@wipco/sdui 1.5.0 → 1.6.1

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 (143) hide show
  1. package/dist/{DatePicker-C_TT_SOw.d.ts → DatePicker-DX9juElE.d.ts} +10 -1
  2. package/dist/{chunk-7P7N43JV.js → chunk-34BABTH4.js} +2 -2
  3. package/dist/{chunk-DMLDKW7K.js → chunk-37BNG4DT.js} +1 -1
  4. package/dist/{chunk-5WW4MBRO.js → chunk-3JTBOABA.js} +6 -2
  5. package/dist/{chunk-HBIIEYKW.js → chunk-3PCR73OC.js} +4 -4
  6. package/dist/{chunk-VY7MVBSE.js → chunk-3PT5OBOU.js} +2 -2
  7. package/dist/{chunk-YVTV4ZV6.js → chunk-4YPPL7JK.js} +1 -1
  8. package/dist/{chunk-E6ISNQK3.js → chunk-6YBSBC77.js} +31 -8
  9. package/dist/{chunk-YWUDBLO6.js → chunk-7G6J6QFC.js} +2 -2
  10. package/dist/{chunk-UV6HHFEW.js → chunk-A57GKV5F.js} +129 -68
  11. package/dist/{chunk-I45EUZC6.js → chunk-AJ3KDBEE.js} +4 -2
  12. package/dist/chunk-BITS7UJY.js +333 -0
  13. package/dist/{chunk-DOL57OOP.js → chunk-BV37UCDF.js} +3 -3
  14. package/dist/chunk-CSZCWBOE.js +256 -0
  15. package/dist/{chunk-XGFDY43I.js → chunk-CUFGH3LB.js} +88 -18
  16. package/dist/{chunk-A6LAIGUS.js → chunk-EGFDELSF.js} +7 -4
  17. package/dist/{chunk-JIV4YHCZ.js → chunk-EJIWOD7W.js} +1 -1
  18. package/dist/{chunk-CXW6KT6X.js → chunk-ESAFQXEU.js} +3 -3
  19. package/dist/{chunk-N5RKM6IC.js → chunk-EUSC5NMZ.js} +4 -4
  20. package/dist/{chunk-RWSH2MBU.js → chunk-FP32LNFK.js} +73 -19
  21. package/dist/{chunk-44TDRCKR.js → chunk-GKYUDTMI.js} +5 -5
  22. package/dist/chunk-GSM664TX.js +38 -0
  23. package/dist/{chunk-I5SD7XRA.js → chunk-GSXD52XG.js} +3 -3
  24. package/dist/{chunk-O4IISNE7.js → chunk-IB2ZPUTF.js} +51 -12
  25. package/dist/{chunk-YOZN35HD.js → chunk-IIRVHSNK.js} +3 -3
  26. package/dist/{chunk-FNMS7OB7.js → chunk-J7BZF4T4.js} +5 -5
  27. package/dist/{chunk-KO6OEY3G.js → chunk-JHFA5RDN.js} +3 -13
  28. package/dist/{chunk-DKVSM5HX.js → chunk-KDKRFWIF.js} +6 -6
  29. package/dist/chunk-KO3EUNWB.js +380 -0
  30. package/dist/{chunk-JYAR7D5U.js → chunk-NLSR3JYU.js} +2 -2
  31. package/dist/{chunk-ZORQPB6B.js → chunk-O4EMQWCV.js} +325 -360
  32. package/dist/{chunk-2HLXCKK7.js → chunk-OCYJ2ZOV.js} +2 -2
  33. package/dist/{chunk-OQ52XMGG.js → chunk-OKNF2SBB.js} +4 -4
  34. package/dist/{chunk-GNA6SX2H.js → chunk-OQ7A3SFM.js} +2 -2
  35. package/dist/{chunk-A5XQOEVH.js → chunk-PCFH74RD.js} +4 -4
  36. package/dist/{chunk-BEM2YS7U.js → chunk-SGGIWPP6.js} +3 -3
  37. package/dist/{chunk-NIJUVTEW.js → chunk-TB7G5DXQ.js} +3 -3
  38. package/dist/{chunk-GZBY7I4Y.js → chunk-TWUKNUUQ.js} +66 -10
  39. package/dist/{chunk-WPSK2CB5.js → chunk-UC725BGW.js} +16 -5
  40. package/dist/{chunk-ZFNFPXPR.js → chunk-US3K6Q5T.js} +2 -2
  41. package/dist/{chunk-MPT7WJG2.js → chunk-USNPJEXH.js} +5 -5
  42. package/dist/{chunk-SAPBDJJQ.js → chunk-UZZLMPRW.js} +2 -2
  43. package/dist/{chunk-Q4SWUINA.js → chunk-VAXRTBJH.js} +1 -1
  44. package/dist/{chunk-RYBBPFI7.js → chunk-VQKX5PJ4.js} +4 -4
  45. package/dist/chunk-VR5MFUD2.js +106 -0
  46. package/dist/{chunk-JZXU22PE.js → chunk-VSNHDHGS.js} +208 -117
  47. package/dist/{chunk-2YP5N4VV.js → chunk-VZOQRQAR.js} +1 -1
  48. package/dist/{chunk-AXGF4M57.js → chunk-XAXROQKB.js} +1 -1
  49. package/dist/{chunk-IZ3JA2BR.js → chunk-XFKNU6QN.js} +3 -3
  50. package/dist/{chunk-GTGS2QRL.js → chunk-XUVWIRZJ.js} +3 -3
  51. package/dist/{chunk-RNOUXUBO.js → chunk-YYAGE733.js} +323 -59
  52. package/dist/index.d.ts +449 -91
  53. package/dist/index.js +1060 -138
  54. package/dist/{layout-C3nRXMwb.d.ts → layout-DmRikwZb.d.ts} +5 -4
  55. package/dist/meta.d.ts +1 -1
  56. package/dist/meta.js +351 -25
  57. package/dist/rich/ExcelUploadCard.d.ts +1 -1
  58. package/dist/rich/ExcelUploadCard.js +5 -4
  59. package/dist/rich.d.ts +22 -3
  60. package/dist/rich.js +304 -35
  61. package/dist/styles.css +119 -4
  62. package/dist/{types-COjGKgmd.d.ts → types-CMikpoN5.d.ts} +65 -2
  63. package/dist/widgets/ApprovalLineEditor.d.ts +1 -1
  64. package/dist/widgets/ApprovalLineEditor.js +9 -8
  65. package/dist/widgets/ApprovalOverridesEditor.d.ts +1 -1
  66. package/dist/widgets/ApprovalOverridesEditor.js +11 -10
  67. package/dist/widgets/ApprovalStepper.d.ts +29 -4
  68. package/dist/widgets/ApprovalStepper.js +3 -3
  69. package/dist/widgets/AutocompleteField.d.ts +1 -1
  70. package/dist/widgets/AutocompleteField.js +9 -8
  71. package/dist/widgets/ColumnBoard.d.ts +1 -1
  72. package/dist/widgets/ColumnBoard.js +3 -3
  73. package/dist/widgets/DiffView.d.ts +1 -1
  74. package/dist/widgets/DiffView.js +3 -3
  75. package/dist/widgets/Disclosure.d.ts +1 -1
  76. package/dist/widgets/Disclosure.js +3 -3
  77. package/dist/widgets/EventCalendar.d.ts +5 -1
  78. package/dist/widgets/EventCalendar.js +5 -3
  79. package/dist/widgets/FileDropzone.d.ts +1 -1
  80. package/dist/widgets/FileDropzone.js +9 -7
  81. package/dist/widgets/ImageLightbox.d.ts +1 -1
  82. package/dist/widgets/ImageLightbox.js +7 -5
  83. package/dist/widgets/InlineEdit.d.ts +1 -1
  84. package/dist/widgets/InlineEdit.js +3 -3
  85. package/dist/widgets/JsonField.d.ts +1 -1
  86. package/dist/widgets/JsonField.js +3 -3
  87. package/dist/widgets/LiveClock.d.ts +1 -1
  88. package/dist/widgets/LiveClock.js +2 -2
  89. package/dist/widgets/OptionSchemaEditor.d.ts +1 -1
  90. package/dist/widgets/OptionSchemaEditor.js +4 -4
  91. package/dist/widgets/OptionValueFields.d.ts +1 -1
  92. package/dist/widgets/OptionValueFields.js +4 -4
  93. package/dist/widgets/OrgChart.d.ts +1 -1
  94. package/dist/widgets/OrgChart.js +4 -4
  95. package/dist/widgets/OrgChartBoard.d.ts +15 -33
  96. package/dist/widgets/OrgChartBoard.js +10 -8
  97. package/dist/widgets/PeriodFilter.d.ts +1 -1
  98. package/dist/widgets/PeriodFilter.js +6 -5
  99. package/dist/widgets/PermissionMatrixEditor.d.ts +34 -2
  100. package/dist/widgets/PermissionMatrixEditor.js +6 -4
  101. package/dist/widgets/PositionSelect.d.ts +1 -1
  102. package/dist/widgets/PositionSelect.js +5 -4
  103. package/dist/widgets/PrintSheet.d.ts +15 -2
  104. package/dist/widgets/PrintSheet.js +3 -3
  105. package/dist/widgets/ProfileEditDiffCard.d.ts +1 -1
  106. package/dist/widgets/ProfileEditDiffCard.js +5 -4
  107. package/dist/widgets/QRDisplay.d.ts +1 -1
  108. package/dist/widgets/QRDisplay.js +5 -4
  109. package/dist/widgets/RankBoard.d.ts +1 -1
  110. package/dist/widgets/RankBoard.js +8 -6
  111. package/dist/widgets/RecordSheet.d.ts +1 -1
  112. package/dist/widgets/RecordSheet.js +2 -2
  113. package/dist/widgets/RoleMemberPicker.d.ts +1 -1
  114. package/dist/widgets/RoleMemberPicker.js +6 -5
  115. package/dist/widgets/SearchableMultiPicker.d.ts +1 -1
  116. package/dist/widgets/SearchableMultiPicker.js +7 -6
  117. package/dist/widgets/SecureScreen.d.ts +1 -1
  118. package/dist/widgets/SecureScreen.js +3 -3
  119. package/dist/widgets/StackedMeter.d.ts +1 -1
  120. package/dist/widgets/StackedMeter.js +2 -2
  121. package/dist/widgets/StagePeriodEditor.d.ts +1 -1
  122. package/dist/widgets/StagePeriodEditor.js +6 -5
  123. package/dist/widgets/Strip.d.ts +1 -1
  124. package/dist/widgets/Strip.js +2 -2
  125. package/dist/widgets/SummaryTable.d.ts +1 -1
  126. package/dist/widgets/SummaryTable.js +2 -2
  127. package/dist/widgets/TagInput.d.ts +1 -1
  128. package/dist/widgets/TagInput.js +3 -3
  129. package/dist/widgets/TagMultiSelect.d.ts +1 -1
  130. package/dist/widgets/TagMultiSelect.js +5 -4
  131. package/dist/widgets/Timeline.d.ts +1 -1
  132. package/dist/widgets/Timeline.js +4 -4
  133. package/dist/widgets/TreePicker.d.ts +1 -1
  134. package/dist/widgets/TreePicker.js +8 -7
  135. package/dist/widgets/TreeView.d.ts +17 -3
  136. package/dist/widgets/TreeView.js +7 -6
  137. package/dist/widgets/index.d.ts +3 -3
  138. package/dist/widgets/index.js +84 -83
  139. package/package.json +1 -1
  140. package/dist/chunk-LFEJLOFN.js +0 -352
  141. package/dist/chunk-MMIGOPO5.js +0 -111
  142. package/dist/chunk-TFGNKFL2.js +0 -39
  143. package/dist/chunk-XQPTSEJC.js +0 -135
@@ -1,5 +1,5 @@
1
- import { Icon } from './chunk-RNOUXUBO.js';
2
- import { boxed } from './chunk-5WW4MBRO.js';
1
+ import { Icon } from './chunk-YYAGE733.js';
2
+ import { boxed } from './chunk-3JTBOABA.js';
3
3
  import { useState, useId, useCallback } from 'react';
4
4
  import { jsxs, jsx } from 'react/jsx-runtime';
5
5
 
@@ -1,7 +1,7 @@
1
- import { resolveTreeNodes, TreeView } from './chunk-GZBY7I4Y.js';
2
- import { OverlayLayer } from './chunk-XQPTSEJC.js';
3
- import { Field, Dialog, Icon, Button, Input } from './chunk-RNOUXUBO.js';
4
- import { boxed } from './chunk-5WW4MBRO.js';
1
+ import { resolveTreeNodes, TreeView } from './chunk-TWUKNUUQ.js';
2
+ import { OverlayLayer } from './chunk-BITS7UJY.js';
3
+ import { Field, Dialog, Icon, Button, Input } from './chunk-YYAGE733.js';
4
+ import { boxed } from './chunk-3JTBOABA.js';
5
5
  import { useState, useMemo } from 'react';
6
6
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
7
7
 
@@ -1,6 +1,6 @@
1
1
  import { HoistedStyle } from './chunk-RIZRM7OO.js';
2
- import { Tag } from './chunk-RNOUXUBO.js';
3
- import { boxed } from './chunk-5WW4MBRO.js';
2
+ import { Tag } from './chunk-YYAGE733.js';
3
+ import { boxed } from './chunk-3JTBOABA.js';
4
4
  import { useState, useMemo, useRef, useEffect } from 'react';
5
5
  import { jsxs, jsx } from 'react/jsx-runtime';
6
6
 
@@ -1,7 +1,7 @@
1
- import { fetchAllPages } from './chunk-Q4SWUINA.js';
2
- import { useSduiAdapter, hostFetchOf, defaultAdapter } from './chunk-KO6OEY3G.js';
3
- import { Alert, Badge, Spinner, Button, Input, Checkbox } from './chunk-RNOUXUBO.js';
4
- import { boxed } from './chunk-5WW4MBRO.js';
1
+ import { fetchAllPages } from './chunk-VAXRTBJH.js';
2
+ import { useSduiAdapter, hostFetchOf, defaultAdapter } from './chunk-JHFA5RDN.js';
3
+ import { Alert, Badge, Spinner, Button, Input, Checkbox } from './chunk-YYAGE733.js';
4
+ import { boxed } from './chunk-3JTBOABA.js';
5
5
  import { useRef, useMemo, useState, useCallback, useEffect } from 'react';
6
6
  import { jsxs, jsx } from 'react/jsx-runtime';
7
7
 
@@ -1,6 +1,6 @@
1
- import { Text } from './chunk-WPSK2CB5.js';
2
- import { Switch, Field, Select, Input } from './chunk-RNOUXUBO.js';
3
- import { boxed } from './chunk-5WW4MBRO.js';
1
+ import { Text } from './chunk-UC725BGW.js';
2
+ import { Switch, Field, Select, Input } from './chunk-YYAGE733.js';
3
+ import { boxed } from './chunk-3JTBOABA.js';
4
4
  import React, { useMemo } from 'react';
5
5
  import { jsx, jsxs } from 'react/jsx-runtime';
6
6
 
@@ -1,6 +1,6 @@
1
- import { DatePicker, TimePicker } from './chunk-RWSH2MBU.js';
2
- import { Field } from './chunk-RNOUXUBO.js';
3
- import { boxed } from './chunk-5WW4MBRO.js';
1
+ import { DatePicker, TimePicker } from './chunk-FP32LNFK.js';
2
+ import { Field } from './chunk-YYAGE733.js';
3
+ import { boxed } from './chunk-3JTBOABA.js';
4
4
  import { useState, useRef, useEffect, useMemo } from 'react';
5
5
  import { jsxs, jsx } from 'react/jsx-runtime';
6
6
 
@@ -1,6 +1,6 @@
1
- import { buildCascadingTree } from './chunk-UV6HHFEW.js';
2
- import { Input, IconButton, EmptyState, Icon, Badge } from './chunk-RNOUXUBO.js';
3
- import { boxed } from './chunk-5WW4MBRO.js';
1
+ import { buildCascadingTree } from './chunk-A57GKV5F.js';
2
+ import { Input, IconButton, EmptyState, Icon, Badge } from './chunk-YYAGE733.js';
3
+ import { boxed } from './chunk-3JTBOABA.js';
4
4
  import React, { useMemo, useState, useRef, useEffect } from 'react';
5
5
  import { jsxs, jsx } from 'react/jsx-runtime';
6
6
 
@@ -66,6 +66,35 @@ function collectExpandedIds(nodes, maxDepth, depth = 0, acc = /* @__PURE__ */ ne
66
66
  }
67
67
  return acc;
68
68
  }
69
+ function ancestorIdsOf(nodes, id) {
70
+ const path = [];
71
+ const walk = (list) => {
72
+ for (const node of list) {
73
+ if (node.id === id) return true;
74
+ if (node.children && node.children.length > 0) {
75
+ path.push(node.id);
76
+ if (walk(node.children)) return true;
77
+ path.pop();
78
+ }
79
+ }
80
+ return false;
81
+ };
82
+ return walk(nodes) ? path : null;
83
+ }
84
+ function withAncestors(prev, nodes, selected) {
85
+ if (selected == null || selected === "") return prev;
86
+ const ancestors = ancestorIdsOf(nodes, selected);
87
+ if (!ancestors || ancestors.every((id) => prev.has(id))) return prev;
88
+ return /* @__PURE__ */ new Set([...prev, ...ancestors]);
89
+ }
90
+ function scrollRowIntoBox(box, row) {
91
+ if (box.scrollHeight <= box.clientHeight) return;
92
+ const boxRect = box.getBoundingClientRect();
93
+ const rowRect = row.getBoundingClientRect();
94
+ const scale = box.offsetHeight && boxRect.height > 0 ? boxRect.height / box.offsetHeight : 1;
95
+ if (rowRect.top < boxRect.top) box.scrollTop -= (boxRect.top - rowRect.top) / scale;
96
+ else if (rowRect.bottom > boxRect.bottom) box.scrollTop += (rowRect.bottom - boxRect.bottom) / scale;
97
+ }
69
98
  function toggled(prev, id) {
70
99
  const next = new Set(prev);
71
100
  if (next.has(id)) next.delete(id);
@@ -84,18 +113,44 @@ function TreeViewImpl({
84
113
  maxHeight
85
114
  }) {
86
115
  const sourceNodes = useMemo(() => resolveTreeNodes(nodes, rows, tree), [nodes, rows, tree]);
87
- const [expanded, setExpanded] = useState(() => collectExpandedIds(sourceNodes, defaultExpandedDepth));
116
+ const [innerSelected, setInnerSelected] = useState(null);
117
+ const isControlled = selectedId !== void 0;
118
+ const currentSelected = isControlled ? selectedId : innerSelected;
119
+ const [expanded, setExpanded] = useState(
120
+ () => withAncestors(collectExpandedIds(sourceNodes, defaultExpandedDepth), sourceNodes, currentSelected)
121
+ );
88
122
  const [searchCollapsed, setSearchCollapsed] = useState(() => /* @__PURE__ */ new Set());
89
123
  const [query, setQuery] = useState("");
90
- const [innerSelected, setInnerSelected] = useState(null);
124
+ const treeRef = useRef(null);
91
125
  const hadRows = useRef(Array.isArray(rows) && rows.length > 0);
92
126
  useEffect(() => {
93
127
  const hasRows = Array.isArray(rows) && rows.length > 0;
94
- if (hasRows && !hadRows.current) setExpanded(collectExpandedIds(sourceNodes, defaultExpandedDepth));
128
+ if (hasRows && !hadRows.current) {
129
+ setExpanded(withAncestors(collectExpandedIds(sourceNodes, defaultExpandedDepth), sourceNodes, currentSelected));
130
+ }
95
131
  hadRows.current = hasRows;
96
- }, [rows, sourceNodes, defaultExpandedDepth]);
97
- const isControlled = selectedId !== void 0;
98
- const currentSelected = isControlled ? selectedId : innerSelected;
132
+ }, [rows, sourceNodes, defaultExpandedDepth, currentSelected]);
133
+ const revealedFor = useRef(null);
134
+ const scrollPending = useRef(false);
135
+ useEffect(() => {
136
+ if (currentSelected == null || currentSelected === "") {
137
+ revealedFor.current = null;
138
+ return;
139
+ }
140
+ if (revealedFor.current === currentSelected) return;
141
+ if (ancestorIdsOf(sourceNodes, currentSelected) === null) return;
142
+ revealedFor.current = currentSelected;
143
+ scrollPending.current = true;
144
+ setExpanded((prev) => withAncestors(prev, sourceNodes, currentSelected));
145
+ }, [currentSelected, sourceNodes]);
146
+ useEffect(() => {
147
+ if (!scrollPending.current) return;
148
+ const box = treeRef.current;
149
+ const row = box?.querySelector('[aria-current="true"]');
150
+ if (!box || !row) return;
151
+ scrollPending.current = false;
152
+ scrollRowIntoBox(box, row);
153
+ });
99
154
  const trimmedQuery = query.trim().toLowerCase();
100
155
  const searching = trimmedQuery.length > 0;
101
156
  const visibleNodes = useMemo(() => {
@@ -271,6 +326,7 @@ function TreeViewImpl({
271
326
  /* @__PURE__ */ jsx(
272
327
  "div",
273
328
  {
329
+ ref: treeRef,
274
330
  role: "tree",
275
331
  className: "wp-scroll",
276
332
  style: { overflowY: "auto", ...maxHeight ? { maxHeight } : null },
@@ -283,4 +339,4 @@ function TreeViewImpl({
283
339
  }
284
340
  var TreeView = boxed(TreeViewImpl, "TreeView");
285
341
 
286
- export { TreeView, buildTreeNodes, pruneExcluded, resolveTreeNodes };
342
+ export { TreeView, ancestorIdsOf, buildTreeNodes, pruneExcluded, resolveTreeNodes, scrollRowIntoBox };
@@ -1,4 +1,5 @@
1
- import { mergeStyle, containerLayoutStyle, joinClass, columnsClass, typographyStyle, GAP_CSS } from './chunk-5WW4MBRO.js';
1
+ import { formatDisplayValue } from './chunk-YYAGE733.js';
2
+ import { mergeStyle, containerLayoutStyle, joinClass, columnsClass, typographyStyle, GAP_CSS } from './chunk-3JTBOABA.js';
2
3
  import React from 'react';
3
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
5
 
@@ -9,6 +10,7 @@ function paddingStyle(padding) {
9
10
  function Grid({
10
11
  columns = 3,
11
12
  template,
13
+ collapse = true,
12
14
  gap,
13
15
  rowGap,
14
16
  columnGap,
@@ -23,10 +25,16 @@ function Grid({
23
25
  return /* @__PURE__ */ jsx(
24
26
  "div",
25
27
  {
26
- className: joinClass("wp-grid", !template && columnsClass(columns), className),
28
+ className: joinClass(
29
+ "wp-grid",
30
+ template ? "wp-grid--custom" : columnsClass(columns),
31
+ collapse === false && "wp-grid--nocollapse",
32
+ className
33
+ ),
27
34
  style: mergeStyle(
28
35
  {
29
- ...template ? { gridTemplateColumns: template } : null,
36
+ // 규칙(`.wp-grid--custom{grid-template-columns:var(--wp-grid-template)}`)은 LAYOUT_CSS 에 있다.
37
+ ...template ? { "--wp-grid-template": String(template) } : null,
30
38
  ...containerLayoutStyle({ gap, rowGap, columnGap, align, justify, wrap }),
31
39
  ...paddingStyle(padding)
32
40
  },
@@ -135,6 +143,7 @@ function Text({
135
143
  }
136
144
  );
137
145
  }
146
+ var KV_BLOCK_AUTO_LENGTH = 80;
138
147
  function KeyValueList({ source, items, className, style }) {
139
148
  return /* @__PURE__ */ jsx("div", { className: joinClass("wp-kv", className), style, children: (items ?? []).map((item, index) => {
140
149
  const raw = item.key ? source?.[item.key] : item.value;
@@ -147,11 +156,13 @@ function KeyValueList({ source, items, className, style }) {
147
156
  word
148
157
  ] }, `${word}-${wordIndex}`)) });
149
158
  } else {
150
- content = raw === null || raw === void 0 || raw === "" ? "\u2014" : raw;
159
+ const shown = formatDisplayValue(raw, item.format);
160
+ content = shown === null || shown === void 0 || shown === "" ? "\u2014" : shown;
151
161
  }
162
+ const block = item.block ?? (typeof content === "string" && (content.includes("\n") || content.length > KV_BLOCK_AUTO_LENGTH));
152
163
  return /* @__PURE__ */ jsxs(React.Fragment, { children: [
153
164
  /* @__PURE__ */ jsx("span", { className: "wp-kv__k", children: item.label }),
154
- /* @__PURE__ */ jsx("span", { className: joinClass("wp-kv__v", item.mono && "wp-mono"), children: content })
165
+ /* @__PURE__ */ jsx("span", { className: joinClass("wp-kv__v", block && "wp-kv__v--block", item.mono && "wp-mono"), children: content })
155
166
  ] }, index);
156
167
  }) });
157
168
  }
@@ -1,5 +1,5 @@
1
- import { Textarea, Icon } from './chunk-RNOUXUBO.js';
2
- import { boxed } from './chunk-5WW4MBRO.js';
1
+ import { Textarea, Icon } from './chunk-YYAGE733.js';
2
+ import { boxed } from './chunk-3JTBOABA.js';
3
3
  import { useState, useRef, useId, useEffect, useCallback } from 'react';
4
4
  import { jsxs, jsx } from 'react/jsx-runtime';
5
5
 
@@ -1,8 +1,8 @@
1
- import { orderCircleStyle, ellipsisStyle, unwrapRows, uid } from './chunk-Q4SWUINA.js';
2
- import { includesLooseSearch } from './chunk-UV6HHFEW.js';
3
- import { useSduiAdapter, hostFetchOf, defaultAdapter } from './chunk-KO6OEY3G.js';
4
- import { Icon, Badge, IconButton, Field, Select, Input, Tag, Spinner, Button, isPlainObject } from './chunk-RNOUXUBO.js';
5
- import { boxed } from './chunk-5WW4MBRO.js';
1
+ import { orderCircleStyle, ellipsisStyle, unwrapRows, uid } from './chunk-VAXRTBJH.js';
2
+ import { includesLooseSearch } from './chunk-A57GKV5F.js';
3
+ import { useSduiAdapter, hostFetchOf, defaultAdapter } from './chunk-JHFA5RDN.js';
4
+ import { Icon, Badge, IconButton, Field, Select, Input, Tag, Spinner, Button, isPlainObject } from './chunk-YYAGE733.js';
5
+ import { boxed } from './chunk-3JTBOABA.js';
6
6
  import React, { useState, useId, useRef, useEffect } from 'react';
7
7
  import { jsxs, jsx } from 'react/jsx-runtime';
8
8
 
@@ -1,5 +1,5 @@
1
- import { useOverlayLayer, OverlayContainerContext, getOverlayRoot } from './chunk-XQPTSEJC.js';
2
- import { IconButton } from './chunk-RNOUXUBO.js';
1
+ import { useOverlayLayer, OverlayContainerContext, getOverlayRoot } from './chunk-BITS7UJY.js';
2
+ import { IconButton } from './chunk-YYAGE733.js';
3
3
  import { useState, useRef, useCallback, useEffect, useContext } from 'react';
4
4
  import { createPortal } from 'react-dom';
5
5
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -1,4 +1,4 @@
1
- import { isPlainObject } from './chunk-RNOUXUBO.js';
1
+ import { isPlainObject } from './chunk-YYAGE733.js';
2
2
 
3
3
  // src/widgets/shared.ts
4
4
  function unwrapRows(payload) {
@@ -1,8 +1,8 @@
1
1
  import { fetchAllJobPositions } from './chunk-XRHR452N.js';
2
- import { useSduiDispatch, useSduiCan, SduiDialog } from './chunk-TFGNKFL2.js';
3
- import { useSduiAdapter, hostFetchOf, defaultAdapter } from './chunk-KO6OEY3G.js';
4
- import { Card, Input, Button, Icon, Badge, IconButton } from './chunk-RNOUXUBO.js';
5
- import { boxed } from './chunk-5WW4MBRO.js';
2
+ import { useSduiDispatch, useSduiCan, SduiDialog } from './chunk-VR5MFUD2.js';
3
+ import { useSduiAdapter, hostFetchOf, defaultAdapter } from './chunk-JHFA5RDN.js';
4
+ import { Card, Input, Button, Icon, Badge, IconButton } from './chunk-YYAGE733.js';
5
+ import { boxed } from './chunk-3JTBOABA.js';
6
6
  import React, { useState, useEffect, useCallback, useMemo } from 'react';
7
7
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
8
8
 
@@ -0,0 +1,106 @@
1
+ import { OverlayLayer } from './chunk-BITS7UJY.js';
2
+ import { Dialog, Button, warnOnce } from './chunk-YYAGE733.js';
3
+ import { createContext, useContext, useMemo, useRef, useCallback, useState } from 'react';
4
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
+
6
+ var SduiDispatchContext = createContext(null);
7
+ function useSduiDispatch() {
8
+ const dispatch = useContext(SduiDispatchContext);
9
+ if (!dispatch) {
10
+ throw new Error("useSduiDispatch\uB294 SduiRenderer \uB0B4\uBD80\uC5D0\uC11C\uB9CC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.");
11
+ }
12
+ return dispatch;
13
+ }
14
+ var ALLOW_ALL = () => true;
15
+ var DENY_ALL = () => false;
16
+ var MISSING = () => {
17
+ warnOnce(
18
+ "permission:missing",
19
+ '[sdui] \uAD8C\uD55C \uD310\uC815(can)\uC774 \uC8FC\uC785\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4 \u2014 <Can>\uC774 \uC804\uBD80 \uD1B5\uACFC\uD569\uB2C8\uB2E4. SduiRenderer\uC5D0 can \uCF5C\uBC31\uC744 \uB118\uAE30\uAC70\uB098, \uC138\uC158\uC774 \uC5C6\uB294 \uBBF8\uB9AC\uBCF4\uAE30\uB77C\uBA74 can="allow-all"\uC744 \uBA85\uC2DC\uD558\uC138\uC694.'
20
+ );
21
+ return true;
22
+ };
23
+ var SduiPermissionContext = createContext(null);
24
+ function SduiPermissionProvider({ can, children }) {
25
+ const value = useMemo(() => {
26
+ if (can === "allow-all") return ALLOW_ALL;
27
+ if (can === "deny-all") return DENY_ALL;
28
+ return typeof can === "function" ? can : null;
29
+ }, [can]);
30
+ return /* @__PURE__ */ jsx(SduiPermissionContext.Provider, { value, children });
31
+ }
32
+ function useSduiCan() {
33
+ return useContext(SduiPermissionContext) ?? MISSING;
34
+ }
35
+ var SduiRuntimeContext = createContext(null);
36
+ function useSduiRuntime() {
37
+ const runtime = useContext(SduiRuntimeContext);
38
+ if (!runtime) throw new Error("useSduiRuntime\uC740 SduiRenderer \uB0B4\uBD80\uC5D0\uC11C\uB9CC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.");
39
+ return runtime;
40
+ }
41
+ var SduiFormScopeContext = createContext(null);
42
+ var SduiDirtyRegistryContext = createContext(null);
43
+ var SduiLeaveRegistryContext = createContext(null);
44
+ var DEFAULT_CONFIRM_MESSAGE = "\uC9C0\uAE08 \uB2EB\uC73C\uBA74 \uC785\uB825\uD55C \uB0B4\uC6A9\uC774 \uC800\uC7A5\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.";
45
+ function isInsideBody(target) {
46
+ return target instanceof Element && target.closest(".wp-dialog__body, .wp-anchored-pop") !== null;
47
+ }
48
+ function SduiDialog({ confirmClose, ...props }) {
49
+ const { onClose } = props;
50
+ const dirtyChecks = useRef(/* @__PURE__ */ new Set());
51
+ const registry = useMemo(
52
+ () => ({
53
+ register: (isDirty) => {
54
+ dirtyChecks.current.add(isDirty);
55
+ return () => {
56
+ dirtyChecks.current.delete(isDirty);
57
+ };
58
+ }
59
+ }),
60
+ []
61
+ );
62
+ const touched = useRef(false);
63
+ const markTouched = useCallback((event) => {
64
+ if (isInsideBody(event.target)) touched.current = true;
65
+ }, []);
66
+ const [asking, setAsking] = useState(false);
67
+ const explicit = confirmClose === true || typeof confirmClose === "string" && confirmClose !== "";
68
+ const needsConfirm = () => {
69
+ if (confirmClose === false) return false;
70
+ if (explicit) return true;
71
+ if (!touched.current) return false;
72
+ for (const isDirty of dirtyChecks.current) if (isDirty()) return true;
73
+ return false;
74
+ };
75
+ const guardedClose = () => {
76
+ if (!onClose || asking) return;
77
+ if (needsConfirm()) setAsking(true);
78
+ else onClose();
79
+ };
80
+ const message = typeof confirmClose === "string" && confirmClose !== "" ? confirmClose : DEFAULT_CONFIRM_MESSAGE;
81
+ const keep = () => setAsking(false);
82
+ const discard = () => {
83
+ setAsking(false);
84
+ onClose?.();
85
+ };
86
+ return /* @__PURE__ */ jsxs(SduiDirtyRegistryContext.Provider, { value: registry, children: [
87
+ /* @__PURE__ */ jsx(OverlayLayer, { onClose: onClose ? guardedClose : void 0, children: /* @__PURE__ */ jsx(Dialog, { ...props, onInputCapture: markTouched, onChangeCapture: markTouched, onPointerDownCapture: markTouched }) }),
88
+ asking ? /* @__PURE__ */ jsx(OverlayLayer, { onClose: keep, children: /* @__PURE__ */ jsx(
89
+ Dialog,
90
+ {
91
+ size: "sm",
92
+ icon: "triangle-alert",
93
+ tone: "danger",
94
+ title: "\uC791\uC131 \uC911\uC778 \uB0B4\uC6A9\uC744 \uBC84\uB9B4\uAE4C\uC694?",
95
+ onClose: keep,
96
+ footer: /* @__PURE__ */ jsxs(Fragment, { children: [
97
+ /* @__PURE__ */ jsx(Button, { variant: "secondary", "data-autofocus": "", onClick: keep, children: "\uACC4\uC18D \uC791\uC131" }),
98
+ /* @__PURE__ */ jsx(Button, { variant: "danger", onClick: discard, children: "\uBC84\uB9AC\uACE0 \uB2EB\uAE30" })
99
+ ] }),
100
+ children: message
101
+ }
102
+ ) }) : null
103
+ ] });
104
+ }
105
+
106
+ export { SduiDialog, SduiDirtyRegistryContext, SduiDispatchContext, SduiFormScopeContext, SduiLeaveRegistryContext, SduiPermissionProvider, SduiRuntimeContext, useSduiCan, useSduiDispatch, useSduiRuntime };