@jctrans-materials/comps-vue2 1.0.37-beta.2 → 1.0.37-beta.21
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/README.md +159 -0
- package/dist/components/JcCarrierSearch/AirCarrierSearch.d.ts +4 -4
- package/dist/components/JcCarrierSearch/AirLineSearch.d.ts +4 -4
- package/dist/components/JcCarrierSearch/SeaCarrierSearch.d.ts +4 -4
- package/dist/components/JcCarrierSearch/SeaLineSearch.d.ts +4 -4
- package/dist/components/JcCarrierSearch/index.d.ts +9 -8
- package/dist/components/JcSearch/hooks/useSearchHistory.d.ts +2 -2
- package/dist/components/JcSearch/hooks/useSearchLogic.d.ts +2 -2
- package/dist/components/JcSearch/hooks/useSelectBehavior.d.ts +1 -1
- package/dist/components/JcSearch/index.d.ts +18 -18
- package/dist/gio.d.ts +60 -0
- package/dist/gio.test.d.ts +2 -0
- package/dist/hooks/useLang.d.ts +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.esm.js +1907 -1694
- package/package.json +12 -3
package/README.md
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Vue2 组件说明(jc-utils)
|
|
2
|
+
|
|
3
|
+
## 组件清单
|
|
4
|
+
|
|
5
|
+
当前 `packages/vue2` 对外导出的核心组件如下:
|
|
6
|
+
|
|
7
|
+
- `ApplyDataDialog`
|
|
8
|
+
- `GlobalModal`
|
|
9
|
+
- `JcSearch`
|
|
10
|
+
- `JcVerifySlide`
|
|
11
|
+
- `JcCarrierSearch`
|
|
12
|
+
- `AirCarrierSearch`
|
|
13
|
+
- `SeaCarrierSearch`
|
|
14
|
+
- `AirLineSearch`
|
|
15
|
+
- `SeaLineSearch`
|
|
16
|
+
|
|
17
|
+
## 快速使用
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import Vue from "vue";
|
|
21
|
+
import JCtransComps from "@jctrans-materials/comps-vue2";
|
|
22
|
+
import "@jctrans-materials/comps-vue2/style.css";
|
|
23
|
+
|
|
24
|
+
Vue.use(JCtransComps);
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
如果你在 Vue 2.6 环境下使用,请额外安装并注册 `@vue/composition-api`;Vue 2.7 及以上版本不需要这一步。
|
|
28
|
+
|
|
29
|
+
## 组件能力速览
|
|
30
|
+
|
|
31
|
+
### 1) `JcSearch`
|
|
32
|
+
|
|
33
|
+
- 用途:国家/城市/港口/机场等通用地点搜索
|
|
34
|
+
- 常用 Props:`value` / `modelValue`、`multiple`、`searchTypeList`、`historyKey`
|
|
35
|
+
- 常用事件:`select`、`change`、`input`、`update:modelValue`
|
|
36
|
+
|
|
37
|
+
### 2) `JcVerifySlide`
|
|
38
|
+
|
|
39
|
+
- 用途:滑块验证码验证
|
|
40
|
+
- 常用 Props:`visible`、`lang`、`mode`、`imgSize`、`barSize`
|
|
41
|
+
- 常用事件:`success`、`update:visible`
|
|
42
|
+
|
|
43
|
+
### 3) `JcCarrierSearch` 及包装组件
|
|
44
|
+
|
|
45
|
+
- 用途:承运人/航线搜索(海运、空运)
|
|
46
|
+
- 常用 Props:`value` / `modelValue`、`type`、`lineType`、`multiple`、`showApplyData`
|
|
47
|
+
- 常用事件:
|
|
48
|
+
- 业务:`change`、`apply`
|
|
49
|
+
- 输入框:`focus`、`blur`、`remove-tag`
|
|
50
|
+
|
|
51
|
+
包装组件:
|
|
52
|
+
|
|
53
|
+
- `AirCarrierSearch`(航空公司)
|
|
54
|
+
- `SeaCarrierSearch`(船公司)
|
|
55
|
+
- `AirLineSearch`(空运航线)
|
|
56
|
+
- `SeaLineSearch`(海运航线)
|
|
57
|
+
|
|
58
|
+
### 4) `ApplyDataDialog`
|
|
59
|
+
|
|
60
|
+
- 用途:申请补充数据弹窗
|
|
61
|
+
- 常用 Props:`value`
|
|
62
|
+
- 常用事件:`confirm`、`input` / `update:value`
|
|
63
|
+
|
|
64
|
+
### 5) `GlobalModal`
|
|
65
|
+
|
|
66
|
+
- 用途:全局业务弹窗容器(配合插件/事件总线)
|
|
67
|
+
|
|
68
|
+
## Playground 示例
|
|
69
|
+
|
|
70
|
+
可在以下页面查看 Vue2 组件演示:
|
|
71
|
+
|
|
72
|
+
- `playground/v2play/src/App.vue`
|
|
73
|
+
- `Base Demo`:`JcSearch` + `ApplyDataDialog` + `GlobalModal`
|
|
74
|
+
- `Carrier Search Demo`:`JcCarrierSearch` 系列
|
|
75
|
+
- `Verify Slide Demo`:`JcVerifySlide`
|
|
76
|
+
|
|
77
|
+
## GIO 埋点接入(Vue2)
|
|
78
|
+
|
|
79
|
+
### 1) 按需启用(不传配置即不启用)
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
import Vue from "vue";
|
|
83
|
+
import JCtransComps from "@jctrans-materials/comps-vue2";
|
|
84
|
+
|
|
85
|
+
Vue.use(JCtransComps, {
|
|
86
|
+
tracking: {
|
|
87
|
+
enabled: true,
|
|
88
|
+
autoInit: true,
|
|
89
|
+
directiveName: "gio-track",
|
|
90
|
+
accountId: process.env.VUE_APP_GIO_ACCOUNT_ID,
|
|
91
|
+
dataSourceId: process.env.VUE_APP_GIO_DATA_SOURCE_ID,
|
|
92
|
+
appId: process.env.VUE_APP_GIO_APP_ID,
|
|
93
|
+
initOptions: {
|
|
94
|
+
debug: process.env.NODE_ENV !== "production",
|
|
95
|
+
trackPage: false,
|
|
96
|
+
serverUrl: process.env.VUE_APP_GIO_SERVER_URL,
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
如果不传 `tracking`,则不会初始化 GIO。
|
|
103
|
+
|
|
104
|
+
### 2) 指令与 API 用法
|
|
105
|
+
|
|
106
|
+
```vue
|
|
107
|
+
<button v-gio-track="'order_submit'">提交订单</button>
|
|
108
|
+
|
|
109
|
+
<button
|
|
110
|
+
v-gio-track="{
|
|
111
|
+
event: 'order_submit',
|
|
112
|
+
attrs: { source: 'cart' },
|
|
113
|
+
onTracked: ({ eventName }) => console.log(eventName),
|
|
114
|
+
}"
|
|
115
|
+
>
|
|
116
|
+
提交并回调
|
|
117
|
+
</button>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
```ts
|
|
121
|
+
this.$trackEvent("manual_track", { source: "manual" });
|
|
122
|
+
this.$gio.track("direct_track", { source: "direct" }, () => {
|
|
123
|
+
console.log("done");
|
|
124
|
+
});
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### 3) 配置优先级
|
|
128
|
+
|
|
129
|
+
1. `window.__JCTRANS_GIO_CONFIG__`(或 `globalVarName` 指定对象)
|
|
130
|
+
2. `tracking` 传入配置
|
|
131
|
+
3. `import.meta.env.VITE_GIO_*`
|
|
132
|
+
|
|
133
|
+
### 4) GIO 单测(Vue2)
|
|
134
|
+
|
|
135
|
+
测试文件:`src/gio.test.ts`
|
|
136
|
+
|
|
137
|
+
覆盖点:
|
|
138
|
+
|
|
139
|
+
- 初始化分支:
|
|
140
|
+
- 有 `appId`(4 参数 `init`)
|
|
141
|
+
- 无 `appId`(3 参数 `init`)
|
|
142
|
+
- 缺少必填配置时不初始化
|
|
143
|
+
- 指令行为:`bind` / `update` / `unbind` 的绑定、重绑、清理
|
|
144
|
+
- 回调行为:`onTracked` 在 `track` 回调后触发
|
|
145
|
+
- 暴露能力:`$trackEvent` 与 `$gio` 常用 API
|
|
146
|
+
|
|
147
|
+
结合 GrowingIO WebJS 常用 API 文档(含 `trackTimerStart`)对齐了以下接口可用性:
|
|
148
|
+
|
|
149
|
+
- `setUserId`
|
|
150
|
+
- `clearUserId`
|
|
151
|
+
- `setVisitor`
|
|
152
|
+
- `trackTimerStart`
|
|
153
|
+
- `trackTimerEnd`
|
|
154
|
+
|
|
155
|
+
运行方式:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
pnpm -C packages/vue2 test:run
|
|
159
|
+
```
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: import('vue').DefineComponent<{
|
|
1
|
+
declare const _default: import('../../../vue-demi').DefineComponent<{
|
|
2
2
|
value: {
|
|
3
3
|
type: (StringConstructor | NumberConstructor)[];
|
|
4
4
|
default: string;
|
|
@@ -20,12 +20,12 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
20
20
|
default: boolean;
|
|
21
21
|
};
|
|
22
22
|
}, {
|
|
23
|
-
carrierId: import('vue').WritableComputedRef<string | number>;
|
|
24
|
-
currentPlaceholder: import('vue').ComputedRef<string>;
|
|
23
|
+
carrierId: import('../../../vue-demi').WritableComputedRef<string | number>;
|
|
24
|
+
currentPlaceholder: import('../../../vue-demi').ComputedRef<string>;
|
|
25
25
|
onCarrierChange: (value: string | number) => void;
|
|
26
26
|
lang: string;
|
|
27
27
|
showApplyData: boolean;
|
|
28
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("input" | "update:modelValue" | "update:value" | "change" | "apply")[], string, Readonly<import('vue').ExtractPropTypes<{
|
|
28
|
+
}, {}, {}, {}, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, ("input" | "update:modelValue" | "update:value" | "change" | "apply" | "focus" | "blur" | "remove-tag")[], string, Readonly<import('../../../vue-demi').ExtractPropTypes<{
|
|
29
29
|
value: {
|
|
30
30
|
type: (StringConstructor | NumberConstructor)[];
|
|
31
31
|
default: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: import('vue').DefineComponent<{
|
|
1
|
+
declare const _default: import('../../../vue-demi').DefineComponent<{
|
|
2
2
|
value: {
|
|
3
3
|
type: (StringConstructor | NumberConstructor)[];
|
|
4
4
|
default: string;
|
|
@@ -20,12 +20,12 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
20
20
|
default: boolean;
|
|
21
21
|
};
|
|
22
22
|
}, {
|
|
23
|
-
carrierId: import('vue').WritableComputedRef<string | number>;
|
|
24
|
-
currentPlaceholder: import('vue').ComputedRef<string>;
|
|
23
|
+
carrierId: import('../../../vue-demi').WritableComputedRef<string | number>;
|
|
24
|
+
currentPlaceholder: import('../../../vue-demi').ComputedRef<string>;
|
|
25
25
|
onCarrierChange: (value: string | number) => void;
|
|
26
26
|
lang: string;
|
|
27
27
|
showApplyData: boolean;
|
|
28
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("input" | "update:modelValue" | "update:value" | "change" | "apply")[], string, Readonly<import('vue').ExtractPropTypes<{
|
|
28
|
+
}, {}, {}, {}, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, ("input" | "update:modelValue" | "update:value" | "change" | "apply" | "focus" | "blur" | "remove-tag")[], string, Readonly<import('../../../vue-demi').ExtractPropTypes<{
|
|
29
29
|
value: {
|
|
30
30
|
type: (StringConstructor | NumberConstructor)[];
|
|
31
31
|
default: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: import('vue').DefineComponent<{
|
|
1
|
+
declare const _default: import('../../../vue-demi').DefineComponent<{
|
|
2
2
|
value: {
|
|
3
3
|
type: (StringConstructor | NumberConstructor)[];
|
|
4
4
|
default: string;
|
|
@@ -20,12 +20,12 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
20
20
|
default: boolean;
|
|
21
21
|
};
|
|
22
22
|
}, {
|
|
23
|
-
carrierId: import('vue').WritableComputedRef<string | number>;
|
|
24
|
-
currentPlaceholder: import('vue').ComputedRef<string>;
|
|
23
|
+
carrierId: import('../../../vue-demi').WritableComputedRef<string | number>;
|
|
24
|
+
currentPlaceholder: import('../../../vue-demi').ComputedRef<string>;
|
|
25
25
|
onCarrierChange: (value: string | number) => void;
|
|
26
26
|
lang: string;
|
|
27
27
|
showApplyData: boolean;
|
|
28
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("input" | "update:modelValue" | "update:value" | "change" | "apply")[], string, Readonly<import('vue').ExtractPropTypes<{
|
|
28
|
+
}, {}, {}, {}, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, ("input" | "update:modelValue" | "update:value" | "change" | "apply" | "focus" | "blur" | "remove-tag")[], string, Readonly<import('../../../vue-demi').ExtractPropTypes<{
|
|
29
29
|
value: {
|
|
30
30
|
type: (StringConstructor | NumberConstructor)[];
|
|
31
31
|
default: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: import('vue').DefineComponent<{
|
|
1
|
+
declare const _default: import('../../../vue-demi').DefineComponent<{
|
|
2
2
|
value: {
|
|
3
3
|
type: (StringConstructor | NumberConstructor)[];
|
|
4
4
|
default: string;
|
|
@@ -20,12 +20,12 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
20
20
|
default: boolean;
|
|
21
21
|
};
|
|
22
22
|
}, {
|
|
23
|
-
carrierId: import('vue').WritableComputedRef<string | number>;
|
|
24
|
-
currentPlaceholder: import('vue').ComputedRef<string>;
|
|
23
|
+
carrierId: import('../../../vue-demi').WritableComputedRef<string | number>;
|
|
24
|
+
currentPlaceholder: import('../../../vue-demi').ComputedRef<string>;
|
|
25
25
|
onCarrierChange: (value: string | number) => void;
|
|
26
26
|
lang: string;
|
|
27
27
|
showApplyData: boolean;
|
|
28
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("input" | "update:modelValue" | "update:value" | "change" | "apply")[], string, Readonly<import('vue').ExtractPropTypes<{
|
|
28
|
+
}, {}, {}, {}, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, ("input" | "update:modelValue" | "update:value" | "change" | "apply" | "focus" | "blur" | "remove-tag")[], string, Readonly<import('../../../vue-demi').ExtractPropTypes<{
|
|
29
29
|
value: {
|
|
30
30
|
type: (StringConstructor | NumberConstructor)[];
|
|
31
31
|
default: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LocationUnifiedItem, LocationType } from '@jctrans-materials/shared';
|
|
2
2
|
|
|
3
|
-
declare const _default: import('vue').DefineComponent<{
|
|
3
|
+
declare const _default: import('../../../vue-demi').DefineComponent<{
|
|
4
4
|
value: {
|
|
5
5
|
type: (StringConstructor | NumberConstructor | ArrayConstructor)[];
|
|
6
6
|
default: undefined;
|
|
@@ -38,10 +38,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
38
38
|
default: () => never[];
|
|
39
39
|
};
|
|
40
40
|
}, {
|
|
41
|
-
selectRef: import('vue').Ref<any>;
|
|
42
|
-
innerValue: import('vue').WritableComputedRef<string | number | unknown[]>;
|
|
43
|
-
loading: import('vue').Ref<boolean>;
|
|
44
|
-
options: import('vue').Ref<{
|
|
41
|
+
selectRef: import('../../../vue-demi').Ref<any>;
|
|
42
|
+
innerValue: import('../../../vue-demi').WritableComputedRef<string | number | unknown[]>;
|
|
43
|
+
loading: import('../../../vue-demi').Ref<boolean>;
|
|
44
|
+
options: import('../../../vue-demi').Ref<{
|
|
45
45
|
id: number | string;
|
|
46
46
|
type: LocationType;
|
|
47
47
|
nameCn?: string | undefined;
|
|
@@ -60,18 +60,19 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
60
60
|
province?: Record<string, any> | undefined;
|
|
61
61
|
raw?: any;
|
|
62
62
|
}[]>;
|
|
63
|
-
currentPlaceholder: import('vue').ComputedRef<string>;
|
|
64
|
-
isEn: import('vue').ComputedRef<boolean>;
|
|
63
|
+
currentPlaceholder: import('../../../vue-demi').ComputedRef<string>;
|
|
64
|
+
isEn: import('../../../vue-demi').ComputedRef<boolean>;
|
|
65
65
|
onRemoteMethod: (query: string) => void;
|
|
66
66
|
handleVisibleChange: (visible: boolean) => void;
|
|
67
67
|
handleClear: () => void;
|
|
68
68
|
handleChange: (val: any) => void;
|
|
69
69
|
handleApply: () => void;
|
|
70
|
+
handleRemoveTag: (tag: any) => void;
|
|
70
71
|
ICON_MORE: string;
|
|
71
72
|
showApplyData: boolean;
|
|
72
73
|
normalizeOptionValue: (id: any) => any;
|
|
73
74
|
multiple: boolean;
|
|
74
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("input" | "update:modelValue" | "update:value" | "change" | "apply")[], string, Readonly<import('vue').ExtractPropTypes<{
|
|
75
|
+
}, {}, {}, {}, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, ("input" | "update:modelValue" | "update:value" | "change" | "apply" | "focus" | "blur" | "remove-tag")[], string, Readonly<import('../../../vue-demi').ExtractPropTypes<{
|
|
75
76
|
value: {
|
|
76
77
|
type: (StringConstructor | NumberConstructor | ArrayConstructor)[];
|
|
77
78
|
default: undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ref } from 'vue';
|
|
1
|
+
import { Ref } from 'vue-demi';
|
|
2
2
|
import { SearchItem } from '../type';
|
|
3
3
|
|
|
4
4
|
export declare function useSearchHistory(historyKey: Ref<string | undefined | any>): {
|
|
@@ -15,5 +15,5 @@ export declare function useSearchHistory(historyKey: Ref<string | undefined | an
|
|
|
15
15
|
}[]>;
|
|
16
16
|
saveToHistory: (item: SearchItem) => void;
|
|
17
17
|
clearHistory: () => void;
|
|
18
|
-
HasHistory: import('vue').ComputedRef<boolean>;
|
|
18
|
+
HasHistory: import('../../../../vue-demi').ComputedRef<boolean>;
|
|
19
19
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ref } from 'vue';
|
|
1
|
+
import { Ref } from 'vue-demi';
|
|
2
2
|
import { SearchItem } from '../type';
|
|
3
3
|
|
|
4
4
|
export declare function useSearchLogic(query: Ref<string>, searchTypeList: Ref<string[]>): {
|
|
@@ -15,7 +15,7 @@ export declare function useSearchLogic(query: Ref<string>, searchTypeList: Ref<s
|
|
|
15
15
|
}[]>;
|
|
16
16
|
loading: Ref<boolean>;
|
|
17
17
|
isFetchingMore: Ref<boolean>;
|
|
18
|
-
isFinished: import('vue').ComputedRef<boolean>;
|
|
18
|
+
isFinished: import('../../../../vue-demi').ComputedRef<boolean>;
|
|
19
19
|
currentPage: Ref<number>;
|
|
20
20
|
total: Ref<number>;
|
|
21
21
|
fetchData: (page?: number, appendMode?: boolean) => Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: import('vue').DefineComponent<{
|
|
1
|
+
declare const _default: import('../../../vue-demi').DefineComponent<{
|
|
2
2
|
value: {
|
|
3
3
|
type: (ArrayConstructor | ObjectConstructor)[];
|
|
4
4
|
default: null;
|
|
@@ -44,16 +44,16 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
44
44
|
default: boolean;
|
|
45
45
|
};
|
|
46
46
|
}, {
|
|
47
|
-
query: import('vue').Ref<string>;
|
|
48
|
-
isSelected: import('vue').Ref<boolean>;
|
|
49
|
-
isDropdownVisible: import('vue').Ref<boolean>;
|
|
50
|
-
applyDataVisible: import('vue').Ref<boolean>;
|
|
51
|
-
selectedLabel: import('vue').Ref<string>;
|
|
52
|
-
inputRef: import('vue').Ref<null>;
|
|
53
|
-
referenceRef: import('vue').Ref<null>;
|
|
54
|
-
floatingRef: import('vue').Ref<null>;
|
|
55
|
-
hasContentToShow: import('vue').ComputedRef<string | boolean>;
|
|
56
|
-
searchHistory: import('vue').Ref<{
|
|
47
|
+
query: import('../../../vue-demi').Ref<string>;
|
|
48
|
+
isSelected: import('../../../vue-demi').Ref<boolean>;
|
|
49
|
+
isDropdownVisible: import('../../../vue-demi').Ref<boolean>;
|
|
50
|
+
applyDataVisible: import('../../../vue-demi').Ref<boolean>;
|
|
51
|
+
selectedLabel: import('../../../vue-demi').Ref<string>;
|
|
52
|
+
inputRef: import('../../../vue-demi').Ref<null>;
|
|
53
|
+
referenceRef: import('../../../vue-demi').Ref<null>;
|
|
54
|
+
floatingRef: import('../../../vue-demi').Ref<null>;
|
|
55
|
+
hasContentToShow: import('../../../vue-demi').ComputedRef<string | boolean>;
|
|
56
|
+
searchHistory: import('../../../vue-demi').Ref<{
|
|
57
57
|
[x: string]: any;
|
|
58
58
|
id?: string | number | undefined;
|
|
59
59
|
type: string;
|
|
@@ -64,7 +64,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
64
64
|
nameEn?: string | undefined;
|
|
65
65
|
nameCn?: string | undefined;
|
|
66
66
|
}[]>;
|
|
67
|
-
searchResults: import('vue').Ref<{
|
|
67
|
+
searchResults: import('../../../vue-demi').Ref<{
|
|
68
68
|
[x: string]: any;
|
|
69
69
|
id?: string | number | undefined;
|
|
70
70
|
type: string;
|
|
@@ -75,11 +75,11 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
75
75
|
nameEn?: string | undefined;
|
|
76
76
|
nameCn?: string | undefined;
|
|
77
77
|
}[]>;
|
|
78
|
-
loading: import('vue').Ref<boolean>;
|
|
79
|
-
isFetchingMore: import('vue').Ref<boolean>;
|
|
80
|
-
isFinished: import('vue').ComputedRef<boolean>;
|
|
81
|
-
currentPage: import('vue').Ref<number>;
|
|
82
|
-
floatingStyles: import('vue').Ref<import('vue').CSSProperties>;
|
|
78
|
+
loading: import('../../../vue-demi').Ref<boolean>;
|
|
79
|
+
isFetchingMore: import('../../../vue-demi').Ref<boolean>;
|
|
80
|
+
isFinished: import('../../../vue-demi').ComputedRef<boolean>;
|
|
81
|
+
currentPage: import('../../../vue-demi').Ref<number>;
|
|
82
|
+
floatingStyles: import('../../../vue-demi').Ref<import('../../../vue-demi').CSSProperties>;
|
|
83
83
|
saveToHistory: (item: import('./type').SearchItem) => void;
|
|
84
84
|
clearHistory: () => void;
|
|
85
85
|
fetchData: (page?: number, appendMode?: boolean) => Promise<void>;
|
|
@@ -113,7 +113,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
113
113
|
handleSearch(): void;
|
|
114
114
|
getIconUrl(type: string): any;
|
|
115
115
|
handleScroll(e: any): void;
|
|
116
|
-
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, Readonly<import('vue').ExtractPropTypes<{
|
|
116
|
+
}, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, {}, string, Readonly<import('../../../vue-demi').ExtractPropTypes<{
|
|
117
117
|
value: {
|
|
118
118
|
type: (ArrayConstructor | ObjectConstructor)[];
|
|
119
119
|
default: null;
|
package/dist/gio.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { VueConstructor } from '../vue-demi';
|
|
2
|
+
|
|
3
|
+
export type TrackAttrs = Record<string, string | number | Array<string | number>>;
|
|
4
|
+
export type TrackDirectiveValue = string | {
|
|
5
|
+
event?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
attrs?: TrackAttrs;
|
|
8
|
+
attributes?: TrackAttrs;
|
|
9
|
+
trigger?: string;
|
|
10
|
+
once?: boolean;
|
|
11
|
+
stop?: boolean;
|
|
12
|
+
prevent?: boolean;
|
|
13
|
+
callback?: (payload: {
|
|
14
|
+
event: Event;
|
|
15
|
+
eventName: string;
|
|
16
|
+
attrs: TrackAttrs;
|
|
17
|
+
trigger: string;
|
|
18
|
+
}) => void;
|
|
19
|
+
onTracked?: (payload: {
|
|
20
|
+
event: Event;
|
|
21
|
+
eventName: string;
|
|
22
|
+
attrs: TrackAttrs;
|
|
23
|
+
trigger: string;
|
|
24
|
+
}) => void;
|
|
25
|
+
};
|
|
26
|
+
export type TrackConfig = {
|
|
27
|
+
enabled?: boolean;
|
|
28
|
+
autoInit?: boolean;
|
|
29
|
+
directiveName?: string;
|
|
30
|
+
globalVarName?: string;
|
|
31
|
+
accountId?: string;
|
|
32
|
+
dataSourceId?: string;
|
|
33
|
+
appId?: string;
|
|
34
|
+
serverUrl?: string;
|
|
35
|
+
initOptions?: {
|
|
36
|
+
debug?: boolean;
|
|
37
|
+
trackPage?: boolean;
|
|
38
|
+
forceLogin?: boolean;
|
|
39
|
+
idMapping?: boolean;
|
|
40
|
+
hashtag?: boolean;
|
|
41
|
+
serverUrl?: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export type GioPublicApi = {
|
|
45
|
+
isInitialized: () => boolean;
|
|
46
|
+
isBrowser: () => boolean;
|
|
47
|
+
init: (...args: any[]) => void;
|
|
48
|
+
track: (eventName: string, attrs?: TrackAttrs, callback?: () => void) => void;
|
|
49
|
+
setUserId: (userId: string) => void;
|
|
50
|
+
clearUserId: () => void;
|
|
51
|
+
setVisitor: (visitor: Record<string, any>) => void;
|
|
52
|
+
setGeneralProps: (props: Record<string, any>) => void;
|
|
53
|
+
setPageAttributes: (props: Record<string, any>) => void;
|
|
54
|
+
sendPage: () => void;
|
|
55
|
+
trackTimerStart: (eventName: string) => void;
|
|
56
|
+
trackTimerEnd: (eventName: string, attrs?: TrackAttrs) => void;
|
|
57
|
+
};
|
|
58
|
+
export declare function createGioTrackingPlugin(rawConfig?: TrackConfig): {
|
|
59
|
+
install(Vue: VueConstructor): void;
|
|
60
|
+
};
|
package/dist/hooks/useLang.d.ts
CHANGED