@uzum-tech/ui 1.5.4 → 1.5.5
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/index.js +35 -20
- package/dist/index.prod.js +3 -3
- package/es/_utils/css/index.d.ts +1 -0
- package/es/_utils/css/index.js +1 -0
- package/es/_utils/css/normalize-size.d.ts +1 -0
- package/es/_utils/css/normalize-size.js +6 -0
- package/es/_utils/index.d.ts +1 -1
- package/es/_utils/index.js +1 -1
- package/es/avatar/src/Avatar.js +1 -7
- package/es/badge/src/Badge.d.ts +13 -0
- package/es/badge/src/Badge.js +5 -4
- package/es/badge/src/styles/index.cssr.js +5 -6
- package/es/badge/styles/light.d.ts +1 -0
- package/es/badge/styles/light.js +2 -1
- package/es/date-picker/src/DatePicker.d.ts +3 -0
- package/es/date-picker/src/DatePicker.js +2 -2
- package/es/date-picker/src/interface.d.ts +1 -0
- package/es/date-picker/src/panel/use-calendar.js +5 -2
- package/es/date-picker/src/panel/use-dual-calendar.js +6 -3
- package/es/date-picker/src/utils.d.ts +1 -1
- package/es/date-picker/src/utils.js +3 -2
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_utils/css/index.d.ts +1 -0
- package/lib/_utils/css/index.js +3 -1
- package/lib/_utils/css/normalize-size.d.ts +1 -0
- package/lib/_utils/css/normalize-size.js +10 -0
- package/lib/_utils/index.d.ts +1 -1
- package/lib/_utils/index.js +2 -1
- package/lib/avatar/src/Avatar.js +1 -7
- package/lib/badge/src/Badge.d.ts +13 -0
- package/lib/badge/src/Badge.js +4 -3
- package/lib/badge/src/styles/index.cssr.js +5 -6
- package/lib/badge/styles/light.d.ts +1 -0
- package/lib/badge/styles/light.js +2 -1
- package/lib/date-picker/src/DatePicker.d.ts +3 -0
- package/lib/date-picker/src/DatePicker.js +2 -2
- package/lib/date-picker/src/interface.d.ts +1 -0
- package/lib/date-picker/src/panel/use-calendar.js +5 -2
- package/lib/date-picker/src/panel/use-dual-calendar.js +6 -3
- package/lib/date-picker/src/utils.d.ts +1 -1
- package/lib/date-picker/src/utils.js +3 -2
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/web-types.json +11 -1
package/es/_utils/css/index.d.ts
CHANGED
package/es/_utils/css/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const resolveSize: (value: string | number | undefined, fallback: string) => string;
|
package/es/_utils/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { call, keep, omit, flatten, getSlot, getVNodeChildren, keysOf, render, g
|
|
|
2
2
|
export type { MaybeArray } from './vue';
|
|
3
3
|
export { warn, warnOnce, throwError, smallerSize, largerSize, getTitleAttribute, isArrayShallowEqual } from './uzum';
|
|
4
4
|
export type { ExtractPublicPropTypes, ExtractInternalPropTypes, Mutable } from './uzum';
|
|
5
|
-
export { formatLength, color2Class } from './css';
|
|
5
|
+
export { formatLength, color2Class, resolveSize } from './css';
|
|
6
6
|
export { createKey } from './cssr';
|
|
7
7
|
export { isJsdom } from './env/is-jsdom';
|
|
8
8
|
export { isBrowser } from './env/is-browser';
|
package/es/_utils/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { call, keep, omit, flatten, getSlot, getVNodeChildren, keysOf, render, getFirstSlotVNode, createDataKey, createRefSetter, createInjectionKey, resolveSlot, resolveSlotWithProps, resolveWrappedSlot, isSlotEmpty, mergeEventHandlers, isNodeVShowFalse, resolveWrappedSlotWithProps, Wrapper } from './vue';
|
|
2
2
|
export { warn, warnOnce, throwError, smallerSize, largerSize, getTitleAttribute, isArrayShallowEqual } from './uzum';
|
|
3
|
-
export { formatLength, color2Class } from './css';
|
|
3
|
+
export { formatLength, color2Class, resolveSize } from './css';
|
|
4
4
|
export { createKey } from './cssr';
|
|
5
5
|
export { isJsdom } from './env/is-jsdom';
|
|
6
6
|
export { isBrowser } from './env/is-browser';
|
package/es/avatar/src/Avatar.js
CHANGED
|
@@ -4,7 +4,7 @@ import { isImageSupportNativeLazy } from '../../_utils/env/is-native-lazy-load';
|
|
|
4
4
|
import { observeIntersection } from '../../image/src/utils';
|
|
5
5
|
import { tagInjectionKey } from '../../tag/src/Tag';
|
|
6
6
|
import { useConfig, useTheme, useThemeClass } from '../../_mixins';
|
|
7
|
-
import { createKey, resolveWrappedSlot, resolveSlot } from '../../_utils';
|
|
7
|
+
import { createKey, resolveWrappedSlot, resolveSlot, resolveSize } from '../../_utils';
|
|
8
8
|
import { avatarLight } from '../styles';
|
|
9
9
|
import { avatarGroupInjectionKey } from './context';
|
|
10
10
|
import { USkeleton } from '../../skeleton';
|
|
@@ -103,12 +103,6 @@ export default defineComponent({
|
|
|
103
103
|
const getBackgroundColor = (color) => {
|
|
104
104
|
return props.disabled || size === 'small' ? 'rgba(0,0,0,0)' : color;
|
|
105
105
|
};
|
|
106
|
-
const resolveSize = (value, fallback) => {
|
|
107
|
-
if (value === undefined)
|
|
108
|
-
return fallback;
|
|
109
|
-
value = String(value);
|
|
110
|
-
return /^\d+$/.test(value) ? `${value}px` : value;
|
|
111
|
-
};
|
|
112
106
|
return {
|
|
113
107
|
'--u-font-size': fontSize,
|
|
114
108
|
'--u-font-weight': fontWeight,
|
package/es/badge/src/Badge.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export declare const badgeProps: {
|
|
|
16
16
|
readonly processing: BooleanConstructor;
|
|
17
17
|
readonly color: StringConstructor;
|
|
18
18
|
readonly textColor: StringConstructor;
|
|
19
|
+
readonly dotSize: PropType<string | number>;
|
|
19
20
|
readonly offset: PropType<readonly [number | string, number | string]>;
|
|
20
21
|
readonly theme: PropType<import("../../_mixins").Theme<"Badge", {
|
|
21
22
|
color: string;
|
|
@@ -32,6 +33,7 @@ export declare const badgeProps: {
|
|
|
32
33
|
textColorError: string;
|
|
33
34
|
textColorWarning: string;
|
|
34
35
|
borderColor: string;
|
|
36
|
+
dotSize: string;
|
|
35
37
|
}, any>>;
|
|
36
38
|
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Badge", {
|
|
37
39
|
color: string;
|
|
@@ -48,6 +50,7 @@ export declare const badgeProps: {
|
|
|
48
50
|
textColorError: string;
|
|
49
51
|
textColorWarning: string;
|
|
50
52
|
borderColor: string;
|
|
53
|
+
dotSize: string;
|
|
51
54
|
}, any>>>;
|
|
52
55
|
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Badge", {
|
|
53
56
|
color: string;
|
|
@@ -64,6 +67,7 @@ export declare const badgeProps: {
|
|
|
64
67
|
textColorError: string;
|
|
65
68
|
textColorWarning: string;
|
|
66
69
|
borderColor: string;
|
|
70
|
+
dotSize: string;
|
|
67
71
|
}, any>>>;
|
|
68
72
|
};
|
|
69
73
|
export type BadgeProps = ExtractPublicPropTypes<typeof badgeProps>;
|
|
@@ -83,6 +87,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
83
87
|
readonly processing: BooleanConstructor;
|
|
84
88
|
readonly color: StringConstructor;
|
|
85
89
|
readonly textColor: StringConstructor;
|
|
90
|
+
readonly dotSize: PropType<string | number>;
|
|
86
91
|
readonly offset: PropType<readonly [number | string, number | string]>;
|
|
87
92
|
readonly theme: PropType<import("../../_mixins").Theme<"Badge", {
|
|
88
93
|
color: string;
|
|
@@ -99,6 +104,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
99
104
|
textColorError: string;
|
|
100
105
|
textColorWarning: string;
|
|
101
106
|
borderColor: string;
|
|
107
|
+
dotSize: string;
|
|
102
108
|
}, any>>;
|
|
103
109
|
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Badge", {
|
|
104
110
|
color: string;
|
|
@@ -115,6 +121,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
115
121
|
textColorError: string;
|
|
116
122
|
textColorWarning: string;
|
|
117
123
|
borderColor: string;
|
|
124
|
+
dotSize: string;
|
|
118
125
|
}, any>>>;
|
|
119
126
|
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Badge", {
|
|
120
127
|
color: string;
|
|
@@ -131,6 +138,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
131
138
|
textColorError: string;
|
|
132
139
|
textColorWarning: string;
|
|
133
140
|
borderColor: string;
|
|
141
|
+
dotSize: string;
|
|
134
142
|
}, any>>>;
|
|
135
143
|
}, {
|
|
136
144
|
rtlEnabled: import("vue").Ref<import("../../config-provider/src/internal-interface").RtlItem | undefined> | undefined;
|
|
@@ -147,6 +155,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
147
155
|
'--u-ripple-bezier': string;
|
|
148
156
|
'--u-text-color': string;
|
|
149
157
|
'--u-border-color': string;
|
|
158
|
+
'--u-dot-size': string;
|
|
150
159
|
}> | undefined;
|
|
151
160
|
themeClass: import("vue").Ref<string> | undefined;
|
|
152
161
|
onRender: (() => void) | undefined;
|
|
@@ -169,6 +178,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
169
178
|
readonly processing: BooleanConstructor;
|
|
170
179
|
readonly color: StringConstructor;
|
|
171
180
|
readonly textColor: StringConstructor;
|
|
181
|
+
readonly dotSize: PropType<string | number>;
|
|
172
182
|
readonly offset: PropType<readonly [number | string, number | string]>;
|
|
173
183
|
readonly theme: PropType<import("../../_mixins").Theme<"Badge", {
|
|
174
184
|
color: string;
|
|
@@ -185,6 +195,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
185
195
|
textColorError: string;
|
|
186
196
|
textColorWarning: string;
|
|
187
197
|
borderColor: string;
|
|
198
|
+
dotSize: string;
|
|
188
199
|
}, any>>;
|
|
189
200
|
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Badge", {
|
|
190
201
|
color: string;
|
|
@@ -201,6 +212,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
201
212
|
textColorError: string;
|
|
202
213
|
textColorWarning: string;
|
|
203
214
|
borderColor: string;
|
|
215
|
+
dotSize: string;
|
|
204
216
|
}, any>>>;
|
|
205
217
|
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Badge", {
|
|
206
218
|
color: string;
|
|
@@ -217,6 +229,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
217
229
|
textColorError: string;
|
|
218
230
|
textColorWarning: string;
|
|
219
231
|
borderColor: string;
|
|
232
|
+
dotSize: string;
|
|
220
233
|
}, any>>>;
|
|
221
234
|
}>>, {
|
|
222
235
|
readonly type: "default" | "info" | "success" | "warning" | "error" | "prime";
|
package/es/badge/src/Badge.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, computed, onMounted, ref, defineComponent, Transition } from 'vue';
|
|
2
2
|
import { useConfig, useTheme, useThemeClass } from '../../_mixins';
|
|
3
3
|
import { UBaseSlotMachine, UBaseWave } from '../../_internal';
|
|
4
|
-
import { color2Class, createKey, getTitleAttribute, isSlotEmpty, resolveSlot } from '../../_utils';
|
|
4
|
+
import { color2Class, createKey, getTitleAttribute, isSlotEmpty, resolveSize, resolveSlot } from '../../_utils';
|
|
5
5
|
import { badgeLight } from '../styles';
|
|
6
6
|
import style from './styles/index.cssr';
|
|
7
7
|
import { useRtl } from '../../_mixins/use-rtl';
|
|
@@ -11,7 +11,7 @@ export const badgeProps = Object.assign(Object.assign({}, useTheme.props), { val
|
|
|
11
11
|
}, show: {
|
|
12
12
|
type: Boolean,
|
|
13
13
|
default: true
|
|
14
|
-
}, showZero: Boolean, processing: Boolean, color: String, textColor: String, offset: Array });
|
|
14
|
+
}, showZero: Boolean, processing: Boolean, color: String, textColor: String, dotSize: [String, Number], offset: Array });
|
|
15
15
|
export default defineComponent({
|
|
16
16
|
name: 'Badge',
|
|
17
17
|
props: badgeProps,
|
|
@@ -39,7 +39,7 @@ export default defineComponent({
|
|
|
39
39
|
const rtlEnabledRef = useRtl('Badge', mergedRtlRef, mergedClsPrefixRef);
|
|
40
40
|
const cssVarsRef = computed(() => {
|
|
41
41
|
const { type, color: propColor, textColor: propTextColor } = props;
|
|
42
|
-
const { common: { cubicBezierEaseInOut, cubicBezierEaseOut }, self: { [createKey('color', type)]: color, [createKey('textColor', type)]: textColor, fontSize, borderColor } } = themeRef.value;
|
|
42
|
+
const { common: { cubicBezierEaseInOut, cubicBezierEaseOut }, self: { [createKey('color', type)]: color, [createKey('textColor', type)]: textColor, fontSize, borderColor, dotSize } } = themeRef.value;
|
|
43
43
|
return {
|
|
44
44
|
'--u-font-size': fontSize,
|
|
45
45
|
'--u-color': propColor || color,
|
|
@@ -47,7 +47,8 @@ export default defineComponent({
|
|
|
47
47
|
'--u-bezier': cubicBezierEaseInOut,
|
|
48
48
|
'--u-ripple-bezier': cubicBezierEaseOut,
|
|
49
49
|
'--u-text-color': propTextColor || textColor,
|
|
50
|
-
'--u-border-color': borderColor
|
|
50
|
+
'--u-border-color': borderColor,
|
|
51
|
+
'--u-dot-size': resolveSize(props.dotSize, dotSize)
|
|
51
52
|
};
|
|
52
53
|
});
|
|
53
54
|
const themeClassHandle = inlineThemeDisabled
|
|
@@ -29,13 +29,14 @@ export default c([c('@keyframes badge-wave-spread', {
|
|
|
29
29
|
transformOrigin: 'left bottom',
|
|
30
30
|
originalTransform: 'translateX(0)'
|
|
31
31
|
})])]), cM('dot', [cB('badge-sup', `
|
|
32
|
-
height:
|
|
33
|
-
width:
|
|
32
|
+
height: var(--u-dot-size);
|
|
33
|
+
width: var(--u-dot-size);
|
|
34
|
+
justify-content: center;
|
|
35
|
+
overflow: hidden;
|
|
34
36
|
padding: 0;
|
|
35
|
-
min-width: 8px;
|
|
36
37
|
left: 100%;
|
|
37
38
|
bottom: calc(100% - 4px);
|
|
38
|
-
`, [c('::before', 'border-radius: 4px;')])]), cB('badge-sup', `
|
|
39
|
+
`, [c('::before', 'border-radius: 4px;'), c('img', 'width: 100%')])]), cB('badge-sup', `
|
|
39
40
|
background: var(--u-color);
|
|
40
41
|
transition:
|
|
41
42
|
background-color .3s var(--u-bezier),
|
|
@@ -86,8 +87,6 @@ export default c([c('@keyframes badge-wave-spread', {
|
|
|
86
87
|
border-radius: 100px;
|
|
87
88
|
`), cM('dot', [cB('badge-sup', `
|
|
88
89
|
transform: none;
|
|
89
|
-
width: 12px;
|
|
90
|
-
height: 12px;
|
|
91
90
|
transform: none;
|
|
92
91
|
left: auto;
|
|
93
92
|
right: 0;
|
|
@@ -15,6 +15,7 @@ export declare const self: (vars: ThemeCommonVars) => {
|
|
|
15
15
|
textColorError: string;
|
|
16
16
|
textColorWarning: string;
|
|
17
17
|
borderColor: string;
|
|
18
|
+
dotSize: string;
|
|
18
19
|
};
|
|
19
20
|
export type BadgeThemeVars = ReturnType<typeof self>;
|
|
20
21
|
declare const badgeLight: Theme<'Badge', BadgeThemeVars>;
|
package/es/badge/styles/light.js
CHANGED
|
@@ -47,6 +47,7 @@ export declare const datePickerProps: {
|
|
|
47
47
|
readonly shortcuts: PropType<Shortcuts>;
|
|
48
48
|
readonly defaultShortcuts: BooleanConstructor;
|
|
49
49
|
readonly isDateDisabled: PropType<IsDateDisabled>;
|
|
50
|
+
readonly maxDate: PropType<number | undefined>;
|
|
50
51
|
readonly isTimeDisabled: PropType<IsTimeDisabled>;
|
|
51
52
|
readonly show: {
|
|
52
53
|
readonly type: PropType<boolean | undefined>;
|
|
@@ -2148,6 +2149,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2148
2149
|
readonly shortcuts: PropType<Shortcuts>;
|
|
2149
2150
|
readonly defaultShortcuts: BooleanConstructor;
|
|
2150
2151
|
readonly isDateDisabled: PropType<IsDateDisabled>;
|
|
2152
|
+
readonly maxDate: PropType<number | undefined>;
|
|
2151
2153
|
readonly isTimeDisabled: PropType<IsTimeDisabled>;
|
|
2152
2154
|
readonly show: {
|
|
2153
2155
|
readonly type: PropType<boolean | undefined>;
|
|
@@ -5448,6 +5450,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5448
5450
|
readonly shortcuts: PropType<Shortcuts>;
|
|
5449
5451
|
readonly defaultShortcuts: BooleanConstructor;
|
|
5450
5452
|
readonly isDateDisabled: PropType<IsDateDisabled>;
|
|
5453
|
+
readonly maxDate: PropType<number | undefined>;
|
|
5451
5454
|
readonly isTimeDisabled: PropType<IsTimeDisabled>;
|
|
5452
5455
|
readonly show: {
|
|
5453
5456
|
readonly type: PropType<boolean | undefined>;
|
|
@@ -30,7 +30,7 @@ export const datePickerProps = Object.assign(Object.assign({}, useTheme.props),
|
|
|
30
30
|
}, value: [Number, Array], formattedValue: [String, Array], size: String, type: {
|
|
31
31
|
type: String,
|
|
32
32
|
default: 'date'
|
|
33
|
-
}, valueFormat: String, separator: String, placeholder: String, startPlaceholder: String, endPlaceholder: String, format: String, dateFormat: String, timeFormat: String, actions: Array, shortcuts: Object, defaultShortcuts: Boolean, isDateDisabled: Function, isTimeDisabled: Function, show: {
|
|
33
|
+
}, valueFormat: String, separator: String, placeholder: String, startPlaceholder: String, endPlaceholder: String, format: String, dateFormat: String, timeFormat: String, actions: Array, shortcuts: Object, defaultShortcuts: Boolean, isDateDisabled: Function, maxDate: Number, isTimeDisabled: Function, show: {
|
|
34
34
|
type: Boolean,
|
|
35
35
|
default: undefined
|
|
36
36
|
}, panel: Boolean, ranges: Object, firstDayOfWeek: Number, inputReadonly: Boolean, closeOnSelect: Boolean, status: String, timePickerProps: [Object, Array], onClear: Function, onConfirm: Function, defaultCalendarStartTime: Number, defaultCalendarEndTime: Number, bindCalendarMonths: Boolean, 'onUpdate:show': [Function, Array], onUpdateShow: [Function, Array], 'onUpdate:formattedValue': [Function, Array], onUpdateFormattedValue: [Function, Array], 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array], onFocus: [Function, Array], onBlur: [Function, Array],
|
|
@@ -564,7 +564,7 @@ export default defineComponent({
|
|
|
564
564
|
const dualValidation = dualCalendarValidation(props, pendingValueRef);
|
|
565
565
|
provide(datePickerInjectionKey, Object.assign(Object.assign(Object.assign({ mergedClsPrefixRef, mergedThemeRef: themeRef, timePickerSizeRef,
|
|
566
566
|
localeRef,
|
|
567
|
-
dateLocaleRef, firstDayOfWeekRef: toRef(props, 'firstDayOfWeek'), isDateDisabledRef: toRef(props, 'isDateDisabled'), rangesRef: toRef(props, 'ranges'), timePickerPropsRef: toRef(props, 'timePickerProps'), closeOnSelectRef: toRef(props, 'closeOnSelect'), updateValueOnCloseRef: toRef(props, 'updateValueOnClose') }, uniVaidation), dualValidation), { datePickerSlots: slots }));
|
|
567
|
+
dateLocaleRef, firstDayOfWeekRef: toRef(props, 'firstDayOfWeek'), isDateDisabledRef: toRef(props, 'isDateDisabled'), maxDateRef: toRef(props, 'maxDate'), rangesRef: toRef(props, 'ranges'), timePickerPropsRef: toRef(props, 'timePickerProps'), closeOnSelectRef: toRef(props, 'closeOnSelect'), updateValueOnCloseRef: toRef(props, 'updateValueOnClose') }, uniVaidation), dualValidation), { datePickerSlots: slots }));
|
|
568
568
|
const exposedMethods = {
|
|
569
569
|
focus: () => {
|
|
570
570
|
var _a;
|
|
@@ -61,6 +61,7 @@ export type DatePickerInjection = {
|
|
|
61
61
|
localeRef: Ref<ULocale['DatePicker']>;
|
|
62
62
|
dateLocaleRef: Ref<UDateLocale>;
|
|
63
63
|
isDateDisabledRef: Ref<IsDateDisabled | undefined>;
|
|
64
|
+
maxDateRef: Ref<number | undefined>;
|
|
64
65
|
rangesRef: Ref<Record<string, [number, number]> | undefined>;
|
|
65
66
|
closeOnSelectRef: Ref<boolean>;
|
|
66
67
|
updateValueOnCloseRef: Ref<boolean>;
|
|
@@ -11,7 +11,7 @@ const useCalendarProps = Object.assign(Object.assign({}, usePanelCommonProps), {
|
|
|
11
11
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
12
12
|
function useCalendar(props, type) {
|
|
13
13
|
const panelCommon = usePanelCommon(props);
|
|
14
|
-
const { isValueInvalidRef, isDateDisabledRef, isDateInvalidRef, isTimeInvalidRef, isDateTimeInvalidRef, isHourDisabledRef, isMinuteDisabledRef, isSecondDisabledRef, localeRef, firstDayOfWeekRef, datePickerSlots
|
|
14
|
+
const { isValueInvalidRef, isDateDisabledRef, maxDateRef, isDateInvalidRef, isTimeInvalidRef, isDateTimeInvalidRef, isHourDisabledRef, isMinuteDisabledRef, isSecondDisabledRef, localeRef, firstDayOfWeekRef, datePickerSlots
|
|
15
15
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
16
16
|
} = inject(datePickerInjectionKey);
|
|
17
17
|
const validation = {
|
|
@@ -44,7 +44,7 @@ function useCalendar(props, type) {
|
|
|
44
44
|
});
|
|
45
45
|
const yearArrayRef = computed(() => {
|
|
46
46
|
const { value } = props;
|
|
47
|
-
return yearArray(Array.isArray(value) ? null : value, nowRef.value);
|
|
47
|
+
return yearArray(Array.isArray(value) ? null : value, nowRef.value, maxDateRef.value);
|
|
48
48
|
});
|
|
49
49
|
const quarterArrayRef = computed(() => {
|
|
50
50
|
const { value } = props;
|
|
@@ -90,6 +90,9 @@ function useCalendar(props, type) {
|
|
|
90
90
|
return getTime(startOfDay(value));
|
|
91
91
|
}
|
|
92
92
|
function mergedIsDateDisabled(ts) {
|
|
93
|
+
if (maxDateRef.value && ts > maxDateRef.value) {
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
93
96
|
const { isDateDisabled: { value: isDateDisabled } } = validation;
|
|
94
97
|
if (!isDateDisabled)
|
|
95
98
|
return false;
|
|
@@ -11,7 +11,7 @@ const useDualCalendarProps = Object.assign(Object.assign({}, usePanelCommonProps
|
|
|
11
11
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
12
12
|
function useDualCalendar(props, type) {
|
|
13
13
|
var _a, _b;
|
|
14
|
-
const { isDateDisabledRef, isStartHourDisabledRef, isEndHourDisabledRef, isStartMinuteDisabledRef, isEndMinuteDisabledRef, isStartSecondDisabledRef, isEndSecondDisabledRef, isStartDateInvalidRef, isEndDateInvalidRef, isStartTimeInvalidRef, isEndTimeInvalidRef, isStartValueInvalidRef, isEndValueInvalidRef, isRangeInvalidRef, localeRef, rangesRef, closeOnSelectRef, updateValueOnCloseRef, firstDayOfWeekRef, datePickerSlots
|
|
14
|
+
const { isDateDisabledRef, maxDateRef, isStartHourDisabledRef, isEndHourDisabledRef, isStartMinuteDisabledRef, isEndMinuteDisabledRef, isStartSecondDisabledRef, isEndSecondDisabledRef, isStartDateInvalidRef, isEndDateInvalidRef, isStartTimeInvalidRef, isEndTimeInvalidRef, isStartValueInvalidRef, isEndValueInvalidRef, isRangeInvalidRef, localeRef, rangesRef, closeOnSelectRef, updateValueOnCloseRef, firstDayOfWeekRef, datePickerSlots
|
|
15
15
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
16
16
|
} = inject(datePickerInjectionKey);
|
|
17
17
|
const validation = {
|
|
@@ -108,10 +108,10 @@ function useDualCalendar(props, type) {
|
|
|
108
108
|
return shortcuts || rangesRef.value;
|
|
109
109
|
});
|
|
110
110
|
const startYearArrayRef = computed(() => {
|
|
111
|
-
return yearArray(pluckValueFromRange(props.value, 'start'), nowRef.value);
|
|
111
|
+
return yearArray(pluckValueFromRange(props.value, 'start'), nowRef.value, maxDateRef.value);
|
|
112
112
|
});
|
|
113
113
|
const endYearArrayRef = computed(() => {
|
|
114
|
-
return yearArray(pluckValueFromRange(props.value, 'end'), nowRef.value);
|
|
114
|
+
return yearArray(pluckValueFromRange(props.value, 'end'), nowRef.value, maxDateRef.value);
|
|
115
115
|
});
|
|
116
116
|
const startQuarterArrayRef = computed(() => {
|
|
117
117
|
const startValue = pluckValueFromRange(props.value, 'start');
|
|
@@ -208,6 +208,9 @@ function useDualCalendar(props, type) {
|
|
|
208
208
|
}
|
|
209
209
|
// The function is used on date panel, not the date-picker value validation
|
|
210
210
|
function mergedIsDateDisabled(ts) {
|
|
211
|
+
if (maxDateRef.value && ts > maxDateRef.value) {
|
|
212
|
+
return true;
|
|
213
|
+
}
|
|
211
214
|
const isDateDisabled = isDateDisabledRef.value;
|
|
212
215
|
if (!isDateDisabled)
|
|
213
216
|
return false;
|
|
@@ -53,7 +53,7 @@ export type DateCommonItem = DateItem | MonthItem | YearItem | QuarterItem;
|
|
|
53
53
|
declare function dateArray(monthTs: number, valueTs: number | [number, number] | null, currentTs: number, startDay: 0 | 1 | 2 | 3 | 4 | 5 | 6, strip?: boolean): DateItem[];
|
|
54
54
|
declare function monthArray(yearAnchorTs: number, valueTs: number | null, currentTs: number): MonthItem[];
|
|
55
55
|
declare function quarterArray(yearAnchorTs: number, valueTs: number | null, currentTs: number): QuarterItem[];
|
|
56
|
-
declare function yearArray(valueTs: number | null, currentTs: number): YearItem[];
|
|
56
|
+
declare function yearArray(valueTs: number | null, currentTs: number, maxDate?: number): YearItem[];
|
|
57
57
|
declare function strictParse(string: string, pattern: string, backup: Date, option: {
|
|
58
58
|
locale: UDateLocale['locale'];
|
|
59
59
|
}): Date;
|
|
@@ -153,10 +153,11 @@ function quarterArray(yearAnchorTs, valueTs, currentTs) {
|
|
|
153
153
|
}
|
|
154
154
|
return calendarQuarters;
|
|
155
155
|
}
|
|
156
|
-
function yearArray(valueTs, currentTs) {
|
|
156
|
+
function yearArray(valueTs, currentTs, maxDate) {
|
|
157
157
|
const calendarYears = [];
|
|
158
158
|
const time1900 = new Date(START_YEAR, 0, 1);
|
|
159
|
-
|
|
159
|
+
const endYear = maxDate ? new Date(maxDate).getFullYear() : END_YEAR;
|
|
160
|
+
let count = endYear - START_YEAR + 1;
|
|
160
161
|
while (count--) {
|
|
161
162
|
calendarYears.push(yearItem(getTime(addYears(time1900, count)), valueTs, currentTs));
|
|
162
163
|
}
|
package/es/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.5.
|
|
1
|
+
declare const _default: "1.5.5";
|
|
2
2
|
export default _default;
|
package/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.5.
|
|
1
|
+
export default '1.5.5';
|
package/lib/_utils/css/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.color2Class = exports.formatLength = void 0;
|
|
3
|
+
exports.resolveSize = exports.color2Class = exports.formatLength = void 0;
|
|
4
4
|
var format_length_1 = require("./format-length");
|
|
5
5
|
Object.defineProperty(exports, "formatLength", { enumerable: true, get: function () { return format_length_1.formatLength; } });
|
|
6
6
|
var color_to_class_1 = require("./color-to-class");
|
|
7
7
|
Object.defineProperty(exports, "color2Class", { enumerable: true, get: function () { return color_to_class_1.color2Class; } });
|
|
8
|
+
var normalize_size_1 = require("./normalize-size");
|
|
9
|
+
Object.defineProperty(exports, "resolveSize", { enumerable: true, get: function () { return normalize_size_1.resolveSize; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const resolveSize: (value: string | number | undefined, fallback: string) => string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveSize = void 0;
|
|
4
|
+
const resolveSize = (value, fallback) => {
|
|
5
|
+
if (value === undefined)
|
|
6
|
+
return fallback;
|
|
7
|
+
value = String(value);
|
|
8
|
+
return /^\d+$/.test(value) ? `${value}px` : value;
|
|
9
|
+
};
|
|
10
|
+
exports.resolveSize = resolveSize;
|
package/lib/_utils/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { call, keep, omit, flatten, getSlot, getVNodeChildren, keysOf, render, g
|
|
|
2
2
|
export type { MaybeArray } from './vue';
|
|
3
3
|
export { warn, warnOnce, throwError, smallerSize, largerSize, getTitleAttribute, isArrayShallowEqual } from './uzum';
|
|
4
4
|
export type { ExtractPublicPropTypes, ExtractInternalPropTypes, Mutable } from './uzum';
|
|
5
|
-
export { formatLength, color2Class } from './css';
|
|
5
|
+
export { formatLength, color2Class, resolveSize } from './css';
|
|
6
6
|
export { createKey } from './cssr';
|
|
7
7
|
export { isJsdom } from './env/is-jsdom';
|
|
8
8
|
export { isBrowser } from './env/is-browser';
|
package/lib/_utils/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.createStylesWithSingleColor = exports.markEventEffectPerformed = exports.eventEffectNotPerformed = exports.isBrowser = exports.isJsdom = exports.createKey = exports.color2Class = exports.formatLength = exports.isArrayShallowEqual = exports.getTitleAttribute = exports.largerSize = exports.smallerSize = exports.throwError = exports.warnOnce = exports.warn = exports.Wrapper = exports.resolveWrappedSlotWithProps = exports.isNodeVShowFalse = exports.mergeEventHandlers = exports.isSlotEmpty = exports.resolveWrappedSlot = exports.resolveSlotWithProps = exports.resolveSlot = exports.createInjectionKey = exports.createRefSetter = exports.createDataKey = exports.getFirstSlotVNode = exports.render = exports.keysOf = exports.getVNodeChildren = exports.getSlot = exports.flatten = exports.omit = exports.keep = exports.call = void 0;
|
|
17
|
+
exports.createStylesWithSingleColor = exports.markEventEffectPerformed = exports.eventEffectNotPerformed = exports.isBrowser = exports.isJsdom = exports.createKey = exports.resolveSize = exports.color2Class = exports.formatLength = exports.isArrayShallowEqual = exports.getTitleAttribute = exports.largerSize = exports.smallerSize = exports.throwError = exports.warnOnce = exports.warn = exports.Wrapper = exports.resolveWrappedSlotWithProps = exports.isNodeVShowFalse = exports.mergeEventHandlers = exports.isSlotEmpty = exports.resolveWrappedSlot = exports.resolveSlotWithProps = exports.resolveSlot = exports.createInjectionKey = exports.createRefSetter = exports.createDataKey = exports.getFirstSlotVNode = exports.render = exports.keysOf = exports.getVNodeChildren = exports.getSlot = exports.flatten = exports.omit = exports.keep = exports.call = void 0;
|
|
18
18
|
var vue_1 = require("./vue");
|
|
19
19
|
Object.defineProperty(exports, "call", { enumerable: true, get: function () { return vue_1.call; } });
|
|
20
20
|
Object.defineProperty(exports, "keep", { enumerable: true, get: function () { return vue_1.keep; } });
|
|
@@ -47,6 +47,7 @@ Object.defineProperty(exports, "isArrayShallowEqual", { enumerable: true, get: f
|
|
|
47
47
|
var css_1 = require("./css");
|
|
48
48
|
Object.defineProperty(exports, "formatLength", { enumerable: true, get: function () { return css_1.formatLength; } });
|
|
49
49
|
Object.defineProperty(exports, "color2Class", { enumerable: true, get: function () { return css_1.color2Class; } });
|
|
50
|
+
Object.defineProperty(exports, "resolveSize", { enumerable: true, get: function () { return css_1.resolveSize; } });
|
|
50
51
|
var cssr_1 = require("./cssr");
|
|
51
52
|
Object.defineProperty(exports, "createKey", { enumerable: true, get: function () { return cssr_1.createKey; } });
|
|
52
53
|
var is_jsdom_1 = require("./env/is-jsdom");
|
package/lib/avatar/src/Avatar.js
CHANGED
|
@@ -109,12 +109,6 @@ 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
|
-
};
|
|
118
112
|
return {
|
|
119
113
|
'--u-font-size': fontSize,
|
|
120
114
|
'--u-font-weight': fontWeight,
|
|
@@ -125,7 +119,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
125
119
|
'--u-icon-color': props.iconColor || iconColor,
|
|
126
120
|
'--u-bezier': cubicBezierEaseInOut,
|
|
127
121
|
'--u-merged-size': `var(--u-avatar-size-override, ${height})`,
|
|
128
|
-
'--u-icon-size': resolveSize(props.iconSize, iconSize)
|
|
122
|
+
'--u-icon-size': (0, _utils_1.resolveSize)(props.iconSize, iconSize)
|
|
129
123
|
};
|
|
130
124
|
});
|
|
131
125
|
const themeClassHandle = inlineThemeDisabled
|
package/lib/badge/src/Badge.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export declare const badgeProps: {
|
|
|
16
16
|
readonly processing: BooleanConstructor;
|
|
17
17
|
readonly color: StringConstructor;
|
|
18
18
|
readonly textColor: StringConstructor;
|
|
19
|
+
readonly dotSize: PropType<string | number>;
|
|
19
20
|
readonly offset: PropType<readonly [number | string, number | string]>;
|
|
20
21
|
readonly theme: PropType<import("../../_mixins").Theme<"Badge", {
|
|
21
22
|
color: string;
|
|
@@ -32,6 +33,7 @@ export declare const badgeProps: {
|
|
|
32
33
|
textColorError: string;
|
|
33
34
|
textColorWarning: string;
|
|
34
35
|
borderColor: string;
|
|
36
|
+
dotSize: string;
|
|
35
37
|
}, any>>;
|
|
36
38
|
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Badge", {
|
|
37
39
|
color: string;
|
|
@@ -48,6 +50,7 @@ export declare const badgeProps: {
|
|
|
48
50
|
textColorError: string;
|
|
49
51
|
textColorWarning: string;
|
|
50
52
|
borderColor: string;
|
|
53
|
+
dotSize: string;
|
|
51
54
|
}, any>>>;
|
|
52
55
|
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Badge", {
|
|
53
56
|
color: string;
|
|
@@ -64,6 +67,7 @@ export declare const badgeProps: {
|
|
|
64
67
|
textColorError: string;
|
|
65
68
|
textColorWarning: string;
|
|
66
69
|
borderColor: string;
|
|
70
|
+
dotSize: string;
|
|
67
71
|
}, any>>>;
|
|
68
72
|
};
|
|
69
73
|
export type BadgeProps = ExtractPublicPropTypes<typeof badgeProps>;
|
|
@@ -83,6 +87,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
83
87
|
readonly processing: BooleanConstructor;
|
|
84
88
|
readonly color: StringConstructor;
|
|
85
89
|
readonly textColor: StringConstructor;
|
|
90
|
+
readonly dotSize: PropType<string | number>;
|
|
86
91
|
readonly offset: PropType<readonly [number | string, number | string]>;
|
|
87
92
|
readonly theme: PropType<import("../../_mixins").Theme<"Badge", {
|
|
88
93
|
color: string;
|
|
@@ -99,6 +104,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
99
104
|
textColorError: string;
|
|
100
105
|
textColorWarning: string;
|
|
101
106
|
borderColor: string;
|
|
107
|
+
dotSize: string;
|
|
102
108
|
}, any>>;
|
|
103
109
|
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Badge", {
|
|
104
110
|
color: string;
|
|
@@ -115,6 +121,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
115
121
|
textColorError: string;
|
|
116
122
|
textColorWarning: string;
|
|
117
123
|
borderColor: string;
|
|
124
|
+
dotSize: string;
|
|
118
125
|
}, any>>>;
|
|
119
126
|
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Badge", {
|
|
120
127
|
color: string;
|
|
@@ -131,6 +138,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
131
138
|
textColorError: string;
|
|
132
139
|
textColorWarning: string;
|
|
133
140
|
borderColor: string;
|
|
141
|
+
dotSize: string;
|
|
134
142
|
}, any>>>;
|
|
135
143
|
}, {
|
|
136
144
|
rtlEnabled: import("vue").Ref<import("../../config-provider/src/internal-interface").RtlItem | undefined> | undefined;
|
|
@@ -147,6 +155,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
147
155
|
'--u-ripple-bezier': string;
|
|
148
156
|
'--u-text-color': string;
|
|
149
157
|
'--u-border-color': string;
|
|
158
|
+
'--u-dot-size': string;
|
|
150
159
|
}> | undefined;
|
|
151
160
|
themeClass: import("vue").Ref<string> | undefined;
|
|
152
161
|
onRender: (() => void) | undefined;
|
|
@@ -169,6 +178,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
169
178
|
readonly processing: BooleanConstructor;
|
|
170
179
|
readonly color: StringConstructor;
|
|
171
180
|
readonly textColor: StringConstructor;
|
|
181
|
+
readonly dotSize: PropType<string | number>;
|
|
172
182
|
readonly offset: PropType<readonly [number | string, number | string]>;
|
|
173
183
|
readonly theme: PropType<import("../../_mixins").Theme<"Badge", {
|
|
174
184
|
color: string;
|
|
@@ -185,6 +195,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
185
195
|
textColorError: string;
|
|
186
196
|
textColorWarning: string;
|
|
187
197
|
borderColor: string;
|
|
198
|
+
dotSize: string;
|
|
188
199
|
}, any>>;
|
|
189
200
|
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Badge", {
|
|
190
201
|
color: string;
|
|
@@ -201,6 +212,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
201
212
|
textColorError: string;
|
|
202
213
|
textColorWarning: string;
|
|
203
214
|
borderColor: string;
|
|
215
|
+
dotSize: string;
|
|
204
216
|
}, any>>>;
|
|
205
217
|
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Badge", {
|
|
206
218
|
color: string;
|
|
@@ -217,6 +229,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
217
229
|
textColorError: string;
|
|
218
230
|
textColorWarning: string;
|
|
219
231
|
borderColor: string;
|
|
232
|
+
dotSize: string;
|
|
220
233
|
}, any>>>;
|
|
221
234
|
}>>, {
|
|
222
235
|
readonly type: "default" | "info" | "success" | "warning" | "error" | "prime";
|
package/lib/badge/src/Badge.js
CHANGED
|
@@ -17,7 +17,7 @@ exports.badgeProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props),
|
|
|
17
17
|
}, show: {
|
|
18
18
|
type: Boolean,
|
|
19
19
|
default: true
|
|
20
|
-
}, showZero: Boolean, processing: Boolean, color: String, textColor: String, offset: Array });
|
|
20
|
+
}, showZero: Boolean, processing: Boolean, color: String, textColor: String, dotSize: [String, Number], offset: Array });
|
|
21
21
|
exports.default = (0, vue_1.defineComponent)({
|
|
22
22
|
name: 'Badge',
|
|
23
23
|
props: exports.badgeProps,
|
|
@@ -45,7 +45,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
45
45
|
const rtlEnabledRef = (0, use_rtl_1.useRtl)('Badge', mergedRtlRef, mergedClsPrefixRef);
|
|
46
46
|
const cssVarsRef = (0, vue_1.computed)(() => {
|
|
47
47
|
const { type, color: propColor, textColor: propTextColor } = props;
|
|
48
|
-
const { common: { cubicBezierEaseInOut, cubicBezierEaseOut }, self: { [(0, _utils_1.createKey)('color', type)]: color, [(0, _utils_1.createKey)('textColor', type)]: textColor, fontSize, borderColor } } = themeRef.value;
|
|
48
|
+
const { common: { cubicBezierEaseInOut, cubicBezierEaseOut }, self: { [(0, _utils_1.createKey)('color', type)]: color, [(0, _utils_1.createKey)('textColor', type)]: textColor, fontSize, borderColor, dotSize } } = themeRef.value;
|
|
49
49
|
return {
|
|
50
50
|
'--u-font-size': fontSize,
|
|
51
51
|
'--u-color': propColor || color,
|
|
@@ -53,7 +53,8 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
53
53
|
'--u-bezier': cubicBezierEaseInOut,
|
|
54
54
|
'--u-ripple-bezier': cubicBezierEaseOut,
|
|
55
55
|
'--u-text-color': propTextColor || textColor,
|
|
56
|
-
'--u-border-color': borderColor
|
|
56
|
+
'--u-border-color': borderColor,
|
|
57
|
+
'--u-dot-size': (0, _utils_1.resolveSize)(props.dotSize, dotSize)
|
|
57
58
|
};
|
|
58
59
|
});
|
|
59
60
|
const themeClassHandle = inlineThemeDisabled
|