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.
- package/es/cascader/Cascader.d.ts +1 -1
- package/es/cascader/index.d.ts +1 -1
- package/es/coupon-list/style/index.mjs +1 -1
- package/es/coupon-list/style/less.mjs +1 -1
- package/es/index.d.ts +2 -2
- package/es/index.mjs +4 -4
- package/es/label/Label.d.ts +92 -0
- package/es/label/Label.mjs +95 -0
- package/es/label/index.css +1 -0
- package/es/label/index.d.ts +64 -0
- package/es/label/index.less +113 -0
- package/es/label/index.mjs +8 -0
- package/es/label/style/index.mjs +6 -0
- package/es/label/style/less.mjs +6 -0
- package/es/label/var.less +11 -0
- package/es/location-select/style/index.mjs +1 -1
- package/es/location-select/style/less.mjs +1 -1
- package/es/material-add/MaterialAdd.d.ts +105 -1
- package/es/material-add/MaterialAdd.mjs +63 -23
- package/es/material-add/index.d.ts +73 -1
- package/es/quantity-input/QuantityInput.d.ts +1 -1
- package/es/quantity-input/index.d.ts +2 -2
- package/es/radio-panel/RadioPanel.d.ts +46 -1
- package/es/radio-panel/RadioPanel.mjs +115 -29
- package/es/radio-panel/index.css +1 -1
- package/es/radio-panel/index.d.ts +35 -1
- package/es/radio-panel/index.less +17 -0
- package/es/radio-panel/style/index.mjs +4 -0
- package/es/radio-panel/style/less.mjs +4 -0
- package/es/sticky/Sticky.d.ts +1 -1
- package/es/sticky/index.d.ts +1 -1
- package/es/tabs/TabsTitle.mjs +1 -0
- package/es/tabs/index.css +1 -1
- package/es/tabs/index.less +11 -0
- package/es/tag/Tag.d.ts +1 -1
- package/es/tag/index.css +1 -1
- package/es/tag/index.less +7 -0
- package/es/tag/var.less +3 -0
- package/lib/cascader/Cascader.d.ts +1 -1
- package/lib/cascader/index.d.ts +1 -1
- package/lib/coupon-list/style/index.js +1 -1
- package/lib/coupon-list/style/less.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +4 -4
- package/lib/index.less +6 -6
- package/lib/label/Label.d.ts +92 -0
- package/lib/label/Label.js +114 -0
- package/lib/label/index.css +1 -0
- package/lib/label/index.d.ts +64 -0
- package/lib/{bot-mobile/session-filter.js → label/index.js} +16 -13
- package/lib/label/index.less +113 -0
- package/lib/label/style/index.js +6 -0
- package/lib/label/style/less.js +6 -0
- package/lib/label/var.less +11 -0
- package/lib/location-select/style/index.js +1 -1
- package/lib/location-select/style/less.js +1 -1
- package/lib/material-add/MaterialAdd.d.ts +105 -1
- package/lib/material-add/MaterialAdd.js +63 -23
- package/lib/material-add/index.d.ts +73 -1
- package/lib/quantity-input/QuantityInput.d.ts +1 -1
- package/lib/quantity-input/index.d.ts +2 -2
- package/lib/radio-panel/RadioPanel.d.ts +46 -1
- package/lib/radio-panel/RadioPanel.js +114 -28
- package/lib/radio-panel/index.css +1 -1
- package/lib/radio-panel/index.d.ts +35 -1
- package/lib/radio-panel/index.less +17 -0
- package/lib/radio-panel/style/index.js +4 -0
- package/lib/radio-panel/style/less.js +4 -0
- package/lib/sticky/Sticky.d.ts +1 -1
- package/lib/sticky/index.d.ts +1 -1
- package/lib/tabs/TabsTitle.js +1 -0
- package/lib/tabs/index.css +1 -1
- package/lib/tabs/index.less +11 -0
- package/lib/tag/Tag.d.ts +1 -1
- package/lib/tag/index.css +1 -1
- package/lib/tag/index.less +7 -0
- package/lib/tag/var.less +3 -0
- package/lib/vant.cjs.js +1212 -1769
- package/lib/vant.es.js +1212 -1769
- package/lib/vant.js +13016 -24376
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +4 -4
- package/es/bot-mobile/BotFab.d.ts +0 -72
- package/es/bot-mobile/BotFab.mjs +0 -152
- package/es/bot-mobile/BotHistoryDrawer.d.ts +0 -72
- package/es/bot-mobile/BotHistoryDrawer.mjs +0 -97
- package/es/bot-mobile/BotMobile.d.ts +0 -83
- package/es/bot-mobile/BotMobile.mjs +0 -47
- package/es/bot-mobile/BotMobileContextTags.d.ts +0 -52
- package/es/bot-mobile/BotMobileContextTags.mjs +0 -52
- package/es/bot-mobile/BotMobilePrompts.d.ts +0 -54
- package/es/bot-mobile/BotMobilePrompts.mjs +0 -49
- package/es/bot-mobile/BotMobileSheet.d.ts +0 -92
- package/es/bot-mobile/BotMobileSheet.mjs +0 -50
- package/es/bot-mobile/BotMobileView.d.ts +0 -82
- package/es/bot-mobile/BotMobileView.mjs +0 -45
- package/es/bot-mobile/BotSessionList.d.ts +0 -71
- package/es/bot-mobile/BotSessionList.mjs +0 -99
- package/es/bot-mobile/BotVoiceBar.d.ts +0 -80
- package/es/bot-mobile/BotVoiceBar.mjs +0 -138
- package/es/bot-mobile/fab-position.d.ts +0 -9
- package/es/bot-mobile/fab-position.mjs +0 -10
- package/es/bot-mobile/fab-position.test.d.ts +0 -1
- package/es/bot-mobile/fab-position.test.mjs +0 -29
- package/es/bot-mobile/index.css +0 -1
- package/es/bot-mobile/index.d.ts +0 -469
- package/es/bot-mobile/index.less +0 -464
- package/es/bot-mobile/index.mjs +0 -50
- package/es/bot-mobile/session-filter.d.ts +0 -6
- package/es/bot-mobile/session-filter.mjs +0 -15
- package/es/bot-mobile/session-item.d.ts +0 -15
- package/es/bot-mobile/session-item.mjs +0 -73
- package/es/bot-mobile/style/index.mjs +0 -15
- package/es/bot-mobile/style/less.mjs +0 -15
- package/es/bot-mobile/types.d.ts +0 -23
- package/es/bot-mobile/types.mjs +0 -0
- package/es/bot-mobile/var.less +0 -58
- package/es/bot-mobile/voice-zone.d.ts +0 -6
- package/es/bot-mobile/voice-zone.mjs +0 -6
- package/es/bot-mobile/voice-zone.test.d.ts +0 -1
- package/es/bot-mobile/voice-zone.test.mjs +0 -19
- package/lib/bot-mobile/BotFab.d.ts +0 -72
- package/lib/bot-mobile/BotFab.js +0 -171
- package/lib/bot-mobile/BotHistoryDrawer.d.ts +0 -72
- package/lib/bot-mobile/BotHistoryDrawer.js +0 -116
- package/lib/bot-mobile/BotMobile.d.ts +0 -83
- package/lib/bot-mobile/BotMobile.js +0 -66
- package/lib/bot-mobile/BotMobileContextTags.d.ts +0 -52
- package/lib/bot-mobile/BotMobileContextTags.js +0 -71
- package/lib/bot-mobile/BotMobilePrompts.d.ts +0 -54
- package/lib/bot-mobile/BotMobilePrompts.js +0 -68
- package/lib/bot-mobile/BotMobileSheet.d.ts +0 -92
- package/lib/bot-mobile/BotMobileSheet.js +0 -79
- package/lib/bot-mobile/BotMobileView.d.ts +0 -82
- package/lib/bot-mobile/BotMobileView.js +0 -64
- package/lib/bot-mobile/BotSessionList.d.ts +0 -71
- package/lib/bot-mobile/BotSessionList.js +0 -118
- package/lib/bot-mobile/BotVoiceBar.d.ts +0 -80
- package/lib/bot-mobile/BotVoiceBar.js +0 -157
- package/lib/bot-mobile/fab-position.d.ts +0 -9
- package/lib/bot-mobile/fab-position.js +0 -29
- package/lib/bot-mobile/fab-position.test.d.ts +0 -1
- package/lib/bot-mobile/fab-position.test.js +0 -29
- package/lib/bot-mobile/index.css +0 -1
- package/lib/bot-mobile/index.d.ts +0 -469
- package/lib/bot-mobile/index.js +0 -79
- package/lib/bot-mobile/index.less +0 -464
- package/lib/bot-mobile/session-filter.d.ts +0 -6
- package/lib/bot-mobile/session-item.d.ts +0 -15
- package/lib/bot-mobile/session-item.js +0 -92
- package/lib/bot-mobile/style/index.js +0 -15
- package/lib/bot-mobile/style/less.js +0 -15
- package/lib/bot-mobile/types.d.ts +0 -23
- package/lib/bot-mobile/types.js +0 -15
- package/lib/bot-mobile/var.less +0 -58
- package/lib/bot-mobile/voice-zone.d.ts +0 -6
- package/lib/bot-mobile/voice-zone.js +0 -25
- package/lib/bot-mobile/voice-zone.test.d.ts +0 -1
- package/lib/bot-mobile/voice-zone.test.js +0 -19
- /package/es/{bot-mobile → label}/var.css +0 -0
- /package/lib/{bot-mobile → label}/var.css +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "persagy-vant",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
4
4
|
"description": "Lightweight Mobile UI Components built on Vue",
|
|
5
5
|
"main": "lib/vant.cjs.js",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -54,9 +54,7 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@vant/popperjs": "1.2.1",
|
|
56
56
|
"@vant/use": "1.4.2",
|
|
57
|
-
"
|
|
58
|
-
"plyr": "3.7.8",
|
|
59
|
-
"pnpm": "^9.7.1"
|
|
57
|
+
"plyr": "3.7.8"
|
|
60
58
|
},
|
|
61
59
|
"peerDependencies": {
|
|
62
60
|
"vue": "3.0.0"
|
|
@@ -69,6 +67,8 @@
|
|
|
69
67
|
"@vant/eslint-config": "3.5.0",
|
|
70
68
|
"@vue/runtime-core": "3.2.38",
|
|
71
69
|
"@vue/test-utils": "2.0.2",
|
|
70
|
+
"meos-bot-web": "^0.3.2",
|
|
71
|
+
"persagy-bot-mobile": "workspace:*",
|
|
72
72
|
"standard-version": "9.5.0",
|
|
73
73
|
"typescript": "4.8.2",
|
|
74
74
|
"vue": "3.2.38",
|
|
@@ -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;
|
package/es/bot-mobile/BotFab.mjs
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { ref, computed, onMounted, defineComponent, createVNode as _createVNode } from "vue";
|
|
2
|
-
import { clamp, truthProp, numericProp, makeStringProp, makeNumberProp, createNamespace } from "../utils/index.mjs";
|
|
3
|
-
import { Icon } from "../icon/index.mjs";
|
|
4
|
-
import { resolveSnapSide, isTapNotDrag } from "./fab-position.mjs";
|
|
5
|
-
const [name, bem] = createNamespace("bot-mobile-fab");
|
|
6
|
-
const FAB_SIZE = 56;
|
|
7
|
-
const botFabProps = {
|
|
8
|
-
icon: makeStringProp("chat-o"),
|
|
9
|
-
side: makeStringProp("right"),
|
|
10
|
-
offsetBottom: makeNumberProp(80),
|
|
11
|
-
draggable: truthProp,
|
|
12
|
-
badge: numericProp
|
|
13
|
-
};
|
|
14
|
-
function getSafeAreaInsetBottom() {
|
|
15
|
-
if (typeof document === "undefined") {
|
|
16
|
-
return 0;
|
|
17
|
-
}
|
|
18
|
-
const probe = document.createElement("div");
|
|
19
|
-
probe.style.position = "fixed";
|
|
20
|
-
probe.style.left = "0";
|
|
21
|
-
probe.style.bottom = "0";
|
|
22
|
-
probe.style.height = "0";
|
|
23
|
-
probe.style.paddingBottom = "env(safe-area-inset-bottom)";
|
|
24
|
-
probe.style.visibility = "hidden";
|
|
25
|
-
probe.style.pointerEvents = "none";
|
|
26
|
-
document.body.appendChild(probe);
|
|
27
|
-
const value = parseFloat(getComputedStyle(probe).paddingBottom) || 0;
|
|
28
|
-
document.body.removeChild(probe);
|
|
29
|
-
return value;
|
|
30
|
-
}
|
|
31
|
-
var stdin_default = defineComponent({
|
|
32
|
-
name,
|
|
33
|
-
props: botFabProps,
|
|
34
|
-
emits: ["click", "positionChange"],
|
|
35
|
-
setup(props, {
|
|
36
|
-
emit
|
|
37
|
-
}) {
|
|
38
|
-
const side = ref(props.side);
|
|
39
|
-
const dragging = ref(false);
|
|
40
|
-
const dragLeft = ref(null);
|
|
41
|
-
const top = ref(typeof window === "undefined" ? 0 : window.innerHeight - FAB_SIZE - props.offsetBottom);
|
|
42
|
-
let safeAreaBottom = 0;
|
|
43
|
-
let pressing = false;
|
|
44
|
-
let moved = false;
|
|
45
|
-
let startX = 0;
|
|
46
|
-
let startY = 0;
|
|
47
|
-
let startTop = 0;
|
|
48
|
-
let startLeft = 0;
|
|
49
|
-
let elWidth = FAB_SIZE;
|
|
50
|
-
let elHeight = FAB_SIZE;
|
|
51
|
-
onMounted(() => {
|
|
52
|
-
safeAreaBottom = getSafeAreaInsetBottom();
|
|
53
|
-
});
|
|
54
|
-
const onPointerDown = (event) => {
|
|
55
|
-
if (event.button !== 0) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
const el = event.currentTarget;
|
|
59
|
-
try {
|
|
60
|
-
el.setPointerCapture(event.pointerId);
|
|
61
|
-
} catch (e) {
|
|
62
|
-
}
|
|
63
|
-
const rect = el.getBoundingClientRect();
|
|
64
|
-
pressing = true;
|
|
65
|
-
moved = false;
|
|
66
|
-
startX = event.clientX;
|
|
67
|
-
startY = event.clientY;
|
|
68
|
-
startTop = rect.top;
|
|
69
|
-
startLeft = rect.left;
|
|
70
|
-
elWidth = rect.width || FAB_SIZE;
|
|
71
|
-
elHeight = rect.height || FAB_SIZE;
|
|
72
|
-
if (props.draggable) {
|
|
73
|
-
top.value = startTop;
|
|
74
|
-
dragLeft.value = startLeft;
|
|
75
|
-
dragging.value = true;
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
const onPointerMove = (event) => {
|
|
79
|
-
if (!pressing || !props.draggable) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
const dx = event.clientX - startX;
|
|
83
|
-
const dy = event.clientY - startY;
|
|
84
|
-
if (!isTapNotDrag(dx, dy)) {
|
|
85
|
-
moved = true;
|
|
86
|
-
}
|
|
87
|
-
const maxLeft = Math.max(0, window.innerWidth - elWidth);
|
|
88
|
-
const maxTop = Math.max(0, window.innerHeight - elHeight - safeAreaBottom);
|
|
89
|
-
dragLeft.value = clamp(startLeft + dx, 0, maxLeft);
|
|
90
|
-
top.value = clamp(startTop + dy, 0, maxTop);
|
|
91
|
-
};
|
|
92
|
-
const finishGesture = (dx, dy, cancelled) => {
|
|
93
|
-
var _a;
|
|
94
|
-
if (!pressing) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
pressing = false;
|
|
98
|
-
if (props.draggable) {
|
|
99
|
-
dragging.value = false;
|
|
100
|
-
const currentLeft = (_a = dragLeft.value) != null ? _a : startLeft;
|
|
101
|
-
const nextSide = resolveSnapSide(currentLeft + elWidth / 2, window.innerWidth);
|
|
102
|
-
side.value = nextSide;
|
|
103
|
-
dragLeft.value = null;
|
|
104
|
-
emit("positionChange", {
|
|
105
|
-
side: nextSide,
|
|
106
|
-
top: top.value
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
if (!cancelled && !moved && isTapNotDrag(dx, dy)) {
|
|
110
|
-
emit("click");
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
const onPointerUp = (event) => {
|
|
114
|
-
finishGesture(event.clientX - startX, event.clientY - startY, false);
|
|
115
|
-
};
|
|
116
|
-
const onPointerCancel = () => {
|
|
117
|
-
finishGesture(0, 0, true);
|
|
118
|
-
};
|
|
119
|
-
const fabStyle = computed(() => {
|
|
120
|
-
const style = {
|
|
121
|
-
top: `${top.value}px`
|
|
122
|
-
};
|
|
123
|
-
if (dragging.value && dragLeft.value !== null) {
|
|
124
|
-
style.left = `${dragLeft.value}px`;
|
|
125
|
-
} else {
|
|
126
|
-
style[side.value] = "0px";
|
|
127
|
-
}
|
|
128
|
-
return style;
|
|
129
|
-
});
|
|
130
|
-
return () => _createVNode("div", {
|
|
131
|
-
"class": bem({
|
|
132
|
-
dragging: dragging.value
|
|
133
|
-
}),
|
|
134
|
-
"style": fabStyle.value,
|
|
135
|
-
"role": "button",
|
|
136
|
-
"tabindex": 0,
|
|
137
|
-
"onPointerdown": onPointerDown,
|
|
138
|
-
"onPointermove": onPointerMove,
|
|
139
|
-
"onPointerup": onPointerUp,
|
|
140
|
-
"onPointercancel": onPointerCancel
|
|
141
|
-
}, [_createVNode(Icon, {
|
|
142
|
-
"class": bem("icon"),
|
|
143
|
-
"name": props.icon,
|
|
144
|
-
"size": 24,
|
|
145
|
-
"badge": props.badge
|
|
146
|
-
}, null)]);
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
export {
|
|
150
|
-
botFabProps,
|
|
151
|
-
stdin_default as default
|
|
152
|
-
};
|
|
@@ -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,97 +0,0 @@
|
|
|
1
|
-
import { ref, defineComponent, createVNode as _createVNode } from "vue";
|
|
2
|
-
import { truthProp, makeArrayProp, makeStringProp, createNamespace } from "../utils/index.mjs";
|
|
3
|
-
import { Popup } from "../popup/index.mjs";
|
|
4
|
-
import { Icon } from "../icon/index.mjs";
|
|
5
|
-
import { Search } from "../search/index.mjs";
|
|
6
|
-
import { filterSessions } from "./session-filter.mjs";
|
|
7
|
-
import { renderSessionItem } from "./session-item.mjs";
|
|
8
|
-
const [name, bem] = createNamespace("bot-mobile-history-drawer");
|
|
9
|
-
const botHistoryDrawerProps = {
|
|
10
|
-
show: Boolean,
|
|
11
|
-
sessions: makeArrayProp(),
|
|
12
|
-
activeId: makeStringProp(""),
|
|
13
|
-
searchable: truthProp,
|
|
14
|
-
title: makeStringProp("\u5386\u53F2\u4F1A\u8BDD")
|
|
15
|
-
};
|
|
16
|
-
var stdin_default = defineComponent({
|
|
17
|
-
name,
|
|
18
|
-
props: botHistoryDrawerProps,
|
|
19
|
-
emits: ["update:show", "select", "rename", "delete", "create"],
|
|
20
|
-
setup(props, {
|
|
21
|
-
emit
|
|
22
|
-
}) {
|
|
23
|
-
const keyword = ref("");
|
|
24
|
-
const editingId = ref("");
|
|
25
|
-
const editingName = ref("");
|
|
26
|
-
const close = () => emit("update:show", false);
|
|
27
|
-
const startRename = (session) => {
|
|
28
|
-
editingId.value = session.id;
|
|
29
|
-
editingName.value = session.name;
|
|
30
|
-
};
|
|
31
|
-
const cancelRename = () => {
|
|
32
|
-
editingId.value = "";
|
|
33
|
-
editingName.value = "";
|
|
34
|
-
};
|
|
35
|
-
const commitRename = (session) => {
|
|
36
|
-
if (editingId.value !== session.id) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
const nextName = editingName.value.trim();
|
|
40
|
-
cancelRename();
|
|
41
|
-
if (nextName && nextName !== session.name) {
|
|
42
|
-
emit("rename", {
|
|
43
|
-
session,
|
|
44
|
-
name: nextName
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
return () => _createVNode(Popup, {
|
|
49
|
-
"show": props.show,
|
|
50
|
-
"class": bem(),
|
|
51
|
-
"position": "right",
|
|
52
|
-
"teleport": "body",
|
|
53
|
-
"onUpdate:show": (show) => emit("update:show", show)
|
|
54
|
-
}, {
|
|
55
|
-
default: () => [_createVNode("div", {
|
|
56
|
-
"class": bem("header")
|
|
57
|
-
}, [_createVNode(Icon, {
|
|
58
|
-
"name": "cross",
|
|
59
|
-
"class": bem("close"),
|
|
60
|
-
"onClick": close
|
|
61
|
-
}, null), _createVNode("div", {
|
|
62
|
-
"class": bem("title")
|
|
63
|
-
}, [props.title]), _createVNode(Icon, {
|
|
64
|
-
"name": "plus",
|
|
65
|
-
"class": bem("create"),
|
|
66
|
-
"onClick": () => emit("create")
|
|
67
|
-
}, null)]), props.searchable && _createVNode(Search, {
|
|
68
|
-
"modelValue": keyword.value,
|
|
69
|
-
"onUpdate:modelValue": ($event) => keyword.value = $event,
|
|
70
|
-
"class": bem("search"),
|
|
71
|
-
"shape": "round",
|
|
72
|
-
"placeholder": "\u641C\u7D22\u4F1A\u8BDD",
|
|
73
|
-
"clearable": true
|
|
74
|
-
}, null), _createVNode("div", {
|
|
75
|
-
"class": bem("list")
|
|
76
|
-
}, [filterSessions(props.sessions, keyword.value).map((session) => renderSessionItem({
|
|
77
|
-
key: session.id,
|
|
78
|
-
session,
|
|
79
|
-
active: session.id === props.activeId,
|
|
80
|
-
editing: editingId.value === session.id,
|
|
81
|
-
editingName: editingName.value,
|
|
82
|
-
onSelect: () => emit("select", session),
|
|
83
|
-
onStartRename: () => startRename(session),
|
|
84
|
-
onEditingNameInput: (value) => {
|
|
85
|
-
editingName.value = value;
|
|
86
|
-
},
|
|
87
|
-
onCommitRename: () => commitRename(session),
|
|
88
|
-
onCancelRename: cancelRename,
|
|
89
|
-
onDelete: () => emit("delete", session)
|
|
90
|
-
}))])]
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
export {
|
|
95
|
-
botHistoryDrawerProps,
|
|
96
|
-
stdin_default as default
|
|
97
|
-
};
|
|
@@ -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,47 +0,0 @@
|
|
|
1
|
-
import { ref, defineComponent, mergeProps as _mergeProps, createVNode as _createVNode } from "vue";
|
|
2
|
-
import { BotContainerNanobot } from "meos-bot-web";
|
|
3
|
-
import { truthProp, makeStringProp, makeArrayProp, createNamespace } from "../utils/index.mjs";
|
|
4
|
-
import { useExpose } from "../composables/use-expose.mjs";
|
|
5
|
-
const [name, bem] = createNamespace("bot-mobile");
|
|
6
|
-
const botMobileProps = {
|
|
7
|
-
gatewayBaseUrl: makeStringProp(""),
|
|
8
|
-
businessContext: Object,
|
|
9
|
-
references: makeArrayProp(),
|
|
10
|
-
title: String,
|
|
11
|
-
showHeader: truthProp,
|
|
12
|
-
showFooter: truthProp,
|
|
13
|
-
clientId: String,
|
|
14
|
-
autoConnect: truthProp
|
|
15
|
-
};
|
|
16
|
-
var stdin_default = defineComponent({
|
|
17
|
-
name,
|
|
18
|
-
inheritAttrs: false,
|
|
19
|
-
props: botMobileProps,
|
|
20
|
-
setup(props, {
|
|
21
|
-
attrs
|
|
22
|
-
}) {
|
|
23
|
-
const botRef = ref();
|
|
24
|
-
useExpose({
|
|
25
|
-
botRef
|
|
26
|
-
});
|
|
27
|
-
return () => _createVNode("div", {
|
|
28
|
-
"class": bem()
|
|
29
|
-
}, [_createVNode(BotContainerNanobot, _mergeProps({
|
|
30
|
-
"ref": botRef,
|
|
31
|
-
"gatewayBaseUrl": props.gatewayBaseUrl,
|
|
32
|
-
"businessContext": props.businessContext,
|
|
33
|
-
"references": props.references,
|
|
34
|
-
"title": props.title,
|
|
35
|
-
"showHeader": props.showHeader,
|
|
36
|
-
"showFooter": props.showFooter,
|
|
37
|
-
"clientId": props.clientId,
|
|
38
|
-
"autoConnect": props.autoConnect
|
|
39
|
-
}, attrs, {
|
|
40
|
-
"mode": "mobile"
|
|
41
|
-
}), null)]);
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
export {
|
|
45
|
-
botMobileProps,
|
|
46
|
-
stdin_default as default
|
|
47
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { type ExtractPropTypes } from 'vue';
|
|
2
|
-
import type { BotMobileContextTag } from './types';
|
|
3
|
-
export declare const botMobileContextTagsProps: {
|
|
4
|
-
tags: {
|
|
5
|
-
type: import("vue").PropType<BotMobileContextTag[]>;
|
|
6
|
-
default: () => never[];
|
|
7
|
-
};
|
|
8
|
-
modelValue: {
|
|
9
|
-
type: import("vue").PropType<string[]>;
|
|
10
|
-
default: () => never[];
|
|
11
|
-
};
|
|
12
|
-
max: {
|
|
13
|
-
type: NumberConstructor;
|
|
14
|
-
default: number;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export declare type BotMobileContextTagsProps = ExtractPropTypes<typeof botMobileContextTagsProps>;
|
|
18
|
-
declare const _default: import("vue").DefineComponent<{
|
|
19
|
-
tags: {
|
|
20
|
-
type: import("vue").PropType<BotMobileContextTag[]>;
|
|
21
|
-
default: () => never[];
|
|
22
|
-
};
|
|
23
|
-
modelValue: {
|
|
24
|
-
type: import("vue").PropType<string[]>;
|
|
25
|
-
default: () => never[];
|
|
26
|
-
};
|
|
27
|
-
max: {
|
|
28
|
-
type: NumberConstructor;
|
|
29
|
-
default: number;
|
|
30
|
-
};
|
|
31
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
32
|
-
tags: {
|
|
33
|
-
type: import("vue").PropType<BotMobileContextTag[]>;
|
|
34
|
-
default: () => never[];
|
|
35
|
-
};
|
|
36
|
-
modelValue: {
|
|
37
|
-
type: import("vue").PropType<string[]>;
|
|
38
|
-
default: () => never[];
|
|
39
|
-
};
|
|
40
|
-
max: {
|
|
41
|
-
type: NumberConstructor;
|
|
42
|
-
default: number;
|
|
43
|
-
};
|
|
44
|
-
}>> & {
|
|
45
|
-
onChange?: ((...args: any[]) => any) | undefined;
|
|
46
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
47
|
-
}, {
|
|
48
|
-
max: number;
|
|
49
|
-
tags: BotMobileContextTag[];
|
|
50
|
-
modelValue: string[];
|
|
51
|
-
}>;
|
|
52
|
-
export default _default;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { defineComponent, createVNode as _createVNode } from "vue";
|
|
2
|
-
import { makeArrayProp, makeNumberProp, createNamespace } from "../utils/index.mjs";
|
|
3
|
-
const [name, bem] = createNamespace("bot-mobile-context-tags");
|
|
4
|
-
const botMobileContextTagsProps = {
|
|
5
|
-
tags: makeArrayProp(),
|
|
6
|
-
modelValue: makeArrayProp(),
|
|
7
|
-
max: makeNumberProp(0)
|
|
8
|
-
};
|
|
9
|
-
var stdin_default = defineComponent({
|
|
10
|
-
name,
|
|
11
|
-
props: botMobileContextTagsProps,
|
|
12
|
-
emits: ["update:modelValue", "change"],
|
|
13
|
-
setup(props, {
|
|
14
|
-
emit
|
|
15
|
-
}) {
|
|
16
|
-
const toggle = (tag) => {
|
|
17
|
-
const selectedIds = props.modelValue;
|
|
18
|
-
const isSelected = selectedIds.includes(tag.id);
|
|
19
|
-
let nextIds;
|
|
20
|
-
if (isSelected) {
|
|
21
|
-
nextIds = selectedIds.filter((id) => id !== tag.id);
|
|
22
|
-
} else if (props.max === 1) {
|
|
23
|
-
nextIds = [tag.id];
|
|
24
|
-
} else if (props.max > 0 && selectedIds.length >= props.max) {
|
|
25
|
-
return;
|
|
26
|
-
} else {
|
|
27
|
-
nextIds = selectedIds.concat(tag.id);
|
|
28
|
-
}
|
|
29
|
-
emit("update:modelValue", nextIds);
|
|
30
|
-
emit("change", props.tags.filter((item) => nextIds.includes(item.id)));
|
|
31
|
-
};
|
|
32
|
-
const renderTag = (tag) => {
|
|
33
|
-
const selected = props.modelValue.includes(tag.id);
|
|
34
|
-
return _createVNode("div", {
|
|
35
|
-
"role": "button",
|
|
36
|
-
"tabindex": 0,
|
|
37
|
-
"key": tag.id,
|
|
38
|
-
"class": bem("item", {
|
|
39
|
-
selected
|
|
40
|
-
}),
|
|
41
|
-
"onClick": () => toggle(tag)
|
|
42
|
-
}, [tag.label]);
|
|
43
|
-
};
|
|
44
|
-
return () => _createVNode("div", {
|
|
45
|
-
"class": bem()
|
|
46
|
-
}, [props.tags.map(renderTag)]);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
export {
|
|
50
|
-
botMobileContextTagsProps,
|
|
51
|
-
stdin_default as default
|
|
52
|
-
};
|