@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/action-sheet/index.js
CHANGED
|
@@ -40,12 +40,11 @@ const visibleHandle = ({ emit, state }) => () => {
|
|
|
40
40
|
emit("update:visible", false);
|
|
41
41
|
emit("close", false);
|
|
42
42
|
};
|
|
43
|
-
const watchVisible = ({ emit,
|
|
44
|
-
state.active = props.modelValue;
|
|
43
|
+
const watchVisible = ({ emit, state }) => (bool) => {
|
|
45
44
|
setTimeout(() => {
|
|
46
|
-
|
|
45
|
+
state.toggle = bool;
|
|
47
46
|
}, 0);
|
|
48
|
-
emit("update:visible",
|
|
47
|
+
emit("update:visible", bool);
|
|
49
48
|
};
|
|
50
49
|
const menuHandle = ({ emit, state }) => (item) => {
|
|
51
50
|
state.active = item.id;
|
|
@@ -54,13 +53,11 @@ const menuHandle = ({ emit, state }) => (item) => {
|
|
|
54
53
|
emit("update:modelValue", item.id);
|
|
55
54
|
emit("click", item);
|
|
56
55
|
};
|
|
57
|
-
const close = ({
|
|
58
|
-
|
|
59
|
-
emit("close", false);
|
|
56
|
+
const close = ({ api }) => () => {
|
|
57
|
+
api.handleClose("close", false);
|
|
60
58
|
};
|
|
61
|
-
const hide = (
|
|
62
|
-
|
|
63
|
-
emit("update:visible", false);
|
|
59
|
+
const hide = ({ api }) => () => {
|
|
60
|
+
api.handleClose("hide", false);
|
|
64
61
|
};
|
|
65
62
|
const selectOption = ({ emit, props }) => (option) => {
|
|
66
63
|
const { valueField } = props;
|
|
@@ -68,18 +65,28 @@ const selectOption = ({ emit, props }) => (option) => {
|
|
|
68
65
|
emit("update:modelValue", option[valueField]);
|
|
69
66
|
emit("click", option);
|
|
70
67
|
};
|
|
71
|
-
const confirm = ({
|
|
72
|
-
|
|
73
|
-
emit("update:visible", false);
|
|
68
|
+
const confirm = ({ state, api }) => () => {
|
|
69
|
+
api.handleClose("confirm", state);
|
|
74
70
|
};
|
|
75
71
|
const actionSelectOption = ({ emit }) => (option, index) => {
|
|
76
72
|
emit("update:visible", false);
|
|
77
73
|
emit("click", option, index);
|
|
78
74
|
};
|
|
75
|
+
const handleClose = ({ vm, emit, props }) => (type, show) => {
|
|
76
|
+
if (typeof props.beforeClose === "function" && props.beforeClose(type) === false)
|
|
77
|
+
return;
|
|
78
|
+
if (type === "close") {
|
|
79
|
+
vm.$refs.drawer.close(true);
|
|
80
|
+
} else {
|
|
81
|
+
emit("update:visible", false);
|
|
82
|
+
}
|
|
83
|
+
emit(type, show);
|
|
84
|
+
};
|
|
79
85
|
export {
|
|
80
86
|
actionSelectOption,
|
|
81
87
|
close,
|
|
82
88
|
confirm,
|
|
89
|
+
handleClose,
|
|
83
90
|
hide,
|
|
84
91
|
initScrollMenu,
|
|
85
92
|
menuHandle,
|
package/action-sheet/vue.js
CHANGED
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
selectOption,
|
|
10
10
|
confirm,
|
|
11
11
|
actionSelectOption,
|
|
12
|
-
hide
|
|
12
|
+
hide,
|
|
13
|
+
handleClose
|
|
13
14
|
} from "./index";
|
|
14
15
|
const api = [
|
|
15
16
|
"state",
|
|
@@ -25,26 +26,26 @@ const api = [
|
|
|
25
26
|
"hide"
|
|
26
27
|
];
|
|
27
28
|
const renderless = (props, { reactive, watch }, { emit, nextTick, refs, vm }, { BScroll }) => {
|
|
28
|
-
const api2 = {};
|
|
29
29
|
const state = reactive({
|
|
30
30
|
toggle: false,
|
|
31
|
-
active: null,
|
|
32
31
|
sheetMaskStyle: {},
|
|
33
32
|
sheetContentStyle: {},
|
|
34
33
|
scroll: null
|
|
35
34
|
});
|
|
35
|
+
const api2 = {};
|
|
36
36
|
Object.assign(api2, {
|
|
37
37
|
state,
|
|
38
38
|
setSheetStyle: setSheetStyle({ state, props }),
|
|
39
39
|
initScrollMenu: initScrollMenu({ state, nextTick, refs, BScroll }),
|
|
40
40
|
visibleHandle: visibleHandle({ emit, state }),
|
|
41
|
-
watchVisible: watchVisible({ emit,
|
|
41
|
+
watchVisible: watchVisible({ emit, state }),
|
|
42
42
|
menuHandle: menuHandle({ state, emit }),
|
|
43
|
-
confirm: confirm({ state,
|
|
43
|
+
confirm: confirm({ state, api: api2 }),
|
|
44
44
|
selectOption: selectOption({ emit, props }),
|
|
45
45
|
actionSelectOption: actionSelectOption({ emit }),
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
hide: hide({ api: api2 }),
|
|
47
|
+
close: close({ api: api2 }),
|
|
48
|
+
handleClose: handleClose({ vm, emit, props })
|
|
48
49
|
});
|
|
49
50
|
watch(
|
|
50
51
|
() => props.visible,
|
package/amount/index.js
CHANGED
|
@@ -17,6 +17,7 @@ const initService = (service) => {
|
|
|
17
17
|
const getDecimal = (props) => (value) => getMiniDecimal(value, props.plugin);
|
|
18
18
|
const closePopper = (state) => () => {
|
|
19
19
|
state.visible = false;
|
|
20
|
+
state.editorPhase = "close";
|
|
20
21
|
};
|
|
21
22
|
const popInput = ({ editorState, props, state, api }) => (value) => {
|
|
22
23
|
value = api.onInputPreprocess(value);
|
|
@@ -32,22 +33,54 @@ const popInput = ({ editorState, props, state, api }) => (value) => {
|
|
|
32
33
|
editorState.lastInput = value;
|
|
33
34
|
editorState.amount = value;
|
|
34
35
|
};
|
|
35
|
-
const toggleVisible = ({ api, props, state, editorState }) => () => {
|
|
36
|
-
if (
|
|
36
|
+
const toggleVisible = ({ api, props, state, editorState, uiMode, isMobileFirstMode: mf }) => () => {
|
|
37
|
+
if (state.disabled || !props.popUp) {
|
|
37
38
|
return;
|
|
38
39
|
}
|
|
39
40
|
state.lock = true;
|
|
40
41
|
state.visible = !state.visible;
|
|
41
42
|
if (state.visible) {
|
|
42
43
|
const { date, currency } = state;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
if (!state.clearValues) {
|
|
45
|
+
Object.assign(editorState, {
|
|
46
|
+
amount: state.amount,
|
|
47
|
+
date,
|
|
48
|
+
currency
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (props.date || props.dateAllowEmpty) {
|
|
52
|
+
state.editorPhase = "selection";
|
|
53
|
+
} else {
|
|
54
|
+
state.editorPhase = "currency";
|
|
55
|
+
}
|
|
56
|
+
if (!mf || uiMode.value !== "default") {
|
|
57
|
+
api.addOutSideEvent(state.visible);
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
state.editorPhase = "close";
|
|
49
61
|
}
|
|
50
62
|
};
|
|
63
|
+
const openDetailEditor = ({ state }) => (option, index) => {
|
|
64
|
+
const optionPhase = ["currency", "date"];
|
|
65
|
+
state.editorPhase = optionPhase[index];
|
|
66
|
+
state.visible = true;
|
|
67
|
+
};
|
|
68
|
+
const closeDetailEidtor = ({ state, props, api }) => (triggerCondition) => {
|
|
69
|
+
if (!triggerCondition) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const inSelectionPhase = state.editorPhase === "selection";
|
|
73
|
+
const isMultipleStep = props.date || props.dateAllowEmpty;
|
|
74
|
+
if (!inSelectionPhase && isMultipleStep) {
|
|
75
|
+
state.editorPhase = "selection";
|
|
76
|
+
state.visible = true;
|
|
77
|
+
} else {
|
|
78
|
+
api.toggleVisible();
|
|
79
|
+
}
|
|
80
|
+
setTimeout(() => {
|
|
81
|
+
api.save(true);
|
|
82
|
+
}, 0);
|
|
83
|
+
};
|
|
51
84
|
const innerFormat = ({ state, props }) => (value) => {
|
|
52
85
|
const { fraction, zeroize, rounding } = state.format;
|
|
53
86
|
const { modelTruncation } = props;
|
|
@@ -66,11 +99,13 @@ const innerFormat = ({ state, props }) => (value) => {
|
|
|
66
99
|
rounding
|
|
67
100
|
});
|
|
68
101
|
};
|
|
69
|
-
const save = ({ api, state, editorState }) => () => {
|
|
102
|
+
const save = ({ api, state, editorState }) => (keepOpen) => {
|
|
70
103
|
const { amount, date, currency } = editorState;
|
|
71
104
|
Object.assign(state, { amount, date, currency });
|
|
72
|
-
|
|
73
|
-
|
|
105
|
+
if (keepOpen !== true) {
|
|
106
|
+
api.closePopper();
|
|
107
|
+
}
|
|
108
|
+
let num = api.innerFormat(state.amount + "");
|
|
74
109
|
state.amount = isNaN(num) ? 0 : num;
|
|
75
110
|
if (!equalsDecimal(state.lastInput, state.amount) || state.lastCurrency !== currency || state.lastDate !== date) {
|
|
76
111
|
api.emitChange();
|
|
@@ -84,16 +119,20 @@ const reset = ({ state, editorState }) => () => {
|
|
|
84
119
|
const { amount, date, currency } = state;
|
|
85
120
|
Object.assign(editorState, { amount, date, currency });
|
|
86
121
|
};
|
|
87
|
-
const emitChange = ({ emit, state }) => () => {
|
|
122
|
+
const emitChange = ({ emit, state, props, api }) => () => {
|
|
88
123
|
const { date, currency } = state;
|
|
89
|
-
|
|
90
|
-
|
|
124
|
+
let emitAmount = props.stringMode ? api.getDecimal(state.amount).toString() : Number(state.amount);
|
|
125
|
+
if (props.numAllowEmpty && state.amount === "") {
|
|
126
|
+
emitAmount = state.amount;
|
|
127
|
+
}
|
|
128
|
+
state.amount && (state.clearValues = false);
|
|
129
|
+
!state.clearValues && emit("update:modelValue", emitAmount);
|
|
91
130
|
emit("update:currency", currency);
|
|
92
131
|
emit("update:date", date);
|
|
93
132
|
emit("change", { amount: emitAmount, date, currency });
|
|
94
133
|
};
|
|
95
134
|
const inputFocus = ({ state, props }) => () => {
|
|
96
|
-
let amount =
|
|
135
|
+
let amount = state.amount + "";
|
|
97
136
|
state.isFocus = true;
|
|
98
137
|
state.lock = false;
|
|
99
138
|
const { fraction } = state.format;
|
|
@@ -105,7 +144,7 @@ const inputFocus = ({ state, props }) => () => {
|
|
|
105
144
|
};
|
|
106
145
|
const inputBlur = ({ api, state, props }) => () => {
|
|
107
146
|
if (state.amountText !== "") {
|
|
108
|
-
let amount = api.innerFormat(
|
|
147
|
+
let amount = api.innerFormat(state.amountText + "");
|
|
109
148
|
if (isNaN(amount)) {
|
|
110
149
|
state.amount = "";
|
|
111
150
|
}
|
|
@@ -118,8 +157,8 @@ const inputBlur = ({ api, state, props }) => () => {
|
|
|
118
157
|
}
|
|
119
158
|
state.lastInput = state.amount;
|
|
120
159
|
};
|
|
121
|
-
const handelClick = ({ api,
|
|
122
|
-
const contains = refs.root.contains(e.target);
|
|
160
|
+
const handelClick = ({ api, vm }) => (e) => {
|
|
161
|
+
const contains = vm.$refs.root.contains(e.target);
|
|
123
162
|
if (!contains) {
|
|
124
163
|
api.closePopper();
|
|
125
164
|
}
|
|
@@ -132,7 +171,7 @@ const addOutSideEvent = (api) => (visible) => {
|
|
|
132
171
|
}
|
|
133
172
|
};
|
|
134
173
|
const initText = ({ state }) => () => {
|
|
135
|
-
let amount =
|
|
174
|
+
let amount = state.amount + "";
|
|
136
175
|
state.amountText = amount ? state.isFocus ? amount : formatNumber(state.amount, state.format) : "";
|
|
137
176
|
};
|
|
138
177
|
const onInputPreprocess = (props) => (value) => {
|
|
@@ -151,7 +190,7 @@ const onInputPreprocess = (props) => (value) => {
|
|
|
151
190
|
const onInput = ({ state, props, api }) => (value) => {
|
|
152
191
|
value = api.onInputPreprocess(value);
|
|
153
192
|
const { fraction, groupSeparator } = state.format;
|
|
154
|
-
value = event.target.value.replace(/^-+/, "-");
|
|
193
|
+
value = event.target.value !== void 0 ? event.target.value.replace(/^-+/, "-") : value.replace(/^-+/, "-");
|
|
155
194
|
const groups = value.split(groupSeparator).map((val) => val.trim());
|
|
156
195
|
value = groups.join("");
|
|
157
196
|
if (value !== "-" && api.getDecimal(value).isNaN()) {
|
|
@@ -184,7 +223,17 @@ const getPrecision = ({ service, props, currency }) => {
|
|
|
184
223
|
}
|
|
185
224
|
return __spreadValues(__spreadValues(__spreadProps(__spreadValues({}, defaultFmt), { fraction, rounding }), serFmt), format);
|
|
186
225
|
};
|
|
187
|
-
const getAmountText = ({ state, props }) => () =>
|
|
226
|
+
const getAmountText = ({ state, props }) => () => {
|
|
227
|
+
const isFilter = props.shape === "filter" && props.filter;
|
|
228
|
+
if (props.hideCurrency && typeof state.amountText === "string") {
|
|
229
|
+
return isFilter ? state.radioVal + state.amountText.replace(state.currency, "") : state.amountText.replace(state.currency, "");
|
|
230
|
+
} else {
|
|
231
|
+
return isFilter ? state.radioVal + state.amountText : state.amountText;
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
const getAmountTextWithoutCurrncy = ({ state }) => () => {
|
|
235
|
+
return state.amountText.replace(state.currency, "");
|
|
236
|
+
};
|
|
188
237
|
const watchModelValue = ({ api, state }) => () => {
|
|
189
238
|
let value = api.initAmount();
|
|
190
239
|
state.amount = value;
|
|
@@ -197,23 +246,47 @@ const watchCurrency = ({ api, state, editorState }) => (value) => {
|
|
|
197
246
|
state.lastCurrency = value;
|
|
198
247
|
api.initText();
|
|
199
248
|
};
|
|
200
|
-
const
|
|
249
|
+
const watchUiMode = ({ api, isMobileFirstMode: mf }) => (value) => {
|
|
250
|
+
if (mf && value === "default") {
|
|
251
|
+
api.addOutSideEvent(false);
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
const initAmount = ({ props, api }) => () => {
|
|
201
255
|
let value = props.modelValue;
|
|
202
256
|
value = value === null || isNaN(Number(value)) ? "" : value;
|
|
203
257
|
if (!props.negative && value && Number(value) < 0) {
|
|
204
|
-
|
|
205
|
-
|
|
258
|
+
if (props.stringMode) {
|
|
259
|
+
value = api.getDecimal(String(value).replace(/^-/, "")).toString();
|
|
260
|
+
} else {
|
|
261
|
+
value -= 0;
|
|
262
|
+
value = Math.abs(value);
|
|
263
|
+
}
|
|
206
264
|
}
|
|
207
265
|
return value;
|
|
208
266
|
};
|
|
267
|
+
const handleClearClick = ({ state, emit, editorState }) => (event2) => {
|
|
268
|
+
event2.stopPropagation();
|
|
269
|
+
state.amountText = "";
|
|
270
|
+
state.radioVal = "";
|
|
271
|
+
editorState.amount = "";
|
|
272
|
+
state.clearValues = true;
|
|
273
|
+
emit("clear");
|
|
274
|
+
};
|
|
275
|
+
const handleChange = ({ state, emit }) => () => {
|
|
276
|
+
emit("filter-change", state.radioVal);
|
|
277
|
+
};
|
|
209
278
|
export {
|
|
210
279
|
addOutSideEvent,
|
|
280
|
+
closeDetailEidtor,
|
|
211
281
|
closePopper,
|
|
212
282
|
emitChange,
|
|
213
283
|
getAmountText,
|
|
284
|
+
getAmountTextWithoutCurrncy,
|
|
214
285
|
getDecimal,
|
|
215
286
|
getPrecision,
|
|
216
287
|
handelClick,
|
|
288
|
+
handleChange,
|
|
289
|
+
handleClearClick,
|
|
217
290
|
initAmount,
|
|
218
291
|
initService,
|
|
219
292
|
initText,
|
|
@@ -222,10 +295,12 @@ export {
|
|
|
222
295
|
inputFocus,
|
|
223
296
|
onInput,
|
|
224
297
|
onInputPreprocess,
|
|
298
|
+
openDetailEditor,
|
|
225
299
|
popInput,
|
|
226
300
|
reset,
|
|
227
301
|
save,
|
|
228
302
|
toggleVisible,
|
|
229
303
|
watchCurrency,
|
|
230
|
-
watchModelValue
|
|
304
|
+
watchModelValue,
|
|
305
|
+
watchUiMode
|
|
231
306
|
};
|
package/amount/vue.js
CHANGED
|
@@ -23,7 +23,13 @@ import {
|
|
|
23
23
|
watchModelValue,
|
|
24
24
|
watchCurrency,
|
|
25
25
|
onInputPreprocess,
|
|
26
|
-
initAmount
|
|
26
|
+
initAmount,
|
|
27
|
+
handleClearClick,
|
|
28
|
+
handleChange,
|
|
29
|
+
closeDetailEidtor,
|
|
30
|
+
openDetailEditor,
|
|
31
|
+
getAmountTextWithoutCurrncy,
|
|
32
|
+
watchUiMode
|
|
27
33
|
} from "./index";
|
|
28
34
|
const api = [
|
|
29
35
|
"t",
|
|
@@ -38,9 +44,26 @@ const api = [
|
|
|
38
44
|
"inputFocus",
|
|
39
45
|
"closePopper",
|
|
40
46
|
"onInput",
|
|
41
|
-
"getAmountText"
|
|
47
|
+
"getAmountText",
|
|
48
|
+
"handleClearClick",
|
|
49
|
+
"handleChange",
|
|
50
|
+
"openDetailEditor",
|
|
51
|
+
"closeDetailEidtor",
|
|
52
|
+
"uiMode",
|
|
53
|
+
"getAmountTextWithoutCurrncy",
|
|
54
|
+
"watchUiMode"
|
|
42
55
|
];
|
|
43
|
-
const initState = ({
|
|
56
|
+
const initState = ({
|
|
57
|
+
reactive,
|
|
58
|
+
computed,
|
|
59
|
+
props,
|
|
60
|
+
$service,
|
|
61
|
+
editorState,
|
|
62
|
+
vm,
|
|
63
|
+
api: api2,
|
|
64
|
+
constants,
|
|
65
|
+
parent
|
|
66
|
+
}) => {
|
|
44
67
|
const state = reactive({
|
|
45
68
|
visible: false,
|
|
46
69
|
amount: props.modelValue || "",
|
|
@@ -53,45 +76,88 @@ const initState = ({ reactive, computed, props, $service, editorState }) => {
|
|
|
53
76
|
lastInput: props.modelValue,
|
|
54
77
|
lastCurrency: props.currency,
|
|
55
78
|
lastDate: props.date,
|
|
56
|
-
format: computed(() =>
|
|
57
|
-
|
|
58
|
-
|
|
79
|
+
format: computed(() => {
|
|
80
|
+
return __spreadProps(__spreadValues({}, getPrecision({ service: $service, props, currency: editorState.currency })), {
|
|
81
|
+
prefix: state.currency
|
|
82
|
+
});
|
|
83
|
+
}),
|
|
84
|
+
disabled: computed(() => props.disabled || (parent.tinyForm || {}).disabled),
|
|
85
|
+
displayOnly: computed(() => props.displayOnly || (parent.tinyForm || {}).displayOnly),
|
|
86
|
+
theme: vm.theme,
|
|
87
|
+
radioVal: "",
|
|
88
|
+
clearValues: false,
|
|
89
|
+
amountValue: computed(() => api2.getAmountText()),
|
|
90
|
+
amountNumberValue: computed(() => api2.getAmountTextWithoutCurrncy()),
|
|
91
|
+
filterMenu: constants.FILTER_OPTION,
|
|
92
|
+
editorPhase: "close"
|
|
93
|
+
// 'close' | 'selection' | 'currency' | 'date',
|
|
59
94
|
});
|
|
60
95
|
return state;
|
|
61
96
|
};
|
|
62
|
-
const initEditorState = ({
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
97
|
+
const initEditorState = ({
|
|
98
|
+
reactive,
|
|
99
|
+
props
|
|
100
|
+
}) => {
|
|
101
|
+
return reactive({
|
|
102
|
+
amount: "",
|
|
103
|
+
date: "",
|
|
104
|
+
currency: props.currency,
|
|
105
|
+
lastInput: props.modelValue
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
const initUiMode = ({ useBreakpoint }) => {
|
|
109
|
+
return useBreakpoint().current;
|
|
110
|
+
};
|
|
111
|
+
const initApi = ({
|
|
112
|
+
api: api2,
|
|
113
|
+
t,
|
|
114
|
+
editorState,
|
|
115
|
+
props,
|
|
116
|
+
state,
|
|
117
|
+
emit,
|
|
118
|
+
vm,
|
|
119
|
+
uiMode,
|
|
120
|
+
isMobileFirstMode
|
|
121
|
+
}) => {
|
|
69
122
|
Object.assign(api2, {
|
|
70
123
|
state,
|
|
71
124
|
t,
|
|
72
125
|
editorState,
|
|
126
|
+
uiMode,
|
|
73
127
|
getDecimal: getDecimal(props),
|
|
74
128
|
innerFormat: innerFormat({ state, props }),
|
|
75
129
|
getAmountText: getAmountText({ state, props }),
|
|
76
|
-
|
|
130
|
+
getAmountTextWithoutCurrncy: getAmountTextWithoutCurrncy({ state }),
|
|
131
|
+
initAmount: initAmount({ props, api: api2 }),
|
|
77
132
|
onInputPreprocess: onInputPreprocess(props),
|
|
78
133
|
onInput: onInput({ state, props, api: api2 }),
|
|
79
134
|
initText: initText({ state }),
|
|
80
135
|
inputFocus: inputFocus({ state, props }),
|
|
81
136
|
inputBlur: inputBlur({ api: api2, props, state }),
|
|
82
137
|
closePopper: closePopper(state),
|
|
83
|
-
emitChange: emitChange({ emit, state }),
|
|
138
|
+
emitChange: emitChange({ emit, state, props, api: api2 }),
|
|
84
139
|
popInput: popInput({ editorState, api: api2, state, props }),
|
|
85
|
-
save: save({ api: api2, state, editorState
|
|
86
|
-
reset: reset({
|
|
87
|
-
handelClick: handelClick({ api: api2,
|
|
140
|
+
save: save({ api: api2, state, editorState }),
|
|
141
|
+
reset: reset({ state, editorState }),
|
|
142
|
+
handelClick: handelClick({ api: api2, vm }),
|
|
88
143
|
addOutSideEvent: addOutSideEvent(api2),
|
|
89
144
|
watchModelValue: watchModelValue({ api: api2, state }),
|
|
90
145
|
watchCurrency: watchCurrency({ api: api2, state, editorState }),
|
|
91
|
-
|
|
146
|
+
watchUiMode: watchUiMode({ api: api2, isMobileFirstMode }),
|
|
147
|
+
toggleVisible: toggleVisible({ api: api2, props, state, editorState, uiMode, isMobileFirstMode }),
|
|
148
|
+
handleClearClick: handleClearClick({ state, emit, editorState }),
|
|
149
|
+
handleChange: handleChange({ state, emit }),
|
|
150
|
+
openDetailEditor: openDetailEditor({ state }),
|
|
151
|
+
closeDetailEidtor: closeDetailEidtor({ state, props, api: api2 })
|
|
92
152
|
});
|
|
93
153
|
};
|
|
94
|
-
const initWatch = ({
|
|
154
|
+
const initWatch = ({
|
|
155
|
+
watch,
|
|
156
|
+
props,
|
|
157
|
+
state,
|
|
158
|
+
api: api2,
|
|
159
|
+
uiMode
|
|
160
|
+
}) => {
|
|
95
161
|
watch(() => props.modelValue, api2.watchModelValue, { immediate: true });
|
|
96
162
|
watch(() => props.currency, api2.watchCurrency, { immediate: true });
|
|
97
163
|
watch(
|
|
@@ -114,16 +180,26 @@ const initWatch = ({ watch, props, state, api: api2 }) => {
|
|
|
114
180
|
state.format.fraction = value;
|
|
115
181
|
}
|
|
116
182
|
);
|
|
183
|
+
watch(uiMode, api2.watchUiMode);
|
|
117
184
|
};
|
|
118
|
-
const renderless = (props, { onUnmounted, computed, reactive, watch }, { t, emit,
|
|
185
|
+
const renderless = (props, { onUnmounted, computed, reactive, watch, inject }, { t, emit, vm, service, parent, constants, isMobileFirstMode, useBreakpoint }) => {
|
|
186
|
+
var _a;
|
|
119
187
|
const api2 = {};
|
|
120
188
|
const $service = initService(service);
|
|
121
189
|
const editorState = initEditorState({ reactive, props });
|
|
122
|
-
const state = initState({ reactive, computed, props, $service, editorState });
|
|
123
|
-
|
|
124
|
-
api2
|
|
125
|
-
|
|
126
|
-
|
|
190
|
+
const state = initState({ reactive, computed, props, $service, editorState, vm, api: api2, constants, parent });
|
|
191
|
+
const uiMode = initUiMode({ useBreakpoint });
|
|
192
|
+
initApi({ api: api2, t, editorState, props, state, emit, vm, uiMode, isMobileFirstMode });
|
|
193
|
+
parent.tinyForm = parent.tinyForm || inject("form", null);
|
|
194
|
+
(_a = api2 == null ? void 0 : api2.getDecimal) == null ? void 0 : _a.call(api2, 0);
|
|
195
|
+
initWatch({ watch, props, state, api: api2, uiMode });
|
|
196
|
+
onUnmounted(() => {
|
|
197
|
+
var _a2;
|
|
198
|
+
return (_a2 = api2 == null ? void 0 : api2.addOutSideEvent) == null ? void 0 : _a2.call(api2, false);
|
|
199
|
+
});
|
|
200
|
+
parent.$on("handle-clear", (event) => {
|
|
201
|
+
api2.handleClearClick(event);
|
|
202
|
+
});
|
|
127
203
|
return api2;
|
|
128
204
|
};
|
|
129
205
|
export {
|
package/anchor/index.js
CHANGED
|
@@ -116,6 +116,7 @@ const unmounted = ({ state, api }) => () => {
|
|
|
116
116
|
};
|
|
117
117
|
const onItersectionObserver = ({ state, props, api, vm, emit }) => () => {
|
|
118
118
|
const { expandLink, scrollContainer } = state;
|
|
119
|
+
state.currentLink && updateSkidPosition({ vm, state, emit });
|
|
119
120
|
state.intersectionObserver = new IntersectionObserver(
|
|
120
121
|
(entries) => {
|
|
121
122
|
const { top } = scrollContainer.getBoundingClientRect();
|
package/area/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
const fetchDefaultData = ({ emit, fetchArea, nextTick, props,
|
|
2
|
+
const fetchDefaultData = ({ emit, fetchArea, nextTick, props, vm, state }) => () => {
|
|
3
3
|
let parent = "";
|
|
4
4
|
nextTick(() => {
|
|
5
|
-
emit("change-jcr", parent, refs.refInstance.$parent);
|
|
5
|
+
emit("change-jcr", parent, vm.$refs.refInstance.$parent);
|
|
6
6
|
});
|
|
7
7
|
let promise;
|
|
8
8
|
if (props.fetchJcr) {
|
|
@@ -20,10 +20,10 @@ const fetchDefaultData = ({ emit, fetchArea, nextTick, props, refs, state }) =>
|
|
|
20
20
|
state.office = "";
|
|
21
21
|
emit("update:modelValue", [state.jcr, state.region, state.rep, state.office]);
|
|
22
22
|
};
|
|
23
|
-
const getRegion = ({ emit, fetchArea, nextTick, props,
|
|
23
|
+
const getRegion = ({ emit, fetchArea, nextTick, props, vm, state }) => (value) => {
|
|
24
24
|
state.jcr = value;
|
|
25
25
|
nextTick(() => {
|
|
26
|
-
emit("change-region", value, refs.refInstance.$parent);
|
|
26
|
+
emit("change-region", value, vm.$refs.refInstance.$parent);
|
|
27
27
|
});
|
|
28
28
|
let promise;
|
|
29
29
|
if (props.fetchRegion) {
|
|
@@ -40,10 +40,10 @@ const getRegion = ({ emit, fetchArea, nextTick, props, refs, state }) => (value)
|
|
|
40
40
|
state.rep = "";
|
|
41
41
|
emit("update:modelValue", [state.jcr, state.region, state.rep, state.office]);
|
|
42
42
|
};
|
|
43
|
-
const getRep = ({ emit, fetchArea, nextTick, props,
|
|
43
|
+
const getRep = ({ emit, fetchArea, nextTick, props, vm, state }) => (value) => {
|
|
44
44
|
state.region = value;
|
|
45
45
|
nextTick(() => {
|
|
46
|
-
emit("change-rep", value, refs.refInstance.$parent);
|
|
46
|
+
emit("change-rep", value, vm.$refs.refInstance.$parent);
|
|
47
47
|
});
|
|
48
48
|
let promise;
|
|
49
49
|
if (props.fetchRep) {
|
|
@@ -59,10 +59,10 @@ const getRep = ({ emit, fetchArea, nextTick, props, refs, state }) => (value) =>
|
|
|
59
59
|
state.rep = "";
|
|
60
60
|
emit("update:modelValue", [state.jcr, state.region, state.rep, state.office]);
|
|
61
61
|
};
|
|
62
|
-
const getOffice = ({ emit, fetchArea, nextTick, props,
|
|
62
|
+
const getOffice = ({ emit, fetchArea, nextTick, props, vm, state }) => (value) => {
|
|
63
63
|
state.rep = value;
|
|
64
64
|
nextTick(() => {
|
|
65
|
-
emit("change-office", value, refs.refInstance.$parent);
|
|
65
|
+
emit("change-office", value, vm.$refs.refInstance.$parent);
|
|
66
66
|
});
|
|
67
67
|
let promise;
|
|
68
68
|
if (props.fetchOffice) {
|
package/area/vue.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import { getRegion, changeOffice, getRep, getOffice, fetchDefaultData, beforeMount } from "./index";
|
|
3
3
|
const api = ["state", "getRep", "getRegion", "getOffice", "changeOffice"];
|
|
4
|
-
const renderless = (props, { onBeforeMount, reactive }, { emit, service,
|
|
4
|
+
const renderless = (props, { onBeforeMount, reactive }, { emit, service, vm, nextTick }) => {
|
|
5
5
|
const api2 = {};
|
|
6
6
|
const { fetchArea } = service || {};
|
|
7
7
|
const state = reactive({
|
|
@@ -18,10 +18,10 @@ const renderless = (props, { onBeforeMount, reactive }, { emit, service, refs, n
|
|
|
18
18
|
state,
|
|
19
19
|
changeOffice: changeOffice({ emit, state }),
|
|
20
20
|
beforeMount: beforeMount({ api: api2, props }),
|
|
21
|
-
getRep: getRep({ emit, fetchArea, nextTick, props,
|
|
22
|
-
getRegion: getRegion({ emit, fetchArea, nextTick, props,
|
|
23
|
-
getOffice: getOffice({ emit, fetchArea, nextTick, props,
|
|
24
|
-
fetchDefaultData: fetchDefaultData({ emit, fetchArea, nextTick, props,
|
|
21
|
+
getRep: getRep({ emit, fetchArea, nextTick, props, vm, state }),
|
|
22
|
+
getRegion: getRegion({ emit, fetchArea, nextTick, props, vm, state }),
|
|
23
|
+
getOffice: getOffice({ emit, fetchArea, nextTick, props, vm, state }),
|
|
24
|
+
fetchDefaultData: fetchDefaultData({ emit, fetchArea, nextTick, props, vm, state })
|
|
25
25
|
});
|
|
26
26
|
onBeforeMount(api2.beforeMount);
|
|
27
27
|
return api2;
|
package/async-flowchart/index.js
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import ResizeObserver from "../common/deps/ResizeObserver";
|
|
3
|
-
const observeContainerSize = ({
|
|
3
|
+
const observeContainerSize = ({
|
|
4
|
+
nextTick,
|
|
5
|
+
vm,
|
|
6
|
+
state
|
|
7
|
+
}) => () => {
|
|
4
8
|
nextTick(() => {
|
|
5
9
|
const observedElement = vm.$el;
|
|
6
10
|
if (observedElement) {
|
|
7
11
|
state.temporary.observer = new ResizeObserver(() => {
|
|
8
12
|
window.requestAnimationFrame(() => {
|
|
13
|
+
var _a;
|
|
9
14
|
if (vm.$refs.chart) {
|
|
10
15
|
vm.$refs.chart.refresh({
|
|
11
16
|
graphWidth: observedElement.offsetWidth,
|
|
12
|
-
adjustX: -state.config.nodeWrapperSize / 2
|
|
17
|
+
adjustX: -(((_a = state == null ? void 0 : state.config) == null ? void 0 : _a.nodeWrapperSize) || 0) / 2
|
|
13
18
|
});
|
|
14
19
|
}
|
|
15
20
|
});
|
|
@@ -27,7 +32,15 @@ const unobserveContainerSize = (state) => () => {
|
|
|
27
32
|
state.temporary.observed = null;
|
|
28
33
|
}
|
|
29
34
|
};
|
|
30
|
-
const fetchData = ({
|
|
35
|
+
const fetchData = ({
|
|
36
|
+
Loading,
|
|
37
|
+
props,
|
|
38
|
+
state,
|
|
39
|
+
vm,
|
|
40
|
+
markRaw,
|
|
41
|
+
api,
|
|
42
|
+
nextTick
|
|
43
|
+
}) => () => {
|
|
31
44
|
if (typeof props.fetch === "function") {
|
|
32
45
|
api.unobserveContainerSize();
|
|
33
46
|
state.loading = true;
|