@box/metadata-editor 1.15.3 → 1.16.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.
Files changed (30) hide show
  1. package/dist/chunks/filter-dropdown-menu.module.js +9 -12
  2. package/dist/chunks/metadata-instance-form-card-wrapper.js +32 -32
  3. package/dist/chunks/taxonomy-ancestor-status-pill.js +37 -38
  4. package/dist/chunks/types.js +3 -3
  5. package/dist/chunks/utils2.js +28 -30
  6. package/dist/esm/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.js +93 -96
  7. package/dist/esm/lib/components/combobox-with-api-pagination/request.js +2 -2
  8. package/dist/esm/lib/components/combobox-with-api-pagination/use-async-list.js +3 -4
  9. package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-controllable-state.js +21 -24
  10. package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-intersection-observer.js +59 -61
  11. package/dist/esm/lib/components/filter-instances-dropdown/filter-instances-dropdown.js +39 -40
  12. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.js +37 -37
  13. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-float-field/use-float-validation.js +9 -9
  14. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +35 -36
  15. package/dist/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-field.js +52 -52
  16. package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +22 -23
  17. package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-fields.js +1 -2
  18. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/autofill-overlay.js +31 -32
  19. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance/custom-instance.js +22 -22
  20. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +114 -114
  21. package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js +96 -98
  22. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance/metadata-instance.js +29 -29
  23. package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.js +39 -40
  24. package/dist/esm/lib/constants.js +3 -3
  25. package/dist/i18n/en-x-pseudo.js +129 -129
  26. package/dist/i18n/en-x-pseudo.properties +129 -129
  27. package/dist/styles/autofill-overlay.css +1 -1
  28. package/dist/styles/filter-dropdown-menu.css +1 -1
  29. package/dist/styles/taxonomy-ancestor-status-pill.css +1 -1
  30. package/package.json +9 -9
@@ -1,17 +1,14 @@
1
- import '../styles/filter-dropdown-menu.css';const c = "_content_2vpjl_2", e = "_scrollableContainer_2vpjl_21", o = "_item_2vpjl_26", t = "_option_2vpjl_36", n = "_search_2vpjl_57", _ = "_searchIcon_2vpjl_62", a = "_global_2vpjl_71", l = "_clearSearchIcon_2vpjl_76", r = "_searchInput_2vpjl_84", s = "_firefoxDefaultOpacityFix_2vpjl_116", i = "_divider_2vpjl_134", p = "_searchDivider_2vpjl_138", v = {
1
+ import '../styles/filter-dropdown-menu.css';const c = "_content_2vpjl_2", e = "_scrollableContainer_2vpjl_21", n = "_item_2vpjl_26", o = "_option_2vpjl_36", t = "_search_2vpjl_57", s = "_searchIcon_2vpjl_62", r = "_clearSearchIcon_2vpjl_76", _ = "_searchInput_2vpjl_84", a = "_searchDivider_2vpjl_138", l = {
2
2
  content: c,
3
3
  scrollableContainer: e,
4
- item: o,
5
- option: t,
6
- search: n,
7
- searchIcon: _,
8
- global: a,
9
- clearSearchIcon: l,
10
- searchInput: r,
11
- firefoxDefaultOpacityFix: s,
12
- divider: i,
13
- searchDivider: p
4
+ item: n,
5
+ option: o,
6
+ search: t,
7
+ searchIcon: s,
8
+ clearSearchIcon: r,
9
+ searchInput: _,
10
+ searchDivider: a
14
11
  };
15
12
  export {
16
- v as s
13
+ l as s
17
14
  };
@@ -1,64 +1,64 @@
1
- import { useBlueprintModernization as E, Card as M } from "@box/blueprint-web";
2
- import S from "clsx";
3
- import { TEMPLATE_CUSTOM_PROPERTIES as b } from "../esm/lib/constants.js";
4
- import { MetadataInstanceFormFooter as w } from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/metadata-instance-form-footer.js";
5
- import { MetadataInstanceFormHeader as v } from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js";
6
- import { jsx as t, jsxs as x } from "react/jsx-runtime";
7
- import '../styles/metadata-instance-form-card-wrapper.css';const D = "_metadataInstanceForm_moyil_1", I = "_wrapperGradient_moyil_7", L = "_suggestionsFetching_moyil_17", N = "_metadataInstanceFormContent_moyil_23", O = "_showOverlay_moyil_30", s = {
8
- metadataInstanceForm: D,
9
- wrapperGradient: I,
1
+ import { useBlueprintModernization as A, Card as E } from "@box/blueprint-web";
2
+ import M from "clsx";
3
+ import { TEMPLATE_CUSTOM_PROPERTIES as S } from "../esm/lib/constants.js";
4
+ import { MetadataInstanceFormFooter as b } from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/metadata-instance-form-footer.js";
5
+ import { MetadataInstanceFormHeader as w } from "../esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js";
6
+ import { jsx as a, jsxs as v } from "react/jsx-runtime";
7
+ import '../styles/metadata-instance-form-card-wrapper.css';const x = "_metadataInstanceForm_moyil_1", D = "_wrapperGradient_moyil_7", L = "_suggestionsFetching_moyil_17", N = "_metadataInstanceFormContent_moyil_23", O = "_showOverlay_moyil_30", s = {
8
+ metadataInstanceForm: x,
9
+ wrapperGradient: D,
10
10
  suggestionsFetching: L,
11
11
  metadataInstanceFormContent: N,
12
12
  showOverlay: O
13
- }, K = (n) => {
13
+ }, z = (n) => {
14
14
  const {
15
15
  areAiSuggestionsAvailable: o,
16
16
  children: i,
17
17
  className: r,
18
18
  formRef: m,
19
- isAdvancedExtractAgentEnabled: g = !1,
19
+ isAdvancedExtractAgentEnabled: l = !1,
20
20
  isAiSuggestionsFeatureEnabled: d,
21
- isBetaLanguageEnabled: l,
22
- isLargeFile: c = !1,
23
- isDeleteButtonDisabled: u,
24
- suggestions: F,
21
+ isBetaLanguageEnabled: c,
22
+ isLargeFile: g = !1,
23
+ isDeleteButtonDisabled: p,
24
+ suggestions: u,
25
25
  isFetchingSuggestions: e,
26
- isFormDirty: p = !1,
27
- selectedTemplateInstance: a,
26
+ isFormDirty: F = !1,
27
+ selectedTemplateInstance: t,
28
28
  getAiSuggestions: _,
29
29
  handleCancel: h,
30
30
  handleDelete: f
31
31
  } = n, {
32
32
  enableModernizedComponents: y
33
- } = E(), C = (a == null ? void 0 : a.templateKey) === b, A = !!F[a == null ? void 0 : a.templateKey];
34
- return /* @__PURE__ */ t("div", {
33
+ } = A(), I = t?.templateKey === S, C = !!u[t?.templateKey];
34
+ return /* @__PURE__ */ a("div", {
35
35
  className: e && s.wrapperGradient,
36
36
  "data-modern": y,
37
- children: /* @__PURE__ */ x(M, {
37
+ children: /* @__PURE__ */ v(E, {
38
38
  ref: m,
39
- className: S(r, {
39
+ className: M(r, {
40
40
  [s.suggestionsFetching]: e
41
41
  }),
42
- children: [/* @__PURE__ */ t(v, {
42
+ children: [/* @__PURE__ */ a(w, {
43
43
  areAiSuggestionsAvailable: o,
44
- hasSuggestions: A,
45
- isAdvancedExtractAgentEnabled: g,
46
- isAiSuggestionsFeatureEnabled: d && !C,
47
- isBetaLanguageEnabled: l,
48
- isLargeFile: c,
44
+ hasSuggestions: C,
45
+ isAdvancedExtractAgentEnabled: l,
46
+ isAiSuggestionsFeatureEnabled: d && !I,
47
+ isBetaLanguageEnabled: c,
48
+ isLargeFile: g,
49
49
  isLoading: e,
50
50
  onAutofill: _,
51
- templateName: a == null ? void 0 : a.displayName
52
- }), a && i, /* @__PURE__ */ t(w, {
53
- isDeleteButtonDisabled: u,
51
+ templateName: t?.displayName
52
+ }), t && i, /* @__PURE__ */ a(b, {
53
+ isDeleteButtonDisabled: p,
54
54
  isLoading: e,
55
- onCancel: () => h(p),
55
+ onCancel: () => h(F),
56
56
  onDelete: f
57
57
  })]
58
58
  })
59
59
  });
60
60
  };
61
61
  export {
62
- K as M,
62
+ z as M,
63
63
  s
64
64
  };
@@ -1,41 +1,40 @@
1
- import { Popover as t, FilterChip as u, InlineNotice as A, TextButton as T, LoadingIndicator as I } from "@box/blueprint-web";
1
+ import { Popover as t, FilterChip as v, InlineNotice as A, TextButton as T, LoadingIndicator as I } from "@box/blueprint-web";
2
2
  import { Loader as W } from "@box/blueprint-web-assets/icons/Fill";
3
3
  import V from "lodash/orderBy";
4
4
  import { useState as s } from "react";
5
- import { useIntl as B, FormattedMessage as _ } from "react-intl";
5
+ import { useIntl as B, FormattedMessage as y } from "react-intl";
6
6
  import a from "../esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/messages.js";
7
7
  import { jsxs as l, jsx as e } from "react/jsx-runtime";
8
- import '../styles/taxonomy-ancestor-status-pill.css';const N = "_popoverContentContainer_1vfhn_2", w = "_popoverMainContent_1vfhn_7", E = "_loadingIndicatorWrapper_1vfhn_11", D = "_errorMessageWrapper_1vfhn_18", P = "_errorMessageWrapperText_1vfhn_23", R = "_container_1vfhn_31", k = "_taxonomyAncestorTable_1vfhn_37", K = "_taxonomyValueGroup_1vfhn_80", G = "_taxonomyValueButton_1vfhn_85", O = "_taxonomyValueLabel_1vfhn_95", r = {
8
+ import '../styles/taxonomy-ancestor-status-pill.css';const N = "_popoverContentContainer_1vfhn_2", w = "_popoverMainContent_1vfhn_7", E = "_loadingIndicatorWrapper_1vfhn_11", D = "_errorMessageWrapper_1vfhn_18", P = "_errorMessageWrapperText_1vfhn_23", R = "_taxonomyAncestorTable_1vfhn_37", k = "_taxonomyValueGroup_1vfhn_80", K = "_taxonomyValueButton_1vfhn_85", G = "_taxonomyValueLabel_1vfhn_95", n = {
9
9
  popoverContentContainer: N,
10
10
  popoverMainContent: w,
11
11
  loadingIndicatorWrapper: E,
12
12
  errorMessageWrapper: D,
13
13
  errorMessageWrapperText: P,
14
- container: R,
15
- taxonomyAncestorTable: k,
16
- taxonomyValueGroup: K,
17
- taxonomyValueButton: G,
18
- taxonomyValueLabel: O
19
- }, j = {
14
+ taxonomyAncestorTable: R,
15
+ taxonomyValueGroup: k,
16
+ taxonomyValueButton: K,
17
+ taxonomyValueLabel: G
18
+ }, O = {
20
19
  right: 24
21
- }, S = (n) => {
22
- n.stopPropagation();
23
- }, z = (n) => {
24
- (n.key === "ArrowLeft" || n.key === "ArrowRight") && n.stopPropagation();
20
+ }, j = (r) => {
21
+ r.stopPropagation();
22
+ }, S = (r) => {
23
+ (r.key === "ArrowLeft" || r.key === "ArrowRight") && r.stopPropagation();
25
24
  };
26
- function Y({
27
- taxonomyNodeFetcher: n,
28
- scope: y,
25
+ function X({
26
+ taxonomyNodeFetcher: r,
27
+ scope: _,
29
28
  taxonomyKey: f,
30
29
  value: x,
31
30
  displayValue: c
32
31
  }) {
33
32
  const {
34
33
  formatMessage: i
35
- } = B(), [C, b] = s([]), [p, d] = s(!1), [m, g] = s(!1), [M, h] = s(!1), L = V(C, (o) => o.level), v = async () => {
34
+ } = B(), [C, b] = s([]), [p, d] = s(!1), [m, g] = s(!1), [M, h] = s(!1), L = V(C, (o) => o.level), u = async () => {
36
35
  d(!0), g(!1), h(!0);
37
36
  try {
38
- const o = await n(y, f, x);
37
+ const o = await r(_, f, x);
39
38
  b(o);
40
39
  } catch {
41
40
  g(!0);
@@ -47,56 +46,56 @@ function Y({
47
46
  onOpenChange: h,
48
47
  open: M,
49
48
  children: [/* @__PURE__ */ e(t.Trigger, {
50
- children: /* @__PURE__ */ e(u.ChipButton, {
49
+ children: /* @__PURE__ */ e(v.ChipButton, {
51
50
  "aria-checked": void 0,
52
- className: r.taxonomyValueButton,
53
- disabled: !n,
54
- onClick: v,
55
- onKeyDown: z,
51
+ className: n.taxonomyValueButton,
52
+ disabled: !r,
53
+ onClick: u,
54
+ onKeyDown: S,
56
55
  role: void 0,
57
56
  value: c,
58
- children: /* @__PURE__ */ e(u.Label, {
59
- className: r.taxonomyValueLabel,
57
+ children: /* @__PURE__ */ e(v.Label, {
58
+ className: n.taxonomyValueLabel,
60
59
  children: c
61
60
  })
62
61
  })
63
62
  }), /* @__PURE__ */ e(t.ContentContainer, {
64
63
  align: "start",
65
- className: r.popoverContentContainer,
66
- collisionPadding: j,
67
- onEscapeKeyDown: S,
64
+ className: n.popoverContentContainer,
65
+ collisionPadding: O,
66
+ onEscapeKeyDown: j,
68
67
  children: /* @__PURE__ */ l(t.MainContent, {
69
- className: r.popoverMainContent,
68
+ className: n.popoverMainContent,
70
69
  children: [m && /* @__PURE__ */ l("div", {
71
- className: r.errorMessageWrapper,
70
+ className: n.errorMessageWrapper,
72
71
  children: [/* @__PURE__ */ e(A, {
73
72
  variant: "error",
74
73
  variantIconAriaLabel: i(a.loadingResultsErrorIconLabel),
75
- children: /* @__PURE__ */ e(_, {
74
+ children: /* @__PURE__ */ e(y, {
76
75
  ...a.loadingResultsErrorMessage
77
76
  })
78
77
  }), /* @__PURE__ */ e(T, {
79
- className: r.errorMessageWrapperText,
78
+ className: n.errorMessageWrapperText,
80
79
  icon: W,
81
- onClick: v,
80
+ onClick: u,
82
81
  "data-target-id": "TextButton-loadingResultsErrorAction",
83
82
  children: i(a.loadingResultsErrorAction)
84
83
  })]
85
84
  }), p && /* @__PURE__ */ e("div", {
86
- className: r.loadingIndicatorWrapper,
85
+ className: n.loadingIndicatorWrapper,
87
86
  children: /* @__PURE__ */ e(I, {
88
87
  "aria-label": i(a.loadingAriaLabel),
89
88
  size: "large"
90
89
  })
91
90
  }), !m && !p && /* @__PURE__ */ e("table", {
92
- className: r.taxonomyAncestorTable,
91
+ className: n.taxonomyAncestorTable,
93
92
  children: /* @__PURE__ */ e("tbody", {
94
93
  children: L.map((o) => /* @__PURE__ */ l("tr", {
95
94
  children: [/* @__PURE__ */ e("th", {
96
95
  scope: "row",
97
96
  children: o.levelName
98
97
  }), /* @__PURE__ */ e("td", {
99
- children: o.levelValue || /* @__PURE__ */ e(_, {
98
+ children: o.levelValue || /* @__PURE__ */ e(y, {
100
99
  ...a.emptyAncestorLevelValue
101
100
  })
102
101
  })]
@@ -108,6 +107,6 @@ function Y({
108
107
  });
109
108
  }
110
109
  export {
111
- Y as T,
112
- r as s
110
+ X as T,
111
+ n as s
113
112
  };
@@ -1,8 +1,8 @@
1
- let n = /* @__PURE__ */ function(e) {
1
+ let n = /* @__PURE__ */ (function(e) {
2
2
  return e.ClearAndReplace = "clearAndReplace", e.RemoveEntered = "removeEntered", e.ReplaceEntered = "replaceEntered", e.Append = "append", e;
3
- }({}), r = /* @__PURE__ */ function(e) {
3
+ })({}), r = /* @__PURE__ */ (function(e) {
4
4
  return e.Initial = "INITIAL", e.Pending = "PENDING", e.Applied = "APPLIED", e;
5
- }({});
5
+ })({});
6
6
  export {
7
7
  r as A,
8
8
  n as U
@@ -1,43 +1,41 @@
1
- import { BoxAiLogo as s } from "@box/blueprint-web-assets/icons/Logo";
1
+ import { BoxAiLogo as n } from "@box/blueprint-web-assets/icons/Logo";
2
2
  import i from "../esm/lib/components/interactive-text/interactive-text.js";
3
- import { convertISOStringtoRFC3339String as c } from "../esm/lib/utils/convertDate.js";
4
- import { jsxs as g, jsx as l } from "react/jsx-runtime";
5
- import '../styles/utils.css';const _ = "_noAttributesText_fefg3_2", f = "_fieldWrapper_fefg3_6", b = "_hasSuggestion_fefg3_11", p = "_error_fefg3_20", d = "_dateField_fefg3_33", x = "_suggestionApplied_fefg3_37", m = "_comboboxContainer_fefg3_37", u = "_labelWrapper_fefg3_52", T = "_labelText_fefg3_58", h = "_labelIcon_fefg3_61", o = {
6
- noAttributesText: _,
7
- fieldWrapper: f,
8
- hasSuggestion: b,
9
- error: p,
10
- dateField: d,
11
- suggestionApplied: x,
12
- comboboxContainer: m,
3
+ import { convertISOStringtoRFC3339String as g } from "../esm/lib/utils/convertDate.js";
4
+ import { jsxs as c, jsx as s } from "react/jsx-runtime";
5
+ import '../styles/utils.css';const p = "_noAttributesText_fefg3_2", _ = "_fieldWrapper_fefg3_6", f = "_hasSuggestion_fefg3_11", b = "_dateField_fefg3_33", d = "_suggestionApplied_fefg3_37", u = "_labelWrapper_fefg3_52", x = "_labelText_fefg3_58", m = "_labelIcon_fefg3_61", l = {
6
+ noAttributesText: p,
7
+ fieldWrapper: _,
8
+ hasSuggestion: f,
9
+ dateField: b,
10
+ suggestionApplied: d,
13
11
  labelWrapper: u,
14
- labelText: T,
15
- labelIcon: h
16
- }, F = (t, e, r = !1, n = "label") => (a) => /* @__PURE__ */ g("div", {
17
- className: o.labelWrapper,
18
- children: [e ? /* @__PURE__ */ l(i, {
19
- as: n,
20
- className: o.labelText,
12
+ labelText: x,
13
+ labelIcon: m
14
+ }, W = (t, e, a = !1, o = "label") => (r) => /* @__PURE__ */ c("div", {
15
+ className: l.labelWrapper,
16
+ children: [e ? /* @__PURE__ */ s(i, {
17
+ as: o,
18
+ className: l.labelText,
21
19
  tooltipText: e,
22
- ...a,
20
+ ...r,
23
21
  children: t
24
- }) : /* @__PURE__ */ l("label", {
25
- className: o.labelText,
26
- ...a,
22
+ }) : /* @__PURE__ */ s("label", {
23
+ className: l.labelText,
24
+ ...r,
27
25
  children: t
28
- }), r && /* @__PURE__ */ l(s, {
29
- className: o.labelIcon
26
+ }), a && /* @__PURE__ */ s(n, {
27
+ className: l.labelIcon
30
28
  })]
31
- }), N = (t) => {
29
+ }), I = (t) => {
32
30
  try {
33
- const e = c(t), r = new Date(e);
34
- return isNaN(r.getTime()) ? null : e;
31
+ const e = g(t), a = new Date(e);
32
+ return isNaN(a.getTime()) ? null : e;
35
33
  } catch {
36
34
  return null;
37
35
  }
38
36
  };
39
37
  export {
40
- F as g,
41
- o as s,
42
- N as t
38
+ W as g,
39
+ l as s,
40
+ I as t
43
41
  };
@@ -1,46 +1,45 @@
1
1
  import { ComboboxItemValue as te } from "@ariakit/react";
2
- import { Combobox as m, useForkRef as re, LoadingIndicator as ne, InlineNotice as ie, Text as se } from "@box/blueprint-web";
2
+ import { Combobox as d, useForkRef as re, LoadingIndicator as ne, InlineNotice as ie, Text as se } from "@box/blueprint-web";
3
3
  import { Search as ae, Loader as le } from "@box/blueprint-web-assets/icons/Fill";
4
- import { IconIconOnLightSecondary as ce, Size6 as T, Size1 as ue } from "@box/blueprint-web-assets/tokens/tokens";
5
- import S from "clsx";
6
- import { forwardRef as F, useRef as C, useCallback as de, useMemo as A, useEffect as me } from "react";
7
- import { useIntl as P, FormattedMessage as V } from "react-intl";
4
+ import { Size6 as M, Size1 as ce, IconIconOnLightSecondary as ue } from "@box/blueprint-web-assets/tokens/tokens";
5
+ import V from "clsx";
6
+ import { forwardRef as k, useRef as C, useCallback as de, useMemo as R, useEffect as pe } from "react";
7
+ import { useIntl as F, FormattedMessage as T } from "react-intl";
8
8
  import i from "./messages.js";
9
- import { useAsyncList as pe } from "./use-async-list.js";
9
+ import { useAsyncList as me } from "./use-async-list.js";
10
10
  import { useControllableState as he } from "./utils/use-controllable-state.js";
11
11
  import { useTrackVisibility as fe } from "./utils/use-intersection-observer.js";
12
- import { jsx as r, jsxs as N, Fragment as ge } from "react/jsx-runtime";
13
- import '../../../../styles/combobox-with-api-pagination.css';const be = "_container_19k3s_2", xe = "_disabled_19k3s_8", _e = "_highlightOptionText_19k3s_12", Oe = "_selected_19k3s_24", Re = "_option_19k3s_35", Ce = "_errorComboboxOption_19k3s_39", Ae = "_errorComboboxOptionText_19k3s_44", a = {
14
- container: be,
15
- disabled: xe,
16
- highlightOptionText: _e,
12
+ import { jsx as r, jsxs as S, Fragment as ge } from "react/jsx-runtime";
13
+ import '../../../../styles/combobox-with-api-pagination.css';const be = "_disabled_19k3s_8", xe = "_highlightOptionText_19k3s_12", Oe = "_selected_19k3s_24", _e = "_option_19k3s_35", Ce = "_errorComboboxOption_19k3s_39", Re = "_errorComboboxOptionText_19k3s_44", s = {
14
+ disabled: be,
15
+ highlightOptionText: xe,
17
16
  selected: Oe,
18
- option: Re,
17
+ option: _e,
19
18
  errorComboboxOption: Ce,
20
- errorComboboxOptionText: Ae
21
- }, k = /* @__PURE__ */ F(({
22
- onTryAgain: E
19
+ errorComboboxOptionText: Re
20
+ }, N = /* @__PURE__ */ k(({
21
+ onTryAgain: y
23
22
  }, p) => {
24
23
  const {
25
- formatMessage: h
26
- } = P();
27
- return /* @__PURE__ */ N(ge, {
24
+ formatMessage: m
25
+ } = F();
26
+ return /* @__PURE__ */ S(ge, {
28
27
  children: [/* @__PURE__ */ r(ie, {
29
28
  variant: "error",
30
- variantIconAriaLabel: h(i.loadingResultsErrorIconLabel),
31
- children: /* @__PURE__ */ r(V, {
29
+ variantIconAriaLabel: m(i.loadingResultsErrorIconLabel),
30
+ children: /* @__PURE__ */ r(T, {
32
31
  ...i.loadingResultsErrorMessage
33
32
  })
34
- }), /* @__PURE__ */ r(m.Option, {
33
+ }), /* @__PURE__ */ r(d.Option, {
35
34
  ref: p,
36
- className: a.errorComboboxOption,
37
- onClick: E,
38
- children: /* @__PURE__ */ N(se, {
35
+ className: s.errorComboboxOption,
36
+ onClick: y,
37
+ children: /* @__PURE__ */ S(se, {
39
38
  as: "span",
40
- className: a.errorComboboxOptionText,
39
+ className: s.errorComboboxOptionText,
41
40
  color: "textOnLightLink",
42
41
  variant: "bodyDefaultBold",
43
- children: [/* @__PURE__ */ r(V, {
42
+ children: [/* @__PURE__ */ r(T, {
44
43
  ...i.loadingResultsErrorAction
45
44
  }), /* @__PURE__ */ r(le, {
46
45
  color: "currentColor",
@@ -50,115 +49,113 @@ import '../../../../styles/combobox-with-api-pagination.css';const be = "_contai
50
49
  })
51
50
  })]
52
51
  });
53
- }), L = "__LOADING__", y = "__LOADING_ERROR__", Le = "0px 0px 20px 0px", ye = /* @__PURE__ */ r(ae, {
54
- color: ce,
55
- height: T,
52
+ }), A = "__LOADING__", L = "__LOADING_ERROR__", Ae = "0px 0px 20px 0px", Le = /* @__PURE__ */ r(ae, {
53
+ color: ue,
54
+ height: M,
56
55
  role: "presentation",
57
56
  style: {
58
- padding: ue,
57
+ padding: ce,
59
58
  boxSizing: "border-box"
60
59
  },
61
- width: T
62
- }), we = /* @__PURE__ */ F(function(p, h) {
60
+ width: M
61
+ }), De = /* @__PURE__ */ k(function(p, m) {
63
62
  const {
64
- defaultFetcher: D,
65
- onInputValueChange: f,
63
+ defaultFetcher: P,
64
+ onInputValueChange: D,
66
65
  value: w,
67
66
  onValueChange: B,
68
67
  noResultMessage: W,
69
68
  defaultValue: z = [],
70
69
  loadingAriaLabel: G,
71
- multiselect: l = !1,
70
+ multiselect: a = !1,
72
71
  disabled: j,
73
72
  className: U,
74
- displaySingleSelectionAsChip: v = !0,
73
+ displaySingleSelectionAsChip: E = !0,
75
74
  ...q
76
75
  } = p, {
77
- formatMessage: u
78
- } = P(), g = C(null), b = C(!0), e = pe({
76
+ formatMessage: c
77
+ } = F(), h = C(null), f = C(!0), e = me({
79
78
  async load({
80
79
  marker: o,
81
80
  searchInput: t,
82
- signal: R
81
+ signal: O
83
82
  }) {
84
- const c = await D({
85
- signal: R,
83
+ const l = await P({
84
+ signal: O,
86
85
  marker: o,
87
86
  searchInput: t
88
87
  });
89
88
  return {
90
- items: c.options,
91
- marker: c.marker
89
+ items: l.options,
90
+ marker: l.marker
92
91
  };
93
92
  }
94
- }), I = C(!1), H = de(() => {
95
- I.current || (e.reload(), I.current = !0);
96
- }, []), [n, x] = he({
93
+ }), v = C(!1), H = de(() => {
94
+ v.current || (e.reload(), v.current = !0);
95
+ }, []), [n, g] = he({
97
96
  prop: w,
98
97
  defaultProp: z,
99
98
  onChange: B
100
- }), _ = !l && n.length === 1, J = (o) => {
101
- o === void 0 ? (x([]), (!b.current || !v) && (e.search(""), b.current = !0)) : Array.isArray(o) ? x(o) : x([o]);
102
- }, K = A(() => n.length === 0 ? l ? [] : void 0 : l ? n : n[0], [l, n]), O = A(() => n.filter((o) => !e.items.some((t) => t.value === o.value)), [n, e.items]), Q = (o) => {
99
+ }), b = !a && n.length === 1, J = (o) => {
100
+ o === void 0 ? (g([]), (!f.current || !E) && (e.search(""), f.current = !0)) : Array.isArray(o) ? g(o) : g([o]);
101
+ }, K = R(() => n.length === 0 ? a ? [] : void 0 : a ? n : n[0], [a, n]), x = R(() => n.filter((o) => !e.items.some((t) => t.value === o.value)), [n, e.items]), Q = (o) => {
103
102
  const {
104
103
  value: t,
105
- displayValue: R,
106
- ...c
104
+ displayValue: O,
105
+ ...l
107
106
  } = o;
108
- if (t === L)
109
- return e.hasNextPage ? /* @__PURE__ */ r(m.Option, {
110
- ...c,
107
+ if (t === A)
108
+ return e.hasNextPage ? /* @__PURE__ */ r(d.Option, {
109
+ ...l,
111
110
  ref: Z,
112
111
  disabled: !0,
113
112
  value: t,
114
113
  children: /* @__PURE__ */ r(ne, {
115
- "aria-label": u(i.loadingMoreAriaLabel),
114
+ "aria-label": c(i.loadingMoreAriaLabel),
116
115
  style: {
117
116
  position: "unset"
118
117
  }
119
118
  })
120
119
  }) : null;
121
- if (t === y && e.hasError && !e.isEmpty)
122
- return /* @__PURE__ */ r(k, {
120
+ if (t === L && e.hasError && !e.isEmpty)
121
+ return /* @__PURE__ */ r(N, {
123
122
  onTryAgain: () => {
124
- var s;
125
- e.loadMore(), (s = g.current) == null || s.focus();
123
+ e.loadMore(), h.current?.focus();
126
124
  }
127
125
  });
128
- if (O.some((s) => s.value === t))
126
+ if (x.some((_) => _.value === t))
129
127
  return null;
130
- const oe = n.some((s) => s.value === t);
131
- return /* @__PURE__ */ r(m.Option, {
132
- ...c,
133
- className: a.option,
128
+ const oe = n.some((_) => _.value === t);
129
+ return /* @__PURE__ */ r(d.Option, {
130
+ ...l,
131
+ className: s.option,
134
132
  value: t,
135
133
  children: /* @__PURE__ */ r(te, {
136
- className: S(a.highlightOptionText, oe && a.selected),
137
- value: R || t
134
+ className: V(s.highlightOptionText, oe && s.selected),
135
+ value: O || t
138
136
  })
139
137
  });
140
138
  }, X = (o) => {
141
- if (f == null || f(o), _ && o === "") {
142
- b.current = !1;
139
+ if (D?.(o), b && o === "") {
140
+ f.current = !1;
143
141
  return;
144
142
  }
145
143
  e.search(o);
146
144
  }, Y = () => {
147
- var o;
148
- e.reload(), (o = g.current) == null || o.focus();
145
+ e.reload(), h.current?.focus();
149
146
  };
150
- let d;
151
- e.hasError && !e.isLoading ? d = /* @__PURE__ */ r(k, {
147
+ let u;
148
+ e.hasError && !e.isLoading ? u = /* @__PURE__ */ r(N, {
152
149
  onTryAgain: Y
153
- }) : e.isEmpty && !e.isLoading ? d = W || u(i.noResults) : d = void 0;
150
+ }) : e.isEmpty && !e.isLoading ? u = W || c(i.noResults) : u = void 0;
154
151
  const [Z, {
155
152
  rootRef: $,
156
- isVisible: M
153
+ isVisible: I
157
154
  }] = fe({
158
- rootMargin: Le
155
+ rootMargin: Ae
159
156
  });
160
- me(() => {
161
- if (!(M && e.hasNextPage))
157
+ pe(() => {
158
+ if (!(I && e.hasNextPage))
162
159
  return;
163
160
  const t = setTimeout(() => {
164
161
  e.loadMore();
@@ -166,35 +163,35 @@ import '../../../../styles/combobox-with-api-pagination.css';const be = "_contai
166
163
  return () => {
167
164
  clearTimeout(t);
168
165
  };
169
- }, [M]);
170
- const ee = A(() => {
166
+ }, [I]);
167
+ const ee = R(() => {
171
168
  const o = e.hasNextPage ? {
169
+ displayValue: A,
170
+ value: A
171
+ } : null, t = !o && e.hasError && !e.isEmpty ? {
172
172
  displayValue: L,
173
173
  value: L
174
- } : null, t = !o && e.hasError && !e.isEmpty ? {
175
- displayValue: y,
176
- value: y
177
174
  } : null;
178
- return [...e.items, ...O, o, t].filter(Boolean);
179
- }, [e.hasNextPage, e.hasError, e.isEmpty, e.items, O]);
180
- return /* @__PURE__ */ r(m, {
175
+ return [...e.items, ...x, o, t].filter(Boolean);
176
+ }, [e.hasNextPage, e.hasError, e.isEmpty, e.items, x]);
177
+ return /* @__PURE__ */ r(d, {
181
178
  as: "input",
182
179
  ...q,
183
- ref: re(g, h),
184
- className: S({
185
- [a.disabled]: _
180
+ ref: re(h, m),
181
+ className: V({
182
+ [s.disabled]: b
186
183
  }, U),
187
- clearButtonAriaLabel: u(i.clearButtonAriaLabel),
188
- disabled: j || _,
189
- displaySingleSelectionAsChip: v,
184
+ clearButtonAriaLabel: c(i.clearButtonAriaLabel),
185
+ disabled: j || b,
186
+ displaySingleSelectionAsChip: E,
190
187
  displayValue: (o) => o.displayValue || o.value,
191
- endComboboxIcon: ye,
188
+ endComboboxIcon: Le,
192
189
  focusLoop: !1,
193
190
  getPopoverRef: $,
194
191
  loading: e.isReloading,
195
- loadingAriaLabel: G || u(i.loadingAriaLabel),
196
- multiselect: l,
197
- noResultMessage: d,
192
+ loadingAriaLabel: G || c(i.loadingAriaLabel),
193
+ multiselect: a,
194
+ noResultMessage: u,
198
195
  onFocus: H,
199
196
  onInputValueChange: X,
200
197
  onValueChange: J,
@@ -204,5 +201,5 @@ import '../../../../styles/combobox-with-api-pagination.css';const be = "_contai
204
201
  });
205
202
  });
206
203
  export {
207
- we as ComboboxWithApiPagination
204
+ De as ComboboxWithApiPagination
208
205
  };