@opentiny/vue-renderless 3.6.8 → 3.8.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/action-sheet/index.js +28 -1
- package/action-sheet/vue.js +10 -4
- package/alert/index.js +24 -2
- package/alert/vue.js +15 -11
- package/amount/index.js +4 -4
- package/anchor/index.js +1 -1
- package/autocomplete/vue.js +3 -3
- package/autonavi-map/index.js +1 -1
- package/badge/vue.js +6 -6
- package/baidu-map/index.js +1 -1
- package/bulletin-board/index.js +1 -1
- package/button-group/vue.js +5 -4
- package/calendar/index.js +2 -2
- package/calendar-bar/index.js +268 -0
- package/calendar-bar/vue.js +87 -0
- package/card/index.js +84 -0
- package/card/vue.js +70 -0
- package/card-group/index.js +16 -0
- package/card-group/vue.js +21 -0
- package/card-template/index.js +1 -1
- package/carousel/index.js +89 -2
- package/carousel/vue.js +14 -5
- package/carousel-item/index.js +8 -0
- package/carousel-item/vue.js +7 -3
- package/cascader/index.js +6 -6
- package/cascader/vue.js +3 -3
- package/cascader-menu/vue.js +2 -2
- package/cascader-panel/index.js +4 -4
- package/cascader-panel/node.js +4 -4
- package/cascader-panel/vue.js +2 -2
- package/cascader-select/index.js +179 -0
- package/cascader-select/vue.js +74 -0
- package/cell/vue.js +16 -0
- package/chart-bar/index.js +3 -3
- package/chart-boxplot/index.js +2 -2
- package/chart-candle/index.js +3 -3
- package/chart-core/deps/utils.js +7 -7
- package/chart-core/index.js +2 -2
- package/chart-funnel/index.js +3 -3
- package/chart-gauge/index.js +3 -3
- package/chart-graph/index.js +1 -1
- package/chart-heatmap/index.js +2 -2
- package/chart-line/index.js +3 -3
- package/chart-liquidfill/index.js +2 -2
- package/chart-map/index.js +3 -3
- package/chart-pie/index.js +3 -3
- package/chart-radar/index.js +3 -3
- package/chart-sankey/index.js +3 -3
- package/chart-scatter/index.js +4 -4
- package/chart-sunburst/index.js +1 -1
- package/chart-tree/index.js +2 -2
- package/chart-waterfall/index.js +3 -3
- package/chart-wordcloud/index.js +2 -2
- package/checkbox/index.js +21 -0
- package/checkbox/vue.js +16 -3
- package/checkbox-button/vue.js +1 -1
- package/collapse-item/vue.js +1 -1
- package/column-list-group/index.js +0 -0
- package/column-list-group/vue.js +14 -0
- package/column-list-item/index.js +50 -0
- package/column-list-item/vue.js +39 -0
- package/common/array.js +3 -3
- package/common/bigInt.js +5 -2
- package/common/dataset/index.js +3 -3
- package/common/date.js +2 -2
- package/common/deps/ResizeObserver.js +1 -1
- package/common/deps/clickoutside.js +1 -1
- package/common/deps/date-util.js +4 -4
- package/common/deps/date.js +2 -2
- package/common/deps/debounce.js +1 -1
- package/common/deps/dom.js +1 -1
- package/common/deps/fullscreen/apis.js +3 -3
- package/common/deps/fullscreen/screenfull.js +1 -1
- package/common/deps/infinite-scroll.js +176 -0
- package/common/deps/letter-only.js +1 -1
- package/common/deps/number-only.js +1 -1
- package/common/deps/observe-visibility.js +106 -0
- package/common/deps/popper.js +20 -22
- package/common/deps/popup-manager.js +2 -2
- package/common/deps/repeat-click.js +1 -1
- package/common/deps/resize-event.js +1 -1
- package/common/deps/tree-model/node.js +5 -5
- package/common/deps/tree-model/tree-store.js +3 -3
- package/common/deps/upload-ajax.js +2 -2
- package/common/deps/vue-popper.js +6 -6
- package/common/deps/vue-popup.js +4 -4
- package/common/index.js +2 -2
- package/common/object.js +1 -1
- package/common/runtime.js +24 -24
- package/common/string.js +23 -4
- package/common/validate/rules/range.js +2 -2
- package/common/validate/rules/required.js +1 -1
- package/common/validate/rules/type.js +3 -3
- package/common/validate/schema.js +1 -1
- package/common/validate/util.js +1 -1
- package/common/validate/validations/array.js +1 -1
- package/common/validate/validations/date.js +1 -1
- package/common/validate/validations/enum.js +1 -1
- package/common/validate/validations/float.js +1 -1
- package/common/validate/validations/integer.js +1 -1
- package/common/validate/validations/method.js +1 -1
- package/common/validate/validations/number.js +1 -1
- package/common/validate/validations/pattern.js +1 -1
- package/common/validate/validations/string.js +1 -1
- package/common/validate/validations/type.js +1 -1
- package/container/index.js +1 -1
- package/crop/index.js +2 -2
- package/currency/index.js +2 -2
- package/date-panel/index.js +7 -7
- package/date-panel/vue.js +3 -2
- package/date-picker-mobile/index.js +250 -0
- package/date-picker-mobile/vue.js +86 -0
- package/date-range/index.js +1 -1
- package/date-range/vue.js +1 -1
- package/date-table/index.js +3 -3
- package/date-table/vue.js +1 -1
- package/dialog-box/index.js +6 -4
- package/dialog-box/vue.js +1 -1
- package/dialog-select/index.js +345 -0
- package/dialog-select/vue.js +110 -0
- package/drawer/index.js +83 -0
- package/drawer/vue.js +51 -0
- package/drop-times/index.js +1 -1
- package/dropdown/index.js +2 -2
- package/dropdown/vue.js +4 -3
- package/dropdown-item/index.js +5 -1
- package/dropdown-item/mf.js +79 -0
- package/dropdown-item/vue.js +9 -6
- package/dropdown-menu/index.js +30 -1
- package/dropdown-menu/vue.js +17 -7
- package/dynamic-scroller/index.js +117 -0
- package/dynamic-scroller/vue.js +88 -0
- package/dynamic-scroller-item/index.js +147 -0
- package/dynamic-scroller-item/vue.js +92 -0
- package/espace/index.js +1 -1
- package/espace/vue.js +1 -1
- package/exception/vue.js +3 -1
- package/fall-menu/index.js +4 -4
- package/file-upload/index.js +872 -408
- package/file-upload/vue.js +87 -36
- package/filter/index.js +131 -0
- package/filter/tag-group.js +43 -0
- package/filter/vue.js +73 -0
- package/filter-bar/index.js +9 -0
- package/filter-bar/vue.js +16 -0
- package/filter-box/index.js +17 -0
- package/filter-box/vue.js +19 -0
- package/filter-panel/index.js +42 -0
- package/filter-panel/vue.js +33 -0
- package/floatbar/index.js +1 -1
- package/flowchart/index.js +721 -0
- package/flowchart/vue.js +81 -0
- package/form/index.js +15 -1
- package/form/vue.js +10 -4
- package/form-item/index.js +46 -6
- package/form-item/vue.js +27 -3
- package/fullscreen/index.js +1 -1
- package/fullscreen/vue.js +1 -1
- package/grid/plugins/export.js +2 -2
- package/grid/plugins/exportExcel.js +2 -2
- package/grid/plugins/resize.js +1 -1
- package/grid/static/base/helperEqualCompare.js +1 -1
- package/grid/static/base/isPlainObject.js +1 -1
- package/grid/utils/common.js +3 -3
- package/grid/utils/dom.js +3 -3
- package/grid/utils/event.js +2 -2
- package/guide/index.js +168 -0
- package/guide/vue.js +36 -0
- package/hrapprover/index.js +1 -1
- package/image/index.js +8 -4
- package/image/vue.js +12 -6
- package/image-viewer/index.js +3 -3
- package/image-viewer/vue.js +16 -6
- package/input/index.js +34 -1
- package/input/vue.js +22 -6
- package/ip-address/index.js +1 -1
- package/ip-address/vue.js +1 -1
- package/link-menu/index.js +2 -2
- package/link-menu/vue.js +2 -2
- package/loading/index.js +2 -2
- package/loading/vue.js +2 -1
- package/locales/index.js +1 -1
- package/logout/index.js +1 -1
- package/milestone/index.js +5 -1
- package/modal/index.js +68 -39
- package/modal/vue.js +15 -12
- package/month-range/index.js +1 -1
- package/month-range/vue.js +1 -1
- package/month-table/index.js +5 -5
- package/month-table/vue.js +1 -1
- package/multi-select/index.js +5 -2
- package/multi-select/vue.js +4 -5
- package/nav-menu/index.js +6 -6
- package/notify/index.js +3 -3
- package/numeric/index.js +15 -5
- package/numeric/vue.js +15 -6
- package/option/index.js +1 -1
- package/package.json +2 -1
- package/pager/vue.js +10 -0
- package/pager-item/index.js +1 -1
- package/panel/index.js +1 -1
- package/picker/index.js +7 -7
- package/picker/vue.js +1 -1
- package/picker-column/index.js +1 -1
- package/popconfirm/index.js +25 -0
- package/popconfirm/vue.js +22 -0
- package/popeditor/index.js +7 -7
- package/popeditor/vue.js +2 -2
- package/popover/index.js +11 -3
- package/popover/vue.js +33 -10
- package/popup/index.js +4 -4
- package/pull-refresh/index.js +8 -11
- package/pull-refresh/vue.js +7 -7
- package/radio/index.js +17 -0
- package/radio/vue.js +18 -3
- package/radio-button/index.js +8 -0
- package/radio-button/vue.js +19 -4
- package/radio-group/index.js +1 -1
- package/radio-group/vue.js +5 -2
- package/rate/index.js +4 -2
- package/rate/vue.js +1 -1
- package/record/index.js +190 -0
- package/record/vue.js +44 -0
- package/recycle-scroller/index.js +470 -0
- package/recycle-scroller/vue.js +135 -0
- package/river/index.js +371 -0
- package/river/river.js +352 -0
- package/river/vue.js +77 -0
- package/roles/index.js +1 -1
- package/scrollbar/vue-bar.js +1 -1
- package/scrollbar/vue.js +1 -1
- package/search/index.js +3 -3
- package/select/index.js +21 -14
- package/select/vue.js +38 -15
- package/select-dropdown/vue.js +1 -1
- package/select-mobile/index.js +111 -0
- package/select-mobile/vue.js +58 -0
- package/select-view/index.js +170 -0
- package/select-view/vue.js +82 -0
- package/selected-box/index.js +216 -0
- package/selected-box/vue.js +98 -0
- package/slide-bar/index.js +1 -1
- package/slider/index.js +49 -4
- package/slider/vue.js +15 -4
- package/split/vue.js +1 -1
- package/standard-list-item/index.js +18 -0
- package/standard-list-item/vue.js +22 -0
- package/steps/index.js +30 -0
- package/steps/slide-bar.js +122 -0
- package/steps/vue.js +15 -3
- package/switch/index.js +1 -1
- package/switch/vue.js +2 -1
- package/tab-bar/index.js +2 -2
- package/tab-item/index.js +3 -3
- package/tab-item/vue.js +4 -3
- package/tab-item-mf/index.js +0 -0
- package/tab-item-mf/vue.js +16 -0
- package/tab-nav/index.js +78 -4
- package/tab-nav/vue.js +11 -3
- package/tabbar-item/index.js +1 -1
- package/tabbar-item/vue.js +1 -1
- package/tabs/index.js +8 -9
- package/tabs/vue.js +1 -1
- package/tabs-mf/index.js +109 -0
- package/tabs-mf/vue-bar.js +49 -0
- package/tabs-mf/vue-nav-item.js +22 -0
- package/tabs-mf/vue-nav.js +13 -0
- package/tabs-mf/vue.js +45 -0
- package/tabs-mf/wheel.js +71 -0
- package/tag/index.js +8 -2
- package/tag/vue.js +13 -5
- package/tag-group/index.js +24 -0
- package/tag-group/vue.js +29 -0
- package/tall-storage/index.js +1 -1
- package/tall-storage/vue.js +1 -1
- package/time/index.js +1 -1
- package/time/vue.js +2 -2
- package/time-line/index.js +28 -7
- package/time-line/vue.js +9 -4
- package/time-panel/index.js +2 -2
- package/time-panel/vue.js +1 -1
- package/time-picker-mobile/index.js +30 -0
- package/time-picker-mobile/vue.js +30 -0
- package/time-range/index.js +1 -1
- package/time-range/vue.js +1 -1
- package/time-spinner/index.js +2 -2
- package/time-spinner/vue.js +1 -1
- package/toggle-menu/index.js +2 -2
- package/toggle-menu/vue.js +1 -1
- package/tooltip/index.js +30 -3
- package/tooltip/vue.js +34 -13
- package/top-box/index.js +3 -3
- package/transfer/index.js +1 -1
- package/transfer-panel/index.js +2 -2
- package/tree/index.js +6 -6
- package/tree/vue.js +1 -1
- package/tree-node/index.js +1 -1
- package/upload/index.js +1 -1
- package/upload/vue.js +2 -2
- package/upload-dragger/index.js +5 -1
- package/upload-dragger/vue.js +9 -3
- package/upload-list/index.js +158 -8
- package/upload-list/vue.js +77 -25
- package/user/index.js +86 -70
- package/user/vue.js +15 -5
- package/user-account/vue.js +1 -1
- package/user-contact/index.js +49 -3
- package/user-contact/vue.js +17 -8
- package/user-head-group/vue.js +17 -0
- package/user-link/index.js +10 -2
- package/user-link/vue.js +11 -6
- package/wheel/index.js +1 -1
- package/wizard/index.js +3 -3
- package/year-range/index.js +125 -0
- package/year-range/vue.js +88 -0
- package/year-table/index.js +175 -11
- package/year-table/vue.js +17 -5
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
const getFormatTime = (time) => {
|
|
3
|
+
return ("0" + time).slice(-2);
|
|
4
|
+
};
|
|
5
|
+
const getDaysByMonth = (year, month) => {
|
|
6
|
+
return new Date(year, month, 0).getDate();
|
|
7
|
+
};
|
|
8
|
+
const isSameDay = (day1, day2) => {
|
|
9
|
+
const theDay1 = new Date(day1);
|
|
10
|
+
const theDay2 = new Date(day2);
|
|
11
|
+
return theDay1.getFullYear() === theDay2.getFullYear() && theDay1.getMonth() === theDay2.getMonth() && theDay1.getDate() === theDay2.getDate();
|
|
12
|
+
};
|
|
13
|
+
const getCurrentDate = () => (dateValue) => {
|
|
14
|
+
const today = /* @__PURE__ */ new Date();
|
|
15
|
+
const theDate = new Date(dateValue);
|
|
16
|
+
const year = theDate.getFullYear();
|
|
17
|
+
const month = theDate.getMonth() + 1;
|
|
18
|
+
const day = theDate.getDate();
|
|
19
|
+
const yearMonth = year + "/" + month;
|
|
20
|
+
const startWeek = new Date(year, month - 1, 1).getDay();
|
|
21
|
+
const index = startWeek + day - 1;
|
|
22
|
+
return {
|
|
23
|
+
date: yearMonth + "/" + day,
|
|
24
|
+
yearMonth,
|
|
25
|
+
index,
|
|
26
|
+
day,
|
|
27
|
+
year,
|
|
28
|
+
month,
|
|
29
|
+
isStartDay: false,
|
|
30
|
+
isEndDay: false,
|
|
31
|
+
isToday: isSameDay(today, theDate)
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
const getFormatDate = (date, yearUnit = "/", monthUnit = "/", dayUnit = "") => {
|
|
35
|
+
const theDate = new Date(date);
|
|
36
|
+
return theDate.getFullYear() + yearUnit + (theDate.getMonth() + 1) + monthUnit + theDate.getDate() + dayUnit;
|
|
37
|
+
};
|
|
38
|
+
const loadingDate = ({ state, api }) => (direction) => {
|
|
39
|
+
const list = Object.keys(state.dateList);
|
|
40
|
+
let date;
|
|
41
|
+
if (direction === "top") {
|
|
42
|
+
const yearMonth = list[0].split("/").map((item) => +item);
|
|
43
|
+
const year = yearMonth[1] === 1 ? yearMonth[0] - 1 : yearMonth[0];
|
|
44
|
+
const month = yearMonth[1] === 1 ? 11 : yearMonth[1] - 1;
|
|
45
|
+
date = new Date(year, month, 1);
|
|
46
|
+
} else {
|
|
47
|
+
const yearMonth = list[list.length - 1].split("/").map((item) => +item);
|
|
48
|
+
date = new Date(yearMonth[0], yearMonth[1] - 2, 1);
|
|
49
|
+
}
|
|
50
|
+
api.initPanel(date, direction, 2);
|
|
51
|
+
setTimeout(() => {
|
|
52
|
+
state.loading = false;
|
|
53
|
+
}, 300);
|
|
54
|
+
};
|
|
55
|
+
const initPanel = ({ state, api }) => (dateValue, direction, yearNum = 1) => {
|
|
56
|
+
const currentDate = dateValue || (Array.isArray(state.date) ? state.date[1] : state.date) || /* @__PURE__ */ new Date();
|
|
57
|
+
let month = currentDate.getMonth() + 1;
|
|
58
|
+
let year = direction === "top" ? currentDate.getFullYear() - 1 : currentDate.getFullYear();
|
|
59
|
+
if (yearNum === 1 && !direction) {
|
|
60
|
+
if (month <= 6) {
|
|
61
|
+
year -= 1;
|
|
62
|
+
month += 6;
|
|
63
|
+
} else {
|
|
64
|
+
month -= 6;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
let date = new Date(year, month - 1, 1);
|
|
68
|
+
const dateList = {};
|
|
69
|
+
Array.from({ length: 12 * yearNum }).map(() => {
|
|
70
|
+
const startWeek = date.getDay();
|
|
71
|
+
dateList[year + "/" + month] = Array.from({ length: startWeek }).map(() => ({}));
|
|
72
|
+
const days = getDaysByMonth(year, month);
|
|
73
|
+
Array.from({ length: days }).map((v, index) => {
|
|
74
|
+
const day = index + 1;
|
|
75
|
+
const dayInfo = api.getCurrentDate(new Date(year, month - 1, day));
|
|
76
|
+
dateList[year + "/" + month].push(dayInfo);
|
|
77
|
+
});
|
|
78
|
+
month++;
|
|
79
|
+
if (month > 12) {
|
|
80
|
+
year++;
|
|
81
|
+
month = 1;
|
|
82
|
+
}
|
|
83
|
+
date = new Date(year, month - 1, 1);
|
|
84
|
+
});
|
|
85
|
+
state.dateList = dateList;
|
|
86
|
+
};
|
|
87
|
+
const getWeeksByMonth = ({ state }) => (yearMonth) => {
|
|
88
|
+
const length = state.dateList[yearMonth].length;
|
|
89
|
+
return Math.ceil(length / 7);
|
|
90
|
+
};
|
|
91
|
+
const getDaysByWeek = ({ state, api }) => (yearMonth, week) => {
|
|
92
|
+
const length = state.dateList[yearMonth].length;
|
|
93
|
+
const weeks = api.getWeeksByMonth(yearMonth);
|
|
94
|
+
return week === weeks ? length % 7 : 7;
|
|
95
|
+
};
|
|
96
|
+
const getDate = ({ state }) => ({ date, yearMonth, index }) => {
|
|
97
|
+
let currentDate;
|
|
98
|
+
if (date) {
|
|
99
|
+
const theDate = new Date(date);
|
|
100
|
+
currentDate = state.dateList[`${theDate.getFullYear()}/${theDate.getMonth + 1}`].filter((item) => item.day === theDate.getDate()).shift();
|
|
101
|
+
} else {
|
|
102
|
+
currentDate = state.dateList[yearMonth][index];
|
|
103
|
+
}
|
|
104
|
+
return currentDate || {};
|
|
105
|
+
};
|
|
106
|
+
const getSelectedPosition = ({ state }) => (dateFormat) => {
|
|
107
|
+
const { selected } = state;
|
|
108
|
+
if (!selected.length) {
|
|
109
|
+
return "";
|
|
110
|
+
}
|
|
111
|
+
const index = selected.map((item) => getFormatDate(item)).indexOf(dateFormat);
|
|
112
|
+
const length = selected.length;
|
|
113
|
+
return index === 0 ? "start" : index === length - 1 ? "end" : index > -1 ? "inner" : "";
|
|
114
|
+
};
|
|
115
|
+
const watchVisible = ({ emit, api, nextTick, vm }) => (bool) => {
|
|
116
|
+
if (bool) {
|
|
117
|
+
api.watchModelValue();
|
|
118
|
+
nextTick(() => {
|
|
119
|
+
const refBody = vm.$refs.datePickerBody;
|
|
120
|
+
if (refBody.scrollHeight && !refBody.scrollTop) {
|
|
121
|
+
refBody.scrollTop = refBody.scrollHeight / 2;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
emit("update:visible", bool);
|
|
126
|
+
};
|
|
127
|
+
const watchModelValue = ({ props, state }) => () => {
|
|
128
|
+
const { modelValue, type } = props;
|
|
129
|
+
if (["daterange", "datetimerange"].includes(type)) {
|
|
130
|
+
state.date = modelValue && modelValue.length ? modelValue.map((date) => new Date(date)) : [];
|
|
131
|
+
}
|
|
132
|
+
if (["datetime", "date"].includes(type)) {
|
|
133
|
+
state.date = modelValue ? new Date(modelValue) : /* @__PURE__ */ new Date();
|
|
134
|
+
}
|
|
135
|
+
if (["datetimerange", "datetime"].includes(type)) {
|
|
136
|
+
const length = type === "datetime" ? 1 : 2;
|
|
137
|
+
Array.from({ length }).forEach((v, index) => {
|
|
138
|
+
const date = type === "datetime" ? state.date : state.date[index];
|
|
139
|
+
if (date) {
|
|
140
|
+
state.timeList[index] = [
|
|
141
|
+
getFormatTime(date.getHours()),
|
|
142
|
+
getFormatTime(date.getMinutes()),
|
|
143
|
+
getFormatTime(date.getSeconds())
|
|
144
|
+
];
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
const selectOption = ({ emit, state, props }) => ({ yearMonth, index }) => {
|
|
150
|
+
const { type } = props;
|
|
151
|
+
const currentDateInfo = state.dateList[yearMonth][index];
|
|
152
|
+
if (!currentDateInfo) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (["daterange", "datetimerange"].includes(type)) {
|
|
156
|
+
if (state.date.length > 1) {
|
|
157
|
+
state.date = [];
|
|
158
|
+
}
|
|
159
|
+
state.date.push(new Date(currentDateInfo.date));
|
|
160
|
+
if (state.date.length === 2) {
|
|
161
|
+
state.date.sort((a, b) => a.getTime() - b.getTime());
|
|
162
|
+
}
|
|
163
|
+
} else {
|
|
164
|
+
state.date = new Date(currentDateInfo.date);
|
|
165
|
+
emit("click", currentDateInfo);
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
const confirm = ({ emit, state, props, api }) => () => {
|
|
169
|
+
const { date, timeList } = state;
|
|
170
|
+
const { type } = props;
|
|
171
|
+
if (["daterange", "datetimerange", "datetime"].includes(type)) {
|
|
172
|
+
const length = type === "datetime" ? 1 : 2;
|
|
173
|
+
Array.from({ length }).forEach((v, index) => {
|
|
174
|
+
let thisDate = type === "datetime" ? date : date[index];
|
|
175
|
+
if (thisDate) {
|
|
176
|
+
const currentDate = api.getCurrentDate(thisDate);
|
|
177
|
+
const time = timeList[index];
|
|
178
|
+
thisDate = new Date(currentDate.year, currentDate.month - 1, currentDate.day, time[0], time[1], time[2]);
|
|
179
|
+
if (type === "datetime") {
|
|
180
|
+
state.date = thisDate;
|
|
181
|
+
} else {
|
|
182
|
+
state.date[index] = thisDate;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
emit("confirm", state.date);
|
|
188
|
+
emit("update:visible", false);
|
|
189
|
+
emit("update:modelValue", state.date);
|
|
190
|
+
};
|
|
191
|
+
const timeConfirm = ({ emit, state }) => (value) => {
|
|
192
|
+
state.timeVisible = false;
|
|
193
|
+
state.timeList[state.showTimeIndex] = value;
|
|
194
|
+
emit("time-confirm", value);
|
|
195
|
+
};
|
|
196
|
+
const timeToggle = ({ state }) => (index) => {
|
|
197
|
+
state.showTimeIndex = index;
|
|
198
|
+
state.time = state.timeList[index];
|
|
199
|
+
state.timeVisible = true;
|
|
200
|
+
};
|
|
201
|
+
const selectedComputed = ({ state, props }) => () => {
|
|
202
|
+
if (["daterange", "datetimerange"].includes(props.type)) {
|
|
203
|
+
if (state.date && state.date.length) {
|
|
204
|
+
if (state.date.length === 1) {
|
|
205
|
+
return [state.date[0]];
|
|
206
|
+
}
|
|
207
|
+
const list = [];
|
|
208
|
+
let date1 = state.date[0].getTime();
|
|
209
|
+
let date2 = state.date[1].getTime();
|
|
210
|
+
while (date1 <= date2) {
|
|
211
|
+
list.push(new Date(date1));
|
|
212
|
+
date1 += 3600 * 24 * 1e3;
|
|
213
|
+
}
|
|
214
|
+
return list;
|
|
215
|
+
} else {
|
|
216
|
+
return [];
|
|
217
|
+
}
|
|
218
|
+
} else {
|
|
219
|
+
return state.date ? [getFormatDate(state.date)] : [];
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
const scrollLoadHandler = ({ state, vm, api }) => () => {
|
|
223
|
+
const refBody = vm.$refs.datePickerBody;
|
|
224
|
+
if (refBody.scrollHeight && refBody.scrollTop < 50 && !state.loading) {
|
|
225
|
+
state.loading = true;
|
|
226
|
+
api.loadingDate("top");
|
|
227
|
+
} else if (refBody.scrollHeight && refBody.scrollHeight - refBody.offsetHeight - refBody.scrollTop < 10 && !state.loading) {
|
|
228
|
+
state.loading = true;
|
|
229
|
+
api.loadingDate("down");
|
|
230
|
+
refBody.scrollTop = 50;
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
export {
|
|
234
|
+
confirm,
|
|
235
|
+
getCurrentDate,
|
|
236
|
+
getDate,
|
|
237
|
+
getDaysByWeek,
|
|
238
|
+
getFormatDate,
|
|
239
|
+
getSelectedPosition,
|
|
240
|
+
getWeeksByMonth,
|
|
241
|
+
initPanel,
|
|
242
|
+
loadingDate,
|
|
243
|
+
scrollLoadHandler,
|
|
244
|
+
selectOption,
|
|
245
|
+
selectedComputed,
|
|
246
|
+
timeConfirm,
|
|
247
|
+
timeToggle,
|
|
248
|
+
watchModelValue,
|
|
249
|
+
watchVisible
|
|
250
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
import { on, off } from "../common/deps/dom";
|
|
3
|
+
import {
|
|
4
|
+
initPanel,
|
|
5
|
+
getFormatDate,
|
|
6
|
+
getCurrentDate,
|
|
7
|
+
getSelectedPosition,
|
|
8
|
+
getWeeksByMonth,
|
|
9
|
+
getDaysByWeek,
|
|
10
|
+
getDate,
|
|
11
|
+
watchVisible,
|
|
12
|
+
watchModelValue,
|
|
13
|
+
selectOption,
|
|
14
|
+
timeToggle,
|
|
15
|
+
timeConfirm,
|
|
16
|
+
selectedComputed,
|
|
17
|
+
scrollLoadHandler,
|
|
18
|
+
loadingDate,
|
|
19
|
+
confirm
|
|
20
|
+
} from "./index";
|
|
21
|
+
const api = [
|
|
22
|
+
"state",
|
|
23
|
+
"getDate",
|
|
24
|
+
"getWeeksByMonth",
|
|
25
|
+
"getDaysByWeek",
|
|
26
|
+
"getSelectedPosition",
|
|
27
|
+
"selectOption",
|
|
28
|
+
"confirm",
|
|
29
|
+
"timeToggle",
|
|
30
|
+
"timeConfirm",
|
|
31
|
+
"getFormatDate"
|
|
32
|
+
];
|
|
33
|
+
const renderless = (props, { computed, reactive, watch, onMounted, onBeforeUnmount }, { emit, vm, nextTick }) => {
|
|
34
|
+
const api2 = {};
|
|
35
|
+
const state = reactive({
|
|
36
|
+
toggle: false,
|
|
37
|
+
date: null,
|
|
38
|
+
loading: false,
|
|
39
|
+
dateList: {},
|
|
40
|
+
timeVisible: false,
|
|
41
|
+
showTimeIndex: 0,
|
|
42
|
+
time: ["00", "00", "00"],
|
|
43
|
+
timeList: [
|
|
44
|
+
["00", "00", "00"],
|
|
45
|
+
["00", "00", "00"]
|
|
46
|
+
],
|
|
47
|
+
selected: computed(() => api2.selectedComputed()),
|
|
48
|
+
months: computed(() => Object.keys(state.dateList)),
|
|
49
|
+
btnDisabled: computed(
|
|
50
|
+
() => ["daterange", "datetimerange"].includes(props.type) && state.date && state.date.length === 1
|
|
51
|
+
)
|
|
52
|
+
});
|
|
53
|
+
Object.assign(api2, {
|
|
54
|
+
state,
|
|
55
|
+
initPanel: initPanel({ state, api: api2 }),
|
|
56
|
+
getCurrentDate: getCurrentDate(),
|
|
57
|
+
getWeeksByMonth: getWeeksByMonth({ state }),
|
|
58
|
+
getDate: getDate({ state }),
|
|
59
|
+
getDaysByWeek: getDaysByWeek({ state, api: api2 }),
|
|
60
|
+
getSelectedPosition: getSelectedPosition({ state }),
|
|
61
|
+
confirm: confirm({ state, emit, props, api: api2 }),
|
|
62
|
+
timeConfirm: timeConfirm({ state, emit }),
|
|
63
|
+
selectOption: selectOption({ state, emit, props }),
|
|
64
|
+
timeToggle: timeToggle({ state }),
|
|
65
|
+
watchVisible: watchVisible({ emit, api: api2, nextTick, vm }),
|
|
66
|
+
watchModelValue: watchModelValue({ props, state }),
|
|
67
|
+
selectedComputed: selectedComputed({ props, state }),
|
|
68
|
+
scrollLoadHandler: scrollLoadHandler({ state, vm, api: api2 }),
|
|
69
|
+
loadingDate: loadingDate({ state, api: api2 }),
|
|
70
|
+
getFormatDate
|
|
71
|
+
});
|
|
72
|
+
watch(() => props.visible, api2.watchVisible);
|
|
73
|
+
watch(() => props.modelValue, api2.watchModelValue, { immediate: true });
|
|
74
|
+
onMounted(() => {
|
|
75
|
+
api2.initPanel();
|
|
76
|
+
on(vm.$refs.datePickerBody, "scroll", api2.scrollLoadHandler);
|
|
77
|
+
});
|
|
78
|
+
onBeforeUnmount(() => {
|
|
79
|
+
off(vm.$refs.datePickerBody, "scroll", api2.scrollLoadHandler);
|
|
80
|
+
});
|
|
81
|
+
return api2;
|
|
82
|
+
};
|
|
83
|
+
export {
|
|
84
|
+
api,
|
|
85
|
+
renderless
|
|
86
|
+
};
|
package/date-range/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
nextMonth,
|
|
12
12
|
prevMonth,
|
|
13
13
|
modifyWithTimeString
|
|
14
|
-
} from "
|
|
14
|
+
} from "../common/deps/date-util";
|
|
15
15
|
const calcDefaultValue = (defaultValue) => {
|
|
16
16
|
if (Array.isArray(defaultValue)) {
|
|
17
17
|
return [new Date(defaultValue[0]), new Date(defaultValue[1])];
|
package/date-range/vue.js
CHANGED
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
computerLabel,
|
|
41
41
|
computerEnableYearArrow
|
|
42
42
|
} from "./index";
|
|
43
|
-
import { nextMonth, extractDateFormat, extractTimeFormat } from "
|
|
43
|
+
import { nextMonth, extractDateFormat, extractTimeFormat } from "../common/deps/date-util";
|
|
44
44
|
const api = [
|
|
45
45
|
"state",
|
|
46
46
|
"handleShortcutClick",
|
package/date-table/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { formatDate } from "
|
|
3
|
-
import { getFirstDayOfMonth, getDayCountOfMonth, getWeekNumber, prevDate, nextDate, isDate, clearTime } from "
|
|
4
|
-
import { DATEPICKER } from "
|
|
2
|
+
import { formatDate } from "../common/deps/date-util";
|
|
3
|
+
import { getFirstDayOfMonth, getDayCountOfMonth, getWeekNumber, prevDate, nextDate, isDate, clearTime } from "../common/deps/date-util";
|
|
4
|
+
import { DATEPICKER } from "../common";
|
|
5
5
|
const formatJudg = ({ day, offset, j, i, cell, count, dateCountOfLastMonth }) => {
|
|
6
6
|
const nodfpm = day + offset < 0 ? 7 + day + offset : day + offset;
|
|
7
7
|
if (j + i * 7 >= nodfpm) {
|
package/date-table/vue.js
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
getCellRangeClasses,
|
|
16
16
|
getCell
|
|
17
17
|
} from "./index";
|
|
18
|
-
import { getStartDateOfMonth } from "
|
|
18
|
+
import { getStartDateOfMonth } from "../common/deps/date-util";
|
|
19
19
|
const api = ["state", "getCellClasses", "isWeekActive", "handleMouseMove", "handleClick"];
|
|
20
20
|
const initState = ({ reactive, computed, api: api2, props }) => {
|
|
21
21
|
const state = reactive({
|
package/dialog-box/index.js
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { on, off, addClass, removeClass } from "
|
|
3
|
-
import { emitEvent } from "
|
|
4
|
-
import { getDomNode } from "
|
|
2
|
+
import { on, off, addClass, removeClass } from "../common/deps/dom";
|
|
3
|
+
import { emitEvent } from "../common/event";
|
|
4
|
+
import { getDomNode } from "../common/deps/dom";
|
|
5
5
|
const computedAnimationName = ({ constants, props }) => () => props.rightSlide ? constants.DIALOG_SLIDER_RIGHT : constants.DIALOG_FADE;
|
|
6
6
|
const computedAddUnit = (value) => isNaN(Number(value)) ? value : value + "px";
|
|
7
7
|
const computedStyle = ({ props, state }) => () => {
|
|
8
8
|
const style = {};
|
|
9
|
-
let { width, top, rightSlide } = props;
|
|
9
|
+
let { width, top, rightSlide, maxHeight } = props;
|
|
10
10
|
if (top === void 0) {
|
|
11
11
|
top = rightSlide ? "0" : "15vh";
|
|
12
12
|
}
|
|
13
13
|
width = computedAddUnit(width);
|
|
14
14
|
top = computedAddUnit(top);
|
|
15
|
+
maxHeight = computedAddUnit(maxHeight);
|
|
15
16
|
if (!state.isFull) {
|
|
16
17
|
style.width = width;
|
|
17
18
|
style.top = state.top || top;
|
|
19
|
+
style.maxHeight = maxHeight;
|
|
18
20
|
if (rightSlide) {
|
|
19
21
|
style.right = 0;
|
|
20
22
|
style.height = "calc(100vh - " + style.top + ")";
|
package/dialog-box/vue.js
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
showScrollbar,
|
|
20
20
|
hideScrollbar
|
|
21
21
|
} from "./index";
|
|
22
|
-
import usePopup from "
|
|
22
|
+
import usePopup from "../common/deps/vue-popup";
|
|
23
23
|
const api = ["afterEnter", "afterLeave", "handleClose", "handleWrapperClick", "handleCancel", "handleConfirm", "handleDrag", "state"];
|
|
24
24
|
const initState = ({ reactive, computed, api: api2, emitter, props }) => {
|
|
25
25
|
const state = reactive({
|