@epam/ai-dial-ui-kit 0.15.0-dev.3 → 0.15.0-dev.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/README.md +185 -0
  2. package/dist/CHANGELOG.md +48 -0
  3. package/dist/{DateCellRenderer-BVM-Q8yx.cjs → DateCellRenderer-BFEh4rXZ.cjs} +26 -26
  4. package/dist/DateCellRenderer-J1V3xwF7.cjs +1 -0
  5. package/dist/IconButton-DHOFapLo.cjs +1 -0
  6. package/dist/{JsonEditor-qv1Z0dLX.cjs → JsonEditor-BDe6elKO.cjs} +1 -1
  7. package/dist/{MarkdownEditor-DHn2pYOJ.cjs → MarkdownEditor-C7BONfsl.cjs} +1 -1
  8. package/dist/{MarkdownEditor-jQ8nDJfx.cjs → MarkdownEditor-FVzYMdkC.cjs} +1 -1
  9. package/dist/{MarkdownEditorContainer-Bzcnoemw.cjs → MarkdownEditorContainer-GvlxX6kx.cjs} +1 -1
  10. package/dist/{Switch-CUKClcEz.cjs → Switch-DE6MrcqJ.cjs} +1 -1
  11. package/dist/components/Button/constants.js +9 -8
  12. package/dist/components/Dropdown/Dropdown.js +70 -65
  13. package/dist/components/Dropdown/DropdownSubMenuItem.js +63 -55
  14. package/dist/components/Dropdown/constants.js +16 -14
  15. package/dist/components/DropdownIcon/DropdownIcon.js +43 -32
  16. package/dist/components/FileManager/FileManager.js +373 -372
  17. package/dist/components/FileManager/FileManagerProvider.js +266 -264
  18. package/dist/components/FileManager/hooks/use-grid-context-menu.js +59 -59
  19. package/dist/components/New/Accordion/Accordion.js +87 -71
  20. package/dist/components/New/Breadcrumbs/Breadcrumbs.js +159 -0
  21. package/dist/components/New/Breadcrumbs/constants.js +41 -0
  22. package/dist/components/New/Button/Button.js +32 -32
  23. package/dist/components/New/Button/ButtonWrappers.js +93 -37
  24. package/dist/components/New/Button/constants.js +3 -0
  25. package/dist/components/New/Button/utils.js +18 -8
  26. package/dist/components/New/ButtonDropdown/ButtonDropdown.js +26 -16
  27. package/dist/components/New/Calendar/Calendar.js +337 -289
  28. package/dist/components/New/Calendar/constants.js +5 -5
  29. package/dist/components/New/CaptionText/CaptionText.js +18 -15
  30. package/dist/components/New/CardShell/CardShell.js +5 -3
  31. package/dist/components/New/Checkbox/Checkbox.js +67 -56
  32. package/dist/components/New/Checkbox/CheckboxBox.js +5 -3
  33. package/dist/components/New/CloseButton/CloseButton.js +18 -16
  34. package/dist/components/New/CollapsibleSidebar/CollapsibleSidebar.js +39 -34
  35. package/dist/components/New/ConfirmationPopup/ConfirmationPopup.js +44 -39
  36. package/dist/components/New/Dropdown/Dropdown.js +112 -105
  37. package/dist/components/New/Dropdown/DropdownSubMenuItem.js +17 -17
  38. package/dist/components/New/Dropdown/constants.js +22 -17
  39. package/dist/components/New/EllipsisTooltip/EllipsisTooltip.js +20 -18
  40. package/dist/components/New/FileDropzone/FileDropzone.js +27 -25
  41. package/dist/components/New/FileIcon/FileIcon.js +55 -0
  42. package/dist/components/New/FileIcon/constants.js +134 -0
  43. package/dist/components/New/FileIcon/icons/FileGlyph.js +150 -0
  44. package/dist/components/New/FileIcon/icons/FolderGlyph.js +50 -0
  45. package/dist/components/New/FileName/FileName.js +78 -0
  46. package/dist/components/New/FilterChips/FilterChips.js +43 -0
  47. package/dist/components/New/FilterChips/constants.js +5 -0
  48. package/dist/components/New/FolderName/FolderName.js +16 -0
  49. package/dist/components/New/FolderPath/FolderPath.js +29 -28
  50. package/dist/components/New/Highlight/Highlight.js +23 -30
  51. package/dist/components/New/IconButton/IconButton.js +30 -28
  52. package/dist/components/New/InfoButton/InfoButton.js +13 -11
  53. package/dist/components/New/InlineSelect/InlineSelect.js +74 -56
  54. package/dist/components/New/InteractiveTooltip/InteractiveTooltip.js +41 -39
  55. package/dist/components/New/InteractiveTooltip/constants.js +2 -2
  56. package/dist/components/New/Label/Label.js +13 -8
  57. package/dist/components/New/MenuItem/MenuItem.js +29 -27
  58. package/dist/components/New/MenuItem/constants.js +9 -8
  59. package/dist/components/New/NoDataContent/NoDataContent.js +21 -19
  60. package/dist/components/New/Notification/Notification.js +33 -29
  61. package/dist/components/New/NumberInput/NumberInput.js +42 -33
  62. package/dist/components/New/PasswordInput/PasswordInput.js +41 -35
  63. package/dist/components/New/Popup/Popup.js +46 -44
  64. package/dist/components/New/Popup/constants.js +3 -3
  65. package/dist/components/New/Radio/Radio.js +75 -64
  66. package/dist/components/New/RadioGroup/RadioGroup.js +76 -65
  67. package/dist/components/New/RadioGroupPopupField/RadioGroupPopupField.js +117 -106
  68. package/dist/components/New/ResizableContainer/ResizableContainer.js +42 -40
  69. package/dist/components/New/Search/Search.js +29 -27
  70. package/dist/components/New/SegmentedControl/SegmentedControl.js +29 -23
  71. package/dist/components/New/Select/Select.js +120 -109
  72. package/dist/components/New/Select/constants.js +23 -20
  73. package/dist/components/New/SharedEntityIndicator/SharedEntityIndicator.js +34 -0
  74. package/dist/components/New/Switch/Switch.js +69 -58
  75. package/dist/components/New/Tabs/Tabs.js +125 -61
  76. package/dist/components/New/Tag/Tag.js +42 -40
  77. package/dist/components/New/TagInput/TagInput.js +45 -43
  78. package/dist/components/New/ToggleIconButton/ToggleIconButton.js +26 -24
  79. package/dist/components/New/Tooltip/TooltipContent.js +11 -9
  80. package/dist/components/New/Tooltip/constants.js +1 -1
  81. package/dist/components/New/TransferQueue/TransferQueue.js +124 -0
  82. package/dist/components/New/TransferQueue/TransferQueueHeader.js +71 -0
  83. package/dist/components/New/TransferQueue/TransferQueueRow.js +119 -0
  84. package/dist/components/New/TransferQueue/constants.js +24 -0
  85. package/dist/components/New/constants/overlay.js +15 -9
  86. package/dist/components/Popup/constants.js +8 -8
  87. package/dist/components/ProgressBar/ProgressBar.js +45 -33
  88. package/dist/components/SchemaRenderer/components/SchemaAdditionalPropertiesEditor.js +46 -31
  89. package/dist/components/SchemaRenderer/components/SchemaField.js +19 -19
  90. package/dist/components/SchemaRenderer/components/SchemaFieldContent.js +18 -18
  91. package/dist/components/SchemaRenderer/components/SchemaKeyValueEditor.js +223 -135
  92. package/dist/components/SchemaRenderer/types.js +19 -8
  93. package/dist/components/SchemaRenderer/utils.js +122 -95
  94. package/dist/components/Skeleton/Skeleton.js +25 -19
  95. package/dist/components/Spinner/Spinner.js +7 -5
  96. package/dist/components/Tooltip/TooltipContent.js +11 -11
  97. package/dist/components-manifest.json +830 -31
  98. package/dist/constants/public-class-names.js +198 -0
  99. package/dist/dial-ui-kit.cjs +2 -2
  100. package/dist/dial-ui-kit.js +330 -302
  101. package/dist/editors.cjs +1 -1
  102. package/dist/file-manager.cjs +1 -1
  103. package/dist/grid.cjs +1 -1
  104. package/dist/index.css +2 -2
  105. package/dist/lazy-BEsZqouS.cjs +1 -0
  106. package/dist/merge-classes-BEJXjzkx.cjs +1 -0
  107. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +419 -399
  108. package/dist/src/components/FileManager/FileManager.d.ts +2 -0
  109. package/dist/src/components/FileManager/FileManagerContext.d.ts +1 -0
  110. package/dist/src/components/FileManager/hooks/use-grid-context-menu.d.ts +2 -1
  111. package/dist/src/components/New/Accordion/Accordion.d.ts +6 -1
  112. package/dist/src/components/New/Breadcrumbs/Breadcrumbs.d.ts +94 -0
  113. package/dist/src/components/New/Breadcrumbs/constants.d.ts +60 -0
  114. package/dist/src/components/New/Button/Button.d.ts +4 -1
  115. package/dist/src/components/New/Button/ButtonWrappers.d.ts +20 -0
  116. package/dist/src/components/New/Button/utils.d.ts +15 -0
  117. package/dist/src/components/New/ButtonDropdown/ButtonDropdown.d.ts +4 -0
  118. package/dist/src/components/New/Calendar/Calendar.d.ts +14 -1
  119. package/dist/src/components/New/Calendar/constants.d.ts +1 -1
  120. package/dist/src/components/New/Dropdown/Dropdown.d.ts +9 -1
  121. package/dist/src/components/New/Dropdown/constants.d.ts +3 -0
  122. package/dist/src/components/New/FileIcon/FileIcon.d.ts +61 -0
  123. package/dist/src/components/New/FileIcon/constants.d.ts +16 -0
  124. package/dist/src/components/New/FileIcon/icons/FileGlyph.d.ts +18 -0
  125. package/dist/src/components/New/FileIcon/icons/FolderGlyph.d.ts +17 -0
  126. package/dist/src/components/New/FileName/FileName.d.ts +79 -0
  127. package/dist/src/components/New/FilterChips/FilterChips.d.ts +69 -0
  128. package/dist/src/components/New/FilterChips/constants.d.ts +13 -0
  129. package/dist/src/components/New/FolderName/FolderName.d.ts +37 -0
  130. package/dist/src/components/New/InlineSelect/InlineSelect.d.ts +16 -1
  131. package/dist/src/components/New/InteractiveTooltip/constants.d.ts +5 -4
  132. package/dist/src/components/New/Notification/Notification.d.ts +18 -0
  133. package/dist/src/components/New/Popup/constants.d.ts +1 -1
  134. package/dist/src/components/New/Select/constants.d.ts +3 -2
  135. package/dist/src/components/New/SharedEntityIndicator/SharedEntityIndicator.d.ts +35 -0
  136. package/dist/src/components/New/Tabs/Tabs.d.ts +54 -6
  137. package/dist/src/components/New/Tooltip/constants.d.ts +5 -3
  138. package/dist/src/components/New/TransferQueue/TransferQueue.d.ts +139 -0
  139. package/dist/src/components/New/TransferQueue/TransferQueueHeader.d.ts +16 -0
  140. package/dist/src/components/New/TransferQueue/TransferQueueRow.d.ts +10 -0
  141. package/dist/src/components/New/TransferQueue/constants.d.ts +6 -0
  142. package/dist/src/components/New/constants/overlay.d.ts +13 -0
  143. package/dist/src/components/Popup/constants.d.ts +1 -1
  144. package/dist/src/components/SchemaRenderer/types.d.ts +11 -0
  145. package/dist/src/components/SchemaRenderer/utils.d.ts +10 -1
  146. package/dist/src/constants/public-class-names.d.ts +189 -0
  147. package/dist/src/index.d.ts +22 -1
  148. package/dist/src/types/accordion.d.ts +7 -0
  149. package/dist/src/types/breadcrumbs.d.ts +9 -0
  150. package/dist/src/types/button.d.ts +1 -0
  151. package/dist/src/types/transfer-queue.d.ts +10 -0
  152. package/dist/src/utils/__tests__/timezone.spec.d.ts +1 -0
  153. package/dist/src/utils/sub-menu-floating.d.ts +7 -4
  154. package/dist/src/utils/timezone.d.ts +24 -0
  155. package/dist/types/accordion.js +4 -0
  156. package/dist/types/breadcrumbs.js +4 -0
  157. package/dist/types/button.js +3 -3
  158. package/dist/types/transfer-queue.js +4 -0
  159. package/dist/use-file-manager-tabs-C0h1Sq5T.cjs +3 -0
  160. package/dist/utils/merge-classes.js +12 -5
  161. package/dist/utils/sub-menu-floating.js +98 -54
  162. package/dist/utils/timezone.js +19 -0
  163. package/package.json +3 -3
  164. package/dist/DateCellRenderer-ssp7eaZY.cjs +0 -1
  165. package/dist/IconButton-DWqoaBWf.cjs +0 -1
  166. package/dist/lazy-tfN4sKhq.cjs +0 -1
  167. package/dist/merge-classes-Dipy1Ih1.cjs +0 -1
  168. package/dist/use-file-manager-tabs-DjdR_mYM.cjs +0 -3
@@ -1,71 +1,71 @@
1
- import { jsx as i } from "react/jsx-runtime";
1
+ import { jsx as s } from "react/jsx-runtime";
2
2
  import { DialFormItem as g } from "../../FormItem/FormItem.js";
3
3
  import { JsonSchemaType as A } from "../types.js";
4
4
  import { useSchemaContext as C } from "../context.js";
5
- import { resolveRef as E, isObjectType as I, buildSummary as O, validateRequired as b, isMissingRequiredValue as k } from "../utils.js";
5
+ import { resolveRef as E, isObjectType as I, buildSummary as M, validateRequired as O, isMissingRequiredValue as b, toRequiredMessage as k } from "../utils.js";
6
6
  import { SchemaSection as w } from "./SchemaSection.js";
7
7
  import { SchemaFieldContent as u } from "./SchemaFieldContent.js";
8
- const q = ({
9
- schema: f,
8
+ const B = ({
9
+ schema: a,
10
10
  value: t,
11
11
  onChange: d,
12
12
  path: e,
13
- level: s = 0,
13
+ level: i = 0,
14
14
  required: r,
15
15
  label: n
16
16
  }) => {
17
17
  const {
18
18
  rootSchema: c,
19
- defaultExpanded: S = !0,
19
+ defaultExpanded: f = !0,
20
20
  touchedPaths: m = /* @__PURE__ */ new Set(),
21
21
  skipUntouched: h = !1
22
- } = C(), o = E(f, c), a = I(o), l = o.type === A.Array;
23
- if (a || l) {
24
- const j = O(t, o, c), x = b(
22
+ } = C(), o = E(a, c), S = I(o), l = o.type === A.Array;
23
+ if (S || l) {
24
+ const j = M(t, o, c), x = O(
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__ */ i(
30
+ return /* @__PURE__ */ s(
31
31
  w,
32
32
  {
33
33
  title: n ?? o.title ?? e[e.length - 1] ?? "Section",
34
34
  description: o.description,
35
- level: s,
35
+ level: i,
36
36
  summary: j,
37
37
  errorCount: F ? x.length : 0,
38
- defaultExpanded: S,
39
- children: /* @__PURE__ */ i(
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: s + 1,
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 && k(t) ? `${n ?? "Field"} is required` : void 0;
54
- return /* @__PURE__ */ i(
53
+ const y = (!h || m.has(e.join("."))) && r && b(t) ? k(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__ */ i(
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: s,
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
- q as SchemaField
77
+ B as SchemaField
78
78
  };
@@ -2,15 +2,15 @@ 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
3
  import { JsonSchemaType as c } from "../types.js";
4
4
  import { useSchemaContext as F } from "../context.js";
5
- import { resolveRef as T, isObjectType as u, isMissingRequiredValue as A } from "../utils.js";
6
- import { SchemaObjectEditor as b } from "./SchemaObjectEditor.js";
7
- import { SchemaArrayEditor as k } from "./SchemaArrayEditor.js";
8
- import { SchemaOneOfEditor as q } from "./SchemaOneOfEditor.js";
9
- import { SchemaAnyOfEditor as M } from "./SchemaAnyOfEditor.js";
10
- import { SchemaKeyValueEditor as R } from "./SchemaKeyValueEditor.js";
11
- import { SchemaPrimitiveField as V } from "./SchemaPrimitiveField.js";
12
- import { SchemaAdditionalPropertiesEditor as w } from "./SchemaAdditionalPropertiesEditor.js";
13
- const Q = ({
5
+ import { resolveRef as T, isObjectType as u, toRequiredMessage as A, isMissingRequiredValue as b } from "../utils.js";
6
+ import { SchemaObjectEditor as k } from "./SchemaObjectEditor.js";
7
+ import { SchemaArrayEditor as M } from "./SchemaArrayEditor.js";
8
+ import { SchemaOneOfEditor as R } from "./SchemaOneOfEditor.js";
9
+ import { SchemaAnyOfEditor as q } from "./SchemaAnyOfEditor.js";
10
+ import { SchemaKeyValueEditor as V } from "./SchemaKeyValueEditor.js";
11
+ import { SchemaPrimitiveField as w } from "./SchemaPrimitiveField.js";
12
+ import { SchemaAdditionalPropertiesEditor as D } from "./SchemaAdditionalPropertiesEditor.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
- q,
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
- M,
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
- R,
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
- w,
68
+ D,
69
69
  {
70
70
  value: i,
71
71
  onChange: s,
72
72
  theme: E
73
73
  }
74
74
  ) : o = /* @__PURE__ */ t(
75
- b,
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
- k,
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 && A(i), a = !l && n ? `${e.title ?? "Field"} is required` : void 0;
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
- V,
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
- Q as SchemaFieldContent
113
+ X as SchemaFieldContent
114
114
  };
@@ -1,184 +1,272 @@
1
- import { jsxs as y, jsx as a } from "react/jsx-runtime";
2
- import { useState as T } from "react";
3
- import { IconPlus as K } from "@tabler/icons-react";
4
- import { DialInput as A } from "../../Input/Input.js";
5
- import { DialErrorText as V } from "../../CaptionText/CaptionText.js";
6
- import { DialGhostButton as z } from "../../Button/ButtonWrappers.js";
7
- import { DialRemoveButton as H } from "../../RemoveButton/RemoveButton.js";
8
- import { ElementSize as q } from "../../../types/size.js";
9
- import { JsonSchemaType as L } from "../types.js";
10
- import { useSchemaContext as E } from "../context.js";
11
- import { resolveRef as G, isObjectType as J, buildSummary as M, validateRequired as U, extractDefaults as Y, getSchemaDefault as _ } from "../utils.js";
12
- import { SchemaPrimitiveField as $ } from "./SchemaPrimitiveField.js";
13
- import { SchemaSection as Q } from "./SchemaSection.js";
14
- import { SchemaFieldContent as W } from "./SchemaFieldContent.js";
15
- const R = (n, i) => ({
1
+ import { jsxs as x, jsx as e } from "react/jsx-runtime";
2
+ import { useState as R, useCallback as U, useMemo as M } from "react";
3
+ import { IconPlus as V } from "@tabler/icons-react";
4
+ import { DialInput as L } from "../../Input/Input.js";
5
+ import { DialErrorText as ee } from "../../CaptionText/CaptionText.js";
6
+ import { DialGhostButton as te } from "../../Button/ButtonWrappers.js";
7
+ import { DialRemoveButton as oe } from "../../RemoveButton/RemoveButton.js";
8
+ import { DialSelect as Y } from "../../Select/Select.js";
9
+ import { DialTooltip as ne } from "../../Tooltip/Tooltip.js";
10
+ import { ElementSize as re } from "../../../types/size.js";
11
+ import { JsonSchemaType as c } from "../types.js";
12
+ import { useSchemaContext as q } from "../context.js";
13
+ import { resolveRef as le, isObjectType as ae, inferEntryType as ie, getEntryTypeDefault as se, ENTRY_TYPE_OPTIONS as ce, buildSummary as de, validateRequired as me, extractDefaults as pe, getSchemaDefault as ye } from "../utils.js";
14
+ import { SchemaPrimitiveField as ue } from "./SchemaPrimitiveField.js";
15
+ import { SchemaSection as fe } from "./SchemaSection.js";
16
+ import { SchemaFieldContent as he } from "./SchemaFieldContent.js";
17
+ import { SchemaAdditionalPropertiesEditor as be } from "./SchemaAdditionalPropertiesEditor.js";
18
+ const _ = (l, d) => ({
16
19
  id: Math.random().toString(36).slice(2),
17
- key: n,
18
- value: i
19
- }), F = (n) => !!(n.oneOf || n.anyOf || n.type === L.Array || J(n)), X = ({
20
- pairId: n,
21
- pairKey: i,
22
- pairValue: s,
23
- valueSchema: c,
24
- onKeyChange: k,
20
+ key: l,
21
+ value: d
22
+ }), J = (l) => !!(l.oneOf || l.anyOf || l.type === c.Array || ae(l)), ve = {
23
+ [c.String]: "entryTypeString",
24
+ [c.Number]: "entryTypeNumber",
25
+ [c.Boolean]: "entryTypeBoolean",
26
+ [c.Null]: "entryTypeNull",
27
+ [c.Object]: "entryTypeObject",
28
+ [c.Array]: "entryTypeArray"
29
+ }, xe = ({
30
+ pairId: l,
31
+ pairKey: d,
32
+ pairValue: i,
33
+ valueSchema: u,
34
+ isUnschematizedValue: f,
35
+ jsonEditorTheme: C,
36
+ onKeyChange: m,
25
37
  onValueChange: p,
26
- onRemove: d,
27
- keyInputPlaceholder: x,
28
- removeFieldAriaLabel: C,
29
- path: m,
30
- level: h,
31
- readonly: l = !1,
32
- inputClassName: u
38
+ onRemove: P,
39
+ keyInputPlaceholder: O,
40
+ removeFieldAriaLabel: T,
41
+ path: h,
42
+ level: N,
43
+ readonly: s = !1,
44
+ inputClassName: b
33
45
  }) => {
34
46
  const {
35
- rootSchema: f,
36
- texts: g,
37
- defaultExpanded: N = !0,
38
- touchedPaths: S = /* @__PURE__ */ new Set(),
39
- markTouched: b = () => {
47
+ rootSchema: v,
48
+ texts: y,
49
+ defaultExpanded: E = !0,
50
+ touchedPaths: j = /* @__PURE__ */ new Set(),
51
+ markTouched: w = () => {
40
52
  },
41
- skipUntouched: P = !1
42
- } = E(), [e, t] = T(i), o = F(c), r = [...m, n, "key"].join("."), w = (!P || S.has(r)) && i === "", j = /* @__PURE__ */ y("div", { className: "flex gap-2 items-start", children: [
43
- /* @__PURE__ */ y("div", { className: o ? "flex-1 min-w-0" : "w-2/5 min-w-0", children: [
44
- /* @__PURE__ */ a(
45
- A,
53
+ skipUntouched: D = !1
54
+ } = q(), [t, o] = R(d), a = J(u), [n, g] = R(
55
+ () => ie(i)
56
+ ), B = f && (n === c.Object || n === c.Array), $ = f && n === c.Null, F = a || B, I = [...h, l, "key"].join("."), S = (!D || j.has(I)) && d === "", z = U(
57
+ (r) => {
58
+ p(se(r)), g(r);
59
+ },
60
+ [p]
61
+ ), G = M(
62
+ () => ce.map((r) => ({
63
+ value: r,
64
+ label: y[ve[r]]
65
+ })),
66
+ [y]
67
+ ), W = M(
68
+ () => [
69
+ { value: "true", label: y.booleanTrueOption },
70
+ { value: "false", label: y.booleanFalseOption }
71
+ ],
72
+ [y]
73
+ ), K = `${l}-key-error`, Q = f && n === c.Boolean, A = /* @__PURE__ */ x("div", { className: "flex gap-2 items-start", children: [
74
+ /* @__PURE__ */ x("div", { className: F ? "flex-1 min-w-0" : "w-2/5 min-w-0", children: [
75
+ /* @__PURE__ */ e(
76
+ L,
46
77
  {
47
- value: e,
48
- disabled: l,
49
- invalid: w,
50
- onChange: (I) => t(I ?? ""),
78
+ value: t,
79
+ disabled: s,
80
+ invalid: S,
81
+ "aria-describedby": S ? K : void 0,
82
+ onChange: (r) => o(r ?? ""),
51
83
  onBlur: () => {
52
- b(r), e !== i && k(e);
84
+ w(I), t !== d && m(t);
53
85
  },
54
- placeholder: x,
55
- containerClassName: u
86
+ placeholder: O,
87
+ containerClassName: b
56
88
  }
57
89
  ),
58
- /* @__PURE__ */ a(
59
- V,
90
+ /* @__PURE__ */ e(
91
+ ee,
60
92
  {
61
- text: w ? `${g.keyColumnHeader} is required` : void 0
93
+ id: K,
94
+ text: S ? `${y.keyColumnHeader} is required` : void 0
62
95
  }
63
96
  )
64
97
  ] }),
65
- !o && /* @__PURE__ */ a("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ a(
66
- $,
98
+ !a && !B && /* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: $ ? /* @__PURE__ */ e(
99
+ L,
100
+ {
101
+ value: "null",
102
+ disabled: !0,
103
+ onChange: void 0,
104
+ className: "opacity-60"
105
+ }
106
+ ) : Q ? /* @__PURE__ */ e(
107
+ Y,
67
108
  {
68
- schema: c,
69
- value: s,
109
+ options: W,
110
+ value: i ? "true" : "false",
111
+ disabled: s,
112
+ onChange: (r) => {
113
+ const k = typeof r == "string" ? r : r[0];
114
+ k && p(k === "true");
115
+ }
116
+ }
117
+ ) : /* @__PURE__ */ e(
118
+ ue,
119
+ {
120
+ schema: f ? { type: n } : u,
121
+ value: i,
70
122
  onChange: p
71
123
  }
72
124
  ) }),
73
- !l && /* @__PURE__ */ a(
74
- H,
125
+ f && /* @__PURE__ */ e("div", { className: "w-28 shrink-0", children: /* @__PURE__ */ e(
126
+ ne,
127
+ {
128
+ tooltip: y.entryTypeChangeWarning,
129
+ triggerClassName: "block",
130
+ children: /* @__PURE__ */ e(
131
+ Y,
132
+ {
133
+ options: G,
134
+ value: n,
135
+ disabled: s,
136
+ onChange: (r) => {
137
+ const k = typeof r == "string" ? r : r[0];
138
+ k && z(k);
139
+ }
140
+ }
141
+ )
142
+ }
143
+ ) }),
144
+ !s && /* @__PURE__ */ e(
145
+ oe,
75
146
  {
76
- size: q.Small,
77
- onClick: d,
78
- "aria-label": C,
147
+ size: re.Small,
148
+ onClick: P,
149
+ "aria-label": T,
79
150
  className: "shrink-0 p-1"
80
151
  }
81
152
  )
82
153
  ] });
83
- if (!o) return j;
84
- const D = [...m, i], O = M(s, c, f), B = U(
85
- s,
86
- c,
87
- f,
88
- D.join(".")
154
+ if (!F) return A;
155
+ if (B)
156
+ return /* @__PURE__ */ x("div", { className: "flex flex-col gap-2", children: [
157
+ A,
158
+ /* @__PURE__ */ e(
159
+ be,
160
+ {
161
+ value: i,
162
+ onChange: p,
163
+ theme: C
164
+ },
165
+ n
166
+ )
167
+ ] });
168
+ const H = [...h, d], X = de(i, u, v), Z = me(
169
+ i,
170
+ u,
171
+ v,
172
+ H.join(".")
89
173
  );
90
- return /* @__PURE__ */ y("div", { className: "flex flex-col gap-2", children: [
91
- j,
92
- /* @__PURE__ */ a(
93
- Q,
174
+ return /* @__PURE__ */ x("div", { className: "flex flex-col gap-2", children: [
175
+ A,
176
+ /* @__PURE__ */ e(
177
+ fe,
94
178
  {
95
- title: i,
96
- level: h,
97
- summary: O,
98
- errorCount: B.length + (w ? 1 : 0),
99
- defaultExpanded: N,
100
- children: /* @__PURE__ */ a(
101
- W,
179
+ title: d,
180
+ level: N,
181
+ summary: X,
182
+ errorCount: Z.length + (S ? 1 : 0),
183
+ defaultExpanded: E,
184
+ children: /* @__PURE__ */ e(
185
+ he,
102
186
  {
103
- schema: c,
104
- value: s,
187
+ schema: u,
188
+ value: i,
105
189
  onChange: p,
106
- path: D,
107
- level: h + 1
190
+ path: H,
191
+ level: N + 1
108
192
  }
109
193
  )
110
194
  }
111
195
  )
112
196
  ] });
113
- }, fe = ({
114
- schema: n,
115
- value: i,
116
- onChange: s,
117
- path: c,
118
- level: k
197
+ }, He = ({
198
+ schema: l,
199
+ value: d,
200
+ onChange: i,
201
+ path: u,
202
+ level: f
119
203
  }) => {
120
204
  const {
121
- rootSchema: p,
122
- texts: d,
123
- readonly: x = !1,
124
- inputClassName: C
125
- } = E(), m = n.additionalProperties === !0 || n.additionalProperties == null ? { type: "string" } : typeof n.additionalProperties == "object" ? G(n.additionalProperties, p) : { type: "string" }, h = F(m), [l, u] = T(
126
- () => Object.entries(i ?? {}).map(
127
- ([e, t]) => R(e, t)
205
+ rootSchema: C,
206
+ texts: m,
207
+ readonly: p = !1,
208
+ inputClassName: P,
209
+ jsonEditorTheme: O
210
+ } = q(), T = l.additionalProperties === !0 || l.additionalProperties == null, h = T ? { type: "string" } : typeof l.additionalProperties == "object" ? le(l.additionalProperties, C) : { type: "string" }, N = J(h), [s, b] = R(
211
+ () => Object.entries(d ?? {}).map(
212
+ ([t, o]) => _(t, o)
128
213
  )
129
- ), f = (e) => Object.fromEntries(
130
- e.filter((t) => t.key !== "").map((t) => [t.key, t.value])
131
- ), g = (e, t) => {
132
- const o = l.map(
133
- (r, v) => v === e ? { ...r, key: t } : r
214
+ ), v = (t) => Object.fromEntries(
215
+ t.filter((o) => o.key !== "").map((o) => [o.key, o.value])
216
+ ), y = (t, o) => {
217
+ const a = s.map(
218
+ (n, g) => g === t ? { ...n, key: o } : n
134
219
  );
135
- u(o), s(f(o));
136
- }, N = (e, t) => {
137
- const o = l.map(
138
- (r, v) => v === e ? { ...r, value: t } : r
220
+ b(a), i(v(a));
221
+ }, E = (t, o) => {
222
+ const a = s.map(
223
+ (n, g) => g === t ? { ...n, value: o } : n
139
224
  );
140
- u(o), s(f(o));
141
- }, S = () => h ? Y(m, p) ?? _(m) : "", b = () => {
142
- u((e) => [...e, R("", S())]);
143
- }, P = (e) => {
144
- const t = l.filter((o, r) => r !== e);
145
- u(t), s(f(t));
225
+ b(a), i(v(a));
226
+ }, j = () => N ? pe(h, C) ?? ye(h) : "", w = () => {
227
+ b((t) => [...t, _("", j())]);
228
+ }, D = (t) => {
229
+ const o = s.filter((a, n) => n !== t);
230
+ b(o), i(v(o));
146
231
  };
147
- return /* @__PURE__ */ y("div", { className: "flex flex-col gap-2", children: [
148
- l.length === 0 && /* @__PURE__ */ a("p", { className: "dial-tiny-text text-secondary italic", children: d.noFieldsYet }),
149
- l.length > 0 && !h && /* @__PURE__ */ y("div", { className: "flex gap-2 mb-1 pr-7", children: [
150
- /* @__PURE__ */ a("span", { className: "w-2/5 dial-tiny-text text-secondary font-medium", children: d.keyColumnHeader }),
151
- /* @__PURE__ */ a("span", { className: "flex-1 dial-tiny-text text-secondary font-medium", children: d.valueColumnHeader })
232
+ return /* @__PURE__ */ x("div", { className: "flex flex-col gap-2", children: [
233
+ s.length === 0 && /* @__PURE__ */ e("p", { className: "dial-tiny-text text-secondary italic", children: m.noFieldsYet }),
234
+ s.length > 0 && !N && /* @__PURE__ */ x("div", { className: "flex gap-2 mb-1 pr-7", children: [
235
+ /* @__PURE__ */ e("span", { className: "w-2/5 dial-tiny-text text-secondary font-medium", children: m.keyColumnHeader }),
236
+ /* @__PURE__ */ e("span", { className: "flex-1 dial-tiny-text text-secondary font-medium", children: m.valueColumnHeader }),
237
+ T && /* @__PURE__ */ e("span", { className: "w-28 shrink-0 dial-tiny-text text-secondary font-medium", children: m.typeColumnHeader })
152
238
  ] }),
153
- l.map((e, t) => /* @__PURE__ */ a(
154
- X,
239
+ s.map((t, o) => /* @__PURE__ */ e(
240
+ xe,
155
241
  {
156
- pairId: e.id,
157
- pairKey: e.key,
158
- pairValue: e.value,
159
- valueSchema: m,
160
- onKeyChange: (o) => g(t, o),
161
- onValueChange: (o) => N(t, o),
162
- onRemove: () => P(t),
163
- keyInputPlaceholder: d.keyInputPlaceholder,
164
- removeFieldAriaLabel: d.removeFieldAriaLabel,
165
- path: c,
166
- level: k,
167
- readonly: x,
168
- inputClassName: C
242
+ pairId: t.id,
243
+ pairKey: t.key,
244
+ pairValue: t.value,
245
+ valueSchema: h,
246
+ isUnschematizedValue: T,
247
+ jsonEditorTheme: O,
248
+ onKeyChange: (a) => y(o, a),
249
+ onValueChange: (a) => E(o, a),
250
+ onRemove: () => D(o),
251
+ keyInputPlaceholder: m.keyInputPlaceholder,
252
+ removeFieldAriaLabel: m.removeFieldAriaLabel,
253
+ path: u,
254
+ level: f,
255
+ readonly: p,
256
+ inputClassName: P
169
257
  },
170
- e.id
258
+ t.id
171
259
  )),
172
- !x && /* @__PURE__ */ a("div", { className: "pt-1", children: /* @__PURE__ */ a(
173
- z,
260
+ !p && /* @__PURE__ */ e("div", { className: "pt-1", children: /* @__PURE__ */ e(
261
+ te,
174
262
  {
175
- label: d.addField,
176
- iconBefore: /* @__PURE__ */ a(K, { size: 16, stroke: 2 }),
177
- onClick: b
263
+ label: m.addField,
264
+ iconBefore: /* @__PURE__ */ e(V, { size: 16, stroke: 2 }),
265
+ onClick: w
178
266
  }
179
267
  ) })
180
268
  ] });
181
269
  };
182
270
  export {
183
- fe as SchemaKeyValueEditor
271
+ He as SchemaKeyValueEditor
184
272
  };
@@ -1,5 +1,5 @@
1
- var t = /* @__PURE__ */ ((e) => (e.Sections = "sections", e.Flat = "flat", e.FlatSections = "flat-sections", e))(t || {}), l = /* @__PURE__ */ ((e) => (e.Select = "select", e.Radio = "radio", e))(l || {}), r = /* @__PURE__ */ ((e) => (e.Row = "row", e.Column = "column", e))(r || {}), o = /* @__PURE__ */ ((e) => (e.String = "string", e.Number = "number", e.Integer = "integer", e.Boolean = "boolean", e.Object = "object", e.Array = "array", e.Null = "null", e))(o || {});
2
- const n = {
1
+ var r = /* @__PURE__ */ ((e) => (e.Sections = "sections", e.Flat = "flat", e.FlatSections = "flat-sections", e))(r || {}), t = /* @__PURE__ */ ((e) => (e.Select = "select", e.Radio = "radio", e))(t || {}), l = /* @__PURE__ */ ((e) => (e.Row = "row", e.Column = "column", e))(l || {}), n = /* @__PURE__ */ ((e) => (e.String = "string", e.Number = "number", e.Integer = "integer", e.Boolean = "boolean", e.Object = "object", e.Array = "array", e.Null = "null", e))(n || {});
2
+ const o = {
3
3
  noItemSchema: "No item schema defined.",
4
4
  noItemsYet: "No items yet. Add one below.",
5
5
  addItem: "Add Item",
@@ -16,12 +16,23 @@ const n = {
16
16
  enumSelectPlaceholder: "Select an option",
17
17
  selectTypePlaceholder: "Select type",
18
18
  removeItemAriaLabel: "Remove item",
19
- removeFieldAriaLabel: "Remove field"
19
+ removeFieldAriaLabel: "Remove field",
20
+ typeColumnHeader: "Type",
21
+ entryTypeString: "String",
22
+ entryTypeNumber: "Number",
23
+ entryTypeBoolean: "Boolean",
24
+ entryTypeNull: "Null",
25
+ entryTypeObject: "Object",
26
+ entryTypeArray: "Array",
27
+ entryTypeChangeWarning: "Changing type will reset the current value.",
28
+ booleanTrueOption: "True",
29
+ booleanFalseOption: "False",
30
+ invalidJsonError: "Invalid JSON"
20
31
  };
21
32
  export {
22
- n as DEFAULT_SCHEMA_TEXTS,
23
- o as JsonSchemaType,
24
- l as SchemaDisplayMode,
25
- r as SchemaOrientation,
26
- t as SchemaRendererVariant
33
+ o as DEFAULT_SCHEMA_TEXTS,
34
+ n as JsonSchemaType,
35
+ t as SchemaDisplayMode,
36
+ l as SchemaOrientation,
37
+ r as SchemaRendererVariant
27
38
  };