@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
package/tab-nav/vue.js
CHANGED
|
@@ -18,7 +18,11 @@ import {
|
|
|
18
18
|
scrollNext,
|
|
19
19
|
changeTab,
|
|
20
20
|
setFocus,
|
|
21
|
-
removeFocus
|
|
21
|
+
removeFocus,
|
|
22
|
+
sortableEvent,
|
|
23
|
+
handleTabDragStart,
|
|
24
|
+
handleTabDragEnd,
|
|
25
|
+
watchCurrentName
|
|
22
26
|
} from "./index";
|
|
23
27
|
const api = [
|
|
24
28
|
"state",
|
|
@@ -35,7 +39,7 @@ const api = [
|
|
|
35
39
|
"computedHeaderStyle",
|
|
36
40
|
"swiperHandle"
|
|
37
41
|
];
|
|
38
|
-
const renderless = (props, { computed, inject, onBeforeUnmount, onMounted, onUpdated, reactive }, { parent, refs, mode: tinyMode }) => {
|
|
42
|
+
const renderless = (props, { computed, inject, onBeforeUnmount, onMounted, onUpdated, reactive, markRaw }, { parent, vm, nextTick, refs, mode: tinyMode, emit }) => {
|
|
39
43
|
const api2 = { mounted, beforeUnmount, computedNavStyle, computedSizeName };
|
|
40
44
|
const state = reactive({
|
|
41
45
|
navOffset: 0,
|
|
@@ -68,7 +72,11 @@ const renderless = (props, { computed, inject, onBeforeUnmount, onMounted, onUpd
|
|
|
68
72
|
visibilityChangeHandler: visibilityChangeHandler(state),
|
|
69
73
|
scrollToActiveTab: scrollToActiveTab({ props, parent, refs, state }),
|
|
70
74
|
scrollIntoView: scrollIntoView({ props, parent, refs, state }),
|
|
71
|
-
computedHeaderStyle: computedHeaderStyle({ refs, state })
|
|
75
|
+
computedHeaderStyle: computedHeaderStyle({ refs, state }),
|
|
76
|
+
watchCurrentName: watchCurrentName({ nextTick, vm, state }),
|
|
77
|
+
handleTabDragStart: handleTabDragStart({ state, vm, emit }),
|
|
78
|
+
handleTabDragEnd: handleTabDragEnd({ state, vm, nextTick }),
|
|
79
|
+
sortableEvent: sortableEvent({ api: api2, props, state, vm, emit, markRaw })
|
|
72
80
|
});
|
|
73
81
|
Object.assign(api2, { updated: updated({ api: api2, props, refs, state }), changeTab: changeTab(api2) });
|
|
74
82
|
onUpdated(() => api2.updated());
|
package/tabbar-item/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { isObject, isNull } from "
|
|
2
|
+
import { isObject, isNull } from "../common/type";
|
|
3
3
|
const getRouteActive = ({ props, route }) => () => {
|
|
4
4
|
if (props.to && route) {
|
|
5
5
|
const config = isObject(props.to) ? props.to : { path: props.to };
|
package/tabbar-item/vue.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
2
|
import { getRouteActive, onClick, bindChildren, routeTab } from "./index";
|
|
3
|
-
import { xss } from "
|
|
3
|
+
import { xss } from "../common/xss.js";
|
|
4
4
|
const api = ["state", "onClick"];
|
|
5
5
|
const renderless = (props, { computed, onMounted, reactive }, { parent, emit, nextTick, route, router }) => {
|
|
6
6
|
const api2 = {};
|
package/tabs/index.js
CHANGED
|
@@ -27,19 +27,19 @@ const calcPaneInstances = ({ constants, parent, state, childrenHandler }) => (is
|
|
|
27
27
|
state.panes = [];
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
const calcMorePanes = ({ parent, props, state }) => () => {
|
|
30
|
+
const calcMorePanes = ({ parent, props, state, refs }) => () => {
|
|
31
31
|
if (!props.showMoreTabs) {
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
const el = parent.$el;
|
|
35
35
|
const tabs = el.querySelectorAll(".tiny-tabs__item");
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (
|
|
36
|
+
const navRef = refs.nav.$refs;
|
|
37
|
+
const NavWidth = navRef.nav.offsetWidth || 0;
|
|
38
|
+
const tabsHeaderWidth = navRef.navScroll.offsetWidth || 0;
|
|
39
|
+
if (NavWidth > tabsHeaderWidth) {
|
|
40
|
+
for (let i = 0; i < tabs.length; i++) {
|
|
41
|
+
const isHiddenWidth = tabs[i].offsetLeft + tabs[i].offsetWidth / 2;
|
|
42
|
+
if (isHiddenWidth > tabsHeaderWidth) {
|
|
43
43
|
state.showPanesCount = i;
|
|
44
44
|
break;
|
|
45
45
|
}
|
|
@@ -60,7 +60,6 @@ const handleTabClick = ({ api, emit, props, refs }) => (pane, tabName, event) =>
|
|
|
60
60
|
if (pane.disabled) {
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
|
-
event.stopPropagation();
|
|
64
63
|
api.setCurrentName(tabName);
|
|
65
64
|
emit("click", pane, event);
|
|
66
65
|
if (props.showExpandTabs) {
|
package/tabs/vue.js
CHANGED
|
@@ -72,7 +72,7 @@ const renderless = (props, { onMounted, onUpdated, provide, reactive, watch }, {
|
|
|
72
72
|
handleTabRemove: handleTabRemove(emit),
|
|
73
73
|
changeDirection: changeDirection({ props, state }),
|
|
74
74
|
changeCurrentName: changeCurrentName({ emit, state }),
|
|
75
|
-
calcMorePanes: calcMorePanes({ parent, props, state }),
|
|
75
|
+
calcMorePanes: calcMorePanes({ parent, props, state, refs }),
|
|
76
76
|
calcExpandPanes: calcExpandPanes({ parent, props, state }),
|
|
77
77
|
calcPaneInstances: calcPaneInstances({ constants, parent, state, childrenHandler }),
|
|
78
78
|
handleTabDragStart: handleTabDragStart({ emit }),
|
package/tabs-mf/index.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
import { random } from "../common/string";
|
|
3
|
+
import debounce from "../common/deps/debounce";
|
|
4
|
+
const setActive = ({ emit, state, props }) => (name) => {
|
|
5
|
+
const current = state.currentItem ? state.currentItem.name : "";
|
|
6
|
+
if (current && current !== name && props.beforeLeave && !props.beforeLeave(name, current)) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
state.items.forEach((item) => item.selected = item.name === name);
|
|
10
|
+
emit("update:activeName", name);
|
|
11
|
+
emit("update:modelValue", name);
|
|
12
|
+
};
|
|
13
|
+
const addItem = (state) => (item) => {
|
|
14
|
+
state.items = [...state.items, item];
|
|
15
|
+
};
|
|
16
|
+
const addNav = (state) => (nav) => {
|
|
17
|
+
state.navs = [...state.navs, nav];
|
|
18
|
+
};
|
|
19
|
+
const scrollTo = ({ vm, state }) => (name) => {
|
|
20
|
+
const { navs } = state;
|
|
21
|
+
const { $refs } = vm;
|
|
22
|
+
const { tabbar } = $refs;
|
|
23
|
+
const { scroll } = tabbar.$refs;
|
|
24
|
+
const { clientWidth, scrollWidth } = scroll;
|
|
25
|
+
if (name && scrollWidth > clientWidth) {
|
|
26
|
+
const total = navs.length;
|
|
27
|
+
const index = navs.findIndex((nav) => nav.name === name);
|
|
28
|
+
const max = scrollWidth - clientWidth;
|
|
29
|
+
if (~index) {
|
|
30
|
+
scroll.scrollLeft = max / (total - 1) * index;
|
|
31
|
+
tabbar.wheelListener();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const clickMore = (api) => (name) => {
|
|
36
|
+
api.setActive(name);
|
|
37
|
+
api.scrollTo(name);
|
|
38
|
+
};
|
|
39
|
+
const removeItem = ({ state, emit }) => (name) => {
|
|
40
|
+
const itemIndex = state.items.findIndex((item) => item.name === name);
|
|
41
|
+
const navIndex = state.navs.findIndex((item) => item.name === name);
|
|
42
|
+
if (~itemIndex) {
|
|
43
|
+
state.items.splice(itemIndex, 1);
|
|
44
|
+
state.items = [...state.items];
|
|
45
|
+
state.navs.splice(navIndex, 1);
|
|
46
|
+
state.navs = [...state.navs];
|
|
47
|
+
emit("edit", name, "remove");
|
|
48
|
+
emit("close", name);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const wheelListener = ({ vm, api, tabs, state }) => debounce(10, (e) => {
|
|
52
|
+
const { $refs } = vm;
|
|
53
|
+
const { getBoundRect: getBoundRect2 } = api;
|
|
54
|
+
e && e.stopPropagation();
|
|
55
|
+
$refs.scroll && ($refs.scroll.scrollLeft += ((e || {}).deltaY || 0) / 3);
|
|
56
|
+
state.tabMoreWidth = $refs.tabMore && $refs.tabMore.offsetWidth || 0;
|
|
57
|
+
state.navPaddingRight = state.tabMoreWidth + 1;
|
|
58
|
+
const { left, width } = getBoundRect2();
|
|
59
|
+
const barRange = { left, width, reserve: state.tabMoreWidth };
|
|
60
|
+
let { moreList = [], moreLeft = false, moreRight = false } = {};
|
|
61
|
+
tabs.state.navs.forEach((nav) => {
|
|
62
|
+
const { name, rect } = nav.getBoundRect();
|
|
63
|
+
const { left: left2, width: width2 } = rect;
|
|
64
|
+
const navRange = { name, left: left2, width: width2 };
|
|
65
|
+
if (navRange.left < barRange.left || navRange.left + navRange.width > barRange.left + barRange.width - barRange.reserve) {
|
|
66
|
+
moreList.push(navRange.name);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
if (tabs.state.items.length) {
|
|
70
|
+
moreLeft = ~moreList.indexOf(tabs.state.items[0].name);
|
|
71
|
+
moreRight = ~moreList.indexOf(tabs.state.items[tabs.state.items.length - 1].name);
|
|
72
|
+
}
|
|
73
|
+
Object.assign(state, { moreList, moreLeft, moreRight });
|
|
74
|
+
});
|
|
75
|
+
const getBoundRect = (vm) => () => vm.$el.getBoundingClientRect();
|
|
76
|
+
const handleClickDropdownItem = (tabs) => (name) => tabs.clickMore(name);
|
|
77
|
+
const key = (opt) => opt.name + "-" + random();
|
|
78
|
+
const emitAdd = (tabs) => () => {
|
|
79
|
+
tabs.$emit("edit", null, "add");
|
|
80
|
+
tabs.$emit("add");
|
|
81
|
+
};
|
|
82
|
+
const handleNavItemClick = ({ tabs, props }) => () => {
|
|
83
|
+
tabs.setActive(props.navItem.name);
|
|
84
|
+
tabs.$emit("click", props.navItem);
|
|
85
|
+
};
|
|
86
|
+
const getBoundRectNV = ({ vm, props }) => () => ({
|
|
87
|
+
name: props.navItem.name,
|
|
88
|
+
rect: vm.$el.getBoundingClientRect()
|
|
89
|
+
});
|
|
90
|
+
const handleNavItemClose = ({ tabs, props }) => (e) => {
|
|
91
|
+
e.stopPropagation();
|
|
92
|
+
tabs.removeItem(props.navItem.name);
|
|
93
|
+
};
|
|
94
|
+
export {
|
|
95
|
+
addItem,
|
|
96
|
+
addNav,
|
|
97
|
+
clickMore,
|
|
98
|
+
emitAdd,
|
|
99
|
+
getBoundRect,
|
|
100
|
+
getBoundRectNV,
|
|
101
|
+
handleClickDropdownItem,
|
|
102
|
+
handleNavItemClick,
|
|
103
|
+
handleNavItemClose,
|
|
104
|
+
key,
|
|
105
|
+
removeItem,
|
|
106
|
+
scrollTo,
|
|
107
|
+
setActive,
|
|
108
|
+
wheelListener
|
|
109
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
import { addResizeListener, removeResizeListener } from "../common/deps/resize-event";
|
|
3
|
+
import { wheelListener, getBoundRect, handleClickDropdownItem, key, emitAdd } from "./index";
|
|
4
|
+
import { getAddWheelListener } from "./wheel";
|
|
5
|
+
const { addWheelListener, removeWheelListener } = getAddWheelListener(window, document);
|
|
6
|
+
const api = ["state", "wheelListener", "handleClickDropdownItem", "key", "emitAdd"];
|
|
7
|
+
const renderless = (props, { onMounted, onBeforeUnmount, reactive, watch, inject, computed }, { vm }) => {
|
|
8
|
+
const tabs = inject("tabs", null);
|
|
9
|
+
const state = reactive({
|
|
10
|
+
moreList: [],
|
|
11
|
+
moreLeft: false,
|
|
12
|
+
moreRight: false,
|
|
13
|
+
moreOptions: [],
|
|
14
|
+
tabMoreWidth: 0,
|
|
15
|
+
navPaddingRight: 0,
|
|
16
|
+
withAdd: computed(() => tabs.withAdd),
|
|
17
|
+
slotCustom: tabs.slots.custom
|
|
18
|
+
});
|
|
19
|
+
const api2 = {
|
|
20
|
+
getBoundRect: getBoundRect(vm),
|
|
21
|
+
handleClickDropdownItem: handleClickDropdownItem(tabs),
|
|
22
|
+
key,
|
|
23
|
+
emitAdd: emitAdd(tabs)
|
|
24
|
+
};
|
|
25
|
+
Object.assign(api2, {
|
|
26
|
+
state,
|
|
27
|
+
wheelListener: wheelListener({ vm, api: api2, tabs, state })
|
|
28
|
+
});
|
|
29
|
+
watch(
|
|
30
|
+
() => state.moreList,
|
|
31
|
+
() => {
|
|
32
|
+
state.moreOptions = state.moreList.map((name) => tabs.state.items.find((item) => item.name === name));
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
onMounted(() => {
|
|
36
|
+
addWheelListener(vm.$refs.scroll, api2.wheelListener);
|
|
37
|
+
addResizeListener(vm.$el, api2.wheelListener);
|
|
38
|
+
api2.wheelListener();
|
|
39
|
+
});
|
|
40
|
+
onBeforeUnmount(() => {
|
|
41
|
+
removeWheelListener(vm.$refs.scroll, api2.wheelListener);
|
|
42
|
+
removeResizeListener(vm.$el, api2.wheelListener);
|
|
43
|
+
});
|
|
44
|
+
return api2;
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
api,
|
|
48
|
+
renderless
|
|
49
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
import { handleNavItemClick, getBoundRectNV, handleNavItemClose } from "./index";
|
|
3
|
+
const api = ["state", "handleNavItemClick", "getBoundRect", "handleNavItemClose"];
|
|
4
|
+
const renderless = (props, { inject, markRaw, reactive, computed }, { vm }) => {
|
|
5
|
+
const tabs = inject("tabs", null);
|
|
6
|
+
tabs.addNav(markRaw(vm));
|
|
7
|
+
const state = reactive({
|
|
8
|
+
tabSize: computed(() => tabs.size),
|
|
9
|
+
withClose: computed(() => tabs.withClose)
|
|
10
|
+
});
|
|
11
|
+
const api2 = {
|
|
12
|
+
state,
|
|
13
|
+
handleNavItemClick: handleNavItemClick({ tabs, props }),
|
|
14
|
+
getBoundRect: getBoundRectNV({ vm, props }),
|
|
15
|
+
handleNavItemClose: handleNavItemClose({ tabs, props })
|
|
16
|
+
};
|
|
17
|
+
return api2;
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
api,
|
|
21
|
+
renderless
|
|
22
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
const api = ["state"];
|
|
3
|
+
const renderless = (props, { reactive, inject, computed }) => {
|
|
4
|
+
const tabs = inject("tabs", null);
|
|
5
|
+
const state = reactive({
|
|
6
|
+
navItems: computed(() => tabs.state.items)
|
|
7
|
+
});
|
|
8
|
+
return { state };
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
api,
|
|
12
|
+
renderless
|
|
13
|
+
};
|
package/tabs-mf/vue.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
import { random } from "../common/string";
|
|
3
|
+
import { setActive, addItem, addNav, scrollTo, clickMore, removeItem } from "./index";
|
|
4
|
+
const api = ["state", "setActive", "addItem", "addNav", "scrollTo", "clickMore", "removeItem"];
|
|
5
|
+
const renderless = (props, { onMounted, onBeforeUnmount, provide, reactive, watch, computed }, { vm, emit }) => {
|
|
6
|
+
const state = reactive({
|
|
7
|
+
items: [],
|
|
8
|
+
navs: [],
|
|
9
|
+
currentItem: computed(() => state.items.find((item) => item.selected)),
|
|
10
|
+
key: computed(() => state.currentItem ? state.currentItem.name : random())
|
|
11
|
+
});
|
|
12
|
+
const api2 = {
|
|
13
|
+
setActive: setActive({ emit, state, props }),
|
|
14
|
+
addItem: addItem(state),
|
|
15
|
+
addNav: addNav(state),
|
|
16
|
+
scrollTo: scrollTo({ vm, state }),
|
|
17
|
+
removeItem: removeItem({ state, emit })
|
|
18
|
+
};
|
|
19
|
+
Object.assign(api2, {
|
|
20
|
+
state,
|
|
21
|
+
clickMore: clickMore(api2)
|
|
22
|
+
});
|
|
23
|
+
provide("tabs", vm);
|
|
24
|
+
watch(
|
|
25
|
+
() => props.activeName,
|
|
26
|
+
(name) => name && api2.setActive(name)
|
|
27
|
+
);
|
|
28
|
+
watch(
|
|
29
|
+
() => props.modelValue,
|
|
30
|
+
(name) => name && api2.setActive(name)
|
|
31
|
+
);
|
|
32
|
+
onMounted(() => {
|
|
33
|
+
props.activeName && api2.scrollTo(props.activeName);
|
|
34
|
+
props.modelValue && api2.scrollTo(props.modelValue);
|
|
35
|
+
});
|
|
36
|
+
onBeforeUnmount(() => {
|
|
37
|
+
state.navs.forEach((n, i) => state.navs[i] = null);
|
|
38
|
+
state.navs.length = 0;
|
|
39
|
+
});
|
|
40
|
+
return api2;
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
api,
|
|
44
|
+
renderless
|
|
45
|
+
};
|
package/tabs-mf/wheel.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
const getAddWheelListener = (window, document) => {
|
|
3
|
+
const { addApiName, removeApiName, prefix } = detectEventModel(window);
|
|
4
|
+
const support = detectAvailableWheelEvent(document);
|
|
5
|
+
const params = { addApiName, removeApiName, prefix, support, window };
|
|
6
|
+
const { add, remove } = getWheelListener(params);
|
|
7
|
+
return {
|
|
8
|
+
addWheelListener: (elem, callback, useCapture) => {
|
|
9
|
+
support === "DOMMouseScroll" ? add(elem, "MozMousePixelScroll", callback, useCapture) : add(elem, support, callback, useCapture);
|
|
10
|
+
},
|
|
11
|
+
removeWheelListener: (elem, callback, useCapture) => {
|
|
12
|
+
support === "DOMMouseScroll" ? remove(elem, "MozMousePixelScroll", callback, useCapture) : remove(elem, support, callback, useCapture);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
const detectEventModel = (window) => {
|
|
17
|
+
const flag = window.addEventListener;
|
|
18
|
+
const addApiName = flag ? "addEventListener" : "attachEvent";
|
|
19
|
+
const removeApiName = flag ? "removeEventListener" : "detachEvent";
|
|
20
|
+
const prefix = flag ? "" : "on";
|
|
21
|
+
return { addApiName, removeApiName, prefix };
|
|
22
|
+
};
|
|
23
|
+
const detectAvailableWheelEvent = (document) => {
|
|
24
|
+
let support;
|
|
25
|
+
if ("onwheel" in document.createElement("div")) {
|
|
26
|
+
support = "wheel";
|
|
27
|
+
} else if (document.onmousewheel !== void 0) {
|
|
28
|
+
support = "mousewheel";
|
|
29
|
+
} else {
|
|
30
|
+
support = "DOMMouseScroll";
|
|
31
|
+
}
|
|
32
|
+
return support;
|
|
33
|
+
};
|
|
34
|
+
const elemCbMap = /* @__PURE__ */ new WeakMap();
|
|
35
|
+
const getWheelListener = ({ addApiName, removeApiName, prefix, support, window }) => ({
|
|
36
|
+
add: (elem, eventName, callback, useCapture) => {
|
|
37
|
+
let cb = callback;
|
|
38
|
+
if (support !== "wheel") {
|
|
39
|
+
cb = (oEvent) => {
|
|
40
|
+
!oEvent && (oEvent = window.event);
|
|
41
|
+
const event = {
|
|
42
|
+
originalEvent: oEvent,
|
|
43
|
+
target: oEvent.target || oEvent.srcElement,
|
|
44
|
+
type: "wheel",
|
|
45
|
+
deltaMode: oEvent.type === "MozMousePixelScroll" ? 0 : 1,
|
|
46
|
+
deltaX: 0,
|
|
47
|
+
deltaZ: 0,
|
|
48
|
+
preventDefault: () => {
|
|
49
|
+
oEvent.preventDefault ? oEvent.preventDefault() : oEvent.returnValue = false;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
if (support === "mousewheel") {
|
|
53
|
+
event.deltaY = -1 / 40 * oEvent.wheelDelta;
|
|
54
|
+
oEvent.wheelDeltaX && (event.deltaX = -1 / 40 * oEvent.wheelDeltaX);
|
|
55
|
+
} else {
|
|
56
|
+
event.deltaY = oEvent.detail;
|
|
57
|
+
}
|
|
58
|
+
return callback(event);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
elemCbMap.set(elem, cb);
|
|
62
|
+
elem[addApiName](prefix + eventName, cb, useCapture || false);
|
|
63
|
+
},
|
|
64
|
+
remove: (elem, eventName, callback, useCapture) => {
|
|
65
|
+
const cb = elemCbMap.get(elem);
|
|
66
|
+
elem[removeApiName](prefix + eventName, cb, useCapture || false);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
export {
|
|
70
|
+
getAddWheelListener
|
|
71
|
+
};
|
package/tag/index.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
const handleClose = ({ emit, props }) => (event) => {
|
|
2
|
+
const handleClose = ({ emit, props, state }) => (event) => {
|
|
3
|
+
if (props.disabled)
|
|
4
|
+
return;
|
|
3
5
|
event.stopPropagation();
|
|
6
|
+
state.show = false;
|
|
4
7
|
const close = () => emit("close", event);
|
|
5
8
|
props.beforeDelete ? props.beforeDelete(close) : close();
|
|
6
9
|
};
|
|
7
|
-
const handleClick = ({ emit, parent }) => (event) => {
|
|
10
|
+
const handleClick = ({ emit, props, parent, state }) => (event) => {
|
|
11
|
+
if (props.selectable || props.disabled)
|
|
12
|
+
return;
|
|
8
13
|
parent.$parent && parent.$parent.tagSelectable && event.stopPropagation();
|
|
14
|
+
state.selected = !state.selected;
|
|
9
15
|
emit("click", event);
|
|
10
16
|
};
|
|
11
17
|
export {
|
package/tag/vue.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
2
|
import { handleClose, handleClick } from "./index";
|
|
3
|
-
const api = ["handleClose", "handleClick"];
|
|
4
|
-
const renderless = (props,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
const api = ["state", "handleClose", "handleClick"];
|
|
4
|
+
const renderless = (props, { reactive, computed }, { emit, parent }) => {
|
|
5
|
+
const state = reactive({
|
|
6
|
+
type: computed(() => props.theme || props.type),
|
|
7
|
+
show: true,
|
|
8
|
+
selected: false
|
|
9
|
+
});
|
|
10
|
+
const api2 = {
|
|
11
|
+
handleClose: handleClose({ emit, props, state }),
|
|
12
|
+
handleClick: handleClick({ emit, props, parent, state })
|
|
13
|
+
};
|
|
14
|
+
return Object.assign(api2, { state });
|
|
15
|
+
};
|
|
8
16
|
export {
|
|
9
17
|
api,
|
|
10
18
|
renderless
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
const getHiddenTags = ({ props, vm, state }) => () => {
|
|
3
|
+
if (!props.data.length)
|
|
4
|
+
return;
|
|
5
|
+
const tagGroup = vm.$refs.tagGroup || {};
|
|
6
|
+
const tags = tagGroup.children;
|
|
7
|
+
const moreDom = vm.$refs.more || {};
|
|
8
|
+
const height = tags[0] && tags[0].getBoundingClientRect().height + "px";
|
|
9
|
+
tagGroup.style && (tagGroup.style.height = height);
|
|
10
|
+
moreDom.style && (moreDom.style.height = height);
|
|
11
|
+
state.hiddenTags = [];
|
|
12
|
+
Array.from(tags).forEach((el, index) => {
|
|
13
|
+
if (el.offsetTop > 0) {
|
|
14
|
+
state.hiddenTags.push({
|
|
15
|
+
name: el.innerText,
|
|
16
|
+
type: props.data[index] && props.data[index].type
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
state.showMore = !!state.hiddenTags.length;
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
getHiddenTags
|
|
24
|
+
};
|
package/tag-group/vue.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
import { addResizeListener, removeResizeListener } from "../common/deps/resize-event";
|
|
3
|
+
import debounce from "../common/deps/debounce";
|
|
4
|
+
import { getHiddenTags } from "./index";
|
|
5
|
+
const api = ["state"];
|
|
6
|
+
const renderless = (props, { onMounted, onBeforeUnmount, reactive }, { vm }) => {
|
|
7
|
+
const delay = 100;
|
|
8
|
+
const state = reactive({
|
|
9
|
+
showMore: false,
|
|
10
|
+
hiddenTags: []
|
|
11
|
+
});
|
|
12
|
+
const api2 = {
|
|
13
|
+
state,
|
|
14
|
+
getHiddenTags: getHiddenTags({ props, vm, state })
|
|
15
|
+
};
|
|
16
|
+
onMounted(() => {
|
|
17
|
+
api2.getHiddenTags();
|
|
18
|
+
api2.debouncedGetHiddenTags = debounce(delay, api2.getHiddenTags);
|
|
19
|
+
addResizeListener(vm.$refs.tagGroup, debounce(delay, api2.debouncedGetHiddenTags));
|
|
20
|
+
});
|
|
21
|
+
onBeforeUnmount(() => {
|
|
22
|
+
removeResizeListener(vm.$refs.tagGroup, api2.debouncedGetHiddenTags);
|
|
23
|
+
});
|
|
24
|
+
return api2;
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
api,
|
|
28
|
+
renderless
|
|
29
|
+
};
|
package/tall-storage/index.js
CHANGED
package/tall-storage/vue.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
2
|
import { mousedown, selectItem, keydown } from "./index";
|
|
3
|
-
import { on, off } from "
|
|
3
|
+
import { on, off } from "../common/deps/dom";
|
|
4
4
|
const api = ["state", "mousedown", "selectItem"];
|
|
5
5
|
const renderless = (props, { onUnmounted, reactive, watch }, { emit }) => {
|
|
6
6
|
const state = reactive({
|
package/time/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { limitTimeRange, clearMilliseconds, timeWithinRange } from "
|
|
2
|
+
import { limitTimeRange, clearMilliseconds, timeWithinRange } from "../common/deps/date-util";
|
|
3
3
|
const watchValue = ({ api, nextTick, state }) => (value) => {
|
|
4
4
|
let date;
|
|
5
5
|
if (value instanceof Date) {
|
package/time/vue.js
CHANGED
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
setSelectionRange,
|
|
12
12
|
handleConfirm
|
|
13
13
|
} from "./index";
|
|
14
|
-
import { compuAmPmMode } from "
|
|
15
|
-
import { isDate } from "
|
|
14
|
+
import { compuAmPmMode } from "../time-range";
|
|
15
|
+
import { isDate } from "../common/deps/date-util";
|
|
16
16
|
const api = ["state", "handleChange", "setSelectionRange", "handleCancel", "handleConfirm", "adjustSpinners"];
|
|
17
17
|
const initState = ({ reactive, props, computed, api: api2 }) => {
|
|
18
18
|
const state = reactive({
|
package/time-line/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { format } from "
|
|
2
|
+
import { format } from "../common/date";
|
|
3
3
|
const getDate = (dateTime) => ({
|
|
4
4
|
date: format(dateTime, "yyyy-MM-dd"),
|
|
5
5
|
time: format(dateTime, "hh:mm")
|
|
@@ -9,24 +9,45 @@ const getStatus = ({ state, t }) => (value) => {
|
|
|
9
9
|
return status > 0 ? t("ui.steps.done") : status === 0 ? t("ui.steps.doing") : t("ui.steps.wait");
|
|
10
10
|
};
|
|
11
11
|
const handleClick = ({ emit, state }) => ({ index, node }) => {
|
|
12
|
-
|
|
12
|
+
if (!node.disabled) {
|
|
13
|
+
emit("click", state.isReverse ? state.nodes.length - index - 1 : index, node);
|
|
14
|
+
}
|
|
13
15
|
};
|
|
14
|
-
const getStatusCls = ({ constants, state }) => (index) => {
|
|
15
|
-
const { PROCESS_DONE_CLS, PROCESS_CUR_CLS, PROCESS_WAIT_CLS } = constants;
|
|
16
|
+
const getStatusCls = ({ constants, state }) => (index, node) => {
|
|
17
|
+
const { PROCESS_DONE_CLS, PROCESS_CUR_CLS, PROCESS_WAIT_CLS, PROCESS_DISABLED_CLS, PROCESS_ERROR_CLS } = constants;
|
|
16
18
|
const cls = {};
|
|
17
19
|
const reverse = state.isReverse;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
if (node == null ? void 0 : node.disabled) {
|
|
21
|
+
cls[PROCESS_DISABLED_CLS] = true;
|
|
22
|
+
} else if (node == null ? void 0 : node.error) {
|
|
23
|
+
cls[PROCESS_ERROR_CLS] = true;
|
|
24
|
+
} else {
|
|
25
|
+
cls[PROCESS_DONE_CLS] = reverse ? index > state.current : index < state.current;
|
|
26
|
+
cls[PROCESS_CUR_CLS] = index === state.current;
|
|
27
|
+
cls[PROCESS_WAIT_CLS] = reverse ? index < state.current : index > state.current;
|
|
28
|
+
}
|
|
21
29
|
return cls;
|
|
22
30
|
};
|
|
23
31
|
const computedData = ({ props, state }) => () => state.isReverse ? props.data.map((item, i) => props.data[props.data.length - 1 - i]) : props.data;
|
|
24
32
|
const computedCurrent = ({ props, state }) => () => state.isReverse ? state.nodes.length - props.active - 1 : props.active;
|
|
25
33
|
const computedIsReverse = (props) => () => props.reverse && props.vertical;
|
|
34
|
+
const computedStackNodes = ({ state, constants }) => () => {
|
|
35
|
+
if (state.nodes.length >= constants.STACK_NODES_MAX) {
|
|
36
|
+
state.showData = true;
|
|
37
|
+
return state.nodes.slice(0, constants.LIMITED_STACK_NODES);
|
|
38
|
+
}
|
|
39
|
+
return state.nodes;
|
|
40
|
+
};
|
|
41
|
+
const changeStatus = ({ state }) => () => {
|
|
42
|
+
state.showAll = !state.showAll;
|
|
43
|
+
return state.showAll;
|
|
44
|
+
};
|
|
26
45
|
export {
|
|
46
|
+
changeStatus,
|
|
27
47
|
computedCurrent,
|
|
28
48
|
computedData,
|
|
29
49
|
computedIsReverse,
|
|
50
|
+
computedStackNodes,
|
|
30
51
|
getDate,
|
|
31
52
|
getStatus,
|
|
32
53
|
getStatusCls,
|
package/time-line/vue.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { handleClick, getStatusCls, getStatus, computedData, getDate, computedCurrent, computedIsReverse } from "./index";
|
|
3
|
-
const api = ["state", "handleClick", "getStatusCls", "getStatus", "getDate"];
|
|
2
|
+
import { handleClick, getStatusCls, getStatus, computedData, getDate, computedCurrent, computedIsReverse, changeStatus, computedStackNodes } from "./index";
|
|
3
|
+
const api = ["state", "handleClick", "getStatusCls", "getStatus", "getDate", "changeStatus"];
|
|
4
4
|
const renderless = (props, { computed, reactive }, { t, emit, constants }) => {
|
|
5
5
|
const api2 = {};
|
|
6
6
|
const state = reactive({
|
|
7
7
|
nodes: computed(() => api2.computedData()),
|
|
8
8
|
current: computed(() => api2.computedCurrent()),
|
|
9
|
-
isReverse: computed(() => api2.computedIsReverse())
|
|
9
|
+
isReverse: computed(() => api2.computedIsReverse()),
|
|
10
|
+
stackNodes: computed(() => state.showAll ? state.nodes : api2.computedStackNodes()),
|
|
11
|
+
showData: false,
|
|
12
|
+
showAll: false
|
|
10
13
|
});
|
|
11
14
|
Object.assign(api2, {
|
|
12
15
|
state,
|
|
@@ -16,7 +19,9 @@ const renderless = (props, { computed, reactive }, { t, emit, constants }) => {
|
|
|
16
19
|
computedIsReverse: computedIsReverse(props),
|
|
17
20
|
getStatus: getStatus({ state, t }),
|
|
18
21
|
handleClick: handleClick({ emit, state, api: api2 }),
|
|
19
|
-
getStatusCls: getStatusCls({ constants, props, state })
|
|
22
|
+
getStatusCls: getStatusCls({ constants, props, state }),
|
|
23
|
+
computedStackNodes: computedStackNodes({ state, constants }),
|
|
24
|
+
changeStatus: changeStatus({ state })
|
|
20
25
|
});
|
|
21
26
|
return api2;
|
|
22
27
|
};
|
package/time-panel/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import scrollIntoView from "
|
|
3
|
-
import { DATEPICKER } from "
|
|
2
|
+
import scrollIntoView from "../common/deps/scroll-into-view";
|
|
3
|
+
import { DATEPICKER } from "../common";
|
|
4
4
|
const parseTime = () => (time) => {
|
|
5
5
|
const values = (time || "").split(":");
|
|
6
6
|
if (values.length >= 2) {
|
package/time-panel/vue.js
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
emitPick,
|
|
17
17
|
emitDestroy
|
|
18
18
|
} from "./index";
|
|
19
|
-
import { DATEPICKER } from "
|
|
19
|
+
import { DATEPICKER } from "../common";
|
|
20
20
|
const api = ["state", "handleMenuEnter", "handleClick", "handleClear", "emitDestroy"];
|
|
21
21
|
const initState = ({ reactive, computed, api: api2 }) => {
|
|
22
22
|
const { Start, End, Step } = DATEPICKER;
|