@dmsi/wedgekit-react 0.0.45 → 0.0.47
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.
- package/dist/{chunk-JIFWUW4M.js → chunk-2BVSUYXU.js} +1 -1
- package/dist/{chunk-DVXLTLKP.js → chunk-724LJWFR.js} +5 -3
- package/dist/{chunk-IOSLZ3WW.js → chunk-KXUUKAQM.js} +1 -0
- package/dist/{chunk-W3K72ORO.js → chunk-SGQWENE2.js} +1 -1
- package/dist/{chunk-MUDULZCP.js → chunk-XIEG2XMD.js} +1 -1
- package/dist/components/DataGrid.cjs +5 -3
- package/dist/components/DataGrid.js +4 -4
- package/dist/components/DataGridCell.cjs +5 -3
- package/dist/components/DataGridCell.js +3 -3
- package/dist/components/DateInput.cjs +10 -4
- package/dist/components/DateInput.js +6 -2
- package/dist/components/DateRangeInput.cjs +32 -9
- package/dist/components/DateRangeInput.js +28 -7
- package/dist/components/FilterGroup.cjs +5 -3
- package/dist/components/FilterGroup.js +2 -2
- package/dist/components/Input.cjs +5 -3
- package/dist/components/Input.js +1 -1
- package/dist/components/MobileDataGrid.cjs +1 -0
- package/dist/components/MobileDataGrid.js +1 -1
- package/dist/components/Notification.cjs +1 -0
- package/dist/components/Notification.js +1 -1
- package/dist/components/Password.cjs +5 -3
- package/dist/components/Password.js +1 -1
- package/dist/components/Search.cjs +5 -3
- package/dist/components/Search.js +2 -2
- package/dist/components/Select.cjs +5 -3
- package/dist/components/Select.js +2 -2
- package/dist/components/SideMenuGroup.cjs +1 -0
- package/dist/components/SideMenuGroup.js +1 -1
- package/dist/components/SideMenuItem.cjs +1 -0
- package/dist/components/SideMenuItem.js +1 -1
- package/dist/components/Stack.cjs +1 -0
- package/dist/components/Stack.js +1 -1
- package/dist/components/Stepper.cjs +5 -3
- package/dist/components/Stepper.js +1 -1
- package/dist/components/Swatch.cjs +1 -0
- package/dist/components/Swatch.js +1 -1
- package/dist/components/Time.cjs +6 -3
- package/dist/components/Time.js +2 -2
- package/package.json +1 -1
- package/src/components/DateInput.tsx +19 -14
- package/src/components/DateRangeInput.tsx +136 -91
- package/src/components/Input.tsx +3 -1
- package/src/components/Stack.tsx +2 -2
|
@@ -312,6 +312,7 @@ var Stack = (_a) => {
|
|
|
312
312
|
"max-w-screen",
|
|
313
313
|
width !== "fit" && "w-full",
|
|
314
314
|
width === "full" && "w-full",
|
|
315
|
+
width === "max" && "w-max",
|
|
315
316
|
centered && "mx-auto",
|
|
316
317
|
overflowY == "auto" && "overflow-y-auto",
|
|
317
318
|
overflowY == "hidden" && "overflow-y-hidden",
|
|
@@ -183,6 +183,7 @@ var Stack = (_a) => {
|
|
|
183
183
|
"max-w-screen",
|
|
184
184
|
width !== "fit" && "w-full",
|
|
185
185
|
width === "full" && "w-full",
|
|
186
|
+
width === "max" && "w-max",
|
|
186
187
|
centered && "mx-auto",
|
|
187
188
|
overflowY == "auto" && "overflow-y-auto",
|
|
188
189
|
overflowY == "hidden" && "overflow-y-hidden",
|
package/dist/components/Stack.js
CHANGED
|
@@ -458,7 +458,8 @@ var InputBase = (_a) => {
|
|
|
458
458
|
inputContainerRef,
|
|
459
459
|
removeBorder,
|
|
460
460
|
wrapperClassName,
|
|
461
|
-
focus
|
|
461
|
+
focus,
|
|
462
|
+
fullWidth = true
|
|
462
463
|
} = _b, props = __objRest(_b, [
|
|
463
464
|
"id",
|
|
464
465
|
"before",
|
|
@@ -475,7 +476,8 @@ var InputBase = (_a) => {
|
|
|
475
476
|
"inputContainerRef",
|
|
476
477
|
"removeBorder",
|
|
477
478
|
"wrapperClassName",
|
|
478
|
-
"focus"
|
|
479
|
+
"focus",
|
|
480
|
+
"fullWidth"
|
|
479
481
|
]);
|
|
480
482
|
const attributes = {
|
|
481
483
|
"data-error": error && !focus || null,
|
|
@@ -497,7 +499,7 @@ var InputBase = (_a) => {
|
|
|
497
499
|
}
|
|
498
500
|
}, [selectOnFocus]);
|
|
499
501
|
const inputBaseClass = (0, import_clsx5.default)(
|
|
500
|
-
"w-full",
|
|
502
|
+
fullWidth ? "w-full" : "w-fit",
|
|
501
503
|
"flex flex-row items-center",
|
|
502
504
|
"bg-background-action-secondary-normal caret-icon-on-action-secondary-normal",
|
|
503
505
|
componentGap,
|
|
@@ -362,6 +362,7 @@ var Stack = (_a) => {
|
|
|
362
362
|
"max-w-screen",
|
|
363
363
|
width !== "fit" && "w-full",
|
|
364
364
|
width === "full" && "w-full",
|
|
365
|
+
width === "max" && "w-max",
|
|
365
366
|
centered && "mx-auto",
|
|
366
367
|
overflowY == "auto" && "overflow-y-auto",
|
|
367
368
|
overflowY == "hidden" && "overflow-y-hidden",
|
package/dist/components/Time.cjs
CHANGED
|
@@ -319,7 +319,8 @@ var InputBase = (_a) => {
|
|
|
319
319
|
inputContainerRef,
|
|
320
320
|
removeBorder,
|
|
321
321
|
wrapperClassName,
|
|
322
|
-
focus
|
|
322
|
+
focus,
|
|
323
|
+
fullWidth = true
|
|
323
324
|
} = _b, props = __objRest(_b, [
|
|
324
325
|
"id",
|
|
325
326
|
"before",
|
|
@@ -336,7 +337,8 @@ var InputBase = (_a) => {
|
|
|
336
337
|
"inputContainerRef",
|
|
337
338
|
"removeBorder",
|
|
338
339
|
"wrapperClassName",
|
|
339
|
-
"focus"
|
|
340
|
+
"focus",
|
|
341
|
+
"fullWidth"
|
|
340
342
|
]);
|
|
341
343
|
const attributes = {
|
|
342
344
|
"data-error": error && !focus || null,
|
|
@@ -358,7 +360,7 @@ var InputBase = (_a) => {
|
|
|
358
360
|
}
|
|
359
361
|
}, [selectOnFocus]);
|
|
360
362
|
const inputBaseClass = (0, import_clsx4.default)(
|
|
361
|
-
"w-full",
|
|
363
|
+
fullWidth ? "w-full" : "w-fit",
|
|
362
364
|
"flex flex-row items-center",
|
|
363
365
|
"bg-background-action-secondary-normal caret-icon-on-action-secondary-normal",
|
|
364
366
|
componentGap,
|
|
@@ -831,6 +833,7 @@ var Stack = (_a) => {
|
|
|
831
833
|
"max-w-screen",
|
|
832
834
|
width !== "fit" && "w-full",
|
|
833
835
|
width === "full" && "w-full",
|
|
836
|
+
width === "max" && "w-max",
|
|
834
837
|
centered && "mx-auto",
|
|
835
838
|
overflowY == "auto" && "overflow-y-auto",
|
|
836
839
|
overflowY == "hidden" && "overflow-y-hidden",
|
package/dist/components/Time.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Stack
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-KXUUKAQM.js";
|
|
4
4
|
import {
|
|
5
5
|
findDocumentRoot
|
|
6
6
|
} from "../chunk-4T7F5BZZ.js";
|
|
7
7
|
import {
|
|
8
8
|
InputBase
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-724LJWFR.js";
|
|
10
10
|
import "../chunk-S5K22XTH.js";
|
|
11
11
|
import {
|
|
12
12
|
Icon
|
package/package.json
CHANGED
|
@@ -75,7 +75,7 @@ export const DateInput = ({
|
|
|
75
75
|
if (visible) {
|
|
76
76
|
updatePosition();
|
|
77
77
|
}
|
|
78
|
-
}, [visible])
|
|
78
|
+
}, [visible]);
|
|
79
79
|
|
|
80
80
|
const updatePosition = () => {
|
|
81
81
|
if (triggerRef.current) {
|
|
@@ -148,27 +148,31 @@ export const DateInput = ({
|
|
|
148
148
|
|
|
149
149
|
const handleClick = () => {
|
|
150
150
|
handleFocus();
|
|
151
|
-
}
|
|
151
|
+
};
|
|
152
152
|
|
|
153
153
|
const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
154
154
|
if (readOnly) return;
|
|
155
|
-
|
|
155
|
+
|
|
156
156
|
const rawValue = event.target.value;
|
|
157
157
|
const cursorPosition = event.target.selectionStart || 0;
|
|
158
158
|
setIsTyping(true);
|
|
159
|
-
|
|
159
|
+
|
|
160
160
|
// Format the input as user types (add slashes automatically)
|
|
161
161
|
const formattedValue = formatInputValue(rawValue);
|
|
162
162
|
setInputValue(formattedValue);
|
|
163
|
-
|
|
163
|
+
|
|
164
164
|
// Restore cursor position after formatting
|
|
165
165
|
requestAnimationFrame(() => {
|
|
166
166
|
if (triggerRef.current) {
|
|
167
|
-
const newPosition = calculateCursorPosition(
|
|
167
|
+
const newPosition = calculateCursorPosition(
|
|
168
|
+
rawValue,
|
|
169
|
+
formattedValue,
|
|
170
|
+
cursorPosition,
|
|
171
|
+
);
|
|
168
172
|
triggerRef.current.setSelectionRange(newPosition, newPosition);
|
|
169
173
|
}
|
|
170
174
|
});
|
|
171
|
-
|
|
175
|
+
|
|
172
176
|
// Try to parse and validate the date
|
|
173
177
|
const parsedDate = parseInputDate(formattedValue);
|
|
174
178
|
if (parsedDate && isValidDate(parsedDate)) {
|
|
@@ -190,14 +194,15 @@ export const DateInput = ({
|
|
|
190
194
|
const input = event.target as HTMLInputElement;
|
|
191
195
|
const cursorPosition = input.selectionStart || 0;
|
|
192
196
|
const value = input.value;
|
|
193
|
-
|
|
197
|
+
|
|
194
198
|
// If cursor is right after a slash, move it before the slash
|
|
195
199
|
if (cursorPosition > 0 && value[cursorPosition - 1] === "/") {
|
|
196
200
|
event.preventDefault();
|
|
197
|
-
const newValue =
|
|
201
|
+
const newValue =
|
|
202
|
+
value.slice(0, cursorPosition - 2) + value.slice(cursorPosition);
|
|
198
203
|
const formattedValue = formatInputValue(newValue);
|
|
199
204
|
setInputValue(formattedValue);
|
|
200
|
-
|
|
205
|
+
|
|
201
206
|
// Set cursor position after the deletion
|
|
202
207
|
requestAnimationFrame(() => {
|
|
203
208
|
if (triggerRef.current) {
|
|
@@ -205,12 +210,12 @@ export const DateInput = ({
|
|
|
205
210
|
triggerRef.current.setSelectionRange(newPosition, newPosition);
|
|
206
211
|
}
|
|
207
212
|
});
|
|
208
|
-
|
|
213
|
+
|
|
209
214
|
setIsTyping(true);
|
|
210
215
|
return;
|
|
211
216
|
}
|
|
212
217
|
}
|
|
213
|
-
|
|
218
|
+
|
|
214
219
|
if (event.key === "Enter") {
|
|
215
220
|
const parsedDate = parseInputDate(inputValue);
|
|
216
221
|
if (parsedDate && isValidDate(parsedDate)) {
|
|
@@ -280,6 +285,6 @@ function formatDisplayValue(from?: string): string {
|
|
|
280
285
|
if (!isValidDate(from)) {
|
|
281
286
|
return "";
|
|
282
287
|
}
|
|
283
|
-
|
|
288
|
+
|
|
284
289
|
return formatDate(from);
|
|
285
|
-
}
|
|
290
|
+
}
|