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;
@@ -265,7 +265,27 @@ const materialAddProps = {
265
265
  default: () => defaultCategories
266
266
  },
267
267
  title: makeStringProp("\u6DFB\u52A0\u7269\u6599"),
268
- confirmText: makeStringProp("\u786E\u5B9A")
268
+ confirmText: makeStringProp("\u786E\u5B9A"),
269
+ showCommonTab: {
270
+ type: Boolean,
271
+ default: true
272
+ },
273
+ showAllTab: {
274
+ type: Boolean,
275
+ default: true
276
+ },
277
+ showMaterialTab: {
278
+ type: Boolean,
279
+ default: true
280
+ },
281
+ showToolTab: {
282
+ type: Boolean,
283
+ default: true
284
+ },
285
+ commonTabText: makeStringProp("\u5E38\u7528\u7269\u6599"),
286
+ allTabText: makeStringProp("\u5168\u90E8\u7269\u6599"),
287
+ materialTabText: makeStringProp("\u7269\u8D44"),
288
+ toolTabText: makeStringProp("\u5DE5\u5177")
269
289
  };
270
290
  var stdin_default = defineComponent({
271
291
  name,
@@ -274,8 +294,16 @@ var stdin_default = defineComponent({
274
294
  setup(props, {
275
295
  emit
276
296
  }) {
277
- const activeTab = ref(0);
278
- const activeKind = ref("material");
297
+ const getDefaultTab = () => props.showCommonTab || !props.showAllTab ? "common" : "all";
298
+ const getDefaultKind = () => {
299
+ if (props.showMaterialTab || !props.showToolTab)
300
+ return "material";
301
+ if (props.showToolTab)
302
+ return "tool";
303
+ return void 0;
304
+ };
305
+ const activeTab = ref(getDefaultTab());
306
+ const activeKind = ref(getDefaultKind());
279
307
  const keyword = ref("");
280
308
  const searching = ref(false);
281
309
  const expandedKeys = ref(["material-root", "tool-root"]);
@@ -287,8 +315,8 @@ var stdin_default = defineComponent({
287
315
  const detailBannerIndex = ref(0);
288
316
  watch(() => props.show, (show) => {
289
317
  if (show) {
290
- activeTab.value = 0;
291
- activeKind.value = "material";
318
+ activeTab.value = getDefaultTab();
319
+ activeKind.value = getDefaultKind();
292
320
  keyword.value = "";
293
321
  searching.value = false;
294
322
  expandedKeys.value = ["material-root", "tool-root"];
@@ -302,6 +330,16 @@ var stdin_default = defineComponent({
302
330
  }, {
303
331
  immediate: true
304
332
  });
333
+ watch(() => [props.showCommonTab, props.showAllTab], () => {
334
+ if (activeTab.value === "common" && !props.showCommonTab || activeTab.value === "all" && !props.showAllTab) {
335
+ activeTab.value = getDefaultTab();
336
+ }
337
+ });
338
+ watch(() => [props.showMaterialTab, props.showToolTab], () => {
339
+ if (activeKind.value === "material" && !props.showMaterialTab || activeKind.value === "tool" && !props.showToolTab) {
340
+ activeKind.value = getDefaultKind();
341
+ }
342
+ });
305
343
  const quantities = computed(() => props.items.map((_, index) => Math.max(Number(props.modelValue[index] || 0), 0)));
306
344
  const total = computed(() => quantities.value.reduce((sum, value) => sum + value, 0));
307
345
  const selectedItems = computed(() => props.items.map((item, index) => ({
@@ -314,8 +352,8 @@ var stdin_default = defineComponent({
314
352
  const visibleItems = computed(() => {
315
353
  const query = keyword.value.trim().toLowerCase();
316
354
  return props.items.filter((item) => {
317
- const matchesKind = searching.value || item.kind === activeKind.value;
318
- const matchesCategory = searching.value || activeTab.value === 0;
355
+ const matchesKind = searching.value || !activeKind.value || item.kind === activeKind.value;
356
+ const matchesCategory = searching.value || activeTab.value === "common";
319
357
  const matchesSearch = !query || `${item.name}${item.detail}`.toLowerCase().includes(query);
320
358
  return matchesKind && matchesCategory && matchesSearch;
321
359
  });
@@ -356,13 +394,13 @@ var stdin_default = defineComponent({
356
394
  "class": bem("empty")
357
395
  }, [_createTextVNode("\u6682\u65E0\u5339\u914D\u7269\u6599")])]);
358
396
  const renderCatalog = () => {
359
- const rootGroups = props.categories.filter((category) => category.kind === activeKind.value);
397
+ const rootGroups = props.categories.filter((category) => !activeKind.value || category.kind === activeKind.value);
360
398
  const configuredValues = new Set(rootGroups.flatMap((group) => group.categories.map((category) => category.value)));
361
- const ungroupedCategories = [...new Set(props.items.filter((item) => item.kind === activeKind.value && !configuredValues.has(item.category)).map((item) => item.category))];
399
+ const ungroupedCategories = [...new Set(props.items.filter((item) => (!activeKind.value || item.kind === activeKind.value) && !configuredValues.has(item.category)).map((item) => item.category))];
362
400
  const groups = ungroupedCategories.length ? [...rootGroups, {
363
- id: `${activeKind.value}-other`,
401
+ id: `${activeKind.value || "all"}-other`,
364
402
  text: "\u672A\u5206\u7C7B",
365
- kind: activeKind.value,
403
+ kind: activeKind.value || "material",
366
404
  categories: ungroupedCategories.map((value) => ({
367
405
  value,
368
406
  text: value
@@ -372,7 +410,7 @@ var stdin_default = defineComponent({
372
410
  id: root.id,
373
411
  text: root.text,
374
412
  selectable: false,
375
- children: props.items.filter((item) => item.kind === activeKind.value && root.categories.some((category) => category.value === item.category)).map((material) => ({
413
+ children: props.items.filter((item) => (!activeKind.value || item.kind === activeKind.value) && root.categories.some((category) => category.value === item.category)).map((material) => ({
376
414
  id: material.id,
377
415
  text: material.name,
378
416
  selectable: false,
@@ -563,36 +601,38 @@ var stdin_default = defineComponent({
563
601
  searching.value = true;
564
602
  }
565
603
  }, null)
566
- }), _createVNode(Tabs, {
604
+ }), (props.showCommonTab || props.showAllTab) && _createVNode(Tabs, {
567
605
  "active": activeTab.value,
568
606
  "onUpdate:active": ($event) => activeTab.value = $event,
569
607
  "class": bem("tabs"),
570
608
  "shrink": true
571
609
  }, {
572
- default: () => [_createVNode(Tab, {
573
- "title": "\u5E38\u7528\u7269\u6599"
574
- }, null), _createVNode(Tab, {
575
- "title": "\u5168\u90E8\u7269\u6599"
610
+ default: () => [props.showCommonTab && _createVNode(Tab, {
611
+ "name": "common",
612
+ "title": props.commonTabText
613
+ }, null), props.showAllTab && _createVNode(Tab, {
614
+ "name": "all",
615
+ "title": props.allTabText
576
616
  }, null)]
577
- }), _createVNode("div", {
617
+ }), (props.showMaterialTab || props.showToolTab) && _createVNode("div", {
578
618
  "class": bem("filter-tags")
579
- }, [_createVNode(FilterTag, {
619
+ }, [props.showMaterialTab && _createVNode(FilterTag, {
580
620
  "selected": activeKind.value === "material",
581
621
  "onClick": () => {
582
622
  activeKind.value = "material";
583
623
  }
584
624
  }, {
585
- default: () => [_createTextVNode("\u7269\u8D44")]
586
- }), _createVNode(FilterTag, {
625
+ default: () => [props.materialTabText]
626
+ }), props.showToolTab && _createVNode(FilterTag, {
587
627
  "selected": activeKind.value === "tool",
588
628
  "onClick": () => {
589
629
  activeKind.value = "tool";
590
630
  }
591
631
  }, {
592
- default: () => [_createTextVNode("\u5DE5\u5177")]
632
+ default: () => [props.toolTabText]
593
633
  })])]), _createVNode("div", {
594
634
  "class": bem("body")
595
- }, [searching.value && !keyword.value.trim() ? null : searching.value || activeTab.value === 0 ? renderList() : renderCatalog()]), _createVNode("div", {
635
+ }, [searching.value && !keyword.value.trim() ? null : searching.value || activeTab.value === "common" ? renderList() : renderCatalog()]), _createVNode("div", {
596
636
  "class": bem("footer")
597
637
  }, [renderSelectPanel(), _createVNode(BottomActionBar, {
598
638
  "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;
@@ -1,25 +1,49 @@
1
- import { defineComponent, createVNode as _createVNode } from "vue";
1
+ import { computed, defineComponent, ref, createVNode as _createVNode } from "vue";
2
2
  import { createNamespace, makeArrayProp } from "../utils/index.mjs";
3
3
  import { ActionSheet } from "../action-sheet/index.mjs";
4
4
  import { NavBar } from "../nav-bar/index.mjs";
5
5
  import { Icon } from "../icon/index.mjs";
6
+ import { Badge } from "../badge/index.mjs";
6
7
  import { Cell } from "../cell/index.mjs";
8
+ import { Empty } from "../empty/index.mjs";
9
+ import { List } from "../list/index.mjs";
7
10
  import { Radio } from "../radio/index.mjs";
8
11
  import { RadioGroup } from "../radio-group/index.mjs";
12
+ import { Search } from "../search/index.mjs";
9
13
  const [name, bem] = createNamespace("radio-panel");
14
+ const escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
10
15
  const radioPanelProps = {
11
16
  show: Boolean,
12
17
  title: String,
13
18
  options: makeArrayProp(),
14
- modelValue: String
19
+ modelValue: String,
20
+ searchable: Boolean,
21
+ searchPlaceholder: String,
22
+ filterable: Boolean,
23
+ filterActive: Boolean,
24
+ loading: Boolean,
25
+ finished: Boolean,
26
+ error: Boolean,
27
+ lazy: Boolean,
28
+ loadingText: String,
29
+ finishedText: String,
30
+ errorText: String
15
31
  };
16
32
  var stdin_default = defineComponent({
17
33
  name,
18
34
  props: radioPanelProps,
19
- emits: ["update:show", "update:modelValue", "select"],
35
+ emits: ["update:show", "update:modelValue", "update:loading", "update:error", "select", "search", "filter", "load"],
20
36
  setup(props, {
21
- emit
37
+ emit,
38
+ slots
22
39
  }) {
40
+ const keyword = ref("");
41
+ const filteredOptions = computed(() => {
42
+ const query = keyword.value.trim().toLocaleLowerCase();
43
+ if (!query)
44
+ return props.options;
45
+ return props.options.filter((option) => option.label.toLocaleLowerCase().includes(query));
46
+ });
23
47
  const close = () => emit("update:show", false);
24
48
  const select = (option) => {
25
49
  if (option.disabled)
@@ -28,6 +52,48 @@ var stdin_default = defineComponent({
28
52
  emit("select", option.value);
29
53
  close();
30
54
  };
55
+ const renderOptionLabel = (label) => {
56
+ const query = keyword.value.trim();
57
+ if (!query)
58
+ return label;
59
+ const normalizedQuery = query.toLocaleLowerCase();
60
+ return label.split(new RegExp(`(${escapeRegExp(query)})`, "ig")).map((part) => part.toLocaleLowerCase() === normalizedQuery ? _createVNode("span", {
61
+ "class": bem("match")
62
+ }, [part]) : part);
63
+ };
64
+ const renderOptions = () => {
65
+ if (!filteredOptions.value.length) {
66
+ return _createVNode(Empty, {
67
+ "imageSize": 60,
68
+ "description": "\u6682\u65E0\u5339\u914D\u9009\u9879"
69
+ }, null);
70
+ }
71
+ return _createVNode(RadioGroup, {
72
+ "modelValue": props.modelValue,
73
+ "onUpdate:modelValue": (value) => {
74
+ const option = props.options.find((item) => item.value === value);
75
+ if (option)
76
+ select(option);
77
+ }
78
+ }, {
79
+ default: () => [filteredOptions.value.map((option) => _createVNode(Cell, {
80
+ "key": option.value,
81
+ "clickable": !option.disabled,
82
+ "title": option.label,
83
+ "titleStyle": {
84
+ color: props.modelValue === option.value ? "var(--van-primary-color)" : void 0
85
+ },
86
+ "onClick": () => select(option)
87
+ }, {
88
+ title: () => renderOptionLabel(option.label),
89
+ "right-icon": () => _createVNode(Radio, {
90
+ "name": option.value,
91
+ "disabled": option.disabled,
92
+ "onClick": (event) => event.stopPropagation()
93
+ }, null)
94
+ }))]
95
+ });
96
+ };
31
97
  return () => _createVNode(ActionSheet, {
32
98
  "show": props.show,
33
99
  "class": bem(),
@@ -46,35 +112,55 @@ var stdin_default = defineComponent({
46
112
  "name": "cross",
47
113
  "size": "22",
48
114
  "onClick": close
49
- }, null)
50
- })]), _createVNode("div", {
115
+ }, null),
116
+ right: () => {
117
+ if (slots.filter)
118
+ return slots.filter();
119
+ if (!props.filterable)
120
+ return;
121
+ return _createVNode("button", {
122
+ "type": "button",
123
+ "class": bem("filter"),
124
+ "aria-label": "\u7B5B\u9009",
125
+ "onClick": () => emit("filter")
126
+ }, [_createVNode(Badge, {
127
+ "dot": props.filterActive
128
+ }, {
129
+ default: () => [_createVNode(Icon, {
130
+ "name": "filter-o",
131
+ "size": "22"
132
+ }, null)]
133
+ })]);
134
+ }
135
+ })]), props.searchable && _createVNode(Search, {
136
+ "modelValue": keyword.value,
137
+ "class": bem("search"),
138
+ "shape": "round",
139
+ "inputAlign": "left",
140
+ "placeholder": props.searchPlaceholder || "\u8BF7\u8F93\u5165\u641C\u7D22\u5173\u952E\u8BCD",
141
+ "maxlength": 200,
142
+ "onUpdate:modelValue": (value) => {
143
+ keyword.value = value;
144
+ emit("search", value);
145
+ },
146
+ "onSearch": (value) => emit("search", value)
147
+ }, null), _createVNode("div", {
51
148
  "class": bem("body")
52
149
  }, [_createVNode("div", {
53
150
  "class": bem("card")
54
- }, [_createVNode(RadioGroup, {
55
- "modelValue": props.modelValue,
56
- "onUpdate:modelValue": (value) => {
57
- const option = props.options.find((item) => item.value === value);
58
- if (option)
59
- select(option);
60
- }
151
+ }, [props.lazy ? _createVNode(List, {
152
+ "loading": props.loading,
153
+ "finished": props.finished,
154
+ "error": props.error,
155
+ "loadingText": props.loadingText,
156
+ "finishedText": props.finishedText,
157
+ "errorText": props.errorText,
158
+ "onUpdate:loading": (value) => emit("update:loading", value),
159
+ "onUpdate:error": (value) => emit("update:error", value),
160
+ "onLoad": () => emit("load")
61
161
  }, {
62
- default: () => [props.options.map((option) => _createVNode(Cell, {
63
- "key": option.value,
64
- "clickable": !option.disabled,
65
- "title": option.label,
66
- "titleStyle": {
67
- color: props.modelValue === option.value ? "var(--van-primary-color)" : void 0
68
- },
69
- "onClick": () => select(option)
70
- }, {
71
- "right-icon": () => _createVNode(Radio, {
72
- "name": option.value,
73
- "disabled": option.disabled,
74
- "onClick": (event) => event.stopPropagation()
75
- }, null)
76
- }))]
77
- })])])])]
162
+ default: () => [renderOptions()]
163
+ }) : renderOptions()])])])]
78
164
  });
79
165
  }
80
166
  });