@iress-oss/ids-components 6.3.0 → 6.4.0
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-DAfthdT2.js → Shadow-BKrsbwQE.js} +8 -6
- 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/{sva-DGhdmNso.js → sva-CG-TbBow.js} +2 -2
- package/dist/{useAutocompleteSearch-BYzUn7Ag.js → useAutocompleteSearch-m33c4lI7.js} +7 -5
- package/package.json +6 -6
- package/dist/Autocomplete-ZqkibVwt.js +0 -327
- package/dist/Slideout-BOH2gwIN.js +0 -194
|
@@ -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 };
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./cx-QcEwjve6.js";
|
|
2
|
-
import { n as t } from "./is-valid-prop-BVyYPT21.js";
|
|
3
|
-
import { GlobalCSSClass as n } from "./enums.js";
|
|
4
|
-
import { idsLogger as r } from "./helpers/utility/idsLogger.js";
|
|
5
|
-
import { IressText as i } from "./components/Text/Text.js";
|
|
6
|
-
import { propagateTestid as a } from "./helpers/utility/propagateTestid.js";
|
|
7
|
-
import { useIdIfNeeded as o } from "./hooks/useIdIfNeeded.js";
|
|
8
|
-
import { b as s, d as c, g as l, s as u, u as d, y as f } from "./floating-ui.react-TDMXDOBr.js";
|
|
9
|
-
import { getTransitionDuration as p } from "./helpers/transition/getTransitionDuration.js";
|
|
10
|
-
import { slideout as m } from "./components/Slideout/Slideout.styles.js";
|
|
11
|
-
import { SlideoutInner as ee } from "./components/Slideout/components/SlideoutInner.js";
|
|
12
|
-
import { usePushElement as te } from "./components/Slideout/hooks/usePushElement.js";
|
|
13
|
-
import { useProviderSlideout as ne } from "./components/Slideout/hooks/useProviderSlideout.js";
|
|
14
|
-
import { useCallback as h, useEffect as g, useMemo as _, useRef as v, useState as y } from "react";
|
|
15
|
-
import { jsx as b } from "react/jsx-runtime";
|
|
16
|
-
//#region ../../node_modules/query-selector-shadow-dom/src/normalize.js
|
|
17
|
-
/* istanbul ignore file */
|
|
18
|
-
function x(e) {
|
|
19
|
-
function t() {
|
|
20
|
-
i && (n.length > 0 && /^[~+>]$/.test(n[n.length - 1]) && n.push(" "), n.push(i));
|
|
21
|
-
}
|
|
22
|
-
var n = [], r, i, a, o = [0], s = 0, c, l = /(?:[^\\]|(?:^|[^\\])(?:\\\\)+)$/, u = /^\s+$/, d = [
|
|
23
|
-
/\s+|\/\*|["'>~+[(]/g,
|
|
24
|
-
/\s+|\/\*|["'[\]()]/g,
|
|
25
|
-
/\s+|\/\*|["'[\]()]/g,
|
|
26
|
-
null,
|
|
27
|
-
/\*\//g
|
|
28
|
-
];
|
|
29
|
-
for (e = e.trim();;) if (i = "", a = d[o[o.length - 1]], a.lastIndex = s, r = a.exec(e), r) if (c = s, s = a.lastIndex, c < s - r[0].length && (i = e.substring(c, s - r[0].length)), o[o.length - 1] < 3) {
|
|
30
|
-
if (t(), r[0] === "[") o.push(1);
|
|
31
|
-
else if (r[0] === "(") o.push(2);
|
|
32
|
-
else if (/^["']$/.test(r[0])) o.push(3), d[3] = new RegExp(r[0], "g");
|
|
33
|
-
else if (r[0] === "/*") o.push(4);
|
|
34
|
-
else if (/^[\])]$/.test(r[0]) && o.length > 0) o.pop();
|
|
35
|
-
else if (/^(?:\s+|[~+>])$/.test(r[0]) && (n.length > 0 && !u.test(n[n.length - 1]) && o[o.length - 1] === 0 && n.push(" "), o[o.length - 1] === 1 && n.length === 5 && n[2].charAt(n[2].length - 1) === "=" && (n[4] = " " + n[4]), u.test(r[0]))) continue;
|
|
36
|
-
n.push(r[0]);
|
|
37
|
-
} else n[n.length - 1] += i, l.test(n[n.length - 1]) && (o[o.length - 1] === 4 && (n.length < 2 || u.test(n[n.length - 2]) ? n.pop() : n[n.length - 1] = " ", r[0] = ""), o.pop()), n[n.length - 1] += r[0];
|
|
38
|
-
else {
|
|
39
|
-
i = e.substr(s), t();
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
return n.join("").trim();
|
|
43
|
-
}
|
|
44
|
-
//#endregion
|
|
45
|
-
//#region ../../node_modules/query-selector-shadow-dom/src/querySelectorDeep.js
|
|
46
|
-
function S(e, t = document, n = null) {
|
|
47
|
-
return C(e, !1, t, n);
|
|
48
|
-
}
|
|
49
|
-
function C(e, t, n, r = null) {
|
|
50
|
-
e = x(e);
|
|
51
|
-
let i = n.querySelector(e);
|
|
52
|
-
return document.head.createShadowRoot || document.head.attachShadow ? !t && i ? i : T(e, ",").reduce((e, i) => {
|
|
53
|
-
if (!t && e) return e;
|
|
54
|
-
let a = T(i.replace(/^\s+/g, "").replace(/\s*([>+~]+)\s*/g, "$1"), " ").filter((e) => !!e).map((e) => T(e, ">")), o = a.length - 1, s = a[o][a[o].length - 1], c = O(s, n, r), l = w(a, o, n);
|
|
55
|
-
return t ? (e = e.concat(c.filter(l)), e) : (e = c.find(l), e || null);
|
|
56
|
-
}, t ? [] : null) : t ? n.querySelectorAll(e) : i;
|
|
57
|
-
}
|
|
58
|
-
function w(e, t, n) {
|
|
59
|
-
return (r) => {
|
|
60
|
-
let i = t, a = r, o = !1;
|
|
61
|
-
for (; a && !E(a);) {
|
|
62
|
-
let t = !0;
|
|
63
|
-
if (e[i].length === 1) t = a.matches(e[i]);
|
|
64
|
-
else {
|
|
65
|
-
let r = [].concat(e[i]).reverse(), o = a;
|
|
66
|
-
for (let e of r) {
|
|
67
|
-
if (!o || !o.matches(e)) {
|
|
68
|
-
t = !1;
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
o = D(o, n);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
if (t && i === 0) {
|
|
75
|
-
o = !0;
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
t && i--, a = D(a, n);
|
|
79
|
-
}
|
|
80
|
-
return o;
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
function T(e, t) {
|
|
84
|
-
return e.match(/\\?.|^$/g).reduce((e, n) => (n === "\"" && !e.sQuote ? (e.quote ^= 1, e.a[e.a.length - 1] += n) : n === "'" && !e.quote ? (e.sQuote ^= 1, e.a[e.a.length - 1] += n) : !e.quote && !e.sQuote && n === t ? e.a.push("") : e.a[e.a.length - 1] += n, e), { a: [""] }).a;
|
|
85
|
-
}
|
|
86
|
-
function E(e) {
|
|
87
|
-
return e.nodeType === Node.DOCUMENT_FRAGMENT_NODE || e.nodeType === Node.DOCUMENT_NODE;
|
|
88
|
-
}
|
|
89
|
-
function D(e, t) {
|
|
90
|
-
let n = e.parentNode;
|
|
91
|
-
return n && n.host && n.nodeType === 11 ? n.host : n === t ? null : n;
|
|
92
|
-
}
|
|
93
|
-
function O(e = null, t, n = null) {
|
|
94
|
-
let r = [];
|
|
95
|
-
if (n) r = n;
|
|
96
|
-
else {
|
|
97
|
-
let e = function(t) {
|
|
98
|
-
for (let n = 0; n < t.length; n++) {
|
|
99
|
-
let i = t[n];
|
|
100
|
-
r.push(i), i.shadowRoot && e(i.shadowRoot.querySelectorAll("*"));
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
t.shadowRoot && e(t.shadowRoot.querySelectorAll("*")), e(t.querySelectorAll("*"));
|
|
104
|
-
}
|
|
105
|
-
return e ? r.filter((t) => t.matches(e)) : r;
|
|
106
|
-
}
|
|
107
|
-
//#endregion
|
|
108
|
-
//#region src/components/Slideout/Slideout.tsx
|
|
109
|
-
var k = ({ children: x, className: C, closeText: w = "Close", container: T, "data-testid": E, defaultShow: D = !1, eleToPush: O, footer: k, heading: A, mode: j = "overlay", onEntered: M, onExited: N, onShowChange: P, onStatus: F, onTransitionEnd: I, position: L = "right", show: R, size: z = "sm", style: re, ...B }) => {
|
|
110
|
-
let [V, H] = y(D), U = 240, W = v(null), G = ne(B.id), K = o({ id: B.id }), q = `${K}--heading`, J = G.opened || R || V, Y = (e, t, n) => {
|
|
111
|
-
G?.show?.(e), H(e), P?.(e, n);
|
|
112
|
-
}, { context: X } = c({
|
|
113
|
-
open: J,
|
|
114
|
-
onOpenChange: Y
|
|
115
|
-
}), ie = l([d(X, {
|
|
116
|
-
enabled: !0,
|
|
117
|
-
outsidePress: !1
|
|
118
|
-
}), f(X)]);
|
|
119
|
-
X.refs.floating.current && (U = p(X.refs.floating.current, 1.2, 240));
|
|
120
|
-
let { isMounted: ae, status: Z } = s(X, { duration: U }), oe = m({
|
|
121
|
-
position: L,
|
|
122
|
-
size: z,
|
|
123
|
-
status: Z,
|
|
124
|
-
mode: j
|
|
125
|
-
});
|
|
126
|
-
g(() => {
|
|
127
|
-
G.opened && R && r("IressSlideout: Please use either IressSlideoutProvider for uncontrolled components, or the show prop for controlled components, rather than both. If you use both, the open state of the slideout will become unpredictable. If you want to show a slideout by default in uncontrolled mode, use the defaultShow prop.");
|
|
128
|
-
}, [G.opened, R]), g(() => {
|
|
129
|
-
F?.(Z);
|
|
130
|
-
}, [Z, F]), g(() => (j === "overlay" ? W.current = null : W.current = ((e) => typeof e == "string" ? S(e) : e instanceof Element ? e : e?.current)(O), () => {
|
|
131
|
-
W.current = null;
|
|
132
|
-
}), [O, j]), g(() => {
|
|
133
|
-
Z === "open" && X.refs.floating?.current?.focus();
|
|
134
|
-
}, [X.refs.floating, Z]), te(_(() => ({
|
|
135
|
-
element: W.current ?? null,
|
|
136
|
-
isActive: j === "push",
|
|
137
|
-
position: L,
|
|
138
|
-
size: z,
|
|
139
|
-
status: Z
|
|
140
|
-
}), [
|
|
141
|
-
W,
|
|
142
|
-
j,
|
|
143
|
-
L,
|
|
144
|
-
z,
|
|
145
|
-
Z
|
|
146
|
-
]));
|
|
147
|
-
let Q = h((e) => {
|
|
148
|
-
I?.(e);
|
|
149
|
-
let t = L === "right" ? "right" : "left";
|
|
150
|
-
!(e.propertyName === t || e.propertyName === "opacity" || !e.propertyName) || e.target !== e.currentTarget || (Z === "open" ? M?.() : Z === "close" && N?.());
|
|
151
|
-
}, [
|
|
152
|
-
I,
|
|
153
|
-
L,
|
|
154
|
-
Z,
|
|
155
|
-
M,
|
|
156
|
-
N
|
|
157
|
-
]), $ = _(() => typeof A == "string" ? /* @__PURE__ */ b(i, {
|
|
158
|
-
id: q,
|
|
159
|
-
"data-testid": a(E, "heading"),
|
|
160
|
-
element: "h2",
|
|
161
|
-
children: A
|
|
162
|
-
}) : A, [
|
|
163
|
-
E,
|
|
164
|
-
q,
|
|
165
|
-
A
|
|
166
|
-
]);
|
|
167
|
-
if (!ae) return null;
|
|
168
|
-
let se = e(oe.root, C, n.Slideout, Z === "open" && n.SlideoutOpen), [ce, le] = t(B), ue = {
|
|
169
|
-
"aria-labelledby": $ ? q : void 0,
|
|
170
|
-
children: x,
|
|
171
|
-
className: se,
|
|
172
|
-
closeText: w,
|
|
173
|
-
"data-testid": E,
|
|
174
|
-
footer: k,
|
|
175
|
-
floatingRef: (e) => X.refs.setFloating(e),
|
|
176
|
-
heading: $,
|
|
177
|
-
id: K,
|
|
178
|
-
onOpenChange: Y,
|
|
179
|
-
...ce,
|
|
180
|
-
...ie.getFloatingProps(le),
|
|
181
|
-
onTransitionEnd: Q
|
|
182
|
-
};
|
|
183
|
-
return /* @__PURE__ */ b(u, {
|
|
184
|
-
root: T ?? G?.container,
|
|
185
|
-
children: /* @__PURE__ */ b(ee, {
|
|
186
|
-
...ue,
|
|
187
|
-
style: re,
|
|
188
|
-
"data-testid": E
|
|
189
|
-
})
|
|
190
|
-
});
|
|
191
|
-
};
|
|
192
|
-
k.displayName = "IressSlideout";
|
|
193
|
-
//#endregion
|
|
194
|
-
export { k as t };
|