@ctzy-web-client/plugin-component-vue 1.0.26 → 1.0.28

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 (233) hide show
  1. package/es/_virtual/_plugin-vue_export-helper.mjs +11 -0
  2. package/es/advance-select/advance-operation.mjs +48 -51
  3. package/es/advance-select/advance-option.mjs +134 -164
  4. package/es/advance-select/advance-option.vue_vue_type_style_index_0_scoped_daae7edd_lang.mjs +13 -0
  5. package/es/advance-select/advance-select.mjs +327 -370
  6. package/es/advance-select/events-helpers.mjs +9 -0
  7. package/es/advance-select/index.mjs +9 -0
  8. package/es/advance-select/use-advance-option.mjs +9 -0
  9. package/es/advance-select/use-advance-select.mjs +9 -0
  10. package/es/application-slot/application-slot.mjs +9 -0
  11. package/es/application-slot/breadcrumb-item.mjs +26 -20
  12. package/es/application-slot/header-tools-item.mjs +26 -20
  13. package/es/application-slot/index.mjs +9 -0
  14. package/es/breadcrumb-select/breadcrumb-select.mjs +123 -137
  15. package/es/breadcrumb-select/index.mjs +9 -0
  16. package/es/components.mjs +9 -0
  17. package/es/contextmenu/contextmenu-item.mjs +24 -19
  18. package/es/contextmenu/contextmenu.mjs +68 -73
  19. package/es/contextmenu/index.mjs +9 -0
  20. package/es/contextmenu/use-contextmenu.mjs +10 -1
  21. package/es/data-form/data-form-item.mjs +41 -49
  22. package/es/data-form/data-form.mjs +176 -213
  23. package/es/data-form/dynamic-component.mjs +9 -0
  24. package/es/data-form/form-components/Blots/AtBlot.mjs +9 -0
  25. package/es/data-form/form-components/bwa-date-picker.mjs +50 -51
  26. package/es/data-form/form-components/bwa-date-time-picker.mjs +55 -56
  27. package/es/data-form/form-components/bwa-input-float.mjs +48 -48
  28. package/es/data-form/form-components/bwa-input-integer.mjs +61 -68
  29. package/es/data-form/form-components/bwa-input.mjs +43 -43
  30. package/es/data-form/form-components/bwa-multi-select.mjs +40 -40
  31. package/es/data-form/form-components/bwa-rich-text-tinymce.mjs +230 -555
  32. package/es/data-form/form-components/bwa-rich-text.mjs +326 -404
  33. package/es/data-form/form-components/bwa-select.mjs +81 -84
  34. package/es/data-form/form-components/bwa-textarea.mjs +38 -38
  35. package/es/data-form/form-components/bwa-upload.mjs +160 -173
  36. package/es/data-form/form-components/bwa-user-multi-select.mjs +35 -35
  37. package/es/data-form/form-components/bwa-user-select.mjs +72 -86
  38. package/es/data-form/index.mjs +9 -0
  39. package/es/data-table/data-column-view.mjs +124 -146
  40. package/es/data-table/data-table-card.mjs +49 -48
  41. package/es/data-table/data-table-column.mjs +55 -58
  42. package/es/data-table/data-table.mjs +328 -404
  43. package/es/data-table/dynamic-component.mjs +9 -0
  44. package/es/data-table/index.mjs +9 -0
  45. package/es/data-table/use-datatable-drag.mjs +9 -0
  46. package/es/datatable-settings/datatable-settings.mjs +286 -328
  47. package/es/datatable-settings/index.mjs +9 -0
  48. package/es/date-range/date-picker.mjs +125 -131
  49. package/es/date-range/date-range.mjs +173 -216
  50. package/es/date-range/index.mjs +9 -0
  51. package/es/drag-list/constants.mjs +10 -0
  52. package/es/drag-list/drag-item.mjs +51 -56
  53. package/es/drag-list/drag-list.mjs +58 -60
  54. package/es/drag-list/index.mjs +9 -0
  55. package/es/drag-list/use-drag-list.mjs +10 -1
  56. package/es/dragable/constants.mjs +10 -0
  57. package/es/dragable/dragable-item.mjs +27 -23
  58. package/es/dragable/dragable-operation.mjs +33 -32
  59. package/es/dragable/dragable.mjs +33 -32
  60. package/es/dragable/index.mjs +9 -0
  61. package/es/dragable/use-dragable.mjs +9 -0
  62. package/es/filter-panel/conditions/condition.mjs +9 -0
  63. package/es/filter-panel/conditions/date-range-condition.mjs +51 -50
  64. package/es/filter-panel/conditions/department-condition/department-condition.mjs +82 -99
  65. package/es/filter-panel/conditions/department-condition/department-node.mjs +69 -73
  66. package/es/filter-panel/conditions/index.mjs +9 -0
  67. package/es/filter-panel/conditions/input-condition.mjs +88 -91
  68. package/es/filter-panel/conditions/multi-user-condition.mjs +66 -67
  69. package/es/filter-panel/conditions/multiple-menu-condition.mjs +44 -54
  70. package/es/filter-panel/conditions/single-menu-condition.mjs +71 -65
  71. package/es/filter-panel/conditions/single-user-condition.mjs +66 -67
  72. package/es/filter-panel/filter-panel-item.mjs +51 -55
  73. package/es/filter-panel/filter-panel.mjs +147 -156
  74. package/es/filter-panel/index.mjs +9 -0
  75. package/es/filter-panel/use-filter-panel-item.mjs +9 -0
  76. package/es/filter-panel/use-filter-panel.mjs +9 -0
  77. package/es/hooks/use-data/index.mjs +9 -0
  78. package/es/index.mjs +9 -0
  79. package/es/layout/index.mjs +9 -0
  80. package/es/layout/layout.mjs +87 -85
  81. package/es/make-installer.mjs +9 -0
  82. package/es/math/Rectangle.mjs +10 -0
  83. package/es/menu/index.mjs +9 -0
  84. package/es/menu/menu-item.mjs +65 -70
  85. package/es/menu/menu.mjs +64 -70
  86. package/es/node_modules/.pnpm/{@vueuse_core@9.6.0_vue@3.2.41 → @vueuse_core@9.13.0_vue@3.5.29_typescript@4.9.5_}/node_modules/@vueuse/core/index.mjs +680 -454
  87. package/es/node_modules/.pnpm/{@vueuse_shared@9.6.0_vue@3.2.41 → @vueuse_shared@9.13.0_vue@3.5.29_typescript@4.9.5_}/node_modules/@vueuse/shared/index.mjs +108 -46
  88. package/es/panel/index.mjs +9 -0
  89. package/es/panel/panel.mjs +49 -53
  90. package/es/panel-tabs/index.mjs +9 -0
  91. package/es/panel-tabs/panel-tabs.mjs +9 -0
  92. package/es/pct-filter-panel/index.mjs +9 -0
  93. package/es/pct-filter-panel/pct-compents/index.mjs +9 -0
  94. package/es/pct-filter-panel/pct-compents/pct-Input-condition.mjs +73 -75
  95. package/es/pct-filter-panel/pct-compents/pct-date-range-condition.mjs +77 -77
  96. package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition.mjs +357 -374
  97. package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.mjs +149 -154
  98. package/es/pct-filter-panel/pct-filter-panel-item.mjs +52 -56
  99. package/es/pct-filter-panel/pct-filter-panel.mjs +235 -248
  100. package/es/pct-filter-panel/use-filter-panel-item.mjs +9 -0
  101. package/es/pct-filter-panel/use-filter-panel.mjs +9 -0
  102. package/es/plugins.css +1 -0
  103. package/es/plugins.mjs +9 -0
  104. package/es/progress/index.mjs +9 -0
  105. package/es/progress/progress-item.mjs +71 -81
  106. package/es/progress/progress.mjs +74 -78
  107. package/es/progress/use-progress.mjs +9 -0
  108. package/es/utils/db.mjs +9 -0
  109. package/es/utils.mjs +9 -0
  110. package/es/where-filter-panel/index.mjs +9 -1
  111. package/es/where-filter-panel/use-where-filter-panel.mjs +9 -0
  112. package/es/where-filter-panel/where-filter-panel.mjs +21 -15
  113. package/lib/_virtual/_plugin-vue_export-helper.js +11 -0
  114. package/lib/advance-select/advance-operation.js +47 -50
  115. package/lib/advance-select/advance-option.js +133 -163
  116. package/lib/advance-select/advance-option.vue_vue_type_style_index_0_scoped_daae7edd_lang.js +17 -0
  117. package/lib/advance-select/advance-select.js +326 -369
  118. package/lib/advance-select/events-helpers.js +9 -0
  119. package/lib/advance-select/index.js +9 -0
  120. package/lib/advance-select/use-advance-option.js +9 -0
  121. package/lib/advance-select/use-advance-select.js +9 -0
  122. package/lib/application-slot/application-slot.js +9 -0
  123. package/lib/application-slot/breadcrumb-item.js +25 -19
  124. package/lib/application-slot/header-tools-item.js +25 -19
  125. package/lib/application-slot/index.js +9 -0
  126. package/lib/breadcrumb-select/breadcrumb-select.js +122 -136
  127. package/lib/breadcrumb-select/index.js +9 -0
  128. package/lib/components.js +9 -0
  129. package/lib/contextmenu/contextmenu-item.js +23 -18
  130. package/lib/contextmenu/contextmenu.js +67 -72
  131. package/lib/contextmenu/index.js +9 -0
  132. package/lib/contextmenu/use-contextmenu.js +10 -1
  133. package/lib/data-form/data-form-item.js +40 -48
  134. package/lib/data-form/data-form.js +175 -212
  135. package/lib/data-form/dynamic-component.js +9 -0
  136. package/lib/data-form/form-components/Blots/AtBlot.js +9 -0
  137. package/lib/data-form/form-components/bwa-date-picker.js +49 -50
  138. package/lib/data-form/form-components/bwa-date-time-picker.js +54 -55
  139. package/lib/data-form/form-components/bwa-input-float.js +47 -47
  140. package/lib/data-form/form-components/bwa-input-integer.js +60 -67
  141. package/lib/data-form/form-components/bwa-input.js +42 -42
  142. package/lib/data-form/form-components/bwa-multi-select.js +39 -39
  143. package/lib/data-form/form-components/bwa-rich-text-tinymce.js +229 -554
  144. package/lib/data-form/form-components/bwa-rich-text.js +325 -403
  145. package/lib/data-form/form-components/bwa-select.js +80 -83
  146. package/lib/data-form/form-components/bwa-textarea.js +37 -37
  147. package/lib/data-form/form-components/bwa-upload.js +159 -172
  148. package/lib/data-form/form-components/bwa-user-multi-select.js +34 -34
  149. package/lib/data-form/form-components/bwa-user-select.js +71 -85
  150. package/lib/data-form/index.js +9 -0
  151. package/lib/data-table/data-column-view.js +124 -146
  152. package/lib/data-table/data-table-card.js +49 -48
  153. package/lib/data-table/data-table-column.js +54 -57
  154. package/lib/data-table/data-table.js +327 -403
  155. package/lib/data-table/dynamic-component.js +9 -0
  156. package/lib/data-table/index.js +9 -0
  157. package/lib/data-table/use-datatable-drag.js +9 -0
  158. package/lib/datatable-settings/datatable-settings.js +285 -327
  159. package/lib/datatable-settings/index.js +9 -0
  160. package/lib/date-range/date-picker.js +124 -130
  161. package/lib/date-range/date-range.js +172 -215
  162. package/lib/date-range/index.js +9 -0
  163. package/lib/drag-list/constants.js +10 -0
  164. package/lib/drag-list/drag-item.js +50 -55
  165. package/lib/drag-list/drag-list.js +57 -59
  166. package/lib/drag-list/index.js +9 -0
  167. package/lib/drag-list/use-drag-list.js +10 -1
  168. package/lib/dragable/constants.js +10 -0
  169. package/lib/dragable/dragable-item.js +26 -22
  170. package/lib/dragable/dragable-operation.js +32 -31
  171. package/lib/dragable/dragable.js +32 -31
  172. package/lib/dragable/index.js +9 -0
  173. package/lib/dragable/use-dragable.js +9 -0
  174. package/lib/filter-panel/conditions/condition.js +9 -0
  175. package/lib/filter-panel/conditions/date-range-condition.js +50 -49
  176. package/lib/filter-panel/conditions/department-condition/department-condition.js +81 -98
  177. package/lib/filter-panel/conditions/department-condition/department-node.js +68 -72
  178. package/lib/filter-panel/conditions/index.js +9 -0
  179. package/lib/filter-panel/conditions/input-condition.js +87 -90
  180. package/lib/filter-panel/conditions/multi-user-condition.js +65 -66
  181. package/lib/filter-panel/conditions/multiple-menu-condition.js +43 -53
  182. package/lib/filter-panel/conditions/single-menu-condition.js +70 -64
  183. package/lib/filter-panel/conditions/single-user-condition.js +65 -66
  184. package/lib/filter-panel/filter-panel-item.js +50 -54
  185. package/lib/filter-panel/filter-panel.js +146 -155
  186. package/lib/filter-panel/index.js +9 -0
  187. package/lib/filter-panel/use-filter-panel-item.js +9 -0
  188. package/lib/filter-panel/use-filter-panel.js +9 -0
  189. package/lib/hooks/use-data/index.js +9 -0
  190. package/lib/index.js +9 -0
  191. package/lib/layout/index.js +9 -0
  192. package/lib/layout/layout.js +86 -84
  193. package/lib/make-installer.js +9 -0
  194. package/lib/math/Rectangle.js +10 -0
  195. package/lib/menu/index.js +9 -0
  196. package/lib/menu/menu-item.js +64 -69
  197. package/lib/menu/menu.js +63 -69
  198. package/lib/node_modules/.pnpm/{@vueuse_core@9.6.0_vue@3.2.41 → @vueuse_core@9.13.0_vue@3.5.29_typescript@4.9.5_}/node_modules/@vueuse/core/index.js +685 -451
  199. package/lib/node_modules/.pnpm/{@vueuse_shared@9.6.0_vue@3.2.41 → @vueuse_shared@9.13.0_vue@3.5.29_typescript@4.9.5_}/node_modules/@vueuse/shared/index.js +109 -44
  200. package/lib/panel/index.js +9 -0
  201. package/lib/panel/panel.js +48 -52
  202. package/lib/panel-tabs/index.js +9 -0
  203. package/lib/panel-tabs/panel-tabs.js +9 -0
  204. package/lib/pct-filter-panel/index.js +9 -0
  205. package/lib/pct-filter-panel/pct-compents/index.js +9 -0
  206. package/lib/pct-filter-panel/pct-compents/pct-Input-condition.js +72 -74
  207. package/lib/pct-filter-panel/pct-compents/pct-date-range-condition.js +76 -76
  208. package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition.js +356 -373
  209. package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.js +148 -153
  210. package/lib/pct-filter-panel/pct-filter-panel-item.js +51 -55
  211. package/lib/pct-filter-panel/pct-filter-panel.js +234 -247
  212. package/lib/pct-filter-panel/use-filter-panel-item.js +9 -0
  213. package/lib/pct-filter-panel/use-filter-panel.js +9 -0
  214. package/lib/plugins.css +1 -0
  215. package/lib/plugins.js +9 -0
  216. package/lib/progress/index.js +9 -0
  217. package/lib/progress/progress-item.js +70 -80
  218. package/lib/progress/progress.js +73 -77
  219. package/lib/progress/use-progress.js +9 -0
  220. package/lib/utils/db.js +9 -0
  221. package/lib/utils.js +9 -0
  222. package/lib/where-filter-panel/index.js +9 -0
  223. package/lib/where-filter-panel/use-where-filter-panel.js +9 -0
  224. package/lib/where-filter-panel/where-filter-panel.js +20 -14
  225. package/package.json +1 -1
  226. package/src/advance-select/advance-option.vue +13 -7
  227. package/src/advance-select/advance-select.vue +8 -1
  228. package/src/pct-filter-panel/pct-compents/pct-multiple-menu-condition.vue +10 -1
  229. package/style/index.css +1 -1
  230. package/es/advance-select/advance-option.vue_vue_type_style_index_0_scoped_bc8f5626_lang.mjs +0 -7
  231. package/es/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.mjs +0 -28
  232. package/lib/advance-select/advance-option.vue_vue_type_style_index_0_scoped_bc8f5626_lang.js +0 -12
  233. package/lib/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js +0 -32
@@ -1,3 +1,14 @@
1
+ // Inject __name helper
2
+ if (typeof __name === 'undefined') {
3
+ function __name(obj, name) {
4
+ Object.defineProperty(obj, "name", {
5
+ value: name,
6
+ configurable: true
7
+ });
8
+ }
9
+ }
10
+
11
+
1
12
  var _export_sfc = (sfc, props) => {
2
13
  const target = sfc.__vccOpts || sfc;
3
14
  for (const [key, val] of props) {
@@ -1,57 +1,54 @@
1
- import { inject, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from 'vue';
1
+ import { defineComponent, inject, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from 'vue';
2
2
  import { advanceSelectKey, useNamespace } from '@ctzy-web-client/web-base-client-vue';
3
3
  import _export_sfc from '../_virtual/_plugin-vue_export-helper.mjs';
4
4
 
5
- const _sfc_main = {
6
- __name: 'advance-operation',
7
- props: {
8
- border: {
9
- type: Boolean,
10
- default: false,
11
- },
12
- type: {
13
- type: String,
14
- default: 'button',
15
- },
16
- },
17
- emits: ['click'],
18
- setup(__props, { emit }) {
19
-
20
- const props = __props;
21
-
22
- defineOptions({
23
- name: 'BwaAdvanceOperation',
24
- });
25
-
26
-
27
-
28
-
29
-
30
- const advanceSelect = inject(advanceSelectKey);
31
-
32
- const clickHandle = () => {
33
- if (props.type !== 'button') {
34
- return;
35
- }
36
-
37
- advanceSelect.hidePoppper();
38
-
39
- emit('click');
40
- };
41
-
42
- const ns = useNamespace('advance');
43
-
44
- return (_ctx, _cache) => {
45
- return (openBlock(), createElementBlock("div", {
46
- class: normalizeClass([unref(ns).be('select', 'operation'), unref(ns).is('border', __props.border)]),
47
- onClick: clickHandle
48
- }, [
49
- renderSlot(_ctx.$slots, "default")
50
- ], 2 /* CLASS */))
5
+ // Inject __name helper
6
+ if (typeof __name === 'undefined') {
7
+ function __name(obj, name) {
8
+ Object.defineProperty(obj, "name", {
9
+ value: name,
10
+ configurable: true
11
+ });
12
+ }
51
13
  }
52
- }
53
-
54
- };
55
- var AdvanceOperation = /*#__PURE__*/_export_sfc(_sfc_main, [['__file',"advance-operation.vue"]]);
14
+ const __default__ = defineComponent({
15
+ name: "BwaAdvanceOperation"
16
+ });
17
+ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
18
+ props: {
19
+ border: {
20
+ type: Boolean,
21
+ default: false
22
+ },
23
+ type: {
24
+ type: String,
25
+ default: "button"
26
+ }
27
+ },
28
+ emits: ["click"],
29
+ setup(__props, { emit: __emit }) {
30
+ ;
31
+ const props = __props;
32
+ const emit = __emit;
33
+ const advanceSelect = inject(advanceSelectKey);
34
+ const clickHandle = () => {
35
+ if (props.type !== "button") {
36
+ return;
37
+ }
38
+ advanceSelect.hidePoppper();
39
+ emit("click");
40
+ };
41
+ const ns = useNamespace("advance");
42
+ return (_ctx, _cache) => {
43
+ return openBlock(), createElementBlock("div", {
44
+ class: normalizeClass([unref(ns).be("select", "operation"), unref(ns).is("border", __props.border)]),
45
+ onClick: clickHandle
46
+ }, [
47
+ renderSlot(_ctx.$slots, "default")
48
+ ], 2);
49
+ };
50
+ }
51
+ });
52
+ var AdvanceOperation = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "advance-operation.vue"]]);
56
53
 
57
54
  export { AdvanceOperation as default };
@@ -1,141 +1,117 @@
1
1
  import 'element-plus';
2
- import { getCurrentInstance, ref, pushScopeId, popScopeId, resolveComponent, openBlock, createElementBlock, normalizeClass, withModifiers, createCommentVNode, createElementVNode, renderSlot, createVNode, withCtx, createTextVNode, toDisplayString, normalizeStyle, createBlock } from 'vue';
2
+ import { getCurrentInstance, ref, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, withModifiers, createCommentVNode, createElementVNode, renderSlot, createVNode, withCtx, createTextVNode, toDisplayString, normalizeStyle, createBlock } from 'vue';
3
3
  import { useNamespace } from '@ctzy-web-client/web-base-client-vue';
4
4
  import { useEvent } from './events-helpers.mjs';
5
5
  import { useAdvanceOption } from './use-advance-option.mjs';
6
6
  import { pinyin } from 'pinyin-pro';
7
- import './advance-option.vue_vue_type_style_index_0_scoped_bc8f5626_lang.mjs';
7
+ import './advance-option.vue_vue_type_style_index_0_scoped_daae7edd_lang.mjs';
8
8
  import _export_sfc from '../_virtual/_plugin-vue_export-helper.mjs';
9
9
 
10
- const _sfc_main = {
11
- name: 'BwaAdvanceOption',
12
- props: {
13
- label: {
14
- type: [String, Number, Boolean],
15
- },
16
- value: {
17
- type: null,
18
- },
19
- },
20
- expose: ['currentLabel'],
21
- setup(props, { expose }) {
22
- const instance = getCurrentInstance();
23
-
24
- const ns = useNamespace('advance');
25
-
26
- const { handleOptionMouseEnter } = useEvent(ns);
27
-
28
- const { advanceSelect, currentLabel, itemSelected, showSelectIcon, source } =
29
- useAdvanceOption(props);
30
-
31
- const show = ref(true);
32
- const clickFlag = ref(true);
33
- const showUserName = ref(true);
34
-
35
- const contentText = ref();
36
-
37
- expose({ currentLabel });
38
-
39
- const filterOptionClick = () => {
40
- advanceSelect.handleOptionSelect(instance.proxy);
41
- };
42
-
43
- // 判断是否需要展示tooltip
44
- const isShow = async () => {
45
- const dom = document.querySelector(`.content-label-${props.value} .bwa-advance-option__content-label`);
46
- if (dom) {
47
- const scrollWidth = document.querySelector(`.content-label-${props.value} .bwa-advance-option__content-label`).scrollWidth;
48
- const offsetWidth = document.querySelector(`.content-label-${props.value} .bwa-advance-option__content-label`).offsetWidth;
49
- if (scrollWidth > offsetWidth) {
50
- show.value = false;
51
- } else {
52
- show.value = true;
53
- }
54
- }
55
- };
56
- const COLOR_POOL = ['#2DC86D', '#19BBFF', '#FFA901'];
57
- /**
58
- * 接收完整label,提取姓名首字母(大写)并匹配颜色
59
- * @param {string} label - 完整label(如:石玉涵(dw_shiyuhan))
60
- * @returns {object} { firstLetter: 大写首字母, color: 圆点颜色, valid: 是否符合规则 }
61
- */
62
- function processLabel(label) {
63
- // 1. 第一步:拆分label,提取姓名(核心修复点)
64
- const labelMatch = label.match(/^(.*)\((.*)\)$/);
65
- if (!labelMatch) {
66
- return { valid: false, firstLetter: '#', color: COLOR_POOL[0] };
67
- }
68
- const [, name] = labelMatch; // 提取纯姓名:如"石玉涵"
69
- const firstChar = name.charAt(0); // 取姓名第一个字
70
-
71
- // 2. 第二步:获取首字母(强制大写,彻底解决小写问题)
72
- let firstLetter = '#';
73
- if (/^[\u4e00-\u9fa5]$/.test(firstChar)) {
74
- // 拼音库取首字母 + 手动toUpperCase(无视库版本差异)
75
- firstLetter = pinyin(firstChar, { pattern: 'first' }).toUpperCase();
76
- } else if (/^[a-zA-Z]$/.test(firstChar)) {
77
- firstLetter = firstChar.toUpperCase();
78
- }
79
-
80
- // 3. 第三步:计算颜色(按你指定的规则)
81
- let color = COLOR_POOL[0];
82
- if (/^[A-Z]$/.test(firstLetter)) {
83
- const letterCode = firstLetter.charCodeAt(0) - 'A'.charCodeAt(0);
84
- color = COLOR_POOL[letterCode % 3];
85
- }
86
-
87
- return {
88
-
89
- firstLetter: firstLetter, // 确保是大写
90
- color: color
91
- };
92
- }
93
- const listenerClickFunction = () => {
94
- setTimeout(() => {
95
- isShow();
96
- }, 100);
97
- };
98
- // onMounted(async () => {
99
- // if (clickFlag) {
100
- // document.querySelector('.bwa-advance-select button')?.addEventListener('click', listenerClickFunction)
101
- // clickFlag.value = false
102
- // }
103
- // })
104
-
105
- // onUnmounted(() => {
106
- // document.querySelector('.bwa-advance-select button').removeEventListener('click', listenerClickFunction)
107
- // })
108
-
109
- return {
110
- show,
111
- ns,
112
- currentLabel,
113
- showUserName,
114
- itemSelected,
115
- showSelectIcon,
116
- filterOptionClick,
117
- handleOptionMouseEnter,
118
- source,
119
- processLabel
120
- };
121
- },
122
- };
123
-
124
- const _withScopeId = n => (pushScopeId("data-v-bc8f5626"),n=n(),popScopeId(),n);
125
- const _hoisted_1 = { style: {"overflow":"hidden","text-overflow":"ellipsis","flex":"3"} };
126
-
10
+ // Inject __name helper
11
+ if (typeof __name === 'undefined') {
12
+ function __name(obj, name) {
13
+ Object.defineProperty(obj, "name", {
14
+ value: name,
15
+ configurable: true
16
+ });
17
+ }
18
+ }
19
+ const _sfc_main = {
20
+ name: "BwaAdvanceOption",
21
+ props: {
22
+ label: {
23
+ type: [String, Number, Boolean]
24
+ },
25
+ value: {
26
+ type: null
27
+ },
28
+ showLetterAvatar: {
29
+ type: Boolean,
30
+ default: false
31
+ }
32
+ },
33
+ expose: ["currentLabel"],
34
+ setup(props, { expose }) {
35
+ const instance = getCurrentInstance();
36
+ const ns = useNamespace("advance");
37
+ const { handleOptionMouseEnter } = useEvent(ns);
38
+ const { advanceSelect, currentLabel, itemSelected, showSelectIcon, source } = useAdvanceOption(props);
39
+ const show = ref(true);
40
+ const clickFlag = ref(true);
41
+ const showLetterAvatarStatus = computed(() => props.showLetterAvatar);
42
+ console.log(showLetterAvatarStatus.value, "\u4E0B\u4E00\u7EA7");
43
+ const contentText = ref();
44
+ expose({ currentLabel });
45
+ const filterOptionClick = () => {
46
+ advanceSelect.handleOptionSelect(instance.proxy);
47
+ };
48
+ const isShow = async () => {
49
+ const dom = document.querySelector(`.content-label-${props.value} .bwa-advance-option__content-label`);
50
+ if (dom) {
51
+ const scrollWidth = document.querySelector(`.content-label-${props.value} .bwa-advance-option__content-label`).scrollWidth;
52
+ const offsetWidth = document.querySelector(`.content-label-${props.value} .bwa-advance-option__content-label`).offsetWidth;
53
+ if (scrollWidth > offsetWidth) {
54
+ show.value = false;
55
+ } else {
56
+ show.value = true;
57
+ }
58
+ }
59
+ };
60
+ const COLOR_POOL = ["#2DC86D", "#19BBFF", "#FFA901"];
61
+ function processLabel(label) {
62
+ const labelMatch = label.match(/^(.*)\((.*)\)$/);
63
+ if (!labelMatch) {
64
+ return { valid: false, firstLetter: "#", color: COLOR_POOL[0] };
65
+ }
66
+ const [, name] = labelMatch;
67
+ const firstChar = name.charAt(0);
68
+ let firstLetter = "#";
69
+ if (/^[\u4e00-\u9fa5]$/.test(firstChar)) {
70
+ firstLetter = pinyin(firstChar, { pattern: "first" }).toUpperCase();
71
+ } else if (/^[a-zA-Z]$/.test(firstChar)) {
72
+ firstLetter = firstChar.toUpperCase();
73
+ }
74
+ let color = COLOR_POOL[0];
75
+ if (/^[A-Z]$/.test(firstLetter)) {
76
+ const letterCode = firstLetter.charCodeAt(0) - "A".charCodeAt(0);
77
+ color = COLOR_POOL[letterCode % 3];
78
+ }
79
+ return {
80
+ firstLetter,
81
+ color
82
+ };
83
+ }
84
+ const listenerClickFunction = () => {
85
+ setTimeout(() => {
86
+ isShow();
87
+ }, 100);
88
+ };
89
+ return {
90
+ show,
91
+ ns,
92
+ currentLabel,
93
+ itemSelected,
94
+ showSelectIcon,
95
+ filterOptionClick,
96
+ handleOptionMouseEnter,
97
+ source,
98
+ processLabel,
99
+ showLetterAvatarStatus
100
+ };
101
+ }
102
+ };
103
+ const _hoisted_1 = { style: { "overflow": "hidden", "text-overflow": "ellipsis", "flex": "3" } };
127
104
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
128
105
  const _component_ElTooltip = resolveComponent("ElTooltip");
129
106
  const _component_Select = resolveComponent("Select");
130
107
  const _component_ElIcon = resolveComponent("ElIcon");
131
-
132
- return (openBlock(), createElementBlock("div", {
133
- class: normalizeClass($setup.ns.b('option')),
134
- onClick: _cache[0] || (_cache[0] = withModifiers((...args) => ($setup.filterOptionClick && $setup.filterOptionClick(...args)), ["stop"]))
108
+ return openBlock(), createElementBlock("div", {
109
+ class: normalizeClass($setup.ns.b("option")),
110
+ onClick: _cache[0] || (_cache[0] = withModifiers((...args) => $setup.filterOptionClick && $setup.filterOptionClick(...args), ["stop"]))
135
111
  }, [
136
- createCommentVNode(" @mouseenter=\"handleOptionMouseEnter\" "),
112
+ createCommentVNode(' @mouseenter="handleOptionMouseEnter" '),
137
113
  createElementVNode("div", {
138
- class: normalizeClass(`${$setup.ns.be('option', 'content')} content-label-${$props.value}`)
114
+ class: normalizeClass(`${$setup.ns.be("option", "content")} content-label-${$props.value}`)
139
115
  }, [
140
116
  renderSlot(_ctx.$slots, "default", {}, () => [
141
117
  createVNode(_component_ElTooltip, {
@@ -144,52 +120,46 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
144
120
  disabled: $setup.currentLabel.length < 16
145
121
  }, {
146
122
  content: withCtx(() => [
147
- createTextVNode(toDisplayString($setup.currentLabel), 1 /* TEXT */)
123
+ createTextVNode(toDisplayString($setup.currentLabel), 1)
148
124
  ]),
149
125
  default: withCtx(() => [
150
126
  createElementVNode("div", {
151
- class: normalizeClass($setup.ns.be('option', 'content-label')),
127
+ class: normalizeClass($setup.ns.be("option", "content-label")),
152
128
  ref: "contentText"
153
129
  }, [
154
- (!$setup.showUserName)
155
- ? (openBlock(), createElementBlock("div", {
156
- key: 0,
157
- class: normalizeClass($setup.ns.be('option', 'content-label')),
158
- style: {"width":"178px"}
159
- }, toDisplayString($setup.currentLabel), 3 /* TEXT, CLASS */))
160
- : createCommentVNode("v-if", true),
161
- ($setup.showUserName)
162
- ? (openBlock(), createElementBlock("div", {
163
- key: 1,
164
- class: normalizeClass($setup.ns.be('option', 'content-label')),
165
- style: {"width":"178px","display":"flex","align-items":"center"}
166
- }, [
167
- createElementVNode("div", {
168
- class: "letter-circle",
169
- style: normalizeStyle({ backgroundColor: ($setup.processLabel($setup.currentLabel).color) })
170
- }, toDisplayString($setup.processLabel($setup.currentLabel).firstLetter), 5 /* TEXT, STYLE */),
171
- createElementVNode("div", _hoisted_1, toDisplayString($setup.currentLabel), 1 /* TEXT */)
172
- ], 2 /* CLASS */))
173
- : createCommentVNode("v-if", true)
174
- ], 2 /* CLASS */)
130
+ !$setup.showLetterAvatarStatus ? (openBlock(), createElementBlock("div", {
131
+ key: 0,
132
+ class: normalizeClass($setup.ns.be("option", "content-label")),
133
+ style: { "width": "178px" }
134
+ }, toDisplayString($setup.currentLabel), 3)) : createCommentVNode("v-if", true),
135
+ $setup.showLetterAvatarStatus ? (openBlock(), createElementBlock("div", {
136
+ key: 1,
137
+ class: normalizeClass($setup.ns.be("option", "content-label")),
138
+ style: { "width": "178px", "display": "flex", "align-items": "center" }
139
+ }, [
140
+ createElementVNode("div", {
141
+ class: "letter-circle",
142
+ style: normalizeStyle({ backgroundColor: $setup.processLabel($setup.currentLabel).color })
143
+ }, toDisplayString($setup.processLabel($setup.currentLabel).firstLetter), 5),
144
+ createElementVNode("div", _hoisted_1, toDisplayString($setup.currentLabel), 1)
145
+ ], 2)) : createCommentVNode("v-if", true)
146
+ ], 2)
175
147
  ]),
176
- _: 1 /* STABLE */
177
- }, 8 /* PROPS */, ["disabled"])
148
+ _: 1
149
+ }, 8, ["disabled"])
178
150
  ], true)
179
- ], 2 /* CLASS */),
180
- ($setup.itemSelected )
181
- ? (openBlock(), createBlock(_component_ElIcon, {
182
- key: 0,
183
- class: normalizeClass($setup.ns.be('option', 'selected'))
184
- }, {
185
- default: withCtx(() => [
186
- createVNode(_component_Select)
187
- ]),
188
- _: 1 /* STABLE */
189
- }, 8 /* PROPS */, ["class"]))
190
- : createCommentVNode("v-if", true)
191
- ], 2 /* CLASS */))
151
+ ], 2),
152
+ $setup.itemSelected ? (openBlock(), createBlock(_component_ElIcon, {
153
+ key: 0,
154
+ class: normalizeClass($setup.ns.be("option", "selected"))
155
+ }, {
156
+ default: withCtx(() => [
157
+ createVNode(_component_Select)
158
+ ]),
159
+ _: 1
160
+ }, 8, ["class"])) : createCommentVNode("v-if", true)
161
+ ], 2);
192
162
  }
193
- var BwaAdvanceOption = /*#__PURE__*/_export_sfc(_sfc_main, [['render',_sfc_render],['__scopeId',"data-v-bc8f5626"],['__file',"advance-option.vue"]]);
163
+ var BwaAdvanceOption = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-daae7edd"], ["__file", "advance-option.vue"]]);
194
164
 
195
165
  export { BwaAdvanceOption as default };
@@ -0,0 +1,13 @@
1
+ // Inject __name helper
2
+ if (typeof __name === 'undefined') {
3
+ function __name(obj, name) {
4
+ Object.defineProperty(obj, "name", {
5
+ value: name,
6
+ configurable: true
7
+ });
8
+ }
9
+ }
10
+
11
+ var undefined$1 = undefined;
12
+
13
+ export { undefined$1 as default };