@veltra/desktop 1.7.19 → 1.8.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/components/batch-edit/batch-edit-form.js +40 -26
- package/dist/components/batch-edit/batch-edit-form.js.map +1 -1
- package/dist/components/batch-edit/use-handlers.js +3 -3
- package/dist/components/batch-edit/use-handlers.js.map +1 -1
- package/dist/components/batch-edit/use-shortcut-key.js +4 -2
- package/dist/components/batch-edit/use-shortcut-key.js.map +1 -1
- package/dist/components/card/style2.css +0 -2
- package/dist/components/condition-editor/condition-editor.js +8 -2
- package/dist/components/condition-editor/condition-editor.js.map +1 -1
- package/dist/components/dropdown/dropdown.js +5 -3
- package/dist/components/dropdown/dropdown.js.map +1 -1
- package/dist/components/expression-editor/components/path-preview.js +3 -6
- package/dist/components/expression-editor/components/path-preview.js.map +1 -1
- package/dist/components/expression-editor/components/variable-picker.js +49 -12
- package/dist/components/expression-editor/components/variable-picker.js.map +1 -1
- package/dist/components/expression-editor/core/editor.js +42 -0
- package/dist/components/expression-editor/core/editor.js.map +1 -1
- package/dist/components/expression-editor/expression-editor.js +68 -22
- package/dist/components/expression-editor/expression-editor.js.map +1 -1
- package/dist/components/expression-editor/style2.css +135 -73
- package/dist/components/form/form.js.map +1 -1
- package/dist/components/form/form.vue_vue_type_script_setup_true_lang.js +0 -1
- package/dist/components/form/form.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/form/style2.css +8 -3
- package/dist/components/form-item/style2.css +14 -0
- package/dist/components/index.d.ts +27 -26
- package/dist/components/index.js +54 -52
- package/dist/components/index.js.map +1 -1
- package/dist/components/kanban/di.js +7 -0
- package/dist/components/kanban/di.js.map +1 -0
- package/dist/components/kanban/kanban-column.js +67 -0
- package/dist/components/kanban/kanban-column.js.map +1 -0
- package/dist/components/kanban/kanban.js +89 -0
- package/dist/components/kanban/kanban.js.map +1 -0
- package/dist/components/kanban/style.d.ts +1 -0
- package/dist/components/kanban/style.js +1 -0
- package/dist/components/kanban/style2.css +128 -0
- package/dist/components/multi-select/multi-select.js +16 -12
- package/dist/components/multi-select/multi-select.js.map +1 -1
- package/dist/components/multi-select/style2.css +7 -0
- package/dist/components/multi-tree-select/multi-tree-select.js +82 -56
- package/dist/components/multi-tree-select/multi-tree-select.js.map +1 -1
- package/dist/components/multi-tree-select/style2.css +7 -0
- package/dist/components/rich-text-editor/image-node.js +154 -0
- package/dist/components/rich-text-editor/image-node.js.map +1 -0
- package/dist/components/rich-text-editor/rich-text-editor.js +80 -22
- package/dist/components/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/components/rich-text-editor/style2.css +6 -0
- package/dist/components/rich-text-editor/toolbar.js +22 -2
- package/dist/components/rich-text-editor/toolbar.js.map +1 -1
- package/dist/components/select/select.js +7 -3
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/select/style2.css +7 -0
- package/dist/components/select/use-options.js +14 -3
- package/dist/components/select/use-options.js.map +1 -1
- package/dist/components/tree-select/style2.css +7 -0
- package/dist/components/tree-select/tree-select.js +49 -17
- package/dist/components/tree-select/tree-select.js.map +1 -1
- package/dist/index.d.ts +48 -46
- package/dist/index.js +47 -46
- package/dist/types/dropdown.d.ts +10 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/kanban.d.ts +69 -0
- package/dist/types/multi-tree-select.d.ts +7 -1
- package/dist/types/rich-text-editor.d.ts +13 -2
- package/dist/types/tree-select.d.ts +7 -1
- package/package.json +1 -1
- package/src/components/batch-edit/__test__/batch-edit.test.ts +112 -1
- package/src/components/batch-edit/batch-edit-form.vue +21 -2
- package/src/components/batch-edit/use-handlers.ts +6 -5
- package/src/components/batch-edit/use-shortcut-key.ts +5 -2
- package/src/components/card/style.scss +0 -2
- package/src/components/condition-editor/__test__/condition-editor.test.ts +61 -0
- package/src/components/condition-editor/condition-editor.vue +6 -1
- package/src/components/dropdown/dropdown.vue +9 -4
- package/src/components/expression-editor/__test__/editor.test.ts +66 -0
- package/src/components/expression-editor/__test__/expression-editor.test.ts +124 -0
- package/src/components/expression-editor/components/path-preview.vue +1 -2
- package/src/components/expression-editor/components/variable-picker.vue +54 -13
- package/src/components/expression-editor/core/editor.ts +61 -0
- package/src/components/expression-editor/expression-editor.vue +58 -20
- package/src/components/expression-editor/style.scss +160 -76
- package/src/components/form/form.vue +0 -1
- package/src/components/form/style.scss +11 -4
- package/src/components/form-item/style.scss +16 -1
- package/src/components/index.ts +2 -0
- package/src/components/kanban/__test__/kanban.test.ts +212 -0
- package/src/components/kanban/di.ts +19 -0
- package/src/components/kanban/index.ts +1 -0
- package/src/components/kanban/kanban-column.vue +77 -0
- package/src/components/kanban/kanban.vue +81 -0
- package/src/components/kanban/style.scss +124 -0
- package/src/components/kanban/style.ts +1 -0
- package/src/components/multi-select/multi-select.vue +11 -2
- package/src/components/multi-select/style.scss +6 -0
- package/src/components/multi-tree-select/multi-tree-select.vue +58 -9
- package/src/components/multi-tree-select/style.scss +6 -0
- package/src/components/rich-text-editor/image-node.ts +193 -0
- package/src/components/rich-text-editor/rich-text-editor.vue +131 -29
- package/src/components/rich-text-editor/style.scss +7 -0
- package/src/components/rich-text-editor/toolbar.vue +21 -1
- package/src/components/select/__test__/select.test.ts +78 -0
- package/src/components/select/select.vue +13 -3
- package/src/components/select/style.scss +6 -0
- package/src/components/select/use-options.ts +25 -4
- package/src/components/tree-select/__test__/tree-select.test.ts +116 -0
- package/src/components/tree-select/style.scss +6 -0
- package/src/components/tree-select/tree-select.vue +63 -13
- package/src/types/dropdown.ts +10 -0
- package/src/types/index.ts +1 -0
- package/src/types/kanban.ts +63 -0
- package/src/types/multi-tree-select.ts +12 -1
- package/src/types/rich-text-editor.ts +14 -1
- package/src/types/tree-select.ts +12 -1
package/dist/components/index.js
CHANGED
|
@@ -7,35 +7,35 @@ import _sfc_main$3 from "./tip/tip.js";
|
|
|
7
7
|
import { createEmptyGroup, createEmptyLeaf, evaluate } from "./condition-editor/core/evaluator.js";
|
|
8
8
|
import _sfc_main$4 from "./dropdown/dropdown.js";
|
|
9
9
|
import input_default from "./input/input.js";
|
|
10
|
-
import _sfc_main$5 from "./
|
|
11
|
-
import
|
|
12
|
-
import _sfc_main$
|
|
13
|
-
import _sfc_main$
|
|
14
|
-
import _sfc_main$
|
|
15
|
-
import _sfc_main$
|
|
16
|
-
import _sfc_main$
|
|
17
|
-
import _sfc_main$
|
|
18
|
-
import _sfc_main$
|
|
19
|
-
import _sfc_main$
|
|
20
|
-
import _sfc_main$
|
|
21
|
-
import _sfc_main$
|
|
10
|
+
import _sfc_main$5 from "./loading/loading.js";
|
|
11
|
+
import { vLoading } from "./loading/directive.js";
|
|
12
|
+
import _sfc_main$6 from "./select/select.js";
|
|
13
|
+
import _sfc_main$7 from "./condition-editor/condition-editor.js";
|
|
14
|
+
import _sfc_main$8 from "./tabs/tabs-horizontal.js";
|
|
15
|
+
import _sfc_main$9 from "./tabs/tabs-vertical.js";
|
|
16
|
+
import _sfc_main$10 from "./tabs/tabs.js";
|
|
17
|
+
import _sfc_main$11 from "./checkbox/checkbox.js";
|
|
18
|
+
import _sfc_main$12 from "./tree/tree.js";
|
|
19
|
+
import _sfc_main$13 from "./tree-select/tree-select.js";
|
|
20
|
+
import _sfc_main$14 from "./code-editor/code-editor.js";
|
|
21
|
+
import _sfc_main$15 from "./drawer/drawer.js";
|
|
22
|
+
import _sfc_main$16 from "./grid/grid.js";
|
|
23
|
+
import _sfc_main$17 from "./grid/grid-item.js";
|
|
22
24
|
import form_item_default from "./form-item/form-item.js";
|
|
23
25
|
import form_default from "./form/form.js";
|
|
24
|
-
import _sfc_main$
|
|
25
|
-
import _sfc_main$
|
|
26
|
-
import _sfc_main$
|
|
26
|
+
import _sfc_main$18 from "./button/button.js";
|
|
27
|
+
import _sfc_main$19 from "./button/button-group.js";
|
|
28
|
+
import _sfc_main$20 from "./message-confirm/message-confirm.js";
|
|
27
29
|
import { messageConfirm } from "./message-confirm/message-confirm2.js";
|
|
28
|
-
import _sfc_main$
|
|
29
|
-
import _sfc_main$
|
|
30
|
-
import _sfc_main$
|
|
31
|
-
import _sfc_main$
|
|
32
|
-
import _sfc_main$
|
|
33
|
-
import _sfc_main$
|
|
34
|
-
import _sfc_main$
|
|
35
|
-
import _sfc_main$
|
|
36
|
-
import _sfc_main$
|
|
37
|
-
import _sfc_main$29 from "./loading/loading.js";
|
|
38
|
-
import { vLoading } from "./loading/directive.js";
|
|
30
|
+
import _sfc_main$21 from "./calendar/calendar.js";
|
|
31
|
+
import _sfc_main$22 from "./radio/radio.js";
|
|
32
|
+
import _sfc_main$23 from "./card/card.js";
|
|
33
|
+
import _sfc_main$24 from "./card/card-header.js";
|
|
34
|
+
import _sfc_main$25 from "./card/card-cover.js";
|
|
35
|
+
import _sfc_main$26 from "./card/card-content.js";
|
|
36
|
+
import _sfc_main$27 from "./card/card-action.js";
|
|
37
|
+
import _sfc_main$28 from "./date-panel/date-panel.js";
|
|
38
|
+
import _sfc_main$29 from "./date-range-picker/date-range-picker.js";
|
|
39
39
|
import _sfc_main$30 from "./progress-nodes/progress-nodes.js";
|
|
40
40
|
import _sfc_main$31 from "./auto-complete/auto-complete.js";
|
|
41
41
|
import _sfc_main$32 from "./progress/progress.js";
|
|
@@ -100,6 +100,7 @@ import _sfc_main$83 from "./float-button/float-button.js";
|
|
|
100
100
|
import _sfc_main$84 from "./badge/badge.js";
|
|
101
101
|
import _sfc_main$85 from "./segment/segment.js";
|
|
102
102
|
import _sfc_main$86 from "./image-cropper/image-cropper.js";
|
|
103
|
+
import _sfc_main$87 from "./kanban/kanban.js";
|
|
103
104
|
//#region src/components/index.ts
|
|
104
105
|
var components_exports = /* @__PURE__ */ __exportAll({
|
|
105
106
|
ContextmenuPanelDIKey: () => ContextmenuPanelDIKey,
|
|
@@ -110,29 +111,29 @@ var components_exports = /* @__PURE__ */ __exportAll({
|
|
|
110
111
|
UBadge: () => _sfc_main$84,
|
|
111
112
|
UBatchEdit: () => _sfc_main$58,
|
|
112
113
|
UBreadcrumb: () => _sfc_main$81,
|
|
113
|
-
UButton: () => _sfc_main$
|
|
114
|
-
UButtonGroup: () => _sfc_main$
|
|
115
|
-
UCalendar: () => _sfc_main$
|
|
116
|
-
UCard: () => _sfc_main$
|
|
117
|
-
UCardAction: () => _sfc_main$
|
|
118
|
-
UCardContent: () => _sfc_main$
|
|
119
|
-
UCardCover: () => _sfc_main$
|
|
120
|
-
UCardHeader: () => _sfc_main$
|
|
114
|
+
UButton: () => _sfc_main$18,
|
|
115
|
+
UButtonGroup: () => _sfc_main$19,
|
|
116
|
+
UCalendar: () => _sfc_main$21,
|
|
117
|
+
UCard: () => _sfc_main$23,
|
|
118
|
+
UCardAction: () => _sfc_main$27,
|
|
119
|
+
UCardContent: () => _sfc_main$26,
|
|
120
|
+
UCardCover: () => _sfc_main$25,
|
|
121
|
+
UCardHeader: () => _sfc_main$24,
|
|
121
122
|
UCascade: () => _sfc_main$60,
|
|
122
123
|
UCheckTag: () => _sfc_main$48,
|
|
123
|
-
UCheckbox: () => _sfc_main$
|
|
124
|
+
UCheckbox: () => _sfc_main$11,
|
|
124
125
|
UCheckboxButton: () => _sfc_main$36,
|
|
125
126
|
UCheckboxGroup: () => _sfc_main$78,
|
|
126
|
-
UCodeEditor: () => _sfc_main$
|
|
127
|
+
UCodeEditor: () => _sfc_main$14,
|
|
127
128
|
UCollapse: () => _sfc_main$44,
|
|
128
129
|
UCollapseItem: () => _sfc_main$45,
|
|
129
|
-
UConditionEditor: () => _sfc_main$
|
|
130
|
+
UConditionEditor: () => _sfc_main$7,
|
|
130
131
|
UContextmenu: () => _sfc_main$49,
|
|
131
|
-
UDatePanel: () => _sfc_main$
|
|
132
|
+
UDatePanel: () => _sfc_main$28,
|
|
132
133
|
UDatePicker: () => _sfc_main$62,
|
|
133
|
-
UDateRangePicker: () => _sfc_main$
|
|
134
|
+
UDateRangePicker: () => _sfc_main$29,
|
|
134
135
|
UDialog: () => _sfc_main$52,
|
|
135
|
-
UDrawer: () => _sfc_main$
|
|
136
|
+
UDrawer: () => _sfc_main$15,
|
|
136
137
|
UDropdown: () => _sfc_main$4,
|
|
137
138
|
UDualNav: () => _sfc_main$73,
|
|
138
139
|
UEmpty: () => _sfc_main$1,
|
|
@@ -143,21 +144,22 @@ var components_exports = /* @__PURE__ */ __exportAll({
|
|
|
143
144
|
UForm: () => form_default,
|
|
144
145
|
UFormItem: () => form_item_default,
|
|
145
146
|
UGanttChart: () => _sfc_main$39,
|
|
146
|
-
UGrid: () => _sfc_main$
|
|
147
|
+
UGrid: () => _sfc_main$16,
|
|
147
148
|
UGridInput: () => _sfc_main$75,
|
|
148
|
-
UGridItem: () => _sfc_main$
|
|
149
|
+
UGridItem: () => _sfc_main$17,
|
|
149
150
|
UGroupInput: () => _sfc_main$66,
|
|
150
151
|
UGroupNav: () => _sfc_main$74,
|
|
151
152
|
UIcon: () => _sfc_main,
|
|
152
153
|
UImageCropper: () => _sfc_main$86,
|
|
153
154
|
UInput: () => input_default,
|
|
155
|
+
UKanban: () => _sfc_main$87,
|
|
154
156
|
UKbd: () => _sfc_main$55,
|
|
155
157
|
ULayout: () => _sfc_main$34,
|
|
156
158
|
UList: () => _sfc_main$67,
|
|
157
159
|
UListItem: () => _sfc_main$68,
|
|
158
|
-
ULoading: () => _sfc_main$
|
|
160
|
+
ULoading: () => _sfc_main$5,
|
|
159
161
|
UMessage: () => _sfc_main$40,
|
|
160
|
-
UMessageConfirm: () => _sfc_main$
|
|
162
|
+
UMessageConfirm: () => _sfc_main$20,
|
|
161
163
|
UMultiSelect: () => _sfc_main$37,
|
|
162
164
|
UMultiTreeSelect: () => _sfc_main$65,
|
|
163
165
|
UNav: () => _sfc_main$72,
|
|
@@ -174,27 +176,27 @@ var components_exports = /* @__PURE__ */ __exportAll({
|
|
|
174
176
|
UPopConfirm: () => _sfc_main$56,
|
|
175
177
|
UProgress: () => _sfc_main$32,
|
|
176
178
|
UProgressNodes: () => _sfc_main$30,
|
|
177
|
-
URadio: () => _sfc_main$
|
|
179
|
+
URadio: () => _sfc_main$22,
|
|
178
180
|
URadioGroup: () => _sfc_main$77,
|
|
179
181
|
URichTextEditor: () => _sfc_main$69,
|
|
180
182
|
UScroll: () => _sfc_main$2,
|
|
181
183
|
USegment: () => _sfc_main$85,
|
|
182
|
-
USelect: () => _sfc_main$
|
|
184
|
+
USelect: () => _sfc_main$6,
|
|
183
185
|
USlider: () => _sfc_main$38,
|
|
184
186
|
USteps: () => _sfc_main$61,
|
|
185
187
|
USwitch: () => _sfc_main$76,
|
|
186
188
|
UTable: () => _sfc_main$46,
|
|
187
189
|
UTableEditor: () => _sfc_main$47,
|
|
188
|
-
UTabs: () => _sfc_main$
|
|
189
|
-
UTabsHorizontal: () => _sfc_main$
|
|
190
|
-
UTabsVertical: () => _sfc_main$
|
|
190
|
+
UTabs: () => _sfc_main$10,
|
|
191
|
+
UTabsHorizontal: () => _sfc_main$8,
|
|
192
|
+
UTabsVertical: () => _sfc_main$9,
|
|
191
193
|
UTag: () => _sfc_main$35,
|
|
192
194
|
UText: () => _sfc_main$80,
|
|
193
195
|
UTextarea: () => _sfc_main$59,
|
|
194
196
|
UTheme: () => _sfc_main$64,
|
|
195
197
|
UTip: () => _sfc_main$3,
|
|
196
|
-
UTree: () => _sfc_main$
|
|
197
|
-
UTreeSelect: () => _sfc_main$
|
|
198
|
+
UTree: () => _sfc_main$12,
|
|
199
|
+
UTreeSelect: () => _sfc_main$13,
|
|
198
200
|
UWatermark: () => _sfc_main$54,
|
|
199
201
|
contextmenu: () => contextmenu,
|
|
200
202
|
createEmptyGroup: () => createEmptyGroup,
|
|
@@ -208,6 +210,6 @@ var components_exports = /* @__PURE__ */ __exportAll({
|
|
|
208
210
|
vLoading: () => vLoading
|
|
209
211
|
});
|
|
210
212
|
//#endregion
|
|
211
|
-
export { ContextmenuPanelDIKey, ContextmenuRootDIKey, _sfc_main$57 as UAction, action_group_default as UActionGroup, _sfc_main$31 as UAutoComplete, _sfc_main$84 as UBadge, _sfc_main$58 as UBatchEdit, _sfc_main$81 as UBreadcrumb, _sfc_main$
|
|
213
|
+
export { ContextmenuPanelDIKey, ContextmenuRootDIKey, _sfc_main$57 as UAction, action_group_default as UActionGroup, _sfc_main$31 as UAutoComplete, _sfc_main$84 as UBadge, _sfc_main$58 as UBatchEdit, _sfc_main$81 as UBreadcrumb, _sfc_main$18 as UButton, _sfc_main$19 as UButtonGroup, _sfc_main$21 as UCalendar, _sfc_main$23 as UCard, _sfc_main$27 as UCardAction, _sfc_main$26 as UCardContent, _sfc_main$25 as UCardCover, _sfc_main$24 as UCardHeader, _sfc_main$60 as UCascade, _sfc_main$48 as UCheckTag, _sfc_main$11 as UCheckbox, _sfc_main$36 as UCheckboxButton, _sfc_main$78 as UCheckboxGroup, _sfc_main$14 as UCodeEditor, _sfc_main$44 as UCollapse, _sfc_main$45 as UCollapseItem, _sfc_main$7 as UConditionEditor, _sfc_main$49 as UContextmenu, _sfc_main$28 as UDatePanel, _sfc_main$62 as UDatePicker, _sfc_main$29 as UDateRangePicker, _sfc_main$52 as UDialog, _sfc_main$15 as UDrawer, _sfc_main$4 as UDropdown, _sfc_main$73 as UDualNav, _sfc_main$1 as UEmpty, _sfc_main$53 as UExpressionEditor, _sfc_main$41 as UFilePicker, _sfc_main$79 as UFileViewer, _sfc_main$83 as UFloatButton, form_default as UForm, form_item_default as UFormItem, _sfc_main$39 as UGanttChart, _sfc_main$16 as UGrid, _sfc_main$75 as UGridInput, _sfc_main$17 as UGridItem, _sfc_main$66 as UGroupInput, _sfc_main$74 as UGroupNav, _sfc_main as UIcon, _sfc_main$86 as UImageCropper, input_default as UInput, _sfc_main$87 as UKanban, _sfc_main$55 as UKbd, _sfc_main$34 as ULayout, _sfc_main$67 as UList, _sfc_main$68 as UListItem, _sfc_main$5 as ULoading, _sfc_main$40 as UMessage, _sfc_main$20 as UMessageConfirm, _sfc_main$37 as UMultiSelect, _sfc_main$65 as UMultiTreeSelect, _sfc_main$72 as UNav, _sfc_main$70 as UNavItem, _sfc_main$71 as UNavSub, NodeRender as UNodeRender, _sfc_main$33 as UNotification, _sfc_main$51 as UNumber, _sfc_main$42 as UNumberInput, _sfc_main$43 as UNumberRangeInput, _sfc_main$82 as UPaginator, _sfc_main$63 as UPalette, _sfc_main$50 as UPasswordInput, _sfc_main$56 as UPopConfirm, _sfc_main$32 as UProgress, _sfc_main$30 as UProgressNodes, _sfc_main$22 as URadio, _sfc_main$77 as URadioGroup, _sfc_main$69 as URichTextEditor, _sfc_main$2 as UScroll, _sfc_main$85 as USegment, _sfc_main$6 as USelect, _sfc_main$38 as USlider, _sfc_main$61 as USteps, _sfc_main$76 as USwitch, _sfc_main$46 as UTable, _sfc_main$47 as UTableEditor, _sfc_main$10 as UTabs, _sfc_main$8 as UTabsHorizontal, _sfc_main$9 as UTabsVertical, _sfc_main$35 as UTag, _sfc_main$80 as UText, _sfc_main$59 as UTextarea, _sfc_main$64 as UTheme, _sfc_main$3 as UTip, _sfc_main$12 as UTree, _sfc_main$13 as UTreeSelect, _sfc_main$54 as UWatermark, components_exports, contextmenu, createEmptyGroup, createEmptyLeaf, defineBatchEditColumns, defineTableColumns, evaluate as evaluateConditionExpression, message, messageConfirm, notification, vLoading };
|
|
212
214
|
|
|
213
215
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/components/index.ts"],"sourcesContent":["export * from './condition-editor'\n\nexport * from './tabs'\n\nexport * from './tree'\n\nexport * from './tree-select'\n\nexport * from './code-editor'\n\nexport * from './dropdown'\n\nexport * from './drawer'\n\nexport * from './form'\n\nexport * from './message-confirm'\n\nexport * from './calendar'\n\nexport * from './radio'\n\nexport * from './card'\n\nexport * from './date-range-picker'\n\nexport * from './loading'\n\nexport * from './scroll'\n\nexport * from './progress-nodes'\n\nexport * from './empty'\n\nexport * from './auto-complete'\n\nexport * from './progress'\n\nexport * from './input'\n\nexport * from './notification'\n\nexport * from './layout'\n\nexport * from './multi-select'\n\nexport * from './checkbox'\n\nexport * from './slider'\n\nexport * from './gantt-chart'\n\nexport * from './message'\n\nexport * from './file-picker'\n\nexport * from './number-range-input'\n\nexport * from './number-input'\n\nexport * from './collapse'\n\nexport * from './date-panel'\n\nexport * from './table-editor'\n\nexport * from './check-tag'\n\nexport * from './contextmenu'\n\nexport * from './password-input'\n\nexport * from './number'\n\nexport * from './dialog'\n\nexport * from './node-render'\n\nexport * from './expression-editor'\n\nexport * from './watermark'\n\nexport * from './batch-edit'\n\nexport * from './action'\n\nexport * from './tip'\n\nexport * from './textarea'\n\nexport * from './button'\n\nexport * from './cascade'\n\nexport * from './steps'\n\nexport * from './date-picker'\n\nexport * from './theme'\n\nexport * from './table'\n\nexport * from './multi-tree-select'\n\nexport * from './group-input'\n\nexport * from './list'\n\nexport * from './rich-text-editor'\n\nexport * from './nav'\n\nexport * from './dual-nav'\n\nexport * from './group-nav'\n\nexport * from './grid-input'\n\nexport * from './switch'\n\nexport * from './form-item'\n\nexport * from './radio-group'\n\nexport * from './checkbox-group'\n\nexport * from './file-viewer'\n\nexport * from './text'\n\nexport * from './select'\n\nexport * from './breadcrumb'\n\nexport * from './icon'\n\nexport * from './kbd'\n\nexport * from './pop-confirm'\n\nexport * from './paginator'\n\nexport * from './tag'\n\nexport * from './float-button'\n\nexport * from './palette'\n\nexport * from './grid'\n\nexport * from './badge'\n\nexport * from './segment'\n\nexport * from './image-cropper'\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/components/index.ts"],"sourcesContent":["export * from './condition-editor'\n\nexport * from './tabs'\n\nexport * from './tree'\n\nexport * from './tree-select'\n\nexport * from './code-editor'\n\nexport * from './dropdown'\n\nexport * from './drawer'\n\nexport * from './form'\n\nexport * from './message-confirm'\n\nexport * from './calendar'\n\nexport * from './radio'\n\nexport * from './card'\n\nexport * from './date-range-picker'\n\nexport * from './loading'\n\nexport * from './scroll'\n\nexport * from './progress-nodes'\n\nexport * from './empty'\n\nexport * from './auto-complete'\n\nexport * from './progress'\n\nexport * from './input'\n\nexport * from './notification'\n\nexport * from './layout'\n\nexport * from './multi-select'\n\nexport * from './checkbox'\n\nexport * from './slider'\n\nexport * from './gantt-chart'\n\nexport * from './message'\n\nexport * from './file-picker'\n\nexport * from './number-range-input'\n\nexport * from './number-input'\n\nexport * from './collapse'\n\nexport * from './date-panel'\n\nexport * from './table-editor'\n\nexport * from './check-tag'\n\nexport * from './contextmenu'\n\nexport * from './password-input'\n\nexport * from './number'\n\nexport * from './dialog'\n\nexport * from './node-render'\n\nexport * from './expression-editor'\n\nexport * from './watermark'\n\nexport * from './batch-edit'\n\nexport * from './action'\n\nexport * from './tip'\n\nexport * from './textarea'\n\nexport * from './button'\n\nexport * from './cascade'\n\nexport * from './steps'\n\nexport * from './date-picker'\n\nexport * from './theme'\n\nexport * from './table'\n\nexport * from './multi-tree-select'\n\nexport * from './group-input'\n\nexport * from './list'\n\nexport * from './rich-text-editor'\n\nexport * from './nav'\n\nexport * from './dual-nav'\n\nexport * from './group-nav'\n\nexport * from './grid-input'\n\nexport * from './switch'\n\nexport * from './form-item'\n\nexport * from './radio-group'\n\nexport * from './checkbox-group'\n\nexport * from './file-viewer'\n\nexport * from './text'\n\nexport * from './select'\n\nexport * from './breadcrumb'\n\nexport * from './icon'\n\nexport * from './kbd'\n\nexport * from './pop-confirm'\n\nexport * from './paginator'\n\nexport * from './tag'\n\nexport * from './float-button'\n\nexport * from './palette'\n\nexport * from './grid'\n\nexport * from './badge'\n\nexport * from './segment'\n\nexport * from './image-cropper'\n\nexport * from './kanban'\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"di.js","names":[],"sources":["../../../src/components/kanban/di.ts"],"sourcesContent":["import type { BEM } from '@veltra/utils'\nimport type { InjectionKey } from 'vue'\n\nimport type { KanbanProps } from '../../types'\n\n/** 看板上下文:主组件向列子组件注入 */\nexport interface KanbanContext {\n /** 看板组件属性 */\n kanbanProps: KanbanProps\n /** BEM */\n cls: BEM<'kanban'>\n /** 某列卡片重排写回(getter 数据源 onReorder 链路),items 为该列最新完整卡片数组 */\n reorderColumn: (columnKey: string, items: Record<string, any>[]) => void\n /** 拖拽操作结束通知(一次操作只通知一次,主组件据此 emit change) */\n notifyChange: () => void\n}\n\n/** 看板依赖注入key */\nexport const KanbanDIKey: InjectionKey<KanbanContext> = Symbol('KanbanDIKey')\n"],"mappings":";;AAkBA,MAAa,cAA2C,OAAO,aAAa"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { KanbanDIKey } from "./di.js";
|
|
2
|
+
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, inject, normalizeClass, openBlock, renderList, renderSlot, toDisplayString, unref, watch } from "vue";
|
|
3
|
+
import { animations, useDnD } from "@veltra/compositions";
|
|
4
|
+
//#region src/components/kanban/kanban-column.vue
|
|
5
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
6
|
+
name: "UKanbanColumn",
|
|
7
|
+
__name: "kanban-column",
|
|
8
|
+
props: { column: {} },
|
|
9
|
+
setup(__props) {
|
|
10
|
+
const props = __props;
|
|
11
|
+
const ctx = inject(KanbanDIKey);
|
|
12
|
+
const cls = ctx.cls;
|
|
13
|
+
const titleKey = computed(() => ctx.kanbanProps.titleKey ?? "title");
|
|
14
|
+
const cardKey = computed(() => ctx.kanbanProps.cardKey ?? "id");
|
|
15
|
+
const countable = computed(() => ctx.kanbanProps.countable !== false);
|
|
16
|
+
const placeholder = computed(() => ctx.kanbanProps.placeholder ?? "暂无内容");
|
|
17
|
+
const title = computed(() => props.column[titleKey.value]);
|
|
18
|
+
function makeConfig() {
|
|
19
|
+
return {
|
|
20
|
+
group: "u-kanban",
|
|
21
|
+
dragHandle: `.${cls.e("card-handle")}`,
|
|
22
|
+
draggable: (el) => el.classList.contains(cls.e("card")),
|
|
23
|
+
draggingClass: "is-dragging",
|
|
24
|
+
dropZoneClass: "is-dropzone",
|
|
25
|
+
disabled: ctx.kanbanProps.disabled,
|
|
26
|
+
onSort: () => ctx.notifyChange(),
|
|
27
|
+
onTransfer: () => ctx.notifyChange(),
|
|
28
|
+
plugins: [animations()]
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const { parentRef, values, updateConfig } = useDnD({
|
|
32
|
+
values: () => props.column.items,
|
|
33
|
+
onReorder: (items) => ctx.reorderColumn(props.column.key, items),
|
|
34
|
+
...makeConfig()
|
|
35
|
+
});
|
|
36
|
+
watch(() => ctx.kanbanProps.disabled, () => updateConfig(makeConfig()));
|
|
37
|
+
return (_ctx, _cache) => {
|
|
38
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(unref(cls).e("column")) }, [createElementVNode("div", { class: normalizeClass(unref(cls).e("column-header")) }, [renderSlot(_ctx.$slots, "header", {
|
|
39
|
+
column: __props.column,
|
|
40
|
+
count: unref(values).length
|
|
41
|
+
}, () => [createElementVNode("span", { class: normalizeClass(unref(cls).e("column-title")) }, toDisplayString(title.value), 3), countable.value ? (openBlock(), createElementBlock("span", {
|
|
42
|
+
key: 0,
|
|
43
|
+
class: normalizeClass(unref(cls).e("column-count"))
|
|
44
|
+
}, toDisplayString(unref(values).length), 3)) : createCommentVNode("v-if", true)])], 2), createElementVNode("div", {
|
|
45
|
+
ref_key: "parentRef",
|
|
46
|
+
ref: parentRef,
|
|
47
|
+
class: normalizeClass(unref(cls).e("cards"))
|
|
48
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(values), (card, index) => {
|
|
49
|
+
return openBlock(), createElementBlock("div", {
|
|
50
|
+
key: card[cardKey.value],
|
|
51
|
+
class: normalizeClass(unref(cls).e("card"))
|
|
52
|
+
}, [createElementVNode("span", { class: normalizeClass(unref(cls).e("card-handle")) }, "≡", 2), createElementVNode("div", { class: normalizeClass(unref(cls).e("card-body")) }, [renderSlot(_ctx.$slots, "card", {
|
|
53
|
+
card,
|
|
54
|
+
column: __props.column,
|
|
55
|
+
index
|
|
56
|
+
}, () => [createTextVNode(toDisplayString(card[titleKey.value] ?? card[cardKey.value]), 1)])], 2)], 2);
|
|
57
|
+
}), 128)), !unref(values).length ? (openBlock(), createElementBlock("div", {
|
|
58
|
+
key: 0,
|
|
59
|
+
class: normalizeClass(unref(cls).e("empty"))
|
|
60
|
+
}, [renderSlot(_ctx.$slots, "empty", { column: __props.column }, () => [createTextVNode(toDisplayString(placeholder.value), 1)])], 2)) : createCommentVNode("v-if", true)], 2)], 2);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
//#endregion
|
|
65
|
+
export { _sfc_main as default };
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=kanban-column.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kanban-column.js","names":[],"sources":["../../../src/components/kanban/kanban-column.vue"],"sourcesContent":["<template>\n <div :class=\"cls.e('column')\">\n <div :class=\"cls.e('column-header')\">\n <slot name=\"header\" :column=\"column\" :count=\"values.length\">\n <span :class=\"cls.e('column-title')\">{{ title }}</span>\n <span v-if=\"countable\" :class=\"cls.e('column-count')\">{{ values.length }}</span>\n </slot>\n </div>\n\n <div ref=\"parentRef\" :class=\"cls.e('cards')\">\n <div v-for=\"(card, index) of values\" :key=\"card[cardKey]\" :class=\"cls.e('card')\">\n <span :class=\"cls.e('card-handle')\">≡</span>\n <div :class=\"cls.e('card-body')\">\n <slot name=\"card\" :card=\"card\" :column=\"column\" :index=\"index\">\n {{ card[titleKey] ?? card[cardKey] }}\n </slot>\n </div>\n </div>\n\n <div v-if=\"!values.length\" :class=\"cls.e('empty')\">\n <slot name=\"empty\" :column=\"column\">{{ placeholder }}</slot>\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { animations, useDnD, type VueParentConfig } from '@veltra/compositions'\nimport { computed, inject, watch } from 'vue'\n\nimport type { KanbanColumnItem, KanbanSlots } from '../../types'\nimport { KanbanDIKey } from './di'\n\ndefineOptions({ name: 'UKanbanColumn' })\n\ndefineSlots<KanbanSlots>()\n\nconst props = defineProps<{ column: KanbanColumnItem }>()\n\nconst ctx = inject(KanbanDIKey)!\n\nconst cls = ctx.cls\n\nconst titleKey = computed(() => ctx.kanbanProps.titleKey ?? 'title')\nconst cardKey = computed(() => ctx.kanbanProps.cardKey ?? 'id')\nconst countable = computed(() => ctx.kanbanProps.countable !== false)\nconst placeholder = computed(() => ctx.kanbanProps.placeholder ?? '暂无内容')\n\nconst title = computed(() => props.column[titleKey.value])\n\nfunction makeConfig(): VueParentConfig<Record<string, any>> {\n return {\n group: 'u-kanban',\n dragHandle: `.${cls.e('card-handle')}`,\n draggable: (el) => el.classList.contains(cls.e('card')),\n draggingClass: 'is-dragging',\n dropZoneClass: 'is-dropzone',\n disabled: ctx.kanbanProps.disabled,\n // 排序/转移数据已由 onReorder 写回,这里只负责对外发 change 通知\n onSort: () => ctx.notifyChange(),\n onTransfer: () => ctx.notifyChange(),\n plugins: [animations()]\n }\n}\n\nconst { parentRef, values, updateConfig } = useDnD<Record<string, any>>({\n values: () => props.column.items,\n onReorder: (items) => ctx.reorderColumn(props.column.key, items),\n ...makeConfig()\n})\n\n// updateConfig 是整体替换配置,须传完整配置而非仅 disabled\nwatch(\n () => ctx.kanbanProps.disabled,\n () => updateConfig(makeConfig())\n)\n</script>\n"],"mappings":"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"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { KanbanDIKey } from "./di.js";
|
|
2
|
+
import _sfc_main$1 from "./kanban-column.js";
|
|
3
|
+
import { Fragment, createBlock, createElementBlock, defineComponent, mergeProps, openBlock, provide, ref, renderList, renderSlot, unref, watch, withCtx } from "vue";
|
|
4
|
+
import { bem } from "@veltra/utils";
|
|
5
|
+
//#region src/components/kanban/kanban.vue
|
|
6
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
7
|
+
name: "UKanban",
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
__name: "kanban",
|
|
10
|
+
props: {
|
|
11
|
+
columns: {},
|
|
12
|
+
cardKey: { default: "id" },
|
|
13
|
+
titleKey: { default: "title" },
|
|
14
|
+
disabled: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false
|
|
17
|
+
},
|
|
18
|
+
countable: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: true
|
|
21
|
+
},
|
|
22
|
+
placeholder: { default: "暂无内容" }
|
|
23
|
+
},
|
|
24
|
+
emits: ["update:columns", "change"],
|
|
25
|
+
setup(__props, { emit: __emit }) {
|
|
26
|
+
const props = __props;
|
|
27
|
+
const emit = __emit;
|
|
28
|
+
const cls = bem("kanban");
|
|
29
|
+
const localColumns = ref([]);
|
|
30
|
+
watch(() => props.columns, (columns) => {
|
|
31
|
+
localColumns.value = (columns ?? []).map((column) => ({
|
|
32
|
+
...column,
|
|
33
|
+
items: [...column.items]
|
|
34
|
+
}));
|
|
35
|
+
}, { immediate: true });
|
|
36
|
+
function snapshot() {
|
|
37
|
+
return localColumns.value.map((column) => ({
|
|
38
|
+
...column,
|
|
39
|
+
items: [...column.items]
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
function reorderColumn(columnKey, items) {
|
|
43
|
+
localColumns.value = localColumns.value.map((column) => column.key === columnKey ? {
|
|
44
|
+
...column,
|
|
45
|
+
items
|
|
46
|
+
} : column);
|
|
47
|
+
emit("update:columns", snapshot());
|
|
48
|
+
}
|
|
49
|
+
let changePending = false;
|
|
50
|
+
function notifyChange() {
|
|
51
|
+
if (changePending) return;
|
|
52
|
+
changePending = true;
|
|
53
|
+
queueMicrotask(() => {
|
|
54
|
+
changePending = false;
|
|
55
|
+
emit("change", snapshot());
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
provide(KanbanDIKey, {
|
|
59
|
+
kanbanProps: props,
|
|
60
|
+
cls,
|
|
61
|
+
reorderColumn,
|
|
62
|
+
notifyChange
|
|
63
|
+
});
|
|
64
|
+
return (_ctx, _cache) => {
|
|
65
|
+
return openBlock(), createElementBlock("div", mergeProps(_ctx.$attrs, { class: [unref(cls).b, unref(bem).is("disabled", __props.disabled)] }), [(openBlock(true), createElementBlock(Fragment, null, renderList(localColumns.value, (column) => {
|
|
66
|
+
return openBlock(), createBlock(_sfc_main$1, {
|
|
67
|
+
key: column.key,
|
|
68
|
+
column
|
|
69
|
+
}, {
|
|
70
|
+
header: withCtx(({ column: col, count }) => [renderSlot(_ctx.$slots, "header", {
|
|
71
|
+
column: col,
|
|
72
|
+
count
|
|
73
|
+
})]),
|
|
74
|
+
card: withCtx(({ card, column: col, index }) => [renderSlot(_ctx.$slots, "card", {
|
|
75
|
+
card,
|
|
76
|
+
column: col,
|
|
77
|
+
index
|
|
78
|
+
})]),
|
|
79
|
+
empty: withCtx(({ column: col }) => [renderSlot(_ctx.$slots, "empty", { column: col })]),
|
|
80
|
+
_: 3
|
|
81
|
+
}, 8, ["column"]);
|
|
82
|
+
}), 128))], 16);
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
//#endregion
|
|
87
|
+
export { _sfc_main as default };
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=kanban.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kanban.js","names":["$attrs"],"sources":["../../../src/components/kanban/kanban.vue"],"sourcesContent":["<template>\n <div v-bind=\"$attrs\" :class=\"[cls.b, bem.is('disabled', disabled)]\">\n <KanbanColumn v-for=\"column of localColumns\" :key=\"column.key\" :column=\"column\">\n <template #header=\"{ column: col, count }\">\n <slot name=\"header\" :column=\"col\" :count=\"count\" />\n </template>\n <template #card=\"{ card, column: col, index }\">\n <slot name=\"card\" :card=\"card\" :column=\"col\" :index=\"index\" />\n </template>\n <template #empty=\"{ column: col }\">\n <slot name=\"empty\" :column=\"col\" />\n </template>\n </KanbanColumn>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { bem } from '@veltra/utils'\nimport { provide, ref, watch } from 'vue'\n\nimport type { KanbanColumnItem, KanbanEmits, KanbanProps, KanbanSlots } from '../../types'\nimport { KanbanDIKey, type KanbanContext } from './di'\nimport KanbanColumn from './kanban-column.vue'\n\ndefineOptions({ name: 'UKanban', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<KanbanProps>(), {\n cardKey: 'id',\n titleKey: 'title',\n disabled: false,\n countable: true,\n placeholder: '暂无内容'\n})\n\nconst emit = defineEmits<KanbanEmits>()\ndefineSlots<KanbanSlots>()\n\nconst cls = bem('kanban')\n\n// 拖拽写回的本地数据源:props 拷贝一份避免原地改父级数据,\n// 拖拽结果经 update:columns 交给父级决定是否受控回写\nconst localColumns = ref<KanbanColumnItem[]>([])\n\nwatch(\n () => props.columns,\n (columns) => {\n localColumns.value = (columns ?? []).map((column) => ({ ...column, items: [...column.items] }))\n },\n { immediate: true }\n)\n\nfunction snapshot(): KanbanColumnItem[] {\n return localColumns.value.map((column) => ({ ...column, items: [...column.items] }))\n}\n\nfunction reorderColumn(columnKey: string, items: Record<string, any>[]) {\n localColumns.value = localColumns.value.map((column) =>\n column.key === columnKey ? { ...column, items } : column\n )\n emit('update:columns', snapshot())\n}\n\n// 一次拖拽可能同步触发多个回调(跨列转移在源列与目标列各触发一次 onTransfer),\n// microtask 内合并保证一次操作只 emit 一次 change\nlet changePending = false\nfunction notifyChange() {\n if (changePending) return\n changePending = true\n queueMicrotask(() => {\n changePending = false\n emit('change', snapshot())\n })\n}\n\nprovide(KanbanDIKey, {\n kanbanProps: props,\n cls,\n reorderColumn,\n notifyChange\n} satisfies KanbanContext)\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EA0BA,MAAM,QAAQ;EAQd,MAAM,OAAO;EAGb,MAAM,MAAM,IAAI,QAAQ;EAIxB,MAAM,eAAe,IAAwB,CAAC,CAAC;EAE/C,YACQ,MAAM,UACX,YAAY;GACX,aAAa,SAAS,WAAW,CAAC,EAAA,CAAG,KAAK,YAAY;IAAE,GAAG;IAAQ,OAAO,CAAC,GAAG,OAAO,KAAK;GAAE,EAAE;EAChG,GACA,EAAE,WAAW,KAAK,CACpB;EAEA,SAAS,WAA+B;GACtC,OAAO,aAAa,MAAM,KAAK,YAAY;IAAE,GAAG;IAAQ,OAAO,CAAC,GAAG,OAAO,KAAK;GAAE,EAAE;EACrF;EAEA,SAAS,cAAc,WAAmB,OAA8B;GACtE,aAAa,QAAQ,aAAa,MAAM,KAAK,WAC3C,OAAO,QAAQ,YAAY;IAAE,GAAG;IAAQ;GAAM,IAAI,MACpD;GACA,KAAK,kBAAkB,SAAS,CAAC;EACnC;EAIA,IAAI,gBAAgB;EACpB,SAAS,eAAe;GACtB,IAAI,eAAe;GACnB,gBAAgB;GAChB,qBAAqB;IACnB,gBAAgB;IAChB,KAAK,UAAU,SAAS,CAAC;GAC3B,CAAC;EACH;EAEA,QAAQ,aAAa;GACnB,aAAa;GACb;GACA;GACA;EACF,CAAyB;;GA9EvB,OAAA,UAAA,GAAA,mBAYM,OAZN,WAAaA,KAYP,QAZa,EAAG,OAAK,CAAG,MAAA,GAAA,CAAG,CAAC,GAAG,MAAA,GAAA,CAAG,CAAC,GAAE,YAAa,QAAA,QAAQ,CAAA,EAAA,CAAA,GAC9D,EAAA,UAAA,IAAA,GAAA,mBAUe,UAAA,MAAA,WAVgB,aAAA,QAAV,WAAM;IAA3B,OAAA,UAAA,GAAA,YAUe,aAAA;KAV+B,KAAK,OAAO;KAAc;;KAC3D,QAAM,SACoC,EAAA,QADxB,KAAK,YAAK,CACrC,WAAmD,KAAA,QAAA,UAAA;MAA9B,QAAQ;MAAa;;KAEjC,MAAI,SACiD,EAD7C,MAAI,QAAU,KAAK,YAAK,CACzC,WAA8D,KAAA,QAAA,QAAA;MAArC;MAAO,QAAQ;MAAa;;KAE5C,OAAK,SACqB,EAAA,QADT,UAAG,CAC7B,WAAmC,KAAA,QAAA,SAAA,EAAf,QAAQ,IAAG,CAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./style2.css";
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
/** flex布局 */
|
|
3
|
+
/**
|
|
4
|
+
* 设置css变量
|
|
5
|
+
* 参数1:变量前缀
|
|
6
|
+
* 参数2: 一个由值组成的列表或者由key, value组成的map
|
|
7
|
+
* css-var(height, (
|
|
8
|
+
* large: 40px
|
|
9
|
+
* default: 32px
|
|
10
|
+
* small: 24px
|
|
11
|
+
* ))
|
|
12
|
+
* 生成的css变量:
|
|
13
|
+
* --u-height-large: 40px;
|
|
14
|
+
* --u-height-default: 32px;
|
|
15
|
+
* --u-height-small: 24px;
|
|
16
|
+
*/
|
|
17
|
+
/** 暗色:`UITheme.render()` 按主题系列写入 html[data-theme] */
|
|
18
|
+
.u-kanban {
|
|
19
|
+
display: flex;
|
|
20
|
+
justify-content: flex-start;
|
|
21
|
+
align-items: flex-start;
|
|
22
|
+
flex-wrap: nowrap;
|
|
23
|
+
gap: var(--u-gap-default);
|
|
24
|
+
padding: var(--u-gap-default);
|
|
25
|
+
overflow-x: auto;
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
}
|
|
28
|
+
.u-kanban__column {
|
|
29
|
+
flex: 0 0 auto;
|
|
30
|
+
width: 280px;
|
|
31
|
+
max-width: 100%;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
gap: var(--u-gap-small);
|
|
35
|
+
padding: var(--u-gap-small);
|
|
36
|
+
background-color: var(--u-bg-color-bottom);
|
|
37
|
+
border-radius: var(--u-radius-default);
|
|
38
|
+
box-sizing: border-box;
|
|
39
|
+
}
|
|
40
|
+
.u-kanban__column-header {
|
|
41
|
+
display: flex;
|
|
42
|
+
justify-content: flex-start;
|
|
43
|
+
align-items: center;
|
|
44
|
+
flex-wrap: nowrap;
|
|
45
|
+
gap: var(--u-gap-small);
|
|
46
|
+
padding: 0 2px;
|
|
47
|
+
}
|
|
48
|
+
.u-kanban__column-title {
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
text-overflow: ellipsis;
|
|
51
|
+
white-space: nowrap;
|
|
52
|
+
flex: 1 1 0%;
|
|
53
|
+
min-width: 0;
|
|
54
|
+
font-size: var(--u-font-size-main-default);
|
|
55
|
+
font-weight: 600;
|
|
56
|
+
color: var(--u-text-color-title);
|
|
57
|
+
}
|
|
58
|
+
.u-kanban__column-count {
|
|
59
|
+
flex: none;
|
|
60
|
+
min-width: 18px;
|
|
61
|
+
padding: 0 6px;
|
|
62
|
+
border-radius: var(--u-radius-large);
|
|
63
|
+
background-color: var(--u-color-primary-a-11);
|
|
64
|
+
color: var(--u-color-primary);
|
|
65
|
+
font-size: var(--u-font-size-main-small);
|
|
66
|
+
line-height: 18px;
|
|
67
|
+
text-align: center;
|
|
68
|
+
}
|
|
69
|
+
.u-kanban__cards {
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
gap: var(--u-gap-small);
|
|
73
|
+
min-height: 64px;
|
|
74
|
+
padding: 2px;
|
|
75
|
+
}
|
|
76
|
+
.u-kanban__cards.is-dropzone {
|
|
77
|
+
background-color: var(--u-color-primary-a-4);
|
|
78
|
+
border-radius: var(--u-radius-default);
|
|
79
|
+
}
|
|
80
|
+
.u-kanban__card {
|
|
81
|
+
display: flex;
|
|
82
|
+
justify-content: flex-start;
|
|
83
|
+
align-items: flex-start;
|
|
84
|
+
flex-wrap: nowrap;
|
|
85
|
+
gap: var(--u-gap-small);
|
|
86
|
+
padding: var(--u-gap-small);
|
|
87
|
+
background-color: var(--u-bg-color-top);
|
|
88
|
+
border-radius: var(--u-radius-default);
|
|
89
|
+
box-shadow: var(--u-shadow-sm);
|
|
90
|
+
font-size: var(--u-font-size-main-default);
|
|
91
|
+
color: var(--u-text-color-main);
|
|
92
|
+
transition: box-shadow var(--u-transition-fast) var(--u-transition-ease), opacity var(--u-transition-fast) var(--u-transition-ease);
|
|
93
|
+
}
|
|
94
|
+
.u-kanban__card:hover {
|
|
95
|
+
box-shadow: var(--u-shadow);
|
|
96
|
+
}
|
|
97
|
+
.u-kanban__card.is-dragging {
|
|
98
|
+
opacity: 0.6;
|
|
99
|
+
}
|
|
100
|
+
.u-kanban__card-handle {
|
|
101
|
+
flex: none;
|
|
102
|
+
line-height: 1;
|
|
103
|
+
color: var(--u-text-color-assist);
|
|
104
|
+
cursor: grab;
|
|
105
|
+
user-select: none;
|
|
106
|
+
}
|
|
107
|
+
.u-kanban__card-handle:active {
|
|
108
|
+
cursor: grabbing;
|
|
109
|
+
}
|
|
110
|
+
.u-kanban__card-body {
|
|
111
|
+
flex: 1 1 0%;
|
|
112
|
+
min-width: 0;
|
|
113
|
+
word-break: break-word;
|
|
114
|
+
}
|
|
115
|
+
.u-kanban__empty {
|
|
116
|
+
border: 1px dashed var(--u-border-color);
|
|
117
|
+
border-radius: var(--u-radius-default);
|
|
118
|
+
padding: var(--u-gap-default) var(--u-gap-small);
|
|
119
|
+
font-size: var(--u-font-size-main-default);
|
|
120
|
+
color: var(--u-text-color-assist);
|
|
121
|
+
text-align: center;
|
|
122
|
+
}
|
|
123
|
+
.u-kanban.is-disabled .u-kanban__card-handle {
|
|
124
|
+
cursor: not-allowed;
|
|
125
|
+
}
|
|
126
|
+
.u-kanban.is-disabled .u-kanban__card-handle:active {
|
|
127
|
+
cursor: not-allowed;
|
|
128
|
+
}
|
|
@@ -2,11 +2,12 @@ import _sfc_main$1 from "../icon/icon.js";
|
|
|
2
2
|
import _sfc_main$2 from "../empty/empty.js";
|
|
3
3
|
import _sfc_main$3 from "../scroll/scroll.js";
|
|
4
4
|
import _sfc_main$4 from "../dropdown/dropdown.js";
|
|
5
|
+
import _sfc_main$5 from "../loading/loading.js";
|
|
5
6
|
import { useOptions } from "../select/use-options.js";
|
|
6
|
-
import _sfc_main$
|
|
7
|
-
import _sfc_main$
|
|
7
|
+
import _sfc_main$6 from "../checkbox/checkbox.js";
|
|
8
|
+
import _sfc_main$7 from "../tag/tag.js";
|
|
8
9
|
import { MultiSelectDIKey } from "./di.js";
|
|
9
|
-
import _sfc_main$
|
|
10
|
+
import _sfc_main$8 from "./multi-select-option.js";
|
|
10
11
|
import { Fragment, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, isRef, mergeModels, mergeProps, nextTick, normalizeClass, normalizeStyle, openBlock, provide, renderList, renderSlot, shallowReactive, shallowRef, toDisplayString, unref, useModel, useTemplateRef, vModelText, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
11
12
|
import { useFormFallbackProps, useVirtualizer } from "@veltra/compositions";
|
|
12
13
|
import { FORM_EMPTY_CONTENT, bem, fieldKey, injectFormContext } from "@veltra/utils";
|
|
@@ -73,7 +74,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
73
74
|
});
|
|
74
75
|
const scrollRef = shallowRef();
|
|
75
76
|
const hovered = shallowRef(false);
|
|
76
|
-
const { options: rawOptions, queryString, allOptions: rawAllOptions } = useOptions({ props });
|
|
77
|
+
const { options: rawOptions, queryString, loading, allOptions: rawAllOptions } = useOptions({ props });
|
|
77
78
|
const createdOptions = shallowRef([]);
|
|
78
79
|
const options = computed(() => {
|
|
79
80
|
const base = rawOptions.value;
|
|
@@ -327,7 +328,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
327
328
|
class: normalizeClass(unref(cls).e("tags"))
|
|
328
329
|
}, [
|
|
329
330
|
(openBlock(true), createElementBlock(Fragment, null, renderList(tags.value, (option) => {
|
|
330
|
-
return openBlock(), createBlock(unref(_sfc_main$
|
|
331
|
+
return openBlock(), createBlock(unref(_sfc_main$7), {
|
|
331
332
|
key: option[valueKey.value],
|
|
332
333
|
closable: !unref(disabled),
|
|
333
334
|
size: "small",
|
|
@@ -337,7 +338,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
337
338
|
_: 2
|
|
338
339
|
}, 1032, ["closable", "onClose"]);
|
|
339
340
|
}), 128)),
|
|
340
|
-
restTag.value ? (openBlock(), createBlock(unref(_sfc_main$
|
|
341
|
+
restTag.value ? (openBlock(), createBlock(unref(_sfc_main$7), {
|
|
341
342
|
key: 0,
|
|
342
343
|
size: "small"
|
|
343
344
|
}, {
|
|
@@ -381,7 +382,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
381
382
|
]),
|
|
382
383
|
content: withCtx(() => [
|
|
383
384
|
createCommentVNode(" 多选栏 "),
|
|
384
|
-
createElementVNode("div", { class: normalizeClass(unref(cls).e("content-header")) }, [createVNode(unref(_sfc_main$
|
|
385
|
+
createElementVNode("div", { class: normalizeClass(unref(cls).e("content-header")) }, [createVNode(unref(_sfc_main$6), {
|
|
385
386
|
"model-value": allChecked.value,
|
|
386
387
|
indeterminate: indeterminate.value,
|
|
387
388
|
"onUpdate:modelValue": handleCheckAll,
|
|
@@ -396,8 +397,11 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
396
397
|
]), createElementVNode("span", null, " 已选 " + toDisplayString(model.value?.length) + "/" + toDisplayString(__props.max ?? options.value?.length ?? 0), 1)], 2),
|
|
397
398
|
createCommentVNode(" 多选列表 "),
|
|
398
399
|
createCommentVNode("\n 虚拟化启用时内容容器 height 由 useVirtualizer 命令式写入;\n 模板不再绑定 totalSize,避免尺寸变化引起重渲染。\n "),
|
|
399
|
-
|
|
400
|
+
unref(loading) ? (openBlock(), createElementBlock("div", {
|
|
400
401
|
key: 0,
|
|
402
|
+
class: normalizeClass(unref(cls).e("loading"))
|
|
403
|
+
}, [createVNode(unref(_sfc_main$5), { type: "dual-ring" })], 2)) : options.value.length ? (openBlock(), createBlock(unref(_sfc_main$3), {
|
|
404
|
+
key: 1,
|
|
401
405
|
tag: "ul",
|
|
402
406
|
class: normalizeClass([unref(cls).e("options")]),
|
|
403
407
|
ref_key: "scrollRef",
|
|
@@ -405,7 +409,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
405
409
|
"content-class": [unref(cls).e("options-wrap"), unref(bem).is("virtual", virtualEnabled.value)]
|
|
406
410
|
}, {
|
|
407
411
|
default: withCtx(() => [virtualEnabled.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(virtualOptions.value, ({ option, index, key, label, offset }) => {
|
|
408
|
-
return openBlock(), createBlock(_sfc_main$
|
|
412
|
+
return openBlock(), createBlock(_sfc_main$8, {
|
|
409
413
|
option,
|
|
410
414
|
disabled: isDisabled(option),
|
|
411
415
|
key,
|
|
@@ -429,7 +433,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
429
433
|
"index"
|
|
430
434
|
]);
|
|
431
435
|
}), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(options.value, (option, index) => {
|
|
432
|
-
return openBlock(), createBlock(_sfc_main$
|
|
436
|
+
return openBlock(), createBlock(_sfc_main$8, {
|
|
433
437
|
option,
|
|
434
438
|
disabled: isDisabled(option),
|
|
435
439
|
key: unref(o)(option).get(valueKey.value),
|
|
@@ -450,7 +454,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
450
454
|
}), 128))]),
|
|
451
455
|
_: 3
|
|
452
456
|
}, 8, ["class", "content-class"])) : (openBlock(), createElementBlock("div", {
|
|
453
|
-
key:
|
|
457
|
+
key: 2,
|
|
454
458
|
class: normalizeClass(unref(cls).e("empty"))
|
|
455
459
|
}, [createVNode(unref(_sfc_main$2))], 2))
|
|
456
460
|
]),
|
|
@@ -466,7 +470,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
466
470
|
key: 1,
|
|
467
471
|
class: normalizeClass([unref(cls).m(unref(size)), unref(cls).e("readonly-tags")])
|
|
468
472
|
}, [createElementVNode("div", { class: normalizeClass(unref(cls).e("tags")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(tags.value, (option) => {
|
|
469
|
-
return openBlock(), createBlock(unref(_sfc_main$
|
|
473
|
+
return openBlock(), createBlock(unref(_sfc_main$7), {
|
|
470
474
|
key: option[valueKey.value],
|
|
471
475
|
size: "small"
|
|
472
476
|
}, {
|