@epam/ai-dial-ui-kit 0.15.0-dev.7 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -2
- package/dist/CHANGELOG.md +86 -0
- package/dist/DateCellRenderer-BdUMSg-E.cjs +1 -0
- package/dist/{DateCellRenderer-4iMidqal.cjs → DateCellRenderer-CZNa4jVJ.cjs} +30 -30
- package/dist/IconButton-DHOFapLo.cjs +1 -0
- package/dist/JsonEditor-Bxui5wJH.cjs +1 -0
- package/dist/{MarkdownEditor-C9-ZMRVi.cjs → MarkdownEditor-BKtFs714.cjs} +1 -1
- package/dist/MarkdownEditor-Bapd1ycU.cjs +1 -0
- package/dist/MarkdownEditorContainer-B5aHwoYF.cjs +1 -0
- package/dist/{Switch-CUKClcEz.cjs → Switch-DE6MrcqJ.cjs} +1 -1
- package/dist/components/Button/constants.js +9 -8
- package/dist/components/Dropdown/Dropdown.js +2 -2
- package/dist/components/Dropdown/DropdownSubMenuItem.js +1 -1
- package/dist/components/Dropdown/constants.js +7 -7
- package/dist/components/DropdownIcon/DropdownIcon.js +4 -4
- package/dist/components/FileManager/FileManager.js +373 -372
- package/dist/components/FileManager/FileManagerProvider.js +266 -264
- package/dist/components/FileManager/hooks/use-grid-context-menu.js +59 -59
- package/dist/components/MarkdownEditor/MarkdownEditor.js +23 -21
- package/dist/components/MarkdownEditor/MarkdownEditorContainer.js +27 -27
- package/dist/components/New/Accordion/Accordion.js +86 -72
- package/dist/components/New/AutocompleteTagInput/AutocompleteTagInput.js +214 -0
- package/dist/components/New/AutocompleteTagInput/utils.js +11 -0
- package/dist/components/New/Avatar/Avatar.js +70 -0
- package/dist/components/New/Badge/Badge.js +45 -0
- package/dist/components/New/BottomSheet/BottomSheet.js +128 -0
- package/dist/components/New/Breadcrumbs/Breadcrumbs.js +159 -0
- package/dist/components/New/Breadcrumbs/constants.js +41 -0
- package/dist/components/New/Button/Button.js +32 -32
- package/dist/components/New/Button/ButtonWrappers.js +103 -37
- package/dist/components/New/Button/constants.js +3 -0
- package/dist/components/New/Button/utils.js +18 -8
- package/dist/components/New/ButtonDropdown/ButtonDropdown.js +27 -18
- package/dist/components/New/Calendar/Calendar.js +6 -6
- package/dist/components/New/Calendar/constants.js +5 -5
- package/dist/components/New/CaptionText/CaptionText.js +3 -3
- package/dist/components/New/CardShell/CardShell.js +2 -2
- package/dist/components/New/Checkbox/Checkbox.js +2 -2
- package/dist/components/New/Checkbox/CheckboxBox.js +2 -2
- package/dist/components/New/CloseButton/CloseButton.js +1 -1
- package/dist/components/New/CollapsibleSidebar/CollapsibleSidebar.js +2 -2
- package/dist/components/New/ConfirmationPopup/ConfirmationPopup.js +21 -25
- package/dist/components/New/ConfirmationPopup/constants.js +8 -11
- package/dist/components/New/Dropdown/Dropdown.js +99 -98
- package/dist/components/New/Dropdown/DropdownSubMenuItem.js +17 -17
- package/dist/components/New/Dropdown/constants.js +22 -17
- package/dist/components/New/EllipsisTooltip/EllipsisTooltip.js +2 -2
- package/dist/components/New/EntityIdentity/EntityIdentity.js +135 -0
- package/dist/components/New/FileDropzone/FileDropzone.js +2 -2
- package/dist/components/New/FileIcon/FileIcon.js +55 -0
- package/dist/components/New/FileIcon/constants.js +134 -0
- package/dist/components/New/FileIcon/icons/FileGlyph.js +150 -0
- package/dist/components/New/FileIcon/icons/FolderGlyph.js +50 -0
- package/dist/components/New/FileName/FileName.js +78 -0
- package/dist/components/New/FilterChips/FilterChips.js +43 -0
- package/dist/components/New/FilterChips/constants.js +5 -0
- package/dist/components/New/FolderName/FolderName.js +16 -0
- package/dist/components/New/FolderPath/FolderPath.js +1 -1
- package/dist/components/New/Grid/constants.js +14 -5
- package/dist/components/New/Highlight/Highlight.js +2 -2
- package/dist/components/New/IconButton/IconButton.js +30 -28
- package/dist/components/New/InfoButton/InfoButton.js +2 -2
- package/dist/components/New/InlineSelect/InlineSelect.js +75 -59
- package/dist/components/New/InteractiveTooltip/InteractiveTooltip.js +70 -66
- package/dist/components/New/InteractiveTooltip/constants.js +2 -2
- package/dist/components/New/Label/Label.js +2 -2
- package/dist/components/New/MarkdownEditor/MarkdownEditor.js +29 -27
- package/dist/components/New/MenuItem/MenuItem.js +2 -2
- package/dist/components/New/MenuItem/constants.js +1 -1
- package/dist/components/New/NoDataContent/NoDataContent.js +2 -2
- package/dist/components/New/Notification/Notification.js +37 -35
- package/dist/components/New/NumberInput/NumberInput.js +2 -2
- package/dist/components/New/PasswordInput/PasswordInput.js +2 -2
- package/dist/components/New/Popup/Popup.js +59 -57
- package/dist/components/New/Popup/constants.js +3 -3
- package/dist/components/New/Radio/Radio.js +2 -2
- package/dist/components/New/RadioGroup/RadioGroup.js +2 -2
- package/dist/components/New/RadioGroupPopupField/RadioGroupPopupField.js +2 -2
- package/dist/components/New/ResizableContainer/ResizableContainer.js +2 -2
- package/dist/components/New/SchemaRenderer/SchemaRenderer.js +164 -0
- package/dist/components/New/SchemaRenderer/components/SchemaAnyOfEditor.js +65 -0
- package/dist/components/New/SchemaRenderer/components/SchemaArrayEditor.js +109 -0
- package/dist/components/New/SchemaRenderer/components/SchemaField.js +83 -0
- package/dist/components/New/SchemaRenderer/components/SchemaFieldContent.js +72 -0
- package/dist/components/New/SchemaRenderer/components/SchemaJsonEditor.js +41 -0
- package/dist/components/New/SchemaRenderer/components/SchemaKeyValueEditor.js +250 -0
- package/dist/components/New/SchemaRenderer/components/SchemaObjectEditor.js +36 -0
- package/dist/components/New/SchemaRenderer/components/SchemaOneOfEditor.js +163 -0
- package/dist/components/New/SchemaRenderer/components/SchemaPrimitiveField.js +150 -0
- package/dist/components/New/SchemaRenderer/components/SchemaSection.js +135 -0
- package/dist/components/New/SchemaRenderer/context.js +17 -0
- package/dist/components/New/Search/Search.js +2 -2
- package/dist/components/New/SegmentedControl/SegmentedControl.js +4 -4
- package/dist/components/New/Select/CollapsedSelectTags.js +127 -0
- package/dist/components/New/Select/MultiSelectTags.js +18 -15
- package/dist/components/New/Select/Select.js +184 -173
- package/dist/components/New/Select/constants.js +23 -20
- package/dist/components/New/SharedEntityIndicator/SharedEntityIndicator.js +34 -0
- package/dist/components/New/SideDrawer/SideDrawer.js +148 -0
- package/dist/components/New/Slider/Slider.js +184 -91
- package/dist/components/New/Slider/utils.js +20 -0
- package/dist/components/New/Switch/Switch.js +2 -2
- package/dist/components/New/Tabs/Tabs.js +124 -66
- package/dist/components/New/Tag/Tag.js +2 -2
- package/dist/components/New/TagInput/TagInput.js +5 -3
- package/dist/components/New/Textarea/Textarea.js +21 -20
- package/dist/components/New/ToggleIconButton/ToggleIconButton.js +2 -2
- package/dist/components/New/Tooltip/TooltipContent.js +2 -2
- package/dist/components/New/Tooltip/constants.js +1 -1
- package/dist/components/New/TransferQueue/TransferQueue.js +124 -0
- package/dist/components/New/TransferQueue/TransferQueueHeader.js +71 -0
- package/dist/components/New/TransferQueue/TransferQueueRow.js +119 -0
- package/dist/components/New/TransferQueue/constants.js +24 -0
- package/dist/components/New/constants/overlay.js +17 -9
- package/dist/components/Popup/constants.js +8 -8
- package/dist/components/ProgressBar/ProgressBar.js +6 -6
- package/dist/components/SchemaRenderer/SchemaRenderer.js +16 -15
- package/dist/components/SchemaRenderer/components/SchemaAdditionalPropertiesEditor.js +46 -31
- package/dist/components/SchemaRenderer/components/SchemaAnyOfEditor.js +2 -2
- package/dist/components/SchemaRenderer/components/SchemaArrayEditor.js +1 -1
- package/dist/components/SchemaRenderer/components/SchemaField.js +23 -23
- package/dist/components/SchemaRenderer/components/SchemaFieldContent.js +19 -19
- package/dist/components/SchemaRenderer/components/SchemaKeyValueEditor.js +223 -135
- package/dist/components/SchemaRenderer/components/SchemaObjectEditor.js +1 -1
- package/dist/components/SchemaRenderer/components/SchemaOneOfEditor.js +13 -13
- package/dist/components/SchemaRenderer/components/SchemaPrimitiveField.js +5 -5
- package/dist/components/Skeleton/Skeleton.js +2 -2
- package/dist/components/Spinner/Spinner.js +2 -2
- package/dist/components/Tooltip/TooltipContent.js +11 -11
- package/dist/components-manifest.json +1873 -78
- package/dist/constants/public-class-names.js +69 -3
- package/dist/constants/schema-renderer.js +33 -0
- package/dist/dial-ui-kit.cjs +2 -2
- package/dist/dial-ui-kit.js +358 -310
- package/dist/editors.cjs +1 -1
- package/dist/file-manager.cjs +1 -1
- package/dist/grid.cjs +1 -1
- package/dist/index.css +2 -2
- package/dist/lazy-_W6FYhKg.cjs +1 -0
- package/dist/merge-classes-BEJXjzkx.cjs +1 -0
- package/dist/migration-guides/0.15.0/legacy-theme-variable-fallbacks-removal.md +69 -0
- package/dist/migration-guides/0.15.0/slider-redesign.md +110 -0
- package/dist/migration-guides/README.md +2 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +419 -399
- package/dist/src/components/FileManager/FileManager.d.ts +2 -0
- package/dist/src/components/FileManager/FileManagerContext.d.ts +1 -0
- package/dist/src/components/FileManager/hooks/use-grid-context-menu.d.ts +2 -1
- package/dist/src/components/MarkdownEditor/MarkdownEditor.d.ts +2 -0
- package/dist/src/components/MarkdownEditor/MarkdownEditorContainer.d.ts +2 -0
- package/dist/src/components/New/Accordion/Accordion.d.ts +6 -1
- package/dist/src/components/New/AutocompleteTagInput/AutocompleteTagInput.d.ts +108 -0
- package/dist/src/components/New/AutocompleteTagInput/utils.d.ts +17 -0
- package/dist/src/components/New/AutocompleteTagInput/utils.spec.d.ts +1 -0
- package/dist/src/components/New/Avatar/Avatar.d.ts +55 -0
- package/dist/src/components/New/Badge/Badge.d.ts +47 -0
- package/dist/src/components/New/BottomSheet/BottomSheet.d.ts +84 -0
- package/dist/src/components/New/Breadcrumbs/Breadcrumbs.d.ts +94 -0
- package/dist/src/components/New/Breadcrumbs/constants.d.ts +60 -0
- package/dist/src/components/New/Button/Button.d.ts +4 -1
- package/dist/src/components/New/Button/ButtonWrappers.d.ts +21 -0
- package/dist/src/components/New/Button/utils.d.ts +15 -0
- package/dist/src/components/New/ButtonDropdown/ButtonDropdown.d.ts +4 -0
- package/dist/src/components/New/Calendar/constants.d.ts +1 -1
- package/dist/src/components/New/ConfirmationPopup/constants.d.ts +0 -1
- package/dist/src/components/New/Dropdown/Dropdown.d.ts +9 -1
- package/dist/src/components/New/Dropdown/constants.d.ts +3 -0
- package/dist/src/components/New/EntityIdentity/EntityIdentity.d.ts +85 -0
- package/dist/src/components/New/FileIcon/FileIcon.d.ts +61 -0
- package/dist/src/components/New/FileIcon/constants.d.ts +16 -0
- package/dist/src/components/New/FileIcon/icons/FileGlyph.d.ts +18 -0
- package/dist/src/components/New/FileIcon/icons/FolderGlyph.d.ts +17 -0
- package/dist/src/components/New/FileName/FileName.d.ts +79 -0
- package/dist/src/components/New/FilterChips/FilterChips.d.ts +69 -0
- package/dist/src/components/New/FilterChips/constants.d.ts +13 -0
- package/dist/src/components/New/FolderName/FolderName.d.ts +37 -0
- package/dist/src/components/New/Grid/constants.d.ts +6 -4
- package/dist/src/components/New/InlineSelect/InlineSelect.d.ts +16 -1
- package/dist/src/components/New/InteractiveTooltip/InteractiveTooltip.d.ts +13 -2
- package/dist/src/components/New/InteractiveTooltip/constants.d.ts +5 -4
- package/dist/src/components/New/MarkdownEditor/MarkdownEditor.d.ts +3 -0
- package/dist/src/components/New/Notification/Notification.d.ts +18 -0
- package/dist/src/components/New/Popup/Popup.d.ts +8 -1
- package/dist/src/components/New/Popup/constants.d.ts +1 -1
- package/dist/src/components/New/SchemaRenderer/SchemaRenderer.d.ts +38 -0
- package/dist/src/components/New/SchemaRenderer/components/SchemaAnyOfEditor.d.ts +37 -0
- package/dist/src/components/New/SchemaRenderer/components/SchemaArrayEditor.d.ts +35 -0
- package/dist/src/components/New/SchemaRenderer/components/SchemaField.d.ts +33 -0
- package/dist/src/components/New/SchemaRenderer/components/SchemaFieldContent.d.ts +30 -0
- package/dist/src/components/New/SchemaRenderer/components/SchemaJsonEditor.d.ts +29 -0
- package/dist/src/components/New/SchemaRenderer/components/SchemaKeyValueEditor.d.ts +37 -0
- package/dist/src/components/New/SchemaRenderer/components/SchemaObjectEditor.d.ts +32 -0
- package/dist/src/components/New/SchemaRenderer/components/SchemaOneOfEditor.d.ts +39 -0
- package/dist/src/components/New/SchemaRenderer/components/SchemaPrimitiveField.d.ts +38 -0
- package/dist/src/components/New/SchemaRenderer/components/SchemaSection.d.ts +39 -0
- package/dist/src/components/New/SchemaRenderer/context.d.ts +8 -0
- package/dist/src/components/New/SchemaRenderer/types.d.ts +76 -0
- package/dist/src/components/New/Select/CollapsedSelectTags.d.ts +22 -0
- package/dist/src/components/New/Select/MultiSelectTags.d.ts +5 -0
- package/dist/src/components/New/Select/Select.d.ts +9 -0
- package/dist/src/components/New/Select/constants.d.ts +3 -2
- package/dist/src/components/New/SharedEntityIndicator/SharedEntityIndicator.d.ts +35 -0
- package/dist/src/components/New/SideDrawer/SideDrawer.d.ts +100 -0
- package/dist/src/components/New/Slider/Slider.d.ts +29 -1
- package/dist/src/components/New/Slider/utils.d.ts +14 -0
- package/dist/src/components/New/Slider/utils.spec.d.ts +1 -0
- package/dist/src/components/New/Tabs/Tabs.d.ts +54 -6
- package/dist/src/components/New/Tooltip/constants.d.ts +5 -3
- package/dist/src/components/New/TransferQueue/TransferQueue.d.ts +139 -0
- package/dist/src/components/New/TransferQueue/TransferQueueHeader.d.ts +16 -0
- package/dist/src/components/New/TransferQueue/TransferQueueRow.d.ts +10 -0
- package/dist/src/components/New/TransferQueue/constants.d.ts +6 -0
- package/dist/src/components/New/constants/overlay.d.ts +13 -0
- package/dist/src/components/Popup/constants.d.ts +1 -1
- package/dist/src/components/SchemaRenderer/types.d.ts +5 -82
- package/dist/src/components/SchemaRenderer/utils.d.ts +1 -13
- package/dist/src/constants/public-class-names.d.ts +69 -3
- package/dist/src/constants/schema-renderer.d.ts +2 -0
- package/dist/src/index.d.ts +39 -3
- package/dist/src/models/json-schema.d.ts +71 -0
- package/dist/src/types/accordion.d.ts +7 -0
- package/dist/src/types/avatar.d.ts +7 -0
- package/dist/src/types/badge.d.ts +16 -0
- package/dist/src/types/breadcrumbs.d.ts +9 -0
- package/dist/src/types/button.d.ts +1 -0
- package/dist/src/types/entity-type.d.ts +9 -0
- package/dist/src/types/json-schema.d.ts +22 -0
- package/dist/src/types/tooltip.d.ts +4 -0
- package/dist/src/types/transfer-queue.d.ts +10 -0
- package/dist/src/utils/__tests__/avatar.spec.d.ts +1 -0
- package/dist/src/utils/avatar.d.ts +12 -0
- package/dist/src/utils/json-schema.d.ts +23 -0
- package/dist/src/utils/sub-menu-floating.d.ts +7 -4
- package/dist/types/accordion.js +4 -0
- package/dist/types/avatar.js +4 -0
- package/dist/types/badge.js +5 -0
- package/dist/types/breadcrumbs.js +4 -0
- package/dist/types/button.js +3 -3
- package/dist/types/entity-type.js +4 -0
- package/dist/types/json-schema.js +7 -0
- package/dist/types/tooltip.js +3 -2
- package/dist/types/transfer-queue.js +4 -0
- package/dist/use-file-manager-tabs-Bzzwwcgk.cjs +3 -0
- package/dist/utils/avatar.js +22 -0
- package/dist/{components/SchemaRenderer/utils.js → utils/json-schema.js} +122 -95
- package/dist/utils/merge-classes.js +12 -5
- package/dist/utils/sub-menu-floating.js +99 -54
- package/package.json +4 -9
- package/dist/DateCellRenderer-CTTAnQjB.cjs +0 -1
- package/dist/IconButton-DWqoaBWf.cjs +0 -1
- package/dist/JsonEditor-D2jSlRFi.cjs +0 -1
- package/dist/MarkdownEditor-BzEbdj7R.cjs +0 -1
- package/dist/MarkdownEditorContainer-BvwJjkiZ.cjs +0 -1
- package/dist/components/SchemaRenderer/types.js +0 -27
- package/dist/editor-_174x-qy.cjs +0 -1
- package/dist/lazy-DM-7dL0Y.cjs +0 -1
- package/dist/merge-classes-Dipy1Ih1.cjs +0 -1
- package/dist/use-file-manager-tabs-DKmWaOlC.cjs +0 -3
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { jsx as n, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import { useId as _ } from "react";
|
|
3
|
+
import { RadioGroup as D } from "../../RadioGroup/RadioGroup.js";
|
|
4
|
+
import { Select as E } from "../../Select/Select.js";
|
|
5
|
+
import { SchemaDisplayMode as q, SchemaOrientation as F } from "../../../../types/json-schema.js";
|
|
6
|
+
import { RadioGroupOrientation as G } from "../../../../types/radio-group.js";
|
|
7
|
+
import { resolveRef as f, getOptionLabel as M, extractDefaults as T } from "../../../../utils/json-schema.js";
|
|
8
|
+
import { useSchemaContext as z } from "../context.js";
|
|
9
|
+
import { SchemaFieldContent as V } from "./SchemaFieldContent.js";
|
|
10
|
+
import { SchemaObjectEditor as $ } from "./SchemaObjectEditor.js";
|
|
11
|
+
const A = (i) => typeof i == "string" ? i : i[0], B = (i, t) => {
|
|
12
|
+
const { [t]: s, ...l } = i.properties ?? {};
|
|
13
|
+
return { ...i, properties: l };
|
|
14
|
+
}, te = ({
|
|
15
|
+
schema: i,
|
|
16
|
+
value: t,
|
|
17
|
+
onChange: s,
|
|
18
|
+
path: l,
|
|
19
|
+
level: u,
|
|
20
|
+
ariaLabel: g
|
|
21
|
+
}) => {
|
|
22
|
+
const { rootSchema: a, texts: v, readonly: b = !1 } = z(), R = _(), h = g ?? v.selectTypePlaceholder, j = i.discriminatorDisplay === q.Radio, y = i.discriminator;
|
|
23
|
+
if (y) {
|
|
24
|
+
const e = y.propertyName, o = y.mapping, m = (r) => f({ $ref: o[r] }, a), x = typeof t == "object" && t !== null ? t[e] : void 0, S = x ? m(x) : void 0, P = (r) => {
|
|
25
|
+
const c = T(m(r), a) ?? {};
|
|
26
|
+
s({ ...c, [e]: r });
|
|
27
|
+
};
|
|
28
|
+
if (j) {
|
|
29
|
+
const r = i.discriminatorOrientation === F.Row, c = (p) => /* @__PURE__ */ n(
|
|
30
|
+
$,
|
|
31
|
+
{
|
|
32
|
+
schema: B(p, e),
|
|
33
|
+
value: t,
|
|
34
|
+
onChange: s,
|
|
35
|
+
path: l,
|
|
36
|
+
level: u
|
|
37
|
+
}
|
|
38
|
+
), C = /* @__PURE__ */ n(
|
|
39
|
+
D,
|
|
40
|
+
{
|
|
41
|
+
id: R,
|
|
42
|
+
ariaLabel: h,
|
|
43
|
+
value: x,
|
|
44
|
+
onChange: P,
|
|
45
|
+
disabled: b,
|
|
46
|
+
orientation: r ? G.Row : G.Column,
|
|
47
|
+
items: Object.keys(o).map((p) => {
|
|
48
|
+
const L = m(p);
|
|
49
|
+
return {
|
|
50
|
+
value: p,
|
|
51
|
+
label: L.title ?? p,
|
|
52
|
+
content: r ? void 0 : c(L)
|
|
53
|
+
};
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
return r ? /* @__PURE__ */ N("div", { className: "flex flex-col gap-3", children: [
|
|
58
|
+
C,
|
|
59
|
+
S && c(S)
|
|
60
|
+
] }) : C;
|
|
61
|
+
}
|
|
62
|
+
return /* @__PURE__ */ N("div", { className: "flex flex-col gap-3", children: [
|
|
63
|
+
/* @__PURE__ */ n(
|
|
64
|
+
E,
|
|
65
|
+
{
|
|
66
|
+
ariaLabel: h,
|
|
67
|
+
options: Object.keys(o).map((r) => ({
|
|
68
|
+
value: r,
|
|
69
|
+
label: r
|
|
70
|
+
})),
|
|
71
|
+
value: x,
|
|
72
|
+
placeholder: v.selectTypePlaceholder,
|
|
73
|
+
disabled: b,
|
|
74
|
+
onChange: (r) => {
|
|
75
|
+
const c = A(r);
|
|
76
|
+
c && P(c);
|
|
77
|
+
},
|
|
78
|
+
className: "max-w-[280px]"
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
S && /* @__PURE__ */ n("div", { className: "pl-3", children: /* @__PURE__ */ n(
|
|
82
|
+
$,
|
|
83
|
+
{
|
|
84
|
+
schema: S,
|
|
85
|
+
value: t,
|
|
86
|
+
onChange: s,
|
|
87
|
+
path: l,
|
|
88
|
+
level: u
|
|
89
|
+
}
|
|
90
|
+
) })
|
|
91
|
+
] });
|
|
92
|
+
}
|
|
93
|
+
const d = i.oneOf ?? [], O = (() => {
|
|
94
|
+
if (typeof t != "object" || t === null || Array.isArray(t))
|
|
95
|
+
return 0;
|
|
96
|
+
const e = d.findIndex(
|
|
97
|
+
(o) => f(o, a).required?.every(
|
|
98
|
+
(m) => m in t
|
|
99
|
+
)
|
|
100
|
+
);
|
|
101
|
+
return e >= 0 ? e : 0;
|
|
102
|
+
})(), I = d[O], w = (e) => {
|
|
103
|
+
const o = T(
|
|
104
|
+
f(d[e], a),
|
|
105
|
+
a
|
|
106
|
+
);
|
|
107
|
+
s(o ?? null);
|
|
108
|
+
};
|
|
109
|
+
return j ? /* @__PURE__ */ n(
|
|
110
|
+
D,
|
|
111
|
+
{
|
|
112
|
+
id: R,
|
|
113
|
+
ariaLabel: h,
|
|
114
|
+
value: String(O),
|
|
115
|
+
onChange: (e) => w(Number(e)),
|
|
116
|
+
disabled: b,
|
|
117
|
+
items: d.map((e, o) => ({
|
|
118
|
+
value: String(o),
|
|
119
|
+
label: M(e, a) ?? `Option ${o + 1}`,
|
|
120
|
+
content: /* @__PURE__ */ n(
|
|
121
|
+
V,
|
|
122
|
+
{
|
|
123
|
+
schema: f(e, a),
|
|
124
|
+
value: t,
|
|
125
|
+
onChange: s,
|
|
126
|
+
path: l,
|
|
127
|
+
level: u,
|
|
128
|
+
ariaLabel: g
|
|
129
|
+
}
|
|
130
|
+
)
|
|
131
|
+
}))
|
|
132
|
+
}
|
|
133
|
+
) : /* @__PURE__ */ N("div", { className: "flex flex-col gap-3", children: [
|
|
134
|
+
/* @__PURE__ */ n(
|
|
135
|
+
E,
|
|
136
|
+
{
|
|
137
|
+
ariaLabel: h,
|
|
138
|
+
options: d.map((e, o) => ({
|
|
139
|
+
value: String(o),
|
|
140
|
+
label: f(e, a).title ?? `Option ${o + 1}`
|
|
141
|
+
})),
|
|
142
|
+
value: String(O),
|
|
143
|
+
disabled: b,
|
|
144
|
+
onChange: (e) => w(Number(A(e))),
|
|
145
|
+
className: "max-w-[280px]"
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
I && /* @__PURE__ */ n("div", { className: "border-l-2 border-tertiary pl-3", children: /* @__PURE__ */ n(
|
|
149
|
+
V,
|
|
150
|
+
{
|
|
151
|
+
schema: I,
|
|
152
|
+
value: t,
|
|
153
|
+
onChange: s,
|
|
154
|
+
path: l,
|
|
155
|
+
level: u,
|
|
156
|
+
ariaLabel: g
|
|
157
|
+
}
|
|
158
|
+
) })
|
|
159
|
+
] });
|
|
160
|
+
};
|
|
161
|
+
export {
|
|
162
|
+
te as SchemaOneOfEditor
|
|
163
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { Input as b } from "../../Input/Input.js";
|
|
3
|
+
import { NumberInput as A } from "../../NumberInput/NumberInput.js";
|
|
4
|
+
import { PasswordInput as w } from "../../PasswordInput/PasswordInput.js";
|
|
5
|
+
import { RadioGroup as O } from "../../RadioGroup/RadioGroup.js";
|
|
6
|
+
import { Select as I } from "../../Select/Select.js";
|
|
7
|
+
import { Switch as T } from "../../Switch/Switch.js";
|
|
8
|
+
import { JsonSchemaType as p, SchemaDisplayMode as v, SchemaOrientation as V } from "../../../../types/json-schema.js";
|
|
9
|
+
import { RadioGroupOrientation as N } from "../../../../types/radio-group.js";
|
|
10
|
+
import { useSchemaContext as F } from "../context.js";
|
|
11
|
+
const R = (e) => typeof e == "string" ? e : e[0], g = (e) => e != null ? String(e) : "", B = (e) => e !== void 0 ? Number(e) : void 0, K = ({
|
|
12
|
+
schema: e,
|
|
13
|
+
value: t,
|
|
14
|
+
onChange: i,
|
|
15
|
+
invalid: c,
|
|
16
|
+
id: o,
|
|
17
|
+
ariaLabel: n
|
|
18
|
+
}) => {
|
|
19
|
+
const {
|
|
20
|
+
texts: a,
|
|
21
|
+
readonly: s = !1,
|
|
22
|
+
inputClassName: u,
|
|
23
|
+
acceptableResourceTypes: C
|
|
24
|
+
} = F(), P = e.const !== void 0, d = Array.isArray(e.enum) ? e.enum : [], S = d.length > 0;
|
|
25
|
+
if (e["dial:resource"] === !0 && Array.isArray(e.acceptableResourceTypes) && e.acceptableResourceTypes.length > 0 && (e.type === p.String || e.type === void 0)) {
|
|
26
|
+
const r = (e.acceptableResourceTypes ?? []).flatMap(
|
|
27
|
+
(m) => {
|
|
28
|
+
const y = C?.[m];
|
|
29
|
+
return Array.isArray(y) ? y.map((h) => {
|
|
30
|
+
const f = String(h);
|
|
31
|
+
return { value: f, label: f };
|
|
32
|
+
}) : [];
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
return /* @__PURE__ */ l(
|
|
36
|
+
I,
|
|
37
|
+
{
|
|
38
|
+
id: o,
|
|
39
|
+
ariaLabel: n,
|
|
40
|
+
options: r,
|
|
41
|
+
value: t != null ? String(t) : void 0,
|
|
42
|
+
invalid: c,
|
|
43
|
+
disabled: s,
|
|
44
|
+
onChange: (m) => i(R(m)),
|
|
45
|
+
placeholder: a.enumSelectPlaceholder,
|
|
46
|
+
className: u
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
if (P)
|
|
51
|
+
return /* @__PURE__ */ l(
|
|
52
|
+
b,
|
|
53
|
+
{
|
|
54
|
+
id: o,
|
|
55
|
+
"aria-label": n,
|
|
56
|
+
value: String(e.const ?? ""),
|
|
57
|
+
disabled: !0,
|
|
58
|
+
containerClassName: u
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
if (S && e.enumDisplay === v.Radio)
|
|
62
|
+
return /* @__PURE__ */ l(
|
|
63
|
+
O,
|
|
64
|
+
{
|
|
65
|
+
id: o,
|
|
66
|
+
ariaLabel: n,
|
|
67
|
+
items: d.map((r) => ({ value: String(r), label: String(r) })),
|
|
68
|
+
value: t != null ? String(t) : void 0,
|
|
69
|
+
orientation: e.enumOrientation === V.Row ? N.Row : N.Column,
|
|
70
|
+
disabled: s,
|
|
71
|
+
onChange: (r) => i(r)
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
if (S)
|
|
75
|
+
return /* @__PURE__ */ l(
|
|
76
|
+
I,
|
|
77
|
+
{
|
|
78
|
+
id: o,
|
|
79
|
+
ariaLabel: n,
|
|
80
|
+
options: d.map((r) => ({
|
|
81
|
+
value: String(r),
|
|
82
|
+
label: String(r)
|
|
83
|
+
})),
|
|
84
|
+
value: t != null ? String(t) : void 0,
|
|
85
|
+
invalid: c,
|
|
86
|
+
disabled: s,
|
|
87
|
+
onChange: (r) => i(R(r)),
|
|
88
|
+
placeholder: a.enumSelectPlaceholder,
|
|
89
|
+
className: u
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
switch (e.type) {
|
|
93
|
+
case p.Boolean:
|
|
94
|
+
return /* @__PURE__ */ l(
|
|
95
|
+
T,
|
|
96
|
+
{
|
|
97
|
+
id: o,
|
|
98
|
+
"aria-label": n,
|
|
99
|
+
isOn: !!t,
|
|
100
|
+
disabled: s,
|
|
101
|
+
onChange: (r) => i(r)
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
case p.Integer:
|
|
105
|
+
case p.Number:
|
|
106
|
+
return /* @__PURE__ */ l(
|
|
107
|
+
A,
|
|
108
|
+
{
|
|
109
|
+
id: o,
|
|
110
|
+
"aria-label": n,
|
|
111
|
+
integer: e.type === p.Integer,
|
|
112
|
+
value: g(t),
|
|
113
|
+
invalid: c,
|
|
114
|
+
disabled: s,
|
|
115
|
+
onChange: (r) => i(B(r)),
|
|
116
|
+
placeholder: e.type === p.Integer ? a.integerInputPlaceholder : a.numberInputPlaceholder,
|
|
117
|
+
containerClassName: u
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
default:
|
|
121
|
+
return e.isProtected ? /* @__PURE__ */ l(
|
|
122
|
+
w,
|
|
123
|
+
{
|
|
124
|
+
id: o,
|
|
125
|
+
"aria-label": n,
|
|
126
|
+
value: g(t),
|
|
127
|
+
invalid: c,
|
|
128
|
+
disabled: s,
|
|
129
|
+
onChange: (r) => i(r ?? void 0),
|
|
130
|
+
placeholder: a.stringInputPlaceholder,
|
|
131
|
+
containerClassName: u
|
|
132
|
+
}
|
|
133
|
+
) : /* @__PURE__ */ l(
|
|
134
|
+
b,
|
|
135
|
+
{
|
|
136
|
+
id: o,
|
|
137
|
+
"aria-label": n,
|
|
138
|
+
value: g(t),
|
|
139
|
+
invalid: c,
|
|
140
|
+
disabled: s,
|
|
141
|
+
onChange: (r) => i(r ?? void 0),
|
|
142
|
+
placeholder: a.stringInputPlaceholder,
|
|
143
|
+
containerClassName: u
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
export {
|
|
149
|
+
K as SchemaPrimitiveField
|
|
150
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as N, useId as k } from "react";
|
|
3
|
+
import { IconChevronDown as b, IconAlertTriangle as y, IconCheck as g, IconTrash as v } from "@tabler/icons-react";
|
|
4
|
+
import { DIAL_KIT_ICON_STROKE as a } from "../../constants/icon.js";
|
|
5
|
+
import { DangerIconButton as _ } from "../../IconButton/IconButtonWrappers.js";
|
|
6
|
+
import { InfoButton as w } from "../../InfoButton/InfoButton.js";
|
|
7
|
+
import { DIAL_ICON_SIZE as o } from "../../../../constants/icon.js";
|
|
8
|
+
import { DIAL_KIT_CLASS as z } from "../../../../constants/public-class-names.js";
|
|
9
|
+
import { ElementSize as C } from "../../../../types/size.js";
|
|
10
|
+
import { mergeClasses as t } from "../../../../utils/merge-classes.js";
|
|
11
|
+
const R = ({
|
|
12
|
+
title: m,
|
|
13
|
+
description: p,
|
|
14
|
+
summary: l,
|
|
15
|
+
errorCount: n = 0,
|
|
16
|
+
level: x = 0,
|
|
17
|
+
children: f,
|
|
18
|
+
onRemove: c,
|
|
19
|
+
defaultExpanded: h = !0,
|
|
20
|
+
removeItemAriaLabel: u = "Remove item"
|
|
21
|
+
}) => {
|
|
22
|
+
const [r, I] = N(h), d = k(), s = x === 0;
|
|
23
|
+
return /* @__PURE__ */ i(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: t(
|
|
27
|
+
"flex flex-col border border-tertiary",
|
|
28
|
+
s ? "rounded-xl bg-layer-raised" : "rounded-lg",
|
|
29
|
+
z.schemaRendererSection
|
|
30
|
+
),
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ i(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: t(
|
|
36
|
+
"flex items-center gap-2",
|
|
37
|
+
s ? "px-4 py-3" : "px-3 py-2"
|
|
38
|
+
),
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ i(
|
|
41
|
+
"button",
|
|
42
|
+
{
|
|
43
|
+
type: "button",
|
|
44
|
+
"aria-expanded": r,
|
|
45
|
+
"aria-controls": r ? d : void 0,
|
|
46
|
+
onClick: () => I((S) => !S),
|
|
47
|
+
className: "flex min-w-0 flex-1 items-center gap-2 rounded text-left text-primary focus-visible:outline focus-visible:outline-focus",
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ e(
|
|
50
|
+
b,
|
|
51
|
+
{
|
|
52
|
+
size: o.SM,
|
|
53
|
+
stroke: a,
|
|
54
|
+
"aria-hidden": "true",
|
|
55
|
+
className: t(
|
|
56
|
+
"shrink-0 text-secondary transition-transform",
|
|
57
|
+
!r && "-rotate-90"
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ e(
|
|
62
|
+
"span",
|
|
63
|
+
{
|
|
64
|
+
className: t(
|
|
65
|
+
"truncate",
|
|
66
|
+
s ? "dial-small-semi-text" : "dial-small-text"
|
|
67
|
+
),
|
|
68
|
+
children: m
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
/* @__PURE__ */ e(w, { caption: p }),
|
|
75
|
+
l && /* @__PURE__ */ e("span", { className: "dial-tiny-text whitespace-nowrap text-secondary", children: l }),
|
|
76
|
+
n > 0 ? /* @__PURE__ */ i("span", { className: "flex items-center gap-1 whitespace-nowrap dial-tiny-text text-error", children: [
|
|
77
|
+
/* @__PURE__ */ e(
|
|
78
|
+
y,
|
|
79
|
+
{
|
|
80
|
+
size: o.SM,
|
|
81
|
+
stroke: a,
|
|
82
|
+
"aria-hidden": "true",
|
|
83
|
+
className: "shrink-0"
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
n,
|
|
87
|
+
" error",
|
|
88
|
+
n > 1 ? "s" : ""
|
|
89
|
+
] }) : /* @__PURE__ */ e(
|
|
90
|
+
g,
|
|
91
|
+
{
|
|
92
|
+
size: o.SM,
|
|
93
|
+
stroke: a,
|
|
94
|
+
"aria-hidden": "true",
|
|
95
|
+
className: "shrink-0 text-success"
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
c && /* @__PURE__ */ e(
|
|
99
|
+
_,
|
|
100
|
+
{
|
|
101
|
+
size: C.Small,
|
|
102
|
+
icon: /* @__PURE__ */ e(
|
|
103
|
+
v,
|
|
104
|
+
{
|
|
105
|
+
size: o.SM,
|
|
106
|
+
stroke: a,
|
|
107
|
+
"aria-hidden": "true"
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
"aria-label": u,
|
|
111
|
+
onClick: c,
|
|
112
|
+
className: "shrink-0"
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
r && /* @__PURE__ */ e(
|
|
119
|
+
"div",
|
|
120
|
+
{
|
|
121
|
+
id: d,
|
|
122
|
+
className: t(
|
|
123
|
+
"border-t border-tertiary",
|
|
124
|
+
s ? "p-4" : "p-3"
|
|
125
|
+
),
|
|
126
|
+
children: f
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
};
|
|
133
|
+
export {
|
|
134
|
+
R as SchemaSection
|
|
135
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createContext as c, useContext as u } from "react";
|
|
2
|
+
const a = c(null), f = () => {
|
|
3
|
+
const e = u(a);
|
|
4
|
+
if (!e)
|
|
5
|
+
throw new Error("useSchemaContext must be used inside SchemaRenderer");
|
|
6
|
+
return e;
|
|
7
|
+
}, m = (e, t = /* @__PURE__ */ new Set(), r = !1, n = !1) => {
|
|
8
|
+
if (!r || t.has(e)) return !0;
|
|
9
|
+
if (!n) return !1;
|
|
10
|
+
const s = e + ".";
|
|
11
|
+
return [...t].some((o) => o.startsWith(s));
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
a as SchemaRendererContext,
|
|
15
|
+
m as isPathTouched,
|
|
16
|
+
f as useSchemaContext
|
|
17
|
+
};
|
|
@@ -53,9 +53,9 @@ const M = ({
|
|
|
53
53
|
"aria-disabled": o || void 0,
|
|
54
54
|
onKeyDown: N,
|
|
55
55
|
className: u(
|
|
56
|
-
f.segmentedControl,
|
|
57
56
|
_,
|
|
58
|
-
g
|
|
57
|
+
g,
|
|
58
|
+
f.segmentedControl
|
|
59
59
|
),
|
|
60
60
|
children: l.map((e) => {
|
|
61
61
|
const a = e.value === r, s = o || e.disabled;
|
|
@@ -76,11 +76,11 @@ const M = ({
|
|
|
76
76
|
disabled: s,
|
|
77
77
|
onClick: () => c(e.value),
|
|
78
78
|
className: u(
|
|
79
|
-
f.segmentedControlItem,
|
|
80
79
|
R,
|
|
81
80
|
a ? U : L,
|
|
82
81
|
s ? a ? D : h : a ? y : K,
|
|
83
|
-
p
|
|
82
|
+
p,
|
|
83
|
+
f.segmentedControlItem
|
|
84
84
|
),
|
|
85
85
|
children: [
|
|
86
86
|
e.icon,
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { jsxs as u, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as h, useState as P, useCallback as T, useLayoutEffect as d } from "react";
|
|
3
|
+
import { getVisibleTagCount as y } from "../TagInput/utils.js";
|
|
4
|
+
import { InteractiveTooltip as W } from "../InteractiveTooltip/InteractiveTooltip.js";
|
|
5
|
+
import { Tag as g } from "../Tag/Tag.js";
|
|
6
|
+
import { TooltipPlacement as S } from "../../../types/tooltip.js";
|
|
7
|
+
import { observeElementSize as $ } from "../../../utils/element-size-observer.js";
|
|
8
|
+
import { mergeClasses as b } from "../../../utils/merge-classes.js";
|
|
9
|
+
import { MultiSelectTags as c, selectTagClassName as w } from "./MultiSelectTags.js";
|
|
10
|
+
const j = 8, A = (e) => e.stopPropagation(), E = (e) => {
|
|
11
|
+
e.key !== "Escape" && e.stopPropagation();
|
|
12
|
+
}, V = ({
|
|
13
|
+
options: e,
|
|
14
|
+
selectedValues: r,
|
|
15
|
+
handleRemoveTag: a
|
|
16
|
+
}) => {
|
|
17
|
+
const n = h(null), m = h(null), [v, C] = P(null), l = T(() => {
|
|
18
|
+
const t = n.current, s = m.current;
|
|
19
|
+
if (!t || !s) return;
|
|
20
|
+
const f = Array.from(
|
|
21
|
+
s.children,
|
|
22
|
+
(k) => k.offsetWidth
|
|
23
|
+
), N = f.pop() ?? 0;
|
|
24
|
+
C(
|
|
25
|
+
y({
|
|
26
|
+
tagWidths: f,
|
|
27
|
+
overflowChipWidth: N,
|
|
28
|
+
availableWidth: t.clientWidth,
|
|
29
|
+
gap: j
|
|
30
|
+
})
|
|
31
|
+
);
|
|
32
|
+
}, []);
|
|
33
|
+
d(() => {
|
|
34
|
+
l();
|
|
35
|
+
}, [l, e, r]), d(() => {
|
|
36
|
+
const t = n.current;
|
|
37
|
+
return t ? $(t, l) : void 0;
|
|
38
|
+
}, [l]);
|
|
39
|
+
const p = v ?? r.length, x = r.slice(0, p), i = r.slice(p);
|
|
40
|
+
return /* @__PURE__ */ u(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
ref: n,
|
|
44
|
+
className: "relative flex min-w-0 flex-1 items-center gap-2 overflow-hidden",
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ o(
|
|
47
|
+
c,
|
|
48
|
+
{
|
|
49
|
+
options: e,
|
|
50
|
+
selectedValues: x,
|
|
51
|
+
handleRemoveTag: a,
|
|
52
|
+
tagClassName: "min-w-0"
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
i.length > 0 && /* @__PURE__ */ o(
|
|
56
|
+
W,
|
|
57
|
+
{
|
|
58
|
+
asChild: !0,
|
|
59
|
+
placement: S.Bottom,
|
|
60
|
+
content: (
|
|
61
|
+
// The panel is portalled but still a React child of the field, so
|
|
62
|
+
// its clicks and keys would otherwise reach the dropdown trigger.
|
|
63
|
+
/* @__PURE__ */ o(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
className: "flex flex-wrap gap-2",
|
|
67
|
+
onClick: A,
|
|
68
|
+
onKeyDown: E,
|
|
69
|
+
children: /* @__PURE__ */ o(
|
|
70
|
+
c,
|
|
71
|
+
{
|
|
72
|
+
options: e,
|
|
73
|
+
selectedValues: i,
|
|
74
|
+
handleRemoveTag: a
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
),
|
|
80
|
+
children: /* @__PURE__ */ o(
|
|
81
|
+
g,
|
|
82
|
+
{
|
|
83
|
+
label: `+${i.length}`,
|
|
84
|
+
role: "button",
|
|
85
|
+
tabIndex: 0,
|
|
86
|
+
"aria-haspopup": "true",
|
|
87
|
+
"aria-label": `${i.length} more selected: ${i.map((t) => e.find((s) => s.value === t)?.label ?? t).join(", ")}`,
|
|
88
|
+
title: "",
|
|
89
|
+
className: b(w, "shrink-0")
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ u(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
ref: m,
|
|
98
|
+
"aria-hidden": "true",
|
|
99
|
+
inert: !0,
|
|
100
|
+
className: "pointer-events-none invisible absolute left-0 top-0 flex h-0 w-max gap-2 overflow-hidden",
|
|
101
|
+
children: [
|
|
102
|
+
/* @__PURE__ */ o(
|
|
103
|
+
c,
|
|
104
|
+
{
|
|
105
|
+
options: e,
|
|
106
|
+
selectedValues: r,
|
|
107
|
+
handleRemoveTag: a,
|
|
108
|
+
tagClassName: "shrink-0"
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
/* @__PURE__ */ o(
|
|
112
|
+
g,
|
|
113
|
+
{
|
|
114
|
+
label: `+${r.length}`,
|
|
115
|
+
className: b(w, "shrink-0")
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
};
|
|
125
|
+
export {
|
|
126
|
+
V as CollapsedSelectTags
|
|
127
|
+
};
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { jsx as s, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import { mergeClasses as c } from "../../../utils/merge-classes.js";
|
|
3
|
+
import { Tag as i } from "../Tag/Tag.js";
|
|
4
|
+
const p = "h-[24px] max-w-full rounded-md border border-secondary bg-layer-sunken px-2", f = ({
|
|
4
5
|
options: a,
|
|
5
6
|
selectedValues: n,
|
|
6
|
-
handleRemoveTag:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
handleRemoveTag: o,
|
|
8
|
+
tagClassName: t
|
|
9
|
+
}) => /* @__PURE__ */ s(m, { children: n.map((e) => {
|
|
10
|
+
const l = a.find((r) => r.value === e);
|
|
11
|
+
return /* @__PURE__ */ s(
|
|
12
|
+
i,
|
|
11
13
|
{
|
|
12
|
-
label:
|
|
13
|
-
closable: !!
|
|
14
|
-
onRemove: (
|
|
15
|
-
icon:
|
|
16
|
-
className:
|
|
14
|
+
label: l?.label ?? e,
|
|
15
|
+
closable: !!o,
|
|
16
|
+
onRemove: (r) => o?.(r, e),
|
|
17
|
+
icon: l?.icon,
|
|
18
|
+
className: c(p, t)
|
|
17
19
|
},
|
|
18
|
-
|
|
20
|
+
e
|
|
19
21
|
);
|
|
20
22
|
}) });
|
|
21
23
|
export {
|
|
22
|
-
|
|
24
|
+
f as MultiSelectTags,
|
|
25
|
+
p as selectTagClassName
|
|
23
26
|
};
|