@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.
- package/dist/index.js +72 -69
- package/dist/react-components/fields/TagPicker/EFWTagPicker.js +130 -126
- package/dist/react-components/fields/TagPicker/EFWTagPicker.types.d.ts +11 -6
- package/dist/react-components/forms/EFWForm/EFWForm.js +284 -290
- package/dist/react-components/forms/EFWForm/EFWForm.utils.d.ts +26 -1
- package/dist/react-components/forms/EFWForm/EFWForm.utils.js +94 -65
- package/dist/react-components/forms/EFWForm/index.d.ts +4 -3
- package/dist/react-components/forms/EFWForm/index.js +10 -7
- package/dist/react-components/tables/EFWTable/EFWTable.js +767 -747
- package/dist/react-components/tables/EFWTable/EFWTable.types.d.ts +10 -1
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.js +31 -9
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.types.d.ts +39 -4
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.utils.d.ts +8 -3
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.utils.js +4 -1
- package/dist/react-components/tables/EFWTable/hooks/useDefaultAddButton/useDefaultAddButton.d.ts +1 -1
- package/dist/react-components/tables/EFWTable/hooks/useDefaultAddButton/useDefaultAddButton.js +47 -15
- package/dist/react-components/tables/EFWTable/hooks/useDefaultUpdateButton/useDefaultUpdateButton.js +52 -21
- package/dist/react-components/tables/EFWTable/utils/index.d.ts +2 -1
- package/dist/react-components/tables/EFWTable/utils/index.js +19 -17
- package/dist/react-components/tables/EFWTable/utils/itemCompletion.d.ts +32 -0
- package/dist/react-components/tables/EFWTable/utils/itemCompletion.js +23 -0
- 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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
15
|
-
import { getInputFormattedValue as
|
|
16
|
-
import { EFWInputField as
|
|
17
|
-
import { EFWNumberInput as
|
|
18
|
-
import { getNumberInputFormattedValue as
|
|
19
|
-
import { EFWNumberInputField as
|
|
20
|
-
import { EFWSwitch as
|
|
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
|
|
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 {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
56
|
+
ne as EFWConversionError,
|
|
56
57
|
O as EFWDatePicker,
|
|
57
58
|
U as EFWDatePickerField,
|
|
58
59
|
f as EFWDrawerButton,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
_ as EFWField,
|
|
61
|
+
_e as EFWForm,
|
|
62
|
+
de as EFWFormMessageBarGroup,
|
|
62
63
|
u as EFWGroupButton,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
78
|
-
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
89
|
+
Ae as flatToEFWValues,
|
|
88
90
|
o as formatFileSize,
|
|
89
91
|
A as getAttachmentsFormattedValue,
|
|
90
|
-
|
|
92
|
+
B as getDatePickerFormattedValue,
|
|
93
|
+
fe as getEmptyValueForFieldType,
|
|
91
94
|
t as getErrorMessage,
|
|
92
95
|
F as getFileIconUrl,
|
|
93
96
|
xe as getFormFieldDisplayText,
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
y as getInputFormattedValue,
|
|
98
|
+
G as getNumberInputFormattedValue,
|
|
96
99
|
q as getSwitchFormattedValue,
|
|
97
100
|
$ as getTagPickerFormattedValue,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { makeStyles as
|
|
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
|
|
6
|
-
import { CollectionsEmpty20Regular as
|
|
7
|
-
import { useFieldsLocaleText as
|
|
8
|
-
const
|
|
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 = (
|
|
65
|
+
}), ct = (M) => {
|
|
66
66
|
const {
|
|
67
67
|
labels: f,
|
|
68
|
-
className:
|
|
68
|
+
className: ue = "",
|
|
69
69
|
minQueryLength: m = 0,
|
|
70
|
-
options: r =
|
|
71
|
-
hidden:
|
|
72
|
-
disabled:
|
|
73
|
-
editable:
|
|
74
|
-
selectedOptions:
|
|
75
|
-
defaultSelectedOptions: B =
|
|
76
|
-
noPopover:
|
|
77
|
-
tagSize:
|
|
78
|
-
tagShape:
|
|
79
|
-
tagAppearance:
|
|
80
|
-
onChange:
|
|
81
|
-
beforeRenderOptions:
|
|
82
|
-
renderOptionMedia:
|
|
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:
|
|
88
|
-
setParentComponentState:
|
|
89
|
-
} =
|
|
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 =
|
|
92
|
+
), b = u(
|
|
93
93
|
() => i.map((e) => e.key),
|
|
94
94
|
[i]
|
|
95
|
-
), K =
|
|
95
|
+
), K = u(
|
|
96
96
|
() => new Set(b),
|
|
97
97
|
[b]
|
|
98
|
-
), [Y, C] =
|
|
99
|
-
() =>
|
|
100
|
-
[
|
|
101
|
-
), l =
|
|
102
|
-
() => new Map(
|
|
103
|
-
[
|
|
104
|
-
),
|
|
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
|
|
109
|
-
I ?? ue
|
|
110
|
-
), U = p(
|
|
108
|
+
const U = u(
|
|
111
109
|
() => B ?? [],
|
|
112
110
|
[B]
|
|
113
|
-
), h =
|
|
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
|
-
|
|
132
|
+
_(() => {
|
|
135
133
|
i.forEach((e) => {
|
|
136
134
|
g.current[e.key] = e;
|
|
137
135
|
});
|
|
138
|
-
}, [i])
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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 =
|
|
150
|
+
const t = x.get(e) || l.get(e) || g.current[e];
|
|
149
151
|
if (!t)
|
|
150
152
|
return;
|
|
151
|
-
const o =
|
|
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
|
-
|
|
158
|
-
l
|
|
159
|
+
x,
|
|
160
|
+
l,
|
|
161
|
+
L
|
|
159
162
|
]
|
|
160
163
|
);
|
|
161
|
-
|
|
164
|
+
_(() => D ? (k.current?.abort(), k.current = new AbortController(), (async () => {
|
|
162
165
|
if (typeof r != "function") {
|
|
163
|
-
const t =
|
|
166
|
+
const t = O ? O(r) : r;
|
|
164
167
|
C((o) => ({ ...o, available: t }));
|
|
165
168
|
return;
|
|
166
169
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
+
I?.(
|
|
171
|
+
Ce.current,
|
|
172
|
+
Te.current
|
|
170
173
|
);
|
|
171
174
|
try {
|
|
172
175
|
C({ available: [], loading: !0 });
|
|
173
|
-
const t = await r(
|
|
176
|
+
const t = await r(c, {
|
|
174
177
|
signal: k.current.signal
|
|
175
|
-
}), o =
|
|
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 }),
|
|
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
|
-
|
|
184
|
+
D,
|
|
182
185
|
r,
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
+
c,
|
|
187
|
+
O,
|
|
188
|
+
I,
|
|
186
189
|
m
|
|
187
190
|
]);
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
}, [
|
|
191
|
+
const Ne = s(() => {
|
|
192
|
+
d || E([]), P?.([], "");
|
|
193
|
+
}, [d, P]), Le = s(
|
|
191
194
|
(e, t) => {
|
|
192
|
-
if (t.open && typeof r == "function" &&
|
|
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,
|
|
199
|
-
),
|
|
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
|
-
),
|
|
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
|
|
211
|
-
const
|
|
212
|
-
return
|
|
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
|
-
|
|
215
|
-
|
|
216
|
-
pe(
|
|
217
|
+
d || E(v), P?.(
|
|
218
|
+
v,
|
|
219
|
+
pe(Je(v))
|
|
217
220
|
);
|
|
218
221
|
},
|
|
219
|
-
[l,
|
|
220
|
-
),
|
|
222
|
+
[l, P, q, d]
|
|
223
|
+
), Re = De({
|
|
221
224
|
// La consulta actual ingresada por el usuario para filtrar opciones.
|
|
222
|
-
query:
|
|
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:
|
|
229
|
+
noOptionsElement: Me ? (
|
|
227
230
|
// Si está cargando ('isLoading' es true), muestra un spinner pequeño.
|
|
228
231
|
/* @__PURE__ */ a(
|
|
229
|
-
|
|
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(
|
|
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:
|
|
260
|
+
renderOption: s(
|
|
258
261
|
(e) => {
|
|
259
262
|
const t = l.get(e);
|
|
260
263
|
if (t) {
|
|
261
|
-
const o =
|
|
262
|
-
return !
|
|
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:
|
|
268
|
+
media: p,
|
|
266
269
|
text: t.text,
|
|
267
270
|
value: t.key,
|
|
268
|
-
children: /* @__PURE__ */
|
|
271
|
+
children: /* @__PURE__ */ V("div", { className: y.efwTagPickerOptionContentNoMedia, children: [
|
|
269
272
|
/* @__PURE__ */ a("span", { children: t.text }),
|
|
270
|
-
/* @__PURE__ */ a("span", { className:
|
|
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:
|
|
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
|
-
|
|
294
|
-
|
|
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:
|
|
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
|
-
}),
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
X === "error" &&
|
|
314
|
+
}), Be = Ve(
|
|
315
|
+
ue,
|
|
316
|
+
y.efwTagPickerControl,
|
|
317
|
+
X === "error" && y.efwTagPickerControlError
|
|
314
318
|
);
|
|
315
|
-
if (
|
|
316
|
-
|
|
317
|
-
}, [
|
|
318
|
-
if (!
|
|
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(
|
|
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__ */
|
|
326
|
-
|
|
329
|
+
return /* @__PURE__ */ V(
|
|
330
|
+
Fe,
|
|
327
331
|
{
|
|
328
|
-
open:
|
|
329
|
-
size:
|
|
330
|
-
disabled:
|
|
331
|
-
onOptionSelect:
|
|
332
|
-
onOpenChange:
|
|
332
|
+
open: D,
|
|
333
|
+
size: be,
|
|
334
|
+
disabled: Q,
|
|
335
|
+
onOptionSelect: Ae,
|
|
336
|
+
onOpenChange: Le,
|
|
333
337
|
selectedOptions: b,
|
|
334
|
-
noPopover:
|
|
338
|
+
noPopover: me,
|
|
335
339
|
positioning: {
|
|
336
340
|
autoSize: "height",
|
|
337
|
-
overflowBoundaryPadding:
|
|
341
|
+
overflowBoundaryPadding: Ue
|
|
338
342
|
},
|
|
339
343
|
children: [
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
-
|
|
344
|
+
/* @__PURE__ */ V(
|
|
345
|
+
Qe,
|
|
342
346
|
{
|
|
343
|
-
className:
|
|
344
|
-
secondaryAction: !
|
|
345
|
-
|
|
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:
|
|
351
|
-
icon: /* @__PURE__ */ a(
|
|
354
|
+
onClick: Ne,
|
|
355
|
+
icon: /* @__PURE__ */ a(Ye, {}),
|
|
352
356
|
iconPosition: "before"
|
|
353
357
|
}
|
|
354
358
|
) : void 0,
|
|
355
359
|
children: [
|
|
356
|
-
/* @__PURE__ */ a(
|
|
357
|
-
|
|
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:
|
|
361
|
-
appearance:
|
|
362
|
-
media:
|
|
364
|
+
shape: he,
|
|
365
|
+
appearance: Se,
|
|
366
|
+
media: xe(e),
|
|
363
367
|
value: e,
|
|
364
|
-
children:
|
|
368
|
+
children: Pe(e)
|
|
365
369
|
},
|
|
366
370
|
e
|
|
367
371
|
)) }),
|
|
368
372
|
/* @__PURE__ */ a(
|
|
369
|
-
|
|
373
|
+
Ge,
|
|
370
374
|
{
|
|
371
375
|
placeholder: b.length ? "" : S.placeholder,
|
|
372
376
|
autoComplete: "off",
|
|
373
377
|
"aria-label": S.inputAriaLabel,
|
|
374
|
-
value:
|
|
375
|
-
onChange:
|
|
378
|
+
value: c,
|
|
379
|
+
onChange: we
|
|
376
380
|
}
|
|
377
381
|
)
|
|
378
382
|
]
|
|
379
383
|
}
|
|
380
384
|
),
|
|
381
|
-
/* @__PURE__ */ a(
|
|
385
|
+
/* @__PURE__ */ a(Xe, { children: Re })
|
|
382
386
|
]
|
|
383
387
|
}
|
|
384
388
|
);
|