@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/card/index.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
import { isNull } from "../common/type";
|
|
3
|
+
const handelIconClick = ({ emit }) => (item, index, event) => {
|
|
4
|
+
if (item.disabled)
|
|
5
|
+
return;
|
|
6
|
+
emit("icon-click", item, index, event);
|
|
7
|
+
};
|
|
8
|
+
const getSliceNum = ({ props }) => () => {
|
|
9
|
+
const sliceNumMap = {
|
|
10
|
+
"mini": 1,
|
|
11
|
+
"small": 2,
|
|
12
|
+
"medium": 3,
|
|
13
|
+
"large": 5
|
|
14
|
+
};
|
|
15
|
+
return sliceNumMap[props.size];
|
|
16
|
+
};
|
|
17
|
+
const getIconNum = ({ props }) => () => {
|
|
18
|
+
const iconNumMap = {
|
|
19
|
+
"mini": 2,
|
|
20
|
+
"small": 3,
|
|
21
|
+
"medium": 4,
|
|
22
|
+
"large": 6
|
|
23
|
+
};
|
|
24
|
+
return iconNumMap[props.size];
|
|
25
|
+
};
|
|
26
|
+
const handleChange = ({ constants, dispatch, emit, state, nextTick }) => () => {
|
|
27
|
+
nextTick(() => {
|
|
28
|
+
emit("change", state.model);
|
|
29
|
+
state.isGroup && dispatch(constants.CARD_GROUP, "handleChange", [state.model]);
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
const isGroup = ({ constants, parent: $parent, state }) => () => {
|
|
33
|
+
let parent = $parent;
|
|
34
|
+
while (parent) {
|
|
35
|
+
if (parent.$options.componentName !== constants.CARD_GROUP) {
|
|
36
|
+
parent = parent.$parent;
|
|
37
|
+
} else {
|
|
38
|
+
state.cardGroup = parent;
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return false;
|
|
43
|
+
};
|
|
44
|
+
const getSize = ({ props, state }) => () => state.isGroup ? state.cardGroup.size || props.size : props.size;
|
|
45
|
+
const isDisabled = ({ props, state }) => () => props.disabled || state.cardGroup.disabled;
|
|
46
|
+
const getModel = ({ props, state }) => () => {
|
|
47
|
+
const model = state.isGroup ? state.store : props.modelValue !== void 0 ? props.modelValue : state.selfModel;
|
|
48
|
+
if (state.isCheckbox) {
|
|
49
|
+
return isNull(model) ? [] : model;
|
|
50
|
+
} else {
|
|
51
|
+
return state.store;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const setModel = ({ constants, dispatch, emit, state }) => (val) => {
|
|
55
|
+
if (state.isGroup) {
|
|
56
|
+
dispatch(constants.CARD_GROUP, "update:modelValue", [val]);
|
|
57
|
+
} else {
|
|
58
|
+
emit("update:modelValue", val);
|
|
59
|
+
state.isCheckbox && (state.selfModel = val);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const computedStore = ({ state, props }) => () => state.isGroup ? state.cardGroup.modelValue : props.modelValue;
|
|
63
|
+
const getItemChecked = ({ props, state }) => () => {
|
|
64
|
+
if (!state.checkType)
|
|
65
|
+
return;
|
|
66
|
+
if (state.isCheckbox) {
|
|
67
|
+
return state.isGroup || Array.isArray(state.model) ? ~state.model.indexOf(props.label) : state.model;
|
|
68
|
+
} else {
|
|
69
|
+
return state.model === props.label;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
export {
|
|
73
|
+
computedStore,
|
|
74
|
+
getIconNum,
|
|
75
|
+
getItemChecked,
|
|
76
|
+
getModel,
|
|
77
|
+
getSize,
|
|
78
|
+
getSliceNum,
|
|
79
|
+
handelIconClick,
|
|
80
|
+
handleChange,
|
|
81
|
+
isDisabled,
|
|
82
|
+
isGroup,
|
|
83
|
+
setModel
|
|
84
|
+
};
|
package/card/vue.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
import {
|
|
3
|
+
handelIconClick,
|
|
4
|
+
getSliceNum,
|
|
5
|
+
getIconNum,
|
|
6
|
+
handleChange,
|
|
7
|
+
isGroup,
|
|
8
|
+
getSize,
|
|
9
|
+
isDisabled,
|
|
10
|
+
getModel,
|
|
11
|
+
setModel,
|
|
12
|
+
computedStore,
|
|
13
|
+
getItemChecked
|
|
14
|
+
} from "./index";
|
|
15
|
+
const api = ["state", "handelIconClick"];
|
|
16
|
+
const renderless = (props, { reactive, watch, computed }, { vm, parent, emit, constants, nextTick, dispatch }) => {
|
|
17
|
+
const api2 = {};
|
|
18
|
+
const state = reactive({
|
|
19
|
+
cardGroup: {},
|
|
20
|
+
selfModel: false,
|
|
21
|
+
itemChecked: computed(() => api2.getItemChecked()),
|
|
22
|
+
sliceNum: computed(() => api2.getSliceNum()),
|
|
23
|
+
iconNum: computed(() => api2.getIconNum()),
|
|
24
|
+
effectOptions: computed(() => props.options.filter((item) => !item.hidden)),
|
|
25
|
+
store: computed(() => api2.computedStore()),
|
|
26
|
+
cardClass: computed(() => props.cardClass || state.cardGroup.cardClass || ""),
|
|
27
|
+
autoWidth: computed(() => props.autoWidth || state.cardGroup.autoWidth),
|
|
28
|
+
height: computed(() => props.height || state.cardGroup.height),
|
|
29
|
+
status: computed(() => props.status || state.cardGroup.status || "default"),
|
|
30
|
+
checkType: computed(() => props.checkType || state.cardGroup.checkType),
|
|
31
|
+
type: computed(() => props.type || state.cardGroup.type || "text"),
|
|
32
|
+
isCheckbox: computed(() => state.checkType === "checkbox"),
|
|
33
|
+
isGroup: computed(() => api2.isGroup()),
|
|
34
|
+
size: computed(() => api2.getSize()),
|
|
35
|
+
disabled: computed(() => api2.isDisabled()),
|
|
36
|
+
model: computed({
|
|
37
|
+
get: () => api2.getModel(),
|
|
38
|
+
set: (val) => api2.setModel(val)
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
Object.assign(api2, {
|
|
42
|
+
state,
|
|
43
|
+
getSize: getSize({ props, state }),
|
|
44
|
+
getModel: getModel({ props, state }),
|
|
45
|
+
isGroup: isGroup({ constants, parent, state }),
|
|
46
|
+
isDisabled: isDisabled({ props, state }),
|
|
47
|
+
setModel: setModel({ constants, dispatch, emit, props, vm, state }),
|
|
48
|
+
handleChange: handleChange({ constants, dispatch, emit, state, nextTick }),
|
|
49
|
+
getSliceNum: getSliceNum({ state, props }),
|
|
50
|
+
getIconNum: getIconNum({ state, props }),
|
|
51
|
+
computedStore: computedStore({ state, props }),
|
|
52
|
+
handelIconClick: handelIconClick({ emit }),
|
|
53
|
+
getItemChecked: getItemChecked({ state, props })
|
|
54
|
+
});
|
|
55
|
+
watch(() => state.model, api2.handleChange, { deep: true });
|
|
56
|
+
watch(
|
|
57
|
+
() => state.disabled,
|
|
58
|
+
() => {
|
|
59
|
+
state.effectOptions.forEach((item) => {
|
|
60
|
+
item.disabled = item.disabled || state.disabled;
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
{ immediate: true }
|
|
64
|
+
);
|
|
65
|
+
return api2;
|
|
66
|
+
};
|
|
67
|
+
export {
|
|
68
|
+
api,
|
|
69
|
+
renderless
|
|
70
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
const getStyle = ({ props }) => () => {
|
|
3
|
+
const size = props.size || "medium";
|
|
4
|
+
const sizeMap = {
|
|
5
|
+
large: "31.25rem",
|
|
6
|
+
medium: "18.75rem",
|
|
7
|
+
small: "12.5rem",
|
|
8
|
+
mini: "6.25rem"
|
|
9
|
+
};
|
|
10
|
+
return {
|
|
11
|
+
"grid-template-columns": `repeat(auto-fit, minmax(${sizeMap[size]}, 1fr))`
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
getStyle
|
|
16
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
import { getStyle } from "./index";
|
|
3
|
+
const api = ["state"];
|
|
4
|
+
const renderless = (props, { reactive, computed }, { vm }) => {
|
|
5
|
+
const api2 = {};
|
|
6
|
+
const state = reactive({
|
|
7
|
+
style: computed(() => api2.getStyle())
|
|
8
|
+
});
|
|
9
|
+
Object.assign(api2, {
|
|
10
|
+
state,
|
|
11
|
+
getStyle: getStyle({ props })
|
|
12
|
+
});
|
|
13
|
+
vm.$on("handleChange", (value) => {
|
|
14
|
+
vm.$emit("change", value);
|
|
15
|
+
});
|
|
16
|
+
return api2;
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
api,
|
|
20
|
+
renderless
|
|
21
|
+
};
|
package/card-template/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import PopupManager from "
|
|
2
|
+
import PopupManager from "../common/deps/popup-manager";
|
|
3
3
|
const toolClick = (showMoreTools) => (cb) => {
|
|
4
4
|
typeof cb === "function" && cb();
|
|
5
5
|
showMoreTools.value = false;
|
package/carousel/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import throttle from "
|
|
3
|
-
import { POSITION } from "
|
|
2
|
+
import throttle from "../common/deps/throttle";
|
|
3
|
+
import { POSITION } from "../common";
|
|
4
4
|
const handleMouseEnter = ({ api, state }) => () => {
|
|
5
5
|
state.hover = true;
|
|
6
6
|
api.pauseTimer();
|
|
@@ -99,6 +99,13 @@ const watchAutoplay = (api) => (value) => value ? api.startTimer() : api.pauseTi
|
|
|
99
99
|
const throttledArrowClick = (api) => throttle(300, true, (index) => api.setActiveItem(index));
|
|
100
100
|
const throttledIndicatorHover = (api) => throttle(300, (index) => api.handleIndicatorHover(index));
|
|
101
101
|
const computedHasLable = (items) => items.some((item) => item.label.toString().length > 0);
|
|
102
|
+
const computedStyle = ({ props }) => () => {
|
|
103
|
+
if (props.height) {
|
|
104
|
+
return { "height": props.height };
|
|
105
|
+
} else {
|
|
106
|
+
return { "aspect-ratio": props.aspectRatio.replace(":", " / ") };
|
|
107
|
+
}
|
|
108
|
+
};
|
|
102
109
|
const onComplete = ({ count, emit, props, state }) => (total) => {
|
|
103
110
|
if (count++ === total) {
|
|
104
111
|
state.completed = true;
|
|
@@ -108,8 +115,85 @@ const onComplete = ({ count, emit, props, state }) => (total) => {
|
|
|
108
115
|
emit("complete");
|
|
109
116
|
}
|
|
110
117
|
};
|
|
118
|
+
const touchstart = ({ state, api }) => (event) => {
|
|
119
|
+
if (state.items.length <= 1 || ~state.noTouchNode.indexOf(event.target.nodeName))
|
|
120
|
+
return;
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
event.stopPropagation();
|
|
123
|
+
resetTouchStatus(state);
|
|
124
|
+
api.pauseTimer();
|
|
125
|
+
state.itemsTranslate = state.items.map((item) => item.state.translate);
|
|
126
|
+
state.moving = true;
|
|
127
|
+
state.touchTime = Date.now();
|
|
128
|
+
state.startPos.X = event.touches[0].clientX;
|
|
129
|
+
state.startPos.Y = event.touches[0].clientY;
|
|
130
|
+
};
|
|
131
|
+
const touchmove = ({ props, state, vm }) => (event) => {
|
|
132
|
+
if (state.items.length <= 1 || ~state.noTouchNode.indexOf(event.target.nodeName))
|
|
133
|
+
return;
|
|
134
|
+
const touch = event.touches[0];
|
|
135
|
+
const itemsLen = state.items.length;
|
|
136
|
+
const carousel = vm.$refs.carousel;
|
|
137
|
+
state.deltaPos.X = touch.clientX - state.startPos.X;
|
|
138
|
+
state.deltaPos.Y = touch.clientY - state.startPos.Y;
|
|
139
|
+
state.offsetPos.X = Math.abs(state.deltaPos.X);
|
|
140
|
+
state.offsetPos.Y = Math.abs(state.deltaPos.Y);
|
|
141
|
+
state.direction = state.direction || getDirection(state.offsetPos.X, state.offsetPos.Y);
|
|
142
|
+
state.isCorrectDirection = state.direction === props.type;
|
|
143
|
+
if (!state.isCorrectDirection)
|
|
144
|
+
return;
|
|
145
|
+
state.size = state.direction === "horizontal" ? carousel.offsetWidth : carousel.offsetHeight;
|
|
146
|
+
const nextIndex = state.activeIndex === itemsLen - 1 ? 0 : state.activeIndex + 1;
|
|
147
|
+
const prevIndex = state.activeIndex === 0 ? itemsLen - 1 : state.activeIndex - 1;
|
|
148
|
+
state.delta = state.direction === "horizontal" ? state.deltaPos.X : state.deltaPos.Y;
|
|
149
|
+
state.moveDisable = !props.loop && (state.activeIndex === 0 && state.delta > 0 || state.activeIndex === state.items.length - 1 && state.delta < 0);
|
|
150
|
+
if (state.moveDisable)
|
|
151
|
+
return;
|
|
152
|
+
state.items[state.activeIndex].setDelta(state.delta);
|
|
153
|
+
state.items[nextIndex].setDelta(state.delta);
|
|
154
|
+
if (itemsLen > 2) {
|
|
155
|
+
state.items[prevIndex].setDelta(state.delta);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
const touchend = ({ state, api }) => (event) => {
|
|
159
|
+
if (state.moveDisable || state.items.length <= 1 || ~state.noTouchNode.indexOf(event.target.nodeName))
|
|
160
|
+
return;
|
|
161
|
+
const speed = state.delta / (Date.now() - state.touchTime);
|
|
162
|
+
const isShouldMove = Math.abs(speed) > 0.3 || Math.abs(state.delta) > +(state.size / 2).toFixed(2);
|
|
163
|
+
state.moving = false;
|
|
164
|
+
state.itemsTranslate.forEach((item, index) => {
|
|
165
|
+
state.items[index].setDelta(0);
|
|
166
|
+
});
|
|
167
|
+
if (isShouldMove && state.isCorrectDirection) {
|
|
168
|
+
state.delta < 0 ? api.next() : api.prev();
|
|
169
|
+
} else if (Math.abs(state.delta) > 1) {
|
|
170
|
+
state.items.forEach((item) => {
|
|
171
|
+
item.resetAnimatingMf();
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
api.startTimer();
|
|
175
|
+
};
|
|
176
|
+
function getDirection(x, y) {
|
|
177
|
+
const MIN_DISTANCE = 10;
|
|
178
|
+
if (x > y && x > MIN_DISTANCE) {
|
|
179
|
+
return "horizontal";
|
|
180
|
+
}
|
|
181
|
+
if (y > x && y > MIN_DISTANCE) {
|
|
182
|
+
return "vertical";
|
|
183
|
+
}
|
|
184
|
+
return "";
|
|
185
|
+
}
|
|
186
|
+
function resetTouchStatus(state) {
|
|
187
|
+
state.direction = "";
|
|
188
|
+
state.delta = 0;
|
|
189
|
+
state.deltaPos.X = 0;
|
|
190
|
+
state.deltaPos.Y = 0;
|
|
191
|
+
state.offsetPos.X = 0;
|
|
192
|
+
state.offsetPos.Y = 0;
|
|
193
|
+
}
|
|
111
194
|
export {
|
|
112
195
|
computedHasLable,
|
|
196
|
+
computedStyle,
|
|
113
197
|
handleButtonEnter,
|
|
114
198
|
handleButtonLeave,
|
|
115
199
|
handleIndicatorClick,
|
|
@@ -127,6 +211,9 @@ export {
|
|
|
127
211
|
startTimer,
|
|
128
212
|
throttledArrowClick,
|
|
129
213
|
throttledIndicatorHover,
|
|
214
|
+
touchend,
|
|
215
|
+
touchmove,
|
|
216
|
+
touchstart,
|
|
130
217
|
watchActiveIndex,
|
|
131
218
|
watchAutoplay,
|
|
132
219
|
watchItems
|
package/carousel/vue.js
CHANGED
|
@@ -20,9 +20,12 @@ import {
|
|
|
20
20
|
watchAutoplay,
|
|
21
21
|
throttledArrowClick,
|
|
22
22
|
throttledIndicatorHover,
|
|
23
|
-
computedHasLable
|
|
23
|
+
computedHasLable,
|
|
24
|
+
touchstart,
|
|
25
|
+
touchmove,
|
|
26
|
+
touchend
|
|
24
27
|
} from "./index";
|
|
25
|
-
import { addResizeListener, removeResizeListener } from "
|
|
28
|
+
import { addResizeListener, removeResizeListener } from "../common/deps/resize-event";
|
|
26
29
|
const api = [
|
|
27
30
|
"state",
|
|
28
31
|
"items",
|
|
@@ -47,7 +50,10 @@ const api = [
|
|
|
47
50
|
"handleIndicatorClick",
|
|
48
51
|
"handleIndicatorHover",
|
|
49
52
|
"throttledArrowClick",
|
|
50
|
-
"throttledIndicatorHover"
|
|
53
|
+
"throttledIndicatorHover",
|
|
54
|
+
"touchstart",
|
|
55
|
+
"touchmove",
|
|
56
|
+
"touchend"
|
|
51
57
|
];
|
|
52
58
|
const initState = ({ reactive, computed, api: api2 }) => {
|
|
53
59
|
const state = reactive({
|
|
@@ -61,10 +67,13 @@ const initState = ({ reactive, computed, api: api2 }) => {
|
|
|
61
67
|
});
|
|
62
68
|
return state;
|
|
63
69
|
};
|
|
64
|
-
const initApi = ({ api: api2, state, props, emit }) => {
|
|
70
|
+
const initApi = ({ api: api2, state, props, emit, vm }) => {
|
|
65
71
|
Object.assign(api2, {
|
|
66
72
|
state,
|
|
67
73
|
computedHasLable,
|
|
74
|
+
touchstart: touchstart({ state, api: api2 }),
|
|
75
|
+
touchmove: touchmove({ props, state, vm }),
|
|
76
|
+
touchend: touchend({ state, api: api2 }),
|
|
68
77
|
playSlides: playSlides({ props, state }),
|
|
69
78
|
pauseTimer: pauseTimer(state),
|
|
70
79
|
onComplete: onComplete({ count: 0, emit, props, state }),
|
|
@@ -133,7 +142,7 @@ const useResizeListener = ({ api: api2, onBeforeUnmount, onMounted, parent }) =>
|
|
|
133
142
|
const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive, watch }, { vm, parent, constants, emit, childrenHandler }) => {
|
|
134
143
|
const api2 = {};
|
|
135
144
|
const state = initState({ reactive, computed, api: api2 });
|
|
136
|
-
initApi({ api: api2, state, props, emit });
|
|
145
|
+
initApi({ api: api2, state, props, emit, vm });
|
|
137
146
|
const { updateItems } = useItems({
|
|
138
147
|
api: api2,
|
|
139
148
|
vm,
|
package/carousel-item/index.js
CHANGED
|
@@ -61,10 +61,18 @@ const computedTransform = ({ parent, TYPE_VERTICAL }) => (state) => {
|
|
|
61
61
|
transform: TRANSLATE
|
|
62
62
|
};
|
|
63
63
|
};
|
|
64
|
+
const resetAnimatingMf = (state) => () => {
|
|
65
|
+
state.animatingMf = false;
|
|
66
|
+
};
|
|
67
|
+
const setDelta = ({ state }) => (val) => {
|
|
68
|
+
state.delta = val;
|
|
69
|
+
};
|
|
64
70
|
export {
|
|
65
71
|
calculateTranslate,
|
|
66
72
|
computedTransform,
|
|
67
73
|
handleItemClick,
|
|
68
74
|
processIndex,
|
|
75
|
+
resetAnimatingMf,
|
|
76
|
+
setDelta,
|
|
69
77
|
translateItem
|
|
70
78
|
};
|
package/carousel-item/vue.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { processIndex, calculateTranslate, translateItem, handleItemClick, computedTransform } from "./index";
|
|
2
|
+
import { processIndex, calculateTranslate, translateItem, handleItemClick, computedTransform, resetAnimatingMf, setDelta } from "./index";
|
|
3
3
|
const api = [
|
|
4
4
|
"state",
|
|
5
5
|
"hover",
|
|
@@ -15,7 +15,9 @@ const api = [
|
|
|
15
15
|
"processIndex",
|
|
16
16
|
"calculateTranslate",
|
|
17
17
|
"translateItem",
|
|
18
|
-
"handleItemClick"
|
|
18
|
+
"handleItemClick",
|
|
19
|
+
"resetAnimatingMf",
|
|
20
|
+
"setDelta"
|
|
19
21
|
];
|
|
20
22
|
const renderless = (props, { computed, onMounted, onUnmounted, reactive }, { parent, dispatch }) => {
|
|
21
23
|
const api2 = {};
|
|
@@ -40,7 +42,9 @@ const renderless = (props, { computed, onMounted, onUnmounted, reactive }, { par
|
|
|
40
42
|
handleItemClick: handleItemClick(parent),
|
|
41
43
|
computedTransform: computedTransform({ parent, TYPE_VERTICAL }),
|
|
42
44
|
calculateTranslate: calculateTranslate({ CARD_SCALE, state }),
|
|
43
|
-
translateItem: translateItem({ api: api2, CARD_SCALE, parent, state })
|
|
45
|
+
translateItem: translateItem({ api: api2, CARD_SCALE, parent, state }),
|
|
46
|
+
setDelta: setDelta({ state }),
|
|
47
|
+
resetAnimatingMf: resetAnimatingMf(state)
|
|
44
48
|
});
|
|
45
49
|
onMounted(() => {
|
|
46
50
|
dispatch("Carousel", "updateItems", []);
|
package/cascader/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import browser from "
|
|
3
|
-
import { isNull } from "
|
|
4
|
-
import debounce from "
|
|
5
|
-
import { isEqual } from "
|
|
6
|
-
import { addResizeListener } from "
|
|
7
|
-
import { KEY_CODE, CASCADER } from "
|
|
2
|
+
import browser from "../common/browser";
|
|
3
|
+
import { isNull } from "../common/type";
|
|
4
|
+
import debounce from "../common/deps/debounce";
|
|
5
|
+
import { isEqual } from "../common/object";
|
|
6
|
+
import { addResizeListener } from "../common/deps/resize-event";
|
|
7
|
+
import { KEY_CODE, CASCADER } from "../common";
|
|
8
8
|
const initMigratingProps = () => ({
|
|
9
9
|
expandTrigger: { newProp: CASCADER.PropsExpandTri, type: String },
|
|
10
10
|
changeOnSelect: { newProp: CASCADER.PropsCheckStric, type: Boolean },
|
package/cascader/vue.js
CHANGED
|
@@ -31,9 +31,9 @@ import {
|
|
|
31
31
|
presentTextHandler,
|
|
32
32
|
handleBeforeUpdate
|
|
33
33
|
} from "./index";
|
|
34
|
-
import { removeResizeListener } from "
|
|
35
|
-
import userPopper from "
|
|
36
|
-
import { DATEPICKER } from "
|
|
34
|
+
import { removeResizeListener } from "../common/deps/resize-event";
|
|
35
|
+
import userPopper from "../common/deps/vue-popper";
|
|
36
|
+
import { DATEPICKER } from "../common";
|
|
37
37
|
const api = [
|
|
38
38
|
"state",
|
|
39
39
|
"getCheckedNodes",
|
package/cascader-menu/vue.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
2
|
import { handleExpand, handleMouseMove, clearHoverZone } from "./index";
|
|
3
|
-
import { CASCADER } from "
|
|
4
|
-
import { random } from "
|
|
3
|
+
import { CASCADER } from "../common";
|
|
4
|
+
import { random } from "../common/string";
|
|
5
5
|
const api = ["state", "handleMouseMove", "handleExpand"];
|
|
6
6
|
const renderless = (props, { computed, reactive }, { vm, parent }) => {
|
|
7
7
|
const refs = vm.$refs;
|
package/cascader-panel/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { isNull } from "
|
|
3
|
-
import { isEqual } from "
|
|
4
|
-
import { isEmpty } from "
|
|
5
|
-
import { KEY_CODE, CASCADER } from "
|
|
2
|
+
import { isNull } from "../common/type";
|
|
3
|
+
import { isEqual } from "../common/object";
|
|
4
|
+
import { isEmpty } from "../cascader";
|
|
5
|
+
import { KEY_CODE, CASCADER } from "../common";
|
|
6
6
|
const watchCheckedValue = ({ api, emit, props, state }) => (value) => {
|
|
7
7
|
if (!isEqual(value, props.modelValue)) {
|
|
8
8
|
state.checkStrictly && api.calculateCheckedNodePaths();
|
package/cascader-panel/node.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { isEqual } from "
|
|
3
|
-
import { capitalize } from "
|
|
4
|
-
import { isNull } from "
|
|
2
|
+
import { isEqual } from "../common/object";
|
|
3
|
+
import { capitalize } from "../common/string";
|
|
4
|
+
import { isNull } from "../common/type";
|
|
5
5
|
let uid = 0;
|
|
6
6
|
class Node {
|
|
7
7
|
constructor(data, config, parentNode) {
|
|
@@ -24,7 +24,7 @@ class Node {
|
|
|
24
24
|
const { config } = this;
|
|
25
25
|
const childrenKey = config.children;
|
|
26
26
|
const childrenData = this.data[childrenKey];
|
|
27
|
-
this.hasChildren = Array.isArray(childrenData)
|
|
27
|
+
this.hasChildren = Array.isArray(childrenData);
|
|
28
28
|
this.children = (childrenData || []).map((child) => new Node(child, config, this));
|
|
29
29
|
}
|
|
30
30
|
get isLeaf() {
|
package/cascader-panel/vue.js
CHANGED
|
@@ -25,8 +25,8 @@ import {
|
|
|
25
25
|
syncMenuState,
|
|
26
26
|
syncMultiCheckState
|
|
27
27
|
} from "./index";
|
|
28
|
-
import { merge } from "
|
|
29
|
-
import { isEmpty } from "
|
|
28
|
+
import { merge } from "../common/object";
|
|
29
|
+
import { isEmpty } from "../cascader";
|
|
30
30
|
import Store from "./store.js";
|
|
31
31
|
const api = [
|
|
32
32
|
"state",
|