cnhis-design-vue 3.1.31-beta.0 → 3.1.31-beta.10

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 (219) hide show
  1. package/es/components/big-table/index.js +1 -1
  2. package/es/components/big-table/src/{BigTable.js → BigTable.vue.js} +1 -1
  3. package/es/components/big-table/src/{BigTable.vue_vue_type_script_setup_true_lang.js → BigTable.vue2.js} +6 -6
  4. package/es/components/{scale-view/src/components/NoData.js → big-table/src/components/NoData.vue.js} +4 -4
  5. package/es/components/big-table/src/components/edit-form/{edit-separate.js → edit-separate.vue.js} +1 -1
  6. package/es/components/big-table/src/components/{input-button.js → input-button.vue.js} +0 -0
  7. package/es/components/big-table/src/components/{separate.js → separate.vue.js} +0 -0
  8. package/es/components/big-table/src/hooks/useEdit.js +1 -1
  9. package/es/components/big-table/src/utils.js +1 -1
  10. package/es/components/bpmn-workflow/index.js +1 -1
  11. package/es/components/bpmn-workflow/src/{BpmnWorkflow.js → BpmnWorkflow.vue.js} +0 -0
  12. package/es/components/button-print/index.d.ts +76 -79
  13. package/es/components/button-print/index.js +2 -2
  14. package/es/components/button-print/src/ButtonPrint.vue.d.ts +76 -79
  15. package/es/components/button-print/src/{ButtonPrint.js → ButtonPrint.vue.js} +1 -1
  16. package/es/components/button-print/src/{ButtonPrint.vue_vue_type_script_setup_true_lang.js → ButtonPrint.vue2.js} +47 -85
  17. package/es/components/button-print/src/components/{edit.vue.d.ts → EditFormat.vue.d.ts} +61 -54
  18. package/es/components/button-print/src/components/EditFormat.vue.js +173 -0
  19. package/es/components/button-print/src/components/IdentityVerification.vue.d.ts +76 -64
  20. package/es/components/button-print/src/components/{IdentityVerification.js → IdentityVerification.vue.js} +22 -10
  21. package/es/components/button-print/src/components/Preview.vue.d.ts +41 -0
  22. package/es/components/button-print/src/components/Preview.vue.js +6 -0
  23. package/es/components/button-print/src/components/Preview.vue2.js +67 -0
  24. package/es/components/button-print/src/utils/browserPrint.d.ts +2 -1
  25. package/es/components/button-print/src/utils/browserPrint.js +6 -3
  26. package/es/components/button-print/src/utils/dialog.d.ts +6 -2
  27. package/es/components/button-print/src/utils/dialog.js +69 -25
  28. package/es/components/button-print/src/utils/index.js +1 -1
  29. package/es/components/button-print/src/utils/print.d.ts +7 -3
  30. package/es/components/button-print/src/utils/print.js +51 -4
  31. package/es/components/button-print/style/index.css +1 -1
  32. package/es/components/drag-layout/index.js +1 -1
  33. package/es/components/drag-layout/src/{DragFormLeftItem.js → DragFormLeftItem.vue.js} +0 -0
  34. package/es/components/drag-layout/src/{DragFormRightItem.js → DragFormRightItem.vue.js} +0 -0
  35. package/es/components/drag-layout/src/{DragLayout.js → DragLayout.vue.js} +2 -2
  36. package/es/components/fabric-chart/index.js +1 -1
  37. package/es/components/fabric-chart/src/{FabricChart.js → FabricChart.vue.js} +1 -1
  38. package/es/components/fabric-chart/src/components/{PopupTip.js → PopupTip.vue.js} +0 -0
  39. package/es/components/fabric-chart/src/hooks/useCenter.js +5 -6
  40. package/es/components/fabric-chart/src/hooks/useGrid.js +3 -3
  41. package/es/components/fabric-chart/src/interface.d.ts +1 -1
  42. package/es/components/fabric-chart/src/utils/index.js +0 -1
  43. package/es/components/field-set/index.js +1 -1
  44. package/es/components/field-set/src/{FieldSet.js → FieldSet.vue.js} +0 -0
  45. package/es/components/form-config/index.js +1 -1
  46. package/es/components/form-config/src/{FormConfig.js → FormConfig.vue.js} +3 -3
  47. package/es/components/form-config/src/components/{FormConfigCreator.js → FormConfigCreator.vue.js} +0 -0
  48. package/es/components/form-config/src/components/{FormConfigDragDisplay.js → FormConfigDragDisplay.vue.js} +0 -0
  49. package/es/components/form-config/src/components/{FormConfigEdit.js → FormConfigEdit.vue.js} +0 -0
  50. package/es/components/form-config/src/components/index.js +6 -6
  51. package/es/components/form-config/src/components/renderer/{CloseButton.js → CloseButton.vue.js} +0 -0
  52. package/es/components/form-config/src/components/renderer/{ComplexNode.js → ComplexNode.vue.js} +2 -2
  53. package/es/components/form-config/src/components/renderer/{DefaultNode.js → DefaultNode.vue.js} +1 -1
  54. package/es/components/form-config/src/components/renderer/index.js +3 -3
  55. package/es/components/form-config/src/hooks/usePresetRenderer.js +2 -2
  56. package/es/components/form-render/index.js +2 -2
  57. package/es/components/form-render/src/{FormRender.js → FormRender.vue.js} +0 -0
  58. package/es/components/form-render/src/{FormRenderWrapper.js → FormRenderWrapper.vue.js} +1 -1
  59. package/es/components/form-render/src/components/renderer/checkbox.js +3 -5
  60. package/es/components/form-render/src/components/renderer/index.js +2 -0
  61. package/es/components/form-render/src/components/renderer/jsonCombination/index.js +1 -1
  62. package/es/components/form-render/src/components/renderer/levelSearchCascader.js +1 -1
  63. package/es/components/form-render/src/components/renderer/lineBar/{FormCollapse.js → FormCollapse.vue.js} +0 -0
  64. package/es/components/form-render/src/components/renderer/lineBar/index.js +1 -1
  65. package/es/components/form-render/src/components/renderer/recommendSelect.d.ts +131 -0
  66. package/es/components/form-render/src/components/renderer/recommendSelect.js +213 -0
  67. package/es/components/form-render/src/components/renderer/remoteSearch.js +0 -1
  68. package/es/components/form-render/src/components/renderer/select.js +3 -5
  69. package/es/components/form-render/src/hooks/useAsyncQueue.js +2 -1
  70. package/es/components/form-render/src/hooks/useAutographOptions.js +5 -7
  71. package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +3 -2
  72. package/es/components/form-render/src/hooks/useBusinessBinding.js +20 -17
  73. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +7 -0
  74. package/es/components/form-render/src/hooks/useFormRequest.d.ts +8 -1
  75. package/es/components/form-render/src/hooks/useFormRequest.js +24 -1
  76. package/es/components/form-render/src/utils/index.d.ts +2 -2
  77. package/es/components/form-render/src/utils/index.js +27 -3
  78. package/es/components/form-render/style/index.css +1 -1
  79. package/es/components/iho-table/index.d.ts +160 -102
  80. package/es/components/iho-table/index.js +1 -2
  81. package/es/components/iho-table/src/IhoTable.vue.d.ts +160 -102
  82. package/es/components/iho-table/src/{IhoTable.js → IhoTable.vue.js} +2 -1
  83. package/es/components/iho-table/src/components/IhoTableColumn.js +14 -11
  84. package/es/components/iho-table/src/constants/index.d.ts +5 -3
  85. package/es/components/iho-table/src/constants/index.js +5 -3
  86. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +64 -5
  87. package/es/components/iho-table/src/hooks/tapHooks/index.js +17 -9
  88. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +60 -1
  89. package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +5 -3
  90. package/es/components/iho-table/src/hooks/useTableContext.d.ts +1 -1
  91. package/es/components/iho-table/src/plugins/anchorPlugin/useAnchor.js +3 -2
  92. package/es/components/iho-table/src/plugins/filterPlugin/filter.vue.d.ts +1 -1
  93. package/es/components/iho-table/src/plugins/filterPlugin/{filter.js → filter.vue.js} +1 -0
  94. package/es/components/iho-table/src/plugins/filterPlugin/index.js +1 -1
  95. package/es/components/iho-table/src/plugins/index.js +14 -12
  96. package/es/components/iho-table/src/plugins/keyboardEventPlugin/index.d.ts +1 -0
  97. package/es/components/iho-table/src/plugins/keyboardEventPlugin/index.js +32 -0
  98. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +1 -1
  99. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/{editDate.js → editDate.vue.js} +0 -0
  100. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +10 -12
  101. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.js +11 -15
  102. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +17 -24
  103. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +11 -13
  104. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/editSeparate.vue.d.ts +1 -1
  105. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/{editSeparate.js → editSeparate.vue.js} +2 -1
  106. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +9 -12
  107. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin.js +13 -17
  108. package/es/components/iho-table/src/types/index.d.ts +6 -6
  109. package/es/components/iho-table/src/types/pluginType.d.ts +2 -1
  110. package/es/components/iho-table/src/utils/index.d.ts +12 -2
  111. package/es/components/iho-table/src/utils/index.js +33 -2
  112. package/es/components/iho-table/style/index.css +1 -1
  113. package/es/components/index.css +1 -1
  114. package/es/components/index.d.ts +2 -1
  115. package/es/components/index.js +6 -3
  116. package/es/components/info-header/index.js +1 -1
  117. package/es/components/info-header/src/{HiddenContent.js → HiddenContent.vue.js} +1 -1
  118. package/es/components/info-header/src/{InfoEllipsis.js → InfoEllipsis.vue.js} +0 -0
  119. package/es/components/info-header/src/{InfoHeader.js → InfoHeader.vue.js} +2 -2
  120. package/es/components/keyboard/index.d.ts +146 -78
  121. package/es/components/keyboard/index.js +1 -1
  122. package/es/components/keyboard/src/Keyboard.vue.d.ts +155 -78
  123. package/es/components/keyboard/src/Keyboard.vue.js +149 -0
  124. package/es/components/keyboard/src/components/InputNumber.vue.d.ts +6 -4
  125. package/es/components/keyboard/src/components/{InputNumber.js → InputNumber.vue.js} +0 -0
  126. package/es/components/keyboard/src/components/NumberPanel.vue.d.ts +118 -0
  127. package/es/components/keyboard/src/components/NumberPanel.vue.js +206 -0
  128. package/es/components/map/index.js +1 -1
  129. package/es/components/map/src/{Map.js → Map.vue.js} +0 -0
  130. package/es/components/recommend-search/index.d.ts +813 -0
  131. package/es/components/recommend-search/index.js +10 -0
  132. package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +815 -0
  133. package/es/components/recommend-search/src/RecommendSearch.vue.js +62 -0
  134. package/es/components/recommend-search/src/components/BaseSearch.vue.d.ts +119 -0
  135. package/es/components/recommend-search/src/components/BaseSearch.vue.js +148 -0
  136. package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +303 -0
  137. package/es/components/recommend-search/src/components/RecommendInput.vue.js +103 -0
  138. package/es/components/recommend-search/src/components/RecommendMenu.vue.d.ts +63 -0
  139. package/es/components/recommend-search/src/components/RecommendMenu.vue.js +104 -0
  140. package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +350 -0
  141. package/es/components/recommend-search/src/components/RecommendSelect.vue.js +156 -0
  142. package/es/components/recommend-search/src/constant/index.d.ts +4 -0
  143. package/es/components/recommend-search/src/constant/index.js +7 -0
  144. package/es/components/recommend-search/src/types/index.d.ts +9 -0
  145. package/es/components/recommend-search/src/types/index.js +1 -0
  146. package/es/components/recommend-search/style/index.css +1 -0
  147. package/es/components/scale-view/index.js +1 -1
  148. package/es/components/scale-view/src/{ScaleView.js → ScaleView.vue.js} +5 -5
  149. package/es/components/scale-view/src/components/{AnswerParse.js → AnswerParse.vue.js} +1 -1
  150. package/es/components/scale-view/src/components/{EvaluateCountdown.js → EvaluateCountdown.vue.js} +1 -1
  151. package/es/components/scale-view/src/components/{EvaluatePage.js → EvaluatePage.vue.js} +0 -0
  152. package/es/components/scale-view/src/components/{LoadingCom.js → LoadingCom.vue.js} +0 -0
  153. package/es/components/{big-table/src/components/NoData.js → scale-view/src/components/NoData.vue.js} +4 -4
  154. package/es/components/scale-view/src/components/formitem/r-cascader.js +1 -1
  155. package/es/components/scale-view/src/components/formitem/r-select.js +1 -1
  156. package/es/components/scale-view/src/hooks/use-component.js +1 -1
  157. package/es/components/search-cascader/index.js +1 -1
  158. package/es/components/search-cascader/src/{SearchCascader.js → SearchCascader.vue.js} +0 -0
  159. package/es/components/search-cascader/src/components/SearchMenu.js +3 -3
  160. package/es/components/select-label/index.js +2 -2
  161. package/es/components/select-label/src/{LabelFormContent.js → LabelFormContent.vue.js} +1 -1
  162. package/es/components/select-label/src/{SelectLabel.js → SelectLabel.vue.js} +1 -1
  163. package/es/components/select-label/src/{SelectLabel.vue_vue_type_script_setup_true_lang.js → SelectLabel.vue2.js} +2 -2
  164. package/es/components/select-label/src/components/{label-classify.js → label-classify.vue.js} +0 -0
  165. package/es/components/select-person/index.js +1 -1
  166. package/es/components/select-person/src/{SelectPerson.js → SelectPerson.vue.js} +1 -1
  167. package/es/components/select-person/src/{SelectPerson.vue_vue_type_script_setup_true_lang.js → SelectPerson.vue2.js} +0 -0
  168. package/es/components/shortcut-provider/index.js +1 -1
  169. package/es/components/shortcut-provider/src/{ShortcutProvider.js → ShortcutProvider.vue.js} +0 -0
  170. package/es/components/shortcut-setter/index.js +1 -1
  171. package/es/components/shortcut-setter/src/{ShortcutSetter.js → ShortcutSetter.vue.js} +1 -1
  172. package/es/components/shortcut-setter/src/{ShortcutSetterItem.js → ShortcutSetterItem.vue.js} +0 -0
  173. package/es/components/steps-wheel/index.d.ts +3 -0
  174. package/es/components/steps-wheel/index.js +1 -1
  175. package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +3 -0
  176. package/es/components/steps-wheel/src/{StepsWheel.js → StepsWheel.vue.js} +38 -9
  177. package/es/components/steps-wheel/style/index.css +1 -1
  178. package/es/components/time-line/index.js +1 -1
  179. package/es/components/time-line/src/{TimeLine.js → TimeLine.vue.js} +0 -0
  180. package/es/components/vod-chunk-upload/index.js +1 -1
  181. package/es/components/vod-chunk-upload/src/{chunk-upload-new.js → chunk-upload-new.vue.js} +0 -0
  182. package/es/components/vod-chunk-upload/src/vod-chunk-upload/index.js +2 -2
  183. package/es/components/vod-chunk-upload/src/vod-chunk-upload/{vod-chunk-upload.js → vod-chunk-upload.vue.js} +3 -3
  184. package/es/components/vod-chunk-upload/src/vod-upload-modal.js +1 -1
  185. package/es/shared/assets/img/failure.js +1 -3
  186. package/es/shared/assets/img/failure.png.js +3 -0
  187. package/es/shared/assets/img/no-permission.js +1 -3
  188. package/es/shared/assets/img/no-permission.png.js +3 -0
  189. package/es/shared/assets/img/nodata.js +1 -3
  190. package/es/shared/assets/img/nodata.png.js +3 -0
  191. package/es/shared/assets/img/notfound.js +1 -3
  192. package/es/shared/assets/img/notfound.png.js +3 -0
  193. package/es/shared/assets/img/qr.js +1 -3
  194. package/es/shared/assets/img/qr.png.js +3 -0
  195. package/es/shared/assets/img/success.js +1 -3
  196. package/es/shared/assets/img/success.png.js +3 -0
  197. package/es/shared/assets/img/video.js +1 -3
  198. package/es/shared/assets/img/video.png.js +3 -0
  199. package/es/shared/assets/img/video_default_cover.js +1 -3
  200. package/es/shared/assets/img/video_default_cover.png.js +3 -0
  201. package/es/shared/assets/img/xb_big.js +1 -3
  202. package/es/shared/assets/img/xb_big.png.js +3 -0
  203. package/es/shared/assets/img/xb_small.js +1 -3
  204. package/es/shared/assets/img/xb_small.png.js +3 -0
  205. package/es/shared/components/SelectPage/{SelectPage.js → SelectPage.vue.js} +0 -0
  206. package/es/shared/components/SelectPage/index.js +2 -2
  207. package/es/shared/components/SvgIcon/{SvgIcon.js → SvgIcon.vue.js} +0 -0
  208. package/es/shared/components/SvgIcon/index.js +2 -2
  209. package/es/shared/components/TextOverTooltip/{TextOverTooltip.js → TextOverTooltip.vue.js} +0 -0
  210. package/es/shared/components/TextOverTooltip/index.js +2 -2
  211. package/es/shared/components/no-data/{NoData.js → NoData.vue.js} +4 -4
  212. package/es/shared/components/no-data/index.js +2 -2
  213. package/es/shared/utils/index.d.ts +1 -1
  214. package/es/shared/utils/index.js +3 -3
  215. package/package.json +2 -2
  216. package/es/components/button-print/src/components/edit.js +0 -142
  217. package/es/components/fabric-chart/index.d.ts +0 -207
  218. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +0 -208
  219. package/es/components/keyboard/src/Keyboard.js +0 -285
@@ -0,0 +1,62 @@
1
+ import { defineComponent, computed, openBlock, createBlock, resolveDynamicComponent, unref, mergeProps, isRef, withCtx, renderSlot } from 'vue';
2
+ import { useVModel } from '@vueuse/core';
3
+ import RecommendInput from './components/RecommendInput.vue.js';
4
+ import RecommendSelect from './components/RecommendSelect.vue.js';
5
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
6
+
7
+ const _sfc_main = /* @__PURE__ */ defineComponent({
8
+ __name: "RecommendSearch",
9
+ props: {
10
+ mode: { type: String, default: "input" },
11
+ value: { type: [String, Number] },
12
+ labelKey: { type: String, default: "label" },
13
+ valueKey: { type: String, default: "value" },
14
+ placeholder: { type: String },
15
+ editPlaceholder: { type: String, default: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57\u8FDB\u884C\u641C\u7D22" },
16
+ options: { type: Array, default: () => [] },
17
+ commonList: { type: Array, default: () => [] },
18
+ recentList: { type: Array, default: () => [] },
19
+ recommendDeletable: { type: Boolean, default: true },
20
+ inputProps: { type: Object },
21
+ popProps: { type: Object }
22
+ },
23
+ emits: [
24
+ "update:value",
25
+ "search",
26
+ "delete",
27
+ "choose",
28
+ "clear",
29
+ "openMenu",
30
+ "closeMenu"
31
+ ],
32
+ setup(__props, { emit: emits }) {
33
+ const props = __props;
34
+ const valueRef = useVModel(props, "value", emits);
35
+ const componentMap = {
36
+ input: RecommendInput,
37
+ select: RecommendSelect
38
+ };
39
+ const currentComponent = computed(() => {
40
+ return componentMap[props.mode];
41
+ });
42
+ return (_ctx, _cache) => {
43
+ return openBlock(), createBlock(resolveDynamicComponent(unref(currentComponent)), mergeProps(_ctx.$props, {
44
+ value: unref(valueRef),
45
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => isRef(valueRef) ? valueRef.value = $event : null),
46
+ onSearch: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("search", $event)),
47
+ onChoose: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("choose", $event)),
48
+ onOpenMenu: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("openMenu", $event)),
49
+ onCloseMenu: _cache[4] || (_cache[4] = ($event) => _ctx.$emit("closeMenu", $event)),
50
+ onDelete: _cache[5] || (_cache[5] = ($event) => _ctx.$emit("delete", $event))
51
+ }), {
52
+ empty: withCtx(() => [
53
+ renderSlot(_ctx.$slots, "empty")
54
+ ]),
55
+ _: 3
56
+ }, 16, ["value"]);
57
+ };
58
+ }
59
+ });
60
+ var script = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "RecommendSearch.vue"]]);
61
+
62
+ export { script as default };
@@ -0,0 +1,119 @@
1
+ import { Func } from '../../../../../es/shared/types';
2
+ import { PropType } from 'vue';
3
+ declare const _default: import("vue").DefineComponent<{
4
+ displayValue: {
5
+ type: StringConstructor;
6
+ };
7
+ valueFormatter: {
8
+ type: PropType<(value: undefined | number | string | Array<any>) => string>;
9
+ };
10
+ show: {
11
+ type: BooleanConstructor;
12
+ };
13
+ placeholder: {
14
+ type: StringConstructor;
15
+ default: string;
16
+ };
17
+ inputProps: {
18
+ type: ObjectConstructor;
19
+ default: () => {};
20
+ };
21
+ popProps: {
22
+ type: ObjectConstructor;
23
+ default: () => {};
24
+ };
25
+ clearPatternOnOpenMenu: {
26
+ type: BooleanConstructor;
27
+ default: boolean;
28
+ };
29
+ }, {
30
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
31
+ displayValue: {
32
+ type: StringConstructor;
33
+ };
34
+ valueFormatter: {
35
+ type: PropType<(value: undefined | number | string | Array<any>) => string>;
36
+ };
37
+ show: {
38
+ type: BooleanConstructor;
39
+ };
40
+ placeholder: {
41
+ type: StringConstructor;
42
+ default: string;
43
+ };
44
+ inputProps: {
45
+ type: ObjectConstructor;
46
+ default: () => {};
47
+ };
48
+ popProps: {
49
+ type: ObjectConstructor;
50
+ default: () => {};
51
+ };
52
+ clearPatternOnOpenMenu: {
53
+ type: BooleanConstructor;
54
+ default: boolean;
55
+ };
56
+ }>> & {
57
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
58
+ onClear?: ((...args: any[]) => any) | undefined;
59
+ onSearch?: ((...args: any[]) => any) | undefined;
60
+ onOpenMenu?: ((...args: any[]) => any) | undefined;
61
+ onCloseMenu?: ((...args: any[]) => any) | undefined;
62
+ }>>;
63
+ uuid: string;
64
+ emits: (event: "clear" | "update:show" | "search" | "openMenu" | "closeMenu", ...args: any[]) => void;
65
+ search: (content?: any) => void;
66
+ popoverRef: import("vue").Ref<{
67
+ syncPosition: Func;
68
+ } | undefined>;
69
+ _show: import("vue").Ref<boolean>;
70
+ show: import("vue").WritableComputedRef<boolean>;
71
+ inputRef: import("vue").Ref<HTMLElement | undefined>;
72
+ patternContent: import("vue").Ref<string>;
73
+ displayValueRef: import("vue").WritableComputedRef<string | undefined>;
74
+ openMenuAtInput: (evt: PointerEvent) => void;
75
+ openMenu: () => void;
76
+ closeMenu: () => void;
77
+ onClear: () => void;
78
+ NInput: any;
79
+ NPopover: any;
80
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "update:show" | "search" | "openMenu" | "closeMenu")[], "search" | "closeMenu" | "clear" | "update:show" | "openMenu", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
81
+ displayValue: {
82
+ type: StringConstructor;
83
+ };
84
+ valueFormatter: {
85
+ type: PropType<(value: undefined | number | string | Array<any>) => string>;
86
+ };
87
+ show: {
88
+ type: BooleanConstructor;
89
+ };
90
+ placeholder: {
91
+ type: StringConstructor;
92
+ default: string;
93
+ };
94
+ inputProps: {
95
+ type: ObjectConstructor;
96
+ default: () => {};
97
+ };
98
+ popProps: {
99
+ type: ObjectConstructor;
100
+ default: () => {};
101
+ };
102
+ clearPatternOnOpenMenu: {
103
+ type: BooleanConstructor;
104
+ default: boolean;
105
+ };
106
+ }>> & {
107
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
108
+ onClear?: ((...args: any[]) => any) | undefined;
109
+ onSearch?: ((...args: any[]) => any) | undefined;
110
+ onOpenMenu?: ((...args: any[]) => any) | undefined;
111
+ onCloseMenu?: ((...args: any[]) => any) | undefined;
112
+ }, {
113
+ show: boolean;
114
+ placeholder: string;
115
+ inputProps: Record<string, any>;
116
+ popProps: Record<string, any>;
117
+ clearPatternOnOpenMenu: boolean;
118
+ }>;
119
+ export default _default;
@@ -0,0 +1,148 @@
1
+ import { defineComponent, ref, computed, openBlock, createBlock, unref, mergeProps, isRef, withCtx, createVNode, withKeys, createElementVNode, renderSlot } from 'vue';
2
+ import { uuidGenerator } from '../../../../shared/utils/index.js';
3
+ import { useDebounceFn, onClickOutside } from '@vueuse/core';
4
+ import { NPopover, NInput } from 'naive-ui';
5
+ import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.js';
6
+
7
+ const _hoisted_1 = ["id"];
8
+ const _sfc_main = /* @__PURE__ */ defineComponent({
9
+ __name: "BaseSearch",
10
+ props: {
11
+ displayValue: { type: String },
12
+ valueFormatter: {
13
+ type: Function
14
+ },
15
+ show: { type: Boolean },
16
+ placeholder: { type: String, default: "\u8BF7\u8F93\u5165" },
17
+ inputProps: { type: Object, default: () => ({}) },
18
+ popProps: { type: Object, default: () => ({}) },
19
+ clearPatternOnOpenMenu: { type: Boolean, default: true }
20
+ },
21
+ emits: ["update:show", "clear", "search", "openMenu", "closeMenu"],
22
+ setup(__props, { expose, emit: emits }) {
23
+ const props = __props;
24
+ const uuid = uuidGenerator();
25
+ const search = useDebounceFn((content = "") => {
26
+ emits("search", content);
27
+ }, 300);
28
+ const popoverRef = ref();
29
+ const _show = ref(props.show);
30
+ const show = computed({
31
+ get() {
32
+ return _show.value || props.show;
33
+ },
34
+ set(value) {
35
+ emits("update:show", value);
36
+ _show.value = value;
37
+ }
38
+ });
39
+ const inputRef = ref();
40
+ const patternContent = ref("");
41
+ const displayValueRef = computed({
42
+ get() {
43
+ if (show.value)
44
+ return patternContent.value;
45
+ return props.displayValue;
46
+ },
47
+ set(value) {
48
+ patternContent.value = value || "";
49
+ search(value);
50
+ }
51
+ });
52
+ function openMenuAtInput(evt) {
53
+ var _a;
54
+ if (((_a = evt.target) == null ? void 0 : _a.tagName) !== "INPUT")
55
+ return;
56
+ openMenu();
57
+ }
58
+ function openMenu() {
59
+ if (show.value)
60
+ return;
61
+ show.value = true;
62
+ emits("openMenu");
63
+ if (props.clearPatternOnOpenMenu) {
64
+ patternContent.value = "";
65
+ }
66
+ }
67
+ function closeMenu() {
68
+ var _a;
69
+ show.value = false;
70
+ (_a = inputRef.value) == null ? void 0 : _a.blur();
71
+ emits("closeMenu");
72
+ }
73
+ function onClear() {
74
+ emits("clear");
75
+ }
76
+ onClickOutside(inputRef, (evt) => {
77
+ var _a;
78
+ if (!show.value)
79
+ return;
80
+ const _evt = evt;
81
+ if (!_evt.target)
82
+ return closeMenu();
83
+ if (isInPopper(_evt.target)) {
84
+ (_a = inputRef.value) == null ? void 0 : _a.focus();
85
+ return;
86
+ }
87
+ closeMenu();
88
+ function isInPopper(targetEle) {
89
+ let result = false;
90
+ let current = targetEle;
91
+ while (current) {
92
+ if (current.id === uuid) {
93
+ result = true;
94
+ break;
95
+ }
96
+ current = current.parentElement;
97
+ }
98
+ return result;
99
+ }
100
+ });
101
+ expose({
102
+ setPattern(value) {
103
+ patternContent.value = value;
104
+ },
105
+ closeMenu,
106
+ openMenu
107
+ });
108
+ return (_ctx, _cache) => {
109
+ return openBlock(), createBlock(unref(NPopover), mergeProps({
110
+ trigger: "manual",
111
+ class: "recommend-search",
112
+ placement: "bottom-start",
113
+ show: unref(show),
114
+ "onUpdate:show": _cache[1] || (_cache[1] = ($event) => isRef(show) ? show.value = $event : null),
115
+ "show-arrow": false,
116
+ ref_key: "popoverRef",
117
+ ref: popoverRef,
118
+ width: "trigger"
119
+ }, __props.popProps), {
120
+ trigger: withCtx(() => [
121
+ createVNode(unref(NInput), mergeProps(__props.inputProps, {
122
+ placeholder: __props.placeholder,
123
+ onClear,
124
+ onFocus: openMenuAtInput,
125
+ onClick: openMenuAtInput,
126
+ onKeydown: withKeys(openMenuAtInput, ["enter"]),
127
+ ref_key: "inputRef",
128
+ ref: inputRef,
129
+ value: unref(displayValueRef),
130
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => isRef(displayValueRef) ? displayValueRef.value = $event : null)
131
+ }), null, 16, ["placeholder", "onKeydown", "value"])
132
+ ]),
133
+ default: withCtx(() => [
134
+ createElementVNode("section", {
135
+ id: unref(uuid),
136
+ class: "base-search__menu"
137
+ }, [
138
+ renderSlot(_ctx.$slots, "menu")
139
+ ], 8, _hoisted_1)
140
+ ]),
141
+ _: 3
142
+ }, 16, ["show"]);
143
+ };
144
+ }
145
+ });
146
+ var BaseSearch = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "BaseSearch.vue"]]);
147
+
148
+ export { BaseSearch as default };
@@ -0,0 +1,303 @@
1
+ import { AnyObject } from '../../../../../es/shared/types';
2
+ import { PropType } from 'vue';
3
+ import { RecommendType } from '../../../../../es/components/recommend-search/src/constant';
4
+ import { BaseSearchExpose, RecommendItem } from '../../../../../es/components/recommend-search/src/types';
5
+ declare const _default: import("vue").DefineComponent<{
6
+ value: {
7
+ type: StringConstructor;
8
+ };
9
+ options: {
10
+ type: PropType<AnyObject[]>;
11
+ default: () => never[];
12
+ };
13
+ placeholder: {
14
+ type: StringConstructor;
15
+ default: string;
16
+ };
17
+ commonList: {
18
+ type: PropType<RecommendItem[]>;
19
+ default: () => never[];
20
+ };
21
+ recentList: {
22
+ type: PropType<RecommendItem[]>;
23
+ default: () => never[];
24
+ };
25
+ recommendDeletable: {
26
+ type: BooleanConstructor;
27
+ default: boolean;
28
+ };
29
+ }, {
30
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
31
+ value: {
32
+ type: StringConstructor;
33
+ };
34
+ options: {
35
+ type: PropType<AnyObject[]>;
36
+ default: () => never[];
37
+ };
38
+ placeholder: {
39
+ type: StringConstructor;
40
+ default: string;
41
+ };
42
+ commonList: {
43
+ type: PropType<RecommendItem[]>;
44
+ default: () => never[];
45
+ };
46
+ recentList: {
47
+ type: PropType<RecommendItem[]>;
48
+ default: () => never[];
49
+ };
50
+ recommendDeletable: {
51
+ type: BooleanConstructor;
52
+ default: boolean;
53
+ };
54
+ }>> & {
55
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
56
+ onDelete?: ((...args: any[]) => any) | undefined;
57
+ onClear?: ((...args: any[]) => any) | undefined;
58
+ onSearch?: ((...args: any[]) => any) | undefined;
59
+ onChoose?: ((...args: any[]) => any) | undefined;
60
+ onOpenMenu?: ((...args: any[]) => any) | undefined;
61
+ onCloseMenu?: ((...args: any[]) => any) | undefined;
62
+ }>>;
63
+ emits: (event: "delete" | "clear" | "update:value" | "search" | "choose" | "openMenu" | "closeMenu", ...args: any[]) => void;
64
+ baseSearchRef: import("vue").Ref<BaseSearchExpose | undefined>;
65
+ setPattern: (value?: string) => void;
66
+ valueRef: import("vue").Ref<string | undefined> | import("vue").WritableComputedRef<string | undefined>;
67
+ parsedOptions: import("vue").ComputedRef<AnyObject[]>;
68
+ search: (value: string) => void;
69
+ onOpenMenu: () => void;
70
+ onCloseMenu: () => void;
71
+ onChoose: ({ type, value }: {
72
+ type?: RecommendType | undefined;
73
+ value: RecommendItem;
74
+ }) => void;
75
+ list: import("vue").Ref<import("@vueuse/core").UseVirtualListItem<AnyObject>[]>;
76
+ wrapperProps: import("vue").ComputedRef<{
77
+ style: {
78
+ width: string;
79
+ height: string;
80
+ marginTop: string;
81
+ };
82
+ }>;
83
+ containerProps: {
84
+ ref: import("vue").Ref<any>;
85
+ onScroll: () => void;
86
+ style: Partial<CSSStyleDeclaration>;
87
+ };
88
+ RecommendMenu: import("vue").DefineComponent<{
89
+ getDisplayValue: {
90
+ type: FunctionConstructor;
91
+ required: false;
92
+ default: (item: RecommendItem) => string;
93
+ };
94
+ commonList: {
95
+ type: ArrayConstructor;
96
+ required: true;
97
+ default: () => never[];
98
+ };
99
+ recentList: {
100
+ type: ArrayConstructor;
101
+ required: true;
102
+ default: () => never[];
103
+ };
104
+ deletable: {
105
+ type: BooleanConstructor;
106
+ required: false;
107
+ };
108
+ }, {
109
+ emits: (event: "delete" | "choose", ...args: any[]) => void;
110
+ clickTag: (type: RecommendType, value: RecommendItem) => void;
111
+ clickCommonTag: (value: RecommendItem) => void;
112
+ clickRecentTag: (value: RecommendItem) => void;
113
+ deleteTag: (type: RecommendType) => void;
114
+ deleteCommonTag: () => void;
115
+ deleteRecentTag: () => void;
116
+ TrashOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
117
+ NTag: any;
118
+ NIcon: any;
119
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("delete" | "choose")[], "delete" | "choose", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
120
+ getDisplayValue: {
121
+ type: FunctionConstructor;
122
+ required: false;
123
+ default: (item: RecommendItem) => string;
124
+ };
125
+ commonList: {
126
+ type: ArrayConstructor;
127
+ required: true;
128
+ default: () => never[];
129
+ };
130
+ recentList: {
131
+ type: ArrayConstructor;
132
+ required: true;
133
+ default: () => never[];
134
+ };
135
+ deletable: {
136
+ type: BooleanConstructor;
137
+ required: false;
138
+ };
139
+ }>> & {
140
+ onDelete?: ((...args: any[]) => any) | undefined;
141
+ onChoose?: ((...args: any[]) => any) | undefined;
142
+ }, {
143
+ commonList: unknown[];
144
+ recentList: unknown[];
145
+ getDisplayValue: Function;
146
+ deletable: boolean;
147
+ }>;
148
+ BaseSearch: import("vue").DefineComponent<{
149
+ displayValue: {
150
+ type: StringConstructor;
151
+ };
152
+ valueFormatter: {
153
+ type: PropType<(value: string | number | any[] | undefined) => string>;
154
+ };
155
+ show: {
156
+ type: BooleanConstructor;
157
+ };
158
+ placeholder: {
159
+ type: StringConstructor;
160
+ default: string;
161
+ };
162
+ inputProps: {
163
+ type: ObjectConstructor;
164
+ default: () => {};
165
+ };
166
+ popProps: {
167
+ type: ObjectConstructor;
168
+ default: () => {};
169
+ };
170
+ clearPatternOnOpenMenu: {
171
+ type: BooleanConstructor;
172
+ default: boolean;
173
+ };
174
+ }, {
175
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
176
+ displayValue: {
177
+ type: StringConstructor;
178
+ };
179
+ valueFormatter: {
180
+ type: PropType<(value: string | number | any[] | undefined) => string>;
181
+ };
182
+ show: {
183
+ type: BooleanConstructor;
184
+ };
185
+ placeholder: {
186
+ type: StringConstructor;
187
+ default: string;
188
+ };
189
+ inputProps: {
190
+ type: ObjectConstructor;
191
+ default: () => {};
192
+ };
193
+ popProps: {
194
+ type: ObjectConstructor;
195
+ default: () => {};
196
+ };
197
+ clearPatternOnOpenMenu: {
198
+ type: BooleanConstructor;
199
+ default: boolean;
200
+ };
201
+ }>> & {
202
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
203
+ onClear?: ((...args: any[]) => any) | undefined;
204
+ onSearch?: ((...args: any[]) => any) | undefined;
205
+ onOpenMenu?: ((...args: any[]) => any) | undefined;
206
+ onCloseMenu?: ((...args: any[]) => any) | undefined;
207
+ }>>;
208
+ uuid: string;
209
+ emits: (event: "clear" | "update:show" | "search" | "openMenu" | "closeMenu", ...args: any[]) => void;
210
+ search: (content?: any) => void;
211
+ popoverRef: import("vue").Ref<{
212
+ syncPosition: import("../../../../../es/shared/types").Func<any[], any>;
213
+ } | undefined>;
214
+ _show: import("vue").Ref<boolean>;
215
+ show: import("vue").WritableComputedRef<boolean>;
216
+ inputRef: import("vue").Ref<HTMLElement | undefined>;
217
+ patternContent: import("vue").Ref<string>;
218
+ displayValueRef: import("vue").WritableComputedRef<string | undefined>;
219
+ openMenuAtInput: (evt: PointerEvent) => void;
220
+ openMenu: () => void;
221
+ closeMenu: () => void;
222
+ onClear: () => void;
223
+ NInput: any;
224
+ NPopover: any;
225
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "update:show" | "search" | "openMenu" | "closeMenu")[], "search" | "closeMenu" | "clear" | "update:show" | "openMenu", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
226
+ displayValue: {
227
+ type: StringConstructor;
228
+ };
229
+ valueFormatter: {
230
+ type: PropType<(value: string | number | any[] | undefined) => string>;
231
+ };
232
+ show: {
233
+ type: BooleanConstructor;
234
+ };
235
+ placeholder: {
236
+ type: StringConstructor;
237
+ default: string;
238
+ };
239
+ inputProps: {
240
+ type: ObjectConstructor;
241
+ default: () => {};
242
+ };
243
+ popProps: {
244
+ type: ObjectConstructor;
245
+ default: () => {};
246
+ };
247
+ clearPatternOnOpenMenu: {
248
+ type: BooleanConstructor;
249
+ default: boolean;
250
+ };
251
+ }>> & {
252
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
253
+ onClear?: ((...args: any[]) => any) | undefined;
254
+ onSearch?: ((...args: any[]) => any) | undefined;
255
+ onOpenMenu?: ((...args: any[]) => any) | undefined;
256
+ onCloseMenu?: ((...args: any[]) => any) | undefined;
257
+ }, {
258
+ show: boolean;
259
+ placeholder: string;
260
+ inputProps: Record<string, any>;
261
+ popProps: Record<string, any>;
262
+ clearPatternOnOpenMenu: boolean;
263
+ }>;
264
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("delete" | "clear" | "update:value" | "search" | "choose" | "openMenu" | "closeMenu")[], "search" | "closeMenu" | "delete" | "clear" | "update:value" | "choose" | "openMenu", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
265
+ value: {
266
+ type: StringConstructor;
267
+ };
268
+ options: {
269
+ type: PropType<AnyObject[]>;
270
+ default: () => never[];
271
+ };
272
+ placeholder: {
273
+ type: StringConstructor;
274
+ default: string;
275
+ };
276
+ commonList: {
277
+ type: PropType<RecommendItem[]>;
278
+ default: () => never[];
279
+ };
280
+ recentList: {
281
+ type: PropType<RecommendItem[]>;
282
+ default: () => never[];
283
+ };
284
+ recommendDeletable: {
285
+ type: BooleanConstructor;
286
+ default: boolean;
287
+ };
288
+ }>> & {
289
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
290
+ onDelete?: ((...args: any[]) => any) | undefined;
291
+ onClear?: ((...args: any[]) => any) | undefined;
292
+ onSearch?: ((...args: any[]) => any) | undefined;
293
+ onChoose?: ((...args: any[]) => any) | undefined;
294
+ onOpenMenu?: ((...args: any[]) => any) | undefined;
295
+ onCloseMenu?: ((...args: any[]) => any) | undefined;
296
+ }, {
297
+ options: AnyObject[];
298
+ placeholder: string;
299
+ commonList: RecommendItem[];
300
+ recentList: RecommendItem[];
301
+ recommendDeletable: boolean;
302
+ }>;
303
+ export default _default;