mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-25 02:41:21 +01:00
query client cache and better body types
This commit is contained in:
@@ -271,6 +271,7 @@ const FormRow = memo(function FormRow({
|
||||
onChange={handleChangeEnabled}
|
||||
/>
|
||||
<div
|
||||
onDragStart={(e) => e.preventDefault()}
|
||||
className={classnames(
|
||||
'grid items-center',
|
||||
'@xs:gap-2 @xs:!grid-rows-1 @xs:!grid-cols-[minmax(0,1fr)_minmax(0,1fr)]',
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
.tab-content {
|
||||
&[data-state="inactive"] {
|
||||
@apply hidden;
|
||||
}
|
||||
}
|
||||
@@ -7,9 +7,7 @@ import type { RadioDropdownProps } from '../RadioDropdown';
|
||||
import { RadioDropdown } from '../RadioDropdown';
|
||||
import { HStack } from '../Stacks';
|
||||
|
||||
import './Tabs.css';
|
||||
|
||||
export type TabItem<T> = {
|
||||
export type TabItem<T = string> = {
|
||||
value: string;
|
||||
label: string;
|
||||
options?: Omit<RadioDropdownProps<T>, 'children'>;
|
||||
@@ -37,14 +35,18 @@ export function Tabs<T>({
|
||||
const ref = useRef<HTMLDivElement | null>(null);
|
||||
|
||||
const handleTabChange = (value: string) => {
|
||||
const tabs = ref.current?.querySelectorAll(`[data-tab]`);
|
||||
const tabs = ref.current?.querySelectorAll<HTMLDivElement>(`[data-tab]`);
|
||||
for (const tab of tabs ?? []) {
|
||||
const v = tab.getAttribute('data-tab');
|
||||
if (v === value) {
|
||||
tab.setAttribute('tabindex', '-1');
|
||||
tab.setAttribute('data-state', 'active');
|
||||
tab.setAttribute('aria-hidden', 'false');
|
||||
tab.style.display = 'block';
|
||||
} else {
|
||||
tab.setAttribute('data-state', 'inactive');
|
||||
tab.setAttribute('aria-hidden', 'true');
|
||||
tab.style.display = 'none';
|
||||
}
|
||||
}
|
||||
onChangeValue(value);
|
||||
|
||||
Reference in New Issue
Block a user