@astryxdesign/core 0.7.2-canary.fdd384f → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +156 -2
- package/README.md +4 -4
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +8 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +4 -1
- package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
- package/dist/Chat/ChatLayoutScrollButton.js +1 -0
- package/dist/CheckboxList/CheckboxList.d.ts +1 -1
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +6 -2
- package/dist/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +38 -110
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenuGroup.d.ts +6 -4
- package/dist/DropdownMenu/DropdownMenuGroup.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuGroup.js +4 -3
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +1 -1
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts +24 -0
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts.map +1 -0
- package/dist/DropdownMenu/lazyMenuBottomSheet.js +46 -0
- package/dist/DropdownMenu/menuRegionStops.d.ts +38 -0
- package/dist/DropdownMenu/menuRegionStops.d.ts.map +1 -0
- package/dist/DropdownMenu/menuRegionStops.js +131 -0
- package/dist/FormLayout/FormLayout.d.ts +5 -4
- package/dist/FormLayout/FormLayout.d.ts.map +1 -1
- package/dist/FormLayout/FormLayout.js +1 -1
- package/dist/FormLayout/FormLayoutContext.d.ts +3 -3
- package/dist/FormLayout/FormLayoutContext.js +3 -3
- package/dist/Grid/Grid.d.ts +8 -7
- package/dist/Grid/Grid.d.ts.map +1 -1
- package/dist/Grid/Grid.js +5 -4
- package/dist/Grid/GridSpan.d.ts +1 -1
- package/dist/Markdown/parser.d.ts.map +1 -1
- package/dist/Markdown/parser.js +8 -2
- package/dist/Markdown/plugins/headingLinks.d.ts.map +1 -1
- package/dist/Markdown/plugins/headingLinks.js +9 -1
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +5 -0
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +45 -11
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +6 -2
- package/dist/Token/Token.js +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +2 -0
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +2 -0
- package/dist/astryx.css +1 -1
- package/dist/reset.a11y.chromium.spec.js +50 -1
- package/docs.mjs +4 -4
- package/package.json +4 -4
- package/scripts/agent-doc-state.mjs +66 -6
- package/scripts/postinstall.mjs +44 -3
- package/src/Avatar/Avatar.tsx +11 -2
- package/src/AvatarGroup/AvatarGroupOverflow.test.tsx +24 -1
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +2 -0
- package/src/Chat/ChatLayoutScrollButton.test.tsx +13 -0
- package/src/Chat/ChatLayoutScrollButton.tsx +4 -2
- package/src/Chat/__tests__/ChatLayoutScrollButton.a11y.chromium.spec.ts +64 -19
- package/src/CheckboxList/CheckboxList.fr10.test.tsx +29 -2
- package/src/CheckboxList/CheckboxList.tsx +4 -1
- package/src/Code/Code.doc.mjs +1 -0
- package/src/CommandPalette/CommandPalette.doc.mjs +2 -0
- package/src/ContextMenu/ContextMenu.test.tsx +12 -2
- package/src/Drawer/Drawer.doc.mjs +1 -0
- package/src/DropdownMenu/DropdownMenu.ssr.test.tsx +57 -0
- package/src/DropdownMenu/DropdownMenu.test.tsx +17 -5
- package/src/DropdownMenu/DropdownMenu.tsx +43 -142
- package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +1 -1
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +1 -1
- package/src/DropdownMenu/DropdownMenuGroup.doc.mjs +169 -10
- package/src/DropdownMenu/DropdownMenuGroup.tsx +6 -4
- package/src/DropdownMenu/DropdownMenuLazySheet.test.tsx +126 -0
- package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +1 -1
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +1 -1
- package/src/DropdownMenu/__tests__/DropdownMenuGroupAudit.a11y.chromium.spec.ts +334 -0
- package/src/DropdownMenu/__tests__/warmMenuBottomSheet.tsx +43 -0
- package/src/DropdownMenu/lazyMenuBottomSheet.ts +71 -0
- package/src/DropdownMenu/menuRegionStops.ts +167 -0
- package/src/Field/FieldLabel.doc.mjs +133 -26
- package/src/Field/FieldLabel.spec.md +172 -0
- package/src/Field/__tests__/FieldLabelAudit.a11y.chromium.spec.ts +296 -0
- package/src/FormLayout/FormLayout.doc.mjs +6 -3
- package/src/FormLayout/FormLayout.spec.md +192 -0
- package/src/FormLayout/FormLayout.test.tsx +15 -0
- package/src/FormLayout/FormLayout.tsx +7 -6
- package/src/FormLayout/FormLayoutContext.ts +3 -3
- package/src/Grid/Grid.doc.mjs +7 -1
- package/src/Grid/Grid.spec.md +93 -113
- package/src/Grid/Grid.test.tsx +22 -0
- package/src/Grid/Grid.tsx +10 -9
- package/src/Grid/GridSpan.doc.mjs +3 -3
- package/src/Grid/GridSpan.tsx +1 -1
- package/src/Icon/Icon.doc.mjs +36 -0
- package/src/Indicator/Indicator.doc.mjs +3 -3
- package/src/Layout/LayoutHeader.doc.mjs +5 -0
- package/src/Markdown/parser.ts +8 -2
- package/src/Markdown/plugins/headingLinks.ts +9 -1
- package/src/MetadataList/MetadataList.doc.mjs +1 -1
- package/src/MoreMenu/MoreMenu.test.tsx +5 -1
- package/src/PowerSearch/PowerSearch.test.tsx +62 -0
- package/src/PowerSearch/PowerSearch.tsx +9 -0
- package/src/PowerSearch/PowerSearchValueEditor.test.tsx +71 -0
- package/src/PowerSearch/PowerSearchValueEditor.tsx +45 -0
- package/src/ProgressBar/ProgressBar.doc.mjs +1 -0
- package/src/Resizable/useResizable.doc.mjs +2 -0
- package/src/ScrollableArea/ScrollableArea.doc.mjs +1 -1
- package/src/SideNav/SideNav.spec.md +227 -0
- package/src/SideNav/SideNav.test.tsx +41 -0
- package/src/SideNav/SideNavItem.tsx +5 -2
- package/src/Spinner/Spinner.doc.mjs +1 -1
- package/src/Table/Table.spec.md +6 -1
- package/src/Table/plugins/activation/useTableActivation.spec.md +254 -0
- package/src/Timestamp/Timestamp.doc.mjs +1 -1
- package/src/ToggleButton/ToggleButtonGroup.doc.mjs +4 -0
- package/src/Token/Token.tsx +1 -1
- package/src/Token/__tests__/TokenRemoveTarget.a11y.chromium.spec.ts +86 -0
- package/src/Toolbar/Toolbar.test.tsx +0 -8
- package/src/Toolbar/__tests__/Toolbar.a11y.chromium.spec.ts +163 -0
- package/src/Toolbar/__tests__/Toolbar.a11y.renders.tsx +63 -0
- package/src/Toolbar/__tests__/Toolbar.a11y.states.ts +142 -0
- package/src/Toolbar/__tests__/Toolbar.a11y.test.tsx +126 -0
- package/src/TopNav/TopNavMegaMenu.test.tsx +25 -0
- package/src/TopNav/TopNavMegaMenu.tsx +2 -0
- package/src/TopNav/TopNavMenu.test.tsx +27 -1
- package/src/TopNav/TopNavMenu.tsx +2 -0
- package/src/postinstall.test.mjs +79 -0
- package/src/reset.a11y.chromium.spec.ts +52 -1
- package/src/reset.css +9 -0
- package/src/reset.test.ts +11 -0
- package/src/unicodePropertyEscapes.source-build.test.mjs +69 -0
|
@@ -552,6 +552,68 @@ describe('PowerSearch', () => {
|
|
|
552
552
|
});
|
|
553
553
|
});
|
|
554
554
|
|
|
555
|
+
describe('filter token focus', () => {
|
|
556
|
+
it('opens the editor with the mouse without opening search suggestions', async () => {
|
|
557
|
+
const user = userEvent.setup();
|
|
558
|
+
render(
|
|
559
|
+
<PowerSearch
|
|
560
|
+
config={config}
|
|
561
|
+
filters={[
|
|
562
|
+
{
|
|
563
|
+
field: 'status',
|
|
564
|
+
operator: 'is',
|
|
565
|
+
value: {type: 'enum', value: 'open'},
|
|
566
|
+
},
|
|
567
|
+
]}
|
|
568
|
+
onChange={() => {}}
|
|
569
|
+
/>,
|
|
570
|
+
);
|
|
571
|
+
const input = screen.getByRole('combobox', {name: 'Search'});
|
|
572
|
+
|
|
573
|
+
await user.pointer({
|
|
574
|
+
target: screen.getByText('Status: is'),
|
|
575
|
+
keys: '[MouseLeft>]',
|
|
576
|
+
});
|
|
577
|
+
expect(input).not.toHaveFocus();
|
|
578
|
+
expect(input).toHaveAttribute('aria-expanded', 'false');
|
|
579
|
+
expect(
|
|
580
|
+
screen.queryByRole('button', {name: 'Apply', hidden: true}),
|
|
581
|
+
).toBeNull();
|
|
582
|
+
|
|
583
|
+
await user.pointer({keys: '[/MouseLeft]'});
|
|
584
|
+
expect(
|
|
585
|
+
await screen.findByRole('button', {name: 'Apply', hidden: true}),
|
|
586
|
+
).toBeInTheDocument();
|
|
587
|
+
});
|
|
588
|
+
|
|
589
|
+
it('preserves search entry and token editing with the keyboard', async () => {
|
|
590
|
+
const user = userEvent.setup();
|
|
591
|
+
render(
|
|
592
|
+
<PowerSearch
|
|
593
|
+
config={config}
|
|
594
|
+
filters={[
|
|
595
|
+
{
|
|
596
|
+
field: 'status',
|
|
597
|
+
operator: 'is',
|
|
598
|
+
value: {type: 'enum', value: 'open'},
|
|
599
|
+
},
|
|
600
|
+
]}
|
|
601
|
+
onChange={() => {}}
|
|
602
|
+
/>,
|
|
603
|
+
);
|
|
604
|
+
await user.tab();
|
|
605
|
+
expect(screen.getByRole('combobox', {name: 'Search'})).toHaveFocus();
|
|
606
|
+
|
|
607
|
+
await user.tab({shift: true}); // Remove button
|
|
608
|
+
await user.tab({shift: true}); // Token label
|
|
609
|
+
expect(screen.getByRole('button', {name: 'Status: is'})).toHaveFocus();
|
|
610
|
+
await user.keyboard('{Enter}');
|
|
611
|
+
expect(
|
|
612
|
+
await screen.findByRole('button', {name: 'Apply', hidden: true}),
|
|
613
|
+
).toBeInTheDocument();
|
|
614
|
+
});
|
|
615
|
+
});
|
|
616
|
+
|
|
555
617
|
describe('PowerSearch statusVariant forwarding', () => {
|
|
556
618
|
it('defaults to attached (status renders with data-variant="attached")', () => {
|
|
557
619
|
const {container} = render(
|
|
@@ -900,6 +900,15 @@ export function PowerSearch({
|
|
|
900
900
|
size={size}
|
|
901
901
|
icon={tokenIcon}
|
|
902
902
|
endContent={valueContent}
|
|
903
|
+
onMouseDown={
|
|
904
|
+
handleClick
|
|
905
|
+
? e => {
|
|
906
|
+
// Keep a token press from entering Tokenizer's input-focus
|
|
907
|
+
// redirect. Click still edits/removes; Tab entry is unchanged.
|
|
908
|
+
e.preventDefault();
|
|
909
|
+
}
|
|
910
|
+
: undefined
|
|
911
|
+
}
|
|
903
912
|
onClick={
|
|
904
913
|
handleClick
|
|
905
914
|
? (e: React.MouseEvent) => {
|
|
@@ -80,6 +80,77 @@ function createSearchSource(
|
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
describe('isDisabled reaches every built-in value editor', () => {
|
|
84
|
+
const items = [
|
|
85
|
+
{id: 'a', label: 'Alpha'},
|
|
86
|
+
{id: 'b', label: 'Beta'},
|
|
87
|
+
];
|
|
88
|
+
const enumValues = [
|
|
89
|
+
{value: 'a', label: 'Alpha'},
|
|
90
|
+
{value: 'b', label: 'Beta'},
|
|
91
|
+
];
|
|
92
|
+
const cases: ReadonlyArray<[string, OperatorValue]> = [
|
|
93
|
+
['string', {type: 'string'}],
|
|
94
|
+
[
|
|
95
|
+
'string with a search source',
|
|
96
|
+
{type: 'string', searchSource: createSearchSource(items)},
|
|
97
|
+
],
|
|
98
|
+
[
|
|
99
|
+
'string_list',
|
|
100
|
+
{type: 'string_list', searchSource: createSearchSource(items)},
|
|
101
|
+
],
|
|
102
|
+
['integer', {type: 'integer'}],
|
|
103
|
+
['float', {type: 'float'}],
|
|
104
|
+
['time', {type: 'time'}],
|
|
105
|
+
['date_absolute', {type: 'date_absolute'}],
|
|
106
|
+
['date_relative', {type: 'date_relative'}],
|
|
107
|
+
['date_range', {type: 'date_range'}],
|
|
108
|
+
['enum', {type: 'enum', values: enumValues}],
|
|
109
|
+
['enum_list', {type: 'enum_list', values: enumValues}],
|
|
110
|
+
[
|
|
111
|
+
'entity_list',
|
|
112
|
+
{type: 'entity_list', searchSource: createSearchSource(items)},
|
|
113
|
+
],
|
|
114
|
+
];
|
|
115
|
+
|
|
116
|
+
// Every form control the editor renders outside a closed popover (a date
|
|
117
|
+
// input's calendar stays mounted while closed, and its disabled trigger
|
|
118
|
+
// cannot open it), so a disabled built-in editor leaves nothing a person
|
|
119
|
+
// can type into, press, or open.
|
|
120
|
+
function controlsOf(container: HTMLElement): HTMLElement[] {
|
|
121
|
+
return Array.from(
|
|
122
|
+
container.querySelectorAll<HTMLElement>(
|
|
123
|
+
'input, textarea, button, select, [role="combobox"], [contenteditable="true"]',
|
|
124
|
+
),
|
|
125
|
+
).filter(element => {
|
|
126
|
+
const popover = element.closest<HTMLElement>('[popover]');
|
|
127
|
+
return (
|
|
128
|
+
element.getAttribute('aria-hidden') !== 'true' &&
|
|
129
|
+
(popover == null || popover.matches(':popover-open'))
|
|
130
|
+
);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const isUnavailable = (element: HTMLElement) =>
|
|
135
|
+
(element as HTMLInputElement).disabled === true ||
|
|
136
|
+
element.getAttribute('aria-disabled') === 'true';
|
|
137
|
+
|
|
138
|
+
it.each(cases)('%s', (_name, operatorValue) => {
|
|
139
|
+
const {container} = render(
|
|
140
|
+
<PowerSearchValueEditor
|
|
141
|
+
operatorValue={operatorValue}
|
|
142
|
+
filterValue={undefined}
|
|
143
|
+
onChange={() => {}}
|
|
144
|
+
config={stubConfig}
|
|
145
|
+
isDisabled
|
|
146
|
+
/>,
|
|
147
|
+
);
|
|
148
|
+
const controls = controlsOf(container);
|
|
149
|
+
expect(controls.length).toBeGreaterThan(0);
|
|
150
|
+
expect(controls.filter(element => !isUnavailable(element))).toEqual([]);
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
|
|
83
154
|
// =============================================================================
|
|
84
155
|
// #1103 — StringEditor ignores searchSource
|
|
85
156
|
// =============================================================================
|
|
@@ -105,12 +105,14 @@ function StringEditor({
|
|
|
105
105
|
onChange,
|
|
106
106
|
onEnter: _onEnter,
|
|
107
107
|
maxMenuItems,
|
|
108
|
+
isDisabled,
|
|
108
109
|
}: {
|
|
109
110
|
operatorValue: OperatorValue & {type: 'string'};
|
|
110
111
|
filterValue: FilterValue | undefined;
|
|
111
112
|
onChange: (value: FilterValue, shouldSave?: boolean) => void;
|
|
112
113
|
onEnter?: () => void;
|
|
113
114
|
maxMenuItems?: number;
|
|
115
|
+
isDisabled?: boolean;
|
|
114
116
|
}) {
|
|
115
117
|
const t = useTranslator();
|
|
116
118
|
const currentValue = filterValue?.type === 'string' ? filterValue.value : '';
|
|
@@ -126,6 +128,7 @@ function StringEditor({
|
|
|
126
128
|
<Typeahead
|
|
127
129
|
label={t('@astryx.powersearch.valueEditor.value')}
|
|
128
130
|
isLabelHidden
|
|
131
|
+
isDisabled={isDisabled}
|
|
129
132
|
searchSource={operatorValue.searchSource}
|
|
130
133
|
value={selectedItem}
|
|
131
134
|
onChange={item => {
|
|
@@ -146,6 +149,7 @@ function StringEditor({
|
|
|
146
149
|
<TextInput
|
|
147
150
|
label={t('@astryx.powersearch.valueEditor.value')}
|
|
148
151
|
isLabelHidden
|
|
152
|
+
isDisabled={isDisabled}
|
|
149
153
|
value={currentValue}
|
|
150
154
|
placeholder={t('@astryx.powersearch.valueEditor.enterValuePlaceholder')}
|
|
151
155
|
onChange={(value: string) => {
|
|
@@ -160,11 +164,13 @@ function StringListEditor({
|
|
|
160
164
|
filterValue,
|
|
161
165
|
onChange,
|
|
162
166
|
maxMenuItems,
|
|
167
|
+
isDisabled,
|
|
163
168
|
}: {
|
|
164
169
|
operatorValue: OperatorValue & {type: 'string_list'};
|
|
165
170
|
filterValue: FilterValue | undefined;
|
|
166
171
|
onChange: (value: FilterValue) => void;
|
|
167
172
|
maxMenuItems?: number;
|
|
173
|
+
isDisabled?: boolean;
|
|
168
174
|
}) {
|
|
169
175
|
const t = useTranslator();
|
|
170
176
|
const currentValue: SearchableItem[] = useMemo(() => {
|
|
@@ -194,6 +200,7 @@ function StringListEditor({
|
|
|
194
200
|
<Tokenizer
|
|
195
201
|
label={t('@astryx.powersearch.valueEditor.values')}
|
|
196
202
|
isLabelHidden
|
|
203
|
+
isDisabled={isDisabled}
|
|
197
204
|
searchSource={source}
|
|
198
205
|
value={currentValue}
|
|
199
206
|
onChange={items => {
|
|
@@ -278,11 +285,13 @@ function IntegerEditor({
|
|
|
278
285
|
filterValue,
|
|
279
286
|
onChange,
|
|
280
287
|
onEnter,
|
|
288
|
+
isDisabled,
|
|
281
289
|
}: {
|
|
282
290
|
operatorValue: OperatorValue & {type: 'integer'};
|
|
283
291
|
filterValue: FilterValue | undefined;
|
|
284
292
|
onChange: (value: FilterValue, shouldSave?: boolean) => void;
|
|
285
293
|
onEnter?: () => void;
|
|
294
|
+
isDisabled?: boolean;
|
|
286
295
|
}) {
|
|
287
296
|
const t = useTranslator();
|
|
288
297
|
const currentValue =
|
|
@@ -300,6 +309,7 @@ function IntegerEditor({
|
|
|
300
309
|
<NumberInput
|
|
301
310
|
label={t('@astryx.powersearch.valueEditor.value')}
|
|
302
311
|
isLabelHidden
|
|
312
|
+
isDisabled={isDisabled}
|
|
303
313
|
value={currentValue ?? null}
|
|
304
314
|
onChange={handlers.handleChange}
|
|
305
315
|
onFocus={handlers.handleFocus}
|
|
@@ -320,11 +330,13 @@ function FloatEditor({
|
|
|
320
330
|
filterValue,
|
|
321
331
|
onChange,
|
|
322
332
|
onEnter,
|
|
333
|
+
isDisabled,
|
|
323
334
|
}: {
|
|
324
335
|
operatorValue: OperatorValue & {type: 'float'};
|
|
325
336
|
filterValue: FilterValue | undefined;
|
|
326
337
|
onChange: (value: FilterValue, shouldSave?: boolean) => void;
|
|
327
338
|
onEnter?: () => void;
|
|
339
|
+
isDisabled?: boolean;
|
|
328
340
|
}) {
|
|
329
341
|
const t = useTranslator();
|
|
330
342
|
const currentValue =
|
|
@@ -342,6 +354,7 @@ function FloatEditor({
|
|
|
342
354
|
<NumberInput
|
|
343
355
|
label={t('@astryx.powersearch.valueEditor.value')}
|
|
344
356
|
isLabelHidden
|
|
357
|
+
isDisabled={isDisabled}
|
|
345
358
|
value={currentValue ?? null}
|
|
346
359
|
onChange={handlers.handleChange}
|
|
347
360
|
onFocus={handlers.handleFocus}
|
|
@@ -360,10 +373,12 @@ function TimeEditor({
|
|
|
360
373
|
operatorValue,
|
|
361
374
|
filterValue,
|
|
362
375
|
onChange,
|
|
376
|
+
isDisabled,
|
|
363
377
|
}: {
|
|
364
378
|
operatorValue: OperatorValue & {type: 'time'};
|
|
365
379
|
filterValue: FilterValue | undefined;
|
|
366
380
|
onChange: (value: FilterValue) => void;
|
|
381
|
+
isDisabled?: boolean;
|
|
367
382
|
}) {
|
|
368
383
|
const t = useTranslator();
|
|
369
384
|
const currentValue =
|
|
@@ -375,6 +390,7 @@ function TimeEditor({
|
|
|
375
390
|
<TimeInput
|
|
376
391
|
label={t('@astryx.powersearch.valueEditor.time')}
|
|
377
392
|
isLabelHidden
|
|
393
|
+
isDisabled={isDisabled}
|
|
378
394
|
value={currentValue}
|
|
379
395
|
onChange={value => {
|
|
380
396
|
if (value != null) {
|
|
@@ -390,10 +406,12 @@ function TimeEditor({
|
|
|
390
406
|
function DateAbsoluteEditor({
|
|
391
407
|
filterValue,
|
|
392
408
|
onChange,
|
|
409
|
+
isDisabled,
|
|
393
410
|
}: {
|
|
394
411
|
operatorValue: OperatorValue & {type: 'date_absolute'};
|
|
395
412
|
filterValue: FilterValue | undefined;
|
|
396
413
|
onChange: (value: FilterValue) => void;
|
|
414
|
+
isDisabled?: boolean;
|
|
397
415
|
}) {
|
|
398
416
|
const t = useTranslator();
|
|
399
417
|
// Convert unixSeconds to ISO date string for the date input
|
|
@@ -409,6 +427,7 @@ function DateAbsoluteEditor({
|
|
|
409
427
|
<DateInput
|
|
410
428
|
label={t('@astryx.powersearch.valueEditor.date')}
|
|
411
429
|
isLabelHidden
|
|
430
|
+
isDisabled={isDisabled}
|
|
412
431
|
value={currentValue}
|
|
413
432
|
onChange={value => {
|
|
414
433
|
if (value != null) {
|
|
@@ -424,10 +443,12 @@ function DateRelativeEditor({
|
|
|
424
443
|
operatorValue,
|
|
425
444
|
filterValue,
|
|
426
445
|
onChange,
|
|
446
|
+
isDisabled,
|
|
427
447
|
}: {
|
|
428
448
|
operatorValue: OperatorValue & {type: 'date_relative'};
|
|
429
449
|
filterValue: FilterValue | undefined;
|
|
430
450
|
onChange: (value: FilterValue, shouldSave?: boolean) => void;
|
|
451
|
+
isDisabled?: boolean;
|
|
431
452
|
}) {
|
|
432
453
|
const t = useTranslator();
|
|
433
454
|
const currentValue =
|
|
@@ -469,6 +490,7 @@ function DateRelativeEditor({
|
|
|
469
490
|
<Selector
|
|
470
491
|
label={t('@astryx.powersearch.valueEditor.relativeDate')}
|
|
471
492
|
isLabelHidden
|
|
493
|
+
isDisabled={isDisabled}
|
|
472
494
|
options={options}
|
|
473
495
|
value={currentValue}
|
|
474
496
|
onChange={value => {
|
|
@@ -481,10 +503,12 @@ function DateRelativeEditor({
|
|
|
481
503
|
function DateRangeEditor({
|
|
482
504
|
filterValue,
|
|
483
505
|
onChange,
|
|
506
|
+
isDisabled,
|
|
484
507
|
}: {
|
|
485
508
|
operatorValue: OperatorValue & {type: 'date_range'};
|
|
486
509
|
filterValue: FilterValue | undefined;
|
|
487
510
|
onChange: (value: FilterValue) => void;
|
|
511
|
+
isDisabled?: boolean;
|
|
488
512
|
}) {
|
|
489
513
|
const t = useTranslator();
|
|
490
514
|
const currentValue = useMemo<DateRange | null>(() => {
|
|
@@ -534,6 +558,7 @@ function DateRangeEditor({
|
|
|
534
558
|
<DateRangeInput
|
|
535
559
|
label={t('@astryx.powersearch.valueEditor.dateRange')}
|
|
536
560
|
isLabelHidden
|
|
561
|
+
isDisabled={isDisabled}
|
|
537
562
|
value={currentValue}
|
|
538
563
|
onChange={handleChange}
|
|
539
564
|
hasClear={false}
|
|
@@ -546,10 +571,12 @@ function EnumEditor({
|
|
|
546
571
|
operatorValue,
|
|
547
572
|
filterValue,
|
|
548
573
|
onChange,
|
|
574
|
+
isDisabled,
|
|
549
575
|
}: {
|
|
550
576
|
operatorValue: OperatorValue & {type: 'enum'};
|
|
551
577
|
filterValue: FilterValue | undefined;
|
|
552
578
|
onChange: (value: FilterValue, shouldSave?: boolean) => void;
|
|
579
|
+
isDisabled?: boolean;
|
|
553
580
|
}) {
|
|
554
581
|
const t = useTranslator();
|
|
555
582
|
const currentValue =
|
|
@@ -568,6 +595,7 @@ function EnumEditor({
|
|
|
568
595
|
<Selector
|
|
569
596
|
label={t('@astryx.powersearch.valueEditor.value')}
|
|
570
597
|
isLabelHidden
|
|
598
|
+
isDisabled={isDisabled}
|
|
571
599
|
options={options}
|
|
572
600
|
value={currentValue}
|
|
573
601
|
onChange={value => {
|
|
@@ -581,10 +609,12 @@ function EnumListEditor({
|
|
|
581
609
|
operatorValue,
|
|
582
610
|
filterValue,
|
|
583
611
|
onChange,
|
|
612
|
+
isDisabled,
|
|
584
613
|
}: {
|
|
585
614
|
operatorValue: OperatorValue & {type: 'enum_list'};
|
|
586
615
|
filterValue: FilterValue | undefined;
|
|
587
616
|
onChange: (value: FilterValue) => void;
|
|
617
|
+
isDisabled?: boolean;
|
|
588
618
|
}) {
|
|
589
619
|
const t = useTranslator();
|
|
590
620
|
const items = useMemo(
|
|
@@ -608,6 +638,7 @@ function EnumListEditor({
|
|
|
608
638
|
<Tokenizer
|
|
609
639
|
label={t('@astryx.powersearch.valueEditor.values')}
|
|
610
640
|
isLabelHidden
|
|
641
|
+
isDisabled={isDisabled}
|
|
611
642
|
searchSource={source}
|
|
612
643
|
value={currentValue}
|
|
613
644
|
onChange={selectedItems => {
|
|
@@ -632,11 +663,13 @@ function EntityListEditor({
|
|
|
632
663
|
filterValue,
|
|
633
664
|
onChange,
|
|
634
665
|
maxMenuItems,
|
|
666
|
+
isDisabled,
|
|
635
667
|
}: {
|
|
636
668
|
operatorValue: OperatorValue & {type: 'entity_list'};
|
|
637
669
|
filterValue: FilterValue | undefined;
|
|
638
670
|
onChange: (value: FilterValue) => void;
|
|
639
671
|
maxMenuItems?: number;
|
|
672
|
+
isDisabled?: boolean;
|
|
640
673
|
}) {
|
|
641
674
|
const t = useTranslator();
|
|
642
675
|
const source = useMemo<SearchSource<SearchableItem>>(() => {
|
|
@@ -665,6 +698,7 @@ function EntityListEditor({
|
|
|
665
698
|
<Tokenizer
|
|
666
699
|
label={t('@astryx.powersearch.valueEditor.entities')}
|
|
667
700
|
isLabelHidden
|
|
701
|
+
isDisabled={isDisabled}
|
|
668
702
|
searchSource={source}
|
|
669
703
|
value={currentValue}
|
|
670
704
|
onChange={items => {
|
|
@@ -738,6 +772,7 @@ export function PowerSearchValueEditor({
|
|
|
738
772
|
case 'string':
|
|
739
773
|
return (
|
|
740
774
|
<StringEditor
|
|
775
|
+
isDisabled={isDisabled}
|
|
741
776
|
operatorValue={operatorValue}
|
|
742
777
|
filterValue={filterValue}
|
|
743
778
|
onChange={onChange}
|
|
@@ -749,6 +784,7 @@ export function PowerSearchValueEditor({
|
|
|
749
784
|
case 'string_list':
|
|
750
785
|
return (
|
|
751
786
|
<StringListEditor
|
|
787
|
+
isDisabled={isDisabled}
|
|
752
788
|
operatorValue={operatorValue}
|
|
753
789
|
filterValue={filterValue}
|
|
754
790
|
onChange={onChange}
|
|
@@ -759,6 +795,7 @@ export function PowerSearchValueEditor({
|
|
|
759
795
|
case 'integer':
|
|
760
796
|
return (
|
|
761
797
|
<IntegerEditor
|
|
798
|
+
isDisabled={isDisabled}
|
|
762
799
|
operatorValue={operatorValue}
|
|
763
800
|
filterValue={filterValue}
|
|
764
801
|
onChange={onChange}
|
|
@@ -769,6 +806,7 @@ export function PowerSearchValueEditor({
|
|
|
769
806
|
case 'float':
|
|
770
807
|
return (
|
|
771
808
|
<FloatEditor
|
|
809
|
+
isDisabled={isDisabled}
|
|
772
810
|
operatorValue={operatorValue}
|
|
773
811
|
filterValue={filterValue}
|
|
774
812
|
onChange={onChange}
|
|
@@ -779,6 +817,7 @@ export function PowerSearchValueEditor({
|
|
|
779
817
|
case 'time':
|
|
780
818
|
return (
|
|
781
819
|
<TimeEditor
|
|
820
|
+
isDisabled={isDisabled}
|
|
782
821
|
operatorValue={operatorValue}
|
|
783
822
|
filterValue={filterValue}
|
|
784
823
|
onChange={onChange}
|
|
@@ -788,6 +827,7 @@ export function PowerSearchValueEditor({
|
|
|
788
827
|
case 'date_absolute':
|
|
789
828
|
return (
|
|
790
829
|
<DateAbsoluteEditor
|
|
830
|
+
isDisabled={isDisabled}
|
|
791
831
|
operatorValue={operatorValue}
|
|
792
832
|
filterValue={filterValue}
|
|
793
833
|
onChange={onChange}
|
|
@@ -797,6 +837,7 @@ export function PowerSearchValueEditor({
|
|
|
797
837
|
case 'date_relative':
|
|
798
838
|
return (
|
|
799
839
|
<DateRelativeEditor
|
|
840
|
+
isDisabled={isDisabled}
|
|
800
841
|
operatorValue={operatorValue}
|
|
801
842
|
filterValue={filterValue}
|
|
802
843
|
onChange={onChange}
|
|
@@ -806,6 +847,7 @@ export function PowerSearchValueEditor({
|
|
|
806
847
|
case 'date_range':
|
|
807
848
|
return (
|
|
808
849
|
<DateRangeEditor
|
|
850
|
+
isDisabled={isDisabled}
|
|
809
851
|
operatorValue={operatorValue}
|
|
810
852
|
filterValue={filterValue}
|
|
811
853
|
onChange={onChange}
|
|
@@ -815,6 +857,7 @@ export function PowerSearchValueEditor({
|
|
|
815
857
|
case 'enum':
|
|
816
858
|
return (
|
|
817
859
|
<EnumEditor
|
|
860
|
+
isDisabled={isDisabled}
|
|
818
861
|
operatorValue={operatorValue}
|
|
819
862
|
filterValue={filterValue}
|
|
820
863
|
onChange={onChange}
|
|
@@ -824,6 +867,7 @@ export function PowerSearchValueEditor({
|
|
|
824
867
|
case 'enum_list':
|
|
825
868
|
return (
|
|
826
869
|
<EnumListEditor
|
|
870
|
+
isDisabled={isDisabled}
|
|
827
871
|
operatorValue={operatorValue}
|
|
828
872
|
filterValue={filterValue}
|
|
829
873
|
onChange={onChange}
|
|
@@ -833,6 +877,7 @@ export function PowerSearchValueEditor({
|
|
|
833
877
|
case 'entity_list':
|
|
834
878
|
return (
|
|
835
879
|
<EntityListEditor
|
|
880
|
+
isDisabled={isDisabled}
|
|
836
881
|
operatorValue={operatorValue}
|
|
837
882
|
filterValue={filterValue}
|
|
838
883
|
onChange={onChange}
|
|
@@ -5,7 +5,7 @@ export const docs = {
|
|
|
5
5
|
name: 'ScrollableArea',
|
|
6
6
|
displayName: 'Scrollable Area',
|
|
7
7
|
category: 'Layout',
|
|
8
|
-
keywords: ['scroll', 'overflow', 'viewport', 'logical axis', 'keyboard', 'overscroll', 'sticky', 'scrollbar', 'padding', 'full bleed'],
|
|
8
|
+
keywords: ['scroll', 'overflow', 'viewport', 'logical axis', 'keyboard', 'overscroll', 'sticky', 'scrollbar', 'padding', 'full bleed', 'scrollarea', 'scrollview'],
|
|
9
9
|
usage: {
|
|
10
10
|
description: 'Provides a native scroll viewport and a real observed content box. The viewport enters the tab order only while a requested logical axis is effectively scrollable, and containment applies only to effective axes.',
|
|
11
11
|
bestPractices: [
|