@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
|
@@ -34,13 +34,14 @@ exports.default = (0, cssr_1.c)([(0, cssr_1.c)('@keyframes badge-wave-spread', {
|
|
|
34
34
|
transformOrigin: 'left bottom',
|
|
35
35
|
originalTransform: 'translateX(0)'
|
|
36
36
|
})])]), (0, cssr_1.cM)('dot', [(0, cssr_1.cB)('badge-sup', `
|
|
37
|
-
height:
|
|
38
|
-
width:
|
|
37
|
+
height: var(--u-dot-size);
|
|
38
|
+
width: var(--u-dot-size);
|
|
39
|
+
justify-content: center;
|
|
40
|
+
overflow: hidden;
|
|
39
41
|
padding: 0;
|
|
40
|
-
min-width: 8px;
|
|
41
42
|
left: 100%;
|
|
42
43
|
bottom: calc(100% - 4px);
|
|
43
|
-
`, [(0, cssr_1.c)('::before', 'border-radius: 4px;')])]), (0, cssr_1.cB)('badge-sup', `
|
|
44
|
+
`, [(0, cssr_1.c)('::before', 'border-radius: 4px;'), (0, cssr_1.c)('img', 'width: 100%')])]), (0, cssr_1.cB)('badge-sup', `
|
|
44
45
|
background: var(--u-color);
|
|
45
46
|
transition:
|
|
46
47
|
background-color .3s var(--u-bezier),
|
|
@@ -91,8 +92,6 @@ exports.default = (0, cssr_1.c)([(0, cssr_1.c)('@keyframes badge-wave-spread', {
|
|
|
91
92
|
border-radius: 100px;
|
|
92
93
|
`), (0, cssr_1.cM)('dot', [(0, cssr_1.cB)('badge-sup', `
|
|
93
94
|
transform: none;
|
|
94
|
-
width: 12px;
|
|
95
|
-
height: 12px;
|
|
96
95
|
transform: none;
|
|
97
96
|
left: auto;
|
|
98
97
|
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>;
|
|
@@ -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>;
|
|
@@ -36,7 +36,7 @@ exports.datePickerProps = Object.assign(Object.assign({}, _mixins_1.useTheme.pro
|
|
|
36
36
|
}, value: [Number, Array], formattedValue: [String, Array], size: String, type: {
|
|
37
37
|
type: String,
|
|
38
38
|
default: 'date'
|
|
39
|
-
}, 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: {
|
|
39
|
+
}, 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: {
|
|
40
40
|
type: Boolean,
|
|
41
41
|
default: undefined
|
|
42
42
|
}, 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],
|
|
@@ -570,7 +570,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
570
570
|
const dualValidation = (0, validation_utils_1.dualCalendarValidation)(props, pendingValueRef);
|
|
571
571
|
(0, vue_1.provide)(interface_1.datePickerInjectionKey, Object.assign(Object.assign(Object.assign({ mergedClsPrefixRef, mergedThemeRef: themeRef, timePickerSizeRef,
|
|
572
572
|
localeRef,
|
|
573
|
-
dateLocaleRef, firstDayOfWeekRef: (0, vue_1.toRef)(props, 'firstDayOfWeek'), isDateDisabledRef: (0, vue_1.toRef)(props, 'isDateDisabled'), rangesRef: (0, vue_1.toRef)(props, 'ranges'), timePickerPropsRef: (0, vue_1.toRef)(props, 'timePickerProps'), closeOnSelectRef: (0, vue_1.toRef)(props, 'closeOnSelect'), updateValueOnCloseRef: (0, vue_1.toRef)(props, 'updateValueOnClose') }, uniVaidation), dualValidation), { datePickerSlots: slots }));
|
|
573
|
+
dateLocaleRef, firstDayOfWeekRef: (0, vue_1.toRef)(props, 'firstDayOfWeek'), isDateDisabledRef: (0, vue_1.toRef)(props, 'isDateDisabled'), maxDateRef: (0, vue_1.toRef)(props, 'maxDate'), rangesRef: (0, vue_1.toRef)(props, 'ranges'), timePickerPropsRef: (0, vue_1.toRef)(props, 'timePickerProps'), closeOnSelectRef: (0, vue_1.toRef)(props, 'closeOnSelect'), updateValueOnCloseRef: (0, vue_1.toRef)(props, 'updateValueOnClose') }, uniVaidation), dualValidation), { datePickerSlots: slots }));
|
|
574
574
|
const exposedMethods = {
|
|
575
575
|
focus: () => {
|
|
576
576
|
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>;
|
|
@@ -16,7 +16,7 @@ exports.useCalendarProps = useCalendarProps;
|
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
17
17
|
function useCalendar(props, type) {
|
|
18
18
|
const panelCommon = (0, use_panel_common_1.usePanelCommon)(props);
|
|
19
|
-
const { isValueInvalidRef, isDateDisabledRef, isDateInvalidRef, isTimeInvalidRef, isDateTimeInvalidRef, isHourDisabledRef, isMinuteDisabledRef, isSecondDisabledRef, localeRef, firstDayOfWeekRef, datePickerSlots
|
|
19
|
+
const { isValueInvalidRef, isDateDisabledRef, maxDateRef, isDateInvalidRef, isTimeInvalidRef, isDateTimeInvalidRef, isHourDisabledRef, isMinuteDisabledRef, isSecondDisabledRef, localeRef, firstDayOfWeekRef, datePickerSlots
|
|
20
20
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
21
21
|
} = (0, vue_1.inject)(interface_1.datePickerInjectionKey);
|
|
22
22
|
const validation = {
|
|
@@ -49,7 +49,7 @@ function useCalendar(props, type) {
|
|
|
49
49
|
});
|
|
50
50
|
const yearArrayRef = (0, vue_1.computed)(() => {
|
|
51
51
|
const { value } = props;
|
|
52
|
-
return (0, utils_1.yearArray)(Array.isArray(value) ? null : value, nowRef.value);
|
|
52
|
+
return (0, utils_1.yearArray)(Array.isArray(value) ? null : value, nowRef.value, maxDateRef.value);
|
|
53
53
|
});
|
|
54
54
|
const quarterArrayRef = (0, vue_1.computed)(() => {
|
|
55
55
|
const { value } = props;
|
|
@@ -95,6 +95,9 @@ function useCalendar(props, type) {
|
|
|
95
95
|
return (0, date_fns_1.getTime)((0, date_fns_1.startOfDay)(value));
|
|
96
96
|
}
|
|
97
97
|
function mergedIsDateDisabled(ts) {
|
|
98
|
+
if (maxDateRef.value && ts > maxDateRef.value) {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
98
101
|
const { isDateDisabled: { value: isDateDisabled } } = validation;
|
|
99
102
|
if (!isDateDisabled)
|
|
100
103
|
return false;
|
|
@@ -16,7 +16,7 @@ exports.useDualCalendarProps = useDualCalendarProps;
|
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
17
17
|
function useDualCalendar(props, type) {
|
|
18
18
|
var _a, _b;
|
|
19
|
-
const { isDateDisabledRef, isStartHourDisabledRef, isEndHourDisabledRef, isStartMinuteDisabledRef, isEndMinuteDisabledRef, isStartSecondDisabledRef, isEndSecondDisabledRef, isStartDateInvalidRef, isEndDateInvalidRef, isStartTimeInvalidRef, isEndTimeInvalidRef, isStartValueInvalidRef, isEndValueInvalidRef, isRangeInvalidRef, localeRef, rangesRef, closeOnSelectRef, updateValueOnCloseRef, firstDayOfWeekRef, datePickerSlots
|
|
19
|
+
const { isDateDisabledRef, maxDateRef, isStartHourDisabledRef, isEndHourDisabledRef, isStartMinuteDisabledRef, isEndMinuteDisabledRef, isStartSecondDisabledRef, isEndSecondDisabledRef, isStartDateInvalidRef, isEndDateInvalidRef, isStartTimeInvalidRef, isEndTimeInvalidRef, isStartValueInvalidRef, isEndValueInvalidRef, isRangeInvalidRef, localeRef, rangesRef, closeOnSelectRef, updateValueOnCloseRef, firstDayOfWeekRef, datePickerSlots
|
|
20
20
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
21
21
|
} = (0, vue_1.inject)(interface_1.datePickerInjectionKey);
|
|
22
22
|
const validation = {
|
|
@@ -113,10 +113,10 @@ function useDualCalendar(props, type) {
|
|
|
113
113
|
return shortcuts || rangesRef.value;
|
|
114
114
|
});
|
|
115
115
|
const startYearArrayRef = (0, vue_1.computed)(() => {
|
|
116
|
-
return (0, utils_1.yearArray)((0, utils_1.pluckValueFromRange)(props.value, 'start'), nowRef.value);
|
|
116
|
+
return (0, utils_1.yearArray)((0, utils_1.pluckValueFromRange)(props.value, 'start'), nowRef.value, maxDateRef.value);
|
|
117
117
|
});
|
|
118
118
|
const endYearArrayRef = (0, vue_1.computed)(() => {
|
|
119
|
-
return (0, utils_1.yearArray)((0, utils_1.pluckValueFromRange)(props.value, 'end'), nowRef.value);
|
|
119
|
+
return (0, utils_1.yearArray)((0, utils_1.pluckValueFromRange)(props.value, 'end'), nowRef.value, maxDateRef.value);
|
|
120
120
|
});
|
|
121
121
|
const startQuarterArrayRef = (0, vue_1.computed)(() => {
|
|
122
122
|
const startValue = (0, utils_1.pluckValueFromRange)(props.value, 'start');
|
|
@@ -213,6 +213,9 @@ function useDualCalendar(props, type) {
|
|
|
213
213
|
}
|
|
214
214
|
// The function is used on date panel, not the date-picker value validation
|
|
215
215
|
function mergedIsDateDisabled(ts) {
|
|
216
|
+
if (maxDateRef.value && ts > maxDateRef.value) {
|
|
217
|
+
return true;
|
|
218
|
+
}
|
|
216
219
|
const isDateDisabled = isDateDisabledRef.value;
|
|
217
220
|
if (!isDateDisabled)
|
|
218
221
|
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;
|
|
@@ -164,10 +164,11 @@ function quarterArray(yearAnchorTs, valueTs, currentTs) {
|
|
|
164
164
|
}
|
|
165
165
|
return calendarQuarters;
|
|
166
166
|
}
|
|
167
|
-
function yearArray(valueTs, currentTs) {
|
|
167
|
+
function yearArray(valueTs, currentTs, maxDate) {
|
|
168
168
|
const calendarYears = [];
|
|
169
169
|
const time1900 = new Date(config_1.START_YEAR, 0, 1);
|
|
170
|
-
|
|
170
|
+
const endYear = maxDate ? new Date(maxDate).getFullYear() : config_1.END_YEAR;
|
|
171
|
+
let count = endYear - config_1.START_YEAR + 1;
|
|
171
172
|
while (count--) {
|
|
172
173
|
calendarYears.push(yearItem((0, date_fns_1.getTime)((0, date_fns_1.addYears)(time1900, count)), valueTs, currentTs));
|
|
173
174
|
}
|
package/lib/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/lib/version.js
CHANGED
package/package.json
CHANGED
package/web-types.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"framework": "vue",
|
|
4
4
|
"name": "@uzum-tech/ui",
|
|
5
|
-
"version": "1.5.
|
|
5
|
+
"version": "1.5.5",
|
|
6
6
|
"js-types-syntax": "typescript",
|
|
7
7
|
"contributions": {
|
|
8
8
|
"html": {
|
|
@@ -977,6 +977,11 @@
|
|
|
977
977
|
"since": "1.1.0"
|
|
978
978
|
}
|
|
979
979
|
},
|
|
980
|
+
{
|
|
981
|
+
"name": "dot-size",
|
|
982
|
+
"doc-url": "https://www.naiveui.com/en-US/os-theme/components/badge",
|
|
983
|
+
"type": "string | number"
|
|
984
|
+
},
|
|
980
985
|
{
|
|
981
986
|
"name": "offset",
|
|
982
987
|
"doc-url": "https://www.naiveui.com/en-US/os-theme/components/badge",
|
|
@@ -3966,6 +3971,11 @@
|
|
|
3966
3971
|
"doc-url": "https://www.naiveui.com/en-US/os-theme/components/date-picker",
|
|
3967
3972
|
"type": "Function"
|
|
3968
3973
|
},
|
|
3974
|
+
{
|
|
3975
|
+
"name": "max-date",
|
|
3976
|
+
"doc-url": "https://www.naiveui.com/en-US/os-theme/components/date-picker",
|
|
3977
|
+
"type": "number"
|
|
3978
|
+
},
|
|
3969
3979
|
{
|
|
3970
3980
|
"name": "is-time-disabled",
|
|
3971
3981
|
"doc-url": "https://www.naiveui.com/en-US/os-theme/components/date-picker",
|