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
@@ -1,58 +0,0 @@
1
- @import '../style/var.less';
2
-
3
- @bot-mobile-primary-color: var(--van-primary-color);
4
- @bot-mobile-text-color: var(--van-text-color);
5
- @bot-mobile-border-color: var(--van-border-color);
6
- @bot-mobile-background-color: var(--van-background-color-light);
7
-
8
- @bot-mobile-prompts-title-color: var(--van-text-color-2);
9
- @bot-mobile-prompts-title-font-size: var(--van-font-size-sm);
10
- @bot-mobile-prompts-item-background: var(--van-background-color-light);
11
- @bot-mobile-prompts-item-border-color: var(--van-border-color);
12
- @bot-mobile-prompts-item-active-background: var(--van-active-color);
13
- @bot-mobile-prompts-item-selected-background: var(--van-blue-100);
14
- @bot-mobile-prompts-item-selected-border-color: var(--van-primary-color);
15
- @bot-mobile-prompts-item-selected-color: var(--van-primary-color);
16
- @bot-mobile-prompts-item-title-color: var(--van-text-color);
17
- @bot-mobile-prompts-item-desc-color: var(--van-text-color-2);
18
-
19
- @bot-mobile-context-tags-gap: 8px;
20
- @bot-mobile-context-tags-padding: 4px 12px;
21
- @bot-mobile-context-tags-font-size: var(--van-font-size-md);
22
- @bot-mobile-context-tags-line-height: var(--van-line-height-lg);
23
- @bot-mobile-context-tags-border-radius: var(--van-border-radius-lg);
24
- @bot-mobile-context-tags-color: var(--van-gray-8);
25
- @bot-mobile-context-tags-background-color: var(--van-gray-2);
26
- @bot-mobile-context-tags-selected-color: var(--van-bot-mobile-primary-color);
27
- @bot-mobile-context-tags-selected-background-color: var(--van-blue-100);
28
- @bot-mobile-context-tags-active-opacity: var(--van-active-opacity);
29
-
30
- @bot-mobile-sheet-height: 90%;
31
-
32
- @bot-mobile-fab-size: 56px;
33
- @bot-mobile-fab-z-index: 999;
34
- @bot-mobile-fab-color: var(--van-white);
35
- @bot-mobile-fab-background: var(--van-bot-mobile-primary-color);
36
- @bot-mobile-fab-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
37
-
38
- // 会话行公共 token:BotHistoryDrawer 与 BotSessionList 共用
39
- @bot-mobile-session-item-active-background: var(--van-active-color);
40
- @bot-mobile-session-item-name-color: var(--van-text-color);
41
- @bot-mobile-session-item-meta-color: var(--van-text-color-2);
42
- @bot-mobile-session-item-action-color: var(--van-text-color-3);
43
- @bot-mobile-session-item-danger-color: var(--van-danger-color);
44
-
45
- @bot-mobile-history-drawer-header-height: 52px;
46
- @bot-mobile-history-drawer-title-color: var(--van-text-color);
47
-
48
- @bot-mobile-voice-bar-height: 64px;
49
- @bot-mobile-voice-bar-background: var(--van-background-color-light);
50
- @bot-mobile-voice-bar-border-color: var(--van-border-color);
51
- @bot-mobile-voice-bar-recording-background: var(--van-blue-50);
52
- @bot-mobile-voice-bar-cancel-zone-background: var(--van-red);
53
- @bot-mobile-voice-bar-elapsed-color: var(--van-text-color);
54
- @bot-mobile-voice-bar-hint-color: var(--van-text-color-2);
55
- @bot-mobile-voice-bar-wave-color: var(--van-bot-mobile-primary-color);
56
-
57
- @bot-mobile-session-list-toolbar-padding: 8px 16px;
58
- @bot-mobile-session-list-create-color: var(--van-bot-mobile-primary-color);
@@ -1,6 +0,0 @@
1
- /**
2
- * BotVoiceBar 纯几何逻辑:上滑取消区判定。
3
- * 拆成纯函数便于单测,组件内 pointer 事件处理只负责采集坐标、调用这里。
4
- */
5
- /** 从按下点上滑超过 cancelDistance(px)即进入取消区;恰好达到阈值视为进入(>=) */
6
- export declare function isInCancelZone(startY: number, currentY: number, cancelDistance: number): boolean;
@@ -1,6 +0,0 @@
1
- function isInCancelZone(startY, currentY, cancelDistance) {
2
- return startY - currentY >= cancelDistance;
3
- }
4
- export {
5
- isInCancelZone
6
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,19 +0,0 @@
1
- import { isInCancelZone } from "./voice-zone.mjs";
2
- describe("isInCancelZone", () => {
3
- test("should not be in the cancel zone when the upward displacement is below the threshold", () => {
4
- expect(isInCancelZone(200, 150, 60)).toBe(false);
5
- });
6
- test("should be in the cancel zone once the upward displacement reaches the threshold", () => {
7
- expect(isInCancelZone(200, 140, 60)).toBe(true);
8
- });
9
- test("should be in the cancel zone when the upward displacement exceeds the threshold", () => {
10
- expect(isInCancelZone(200, 100, 60)).toBe(true);
11
- });
12
- test("should not be in the cancel zone for a downward movement", () => {
13
- expect(isInCancelZone(200, 260, 60)).toBe(false);
14
- });
15
- test("should respect a custom cancel distance", () => {
16
- expect(isInCancelZone(200, 170, 20)).toBe(true);
17
- expect(isInCancelZone(200, 190, 20)).toBe(false);
18
- });
19
- });
@@ -1,72 +0,0 @@
1
- import { type ExtractPropTypes } from 'vue';
2
- import { type FabSide } from './fab-position';
3
- export interface BotFabPositionChangePayload {
4
- side: FabSide;
5
- top: number;
6
- }
7
- export declare const botFabProps: {
8
- icon: {
9
- type: import("vue").PropType<string>;
10
- default: string;
11
- };
12
- side: {
13
- type: import("vue").PropType<FabSide>;
14
- default: FabSide;
15
- };
16
- offsetBottom: {
17
- type: NumberConstructor;
18
- default: number;
19
- };
20
- draggable: {
21
- type: BooleanConstructor;
22
- default: true;
23
- };
24
- badge: (NumberConstructor | StringConstructor)[];
25
- };
26
- export declare type BotFabProps = ExtractPropTypes<typeof botFabProps>;
27
- declare const _default: import("vue").DefineComponent<{
28
- icon: {
29
- type: import("vue").PropType<string>;
30
- default: string;
31
- };
32
- side: {
33
- type: import("vue").PropType<FabSide>;
34
- default: FabSide;
35
- };
36
- offsetBottom: {
37
- type: NumberConstructor;
38
- default: number;
39
- };
40
- draggable: {
41
- type: BooleanConstructor;
42
- default: true;
43
- };
44
- badge: (NumberConstructor | StringConstructor)[];
45
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "positionChange")[], "click" | "positionChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
46
- icon: {
47
- type: import("vue").PropType<string>;
48
- default: string;
49
- };
50
- side: {
51
- type: import("vue").PropType<FabSide>;
52
- default: FabSide;
53
- };
54
- offsetBottom: {
55
- type: NumberConstructor;
56
- default: number;
57
- };
58
- draggable: {
59
- type: BooleanConstructor;
60
- default: true;
61
- };
62
- badge: (NumberConstructor | StringConstructor)[];
63
- }>> & {
64
- onClick?: ((...args: any[]) => any) | undefined;
65
- onPositionChange?: ((...args: any[]) => any) | undefined;
66
- }, {
67
- icon: string;
68
- side: FabSide;
69
- offsetBottom: number;
70
- draggable: boolean;
71
- }>;
72
- export default _default;
@@ -1,171 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name2 in all)
7
- __defProp(target, name2, { get: all[name2], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var stdin_exports = {};
19
- __export(stdin_exports, {
20
- botFabProps: () => botFabProps,
21
- default: () => stdin_default
22
- });
23
- module.exports = __toCommonJS(stdin_exports);
24
- var import_vue = require("vue");
25
- var import_utils = require("../utils");
26
- var import_icon = require("../icon");
27
- var import_fab_position = require("./fab-position");
28
- const [name, bem] = (0, import_utils.createNamespace)("bot-mobile-fab");
29
- const FAB_SIZE = 56;
30
- const botFabProps = {
31
- icon: (0, import_utils.makeStringProp)("chat-o"),
32
- side: (0, import_utils.makeStringProp)("right"),
33
- offsetBottom: (0, import_utils.makeNumberProp)(80),
34
- draggable: import_utils.truthProp,
35
- badge: import_utils.numericProp
36
- };
37
- function getSafeAreaInsetBottom() {
38
- if (typeof document === "undefined") {
39
- return 0;
40
- }
41
- const probe = document.createElement("div");
42
- probe.style.position = "fixed";
43
- probe.style.left = "0";
44
- probe.style.bottom = "0";
45
- probe.style.height = "0";
46
- probe.style.paddingBottom = "env(safe-area-inset-bottom)";
47
- probe.style.visibility = "hidden";
48
- probe.style.pointerEvents = "none";
49
- document.body.appendChild(probe);
50
- const value = parseFloat(getComputedStyle(probe).paddingBottom) || 0;
51
- document.body.removeChild(probe);
52
- return value;
53
- }
54
- var stdin_default = (0, import_vue.defineComponent)({
55
- name,
56
- props: botFabProps,
57
- emits: ["click", "positionChange"],
58
- setup(props, {
59
- emit
60
- }) {
61
- const side = (0, import_vue.ref)(props.side);
62
- const dragging = (0, import_vue.ref)(false);
63
- const dragLeft = (0, import_vue.ref)(null);
64
- const top = (0, import_vue.ref)(typeof window === "undefined" ? 0 : window.innerHeight - FAB_SIZE - props.offsetBottom);
65
- let safeAreaBottom = 0;
66
- let pressing = false;
67
- let moved = false;
68
- let startX = 0;
69
- let startY = 0;
70
- let startTop = 0;
71
- let startLeft = 0;
72
- let elWidth = FAB_SIZE;
73
- let elHeight = FAB_SIZE;
74
- (0, import_vue.onMounted)(() => {
75
- safeAreaBottom = getSafeAreaInsetBottom();
76
- });
77
- const onPointerDown = (event) => {
78
- if (event.button !== 0) {
79
- return;
80
- }
81
- const el = event.currentTarget;
82
- try {
83
- el.setPointerCapture(event.pointerId);
84
- } catch (e) {
85
- }
86
- const rect = el.getBoundingClientRect();
87
- pressing = true;
88
- moved = false;
89
- startX = event.clientX;
90
- startY = event.clientY;
91
- startTop = rect.top;
92
- startLeft = rect.left;
93
- elWidth = rect.width || FAB_SIZE;
94
- elHeight = rect.height || FAB_SIZE;
95
- if (props.draggable) {
96
- top.value = startTop;
97
- dragLeft.value = startLeft;
98
- dragging.value = true;
99
- }
100
- };
101
- const onPointerMove = (event) => {
102
- if (!pressing || !props.draggable) {
103
- return;
104
- }
105
- const dx = event.clientX - startX;
106
- const dy = event.clientY - startY;
107
- if (!(0, import_fab_position.isTapNotDrag)(dx, dy)) {
108
- moved = true;
109
- }
110
- const maxLeft = Math.max(0, window.innerWidth - elWidth);
111
- const maxTop = Math.max(0, window.innerHeight - elHeight - safeAreaBottom);
112
- dragLeft.value = (0, import_utils.clamp)(startLeft + dx, 0, maxLeft);
113
- top.value = (0, import_utils.clamp)(startTop + dy, 0, maxTop);
114
- };
115
- const finishGesture = (dx, dy, cancelled) => {
116
- var _a;
117
- if (!pressing) {
118
- return;
119
- }
120
- pressing = false;
121
- if (props.draggable) {
122
- dragging.value = false;
123
- const currentLeft = (_a = dragLeft.value) != null ? _a : startLeft;
124
- const nextSide = (0, import_fab_position.resolveSnapSide)(currentLeft + elWidth / 2, window.innerWidth);
125
- side.value = nextSide;
126
- dragLeft.value = null;
127
- emit("positionChange", {
128
- side: nextSide,
129
- top: top.value
130
- });
131
- }
132
- if (!cancelled && !moved && (0, import_fab_position.isTapNotDrag)(dx, dy)) {
133
- emit("click");
134
- }
135
- };
136
- const onPointerUp = (event) => {
137
- finishGesture(event.clientX - startX, event.clientY - startY, false);
138
- };
139
- const onPointerCancel = () => {
140
- finishGesture(0, 0, true);
141
- };
142
- const fabStyle = (0, import_vue.computed)(() => {
143
- const style = {
144
- top: `${top.value}px`
145
- };
146
- if (dragging.value && dragLeft.value !== null) {
147
- style.left = `${dragLeft.value}px`;
148
- } else {
149
- style[side.value] = "0px";
150
- }
151
- return style;
152
- });
153
- return () => (0, import_vue.createVNode)("div", {
154
- "class": bem({
155
- dragging: dragging.value
156
- }),
157
- "style": fabStyle.value,
158
- "role": "button",
159
- "tabindex": 0,
160
- "onPointerdown": onPointerDown,
161
- "onPointermove": onPointerMove,
162
- "onPointerup": onPointerUp,
163
- "onPointercancel": onPointerCancel
164
- }, [(0, import_vue.createVNode)(import_icon.Icon, {
165
- "class": bem("icon"),
166
- "name": props.icon,
167
- "size": 24,
168
- "badge": props.badge
169
- }, null)]);
170
- }
171
- });
@@ -1,72 +0,0 @@
1
- import { type ExtractPropTypes } from 'vue';
2
- import type { BotMobileSession } from './types';
3
- export declare const botHistoryDrawerProps: {
4
- show: BooleanConstructor;
5
- sessions: {
6
- type: import("vue").PropType<BotMobileSession[]>;
7
- default: () => never[];
8
- };
9
- activeId: {
10
- type: import("vue").PropType<string>;
11
- default: string;
12
- };
13
- searchable: {
14
- type: BooleanConstructor;
15
- default: true;
16
- };
17
- title: {
18
- type: import("vue").PropType<string>;
19
- default: string;
20
- };
21
- };
22
- export declare type BotHistoryDrawerProps = ExtractPropTypes<typeof botHistoryDrawerProps>;
23
- declare const _default: import("vue").DefineComponent<{
24
- show: BooleanConstructor;
25
- sessions: {
26
- type: import("vue").PropType<BotMobileSession[]>;
27
- default: () => never[];
28
- };
29
- activeId: {
30
- type: import("vue").PropType<string>;
31
- default: string;
32
- };
33
- searchable: {
34
- type: BooleanConstructor;
35
- default: true;
36
- };
37
- title: {
38
- type: import("vue").PropType<string>;
39
- default: string;
40
- };
41
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "update:show" | "delete" | "rename" | "create")[], "select" | "update:show" | "delete" | "rename" | "create", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
42
- show: BooleanConstructor;
43
- sessions: {
44
- type: import("vue").PropType<BotMobileSession[]>;
45
- default: () => never[];
46
- };
47
- activeId: {
48
- type: import("vue").PropType<string>;
49
- default: string;
50
- };
51
- searchable: {
52
- type: BooleanConstructor;
53
- default: true;
54
- };
55
- title: {
56
- type: import("vue").PropType<string>;
57
- default: string;
58
- };
59
- }>> & {
60
- onSelect?: ((...args: any[]) => any) | undefined;
61
- "onUpdate:show"?: ((...args: any[]) => any) | undefined;
62
- onDelete?: ((...args: any[]) => any) | undefined;
63
- onRename?: ((...args: any[]) => any) | undefined;
64
- onCreate?: ((...args: any[]) => any) | undefined;
65
- }, {
66
- title: string;
67
- show: boolean;
68
- activeId: string;
69
- sessions: BotMobileSession[];
70
- searchable: boolean;
71
- }>;
72
- export default _default;
@@ -1,116 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name2 in all)
7
- __defProp(target, name2, { get: all[name2], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var stdin_exports = {};
19
- __export(stdin_exports, {
20
- botHistoryDrawerProps: () => botHistoryDrawerProps,
21
- default: () => stdin_default
22
- });
23
- module.exports = __toCommonJS(stdin_exports);
24
- var import_vue = require("vue");
25
- var import_utils = require("../utils");
26
- var import_popup = require("../popup");
27
- var import_icon = require("../icon");
28
- var import_search = require("../search");
29
- var import_session_filter = require("./session-filter");
30
- var import_session_item = require("./session-item");
31
- const [name, bem] = (0, import_utils.createNamespace)("bot-mobile-history-drawer");
32
- const botHistoryDrawerProps = {
33
- show: Boolean,
34
- sessions: (0, import_utils.makeArrayProp)(),
35
- activeId: (0, import_utils.makeStringProp)(""),
36
- searchable: import_utils.truthProp,
37
- title: (0, import_utils.makeStringProp)("\u5386\u53F2\u4F1A\u8BDD")
38
- };
39
- var stdin_default = (0, import_vue.defineComponent)({
40
- name,
41
- props: botHistoryDrawerProps,
42
- emits: ["update:show", "select", "rename", "delete", "create"],
43
- setup(props, {
44
- emit
45
- }) {
46
- const keyword = (0, import_vue.ref)("");
47
- const editingId = (0, import_vue.ref)("");
48
- const editingName = (0, import_vue.ref)("");
49
- const close = () => emit("update:show", false);
50
- const startRename = (session) => {
51
- editingId.value = session.id;
52
- editingName.value = session.name;
53
- };
54
- const cancelRename = () => {
55
- editingId.value = "";
56
- editingName.value = "";
57
- };
58
- const commitRename = (session) => {
59
- if (editingId.value !== session.id) {
60
- return;
61
- }
62
- const nextName = editingName.value.trim();
63
- cancelRename();
64
- if (nextName && nextName !== session.name) {
65
- emit("rename", {
66
- session,
67
- name: nextName
68
- });
69
- }
70
- };
71
- return () => (0, import_vue.createVNode)(import_popup.Popup, {
72
- "show": props.show,
73
- "class": bem(),
74
- "position": "right",
75
- "teleport": "body",
76
- "onUpdate:show": (show) => emit("update:show", show)
77
- }, {
78
- default: () => [(0, import_vue.createVNode)("div", {
79
- "class": bem("header")
80
- }, [(0, import_vue.createVNode)(import_icon.Icon, {
81
- "name": "cross",
82
- "class": bem("close"),
83
- "onClick": close
84
- }, null), (0, import_vue.createVNode)("div", {
85
- "class": bem("title")
86
- }, [props.title]), (0, import_vue.createVNode)(import_icon.Icon, {
87
- "name": "plus",
88
- "class": bem("create"),
89
- "onClick": () => emit("create")
90
- }, null)]), props.searchable && (0, import_vue.createVNode)(import_search.Search, {
91
- "modelValue": keyword.value,
92
- "onUpdate:modelValue": ($event) => keyword.value = $event,
93
- "class": bem("search"),
94
- "shape": "round",
95
- "placeholder": "\u641C\u7D22\u4F1A\u8BDD",
96
- "clearable": true
97
- }, null), (0, import_vue.createVNode)("div", {
98
- "class": bem("list")
99
- }, [(0, import_session_filter.filterSessions)(props.sessions, keyword.value).map((session) => (0, import_session_item.renderSessionItem)({
100
- key: session.id,
101
- session,
102
- active: session.id === props.activeId,
103
- editing: editingId.value === session.id,
104
- editingName: editingName.value,
105
- onSelect: () => emit("select", session),
106
- onStartRename: () => startRename(session),
107
- onEditingNameInput: (value) => {
108
- editingName.value = value;
109
- },
110
- onCommitRename: () => commitRename(session),
111
- onCancelRename: cancelRename,
112
- onDelete: () => emit("delete", session)
113
- }))])]
114
- });
115
- }
116
- });
@@ -1,83 +0,0 @@
1
- import { type PropType, type ExtractPropTypes } from 'vue';
2
- export declare const botMobileProps: {
3
- gatewayBaseUrl: {
4
- type: PropType<string>;
5
- default: string;
6
- };
7
- businessContext: PropType<Record<string, unknown>>;
8
- references: {
9
- type: PropType<unknown[]>;
10
- default: () => never[];
11
- };
12
- title: StringConstructor;
13
- showHeader: {
14
- type: BooleanConstructor;
15
- default: true;
16
- };
17
- showFooter: {
18
- type: BooleanConstructor;
19
- default: true;
20
- };
21
- clientId: StringConstructor;
22
- autoConnect: {
23
- type: BooleanConstructor;
24
- default: true;
25
- };
26
- };
27
- export declare type BotMobileProps = ExtractPropTypes<typeof botMobileProps>;
28
- declare const _default: import("vue").DefineComponent<{
29
- gatewayBaseUrl: {
30
- type: PropType<string>;
31
- default: string;
32
- };
33
- businessContext: PropType<Record<string, unknown>>;
34
- references: {
35
- type: PropType<unknown[]>;
36
- default: () => never[];
37
- };
38
- title: StringConstructor;
39
- showHeader: {
40
- type: BooleanConstructor;
41
- default: true;
42
- };
43
- showFooter: {
44
- type: BooleanConstructor;
45
- default: true;
46
- };
47
- clientId: StringConstructor;
48
- autoConnect: {
49
- type: BooleanConstructor;
50
- default: true;
51
- };
52
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
53
- gatewayBaseUrl: {
54
- type: PropType<string>;
55
- default: string;
56
- };
57
- businessContext: PropType<Record<string, unknown>>;
58
- references: {
59
- type: PropType<unknown[]>;
60
- default: () => never[];
61
- };
62
- title: StringConstructor;
63
- showHeader: {
64
- type: BooleanConstructor;
65
- default: true;
66
- };
67
- showFooter: {
68
- type: BooleanConstructor;
69
- default: true;
70
- };
71
- clientId: StringConstructor;
72
- autoConnect: {
73
- type: BooleanConstructor;
74
- default: true;
75
- };
76
- }>>, {
77
- gatewayBaseUrl: string;
78
- references: unknown[];
79
- showHeader: boolean;
80
- showFooter: boolean;
81
- autoConnect: boolean;
82
- }>;
83
- export default _default;
@@ -1,66 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name2 in all)
7
- __defProp(target, name2, { get: all[name2], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var stdin_exports = {};
19
- __export(stdin_exports, {
20
- botMobileProps: () => botMobileProps,
21
- default: () => stdin_default
22
- });
23
- module.exports = __toCommonJS(stdin_exports);
24
- var import_vue = require("vue");
25
- var import_meos_bot_web = require("meos-bot-web");
26
- var import_utils = require("../utils");
27
- var import_use_expose = require("../composables/use-expose");
28
- const [name, bem] = (0, import_utils.createNamespace)("bot-mobile");
29
- const botMobileProps = {
30
- gatewayBaseUrl: (0, import_utils.makeStringProp)(""),
31
- businessContext: Object,
32
- references: (0, import_utils.makeArrayProp)(),
33
- title: String,
34
- showHeader: import_utils.truthProp,
35
- showFooter: import_utils.truthProp,
36
- clientId: String,
37
- autoConnect: import_utils.truthProp
38
- };
39
- var stdin_default = (0, import_vue.defineComponent)({
40
- name,
41
- inheritAttrs: false,
42
- props: botMobileProps,
43
- setup(props, {
44
- attrs
45
- }) {
46
- const botRef = (0, import_vue.ref)();
47
- (0, import_use_expose.useExpose)({
48
- botRef
49
- });
50
- return () => (0, import_vue.createVNode)("div", {
51
- "class": bem()
52
- }, [(0, import_vue.createVNode)(import_meos_bot_web.BotContainerNanobot, (0, import_vue.mergeProps)({
53
- "ref": botRef,
54
- "gatewayBaseUrl": props.gatewayBaseUrl,
55
- "businessContext": props.businessContext,
56
- "references": props.references,
57
- "title": props.title,
58
- "showHeader": props.showHeader,
59
- "showFooter": props.showFooter,
60
- "clientId": props.clientId,
61
- "autoConnect": props.autoConnect
62
- }, attrs, {
63
- "mode": "mobile"
64
- }), null)]);
65
- }
66
- });