@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
|
File without changes
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
import { isNull } from "../common/type";
|
|
3
|
+
const handelIconClick = ({ emit }) => (item, index) => {
|
|
4
|
+
if (item.disabled)
|
|
5
|
+
return;
|
|
6
|
+
emit("icon-click", item, index);
|
|
7
|
+
};
|
|
8
|
+
const handleChange = ({ constants, dispatch, emit, state, nextTick }) => () => {
|
|
9
|
+
nextTick(() => {
|
|
10
|
+
emit("change", state.model);
|
|
11
|
+
state.isGroup && dispatch(constants.COLUMN_GROUP, "change", [state.model]);
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
const getIsGroup = ({ constants, parent: $parent, state }) => () => {
|
|
15
|
+
let parent = $parent;
|
|
16
|
+
while (parent) {
|
|
17
|
+
if (parent.$options.componentName !== constants.COLUMN_GROUP) {
|
|
18
|
+
parent = parent.$parent;
|
|
19
|
+
} else {
|
|
20
|
+
state.columnGroup = parent;
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
25
|
+
};
|
|
26
|
+
const getSize = ({ props, state }) => () => state.isGroup ? state.columnGroup.size || props.size : props.size;
|
|
27
|
+
const isDisabled = ({ props, state }) => () => props.checkboxDisabled || state.columnGroup.disabled;
|
|
28
|
+
const getModel = ({ props, state }) => () => {
|
|
29
|
+
const model = state.isGroup ? state.store : props.modelValue !== void 0 ? props.modelValue : state.selfModel;
|
|
30
|
+
return isNull(model) ? [] : model;
|
|
31
|
+
};
|
|
32
|
+
const setModel = ({ constants, dispatch, emit, state }) => (val) => {
|
|
33
|
+
if (state.isGroup) {
|
|
34
|
+
dispatch(constants.COLUMN_GROUP, "update:modelValue", [val]);
|
|
35
|
+
} else {
|
|
36
|
+
emit("update:modelValue", val);
|
|
37
|
+
state.selfModel = val;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const computedStore = ({ state, props }) => () => state.isGroup ? state.columnGroup.modelValue : props.modelValue;
|
|
41
|
+
export {
|
|
42
|
+
computedStore,
|
|
43
|
+
getIsGroup,
|
|
44
|
+
getModel,
|
|
45
|
+
getSize,
|
|
46
|
+
handelIconClick,
|
|
47
|
+
handleChange,
|
|
48
|
+
isDisabled,
|
|
49
|
+
setModel
|
|
50
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
import { handelIconClick, handleChange, getIsGroup, getSize, isDisabled, getModel, setModel, computedStore } from "./index";
|
|
3
|
+
const api = ["state", "handelIconClick"];
|
|
4
|
+
const renderless = (props, { reactive, watch, computed }, { vm, parent, emit, constants, nextTick, dispatch }) => {
|
|
5
|
+
const api2 = {};
|
|
6
|
+
const state = reactive({
|
|
7
|
+
columnGroup: {},
|
|
8
|
+
itemChecked: props.modelValue,
|
|
9
|
+
sliceNum: computed(() => props.size === "small" ? 1 : 2),
|
|
10
|
+
iconNum: computed(() => props.size === "small" ? 2 : 3),
|
|
11
|
+
effectOptions: computed(() => props.options.filter((item) => !item.hidden)),
|
|
12
|
+
showCheckbox: computed(() => props.showCheckbox || state.columnGroup.showCheckbox),
|
|
13
|
+
store: computed(() => api2.computedStore()),
|
|
14
|
+
getIsGroup: computed(() => api2.getIsGroup()),
|
|
15
|
+
size: computed(() => api2.getSize()),
|
|
16
|
+
disabled: computed(() => api2.isDisabled()),
|
|
17
|
+
model: computed({
|
|
18
|
+
get: () => api2.getModel(),
|
|
19
|
+
set: (val) => api2.setModel(val)
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
Object.assign(api2, {
|
|
23
|
+
state,
|
|
24
|
+
getSize: getSize({ props, state }),
|
|
25
|
+
getModel: getModel({ props, state }),
|
|
26
|
+
getIsGroup: getIsGroup({ constants, parent, state }),
|
|
27
|
+
isDisabled: isDisabled({ props, state }),
|
|
28
|
+
setModel: setModel({ constants, dispatch, emit, props, vm, state }),
|
|
29
|
+
handleChange: handleChange({ constants, dispatch, emit, state, nextTick }),
|
|
30
|
+
computedStore: computedStore({ state, props }),
|
|
31
|
+
handelIconClick: handelIconClick({ emit })
|
|
32
|
+
});
|
|
33
|
+
watch(() => state.model, api2.handleChange, { deep: true });
|
|
34
|
+
return api2;
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
api,
|
|
38
|
+
renderless
|
|
39
|
+
};
|
package/common/array.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__spreadValues
|
|
3
3
|
} from "../chunk-PKUHTIDK.js";
|
|
4
|
-
import { SORT } from "
|
|
5
|
-
import { isSame } from "
|
|
6
|
-
import { getObj } from "
|
|
4
|
+
import { SORT } from "./index";
|
|
5
|
+
import { isSame } from "./type";
|
|
6
|
+
import { getObj } from "./object";
|
|
7
7
|
const indexOf = (arr, data, predicate = isSame) => {
|
|
8
8
|
if (Array.isArray(arr) && typeof predicate === "function") {
|
|
9
9
|
for (let i = 0, len = arr.length; i < len; i++) {
|
package/common/bigInt.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { fillChar } from "
|
|
2
|
+
import { fillChar } from "./string";
|
|
3
3
|
const BigInt = window.BigInt;
|
|
4
4
|
function supportBigInt() {
|
|
5
5
|
return typeof BigInt === "function";
|
|
@@ -116,7 +116,10 @@ class BigIntDecimal {
|
|
|
116
116
|
num2str(mergedValue);
|
|
117
117
|
}
|
|
118
118
|
const f = Function;
|
|
119
|
-
const convertBigInt = (str) =>
|
|
119
|
+
const convertBigInt = (str) => {
|
|
120
|
+
const validStr = str.replace(/^0+/, "") || "0";
|
|
121
|
+
return f(`return BigInt(${validStr})`)();
|
|
122
|
+
};
|
|
120
123
|
if (validateNumber(mergedValue)) {
|
|
121
124
|
const trimRet = trimNumber(mergedValue);
|
|
122
125
|
this.negative = trimRet.negative;
|
package/common/dataset/index.js
CHANGED
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
__objRest,
|
|
3
3
|
__spreadValues
|
|
4
4
|
} from "../../chunk-PKUHTIDK.js";
|
|
5
|
-
import { format } from "
|
|
6
|
-
import { isObject } from "
|
|
7
|
-
import { transformTreeData } from "
|
|
5
|
+
import { format } from "../string";
|
|
6
|
+
import { isObject } from "../type";
|
|
7
|
+
import { transformTreeData } from "../array";
|
|
8
8
|
const getFilterStr = (filters) => {
|
|
9
9
|
const filterArr = {};
|
|
10
10
|
Object.keys(filters).forEach((property) => {
|
package/common/date.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { isDate, isNumber, isNumeric } from "
|
|
3
|
-
import { fillChar } from "
|
|
2
|
+
import { isDate, isNumber, isNumeric } from "./type";
|
|
3
|
+
import { fillChar } from "./string";
|
|
4
4
|
const daysInMonths = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
5
5
|
const yyyymmddReg = new RegExp(
|
|
6
6
|
"^(\\d{4})(/|-)(((0)?[1-9])|(1[0-2]))((/|-)(((0)?[1-9])|([1-2][0-9])|(3[0-1])))?( ((0)?[0-9]|1[0-9]|20|21|22|23):([0-5]?[0-9])((:([0-5]?[0-9]))?(.([0-9]{1,6}))?)?)?$"
|
package/common/deps/date-util.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "../../chunk-PKUHTIDK.js";
|
|
2
|
-
import fecha from "
|
|
3
|
-
import { isNull } from "
|
|
4
|
-
import { isLeapYear } from "
|
|
5
|
-
import { DATEPICKER } from "
|
|
2
|
+
import fecha from "./date";
|
|
3
|
+
import { isNull } from "../type";
|
|
4
|
+
import { isLeapYear } from "../date";
|
|
5
|
+
import { DATEPICKER } from "../index";
|
|
6
6
|
const weeks = DATEPICKER.Weeks;
|
|
7
7
|
const months = DATEPICKER.MonhtList;
|
|
8
8
|
const defaultYMD = DATEPICKER.DateFormats.date;
|
package/common/deps/date.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../../chunk-PKUHTIDK.js";
|
|
2
|
-
import { DATEPICKER } from "
|
|
3
|
-
import { isNull, isDate } from "
|
|
2
|
+
import { DATEPICKER } from "../index";
|
|
3
|
+
import { isNull, isDate } from "../type";
|
|
4
4
|
const fecha = {};
|
|
5
5
|
const digitsReg = ["\\d\\d?", "\\d{3}", "\\d{4}"];
|
|
6
6
|
const twoDigits = digitsReg[0];
|
package/common/deps/debounce.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../chunk-PKUHTIDK.js";
|
|
2
|
-
import throttle from "
|
|
2
|
+
import throttle from "./throttle";
|
|
3
3
|
function debounce_default(delay, atBegin, callback) {
|
|
4
4
|
return callback === void 0 ? throttle(delay, atBegin, false) : throttle(delay, callback, atBegin !== false);
|
|
5
5
|
}
|
package/common/deps/dom.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../chunk-PKUHTIDK.js";
|
|
2
|
-
import { hasOwn, isObject, isNull } from "
|
|
2
|
+
import { hasOwn, isObject, isNull } from "../type";
|
|
3
3
|
const isServer = typeof window === "undefined";
|
|
4
4
|
const SPECIAL_CHARS_REGEXP = /([:\-_]+(.))/g;
|
|
5
5
|
const MOZ_HACK_REGEXP = /^moz([A-Z])/;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../chunk-PKUHTIDK.js";
|
|
2
|
-
import { extend } from "
|
|
3
|
-
import { on, off } from "
|
|
4
|
-
import screenfull from "
|
|
2
|
+
import { extend } from "../../object";
|
|
3
|
+
import { on, off } from "../dom";
|
|
4
|
+
import screenfull from "./screenfull";
|
|
5
5
|
const defaults = {
|
|
6
6
|
callback: () => void 0,
|
|
7
7
|
fullscreenClass: "fullscreen",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../../chunk-PKUHTIDK.js";
|
|
2
|
-
import { on, off } from "
|
|
2
|
+
import { on, off } from "../dom";
|
|
3
3
|
const fullscreenApi = ["fullscreenElement", "fullscreenEnabled", "requestFullscreen", "exitFullscreen", "fullscreenchange", "fullscreenerror"];
|
|
4
4
|
const fullscreenApiMoz = [
|
|
5
5
|
"mozFullScreenElement",
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import "../../chunk-PKUHTIDK.js";
|
|
2
|
+
import throttle from "./throttle";
|
|
3
|
+
const CONTEXT_KEY = "@@infinitescrollContext";
|
|
4
|
+
const OBSERVER_CHECK_INTERVAL = 50;
|
|
5
|
+
const ATTR_DEFAULT_DELAY = 200;
|
|
6
|
+
const ATTR_DEFAULT_DISTANCE = 0;
|
|
7
|
+
const attrs = {
|
|
8
|
+
delay: { type: Number, default: ATTR_DEFAULT_DELAY },
|
|
9
|
+
disabled: { type: Boolean, default: false },
|
|
10
|
+
distance: { type: Number, default: ATTR_DEFAULT_DISTANCE },
|
|
11
|
+
immediate: { type: Boolean, default: true }
|
|
12
|
+
};
|
|
13
|
+
const isNull = (val) => val === null;
|
|
14
|
+
const parseAttrValue = (attrVal, type, defaultVal) => {
|
|
15
|
+
if (isNull(attrVal))
|
|
16
|
+
return defaultVal;
|
|
17
|
+
if (type === Boolean) {
|
|
18
|
+
return attrVal !== "false";
|
|
19
|
+
} else if (type === Number) {
|
|
20
|
+
return Number(attrVal);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const computeScrollOptions = (el, instance) => Object.entries(attrs).reduce((accumulator, [name, option]) => {
|
|
24
|
+
const { type, default: defaultValue } = option;
|
|
25
|
+
const attrKey = `infinite-scroll-${name}`;
|
|
26
|
+
const $attrValue = instance.$el.getAttribute(attrKey);
|
|
27
|
+
const attrValue = el.getAttribute(attrKey);
|
|
28
|
+
let value;
|
|
29
|
+
if (isNull(attrValue) && isNull($attrValue) || !isNull(attrValue)) {
|
|
30
|
+
value = parseAttrValue(attrValue, type, defaultValue);
|
|
31
|
+
}
|
|
32
|
+
if (isNull(attrValue) && !isNull($attrValue)) {
|
|
33
|
+
value = parseAttrValue($attrValue, type, defaultValue);
|
|
34
|
+
}
|
|
35
|
+
accumulator[name] = Number.isNaN(value) ? defaultValue : value;
|
|
36
|
+
return accumulator;
|
|
37
|
+
}, {});
|
|
38
|
+
const stopObserver = (el) => {
|
|
39
|
+
const { observer } = el[CONTEXT_KEY];
|
|
40
|
+
if (observer) {
|
|
41
|
+
observer.disconnect();
|
|
42
|
+
delete el[CONTEXT_KEY].observer;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const accumOffsetTop = (el) => {
|
|
46
|
+
let totalOffset = 0;
|
|
47
|
+
let parent = el;
|
|
48
|
+
while (parent) {
|
|
49
|
+
totalOffset += parent.offsetTop;
|
|
50
|
+
parent = parent.offsetParent;
|
|
51
|
+
}
|
|
52
|
+
return totalOffset;
|
|
53
|
+
};
|
|
54
|
+
const distanceOffsetTop = (el, containerEl) => Math.abs(accumOffsetTop(el) - accumOffsetTop(containerEl));
|
|
55
|
+
const scroller = (el, cb) => {
|
|
56
|
+
const { container, containerEl, instance, observer, lastScrollTop } = el[CONTEXT_KEY];
|
|
57
|
+
const { disabled, distance } = computeScrollOptions(el, instance);
|
|
58
|
+
const { clientHeight, scrollHeight, scrollTop } = containerEl;
|
|
59
|
+
const deltaTop = scrollTop - lastScrollTop;
|
|
60
|
+
el[CONTEXT_KEY].lastScrollTop = scrollTop;
|
|
61
|
+
if (observer || disabled || deltaTop < 0)
|
|
62
|
+
return;
|
|
63
|
+
let isTrigger = false;
|
|
64
|
+
if (container === el) {
|
|
65
|
+
isTrigger = scrollHeight - (clientHeight + scrollTop) <= distance;
|
|
66
|
+
} else {
|
|
67
|
+
const { clientTop, scrollHeight: height } = el;
|
|
68
|
+
const offsetTop = distanceOffsetTop(el, containerEl);
|
|
69
|
+
isTrigger = scrollTop + clientHeight >= offsetTop + clientTop + height - distance;
|
|
70
|
+
}
|
|
71
|
+
if (isTrigger) {
|
|
72
|
+
cb.call(instance);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
function observerChecker(el, cb) {
|
|
76
|
+
const { containerEl, instance } = el[CONTEXT_KEY];
|
|
77
|
+
const { disabled } = computeScrollOptions(el, instance);
|
|
78
|
+
if (disabled || containerEl.clientHeight === 0)
|
|
79
|
+
return;
|
|
80
|
+
if (containerEl.scrollHeight <= containerEl.clientHeight) {
|
|
81
|
+
cb.call(instance);
|
|
82
|
+
} else {
|
|
83
|
+
stopObserver(el);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const cached = (fn) => {
|
|
87
|
+
const cache = /* @__PURE__ */ Object.create(null);
|
|
88
|
+
return (str) => cache[str] || (cache[str] = fn(str));
|
|
89
|
+
};
|
|
90
|
+
const camelizeRE = /-(\w)/g;
|
|
91
|
+
const camelize = cached((str) => str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""));
|
|
92
|
+
const getElementStyle = (elem, styleKey) => {
|
|
93
|
+
if (!elem || !styleKey)
|
|
94
|
+
return "";
|
|
95
|
+
let key = camelize(styleKey);
|
|
96
|
+
if (key === "float")
|
|
97
|
+
key = "cssFloat";
|
|
98
|
+
try {
|
|
99
|
+
const styleValue = elem.style[key];
|
|
100
|
+
if (styleValue)
|
|
101
|
+
return styleValue;
|
|
102
|
+
const computedStyle = document.defaultView ? document.defaultView.getComputedStyle(elem, "") : null;
|
|
103
|
+
return computedStyle ? computedStyle[key] : "";
|
|
104
|
+
} catch (e) {
|
|
105
|
+
return elem.style[key];
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const canScroll = (el, isVertical) => {
|
|
109
|
+
const overflowKey = { undefined: "overflow", true: "overflow-y", false: "overflow-x" }[String(isVertical)];
|
|
110
|
+
const overflowVal = getElementStyle(el, overflowKey);
|
|
111
|
+
return ["scroll", "auto", "overlay"].some((s) => overflowVal.includes(s));
|
|
112
|
+
};
|
|
113
|
+
const getScrollContainer = (el, isVertical) => {
|
|
114
|
+
let parentEl = el;
|
|
115
|
+
while (parentEl) {
|
|
116
|
+
if ([window, document, document.documentElement].includes(parentEl))
|
|
117
|
+
return window;
|
|
118
|
+
if (canScroll(parentEl, isVertical))
|
|
119
|
+
return parentEl;
|
|
120
|
+
parentEl = parentEl.parentNode;
|
|
121
|
+
}
|
|
122
|
+
return parentEl;
|
|
123
|
+
};
|
|
124
|
+
const bind = (el, binding, vnode) => {
|
|
125
|
+
const instance = binding.instance || vnode.context;
|
|
126
|
+
const { value: cb } = binding;
|
|
127
|
+
if (typeof cb !== "function") {
|
|
128
|
+
throw new TypeError('[TINY Error][InfiniteScroll] "v-infinite-scroll" binding value must be a function');
|
|
129
|
+
}
|
|
130
|
+
instance.$nextTick(() => {
|
|
131
|
+
const { delay, immediate } = computeScrollOptions(el, instance);
|
|
132
|
+
const container = getScrollContainer(el, true);
|
|
133
|
+
const containerEl = container === window ? document.documentElement : container;
|
|
134
|
+
const onScroll = throttle(delay, scroller.bind(null, el, cb));
|
|
135
|
+
if (!container)
|
|
136
|
+
return;
|
|
137
|
+
el[CONTEXT_KEY] = { instance, container, containerEl, delay, cb, onScroll, lastScrollTop: containerEl.scrollTop };
|
|
138
|
+
if (immediate) {
|
|
139
|
+
const observer = new MutationObserver(throttle(OBSERVER_CHECK_INTERVAL, observerChecker.bind(null, el, cb)));
|
|
140
|
+
el[CONTEXT_KEY].observer = observer;
|
|
141
|
+
observer.observe(el, { childList: true, subtree: true });
|
|
142
|
+
observerChecker(el, cb);
|
|
143
|
+
}
|
|
144
|
+
container.addEventListener("scroll", onScroll);
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
const update = (el, binding, vnode) => {
|
|
148
|
+
if (!el[CONTEXT_KEY]) {
|
|
149
|
+
const instance = binding.instance || vnode.context;
|
|
150
|
+
return instance.$nextTick();
|
|
151
|
+
} else {
|
|
152
|
+
const { containerEl, cb, observer } = el[CONTEXT_KEY];
|
|
153
|
+
if (containerEl.clientHeight && observer) {
|
|
154
|
+
observerChecker(el, cb);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
const unbind = (el) => {
|
|
159
|
+
const { container, onScroll } = el[CONTEXT_KEY];
|
|
160
|
+
if (container)
|
|
161
|
+
container.removeEventListener("scroll", onScroll);
|
|
162
|
+
stopObserver(el);
|
|
163
|
+
};
|
|
164
|
+
const InfiniteScroll = {
|
|
165
|
+
bind,
|
|
166
|
+
update,
|
|
167
|
+
unbind,
|
|
168
|
+
beforeMount: bind,
|
|
169
|
+
updated: update,
|
|
170
|
+
unmounted: unbind
|
|
171
|
+
};
|
|
172
|
+
var infinite_scroll_default = InfiniteScroll;
|
|
173
|
+
export {
|
|
174
|
+
infinite_scroll_default as default,
|
|
175
|
+
getScrollContainer
|
|
176
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../chunk-PKUHTIDK.js";
|
|
2
|
-
import { on, off } from "
|
|
2
|
+
import { on, off } from "./dom";
|
|
3
3
|
const checkValue = (event) => {
|
|
4
4
|
event.target.value = event.target.value.replace(/[^0-9]/g, "");
|
|
5
5
|
if (event.charCode >= 48 && event.charCode <= 57) {
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import "../../chunk-PKUHTIDK.js";
|
|
2
|
+
import throttle from "./throttle";
|
|
3
|
+
import { isEqual } from "../object";
|
|
4
|
+
const CONTEXT_KEY = "@@observevisibilityContext";
|
|
5
|
+
const processOptions = (value) => {
|
|
6
|
+
let options;
|
|
7
|
+
if (typeof value === "function") {
|
|
8
|
+
options = { callback: value };
|
|
9
|
+
} else {
|
|
10
|
+
options = value;
|
|
11
|
+
}
|
|
12
|
+
return options;
|
|
13
|
+
};
|
|
14
|
+
const createObserver = ({ options, instance, state }) => {
|
|
15
|
+
if (state.observer) {
|
|
16
|
+
destroyObserver(state);
|
|
17
|
+
}
|
|
18
|
+
if (state.frozen)
|
|
19
|
+
return;
|
|
20
|
+
state.options = processOptions(options);
|
|
21
|
+
state.callback = (result, entry) => {
|
|
22
|
+
state.options.callback(result, entry);
|
|
23
|
+
if (result && state.options.once) {
|
|
24
|
+
state.frozen = true;
|
|
25
|
+
destroyObserver(state);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
if (state.callback && state.options.throttle) {
|
|
29
|
+
state.callback = throttle(state.options.throttleDelay || 20, state.callback);
|
|
30
|
+
}
|
|
31
|
+
state.observer = new IntersectionObserver((entries) => {
|
|
32
|
+
let entry = entries[0];
|
|
33
|
+
if (entries.length > 1) {
|
|
34
|
+
const intersectingEntry = entries.find((e) => e.isIntersecting);
|
|
35
|
+
if (intersectingEntry) {
|
|
36
|
+
entry = intersectingEntry;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (state.callback) {
|
|
40
|
+
state.callback(entry.isIntersecting, entry);
|
|
41
|
+
}
|
|
42
|
+
}, state.options.intersection);
|
|
43
|
+
instance.$nextTick(() => {
|
|
44
|
+
if (state.observer) {
|
|
45
|
+
state.observer.observe(state.el);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
const destroyObserver = (state) => {
|
|
50
|
+
if (state.observer) {
|
|
51
|
+
state.observer.disconnect();
|
|
52
|
+
state.observer = null;
|
|
53
|
+
}
|
|
54
|
+
if (state.callback) {
|
|
55
|
+
state.callback = null;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const createVisibilityState = ({ el, options, instance }) => {
|
|
59
|
+
const state = { el, observer: null, frozen: false };
|
|
60
|
+
createObserver({ options, instance, state });
|
|
61
|
+
return state;
|
|
62
|
+
};
|
|
63
|
+
const bind = (el, { value, instance }, { context }) => {
|
|
64
|
+
if (!value)
|
|
65
|
+
return;
|
|
66
|
+
if (typeof IntersectionObserver === "undefined") {
|
|
67
|
+
throw new TypeError("[TINY Error][ObserveVisibility] IntersectionObserver API is not available in your browser");
|
|
68
|
+
} else {
|
|
69
|
+
instance = instance || context;
|
|
70
|
+
el[CONTEXT_KEY] = createVisibilityState({ el, options: value, instance });
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const update = (el, { value, oldValue, instance }, { context }) => {
|
|
74
|
+
if (isEqual(value, oldValue))
|
|
75
|
+
return;
|
|
76
|
+
const state = el[CONTEXT_KEY];
|
|
77
|
+
if (!value) {
|
|
78
|
+
unbind(el);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
instance = instance || context;
|
|
82
|
+
if (state) {
|
|
83
|
+
createObserver({ options: value, instance, state });
|
|
84
|
+
} else {
|
|
85
|
+
bind(el, { value, instance }, { context });
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const unbind = (el) => {
|
|
89
|
+
const state = el[CONTEXT_KEY];
|
|
90
|
+
if (state) {
|
|
91
|
+
destroyObserver(state);
|
|
92
|
+
delete el[CONTEXT_KEY];
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
const ObserveVisibility = {
|
|
96
|
+
bind,
|
|
97
|
+
update,
|
|
98
|
+
unbind,
|
|
99
|
+
beforeMount: bind,
|
|
100
|
+
updated: update,
|
|
101
|
+
unmounted: unbind
|
|
102
|
+
};
|
|
103
|
+
var observe_visibility_default = ObserveVisibility;
|
|
104
|
+
export {
|
|
105
|
+
observe_visibility_default as default
|
|
106
|
+
};
|
package/common/deps/popper.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__spreadValues
|
|
3
3
|
} from "../../chunk-PKUHTIDK.js";
|
|
4
|
-
import { on, off } from "
|
|
5
|
-
import PopupManager from "
|
|
6
|
-
import { typeOf } from "
|
|
7
|
-
import { xss } from "
|
|
4
|
+
import { on, off } from "./dom";
|
|
5
|
+
import PopupManager from "./popup-manager";
|
|
6
|
+
import { typeOf } from "../type";
|
|
7
|
+
import { xss } from "../xss";
|
|
8
8
|
const win = window;
|
|
9
9
|
const positions = ["left", "right", "top", "bottom"];
|
|
10
10
|
const modifiers = ["shift", "offset", "preventOverflow", "keepTogether", "arrow", "flip", "applyStyle"];
|
|
@@ -128,24 +128,13 @@ const getOffsetRectRelativeToCustomParent = (el, parent, fixed) => {
|
|
|
128
128
|
};
|
|
129
129
|
return rect;
|
|
130
130
|
};
|
|
131
|
-
const getScrollTopValue = (el) => el
|
|
132
|
-
const getScrollLeftValue = (el) => el
|
|
131
|
+
const getScrollTopValue = (el) => el === document.body ? Math.max(document.documentElement.scrollTop, document.body.scrollTop) : el.scrollTop;
|
|
132
|
+
const getScrollLeftValue = (el) => el === document.body ? Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) : el.scrollLeft;
|
|
133
133
|
const getMaxWH = (body, html) => {
|
|
134
134
|
const height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
|
|
135
135
|
const width = Math.max(body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth);
|
|
136
136
|
return { width, height };
|
|
137
137
|
};
|
|
138
|
-
const adjustArrowStyle = (arrowStyle, side, arrowRect, popperRect, popperOptions) => {
|
|
139
|
-
let params = popperOptions.placement.split("-");
|
|
140
|
-
if (popperOptions.adjustArrow && ~["top", "bottom"].indexOf(params[0]) && side === "left") {
|
|
141
|
-
if (params[1] === "start") {
|
|
142
|
-
arrowStyle.left = 8;
|
|
143
|
-
} else if (!params[1]) {
|
|
144
|
-
arrowStyle.left = (popperRect.width - arrowRect.width) / 2;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
return arrowStyle;
|
|
148
|
-
};
|
|
149
138
|
const getOuterSizes = (el) => {
|
|
150
139
|
let _display = el.style.display;
|
|
151
140
|
let _visibility = el.style.visibility;
|
|
@@ -594,25 +583,34 @@ Popper.prototype.modifiers.arrow = function(data) {
|
|
|
594
583
|
let popper = getPopperClientRect(data.offsets.popper);
|
|
595
584
|
let reference = data.offsets.reference;
|
|
596
585
|
let isVertical = ~["left", "right"].indexOf(placement);
|
|
597
|
-
let
|
|
586
|
+
let calcProp = isVertical ? "height" : "width";
|
|
598
587
|
let opSide = isVertical ? "bottom" : "right";
|
|
599
588
|
let altSide = isVertical ? "left" : "top";
|
|
600
589
|
let side = isVertical ? "top" : "left";
|
|
601
590
|
let popperRect = this.popperOuterSize ? this.popperOuterSize : this.popperOuterSize = getOuterSizes(this._popper);
|
|
602
591
|
let arrowRect = getOuterSizes(arrow);
|
|
603
|
-
let arrowSize = arrowRect[
|
|
592
|
+
let arrowSize = arrowRect[calcProp];
|
|
604
593
|
if (reference[opSide] - arrowSize < popper[side]) {
|
|
605
594
|
data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowSize);
|
|
606
595
|
}
|
|
607
596
|
if (reference[side] + arrowSize > popper[opSide]) {
|
|
608
597
|
data.offsets.popper[side] += reference[side] + arrowSize - popper[opSide];
|
|
609
598
|
}
|
|
610
|
-
let center = reference[side] + (arrowOffset || reference[
|
|
599
|
+
let center = reference[side] + (arrowOffset || reference[calcProp] / 2 - arrowSize / 2);
|
|
611
600
|
let sideValue = center - popper[side];
|
|
612
|
-
sideValue = Math.max(Math.min(popper[
|
|
601
|
+
sideValue = Math.max(Math.min(popper[calcProp] - arrowSize - 8, sideValue), 8);
|
|
613
602
|
arrowStyle[side] = sideValue;
|
|
614
603
|
arrowStyle[altSide] = "";
|
|
615
|
-
|
|
604
|
+
const popperOptions = this._options;
|
|
605
|
+
const params = popperOptions.placement.split("-");
|
|
606
|
+
if (popperOptions.adjustArrow && ~["top", "bottom"].indexOf(params[0]) && side === "left") {
|
|
607
|
+
if (params[1] === "start") {
|
|
608
|
+
arrowStyle.left = 8;
|
|
609
|
+
} else if (!params[1]) {
|
|
610
|
+
arrowStyle.left = (popperRect.width - arrowRect.width) / 2;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
data.offsets.arrow = arrowStyle;
|
|
616
614
|
data.arrowElement = arrow;
|
|
617
615
|
return data;
|
|
618
616
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../../chunk-PKUHTIDK.js";
|
|
2
|
-
import { KEY_CODE } from "
|
|
3
|
-
import { addClass, removeClass, on } from "
|
|
2
|
+
import { KEY_CODE } from "../index";
|
|
3
|
+
import { addClass, removeClass, on } from "./dom";
|
|
4
4
|
let hasModal = false;
|
|
5
5
|
const isServer = typeof window === "undefined";
|
|
6
6
|
const instances = {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../chunk-PKUHTIDK.js";
|
|
2
|
-
import ResizeObserver from "
|
|
2
|
+
import ResizeObserver from "./ResizeObserver";
|
|
3
3
|
const isServer = typeof window === "undefined";
|
|
4
4
|
const cacheKey = "__resizeListeners__";
|
|
5
5
|
const resizeHandler = (entries) => {
|