@dmsi/wedgekit-react 0.0.475 → 0.0.477

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 (77) hide show
  1. package/dist/{chunk-IG2YUDHI.js → chunk-24K4HHV5.js} +4 -4
  2. package/dist/{chunk-OEMLNGE2.js → chunk-4Q7T4GJ2.js} +2 -2
  3. package/dist/chunk-4UH72JT2.js +104 -0
  4. package/dist/{chunk-KJNK7KEV.js → chunk-QMSPTD6L.js} +1 -1
  5. package/dist/{chunk-GTPSPGSJ.js → chunk-WIDUWFLX.js} +761 -47
  6. package/dist/components/Accordion.js +2 -2
  7. package/dist/components/Alert.cjs +787 -0
  8. package/dist/components/Alert.js +13 -0
  9. package/dist/components/CalendarRange.cjs +465 -160
  10. package/dist/components/CalendarRange.css +3 -0
  11. package/dist/components/CalendarRange.js +19 -19
  12. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +918 -148
  13. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +3 -0
  14. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +19 -18
  15. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +928 -158
  16. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +3 -0
  17. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +19 -18
  18. package/dist/components/DataGrid/PinnedColumns.cjs +943 -173
  19. package/dist/components/DataGrid/PinnedColumns.css +3 -0
  20. package/dist/components/DataGrid/PinnedColumns.js +19 -18
  21. package/dist/components/DataGrid/TableBody/LoadingCell.cjs +919 -149
  22. package/dist/components/DataGrid/TableBody/LoadingCell.css +3 -0
  23. package/dist/components/DataGrid/TableBody/LoadingCell.js +19 -18
  24. package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +925 -155
  25. package/dist/components/DataGrid/TableBody/TableBodyRow.css +3 -0
  26. package/dist/components/DataGrid/TableBody/TableBodyRow.js +19 -18
  27. package/dist/components/DataGrid/TableBody/index.cjs +940 -170
  28. package/dist/components/DataGrid/TableBody/index.css +3 -0
  29. package/dist/components/DataGrid/TableBody/index.js +19 -18
  30. package/dist/components/DataGrid/index.cjs +1029 -259
  31. package/dist/components/DataGrid/index.css +3 -0
  32. package/dist/components/DataGrid/index.js +19 -18
  33. package/dist/components/DataGrid/utils.cjs +919 -149
  34. package/dist/components/DataGrid/utils.css +3 -0
  35. package/dist/components/DataGrid/utils.js +19 -18
  36. package/dist/components/DataGridCell.js +2 -2
  37. package/dist/components/DateInput.cjs +70 -65
  38. package/dist/components/DateInput.css +3 -0
  39. package/dist/components/DateInput.js +25 -271
  40. package/dist/components/DateRangeInput.cjs +419 -184
  41. package/dist/components/DateRangeInput.css +3 -0
  42. package/dist/components/DateRangeInput.js +19 -19
  43. package/dist/components/FilterGroup.js +6 -6
  44. package/dist/components/MobileDataGrid/ColumnList.js +3 -3
  45. package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +925 -155
  46. package/dist/components/MobileDataGrid/ColumnSelector/index.css +3 -0
  47. package/dist/components/MobileDataGrid/ColumnSelector/index.js +19 -18
  48. package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +2 -2
  49. package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +923 -153
  50. package/dist/components/MobileDataGrid/MobileDataGridHeader.css +3 -0
  51. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +19 -18
  52. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +2 -2
  53. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +6 -6
  54. package/dist/components/MobileDataGrid/index.cjs +973 -203
  55. package/dist/components/MobileDataGrid/index.css +3 -0
  56. package/dist/components/MobileDataGrid/index.js +19 -18
  57. package/dist/components/Modal.js +3 -3
  58. package/dist/components/Notification.js +3 -3
  59. package/dist/components/PDFViewer/PDFNavigation.js +2 -2
  60. package/dist/components/PDFViewer/index.js +6 -6
  61. package/dist/components/SideMenuItem.js +3 -3
  62. package/dist/components/Swatch.js +3 -3
  63. package/dist/components/Upload.js +3 -3
  64. package/dist/components/index.cjs +1212 -363
  65. package/dist/components/index.css +3 -0
  66. package/dist/components/index.js +34 -28
  67. package/dist/index.css +3 -0
  68. package/package.json +1 -1
  69. package/src/components/Alert.tsx +81 -0
  70. package/src/components/index.ts +2 -0
  71. package/dist/chunk-X35NLL3N.js +0 -493
  72. package/dist/{chunk-IT4VFU6T.js → chunk-3DEYCNUE.js} +3 -3
  73. package/dist/{chunk-GTBGPBH6.js → chunk-B53XDCLO.js} +3 -3
  74. package/dist/{chunk-ZQSD74IJ.js → chunk-IY7SXEVY.js} +3 -3
  75. package/dist/{chunk-BFFNSUNS.js → chunk-QBSEKZWX.js} +3 -3
  76. package/dist/{chunk-NIWXVOBW.js → chunk-X67L3NZI.js} +3 -3
  77. package/dist/{chunk-TVXBP5CW.js → chunk-XIXQUEYC.js} +3 -3
@@ -1,314 +1,68 @@
1
1
  import {
2
- CalendarRange
3
- } from "../chunk-X35NLL3N.js";
4
- import "../chunk-GTPSPGSJ.js";
5
- import "../chunk-OEMLNGE2.js";
6
- import "../chunk-IT4VFU6T.js";
2
+ DateInput
3
+ } from "../chunk-WIDUWFLX.js";
7
4
  import "../chunk-M7INAUAJ.js";
8
- import "../chunk-IG2YUDHI.js";
5
+ import "../chunk-4Q7T4GJ2.js";
6
+ import "../chunk-3DEYCNUE.js";
9
7
  import "../chunk-DYBJUTGK.js";
8
+ import "../chunk-24K4HHV5.js";
9
+ import "../chunk-B53XDCLO.js";
10
10
  import "../chunk-MBZ55T2D.js";
11
11
  import "../chunk-2IKT6IHB.js";
12
12
  import "../chunk-YCDDBSVU.js";
13
13
  import "../chunk-3X3Y4TMS.js";
14
14
  import "../chunk-BQNPOGD5.js";
15
- import "../chunk-KJNK7KEV.js";
16
- import "../chunk-TVXBP5CW.js";
15
+ import "../chunk-QMSPTD6L.js";
16
+ import "../chunk-XIXQUEYC.js";
17
17
  import "../chunk-5IFPG6TS.js";
18
18
  import "../chunk-KW6V7O3H.js";
19
19
  import "../chunk-AJ5M6MVX.js";
20
20
  import "../chunk-JUFBGNWW.js";
21
21
  import "../chunk-YNKN6RKF.js";
22
22
  import "../chunk-VJVY6NPF.js";
23
- import "../chunk-GTBGPBH6.js";
24
23
  import "../chunk-AT4AWD6B.js";
25
24
  import "../chunk-EWGHVZL5.js";
26
25
  import "../chunk-7GHD74J3.js";
27
26
  import "../chunk-7BVUTFZ5.js";
28
27
  import "../chunk-ETAEB3TA.js";
29
- import "../chunk-HVNHTM3P.js";
30
28
  import "../chunk-GRGDX7JC.js";
31
- import "../chunk-NIWXVOBW.js";
29
+ import "../chunk-HVNHTM3P.js";
30
+ import "../chunk-X67L3NZI.js";
32
31
  import "../chunk-4RJKB7LC.js";
32
+ import "../chunk-FG7GNGE3.js";
33
33
  import "../chunk-G7KIKHER.js";
34
34
  import "../chunk-AG43RS4Q.js";
35
35
  import "../chunk-ZQJMNPCF.js";
36
- import "../chunk-FG7GNGE3.js";
37
36
  import "../chunk-6TYWM26K.js";
38
37
  import "../chunk-SBRRNFOP.js";
39
38
  import "../chunk-Y2GK27RX.js";
40
- import "../chunk-H2KC5XUY.js";
41
39
  import "../chunk-QVWYTQKL.js";
42
- import "../chunk-75USUR3I.js";
43
- import "../chunk-WEAVZEE4.js";
44
- import "../chunk-OZBB6RFM.js";
45
- import "../chunk-BFFNSUNS.js";
40
+ import "../chunk-QBSEKZWX.js";
46
41
  import "../chunk-TCMOGTPB.js";
47
42
  import "../chunk-DVU5XV7L.js";
48
43
  import "../chunk-IPAKWF2V.js";
49
- import "../chunk-WVUIIBRR.js";
50
44
  import "../chunk-RQRR4FEF.js";
51
- import {
52
- InputBase
53
- } from "../chunk-44TH3VC7.js";
45
+ import "../chunk-44TH3VC7.js";
54
46
  import "../chunk-AL5QIRY3.js";
47
+ import "../chunk-WVUIIBRR.js";
48
+ import "../chunk-75USUR3I.js";
49
+ import "../chunk-WEAVZEE4.js";
50
+ import "../chunk-OZBB6RFM.js";
55
51
  import "../chunk-URYQ24NF.js";
56
- import {
57
- findDocumentRoot
58
- } from "../chunk-VXWSAIB5.js";
59
- import {
60
- calculateCursorPosition,
61
- formatDate,
62
- formatInputValue,
63
- isValidDate,
64
- parseInputDate
65
- } from "../chunk-R3EQIDBX.js";
52
+ import "../chunk-VXWSAIB5.js";
53
+ import "../chunk-R3EQIDBX.js";
66
54
  import "../chunk-5UH6QUFB.js";
67
55
  import "../chunk-UCJUC5AZ.js";
68
- import "../chunk-ZQSD74IJ.js";
56
+ import "../chunk-IY7SXEVY.js";
69
57
  import "../chunk-KBJZUVLM.js";
70
- import "../chunk-DORD2EBO.js";
58
+ import "../chunk-4UH72JT2.js";
59
+ import "../chunk-H2KC5XUY.js";
71
60
  import "../chunk-ZSETMD4A.js";
72
- import {
73
- Icon
74
- } from "../chunk-NKUETCDA.js";
61
+ import "../chunk-DORD2EBO.js";
62
+ import "../chunk-NKUETCDA.js";
75
63
  import "../chunk-LPY6PMAY.js";
76
64
  import "../chunk-IXR65MOU.js";
77
- import {
78
- __objRest,
79
- __spreadProps,
80
- __spreadValues
81
- } from "../chunk-ORMEWXMH.js";
82
-
83
- // src/components/DateInput.tsx
84
- import { useRef, useEffect, useState, useLayoutEffect } from "react";
85
- import { createPortal } from "react-dom";
86
- import { jsx, jsxs } from "react/jsx-runtime";
87
- var DateInput = (_a) => {
88
- var _b = _a, {
89
- id,
90
- testid,
91
- value,
92
- onChange,
93
- placeholder = "MM/DD/YYYY",
94
- disabled,
95
- readOnly = false,
96
- label
97
- } = _b, props = __objRest(_b, [
98
- "id",
99
- "testid",
100
- "value",
101
- "onChange",
102
- "placeholder",
103
- "disabled",
104
- "readOnly",
105
- "label"
106
- ]);
107
- const [visible, setVisible] = useState(false);
108
- const [inputValue, setInputValue] = useState("");
109
- const [isTyping, setIsTyping] = useState(false);
110
- const popoverRef = useRef(null);
111
- const triggerRef = useRef(null);
112
- const rootRef = useRef(null);
113
- const [calendarPosition, setCalendarPosition] = useState({
114
- top: 0,
115
- left: 0,
116
- width: 0
117
- });
118
- const [from, to] = [value, ""];
119
- useEffect(() => {
120
- if (!isTyping) {
121
- setInputValue(formatDisplayValue(from));
122
- }
123
- }, [from, isTyping]);
124
- useLayoutEffect(() => {
125
- if (visible) {
126
- updatePosition();
127
- }
128
- }, [visible]);
129
- const updatePosition = () => {
130
- if (rootRef.current) {
131
- const rect = rootRef.current.getBoundingClientRect();
132
- setCalendarPosition({
133
- top: rect.bottom + window.scrollY,
134
- left: rect.left + window.scrollX,
135
- width: rect.width
136
- });
137
- }
138
- };
139
- useEffect(() => {
140
- updatePosition();
141
- const resizeObserver = new ResizeObserver(updatePosition);
142
- if (triggerRef.current) {
143
- resizeObserver.observe(triggerRef.current);
144
- }
145
- window.addEventListener("scroll", updatePosition);
146
- return () => {
147
- resizeObserver.disconnect();
148
- window.removeEventListener("scroll", updatePosition);
149
- };
150
- }, []);
151
- useEffect(() => {
152
- const handleKeyDown2 = (event) => {
153
- var _a2;
154
- if (event.key === "Escape" && popoverRef.current) {
155
- setVisible(false);
156
- (_a2 = triggerRef.current) == null ? void 0 : _a2.blur();
157
- }
158
- };
159
- document.addEventListener("keydown", handleKeyDown2);
160
- return () => {
161
- document.removeEventListener("keydown", handleKeyDown2);
162
- };
163
- });
164
- useEffect(() => {
165
- const handleClickOutside = (event) => {
166
- if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
167
- setVisible(false);
168
- }
169
- };
170
- document.addEventListener("mousedown", handleClickOutside);
171
- return () => {
172
- document.removeEventListener("mousedown", handleClickOutside);
173
- };
174
- }, []);
175
- function handleDateChange(fromValue) {
176
- onChange(fromValue);
177
- setVisible(false);
178
- setIsTyping(false);
179
- }
180
- const handleFocus = () => {
181
- if (readOnly) return;
182
- setVisible(true);
183
- };
184
- const handleClick = () => {
185
- handleFocus();
186
- };
187
- const handleInputChange = (event) => {
188
- if (readOnly) return;
189
- const rawValue = event.target.value;
190
- const cursorPosition = event.target.selectionStart || 0;
191
- setIsTyping(true);
192
- const formattedValue = formatInputValue(rawValue);
193
- setInputValue(formattedValue);
194
- requestAnimationFrame(() => {
195
- if (triggerRef.current) {
196
- const newPosition = calculateCursorPosition(
197
- rawValue,
198
- formattedValue,
199
- cursorPosition
200
- );
201
- triggerRef.current.setSelectionRange(newPosition, newPosition);
202
- }
203
- });
204
- const parsedDate = parseInputDate(formattedValue);
205
- if (parsedDate && isValidDate(parsedDate)) {
206
- onChange(parsedDate);
207
- }
208
- };
209
- const handleBlur = () => {
210
- setIsTyping(false);
211
- const parsedDate = parseInputDate(inputValue);
212
- if (!parsedDate || !isValidDate(parsedDate)) {
213
- setInputValue(formatDisplayValue(from));
214
- }
215
- };
216
- const handleKeyDown = (event) => {
217
- if (event.key === "Backspace") {
218
- const input = event.target;
219
- const cursorPosition = input.selectionStart || 0;
220
- const value2 = input.value;
221
- if (cursorPosition > 0 && value2[cursorPosition - 1] === "/") {
222
- event.preventDefault();
223
- const newValue = value2.slice(0, cursorPosition - 2) + value2.slice(cursorPosition);
224
- const formattedValue = formatInputValue(newValue);
225
- setInputValue(formattedValue);
226
- requestAnimationFrame(() => {
227
- if (triggerRef.current) {
228
- const newPosition = Math.max(0, cursorPosition - 2);
229
- triggerRef.current.setSelectionRange(newPosition, newPosition);
230
- }
231
- });
232
- setIsTyping(true);
233
- return;
234
- }
235
- }
236
- if (event.key === "Enter") {
237
- const parsedDate = parseInputDate(inputValue);
238
- if (parsedDate && isValidDate(parsedDate)) {
239
- onChange(parsedDate);
240
- setVisible(false);
241
- setIsTyping(false);
242
- }
243
- }
244
- };
245
- return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
246
- /* @__PURE__ */ jsx(
247
- InputBase,
248
- __spreadProps(__spreadValues({
249
- id,
250
- testid,
251
- ref: (el) => {
252
- triggerRef.current = el;
253
- }
254
- }, props), {
255
- wrapperRef: rootRef,
256
- value: inputValue,
257
- placeholder,
258
- disabled,
259
- readOnly,
260
- after: /* @__PURE__ */ jsx(Icon, { name: "calendar_month" }),
261
- onFocus: handleFocus,
262
- onClick: handleClick,
263
- onChange: handleInputChange,
264
- onBlur: handleBlur,
265
- onKeyDown: handleKeyDown,
266
- label,
267
- secondaryIconColor: true
268
- })
269
- ),
270
- visible && !readOnly && createPortal(
271
- /* @__PURE__ */ jsx(
272
- "div",
273
- {
274
- ref: (el) => {
275
- popoverRef.current = el;
276
- },
277
- className: "absolute z-40 bg-white",
278
- style: {
279
- top: `${calendarPosition.top + 4}px`,
280
- left: `${calendarPosition.left}px`,
281
- minWidth: `${calendarPosition.width}px`
282
- },
283
- children: /* @__PURE__ */ jsx(
284
- CalendarRange,
285
- {
286
- id: id ? `${id}-calendar` : void 0,
287
- testid: testid ? `${testid}-calendar` : void 0,
288
- from,
289
- to: to || from,
290
- onChange: handleDateChange,
291
- cardStyle: true,
292
- mode: "single",
293
- disableRange: true
294
- }
295
- )
296
- }
297
- ),
298
- findDocumentRoot(popoverRef.current)
299
- )
300
- ] });
301
- };
302
- DateInput.displayName = "DateInput";
303
- function formatDisplayValue(from) {
304
- if (!from) {
305
- return "";
306
- }
307
- if (!isValidDate(from)) {
308
- return "";
309
- }
310
- return formatDate(from);
311
- }
65
+ import "../chunk-ORMEWXMH.js";
312
66
  export {
313
67
  DateInput
314
68
  };