@veltra/desktop 1.1.3 → 1.1.5
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.js +3 -110
- package/dist/components/action/action-group.js.map +1 -1
- package/dist/components/action/action-group.vue.d.ts +5 -14
- package/dist/components/action/action-group.vue_vue_type_script_setup_true_lang.js +105 -0
- package/dist/components/action/action-group.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/action/action.js +5 -1
- package/dist/components/action/action.js.map +1 -1
- package/dist/components/action/di.js.map +1 -1
- package/dist/components/action/style2.css +17 -14
- package/dist/components/auto-complete/auto-complete.js +1 -1
- package/dist/components/auto-complete/auto-complete.vue.d.ts +2 -2
- package/dist/components/badge/badge.js +1 -1
- package/dist/components/batch-edit/batch-edit-form.js +94 -101
- package/dist/components/batch-edit/batch-edit-form.js.map +1 -1
- package/dist/components/batch-edit/batch-edit-list.js +52 -68
- package/dist/components/batch-edit/batch-edit-list.js.map +1 -1
- package/dist/components/batch-edit/style2.css +13 -89
- package/dist/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/components/button/button.js +1 -1
- package/dist/components/card/card.js +1 -1
- package/dist/components/cascade/cascade-panel-item.js +4 -4
- package/dist/components/cascade/cascade.js +2 -2
- package/dist/components/cascade/cascade.vue.d.ts +5 -5
- package/dist/components/checkbox/checkbox-button.js +1 -1
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/checkbox-group/checkbox-group.js +1 -1
- package/dist/components/code-editor/code-editor.js +1 -1
- package/dist/components/collapse/collapse.js +1 -1
- package/dist/components/condition-editor/components/condition-group.js +152 -0
- package/dist/components/condition-editor/components/condition-group.js.map +1 -0
- package/dist/components/condition-editor/components/condition-row.js +217 -0
- package/dist/components/condition-editor/components/condition-row.js.map +1 -0
- package/dist/components/condition-editor/condition-editor.js +134 -5
- package/dist/components/condition-editor/condition-editor.js.map +1 -1
- package/dist/components/condition-editor/condition-editor.vue.d.ts +10 -2
- package/dist/components/condition-editor/core/evaluator.js +75 -0
- package/dist/components/condition-editor/core/evaluator.js.map +1 -0
- package/dist/components/condition-editor/core/operators.js +123 -0
- package/dist/components/condition-editor/core/operators.js.map +1 -0
- package/dist/components/condition-editor/style.js +7 -0
- package/dist/components/condition-editor/style2.css +186 -0
- package/dist/components/context-menu/context-menu.js +1 -1
- package/dist/components/date-picker/date-picker.js +2 -2
- package/dist/components/date-picker/date-picker.vue.d.ts +2 -2
- package/dist/components/date-range-picker/date-range-picker.js +2 -2
- package/dist/components/date-range-picker/date-range-picker.vue.d.ts +2 -2
- package/dist/components/dialog/dialog.js +7 -7
- package/dist/components/dialog/style2.css +8 -0
- package/dist/components/dialog/use-maximum.js +1 -1
- package/dist/components/drawer/style2.css +8 -0
- package/dist/components/dropdown/dropdown.js +1 -1
- package/dist/components/expression-editor/components/variable-picker.js +8 -8
- package/dist/components/expression-editor/expression-editor.js +1 -1
- package/dist/components/expression-editor/style2.css +1 -0
- package/dist/components/file-viewer/file-viewer.js +13 -13
- package/dist/components/form-item/form-item.js.map +1 -1
- package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/grid-input/grid-input.js +1 -1
- package/dist/components/group-input/group-input.js +2 -1
- package/dist/components/group-input/group-input.js.map +1 -1
- package/dist/components/group-input/style.js +1 -0
- package/dist/components/index.js +154 -154
- package/dist/components/input/input.vue.d.ts +4 -4
- package/dist/components/input/input.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/layout/layout-resizer.js +1 -1
- package/dist/components/layout/layout.js +1 -1
- package/dist/components/list/list.js +1 -1
- package/dist/components/loading/loading.js +1 -1
- package/dist/components/menu/menu-sub-collapsed.js +4 -4
- package/dist/components/menu/menu.js +1 -1
- package/dist/components/message/message.js +1 -1
- package/dist/components/message-confirm/message-confirm.js +1 -1
- package/dist/components/multi-select/multi-select-option.js +19 -14
- package/dist/components/multi-select/multi-select-option.js.map +1 -1
- package/dist/components/multi-select/multi-select.js +15 -15
- package/dist/components/multi-select/multi-select.vue.d.ts +4 -4
- package/dist/components/multi-tree-select/multi-tree-select.js +8 -8
- package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +6 -6
- package/dist/components/notification/notification.js +1 -1
- package/dist/components/notification/notification.vue.d.ts +1 -1
- package/dist/components/number/number.vue.d.ts +1 -1
- package/dist/components/number-input/number-input.js +2 -2
- package/dist/components/number-input/number-input.vue.d.ts +4 -4
- package/dist/components/number-range-input/number-range-input.js +1 -1
- package/dist/components/number-range-input/number-range-input.vue.d.ts +1 -1
- package/dist/components/number-range-input/style2.css +1 -0
- package/dist/components/paginator/paginator.js +6 -6
- package/dist/components/paginator/style.js +1 -1
- package/dist/components/palette/palette.js +1 -1
- package/dist/components/password-input/password-input.js +2 -2
- package/dist/components/password-input/password-input.vue.d.ts +1 -1
- package/dist/components/pop-confirm/pop-confirm.js +1 -1
- package/dist/components/pop-confirm/pop-confirm.vue.d.ts +1 -1
- package/dist/components/progress-nodes/progress-nodes.js +1 -1
- package/dist/components/radio/radio.js +1 -1
- package/dist/components/radio-group/radio-group.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.vue.d.ts +1 -1
- package/dist/components/scroll/scroll-bar.js +1 -1
- package/dist/components/scroll/scroll.js +1 -1
- package/dist/components/select/select.js +10 -10
- package/dist/components/select/select.vue.d.ts +2 -2
- package/dist/components/slider/slider.js +1 -1
- package/dist/components/steps/steps.js +2 -2
- package/dist/components/switch/switch.js +1 -1
- package/dist/components/table/style2.css +4 -1
- package/dist/components/table/table.js +2 -2
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/table/use-columns.js +1 -1
- package/dist/components/table/use-fixed-columns.js +8 -31
- package/dist/components/table/use-fixed-columns.js.map +1 -1
- package/dist/components/table-editor/table-editor.js +1 -1
- package/dist/components/tabs/tabs-horizontal.js +1 -1
- package/dist/components/tabs/tabs-horizontal.vue.d.ts +4 -4
- package/dist/components/tabs/tabs-vertical.js +1 -1
- package/dist/components/tabs/tabs-vertical.vue.d.ts +3 -3
- package/dist/components/tabs/tabs.js +1 -1
- package/dist/components/tabs/tabs.vue.d.ts +4 -4
- package/dist/components/tag/tag.js +1 -1
- package/dist/components/textarea/textarea.js +1 -1
- package/dist/components/textarea/textarea.vue.d.ts +4 -4
- package/dist/components/theme/style.js +1 -1
- package/dist/components/theme/theme.js +11 -11
- package/dist/components/tip/tip.js +1 -1
- package/dist/components/tree/tree-node.js +1 -1
- package/dist/components/tree/tree.js +5 -5
- package/dist/components/tree-select/tree-select.js +6 -6
- package/dist/components/tree-select/tree-select.vue.d.ts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +83 -83
- package/dist/style.js +2 -2
- package/dist/types/action.d.ts +5 -11
- package/dist/types/condition-editor.d.ts +41 -8
- package/dist/types/index.d.ts +4 -4
- package/package.json +11 -11
- package/src/components/action/action-group.vue +68 -82
- package/src/components/action/action.vue +9 -1
- package/src/components/action/di.ts +2 -1
- package/src/components/action/style.scss +22 -27
- package/src/components/batch-edit/batch-edit-form.vue +65 -70
- package/src/components/batch-edit/batch-edit-list.vue +35 -41
- package/src/components/batch-edit/style.scss +19 -118
- package/src/components/condition-editor/components/condition-group.vue +131 -0
- package/src/components/condition-editor/components/condition-row.vue +208 -0
- package/src/components/condition-editor/condition-editor.vue +145 -6
- package/src/components/condition-editor/core/evaluator.ts +93 -0
- package/src/components/condition-editor/core/operators.ts +57 -0
- package/src/components/condition-editor/style.scss +239 -1
- package/src/components/condition-editor/style.ts +7 -0
- package/src/components/dialog/style.scss +13 -0
- package/src/components/drawer/style.scss +13 -0
- package/src/components/expression-editor/style.scss +1 -0
- package/src/components/form-item/form-item.vue +1 -1
- package/src/components/group-input/group-input.vue +8 -1
- package/src/components/group-input/style.ts +1 -0
- package/src/components/multi-select/multi-select-option.vue +19 -13
- package/src/components/number-range-input/style.scss +1 -0
- package/src/components/table/style.scss +9 -1
- package/src/components/table/table.vue +1 -3
- package/src/components/table/use-fixed-columns.ts +5 -49
- package/src/types/action.ts +6 -11
- package/src/types/condition-editor.ts +39 -7
|
@@ -15,3 +15,189 @@
|
|
|
15
15
|
* --u-height-small: 24px;
|
|
16
16
|
*/
|
|
17
17
|
/** 暗色:data-theme 与系统偏好,与 UITheme.injectBuiltInThemes 选择器策略一致 */
|
|
18
|
+
.u-condition-editor__group-header {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: 6px;
|
|
22
|
+
margin-bottom: 4px;
|
|
23
|
+
}
|
|
24
|
+
.u-condition-editor__group-body {
|
|
25
|
+
border-left: 2px solid var(--u-border-muted-color);
|
|
26
|
+
margin-left: 8px;
|
|
27
|
+
padding-left: 10px;
|
|
28
|
+
}
|
|
29
|
+
.u-condition-editor__group-actions {
|
|
30
|
+
display: flex;
|
|
31
|
+
gap: 10px;
|
|
32
|
+
padding: 2px 0;
|
|
33
|
+
}
|
|
34
|
+
.u-condition-editor__group-result {
|
|
35
|
+
font-size: 11px;
|
|
36
|
+
font-weight: 600;
|
|
37
|
+
}
|
|
38
|
+
.u-condition-editor__group-result--pass {
|
|
39
|
+
color: var(--u-color-success);
|
|
40
|
+
}
|
|
41
|
+
.u-condition-editor__group-result--fail {
|
|
42
|
+
color: var(--u-color-danger);
|
|
43
|
+
}
|
|
44
|
+
.u-condition-editor__logic-tag {
|
|
45
|
+
display: inline-block;
|
|
46
|
+
padding: 1px 8px;
|
|
47
|
+
border-radius: var(--u-radius-small);
|
|
48
|
+
font-size: 11px;
|
|
49
|
+
font-weight: 600;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
user-select: none;
|
|
52
|
+
transition: background-color 0.12s ease;
|
|
53
|
+
}
|
|
54
|
+
.u-condition-editor__logic-tag--and {
|
|
55
|
+
background-color: var(--u-color-primary-light-9);
|
|
56
|
+
color: var(--u-color-primary);
|
|
57
|
+
}
|
|
58
|
+
.u-condition-editor__logic-tag--and:hover {
|
|
59
|
+
background-color: var(--u-color-primary-light-8);
|
|
60
|
+
}
|
|
61
|
+
.u-condition-editor__logic-tag--or {
|
|
62
|
+
background-color: var(--u-color-warning-light-9);
|
|
63
|
+
color: var(--u-color-warning);
|
|
64
|
+
}
|
|
65
|
+
.u-condition-editor__logic-tag--or:hover {
|
|
66
|
+
background-color: var(--u-color-warning-light-8);
|
|
67
|
+
}
|
|
68
|
+
.u-condition-editor__row {
|
|
69
|
+
display: flex;
|
|
70
|
+
gap: 4px;
|
|
71
|
+
align-items: center;
|
|
72
|
+
margin-bottom: 3px;
|
|
73
|
+
}
|
|
74
|
+
.u-condition-editor__field {
|
|
75
|
+
width: 90px;
|
|
76
|
+
flex-shrink: 0;
|
|
77
|
+
}
|
|
78
|
+
.u-condition-editor__operator {
|
|
79
|
+
width: 80px;
|
|
80
|
+
flex-shrink: 0;
|
|
81
|
+
}
|
|
82
|
+
.u-condition-editor__value {
|
|
83
|
+
flex: 1;
|
|
84
|
+
min-width: 0;
|
|
85
|
+
display: flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
}
|
|
88
|
+
.u-condition-editor__value-input {
|
|
89
|
+
width: 100%;
|
|
90
|
+
height: 28px;
|
|
91
|
+
padding: 0 8px;
|
|
92
|
+
border: 1px solid var(--u-border-muted-color);
|
|
93
|
+
border-radius: var(--u-radius-small);
|
|
94
|
+
font-size: 12px;
|
|
95
|
+
color: var(--u-text-color-main);
|
|
96
|
+
background-color: var(--u-bg-color-top);
|
|
97
|
+
outline: none;
|
|
98
|
+
transition: border-color 0.12s ease;
|
|
99
|
+
}
|
|
100
|
+
.u-condition-editor__value-input::placeholder {
|
|
101
|
+
color: var(--u-text-color-placeholder);
|
|
102
|
+
}
|
|
103
|
+
.u-condition-editor__value-input:focus {
|
|
104
|
+
border-color: var(--u-color-primary);
|
|
105
|
+
}
|
|
106
|
+
.u-condition-editor__value-input:disabled {
|
|
107
|
+
background-color: var(--u-color-disabled);
|
|
108
|
+
cursor: not-allowed;
|
|
109
|
+
}
|
|
110
|
+
.u-condition-editor__value-empty {
|
|
111
|
+
font-size: 12px;
|
|
112
|
+
color: var(--u-text-color-assist);
|
|
113
|
+
}
|
|
114
|
+
.u-condition-editor__value-chip {
|
|
115
|
+
display: inline-flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
gap: 4px;
|
|
118
|
+
padding: 0 8px;
|
|
119
|
+
height: 22px;
|
|
120
|
+
font-size: 12px;
|
|
121
|
+
color: var(--u-color-primary);
|
|
122
|
+
background-color: var(--u-color-primary-light-9);
|
|
123
|
+
border-radius: 999px;
|
|
124
|
+
cursor: pointer;
|
|
125
|
+
user-select: none;
|
|
126
|
+
transition: background-color 0.12s ease, box-shadow 0.12s ease;
|
|
127
|
+
}
|
|
128
|
+
.u-condition-editor__value-chip:hover {
|
|
129
|
+
background-color: var(--u-color-primary-light-8);
|
|
130
|
+
}
|
|
131
|
+
.u-condition-editor__value-chip:hover .u-condition-editor__value-chip-close {
|
|
132
|
+
opacity: 1;
|
|
133
|
+
max-width: 14px;
|
|
134
|
+
margin-left: 2px;
|
|
135
|
+
}
|
|
136
|
+
.u-condition-editor__value-chip-label {
|
|
137
|
+
pointer-events: none;
|
|
138
|
+
}
|
|
139
|
+
.u-condition-editor__value-chip-close {
|
|
140
|
+
display: inline-flex;
|
|
141
|
+
align-items: center;
|
|
142
|
+
justify-content: center;
|
|
143
|
+
width: 14px;
|
|
144
|
+
max-width: 0;
|
|
145
|
+
margin-left: 0;
|
|
146
|
+
overflow: hidden;
|
|
147
|
+
font-size: 14px;
|
|
148
|
+
line-height: 1;
|
|
149
|
+
color: var(--u-color-primary);
|
|
150
|
+
opacity: 0;
|
|
151
|
+
transition: opacity 0.12s ease, max-width 0.12s ease, margin-left 0.12s ease;
|
|
152
|
+
}
|
|
153
|
+
.u-condition-editor__value-chip-close:hover {
|
|
154
|
+
transform: scale(1.1);
|
|
155
|
+
}
|
|
156
|
+
.u-condition-editor__row-delete {
|
|
157
|
+
flex-shrink: 0;
|
|
158
|
+
width: 16px;
|
|
159
|
+
text-align: center;
|
|
160
|
+
font-size: 15px;
|
|
161
|
+
color: var(--u-text-color-assist);
|
|
162
|
+
cursor: pointer;
|
|
163
|
+
transition: color 0.12s ease;
|
|
164
|
+
}
|
|
165
|
+
.u-condition-editor__row-delete:hover {
|
|
166
|
+
color: var(--u-color-danger);
|
|
167
|
+
}
|
|
168
|
+
.u-condition-editor__result {
|
|
169
|
+
flex-shrink: 0;
|
|
170
|
+
width: 16px;
|
|
171
|
+
text-align: center;
|
|
172
|
+
font-size: 11px;
|
|
173
|
+
font-weight: 600;
|
|
174
|
+
}
|
|
175
|
+
.u-condition-editor__result--pass {
|
|
176
|
+
color: var(--u-color-success);
|
|
177
|
+
}
|
|
178
|
+
.u-condition-editor__result--fail {
|
|
179
|
+
color: var(--u-color-danger);
|
|
180
|
+
}
|
|
181
|
+
.u-condition-editor__result--none {
|
|
182
|
+
color: var(--u-text-color-assist);
|
|
183
|
+
}
|
|
184
|
+
.u-condition-editor__add-btn {
|
|
185
|
+
font-size: 11px;
|
|
186
|
+
color: var(--u-color-primary);
|
|
187
|
+
cursor: pointer;
|
|
188
|
+
transition: color 0.12s ease;
|
|
189
|
+
}
|
|
190
|
+
.u-condition-editor__add-btn:hover {
|
|
191
|
+
color: var(--u-color-primary-dark-2);
|
|
192
|
+
}
|
|
193
|
+
.u-condition-editor.is-disabled {
|
|
194
|
+
cursor: not-allowed;
|
|
195
|
+
}
|
|
196
|
+
.u-condition-editor.is-disabled .u-condition-editor__logic-tag {
|
|
197
|
+
cursor: not-allowed;
|
|
198
|
+
opacity: 0.6;
|
|
199
|
+
}
|
|
200
|
+
.u-condition-editor.is-disabled .u-condition-editor__add-btn {
|
|
201
|
+
cursor: not-allowed;
|
|
202
|
+
opacity: 0.6;
|
|
203
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ContextMenuDIKey } from "./di.js";
|
|
2
2
|
import _sfc_main$1 from "./context-menu-item.js";
|
|
3
3
|
import { Fragment, Transition, computed, createBlock, createCommentVNode, createElementBlock, defineComponent, normalizeClass, normalizeStyle, openBlock, provide, renderList, shallowRef, unref, withCtx, withDirectives } from "vue";
|
|
4
|
-
import { bem, withUnit, zIndex } from "@veltra/utils";
|
|
5
4
|
import { useFallbackProps } from "@veltra/compositions";
|
|
5
|
+
import { bem, withUnit, zIndex } from "@veltra/utils";
|
|
6
6
|
import { vClickOutside } from "@veltra/directives";
|
|
7
7
|
//#region src/components/context-menu/context-menu.vue
|
|
8
8
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -3,10 +3,10 @@ import _sfc_main$2 from "../dropdown/dropdown.js";
|
|
|
3
3
|
import input_default from "../input/input.js";
|
|
4
4
|
import _sfc_main$3 from "../date-panel/date-panel.js";
|
|
5
5
|
import { Fragment, computed, createBlock, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, shallowRef, toDisplayString, unref, watch, withCtx } from "vue";
|
|
6
|
-
import { FORM_EMPTY_CONTENT, bem, injectFormContext } from "@veltra/utils";
|
|
7
6
|
import { useFormFallbackProps, useUserAction } from "@veltra/compositions";
|
|
8
|
-
import {
|
|
7
|
+
import { FORM_EMPTY_CONTENT, bem, injectFormContext } from "@veltra/utils";
|
|
9
8
|
import { Calendar } from "@veltra/icons/normal";
|
|
9
|
+
import { date } from "@cat-kit/core";
|
|
10
10
|
//#region src/components/date-picker/date-picker.vue
|
|
11
11
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
12
|
name: "DatePicker",
|
|
@@ -8,10 +8,10 @@ declare const __VLS_export: _$vue.DefineComponent<DatePickerProps, {}, {}, {}, {
|
|
|
8
8
|
"onUpdate:modelValue"?: ((value?: string | number | Date | undefined) => any) | undefined;
|
|
9
9
|
}>, {
|
|
10
10
|
type: "date" | "month" | "year";
|
|
11
|
-
clearable: boolean;
|
|
12
|
-
placeholder: string;
|
|
13
11
|
disabled: boolean;
|
|
14
12
|
readonly: boolean;
|
|
13
|
+
placeholder: string;
|
|
14
|
+
clearable: boolean;
|
|
15
15
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
16
16
|
declare const _default: typeof __VLS_export;
|
|
17
17
|
//#endregion
|
|
@@ -2,10 +2,10 @@ import _sfc_main$1 from "../icon/icon.js";
|
|
|
2
2
|
import _sfc_main$2 from "../dropdown/dropdown.js";
|
|
3
3
|
import _sfc_main$3 from "../date-panel/date-panel.js";
|
|
4
4
|
import { Fragment, Transition, computed, createBlock, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, shallowRef, toDisplayString, unref, watch, withCtx, withModifiers } from "vue";
|
|
5
|
-
import { FORM_EMPTY_CONTENT, bem, injectFormContext } from "@veltra/utils";
|
|
6
5
|
import { useFormFallbackProps, useUserAction } from "@veltra/compositions";
|
|
7
|
-
import {
|
|
6
|
+
import { FORM_EMPTY_CONTENT, bem, injectFormContext } from "@veltra/utils";
|
|
8
7
|
import { Calendar, Close } from "@veltra/icons/normal";
|
|
8
|
+
import { date } from "@cat-kit/core";
|
|
9
9
|
//#region src/components/date-range-picker/date-range-picker.vue
|
|
10
10
|
const _hoisted_1 = ["value", "placeholder"];
|
|
11
11
|
const _hoisted_2 = ["value", "placeholder"];
|
|
@@ -8,10 +8,10 @@ declare const __VLS_export: _$vue.DefineComponent<DateRangePickerProps, {}, {},
|
|
|
8
8
|
"onUpdate:modelValue"?: ((value?: [string, string] | undefined) => any) | undefined;
|
|
9
9
|
}>, {
|
|
10
10
|
type: "date" | "month" | "year";
|
|
11
|
-
clearable: boolean;
|
|
12
|
-
placeholder: [string, string];
|
|
13
11
|
disabled: boolean;
|
|
14
12
|
readonly: boolean;
|
|
13
|
+
placeholder: [string, string];
|
|
14
|
+
clearable: boolean;
|
|
15
15
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
16
16
|
declare const _default: typeof __VLS_export;
|
|
17
17
|
//#endregion
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import _sfc_main$1 from "../
|
|
2
|
-
import _sfc_main$2 from "../
|
|
1
|
+
import _sfc_main$1 from "../icon/icon.js";
|
|
2
|
+
import _sfc_main$2 from "../scroll/scroll.js";
|
|
3
3
|
import NodeRender from "../node-render/node-render.js";
|
|
4
4
|
import { DialogDIKey } from "./di.js";
|
|
5
5
|
import { useMaximum } from "./use-maximum.js";
|
|
6
6
|
import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, openBlock, provide, renderSlot, shallowRef, toDisplayString, unref, useModel, useSlots, vShow, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
7
|
-
import { bem, extractNormalVNodes, setStyles, zIndex } from "@veltra/utils";
|
|
8
7
|
import { useDrag, useFallbackProps } from "@veltra/compositions";
|
|
8
|
+
import { bem, extractNormalVNodes, setStyles, zIndex } from "@veltra/utils";
|
|
9
9
|
import { Close, Maximum, Recover } from "@veltra/icons/normal";
|
|
10
10
|
//#region src/components/dialog/dialog.vue
|
|
11
11
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -168,7 +168,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
168
168
|
}, [renderSlot(_ctx.$slots, "header", {}, () => [createTextVNode(toDisplayString(__props.header || __props.title), 1)])], 34), createElementVNode("div", {
|
|
169
169
|
class: normalizeClass(unref(cls).e("buttons")),
|
|
170
170
|
onMousedown: _cache[3] || (_cache[3] = withModifiers(() => {}, ["stop"]))
|
|
171
|
-
}, [unref(maximized) ? (openBlock(), createBlock(unref(_sfc_main$
|
|
171
|
+
}, [unref(maximized) ? (openBlock(), createBlock(unref(_sfc_main$1), {
|
|
172
172
|
key: 0,
|
|
173
173
|
class: normalizeClass(unref(cls).e("btn-recover")),
|
|
174
174
|
onClick: _cache[1] || (_cache[1] = ($event) => unref(toggleMaximize)(false)),
|
|
@@ -176,7 +176,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
176
176
|
}, {
|
|
177
177
|
default: withCtx(() => [createVNode(unref(Recover))]),
|
|
178
178
|
_: 1
|
|
179
|
-
}, 8, ["class"])) : (openBlock(), createBlock(unref(_sfc_main$
|
|
179
|
+
}, 8, ["class"])) : (openBlock(), createBlock(unref(_sfc_main$1), {
|
|
180
180
|
key: 1,
|
|
181
181
|
class: normalizeClass(unref(cls).e("btn-maximize")),
|
|
182
182
|
onClick: _cache[2] || (_cache[2] = ($event) => unref(toggleMaximize)(true)),
|
|
@@ -184,7 +184,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
184
184
|
}, {
|
|
185
185
|
default: withCtx(() => [createVNode(unref(Maximum))]),
|
|
186
186
|
_: 1
|
|
187
|
-
}, 8, ["class"])), createVNode(unref(_sfc_main$
|
|
187
|
+
}, 8, ["class"])), createVNode(unref(_sfc_main$1), {
|
|
188
188
|
class: normalizeClass(unref(cls).e("btn-close")),
|
|
189
189
|
onClick: close,
|
|
190
190
|
title: "关闭"
|
|
@@ -192,7 +192,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
192
192
|
default: withCtx(() => [createVNode(unref(Close))]),
|
|
193
193
|
_: 1
|
|
194
194
|
}, 8, ["class"])], 34)], 544),
|
|
195
|
-
createVNode(unref(_sfc_main$
|
|
195
|
+
createVNode(unref(_sfc_main$2), {
|
|
196
196
|
tag: "section",
|
|
197
197
|
class: normalizeClass(unref(cls).e("body")),
|
|
198
198
|
ref_key: "bodyRef",
|
|
@@ -32,6 +32,14 @@
|
|
|
32
32
|
background-color: rgba(0, 0, 0, 0.32);
|
|
33
33
|
pointer-events: auto;
|
|
34
34
|
}
|
|
35
|
+
.u-dialog__overlay.fade-enter-active, .u-dialog__overlay.fade-leave-active {
|
|
36
|
+
transition: opacity 0.25s linear;
|
|
37
|
+
}
|
|
38
|
+
.u-dialog__overlay.fade-enter-from, .u-dialog__overlay.fade-leave-to {
|
|
39
|
+
opacity: 0;
|
|
40
|
+
transform: none;
|
|
41
|
+
filter: none;
|
|
42
|
+
}
|
|
35
43
|
|
|
36
44
|
.u-dialog {
|
|
37
45
|
pointer-events: auto;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { shallowRef } from "vue";
|
|
2
|
-
import { removeStyles, setStyles } from "@veltra/utils";
|
|
3
2
|
import { useTransition } from "@veltra/compositions";
|
|
3
|
+
import { removeStyles, setStyles } from "@veltra/utils";
|
|
4
4
|
//#region src/components/dialog/use-maximum.ts
|
|
5
5
|
function useMaximum(options) {
|
|
6
6
|
const { dialogRef } = options;
|
|
@@ -112,6 +112,14 @@
|
|
|
112
112
|
background-color: rgba(0, 0, 0, 0.32);
|
|
113
113
|
overflow: hidden;
|
|
114
114
|
}
|
|
115
|
+
.u-drawer-overlay.fade-enter-active, .u-drawer-overlay.fade-leave-active {
|
|
116
|
+
transition: opacity 0.25s linear;
|
|
117
|
+
}
|
|
118
|
+
.u-drawer-overlay.fade-enter-from, .u-drawer-overlay.fade-leave-to {
|
|
119
|
+
opacity: 0;
|
|
120
|
+
transform: none;
|
|
121
|
+
filter: none;
|
|
122
|
+
}
|
|
115
123
|
|
|
116
124
|
.drawer-slide-right-enter-active, .drawer-slide-left-enter-active, .drawer-slide-top-enter-active, .drawer-slide-bottom-enter-active {
|
|
117
125
|
transition: transform 0.3s cubic-bezier(0.46, 1.29, 0.46, 1.04);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import NodeRender from "../node-render/node-render.js";
|
|
2
2
|
import { useNest } from "../tip/use-nest.js";
|
|
3
3
|
import { Fragment, Teleport, cloneVNode, computed, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, renderSlot, resolveDynamicComponent, shallowRef, unref, useAttrs, useSlots, useTemplateRef, withCtx, withDirectives } from "vue";
|
|
4
|
-
import { bem, extractNormalVNodes, setStyles, zIndex } from "@veltra/utils";
|
|
5
4
|
import { useModel as useModel$1, usePop, useTransition } from "@veltra/compositions";
|
|
5
|
+
import { bem, extractNormalVNodes, setStyles, zIndex } from "@veltra/utils";
|
|
6
6
|
import { vClickOutside } from "@veltra/directives";
|
|
7
7
|
//#region src/components/dropdown/dropdown.vue
|
|
8
8
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import _sfc_main$1 from "../../
|
|
2
|
-
import _sfc_main$2 from "../../
|
|
3
|
-
import _sfc_main$3 from "../../
|
|
1
|
+
import _sfc_main$1 from "../../icon/icon.js";
|
|
2
|
+
import _sfc_main$2 from "../../empty/empty.js";
|
|
3
|
+
import _sfc_main$3 from "../../scroll/scroll.js";
|
|
4
4
|
import _sfc_main$4 from "../../tip/tip.js";
|
|
5
5
|
import _sfc_main$5 from "./path-preview.js";
|
|
6
6
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, nextTick, normalizeClass, openBlock, ref, renderList, toDisplayString, unref, watch, withCtx, withModifiers } from "vue";
|
|
@@ -219,7 +219,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
219
219
|
}, [createElementVNode("span", { class: normalizeClass(unref(cls).e("breadcrumb-item")) }, [createElementVNode("span", {
|
|
220
220
|
class: normalizeClass(unref(cls).e("breadcrumb-link")),
|
|
221
221
|
onClick: _cache[0] || (_cache[0] = ($event) => navigateTo(0))
|
|
222
|
-
}, "全部变量", 2), createVNode(unref(_sfc_main$
|
|
222
|
+
}, "全部变量", 2), createVNode(unref(_sfc_main$1), { class: normalizeClass(unref(cls).e("breadcrumb-separator")) }, {
|
|
223
223
|
default: withCtx(() => [createVNode(unref(ArrowRight))]),
|
|
224
224
|
_: 1
|
|
225
225
|
}, 8, ["class"])], 2), (openBlock(true), createElementBlock(Fragment, null, renderList(navPath.value, (crumb, i) => {
|
|
@@ -229,7 +229,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
229
229
|
}, [createElementVNode("span", {
|
|
230
230
|
class: normalizeClass([unref(cls).e("breadcrumb-link"), { [unref(cls).em("breadcrumb-link", "active")]: i === navPath.value.length - 1 }]),
|
|
231
231
|
onClick: ($event) => navigateTo(i + 1)
|
|
232
|
-
}, toDisplayString(crumb.label), 11, _hoisted_1), i < navPath.value.length - 1 ? (openBlock(), createBlock(unref(_sfc_main$
|
|
232
|
+
}, toDisplayString(crumb.label), 11, _hoisted_1), i < navPath.value.length - 1 ? (openBlock(), createBlock(unref(_sfc_main$1), {
|
|
233
233
|
key: 0,
|
|
234
234
|
class: normalizeClass(unref(cls).e("breadcrumb-separator"))
|
|
235
235
|
}, {
|
|
@@ -240,7 +240,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
240
240
|
createElementVNode("div", { class: normalizeClass(unref(cls).e("picker-body")) }, [currentList.value.length > 0 ? (openBlock(), createElementBlock("div", {
|
|
241
241
|
key: 0,
|
|
242
242
|
class: normalizeClass(unref(cls).e("panel"))
|
|
243
|
-
}, [createVNode(unref(_sfc_main$
|
|
243
|
+
}, [createVNode(unref(_sfc_main$3), {
|
|
244
244
|
tag: "ul",
|
|
245
245
|
class: normalizeClass(unref(cls).e("panel-list")),
|
|
246
246
|
"content-class": unref(cls).e("panel-content")
|
|
@@ -252,7 +252,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
252
252
|
class: normalizeClass(getItemCls(item, idx)),
|
|
253
253
|
onClick: ($event) => handleItemClick(item, idx),
|
|
254
254
|
onMouseenter: ($event) => activeIndex.value = idx
|
|
255
|
-
}, [createElementVNode("span", { class: normalizeClass(unref(cls).e("item-label")) }, toDisplayString(item.label), 3), !isFlat.value && hasChildren(item) ? (openBlock(), createBlock(unref(_sfc_main$
|
|
255
|
+
}, [createElementVNode("span", { class: normalizeClass(unref(cls).e("item-label")) }, toDisplayString(item.label), 3), !isFlat.value && hasChildren(item) ? (openBlock(), createBlock(unref(_sfc_main$1), {
|
|
256
256
|
key: 0,
|
|
257
257
|
class: normalizeClass(unref(cls).e("item-expand"))
|
|
258
258
|
}, {
|
|
@@ -264,7 +264,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
264
264
|
}, 8, ["class", "content-class"])], 2)) : (openBlock(), createElementBlock("div", {
|
|
265
265
|
key: 1,
|
|
266
266
|
class: normalizeClass(unref(cls).e("empty"))
|
|
267
|
-
}, [createVNode(unref(_sfc_main$
|
|
267
|
+
}, [createVNode(unref(_sfc_main$2), { description: "暂无可用变量" })], 2)), isFlat.value && activePath.value.length > 0 ? (openBlock(), createBlock(_sfc_main$5, {
|
|
268
268
|
key: 2,
|
|
269
269
|
path: activePath.value
|
|
270
270
|
}, null, 8, ["path"])) : createCommentVNode("v-if", true)], 2)
|
|
@@ -4,8 +4,8 @@ import { createEditor } from "./core/editor.js";
|
|
|
4
4
|
import { createMention } from "./core/mention.js";
|
|
5
5
|
import { createVariableMap } from "./di.js";
|
|
6
6
|
import { computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, nextTick, normalizeClass, onBeforeUnmount, onMounted, openBlock, shallowRef, toDisplayString, unref, useTemplateRef, watch } from "vue";
|
|
7
|
-
import { bem, injectFormContext } from "@veltra/utils";
|
|
8
7
|
import { useFormFallbackProps } from "@veltra/compositions";
|
|
8
|
+
import { bem, injectFormContext } from "@veltra/utils";
|
|
9
9
|
//#region src/components/expression-editor/expression-editor.vue
|
|
10
10
|
const _hoisted_1 = [
|
|
11
11
|
"contenteditable",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import _sfc_main$1 from "../
|
|
2
|
-
import _sfc_main$2 from "../
|
|
3
|
-
import _sfc_main$3 from "../
|
|
1
|
+
import _sfc_main$1 from "../icon/icon.js";
|
|
2
|
+
import _sfc_main$2 from "../empty/empty.js";
|
|
3
|
+
import _sfc_main$3 from "../scroll/scroll.js";
|
|
4
4
|
import { FILE_VIEWER_KIND_LABEL, downloadFile, formatBytes, inferKind } from "./helper.js";
|
|
5
5
|
import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineAsyncComponent, defineComponent, mergeModels, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, openBlock, ref, renderList, resolveDynamicComponent, shallowRef, toDisplayString, unref, useModel, watch, withCtx, withModifiers } from "vue";
|
|
6
6
|
import { bem, withUnit } from "@veltra/utils";
|
|
@@ -296,7 +296,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
296
296
|
key: 0,
|
|
297
297
|
class: normalizeClass(unref(cls).e("sidebar")),
|
|
298
298
|
style: normalizeStyle({ width: sidebarWidthCss.value })
|
|
299
|
-
}, [createElementVNode("header", { class: normalizeClass(unref(cls).e("sidebar-head")) }, [createElementVNode("span", { class: normalizeClass(unref(cls).e("sidebar-title")) }, "文件", 2), createElementVNode("span", { class: normalizeClass(unref(cls).e("sidebar-count")) }, toDisplayString(normalizedFiles.value.length), 3)], 2), createVNode(unref(_sfc_main$
|
|
299
|
+
}, [createElementVNode("header", { class: normalizeClass(unref(cls).e("sidebar-head")) }, [createElementVNode("span", { class: normalizeClass(unref(cls).e("sidebar-title")) }, "文件", 2), createElementVNode("span", { class: normalizeClass(unref(cls).e("sidebar-count")) }, toDisplayString(normalizedFiles.value.length), 3)], 2), createVNode(unref(_sfc_main$3), {
|
|
300
300
|
tag: "ul",
|
|
301
301
|
class: normalizeClass(unref(cls).e("list"))
|
|
302
302
|
}, {
|
|
@@ -313,7 +313,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
313
313
|
}), 128)), !normalizedFiles.value.length ? (openBlock(), createElementBlock("li", {
|
|
314
314
|
key: 0,
|
|
315
315
|
class: normalizeClass(unref(cls).e("list-empty"))
|
|
316
|
-
}, [createVNode(unref(_sfc_main$
|
|
316
|
+
}, [createVNode(unref(_sfc_main$2), {
|
|
317
317
|
text: "暂无文件",
|
|
318
318
|
size: 32
|
|
319
319
|
})], 2)) : createCommentVNode("v-if", true)]),
|
|
@@ -335,7 +335,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
335
335
|
"aria-label": "上一个",
|
|
336
336
|
title: "上一个",
|
|
337
337
|
onClick: prev
|
|
338
|
-
}, [createVNode(unref(_sfc_main$
|
|
338
|
+
}, [createVNode(unref(_sfc_main$1), { size: 15 }, {
|
|
339
339
|
default: withCtx(() => [createVNode(unref(ArrowLeft))]),
|
|
340
340
|
_: 1
|
|
341
341
|
})], 10, _hoisted_6), createElementVNode("button", {
|
|
@@ -345,7 +345,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
345
345
|
"aria-label": "下一个",
|
|
346
346
|
title: "下一个",
|
|
347
347
|
onClick: next
|
|
348
|
-
}, [createVNode(unref(_sfc_main$
|
|
348
|
+
}, [createVNode(unref(_sfc_main$1), { size: 15 }, {
|
|
349
349
|
default: withCtx(() => [createVNode(unref(ArrowRight))]),
|
|
350
350
|
_: 1
|
|
351
351
|
})], 10, _hoisted_7)], 2),
|
|
@@ -360,7 +360,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
360
360
|
"aria-label": "缩小",
|
|
361
361
|
title: "缩小",
|
|
362
362
|
onClick: zoomOut
|
|
363
|
-
}, [createVNode(unref(_sfc_main$
|
|
363
|
+
}, [createVNode(unref(_sfc_main$1), { size: 15 }, {
|
|
364
364
|
default: withCtx(() => [createVNode(unref(ZoomOut))]),
|
|
365
365
|
_: 1
|
|
366
366
|
})], 10, _hoisted_8),
|
|
@@ -372,7 +372,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
372
372
|
"aria-label": "放大",
|
|
373
373
|
title: "放大",
|
|
374
374
|
onClick: zoomIn
|
|
375
|
-
}, [createVNode(unref(_sfc_main$
|
|
375
|
+
}, [createVNode(unref(_sfc_main$1), { size: 15 }, {
|
|
376
376
|
default: withCtx(() => [createVNode(unref(ZoomIn))]),
|
|
377
377
|
_: 1
|
|
378
378
|
})], 10, _hoisted_9),
|
|
@@ -383,7 +383,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
383
383
|
"aria-label": "重置视图",
|
|
384
384
|
title: "重置视图",
|
|
385
385
|
onClick: resetTransform
|
|
386
|
-
}, [createVNode(unref(_sfc_main$
|
|
386
|
+
}, [createVNode(unref(_sfc_main$1), { size: 15 }, {
|
|
387
387
|
default: withCtx(() => [createVNode(unref(Refresh))]),
|
|
388
388
|
_: 1
|
|
389
389
|
})], 10, _hoisted_10)
|
|
@@ -399,7 +399,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
399
399
|
"aria-label": "下载",
|
|
400
400
|
title: "下载",
|
|
401
401
|
onClick: download
|
|
402
|
-
}, [createVNode(unref(_sfc_main$
|
|
402
|
+
}, [createVNode(unref(_sfc_main$1), { size: 15 }, {
|
|
403
403
|
default: withCtx(() => [createVNode(unref(Download))]),
|
|
404
404
|
_: 1
|
|
405
405
|
})], 2)) : createCommentVNode("v-if", true),
|
|
@@ -410,7 +410,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
410
410
|
"aria-label": "关闭预览",
|
|
411
411
|
title: "关闭",
|
|
412
412
|
onClick: handleClose
|
|
413
|
-
}, [createVNode(unref(_sfc_main$
|
|
413
|
+
}, [createVNode(unref(_sfc_main$1), { size: 16 }, {
|
|
414
414
|
default: withCtx(() => [createVNode(unref(Close))]),
|
|
415
415
|
_: 1
|
|
416
416
|
})], 2)) : createCommentVNode("v-if", true)
|
|
@@ -445,7 +445,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
445
445
|
]))], 34)) : (openBlock(), createElementBlock("div", {
|
|
446
446
|
key: 1,
|
|
447
447
|
class: normalizeClass(unref(cls).e("empty"))
|
|
448
|
-
}, [createVNode(unref(_sfc_main$
|
|
448
|
+
}, [createVNode(unref(_sfc_main$2), { text: "暂无可预览文件" })], 2))]),
|
|
449
449
|
_: 1
|
|
450
450
|
})], 2)], 2)], 2)], 42, _hoisted_1)) : createCommentVNode("v-if", true)]),
|
|
451
451
|
_: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-item.js","names":[],"sources":["../../../src/components/form-item/form-item.vue"],"sourcesContent":["<template>\n <u-grid-item :span=\"span\" :class=\"className\">\n <label\n v-if=\"props.label || $slots.label\"\n :class=\"[cls.e('label'), bem.is('required', fieldRequired)]\"\n :style=\"labelStyles\"\n >\n <u-tip v-if=\"tips\" :content=\"tips\" :class=\"cls.e('tips')\">\n <span :class=\"cls.e('tip-label')\">\n <slot name=\"label\">{{ label }}:</slot>\n </span>\n </u-tip>\n <template v-else>\n <slot name=\"label\">{{ label }}:</slot>\n </template>\n </label>\n\n <section :class=\"cls.e('wrapper')\">\n <div :class=\"cls.e('content')\">\n <slot></slot>\n </div>\n\n <!-- 只有表单控件处于非只读状态时,才显示错误提示 -->\n <section :class=\"cls.e('error')\" v-if=\"!formProps?.readonly && !formProps?.noTips\">\n <transition name=\"form-item-tips\" mode=\"out-in\">\n <span :class=\"cls.e('error-text')\" v-if=\"!!errorTips\">\n {{ errorTips }}\n </span>\n </transition>\n </section>\n </section>\n </u-grid-item>\n</template>\n\n<script lang=\"tsx\" setup>\nimport { useConfig, useFallbackProps } from '@veltra/compositions'\nimport { bem, withUnit } from '@veltra/utils'\nimport { injectFormContext } from '@veltra/utils'\nimport { type CSSProperties, computed } from 'vue'\n\nimport type { FormItemProps, ComponentSize } from '../../types'\nimport { UGridItem } from '../grid'\nimport { UTip } from '../tip'\nimport { formItemCls as cls } from './helper'\n\ndefineOptions({\n name: 'FormItem'\n})\n\nconst props = withDefaults(defineProps<FormItemProps>(), {\n readonly: undefined\n})\n\ndefineSlots<{\n /** 标签插槽 */\n label?: () => any\n default?: () => any\n}>()\n\n/** 表单组件上下文 */\nconst { formProps } = injectFormContext()\n\nconst { config } = useConfig()\n\nconst { size, readonly } = useFallbackProps([formProps ?? {}, props], {\n size: 'default' as ComponentSize,\n readonly: false\n})\n\nconst className = computed(() => {\n return [cls.b, cls.m(size.value), bem.is('error', !!errorTips.value)].join(' ')\n})\n\n/** label样式 */\nconst labelStyles = computed<CSSProperties>(() => {\n return {\n width: withUnit(props.labelWidth ?? formProps?.labelWidth ?? config.form.labelWidth, 'px')\n }\n})\n\n/** 错误提示 */\nconst errorTips = computed<string | undefined>(() => {\n if (props.field) {\n return formProps?.model
|
|
1
|
+
{"version":3,"file":"form-item.js","names":[],"sources":["../../../src/components/form-item/form-item.vue"],"sourcesContent":["<template>\n <u-grid-item :span=\"span\" :class=\"className\">\n <label\n v-if=\"props.label || $slots.label\"\n :class=\"[cls.e('label'), bem.is('required', fieldRequired)]\"\n :style=\"labelStyles\"\n >\n <u-tip v-if=\"tips\" :content=\"tips\" :class=\"cls.e('tips')\">\n <span :class=\"cls.e('tip-label')\">\n <slot name=\"label\">{{ label }}:</slot>\n </span>\n </u-tip>\n <template v-else>\n <slot name=\"label\">{{ label }}:</slot>\n </template>\n </label>\n\n <section :class=\"cls.e('wrapper')\">\n <div :class=\"cls.e('content')\">\n <slot></slot>\n </div>\n\n <!-- 只有表单控件处于非只读状态时,才显示错误提示 -->\n <section :class=\"cls.e('error')\" v-if=\"!formProps?.readonly && !formProps?.noTips\">\n <transition name=\"form-item-tips\" mode=\"out-in\">\n <span :class=\"cls.e('error-text')\" v-if=\"!!errorTips\">\n {{ errorTips }}\n </span>\n </transition>\n </section>\n </section>\n </u-grid-item>\n</template>\n\n<script lang=\"tsx\" setup>\nimport { useConfig, useFallbackProps } from '@veltra/compositions'\nimport { bem, withUnit } from '@veltra/utils'\nimport { injectFormContext } from '@veltra/utils'\nimport { type CSSProperties, computed } from 'vue'\n\nimport type { FormItemProps, ComponentSize } from '../../types'\nimport { UGridItem } from '../grid'\nimport { UTip } from '../tip'\nimport { formItemCls as cls } from './helper'\n\ndefineOptions({\n name: 'FormItem'\n})\n\nconst props = withDefaults(defineProps<FormItemProps>(), {\n readonly: undefined\n})\n\ndefineSlots<{\n /** 标签插槽 */\n label?: () => any\n default?: () => any\n}>()\n\n/** 表单组件上下文 */\nconst { formProps } = injectFormContext()\n\nconst { config } = useConfig()\n\nconst { size, readonly } = useFallbackProps([formProps ?? {}, props], {\n size: 'default' as ComponentSize,\n readonly: false\n})\n\nconst className = computed(() => {\n return [cls.b, cls.m(size.value), bem.is('error', !!errorTips.value)].join(' ')\n})\n\n/** label样式 */\nconst labelStyles = computed<CSSProperties>(() => {\n return {\n width: withUnit(props.labelWidth ?? formProps?.labelWidth ?? config.form.labelWidth, 'px')\n }\n})\n\n/** 错误提示 */\nconst errorTips = computed<string | undefined>(() => {\n if (props.field) {\n return formProps?.model?.errors.get(props.field)?.[0]\n }\n})\n\n/** 字段是否必须 */\nconst fieldRequired = computed<boolean>(() => {\n const { field } = props\n if (!field || readonly.value) return false\n const required = formProps?.model?.fields[field]?.required\n return Boolean(required)\n})\n</script>\n"],"mappings":""}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import _sfc_main from "../
|
|
2
|
-
import _sfc_main$1 from "../
|
|
1
|
+
import _sfc_main from "../tip/tip.js";
|
|
2
|
+
import _sfc_main$1 from "../grid/grid-item.js";
|
|
3
3
|
import { formItemCls } from "./helper.js";
|
|
4
4
|
import { Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, renderSlot, toDisplayString, unref, withCtx } from "vue";
|
|
5
|
-
import { bem, injectFormContext, withUnit } from "@veltra/utils";
|
|
6
5
|
import { useConfig, useFallbackProps } from "@veltra/compositions";
|
|
6
|
+
import { bem, injectFormContext, withUnit } from "@veltra/utils";
|
|
7
7
|
//#region src/components/form-item/form-item.vue?vue&type=script&setup=true&lang.tsx
|
|
8
8
|
var form_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
9
9
|
name: "FormItem",
|
|
@@ -43,7 +43,7 @@ var form_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
43
43
|
});
|
|
44
44
|
/** 错误提示 */
|
|
45
45
|
const errorTips = computed(() => {
|
|
46
|
-
if (props.field) return formProps?.model
|
|
46
|
+
if (props.field) return formProps?.model?.errors.get(props.field)?.[0];
|
|
47
47
|
});
|
|
48
48
|
/** 字段是否必须 */
|
|
49
49
|
const fieldRequired = computed(() => {
|
|
@@ -53,7 +53,7 @@ var form_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
53
53
|
return Boolean(required);
|
|
54
54
|
});
|
|
55
55
|
return (_ctx, _cache) => {
|
|
56
|
-
return openBlock(), createBlock(unref(_sfc_main), {
|
|
56
|
+
return openBlock(), createBlock(unref(_sfc_main$1), {
|
|
57
57
|
span: __props.span,
|
|
58
58
|
class: normalizeClass(className.value)
|
|
59
59
|
}, {
|
|
@@ -61,7 +61,7 @@ var form_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
61
61
|
key: 0,
|
|
62
62
|
class: normalizeClass([unref(formItemCls).e("label"), unref(bem).is("required", fieldRequired.value)]),
|
|
63
63
|
style: normalizeStyle(labelStyles.value)
|
|
64
|
-
}, [__props.tips ? (openBlock(), createBlock(unref(_sfc_main
|
|
64
|
+
}, [__props.tips ? (openBlock(), createBlock(unref(_sfc_main), {
|
|
65
65
|
key: 0,
|
|
66
66
|
content: __props.tips,
|
|
67
67
|
class: normalizeClass(unref(formItemCls).e("tips"))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-item.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/form-item/form-item.vue"],"sourcesContent":["<template>\n <u-grid-item :span=\"span\" :class=\"className\">\n <label\n v-if=\"props.label || $slots.label\"\n :class=\"[cls.e('label'), bem.is('required', fieldRequired)]\"\n :style=\"labelStyles\"\n >\n <u-tip v-if=\"tips\" :content=\"tips\" :class=\"cls.e('tips')\">\n <span :class=\"cls.e('tip-label')\">\n <slot name=\"label\">{{ label }}:</slot>\n </span>\n </u-tip>\n <template v-else>\n <slot name=\"label\">{{ label }}:</slot>\n </template>\n </label>\n\n <section :class=\"cls.e('wrapper')\">\n <div :class=\"cls.e('content')\">\n <slot></slot>\n </div>\n\n <!-- 只有表单控件处于非只读状态时,才显示错误提示 -->\n <section :class=\"cls.e('error')\" v-if=\"!formProps?.readonly && !formProps?.noTips\">\n <transition name=\"form-item-tips\" mode=\"out-in\">\n <span :class=\"cls.e('error-text')\" v-if=\"!!errorTips\">\n {{ errorTips }}\n </span>\n </transition>\n </section>\n </section>\n </u-grid-item>\n</template>\n\n<script lang=\"tsx\" setup>\nimport { useConfig, useFallbackProps } from '@veltra/compositions'\nimport { bem, withUnit } from '@veltra/utils'\nimport { injectFormContext } from '@veltra/utils'\nimport { type CSSProperties, computed } from 'vue'\n\nimport type { FormItemProps, ComponentSize } from '../../types'\nimport { UGridItem } from '../grid'\nimport { UTip } from '../tip'\nimport { formItemCls as cls } from './helper'\n\ndefineOptions({\n name: 'FormItem'\n})\n\nconst props = withDefaults(defineProps<FormItemProps>(), {\n readonly: undefined\n})\n\ndefineSlots<{\n /** 标签插槽 */\n label?: () => any\n default?: () => any\n}>()\n\n/** 表单组件上下文 */\nconst { formProps } = injectFormContext()\n\nconst { config } = useConfig()\n\nconst { size, readonly } = useFallbackProps([formProps ?? {}, props], {\n size: 'default' as ComponentSize,\n readonly: false\n})\n\nconst className = computed(() => {\n return [cls.b, cls.m(size.value), bem.is('error', !!errorTips.value)].join(' ')\n})\n\n/** label样式 */\nconst labelStyles = computed<CSSProperties>(() => {\n return {\n width: withUnit(props.labelWidth ?? formProps?.labelWidth ?? config.form.labelWidth, 'px')\n }\n})\n\n/** 错误提示 */\nconst errorTips = computed<string | undefined>(() => {\n if (props.field) {\n return formProps?.model
|
|
1
|
+
{"version":3,"file":"form-item.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/form-item/form-item.vue"],"sourcesContent":["<template>\n <u-grid-item :span=\"span\" :class=\"className\">\n <label\n v-if=\"props.label || $slots.label\"\n :class=\"[cls.e('label'), bem.is('required', fieldRequired)]\"\n :style=\"labelStyles\"\n >\n <u-tip v-if=\"tips\" :content=\"tips\" :class=\"cls.e('tips')\">\n <span :class=\"cls.e('tip-label')\">\n <slot name=\"label\">{{ label }}:</slot>\n </span>\n </u-tip>\n <template v-else>\n <slot name=\"label\">{{ label }}:</slot>\n </template>\n </label>\n\n <section :class=\"cls.e('wrapper')\">\n <div :class=\"cls.e('content')\">\n <slot></slot>\n </div>\n\n <!-- 只有表单控件处于非只读状态时,才显示错误提示 -->\n <section :class=\"cls.e('error')\" v-if=\"!formProps?.readonly && !formProps?.noTips\">\n <transition name=\"form-item-tips\" mode=\"out-in\">\n <span :class=\"cls.e('error-text')\" v-if=\"!!errorTips\">\n {{ errorTips }}\n </span>\n </transition>\n </section>\n </section>\n </u-grid-item>\n</template>\n\n<script lang=\"tsx\" setup>\nimport { useConfig, useFallbackProps } from '@veltra/compositions'\nimport { bem, withUnit } from '@veltra/utils'\nimport { injectFormContext } from '@veltra/utils'\nimport { type CSSProperties, computed } from 'vue'\n\nimport type { FormItemProps, ComponentSize } from '../../types'\nimport { UGridItem } from '../grid'\nimport { UTip } from '../tip'\nimport { formItemCls as cls } from './helper'\n\ndefineOptions({\n name: 'FormItem'\n})\n\nconst props = withDefaults(defineProps<FormItemProps>(), {\n readonly: undefined\n})\n\ndefineSlots<{\n /** 标签插槽 */\n label?: () => any\n default?: () => any\n}>()\n\n/** 表单组件上下文 */\nconst { formProps } = injectFormContext()\n\nconst { config } = useConfig()\n\nconst { size, readonly } = useFallbackProps([formProps ?? {}, props], {\n size: 'default' as ComponentSize,\n readonly: false\n})\n\nconst className = computed(() => {\n return [cls.b, cls.m(size.value), bem.is('error', !!errorTips.value)].join(' ')\n})\n\n/** label样式 */\nconst labelStyles = computed<CSSProperties>(() => {\n return {\n width: withUnit(props.labelWidth ?? formProps?.labelWidth ?? config.form.labelWidth, 'px')\n }\n})\n\n/** 错误提示 */\nconst errorTips = computed<string | undefined>(() => {\n if (props.field) {\n return formProps?.model?.errors.get(props.field)?.[0]\n }\n})\n\n/** 字段是否必须 */\nconst fieldRequired = computed<boolean>(() => {\n const { field } = props\n if (!field || readonly.value) return false\n const required = formProps?.model?.fields[field]?.required\n return Boolean(required)\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAiDA,MAAM,QAAQ;;EAWd,MAAM,EAAE,cAAc,mBAAkB;EAExC,MAAM,EAAE,WAAW,WAAU;EAE7B,MAAM,EAAE,MAAM,aAAa,iBAAiB,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE;GACpE,MAAM;GACN,UAAU;GACX,CAAA;EAED,MAAM,YAAY,eAAe;AAC/B,UAAO;IAAC,YAAI;IAAG,YAAI,EAAE,KAAK,MAAM;IAAE,IAAI,GAAG,SAAS,CAAC,CAAC,UAAU,MAAM;IAAC,CAAC,KAAK,IAAG;IAC/E;;EAGD,MAAM,cAAc,eAA8B;AAChD,UAAO,EACL,OAAO,SAAS,MAAM,cAAc,WAAW,cAAc,OAAO,KAAK,YAAY,KAAI,EAC3F;IACD;;EAGD,MAAM,YAAY,eAAmC;AACnD,OAAI,MAAM,MACR,QAAO,WAAW,OAAO,OAAO,IAAI,MAAM,MAAM,GAAG;IAEtD;;EAGD,MAAM,gBAAgB,eAAwB;GAC5C,MAAM,EAAE,UAAU;AAClB,OAAI,CAAC,SAAS,SAAS,MAAO,QAAO;GACrC,MAAM,WAAW,WAAW,OAAO,OAAO,QAAQ;AAClD,UAAO,QAAQ,SAAQ;IACxB;;uBA5FC,YA8Bc,MAAA,YAAA,EAAA;IA9BA,MAAM,QAAA;IAAO,OAAK,eAAE,UAAA,MAAS;;2BAcjC,CAZA,MAAM,SAASA,KAAAA,OAAO,SAAA,WAAA,EAD9B,mBAaQ,SAAA;;KAXL,OAAK,eAAA,CAAG,MAAA,YAAG,CAAC,EAAC,QAAA,EAAW,MAAA,IAAG,CAAC,GAAE,YAAa,cAAA,MAAa,CAAA,CAAA;KACxD,OAAK,eAAE,YAAA,MAAW;QAEN,QAAA,QAAA,WAAA,EAAb,YAIQ,MAAA,UAAA,EAAA;;KAJY,SAAS,QAAA;KAAO,OAAK,eAAE,MAAA,YAAG,CAAC,EAAC,OAAA,CAAA;;4BAGvC,CAFP,mBAEO,QAAA,EAFA,OAAK,eAAE,MAAA,YAAG,CAAC,EAAC,YAAA,CAAA,EAAA,EAAA,CACjB,WAAsC,KAAA,QAAA,SAAA,EAAA,QAAA,CAAA,gBAAA,gBAAhB,QAAA,MAAK,GAAG,KAAC,EAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA;;mCAIjC,WAAsC,KAAA,QAAA,SAAA,EAAA,KAAA,GAAA,QAAA,CAAA,gBAAA,gBAAhB,QAAA,MAAK,GAAG,KAAC,EAAA,CAAA,CAAA,CAAA,EAAA,EAAA,IAAA,mBAAA,QAAA,KAAA,EAInC,mBAaU,WAAA,EAbA,OAAK,eAAE,MAAA,YAAG,CAAC,EAAC,UAAA,CAAA,EAAA,EAAA;KACpB,mBAEM,OAAA,EAFA,OAAK,eAAE,MAAA,YAAG,CAAC,EAAC,UAAA,CAAA,EAAA,EAAA,CAChB,WAAa,KAAA,QAAA,UAAA,CAAA,EAAA,EAAA;KAGf,mBAAA,2BAA+B;MACS,MAAA,UAAS,EAAE,YAAQ,CAAK,MAAA,UAAS,EAAE,UAAA,WAAA,EAA3E,mBAMU,WAAA;;MANA,OAAK,eAAE,MAAA,YAAG,CAAC,EAAC,QAAA,CAAA;SACpB,YAIa,YAAA;MAJD,MAAK;MAAiB,MAAK;;6BAG9B,CAAA,CAAA,CAFoC,UAAA,SAAA,WAAA,EAA3C,mBAEO,QAAA;;OAFA,OAAK,eAAE,MAAA,YAAG,CAAC,EAAC,aAAA,CAAA;yBACd,UAAA,MAAS,EAAA,EAAA,IAAA,mBAAA,QAAA,KAAA,CAAA,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, computed, createCommentVNode, createElementBlock, defineComponent, getCurrentInstance, normalizeClass, openBlock, ref, renderList, toDisplayString, unref } from "vue";
|
|
2
|
-
import { bem } from "@veltra/utils";
|
|
3
2
|
import { useFallbackProps } from "@veltra/compositions";
|
|
3
|
+
import { bem } from "@veltra/utils";
|
|
4
4
|
//#region src/components/grid-input/grid-input.vue
|
|
5
5
|
const _hoisted_1 = [
|
|
6
6
|
"onKeydown",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _sfc_main$1 from "../button/button.js";
|
|
2
2
|
import { useGroupItems } from "./use-group-items.js";
|
|
3
3
|
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, normalizeClass, normalizeStyle, openBlock, renderList, renderSlot, toDisplayString, unref, withCtx } from "vue";
|
|
4
|
-
import { FORM_EMPTY_CONTENT, bem, injectFormContext } from "@veltra/utils";
|
|
5
4
|
import { useFormFallbackProps } from "@veltra/compositions";
|
|
5
|
+
import { FORM_EMPTY_CONTENT, bem, injectFormContext } from "@veltra/utils";
|
|
6
6
|
import { Minus, Plus } from "@veltra/icons/normal";
|
|
7
7
|
//#region src/components/group-input/group-input.vue
|
|
8
8
|
const _hoisted_1 = { key: 0 };
|
|
@@ -106,6 +106,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
106
106
|
circle: "",
|
|
107
107
|
disabled: unref(disabled),
|
|
108
108
|
size: unref(size),
|
|
109
|
+
type: "primary",
|
|
109
110
|
onClick: ($event) => handleAdd(index)
|
|
110
111
|
}, null, 8, [
|
|
111
112
|
"icon",
|