@sia.soul/sia-react-ui 0.1.75 → 0.1.77
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-TG7ZYXA7.js → chunk-K5OU5NOT.js} +33 -10
- package/dist/{core-DErc-oXr.d.cts → core-Bx07vzrr.d.cts} +1 -1
- package/dist/{core-CFukvTes.d.ts → core-CBLT4Vfl.d.ts} +1 -1
- package/dist/core.css +4 -0
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/index.cjs +35 -12
- package/dist/index.css +4 -0
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +3 -3
- package/dist/{select-date-range-DN4eBuVx.d.cts → select-date-range-CRWxqHFp.d.cts} +2 -2
- package/dist/{select-date-range-YrK9kuKW.d.ts → select-date-range-rtYL9egr.d.ts} +2 -2
- package/dist/select-date-range.cjs +33 -10
- package/dist/select-date-range.d.cts +1 -1
- package/dist/select-date-range.d.ts +1 -1
- package/dist/select-date-range.js +1 -1
- package/package.json +1 -1
|
@@ -223,7 +223,7 @@ function DatePanelFooter({
|
|
|
223
223
|
}) {
|
|
224
224
|
return /* @__PURE__ */ jsxs("footer", { className: "sia-date-panel__footer", children: [
|
|
225
225
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
226
|
-
showToday ? /* @__PURE__ */ jsx("button", { type: "button", onClick: onToday, children: "\
|
|
226
|
+
showToday ? /* @__PURE__ */ jsx("button", { type: "button", onClick: onToday, children: "\u6B64\u523B" }) : null,
|
|
227
227
|
extra
|
|
228
228
|
] }),
|
|
229
229
|
needConfirm ? /* @__PURE__ */ jsx("button", { type: "button", className: "sia-date-panel__confirm", disabled: disabledConfirm, onClick: onConfirm, children: confirmText }) : null
|
|
@@ -348,17 +348,17 @@ function DatePicker({
|
|
|
348
348
|
if (maximum && day > String(maximum).slice(0, 10)) return true;
|
|
349
349
|
return disabledDate?.(day, { type: "date" }) ?? false;
|
|
350
350
|
}
|
|
351
|
-
function buildValue(day) {
|
|
351
|
+
function buildValue(day, time = draftTime) {
|
|
352
352
|
const picked = formatPickerValue(day, picker);
|
|
353
|
-
return showTime && picker === "date" ? withTime(picked,
|
|
353
|
+
return showTime && picker === "date" ? withTime(picked, time, showSecond) : picked;
|
|
354
354
|
}
|
|
355
|
-
function selectDate(day) {
|
|
355
|
+
function selectDate(day, time = draftTime, ensureSelected = false) {
|
|
356
356
|
if (isDisabled(day)) return;
|
|
357
|
-
const nextValue = buildValue(day);
|
|
357
|
+
const nextValue = buildValue(day, time);
|
|
358
358
|
if (multiple) {
|
|
359
359
|
const current = Array.isArray(draftValue) ? [...draftValue] : [];
|
|
360
360
|
const exists = current.some((item) => dayFromValue(item) === day);
|
|
361
|
-
const next = exists ? current.filter((item) => dayFromValue(item) !== day) : [...current, nextValue];
|
|
361
|
+
const next = exists ? ensureSelected ? current.map((item) => dayFromValue(item) === day ? nextValue : item) : current.filter((item) => dayFromValue(item) !== day) : [...current, nextValue];
|
|
362
362
|
setDraftValue(next);
|
|
363
363
|
if (!resolvedNeedConfirm) setCurrentValue(next);
|
|
364
364
|
return;
|
|
@@ -450,7 +450,15 @@ function DatePicker({
|
|
|
450
450
|
showToday,
|
|
451
451
|
needConfirm: resolvedNeedConfirm,
|
|
452
452
|
disabledConfirm: Array.isArray(draftValue) ? draftValue.length === 0 : !draftValue,
|
|
453
|
-
onToday: () =>
|
|
453
|
+
onToday: () => {
|
|
454
|
+
const now = /* @__PURE__ */ new Date();
|
|
455
|
+
const day = dateKey(now);
|
|
456
|
+
if (isDisabled(day)) return;
|
|
457
|
+
const time = [now.getHours(), now.getMinutes(), now.getSeconds()].map(pad).join(":");
|
|
458
|
+
if (showTime) setDraftTime(time);
|
|
459
|
+
setViewMonth(startOfMonth(now));
|
|
460
|
+
selectDate(day, time, true);
|
|
461
|
+
},
|
|
454
462
|
onConfirm: commitDraft
|
|
455
463
|
}
|
|
456
464
|
)
|
|
@@ -611,10 +619,13 @@ function DateRangePicker({
|
|
|
611
619
|
changeOpen(false);
|
|
612
620
|
}
|
|
613
621
|
}
|
|
614
|
-
function selectDateTime(day, index) {
|
|
622
|
+
function selectDateTime(day, index, time = index === 1 ? "23:59:59" : times[index]) {
|
|
615
623
|
if (isDisabled(day, index, true)) return;
|
|
624
|
+
const nextTimes = [...times];
|
|
625
|
+
nextTimes[index] = time;
|
|
626
|
+
setTimes(nextTimes);
|
|
616
627
|
const nextValue = [...draftValue];
|
|
617
|
-
nextValue[index] =
|
|
628
|
+
nextValue[index] = withTime(day, time, showSecond);
|
|
618
629
|
updateDraft(nextValue);
|
|
619
630
|
setHoverDate("");
|
|
620
631
|
setActiveIndex(index);
|
|
@@ -830,7 +841,19 @@ function DateRangePicker({
|
|
|
830
841
|
" \u5929"
|
|
831
842
|
] }) : null
|
|
832
843
|
] }),
|
|
833
|
-
onToday: () =>
|
|
844
|
+
onToday: () => {
|
|
845
|
+
const now = /* @__PURE__ */ new Date();
|
|
846
|
+
const day = dateKey(now);
|
|
847
|
+
if (isDisabled(day, activeIndex, Boolean(showTime))) return;
|
|
848
|
+
if (showTime) {
|
|
849
|
+
const time = [now.getHours(), now.getMinutes(), now.getSeconds()].map(pad).join(":");
|
|
850
|
+
(activeIndex === 0 ? setViewMonth : setEndViewMonth)(startOfMonth(now));
|
|
851
|
+
selectDateTime(day, activeIndex, time);
|
|
852
|
+
} else {
|
|
853
|
+
setViewMonth(startOfMonth(now));
|
|
854
|
+
selectDate(day);
|
|
855
|
+
}
|
|
856
|
+
},
|
|
834
857
|
onConfirm: confirm
|
|
835
858
|
}
|
|
836
859
|
)
|
|
@@ -1874,7 +1874,7 @@ interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "prefix
|
|
|
1874
1874
|
/** 输入框后缀 */
|
|
1875
1875
|
suffix?: ReactNode;
|
|
1876
1876
|
/**
|
|
1877
|
-
* 是否允许清空当前选择或输入值;默认启用,显式传入 false
|
|
1877
|
+
* 是否允许清空当前选择或输入值;默认启用,显式传入 false 可关闭。组件或所属 Form / fieldset 禁用时隐藏清空按钮。
|
|
1878
1878
|
* @defaultValue true
|
|
1879
1879
|
*/
|
|
1880
1880
|
allowClear?: boolean;
|
|
@@ -1874,7 +1874,7 @@ interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "prefix
|
|
|
1874
1874
|
/** 输入框后缀 */
|
|
1875
1875
|
suffix?: ReactNode;
|
|
1876
1876
|
/**
|
|
1877
|
-
* 是否允许清空当前选择或输入值;默认启用,显式传入 false
|
|
1877
|
+
* 是否允许清空当前选择或输入值;默认启用,显式传入 false 可关闭。组件或所属 Form / fieldset 禁用时隐藏清空按钮。
|
|
1878
1878
|
* @defaultValue true
|
|
1879
1879
|
*/
|
|
1880
1880
|
allowClear?: boolean;
|
package/dist/core.css
CHANGED
|
@@ -888,6 +888,10 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
888
888
|
outline: none;
|
|
889
889
|
opacity: 1;
|
|
890
890
|
}
|
|
891
|
+
:is(.sia-input-control__clear, .sia-input-select__clear, .sia-select__clear, .sia-picker__clear, .sia-tree-select__clear, .sia-number-range__clear):disabled,
|
|
892
|
+
.sia-cascader__trigger:disabled .sia-cascader__clear {
|
|
893
|
+
display: none;
|
|
894
|
+
}
|
|
891
895
|
.sia-input-control__input-wrap {
|
|
892
896
|
position: relative;
|
|
893
897
|
align-self: stretch;
|
package/dist/core.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, aq as TabItem, ar as Tabs, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, T as TagStatus, aA as TagVariant, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, b1 as UploadProps, b5 as UploadRequestOptions, b9 as message } from './core-
|
|
1
|
+
export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, aq as TabItem, ar as Tabs, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, T as TagStatus, aA as TagVariant, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, b1 as UploadProps, b5 as UploadRequestOptions, b9 as message } from './core-Bx07vzrr.cjs';
|
|
2
2
|
export { f as Button, B as ButtonProps, e as ButtonSize, g as ButtonVariant, h as Modal, d as ModalActionResult, M as ModalOpenConfig, i as ModalProps, j as ModalType, a as OverlayApiHandle, k as Select, S as SelectOption, c as SelectProps, m as SelectValue } from './Select-Bv2AmXRD.cjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
import './shared-Bx4B28Wh.cjs';
|
package/dist/core.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, aq as TabItem, ar as Tabs, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, T as TagStatus, aA as TagVariant, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, b1 as UploadProps, b5 as UploadRequestOptions, b9 as message } from './core-
|
|
1
|
+
export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, aq as TabItem, ar as Tabs, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, T as TagStatus, aA as TagVariant, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, b1 as UploadProps, b5 as UploadRequestOptions, b9 as message } from './core-CBLT4Vfl.js';
|
|
2
2
|
export { f as Button, B as ButtonProps, e as ButtonSize, g as ButtonVariant, h as Modal, d as ModalActionResult, M as ModalOpenConfig, i as ModalProps, j as ModalType, a as OverlayApiHandle, k as Select, S as SelectOption, c as SelectProps, m as SelectValue } from './Select-Cc1owuvN.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import './shared-Bx4B28Wh.js';
|
package/dist/index.cjs
CHANGED
|
@@ -4526,7 +4526,7 @@ function Cascader({
|
|
|
4526
4526
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { ref: rootRef, className: `sia-cascader sia-cascader--${size}${open ? " is-open" : ""}${disabled ? " is-disabled" : ""} ${className}`.trim(), ...withTitleTooltip(props), children: [
|
|
4527
4527
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: `sia-cascader__trigger${floating.className}`, disabled, "aria-haspopup": "listbox", "aria-expanded": open, onClick: toggleOpen, children: [
|
|
4528
4528
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "sia-cascader__value", children: display ? multiple && Array.isArray(display) ? display.map((label, index) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "sia-cascader__tag", children: label }, pathKey(selectedPaths[index] ?? []))) : display : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "sia-cascader__placeholder", children: placeholder }) }),
|
|
4529
|
-
allowClear && selectedPaths.length ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "sia-cascader__clear", role: "button", "aria-label": "\u6E05\u9664\u9009\u62E9", onClick: (event) => {
|
|
4529
|
+
allowClear && selectedPaths.length && !disabled ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "sia-cascader__clear", role: "button", "aria-label": "\u6E05\u9664\u9009\u62E9", onClick: (event) => {
|
|
4530
4530
|
event.stopPropagation();
|
|
4531
4531
|
clearSelection();
|
|
4532
4532
|
}, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "circle-close", variant: "filled", size: 15 }) }) : null,
|
|
@@ -7413,7 +7413,7 @@ function DatePanelFooter({
|
|
|
7413
7413
|
}) {
|
|
7414
7414
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("footer", { className: "sia-date-panel__footer", children: [
|
|
7415
7415
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { children: [
|
|
7416
|
-
showToday ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", onClick: onToday, children: "\
|
|
7416
|
+
showToday ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", onClick: onToday, children: "\u6B64\u523B" }) : null,
|
|
7417
7417
|
extra
|
|
7418
7418
|
] }),
|
|
7419
7419
|
needConfirm ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", className: "sia-date-panel__confirm", disabled: disabledConfirm, onClick: onConfirm, children: confirmText }) : null
|
|
@@ -7538,17 +7538,17 @@ function DatePicker({
|
|
|
7538
7538
|
if (maximum && day > String(maximum).slice(0, 10)) return true;
|
|
7539
7539
|
return disabledDate?.(day, { type: "date" }) ?? false;
|
|
7540
7540
|
}
|
|
7541
|
-
function buildValue(day) {
|
|
7541
|
+
function buildValue(day, time = draftTime) {
|
|
7542
7542
|
const picked = formatPickerValue(day, picker);
|
|
7543
|
-
return showTime && picker === "date" ? withTime(picked,
|
|
7543
|
+
return showTime && picker === "date" ? withTime(picked, time, showSecond) : picked;
|
|
7544
7544
|
}
|
|
7545
|
-
function selectDate(day) {
|
|
7545
|
+
function selectDate(day, time = draftTime, ensureSelected = false) {
|
|
7546
7546
|
if (isDisabled(day)) return;
|
|
7547
|
-
const nextValue = buildValue(day);
|
|
7547
|
+
const nextValue = buildValue(day, time);
|
|
7548
7548
|
if (multiple) {
|
|
7549
7549
|
const current = Array.isArray(draftValue) ? [...draftValue] : [];
|
|
7550
7550
|
const exists = current.some((item) => dayFromValue(item) === day);
|
|
7551
|
-
const next = exists ? current.filter((item) => dayFromValue(item) !== day) : [...current, nextValue];
|
|
7551
|
+
const next = exists ? ensureSelected ? current.map((item) => dayFromValue(item) === day ? nextValue : item) : current.filter((item) => dayFromValue(item) !== day) : [...current, nextValue];
|
|
7552
7552
|
setDraftValue(next);
|
|
7553
7553
|
if (!resolvedNeedConfirm) setCurrentValue(next);
|
|
7554
7554
|
return;
|
|
@@ -7640,7 +7640,15 @@ function DatePicker({
|
|
|
7640
7640
|
showToday,
|
|
7641
7641
|
needConfirm: resolvedNeedConfirm,
|
|
7642
7642
|
disabledConfirm: Array.isArray(draftValue) ? draftValue.length === 0 : !draftValue,
|
|
7643
|
-
onToday: () =>
|
|
7643
|
+
onToday: () => {
|
|
7644
|
+
const now = /* @__PURE__ */ new Date();
|
|
7645
|
+
const day = dateKey(now);
|
|
7646
|
+
if (isDisabled(day)) return;
|
|
7647
|
+
const time = [now.getHours(), now.getMinutes(), now.getSeconds()].map(pad2).join(":");
|
|
7648
|
+
if (showTime) setDraftTime(time);
|
|
7649
|
+
setViewMonth(startOfMonth(now));
|
|
7650
|
+
selectDate(day, time, true);
|
|
7651
|
+
},
|
|
7644
7652
|
onConfirm: commitDraft
|
|
7645
7653
|
}
|
|
7646
7654
|
)
|
|
@@ -7801,10 +7809,13 @@ function DateRangePicker({
|
|
|
7801
7809
|
changeOpen(false);
|
|
7802
7810
|
}
|
|
7803
7811
|
}
|
|
7804
|
-
function selectDateTime(day, index) {
|
|
7812
|
+
function selectDateTime(day, index, time = index === 1 ? "23:59:59" : times[index]) {
|
|
7805
7813
|
if (isDisabled(day, index, true)) return;
|
|
7814
|
+
const nextTimes = [...times];
|
|
7815
|
+
nextTimes[index] = time;
|
|
7816
|
+
setTimes(nextTimes);
|
|
7806
7817
|
const nextValue = [...draftValue];
|
|
7807
|
-
nextValue[index] =
|
|
7818
|
+
nextValue[index] = withTime(day, time, showSecond);
|
|
7808
7819
|
updateDraft(nextValue);
|
|
7809
7820
|
setHoverDate("");
|
|
7810
7821
|
setActiveIndex(index);
|
|
@@ -8020,7 +8031,19 @@ function DateRangePicker({
|
|
|
8020
8031
|
" \u5929"
|
|
8021
8032
|
] }) : null
|
|
8022
8033
|
] }),
|
|
8023
|
-
onToday: () =>
|
|
8034
|
+
onToday: () => {
|
|
8035
|
+
const now = /* @__PURE__ */ new Date();
|
|
8036
|
+
const day = dateKey(now);
|
|
8037
|
+
if (isDisabled(day, activeIndex, Boolean(showTime))) return;
|
|
8038
|
+
if (showTime) {
|
|
8039
|
+
const time = [now.getHours(), now.getMinutes(), now.getSeconds()].map(pad2).join(":");
|
|
8040
|
+
(activeIndex === 0 ? setViewMonth : setEndViewMonth)(startOfMonth(now));
|
|
8041
|
+
selectDateTime(day, activeIndex, time);
|
|
8042
|
+
} else {
|
|
8043
|
+
setViewMonth(startOfMonth(now));
|
|
8044
|
+
selectDate(day);
|
|
8045
|
+
}
|
|
8046
|
+
},
|
|
8024
8047
|
onConfirm: confirm
|
|
8025
8048
|
}
|
|
8026
8049
|
)
|
|
@@ -23467,7 +23490,7 @@ var InputSelect = (0, import_react93.forwardRef)(function InputSelect2({
|
|
|
23467
23490
|
changeOpen(true);
|
|
23468
23491
|
},
|
|
23469
23492
|
suffix: /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("span", { className: "sia-input-select__suffix", children: [
|
|
23470
|
-
allowClear && draft && !disabled && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Button, { variant: "text", size: "small", disabled: loading, "aria-label": "\u6E05\u9664\u8F93\u5165\u9009\u62E9", onClick: (event) => {
|
|
23493
|
+
allowClear && draft && !disabled && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Button, { className: "sia-input-select__clear", variant: "text", size: "small", disabled: loading, "aria-label": "\u6E05\u9664\u8F93\u5165\u9009\u62E9", onClick: (event) => {
|
|
23471
23494
|
event.stopPropagation();
|
|
23472
23495
|
setDraft("");
|
|
23473
23496
|
emit(multiple ? [] : void 0);
|
package/dist/index.css
CHANGED
|
@@ -888,6 +888,10 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
888
888
|
outline: none;
|
|
889
889
|
opacity: 1;
|
|
890
890
|
}
|
|
891
|
+
:is(.sia-input-control__clear, .sia-input-select__clear, .sia-select__clear, .sia-picker__clear, .sia-tree-select__clear, .sia-number-range__clear):disabled,
|
|
892
|
+
.sia-cascader__trigger:disabled .sia-cascader__clear {
|
|
893
|
+
display: none;
|
|
894
|
+
}
|
|
891
895
|
.sia-input-control__input-wrap {
|
|
892
896
|
position: relative;
|
|
893
897
|
align-self: stretch;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { T as TagStatus, B as BadgeProps } from './core-
|
|
2
|
-
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, ak as Spin, al as SpinProps, am as StepItem, an as StepStatus, ao as Steps, ap as StepsProps, aq as TabItem, ar as Tabs, as as TabsContextMenuClickInfo, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, aA as TagVariant, aB as Timeline, aC as TimelineItem, aD as TimelineProps, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aH as Tooltip, aI as TooltipProps, aJ as Tour, aK as TourProps, aL as TourStep, aM as Tree, aN as TreeDropPosition, aO as TreeKey, aP as TreeNode, aQ as TreeProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, a$ as UploadHttpRequest, b0 as UploadItemActions, b1 as UploadProps, b2 as UploadRef, b3 as UploadRejectInfo, b4 as UploadRequestHandle, b5 as UploadRequestOptions, b6 as Watermark, b7 as WatermarkFont, b8 as WatermarkProps, b9 as message, ba as notification } from './core-
|
|
1
|
+
import { T as TagStatus, B as BadgeProps } from './core-Bx07vzrr.cjs';
|
|
2
|
+
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, ak as Spin, al as SpinProps, am as StepItem, an as StepStatus, ao as Steps, ap as StepsProps, aq as TabItem, ar as Tabs, as as TabsContextMenuClickInfo, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, aA as TagVariant, aB as Timeline, aC as TimelineItem, aD as TimelineProps, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aH as Tooltip, aI as TooltipProps, aJ as Tour, aK as TourProps, aL as TourStep, aM as Tree, aN as TreeDropPosition, aO as TreeKey, aP as TreeNode, aQ as TreeProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, a$ as UploadHttpRequest, b0 as UploadItemActions, b1 as UploadProps, b2 as UploadRef, b3 as UploadRejectInfo, b4 as UploadRequestHandle, b5 as UploadRequestOptions, b6 as Watermark, b7 as WatermarkFont, b8 as WatermarkProps, b9 as message, ba as notification } from './core-Bx07vzrr.cjs';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { HTMLAttributes, ReactNode, CSSProperties, ElementType, FormHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, MouseEvent, Key, PointerEvent, Ref, ReactElement, ButtonHTMLAttributes, RefObject } from 'react';
|
|
5
5
|
import { C as ControlSize, I as InputPlaceholderMode, a as ControlStatus } from './shared-Bx4B28Wh.cjs';
|
|
6
6
|
import { O as OverlayContainer, a as OverlayApiHandle, M as ModalOpenConfig, S as SelectOption, b as SelectChangeValue, c as SelectProps, d as ModalActionResult, B as ButtonProps, e as ButtonSize } from './Select-Bv2AmXRD.cjs';
|
|
7
7
|
export { f as Button, g as ButtonVariant, h as Modal, i as ModalProps, j as ModalType, k as Select, l as SelectMode, m as SelectValue } from './Select-Bv2AmXRD.cjs';
|
|
8
|
-
export { D as DatePicker, a as DatePickerDisabledInfo, b as DatePickerPreset, c as DatePickerProps, d as DatePickerShowTime, e as DatePickerType, f as DatePickerValue, g as DateRangePickerPreset, h as DateRangePickerProps, S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-
|
|
8
|
+
export { D as DatePicker, a as DatePickerDisabledInfo, b as DatePickerPreset, c as DatePickerProps, d as DatePickerShowTime, e as DatePickerType, f as DatePickerValue, g as DateRangePickerPreset, h as DateRangePickerProps, S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-CRWxqHFp.cjs';
|
|
9
9
|
export { RichTextContent, RichTextContentFormat, RichTextContentProps, RichTextEditor, RichTextEditorProps, RichTextImagePasteHandler, RichTextToolbar } from './rich-text-editor.cjs';
|
|
10
10
|
export { MarkdownEditor, MarkdownEditorMode, MarkdownEditorProps } from './markdown-editor.cjs';
|
|
11
11
|
import * as Monaco from 'monaco-editor';
|
|
@@ -163,7 +163,7 @@ interface CascaderProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultVal
|
|
|
163
163
|
*/
|
|
164
164
|
showSearch?: boolean;
|
|
165
165
|
/**
|
|
166
|
-
* 是否允许清空当前选择或输入值;默认启用,显式传入 false
|
|
166
|
+
* 是否允许清空当前选择或输入值;默认启用,显式传入 false 可关闭。组件或所属 Form / fieldset 禁用时隐藏清空入口。
|
|
167
167
|
* @defaultValue true
|
|
168
168
|
*/
|
|
169
169
|
allowClear?: boolean;
|
|
@@ -743,7 +743,7 @@ interface FormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"
|
|
|
743
743
|
/** 占位提示的显示模式;floating 为浮动标签。 */
|
|
744
744
|
placeholderMode?: InputPlaceholderMode;
|
|
745
745
|
/**
|
|
746
|
-
*
|
|
746
|
+
* 是否通过原生 fieldset 禁用表单内控件交互;禁用时同时隐藏输入、选择和区间控件的清空入口,恢复启用后按各控件的 allowClear 配置显示。
|
|
747
747
|
* @defaultValue false
|
|
748
748
|
*/
|
|
749
749
|
disabled?: boolean;
|
|
@@ -3028,7 +3028,7 @@ interface InputSelectProps {
|
|
|
3028
3028
|
*/
|
|
3029
3029
|
loading?: boolean;
|
|
3030
3030
|
/**
|
|
3031
|
-
|
|
3031
|
+
* 是否允许清空当前选择或输入值;组件或所属 Form / fieldset 禁用时隐藏清空按钮。
|
|
3032
3032
|
* @defaultValue true
|
|
3033
3033
|
*/
|
|
3034
3034
|
allowClear?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { T as TagStatus, B as BadgeProps } from './core-
|
|
2
|
-
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, ak as Spin, al as SpinProps, am as StepItem, an as StepStatus, ao as Steps, ap as StepsProps, aq as TabItem, ar as Tabs, as as TabsContextMenuClickInfo, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, aA as TagVariant, aB as Timeline, aC as TimelineItem, aD as TimelineProps, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aH as Tooltip, aI as TooltipProps, aJ as Tour, aK as TourProps, aL as TourStep, aM as Tree, aN as TreeDropPosition, aO as TreeKey, aP as TreeNode, aQ as TreeProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, a$ as UploadHttpRequest, b0 as UploadItemActions, b1 as UploadProps, b2 as UploadRef, b3 as UploadRejectInfo, b4 as UploadRequestHandle, b5 as UploadRequestOptions, b6 as Watermark, b7 as WatermarkFont, b8 as WatermarkProps, b9 as message, ba as notification } from './core-
|
|
1
|
+
import { T as TagStatus, B as BadgeProps } from './core-CBLT4Vfl.js';
|
|
2
|
+
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, ak as Spin, al as SpinProps, am as StepItem, an as StepStatus, ao as Steps, ap as StepsProps, aq as TabItem, ar as Tabs, as as TabsContextMenuClickInfo, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, aA as TagVariant, aB as Timeline, aC as TimelineItem, aD as TimelineProps, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aH as Tooltip, aI as TooltipProps, aJ as Tour, aK as TourProps, aL as TourStep, aM as Tree, aN as TreeDropPosition, aO as TreeKey, aP as TreeNode, aQ as TreeProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, a$ as UploadHttpRequest, b0 as UploadItemActions, b1 as UploadProps, b2 as UploadRef, b3 as UploadRejectInfo, b4 as UploadRequestHandle, b5 as UploadRequestOptions, b6 as Watermark, b7 as WatermarkFont, b8 as WatermarkProps, b9 as message, ba as notification } from './core-CBLT4Vfl.js';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { HTMLAttributes, ReactNode, CSSProperties, ElementType, FormHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, MouseEvent, Key, PointerEvent, Ref, ReactElement, ButtonHTMLAttributes, RefObject } from 'react';
|
|
5
5
|
import { C as ControlSize, I as InputPlaceholderMode, a as ControlStatus } from './shared-Bx4B28Wh.js';
|
|
6
6
|
import { O as OverlayContainer, a as OverlayApiHandle, M as ModalOpenConfig, S as SelectOption, b as SelectChangeValue, c as SelectProps, d as ModalActionResult, B as ButtonProps, e as ButtonSize } from './Select-Cc1owuvN.js';
|
|
7
7
|
export { f as Button, g as ButtonVariant, h as Modal, i as ModalProps, j as ModalType, k as Select, l as SelectMode, m as SelectValue } from './Select-Cc1owuvN.js';
|
|
8
|
-
export { D as DatePicker, a as DatePickerDisabledInfo, b as DatePickerPreset, c as DatePickerProps, d as DatePickerShowTime, e as DatePickerType, f as DatePickerValue, g as DateRangePickerPreset, h as DateRangePickerProps, S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-
|
|
8
|
+
export { D as DatePicker, a as DatePickerDisabledInfo, b as DatePickerPreset, c as DatePickerProps, d as DatePickerShowTime, e as DatePickerType, f as DatePickerValue, g as DateRangePickerPreset, h as DateRangePickerProps, S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-rtYL9egr.js';
|
|
9
9
|
export { RichTextContent, RichTextContentFormat, RichTextContentProps, RichTextEditor, RichTextEditorProps, RichTextImagePasteHandler, RichTextToolbar } from './rich-text-editor.js';
|
|
10
10
|
export { MarkdownEditor, MarkdownEditorMode, MarkdownEditorProps } from './markdown-editor.js';
|
|
11
11
|
import * as Monaco from 'monaco-editor';
|
|
@@ -163,7 +163,7 @@ interface CascaderProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultVal
|
|
|
163
163
|
*/
|
|
164
164
|
showSearch?: boolean;
|
|
165
165
|
/**
|
|
166
|
-
* 是否允许清空当前选择或输入值;默认启用,显式传入 false
|
|
166
|
+
* 是否允许清空当前选择或输入值;默认启用,显式传入 false 可关闭。组件或所属 Form / fieldset 禁用时隐藏清空入口。
|
|
167
167
|
* @defaultValue true
|
|
168
168
|
*/
|
|
169
169
|
allowClear?: boolean;
|
|
@@ -743,7 +743,7 @@ interface FormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"
|
|
|
743
743
|
/** 占位提示的显示模式;floating 为浮动标签。 */
|
|
744
744
|
placeholderMode?: InputPlaceholderMode;
|
|
745
745
|
/**
|
|
746
|
-
*
|
|
746
|
+
* 是否通过原生 fieldset 禁用表单内控件交互;禁用时同时隐藏输入、选择和区间控件的清空入口,恢复启用后按各控件的 allowClear 配置显示。
|
|
747
747
|
* @defaultValue false
|
|
748
748
|
*/
|
|
749
749
|
disabled?: boolean;
|
|
@@ -3028,7 +3028,7 @@ interface InputSelectProps {
|
|
|
3028
3028
|
*/
|
|
3029
3029
|
loading?: boolean;
|
|
3030
3030
|
/**
|
|
3031
|
-
|
|
3031
|
+
* 是否允许清空当前选择或输入值;组件或所属 Form / fieldset 禁用时隐藏清空按钮。
|
|
3032
3032
|
* @defaultValue true
|
|
3033
3033
|
*/
|
|
3034
3034
|
allowClear?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -95,7 +95,7 @@ import {
|
|
|
95
95
|
DatePicker,
|
|
96
96
|
SelectDateRange,
|
|
97
97
|
TimePanel
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-K5OU5NOT.js";
|
|
99
99
|
import {
|
|
100
100
|
Checkbox,
|
|
101
101
|
FloatingScrollbarProvider,
|
|
@@ -441,7 +441,7 @@ function Cascader({
|
|
|
441
441
|
return /* @__PURE__ */ jsxs3("div", { ref: rootRef, className: `sia-cascader sia-cascader--${size}${open ? " is-open" : ""}${disabled ? " is-disabled" : ""} ${className}`.trim(), ...withTitleTooltip(props), children: [
|
|
442
442
|
/* @__PURE__ */ jsxs3("button", { type: "button", className: `sia-cascader__trigger${floating.className}`, disabled, "aria-haspopup": "listbox", "aria-expanded": open, onClick: toggleOpen, children: [
|
|
443
443
|
/* @__PURE__ */ jsx3("span", { className: "sia-cascader__value", children: display ? multiple && Array.isArray(display) ? display.map((label, index) => /* @__PURE__ */ jsx3("span", { className: "sia-cascader__tag", children: label }, pathKey(selectedPaths[index] ?? []))) : display : /* @__PURE__ */ jsx3("span", { className: "sia-cascader__placeholder", children: placeholder }) }),
|
|
444
|
-
allowClear && selectedPaths.length ? /* @__PURE__ */ jsx3("span", { className: "sia-cascader__clear", role: "button", "aria-label": "\u6E05\u9664\u9009\u62E9", onClick: (event) => {
|
|
444
|
+
allowClear && selectedPaths.length && !disabled ? /* @__PURE__ */ jsx3("span", { className: "sia-cascader__clear", role: "button", "aria-label": "\u6E05\u9664\u9009\u62E9", onClick: (event) => {
|
|
445
445
|
event.stopPropagation();
|
|
446
446
|
clearSelection();
|
|
447
447
|
}, children: /* @__PURE__ */ jsx3(Icon, { name: "circle-close", variant: "filled", size: 15 }) }) : null,
|
|
@@ -8496,7 +8496,7 @@ var InputSelect = forwardRef7(function InputSelect2({
|
|
|
8496
8496
|
changeOpen(true);
|
|
8497
8497
|
},
|
|
8498
8498
|
suffix: /* @__PURE__ */ jsxs23("span", { className: "sia-input-select__suffix", children: [
|
|
8499
|
-
allowClear && draft && !disabled && /* @__PURE__ */ jsx25(Button, { variant: "text", size: "small", disabled: loading, "aria-label": "\u6E05\u9664\u8F93\u5165\u9009\u62E9", onClick: (event) => {
|
|
8499
|
+
allowClear && draft && !disabled && /* @__PURE__ */ jsx25(Button, { className: "sia-input-select__clear", variant: "text", size: "small", disabled: loading, "aria-label": "\u6E05\u9664\u8F93\u5165\u9009\u62E9", onClick: (event) => {
|
|
8500
8500
|
event.stopPropagation();
|
|
8501
8501
|
setDraft("");
|
|
8502
8502
|
emit(multiple ? [] : void 0);
|
|
@@ -71,12 +71,12 @@ interface DatePickerProps extends SharedDatePickerProps {
|
|
|
71
71
|
/** 选择后需要点击确定才提交;带时间的范围必须确认后保存;纯日期范围点选后立即保存合法值,此属性仅控制是否保留面板供确认关闭。 */
|
|
72
72
|
needConfirm?: boolean;
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
74
|
+
* 组合时间面板,可显示秒;范围选择始终显示单个面板,点击起止输入区域直接编辑对应端点。日历点选结束日期时自动填入 23:59,开启 showSecond 时为 23:59:59,可随后手动调整;开始日期保留原时间,“此刻”使用当前时间,快捷范围保留预设时间。先确认当前端点,再切换到另一端点,两个端点确认后提交并关闭;锁定端点无需再次确认,快捷范围只需一次确认。
|
|
75
75
|
* @defaultValue false
|
|
76
76
|
*/
|
|
77
77
|
showTime?: DatePickerShowTime;
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
79
|
+
* 是否显示“此刻”入口。点击选择本机当前日期;开启 showTime 时同时填入当前时分,showSecond 为 true 时包含秒。沿用 needConfirm 的提交规则;范围选择仅更新当前编辑端点,禁用日期不可选择。
|
|
80
80
|
* @defaultValue true
|
|
81
81
|
*/
|
|
82
82
|
showToday?: boolean;
|
|
@@ -71,12 +71,12 @@ interface DatePickerProps extends SharedDatePickerProps {
|
|
|
71
71
|
/** 选择后需要点击确定才提交;带时间的范围必须确认后保存;纯日期范围点选后立即保存合法值,此属性仅控制是否保留面板供确认关闭。 */
|
|
72
72
|
needConfirm?: boolean;
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
74
|
+
* 组合时间面板,可显示秒;范围选择始终显示单个面板,点击起止输入区域直接编辑对应端点。日历点选结束日期时自动填入 23:59,开启 showSecond 时为 23:59:59,可随后手动调整;开始日期保留原时间,“此刻”使用当前时间,快捷范围保留预设时间。先确认当前端点,再切换到另一端点,两个端点确认后提交并关闭;锁定端点无需再次确认,快捷范围只需一次确认。
|
|
75
75
|
* @defaultValue false
|
|
76
76
|
*/
|
|
77
77
|
showTime?: DatePickerShowTime;
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
79
|
+
* 是否显示“此刻”入口。点击选择本机当前日期;开启 showTime 时同时填入当前时分,showSecond 为 true 时包含秒。沿用 needConfirm 的提交规则;范围选择仅更新当前编辑端点,禁用日期不可选择。
|
|
80
80
|
* @defaultValue true
|
|
81
81
|
*/
|
|
82
82
|
showToday?: boolean;
|
|
@@ -1734,7 +1734,7 @@ function DatePanelFooter({
|
|
|
1734
1734
|
}) {
|
|
1735
1735
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("footer", { className: "sia-date-panel__footer", children: [
|
|
1736
1736
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { children: [
|
|
1737
|
-
showToday ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: onToday, children: "\
|
|
1737
|
+
showToday ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: onToday, children: "\u6B64\u523B" }) : null,
|
|
1738
1738
|
extra
|
|
1739
1739
|
] }),
|
|
1740
1740
|
needConfirm ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "sia-date-panel__confirm", disabled: disabledConfirm, onClick: onConfirm, children: confirmText }) : null
|
|
@@ -1859,17 +1859,17 @@ function DatePicker({
|
|
|
1859
1859
|
if (maximum && day > String(maximum).slice(0, 10)) return true;
|
|
1860
1860
|
return disabledDate?.(day, { type: "date" }) ?? false;
|
|
1861
1861
|
}
|
|
1862
|
-
function buildValue(day) {
|
|
1862
|
+
function buildValue(day, time = draftTime) {
|
|
1863
1863
|
const picked = formatPickerValue(day, picker);
|
|
1864
|
-
return showTime && picker === "date" ? withTime(picked,
|
|
1864
|
+
return showTime && picker === "date" ? withTime(picked, time, showSecond) : picked;
|
|
1865
1865
|
}
|
|
1866
|
-
function selectDate(day) {
|
|
1866
|
+
function selectDate(day, time = draftTime, ensureSelected = false) {
|
|
1867
1867
|
if (isDisabled(day)) return;
|
|
1868
|
-
const nextValue = buildValue(day);
|
|
1868
|
+
const nextValue = buildValue(day, time);
|
|
1869
1869
|
if (multiple) {
|
|
1870
1870
|
const current = Array.isArray(draftValue) ? [...draftValue] : [];
|
|
1871
1871
|
const exists = current.some((item) => dayFromValue(item) === day);
|
|
1872
|
-
const next = exists ? current.filter((item) => dayFromValue(item) !== day) : [...current, nextValue];
|
|
1872
|
+
const next = exists ? ensureSelected ? current.map((item) => dayFromValue(item) === day ? nextValue : item) : current.filter((item) => dayFromValue(item) !== day) : [...current, nextValue];
|
|
1873
1873
|
setDraftValue(next);
|
|
1874
1874
|
if (!resolvedNeedConfirm) setCurrentValue(next);
|
|
1875
1875
|
return;
|
|
@@ -1961,7 +1961,15 @@ function DatePicker({
|
|
|
1961
1961
|
showToday,
|
|
1962
1962
|
needConfirm: resolvedNeedConfirm,
|
|
1963
1963
|
disabledConfirm: Array.isArray(draftValue) ? draftValue.length === 0 : !draftValue,
|
|
1964
|
-
onToday: () =>
|
|
1964
|
+
onToday: () => {
|
|
1965
|
+
const now = /* @__PURE__ */ new Date();
|
|
1966
|
+
const day = dateKey(now);
|
|
1967
|
+
if (isDisabled(day)) return;
|
|
1968
|
+
const time = [now.getHours(), now.getMinutes(), now.getSeconds()].map(pad).join(":");
|
|
1969
|
+
if (showTime) setDraftTime(time);
|
|
1970
|
+
setViewMonth(startOfMonth(now));
|
|
1971
|
+
selectDate(day, time, true);
|
|
1972
|
+
},
|
|
1965
1973
|
onConfirm: commitDraft
|
|
1966
1974
|
}
|
|
1967
1975
|
)
|
|
@@ -2122,10 +2130,13 @@ function DateRangePicker({
|
|
|
2122
2130
|
changeOpen(false);
|
|
2123
2131
|
}
|
|
2124
2132
|
}
|
|
2125
|
-
function selectDateTime(day, index) {
|
|
2133
|
+
function selectDateTime(day, index, time = index === 1 ? "23:59:59" : times[index]) {
|
|
2126
2134
|
if (isDisabled(day, index, true)) return;
|
|
2135
|
+
const nextTimes = [...times];
|
|
2136
|
+
nextTimes[index] = time;
|
|
2137
|
+
setTimes(nextTimes);
|
|
2127
2138
|
const nextValue = [...draftValue];
|
|
2128
|
-
nextValue[index] =
|
|
2139
|
+
nextValue[index] = withTime(day, time, showSecond);
|
|
2129
2140
|
updateDraft(nextValue);
|
|
2130
2141
|
setHoverDate("");
|
|
2131
2142
|
setActiveIndex(index);
|
|
@@ -2341,7 +2352,19 @@ function DateRangePicker({
|
|
|
2341
2352
|
" \u5929"
|
|
2342
2353
|
] }) : null
|
|
2343
2354
|
] }),
|
|
2344
|
-
onToday: () =>
|
|
2355
|
+
onToday: () => {
|
|
2356
|
+
const now = /* @__PURE__ */ new Date();
|
|
2357
|
+
const day = dateKey(now);
|
|
2358
|
+
if (isDisabled(day, activeIndex, Boolean(showTime))) return;
|
|
2359
|
+
if (showTime) {
|
|
2360
|
+
const time = [now.getHours(), now.getMinutes(), now.getSeconds()].map(pad).join(":");
|
|
2361
|
+
(activeIndex === 0 ? setViewMonth : setEndViewMonth)(startOfMonth(now));
|
|
2362
|
+
selectDateTime(day, activeIndex, time);
|
|
2363
|
+
} else {
|
|
2364
|
+
setViewMonth(startOfMonth(now));
|
|
2365
|
+
selectDate(day);
|
|
2366
|
+
}
|
|
2367
|
+
},
|
|
2345
2368
|
onConfirm: confirm
|
|
2346
2369
|
}
|
|
2347
2370
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-
|
|
1
|
+
export { S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-CRWxqHFp.cjs';
|
|
2
2
|
import 'react';
|
|
3
3
|
import './shared-Bx4B28Wh.cjs';
|
|
4
4
|
import './Select-Bv2AmXRD.cjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-
|
|
1
|
+
export { S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-rtYL9egr.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import './shared-Bx4B28Wh.js';
|
|
4
4
|
import './Select-Cc1owuvN.js';
|