@veltra/desktop 1.1.4 → 1.1.6

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 (169) hide show
  1. package/dist/components/action/action-group.js +3 -110
  2. package/dist/components/action/action-group.js.map +1 -1
  3. package/dist/components/action/action-group.vue.d.ts +4 -13
  4. package/dist/components/action/action-group.vue_vue_type_script_setup_true_lang.js +105 -0
  5. package/dist/components/action/action-group.vue_vue_type_script_setup_true_lang.js.map +1 -0
  6. package/dist/components/action/action.js +5 -1
  7. package/dist/components/action/action.js.map +1 -1
  8. package/dist/components/action/action.vue.d.ts +2 -2
  9. package/dist/components/action/di.js.map +1 -1
  10. package/dist/components/action/style2.css +17 -14
  11. package/dist/components/auto-complete/auto-complete.js +1 -1
  12. package/dist/components/badge/badge.js +1 -1
  13. package/dist/components/batch-edit/batch-edit-form.js +105 -100
  14. package/dist/components/batch-edit/batch-edit-form.js.map +1 -1
  15. package/dist/components/batch-edit/batch-edit-list.js +52 -68
  16. package/dist/components/batch-edit/batch-edit-list.js.map +1 -1
  17. package/dist/components/batch-edit/batch-edit.js +0 -1
  18. package/dist/components/batch-edit/batch-edit.js.map +1 -1
  19. package/dist/components/batch-edit/style.js +1 -0
  20. package/dist/components/batch-edit/style2.css +13 -89
  21. package/dist/components/breadcrumb/breadcrumb.js +1 -1
  22. package/dist/components/button/button.js +1 -1
  23. package/dist/components/card/card.js +1 -1
  24. package/dist/components/cascade/cascade-panel-item.js +4 -4
  25. package/dist/components/cascade/cascade.js +2 -2
  26. package/dist/components/cascade/cascade.vue.d.ts +2 -2
  27. package/dist/components/checkbox/checkbox-button.js +1 -1
  28. package/dist/components/checkbox/checkbox-button.vue.d.ts +1 -1
  29. package/dist/components/checkbox/checkbox.js +1 -1
  30. package/dist/components/checkbox-group/checkbox-group.js +1 -1
  31. package/dist/components/checkbox-group/checkbox-group.vue.d.ts +2 -2
  32. package/dist/components/code-editor/code-editor.js +1 -1
  33. package/dist/components/collapse/collapse.js +1 -1
  34. package/dist/components/condition-editor/components/condition-group.js +152 -0
  35. package/dist/components/condition-editor/components/condition-group.js.map +1 -0
  36. package/dist/components/condition-editor/components/condition-row.js +217 -0
  37. package/dist/components/condition-editor/components/condition-row.js.map +1 -0
  38. package/dist/components/condition-editor/condition-editor.js +134 -5
  39. package/dist/components/condition-editor/condition-editor.js.map +1 -1
  40. package/dist/components/condition-editor/condition-editor.vue.d.ts +10 -2
  41. package/dist/components/condition-editor/core/evaluator.js +75 -0
  42. package/dist/components/condition-editor/core/evaluator.js.map +1 -0
  43. package/dist/components/condition-editor/core/operators.js +123 -0
  44. package/dist/components/condition-editor/core/operators.js.map +1 -0
  45. package/dist/components/condition-editor/style.js +7 -0
  46. package/dist/components/condition-editor/style2.css +186 -0
  47. package/dist/components/context-menu/context-menu.js +1 -1
  48. package/dist/components/date-panel/date-panel.vue.d.ts +1 -1
  49. package/dist/components/date-picker/date-picker.js +2 -2
  50. package/dist/components/date-picker/date-picker.vue.d.ts +1 -1
  51. package/dist/components/date-range-picker/date-range-picker.js +2 -2
  52. package/dist/components/date-range-picker/date-range-picker.vue.d.ts +1 -1
  53. package/dist/components/dialog/dialog.js +7 -7
  54. package/dist/components/dialog/style2.css +8 -0
  55. package/dist/components/dialog/use-maximum.js +1 -1
  56. package/dist/components/drawer/style2.css +8 -0
  57. package/dist/components/dropdown/dropdown.js +1 -1
  58. package/dist/components/expression-editor/components/variable-picker.js +8 -8
  59. package/dist/components/expression-editor/expression-editor.js +1 -1
  60. package/dist/components/file-viewer/file-viewer.js +13 -13
  61. package/dist/components/form-item/form-item.js.map +1 -1
  62. package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js +6 -6
  63. package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js.map +1 -1
  64. package/dist/components/grid-input/grid-input.js +1 -1
  65. package/dist/components/group-input/group-input.js +1 -1
  66. package/dist/components/index.d.ts +9 -8
  67. package/dist/components/index.js +130 -128
  68. package/dist/components/index.js.map +1 -1
  69. package/dist/components/input/input.vue_vue_type_script_setup_true_lang.js +1 -1
  70. package/dist/components/kbd/index.d.ts +1 -0
  71. package/dist/components/kbd/kbd.js +17 -0
  72. package/dist/components/kbd/kbd.js.map +1 -0
  73. package/dist/components/kbd/kbd.vue.d.ts +18 -0
  74. package/dist/components/kbd/style.d.ts +1 -0
  75. package/dist/components/kbd/style.js +1 -0
  76. package/dist/components/kbd/style2.css +43 -0
  77. package/dist/components/layout/layout-resizer.js +1 -1
  78. package/dist/components/layout/layout.js +1 -1
  79. package/dist/components/list/list.js +1 -1
  80. package/dist/components/loading/loading.js +1 -1
  81. package/dist/components/menu/menu-sub-collapsed.js +4 -4
  82. package/dist/components/menu/menu.js +1 -1
  83. package/dist/components/message/message.js +1 -1
  84. package/dist/components/message-confirm/message-confirm.js +1 -1
  85. package/dist/components/multi-select/multi-select.js +15 -15
  86. package/dist/components/multi-select/multi-select.vue.d.ts +3 -3
  87. package/dist/components/multi-tree-select/multi-tree-select.js +8 -8
  88. package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +3 -3
  89. package/dist/components/notification/notification.js +1 -1
  90. package/dist/components/number/number.vue.d.ts +1 -1
  91. package/dist/components/number-input/number-input.js +2 -2
  92. package/dist/components/number-range-input/number-range-input.js +1 -1
  93. package/dist/components/paginator/paginator.js +6 -6
  94. package/dist/components/paginator/style.js +1 -1
  95. package/dist/components/palette/palette.js +1 -1
  96. package/dist/components/password-input/password-input.js +2 -2
  97. package/dist/components/pop-confirm/pop-confirm.js +1 -1
  98. package/dist/components/progress-nodes/progress-nodes.js +1 -1
  99. package/dist/components/radio/radio.js +1 -1
  100. package/dist/components/radio-group/radio-group.js +1 -1
  101. package/dist/components/radio-group/radio-group.vue.d.ts +2 -2
  102. package/dist/components/rich-text-editor/rich-text-editor.js +1 -1
  103. package/dist/components/scroll/scroll-bar.js +1 -1
  104. package/dist/components/scroll/scroll.js +1 -1
  105. package/dist/components/select/select.js +10 -10
  106. package/dist/components/select/select.vue.d.ts +2 -2
  107. package/dist/components/slider/slider.js +1 -1
  108. package/dist/components/steps/steps.js +2 -2
  109. package/dist/components/switch/switch.js +1 -1
  110. package/dist/components/table/style2.css +4 -1
  111. package/dist/components/table/table.js +2 -3
  112. package/dist/components/table/table.js.map +1 -1
  113. package/dist/components/table/use-columns.js +1 -1
  114. package/dist/components/table/use-fixed-columns.js +8 -31
  115. package/dist/components/table/use-fixed-columns.js.map +1 -1
  116. package/dist/components/table-editor/table-editor.js +1 -2
  117. package/dist/components/table-editor/table-editor.js.map +1 -1
  118. package/dist/components/tabs/tabs-horizontal.js +1 -1
  119. package/dist/components/tabs/tabs-horizontal.vue.d.ts +1 -1
  120. package/dist/components/tabs/tabs-vertical.js +1 -1
  121. package/dist/components/tabs/tabs.js +1 -1
  122. package/dist/components/tabs/tabs.vue.d.ts +1 -1
  123. package/dist/components/tag/tag.js +1 -1
  124. package/dist/components/textarea/textarea.js +1 -1
  125. package/dist/components/theme/style.js +1 -1
  126. package/dist/components/theme/theme.js +11 -11
  127. package/dist/components/tip/tip.js +1 -1
  128. package/dist/components/tree/tree-node.js +1 -1
  129. package/dist/components/tree/tree.js +5 -5
  130. package/dist/components/tree-select/tree-select.js +6 -6
  131. package/dist/components/tree-select/tree-select.vue.d.ts +3 -3
  132. package/dist/index.d.ts +48 -47
  133. package/dist/index.js +46 -45
  134. package/dist/style.js +3 -2
  135. package/dist/types/action.d.ts +5 -11
  136. package/dist/types/condition-editor.d.ts +41 -8
  137. package/dist/types/index.d.ts +4 -4
  138. package/dist/types/table.d.ts +0 -2
  139. package/package.json +11 -11
  140. package/src/components/action/action-group.vue +68 -82
  141. package/src/components/action/action.vue +9 -1
  142. package/src/components/action/di.ts +2 -1
  143. package/src/components/action/style.scss +22 -27
  144. package/src/components/batch-edit/batch-edit-form.vue +73 -70
  145. package/src/components/batch-edit/batch-edit-list.vue +35 -41
  146. package/src/components/batch-edit/style.scss +19 -118
  147. package/src/components/batch-edit/style.ts +1 -0
  148. package/src/components/condition-editor/components/condition-group.vue +131 -0
  149. package/src/components/condition-editor/components/condition-row.vue +208 -0
  150. package/src/components/condition-editor/condition-editor.vue +145 -6
  151. package/src/components/condition-editor/core/evaluator.ts +93 -0
  152. package/src/components/condition-editor/core/operators.ts +57 -0
  153. package/src/components/condition-editor/style.scss +239 -1
  154. package/src/components/condition-editor/style.ts +7 -0
  155. package/src/components/dialog/style.scss +13 -0
  156. package/src/components/drawer/style.scss +13 -0
  157. package/src/components/form-item/form-item.vue +1 -1
  158. package/src/components/index.ts +2 -0
  159. package/src/components/kbd/index.ts +1 -0
  160. package/src/components/kbd/kbd.vue +13 -0
  161. package/src/components/kbd/style.scss +37 -0
  162. package/src/components/kbd/style.ts +1 -0
  163. package/src/components/table/style.scss +9 -1
  164. package/src/components/table/table.vue +1 -3
  165. package/src/components/table/use-fixed-columns.ts +5 -49
  166. package/src/style.ts +1 -0
  167. package/src/types/action.ts +6 -11
  168. package/src/types/condition-editor.ts +39 -7
  169. package/src/types/table.ts +0 -2
@@ -17,8 +17,8 @@ $root-name: table;
17
17
  width: 100%;
18
18
  position: relative;
19
19
  border: 1px solid var(--u-table-border-color);
20
- border-bottom: none;
21
20
  overflow: hidden;
21
+ background-color: fn.use-var(bg-color, top);
22
22
 
23
23
  @include m.size using ($size) {
24
24
  border-radius: fn.use-var(radius, $size);
@@ -171,6 +171,14 @@ $root-name: table;
171
171
 
172
172
  @include m.e(body) {
173
173
  will-change: transform;
174
+
175
+ @include m.bem($root-name, row) {
176
+ &:last-child {
177
+ @include m.bem($root-name, cell) {
178
+ border-bottom: none;
179
+ }
180
+ }
181
+ }
174
182
  }
175
183
 
176
184
  @include m.e(empty) {
@@ -151,9 +151,7 @@ const columnConfig = useColumns({
151
151
 
152
152
  const { leafColumns } = columnConfig
153
153
 
154
- const { handleScroll, leftFixed, rightFixed } = useFixedColumns({
155
- isScrolling: isScrollingRelay
156
- })
154
+ const { handleScroll, leftFixed, rightFixed } = useFixedColumns()
157
155
 
158
156
  const {
159
157
  getColumnSlotsNode,
@@ -1,5 +1,5 @@
1
1
  import { debounce } from '@cat-kit/core'
2
- import { type ShallowRef, type Ref, ref, watch } from 'vue'
2
+ import { type ShallowRef, ref } from 'vue'
3
3
 
4
4
  import type { ScrollPosition } from '../../types'
5
5
 
@@ -9,62 +9,18 @@ interface UseColumnFixedReturned {
9
9
  handleScroll: (e: Required<ScrollPosition>) => void
10
10
  }
11
11
 
12
- interface Options {
13
- /**
14
- * D1:滚动中 (`true`) 暂缓 `leftFixed` / `rightFixed` 的切换,滚动结束后
15
- * 一次性补算。
16
- *
17
- * 背景:固定列的阴影是通过在 cell 上切换 `is-last-fixed` / `is-first-fixed`
18
- * 等 class 实现的,这些 class 会穿透到 `useTable.getCellClass` 的缓存键,
19
- * 任何一次切换都会让全表的单元格类名失效重算。滚动本身并不需要实时更新阴影,
20
- * 因此把切换推迟到 `isScrolling` 归零时做一次即可。
21
- *
22
- * 未传入时退化到旧行为(实时切换)。
23
- */
24
- isScrolling?: Ref<boolean>
25
- }
26
-
27
- /**
28
- * 固定列
29
- * @returns
30
- */
31
- export function useFixedColumns(options: Options = {}): UseColumnFixedReturned {
32
- const { isScrolling } = options
33
-
12
+ export function useFixedColumns(): UseColumnFixedReturned {
34
13
  const leftFixed = ref(false)
35
14
  const rightFixed = ref(false)
36
15
 
37
- let pendingLeft: boolean | null = null
38
- let pendingRight: boolean | null = null
39
-
40
- const applyImmediate = (nextLeft: boolean, nextRight: boolean): void => {
41
- if (nextLeft !== leftFixed.value) leftFixed.value = nextLeft
42
- if (nextRight !== rightFixed.value) rightFixed.value = nextRight
43
- pendingLeft = null
44
- pendingRight = null
45
- }
46
-
47
16
  const handleScroll = debounce((e: Required<ScrollPosition>) => {
48
17
  const nextLeft = e.x > 0
49
18
  // 精度修正:浏览器滚动条最后 1px 的误差
50
19
  const nextRight = !(e.cw + e.x + 1 >= e.sw)
51
20
 
52
- if (isScrolling?.value) {
53
- pendingLeft = nextLeft
54
- pendingRight = nextRight
55
- return
56
- }
57
-
58
- applyImmediate(nextLeft, nextRight)
59
- }, 50)
60
-
61
- if (isScrolling) {
62
- watch(isScrolling, (v) => {
63
- if (v) return
64
- if (pendingLeft === null && pendingRight === null) return
65
- applyImmediate(pendingLeft ?? leftFixed.value, pendingRight ?? rightFixed.value)
66
- })
67
- }
21
+ if (nextLeft !== leftFixed.value) leftFixed.value = nextLeft
22
+ if (nextRight !== rightFixed.value) rightFixed.value = nextRight
23
+ }, 100)
68
24
 
69
25
  return { leftFixed, rightFixed, handleScroll }
70
26
  }
package/src/style.ts CHANGED
@@ -32,6 +32,7 @@ import './components/grid-input/style'
32
32
  import './components/grid/style'
33
33
  import './components/group-input/style'
34
34
  import './components/icon/style'
35
+ import './components/kbd/style'
35
36
  import './components/input/style'
36
37
  import './components/layout/style'
37
38
  import './components/list/style'
@@ -30,17 +30,6 @@ export interface ActionGroupProps {
30
30
  */
31
31
  max?: number
32
32
 
33
- /**
34
- * 紧凑悬浮模式
35
- *
36
- * @description
37
- * - 默认半透明,悬浮在父容器上方时完全显现
38
- * - 提供圆角胶囊容器与磨砂背景,更适合表格行内操作栏
39
- * - "更多"按钮也会切换为图标态以与其他操作按钮保持一致
40
- * @default false
41
- */
42
- hover?: boolean
43
-
44
33
  /**
45
34
  * 子项默认尺寸
46
35
  * @default 'small'
@@ -68,5 +57,11 @@ export interface ActionEmits {
68
57
  /** 操作组件暴露的属性和方法(组件内部使用) */
69
58
  export interface _ActionExposed {}
70
59
 
60
+ export interface _ActionGroupExposed {
61
+ closeTip: () => void
62
+ }
63
+
71
64
  /** 操作组件暴露的属性和方法(组件外部使用, 引用的值会被自动解构) */
72
65
  export type ActionExposed = DeconstructValue<_ActionExposed>
66
+
67
+ export type ActionGroupExposed = DeconstructValue<_ActionGroupExposed>
@@ -1,17 +1,49 @@
1
- import type { DeconstructValue } from '@veltra/utils'
1
+ import type { ComponentSize, DeconstructValue } from '@veltra/utils'
2
+
3
+ import type { VariableItem } from './expression-editor'
4
+
5
+ export interface ConditionField {
6
+ label: string
7
+ value: string
8
+ type: 'string' | 'number' | 'boolean' | 'date' | 'enum'
9
+ enumOptions?: { label: string; value: string }[]
10
+ }
11
+
12
+ export type ConditionValue =
13
+ | { kind: 'constant'; value: string }
14
+ | { kind: 'variable'; name: string }
15
+
16
+ export interface ConditionItem {
17
+ field: string
18
+ operator: string
19
+ value: ConditionValue
20
+ _result?: boolean
21
+ }
22
+
23
+ export interface ConditionGroup {
24
+ logic: 'and' | 'or'
25
+ conditions: ConditionItem[]
26
+ groups: ConditionGroup[]
27
+ _result?: boolean
28
+ }
29
+
30
+ export type ConditionExpression = ConditionGroup
2
31
 
3
- /** 条件编辑器组件属性 */
4
32
  export interface ConditionEditorProps {
5
- modelValue?: string
33
+ modelValue?: ConditionExpression
34
+ fields?: ConditionField[]
35
+ variables?: VariableItem[]
36
+ data?: Record<string, unknown>
37
+ size?: ComponentSize
38
+ disabled?: boolean
39
+ readonly?: boolean
6
40
  }
7
41
 
8
- /** 条件编辑器组件定义的事件 */
9
42
  export interface ConditionEditorEmits {
10
- (e: 'update:modelValue', value: string): void
43
+ (e: 'update:modelValue', value: ConditionExpression): void
44
+ (e: 'evaluate', results: ConditionExpression): void
11
45
  }
12
46
 
13
- /** 条件编辑器组件暴露的属性和方法(组件内部使用) */
14
47
  export interface _ConditionEditorExposed {}
15
48
 
16
- /** 条件编辑器组件暴露的属性和方法(组件外部使用, 引用的值会被自动解构) */
17
49
  export type ConditionEditorExposed = DeconstructValue<_ConditionEditorExposed>
@@ -127,8 +127,6 @@ export interface TableProps {
127
127
  virtualThreshold?: number
128
128
  /** 是否开启展开行, 只在非树形模式下有效 */
129
129
  expandable?: boolean
130
- /** 是否开启虚拟列表 */
131
- virtual?: boolean
132
130
  /** 默认展开全部 */
133
131
  defaultExpandAll?: boolean
134
132
  /** 文本溢出省略 */