@wipco/sdui 1.6.1 → 1.7.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 (95) hide show
  1. package/dist/{DatePicker-DX9juElE.d.ts → DatePicker-BOOKdd5x.d.ts} +6 -6
  2. package/dist/calendar-nav-BSGsgJc4.d.ts +54 -0
  3. package/dist/{chunk-OKNF2SBB.js → chunk-2FHNGMBT.js} +3 -3
  4. package/dist/{chunk-AJ3KDBEE.js → chunk-466W3XNK.js} +1 -1
  5. package/dist/{chunk-UC725BGW.js → chunk-5FZBH3T5.js} +1 -1
  6. package/dist/{chunk-XUVWIRZJ.js → chunk-5LIFU57A.js} +2 -2
  7. package/dist/{chunk-VAXRTBJH.js → chunk-63GM4S25.js} +1 -1
  8. package/dist/{chunk-KO3EUNWB.js → chunk-7YTZB5LQ.js} +3 -3
  9. package/dist/{chunk-SGGIWPP6.js → chunk-7ZCM6XEM.js} +2 -2
  10. package/dist/{chunk-IIRVHSNK.js → chunk-A3SO6H47.js} +2 -2
  11. package/dist/{chunk-VSNHDHGS.js → chunk-B5MB64YQ.js} +209 -25
  12. package/dist/{chunk-US3K6Q5T.js → chunk-ENZBX4AR.js} +1 -1
  13. package/dist/{chunk-CUFGH3LB.js → chunk-FGKBXUUA.js} +1 -1
  14. package/dist/{chunk-VR5MFUD2.js → chunk-FUNCQCKN.js} +2 -2
  15. package/dist/{chunk-O4EMQWCV.js → chunk-FYVDPEJU.js} +120 -26
  16. package/dist/{chunk-GKYUDTMI.js → chunk-J6YDTBKY.js} +2 -2
  17. package/dist/{chunk-UZZLMPRW.js → chunk-JCG4575S.js} +2 -2
  18. package/dist/{chunk-34BABTH4.js → chunk-JMNUFA5M.js} +1 -1
  19. package/dist/{chunk-FP32LNFK.js → chunk-KAQ2VZBM.js} +166 -193
  20. package/dist/{chunk-A57GKV5F.js → chunk-KXTQOP3E.js} +3 -3
  21. package/dist/{chunk-3PT5OBOU.js → chunk-L6ODTHTX.js} +1 -1
  22. package/dist/{chunk-OQ7A3SFM.js → chunk-LKA43GYA.js} +1 -1
  23. package/dist/{chunk-GSXD52XG.js → chunk-LKL3SCBJ.js} +2 -2
  24. package/dist/{chunk-J7BZF4T4.js → chunk-MANONABB.js} +4 -4
  25. package/dist/{chunk-XFKNU6QN.js → chunk-NI3LMETK.js} +2 -2
  26. package/dist/{chunk-ESAFQXEU.js → chunk-NJTIJAFU.js} +2 -2
  27. package/dist/{chunk-PCFH74RD.js → chunk-NQDHGK7C.js} +3 -3
  28. package/dist/{chunk-YYAGE733.js → chunk-OWM7E55U.js} +8 -0
  29. package/dist/{chunk-OCYJ2ZOV.js → chunk-P62INTQ5.js} +1 -1
  30. package/dist/{chunk-7G6J6QFC.js → chunk-Q56LZJFX.js} +1 -1
  31. package/dist/{chunk-KDKRFWIF.js → chunk-QAGJ6FRE.js} +5 -5
  32. package/dist/chunk-QVNJMZUF.js +462 -0
  33. package/dist/{chunk-BITS7UJY.js → chunk-R2ORCOTG.js} +2 -2
  34. package/dist/{chunk-VQKX5PJ4.js → chunk-RA74PUMP.js} +3 -3
  35. package/dist/{chunk-USNPJEXH.js → chunk-RJYPRWWS.js} +4 -4
  36. package/dist/{chunk-TB7G5DXQ.js → chunk-S6GJRP5T.js} +2 -2
  37. package/dist/{chunk-TWUKNUUQ.js → chunk-SGR2QDEG.js} +2 -2
  38. package/dist/{chunk-3PCR73OC.js → chunk-T5LLOSHE.js} +3 -3
  39. package/dist/{chunk-GSM664TX.js → chunk-TAVKGYH5.js} +24 -1
  40. package/dist/{chunk-BV37UCDF.js → chunk-UBVYPV7H.js} +2 -2
  41. package/dist/chunk-VR4DQTWR.js +391 -0
  42. package/dist/{chunk-6YBSBC77.js → chunk-WPAZBAUW.js} +1 -1
  43. package/dist/{chunk-4YPPL7JK.js → chunk-WTQH2NI2.js} +1 -1
  44. package/dist/{chunk-NLSR3JYU.js → chunk-X7RSKFWF.js} +1 -1
  45. package/dist/{chunk-CSZCWBOE.js → chunk-XDR6HC4U.js} +14 -7
  46. package/dist/{chunk-EUSC5NMZ.js → chunk-Z4JZUIKE.js} +3 -3
  47. package/dist/{chunk-EGFDELSF.js → chunk-Z4LFZWHH.js} +2 -2
  48. package/dist/{chunk-JHFA5RDN.js → chunk-ZBX2CAOO.js} +2 -2
  49. package/dist/index.d.ts +22 -2
  50. package/dist/index.js +27 -19
  51. package/dist/meta.js +14 -1
  52. package/dist/rich/ExcelUploadCard.js +4 -4
  53. package/dist/rich.d.ts +2 -1
  54. package/dist/rich.js +7 -6
  55. package/dist/styles.css +10 -0
  56. package/dist/widgets/ApprovalLineEditor.js +9 -8
  57. package/dist/widgets/ApprovalOverridesEditor.js +11 -10
  58. package/dist/widgets/ApprovalStepper.js +2 -2
  59. package/dist/widgets/AutocompleteField.js +9 -8
  60. package/dist/widgets/ColumnBoard.js +2 -2
  61. package/dist/widgets/DiffView.js +2 -2
  62. package/dist/widgets/Disclosure.js +2 -2
  63. package/dist/widgets/EventCalendar.d.ts +14 -10
  64. package/dist/widgets/EventCalendar.js +5 -3
  65. package/dist/widgets/FileDropzone.js +7 -7
  66. package/dist/widgets/ImageLightbox.js +5 -5
  67. package/dist/widgets/InlineEdit.js +2 -2
  68. package/dist/widgets/JsonField.js +2 -2
  69. package/dist/widgets/OptionSchemaEditor.js +3 -3
  70. package/dist/widgets/OptionValueFields.js +3 -3
  71. package/dist/widgets/OrgChart.js +3 -3
  72. package/dist/widgets/OrgChartBoard.d.ts +57 -4
  73. package/dist/widgets/OrgChartBoard.js +8 -8
  74. package/dist/widgets/PeriodFilter.js +6 -5
  75. package/dist/widgets/PermissionMatrixEditor.js +4 -4
  76. package/dist/widgets/PositionSelect.js +4 -4
  77. package/dist/widgets/PrintSheet.js +2 -2
  78. package/dist/widgets/ProfileEditDiffCard.js +4 -4
  79. package/dist/widgets/QRDisplay.js +4 -4
  80. package/dist/widgets/RankBoard.js +6 -6
  81. package/dist/widgets/RecordSheet.d.ts +48 -1
  82. package/dist/widgets/RecordSheet.js +2 -1
  83. package/dist/widgets/RoleMemberPicker.js +5 -5
  84. package/dist/widgets/SearchableMultiPicker.js +7 -6
  85. package/dist/widgets/SecureScreen.js +2 -2
  86. package/dist/widgets/StagePeriodEditor.js +6 -5
  87. package/dist/widgets/TagInput.js +2 -2
  88. package/dist/widgets/TagMultiSelect.js +4 -4
  89. package/dist/widgets/Timeline.js +3 -3
  90. package/dist/widgets/TreePicker.js +8 -7
  91. package/dist/widgets/TreeView.js +7 -6
  92. package/dist/widgets/index.d.ts +1 -0
  93. package/dist/widgets/index.js +76 -75
  94. package/package.json +1 -1
  95. package/dist/chunk-IB2ZPUTF.js +0 -172
@@ -1,8 +1,10 @@
1
+ import { useDismiss, usePopoverAnchor, usePanelPointer, usePortalTo, CalendarNav, KO_CALENDAR_NAV_LOCALE, CalendarZoom, anchorStyle, AnchoredPopoverStyles } from './chunk-QVNJMZUF.js';
2
+ import { tabbablesIn } from './chunk-R2ORCOTG.js';
1
3
  import { HoistedStyle } from './chunk-RIZRM7OO.js';
2
- import { useIsMobile } from './chunk-GSM664TX.js';
3
- import { SegmentedControl, IconButton, Button, Tag, EmptyState, Icon, Badge } from './chunk-YYAGE733.js';
4
+ import { useIsMobile } from './chunk-TAVKGYH5.js';
5
+ import { SegmentedControl, Button, Tag, EmptyState, Icon, Badge } from './chunk-OWM7E55U.js';
4
6
  import { boxed } from './chunk-3JTBOABA.js';
5
- import { useState, useMemo } from 'react';
7
+ import { useState, useMemo, useRef, useCallback } from 'react';
6
8
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
7
9
 
8
10
  var DAY_MS = 864e5;
@@ -185,6 +187,20 @@ var VIEW_ITEMS = [
185
187
  { value: "agenda", label: "\uC77C\uC815" }
186
188
  ];
187
189
  var VIEW_VALUES = ["month", "week", "day", "agenda"];
190
+ var VIEW_NAV = {
191
+ month: { small: "month", big: "year", keepDay: false, labels: { prevBig: "\uC774\uC804 \uD574", prev: "\uC774\uC804 \uB2EC", next: "\uB2E4\uC74C \uB2EC", nextBig: "\uB2E4\uC74C \uD574" } },
192
+ week: { small: "week", big: "month", keepDay: true, labels: { prevBig: "\uC774\uC804 \uB2EC", prev: "\uC774\uC804 \uC8FC", next: "\uB2E4\uC74C \uC8FC", nextBig: "\uB2E4\uC74C \uB2EC" } },
193
+ day: { small: "day", big: "week", keepDay: true, labels: { prevBig: "\uC774\uC804 \uC8FC", prev: "\uC774\uC804 \uB0A0", next: "\uB2E4\uC74C \uB0A0", nextBig: "\uB2E4\uC74C \uC8FC" } },
194
+ agenda: { small: "month", big: "year", keepDay: false, labels: { prevBig: "\uC774\uC804 \uD574", prev: "\uC774\uC804 \uB2EC", next: "\uB2E4\uC74C \uB2EC", nextBig: "\uB2E4\uC74C \uD574" } }
195
+ };
196
+ var addMonthsKeepDay = (ts, amount) => {
197
+ const d = new Date(ts);
198
+ const month = d.getMonth() + amount;
199
+ const lastDay = new Date(d.getFullYear(), month + 1, 0).getDate();
200
+ return new Date(d.getFullYear(), month, Math.min(d.getDate(), lastDay)).getTime();
201
+ };
202
+ var shiftBy = (ts, unit, dir, keepDay) => unit === "day" ? addDays(ts, dir) : unit === "week" ? addDays(ts, dir * 7) : (keepDay ? addMonthsKeepDay : addMonths)(ts, dir * (unit === "month" ? 1 : 12));
203
+ var ZOOM_HEIGHT = 200;
188
204
  function normalizeViews(views) {
189
205
  if (!Array.isArray(views)) return VIEW_ITEMS;
190
206
  const seen = /* @__PURE__ */ new Set();
@@ -203,6 +219,11 @@ var cellBorder = "1px solid var(--wp-border-subtle)";
203
219
  var EVCAL_CSS = `
204
220
  .wp-evcal{display:flex;flex-direction:column;gap:var(--wp-space-3);min-width:0}
205
221
  .wp-evcal__toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:var(--wp-space-2)}
222
+ .wp-evcal__tools{display:flex;align-items:center;gap:var(--wp-space-2);flex:none}
223
+ .wp-evcal__nav{display:flex;align-items:center;justify-content:center;flex:1 1 auto;min-width:0}
224
+ .wp-evcal__nav .wp-calnav{flex:0 1 auto}
225
+ .wp-evcal__nav .wp-calnav__title{min-width:7.5em}
226
+ .wp-evcal__zoom{padding:var(--wp-space-3)}
206
227
  .wp-evcal__types{display:flex;flex-wrap:wrap;align-items:center;gap:var(--wp-space-1);margin-left:auto}
207
228
  .wp-evcal__item{display:flex;align-items:center;gap:var(--wp-space-3);width:100%;padding:var(--wp-space-3) var(--wp-space-4);border-radius:var(--wp-radius-md);cursor:pointer;text-align:left;min-width:0;transition:background var(--wp-duration-fast),border-color var(--wp-duration-fast)}
208
229
  .wp-evcal__item-bar{width:4px;height:26px;flex:none;border-radius:var(--wp-radius-pill)}
@@ -216,6 +237,9 @@ var EVCAL_CSS = `
216
237
  .wp-evcal--month .wp-evcal__bar::before{content:"";position:absolute;left:0;right:0;top:50%;height:32px;margin-top:-16px;z-index:-1}
217
238
  }
218
239
  @media screen and (max-width:767.98px){
240
+ .wp-evcal__nav{order:-1;flex:1 1 100%}
241
+ .wp-evcal__nav .wp-calnav{flex:1 1 auto}
242
+ .wp-evcal__tools{flex:1 1 100%;justify-content:space-between}
219
243
  .wp-evcal__types{flex:1 1 100%;margin-left:0;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;padding-bottom:2px}
220
244
  .wp-evcal__types::-webkit-scrollbar{display:none}
221
245
  .wp-evcal__types>*{flex:none}
@@ -283,10 +307,33 @@ var EventCalendarImpl = ({
283
307
  () => dayEvents.filter((e) => !hiddenTypes.has(e.type)),
284
308
  [dayEvents, hiddenTypes]
285
309
  );
286
- const move = (dir) => {
287
- if (activeView === "week") setDate(addDays(anchor, dir * 7));
288
- else if (activeView === "day") setDate(addDays(anchor, dir));
289
- else setDate(addMonths(anchor, dir));
310
+ const nav = VIEW_NAV[activeView];
311
+ const step = (which) => {
312
+ const dir = which === "prev" || which === "prevBig" ? -1 : 1;
313
+ setDate(shiftBy(anchor, which === "prev" || which === "next" ? nav.small : nav.big, dir, nav.keepDay));
314
+ };
315
+ const titleRef = useRef(null);
316
+ const zoomPopRef = useRef(null);
317
+ const [zoomOpen, setZoomOpen] = useState(false);
318
+ const closeZoom = useCallback((refocus) => {
319
+ setZoomOpen(false);
320
+ if (refocus) titleRef.current?.focus();
321
+ }, []);
322
+ const dismissZoom = useCallback((reason) => closeZoom(reason === "escape"), [closeZoom]);
323
+ useDismiss(zoomOpen, titleRef, zoomPopRef, dismissZoom);
324
+ const zoomAnchor = usePopoverAnchor(zoomOpen, titleRef, zoomPopRef, ZOOM_HEIGHT);
325
+ const zoomPointer = usePanelPointer(zoomPopRef);
326
+ const navRef = useRef(null);
327
+ const navPointer = usePanelPointer(navRef);
328
+ const portal = usePortalTo();
329
+ const anchorDate = new Date(anchor);
330
+ const anchorMonthIdx = anchorDate.getFullYear() * 12 + anchorDate.getMonth();
331
+ const pickMonth = (idx) => {
332
+ const year = Math.floor(idx / 12);
333
+ const month = idx % 12;
334
+ const lastDay = new Date(year, month + 1, 0).getDate();
335
+ setDate(new Date(year, month, Math.min(anchorDate.getDate(), lastDay)).getTime());
336
+ closeZoom(true);
290
337
  };
291
338
  const headline = (() => {
292
339
  const d = new Date(anchor);
@@ -429,25 +476,30 @@ var EventCalendarImpl = ({
429
476
  };
430
477
  return /* @__PURE__ */ jsxs("div", { className: `wp-evcal wp-evcal--${activeView}`, children: [
431
478
  /* @__PURE__ */ jsxs("div", { className: "wp-evcal__toolbar", children: [
432
- /* @__PURE__ */ jsx(
433
- SegmentedControl,
434
- {
435
- items: [...viewItems],
436
- value: activeView,
437
- onChange: (v) => setView(v)
438
- }
439
- ),
440
- /* @__PURE__ */ jsx(
441
- "span",
479
+ /* @__PURE__ */ jsxs("div", { className: "wp-evcal__tools", children: [
480
+ /* @__PURE__ */ jsx(
481
+ SegmentedControl,
482
+ {
483
+ items: [...viewItems],
484
+ value: activeView,
485
+ onChange: (v) => setView(v)
486
+ }
487
+ ),
488
+ /* @__PURE__ */ jsx(Button, { size: "sm", variant: "secondary", onClick: () => setDate(today), children: "\uC624\uB298" })
489
+ ] }),
490
+ /* @__PURE__ */ jsx("div", { className: "wp-evcal__nav", ref: navRef, onClick: navPointer.panelProps.onClick, children: /* @__PURE__ */ jsx(
491
+ CalendarNav,
442
492
  {
443
- "aria-hidden": true,
444
- style: { width: 1, height: 20, background: "var(--wp-border-subtle)" }
493
+ size: "md",
494
+ title: headline,
495
+ labels: nav.labels,
496
+ onStep: step,
497
+ onZoomOut: () => zoomOpen ? closeZoom(false) : setZoomOpen(true),
498
+ zoomLabel: KO_CALENDAR_NAV_LOCALE.zoomLabel,
499
+ titleRef,
500
+ titleProps: { "aria-haspopup": "dialog", "aria-expanded": zoomOpen }
445
501
  }
446
- ),
447
- /* @__PURE__ */ jsx(IconButton, { icon: "chevron-left", label: "\uC774\uC804", onClick: () => move(-1) }),
448
- /* @__PURE__ */ jsx(Button, { size: "sm", variant: "secondary", onClick: () => setDate(today), children: "\uC624\uB298" }),
449
- /* @__PURE__ */ jsx(IconButton, { icon: "chevron-right", label: "\uB2E4\uC74C", onClick: () => move(1) }),
450
- /* @__PURE__ */ jsx("h3", { className: "wp-h4", style: { margin: "0 0 0 var(--wp-space-2)" }, children: headline }),
502
+ ) }),
451
503
  types && types.length > 0 && /* @__PURE__ */ jsx("span", { className: "wp-evcal__types", role: "group", "aria-label": "\uC77C\uC815 \uC720\uD615", children: types.map((t) => {
452
504
  const off = hiddenTypes.has(t.value);
453
505
  const color = dayEvents.find((e) => e.type === t.value)?.color ?? t.color;
@@ -732,9 +784,51 @@ var EventCalendarImpl = ({
732
784
  ]
733
785
  }
734
786
  ),
735
- /* @__PURE__ */ jsx(HoistedStyle, { id: "wp-evcal", css: EVCAL_CSS })
787
+ portal(
788
+ zoomAnchor,
789
+ /* @__PURE__ */ jsx(
790
+ "div",
791
+ {
792
+ ref: zoomPopRef,
793
+ className: "wp-anchored-pop wp-evcal__zoom",
794
+ style: anchorStyle(zoomAnchor),
795
+ role: "dialog",
796
+ "aria-label": KO_CALENDAR_NAV_LOCALE.monthGridLabel,
797
+ ...zoomPointer.panelProps,
798
+ onBlur: (event) => {
799
+ const next = event.relatedTarget;
800
+ if (!(next instanceof Node) || zoomPopRef.current?.contains(next) || next === titleRef.current) return;
801
+ if (zoomPointer.interacting() && zoomPopRef.current && next.contains(zoomPopRef.current)) return;
802
+ if (titleRef.current && next.contains(titleRef.current)) return;
803
+ closeZoom(false);
804
+ },
805
+ onKeyDown: (event) => {
806
+ if (event.key !== "Tab" || !zoomPopRef.current) return;
807
+ const stops = tabbablesIn(zoomPopRef.current);
808
+ const at = stops.indexOf(document.activeElement);
809
+ const atEdge = event.shiftKey ? at <= 0 : at === stops.length - 1 || at < 0;
810
+ if (!atEdge) return;
811
+ event.preventDefault();
812
+ closeZoom(true);
813
+ },
814
+ children: /* @__PURE__ */ jsx(
815
+ CalendarZoom,
816
+ {
817
+ monthIndex: anchorMonthIdx,
818
+ selectedMonthIndexes: [anchorMonthIdx],
819
+ onPick: pickMonth,
820
+ onExit: () => closeZoom(true),
821
+ autoFocus: true,
822
+ locale: KO_CALENDAR_NAV_LOCALE
823
+ }
824
+ )
825
+ }
826
+ )
827
+ ),
828
+ /* @__PURE__ */ jsx(HoistedStyle, { id: "wp-evcal", css: EVCAL_CSS }),
829
+ /* @__PURE__ */ jsx(AnchoredPopoverStyles, {})
736
830
  ] });
737
831
  };
738
832
  var EventCalendar = boxed(EventCalendarImpl, "EventCalendar");
739
833
 
740
- export { EventCalendar, statusToneOf };
834
+ export { EventCalendar, VIEW_NAV, statusToneOf };
@@ -1,5 +1,5 @@
1
- import { DateRangePicker } from './chunk-FP32LNFK.js';
2
- import { SegmentedControl, Select } from './chunk-YYAGE733.js';
1
+ import { DateRangePicker } from './chunk-KAQ2VZBM.js';
2
+ import { SegmentedControl, Select } from './chunk-OWM7E55U.js';
3
3
  import { boxed } from './chunk-3JTBOABA.js';
4
4
  import { useState, useMemo } from 'react';
5
5
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -1,5 +1,5 @@
1
- import { useOverlayLayer, OverlayContainerContext, getOverlayRoot } from './chunk-BITS7UJY.js';
2
- import { IconButton } from './chunk-YYAGE733.js';
1
+ import { useOverlayLayer, OverlayContainerContext, getOverlayRoot } from './chunk-R2ORCOTG.js';
2
+ import { IconButton } from './chunk-OWM7E55U.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 { IconButton, Input } from './chunk-YYAGE733.js';
1
+ import { IconButton, Input } from './chunk-OWM7E55U.js';
2
2
  import { boxed } from './chunk-3JTBOABA.js';
3
3
  import { useState, useRef, useEffect, useCallback } from 'react';
4
4
  import { jsxs, jsx } from 'react/jsx-runtime';