@opentiny/vue-renderless 3.13.2 → 3.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/action-sheet/index.js +20 -13
- package/action-sheet/vue.js +8 -7
- package/amount/index.js +100 -25
- package/amount/vue.js +102 -26
- package/anchor/index.js +1 -0
- package/area/index.js +8 -8
- package/area/vue.js +5 -5
- package/async-flowchart/index.js +16 -3
- package/autocomplete/index.js +58 -14
- package/autocomplete/vue.js +40 -12
- package/badge/index.js +12 -0
- package/badge/vue.js +6 -4
- package/breadcrumb/vue.js +3 -1
- package/breadcrumb-item/vue.js +6 -2
- package/button/index.js +5 -1
- package/calendar/index.js +2 -86
- package/calendar-bar/index.js +18 -4
- package/calendar-view/index.js +5 -1
- package/calendar-view/vue.js +16 -3
- package/card-group/vue.js +4 -2
- package/cascader/index.js +86 -34
- package/cascader/vue.js +61 -20
- package/cascader-menu/index.js +7 -7
- package/cascader-menu/vue.js +2 -3
- package/cascader-mobile/index.js +36 -23
- package/cascader-mobile/vue.js +6 -0
- package/cascader-node/index.js +13 -1
- package/cascader-node/vue.js +15 -4
- package/cascader-panel/index.js +1 -1
- package/cascader-select/column-index.js +150 -0
- package/cascader-select/column.js +120 -0
- package/cascader-select/index.js +29 -165
- package/cascader-select/usePicker.js +251 -0
- package/cascader-select/useTouch.js +65 -0
- package/cascader-select/vue.js +35 -47
- package/cell/vue.js +2 -1
- package/chart-bar/index.js +2 -3
- package/chart-core/deps/constants.js +43 -43
- package/chart-core/index.js +1 -1
- package/chart-gauge/index.js +2 -2
- package/chart-heatmap/index.js +17 -10
- package/chart-line/index.js +8 -9
- package/chart-tree/index.js +2 -2
- package/chart-waterfall/index.js +4 -6
- package/checkbox/index.js +18 -1
- package/checkbox/vue.js +15 -7
- package/checkbox-group/vue.js +1 -0
- package/col/vue.js +1 -1
- package/collapse/index.js +3 -3
- package/color-select-panel/vue.js +0 -7
- package/column-list-item/index.js +17 -1
- package/column-list-item/vue.js +8 -3
- package/common/bigInt.js +2 -2
- package/common/date.js +7 -5
- package/common/deps/clickoutside.js +6 -2
- package/common/deps/date-util.js +4 -2
- package/common/deps/dom.js +19 -4
- package/common/deps/popper.js +44 -11
- package/common/deps/resize-event.js +1 -0
- package/common/deps/touch-emulator.js +4 -1
- package/common/deps/tree-model/node.js +2 -2
- package/common/deps/tree-model/tree-store.js +2 -13
- package/common/deps/useRect.js +25 -0
- package/common/deps/vue-popper.js +38 -20
- package/common/index.js +2 -2
- package/common/runtime.js +1 -1
- package/common/string.js +2 -2
- package/common/type.js +2 -1
- package/common/validate/rules/enum.js +1 -1
- package/common/validate/rules/pattern.js +2 -2
- package/common/validate/rules/range.js +8 -5
- package/common/validate/rules/required.js +1 -1
- package/common/validate/rules/type.js +5 -5
- package/common/validate/rules/whitespace.js +1 -1
- package/common/validate/util.js +15 -16
- package/common/validate/validations/integer.js +1 -1
- package/common/validate/validations/method.js +1 -1
- package/currency/index.js +74 -7
- package/currency/vue.js +21 -5
- package/date-panel/index.js +16 -0
- package/date-panel/vue.js +8 -2
- package/date-picker-mobile/index.js +12 -0
- package/date-picker-mobile/vue.js +7 -1
- package/date-range/vue.js +15 -6
- package/date-table/index.js +35 -53
- package/date-table/vue.js +4 -2
- package/dialog-box/index.js +46 -14
- package/dialog-box/vue.js +30 -7
- package/dialog-select/index.js +6 -3
- package/dialog-select/vue.js +8 -4
- package/drawer/index.js +27 -5
- package/drawer/vue.js +14 -7
- package/dropdown/index.js +7 -7
- package/dropdown/vue.js +6 -2
- package/dropdown-item/index.js +9 -1
- package/dropdown-item/mf.js +6 -10
- package/dropdown-item/vue.js +20 -7
- package/dropdown-menu/index.js +20 -7
- package/dropdown-menu/vue.js +4 -3
- package/exception/index.js +2 -7
- package/exception/vue.js +7 -10
- package/fall-menu/index.js +5 -1
- package/fall-menu/vue.js +13 -2
- package/file-upload/index.js +68 -18
- package/file-upload/vue.js +38 -8
- package/filter-box/index.js +1 -0
- package/float-button/index.js +42 -0
- package/float-button/vue.js +101 -0
- package/floating-button/index.js +62 -16
- package/floating-button/vue.js +27 -9
- package/flowchart/index.js +134 -25
- package/flowchart/node.js +13 -4
- package/flowchart/vue.js +16 -4
- package/form/vue.js +8 -0
- package/form-item/index.js +5 -5
- package/form-item/vue.js +3 -1
- package/fullscreen/index.js +5 -5
- package/fullscreen/vue.js +3 -3
- package/grid/plugins/export.js +5 -2
- package/grid/utils/column.js +1 -0
- package/grid/utils/dom.js +7 -1
- package/image/index.js +6 -1
- package/image/vue.js +6 -3
- package/image-viewer/index.js +62 -51
- package/image-viewer/vue.js +17 -5
- package/input/index.js +81 -20
- package/input/vue.js +44 -18
- package/ip-address/index.js +61 -19
- package/ip-address/vue.js +22 -4
- package/link/vue.js +3 -1
- package/loading/index.js +2 -2
- package/loading/vue.js +8 -2
- package/logout/index.js +1 -1
- package/menu/index.js +15 -2
- package/menu/vue.js +22 -17
- package/mind-map/index.js +47 -0
- package/mind-map/vue.js +53 -0
- package/modal/index.js +44 -4
- package/modal/vue.js +18 -4
- package/multi-select/index.js +186 -11
- package/multi-select/vue.js +60 -15
- package/multi-select-item/index.js +23 -0
- package/multi-select-item/vue.js +31 -0
- package/numeric/index.js +48 -12
- package/numeric/vue.js +44 -19
- package/option/index.js +27 -9
- package/option/vue.js +37 -21
- package/option-group/index.js +3 -3
- package/package.json +1 -1
- package/pager/index.js +18 -4
- package/pager/vue.js +16 -5
- package/picker/index.js +290 -77
- package/picker/mb.js +42 -0
- package/picker/vue.js +76 -20
- package/picker-column/index.js +1 -1
- package/pop-upload/vue.js +3 -0
- package/popconfirm/index.js +3 -6
- package/popconfirm/vue.js +1 -1
- package/popeditor/index.js +73 -34
- package/popeditor/vue.js +15 -11
- package/popover/index.js +4 -4
- package/popover/vue.js +6 -6
- package/popup/index.js +3 -3
- package/popup/vue.js +5 -5
- package/pull-refresh/index.js +13 -13
- package/pull-refresh/vue.js +5 -4
- package/radio/index.js +0 -17
- package/radio/vue.js +4 -10
- package/rate/index.js +1 -1
- package/rate/vue.js +0 -2
- package/record/index.js +4 -1
- package/rich-text/clipboard.js +54 -0
- package/rich-text/index.js +192 -0
- package/rich-text/module/file-upload.js +107 -0
- package/rich-text/module/image-drop.js +63 -0
- package/rich-text/module/image-upload.js +89 -0
- package/rich-text/options.js +141 -0
- package/rich-text/table-module.js +382 -0
- package/rich-text/vue.js +102 -0
- package/{rich-text-edtior → rich-text-editor}/index.js +2 -2
- package/{rich-text-edtior → rich-text-editor}/vue.js +2 -5
- package/scrollbar/index.js +11 -11
- package/scrollbar/vue-bar.js +3 -3
- package/scrollbar/vue.js +5 -5
- package/search/index.js +9 -9
- package/search/vue.js +8 -6
- package/select/index.js +442 -393
- package/select/vue.js +278 -164
- package/select-dropdown/index.js +61 -3
- package/select-dropdown/vue.js +85 -8
- package/select-view/index.js +3 -1
- package/selected-box/index.js +2 -0
- package/selected-box/vue.js +6 -3
- package/signature/index.js +241 -0
- package/signature/vue.js +88 -0
- package/skeleton/index.js +14 -0
- package/skeleton/vue.js +15 -0
- package/skeleton-item/vue.js +15 -0
- package/slider/index.js +70 -17
- package/slider/vue.js +16 -7
- package/split/index.js +5 -3
- package/split/vue.js +4 -6
- package/standard-list-item/index.js +15 -1
- package/standard-list-item/vue.js +6 -5
- package/steps/index.js +25 -2
- package/steps/slide-bar.js +8 -1
- package/steps/vue.js +15 -3
- package/tab-item-mf/vue.js +14 -8
- package/tab-nav/index.js +30 -5
- package/tab-nav/vue.js +16 -4
- package/tabbar/vue.js +9 -3
- package/tabbar-item/vue.js +3 -2
- package/tabs/index.js +16 -4
- package/tabs/vue.js +2 -1
- package/tabs-mf/index.js +20 -6
- package/tabs-mf/vue-nav.js +26 -11
- package/tabs-mf/vue.js +7 -7
- package/tabs-mf/wheel.js +1 -0
- package/tag/index.js +1 -1
- package/tag-group/index.js +2 -1
- package/time/index.js +5 -2
- package/time/vue.js +1 -1
- package/time-line/index.js +3 -3
- package/time-line/vue.js +2 -2
- package/time-picker-mobile/index.js +24 -5
- package/time-picker-mobile/vue.js +17 -7
- package/time-range/index.js +2 -0
- package/timeline-item/vue.js +1 -1
- package/tooltip/index.js +6 -3
- package/tooltip/vue.js +4 -4
- package/transfer/index.js +20 -22
- package/transfer/vue.js +1 -6
- package/transfer-panel/vue.js +3 -5
- package/tree/index.js +21 -4
- package/tree/vue.js +10 -8
- package/tree-menu/index.js +29 -3
- package/tree-menu/vue.js +28 -15
- package/tree-node/index.js +18 -18
- package/tree-node/vue.js +6 -5
- package/types/action-sheet.type.d.ts +118 -1
- package/types/amount.type.d.ts +168 -1
- package/types/area.type.d.ts +134 -1
- package/types/async-flowchart.type.d.ts +72 -0
- package/types/autocomplete.type.d.ts +199 -1
- package/types/badge.type.d.ts +3 -1
- package/types/breadcrumb-item.type.d.ts +2 -0
- package/types/breadcrumb.type.d.ts +2 -0
- package/types/button-group.type.d.ts +3 -3
- package/types/button.type.d.ts +4 -0
- package/types/cascader-menu.type.d.ts +3 -4
- package/types/cascader-node.type.d.ts +5 -2
- package/types/cascader-panel.type-2bd03be3.d.ts +241 -0
- package/types/cascader-panel.type.d.ts +3 -241
- package/types/cascader.type.d.ts +329 -1
- package/types/checkbox.type.d.ts +6 -0
- package/types/collapse.type.d.ts +19 -2
- package/types/date-picker.type.d.ts +38 -1
- package/types/dialog-box.type.d.ts +13 -3
- package/types/drawer.type.d.ts +133 -1
- package/types/{dropdown-item.type-8ea6c633.d.ts → dropdown-item.type-8475a549.d.ts} +7 -13
- package/types/dropdown-item.type.d.ts +1 -1
- package/types/dropdown-menu.type.d.ts +1 -1
- package/types/dropdown.type.d.ts +1 -5
- package/types/fall-menu.type.d.ts +94 -1
- package/types/file-upload.type.d.ts +1 -1
- package/types/float-button.type.d.ts +123 -0
- package/types/form-item.type.d.ts +1 -1
- package/types/{form.type-d0fd42f3.d.ts → form.type-a2dc0099.d.ts} +4 -1
- package/types/form.type.d.ts +1 -1
- package/types/{index-e0250f63.d.ts → index-b012f687.d.ts} +9 -0
- package/types/input.type.d.ts +2 -6
- package/types/ip-address.type.d.ts +160 -1
- package/types/link.type.d.ts +6 -3
- package/types/loading.type.d.ts +7 -0
- package/types/mind-map.type.d.ts +20 -0
- package/types/modal.type.d.ts +29 -2
- package/types/numeric.type.d.ts +41 -10
- package/types/pager.type.d.ts +12 -0
- package/types/picker.type.d.ts +18 -0
- package/types/popconfirm.type.d.ts +86 -1
- package/types/popeditor.type.d.ts +4 -0
- package/types/popover.type.d.ts +3 -3
- package/types/progress.type.d.ts +2 -0
- package/types/radio.type.d.ts +0 -4
- package/types/rate.type.d.ts +236 -1
- package/types/search.type.d.ts +88 -1
- package/types/shared.type.d.ts +1 -1
- package/types/skeleton-item.type.d.ts +38 -0
- package/types/skeleton.type.d.ts +45 -0
- package/types/slider.type.d.ts +49 -10
- package/types/steps.type.d.ts +14 -3
- package/types/tab-bar.type.d.ts +1 -1
- package/types/tab-nav.type.d.ts +7 -2
- package/types/tabs.type.d.ts +9 -1
- package/types/tag-group.type.d.ts +64 -1
- package/types/{time-line.type-d7daa669.d.ts → time-line.type-b155cb4f.d.ts} +12 -0
- package/types/time-line.type.d.ts +1 -1
- package/types/timeline-item.type.d.ts +1 -1
- package/types/tooltip.type.d.ts +2 -2
- package/types/transfer.type.d.ts +185 -1
- package/types/tree-menu.type.d.ts +210 -1
- package/types/upload-dragger.type.d.ts +1 -1
- package/types/{upload-list.type-343e8c11.d.ts → upload-list.type-6d6e3d0e.d.ts} +35 -8
- package/types/upload-list.type.d.ts +1 -1
- package/types/upload.type.d.ts +1 -1
- package/types/user-head.type.d.ts +146 -1
- package/types/wizard.type.d.ts +1 -0
- package/upload/index.js +64 -34
- package/upload/vue.js +9 -5
- package/upload-dragger/index.js +22 -20
- package/upload-list/index.js +24 -18
- package/upload-list/vue.js +9 -4
- package/user/index.js +35 -26
- package/user/vue.js +1 -1
- package/user-head/index.js +3 -3
- package/watermark/index.js +11 -0
- package/wheel/index.js +3 -0
- package/wizard/vue.js +4 -2
- package/common/deps/modal-queue.js +0 -6
- package/common/deps/requestAnimationFrame.js +0 -25
package/chart-line/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
__spreadProps,
|
|
3
2
|
__spreadValues
|
|
4
3
|
} from "../chunk-G2ADBYYC.js";
|
|
5
4
|
import { getFormated, getStackMap, getLegend, hexToRgb, set } from "../chart-core/deps/utils";
|
|
6
5
|
import { isNull } from "../common/type";
|
|
7
|
-
import { itemPoint, itemLabel, itemContent,
|
|
6
|
+
import { itemPoint, itemLabel, itemContent, SAAS_DEFAULT_COLORS } from "../chart-core/deps/constants";
|
|
8
7
|
const getLineXAxis = (args) => {
|
|
9
8
|
const { xAxisType, dimension, rows, xAxisName, axisVisible } = args;
|
|
10
9
|
return dimension.map((item, idx) => ({
|
|
@@ -28,10 +27,10 @@ const getAreaSeries = ({ color, seriesItem }) => {
|
|
|
28
27
|
};
|
|
29
28
|
const setSingLineSeries = ({ defaultSeriesItem, seriesItem }) => {
|
|
30
29
|
defaultSeriesItem.showSymbol = true;
|
|
31
|
-
set(defaultSeriesItem, "emphasis.itemStyle.color",
|
|
30
|
+
set(defaultSeriesItem, "emphasis.itemStyle.color", SAAS_DEFAULT_COLORS[0]);
|
|
32
31
|
seriesItem.label = __spreadValues({ show: true }, seriesItem.label);
|
|
33
32
|
seriesItem.itemStyle = __spreadValues({ color: "transparent" }, seriesItem.itemStyle);
|
|
34
|
-
seriesItem.lineStyle = __spreadValues({ color:
|
|
33
|
+
seriesItem.lineStyle = __spreadValues({ color: SAAS_DEFAULT_COLORS[0] }, seriesItem.lineStyle);
|
|
35
34
|
seriesItem.animation = seriesItem.animation || false;
|
|
36
35
|
};
|
|
37
36
|
const getLineSeries = (args) => {
|
|
@@ -83,7 +82,7 @@ const getLineYAxis = (args) => {
|
|
|
83
82
|
let yAxis = [];
|
|
84
83
|
for (let k = 0; k < 2; k++) {
|
|
85
84
|
if (yAxisType[k]) {
|
|
86
|
-
yAxis[k] =
|
|
85
|
+
yAxis[k] = Object.assign({}, yAxisBase, {
|
|
87
86
|
axisLabel: {
|
|
88
87
|
formatter(val) {
|
|
89
88
|
return getFormated(val, yAxisType[k], digit);
|
|
@@ -91,7 +90,7 @@ const getLineYAxis = (args) => {
|
|
|
91
90
|
}
|
|
92
91
|
});
|
|
93
92
|
} else {
|
|
94
|
-
yAxis[k] =
|
|
93
|
+
yAxis[k] = Object.assign({}, yAxisBase);
|
|
95
94
|
}
|
|
96
95
|
yAxis[k].name = yAxisName[k] || "";
|
|
97
96
|
yAxis[k].scale = scale[k] || false;
|
|
@@ -115,7 +114,7 @@ const getLineTooltip = (args) => {
|
|
|
115
114
|
template.push(`${title}<br>`);
|
|
116
115
|
items.forEach(({ seriesName, data, color }) => {
|
|
117
116
|
if (color === "transparent" && items.length === 1) {
|
|
118
|
-
color =
|
|
117
|
+
color = SAAS_DEFAULT_COLORS[0];
|
|
119
118
|
}
|
|
120
119
|
let showData = null;
|
|
121
120
|
const type = ~rightListArr.indexOf(seriesName) ? yAxisType[1] : yAxisType[0];
|
|
@@ -150,7 +149,7 @@ const line = (columns, rows, settings, extra) => {
|
|
|
150
149
|
}
|
|
151
150
|
let legendItemStyle;
|
|
152
151
|
if (metrics.length === 1) {
|
|
153
|
-
legendItemStyle = { itemStyle: { color:
|
|
152
|
+
legendItemStyle = { itemStyle: { color: SAAS_DEFAULT_COLORS[0] } };
|
|
154
153
|
}
|
|
155
154
|
const legend = legendVisible && getLegend({ legendName, metrics, labelMap, legendItemStyle });
|
|
156
155
|
const tooltip = tooltipVisible && getLineTooltip({ axisSite, digit, labelMap, tooltipFormatter, xAxisType, yAxisType });
|
|
@@ -160,7 +159,7 @@ const line = (columns, rows, settings, extra) => {
|
|
|
160
159
|
Object.assign(seriesParam, { label, labelMap, metrics, nullAddZero, rows, xAxisType, stack, color, smooth });
|
|
161
160
|
const series = getLineSeries(seriesParam);
|
|
162
161
|
let options = { legend, xAxis, series, yAxis, tooltip };
|
|
163
|
-
return
|
|
162
|
+
return options;
|
|
164
163
|
};
|
|
165
164
|
export {
|
|
166
165
|
line
|
package/chart-tree/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import { isObject } from "../chart-core/deps/utils";
|
|
3
|
-
import { itemLabel, itemContent,
|
|
3
|
+
import { itemLabel, itemContent, SAAS_DEFAULT_COLORS } from "../chart-core/deps/constants";
|
|
4
4
|
const getTreeLegend = (args) => {
|
|
5
5
|
const { dimension, rows } = args;
|
|
6
6
|
const result = rows.map((row) => row[dimension]);
|
|
@@ -33,7 +33,7 @@ const getTreeSeries = (args) => {
|
|
|
33
33
|
rows.forEach((row) => {
|
|
34
34
|
const seriesItem = seriesMap[row[dimension]];
|
|
35
35
|
const label = { position: "right", fontSize: 12, color: "#191919" };
|
|
36
|
-
const itemStyle = { color:
|
|
36
|
+
const itemStyle = { color: SAAS_DEFAULT_COLORS[0] };
|
|
37
37
|
const lineStyle = { color: "rgba(25 ,25 ,25 , 0.10)" };
|
|
38
38
|
const symbolSize = 16;
|
|
39
39
|
const result = { type: "tree", name: row[dimension], data: row[metrics], itemStyle, label, lineStyle, symbolSize };
|
package/chart-waterfall/index.js
CHANGED
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "../chunk-G2ADBYYC.js";
|
|
5
5
|
import { getFormated } from "../chart-core/deps/utils";
|
|
6
6
|
import { isNull } from "../common/type";
|
|
7
|
-
import { itemLabel, itemContent,
|
|
7
|
+
import { itemLabel, itemContent, SAAS_DEFAULT_COLORS } from "../chart-core/deps/constants";
|
|
8
8
|
const getWaterfallTooltip = (dataType, digit) => {
|
|
9
9
|
let trigger = "axis";
|
|
10
|
-
let axisPointer = { type: "shadow" };
|
|
10
|
+
let axisPointer = { type: "shadow", z: 1, shadowStyle: { color: "#f5f5f5" } };
|
|
11
11
|
let formatter = function(items) {
|
|
12
12
|
const item = items[1];
|
|
13
13
|
return [
|
|
@@ -24,10 +24,8 @@ const getWaterfallXAxis = (args) => {
|
|
|
24
24
|
let name = labelMap && labelMap[xAxisName] || xAxisName;
|
|
25
25
|
const xAxis = { type: "category", name, splitLine: { show: false }, data: xAxisData, show: axisVisible };
|
|
26
26
|
const axisLine = { show: true, lineStyle: { color: "#191919", opacity: 0.1, width: 2 } };
|
|
27
|
-
const axisPointer = { type: "shadow", z: 1, shadowStyle: { color: "#f5f5f5" } };
|
|
28
27
|
return __spreadProps(__spreadValues({}, xAxis), {
|
|
29
|
-
axisLine
|
|
30
|
-
axisPointer
|
|
28
|
+
axisLine
|
|
31
29
|
});
|
|
32
30
|
};
|
|
33
31
|
const getWaterfallYAxis = (args) => {
|
|
@@ -69,7 +67,7 @@ const getWaterfallSeries = (args) => {
|
|
|
69
67
|
series.push(
|
|
70
68
|
Object.assign(seriesAdv, __spreadProps(__spreadValues({}, seriesBase), {
|
|
71
69
|
itemStyle: { borderRadius: [4, 4, 0, 0] },
|
|
72
|
-
color:
|
|
70
|
+
color: SAAS_DEFAULT_COLORS[0]
|
|
73
71
|
}))
|
|
74
72
|
);
|
|
75
73
|
return series;
|
package/checkbox/index.js
CHANGED
|
@@ -40,7 +40,7 @@ const handleChange = ({
|
|
|
40
40
|
};
|
|
41
41
|
const computedGetModelGet = ({ state, props }) => () => {
|
|
42
42
|
const model = state.isGroup ? state.store : props.modelValue !== void 0 ? props.modelValue : state.selfModel;
|
|
43
|
-
return isNull(model) ? [] : model;
|
|
43
|
+
return isNull(model) ? state.isGroup ? [] : "" : model;
|
|
44
44
|
};
|
|
45
45
|
const computedGetModelSet = ({
|
|
46
46
|
state,
|
|
@@ -124,6 +124,21 @@ const computedShowText = ({ props }) => () => {
|
|
|
124
124
|
return props.label;
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
|
+
const handleLabelMouseenter = ({ state, vm }) => (e) => {
|
|
128
|
+
const label = e.target;
|
|
129
|
+
if (label && label.scrollWidth > label.offsetWidth) {
|
|
130
|
+
const tooltip = vm.$refs.tooltip;
|
|
131
|
+
tooltip.state.referenceElm = label;
|
|
132
|
+
tooltip.state.popperElm && (tooltip.state.popperElm.style.display = "none");
|
|
133
|
+
tooltip.doDestroy();
|
|
134
|
+
state.tooltipVisible = true;
|
|
135
|
+
state.displayedValue = label.textContent;
|
|
136
|
+
setTimeout(tooltip.updatePopper, 20);
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
const handleMouseleave = (state) => () => {
|
|
140
|
+
state.tooltipVisible = false;
|
|
141
|
+
};
|
|
127
142
|
export {
|
|
128
143
|
addToStore,
|
|
129
144
|
computedCheckboxSize,
|
|
@@ -141,6 +156,8 @@ export {
|
|
|
141
156
|
computedShowText,
|
|
142
157
|
computedStore,
|
|
143
158
|
handleChange,
|
|
159
|
+
handleLabelMouseenter,
|
|
160
|
+
handleMouseleave,
|
|
144
161
|
mounted,
|
|
145
162
|
removeFromStore,
|
|
146
163
|
toggleEvent
|
package/checkbox/vue.js
CHANGED
|
@@ -18,12 +18,14 @@ import {
|
|
|
18
18
|
mounted,
|
|
19
19
|
toggleEvent,
|
|
20
20
|
computedIsShowText,
|
|
21
|
-
computedShowText
|
|
21
|
+
computedShowText,
|
|
22
|
+
handleLabelMouseenter,
|
|
23
|
+
handleMouseleave
|
|
22
24
|
} from "./index";
|
|
23
|
-
const api = ["state", "handleChange", "computedStore"];
|
|
25
|
+
const api = ["state", "handleChange", "computedStore", "handleLabelMouseenter", "handleMouseleave"];
|
|
24
26
|
const initState = ({ reactive, computed, parent, api: api2, inject, props }) => {
|
|
25
27
|
const state = reactive({
|
|
26
|
-
size: props.size || inject("size", null),
|
|
28
|
+
size: computed(() => props.size || inject("size", null) || (parent.tinyForm || {}).size),
|
|
27
29
|
vertical: inject("vertical", null),
|
|
28
30
|
iconPosition: props.iconPosition || inject("iconPosition", "center"),
|
|
29
31
|
focus: false,
|
|
@@ -48,7 +50,10 @@ const initState = ({ reactive, computed, parent, api: api2, inject, props }) =>
|
|
|
48
50
|
set: (value) => api2.computedGetModelSet(value)
|
|
49
51
|
}),
|
|
50
52
|
showText: computed(() => api2.computedShowText()),
|
|
51
|
-
isShowText: computed(() => api2.computedIsShowText())
|
|
53
|
+
isShowText: computed(() => api2.computedIsShowText()),
|
|
54
|
+
shape: inject("shape", null) || props.shape,
|
|
55
|
+
tooltipVisible: false,
|
|
56
|
+
displayedValue: ""
|
|
52
57
|
});
|
|
53
58
|
return state;
|
|
54
59
|
};
|
|
@@ -62,7 +67,8 @@ const initApi = ({
|
|
|
62
67
|
formItemSize,
|
|
63
68
|
emit,
|
|
64
69
|
nextTick,
|
|
65
|
-
t
|
|
70
|
+
t,
|
|
71
|
+
vm
|
|
66
72
|
}) => {
|
|
67
73
|
Object.assign(api2, {
|
|
68
74
|
state,
|
|
@@ -83,7 +89,9 @@ const initApi = ({
|
|
|
83
89
|
handleChange: handleChange({ state, props, emit, nextTick, dispatch, constants }),
|
|
84
90
|
computedDisplayLabel: computedDisplayLabel({ state, props, t }),
|
|
85
91
|
computedIsShowText: computedIsShowText({ props }),
|
|
86
|
-
computedShowText: computedShowText({ props })
|
|
92
|
+
computedShowText: computedShowText({ props }),
|
|
93
|
+
handleLabelMouseenter: handleLabelMouseenter({ state, vm }),
|
|
94
|
+
handleMouseleave: handleMouseleave(state)
|
|
87
95
|
});
|
|
88
96
|
};
|
|
89
97
|
const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive, watch, inject }, { vm, parent, emit, constants, nextTick, dispatch, t }) => {
|
|
@@ -91,7 +99,7 @@ const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive, wat
|
|
|
91
99
|
const formItemSize = computed(() => api2.computedFormItemSize());
|
|
92
100
|
const state = initState({ reactive, computed, parent, api: api2, inject, props });
|
|
93
101
|
parent.tinyForm = parent.tinyForm || inject("form", null);
|
|
94
|
-
initApi({ api: api2, state, dispatch, props, parent, constants, formItemSize, emit, nextTick, t });
|
|
102
|
+
initApi({ api: api2, state, dispatch, props, parent, constants, formItemSize, emit, nextTick, t, vm });
|
|
95
103
|
watch(
|
|
96
104
|
() => props.modelValue,
|
|
97
105
|
(value) => props.validateEvent && api2.dispatch(constants.FORM_ITEM, constants.FORM_CHANGE, value)
|
package/checkbox-group/vue.js
CHANGED
|
@@ -20,6 +20,7 @@ const renderless = (props, { computed, reactive, watch, provide }, { dispatch, c
|
|
|
20
20
|
provide("size", props.size);
|
|
21
21
|
provide("vertical", props.vertical);
|
|
22
22
|
provide("iconPosition", props.iconPosition);
|
|
23
|
+
provide("shape", props.shape);
|
|
23
24
|
return api2;
|
|
24
25
|
};
|
|
25
26
|
export {
|
package/col/vue.js
CHANGED
|
@@ -7,7 +7,7 @@ const renderless = (props, { computed, reactive, inject }, { parent }) => {
|
|
|
7
7
|
row: computed(() => api2.row()),
|
|
8
8
|
style: computed(() => api2.getStyle()),
|
|
9
9
|
className: computed(() => api2.getClassName()),
|
|
10
|
-
layout: inject("layout")
|
|
10
|
+
layout: inject("layout", {})
|
|
11
11
|
});
|
|
12
12
|
Object.assign(api2, {
|
|
13
13
|
state,
|
package/collapse/index.js
CHANGED
|
@@ -8,7 +8,7 @@ const setActiveNames = ({ emit, props, state }) => (activeNames) => {
|
|
|
8
8
|
};
|
|
9
9
|
const handleItemClick = ({ api, props, state }) => (item) => {
|
|
10
10
|
const activeNames = state.activeNames.slice(0);
|
|
11
|
-
const index = activeNames.indexOf(item.name);
|
|
11
|
+
const index = activeNames.indexOf(item == null ? void 0 : item.name);
|
|
12
12
|
const beforeClose = () => {
|
|
13
13
|
let result = props.beforeClose ? props.beforeClose(item, state.activeNames) : true;
|
|
14
14
|
return new Promise((resolve) => {
|
|
@@ -22,10 +22,10 @@ const handleItemClick = ({ api, props, state }) => (item) => {
|
|
|
22
22
|
beforeClose().then((next) => {
|
|
23
23
|
if (props.accordion) {
|
|
24
24
|
if (next || !activeNames.length) {
|
|
25
|
-
api.setActiveNames(activeNames[0] === item.name ? "" : item.name);
|
|
25
|
+
api.setActiveNames(activeNames[0] === (item == null ? void 0 : item.name) ? "" : item == null ? void 0 : item.name);
|
|
26
26
|
}
|
|
27
27
|
} else {
|
|
28
|
-
index > -1 ? next && activeNames.splice(index, 1) : activeNames.push(item.name);
|
|
28
|
+
index > -1 ? next && activeNames.splice(index, 1) : activeNames.push(item == null ? void 0 : item.name);
|
|
29
29
|
api.setActiveNames(activeNames);
|
|
30
30
|
}
|
|
31
31
|
});
|
|
@@ -57,13 +57,6 @@ const renderless = (props, context, { emit }) => {
|
|
|
57
57
|
},
|
|
58
58
|
{ deep: true }
|
|
59
59
|
);
|
|
60
|
-
context.watch(
|
|
61
|
-
state,
|
|
62
|
-
() => {
|
|
63
|
-
state.color = state.color;
|
|
64
|
-
},
|
|
65
|
-
{ deep: true }
|
|
66
|
-
);
|
|
67
60
|
context.watch(modelValue, (newValue) => {
|
|
68
61
|
pre.value = res.value;
|
|
69
62
|
hex.value = newValue;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../chunk-G2ADBYYC.js";
|
|
2
5
|
import { isNull } from "../common/type";
|
|
3
6
|
const handelIconClick = ({ emit }) => (item, index, event) => {
|
|
4
7
|
if (item.disabled)
|
|
@@ -51,12 +54,25 @@ const getItemChecked = ({ props, state }) => () => {
|
|
|
51
54
|
return state.model === props.label;
|
|
52
55
|
}
|
|
53
56
|
};
|
|
57
|
+
const computedOptions = ({ props }) => () => {
|
|
58
|
+
return props.options.filter((item) => {
|
|
59
|
+
const hidden = typeof item.hidden === "function" ? item.hidden(props.data) : item.hidden;
|
|
60
|
+
return !hidden;
|
|
61
|
+
}).map((opt) => {
|
|
62
|
+
return __spreadProps(__spreadValues({}, opt), {
|
|
63
|
+
disabled: typeof opt.disabled === "function" ? opt.disabled(props.data) : opt.disabled
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
const getType = ({ props, state }) => () => state.isGroup ? state.columnGroup.type || props.type : props.type;
|
|
54
68
|
export {
|
|
69
|
+
computedOptions,
|
|
55
70
|
computedStore,
|
|
56
71
|
getIsGroup,
|
|
57
72
|
getItemChecked,
|
|
58
73
|
getModel,
|
|
59
74
|
getSize,
|
|
75
|
+
getType,
|
|
60
76
|
handelIconClick,
|
|
61
77
|
handleChange,
|
|
62
78
|
isDisabled,
|
package/column-list-item/vue.js
CHANGED
|
@@ -8,22 +8,25 @@ import {
|
|
|
8
8
|
handleChange,
|
|
9
9
|
getIsGroup,
|
|
10
10
|
getSize,
|
|
11
|
-
isDisabled
|
|
11
|
+
isDisabled,
|
|
12
|
+
computedOptions,
|
|
13
|
+
getType
|
|
12
14
|
} from "./index";
|
|
13
15
|
const api = ["state", "handelIconClick", "handleChange"];
|
|
14
16
|
const renderless = (props, { reactive, computed }, { vm, parent, emit, nextTick, dispatch, constants }) => {
|
|
15
17
|
const api2 = {};
|
|
16
18
|
const state = reactive({
|
|
17
19
|
columnGroup: {},
|
|
20
|
+
type: computed(() => api2.getType()),
|
|
18
21
|
size: computed(() => api2.getSize()),
|
|
19
22
|
disabled: computed(() => api2.isDisabled()),
|
|
20
23
|
itemChecked: computed(() => api2.getItemChecked()),
|
|
21
24
|
sliceNum: computed(() => props.size === "small" ? 1 : 2),
|
|
22
25
|
iconNum: computed(() => props.size === "small" ? 2 : 3),
|
|
23
|
-
effectOptions: computed(() => props.options.filter((item) => !item.hidden)),
|
|
24
26
|
showCheckbox: computed(() => props.showCheckbox || state.columnGroup.showCheckbox),
|
|
25
27
|
showRadio: computed(() => props.showRadio || state.columnGroup.showRadio),
|
|
26
28
|
store: computed(() => api2.computedStore()),
|
|
29
|
+
effectOptions: computed(() => api2.computedOptions()),
|
|
27
30
|
isGroup: computed(() => api2.getIsGroup()),
|
|
28
31
|
model: computed({
|
|
29
32
|
get: () => api2.getModel(),
|
|
@@ -40,7 +43,9 @@ const renderless = (props, { reactive, computed }, { vm, parent, emit, nextTick,
|
|
|
40
43
|
handleChange: handleChange({ constants, dispatch, emit, state, nextTick }),
|
|
41
44
|
computedStore: computedStore({ state, props }),
|
|
42
45
|
handelIconClick: handelIconClick({ emit }),
|
|
43
|
-
getItemChecked: getItemChecked({ state, props })
|
|
46
|
+
getItemChecked: getItemChecked({ state, props }),
|
|
47
|
+
computedOptions: computedOptions({ props }),
|
|
48
|
+
getType: getType({ props, state })
|
|
44
49
|
});
|
|
45
50
|
return api2;
|
|
46
51
|
};
|
package/common/bigInt.js
CHANGED
|
@@ -119,7 +119,7 @@ class BigIntDecimal {
|
|
|
119
119
|
const f = Function;
|
|
120
120
|
const convertBigInt = (str) => {
|
|
121
121
|
const validStr = str.replace(/^0+/, "") || "0";
|
|
122
|
-
return f(`return BigInt(${validStr})`)();
|
|
122
|
+
return f(`return BigInt('${validStr}')`)();
|
|
123
123
|
};
|
|
124
124
|
if (validateNumber(mergedValue)) {
|
|
125
125
|
const trimRet = trimNumber(mergedValue);
|
|
@@ -127,7 +127,7 @@ class BigIntDecimal {
|
|
|
127
127
|
const numbers = trimRet.trimStr.split(".");
|
|
128
128
|
this.integer = !numbers[0].includes("e") ? BigInt(numbers[0]) : numbers[0];
|
|
129
129
|
const decimalStr = numbers[1] || "0";
|
|
130
|
-
this.decimal = convertBigInt(decimalStr);
|
|
130
|
+
this.decimal = decimalStr.includes("e") ? convertBigInt(decimalStr) : BigInt(decimalStr);
|
|
131
131
|
this.decimalLen = decimalStr.length;
|
|
132
132
|
} else {
|
|
133
133
|
this.nan = true;
|
package/common/date.js
CHANGED
|
@@ -48,13 +48,14 @@ const getTimezone = (date) => {
|
|
|
48
48
|
return timezone;
|
|
49
49
|
};
|
|
50
50
|
const isLeapYear = (year) => year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
|
|
51
|
+
const getMilliseconds = (milliseconds) => milliseconds > maxDateValues.MILLISECOND ? Number(String(milliseconds).substring(0, 3)) : milliseconds;
|
|
51
52
|
const getDateFromData = ({ year, month, date, hours, minutes, seconds, milliseconds }) => {
|
|
52
53
|
let daysInMonth = daysInMonths[month];
|
|
53
54
|
if (isLeapYear(year) && month === 1) {
|
|
54
55
|
daysInMonth += 1;
|
|
55
56
|
}
|
|
56
57
|
if (date <= daysInMonth) {
|
|
57
|
-
return new Date(year, month, date, hours, minutes, seconds, milliseconds);
|
|
58
|
+
return new Date(year, month, date, hours, minutes, seconds, getMilliseconds(milliseconds));
|
|
58
59
|
}
|
|
59
60
|
};
|
|
60
61
|
const yyyymmddDateParser = (m) => {
|
|
@@ -133,7 +134,7 @@ const iso8601DateParser = (m) => {
|
|
|
133
134
|
actHours = sign === "+" ? hours - offsetHours - offset / 60 : Number(hours) + Number(offsetHours) - offset / 60;
|
|
134
135
|
actMinutes = sign === "+" ? minutes - offsetMinutes : Number(minutes) + Number(offsetMinutes);
|
|
135
136
|
}
|
|
136
|
-
return new Date(year, month, date, actHours, actMinutes, seconds, milliseconds);
|
|
137
|
+
return new Date(year, month, date, actHours, actMinutes, seconds, getMilliseconds(milliseconds));
|
|
137
138
|
}
|
|
138
139
|
};
|
|
139
140
|
const dateParsers = [
|
|
@@ -298,14 +299,15 @@ const format = function(date, dateFormat = "yyyy/MM/dd hh:mm:ss") {
|
|
|
298
299
|
return dateValue ? format(dateValue, afterFormat) : "";
|
|
299
300
|
}
|
|
300
301
|
};
|
|
301
|
-
const getDateWithNewTimezone = (date, otz, ntz) => {
|
|
302
|
-
if (!isDate(date) || !isNumeric(otz) || !isNumeric(ntz)) {
|
|
302
|
+
const getDateWithNewTimezone = (date, otz, ntz, timezoneOffset = 0) => {
|
|
303
|
+
if (!isDate(date) || !isNumeric(otz) || !isNumeric(ntz) || !isNumeric(timezoneOffset)) {
|
|
303
304
|
return;
|
|
304
305
|
}
|
|
305
306
|
const otzOffset = -otz * 60;
|
|
306
307
|
const ntzOffset = -ntz * 60;
|
|
308
|
+
const dstOffeset = timezoneOffset * 60;
|
|
307
309
|
const utc = date.getTime() + otzOffset * 6e4;
|
|
308
|
-
return new Date(utc - ntzOffset * 6e4);
|
|
310
|
+
return new Date(utc - (ntzOffset - dstOffeset) * 6e4);
|
|
309
311
|
};
|
|
310
312
|
const toDateStr = (date, dateFormat, timezone) => {
|
|
311
313
|
if (date && isNumeric(timezone)) {
|
|
@@ -9,11 +9,12 @@ if (!isServer) {
|
|
|
9
9
|
on(document, "mousedown", (event) => startClick = event);
|
|
10
10
|
on(document, "mouseup", (event) => {
|
|
11
11
|
nodeList.forEach((node) => node[nameSpace].documentHandler(event, startClick));
|
|
12
|
+
startClick = void 0;
|
|
12
13
|
});
|
|
13
14
|
}
|
|
14
15
|
const createDocumentHandler = (el, binding, vnode) => function(mouseup = {}, mousedown = {}) {
|
|
15
|
-
let popperElm = vnode.context.popperElm || vnode.context.state.popperElm;
|
|
16
|
-
if (!mouseup.target || !mousedown.target || el.contains(mouseup.target) || el.contains(mousedown.target) || el === mouseup.target || popperElm && (popperElm.contains(mouseup.target) || popperElm.contains(mousedown.target))) {
|
|
16
|
+
let popperElm = vnode.context.popperElm || vnode.context.state && vnode.context.state.popperElm;
|
|
17
|
+
if (!mouseup || !mouseup.target || !mousedown || !mousedown.target || el.contains(mouseup.target) || el.contains(mousedown.target) || el === mouseup.target || popperElm && (popperElm.contains(mouseup.target) || popperElm.contains(mousedown.target))) {
|
|
17
18
|
return;
|
|
18
19
|
}
|
|
19
20
|
if (binding.expression && el[nameSpace].methodName && vnode.context[el[nameSpace].methodName]) {
|
|
@@ -49,6 +50,9 @@ var clickoutside_default = {
|
|
|
49
50
|
break;
|
|
50
51
|
}
|
|
51
52
|
}
|
|
53
|
+
if (nodeList.length === 0 && startClick) {
|
|
54
|
+
startClick = null;
|
|
55
|
+
}
|
|
52
56
|
delete el[nameSpace];
|
|
53
57
|
}
|
|
54
58
|
};
|
package/common/deps/date-util.js
CHANGED
|
@@ -60,10 +60,12 @@ const getFirstDayOfMonth = (date) => {
|
|
|
60
60
|
};
|
|
61
61
|
const prevDate = (date, amount = 1) => new Date(date.getFullYear(), date.getMonth(), date.getDate() - amount);
|
|
62
62
|
const nextDate = (date, amount = 1) => new Date(date.getFullYear(), date.getMonth(), date.getDate() + amount);
|
|
63
|
-
const getStartDateOfMonth = (year, month) => {
|
|
63
|
+
const getStartDateOfMonth = (year, month, offsetDay = 0) => {
|
|
64
64
|
const res = new Date(year, month, 1);
|
|
65
65
|
const day = res.getDay();
|
|
66
|
-
|
|
66
|
+
const _day = day === 0 ? 7 : day;
|
|
67
|
+
const offset = _day + offsetDay <= 0 ? 7 + _day : _day;
|
|
68
|
+
return prevDate(res, offset);
|
|
67
69
|
};
|
|
68
70
|
const getWeekNumber = (src) => {
|
|
69
71
|
if (!isDate(src)) {
|
package/common/deps/dom.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../chunk-G2ADBYYC.js";
|
|
2
|
-
import { hasOwn,
|
|
2
|
+
import { hasOwn, isNull } from "../type";
|
|
3
3
|
import globalConfig from "../global";
|
|
4
4
|
const isServer = typeof window === "undefined";
|
|
5
5
|
const SPECIAL_CHARS_REGEXP = /([:\-_]+(.))/g;
|
|
@@ -11,7 +11,6 @@ const on = (el, event, handler, options = false) => {
|
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
13
|
const off = (el, event, handler, options = false) => {
|
|
14
|
-
window.document;
|
|
15
14
|
if (el && event) {
|
|
16
15
|
el.removeEventListener(event, handler, options);
|
|
17
16
|
}
|
|
@@ -133,7 +132,6 @@ const isInContainer = (el, container) => {
|
|
|
133
132
|
}
|
|
134
133
|
return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
|
|
135
134
|
};
|
|
136
|
-
const isVNode = (node) => node !== null && isObject(node) && hasOwn.call(node, "componentOptions");
|
|
137
135
|
const getDomNode = () => {
|
|
138
136
|
const viewportWindow = globalConfig.viewportWindow || window;
|
|
139
137
|
let documentElement = viewportWindow.document.documentElement;
|
|
@@ -172,6 +170,23 @@ const getScrollParent = (el, root = defaultRoot) => {
|
|
|
172
170
|
}
|
|
173
171
|
return root;
|
|
174
172
|
};
|
|
173
|
+
const isDisplayNone = (elm) => {
|
|
174
|
+
if (isServer)
|
|
175
|
+
return false;
|
|
176
|
+
if (elm) {
|
|
177
|
+
const computedStyle = getComputedStyle(elm);
|
|
178
|
+
if (computedStyle.getPropertyValue("position") === "fixed") {
|
|
179
|
+
if (computedStyle.getPropertyValue("display") === "none") {
|
|
180
|
+
return true;
|
|
181
|
+
} else if (elm.parentNode !== document.body) {
|
|
182
|
+
return isDisplayNone(elm.parentNode);
|
|
183
|
+
}
|
|
184
|
+
} else {
|
|
185
|
+
return elm.offsetParent === null;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return false;
|
|
189
|
+
};
|
|
175
190
|
export {
|
|
176
191
|
addClass,
|
|
177
192
|
getDomNode,
|
|
@@ -180,10 +195,10 @@ export {
|
|
|
180
195
|
getScrollTop,
|
|
181
196
|
getStyle,
|
|
182
197
|
hasClass,
|
|
198
|
+
isDisplayNone,
|
|
183
199
|
isInContainer,
|
|
184
200
|
isScroll,
|
|
185
201
|
isServer,
|
|
186
|
-
isVNode,
|
|
187
202
|
off,
|
|
188
203
|
on,
|
|
189
204
|
once,
|
package/common/deps/popper.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__spreadValues
|
|
3
3
|
} from "../../chunk-G2ADBYYC.js";
|
|
4
|
-
import { on, off } from "./dom";
|
|
4
|
+
import { on, off, isDisplayNone } from "./dom";
|
|
5
5
|
import PopupManager from "./popup-manager";
|
|
6
6
|
import globalConfig from "../global";
|
|
7
7
|
import { typeOf } from "../type";
|
|
@@ -16,12 +16,13 @@ const DEFAULTS = {
|
|
|
16
16
|
// 全局没有修改过它,所以它一直是flip
|
|
17
17
|
forceAbsolute: false,
|
|
18
18
|
gpuAcceleration: true,
|
|
19
|
-
// 这个用不到了,默认使用tranform3d
|
|
20
19
|
offset: 0,
|
|
21
20
|
placement: "bottom",
|
|
22
21
|
preventOverflowOrder: positions,
|
|
23
|
-
modifiers
|
|
22
|
+
modifiers,
|
|
24
23
|
// 此处是string数组, 构造函数调用之后转为函数数组
|
|
24
|
+
updateHiddenPopperOnScroll: false
|
|
25
|
+
// 滚动过程中是否更新隐藏的弹出层位置
|
|
25
26
|
};
|
|
26
27
|
const setStyle = (el, styles) => {
|
|
27
28
|
const isNumeric = (n) => n !== "" && !isNaN(parseFloat(n)) && isFinite(n);
|
|
@@ -255,8 +256,12 @@ class Popper {
|
|
|
255
256
|
let styles = { position: data.offsets.popper.position };
|
|
256
257
|
let left = Math.round(data.offsets.popper.left);
|
|
257
258
|
let top = Math.round(data.offsets.popper.top);
|
|
258
|
-
|
|
259
|
-
|
|
259
|
+
if (this._options.gpuAcceleration) {
|
|
260
|
+
styles.transform = `translate3d(${left}px, ${top}px, 0)`;
|
|
261
|
+
Object.assign(styles, { top: 0, left: 0 });
|
|
262
|
+
} else {
|
|
263
|
+
Object.assign(styles, { top, left });
|
|
264
|
+
}
|
|
260
265
|
Object.assign(styles, data.styles);
|
|
261
266
|
setStyle(this._popper, styles);
|
|
262
267
|
this._popper.setAttribute("x-placement", data.placement);
|
|
@@ -480,10 +485,29 @@ class Popper {
|
|
|
480
485
|
};
|
|
481
486
|
}
|
|
482
487
|
_setupEventListeners() {
|
|
488
|
+
var _a, _b;
|
|
483
489
|
this.state.updateBoundFn = this.update.bind(this);
|
|
490
|
+
this.state.scrollUpdate = () => {
|
|
491
|
+
if (this._options.updateHiddenPopperOnScroll) {
|
|
492
|
+
this.state.updateBoundFn();
|
|
493
|
+
} else {
|
|
494
|
+
if (isDisplayNone(this._popper))
|
|
495
|
+
return;
|
|
496
|
+
this.state.updateBoundFn();
|
|
497
|
+
}
|
|
498
|
+
};
|
|
484
499
|
on(window, "resize", this.state.updateBoundFn);
|
|
485
500
|
if (this._options.boundariesElement !== "window") {
|
|
486
501
|
let target = getScrollParent(this._reference);
|
|
502
|
+
const customTargets = [];
|
|
503
|
+
if ((_b = (_a = target == null ? void 0 : target.dataset) == null ? void 0 : _a.tag) == null ? void 0 : _b.includes("-form")) {
|
|
504
|
+
customTargets.push(target);
|
|
505
|
+
let realTarget = getScrollParent(target);
|
|
506
|
+
if (realTarget === window.document.body || realTarget === window.document.documentElement) {
|
|
507
|
+
realTarget = window;
|
|
508
|
+
}
|
|
509
|
+
customTargets.push(realTarget);
|
|
510
|
+
}
|
|
487
511
|
if (target === window.document.body || target === window.document.documentElement) {
|
|
488
512
|
target = window;
|
|
489
513
|
}
|
|
@@ -492,27 +516,35 @@ class Popper {
|
|
|
492
516
|
let targets = getAllScrollParents(this._reference);
|
|
493
517
|
this.state.scrollTargets = targets || [];
|
|
494
518
|
targets.forEach((target2) => {
|
|
495
|
-
on(target2, "scroll", this.state.
|
|
519
|
+
on(target2, "scroll", this.state.scrollUpdate);
|
|
496
520
|
});
|
|
497
521
|
} else {
|
|
498
|
-
|
|
522
|
+
if (customTargets.length) {
|
|
523
|
+
this.state.scrollTargets = customTargets;
|
|
524
|
+
customTargets.forEach((target2) => {
|
|
525
|
+
on(target2, "scroll", this.state.scrollUpdate);
|
|
526
|
+
});
|
|
527
|
+
} else {
|
|
528
|
+
on(target, "scroll", this.state.scrollUpdate);
|
|
529
|
+
}
|
|
499
530
|
}
|
|
500
531
|
}
|
|
501
532
|
}
|
|
502
533
|
_removeEventListeners() {
|
|
503
534
|
off(window, "resize", this.state.updateBoundFn);
|
|
504
535
|
if (this._options.boundariesElement !== "window" && this.state.scrollTarget) {
|
|
505
|
-
off(this.state.scrollTarget, "scroll", this.state.
|
|
536
|
+
off(this.state.scrollTarget, "scroll", this.state.scrollUpdate);
|
|
506
537
|
this.state.scrollTarget = null;
|
|
507
538
|
if (this._options.bubbling || PopupManager.globalScroll) {
|
|
508
539
|
let targets = this.state.scrollTargets || [];
|
|
509
540
|
targets.forEach((target) => {
|
|
510
|
-
off(target, "scroll", this.state.
|
|
541
|
+
off(target, "scroll", this.state.scrollUpdate);
|
|
511
542
|
});
|
|
512
543
|
this.state.scrollTargets = null;
|
|
513
544
|
}
|
|
514
545
|
}
|
|
515
546
|
this.state.updateBoundFn = null;
|
|
547
|
+
this.state.scrollUpdate = null;
|
|
516
548
|
}
|
|
517
549
|
/** 实时计算一下Boundary的位置 */
|
|
518
550
|
_getBoundaries(data, padding, boundariesElement) {
|
|
@@ -527,8 +559,9 @@ class Popper {
|
|
|
527
559
|
let scrollParent = getScrollParent(this._popper);
|
|
528
560
|
let offsetParentRect = getOffsetRect(offsetParent);
|
|
529
561
|
let isFixed2 = data.offsets.popper.position === "fixed";
|
|
530
|
-
|
|
531
|
-
let
|
|
562
|
+
const noScroll = isFixed2 || !this._options.appendToBody && ["right", "left"].includes(this._options.placement);
|
|
563
|
+
let scrollTop = noScroll ? 0 : getScrollTopValue(scrollParent);
|
|
564
|
+
let scrollLeft = noScroll ? 0 : getScrollLeftValue(scrollParent);
|
|
532
565
|
const viewportWindow = globalConfig.viewportWindow || PopupManager.viewportWindow || window;
|
|
533
566
|
boundaries = {
|
|
534
567
|
top: 0 - (offsetParentRect.top - scrollTop),
|
|
@@ -24,6 +24,8 @@ class Touch {
|
|
|
24
24
|
this.screenY = pos.screenY + deltaY;
|
|
25
25
|
this.clientX = pos.clientX + deltaX;
|
|
26
26
|
this.clientY = pos.clientY + deltaY;
|
|
27
|
+
this.offsetX = pos.offsetX + deltaX;
|
|
28
|
+
this.offsetY = pos.offsetY + deltaY;
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
const TouchList = () => {
|
|
@@ -69,7 +71,8 @@ const onMouse = (touchType) => (ev) => {
|
|
|
69
71
|
if (ev.type === "mousedown" || !mouseTarget) {
|
|
70
72
|
mouseTarget = ev.target;
|
|
71
73
|
}
|
|
72
|
-
|
|
74
|
+
eventTarget = closest(mouseTarget, "[data-tiny-touch-simulate-container]");
|
|
75
|
+
if (eventTarget && eventTarget.dispatchEvent) {
|
|
73
76
|
triggerTouch(touchType, ev);
|
|
74
77
|
}
|
|
75
78
|
if (ev.type === "mouseup") {
|