cnhis-design-vue 3.1.40-beta.6 → 3.1.40-beta.7
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 +123 -123
- package/es/components/keyboard/index.d.ts +20 -2
- package/es/components/keyboard/src/Keyboard.vue.d.ts +20 -2
- package/es/components/keyboard/src/components/InputNumber.vue.d.ts +19 -2
- package/es/components/keyboard/src/components/InputNumber.vue.js +15 -5
- package/es/components/keyboard/src/components/NumberPanel.vue.d.ts +20 -2
- package/es/components/keyboard/src/components/NumberPanel.vue.js +14 -10
- package/es/components/scale-view/src/ScaleView.vue.d.ts +0 -3
- package/es/components/scale-view/src/ScaleView.vue.js +1 -1
- package/es/env.d.ts +24 -24
- package/package.json +2 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/tapable/index.d.ts +0 -139
package/README.md
CHANGED
|
@@ -1,123 +1,123 @@
|
|
|
1
|
-
# 安装
|
|
2
|
-
|
|
3
|
-
```shell
|
|
4
|
-
npm i cnhis-design-vue@[版本号]
|
|
5
|
-
# or
|
|
6
|
-
yarn add cnhis-design-vue@[版本号] #推荐
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## 1.全局引入
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
// main.ts
|
|
13
|
-
import { createApp } from 'vue';
|
|
14
|
-
import App from './App.vue';
|
|
15
|
-
import 'cnhis-design-vue/es/packages/index.css';
|
|
16
|
-
import cui from 'cnhis-design-vue';
|
|
17
|
-
|
|
18
|
-
const app = createApp(App);
|
|
19
|
-
app.use(cui).mount('#app');
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## 2. 按需引入
|
|
23
|
-
|
|
24
|
-
组件现在支持了自动按需引入, 但是样式文件需要额外的处理
|
|
25
|
-
|
|
26
|
-
### 2.1 样式处理方式 1(按需引入样式)
|
|
27
|
-
|
|
28
|
-
```shell
|
|
29
|
-
# 安装自动导入样式的插件
|
|
30
|
-
npm i -d vite-plugin-style-import
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
```typescript
|
|
34
|
-
// vite.config.ts
|
|
35
|
-
import { defineConfig } from 'vite';
|
|
36
|
-
import { createStyleImportPlugin } from 'vite-plugin-style-import';
|
|
37
|
-
|
|
38
|
-
export default defineConfig({
|
|
39
|
-
plugins: [
|
|
40
|
-
// ...otherPlugins
|
|
41
|
-
createStyleImportPlugin({
|
|
42
|
-
libs: [
|
|
43
|
-
{
|
|
44
|
-
libraryName: 'cnhis-design-vue',
|
|
45
|
-
esModule: true,
|
|
46
|
-
ensureStyleFile: true,
|
|
47
|
-
resolveStyle: name => {
|
|
48
|
-
return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
})
|
|
53
|
-
]
|
|
54
|
-
});
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### 2.2 样式处理方式 2(全局引入样式)
|
|
58
|
-
|
|
59
|
-
```typescript
|
|
60
|
-
// main.ts
|
|
61
|
-
import 'cnhis-design-vue/es/components/index.css';
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## 3. 注意
|
|
65
|
-
|
|
66
|
-
由于 vxe-table 目前的引入方式是由组件 install 触发的,所以如果需要使用 c-grid/c-big-table 组件,需要全局注册二者任意一个
|
|
67
|
-
|
|
68
|
-
```typescript
|
|
69
|
-
// main.ts
|
|
70
|
-
import { createApp } from 'vue';
|
|
71
|
-
import App from './App.vue';
|
|
72
|
-
|
|
73
|
-
import { CGrid } from 'cnhis-design-vue';
|
|
74
|
-
// 或者
|
|
75
|
-
import { CBigTable } from 'cnhis-design-vue';
|
|
76
|
-
|
|
77
|
-
const app = createApp(App);
|
|
78
|
-
app.use(CGrid);
|
|
79
|
-
// 或者
|
|
80
|
-
app.use(CBigTable);
|
|
81
|
-
app.mount('#app');
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
## 4.FAQ
|
|
85
|
-
|
|
86
|
-
### 4.1 项目打包后样式丢失
|
|
87
|
-
|
|
88
|
-
> 处理方法, 将 cnhis-design-vue 从 vendor 包中移除
|
|
89
|
-
|
|
90
|
-
```typescript
|
|
91
|
-
// vite.config.ts
|
|
92
|
-
import { defineConfig } from 'vite';
|
|
93
|
-
|
|
94
|
-
export default defineConfig({
|
|
95
|
-
rollupOptions: {
|
|
96
|
-
// ..otherOptions
|
|
97
|
-
output: {
|
|
98
|
-
dir: './dist',
|
|
99
|
-
manualChunks(id: string) {
|
|
100
|
-
if (id.includes('node_modules') && !id.includes('cnhis-design-vue')) {
|
|
101
|
-
return 'vendor';
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### 4.2 找不到文件
|
|
110
|
-
|
|
111
|
-
> 由于组件库输出文件类型由 js 修改成了 mjs, 如果配置了 resolve 属性的项目, 需要将 mjs 文件类型添加至 extensions 中
|
|
112
|
-
|
|
113
|
-
```javascript
|
|
114
|
-
// vite.config.ts
|
|
115
|
-
const config = {
|
|
116
|
-
// ...otherOptions
|
|
117
|
-
resolve: {
|
|
118
|
-
// ...otherOptions
|
|
119
|
-
// 如果没有配置, 则不用考虑
|
|
120
|
-
extensions: ['.js', '.ts', '.vue', '.json', '.mjs']
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
```
|
|
1
|
+
# 安装
|
|
2
|
+
|
|
3
|
+
```shell
|
|
4
|
+
npm i cnhis-design-vue@[版本号]
|
|
5
|
+
# or
|
|
6
|
+
yarn add cnhis-design-vue@[版本号] #推荐
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## 1.全局引入
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
// main.ts
|
|
13
|
+
import { createApp } from 'vue';
|
|
14
|
+
import App from './App.vue';
|
|
15
|
+
import 'cnhis-design-vue/es/packages/index.css';
|
|
16
|
+
import cui from 'cnhis-design-vue';
|
|
17
|
+
|
|
18
|
+
const app = createApp(App);
|
|
19
|
+
app.use(cui).mount('#app');
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 2. 按需引入
|
|
23
|
+
|
|
24
|
+
组件现在支持了自动按需引入, 但是样式文件需要额外的处理
|
|
25
|
+
|
|
26
|
+
### 2.1 样式处理方式 1(按需引入样式)
|
|
27
|
+
|
|
28
|
+
```shell
|
|
29
|
+
# 安装自动导入样式的插件
|
|
30
|
+
npm i -d vite-plugin-style-import
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
// vite.config.ts
|
|
35
|
+
import { defineConfig } from 'vite';
|
|
36
|
+
import { createStyleImportPlugin } from 'vite-plugin-style-import';
|
|
37
|
+
|
|
38
|
+
export default defineConfig({
|
|
39
|
+
plugins: [
|
|
40
|
+
// ...otherPlugins
|
|
41
|
+
createStyleImportPlugin({
|
|
42
|
+
libs: [
|
|
43
|
+
{
|
|
44
|
+
libraryName: 'cnhis-design-vue',
|
|
45
|
+
esModule: true,
|
|
46
|
+
ensureStyleFile: true,
|
|
47
|
+
resolveStyle: name => {
|
|
48
|
+
return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 2.2 样式处理方式 2(全局引入样式)
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
// main.ts
|
|
61
|
+
import 'cnhis-design-vue/es/components/index.css';
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## 3. 注意
|
|
65
|
+
|
|
66
|
+
由于 vxe-table 目前的引入方式是由组件 install 触发的,所以如果需要使用 c-grid/c-big-table 组件,需要全局注册二者任意一个
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
// main.ts
|
|
70
|
+
import { createApp } from 'vue';
|
|
71
|
+
import App from './App.vue';
|
|
72
|
+
|
|
73
|
+
import { CGrid } from 'cnhis-design-vue';
|
|
74
|
+
// 或者
|
|
75
|
+
import { CBigTable } from 'cnhis-design-vue';
|
|
76
|
+
|
|
77
|
+
const app = createApp(App);
|
|
78
|
+
app.use(CGrid);
|
|
79
|
+
// 或者
|
|
80
|
+
app.use(CBigTable);
|
|
81
|
+
app.mount('#app');
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## 4.FAQ
|
|
85
|
+
|
|
86
|
+
### 4.1 项目打包后样式丢失
|
|
87
|
+
|
|
88
|
+
> 处理方法, 将 cnhis-design-vue 从 vendor 包中移除
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
// vite.config.ts
|
|
92
|
+
import { defineConfig } from 'vite';
|
|
93
|
+
|
|
94
|
+
export default defineConfig({
|
|
95
|
+
rollupOptions: {
|
|
96
|
+
// ..otherOptions
|
|
97
|
+
output: {
|
|
98
|
+
dir: './dist',
|
|
99
|
+
manualChunks(id: string) {
|
|
100
|
+
if (id.includes('node_modules') && !id.includes('cnhis-design-vue')) {
|
|
101
|
+
return 'vendor';
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 4.2 找不到文件
|
|
110
|
+
|
|
111
|
+
> 由于组件库输出文件类型由 js 修改成了 mjs, 如果配置了 resolve 属性的项目, 需要将 mjs 文件类型添加至 extensions 中
|
|
112
|
+
|
|
113
|
+
```javascript
|
|
114
|
+
// vite.config.ts
|
|
115
|
+
const config = {
|
|
116
|
+
// ...otherOptions
|
|
117
|
+
resolve: {
|
|
118
|
+
// ...otherOptions
|
|
119
|
+
// 如果没有配置, 则不用考虑
|
|
120
|
+
extensions: ['.js', '.ts', '.vue', '.json', '.mjs']
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
```
|
|
@@ -181,6 +181,7 @@ declare const Keyboard: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
181
181
|
inputValueStatus: import("vue").Ref<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
182
182
|
numeratorValueStatus: import("vue").Ref<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
183
183
|
denominatorValueStatus: import("vue").Ref<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
184
|
+
inputSelect: import("vue").Ref<boolean>;
|
|
184
185
|
keyboardRef: import("vue").Ref<HTMLElement | null>;
|
|
185
186
|
style: import("vue").ComputedRef<string> | undefined;
|
|
186
187
|
init: () => import("vue").ComputedRef<string> | undefined;
|
|
@@ -207,6 +208,10 @@ declare const Keyboard: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
207
208
|
type: import("vue").PropType<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
208
209
|
default: string;
|
|
209
210
|
};
|
|
211
|
+
select: {
|
|
212
|
+
type: BooleanConstructor;
|
|
213
|
+
default: boolean;
|
|
214
|
+
};
|
|
210
215
|
}, {
|
|
211
216
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
212
217
|
modelValue: {
|
|
@@ -221,22 +226,29 @@ declare const Keyboard: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
221
226
|
type: import("vue").PropType<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
222
227
|
default: string;
|
|
223
228
|
};
|
|
229
|
+
select: {
|
|
230
|
+
type: BooleanConstructor;
|
|
231
|
+
default: boolean;
|
|
232
|
+
};
|
|
224
233
|
}>> & {
|
|
225
234
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
226
235
|
"onUpdate:status"?: ((...args: any[]) => any) | undefined;
|
|
236
|
+
"onUpdate:select"?: ((...args: any[]) => any) | undefined;
|
|
227
237
|
}>>;
|
|
228
|
-
emit: (event: "update:modelValue" | "update:status", ...args: any[]) => void;
|
|
238
|
+
emit: (event: "update:modelValue" | "update:status" | "update:select", ...args: any[]) => void;
|
|
229
239
|
inputRef: any;
|
|
230
240
|
toSelectInputContent: import("vue").Ref<number>;
|
|
231
241
|
update: (value: string | [string, string]) => void;
|
|
232
242
|
validator: (value: string) => boolean;
|
|
233
243
|
calculate: (type: string) => void;
|
|
244
|
+
unSelect: () => void;
|
|
245
|
+
onSelect: () => void;
|
|
234
246
|
NInput: any;
|
|
235
247
|
NIcon: any;
|
|
236
248
|
NSpace: any;
|
|
237
249
|
CaretDown: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
238
250
|
CaretUp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
239
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:status")[], "update:modelValue" | "update:status", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
251
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:status" | "update:select")[], "update:modelValue" | "update:status" | "update:select", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
240
252
|
modelValue: {
|
|
241
253
|
type: StringConstructor;
|
|
242
254
|
default: string;
|
|
@@ -249,13 +261,19 @@ declare const Keyboard: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
249
261
|
type: import("vue").PropType<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
250
262
|
default: string;
|
|
251
263
|
};
|
|
264
|
+
select: {
|
|
265
|
+
type: BooleanConstructor;
|
|
266
|
+
default: boolean;
|
|
267
|
+
};
|
|
252
268
|
}>> & {
|
|
253
269
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
254
270
|
"onUpdate:status"?: ((...args: any[]) => any) | undefined;
|
|
271
|
+
"onUpdate:select"?: ((...args: any[]) => any) | undefined;
|
|
255
272
|
}, {
|
|
256
273
|
modelValue: string;
|
|
257
274
|
status: import("naive-ui/es/form/src/interface").FormValidationStatus;
|
|
258
275
|
integer: boolean;
|
|
276
|
+
select: boolean;
|
|
259
277
|
}>;
|
|
260
278
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
261
279
|
defaultValue: {
|
|
@@ -182,6 +182,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
182
182
|
inputValueStatus: import("vue").Ref<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
183
183
|
numeratorValueStatus: import("vue").Ref<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
184
184
|
denominatorValueStatus: import("vue").Ref<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
185
|
+
inputSelect: import("vue").Ref<boolean>;
|
|
185
186
|
keyboardRef: import("vue").Ref<HTMLElement | null>;
|
|
186
187
|
style: import("vue").ComputedRef<string> | undefined;
|
|
187
188
|
init: () => import("vue").ComputedRef<string> | undefined;
|
|
@@ -208,6 +209,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
208
209
|
type: PropType<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
209
210
|
default: string;
|
|
210
211
|
};
|
|
212
|
+
select: {
|
|
213
|
+
type: BooleanConstructor;
|
|
214
|
+
default: boolean;
|
|
215
|
+
};
|
|
211
216
|
}, {
|
|
212
217
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
213
218
|
modelValue: {
|
|
@@ -222,22 +227,29 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
222
227
|
type: PropType<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
223
228
|
default: string;
|
|
224
229
|
};
|
|
230
|
+
select: {
|
|
231
|
+
type: BooleanConstructor;
|
|
232
|
+
default: boolean;
|
|
233
|
+
};
|
|
225
234
|
}>> & {
|
|
226
235
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
227
236
|
"onUpdate:status"?: ((...args: any[]) => any) | undefined;
|
|
237
|
+
"onUpdate:select"?: ((...args: any[]) => any) | undefined;
|
|
228
238
|
}>>;
|
|
229
|
-
emit: (event: "update:modelValue" | "update:status", ...args: any[]) => void;
|
|
239
|
+
emit: (event: "update:modelValue" | "update:status" | "update:select", ...args: any[]) => void;
|
|
230
240
|
inputRef: any;
|
|
231
241
|
toSelectInputContent: import("vue").Ref<number>;
|
|
232
242
|
update: (value: string | [string, string]) => void;
|
|
233
243
|
validator: (value: string) => boolean;
|
|
234
244
|
calculate: (type: string) => void;
|
|
245
|
+
unSelect: () => void;
|
|
246
|
+
onSelect: () => void;
|
|
235
247
|
NInput: any;
|
|
236
248
|
NIcon: any;
|
|
237
249
|
NSpace: any;
|
|
238
250
|
CaretDown: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
239
251
|
CaretUp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
240
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:status")[], "update:modelValue" | "update:status", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
252
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:status" | "update:select")[], "update:modelValue" | "update:status" | "update:select", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
241
253
|
modelValue: {
|
|
242
254
|
type: StringConstructor;
|
|
243
255
|
default: string;
|
|
@@ -250,13 +262,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
250
262
|
type: PropType<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
251
263
|
default: string;
|
|
252
264
|
};
|
|
265
|
+
select: {
|
|
266
|
+
type: BooleanConstructor;
|
|
267
|
+
default: boolean;
|
|
268
|
+
};
|
|
253
269
|
}>> & {
|
|
254
270
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
255
271
|
"onUpdate:status"?: ((...args: any[]) => any) | undefined;
|
|
272
|
+
"onUpdate:select"?: ((...args: any[]) => any) | undefined;
|
|
256
273
|
}, {
|
|
257
274
|
modelValue: string;
|
|
258
275
|
status: import("naive-ui/es/form/src/interface").FormValidationStatus;
|
|
259
276
|
integer: boolean;
|
|
277
|
+
select: boolean;
|
|
260
278
|
}>;
|
|
261
279
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
262
280
|
defaultValue: {
|
|
@@ -13,6 +13,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
13
13
|
type: PropType<FormValidationStatus>;
|
|
14
14
|
default: string;
|
|
15
15
|
};
|
|
16
|
+
select: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
default: boolean;
|
|
19
|
+
};
|
|
16
20
|
}, {
|
|
17
21
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
18
22
|
modelValue: {
|
|
@@ -27,22 +31,29 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
27
31
|
type: PropType<FormValidationStatus>;
|
|
28
32
|
default: string;
|
|
29
33
|
};
|
|
34
|
+
select: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
default: boolean;
|
|
37
|
+
};
|
|
30
38
|
}>> & {
|
|
31
39
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
32
40
|
"onUpdate:status"?: ((...args: any[]) => any) | undefined;
|
|
41
|
+
"onUpdate:select"?: ((...args: any[]) => any) | undefined;
|
|
33
42
|
}>>;
|
|
34
|
-
emit: (event: "update:modelValue" | "update:status", ...args: any[]) => void;
|
|
43
|
+
emit: (event: "update:modelValue" | "update:status" | "update:select", ...args: any[]) => void;
|
|
35
44
|
inputRef: any;
|
|
36
45
|
toSelectInputContent: Ref<number>;
|
|
37
46
|
update: (value: string | [string, string]) => void;
|
|
38
47
|
validator: (value: string) => boolean;
|
|
39
48
|
calculate: (type: string) => void;
|
|
49
|
+
unSelect: () => void;
|
|
50
|
+
onSelect: () => void;
|
|
40
51
|
NInput: any;
|
|
41
52
|
NIcon: any;
|
|
42
53
|
NSpace: any;
|
|
43
54
|
CaretDown: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
44
55
|
CaretUp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
45
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:status")[], "update:modelValue" | "update:status", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
56
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:status" | "update:select")[], "update:modelValue" | "update:status" | "update:select", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
46
57
|
modelValue: {
|
|
47
58
|
type: StringConstructor;
|
|
48
59
|
default: string;
|
|
@@ -55,12 +66,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
55
66
|
type: PropType<FormValidationStatus>;
|
|
56
67
|
default: string;
|
|
57
68
|
};
|
|
69
|
+
select: {
|
|
70
|
+
type: BooleanConstructor;
|
|
71
|
+
default: boolean;
|
|
72
|
+
};
|
|
58
73
|
}>> & {
|
|
59
74
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
60
75
|
"onUpdate:status"?: ((...args: any[]) => any) | undefined;
|
|
76
|
+
"onUpdate:select"?: ((...args: any[]) => any) | undefined;
|
|
61
77
|
}, {
|
|
62
78
|
modelValue: string;
|
|
63
79
|
status: FormValidationStatus;
|
|
64
80
|
integer: boolean;
|
|
81
|
+
select: boolean;
|
|
65
82
|
}>;
|
|
66
83
|
export default _default;
|
|
@@ -9,9 +9,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
9
9
|
props: {
|
|
10
10
|
modelValue: { type: String, default: "" },
|
|
11
11
|
integer: { type: Boolean, default: false },
|
|
12
|
-
status: { type: String, default: "success" }
|
|
12
|
+
status: { type: String, default: "success" },
|
|
13
|
+
select: { type: Boolean, default: false }
|
|
13
14
|
},
|
|
14
|
-
emits: ["update:modelValue", "update:status"],
|
|
15
|
+
emits: ["update:modelValue", "update:status", "update:select"],
|
|
15
16
|
setup(__props, { emit }) {
|
|
16
17
|
const props = __props;
|
|
17
18
|
const inputRef = ref(null);
|
|
@@ -35,16 +36,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
35
36
|
emit("update:modelValue", newValue.toString());
|
|
36
37
|
emit("update:status", "success");
|
|
37
38
|
}
|
|
39
|
+
function unSelect() {
|
|
40
|
+
setTimeout(() => {
|
|
41
|
+
emit("update:select", false);
|
|
42
|
+
}, 1e3);
|
|
43
|
+
}
|
|
44
|
+
function onSelect() {
|
|
45
|
+
emit("update:select", true);
|
|
46
|
+
}
|
|
38
47
|
watch(
|
|
39
48
|
() => toSelectInputContent.value,
|
|
40
49
|
(value) => {
|
|
41
50
|
var _a, _b;
|
|
42
|
-
(_b = (_a = inputRef.value) == null ? void 0 : _a.select) == null ? void 0 : _b.call(_a);
|
|
51
|
+
!props.integer && ((_b = (_a = inputRef.value) == null ? void 0 : _a.select) == null ? void 0 : _b.call(_a));
|
|
43
52
|
}
|
|
44
53
|
);
|
|
45
54
|
return (_ctx, _cache) => {
|
|
46
55
|
return openBlock(), createBlock(unref(NInput), {
|
|
47
|
-
autofocus: "",
|
|
48
56
|
ref_key: "inputRef",
|
|
49
57
|
ref: inputRef,
|
|
50
58
|
value: __props.modelValue,
|
|
@@ -52,7 +60,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
52
60
|
"allow-input": validator,
|
|
53
61
|
placeholder: "",
|
|
54
62
|
status: __props.status,
|
|
55
|
-
clearable: !__props.integer
|
|
63
|
+
clearable: !__props.integer,
|
|
64
|
+
onBlur: unSelect,
|
|
65
|
+
onSelect
|
|
56
66
|
}, {
|
|
57
67
|
suffix: withCtx(() => [
|
|
58
68
|
createVNode(unref(NSpace), {
|
|
@@ -79,6 +79,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
79
79
|
inputValueStatus: Ref<FormValidationStatus>;
|
|
80
80
|
numeratorValueStatus: Ref<FormValidationStatus>;
|
|
81
81
|
denominatorValueStatus: Ref<FormValidationStatus>;
|
|
82
|
+
inputSelect: Ref<boolean>;
|
|
82
83
|
keyboardRef: Ref<HTMLElement | null>;
|
|
83
84
|
style: import("vue").ComputedRef<string> | undefined;
|
|
84
85
|
init: () => import("vue").ComputedRef<string> | undefined;
|
|
@@ -105,6 +106,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
105
106
|
type: PropType<FormValidationStatus>;
|
|
106
107
|
default: string;
|
|
107
108
|
};
|
|
109
|
+
select: {
|
|
110
|
+
type: BooleanConstructor;
|
|
111
|
+
default: boolean;
|
|
112
|
+
};
|
|
108
113
|
}, {
|
|
109
114
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
110
115
|
modelValue: {
|
|
@@ -119,22 +124,29 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
119
124
|
type: PropType<FormValidationStatus>;
|
|
120
125
|
default: string;
|
|
121
126
|
};
|
|
127
|
+
select: {
|
|
128
|
+
type: BooleanConstructor;
|
|
129
|
+
default: boolean;
|
|
130
|
+
};
|
|
122
131
|
}>> & {
|
|
123
132
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
124
133
|
"onUpdate:status"?: ((...args: any[]) => any) | undefined;
|
|
134
|
+
"onUpdate:select"?: ((...args: any[]) => any) | undefined;
|
|
125
135
|
}>>;
|
|
126
|
-
emit: (event: "update:modelValue" | "update:status", ...args: any[]) => void;
|
|
136
|
+
emit: (event: "update:modelValue" | "update:status" | "update:select", ...args: any[]) => void;
|
|
127
137
|
inputRef: any;
|
|
128
138
|
toSelectInputContent: Ref<number>;
|
|
129
139
|
update: (value: string | [string, string]) => void;
|
|
130
140
|
validator: (value: string) => boolean;
|
|
131
141
|
calculate: (type: string) => void;
|
|
142
|
+
unSelect: () => void;
|
|
143
|
+
onSelect: () => void;
|
|
132
144
|
NInput: any;
|
|
133
145
|
NIcon: any;
|
|
134
146
|
NSpace: any;
|
|
135
147
|
CaretDown: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
136
148
|
CaretUp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
137
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:status")[], "update:modelValue" | "update:status", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
149
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:status" | "update:select")[], "update:modelValue" | "update:status" | "update:select", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
138
150
|
modelValue: {
|
|
139
151
|
type: StringConstructor;
|
|
140
152
|
default: string;
|
|
@@ -147,13 +159,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
147
159
|
type: PropType<FormValidationStatus>;
|
|
148
160
|
default: string;
|
|
149
161
|
};
|
|
162
|
+
select: {
|
|
163
|
+
type: BooleanConstructor;
|
|
164
|
+
default: boolean;
|
|
165
|
+
};
|
|
150
166
|
}>> & {
|
|
151
167
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
152
168
|
"onUpdate:status"?: ((...args: any[]) => any) | undefined;
|
|
169
|
+
"onUpdate:select"?: ((...args: any[]) => any) | undefined;
|
|
153
170
|
}, {
|
|
154
171
|
modelValue: string;
|
|
155
172
|
status: FormValidationStatus;
|
|
156
173
|
integer: boolean;
|
|
174
|
+
select: boolean;
|
|
157
175
|
}>;
|
|
158
176
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
159
177
|
defaultValue: {
|
|
@@ -44,6 +44,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
44
44
|
const inputValueStatus = ref("success");
|
|
45
45
|
const numeratorValueStatus = ref("success");
|
|
46
46
|
const denominatorValueStatus = ref("success");
|
|
47
|
+
const inputSelect = ref(false);
|
|
47
48
|
const keyboardRef = ref(null);
|
|
48
49
|
const style = init();
|
|
49
50
|
function init() {
|
|
@@ -87,12 +88,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
87
88
|
arr.splice(-1, 1, key);
|
|
88
89
|
inputValue.value = arr.join("");
|
|
89
90
|
} else {
|
|
90
|
-
inputValue.value = (((_b = (_a = inputValue.value) == null ? void 0 : _a.toString) == null ? void 0 : _b.call(_a)) || "") + key;
|
|
91
|
+
inputValue.value = inputSelect.value ? key.toString() : (((_b = (_a = inputValue.value) == null ? void 0 : _a.toString) == null ? void 0 : _b.call(_a)) || "") + key;
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
setInputValueStatus();
|
|
94
95
|
break;
|
|
95
96
|
}
|
|
97
|
+
inputSelect.value = false;
|
|
96
98
|
}
|
|
97
99
|
function validator() {
|
|
98
100
|
if (!inputValue.value)
|
|
@@ -175,8 +177,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
175
177
|
modelValue: inputValue.value,
|
|
176
178
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
|
|
177
179
|
status: inputValueStatus.value,
|
|
178
|
-
"onUpdate:status": _cache[1] || (_cache[1] = ($event) => inputValueStatus.value = $event)
|
|
179
|
-
|
|
180
|
+
"onUpdate:status": _cache[1] || (_cache[1] = ($event) => inputValueStatus.value = $event),
|
|
181
|
+
select: inputSelect.value,
|
|
182
|
+
"onUpdate:select": _cache[2] || (_cache[2] = ($event) => inputSelect.value = $event)
|
|
183
|
+
}, null, 8, ["modelValue", "status", "select"]),
|
|
180
184
|
createElementVNode("div", _hoisted_1, [
|
|
181
185
|
createVNode(unref(NSpace), {
|
|
182
186
|
class: "margin-offset",
|
|
@@ -200,13 +204,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
200
204
|
default: withCtx(() => [
|
|
201
205
|
createElementVNode("span", {
|
|
202
206
|
class: "opt",
|
|
203
|
-
onClick: _cache[
|
|
207
|
+
onClick: _cache[3] || (_cache[3] = ($event) => keydown("Undo"))
|
|
204
208
|
}, [
|
|
205
209
|
createVNode(unref(NIcon), { component: unref(ArrowUndoSharp) }, null, 8, ["component"])
|
|
206
210
|
]),
|
|
207
211
|
createElementVNode("span", {
|
|
208
212
|
class: "opt",
|
|
209
|
-
onClick: _cache[
|
|
213
|
+
onClick: _cache[4] || (_cache[4] = ($event) => keydown("Enter"))
|
|
210
214
|
}, "\u786E\u5B9A")
|
|
211
215
|
]),
|
|
212
216
|
_: 1
|
|
@@ -256,23 +260,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
256
260
|
createVNode(InputNumber, {
|
|
257
261
|
integer: "",
|
|
258
262
|
modelValue: integerValue.value,
|
|
259
|
-
"onUpdate:modelValue": _cache[
|
|
263
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => integerValue.value = $event)
|
|
260
264
|
}, null, 8, ["modelValue"]),
|
|
261
265
|
createElementVNode("div", _hoisted_7, [
|
|
262
266
|
createVNode(InputNumber, {
|
|
263
267
|
integer: "",
|
|
264
268
|
modelValue: numeratorValue.value,
|
|
265
|
-
"onUpdate:modelValue": _cache[
|
|
269
|
+
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => numeratorValue.value = $event),
|
|
266
270
|
status: numeratorValueStatus.value,
|
|
267
|
-
"onUpdate:status": _cache[
|
|
271
|
+
"onUpdate:status": _cache[7] || (_cache[7] = ($event) => numeratorValueStatus.value = $event)
|
|
268
272
|
}, null, 8, ["modelValue", "status"]),
|
|
269
273
|
_hoisted_8,
|
|
270
274
|
createVNode(InputNumber, {
|
|
271
275
|
integer: "",
|
|
272
276
|
modelValue: denominatorValue.value,
|
|
273
|
-
"onUpdate:modelValue": _cache[
|
|
277
|
+
"onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => denominatorValue.value = $event),
|
|
274
278
|
status: denominatorValueStatus.value,
|
|
275
|
-
"onUpdate:status": _cache[
|
|
279
|
+
"onUpdate:status": _cache[9] || (_cache[9] = ($event) => denominatorValueStatus.value = $event)
|
|
276
280
|
}, null, 8, ["modelValue", "status"])
|
|
277
281
|
])
|
|
278
282
|
]),
|