@envisiongroup/porygon 1.0.2 → 1.0.4

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 (22) hide show
  1. package/dist/index.js +72 -69
  2. package/dist/react-components/fields/TagPicker/EFWTagPicker.js +130 -126
  3. package/dist/react-components/fields/TagPicker/EFWTagPicker.types.d.ts +11 -6
  4. package/dist/react-components/forms/EFWForm/EFWForm.js +284 -290
  5. package/dist/react-components/forms/EFWForm/EFWForm.utils.d.ts +26 -1
  6. package/dist/react-components/forms/EFWForm/EFWForm.utils.js +94 -65
  7. package/dist/react-components/forms/EFWForm/index.d.ts +4 -3
  8. package/dist/react-components/forms/EFWForm/index.js +10 -7
  9. package/dist/react-components/tables/EFWTable/EFWTable.js +767 -747
  10. package/dist/react-components/tables/EFWTable/EFWTable.types.d.ts +10 -1
  11. package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.js +31 -9
  12. package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.types.d.ts +39 -4
  13. package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.utils.d.ts +8 -3
  14. package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.utils.js +4 -1
  15. package/dist/react-components/tables/EFWTable/hooks/useDefaultAddButton/useDefaultAddButton.d.ts +1 -1
  16. package/dist/react-components/tables/EFWTable/hooks/useDefaultAddButton/useDefaultAddButton.js +47 -15
  17. package/dist/react-components/tables/EFWTable/hooks/useDefaultUpdateButton/useDefaultUpdateButton.js +52 -21
  18. package/dist/react-components/tables/EFWTable/utils/index.d.ts +2 -1
  19. package/dist/react-components/tables/EFWTable/utils/index.js +19 -17
  20. package/dist/react-components/tables/EFWTable/utils/itemCompletion.d.ts +32 -0
  21. package/dist/react-components/tables/EFWTable/utils/itemCompletion.js +23 -0
  22. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,111 +1,114 @@
1
1
  import { formatFileSize as o, getErrorMessage as t, getFileIconUrl as F } from "./react-components/commons/utils.js";
2
- import { EFWMessageBarManager as E } from "./react-components/forms/EFWMessageBarManager/EFWMessageBarManager.js";
2
+ import { EFWMessageBarManager as m } from "./react-components/forms/EFWMessageBarManager/EFWMessageBarManager.js";
3
3
  import { EFWButton as p } from "./react-components/buttons/EFWButton/EFWButton.js";
4
- import { useEFWButton as l } from "./react-components/buttons/EFWButton/EFWButton.hooks.js";
4
+ import { useEFWButton as T } from "./react-components/buttons/EFWButton/EFWButton.hooks.js";
5
5
  import { EFWDrawerButton as f } from "./react-components/buttons/EFWDrawerButton/EFWDrawerButton.js";
6
6
  import { EFWGroupButton as u } from "./react-components/buttons/EFWGroupButton/EFWGroupButton.js";
7
- import { EFWField as W } from "./react-components/fields/_shared/EFWField/EFWField.js";
7
+ import { EFWField as _ } from "./react-components/fields/_shared/EFWField/EFWField.js";
8
8
  import { EFWAttachment as n } from "./react-components/fields/Attachments/EFWAttachments.js";
9
9
  import { getAttachmentsFormattedValue as A } from "./react-components/fields/Attachments/EFWAttachments.utils.js";
10
10
  import { EFWAttachmentsField as d } from "./react-components/fields/Attachments/EFWAttachmentsField.js";
11
11
  import { EFWDatePicker as O } from "./react-components/fields/DatePicker/EFWDatePicker.js";
12
- import { enLocalizedStrings as D, esLocalizedStrings as P, getDatePickerFormattedValue as C, ptLocalizedStrings as B } from "./react-components/fields/DatePicker/EFWDatePicker.utils.js";
12
+ import { enLocalizedStrings as D, esLocalizedStrings as P, getDatePickerFormattedValue as B, ptLocalizedStrings as C } from "./react-components/fields/DatePicker/EFWDatePicker.utils.js";
13
13
  import { EFWDatePickerField as U } from "./react-components/fields/DatePicker/EFWDatePickerField.js";
14
- import { EFWInput as V } from "./react-components/fields/Input/EFWInput.js";
15
- import { getInputFormattedValue as R } from "./react-components/fields/Input/EFWInput.utils.js";
16
- import { EFWInputField as k } from "./react-components/fields/Input/EFWInputField.js";
17
- import { EFWNumberInput as M } from "./react-components/fields/NumberInput/EFWNumberInput.js";
18
- import { getNumberInputFormattedValue as w } from "./react-components/fields/NumberInput/EFWNumberInput.utils.js";
19
- import { EFWNumberInputField as X } from "./react-components/fields/NumberInput/EFWNumberInputField.js";
20
- import { EFWSwitch as Y } from "./react-components/fields/Switch/EFWSwitch.js";
14
+ import { EFWInput as N } from "./react-components/fields/Input/EFWInput.js";
15
+ import { getInputFormattedValue as y } from "./react-components/fields/Input/EFWInput.utils.js";
16
+ import { EFWInputField as R } from "./react-components/fields/Input/EFWInputField.js";
17
+ import { EFWNumberInput as h } from "./react-components/fields/NumberInput/EFWNumberInput.js";
18
+ import { getNumberInputFormattedValue as G } from "./react-components/fields/NumberInput/EFWNumberInput.utils.js";
19
+ import { EFWNumberInputField as w } from "./react-components/fields/NumberInput/EFWNumberInputField.js";
20
+ import { EFWSwitch as z } from "./react-components/fields/Switch/EFWSwitch.js";
21
21
  import { getSwitchFormattedValue as q } from "./react-components/fields/Switch/EFWSwitch.utils.js";
22
22
  import { EFWSwitchField as J } from "./react-components/fields/Switch/EFWSwitchField.js";
23
23
  import { EFWTagPicker as Q } from "./react-components/fields/TagPicker/EFWTagPicker.js";
24
24
  import { getTagPickerFormattedValue as $ } from "./react-components/fields/TagPicker/EFWTagPicker.utils.js";
25
25
  import { EFWTagPickerField as re } from "./react-components/fields/TagPicker/EFWTagPickerField.js";
26
26
  import { EFWTextArea as te } from "./react-components/fields/TextArea/EFWTextArea.js";
27
- import { getTextAreaFormattedValue as me } from "./react-components/fields/TextArea/EFWTextArea.utils.js";
27
+ import { getTextAreaFormattedValue as Ee } from "./react-components/fields/TextArea/EFWTextArea.utils.js";
28
28
  import { EFWTextAreaField as ae } from "./react-components/fields/TextArea/EFWTextAreaField.js";
29
29
  import { getFormFieldDisplayText as xe } from "./react-components/forms/EFWForm/EFWForm.converter.js";
30
- import { useFormController as Te } from "./react-components/forms/EFWForm/EFWForm.hooks.js";
31
- import { EFWForm as Le } from "./react-components/forms/EFWForm/EFWForm.js";
32
- import { EFWConversionError as ie, EFWValuesToFlat as We, flatToEFWValues as _e } from "./react-components/forms/EFWForm/EFWForm.flatConverter.js";
33
- import { EFWFormMessageBarGroup as se } from "./react-components/forms/EFWFormMessageBarGroup/EFWFormMessageBarGroup.js";
34
- import { useDrawer as ce } from "./react-components/hooks/useDrawer/useDrawer.js";
35
- import { PorygonI18nProvider as ge, useButtonsLocaleText as Oe, useFieldsLocaleText as Se, useFormLocaleText as De, usePorygonLocaleText as Pe, useTableLocaleText as Ce, useTimelineLocaleText as Be } from "./react-components/i18n/PorygonI18nProvider.js";
36
- import { DEFAULT_EFW_BUTTONS_LOCALE_TEXT as Ue, DEFAULT_EFW_FIELDS_LOCALE_TEXT as Ne, DEFAULT_EFW_FORM_LOCALE_TEXT as Ve, DEFAULT_EFW_TABLE_LOCALE_TEXT as be, DEFAULT_EFW_TIMELINE_LOCALE_TEXT as Re } from "./react-components/i18n/defaultLocaleText.js";
37
- import { PORYGON_LOCALES as ke, PORYGON_LOCALE_EN as Ge, PORYGON_LOCALE_ES as Me, PORYGON_LOCALE_PT_BR as ve } from "./react-components/i18n/localePresets.js";
38
- import { EFWTable as ye } from "./react-components/tables/EFWTable/EFWTable.js";
39
- import { useTableController as ze } from "./react-components/tables/EFWTable/hooks/useTableController/useTableController.js";
40
- import { useDefaultFilterButton as je } from "./react-components/tables/EFWTable/hooks/useDefaultFilterButton/useDefaultFilterButton.js";
41
- import { EFWTableEmpty as He, EFWTableOverlay as Je } from "./react-components/tables/EFWTable/components/EFWTableOverlay/EFWTableOverlay.js";
42
- import { EFWTimeline as Qe } from "./react-components/timeline/EFWTimeline/EFWTimeline.js";
43
- import { DEFAULT_STATUS_COLORS as $e, DEFAULT_STATUS_LABELS as er, deriveStatusFromActive as rr } from "./react-components/timeline/EFWTimeline/EFWTimeline.utils.js";
30
+ import { EMPTY_VALUE_BY_FIELD_TYPE as le, getEmptyValueForFieldType as fe } from "./react-components/forms/EFWForm/EFWForm.utils.js";
31
+ import { useFormController as ue } from "./react-components/forms/EFWForm/EFWForm.hooks.js";
32
+ import { EFWForm as _e } from "./react-components/forms/EFWForm/EFWForm.js";
33
+ import { EFWConversionError as ne, EFWValuesToFlat as se, flatToEFWValues as Ae } from "./react-components/forms/EFWForm/EFWForm.flatConverter.js";
34
+ import { EFWFormMessageBarGroup as de } from "./react-components/forms/EFWFormMessageBarGroup/EFWFormMessageBarGroup.js";
35
+ import { useDrawer as Oe } from "./react-components/hooks/useDrawer/useDrawer.js";
36
+ import { PorygonI18nProvider as De, useButtonsLocaleText as Pe, useFieldsLocaleText as Be, useFormLocaleText as Ce, usePorygonLocaleText as Ie, useTableLocaleText as Ue, useTimelineLocaleText as Ve } from "./react-components/i18n/PorygonI18nProvider.js";
37
+ import { DEFAULT_EFW_BUTTONS_LOCALE_TEXT as be, DEFAULT_EFW_FIELDS_LOCALE_TEXT as ye, DEFAULT_EFW_FORM_LOCALE_TEXT as Me, DEFAULT_EFW_TABLE_LOCALE_TEXT as Re, DEFAULT_EFW_TIMELINE_LOCALE_TEXT as Ye } from "./react-components/i18n/defaultLocaleText.js";
38
+ import { PORYGON_LOCALES as ke, PORYGON_LOCALE_EN as Ge, PORYGON_LOCALE_ES as ve, PORYGON_LOCALE_PT_BR as we } from "./react-components/i18n/localePresets.js";
39
+ import { EFWTable as ze } from "./react-components/tables/EFWTable/EFWTable.js";
40
+ import { useTableController as qe } from "./react-components/tables/EFWTable/hooks/useTableController/useTableController.js";
41
+ import { useDefaultFilterButton as Je } from "./react-components/tables/EFWTable/hooks/useDefaultFilterButton/useDefaultFilterButton.js";
42
+ import { EFWTableEmpty as Qe, EFWTableOverlay as Ze } from "./react-components/tables/EFWTable/components/EFWTableOverlay/EFWTableOverlay.js";
43
+ import { EFWTimeline as er } from "./react-components/timeline/EFWTimeline/EFWTimeline.js";
44
+ import { DEFAULT_STATUS_COLORS as or, DEFAULT_STATUS_LABELS as tr, deriveStatusFromActive as Fr } from "./react-components/timeline/EFWTimeline/EFWTimeline.utils.js";
44
45
  export {
45
- Ue as DEFAULT_EFW_BUTTONS_LOCALE_TEXT,
46
- Ne as DEFAULT_EFW_FIELDS_LOCALE_TEXT,
47
- Ve as DEFAULT_EFW_FORM_LOCALE_TEXT,
48
- be as DEFAULT_EFW_TABLE_LOCALE_TEXT,
49
- Re as DEFAULT_EFW_TIMELINE_LOCALE_TEXT,
50
- $e as DEFAULT_STATUS_COLORS,
51
- er as DEFAULT_STATUS_LABELS,
46
+ be as DEFAULT_EFW_BUTTONS_LOCALE_TEXT,
47
+ ye as DEFAULT_EFW_FIELDS_LOCALE_TEXT,
48
+ Me as DEFAULT_EFW_FORM_LOCALE_TEXT,
49
+ Re as DEFAULT_EFW_TABLE_LOCALE_TEXT,
50
+ Ye as DEFAULT_EFW_TIMELINE_LOCALE_TEXT,
51
+ or as DEFAULT_STATUS_COLORS,
52
+ tr as DEFAULT_STATUS_LABELS,
52
53
  n as EFWAttachment,
53
54
  d as EFWAttachmentsField,
54
55
  p as EFWButton,
55
- ie as EFWConversionError,
56
+ ne as EFWConversionError,
56
57
  O as EFWDatePicker,
57
58
  U as EFWDatePickerField,
58
59
  f as EFWDrawerButton,
59
- W as EFWField,
60
- Le as EFWForm,
61
- se as EFWFormMessageBarGroup,
60
+ _ as EFWField,
61
+ _e as EFWForm,
62
+ de as EFWFormMessageBarGroup,
62
63
  u as EFWGroupButton,
63
- V as EFWInput,
64
- k as EFWInputField,
65
- E as EFWMessageBarManager,
66
- M as EFWNumberInput,
67
- X as EFWNumberInputField,
68
- Y as EFWSwitch,
64
+ N as EFWInput,
65
+ R as EFWInputField,
66
+ m as EFWMessageBarManager,
67
+ h as EFWNumberInput,
68
+ w as EFWNumberInputField,
69
+ z as EFWSwitch,
69
70
  J as EFWSwitchField,
70
- ye as EFWTable,
71
- He as EFWTableEmpty,
72
- Je as EFWTableOverlay,
71
+ ze as EFWTable,
72
+ Qe as EFWTableEmpty,
73
+ Ze as EFWTableOverlay,
73
74
  Q as EFWTagPicker,
74
75
  re as EFWTagPickerField,
75
76
  te as EFWTextArea,
76
77
  ae as EFWTextAreaField,
77
- Qe as EFWTimeline,
78
- We as EFWValuesToFlat,
78
+ er as EFWTimeline,
79
+ se as EFWValuesToFlat,
80
+ le as EMPTY_VALUE_BY_FIELD_TYPE,
79
81
  ke as PORYGON_LOCALES,
80
82
  Ge as PORYGON_LOCALE_EN,
81
- Me as PORYGON_LOCALE_ES,
82
- ve as PORYGON_LOCALE_PT_BR,
83
- ge as PorygonI18nProvider,
84
- rr as deriveStatusFromActive,
83
+ ve as PORYGON_LOCALE_ES,
84
+ we as PORYGON_LOCALE_PT_BR,
85
+ De as PorygonI18nProvider,
86
+ Fr as deriveStatusFromActive,
85
87
  D as enLocalizedStrings,
86
88
  P as esLocalizedStrings,
87
- _e as flatToEFWValues,
89
+ Ae as flatToEFWValues,
88
90
  o as formatFileSize,
89
91
  A as getAttachmentsFormattedValue,
90
- C as getDatePickerFormattedValue,
92
+ B as getDatePickerFormattedValue,
93
+ fe as getEmptyValueForFieldType,
91
94
  t as getErrorMessage,
92
95
  F as getFileIconUrl,
93
96
  xe as getFormFieldDisplayText,
94
- R as getInputFormattedValue,
95
- w as getNumberInputFormattedValue,
97
+ y as getInputFormattedValue,
98
+ G as getNumberInputFormattedValue,
96
99
  q as getSwitchFormattedValue,
97
100
  $ as getTagPickerFormattedValue,
98
- me as getTextAreaFormattedValue,
99
- B as ptLocalizedStrings,
100
- Oe as useButtonsLocaleText,
101
- je as useDefaultFilterButton,
102
- ce as useDrawer,
103
- l as useEFWButton,
104
- Se as useFieldsLocaleText,
105
- Te as useFormController,
106
- De as useFormLocaleText,
107
- Pe as usePorygonLocaleText,
108
- ze as useTableController,
109
- Ce as useTableLocaleText,
110
- Be as useTimelineLocaleText
101
+ Ee as getTextAreaFormattedValue,
102
+ C as ptLocalizedStrings,
103
+ Pe as useButtonsLocaleText,
104
+ Je as useDefaultFilterButton,
105
+ Oe as useDrawer,
106
+ T as useEFWButton,
107
+ Be as useFieldsLocaleText,
108
+ ue as useFormController,
109
+ Ce as useFormLocaleText,
110
+ Ie as usePorygonLocaleText,
111
+ qe as useTableController,
112
+ Ue as useTableLocaleText,
113
+ Ve as useTimelineLocaleText
111
114
  };
@@ -1,11 +1,11 @@
1
- import { jsx as a, jsxs as F, Fragment as Ee } from "react/jsx-runtime";
2
- import { useRef as v, useState as w, useMemo as p, useEffect as A, useCallback as u } from "react";
3
- import { makeStyles as De, tokens as n, useTagPickerFilter as ze, TagPickerOption as R, Spinner as Ve, mergeClasses as _e, Text as Fe, TagPicker as Qe, TagPickerControl as We, TagPickerGroup as je, Tag as Ge, TagPickerInput as qe, Button as Xe, TagPickerList as He, Avatar as Je } from "@fluentui/react-components";
1
+ import { jsx as a, jsxs as V, Fragment as Ie } from "react/jsx-runtime";
2
+ import { useRef as w, useState as A, useMemo as u, useEffect as _, useCallback as s } from "react";
3
+ import { makeStyles as Ee, tokens as n, useTagPickerFilter as De, TagPickerOption as R, Spinner as ze, mergeClasses as Ve, Text as _e, TagPicker as Fe, TagPickerControl as Qe, TagPickerGroup as We, Tag as je, TagPickerInput as Ge, Button as qe, TagPickerList as Xe, Avatar as He } from "@fluentui/react-components";
4
4
  import { getTagPickerFormattedValue as pe } from "./EFWTagPicker.utils.js";
5
- import { normalizeArrayValue as Ke } from "../../commons/valueNormalization.js";
6
- import { CollectionsEmpty20Regular as Ye, Eraser20Regular as $e } from "@fluentui/react-icons";
7
- import { useFieldsLocaleText as Ue } from "../../i18n/PorygonI18nProvider.js";
8
- const Q = [], Ze = 12, ue = (P) => /* @__PURE__ */ a(Je, { shape: "square", "aria-hidden": !0, name: P.text, color: "colorful" }), et = De({
5
+ import { normalizeArrayValue as Je } from "../../commons/valueNormalization.js";
6
+ import { CollectionsEmpty20Regular as Ke, Eraser20Regular as Ye } from "@fluentui/react-icons";
7
+ import { useFieldsLocaleText as $e } from "../../i18n/PorygonI18nProvider.js";
8
+ const F = [], Ue = 12, Ze = (M) => /* @__PURE__ */ a(He, { shape: "square", "aria-hidden": !0, name: M.text, color: "colorful" }), et = Ee({
9
9
  efwTagPickerControlError: {
10
10
  backgroundColor: n.colorPaletteRedBackground1,
11
11
  "::after": {
@@ -62,55 +62,53 @@ const Q = [], Ze = 12, ue = (P) => /* @__PURE__ */ a(Je, { shape: "square", "ari
62
62
  fontSize: "12px",
63
63
  lineHeight: "16px"
64
64
  }
65
- }), ct = (P) => {
65
+ }), ct = (M) => {
66
66
  const {
67
67
  labels: f,
68
- className: ge = "",
68
+ className: ue = "",
69
69
  minQueryLength: m = 0,
70
- options: r = Q,
71
- hidden: fe = !1,
72
- disabled: W = !1,
73
- editable: me = !0,
74
- selectedOptions: j = Q,
75
- defaultSelectedOptions: B = Q,
76
- noPopover: be = !1,
77
- tagSize: he = "medium",
78
- tagShape: Se = "rounded",
79
- tagAppearance: Oe = "brand",
80
- onChange: x,
81
- beforeRenderOptions: y,
82
- renderOptionMedia: I,
70
+ options: r = F,
71
+ hidden: ge = !1,
72
+ disabled: Q = !1,
73
+ editable: fe = !0,
74
+ selectedOptions: W = F,
75
+ defaultSelectedOptions: B = F,
76
+ noPopover: me = !1,
77
+ tagSize: be = "medium",
78
+ tagShape: he = "rounded",
79
+ tagAppearance: Se = "brand",
80
+ onChange: P,
81
+ beforeRenderOptions: O,
82
+ renderOptionMedia: j,
83
83
  showOptionMediaInSelectedTags: G = !1,
84
84
  readOnlyRenderer: ye,
85
85
  multiple: q = !0,
86
86
  validationState: X = "none",
87
- validationMessage: Ce,
88
- setParentComponentState: E
89
- } = P, Te = v(X), ke = v(Ce), [s, H] = w(""), c = P.selectedOptions !== void 0, J = (c ? j : B) ?? [], [Me, D] = w(J), i = c ? j ?? [] : Me, N = p(
87
+ validationMessage: Oe,
88
+ setParentComponentState: I
89
+ } = M, Ce = w(X), Te = w(Oe), [c, H] = A(""), d = M.selectedOptions !== void 0, J = (d ? W : B) ?? [], [ke, E] = A(J), i = d ? W ?? [] : ke, x = u(
90
90
  () => new Map(i.map((e) => [e.key, e])),
91
91
  [i]
92
- ), b = p(
92
+ ), b = u(
93
93
  () => i.map((e) => e.key),
94
94
  [i]
95
- ), K = p(
95
+ ), K = u(
96
96
  () => new Set(b),
97
97
  [b]
98
- ), [Y, C] = w({ available: [], loading: !1 }), L = Y.available, ve = p(
99
- () => L.map((e) => e.key.toString()),
100
- [L]
101
- ), l = p(
102
- () => new Map(L.map((e) => [e.key, e])),
103
- [L]
104
- ), Pe = Y.loading, [z, T] = w(!1), $ = p(() => s.toLowerCase(), [s]), k = v(), g = v(null);
98
+ ), [Y, C] = A({ available: [], loading: !1 }), N = Y.available, ve = u(
99
+ () => N.map((e) => e.key.toString()),
100
+ [N]
101
+ ), l = u(
102
+ () => new Map(N.map((e) => [e.key, e])),
103
+ [N]
104
+ ), Me = Y.loading, [D, T] = A(!1), $ = u(() => c.toLowerCase(), [c]), k = w(), g = w(null);
105
105
  g.current === null && (g.current = Object.fromEntries(
106
106
  J.map((e) => [e.key, e])
107
107
  ));
108
- const V = v(
109
- I ?? ue
110
- ), U = p(
108
+ const U = u(
111
109
  () => B ?? [],
112
110
  [B]
113
- ), h = Ue().tagPicker.labels, Z = h.placeholder, ee = h.noMatchesMessage, te = h.loadingMessage, oe = h.emptyState, ae = h.selectedItemsAriaLabel, ne = h.inputAriaLabel, re = f?.placeholder, le = f?.noMatchesMessage, ie = f?.loadingMessage, se = f?.emptyState, ce = f?.selectedItemsAriaLabel, de = f?.inputAriaLabel, S = p(() => ({
111
+ ), h = $e().tagPicker.labels, Z = h.placeholder, ee = h.noMatchesMessage, te = h.loadingMessage, oe = h.emptyState, ae = h.selectedItemsAriaLabel, ne = h.inputAriaLabel, re = f?.placeholder, le = f?.noMatchesMessage, ie = f?.loadingMessage, se = f?.emptyState, ce = f?.selectedItemsAriaLabel, de = f?.inputAriaLabel, S = u(() => ({
114
112
  placeholder: re ?? Z,
115
113
  noMatchesMessage: le ?? ee,
116
114
  loadingMessage: ie ?? te,
@@ -131,102 +129,107 @@ const Q = [], Ze = 12, ue = (P) => /* @__PURE__ */ a(Je, { shape: "square", "ari
131
129
  ae,
132
130
  ne
133
131
  ]);
134
- A(() => {
132
+ _(() => {
135
133
  i.forEach((e) => {
136
134
  g.current[e.key] = e;
137
135
  });
138
- }, [i]), A(() => {
139
- V.current = I ?? ue;
140
- }, [I]);
141
- const O = et(), xe = u(
142
- (e) => (N.get(e) || l.get(e) || g.current[e])?.text || e,
143
- [N, l]
144
- ), Ne = u(
136
+ }, [i]);
137
+ const y = et(), Pe = s(
138
+ (e) => (x.get(e) || l.get(e) || g.current[e])?.text || e,
139
+ [x, l]
140
+ ), L = s(
141
+ (e) => {
142
+ const t = j;
143
+ return t === void 0 ? Ze(e) : typeof t == "function" ? t(e) : t;
144
+ },
145
+ [j]
146
+ ), xe = s(
145
147
  (e) => {
146
148
  if (!G)
147
149
  return;
148
- const t = N.get(e) || l.get(e) || g.current[e];
150
+ const t = x.get(e) || l.get(e) || g.current[e];
149
151
  if (!t)
150
152
  return;
151
- const o = V.current(t);
153
+ const o = L(t);
152
154
  if (!(o == null || o === !1 || typeof o == "boolean"))
153
155
  return o;
154
156
  },
155
157
  [
156
158
  G,
157
- N,
158
- l
159
+ x,
160
+ l,
161
+ L
159
162
  ]
160
163
  );
161
- A(() => z ? (k.current?.abort(), k.current = new AbortController(), (async () => {
164
+ _(() => D ? (k.current?.abort(), k.current = new AbortController(), (async () => {
162
165
  if (typeof r != "function") {
163
- const t = y ? y(r) : r;
166
+ const t = O ? O(r) : r;
164
167
  C((o) => ({ ...o, available: t }));
165
168
  return;
166
169
  }
167
- E?.(
168
- Te.current,
169
- ke.current
170
+ I?.(
171
+ Ce.current,
172
+ Te.current
170
173
  );
171
174
  try {
172
175
  C({ available: [], loading: !0 });
173
- const t = await r(s, {
176
+ const t = await r(c, {
174
177
  signal: k.current.signal
175
- }), o = y ? y(t) : t;
178
+ }), o = O ? O(t) : t;
176
179
  C({ available: o, loading: !1 });
177
180
  } catch (t) {
178
- k.current?.signal.aborted || (console.error("Error loading options:", t), C({ available: [], loading: !1 }), E?.("error", JSON.stringify(t)));
181
+ k.current?.signal.aborted || (console.error("Error loading options:", t), C({ available: [], loading: !1 }), I?.("error", JSON.stringify(t)));
179
182
  }
180
183
  })(), () => k.current?.abort()) : void 0, [
181
- z,
184
+ D,
182
185
  r,
183
- s,
184
- y,
185
- E,
186
+ c,
187
+ O,
188
+ I,
186
189
  m
187
190
  ]);
188
- const Le = u(() => {
189
- c || D([]), x?.([], "");
190
- }, [c, x]), we = u(
191
+ const Ne = s(() => {
192
+ d || E([]), P?.([], "");
193
+ }, [d, P]), Le = s(
191
194
  (e, t) => {
192
- if (t.open && typeof r == "function" && s.length < m) {
195
+ if (t.open && typeof r == "function" && c.length < m) {
193
196
  T(!1);
194
197
  return;
195
198
  }
196
199
  t.open && typeof r == "function" && C({ available: [], loading: !0 }), T(t.open);
197
200
  },
198
- [r, s, m]
199
- ), Ae = u(
201
+ [r, c, m]
202
+ ), we = s(
200
203
  (e) => {
201
204
  const t = e.target.value;
202
205
  H(t), typeof r == "function" && t.length < m && T(!1);
203
206
  },
204
207
  [r, m]
205
- ), Re = u(
208
+ ), Ae = s(
206
209
  (e, t) => {
207
210
  if (t.value === "no-matches") return;
208
211
  let o;
209
212
  q ? o = t.selectedOptions : (o = t.selectedOptions.slice(-1), T(!1)), H(""), typeof r == "function" && m > 0 && T(!1);
210
- const M = o.map((d) => {
211
- const _ = l.get(d) || g.current[d];
212
- return _ && (g.current[d] = _), _ || { key: d, text: d };
213
+ const v = o.map((p) => {
214
+ const z = l.get(p) || g.current[p];
215
+ return z && (g.current[p] = z), z || { key: p, text: p };
213
216
  });
214
- c || D(M), x?.(
215
- M,
216
- pe(Ke(M))
217
+ d || E(v), P?.(
218
+ v,
219
+ pe(Je(v))
217
220
  );
218
221
  },
219
- [l, x, q, c]
220
- ), Be = ze({
222
+ [l, P, q, d]
223
+ ), Re = De({
221
224
  // La consulta actual ingresada por el usuario para filtrar opciones.
222
- query: s,
225
+ query: c,
223
226
  // Lista de claves (como strings) de las opciones disponibles, obtenidas de 'availableOptions'.
224
227
  options: ve,
225
228
  // Elemento a mostrar cuando no hay opciones disponibles.
226
- noOptionsElement: Pe ? (
229
+ noOptionsElement: Me ? (
227
230
  // Si está cargando ('isLoading' es true), muestra un spinner pequeño.
228
231
  /* @__PURE__ */ a(
229
- Ve,
232
+ ze,
230
233
  {
231
234
  style: { height: "30px" },
232
235
  size: "extra-tiny",
@@ -244,7 +247,7 @@ const Q = [], Ze = 12, ue = (P) => /* @__PURE__ */ a(Je, { shape: "square", "ari
244
247
  R,
245
248
  {
246
249
  value: "no-matches",
247
- media: /* @__PURE__ */ a(Ye, {}),
250
+ media: /* @__PURE__ */ a(Ke, {}),
248
251
  children: S.noMatchesMessage
249
252
  }
250
253
  )
@@ -254,20 +257,20 @@ const Q = [], Ze = 12, ue = (P) => /* @__PURE__ */ a(Je, { shape: "square", "ari
254
257
  * @param {string} optionKey - Clave de la opción a renderizar.
255
258
  * @returns {JSX.Element} - Elemento JSX que representa la opción.
256
259
  */
257
- renderOption: u(
260
+ renderOption: s(
258
261
  (e) => {
259
262
  const t = l.get(e);
260
263
  if (t) {
261
- const o = V.current(t), M = o != null && o !== !1, d = typeof o == "boolean" ? void 0 : o;
262
- return !M && t.secondaryContent ? /* @__PURE__ */ a(
264
+ const o = L(t), v = o != null && o !== !1, p = typeof o == "boolean" ? void 0 : o;
265
+ return !v && t.secondaryContent ? /* @__PURE__ */ a(
263
266
  R,
264
267
  {
265
- media: d,
268
+ media: p,
266
269
  text: t.text,
267
270
  value: t.key,
268
- children: /* @__PURE__ */ F("div", { className: O.efwTagPickerOptionContentNoMedia, children: [
271
+ children: /* @__PURE__ */ V("div", { className: y.efwTagPickerOptionContentNoMedia, children: [
269
272
  /* @__PURE__ */ a("span", { children: t.text }),
270
- /* @__PURE__ */ a("span", { className: O.efwTagPickerOptionSecondaryNoMedia, children: t.secondaryContent })
273
+ /* @__PURE__ */ a("span", { className: y.efwTagPickerOptionSecondaryNoMedia, children: t.secondaryContent })
271
274
  ] })
272
275
  },
273
276
  t.key
@@ -275,7 +278,7 @@ const Q = [], Ze = 12, ue = (P) => /* @__PURE__ */ a(Je, { shape: "square", "ari
275
278
  R,
276
279
  {
277
280
  secondaryContent: t.secondaryContent || "",
278
- media: d,
281
+ media: p,
279
282
  text: t.text,
280
283
  value: t.key,
281
284
  children: t.text
@@ -290,8 +293,9 @@ const Q = [], Ze = 12, ue = (P) => /* @__PURE__ */ a(Je, { shape: "square", "ari
290
293
  },
291
294
  [
292
295
  l,
293
- O.efwTagPickerOptionContentNoMedia,
294
- O.efwTagPickerOptionSecondaryNoMedia
296
+ L,
297
+ y.efwTagPickerOptionContentNoMedia,
298
+ y.efwTagPickerOptionSecondaryNoMedia
295
299
  ]
296
300
  ),
297
301
  // Dependencia: se recrea solo si cambia el set de opciones disponibles.
@@ -300,85 +304,85 @@ const Q = [], Ze = 12, ue = (P) => /* @__PURE__ */ a(Je, { shape: "square", "ari
300
304
  * @param {string} optionKey - Clave de la opción a evaluar.
301
305
  * @returns {boolean} - True si la opción debe mostrarse, false si no.
302
306
  */
303
- filter: u(
307
+ filter: s(
304
308
  (e) => {
305
309
  const t = l.get(e);
306
310
  return t ? !K.has(e) && t.text.toLowerCase().includes($) : !1;
307
311
  },
308
312
  [l, K, $]
309
313
  )
310
- }), Ie = _e(
311
- ge,
312
- O.efwTagPickerControl,
313
- X === "error" && O.efwTagPickerControlError
314
+ }), Be = Ve(
315
+ ue,
316
+ y.efwTagPickerControl,
317
+ X === "error" && y.efwTagPickerControlError
314
318
  );
315
- if (A(() => {
316
- c || D(U);
317
- }, [c, U]), fe) return null;
318
- if (!me) {
319
+ if (_(() => {
320
+ d || E(U);
321
+ }, [d, U]), ge) return null;
322
+ if (!fe) {
319
323
  const e = pe(i) || S.emptyState, t = ye?.(
320
324
  i,
321
325
  e
322
326
  );
323
- return t != null ? /* @__PURE__ */ a(Ee, { children: t }) : /* @__PURE__ */ a(Fe, { style: i.length ? void 0 : { opacity: 0.7 }, children: e });
327
+ return t != null ? /* @__PURE__ */ a(Ie, { children: t }) : /* @__PURE__ */ a(_e, { style: i.length ? void 0 : { opacity: 0.7 }, children: e });
324
328
  }
325
- return /* @__PURE__ */ F(
326
- Qe,
329
+ return /* @__PURE__ */ V(
330
+ Fe,
327
331
  {
328
- open: z,
329
- size: he,
330
- disabled: W,
331
- onOptionSelect: Re,
332
- onOpenChange: we,
332
+ open: D,
333
+ size: be,
334
+ disabled: Q,
335
+ onOptionSelect: Ae,
336
+ onOpenChange: Le,
333
337
  selectedOptions: b,
334
- noPopover: be,
338
+ noPopover: me,
335
339
  positioning: {
336
340
  autoSize: "height",
337
- overflowBoundaryPadding: Ze
341
+ overflowBoundaryPadding: Ue
338
342
  },
339
343
  children: [
340
- /* @__PURE__ */ F(
341
- We,
344
+ /* @__PURE__ */ V(
345
+ Qe,
342
346
  {
343
- className: Ie,
344
- secondaryAction: !W && b.length ? /* @__PURE__ */ a(
345
- Xe,
347
+ className: Be,
348
+ secondaryAction: !Q && b.length ? /* @__PURE__ */ a(
349
+ qe,
346
350
  {
347
351
  appearance: "transparent",
348
352
  size: "small",
349
353
  shape: "rounded",
350
- onClick: Le,
351
- icon: /* @__PURE__ */ a($e, {}),
354
+ onClick: Ne,
355
+ icon: /* @__PURE__ */ a(Ye, {}),
352
356
  iconPosition: "before"
353
357
  }
354
358
  ) : void 0,
355
359
  children: [
356
- /* @__PURE__ */ a(je, { "aria-label": S.selectedItemsAriaLabel, children: b.map((e) => /* @__PURE__ */ a(
357
- Ge,
360
+ /* @__PURE__ */ a(We, { "aria-label": S.selectedItemsAriaLabel, children: b.map((e) => /* @__PURE__ */ a(
361
+ je,
358
362
  {
359
363
  style: { paddingTop: "0px", paddingBottom: "0px" },
360
- shape: Se,
361
- appearance: Oe,
362
- media: Ne(e),
364
+ shape: he,
365
+ appearance: Se,
366
+ media: xe(e),
363
367
  value: e,
364
- children: xe(e)
368
+ children: Pe(e)
365
369
  },
366
370
  e
367
371
  )) }),
368
372
  /* @__PURE__ */ a(
369
- qe,
373
+ Ge,
370
374
  {
371
375
  placeholder: b.length ? "" : S.placeholder,
372
376
  autoComplete: "off",
373
377
  "aria-label": S.inputAriaLabel,
374
- value: s,
375
- onChange: Ae
378
+ value: c,
379
+ onChange: we
376
380
  }
377
381
  )
378
382
  ]
379
383
  }
380
384
  ),
381
- /* @__PURE__ */ a(He, { children: Be })
385
+ /* @__PURE__ */ a(Xe, { children: Re })
382
386
  ]
383
387
  }
384
388
  );