@rockshin/tao-ui 0.0.58 → 0.0.59
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/components/affix/affix.js +38 -4
- package/dist/components/app/app-modals.js +11 -6
- package/dist/components/app/app-notices.js +105 -47
- package/dist/components/auto-complete/auto-complete.js +9 -2
- package/dist/components/calendar/calendar.js +22 -18
- package/dist/components/carousel/carousel.js +27 -14
- package/dist/components/cascader/cascader.js +17 -12
- package/dist/components/checkbox/checkbox.d.ts +3 -1
- package/dist/components/checkbox/checkbox.js +65 -58
- package/dist/components/color-picker/color-picker.js +383 -360
- package/dist/components/date-picker/calendar/calendar-grid.d.ts +5 -3
- package/dist/components/date-picker/calendar/calendar-grid.js +9 -4
- package/dist/components/date-picker/calendar/month-grid.d.ts +2 -1
- package/dist/components/date-picker/calendar/month-grid.js +61 -45
- package/dist/components/date-picker/calendar/time-panel.d.ts +8 -1
- package/dist/components/date-picker/calendar/time-panel.js +89 -88
- package/dist/components/date-picker/calendar/year-grid.d.ts +2 -1
- package/dist/components/date-picker/calendar/year-grid.js +60 -44
- package/dist/components/date-picker/date-picker.css +9 -0
- package/dist/components/date-picker/date-picker.js +22 -13
- package/dist/components/date-picker/range-picker.d.ts +2 -0
- package/dist/components/date-picker/range-picker.js +127 -70
- package/dist/components/date-picker/types.js +1 -1
- package/dist/components/drawer/drawer.d.ts +1 -1
- package/dist/components/drawer/drawer.js +4 -3
- package/dist/components/dropdown/dropdown.js +11 -9
- package/dist/components/float-button/float-button.js +4 -4
- package/dist/components/form/form-item.d.ts +1 -1
- package/dist/components/form/form-item.js +160 -120
- package/dist/components/form-field/form-field-view.d.ts +2 -1
- package/dist/components/form-field/form-field-view.js +173 -108
- package/dist/components/input/input-shared.js +3 -2
- package/dist/components/input/otp.js +114 -110
- package/dist/components/input/password.js +55 -61
- package/dist/components/input/search.js +8 -4
- package/dist/components/mentions/mentions.js +1 -0
- package/dist/components/menu/menu-render.js +1 -0
- package/dist/components/modal/confirm-dialog.js +11 -4
- package/dist/components/modal/modal.js +320 -315
- package/dist/components/pagination/pagination.d.ts +1 -0
- package/dist/components/pagination/pagination.js +1 -0
- package/dist/components/popover/popover.js +325 -289
- package/dist/components/qr-code/qr-code.js +157 -150
- package/dist/components/radio/radio.d.ts +3 -1
- package/dist/components/radio/radio.js +73 -64
- package/dist/components/select/mobile-select.js +6 -3
- package/dist/components/select/select-model.js +2 -2
- package/dist/components/select/select.js +78 -39
- package/dist/components/select/use-select-selection.js +58 -58
- package/dist/components/slider/slider.d.ts +2 -2
- package/dist/components/slider/slider.js +13 -2
- package/dist/components/sonner/sonner.js +2 -2
- package/dist/components/splitter/splitter.css +1 -0
- package/dist/components/splitter/splitter.js +152 -126
- package/dist/components/switch/switch.js +45 -39
- package/dist/components/table/table.js +1 -0
- package/dist/components/table/use-table-data.js +2 -2
- package/dist/components/time-picker/time-picker.js +31 -1
- package/dist/components/tooltip/tooltip.js +237 -99
- package/dist/components/tree/tree.js +31 -3
- package/dist/components/tree-select/tree-select.js +1 -1
- package/dist/components/upload/upload.js +67 -40
- package/dist/locales/ar-EG.js +2 -0
- package/dist/locales/de-DE.js +2 -0
- package/dist/locales/en-US.js +2 -0
- package/dist/locales/es-ES.js +2 -0
- package/dist/locales/fr-FR.js +2 -0
- package/dist/locales/hi-IN.js +2 -0
- package/dist/locales/id-ID.js +2 -0
- package/dist/locales/it-IT.js +2 -0
- package/dist/locales/ja-JP.js +2 -0
- package/dist/locales/ko-KR.js +2 -0
- package/dist/locales/pt-BR.js +2 -0
- package/dist/locales/ru-RU.js +2 -0
- package/dist/locales/th-TH.js +2 -0
- package/dist/locales/tr-TR.js +2 -0
- package/dist/locales/types.d.ts +2 -0
- package/dist/locales/vi-VN.js +2 -0
- package/dist/locales/zh-CN.js +2 -0
- package/dist/locales/zh-TW.js +2 -0
- package/dist/number-input/format.js +1 -1
- package/dist/number-input/use-number-input.js +166 -321
- package/dist/number-input/validate.d.ts +1 -0
- package/dist/number-input/validate.js +1 -1
- package/dist/provider/tao-provider.d.ts +2 -2
- package/dist/provider/tao-provider.js +49 -49
- package/dist/utils/composed-parent.d.ts +1 -0
- package/dist/utils/composed-parent.js +7 -0
- package/dist/utils/portal.d.ts +5 -0
- package/dist/utils/portal.js +7 -1
- package/dist/utils/refs.d.ts +3 -1
- package/dist/utils/refs.js +25 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { forwardRef, useState } from "react";
|
|
|
4
4
|
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
5
5
|
import { BaseInput } from "./base-input.js";
|
|
6
6
|
const password_Password = /*#__PURE__*/ forwardRef(function(t0, ref) {
|
|
7
|
-
const $ = c(
|
|
7
|
+
const $ = c(22);
|
|
8
8
|
let disabled;
|
|
9
9
|
let iconRender;
|
|
10
10
|
let props;
|
|
@@ -40,77 +40,71 @@ const password_Password = /*#__PURE__*/ forwardRef(function(t0, ref) {
|
|
|
40
40
|
const resolvedDisabled = disabled ?? ctx.disabled;
|
|
41
41
|
const t3 = visible ? "text" : "password";
|
|
42
42
|
let t4;
|
|
43
|
-
if ($[8] !== config || $[9] !== ctx || $[10] !== iconRender || $[11] !== resolvedDisabled || $[12] !==
|
|
44
|
-
t4 = visibilityToggle
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
43
|
+
if ($[8] !== config || $[9] !== ctx || $[10] !== iconRender || $[11] !== resolvedDisabled || $[12] !== suffix || $[13] !== visibilityToggle || $[14] !== visible) {
|
|
44
|
+
t4 = visibilityToggle ? /*#__PURE__*/ jsxs(Fragment, {
|
|
45
|
+
children: [
|
|
46
|
+
suffix,
|
|
47
|
+
/*#__PURE__*/ jsx("button", {
|
|
48
|
+
type: "button",
|
|
49
|
+
"data-tao-input-action": "",
|
|
50
|
+
"aria-label": visible ? ctx.locale.hidePassword ?? "Hide password" : ctx.locale.showPassword ?? "Show password",
|
|
51
|
+
"aria-pressed": visible,
|
|
52
|
+
tabIndex: config.tabIndex,
|
|
53
|
+
disabled: resolvedDisabled,
|
|
54
|
+
onMouseDown: _temp,
|
|
55
|
+
onClick: ()=>{
|
|
56
|
+
if (void 0 === config.visible) setVisible(!visible);
|
|
57
|
+
config.onVisibleChange?.(!visible);
|
|
58
|
+
},
|
|
59
|
+
children: iconRender ? iconRender(visible) : /*#__PURE__*/ jsxs("svg", {
|
|
60
|
+
viewBox: "0 0 24 24",
|
|
61
|
+
fill: "none",
|
|
62
|
+
stroke: "currentColor",
|
|
63
|
+
strokeWidth: "1.8",
|
|
64
|
+
"aria-hidden": "true",
|
|
65
|
+
children: [
|
|
66
|
+
/*#__PURE__*/ jsx("path", {
|
|
67
|
+
d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7S2 12 2 12Z"
|
|
68
|
+
}),
|
|
69
|
+
/*#__PURE__*/ jsx("circle", {
|
|
70
|
+
cx: "12",
|
|
71
|
+
cy: "12",
|
|
72
|
+
r: "3"
|
|
73
|
+
}),
|
|
74
|
+
!visible && /*#__PURE__*/ jsx("path", {
|
|
75
|
+
d: "m3 3 18 18"
|
|
76
|
+
})
|
|
77
|
+
]
|
|
73
78
|
})
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
});
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
}) : suffix;
|
|
77
82
|
$[8] = config;
|
|
78
83
|
$[9] = ctx;
|
|
79
84
|
$[10] = iconRender;
|
|
80
85
|
$[11] = resolvedDisabled;
|
|
81
|
-
$[12] =
|
|
82
|
-
$[13] =
|
|
83
|
-
$[14] =
|
|
84
|
-
|
|
86
|
+
$[12] = suffix;
|
|
87
|
+
$[13] = visibilityToggle;
|
|
88
|
+
$[14] = visible;
|
|
89
|
+
$[15] = t4;
|
|
90
|
+
} else t4 = $[15];
|
|
85
91
|
let t5;
|
|
86
|
-
if ($[
|
|
87
|
-
t5 = /*#__PURE__*/
|
|
88
|
-
children: [
|
|
89
|
-
suffix,
|
|
90
|
-
t4
|
|
91
|
-
]
|
|
92
|
-
});
|
|
93
|
-
$[15] = suffix;
|
|
94
|
-
$[16] = t4;
|
|
95
|
-
$[17] = t5;
|
|
96
|
-
} else t5 = $[17];
|
|
97
|
-
let t6;
|
|
98
|
-
if ($[18] !== props || $[19] !== ref || $[20] !== resolvedDisabled || $[21] !== t3 || $[22] !== t5) {
|
|
99
|
-
t6 = /*#__PURE__*/ jsx(BaseInput, {
|
|
92
|
+
if ($[16] !== props || $[17] !== ref || $[18] !== resolvedDisabled || $[19] !== t3 || $[20] !== t4) {
|
|
93
|
+
t5 = /*#__PURE__*/ jsx(BaseInput, {
|
|
100
94
|
...props,
|
|
101
95
|
disabled: resolvedDisabled,
|
|
102
96
|
ref: ref,
|
|
103
97
|
type: t3,
|
|
104
|
-
suffix:
|
|
98
|
+
suffix: t4
|
|
105
99
|
});
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
110
|
-
$[
|
|
111
|
-
$[
|
|
112
|
-
} else
|
|
113
|
-
return
|
|
100
|
+
$[16] = props;
|
|
101
|
+
$[17] = ref;
|
|
102
|
+
$[18] = resolvedDisabled;
|
|
103
|
+
$[19] = t3;
|
|
104
|
+
$[20] = t4;
|
|
105
|
+
$[21] = t5;
|
|
106
|
+
} else t5 = $[21];
|
|
107
|
+
return t5;
|
|
114
108
|
});
|
|
115
109
|
function _temp(event) {
|
|
116
110
|
return event.preventDefault();
|
|
@@ -26,17 +26,20 @@ const search_Search = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
26
26
|
source: 'input'
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
|
+
const searchLabel = ctx.locale.search ?? 'Search';
|
|
30
|
+
const hasButtonContent = 0 === enterButton || Boolean(enterButton);
|
|
31
|
+
const iconOnly = true === enterButton || !hasButtonContent;
|
|
29
32
|
const buttonProps = {
|
|
30
33
|
type: 'button',
|
|
31
34
|
disabled: submitDisabled,
|
|
32
35
|
'aria-busy': isLoading || void 0,
|
|
33
|
-
'aria-label':
|
|
36
|
+
'aria-label': iconOnly ? searchLabel : void 0,
|
|
37
|
+
title: iconOnly ? void 0 : searchLabel,
|
|
34
38
|
className: classNames?.button,
|
|
35
39
|
style: styles?.button,
|
|
36
40
|
onMouseDown: (event_0)=>event_0.preventDefault(),
|
|
37
41
|
onClick: search
|
|
38
42
|
};
|
|
39
|
-
const hasButtonContent = 0 === enterButton || Boolean(enterButton);
|
|
40
43
|
const button = customButton ? /*#__PURE__*/ cloneElement(enterButton, {
|
|
41
44
|
...buttonProps,
|
|
42
45
|
className: cx(enterButton.props.className, classNames?.button),
|
|
@@ -44,7 +47,8 @@ const search_Search = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
44
47
|
...enterButton.props.style,
|
|
45
48
|
...styles?.button
|
|
46
49
|
},
|
|
47
|
-
'aria-label': enterButton.props['aria-label']
|
|
50
|
+
'aria-label': enterButton.props['aria-label'],
|
|
51
|
+
title: enterButton.props.title ?? searchLabel,
|
|
48
52
|
...enterButton.type === Button ? {
|
|
49
53
|
loading: isLoading,
|
|
50
54
|
size: props.size ?? enterButton.props.size
|
|
@@ -62,7 +66,7 @@ const search_Search = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
62
66
|
loading: isLoading,
|
|
63
67
|
size: props.size,
|
|
64
68
|
variant: hasButtonContent ? 'primary' : 'secondary',
|
|
65
|
-
children:
|
|
69
|
+
children: iconOnly ? searchIcon ?? /*#__PURE__*/ jsx(SearchIcon, {}) : enterButton
|
|
66
70
|
});
|
|
67
71
|
return /*#__PURE__*/ jsxs("div", {
|
|
68
72
|
"data-tao-input-search": "",
|
|
@@ -75,6 +75,7 @@ const MentionsComponent = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
75
75
|
ref: ref,
|
|
76
76
|
prefixCls: prefixCls,
|
|
77
77
|
disabled: disabled,
|
|
78
|
+
"aria-invalid": 'error' === status ? true : props['aria-invalid'],
|
|
78
79
|
onKeyDownCapture: (event)=>{
|
|
79
80
|
props.onKeyDownCapture?.(event);
|
|
80
81
|
if (!event.isPropagationStopped() && 'Enter' === event.key && (event.nativeEvent.isComposing || 229 === event.keyCode)) {
|
|
@@ -245,6 +245,7 @@ function renderMenuItems(items, ctx) {
|
|
|
245
245
|
disabled: item.disabled,
|
|
246
246
|
textValue: textValue,
|
|
247
247
|
checked: ctx.selectedKeys.includes(item.key),
|
|
248
|
+
onSelect: (event)=>event.preventDefault(),
|
|
248
249
|
onCheckedChange: ()=>{
|
|
249
250
|
ctx.onToggle(item.key);
|
|
250
251
|
ctx.onAction(item);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
|
-
import { useLayoutEffect, useRef, useState } from "react";
|
|
3
|
+
import { useId, useLayoutEffect, useRef, useState } from "react";
|
|
4
4
|
import { cx } from "../../utils/semantic.js";
|
|
5
5
|
import { Button } from "../button/button.js";
|
|
6
6
|
import { StatusIcon } from "../status-icon/status-icon.js";
|
|
@@ -9,8 +9,10 @@ import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
|
9
9
|
function isPromise(v) {
|
|
10
10
|
return !!v && 'function' == typeof v.then;
|
|
11
11
|
}
|
|
12
|
-
function ConfirmDialog({ onMount, open, close, type = 'confirm', icon, title, content, okText, cancelText, okCancel, okButtonProps, cancelButtonProps, onOk, onCancel, afterClose, centered = true, width = 416, maskClosable = false, closable
|
|
13
|
-
const { locale } = useTaoConfig();
|
|
12
|
+
function ConfirmDialog({ onMount, open, close, type = 'confirm', icon, title, content, okText, cancelText, okCancel, okButtonProps, cancelButtonProps, onOk, onCancel, afterClose, centered = true, width = 416, maskClosable = false, closable, keyboard = true, className, classNames, styles }) {
|
|
13
|
+
const { locale, disabled } = useTaoConfig();
|
|
14
|
+
const titleId = useId();
|
|
15
|
+
const contentId = useId();
|
|
14
16
|
const [loading, setLoading] = useState(false);
|
|
15
17
|
const [cancelLoading, setCancelLoading] = useState(false);
|
|
16
18
|
const cancelPending = useRef(false);
|
|
@@ -55,11 +57,13 @@ function ConfirmDialog({ onMount, open, close, type = 'confirm', icon, title, co
|
|
|
55
57
|
return /*#__PURE__*/ jsx(Modal, {
|
|
56
58
|
open: open,
|
|
57
59
|
title: null,
|
|
60
|
+
"aria-labelledby": null != title ? titleId : void 0,
|
|
61
|
+
"aria-describedby": null != content ? contentId : void 0,
|
|
58
62
|
onClose: handleCancel,
|
|
59
63
|
afterClose: afterClose,
|
|
60
64
|
width: width,
|
|
61
65
|
centered: centered,
|
|
62
|
-
closable: closable,
|
|
66
|
+
closable: closable ?? (!!(okButtonProps?.disabled ?? disabled) && (!showCancel || !!cancelButtonProps?.disabled)),
|
|
63
67
|
maskClosable: maskClosable,
|
|
64
68
|
keyboard: keyboard,
|
|
65
69
|
classNames: mergedClassNames,
|
|
@@ -69,6 +73,7 @@ function ConfirmDialog({ onMount, open, close, type = 'confirm', icon, title, co
|
|
|
69
73
|
showCancel && /*#__PURE__*/ jsx(Button, {
|
|
70
74
|
variant: "secondary",
|
|
71
75
|
...cancelButtonProps,
|
|
76
|
+
disabled: cancelButtonProps?.disabled ?? false,
|
|
72
77
|
loading: cancelLoading || cancelButtonProps?.loading,
|
|
73
78
|
onClick: (event)=>{
|
|
74
79
|
cancelButtonProps?.onClick?.(event);
|
|
@@ -101,10 +106,12 @@ function ConfirmDialog({ onMount, open, close, type = 'confirm', icon, title, co
|
|
|
101
106
|
"data-tao-modal-confirm-main": "",
|
|
102
107
|
children: [
|
|
103
108
|
null != title && /*#__PURE__*/ jsx("div", {
|
|
109
|
+
id: titleId,
|
|
104
110
|
"data-tao-modal-confirm-title": "",
|
|
105
111
|
children: title
|
|
106
112
|
}),
|
|
107
113
|
null != content && /*#__PURE__*/ jsx("div", {
|
|
114
|
+
id: contentId,
|
|
108
115
|
"data-tao-modal-confirm-content": "",
|
|
109
116
|
children: content
|
|
110
117
|
})
|