@iress-oss/ids-components 6.3.0 → 6.4.1
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/.ai/components/modal.md +6 -1
- package/.ai/components/select.md +22 -0
- package/.ai/skills/ui-translation.md +4 -4
- package/dist/Autocomplete-CfNw4UXr.js +328 -0
- package/dist/{Button-BY2qzshw.js → Button-x1_YRAyD.js} +3 -3
- package/dist/Shadow-CUpIJ8Pl.js +59 -0
- package/dist/Slideout-DuFGU2C8.js +197 -0
- package/dist/{Table.styles-CKD_vWqh.js → Table.styles-CeUw7q9b.js} +3 -3
- package/dist/{TableProvider-C8bDaWu2.js → TableProvider-DLIQWfLq.js} +1 -1
- package/dist/{TableRows-DXoiLfwt.js → TableRows-RGC4_RRZ.js} +8 -6
- package/dist/{Text.styles-DUvXBRio.js → Text.styles-CVKI4cU7.js} +2 -2
- package/dist/components/Alert/Alert.js +12 -8
- package/dist/components/Alert/Alert.styles.js +1 -1
- package/dist/components/Autocomplete/Autocomplete.js +1 -1
- package/dist/components/Autocomplete/Autocomplete.styles.js +1 -1
- package/dist/components/Autocomplete/components/AutocompleteInstructions.js +7 -4
- package/dist/components/Autocomplete/hooks/useAutocompleteSearch.js +1 -1
- package/dist/components/Autocomplete/index.js +2 -2
- package/dist/components/Avatar/Avatar.js +2 -2
- package/dist/components/Avatar/Avatar.styles.js +1 -1
- package/dist/components/Avatar/AvatarGroup/AvatarGroup.js +2 -2
- package/dist/components/Avatar/AvatarGroup/AvatarGroup.styles.js +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/CloseButton/CloseButton.js +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.js +3 -3
- package/dist/components/ButtonGroup/ButtonGroup.styles.js +1 -1
- package/dist/components/Card/Card.js +4 -4
- package/dist/components/Card/Card.styles.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +3 -3
- package/dist/components/Checkbox/Checkbox.styles.js +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.styles.js +1 -1
- package/dist/components/CheckboxMark/CheckboxMark.js +2 -2
- package/dist/components/CheckboxMark/CheckboxMark.styles.js +1 -1
- package/dist/components/Col/Col.js +1 -1
- package/dist/components/Col/Col.styles.js +1 -1
- package/dist/components/Container/Container.js +1 -1
- package/dist/components/Container/Container.styles.js +1 -1
- package/dist/components/Divider/Divider.js +2 -2
- package/dist/components/Divider/Divider.styles.js +1 -1
- package/dist/components/Expander/Expander.js +3 -3
- package/dist/components/Expander/Expander.styles.js +1 -1
- package/dist/components/ExpanderChevron/ExpanderChevron.styles.js +1 -1
- package/dist/components/Field/Field.js +3 -3
- package/dist/components/Field/Field.styles.js +1 -1
- package/dist/components/Field/components/FieldFooter.js +2 -2
- package/dist/components/Field/components/FieldHint.js +3 -3
- package/dist/components/FieldGroup/FieldGroup.js +3 -3
- package/dist/components/FieldGroup/FieldGroup.styles.js +1 -1
- package/dist/components/Hide/Hide.js +1 -1
- package/dist/components/Icon/Icon.js +4 -4
- package/dist/components/Icon/Icon.styles.js +1 -1
- package/dist/components/Image/Image.js +1 -1
- package/dist/components/Image/Image.styles.js +1 -1
- package/dist/components/Inline/Inline.js +1 -1
- package/dist/components/Inline/Inline.styles.js +1 -1
- package/dist/components/Input/Input.js +85 -79
- package/dist/components/Input/Input.styles.js +1 -1
- package/dist/components/Input/InputBase/InputBase.js +1 -1
- package/dist/components/Label/Label.styles.js +1 -1
- package/dist/components/Label/LabelBase/LabelBase.js +3 -3
- package/dist/components/Link/Link.js +4 -4
- package/dist/components/Link/Link.styles.js +1 -1
- package/dist/components/Menu/Menu.js +2 -2
- package/dist/components/Menu/Menu.styles.js +1 -1
- package/dist/components/Menu/MenuGroup/MenuGroup.styles.js +1 -1
- package/dist/components/Menu/MenuItem/MenuItem.js +121 -121
- package/dist/components/Menu/MenuItem/MenuItem.styles.js +1 -1
- package/dist/components/Menu/MenuText/MenuText.js +2 -2
- package/dist/components/Modal/Modal.d.ts +3 -2
- package/dist/components/Modal/Modal.js +46 -46
- package/dist/components/Modal/Modal.styles.js +1 -1
- package/dist/components/Pill/Pill.js +3 -3
- package/dist/components/Pill/Pill.styles.js +1 -1
- package/dist/components/Placeholder/Placeholder.styles.js +1 -1
- package/dist/components/Popover/InputPopover/InputPopover.js +1 -1
- package/dist/components/Popover/Popover.js +3 -3
- package/dist/components/Popover/Popover.styles.js +1 -1
- package/dist/components/Popover/components/PopoverContent.js +2 -2
- package/dist/components/Popover/helpers/handlePopoverTabKey.js +2 -2
- package/dist/components/Popover/hooks/useFloatingPopover.js +66 -66
- package/dist/components/Popover/hooks/usePopoverItem.js +1 -1
- package/dist/components/Popover/hooks/usePopoverNavigation.js +1 -1
- package/dist/components/Progress/Progress.js +3 -3
- package/dist/components/Progress/Progress.styles.js +1 -1
- package/dist/components/Radio/Radio.js +3 -3
- package/dist/components/Radio/Radio.styles.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.styles.js +1 -1
- package/dist/components/RadioMark/RadioMark.js +2 -2
- package/dist/components/RadioMark/RadioMark.styles.js +1 -1
- package/dist/components/Readonly/Readonly.js +3 -3
- package/dist/components/Readonly/Readonly.styles.js +1 -1
- package/dist/components/Row/Row.js +1 -1
- package/dist/components/Row/Row.styles.js +1 -1
- package/dist/components/Select/Select.d.ts +10 -0
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Select/Select.styles.js +1 -1
- package/dist/components/Select/SelectBody/SelectBody.styles.js +1 -1
- package/dist/components/Select/SelectHeading/SelectHeading.js +1 -1
- package/dist/components/Select/SelectLabel/SelectLabel.styles.js +1 -1
- package/dist/components/Select/SelectMenu/SelectMenu.styles.js +1 -1
- package/dist/components/Select/SelectSearch/SelectSearch.styles.js +1 -1
- package/dist/components/Select/SelectSearchInput/SelectSearchInput.styles.js +1 -1
- package/dist/components/Select/SelectTags/SelectTags.js +1 -1
- package/dist/components/Select/SelectTags/SelectTags.styles.js +1 -1
- package/dist/components/Select/components/NativeSelect.js +2 -2
- package/dist/components/Select/components/NativeSelect.styles.js +1 -1
- package/dist/components/Select/components/SelectOptions.d.ts +2 -2
- package/dist/components/Select/components/SelectOptions.js +89 -74
- package/dist/components/Select/index.js +1 -1
- package/dist/components/Skeleton/Skeleton.styles.js +1 -1
- package/dist/components/SkipLink/SkipLink.js +1 -1
- package/dist/components/SkipLink/SkipLink.styles.js +1 -1
- package/dist/components/Slideout/Slideout.js +1 -1
- package/dist/components/Slideout/Slideout.styles.js +1 -1
- package/dist/components/Slideout/components/SlideoutInner.js +2 -2
- package/dist/components/Slideout/index.js +1 -1
- package/dist/components/Slider/Slider.js +2 -2
- package/dist/components/Slider/Slider.styles.js +1 -1
- package/dist/components/Slider/components/SliderTicks.js +16 -13
- package/dist/components/Spinner/Spinner.styles.js +2 -2
- package/dist/components/Stack/Stack.js +11 -8
- package/dist/components/Stack/Stack.styles.js +1 -1
- package/dist/components/Styled/Styled.js +8 -5
- package/dist/components/TabSet/Tab/Tab.js +2 -2
- package/dist/components/TabSet/Tab/Tab.styles.js +1 -1
- package/dist/components/TabSet/TabSet.js +2 -2
- package/dist/components/TabSet/TabSet.styles.js +1 -1
- package/dist/components/Table/Table.js +1 -1
- package/dist/components/Table/Table.styles.js +1 -1
- package/dist/components/Table/TableBody/TableBody.js +1 -1
- package/dist/components/Table/TableProvider.js +1 -1
- package/dist/components/Table/components/TableEmpty.js +1 -1
- package/dist/components/Table/components/TableFilterButton.js +1 -1
- package/dist/components/Table/components/TableHeader.js +1 -1
- package/dist/components/Table/components/TableHeaderCell.js +1 -1
- package/dist/components/Table/components/TableRows.js +1 -1
- package/dist/components/Table/components/TableSortButton.js +1 -1
- package/dist/components/Table/helpers/composeTableColumnDefs.js +1 -1
- package/dist/components/Table/helpers/composeTableInitialColumnFilters.js +1 -1
- package/dist/components/Table/hooks/useTable.js +1 -1
- package/dist/components/Table/hooks/useTableColumnFilter.js +3 -3
- package/dist/components/Table/hooks/useTableColumnSort.js +1 -1
- package/dist/components/Table/hooks/useTableColumnStyles.js +4 -4
- package/dist/components/Table/index.js +2 -2
- package/dist/components/Tag/Tag.js +2 -2
- package/dist/components/Tag/Tag.styles.js +1 -1
- package/dist/components/TagInput/TagInput.styles.js +1 -1
- package/dist/components/Text/Text.js +9 -6
- package/dist/components/Text/Text.styles.js +1 -1
- package/dist/components/Text/index.js +1 -1
- package/dist/components/Toaster/Toaster.js +2 -2
- package/dist/components/Toaster/Toaster.styles.js +1 -1
- package/dist/components/Toaster/components/Toast/Toast.js +1 -1
- package/dist/components/Toaster/components/Toast/Toast.styles.js +1 -1
- package/dist/components/Toggle/Toggle.js +2 -2
- package/dist/components/Toggle/Toggle.styles.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +16 -16
- package/dist/components/Tooltip/Tooltip.styles.js +1 -1
- package/dist/components/ValidationMessage/ValidationMessage.js +1 -1
- package/dist/components/ValidationMessage/ValidationSummary/ValidationSummary.js +1 -1
- package/dist/{composeTableColumnDefs-DzUn8D5f.js → composeTableColumnDefs-Ds00wPMn.js} +3 -3
- package/dist/{create-recipe-A316lnq3.js → create-recipe-BWTPSpll.js} +2 -2
- package/dist/{css-R34N3rft.js → css-BRrgGHqo.js} +1 -1
- package/dist/{cva-DcOwIar2.js → cva-1V8NmPTA.js} +1 -1
- package/dist/{factory-BKr3zaf6.js → factory-Dbc35N0_.js} +5 -5
- package/dist/{floating-ui.react-TDMXDOBr.js → floating-ui.react-DP-wD-Nz.js} +70 -59
- package/dist/helpers/formatting/formatDateTime.js +3 -3
- package/dist/helpers/label-value/highlightQueryInLabel.js +1 -1
- package/dist/helpers/label-value/searchLabelValues.js +1 -1
- package/dist/helpers/styling/iressCss.js +1 -1
- package/dist/{index.esm-CapMi3wi.js → index.esm-Bl8pnHUv.js} +16 -14
- package/dist/{is-valid-prop-BVyYPT21.js → is-valid-prop-CvqUuuBB.js} +1 -1
- package/dist/{main-TklToXNs.js → main-BY3nH2iz.js} +7 -7
- package/dist/main.js +8 -8
- package/dist/patterns/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/patterns/Breadcrumbs/Breadcrumbs.styles.js +1 -1
- package/dist/patterns/ContextualMenu/ContextualMenu.js +4 -4
- package/dist/patterns/ContextualMenu/ContextualMenu.styles.js +1 -1
- package/dist/patterns/DropdownMenu/DropdownMenu.js +4 -4
- package/dist/patterns/DropdownMenu/DropdownMenu.styles.js +1 -1
- package/dist/patterns/Form/Form.styles.js +1 -1
- package/dist/patterns/Form/FormValidationSummary/FormValidationSummary.js +1 -1
- package/dist/patterns/Form/HookForm/HookForm.js +1 -1
- package/dist/patterns/Loading/Loading.styles.js +1 -1
- package/dist/patterns/Loading/components/ComponentLoading.js +3 -3
- package/dist/patterns/Loading/components/DefaultLoading.js +1 -1
- package/dist/patterns/Loading/components/LongLoading.js +19 -19
- package/dist/patterns/Loading/components/PageLoading.js +1 -1
- package/dist/patterns/Loading/components/StartUpLoading.js +7 -7
- package/dist/patterns/Loading/components/ValidateLoading.js +2 -2
- package/dist/patterns/Shadow/Shadow.js +1 -1
- package/dist/patterns/Shadow/index.js +1 -1
- package/dist/patterns/SideNav/SideNav.js +3 -3
- package/dist/patterns/SideNav/SideNav.styles.js +1 -1
- package/dist/{rolldown-runtime-3b4jIN3o.js → rolldown-runtime-DtPi1Y-2.js} +2 -2
- package/dist/style.css +1 -1
- package/dist/{sva-DGhdmNso.js → sva-CG-TbBow.js} +2 -2
- package/dist/{useAutocompleteSearch-BYzUn7Ag.js → useAutocompleteSearch-m33c4lI7.js} +7 -5
- package/package.json +7 -7
- package/dist/Autocomplete-ZqkibVwt.js +0 -327
- package/dist/Shadow-DAfthdT2.js +0 -57
- package/dist/Slideout-BOH2gwIN.js +0 -194
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as e, c as t, f as n, l as r } from "./css-
|
|
1
|
+
import { a as e, c as t, f as n, l as r } from "./css-BRrgGHqo.js";
|
|
2
2
|
import { t as i } from "./cx-QcEwjve6.js";
|
|
3
|
-
import { n as a } from "./cva-
|
|
3
|
+
import { n as a } from "./cva-1V8NmPTA.js";
|
|
4
4
|
//#region src/styled-system/css/sva.mjs
|
|
5
5
|
function o(o) {
|
|
6
6
|
let s = Object.entries(t(o)).map(([e, t]) => [e, a(t)]), c = o.defaultVariants ?? {}, l = s.reduce((e, [t, n]) => (o.className && (e[t] = n.config.className), e), {});
|
|
@@ -140,11 +140,13 @@ var u = 300, d = 1, f = 250, p = (e) => e instanceof Error && e.message ? e.mess
|
|
|
140
140
|
i
|
|
141
141
|
]),
|
|
142
142
|
handleSync: n((n, r, i, a = !1) => {
|
|
143
|
-
if (!
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
143
|
+
if (!l(r) || a) {
|
|
144
|
+
if (u(r), r.length >= i || a) {
|
|
145
|
+
e.setSearched(!0);
|
|
146
|
+
let i = t(r, n);
|
|
147
|
+
e.updateWithResults(i, r);
|
|
148
|
+
} else e.reset();
|
|
149
|
+
}
|
|
148
150
|
}, [
|
|
149
151
|
e,
|
|
150
152
|
l,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iress-oss/ids-components",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.1",
|
|
4
4
|
"description": "Iress React Component Library",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"typecheck:node": "tsc --noEmit -p tsconfig.node.json"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@iress-oss/ids-theme-preset": "^6.0.
|
|
34
|
+
"@iress-oss/ids-theme-preset": "^6.0.1",
|
|
35
35
|
"@iress-oss/ids-tokens": "^6.0.0",
|
|
36
36
|
"@pandacss/dev": "1.9.1",
|
|
37
37
|
"@testing-library/dom": "10.4.1",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"@vitejs/plugin-react": "^6.0.3",
|
|
47
47
|
"@vitest/coverage-v8": "4.1.10",
|
|
48
48
|
"@vitest/ui": "4.1.10",
|
|
49
|
-
"concurrently": "^
|
|
50
|
-
"dompurify": "^3.4.
|
|
49
|
+
"concurrently": "^10.0.3",
|
|
50
|
+
"dompurify": "^3.4.14",
|
|
51
51
|
"eslint": "10.6.0",
|
|
52
52
|
"eslint-plugin-file-progress": "^4.0.0",
|
|
53
53
|
"eslint-plugin-mdx": "3.8.1",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"jest-axe": "10.0.0",
|
|
60
60
|
"jsdom": "29.1.1",
|
|
61
61
|
"lightningcss": "^1.32.0",
|
|
62
|
-
"postcss": "8.5.
|
|
62
|
+
"postcss": "8.5.26",
|
|
63
63
|
"prettier": "^3.8.2",
|
|
64
64
|
"react": "^19.2.6",
|
|
65
65
|
"react-dom": "^19.2.6",
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
"rimraf": "^6.1.3",
|
|
69
69
|
"storybook": "10.4.6",
|
|
70
70
|
"typescript": "6.0.3",
|
|
71
|
-
"vite": "8.
|
|
71
|
+
"vite": "8.2.2",
|
|
72
72
|
"vite-bundle-visualizer": "^1.2.1",
|
|
73
73
|
"vite-plugin-dts": "5.0.3",
|
|
74
74
|
"vite-plugin-static-copy": "4.1.1",
|
|
75
|
-
"vitest": "4.1.
|
|
75
|
+
"vitest": "4.1.11"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@floating-ui/react": "0.27.19",
|
|
@@ -1,327 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./cx-QcEwjve6.js";
|
|
2
|
-
import { GlobalCSSClass as t } from "./enums.js";
|
|
3
|
-
import { idsLogger as n } from "./helpers/utility/idsLogger.js";
|
|
4
|
-
import { IressIcon as r } from "./components/Icon/Icon.js";
|
|
5
|
-
import { IressText as i } from "./components/Text/Text.js";
|
|
6
|
-
import { propagateTestid as a } from "./helpers/utility/propagateTestid.js";
|
|
7
|
-
import { IressSpinner as o } from "./components/Spinner/Spinner.js";
|
|
8
|
-
import { toArray as s } from "./helpers/formatting/toArray.js";
|
|
9
|
-
import { useControlledState as ee } from "./hooks/useControlledState.js";
|
|
10
|
-
import { useResponsiveProps as te } from "./hooks/useResponsiveProps.js";
|
|
11
|
-
import { IressPopover as ne } from "./components/Popover/Popover.js";
|
|
12
|
-
import { IressInputPopover as re } from "./components/Popover/InputPopover/InputPopover.js";
|
|
13
|
-
import { IressAlert as ie } from "./components/Alert/Alert.js";
|
|
14
|
-
import { autoComplete as c } from "./components/Autocomplete/Autocomplete.styles.js";
|
|
15
|
-
import { getFormControlValueAsStringIfDefined as ae } from "./helpers/form/getFormControlValueAsStringIfDefined.js";
|
|
16
|
-
import { useNoDefaultValueInForms as oe } from "./patterns/Form/hooks/useNoDefaultValueInForms.js";
|
|
17
|
-
import { IressReadonly as se } from "./components/Readonly/Readonly.js";
|
|
18
|
-
import { IressInput as l } from "./components/Input/Input.js";
|
|
19
|
-
import { getValueAsEvent as ce } from "./helpers/form/getValueAsEvent.js";
|
|
20
|
-
import { t as le } from "./useAutocompleteSearch-BYzUn7Ag.js";
|
|
21
|
-
import { AutocompleteInstructions as u } from "./components/Autocomplete/components/AutocompleteInstructions.js";
|
|
22
|
-
import { select as ue } from "./components/Select/Select.styles.js";
|
|
23
|
-
import { IressInline as d } from "./components/Inline/Inline.js";
|
|
24
|
-
import { SelectActivator as de } from "./components/Select/components/SelectActivator.js";
|
|
25
|
-
import { IressSelectMenu as f } from "./components/Select/SelectMenu/SelectMenu.js";
|
|
26
|
-
import { SelectOptions as p } from "./components/Select/components/SelectOptions.js";
|
|
27
|
-
import { SelectHiddenInput as fe } from "./components/Select/components/SelectHiddenInput.js";
|
|
28
|
-
import { NativeSelect as pe } from "./components/Select/components/NativeSelect.js";
|
|
29
|
-
import { useSelectState as me } from "./components/Select/hooks/useSelectState.js";
|
|
30
|
-
import { forwardRef as m, useCallback as he, useEffect as h, useImperativeHandle as ge, useMemo as g, useRef as _, useState as v } from "react";
|
|
31
|
-
import { Fragment as _e, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
32
|
-
//#region src/components/Select/Select.tsx
|
|
33
|
-
var x = (e) => typeof e == "object" && !!e && "label" in e, S = (e, t) => {
|
|
34
|
-
for (let n of t) if (n.children) {
|
|
35
|
-
let t = S(e, n.children);
|
|
36
|
-
if (t) return t;
|
|
37
|
-
} else if (n.value !== void 0 && n.value === e) return n;
|
|
38
|
-
}, C = (e, t) => {
|
|
39
|
-
if (x(e)) return e;
|
|
40
|
-
if (typeof t != "function") return S(e, t) ?? (typeof e == "number" ? S(String(e), t) : void 0);
|
|
41
|
-
}, w = (e, t) => {
|
|
42
|
-
if (e !== void 0) {
|
|
43
|
-
if (Array.isArray(e)) {
|
|
44
|
-
let r = e, i = r.map((e) => C(e, t)).filter((e) => e !== void 0);
|
|
45
|
-
return i.length < r.length && typeof t != "function" && n(`IressSelect: ${r.length - i.length} value(s) could not be resolved to matching options and were dropped.`, "warn"), i;
|
|
46
|
-
}
|
|
47
|
-
return C(e, t);
|
|
48
|
-
}
|
|
49
|
-
}, T = m(({ align: r = "bottom-start", autoHighlight: i = !0, className: a, defaultValue: o, disabled: s, errorText: ee, footer: re, header: ie, id: c, matchActivatorWidth: ae = !0, multiSelect: l, multiSelectLimit: ce, name: u, onChange: d, onBlur: f, options: m, native: S, placeholder: C, readOnly: T, renderHiddenInput: E, renderLabel: ve, renderOptions: ye, required: D, type: O, value: k, virtualFocus: A, width: j, ...M }, N) => {
|
|
50
|
-
oe({
|
|
51
|
-
component: "IressSelect",
|
|
52
|
-
defaultValue: o
|
|
53
|
-
});
|
|
54
|
-
let [P, F] = v(!1), I = P && !s, [L, be] = v(""), R = g(() => w(k, m), [k, m]), z = g(() => w(o, m), [o, m]);
|
|
55
|
-
h(() => {
|
|
56
|
-
k !== void 0 && !x(k) && R === void 0 && typeof m == "function" && n("IressSelect: A primitive value was passed but cannot be resolved because options are asynchronous. Pass a LabelValueMeta object instead when using async options, otherwise the component will behave as uncontrolled.", "warn");
|
|
57
|
-
}, [
|
|
58
|
-
k,
|
|
59
|
-
R,
|
|
60
|
-
m
|
|
61
|
-
]);
|
|
62
|
-
let { value: B, setValue: V, getValuesString: H, getLabelsString: xe } = me({
|
|
63
|
-
component: "IressSelect",
|
|
64
|
-
defaultValue: z,
|
|
65
|
-
multiple: l,
|
|
66
|
-
value: R
|
|
67
|
-
}), U = _(null), W = _(null), G = _(null), { value: K } = te(typeof S == "string" ? {
|
|
68
|
-
xs: !0,
|
|
69
|
-
[S]: !1
|
|
70
|
-
} : { xs: S }, { disabled: !S }), { append: Se, container: q, debounceThreshold: Ce, initialOptions: J, loadingDelay: Y, minSearchLength: we, onActivated: Te, onDeactivated: Ee, prepend: De, selectedOptionsText: Oe, ...X } = M, { debouncedQuery: ke, error: Ae, results: je, stopSearch: Me, loading: Z, shouldShowInstructions: Ne, shouldShowNoResults: Pe } = le({
|
|
71
|
-
debounceThreshold: Ce,
|
|
72
|
-
disabled: !P || !!K,
|
|
73
|
-
initialOptions: J,
|
|
74
|
-
loadingDelay: Y,
|
|
75
|
-
minSearchLength: we,
|
|
76
|
-
options: m,
|
|
77
|
-
query: L
|
|
78
|
-
});
|
|
79
|
-
ge(N, () => K ? {
|
|
80
|
-
focus: () => W.current?.focus(),
|
|
81
|
-
blur: () => W.current?.blur(),
|
|
82
|
-
input: W.current ?? null
|
|
83
|
-
} : U.current ? {
|
|
84
|
-
...U.current,
|
|
85
|
-
focus: () => U.current?.getActivator()?.focus(),
|
|
86
|
-
blur: () => U.current?.getActivator()?.blur(),
|
|
87
|
-
hiddenInput: G.current ?? void 0,
|
|
88
|
-
input: G.current ?? null
|
|
89
|
-
} : {
|
|
90
|
-
hiddenInput: G.current ?? void 0,
|
|
91
|
-
input: G.current ?? null,
|
|
92
|
-
focus: () => G.current?.focus(),
|
|
93
|
-
blur: () => G.current?.blur()
|
|
94
|
-
}, [K]), h(() => {
|
|
95
|
-
P ? Te?.() : Ee?.();
|
|
96
|
-
}, [
|
|
97
|
-
Te,
|
|
98
|
-
Ee,
|
|
99
|
-
P
|
|
100
|
-
]);
|
|
101
|
-
let Fe = he((e) => {
|
|
102
|
-
if (!f) return;
|
|
103
|
-
let t = e.currentTarget, n = e.relatedTarget;
|
|
104
|
-
!P && (!n || !t.contains(n)) && f(e), e.stopPropagation();
|
|
105
|
-
}, [f, P]);
|
|
106
|
-
if (T) return /* @__PURE__ */ y(se, {
|
|
107
|
-
value: H(),
|
|
108
|
-
ref: G,
|
|
109
|
-
variant: T,
|
|
110
|
-
name: u,
|
|
111
|
-
disabled: s,
|
|
112
|
-
required: D,
|
|
113
|
-
children: xe(", ")
|
|
114
|
-
});
|
|
115
|
-
if (K) {
|
|
116
|
-
if (m instanceof Function) throw Error("[IressSelect] The native select does not support asynchronous options. Please provide options as an array.");
|
|
117
|
-
if (l) throw Error("[IressSelect] The native select does not support multiple selection. Please remove the multiSelect prop or use the non-native select.");
|
|
118
|
-
return /* @__PURE__ */ y(pe, {
|
|
119
|
-
className: e(a, t.Select),
|
|
120
|
-
"data-testid": X["data-testid"],
|
|
121
|
-
disabled: s,
|
|
122
|
-
id: c,
|
|
123
|
-
name: u,
|
|
124
|
-
onBlur: f,
|
|
125
|
-
onChange: (e, t) => {
|
|
126
|
-
d?.(e, t?.value ?? null, t), V(t);
|
|
127
|
-
},
|
|
128
|
-
options: m,
|
|
129
|
-
placeholder: typeof S == "string" ? C ?? "" : C,
|
|
130
|
-
style: X.style,
|
|
131
|
-
value: B,
|
|
132
|
-
width: j,
|
|
133
|
-
ref: W
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
let Q = typeof m == "function", Ie = A ?? !Q, Le = O ?? (Q ? void 0 : "listbox"), $ = ue({ width: j }), Re = () => {
|
|
137
|
-
F(!0);
|
|
138
|
-
}, ze = () => {
|
|
139
|
-
F(!1), Me();
|
|
140
|
-
};
|
|
141
|
-
return /* @__PURE__ */ b(_e, { children: [/* @__PURE__ */ y(fe, {
|
|
142
|
-
"data-testid": X["data-testid"],
|
|
143
|
-
getValuesString: H,
|
|
144
|
-
name: u,
|
|
145
|
-
renderHiddenInput: E,
|
|
146
|
-
required: D,
|
|
147
|
-
value: B,
|
|
148
|
-
disabled: s,
|
|
149
|
-
ref: G
|
|
150
|
-
}), /* @__PURE__ */ y(ne, {
|
|
151
|
-
...X,
|
|
152
|
-
activator: /* @__PURE__ */ y(de, {
|
|
153
|
-
append: Se,
|
|
154
|
-
async: Q,
|
|
155
|
-
disabled: s,
|
|
156
|
-
error: Ae,
|
|
157
|
-
id: c,
|
|
158
|
-
loading: Z,
|
|
159
|
-
multiSelect: l,
|
|
160
|
-
multiSelectLimit: ce,
|
|
161
|
-
onChange: d,
|
|
162
|
-
placeholder: C,
|
|
163
|
-
popoverContainer: q,
|
|
164
|
-
prepend: De,
|
|
165
|
-
renderLabel: ve,
|
|
166
|
-
selectedOptionsText: Oe,
|
|
167
|
-
setValue: V,
|
|
168
|
-
setShow: F,
|
|
169
|
-
show: P,
|
|
170
|
-
value: B
|
|
171
|
-
}),
|
|
172
|
-
align: r,
|
|
173
|
-
className: e(a, $.root, t.Select),
|
|
174
|
-
container: q,
|
|
175
|
-
contentClassName: e($.popoverContent),
|
|
176
|
-
contentStyle: {
|
|
177
|
-
...X.contentStyle,
|
|
178
|
-
p: "none"
|
|
179
|
-
},
|
|
180
|
-
matchActivatorWidth: ae,
|
|
181
|
-
onActivated: Re,
|
|
182
|
-
onDeactivated: ze,
|
|
183
|
-
ref: U,
|
|
184
|
-
show: I,
|
|
185
|
-
type: Le,
|
|
186
|
-
virtualFocus: Ie,
|
|
187
|
-
onBlur: Fe,
|
|
188
|
-
children: /* @__PURE__ */ b("div", {
|
|
189
|
-
className: $.wrapper,
|
|
190
|
-
children: [
|
|
191
|
-
ie,
|
|
192
|
-
/* @__PURE__ */ y(p, {
|
|
193
|
-
autoHighlight: i,
|
|
194
|
-
debouncedQuery: ke,
|
|
195
|
-
error: Ae,
|
|
196
|
-
errorText: ee,
|
|
197
|
-
initialOptions: J,
|
|
198
|
-
loading: Z,
|
|
199
|
-
minSearchLength: we,
|
|
200
|
-
multiSelect: l,
|
|
201
|
-
onChange: d,
|
|
202
|
-
options: m,
|
|
203
|
-
query: L,
|
|
204
|
-
renderOptions: ye,
|
|
205
|
-
results: je,
|
|
206
|
-
setQuery: be,
|
|
207
|
-
setShow: F,
|
|
208
|
-
setValue: V,
|
|
209
|
-
shouldShowInstructions: Ne,
|
|
210
|
-
shouldShowNoResults: Pe,
|
|
211
|
-
show: I,
|
|
212
|
-
value: B
|
|
213
|
-
}),
|
|
214
|
-
re
|
|
215
|
-
]
|
|
216
|
-
})
|
|
217
|
-
})] });
|
|
218
|
-
});
|
|
219
|
-
T.displayName = "IressSelect";
|
|
220
|
-
//#endregion
|
|
221
|
-
//#region src/components/Autocomplete/Autocomplete.tsx
|
|
222
|
-
var E = m(({ alwaysShowOnFocus: n, append: te = /* @__PURE__ */ y(r, { name: "search" }), autoComplete: ne = "off", autoSelect: oe = !0, className: ue, clearable: de = !0, "data-testid": p, debounceThreshold: fe, defaultValue: pe, errorText: me = /* @__PURE__ */ y(ie, {
|
|
223
|
-
status: "danger",
|
|
224
|
-
mb: "none",
|
|
225
|
-
variant: "full-width",
|
|
226
|
-
children: "An unknown error occurred. Please contact support if the error persists."
|
|
227
|
-
}), initialOptions: m, loadingDelay: he, limitDesktop: ge = 12, limitMobile: g = 6, minSearchLength: _, noResultsText: x, onChange: S, onClear: C, onFocus: w, options: T, popoverProps: { autoHighlight: E = !1, append: ve, prepend: ye, ...D } = {}, readOnly: O, value: k, ...A }, j) => {
|
|
228
|
-
let [M, N] = v(!1), { value: P, setValue: F } = ee({
|
|
229
|
-
component: "IressAutocomplete",
|
|
230
|
-
defaultValue: pe,
|
|
231
|
-
value: k
|
|
232
|
-
}), [I, L] = v(!1), { clearError: be, debouncedQuery: R, error: z, loading: B, results: V, startSearch: H, stopSearch: xe, shouldShowInstructions: U, shouldShowNoResults: W } = le({
|
|
233
|
-
debounceThreshold: fe,
|
|
234
|
-
initialOptions: m,
|
|
235
|
-
loadingDelay: he,
|
|
236
|
-
minSearchLength: _,
|
|
237
|
-
options: T,
|
|
238
|
-
query: ae(P)
|
|
239
|
-
});
|
|
240
|
-
if (h(() => {
|
|
241
|
-
I && !M && V.length > 0 && P && N(!0);
|
|
242
|
-
}, [
|
|
243
|
-
V.length,
|
|
244
|
-
M,
|
|
245
|
-
I,
|
|
246
|
-
P
|
|
247
|
-
]), h(() => {
|
|
248
|
-
B && I && N(!0);
|
|
249
|
-
}, [B, I]), h(() => {
|
|
250
|
-
z && N(!0);
|
|
251
|
-
}, [z]), O) return /* @__PURE__ */ y(se, {
|
|
252
|
-
value: P,
|
|
253
|
-
variant: O
|
|
254
|
-
});
|
|
255
|
-
let G = (e, t) => {
|
|
256
|
-
S?.(e, t), F(t), L(!!t);
|
|
257
|
-
}, K = (e) => {
|
|
258
|
-
C?.(e), F("");
|
|
259
|
-
}, Se = (e) => {
|
|
260
|
-
w?.(e), m?.length && N(!0);
|
|
261
|
-
}, q = (e) => {
|
|
262
|
-
let t = s(e)?.[0];
|
|
263
|
-
S?.(ce(t?.label), t?.label, t), F(t?.label), N(!1), L(!1);
|
|
264
|
-
}, Ce = () => {
|
|
265
|
-
(!n || !P) && xe(), be(), N(!1), P && L(!1);
|
|
266
|
-
}, J = (e) => {
|
|
267
|
-
A.onKeyDown?.(e), e.key === "ArrowDown" && (!M || !I) && (V.length || H(!0), L(!0), N(!0));
|
|
268
|
-
}, Y = c({ isEmpty: V.length === 0 && !B && !z && !U && !W });
|
|
269
|
-
return /* @__PURE__ */ b(re, {
|
|
270
|
-
...D,
|
|
271
|
-
activator: /* @__PURE__ */ y(l, {
|
|
272
|
-
...A,
|
|
273
|
-
append: te,
|
|
274
|
-
autoComplete: ne,
|
|
275
|
-
clearable: de,
|
|
276
|
-
"data-testid": a(p, "input"),
|
|
277
|
-
onChange: G,
|
|
278
|
-
onClear: K,
|
|
279
|
-
onFocus: Se,
|
|
280
|
-
onKeyDown: J,
|
|
281
|
-
value: P,
|
|
282
|
-
ref: j
|
|
283
|
-
}),
|
|
284
|
-
autoHighlight: E,
|
|
285
|
-
className: e(ue, D.className, Y.root, t.Autocomplete),
|
|
286
|
-
contentClassName: e(D.contentClassName, Y.popoverContent),
|
|
287
|
-
contentStyle: D.contentStyle,
|
|
288
|
-
"data-testid": p,
|
|
289
|
-
minLength: 0,
|
|
290
|
-
onActivated: () => (I || n) && N(!0),
|
|
291
|
-
onDeactivated: Ce,
|
|
292
|
-
show: M,
|
|
293
|
-
type: "listbox",
|
|
294
|
-
focusStartIndex: 0,
|
|
295
|
-
children: [
|
|
296
|
-
B && !V.length && /* @__PURE__ */ b(d, {
|
|
297
|
-
gap: "sm",
|
|
298
|
-
verticalAlign: "middle",
|
|
299
|
-
p: "spacing.3",
|
|
300
|
-
children: [/* @__PURE__ */ y(o, { color: "colour.neutral.70" }), /* @__PURE__ */ y(i, {
|
|
301
|
-
color: "colour.neutral.70",
|
|
302
|
-
children: "Loading results..."
|
|
303
|
-
})]
|
|
304
|
-
}),
|
|
305
|
-
V.length > 0 && /* @__PURE__ */ b(_e, { children: [
|
|
306
|
-
ye,
|
|
307
|
-
/* @__PURE__ */ y(f, {
|
|
308
|
-
changeOnBlur: oe,
|
|
309
|
-
className: e(Y.optionList),
|
|
310
|
-
"data-testid": a(p, "menu"),
|
|
311
|
-
items: V,
|
|
312
|
-
limitDesktop: ge,
|
|
313
|
-
limitMobile: g,
|
|
314
|
-
onChange: q,
|
|
315
|
-
selected: { label: R }
|
|
316
|
-
}),
|
|
317
|
-
ve
|
|
318
|
-
] }),
|
|
319
|
-
z && me,
|
|
320
|
-
U && !z && /* @__PURE__ */ y(u, { minSearchLength: _ ?? 1 }),
|
|
321
|
-
W && !z && x
|
|
322
|
-
]
|
|
323
|
-
});
|
|
324
|
-
});
|
|
325
|
-
E.displayName = "IressAutocomplete";
|
|
326
|
-
//#endregion
|
|
327
|
-
export { T as n, E as t };
|