@veltra/desktop 1.1.5 → 1.1.7
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/action/action-group.vue.d.ts +1 -1
- package/dist/components/action/action.vue.d.ts +1 -1
- package/dist/components/batch-edit/batch-edit-form.js +23 -11
- package/dist/components/batch-edit/batch-edit-form.js.map +1 -1
- package/dist/components/batch-edit/batch-edit.js +0 -1
- package/dist/components/batch-edit/batch-edit.js.map +1 -1
- package/dist/components/batch-edit/style.js +1 -0
- package/dist/components/button/button.vue.d.ts +1 -1
- package/dist/components/button/style2.css +57 -45
- package/dist/components/cascade/cascade.vue.d.ts +4 -4
- package/dist/components/cascade/style2.css +2 -1
- package/dist/components/checkbox/checkbox-button.vue.d.ts +1 -1
- package/dist/components/checkbox/style2.css +2 -2
- package/dist/components/checkbox-group/checkbox-group.vue.d.ts +1 -1
- package/dist/components/collapse/collapse.vue.d.ts +1 -1
- package/dist/components/date-picker/date-picker.vue.d.ts +1 -1
- package/dist/components/date-range-picker/date-range-picker.vue.d.ts +1 -1
- package/dist/components/drawer/drawer.vue.d.ts +2 -2
- package/dist/components/expression-editor/style2.css +4 -4
- package/dist/components/file-viewer/file-viewer.vue.d.ts +1 -1
- package/dist/components/index.d.ts +9 -8
- package/dist/components/index.js +56 -54
- package/dist/components/index.js.map +1 -1
- package/dist/components/input/input.vue.d.ts +2 -2
- package/dist/components/kbd/index.d.ts +1 -0
- package/dist/components/kbd/kbd.js +17 -0
- package/dist/components/kbd/kbd.js.map +1 -0
- package/dist/components/kbd/kbd.vue.d.ts +18 -0
- package/dist/components/kbd/style.d.ts +1 -0
- package/dist/components/kbd/style.js +1 -0
- package/dist/components/kbd/style2.css +43 -0
- package/dist/components/message-confirm/style2.css +3 -1
- package/dist/components/multi-select/multi-select.vue.d.ts +2 -2
- package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +4 -4
- package/dist/components/notification/notification.vue.d.ts +1 -1
- package/dist/components/notification/style2.css +1 -1
- package/dist/components/number-input/number-input.vue.d.ts +2 -2
- package/dist/components/paginator/style2.css +4 -3
- package/dist/components/progress-nodes/progress-nodes.vue.d.ts +2 -2
- package/dist/components/radio-group/radio-group.vue.d.ts +1 -1
- package/dist/components/select/select.vue.d.ts +1 -1
- package/dist/components/table/table.js +0 -1
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/table-editor/table-editor.js +0 -1
- package/dist/components/table-editor/table-editor.js.map +1 -1
- package/dist/components/tabs/style2.css +3 -3
- package/dist/components/tabs/tabs-horizontal.vue.d.ts +5 -5
- package/dist/components/tabs/tabs-vertical.vue.d.ts +4 -4
- package/dist/components/tabs/tabs.vue.d.ts +5 -5
- package/dist/components/tag/style2.css +35 -35
- package/dist/components/textarea/textarea.vue.d.ts +2 -2
- package/dist/components/tip/tip.vue.d.ts +1 -1
- package/dist/components/tree/style2.css +2 -2
- package/dist/components/tree-select/tree-select.vue.d.ts +4 -4
- package/dist/index.d.ts +45 -44
- package/dist/index.js +44 -43
- package/dist/style.js +1 -0
- package/dist/types/table.d.ts +0 -2
- package/package.json +11 -11
- package/src/components/auto-complete/style.scss +3 -1
- package/src/components/batch-edit/batch-edit-form.vue +10 -2
- package/src/components/batch-edit/style.ts +1 -0
- package/src/components/button/style.scss +16 -9
- package/src/components/cascade/style.scss +5 -2
- package/src/components/checkbox/style.scss +2 -2
- package/src/components/code-editor/style.scss +5 -2
- package/src/components/date-range-picker/style.scss +3 -1
- package/src/components/expression-editor/style.scss +4 -4
- package/src/components/index.ts +2 -0
- package/src/components/kbd/index.ts +1 -0
- package/src/components/kbd/kbd.vue +13 -0
- package/src/components/kbd/style.scss +37 -0
- package/src/components/kbd/style.ts +1 -0
- package/src/components/message-confirm/style.scss +3 -1
- package/src/components/multi-select/style.scss +3 -1
- package/src/components/multi-tree-select/style.scss +3 -1
- package/src/components/notification/style.scss +1 -1
- package/src/components/paginator/style.scss +4 -3
- package/src/components/tabs/style.scss +2 -2
- package/src/components/tag/style.scss +5 -5
- package/src/components/textarea/style.scss +3 -1
- package/src/components/tree/style.scss +2 -2
- package/src/style.ts +1 -0
- package/src/types/table.ts +0 -2
|
@@ -81,16 +81,16 @@
|
|
|
81
81
|
height: 22px;
|
|
82
82
|
line-height: 1;
|
|
83
83
|
font-size: 12px;
|
|
84
|
-
color: var(--u-color-primary);
|
|
85
|
-
background-color: var(--u-color-primary-light-9);
|
|
84
|
+
color: var(--u-expression-editor-chip-color, var(--u-color-primary));
|
|
85
|
+
background-color: var(--u-expression-editor-chip-bg, var(--u-color-primary-light-9));
|
|
86
86
|
border-radius: 999px;
|
|
87
87
|
cursor: pointer;
|
|
88
88
|
user-select: none;
|
|
89
89
|
transition: background-color 0.12s ease, box-shadow 0.12s ease;
|
|
90
90
|
}
|
|
91
91
|
.u-expression-editor__chip:hover {
|
|
92
|
-
color: var(--u-color-primary);
|
|
93
|
-
background-color: var(--u-color-primary-light-8);
|
|
92
|
+
color: var(--u-expression-editor-chip-color, var(--u-color-primary));
|
|
93
|
+
background-color: var(--u-expression-editor-chip-bg, var(--u-color-primary-light-8));
|
|
94
94
|
box-shadow: 0 1px 4px var(--u-shadow-color);
|
|
95
95
|
}
|
|
96
96
|
.u-expression-editor__chip:hover .u-expression-editor__chip-close {
|
|
@@ -28,8 +28,8 @@ declare const __VLS_export: _$vue.DefineComponent<__VLS_PublicProps, _FileViewer
|
|
|
28
28
|
}) => any) | undefined;
|
|
29
29
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
30
30
|
}>, {
|
|
31
|
-
modelValue: string;
|
|
32
31
|
open: boolean;
|
|
32
|
+
modelValue: string;
|
|
33
33
|
sidebarWidth: string | number | false;
|
|
34
34
|
sheetMaxRows: number;
|
|
35
35
|
downloadable: boolean;
|
|
@@ -87,11 +87,12 @@ import { _default as _default$75 } from "./text/text.vue.js";
|
|
|
87
87
|
import { _default as _default$76 } from "./select/select.vue.js";
|
|
88
88
|
import { _default as _default$77 } from "./breadcrumb/breadcrumb.vue.js";
|
|
89
89
|
import { _default as _default$78 } from "./icon/icon.vue.js";
|
|
90
|
-
import { _default as _default$79 } from "./
|
|
91
|
-
import { _default as _default$80 } from "./
|
|
92
|
-
import { _default as _default$81 } from "./
|
|
93
|
-
import { _default as _default$82 } from "./
|
|
94
|
-
import { _default as _default$83 } from "./
|
|
95
|
-
import { _default as _default$84 } from "./
|
|
96
|
-
import { _default as _default$85 } from "./grid/grid
|
|
97
|
-
import { _default as _default$86 } from "./
|
|
90
|
+
import { _default as _default$79 } from "./kbd/kbd.vue.js";
|
|
91
|
+
import { _default as _default$80 } from "./pop-confirm/pop-confirm.vue.js";
|
|
92
|
+
import { _default as _default$81 } from "./paginator/paginator.vue.js";
|
|
93
|
+
import { _default as _default$82 } from "./tag/tag.vue.js";
|
|
94
|
+
import { _default as _default$83 } from "./float-button/float-button.vue.js";
|
|
95
|
+
import { _default as _default$84 } from "./palette/palette.vue.js";
|
|
96
|
+
import { _default as _default$85 } from "./grid/grid.vue.js";
|
|
97
|
+
import { _default as _default$86 } from "./grid/grid-item.vue.js";
|
|
98
|
+
import { _default as _default$87 } from "./badge/badge.vue.js";
|
package/dist/components/index.js
CHANGED
|
@@ -67,47 +67,48 @@ import _sfc_main$51 from "./number/number.js";
|
|
|
67
67
|
import _sfc_main$52 from "./dialog/dialog.js";
|
|
68
68
|
import _sfc_main$53 from "./expression-editor/expression-editor.js";
|
|
69
69
|
import _sfc_main$54 from "./watermark/watermark.js";
|
|
70
|
-
import _sfc_main$55 from "./
|
|
71
|
-
import _sfc_main$56 from "./
|
|
70
|
+
import _sfc_main$55 from "./kbd/kbd.js";
|
|
71
|
+
import _sfc_main$56 from "./pop-confirm/pop-confirm.js";
|
|
72
|
+
import _sfc_main$57 from "./action/action.js";
|
|
72
73
|
import action_group_default from "./action/action-group.js";
|
|
73
|
-
import _sfc_main$
|
|
74
|
+
import _sfc_main$58 from "./batch-edit/batch-edit.js";
|
|
74
75
|
import { defineBatchEditColumns } from "./batch-edit/helper.js";
|
|
75
|
-
import _sfc_main$
|
|
76
|
-
import _sfc_main$
|
|
77
|
-
import _sfc_main$
|
|
78
|
-
import _sfc_main$
|
|
79
|
-
import _sfc_main$
|
|
80
|
-
import _sfc_main$
|
|
81
|
-
import _sfc_main$
|
|
82
|
-
import _sfc_main$
|
|
83
|
-
import _sfc_main$
|
|
84
|
-
import _sfc_main$
|
|
85
|
-
import _sfc_main$
|
|
86
|
-
import _sfc_main$
|
|
87
|
-
import _sfc_main$
|
|
88
|
-
import _sfc_main$
|
|
89
|
-
import _sfc_main$
|
|
90
|
-
import _sfc_main$
|
|
91
|
-
import _sfc_main$
|
|
92
|
-
import _sfc_main$
|
|
93
|
-
import _sfc_main$
|
|
94
|
-
import _sfc_main$
|
|
95
|
-
import _sfc_main$
|
|
96
|
-
import _sfc_main$
|
|
97
|
-
import _sfc_main$
|
|
98
|
-
import _sfc_main$
|
|
76
|
+
import _sfc_main$59 from "./textarea/textarea.js";
|
|
77
|
+
import _sfc_main$60 from "./cascade/cascade.js";
|
|
78
|
+
import _sfc_main$61 from "./steps/steps.js";
|
|
79
|
+
import _sfc_main$62 from "./date-picker/date-picker.js";
|
|
80
|
+
import _sfc_main$63 from "./palette/palette.js";
|
|
81
|
+
import _sfc_main$64 from "./theme/theme.js";
|
|
82
|
+
import _sfc_main$65 from "./multi-tree-select/multi-tree-select.js";
|
|
83
|
+
import _sfc_main$66 from "./group-input/group-input.js";
|
|
84
|
+
import _sfc_main$67 from "./list/list.js";
|
|
85
|
+
import _sfc_main$68 from "./list/list-item.js";
|
|
86
|
+
import _sfc_main$69 from "./rich-text-editor/rich-text-editor.js";
|
|
87
|
+
import _sfc_main$70 from "./menu/menu-item.js";
|
|
88
|
+
import _sfc_main$71 from "./menu/menu-sub.js";
|
|
89
|
+
import _sfc_main$72 from "./menu/menu.js";
|
|
90
|
+
import _sfc_main$73 from "./grid-input/grid-input.js";
|
|
91
|
+
import _sfc_main$74 from "./switch/switch.js";
|
|
92
|
+
import _sfc_main$75 from "./radio-group/radio-group.js";
|
|
93
|
+
import _sfc_main$76 from "./checkbox-group/checkbox-group.js";
|
|
94
|
+
import _sfc_main$77 from "./file-viewer/file-viewer.js";
|
|
95
|
+
import _sfc_main$78 from "./text/text.js";
|
|
96
|
+
import _sfc_main$79 from "./breadcrumb/breadcrumb.js";
|
|
97
|
+
import _sfc_main$80 from "./paginator/paginator.js";
|
|
98
|
+
import _sfc_main$81 from "./float-button/float-button.js";
|
|
99
|
+
import _sfc_main$82 from "./badge/badge.js";
|
|
99
100
|
//#region src/components/index.ts
|
|
100
101
|
var components_exports = /* @__PURE__ */ __exportAll({
|
|
101
102
|
DynamicFormModel: () => DynamicFormModel,
|
|
102
103
|
FormModel: () => FormModel,
|
|
103
104
|
MessageConfirm: () => MessageConfirm,
|
|
104
105
|
Notification: () => Notification,
|
|
105
|
-
UAction: () => _sfc_main$
|
|
106
|
+
UAction: () => _sfc_main$57,
|
|
106
107
|
UActionGroup: () => action_group_default,
|
|
107
108
|
UAutoComplete: () => _sfc_main$31,
|
|
108
|
-
UBadge: () => _sfc_main$
|
|
109
|
-
UBatchEdit: () => _sfc_main$
|
|
110
|
-
UBreadcrumb: () => _sfc_main$
|
|
109
|
+
UBadge: () => _sfc_main$82,
|
|
110
|
+
UBatchEdit: () => _sfc_main$58,
|
|
111
|
+
UBreadcrumb: () => _sfc_main$79,
|
|
111
112
|
UButton: () => _sfc_main$17,
|
|
112
113
|
UButtonGroup: () => _sfc_main$18,
|
|
113
114
|
UCalendar: () => _sfc_main$20,
|
|
@@ -116,18 +117,18 @@ var components_exports = /* @__PURE__ */ __exportAll({
|
|
|
116
117
|
UCardContent: () => _sfc_main$25,
|
|
117
118
|
UCardCover: () => _sfc_main$24,
|
|
118
119
|
UCardHeader: () => _sfc_main$23,
|
|
119
|
-
UCascade: () => _sfc_main$
|
|
120
|
+
UCascade: () => _sfc_main$60,
|
|
120
121
|
UCheckTag: () => _sfc_main$48,
|
|
121
122
|
UCheckbox: () => _sfc_main$10,
|
|
122
123
|
UCheckboxButton: () => _sfc_main$36,
|
|
123
|
-
UCheckboxGroup: () => _sfc_main$
|
|
124
|
+
UCheckboxGroup: () => _sfc_main$76,
|
|
124
125
|
UCodeEditor: () => _sfc_main$13,
|
|
125
126
|
UCollapse: () => _sfc_main$44,
|
|
126
127
|
UCollapseItem: () => _sfc_main$45,
|
|
127
128
|
UConditionEditor: () => _sfc_main$6,
|
|
128
129
|
UContextMenu: () => _sfc_main$49,
|
|
129
130
|
UDatePanel: () => _sfc_main$27,
|
|
130
|
-
UDatePicker: () => _sfc_main$
|
|
131
|
+
UDatePicker: () => _sfc_main$62,
|
|
131
132
|
UDateRangePicker: () => _sfc_main$28,
|
|
132
133
|
UDialog: () => _sfc_main$52,
|
|
133
134
|
UDrawer: () => _sfc_main$14,
|
|
@@ -135,56 +136,57 @@ var components_exports = /* @__PURE__ */ __exportAll({
|
|
|
135
136
|
UEmpty: () => _sfc_main$1,
|
|
136
137
|
UExpressionEditor: () => _sfc_main$53,
|
|
137
138
|
UFilePicker: () => _sfc_main$41,
|
|
138
|
-
UFileViewer: () => _sfc_main$
|
|
139
|
-
UFloatButton: () => _sfc_main$
|
|
139
|
+
UFileViewer: () => _sfc_main$77,
|
|
140
|
+
UFloatButton: () => _sfc_main$81,
|
|
140
141
|
UForm: () => form_default,
|
|
141
142
|
UFormItem: () => form_item_default,
|
|
142
143
|
UGanttChart: () => _sfc_main$39,
|
|
143
144
|
UGrid: () => _sfc_main$15,
|
|
144
|
-
UGridInput: () => _sfc_main$
|
|
145
|
+
UGridInput: () => _sfc_main$73,
|
|
145
146
|
UGridItem: () => _sfc_main$16,
|
|
146
|
-
UGroupInput: () => _sfc_main$
|
|
147
|
+
UGroupInput: () => _sfc_main$66,
|
|
147
148
|
UIcon: () => _sfc_main,
|
|
148
149
|
UInput: () => input_default,
|
|
150
|
+
UKbd: () => _sfc_main$55,
|
|
149
151
|
ULayout: () => _sfc_main$34,
|
|
150
|
-
UList: () => _sfc_main$
|
|
151
|
-
UListItem: () => _sfc_main$
|
|
152
|
+
UList: () => _sfc_main$67,
|
|
153
|
+
UListItem: () => _sfc_main$68,
|
|
152
154
|
ULoading: () => _sfc_main$29,
|
|
153
|
-
UMenu: () => _sfc_main$
|
|
154
|
-
UMenuItem: () => _sfc_main$
|
|
155
|
-
UMenuSub: () => _sfc_main$
|
|
155
|
+
UMenu: () => _sfc_main$72,
|
|
156
|
+
UMenuItem: () => _sfc_main$70,
|
|
157
|
+
UMenuSub: () => _sfc_main$71,
|
|
156
158
|
UMessage: () => _sfc_main$40,
|
|
157
159
|
UMessageConfirm: () => _sfc_main$19,
|
|
158
160
|
UMultiSelect: () => _sfc_main$37,
|
|
159
|
-
UMultiTreeSelect: () => _sfc_main$
|
|
161
|
+
UMultiTreeSelect: () => _sfc_main$65,
|
|
160
162
|
UNodeRender: () => NodeRender,
|
|
161
163
|
UNotification: () => _sfc_main$33,
|
|
162
164
|
UNumber: () => _sfc_main$51,
|
|
163
165
|
UNumberInput: () => _sfc_main$42,
|
|
164
166
|
UNumberRangeInput: () => _sfc_main$43,
|
|
165
|
-
UPaginator: () => _sfc_main$
|
|
166
|
-
UPalette: () => _sfc_main$
|
|
167
|
+
UPaginator: () => _sfc_main$80,
|
|
168
|
+
UPalette: () => _sfc_main$63,
|
|
167
169
|
UPasswordInput: () => _sfc_main$50,
|
|
168
|
-
UPopConfirm: () => _sfc_main$
|
|
170
|
+
UPopConfirm: () => _sfc_main$56,
|
|
169
171
|
UProgress: () => _sfc_main$32,
|
|
170
172
|
UProgressNodes: () => _sfc_main$30,
|
|
171
173
|
URadio: () => _sfc_main$21,
|
|
172
|
-
URadioGroup: () => _sfc_main$
|
|
173
|
-
URichTextEditor: () => _sfc_main$
|
|
174
|
+
URadioGroup: () => _sfc_main$75,
|
|
175
|
+
URichTextEditor: () => _sfc_main$69,
|
|
174
176
|
UScroll: () => _sfc_main$2,
|
|
175
177
|
USelect: () => _sfc_main$5,
|
|
176
178
|
USlider: () => _sfc_main$38,
|
|
177
|
-
USteps: () => _sfc_main$
|
|
178
|
-
USwitch: () => _sfc_main$
|
|
179
|
+
USteps: () => _sfc_main$61,
|
|
180
|
+
USwitch: () => _sfc_main$74,
|
|
179
181
|
UTable: () => _sfc_main$46,
|
|
180
182
|
UTableEditor: () => _sfc_main$47,
|
|
181
183
|
UTabs: () => _sfc_main$9,
|
|
182
184
|
UTabsHorizontal: () => _sfc_main$7,
|
|
183
185
|
UTabsVertical: () => _sfc_main$8,
|
|
184
186
|
UTag: () => _sfc_main$35,
|
|
185
|
-
UText: () => _sfc_main$
|
|
186
|
-
UTextarea: () => _sfc_main$
|
|
187
|
-
UTheme: () => _sfc_main$
|
|
187
|
+
UText: () => _sfc_main$78,
|
|
188
|
+
UTextarea: () => _sfc_main$59,
|
|
189
|
+
UTheme: () => _sfc_main$64,
|
|
188
190
|
UTip: () => _sfc_main$3,
|
|
189
191
|
UTree: () => _sfc_main$11,
|
|
190
192
|
UTreeSelect: () => _sfc_main$12,
|
|
@@ -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 './context-menu'\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 './menu'\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 './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"],"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 './context-menu'\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 './menu'\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"],"mappings":""}
|
|
@@ -17,20 +17,20 @@ declare const __VLS_base: _$vue.DefineComponent<__VLS_PublicProps, _InputExposed
|
|
|
17
17
|
"update:modelValue": (value: string | undefined) => any;
|
|
18
18
|
} & {
|
|
19
19
|
"update:modelValue": (value: string) => any;
|
|
20
|
-
clear: () => any;
|
|
21
20
|
change: (value: string) => any;
|
|
22
21
|
"suffix:click": (value?: string | undefined) => any;
|
|
23
22
|
"prefix:click": (value?: string | undefined) => any;
|
|
24
23
|
focus: (value?: string | undefined) => any;
|
|
24
|
+
clear: () => any;
|
|
25
25
|
blur: (value?: string | undefined) => any;
|
|
26
26
|
"native:input": (ev: Event) => any;
|
|
27
27
|
}, string, _$vue.PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
28
28
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
29
|
-
onClear?: (() => any) | undefined;
|
|
30
29
|
onChange?: ((value: string) => any) | undefined;
|
|
31
30
|
"onSuffix:click"?: ((value?: string | undefined) => any) | undefined;
|
|
32
31
|
"onPrefix:click"?: ((value?: string | undefined) => any) | undefined;
|
|
33
32
|
onFocus?: ((value?: string | undefined) => any) | undefined;
|
|
33
|
+
onClear?: (() => any) | undefined;
|
|
34
34
|
onBlur?: ((value?: string | undefined) => any) | undefined;
|
|
35
35
|
"onNative:input"?: ((ev: Event) => any) | undefined;
|
|
36
36
|
}>, {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { _default } from "./kbd.vue.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createElementBlock, defineComponent, normalizeClass, openBlock, renderSlot, unref } from "vue";
|
|
2
|
+
import { bem } from "@veltra/utils";
|
|
3
|
+
//#region src/components/kbd/kbd.vue
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
name: "Kbd",
|
|
6
|
+
__name: "kbd",
|
|
7
|
+
setup(__props) {
|
|
8
|
+
const cls = bem("kbd");
|
|
9
|
+
return (_ctx, _cache) => {
|
|
10
|
+
return openBlock(), createElementBlock("kbd", { class: normalizeClass(unref(cls).b) }, [renderSlot(_ctx.$slots, "default")], 2);
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export { _sfc_main as default };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=kbd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kbd.js","names":[],"sources":["../../../src/components/kbd/kbd.vue"],"sourcesContent":["<template>\n <kbd :class=\"cls.b\">\n <slot />\n </kbd>\n</template>\n\n<script lang=\"ts\" setup>\nimport { bem } from '@veltra/utils'\n\ndefineOptions({ name: 'Kbd' })\n\nconst cls = bem('kbd')\n</script>\n"],"mappings":";;;;;;;EAWA,MAAM,MAAM,IAAI,MAAK;;uBAVnB,mBAEM,OAAA,EAFA,OAAK,eAAE,MAAA,IAAG,CAAC,EAAC,EAAA,EAAA,CAChB,WAAQ,KAAA,QAAA,UAAA,CAAA,EAAA,EAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as _$vue from "vue";
|
|
2
|
+
|
|
3
|
+
//#region src/components/kbd/kbd.vue.d.ts
|
|
4
|
+
declare var __VLS_1: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
default?: (props: typeof __VLS_1) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_base: _$vue.DefineComponent<{}, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
9
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
12
|
+
new (): {
|
|
13
|
+
$slots: S;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { _default };
|
|
18
|
+
//# sourceMappingURL=kbd.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./style2.css";
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
/** 暗色:data-theme 与系统偏好,与 UITheme.injectBuiltInThemes 选择器策略一致 */
|
|
18
|
+
.u-kbd {
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
font-family: var(--u-font-family);
|
|
24
|
+
font-weight: normal;
|
|
25
|
+
vertical-align: text-top;
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
user-select: none;
|
|
28
|
+
position: relative;
|
|
29
|
+
top: -0.03em;
|
|
30
|
+
font-size: 0.75em;
|
|
31
|
+
min-width: 1.75em;
|
|
32
|
+
line-height: 1.7em;
|
|
33
|
+
padding: 0 0.5em 0.05em;
|
|
34
|
+
border-radius: calc(var(--u-radius-default) * 0.35);
|
|
35
|
+
height: fit-content;
|
|
36
|
+
color: var(--u-text-color-main);
|
|
37
|
+
background: var(--u-bg-color-top);
|
|
38
|
+
/*
|
|
39
|
+
* Adapted from Radix UI Themes Kbd.
|
|
40
|
+
* Multi-layer box-shadow simulates a 3D keycap appearance.
|
|
41
|
+
*/
|
|
42
|
+
box-shadow: inset 0 0.05em color-mix(in srgb, var(--u-bg-color-top) 75%, var(--u-bg-color-black)), 0 0 0 0.05em color-mix(in srgb, var(--u-border-color) 50%, transparent), 0 0.08em 0.17em color-mix(in srgb, var(--u-shadow-color) 60%, transparent);
|
|
43
|
+
}
|
|
@@ -29,7 +29,9 @@
|
|
|
29
29
|
}
|
|
30
30
|
.u-message-confirm__box {
|
|
31
31
|
width: 420px;
|
|
32
|
-
background-color:
|
|
32
|
+
background-color: var(--u-bg-color-top);
|
|
33
|
+
border: var(--u-border);
|
|
34
|
+
box-shadow: var(--u-shadow);
|
|
33
35
|
transition: opacity 0.3s, transform 0.4s;
|
|
34
36
|
transform: translateY(-50%);
|
|
35
37
|
}
|
|
@@ -28,13 +28,13 @@ declare const __VLS_base: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {}, {
|
|
|
28
28
|
"onUpdate:modelValue"?: ((value: any[]) => any) | undefined;
|
|
29
29
|
onChange?: ((options: Record<string, any>[]) => any) | undefined;
|
|
30
30
|
}>, {
|
|
31
|
+
minWidth: string;
|
|
32
|
+
disabled: boolean;
|
|
31
33
|
labelKey: string;
|
|
32
34
|
valueKey: string;
|
|
33
|
-
disabled: boolean;
|
|
34
35
|
readonly: boolean;
|
|
35
36
|
placeholder: string;
|
|
36
37
|
clearable: boolean;
|
|
37
|
-
minWidth: string;
|
|
38
38
|
visibilityLimit: number;
|
|
39
39
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
40
40
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -15,22 +15,22 @@ declare const __VLS_base: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {}, {
|
|
|
15
15
|
"update:modelValue": (value: (string | number)[]) => any;
|
|
16
16
|
} & {
|
|
17
17
|
"update:modelValue": (value: any[]) => any;
|
|
18
|
-
clear: () => any;
|
|
19
18
|
change: (checked: Record<string, any>[]) => any;
|
|
19
|
+
clear: () => any;
|
|
20
20
|
}, string, _$vue.PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
21
21
|
"onUpdate:modelValue"?: ((value: any[]) => any) | undefined;
|
|
22
|
-
onClear?: (() => any) | undefined;
|
|
23
22
|
onChange?: ((checked: Record<string, any>[]) => any) | undefined;
|
|
23
|
+
onClear?: (() => any) | undefined;
|
|
24
24
|
}>, {
|
|
25
|
+
minWidth: string;
|
|
26
|
+
disabled: boolean;
|
|
25
27
|
expandAll: boolean;
|
|
26
28
|
labelKey: string;
|
|
27
29
|
valueKey: string;
|
|
28
|
-
disabled: boolean;
|
|
29
30
|
readonly: boolean;
|
|
30
31
|
placeholder: string;
|
|
31
32
|
clearable: boolean;
|
|
32
33
|
filterable: boolean;
|
|
33
|
-
minWidth: string;
|
|
34
34
|
visibilityLimit: number;
|
|
35
35
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
36
36
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -4,9 +4,9 @@ import * as _$_veltra_utils0 from "@veltra/utils";
|
|
|
4
4
|
|
|
5
5
|
//#region src/components/notification/notification.vue.d.ts
|
|
6
6
|
declare const __VLS_export: _$vue.DefineComponent<NotificationProps, _$_veltra_utils0.DeconstructValue<_NotificationExposed>, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<NotificationProps> & Readonly<{}>, {
|
|
7
|
+
duration: number;
|
|
7
8
|
closable: boolean;
|
|
8
9
|
position: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
9
|
-
duration: number;
|
|
10
10
|
offset: number;
|
|
11
11
|
buttonText: string;
|
|
12
12
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
@@ -15,12 +15,12 @@ declare const __VLS_base: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {}, {
|
|
|
15
15
|
"update:modelValue": (value: number | undefined) => any;
|
|
16
16
|
} & {
|
|
17
17
|
"update:modelValue": (value?: number | undefined) => any;
|
|
18
|
-
clear: () => any;
|
|
19
18
|
change: (value?: number | undefined) => any;
|
|
19
|
+
clear: () => any;
|
|
20
20
|
}, string, _$vue.PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
21
21
|
"onUpdate:modelValue"?: ((value?: number | undefined) => any) | undefined;
|
|
22
|
-
onClear?: (() => any) | undefined;
|
|
23
22
|
onChange?: ((value?: number | undefined) => any) | undefined;
|
|
23
|
+
onClear?: (() => any) | undefined;
|
|
24
24
|
}>, {
|
|
25
25
|
disabled: boolean;
|
|
26
26
|
readonly: boolean;
|
|
@@ -82,11 +82,12 @@
|
|
|
82
82
|
flex-wrap: nowrap;
|
|
83
83
|
}
|
|
84
84
|
.u-paginator__btn:hover {
|
|
85
|
-
background-color: var(--u-color-primary-light-9);
|
|
85
|
+
background-color: var(--u-paginator-btn-hover-bg, var(--u-color-primary-light-9));
|
|
86
|
+
color: var(--u-paginator-btn-hover-color, var(--u-text-color-title));
|
|
86
87
|
}
|
|
87
88
|
.u-paginator__btn.is-active {
|
|
88
|
-
background-color: var(--u-color-primary-light-9);
|
|
89
|
-
color: var(--u-color-primary);
|
|
89
|
+
background-color: var(--u-paginator-btn-active-bg, var(--u-color-primary-light-9));
|
|
90
|
+
color: var(--u-paginator-btn-active-color, var(--u-color-primary));
|
|
90
91
|
}
|
|
91
92
|
.u-paginator__btn.is-disabled {
|
|
92
93
|
cursor: not-allowed;
|
|
@@ -16,11 +16,11 @@ type __VLS_Slots = {} & {
|
|
|
16
16
|
default?: (props: typeof __VLS_3) => any;
|
|
17
17
|
};
|
|
18
18
|
declare const __VLS_base: _$vue.DefineComponent<ProgressNodesProps, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {} & {
|
|
19
|
-
"update:modelValue": (value: string | number) => any;
|
|
20
19
|
click: (node: Record<string, any>, index: number) => any;
|
|
20
|
+
"update:modelValue": (value: string | number) => any;
|
|
21
21
|
}, string, _$vue.PublicProps, Readonly<ProgressNodesProps> & Readonly<{
|
|
22
|
-
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
23
22
|
onClick?: ((node: Record<string, any>, index: number) => any) | undefined;
|
|
23
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
24
24
|
}>, {
|
|
25
25
|
labelKey: string;
|
|
26
26
|
valueKey: string;
|
|
@@ -16,9 +16,9 @@ declare const __VLS_export: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {},
|
|
|
16
16
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
17
17
|
onChange?: ((item: Record<string, any>) => any) | undefined;
|
|
18
18
|
}>, {
|
|
19
|
+
disabled: boolean;
|
|
19
20
|
labelKey: string;
|
|
20
21
|
valueKey: string;
|
|
21
|
-
disabled: boolean;
|
|
22
22
|
readonly: boolean;
|
|
23
23
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
24
24
|
declare const _default: typeof __VLS_export;
|
|
@@ -26,9 +26,9 @@ declare const __VLS_base: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {}, {
|
|
|
26
26
|
"onUpdate:text"?: ((value: any) => any) | undefined;
|
|
27
27
|
"onUpdate:label"?: ((label?: string | undefined) => any) | undefined;
|
|
28
28
|
}>, {
|
|
29
|
+
disabled: boolean;
|
|
29
30
|
labelKey: string;
|
|
30
31
|
valueKey: string;
|
|
31
|
-
disabled: boolean;
|
|
32
32
|
readonly: boolean;
|
|
33
33
|
placeholder: string;
|
|
34
34
|
clearable: boolean;
|
|
@@ -52,7 +52,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
52
52
|
border: { type: Boolean },
|
|
53
53
|
virtualThreshold: { default: 80 },
|
|
54
54
|
expandable: { type: Boolean },
|
|
55
|
-
virtual: { type: Boolean },
|
|
56
55
|
defaultExpandAll: { type: Boolean },
|
|
57
56
|
textEllipsis: { type: Boolean }
|
|
58
57
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","names":[],"sources":["../../../src/components/table/table.vue"],"sourcesContent":["<template>\n <u-scroll\n :class=\"[\n cls.b,\n cls.m(size),\n bem.is('border', border),\n bem.is('all-expanded', allExpanded),\n bem.is('text-ellipsis', textEllipsis)\n ]\"\n ref=\"scrollRef\"\n :content-class=\"cls.e('content')\"\n @scroll=\"handleScroll\"\n >\n <table :class=\"cls.e('wrap')\">\n <colgroup ref=\"colgroupRef\">\n <col\n v-for=\"column of leafColumns\"\n :key=\"column.key\"\n :class=\"column.fixed\"\n :style=\"{\n width: withUnit(column.width, 'px'),\n minWidth: withUnit(column.minWidth, 'px')\n }\"\n />\n </colgroup>\n <UTableHead />\n\n <!--\n 虚拟滚动上占位:替代 tbody transform,避免 table-layout: fixed 下列宽抖动。\n 高度由 useVirtualizer 命令式写入 `style.height`,不经过模板响应式绑定,\n 因此滚动窗口变化不会引起表格模板重渲染。\n -->\n <tbody v-if=\"virtualEnabled\" aria-hidden=\"true\">\n <tr ref=\"beforeSpacerRef\">\n <td :colspan=\"leafColumns.length\" style=\"padding: 0; border: none\"></td>\n </tr>\n </tbody>\n\n <u-table-body>\n <slot name=\"body\" :columns=\"leafColumns\" :rows=\"rows\" />\n\n <template #empty v-if=\"slots.empty\">\n <slot name=\"empty\" />\n </template>\n </u-table-body>\n\n <!-- 虚拟滚动下占位(高度由 useVirtualizer 命令式写入) -->\n <tbody v-if=\"virtualEnabled\" aria-hidden=\"true\">\n <tr ref=\"afterSpacerRef\">\n <td :colspan=\"leafColumns.length\" style=\"padding: 0; border: none\"></td>\n </tr>\n </tbody>\n\n <u-table-foot ref=\"tableFoot\">\n <slot name=\"foot\" :columns=\"leafColumns\" :rows=\"rows\" />\n </u-table-foot>\n </table>\n\n <slot name=\"append\" />\n\n <div v-if=\"showResizeLine\" :class=\"cls.e('resize-line')\" ref=\"resizeLineRef\"></div>\n\n <!-- <u-tip v-if=\"textEllipsis\" ref=\"tip\"> </u-tip> -->\n </u-scroll>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useFallbackProps, useVirtualizer } from '@veltra/compositions'\nimport { bem, withUnit } from '@veltra/utils'\nimport { computed, provide, shallowRef, toRef, useTemplateRef, watch } from 'vue'\n\nimport type {\n TableProps,\n TableEmits,\n _TableExposed,\n TableColumnSlotsScope,\n ComponentSize,\n ScrollExposed,\n TableRowSlotsScope\n} from '../../types'\nimport { UScroll } from '../scroll'\nimport { TableDIKey } from './di'\nimport type { ColumnNode } from './node/col'\nimport type { TableRowNode } from './node/row'\nimport UTableBody from './table-body.vue'\nimport UTableFoot from './table-foot.vue'\n// import { UTip } from '../tip'\nimport UTableHead from './table-head'\nimport { useCheck } from './use-check'\nimport { useColResize } from './use-col-resize'\nimport { useColumns } from './use-columns'\nimport { useFixedColumns } from './use-fixed-columns'\nimport { useRows } from './use-rows'\nimport { useTable } from './use-table'\n\ndefineOptions({ name: 'Table' })\n\nconst props = withDefaults(defineProps<TableProps>(), {\n tree: false,\n stripe: true,\n textOverflow: 'line-break',\n virtualThreshold: 80\n})\nconst emit = defineEmits<TableEmits>()\n\nconst slots = defineSlots<{\n [key: `column:${string}`]: (props: TableColumnSlotsScope) => any\n [key: `header:${string}`]: (props: { column: ColumnNode }) => any\n 'row:expand'?: (props: TableRowSlotsScope) => any\n foot?: (props: { columns: ColumnNode[]; rows: TableRowNode[] }) => any\n body?: (props: { columns: ColumnNode[]; rows: TableRowNode[] }) => any\n empty?: () => any\n append?: () => any\n}>()\n\nconst cls = bem('table')\n\nconst { size } = useFallbackProps([props], { size: 'default' as ComponentSize })\n\nconst scrollRef = shallowRef<ScrollExposed>()\n\n// 占位 tr 的 DOM 句柄;交给 useVirtualizer 直接命令式写 style.height。\nconst beforeSpacerRef = useTemplateRef<HTMLElement>('beforeSpacerRef')\nconst afterSpacerRef = useTemplateRef<HTMLElement>('afterSpacerRef')\n\n// 行(useRows / useFixedColumns 需要 isScrolling,而虚拟化 hook 又依赖 rows.length;\n// 先用中继占位,下方 isScrolling 到位后 watch 回灌)。\nconst isScrollingRelay = shallowRef(false)\n\nconst {\n rows,\n toggleTreeRowExpand,\n allExpanded,\n toggleAllTreeRowExpand,\n rowForest,\n handleRowClick,\n handleCellClick,\n getRowByData\n} = useRows({ props, emit, isScrolling: isScrollingRelay })\n\nconst { createCheckColumn, createSelectColumn, clearChecked, clearSelected, checkedRows } =\n useCheck({ size, props, rows, rowForest, emit, cls })\n\nconst columnConfig = useColumns({\n props,\n createCheckColumn,\n createSelectColumn,\n toggleAllTreeRowExpand,\n cls\n})\n\nconst { leafColumns } = columnConfig\n\nconst { handleScroll, leftFixed, rightFixed } = useFixedColumns()\n\nconst {\n getColumnSlotsNode,\n getExpandRowSlotsNode,\n getHeaderSlotsNode,\n getCellClass,\n getCellCtx,\n getHeaderCellClass\n} = useTable({ props, cls, leftFixed, rightFixed })\n\nconst { showResizeLine, resizeLineRef, colgroupRef } = useColResize({ scrollRef, leafColumns })\n\nconst { virtualizer, items, isScrolling } = useVirtualizer({\n count: computed(() => rows.value.length),\n scrollEl: () => scrollRef.value?.containerRef ?? null,\n beforeEl: beforeSpacerRef,\n afterEl: afterSpacerRef,\n estimateSize: () => 41,\n // 注意:getItemKey 在构造期一次性写入底层 Virtualizer;闭包每次读的是当前 rows.value,\n // rows 引用整体替换后 key 仍有效(无需再 setOptions)。\n getItemKey: (i) => rows.value[i]?.uid ?? i\n})\n\nconst virtualEnabled = computed(() => {\n const t = props.virtualThreshold\n return t ? rows.value.length > t : true\n})\n\n// 把虚拟化 isScrolling 回灌到中继,供 useRows / useFixedColumns 读取。\nwatch(isScrolling, (v) => {\n isScrollingRelay.value = v\n})\n\n/**\n * E1:数据替换时的条件置顶。\n *\n * 旧实现无差别地 `scrollTo({ y: 0 })`,在「行内增删 / 排序 / 单行更新」等\n * 场景会把用户当前阅读位置跳走;仅在「翻页 / 显著数据集替换」时才需要复位。\n *\n * 判定阈值:|Δlen| / max(newLen, oldLen) ≥ 0.5,即行数变化量超过更大侧的一半时视为显著变化。\n * 选择 0.5 是因为典型的分页/搜索场景会带来 50% 以上的行数差(通常完全替换数据集),\n * 而行内追加 / 删除个位数通常只带来 <5% 的变化;两者区分度足够宽。\n */\nconst LENGTH_DELTA_RATIO_TO_RESET_SCROLL = 0.5\n\nwatch(\n () => props.data,\n (next, prev) => {\n const nextLen = next?.length ?? 0\n const prevLen = prev?.length ?? 0\n const denom = Math.max(nextLen, prevLen, 1)\n const ratio = Math.abs(nextLen - prevLen) / denom\n if (ratio >= LENGTH_DELTA_RATIO_TO_RESET_SCROLL) {\n scrollRef.value?.scrollTo({ y: 0 })\n }\n }\n)\n\n// const tipRef = useTemplateRef('tip')\n\nprovide(TableDIKey, {\n tableProps: props,\n tableSlots: slots,\n cls,\n rows,\n checkedRows,\n columnConfig,\n handleRowClick,\n handleCellClick,\n getColumnSlotsNode,\n getExpandRowSlotsNode,\n getHeaderSlotsNode,\n getCellClass,\n getCellCtx,\n getHeaderCellClass,\n // tipRef,\n toggleTreeRowExpand,\n virtualList: items,\n virtualEnabled,\n measureElement: (index, el) => virtualizer.measureElement(index, el)\n})\n\nconst tableFootRef = useTemplateRef('tableFoot')\n\ndefineExpose<_TableExposed>({\n el: toRef(() => scrollRef.value?.el),\n clearChecked,\n clearSelected,\n getRowByData,\n getSummaryRow: () => tableFootRef.value!.getSummaryRow()\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAqMA,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EApG3C,MAAM,QAAQ;EAMd,MAAM,OAAO;EAEb,MAAM,QAAQ,UAAA;EAUd,MAAM,MAAM,IAAI,QAAO;EAEvB,MAAM,EAAE,SAAS,iBAAiB,CAAC,MAAM,EAAE,EAAE,MAAM,WAA4B,CAAA;EAE/E,MAAM,YAAY,YAA0B;EAG5C,MAAM,kBAAkB,eAA4B,kBAAiB;EACrE,MAAM,iBAAiB,eAA4B,iBAAgB;EAInE,MAAM,mBAAmB,WAAW,MAAK;EAEzC,MAAM,EACJ,MACA,qBACA,aACA,wBACA,WACA,gBACA,iBACA,iBACE,QAAQ;GAAE;GAAO;GAAM,aAAa;GAAkB,CAAA;EAE1D,MAAM,EAAE,mBAAmB,oBAAoB,cAAc,eAAe,gBAC1E,SAAS;GAAE;GAAM;GAAO;GAAM;GAAW;GAAM;GAAK,CAAA;EAEtD,MAAM,eAAe,WAAW;GAC9B;GACA;GACA;GACA;GACA;GACD,CAAA;EAED,MAAM,EAAE,gBAAgB;EAExB,MAAM,EAAE,cAAc,WAAW,eAAe,iBAAgB;EAEhE,MAAM,EACJ,oBACA,uBACA,oBACA,cACA,YACA,uBACE,SAAS;GAAE;GAAO;GAAK;GAAW;GAAY,CAAA;E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,CAAxD,WAAwD,KAAA,QAAA,QAAA;QAArC,SAAS,MAAA,YAAW;QAAG,MAAM,MAAA,KAAI;;;;;KAIxD,WAAsB,KAAA,QAAA,SAAA;KAEX,MAAA,eAAc,IAAA,WAAA,EAAzB,mBAAmF,OAAA;;MAAvD,OAAK,eAAE,MAAA,IAAG,CAAC,EAAC,cAAA,CAAA;eAAqB;MAAJ,KAAI;;KAE7D,mBAAA,uDAAuD"}
|
|
1
|
+
{"version":3,"file":"table.js","names":[],"sources":["../../../src/components/table/table.vue"],"sourcesContent":["<template>\n <u-scroll\n :class=\"[\n cls.b,\n cls.m(size),\n bem.is('border', border),\n bem.is('all-expanded', allExpanded),\n bem.is('text-ellipsis', textEllipsis)\n ]\"\n ref=\"scrollRef\"\n :content-class=\"cls.e('content')\"\n @scroll=\"handleScroll\"\n >\n <table :class=\"cls.e('wrap')\">\n <colgroup ref=\"colgroupRef\">\n <col\n v-for=\"column of leafColumns\"\n :key=\"column.key\"\n :class=\"column.fixed\"\n :style=\"{\n width: withUnit(column.width, 'px'),\n minWidth: withUnit(column.minWidth, 'px')\n }\"\n />\n </colgroup>\n <UTableHead />\n\n <!--\n 虚拟滚动上占位:替代 tbody transform,避免 table-layout: fixed 下列宽抖动。\n 高度由 useVirtualizer 命令式写入 `style.height`,不经过模板响应式绑定,\n 因此滚动窗口变化不会引起表格模板重渲染。\n -->\n <tbody v-if=\"virtualEnabled\" aria-hidden=\"true\">\n <tr ref=\"beforeSpacerRef\">\n <td :colspan=\"leafColumns.length\" style=\"padding: 0; border: none\"></td>\n </tr>\n </tbody>\n\n <u-table-body>\n <slot name=\"body\" :columns=\"leafColumns\" :rows=\"rows\" />\n\n <template #empty v-if=\"slots.empty\">\n <slot name=\"empty\" />\n </template>\n </u-table-body>\n\n <!-- 虚拟滚动下占位(高度由 useVirtualizer 命令式写入) -->\n <tbody v-if=\"virtualEnabled\" aria-hidden=\"true\">\n <tr ref=\"afterSpacerRef\">\n <td :colspan=\"leafColumns.length\" style=\"padding: 0; border: none\"></td>\n </tr>\n </tbody>\n\n <u-table-foot ref=\"tableFoot\">\n <slot name=\"foot\" :columns=\"leafColumns\" :rows=\"rows\" />\n </u-table-foot>\n </table>\n\n <slot name=\"append\" />\n\n <div v-if=\"showResizeLine\" :class=\"cls.e('resize-line')\" ref=\"resizeLineRef\"></div>\n\n <!-- <u-tip v-if=\"textEllipsis\" ref=\"tip\"> </u-tip> -->\n </u-scroll>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useFallbackProps, useVirtualizer } from '@veltra/compositions'\nimport { bem, withUnit } from '@veltra/utils'\nimport { computed, provide, shallowRef, toRef, useTemplateRef, watch } from 'vue'\n\nimport type {\n TableProps,\n TableEmits,\n _TableExposed,\n TableColumnSlotsScope,\n ComponentSize,\n ScrollExposed,\n TableRowSlotsScope\n} from '../../types'\nimport { UScroll } from '../scroll'\nimport { TableDIKey } from './di'\nimport type { ColumnNode } from './node/col'\nimport type { TableRowNode } from './node/row'\nimport UTableBody from './table-body.vue'\nimport UTableFoot from './table-foot.vue'\n// import { UTip } from '../tip'\nimport UTableHead from './table-head'\nimport { useCheck } from './use-check'\nimport { useColResize } from './use-col-resize'\nimport { useColumns } from './use-columns'\nimport { useFixedColumns } from './use-fixed-columns'\nimport { useRows } from './use-rows'\nimport { useTable } from './use-table'\n\ndefineOptions({ name: 'Table' })\n\nconst props = withDefaults(defineProps<TableProps>(), {\n tree: false,\n stripe: true,\n textOverflow: 'line-break',\n virtualThreshold: 80\n})\nconst emit = defineEmits<TableEmits>()\n\nconst slots = defineSlots<{\n [key: `column:${string}`]: (props: TableColumnSlotsScope) => any\n [key: `header:${string}`]: (props: { column: ColumnNode }) => any\n 'row:expand'?: (props: TableRowSlotsScope) => any\n foot?: (props: { columns: ColumnNode[]; rows: TableRowNode[] }) => any\n body?: (props: { columns: ColumnNode[]; rows: TableRowNode[] }) => any\n empty?: () => any\n append?: () => any\n}>()\n\nconst cls = bem('table')\n\nconst { size } = useFallbackProps([props], { size: 'default' as ComponentSize })\n\nconst scrollRef = shallowRef<ScrollExposed>()\n\n// 占位 tr 的 DOM 句柄;交给 useVirtualizer 直接命令式写 style.height。\nconst beforeSpacerRef = useTemplateRef<HTMLElement>('beforeSpacerRef')\nconst afterSpacerRef = useTemplateRef<HTMLElement>('afterSpacerRef')\n\n// 行(useRows / useFixedColumns 需要 isScrolling,而虚拟化 hook 又依赖 rows.length;\n// 先用中继占位,下方 isScrolling 到位后 watch 回灌)。\nconst isScrollingRelay = shallowRef(false)\n\nconst {\n rows,\n toggleTreeRowExpand,\n allExpanded,\n toggleAllTreeRowExpand,\n rowForest,\n handleRowClick,\n handleCellClick,\n getRowByData\n} = useRows({ props, emit, isScrolling: isScrollingRelay })\n\nconst { createCheckColumn, createSelectColumn, clearChecked, clearSelected, checkedRows } =\n useCheck({ size, props, rows, rowForest, emit, cls })\n\nconst columnConfig = useColumns({\n props,\n createCheckColumn,\n createSelectColumn,\n toggleAllTreeRowExpand,\n cls\n})\n\nconst { leafColumns } = columnConfig\n\nconst { handleScroll, leftFixed, rightFixed } = useFixedColumns()\n\nconst {\n getColumnSlotsNode,\n getExpandRowSlotsNode,\n getHeaderSlotsNode,\n getCellClass,\n getCellCtx,\n getHeaderCellClass\n} = useTable({ props, cls, leftFixed, rightFixed })\n\nconst { showResizeLine, resizeLineRef, colgroupRef } = useColResize({ scrollRef, leafColumns })\n\nconst { virtualizer, items, isScrolling } = useVirtualizer({\n count: computed(() => rows.value.length),\n scrollEl: () => scrollRef.value?.containerRef ?? null,\n beforeEl: beforeSpacerRef,\n afterEl: afterSpacerRef,\n estimateSize: () => 41,\n // 注意:getItemKey 在构造期一次性写入底层 Virtualizer;闭包每次读的是当前 rows.value,\n // rows 引用整体替换后 key 仍有效(无需再 setOptions)。\n getItemKey: (i) => rows.value[i]?.uid ?? i\n})\n\nconst virtualEnabled = computed(() => {\n const t = props.virtualThreshold\n return t ? rows.value.length > t : true\n})\n\n// 把虚拟化 isScrolling 回灌到中继,供 useRows / useFixedColumns 读取。\nwatch(isScrolling, (v) => {\n isScrollingRelay.value = v\n})\n\n/**\n * E1:数据替换时的条件置顶。\n *\n * 旧实现无差别地 `scrollTo({ y: 0 })`,在「行内增删 / 排序 / 单行更新」等\n * 场景会把用户当前阅读位置跳走;仅在「翻页 / 显著数据集替换」时才需要复位。\n *\n * 判定阈值:|Δlen| / max(newLen, oldLen) ≥ 0.5,即行数变化量超过更大侧的一半时视为显著变化。\n * 选择 0.5 是因为典型的分页/搜索场景会带来 50% 以上的行数差(通常完全替换数据集),\n * 而行内追加 / 删除个位数通常只带来 <5% 的变化;两者区分度足够宽。\n */\nconst LENGTH_DELTA_RATIO_TO_RESET_SCROLL = 0.5\n\nwatch(\n () => props.data,\n (next, prev) => {\n const nextLen = next?.length ?? 0\n const prevLen = prev?.length ?? 0\n const denom = Math.max(nextLen, prevLen, 1)\n const ratio = Math.abs(nextLen - prevLen) / denom\n if (ratio >= LENGTH_DELTA_RATIO_TO_RESET_SCROLL) {\n scrollRef.value?.scrollTo({ y: 0 })\n }\n }\n)\n\n// const tipRef = useTemplateRef('tip')\n\nprovide(TableDIKey, {\n tableProps: props,\n tableSlots: slots,\n cls,\n rows,\n checkedRows,\n columnConfig,\n handleRowClick,\n handleCellClick,\n getColumnSlotsNode,\n getExpandRowSlotsNode,\n getHeaderSlotsNode,\n getCellClass,\n getCellCtx,\n getHeaderCellClass,\n // tipRef,\n toggleTreeRowExpand,\n virtualList: items,\n virtualEnabled,\n measureElement: (index, el) => virtualizer.measureElement(index, el)\n})\n\nconst tableFootRef = useTemplateRef('tableFoot')\n\ndefineExpose<_TableExposed>({\n el: toRef(() => scrollRef.value?.el),\n clearChecked,\n clearSelected,\n getRowByData,\n getSummaryRow: () => tableFootRef.value!.getSummaryRow()\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAqMA,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EApG3C,MAAM,QA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SAAQ,CAAC,OAAO,UAAQ,KAAA;;;;MAM7G,YAAc,MAAA,UAAA,CAAA;MAEd,mBAAA,wKAIG;MACU,eAAA,SAAA,WAAA,EAAb,mBAIQ,SAJR,YAIQ,CAHN,mBAEK,MAAA;gBAFG;OAAJ,KAAI;UACN,mBAAwE,MAAA;OAAnE,SAAS,MAAA,YAAW,CAAC;OAAQ,OAAA;QAAA,WAAA;QAAA,UAAA;QAAgC;;MAItE,YAMe,aAAA,MAAA,YAAA;8BAL2C,CAAxD,WAAwD,KAAA,QAAA,QAAA;QAArC,SAAS,MAAA,YAAW;QAAG,MAAM,MAAA,KAAI;;;UAE7B,MAAM,QAAA;aAAlB;yBACY,CAArB,WAAqB,KAAA,QAAA,QAAA,CAAA,CAAA;;;MAIzB,mBAAA,sCAA0C;MAC7B,eAAA,SAAA,WAAA,EAAb,mBAIQ,SAJR,YAIQ,CAHN,mBAEK,MAAA;gBAFG;OAAJ,KAAI;UACN,mBAAwE,MAAA;OAAnE,SAAS,MAAA,YAAW,CAAC;OAAQ,OAAA;QAAA,WAAA;QAAA,UAAA;QAAgC;;MAItE,YAEe,aAAA,EAFD,KAAI,aAAW,EAAA;8BAC6B,CAAxD,WAAwD,KAAA,QAAA,QAAA;QAArC,SAAS,MAAA,YAAW;QAAG,MAAM,MAAA,KAAI;;;;;KAIxD,WAAsB,KAAA,QAAA,SAAA;KAEX,MAAA,eAAc,IAAA,WAAA,EAAzB,mBAAmF,OAAA;;MAAvD,OAAK,eAAE,MAAA,IAAG,CAAC,EAAC,cAAA,CAAA;eAAqB;MAAJ,KAAI;;KAE7D,mBAAA,uDAAuD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-editor.js","names":["$slots"],"sources":["../../../src/components/table-editor/table-editor.vue"],"sourcesContent":["<template>\n <u-table\n :columns=\"internalColumns\"\n :data=\"modelValue || []\"\n :class=\"cls.b\"\n :stripe=\"false\"\n show-index\n :slots=\"$slots\"\n >\n <template #column:__operation=\"{ row }\">\n <ButtonCommonProps tag=\"div\" style=\"display: flex; justify-content: center; gap: 8px\">\n <u-button type=\"danger\" @click=\"handleDelete(row.index)\" :icon=\"Minus\" title=\"移除\" />\n <u-button :icon=\"Plus\" @click=\"handleCreate(row.index)\" title=\"新增到下一行\" />\n <u-button :icon=\"Copy\" @click=\"handleCopy(row)\" title=\"复制到下一行\" />\n </ButtonCommonProps>\n </template>\n\n <!-- <template #header:__operation> </template> -->\n\n <template #empty>\n <div style=\"text-align: center; padding: 4px 0\">\n <u-button\n text\n size=\"small\"\n type=\"primary\"\n v-if=\"!modelValue.length\"\n :icon=\"Plus\"\n @click=\"handleCreate()\"\n >添加</u-button\n >\n </div>\n </template>\n </u-table>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useComponentProps } from '@veltra/compositions'\nimport { Copy, Minus, Plus } from '@veltra/icons/normal'\nimport { bem } from '@veltra/utils'\nimport { computed } from 'vue'\n\nimport type { TableEditorProps, TableEditorEmits, TableColumn } from '../../types'\nimport { UButton } from '../button'\nimport { UTable } from '../table'\nimport type { TableRowNode } from '../table/node/row'\n\ndefineOptions({\n name: 'TableEditor'\n})\n\nconst { columns = [], modelValue = [] } = defineProps<TableEditorProps>()\nconst emit = defineEmits<TableEditorEmits>()\n\nconst cls = bem('table-editor')\n\nconst ButtonCommonProps = useComponentProps({\n size: 'small',\n circle: true,\n text: true,\n type: 'primary'\n})\n\nconst actionColumn: TableColumn = {\n key: '__operation',\n name: '操作', // 使用name而不是title\n width: 120,\n align: 'center',\n fixed: 'right',\n resizable: false\n}\n\n// 内部列定义,添加编辑和删除操作列\nconst internalColumns = computed(() => {\n return [...columns, actionColumn]\n})\n\nfunction handleCreate(index?: number) {\n if (index !== undefined) {\n emit('update:modelValue', [\n ...modelValue.slice(0, index + 1),\n {},\n ...modelValue.slice(index + 1)\n ])\n } else {\n emit('update:modelValue', [...modelValue, {}])\n }\n}\n\nfunction handleCopy(row: TableRowNode) {\n emit('update:modelValue', [\n ...modelValue.slice(0, row.index + 1),\n JSON.parse(JSON.stringify(row.data)),\n ...modelValue.slice(row.index + 1)\n ])\n}\n\nfunction handleDelete(index: number) {\n emit(\n 'update:modelValue',\n modelValue.filter((_, i) => i !== index)\n )\n}\n</script>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"table-editor.js","names":["$slots"],"sources":["../../../src/components/table-editor/table-editor.vue"],"sourcesContent":["<template>\n <u-table\n :columns=\"internalColumns\"\n :data=\"modelValue || []\"\n :class=\"cls.b\"\n :stripe=\"false\"\n show-index\n :slots=\"$slots\"\n >\n <template #column:__operation=\"{ row }\">\n <ButtonCommonProps tag=\"div\" style=\"display: flex; justify-content: center; gap: 8px\">\n <u-button type=\"danger\" @click=\"handleDelete(row.index)\" :icon=\"Minus\" title=\"移除\" />\n <u-button :icon=\"Plus\" @click=\"handleCreate(row.index)\" title=\"新增到下一行\" />\n <u-button :icon=\"Copy\" @click=\"handleCopy(row)\" title=\"复制到下一行\" />\n </ButtonCommonProps>\n </template>\n\n <!-- <template #header:__operation> </template> -->\n\n <template #empty>\n <div style=\"text-align: center; padding: 4px 0\">\n <u-button\n text\n size=\"small\"\n type=\"primary\"\n v-if=\"!modelValue.length\"\n :icon=\"Plus\"\n @click=\"handleCreate()\"\n >添加</u-button\n >\n </div>\n </template>\n </u-table>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useComponentProps } from '@veltra/compositions'\nimport { Copy, Minus, Plus } from '@veltra/icons/normal'\nimport { bem } from '@veltra/utils'\nimport { computed } from 'vue'\n\nimport type { TableEditorProps, TableEditorEmits, TableColumn } from '../../types'\nimport { UButton } from '../button'\nimport { UTable } from '../table'\nimport type { TableRowNode } from '../table/node/row'\n\ndefineOptions({\n name: 'TableEditor'\n})\n\nconst { columns = [], modelValue = [] } = defineProps<TableEditorProps>()\nconst emit = defineEmits<TableEditorEmits>()\n\nconst cls = bem('table-editor')\n\nconst ButtonCommonProps = useComponentProps({\n size: 'small',\n circle: true,\n text: true,\n type: 'primary'\n})\n\nconst actionColumn: TableColumn = {\n key: '__operation',\n name: '操作', // 使用name而不是title\n width: 120,\n align: 'center',\n fixed: 'right',\n resizable: false\n}\n\n// 内部列定义,添加编辑和删除操作列\nconst internalColumns = computed(() => {\n return [...columns, actionColumn]\n})\n\nfunction handleCreate(index?: number) {\n if (index !== undefined) {\n emit('update:modelValue', [\n ...modelValue.slice(0, index + 1),\n {},\n ...modelValue.slice(index + 1)\n ])\n } else {\n emit('update:modelValue', [...modelValue, {}])\n }\n}\n\nfunction handleCopy(row: TableRowNode) {\n emit('update:modelValue', [\n ...modelValue.slice(0, row.index + 1),\n JSON.parse(JSON.stringify(row.data)),\n ...modelValue.slice(row.index + 1)\n ])\n}\n\nfunction handleDelete(index: number) {\n emit(\n 'update:modelValue',\n modelValue.filter((_, i) => i !== index)\n )\n}\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmDA,MAAM,OAAO;EAEb,MAAM,MAAM,IAAI,eAAc;EAE9B,MAAM,oBAAoB,kBAAkB;GAC1C,MAAM;GACN,QAAQ;GACR,MAAM;GACN,MAAM;GACP,CAAA;EAED,MAAM,eAA4B;GAChC,KAAK;GACL,MAAM;GACN,OAAO;GACP,OAAO;GACP,OAAO;GACP,WAAW;GACb;EAGA,MAAM,kBAAkB,eAAe;AACrC,UAAO,CAAC,GAAG,QAAA,SAAS,aAAY;IACjC;EAED,SAAS,aAAa,OAAgB;AACpC,OAAI,UAAU,KAAA,EACZ,MAAK,qBAAqB;IACxB,GAAG,QAAA,WAAW,MAAM,GAAG,QAAQ,EAAE;IACjC,EAAE;IACF,GAAG,QAAA,WAAW,MAAM,QAAQ,EAAC;IAC9B,CAAA;OAED,MAAK,qBAAqB,CAAC,GAAG,QAAA,YAAY,EAAE,CAAC,CAAA;;EAIjD,SAAS,WAAW,KAAmB;AACrC,QAAK,qBAAqB;IACxB,GAAG,QAAA,WAAW,MAAM,GAAG,IAAI,QAAQ,EAAE;IACrC,KAA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