@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/flowchart/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../chunk-G2ADBYYC.js";
|
|
2
5
|
import debounce from "../common/deps/debounce";
|
|
3
6
|
import { omitText as omit } from "../common/string";
|
|
7
|
+
import { fastdom } from "../common/deps/fastdom";
|
|
4
8
|
const compute = ({ api, markRaw, props, state }) => () => {
|
|
5
9
|
const { data, config } = props;
|
|
6
10
|
const { nodes, links } = data;
|
|
@@ -170,14 +174,16 @@ const realDraw = ({ afterLink, afterNodes, config, ctx, state }) => {
|
|
|
170
174
|
} else if (Array.isArray(config.drawLink)) {
|
|
171
175
|
if (config.drawLink.length) {
|
|
172
176
|
for (let i = 0; i < config.drawLink.length; i++) {
|
|
173
|
-
|
|
177
|
+
drawn = hitMatch(config.drawLink[i], afterLink);
|
|
178
|
+
if (drawn) {
|
|
174
179
|
config.drawLink[i].method({ ctx, afterLink, afterNodes });
|
|
175
180
|
break;
|
|
176
181
|
}
|
|
177
182
|
}
|
|
178
183
|
}
|
|
179
184
|
} else if (config.drawLink && typeof config.drawLink.method === "function") {
|
|
180
|
-
|
|
185
|
+
drawn = hitMatch(config.drawLink, afterLink);
|
|
186
|
+
if (drawn) {
|
|
181
187
|
config.drawLink.method({ ctx, afterLink, afterNodes });
|
|
182
188
|
}
|
|
183
189
|
}
|
|
@@ -242,6 +248,7 @@ const refresh = ({ api, nextTick, state }) => ({ graphWidth = 0, adjustX = 0 } =
|
|
|
242
248
|
}
|
|
243
249
|
state.refreshKey++;
|
|
244
250
|
nextTick(() => {
|
|
251
|
+
api.antialiasing();
|
|
245
252
|
api.drawAfterLink();
|
|
246
253
|
api.addListeners();
|
|
247
254
|
state.temporary.emitter.emit("after-graph-refresh");
|
|
@@ -251,9 +258,9 @@ const getAllItem = (props) => (nodes) => {
|
|
|
251
258
|
const allItem = {};
|
|
252
259
|
const { config } = props;
|
|
253
260
|
const { headUrl } = config;
|
|
254
|
-
nodes.
|
|
261
|
+
nodes.forEach(({ info: { items } }) => {
|
|
255
262
|
if (Array.isArray(items) && items.length) {
|
|
256
|
-
items.
|
|
263
|
+
items.forEach(({ key }) => {
|
|
257
264
|
allItem[key] = (headUrl || "").replace("{0}", String(key));
|
|
258
265
|
});
|
|
259
266
|
}
|
|
@@ -272,7 +279,7 @@ const getVars = () => (afterNode, config) => {
|
|
|
272
279
|
const isFailFn = () => statusFn() === config.statusFail;
|
|
273
280
|
const half = (qty) => qty >>> 1;
|
|
274
281
|
const white = "#fff";
|
|
275
|
-
let
|
|
282
|
+
let background, borderColor, statusName;
|
|
276
283
|
background = borderColor = config.colors[statusFn()];
|
|
277
284
|
statusName = config.status[statusFn()];
|
|
278
285
|
isCompleteFn() && (background = white);
|
|
@@ -327,10 +334,10 @@ const buildLinkHoverState = ({ afterLinks, hoverMap, hoverList, config }) => {
|
|
|
327
334
|
hoverMap.set(tri2, afterLink);
|
|
328
335
|
}
|
|
329
336
|
};
|
|
330
|
-
afterLinks.
|
|
337
|
+
afterLinks.forEach((afterLink) => {
|
|
331
338
|
const { p } = afterLink;
|
|
332
339
|
let cur, next;
|
|
333
|
-
p.
|
|
340
|
+
p.forEach((p2) => {
|
|
334
341
|
const parts = p2.split(",");
|
|
335
342
|
if (parts[0] === "m") {
|
|
336
343
|
cur = parts.slice(1).map(Number);
|
|
@@ -397,7 +404,8 @@ const setListeners = ({ api, emit, props, state, vm }) => () => {
|
|
|
397
404
|
api.clearDropdown();
|
|
398
405
|
});
|
|
399
406
|
};
|
|
400
|
-
const pointInTriangle = (
|
|
407
|
+
const pointInTriangle = (points, px, py) => {
|
|
408
|
+
const [x0, y0, x1, y1, x2, y2] = points;
|
|
401
409
|
const v0 = [x2 - x0, y2 - y0];
|
|
402
410
|
const v1 = [x1 - x0, y1 - y0];
|
|
403
411
|
const v2 = [px - x0, py - y0];
|
|
@@ -422,10 +430,10 @@ const hitTest = ({ api, state, vm }) => (x, y) => {
|
|
|
422
430
|
const { afterData } = state;
|
|
423
431
|
const { hoverState } = afterData;
|
|
424
432
|
const { hoverMap, hoverList, groupHoverMap, groupHoverList } = hoverState;
|
|
425
|
-
let tri = hoverList.find((item) => pointInTriangle(
|
|
433
|
+
let tri = hoverList.find((item) => pointInTriangle(item, x, y));
|
|
426
434
|
state.hoverAfterLink = tri ? hoverMap.get(tri) : null;
|
|
427
435
|
if (!tri) {
|
|
428
|
-
tri = groupHoverList.find((item) => pointInTriangle(
|
|
436
|
+
tri = groupHoverList.find((item) => pointInTriangle(item, x, y));
|
|
429
437
|
state.hoverAfterGroup = tri ? groupHoverMap.get(tri) : null;
|
|
430
438
|
}
|
|
431
439
|
if (hoverAfterLink !== state.hoverAfterLink || hoverAfterGroup !== state.hoverAfterGroup) {
|
|
@@ -453,7 +461,7 @@ const clickNode = ({ api, emit }) => (params, e) => {
|
|
|
453
461
|
};
|
|
454
462
|
const clearDropdown = (state) => (nodeName) => {
|
|
455
463
|
const { dropdowns } = state;
|
|
456
|
-
Object.keys(dropdowns).
|
|
464
|
+
Object.keys(dropdowns).forEach((item) => {
|
|
457
465
|
if (dropdowns[item] && (nodeName && item !== nodeName || !nodeName)) {
|
|
458
466
|
dropdowns[item] = false;
|
|
459
467
|
}
|
|
@@ -466,10 +474,10 @@ const computeMf = ({ api, markRaw, props, state }) => () => {
|
|
|
466
474
|
const getCol = buildGetCol({ afterConfig, api });
|
|
467
475
|
const rectRow = buildRectRow({ afterConfig, getRow });
|
|
468
476
|
const rectNode = buildRectNode({ afterConfig, api, getRow, rectRow });
|
|
469
|
-
|
|
470
|
-
const { afterGroups, afterNodes, graph } = buildAfterNodeGraph(
|
|
471
|
-
|
|
472
|
-
const { afterLinks, arrows } = buildAfterLinkArrow(
|
|
477
|
+
const buildAfterNodeGraphArgs = { afterConfig, api, getCol, getRow, groups, nodes, rectNode, state };
|
|
478
|
+
const { afterGroups, afterNodes, graph } = buildAfterNodeGraph(buildAfterNodeGraphArgs);
|
|
479
|
+
const buildAfterLinkArrowArgs = { afterConfig, afterNodes, graph, links };
|
|
480
|
+
const { afterLinks, arrows } = buildAfterLinkArrow(buildAfterLinkArrowArgs);
|
|
473
481
|
const hoverState = api.buildHoverState({ afterGroups, afterLinks });
|
|
474
482
|
state.afterData = markRaw({ afterConfig, afterGroups, afterLinks, afterNodes, arrows, graph, hoverState });
|
|
475
483
|
state.wrapperStyle = { width: `${graph.width}px`, height: `${graph.height}px` };
|
|
@@ -571,7 +579,7 @@ const normalRowCol = ({ afterConfig, nodes }) => {
|
|
|
571
579
|
rows = [...rows].sort((a, b) => a - b);
|
|
572
580
|
rows.forEach((row, i) => rowMap.set(row, autoAdjustPos ? i : row));
|
|
573
581
|
const afterNodes = nodes.map((node) => {
|
|
574
|
-
return { type: "node", row: rowMap.get(node.info.row), col: 0, raw: node };
|
|
582
|
+
return { type: "node", row: rowMap.get(node.info.row), col: 0, raw: node, lastCol: false, lastRow: false };
|
|
575
583
|
});
|
|
576
584
|
rows.forEach((r, row) => {
|
|
577
585
|
const rowAfterNodes = afterNodes.filter((afterNode) => afterNode.row === row);
|
|
@@ -588,14 +596,23 @@ const defaultLayout = ({ afterConfig, afterNodes, getCol, getRow, graph, maxCol,
|
|
|
588
596
|
const { height, padding, width } = afterConfig;
|
|
589
597
|
let tmp;
|
|
590
598
|
for (let i = 0; i <= maxRow; i++) {
|
|
591
|
-
|
|
599
|
+
tmp = getRow(afterNodes, i, "width");
|
|
600
|
+
if (tmp > graph.width)
|
|
592
601
|
graph.width = tmp;
|
|
593
602
|
}
|
|
594
603
|
for (let i = 0; i <= maxCol; i++) {
|
|
595
|
-
|
|
604
|
+
tmp = getCol(afterNodes, i, "height");
|
|
605
|
+
if (tmp > graph.height)
|
|
596
606
|
graph.height = tmp;
|
|
597
607
|
}
|
|
598
|
-
afterNodes.forEach((afterNode) =>
|
|
608
|
+
afterNodes.forEach((afterNode) => {
|
|
609
|
+
Object.assign(afterNode, rectNode(afterNode, afterNodes, graph));
|
|
610
|
+
afterNode.lastCol = afterNode.lastRow = false;
|
|
611
|
+
if (afterNode.col === maxCol)
|
|
612
|
+
afterNode.lastCol = true;
|
|
613
|
+
if (afterNode.row === maxRow)
|
|
614
|
+
afterNode.lastRow = true;
|
|
615
|
+
});
|
|
599
616
|
if (padding > 0) {
|
|
600
617
|
tmp = 2 * padding;
|
|
601
618
|
graph.width += tmp;
|
|
@@ -623,6 +640,7 @@ const dotModeAdjust = ({ afterConfig, afterNodes, graph, maxCol, state }) => {
|
|
|
623
640
|
const colSize = (graph.width - 2 * padding) / (maxCol + 1);
|
|
624
641
|
afterNodes.forEach((afterNode) => {
|
|
625
642
|
afterNode.x = ~~((afterNode.col + 0.5) * colSize + padding) + state.temporary.adjustX;
|
|
643
|
+
afterNode.y += state.temporary.adjustY;
|
|
626
644
|
});
|
|
627
645
|
}
|
|
628
646
|
};
|
|
@@ -646,10 +664,12 @@ const calcGraphMinSize = ({ afterConfig, afterNodes, api, graph, maxCol, maxRow
|
|
|
646
664
|
const maxNodeSize = { width: 0, height: 0 };
|
|
647
665
|
let tempSize;
|
|
648
666
|
afterNodes.forEach((afterNode) => {
|
|
649
|
-
|
|
667
|
+
tempSize = api.getNode(afterNode.raw, "width");
|
|
668
|
+
if (tempSize > maxNodeSize.width) {
|
|
650
669
|
maxNodeSize.width = tempSize;
|
|
651
670
|
}
|
|
652
|
-
|
|
671
|
+
tempSize = api.getNode(afterNode.raw, "height");
|
|
672
|
+
if (tempSize > maxNodeSize.height) {
|
|
653
673
|
maxNodeSize.height = tempSize;
|
|
654
674
|
}
|
|
655
675
|
});
|
|
@@ -818,13 +838,41 @@ const validLinkPath = (res) => {
|
|
|
818
838
|
}
|
|
819
839
|
return { points, midpoint, middir, linear, flag };
|
|
820
840
|
};
|
|
841
|
+
const getFromToRect = ({ afterLink, afterNodes }) => {
|
|
842
|
+
const afterNodeCouple = [afterLink.raw.from, afterLink.raw.to].map(
|
|
843
|
+
(name) => afterNodes.find((afterNode) => afterNode.raw.name === name)
|
|
844
|
+
);
|
|
845
|
+
const { x: x0, y: y0, width: w0, height: h0 } = afterNodeCouple[0];
|
|
846
|
+
const { x: x1, y: y1, width: w1, height: h1 } = afterNodeCouple[1];
|
|
847
|
+
return {
|
|
848
|
+
from: { x: x0, y: y0, width: w0, height: h0 },
|
|
849
|
+
to: { x: x1, y: y1, width: w1, height: h1 }
|
|
850
|
+
};
|
|
851
|
+
};
|
|
852
|
+
const linkPathApis = {
|
|
853
|
+
getTop: (rect) => ({ x: rect.x + rect.width / 2, y: rect.y }),
|
|
854
|
+
getRight: (rect) => ({ x: rect.x + rect.width, y: rect.y + rect.height / 2 }),
|
|
855
|
+
getBottom: (rect) => ({
|
|
856
|
+
x: rect.x + rect.width / 2,
|
|
857
|
+
y: rect.y + rect.height
|
|
858
|
+
}),
|
|
859
|
+
getLeft: (rect) => ({ x: rect.x, y: rect.y + rect.height / 2 })
|
|
860
|
+
};
|
|
821
861
|
const customRoute = ({ adjust, afterConfig, afterLink, afterNodes, arrow }) => {
|
|
822
862
|
const { linkPath, radius } = afterConfig;
|
|
823
863
|
let valid = false;
|
|
824
864
|
if (Array.isArray(linkPath)) {
|
|
825
865
|
for (let i = 0; i < linkPath.length; i++) {
|
|
826
866
|
if (hitMatch(linkPath[i], afterLink)) {
|
|
827
|
-
const
|
|
867
|
+
const fromToRect = getFromToRect({ afterLink, afterNodes });
|
|
868
|
+
const { points, midpoint, middir, linear, flag } = validLinkPath(
|
|
869
|
+
linkPath[i].method(__spreadProps(__spreadValues({
|
|
870
|
+
afterLink,
|
|
871
|
+
afterNodes
|
|
872
|
+
}, fromToRect), {
|
|
873
|
+
api: linkPathApis
|
|
874
|
+
}))
|
|
875
|
+
);
|
|
828
876
|
if (flag) {
|
|
829
877
|
valid = true;
|
|
830
878
|
pathParser({ adjust, afterLink, arrow, linear, midpoint, middir, points, radius });
|
|
@@ -834,7 +882,15 @@ const customRoute = ({ adjust, afterConfig, afterLink, afterNodes, arrow }) => {
|
|
|
834
882
|
}
|
|
835
883
|
} else if (linkPath && typeof linkPath.method === "function") {
|
|
836
884
|
if (hitMatch(linkPath, afterLink)) {
|
|
837
|
-
const
|
|
885
|
+
const fromToRect = getFromToRect({ afterLink, afterNodes });
|
|
886
|
+
const { points, midpoint, middir, linear, flag } = validLinkPath(
|
|
887
|
+
linkPath.method(__spreadProps(__spreadValues({
|
|
888
|
+
afterLink,
|
|
889
|
+
afterNodes
|
|
890
|
+
}, fromToRect), {
|
|
891
|
+
api: linkPathApis
|
|
892
|
+
}))
|
|
893
|
+
);
|
|
838
894
|
if (flag) {
|
|
839
895
|
valid = true;
|
|
840
896
|
pathParser({ adjust, afterLink, arrow, linear, midpoint, middir, points, radius });
|
|
@@ -1113,6 +1169,55 @@ const handleNodeResize = ({ state, vm }) => () => {
|
|
|
1113
1169
|
state.nodeWidth = vm.$refs.title.offsetWidth + paddingLeft + padding;
|
|
1114
1170
|
}
|
|
1115
1171
|
};
|
|
1172
|
+
const runAdjustYTask = ({ api, state }) => () => {
|
|
1173
|
+
if (state.temporary.adjustYTask) {
|
|
1174
|
+
fastdom.clear(state.temporary.adjustYTask);
|
|
1175
|
+
state.temporary.adjustYTask = null;
|
|
1176
|
+
}
|
|
1177
|
+
state.temporary.adjustYTask = fastdom.measure(() => {
|
|
1178
|
+
state.temporary.adjustYTask = null;
|
|
1179
|
+
api.refresh();
|
|
1180
|
+
});
|
|
1181
|
+
};
|
|
1182
|
+
const setAdjustY = ({ api, state }) => (param) => {
|
|
1183
|
+
let { lastRowAfterNodes, adjustY } = state.temporary;
|
|
1184
|
+
if (!lastRowAfterNodes.length) {
|
|
1185
|
+
lastRowAfterNodes = state.temporary.lastRowAfterNodes = state.afterData.afterNodes.filter(
|
|
1186
|
+
(afterNode) => afterNode.lastRow
|
|
1187
|
+
);
|
|
1188
|
+
}
|
|
1189
|
+
const lastRowNodeNames = lastRowAfterNodes.map((afterNode) => afterNode.raw.name);
|
|
1190
|
+
if (Array.isArray(lastRowNodeNames) && lastRowNodeNames.includes(param.node) && param.value < adjustY) {
|
|
1191
|
+
state.temporary.adjustY = param.value;
|
|
1192
|
+
api.runAdjustYTask();
|
|
1193
|
+
}
|
|
1194
|
+
};
|
|
1195
|
+
const setNodeAdjustY = ({ vm, state }) => () => {
|
|
1196
|
+
const elRect = vm.$el.getBoundingClientRect();
|
|
1197
|
+
const titleRect = vm.$refs.title.getBoundingClientRect();
|
|
1198
|
+
if (state.layUpdown) {
|
|
1199
|
+
state.temporary.graphInstance.setAdjustY({ node: state.nodeName, value: -titleRect.height / 2 });
|
|
1200
|
+
} else {
|
|
1201
|
+
state.temporary.graphInstance.setAdjustY({
|
|
1202
|
+
node: state.nodeName,
|
|
1203
|
+
value: titleRect.height > elRect.height ? (elRect.height - titleRect.height) / 2 : 0
|
|
1204
|
+
});
|
|
1205
|
+
}
|
|
1206
|
+
};
|
|
1207
|
+
const computedIcon = ({ state, icons }) => () => {
|
|
1208
|
+
let svg, size;
|
|
1209
|
+
if (state.isSmall) {
|
|
1210
|
+
svg = icons[state.nodeStatus].other;
|
|
1211
|
+
size = "small";
|
|
1212
|
+
} else if (state.sizeMini) {
|
|
1213
|
+
svg = icons[state.nodeStatus].mini;
|
|
1214
|
+
size = "mini";
|
|
1215
|
+
} else {
|
|
1216
|
+
svg = icons[state.nodeStatus].other;
|
|
1217
|
+
size = state.nodeSize;
|
|
1218
|
+
}
|
|
1219
|
+
return { svg, size };
|
|
1220
|
+
};
|
|
1116
1221
|
export {
|
|
1117
1222
|
addListeners,
|
|
1118
1223
|
antialiasing,
|
|
@@ -1125,6 +1230,7 @@ export {
|
|
|
1125
1230
|
clickNode,
|
|
1126
1231
|
compute,
|
|
1127
1232
|
computeMf,
|
|
1233
|
+
computedIcon,
|
|
1128
1234
|
drawAfterLink,
|
|
1129
1235
|
getAllItem,
|
|
1130
1236
|
getNode,
|
|
@@ -1138,5 +1244,8 @@ export {
|
|
|
1138
1244
|
omitText,
|
|
1139
1245
|
refresh,
|
|
1140
1246
|
removeListeners,
|
|
1141
|
-
|
|
1247
|
+
runAdjustYTask,
|
|
1248
|
+
setAdjustY,
|
|
1249
|
+
setListeners,
|
|
1250
|
+
setNodeAdjustY
|
|
1142
1251
|
};
|
package/flowchart/node.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import { handleNodeResize } from "./index";
|
|
2
|
+
import { handleNodeResize, setNodeAdjustY, computedIcon } from "./index";
|
|
3
3
|
const api = ["state"];
|
|
4
|
-
const renderless = (props, { reactive, computed, inject, onBeforeUnmount }, { vm }) => {
|
|
4
|
+
const renderless = (props, { reactive, computed, inject, onMounted, onBeforeUnmount }, { vm }, { icons }) => {
|
|
5
5
|
const { node, config } = props;
|
|
6
6
|
const state = reactive({
|
|
7
|
+
icon: computed(() => api2.computedIcon()),
|
|
7
8
|
nodeName: node.name,
|
|
8
9
|
nodeLayout: computed(() => node.layout || config.nodeLayout || "up-down"),
|
|
9
10
|
nodeSize: computed(() => config.nodeSize || "small"),
|
|
@@ -35,12 +36,20 @@ const renderless = (props, { reactive, computed, inject, onBeforeUnmount }, { vm
|
|
|
35
36
|
statFail: computed(() => state.nodeStatus === "fail"),
|
|
36
37
|
statNotStarted: computed(() => state.nodeStatus === "not-started")
|
|
37
38
|
});
|
|
38
|
-
state.temporary = {
|
|
39
|
+
state.temporary = {
|
|
40
|
+
padding: 8,
|
|
41
|
+
height: 24,
|
|
42
|
+
graphEmitter: inject("graphEmitter"),
|
|
43
|
+
graphInstance: inject("graphInstance")
|
|
44
|
+
};
|
|
39
45
|
const api2 = {
|
|
40
46
|
state,
|
|
41
|
-
handleNodeResize: handleNodeResize({ state, vm })
|
|
47
|
+
handleNodeResize: handleNodeResize({ state, vm }),
|
|
48
|
+
setNodeAdjustY: setNodeAdjustY({ vm, state }),
|
|
49
|
+
computedIcon: computedIcon({ state, icons })
|
|
42
50
|
};
|
|
43
51
|
state.temporary.graphEmitter.on("after-graph-refresh", api2.handleNodeResize);
|
|
52
|
+
onMounted(() => api2.setNodeAdjustY());
|
|
44
53
|
onBeforeUnmount(() => {
|
|
45
54
|
state.temporary.graphEmitter.off("after-graph-refresh", api2.handleNodeResize);
|
|
46
55
|
});
|
package/flowchart/vue.js
CHANGED
|
@@ -23,7 +23,9 @@ import {
|
|
|
23
23
|
antialiasing,
|
|
24
24
|
getNodeDef,
|
|
25
25
|
getNode,
|
|
26
|
-
clickGroup
|
|
26
|
+
clickGroup,
|
|
27
|
+
setAdjustY,
|
|
28
|
+
runAdjustYTask
|
|
27
29
|
} from "./index";
|
|
28
30
|
import throttle from "../common/deps/throttle";
|
|
29
31
|
const api = [
|
|
@@ -43,8 +45,14 @@ const renderless = (props, { reactive, markRaw, onMounted, onBeforeUnmount, prov
|
|
|
43
45
|
wrapperStyle: "",
|
|
44
46
|
dropdowns: {}
|
|
45
47
|
});
|
|
46
|
-
state.temporary = {
|
|
47
|
-
|
|
48
|
+
state.temporary = {
|
|
49
|
+
graphWidth: 0,
|
|
50
|
+
adjustX: 0,
|
|
51
|
+
emitter: emitter(),
|
|
52
|
+
customLinks: [],
|
|
53
|
+
lastRowAfterNodes: [],
|
|
54
|
+
adjustY: 0
|
|
55
|
+
};
|
|
48
56
|
const api2 = {
|
|
49
57
|
state,
|
|
50
58
|
omitText,
|
|
@@ -72,8 +80,12 @@ const renderless = (props, { reactive, markRaw, onMounted, onBeforeUnmount, prov
|
|
|
72
80
|
hitTest: hitTest({ api: api2, state, vm }),
|
|
73
81
|
clearHoverAfterLink: throttle(10, clearHoverAfterLink({ api: api2, state, vm })),
|
|
74
82
|
clickNode: clickNode({ api: api2, emit }),
|
|
75
|
-
getNode: getNode(api2)
|
|
83
|
+
getNode: getNode(api2),
|
|
84
|
+
setAdjustY: setAdjustY({ api: api2, state }),
|
|
85
|
+
runAdjustYTask: runAdjustYTask({ api: api2, state })
|
|
76
86
|
});
|
|
87
|
+
provide("graphEmitter", state.temporary.emitter);
|
|
88
|
+
provide("graphInstance", { setAdjustY: api2.setAdjustY });
|
|
77
89
|
if (api2.isMf()) {
|
|
78
90
|
api2.computeMf();
|
|
79
91
|
} else {
|
package/form/vue.js
CHANGED
|
@@ -60,6 +60,14 @@ const renderless = (props, { computed, inject, provide, reactive, watch, onBefor
|
|
|
60
60
|
} else {
|
|
61
61
|
return false;
|
|
62
62
|
}
|
|
63
|
+
}),
|
|
64
|
+
labelWidth: computed(() => {
|
|
65
|
+
var _a;
|
|
66
|
+
return props.labelWidth || ((_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.labelWidth) || "80px";
|
|
67
|
+
}),
|
|
68
|
+
tooltipType: computed(() => {
|
|
69
|
+
var _a;
|
|
70
|
+
return ((_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.tooltipType) || "normal";
|
|
63
71
|
})
|
|
64
72
|
});
|
|
65
73
|
Object.assign(api2, {
|
package/form-item/index.js
CHANGED
|
@@ -42,7 +42,7 @@ const computedLabelStyle = ({ props, state }) => () => {
|
|
|
42
42
|
if (state.form.labelPosition === POSITION.Top) {
|
|
43
43
|
return result;
|
|
44
44
|
}
|
|
45
|
-
const labelWidth = props.labelWidth || state.form.labelWidth;
|
|
45
|
+
const labelWidth = props.labelWidth || state.form.state.labelWidth;
|
|
46
46
|
if (labelWidth) {
|
|
47
47
|
result.width = labelWidth;
|
|
48
48
|
}
|
|
@@ -54,7 +54,7 @@ const computedValueStyle = ({ props, state }) => () => {
|
|
|
54
54
|
result.width = "100%";
|
|
55
55
|
return result;
|
|
56
56
|
}
|
|
57
|
-
const labelWidth = props.labelWidth || state.form.labelWidth;
|
|
57
|
+
const labelWidth = props.labelWidth || state.form.state.labelWidth;
|
|
58
58
|
if (labelWidth) {
|
|
59
59
|
if (labelWidth === "auto") {
|
|
60
60
|
result.width = labelWidth;
|
|
@@ -73,11 +73,11 @@ const computedContentStyle = ({ props, state }) => () => {
|
|
|
73
73
|
if (!label && !props.labelWidth && state.isNested) {
|
|
74
74
|
return result;
|
|
75
75
|
}
|
|
76
|
-
const labelWidth = props.labelWidth || state.form.labelWidth;
|
|
76
|
+
const labelWidth = props.labelWidth || state.form.state.labelWidth;
|
|
77
77
|
if (labelWidth === "auto") {
|
|
78
78
|
if (props.labelWidth === "auto") {
|
|
79
79
|
result.marginLeft = state.computedLabelWidth;
|
|
80
|
-
} else if (state.form.labelWidth === "auto") {
|
|
80
|
+
} else if (state.form.state.labelWidth === "auto") {
|
|
81
81
|
result.marginLeft = state.formInstance.state.autoLabelWidth;
|
|
82
82
|
}
|
|
83
83
|
} else {
|
|
@@ -235,7 +235,7 @@ const resetField = ({ api, nextTick, props, state }) => () => {
|
|
|
235
235
|
const getRules = ({ props, state }) => () => {
|
|
236
236
|
let formRules = state.form.rules || {};
|
|
237
237
|
const selfRules = props.rules;
|
|
238
|
-
const requiredRule = props.required !== void 0 ? { required:
|
|
238
|
+
const requiredRule = props.required !== void 0 ? { required: Boolean(props.required) } : [];
|
|
239
239
|
const prop = getPropByPath(formRules, props.prop || "");
|
|
240
240
|
formRules = formRules ? prop.o[props.prop || ""] || prop.v : [];
|
|
241
241
|
return [].concat(selfRules || formRules || []).concat(requiredRule);
|
package/form-item/vue.js
CHANGED
|
@@ -97,7 +97,9 @@ const initState = ({
|
|
|
97
97
|
getValidateType: computed(() => api2.computedGetValidateType()),
|
|
98
98
|
validateIcon: computed(() => api2.computedValidateIcon()),
|
|
99
99
|
isErrorInline: computed(() => api2.computedIsErrorInline()),
|
|
100
|
-
isErrorBlock: computed(() => api2.computedIsErrorBlock())
|
|
100
|
+
isErrorBlock: computed(() => api2.computedIsErrorBlock()),
|
|
101
|
+
disabled: computed(() => state.formInstance.disabled),
|
|
102
|
+
tooltipType: computed(() => state.formInstance.state.tooltipType)
|
|
101
103
|
});
|
|
102
104
|
return state;
|
|
103
105
|
};
|
package/fullscreen/index.js
CHANGED
|
@@ -15,7 +15,7 @@ const request = ({ props, state, vm, sf, api }) => () => {
|
|
|
15
15
|
const change = () => {
|
|
16
16
|
if (state.isPageOnly) {
|
|
17
17
|
state.isFullscreen = true;
|
|
18
|
-
api.
|
|
18
|
+
api.onChangeFullScreen();
|
|
19
19
|
off(document, "keyup", api.keypressCallback);
|
|
20
20
|
on(document, "keyup", api.keypressCallback);
|
|
21
21
|
} else {
|
|
@@ -42,7 +42,7 @@ const exit = ({ state, api, sf, props }) => () => {
|
|
|
42
42
|
}
|
|
43
43
|
if (state.isPageOnly) {
|
|
44
44
|
state.isFullscreen = false;
|
|
45
|
-
api.
|
|
45
|
+
api.onChangeFullScreen();
|
|
46
46
|
off(document, "keyup", api.keypressCallback);
|
|
47
47
|
} else {
|
|
48
48
|
sf.exit();
|
|
@@ -62,14 +62,14 @@ const fullScreenCallback = ({ state, sf, api }) => () => {
|
|
|
62
62
|
sf.off("change", api.fullScreenCallback);
|
|
63
63
|
}
|
|
64
64
|
state.isFullscreen = sf.isFullscreen;
|
|
65
|
-
api.
|
|
65
|
+
api.onChangeFullScreen();
|
|
66
66
|
};
|
|
67
67
|
const keypressCallback = (api) => (e) => {
|
|
68
68
|
if (e.key === "Escape") {
|
|
69
69
|
api.exit();
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
|
-
const
|
|
72
|
+
const onChangeFullScreen = ({ props, state, vm, emit }) => () => {
|
|
73
73
|
if (!state.isFullscreen) {
|
|
74
74
|
if (props.teleport && state.__parentNode) {
|
|
75
75
|
state.__parentNode.insertBefore(vm.$el, state.__token);
|
|
@@ -106,7 +106,7 @@ export {
|
|
|
106
106
|
fullScreenCallback,
|
|
107
107
|
getState,
|
|
108
108
|
keypressCallback,
|
|
109
|
-
|
|
109
|
+
onChangeFullScreen,
|
|
110
110
|
request,
|
|
111
111
|
shadeClick,
|
|
112
112
|
toggle
|
package/fullscreen/vue.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
shadeClick,
|
|
10
10
|
keypressCallback,
|
|
11
11
|
fullScreenCallback,
|
|
12
|
-
|
|
12
|
+
onChangeFullScreen,
|
|
13
13
|
computeWrapperStyle
|
|
14
14
|
} from "./index";
|
|
15
15
|
const api = [
|
|
@@ -22,7 +22,7 @@ const api = [
|
|
|
22
22
|
"shadeClick",
|
|
23
23
|
"keypressCallback",
|
|
24
24
|
"fullScreenCallback",
|
|
25
|
-
"
|
|
25
|
+
"onChangeFullScreen"
|
|
26
26
|
];
|
|
27
27
|
const renderless = (props, { reactive, computed, watch }, { vm, emit }) => {
|
|
28
28
|
const api2 = {};
|
|
@@ -45,7 +45,7 @@ const renderless = (props, { reactive, computed, watch }, { vm, emit }) => {
|
|
|
45
45
|
request: request({ props, state, vm, sf, api: api2 }),
|
|
46
46
|
fullScreenCallback: fullScreenCallback({ state, sf, api: api2 }),
|
|
47
47
|
computeWrapperStyle: computeWrapperStyle({ props, state }),
|
|
48
|
-
|
|
48
|
+
onChangeFullScreen: onChangeFullScreen({ props, state, vm, emit })
|
|
49
49
|
});
|
|
50
50
|
watch(
|
|
51
51
|
() => props.fullscreen,
|
package/grid/plugins/export.js
CHANGED
|
@@ -37,11 +37,14 @@ const getCsvContent = ($table, opts, oColumns, oData) => {
|
|
|
37
37
|
const tableEl = $table.$el;
|
|
38
38
|
const tab = opts.useTabs === false ? "" : " ";
|
|
39
39
|
const { columns, datas } = getCsvData(opts, oData, oColumns, tableEl);
|
|
40
|
-
let content =
|
|
40
|
+
let content = "\uFEFF";
|
|
41
41
|
const transfrom = (str) => {
|
|
42
42
|
if (typeof str === "string" && str.replace(/ /g, "").match(/[\s,"]/)) {
|
|
43
43
|
str = '"' + str.replace(/"/g, '""') + '"';
|
|
44
44
|
}
|
|
45
|
+
if (typeof str === "string" && str.match(/^([@=]|([-\\+].*[^0-9\\.])).*$/)) {
|
|
46
|
+
str = " " + str;
|
|
47
|
+
}
|
|
45
48
|
return str + tab;
|
|
46
49
|
};
|
|
47
50
|
if (opts.isHeader) {
|
|
@@ -71,7 +74,7 @@ const getCsvContent = ($table, opts, oColumns, oData) => {
|
|
|
71
74
|
};
|
|
72
75
|
const getCsvUrl = (opts, content) => {
|
|
73
76
|
if (window.Blob && window.URL && window.URL.createObjectURL && browser.name !== "safari") {
|
|
74
|
-
return URL.createObjectURL(new Blob([content], { type: "text/csv" }));
|
|
77
|
+
return URL.createObjectURL(new Blob([content], { type: "text/csv;charset=utf-8" }));
|
|
75
78
|
}
|
|
76
79
|
return `data:attachment/csv;charset=utf-8,${encodeURIComponent(content)}`;
|
|
77
80
|
};
|
package/grid/utils/column.js
CHANGED
|
@@ -41,6 +41,7 @@ function setBasicProperty(column, context) {
|
|
|
41
41
|
column.renderer = context.renderer;
|
|
42
42
|
column.editor = context.editor;
|
|
43
43
|
column.operationConfig = context.operationConfig;
|
|
44
|
+
column.equals = context.equals;
|
|
44
45
|
}
|
|
45
46
|
function ColumnConfig(context, { renderHeader, renderCell, renderData } = {}, config = {}) {
|
|
46
47
|
setBasicProperty(this, context);
|
package/grid/utils/dom.js
CHANGED
|
@@ -96,11 +96,16 @@ const colToVisible = ($table, column, move) => {
|
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
98
|
};
|
|
99
|
+
const hasDataTag = (el, value) => {
|
|
100
|
+
if (!el || !value)
|
|
101
|
+
return false;
|
|
102
|
+
return (" " + el.getAttribute("data-tag") + " ").includes(" " + value + " ");
|
|
103
|
+
};
|
|
99
104
|
const getEventTargetNode = (event, container, queryCls) => {
|
|
100
105
|
let targetEl;
|
|
101
106
|
let target = getActualTarget(event);
|
|
102
107
|
while (target && target.nodeType && target !== document) {
|
|
103
|
-
if (queryCls && hasClass(target, queryCls)) {
|
|
108
|
+
if (queryCls && (hasClass(target, queryCls) || hasDataTag(target, queryCls))) {
|
|
104
109
|
targetEl = target;
|
|
105
110
|
} else if (target === container) {
|
|
106
111
|
return {
|
|
@@ -188,6 +193,7 @@ export {
|
|
|
188
193
|
getEventTargetNode,
|
|
189
194
|
getOffsetPos,
|
|
190
195
|
getRowNodes,
|
|
196
|
+
hasDataTag,
|
|
191
197
|
isPx,
|
|
192
198
|
isScale,
|
|
193
199
|
rowToVisible,
|
package/image/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import { on, off, getScrollContainer, isInContainer } from "../common/deps/dom";
|
|
3
3
|
import { typeOf } from "../common/type";
|
|
4
|
-
import "../common/deps/requestAnimationFrame";
|
|
5
4
|
import { rafThrottle } from "../image-viewer";
|
|
5
|
+
import { xss } from "../common/xss";
|
|
6
6
|
const isSupportObjectFit = () => document.documentElement.style.objectFit !== void 0;
|
|
7
7
|
const isHtmlElement = (node) => node && node.nodeType === Node.ELEMENT_NODE;
|
|
8
8
|
const computedGetImageStyle = ({ props, api }) => () => {
|
|
@@ -108,6 +108,10 @@ const mounted = ({ props, api }) => () => {
|
|
|
108
108
|
api.loadImage();
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
|
+
const filterImageUrl = (props) => () => {
|
|
112
|
+
const isBase64 = /^data:image\/(png|jpg|jpeg|gif);base64,([a-zA-Z0-9+/]+={0,2})/;
|
|
113
|
+
return isBase64.test(props.src) ? props.src : xss.filterUrl(props.src);
|
|
114
|
+
};
|
|
111
115
|
export {
|
|
112
116
|
addLazyLoadListener,
|
|
113
117
|
clickHandler,
|
|
@@ -116,6 +120,7 @@ export {
|
|
|
116
120
|
computedGetImageStyle,
|
|
117
121
|
computedGetPreview,
|
|
118
122
|
deleteHander,
|
|
123
|
+
filterImageUrl,
|
|
119
124
|
getImageStyle,
|
|
120
125
|
handleError,
|
|
121
126
|
handleLazyLoad,
|
package/image/vue.js
CHANGED
|
@@ -13,7 +13,8 @@ import {
|
|
|
13
13
|
clickHandler,
|
|
14
14
|
closeViewer,
|
|
15
15
|
mounted,
|
|
16
|
-
deleteHander
|
|
16
|
+
deleteHander,
|
|
17
|
+
filterImageUrl
|
|
17
18
|
} from "./index";
|
|
18
19
|
const api = [
|
|
19
20
|
"state",
|
|
@@ -46,7 +47,8 @@ const initState = ({
|
|
|
46
47
|
showViewer: false,
|
|
47
48
|
getPreview: computed(() => api2.computedGetPreview()),
|
|
48
49
|
getImageStyle: computed(() => api2.computedGetImageStyle()),
|
|
49
|
-
getAlignCenter: computed(() => api2.computedGetAlignCenter())
|
|
50
|
+
getAlignCenter: computed(() => api2.computedGetAlignCenter()),
|
|
51
|
+
src: computed(() => api2.filterImageUrl())
|
|
50
52
|
});
|
|
51
53
|
return state;
|
|
52
54
|
};
|
|
@@ -75,7 +77,8 @@ const initApi = ({
|
|
|
75
77
|
loadImage: loadImage({ api: api2, state, props, attrs }),
|
|
76
78
|
computedGetImageStyle: computedGetImageStyle({ api: api2, props }),
|
|
77
79
|
addLazyLoadListener: addLazyLoadListener({ api: api2, props, state, vm }),
|
|
78
|
-
deleteHander: deleteHander(emit)
|
|
80
|
+
deleteHander: deleteHander(emit),
|
|
81
|
+
filterImageUrl: filterImageUrl(props)
|
|
79
82
|
});
|
|
80
83
|
};
|
|
81
84
|
const initWatch = ({ watch, state, api: api2, props }) => {
|