persagy-vant 0.0.27 → 0.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 (163) hide show
  1. package/es/cascader/Cascader.d.ts +1 -1
  2. package/es/cascader/index.d.ts +1 -1
  3. package/es/coupon-list/style/index.mjs +1 -1
  4. package/es/coupon-list/style/less.mjs +1 -1
  5. package/es/index.d.ts +2 -2
  6. package/es/index.mjs +4 -4
  7. package/es/label/Label.d.ts +92 -0
  8. package/es/label/Label.mjs +95 -0
  9. package/es/label/index.css +1 -0
  10. package/es/label/index.d.ts +64 -0
  11. package/es/label/index.less +113 -0
  12. package/es/label/index.mjs +8 -0
  13. package/es/label/style/index.mjs +6 -0
  14. package/es/label/style/less.mjs +6 -0
  15. package/es/label/var.less +11 -0
  16. package/es/location-select/style/index.mjs +1 -1
  17. package/es/location-select/style/less.mjs +1 -1
  18. package/es/material-add/MaterialAdd.d.ts +105 -1
  19. package/es/material-add/MaterialAdd.mjs +63 -23
  20. package/es/material-add/index.d.ts +73 -1
  21. package/es/quantity-input/QuantityInput.d.ts +1 -1
  22. package/es/quantity-input/index.d.ts +2 -2
  23. package/es/radio-panel/RadioPanel.d.ts +46 -1
  24. package/es/radio-panel/RadioPanel.mjs +115 -29
  25. package/es/radio-panel/index.css +1 -1
  26. package/es/radio-panel/index.d.ts +35 -1
  27. package/es/radio-panel/index.less +17 -0
  28. package/es/radio-panel/style/index.mjs +4 -0
  29. package/es/radio-panel/style/less.mjs +4 -0
  30. package/es/sticky/Sticky.d.ts +1 -1
  31. package/es/sticky/index.d.ts +1 -1
  32. package/es/tabs/TabsTitle.mjs +1 -0
  33. package/es/tabs/index.css +1 -1
  34. package/es/tabs/index.less +11 -0
  35. package/es/tag/Tag.d.ts +1 -1
  36. package/es/tag/index.css +1 -1
  37. package/es/tag/index.less +7 -0
  38. package/es/tag/var.less +3 -0
  39. package/lib/cascader/Cascader.d.ts +1 -1
  40. package/lib/cascader/index.d.ts +1 -1
  41. package/lib/coupon-list/style/index.js +1 -1
  42. package/lib/coupon-list/style/less.js +1 -1
  43. package/lib/index.css +1 -1
  44. package/lib/index.d.ts +2 -2
  45. package/lib/index.js +4 -4
  46. package/lib/index.less +6 -6
  47. package/lib/label/Label.d.ts +92 -0
  48. package/lib/label/Label.js +114 -0
  49. package/lib/label/index.css +1 -0
  50. package/lib/label/index.d.ts +64 -0
  51. package/lib/{bot-mobile/session-filter.js → label/index.js} +16 -13
  52. package/lib/label/index.less +113 -0
  53. package/lib/label/style/index.js +6 -0
  54. package/lib/label/style/less.js +6 -0
  55. package/lib/label/var.less +11 -0
  56. package/lib/location-select/style/index.js +1 -1
  57. package/lib/location-select/style/less.js +1 -1
  58. package/lib/material-add/MaterialAdd.d.ts +105 -1
  59. package/lib/material-add/MaterialAdd.js +63 -23
  60. package/lib/material-add/index.d.ts +73 -1
  61. package/lib/quantity-input/QuantityInput.d.ts +1 -1
  62. package/lib/quantity-input/index.d.ts +2 -2
  63. package/lib/radio-panel/RadioPanel.d.ts +46 -1
  64. package/lib/radio-panel/RadioPanel.js +114 -28
  65. package/lib/radio-panel/index.css +1 -1
  66. package/lib/radio-panel/index.d.ts +35 -1
  67. package/lib/radio-panel/index.less +17 -0
  68. package/lib/radio-panel/style/index.js +4 -0
  69. package/lib/radio-panel/style/less.js +4 -0
  70. package/lib/sticky/Sticky.d.ts +1 -1
  71. package/lib/sticky/index.d.ts +1 -1
  72. package/lib/tabs/TabsTitle.js +1 -0
  73. package/lib/tabs/index.css +1 -1
  74. package/lib/tabs/index.less +11 -0
  75. package/lib/tag/Tag.d.ts +1 -1
  76. package/lib/tag/index.css +1 -1
  77. package/lib/tag/index.less +7 -0
  78. package/lib/tag/var.less +3 -0
  79. package/lib/vant.cjs.js +1212 -1769
  80. package/lib/vant.es.js +1212 -1769
  81. package/lib/vant.js +13016 -24376
  82. package/lib/vant.min.js +1 -1
  83. package/lib/web-types.json +1 -1
  84. package/package.json +4 -4
  85. package/es/bot-mobile/BotFab.d.ts +0 -72
  86. package/es/bot-mobile/BotFab.mjs +0 -152
  87. package/es/bot-mobile/BotHistoryDrawer.d.ts +0 -72
  88. package/es/bot-mobile/BotHistoryDrawer.mjs +0 -97
  89. package/es/bot-mobile/BotMobile.d.ts +0 -83
  90. package/es/bot-mobile/BotMobile.mjs +0 -47
  91. package/es/bot-mobile/BotMobileContextTags.d.ts +0 -52
  92. package/es/bot-mobile/BotMobileContextTags.mjs +0 -52
  93. package/es/bot-mobile/BotMobilePrompts.d.ts +0 -54
  94. package/es/bot-mobile/BotMobilePrompts.mjs +0 -49
  95. package/es/bot-mobile/BotMobileSheet.d.ts +0 -92
  96. package/es/bot-mobile/BotMobileSheet.mjs +0 -50
  97. package/es/bot-mobile/BotMobileView.d.ts +0 -82
  98. package/es/bot-mobile/BotMobileView.mjs +0 -45
  99. package/es/bot-mobile/BotSessionList.d.ts +0 -71
  100. package/es/bot-mobile/BotSessionList.mjs +0 -99
  101. package/es/bot-mobile/BotVoiceBar.d.ts +0 -80
  102. package/es/bot-mobile/BotVoiceBar.mjs +0 -138
  103. package/es/bot-mobile/fab-position.d.ts +0 -9
  104. package/es/bot-mobile/fab-position.mjs +0 -10
  105. package/es/bot-mobile/fab-position.test.d.ts +0 -1
  106. package/es/bot-mobile/fab-position.test.mjs +0 -29
  107. package/es/bot-mobile/index.css +0 -1
  108. package/es/bot-mobile/index.d.ts +0 -469
  109. package/es/bot-mobile/index.less +0 -464
  110. package/es/bot-mobile/index.mjs +0 -50
  111. package/es/bot-mobile/session-filter.d.ts +0 -6
  112. package/es/bot-mobile/session-filter.mjs +0 -15
  113. package/es/bot-mobile/session-item.d.ts +0 -15
  114. package/es/bot-mobile/session-item.mjs +0 -73
  115. package/es/bot-mobile/style/index.mjs +0 -15
  116. package/es/bot-mobile/style/less.mjs +0 -15
  117. package/es/bot-mobile/types.d.ts +0 -23
  118. package/es/bot-mobile/types.mjs +0 -0
  119. package/es/bot-mobile/var.less +0 -58
  120. package/es/bot-mobile/voice-zone.d.ts +0 -6
  121. package/es/bot-mobile/voice-zone.mjs +0 -6
  122. package/es/bot-mobile/voice-zone.test.d.ts +0 -1
  123. package/es/bot-mobile/voice-zone.test.mjs +0 -19
  124. package/lib/bot-mobile/BotFab.d.ts +0 -72
  125. package/lib/bot-mobile/BotFab.js +0 -171
  126. package/lib/bot-mobile/BotHistoryDrawer.d.ts +0 -72
  127. package/lib/bot-mobile/BotHistoryDrawer.js +0 -116
  128. package/lib/bot-mobile/BotMobile.d.ts +0 -83
  129. package/lib/bot-mobile/BotMobile.js +0 -66
  130. package/lib/bot-mobile/BotMobileContextTags.d.ts +0 -52
  131. package/lib/bot-mobile/BotMobileContextTags.js +0 -71
  132. package/lib/bot-mobile/BotMobilePrompts.d.ts +0 -54
  133. package/lib/bot-mobile/BotMobilePrompts.js +0 -68
  134. package/lib/bot-mobile/BotMobileSheet.d.ts +0 -92
  135. package/lib/bot-mobile/BotMobileSheet.js +0 -79
  136. package/lib/bot-mobile/BotMobileView.d.ts +0 -82
  137. package/lib/bot-mobile/BotMobileView.js +0 -64
  138. package/lib/bot-mobile/BotSessionList.d.ts +0 -71
  139. package/lib/bot-mobile/BotSessionList.js +0 -118
  140. package/lib/bot-mobile/BotVoiceBar.d.ts +0 -80
  141. package/lib/bot-mobile/BotVoiceBar.js +0 -157
  142. package/lib/bot-mobile/fab-position.d.ts +0 -9
  143. package/lib/bot-mobile/fab-position.js +0 -29
  144. package/lib/bot-mobile/fab-position.test.d.ts +0 -1
  145. package/lib/bot-mobile/fab-position.test.js +0 -29
  146. package/lib/bot-mobile/index.css +0 -1
  147. package/lib/bot-mobile/index.d.ts +0 -469
  148. package/lib/bot-mobile/index.js +0 -79
  149. package/lib/bot-mobile/index.less +0 -464
  150. package/lib/bot-mobile/session-filter.d.ts +0 -6
  151. package/lib/bot-mobile/session-item.d.ts +0 -15
  152. package/lib/bot-mobile/session-item.js +0 -92
  153. package/lib/bot-mobile/style/index.js +0 -15
  154. package/lib/bot-mobile/style/less.js +0 -15
  155. package/lib/bot-mobile/types.d.ts +0 -23
  156. package/lib/bot-mobile/types.js +0 -15
  157. package/lib/bot-mobile/var.less +0 -58
  158. package/lib/bot-mobile/voice-zone.d.ts +0 -6
  159. package/lib/bot-mobile/voice-zone.js +0 -25
  160. package/lib/bot-mobile/voice-zone.test.d.ts +0 -1
  161. package/lib/bot-mobile/voice-zone.test.js +0 -19
  162. /package/es/{bot-mobile → label}/var.css +0 -0
  163. /package/lib/{bot-mobile → label}/var.css +0 -0
@@ -22,6 +22,38 @@ declare const materialAddProps: {
22
22
  type: PropType<string>;
23
23
  default: string;
24
24
  };
25
+ showCommonTab: {
26
+ type: BooleanConstructor;
27
+ default: boolean;
28
+ };
29
+ showAllTab: {
30
+ type: BooleanConstructor;
31
+ default: boolean;
32
+ };
33
+ showMaterialTab: {
34
+ type: BooleanConstructor;
35
+ default: boolean;
36
+ };
37
+ showToolTab: {
38
+ type: BooleanConstructor;
39
+ default: boolean;
40
+ };
41
+ commonTabText: {
42
+ type: PropType<string>;
43
+ default: string;
44
+ };
45
+ allTabText: {
46
+ type: PropType<string>;
47
+ default: string;
48
+ };
49
+ materialTabText: {
50
+ type: PropType<string>;
51
+ default: string;
52
+ };
53
+ toolTabText: {
54
+ type: PropType<string>;
55
+ default: string;
56
+ };
25
57
  };
26
58
  export declare type MaterialAddProps = ExtractPropTypes<typeof materialAddProps>;
27
59
  declare const _default: import("vue").DefineComponent<{
@@ -46,6 +78,38 @@ declare const _default: import("vue").DefineComponent<{
46
78
  type: PropType<string>;
47
79
  default: string;
48
80
  };
81
+ showCommonTab: {
82
+ type: BooleanConstructor;
83
+ default: boolean;
84
+ };
85
+ showAllTab: {
86
+ type: BooleanConstructor;
87
+ default: boolean;
88
+ };
89
+ showMaterialTab: {
90
+ type: BooleanConstructor;
91
+ default: boolean;
92
+ };
93
+ showToolTab: {
94
+ type: BooleanConstructor;
95
+ default: boolean;
96
+ };
97
+ commonTabText: {
98
+ type: PropType<string>;
99
+ default: string;
100
+ };
101
+ allTabText: {
102
+ type: PropType<string>;
103
+ default: string;
104
+ };
105
+ materialTabText: {
106
+ type: PropType<string>;
107
+ default: string;
108
+ };
109
+ toolTabText: {
110
+ type: PropType<string>;
111
+ default: string;
112
+ };
49
113
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue" | "update:show" | "confirm")[], "change" | "update:modelValue" | "update:show" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
50
114
  show: BooleanConstructor;
51
115
  modelValue: {
@@ -68,6 +132,38 @@ declare const _default: import("vue").DefineComponent<{
68
132
  type: PropType<string>;
69
133
  default: string;
70
134
  };
135
+ showCommonTab: {
136
+ type: BooleanConstructor;
137
+ default: boolean;
138
+ };
139
+ showAllTab: {
140
+ type: BooleanConstructor;
141
+ default: boolean;
142
+ };
143
+ showMaterialTab: {
144
+ type: BooleanConstructor;
145
+ default: boolean;
146
+ };
147
+ showToolTab: {
148
+ type: BooleanConstructor;
149
+ default: boolean;
150
+ };
151
+ commonTabText: {
152
+ type: PropType<string>;
153
+ default: string;
154
+ };
155
+ allTabText: {
156
+ type: PropType<string>;
157
+ default: string;
158
+ };
159
+ materialTabText: {
160
+ type: PropType<string>;
161
+ default: string;
162
+ };
163
+ toolTabText: {
164
+ type: PropType<string>;
165
+ default: string;
166
+ };
71
167
  }>> & {
72
168
  onChange?: ((...args: any[]) => any) | undefined;
73
169
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
@@ -77,8 +173,16 @@ declare const _default: import("vue").DefineComponent<{
77
173
  title: string;
78
174
  modelValue: number[];
79
175
  show: boolean;
80
- items: MaterialAddItem[];
81
176
  confirmText: string;
177
+ items: MaterialAddItem[];
82
178
  categories: MaterialAddCategory[];
179
+ showCommonTab: boolean;
180
+ showAllTab: boolean;
181
+ showMaterialTab: boolean;
182
+ showToolTab: boolean;
183
+ commonTabText: string;
184
+ allTabText: string;
185
+ materialTabText: string;
186
+ toolTabText: string;
83
187
  }>;
84
188
  export default _default;
@@ -297,7 +297,27 @@ const materialAddProps = {
297
297
  default: () => defaultCategories
298
298
  },
299
299
  title: (0, import_utils.makeStringProp)("\u6DFB\u52A0\u7269\u6599"),
300
- confirmText: (0, import_utils.makeStringProp)("\u786E\u5B9A")
300
+ confirmText: (0, import_utils.makeStringProp)("\u786E\u5B9A"),
301
+ showCommonTab: {
302
+ type: Boolean,
303
+ default: true
304
+ },
305
+ showAllTab: {
306
+ type: Boolean,
307
+ default: true
308
+ },
309
+ showMaterialTab: {
310
+ type: Boolean,
311
+ default: true
312
+ },
313
+ showToolTab: {
314
+ type: Boolean,
315
+ default: true
316
+ },
317
+ commonTabText: (0, import_utils.makeStringProp)("\u5E38\u7528\u7269\u6599"),
318
+ allTabText: (0, import_utils.makeStringProp)("\u5168\u90E8\u7269\u6599"),
319
+ materialTabText: (0, import_utils.makeStringProp)("\u7269\u8D44"),
320
+ toolTabText: (0, import_utils.makeStringProp)("\u5DE5\u5177")
301
321
  };
302
322
  var stdin_default = (0, import_vue.defineComponent)({
303
323
  name,
@@ -306,8 +326,16 @@ var stdin_default = (0, import_vue.defineComponent)({
306
326
  setup(props, {
307
327
  emit
308
328
  }) {
309
- const activeTab = (0, import_vue.ref)(0);
310
- const activeKind = (0, import_vue.ref)("material");
329
+ const getDefaultTab = () => props.showCommonTab || !props.showAllTab ? "common" : "all";
330
+ const getDefaultKind = () => {
331
+ if (props.showMaterialTab || !props.showToolTab)
332
+ return "material";
333
+ if (props.showToolTab)
334
+ return "tool";
335
+ return void 0;
336
+ };
337
+ const activeTab = (0, import_vue.ref)(getDefaultTab());
338
+ const activeKind = (0, import_vue.ref)(getDefaultKind());
311
339
  const keyword = (0, import_vue.ref)("");
312
340
  const searching = (0, import_vue.ref)(false);
313
341
  const expandedKeys = (0, import_vue.ref)(["material-root", "tool-root"]);
@@ -319,8 +347,8 @@ var stdin_default = (0, import_vue.defineComponent)({
319
347
  const detailBannerIndex = (0, import_vue.ref)(0);
320
348
  (0, import_vue.watch)(() => props.show, (show) => {
321
349
  if (show) {
322
- activeTab.value = 0;
323
- activeKind.value = "material";
350
+ activeTab.value = getDefaultTab();
351
+ activeKind.value = getDefaultKind();
324
352
  keyword.value = "";
325
353
  searching.value = false;
326
354
  expandedKeys.value = ["material-root", "tool-root"];
@@ -334,6 +362,16 @@ var stdin_default = (0, import_vue.defineComponent)({
334
362
  }, {
335
363
  immediate: true
336
364
  });
365
+ (0, import_vue.watch)(() => [props.showCommonTab, props.showAllTab], () => {
366
+ if (activeTab.value === "common" && !props.showCommonTab || activeTab.value === "all" && !props.showAllTab) {
367
+ activeTab.value = getDefaultTab();
368
+ }
369
+ });
370
+ (0, import_vue.watch)(() => [props.showMaterialTab, props.showToolTab], () => {
371
+ if (activeKind.value === "material" && !props.showMaterialTab || activeKind.value === "tool" && !props.showToolTab) {
372
+ activeKind.value = getDefaultKind();
373
+ }
374
+ });
337
375
  const quantities = (0, import_vue.computed)(() => props.items.map((_, index) => Math.max(Number(props.modelValue[index] || 0), 0)));
338
376
  const total = (0, import_vue.computed)(() => quantities.value.reduce((sum, value) => sum + value, 0));
339
377
  const selectedItems = (0, import_vue.computed)(() => props.items.map((item, index) => ({
@@ -346,8 +384,8 @@ var stdin_default = (0, import_vue.defineComponent)({
346
384
  const visibleItems = (0, import_vue.computed)(() => {
347
385
  const query = keyword.value.trim().toLowerCase();
348
386
  return props.items.filter((item) => {
349
- const matchesKind = searching.value || item.kind === activeKind.value;
350
- const matchesCategory = searching.value || activeTab.value === 0;
387
+ const matchesKind = searching.value || !activeKind.value || item.kind === activeKind.value;
388
+ const matchesCategory = searching.value || activeTab.value === "common";
351
389
  const matchesSearch = !query || `${item.name}${item.detail}`.toLowerCase().includes(query);
352
390
  return matchesKind && matchesCategory && matchesSearch;
353
391
  });
@@ -388,13 +426,13 @@ var stdin_default = (0, import_vue.defineComponent)({
388
426
  "class": bem("empty")
389
427
  }, [(0, import_vue.createTextVNode)("\u6682\u65E0\u5339\u914D\u7269\u6599")])]);
390
428
  const renderCatalog = () => {
391
- const rootGroups = props.categories.filter((category) => category.kind === activeKind.value);
429
+ const rootGroups = props.categories.filter((category) => !activeKind.value || category.kind === activeKind.value);
392
430
  const configuredValues = new Set(rootGroups.flatMap((group) => group.categories.map((category) => category.value)));
393
- const ungroupedCategories = [...new Set(props.items.filter((item) => item.kind === activeKind.value && !configuredValues.has(item.category)).map((item) => item.category))];
431
+ const ungroupedCategories = [...new Set(props.items.filter((item) => (!activeKind.value || item.kind === activeKind.value) && !configuredValues.has(item.category)).map((item) => item.category))];
394
432
  const groups = ungroupedCategories.length ? [...rootGroups, {
395
- id: `${activeKind.value}-other`,
433
+ id: `${activeKind.value || "all"}-other`,
396
434
  text: "\u672A\u5206\u7C7B",
397
- kind: activeKind.value,
435
+ kind: activeKind.value || "material",
398
436
  categories: ungroupedCategories.map((value) => ({
399
437
  value,
400
438
  text: value
@@ -404,7 +442,7 @@ var stdin_default = (0, import_vue.defineComponent)({
404
442
  id: root.id,
405
443
  text: root.text,
406
444
  selectable: false,
407
- children: props.items.filter((item) => item.kind === activeKind.value && root.categories.some((category) => category.value === item.category)).map((material) => ({
445
+ children: props.items.filter((item) => (!activeKind.value || item.kind === activeKind.value) && root.categories.some((category) => category.value === item.category)).map((material) => ({
408
446
  id: material.id,
409
447
  text: material.name,
410
448
  selectable: false,
@@ -595,36 +633,38 @@ var stdin_default = (0, import_vue.defineComponent)({
595
633
  searching.value = true;
596
634
  }
597
635
  }, null)
598
- }), (0, import_vue.createVNode)(import_tabs.Tabs, {
636
+ }), (props.showCommonTab || props.showAllTab) && (0, import_vue.createVNode)(import_tabs.Tabs, {
599
637
  "active": activeTab.value,
600
638
  "onUpdate:active": ($event) => activeTab.value = $event,
601
639
  "class": bem("tabs"),
602
640
  "shrink": true
603
641
  }, {
604
- default: () => [(0, import_vue.createVNode)(import_tab.Tab, {
605
- "title": "\u5E38\u7528\u7269\u6599"
606
- }, null), (0, import_vue.createVNode)(import_tab.Tab, {
607
- "title": "\u5168\u90E8\u7269\u6599"
642
+ default: () => [props.showCommonTab && (0, import_vue.createVNode)(import_tab.Tab, {
643
+ "name": "common",
644
+ "title": props.commonTabText
645
+ }, null), props.showAllTab && (0, import_vue.createVNode)(import_tab.Tab, {
646
+ "name": "all",
647
+ "title": props.allTabText
608
648
  }, null)]
609
- }), (0, import_vue.createVNode)("div", {
649
+ }), (props.showMaterialTab || props.showToolTab) && (0, import_vue.createVNode)("div", {
610
650
  "class": bem("filter-tags")
611
- }, [(0, import_vue.createVNode)(import_filter_tag.FilterTag, {
651
+ }, [props.showMaterialTab && (0, import_vue.createVNode)(import_filter_tag.FilterTag, {
612
652
  "selected": activeKind.value === "material",
613
653
  "onClick": () => {
614
654
  activeKind.value = "material";
615
655
  }
616
656
  }, {
617
- default: () => [(0, import_vue.createTextVNode)("\u7269\u8D44")]
618
- }), (0, import_vue.createVNode)(import_filter_tag.FilterTag, {
657
+ default: () => [props.materialTabText]
658
+ }), props.showToolTab && (0, import_vue.createVNode)(import_filter_tag.FilterTag, {
619
659
  "selected": activeKind.value === "tool",
620
660
  "onClick": () => {
621
661
  activeKind.value = "tool";
622
662
  }
623
663
  }, {
624
- default: () => [(0, import_vue.createTextVNode)("\u5DE5\u5177")]
664
+ default: () => [props.toolTabText]
625
665
  })])]), (0, import_vue.createVNode)("div", {
626
666
  "class": bem("body")
627
- }, [searching.value && !keyword.value.trim() ? null : searching.value || activeTab.value === 0 ? renderList() : renderCatalog()]), (0, import_vue.createVNode)("div", {
667
+ }, [searching.value && !keyword.value.trim() ? null : searching.value || activeTab.value === "common" ? renderList() : renderCatalog()]), (0, import_vue.createVNode)("div", {
628
668
  "class": bem("footer")
629
669
  }, [renderSelectPanel(), (0, import_vue.createVNode)(import_bottom_action_bar.BottomActionBar, {
630
670
  "fixed": false,
@@ -20,6 +20,38 @@ export declare const MaterialAdd: import("../utils").WithInstall<import("vue").D
20
20
  type: import("vue").PropType<string>;
21
21
  default: string;
22
22
  };
23
+ showCommonTab: {
24
+ type: BooleanConstructor;
25
+ default: boolean;
26
+ };
27
+ showAllTab: {
28
+ type: BooleanConstructor;
29
+ default: boolean;
30
+ };
31
+ showMaterialTab: {
32
+ type: BooleanConstructor;
33
+ default: boolean;
34
+ };
35
+ showToolTab: {
36
+ type: BooleanConstructor;
37
+ default: boolean;
38
+ };
39
+ commonTabText: {
40
+ type: import("vue").PropType<string>;
41
+ default: string;
42
+ };
43
+ allTabText: {
44
+ type: import("vue").PropType<string>;
45
+ default: string;
46
+ };
47
+ materialTabText: {
48
+ type: import("vue").PropType<string>;
49
+ default: string;
50
+ };
51
+ toolTabText: {
52
+ type: import("vue").PropType<string>;
53
+ default: string;
54
+ };
23
55
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue" | "update:show" | "confirm")[], "change" | "update:modelValue" | "update:show" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
24
56
  show: BooleanConstructor;
25
57
  modelValue: {
@@ -42,6 +74,38 @@ export declare const MaterialAdd: import("../utils").WithInstall<import("vue").D
42
74
  type: import("vue").PropType<string>;
43
75
  default: string;
44
76
  };
77
+ showCommonTab: {
78
+ type: BooleanConstructor;
79
+ default: boolean;
80
+ };
81
+ showAllTab: {
82
+ type: BooleanConstructor;
83
+ default: boolean;
84
+ };
85
+ showMaterialTab: {
86
+ type: BooleanConstructor;
87
+ default: boolean;
88
+ };
89
+ showToolTab: {
90
+ type: BooleanConstructor;
91
+ default: boolean;
92
+ };
93
+ commonTabText: {
94
+ type: import("vue").PropType<string>;
95
+ default: string;
96
+ };
97
+ allTabText: {
98
+ type: import("vue").PropType<string>;
99
+ default: string;
100
+ };
101
+ materialTabText: {
102
+ type: import("vue").PropType<string>;
103
+ default: string;
104
+ };
105
+ toolTabText: {
106
+ type: import("vue").PropType<string>;
107
+ default: string;
108
+ };
45
109
  }>> & {
46
110
  onChange?: ((...args: any[]) => any) | undefined;
47
111
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
@@ -51,9 +115,17 @@ export declare const MaterialAdd: import("../utils").WithInstall<import("vue").D
51
115
  title: string;
52
116
  modelValue: number[];
53
117
  show: boolean;
54
- items: import("./types").MaterialAddItem[];
55
118
  confirmText: string;
119
+ items: import("./types").MaterialAddItem[];
56
120
  categories: import("./types").MaterialAddCategory[];
121
+ showCommonTab: boolean;
122
+ showAllTab: boolean;
123
+ showMaterialTab: boolean;
124
+ showToolTab: boolean;
125
+ commonTabText: string;
126
+ allTabText: string;
127
+ materialTabText: string;
128
+ toolTabText: string;
57
129
  }>>;
58
130
  export default MaterialAdd;
59
131
  export type { MaterialAddProps } from './MaterialAdd';
@@ -92,8 +92,8 @@ declare const _default: import("vue").DefineComponent<{
92
92
  expanded: boolean;
93
93
  expandText: string;
94
94
  collapseText: string;
95
- items: QuantityInputItem[];
96
95
  confirmText: string;
96
+ items: QuantityInputItem[];
97
97
  clearText: string;
98
98
  }>;
99
99
  export default _default;
@@ -60,8 +60,8 @@ export declare const QuantityInput: import("../utils").WithInstall<import("vue")
60
60
  expanded: boolean;
61
61
  expandText: string;
62
62
  collapseText: string;
63
- items: import("./QuantityInput").QuantityInputItem[];
64
63
  confirmText: string;
64
+ items: import("./QuantityInput").QuantityInputItem[];
65
65
  clearText: string;
66
66
  }>>;
67
67
  export declare const BatchMultiSelect: import("../utils").WithInstall<import("vue").DefineComponent<{
@@ -126,8 +126,8 @@ export declare const BatchMultiSelect: import("../utils").WithInstall<import("vu
126
126
  expanded: boolean;
127
127
  expandText: string;
128
128
  collapseText: string;
129
- items: import("./QuantityInput").QuantityInputItem[];
130
129
  confirmText: string;
130
+ items: import("./QuantityInput").QuantityInputItem[];
131
131
  clearText: string;
132
132
  }>>;
133
133
  export default QuantityInput;
@@ -12,6 +12,17 @@ declare const radioPanelProps: {
12
12
  default: () => never[];
13
13
  };
14
14
  modelValue: PropType<string>;
15
+ searchable: BooleanConstructor;
16
+ searchPlaceholder: StringConstructor;
17
+ filterable: BooleanConstructor;
18
+ filterActive: BooleanConstructor;
19
+ loading: BooleanConstructor;
20
+ finished: BooleanConstructor;
21
+ error: BooleanConstructor;
22
+ lazy: BooleanConstructor;
23
+ loadingText: StringConstructor;
24
+ finishedText: StringConstructor;
25
+ errorText: StringConstructor;
15
26
  };
16
27
  export declare type RadioPanelProps = ExtractPropTypes<typeof radioPanelProps>;
17
28
  declare const _default: import("vue").DefineComponent<{
@@ -22,7 +33,18 @@ declare const _default: import("vue").DefineComponent<{
22
33
  default: () => never[];
23
34
  };
24
35
  modelValue: PropType<string>;
25
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "update:modelValue" | "update:show")[], "select" | "update:modelValue" | "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
36
+ searchable: BooleanConstructor;
37
+ searchPlaceholder: StringConstructor;
38
+ filterable: BooleanConstructor;
39
+ filterActive: BooleanConstructor;
40
+ loading: BooleanConstructor;
41
+ finished: BooleanConstructor;
42
+ error: BooleanConstructor;
43
+ lazy: BooleanConstructor;
44
+ loadingText: StringConstructor;
45
+ finishedText: StringConstructor;
46
+ errorText: StringConstructor;
47
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("search" | "select" | "update:modelValue" | "load" | "update:show" | "filter" | "update:error" | "update:loading")[], "search" | "select" | "filter" | "update:modelValue" | "load" | "update:show" | "update:error" | "update:loading", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
26
48
  show: BooleanConstructor;
27
49
  title: StringConstructor;
28
50
  options: {
@@ -30,12 +52,35 @@ declare const _default: import("vue").DefineComponent<{
30
52
  default: () => never[];
31
53
  };
32
54
  modelValue: PropType<string>;
55
+ searchable: BooleanConstructor;
56
+ searchPlaceholder: StringConstructor;
57
+ filterable: BooleanConstructor;
58
+ filterActive: BooleanConstructor;
59
+ loading: BooleanConstructor;
60
+ finished: BooleanConstructor;
61
+ error: BooleanConstructor;
62
+ lazy: BooleanConstructor;
63
+ loadingText: StringConstructor;
64
+ finishedText: StringConstructor;
65
+ errorText: StringConstructor;
33
66
  }>> & {
67
+ onLoad?: ((...args: any[]) => any) | undefined;
34
68
  onSelect?: ((...args: any[]) => any) | undefined;
35
69
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
36
70
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
71
+ "onUpdate:error"?: ((...args: any[]) => any) | undefined;
72
+ "onUpdate:loading"?: ((...args: any[]) => any) | undefined;
73
+ onSearch?: ((...args: any[]) => any) | undefined;
74
+ onFilter?: ((...args: any[]) => any) | undefined;
37
75
  }, {
76
+ error: boolean;
77
+ loading: boolean;
38
78
  show: boolean;
39
79
  options: RadioPanelOption[];
80
+ finished: boolean;
81
+ searchable: boolean;
82
+ filterable: boolean;
83
+ filterActive: boolean;
84
+ lazy: boolean;
40
85
  }>;
41
86
  export default _default;
@@ -25,23 +25,47 @@ var import_utils = require("../utils");
25
25
  var import_action_sheet = require("../action-sheet");
26
26
  var import_nav_bar = require("../nav-bar");
27
27
  var import_icon = require("../icon");
28
+ var import_badge = require("../badge");
28
29
  var import_cell = require("../cell");
30
+ var import_empty = require("../empty");
31
+ var import_list = require("../list");
29
32
  var import_radio = require("../radio");
30
33
  var import_radio_group = require("../radio-group");
34
+ var import_search = require("../search");
31
35
  const [name, bem] = (0, import_utils.createNamespace)("radio-panel");
36
+ const escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
32
37
  const radioPanelProps = {
33
38
  show: Boolean,
34
39
  title: String,
35
40
  options: (0, import_utils.makeArrayProp)(),
36
- modelValue: String
41
+ modelValue: String,
42
+ searchable: Boolean,
43
+ searchPlaceholder: String,
44
+ filterable: Boolean,
45
+ filterActive: Boolean,
46
+ loading: Boolean,
47
+ finished: Boolean,
48
+ error: Boolean,
49
+ lazy: Boolean,
50
+ loadingText: String,
51
+ finishedText: String,
52
+ errorText: String
37
53
  };
38
54
  var stdin_default = (0, import_vue.defineComponent)({
39
55
  name,
40
56
  props: radioPanelProps,
41
- emits: ["update:show", "update:modelValue", "select"],
57
+ emits: ["update:show", "update:modelValue", "update:loading", "update:error", "select", "search", "filter", "load"],
42
58
  setup(props, {
43
- emit
59
+ emit,
60
+ slots
44
61
  }) {
62
+ const keyword = (0, import_vue.ref)("");
63
+ const filteredOptions = (0, import_vue.computed)(() => {
64
+ const query = keyword.value.trim().toLocaleLowerCase();
65
+ if (!query)
66
+ return props.options;
67
+ return props.options.filter((option) => option.label.toLocaleLowerCase().includes(query));
68
+ });
45
69
  const close = () => emit("update:show", false);
46
70
  const select = (option) => {
47
71
  if (option.disabled)
@@ -50,6 +74,48 @@ var stdin_default = (0, import_vue.defineComponent)({
50
74
  emit("select", option.value);
51
75
  close();
52
76
  };
77
+ const renderOptionLabel = (label) => {
78
+ const query = keyword.value.trim();
79
+ if (!query)
80
+ return label;
81
+ const normalizedQuery = query.toLocaleLowerCase();
82
+ return label.split(new RegExp(`(${escapeRegExp(query)})`, "ig")).map((part) => part.toLocaleLowerCase() === normalizedQuery ? (0, import_vue.createVNode)("span", {
83
+ "class": bem("match")
84
+ }, [part]) : part);
85
+ };
86
+ const renderOptions = () => {
87
+ if (!filteredOptions.value.length) {
88
+ return (0, import_vue.createVNode)(import_empty.Empty, {
89
+ "imageSize": 60,
90
+ "description": "\u6682\u65E0\u5339\u914D\u9009\u9879"
91
+ }, null);
92
+ }
93
+ return (0, import_vue.createVNode)(import_radio_group.RadioGroup, {
94
+ "modelValue": props.modelValue,
95
+ "onUpdate:modelValue": (value) => {
96
+ const option = props.options.find((item) => item.value === value);
97
+ if (option)
98
+ select(option);
99
+ }
100
+ }, {
101
+ default: () => [filteredOptions.value.map((option) => (0, import_vue.createVNode)(import_cell.Cell, {
102
+ "key": option.value,
103
+ "clickable": !option.disabled,
104
+ "title": option.label,
105
+ "titleStyle": {
106
+ color: props.modelValue === option.value ? "var(--van-primary-color)" : void 0
107
+ },
108
+ "onClick": () => select(option)
109
+ }, {
110
+ title: () => renderOptionLabel(option.label),
111
+ "right-icon": () => (0, import_vue.createVNode)(import_radio.Radio, {
112
+ "name": option.value,
113
+ "disabled": option.disabled,
114
+ "onClick": (event) => event.stopPropagation()
115
+ }, null)
116
+ }))]
117
+ });
118
+ };
53
119
  return () => (0, import_vue.createVNode)(import_action_sheet.ActionSheet, {
54
120
  "show": props.show,
55
121
  "class": bem(),
@@ -68,35 +134,55 @@ var stdin_default = (0, import_vue.defineComponent)({
68
134
  "name": "cross",
69
135
  "size": "22",
70
136
  "onClick": close
71
- }, null)
72
- })]), (0, import_vue.createVNode)("div", {
137
+ }, null),
138
+ right: () => {
139
+ if (slots.filter)
140
+ return slots.filter();
141
+ if (!props.filterable)
142
+ return;
143
+ return (0, import_vue.createVNode)("button", {
144
+ "type": "button",
145
+ "class": bem("filter"),
146
+ "aria-label": "\u7B5B\u9009",
147
+ "onClick": () => emit("filter")
148
+ }, [(0, import_vue.createVNode)(import_badge.Badge, {
149
+ "dot": props.filterActive
150
+ }, {
151
+ default: () => [(0, import_vue.createVNode)(import_icon.Icon, {
152
+ "name": "filter-o",
153
+ "size": "22"
154
+ }, null)]
155
+ })]);
156
+ }
157
+ })]), props.searchable && (0, import_vue.createVNode)(import_search.Search, {
158
+ "modelValue": keyword.value,
159
+ "class": bem("search"),
160
+ "shape": "round",
161
+ "inputAlign": "left",
162
+ "placeholder": props.searchPlaceholder || "\u8BF7\u8F93\u5165\u641C\u7D22\u5173\u952E\u8BCD",
163
+ "maxlength": 200,
164
+ "onUpdate:modelValue": (value) => {
165
+ keyword.value = value;
166
+ emit("search", value);
167
+ },
168
+ "onSearch": (value) => emit("search", value)
169
+ }, null), (0, import_vue.createVNode)("div", {
73
170
  "class": bem("body")
74
171
  }, [(0, import_vue.createVNode)("div", {
75
172
  "class": bem("card")
76
- }, [(0, import_vue.createVNode)(import_radio_group.RadioGroup, {
77
- "modelValue": props.modelValue,
78
- "onUpdate:modelValue": (value) => {
79
- const option = props.options.find((item) => item.value === value);
80
- if (option)
81
- select(option);
82
- }
173
+ }, [props.lazy ? (0, import_vue.createVNode)(import_list.List, {
174
+ "loading": props.loading,
175
+ "finished": props.finished,
176
+ "error": props.error,
177
+ "loadingText": props.loadingText,
178
+ "finishedText": props.finishedText,
179
+ "errorText": props.errorText,
180
+ "onUpdate:loading": (value) => emit("update:loading", value),
181
+ "onUpdate:error": (value) => emit("update:error", value),
182
+ "onLoad": () => emit("load")
83
183
  }, {
84
- default: () => [props.options.map((option) => (0, import_vue.createVNode)(import_cell.Cell, {
85
- "key": option.value,
86
- "clickable": !option.disabled,
87
- "title": option.label,
88
- "titleStyle": {
89
- color: props.modelValue === option.value ? "var(--van-primary-color)" : void 0
90
- },
91
- "onClick": () => select(option)
92
- }, {
93
- "right-icon": () => (0, import_vue.createVNode)(import_radio.Radio, {
94
- "name": option.value,
95
- "disabled": option.disabled,
96
- "onClick": (event) => event.stopPropagation()
97
- }, null)
98
- }))]
99
- })])])])]
184
+ default: () => [renderOptions()]
185
+ }) : renderOptions()])])])]
100
186
  });
101
187
  }
102
188
  });