@deepnoid/ui 0.1.206 → 0.1.208
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/.turbo/turbo-build.log +494 -484
- package/dist/chunk-3IBJXQTJ.mjs +42 -0
- package/dist/chunk-4TAZM6EF.mjs +285 -0
- package/dist/chunk-I4YRN4UE.mjs +79 -0
- package/dist/{chunk-BTO7MP5N.mjs → chunk-JPNMYMDN.mjs} +4 -4
- package/dist/chunk-QBWQHWNV.mjs +81 -0
- package/dist/components/breadcrumb/breadcrumb.mjs +1 -1
- package/dist/components/breadcrumb/index.mjs +1 -1
- package/dist/components/button/button.mjs +1 -1
- package/dist/components/button/icon-button.mjs +1 -1
- package/dist/components/button/index.mjs +1 -1
- package/dist/components/chip/chip.mjs +1 -1
- package/dist/components/chip/index.mjs +1 -1
- package/dist/components/fileUpload/fileUpload.mjs +1 -1
- package/dist/components/fileUpload/index.mjs +1 -1
- package/dist/components/input/index.mjs +1 -1
- package/dist/components/input/input.mjs +1 -1
- package/dist/components/list/index.mjs +3 -3
- package/dist/components/list/listItem.mjs +3 -3
- package/dist/components/modal/index.mjs +4 -4
- package/dist/components/modal/modal.mjs +4 -4
- package/dist/components/pagination/index.mjs +1 -1
- package/dist/components/pagination/pagination.mjs +1 -1
- package/dist/components/picker/datePicker.mjs +3 -3
- package/dist/components/picker/index.d.mts +1 -1
- package/dist/components/picker/index.d.ts +1 -1
- package/dist/components/picker/index.js +266 -679
- package/dist/components/picker/index.mjs +8 -8
- package/dist/components/picker/timePicker/Panel.d.mts +11 -0
- package/dist/components/picker/timePicker/Panel.d.ts +11 -0
- package/dist/components/picker/timePicker/Panel.js +740 -0
- package/dist/components/picker/timePicker/Panel.mjs +26 -0
- package/dist/components/picker/timePicker/WheelColumn.d.mts +10 -0
- package/dist/components/picker/timePicker/WheelColumn.d.ts +10 -0
- package/dist/components/picker/timePicker/WheelColumn.js +98 -0
- package/dist/components/picker/timePicker/WheelColumn.mjs +8 -0
- package/dist/components/picker/{timePicker.d.ts → timePicker/index.d.mts} +41 -52
- package/dist/components/picker/{timePicker.d.mts → timePicker/index.d.ts} +41 -52
- package/dist/components/picker/{timePicker.js → timePicker/index.js} +702 -1003
- package/dist/components/picker/timePicker/index.mjs +29 -0
- package/dist/components/picker/utils.d.mts +11 -1
- package/dist/components/picker/utils.d.ts +11 -1
- package/dist/components/picker/utils.js +28 -2
- package/dist/components/picker/utils.mjs +7 -3
- package/dist/components/select/index.mjs +1 -1
- package/dist/components/select/select.mjs +1 -1
- package/dist/components/starRating/index.mjs +1 -1
- package/dist/components/starRating/starRating.mjs +1 -1
- package/dist/components/table/index.mjs +1 -1
- package/dist/components/table/table-body.mjs +1 -1
- package/dist/components/table/table-head.mjs +1 -1
- package/dist/components/table/table.mjs +1 -1
- package/dist/components/timePicker/calendar.mjs +2 -2
- package/dist/components/timePicker/useDateTimePicker.mjs +1 -1
- package/dist/components/toast/index.mjs +1 -1
- package/dist/components/toast/toast.mjs +1 -1
- package/dist/components/toast/use-toast.mjs +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +479 -397
- package/dist/index.mjs +40 -38
- package/package.json +1 -1
- package/dist/chunk-COGGK5Q6.mjs +0 -365
- package/dist/chunk-FWFEKWWD.mjs +0 -18
- package/dist/components/picker/timePicker.mjs +0 -26
- package/dist/{chunk-IG7QEXDU.mjs → chunk-D72ILS4A.mjs} +3 -3
- package/dist/{chunk-YO4PZXCM.mjs → chunk-K3M3QEEV.mjs} +3 -3
|
@@ -5215,6 +5215,28 @@ var formatStringToDate = (date) => {
|
|
|
5215
5215
|
const formattedDate = new Date(date);
|
|
5216
5216
|
return formattedDate;
|
|
5217
5217
|
};
|
|
5218
|
+
var convert24To12 = (time24) => {
|
|
5219
|
+
const [HH, MM] = time24.split(":");
|
|
5220
|
+
let h = Number(HH);
|
|
5221
|
+
const minute = MM || "";
|
|
5222
|
+
const meridiem = h >= 12 ? "PM" : "AM";
|
|
5223
|
+
let hour12 = h % 12;
|
|
5224
|
+
if (hour12 === 0) hour12 = 12;
|
|
5225
|
+
const hour = String(hour12).padStart(2, "0");
|
|
5226
|
+
return { hour, minute, meridiem };
|
|
5227
|
+
};
|
|
5228
|
+
var getCurrent12Hour = () => {
|
|
5229
|
+
const now = /* @__PURE__ */ new Date();
|
|
5230
|
+
let hour = now.getHours();
|
|
5231
|
+
const minute = String(now.getMinutes()).padStart(2, "0");
|
|
5232
|
+
const meridiem = hour >= 12 ? "PM" : "AM";
|
|
5233
|
+
hour = hour % 12 || 12;
|
|
5234
|
+
return {
|
|
5235
|
+
hour: String(hour).padStart(2, "0"),
|
|
5236
|
+
minute,
|
|
5237
|
+
meridiem
|
|
5238
|
+
};
|
|
5239
|
+
};
|
|
5218
5240
|
|
|
5219
5241
|
// src/components/button/button.tsx
|
|
5220
5242
|
var import_react3 = require("react");
|
|
@@ -7173,712 +7195,262 @@ var datePickerStyle = tv({
|
|
|
7173
7195
|
}
|
|
7174
7196
|
});
|
|
7175
7197
|
|
|
7176
|
-
// src/components/picker/timePicker.tsx
|
|
7198
|
+
// src/components/picker/timePicker/index.tsx
|
|
7199
|
+
var import_react10 = require("react");
|
|
7200
|
+
var import_react_dom2 = require("react-dom");
|
|
7201
|
+
|
|
7202
|
+
// src/components/picker/timePicker/Panel.tsx
|
|
7177
7203
|
var import_react9 = require("react");
|
|
7178
|
-
var import_react_dom3 = require("react-dom");
|
|
7179
7204
|
|
|
7180
|
-
// src/components/
|
|
7205
|
+
// src/components/picker/timePicker/WheelColumn.tsx
|
|
7181
7206
|
var import_react8 = require("react");
|
|
7182
|
-
var import_react_dom2 = require("react-dom");
|
|
7183
7207
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
7184
|
-
var
|
|
7185
|
-
var
|
|
7186
|
-
|
|
7187
|
-
const
|
|
7188
|
-
const
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
enableSelectAll,
|
|
7198
|
-
dropdownIconName = "brace-up",
|
|
7199
|
-
optionIconName,
|
|
7200
|
-
optionIconPlacement,
|
|
7201
|
-
clearable,
|
|
7202
|
-
...inputProps
|
|
7203
|
-
} = props;
|
|
7204
|
-
const slots = (0, import_react8.useMemo)(() => select({ ...variantProps }), [variantProps]);
|
|
7205
|
-
const [selectedOptions, setSelectedOptions] = (0, import_react8.useState)(defaultSelectedOptions || []);
|
|
7206
|
-
const [targetRect, setTargetRect] = (0, import_react8.useState)(null);
|
|
7207
|
-
const [optionWrapperHeight, setOptionWrapperHeight] = (0, import_react8.useState)(0);
|
|
7208
|
-
const [isVisible, setIsVisible] = (0, import_react8.useState)(false);
|
|
7209
|
-
const [isOpen, setIsOpen] = (0, import_react8.useState)(false);
|
|
7210
|
-
const selectWrapperRef = (0, import_react8.useRef)(null);
|
|
7211
|
-
const optionWrapperRef = (0, import_react8.useRef)(null);
|
|
7212
|
-
const isControlled = originalProps.value !== void 0;
|
|
7213
|
-
const openSelect = () => {
|
|
7214
|
-
if (selectWrapperRef.current) {
|
|
7215
|
-
const rect = selectWrapperRef.current.getBoundingClientRect();
|
|
7216
|
-
setTargetRect(rect);
|
|
7217
|
-
setIsVisible(true);
|
|
7218
|
-
requestAnimationFrame(() => setIsOpen(true));
|
|
7219
|
-
}
|
|
7220
|
-
};
|
|
7221
|
-
const closeSelect = () => {
|
|
7222
|
-
setIsOpen(false);
|
|
7223
|
-
setTimeout(() => setIsVisible(false), 150);
|
|
7224
|
-
};
|
|
7225
|
-
const handleToggleSelect = () => {
|
|
7226
|
-
isOpen ? closeSelect() : openSelect();
|
|
7208
|
+
var ITEM_HEIGHT = 30;
|
|
7209
|
+
var ACTIVE_HEIGHT = 34;
|
|
7210
|
+
function WheelColumn({ list, value, onChange }) {
|
|
7211
|
+
const ref = (0, import_react8.useRef)(null);
|
|
7212
|
+
const internalChangeRef = (0, import_react8.useRef)(false);
|
|
7213
|
+
const [currentIndex, setCurrentIndex] = (0, import_react8.useState)(0);
|
|
7214
|
+
const scrollToIndex = (index, behavior = "smooth") => {
|
|
7215
|
+
if (!ref.current) return;
|
|
7216
|
+
const diff = ACTIVE_HEIGHT - ITEM_HEIGHT;
|
|
7217
|
+
let centerOffset = index > 0 && behavior === "auto" ? diff : 0;
|
|
7218
|
+
if (behavior === "auto" && currentIndex !== 0) centerOffset -= 4;
|
|
7219
|
+
const top = index * ITEM_HEIGHT + centerOffset;
|
|
7220
|
+
ref.current.scrollTo({ top, behavior });
|
|
7227
7221
|
};
|
|
7228
|
-
const
|
|
7229
|
-
|
|
7230
|
-
const
|
|
7231
|
-
|
|
7232
|
-
|
|
7233
|
-
|
|
7234
|
-
return {
|
|
7235
|
-
top: top + scrollTop,
|
|
7236
|
-
left: rect.x + scrollLeft
|
|
7237
|
-
};
|
|
7222
|
+
const finalizeScroll = (index) => {
|
|
7223
|
+
internalChangeRef.current = true;
|
|
7224
|
+
const v = list[index];
|
|
7225
|
+
setCurrentIndex(index);
|
|
7226
|
+
scrollToIndex(index, "smooth");
|
|
7227
|
+
if (v) onChange(v);
|
|
7238
7228
|
};
|
|
7239
|
-
const
|
|
7240
|
-
|
|
7241
|
-
if (
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
}
|
|
7248
|
-
} else {
|
|
7249
|
-
nextOptions = [option];
|
|
7250
|
-
closeSelect();
|
|
7229
|
+
const handleClick = (index) => finalizeScroll(index);
|
|
7230
|
+
(0, import_react8.useEffect)(() => {
|
|
7231
|
+
if (!ref.current || !value) return;
|
|
7232
|
+
const idx = list.indexOf(value);
|
|
7233
|
+
if (idx < 0) return;
|
|
7234
|
+
if (internalChangeRef.current) {
|
|
7235
|
+
internalChangeRef.current = false;
|
|
7236
|
+
return;
|
|
7251
7237
|
}
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
};
|
|
7255
|
-
const handleClear = (e) => {
|
|
7256
|
-
e.stopPropagation();
|
|
7257
|
-
setSelectedOptions([]);
|
|
7258
|
-
onChange == null ? void 0 : onChange([]);
|
|
7259
|
-
};
|
|
7238
|
+
setCurrentIndex(idx);
|
|
7239
|
+
scrollToIndex(idx, "auto");
|
|
7240
|
+
}, [value]);
|
|
7260
7241
|
(0, import_react8.useEffect)(() => {
|
|
7261
|
-
const
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7242
|
+
const el = ref.current;
|
|
7243
|
+
if (!el) return;
|
|
7244
|
+
const handleWheel = (e) => {
|
|
7245
|
+
e.preventDefault();
|
|
7246
|
+
let newIndex = currentIndex;
|
|
7247
|
+
if (e.deltaY > 0) {
|
|
7248
|
+
newIndex = Math.min(currentIndex + 1, list.length - 1);
|
|
7249
|
+
} else if (e.deltaY < 0) {
|
|
7250
|
+
newIndex = Math.max(currentIndex - 1, 0);
|
|
7266
7251
|
}
|
|
7252
|
+
finalizeScroll(newIndex);
|
|
7267
7253
|
};
|
|
7268
|
-
|
|
7269
|
-
return () =>
|
|
7270
|
-
}, []);
|
|
7271
|
-
(0,
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
}, [originalProps.value, defaultSelectedOptions, options]);
|
|
7285
|
-
const position = targetRect ? calculatePositionWithScroll(targetRect, optionWrapperHeight) : null;
|
|
7286
|
-
let allOptionValue = "";
|
|
7287
|
-
if (multiple) {
|
|
7288
|
-
if (selectedOptions.length === 0) {
|
|
7289
|
-
allOptionValue = "\uC804\uCCB4 \uC120\uD0DD";
|
|
7290
|
-
} else if (selectedOptions.length === options.length) {
|
|
7291
|
-
allOptionValue = `\uC804\uCCB4 (${options.length}) \uC120\uD0DD\uB428`;
|
|
7292
|
-
} else {
|
|
7293
|
-
allOptionValue = `${selectedOptions.length} / ${options.length} \uC120\uD0DD\uB428`;
|
|
7294
|
-
}
|
|
7295
|
-
} else {
|
|
7296
|
-
allOptionValue = ((_a = selectedOptions[0]) == null ? void 0 : _a.label) || "";
|
|
7297
|
-
}
|
|
7298
|
-
const displayValue = multiple ? selectedOptions.map((opt) => opt.label).join(", ") : ((_b = selectedOptions[0]) == null ? void 0 : _b.label) || "";
|
|
7299
|
-
const selectedValue = multiple ? selectedOptions.map((opt) => opt.value).join(",") : ((_c = selectedOptions[0]) == null ? void 0 : _c.value) || "";
|
|
7300
|
-
const renderOptions = () => {
|
|
7301
|
-
if (!isVisible) return null;
|
|
7302
|
-
const renderedOptions = [...options];
|
|
7303
|
-
if (multiple && enableSelectAll) {
|
|
7304
|
-
renderedOptions.unshift({ label: allOptionValue, value: ALL_OPTION_VALUE });
|
|
7305
|
-
}
|
|
7306
|
-
return (0, import_react_dom2.createPortal)(
|
|
7307
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
7308
|
-
"div",
|
|
7309
|
-
{
|
|
7310
|
-
ref: optionWrapperRef,
|
|
7311
|
-
role: "listbox",
|
|
7312
|
-
className: slots.optionsWrapper({ class: classNames == null ? void 0 : classNames.optionsWrapper }),
|
|
7313
|
-
style: {
|
|
7314
|
-
position: "absolute",
|
|
7315
|
-
top: position == null ? void 0 : position.top,
|
|
7316
|
-
left: position == null ? void 0 : position.left,
|
|
7317
|
-
width: targetRect == null ? void 0 : targetRect.width,
|
|
7318
|
-
zIndex: 1e3,
|
|
7319
|
-
opacity: isOpen ? 1 : 0,
|
|
7320
|
-
transform: isOpen ? "translateY(0)" : "translateY(-0.25rem)",
|
|
7321
|
-
transition: "opacity 150ms ease-out, transform 150ms ease-out"
|
|
7254
|
+
el.addEventListener("wheel", handleWheel, { passive: false });
|
|
7255
|
+
return () => el.removeEventListener("wheel", handleWheel);
|
|
7256
|
+
}, [currentIndex, list, onChange]);
|
|
7257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "relative h-[94px] w-[40px]", children: [
|
|
7258
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "pointer-events-none absolute left-1/2 top-[30px] h-[34px] w-[40px] -translate-x-1/2 rounded-[10px] shadow-[inset_0_0_0_1.5px_var(--dn-primary-light)]" }),
|
|
7259
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { ref, className: "scrollbar-none relative h-full select-none overflow-y-scroll py-[0]", children: [
|
|
7260
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { height: ITEM_HEIGHT } }),
|
|
7261
|
+
list.map((v, i) => {
|
|
7262
|
+
const isActive = i === currentIndex;
|
|
7263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
7264
|
+
"div",
|
|
7265
|
+
{
|
|
7266
|
+
onClick: () => handleClick(i),
|
|
7267
|
+
className: `flex items-center justify-center text-sm font-bold transition-all ${isActive ? "text-body-foreground" : "text-neutral-light"}`,
|
|
7268
|
+
style: { height: isActive ? ACTIVE_HEIGHT : ITEM_HEIGHT },
|
|
7269
|
+
children: v
|
|
7322
7270
|
},
|
|
7323
|
-
|
|
7324
|
-
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
|
|
7328
|
-
role: "option",
|
|
7329
|
-
onClick: () => handleChangeOption(option),
|
|
7330
|
-
className: clsx(
|
|
7331
|
-
select({ ...variantProps, isSelected }).option({ class: classNames == null ? void 0 : classNames.option }),
|
|
7332
|
-
optionIconPlacement === "end" ? "justify-between" : ""
|
|
7333
|
-
),
|
|
7334
|
-
children: [
|
|
7335
|
-
optionIconName && optionIconPlacement === "start" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon_default, { name: optionIconName, size: originalProps.size }),
|
|
7336
|
-
option.label,
|
|
7337
|
-
optionIconName && optionIconPlacement === "end" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon_default, { name: optionIconName, size: originalProps.size })
|
|
7338
|
-
]
|
|
7339
|
-
},
|
|
7340
|
-
option.value
|
|
7341
|
-
);
|
|
7342
|
-
})
|
|
7343
|
-
}
|
|
7344
|
-
),
|
|
7345
|
-
document.body
|
|
7346
|
-
);
|
|
7347
|
-
};
|
|
7348
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
7349
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
7350
|
-
"div",
|
|
7351
|
-
{
|
|
7352
|
-
className: clsx(
|
|
7353
|
-
slots.base({ class: classNames == null ? void 0 : classNames.base }),
|
|
7354
|
-
variantProps.direction === "horizon" ? slots.horizon({ class: classNames == null ? void 0 : classNames.horizon }) : slots.vertical({ class: classNames == null ? void 0 : classNames.vertical })
|
|
7355
|
-
),
|
|
7356
|
-
children: [
|
|
7357
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
7358
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
7359
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
7360
|
-
"div",
|
|
7361
|
-
{
|
|
7362
|
-
"data-expanded": isOpen,
|
|
7363
|
-
className: clsx(
|
|
7364
|
-
slots.selectWrapper({ class: classNames == null ? void 0 : classNames.selectWrapper }),
|
|
7365
|
-
inputProps.readOnly ? slots.readonly({ class: classNames == null ? void 0 : classNames.readonly }) : ""
|
|
7366
|
-
),
|
|
7367
|
-
ref: selectWrapperRef,
|
|
7368
|
-
onClick: handleToggleSelect,
|
|
7369
|
-
children: [
|
|
7370
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
7371
|
-
"input",
|
|
7372
|
-
{
|
|
7373
|
-
...inputProps,
|
|
7374
|
-
ref,
|
|
7375
|
-
className: clsx(
|
|
7376
|
-
slots.select({ class: classNames == null ? void 0 : classNames.select }),
|
|
7377
|
-
inputProps.readOnly ? "!placeholder:text-body-foreground" : ""
|
|
7378
|
-
),
|
|
7379
|
-
name: void 0,
|
|
7380
|
-
value: displayValue,
|
|
7381
|
-
readOnly: true,
|
|
7382
|
-
size: 0
|
|
7383
|
-
}
|
|
7384
|
-
),
|
|
7385
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { type: "hidden", name: inputProps.name, value: selectedValue }),
|
|
7386
|
-
clearable && selectedOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
7387
|
-
icon_button_default,
|
|
7388
|
-
{
|
|
7389
|
-
name: "close",
|
|
7390
|
-
variant: "ghost",
|
|
7391
|
-
size: "sm",
|
|
7392
|
-
color: "neutral",
|
|
7393
|
-
onClick: handleClear,
|
|
7394
|
-
classNames: { base: "pr-[2px]" }
|
|
7395
|
-
}
|
|
7396
|
-
),
|
|
7397
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
7398
|
-
Icon_default,
|
|
7399
|
-
{
|
|
7400
|
-
name: dropdownIconName,
|
|
7401
|
-
size: originalProps.size,
|
|
7402
|
-
className: `transition-transform duration-200 ${isOpen ? "rotate-0" : "rotate-180"}`
|
|
7403
|
-
}
|
|
7404
|
-
)
|
|
7405
|
-
]
|
|
7406
|
-
}
|
|
7407
|
-
),
|
|
7408
|
-
helperMessage && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: slots.helperMessage({ class: classNames == null ? void 0 : classNames.helperMessage }), children: helperMessage }),
|
|
7409
|
-
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: clsx("error", slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })), children: errorMessage })
|
|
7410
|
-
] })
|
|
7411
|
-
]
|
|
7412
|
-
}
|
|
7413
|
-
),
|
|
7414
|
-
renderOptions()
|
|
7271
|
+
i
|
|
7272
|
+
);
|
|
7273
|
+
}),
|
|
7274
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { height: list.length >= 3 ? ITEM_HEIGHT + 4 : ITEM_HEIGHT } })
|
|
7275
|
+
] })
|
|
7415
7276
|
] });
|
|
7416
|
-
}
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
var
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
"
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
"group-has-[p.error]/select:text-danger-main",
|
|
7437
|
-
"group-has-[p.error]/select:hover:bg-danger-soft"
|
|
7438
|
-
],
|
|
7439
|
-
select: [
|
|
7440
|
-
"bg-transparent",
|
|
7441
|
-
"w-full",
|
|
7442
|
-
"outline-none",
|
|
7443
|
-
"placeholder:text-neutral-main",
|
|
7444
|
-
"text-body-foreground",
|
|
7445
|
-
"group-has-[p.error]/select:text-danger-main",
|
|
7446
|
-
"group-has-[p.error]/select:placeholder:text-danger-main",
|
|
7447
|
-
"truncate"
|
|
7448
|
-
],
|
|
7449
|
-
optionsWrapper: ["bg-body-background", "overflow-auto", "flex", "flex-col", "gap-[10px]"],
|
|
7450
|
-
option: [
|
|
7451
|
-
"flex",
|
|
7452
|
-
"items-center",
|
|
7453
|
-
"cursor-pointer",
|
|
7454
|
-
"text-neutral-dark",
|
|
7455
|
-
"hover:bg-trans-soft",
|
|
7456
|
-
"hover:text-neutral-strong"
|
|
7457
|
-
],
|
|
7458
|
-
helperMessage: ["text-neutral-main"],
|
|
7459
|
-
errorMessage: ["text-danger-main"],
|
|
7460
|
-
readonly: ["pointer-events-none", "!bg-trans-soft"]
|
|
7461
|
-
},
|
|
7462
|
-
variants: {
|
|
7463
|
-
variant: {
|
|
7464
|
-
solid: {
|
|
7465
|
-
selectWrapper: ["border-transparent", "bg-trans-soft"],
|
|
7466
|
-
option: [],
|
|
7467
|
-
readonlyWrapper: ["!bg-trans-light"]
|
|
7468
|
-
},
|
|
7469
|
-
outline: {
|
|
7470
|
-
selectWrapper: [
|
|
7471
|
-
"border-neutral-light",
|
|
7472
|
-
"border",
|
|
7473
|
-
"group-has-[:hover]/select:bg-trans-soft",
|
|
7474
|
-
"group-has-[:focus]/select:bg-body-background",
|
|
7475
|
-
"group-has-[p.error]/select:border-danger-main"
|
|
7476
|
-
],
|
|
7477
|
-
option: [],
|
|
7478
|
-
readonlyWrapper: ["!bg-trans-soft"]
|
|
7479
|
-
},
|
|
7480
|
-
underline: {
|
|
7481
|
-
selectWrapper: [
|
|
7482
|
-
"bg-transparent",
|
|
7483
|
-
"border-neutral-light",
|
|
7484
|
-
"!rounded-none",
|
|
7485
|
-
"group-has-[:hover]/select:bg-trans-soft",
|
|
7486
|
-
"group-has-[:focus]/select:bg-body-background",
|
|
7487
|
-
"group-has-[p.error]/select:border-danger-main"
|
|
7488
|
-
],
|
|
7489
|
-
option: ["!rounded-none"],
|
|
7490
|
-
readonlyWrapper: ["!bg-trans-soft"]
|
|
7491
|
-
}
|
|
7492
|
-
},
|
|
7493
|
-
color: {
|
|
7494
|
-
primary: {
|
|
7495
|
-
selectWrapper: ["text-primary-main"],
|
|
7496
|
-
option: [],
|
|
7497
|
-
helperMessage: ["text-primary-main"]
|
|
7498
|
-
},
|
|
7499
|
-
secondary: {
|
|
7500
|
-
selectWrapper: ["text-secondary-main"],
|
|
7501
|
-
option: [],
|
|
7502
|
-
helperMessage: ["text-secondary-main"]
|
|
7503
|
-
}
|
|
7504
|
-
},
|
|
7505
|
-
size: {
|
|
7506
|
-
sm: {
|
|
7507
|
-
base: ["text-sm", "gap-[4px]"],
|
|
7508
|
-
label: ["text-sm"],
|
|
7509
|
-
wrapper: ["gap-[4px]"],
|
|
7510
|
-
selectWrapper: ["w-[240px]", "h-[24px]", "rounded-sm", "px-[4px]"],
|
|
7511
|
-
select: ["text-sm"],
|
|
7512
|
-
optionsWrapper: ["shadow-drop-sm", "rounded-sm", "p-[4px]"],
|
|
7513
|
-
option: ["px-[4px]", "py-[3px]", "rounded-sm", "text-sm", "gap-[4px]"],
|
|
7514
|
-
helperMessage: ["text-sm"],
|
|
7515
|
-
errorMessage: ["text-sm"]
|
|
7516
|
-
},
|
|
7517
|
-
md: {
|
|
7518
|
-
base: ["text-md", "gap-[6px]", "rounded-md"],
|
|
7519
|
-
label: ["text-md"],
|
|
7520
|
-
wrapper: ["gap-[6px]"],
|
|
7521
|
-
selectWrapper: ["w-[240px]", "h-[32px]", "rounded-md", "px-[6px]"],
|
|
7522
|
-
select: ["text-md"],
|
|
7523
|
-
optionsWrapper: ["shadow-drop-md", "rounded-md", "p-[6px]"],
|
|
7524
|
-
option: ["px-[6px]", "py-[5.5px]", "rounded-md", "text-md", "gap-[6px]"],
|
|
7525
|
-
helperMessage: ["text-sm"],
|
|
7526
|
-
errorMessage: ["text-sm"]
|
|
7527
|
-
},
|
|
7528
|
-
lg: {
|
|
7529
|
-
base: ["text-lg", "gap-[8px]"],
|
|
7530
|
-
label: ["text-lg"],
|
|
7531
|
-
wrapper: ["gap-[8px]"],
|
|
7532
|
-
selectWrapper: ["w-[240px]", "h-[40px]", "rounded-lg", "px-[8px]"],
|
|
7533
|
-
select: ["text-lg"],
|
|
7534
|
-
optionsWrapper: ["shadow-drop-lg", "rounded-lg", "p-[8px]"],
|
|
7535
|
-
option: ["px-[8px]", "py-[8px]", "rounded-lg", "text-lg", "gap-[8px]"],
|
|
7536
|
-
helperMessage: ["text-md"],
|
|
7537
|
-
errorMessage: ["text-md"]
|
|
7538
|
-
},
|
|
7539
|
-
xl: {
|
|
7540
|
-
base: ["text-xl", "gap-[10px]"],
|
|
7541
|
-
label: ["text-xl"],
|
|
7542
|
-
wrapper: ["gap-[10px]"],
|
|
7543
|
-
selectWrapper: ["w-[240px]", "h-[50px]", "rounded-xl", "px-[10px]"],
|
|
7544
|
-
select: ["text-xl"],
|
|
7545
|
-
optionsWrapper: ["shadow-drop-xl", "rounded-xl", "p-[10px]"],
|
|
7546
|
-
option: ["px-[10px]", "py-[11.5px]", "rounded-xl", "text-xl", "gap-[10px]"],
|
|
7547
|
-
helperMessage: ["text-md"],
|
|
7548
|
-
errorMessage: ["text-md"]
|
|
7549
|
-
}
|
|
7550
|
-
},
|
|
7551
|
-
direction: {
|
|
7552
|
-
vertical: "",
|
|
7553
|
-
horizon: ""
|
|
7554
|
-
},
|
|
7555
|
-
full: {
|
|
7556
|
-
true: {
|
|
7557
|
-
base: ["w-full"],
|
|
7558
|
-
wrapper: ["w-full"],
|
|
7559
|
-
selectWrapper: ["w-full"]
|
|
7560
|
-
}
|
|
7561
|
-
},
|
|
7562
|
-
disabled: {
|
|
7563
|
-
true: {
|
|
7564
|
-
base: ["pointer-events-none"],
|
|
7565
|
-
selectWrapper: [
|
|
7566
|
-
"bg-neutral-soft",
|
|
7567
|
-
"border-neutral-light",
|
|
7568
|
-
"group-has-[p.error]/select:text-danger-light",
|
|
7569
|
-
"group-has-[p.error]/select:bg-danger-soft",
|
|
7570
|
-
"group-has-[p.error]/select:border-danger-light"
|
|
7571
|
-
],
|
|
7572
|
-
select: [
|
|
7573
|
-
"text-neutral-light",
|
|
7574
|
-
"placeholder:text-neutral-light",
|
|
7575
|
-
"group-has-[p.error]/select:text-danger-light",
|
|
7576
|
-
"group-has-[p.error]/select:placeholder:text-danger-light"
|
|
7577
|
-
],
|
|
7578
|
-
helperMessage: ["!text-neutral-light"],
|
|
7579
|
-
errorMessage: ["!text-danger-light"]
|
|
7580
|
-
}
|
|
7581
|
-
},
|
|
7582
|
-
isSelected: {
|
|
7583
|
-
true: "",
|
|
7584
|
-
false: ""
|
|
7585
|
-
}
|
|
7586
|
-
},
|
|
7587
|
-
compoundVariants: [
|
|
7588
|
-
{
|
|
7589
|
-
variant: "outline",
|
|
7590
|
-
size: "sm",
|
|
7591
|
-
class: {
|
|
7592
|
-
option: ["hover:shadow-[inset_0_0_0_1px_var(--dn-neutral-light)]"]
|
|
7593
|
-
}
|
|
7594
|
-
},
|
|
7595
|
-
{
|
|
7596
|
-
variant: "outline",
|
|
7597
|
-
size: "md",
|
|
7598
|
-
class: {
|
|
7599
|
-
option: ["hover:shadow-[inset_0_0_0_1.25px_var(--dn-neutral-light)]"]
|
|
7600
|
-
}
|
|
7601
|
-
},
|
|
7602
|
-
{
|
|
7603
|
-
variant: "outline",
|
|
7604
|
-
size: "lg",
|
|
7605
|
-
class: {
|
|
7606
|
-
option: ["hover:shadow-[inset_0_0_0_1.5px_var(--dn-neutral-light)]"]
|
|
7607
|
-
}
|
|
7608
|
-
},
|
|
7609
|
-
{
|
|
7610
|
-
variant: "outline",
|
|
7611
|
-
size: "xl",
|
|
7612
|
-
class: {
|
|
7613
|
-
option: ["hover:shadow-[inset_0_0_0_1.75px_var(--dn-neutral-light)]"]
|
|
7614
|
-
}
|
|
7615
|
-
},
|
|
7616
|
-
{
|
|
7617
|
-
variant: "underline",
|
|
7618
|
-
size: "sm",
|
|
7619
|
-
class: {
|
|
7620
|
-
selectWrapper: ["border-b-sm"],
|
|
7621
|
-
option: ["hover:shadow-[inset_0_-1px_0_0_var(--dn-neutral-light)]"]
|
|
7622
|
-
}
|
|
7623
|
-
},
|
|
7624
|
-
{
|
|
7625
|
-
variant: "underline",
|
|
7626
|
-
size: "md",
|
|
7627
|
-
class: {
|
|
7628
|
-
selectWrapper: ["border-b-md"],
|
|
7629
|
-
option: ["hover:shadow-[inset_0_-1.25px_0_0_var(--dn-neutral-light)]"]
|
|
7630
|
-
}
|
|
7631
|
-
},
|
|
7632
|
-
{
|
|
7633
|
-
variant: "underline",
|
|
7634
|
-
size: "lg",
|
|
7635
|
-
class: {
|
|
7636
|
-
selectWrapper: ["border-b-lg"],
|
|
7637
|
-
option: ["hover:shadow-[inset_0_-1.5px_0_0_var(--dn-neutral-light)]"]
|
|
7638
|
-
}
|
|
7639
|
-
},
|
|
7640
|
-
{
|
|
7641
|
-
variant: "underline",
|
|
7642
|
-
size: "xl",
|
|
7643
|
-
class: {
|
|
7644
|
-
selectWrapper: ["border-b-xl"],
|
|
7645
|
-
option: ["hover:shadow-[inset_0_-1.75px_0_0_var(--dn-neutral-light)]"]
|
|
7646
|
-
}
|
|
7647
|
-
},
|
|
7648
|
-
{
|
|
7649
|
-
color: "primary",
|
|
7650
|
-
isSelected: true,
|
|
7651
|
-
class: {
|
|
7652
|
-
option: ["text-primary-main"]
|
|
7653
|
-
}
|
|
7654
|
-
},
|
|
7655
|
-
{
|
|
7656
|
-
color: "secondary",
|
|
7657
|
-
isSelected: true,
|
|
7658
|
-
class: {
|
|
7659
|
-
option: ["text-secondary-main"]
|
|
7277
|
+
}
|
|
7278
|
+
|
|
7279
|
+
// src/components/picker/timePicker/Panel.tsx
|
|
7280
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
7281
|
+
var hours = [...Array(12)].map((_, i) => String(i + 1).padStart(2, "0"));
|
|
7282
|
+
var minutes = [...Array(60)].map((_, i) => String(i).padStart(2, "0"));
|
|
7283
|
+
var meridiemList = ["AM", "PM"];
|
|
7284
|
+
var TimePickerPanel = (0, import_react9.forwardRef)(
|
|
7285
|
+
({ value, onChange, nowTitle, confirmTitle }, ref) => {
|
|
7286
|
+
const [time, setTime] = (0, import_react9.useState)({ hour: "", minute: "", meridiem: "" });
|
|
7287
|
+
const handleNow = () => {
|
|
7288
|
+
setTime(getCurrent12Hour());
|
|
7289
|
+
};
|
|
7290
|
+
const handleConfirm = (time2) => {
|
|
7291
|
+
const { hour, minute, meridiem } = time2;
|
|
7292
|
+
let h = Number(hour);
|
|
7293
|
+
if (meridiem === "AM") {
|
|
7294
|
+
if (h === 12) h = 0;
|
|
7295
|
+
} else {
|
|
7296
|
+
if (h !== 12) h += 12;
|
|
7660
7297
|
}
|
|
7661
|
-
|
|
7662
|
-
|
|
7663
|
-
|
|
7664
|
-
|
|
7665
|
-
|
|
7666
|
-
|
|
7667
|
-
|
|
7668
|
-
|
|
7669
|
-
|
|
7298
|
+
const HH = String(h).padStart(2, "0");
|
|
7299
|
+
const MM = minute.padStart(2, "0");
|
|
7300
|
+
const SS = "00";
|
|
7301
|
+
onChange(`${HH}:${MM}:${SS}`);
|
|
7302
|
+
};
|
|
7303
|
+
(0, import_react9.useEffect)(() => {
|
|
7304
|
+
setTime(value ? convert24To12(value) : getCurrent12Hour());
|
|
7305
|
+
}, [value]);
|
|
7306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
7307
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { ref, className: "flex gap-[10px]", children: [
|
|
7308
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center justify-center gap-[5px]", children: [
|
|
7309
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(WheelColumn, { list: hours, value: time.hour, onChange: (v) => setTime({ ...time, hour: v }) }),
|
|
7310
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "w-[5px] text-sm font-bold", children: ":" }),
|
|
7311
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(WheelColumn, { list: minutes, value: time.minute, onChange: (v) => setTime({ ...time, minute: v }) })
|
|
7312
|
+
] }),
|
|
7313
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(WheelColumn, { list: meridiemList, value: time.meridiem, onChange: (v) => setTime({ ...time, meridiem: v }) })
|
|
7314
|
+
] }),
|
|
7315
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex justify-between px-1 text-sm", children: [
|
|
7316
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
7317
|
+
text_button_default,
|
|
7318
|
+
{
|
|
7319
|
+
variant: "underline",
|
|
7320
|
+
color: "neutral",
|
|
7321
|
+
size: "sm",
|
|
7322
|
+
classNames: { base: "font-bold" },
|
|
7323
|
+
onClick: handleNow,
|
|
7324
|
+
children: nowTitle
|
|
7325
|
+
}
|
|
7326
|
+
),
|
|
7327
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
7328
|
+
text_button_default,
|
|
7329
|
+
{
|
|
7330
|
+
variant: "underline",
|
|
7331
|
+
size: "sm",
|
|
7332
|
+
classNames: { base: "font-bold" },
|
|
7333
|
+
onClick: () => handleConfirm(time),
|
|
7334
|
+
children: confirmTitle
|
|
7335
|
+
}
|
|
7336
|
+
)
|
|
7337
|
+
] })
|
|
7338
|
+
] });
|
|
7670
7339
|
}
|
|
7671
|
-
|
|
7340
|
+
);
|
|
7341
|
+
var Panel_default = TimePickerPanel;
|
|
7672
7342
|
|
|
7673
|
-
// src/components/picker/timePicker.tsx
|
|
7674
|
-
var
|
|
7675
|
-
var TimePicker = (0,
|
|
7343
|
+
// src/components/picker/timePicker/index.tsx
|
|
7344
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
7345
|
+
var TimePicker = (0, import_react10.forwardRef)((originalProps, ref) => {
|
|
7676
7346
|
const [props, variantProps] = mapPropsVariants(originalProps, timePickerStyle.variantKeys);
|
|
7677
7347
|
const {
|
|
7678
7348
|
classNames,
|
|
7679
7349
|
label,
|
|
7680
7350
|
errorMessage,
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
size,
|
|
7684
|
-
|
|
7351
|
+
value,
|
|
7352
|
+
onChange,
|
|
7353
|
+
size = "md",
|
|
7354
|
+
variant = "solid",
|
|
7355
|
+
full = false,
|
|
7356
|
+
disabled = false,
|
|
7685
7357
|
placeholder = "",
|
|
7358
|
+
nowTitle,
|
|
7359
|
+
confirmTitle,
|
|
7686
7360
|
...inputProps
|
|
7687
|
-
} = props;
|
|
7688
|
-
const
|
|
7689
|
-
|
|
7690
|
-
);
|
|
7691
|
-
const
|
|
7692
|
-
const
|
|
7693
|
-
|
|
7694
|
-
|
|
7695
|
-
|
|
7696
|
-
|
|
7697
|
-
|
|
7698
|
-
}
|
|
7699
|
-
return
|
|
7700
|
-
}, [
|
|
7701
|
-
const calculatePosition = (0,
|
|
7361
|
+
} = { ...props, ...variantProps };
|
|
7362
|
+
const slots = (0, import_react10.useMemo)(() => timePickerStyle({ ...variantProps }), [variantProps]);
|
|
7363
|
+
const [isPanelOpen, setIsPanelOpen] = (0, import_react10.useState)(false);
|
|
7364
|
+
const inputWrapperRef = (0, import_react10.useRef)(null);
|
|
7365
|
+
const panelWrapperRef = (0, import_react10.useRef)(null);
|
|
7366
|
+
const [panelPos, setPanelPos] = (0, import_react10.useState)({
|
|
7367
|
+
top: -9999,
|
|
7368
|
+
left: -9999
|
|
7369
|
+
});
|
|
7370
|
+
const displayValue = (0, import_react10.useMemo)(() => {
|
|
7371
|
+
if (!value) return "";
|
|
7372
|
+
const { hour, minute, meridiem } = convert24To12(value);
|
|
7373
|
+
return `${hour}:${minute} ${meridiem}`;
|
|
7374
|
+
}, [value]);
|
|
7375
|
+
const calculatePosition = (0, import_react10.useCallback)(() => {
|
|
7702
7376
|
if (inputWrapperRef.current) {
|
|
7703
7377
|
const rect = inputWrapperRef.current.getBoundingClientRect();
|
|
7704
|
-
setPanelPos({
|
|
7378
|
+
setPanelPos({
|
|
7379
|
+
top: rect.bottom + window.scrollY + 6,
|
|
7380
|
+
left: rect.left + window.scrollX
|
|
7381
|
+
});
|
|
7705
7382
|
}
|
|
7706
7383
|
}, []);
|
|
7707
|
-
const
|
|
7384
|
+
const openPanel = () => {
|
|
7708
7385
|
calculatePosition();
|
|
7709
7386
|
setIsPanelOpen(true);
|
|
7710
7387
|
};
|
|
7711
|
-
const
|
|
7712
|
-
|
|
7388
|
+
const handleInputFocus = () => {
|
|
7389
|
+
openPanel();
|
|
7713
7390
|
};
|
|
7714
7391
|
const handleInputKeyDown = (e) => {
|
|
7715
7392
|
if (e.key === "Enter" || e.key === " ") {
|
|
7716
7393
|
e.preventDefault();
|
|
7717
7394
|
calculatePosition();
|
|
7718
7395
|
setIsPanelOpen((prev) => !prev);
|
|
7719
|
-
} else if (e.key === "Escape")
|
|
7720
|
-
setIsPanelOpen(false);
|
|
7721
|
-
}
|
|
7722
|
-
};
|
|
7723
|
-
const slots = (0, import_react9.useMemo)(() => timePickerStyle({ ...variantProps }), [variantProps]);
|
|
7724
|
-
const renderHourOptions = () => {
|
|
7725
|
-
return Array.from({ length: 24 }, (_, i) => {
|
|
7726
|
-
const value = String(i).padStart(2, "0");
|
|
7727
|
-
return { label: value, value };
|
|
7728
|
-
});
|
|
7729
|
-
};
|
|
7730
|
-
const renderMinuteOptions = () => {
|
|
7731
|
-
return Array.from({ length: 60 }, (_, i) => {
|
|
7732
|
-
const value = String(i).padStart(2, "0");
|
|
7733
|
-
return { label: value, value };
|
|
7734
|
-
});
|
|
7396
|
+
} else if (e.key === "Escape") setIsPanelOpen(false);
|
|
7735
7397
|
};
|
|
7736
|
-
const
|
|
7737
|
-
|
|
7738
|
-
|
|
7398
|
+
const handleChange = (time) => {
|
|
7399
|
+
onChange == null ? void 0 : onChange(time);
|
|
7400
|
+
setIsPanelOpen(false);
|
|
7739
7401
|
};
|
|
7740
|
-
|
|
7741
|
-
const
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
const range = {
|
|
7748
|
-
start: `${type === "startHour" ? option.value : sh}:${type === "startMinute" ? option.value : sm}`,
|
|
7749
|
-
end: `${type === "endHour" ? option.value : eh}:${type === "endMinute" ? option.value : em}`
|
|
7402
|
+
(0, import_react10.useEffect)(() => {
|
|
7403
|
+
const handleClickOutside = (e) => {
|
|
7404
|
+
var _a, _b;
|
|
7405
|
+
const target = e.target;
|
|
7406
|
+
if ((_a = inputWrapperRef.current) == null ? void 0 : _a.contains(target)) return;
|
|
7407
|
+
if ((_b = panelWrapperRef.current) == null ? void 0 : _b.contains(target)) return;
|
|
7408
|
+
setIsPanelOpen(false);
|
|
7750
7409
|
};
|
|
7751
|
-
|
|
7752
|
-
|
|
7753
|
-
};
|
|
7754
|
-
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
|
|
7771
|
-
|
|
7772
|
-
|
|
7773
|
-
|
|
7774
|
-
|
|
7775
|
-
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
onBlur: handleInputBlur,
|
|
7785
|
-
onKeyDown: handleInputKeyDown
|
|
7786
|
-
}
|
|
7787
|
-
),
|
|
7788
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }), children: [
|
|
7789
|
-
displayValue && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
7790
|
-
Icon_default,
|
|
7791
|
-
{
|
|
7792
|
-
name: "close",
|
|
7793
|
-
className: "text-neutral-light hover:text-neutral-main mr-[5px] cursor-pointer",
|
|
7794
|
-
onClick: (e) => {
|
|
7795
|
-
e.stopPropagation();
|
|
7796
|
-
handleClearRange();
|
|
7797
|
-
}
|
|
7798
|
-
}
|
|
7799
|
-
),
|
|
7800
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
7801
|
-
Icon_default,
|
|
7802
|
-
{
|
|
7803
|
-
name: "clock",
|
|
7804
|
-
className: "cursor-pointer",
|
|
7805
|
-
onClick: () => {
|
|
7806
|
-
calculatePosition();
|
|
7807
|
-
setIsPanelOpen((v) => !v);
|
|
7808
|
-
}
|
|
7809
|
-
}
|
|
7810
|
-
)
|
|
7811
|
-
] })
|
|
7812
|
-
] }),
|
|
7813
|
-
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: clsx("error", slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })), children: errorMessage })
|
|
7814
|
-
] })
|
|
7815
|
-
] }),
|
|
7816
|
-
isPanelOpen && (0, import_react_dom3.createPortal)(
|
|
7817
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
7410
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
7411
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
7412
|
+
}, []);
|
|
7413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
7414
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ref: inputWrapperRef, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), onClick: openPanel, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
7415
|
+
input_default,
|
|
7416
|
+
{
|
|
7417
|
+
...inputProps,
|
|
7418
|
+
autoComplete: "off",
|
|
7419
|
+
ref,
|
|
7420
|
+
label,
|
|
7421
|
+
value: displayValue,
|
|
7422
|
+
placeholder,
|
|
7423
|
+
errorMessage,
|
|
7424
|
+
size,
|
|
7425
|
+
variant,
|
|
7426
|
+
full,
|
|
7427
|
+
disabled,
|
|
7428
|
+
endContent: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Icon_default, { name: "clock", size, className: "cursor-pointer" }),
|
|
7429
|
+
onFocus: handleInputFocus,
|
|
7430
|
+
onKeyDown: handleInputKeyDown,
|
|
7431
|
+
onChange: () => {
|
|
7432
|
+
},
|
|
7433
|
+
classNames: {
|
|
7434
|
+
inputWrapper: classNames == null ? void 0 : classNames.inputWrapper,
|
|
7435
|
+
input: classNames == null ? void 0 : classNames.input,
|
|
7436
|
+
label: classNames == null ? void 0 : classNames.label,
|
|
7437
|
+
errorMessage: classNames == null ? void 0 : classNames.errorMessage
|
|
7438
|
+
}
|
|
7439
|
+
}
|
|
7440
|
+
) }),
|
|
7441
|
+
isPanelOpen && (0, import_react_dom2.createPortal)(
|
|
7442
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
7818
7443
|
"div",
|
|
7819
7444
|
{
|
|
7820
7445
|
ref: panelWrapperRef,
|
|
7821
|
-
|
|
7446
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
7447
|
+
className: slots.portalWrapper({ class: classNames == null ? void 0 : classNames.portalWrapper }),
|
|
7822
7448
|
style: {
|
|
7823
7449
|
position: "absolute",
|
|
7824
7450
|
top: panelPos.top,
|
|
7825
|
-
left: panelPos.left
|
|
7826
|
-
zIndex: 1e3
|
|
7451
|
+
left: panelPos.left
|
|
7827
7452
|
},
|
|
7828
|
-
|
|
7829
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "bg-body-background text-neutral-main flex items-center gap-[5px] p-[10px]", children: [
|
|
7830
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center gap-[5px]", children: [
|
|
7831
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
7832
|
-
select_default,
|
|
7833
|
-
{
|
|
7834
|
-
options: renderHourOptions(),
|
|
7835
|
-
value: getSelectValue(selectedRange.start, "hour"),
|
|
7836
|
-
onChange: (options) => {
|
|
7837
|
-
if (options[0]) handleRangeChange("startHour", options[0]);
|
|
7838
|
-
},
|
|
7839
|
-
classNames: mergedSelectClassNames
|
|
7840
|
-
}
|
|
7841
|
-
),
|
|
7842
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: ":" }),
|
|
7843
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
7844
|
-
select_default,
|
|
7845
|
-
{
|
|
7846
|
-
options: renderMinuteOptions(),
|
|
7847
|
-
value: getSelectValue(selectedRange.start, "minute"),
|
|
7848
|
-
onChange: (options) => {
|
|
7849
|
-
if (options[0]) handleRangeChange("startMinute", options[0]);
|
|
7850
|
-
},
|
|
7851
|
-
classNames: mergedSelectClassNames
|
|
7852
|
-
}
|
|
7853
|
-
)
|
|
7854
|
-
] }),
|
|
7855
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "~" }),
|
|
7856
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center gap-[5px]", children: [
|
|
7857
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
7858
|
-
select_default,
|
|
7859
|
-
{
|
|
7860
|
-
options: renderHourOptions(),
|
|
7861
|
-
value: getSelectValue(selectedRange.end, "hour"),
|
|
7862
|
-
onChange: (options) => {
|
|
7863
|
-
if (options[0]) handleRangeChange("endHour", options[0]);
|
|
7864
|
-
},
|
|
7865
|
-
classNames: mergedSelectClassNames
|
|
7866
|
-
}
|
|
7867
|
-
),
|
|
7868
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: ":" }),
|
|
7869
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
7870
|
-
select_default,
|
|
7871
|
-
{
|
|
7872
|
-
options: renderMinuteOptions(),
|
|
7873
|
-
value: getSelectValue(selectedRange.end, "minute"),
|
|
7874
|
-
onChange: (options) => {
|
|
7875
|
-
if (options[0]) handleRangeChange("endMinute", options[0]);
|
|
7876
|
-
},
|
|
7877
|
-
classNames: mergedSelectClassNames
|
|
7878
|
-
}
|
|
7879
|
-
)
|
|
7880
|
-
] })
|
|
7881
|
-
] })
|
|
7453
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Panel_default, { nowTitle, confirmTitle, value, onChange: handleChange })
|
|
7882
7454
|
}
|
|
7883
7455
|
),
|
|
7884
7456
|
document.body
|
|
@@ -7915,24 +7487,44 @@ var timePickerStyle = tv({
|
|
|
7915
7487
|
"group-has-[p.error]/timepicker:placeholder:text-danger-main",
|
|
7916
7488
|
"cursor-pointer"
|
|
7917
7489
|
],
|
|
7918
|
-
|
|
7490
|
+
portalWrapper: [
|
|
7491
|
+
"rounded-[10px]",
|
|
7492
|
+
"bg-body-background",
|
|
7493
|
+
"shadow-drop-md",
|
|
7494
|
+
"overflow-auto",
|
|
7495
|
+
"p-[10px]",
|
|
7496
|
+
"w-[165px]",
|
|
7497
|
+
"h-[137px]",
|
|
7919
7498
|
"flex",
|
|
7920
|
-
"
|
|
7921
|
-
"
|
|
7922
|
-
"text-body-foreground",
|
|
7923
|
-
"group-has-[p.error]/timepicker:text-danger-main"
|
|
7499
|
+
"flex-col",
|
|
7500
|
+
"gap-[5px]"
|
|
7924
7501
|
],
|
|
7925
|
-
|
|
7926
|
-
errorMessage: ["text-danger-main", "text-sm"],
|
|
7927
|
-
selectWrapper: []
|
|
7502
|
+
errorMessage: ["text-danger-main", "text-sm"]
|
|
7928
7503
|
},
|
|
7929
7504
|
variants: {
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
7505
|
+
variant: {
|
|
7506
|
+
solid: {
|
|
7507
|
+
inputWrapper: ["border-transparent", "bg-trans-soft"],
|
|
7508
|
+
readonlyWrapper: ["!bg-trans-light"]
|
|
7509
|
+
},
|
|
7510
|
+
outline: {
|
|
7511
|
+
inputWrapper: [
|
|
7512
|
+
"border-neutral-light",
|
|
7513
|
+
"group-has-[:hover:not(:read-only):not(:focus)]/input:bg-trans-soft",
|
|
7514
|
+
"group-has-[:focus:not(:read-only)]/input:bg-body-background",
|
|
7515
|
+
"group-has-[p.error]/input:border-danger-main"
|
|
7516
|
+
],
|
|
7517
|
+
readonlyWrapper: ["!bg-trans-soft"]
|
|
7933
7518
|
},
|
|
7934
|
-
|
|
7935
|
-
|
|
7519
|
+
underline: {
|
|
7520
|
+
inputWrapper: [
|
|
7521
|
+
"bg-transparent",
|
|
7522
|
+
"rounded-none",
|
|
7523
|
+
"group-has-[:hover:not(:read-only):not(:focus)]/input:bg-trans-soft",
|
|
7524
|
+
"group-has-[:focus:not(:read-only)]/input:bg-body-background",
|
|
7525
|
+
"group-has-[p.error]/input:border-danger-main"
|
|
7526
|
+
],
|
|
7527
|
+
readonlyWrapper: ["!bg-trans-soft"]
|
|
7936
7528
|
}
|
|
7937
7529
|
},
|
|
7938
7530
|
size: {
|
|
@@ -7942,7 +7534,6 @@ var timePickerStyle = tv({
|
|
|
7942
7534
|
wrapper: ["gap-[4px]"],
|
|
7943
7535
|
inputWrapper: ["w-[240px]", "h-[24px]", "rounded-sm", "px-[4px]"],
|
|
7944
7536
|
input: ["text-sm"],
|
|
7945
|
-
icon: ["text-sm"],
|
|
7946
7537
|
errorMessage: ["text-sm"]
|
|
7947
7538
|
},
|
|
7948
7539
|
md: {
|
|
@@ -7951,7 +7542,6 @@ var timePickerStyle = tv({
|
|
|
7951
7542
|
wrapper: ["gap-[6px]"],
|
|
7952
7543
|
inputWrapper: ["w-[240px]", "h-[32px]", "rounded-md", "px-[6px]"],
|
|
7953
7544
|
input: ["text-md"],
|
|
7954
|
-
icon: ["text-md"],
|
|
7955
7545
|
errorMessage: ["text-sm"]
|
|
7956
7546
|
},
|
|
7957
7547
|
lg: {
|
|
@@ -7960,7 +7550,6 @@ var timePickerStyle = tv({
|
|
|
7960
7550
|
wrapper: ["gap-[8px]"],
|
|
7961
7551
|
inputWrapper: ["w-[240px]", "h-[40px]", "rounded-lg", "px-[8px]"],
|
|
7962
7552
|
input: ["text-lg"],
|
|
7963
|
-
icon: ["text-lg"],
|
|
7964
7553
|
errorMessage: ["text-md"]
|
|
7965
7554
|
},
|
|
7966
7555
|
xl: {
|
|
@@ -7969,7 +7558,6 @@ var timePickerStyle = tv({
|
|
|
7969
7558
|
wrapper: ["gap-[10px]"],
|
|
7970
7559
|
inputWrapper: ["w-[240px]", "h-[50px]", "rounded-lg", "px-[10px]"],
|
|
7971
7560
|
input: ["text-xl"],
|
|
7972
|
-
icon: ["text-xl"],
|
|
7973
7561
|
errorMessage: ["text-md"]
|
|
7974
7562
|
}
|
|
7975
7563
|
},
|
|
@@ -7999,7 +7587,6 @@ var timePickerStyle = tv({
|
|
|
7999
7587
|
"group-has-[p.error]/timepicker:placeholder:text-danger-light",
|
|
8000
7588
|
"cursor-not-allowed"
|
|
8001
7589
|
],
|
|
8002
|
-
icon: ["text-neutral-light"],
|
|
8003
7590
|
errorMessage: ["text-danger-light"]
|
|
8004
7591
|
}
|
|
8005
7592
|
}
|