@opentiny/vue-renderless 3.6.7 → 3.8.0
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/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 +4 -4
- 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 +10 -6
- 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 +1 -1
- package/dropdown-item/index.js +1 -1
- package/dropdown-item/mf.js +79 -0
- 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-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 +17 -14
- package/select/vue.js +14 -8
- 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 +2 -2
- package/tab-item/vue.js +1 -1
- 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 +33 -12
- 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 -2
- 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
package/action-sheet/index.js
CHANGED
|
@@ -22,7 +22,7 @@ const setSheetStyle = ({ state, props }) => () => {
|
|
|
22
22
|
const initScrollMenu = ({ state, nextTick, refs, BScroll }) => () => {
|
|
23
23
|
nextTick(() => {
|
|
24
24
|
const { scrollMenu } = refs;
|
|
25
|
-
if (
|
|
25
|
+
if (state.scroll) {
|
|
26
26
|
state.scroll = new BScroll(scrollMenu, {
|
|
27
27
|
probeType: 3,
|
|
28
28
|
tap: "tap"
|
|
@@ -51,9 +51,36 @@ const menuHandle = ({ emit, state }) => (item) => {
|
|
|
51
51
|
emit("update:modelValue", item.id);
|
|
52
52
|
emit("click", item);
|
|
53
53
|
};
|
|
54
|
+
const close = ({ emit, vm }) => () => {
|
|
55
|
+
vm.$refs.drawer.close();
|
|
56
|
+
emit("close", false);
|
|
57
|
+
};
|
|
58
|
+
const hide = (emit) => () => {
|
|
59
|
+
emit("hide", false);
|
|
60
|
+
emit("update:visible", false);
|
|
61
|
+
};
|
|
62
|
+
const selectOption = ({ emit, props }) => (option) => {
|
|
63
|
+
const { valueField } = props;
|
|
64
|
+
emit("update:visible", false);
|
|
65
|
+
emit("update:modelValue", option[valueField]);
|
|
66
|
+
emit("click", option);
|
|
67
|
+
};
|
|
68
|
+
const confirm = ({ emit, state }) => () => {
|
|
69
|
+
emit("confirm", state);
|
|
70
|
+
emit("update:visible", false);
|
|
71
|
+
};
|
|
72
|
+
const actionSelectOption = ({ emit }) => (option, index) => {
|
|
73
|
+
emit("update:visible", false);
|
|
74
|
+
emit("click", option, index);
|
|
75
|
+
};
|
|
54
76
|
export {
|
|
77
|
+
actionSelectOption,
|
|
78
|
+
close,
|
|
79
|
+
confirm,
|
|
80
|
+
hide,
|
|
55
81
|
initScrollMenu,
|
|
56
82
|
menuHandle,
|
|
83
|
+
selectOption,
|
|
57
84
|
setSheetStyle,
|
|
58
85
|
visibleHandle,
|
|
59
86
|
watchVisible
|
package/action-sheet/vue.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { setSheetStyle, initScrollMenu, visibleHandle, watchVisible, menuHandle } from "./index";
|
|
3
|
-
const api = ["state", "setSheetStyle", "initScrollMenu", "visibleHandle", "menuHandle"];
|
|
4
|
-
const renderless = (props, { reactive, watch }, { emit, nextTick, refs }, { BScroll }) => {
|
|
2
|
+
import { setSheetStyle, initScrollMenu, visibleHandle, watchVisible, menuHandle, close, selectOption, confirm, actionSelectOption, hide } from "./index";
|
|
3
|
+
const api = ["state", "setSheetStyle", "initScrollMenu", "visibleHandle", "menuHandle", "close", "selectOption", "confirm", "actionSelectOption", "hide"];
|
|
4
|
+
const renderless = (props, { reactive, watch }, { emit, nextTick, refs, vm }, { BScroll }) => {
|
|
5
5
|
const api2 = {};
|
|
6
6
|
const state = reactive({
|
|
7
7
|
toggle: false,
|
|
@@ -20,13 +20,19 @@ const renderless = (props, { reactive, watch }, { emit, nextTick, refs }, { BScr
|
|
|
20
20
|
api2.watchVisible(value);
|
|
21
21
|
}
|
|
22
22
|
);
|
|
23
|
+
watch(() => props.visible, api2.watchVisible, { immediate: true });
|
|
23
24
|
Object.assign(api2, {
|
|
24
25
|
state,
|
|
25
26
|
setSheetStyle: setSheetStyle({ state, props }),
|
|
26
27
|
initScrollMenu: initScrollMenu({ state, nextTick, refs, BScroll }),
|
|
27
28
|
visibleHandle: visibleHandle({ emit, state }),
|
|
28
29
|
watchVisible: watchVisible({ emit, props, state }),
|
|
29
|
-
menuHandle: menuHandle({ state, emit })
|
|
30
|
+
menuHandle: menuHandle({ state, emit }),
|
|
31
|
+
confirm: confirm({ state, emit }),
|
|
32
|
+
selectOption: selectOption({ emit, props }),
|
|
33
|
+
actionSelectOption: actionSelectOption({ emit }),
|
|
34
|
+
close: close({ emit, vm }),
|
|
35
|
+
hide: hide(emit)
|
|
30
36
|
});
|
|
31
37
|
return api2;
|
|
32
38
|
};
|
package/alert/index.js
CHANGED
|
@@ -3,10 +3,32 @@ const close = ({ emit, state }) => () => {
|
|
|
3
3
|
state.show = false;
|
|
4
4
|
emit("close");
|
|
5
5
|
};
|
|
6
|
-
const computedGetIcon = ({ constants, props }) => () =>
|
|
6
|
+
const computedGetIcon = ({ constants, props, designConfig }) => () => {
|
|
7
|
+
var _a;
|
|
8
|
+
const designIcon = (_a = designConfig == null ? void 0 : designConfig.icons) == null ? void 0 : _a[props.type];
|
|
9
|
+
return props.icon || designIcon || constants.ICON_MAP[props.type];
|
|
10
|
+
};
|
|
7
11
|
const computedGetTitle = ({ constants, t, props }) => () => props.title || t(constants.TITLE_MAP[props.type]);
|
|
12
|
+
const handleHeaderClick = ({ state, props, vm }) => () => {
|
|
13
|
+
if (props.showFoldable) {
|
|
14
|
+
state.contentVisible = !state.contentVisible;
|
|
15
|
+
}
|
|
16
|
+
if (vm.$refs.ContentDescribe) {
|
|
17
|
+
state.contentDescribeHeight = vm.$refs.ContentDescribe.scrollHeight;
|
|
18
|
+
if (state.contentDescribeHeight > state.contentMaxHeight) {
|
|
19
|
+
state.scrollStatus = true;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (vm.$refs.ContentDefault) {
|
|
23
|
+
state.contentDefaultHeight = vm.$refs.ContentDefault.scrollHeight;
|
|
24
|
+
if (state.contentDefaultHeight > state.contentMaxHeight) {
|
|
25
|
+
state.scrollStatus = true;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
8
29
|
export {
|
|
9
30
|
close,
|
|
10
31
|
computedGetIcon,
|
|
11
|
-
computedGetTitle
|
|
32
|
+
computedGetTitle,
|
|
33
|
+
handleHeaderClick
|
|
12
34
|
};
|
package/alert/vue.js
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { close, computedGetIcon, computedGetTitle } from "./index";
|
|
3
|
-
const api = ["close", "state"];
|
|
4
|
-
const renderless = (props, { computed, reactive }, { t, emit, constants }) => {
|
|
5
|
-
const api2 = {
|
|
6
|
-
computedGetIcon: computedGetIcon({ constants, props }),
|
|
7
|
-
computedGetTitle: computedGetTitle({ constants, props, t })
|
|
8
|
-
};
|
|
2
|
+
import { close, computedGetIcon, computedGetTitle, handleHeaderClick } from "./index";
|
|
3
|
+
const api = ["close", "state", "handleHeaderClick"];
|
|
4
|
+
const renderless = (props, { computed, reactive }, { t, emit, constants, vm, designConfig }) => {
|
|
9
5
|
const state = reactive({
|
|
10
6
|
show: true,
|
|
11
7
|
getIcon: computed(() => api2.computedGetIcon()),
|
|
12
|
-
getTitle: computed(() => api2.computedGetTitle())
|
|
8
|
+
getTitle: computed(() => api2.computedGetTitle()),
|
|
9
|
+
contentVisible: false,
|
|
10
|
+
contentDescribeHeight: 0,
|
|
11
|
+
contentDefaultHeight: 0,
|
|
12
|
+
contentMaxHeight: constants.CONTENT_MAXHEUGHT,
|
|
13
|
+
scrollStatus: false
|
|
13
14
|
});
|
|
14
|
-
|
|
15
|
+
const api2 = {
|
|
15
16
|
state,
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
computedGetIcon: computedGetIcon({ constants, props, designConfig }),
|
|
18
|
+
computedGetTitle: computedGetTitle({ constants, props, t }),
|
|
19
|
+
close: close({ state, emit }),
|
|
20
|
+
handleHeaderClick: handleHeaderClick({ state, props, vm })
|
|
21
|
+
};
|
|
18
22
|
return api2;
|
|
19
23
|
};
|
|
20
24
|
export {
|
package/amount/index.js
CHANGED
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
__spreadProps,
|
|
3
3
|
__spreadValues
|
|
4
4
|
} from "../chunk-PKUHTIDK.js";
|
|
5
|
-
import { on, off } from "
|
|
6
|
-
import { formatNumber } from "
|
|
7
|
-
import { getMiniDecimal, equalsDecimal } from "
|
|
8
|
-
import { isNumber } from "
|
|
5
|
+
import { on, off } from "../common/deps/dom";
|
|
6
|
+
import { formatNumber } from "../common/decimal";
|
|
7
|
+
import { getMiniDecimal, equalsDecimal } from "../common/bigInt";
|
|
8
|
+
import { isNumber } from "../common/type";
|
|
9
9
|
const initService = (service) => {
|
|
10
10
|
const { utils = {} } = service || {};
|
|
11
11
|
const noopFn = () => null;
|
package/anchor/index.js
CHANGED
package/autocomplete/vue.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import debounce from "
|
|
3
|
-
import userPopper from "
|
|
4
|
-
import { guid } from "
|
|
2
|
+
import debounce from "../common/deps/debounce";
|
|
3
|
+
import userPopper from "../common/deps/vue-popper";
|
|
4
|
+
import { guid } from "../common/string";
|
|
5
5
|
import {
|
|
6
6
|
computedVisible,
|
|
7
7
|
watchVisible,
|
package/autonavi-map/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { getAmap } from "
|
|
2
|
+
import { getAmap } from "../chart-core/deps/utils";
|
|
3
3
|
const amap = (columns, rows, settings, extra) => {
|
|
4
4
|
const { key, v, amap: amap2, useOuterMap, url } = settings;
|
|
5
5
|
const { _once } = extra;
|
package/badge/vue.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
2
|
import { computedContent, computedValueRef } from "./index";
|
|
3
|
-
import { xss } from "
|
|
3
|
+
import { xss } from "../common/xss";
|
|
4
4
|
const api = ["state"];
|
|
5
5
|
const renderless = (props, { computed, reactive }) => {
|
|
6
|
-
const api2 = {
|
|
7
|
-
computedValueRef: computedValueRef({ props })
|
|
8
|
-
};
|
|
9
6
|
const state = reactive({
|
|
10
7
|
isOverstep: false,
|
|
11
8
|
valueRef: computed(() => api2.computedValueRef()),
|
|
12
9
|
content: computed(() => api2.computedContent()),
|
|
13
10
|
href: computed(() => xss.filterUrl(props.href))
|
|
14
11
|
});
|
|
15
|
-
api2
|
|
16
|
-
|
|
12
|
+
const api2 = {
|
|
13
|
+
state,
|
|
14
|
+
computedValueRef: computedValueRef({ props }),
|
|
15
|
+
computedContent: computedContent({ props, state })
|
|
16
|
+
};
|
|
17
17
|
return api2;
|
|
18
18
|
};
|
|
19
19
|
export {
|
package/baidu-map/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { getBmap } from "
|
|
2
|
+
import { getBmap } from "../chart-core/deps/utils";
|
|
3
3
|
const bmap = (columns, rows, settings, extra) => {
|
|
4
4
|
const { key, v, bmap: bmap2, useOuterMap, url } = settings;
|
|
5
5
|
const { _once } = extra;
|
package/bulletin-board/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { xss } from "
|
|
2
|
+
import { xss } from "../common/xss.js";
|
|
3
3
|
const getRoute = (route) => `/${route || ""}`.replace(/^\/+/, "/");
|
|
4
4
|
const computedDataList = ({ props, state }) => () => {
|
|
5
5
|
const list = props.data[Number(state.actName) - 1] || [];
|
package/calendar/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { isLeapYear } from "
|
|
3
|
-
import { copyArray } from "
|
|
2
|
+
import { isLeapYear } from "../common/date";
|
|
3
|
+
import { copyArray } from "../common/object";
|
|
4
4
|
const getDays = (year, month) => [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month - 1];
|
|
5
5
|
const getWeek = (year, month, day) => (/* @__PURE__ */ new Date(`${year}/${month}/${day}`)).getDay();
|
|
6
6
|
const lastMonth = (year, month) => {
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
const normalConfig = (config, state) => {
|
|
3
|
+
let { weekFirst, disabled, holiday, workday, mark } = config || {};
|
|
4
|
+
const minWeekFirst = 0;
|
|
5
|
+
const maxWeekFirst = state.dayOfWeek - 1;
|
|
6
|
+
weekFirst = typeof weekFirst === "number" && weekFirst >= minWeekFirst && weekFirst <= maxWeekFirst ? Math.round(weekFirst) : minWeekFirst;
|
|
7
|
+
disabled = typeof disabled === "function" ? disabled : () => false;
|
|
8
|
+
holiday = typeof holiday === "function" ? holiday : () => true;
|
|
9
|
+
workday = typeof workday === "function" ? workday : () => true;
|
|
10
|
+
mark = typeof mark === "function" ? mark : () => "";
|
|
11
|
+
return { weekFirst, disabled, holiday, workday, mark };
|
|
12
|
+
};
|
|
13
|
+
const normalDate = (date) => {
|
|
14
|
+
date = !date ? /* @__PURE__ */ new Date() : !(date instanceof Date) ? new Date(date) : date;
|
|
15
|
+
date = date.toString() === "Invalid Date" ? /* @__PURE__ */ new Date() : date;
|
|
16
|
+
return date;
|
|
17
|
+
};
|
|
18
|
+
const splitDate = (date) => {
|
|
19
|
+
const today = /* @__PURE__ */ new Date();
|
|
20
|
+
const todayFullYear = today.getFullYear();
|
|
21
|
+
const todayMonth = today.getMonth() + 1;
|
|
22
|
+
const todayDate = today.getDate();
|
|
23
|
+
const currentFullYear = date.getFullYear();
|
|
24
|
+
const currentMonth = date.getMonth() + 1;
|
|
25
|
+
const currentDate = date.getDate();
|
|
26
|
+
return { todayFullYear, todayMonth, todayDate, currentFullYear, currentMonth, currentDate };
|
|
27
|
+
};
|
|
28
|
+
const getBuildDay = (args) => (year, month, date) => {
|
|
29
|
+
const { pad0: pad02, isCurrent, currentFullYear, currentMonth, holiday, workday, mark } = args;
|
|
30
|
+
const { currentDate, isToday, disabled, dayOfWeek } = args;
|
|
31
|
+
const dateStr = `${year}-${pad02(month)}-${pad02(date)}`;
|
|
32
|
+
const d = new Date(dateStr);
|
|
33
|
+
const isCurMon = isCurrent(year, month);
|
|
34
|
+
const isSat = d.getDay() === dayOfWeek - 1;
|
|
35
|
+
const isSun = d.getDay() === 0;
|
|
36
|
+
let isWorkday, isHoliday;
|
|
37
|
+
if (year === currentFullYear && month === currentMonth) {
|
|
38
|
+
if (isSat || isSun) {
|
|
39
|
+
isHoliday = holiday(d);
|
|
40
|
+
isWorkday = !isHoliday;
|
|
41
|
+
} else {
|
|
42
|
+
isWorkday = workday(d);
|
|
43
|
+
isHoliday = !isWorkday;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const markMsg = mark(d);
|
|
47
|
+
const marked = !!markMsg;
|
|
48
|
+
const day = { dateStr, marked, markMsg, isWorkday, isHoliday, isSat, isSun, isCurMon };
|
|
49
|
+
day.isCur = isCurMon && date === currentDate;
|
|
50
|
+
day.isToday = isToday(year, month, date);
|
|
51
|
+
day.disabled = disabled(d);
|
|
52
|
+
day.dateArr = [year, month, date];
|
|
53
|
+
return day;
|
|
54
|
+
};
|
|
55
|
+
const getPadCalendarDays = ({ calendarDays, buildDay }) => (flag, count, cur) => {
|
|
56
|
+
const sign = flag === "s" ? -1 : 1;
|
|
57
|
+
Array.from({ length: count }).map((v, i) => {
|
|
58
|
+
const d = new Date(cur.getTime() + (i + 1) * sign * 864e5);
|
|
59
|
+
const year = d.getFullYear();
|
|
60
|
+
const month = d.getMonth() + 1;
|
|
61
|
+
const date = d.getDate();
|
|
62
|
+
calendarDays[flag === "s" ? "unshift" : "push"](buildDay(year, month, date));
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
const equalArr = (arr1, arr2) => Array.isArray(arr1) && Array.isArray(arr2) && arr1.join(",") === arr2.join(",");
|
|
66
|
+
const setDayRow = ({ calendarDays, state }) => calendarDays.map((day, i) => day.row = Math.floor(i / state.dayOfWeek));
|
|
67
|
+
const pad0 = (str, n = 2) => String(str).padStart(n, "0");
|
|
68
|
+
const getCalendarDays = (state) => (date, config) => {
|
|
69
|
+
date = normalDate(date);
|
|
70
|
+
let { weekFirst, disabled, holiday, workday, mark } = normalConfig(config, state);
|
|
71
|
+
const { todayFullYear, todayMonth, todayDate, currentFullYear, currentMonth, currentDate } = splitDate(date);
|
|
72
|
+
const isToday = (year, month, date2) => year === todayFullYear && month === todayMonth && date2 === todayDate;
|
|
73
|
+
const isCurrent = (year, month) => year === currentFullYear && month === currentMonth;
|
|
74
|
+
const february = currentFullYear % 4 === 0 && currentFullYear % 100 !== 0 || currentFullYear % 400 === 0 ? 29 : 28;
|
|
75
|
+
const monthDays = [-1, 31, february, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
76
|
+
const f = (arr) => arr[0];
|
|
77
|
+
const l = (arr) => arr[arr.length - 1];
|
|
78
|
+
const { dayOfWeek } = state;
|
|
79
|
+
const args = { pad0, isCurrent, currentFullYear, currentMonth, holiday, workday, mark };
|
|
80
|
+
Object.assign(args, { currentDate, isToday, disabled, dayOfWeek });
|
|
81
|
+
const buildDay = getBuildDay(args);
|
|
82
|
+
const calendarDays = Array.from({ length: monthDays[currentMonth] }).map(
|
|
83
|
+
(v, i) => buildDay(currentFullYear, currentMonth, i + 1)
|
|
84
|
+
);
|
|
85
|
+
const weekDays = Array.from({ length: dayOfWeek }).map((v, i) => (weekFirst + i) % dayOfWeek);
|
|
86
|
+
const monthDaysFirst = new Date(f(calendarDays).dateStr).getDay();
|
|
87
|
+
const monthDaysLast = new Date(l(calendarDays).dateStr).getDay();
|
|
88
|
+
const padCalendarDays = getPadCalendarDays({ calendarDays, buildDay });
|
|
89
|
+
let count = monthDaysFirst !== f(weekDays) ? weekDays.indexOf(monthDaysFirst) : dayOfWeek;
|
|
90
|
+
padCalendarDays("s", count, new Date(f(calendarDays).dateStr));
|
|
91
|
+
count = monthDaysLast !== l(weekDays) ? dayOfWeek - 1 - weekDays.indexOf(monthDaysLast) : dayOfWeek;
|
|
92
|
+
padCalendarDays("e", count, new Date(l(calendarDays).dateStr));
|
|
93
|
+
setDayRow({ calendarDays, state });
|
|
94
|
+
if (!equalArr(state.weekDays, weekDays)) {
|
|
95
|
+
state.weekDays = weekDays;
|
|
96
|
+
}
|
|
97
|
+
state.calendarDays = calendarDays;
|
|
98
|
+
state.currentYear = `${currentFullYear}`;
|
|
99
|
+
state.currentMonth = `${currentMonth}`;
|
|
100
|
+
state.currentDate = `${currentDate}`;
|
|
101
|
+
state.cascaderCurrent = [currentFullYear, currentMonth];
|
|
102
|
+
};
|
|
103
|
+
const setStackRows = (state) => {
|
|
104
|
+
const { calendarDays } = state;
|
|
105
|
+
if (Array.isArray(calendarDays) && calendarDays.length) {
|
|
106
|
+
const currentDay = calendarDays.find((day) => day.isCur);
|
|
107
|
+
const allRows = [...new Set(calendarDays.map((day) => day.row))];
|
|
108
|
+
const index = allRows.indexOf(currentDay.row);
|
|
109
|
+
const stackRows = allRows.slice(index + 1).reverse().concat(allRows.slice(0, index));
|
|
110
|
+
state.stackRows = stackRows;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const computedCurrentRow = (state) => () => {
|
|
114
|
+
const { calendarDays } = state;
|
|
115
|
+
setStackRows(state);
|
|
116
|
+
if (Array.isArray(calendarDays) && calendarDays.length) {
|
|
117
|
+
const currentDay = calendarDays.find((day) => day.isCur);
|
|
118
|
+
if (currentDay) {
|
|
119
|
+
return currentDay.row;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return null;
|
|
123
|
+
};
|
|
124
|
+
const computedFilteredCalendarDays = (state) => () => {
|
|
125
|
+
const { calendarDays, currentRow, visibleRows } = state;
|
|
126
|
+
if (Array.isArray(calendarDays) && calendarDays.length && currentRow !== null) {
|
|
127
|
+
const rows = [...visibleRows, currentRow];
|
|
128
|
+
return calendarDays.filter((day) => ~rows.indexOf(day.row));
|
|
129
|
+
}
|
|
130
|
+
return [];
|
|
131
|
+
};
|
|
132
|
+
const clearVisibleRows = (state) => state.visibleRows = [];
|
|
133
|
+
const fillVisibleRows = (state) => state.visibleRows = [...new Set((state.calendarDays || []).map((day) => day.row))];
|
|
134
|
+
const handleDraggerClick = (state) => () => {
|
|
135
|
+
const { visibleRows } = state;
|
|
136
|
+
if (state.dragging)
|
|
137
|
+
return;
|
|
138
|
+
if (Array.isArray(visibleRows) && visibleRows.length) {
|
|
139
|
+
clearVisibleRows(state);
|
|
140
|
+
} else {
|
|
141
|
+
fillVisibleRows(state);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
const handleClickDay = ({ api, emit, props }) => (day) => {
|
|
145
|
+
if (day.isCur || day.disabled)
|
|
146
|
+
return;
|
|
147
|
+
if (typeof day.dateStr === "string") {
|
|
148
|
+
api.getCalendarDays(day.dateStr, props.config);
|
|
149
|
+
emit("update:modelValue", day.dateStr);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
const calcCalendarItemHeight = ({ state, vm }) => () => {
|
|
153
|
+
const calendarPanel = vm.$refs.calendarPanel;
|
|
154
|
+
if (calendarPanel && calendarPanel.childNodes instanceof NodeList && calendarPanel.childNodes.length > 1) {
|
|
155
|
+
setTimeout(() => {
|
|
156
|
+
state.itemHeight = calendarPanel.childNodes[1].offsetHeight;
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
const computedTotalRows = (state) => () => {
|
|
161
|
+
const { calendarDays, dayOfWeek } = state;
|
|
162
|
+
const total = Math.floor(calendarDays.length / dayOfWeek);
|
|
163
|
+
return total;
|
|
164
|
+
};
|
|
165
|
+
const dragStart = ({ state, vm, clientX, clientY }) => {
|
|
166
|
+
state.dragPosStart = state.dragPos = { clientX, clientY };
|
|
167
|
+
state.calendarPanelHeight = vm.$refs.calendarPanel.offsetHeight;
|
|
168
|
+
state.stackRowsCopy = state.stackRows.slice(0);
|
|
169
|
+
};
|
|
170
|
+
const dragEnd = ({ state, vm, clientY }) => {
|
|
171
|
+
const dy = clientY - state.dragPosStart.clientY;
|
|
172
|
+
state.dragPosStart = state.dragPos = {};
|
|
173
|
+
vm.$refs.calendarPanel.style.height = "auto";
|
|
174
|
+
if (dy > 0) {
|
|
175
|
+
fillVisibleRows(state);
|
|
176
|
+
} else if (dy < 0) {
|
|
177
|
+
clearVisibleRows(state);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
const dragMove = ({ state, vm, clientX, clientY }) => {
|
|
181
|
+
const { dragPos: lastPos, itemHeight, totalRows, stackRowsCopy, currentRow } = state;
|
|
182
|
+
const minH = itemHeight;
|
|
183
|
+
const maxH = itemHeight * totalRows;
|
|
184
|
+
state.dragPos = { clientX, clientY };
|
|
185
|
+
state.calendarPanelHeight += clientY - lastPos.clientY;
|
|
186
|
+
let h = state.calendarPanelHeight;
|
|
187
|
+
h = h < minH ? minH : h > maxH ? maxH : h;
|
|
188
|
+
const showRows = Math.floor(h / itemHeight);
|
|
189
|
+
vm.$refs.calendarPanel.style.height = `${h}px`;
|
|
190
|
+
state.visibleRows = stackRowsCopy.slice(0).concat(currentRow).reverse().slice(0, showRows);
|
|
191
|
+
};
|
|
192
|
+
const handleDraggerMousedown = ({ api, state, vm }) => (e) => {
|
|
193
|
+
const { clientX, clientY } = e;
|
|
194
|
+
dragStart({ state, vm, clientX, clientY });
|
|
195
|
+
document.addEventListener("mouseup", api.handleMouseup);
|
|
196
|
+
document.addEventListener("mousemove", api.throttledHandleMousemove);
|
|
197
|
+
};
|
|
198
|
+
const handleMouseup = ({ api, state, vm }) => (e) => {
|
|
199
|
+
setTimeout(() => state.dragging = false);
|
|
200
|
+
document.removeEventListener("mouseup", api.handleMouseup);
|
|
201
|
+
document.removeEventListener("mousemove", api.throttledHandleMousemove);
|
|
202
|
+
dragEnd({ state, vm, clientY: e.clientY });
|
|
203
|
+
};
|
|
204
|
+
const handleMousemove = ({ state, vm }) => (e) => {
|
|
205
|
+
state.dragging = true;
|
|
206
|
+
const { clientX, clientY } = e;
|
|
207
|
+
dragMove({ state, vm, clientX, clientY });
|
|
208
|
+
};
|
|
209
|
+
const handleDraggerTouchstart = ({ state, vm }) => (e) => {
|
|
210
|
+
const { clientX, clientY } = e.changedTouches[0];
|
|
211
|
+
state.touching = true;
|
|
212
|
+
dragStart({ state, vm, clientX, clientY });
|
|
213
|
+
};
|
|
214
|
+
const handleDraggerTouchend = ({ state, vm }) => (e) => {
|
|
215
|
+
const { clientY } = e.changedTouches[0];
|
|
216
|
+
state.touching = false;
|
|
217
|
+
dragEnd({ state, vm, clientY });
|
|
218
|
+
};
|
|
219
|
+
const handleDraggerTouchmove = ({ state, vm }) => (e) => {
|
|
220
|
+
const { clientX, clientY } = e.changedTouches[0];
|
|
221
|
+
dragMove({ state, vm, clientX, clientY });
|
|
222
|
+
};
|
|
223
|
+
const setCascaderVisible = (state) => (value) => state.cascaderVisible = !!value;
|
|
224
|
+
const handleCascaderChange = ({ api, emit, props, state }) => (val) => {
|
|
225
|
+
const { currentDate } = state;
|
|
226
|
+
let dateStr = `${val[0]}-${pad0(val[1])}-${pad0(currentDate)}`;
|
|
227
|
+
const numberCurrentDate = Number(currentDate);
|
|
228
|
+
const { currentFullYear: curYear, currentMonth: curMonth, currentDate: curDate } = splitDate(new Date(dateStr));
|
|
229
|
+
if (curYear !== val[0] || curMonth !== val[1] || curDate !== numberCurrentDate) {
|
|
230
|
+
dateStr = `${val[0]}-${pad0(val[1])}-01`;
|
|
231
|
+
}
|
|
232
|
+
api.getCalendarDays(dateStr, props.config);
|
|
233
|
+
emit("update:modelValue", dateStr);
|
|
234
|
+
};
|
|
235
|
+
const computeCascaderOptions = (t) => () => [
|
|
236
|
+
{
|
|
237
|
+
range: [2e3, 2050],
|
|
238
|
+
optionMethod: (i) => ({ id: i, label: t("ui.calendarBar.year").replace("%s", String(i)) })
|
|
239
|
+
},
|
|
240
|
+
{ range: [1, 12], optionMethod: (i) => ({ id: i, label: t(`ui.calendarBar.month.${i}`) }) }
|
|
241
|
+
];
|
|
242
|
+
const i18nYearMonth = ({ state, t }) => () => {
|
|
243
|
+
const { currentYear, currentMonth } = state;
|
|
244
|
+
let template = t("ui.calendarBar.yearMonth");
|
|
245
|
+
const monthAbbr = t(`ui.calendarBar.monthAbbr.${currentMonth}`);
|
|
246
|
+
template = template.replace("%y", currentYear);
|
|
247
|
+
template = template.replace("%m", monthAbbr);
|
|
248
|
+
return template;
|
|
249
|
+
};
|
|
250
|
+
export {
|
|
251
|
+
calcCalendarItemHeight,
|
|
252
|
+
computeCascaderOptions,
|
|
253
|
+
computedCurrentRow,
|
|
254
|
+
computedFilteredCalendarDays,
|
|
255
|
+
computedTotalRows,
|
|
256
|
+
getCalendarDays,
|
|
257
|
+
handleCascaderChange,
|
|
258
|
+
handleClickDay,
|
|
259
|
+
handleDraggerClick,
|
|
260
|
+
handleDraggerMousedown,
|
|
261
|
+
handleDraggerTouchend,
|
|
262
|
+
handleDraggerTouchmove,
|
|
263
|
+
handleDraggerTouchstart,
|
|
264
|
+
handleMousemove,
|
|
265
|
+
handleMouseup,
|
|
266
|
+
i18nYearMonth,
|
|
267
|
+
setCascaderVisible
|
|
268
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
import {
|
|
3
|
+
getCalendarDays,
|
|
4
|
+
computedCurrentRow,
|
|
5
|
+
computedFilteredCalendarDays,
|
|
6
|
+
handleDraggerClick,
|
|
7
|
+
handleClickDay,
|
|
8
|
+
calcCalendarItemHeight,
|
|
9
|
+
computedTotalRows,
|
|
10
|
+
handleDraggerMousedown,
|
|
11
|
+
handleMouseup,
|
|
12
|
+
handleMousemove,
|
|
13
|
+
handleDraggerTouchstart,
|
|
14
|
+
handleDraggerTouchend,
|
|
15
|
+
handleDraggerTouchmove,
|
|
16
|
+
setCascaderVisible,
|
|
17
|
+
handleCascaderChange,
|
|
18
|
+
computeCascaderOptions,
|
|
19
|
+
i18nYearMonth
|
|
20
|
+
} from "./index";
|
|
21
|
+
import throttle from "../common/deps/throttle";
|
|
22
|
+
const api = [
|
|
23
|
+
"state",
|
|
24
|
+
"handleDraggerClick",
|
|
25
|
+
"handleClickDay",
|
|
26
|
+
"handleDraggerMousedown",
|
|
27
|
+
"handleDraggerTouchstart",
|
|
28
|
+
"handleDraggerTouchend",
|
|
29
|
+
"throttledHandleDraggerTouchmove",
|
|
30
|
+
"setCascaderVisible",
|
|
31
|
+
"handleCascaderChange",
|
|
32
|
+
"i18nYearMonth"
|
|
33
|
+
];
|
|
34
|
+
const renderless = (props, { reactive, computed, onBeforeMount, onMounted }, { emit, vm, t }) => {
|
|
35
|
+
const state = reactive({
|
|
36
|
+
minSize2: "min-width: 3rem; min-height: 2rem",
|
|
37
|
+
minSize3: "min-width: 3rem; min-height: 3rem",
|
|
38
|
+
dayOfWeek: 7,
|
|
39
|
+
weekDays: [],
|
|
40
|
+
calendarDays: [],
|
|
41
|
+
currentYear: "",
|
|
42
|
+
currentMonth: "",
|
|
43
|
+
currentRow: computed(() => api2.computedCurrentRow()),
|
|
44
|
+
filteredCalendarDays: computed(() => api2.computedFilteredCalendarDays()),
|
|
45
|
+
visibleRows: [],
|
|
46
|
+
itemHeight: 0,
|
|
47
|
+
totalRows: computed(() => api2.computedTotalRows()),
|
|
48
|
+
dragging: false,
|
|
49
|
+
touching: false,
|
|
50
|
+
cascaderCurrent: [],
|
|
51
|
+
cascaderOptions: computed(() => api2.computeCascaderOptions()),
|
|
52
|
+
cascaderVisible: false
|
|
53
|
+
});
|
|
54
|
+
const api2 = {
|
|
55
|
+
state,
|
|
56
|
+
getCalendarDays: getCalendarDays(state),
|
|
57
|
+
computedCurrentRow: computedCurrentRow(state),
|
|
58
|
+
computedFilteredCalendarDays: computedFilteredCalendarDays(state),
|
|
59
|
+
handleDraggerClick: handleDraggerClick(state),
|
|
60
|
+
calcCalendarItemHeight: calcCalendarItemHeight({ state, vm }),
|
|
61
|
+
computedTotalRows: computedTotalRows(state),
|
|
62
|
+
throttledHandleMousemove: throttle(20, handleMousemove({ state, vm })),
|
|
63
|
+
handleDraggerTouchstart: handleDraggerTouchstart({ state, vm }),
|
|
64
|
+
handleDraggerTouchend: handleDraggerTouchend({ state, vm }),
|
|
65
|
+
throttledHandleDraggerTouchmove: throttle(20, handleDraggerTouchmove({ state, vm })),
|
|
66
|
+
setCascaderVisible: setCascaderVisible(state),
|
|
67
|
+
computeCascaderOptions: computeCascaderOptions(t),
|
|
68
|
+
i18nYearMonth: i18nYearMonth({ state, t })
|
|
69
|
+
};
|
|
70
|
+
Object.assign(api2, {
|
|
71
|
+
handleClickDay: handleClickDay({ api: api2, emit, props }),
|
|
72
|
+
handleDraggerMousedown: handleDraggerMousedown({ api: api2, state, vm }),
|
|
73
|
+
handleMouseup: handleMouseup({ api: api2, state, vm }),
|
|
74
|
+
handleCascaderChange: handleCascaderChange({ api: api2, emit, props, state })
|
|
75
|
+
});
|
|
76
|
+
onBeforeMount(() => {
|
|
77
|
+
api2.getCalendarDays(props.modelValue, props.config);
|
|
78
|
+
});
|
|
79
|
+
onMounted(() => {
|
|
80
|
+
api2.calcCalendarItemHeight();
|
|
81
|
+
});
|
|
82
|
+
return api2;
|
|
83
|
+
};
|
|
84
|
+
export {
|
|
85
|
+
api,
|
|
86
|
+
renderless
|
|
87
|
+
};
|