@deepnoid/ui 0.0.90 → 0.0.92
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-L7P6OBUX.mjs → chunk-3WTG4YNN.mjs} +2 -2
- package/dist/{chunk-2ZFHB4JM.mjs → chunk-FWJ2ZKH6.mjs} +23 -12
- package/dist/{chunk-N6IEGD4K.mjs → chunk-NUIYVRYF.mjs} +6 -3
- package/dist/{chunk-EDEV4IK4.mjs → chunk-SKQNTNEA.mjs} +5 -5
- package/dist/{chunk-S2VUKVCH.mjs → chunk-VNO4XOQG.mjs} +50 -10
- package/dist/components/dateTimePicker/dateTimePicker.d.mts +2 -0
- package/dist/components/dateTimePicker/dateTimePicker.d.ts +2 -0
- package/dist/components/dateTimePicker/dateTimePicker.js +81 -27
- package/dist/components/dateTimePicker/dateTimePicker.mjs +4 -4
- package/dist/components/dateTimePicker/index.js +81 -27
- package/dist/components/dateTimePicker/index.mjs +4 -4
- package/dist/components/dateTimePicker/timePicker.d.mts +2 -1
- package/dist/components/dateTimePicker/timePicker.d.ts +2 -1
- package/dist/components/dateTimePicker/timePicker.js +10 -7
- package/dist/components/dateTimePicker/timePicker.mjs +2 -2
- package/dist/components/dateTimePicker/useDateTimePicker.d.mts +4 -1
- package/dist/components/dateTimePicker/useDateTimePicker.d.ts +4 -1
- package/dist/components/dateTimePicker/useDateTimePicker.js +23 -12
- package/dist/components/dateTimePicker/useDateTimePicker.mjs +1 -1
- package/dist/components/list/index.js +5 -5
- package/dist/components/list/index.mjs +1 -1
- package/dist/components/list/listItem.js +5 -5
- package/dist/components/list/listItem.mjs +1 -1
- package/dist/components/modal/index.js +2 -2
- package/dist/components/modal/index.mjs +1 -1
- package/dist/components/modal/modal.js +2 -2
- package/dist/components/modal/modal.mjs +1 -1
- package/dist/components/modal/modal.test.js +2 -2
- package/dist/components/modal/modal.test.mjs +1 -1
- package/dist/components/select/index.mjs +2 -2
- package/dist/components/select/select.mjs +2 -2
- package/dist/components/select/select.test.mjs +2 -2
- package/dist/index.js +83 -29
- package/dist/index.mjs +20 -20
- package/package.json +1 -1
- package/dist/{chunk-2BCJZILI.mjs → chunk-JN7EGKJL.mjs} +3 -3
package/dist/index.js
CHANGED
|
@@ -7278,7 +7278,7 @@ var modal = tv({
|
|
|
7278
7278
|
slots: {
|
|
7279
7279
|
backdrop: ["relative w-screen h-screen fixed inset-0 bg-black/60", "z-[900]"],
|
|
7280
7280
|
modalWrapper: ["group/modal", "absolute", "top-1/2", "-translate-y-1/2", "left-1/2", "-translate-x-1/2"],
|
|
7281
|
-
icon: ["absolute", "top-[
|
|
7281
|
+
icon: ["absolute", "top-[0px]", "left-1/2", "-translate-x-1/2", "z-10"],
|
|
7282
7282
|
closeIcon: [
|
|
7283
7283
|
"absolute",
|
|
7284
7284
|
"top-[20px]",
|
|
@@ -7297,7 +7297,7 @@ var modal = tv({
|
|
|
7297
7297
|
"bg-background",
|
|
7298
7298
|
"shadow-drop shadow-foreground/20 rounded-xxlg",
|
|
7299
7299
|
"overflow-hidden",
|
|
7300
|
-
"group-data-[icon-visibility=true]/modal:mt-[
|
|
7300
|
+
"group-data-[icon-visibility=true]/modal:mt-[40px]",
|
|
7301
7301
|
"group-data-[icon-visibility=true]/modal:pt-[60px]"
|
|
7302
7302
|
],
|
|
7303
7303
|
body: ["flex", "flex-col", "gap-[20px]"],
|
|
@@ -7740,10 +7740,10 @@ var listItem = tv({
|
|
|
7740
7740
|
color: "primary",
|
|
7741
7741
|
class: {
|
|
7742
7742
|
base: [
|
|
7743
|
-
"hover:text-primary-
|
|
7743
|
+
"hover:text-primary-strong",
|
|
7744
7744
|
"hover:bg-primary-soft",
|
|
7745
|
-
"data-[selected=true]:text-
|
|
7746
|
-
"data-[selected=true]:bg-primary-
|
|
7745
|
+
"data-[selected=true]:text-white",
|
|
7746
|
+
"data-[selected=true]:bg-primary-main"
|
|
7747
7747
|
]
|
|
7748
7748
|
}
|
|
7749
7749
|
},
|
|
@@ -7754,8 +7754,8 @@ var listItem = tv({
|
|
|
7754
7754
|
base: [
|
|
7755
7755
|
"hover:text-secondary-main",
|
|
7756
7756
|
"hover:bg-secondary-soft",
|
|
7757
|
-
"data-[selected=true]:text-
|
|
7758
|
-
"data-[selected=true]:bg-secondary-
|
|
7757
|
+
"data-[selected=true]:text-white",
|
|
7758
|
+
"data-[selected=true]:bg-secondary-main"
|
|
7759
7759
|
]
|
|
7760
7760
|
}
|
|
7761
7761
|
}
|
|
@@ -8002,21 +8002,23 @@ var useDatePicker = ({ initialDate, initialTime }) => {
|
|
|
8002
8002
|
const [targetRect, setTargetRect] = (0, import_react30.useState)(null);
|
|
8003
8003
|
const [popupWidth, setPopupWidth] = (0, import_react30.useState)(0);
|
|
8004
8004
|
const [popupHeight, setPopupHeight] = (0, import_react30.useState)(0);
|
|
8005
|
+
const [isFocusInput, setIsFocusInput] = (0, import_react30.useState)(false);
|
|
8005
8006
|
const dateInputRef = (0, import_react30.useRef)(null);
|
|
8006
8007
|
const datePickerWrapperRef = (0, import_react30.useRef)(null);
|
|
8007
8008
|
const datePickerRef = (0, import_react30.useRef)(null);
|
|
8008
|
-
const
|
|
8009
|
-
const calculatePositionWithScroll = (targetRect2
|
|
8010
|
-
if (
|
|
8011
|
-
|
|
8012
|
-
|
|
8013
|
-
|
|
8014
|
-
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
|
|
8019
|
-
|
|
8009
|
+
const DATE_PICKER_GAP = 4;
|
|
8010
|
+
const calculatePositionWithScroll = (targetRect2) => {
|
|
8011
|
+
if (targetRect2 && popupWidth && popupHeight) {
|
|
8012
|
+
const scrollTop = window.scrollY || document.documentElement.scrollTop || document.body.scrollTop;
|
|
8013
|
+
const scrollLeft = window.scrollX || document.documentElement.scrollLeft || document.body.scrollLeft;
|
|
8014
|
+
const spaceBelow = window.innerHeight - (targetRect2.y + targetRect2.height + DATE_PICKER_GAP);
|
|
8015
|
+
const spaceAbove = targetRect2.y - DATE_PICKER_GAP;
|
|
8016
|
+
const top = spaceBelow < popupHeight && spaceAbove > popupHeight ? targetRect2.y - popupHeight - DATE_PICKER_GAP : targetRect2.y + targetRect2.height + DATE_PICKER_GAP;
|
|
8017
|
+
return {
|
|
8018
|
+
top: top + scrollTop,
|
|
8019
|
+
left: targetRect2.x + targetRect2.width - popupWidth + scrollLeft
|
|
8020
|
+
};
|
|
8021
|
+
}
|
|
8020
8022
|
};
|
|
8021
8023
|
const handleToggleDatePicker = () => {
|
|
8022
8024
|
if (datePickerRef.current) {
|
|
@@ -8030,6 +8032,12 @@ var useDatePicker = ({ initialDate, initialTime }) => {
|
|
|
8030
8032
|
const handleChangeTime = (time) => {
|
|
8031
8033
|
setSelectedTime(time);
|
|
8032
8034
|
};
|
|
8035
|
+
const handleFocusInput = () => {
|
|
8036
|
+
setIsFocusInput(true);
|
|
8037
|
+
};
|
|
8038
|
+
const handleBlueInput = () => {
|
|
8039
|
+
setIsFocusInput(false);
|
|
8040
|
+
};
|
|
8033
8041
|
(0, import_react30.useEffect)(() => {
|
|
8034
8042
|
const onClickOutside = (e) => {
|
|
8035
8043
|
if (datePickerRef.current && !datePickerRef.current.contains(e.target) && datePickerWrapperRef.current && !datePickerWrapperRef.current.contains(e.target)) {
|
|
@@ -8050,12 +8058,15 @@ var useDatePicker = ({ initialDate, initialTime }) => {
|
|
|
8050
8058
|
selectedTime,
|
|
8051
8059
|
targetRect,
|
|
8052
8060
|
popupHeight,
|
|
8061
|
+
isFocusInput,
|
|
8053
8062
|
dateInputRef,
|
|
8054
8063
|
datePickerWrapperRef,
|
|
8055
8064
|
datePickerRef,
|
|
8056
8065
|
handleToggleDatePicker,
|
|
8057
8066
|
handleChangeDate,
|
|
8058
8067
|
handleChangeTime,
|
|
8068
|
+
handleFocusInput,
|
|
8069
|
+
handleBlueInput,
|
|
8059
8070
|
calculatePositionWithScroll
|
|
8060
8071
|
};
|
|
8061
8072
|
};
|
|
@@ -8256,7 +8267,7 @@ var calendarStyle = tv({
|
|
|
8256
8267
|
// src/components/dateTimePicker/timePicker.tsx
|
|
8257
8268
|
var import_react32 = require("react");
|
|
8258
8269
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
8259
|
-
var TimePicker = ({ color = "primary", selectedTime, onChangeTime }) => {
|
|
8270
|
+
var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime }) => {
|
|
8260
8271
|
const TOTAL_HOURS = 12;
|
|
8261
8272
|
const TOTAL_MINUTES = 60;
|
|
8262
8273
|
const ITEM_HEIGHT = 30;
|
|
@@ -8276,7 +8287,10 @@ var TimePicker = ({ color = "primary", selectedTime, onChangeTime }) => {
|
|
|
8276
8287
|
setSelectedMinute(minute);
|
|
8277
8288
|
setSelectedPeriod(period);
|
|
8278
8289
|
}
|
|
8279
|
-
|
|
8290
|
+
if (isFocusInput) {
|
|
8291
|
+
scrollToSelectedTime();
|
|
8292
|
+
}
|
|
8293
|
+
}, [selectedTime, isFocusInput]);
|
|
8280
8294
|
(0, import_react32.useEffect)(() => {
|
|
8281
8295
|
scrollToSelectedTime();
|
|
8282
8296
|
}, []);
|
|
@@ -8365,24 +8379,38 @@ var timePicker_default = TimePicker;
|
|
|
8365
8379
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
8366
8380
|
var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
8367
8381
|
const [props, variantProps] = mapPropsVariants(originalProps, dateTimePickerStyle.variantKeys);
|
|
8368
|
-
const {
|
|
8382
|
+
const {
|
|
8383
|
+
classNames,
|
|
8384
|
+
label,
|
|
8385
|
+
errorMessage,
|
|
8386
|
+
startContent,
|
|
8387
|
+
endContent,
|
|
8388
|
+
type = "date",
|
|
8389
|
+
value,
|
|
8390
|
+
onChangeDate,
|
|
8391
|
+
onChangeTime,
|
|
8392
|
+
...inputProps
|
|
8393
|
+
} = props;
|
|
8369
8394
|
const slots = (0, import_react33.useMemo)(() => dateTimePickerStyle({ ...variantProps }), [variantProps]);
|
|
8370
8395
|
const {
|
|
8371
8396
|
selectedDate,
|
|
8372
8397
|
selectedTime,
|
|
8373
8398
|
targetRect,
|
|
8374
8399
|
popupHeight,
|
|
8400
|
+
isFocusInput,
|
|
8375
8401
|
datePickerRef,
|
|
8376
8402
|
dateInputRef,
|
|
8377
8403
|
datePickerWrapperRef,
|
|
8378
8404
|
handleToggleDatePicker,
|
|
8379
8405
|
handleChangeDate,
|
|
8380
8406
|
handleChangeTime,
|
|
8407
|
+
handleFocusInput,
|
|
8408
|
+
handleBlueInput,
|
|
8381
8409
|
calculatePositionWithScroll
|
|
8382
8410
|
} = useDatePicker({
|
|
8383
8411
|
initialDate: void 0
|
|
8384
8412
|
});
|
|
8385
|
-
const position = targetRect ? calculatePositionWithScroll(targetRect
|
|
8413
|
+
const position = targetRect ? calculatePositionWithScroll(targetRect) : null;
|
|
8386
8414
|
const getBaseProps = (0, import_react33.useCallback)(
|
|
8387
8415
|
() => ({
|
|
8388
8416
|
className: slots.base({ class: classNames == null ? void 0 : classNames.base })
|
|
@@ -8415,17 +8443,29 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
8415
8443
|
className: slots.input({ class: classNames == null ? void 0 : classNames.input }),
|
|
8416
8444
|
size: 0,
|
|
8417
8445
|
type,
|
|
8418
|
-
value: type === "date" ? selectedDate || "" : type === "time" ? selectedTime || "" : "",
|
|
8446
|
+
value: value !== void 0 ? value : type === "date" ? selectedDate || "" : type === "time" ? selectedTime || "" : "",
|
|
8419
8447
|
onChange: (e) => {
|
|
8420
8448
|
if (type === "date") {
|
|
8421
8449
|
handleChangeDate(e.target.value);
|
|
8450
|
+
if (onChangeDate) {
|
|
8451
|
+
onChangeDate(e.target.value);
|
|
8452
|
+
}
|
|
8422
8453
|
} else if (type === "time") {
|
|
8423
8454
|
handleChangeTime(e.target.value);
|
|
8455
|
+
if (onChangeTime) {
|
|
8456
|
+
onChangeTime(e.target.value);
|
|
8457
|
+
}
|
|
8424
8458
|
}
|
|
8425
8459
|
},
|
|
8460
|
+
onFocus: (e) => {
|
|
8461
|
+
handleFocusInput();
|
|
8462
|
+
},
|
|
8463
|
+
onBlur: (e) => {
|
|
8464
|
+
handleBlueInput();
|
|
8465
|
+
},
|
|
8426
8466
|
max: "9999-12-31"
|
|
8427
8467
|
}),
|
|
8428
|
-
[inputProps, ref, dateInputRef, slots, classNames == null ? void 0 : classNames.input, selectedDate]
|
|
8468
|
+
[inputProps, ref, dateInputRef, slots, classNames == null ? void 0 : classNames.input, selectedDate, selectedTime, type, value]
|
|
8429
8469
|
);
|
|
8430
8470
|
const getContentProps = (0, import_react33.useCallback)(
|
|
8431
8471
|
() => ({
|
|
@@ -8508,8 +8548,8 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
8508
8548
|
ref: datePickerWrapperRef,
|
|
8509
8549
|
style: {
|
|
8510
8550
|
position: "absolute",
|
|
8511
|
-
top: position == null ? void 0 : position.top,
|
|
8512
|
-
left: position == null ? void 0 : position.left,
|
|
8551
|
+
top: (position == null ? void 0 : position.top) || -99999,
|
|
8552
|
+
left: (position == null ? void 0 : position.left) || -99999,
|
|
8513
8553
|
zIndex: 1e3
|
|
8514
8554
|
},
|
|
8515
8555
|
children: [
|
|
@@ -8519,10 +8559,24 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
8519
8559
|
color: originalProps.color,
|
|
8520
8560
|
selectedDate,
|
|
8521
8561
|
highlightWeekend: originalProps.highlightWeekend,
|
|
8522
|
-
onChangeDate:
|
|
8562
|
+
onChangeDate: (date) => {
|
|
8563
|
+
handleChangeDate(date);
|
|
8564
|
+
if (onChangeDate) onChangeDate(date);
|
|
8565
|
+
}
|
|
8523
8566
|
}
|
|
8524
8567
|
),
|
|
8525
|
-
type === "time" && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
8568
|
+
type === "time" && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
8569
|
+
timePicker_default,
|
|
8570
|
+
{
|
|
8571
|
+
color: originalProps.color,
|
|
8572
|
+
selectedTime,
|
|
8573
|
+
isFocusInput,
|
|
8574
|
+
onChangeTime: (time) => {
|
|
8575
|
+
handleChangeTime(time);
|
|
8576
|
+
if (onChangeTime) onChangeTime(time);
|
|
8577
|
+
}
|
|
8578
|
+
}
|
|
8579
|
+
)
|
|
8526
8580
|
]
|
|
8527
8581
|
}
|
|
8528
8582
|
),
|
package/dist/index.mjs
CHANGED
|
@@ -5,10 +5,6 @@ import {
|
|
|
5
5
|
} from "./chunk-P6AZMYVR.mjs";
|
|
6
6
|
import "./chunk-DSBSLSJW.mjs";
|
|
7
7
|
import "./chunk-ODMRJXLJ.mjs";
|
|
8
|
-
import "./chunk-3MY6LO7N.mjs";
|
|
9
|
-
import {
|
|
10
|
-
tabs_default
|
|
11
|
-
} from "./chunk-KRI5IALM.mjs";
|
|
12
8
|
import "./chunk-RRAZM5D3.mjs";
|
|
13
9
|
import {
|
|
14
10
|
textarea_default
|
|
@@ -22,6 +18,10 @@ import "./chunk-ZOTHPHXA.mjs";
|
|
|
22
18
|
import {
|
|
23
19
|
toast_default
|
|
24
20
|
} from "./chunk-PXUBPWKU.mjs";
|
|
21
|
+
import "./chunk-3MY6LO7N.mjs";
|
|
22
|
+
import {
|
|
23
|
+
tabs_default
|
|
24
|
+
} from "./chunk-KRI5IALM.mjs";
|
|
25
25
|
import "./chunk-LVFI2NOH.mjs";
|
|
26
26
|
import {
|
|
27
27
|
switch_default
|
|
@@ -32,16 +32,16 @@ import {
|
|
|
32
32
|
} from "./chunk-6YE26GOI.mjs";
|
|
33
33
|
import "./chunk-DWROPKZW.mjs";
|
|
34
34
|
import "./chunk-VG4644BG.mjs";
|
|
35
|
-
import "./chunk-MV2WCFK7.mjs";
|
|
36
|
-
import {
|
|
37
|
-
slider_default
|
|
38
|
-
} from "./chunk-A3RWT3JJ.mjs";
|
|
39
35
|
import "./chunk-QCEKPS7U.mjs";
|
|
40
36
|
import {
|
|
41
37
|
select_default
|
|
42
|
-
} from "./chunk-
|
|
43
|
-
import "./chunk-S3QS5B7F.mjs";
|
|
38
|
+
} from "./chunk-JN7EGKJL.mjs";
|
|
44
39
|
import "./chunk-RZZWHI6O.mjs";
|
|
40
|
+
import "./chunk-S3QS5B7F.mjs";
|
|
41
|
+
import "./chunk-MV2WCFK7.mjs";
|
|
42
|
+
import {
|
|
43
|
+
slider_default
|
|
44
|
+
} from "./chunk-A3RWT3JJ.mjs";
|
|
45
45
|
import "./chunk-7VOQKIIK.mjs";
|
|
46
46
|
import {
|
|
47
47
|
progress_default
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
import "./chunk-DJOG6Z35.mjs";
|
|
54
54
|
import {
|
|
55
55
|
modal_default
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-3WTG4YNN.mjs";
|
|
57
57
|
import "./chunk-7B7LRG5J.mjs";
|
|
58
58
|
import {
|
|
59
59
|
pagination_default
|
|
@@ -63,7 +63,7 @@ import "./chunk-2GCSFWHD.mjs";
|
|
|
63
63
|
import {
|
|
64
64
|
input_default
|
|
65
65
|
} from "./chunk-3DRIHQOM.mjs";
|
|
66
|
-
import "./chunk-
|
|
66
|
+
import "./chunk-VUYUQGLF.mjs";
|
|
67
67
|
import "./chunk-QZ3LVYJW.mjs";
|
|
68
68
|
import {
|
|
69
69
|
checkbox_default
|
|
@@ -71,29 +71,29 @@ import {
|
|
|
71
71
|
import "./chunk-75HLCORR.mjs";
|
|
72
72
|
import {
|
|
73
73
|
dateTimePicker_default
|
|
74
|
-
} from "./chunk-
|
|
75
|
-
import "./chunk-
|
|
74
|
+
} from "./chunk-VNO4XOQG.mjs";
|
|
75
|
+
import "./chunk-FWJ2ZKH6.mjs";
|
|
76
76
|
import "./chunk-WX32MAKV.mjs";
|
|
77
77
|
import "./chunk-P732YGHO.mjs";
|
|
78
|
-
import "./chunk-
|
|
78
|
+
import "./chunk-NUIYVRYF.mjs";
|
|
79
79
|
import "./chunk-7MVEAQ7Z.mjs";
|
|
80
80
|
import {
|
|
81
81
|
list_default
|
|
82
82
|
} from "./chunk-EYY4CRRR.mjs";
|
|
83
83
|
import {
|
|
84
84
|
listItem_default
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-SKQNTNEA.mjs";
|
|
86
86
|
import "./chunk-NMSDSEBD.mjs";
|
|
87
|
-
import "./chunk-
|
|
87
|
+
import "./chunk-HAOK24MK.mjs";
|
|
88
|
+
import {
|
|
89
|
+
card_default
|
|
90
|
+
} from "./chunk-2ALY3PH5.mjs";
|
|
88
91
|
import {
|
|
89
92
|
button_group_default
|
|
90
93
|
} from "./chunk-NGQ3MK2J.mjs";
|
|
91
94
|
import {
|
|
92
95
|
button_default
|
|
93
96
|
} from "./chunk-UR64ZUAU.mjs";
|
|
94
|
-
import {
|
|
95
|
-
card_default
|
|
96
|
-
} from "./chunk-2ALY3PH5.mjs";
|
|
97
97
|
import "./chunk-27Y6K5NK.mjs";
|
|
98
98
|
import {
|
|
99
99
|
accordion_default
|
package/package.json
CHANGED