@ibiz-template/vue3-components 0.7.40 → 0.7.41-alpha.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/dist/{index-8ZkS4CI0.js → index-4CBJktLS.js} +1 -1
- package/dist/{index-WNFQFxQd.js → index-QL7Ukex9.js} +1 -1
- package/dist/index-eIKUlAq_.js +4 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{map-chart-user-bTKfT7VH.js → map-chart-user-xOSZGbF2.js} +1 -1
- package/dist/{wang-editor-f_OOMd4x.js → wang-editor-6EirGFoh.js} +1 -1
- package/dist/{xlsx-util-3T0fByLw.js → xlsx-util-J1RHk00u.js} +1 -1
- package/es/common/map-chart-user/map-chart-user.util.mjs +1 -1
- package/es/control/app-menu/app-menu.d.ts +2 -2
- package/es/control/app-menu/app-menu.mjs +17 -9
- package/es/control/calendar/calendar.mjs +6 -2
- package/es/control/calendar/components/calendar-daily/use-calendar-daily.mjs +1 -1
- package/es/control/calendar/components/calendar-week/use-calendar-week.mjs +3 -3
- package/es/control/drbar/drbar.controller.mjs +4 -3
- package/es/control/drtab/drtab-control.util.mjs +1 -1
- package/es/control/grid/grid/grid-control.util.mjs +48 -2
- package/es/control/grid/row-edit-popover/row-edit-popover.css +1 -1
- package/es/control/kanban/kanban.mjs +6 -1
- package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.d.ts +1 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/index.d.ts +1 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/index.mjs +3 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/icon.d.ts +2 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/icon.mjs +19 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/interface.d.ts +99 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/interface.mjs +89 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer-util.d.ts +17 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer-util.mjs +103 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer.css +1 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer.d.ts +182 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer.mjs +146 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/icon.d.ts +1 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/icon.mjs +12 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/interface.d.ts +60 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/interface.mjs +52 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel-util.d.ts +14 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel-util.mjs +130 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel.css +1 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel.d.ts +108 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel.mjs +116 -0
- package/es/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.css +1 -0
- package/es/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.d.ts +97 -0
- package/es/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.mjs +279 -0
- package/es/editor/data-picker/index.d.ts +1 -0
- package/es/editor/data-picker/index.mjs +1 -0
- package/es/editor/data-picker/picker-editor.provider.mjs +3 -0
- package/es/editor/dropdown-list/dropdown-list-editor.provider.mjs +3 -0
- package/es/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.css +1 -0
- package/es/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.d.ts +93 -0
- package/es/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.mjs +292 -0
- package/es/editor/dropdown-list/index.d.ts +1 -0
- package/es/editor/dropdown-list/index.mjs +1 -0
- package/es/editor/index.mjs +12 -0
- package/es/editor/rate/ibiz-rate/ibiz-rate.d.ts +3 -0
- package/es/locale/en/index.d.ts +10 -0
- package/es/locale/en/index.mjs +10 -0
- package/es/locale/zh-CN/index.d.ts +10 -0
- package/es/locale/zh-CN/index.mjs +10 -0
- package/es/panel-component/app-switch/app-switch.controller.mjs +11 -1
- package/es/panel-component/panel-tab-panel/panel-tab-panel.css +1 -1
- package/es/panel-component/searchform-buttons/searchform-buttons.css +1 -1
- package/es/util/fullscreen/fullscreen-util.mjs +1 -1
- package/es/web-app/components/router-shell/router-shell.mjs +6 -4
- package/lib/common/map-chart-user/map-chart-user.util.cjs +1 -1
- package/lib/control/app-menu/app-menu.cjs +16 -8
- package/lib/control/calendar/calendar.cjs +6 -2
- package/lib/control/calendar/components/calendar-daily/use-calendar-daily.cjs +1 -1
- package/lib/control/calendar/components/calendar-week/use-calendar-week.cjs +3 -3
- package/lib/control/drbar/drbar.controller.cjs +4 -3
- package/lib/control/drtab/drtab-control.util.cjs +1 -1
- package/lib/control/grid/grid/grid-control.util.cjs +48 -2
- package/lib/control/grid/row-edit-popover/row-edit-popover.css +1 -1
- package/lib/control/kanban/kanban.cjs +6 -1
- package/lib/editor/data-picker/ibiz-transfer-picker/components/index.cjs +7 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer/icon.cjs +22 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer/interface.cjs +99 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer-util.cjs +108 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer.cjs +148 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer.css +1 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/icon.cjs +14 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/interface.cjs +58 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel-util.cjs +133 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel.cjs +118 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel.css +1 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.cjs +281 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.css +1 -0
- package/lib/editor/data-picker/index.cjs +2 -0
- package/lib/editor/data-picker/picker-editor.provider.cjs +3 -0
- package/lib/editor/dropdown-list/dropdown-list-editor.provider.cjs +3 -0
- package/lib/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.cjs +294 -0
- package/lib/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.css +1 -0
- package/lib/editor/dropdown-list/index.cjs +2 -0
- package/lib/editor/index.cjs +12 -0
- package/lib/locale/en/index.cjs +10 -0
- package/lib/locale/zh-CN/index.cjs +10 -0
- package/lib/panel-component/app-switch/app-switch.controller.cjs +11 -1
- package/lib/panel-component/panel-tab-panel/panel-tab-panel.css +1 -1
- package/lib/panel-component/searchform-buttons/searchform-buttons.css +1 -1
- package/lib/util/fullscreen/fullscreen-util.cjs +1 -1
- package/lib/web-app/components/router-shell/router-shell.cjs +6 -4
- package/package.json +5 -5
- package/dist/index-azhHVxuV.js +0 -4
- /package/es/node_modules/.pnpm/{@ibiz-template_core@0.7.40_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.41-alpha.1_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs +0 -0
- /package/lib/node_modules/.pnpm/{@ibiz-template_core@0.7.40_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.41-alpha.1_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs +0 -0
|
@@ -261,24 +261,32 @@ const AppMenuControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
261
261
|
const calcCurMenu = () => {
|
|
262
262
|
const allItems = c.getAllItems();
|
|
263
263
|
return allItems.find((item) => {
|
|
264
|
-
|
|
264
|
+
var _a;
|
|
265
|
+
if (item.itemType !== "MENUITEM" || !item.appFuncId)
|
|
266
|
+
return false;
|
|
267
|
+
if (ibiz.config.appMenu.echoMode === "VIEW") {
|
|
265
268
|
const app = ibiz.hub.getApp(item.appId);
|
|
266
|
-
if (!app)
|
|
269
|
+
if (!app)
|
|
267
270
|
return false;
|
|
268
|
-
}
|
|
269
271
|
const func = app.getAppFunc(item.appFuncId);
|
|
270
|
-
if (func && func.appViewId && route.params.view2) {
|
|
272
|
+
if (func && func.appViewId && (route == null ? void 0 : route.params.view2)) {
|
|
271
273
|
return func.appViewId.split(".")[1] === route.params.view2;
|
|
272
274
|
}
|
|
275
|
+
} else {
|
|
276
|
+
if (!route) {
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
const routePath = vue3Util.route2routePath(route);
|
|
280
|
+
if (routePath.pathNodes.length > 1)
|
|
281
|
+
return item.id === ((_a = routePath.pathNodes[1].params) == null ? void 0 : _a.srfmenuitem);
|
|
273
282
|
}
|
|
274
283
|
return false;
|
|
275
284
|
});
|
|
276
285
|
};
|
|
277
286
|
const onClick = async (id, event) => {
|
|
278
287
|
const activeMenu = calcCurMenu();
|
|
279
|
-
if (activeMenu && activeMenu.id === id)
|
|
288
|
+
if (activeMenu && activeMenu.id === id)
|
|
280
289
|
return;
|
|
281
|
-
}
|
|
282
290
|
defaultActive.value = id;
|
|
283
291
|
const menu = c.getAllItems().find((m) => m.id === id);
|
|
284
292
|
if ((menu == null ? void 0 : menu.itemType) === "RAWITEM" || c.runMode === "DESIGN") {
|
|
@@ -287,7 +295,7 @@ const AppMenuControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
287
295
|
await c.onClickMenuItem(id, event);
|
|
288
296
|
};
|
|
289
297
|
if (c.runMode !== "DESIGN") {
|
|
290
|
-
vue.watch(() => route.params.view2, (newVal, oldVal) => {
|
|
298
|
+
vue.watch(() => route == null ? void 0 : route.params.view2, (newVal, oldVal) => {
|
|
291
299
|
if (newVal !== oldVal && ibiz.config.appMenu.enableEcho) {
|
|
292
300
|
const activeMenu = calcCurMenu();
|
|
293
301
|
defaultActive.value = activeMenu ? activeMenu.id : "";
|
|
@@ -303,7 +311,7 @@ const AppMenuControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
303
311
|
const defaultActiveMenuItem = allItems.find((item) => {
|
|
304
312
|
return item.openDefault && !item.hidden;
|
|
305
313
|
});
|
|
306
|
-
if (defaultActiveMenuItem && !route.params.view2 && !route.fullPath.includes("404")) {
|
|
314
|
+
if (defaultActiveMenuItem && !(route == null ? void 0 : route.params.view2) && !(route == null ? void 0 : route.fullPath.includes("404"))) {
|
|
307
315
|
defaultActive.value = defaultActiveMenuItem.id;
|
|
308
316
|
onClick(defaultActive.value);
|
|
309
317
|
} else if (ibiz.config.appMenu.enableEcho) {
|
|
@@ -548,13 +548,17 @@ const CalendarControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
548
548
|
const {
|
|
549
549
|
data
|
|
550
550
|
} = value;
|
|
551
|
-
|
|
551
|
+
const item = data[0];
|
|
552
|
+
if (item)
|
|
553
|
+
this.c.onRowClick(item);
|
|
552
554
|
},
|
|
553
555
|
"onEventDblClick": (value) => {
|
|
554
556
|
const {
|
|
555
557
|
data
|
|
556
558
|
} = value;
|
|
557
|
-
|
|
559
|
+
const item = data[0];
|
|
560
|
+
if (item)
|
|
561
|
+
this.c.onDbRowClick(item);
|
|
558
562
|
}
|
|
559
563
|
}, _isSlot(slots) ? slots : {
|
|
560
564
|
default: () => [slots]
|
|
@@ -127,7 +127,7 @@ const useCalendarDaily = (props, emit) => {
|
|
|
127
127
|
const difference = new Date(endTime).getTime() - new Date(startTime).getTime();
|
|
128
128
|
height = Math.floor(difference / (1e3 * 60));
|
|
129
129
|
}
|
|
130
|
-
if (height <
|
|
130
|
+
if (height < 30) {
|
|
131
131
|
height = "auto";
|
|
132
132
|
}
|
|
133
133
|
return height;
|
|
@@ -153,7 +153,7 @@ const useCalendarWeek = (props, emit) => {
|
|
|
153
153
|
const width = "".concat(percentage, "%");
|
|
154
154
|
const styleLeft = "".concat(index * percentage, "%");
|
|
155
155
|
Object.assign(tempEventContent, { width, styleLeft });
|
|
156
|
-
let height =
|
|
156
|
+
let height = "auto";
|
|
157
157
|
let styleTop = 60;
|
|
158
158
|
let timeRange = "";
|
|
159
159
|
if (util.isToday(event.beginTime, event.endTime)) {
|
|
@@ -301,8 +301,8 @@ const useCalendarWeek = (props, emit) => {
|
|
|
301
301
|
const difference = new Date(endTime).getTime() - new Date(startTime).getTime();
|
|
302
302
|
height = Math.floor(difference / (1e3 * 60));
|
|
303
303
|
}
|
|
304
|
-
if (height <
|
|
305
|
-
height =
|
|
304
|
+
if (height < 30) {
|
|
305
|
+
height = "auto";
|
|
306
306
|
}
|
|
307
307
|
return height;
|
|
308
308
|
};
|
|
@@ -303,6 +303,7 @@ class DRBarController extends runtime.ControlController {
|
|
|
303
303
|
* @memberof DRBarController
|
|
304
304
|
*/
|
|
305
305
|
initDRBarItems() {
|
|
306
|
+
var _a;
|
|
306
307
|
const { dedrctrlItems, dedrbarGroups } = this.model;
|
|
307
308
|
const drBarItems = [];
|
|
308
309
|
if (!this.state.hideEditItem) {
|
|
@@ -324,7 +325,7 @@ class DRBarController extends runtime.ControlController {
|
|
|
324
325
|
caption,
|
|
325
326
|
disabled: false,
|
|
326
327
|
sysImage: editItemSysImage,
|
|
327
|
-
fullPath: this.router.currentRoute.value.fullPath
|
|
328
|
+
fullPath: (_a = this.router) == null ? void 0 : _a.currentRoute.value.fullPath
|
|
328
329
|
});
|
|
329
330
|
this.state.defaultItem = uniqueTag;
|
|
330
331
|
}
|
|
@@ -356,11 +357,11 @@ class DRBarController extends runtime.ControlController {
|
|
|
356
357
|
});
|
|
357
358
|
} else {
|
|
358
359
|
dedrbarGroups.forEach((group) => {
|
|
359
|
-
var
|
|
360
|
+
var _a2;
|
|
360
361
|
const groupItems = dedrctrlItems.filter(
|
|
361
362
|
(item) => item.dedrbarGroupId === group.id
|
|
362
363
|
);
|
|
363
|
-
if (groupItems.length > 1 || ((
|
|
364
|
+
if (groupItems.length > 1 || ((_a2 = this.controlParams) == null ? void 0 : _a2.singleitemgroup) === "true" && groupItems.length === 1) {
|
|
364
365
|
let itemCaption = group.caption;
|
|
365
366
|
if (group.capLanguageRes) {
|
|
366
367
|
itemCaption = ibiz.i18n.t(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var vue = require('vue');
|
|
4
|
-
var namespace = require('../../node_modules/.pnpm/@ibiz-template_core@0.7.
|
|
4
|
+
var namespace = require('../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.1_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs');
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
function useAppDRTab(c, controlRef, counterData) {
|
|
@@ -511,11 +511,57 @@ function useAppGridBase(c, props) {
|
|
|
511
511
|
}
|
|
512
512
|
return state.rows.map((row) => row.data);
|
|
513
513
|
});
|
|
514
|
+
const calcGroupColumns = (groupColumn) => {
|
|
515
|
+
const result = { ...groupColumn };
|
|
516
|
+
const columns = [];
|
|
517
|
+
const degridColumns = groupColumn.degridColumns || [];
|
|
518
|
+
degridColumns.forEach((column) => {
|
|
519
|
+
var _a, _b;
|
|
520
|
+
if (column.columnType === "GROUPGRIDCOLUMN") {
|
|
521
|
+
const children = calcGroupColumns(column);
|
|
522
|
+
if (children.degridColumns && children.degridColumns.length) {
|
|
523
|
+
columns.push(children);
|
|
524
|
+
}
|
|
525
|
+
} else {
|
|
526
|
+
const columnState = c.state.columnStates.find(
|
|
527
|
+
(item) => item.key === column.codeName
|
|
528
|
+
);
|
|
529
|
+
if (columnState && !columnState.hidden) {
|
|
530
|
+
const columnModel = ((_a = c.fieldColumns[columnState.key]) == null ? void 0 : _a.model) || ((_b = c.uaColumns[columnState.key]) == null ? void 0 : _b.model);
|
|
531
|
+
if (columnModel) {
|
|
532
|
+
columns.push(columnModel);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
});
|
|
537
|
+
result.degridColumns = columns;
|
|
538
|
+
return result;
|
|
539
|
+
};
|
|
514
540
|
const renderColumns = vue.computed(() => {
|
|
541
|
+
const columns = [];
|
|
515
542
|
if (c.isMultistageHeader) {
|
|
516
|
-
|
|
543
|
+
const degridColumns = c.model.degridColumns || [];
|
|
544
|
+
degridColumns.forEach((column) => {
|
|
545
|
+
var _a, _b;
|
|
546
|
+
if (column.columnType === "GROUPGRIDCOLUMN") {
|
|
547
|
+
const groupColumn = calcGroupColumns(column);
|
|
548
|
+
if (groupColumn.degridColumns && groupColumn.degridColumns.length) {
|
|
549
|
+
columns.push(groupColumn);
|
|
550
|
+
}
|
|
551
|
+
} else {
|
|
552
|
+
const columnState = c.state.columnStates.find(
|
|
553
|
+
(item) => item.key === column.codeName
|
|
554
|
+
);
|
|
555
|
+
if (columnState && !columnState.hidden) {
|
|
556
|
+
const columnModel = ((_a = c.fieldColumns[columnState.key]) == null ? void 0 : _a.model) || ((_b = c.uaColumns[columnState.key]) == null ? void 0 : _b.model);
|
|
557
|
+
if (columnModel) {
|
|
558
|
+
columns.push(columnModel);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
});
|
|
563
|
+
return columns;
|
|
517
564
|
}
|
|
518
|
-
const columns = [];
|
|
519
565
|
c.state.columnStates.forEach((item) => {
|
|
520
566
|
var _a, _b;
|
|
521
567
|
if (item.hidden) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-row-edit-popover{position:absolute;z-index:2;padding:var(--ibiz-spacing-tight) var(--ibiz-spacing-base);background-color:var(--ibiz-control-grid-row-edit-bg-color)}.ibiz-row-edit-popover.is-hidden{top:-9999px;left:-9999px;z-index:-9999}.ibiz-row-edit-popover::before{position:absolute;top:0;left:-50px;width:0;height:0;content:"";border-color:transparent var(--ibiz-control-grid-row-edit-bg-color) transparent transparent;border-style:solid;border-width:0 50px 50px 0}.ibiz-row-edit-popover::after{position:absolute;top:0;right:-50px;width:0;height:0;content:"";border-color:transparent transparent transparent var(--ibiz-control-grid-row-edit-bg-color);border-style:solid;border-width:0 0 50px 50px}.row-edit-popover__placeholder{height:50px}
|
|
1
|
+
.ibiz-row-edit-popover{position:absolute;z-index:2;padding:var(--ibiz-spacing-tight) var(--ibiz-spacing-base);white-space:nowrap;background-color:var(--ibiz-control-grid-row-edit-bg-color)}.ibiz-row-edit-popover.is-hidden{top:-9999px;left:-9999px;z-index:-9999}.ibiz-row-edit-popover::before{position:absolute;top:0;left:-50px;width:0;height:0;content:"";border-color:transparent var(--ibiz-control-grid-row-edit-bg-color) transparent transparent;border-style:solid;border-width:0 50px 50px 0}.ibiz-row-edit-popover::after{position:absolute;top:0;right:-50px;width:0;height:0;content:"";border-color:transparent transparent transparent var(--ibiz-control-grid-row-edit-bg-color);border-style:solid;border-width:0 0 50px 50px}.row-edit-popover__placeholder{height:50px}
|
|
@@ -237,7 +237,12 @@ const KanbanControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
237
237
|
const findIndex = c.state.selectedData.findIndex((data) => {
|
|
238
238
|
return data.srfkey === item.srfkey;
|
|
239
239
|
});
|
|
240
|
-
const cardClass = [
|
|
240
|
+
const cardClass = [
|
|
241
|
+
ns.b("item"),
|
|
242
|
+
ns.is("selected", findIndex !== -1),
|
|
243
|
+
// 数据更新时不允许拖拽,鼠标变为禁用
|
|
244
|
+
ns.is("disabled", c.state.draggable && c.state.updating)
|
|
245
|
+
];
|
|
241
246
|
const cardStyle = {};
|
|
242
247
|
if (c.model.cardWidth) {
|
|
243
248
|
cardStyle.width = "".concat(c.model.cardWidth, "px");
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
const arrowLeft = () => vue.createVNode("svg", {
|
|
7
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
8
|
+
"viewBox": "0 0 1024 1024"
|
|
9
|
+
}, [vue.createVNode("path", {
|
|
10
|
+
"fill": "currentColor",
|
|
11
|
+
"d": "M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"
|
|
12
|
+
}, null)]);
|
|
13
|
+
const arrowRight = () => vue.createVNode("svg", {
|
|
14
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
15
|
+
"viewBox": "0 0 1024 1024"
|
|
16
|
+
}, [vue.createVNode("path", {
|
|
17
|
+
"fill": "currentColor",
|
|
18
|
+
"d": "M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"
|
|
19
|
+
}, null)]);
|
|
20
|
+
|
|
21
|
+
exports.arrowLeft = arrowLeft;
|
|
22
|
+
exports.arrowRight = arrowRight;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var lodashEs = require('lodash-es');
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
const UPDATE_MODEL_EVENT = "update:modelValue";
|
|
7
|
+
const CHANGE_EVENT = "change";
|
|
8
|
+
const INPUT_EVENT = "input";
|
|
9
|
+
const LEFT_CHECK_CHANGE_EVENT = "leftCheckChange";
|
|
10
|
+
const RIGHT_CHECK_CHANGE_EVENT = "rightCheckChange";
|
|
11
|
+
const LEFT_AC_SEARCH = "leftAcSearch";
|
|
12
|
+
const transferCheckedChangeFn = (value, movedKeys) => [value, movedKeys].every(lodashEs.isArray) || lodashEs.isArray(value) && lodashEs.isNil(movedKeys);
|
|
13
|
+
const transferProps = {
|
|
14
|
+
data: {
|
|
15
|
+
type: Array,
|
|
16
|
+
default: () => []
|
|
17
|
+
},
|
|
18
|
+
titles: {
|
|
19
|
+
type: Array,
|
|
20
|
+
default: () => []
|
|
21
|
+
},
|
|
22
|
+
buttonTexts: {
|
|
23
|
+
type: Array,
|
|
24
|
+
default: () => []
|
|
25
|
+
},
|
|
26
|
+
filterPlaceholder: String,
|
|
27
|
+
filterMethod: {
|
|
28
|
+
type: Function
|
|
29
|
+
},
|
|
30
|
+
rightSearchMethod: {
|
|
31
|
+
type: Function
|
|
32
|
+
},
|
|
33
|
+
leftDefaultChecked: {
|
|
34
|
+
type: Array,
|
|
35
|
+
default: () => []
|
|
36
|
+
},
|
|
37
|
+
rightDefaultChecked: {
|
|
38
|
+
type: Array,
|
|
39
|
+
default: () => []
|
|
40
|
+
},
|
|
41
|
+
renderContent: {
|
|
42
|
+
type: Function
|
|
43
|
+
},
|
|
44
|
+
modelValue: {
|
|
45
|
+
type: Array,
|
|
46
|
+
default: () => []
|
|
47
|
+
},
|
|
48
|
+
format: {
|
|
49
|
+
type: Object,
|
|
50
|
+
default: () => ({})
|
|
51
|
+
},
|
|
52
|
+
filterable: Boolean,
|
|
53
|
+
props: {
|
|
54
|
+
type: Object,
|
|
55
|
+
default: () => ({
|
|
56
|
+
label: "label",
|
|
57
|
+
key: "key",
|
|
58
|
+
disabled: "disabled"
|
|
59
|
+
})
|
|
60
|
+
},
|
|
61
|
+
targetOrder: {
|
|
62
|
+
type: String,
|
|
63
|
+
values: ["original", "push", "unshift"],
|
|
64
|
+
default: "original"
|
|
65
|
+
},
|
|
66
|
+
enableRemoteSearch: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false
|
|
69
|
+
},
|
|
70
|
+
validateEvent: {
|
|
71
|
+
type: Boolean,
|
|
72
|
+
default: true
|
|
73
|
+
},
|
|
74
|
+
loading: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: false
|
|
77
|
+
},
|
|
78
|
+
readonly: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
default: false
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
const transferEmits = {
|
|
84
|
+
[CHANGE_EVENT]: (value, direction, movedKeys) => [value, movedKeys].every(lodashEs.isArray) && ["left", "right"].includes(direction),
|
|
85
|
+
[UPDATE_MODEL_EVENT]: (value) => lodashEs.isArray(value),
|
|
86
|
+
[LEFT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,
|
|
87
|
+
[RIGHT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,
|
|
88
|
+
[LEFT_AC_SEARCH]: (query) => query
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
exports.CHANGE_EVENT = CHANGE_EVENT;
|
|
92
|
+
exports.INPUT_EVENT = INPUT_EVENT;
|
|
93
|
+
exports.LEFT_AC_SEARCH = LEFT_AC_SEARCH;
|
|
94
|
+
exports.LEFT_CHECK_CHANGE_EVENT = LEFT_CHECK_CHANGE_EVENT;
|
|
95
|
+
exports.RIGHT_CHECK_CHANGE_EVENT = RIGHT_CHECK_CHANGE_EVENT;
|
|
96
|
+
exports.UPDATE_MODEL_EVENT = UPDATE_MODEL_EVENT;
|
|
97
|
+
exports.transferCheckedChangeFn = transferCheckedChangeFn;
|
|
98
|
+
exports.transferEmits = transferEmits;
|
|
99
|
+
exports.transferProps = transferProps;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
var _interface = require('./interface.cjs');
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
const usePropsAlias = (props) => {
|
|
8
|
+
const initProps = {
|
|
9
|
+
label: "label",
|
|
10
|
+
key: "key",
|
|
11
|
+
disabled: "disabled"
|
|
12
|
+
};
|
|
13
|
+
return vue.computed(() => ({
|
|
14
|
+
...initProps,
|
|
15
|
+
...props.props
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
18
|
+
const useComputedData = (props) => {
|
|
19
|
+
const propsAlias = usePropsAlias(props);
|
|
20
|
+
const dataObj = vue.computed(
|
|
21
|
+
() => props.data.reduce(
|
|
22
|
+
// eslint-disable-next-line no-return-assign, no-param-reassign
|
|
23
|
+
(o, cur) => (o[cur[propsAlias.value.key]] = cur) && o,
|
|
24
|
+
{}
|
|
25
|
+
)
|
|
26
|
+
);
|
|
27
|
+
const sourceData = vue.computed(
|
|
28
|
+
() => props.data.filter(
|
|
29
|
+
(item) => !props.modelValue.includes(item[propsAlias.value.key])
|
|
30
|
+
)
|
|
31
|
+
);
|
|
32
|
+
const targetData = vue.computed(() => {
|
|
33
|
+
if (props.targetOrder === "original") {
|
|
34
|
+
return props.data.filter(
|
|
35
|
+
(item) => props.modelValue.includes(item[propsAlias.value.key])
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
return props.modelValue.reduce((arr, cur) => {
|
|
39
|
+
const val = dataObj.value[cur];
|
|
40
|
+
if (val) {
|
|
41
|
+
arr.push(val);
|
|
42
|
+
}
|
|
43
|
+
return arr;
|
|
44
|
+
}, []);
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
sourceData,
|
|
48
|
+
targetData
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
const useCheckedChange = (checkedState, emit) => {
|
|
52
|
+
const onSourceCheckedChange = (val, movedKeys) => {
|
|
53
|
+
checkedState.leftChecked = val;
|
|
54
|
+
if (!movedKeys)
|
|
55
|
+
return;
|
|
56
|
+
emit(_interface.LEFT_CHECK_CHANGE_EVENT, val, movedKeys);
|
|
57
|
+
};
|
|
58
|
+
const onTargetCheckedChange = (val, movedKeys) => {
|
|
59
|
+
checkedState.rightChecked = val;
|
|
60
|
+
if (!movedKeys)
|
|
61
|
+
return;
|
|
62
|
+
emit(_interface.RIGHT_CHECK_CHANGE_EVENT, val, movedKeys);
|
|
63
|
+
};
|
|
64
|
+
return {
|
|
65
|
+
onSourceCheckedChange,
|
|
66
|
+
onTargetCheckedChange
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
const useMove = (props, checkedState, emit) => {
|
|
70
|
+
const propsAlias = usePropsAlias(props);
|
|
71
|
+
const _emit = (value, direction, movedKeys) => {
|
|
72
|
+
emit(_interface.UPDATE_MODEL_EVENT, value);
|
|
73
|
+
emit(_interface.CHANGE_EVENT, value, direction, movedKeys);
|
|
74
|
+
};
|
|
75
|
+
const addToLeft = () => {
|
|
76
|
+
const currentValue = props.modelValue.slice();
|
|
77
|
+
checkedState.rightChecked.forEach((item) => {
|
|
78
|
+
const index = currentValue.indexOf(item);
|
|
79
|
+
if (index > -1) {
|
|
80
|
+
currentValue.splice(index, 1);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
_emit(currentValue, "left", checkedState.rightChecked);
|
|
84
|
+
};
|
|
85
|
+
const addToRight = () => {
|
|
86
|
+
let currentValue = props.modelValue.slice();
|
|
87
|
+
const itemsToBeMoved = props.data.filter((item) => {
|
|
88
|
+
const itemKey = item[propsAlias.value.key];
|
|
89
|
+
return checkedState.leftChecked.includes(itemKey) && !props.modelValue.includes(itemKey);
|
|
90
|
+
}).map((item) => item[propsAlias.value.key]);
|
|
91
|
+
currentValue = props.targetOrder === "unshift" ? itemsToBeMoved.concat(currentValue) : currentValue.concat(itemsToBeMoved);
|
|
92
|
+
if (props.targetOrder === "original") {
|
|
93
|
+
currentValue = props.data.filter(
|
|
94
|
+
(item) => currentValue.includes(item[propsAlias.value.key])
|
|
95
|
+
).map((item) => item[propsAlias.value.key]);
|
|
96
|
+
}
|
|
97
|
+
_emit(currentValue, "right", checkedState.leftChecked);
|
|
98
|
+
};
|
|
99
|
+
return {
|
|
100
|
+
addToLeft,
|
|
101
|
+
addToRight
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
exports.useCheckedChange = useCheckedChange;
|
|
106
|
+
exports.useComputedData = useComputedData;
|
|
107
|
+
exports.useMove = useMove;
|
|
108
|
+
exports.usePropsAlias = usePropsAlias;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
var ramda = require('ramda');
|
|
5
|
+
var vue3Util = require('@ibiz-template/vue3-util');
|
|
6
|
+
var transferUtil = require('./transfer-util.cjs');
|
|
7
|
+
var _interface = require('./interface.cjs');
|
|
8
|
+
var transferPanel = require('../transfer-panel/transfer-panel.cjs');
|
|
9
|
+
var icon = require('./icon.cjs');
|
|
10
|
+
require('./transfer.css');
|
|
11
|
+
|
|
12
|
+
"use strict";
|
|
13
|
+
const TransferSelect = /* @__PURE__ */ vue.defineComponent({
|
|
14
|
+
name: "IBizTransfer",
|
|
15
|
+
props: _interface.transferProps,
|
|
16
|
+
emits: _interface.transferEmits,
|
|
17
|
+
setup(props, {
|
|
18
|
+
emit,
|
|
19
|
+
slots
|
|
20
|
+
}) {
|
|
21
|
+
const ns = vue3Util.useNamespace("transfer");
|
|
22
|
+
const checkedState = vue.reactive({
|
|
23
|
+
leftChecked: [],
|
|
24
|
+
rightChecked: []
|
|
25
|
+
});
|
|
26
|
+
const propsAlias = transferUtil.usePropsAlias(props);
|
|
27
|
+
const {
|
|
28
|
+
sourceData,
|
|
29
|
+
targetData
|
|
30
|
+
} = transferUtil.useComputedData(props);
|
|
31
|
+
const {
|
|
32
|
+
onSourceCheckedChange,
|
|
33
|
+
onTargetCheckedChange
|
|
34
|
+
} = transferUtil.useCheckedChange(checkedState, emit);
|
|
35
|
+
const {
|
|
36
|
+
addToLeft,
|
|
37
|
+
addToRight
|
|
38
|
+
} = transferUtil.useMove(props, checkedState, emit);
|
|
39
|
+
const leftPanel = vue.ref();
|
|
40
|
+
const rightPanel = vue.ref();
|
|
41
|
+
const clearQuery = (which) => {
|
|
42
|
+
switch (which) {
|
|
43
|
+
case "left":
|
|
44
|
+
leftPanel.value.query = "";
|
|
45
|
+
break;
|
|
46
|
+
case "right":
|
|
47
|
+
rightPanel.value.query = "";
|
|
48
|
+
break;
|
|
49
|
+
default:
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const onLeftAcSearch = (query) => {
|
|
54
|
+
emit("leftAcSearch", query);
|
|
55
|
+
};
|
|
56
|
+
const hasButtonTexts = vue.computed(() => props.buttonTexts.length === 2);
|
|
57
|
+
const leftPanelTitle = vue.computed(() => props.titles[0] || "\u53EF\u9009\u5217\u8868");
|
|
58
|
+
const rightPanelTitle = vue.computed(() => props.titles[1] || "\u5DF2\u9009\u5217\u8868");
|
|
59
|
+
const panelFilterPlaceholder = vue.computed(() => props.filterPlaceholder || "\u8BF7\u8F93\u5165");
|
|
60
|
+
const optionRender = vue.computed(() => (option) => {
|
|
61
|
+
var _a;
|
|
62
|
+
if (props.renderContent)
|
|
63
|
+
return props.renderContent(vue.h, option);
|
|
64
|
+
const defaultSlotVNodes = (((_a = slots.default) == null ? void 0 : _a.call(slots, {
|
|
65
|
+
option
|
|
66
|
+
})) || []).filter((node) => node.type !== Comment);
|
|
67
|
+
if (defaultSlotVNodes.length) {
|
|
68
|
+
return defaultSlotVNodes;
|
|
69
|
+
}
|
|
70
|
+
return vue.h("span", option[propsAlias.value.label] || option[propsAlias.value.key]);
|
|
71
|
+
});
|
|
72
|
+
return {
|
|
73
|
+
ns,
|
|
74
|
+
targetData,
|
|
75
|
+
rightPanelTitle,
|
|
76
|
+
optionRender,
|
|
77
|
+
panelFilterPlaceholder,
|
|
78
|
+
leftPanelTitle,
|
|
79
|
+
sourceData,
|
|
80
|
+
leftPanel,
|
|
81
|
+
rightPanel,
|
|
82
|
+
hasButtonTexts,
|
|
83
|
+
checkedState,
|
|
84
|
+
addToLeft,
|
|
85
|
+
addToRight,
|
|
86
|
+
clearQuery,
|
|
87
|
+
onLeftAcSearch,
|
|
88
|
+
onSourceCheckedChange,
|
|
89
|
+
onTargetCheckedChange
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
render() {
|
|
93
|
+
return vue.createVNode("div", {
|
|
94
|
+
"class": this.ns.b()
|
|
95
|
+
}, [vue.createVNode(transferPanel.TransferPanel, {
|
|
96
|
+
"ref": "leftPanel",
|
|
97
|
+
"data": this.sourceData,
|
|
98
|
+
"readonly": this.readonly,
|
|
99
|
+
"optionRender": this.optionRender,
|
|
100
|
+
"placeholder": this.panelFilterPlaceholder,
|
|
101
|
+
"title": this.leftPanelTitle,
|
|
102
|
+
"filterable": this.filterable,
|
|
103
|
+
"format": this.format,
|
|
104
|
+
"enableAcSearch": this.enableRemoteSearch,
|
|
105
|
+
"loading": this.loading,
|
|
106
|
+
"filterMethod": this.filterMethod,
|
|
107
|
+
"defaultChecked": this.leftDefaultChecked,
|
|
108
|
+
"onAcSearch": this.onLeftAcSearch,
|
|
109
|
+
"props": this.props,
|
|
110
|
+
"onCheckedChange": this.onSourceCheckedChange
|
|
111
|
+
}, null), vue.createVNode("div", {
|
|
112
|
+
"class": this.ns.e("buttons")
|
|
113
|
+
}, [vue.createVNode(vue.resolveComponent("el-button"), {
|
|
114
|
+
"class": [this.ns.e("button"), this.ns.is("with-texts", this.hasButtonTexts)],
|
|
115
|
+
"type": "primary",
|
|
116
|
+
"disabled": !!ramda.isEmpty(this.checkedState.rightChecked) || this.readonly,
|
|
117
|
+
"onClick": this.addToLeft
|
|
118
|
+
}, {
|
|
119
|
+
default: () => [vue.createVNode(vue.resolveComponent("el-icon"), null, {
|
|
120
|
+
default: () => icon.arrowLeft()
|
|
121
|
+
}), this.buttonTexts[0] !== void 0 ? vue.createVNode("span", null, [this.buttonTexts[0]]) : null]
|
|
122
|
+
}), vue.createVNode(vue.resolveComponent("el-button"), {
|
|
123
|
+
"class": [this.ns.e("button"), this.ns.is("with-texts", this.hasButtonTexts)],
|
|
124
|
+
"type": "primary",
|
|
125
|
+
"disabled": !!ramda.isEmpty(this.checkedState.leftChecked) || this.readonly,
|
|
126
|
+
"onClick": this.addToRight
|
|
127
|
+
}, {
|
|
128
|
+
default: () => [this.buttonTexts[1] !== void 0 ? vue.createVNode("span", null, [this.buttonTexts[1]]) : null, vue.createVNode(vue.resolveComponent("el-icon"), null, {
|
|
129
|
+
default: () => icon.arrowRight()
|
|
130
|
+
})]
|
|
131
|
+
})]), vue.createVNode(transferPanel.TransferPanel, {
|
|
132
|
+
"ref": "rightPanel",
|
|
133
|
+
"data": this.targetData,
|
|
134
|
+
"readonly": this.readonly,
|
|
135
|
+
"optionRender": this.optionRender,
|
|
136
|
+
"placeholder": this.panelFilterPlaceholder,
|
|
137
|
+
"filterable": this.filterable,
|
|
138
|
+
"format": this.format,
|
|
139
|
+
"filterMethod": this.filterMethod,
|
|
140
|
+
"title": this.rightPanelTitle,
|
|
141
|
+
"defaultChecked": this.rightDefaultChecked,
|
|
142
|
+
"props": this.props,
|
|
143
|
+
"onCheckedChange": this.onTargetCheckedChange
|
|
144
|
+
}, null)]);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
exports.TransferSelect = TransferSelect;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-transfer__buttons{display:inline-block;padding:0 1.875rem;vertical-align:middle}.ibiz-transfer__button{vertical-align:top}.ibiz-transfer__button:nth-child(2){margin:0 0 0 10px}.ibiz-transfer__button i,.ibiz-transfer__button span{font-size:var(--ibiz-font-size-header-6)}.ibiz-transfer__button .el-icon{font-size:var(--ibiz-font-size-regular)}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
const Search = () => vue.createVNode("svg", {
|
|
7
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
8
|
+
"viewBox": "0 0 1024 1024"
|
|
9
|
+
}, [vue.createVNode("path", {
|
|
10
|
+
"fill": "currentColor",
|
|
11
|
+
"d": "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"
|
|
12
|
+
}, null)]);
|
|
13
|
+
|
|
14
|
+
exports.Search = Search;
|