@dcs-tech/ui 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/CHANGELOG.md +496 -0
  2. package/README.md +56 -5
  3. package/dist/{ChartImageMenu-AsfvmdTH.js → ChartImageMenu-3OfqNFyt.js} +557 -546
  4. package/dist/{ChartView-CW3m4Z_1.js → ChartView-n4G5_2ro.js} +35 -31
  5. package/dist/{SummaryChart-CxRjK_HU.js → SummaryChart-i6fOdrDM.js} +2 -2
  6. package/dist/{SummaryImage-DeYs2Jgj.js → SummaryImage-CCt5ozD9.js} +2 -2
  7. package/dist/{SummarySeeAll-CrmROhBv.js → SummarySeeAll-BY8knsRe.js} +5 -5
  8. package/dist/assets/fileTask.worker--Q3rI3Bn.js +1 -0
  9. package/dist/{columnValue-DwUqueZ6.js → columnValue-74XDBcVF.js} +219 -192
  10. package/dist/{exportContext-BKFnNQ0q.js → exportContext-C52ZuHd8.js} +2 -2
  11. package/dist/{exportEngine-CZ22cX7a.js → exportEngine-BmDly7iw.js} +3 -3
  12. package/dist/file-worker.js +1 -1
  13. package/dist/{fileActions-COf5Q4Eg.js → fileActions-CFNO14Aj.js} +1 -1
  14. package/dist/{geometry-yZmKN662.js → geometry-DG134nYI.js} +379 -273
  15. package/dist/index.js +12808 -9621
  16. package/dist/{labels-CnqqTrne.js → labels-BPItSeRU.js} +2 -0
  17. package/dist/{runFileTask--4YjQH7Y.js → runFileTask-BIZTFnZP.js} +55 -39
  18. package/dist/scrollArea-D84Cwm4o.js +310 -0
  19. package/dist/style.css +1 -1
  20. package/dist/{summaryChartData-CARqGRUl.js → summaryChartData-BiQYJbYZ.js} +8 -2
  21. package/dist/types/components/Alert/Alert.d.ts +16 -0
  22. package/dist/types/components/Alert/index.d.ts +2 -0
  23. package/dist/types/components/Card/Card.d.ts +4 -3
  24. package/dist/types/components/Card/index.d.ts +1 -1
  25. package/dist/types/components/Charts/Funnel.d.ts +2 -1
  26. package/dist/types/components/Charts/chartImage.d.ts +1 -0
  27. package/dist/types/components/ChipInput/ChipTags.d.ts +3 -0
  28. package/dist/types/components/CommandPalette/CommandPaletteTrigger.d.ts +9 -0
  29. package/dist/types/components/CommandPalette/index.d.ts +2 -0
  30. package/dist/types/components/DataTable/TablePagination.d.ts +1 -1
  31. package/dist/types/components/DataTable/TableToolbar.d.ts +2 -1
  32. package/dist/types/components/DataTable/TableView.d.ts +1 -0
  33. package/dist/types/components/DataTable/cards/cardFields.d.ts +1 -0
  34. package/dist/types/components/DataTable/defaults.d.ts +4 -0
  35. package/dist/types/components/DataTable/index.d.ts +1 -1
  36. package/dist/types/components/DataTable/labels.d.ts +2 -0
  37. package/dist/types/components/DataTable/types.d.ts +19 -2
  38. package/dist/types/components/DataTable/ui-local/TableReorderList.d.ts +13 -0
  39. package/dist/types/components/DataTable/ui.d.ts +2 -1
  40. package/dist/types/components/DataTable/useTable.d.ts +1 -0
  41. package/dist/types/components/DatePicker/PeriodGrid.d.ts +13 -0
  42. package/dist/types/components/DatePicker/PeriodPicker.d.ts +19 -0
  43. package/dist/types/components/DatePicker/index.d.ts +1 -1
  44. package/dist/types/components/Dialog/dialogSlots.d.ts +9 -0
  45. package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +8 -0
  46. package/dist/types/components/FieldWrapper/index.d.ts +1 -1
  47. package/dist/types/components/Fields/index.d.ts +1 -1
  48. package/dist/types/components/Image/ImageEditor.d.ts +21 -0
  49. package/dist/types/components/Image/ImagePicker.d.ts +10 -1
  50. package/dist/types/components/Image/imageRender.d.ts +33 -0
  51. package/dist/types/components/Image/index.d.ts +3 -1
  52. package/dist/types/components/Image/prepareImage.d.ts +4 -3
  53. package/dist/types/components/Link/Link.d.ts +22 -0
  54. package/dist/types/components/Link/index.d.ts +2 -0
  55. package/dist/types/components/NavList/NavList.d.ts +13 -0
  56. package/dist/types/components/NavList/index.d.ts +2 -0
  57. package/dist/types/components/PageProgress/PageProgress.d.ts +10 -0
  58. package/dist/types/components/PageProgress/index.d.ts +2 -0
  59. package/dist/types/components/Pagination/Pagination.d.ts +19 -0
  60. package/dist/types/components/Pagination/index.d.ts +2 -0
  61. package/dist/types/components/Popover/Popover.d.ts +1 -1
  62. package/dist/types/components/Popover/floatingPosition.d.ts +4 -0
  63. package/dist/types/components/ReorderList/ReorderGroup.d.ts +16 -0
  64. package/dist/types/components/ReorderList/ReorderList.d.ts +55 -0
  65. package/dist/types/components/ReorderList/crossListDrag.d.ts +61 -0
  66. package/dist/types/components/ReorderList/index.d.ts +5 -0
  67. package/dist/types/components/ReorderList/useReorderDrag.d.ts +28 -0
  68. package/dist/types/components/Tooltip/useTooltip.d.ts +4 -0
  69. package/dist/types/components/UIProvider/UILabelsContext.d.ts +86 -0
  70. package/dist/types/core/hooks/index.d.ts +1 -0
  71. package/dist/types/core/hooks/useMeasuredState.d.ts +1 -0
  72. package/dist/types/core/logic/alert.logic.d.ts +3 -0
  73. package/dist/types/core/logic/commandPalette.logic.d.ts +2 -0
  74. package/dist/types/core/logic/datePicker.logic.d.ts +12 -0
  75. package/dist/types/core/logic/fieldWrapper.logic.d.ts +6 -1
  76. package/dist/types/core/logic/imageEditor.logic.d.ts +132 -0
  77. package/dist/types/core/logic/imageTransform.logic.d.ts +57 -0
  78. package/dist/types/core/logic/index.d.ts +9 -0
  79. package/dist/types/core/logic/inertProps.d.ts +3 -0
  80. package/dist/types/core/logic/pageProgress.logic.d.ts +3 -0
  81. package/dist/types/core/logic/pagination.logic.d.ts +7 -0
  82. package/dist/types/core/logic/periodPicker.logic.d.ts +86 -0
  83. package/dist/types/core/logic/reorder.logic.d.ts +49 -0
  84. package/dist/types/core/types/chipinput.types.d.ts +3 -1
  85. package/dist/types/core/types/collapsible.types.d.ts +3 -0
  86. package/dist/types/core/types/datePicker.types.d.ts +7 -0
  87. package/dist/types/core/types/field.types.d.ts +6 -3
  88. package/dist/types/core/types/fieldWrapper.types.d.ts +2 -0
  89. package/dist/types/core/types/fields.types.d.ts +6 -1
  90. package/dist/types/core/types/form.types.d.ts +1 -0
  91. package/dist/types/core/types/format.types.d.ts +2 -0
  92. package/dist/types/core/types/input.types.d.ts +2 -0
  93. package/dist/types/core/types/navigation.types.d.ts +1 -0
  94. package/dist/types/core/types/select.types.d.ts +2 -6
  95. package/dist/types/core/types/suggest.types.d.ts +2 -0
  96. package/dist/types/index.d.ts +25 -7
  97. package/package.json +3 -2
  98. package/dist/assets/fileTask.worker-BHT1olUk.js +0 -1
  99. package/dist/scrollArea-Dd2dNMV4.js +0 -236
  100. package/dist/types/components/DataTable/ui-local/DragAndDropList/DragAndDropList.d.ts +0 -4
  101. package/dist/types/components/DataTable/ui-local/DragAndDropList/index.d.ts +0 -3
  102. package/dist/types/components/DataTable/ui-local/DragAndDropList/types.d.ts +0 -70
@@ -1,236 +0,0 @@
1
- "use client";
2
- import { Nn as e, wn as t } from "./geometry-yZmKN662.js";
3
- import { n, t as r } from "./labels-CnqqTrne.js";
4
- import { createContext as i, useCallback as ee, useContext as a, useEffect as o, useId as te, useMemo as s, useRef as c, useState as l } from "react";
5
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
6
- import { createPortal as ne } from "react-dom";
7
- // src/components/Dialog/dialogOpen.tsx
8
- var f = i(null), p = i(0), m = ({ children: e }) => {
9
- let [t, n] = l(0), r = s(() => () => {
10
- n((e) => e + 1);
11
- let e = !1;
12
- return () => {
13
- e || (e = !0, n((e) => e - 1));
14
- };
15
- }, []);
16
- return /* @__PURE__ */ u(f.Provider, {
17
- value: r,
18
- children: /* @__PURE__ */ u(p.Provider, {
19
- value: t,
20
- children: e
21
- })
22
- });
23
- };
24
- function h(e) {
25
- let t = a(f);
26
- o(() => e && t ? t() : void 0, [e, t]);
27
- }
28
- var g = () => a(p), _ = () => a(p) > 0, v = {
29
- root: "_root_1rswg_7",
30
- nonModal: "_nonModal_1rswg_30",
31
- panel: "_panel_1rswg_3",
32
- center: "_center_1rswg_41",
33
- right: "_right_1rswg_42",
34
- left: "_left_1rswg_43",
35
- top: "_top_1rswg_44",
36
- bottom: "_bottom_1rswg_45",
37
- sm: "_sm_1rswg_86",
38
- md: "_md_1rswg_87",
39
- lg: "_lg_1rswg_88",
40
- xl: "_xl_1rswg_89",
41
- full: "_full_1rswg_90",
42
- header: "_header_1rswg_96",
43
- headText: "_headText_1rswg_106",
44
- title: "_title_1rswg_108",
45
- subtitle: "_subtitle_1rswg_114",
46
- body: "_body_1rswg_120",
47
- flush: "_flush_1rswg_128",
48
- footer: "_footer_1rswg_130",
49
- close: "_close_1rswg_141",
50
- dialogPop: "_dialogPop_1rswg_1",
51
- slideFromRight: "_slideFromRight_1rswg_1",
52
- slideFromLeft: "_slideFromLeft_1rswg_1",
53
- slideFromTop: "_slideFromTop_1rswg_1",
54
- slideFromBottom: "_slideFromBottom_1rswg_1",
55
- backdropIn: "_backdropIn_1rswg_1",
56
- closing: "_closing_1rswg_168"
57
- }, y = 0, b = null, x = (e) => {
58
- if (typeof document < "u") {
59
- if (y === 0) {
60
- let t = document.body;
61
- b = {
62
- overflow: t.style.overflow,
63
- paddingRight: t.style.paddingRight
64
- };
65
- let n = window.innerWidth - document.documentElement.clientWidth;
66
- if (e && n > 0) {
67
- let e = parseFloat(window.getComputedStyle(t).paddingRight) || 0;
68
- t.style.paddingRight = `${e + n}px`;
69
- }
70
- t.style.overflow = "hidden";
71
- }
72
- y += 1;
73
- }
74
- }, re = () => {
75
- typeof document < "u" && (y = Math.max(0, y - 1), y === 0 && b && (document.body.style.overflow = b.overflow, document.body.style.paddingRight = b.paddingRight, b = null));
76
- }, ie = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches, S = /* @__PURE__ */ d("svg", {
77
- width: "16",
78
- height: "16",
79
- viewBox: "0 0 24 24",
80
- fill: "none",
81
- stroke: "currentColor",
82
- strokeWidth: "2",
83
- strokeLinecap: "round",
84
- "aria-hidden": "true",
85
- children: [/* @__PURE__ */ u("line", {
86
- x1: "18",
87
- y1: "6",
88
- x2: "6",
89
- y2: "18"
90
- }), /* @__PURE__ */ u("line", {
91
- x1: "6",
92
- y1: "6",
93
- x2: "18",
94
- y2: "18"
95
- })]
96
- }), ae = 0, C = ({ open: n, onClose: r, onBeforeClose: i, onEscKeyDown: a, onOverlayClick: s, onAnimationEnd: f, children: p, title: m, subtitle: g, footer: _, modal: y = !0, placement: b = "center", size: C = "md", closeOnBackdrop: w = !0, closeOnEscape: T = !0, showCloseButton: E = !0, closeIcon: D, closeIconId: O, blockScroll: k = !0, reserveScrollBarGap: A = !0, initialFocusRef: j, container: oe, animationDuration: se = 200, padded: ce = !0, classNames: M = {}, styleSlots: N = {}, className: P = "", style: F, role: I = "dialog", id: L, "aria-label": R, "aria-labelledby": z, "aria-describedby": B }) => {
97
- let V = e(), H = c(null), [U, W] = l(null), G = te(), [K, q] = l(n), [le, J] = l(!1), Y = c(null), X = ie() ? 0 : se;
98
- h(K), o(() => {
99
- n ? (Y.current &&= (clearTimeout(Y.current), null), J(!1), q(!0)) : K && (J(!0), Y.current = setTimeout(() => {
100
- H.current?.close(), q(!1), J(!1), f?.();
101
- }, X));
102
- }, [n]), o(() => () => {
103
- Y.current && clearTimeout(Y.current);
104
- }, []);
105
- let Z = ee(() => {
106
- i && i() === !1 || r?.();
107
- }, [i, r]);
108
- o(() => {
109
- let e = H.current;
110
- if (e && K && (e.open || (y && (e.dataset.modalOrder = String(++ae)), y ? e.showModal() : e.show(), j?.current && j.current.focus({ focusVisible: !0 })), k && y)) return x(A), () => re();
111
- }, [
112
- K,
113
- y,
114
- k,
115
- A,
116
- j
117
- ]), o(() => {
118
- let e = H.current;
119
- if (!e || !K) return;
120
- let t = (e) => {
121
- e.preventDefault(), a?.(e), T && Z();
122
- };
123
- return e.addEventListener("cancel", t), () => e.removeEventListener("cancel", t);
124
- }, [
125
- K,
126
- T,
127
- Z,
128
- a
129
- ]);
130
- let Q = c(!1), ue = (e) => {
131
- Q.current = e.target === H.current;
132
- }, de = (e) => {
133
- let t = Q.current && e.target === H.current;
134
- Q.current = !1, t && (s?.(e), w && Z());
135
- };
136
- if (!K) return null;
137
- let fe = m !== void 0 || g !== void 0 || E, pe = z ?? (m !== void 0 && !R ? G : void 0), me = /* @__PURE__ */ u("dialog", {
138
- ref: (e) => {
139
- H.current = e, W(e);
140
- },
141
- id: L,
142
- "data-modal": y ? "" : void 0,
143
- className: [
144
- v.root,
145
- v[b],
146
- v[C],
147
- y ? "" : v.nonModal,
148
- le ? v.closing : "",
149
- M.root,
150
- P
151
- ].filter(Boolean).join(" "),
152
- style: {
153
- "--dialog-anim": `${X}ms`,
154
- ...N.root,
155
- ...F
156
- },
157
- role: I,
158
- "aria-label": R,
159
- "aria-labelledby": pe,
160
- "aria-describedby": B,
161
- "aria-modal": y || void 0,
162
- onPointerDown: ue,
163
- onPointerUp: de,
164
- children: /* @__PURE__ */ u(t.Provider, {
165
- value: U,
166
- children: /* @__PURE__ */ d("div", {
167
- className: [v.panel, M.panel].filter(Boolean).join(" "),
168
- style: N.panel,
169
- children: [
170
- fe && /* @__PURE__ */ d("div", {
171
- className: [v.header, M.header].filter(Boolean).join(" "),
172
- style: N.header,
173
- children: [/* @__PURE__ */ d("span", {
174
- className: v.headText,
175
- children: [m !== void 0 && /* @__PURE__ */ u("span", {
176
- className: v.title,
177
- id: G,
178
- children: m
179
- }), g !== void 0 && /* @__PURE__ */ u("span", {
180
- className: v.subtitle,
181
- children: g
182
- })]
183
- }), E && /* @__PURE__ */ u("button", {
184
- type: "button",
185
- id: O,
186
- className: [v.close, M.closeButton].filter(Boolean).join(" "),
187
- style: N.closeButton,
188
- onClick: Z,
189
- "aria-label": V.dialog.close,
190
- children: D ?? S
191
- })]
192
- }),
193
- p !== void 0 && /* @__PURE__ */ u("div", {
194
- className: [
195
- v.body,
196
- ce ? "scroll-fade-y scroll-gutter" : `${v.flush} scroll-fade-y`,
197
- M.body
198
- ].filter(Boolean).join(" "),
199
- style: N.body,
200
- children: p
201
- }),
202
- _ !== void 0 && /* @__PURE__ */ u("div", {
203
- className: [v.footer, M.footer].filter(Boolean).join(" "),
204
- style: N.footer,
205
- children: _
206
- })
207
- ]
208
- })
209
- })
210
- }), $ = oe ?? (typeof document > "u" ? null : document.body);
211
- return $ ? ne(me, $) : null;
212
- };
213
- C.displayName = "Dialog";
214
- var w = i({
215
- authorize: () => !0,
216
- exportOptions: {},
217
- serverMode: !1,
218
- labels: r,
219
- format: n(),
220
- text: {
221
- yes: r.yes,
222
- no: r.no
223
- }
224
- });
225
- function T() {
226
- return a(w);
227
- }
228
- function E() {
229
- return a(w).labels;
230
- }
231
- function D(e, t, n) {
232
- return !e || e(t, n) !== !1;
233
- }
234
- // src/components/DataTable/layout/scrollArea.ts
235
- var O = "dt-scroll-area scroll-fade-y scroll-gutter", k = "dt-scroll-area scroll-fade-x scroll-fade-y scroll-gutter";
236
- export { E as a, m as c, D as i, _ as l, O as n, T as o, w as r, C as s, k as t, g as u };
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { type DragAndDropListProps, type DragAndDropItem } from './types';
3
- import './DragAndDropList.css';
4
- export default function DragAndDropList<T = DragAndDropItem>({ state, setState, renderKeys, onReorder, renderItem, getItemKey, className, showDragHandle, isItemDraggable, dragHandleProps, emptyMessage, showManualButtons, showSerialNumber, maxHeight, enableScrolling }: DragAndDropListProps<T>): React.JSX.Element;
@@ -1,3 +0,0 @@
1
- export { default } from './DragAndDropList';
2
- export { default as DragAndDropList } from './DragAndDropList';
3
- export * from './types';
@@ -1,70 +0,0 @@
1
- import { type CSSProperties, type ReactNode, type MouseEvent, type TouchEvent, type DragEvent } from 'react';
2
- export type DragAndDropItem = any;
3
- export type GetItemKeyFn<T = DragAndDropItem> = (item: T, index: number) => string | number;
4
- export type IsItemDraggableFn<T = DragAndDropItem> = (item: T, index: number) => boolean;
5
- export type OnReorderFn<T = DragAndDropItem> = (newItems: T[]) => void;
6
- export type RenderItemFn<T = DragAndDropItem> = (item: T, index: number, isDragging: boolean, isDragOver: boolean, dragHandle: ReactNode, moveItem: (fromIndex: number, toIndex: number) => void) => ReactNode;
7
- export interface DragHandleProps {
8
- className?: string;
9
- style?: CSSProperties;
10
- title?: string;
11
- 'aria-label'?: string;
12
- onClick?: (e: MouseEvent<HTMLSpanElement>) => void;
13
- onMouseDown?: (e: MouseEvent<HTMLSpanElement>) => void;
14
- }
15
- export interface DragAndDropListProps<T = DragAndDropItem> {
16
- state: T[];
17
- setState?: (items: T[]) => void;
18
- renderKeys?: string | string[];
19
- onReorder?: OnReorderFn<T>;
20
- renderItem?: RenderItemFn<T>;
21
- getItemKey?: GetItemKeyFn<T>;
22
- className?: string;
23
- showDragHandle?: boolean;
24
- isItemDraggable?: IsItemDraggableFn<T>;
25
- dragHandleProps?: DragHandleProps;
26
- emptyMessage?: string;
27
- showManualButtons?: boolean;
28
- showSerialNumber?: boolean;
29
- maxHeight?: string | number;
30
- enableScrolling?: boolean;
31
- }
32
- export interface DragAndDropState {
33
- draggedIndex: number | null;
34
- dragOverIndex: number | null;
35
- isDragging: boolean;
36
- touchStartY: number | null;
37
- touchCurrentY: number | null;
38
- touchStartX: number | null;
39
- isDragReady: boolean;
40
- touchStartTime: number | null;
41
- }
42
- export type AutoScrollDirection = 'up' | 'down';
43
- export interface TouchEventData {
44
- clientX: number;
45
- clientY: number;
46
- startY: number;
47
- startX: number;
48
- startTime: number;
49
- }
50
- export interface DragEventHandlers {
51
- handleDragStart: (e: DragEvent<HTMLDivElement>, index: number) => void;
52
- handleDragEnd: () => void;
53
- handleDragOver: (e: DragEvent<HTMLDivElement>) => void;
54
- handleDragEnter: (e: DragEvent<HTMLDivElement>, index: number) => void;
55
- handleDragLeave: (e: DragEvent<HTMLDivElement>) => void;
56
- handleDrop: (e: DragEvent<HTMLDivElement>, dropIndex: number) => void;
57
- }
58
- export interface TouchEventHandlers {
59
- handleTouchStart: (e: TouchEvent<HTMLDivElement>, index: number) => void;
60
- handleTouchMove: (e: TouchEvent<HTMLDivElement>) => void;
61
- handleTouchEnd: () => void;
62
- }
63
- export interface ItemRenderContext<T = DragAndDropItem> {
64
- item: T;
65
- index: number;
66
- isCurrentDragging: boolean;
67
- isCurrentDragOver: boolean;
68
- isDraggable: boolean;
69
- itemKey: string | number;
70
- }