@ctzy-web-client/plugin-component-vue 1.0.25 → 1.0.27

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 (228) 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 +128 -163
  4. package/es/advance-select/advance-option.vue_vue_type_style_index_0_scoped_bc8f5626_lang.mjs +11 -5
  5. package/es/advance-select/advance-select.mjs +323 -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 +345 -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.mjs +9 -0
  103. package/es/progress/index.mjs +9 -0
  104. package/es/progress/progress-item.mjs +71 -81
  105. package/es/progress/progress.mjs +74 -78
  106. package/es/progress/use-progress.mjs +9 -0
  107. package/es/utils/db.mjs +9 -0
  108. package/es/utils.css +1 -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 +127 -162
  116. package/lib/advance-select/advance-option.vue_vue_type_style_index_0_scoped_bc8f5626_lang.js +11 -6
  117. package/lib/advance-select/advance-select.js +322 -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 +344 -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.js +9 -0
  215. package/lib/progress/index.js +9 -0
  216. package/lib/progress/progress-item.js +70 -80
  217. package/lib/progress/progress.js +73 -77
  218. package/lib/progress/use-progress.js +9 -0
  219. package/lib/utils/db.js +9 -0
  220. package/lib/utils.css +1 -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/style/index.css +1 -1
  227. package/es/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.mjs +0 -28
  228. package/lib/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js +0 -32
@@ -1,4 +1,4 @@
1
- import { inject, toRefs, useSlots, computed, unref, watch, onBeforeUnmount, provide, reactive, getCurrentInstance, resolveComponent, resolveDirective, openBlock, createElementBlock, normalizeClass, createVNode, isRef, withCtx, renderSlot, toDisplayString, createCommentVNode, createBlock, createElementVNode, Fragment, createTextVNode, withDirectives, renderList, normalizeStyle } from 'vue';
1
+ import { defineComponent, inject, toRefs, useSlots, computed, unref, watch, onBeforeUnmount, provide, reactive, getCurrentInstance, resolveComponent, resolveDirective, openBlock, createElementBlock, normalizeClass, createVNode, isRef, withCtx, renderSlot, toDisplayString, createCommentVNode, createBlock, createElementVNode, Fragment, createTextVNode, withDirectives, renderList, normalizeStyle } from 'vue';
2
2
  import { Observable, debounceTime } from 'rxjs';
3
3
  import { useGlobalConfig, filterPanelItemKey, useNamespace, advanceSelectKey } from '@ctzy-web-client/web-base-client-vue';
4
4
  import { dataProps, useData } from '../hooks/use-data/index.mjs';
@@ -7,411 +7,364 @@ import BwaAdvanceOption from './advance-option.mjs';
7
7
  import { useAdvanceSelectStates, useAdvanceSelect } from './use-advance-select.mjs';
8
8
  import _export_sfc from '../_virtual/_plugin-vue_export-helper.mjs';
9
9
 
10
- const _sfc_main = {
11
- __name: 'advance-select',
12
- props: {
13
- ...dataProps,
14
- options: {
15
- type: Array,
16
- },
17
- modelValue: {
18
- type: [Array, String, Number, Boolean],
19
- },
20
- listHeight: {
21
- type: String,
22
- default: '300px',
23
- },
24
- width: {
25
- type: String,
26
- default: '240px',
27
- },
28
- multiple: {
29
- type: Boolean,
30
- default: true,
31
- },
32
- multipleLimit: {
33
- type: Number,
34
- default: 0,
35
- },
36
- required: {
37
- type: Boolean,
38
- default: false,
39
- },
40
- showSearch: {
41
- type: Boolean,
42
- default: true,
43
- },
44
- searchPlaceholder: {
45
- type: String,
46
- default: '',
47
- },
48
- showSelection: {
49
- type: Boolean,
50
- default: true,
51
- },
52
- showSelectIcon: {
53
- type: Boolean,
54
- default: true,
55
- },
56
- closeAfterSelection: {
57
- typoe: Boolean,
58
- default: false,
59
- },
60
- loading: {
61
- type: Boolean,
62
- default: false,
63
- },
64
- virtualRef: null,
65
- virtualTriggering: {
66
- type: Boolean,
67
- default: false,
68
- },
69
- source: '',
70
- borderRadius: {
71
- type: String,
72
- default: '0px',
73
- },
74
- },
75
- emits: ['update:modelValue', 'search', 'visible-change'],
76
- setup(__props, { expose, emit }) {
77
-
78
- const props = __props;
79
-
80
- defineOptions({
81
- name: 'BwaAdvanceSelect',
82
- });
83
-
84
-
85
-
86
-
87
-
88
- const debounceDelay = useGlobalConfig('debounceDelay', 500);
89
-
90
- const filterPanelItem = inject(filterPanelItemKey, null);
91
-
92
- const { listHeight, width, showSearch, showSelection, multiple, modelValue, borderRadius } =
93
- toRefs(props);
94
-
95
- const slots = useSlots();
96
-
97
- const ns = useNamespace('advance');
98
-
99
- const states = useAdvanceSelectStates(props);
100
-
101
- const {
102
- options: optionInstances,
103
- optionsCount,
104
- search,
105
- isShowPopper,
106
- selected,
107
- } = toRefs(states);
108
-
109
- const column = computed(() => filterPanelItem?.column ?? null);
110
-
111
- const {
112
- selectedLabel,
113
- onOptionCreate,
114
- onOptionDestroy,
115
- handleClearClick,
116
- handleOptionSelect,
117
- hidePoppper,
118
- } = useAdvanceSelect(props, states, {
119
- emit,
120
- });
121
-
122
- const disabled = computed(() => !unref(isShowPopper));
123
- // console.log(column,disabled,search)
124
- const { data: itfData, loading: dataLoading } = useData(disabled, search);
125
-
126
- const loading = computed(() => props.loading || unref(dataLoading));
127
-
128
- const data = computed(() => props.options || unref(itfData));
129
-
130
- if (multiple.value && !Array.isArray(modelValue.value)) {
131
- emit('update:modelValue', []);
132
- }
133
- if (!multiple.value && Array.isArray(modelValue.value)) {
134
- emit('update:modelValue', '');
135
- }
136
-
137
- watch(isShowPopper, (isShowPopper) => {
138
- emit('visible-change', isShowPopper);
139
- });
140
-
141
- const subscription = new Observable((observer) =>
142
- watch(search, observer.next.bind(observer))
143
- )
144
- .pipe(debounceTime(unref(debounceDelay)))
145
- .subscribe(emit.bind(null, 'search'));
146
-
147
- onBeforeUnmount(subscription.unsubscribe.bind(subscription));
148
-
149
- provide(
150
- advanceSelectKey,
151
- reactive({
152
- props,
153
- options: optionInstances,
154
- selected,
155
- onOptionCreate,
156
- onOptionDestroy,
157
- handleOptionSelect,
158
- hidePoppper,
159
- select: getCurrentInstance(),
160
- })
161
- );
162
-
163
- const popperStyle = reactive({
164
- padding: '0',
165
- borderRadius,
166
- width,
167
- border: 'none',
168
- boxShadow: `0 3px 12px 0 rgb(0 0 0 / 12%), 0 0.5px 1.5px 0 rgb(0 0 0 / 8%)`,
169
- });
170
-
171
- expose({
172
- handleClearClick
173
- });
174
-
175
- return (_ctx, _cache) => {
176
- const _component_CaretBottom = resolveComponent("CaretBottom");
177
- const _component_ElIcon = resolveComponent("ElIcon");
178
- const _component_ElInput = resolveComponent("ElInput");
179
- const _component_ElButton = resolveComponent("ElButton");
180
- const _component_ElScrollbar = resolveComponent("ElScrollbar");
181
- const _component_ElTooltip = resolveComponent("ElTooltip");
182
- const _directive_loading = resolveDirective("loading");
183
-
184
- return (openBlock(), createElementBlock("div", {
185
- class: normalizeClass(unref(ns).b('select')),
186
- "data-prefix": "el",
187
- ref: "selectWrapper"
188
- }, [
189
- createVNode(_component_ElTooltip, {
190
- class: normalizeClass(unref(ns).be('select', 'tooltip')),
191
- effect: "light",
192
- trigger: "click",
193
- placement: "bottom-start",
194
- "show-arrow": false,
195
- "append-to": ".bwa-application",
196
- "popper-style": popperStyle,
197
- "popper-class": unref(ns).be('select', 'popper'),
198
- persistent: true,
199
- visible: unref(isShowPopper),
200
- "onUpdate:visible": _cache[1] || (_cache[1] = $event => (isRef(isShowPopper) ? (isShowPopper).value = $event : null)),
201
- "virtual-ref": __props.virtualRef,
202
- "virtual-triggering": __props.virtualTriggering
203
- }, {
204
- default: withCtx(() => [
205
- renderSlot(_ctx.$slots, "reference", {
206
- label: unref(selectedLabel),
207
- column: unref(column)
208
- }, () => [
209
- (__props.source)
210
- ? (openBlock(), createElementBlock("div", {
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 __default__ = defineComponent({
20
+ name: "BwaAdvanceSelect"
21
+ });
22
+ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
23
+ props: {
24
+ ...dataProps,
25
+ options: {
26
+ type: Array
27
+ },
28
+ modelValue: {
29
+ type: [Array, String, Number, Boolean]
30
+ },
31
+ listHeight: {
32
+ type: String,
33
+ default: "300px"
34
+ },
35
+ width: {
36
+ type: String,
37
+ default: "240px"
38
+ },
39
+ multiple: {
40
+ type: Boolean,
41
+ default: true
42
+ },
43
+ multipleLimit: {
44
+ type: Number,
45
+ default: 0
46
+ },
47
+ required: {
48
+ type: Boolean,
49
+ default: false
50
+ },
51
+ showSearch: {
52
+ type: Boolean,
53
+ default: true
54
+ },
55
+ searchPlaceholder: {
56
+ type: String,
57
+ default: ""
58
+ },
59
+ showSelection: {
60
+ type: Boolean,
61
+ default: true
62
+ },
63
+ showSelectIcon: {
64
+ type: Boolean,
65
+ default: true
66
+ },
67
+ closeAfterSelection: {
68
+ typoe: Boolean,
69
+ default: false
70
+ },
71
+ loading: {
72
+ type: Boolean,
73
+ default: false
74
+ },
75
+ virtualRef: null,
76
+ virtualTriggering: {
77
+ type: Boolean,
78
+ default: false
79
+ },
80
+ source: "",
81
+ borderRadius: {
82
+ type: String,
83
+ default: "0px"
84
+ }
85
+ },
86
+ emits: ["update:modelValue", "search", "visible-change"],
87
+ setup(__props, { expose: __expose, emit: __emit }) {
88
+ ;
89
+ const props = __props;
90
+ const emit = __emit;
91
+ const debounceDelay = useGlobalConfig("debounceDelay", 500);
92
+ const filterPanelItem = inject(filterPanelItemKey, null);
93
+ const { listHeight, width, showSearch, showSelection, multiple, modelValue, borderRadius } = toRefs(props);
94
+ const slots = useSlots();
95
+ const ns = useNamespace("advance");
96
+ const states = useAdvanceSelectStates(props);
97
+ const {
98
+ options: optionInstances,
99
+ optionsCount,
100
+ search,
101
+ isShowPopper,
102
+ selected
103
+ } = toRefs(states);
104
+ const column = computed(() => {
105
+ var _a;
106
+ return (_a = filterPanelItem == null ? void 0 : filterPanelItem.column) != null ? _a : null;
107
+ });
108
+ const {
109
+ selectedLabel,
110
+ onOptionCreate,
111
+ onOptionDestroy,
112
+ handleClearClick,
113
+ handleOptionSelect,
114
+ hidePoppper
115
+ } = useAdvanceSelect(props, states, {
116
+ emit
117
+ });
118
+ const disabled = computed(() => !unref(isShowPopper));
119
+ const { data: itfData, loading: dataLoading } = useData(disabled, search);
120
+ const loading = computed(() => props.loading || unref(dataLoading));
121
+ const data = computed(() => props.options || unref(itfData));
122
+ if (multiple.value && !Array.isArray(modelValue.value)) {
123
+ emit("update:modelValue", []);
124
+ }
125
+ if (!multiple.value && Array.isArray(modelValue.value)) {
126
+ emit("update:modelValue", "");
127
+ }
128
+ watch(isShowPopper, (isShowPopper2) => {
129
+ emit("visible-change", isShowPopper2);
130
+ });
131
+ const subscription = new Observable(
132
+ (observer) => watch(search, observer.next.bind(observer))
133
+ ).pipe(debounceTime(unref(debounceDelay))).subscribe(emit.bind(null, "search"));
134
+ onBeforeUnmount(subscription.unsubscribe.bind(subscription));
135
+ provide(
136
+ advanceSelectKey,
137
+ reactive({
138
+ props,
139
+ options: optionInstances,
140
+ selected,
141
+ onOptionCreate,
142
+ onOptionDestroy,
143
+ handleOptionSelect,
144
+ hidePoppper,
145
+ select: getCurrentInstance()
146
+ })
147
+ );
148
+ const popperStyle = reactive({
149
+ padding: "0",
150
+ borderRadius,
151
+ width,
152
+ border: "none",
153
+ boxShadow: `0 3px 12px 0 rgb(0 0 0 / 12%), 0 0.5px 1.5px 0 rgb(0 0 0 / 8%)`
154
+ });
155
+ __expose({
156
+ handleClearClick
157
+ });
158
+ return (_ctx, _cache) => {
159
+ const _component_CaretBottom = resolveComponent("CaretBottom");
160
+ const _component_ElIcon = resolveComponent("ElIcon");
161
+ const _component_ElInput = resolveComponent("ElInput");
162
+ const _component_ElButton = resolveComponent("ElButton");
163
+ const _component_ElScrollbar = resolveComponent("ElScrollbar");
164
+ const _component_ElTooltip = resolveComponent("ElTooltip");
165
+ const _directive_loading = resolveDirective("loading");
166
+ return openBlock(), createElementBlock("div", {
167
+ class: normalizeClass(unref(ns).b("select")),
168
+ "data-prefix": "el",
169
+ ref: "selectWrapper"
170
+ }, [
171
+ createVNode(_component_ElTooltip, {
172
+ class: normalizeClass(unref(ns).be("select", "tooltip")),
173
+ effect: "light",
174
+ trigger: "click",
175
+ placement: "bottom-start",
176
+ "show-arrow": false,
177
+ "append-to": ".bwa-application",
178
+ "popper-style": popperStyle,
179
+ "popper-class": unref(ns).be("select", "popper"),
180
+ persistent: true,
181
+ visible: unref(isShowPopper),
182
+ "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => isRef(isShowPopper) ? isShowPopper.value = $event : null),
183
+ "virtual-ref": __props.virtualRef,
184
+ "virtual-triggering": __props.virtualTriggering
185
+ }, {
186
+ default: withCtx(() => [
187
+ renderSlot(_ctx.$slots, "reference", {
188
+ label: unref(selectedLabel),
189
+ column: column.value
190
+ }, () => [
191
+ __props.source ? (openBlock(), createElementBlock("div", {
211
192
  key: 0,
212
- class: normalizeClass([
213
- unref(ns).be('select', 'pct-reference'),
214
- unref(ns).is('active', unref(isShowPopper)),
215
- ])
193
+ class: normalizeClass([
194
+ unref(ns).be("select", "pct-reference"),
195
+ unref(ns).is("active", unref(isShowPopper))
196
+ ])
216
197
  }, [
217
198
  renderSlot(_ctx.$slots, "reference-content", {
218
199
  label: unref(selectedLabel),
219
- column: unref(column),
200
+ column: column.value,
220
201
  selected: unref(selected)
221
202
  }, () => [
222
203
  renderSlot(_ctx.$slots, "label", {}, () => [
223
- (unref(column))
224
- ? (openBlock(), createElementBlock("span", {
225
- key: 0,
226
- class: normalizeClass(unref(ns).be('select', 'label'))
227
- }, toDisplayString(unref(column).title), 3 /* TEXT, CLASS */))
228
- : createCommentVNode("v-if", true)
204
+ column.value ? (openBlock(), createElementBlock("span", {
205
+ key: 0,
206
+ class: normalizeClass(unref(ns).be("select", "label"))
207
+ }, toDisplayString(column.value.title), 3)) : createCommentVNode("v-if", true)
229
208
  ]),
230
209
  renderSlot(_ctx.$slots, "value", { selected: unref(selected) }, () => [
231
- (unref(multiple))
232
- ? (openBlock(), createElementBlock("span", {
233
- key: 0,
234
- class: normalizeClass(unref(ns).be('select', 'content'))
235
- }, toDisplayString(unref(selectedLabel).length ? unref(selectedLabel).join(',') : '全部'), 3 /* TEXT, CLASS */))
236
- : (openBlock(), createElementBlock("span", {
237
- key: 1,
238
- class: normalizeClass(unref(ns).be('select', 'content'))
239
- }, toDisplayString(unref(selectedLabel) ? unref(selectedLabel) : '全部'), 3 /* TEXT, CLASS */))
210
+ unref(multiple) ? (openBlock(), createElementBlock("span", {
211
+ key: 0,
212
+ class: normalizeClass(unref(ns).be("select", "content"))
213
+ }, toDisplayString(unref(selectedLabel).length ? unref(selectedLabel).join(",") : "\u5168\u90E8"), 3)) : (openBlock(), createElementBlock("span", {
214
+ key: 1,
215
+ class: normalizeClass(unref(ns).be("select", "content"))
216
+ }, toDisplayString(unref(selectedLabel) ? unref(selectedLabel) : "\u5168\u90E8"), 3))
240
217
  ]),
241
- (__props.showSelectIcon)
242
- ? (openBlock(), createBlock(_component_ElIcon, {
243
- key: 0,
244
- class: normalizeClass(unref(ns).be('select', 'caret'))
245
- }, {
246
- default: withCtx(() => [
247
- renderSlot(_ctx.$slots, "icon", {}, () => [
248
- createVNode(_component_CaretBottom)
249
- ])
250
- ]),
251
- _: 3 /* FORWARDED */
252
- }, 8 /* PROPS */, ["class"]))
253
- : createCommentVNode("v-if", true)
218
+ __props.showSelectIcon ? (openBlock(), createBlock(_component_ElIcon, {
219
+ key: 0,
220
+ class: normalizeClass(unref(ns).be("select", "caret"))
221
+ }, {
222
+ default: withCtx(() => [
223
+ renderSlot(_ctx.$slots, "icon", {}, () => [
224
+ createVNode(_component_CaretBottom)
225
+ ])
226
+ ]),
227
+ _: 3
228
+ }, 8, ["class"])) : createCommentVNode("v-if", true)
254
229
  ])
255
- ], 2 /* CLASS */))
256
- : (openBlock(), createElementBlock("div", {
230
+ ], 2)) : (openBlock(), createElementBlock("div", {
257
231
  key: 1,
258
- class: normalizeClass([
259
- unref(ns).be('select', 'reference'),
260
- unref(ns).is('active', unref(isShowPopper)),
261
- ])
232
+ class: normalizeClass([
233
+ unref(ns).be("select", "reference"),
234
+ unref(ns).is("active", unref(isShowPopper))
235
+ ])
262
236
  }, [
263
237
  renderSlot(_ctx.$slots, "reference-content", {
264
238
  label: unref(selectedLabel),
265
- column: unref(column),
239
+ column: column.value,
266
240
  selected: unref(selected)
267
241
  }, () => [
268
242
  renderSlot(_ctx.$slots, "label", {}, () => [
269
- (unref(column))
270
- ? (openBlock(), createElementBlock("span", {
271
- key: 0,
272
- class: normalizeClass(unref(ns).be('select', 'label'))
273
- }, toDisplayString(unref(column).title), 3 /* TEXT, CLASS */))
274
- : createCommentVNode("v-if", true)
243
+ column.value ? (openBlock(), createElementBlock("span", {
244
+ key: 0,
245
+ class: normalizeClass(unref(ns).be("select", "label"))
246
+ }, toDisplayString(column.value.title), 3)) : createCommentVNode("v-if", true)
275
247
  ]),
276
248
  renderSlot(_ctx.$slots, "value", { selected: unref(selected) }, () => [
277
- (unref(multiple))
278
- ? (openBlock(), createElementBlock("span", {
279
- key: 0,
280
- class: normalizeClass(unref(ns).be('select', 'content'))
281
- }, toDisplayString(unref(selectedLabel).length ? unref(selectedLabel).join(',') : '全部'), 3 /* TEXT, CLASS */))
282
- : (openBlock(), createElementBlock("span", {
283
- key: 1,
284
- class: normalizeClass(unref(ns).be('select', 'content'))
285
- }, toDisplayString(unref(selectedLabel) ? unref(selectedLabel) : '全部'), 3 /* TEXT, CLASS */))
249
+ unref(multiple) ? (openBlock(), createElementBlock("span", {
250
+ key: 0,
251
+ class: normalizeClass(unref(ns).be("select", "content"))
252
+ }, toDisplayString(unref(selectedLabel).length ? unref(selectedLabel).join(",") : "\u5168\u90E8"), 3)) : (openBlock(), createElementBlock("span", {
253
+ key: 1,
254
+ class: normalizeClass(unref(ns).be("select", "content"))
255
+ }, toDisplayString(unref(selectedLabel) ? unref(selectedLabel) : "\u5168\u90E8"), 3))
286
256
  ])
287
257
  ]),
288
- (__props.showSelectIcon)
289
- ? (openBlock(), createBlock(_component_ElIcon, {
290
- key: 0,
291
- class: normalizeClass(unref(ns).be('select', 'caret'))
292
- }, {
293
- default: withCtx(() => [
294
- renderSlot(_ctx.$slots, "icon", {}, () => [
295
- createVNode(_component_CaretBottom)
296
- ])
297
- ]),
298
- _: 3 /* FORWARDED */
299
- }, 8 /* PROPS */, ["class"]))
300
- : createCommentVNode("v-if", true)
301
- ], 2 /* CLASS */))
302
- ])
303
- ]),
304
- content: withCtx(() => [
305
- createElementVNode("div", {
306
- class: normalizeClass([unref(ns).be('select', 'content'), unref(ns).is('single', !unref(multiple))]),
307
- style: {'margin': '6px'}
308
- }, [
309
- renderSlot(_ctx.$slots, "contentTop"),
310
- (unref(showSearch))
311
- ? (openBlock(), createElementBlock("div", {
258
+ __props.showSelectIcon ? (openBlock(), createBlock(_component_ElIcon, {
259
+ key: 0,
260
+ class: normalizeClass(unref(ns).be("select", "caret"))
261
+ }, {
262
+ default: withCtx(() => [
263
+ renderSlot(_ctx.$slots, "icon", {}, () => [
264
+ createVNode(_component_CaretBottom)
265
+ ])
266
+ ]),
267
+ _: 3
268
+ }, 8, ["class"])) : createCommentVNode("v-if", true)
269
+ ], 2))
270
+ ])
271
+ ]),
272
+ content: withCtx(() => [
273
+ createElementVNode("div", {
274
+ class: normalizeClass([unref(ns).be("select", "content"), unref(ns).is("single", !unref(multiple))]),
275
+ style: { "margin": "6px" }
276
+ }, [
277
+ renderSlot(_ctx.$slots, "contentTop"),
278
+ unref(showSearch) ? (openBlock(), createElementBlock("div", {
312
279
  key: 0,
313
- class: normalizeClass(unref(ns).be('select', 'input-wrapper'))
280
+ class: normalizeClass(unref(ns).be("select", "input-wrapper"))
314
281
  }, [
315
282
  createVNode(_component_ElInput, {
316
283
  modelValue: unref(search),
317
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (isRef(search) ? (search).value = $event : null)),
318
- class: normalizeClass(unref(ns).be('select', 'input')),
284
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(search) ? search.value = $event : null),
285
+ class: normalizeClass(unref(ns).be("select", "input")),
319
286
  placeholder: __props.searchPlaceholder,
320
287
  type: "text",
321
288
  "prefix-icon": "Search",
322
289
  clearable: ""
323
- }, null, 8 /* PROPS */, ["modelValue", "class", "placeholder"])
324
- ], 2 /* CLASS */))
325
- : createCommentVNode("v-if", true),
326
- createElementVNode("div", {
327
- class: normalizeClass(unref(ns).be('select', 'operation-wrapper'))
328
- }, [
329
- (unref(multiple) || !__props.required)
330
- ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
331
- (unref(showSelection))
332
- ? (openBlock(), createBlock(AdvanceOperation, {
290
+ }, null, 8, ["modelValue", "class", "placeholder"])
291
+ ], 2)) : createCommentVNode("v-if", true),
292
+ createElementVNode("div", {
293
+ class: normalizeClass(unref(ns).be("select", "operation-wrapper"))
294
+ }, [
295
+ unref(multiple) || !__props.required ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
296
+ unref(showSelection) ? (openBlock(), createBlock(AdvanceOperation, {
297
+ key: 0,
298
+ class: normalizeClass(unref(ns).be("select", "selection-wrapper")),
299
+ type: "selection",
300
+ border: true
301
+ }, {
302
+ default: withCtx(() => [
303
+ unref(multiple) ? (openBlock(), createElementBlock("span", {
333
304
  key: 0,
334
- class: normalizeClass(unref(ns).be('select', 'selection-wrapper')),
335
- type: "selection",
336
- border: true
305
+ class: normalizeClass([
306
+ unref(ns).be("select", "selection"),
307
+ unref(ns).is("has-selected", !!unref(selected).length)
308
+ ])
309
+ }, " \u5DF2\u9009" + toDisplayString(unref(selected).length) + "\u9879 ", 3)) : createCommentVNode("v-if", true),
310
+ !__props.required ? (openBlock(), createBlock(_component_ElButton, {
311
+ key: 1,
312
+ link: "",
313
+ type: "primary",
314
+ class: normalizeClass(unref(ns).be("select", "clear")),
315
+ onClick: unref(handleClearClick)
337
316
  }, {
338
- default: withCtx(() => [
339
- (unref(multiple))
340
- ? (openBlock(), createElementBlock("span", {
341
- key: 0,
342
- class: normalizeClass([
343
- unref(ns).be('select', 'selection'),
344
- unref(ns).is('has-selected', !!unref(selected).length),
317
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [
318
+ createTextVNode(" \u6E05\u9664\u9009\u9879 ", -1)
319
+ ])]),
320
+ _: 1
321
+ }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
322
+ ]),
323
+ _: 1
324
+ }, 8, ["class"])) : createCommentVNode("v-if", true)
325
+ ], 64)) : createCommentVNode("v-if", true),
326
+ renderSlot(_ctx.$slots, "operation")
327
+ ], 2),
328
+ withDirectives((openBlock(), createElementBlock("div", {
329
+ class: normalizeClass(unref(ns).be("select", "list"))
330
+ }, [
331
+ createVNode(_component_ElScrollbar, { "max-height": unref(listHeight) }, {
332
+ default: withCtx(() => [
333
+ renderSlot(_ctx.$slots, "default", {}, () => [
334
+ (openBlock(true), createElementBlock(Fragment, null, renderList(data.value, (item) => {
335
+ return openBlock(), createBlock(BwaAdvanceOption, {
336
+ key: item.value,
337
+ value: item.value,
338
+ label: item.label
339
+ }, null, 8, ["value", "label"]);
340
+ }), 128))
345
341
  ])
346
- }, " 已选" + toDisplayString(unref(selected).length) + "项 ", 3 /* TEXT, CLASS */))
347
- : createCommentVNode("v-if", true),
348
- (!__props.required)
349
- ? (openBlock(), createBlock(_component_ElButton, {
350
- key: 1,
351
- link: "",
352
- type: "primary",
353
- class: normalizeClass(unref(ns).be('select', 'clear')),
354
- onClick: unref(handleClearClick)
355
- }, {
356
- default: withCtx(() => [
357
- createTextVNode(" 清除选项 ")
358
- ]),
359
- _: 1 /* STABLE */
360
- }, 8 /* PROPS */, ["class", "onClick"]))
361
- : createCommentVNode("v-if", true)
362
- ]),
363
- _: 1 /* STABLE */
364
- }, 8 /* PROPS */, ["class"]))
365
- : createCommentVNode("v-if", true)
366
- ], 64 /* STABLE_FRAGMENT */))
367
- : createCommentVNode("v-if", true),
368
- renderSlot(_ctx.$slots, "operation")
369
- ], 2 /* CLASS */),
370
- withDirectives((openBlock(), createElementBlock("div", {
371
- class: normalizeClass(unref(ns).be('select', 'list'))
372
- }, [
373
- createVNode(_component_ElScrollbar, { "max-height": unref(listHeight) }, {
374
- default: withCtx(() => [
375
- renderSlot(_ctx.$slots, "default", {}, () => [
376
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(data), (item) => {
377
- return (openBlock(), createBlock(BwaAdvanceOption, {
378
- key: item.value,
379
- value: item.value,
380
- label: item.label
381
- }, null, 8 /* PROPS */, ["value", "label"]))
382
- }), 128 /* KEYED_FRAGMENT */))
383
- ])
384
- ]),
385
- _: 3 /* FORWARDED */
386
- }, 8 /* PROPS */, ["max-height"]),
387
- (!unref(optionsCount))
388
- ? renderSlot(_ctx.$slots, "empy", { key: 0 }, () => [
342
+ ]),
343
+ _: 3
344
+ }, 8, ["max-height"]),
345
+ !unref(optionsCount) ? renderSlot(_ctx.$slots, "empy", { key: 0 }, () => [
389
346
  createElementVNode("div", {
390
- class: normalizeClass(unref(ns).be('select', 'empty'))
391
- }, "未匹配到相关条目", 2 /* CLASS */)
392
- ])
393
- : createCommentVNode("v-if", true)
394
- ], 2 /* CLASS */)), [
395
- [_directive_loading, unref(loading)]
396
- ]),
397
- (unref(slots).contentBottom)
398
- ? (openBlock(), createElementBlock("div", {
347
+ class: normalizeClass(unref(ns).be("select", "empty"))
348
+ }, "\u672A\u5339\u914D\u5230\u76F8\u5173\u6761\u76EE", 2)
349
+ ]) : createCommentVNode("v-if", true)
350
+ ], 2)), [
351
+ [_directive_loading, loading.value]
352
+ ]),
353
+ unref(slots).contentBottom ? (openBlock(), createElementBlock("div", {
399
354
  key: 1,
400
- class: normalizeClass(unref(ns).be('select', 'bottom')),
401
- style: normalizeStyle({'boxShadow': __props.source ? 'none': '', 'padding': __props.source ? '0': '4px 0px',})
355
+ class: normalizeClass(unref(ns).be("select", "bottom")),
356
+ style: normalizeStyle({ "boxShadow": __props.source ? "none" : "", "padding": __props.source ? "0" : "4px 0px" })
402
357
  }, [
403
358
  renderSlot(_ctx.$slots, "contentBottom")
404
- ], 6 /* CLASS, STYLE */))
405
- : createCommentVNode("v-if", true)
406
- ], 2 /* CLASS */)
407
- ]),
408
- _: 3 /* FORWARDED */
409
- }, 8 /* PROPS */, ["class", "popper-style", "popper-class", "visible", "virtual-ref", "virtual-triggering"])
410
- ], 2 /* CLASS */))
411
- }
412
- }
413
-
414
- };
415
- var BwaAdvanceSelect = /*#__PURE__*/_export_sfc(_sfc_main, [['__file',"advance-select.vue"]]);
359
+ ], 6)) : createCommentVNode("v-if", true)
360
+ ], 2)
361
+ ]),
362
+ _: 3
363
+ }, 8, ["class", "popper-style", "popper-class", "visible", "virtual-ref", "virtual-triggering"])
364
+ ], 2);
365
+ };
366
+ }
367
+ });
368
+ var BwaAdvanceSelect = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "advance-select.vue"]]);
416
369
 
417
370
  export { BwaAdvanceSelect as default };