@ibiz-template/vue3-components 0.7.40 → 0.7.41-alpha.0

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.
Files changed (82) hide show
  1. package/dist/{index-8ZkS4CI0.js → index-4CBJktLS.js} +1 -1
  2. package/dist/{index-WNFQFxQd.js → index-QL7Ukex9.js} +1 -1
  3. package/dist/index-toTw1DLN.js +4 -0
  4. package/dist/index.min.css +1 -1
  5. package/dist/index.system.min.js +1 -1
  6. package/dist/{wang-editor-f_OOMd4x.js → wang-editor-GTNgz_em.js} +1 -1
  7. package/dist/{xlsx-util-3T0fByLw.js → xlsx-util-_sLiqD2S.js} +1 -1
  8. package/es/control/drbar/drbar.controller.mjs +4 -3
  9. package/es/control/grid/grid/grid-control.util.mjs +48 -2
  10. package/es/control/grid/row-edit-popover/row-edit-popover.css +1 -1
  11. package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.d.ts +1 -0
  12. package/es/editor/data-picker/ibiz-transfer-picker/components/index.d.ts +1 -0
  13. package/es/editor/data-picker/ibiz-transfer-picker/components/index.mjs +3 -0
  14. package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/icon.d.ts +2 -0
  15. package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/icon.mjs +19 -0
  16. package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/interface.d.ts +99 -0
  17. package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/interface.mjs +89 -0
  18. package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer-util.d.ts +17 -0
  19. package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer-util.mjs +103 -0
  20. package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer.css +1 -0
  21. package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer.d.ts +182 -0
  22. package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer.mjs +146 -0
  23. package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/icon.d.ts +1 -0
  24. package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/icon.mjs +12 -0
  25. package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/interface.d.ts +60 -0
  26. package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/interface.mjs +52 -0
  27. package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel-util.d.ts +14 -0
  28. package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel-util.mjs +130 -0
  29. package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel.css +1 -0
  30. package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel.d.ts +108 -0
  31. package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel.mjs +116 -0
  32. package/es/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.css +1 -0
  33. package/es/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.d.ts +97 -0
  34. package/es/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.mjs +279 -0
  35. package/es/editor/data-picker/index.d.ts +1 -0
  36. package/es/editor/data-picker/index.mjs +1 -0
  37. package/es/editor/data-picker/picker-editor.provider.mjs +3 -0
  38. package/es/editor/dropdown-list/dropdown-list-editor.provider.mjs +3 -0
  39. package/es/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.css +1 -0
  40. package/es/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.d.ts +93 -0
  41. package/es/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.mjs +292 -0
  42. package/es/editor/dropdown-list/index.d.ts +1 -0
  43. package/es/editor/dropdown-list/index.mjs +1 -0
  44. package/es/editor/index.mjs +12 -0
  45. package/es/editor/rate/ibiz-rate/ibiz-rate.d.ts +3 -0
  46. package/es/locale/en/index.d.ts +10 -0
  47. package/es/locale/en/index.mjs +10 -0
  48. package/es/locale/zh-CN/index.d.ts +10 -0
  49. package/es/locale/zh-CN/index.mjs +10 -0
  50. package/es/panel-component/app-switch/app-switch.controller.mjs +11 -1
  51. package/es/panel-component/panel-tab-panel/panel-tab-panel.css +1 -1
  52. package/es/panel-component/searchform-buttons/searchform-buttons.css +1 -1
  53. package/lib/control/drbar/drbar.controller.cjs +4 -3
  54. package/lib/control/grid/grid/grid-control.util.cjs +48 -2
  55. package/lib/control/grid/row-edit-popover/row-edit-popover.css +1 -1
  56. package/lib/editor/data-picker/ibiz-transfer-picker/components/index.cjs +7 -0
  57. package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer/icon.cjs +22 -0
  58. package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer/interface.cjs +99 -0
  59. package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer-util.cjs +108 -0
  60. package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer.cjs +148 -0
  61. package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer.css +1 -0
  62. package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/icon.cjs +14 -0
  63. package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/interface.cjs +58 -0
  64. package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel-util.cjs +133 -0
  65. package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel.cjs +118 -0
  66. package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel.css +1 -0
  67. package/lib/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.cjs +281 -0
  68. package/lib/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.css +1 -0
  69. package/lib/editor/data-picker/index.cjs +2 -0
  70. package/lib/editor/data-picker/picker-editor.provider.cjs +3 -0
  71. package/lib/editor/dropdown-list/dropdown-list-editor.provider.cjs +3 -0
  72. package/lib/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.cjs +294 -0
  73. package/lib/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.css +1 -0
  74. package/lib/editor/dropdown-list/index.cjs +2 -0
  75. package/lib/editor/index.cjs +12 -0
  76. package/lib/locale/en/index.cjs +10 -0
  77. package/lib/locale/zh-CN/index.cjs +10 -0
  78. package/lib/panel-component/app-switch/app-switch.controller.cjs +11 -1
  79. package/lib/panel-component/panel-tab-panel/panel-tab-panel.css +1 -1
  80. package/lib/panel-component/searchform-buttons/searchform-buttons.css +1 -1
  81. package/package.json +4 -4
  82. package/dist/index-azhHVxuV.js +0 -4
@@ -301,6 +301,7 @@ class DRBarController extends ControlController {
301
301
  * @memberof DRBarController
302
302
  */
303
303
  initDRBarItems() {
304
+ var _a;
304
305
  const { dedrctrlItems, dedrbarGroups } = this.model;
305
306
  const drBarItems = [];
306
307
  if (!this.state.hideEditItem) {
@@ -322,7 +323,7 @@ class DRBarController extends ControlController {
322
323
  caption,
323
324
  disabled: false,
324
325
  sysImage: editItemSysImage,
325
- fullPath: this.router.currentRoute.value.fullPath
326
+ fullPath: (_a = this.router) == null ? void 0 : _a.currentRoute.value.fullPath
326
327
  });
327
328
  this.state.defaultItem = uniqueTag;
328
329
  }
@@ -354,11 +355,11 @@ class DRBarController extends ControlController {
354
355
  });
355
356
  } else {
356
357
  dedrbarGroups.forEach((group) => {
357
- var _a;
358
+ var _a2;
358
359
  const groupItems = dedrctrlItems.filter(
359
360
  (item) => item.dedrbarGroupId === group.id
360
361
  );
361
- if (groupItems.length > 1 || ((_a = this.controlParams) == null ? void 0 : _a.singleitemgroup) === "true" && groupItems.length === 1) {
362
+ if (groupItems.length > 1 || ((_a2 = this.controlParams) == null ? void 0 : _a2.singleitemgroup) === "true" && groupItems.length === 1) {
362
363
  let itemCaption = group.caption;
363
364
  if (group.capLanguageRes) {
364
365
  itemCaption = ibiz.i18n.t(
@@ -509,11 +509,57 @@ function useAppGridBase(c, props) {
509
509
  }
510
510
  return state.rows.map((row) => row.data);
511
511
  });
512
+ const calcGroupColumns = (groupColumn) => {
513
+ const result = { ...groupColumn };
514
+ const columns = [];
515
+ const degridColumns = groupColumn.degridColumns || [];
516
+ degridColumns.forEach((column) => {
517
+ var _a, _b;
518
+ if (column.columnType === "GROUPGRIDCOLUMN") {
519
+ const children = calcGroupColumns(column);
520
+ if (children.degridColumns && children.degridColumns.length) {
521
+ columns.push(children);
522
+ }
523
+ } else {
524
+ const columnState = c.state.columnStates.find(
525
+ (item) => item.key === column.codeName
526
+ );
527
+ if (columnState && !columnState.hidden) {
528
+ const columnModel = ((_a = c.fieldColumns[columnState.key]) == null ? void 0 : _a.model) || ((_b = c.uaColumns[columnState.key]) == null ? void 0 : _b.model);
529
+ if (columnModel) {
530
+ columns.push(columnModel);
531
+ }
532
+ }
533
+ }
534
+ });
535
+ result.degridColumns = columns;
536
+ return result;
537
+ };
512
538
  const renderColumns = computed(() => {
539
+ const columns = [];
513
540
  if (c.isMultistageHeader) {
514
- return c.model.degridColumns || [];
541
+ const degridColumns = c.model.degridColumns || [];
542
+ degridColumns.forEach((column) => {
543
+ var _a, _b;
544
+ if (column.columnType === "GROUPGRIDCOLUMN") {
545
+ const groupColumn = calcGroupColumns(column);
546
+ if (groupColumn.degridColumns && groupColumn.degridColumns.length) {
547
+ columns.push(groupColumn);
548
+ }
549
+ } else {
550
+ const columnState = c.state.columnStates.find(
551
+ (item) => item.key === column.codeName
552
+ );
553
+ if (columnState && !columnState.hidden) {
554
+ const columnModel = ((_a = c.fieldColumns[columnState.key]) == null ? void 0 : _a.model) || ((_b = c.uaColumns[columnState.key]) == null ? void 0 : _b.model);
555
+ if (columnModel) {
556
+ columns.push(columnModel);
557
+ }
558
+ }
559
+ }
560
+ });
561
+ return columns;
515
562
  }
516
- const columns = [];
517
563
  c.state.columnStates.forEach((item) => {
518
564
  var _a, _b;
519
565
  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}
@@ -5,6 +5,7 @@ import './ibiz-checkbox-list.scss';
5
5
  *
6
6
  * @description 使用el-checkbox-group组件,通过选项框组选择多项数据,该组件通常用于绘制代码表。支持编辑器类型包含:`选项框列表`
7
7
  * @primary
8
+ * @editorparams {name:rowNumber,parameterType:number | undefined,description:设置每行呈现的多选框个数}
8
9
  * @ignoreprops autoFocus | overflowMode
9
10
  * @ignoreemits blur | focus | enter
10
11
  */
@@ -0,0 +1 @@
1
+ export * from './transfer/transfer';
@@ -0,0 +1,3 @@
1
+ export { TransferSelect } from './transfer/transfer.mjs';
2
+
3
+ "use strict";
@@ -0,0 +1,2 @@
1
+ export declare const arrowLeft: () => JSX.Element;
2
+ export declare const arrowRight: () => JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { createVNode } from 'vue';
2
+
3
+ "use strict";
4
+ const arrowLeft = () => createVNode("svg", {
5
+ "xmlns": "http://www.w3.org/2000/svg",
6
+ "viewBox": "0 0 1024 1024"
7
+ }, [createVNode("path", {
8
+ "fill": "currentColor",
9
+ "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"
10
+ }, null)]);
11
+ const arrowRight = () => createVNode("svg", {
12
+ "xmlns": "http://www.w3.org/2000/svg",
13
+ "viewBox": "0 0 1024 1024"
14
+ }, [createVNode("path", {
15
+ "fill": "currentColor",
16
+ "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"
17
+ }, null)]);
18
+
19
+ export { arrowLeft, arrowRight };
@@ -0,0 +1,99 @@
1
+ import type { ExtractPropTypes, h as H, PropType, VNode } from 'vue';
2
+ export declare const UPDATE_MODEL_EVENT = "update:modelValue";
3
+ export declare const CHANGE_EVENT = "change";
4
+ export declare const INPUT_EVENT = "input";
5
+ export declare const LEFT_CHECK_CHANGE_EVENT = "leftCheckChange";
6
+ export declare const RIGHT_CHECK_CHANGE_EVENT = "rightCheckChange";
7
+ export declare const LEFT_AC_SEARCH = "leftAcSearch";
8
+ export type TransferKey = string | number;
9
+ export type TransferDirection = 'left' | 'right';
10
+ export type renderContent = (h: typeof H, option: IData) => VNode | VNode[];
11
+ export interface TransferFormat {
12
+ noChecked?: string;
13
+ hasChecked?: string;
14
+ }
15
+ export interface TransferPropsAlias {
16
+ label?: string;
17
+ key?: string;
18
+ disabled?: string;
19
+ }
20
+ export interface TransferCheckedState {
21
+ leftChecked: TransferKey[];
22
+ rightChecked: TransferKey[];
23
+ }
24
+ export declare const transferCheckedChangeFn: (value: TransferKey[], movedKeys?: TransferKey[]) => boolean;
25
+ export declare const transferProps: {
26
+ data: {
27
+ type: PropType<import("@ibiz-template/core").IApiData>;
28
+ default: () => IData;
29
+ };
30
+ titles: {
31
+ type: PropType<string[]>;
32
+ default: () => Array<string>;
33
+ };
34
+ buttonTexts: {
35
+ type: PropType<string[]>;
36
+ default: () => Array<string>;
37
+ };
38
+ filterPlaceholder: StringConstructor;
39
+ filterMethod: {
40
+ type: PropType<(query: string, item: IData) => boolean>;
41
+ };
42
+ rightSearchMethod: {
43
+ type: PropType<(query: string) => IData[]>;
44
+ };
45
+ leftDefaultChecked: {
46
+ type: PropType<TransferKey[]>;
47
+ default: () => Array<TransferKey>;
48
+ };
49
+ rightDefaultChecked: {
50
+ type: PropType<TransferKey[]>;
51
+ default: () => Array<TransferKey>;
52
+ };
53
+ renderContent: {
54
+ type: PropType<renderContent>;
55
+ };
56
+ modelValue: {
57
+ type: PropType<TransferKey[]>;
58
+ default: () => Array<TransferKey>;
59
+ };
60
+ format: {
61
+ type: PropType<TransferFormat>;
62
+ default: () => TransferFormat;
63
+ };
64
+ filterable: BooleanConstructor;
65
+ props: {
66
+ type: PropType<TransferPropsAlias>;
67
+ default: () => TransferPropsAlias;
68
+ };
69
+ targetOrder: {
70
+ type: StringConstructor;
71
+ values: string[];
72
+ default: string;
73
+ };
74
+ enableRemoteSearch: {
75
+ type: BooleanConstructor;
76
+ default: boolean;
77
+ };
78
+ validateEvent: {
79
+ type: BooleanConstructor;
80
+ default: boolean;
81
+ };
82
+ loading: {
83
+ type: BooleanConstructor;
84
+ default: boolean;
85
+ };
86
+ readonly: {
87
+ type: BooleanConstructor;
88
+ default: boolean;
89
+ };
90
+ };
91
+ export type TransferProps = ExtractPropTypes<typeof transferProps>;
92
+ export declare const transferEmits: {
93
+ change: (value: TransferKey[], direction: TransferDirection, movedKeys: TransferKey[]) => boolean;
94
+ "update:modelValue": (value: TransferKey[]) => boolean;
95
+ leftCheckChange: (value: TransferKey[], movedKeys?: TransferKey[]) => boolean;
96
+ rightCheckChange: (value: TransferKey[], movedKeys?: TransferKey[]) => boolean;
97
+ leftAcSearch: (query: string) => string;
98
+ };
99
+ export type TransferEmits = typeof transferEmits;
@@ -0,0 +1,89 @@
1
+ import { isArray, isNil } from 'lodash-es';
2
+
3
+ "use strict";
4
+ const UPDATE_MODEL_EVENT = "update:modelValue";
5
+ const CHANGE_EVENT = "change";
6
+ const INPUT_EVENT = "input";
7
+ const LEFT_CHECK_CHANGE_EVENT = "leftCheckChange";
8
+ const RIGHT_CHECK_CHANGE_EVENT = "rightCheckChange";
9
+ const LEFT_AC_SEARCH = "leftAcSearch";
10
+ const transferCheckedChangeFn = (value, movedKeys) => [value, movedKeys].every(isArray) || isArray(value) && isNil(movedKeys);
11
+ const transferProps = {
12
+ data: {
13
+ type: Array,
14
+ default: () => []
15
+ },
16
+ titles: {
17
+ type: Array,
18
+ default: () => []
19
+ },
20
+ buttonTexts: {
21
+ type: Array,
22
+ default: () => []
23
+ },
24
+ filterPlaceholder: String,
25
+ filterMethod: {
26
+ type: Function
27
+ },
28
+ rightSearchMethod: {
29
+ type: Function
30
+ },
31
+ leftDefaultChecked: {
32
+ type: Array,
33
+ default: () => []
34
+ },
35
+ rightDefaultChecked: {
36
+ type: Array,
37
+ default: () => []
38
+ },
39
+ renderContent: {
40
+ type: Function
41
+ },
42
+ modelValue: {
43
+ type: Array,
44
+ default: () => []
45
+ },
46
+ format: {
47
+ type: Object,
48
+ default: () => ({})
49
+ },
50
+ filterable: Boolean,
51
+ props: {
52
+ type: Object,
53
+ default: () => ({
54
+ label: "label",
55
+ key: "key",
56
+ disabled: "disabled"
57
+ })
58
+ },
59
+ targetOrder: {
60
+ type: String,
61
+ values: ["original", "push", "unshift"],
62
+ default: "original"
63
+ },
64
+ enableRemoteSearch: {
65
+ type: Boolean,
66
+ default: false
67
+ },
68
+ validateEvent: {
69
+ type: Boolean,
70
+ default: true
71
+ },
72
+ loading: {
73
+ type: Boolean,
74
+ default: false
75
+ },
76
+ readonly: {
77
+ type: Boolean,
78
+ default: false
79
+ }
80
+ };
81
+ const transferEmits = {
82
+ [CHANGE_EVENT]: (value, direction, movedKeys) => [value, movedKeys].every(isArray) && ["left", "right"].includes(direction),
83
+ [UPDATE_MODEL_EVENT]: (value) => isArray(value),
84
+ [LEFT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,
85
+ [RIGHT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,
86
+ [LEFT_AC_SEARCH]: (query) => query
87
+ };
88
+
89
+ export { CHANGE_EVENT, INPUT_EVENT, LEFT_AC_SEARCH, LEFT_CHECK_CHANGE_EVENT, RIGHT_CHECK_CHANGE_EVENT, UPDATE_MODEL_EVENT, transferCheckedChangeFn, transferEmits, transferProps };
@@ -0,0 +1,17 @@
1
+ import type { ComputedRef, SetupContext } from 'vue';
2
+ import type { TransferCheckedState, TransferEmits, TransferKey, TransferProps, TransferPropsAlias } from './interface';
3
+ export declare const usePropsAlias: (props: {
4
+ props: TransferPropsAlias;
5
+ }) => ComputedRef;
6
+ export declare const useComputedData: (props: TransferProps) => {
7
+ sourceData: ComputedRef;
8
+ targetData: ComputedRef;
9
+ };
10
+ export declare const useCheckedChange: (checkedState: TransferCheckedState, emit: SetupContext<TransferEmits>['emit']) => {
11
+ onSourceCheckedChange: (val: TransferKey[], movedKeys?: TransferKey[]) => void;
12
+ onTargetCheckedChange: (val: TransferKey[], movedKeys?: TransferKey[]) => void;
13
+ };
14
+ export declare const useMove: (props: TransferProps, checkedState: TransferCheckedState, emit: SetupContext<TransferEmits>['emit']) => {
15
+ addToLeft: () => void;
16
+ addToRight: () => void;
17
+ };
@@ -0,0 +1,103 @@
1
+ import { computed } from 'vue';
2
+ import { LEFT_CHECK_CHANGE_EVENT, RIGHT_CHECK_CHANGE_EVENT, UPDATE_MODEL_EVENT, CHANGE_EVENT } from './interface.mjs';
3
+
4
+ "use strict";
5
+ const usePropsAlias = (props) => {
6
+ const initProps = {
7
+ label: "label",
8
+ key: "key",
9
+ disabled: "disabled"
10
+ };
11
+ return computed(() => ({
12
+ ...initProps,
13
+ ...props.props
14
+ }));
15
+ };
16
+ const useComputedData = (props) => {
17
+ const propsAlias = usePropsAlias(props);
18
+ const dataObj = computed(
19
+ () => props.data.reduce(
20
+ // eslint-disable-next-line no-return-assign, no-param-reassign
21
+ (o, cur) => (o[cur[propsAlias.value.key]] = cur) && o,
22
+ {}
23
+ )
24
+ );
25
+ const sourceData = computed(
26
+ () => props.data.filter(
27
+ (item) => !props.modelValue.includes(item[propsAlias.value.key])
28
+ )
29
+ );
30
+ const targetData = computed(() => {
31
+ if (props.targetOrder === "original") {
32
+ return props.data.filter(
33
+ (item) => props.modelValue.includes(item[propsAlias.value.key])
34
+ );
35
+ }
36
+ return props.modelValue.reduce((arr, cur) => {
37
+ const val = dataObj.value[cur];
38
+ if (val) {
39
+ arr.push(val);
40
+ }
41
+ return arr;
42
+ }, []);
43
+ });
44
+ return {
45
+ sourceData,
46
+ targetData
47
+ };
48
+ };
49
+ const useCheckedChange = (checkedState, emit) => {
50
+ const onSourceCheckedChange = (val, movedKeys) => {
51
+ checkedState.leftChecked = val;
52
+ if (!movedKeys)
53
+ return;
54
+ emit(LEFT_CHECK_CHANGE_EVENT, val, movedKeys);
55
+ };
56
+ const onTargetCheckedChange = (val, movedKeys) => {
57
+ checkedState.rightChecked = val;
58
+ if (!movedKeys)
59
+ return;
60
+ emit(RIGHT_CHECK_CHANGE_EVENT, val, movedKeys);
61
+ };
62
+ return {
63
+ onSourceCheckedChange,
64
+ onTargetCheckedChange
65
+ };
66
+ };
67
+ const useMove = (props, checkedState, emit) => {
68
+ const propsAlias = usePropsAlias(props);
69
+ const _emit = (value, direction, movedKeys) => {
70
+ emit(UPDATE_MODEL_EVENT, value);
71
+ emit(CHANGE_EVENT, value, direction, movedKeys);
72
+ };
73
+ const addToLeft = () => {
74
+ const currentValue = props.modelValue.slice();
75
+ checkedState.rightChecked.forEach((item) => {
76
+ const index = currentValue.indexOf(item);
77
+ if (index > -1) {
78
+ currentValue.splice(index, 1);
79
+ }
80
+ });
81
+ _emit(currentValue, "left", checkedState.rightChecked);
82
+ };
83
+ const addToRight = () => {
84
+ let currentValue = props.modelValue.slice();
85
+ const itemsToBeMoved = props.data.filter((item) => {
86
+ const itemKey = item[propsAlias.value.key];
87
+ return checkedState.leftChecked.includes(itemKey) && !props.modelValue.includes(itemKey);
88
+ }).map((item) => item[propsAlias.value.key]);
89
+ currentValue = props.targetOrder === "unshift" ? itemsToBeMoved.concat(currentValue) : currentValue.concat(itemsToBeMoved);
90
+ if (props.targetOrder === "original") {
91
+ currentValue = props.data.filter(
92
+ (item) => currentValue.includes(item[propsAlias.value.key])
93
+ ).map((item) => item[propsAlias.value.key]);
94
+ }
95
+ _emit(currentValue, "right", checkedState.leftChecked);
96
+ };
97
+ return {
98
+ addToLeft,
99
+ addToRight
100
+ };
101
+ };
102
+
103
+ export { useCheckedChange, useComputedData, useMove, usePropsAlias };
@@ -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,182 @@
1
+ import { VNode } from 'vue';
2
+ import type { TransferDirection } from './interface';
3
+ import './transfer.scss';
4
+ export declare const TransferSelect: import("vue").DefineComponent<{
5
+ data: {
6
+ type: import("vue").PropType<import("@ibiz-template/core").IApiData>;
7
+ default: () => import("@ibiz-template/core").IApiData;
8
+ };
9
+ titles: {
10
+ type: import("vue").PropType<string[]>;
11
+ default: () => string[];
12
+ };
13
+ buttonTexts: {
14
+ type: import("vue").PropType<string[]>;
15
+ default: () => string[];
16
+ };
17
+ filterPlaceholder: StringConstructor;
18
+ filterMethod: {
19
+ type: import("vue").PropType<(query: string, item: import("@ibiz-template/core").IApiData) => boolean>;
20
+ };
21
+ rightSearchMethod: {
22
+ type: import("vue").PropType<(query: string) => import("@ibiz-template/core").IApiData[]>;
23
+ };
24
+ leftDefaultChecked: {
25
+ type: import("vue").PropType<import("./interface").TransferKey[]>;
26
+ default: () => import("./interface").TransferKey[];
27
+ };
28
+ rightDefaultChecked: {
29
+ type: import("vue").PropType<import("./interface").TransferKey[]>;
30
+ default: () => import("./interface").TransferKey[];
31
+ };
32
+ renderContent: {
33
+ type: import("vue").PropType<import("./interface").renderContent>;
34
+ };
35
+ modelValue: {
36
+ type: import("vue").PropType<import("./interface").TransferKey[]>;
37
+ default: () => import("./interface").TransferKey[];
38
+ };
39
+ format: {
40
+ type: import("vue").PropType<import("./interface").TransferFormat>;
41
+ default: () => import("./interface").TransferFormat;
42
+ };
43
+ filterable: BooleanConstructor;
44
+ props: {
45
+ type: import("vue").PropType<import("./interface").TransferPropsAlias>;
46
+ default: () => import("./interface").TransferPropsAlias;
47
+ };
48
+ targetOrder: {
49
+ type: StringConstructor;
50
+ values: string[];
51
+ default: string;
52
+ };
53
+ enableRemoteSearch: {
54
+ type: BooleanConstructor;
55
+ default: boolean;
56
+ };
57
+ validateEvent: {
58
+ type: BooleanConstructor;
59
+ default: boolean;
60
+ };
61
+ loading: {
62
+ type: BooleanConstructor;
63
+ default: boolean;
64
+ };
65
+ readonly: {
66
+ type: BooleanConstructor;
67
+ default: boolean;
68
+ };
69
+ }, {
70
+ ns: import("@ibiz-template/core").Namespace;
71
+ targetData: import("vue").ComputedRef<any>;
72
+ rightPanelTitle: import("vue").ComputedRef<string>;
73
+ optionRender: import("vue").ComputedRef<(option: IData) => VNode | VNode[]>;
74
+ panelFilterPlaceholder: import("vue").ComputedRef<string>;
75
+ leftPanelTitle: import("vue").ComputedRef<string>;
76
+ sourceData: import("vue").ComputedRef<any>;
77
+ leftPanel: import("vue").Ref<any>;
78
+ rightPanel: import("vue").Ref<any>;
79
+ hasButtonTexts: import("vue").ComputedRef<boolean>;
80
+ checkedState: {
81
+ leftChecked: import("./interface").TransferKey[];
82
+ rightChecked: import("./interface").TransferKey[];
83
+ };
84
+ addToLeft: () => void;
85
+ addToRight: () => void;
86
+ clearQuery: (which: TransferDirection) => void;
87
+ onLeftAcSearch: (query: string) => void;
88
+ onSourceCheckedChange: (val: import("./interface").TransferKey[], movedKeys?: import("./interface").TransferKey[] | undefined) => void;
89
+ onTargetCheckedChange: (val: import("./interface").TransferKey[], movedKeys?: import("./interface").TransferKey[] | undefined) => void;
90
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
91
+ change: (value: import("./interface").TransferKey[], direction: TransferDirection, movedKeys: import("./interface").TransferKey[]) => boolean;
92
+ "update:modelValue": (value: import("./interface").TransferKey[]) => boolean;
93
+ leftCheckChange: (value: import("./interface").TransferKey[], movedKeys?: import("./interface").TransferKey[] | undefined) => boolean;
94
+ rightCheckChange: (value: import("./interface").TransferKey[], movedKeys?: import("./interface").TransferKey[] | undefined) => boolean;
95
+ leftAcSearch: (query: string) => string;
96
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
97
+ data: {
98
+ type: import("vue").PropType<import("@ibiz-template/core").IApiData>;
99
+ default: () => import("@ibiz-template/core").IApiData;
100
+ };
101
+ titles: {
102
+ type: import("vue").PropType<string[]>;
103
+ default: () => string[];
104
+ };
105
+ buttonTexts: {
106
+ type: import("vue").PropType<string[]>;
107
+ default: () => string[];
108
+ };
109
+ filterPlaceholder: StringConstructor;
110
+ filterMethod: {
111
+ type: import("vue").PropType<(query: string, item: import("@ibiz-template/core").IApiData) => boolean>;
112
+ };
113
+ rightSearchMethod: {
114
+ type: import("vue").PropType<(query: string) => import("@ibiz-template/core").IApiData[]>;
115
+ };
116
+ leftDefaultChecked: {
117
+ type: import("vue").PropType<import("./interface").TransferKey[]>;
118
+ default: () => import("./interface").TransferKey[];
119
+ };
120
+ rightDefaultChecked: {
121
+ type: import("vue").PropType<import("./interface").TransferKey[]>;
122
+ default: () => import("./interface").TransferKey[];
123
+ };
124
+ renderContent: {
125
+ type: import("vue").PropType<import("./interface").renderContent>;
126
+ };
127
+ modelValue: {
128
+ type: import("vue").PropType<import("./interface").TransferKey[]>;
129
+ default: () => import("./interface").TransferKey[];
130
+ };
131
+ format: {
132
+ type: import("vue").PropType<import("./interface").TransferFormat>;
133
+ default: () => import("./interface").TransferFormat;
134
+ };
135
+ filterable: BooleanConstructor;
136
+ props: {
137
+ type: import("vue").PropType<import("./interface").TransferPropsAlias>;
138
+ default: () => import("./interface").TransferPropsAlias;
139
+ };
140
+ targetOrder: {
141
+ type: StringConstructor;
142
+ values: string[];
143
+ default: string;
144
+ };
145
+ enableRemoteSearch: {
146
+ type: BooleanConstructor;
147
+ default: boolean;
148
+ };
149
+ validateEvent: {
150
+ type: BooleanConstructor;
151
+ default: boolean;
152
+ };
153
+ loading: {
154
+ type: BooleanConstructor;
155
+ default: boolean;
156
+ };
157
+ readonly: {
158
+ type: BooleanConstructor;
159
+ default: boolean;
160
+ };
161
+ }>> & {
162
+ onChange?: ((value: import("./interface").TransferKey[], direction: TransferDirection, movedKeys: import("./interface").TransferKey[]) => any) | undefined;
163
+ "onUpdate:modelValue"?: ((value: import("./interface").TransferKey[]) => any) | undefined;
164
+ onLeftCheckChange?: ((value: import("./interface").TransferKey[], movedKeys?: import("./interface").TransferKey[] | undefined) => any) | undefined;
165
+ onRightCheckChange?: ((value: import("./interface").TransferKey[], movedKeys?: import("./interface").TransferKey[] | undefined) => any) | undefined;
166
+ onLeftAcSearch?: ((query: string) => any) | undefined;
167
+ }, {
168
+ props: import("./interface").TransferPropsAlias;
169
+ data: import("@ibiz-template/core").IApiData;
170
+ loading: boolean;
171
+ modelValue: import("./interface").TransferKey[];
172
+ readonly: boolean;
173
+ format: import("./interface").TransferFormat;
174
+ titles: string[];
175
+ buttonTexts: string[];
176
+ leftDefaultChecked: import("./interface").TransferKey[];
177
+ rightDefaultChecked: import("./interface").TransferKey[];
178
+ filterable: boolean;
179
+ targetOrder: string;
180
+ enableRemoteSearch: boolean;
181
+ validateEvent: boolean;
182
+ }, {}>;