@opentiny/vue-renderless 3.13.2 → 3.14.1
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 +20 -13
- package/action-sheet/vue.js +8 -7
- package/amount/index.js +100 -25
- package/amount/vue.js +102 -26
- package/anchor/index.js +1 -0
- package/area/index.js +8 -8
- package/area/vue.js +5 -5
- package/async-flowchart/index.js +16 -3
- package/autocomplete/index.js +58 -14
- package/autocomplete/vue.js +40 -12
- package/badge/index.js +12 -0
- package/badge/vue.js +6 -4
- package/breadcrumb/vue.js +3 -1
- package/breadcrumb-item/vue.js +6 -2
- package/button/index.js +5 -1
- package/calendar/index.js +2 -86
- package/calendar-bar/index.js +18 -4
- package/calendar-view/index.js +5 -1
- package/calendar-view/vue.js +16 -3
- package/card-group/vue.js +4 -2
- package/cascader/index.js +86 -34
- package/cascader/vue.js +61 -20
- package/cascader-menu/index.js +7 -7
- package/cascader-menu/vue.js +2 -3
- package/cascader-mobile/index.js +36 -23
- package/cascader-mobile/vue.js +6 -0
- package/cascader-node/index.js +13 -1
- package/cascader-node/vue.js +15 -4
- package/cascader-panel/index.js +1 -1
- package/cascader-select/column-index.js +150 -0
- package/cascader-select/column.js +120 -0
- package/cascader-select/index.js +29 -165
- package/cascader-select/usePicker.js +251 -0
- package/cascader-select/useTouch.js +65 -0
- package/cascader-select/vue.js +35 -47
- package/cell/vue.js +2 -1
- package/chart-bar/index.js +2 -3
- package/chart-core/deps/constants.js +43 -43
- package/chart-core/index.js +1 -1
- package/chart-gauge/index.js +2 -2
- package/chart-heatmap/index.js +17 -10
- package/chart-line/index.js +8 -9
- package/chart-tree/index.js +2 -2
- package/chart-waterfall/index.js +4 -6
- package/checkbox/index.js +18 -1
- package/checkbox/vue.js +15 -7
- package/checkbox-group/vue.js +1 -0
- package/col/vue.js +1 -1
- package/collapse/index.js +3 -3
- package/color-select-panel/vue.js +0 -7
- package/column-list-item/index.js +17 -1
- package/column-list-item/vue.js +8 -3
- package/common/bigInt.js +2 -2
- package/common/date.js +7 -5
- package/common/deps/clickoutside.js +6 -2
- package/common/deps/date-util.js +4 -2
- package/common/deps/dom.js +19 -4
- package/common/deps/popper.js +44 -11
- package/common/deps/resize-event.js +1 -0
- package/common/deps/touch-emulator.js +4 -1
- package/common/deps/tree-model/node.js +2 -2
- package/common/deps/tree-model/tree-store.js +2 -13
- package/common/deps/useRect.js +25 -0
- package/common/deps/vue-popper.js +38 -20
- package/common/index.js +2 -2
- package/common/runtime.js +1 -1
- package/common/string.js +2 -2
- package/common/type.js +2 -1
- package/common/validate/rules/enum.js +1 -1
- package/common/validate/rules/pattern.js +2 -2
- package/common/validate/rules/range.js +8 -5
- package/common/validate/rules/required.js +1 -1
- package/common/validate/rules/type.js +5 -5
- package/common/validate/rules/whitespace.js +1 -1
- package/common/validate/util.js +15 -16
- package/common/validate/validations/integer.js +1 -1
- package/common/validate/validations/method.js +1 -1
- package/currency/index.js +74 -7
- package/currency/vue.js +21 -5
- package/date-panel/index.js +16 -0
- package/date-panel/vue.js +8 -2
- package/date-picker-mobile/index.js +12 -0
- package/date-picker-mobile/vue.js +7 -1
- package/date-range/vue.js +15 -6
- package/date-table/index.js +35 -53
- package/date-table/vue.js +4 -2
- package/dialog-box/index.js +46 -14
- package/dialog-box/vue.js +30 -7
- package/dialog-select/index.js +6 -3
- package/dialog-select/vue.js +8 -4
- package/drawer/index.js +27 -5
- package/drawer/vue.js +14 -7
- package/dropdown/index.js +7 -7
- package/dropdown/vue.js +6 -2
- package/dropdown-item/index.js +9 -1
- package/dropdown-item/mf.js +6 -10
- package/dropdown-item/vue.js +20 -7
- package/dropdown-menu/index.js +20 -7
- package/dropdown-menu/vue.js +4 -3
- package/exception/index.js +2 -7
- package/exception/vue.js +7 -10
- package/fall-menu/index.js +5 -1
- package/fall-menu/vue.js +13 -2
- package/file-upload/index.js +68 -18
- package/file-upload/vue.js +38 -8
- package/filter-box/index.js +1 -0
- package/float-button/index.js +42 -0
- package/float-button/vue.js +101 -0
- package/floating-button/index.js +62 -16
- package/floating-button/vue.js +27 -9
- package/flowchart/index.js +134 -25
- package/flowchart/node.js +13 -4
- package/flowchart/vue.js +16 -4
- package/form/vue.js +8 -0
- package/form-item/index.js +5 -5
- package/form-item/vue.js +3 -1
- package/fullscreen/index.js +5 -5
- package/fullscreen/vue.js +3 -3
- package/grid/plugins/export.js +5 -2
- package/grid/utils/column.js +1 -0
- package/grid/utils/dom.js +7 -1
- package/image/index.js +6 -1
- package/image/vue.js +6 -3
- package/image-viewer/index.js +62 -51
- package/image-viewer/vue.js +17 -5
- package/input/index.js +81 -20
- package/input/vue.js +44 -18
- package/ip-address/index.js +61 -19
- package/ip-address/vue.js +22 -4
- package/link/vue.js +3 -1
- package/loading/index.js +2 -2
- package/loading/vue.js +8 -2
- package/logout/index.js +1 -1
- package/menu/index.js +15 -2
- package/menu/vue.js +22 -17
- package/mind-map/index.js +47 -0
- package/mind-map/vue.js +53 -0
- package/modal/index.js +44 -4
- package/modal/vue.js +18 -4
- package/multi-select/index.js +186 -11
- package/multi-select/vue.js +60 -15
- package/multi-select-item/index.js +23 -0
- package/multi-select-item/vue.js +31 -0
- package/numeric/index.js +48 -12
- package/numeric/vue.js +44 -19
- package/option/index.js +27 -9
- package/option/vue.js +37 -21
- package/option-group/index.js +3 -3
- package/package.json +1 -1
- package/pager/index.js +18 -4
- package/pager/vue.js +16 -5
- package/picker/index.js +290 -77
- package/picker/mb.js +42 -0
- package/picker/vue.js +76 -20
- package/picker-column/index.js +1 -1
- package/pop-upload/vue.js +3 -0
- package/popconfirm/index.js +3 -6
- package/popconfirm/vue.js +1 -1
- package/popeditor/index.js +73 -34
- package/popeditor/vue.js +15 -11
- package/popover/index.js +4 -4
- package/popover/vue.js +6 -6
- package/popup/index.js +3 -3
- package/popup/vue.js +5 -5
- package/pull-refresh/index.js +13 -13
- package/pull-refresh/vue.js +5 -4
- package/radio/index.js +0 -17
- package/radio/vue.js +4 -10
- package/rate/index.js +1 -1
- package/rate/vue.js +0 -2
- package/record/index.js +4 -1
- package/rich-text/clipboard.js +54 -0
- package/rich-text/index.js +192 -0
- package/rich-text/module/file-upload.js +107 -0
- package/rich-text/module/image-drop.js +63 -0
- package/rich-text/module/image-upload.js +89 -0
- package/rich-text/options.js +141 -0
- package/rich-text/table-module.js +382 -0
- package/rich-text/vue.js +102 -0
- package/{rich-text-edtior → rich-text-editor}/index.js +2 -2
- package/{rich-text-edtior → rich-text-editor}/vue.js +2 -5
- package/scrollbar/index.js +11 -11
- package/scrollbar/vue-bar.js +3 -3
- package/scrollbar/vue.js +5 -5
- package/search/index.js +9 -9
- package/search/vue.js +8 -6
- package/select/index.js +442 -393
- package/select/vue.js +278 -164
- package/select-dropdown/index.js +61 -3
- package/select-dropdown/vue.js +85 -8
- package/select-view/index.js +3 -1
- package/selected-box/index.js +2 -0
- package/selected-box/vue.js +6 -3
- package/signature/index.js +241 -0
- package/signature/vue.js +88 -0
- package/skeleton/index.js +14 -0
- package/skeleton/vue.js +15 -0
- package/skeleton-item/vue.js +15 -0
- package/slider/index.js +70 -17
- package/slider/vue.js +16 -7
- package/split/index.js +5 -3
- package/split/vue.js +4 -6
- package/standard-list-item/index.js +15 -1
- package/standard-list-item/vue.js +6 -5
- package/steps/index.js +25 -2
- package/steps/slide-bar.js +8 -1
- package/steps/vue.js +15 -3
- package/tab-item-mf/vue.js +14 -8
- package/tab-nav/index.js +30 -5
- package/tab-nav/vue.js +16 -4
- package/tabbar/vue.js +9 -3
- package/tabbar-item/vue.js +3 -2
- package/tabs/index.js +16 -4
- package/tabs/vue.js +2 -1
- package/tabs-mf/index.js +20 -6
- package/tabs-mf/vue-nav.js +26 -11
- package/tabs-mf/vue.js +7 -7
- package/tabs-mf/wheel.js +1 -0
- package/tag/index.js +1 -1
- package/tag-group/index.js +2 -1
- package/time/index.js +5 -2
- package/time/vue.js +1 -1
- package/time-line/index.js +3 -3
- package/time-line/vue.js +2 -2
- package/time-picker-mobile/index.js +24 -5
- package/time-picker-mobile/vue.js +17 -7
- package/time-range/index.js +2 -0
- package/timeline-item/vue.js +1 -1
- package/tooltip/index.js +6 -3
- package/tooltip/vue.js +4 -4
- package/transfer/index.js +20 -22
- package/transfer/vue.js +1 -6
- package/transfer-panel/vue.js +3 -5
- package/tree/index.js +21 -4
- package/tree/vue.js +10 -8
- package/tree-menu/index.js +29 -3
- package/tree-menu/vue.js +28 -15
- package/tree-node/index.js +18 -18
- package/tree-node/vue.js +6 -5
- package/types/action-sheet.type.d.ts +118 -1
- package/types/amount.type.d.ts +168 -1
- package/types/area.type.d.ts +134 -1
- package/types/async-flowchart.type.d.ts +72 -0
- package/types/autocomplete.type.d.ts +199 -1
- package/types/badge.type.d.ts +3 -1
- package/types/breadcrumb-item.type.d.ts +2 -0
- package/types/breadcrumb.type.d.ts +2 -0
- package/types/button-group.type.d.ts +3 -3
- package/types/button.type.d.ts +4 -0
- package/types/cascader-menu.type.d.ts +3 -4
- package/types/cascader-node.type.d.ts +5 -2
- package/types/cascader-panel.type-2bd03be3.d.ts +241 -0
- package/types/cascader-panel.type.d.ts +3 -241
- package/types/cascader.type.d.ts +329 -1
- package/types/checkbox.type.d.ts +6 -0
- package/types/collapse.type.d.ts +19 -2
- package/types/date-picker.type.d.ts +38 -1
- package/types/dialog-box.type.d.ts +13 -3
- package/types/drawer.type.d.ts +133 -1
- package/types/{dropdown-item.type-8ea6c633.d.ts → dropdown-item.type-8475a549.d.ts} +7 -13
- package/types/dropdown-item.type.d.ts +1 -1
- package/types/dropdown-menu.type.d.ts +1 -1
- package/types/dropdown.type.d.ts +1 -5
- package/types/fall-menu.type.d.ts +94 -1
- package/types/file-upload.type.d.ts +1 -1
- package/types/float-button.type.d.ts +123 -0
- package/types/form-item.type.d.ts +1 -1
- package/types/{form.type-d0fd42f3.d.ts → form.type-a2dc0099.d.ts} +4 -1
- package/types/form.type.d.ts +1 -1
- package/types/{index-e0250f63.d.ts → index-b012f687.d.ts} +9 -0
- package/types/input.type.d.ts +2 -6
- package/types/ip-address.type.d.ts +160 -1
- package/types/link.type.d.ts +6 -3
- package/types/loading.type.d.ts +7 -0
- package/types/mind-map.type.d.ts +20 -0
- package/types/modal.type.d.ts +29 -2
- package/types/numeric.type.d.ts +41 -10
- package/types/pager.type.d.ts +12 -0
- package/types/picker.type.d.ts +18 -0
- package/types/popconfirm.type.d.ts +86 -1
- package/types/popeditor.type.d.ts +4 -0
- package/types/popover.type.d.ts +3 -3
- package/types/progress.type.d.ts +2 -0
- package/types/radio.type.d.ts +0 -4
- package/types/rate.type.d.ts +236 -1
- package/types/search.type.d.ts +88 -1
- package/types/shared.type.d.ts +1 -1
- package/types/skeleton-item.type.d.ts +38 -0
- package/types/skeleton.type.d.ts +45 -0
- package/types/slider.type.d.ts +49 -10
- package/types/steps.type.d.ts +14 -3
- package/types/tab-bar.type.d.ts +1 -1
- package/types/tab-nav.type.d.ts +7 -2
- package/types/tabs.type.d.ts +9 -1
- package/types/tag-group.type.d.ts +64 -1
- package/types/{time-line.type-d7daa669.d.ts → time-line.type-b155cb4f.d.ts} +12 -0
- package/types/time-line.type.d.ts +1 -1
- package/types/timeline-item.type.d.ts +1 -1
- package/types/tooltip.type.d.ts +2 -2
- package/types/transfer.type.d.ts +185 -1
- package/types/tree-menu.type.d.ts +210 -1
- package/types/upload-dragger.type.d.ts +1 -1
- package/types/{upload-list.type-343e8c11.d.ts → upload-list.type-6d6e3d0e.d.ts} +35 -8
- package/types/upload-list.type.d.ts +1 -1
- package/types/upload.type.d.ts +1 -1
- package/types/user-head.type.d.ts +146 -1
- package/types/wizard.type.d.ts +1 -0
- package/upload/index.js +64 -34
- package/upload/vue.js +9 -5
- package/upload-dragger/index.js +22 -20
- package/upload-list/index.js +24 -18
- package/upload-list/vue.js +9 -4
- package/user/index.js +35 -26
- package/user/vue.js +1 -1
- package/user-head/index.js +3 -3
- package/watermark/index.js +11 -0
- package/wheel/index.js +3 -0
- package/wizard/vue.js +4 -2
- package/common/deps/modal-queue.js +0 -6
- package/common/deps/requestAnimationFrame.js +0 -25
package/slider/index.js
CHANGED
|
@@ -53,7 +53,8 @@ const bindMouseDown = ({
|
|
|
53
53
|
constants,
|
|
54
54
|
mode,
|
|
55
55
|
emit,
|
|
56
|
-
state
|
|
56
|
+
state,
|
|
57
|
+
props
|
|
57
58
|
}) => (event) => {
|
|
58
59
|
if (event.button !== 0 && event.detail !== 0) {
|
|
59
60
|
state.activeIndex = -1;
|
|
@@ -66,6 +67,7 @@ const bindMouseDown = ({
|
|
|
66
67
|
const handleEl = event.target;
|
|
67
68
|
let isClickBar = false;
|
|
68
69
|
let isClickBtn = false;
|
|
70
|
+
let isClickLabel = false;
|
|
69
71
|
if (mode === "mobile-first") {
|
|
70
72
|
const role = Array.from(handleEl.attributes).find((attr) => attr.name === "role");
|
|
71
73
|
const name = role && role.value;
|
|
@@ -74,8 +76,9 @@ const bindMouseDown = ({
|
|
|
74
76
|
} else {
|
|
75
77
|
isClickBar = hasClass(handleEl, constants.sliderCls(mode)) || hasClass(handleEl, constants.rangeCls(mode));
|
|
76
78
|
isClickBtn = hasClass(handleEl, constants.buttonCls(mode)) || hasClass(handleEl, constants.leftSvgCls(mode)) || hasClass(handleEl, constants.rightSvgCls(mode));
|
|
79
|
+
isClickLabel = hasClass(handleEl, constants.PC_LABEL_CLS);
|
|
77
80
|
}
|
|
78
|
-
if (state.disabled || !isClickBtn && !isClickBar) {
|
|
81
|
+
if (state.disabled || !isClickBtn && !isClickBar && !isClickLabel) {
|
|
79
82
|
state.activeIndex = -1;
|
|
80
83
|
return;
|
|
81
84
|
}
|
|
@@ -85,7 +88,7 @@ const bindMouseDown = ({
|
|
|
85
88
|
on(window, "touchmove", api.bindMouseMove);
|
|
86
89
|
state.isDrag = isClickBtn;
|
|
87
90
|
isClickBtn && (state.activeIndex = api.getActiveButtonIndex(event));
|
|
88
|
-
if (isClickBar) {
|
|
91
|
+
if (isClickBar || isClickLabel) {
|
|
89
92
|
const currentValue = api.calculateValue(event);
|
|
90
93
|
if (state.isDouble) {
|
|
91
94
|
if (Math.abs(currentValue - state.leftBtnValue) > Math.abs(state.rightBtnValue - currentValue)) {
|
|
@@ -98,6 +101,9 @@ const bindMouseDown = ({
|
|
|
98
101
|
api.setButtonStyle();
|
|
99
102
|
api.setBarStyle();
|
|
100
103
|
emit("stop", api.getActiveButtonValue());
|
|
104
|
+
if (!props.changeCompat) {
|
|
105
|
+
emit("change", api.getActiveButtonValue());
|
|
106
|
+
}
|
|
101
107
|
}
|
|
102
108
|
};
|
|
103
109
|
const bindMouseMove = ({ api, nextTick, state }) => (event) => {
|
|
@@ -111,7 +117,7 @@ const bindMouseMove = ({ api, nextTick, state }) => (event) => {
|
|
|
111
117
|
api.setTipStyle();
|
|
112
118
|
});
|
|
113
119
|
};
|
|
114
|
-
const bindMouseUp = ({ api, emit, state }) => () => {
|
|
120
|
+
const bindMouseUp = ({ api, emit, state, props }) => () => {
|
|
115
121
|
if (state.disabled || !state.isDrag) {
|
|
116
122
|
return;
|
|
117
123
|
}
|
|
@@ -124,6 +130,9 @@ const bindMouseUp = ({ api, emit, state }) => () => {
|
|
|
124
130
|
off(window, "touchend", api.bindMouseUp);
|
|
125
131
|
off(window, "touchmove", api.bindMouseMove);
|
|
126
132
|
emit("stop", api.getActiveButtonValue());
|
|
133
|
+
if (!props.changeCompat) {
|
|
134
|
+
emit("change", api.getActiveButtonValue());
|
|
135
|
+
}
|
|
127
136
|
};
|
|
128
137
|
const displayTip = ({ api, nextTick, state }) => (event) => {
|
|
129
138
|
state.mouseOuterBtn = false;
|
|
@@ -285,12 +294,9 @@ const initSlider = ({ api, props, state }) => (value) => {
|
|
|
285
294
|
state.rightBtnValue = Math.min(Number(item), props.max);
|
|
286
295
|
state.rightBtnShow = true;
|
|
287
296
|
}
|
|
288
|
-
|
|
289
|
-
api.changeActiveValue(index === 0);
|
|
290
|
-
}
|
|
297
|
+
api.changeActiveValue(index === 0);
|
|
291
298
|
api.setButtonStyle();
|
|
292
299
|
});
|
|
293
|
-
state.isInit = false;
|
|
294
300
|
api.setBarStyle();
|
|
295
301
|
};
|
|
296
302
|
const calculateValue = ({ props, state, vm }) => (event) => {
|
|
@@ -369,13 +375,9 @@ const watchActiveValue = ({ api, emit, props, state }) => (newValue, oldValue) =
|
|
|
369
375
|
} else {
|
|
370
376
|
state.activeValue = nNewValue || 0;
|
|
371
377
|
}
|
|
372
|
-
if (!state.isSlotTyping) {
|
|
373
|
-
state.slotValue = state.activeValue;
|
|
374
|
-
}
|
|
375
378
|
};
|
|
376
379
|
const watchModelValue = ({ api, state }) => (value) => {
|
|
377
380
|
if (!state.innerTrigger) {
|
|
378
|
-
state.isInit = true;
|
|
379
381
|
api.initSlider(value);
|
|
380
382
|
api.setActiveButtonValue(value);
|
|
381
383
|
} else {
|
|
@@ -385,6 +387,9 @@ const watchModelValue = ({ api, state }) => (value) => {
|
|
|
385
387
|
api.setActiveButtonValue(value);
|
|
386
388
|
}
|
|
387
389
|
}
|
|
390
|
+
if (!state.isSlotTyping) {
|
|
391
|
+
api.updateSlotValue();
|
|
392
|
+
}
|
|
388
393
|
};
|
|
389
394
|
const getPoints = ({ props, state }) => () => {
|
|
390
395
|
if (props.showSteps && props.step > 0) {
|
|
@@ -415,7 +420,28 @@ const getLabels = ({ props, state }) => () => {
|
|
|
415
420
|
}
|
|
416
421
|
}
|
|
417
422
|
};
|
|
418
|
-
const
|
|
423
|
+
const getMarkList = ({ props }) => () => {
|
|
424
|
+
const markList = [];
|
|
425
|
+
if (!props.marks) {
|
|
426
|
+
return markList;
|
|
427
|
+
}
|
|
428
|
+
for (const [key, label] of Object.entries(props.marks)) {
|
|
429
|
+
const markValue = Number(key);
|
|
430
|
+
if (markValue >= props.min && markValue <= props.max) {
|
|
431
|
+
const percent = (markValue - props.min) / (props.max - props.min);
|
|
432
|
+
markList.push({
|
|
433
|
+
value: markValue,
|
|
434
|
+
label,
|
|
435
|
+
percent,
|
|
436
|
+
positionStyle: {
|
|
437
|
+
[props.vertical ? "bottom" : "left"]: percent * 100 + "%"
|
|
438
|
+
}
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
return markList;
|
|
443
|
+
};
|
|
444
|
+
const inputValueChange = ({ props, state, api, emit }) => ($event, pos) => {
|
|
419
445
|
if (props.disabled || !state.isDouble)
|
|
420
446
|
return;
|
|
421
447
|
if (!/^\d+$/.test($event.target.value)) {
|
|
@@ -427,16 +453,40 @@ const inputValueChange = ({ props, state, api }) => ($event, pos) => {
|
|
|
427
453
|
return;
|
|
428
454
|
}
|
|
429
455
|
api.initSlider([Math.min(...state.inputValue), Math.max(...state.inputValue)]);
|
|
456
|
+
if (!props.changeCompat) {
|
|
457
|
+
emit("change", api.getActiveButtonValue());
|
|
458
|
+
}
|
|
430
459
|
};
|
|
431
460
|
const handleSlotInputFocus = (state) => () => {
|
|
432
461
|
state.isSlotTyping = true;
|
|
433
462
|
};
|
|
434
|
-
const handleSlotInputBlur = (state) => () => {
|
|
463
|
+
const handleSlotInputBlur = ({ state, api }) => () => {
|
|
435
464
|
state.isSlotTyping = false;
|
|
436
|
-
|
|
465
|
+
api.updateSlotValue();
|
|
437
466
|
};
|
|
438
|
-
const
|
|
439
|
-
|
|
467
|
+
const updateSlotValue = ({ state }) => () => {
|
|
468
|
+
if (!state.isDouble) {
|
|
469
|
+
state.slotValue = state.activeValue;
|
|
470
|
+
} else {
|
|
471
|
+
state.slotValue = state.activeIndex === 0 ? [state.activeValue, state.rightBtnValue] : [state.leftBtnValue, state.activeValue];
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
const handleSlotInput = ({ state, api }) => (event, isLeftInput = true) => {
|
|
475
|
+
const inputValue = event.target.value;
|
|
476
|
+
api.changeActiveValue(state.isDouble ? isLeftInput : true);
|
|
477
|
+
state.activeValue = Number(inputValue);
|
|
478
|
+
api.updateSlotValue();
|
|
479
|
+
};
|
|
480
|
+
const inputOnChange = ({ api, emit, props, state }) => (event) => {
|
|
481
|
+
if (!props.changeCompat) {
|
|
482
|
+
if (!/^\d+$/.test(event.target.value)) {
|
|
483
|
+
state.activeValue = state.leftBtnValue;
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
486
|
+
const value = toNumber(state.activeValue) || 0;
|
|
487
|
+
api.autoSlider(value);
|
|
488
|
+
emit("change", api.getActiveButtonValue());
|
|
489
|
+
}
|
|
440
490
|
};
|
|
441
491
|
export {
|
|
442
492
|
autoSlider,
|
|
@@ -456,18 +506,21 @@ export {
|
|
|
456
506
|
getActiveButtonIndex,
|
|
457
507
|
getActiveButtonValue,
|
|
458
508
|
getLabels,
|
|
509
|
+
getMarkList,
|
|
459
510
|
getPoints,
|
|
460
511
|
handleSlotInput,
|
|
461
512
|
handleSlotInputBlur,
|
|
462
513
|
handleSlotInputFocus,
|
|
463
514
|
hideTip,
|
|
464
515
|
initSlider,
|
|
516
|
+
inputOnChange,
|
|
465
517
|
inputValueChange,
|
|
466
518
|
setActiveButtonValue,
|
|
467
519
|
setBarStyle,
|
|
468
520
|
setButtonStyle,
|
|
469
521
|
setTipStyle,
|
|
470
522
|
unBindEvent,
|
|
523
|
+
updateSlotValue,
|
|
471
524
|
watchActiveValue,
|
|
472
525
|
watchModelValue
|
|
473
526
|
};
|
package/slider/vue.js
CHANGED
|
@@ -28,9 +28,12 @@ import {
|
|
|
28
28
|
getPoints,
|
|
29
29
|
getLabels,
|
|
30
30
|
inputValueChange,
|
|
31
|
+
inputOnChange,
|
|
31
32
|
handleSlotInputFocus,
|
|
32
33
|
handleSlotInputBlur,
|
|
33
|
-
handleSlotInput
|
|
34
|
+
handleSlotInput,
|
|
35
|
+
getMarkList,
|
|
36
|
+
updateSlotValue
|
|
34
37
|
} from "./index";
|
|
35
38
|
const api = [
|
|
36
39
|
"state",
|
|
@@ -58,6 +61,7 @@ const api = [
|
|
|
58
61
|
"customAppearHook",
|
|
59
62
|
"customAfterAppearHook",
|
|
60
63
|
"inputValueChange",
|
|
64
|
+
"inputOnChange",
|
|
61
65
|
"handleSlotInputFocus",
|
|
62
66
|
"handleSlotInputBlur",
|
|
63
67
|
"handleSlotInput"
|
|
@@ -70,7 +74,7 @@ const initState = ({ reactive, computed, props, api: api2, parent, inject }) =>
|
|
|
70
74
|
moveStyle: [],
|
|
71
75
|
points: [],
|
|
72
76
|
labels: [],
|
|
73
|
-
|
|
77
|
+
markList: computed(() => api2.getMarkList()),
|
|
74
78
|
inputValue: [0, 0],
|
|
75
79
|
isDrag: false,
|
|
76
80
|
sliderSize: 0,
|
|
@@ -88,6 +92,7 @@ const initState = ({ reactive, computed, props, api: api2, parent, inject }) =>
|
|
|
88
92
|
rightBtnPercent: 0,
|
|
89
93
|
rightBtnShow: false,
|
|
90
94
|
innerTrigger: false,
|
|
95
|
+
changeCompat: computed(() => props.changeCompat),
|
|
91
96
|
rangeDiff: computed(() => props.max - props.min),
|
|
92
97
|
tipValue: computed(() => api2.formatTipValue(state.activeValue)),
|
|
93
98
|
formDisabled: computed(() => (parent.tinyForm || {}).disabled),
|
|
@@ -122,19 +127,22 @@ const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, wat
|
|
|
122
127
|
unBindEvent: unBindEvent(api2),
|
|
123
128
|
displayTip: displayTip({ api: api2, nextTick, state }),
|
|
124
129
|
bindKeyDown: bindKeyDown({ api: api2, props, state }),
|
|
125
|
-
bindMouseUp: bindMouseUp({ api: api2, emit, state }),
|
|
130
|
+
bindMouseUp: bindMouseUp({ api: api2, emit, state, props }),
|
|
126
131
|
bindMouseMove: bindMouseMove({ api: api2, nextTick, state }),
|
|
127
|
-
bindMouseDown: bindMouseDown({ api: api2, constants, mode, emit, state }),
|
|
132
|
+
bindMouseDown: bindMouseDown({ api: api2, constants, mode, emit, state, props }),
|
|
128
133
|
setActiveButtonValue: setActiveButtonValue({ api: api2, emit, props, state }),
|
|
129
134
|
initSlider: initSlider({ api: api2, props, state }),
|
|
130
135
|
watchModelValue: watchModelValue({ api: api2, state }),
|
|
131
136
|
watchActiveValue: watchActiveValue({ api: api2, emit, props, state }),
|
|
132
137
|
getPoints: getPoints({ props, state }),
|
|
133
138
|
getLabels: getLabels({ props, state }),
|
|
134
|
-
inputValueChange: inputValueChange({ props, api: api2, state }),
|
|
139
|
+
inputValueChange: inputValueChange({ props, api: api2, state, emit }),
|
|
135
140
|
handleSlotInputFocus: handleSlotInputFocus(state),
|
|
136
|
-
handleSlotInputBlur: handleSlotInputBlur(state),
|
|
137
|
-
handleSlotInput: handleSlotInput(state)
|
|
141
|
+
handleSlotInputBlur: handleSlotInputBlur({ state, api: api2 }),
|
|
142
|
+
handleSlotInput: handleSlotInput({ state, api: api2 }),
|
|
143
|
+
getMarkList: getMarkList({ props }),
|
|
144
|
+
updateSlotValue: updateSlotValue({ state }),
|
|
145
|
+
inputOnChange: inputOnChange({ api: api2, emit, props, state })
|
|
138
146
|
});
|
|
139
147
|
watch(
|
|
140
148
|
() => props.modelValue,
|
|
@@ -146,6 +154,7 @@ const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, wat
|
|
|
146
154
|
},
|
|
147
155
|
{ immediate: true }
|
|
148
156
|
);
|
|
157
|
+
props.changeCompat && watch(() => state.activeValue, api2.watchActiveValue, { immediate: true });
|
|
149
158
|
watch(() => state.activeValue, api2.watchActiveValue, { immediate: true });
|
|
150
159
|
watch(
|
|
151
160
|
() => props.min,
|
package/split/index.js
CHANGED
|
@@ -44,7 +44,7 @@ const handleUp = ({ api, emit, off, state }) => () => {
|
|
|
44
44
|
emit("moveend");
|
|
45
45
|
};
|
|
46
46
|
const handleMousedown = ({ api, emit, on, props, state, vm }) => (event) => {
|
|
47
|
-
if (
|
|
47
|
+
if (!props.disabled) {
|
|
48
48
|
state.initOffset = state.isHorizontal ? event.pageX : event.pageY;
|
|
49
49
|
if (state.offset === 0) {
|
|
50
50
|
state.oldOffset = 0;
|
|
@@ -95,8 +95,10 @@ const buttonRightBottomClick = ({ emit, props, state }) => () => {
|
|
|
95
95
|
};
|
|
96
96
|
const computeOffset = ({ api, nextTick, props, vm, state }) => () => {
|
|
97
97
|
setTimeout(() => {
|
|
98
|
-
state
|
|
99
|
-
|
|
98
|
+
if (state) {
|
|
99
|
+
state.totalPane = vm.$refs.outerWrapper[state.offsetSize];
|
|
100
|
+
state.leftTopPane = state.totalPane * (state.offset / 100);
|
|
101
|
+
}
|
|
100
102
|
});
|
|
101
103
|
if (state.valueIsPx) {
|
|
102
104
|
nextTick(() => {
|
package/split/vue.js
CHANGED
|
@@ -32,12 +32,10 @@ const renderless = (props, hooks, { vm, nextTick, emit, constants }) => {
|
|
|
32
32
|
computedleftTopMin: computed(() => api2.getComputedThresholdValue("leftTopMin")),
|
|
33
33
|
computedrightBottomMin: computed(() => api2.getComputedThresholdValue("rightBottomMin")),
|
|
34
34
|
wrapperClasses: computed(() => [`${state.prefix}-wrapper`, state.isMoving ? "no-select" : ""]),
|
|
35
|
-
paneClasses: computed(() => [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
collapseRightBottom: props.collapseRightBottom,
|
|
40
|
-
isThreeAreas: props.threeAreas
|
|
35
|
+
paneClasses: computed(() => [
|
|
36
|
+
`${state.prefix}-pane ${props.scrollable ? "tiny-split-scroll" : ""}`,
|
|
37
|
+
{ [`${state.prefix}-pane-moving`]: state.isMoving }
|
|
38
|
+
])
|
|
41
39
|
}, getUseOffset.state));
|
|
42
40
|
Object.assign(api2, __spreadProps(__spreadValues({
|
|
43
41
|
state,
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../chunk-G2ADBYYC.js";
|
|
2
5
|
const handleEnterDesc = ({ state, props }) => ($event) => {
|
|
3
6
|
const target = $event.target;
|
|
4
7
|
if (target && target.scrollHeight > target.offsetHeight) {
|
|
@@ -17,7 +20,18 @@ const handleTitleClick = ({ props }) => () => {
|
|
|
17
20
|
return;
|
|
18
21
|
props.titleOption.click();
|
|
19
22
|
};
|
|
23
|
+
const computedOptions = ({ props }) => () => {
|
|
24
|
+
return props.options.filter((item) => {
|
|
25
|
+
const hidden = typeof item.hidden === "function" ? item.hidden(props.data) : item.hidden;
|
|
26
|
+
return !hidden;
|
|
27
|
+
}).map((op) => {
|
|
28
|
+
return __spreadProps(__spreadValues({}, op), {
|
|
29
|
+
disabled: typeof op.disabled === "function" ? op.disabled(props.data) : op.disabled
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
};
|
|
20
33
|
export {
|
|
34
|
+
computedOptions,
|
|
21
35
|
handelIconClick,
|
|
22
36
|
handleEnterDesc,
|
|
23
37
|
handleTitleClick
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import { handleEnterDesc, handelIconClick, handleTitleClick } from "./index";
|
|
3
|
-
const api = ["state", "handelIconClick", "handleEnterDesc", "handleTitleClick"];
|
|
2
|
+
import { handleEnterDesc, handelIconClick, handleTitleClick, computedOptions } from "./index";
|
|
3
|
+
const api = ["state", "handelIconClick", "handleEnterDesc", "handleTitleClick", "computedOptions"];
|
|
4
4
|
const renderless = (props, { computed, reactive }, { emit }) => {
|
|
5
|
+
const api2 = {};
|
|
5
6
|
const state = reactive({
|
|
6
7
|
descTooltip: "",
|
|
7
8
|
sliceNum: 2,
|
|
8
9
|
iconNum: 3,
|
|
9
|
-
effectOptions: computed(() =>
|
|
10
|
+
effectOptions: computed(() => api2.computedOptions())
|
|
10
11
|
});
|
|
11
|
-
const api2 = {};
|
|
12
12
|
Object.assign(api2, {
|
|
13
13
|
state,
|
|
14
14
|
handleTitleClick: handleTitleClick({ props }),
|
|
15
15
|
handelIconClick: handelIconClick({ emit }),
|
|
16
|
-
handleEnterDesc: handleEnterDesc({ state, props })
|
|
16
|
+
handleEnterDesc: handleEnterDesc({ state, props }),
|
|
17
|
+
computedOptions: computedOptions({ props })
|
|
17
18
|
});
|
|
18
19
|
return api2;
|
|
19
20
|
};
|
package/steps/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
import { omitText } from "../common/string";
|
|
2
3
|
const updateStartIndex = ({ state, props }) => () => {
|
|
3
4
|
const { visibleNum, active } = props;
|
|
4
5
|
const maxStartIndex = Math.min(props.data.length - visibleNum, active - Math.floor(visibleNum / 2));
|
|
@@ -23,9 +24,29 @@ const computedRightNodePos = ({ state, props }) => () => {
|
|
|
23
24
|
right: -(index + 1) * 4 + "px"
|
|
24
25
|
}));
|
|
25
26
|
};
|
|
27
|
+
const handleMouseenter = ({ state, vm }) => (e, placement) => {
|
|
28
|
+
const ele = e.target;
|
|
29
|
+
const text = ele.textContent;
|
|
30
|
+
const font = window.getComputedStyle(ele).font;
|
|
31
|
+
const rect = ele.getBoundingClientRect();
|
|
32
|
+
const res = omitText(text, font, rect.width);
|
|
33
|
+
const popover = vm.$refs.popover;
|
|
34
|
+
if (res.o) {
|
|
35
|
+
popover.state.referenceElm = ele;
|
|
36
|
+
popover.state.popperElm && (popover.state.popperElm.style.display = "none");
|
|
37
|
+
popover.doDestroy();
|
|
38
|
+
state.popoverContent = text;
|
|
39
|
+
state.popoverVisible = true;
|
|
40
|
+
state.popoverPlacement = placement;
|
|
41
|
+
setTimeout(popover.updatePopper, 20);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const handleMouseleave = (state) => () => {
|
|
45
|
+
state.popoverVisible = false;
|
|
46
|
+
};
|
|
26
47
|
const computedSpace = ({ props }) => {
|
|
27
|
-
const { space } = props;
|
|
28
|
-
if (/^\d+$/.test(space)) {
|
|
48
|
+
const { space = "" } = props;
|
|
49
|
+
if (/^\d+$/.test(String(space))) {
|
|
29
50
|
return `${space}px`;
|
|
30
51
|
}
|
|
31
52
|
return space;
|
|
@@ -33,6 +54,8 @@ const computedSpace = ({ props }) => {
|
|
|
33
54
|
export {
|
|
34
55
|
computedRightNodePos,
|
|
35
56
|
computedSpace,
|
|
57
|
+
handleMouseenter,
|
|
58
|
+
handleMouseleave,
|
|
36
59
|
isVisibleHandler,
|
|
37
60
|
updateStartIndex
|
|
38
61
|
};
|
package/steps/slide-bar.js
CHANGED
|
@@ -45,7 +45,14 @@ const rightSlideHandler = ({ state, api: api2 }) => () => {
|
|
|
45
45
|
const updatePosition = ({ state, vm, props, api: api2 }) => debounce(10, (isInit) => {
|
|
46
46
|
state.positionList = props.data.map((item, index) => {
|
|
47
47
|
const blockRef = vm.$refs["block" + index];
|
|
48
|
-
|
|
48
|
+
let position = {};
|
|
49
|
+
if (blockRef) {
|
|
50
|
+
if (Array.isArray(blockRef)) {
|
|
51
|
+
position = blockRef[0] && blockRef[0].getBoundingClientRect();
|
|
52
|
+
} else {
|
|
53
|
+
position = blockRef.getBoundingClientRect();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
49
56
|
return Object.assign(position, { index });
|
|
50
57
|
});
|
|
51
58
|
state.slideMainPostion = vm.$refs.slideMain.getBoundingClientRect();
|
package/steps/vue.js
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import {
|
|
3
|
+
updateStartIndex,
|
|
4
|
+
isVisibleHandler,
|
|
5
|
+
computedRightNodePos,
|
|
6
|
+
computedSpace,
|
|
7
|
+
handleMouseenter,
|
|
8
|
+
handleMouseleave
|
|
9
|
+
} from "./index";
|
|
10
|
+
const api = ["state", "isVisibleHandler", "handleMouseenter", "handleMouseleave"];
|
|
11
|
+
const renderless = (props, { reactive, watch, computed }, { vm }) => {
|
|
5
12
|
const state = reactive({
|
|
6
13
|
startIndex: 0,
|
|
14
|
+
popoverVisible: false,
|
|
15
|
+
popoverContent: "",
|
|
16
|
+
popoverPlacement: "top",
|
|
7
17
|
endIndex: computed(() => state.startIndex + props.visibleNum),
|
|
8
18
|
rightNodePositions: computed(() => api2.computedRightNodePos()),
|
|
9
19
|
computedSpace: computed(() => computedSpace({ props }))
|
|
@@ -12,6 +22,8 @@ const renderless = (props, { reactive, watch, computed }) => {
|
|
|
12
22
|
state,
|
|
13
23
|
updateStartIndex: updateStartIndex({ state, props }),
|
|
14
24
|
isVisibleHandler: isVisibleHandler({ state, props }),
|
|
25
|
+
handleMouseenter: handleMouseenter({ state, vm }),
|
|
26
|
+
handleMouseleave: handleMouseleave(state),
|
|
15
27
|
computedRightNodePos: computedRightNodePos({ state, props })
|
|
16
28
|
};
|
|
17
29
|
watch(() => props.active, api2.updateStartIndex, { immediate: true });
|
package/tab-item-mf/vue.js
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
const renderless = (props, { inject }, { slots }) => {
|
|
2
|
+
const renderless = (props, { inject, onBeforeUnmount, reactive, toRef, markRaw }, { slots, vm }) => {
|
|
3
3
|
const tabs = inject("tabs", null);
|
|
4
|
-
const {
|
|
5
|
-
const item = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
const { lazy } = props;
|
|
5
|
+
const item = reactive({
|
|
6
|
+
title: toRef(props, "title"),
|
|
7
|
+
name: toRef(props, "name"),
|
|
8
|
+
slotDefault: slots.default,
|
|
9
|
+
slotTitle: props.renderTitle ? toRef(props, "renderTitle") : slots.title,
|
|
10
|
+
slotSetting: props.renderSetting ? toRef(props, "renderSetting") : slots.setting,
|
|
11
|
+
lazy,
|
|
12
|
+
selected: false,
|
|
13
|
+
vm: markRaw(vm)
|
|
14
|
+
});
|
|
15
|
+
item.selected = (tabs.activeName || tabs.modelValue) === item.name;
|
|
11
16
|
tabs.addItem(item);
|
|
17
|
+
onBeforeUnmount(() => tabs.removeItem(item.name, true));
|
|
12
18
|
return {};
|
|
13
19
|
};
|
|
14
20
|
export {
|
package/tab-nav/index.js
CHANGED
|
@@ -6,8 +6,10 @@ import { on, off } from "../common/deps/dom";
|
|
|
6
6
|
const computedNavStyle = (state) => {
|
|
7
7
|
const dir = ~[POSITION.Top, POSITION.Bottom].indexOf(state.rootTabs.position) ? "X" : "Y";
|
|
8
8
|
if (state.mode === "mobile") {
|
|
9
|
+
const { offset, width } = state.lineStyle;
|
|
9
10
|
return {
|
|
10
|
-
|
|
11
|
+
width: `${width}px`,
|
|
12
|
+
transform: `translate${dir}(${offset}px) translate${dir}(-50%)`
|
|
11
13
|
};
|
|
12
14
|
} else {
|
|
13
15
|
return {
|
|
@@ -28,7 +30,9 @@ const scrollIntoView = ({ parent, vm, state }) => () => {
|
|
|
28
30
|
const from = nav.scrollLeft;
|
|
29
31
|
if (state.mode === "mobile") {
|
|
30
32
|
nav.scrollLeft += to - from;
|
|
31
|
-
|
|
33
|
+
const nameHtml = activeTab.querySelector(".tiny-mobile-tabs__name");
|
|
34
|
+
state.lineStyle.width = nameHtml.offsetWidth;
|
|
35
|
+
state.lineStyle.offset = activeTab.offsetLeft + activeTab.offsetWidth / 2;
|
|
32
36
|
}
|
|
33
37
|
};
|
|
34
38
|
const computedSizeName = (state) => ~[POSITION.Top, POSITION.Bottom].indexOf(state.rootTabs.position) ? "width" : "height";
|
|
@@ -43,9 +47,10 @@ const updated = ({ api, vm, state }) => () => {
|
|
|
43
47
|
navSize += item.offsetWidth;
|
|
44
48
|
}
|
|
45
49
|
if (item.classList && item.classList.contains("is-active")) {
|
|
46
|
-
const
|
|
50
|
+
const nameHtml = item.querySelector(".tiny-mobile-tabs__name");
|
|
47
51
|
state.isActive = true;
|
|
48
|
-
state.
|
|
52
|
+
state.lineStyle.width = nameHtml.offsetWidth;
|
|
53
|
+
state.lineStyle.offset = item.offsetLeft + item.offsetWidth / 2;
|
|
49
54
|
}
|
|
50
55
|
});
|
|
51
56
|
}
|
|
@@ -281,7 +286,7 @@ const sortableEvent = ({
|
|
|
281
286
|
onStart(event) {
|
|
282
287
|
api.handleTabDragStart(event);
|
|
283
288
|
},
|
|
284
|
-
onEnd(
|
|
289
|
+
onEnd() {
|
|
285
290
|
api.handleTabDragEnd();
|
|
286
291
|
}
|
|
287
292
|
});
|
|
@@ -295,6 +300,24 @@ const watchCurrentName = ({ nextTick, vm, state }) => () => {
|
|
|
295
300
|
}
|
|
296
301
|
});
|
|
297
302
|
};
|
|
303
|
+
const handleTitleMouseenter = ({ state, vm }) => (e, title) => {
|
|
304
|
+
const dom = e.target;
|
|
305
|
+
if (dom && dom.scrollWidth > dom.offsetWidth) {
|
|
306
|
+
const tooltip = vm.$refs.tooltip;
|
|
307
|
+
tooltip.state.referenceElm = dom;
|
|
308
|
+
tooltip.state.popperElm && (tooltip.state.popperElm.style.display = "none");
|
|
309
|
+
tooltip.doDestroy();
|
|
310
|
+
state.tooltipContent = title;
|
|
311
|
+
state.tooltipVisible = true;
|
|
312
|
+
setTimeout(tooltip.updatePopper, 20);
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
const handleTitleMouseleave = ({ state }) => () => {
|
|
316
|
+
state.tooltipVisible = false;
|
|
317
|
+
setTimeout(() => {
|
|
318
|
+
state.tooltipContent = "";
|
|
319
|
+
}, 20);
|
|
320
|
+
};
|
|
298
321
|
export {
|
|
299
322
|
beforeUnmount,
|
|
300
323
|
changeTab,
|
|
@@ -305,6 +328,8 @@ export {
|
|
|
305
328
|
expandTabShow,
|
|
306
329
|
handleTabDragEnd,
|
|
307
330
|
handleTabDragStart,
|
|
331
|
+
handleTitleMouseenter,
|
|
332
|
+
handleTitleMouseleave,
|
|
308
333
|
moreTabShow,
|
|
309
334
|
mounted,
|
|
310
335
|
removeFocus,
|
package/tab-nav/vue.js
CHANGED
|
@@ -22,7 +22,9 @@ import {
|
|
|
22
22
|
sortableEvent,
|
|
23
23
|
handleTabDragStart,
|
|
24
24
|
handleTabDragEnd,
|
|
25
|
-
watchCurrentName
|
|
25
|
+
watchCurrentName,
|
|
26
|
+
handleTitleMouseenter,
|
|
27
|
+
handleTitleMouseleave
|
|
26
28
|
} from "./index";
|
|
27
29
|
const api = [
|
|
28
30
|
"state",
|
|
@@ -37,19 +39,27 @@ const api = [
|
|
|
37
39
|
"expandTabShow",
|
|
38
40
|
"expandTabHide",
|
|
39
41
|
"computedHeaderStyle",
|
|
40
|
-
"swiperHandle"
|
|
42
|
+
"swiperHandle",
|
|
43
|
+
"updated",
|
|
44
|
+
"handleTitleMouseenter",
|
|
45
|
+
"handleTitleMouseleave"
|
|
41
46
|
];
|
|
42
47
|
const renderless = (props, { computed, inject, onBeforeUnmount, onMounted, onUpdated, reactive, markRaw }, { parent, vm, nextTick, mode: tinyMode, emit }) => {
|
|
43
48
|
const api2 = { mounted, beforeUnmount, computedNavStyle, computedSizeName };
|
|
44
49
|
const state = reactive({
|
|
45
50
|
dragging: false,
|
|
46
51
|
navOffset: 0,
|
|
47
|
-
|
|
52
|
+
lineStyle: {
|
|
53
|
+
width: 20,
|
|
54
|
+
offset: 0
|
|
55
|
+
},
|
|
48
56
|
scrollable: false,
|
|
49
57
|
isFocus: false,
|
|
50
58
|
focusable: false,
|
|
51
59
|
showMoreItem: false,
|
|
52
60
|
isActive: false,
|
|
61
|
+
tooltipVisible: false,
|
|
62
|
+
tooltipContent: "",
|
|
53
63
|
showMoreTabs: props.showMoreTabs,
|
|
54
64
|
showExpandItem: false,
|
|
55
65
|
showExpandTabs: props.showExpandTabs,
|
|
@@ -79,7 +89,9 @@ const renderless = (props, { computed, inject, onBeforeUnmount, onMounted, onUpd
|
|
|
79
89
|
watchCurrentName: watchCurrentName({ nextTick, vm, state }),
|
|
80
90
|
handleTabDragStart: handleTabDragStart({ state, vm, emit }),
|
|
81
91
|
handleTabDragEnd: handleTabDragEnd({ state, vm, nextTick }),
|
|
82
|
-
sortableEvent: sortableEvent({ api: api2, props, state, vm, emit, markRaw })
|
|
92
|
+
sortableEvent: sortableEvent({ api: api2, props, state, vm, emit, markRaw }),
|
|
93
|
+
handleTitleMouseenter: handleTitleMouseenter({ state, vm }),
|
|
94
|
+
handleTitleMouseleave: handleTitleMouseleave({ state })
|
|
83
95
|
});
|
|
84
96
|
Object.assign(api2, { updated: updated({ api: api2, vm, state }), changeTab: changeTab(api2) });
|
|
85
97
|
onUpdated(() => api2.updated());
|
package/tabbar/vue.js
CHANGED
|
@@ -2,7 +2,7 @@ import "../chunk-G2ADBYYC.js";
|
|
|
2
2
|
import { setActiveItem, onChange, getChildrens, getItems, beforeDestroy, initPage } from "./index";
|
|
3
3
|
import { on } from "../common/deps/dom";
|
|
4
4
|
const api = ["state", "onChange", "getChildrens"];
|
|
5
|
-
const renderless = (props, { computed, onMounted, reactive, watch, onBeforeUnmount }, { vm, emit, nextTick, childrenHandler }) => {
|
|
5
|
+
const renderless = (props, { computed, onMounted, reactive, watch, onBeforeUnmount, provide }, { vm, emit, nextTick, childrenHandler }) => {
|
|
6
6
|
const api2 = {};
|
|
7
7
|
const state = reactive({
|
|
8
8
|
height: null,
|
|
@@ -11,7 +11,8 @@ const renderless = (props, { computed, onMounted, reactive, watch, onBeforeUnmou
|
|
|
11
11
|
activeItem: false,
|
|
12
12
|
showIndex: 0,
|
|
13
13
|
showNumber: computed(() => props.showNumber > 0 ? props.showNumber : -1),
|
|
14
|
-
tabbarWidth: null
|
|
14
|
+
tabbarWidth: null,
|
|
15
|
+
itemList: computed(() => props.itemList || [])
|
|
15
16
|
});
|
|
16
17
|
Object.assign(api2, {
|
|
17
18
|
state,
|
|
@@ -25,12 +26,17 @@ const renderless = (props, { computed, onMounted, reactive, watch, onBeforeUnmou
|
|
|
25
26
|
});
|
|
26
27
|
onMounted(() => {
|
|
27
28
|
on(window, "resize", api2.initPage);
|
|
28
|
-
state.tabbarWidth = vm.$refs && vm.$refs.tabbar.offsetWidth;
|
|
29
|
+
state.tabbarWidth = vm.$refs.tabbar && vm.$refs.tabbar.offsetWidth;
|
|
29
30
|
if (props.placeholder && props.fixed) {
|
|
30
31
|
nextTick(() => {
|
|
31
32
|
state.height = vm.$refs.tabbar.getBoundingClientRect().height;
|
|
32
33
|
});
|
|
33
34
|
}
|
|
35
|
+
state.itemList.forEach((item) => {
|
|
36
|
+
if (item.customIcon) {
|
|
37
|
+
provide("customIcon", item.customIcon);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
34
40
|
});
|
|
35
41
|
vm.$on("updateItems", api2.getItems);
|
|
36
42
|
vm.$on("activeItem", api2.onChange);
|