@slotted/react 0.1.0-beta.4 → 0.1.0-beta.6
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/README.md +16 -1
- package/dist/{action-bar-OACchRZw.js → action-bar-ti3e6FK1.js} +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/{app-shell-CmYvnu_7.js → app-shell-nnSP44OO.js} +271 -267
- package/dist/app-shell.js +1 -1
- package/dist/bin/slotted-agent-docs.mjs +297 -0
- package/dist/{cascader-D1AhTyBL.js → cascader-Cn2Acpcv.js} +227 -210
- package/dist/cascader.js +1 -1
- package/dist/chart-04i6NZQA.js +968 -0
- package/dist/chart.js +1 -1
- package/dist/{checkbox-DfxFHZaU.js → checkbox-B4Sb1eXj.js} +3 -3
- package/dist/{checkbox-group-9sDgrV5Z.js → checkbox-group-LpGMuq9w.js} +2 -2
- package/dist/checkbox-group.js +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{code-block-CFHf8uTm.js → code-block-CTNiyt0U.js} +1 -1
- package/dist/code-block.js +1 -1
- package/dist/{color-picker-CwbWzCKg.js → color-picker-BcRCeISx.js} +4 -4
- package/dist/color-picker.js +1 -1
- package/dist/{column-manager-CTtizVhm.js → column-manager-BtkYLs5G.js} +4 -4
- package/dist/column-manager.js +1 -1
- package/dist/{combobox-BVMI9lg8.js → combobox-C1D5doWM.js} +227 -198
- package/dist/combobox.js +1 -1
- package/dist/{context-menu-BuST6W94.js → context-menu-B00UIBVC.js} +1 -1
- package/dist/context-menu.js +1 -1
- package/dist/{currency-field-DD9A5U3D.js → currency-field-Dti9JFu0.js} +1 -1
- package/dist/currency-field.js +1 -1
- package/dist/{dashboard-grid-CBMP_-JV.js → dashboard-grid-CoLKLvYL.js} +1 -1
- package/dist/dashboard-grid.js +1 -1
- package/dist/{data-grid-Eb-a4jg3.js → data-grid-DX95Y7mY.js} +18 -18
- package/dist/data-grid.js +1 -1
- package/dist/{data-list-oICmxGkA.js → data-list-CWYTPNm-.js} +2 -2
- package/dist/data-list.js +1 -1
- package/dist/{date-field-Hr-OCU-H.js → date-field-BxEpqAPg.js} +1 -1
- package/dist/date-field.js +1 -1
- package/dist/date-picker-DRk9SZp1.js +308 -0
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-6Yz7avTS.js +483 -0
- package/dist/date-range-picker.js +1 -1
- package/dist/{datetime-field-B8TrmsDK.js → datetime-field-D2f9u6im.js} +1 -1
- package/dist/datetime-field.js +1 -1
- package/dist/datetime-picker-STqSWMkH.js +645 -0
- package/dist/datetime-picker.js +1 -1
- package/dist/datetime-range-picker-DQNQwr3K.js +1000 -0
- package/dist/datetime-range-picker.js +1 -1
- package/dist/{detail-panel-CW53lUjp.js → detail-panel-z6WGleP4.js} +1 -1
- package/dist/detail-panel.js +1 -1
- package/dist/docs/AGENTS.snippet.md +2 -0
- package/dist/docs/app-shell.examples.md +1 -1
- package/dist/docs/app-shell.json +4 -4
- package/dist/docs/app-shell.md +2 -2
- package/dist/docs/guidelines/README.md +2 -2
- package/dist/docs/guidelines/index.md +1 -1
- package/dist/docs/guidelines/own-elements.md +1 -1
- package/dist/docs/page-header.json +1 -0
- package/dist/docs/page-header.md +1 -1
- package/dist/docs/segmented-control.json +7 -11
- package/dist/docs/segmented-control.md +1 -1
- package/dist/docs/skills/build-own-element/SKILL.md +6 -6
- package/dist/docs/skills/compose-screen/SKILL.md +6 -6
- package/dist/docs/skills/review-screen/SKILL.md +6 -6
- package/dist/docs/skills/theme-app/SKILL.md +1 -1
- package/dist/docs/skills/waiting-states/SKILL.md +2 -2
- package/dist/docs/tabs.json +16 -3
- package/dist/docs/tabs.md +3 -2
- package/dist/{entity-picker-Dn1T7JCq.js → entity-picker-BdySwW8F.js} +274 -256
- package/dist/entity-picker.js +1 -1
- package/dist/{event-calendar-CnF3iIZD.js → event-calendar-CiphPXdV.js} +4 -4
- package/dist/event-calendar.js +1 -1
- package/dist/{field-NJaCxl2h.js → field-BxQFpOXS.js} +1 -1
- package/dist/{field-group-hAzVa2O9.js → field-group-DcN_hiZN.js} +1 -1
- package/dist/field-group.js +1 -1
- package/dist/field.js +1 -1
- package/dist/{filter-bar-CHyy1o--.js → filter-bar-C_dXljI_.js} +10 -10
- package/dist/filter-bar.js +1 -1
- package/dist/{hover-card-BJE5dtaQ.js → hover-card-DpVzwvDJ.js} +1 -1
- package/dist/hover-card.js +1 -1
- package/dist/{import-export-center-jF37b909.js → import-export-center-BQnMJz4g.js} +3 -3
- package/dist/import-export-center.js +1 -1
- package/dist/index.js +63 -63
- package/dist/{listbox-Dv856z9I.js → listbox-D0MJcAMm.js} +1 -1
- package/dist/listbox.js +1 -1
- package/dist/{markdown-CeG8mUbI.js → markdown-IiVoh6yi.js} +2 -2
- package/dist/markdown.js +1 -1
- package/dist/menu-parts-D6v_mz6O.js +809 -0
- package/dist/menu.js +1 -1
- package/dist/{menubar-b2CruimJ.js → menubar-DApIg1eR.js} +1 -1
- package/dist/menubar.js +1 -1
- package/dist/{multi-select-DQ5ds0fX.js → multi-select-B8z6ApgW.js} +286 -257
- package/dist/multi-select.js +1 -1
- package/dist/{notification-center-C1iWWl5Y.js → notification-center-CGEEHcRA.js} +2 -2
- package/dist/notification-center.js +1 -1
- package/dist/{number-field-BFIAmv-z.js → number-field-DXk1TAXA.js} +1 -1
- package/dist/number-field.js +1 -1
- package/dist/{otp-input-BNQhuKaT.js → otp-input-CI-kdNgx.js} +1 -1
- package/dist/otp-input.js +1 -1
- package/dist/{popover-Be7JWbGJ.js → popover-DEp8Bf3e.js} +186 -166
- package/dist/popover.js +1 -1
- package/dist/{prompt-composer-BxpdkTpZ.js → prompt-composer-DdcU3S3L.js} +1 -1
- package/dist/prompt-composer.js +1 -1
- package/dist/{radio-group-BaVIP9UH.js → radio-group-D8csBZ8Z.js} +2 -2
- package/dist/radio-group.js +1 -1
- package/dist/{rating-DYBQBzwB.js → rating-rI3b5zII.js} +1 -1
- package/dist/rating.js +1 -1
- package/dist/{saved-views-DlE_--Z9.js → saved-views-B3brBTD9.js} +4 -4
- package/dist/saved-views.js +1 -1
- package/dist/scroll-area-DQ_ansLu.js +112 -0
- package/dist/scroll-area.js +1 -1
- package/dist/{segmented-control-DmuOGiu6.js → segmented-control-C-PzkTtg.js} +2 -2
- package/dist/segmented-control.js +1 -1
- package/dist/{select-M7Io4UL9.js → select-BUylPwpb.js} +241 -203
- package/dist/select.js +1 -1
- package/dist/{side-navigation-CBLtCzuJ.js → side-navigation-Bm-BZma1.js} +156 -140
- package/dist/side-navigation.js +1 -1
- package/dist/{slider-DTes4HLF.js → slider-fp7kyg-6.js} +1 -1
- package/dist/slider.js +1 -1
- package/dist/{split-button-CPgHiy9G.js → split-button-DKRm0j5c.js} +1 -1
- package/dist/split-button.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/{switch-DQzuIhPX.js → switch-aVoc4C2F.js} +1 -1
- package/dist/switch.js +1 -1
- package/dist/{table-U9eJYCuB.js → table-BYEvFr4P.js} +276 -275
- package/dist/table.js +1 -1
- package/dist/{tabs-BtHmjlnM.js → tabs-HWmvOKM4.js} +109 -102
- package/dist/tabs.js +1 -1
- package/dist/{tags-input-CcOkm0AW.js → tags-input-pbv6x1Pi.js} +1 -1
- package/dist/tags-input.js +1 -1
- package/dist/{text-field-DLfIZ0fk.js → text-field-CbQ6UCAP.js} +1 -1
- package/dist/text-field.js +1 -1
- package/dist/{textarea-CBJBJBi6.js → textarea-DJSfhrXH.js} +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{time-field-DrhiCtUl.js → time-field-BI9n607q.js} +1 -1
- package/dist/time-field.js +1 -1
- package/dist/time-picker-D6SlQWNF.js +402 -0
- package/dist/time-picker.js +1 -1
- package/dist/time-range-picker-CcV3_45h.js +751 -0
- package/dist/time-range-picker.js +1 -1
- package/dist/{toggle-group-7iBR9Rn1.js → toggle-group-i7JPO8BM.js} +1 -1
- package/dist/toggle-group.js +1 -1
- package/dist/{toolbar-DDZpEftQ.js → toolbar-B9knmgHA.js} +1 -1
- package/dist/toolbar.js +1 -1
- package/dist/tooltip-CgjIROUy.js +410 -0
- package/dist/tooltip.js +1 -1
- package/dist/{top-navigation-e-tWMGNr.js → top-navigation-DiG2PF5W.js} +2 -2
- package/dist/top-navigation.js +1 -1
- package/dist/{transfer-CqZOTLMP.js → transfer--UOQVeKE.js} +5 -5
- package/dist/transfer.js +1 -1
- package/dist/types/app-shell/app-shell-parts.d.ts +6 -4
- package/dist/types/app-shell/app-shell-parts.d.ts.map +1 -1
- package/dist/types/app-shell/app-shell.d.ts.map +1 -1
- package/dist/types/cascader/cascader.d.ts.map +1 -1
- package/dist/types/chart/chart.d.ts.map +1 -1
- package/dist/types/combobox/combobox-parts.d.ts.map +1 -1
- package/dist/types/date-picker/date-picker.d.ts.map +1 -1
- package/dist/types/date-range-picker/date-range-picker.d.ts.map +1 -1
- package/dist/types/datetime-picker/datetime-picker.d.ts.map +1 -1
- package/dist/types/datetime-range-picker/datetime-range-picker.d.ts.map +1 -1
- package/dist/types/entity-picker/entity-picker-popup.d.ts.map +1 -1
- package/dist/types/menu/menu-parts.d.ts.map +1 -1
- package/dist/types/multi-select/multi-select-parts.d.ts.map +1 -1
- package/dist/types/popover/popover-parts.d.ts.map +1 -1
- package/dist/types/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/types/select/select-parts.d.ts.map +1 -1
- package/dist/types/side-navigation/side-navigation-parts.d.ts.map +1 -1
- package/dist/types/stat-card/stat-card.types.d.ts +2 -2
- package/dist/types/stat-card/stat-card.types.d.ts.map +1 -1
- package/dist/types/table/table-content.d.ts.map +1 -1
- package/dist/types/tabs/tabs-parts.d.ts +2 -4
- package/dist/types/tabs/tabs-parts.d.ts.map +1 -1
- package/dist/types/tabs/tabs.d.ts.map +1 -1
- package/dist/types/time-picker/time-picker.d.ts.map +1 -1
- package/dist/types/time-range-picker/time-range-picker.d.ts.map +1 -1
- package/dist/types/tooltip/tooltip-parts.d.ts.map +1 -1
- package/dist/{upload-DjnlVR8y.js → upload-CLX5cURk.js} +1 -1
- package/dist/upload.js +1 -1
- package/package.json +10 -7
- package/dist/chart-O0ZhkzJe.js +0 -966
- package/dist/date-picker-D3-y2Jxw.js +0 -295
- package/dist/date-range-picker-y3b82Wmf.js +0 -471
- package/dist/datetime-picker-CIRHVLQp.js +0 -629
- package/dist/datetime-range-picker-DM-1m98z.js +0 -994
- package/dist/menu-parts-W58pVNUt.js +0 -786
- package/dist/scroll-area-BriwmvYY.js +0 -111
- package/dist/time-picker-CRQsMJbQ.js +0 -396
- package/dist/time-range-picker-DlZJsj1e.js +0 -745
- package/dist/tooltip-DbKTPe_i.js +0 -392
|
@@ -3,26 +3,26 @@ import { n, r } from "./i18n-DpW8lqJ1.js";
|
|
|
3
3
|
/* empty css */
|
|
4
4
|
import { t as i } from "./avatar-BnlE5jjr.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
import { b as a } from "./field-
|
|
6
|
+
import { b as a } from "./field-BxQFpOXS.js";
|
|
7
7
|
/* empty css */
|
|
8
8
|
import { t as o } from "./highlight-0Qw23QPp.js";
|
|
9
|
-
import { c as s, i as c, n as l, o as ee, s as
|
|
10
|
-
import { createArrowNavigation as
|
|
11
|
-
import { createControllable as
|
|
12
|
-
import { createContext as
|
|
13
|
-
import { Fragment as
|
|
14
|
-
import { createCollapse as
|
|
15
|
-
import { createPresence as
|
|
16
|
-
import { createPortalRoot as
|
|
17
|
-
import { createDismissableLayer as
|
|
18
|
-
import { createPositioner as
|
|
19
|
-
import { createPortal as
|
|
20
|
-
import { entityPickerMessages as
|
|
21
|
-
import { getLiveAnnouncer as
|
|
22
|
-
import { moveIndex as
|
|
23
|
-
import { CREATE_OPTION as
|
|
9
|
+
import { c as s, i as c, n as l, o as ee, s as u } from "./select-BUylPwpb.js";
|
|
10
|
+
import { createArrowNavigation as te, createRemovalFocus as ne } from "@slotted/core/focus";
|
|
11
|
+
import { createControllable as d } from "@slotted/core/state";
|
|
12
|
+
import { createContext as f, useCallback as p, useContext as re, useEffect as m, useId as ie, useImperativeHandle as h, useLayoutEffect as g, useMemo as _, useRef as v, useState as y } from "react";
|
|
13
|
+
import { Fragment as ae, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
14
|
+
import { createCollapse as S } from "@slotted/core/overflow";
|
|
15
|
+
import { createPresence as oe } from "@slotted/core/presence";
|
|
16
|
+
import { createPortalRoot as se } from "@slotted/core/portal";
|
|
17
|
+
import { createDismissableLayer as ce, pressOrigin as le } from "@slotted/core/dismissable-layer";
|
|
18
|
+
import { createPositioner as ue } from "@slotted/core/positioner";
|
|
19
|
+
import { createPortal as de } from "react-dom";
|
|
20
|
+
import { entityPickerMessages as fe } from "@slotted/core/i18n";
|
|
21
|
+
import { getLiveAnnouncer as pe } from "@slotted/core/live-announcer";
|
|
22
|
+
import { moveIndex as me } from "@slotted/core/collection";
|
|
23
|
+
import { CREATE_OPTION as C, CREATE_OPTION as he, RETRY_OPTION as ge, RETRY_OPTION as w, createEntityCache as T, createEntityResolver as _e, createEntitySearch as ve, entityInitials as ye, entityName as be, entityOptions as xe, entityPickerKey as Se, entitySections as Ce, localEntitySource as we, localEntitySource as Te, offersCreation as Ee, rememberRecent as De } from "@slotted/core/entity-picker";
|
|
24
24
|
//#region src/entity-picker/entity-picker-defaults.tsx
|
|
25
|
-
var
|
|
25
|
+
var Oe = {
|
|
26
26
|
clearable: !0,
|
|
27
27
|
disabled: !1,
|
|
28
28
|
fullWidth: !0,
|
|
@@ -42,22 +42,22 @@ var w = {
|
|
|
42
42
|
strategy: "absolute",
|
|
43
43
|
variant: "outline",
|
|
44
44
|
width: "content"
|
|
45
|
-
},
|
|
46
|
-
function
|
|
47
|
-
return
|
|
45
|
+
}, ke = f(Oe);
|
|
46
|
+
function Ae() {
|
|
47
|
+
return re(ke);
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
let n = { ...
|
|
49
|
+
function je({ children: e, ...t }) {
|
|
50
|
+
let n = { ...Ae() };
|
|
51
51
|
for (let [e, r] of Object.entries(t)) r !== void 0 && (n[e] = r);
|
|
52
|
-
return /* @__PURE__ */
|
|
52
|
+
return /* @__PURE__ */ b(ke.Provider, {
|
|
53
53
|
value: n,
|
|
54
54
|
children: e
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region src/entity-picker/entity-picker-control.tsx
|
|
59
|
-
var
|
|
60
|
-
function
|
|
59
|
+
var Me = "[data-part='chips'] > [data-ui='tag']:not([data-count])";
|
|
60
|
+
function Ne(e, t) {
|
|
61
61
|
return (n) => {
|
|
62
62
|
e?.(n), n.defaultPrevented || t(n);
|
|
63
63
|
};
|
|
@@ -77,9 +77,9 @@ var Fe = {
|
|
|
77
77
|
width: "1px"
|
|
78
78
|
};
|
|
79
79
|
function Ie({ entity: e, locale: t }) {
|
|
80
|
-
return e.avatar === null ? null : /* @__PURE__ */
|
|
80
|
+
return e.avatar === null ? null : /* @__PURE__ */ b(i, {
|
|
81
81
|
decorative: !0,
|
|
82
|
-
initials:
|
|
82
|
+
initials: ye(e),
|
|
83
83
|
locale: t,
|
|
84
84
|
name: e.avatar?.name ?? e.label,
|
|
85
85
|
shape: e.avatar?.shape ?? "circle",
|
|
@@ -88,12 +88,12 @@ function Ie({ entity: e, locale: t }) {
|
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
90
|
function Le() {
|
|
91
|
-
let n = k(), r = a(), { props: i } = n, { "aria-describedby": o, "aria-label":
|
|
92
|
-
n.setInputNode(e), Pe(e,
|
|
93
|
-
}, [
|
|
91
|
+
let n = k(), r = a(), { props: i } = n, { "aria-describedby": o, "aria-label": d, form: f, id: re, name: ie, onBlur: h, onClick: _, onFocus: oe, onKeyDown: se, placeholder: ce, ref: ue, render: de, source: fe, items: pe, entities: C, favorites: he, recent: ge, scopes: w, scope: T, defaultScope: _e, onScopeChange: ve, inputValue: ye, defaultInputValue: be, onInputValueChange: xe, open: Ce, defaultOpen: we, onOpenChange: Te, highlightedValue: Ee, defaultHighlightedValue: De, onHighlightedValueChange: Oe, onCreate: ke, renderOption: Ae, renderChip: je, handleRef: Le, locale: D, max: O, clearable: Re, disabled: ze, fullWidth: A, highlightMatch: Be, invalid: Ve, messages: He, loop: Ue, media: We, minQueryLength: Ge, openOn: j, overflow: Ke, portal: qe, readOnly: Je, required: Ye, searchDelay: Xe, side: Ze, size: Qe, strategy: $e, variant: et, width: M, selectionMode: tt, value: N, defaultValue: nt, onValueChange: rt, ...it } = i, { t: P, multiple: F } = n, I = n.chosen, at = v(null), L = v(null), [ot, st] = y(0), ct = p((e) => {
|
|
92
|
+
n.setInputNode(e), Pe(e, ue);
|
|
93
|
+
}, [ue]), lt = (e, t) => {
|
|
94
94
|
n.entry.current = e, n.setOpen(!0, "keyboard", t);
|
|
95
95
|
}, ut = (e, t) => {
|
|
96
|
-
let r = n.options, i = r.findIndex((e) => e.key === n.highlighted), a =
|
|
96
|
+
let r = n.options, i = r.findIndex((e) => e.key === n.highlighted), a = me({
|
|
97
97
|
enabled: r.map((e) => !e.disabled),
|
|
98
98
|
from: i,
|
|
99
99
|
intent: e,
|
|
@@ -102,7 +102,7 @@ function Le() {
|
|
|
102
102
|
a >= 0 && n.setHighlighted(r[a].key, "keyboard", t);
|
|
103
103
|
}, dt = (e) => {
|
|
104
104
|
if (n.disabled) return;
|
|
105
|
-
let t = e.currentTarget, r =
|
|
105
|
+
let t = e.currentTarget, r = Se({
|
|
106
106
|
key: e.key,
|
|
107
107
|
altKey: e.altKey,
|
|
108
108
|
ctrlKey: e.ctrlKey,
|
|
@@ -141,7 +141,7 @@ function Le() {
|
|
|
141
141
|
return;
|
|
142
142
|
case "focusChip": {
|
|
143
143
|
e.preventDefault();
|
|
144
|
-
let t = [...at.current?.querySelectorAll(
|
|
144
|
+
let t = [...at.current?.querySelectorAll(Me) ?? []].filter((e) => !e.hidden);
|
|
145
145
|
t[t.length - 1]?.focus({ preventScroll: !0 });
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
@@ -155,18 +155,18 @@ function Le() {
|
|
|
155
155
|
}, ht = (e) => {
|
|
156
156
|
let t = e.relatedTarget, r = n.inputNode?.ownerDocument.getElementById(n.contentId) ?? null;
|
|
157
157
|
if (n.controlNode?.parentElement, t instanceof Node && (r?.contains(t) || n.controlNode?.contains(t))) return;
|
|
158
|
-
let i =
|
|
158
|
+
let i = le(n.inputNode?.ownerDocument);
|
|
159
159
|
i instanceof Node && r?.contains(i) === !0 || (n.settle(e), n.open && n.setOpen(!1, "blur"));
|
|
160
160
|
}, gt = (e) => {
|
|
161
161
|
n.disabled || n.readOnly || (n.entry.current = F ? "keep" : "selected", n.setOpen(!n.open, "pointer", e.nativeEvent), n.inputNode?.focus({ preventScroll: !0 }));
|
|
162
162
|
}, R = (e) => {
|
|
163
163
|
n.clear(e.nativeEvent), n.inputNode?.focus({ preventScroll: !0 });
|
|
164
164
|
};
|
|
165
|
-
|
|
165
|
+
m(() => {
|
|
166
166
|
let e = at.current;
|
|
167
167
|
if (e === null) return;
|
|
168
|
-
let t =
|
|
169
|
-
itemSelector: `${
|
|
168
|
+
let t = te(e, {
|
|
169
|
+
itemSelector: `${Me}, [data-part='field'] > [data-part='input']`,
|
|
170
170
|
loop: !1,
|
|
171
171
|
ownedKeys: (e) => e instanceof HTMLInputElement && e.value !== "" ? [
|
|
172
172
|
"ArrowLeft",
|
|
@@ -174,22 +174,22 @@ function Le() {
|
|
|
174
174
|
"Home",
|
|
175
175
|
"End"
|
|
176
176
|
] : []
|
|
177
|
-
}), r =
|
|
178
|
-
itemSelector:
|
|
177
|
+
}), r = ne(e, {
|
|
178
|
+
itemSelector: Me,
|
|
179
179
|
fallback: () => n.inputNode
|
|
180
180
|
});
|
|
181
181
|
return () => {
|
|
182
182
|
t.destroy(), r.destroy();
|
|
183
183
|
};
|
|
184
184
|
}, [F, n.inputNode]);
|
|
185
|
-
let z = F && n.overflow === "collapse", B =
|
|
186
|
-
|
|
185
|
+
let z = F && n.overflow === "collapse", B = v(null);
|
|
186
|
+
m(() => {
|
|
187
187
|
let e = at.current;
|
|
188
188
|
if (e === null || !z) {
|
|
189
189
|
st(0);
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
|
-
let t =
|
|
192
|
+
let t = S(e, {
|
|
193
193
|
collapsible: (e) => e.dataset.part !== "field",
|
|
194
194
|
fixedSize: (e) => e.dataset.part === "field" ? Number.parseFloat(getComputedStyle(e).minInlineSize) || 0 : void 0,
|
|
195
195
|
onChange: (e) => st(e.length),
|
|
@@ -199,10 +199,10 @@ function Le() {
|
|
|
199
199
|
return B.current = t, () => {
|
|
200
200
|
t.destroy(), B.current = null;
|
|
201
201
|
};
|
|
202
|
-
}, [z]),
|
|
202
|
+
}, [z]), g(() => {
|
|
203
203
|
B.current?.refresh();
|
|
204
204
|
}, [I, n.version]);
|
|
205
|
-
let V = [o, r?.describedBy].filter(Boolean).join(" "), H =
|
|
205
|
+
let V = [o, r?.describedBy].filter(Boolean).join(" "), H = re ?? r?.ids.control ?? n.inputId, _t = !F && I.length > 0 && n.resolver.status(I[0]) === "pending", vt = n.search.indicator || _t, yt = n.clearable && !n.disabled && !n.readOnly && (I.length > 0 || n.inputValue !== ""), U = /* @__PURE__ */ b("input", {
|
|
206
206
|
...it,
|
|
207
207
|
"aria-activedescendant": n.open && n.highlighted !== null ? n.optionId(n.highlighted) : void 0,
|
|
208
208
|
"aria-autocomplete": "list",
|
|
@@ -211,18 +211,18 @@ function Le() {
|
|
|
211
211
|
"aria-describedby": V === "" ? void 0 : V,
|
|
212
212
|
"aria-expanded": n.open,
|
|
213
213
|
"aria-invalid": n.invalid ? !0 : void 0,
|
|
214
|
-
"aria-label":
|
|
214
|
+
"aria-label": d,
|
|
215
215
|
"aria-readonly": n.readOnly ? !0 : void 0,
|
|
216
216
|
autoComplete: "off",
|
|
217
217
|
"data-part": "input",
|
|
218
218
|
disabled: n.disabled,
|
|
219
219
|
id: H,
|
|
220
|
-
onBlur:
|
|
220
|
+
onBlur: Ne(h, ht),
|
|
221
221
|
onChange: ft,
|
|
222
|
-
onClick:
|
|
223
|
-
onFocus:
|
|
224
|
-
onKeyDown:
|
|
225
|
-
placeholder:
|
|
222
|
+
onClick: Ne(_, mt),
|
|
223
|
+
onFocus: Ne(oe, pt),
|
|
224
|
+
onKeyDown: Ne(se, dt),
|
|
225
|
+
placeholder: ce,
|
|
226
226
|
readOnly: n.readOnly,
|
|
227
227
|
ref: ct,
|
|
228
228
|
required: n.required && I.length === 0,
|
|
@@ -244,19 +244,19 @@ function Le() {
|
|
|
244
244
|
...n.required ? { "data-required": "" } : {},
|
|
245
245
|
...vt ? { "data-loading": "" } : {},
|
|
246
246
|
...n.max !== null && I.length >= n.max ? { "data-complete": "" } : {},
|
|
247
|
-
...
|
|
247
|
+
...w !== void 0 && w.length > 0 ? {
|
|
248
248
|
role: "group",
|
|
249
|
-
...r?.ids.label === void 0 ?
|
|
249
|
+
...r?.ids.label === void 0 ? d === void 0 ? {} : { "aria-label": d } : { "aria-labelledby": r.ids.label }
|
|
250
250
|
} : {}
|
|
251
251
|
}, bt = P("chips", {
|
|
252
|
-
label:
|
|
252
|
+
label: d ?? "",
|
|
253
253
|
count: I.length
|
|
254
|
-
}).replace(/^, /, ""), K = /* @__PURE__ */
|
|
255
|
-
|
|
254
|
+
}).replace(/^, /, ""), K = /* @__PURE__ */ x(ae, { children: [
|
|
255
|
+
w !== void 0 && w.length > 0 ? /* @__PURE__ */ b("div", {
|
|
256
256
|
"data-part": "scope",
|
|
257
|
-
children: /* @__PURE__ */
|
|
257
|
+
children: /* @__PURE__ */ x(s, {
|
|
258
258
|
disabled: n.disabled || n.readOnly,
|
|
259
|
-
items:
|
|
259
|
+
items: w.map((e) => ({
|
|
260
260
|
value: e.id,
|
|
261
261
|
label: e.label
|
|
262
262
|
})),
|
|
@@ -264,41 +264,41 @@ function Le() {
|
|
|
264
264
|
size: n.size,
|
|
265
265
|
value: n.scope,
|
|
266
266
|
variant: n.variant === "plain" ? "plain" : n.variant,
|
|
267
|
-
children: [/* @__PURE__ */
|
|
267
|
+
children: [/* @__PURE__ */ b(ee, {
|
|
268
268
|
"aria-label": P("scope"),
|
|
269
|
-
children: /* @__PURE__ */
|
|
270
|
-
}), /* @__PURE__ */
|
|
269
|
+
children: /* @__PURE__ */ b(u, {})
|
|
270
|
+
}), /* @__PURE__ */ b(c, { children: w.map((e) => /* @__PURE__ */ b(l, {
|
|
271
271
|
value: e.id,
|
|
272
272
|
children: e.label
|
|
273
273
|
}, e.id)) })]
|
|
274
274
|
})
|
|
275
275
|
}) : null,
|
|
276
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ x("div", {
|
|
277
277
|
"data-part": "control",
|
|
278
278
|
ref: n.setControlNode,
|
|
279
279
|
children: [
|
|
280
|
-
!F && W !== void 0 && W.avatar !== null && n.media === "avatar" && n.inputValue === W.label ? /* @__PURE__ */
|
|
280
|
+
!F && W !== void 0 && W.avatar !== null && n.media === "avatar" && n.inputValue === W.label ? /* @__PURE__ */ b("span", {
|
|
281
281
|
"aria-hidden": "true",
|
|
282
282
|
"data-part": "selection",
|
|
283
|
-
children: /* @__PURE__ */
|
|
283
|
+
children: /* @__PURE__ */ b(Ie, {
|
|
284
284
|
entity: W,
|
|
285
285
|
locale: n.locale
|
|
286
286
|
})
|
|
287
287
|
}) : null,
|
|
288
|
-
F ? /* @__PURE__ */
|
|
288
|
+
F ? /* @__PURE__ */ b("div", {
|
|
289
289
|
"aria-label": bt,
|
|
290
290
|
"data-part": "values",
|
|
291
291
|
role: "grid",
|
|
292
|
-
children: /* @__PURE__ */
|
|
292
|
+
children: /* @__PURE__ */ x("div", {
|
|
293
293
|
"data-part": "chips",
|
|
294
294
|
ref: at,
|
|
295
295
|
role: "row",
|
|
296
296
|
children: [
|
|
297
|
-
I.map((e) => /* @__PURE__ */
|
|
297
|
+
I.map((e) => /* @__PURE__ */ b(E, {
|
|
298
298
|
id: e,
|
|
299
|
-
renderChip:
|
|
299
|
+
renderChip: je
|
|
300
300
|
}, e)),
|
|
301
|
-
z ? /* @__PURE__ */
|
|
301
|
+
z ? /* @__PURE__ */ b("span", {
|
|
302
302
|
"aria-label": P("moreLabel", { count: Math.max(ot, 1) }),
|
|
303
303
|
"data-count": "",
|
|
304
304
|
"data-part": "root",
|
|
@@ -313,15 +313,15 @@ function Le() {
|
|
|
313
313
|
ref: L,
|
|
314
314
|
role: "gridcell",
|
|
315
315
|
tabIndex: -1,
|
|
316
|
-
children: /* @__PURE__ */
|
|
316
|
+
children: /* @__PURE__ */ b("span", {
|
|
317
317
|
"data-part": "body",
|
|
318
|
-
children: /* @__PURE__ */
|
|
318
|
+
children: /* @__PURE__ */ b("span", {
|
|
319
319
|
"data-part": "label",
|
|
320
320
|
children: P("more", { count: Math.max(ot, 1) })
|
|
321
321
|
})
|
|
322
322
|
})
|
|
323
323
|
}) : null,
|
|
324
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ b("span", {
|
|
325
325
|
"data-part": "field",
|
|
326
326
|
role: "gridcell",
|
|
327
327
|
children: U
|
|
@@ -329,35 +329,35 @@ function Le() {
|
|
|
329
329
|
]
|
|
330
330
|
})
|
|
331
331
|
}) : U,
|
|
332
|
-
yt ? /* @__PURE__ */
|
|
332
|
+
yt ? /* @__PURE__ */ b("button", {
|
|
333
333
|
"aria-label": P("clear"),
|
|
334
334
|
"data-part": "clear",
|
|
335
335
|
onClick: R,
|
|
336
336
|
type: "button",
|
|
337
|
-
children: /* @__PURE__ */
|
|
337
|
+
children: /* @__PURE__ */ b(t, { children: /* @__PURE__ */ b(e, { name: "x" }) })
|
|
338
338
|
}) : null,
|
|
339
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ b("button", {
|
|
340
340
|
"aria-label": P("trigger"),
|
|
341
341
|
"data-part": "trigger",
|
|
342
342
|
disabled: n.disabled,
|
|
343
343
|
onClick: gt,
|
|
344
344
|
tabIndex: -1,
|
|
345
345
|
type: "button",
|
|
346
|
-
children: vt ? /* @__PURE__ */
|
|
346
|
+
children: vt ? /* @__PURE__ */ b("span", {
|
|
347
347
|
"aria-hidden": "true",
|
|
348
348
|
"data-part": "busy",
|
|
349
349
|
"data-ui": "spinner"
|
|
350
|
-
}) : /* @__PURE__ */
|
|
350
|
+
}) : /* @__PURE__ */ b("span", {
|
|
351
351
|
"data-part": "arrow",
|
|
352
|
-
children: /* @__PURE__ */
|
|
352
|
+
children: /* @__PURE__ */ b(t, { children: /* @__PURE__ */ b(e, { name: "chevron-down" }) })
|
|
353
353
|
})
|
|
354
354
|
})
|
|
355
355
|
]
|
|
356
356
|
}),
|
|
357
|
-
|
|
357
|
+
ie === void 0 ? null : (I.length === 0 ? [""] : I).map((e, t) => /* @__PURE__ */ b("input", {
|
|
358
358
|
"aria-hidden": "true",
|
|
359
|
-
form:
|
|
360
|
-
name:
|
|
359
|
+
form: f,
|
|
360
|
+
name: ie,
|
|
361
361
|
readOnly: !0,
|
|
362
362
|
required: t === 0 && n.required,
|
|
363
363
|
style: Fe,
|
|
@@ -366,16 +366,16 @@ function Le() {
|
|
|
366
366
|
value: e
|
|
367
367
|
}, `${e}-${t}`))
|
|
368
368
|
] });
|
|
369
|
-
return
|
|
369
|
+
return de === void 0 ? /* @__PURE__ */ b("div", {
|
|
370
370
|
...G,
|
|
371
371
|
children: K
|
|
372
|
-
}) :
|
|
372
|
+
}) : de({
|
|
373
373
|
...G,
|
|
374
374
|
children: K
|
|
375
375
|
});
|
|
376
376
|
}
|
|
377
377
|
function E({ id: n, renderChip: r }) {
|
|
378
|
-
let i = k(), { t: a } = i, o = i.cache.get(n), s = i.resolver.status(n), c = o === void 0 && s === "pending", l = o === void 0 && s === "missing", ee = i.readOnly || i.disabled,
|
|
378
|
+
let i = k(), { t: a } = i, o = i.cache.get(n), s = i.resolver.status(n), c = o === void 0 && s === "pending", l = o === void 0 && s === "missing", ee = i.readOnly || i.disabled, u = o === void 0 ? a(l ? "unresolvedChip" : "loadingChip", { id: n }) : be(o), te = o?.label ?? (l ? a("unresolved") : n), ne = (e) => {
|
|
379
379
|
if (!e.defaultPrevented) switch (e.key) {
|
|
380
380
|
case "Delete":
|
|
381
381
|
case "Backspace":
|
|
@@ -387,56 +387,56 @@ function E({ id: n, renderChip: r }) {
|
|
|
387
387
|
return;
|
|
388
388
|
default: e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && i.inputNode?.focus({ preventScroll: !0 });
|
|
389
389
|
}
|
|
390
|
-
},
|
|
390
|
+
}, d = (e) => {
|
|
391
391
|
e.stopPropagation(), i.remove(n, e.nativeEvent), i.inputNode?.focus({ preventScroll: !0 });
|
|
392
392
|
};
|
|
393
|
-
return /* @__PURE__ */
|
|
393
|
+
return /* @__PURE__ */ x("span", {
|
|
394
394
|
"aria-busy": c ? !0 : void 0,
|
|
395
|
-
"aria-label":
|
|
395
|
+
"aria-label": u,
|
|
396
396
|
"data-part": "root",
|
|
397
397
|
"data-size": "sm",
|
|
398
398
|
"data-tone": "secondary",
|
|
399
399
|
"data-ui": "tag",
|
|
400
400
|
"data-value": n,
|
|
401
401
|
"data-variant": l || c ? "outline" : "soft",
|
|
402
|
-
onKeyDown:
|
|
402
|
+
onKeyDown: ne,
|
|
403
403
|
role: "gridcell",
|
|
404
404
|
tabIndex: -1,
|
|
405
405
|
...c ? { "data-loading": "" } : {},
|
|
406
406
|
...l ? { "data-unresolved": "" } : {},
|
|
407
407
|
...i.disabled ? { "data-disabled": "" } : {},
|
|
408
|
-
children: [/* @__PURE__ */
|
|
408
|
+
children: [/* @__PURE__ */ x("span", {
|
|
409
409
|
"data-part": "body",
|
|
410
|
-
children: [i.media === "avatar" && o?.avatar !== null ? /* @__PURE__ */
|
|
410
|
+
children: [i.media === "avatar" && o?.avatar !== null ? /* @__PURE__ */ b("span", {
|
|
411
411
|
"data-part": "start",
|
|
412
|
-
children: o === void 0 ? c ? /* @__PURE__ */
|
|
412
|
+
children: o === void 0 ? c ? /* @__PURE__ */ b("span", {
|
|
413
413
|
"aria-hidden": "true",
|
|
414
414
|
"data-loading": "",
|
|
415
415
|
"data-part": "root",
|
|
416
416
|
"data-shape": "circle",
|
|
417
417
|
"data-size": "xs",
|
|
418
418
|
"data-ui": "skeleton"
|
|
419
|
-
}) : l ? /* @__PURE__ */
|
|
419
|
+
}) : l ? /* @__PURE__ */ b(t, { children: /* @__PURE__ */ b(e, { name: "circle-alert" }) }) : null : /* @__PURE__ */ b(Ie, {
|
|
420
420
|
entity: o,
|
|
421
421
|
locale: i.locale
|
|
422
422
|
})
|
|
423
|
-
}) : null, /* @__PURE__ */
|
|
423
|
+
}) : null, /* @__PURE__ */ b("span", {
|
|
424
424
|
"data-part": "label",
|
|
425
|
-
children: c ? /* @__PURE__ */
|
|
425
|
+
children: c ? /* @__PURE__ */ b("span", {
|
|
426
426
|
"aria-hidden": "true",
|
|
427
427
|
"data-loading": "",
|
|
428
428
|
"data-part": "root",
|
|
429
429
|
"data-shape": "text",
|
|
430
430
|
"data-ui": "skeleton"
|
|
431
|
-
}) : o !== void 0 && r !== void 0 ? r(o) :
|
|
431
|
+
}) : o !== void 0 && r !== void 0 ? r(o) : te
|
|
432
432
|
})]
|
|
433
|
-
}), ee ? null : /* @__PURE__ */
|
|
434
|
-
"aria-label": a("remove", { label: o?.label ??
|
|
433
|
+
}), ee ? null : /* @__PURE__ */ b("button", {
|
|
434
|
+
"aria-label": a("remove", { label: o?.label ?? te }),
|
|
435
435
|
"data-part": "remove",
|
|
436
|
-
onClick:
|
|
436
|
+
onClick: d,
|
|
437
437
|
tabIndex: -1,
|
|
438
438
|
type: "button",
|
|
439
|
-
children: /* @__PURE__ */
|
|
439
|
+
children: /* @__PURE__ */ b(t, { children: /* @__PURE__ */ b(e, { name: "x" }) })
|
|
440
440
|
})]
|
|
441
441
|
});
|
|
442
442
|
}
|
|
@@ -446,21 +446,21 @@ function D(e) {
|
|
|
446
446
|
e.defaultPrevented || e.preventDefault();
|
|
447
447
|
}
|
|
448
448
|
function O() {
|
|
449
|
-
return /* @__PURE__ */
|
|
450
|
-
/* @__PURE__ */
|
|
449
|
+
return /* @__PURE__ */ x("div", { children: [
|
|
450
|
+
/* @__PURE__ */ b("span", {
|
|
451
451
|
"data-loading": "",
|
|
452
452
|
"data-part": "root",
|
|
453
453
|
"data-shape": "circle",
|
|
454
454
|
"data-size": "xs",
|
|
455
455
|
"data-ui": "skeleton"
|
|
456
456
|
}),
|
|
457
|
-
/* @__PURE__ */
|
|
457
|
+
/* @__PURE__ */ b("span", {
|
|
458
458
|
"data-loading": "",
|
|
459
459
|
"data-part": "root",
|
|
460
460
|
"data-shape": "text",
|
|
461
461
|
"data-ui": "skeleton"
|
|
462
462
|
}),
|
|
463
|
-
/* @__PURE__ */
|
|
463
|
+
/* @__PURE__ */ b("span", {
|
|
464
464
|
"data-loading": "",
|
|
465
465
|
"data-part": "root",
|
|
466
466
|
"data-shape": "text",
|
|
@@ -469,80 +469,99 @@ function O() {
|
|
|
469
469
|
] });
|
|
470
470
|
}
|
|
471
471
|
function Re() {
|
|
472
|
-
let n = k(), { t: r, search: i } = n, a =
|
|
473
|
-
|
|
474
|
-
let e =
|
|
475
|
-
present:
|
|
476
|
-
onStatusChange:
|
|
472
|
+
let n = k(), { t: r, search: i } = n, a = ie(), [s, c] = y(null), [l, ee] = y(null), [u, te] = y(null), [ne, d] = y("unmounted"), [f, re] = y(!1), h = v(null), _ = v(null), S = v(n);
|
|
473
|
+
S.current = n, m(() => {
|
|
474
|
+
let e = oe({
|
|
475
|
+
present: S.current.open,
|
|
476
|
+
onStatusChange: d
|
|
477
477
|
});
|
|
478
|
-
return
|
|
479
|
-
e.destroy(),
|
|
478
|
+
return h.current = e, d(e.status), () => {
|
|
479
|
+
e.destroy(), h.current = null;
|
|
480
|
+
};
|
|
481
|
+
}, []), m(() => h.current?.sync(n.open), [n.open]), m(() => h.current?.setNode(s), [s]);
|
|
482
|
+
let le = n.open || ne !== "unmounted";
|
|
483
|
+
m(() => {
|
|
484
|
+
let e = n.inputNode;
|
|
485
|
+
if (e === null || f) return;
|
|
486
|
+
let t = () => re(!0);
|
|
487
|
+
return e.addEventListener("focusin", t), e.addEventListener("pointerdown", t), () => {
|
|
488
|
+
e.removeEventListener("focusin", t), e.removeEventListener("pointerdown", t);
|
|
480
489
|
};
|
|
481
|
-
}, [
|
|
482
|
-
let
|
|
483
|
-
|
|
484
|
-
if (!
|
|
485
|
-
|
|
490
|
+
}, [n.inputNode, f]);
|
|
491
|
+
let fe = le || f;
|
|
492
|
+
g(() => {
|
|
493
|
+
if (!fe) {
|
|
494
|
+
te(null);
|
|
486
495
|
return;
|
|
487
496
|
}
|
|
488
|
-
let e =
|
|
497
|
+
let e = se({
|
|
489
498
|
origin: n.inputNode,
|
|
490
499
|
disabled: !n.portal
|
|
491
500
|
});
|
|
492
|
-
return
|
|
501
|
+
return te(e.container), () => e.release();
|
|
493
502
|
}, [
|
|
494
|
-
|
|
503
|
+
fe,
|
|
495
504
|
n.inputNode,
|
|
496
505
|
n.portal
|
|
497
506
|
]);
|
|
498
|
-
let { side:
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
507
|
+
let { side: me, strategy: he, width: w, controlNode: T } = n, _e = v(null), ve = p((e, t) => {
|
|
508
|
+
e.update().then(() => {
|
|
509
|
+
_e.current === e && S.current.open && t.setAttribute("data-open", "");
|
|
510
|
+
});
|
|
511
|
+
}, []);
|
|
512
|
+
g(() => {
|
|
513
|
+
if (s === null || T === null) return;
|
|
514
|
+
let e = ue(T, s, {
|
|
502
515
|
align: "start",
|
|
503
516
|
alignOffset: 0,
|
|
504
517
|
boundaryPadding: 8,
|
|
505
518
|
flip: !0,
|
|
506
519
|
hideWhenDetached: !0,
|
|
507
|
-
matchWidth:
|
|
520
|
+
matchWidth: w === "anchor",
|
|
508
521
|
shift: !0,
|
|
509
|
-
side:
|
|
522
|
+
side: me,
|
|
510
523
|
sideOffset: 4,
|
|
511
524
|
strategy: he
|
|
512
525
|
});
|
|
513
|
-
return
|
|
514
|
-
e
|
|
515
|
-
}), () => {
|
|
516
|
-
e = !1, t.destroy(), d(!1);
|
|
526
|
+
return _e.current = e, S.current.open && ve(e, s), () => {
|
|
527
|
+
e.destroy(), _e.current = null, s.removeAttribute("data-open");
|
|
517
528
|
};
|
|
518
529
|
}, [
|
|
519
|
-
|
|
530
|
+
T,
|
|
520
531
|
s,
|
|
521
|
-
|
|
532
|
+
ve,
|
|
533
|
+
me,
|
|
522
534
|
he,
|
|
523
|
-
|
|
524
|
-
]),
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
535
|
+
w
|
|
536
|
+
]), g(() => {
|
|
537
|
+
let e = _e.current;
|
|
538
|
+
e !== null && s !== null && (n.open ? ve(e, s) : s.removeAttribute("data-open"));
|
|
539
|
+
}, [
|
|
540
|
+
s,
|
|
541
|
+
n.open,
|
|
542
|
+
ve
|
|
543
|
+
]), m(() => {
|
|
544
|
+
if (s === null || !n.open || T === null) return;
|
|
545
|
+
let e = ce(s, {
|
|
546
|
+
branches: [T],
|
|
528
547
|
escape: !0,
|
|
529
548
|
focusOutside: !1,
|
|
530
549
|
modal: !1,
|
|
531
550
|
outsidePress: !0,
|
|
532
551
|
scrollLock: !1,
|
|
533
552
|
onDismiss: (e) => {
|
|
534
|
-
|
|
553
|
+
S.current.setOpen(!1, e.reason === "escape" ? "escape" : "outsidePress", e.source);
|
|
535
554
|
}
|
|
536
555
|
});
|
|
537
556
|
return () => e.destroy();
|
|
538
557
|
}, [
|
|
539
|
-
|
|
558
|
+
T,
|
|
540
559
|
s,
|
|
541
560
|
n.open
|
|
542
561
|
]);
|
|
543
|
-
let
|
|
544
|
-
|
|
545
|
-
let e =
|
|
562
|
+
let ye = n.options.map((e) => e.key).join("");
|
|
563
|
+
g(() => {
|
|
564
|
+
let e = S.current;
|
|
546
565
|
if (!e.open) return;
|
|
547
566
|
let t = e.options, n = e.entry.current;
|
|
548
567
|
if (n !== "keep") {
|
|
@@ -551,7 +570,7 @@ function Re() {
|
|
|
551
570
|
return;
|
|
552
571
|
}
|
|
553
572
|
e.highlighted !== null && !t.some((t) => t.key === e.highlighted) && e.setHighlighted(null, "keyboard");
|
|
554
|
-
}, [
|
|
573
|
+
}, [ye, n.open]), m(() => {
|
|
555
574
|
if (l === null || n.highlighted === null) return;
|
|
556
575
|
let e = l.ownerDocument.getElementById(n.optionId(n.highlighted));
|
|
557
576
|
typeof e?.scrollIntoView == "function" && e.scrollIntoView({ block: "nearest" });
|
|
@@ -560,38 +579,38 @@ function Re() {
|
|
|
560
579
|
n.highlighted,
|
|
561
580
|
l
|
|
562
581
|
]);
|
|
563
|
-
let
|
|
564
|
-
if (
|
|
565
|
-
|
|
566
|
-
}, [
|
|
567
|
-
let e =
|
|
582
|
+
let be = i.status === "error";
|
|
583
|
+
if (m(() => {
|
|
584
|
+
be && S.current.open && pe(S.current.inputNode?.ownerDocument).announce(S.current.t("error"), { repeat: !0 });
|
|
585
|
+
}, [be]), m(() => {
|
|
586
|
+
let e = _.current, t = l;
|
|
568
587
|
if (e === null || t === null || !i.hasMore || typeof IntersectionObserver != "function") return;
|
|
569
588
|
let n = new IntersectionObserver((e) => {
|
|
570
|
-
e.some((e) => e.isIntersecting) &&
|
|
589
|
+
e.some((e) => e.isIntersecting) && S.current.session.more();
|
|
571
590
|
}, { root: t });
|
|
572
591
|
return n.observe(e), () => n.disconnect();
|
|
573
592
|
}, [
|
|
574
593
|
i.hasMore,
|
|
575
594
|
i.items.length,
|
|
576
595
|
l
|
|
577
|
-
]), !
|
|
578
|
-
let
|
|
596
|
+
]), !le) return null;
|
|
597
|
+
let xe = n.options.filter((e) => e.key !== C && e.key !== ge).length, Se = i.status === "loading" && i.items.length === 0, Ce = i.status === "loading" && i.items.length > 0 && i.indicator, we = i.status === "error", Te = xe === 0 && !n.offerCreate && !we && !Se && i.status !== "waiting" && i.status !== "short", Ee = i.status === "short" ? r("minQuery", { count: n.props.minQueryLength ?? 0 }) : we ? null : i.indicator && (Se || i.loadingMore) ? r("loading") : i.status === "ready" && n.query !== "" ? r("count", { count: i.total ?? i.items.length }) : null, De = (r) => {
|
|
579
598
|
let i = r.id, a = n.chosen.includes(i), s = n.highlighted === i, c = n.options.find((e) => e.key === i)?.disabled ?? r.disabled === !0, l = (e) => {
|
|
580
599
|
c || (n.activate(i, "pointer", e.nativeEvent), n.inputNode?.focus({ preventScroll: !0 }));
|
|
581
|
-
}, ee = n.props.renderOption === void 0 ? /* @__PURE__ */
|
|
582
|
-
/* @__PURE__ */
|
|
600
|
+
}, ee = n.props.renderOption === void 0 ? /* @__PURE__ */ x(ae, { children: [
|
|
601
|
+
/* @__PURE__ */ b("span", {
|
|
583
602
|
"data-part": "label",
|
|
584
|
-
children: n.highlightMatch && n.query !== "" ? /* @__PURE__ */
|
|
603
|
+
children: n.highlightMatch && n.query !== "" ? /* @__PURE__ */ b(o, {
|
|
585
604
|
locale: n.locale,
|
|
586
605
|
query: n.query,
|
|
587
606
|
text: r.label
|
|
588
607
|
}) : r.label
|
|
589
608
|
}),
|
|
590
|
-
r.description === void 0 ? null : /* @__PURE__ */
|
|
609
|
+
r.description === void 0 ? null : /* @__PURE__ */ b("span", {
|
|
591
610
|
"data-part": "description",
|
|
592
611
|
children: r.description
|
|
593
612
|
}),
|
|
594
|
-
r.meta === void 0 ? null : /* @__PURE__ */
|
|
613
|
+
r.meta === void 0 ? null : /* @__PURE__ */ b("span", {
|
|
595
614
|
"data-part": "meta",
|
|
596
615
|
children: r.meta
|
|
597
616
|
})
|
|
@@ -601,7 +620,7 @@ function Re() {
|
|
|
601
620
|
query: n.query,
|
|
602
621
|
selected: a
|
|
603
622
|
});
|
|
604
|
-
return /* @__PURE__ */
|
|
623
|
+
return /* @__PURE__ */ x("div", {
|
|
605
624
|
"aria-disabled": c ? !0 : void 0,
|
|
606
625
|
"aria-selected": a,
|
|
607
626
|
"data-part": "item",
|
|
@@ -617,21 +636,21 @@ function Re() {
|
|
|
617
636
|
...a ? { "data-selected": "" } : {},
|
|
618
637
|
...c ? { "data-disabled": "" } : {},
|
|
619
638
|
children: [
|
|
620
|
-
n.media === "avatar" && r.avatar !== null ? /* @__PURE__ */
|
|
639
|
+
n.media === "avatar" && r.avatar !== null ? /* @__PURE__ */ b("span", {
|
|
621
640
|
"data-part": "media",
|
|
622
|
-
children: /* @__PURE__ */
|
|
641
|
+
children: /* @__PURE__ */ b(Ie, {
|
|
623
642
|
entity: r,
|
|
624
643
|
locale: n.locale
|
|
625
644
|
})
|
|
626
645
|
}) : null,
|
|
627
646
|
ee,
|
|
628
|
-
/* @__PURE__ */
|
|
647
|
+
/* @__PURE__ */ b("span", {
|
|
629
648
|
"data-part": "indicator",
|
|
630
|
-
children: /* @__PURE__ */
|
|
649
|
+
children: /* @__PURE__ */ b(t, { children: /* @__PURE__ */ b(e, { name: "check" }) })
|
|
631
650
|
})
|
|
632
651
|
]
|
|
633
652
|
}, i);
|
|
634
|
-
},
|
|
653
|
+
}, Oe = (r, i, a) => /* @__PURE__ */ x("div", {
|
|
635
654
|
"aria-selected": !1,
|
|
636
655
|
"data-part": "item",
|
|
637
656
|
"data-value": r,
|
|
@@ -640,18 +659,18 @@ function Re() {
|
|
|
640
659
|
onPointerDown: D,
|
|
641
660
|
onPointerEnter: (e) => n.setHighlighted(r, "pointer", e.nativeEvent),
|
|
642
661
|
role: "option",
|
|
643
|
-
...r ===
|
|
662
|
+
...r === C ? { "data-create": "" } : { "data-retry": "" },
|
|
644
663
|
...n.highlighted === r ? { "data-current": "" } : {},
|
|
645
|
-
...n.creating && r ===
|
|
646
|
-
children: [/* @__PURE__ */
|
|
664
|
+
...n.creating && r === C ? { "data-loading": "" } : {},
|
|
665
|
+
children: [/* @__PURE__ */ b("span", {
|
|
647
666
|
"aria-hidden": "true",
|
|
648
667
|
"data-part": "media",
|
|
649
|
-
children: /* @__PURE__ */
|
|
650
|
-
}), /* @__PURE__ */
|
|
668
|
+
children: /* @__PURE__ */ b(t, { children: /* @__PURE__ */ b(e, { name: r === C ? "plus" : "rotate-ccw" }) })
|
|
669
|
+
}), /* @__PURE__ */ b("span", {
|
|
651
670
|
"data-part": "label",
|
|
652
671
|
children: i
|
|
653
672
|
})]
|
|
654
|
-
}), { sections:
|
|
673
|
+
}), { sections: ke, headings: Ae } = n.sections, je = !(we && i.items.length === 0), Me = /* @__PURE__ */ b("div", {
|
|
655
674
|
"data-align": "start",
|
|
656
675
|
"data-part": "positioner",
|
|
657
676
|
"data-size": n.size,
|
|
@@ -659,8 +678,7 @@ function Re() {
|
|
|
659
678
|
"data-width": n.width,
|
|
660
679
|
ref: c,
|
|
661
680
|
...n.open ? {} : { inert: !0 },
|
|
662
|
-
|
|
663
|
-
children: /* @__PURE__ */ v("div", {
|
|
681
|
+
children: /* @__PURE__ */ x("div", {
|
|
664
682
|
"aria-busy": i.status === "loading" || void 0,
|
|
665
683
|
"aria-label": n.props["aria-label"],
|
|
666
684
|
"data-part": "content",
|
|
@@ -668,61 +686,61 @@ function Re() {
|
|
|
668
686
|
ref: ee,
|
|
669
687
|
role: "listbox",
|
|
670
688
|
...n.multiple ? { "aria-multiselectable": !0 } : {},
|
|
671
|
-
...
|
|
689
|
+
...Ce ? { "data-loading": "" } : {},
|
|
672
690
|
children: [
|
|
673
|
-
|
|
691
|
+
je ? ke.map((e) => Ae ? /* @__PURE__ */ x("div", {
|
|
674
692
|
"aria-labelledby": `${a}${e.key}`,
|
|
675
693
|
"data-part": "group",
|
|
676
694
|
role: "group",
|
|
677
|
-
children: [/* @__PURE__ */
|
|
695
|
+
children: [/* @__PURE__ */ b("div", {
|
|
678
696
|
"data-part": "group-label",
|
|
679
697
|
id: `${a}${e.key}`,
|
|
680
698
|
children: e.label
|
|
681
|
-
}), e.entities.map(
|
|
682
|
-
}, e.key) : e.entities.map(
|
|
683
|
-
|
|
699
|
+
}), e.entities.map(De)]
|
|
700
|
+
}, e.key) : e.entities.map(De)) : null,
|
|
701
|
+
Se && i.indicator ? /* @__PURE__ */ x("div", {
|
|
684
702
|
"aria-hidden": "true",
|
|
685
703
|
"data-part": "placeholder",
|
|
686
704
|
children: [
|
|
687
|
-
/* @__PURE__ */
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
/* @__PURE__ */
|
|
705
|
+
/* @__PURE__ */ b(O, {}),
|
|
706
|
+
/* @__PURE__ */ b(O, {}),
|
|
707
|
+
/* @__PURE__ */ b(O, {})
|
|
690
708
|
]
|
|
691
709
|
}) : null,
|
|
692
|
-
i.loadingMore && i.indicator ? /* @__PURE__ */
|
|
710
|
+
i.loadingMore && i.indicator ? /* @__PURE__ */ b("div", {
|
|
693
711
|
"aria-hidden": "true",
|
|
694
712
|
"data-part": "more",
|
|
695
|
-
children: /* @__PURE__ */
|
|
713
|
+
children: /* @__PURE__ */ b(O, {})
|
|
696
714
|
}) : null,
|
|
697
|
-
/* @__PURE__ */
|
|
698
|
-
n.offerCreate ?
|
|
699
|
-
|
|
715
|
+
/* @__PURE__ */ b("div", { ref: _ }),
|
|
716
|
+
n.offerCreate ? Oe(C, r("create", { query: n.query.trim() }), (e) => n.activate(C, "pointer", e.nativeEvent)) : null,
|
|
717
|
+
we ? /* @__PURE__ */ x("div", {
|
|
700
718
|
"data-part": "error",
|
|
701
|
-
children: [/* @__PURE__ */
|
|
719
|
+
children: [/* @__PURE__ */ b(t, { children: /* @__PURE__ */ b(e, { name: "circle-alert" }) }), r("error")]
|
|
702
720
|
}) : null,
|
|
703
|
-
|
|
721
|
+
we ? Oe(ge, r("retry"), () => {
|
|
704
722
|
n.retry(), n.inputNode?.focus({ preventScroll: !0 });
|
|
705
723
|
}) : null,
|
|
706
|
-
|
|
724
|
+
Te ? /* @__PURE__ */ b("div", {
|
|
707
725
|
"data-part": "empty",
|
|
708
726
|
children: r("empty")
|
|
709
727
|
}) : null,
|
|
710
|
-
/* @__PURE__ */
|
|
728
|
+
/* @__PURE__ */ b("div", {
|
|
711
729
|
"aria-live": "polite",
|
|
712
730
|
"data-part": "status",
|
|
713
731
|
role: "status",
|
|
714
|
-
children:
|
|
732
|
+
children: Ee
|
|
715
733
|
})
|
|
716
734
|
]
|
|
717
735
|
})
|
|
718
736
|
});
|
|
719
|
-
return
|
|
737
|
+
return u === null ? Me : de(Me, u);
|
|
720
738
|
}
|
|
721
739
|
//#endregion
|
|
722
740
|
//#region src/entity-picker/entity-picker.tsx
|
|
723
|
-
var ze =
|
|
741
|
+
var ze = f(void 0);
|
|
724
742
|
function k() {
|
|
725
|
-
let e =
|
|
743
|
+
let e = re(ze);
|
|
726
744
|
if (e === void 0) throw Error("An entity picker part is outside an EntityPicker.");
|
|
727
745
|
return e;
|
|
728
746
|
}
|
|
@@ -755,26 +773,26 @@ function He(e) {
|
|
|
755
773
|
return Array.isArray(e) ? e : typeof e == "string" ? [e] : [];
|
|
756
774
|
}
|
|
757
775
|
function Ue(e) {
|
|
758
|
-
let { clearable: t, defaultHighlightedValue: i = null, defaultInputValue: o, defaultOpen: s = !1, defaultScope: c = null, disabled: l, entities: ee = A, favorites:
|
|
759
|
-
et.current === null && (et.current =
|
|
776
|
+
let { clearable: t, defaultHighlightedValue: i = null, defaultInputValue: o, defaultOpen: s = !1, defaultScope: c = null, disabled: l, entities: ee = A, favorites: u = A, fullWidth: te, handleRef: ne, highlightMatch: f, highlightedValue: re, inputValue: g, invalid: ae, items: S, locale: oe, messages: se, loop: ce, max: le, media: ue, minQueryLength: de, onCreate: me, open: he, openOn: w, overflow: ye, portal: be, readOnly: Se, recent: Te = A, required: De, scope: Oe, searchDelay: ke, side: je, size: Me, source: Ne, strategy: Pe, variant: Fe, width: Ie } = e, E = e.selectionMode === "multiple", D = Ae(), O = a(), k = ie(), Ue = `${k}listbox`, We = `${k}input`, Ge = p((e) => `${k}option-${encodeURIComponent(e)}`, [k]), j = r(fe, se), Ke = n(), qe = oe ?? Ke, Je = l ?? O?.disabled ?? D.disabled, Ye = Se ?? O?.readOnly ?? D.readOnly, Xe = de ?? D.minQueryLength, [Ze, Qe] = y(0), $e = p(() => Qe((e) => e + 1), []), et = v(null);
|
|
777
|
+
et.current === null && (et.current = T());
|
|
760
778
|
let M = et.current;
|
|
761
|
-
M.remember(ee), M.remember(
|
|
762
|
-
let tt =
|
|
763
|
-
|
|
779
|
+
M.remember(ee), M.remember(u), M.remember(Te);
|
|
780
|
+
let tt = _(() => Ne ?? we(S ?? A, { locale: qe }), [
|
|
781
|
+
S,
|
|
764
782
|
qe,
|
|
765
|
-
|
|
766
|
-
]), N =
|
|
783
|
+
Ne
|
|
784
|
+
]), N = v(tt);
|
|
767
785
|
N.current = tt;
|
|
768
|
-
let nt =
|
|
786
|
+
let nt = _(() => ({
|
|
769
787
|
search: (e, t) => N.current.search(e, t),
|
|
770
788
|
resolve: (e, t) => N.current.resolve === void 0 ? Promise.resolve([]) : N.current.resolve(e, t)
|
|
771
|
-
}), []), [rt, it] =
|
|
789
|
+
}), []), [rt, it] = y(null), P = v(Xe);
|
|
772
790
|
P.current = Xe;
|
|
773
|
-
let F =
|
|
774
|
-
F.current =
|
|
775
|
-
let [I, at] =
|
|
776
|
-
|
|
777
|
-
let e =
|
|
791
|
+
let F = v(ke ?? D.searchDelay);
|
|
792
|
+
F.current = ke ?? D.searchDelay;
|
|
793
|
+
let [I, at] = y(null);
|
|
794
|
+
m(() => {
|
|
795
|
+
let e = ve({
|
|
778
796
|
source: nt,
|
|
779
797
|
get delay() {
|
|
780
798
|
return F.current;
|
|
@@ -784,7 +802,7 @@ function Ue(e) {
|
|
|
784
802
|
},
|
|
785
803
|
onChange: it,
|
|
786
804
|
onResults: (e) => M.remember(e)
|
|
787
|
-
}), t =
|
|
805
|
+
}), t = _e({
|
|
788
806
|
source: {
|
|
789
807
|
search: nt.search,
|
|
790
808
|
resolve: (e, t) => N.current.resolve === void 0 ? Promise.reject(/* @__PURE__ */ Error("no resolve")) : N.current.resolve(e, t)
|
|
@@ -803,7 +821,7 @@ function Ue(e) {
|
|
|
803
821
|
M,
|
|
804
822
|
nt
|
|
805
823
|
]);
|
|
806
|
-
let L = I?.session ?? Be, ot = I?.resolver ?? Ve, st = He(e.defaultValue), [ct, lt] =
|
|
824
|
+
let L = I?.session ?? Be, ot = I?.resolver ?? Ve, st = He(e.defaultValue), [ct, lt] = y(st), [ut, dt] = y(s), [ft, pt] = y(i), [mt, ht] = y(c), gt = e.value, R = gt === void 0 ? ct : He(gt), z = (he ?? ut) && !Je, B = re === void 0 ? ft : re, V = Oe === void 0 ? mt : Oe, H = (e) => e === void 0 ? "" : M.get(e)?.label ?? "", [_t, vt] = y(() => o ?? (E ? "" : H(st[0]))), yt = g ?? _t, [U, W] = y(!1), G = E || U ? yt : "", bt = v("keep"), [K, xt] = y(null), [St, Ct] = y(null), q = v({
|
|
807
825
|
props: e,
|
|
808
826
|
currentIds: R,
|
|
809
827
|
currentOpen: z,
|
|
@@ -821,12 +839,12 @@ function Ue(e) {
|
|
|
821
839
|
currentScope: V,
|
|
822
840
|
typed: U
|
|
823
841
|
};
|
|
824
|
-
let J =
|
|
825
|
-
|
|
826
|
-
}, [K]), Y =
|
|
842
|
+
let J = p((e) => {
|
|
843
|
+
pe(K?.ownerDocument).announce(e, { repeat: !0 });
|
|
844
|
+
}, [K]), Y = p((e, t, n) => {
|
|
827
845
|
let r = q.current, i = r.currentIds;
|
|
828
846
|
if (e.length === i.length && e.every((e, t) => e === i[t])) return !1;
|
|
829
|
-
let a = r.props.selectionMode === "multiple", o = (e) => a ? e : e[0] ?? null, s =
|
|
847
|
+
let a = r.props.selectionMode === "multiple", o = (e) => a ? e : e[0] ?? null, s = d({
|
|
830
848
|
controlled: r.props.value,
|
|
831
849
|
initial: o(i),
|
|
832
850
|
equals: (e, t) => JSON.stringify(e) === JSON.stringify(t),
|
|
@@ -836,39 +854,39 @@ function Ue(e) {
|
|
|
836
854
|
}
|
|
837
855
|
}).request(o(e), t, n);
|
|
838
856
|
return s && lt(e), s || r.props.value !== void 0;
|
|
839
|
-
}, [M]), X =
|
|
857
|
+
}, [M]), X = p((e, t, n) => {
|
|
840
858
|
let r = q.current;
|
|
841
|
-
e !== r.currentInput &&
|
|
859
|
+
e !== r.currentInput && d({
|
|
842
860
|
controlled: r.props.inputValue,
|
|
843
861
|
initial: r.currentInput,
|
|
844
862
|
onRequest: (e) => r.props.onInputValueChange?.(e.value, e)
|
|
845
863
|
}).request(e, t, n) && vt(e);
|
|
846
|
-
}, []), Z =
|
|
864
|
+
}, []), Z = p((e, t, n) => {
|
|
847
865
|
let r = q.current;
|
|
848
|
-
e !== r.currentOpen &&
|
|
866
|
+
e !== r.currentOpen && d({
|
|
849
867
|
controlled: r.props.open,
|
|
850
868
|
initial: r.currentOpen,
|
|
851
869
|
onRequest: (e) => r.props.onOpenChange?.(e.value, e)
|
|
852
870
|
}).request(e, t, n) && (dt(e), e || (pt(null), bt.current = "keep"));
|
|
853
|
-
}, []), wt =
|
|
871
|
+
}, []), wt = p((e, t, n) => {
|
|
854
872
|
let r = q.current;
|
|
855
|
-
e !== r.currentHighlighted &&
|
|
873
|
+
e !== r.currentHighlighted && d({
|
|
856
874
|
controlled: r.props.highlightedValue,
|
|
857
875
|
initial: r.currentHighlighted,
|
|
858
876
|
onRequest: (e) => r.props.onHighlightedValueChange?.(e.value, e)
|
|
859
877
|
}).request(e, t, n) && pt(e);
|
|
860
|
-
}, []), Tt =
|
|
878
|
+
}, []), Tt = p((e, t, n) => {
|
|
861
879
|
let r = q.current;
|
|
862
|
-
e !== r.currentScope &&
|
|
880
|
+
e !== r.currentScope && d({
|
|
863
881
|
controlled: r.props.scope,
|
|
864
882
|
initial: r.currentScope,
|
|
865
883
|
onRequest: (e) => r.props.onScopeChange?.(e.value, e)
|
|
866
884
|
}).request(e, t, n) && ht(e);
|
|
867
|
-
}, []), Et =
|
|
885
|
+
}, []), Et = p((e, t) => {
|
|
868
886
|
W(!0), X(e, "keyboard", t);
|
|
869
|
-
}, [X]), Dt =
|
|
887
|
+
}, [X]), Dt = p((e, t, n) => {
|
|
870
888
|
Y(e === null ? [] : [e], t, n), W(!1), X(e === null ? "" : H(e), "select", n);
|
|
871
|
-
}, [Y, X]), Q = E ?
|
|
889
|
+
}, [Y, X]), Q = E ? le ?? null : null, Ot = p((e, t, n) => {
|
|
872
890
|
let r = q.current.currentIds, i = H(e);
|
|
873
891
|
if (r.includes(e)) {
|
|
874
892
|
let a = r.filter((t) => t !== e);
|
|
@@ -891,7 +909,7 @@ function Ue(e) {
|
|
|
891
909
|
Y,
|
|
892
910
|
X,
|
|
893
911
|
j
|
|
894
|
-
]), kt =
|
|
912
|
+
]), kt = p((e, t) => {
|
|
895
913
|
let n = q.current.currentIds.filter((t) => t !== e);
|
|
896
914
|
Y(n, "remove", t) && J(j("removed", {
|
|
897
915
|
label: H(e) || j("unresolved"),
|
|
@@ -901,9 +919,9 @@ function Ue(e) {
|
|
|
901
919
|
J,
|
|
902
920
|
Y,
|
|
903
921
|
j
|
|
904
|
-
]), At =
|
|
922
|
+
]), At = p((e) => {
|
|
905
923
|
Y([], "clear", e), W(!1), X("", "clear", e);
|
|
906
|
-
}, [Y, X]), [jt, Mt] =
|
|
924
|
+
}, [Y, X]), [jt, Mt] = y(!1), Nt = p((e, t) => {
|
|
907
925
|
let n = q.current, r = n.currentInput.trim(), i = n.props.onCreate;
|
|
908
926
|
if (i === void 0 || r === "") return;
|
|
909
927
|
let a = (e) => {
|
|
@@ -926,12 +944,12 @@ function Ue(e) {
|
|
|
926
944
|
Y,
|
|
927
945
|
X,
|
|
928
946
|
j
|
|
929
|
-
]), Pt =
|
|
930
|
-
if (e ===
|
|
947
|
+
]), Pt = p((e, t, n) => {
|
|
948
|
+
if (e === ge) {
|
|
931
949
|
L.retry();
|
|
932
950
|
return;
|
|
933
951
|
}
|
|
934
|
-
if (e ===
|
|
952
|
+
if (e === C) {
|
|
935
953
|
Nt(t, n), E || Z(!1, "select", n);
|
|
936
954
|
return;
|
|
937
955
|
}
|
|
@@ -950,7 +968,7 @@ function Ue(e) {
|
|
|
950
968
|
L,
|
|
951
969
|
Z,
|
|
952
970
|
Ot
|
|
953
|
-
]), Ft =
|
|
971
|
+
]), Ft = p((e) => {
|
|
954
972
|
let t = q.current;
|
|
955
973
|
if (t.props.selectionMode !== "multiple" && t.typed) {
|
|
956
974
|
if (t.currentInput.trim() === "") {
|
|
@@ -959,7 +977,7 @@ function Ue(e) {
|
|
|
959
977
|
}
|
|
960
978
|
W(!1), X(H(t.currentIds[0]), "blur", e);
|
|
961
979
|
}
|
|
962
|
-
}, [Y, X]), It =
|
|
980
|
+
}, [Y, X]), It = p((e) => {
|
|
963
981
|
let t = q.current, n = H(t.currentIds[0]);
|
|
964
982
|
if (t.currentIds.length === 0) {
|
|
965
983
|
W(!1), X("", "programmatic", e);
|
|
@@ -970,8 +988,8 @@ function Ue(e) {
|
|
|
970
988
|
return;
|
|
971
989
|
}
|
|
972
990
|
W(!1), X(n, "programmatic", e);
|
|
973
|
-
}, [At, X]), Lt =
|
|
974
|
-
|
|
991
|
+
}, [At, X]), Lt = p((e) => X("", "clear", e), [X]);
|
|
992
|
+
m(() => {
|
|
975
993
|
ot.require(R);
|
|
976
994
|
}, [
|
|
977
995
|
R,
|
|
@@ -979,14 +997,14 @@ function Ue(e) {
|
|
|
979
997
|
Ze
|
|
980
998
|
]);
|
|
981
999
|
let Rt = E ? "" : H(R[0]);
|
|
982
|
-
|
|
1000
|
+
m(() => {
|
|
983
1001
|
E || U || q.current.currentInput !== Rt && X(Rt, "programmatic");
|
|
984
1002
|
}, [
|
|
985
1003
|
Rt,
|
|
986
1004
|
E,
|
|
987
1005
|
X,
|
|
988
1006
|
U
|
|
989
|
-
]),
|
|
1007
|
+
]), m(() => {
|
|
990
1008
|
z && L.search({
|
|
991
1009
|
query: G,
|
|
992
1010
|
scope: V,
|
|
@@ -997,7 +1015,7 @@ function Ue(e) {
|
|
|
997
1015
|
V,
|
|
998
1016
|
G,
|
|
999
1017
|
L
|
|
1000
|
-
]),
|
|
1018
|
+
]), h(ne, () => ({
|
|
1001
1019
|
close: () => Z(!1, "programmatic"),
|
|
1002
1020
|
focus: () => K?.focus({ preventScroll: !0 }),
|
|
1003
1021
|
open: () => Z(!0, "programmatic"),
|
|
@@ -1007,12 +1025,12 @@ function Ue(e) {
|
|
|
1007
1025
|
L,
|
|
1008
1026
|
Z
|
|
1009
1027
|
]);
|
|
1010
|
-
let $ = rt ?? L.state, zt = $.answered || $.status === "loading" ? $.items : A, Bt =
|
|
1028
|
+
let $ = rt ?? L.state, zt = $.answered || $.status === "loading" ? $.items : A, Bt = Ce({
|
|
1011
1029
|
query: G,
|
|
1012
1030
|
scope: V,
|
|
1013
1031
|
chosen: E ? M.pick(R) : A,
|
|
1014
|
-
favorites:
|
|
1015
|
-
recent:
|
|
1032
|
+
favorites: u,
|
|
1033
|
+
recent: Te,
|
|
1016
1034
|
results: $.status === "error" || $.status === "short" ? $.items : zt,
|
|
1017
1035
|
searchedEmpty: Xe === 0,
|
|
1018
1036
|
labels: {
|
|
@@ -1021,13 +1039,13 @@ function Ue(e) {
|
|
|
1021
1039
|
recent: j("recent"),
|
|
1022
1040
|
results: j("results")
|
|
1023
1041
|
}
|
|
1024
|
-
}), Vt = !jt &&
|
|
1025
|
-
enabled:
|
|
1042
|
+
}), Vt = !jt && Ee({
|
|
1043
|
+
enabled: me !== void 0,
|
|
1026
1044
|
query: G,
|
|
1027
1045
|
answered: $.status === "ready",
|
|
1028
1046
|
results: $.items,
|
|
1029
1047
|
locale: qe
|
|
1030
|
-
}), Ht =
|
|
1048
|
+
}), Ht = _(() => {
|
|
1031
1049
|
if (Q === null || R.length < Q) return;
|
|
1032
1050
|
let e = new Set(R);
|
|
1033
1051
|
return new Set(Bt.sections.flatMap((e) => e.entities).map((e) => e.id).filter((t) => !e.has(t)));
|
|
@@ -1035,12 +1053,12 @@ function Ue(e) {
|
|
|
1035
1053
|
R,
|
|
1036
1054
|
Q,
|
|
1037
1055
|
Bt
|
|
1038
|
-
]), Ut =
|
|
1056
|
+
]), Ut = xe({
|
|
1039
1057
|
sections: Bt.sections,
|
|
1040
1058
|
create: Vt,
|
|
1041
1059
|
...Ht === void 0 ? {} : { blocked: Ht }
|
|
1042
|
-
}), Wt = $.status === "error" ? [...Ut.filter((e) => e.key !==
|
|
1043
|
-
key:
|
|
1060
|
+
}), Wt = $.status === "error" ? [...Ut.filter((e) => e.key !== C), {
|
|
1061
|
+
key: ge,
|
|
1044
1062
|
disabled: !1
|
|
1045
1063
|
}] : Ut, Gt = {
|
|
1046
1064
|
activate: Pt,
|
|
@@ -1055,30 +1073,30 @@ function Ue(e) {
|
|
|
1055
1073
|
creating: jt,
|
|
1056
1074
|
disabled: Je,
|
|
1057
1075
|
entry: bt,
|
|
1058
|
-
fullWidth:
|
|
1059
|
-
highlightMatch:
|
|
1076
|
+
fullWidth: te ?? D.fullWidth,
|
|
1077
|
+
highlightMatch: f ?? D.highlightMatch,
|
|
1060
1078
|
highlighted: B,
|
|
1061
1079
|
inputId: We,
|
|
1062
1080
|
inputNode: K,
|
|
1063
1081
|
inputValue: yt,
|
|
1064
|
-
invalid:
|
|
1082
|
+
invalid: ae ?? O?.invalid ?? D.invalid,
|
|
1065
1083
|
locale: qe,
|
|
1066
|
-
loop:
|
|
1084
|
+
loop: ce ?? D.loop,
|
|
1067
1085
|
max: Q,
|
|
1068
|
-
media:
|
|
1086
|
+
media: ue ?? D.media,
|
|
1069
1087
|
multiple: E,
|
|
1070
1088
|
offerCreate: Vt,
|
|
1071
1089
|
open: z,
|
|
1072
|
-
openOn:
|
|
1090
|
+
openOn: w ?? D.openOn,
|
|
1073
1091
|
optionId: Ge,
|
|
1074
1092
|
options: Wt,
|
|
1075
|
-
overflow:
|
|
1076
|
-
portal:
|
|
1093
|
+
overflow: ye ?? D.overflow,
|
|
1094
|
+
portal: be ?? D.portal,
|
|
1077
1095
|
props: e,
|
|
1078
1096
|
query: G,
|
|
1079
1097
|
readOnly: Ye,
|
|
1080
1098
|
remove: kt,
|
|
1081
|
-
required:
|
|
1099
|
+
required: De ?? O?.required ?? D.required,
|
|
1082
1100
|
resolver: ot,
|
|
1083
1101
|
retry: () => L.retry(),
|
|
1084
1102
|
revert: It,
|
|
@@ -1093,18 +1111,18 @@ function Ue(e) {
|
|
|
1093
1111
|
setScope: Tt,
|
|
1094
1112
|
setTyped: Et,
|
|
1095
1113
|
settle: Ft,
|
|
1096
|
-
side:
|
|
1097
|
-
size:
|
|
1114
|
+
side: je ?? D.side,
|
|
1115
|
+
size: Me ?? O?.size ?? D.size,
|
|
1098
1116
|
strategy: Pe ?? D.strategy,
|
|
1099
1117
|
t: j,
|
|
1100
1118
|
variant: Fe ?? D.variant,
|
|
1101
1119
|
version: Ze,
|
|
1102
1120
|
width: Ie ?? D.width
|
|
1103
1121
|
};
|
|
1104
|
-
return /* @__PURE__ */
|
|
1122
|
+
return /* @__PURE__ */ x(ze.Provider, {
|
|
1105
1123
|
value: Gt,
|
|
1106
|
-
children: [/* @__PURE__ */
|
|
1124
|
+
children: [/* @__PURE__ */ b(Le, {}), /* @__PURE__ */ b(Re, {})]
|
|
1107
1125
|
});
|
|
1108
1126
|
}
|
|
1109
1127
|
//#endregion
|
|
1110
|
-
export { Ue as a,
|
|
1128
|
+
export { Ue as a, Ae as c, De as i, w as n, Oe as o, Te as r, je as s, he as t };
|