@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
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
const optionMethod = (value) => {
|
|
3
|
+
const val = ("0" + value).slice(-2);
|
|
4
|
+
return { id: val, label: val };
|
|
5
|
+
};
|
|
6
|
+
const watchModelValue = ({ props, state }) => () => {
|
|
7
|
+
const { modelValue } = props;
|
|
8
|
+
state.dateArr = modelValue ? modelValue.slice() : [];
|
|
9
|
+
};
|
|
10
|
+
const watchVisible = ({ api, state }) => (value) => {
|
|
11
|
+
state.visible = value;
|
|
12
|
+
value && api.watchModelValue();
|
|
13
|
+
};
|
|
14
|
+
const updateVisible = ({ state, emit }) => (value) => {
|
|
15
|
+
state.visible = value;
|
|
16
|
+
emit("update:visible", value);
|
|
17
|
+
};
|
|
18
|
+
const confirm = ({ emit, state }) => (value) => {
|
|
19
|
+
const dateArr = value.map((item) => ("0" + item).slice(-2));
|
|
20
|
+
state.dateArr = dateArr;
|
|
21
|
+
emit("update:modelValue", dateArr);
|
|
22
|
+
emit("confirm", dateArr);
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
confirm,
|
|
26
|
+
optionMethod,
|
|
27
|
+
updateVisible,
|
|
28
|
+
watchModelValue,
|
|
29
|
+
watchVisible
|
|
30
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
import { optionMethod, watchModelValue, watchVisible, confirm, updateVisible } from "./index";
|
|
3
|
+
const api = ["state", "confirm", "updateVisible"];
|
|
4
|
+
const renderless = (props, { reactive, watch }, { emit }) => {
|
|
5
|
+
const api2 = {};
|
|
6
|
+
const state = reactive({
|
|
7
|
+
visible: false,
|
|
8
|
+
dateArr: [],
|
|
9
|
+
optionList: [
|
|
10
|
+
{ range: [0, 23], optionMethod },
|
|
11
|
+
{ range: [0, 59], optionMethod },
|
|
12
|
+
{ range: [0, 59], optionMethod }
|
|
13
|
+
]
|
|
14
|
+
});
|
|
15
|
+
Object.assign(api2, {
|
|
16
|
+
state,
|
|
17
|
+
watchModelValue: watchModelValue({ props, state }),
|
|
18
|
+
watchVisible: watchVisible({ api: api2, state }),
|
|
19
|
+
confirm: confirm({ emit, state }),
|
|
20
|
+
updateVisible: updateVisible({ emit, state }),
|
|
21
|
+
optionMethod
|
|
22
|
+
});
|
|
23
|
+
watch(() => props.visible, api2.watchVisible);
|
|
24
|
+
watch(() => props.modelValue, api2.watchModelValue, { immediate: true });
|
|
25
|
+
return api2;
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
api,
|
|
29
|
+
renderless
|
|
30
|
+
};
|
package/time-range/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { clearMilliseconds, timeWithinRange, limitTimeRange, modifyDate } from "
|
|
2
|
+
import { clearMilliseconds, timeWithinRange, limitTimeRange, modifyDate } from "../common/deps/date-util";
|
|
3
3
|
const minTimeOfDay = ({ MIN_TIME }) => (date) => modifyDate(MIN_TIME, date.getFullYear(), date.getMonth(), date.getDate());
|
|
4
4
|
const maxTimeOfDay = ({ MAX_TIME }) => (date) => modifyDate(MAX_TIME, date.getFullYear(), date.getMonth(), date.getDate());
|
|
5
5
|
const advanceTime = (api) => (date, amount) => new Date(Math.min(date.getTime() + amount, api.maxTimeOfDay(date).getTime()));
|
package/time-range/vue.js
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
advanceTime,
|
|
19
19
|
compuAmPmMode
|
|
20
20
|
} from "./index";
|
|
21
|
-
import { parseDate } from "
|
|
21
|
+
import { parseDate } from "../common/deps/date-util";
|
|
22
22
|
const api = ["state", "handleMinChange", "handleConfirm", "setMinSelectionRange", "handleCancel", "setMaxSelectionRange", "handleMaxChange"];
|
|
23
23
|
const initState = ({ reactive, computed, refs, api: api2 }) => {
|
|
24
24
|
const state = reactive({
|
package/time-spinner/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { modifyTime } from "
|
|
3
|
-
import { DATEPICKER } from "
|
|
2
|
+
import { modifyTime } from "../common/deps/date-util";
|
|
3
|
+
import { DATEPICKER } from "../common";
|
|
4
4
|
const getArrowHourList = (state) => () => {
|
|
5
5
|
const hours = state.hours;
|
|
6
6
|
return [hours > 0 ? hours - 1 : void 0, hours, hours < 23 ? hours + 1 : void 0];
|
package/time-spinner/vue.js
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
handleClick,
|
|
19
19
|
emitSelectRange
|
|
20
20
|
} from "./index";
|
|
21
|
-
import { getRangeHours, getRangeMinutes } from "
|
|
21
|
+
import { getRangeHours, getRangeMinutes } from "../common/deps/date-util";
|
|
22
22
|
const api = ["state", "emitSelectRange", "adjustCurrentSpinner", "handleClick", "decrease", "increase", "amPm", "adjustSpinners"];
|
|
23
23
|
const initState = ({ reactive, computed, props, api: api2 }) => {
|
|
24
24
|
const state = reactive({
|
package/toggle-menu/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { xss } from "
|
|
3
|
-
import { isObject } from "
|
|
2
|
+
import { xss } from "../common/xss.js";
|
|
3
|
+
import { isObject } from "../common/type";
|
|
4
4
|
const filterNode = (props) => (value, data) => {
|
|
5
5
|
const node = data[props.props.label || "label"] || "";
|
|
6
6
|
return node.includes(value);
|
package/toggle-menu/vue.js
CHANGED
package/tooltip/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import debounce from "
|
|
3
|
-
import { on, off, addClass, removeClass } from "
|
|
2
|
+
import debounce from "../common/deps/debounce";
|
|
3
|
+
import { on, off, addClass, removeClass } from "../common/deps/dom";
|
|
4
4
|
const show = ({ api, state, props }) => () => {
|
|
5
5
|
if (props.visible === "auto") {
|
|
6
6
|
const { clientWidth, scrollWidth } = state.referenceElm;
|
|
@@ -112,9 +112,14 @@ const bindEvent = ({ api, state, vm }) => (reference) => {
|
|
|
112
112
|
on(referenceElm, "blur", api.handleBlur);
|
|
113
113
|
on(referenceElm, "click", api.removeFocusing);
|
|
114
114
|
};
|
|
115
|
-
const bindPopper = ({ vm, refs, nextTick }) => (el) => {
|
|
115
|
+
const bindPopper = ({ vm, refs, nextTick, popperVmRef }) => (el) => {
|
|
116
116
|
nextTick(() => vm.bindEvent(el));
|
|
117
117
|
if (vm.popperVM) {
|
|
118
|
+
if (!vm.$refs.popper) {
|
|
119
|
+
popperVmRef.popper = vm.popperVM.$el;
|
|
120
|
+
} else {
|
|
121
|
+
popperVmRef.popper = vm.$refs.popper;
|
|
122
|
+
}
|
|
118
123
|
refs.popper || (refs.popper = vm.popperVM.$el);
|
|
119
124
|
nextTick(() => {
|
|
120
125
|
if (vm.modelValue) {
|
|
@@ -123,6 +128,26 @@ const bindPopper = ({ vm, refs, nextTick }) => (el) => {
|
|
|
123
128
|
});
|
|
124
129
|
}
|
|
125
130
|
};
|
|
131
|
+
const observeCallback = ({ state, popperVmRef }) => (mutationsList) => {
|
|
132
|
+
for (let mutation of mutationsList) {
|
|
133
|
+
if (mutation.type === "attributes" && mutation.attributeName === "x-placement") {
|
|
134
|
+
state.xPlacement = popperVmRef.popper.getAttribute("x-placement") || "bottom";
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
const handleDocumentClick = ({ props, api, state, popperVmRef }) => (event) => {
|
|
139
|
+
if (props.manual)
|
|
140
|
+
return;
|
|
141
|
+
const reference = state.referenceElm;
|
|
142
|
+
const $el = popperVmRef.popper;
|
|
143
|
+
if (!$el || !reference || $el.contains(event.target) || reference.contains(event.target)) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
if (state.showPopper) {
|
|
147
|
+
api.setExpectedState(false);
|
|
148
|
+
api.debounceClose();
|
|
149
|
+
}
|
|
150
|
+
};
|
|
126
151
|
export {
|
|
127
152
|
bindEvent,
|
|
128
153
|
bindPopper,
|
|
@@ -131,9 +156,11 @@ export {
|
|
|
131
156
|
focusHandler,
|
|
132
157
|
handleBlur,
|
|
133
158
|
handleClosePopper,
|
|
159
|
+
handleDocumentClick,
|
|
134
160
|
handleFocus,
|
|
135
161
|
handleShowPopper,
|
|
136
162
|
hide,
|
|
163
|
+
observeCallback,
|
|
137
164
|
removeFocusing,
|
|
138
165
|
setExpectedState,
|
|
139
166
|
show,
|
package/tooltip/vue.js
CHANGED
|
@@ -13,10 +13,12 @@ import {
|
|
|
13
13
|
debounceClose,
|
|
14
14
|
watchFocusing,
|
|
15
15
|
bindPopper,
|
|
16
|
-
focusHandler
|
|
16
|
+
focusHandler,
|
|
17
|
+
observeCallback,
|
|
18
|
+
handleDocumentClick
|
|
17
19
|
} from "./index";
|
|
18
|
-
import userPopper from "
|
|
19
|
-
import { guid } from "
|
|
20
|
+
import userPopper from "../common/deps/vue-popper";
|
|
21
|
+
import { guid } from "../common/string";
|
|
20
22
|
const api = [
|
|
21
23
|
"state",
|
|
22
24
|
"bindEvent",
|
|
@@ -29,9 +31,10 @@ const api = [
|
|
|
29
31
|
"handleClosePopper",
|
|
30
32
|
"setExpectedState",
|
|
31
33
|
"updatePopper",
|
|
32
|
-
"focusHandler"
|
|
34
|
+
"focusHandler",
|
|
35
|
+
"markRaw"
|
|
33
36
|
];
|
|
34
|
-
const initState = ({ reactive, showPopper, popperElm, referenceElm, props }) => reactive({
|
|
37
|
+
const initState = ({ reactive, showPopper, popperElm, referenceElm, props, markRaw, inject }) => reactive({
|
|
35
38
|
showPopper,
|
|
36
39
|
popperElm,
|
|
37
40
|
referenceElm,
|
|
@@ -40,22 +43,28 @@ const initState = ({ reactive, showPopper, popperElm, referenceElm, props }) =>
|
|
|
40
43
|
expectedState: void 0,
|
|
41
44
|
mounted: false,
|
|
42
45
|
tooltipId: guid("tiny-tooltip-", 4),
|
|
43
|
-
tabindex: props.tabindex
|
|
46
|
+
tabindex: props.tabindex,
|
|
47
|
+
xPlacement: "bottom",
|
|
48
|
+
poppers: markRaw([]),
|
|
49
|
+
showContent: inject("showContent", null),
|
|
50
|
+
tipsMaxWidth: inject("tips-max-width", null)
|
|
44
51
|
});
|
|
45
|
-
const renderless = (props, { watch, toRefs, reactive, onBeforeUnmount, onDeactivated, onMounted, onUnmounted }, { vm, emit, refs, slots, nextTick, parent }) => {
|
|
52
|
+
const renderless = (props, { watch, toRefs, reactive, onBeforeUnmount, onDeactivated, onMounted, onUnmounted, markRaw, inject }, { vm, emit, refs, slots, nextTick, parent }) => {
|
|
46
53
|
const api2 = {};
|
|
47
|
-
const popperParam = { emit, props, nextTick, toRefs, reactive, parent, refs };
|
|
54
|
+
const popperParam = { emit, props, nextTick, toRefs, reactive, parent: parent.$parent, refs };
|
|
55
|
+
const popperVmRef = {};
|
|
48
56
|
Object.assign(popperParam, { slots, onBeforeUnmount, onDeactivated, watch });
|
|
49
57
|
const { showPopper, updatePopper, popperElm, referenceElm, doDestroy } = userPopper(popperParam);
|
|
50
|
-
const state = initState({ reactive, showPopper, popperElm, referenceElm, props });
|
|
58
|
+
const state = initState({ reactive, showPopper, popperElm, referenceElm, props, markRaw, inject });
|
|
51
59
|
Object.assign(api2, {
|
|
52
60
|
state,
|
|
61
|
+
markRaw,
|
|
53
62
|
doDestroy,
|
|
54
63
|
updatePopper,
|
|
55
64
|
show: show({ api: api2, state, props }),
|
|
56
65
|
hide: hide(api2),
|
|
57
66
|
destroyed: destroyed({ state, api: api2 }),
|
|
58
|
-
bindPopper: bindPopper({ vm, refs, nextTick }),
|
|
67
|
+
bindPopper: bindPopper({ vm, refs, nextTick, popperVmRef }),
|
|
59
68
|
watchFocusing: watchFocusing(state),
|
|
60
69
|
removeFocusing: removeFocusing(state),
|
|
61
70
|
handleBlur: handleBlur({ api: api2, state }),
|
|
@@ -65,16 +74,28 @@ const renderless = (props, { watch, toRefs, reactive, onBeforeUnmount, onDeactiv
|
|
|
65
74
|
handleShowPopper: handleShowPopper({ props, state }),
|
|
66
75
|
handleClosePopper: handleClosePopper({ api: api2, props, state }),
|
|
67
76
|
bindEvent: bindEvent({ api: api2, state, vm }),
|
|
68
|
-
focusHandler: focusHandler({ slots, api: api2 })
|
|
77
|
+
focusHandler: focusHandler({ slots, api: api2 }),
|
|
78
|
+
handleDocumentClick: handleDocumentClick({ props, api: api2, state, popperVmRef }),
|
|
79
|
+
observeCallback: observeCallback({ state, popperVmRef })
|
|
69
80
|
});
|
|
70
81
|
watch(() => state.focusing, api2.watchFocusing);
|
|
71
82
|
watch(
|
|
72
83
|
() => props.modelValue,
|
|
73
84
|
(val) => nextTick(() => props.manual && (state.showPopper = val))
|
|
74
85
|
);
|
|
75
|
-
onMounted(
|
|
86
|
+
onMounted(() => {
|
|
87
|
+
api2.bindPopper();
|
|
88
|
+
if (props.genArrowByHtml) {
|
|
89
|
+
const config = { attributes: true, childList: false, subtree: false };
|
|
90
|
+
api2.observer = new MutationObserver(api2.observeCallback);
|
|
91
|
+
api2.observer.observe(popperVmRef.popper, config);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
76
94
|
vm.$on("tooltip-update", api2.bindPopper);
|
|
77
|
-
onUnmounted(
|
|
95
|
+
onUnmounted(() => {
|
|
96
|
+
api2.destroyed();
|
|
97
|
+
api2.observer && api2.observer.disconnect();
|
|
98
|
+
});
|
|
78
99
|
return api2;
|
|
79
100
|
};
|
|
80
101
|
export {
|
package/top-box/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { KEY_CODE } from "
|
|
3
|
-
import { on, off } from "
|
|
4
|
-
import PopupManager from "
|
|
2
|
+
import { KEY_CODE } from "../common";
|
|
3
|
+
import { on, off } from "../common/deps/dom";
|
|
4
|
+
import PopupManager from "../common/deps/popup-manager";
|
|
5
5
|
const handleAfterLeave = (api) => () => api.destroy();
|
|
6
6
|
const destroy = (parent) => () => {
|
|
7
7
|
parent.$el.parentNode.removeChild(parent.$el);
|
package/transfer/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { copyArray } from "
|
|
2
|
+
import { copyArray } from "../common/object";
|
|
3
3
|
const getObj = (props) => () => props.data.reduce((o, cur) => (o[cur[props.props.key]] = cur) && o, {});
|
|
4
4
|
const getSourceData = ({ props, Tree }) => () => {
|
|
5
5
|
if (props.render && props.render.plugin.name === Tree) {
|
package/transfer-panel/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { copyArray } from "
|
|
3
|
-
import { getFlatData } from "
|
|
2
|
+
import { copyArray } from "../common/object";
|
|
3
|
+
import { getFlatData } from "../transfer";
|
|
4
4
|
const showFilterData = (data, sign) => {
|
|
5
5
|
const getChild = (data2, sign2) => data2.filter((node) => {
|
|
6
6
|
if (node.children && node.children.length > 0) {
|
package/tree/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { getNodeKey as innerGetNodekey } from "
|
|
3
|
-
import { KEY_CODE } from "
|
|
4
|
-
import TreeStore from "
|
|
5
|
-
import { addClass, removeClass } from "
|
|
6
|
-
import { on, off } from "
|
|
7
|
-
import { getDataset } from "
|
|
2
|
+
import { getNodeKey as innerGetNodekey } from "../common/deps/tree-model/util";
|
|
3
|
+
import { KEY_CODE } from "../common";
|
|
4
|
+
import TreeStore from "../common/deps/tree-model/tree-store";
|
|
5
|
+
import { addClass, removeClass } from "../common/deps/dom";
|
|
6
|
+
import { on, off } from "../common/deps/dom";
|
|
7
|
+
import { getDataset } from "../common/dataset";
|
|
8
8
|
const setChildren = (props) => (data) => props.data = data;
|
|
9
9
|
const getChildren = () => (props) => props.data;
|
|
10
10
|
const computedTreeItemArray = () => (props, state) => Array.prototype.slice.call(state.treeItems);
|
package/tree/vue.js
CHANGED
package/tree-node/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__spreadValues
|
|
3
3
|
} from "../chunk-PKUHTIDK.js";
|
|
4
|
-
import { getNodeKey as getTreeNodeKey } from "
|
|
4
|
+
import { getNodeKey as getTreeNodeKey } from "../common/deps/tree-model/util";
|
|
5
5
|
const watchIndeterminate = ({ api, props }) => (value) => api.handleSelectChange(props.node.checked, value);
|
|
6
6
|
const watchChecked = ({ api, props }) => (value) => api.handleSelectChange(value, props.node.indeterminate);
|
|
7
7
|
const watchExpanded = ({ state }) => (value) => {
|
package/upload/index.js
CHANGED
package/upload/vue.js
CHANGED
|
@@ -22,8 +22,8 @@ const renderless = (props, { computed, inject, reactive, onMounted, onBeforeUnmo
|
|
|
22
22
|
reqs: {},
|
|
23
23
|
uploader: inject("uploader"),
|
|
24
24
|
accecpt: "",
|
|
25
|
-
isEdm: computed(() =>
|
|
26
|
-
openEdmDownload: computed(() =>
|
|
25
|
+
isEdm: computed(() => state.uploader.$refs[constants.FILE_UPLOAD_INNER].state.isEdm),
|
|
26
|
+
openEdmDownload: computed(() => state.uploader.$refs[constants.FILE_UPLOAD_INNER].edm.download),
|
|
27
27
|
headers: computed(() => {
|
|
28
28
|
if (state.isEdm) {
|
|
29
29
|
return {
|
package/upload-dragger/index.js
CHANGED
|
@@ -33,7 +33,11 @@ const onDrop = ({ emit, props, state }) => (event) => {
|
|
|
33
33
|
notAcceptedFiles.length && state.uploader.$emit("drop-error", notAcceptedFiles);
|
|
34
34
|
emit("file", filteredFile);
|
|
35
35
|
};
|
|
36
|
+
const watchDragover = ({ state, constants }) => () => {
|
|
37
|
+
state.uploader.$refs[constants.FILE_UPLOAD_INNER].$emit("drag-over", state.dragover);
|
|
38
|
+
};
|
|
36
39
|
export {
|
|
37
40
|
onDragOver,
|
|
38
|
-
onDrop
|
|
41
|
+
onDrop,
|
|
42
|
+
watchDragover
|
|
39
43
|
};
|
package/upload-dragger/vue.js
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { onDragOver, onDrop } from "./index";
|
|
2
|
+
import { onDragOver, onDrop, watchDragover } from "./index";
|
|
3
3
|
const api = ["state", "onDragOver", "onDrop"];
|
|
4
|
-
const renderless = (props, { inject, reactive, ref }, { emit }) => {
|
|
4
|
+
const renderless = (props, { inject, reactive, ref, watch }, { emit }) => {
|
|
5
5
|
const state = reactive({
|
|
6
6
|
dragover: false,
|
|
7
7
|
uploader: inject("uploader") || ref({ default: "" })
|
|
8
8
|
});
|
|
9
|
+
const constants = state.uploader.$constants || {};
|
|
9
10
|
const api2 = {
|
|
10
11
|
state,
|
|
11
12
|
onDragOver: onDragOver({ props, state }),
|
|
12
|
-
onDrop: onDrop({ emit, props, state })
|
|
13
|
+
onDrop: onDrop({ emit, props, state }),
|
|
14
|
+
watchDragover: watchDragover({ state, constants })
|
|
13
15
|
};
|
|
16
|
+
watch(
|
|
17
|
+
() => state.dragover,
|
|
18
|
+
() => api2.watchDragover()
|
|
19
|
+
);
|
|
14
20
|
return api2;
|
|
15
21
|
};
|
|
16
22
|
export {
|
package/upload-list/index.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
import { xss } from "../common/xss";
|
|
3
|
+
import { addResizeListener, removeResizeListener } from "../common/deps/resize-event";
|
|
2
4
|
const parsePercentage = () => (val) => parseInt(val, 10);
|
|
3
5
|
const handleClick = ({ props, api, parent }) => (file) => {
|
|
4
6
|
if (parent.state.isEdm) {
|
|
5
|
-
|
|
7
|
+
const { downloadFile: downloadFile2 } = api.getApi();
|
|
8
|
+
props.openDownloadFile && downloadFile2 && downloadFile2(file);
|
|
6
9
|
} else {
|
|
7
10
|
props.openDownloadFile && api.downloadFile(file);
|
|
8
11
|
}
|
|
@@ -14,20 +17,19 @@ const downloadFile = (service) => (file) => {
|
|
|
14
17
|
if (Array.isArray(data)) {
|
|
15
18
|
responseFile = data[0];
|
|
16
19
|
} else if (data && typeof data === "object") {
|
|
17
|
-
for (let key
|
|
20
|
+
for (let key in data) {
|
|
18
21
|
responseFile = data[key];
|
|
19
22
|
break;
|
|
20
23
|
}
|
|
21
24
|
}
|
|
22
25
|
if (responseFile) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
window.open(url + "&id=" + responseFile.attachmentId + "&type=AttachmentDemo").opener = null;
|
|
26
|
+
service.getFileDownloadUrl().then((url) => {
|
|
27
|
+
window.open(xss.filterUrl(url + "&id=" + responseFile.attachmentId + "&type=AttachmentDemo")).opener = null;
|
|
26
28
|
});
|
|
27
29
|
} else if (file.url) {
|
|
28
|
-
window.open(file.url).opener = null;
|
|
30
|
+
window.open(xss.filterUrl(file.url)).opener = null;
|
|
29
31
|
} else {
|
|
30
|
-
throw new Error("[
|
|
32
|
+
throw new Error("[TINY Error][FileUpload]file.url must not be empty");
|
|
31
33
|
}
|
|
32
34
|
};
|
|
33
35
|
const picturefilePreview = (state) => (index) => {
|
|
@@ -37,10 +39,158 @@ const picturefilePreview = (state) => (index) => {
|
|
|
37
39
|
const getDeleteData = (emit) => (data) => {
|
|
38
40
|
emit("remove", data);
|
|
39
41
|
};
|
|
42
|
+
const showOperatePanel = ({ state }) => ({ file }) => {
|
|
43
|
+
state.currentFile = file;
|
|
44
|
+
state.showPanel = true;
|
|
45
|
+
};
|
|
46
|
+
const reUpload = ({ emit, props, parent }) => (file) => {
|
|
47
|
+
parent.state.isEdm ? emit("start", [file && file.raw], "", true) : props.handleReUpload && props.handleReUpload(file);
|
|
48
|
+
};
|
|
49
|
+
const addPlayEventListener = ({ type, el }, fn) => el && el.addEventListener(type, fn);
|
|
50
|
+
const removePlayEventListener = ({ type, el }, fn) => el && el.removeEventListener(type, fn);
|
|
51
|
+
const play = ({ vm, api }) => ({ file, index, type }) => {
|
|
52
|
+
const videoOrAudioEle = vm.$refs[type + (file.uid || index)] && vm.$refs[type + (file.uid || index)][index];
|
|
53
|
+
if (file.isPlay)
|
|
54
|
+
return api.pause({ file, index, type });
|
|
55
|
+
if (videoOrAudioEle && videoOrAudioEle.play) {
|
|
56
|
+
file.playEvent = () => {
|
|
57
|
+
if (file) {
|
|
58
|
+
file.isPlay = false;
|
|
59
|
+
removePlayEventListener({ type: "ended", el: videoOrAudioEle }, file.playEvent);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
file.el = videoOrAudioEle;
|
|
63
|
+
removePlayEventListener({ type: "ended", el: videoOrAudioEle }, file.playEvent);
|
|
64
|
+
addPlayEventListener({ type: "ended", el: videoOrAudioEle }, file.playEvent);
|
|
65
|
+
vm.$set(file, "isPlay", true);
|
|
66
|
+
videoOrAudioEle.play();
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const pause = ({ vm }) => ({ file, index, type }) => {
|
|
70
|
+
const videoOrAudioEle = vm.$refs[type + (file.uid || index)] && vm.$refs[type + (file.uid || index)][index];
|
|
71
|
+
if (videoOrAudioEle && videoOrAudioEle.pause) {
|
|
72
|
+
removePlayEventListener({ type: "ended", el: videoOrAudioEle }, file.playEvent);
|
|
73
|
+
file.isPlay = false;
|
|
74
|
+
videoOrAudioEle.pause();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const handleLoadedmetadata = ({ vm }) => ({ e, file }) => {
|
|
78
|
+
vm.$set(file, "totalSecond", parseInt(e.target.duration));
|
|
79
|
+
vm.$set(file, "currentSecond", parseInt(e.target.currentTime));
|
|
80
|
+
};
|
|
81
|
+
const handleTimeupdate = () => ({ e, file }) => {
|
|
82
|
+
file.currentSecond = parseInt(e.target.currentTime);
|
|
83
|
+
};
|
|
84
|
+
const getFileType = () => ({ file }) => file.name && file.name.split(".")[file.name.split(".").length - 1].toLowerCase();
|
|
85
|
+
const getFileIcon = () => ({ type }) => {
|
|
86
|
+
let iconTypes = {
|
|
87
|
+
"xls/xlsx": {
|
|
88
|
+
name: "icon-excel-type",
|
|
89
|
+
color: "#00A2B5"
|
|
90
|
+
},
|
|
91
|
+
file: {
|
|
92
|
+
name: "icon-file-type",
|
|
93
|
+
color: "#71C14C"
|
|
94
|
+
},
|
|
95
|
+
pdf: {
|
|
96
|
+
name: "icon-pdf-type",
|
|
97
|
+
color: "#FC916E"
|
|
98
|
+
},
|
|
99
|
+
"png/jpg/jpeg/gif/svg/webp/bmp/tif/pjp/apng/xbm/jxl/svgz/ico/tiff/jfif/pjpeg/avif": {
|
|
100
|
+
name: "icon-picture-type",
|
|
101
|
+
color: "#2E94FF"
|
|
102
|
+
},
|
|
103
|
+
"ppt/pptx": {
|
|
104
|
+
name: "icon-ppt-type",
|
|
105
|
+
color: "#F46087"
|
|
106
|
+
},
|
|
107
|
+
txt: {
|
|
108
|
+
name: "icon-text-type",
|
|
109
|
+
color: "#9185F0"
|
|
110
|
+
},
|
|
111
|
+
"doc/docx": {
|
|
112
|
+
name: "icon-word-type",
|
|
113
|
+
color: "#2070F3"
|
|
114
|
+
},
|
|
115
|
+
"zip/rar/arj/z/jar/lzh": {
|
|
116
|
+
name: "icon-zip-type",
|
|
117
|
+
color: "#FDC000"
|
|
118
|
+
},
|
|
119
|
+
"mp4/ogg/webm": {
|
|
120
|
+
name: "icon-video-type",
|
|
121
|
+
color: "#2E94FF"
|
|
122
|
+
},
|
|
123
|
+
"mp3/ogg/wav": {
|
|
124
|
+
name: "icon-audio",
|
|
125
|
+
color: "#2E94FF"
|
|
126
|
+
},
|
|
127
|
+
default: {
|
|
128
|
+
name: "icon-other-type",
|
|
129
|
+
color: "#9185F0"
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
for (const typeName in iconTypes) {
|
|
133
|
+
if (Object.hasOwnProperty.call(iconTypes, typeName)) {
|
|
134
|
+
const typeValue = iconTypes[typeName];
|
|
135
|
+
delete iconTypes[typeName];
|
|
136
|
+
typeName.split("/").forEach((type2) => iconTypes[type2] = typeValue);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return iconTypes[type] || iconTypes["default"];
|
|
140
|
+
};
|
|
141
|
+
const remove = ({ emit }) => ({ file }) => emit("remove", file);
|
|
142
|
+
const calcUploadListLiWidth = ({ vm, nextTick, props, constants }) => () => {
|
|
143
|
+
const { listType } = props, { LIST_TYPE } = constants;
|
|
144
|
+
nextTick(() => {
|
|
145
|
+
const uploadListEle = vm.$refs["upload-list"];
|
|
146
|
+
const uploadListLiEle = vm.$refs["upload-list-li"];
|
|
147
|
+
if (!uploadListEle || !(uploadListLiEle && uploadListLiEle[0]))
|
|
148
|
+
return;
|
|
149
|
+
if (listType === LIST_TYPE.TEXT) {
|
|
150
|
+
const { minWidth } = window.getComputedStyle(uploadListLiEle && uploadListLiEle[0]);
|
|
151
|
+
const marginRight = 8;
|
|
152
|
+
const num = Math.floor(uploadListEle.offsetWidth / (parseFloat(minWidth) + marginRight));
|
|
153
|
+
Array.from(uploadListLiEle).forEach((li, index) => {
|
|
154
|
+
if (!((index + 1) % num) || num === 1) {
|
|
155
|
+
li.style.marginRight = 0;
|
|
156
|
+
li.style.width = `${100 / num}%`;
|
|
157
|
+
} else {
|
|
158
|
+
li.style.marginRight = `${marginRight}px`;
|
|
159
|
+
li.style.width = `calc(${100 / num}% - ${marginRight}px)`;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
const mounted = ({ api, vm }) => () => {
|
|
166
|
+
const el = vm.$refs["upload-list"];
|
|
167
|
+
el && addResizeListener(el, api.calcUploadListLiWidth);
|
|
168
|
+
};
|
|
169
|
+
const destroyed = ({ api, props, vm }) => () => {
|
|
170
|
+
removeResizeListener(vm.$refs["upload-list"], api.calcUploadListLiWidth);
|
|
171
|
+
props.files.forEach((file) => {
|
|
172
|
+
removePlayEventListener({ type: "ended", el: file.el }, file.playEvent);
|
|
173
|
+
delete file.playEvent;
|
|
174
|
+
delete file.isPlay;
|
|
175
|
+
delete file.el;
|
|
176
|
+
});
|
|
177
|
+
};
|
|
40
178
|
export {
|
|
179
|
+
calcUploadListLiWidth,
|
|
180
|
+
destroyed,
|
|
41
181
|
downloadFile,
|
|
42
182
|
getDeleteData,
|
|
183
|
+
getFileIcon,
|
|
184
|
+
getFileType,
|
|
43
185
|
handleClick,
|
|
186
|
+
handleLoadedmetadata,
|
|
187
|
+
handleTimeupdate,
|
|
188
|
+
mounted,
|
|
44
189
|
parsePercentage,
|
|
45
|
-
|
|
190
|
+
pause,
|
|
191
|
+
picturefilePreview,
|
|
192
|
+
play,
|
|
193
|
+
reUpload,
|
|
194
|
+
remove,
|
|
195
|
+
showOperatePanel
|
|
46
196
|
};
|