@epam/ai-dial-ui-kit 0.15.0-dev.5 → 0.15.0-dev.50
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 +194 -1
- package/dist/CHANGELOG.md +86 -0
- package/dist/{DateCellRenderer-BVM-Q8yx.cjs → DateCellRenderer-CZNa4jVJ.cjs} +31 -31
- package/dist/DateCellRenderer-X6vXPDIG.cjs +1 -0
- 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 +70 -65
- package/dist/components/Dropdown/DropdownSubMenuItem.js +63 -55
- package/dist/components/Dropdown/constants.js +16 -14
- package/dist/components/DropdownIcon/DropdownIcon.js +43 -32
- 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 +87 -71
- package/dist/components/New/AutocompleteTagInput/AutocompleteTagInput.js +207 -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 +26 -16
- package/dist/components/New/Calendar/Calendar.js +253 -222
- package/dist/components/New/Calendar/constants.js +5 -5
- package/dist/components/New/CaptionText/CaptionText.js +18 -15
- package/dist/components/New/CardShell/CardShell.js +5 -3
- package/dist/components/New/Checkbox/Checkbox.js +67 -56
- package/dist/components/New/Checkbox/CheckboxBox.js +5 -3
- package/dist/components/New/CloseButton/CloseButton.js +18 -16
- package/dist/components/New/CollapsibleSidebar/CollapsibleSidebar.js +39 -34
- package/dist/components/New/ConfirmationPopup/ConfirmationPopup.js +38 -37
- package/dist/components/New/ConfirmationPopup/constants.js +8 -11
- package/dist/components/New/Dropdown/Dropdown.js +112 -105
- 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 +20 -18
- package/dist/components/New/EntityIdentity/EntityIdentity.js +135 -0
- package/dist/components/New/FileDropzone/FileDropzone.js +27 -25
- 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 +29 -28
- package/dist/components/New/Highlight/Highlight.js +23 -30
- package/dist/components/New/IconButton/IconButton.js +30 -28
- package/dist/components/New/InfoButton/InfoButton.js +13 -11
- package/dist/components/New/InlineSelect/InlineSelect.js +74 -56
- package/dist/components/New/InteractiveTooltip/InteractiveTooltip.js +41 -39
- package/dist/components/New/InteractiveTooltip/constants.js +2 -2
- package/dist/components/New/Label/Label.js +13 -8
- package/dist/components/New/MarkdownEditor/MarkdownEditor.js +29 -27
- package/dist/components/New/MenuItem/MenuItem.js +29 -27
- package/dist/components/New/MenuItem/constants.js +9 -8
- package/dist/components/New/NoDataContent/NoDataContent.js +21 -19
- package/dist/components/New/Notification/Notification.js +33 -29
- package/dist/components/New/NumberInput/NumberInput.js +42 -33
- package/dist/components/New/PasswordInput/PasswordInput.js +41 -35
- package/dist/components/New/Popup/Popup.js +46 -44
- package/dist/components/New/Popup/constants.js +3 -3
- package/dist/components/New/Radio/Radio.js +75 -64
- package/dist/components/New/RadioGroup/RadioGroup.js +76 -65
- package/dist/components/New/RadioGroupPopupField/RadioGroupPopupField.js +117 -106
- package/dist/components/New/ResizableContainer/ResizableContainer.js +42 -40
- 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 +29 -27
- package/dist/components/New/SegmentedControl/SegmentedControl.js +29 -23
- 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 +219 -197
- 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 +151 -90
- package/dist/components/New/Slider/utils.js +12 -0
- package/dist/components/New/Switch/Switch.js +69 -58
- package/dist/components/New/Tabs/Tabs.js +125 -61
- package/dist/components/New/Tag/Tag.js +42 -40
- package/dist/components/New/TagInput/TagInput.js +48 -44
- package/dist/components/New/Textarea/Textarea.js +21 -20
- package/dist/components/New/ToggleIconButton/ToggleIconButton.js +26 -24
- package/dist/components/New/Tooltip/TooltipContent.js +11 -9
- 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 +45 -33
- 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 +25 -19
- package/dist/components/Spinner/Spinner.js +7 -5
- package/dist/components/Tooltip/TooltipContent.js +11 -11
- package/dist/components-manifest.json +1837 -84
- package/dist/constants/public-class-names.js +218 -0
- package/dist/constants/schema-renderer.js +33 -0
- package/dist/dial-ui-kit.cjs +2 -2
- package/dist/dial-ui-kit.js +356 -307
- 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 +97 -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/InlineSelect/InlineSelect.d.ts +16 -1
- 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/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 +20 -1
- package/dist/src/components/New/Slider/utils.d.ts +6 -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 +209 -0
- package/dist/src/constants/schema-renderer.d.ts +2 -0
- package/dist/src/index.d.ts +39 -2
- 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/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/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-ssp7eaZY.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-DjdR_mYM.cjs +0 -3
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { jsx as i, jsxs as f } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as b, useState as q, useCallback as J, useEffect as Q } from "react";
|
|
3
3
|
import { mergeClasses as U } from "../../utils/merge-classes.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { extractDefaults as $, sortByPropertyOrder as y, resolveRef as R, toFieldLabel as F, validateRequired as k, isMissingRequiredValue as ee } from "./utils.js";
|
|
4
|
+
import { SchemaRendererContext as Y } from "./context.js";
|
|
5
|
+
import { extractDefaults as Z, sortByPropertyOrder as $, resolveRef as R, toFieldLabel as F, validateRequired as y, isMissingRequiredValue as k } from "../../utils/json-schema.js";
|
|
7
6
|
import { SchemaSection as L } from "./components/SchemaSection.js";
|
|
8
7
|
import { SchemaFieldContent as T } from "./components/SchemaFieldContent.js";
|
|
9
|
-
import { SchemaField as
|
|
10
|
-
import { SchemaAdditionalPropertiesEditor as
|
|
11
|
-
|
|
8
|
+
import { SchemaField as ee } from "./components/SchemaField.js";
|
|
9
|
+
import { SchemaAdditionalPropertiesEditor as te } from "./components/SchemaAdditionalPropertiesEditor.js";
|
|
10
|
+
import { DEFAULT_SCHEMA_TEXTS as re } from "../../constants/schema-renderer.js";
|
|
11
|
+
import { SchemaRendererVariant as m } from "../../types/json-schema.js";
|
|
12
|
+
const pe = ({
|
|
12
13
|
schema: r,
|
|
13
14
|
defaultValue: v,
|
|
14
15
|
texts: x,
|
|
@@ -26,9 +27,9 @@ const he = ({
|
|
|
26
27
|
acceptableResourceTypes: w
|
|
27
28
|
}) => {
|
|
28
29
|
const E = b(
|
|
29
|
-
() => ({ ...
|
|
30
|
+
() => ({ ...re, ...x }),
|
|
30
31
|
[x]
|
|
31
|
-
), C = b(() => v || (
|
|
32
|
+
), C = b(() => v || (Z(r, r) ?? {}), []), [a, H] = q(C), [p, K] = q(
|
|
32
33
|
/* @__PURE__ */ new Set()
|
|
33
34
|
), _ = J((e) => {
|
|
34
35
|
K((t) => t.has(e) ? t : /* @__PURE__ */ new Set([...t, e]));
|
|
@@ -41,13 +42,13 @@ const he = ({
|
|
|
41
42
|
H(o), O?.(o), A?.(e, t);
|
|
42
43
|
}, B = new Set(Object.keys(r.properties ?? {})), W = Object.keys(a).filter(
|
|
43
44
|
(e) => !B.has(e)
|
|
44
|
-
), X =
|
|
45
|
+
), X = $(
|
|
45
46
|
Object.entries(r.properties ?? {}).filter(
|
|
46
47
|
([, e]) => !R(e, r).isHidden
|
|
47
48
|
)
|
|
48
49
|
), z = r.required ?? [];
|
|
49
50
|
return /* @__PURE__ */ i(
|
|
50
|
-
|
|
51
|
+
Y.Provider,
|
|
51
52
|
{
|
|
52
53
|
value: {
|
|
53
54
|
rootSchema: r,
|
|
@@ -67,7 +68,7 @@ const he = ({
|
|
|
67
68
|
const o = R(t, r), s = o.title ?? t.title ?? F(e), d = z.includes(e), n = a[e];
|
|
68
69
|
if (h === m.Flat)
|
|
69
70
|
return /* @__PURE__ */ i(
|
|
70
|
-
|
|
71
|
+
ee,
|
|
71
72
|
{
|
|
72
73
|
schema: t,
|
|
73
74
|
value: n,
|
|
@@ -94,7 +95,7 @@ const he = ({
|
|
|
94
95
|
}
|
|
95
96
|
)
|
|
96
97
|
] }, e);
|
|
97
|
-
const P =
|
|
98
|
+
const P = y(n, o, r, e), G = e + ".", I = !S || p.has(e) || [...p].some((l) => l.startsWith(G));
|
|
98
99
|
return /* @__PURE__ */ i(
|
|
99
100
|
L,
|
|
100
101
|
{
|
|
@@ -102,7 +103,7 @@ const he = ({
|
|
|
102
103
|
description: o.description,
|
|
103
104
|
level: 0,
|
|
104
105
|
defaultExpanded: u,
|
|
105
|
-
errorCount: I ? d &&
|
|
106
|
+
errorCount: I ? d && k(n) ? Math.max(P.length, 1) : P.length : 0,
|
|
106
107
|
children: /* @__PURE__ */ i(
|
|
107
108
|
T,
|
|
108
109
|
{
|
|
@@ -120,7 +121,7 @@ const he = ({
|
|
|
120
121
|
}),
|
|
121
122
|
W.map((e) => {
|
|
122
123
|
const t = F(e), o = /* @__PURE__ */ i(
|
|
123
|
-
|
|
124
|
+
te,
|
|
124
125
|
{
|
|
125
126
|
value: a[e],
|
|
126
127
|
onChange: (s) => c(e, s),
|
|
@@ -146,5 +147,5 @@ const he = ({
|
|
|
146
147
|
);
|
|
147
148
|
};
|
|
148
149
|
export {
|
|
149
|
-
|
|
150
|
+
pe as DialSchemaRenderer
|
|
150
151
|
};
|
|
@@ -1,41 +1,56 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { jsxs as u, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as s, useEffect as E } from "react";
|
|
3
|
+
import { DialErrorText as y } from "../../CaptionText/CaptionText.js";
|
|
4
|
+
import { useSchemaContext as S } from "../context.js";
|
|
5
|
+
import { EditorThemes as v } from "../../../types/editor.js";
|
|
6
|
+
const O = ({ value: a, onChange: d, theme: m = v.dark, height: l = 240 }) => {
|
|
7
|
+
const { readonly: c, texts: p } = S(), [r, h] = s(null), [o, f] = s(
|
|
8
|
+
() => JSON.stringify(a, null, 2)
|
|
8
9
|
);
|
|
9
|
-
|
|
10
|
-
typeof window < "u" && import("../../JsonEditor/JsonEditor.js").then((
|
|
11
|
-
|
|
10
|
+
E(() => {
|
|
11
|
+
typeof window < "u" && import("../../JsonEditor/JsonEditor.js").then((t) => {
|
|
12
|
+
h(() => t.DialJsonEditor);
|
|
12
13
|
});
|
|
13
14
|
}, []);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
let n = !1;
|
|
16
|
+
try {
|
|
17
|
+
JSON.parse(o);
|
|
18
|
+
} catch {
|
|
19
|
+
n = !0;
|
|
20
|
+
}
|
|
21
|
+
const x = (t) => {
|
|
22
|
+
const i = t ?? "";
|
|
23
|
+
f(i);
|
|
17
24
|
try {
|
|
18
|
-
|
|
25
|
+
d(JSON.parse(i));
|
|
19
26
|
} catch {
|
|
20
27
|
}
|
|
21
28
|
};
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
return /* @__PURE__ */ u("div", { children: [
|
|
30
|
+
/* @__PURE__ */ e(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
className: "border border-primary rounded",
|
|
34
|
+
style: { height: `${l}px` },
|
|
35
|
+
children: r && /* @__PURE__ */ e(
|
|
36
|
+
r,
|
|
37
|
+
{
|
|
38
|
+
value: o,
|
|
39
|
+
currentTheme: m,
|
|
40
|
+
onChange: x,
|
|
41
|
+
options: { readOnly: c }
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
/* @__PURE__ */ e(
|
|
47
|
+
y,
|
|
48
|
+
{
|
|
49
|
+
text: n ? p.invalidJsonError : void 0
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
] });
|
|
38
53
|
};
|
|
39
54
|
export {
|
|
40
|
-
|
|
55
|
+
O as SchemaAdditionalPropertiesEditor
|
|
41
56
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as v, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { DialSelect as x } from "../../Select/Select.js";
|
|
3
|
-
import { JsonSchemaType as a } from "../types.js";
|
|
4
3
|
import { useSchemaContext as N } from "../context.js";
|
|
5
|
-
import { getOptionLabel as k, detectAnyOfVariant as O, resolveRef as d, extractDefaults as w } from "
|
|
4
|
+
import { getOptionLabel as k, detectAnyOfVariant as O, resolveRef as d, extractDefaults as w } from "../../../utils/json-schema.js";
|
|
6
5
|
import { SchemaFieldContent as A } from "./SchemaFieldContent.js";
|
|
6
|
+
import { JsonSchemaType as a } from "../../../types/json-schema.js";
|
|
7
7
|
const J = ({
|
|
8
8
|
schema: f,
|
|
9
9
|
value: n,
|
|
@@ -4,7 +4,7 @@ import { IconPlus as w } from "@tabler/icons-react";
|
|
|
4
4
|
import { DialSelect as B } from "../../Select/Select.js";
|
|
5
5
|
import { DialGhostButton as E } from "../../Button/ButtonWrappers.js";
|
|
6
6
|
import { useSchemaContext as L } from "../context.js";
|
|
7
|
-
import { resolveRef as g, getItemTitle as O, buildSummary as P, validateRequired as q, extractDefaults as A, getSchemaDefault as z } from "
|
|
7
|
+
import { resolveRef as g, getItemTitle as O, buildSummary as P, validateRequired as q, extractDefaults as A, getSchemaDefault as z } from "../../../utils/json-schema.js";
|
|
8
8
|
import { SchemaSection as F } from "./SchemaSection.js";
|
|
9
9
|
import { SchemaFieldContent as G } from "./SchemaFieldContent.js";
|
|
10
10
|
const W = ({
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { DialFormItem as g } from "../../FormItem/FormItem.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { SchemaSection as w } from "./SchemaSection.js";
|
|
3
|
+
import { useSchemaContext as A } from "../context.js";
|
|
4
|
+
import { resolveRef as C, isObjectType as E, buildSummary as I, validateRequired as M, isMissingRequiredValue as O, toRequiredMessage as b } from "../../../utils/json-schema.js";
|
|
5
|
+
import { SchemaSection as k } from "./SchemaSection.js";
|
|
7
6
|
import { SchemaFieldContent as u } from "./SchemaFieldContent.js";
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
import { JsonSchemaType as w } from "../../../types/json-schema.js";
|
|
8
|
+
const B = ({
|
|
9
|
+
schema: a,
|
|
10
10
|
value: t,
|
|
11
11
|
onChange: d,
|
|
12
12
|
path: e,
|
|
13
|
-
level:
|
|
13
|
+
level: i = 0,
|
|
14
14
|
required: r,
|
|
15
15
|
label: n
|
|
16
16
|
}) => {
|
|
17
17
|
const {
|
|
18
18
|
rootSchema: c,
|
|
19
|
-
defaultExpanded:
|
|
19
|
+
defaultExpanded: f = !0,
|
|
20
20
|
touchedPaths: m = /* @__PURE__ */ new Set(),
|
|
21
21
|
skipUntouched: h = !1
|
|
22
|
-
} =
|
|
23
|
-
if (
|
|
24
|
-
const j =
|
|
22
|
+
} = A(), o = C(a, c), S = E(o), l = o.type === w.Array;
|
|
23
|
+
if (S || l) {
|
|
24
|
+
const j = I(t, o, c), x = M(
|
|
25
25
|
t,
|
|
26
26
|
o,
|
|
27
27
|
c,
|
|
28
28
|
e.join(".")
|
|
29
29
|
), p = e.join("."), T = p + ".", F = !h || m.has(p) || [...m].some((R) => R.startsWith(T));
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
|
|
30
|
+
return /* @__PURE__ */ s(
|
|
31
|
+
k,
|
|
32
32
|
{
|
|
33
33
|
title: n ?? o.title ?? e[e.length - 1] ?? "Section",
|
|
34
34
|
description: o.description,
|
|
35
|
-
level:
|
|
35
|
+
level: i,
|
|
36
36
|
summary: j,
|
|
37
37
|
errorCount: F ? x.length : 0,
|
|
38
|
-
defaultExpanded:
|
|
39
|
-
children: /* @__PURE__ */
|
|
38
|
+
defaultExpanded: f,
|
|
39
|
+
children: /* @__PURE__ */ s(
|
|
40
40
|
u,
|
|
41
41
|
{
|
|
42
42
|
schema: o,
|
|
43
43
|
value: t,
|
|
44
44
|
onChange: d,
|
|
45
45
|
path: e,
|
|
46
|
-
level:
|
|
46
|
+
level: i + 1,
|
|
47
47
|
required: r
|
|
48
48
|
}
|
|
49
49
|
)
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
|
-
const y = (!h || m.has(e.join("."))) && r &&
|
|
54
|
-
return /* @__PURE__ */
|
|
53
|
+
const y = (!h || m.has(e.join("."))) && r && O(t) ? b(n ?? "Field") : void 0;
|
|
54
|
+
return /* @__PURE__ */ s(
|
|
55
55
|
g,
|
|
56
56
|
{
|
|
57
57
|
label: n,
|
|
58
58
|
required: r,
|
|
59
59
|
description: o.description,
|
|
60
60
|
error: y,
|
|
61
|
-
children: /* @__PURE__ */
|
|
61
|
+
children: /* @__PURE__ */ s(
|
|
62
62
|
u,
|
|
63
63
|
{
|
|
64
64
|
schema: o,
|
|
65
65
|
value: t,
|
|
66
66
|
onChange: d,
|
|
67
67
|
path: e,
|
|
68
|
-
level:
|
|
68
|
+
level: i,
|
|
69
69
|
required: r,
|
|
70
70
|
suppressInlineError: !0
|
|
71
71
|
}
|
|
@@ -74,5 +74,5 @@ const q = ({
|
|
|
74
74
|
);
|
|
75
75
|
};
|
|
76
76
|
export {
|
|
77
|
-
|
|
77
|
+
B as SchemaField
|
|
78
78
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as t, jsxs as O, Fragment as P } from "react/jsx-runtime";
|
|
2
2
|
import { DialErrorText as x } from "../../CaptionText/CaptionText.js";
|
|
3
|
-
import { JsonSchemaType as c } from "../types.js";
|
|
4
3
|
import { useSchemaContext as F } from "../context.js";
|
|
5
|
-
import { resolveRef as T, isObjectType as u,
|
|
6
|
-
import { SchemaObjectEditor as
|
|
7
|
-
import { SchemaArrayEditor as
|
|
8
|
-
import { SchemaOneOfEditor as
|
|
9
|
-
import { SchemaAnyOfEditor as
|
|
10
|
-
import { SchemaKeyValueEditor as
|
|
11
|
-
import { SchemaPrimitiveField as
|
|
12
|
-
import { SchemaAdditionalPropertiesEditor as
|
|
13
|
-
|
|
4
|
+
import { resolveRef as T, isObjectType as u, toRequiredMessage as A, isMissingRequiredValue as b } from "../../../utils/json-schema.js";
|
|
5
|
+
import { SchemaObjectEditor as k } from "./SchemaObjectEditor.js";
|
|
6
|
+
import { SchemaArrayEditor as M } from "./SchemaArrayEditor.js";
|
|
7
|
+
import { SchemaOneOfEditor as R } from "./SchemaOneOfEditor.js";
|
|
8
|
+
import { SchemaAnyOfEditor as q } from "./SchemaAnyOfEditor.js";
|
|
9
|
+
import { SchemaKeyValueEditor as V } from "./SchemaKeyValueEditor.js";
|
|
10
|
+
import { SchemaPrimitiveField as w } from "./SchemaPrimitiveField.js";
|
|
11
|
+
import { SchemaAdditionalPropertiesEditor as D } from "./SchemaAdditionalPropertiesEditor.js";
|
|
12
|
+
import { JsonSchemaType as c } from "../../../types/json-schema.js";
|
|
13
|
+
const X = ({
|
|
14
14
|
schema: h,
|
|
15
15
|
value: i,
|
|
16
16
|
onChange: f,
|
|
@@ -33,7 +33,7 @@ const Q = ({
|
|
|
33
33
|
let o;
|
|
34
34
|
if (e.oneOf)
|
|
35
35
|
o = /* @__PURE__ */ t(
|
|
36
|
-
|
|
36
|
+
R,
|
|
37
37
|
{
|
|
38
38
|
schema: e,
|
|
39
39
|
value: i,
|
|
@@ -44,7 +44,7 @@ const Q = ({
|
|
|
44
44
|
);
|
|
45
45
|
else if (e.anyOf && e.type !== c.Object)
|
|
46
46
|
o = /* @__PURE__ */ t(
|
|
47
|
-
|
|
47
|
+
q,
|
|
48
48
|
{
|
|
49
49
|
schema: e,
|
|
50
50
|
value: i,
|
|
@@ -56,7 +56,7 @@ const Q = ({
|
|
|
56
56
|
else if (u(e)) {
|
|
57
57
|
const n = e.additionalProperties != null && e.additionalProperties !== !1, a = !e.properties || Object.keys(e.properties).length === 0;
|
|
58
58
|
n && a ? o = /* @__PURE__ */ t(
|
|
59
|
-
|
|
59
|
+
V,
|
|
60
60
|
{
|
|
61
61
|
schema: e,
|
|
62
62
|
value: i,
|
|
@@ -65,14 +65,14 @@ const Q = ({
|
|
|
65
65
|
level: m
|
|
66
66
|
}
|
|
67
67
|
) : a && e.additionalProperties !== !1 ? o = /* @__PURE__ */ t(
|
|
68
|
-
|
|
68
|
+
D,
|
|
69
69
|
{
|
|
70
70
|
value: i,
|
|
71
71
|
onChange: s,
|
|
72
72
|
theme: E
|
|
73
73
|
}
|
|
74
74
|
) : o = /* @__PURE__ */ t(
|
|
75
|
-
|
|
75
|
+
k,
|
|
76
76
|
{
|
|
77
77
|
schema: e,
|
|
78
78
|
value: i,
|
|
@@ -83,7 +83,7 @@ const Q = ({
|
|
|
83
83
|
);
|
|
84
84
|
} else if (e.type === c.Array)
|
|
85
85
|
o = /* @__PURE__ */ t(
|
|
86
|
-
|
|
86
|
+
M,
|
|
87
87
|
{
|
|
88
88
|
schema: e,
|
|
89
89
|
value: i,
|
|
@@ -93,10 +93,10 @@ const Q = ({
|
|
|
93
93
|
}
|
|
94
94
|
);
|
|
95
95
|
else {
|
|
96
|
-
const n = j && p &&
|
|
96
|
+
const n = j && p && b(i), a = !l && n ? A(e.title ?? "Field") : void 0;
|
|
97
97
|
o = /* @__PURE__ */ O(P, { children: [
|
|
98
98
|
/* @__PURE__ */ t(
|
|
99
|
-
|
|
99
|
+
w,
|
|
100
100
|
{
|
|
101
101
|
schema: e,
|
|
102
102
|
value: i,
|
|
@@ -110,5 +110,5 @@ const Q = ({
|
|
|
110
110
|
return d ? d(r, e, o) : o;
|
|
111
111
|
};
|
|
112
112
|
export {
|
|
113
|
-
|
|
113
|
+
X as SchemaFieldContent
|
|
114
114
|
};
|