@uzum-tech/ui 1.5.2 → 1.5.3
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/README.md +0 -1
- package/dist/index.js +1030 -564
- package/dist/index.prod.js +3 -3
- package/es/_internal/checkbox/src/use-checkbox.js +3 -3
- package/es/_internal/radio/src/use-radio.js +3 -3
- package/es/_mixins/use-form-item.d.ts +4 -4
- package/es/_mixins/use-form-item.js +4 -4
- package/es/_styles/common/dark.js +1 -1
- package/es/_styles/common/light.d.ts +3 -0
- package/es/_styles/common/light.js +1 -1
- package/es/_utils/composable/composables.d.ts +11 -0
- package/es/_utils/composable/composables.js +40 -0
- package/es/_utils/index.d.ts +1 -1
- package/es/_utils/index.js +1 -1
- package/es/_utils/uzum/index.d.ts +1 -0
- package/es/_utils/uzum/index.js +1 -0
- package/es/_utils/uzum/value.d.ts +1 -0
- package/es/_utils/uzum/value.js +9 -0
- package/es/_utils/vue/resolve-slot.d.ts +1 -1
- package/es/alert/styles/light.js +6 -6
- package/es/auto-complete/src/AutoComplete.js +10 -10
- package/es/avatar/src/Avatar.d.ts +6 -0
- package/es/avatar/src/Avatar.js +9 -3
- package/es/card-list/src/CardList.js +1 -1
- package/es/card-list/src/CardListItem.d.ts +13 -0
- package/es/card-list/src/CardListItem.js +11 -4
- package/es/card-list/src/interface.d.ts +1 -0
- package/es/card-list/src/styles/index.cssr.js +6 -6
- package/es/card-list/styles/light.js +2 -2
- package/es/cascader/src/Cascader.js +7 -7
- package/es/checkbox/src/CheckboxGroup.js +9 -9
- package/es/color-picker/src/ColorPicker.js +6 -6
- package/es/components.d.ts +1 -0
- package/es/components.js +1 -0
- package/es/config-provider/src/internal-interface.d.ts +2 -0
- package/es/data-table/src/DataTable.d.ts +5 -0
- package/es/data-table/src/DataTable.js +20 -10
- package/es/data-table/src/TableParts/Body.js +3 -2
- package/es/data-table/src/TableParts/Cell.js +85 -23
- package/es/data-table/src/interface.d.ts +11 -6
- package/es/data-table/src/styles/index.cssr.js +5 -3
- package/es/data-table/src/use-mask.d.ts +3 -6
- package/es/data-table/src/utils.d.ts +2 -1
- package/es/data-table/src/utils.js +13 -0
- package/es/date-picker/src/DatePicker.js +7 -7
- package/es/dialog/src/DialogProvider.d.ts +6 -0
- package/es/dynamic-tags/src/DynamicTags.js +3 -3
- package/es/input/src/Input.js +8 -8
- package/es/input-number/src/InputNumber.js +7 -7
- package/es/input-otp/index.d.ts +3 -0
- package/es/input-otp/index.js +1 -0
- package/es/input-otp/src/InputOtp.d.ts +871 -0
- package/es/input-otp/src/InputOtp.js +250 -0
- package/es/input-otp/src/public-types.d.ts +25 -0
- package/es/input-otp/src/public-types.js +1 -0
- package/es/input-otp/src/styles/index.cssr.d.ts +2 -0
- package/es/input-otp/src/styles/index.cssr.js +20 -0
- package/es/input-otp/src/styles/input-otp-rtl.cssr.d.ts +2 -0
- package/es/input-otp/src/styles/input-otp-rtl.cssr.js +5 -0
- package/es/input-otp/styles/dark.d.ts +3 -0
- package/es/input-otp/styles/dark.js +12 -0
- package/es/input-otp/styles/index.d.ts +4 -0
- package/es/input-otp/styles/index.js +3 -0
- package/es/input-otp/styles/light.d.ts +83 -0
- package/es/input-otp/styles/light.js +22 -0
- package/es/input-otp/styles/rtl.d.ts +2 -0
- package/es/input-otp/styles/rtl.js +5 -0
- package/es/legacy-transfer/src/Transfer.js +3 -3
- package/es/list/src/ListItem.js +8 -4
- package/es/mention/src/Mention.js +7 -7
- package/es/radio/src/RadioGroup.js +5 -5
- package/es/rate/src/Rate.js +3 -3
- package/es/select/src/Select.js +7 -7
- package/es/slider/src/Slider.js +3 -3
- package/es/styles.d.ts +1 -0
- package/es/styles.js +1 -0
- package/es/switch/src/Switch.js +7 -7
- package/es/theme-editor/src/ThemeEditor.d.ts +3 -0
- package/es/themes/dark.js +2 -0
- package/es/themes/light.js +2 -0
- package/es/time-picker/src/TimePicker.js +7 -7
- package/es/transfer/src/Transfer.js +3 -3
- package/es/tree-select/src/TreeSelect.js +5 -5
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/checkbox/src/use-checkbox.js +3 -3
- package/lib/_internal/radio/src/use-radio.js +3 -3
- package/lib/_mixins/use-form-item.d.ts +4 -4
- package/lib/_mixins/use-form-item.js +4 -4
- package/lib/_styles/common/dark.js +1 -1
- package/lib/_styles/common/light.d.ts +3 -0
- package/lib/_styles/common/light.js +1 -1
- package/lib/_utils/composable/composables.d.ts +11 -0
- package/lib/_utils/composable/composables.js +47 -0
- package/lib/_utils/index.d.ts +1 -1
- package/lib/_utils/index.js +2 -1
- package/lib/_utils/uzum/index.d.ts +1 -0
- package/lib/_utils/uzum/index.js +3 -1
- package/lib/_utils/uzum/value.d.ts +1 -0
- package/lib/_utils/uzum/value.js +12 -0
- package/lib/_utils/vue/resolve-slot.d.ts +1 -1
- package/lib/alert/styles/light.js +6 -6
- package/lib/auto-complete/src/AutoComplete.js +10 -10
- package/lib/avatar/src/Avatar.d.ts +6 -0
- package/lib/avatar/src/Avatar.js +9 -3
- package/lib/card-list/src/CardList.js +1 -1
- package/lib/card-list/src/CardListItem.d.ts +13 -0
- package/lib/card-list/src/CardListItem.js +11 -4
- package/lib/card-list/src/interface.d.ts +1 -0
- package/lib/card-list/src/styles/index.cssr.js +5 -5
- package/lib/card-list/styles/light.js +2 -2
- package/lib/cascader/src/Cascader.js +7 -7
- package/lib/checkbox/src/CheckboxGroup.js +9 -9
- package/lib/color-picker/src/ColorPicker.js +6 -6
- package/lib/components.d.ts +1 -0
- package/lib/components.js +1 -0
- package/lib/config-provider/src/internal-interface.d.ts +2 -0
- package/lib/data-table/src/DataTable.d.ts +5 -0
- package/lib/data-table/src/DataTable.js +20 -10
- package/lib/data-table/src/TableParts/Body.js +3 -2
- package/lib/data-table/src/TableParts/Cell.js +84 -22
- package/lib/data-table/src/interface.d.ts +11 -6
- package/lib/data-table/src/styles/index.cssr.js +5 -3
- package/lib/data-table/src/use-mask.d.ts +3 -6
- package/lib/data-table/src/utils.d.ts +2 -1
- package/lib/data-table/src/utils.js +14 -1
- package/lib/date-picker/src/DatePicker.js +7 -7
- package/lib/dialog/src/DialogProvider.d.ts +6 -0
- package/lib/dynamic-tags/src/DynamicTags.js +3 -3
- package/lib/input/src/Input.js +8 -8
- package/lib/input-number/src/InputNumber.js +7 -7
- package/lib/input-otp/index.d.ts +3 -0
- package/lib/input-otp/index.js +9 -0
- package/lib/input-otp/src/InputOtp.d.ts +871 -0
- package/lib/input-otp/src/InputOtp.js +256 -0
- package/lib/input-otp/src/public-types.d.ts +25 -0
- package/lib/input-otp/src/public-types.js +2 -0
- package/lib/input-otp/src/styles/index.cssr.d.ts +2 -0
- package/lib/input-otp/src/styles/index.cssr.js +25 -0
- package/lib/input-otp/src/styles/input-otp-rtl.cssr.d.ts +2 -0
- package/lib/input-otp/src/styles/input-otp-rtl.cssr.js +10 -0
- package/lib/input-otp/styles/dark.d.ts +3 -0
- package/lib/input-otp/styles/dark.js +14 -0
- package/lib/input-otp/styles/index.d.ts +4 -0
- package/lib/input-otp/styles/index.js +12 -0
- package/lib/input-otp/styles/light.d.ts +83 -0
- package/lib/input-otp/styles/light.js +25 -0
- package/lib/input-otp/styles/rtl.d.ts +2 -0
- package/lib/input-otp/styles/rtl.js +11 -0
- package/lib/legacy-transfer/src/Transfer.js +3 -3
- package/lib/list/src/ListItem.js +8 -4
- package/lib/mention/src/Mention.js +7 -7
- package/lib/radio/src/RadioGroup.js +5 -5
- package/lib/rate/src/Rate.js +3 -3
- package/lib/select/src/Select.js +7 -7
- package/lib/slider/src/Slider.js +3 -3
- package/lib/styles.d.ts +1 -0
- package/lib/styles.js +106 -103
- package/lib/switch/src/Switch.js +7 -7
- package/lib/theme-editor/src/ThemeEditor.d.ts +3 -0
- package/lib/themes/dark.js +2 -0
- package/lib/themes/light.js +2 -0
- package/lib/time-picker/src/TimePicker.js +7 -7
- package/lib/transfer/src/Transfer.js +3 -3
- package/lib/tree-select/src/TreeSelect.js +5 -5
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/volar.d.ts +1 -0
- package/web-types.json +119 -4
|
@@ -28,6 +28,8 @@ export declare const avatarProps: {
|
|
|
28
28
|
readonly imgProps: PropType<ImgHTMLAttributes>;
|
|
29
29
|
readonly disabled: BooleanConstructor;
|
|
30
30
|
readonly loading: BooleanConstructor;
|
|
31
|
+
readonly iconColor: StringConstructor;
|
|
32
|
+
readonly iconSize: PropType<string | number>;
|
|
31
33
|
readonly theme: PropType<import("../../_mixins").Theme<"Avatar", {
|
|
32
34
|
borderRadius: string;
|
|
33
35
|
fontSize: string;
|
|
@@ -98,6 +100,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
98
100
|
readonly imgProps: PropType<ImgHTMLAttributes>;
|
|
99
101
|
readonly disabled: BooleanConstructor;
|
|
100
102
|
readonly loading: BooleanConstructor;
|
|
103
|
+
readonly iconColor: StringConstructor;
|
|
104
|
+
readonly iconSize: PropType<string | number>;
|
|
101
105
|
readonly theme: PropType<import("../../_mixins").Theme<"Avatar", {
|
|
102
106
|
borderRadius: string;
|
|
103
107
|
fontSize: string;
|
|
@@ -191,6 +195,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
191
195
|
readonly imgProps: PropType<ImgHTMLAttributes>;
|
|
192
196
|
readonly disabled: BooleanConstructor;
|
|
193
197
|
readonly loading: BooleanConstructor;
|
|
198
|
+
readonly iconColor: StringConstructor;
|
|
199
|
+
readonly iconSize: PropType<string | number>;
|
|
194
200
|
readonly theme: PropType<import("../../_mixins").Theme<"Avatar", {
|
|
195
201
|
borderRadius: string;
|
|
196
202
|
fontSize: string;
|
package/lib/avatar/src/Avatar.js
CHANGED
|
@@ -24,7 +24,7 @@ exports.avatarProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props),
|
|
|
24
24
|
}, bordered: {
|
|
25
25
|
type: Boolean,
|
|
26
26
|
default: undefined
|
|
27
|
-
}, onError: Function, fallbackSrc: String, intersectionObserverOptions: Object, lazy: Boolean, onLoad: Function, renderPlaceholder: Function, renderFallback: Function, imgProps: Object, disabled: Boolean, loading: Boolean });
|
|
27
|
+
}, onError: Function, fallbackSrc: String, intersectionObserverOptions: Object, lazy: Boolean, onLoad: Function, renderPlaceholder: Function, renderFallback: Function, imgProps: Object, disabled: Boolean, loading: Boolean, iconColor: String, iconSize: [String, Number] });
|
|
28
28
|
exports.default = (0, vue_1.defineComponent)({
|
|
29
29
|
name: 'Avatar',
|
|
30
30
|
props: exports.avatarProps,
|
|
@@ -109,6 +109,12 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
109
109
|
const getBackgroundColor = (color) => {
|
|
110
110
|
return props.disabled || size === 'small' ? 'rgba(0,0,0,0)' : color;
|
|
111
111
|
};
|
|
112
|
+
const resolveSize = (value, fallback) => {
|
|
113
|
+
if (value === undefined)
|
|
114
|
+
return fallback;
|
|
115
|
+
value = String(value);
|
|
116
|
+
return /^\d+$/.test(value) ? `${value}px` : value;
|
|
117
|
+
};
|
|
112
118
|
return {
|
|
113
119
|
'--u-font-size': fontSize,
|
|
114
120
|
'--u-font-weight': fontWeight,
|
|
@@ -116,10 +122,10 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
116
122
|
'--u-border-radius': round ? '50%' : borderRadius,
|
|
117
123
|
'--u-color': getBackgroundColor(color),
|
|
118
124
|
'--u-text-color': textColor,
|
|
119
|
-
'--u-icon-color': iconColor,
|
|
125
|
+
'--u-icon-color': props.iconColor || iconColor,
|
|
120
126
|
'--u-bezier': cubicBezierEaseInOut,
|
|
121
127
|
'--u-merged-size': `var(--u-avatar-size-override, ${height})`,
|
|
122
|
-
'--u-icon-size': iconSize
|
|
128
|
+
'--u-icon-size': resolveSize(props.iconSize, iconSize)
|
|
123
129
|
};
|
|
124
130
|
});
|
|
125
131
|
const themeClassHandle = inlineThemeDisabled
|
|
@@ -69,7 +69,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
69
69
|
return (0, vue_1.h)(Grid_1.default, Object.assign({ class: [`${mergedClsPrefix}-card-list`, themeClass], style: cssVars, cols,
|
|
70
70
|
xGap,
|
|
71
71
|
yGap }, gridProps), () => items.map((card, idx) => (0, vue_1.h)(GridItem_1.default, { key: idx, span: card.span || 1 }, () => [
|
|
72
|
-
(0, vue_1.h)(CardListItem_1.default, Object.assign(Object.assign({ title: card.title, subtitle: card.subtitle, items: card.items, direction: card.direction, dropdown: card.dropdown }, cardProps), { renderDivider: showDivider ? renderDivider : () => null }))
|
|
72
|
+
(0, vue_1.h)(CardListItem_1.default, Object.assign(Object.assign({ title: card.title, subtitle: card.subtitle, items: card.items, direction: card.direction, embedded: card.embedded, dropdown: card.dropdown }, cardProps), { renderDivider: showDivider ? renderDivider : () => null }))
|
|
73
73
|
])));
|
|
74
74
|
}
|
|
75
75
|
});
|
|
@@ -13,6 +13,10 @@ declare const cardListItemProps: {
|
|
|
13
13
|
readonly default: "horizontal";
|
|
14
14
|
};
|
|
15
15
|
readonly dropdown: BooleanConstructor;
|
|
16
|
+
readonly embedded: {
|
|
17
|
+
readonly type: BooleanConstructor;
|
|
18
|
+
readonly default: false;
|
|
19
|
+
};
|
|
16
20
|
readonly renderDivider: PropType<({ index, count, direction }: {
|
|
17
21
|
index: number;
|
|
18
22
|
count: number;
|
|
@@ -32,6 +36,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
32
36
|
readonly default: "horizontal";
|
|
33
37
|
};
|
|
34
38
|
readonly dropdown: BooleanConstructor;
|
|
39
|
+
readonly embedded: {
|
|
40
|
+
readonly type: BooleanConstructor;
|
|
41
|
+
readonly default: false;
|
|
42
|
+
};
|
|
35
43
|
readonly renderDivider: PropType<({ index, count, direction }: {
|
|
36
44
|
index: number;
|
|
37
45
|
count: number;
|
|
@@ -58,6 +66,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
58
66
|
readonly default: "horizontal";
|
|
59
67
|
};
|
|
60
68
|
readonly dropdown: BooleanConstructor;
|
|
69
|
+
readonly embedded: {
|
|
70
|
+
readonly type: BooleanConstructor;
|
|
71
|
+
readonly default: false;
|
|
72
|
+
};
|
|
61
73
|
readonly renderDivider: PropType<({ index, count, direction }: {
|
|
62
74
|
index: number;
|
|
63
75
|
count: number;
|
|
@@ -66,5 +78,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
66
78
|
}>>, {
|
|
67
79
|
readonly direction: "vertical" | "horizontal";
|
|
68
80
|
readonly dropdown: boolean;
|
|
81
|
+
readonly embedded: boolean;
|
|
69
82
|
}, {}>;
|
|
70
83
|
export default _default;
|
|
@@ -17,6 +17,10 @@ const cardListItemProps = {
|
|
|
17
17
|
default: 'horizontal'
|
|
18
18
|
},
|
|
19
19
|
dropdown: Boolean,
|
|
20
|
+
embedded: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false
|
|
23
|
+
},
|
|
20
24
|
renderDivider: Function
|
|
21
25
|
};
|
|
22
26
|
exports.default = (0, vue_1.defineComponent)({
|
|
@@ -63,7 +67,10 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
63
67
|
const isGrouped = !this.dropdown &&
|
|
64
68
|
(this.direction === 'horizontal' || this.direction === 'vertical');
|
|
65
69
|
const isDropdown = this.dropdown;
|
|
66
|
-
return ((0, vue_1.h)("div", { class:
|
|
70
|
+
return ((0, vue_1.h)("div", { class: [
|
|
71
|
+
`${mergedClsPrefix}-card-list-item`,
|
|
72
|
+
this.embedded && `${mergedClsPrefix}-card-list-item--embedded`
|
|
73
|
+
], onClick: isDropdown && items.length ? this.toggle : undefined, ref: "selfRef" },
|
|
67
74
|
isDropdown && ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-card-list-item__wrapper` },
|
|
68
75
|
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-card-list-item__wrapper-content` },
|
|
69
76
|
this.title && ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-card-list-item__title` }, this.title)),
|
|
@@ -79,7 +86,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
79
86
|
isGrouped && items.length > 0 && ((0, vue_1.h)("div", { class: [
|
|
80
87
|
`${mergedClsPrefix}-card-list-item__items`,
|
|
81
88
|
this.direction,
|
|
82
|
-
this.direction === '
|
|
89
|
+
this.direction === 'horizontal' &&
|
|
83
90
|
`${mergedClsPrefix}-card-list-item__items--grid`
|
|
84
91
|
] }, items.map((item, idx) => [
|
|
85
92
|
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-card-list-item__item`, key: idx },
|
|
@@ -95,10 +102,10 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
95
102
|
: (0, vue_1.h)('div', {
|
|
96
103
|
class: [
|
|
97
104
|
`${mergedClsPrefix}-card-list-item__divider`,
|
|
98
|
-
this.direction === '
|
|
105
|
+
this.direction === 'horizontal'
|
|
99
106
|
? `${mergedClsPrefix}-card-list-item__divider--vertical`
|
|
100
107
|
: `${mergedClsPrefix}-card-list-item__divider--horizontal`,
|
|
101
|
-
this.direction === '
|
|
108
|
+
this.direction === 'horizontal' &&
|
|
102
109
|
`${mergedClsPrefix}-card-list-item__divider--grid`
|
|
103
110
|
]
|
|
104
111
|
}))
|
|
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
const cssr_1 = require("../../../_utils/cssr");
|
|
7
7
|
exports.default = (0, cssr_1.cB)('card-list-item', [(0, cssr_1.c)('&', {
|
|
8
8
|
padding: '16px',
|
|
9
|
-
backgroundColor: 'var(--u-color-embedded)',
|
|
10
9
|
borderRadius: 'var(--u-border-radius)',
|
|
11
|
-
boxShadow: 'var(--u-box-shadow)',
|
|
12
10
|
display: 'flex',
|
|
13
11
|
flexDirection: 'column',
|
|
14
12
|
gap: '8px',
|
|
15
13
|
position: 'relative'
|
|
16
|
-
}
|
|
14
|
+
}, [(0, cssr_1.cM)('embedded', {
|
|
15
|
+
backgroundColor: 'var(--u-color-embedded)'
|
|
16
|
+
})]), (0, cssr_1.cB)('card-list-item__title', {
|
|
17
17
|
fontSize: 'var(--u-title-font-size)',
|
|
18
18
|
lineHeight: 'var(--u-title-line-height)',
|
|
19
19
|
fontWeight: 'var(--u-title-font-weight)',
|
|
@@ -27,10 +27,10 @@ exports.default = (0, cssr_1.cB)('card-list-item', [(0, cssr_1.c)('&', {
|
|
|
27
27
|
display: 'flex',
|
|
28
28
|
gap: '0'
|
|
29
29
|
}, [(0, cssr_1.c)('&.horizontal', {
|
|
30
|
-
flexDirection: 'column'
|
|
31
|
-
}), (0, cssr_1.c)('&.vertical', {
|
|
32
30
|
flexDirection: 'row',
|
|
33
31
|
alignItems: 'stretch'
|
|
32
|
+
}), (0, cssr_1.c)('&.vertical', {
|
|
33
|
+
flexDirection: 'column'
|
|
34
34
|
})]), (0, cssr_1.cB)('card-list-item__items--grid', {
|
|
35
35
|
display: 'grid',
|
|
36
36
|
gridAutoFlow: 'column',
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.self = void 0;
|
|
4
4
|
const common_1 = require("../../_styles/common");
|
|
5
5
|
const self = (vars) => {
|
|
6
|
-
const { textSecondary, textPrimary, fontWeight, fontWeightBold, fontBodyLarge, fontBodyMedium, lineHeightBodyMedium, borderRadiusLarge, containerSecondary, shadowDepth2,
|
|
6
|
+
const { textSecondary, textPrimary, fontWeight, fontWeightBold, fontBodyLarge, fontBodyMedium, lineHeightBodyMedium, borderRadiusLarge, containerSecondary, shadowDepth2, elementsQuaternary, elementsSecondary } = vars;
|
|
7
7
|
return {
|
|
8
8
|
textColor: textSecondary,
|
|
9
9
|
textLineHeight: lineHeightBodyMedium,
|
|
@@ -17,7 +17,7 @@ const self = (vars) => {
|
|
|
17
17
|
borderRadius: borderRadiusLarge,
|
|
18
18
|
boxShadow: shadowDepth2,
|
|
19
19
|
colorEmbedded: containerSecondary,
|
|
20
|
-
dividerColor:
|
|
20
|
+
dividerColor: elementsQuaternary,
|
|
21
21
|
dropDownBgColor: elementsSecondary
|
|
22
22
|
};
|
|
23
23
|
};
|
|
@@ -188,7 +188,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
188
188
|
}
|
|
189
189
|
function doUpdateValue(value, option, optionPath) {
|
|
190
190
|
const { onUpdateValue, 'onUpdate:value': _onUpdateValue, onChange } = props;
|
|
191
|
-
const {
|
|
191
|
+
const { triggerFormInput, triggerFormChange } = formItem;
|
|
192
192
|
if (onUpdateValue) {
|
|
193
193
|
(0, _utils_1.call)(onUpdateValue, value, option, optionPath);
|
|
194
194
|
}
|
|
@@ -199,8 +199,8 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
199
199
|
(0, _utils_1.call)(onChange, value, option, optionPath);
|
|
200
200
|
}
|
|
201
201
|
uncontrolledValueRef.value = value;
|
|
202
|
-
|
|
203
|
-
|
|
202
|
+
triggerFormInput();
|
|
203
|
+
triggerFormChange();
|
|
204
204
|
}
|
|
205
205
|
function updateKeyboardKey(key) {
|
|
206
206
|
keyboardKeyRef.value = key;
|
|
@@ -377,17 +377,17 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
377
377
|
// --- methods
|
|
378
378
|
function doBlur(e) {
|
|
379
379
|
const { onBlur } = props;
|
|
380
|
-
const {
|
|
380
|
+
const { triggerFormBlur } = formItem;
|
|
381
381
|
if (onBlur)
|
|
382
382
|
(0, _utils_1.call)(onBlur, e);
|
|
383
|
-
|
|
383
|
+
triggerFormBlur();
|
|
384
384
|
}
|
|
385
385
|
function doFocus(e) {
|
|
386
386
|
const { onFocus } = props;
|
|
387
|
-
const {
|
|
387
|
+
const { triggerFormFocus } = formItem;
|
|
388
388
|
if (onFocus)
|
|
389
389
|
(0, _utils_1.call)(onFocus, e);
|
|
390
|
-
|
|
390
|
+
triggerFormFocus();
|
|
391
391
|
}
|
|
392
392
|
function focusSelectionInput() {
|
|
393
393
|
var _a;
|
|
@@ -52,7 +52,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
52
52
|
return new Set();
|
|
53
53
|
});
|
|
54
54
|
function toggleCheckbox(checked, checkboxValue) {
|
|
55
|
-
const {
|
|
55
|
+
const { triggerFormInput, triggerFormChange } = formItem;
|
|
56
56
|
const { onChange, 'onUpdate:value': _onUpdateValue, onUpdateValue } = props;
|
|
57
57
|
if (Array.isArray(mergedValueRef.value)) {
|
|
58
58
|
const groupValue = Array.from(mergedValueRef.value);
|
|
@@ -72,8 +72,8 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
72
72
|
value: checkboxValue
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
triggerFormInput();
|
|
76
|
+
triggerFormChange();
|
|
77
77
|
uncontrolledValueRef.value = groupValue;
|
|
78
78
|
// deprecated
|
|
79
79
|
if (onChange)
|
|
@@ -98,8 +98,8 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
98
98
|
if (onChange)
|
|
99
99
|
(0, _utils_1.call)(onChange, groupValue); // deprecated
|
|
100
100
|
uncontrolledValueRef.value = groupValue;
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
triggerFormInput();
|
|
102
|
+
triggerFormChange();
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
}
|
|
@@ -120,8 +120,8 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
120
120
|
if (onChange)
|
|
121
121
|
(0, _utils_1.call)(onChange, [checkboxValue]); // deprecated
|
|
122
122
|
uncontrolledValueRef.value = [checkboxValue];
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
triggerFormInput();
|
|
124
|
+
triggerFormChange();
|
|
125
125
|
}
|
|
126
126
|
else {
|
|
127
127
|
if (onUpdateValue) {
|
|
@@ -139,8 +139,8 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
139
139
|
if (onChange)
|
|
140
140
|
(0, _utils_1.call)(onChange, []); // deprecated
|
|
141
141
|
uncontrolledValueRef.value = [];
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
triggerFormInput();
|
|
143
|
+
triggerFormChange();
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
}
|
|
@@ -261,14 +261,14 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
261
261
|
else {
|
|
262
262
|
upcomingValue = null;
|
|
263
263
|
}
|
|
264
|
-
const {
|
|
264
|
+
const { triggerFormChange, triggerFormInput } = formItem;
|
|
265
265
|
const { onUpdateValue, 'onUpdate:value': _onUpdateValue } = props;
|
|
266
266
|
if (onUpdateValue)
|
|
267
267
|
(0, _utils_1.call)(onUpdateValue, value);
|
|
268
268
|
if (_onUpdateValue)
|
|
269
269
|
(0, _utils_1.call)(_onUpdateValue, value);
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
triggerFormChange();
|
|
271
|
+
triggerFormInput();
|
|
272
272
|
uncontrolledValueRef.value = value;
|
|
273
273
|
}
|
|
274
274
|
function handleInputUpdateValue(value) {
|
|
@@ -279,7 +279,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
279
279
|
const { value } = mergedValueRef;
|
|
280
280
|
// no value & only hue changes will complete with no value
|
|
281
281
|
if (value) {
|
|
282
|
-
const {
|
|
282
|
+
const { triggerFormChange, triggerFormInput } = formItem;
|
|
283
283
|
const { onComplete } = props;
|
|
284
284
|
if (onComplete) {
|
|
285
285
|
;
|
|
@@ -291,8 +291,8 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
291
291
|
undoStack.splice(valueIndex + 1, undoStack.length, value);
|
|
292
292
|
valueIndexRef.value = valueIndex + 1;
|
|
293
293
|
}
|
|
294
|
-
|
|
295
|
-
|
|
294
|
+
triggerFormChange();
|
|
295
|
+
triggerFormInput();
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
298
|
function undo() {
|
package/lib/components.d.ts
CHANGED
package/lib/components.js
CHANGED
|
@@ -60,6 +60,7 @@ __exportStar(require("./icon-wrapper"), exports);
|
|
|
60
60
|
__exportStar(require("./image"), exports);
|
|
61
61
|
__exportStar(require("./input"), exports);
|
|
62
62
|
__exportStar(require("./input-number"), exports);
|
|
63
|
+
__exportStar(require("./input-otp"), exports);
|
|
63
64
|
__exportStar(require("./layout"), exports);
|
|
64
65
|
__exportStar(require("./legacy-grid"), exports);
|
|
65
66
|
__exportStar(require("./legacy-transfer"), exports);
|
|
@@ -37,6 +37,7 @@ import type { IconWrapperTheme } from '../../icon-wrapper/styles';
|
|
|
37
37
|
import type { ImageTheme } from '../../image/styles';
|
|
38
38
|
import type { InputTheme } from '../../input/styles';
|
|
39
39
|
import type { InputNumberTheme } from '../../input-number/styles';
|
|
40
|
+
import type { InputOtpTheme } from '../../input-otp/styles';
|
|
40
41
|
import type { LayoutTheme } from '../../layout/styles';
|
|
41
42
|
import type { LegacyTransferTheme } from '../../legacy-transfer/styles';
|
|
42
43
|
import type { ListTheme } from '../../list/styles';
|
|
@@ -190,6 +191,7 @@ export interface GlobalThemeWithoutCommon {
|
|
|
190
191
|
InternalSelectMenu?: InternalSelectMenuTheme;
|
|
191
192
|
InternalSelection?: InternalSelectionTheme;
|
|
192
193
|
AccountOption?: AccountOptionTheme;
|
|
194
|
+
InputOtp?: InputOtpTheme;
|
|
193
195
|
}
|
|
194
196
|
export interface GlobalComponentConfig {
|
|
195
197
|
Pagination?: {
|
|
@@ -2872,6 +2872,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2872
2872
|
page: (page: number) => void;
|
|
2873
2873
|
sort: (columnKey: import("./interface").ColumnKey, order: import("./interface").SortOrder) => void;
|
|
2874
2874
|
scrollTo: import("../../scrollbar/src/Scrollbar").ScrollTo;
|
|
2875
|
+
getData: () => {
|
|
2876
|
+
data: import("./interface").InternalRowData[];
|
|
2877
|
+
totalRows: import("./interface").InternalRowData | null;
|
|
2878
|
+
};
|
|
2879
|
+
getTotalRowData: () => import("./interface").InternalRowData | null;
|
|
2875
2880
|
clearFilter: () => void;
|
|
2876
2881
|
mainTableInstRef: import("vue").Ref<{
|
|
2877
2882
|
getHeaderElement: () => HTMLElement | null;
|
|
@@ -18,7 +18,6 @@ const use_resizable_1 = require("./use-resizable");
|
|
|
18
18
|
const interface_1 = require("./interface");
|
|
19
19
|
const use_group_header_1 = require("./use-group-header");
|
|
20
20
|
const use_expand_1 = require("./use-expand");
|
|
21
|
-
const use_mask_1 = require("./use-mask");
|
|
22
21
|
const index_cssr_1 = __importDefault(require("./styles/index.cssr"));
|
|
23
22
|
exports.default = (0, vue_1.defineComponent)({
|
|
24
23
|
name: 'DataTable',
|
|
@@ -98,7 +97,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
98
97
|
return;
|
|
99
98
|
if (!('totalRow' in col) || !col.totalRow)
|
|
100
99
|
return;
|
|
101
|
-
const { key, totalRow, render
|
|
100
|
+
const { key, totalRow, render } = col;
|
|
102
101
|
if (!totalRow)
|
|
103
102
|
return;
|
|
104
103
|
if (totalRow.type === 'default') {
|
|
@@ -111,18 +110,12 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
111
110
|
return Number(renderedValue) || 0;
|
|
112
111
|
});
|
|
113
112
|
const sum = values.reduce((sum, val) => sum + val, 0);
|
|
114
|
-
|
|
115
|
-
? (0, use_mask_1.processMaskedValue)(String(sum), mask)
|
|
116
|
-
: sum;
|
|
117
|
-
summaryRow[key] = { value: finalValue };
|
|
113
|
+
summaryRow[key] = { value: sum };
|
|
118
114
|
}
|
|
119
115
|
else {
|
|
120
116
|
const values = pageData.map((row) => Number(row[key]) || 0);
|
|
121
117
|
const sum = values.reduce((sum, val) => sum + val, 0);
|
|
122
|
-
|
|
123
|
-
? (0, use_mask_1.processMaskedValue)(String(sum), mask)
|
|
124
|
-
: sum;
|
|
125
|
-
summaryRow[key] = { value: finalValue };
|
|
118
|
+
summaryRow[key] = { value: sum };
|
|
126
119
|
}
|
|
127
120
|
}
|
|
128
121
|
else {
|
|
@@ -325,6 +318,23 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
325
318
|
scrollTo: (arg0, arg1) => {
|
|
326
319
|
var _a;
|
|
327
320
|
(_a = mainTableInstRef.value) === null || _a === void 0 ? void 0 : _a.scrollTo(arg0, arg1);
|
|
321
|
+
},
|
|
322
|
+
getData: () => {
|
|
323
|
+
const originalData = props.data || [];
|
|
324
|
+
const totalRowData = autoSummaryRef.value && rawPaginatedDataRef.value
|
|
325
|
+
? autoSummaryRef.value(rawPaginatedDataRef.value)
|
|
326
|
+
: null;
|
|
327
|
+
return {
|
|
328
|
+
data: originalData,
|
|
329
|
+
totalRows: totalRowData
|
|
330
|
+
};
|
|
331
|
+
},
|
|
332
|
+
getTotalRowData: () => {
|
|
333
|
+
if (autoSummaryRef.value && rawPaginatedDataRef.value) {
|
|
334
|
+
const summaryResult = autoSummaryRef.value(rawPaginatedDataRef.value);
|
|
335
|
+
return summaryResult;
|
|
336
|
+
}
|
|
337
|
+
return null;
|
|
328
338
|
}
|
|
329
339
|
};
|
|
330
340
|
const cssVarsRef = (0, vue_1.computed)(() => {
|
|
@@ -565,6 +565,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
565
565
|
`${mergedClsPrefix}-data-table-td--last-row`,
|
|
566
566
|
'editable' in column &&
|
|
567
567
|
column.editable &&
|
|
568
|
+
!isSummary &&
|
|
568
569
|
`${mergedClsPrefix}-data-table-td--editable`
|
|
569
570
|
] }),
|
|
570
571
|
column.fixed && ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-data-table-td__shadow-holder` })),
|
|
@@ -601,7 +602,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
601
602
|
}))) : null));
|
|
602
603
|
}
|
|
603
604
|
else {
|
|
604
|
-
if (this.loading) {
|
|
605
|
+
if (this.loading || this.loadingSkeleton) {
|
|
605
606
|
return ((0, vue_1.h)("table", { class: `${mergedClsPrefix}-data-table-table`, onMouseleave: handleMouseleaveTable, style: {
|
|
606
607
|
tableLayout: this.mergedTableLayout
|
|
607
608
|
} },
|
|
@@ -620,7 +621,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
620
621
|
}
|
|
621
622
|
}
|
|
622
623
|
}));
|
|
623
|
-
if (this.empty) {
|
|
624
|
+
if (this.empty && !this.loadingSkeleton) {
|
|
624
625
|
const createEmptyNode = () => ((0, vue_1.h)("div", { class: [
|
|
625
626
|
`${mergedClsPrefix}-data-table-empty`,
|
|
626
627
|
this.loading && `${mergedClsPrefix}-data-table-empty--hide`
|
|
@@ -4,6 +4,7 @@ const vue_1 = require("vue");
|
|
|
4
4
|
const lodash_es_1 = require("lodash-es");
|
|
5
5
|
const ellipsis_1 = require("../../../ellipsis");
|
|
6
6
|
const use_mask_1 = require("../use-mask");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
7
8
|
exports.default = (0, vue_1.defineComponent)({
|
|
8
9
|
name: 'DataTableCell',
|
|
9
10
|
emits: ['edit'],
|
|
@@ -35,7 +36,10 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
35
36
|
var _a;
|
|
36
37
|
const { isSummary, column, row, renderCell } = this;
|
|
37
38
|
let cell;
|
|
38
|
-
|
|
39
|
+
let { mask } = column;
|
|
40
|
+
const { render, key, ellipsis, editable, numeric } = column;
|
|
41
|
+
if (numeric && !mask)
|
|
42
|
+
mask = utils_1.defaultNumericMask;
|
|
39
43
|
if (render && !isSummary) {
|
|
40
44
|
let cellValue = render(row, this.index);
|
|
41
45
|
if (mask && cellValue !== null && cellValue !== undefined) {
|
|
@@ -47,37 +51,95 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
47
51
|
}
|
|
48
52
|
else if (editable && !isSummary) {
|
|
49
53
|
const { placeholder } = column;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
+
const rawValue = String(row[key] || '');
|
|
55
|
+
const displayValue = mask ? (0, use_mask_1.processMaskedValue)(rawValue, mask) : rawValue;
|
|
56
|
+
const isEditingRef = { current: false };
|
|
54
57
|
const inputProps = {
|
|
55
58
|
class: `${this.clsPrefix}-data-table-editable-input`,
|
|
56
|
-
value:
|
|
59
|
+
value: displayValue,
|
|
57
60
|
placeholder: placeholder || '',
|
|
61
|
+
onFocus: (e) => {
|
|
62
|
+
const input = e.target;
|
|
63
|
+
isEditingRef.current = true;
|
|
64
|
+
input.value = rawValue;
|
|
65
|
+
},
|
|
66
|
+
onKeyDown: (e) => {
|
|
67
|
+
if (mask && typeof mask === 'function' && isEditingRef.current) {
|
|
68
|
+
const input = e.target;
|
|
69
|
+
input.value = rawValue;
|
|
70
|
+
}
|
|
71
|
+
},
|
|
58
72
|
onInput: (e) => {
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
73
|
+
const input = e.target;
|
|
74
|
+
const value = input.value;
|
|
75
|
+
if (mask && typeof mask === 'function' && !isEditingRef.current) {
|
|
76
|
+
isEditingRef.current = true;
|
|
77
|
+
}
|
|
78
|
+
if (mask && typeof mask === 'function' && isEditingRef.current) {
|
|
79
|
+
const rawValue = value.replace(/\$/g, '').replace(/[^\d.,]/g, '');
|
|
80
|
+
input.value = rawValue;
|
|
81
|
+
let processedValue = rawValue;
|
|
82
|
+
if (numeric && rawValue !== '') {
|
|
83
|
+
const cleanValue = rawValue
|
|
84
|
+
.replace(/[^\d.,]/g, '')
|
|
85
|
+
.replace(',', '.');
|
|
86
|
+
const numValue = Number(cleanValue);
|
|
87
|
+
if (!isNaN(numValue)) {
|
|
88
|
+
processedValue = numValue;
|
|
68
89
|
}
|
|
69
|
-
}
|
|
90
|
+
}
|
|
70
91
|
this.$emit('edit', processedValue, row, key);
|
|
92
|
+
void Promise.resolve().then(() => {
|
|
93
|
+
if (isEditingRef.current && input.value !== rawValue) {
|
|
94
|
+
input.value = rawValue;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
let processedValue = value;
|
|
100
|
+
if (numeric && value !== '') {
|
|
101
|
+
const cleanValue = value.replace(/[^\d.,]/g, '').replace(',', '.');
|
|
102
|
+
const numValue = Number(cleanValue);
|
|
103
|
+
if (!isNaN(numValue)) {
|
|
104
|
+
processedValue = numValue;
|
|
105
|
+
}
|
|
71
106
|
}
|
|
72
|
-
|
|
73
|
-
|
|
107
|
+
this.$emit('edit', processedValue, row, key);
|
|
108
|
+
},
|
|
109
|
+
onKeyUp: (e) => {
|
|
110
|
+
if (mask && typeof mask === 'function' && isEditingRef.current) {
|
|
111
|
+
const input = e.target;
|
|
112
|
+
input.value = rawValue;
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
onChange: (e) => {
|
|
116
|
+
if (mask && typeof mask === 'function' && isEditingRef.current) {
|
|
117
|
+
const input = e.target;
|
|
118
|
+
setTimeout(() => {
|
|
119
|
+
if (isEditingRef.current && input.value !== rawValue) {
|
|
120
|
+
input.value = rawValue;
|
|
121
|
+
}
|
|
122
|
+
}, 0);
|
|
123
|
+
setTimeout(() => {
|
|
124
|
+
if (isEditingRef.current && input.value !== rawValue) {
|
|
125
|
+
input.value = rawValue;
|
|
126
|
+
}
|
|
127
|
+
}, 10);
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
onBlur: (e) => {
|
|
131
|
+
isEditingRef.current = false;
|
|
132
|
+
if (mask) {
|
|
133
|
+
const input = e.target;
|
|
134
|
+
let currentValue = input.value;
|
|
135
|
+
if (numeric && currentValue !== '') {
|
|
136
|
+
currentValue = currentValue.replace(',', '.');
|
|
137
|
+
}
|
|
138
|
+
const maskedValue = (0, use_mask_1.processMaskedValue)(currentValue, mask);
|
|
139
|
+
input.value = maskedValue;
|
|
74
140
|
}
|
|
75
141
|
}
|
|
76
142
|
};
|
|
77
|
-
if (mask) {
|
|
78
|
-
inputProps['data-mask'] =
|
|
79
|
-
typeof mask === 'string' ? mask : JSON.stringify(mask);
|
|
80
|
-
}
|
|
81
143
|
cell = (0, vue_1.h)('input', inputProps);
|
|
82
144
|
}
|
|
83
145
|
else {
|