@uzum-tech/ui 1.2.0 → 1.2.2
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 +52 -12
- package/dist/index.prod.js +2 -2
- package/es/auto-complete/src/AutoComplete.d.ts +4 -0
- package/es/auto-complete/src/AutoComplete.js +11 -2
- package/es/date-picker/src/panel/date.d.ts +14 -2
- package/es/date-picker/src/panel/date.js +7 -2
- package/es/date-picker/src/panel/daterange.js +9 -8
- package/es/date-picker/src/utils.d.ts +2 -1
- package/es/date-picker/src/utils.js +13 -1
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/auto-complete/src/AutoComplete.d.ts +4 -0
- package/lib/auto-complete/src/AutoComplete.js +11 -2
- package/lib/date-picker/src/panel/date.d.ts +14 -2
- package/lib/date-picker/src/panel/date.js +7 -2
- package/lib/date-picker/src/panel/daterange.js +9 -8
- package/lib/date-picker/src/utils.d.ts +2 -1
- package/lib/date-picker/src/utils.js +14 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +3 -3
- package/web-types.json +8 -1
|
@@ -57,6 +57,7 @@ export declare const autoCompleteProps: {
|
|
|
57
57
|
readonly onSelect: PropType<MaybeArray<OnSelect>>;
|
|
58
58
|
readonly onBlur: PropType<MaybeArray<(e: FocusEvent) => void>>;
|
|
59
59
|
readonly onFocus: PropType<MaybeArray<(e: FocusEvent) => void>>;
|
|
60
|
+
readonly onScroll: PropType<MaybeArray<(e: Event) => void> | undefined>;
|
|
60
61
|
readonly onInput: PropType<MaybeArray<OnUpdateValue> | undefined>;
|
|
61
62
|
readonly theme: PropType<import("../../_mixins").Theme<"AutoComplete", {
|
|
62
63
|
menuBoxShadow: string;
|
|
@@ -467,6 +468,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
467
468
|
readonly onSelect: PropType<MaybeArray<OnSelect>>;
|
|
468
469
|
readonly onBlur: PropType<MaybeArray<(e: FocusEvent) => void>>;
|
|
469
470
|
readonly onFocus: PropType<MaybeArray<(e: FocusEvent) => void>>;
|
|
471
|
+
readonly onScroll: PropType<MaybeArray<(e: Event) => void> | undefined>;
|
|
470
472
|
readonly onInput: PropType<MaybeArray<OnUpdateValue> | undefined>;
|
|
471
473
|
readonly theme: PropType<import("../../_mixins").Theme<"AutoComplete", {
|
|
472
474
|
menuBoxShadow: string;
|
|
@@ -858,6 +860,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
858
860
|
mergedStatus: import("vue").ComputedRef<FormValidationStatus | undefined>;
|
|
859
861
|
handleClear: () => void;
|
|
860
862
|
handleFocus: (e: FocusEvent) => void;
|
|
863
|
+
handleMenuScroll: (e: Event) => void;
|
|
861
864
|
handleBlur: (e: FocusEvent) => void;
|
|
862
865
|
handleInput: (value: string) => void;
|
|
863
866
|
handleToggle: (option: TreeNode<SelectBaseOption>) => void;
|
|
@@ -1184,6 +1187,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1184
1187
|
readonly onSelect: PropType<MaybeArray<OnSelect>>;
|
|
1185
1188
|
readonly onBlur: PropType<MaybeArray<(e: FocusEvent) => void>>;
|
|
1186
1189
|
readonly onFocus: PropType<MaybeArray<(e: FocusEvent) => void>>;
|
|
1190
|
+
readonly onScroll: PropType<MaybeArray<(e: Event) => void> | undefined>;
|
|
1187
1191
|
readonly onInput: PropType<MaybeArray<OnUpdateValue> | undefined>;
|
|
1188
1192
|
readonly theme: PropType<import("../../_mixins").Theme<"AutoComplete", {
|
|
1189
1193
|
menuBoxShadow: string;
|
|
@@ -33,7 +33,7 @@ export const autoCompleteProps = Object.assign(Object.assign({}, useTheme.props)
|
|
|
33
33
|
}, value: String, blurAfterSelect: Boolean, clearAfterSelect: Boolean, getShow: Function, inputProps: Object, renderOption: Function, renderLabel: Function, size: String, options: {
|
|
34
34
|
type: Array,
|
|
35
35
|
default: () => []
|
|
36
|
-
}, zIndex: Number, status: String, 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array], onSelect: [Function, Array], onBlur: [Function, Array], onFocus: [Function, Array],
|
|
36
|
+
}, zIndex: Number, status: String, 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array], onSelect: [Function, Array], onBlur: [Function, Array], onFocus: [Function, Array], onScroll: [Function, Array],
|
|
37
37
|
// deprecated
|
|
38
38
|
onInput: [Function, Array] });
|
|
39
39
|
export default defineComponent({
|
|
@@ -109,6 +109,11 @@ export default defineComponent({
|
|
|
109
109
|
call(onFocus, e);
|
|
110
110
|
nTriggerFormFocus();
|
|
111
111
|
}
|
|
112
|
+
function doScroll(e) {
|
|
113
|
+
const { onScroll } = props;
|
|
114
|
+
if (onScroll)
|
|
115
|
+
call(onScroll, e);
|
|
116
|
+
}
|
|
112
117
|
function handleCompositionStart() {
|
|
113
118
|
isComposingRef.value = true;
|
|
114
119
|
}
|
|
@@ -159,6 +164,9 @@ export default defineComponent({
|
|
|
159
164
|
canBeActivatedRef.value = true;
|
|
160
165
|
doFocus(e);
|
|
161
166
|
}
|
|
167
|
+
function handleMenuScroll(e) {
|
|
168
|
+
doScroll(e);
|
|
169
|
+
}
|
|
162
170
|
function handleBlur(e) {
|
|
163
171
|
canBeActivatedRef.value = false;
|
|
164
172
|
doBlur(e);
|
|
@@ -221,6 +229,7 @@ export default defineComponent({
|
|
|
221
229
|
mergedStatus: mergedStatusRef,
|
|
222
230
|
handleClear,
|
|
223
231
|
handleFocus,
|
|
232
|
+
handleMenuScroll,
|
|
224
233
|
handleBlur,
|
|
225
234
|
handleInput,
|
|
226
235
|
handleToggle,
|
|
@@ -276,7 +285,7 @@ export default defineComponent({
|
|
|
276
285
|
], style: [
|
|
277
286
|
menuProps === null || menuProps === void 0 ? void 0 : menuProps.style,
|
|
278
287
|
this.cssVars
|
|
279
|
-
], treeMate: this.treeMate, multiple: false, renderLabel: this.renderLabel, renderOption: this.renderOption, size: "medium", onToggle: this.handleToggle })), [
|
|
288
|
+
], treeMate: this.treeMate, multiple: false, renderLabel: this.renderLabel, renderOption: this.renderOption, size: "medium", onToggle: this.handleToggle, onScroll: this.handleMenuScroll })), [
|
|
280
289
|
[
|
|
281
290
|
clickoutside,
|
|
282
291
|
this.handleClickOutsideMenu,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DatePickerType } from '../config';
|
|
2
|
-
import { DateCommonItem } from '../utils';
|
|
2
|
+
import { DateCommonItem, DateItem } from '../utils';
|
|
3
3
|
/**
|
|
4
4
|
* Date Panel
|
|
5
5
|
* Update picker value on:
|
|
@@ -12,6 +12,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
12
12
|
readonly default: () => string[];
|
|
13
13
|
};
|
|
14
14
|
readonly active: BooleanConstructor;
|
|
15
|
+
/**
|
|
16
|
+
* Date Panel
|
|
17
|
+
* Update picker value on:
|
|
18
|
+
* 1. item click
|
|
19
|
+
* 2. clear click
|
|
20
|
+
*/
|
|
15
21
|
readonly dateFormat: StringConstructor;
|
|
16
22
|
readonly type: import("vue").PropType<DatePickerType>;
|
|
17
23
|
readonly timeFormat: {
|
|
@@ -1209,7 +1215,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1209
1215
|
isHourDisabled: import("vue").ComputedRef<import("../../../time-picker/src/interface").IsHourDisabled | undefined>;
|
|
1210
1216
|
isMinuteDisabled: import("vue").ComputedRef<import("../../../time-picker/src/interface").IsMinuteDisabled | undefined>;
|
|
1211
1217
|
isSecondDisabled: import("vue").ComputedRef<import("../../../time-picker/src/interface").IsSecondDisabled | undefined>;
|
|
1212
|
-
dateArray: import("vue").ComputedRef<
|
|
1218
|
+
dateArray: import("vue").ComputedRef<DateItem[]>;
|
|
1213
1219
|
monthArray: import("vue").ComputedRef<import("../utils").MonthItem[]>;
|
|
1214
1220
|
yearArray: import("vue").ComputedRef<import("../utils").YearItem[]>;
|
|
1215
1221
|
quarterArray: import("vue").ComputedRef<import("../utils").QuarterItem[]>;
|
|
@@ -1231,6 +1237,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1231
1237
|
readonly default: () => string[];
|
|
1232
1238
|
};
|
|
1233
1239
|
readonly active: BooleanConstructor;
|
|
1240
|
+
/**
|
|
1241
|
+
* Date Panel
|
|
1242
|
+
* Update picker value on:
|
|
1243
|
+
* 1. item click
|
|
1244
|
+
* 2. clear click
|
|
1245
|
+
*/
|
|
1234
1246
|
readonly dateFormat: StringConstructor;
|
|
1235
1247
|
readonly type: import("vue").PropType<DatePickerType>;
|
|
1236
1248
|
readonly timeFormat: {
|
|
@@ -4,6 +4,7 @@ import { UBaseFocusDetector } from '../../../_internal';
|
|
|
4
4
|
import { warnOnce } from '../../../_utils';
|
|
5
5
|
import { useCalendar, useCalendarProps } from './use-calendar';
|
|
6
6
|
import PanelHeader from './panelHeader';
|
|
7
|
+
import { getMsByDateCommonItem } from '../utils';
|
|
7
8
|
/**
|
|
8
9
|
* Date Panel
|
|
9
10
|
* Update picker value on:
|
|
@@ -29,13 +30,17 @@ export default defineComponent({
|
|
|
29
30
|
const isWithoutDay = computed(() => withoutDayTypes.includes(type));
|
|
30
31
|
const isMonth = computed(() => monthTypes.includes(type));
|
|
31
32
|
const isYear = computed(() => type === 'year');
|
|
33
|
+
const updateMonth = (item) => {
|
|
34
|
+
const dateItem = item;
|
|
35
|
+
calendar.handleDateClick(Object.assign(Object.assign({}, dateItem), { dateObject: Object.assign(Object.assign({}, dateItem.dateObject), { month: dateItem.dateObject.month || 0, date: 1 }), ts: getMsByDateCommonItem(dateItem) }));
|
|
36
|
+
};
|
|
32
37
|
const handleMonthClick = (value, _doUpdate, item) => {
|
|
33
38
|
calendar.onUpdateCalendarValue(value);
|
|
34
|
-
isMonth.value &&
|
|
39
|
+
isMonth.value && updateMonth(item);
|
|
35
40
|
};
|
|
36
41
|
const handleYearClick = (value, _doUpdate, item) => {
|
|
37
42
|
calendar.onUpdateCalendarValue(value);
|
|
38
|
-
isYear.value &&
|
|
43
|
+
isYear.value && updateMonth(item);
|
|
39
44
|
};
|
|
40
45
|
return Object.assign(Object.assign({}, calendar), { isWithoutDay,
|
|
41
46
|
isMonth,
|
|
@@ -15,6 +15,7 @@ import { UBaseFocusDetector } from '../../../_internal';
|
|
|
15
15
|
import { warnOnce } from '../../../_utils';
|
|
16
16
|
import { useDualCalendar, useDualCalendarProps } from './use-dual-calendar';
|
|
17
17
|
import PanelHeader from './panelHeader';
|
|
18
|
+
import { getMsByDateCommonItem } from '../utils';
|
|
18
19
|
export default defineComponent({
|
|
19
20
|
name: 'DateRangePanel',
|
|
20
21
|
props: useDualCalendarProps,
|
|
@@ -34,30 +35,30 @@ export default defineComponent({
|
|
|
34
35
|
const isWithoutDay = computed(() => withoutDayTypes.includes(type));
|
|
35
36
|
const isMonthRange = computed(() => monthRanges.includes(type));
|
|
36
37
|
const isYearRange = computed(() => type === 'yearrange');
|
|
37
|
-
const monthToDateItem = (
|
|
38
|
+
const monthToDateItem = (item, isEnd = false) => {
|
|
38
39
|
const _a = item, { dateObject } = _a, monthItem = __rest(_a, ["dateObject"]);
|
|
39
|
-
return Object.assign(Object.assign({}, monthItem), { dateObject: Object.assign(Object.assign({}, dateObject), { date: 1 }), inCurrentMonth: false, isCurrentDate: false, inSpan: false, startOfSpan: false, endOfSpan: isEnd, selected: isEnd, ts:
|
|
40
|
+
return Object.assign(Object.assign({}, monthItem), { dateObject: Object.assign(Object.assign({}, dateObject), { date: 1 }), inCurrentMonth: false, isCurrentDate: false, inSpan: false, startOfSpan: false, endOfSpan: isEnd, selected: isEnd, ts: getMsByDateCommonItem(item), type: 'date' });
|
|
40
41
|
};
|
|
41
|
-
const setMonthRange = (
|
|
42
|
-
const monthItem = monthToDateItem(
|
|
42
|
+
const setMonthRange = (item, isEnd = false) => {
|
|
43
|
+
const monthItem = monthToDateItem(item, isEnd);
|
|
43
44
|
calendar.handleDateMouseEnter(monthItem);
|
|
44
45
|
calendar.handleDateClick(monthItem);
|
|
45
46
|
};
|
|
46
47
|
const handleMonthStartClick = (value, _doUpdate, item) => {
|
|
47
48
|
calendar.onUpdateStartCalendarValue(value);
|
|
48
|
-
isMonthRange.value && setMonthRange(
|
|
49
|
+
isMonthRange.value && setMonthRange(item);
|
|
49
50
|
};
|
|
50
51
|
const handleMonthEndClick = (value, _doUpdate, item) => {
|
|
51
52
|
calendar.onUpdateEndCalendarValue(value);
|
|
52
|
-
isMonthRange.value && setMonthRange(
|
|
53
|
+
isMonthRange.value && setMonthRange(item, true);
|
|
53
54
|
};
|
|
54
55
|
const handleYearStartClick = (value, _doUpdate, item) => {
|
|
55
56
|
calendar.onUpdateStartCalendarValue(value);
|
|
56
|
-
isYearRange.value && setMonthRange(
|
|
57
|
+
isYearRange.value && setMonthRange(item);
|
|
57
58
|
};
|
|
58
59
|
const handleYearEndClick = (value, _doUpdate, item) => {
|
|
59
60
|
calendar.onUpdateEndCalendarValue(value);
|
|
60
|
-
isYearRange.value && setMonthRange(
|
|
61
|
+
isYearRange.value && setMonthRange(item, true);
|
|
61
62
|
};
|
|
62
63
|
return Object.assign(Object.assign({}, calendar), { isMonthRange,
|
|
63
64
|
isYearRange,
|
|
@@ -63,4 +63,5 @@ declare function getDefaultTime(timeValue: string | undefined): {
|
|
|
63
63
|
seconds: number;
|
|
64
64
|
} | undefined;
|
|
65
65
|
declare function pluckValueFromRange(value: Value | null, type: 'start' | 'end'): number | null;
|
|
66
|
-
|
|
66
|
+
declare function getMsByDateCommonItem(item?: DateCommonItem): number;
|
|
67
|
+
export { dateArray, monthArray, yearArray, quarterArray, strictParse, getDerivedTimeFromKeyboardEvent, getDefaultTime, getMsByDateCommonItem, pluckValueFromRange };
|
|
@@ -188,4 +188,16 @@ function getDefaultTime(timeValue) {
|
|
|
188
188
|
function pluckValueFromRange(value, type) {
|
|
189
189
|
return Array.isArray(value) ? value[type === 'start' ? 0 : 1] : null;
|
|
190
190
|
}
|
|
191
|
-
|
|
191
|
+
function isDateItem(item) {
|
|
192
|
+
return !!item;
|
|
193
|
+
}
|
|
194
|
+
function getMsByDateCommonItem(item) {
|
|
195
|
+
if (!isDateItem(item))
|
|
196
|
+
return 0;
|
|
197
|
+
const { dateObject: { year, month, date } } = item;
|
|
198
|
+
const resultDate = new Date();
|
|
199
|
+
resultDate.setFullYear(year, month || 0, date || 1);
|
|
200
|
+
resultDate.setHours(0, 0, 0);
|
|
201
|
+
return resultDate.getTime();
|
|
202
|
+
}
|
|
203
|
+
export { dateArray, monthArray, yearArray, quarterArray, strictParse, getDerivedTimeFromKeyboardEvent, getDefaultTime, getMsByDateCommonItem, pluckValueFromRange };
|
package/es/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.2.
|
|
1
|
+
declare const _default: "1.2.2";
|
|
2
2
|
export default _default;
|
package/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.2.
|
|
1
|
+
export default '1.2.2';
|
|
@@ -57,6 +57,7 @@ export declare const autoCompleteProps: {
|
|
|
57
57
|
readonly onSelect: PropType<MaybeArray<OnSelect>>;
|
|
58
58
|
readonly onBlur: PropType<MaybeArray<(e: FocusEvent) => void>>;
|
|
59
59
|
readonly onFocus: PropType<MaybeArray<(e: FocusEvent) => void>>;
|
|
60
|
+
readonly onScroll: PropType<MaybeArray<(e: Event) => void> | undefined>;
|
|
60
61
|
readonly onInput: PropType<MaybeArray<OnUpdateValue> | undefined>;
|
|
61
62
|
readonly theme: PropType<import("../../_mixins").Theme<"AutoComplete", {
|
|
62
63
|
menuBoxShadow: string;
|
|
@@ -467,6 +468,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
467
468
|
readonly onSelect: PropType<MaybeArray<OnSelect>>;
|
|
468
469
|
readonly onBlur: PropType<MaybeArray<(e: FocusEvent) => void>>;
|
|
469
470
|
readonly onFocus: PropType<MaybeArray<(e: FocusEvent) => void>>;
|
|
471
|
+
readonly onScroll: PropType<MaybeArray<(e: Event) => void> | undefined>;
|
|
470
472
|
readonly onInput: PropType<MaybeArray<OnUpdateValue> | undefined>;
|
|
471
473
|
readonly theme: PropType<import("../../_mixins").Theme<"AutoComplete", {
|
|
472
474
|
menuBoxShadow: string;
|
|
@@ -858,6 +860,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
858
860
|
mergedStatus: import("vue").ComputedRef<FormValidationStatus | undefined>;
|
|
859
861
|
handleClear: () => void;
|
|
860
862
|
handleFocus: (e: FocusEvent) => void;
|
|
863
|
+
handleMenuScroll: (e: Event) => void;
|
|
861
864
|
handleBlur: (e: FocusEvent) => void;
|
|
862
865
|
handleInput: (value: string) => void;
|
|
863
866
|
handleToggle: (option: TreeNode<SelectBaseOption>) => void;
|
|
@@ -1184,6 +1187,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1184
1187
|
readonly onSelect: PropType<MaybeArray<OnSelect>>;
|
|
1185
1188
|
readonly onBlur: PropType<MaybeArray<(e: FocusEvent) => void>>;
|
|
1186
1189
|
readonly onFocus: PropType<MaybeArray<(e: FocusEvent) => void>>;
|
|
1190
|
+
readonly onScroll: PropType<MaybeArray<(e: Event) => void> | undefined>;
|
|
1187
1191
|
readonly onInput: PropType<MaybeArray<OnUpdateValue> | undefined>;
|
|
1188
1192
|
readonly theme: PropType<import("../../_mixins").Theme<"AutoComplete", {
|
|
1189
1193
|
menuBoxShadow: string;
|
|
@@ -39,7 +39,7 @@ exports.autoCompleteProps = Object.assign(Object.assign({}, _mixins_1.useTheme.p
|
|
|
39
39
|
}, value: String, blurAfterSelect: Boolean, clearAfterSelect: Boolean, getShow: Function, inputProps: Object, renderOption: Function, renderLabel: Function, size: String, options: {
|
|
40
40
|
type: Array,
|
|
41
41
|
default: () => []
|
|
42
|
-
}, zIndex: Number, status: String, 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array], onSelect: [Function, Array], onBlur: [Function, Array], onFocus: [Function, Array],
|
|
42
|
+
}, zIndex: Number, status: String, 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array], onSelect: [Function, Array], onBlur: [Function, Array], onFocus: [Function, Array], onScroll: [Function, Array],
|
|
43
43
|
// deprecated
|
|
44
44
|
onInput: [Function, Array] });
|
|
45
45
|
exports.default = (0, vue_1.defineComponent)({
|
|
@@ -115,6 +115,11 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
115
115
|
(0, _utils_1.call)(onFocus, e);
|
|
116
116
|
nTriggerFormFocus();
|
|
117
117
|
}
|
|
118
|
+
function doScroll(e) {
|
|
119
|
+
const { onScroll } = props;
|
|
120
|
+
if (onScroll)
|
|
121
|
+
(0, _utils_1.call)(onScroll, e);
|
|
122
|
+
}
|
|
118
123
|
function handleCompositionStart() {
|
|
119
124
|
isComposingRef.value = true;
|
|
120
125
|
}
|
|
@@ -165,6 +170,9 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
165
170
|
canBeActivatedRef.value = true;
|
|
166
171
|
doFocus(e);
|
|
167
172
|
}
|
|
173
|
+
function handleMenuScroll(e) {
|
|
174
|
+
doScroll(e);
|
|
175
|
+
}
|
|
168
176
|
function handleBlur(e) {
|
|
169
177
|
canBeActivatedRef.value = false;
|
|
170
178
|
doBlur(e);
|
|
@@ -227,6 +235,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
227
235
|
mergedStatus: mergedStatusRef,
|
|
228
236
|
handleClear,
|
|
229
237
|
handleFocus,
|
|
238
|
+
handleMenuScroll,
|
|
230
239
|
handleBlur,
|
|
231
240
|
handleInput,
|
|
232
241
|
handleToggle,
|
|
@@ -282,7 +291,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
282
291
|
], style: [
|
|
283
292
|
menuProps === null || menuProps === void 0 ? void 0 : menuProps.style,
|
|
284
293
|
this.cssVars
|
|
285
|
-
], treeMate: this.treeMate, multiple: false, renderLabel: this.renderLabel, renderOption: this.renderOption, size: "medium", onToggle: this.handleToggle })), [
|
|
294
|
+
], treeMate: this.treeMate, multiple: false, renderLabel: this.renderLabel, renderOption: this.renderOption, size: "medium", onToggle: this.handleToggle, onScroll: this.handleMenuScroll })), [
|
|
286
295
|
[
|
|
287
296
|
vdirs_1.clickoutside,
|
|
288
297
|
this.handleClickOutsideMenu,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DatePickerType } from '../config';
|
|
2
|
-
import { DateCommonItem } from '../utils';
|
|
2
|
+
import { DateCommonItem, DateItem } from '../utils';
|
|
3
3
|
/**
|
|
4
4
|
* Date Panel
|
|
5
5
|
* Update picker value on:
|
|
@@ -12,6 +12,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
12
12
|
readonly default: () => string[];
|
|
13
13
|
};
|
|
14
14
|
readonly active: BooleanConstructor;
|
|
15
|
+
/**
|
|
16
|
+
* Date Panel
|
|
17
|
+
* Update picker value on:
|
|
18
|
+
* 1. item click
|
|
19
|
+
* 2. clear click
|
|
20
|
+
*/
|
|
15
21
|
readonly dateFormat: StringConstructor;
|
|
16
22
|
readonly type: import("vue").PropType<DatePickerType>;
|
|
17
23
|
readonly timeFormat: {
|
|
@@ -1209,7 +1215,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1209
1215
|
isHourDisabled: import("vue").ComputedRef<import("../../../time-picker/src/interface").IsHourDisabled | undefined>;
|
|
1210
1216
|
isMinuteDisabled: import("vue").ComputedRef<import("../../../time-picker/src/interface").IsMinuteDisabled | undefined>;
|
|
1211
1217
|
isSecondDisabled: import("vue").ComputedRef<import("../../../time-picker/src/interface").IsSecondDisabled | undefined>;
|
|
1212
|
-
dateArray: import("vue").ComputedRef<
|
|
1218
|
+
dateArray: import("vue").ComputedRef<DateItem[]>;
|
|
1213
1219
|
monthArray: import("vue").ComputedRef<import("../utils").MonthItem[]>;
|
|
1214
1220
|
yearArray: import("vue").ComputedRef<import("../utils").YearItem[]>;
|
|
1215
1221
|
quarterArray: import("vue").ComputedRef<import("../utils").QuarterItem[]>;
|
|
@@ -1231,6 +1237,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1231
1237
|
readonly default: () => string[];
|
|
1232
1238
|
};
|
|
1233
1239
|
readonly active: BooleanConstructor;
|
|
1240
|
+
/**
|
|
1241
|
+
* Date Panel
|
|
1242
|
+
* Update picker value on:
|
|
1243
|
+
* 1. item click
|
|
1244
|
+
* 2. clear click
|
|
1245
|
+
*/
|
|
1234
1246
|
readonly dateFormat: StringConstructor;
|
|
1235
1247
|
readonly type: import("vue").PropType<DatePickerType>;
|
|
1236
1248
|
readonly timeFormat: {
|
|
@@ -9,6 +9,7 @@ const _internal_1 = require("../../../_internal");
|
|
|
9
9
|
const _utils_1 = require("../../../_utils");
|
|
10
10
|
const use_calendar_1 = require("./use-calendar");
|
|
11
11
|
const panelHeader_1 = __importDefault(require("./panelHeader"));
|
|
12
|
+
const utils_1 = require("../utils");
|
|
12
13
|
/**
|
|
13
14
|
* Date Panel
|
|
14
15
|
* Update picker value on:
|
|
@@ -34,13 +35,17 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
34
35
|
const isWithoutDay = (0, vue_1.computed)(() => withoutDayTypes.includes(type));
|
|
35
36
|
const isMonth = (0, vue_1.computed)(() => monthTypes.includes(type));
|
|
36
37
|
const isYear = (0, vue_1.computed)(() => type === 'year');
|
|
38
|
+
const updateMonth = (item) => {
|
|
39
|
+
const dateItem = item;
|
|
40
|
+
calendar.handleDateClick(Object.assign(Object.assign({}, dateItem), { dateObject: Object.assign(Object.assign({}, dateItem.dateObject), { month: dateItem.dateObject.month || 0, date: 1 }), ts: (0, utils_1.getMsByDateCommonItem)(dateItem) }));
|
|
41
|
+
};
|
|
37
42
|
const handleMonthClick = (value, _doUpdate, item) => {
|
|
38
43
|
calendar.onUpdateCalendarValue(value);
|
|
39
|
-
isMonth.value &&
|
|
44
|
+
isMonth.value && updateMonth(item);
|
|
40
45
|
};
|
|
41
46
|
const handleYearClick = (value, _doUpdate, item) => {
|
|
42
47
|
calendar.onUpdateCalendarValue(value);
|
|
43
|
-
isYear.value &&
|
|
48
|
+
isYear.value && updateMonth(item);
|
|
44
49
|
};
|
|
45
50
|
return Object.assign(Object.assign({}, calendar), { isWithoutDay,
|
|
46
51
|
isMonth,
|
|
@@ -20,6 +20,7 @@ const _internal_1 = require("../../../_internal");
|
|
|
20
20
|
const _utils_1 = require("../../../_utils");
|
|
21
21
|
const use_dual_calendar_1 = require("./use-dual-calendar");
|
|
22
22
|
const panelHeader_1 = __importDefault(require("./panelHeader"));
|
|
23
|
+
const utils_1 = require("../utils");
|
|
23
24
|
exports.default = (0, vue_1.defineComponent)({
|
|
24
25
|
name: 'DateRangePanel',
|
|
25
26
|
props: use_dual_calendar_1.useDualCalendarProps,
|
|
@@ -39,30 +40,30 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
39
40
|
const isWithoutDay = (0, vue_1.computed)(() => withoutDayTypes.includes(type));
|
|
40
41
|
const isMonthRange = (0, vue_1.computed)(() => monthRanges.includes(type));
|
|
41
42
|
const isYearRange = (0, vue_1.computed)(() => type === 'yearrange');
|
|
42
|
-
const monthToDateItem = (
|
|
43
|
+
const monthToDateItem = (item, isEnd = false) => {
|
|
43
44
|
const _a = item, { dateObject } = _a, monthItem = __rest(_a, ["dateObject"]);
|
|
44
|
-
return Object.assign(Object.assign({}, monthItem), { dateObject: Object.assign(Object.assign({}, dateObject), { date: 1 }), inCurrentMonth: false, isCurrentDate: false, inSpan: false, startOfSpan: false, endOfSpan: isEnd, selected: isEnd, ts:
|
|
45
|
+
return Object.assign(Object.assign({}, monthItem), { dateObject: Object.assign(Object.assign({}, dateObject), { date: 1 }), inCurrentMonth: false, isCurrentDate: false, inSpan: false, startOfSpan: false, endOfSpan: isEnd, selected: isEnd, ts: (0, utils_1.getMsByDateCommonItem)(item), type: 'date' });
|
|
45
46
|
};
|
|
46
|
-
const setMonthRange = (
|
|
47
|
-
const monthItem = monthToDateItem(
|
|
47
|
+
const setMonthRange = (item, isEnd = false) => {
|
|
48
|
+
const monthItem = monthToDateItem(item, isEnd);
|
|
48
49
|
calendar.handleDateMouseEnter(monthItem);
|
|
49
50
|
calendar.handleDateClick(monthItem);
|
|
50
51
|
};
|
|
51
52
|
const handleMonthStartClick = (value, _doUpdate, item) => {
|
|
52
53
|
calendar.onUpdateStartCalendarValue(value);
|
|
53
|
-
isMonthRange.value && setMonthRange(
|
|
54
|
+
isMonthRange.value && setMonthRange(item);
|
|
54
55
|
};
|
|
55
56
|
const handleMonthEndClick = (value, _doUpdate, item) => {
|
|
56
57
|
calendar.onUpdateEndCalendarValue(value);
|
|
57
|
-
isMonthRange.value && setMonthRange(
|
|
58
|
+
isMonthRange.value && setMonthRange(item, true);
|
|
58
59
|
};
|
|
59
60
|
const handleYearStartClick = (value, _doUpdate, item) => {
|
|
60
61
|
calendar.onUpdateStartCalendarValue(value);
|
|
61
|
-
isYearRange.value && setMonthRange(
|
|
62
|
+
isYearRange.value && setMonthRange(item);
|
|
62
63
|
};
|
|
63
64
|
const handleYearEndClick = (value, _doUpdate, item) => {
|
|
64
65
|
calendar.onUpdateEndCalendarValue(value);
|
|
65
|
-
isYearRange.value && setMonthRange(
|
|
66
|
+
isYearRange.value && setMonthRange(item, true);
|
|
66
67
|
};
|
|
67
68
|
return Object.assign(Object.assign({}, calendar), { isMonthRange,
|
|
68
69
|
isYearRange,
|
|
@@ -63,4 +63,5 @@ declare function getDefaultTime(timeValue: string | undefined): {
|
|
|
63
63
|
seconds: number;
|
|
64
64
|
} | undefined;
|
|
65
65
|
declare function pluckValueFromRange(value: Value | null, type: 'start' | 'end'): number | null;
|
|
66
|
-
|
|
66
|
+
declare function getMsByDateCommonItem(item?: DateCommonItem): number;
|
|
67
|
+
export { dateArray, monthArray, yearArray, quarterArray, strictParse, getDerivedTimeFromKeyboardEvent, getDefaultTime, getMsByDateCommonItem, pluckValueFromRange };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pluckValueFromRange = exports.getDefaultTime = exports.getDerivedTimeFromKeyboardEvent = exports.strictParse = exports.quarterArray = exports.yearArray = exports.monthArray = exports.dateArray = void 0;
|
|
3
|
+
exports.pluckValueFromRange = exports.getMsByDateCommonItem = exports.getDefaultTime = exports.getDerivedTimeFromKeyboardEvent = exports.strictParse = exports.quarterArray = exports.yearArray = exports.monthArray = exports.dateArray = void 0;
|
|
4
4
|
const date_fns_1 = require("date-fns"); //
|
|
5
5
|
const config_1 = require("./config");
|
|
6
6
|
function getDerivedTimeFromKeyboardEvent(prevValue, event) {
|
|
@@ -199,3 +199,16 @@ function pluckValueFromRange(value, type) {
|
|
|
199
199
|
return Array.isArray(value) ? value[type === 'start' ? 0 : 1] : null;
|
|
200
200
|
}
|
|
201
201
|
exports.pluckValueFromRange = pluckValueFromRange;
|
|
202
|
+
function isDateItem(item) {
|
|
203
|
+
return !!item;
|
|
204
|
+
}
|
|
205
|
+
function getMsByDateCommonItem(item) {
|
|
206
|
+
if (!isDateItem(item))
|
|
207
|
+
return 0;
|
|
208
|
+
const { dateObject: { year, month, date } } = item;
|
|
209
|
+
const resultDate = new Date();
|
|
210
|
+
resultDate.setFullYear(year, month || 0, date || 1);
|
|
211
|
+
resultDate.setHours(0, 0, 0);
|
|
212
|
+
return resultDate.getTime();
|
|
213
|
+
}
|
|
214
|
+
exports.getMsByDateCommonItem = getMsByDateCommonItem;
|
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.2.
|
|
1
|
+
declare const _default: "1.2.2";
|
|
2
2
|
export default _default;
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uzum-tech/ui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "A Vue 3 Component Library. Fairly Complete, Theme Customizable, Uses TypeScript, Fast",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
]
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
|
-
"@babel/core": "7.
|
|
95
|
+
"@babel/core": "7.22.0",
|
|
96
96
|
"@babel/eslint-parser": "7.21.3",
|
|
97
97
|
"@babel/generator": "7.21.4",
|
|
98
98
|
"@babel/parser": "7.21.4",
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
"vite-plugin-node-polyfills": "0.18.0",
|
|
159
159
|
"vue": "3.3.4",
|
|
160
160
|
"vue-router": "4.1.6",
|
|
161
|
-
"vue-tsc": "
|
|
161
|
+
"vue-tsc": "2.2.0"
|
|
162
162
|
},
|
|
163
163
|
"peerDependencies": {
|
|
164
164
|
"vue": "^3.0.0"
|
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.2.
|
|
5
|
+
"version": "1.2.2",
|
|
6
6
|
"js-types-syntax": "typescript",
|
|
7
7
|
"contributions": {
|
|
8
8
|
"html": {
|
|
@@ -534,6 +534,13 @@
|
|
|
534
534
|
"description": "On focus callback function.",
|
|
535
535
|
"default": "undefined"
|
|
536
536
|
},
|
|
537
|
+
{
|
|
538
|
+
"name": "scroll",
|
|
539
|
+
"doc-url": "https://www.naiveui.com/en-US/os-theme/components/auto-complete",
|
|
540
|
+
"type": "(event: ScrollEvent) => void",
|
|
541
|
+
"description": "Callback triggered when the options menu is scrolled.",
|
|
542
|
+
"default": "undefined"
|
|
543
|
+
},
|
|
537
544
|
{
|
|
538
545
|
"name": "input",
|
|
539
546
|
"doc-url": "https://www.naiveui.com/en-US/os-theme/components/auto-complete"
|