@veltra/desktop 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/dist/components/action/action-group.js +110 -3
  2. package/dist/components/action/action-group.js.map +1 -1
  3. package/dist/components/action/action-group.vue.d.ts +16 -3
  4. package/dist/components/action/action.js +26 -13
  5. package/dist/components/action/action.js.map +1 -1
  6. package/dist/components/action/action.vue.d.ts +2 -2
  7. package/dist/components/action/style.js +2 -1
  8. package/dist/components/action/style2.css +35 -7
  9. package/dist/components/auto-complete/auto-complete.vue.d.ts +2 -2
  10. package/dist/components/batch-edit/batch-edit-form.js +106 -42
  11. package/dist/components/batch-edit/batch-edit-form.js.map +1 -1
  12. package/dist/components/batch-edit/batch-edit-list.js +84 -47
  13. package/dist/components/batch-edit/batch-edit-list.js.map +1 -1
  14. package/dist/components/batch-edit/batch-edit.js +42 -10
  15. package/dist/components/batch-edit/batch-edit.js.map +1 -1
  16. package/dist/components/batch-edit/style.js +2 -4
  17. package/dist/components/batch-edit/style2.css +202 -30
  18. package/dist/components/batch-edit/use-edit.js +45 -9
  19. package/dist/components/batch-edit/use-edit.js.map +1 -1
  20. package/dist/components/cascade/cascade.js +3 -1
  21. package/dist/components/cascade/cascade.js.map +1 -1
  22. package/dist/components/cascade/cascade.vue.d.ts +2 -2
  23. package/dist/components/checkbox/checkbox-button.vue.d.ts +1 -1
  24. package/dist/components/checkbox-group/checkbox-group.vue.d.ts +2 -2
  25. package/dist/components/code-editor/code-editor.js +145 -49
  26. package/dist/components/code-editor/code-editor.js.map +1 -1
  27. package/dist/components/code-editor/code-editor.vue.d.ts +2 -0
  28. package/dist/components/code-editor/style2.css +87 -19
  29. package/dist/components/date-panel/date-panel.vue.d.ts +1 -1
  30. package/dist/components/date-picker/date-picker.vue.d.ts +2 -2
  31. package/dist/components/date-range-picker/date-range-picker.vue.d.ts +2 -2
  32. package/dist/components/dialog/dialog.js +6 -2
  33. package/dist/components/dialog/dialog.js.map +1 -1
  34. package/dist/components/dialog/style2.css +2 -3
  35. package/dist/components/expression-editor/components/path-preview.js +27 -0
  36. package/dist/components/expression-editor/components/path-preview.js.map +1 -0
  37. package/dist/components/expression-editor/components/variable-picker.js +199 -153
  38. package/dist/components/expression-editor/components/variable-picker.js.map +1 -1
  39. package/dist/components/expression-editor/core/chip.js +54 -0
  40. package/dist/components/expression-editor/core/chip.js.map +1 -0
  41. package/dist/components/expression-editor/core/editor.js +424 -0
  42. package/dist/components/expression-editor/core/editor.js.map +1 -0
  43. package/dist/components/expression-editor/core/mention.js +91 -0
  44. package/dist/components/expression-editor/core/mention.js.map +1 -0
  45. package/dist/components/expression-editor/core/model.js +64 -0
  46. package/dist/components/expression-editor/core/model.js.map +1 -0
  47. package/dist/components/expression-editor/di.js +4 -10
  48. package/dist/components/expression-editor/di.js.map +1 -1
  49. package/dist/components/expression-editor/expression-editor.js +168 -114
  50. package/dist/components/expression-editor/expression-editor.js.map +1 -1
  51. package/dist/components/expression-editor/expression-editor.vue.d.ts +2 -1
  52. package/dist/components/expression-editor/style.js +0 -2
  53. package/dist/components/expression-editor/style2.css +145 -219
  54. package/dist/components/index.js +54 -54
  55. package/dist/components/input/input.vue.d.ts +2 -2
  56. package/dist/components/layout/layout.js +12 -11
  57. package/dist/components/layout/layout.js.map +1 -1
  58. package/dist/components/multi-select/multi-select.vue.d.ts +3 -3
  59. package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +3 -3
  60. package/dist/components/notification/notification.vue.d.ts +1 -1
  61. package/dist/components/number/number.vue.d.ts +1 -1
  62. package/dist/components/number-input/number-input.js +4 -4
  63. package/dist/components/number-input/number-input.js.map +1 -1
  64. package/dist/components/number-input/number-input.vue.d.ts +2 -2
  65. package/dist/components/number-range-input/number-range-input.vue.d.ts +1 -1
  66. package/dist/components/password-input/password-input.vue.d.ts +1 -1
  67. package/dist/components/pop-confirm/pop-confirm.vue.d.ts +1 -1
  68. package/dist/components/radio-group/radio-group.vue.d.ts +2 -2
  69. package/dist/components/rich-text-editor/rich-text-editor.js +1 -1
  70. package/dist/components/rich-text-editor/rich-text-editor.vue.d.ts +1 -1
  71. package/dist/components/rich-text-editor/toolbar.js +2 -2
  72. package/dist/components/select/select.vue.d.ts +2 -2
  73. package/dist/components/steps/steps.vue.d.ts +1 -1
  74. package/dist/components/table/use-table.js +16 -0
  75. package/dist/components/table/use-table.js.map +1 -1
  76. package/dist/components/tabs/tabs-horizontal.vue.d.ts +1 -1
  77. package/dist/components/tabs/tabs-vertical.vue.d.ts +1 -1
  78. package/dist/components/tabs/tabs.vue.d.ts +1 -1
  79. package/dist/components/textarea/textarea.vue.d.ts +2 -2
  80. package/dist/components/tip/tip.vue.d.ts +1 -1
  81. package/dist/components/tree/style2.css +18 -12
  82. package/dist/components/tree/tree-node.js +7 -4
  83. package/dist/components/tree/tree-node.js.map +1 -1
  84. package/dist/components/tree-select/tree-select.vue.d.ts +3 -3
  85. package/dist/index.d.ts +3 -3
  86. package/dist/index.js +83 -83
  87. package/dist/style.js +3 -3
  88. package/dist/types/action.d.ts +38 -4
  89. package/dist/types/cascade.d.ts +2 -3
  90. package/dist/types/code-editor.d.ts +9 -2
  91. package/dist/types/expression-editor.d.ts +9 -1
  92. package/dist/types/index.d.ts +2 -2
  93. package/package.json +11 -12
  94. package/src/components/action/action-group.vue +126 -56
  95. package/src/components/action/action.vue +35 -12
  96. package/src/components/action/style.scss +46 -10
  97. package/src/components/action/style.ts +2 -1
  98. package/src/components/batch-edit/batch-edit-form.vue +121 -45
  99. package/src/components/batch-edit/batch-edit-list.vue +56 -39
  100. package/src/components/batch-edit/batch-edit.vue +57 -6
  101. package/src/components/batch-edit/style.scss +251 -37
  102. package/src/components/batch-edit/style.ts +5 -8
  103. package/src/components/batch-edit/use-edit.ts +58 -11
  104. package/src/components/cascade/cascade.vue +3 -1
  105. package/src/components/code-editor/code-editor.vue +198 -63
  106. package/src/components/code-editor/style.scss +110 -12
  107. package/src/components/dialog/dialog.vue +6 -2
  108. package/src/components/dialog/style.scss +4 -4
  109. package/src/components/expression-editor/__test__/chip.test.ts +86 -0
  110. package/src/components/expression-editor/__test__/mention.test.ts +122 -0
  111. package/src/components/expression-editor/__test__/model.test.ts +127 -0
  112. package/src/components/expression-editor/components/path-preview.vue +32 -0
  113. package/src/components/expression-editor/components/variable-picker.vue +224 -219
  114. package/src/components/expression-editor/core/chip.ts +101 -0
  115. package/src/components/expression-editor/core/editor.ts +513 -0
  116. package/src/components/expression-editor/core/mention.ts +121 -0
  117. package/src/components/expression-editor/core/model.ts +109 -0
  118. package/src/components/expression-editor/di.ts +4 -32
  119. package/src/components/expression-editor/expression-editor.vue +184 -151
  120. package/src/components/expression-editor/style.scss +148 -220
  121. package/src/components/expression-editor/style.ts +0 -2
  122. package/src/components/layout/layout.vue +17 -19
  123. package/src/components/number-input/number-input.vue +4 -4
  124. package/src/components/table/use-table.ts +16 -0
  125. package/src/components/tree/style.scss +30 -33
  126. package/src/components/tree/tree-node.vue +4 -2
  127. package/src/types/action.ts +42 -4
  128. package/src/types/cascade.ts +4 -3
  129. package/src/types/code-editor.ts +9 -2
  130. package/src/types/expression-editor.ts +9 -0
  131. package/dist/components/action/action-group.vue_vue_type_script_setup_true_lang.js +0 -65
  132. package/dist/components/action/action-group.vue_vue_type_script_setup_true_lang.js.map +0 -1
  133. package/dist/components/expression-editor/constants.js +0 -9
  134. package/dist/components/expression-editor/constants.js.map +0 -1
  135. package/dist/components/expression-editor/internal/editor-runtime/create-runtime.js +0 -47
  136. package/dist/components/expression-editor/internal/editor-runtime/create-runtime.js.map +0 -1
  137. package/dist/components/expression-editor/internal/editor-runtime/model-sync.js +0 -49
  138. package/dist/components/expression-editor/internal/editor-runtime/model-sync.js.map +0 -1
  139. package/dist/components/expression-editor/internal/features/commands/register-command-packs.js +0 -215
  140. package/dist/components/expression-editor/internal/features/commands/register-command-packs.js.map +0 -1
  141. package/dist/components/expression-editor/internal/features/drag-drop/drag-drop-service.js +0 -33
  142. package/dist/components/expression-editor/internal/features/drag-drop/drag-drop-service.js.map +0 -1
  143. package/dist/components/expression-editor/internal/features/insertion/insertion-service.js +0 -33
  144. package/dist/components/expression-editor/internal/features/insertion/insertion-service.js.map +0 -1
  145. package/dist/components/expression-editor/nodes/variable-node.js +0 -94
  146. package/dist/components/expression-editor/nodes/variable-node.js.map +0 -1
  147. package/dist/components/expression-editor/parser.js +0 -32
  148. package/dist/components/expression-editor/parser.js.map +0 -1
  149. package/dist/components/expression-editor/plain-text.js +0 -19
  150. package/dist/components/expression-editor/plain-text.js.map +0 -1
  151. package/dist/components/expression-editor/use-context.js +0 -69
  152. package/dist/components/expression-editor/use-context.js.map +0 -1
  153. package/dist/components/expression-editor/use-decorators.js +0 -27
  154. package/dist/components/expression-editor/use-decorators.js.map +0 -1
  155. package/dist/components/expression-editor/use-expression-drag-drop.js +0 -275
  156. package/dist/components/expression-editor/use-expression-drag-drop.js.map +0 -1
  157. package/src/components/batch-edit/batch-edit-new.vue +0 -168
  158. package/src/components/batch-edit/style-new.scss +0 -35
  159. package/src/components/batch-edit/use-edit-new.ts +0 -68
  160. package/src/components/batch-edit/use-tip.ts +0 -47
  161. package/src/components/expression-editor/__test__/architecture-boundaries.test.ts +0 -103
  162. package/src/components/expression-editor/__test__/architecture-compatibility.test.ts +0 -52
  163. package/src/components/expression-editor/__test__/drag-drop.test.ts +0 -171
  164. package/src/components/expression-editor/__test__/parser.test.ts +0 -62
  165. package/src/components/expression-editor/constants.ts +0 -6
  166. package/src/components/expression-editor/internal/contracts/editor-runtime.ts +0 -11
  167. package/src/components/expression-editor/internal/editor-runtime/create-runtime.ts +0 -64
  168. package/src/components/expression-editor/internal/editor-runtime/index.ts +0 -1
  169. package/src/components/expression-editor/internal/editor-runtime/model-sync.ts +0 -68
  170. package/src/components/expression-editor/internal/features/commands/register-command-packs.ts +0 -517
  171. package/src/components/expression-editor/internal/features/drag-drop/drag-drop-service.ts +0 -51
  172. package/src/components/expression-editor/internal/features/insertion/insertion-service.ts +0 -56
  173. package/src/components/expression-editor/nodes/variable-node.tsx +0 -118
  174. package/src/components/expression-editor/parser.ts +0 -46
  175. package/src/components/expression-editor/plain-text.ts +0 -25
  176. package/src/components/expression-editor/plan.md +0 -22
  177. package/src/components/expression-editor/use-context.ts +0 -134
  178. package/src/components/expression-editor/use-decorators.tsx +0 -29
  179. package/src/components/expression-editor/use-editor.ts +0 -12
  180. package/src/components/expression-editor/use-expression-drag-drop.ts +0 -396
@@ -2,7 +2,6 @@
2
2
  @use 'pkg:@veltra/styles/functions' as fn;
3
3
  @use 'pkg:@veltra/styles/vars';
4
4
 
5
- // 方便拼接
6
5
  $root-name: expression-editor;
7
6
 
8
7
  @include m.b($root-name) {
@@ -43,26 +42,6 @@ $root-name: expression-editor;
43
42
  }
44
43
  }
45
44
 
46
- @include m.e(tools) {
47
- text-align: right;
48
- margin-bottom: fn.use-var(gap, small);
49
-
50
- & > * {
51
- cursor: pointer;
52
- transition: color 0.2s ease;
53
-
54
- &:hover {
55
- color: fn.use-var(color, primary);
56
- }
57
- }
58
- }
59
-
60
- @include m.e(paragraph) {
61
- margin: 0;
62
- padding: 0;
63
- line-height: 1.6;
64
- }
65
-
66
45
  @include m.e(placeholder) {
67
46
  position: absolute;
68
47
  color: fn.use-var(text-color, placeholder);
@@ -83,213 +62,172 @@ $root-name: expression-editor;
83
62
  overflow-y: auto;
84
63
 
85
64
  &:empty::before {
86
- content: '\200b'; // Zero-width space to maintain height
87
- }
88
-
89
- .ultra-expression-variable-source {
90
- cursor: grab;
65
+ content: '\200b';
91
66
  }
92
67
 
93
- .ultra-expression-variable-source.is-dragging {
94
- opacity: 0.5;
95
- cursor: grabbing;
68
+ > [data-seg='text'] {
69
+ // 让连续中文 / 字符自然包裹;变量 chip 之间的空 text span 也能承载光标
70
+ white-space: pre-wrap;
96
71
  }
97
-
98
- .expression-editor__drop-indicator {
99
- position: absolute;
100
- width: 2px;
101
- border-radius: 999px;
102
- transform: translateX(-1px);
103
- pointer-events: none;
104
- background-color: fn.use-var(color, primary);
105
- box-shadow: 0 0 0 1px fn.use-var(color, primary, light-8);
106
- transition: opacity 0.12s ease;
107
- z-index: 3;
108
- }
109
- }
110
-
111
- @include m.e(fallback) {
112
- display: flex;
113
- flex-direction: column;
114
- gap: 6px;
115
- margin-top: 8px;
116
- padding-top: 8px;
117
- border-top: fn.use-var(border);
118
- }
119
-
120
- @include m.e(fallback-item) {
121
- display: flex;
122
- align-items: center;
123
- justify-content: space-between;
124
- gap: 8px;
125
- }
126
-
127
- @include m.e(fallback-label) {
128
- min-width: 0;
129
- flex: 1;
130
- font-size: 12px;
131
- color: fn.use-var(text-color, main);
132
- overflow: hidden;
133
- text-overflow: ellipsis;
134
- white-space: nowrap;
135
72
  }
136
73
 
137
- @include m.e(fallback-actions) {
74
+ // ─── 变量 chip ────────────────────────────────────────────────
75
+ @include m.e(chip) {
138
76
  display: inline-flex;
139
77
  align-items: center;
140
78
  gap: 4px;
141
- flex-shrink: 0;
142
- }
143
-
144
- @include m.e(fallback-button) {
145
- border: fn.use-var(border);
146
- border-radius: fn.use-var(radius, small);
147
- background-color: fn.use-var(bg-color, top);
148
- color: fn.use-var(text-color, main);
149
- font-size: 12px;
150
- line-height: 1;
151
- height: 22px;
79
+ margin: 0 2px;
152
80
  padding: 0 8px;
81
+ height: 22px;
82
+ line-height: 1;
83
+ font-size: 12px;
84
+ color: fn.use-var(text-color, white);
85
+ background-color: fn.use-var(color, primary);
86
+ border-radius: 999px;
153
87
  cursor: pointer;
154
- transition: all 0.12s ease;
88
+ user-select: none;
89
+ transition:
90
+ background-color 0.12s ease,
91
+ box-shadow 0.12s ease;
155
92
 
156
- &:hover:not(:disabled) {
157
- color: fn.use-var(color, primary);
158
- border-color: fn.use-var(color, primary);
159
- background-color: fn.use-var(color, primary, light-9);
93
+ &:hover {
94
+ background-color: fn.use-var(color, primary, light-2);
95
+ box-shadow: 0 1px 4px fn.use-var(shadow, color);
96
+
97
+ .#{vars.$namespace}#{$root-name}__chip-close {
98
+ opacity: 1;
99
+ max-width: 14px;
100
+ margin-left: 2px;
101
+ }
160
102
  }
161
103
 
162
- &:disabled {
163
- cursor: not-allowed;
164
- color: fn.use-var(text-color, placeholder);
165
- border-color: fn.use-var(border, color);
166
- background-color: fn.use-var(bg-color, middle);
104
+ &.is-focused {
105
+ box-shadow: 0 0 0 2px fn.use-var(color, primary, light-7);
167
106
  }
168
107
  }
169
108
 
170
- @include m.size using ($size) {
171
- min-height: fn.use-var(form-component-height, $size);
172
- padding: fn.use-var(gap, $size);
173
-
174
- @include m.bem($root-name, placeholder) {
175
- top: fn.use-var(gap, $size);
176
- left: fn.use-var(gap, $size);
177
- font-size: fn.use-var(font-size-main, $size);
178
- }
109
+ @include m.e(chip-label) {
110
+ pointer-events: none;
111
+ }
179
112
 
180
- @include m.bem($root-name, container) {
181
- font-size: fn.use-var(font-size-main, $size);
182
- }
113
+ @include m.e(chip-close) {
114
+ display: inline-flex;
115
+ align-items: center;
116
+ justify-content: center;
117
+ width: 14px;
118
+ max-width: 0;
119
+ margin-left: 0;
120
+ overflow: hidden;
121
+ font-size: 14px;
122
+ line-height: 1;
123
+ color: fn.use-var(text-color, white);
124
+ opacity: 0;
125
+ transition:
126
+ opacity 0.12s ease,
127
+ max-width 0.12s ease,
128
+ margin-left 0.12s ease;
129
+ cursor: pointer;
183
130
 
184
- @include m.bem($root-name, clear) {
185
- font-size: fn.use-var(font-size-main, $size);
131
+ &:hover {
132
+ transform: scale(1.1);
186
133
  }
187
134
  }
188
135
 
189
- @include m.e(variable-empty) {
190
- padding: 16px;
191
- text-align: center;
192
- color: fn.use-var(text-color, second);
193
- font-size: 13px;
194
- font-weight: 500;
195
- }
196
-
197
- @include m.e(variable-list) {
198
- padding: 6px 0;
199
- margin: 0;
200
- list-style: none;
201
- max-height: 240px;
202
- overflow-y: auto;
136
+ // ─── 变量选择面板 ──────────────────────────────────────────
137
+ @include m.e(picker) {
138
+ min-width: 220px;
203
139
  background-color: fn.use-var(bg-color, top);
140
+ }
204
141
 
205
- &::-webkit-scrollbar {
206
- width: 8px;
207
- }
142
+ @include m.e(picker-body) {
143
+ display: flex;
144
+ align-items: stretch;
145
+ min-height: 200px;
146
+ }
208
147
 
209
- &::-webkit-scrollbar-track {
210
- background-color: fn.use-var(bg-color, middle);
211
- border-radius: fn.use-var(radius, small);
212
- }
148
+ @include m.e(panel) {
149
+ flex: 1 1 auto;
150
+ min-width: 0;
151
+ max-height: 320px;
152
+ }
213
153
 
214
- &::-webkit-scrollbar-thumb {
215
- background-color: fn.use-var(text-color, placeholder);
216
- border-radius: fn.use-var(radius, small);
217
- border: 2px solid fn.use-var(bg-color, middle);
154
+ @include m.e(panel-list) {
155
+ height: 100%;
156
+ min-height: 200px;
157
+ }
218
158
 
219
- &:hover {
220
- background-color: fn.use-var(text-color, second);
221
- }
222
- }
159
+ @include m.e(panel-content) {
160
+ padding: 4px 0;
223
161
  }
224
162
 
225
- @include m.e(variable-item) {
226
- padding: 8px 14px;
227
- margin: 2px 6px;
163
+ @include m.e(item) {
164
+ padding: 6px 12px;
228
165
  cursor: pointer;
229
- transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
230
- border-radius: fn.use-var(radius, default);
231
- font-size: 13px;
166
+ user-select: none;
167
+ display: flex;
168
+ align-items: center;
169
+ justify-content: space-between;
170
+ gap: 8px;
171
+ transition:
172
+ background-color 0.12s ease,
173
+ color 0.12s ease;
232
174
  color: fn.use-var(text-color, main);
233
- font-weight: 500;
234
-
235
- &:hover {
236
- background-color: fn.use-var(color, primary, light-9);
237
- color: fn.use-var(color, primary);
238
- transform: translateX(2px);
239
- }
175
+ font-size: 13px;
176
+ line-height: 1.4;
177
+ border-radius: fn.use-var(radius, small);
178
+ margin: 1px 4px;
240
179
 
241
- @include m.is('active') {
180
+ @include m.is(active) {
242
181
  background-color: fn.use-var(color, primary);
243
182
  color: fn.use-var(text-color, white);
244
- font-weight: 600;
245
- box-shadow: 0 2px 4px fn.use-var(shadow, color);
183
+
184
+ @include m.bem($root-name, item-expand) {
185
+ color: fn.use-var(text-color, white);
186
+ }
246
187
  }
247
188
  }
248
189
 
249
- @include m.e(filter) {
250
- padding: 6px;
251
- border-bottom: fn.use-var(border);
190
+ @include m.e(item-label) {
191
+ flex: 1;
192
+ overflow: hidden;
193
+ text-overflow: ellipsis;
194
+ white-space: nowrap;
195
+ }
196
+
197
+ @include m.e(item-expand) {
198
+ flex-shrink: 0;
199
+ color: fn.use-var(text-color, placeholder);
200
+ font-size: 12px;
252
201
  }
253
202
 
203
+ @include m.e(empty) {
204
+ flex: 1;
205
+ padding: 32px 16px;
206
+ text-align: center;
207
+ }
208
+
209
+ // ─── 面包屑 ───────────────────────────────────────────────
254
210
  @include m.e(breadcrumbs) {
255
211
  display: flex;
256
212
  align-items: center;
213
+ flex-wrap: wrap;
257
214
  padding: 6px 10px;
258
215
  border-bottom: fn.use-var(border);
259
- background-color: fn.use-var(bg-color, middle);
260
216
  font-size: 12px;
261
217
  color: fn.use-var(text-color, second);
262
- overflow-x: auto;
263
- white-space: nowrap;
264
-
265
- &::-webkit-scrollbar {
266
- height: 4px;
267
- }
268
-
269
- &::-webkit-scrollbar-track {
270
- background-color: transparent;
271
- }
272
-
273
- &::-webkit-scrollbar-thumb {
274
- background-color: fn.use-var(border, color);
275
- border-radius: 2px;
276
-
277
- &:hover {
278
- background-color: fn.use-var(text-color, placeholder);
279
- }
280
- }
281
218
  }
282
219
 
283
220
  @include m.e(breadcrumb-item) {
284
- display: flex;
221
+ display: inline-flex;
285
222
  align-items: center;
286
223
  gap: 4px;
287
224
  }
288
225
 
289
226
  @include m.e(breadcrumb-link) {
290
227
  cursor: pointer;
291
- transition: all 0.15s ease;
292
- font-weight: 500;
228
+ transition:
229
+ color 0.12s ease,
230
+ background-color 0.12s ease;
293
231
  padding: 2px 6px;
294
232
  border-radius: fn.use-var(radius, small);
295
233
 
@@ -307,74 +245,64 @@ $root-name: expression-editor;
307
245
  @include m.e(breadcrumb-separator) {
308
246
  font-size: 10px;
309
247
  color: fn.use-var(text-color, placeholder);
310
- margin: 0 2px;
311
248
  }
312
249
 
313
- @include m.e(panel) {
314
- min-height: 200px;
315
- max-height: 360px;
250
+ // ─── 路径预览(扁平模式专用) ────────────────────────────────
251
+ @include m.e(path-preview) {
252
+ flex: 0 0 200px;
253
+ border-left: fn.use-var(border);
254
+ padding: 8px 12px;
255
+ background-color: fn.use-var(bg-color, middle);
256
+ font-size: 12px;
316
257
  }
317
258
 
318
- @include m.e(panel-list) {
319
- height: 100%;
320
- min-height: 200px;
259
+ @include m.e(path-preview-title) {
260
+ color: fn.use-var(text-color, second);
261
+ margin-bottom: 6px;
262
+ font-weight: 600;
321
263
  }
322
264
 
323
- @include m.e(panel-content) {
324
- padding: 2px 0;
265
+ @include m.e(path-tree) {
266
+ list-style: none;
267
+ margin: 0;
268
+ padding: 0;
325
269
  }
326
270
 
327
- @include m.e(item) {
328
- padding: 5px 10px;
329
- cursor: pointer;
330
- user-select: none;
271
+ @include m.e(path-tree-item) {
331
272
  display: flex;
332
273
  align-items: center;
333
- justify-content: space-between;
334
- gap: 8px;
335
- transition: all 0.12s ease;
274
+ gap: 4px;
275
+ line-height: 1.6;
336
276
  color: fn.use-var(text-color, main);
337
- font-size: 13px;
338
- line-height: 1.4;
339
- border-radius: fn.use-var(radius, small);
340
- margin: 1px 4px;
341
-
342
- &:hover {
343
- background-color: fn.use-var(bg-color, hover);
344
- }
345
277
 
346
278
  @include m.is(active) {
347
- background-color: fn.use-var(color, primary);
348
- color: fn.use-var(text-color, white);
349
- font-weight: 500;
350
- box-shadow: 0 1px 3px fn.use-var(shadow, color);
351
-
352
- @include m.bem($root-name, item-expand) {
353
- color: fn.use-var(text-color, white);
354
- }
279
+ color: fn.use-var(color, primary);
280
+ font-weight: 600;
355
281
  }
282
+ }
356
283
 
357
- @include m.is(leaf) {
358
- // 叶子节点样式
359
- }
284
+ @include m.e(path-tree-branch) {
285
+ color: fn.use-var(text-color, placeholder);
360
286
  }
361
287
 
362
- @include m.e(item-label) {
363
- flex: 1;
288
+ @include m.e(path-tree-label) {
364
289
  overflow: hidden;
365
290
  text-overflow: ellipsis;
366
291
  white-space: nowrap;
367
292
  }
368
293
 
369
- @include m.e(item-expand) {
370
- flex-shrink: 0;
371
- color: fn.use-var(text-color, placeholder);
372
- font-size: 11px;
373
- transition: color 0.15s ease;
374
- }
294
+ @include m.size using ($size) {
295
+ min-height: fn.use-var(form-component-height, $size);
296
+ padding: fn.use-var(gap, $size);
375
297
 
376
- @include m.e(empty) {
377
- padding: 40px 20px;
378
- text-align: center;
298
+ @include m.bem($root-name, placeholder) {
299
+ top: fn.use-var(gap, $size);
300
+ left: fn.use-var(gap, $size);
301
+ font-size: fn.use-var(font-size-main, $size);
302
+ }
303
+
304
+ @include m.bem($root-name, container) {
305
+ font-size: fn.use-var(font-size-main, $size);
306
+ }
379
307
  }
380
308
  }
@@ -1,7 +1,5 @@
1
1
  import '../tip/style'
2
- import '../input/style'
3
2
  import '../icon/style'
4
3
  import '../scroll/style'
5
4
  import '../empty/style'
6
- import '../tag/style'
7
5
  import './style.scss'
@@ -59,7 +59,7 @@ watchEffect(() => {
59
59
  templateCols.value = []
60
60
  return
61
61
  }
62
- templateCols.value = typeof cols === 'string' ? cols.split(' ') : cols
62
+ templateCols.value = typeof cols === 'string' ? cols.split(' ') : [...cols]
63
63
  })
64
64
 
65
65
  const style = computed<CSSProperties>(() => {
@@ -109,27 +109,25 @@ useResizeObserver({
109
109
 
110
110
  // const resizing = shallowRef(false)
111
111
 
112
- let prevSize = '0'
113
- let nextSize = '0'
112
+ let prevSize = 0
113
+ let nextSize = 0
114
114
  const handleStartResize = (index: number) => {
115
- prevSize = templateCols.value[index]!
116
- nextSize = templateCols.value[index + 1]!
117
-
118
- if (!prevSize.endsWith('px') && !nextSize.endsWith('px')) {
119
- const rect = containerRef.value?.children[index + 1]?.getBoundingClientRect()
120
- if (rect) {
121
- nextSize = rect.width + 'px'
122
- }
123
- }
124
- // resizing.value = true
115
+ const container = containerRef.value
116
+ if (!container) return
117
+
118
+ // 拖拽前把相邻两列按实际渲染宽度固定成 px,
119
+ // 这样拖拽时两列等量增减、容器整体宽度保持不变。
120
+ const prevDom = container.children[index] as HTMLElement | undefined
121
+ const nextDom = container.children[index + 1] as HTMLElement | undefined
122
+ prevSize = prevDom ? prevDom.getBoundingClientRect().width : 0
123
+ nextSize = nextDom ? nextDom.getBoundingClientRect().width : 0
125
124
  }
126
125
  const handleResize = (offset: number, index: number) => {
127
- if (prevSize?.endsWith('px')) {
128
- templateCols.value[index] = `${parseInt(prevSize) + offset}px`
129
- }
130
- if (nextSize?.endsWith('px')) {
131
- templateCols.value[index + 1] = `${parseInt(nextSize) - offset}px`
132
- }
126
+ // 钳位到 [-prevSize, nextSize],避免轨道尺寸出现负值——
127
+ // 一旦 grid-template-columns 中带负值,整条声明会被浏览器丢弃。
128
+ const clamped = Math.max(-prevSize, Math.min(nextSize, offset))
129
+ templateCols.value[index] = `${prevSize + clamped}px`
130
+ templateCols.value[index + 1] = `${nextSize - clamped}px`
133
131
  }
134
132
 
135
133
  provide(LayoutDIKey, {
@@ -181,9 +181,9 @@ function getDisplayed(num?: number): string {
181
181
 
182
182
  watch(
183
183
  [model, focused, () => props.currency],
184
- ([model, focused]) => {
185
- if (focused) return
186
- displayed.value = getDisplayed(model)
184
+ ([modelValue, inputFocused]) => {
185
+ if (inputFocused) return
186
+ displayed.value = getDisplayed(modelValue)
187
187
  },
188
188
  { immediate: true }
189
189
  )
@@ -248,7 +248,7 @@ function getValidValue<T extends undefined | number>(val: T): T {
248
248
 
249
249
  function handleUpdateModelValue(input: string): void {
250
250
  const newVal = parseDisplayed(input)
251
- model.value = getValidValue(newVal) ?? 0
251
+ model.value = getValidValue(newVal)
252
252
  displayed.value = input
253
253
  }
254
254
 
@@ -103,7 +103,21 @@ export function useTable(options: Options): UseTableReturn {
103
103
  headerCellClassCache = new WeakMap()
104
104
  })
105
105
 
106
+ /**
107
+ * B2: 即便缓存命中也需读取 `leftFixed` / `rightFixed`,将其登记为调用方
108
+ * render effect 的响应式依赖。
109
+ *
110
+ * 否则横向滚动时虽然 `watch` 已经清空缓存,但已渲染的单元格没有任何依赖
111
+ * 把这两个 ref 串联到自己的 render,导致 `is-last-fixed` / `is-first-fixed`
112
+ * 阴影 class 不会被刷新——只有垂直滚动让虚拟列表新挂载行时(render 首次
113
+ * 命中空缓存读到最新值)才能看到阴影。
114
+ *
115
+ * 父级 `useTable` 的 watch effect id 早于子 `TableRow` 的 render effect,
116
+ * 同一 flush 周期中缓存会先被清空,再轮到 render 重跑读到最新值。
117
+ */
106
118
  const getCellClass = (column: ColumnNode): string => {
119
+ void leftFixed.value
120
+ void rightFixed.value
107
121
  const cached = cellClassCache.get(column)
108
122
  if (cached !== undefined) return cached
109
123
  const result = getCommonClassName(column) + ` ${bem.is(column.align)}`
@@ -112,6 +126,8 @@ export function useTable(options: Options): UseTableReturn {
112
126
  }
113
127
 
114
128
  const getHeaderCellClass = (column: ColumnNode): string => {
129
+ void leftFixed.value
130
+ void rightFixed.value
115
131
  const cached = headerCellClassCache.get(column)
116
132
  if (cached !== undefined) return cached
117
133
  const result = getCommonClassName(column) + ` ${bem.is(column.headerAlign)}`