@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
|
@@ -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
|
+
}, {}>;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { reactive, ref, computed, h, createVNode, resolveComponent, defineComponent } from 'vue';
|
|
2
|
+
import { isEmpty } from 'ramda';
|
|
3
|
+
import { useNamespace } from '@ibiz-template/vue3-util';
|
|
4
|
+
import { usePropsAlias, useComputedData, useCheckedChange, useMove } from './transfer-util.mjs';
|
|
5
|
+
import { transferProps, transferEmits } from './interface.mjs';
|
|
6
|
+
import { TransferPanel } from '../transfer-panel/transfer-panel.mjs';
|
|
7
|
+
import { arrowLeft, arrowRight } from './icon.mjs';
|
|
8
|
+
import './transfer.css';
|
|
9
|
+
|
|
10
|
+
"use strict";
|
|
11
|
+
const TransferSelect = /* @__PURE__ */ defineComponent({
|
|
12
|
+
name: "IBizTransfer",
|
|
13
|
+
props: transferProps,
|
|
14
|
+
emits: transferEmits,
|
|
15
|
+
setup(props, {
|
|
16
|
+
emit,
|
|
17
|
+
slots
|
|
18
|
+
}) {
|
|
19
|
+
const ns = useNamespace("transfer");
|
|
20
|
+
const checkedState = reactive({
|
|
21
|
+
leftChecked: [],
|
|
22
|
+
rightChecked: []
|
|
23
|
+
});
|
|
24
|
+
const propsAlias = usePropsAlias(props);
|
|
25
|
+
const {
|
|
26
|
+
sourceData,
|
|
27
|
+
targetData
|
|
28
|
+
} = useComputedData(props);
|
|
29
|
+
const {
|
|
30
|
+
onSourceCheckedChange,
|
|
31
|
+
onTargetCheckedChange
|
|
32
|
+
} = useCheckedChange(checkedState, emit);
|
|
33
|
+
const {
|
|
34
|
+
addToLeft,
|
|
35
|
+
addToRight
|
|
36
|
+
} = useMove(props, checkedState, emit);
|
|
37
|
+
const leftPanel = ref();
|
|
38
|
+
const rightPanel = ref();
|
|
39
|
+
const clearQuery = (which) => {
|
|
40
|
+
switch (which) {
|
|
41
|
+
case "left":
|
|
42
|
+
leftPanel.value.query = "";
|
|
43
|
+
break;
|
|
44
|
+
case "right":
|
|
45
|
+
rightPanel.value.query = "";
|
|
46
|
+
break;
|
|
47
|
+
default:
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const onLeftAcSearch = (query) => {
|
|
52
|
+
emit("leftAcSearch", query);
|
|
53
|
+
};
|
|
54
|
+
const hasButtonTexts = computed(() => props.buttonTexts.length === 2);
|
|
55
|
+
const leftPanelTitle = computed(() => props.titles[0] || "\u53EF\u9009\u5217\u8868");
|
|
56
|
+
const rightPanelTitle = computed(() => props.titles[1] || "\u5DF2\u9009\u5217\u8868");
|
|
57
|
+
const panelFilterPlaceholder = computed(() => props.filterPlaceholder || "\u8BF7\u8F93\u5165");
|
|
58
|
+
const optionRender = computed(() => (option) => {
|
|
59
|
+
var _a;
|
|
60
|
+
if (props.renderContent)
|
|
61
|
+
return props.renderContent(h, option);
|
|
62
|
+
const defaultSlotVNodes = (((_a = slots.default) == null ? void 0 : _a.call(slots, {
|
|
63
|
+
option
|
|
64
|
+
})) || []).filter((node) => node.type !== Comment);
|
|
65
|
+
if (defaultSlotVNodes.length) {
|
|
66
|
+
return defaultSlotVNodes;
|
|
67
|
+
}
|
|
68
|
+
return h("span", option[propsAlias.value.label] || option[propsAlias.value.key]);
|
|
69
|
+
});
|
|
70
|
+
return {
|
|
71
|
+
ns,
|
|
72
|
+
targetData,
|
|
73
|
+
rightPanelTitle,
|
|
74
|
+
optionRender,
|
|
75
|
+
panelFilterPlaceholder,
|
|
76
|
+
leftPanelTitle,
|
|
77
|
+
sourceData,
|
|
78
|
+
leftPanel,
|
|
79
|
+
rightPanel,
|
|
80
|
+
hasButtonTexts,
|
|
81
|
+
checkedState,
|
|
82
|
+
addToLeft,
|
|
83
|
+
addToRight,
|
|
84
|
+
clearQuery,
|
|
85
|
+
onLeftAcSearch,
|
|
86
|
+
onSourceCheckedChange,
|
|
87
|
+
onTargetCheckedChange
|
|
88
|
+
};
|
|
89
|
+
},
|
|
90
|
+
render() {
|
|
91
|
+
return createVNode("div", {
|
|
92
|
+
"class": this.ns.b()
|
|
93
|
+
}, [createVNode(TransferPanel, {
|
|
94
|
+
"ref": "leftPanel",
|
|
95
|
+
"data": this.sourceData,
|
|
96
|
+
"readonly": this.readonly,
|
|
97
|
+
"optionRender": this.optionRender,
|
|
98
|
+
"placeholder": this.panelFilterPlaceholder,
|
|
99
|
+
"title": this.leftPanelTitle,
|
|
100
|
+
"filterable": this.filterable,
|
|
101
|
+
"format": this.format,
|
|
102
|
+
"enableAcSearch": this.enableRemoteSearch,
|
|
103
|
+
"loading": this.loading,
|
|
104
|
+
"filterMethod": this.filterMethod,
|
|
105
|
+
"defaultChecked": this.leftDefaultChecked,
|
|
106
|
+
"onAcSearch": this.onLeftAcSearch,
|
|
107
|
+
"props": this.props,
|
|
108
|
+
"onCheckedChange": this.onSourceCheckedChange
|
|
109
|
+
}, null), createVNode("div", {
|
|
110
|
+
"class": this.ns.e("buttons")
|
|
111
|
+
}, [createVNode(resolveComponent("el-button"), {
|
|
112
|
+
"class": [this.ns.e("button"), this.ns.is("with-texts", this.hasButtonTexts)],
|
|
113
|
+
"type": "primary",
|
|
114
|
+
"disabled": !!isEmpty(this.checkedState.rightChecked) || this.readonly,
|
|
115
|
+
"onClick": this.addToLeft
|
|
116
|
+
}, {
|
|
117
|
+
default: () => [createVNode(resolveComponent("el-icon"), null, {
|
|
118
|
+
default: () => arrowLeft()
|
|
119
|
+
}), this.buttonTexts[0] !== void 0 ? createVNode("span", null, [this.buttonTexts[0]]) : null]
|
|
120
|
+
}), createVNode(resolveComponent("el-button"), {
|
|
121
|
+
"class": [this.ns.e("button"), this.ns.is("with-texts", this.hasButtonTexts)],
|
|
122
|
+
"type": "primary",
|
|
123
|
+
"disabled": !!isEmpty(this.checkedState.leftChecked) || this.readonly,
|
|
124
|
+
"onClick": this.addToRight
|
|
125
|
+
}, {
|
|
126
|
+
default: () => [this.buttonTexts[1] !== void 0 ? createVNode("span", null, [this.buttonTexts[1]]) : null, createVNode(resolveComponent("el-icon"), null, {
|
|
127
|
+
default: () => arrowRight()
|
|
128
|
+
})]
|
|
129
|
+
})]), createVNode(TransferPanel, {
|
|
130
|
+
"ref": "rightPanel",
|
|
131
|
+
"data": this.targetData,
|
|
132
|
+
"readonly": this.readonly,
|
|
133
|
+
"optionRender": this.optionRender,
|
|
134
|
+
"placeholder": this.panelFilterPlaceholder,
|
|
135
|
+
"filterable": this.filterable,
|
|
136
|
+
"format": this.format,
|
|
137
|
+
"filterMethod": this.filterMethod,
|
|
138
|
+
"title": this.rightPanelTitle,
|
|
139
|
+
"defaultChecked": this.rightDefaultChecked,
|
|
140
|
+
"props": this.props,
|
|
141
|
+
"onCheckedChange": this.onTargetCheckedChange
|
|
142
|
+
}, null)]);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
export { TransferSelect };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Search: () => JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createVNode } from 'vue';
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
const Search = () => createVNode("svg", {
|
|
5
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
6
|
+
"viewBox": "0 0 1024 1024"
|
|
7
|
+
}, [createVNode("path", {
|
|
8
|
+
"fill": "currentColor",
|
|
9
|
+
"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"
|
|
10
|
+
}, null)]);
|
|
11
|
+
|
|
12
|
+
export { Search };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ExtractPropTypes, PropType, VNode } from 'vue';
|
|
2
|
+
import { TransferFormat } from '../transfer/interface';
|
|
3
|
+
export declare const CHECKED_CHANGE_EVENT = "checkedChange";
|
|
4
|
+
export declare const AC_SEARCH = "acSearch";
|
|
5
|
+
export type TransferKey = string | number;
|
|
6
|
+
export interface TransferPanelState {
|
|
7
|
+
checked: TransferKey[];
|
|
8
|
+
allChecked: boolean;
|
|
9
|
+
query: string;
|
|
10
|
+
checkChangeByUser: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface TransferPropsAlias {
|
|
13
|
+
label?: string;
|
|
14
|
+
key?: string;
|
|
15
|
+
disabled?: string;
|
|
16
|
+
}
|
|
17
|
+
export type CheckboxValueType = string | number | boolean;
|
|
18
|
+
export declare const transferCheckedChangeFn: (value: TransferKey[], movedKeys?: TransferKey[]) => boolean;
|
|
19
|
+
export declare const transferPanelProps: {
|
|
20
|
+
data: {
|
|
21
|
+
type: PropType<import("@ibiz-template/core").IApiData>;
|
|
22
|
+
default: () => IData;
|
|
23
|
+
};
|
|
24
|
+
optionRender: {
|
|
25
|
+
type: PropType<(option: IData) => VNode | VNode[]>;
|
|
26
|
+
};
|
|
27
|
+
placeholder: StringConstructor;
|
|
28
|
+
title: StringConstructor;
|
|
29
|
+
filterable: BooleanConstructor;
|
|
30
|
+
enableAcSearch: BooleanConstructor;
|
|
31
|
+
format: {
|
|
32
|
+
type: PropType<TransferFormat>;
|
|
33
|
+
default: () => TransferFormat;
|
|
34
|
+
};
|
|
35
|
+
filterMethod: {
|
|
36
|
+
type: PropType<(query: string, item: IData) => boolean>;
|
|
37
|
+
};
|
|
38
|
+
defaultChecked: {
|
|
39
|
+
type: PropType<TransferKey[]>;
|
|
40
|
+
default: () => Array<TransferKey>;
|
|
41
|
+
};
|
|
42
|
+
props: {
|
|
43
|
+
type: PropType<TransferPropsAlias>;
|
|
44
|
+
default: () => TransferPropsAlias;
|
|
45
|
+
};
|
|
46
|
+
loading: {
|
|
47
|
+
type: BooleanConstructor;
|
|
48
|
+
default: boolean;
|
|
49
|
+
};
|
|
50
|
+
readonly: {
|
|
51
|
+
type: BooleanConstructor;
|
|
52
|
+
default: boolean;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export type TransferPanelProps = ExtractPropTypes<typeof transferPanelProps>;
|
|
56
|
+
export declare const transferPanelEmits: {
|
|
57
|
+
checkedChange: (value: TransferKey[], movedKeys?: TransferKey[]) => boolean;
|
|
58
|
+
acSearch: (query: string) => string;
|
|
59
|
+
};
|
|
60
|
+
export type TransferPanelEmits = typeof transferPanelEmits;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { isArray, isNil } from 'lodash-es';
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
const CHECKED_CHANGE_EVENT = "checkedChange";
|
|
5
|
+
const AC_SEARCH = "acSearch";
|
|
6
|
+
const transferCheckedChangeFn = (value, movedKeys) => [value, movedKeys].every(isArray) || isArray(value) && isNil(movedKeys);
|
|
7
|
+
const transferPanelProps = {
|
|
8
|
+
data: {
|
|
9
|
+
type: Array,
|
|
10
|
+
default: () => []
|
|
11
|
+
},
|
|
12
|
+
optionRender: {
|
|
13
|
+
type: Function
|
|
14
|
+
},
|
|
15
|
+
placeholder: String,
|
|
16
|
+
title: String,
|
|
17
|
+
filterable: Boolean,
|
|
18
|
+
enableAcSearch: Boolean,
|
|
19
|
+
format: {
|
|
20
|
+
type: Object,
|
|
21
|
+
default: () => ({})
|
|
22
|
+
},
|
|
23
|
+
filterMethod: {
|
|
24
|
+
type: Function
|
|
25
|
+
},
|
|
26
|
+
defaultChecked: {
|
|
27
|
+
type: Array,
|
|
28
|
+
default: () => []
|
|
29
|
+
},
|
|
30
|
+
props: {
|
|
31
|
+
type: Object,
|
|
32
|
+
default: () => ({
|
|
33
|
+
label: "label",
|
|
34
|
+
key: "key",
|
|
35
|
+
disabled: "disabled"
|
|
36
|
+
})
|
|
37
|
+
},
|
|
38
|
+
loading: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
42
|
+
readonly: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const transferPanelEmits = {
|
|
48
|
+
[CHECKED_CHANGE_EVENT]: transferCheckedChangeFn,
|
|
49
|
+
[AC_SEARCH]: (query) => query
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export { AC_SEARCH, CHECKED_CHANGE_EVENT, transferCheckedChangeFn, transferPanelEmits, transferPanelProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComputedRef, SetupContext, Ref } from 'vue';
|
|
2
|
+
import { CheckboxValueType, TransferPanelEmits, TransferPanelProps, TransferPanelState, TransferPropsAlias } from './interface';
|
|
3
|
+
export declare const usePropsAlias: (props: {
|
|
4
|
+
props: TransferPropsAlias;
|
|
5
|
+
}) => ComputedRef;
|
|
6
|
+
export declare const useCheck: (props: TransferPanelProps, panelState: TransferPanelState, emit: SetupContext<TransferPanelEmits>['emit']) => {
|
|
7
|
+
filteredData: Ref;
|
|
8
|
+
checkableData: ComputedRef;
|
|
9
|
+
checkedSummary: ComputedRef;
|
|
10
|
+
isIndeterminate: ComputedRef;
|
|
11
|
+
onInputChange: (value: string) => void;
|
|
12
|
+
updateAllChecked: () => void;
|
|
13
|
+
handleAllCheckedChange: (value: CheckboxValueType) => void;
|
|
14
|
+
};
|
package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel-util.mjs
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { computed, ref, watch } from 'vue';
|
|
2
|
+
import { isFunction } from 'lodash-es';
|
|
3
|
+
import { CHECKED_CHANGE_EVENT } from './interface.mjs';
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
const usePropsAlias = (props) => {
|
|
7
|
+
const initProps = {
|
|
8
|
+
label: "label",
|
|
9
|
+
key: "key",
|
|
10
|
+
disabled: "disabled"
|
|
11
|
+
};
|
|
12
|
+
return computed(() => ({
|
|
13
|
+
...initProps,
|
|
14
|
+
...props.props
|
|
15
|
+
}));
|
|
16
|
+
};
|
|
17
|
+
const useCheck = (props, panelState, emit) => {
|
|
18
|
+
const propsAlias = usePropsAlias(props);
|
|
19
|
+
const filteredData = ref([]);
|
|
20
|
+
const checkableData = computed(
|
|
21
|
+
() => filteredData.value.filter((item) => {
|
|
22
|
+
return !item[propsAlias.value.disabled];
|
|
23
|
+
})
|
|
24
|
+
);
|
|
25
|
+
const checkedSummary = computed(() => {
|
|
26
|
+
const checkedLength = panelState.checked.length;
|
|
27
|
+
const dataLength = props.data.length;
|
|
28
|
+
const { noChecked, hasChecked } = props.format;
|
|
29
|
+
if (noChecked && hasChecked) {
|
|
30
|
+
return checkedLength > 0 ? hasChecked.replace(/\${checked}/g, checkedLength.toString()).replace(/\${total}/g, dataLength.toString()) : noChecked.replace(/\${total}/g, dataLength.toString());
|
|
31
|
+
}
|
|
32
|
+
return "".concat(checkedLength, "/").concat(dataLength);
|
|
33
|
+
});
|
|
34
|
+
const isIndeterminate = computed(() => {
|
|
35
|
+
const checkedLength = panelState.checked.length;
|
|
36
|
+
return checkedLength > 0 && checkedLength < checkableData.value.length;
|
|
37
|
+
});
|
|
38
|
+
const handleFilteredData = (value = "") => {
|
|
39
|
+
filteredData.value = props.data.filter((item) => {
|
|
40
|
+
if (isFunction(props.filterMethod)) {
|
|
41
|
+
return props.filterMethod(value, item);
|
|
42
|
+
}
|
|
43
|
+
const label = String(
|
|
44
|
+
item[propsAlias.value.label] || item[propsAlias.value.key]
|
|
45
|
+
);
|
|
46
|
+
return label.toLowerCase().includes(value.toLowerCase());
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
const onInputChange = async (value) => {
|
|
50
|
+
if (props.enableAcSearch) {
|
|
51
|
+
emit("acSearch", value);
|
|
52
|
+
} else {
|
|
53
|
+
handleFilteredData(value);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const updateAllChecked = () => {
|
|
57
|
+
const checkableDataKeys = checkableData.value.map(
|
|
58
|
+
(item) => item[propsAlias.value.key]
|
|
59
|
+
);
|
|
60
|
+
panelState.allChecked = checkableDataKeys.length > 0 && checkableDataKeys.every(
|
|
61
|
+
(item) => panelState.checked.includes(item)
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
const handleAllCheckedChange = (value) => {
|
|
65
|
+
panelState.checked = value ? checkableData.value.map((item) => item[propsAlias.value.key]) : [];
|
|
66
|
+
};
|
|
67
|
+
watch(
|
|
68
|
+
() => panelState.checked,
|
|
69
|
+
(val, oldVal) => {
|
|
70
|
+
updateAllChecked();
|
|
71
|
+
if (panelState.checkChangeByUser) {
|
|
72
|
+
const movedKeys = val.concat(oldVal).filter((v) => !val.includes(v) || !oldVal.includes(v));
|
|
73
|
+
emit(CHECKED_CHANGE_EVENT, val, movedKeys);
|
|
74
|
+
} else {
|
|
75
|
+
emit(CHECKED_CHANGE_EVENT, val);
|
|
76
|
+
panelState.checkChangeByUser = true;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
watch(checkableData, () => {
|
|
81
|
+
updateAllChecked();
|
|
82
|
+
});
|
|
83
|
+
watch(
|
|
84
|
+
() => props.data,
|
|
85
|
+
() => {
|
|
86
|
+
handleFilteredData(panelState.query);
|
|
87
|
+
const checked = [];
|
|
88
|
+
const filteredDataKeys = filteredData.value.map(
|
|
89
|
+
(item) => item[propsAlias.value.key]
|
|
90
|
+
);
|
|
91
|
+
panelState.checked.forEach((item) => {
|
|
92
|
+
if (filteredDataKeys.includes(item)) {
|
|
93
|
+
checked.push(item);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
panelState.checkChangeByUser = false;
|
|
97
|
+
panelState.checked = checked;
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
watch(
|
|
101
|
+
() => props.defaultChecked,
|
|
102
|
+
(val) => {
|
|
103
|
+
const checked = [];
|
|
104
|
+
const checkableDataKeys = props.data.map(
|
|
105
|
+
(item) => item[propsAlias.value.key]
|
|
106
|
+
);
|
|
107
|
+
val.forEach((item) => {
|
|
108
|
+
if (checkableDataKeys.includes(item)) {
|
|
109
|
+
checked.push(item);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
panelState.checkChangeByUser = false;
|
|
113
|
+
panelState.checked = checked;
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
immediate: true
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
return {
|
|
120
|
+
filteredData,
|
|
121
|
+
checkableData,
|
|
122
|
+
checkedSummary,
|
|
123
|
+
isIndeterminate,
|
|
124
|
+
onInputChange,
|
|
125
|
+
updateAllChecked,
|
|
126
|
+
handleAllCheckedChange
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export { useCheck, usePropsAlias };
|
package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-transfer-panel{--ibiz-transfer-panel-border-color:var(--ibiz-editor-default-border-color);--ibiz-transfer-panel-border-radius:var(--ibiz-border-radius-extra-small);--ibiz-transfer-panel-width:200px;--ibiz-transfer-panel-header-height:40px;--ibiz-transfer-panel-header-bg-color:var(--ibiz-color-fill-0);--ibiz-transfer-panel-footer-height:40px;--ibiz-transfer-panel-body-height:278px;--ibiz-transfer-panel-item-height:30px;--ibiz-transfer-panel-filter-height:32px;--ibiz-transfer-panel-spacing-base:var(--ibiz-spacing-base);position:relative;box-sizing:border-box;display:inline-block;width:var(--ibiz-transfer-panel-width);max-height:100%;overflow:hidden;text-align:left;vertical-align:middle;background:var(--ibiz-color-bg-2)}.ibiz-transfer-panel__header{box-sizing:border-box;display:flex;align-items:center;height:var(--ibiz-transfer-panel-header-height);padding-left:var(--ibiz-transfer-panel-spacing-base);margin:0;color:var(--ibiz-color-text-1);background:var(--ibiz-transfer-panel-header-bg-color);border:1px solid var(--ibiz-transfer-panel-border-color);border-top-left-radius:var(--ibiz-transfer-panel-border-radius);border-top-right-radius:var(--ibiz-transfer-panel-border-radius)}.ibiz-transfer-panel__header .el-checkbox{position:relative;display:flex;align-items:center;width:100%}.ibiz-transfer-panel__header .el-checkbox .el-checkbox__label{font-size:var(--ibiz-font-size-header-5);font-weight:400;color:var(--ibiz-color-text-1)}.ibiz-transfer-panel__header .el-checkbox .el-checkbox__label span{position:absolute;top:50%;right:var(--ibiz-transfer-panel-spacing-base);font-size:var(--ibiz-font-size-regular);font-weight:400;color:var(--ibiz-color-text-3);transform:translate3d(0,-50%,0)}.ibiz-transfer-panel__body{height:var(--ibiz-transfer-panel-body-height);overflow:hidden;border-right:1px solid var(--ibiz-transfer-panel-border-color);border-bottom:1px solid var(--ibiz-transfer-panel-border-color);border-left:1px solid var(--ibiz-transfer-panel-border-color);border-bottom-right-radius:var(--ibiz-transfer-panel-border-radius);border-bottom-left-radius:var(--ibiz-transfer-panel-border-radius)}.ibiz-transfer-panel__filter{--el-input-height:var(--ibiz-transfer-panel-filter-height);box-sizing:border-box;padding:var(--ibiz-transfer-panel-spacing-base);text-align:center}.ibiz-transfer-panel__filter .el-icon{font-size:inherit}.ibiz-transfer-panel__content{width:100%;height:var(--ibiz-transfer-panel-body-height);padding:6px 0}.ibiz-transfer-panel__content.is-filterable{height:calc(100% - var(--ibiz-transfer-panel-filter-height) - var(--ibiz-transfer-panel-spacing-base) * 2);padding-top:0}.ibiz-transfer-panel__list{box-sizing:border-box;height:100%;margin:0;overflow:auto;list-style:none}.ibiz-transfer-panel__item{height:var(--ibiz-transfer-panel-item-height);padding-left:var(--ibiz-transfer-panel-spacing-base);line-height:var(--ibiz-transfer-panel-item-height)}.ibiz-transfer-panel__item.el-checkbox{--el-checkbox-font-size:var(--ibiz-font-size-regular);display:flex;align-items:center;color:var(--ibiz-color-text-0)}.ibiz-transfer-panel__item.el-checkbox .el-checkbox__label{box-sizing:border-box;display:block;width:100%;padding-left:22px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ibiz-transfer-panel__item .el-checkbox__input{position:absolute}.ibiz-transfer-panel__empty{padding:6px 15px 0;margin:0;text-align:center}.ibiz-transfer-panel__empty .ibiz-no-data.el-empty{justify-content:flex-start;padding:0}.ibiz-transfer-panel__empty .ibiz-no-data .el-empty__image{width:52px}.ibiz-transfer-panel .el-checkbox__inner{width:1em;height:1em;border-radius:3px}.ibiz-transfer-panel .el-checkbox__label{padding-left:var(--ibiz-spacing-tight)}
|