@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.
Files changed (163) 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 +5 -14
  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/di.js.map +1 -1
  9. package/dist/components/action/style2.css +17 -14
  10. package/dist/components/auto-complete/auto-complete.js +1 -1
  11. package/dist/components/auto-complete/auto-complete.vue.d.ts +2 -2
  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 +5 -5
  24. package/dist/components/checkbox/checkbox-button.js +1 -1
  25. package/dist/components/checkbox/checkbox.js +1 -1
  26. package/dist/components/checkbox-group/checkbox-group.js +1 -1
  27. package/dist/components/code-editor/code-editor.js +1 -1
  28. package/dist/components/collapse/collapse.js +1 -1
  29. package/dist/components/condition-editor/components/condition-group.js +152 -0
  30. package/dist/components/condition-editor/components/condition-group.js.map +1 -0
  31. package/dist/components/condition-editor/components/condition-row.js +217 -0
  32. package/dist/components/condition-editor/components/condition-row.js.map +1 -0
  33. package/dist/components/condition-editor/condition-editor.js +134 -5
  34. package/dist/components/condition-editor/condition-editor.js.map +1 -1
  35. package/dist/components/condition-editor/condition-editor.vue.d.ts +10 -2
  36. package/dist/components/condition-editor/core/evaluator.js +75 -0
  37. package/dist/components/condition-editor/core/evaluator.js.map +1 -0
  38. package/dist/components/condition-editor/core/operators.js +123 -0
  39. package/dist/components/condition-editor/core/operators.js.map +1 -0
  40. package/dist/components/condition-editor/style.js +7 -0
  41. package/dist/components/condition-editor/style2.css +186 -0
  42. package/dist/components/context-menu/context-menu.js +1 -1
  43. package/dist/components/date-picker/date-picker.js +2 -2
  44. package/dist/components/date-picker/date-picker.vue.d.ts +2 -2
  45. package/dist/components/date-range-picker/date-range-picker.js +2 -2
  46. package/dist/components/date-range-picker/date-range-picker.vue.d.ts +2 -2
  47. package/dist/components/dialog/dialog.js +7 -7
  48. package/dist/components/dialog/style2.css +8 -0
  49. package/dist/components/dialog/use-maximum.js +1 -1
  50. package/dist/components/drawer/style2.css +8 -0
  51. package/dist/components/dropdown/dropdown.js +1 -1
  52. package/dist/components/expression-editor/components/variable-picker.js +8 -8
  53. package/dist/components/expression-editor/expression-editor.js +1 -1
  54. package/dist/components/expression-editor/style2.css +1 -0
  55. package/dist/components/file-viewer/file-viewer.js +13 -13
  56. package/dist/components/form-item/form-item.js.map +1 -1
  57. package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js +6 -6
  58. package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js.map +1 -1
  59. package/dist/components/grid-input/grid-input.js +1 -1
  60. package/dist/components/group-input/group-input.js +2 -1
  61. package/dist/components/group-input/group-input.js.map +1 -1
  62. package/dist/components/group-input/style.js +1 -0
  63. package/dist/components/index.js +154 -154
  64. package/dist/components/input/input.vue.d.ts +4 -4
  65. package/dist/components/input/input.vue_vue_type_script_setup_true_lang.js +1 -1
  66. package/dist/components/layout/layout-resizer.js +1 -1
  67. package/dist/components/layout/layout.js +1 -1
  68. package/dist/components/list/list.js +1 -1
  69. package/dist/components/loading/loading.js +1 -1
  70. package/dist/components/menu/menu-sub-collapsed.js +4 -4
  71. package/dist/components/menu/menu.js +1 -1
  72. package/dist/components/message/message.js +1 -1
  73. package/dist/components/message-confirm/message-confirm.js +1 -1
  74. package/dist/components/multi-select/multi-select-option.js +19 -14
  75. package/dist/components/multi-select/multi-select-option.js.map +1 -1
  76. package/dist/components/multi-select/multi-select.js +15 -15
  77. package/dist/components/multi-select/multi-select.vue.d.ts +4 -4
  78. package/dist/components/multi-tree-select/multi-tree-select.js +8 -8
  79. package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +6 -6
  80. package/dist/components/notification/notification.js +1 -1
  81. package/dist/components/notification/notification.vue.d.ts +1 -1
  82. package/dist/components/number/number.vue.d.ts +1 -1
  83. package/dist/components/number-input/number-input.js +2 -2
  84. package/dist/components/number-input/number-input.vue.d.ts +4 -4
  85. package/dist/components/number-range-input/number-range-input.js +1 -1
  86. package/dist/components/number-range-input/number-range-input.vue.d.ts +1 -1
  87. package/dist/components/number-range-input/style2.css +1 -0
  88. package/dist/components/paginator/paginator.js +6 -6
  89. package/dist/components/paginator/style.js +1 -1
  90. package/dist/components/palette/palette.js +1 -1
  91. package/dist/components/password-input/password-input.js +2 -2
  92. package/dist/components/password-input/password-input.vue.d.ts +1 -1
  93. package/dist/components/pop-confirm/pop-confirm.js +1 -1
  94. package/dist/components/pop-confirm/pop-confirm.vue.d.ts +1 -1
  95. package/dist/components/progress-nodes/progress-nodes.js +1 -1
  96. package/dist/components/radio/radio.js +1 -1
  97. package/dist/components/radio-group/radio-group.js +1 -1
  98. package/dist/components/rich-text-editor/rich-text-editor.js +1 -1
  99. package/dist/components/rich-text-editor/rich-text-editor.vue.d.ts +1 -1
  100. package/dist/components/scroll/scroll-bar.js +1 -1
  101. package/dist/components/scroll/scroll.js +1 -1
  102. package/dist/components/select/select.js +10 -10
  103. package/dist/components/select/select.vue.d.ts +2 -2
  104. package/dist/components/slider/slider.js +1 -1
  105. package/dist/components/steps/steps.js +2 -2
  106. package/dist/components/switch/switch.js +1 -1
  107. package/dist/components/table/style2.css +4 -1
  108. package/dist/components/table/table.js +2 -2
  109. package/dist/components/table/table.js.map +1 -1
  110. package/dist/components/table/use-columns.js +1 -1
  111. package/dist/components/table/use-fixed-columns.js +8 -31
  112. package/dist/components/table/use-fixed-columns.js.map +1 -1
  113. package/dist/components/table-editor/table-editor.js +1 -1
  114. package/dist/components/tabs/tabs-horizontal.js +1 -1
  115. package/dist/components/tabs/tabs-horizontal.vue.d.ts +4 -4
  116. package/dist/components/tabs/tabs-vertical.js +1 -1
  117. package/dist/components/tabs/tabs-vertical.vue.d.ts +3 -3
  118. package/dist/components/tabs/tabs.js +1 -1
  119. package/dist/components/tabs/tabs.vue.d.ts +4 -4
  120. package/dist/components/tag/tag.js +1 -1
  121. package/dist/components/textarea/textarea.js +1 -1
  122. package/dist/components/textarea/textarea.vue.d.ts +4 -4
  123. package/dist/components/theme/style.js +1 -1
  124. package/dist/components/theme/theme.js +11 -11
  125. package/dist/components/tip/tip.js +1 -1
  126. package/dist/components/tree/tree-node.js +1 -1
  127. package/dist/components/tree/tree.js +5 -5
  128. package/dist/components/tree-select/tree-select.js +6 -6
  129. package/dist/components/tree-select/tree-select.vue.d.ts +5 -5
  130. package/dist/index.d.ts +5 -5
  131. package/dist/index.js +83 -83
  132. package/dist/style.js +2 -2
  133. package/dist/types/action.d.ts +5 -11
  134. package/dist/types/condition-editor.d.ts +41 -8
  135. package/dist/types/index.d.ts +4 -4
  136. package/package.json +11 -11
  137. package/src/components/action/action-group.vue +68 -82
  138. package/src/components/action/action.vue +9 -1
  139. package/src/components/action/di.ts +2 -1
  140. package/src/components/action/style.scss +22 -27
  141. package/src/components/batch-edit/batch-edit-form.vue +65 -70
  142. package/src/components/batch-edit/batch-edit-list.vue +35 -41
  143. package/src/components/batch-edit/style.scss +19 -118
  144. package/src/components/condition-editor/components/condition-group.vue +131 -0
  145. package/src/components/condition-editor/components/condition-row.vue +208 -0
  146. package/src/components/condition-editor/condition-editor.vue +145 -6
  147. package/src/components/condition-editor/core/evaluator.ts +93 -0
  148. package/src/components/condition-editor/core/operators.ts +57 -0
  149. package/src/components/condition-editor/style.scss +239 -1
  150. package/src/components/condition-editor/style.ts +7 -0
  151. package/src/components/dialog/style.scss +13 -0
  152. package/src/components/drawer/style.scss +13 -0
  153. package/src/components/expression-editor/style.scss +1 -0
  154. package/src/components/form-item/form-item.vue +1 -1
  155. package/src/components/group-input/group-input.vue +8 -1
  156. package/src/components/group-input/style.ts +1 -0
  157. package/src/components/multi-select/multi-select-option.vue +19 -13
  158. package/src/components/number-range-input/style.scss +1 -0
  159. package/src/components/table/style.scss +9 -1
  160. package/src/components/table/table.vue +1 -3
  161. package/src/components/table/use-fixed-columns.ts +5 -49
  162. package/src/types/action.ts +6 -11
  163. package/src/types/condition-editor.ts +39 -7
@@ -1,5 +1,5 @@
1
- import _sfc_main$1 from "../scroll/scroll.js";
2
- import _sfc_main$2 from "../icon/icon.js";
1
+ import _sfc_main$1 from "../icon/icon.js";
2
+ import _sfc_main$2 from "../scroll/scroll.js";
3
3
  import form_default from "../form/form.js";
4
4
  import _sfc_main$3 from "../button/button.js";
5
5
  import { BatchEditDIKey } from "./di.js";
@@ -34,7 +34,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
34
34
  if (state.type === "create") return {
35
35
  icon: Plus,
36
36
  title: "新增",
37
- chip: insertIndexes.value.length ? `插入到第 ${insertIndexes.value[insertIndexes.value.length - 1] + 1} 位` : void 0,
38
37
  tone: "create"
39
38
  };
40
39
  return {
@@ -49,111 +48,105 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
49
48
  return `${state.type}-${state.row?.uid ?? "create"}-${state.parentRow?.uid ?? "root"}`;
50
49
  });
51
50
  return (_ctx, _cache) => {
52
- return openBlock(), createBlock(Transition, {
53
- name: "batch-edit-panel",
54
- appear: ""
55
- }, {
56
- default: withCtx(() => [unref(state).visible && !!unref(props).model ? (openBlock(), createElementBlock("aside", {
57
- key: 0,
58
- class: normalizeClass(unref(cls).e("form"))
59
- }, [
60
- createElementVNode("header", { class: normalizeClass(unref(cls).e("form-header")) }, [
61
- createElementVNode("span", { class: normalizeClass([unref(cls).e("form-icon"), unref(bem).is(headerInfo.value.tone)]) }, [createVNode(unref(_sfc_main$2), null, {
62
- default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(headerInfo.value.icon)))]),
63
- _: 1
64
- })], 2),
65
- createElementVNode("div", { class: normalizeClass(unref(cls).e("form-title")) }, [createElementVNode("h3", { class: normalizeClass(unref(cls).e("form-title-text")) }, toDisplayString(headerInfo.value.title), 3), headerInfo.value.chip ? (openBlock(), createElementBlock("span", {
66
- key: 0,
67
- class: normalizeClass(unref(cls).e("form-chip"))
68
- }, toDisplayString(headerInfo.value.chip), 3)) : createCommentVNode("v-if", true)], 2),
69
- createVNode(unref(_sfc_main$3), {
70
- class: normalizeClass(unref(cls).e("form-close")),
71
- icon: unref(Close),
72
- text: "",
73
- circle: "",
74
- size: "small",
75
- title: "关闭",
76
- onClick: unref(handleClose)
77
- }, null, 8, [
78
- "class",
79
- "icon",
80
- "onClick"
81
- ])
82
- ], 2),
83
- createVNode(Transition, {
51
+ return unref(state).visible && !!unref(props).model ? (openBlock(), createElementBlock("aside", {
52
+ key: 0,
53
+ class: normalizeClass(unref(cls).e("form"))
54
+ }, [
55
+ createElementVNode("header", { class: normalizeClass(unref(cls).e("form-header")) }, [
56
+ createElementVNode("span", { class: normalizeClass([unref(cls).e("form-icon"), unref(bem).is(headerInfo.value.tone)]) }, [createVNode(unref(_sfc_main$1), null, {
57
+ default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(headerInfo.value.icon)))]),
58
+ _: 1
59
+ })], 2),
60
+ createElementVNode("div", { class: normalizeClass(unref(cls).e("form-title")) }, [createElementVNode("h3", { class: normalizeClass(unref(cls).e("form-title-text")) }, toDisplayString(headerInfo.value.title), 3), headerInfo.value.chip ? (openBlock(), createElementBlock("span", {
61
+ key: 0,
62
+ class: normalizeClass(unref(cls).e("form-chip"))
63
+ }, toDisplayString(headerInfo.value.chip), 3)) : createCommentVNode("v-if", true)], 2),
64
+ createVNode(unref(_sfc_main$3), {
65
+ class: normalizeClass(unref(cls).e("form-close")),
66
+ icon: unref(Close),
67
+ text: "",
68
+ circle: "",
69
+ size: "small",
70
+ title: "关闭",
71
+ onClick: unref(handleClose)
72
+ }, null, 8, [
73
+ "class",
74
+ "icon",
75
+ "onClick"
76
+ ])
77
+ ], 2),
78
+ (openBlock(), createBlock(unref(_sfc_main$2), {
79
+ always: "",
80
+ class: normalizeClass(unref(cls).e("form-body")),
81
+ key: bodyKey.value
82
+ }, {
83
+ default: withCtx(() => [createVNode(Transition, {
84
84
  name: "fade",
85
85
  appear: "",
86
86
  mode: "out-in"
87
87
  }, {
88
- default: withCtx(() => [(openBlock(), createBlock(unref(_sfc_main$1), {
89
- always: "",
90
- class: normalizeClass(unref(cls).e("form-body")),
91
- key: bodyKey.value
88
+ default: withCtx(() => [createVNode(unref(form_default), {
89
+ model: unref(props).model,
90
+ readonly: unref(props).readonly,
91
+ onKeyup: withKeys(unref(handleSave), ["enter"]),
92
+ "label-width": unref(props).labelWidth
92
93
  }, {
93
- default: withCtx(() => [createVNode(unref(form_default), {
94
- model: unref(props).model,
95
- readonly: unref(props).readonly,
96
- onKeyup: withKeys(unref(handleSave), ["enter"]),
97
- "label-width": unref(props).labelWidth
98
- }, {
99
- default: withCtx(({ data, model }) => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
100
- data,
101
- model,
102
- row: unref(state).row,
103
- depth: unref(state).depth,
104
- indexes: unref(insertIndexes),
105
- index: unref(state).row?.index
106
- })))]),
107
- _: 3
108
- }, 8, [
109
- "model",
110
- "readonly",
111
- "onKeyup",
112
- "label-width"
113
- ])]),
94
+ default: withCtx(({ data, model }) => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
95
+ data,
96
+ model,
97
+ row: unref(state).row,
98
+ depth: unref(state).depth,
99
+ indexes: unref(insertIndexes),
100
+ index: unref(state).row?.index
101
+ })))]),
114
102
  _: 3
115
- }, 8, ["class"]))]),
103
+ }, 8, [
104
+ "model",
105
+ "readonly",
106
+ "onKeyup",
107
+ "label-width"
108
+ ])]),
116
109
  _: 3
117
- }),
118
- createElementVNode("footer", { class: normalizeClass(unref(cls).e("form-footer")) }, [!unref(props).readonly && unref(state).dataUpdated ? (openBlock(), createElementBlock("span", {
119
- key: 0,
120
- class: normalizeClass(unref(cls).e("form-hint"))
121
- }, " 有未保存改动 ", 2)) : !unref(props).readonly ? (openBlock(), createElementBlock("span", {
122
- key: 1,
123
- class: normalizeClass(unref(cls).e("form-hint"))
124
- }, [..._cache[0] || (_cache[0] = [
125
- createElementVNode("kbd", null, "Enter", -1),
126
- createTextVNode(" 保存 · ", -1),
127
- createElementVNode("kbd", null, "Esc", -1),
128
- createTextVNode(" 关闭 ", -1)
129
- ])], 2)) : (openBlock(), createElementBlock("span", {
130
- key: 2,
131
- class: normalizeClass(unref(cls).e("form-hint"))
132
- }, "只读模式", 2)), createElementVNode("div", { class: normalizeClass(unref(cls).e("form-actions")) }, [createVNode(unref(_sfc_main$3), {
133
- text: "",
134
- loading: unref(state).loading,
135
- onClick: unref(handleClose)
136
- }, {
137
- default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode(" 取消 ", -1)])]),
138
- _: 1
139
- }, 8, ["loading", "onClick"]), !unref(props).readonly && (creatable.value || updatable.value) ? (openBlock(), createBlock(unref(_sfc_main$3), {
140
- key: 0,
141
- type: unref(state).type === "create" ? "success" : "primary",
142
- loading: unref(state).loading,
143
- disabled: !unref(state).dataUpdated,
144
- onClick: unref(handleSave)
145
- }, {
146
- default: withCtx(() => [createTextVNode(toDisplayString(unref(state).type === "create" ? "保存新增" : "保存修改"), 1)]),
147
- _: 1
148
- }, 8, [
149
- "type",
150
- "loading",
151
- "disabled",
152
- "onClick"
153
- ])) : createCommentVNode("v-if", true)], 2)], 2)
154
- ], 2)) : createCommentVNode("v-if", true)]),
155
- _: 3
156
- });
110
+ })]),
111
+ _: 3
112
+ }, 8, ["class"])),
113
+ createElementVNode("footer", { class: normalizeClass(unref(cls).e("form-footer")) }, [!unref(props).readonly && unref(state).dataUpdated ? (openBlock(), createElementBlock("span", {
114
+ key: 0,
115
+ class: normalizeClass(unref(cls).e("form-hint"))
116
+ }, " 有未保存改动 ", 2)) : !unref(props).readonly ? (openBlock(), createElementBlock("span", {
117
+ key: 1,
118
+ class: normalizeClass(unref(cls).e("form-hint"))
119
+ }, [..._cache[0] || (_cache[0] = [
120
+ createElementVNode("kbd", null, "Enter", -1),
121
+ createTextVNode(" 保存 · ", -1),
122
+ createElementVNode("kbd", null, "Esc", -1),
123
+ createTextVNode(" 关闭 ", -1)
124
+ ])], 2)) : (openBlock(), createElementBlock("span", {
125
+ key: 2,
126
+ class: normalizeClass(unref(cls).e("form-hint"))
127
+ }, "只读模式", 2)), createElementVNode("div", { class: normalizeClass(unref(cls).e("form-actions")) }, [createVNode(unref(_sfc_main$3), {
128
+ text: "",
129
+ loading: unref(state).loading,
130
+ onClick: unref(handleClose)
131
+ }, {
132
+ default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode(" 取消 ", -1)])]),
133
+ _: 1
134
+ }, 8, ["loading", "onClick"]), !unref(props).readonly && (creatable.value || updatable.value) ? (openBlock(), createBlock(unref(_sfc_main$3), {
135
+ key: 0,
136
+ type: unref(state).type === "create" ? "success" : "primary",
137
+ loading: unref(state).loading,
138
+ disabled: !unref(state).dataUpdated,
139
+ onClick: unref(handleSave)
140
+ }, {
141
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode(" 保存 ", -1)])]),
142
+ _: 1
143
+ }, 8, [
144
+ "type",
145
+ "loading",
146
+ "disabled",
147
+ "onClick"
148
+ ])) : createCommentVNode("v-if", true)], 2)], 2)
149
+ ], 2)) : createCommentVNode("v-if", true);
157
150
  };
158
151
  }
159
152
  });
@@ -1 +1 @@
1
- {"version":3,"file":"batch-edit-form.js","names":[],"sources":["../../../src/components/batch-edit/batch-edit-form.vue"],"sourcesContent":["<template>\n <transition name=\"batch-edit-panel\" appear>\n <aside :class=\"cls.e('form')\" v-if=\"state.visible && !!props.model\">\n <header :class=\"cls.e('form-header')\">\n <span :class=\"[cls.e('form-icon'), bem.is(headerInfo.tone)]\">\n <u-icon>\n <component :is=\"headerInfo.icon\" />\n </u-icon>\n </span>\n <div :class=\"cls.e('form-title')\">\n <h3 :class=\"cls.e('form-title-text')\">{{ headerInfo.title }}</h3>\n <span v-if=\"headerInfo.chip\" :class=\"cls.e('form-chip')\">\n {{ headerInfo.chip }}\n </span>\n </div>\n <u-button\n :class=\"cls.e('form-close')\"\n :icon=\"Close\"\n text\n circle\n size=\"small\"\n title=\"关闭\"\n @click=\"handleClose\"\n />\n </header>\n\n <transition name=\"fade\" appear mode=\"out-in\">\n <u-scroll always :class=\"cls.e('form-body')\" :key=\"bodyKey\">\n <u-form\n :model=\"props.model\"\n :readonly=\"props.readonly\"\n @keyup.enter=\"handleSave\"\n :label-width=\"props.labelWidth\"\n >\n <template #default=\"{ data, model }\">\n <slot\n v-bind=\"{\n data,\n model,\n row: state.row,\n depth: state.depth,\n indexes: insertIndexes,\n index: state.row?.index\n }\"\n />\n </template>\n </u-form>\n </u-scroll>\n </transition>\n\n <footer :class=\"cls.e('form-footer')\">\n <span :class=\"cls.e('form-hint')\" v-if=\"!props.readonly && state.dataUpdated\">\n 有未保存改动\n </span>\n <span :class=\"cls.e('form-hint')\" v-else-if=\"!props.readonly\">\n <kbd>Enter</kbd> 保存 · <kbd>Esc</kbd> 关闭\n </span>\n <span :class=\"cls.e('form-hint')\" v-else>只读模式</span>\n\n <div :class=\"cls.e('form-actions')\">\n <u-button text :loading=\"state.loading\" @click=\"handleClose\"> 取消 </u-button>\n <u-button\n v-if=\"!props.readonly && (creatable || updatable)\"\n :type=\"state.type === 'create' ? 'success' : 'primary'\"\n :loading=\"state.loading\"\n :disabled=\"!state.dataUpdated\"\n @click=\"handleSave\"\n >\n {{ state.type === 'create' ? '保存新增' : '保存修改' }}\n </u-button>\n </div>\n </footer>\n </aside>\n </transition>\n</template>\n\n<script lang=\"ts\" setup>\nimport { AddChild, Close, EditPen, Plus, View } from '@veltra/icons/normal'\nimport { bem } from '@veltra/utils'\nimport { computed, inject, type Component } from 'vue'\n\nimport { UButton } from '../button'\nimport { UForm } from '../form'\nimport { UIcon } from '../icon'\nimport { UScroll } from '../scroll'\nimport { BatchEditDIKey } from './di'\n\ndefineOptions({ name: 'BatchEditForm' })\n\nconst {\n cls,\n props,\n state,\n insertIndexes,\n handleSave,\n handleClose,\n staticFeatures,\n dynamicFeatures\n} = inject(BatchEditDIKey)!\n\nconst creatable = computed(() => {\n return (\n state.type === 'create' &&\n (staticFeatures.value.has('create') || dynamicFeatures.value.create?.(state.row))\n )\n})\n\nconst updatable = computed(() => {\n return (\n state.type === 'update' &&\n (staticFeatures.value.has('update') || dynamicFeatures.value.update?.(state.row))\n )\n})\n\ninterface HeaderInfo {\n icon: Component\n title: string\n chip?: string\n tone: 'create' | 'update' | 'view' | 'child'\n}\n\nconst headerInfo = computed<HeaderInfo>(() => {\n if (props.readonly) {\n return {\n icon: View,\n title: '查看详情',\n chip: state.row ? `第 ${state.row.index + 1} 行` : undefined,\n tone: 'view'\n }\n }\n if (state.parentRow) {\n return {\n icon: AddChild,\n title: '新增子级',\n chip: `归属于第 ${state.parentRow.index + 1} 行`,\n tone: 'child'\n }\n }\n if (state.type === 'create') {\n return {\n icon: Plus,\n title: '新增',\n chip: insertIndexes.value.length\n ? `插入到第 ${insertIndexes.value[insertIndexes.value.length - 1]! + 1} 位`\n : undefined,\n tone: 'create'\n }\n }\n return {\n icon: EditPen,\n title: '编辑',\n chip: state.row ? `第 ${state.row.index + 1} 行` : undefined,\n tone: 'update'\n }\n})\n\n/** 通过 row 切换 / 类型切换驱动表单内容淡出淡入 */\nconst bodyKey = computed(() => {\n return `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A,MAAK,CAAC,aAAa,UAAA,SAAa,UAAA,UAAA,WAAA,EADzC,YAQW,MAAA,YAAA,EAAA;;MANR,MAAM,MAAA,MAAK,CAAC,SAAI,WAAA,YAAA;MAChB,SAAS,MAAA,MAAK,CAAC;MACf,UAAQ,CAAG,MAAA,MAAK,CAAC;MACjB,SAAO,MAAA,WAAU;;6BAE6B,CAAA,gBAAA,gBAA5C,MAAA,MAAK,CAAC,SAAI,WAAA,SAAA,OAAA,EAAA,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"batch-edit-form.js","names":[],"sources":["../../../src/components/batch-edit/batch-edit-form.vue"],"sourcesContent":["<template>\n <aside :class=\"cls.e('form')\" v-if=\"state.visible && !!props.model\">\n <header :class=\"cls.e('form-header')\">\n <span :class=\"[cls.e('form-icon'), bem.is(headerInfo.tone)]\">\n <u-icon>\n <component :is=\"headerInfo.icon\" />\n </u-icon>\n </span>\n <div :class=\"cls.e('form-title')\">\n <h3 :class=\"cls.e('form-title-text')\">{{ headerInfo.title }}</h3>\n <span v-if=\"headerInfo.chip\" :class=\"cls.e('form-chip')\">\n {{ headerInfo.chip }}\n </span>\n </div>\n <u-button\n :class=\"cls.e('form-close')\"\n :icon=\"Close\"\n text\n circle\n size=\"small\"\n title=\"关闭\"\n @click=\"handleClose\"\n />\n </header>\n\n <u-scroll always :class=\"cls.e('form-body')\" :key=\"bodyKey\">\n <transition name=\"fade\" appear mode=\"out-in\">\n <u-form\n :model=\"props.model\"\n :readonly=\"props.readonly\"\n @keyup.enter=\"handleSave\"\n :label-width=\"props.labelWidth\"\n >\n <template #default=\"{ data, model }\">\n <slot\n v-bind=\"{\n data,\n model,\n row: state.row,\n depth: state.depth,\n indexes: insertIndexes,\n index: state.row?.index\n }\"\n />\n </template>\n </u-form>\n </transition>\n </u-scroll>\n\n <footer :class=\"cls.e('form-footer')\">\n <span :class=\"cls.e('form-hint')\" v-if=\"!props.readonly && state.dataUpdated\">\n 有未保存改动\n </span>\n <span :class=\"cls.e('form-hint')\" v-else-if=\"!props.readonly\">\n <kbd>Enter</kbd> 保存 · <kbd>Esc</kbd> 关闭\n </span>\n <span :class=\"cls.e('form-hint')\" v-else>只读模式</span>\n\n <div :class=\"cls.e('form-actions')\">\n <u-button text :loading=\"state.loading\" @click=\"handleClose\"> 取消 </u-button>\n <u-button\n v-if=\"!props.readonly && (creatable || updatable)\"\n :type=\"state.type === 'create' ? 'success' : 'primary'\"\n :loading=\"state.loading\"\n :disabled=\"!state.dataUpdated\"\n @click=\"handleSave\"\n >\n 保存\n </u-button>\n </div>\n </footer>\n </aside>\n</template>\n\n<script lang=\"ts\" setup>\nimport { AddChild, Close, EditPen, Plus, View } from '@veltra/icons/normal'\nimport { bem } from '@veltra/utils'\nimport { computed, inject, type Component } from 'vue'\n\nimport { UButton } from '../button'\nimport { UForm } from '../form'\nimport { UIcon } from '../icon'\nimport { UScroll } from '../scroll'\nimport { BatchEditDIKey } from './di'\n\ndefineOptions({ name: 'BatchEditForm' })\n\nconst {\n cls,\n props,\n state,\n insertIndexes,\n handleSave,\n handleClose,\n staticFeatures,\n dynamicFeatures\n} = inject(BatchEditDIKey)!\n\nconst creatable = computed(() => {\n return (\n state.type === 'create' &&\n (staticFeatures.value.has('create') || dynamicFeatures.value.create?.(state.row))\n )\n})\n\nconst updatable = computed(() => {\n return (\n state.type === 'update' &&\n (staticFeatures.value.has('update') || dynamicFeatures.value.update?.(state.row))\n )\n})\n\ninterface HeaderInfo {\n icon: Component\n title: string\n chip?: string\n tone: 'create' | 'update' | 'view' | 'child'\n}\n\nconst headerInfo = computed<HeaderInfo>(() => {\n if (props.readonly) {\n return {\n icon: View,\n title: '查看详情',\n chip: state.row ? `第 ${state.row.index + 1} 行` : undefined,\n tone: 'view'\n }\n }\n if (state.parentRow) {\n return {\n icon: AddChild,\n title: '新增子级',\n chip: `归属于第 ${state.parentRow.index + 1} 行`,\n tone: 'child'\n }\n }\n if (state.type === 'create') {\n return {\n icon: Plus,\n title: '新增',\n tone: 'create'\n }\n }\n return {\n icon: EditPen,\n title: '编辑',\n chip: state.row ? `第 ${state.row.index + 1} 行` : undefined,\n tone: 'update'\n }\n})\n\n/** 通过 row 切换 / 类型切换驱动表单内容淡出淡入 */\nconst bodyKey = computed(() => {\n return `${state.type}-${state.row?.uid ?? 'create'}-${state.parentRow?.uid ?? 'root'}`\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;EAuFA,MAAM,EACJ,KACA,OACA,OACA,eACA,YACA,aACA,gBACA,oBACE,OAAO,eAAe;EAE1B,MAAM,YAAY,eAAe;AAC/B,UACE,MAAM,SAAS,aACd,eAAe,MAAM,IAAI,SAAS,IAAI,gBAAgB,MAAM,SAAS,MAAM,IAAI;IAEnF;EAED,MAAM,YAAY,eAAe;AAC/B,UACE,MAAM,SAAS,aACd,eAAe,MAAM,IAAI,SAAS,IAAI,gBAAgB,MAAM,SAAS,MAAM,IAAI;IAEnF;EASD,MAAM,aAAa,eAA2B;AAC5C,OAAI,MAAM,SACR,QAAO;IACL,MAAM;IACN,OAAO;IACP,MAAM,MAAM,MAAM,KAAK,MAAM,IAAI,QAAQ,EAAE,MAAM,KAAA;IACjD,MAAM;IACR;AAEF,OAAI,MAAM,UACR,QAAO;IACL,MAAM;IACN,OAAO;IACP,MAAM,QAAQ,MAAM,UAAU,QAAQ,EAAE;IACxC,MAAM;IACR;AAEF,OAAI,MAAM,SAAS,SACjB,QAAO;IACL,MAAM;IACN,OAAO;IACP,MAAM;IACR;AAEF,UAAO;IACL,MAAM;IACN,OAAO;IACP,MAAM,MAAM,MAAM,KAAK,MAAM,IAAI,QAAQ,EAAE,MAAM,KAAA;IACjD,MAAM;IACR;IACD;;EAGD,MAAM,UAAU,eAAe;AAC7B,UAAO,GAAG,MAAM,KAAK,GAAG,MAAM,KAAK,OAAO,SAAS,GAAG,MAAM,WAAW,OAAO;IAC/E;;UAzJqC,MAAA,MAAK,CAAC,WAAO,CAAA,CAAM,MAAA,MAAK,CAAC,SAAA,WAAA,EAA7D,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,MAAK,CAAC,aAAa,UAAA,SAAa,UAAA,UAAA,WAAA,EADzC,YAQW,MAAA,YAAA,EAAA;;KANR,MAAM,MAAA,MAAK,CAAC,SAAI,WAAA,YAAA;KAChB,SAAS,MAAA,MAAK,CAAC;KACf,UAAQ,CAAG,MAAA,MAAK,CAAC;KACjB,SAAO,MAAA,WAAU;;4BAGpB,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAFC,QAED,GAAA,CAAA,EAAA,CAAA"}
@@ -1,20 +1,19 @@
1
- import _sfc_main$1 from "../icon/icon.js";
1
+ import _sfc_main$1 from "../button/button.js";
2
2
  import _sfc_main$2 from "../table/table.js";
3
3
  import { BatchEditDIKey } from "./di.js";
4
4
  import _sfc_main$3 from "../action/action.js";
5
- import _sfc_main$4 from "../action/action-group.js";
5
+ import action_group_default from "../action/action-group.js";
6
6
  import { computed, createBlock, createCommentVNode, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, inject, mergeProps, normalizeClass, openBlock, toDisplayString, unref, withCtx, withModifiers } from "vue";
7
7
  import { bem } from "@veltra/utils";
8
+ import { AddChild, Copy, Delete, InsertToNext, InsertToPrev, Plus } from "@veltra/icons/normal";
8
9
  import { o } from "@cat-kit/core";
9
- import { Delete, EditPen, Plus, View } from "@veltra/icons/normal";
10
10
  //#region src/components/batch-edit/batch-edit-list.vue
11
- const _hoisted_1 = ["disabled"];
12
11
  const _sfc_main = /* @__PURE__ */ defineComponent({
13
12
  name: "BatchEditList",
14
13
  __name: "batch-edit-list",
15
14
  props: { slots: {} },
16
15
  setup(__props) {
17
- const { cls, state, tableRef, props, emit, staticFeatures, dynamicFeatures, handleCreate, handleEdit, handleCopy, handleDelete, handleInsertToNext, handleInsertToPrev, handleInsertChild } = inject(BatchEditDIKey);
16
+ const { cls, state, tableRef, props, emit, staticFeatures, dynamicFeatures, handleCreate, handleCopy, handleDelete, handleInsertToNext, handleInsertToPrev, handleInsertChild } = inject(BatchEditDIKey);
18
17
  const tableProps = computed(() => {
19
18
  return o(props).omit([
20
19
  "model",
@@ -42,7 +41,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
42
41
  name: "操作",
43
42
  key: "__action__",
44
43
  align: "center",
45
- width: 132,
44
+ width: 180,
46
45
  fixed: "right",
47
46
  resizable: false
48
47
  });
@@ -53,9 +52,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
53
52
  state.depth = row?.depth;
54
53
  }
55
54
  }
56
- function canEdit(row) {
57
- return !props.readonly ? allowed("update", row) : true;
58
- }
59
55
  function canDelete(row) {
60
56
  return !props.readonly && allowed("delete", row);
61
57
  }
@@ -65,95 +61,83 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
65
61
  class: [unref(cls).e("table"), unref(bem).is("editing", unref(state).visible)],
66
62
  columns: columns.value,
67
63
  "highlight-current": "",
68
- "current-row": unref(state).row,
64
+ current: unref(state).row,
69
65
  "onUpdate:current": handleUpdateCurrentRow,
70
- "onUpdate:checked": _cache[2] || (_cache[2] = ($event) => unref(emit)("update:checked", $event)),
71
- "onUpdate:selected": _cache[3] || (_cache[3] = ($event) => unref(emit)("update:selected", $event)),
66
+ "onUpdate:checked": _cache[1] || (_cache[1] = ($event) => unref(emit)("update:checked", $event)),
67
+ "onUpdate:selected": _cache[2] || (_cache[2] = ($event) => unref(emit)("update:selected", $event)),
72
68
  ref_key: "tableRef",
73
69
  ref: tableRef
74
70
  }), createSlots({
75
- "column:__action__": withCtx(({ row }) => [createVNode(unref(_sfc_main$4), {
71
+ "column:__action__": withCtx(({ row }) => [createVNode(unref(action_group_default), {
76
72
  class: normalizeClass(unref(cls).e("row-actions")),
77
- hover: "",
78
- circle: "",
79
- max: 3,
80
- onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"]))
73
+ max: 5,
74
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"])),
75
+ circle: ""
81
76
  }, {
82
77
  default: withCtx(() => [
83
- canEdit(row) ? (openBlock(), createBlock(unref(_sfc_main$3), mergeProps({
84
- key: 0,
85
- icon: unref(props).readonly ? unref(View) : unref(EditPen),
86
- title: unref(props).readonly ? "查看" : "编辑",
87
- onRun: ($event) => unref(handleEdit)(row)
88
- }, unref(props).actionsProps?.update), null, 16, [
89
- "icon",
90
- "title",
91
- "onRun"
92
- ])) : createCommentVNode("v-if", true),
93
- canDelete(row) ? (openBlock(), createBlock(unref(_sfc_main$3), mergeProps({
94
- key: 1,
95
- icon: unref(Delete),
96
- type: "danger",
97
- title: "删除",
98
- onRun: ($event) => unref(handleDelete)(row)
99
- }, unref(props).actionsProps?.delete), null, 16, ["icon", "onRun"])) : createCommentVNode("v-if", true),
100
78
  allowed("create", row) ? (openBlock(), createBlock(unref(_sfc_main$3), {
101
- key: 2,
102
- "in-dropdown": "",
79
+ key: 0,
80
+ icon: unref(InsertToPrev),
81
+ title: "在上方插入",
103
82
  onRun: ($event) => unref(handleInsertToPrev)(row)
104
- }, {
105
- default: withCtx(() => [..._cache[4] || (_cache[4] = [createTextVNode(" 在上方插入 ", -1)])]),
106
- _: 1
107
- }, 8, ["onRun"])) : createCommentVNode("v-if", true),
83
+ }, null, 8, ["icon", "onRun"])) : createCommentVNode("v-if", true),
108
84
  allowed("create", row) ? (openBlock(), createBlock(unref(_sfc_main$3), {
109
- key: 3,
110
- "in-dropdown": "",
85
+ key: 1,
86
+ icon: unref(InsertToNext),
87
+ title: "在下方插入",
111
88
  onRun: ($event) => unref(handleInsertToNext)(row)
112
- }, {
113
- default: withCtx(() => [..._cache[5] || (_cache[5] = [createTextVNode(" 在下方插入 ", -1)])]),
114
- _: 1
115
- }, 8, ["onRun"])) : createCommentVNode("v-if", true),
89
+ }, null, 8, ["icon", "onRun"])) : createCommentVNode("v-if", true),
116
90
  !!unref(props).tree && allowed("createChild", row) ? (openBlock(), createBlock(unref(_sfc_main$3), {
117
- key: 4,
118
- "in-dropdown": "",
91
+ key: 2,
92
+ icon: unref(AddChild),
93
+ title: "添加子级",
119
94
  onRun: ($event) => unref(handleInsertChild)(row)
120
- }, {
121
- default: withCtx(() => [..._cache[6] || (_cache[6] = [createTextVNode(" 添加子级 ", -1)])]),
122
- _: 1
123
- }, 8, ["onRun"])) : createCommentVNode("v-if", true),
95
+ }, null, 8, ["icon", "onRun"])) : createCommentVNode("v-if", true),
124
96
  allowed("copy", row) ? (openBlock(), createBlock(unref(_sfc_main$3), {
125
- key: 5,
126
- "in-dropdown": "",
97
+ key: 3,
98
+ icon: unref(Copy),
99
+ title: "复制此行",
127
100
  onRun: ($event) => unref(handleCopy)(row)
128
- }, {
129
- default: withCtx(() => [..._cache[7] || (_cache[7] = [createTextVNode(" 复制此行 ", -1)])]),
130
- _: 1
131
- }, 8, ["onRun"])) : createCommentVNode("v-if", true)
101
+ }, null, 8, ["icon", "onRun"])) : createCommentVNode("v-if", true),
102
+ canDelete(row) ? (openBlock(), createBlock(unref(_sfc_main$3), mergeProps({
103
+ key: 4,
104
+ icon: unref(Delete),
105
+ type: "danger",
106
+ title: "删除",
107
+ onRun: ($event) => unref(handleDelete)(row)
108
+ }, unref(props).actionsProps?.delete), null, 16, ["icon", "onRun"])) : createCommentVNode("v-if", true)
132
109
  ]),
133
110
  _: 2
134
111
  }, 1032, ["class"])]),
135
112
  _: 2
136
113
  }, [!unref(props).readonly ? {
137
114
  name: "empty",
138
- fn: withCtx(() => [_cache[8] || (_cache[8] = createTextVNode(toDisplayString(null), -1))]),
115
+ fn: withCtx(() => [_cache[3] || (_cache[3] = createTextVNode(toDisplayString(null), -1))]),
139
116
  key: "0"
140
117
  } : void 0, !unref(props).readonly && (unref(staticFeatures).has("create") || unref(dynamicFeatures).create?.()) && (unref(state).type === "create" && !unref(state).visible || unref(state).type === "update") ? {
141
118
  name: "append",
142
- fn: withCtx(() => [createElementVNode("div", { class: normalizeClass(unref(cls).e("add")) }, [createElementVNode("button", {
143
- type: "button",
144
- class: normalizeClass([unref(cls).e("add-btn"), unref(bem).is("loading", unref(state).loading)]),
145
- disabled: unref(state).loading,
146
- onClick: _cache[1] || (_cache[1] = withModifiers((...args) => unref(handleCreate) && unref(handleCreate)(...args), ["stop"]))
147
- }, [createVNode(unref(_sfc_main$1), { class: normalizeClass(unref(cls).e("add-icon")) }, {
148
- default: withCtx(() => [createVNode(unref(Plus))]),
119
+ fn: withCtx(() => [createElementVNode("div", { class: normalizeClass(unref(cls).e("add")) }, [createVNode(unref(_sfc_main$1), {
120
+ class: normalizeClass(unref(cls).e("add-btn")),
121
+ icon: unref(Plus),
122
+ loading: unref(state).loading,
123
+ type: "primary",
124
+ plain: "",
125
+ onClick: withModifiers(unref(handleCreate), ["stop"])
126
+ }, {
127
+ default: withCtx(() => [..._cache[4] || (_cache[4] = [createTextVNode(" 新增一行 ", -1)])]),
149
128
  _: 1
150
- }, 8, ["class"]), createElementVNode("span", { class: normalizeClass(unref(cls).e("add-label")) }, "新增一行", 2)], 10, _hoisted_1)], 2)]),
129
+ }, 8, [
130
+ "class",
131
+ "icon",
132
+ "loading",
133
+ "onClick"
134
+ ])], 2)]),
151
135
  key: "1"
152
136
  } : void 0]), 1040, [
153
137
  "slots",
154
138
  "class",
155
139
  "columns",
156
- "current-row"
140
+ "current"
157
141
  ]);
158
142
  };
159
143
  }
@@ -1 +1 @@
1
- {"version":3,"file":"batch-edit-list.js","names":[],"sources":["../../../src/components/batch-edit/batch-edit-list.vue"],"sourcesContent":["<template>\n <u-table\n v-bind=\"tableProps\"\n :slots=\"slots\"\n :class=\"[cls.e('table'), bem.is('editing', state.visible)]\"\n :columns=\"columns\"\n highlight-current\n :current-row=\"state.row\"\n @update:current=\"handleUpdateCurrentRow\"\n @update:checked=\"emit('update:checked', $event)\"\n @update:selected=\"emit('update:selected', $event)\"\n ref=\"tableRef\"\n >\n <template #column:__action__=\"{ row }\">\n <u-action-group :class=\"cls.e('row-actions')\" hover circle :max=\"3\" @click.stop>\n <u-action\n v-if=\"canEdit(row)\"\n :icon=\"props.readonly ? View : EditPen\"\n :title=\"props.readonly ? '查看' : '编辑'\"\n @run=\"handleEdit(row)\"\n v-bind=\"props.actionsProps?.update\"\n />\n\n <u-action\n v-if=\"canDelete(row)\"\n :icon=\"Delete\"\n type=\"danger\"\n title=\"删除\"\n @run=\"handleDelete(row)\"\n v-bind=\"props.actionsProps?.delete\"\n />\n\n <u-action v-if=\"allowed('create', row)\" in-dropdown @run=\"handleInsertToPrev(row)\">\n 在上方插入\n </u-action>\n <u-action v-if=\"allowed('create', row)\" in-dropdown @run=\"handleInsertToNext(row)\">\n 在下方插入\n </u-action>\n <u-action\n v-if=\"!!props.tree && allowed('createChild', row)\"\n in-dropdown\n @run=\"handleInsertChild(row)\"\n >\n 添加子级\n </u-action>\n <u-action v-if=\"allowed('copy', row)\" in-dropdown @run=\"handleCopy(row)\">\n 复制此行\n </u-action>\n </u-action-group>\n </template>\n\n <template #empty v-if=\"!props.readonly\"> {{ null }} </template>\n\n <template\n #append\n v-if=\"\n !props.readonly &&\n (staticFeatures.has('create') || dynamicFeatures.create?.()) &&\n ((state.type === 'create' && !state.visible) || state.type === 'update')\n \"\n >\n <div :class=\"cls.e('add')\">\n <button\n type=\"button\"\n :class=\"[cls.e('add-btn'), bem.is('loading', state.loading)]\"\n :disabled=\"state.loading\"\n @click.stop=\"handleCreate\"\n >\n <u-icon :class=\"cls.e('add-icon')\">\n <Plus />\n </u-icon>\n <span :class=\"cls.e('add-label')\">新增一行</span>\n </button>\n </div>\n </template>\n </u-table>\n</template>\n\n<script setup lang=\"ts\">\nimport { o } from '@cat-kit/core'\nimport { Delete, EditPen, Plus, View } from '@veltra/icons/normal'\nimport { bem } from '@veltra/utils'\nimport { computed, inject, type Slots } from 'vue'\n\nimport type { BatchEditFeature, TableRow } from '../../types'\nimport { UAction, UActionGroup } from '../action'\nimport { UIcon } from '../icon'\nimport { UTable } from '../table'\nimport { BatchEditDIKey } from './di'\n\ndefineOptions({\n name: 'BatchEditList'\n})\n\ndefineProps<{\n slots: Slots\n}>()\n\nconst {\n cls,\n state,\n tableRef,\n props,\n emit,\n staticFeatures,\n dynamicFeatures,\n handleCreate,\n handleEdit,\n handleCopy,\n handleDelete,\n handleInsertToNext,\n handleInsertToPrev,\n handleInsertChild\n} = inject(BatchEditDIKey)!\n\nconst tableProps = computed(() => {\n return o(props as Record<string, any>).omit([\n 'model',\n 'columns',\n 'cols',\n 'readonly',\n 'deleteMethod',\n 'saveMethod',\n 'features'\n ])\n})\n\nconst hasNot = (value: BatchEditFeature[]) => value.every((v) => !staticFeatures.value.has(v))\n\nconst allowed = (feature: BatchEditFeature, row?: TableRow) => {\n return staticFeatures.value.has(feature) || !!dynamicFeatures.value[feature]?.(row)\n}\n\nconst columns = computed(() => {\n if (props.readonly || hasNot(['create', 'delete', 'createChild', 'update', 'copy']))\n return props.columns\n\n return (props.columns ?? []).concat({\n name: '操作',\n key: '__action__',\n align: 'center',\n width: 132,\n fixed: 'right',\n resizable: false\n })\n})\n\nfunction handleUpdateCurrentRow(row?: TableRow) {\n if (allowed('update', row)) {\n state.row = row\n state.depth = row?.depth\n }\n}\n\nfunction canEdit(row: TableRow) {\n return !props.readonly ? allowed('update', row) : true\n}\n\nfunction canDelete(row: TableRow) {\n return !props.readonly && allowed('delete', row)\n}\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;EAkGA,MAAM,EACJ,KACA,OACA,UACA,OACA,MACA,gBACA,iBACA,cACA,YACA,YACA,cACA,oBACA,oBACA,sBACE,OAAO,eAAe;EAE1B,MAAM,aAAa,eAAe;AAChC,UAAO,EAAE,MAA6B,CAAC,KAAK;IAC1C;IACA;IACA;IACA;IACA;IACA;IACA;IACD,CAAA;IACF;EAED,MAAM,UAAU,UAA8B,MAAM,OAAO,MAAM,CAAC,eAAe,MAAM,IAAI,EAAE,CAAA;EAE7F,MAAM,WAAW,SAA2B,QAAmB;AAC7D,UAAO,eAAe,MAAM,IAAI,QAAQ,IAAI,CAAC,CAAC,gBAAgB,MAAM,WAAW,IAAG;;EAGpF,MAAM,UAAU,eAAe;AAC7B,OAAI,MAAM,YAAY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../../../src/components/batch-edit/batch-edit-list.vue"],"sourcesContent":["<template>\n <u-table\n v-bind=\"tableProps\"\n :slots=\"slots\"\n :class=\"[cls.e('table'), bem.is('editing', state.visible)]\"\n :columns=\"columns\"\n highlight-current\n :current=\"state.row\"\n @update:current=\"handleUpdateCurrentRow\"\n @update:checked=\"emit('update:checked', $event)\"\n @update:selected=\"emit('update:selected', $event)\"\n ref=\"tableRef\"\n >\n <template #column:__action__=\"{ row }\">\n <u-action-group :class=\"cls.e('row-actions')\" :max=\"5\" @click.stop circle>\n <u-action\n v-if=\"allowed('create', row)\"\n :icon=\"InsertToPrev\"\n title=\"在上方插入\"\n @run=\"handleInsertToPrev(row)\"\n />\n <u-action\n v-if=\"allowed('create', row)\"\n :icon=\"InsertToNext\"\n title=\"在下方插入\"\n @run=\"handleInsertToNext(row)\"\n />\n <u-action\n v-if=\"!!props.tree && allowed('createChild', row)\"\n :icon=\"AddChild\"\n title=\"添加子级\"\n @run=\"handleInsertChild(row)\"\n />\n <u-action\n v-if=\"allowed('copy', row)\"\n :icon=\"Copy\"\n title=\"复制此行\"\n @run=\"handleCopy(row)\"\n />\n\n <u-action\n v-if=\"canDelete(row)\"\n :icon=\"Delete\"\n type=\"danger\"\n title=\"删除\"\n @run=\"handleDelete(row)\"\n v-bind=\"props.actionsProps?.delete\"\n />\n </u-action-group>\n </template>\n\n <template #empty v-if=\"!props.readonly\"> {{ null }} </template>\n\n <template\n #append\n v-if=\"\n !props.readonly &&\n (staticFeatures.has('create') || dynamicFeatures.create?.()) &&\n ((state.type === 'create' && !state.visible) || state.type === 'update')\n \"\n >\n <div :class=\"cls.e('add')\">\n <u-button\n :class=\"cls.e('add-btn')\"\n :icon=\"Plus\"\n :loading=\"state.loading\"\n type=\"primary\"\n plain\n @click.stop=\"handleCreate\"\n >\n 新增一行\n </u-button>\n </div>\n </template>\n </u-table>\n</template>\n\n<script setup lang=\"ts\">\nimport { o } from '@cat-kit/core'\nimport { AddChild, Copy, Delete, InsertToNext, InsertToPrev, Plus } from '@veltra/icons/normal'\nimport { bem } from '@veltra/utils'\nimport { computed, inject, type Slots } from 'vue'\n\nimport type { BatchEditFeature, TableRow } from '../../types'\nimport { UAction, UActionGroup } from '../action'\nimport { UButton } from '../button'\nimport { UTable } from '../table'\nimport { BatchEditDIKey } from './di'\n\ndefineOptions({\n name: 'BatchEditList'\n})\n\ndefineProps<{\n slots: Slots\n}>()\n\nconst {\n cls,\n state,\n tableRef,\n props,\n emit,\n staticFeatures,\n dynamicFeatures,\n handleCreate,\n handleCopy,\n handleDelete,\n handleInsertToNext,\n handleInsertToPrev,\n handleInsertChild\n} = inject(BatchEditDIKey)!\n\nconst tableProps = computed(() => {\n return o(props as Record<string, any>).omit([\n 'model',\n 'columns',\n 'cols',\n 'readonly',\n 'deleteMethod',\n 'saveMethod',\n 'features'\n ])\n})\n\nconst hasNot = (value: BatchEditFeature[]) => value.every((v) => !staticFeatures.value.has(v))\n\nconst allowed = (feature: BatchEditFeature, row?: TableRow) => {\n return staticFeatures.value.has(feature) || !!dynamicFeatures.value[feature]?.(row)\n}\n\nconst columns = computed(() => {\n if (props.readonly || hasNot(['create', 'delete', 'createChild', 'update', 'copy']))\n return props.columns\n\n return (props.columns ?? []).concat({\n name: '操作',\n key: '__action__',\n align: 'center',\n width: 180,\n fixed: 'right',\n resizable: false\n })\n})\n\nfunction handleUpdateCurrentRow(row?: TableRow) {\n if (allowed('update', row)) {\n state.row = row\n state.depth = row?.depth\n }\n}\n\nfunction canDelete(row: TableRow) {\n return !props.readonly && allowed('delete', row)\n}\n</script>\n"],"mappings":";;;;;;;;;;;;;;;EAiGA,MAAM,EACJ,KACA,OACA,UACA,OACA,MACA,gBACA,iBACA,cACA,YACA,cACA,oBACA,oBACA,sBACE,OAAO,eAAe;EAE1B,MAAM,aAAa,eAAe;AAChC,UAAO,EAAE,MAA6B,CAAC,KAAK;IAC1C;IACA;IACA;IACA;IACA;IACA;IACA;IACD,CAAA;IACF;EAED,MAAM,UAAU,UA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