@veltra/desktop 1.1.4 → 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.
Files changed (145) 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 +1 -1
  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 +94 -101
  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/style2.css +13 -89
  18. package/dist/components/breadcrumb/breadcrumb.js +1 -1
  19. package/dist/components/button/button.js +1 -1
  20. package/dist/components/card/card.js +1 -1
  21. package/dist/components/cascade/cascade-panel-item.js +4 -4
  22. package/dist/components/cascade/cascade.js +2 -2
  23. package/dist/components/cascade/cascade.vue.d.ts +2 -2
  24. package/dist/components/checkbox/checkbox-button.js +1 -1
  25. package/dist/components/checkbox/checkbox-button.vue.d.ts +1 -1
  26. package/dist/components/checkbox/checkbox.js +1 -1
  27. package/dist/components/checkbox-group/checkbox-group.js +1 -1
  28. package/dist/components/checkbox-group/checkbox-group.vue.d.ts +2 -2
  29. package/dist/components/code-editor/code-editor.js +1 -1
  30. package/dist/components/collapse/collapse.js +1 -1
  31. package/dist/components/condition-editor/components/condition-group.js +152 -0
  32. package/dist/components/condition-editor/components/condition-group.js.map +1 -0
  33. package/dist/components/condition-editor/components/condition-row.js +217 -0
  34. package/dist/components/condition-editor/components/condition-row.js.map +1 -0
  35. package/dist/components/condition-editor/condition-editor.js +134 -5
  36. package/dist/components/condition-editor/condition-editor.js.map +1 -1
  37. package/dist/components/condition-editor/condition-editor.vue.d.ts +10 -2
  38. package/dist/components/condition-editor/core/evaluator.js +75 -0
  39. package/dist/components/condition-editor/core/evaluator.js.map +1 -0
  40. package/dist/components/condition-editor/core/operators.js +123 -0
  41. package/dist/components/condition-editor/core/operators.js.map +1 -0
  42. package/dist/components/condition-editor/style.js +7 -0
  43. package/dist/components/condition-editor/style2.css +186 -0
  44. package/dist/components/context-menu/context-menu.js +1 -1
  45. package/dist/components/date-panel/date-panel.vue.d.ts +1 -1
  46. package/dist/components/date-picker/date-picker.js +2 -2
  47. package/dist/components/date-picker/date-picker.vue.d.ts +1 -1
  48. package/dist/components/date-range-picker/date-range-picker.js +2 -2
  49. package/dist/components/date-range-picker/date-range-picker.vue.d.ts +1 -1
  50. package/dist/components/dialog/dialog.js +7 -7
  51. package/dist/components/dialog/style2.css +8 -0
  52. package/dist/components/dialog/use-maximum.js +1 -1
  53. package/dist/components/drawer/style2.css +8 -0
  54. package/dist/components/dropdown/dropdown.js +1 -1
  55. package/dist/components/expression-editor/components/variable-picker.js +8 -8
  56. package/dist/components/expression-editor/expression-editor.js +1 -1
  57. package/dist/components/file-viewer/file-viewer.js +13 -13
  58. package/dist/components/form-item/form-item.js.map +1 -1
  59. package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js +6 -6
  60. package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js.map +1 -1
  61. package/dist/components/grid-input/grid-input.js +1 -1
  62. package/dist/components/group-input/group-input.js +1 -1
  63. package/dist/components/index.js +154 -154
  64. package/dist/components/input/input.vue_vue_type_script_setup_true_lang.js +1 -1
  65. package/dist/components/layout/layout-resizer.js +1 -1
  66. package/dist/components/layout/layout.js +1 -1
  67. package/dist/components/list/list.js +1 -1
  68. package/dist/components/loading/loading.js +1 -1
  69. package/dist/components/menu/menu-sub-collapsed.js +4 -4
  70. package/dist/components/menu/menu.js +1 -1
  71. package/dist/components/message/message.js +1 -1
  72. package/dist/components/message-confirm/message-confirm.js +1 -1
  73. package/dist/components/multi-select/multi-select.js +15 -15
  74. package/dist/components/multi-select/multi-select.vue.d.ts +3 -3
  75. package/dist/components/multi-tree-select/multi-tree-select.js +8 -8
  76. package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +3 -3
  77. package/dist/components/notification/notification.js +1 -1
  78. package/dist/components/number/number.vue.d.ts +1 -1
  79. package/dist/components/number-input/number-input.js +2 -2
  80. package/dist/components/number-range-input/number-range-input.js +1 -1
  81. package/dist/components/paginator/paginator.js +6 -6
  82. package/dist/components/paginator/style.js +1 -1
  83. package/dist/components/palette/palette.js +1 -1
  84. package/dist/components/password-input/password-input.js +2 -2
  85. package/dist/components/pop-confirm/pop-confirm.js +1 -1
  86. package/dist/components/progress-nodes/progress-nodes.js +1 -1
  87. package/dist/components/radio/radio.js +1 -1
  88. package/dist/components/radio-group/radio-group.js +1 -1
  89. package/dist/components/radio-group/radio-group.vue.d.ts +2 -2
  90. package/dist/components/rich-text-editor/rich-text-editor.js +1 -1
  91. package/dist/components/scroll/scroll-bar.js +1 -1
  92. package/dist/components/scroll/scroll.js +1 -1
  93. package/dist/components/select/select.js +10 -10
  94. package/dist/components/select/select.vue.d.ts +2 -2
  95. package/dist/components/slider/slider.js +1 -1
  96. package/dist/components/steps/steps.js +2 -2
  97. package/dist/components/switch/switch.js +1 -1
  98. package/dist/components/table/style2.css +4 -1
  99. package/dist/components/table/table.js +2 -2
  100. package/dist/components/table/table.js.map +1 -1
  101. package/dist/components/table/use-columns.js +1 -1
  102. package/dist/components/table/use-fixed-columns.js +8 -31
  103. package/dist/components/table/use-fixed-columns.js.map +1 -1
  104. package/dist/components/table-editor/table-editor.js +1 -1
  105. package/dist/components/tabs/tabs-horizontal.js +1 -1
  106. package/dist/components/tabs/tabs-vertical.js +1 -1
  107. package/dist/components/tabs/tabs.js +1 -1
  108. package/dist/components/tag/tag.js +1 -1
  109. package/dist/components/textarea/textarea.js +1 -1
  110. package/dist/components/theme/style.js +1 -1
  111. package/dist/components/theme/theme.js +11 -11
  112. package/dist/components/tip/tip.js +1 -1
  113. package/dist/components/tree/tree-node.js +1 -1
  114. package/dist/components/tree/tree.js +5 -5
  115. package/dist/components/tree-select/tree-select.js +6 -6
  116. package/dist/components/tree-select/tree-select.vue.d.ts +3 -3
  117. package/dist/index.d.ts +5 -5
  118. package/dist/index.js +83 -83
  119. package/dist/style.js +2 -2
  120. package/dist/types/action.d.ts +5 -11
  121. package/dist/types/condition-editor.d.ts +41 -8
  122. package/dist/types/index.d.ts +4 -4
  123. package/package.json +11 -11
  124. package/src/components/action/action-group.vue +68 -82
  125. package/src/components/action/action.vue +9 -1
  126. package/src/components/action/di.ts +2 -1
  127. package/src/components/action/style.scss +22 -27
  128. package/src/components/batch-edit/batch-edit-form.vue +65 -70
  129. package/src/components/batch-edit/batch-edit-list.vue +35 -41
  130. package/src/components/batch-edit/style.scss +19 -118
  131. package/src/components/condition-editor/components/condition-group.vue +131 -0
  132. package/src/components/condition-editor/components/condition-row.vue +208 -0
  133. package/src/components/condition-editor/condition-editor.vue +145 -6
  134. package/src/components/condition-editor/core/evaluator.ts +93 -0
  135. package/src/components/condition-editor/core/operators.ts +57 -0
  136. package/src/components/condition-editor/style.scss +239 -1
  137. package/src/components/condition-editor/style.ts +7 -0
  138. package/src/components/dialog/style.scss +13 -0
  139. package/src/components/drawer/style.scss +13 -0
  140. package/src/components/form-item/form-item.vue +1 -1
  141. package/src/components/table/style.scss +9 -1
  142. package/src/components/table/table.vue +1 -3
  143. package/src/components/table/use-fixed-columns.ts +5 -49
  144. package/src/types/action.ts +6 -11
  145. package/src/types/condition-editor.ts +39 -7
@@ -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
  }
@@ -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>