view-ui-plus-derive 0.0.2 → 0.1.0

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 CHANGED
@@ -1,11 +1,11 @@
1
1
  # view-ui-plus-derive
2
2
 
3
- 基于view-ui-plus的组件等扩展,需要vue 3.5+
3
+ 基于vue 3.5+与view-ui-plus的组件&优化扩展等
4
4
 
5
5
  ## 安装
6
6
 
7
7
  ```bash
8
- npm install view-ui-plus-derive
8
+ npm i view-ui-plus-derive
9
9
 
10
10
  or
11
11
 
@@ -14,7 +14,21 @@ yarn add view-ui-plus-derive
14
14
 
15
15
  [TOC]
16
16
 
17
- ## 使用
17
+ ### CDN引入
18
+
19
+ ```html
20
+ <link rel="stylesheet" href="https://unpkg.com/view-ui-plus/dist/styles/viewuiplus.css">
21
+ <link rel="stylesheet" href="https://unpkg.com/view-ui-plus-derive/dist/umd/index.css">
22
+ <script src="https://unpkg.com/vue"></script>
23
+ <script src="https://unpkg.com/view-ui-plus"></script>
24
+ <script src="https://unpkg.com/view-ui-plus-derive/dist/umd/index.js"></script>
25
+
26
+ <!-- <script src="https://unpkg.com/view-ui-plus-derive/dist/umd/en-US.js"></script> -->
27
+
28
+ <script>
29
+ Vue.createApp().use(ViewUIPlus).use(iviewDerive /*,{msg: iviewDeriveENUS} */).mount('#app')
30
+ </script>
31
+ ```
18
32
 
19
33
  ### 全局引入
20
34
 
@@ -22,12 +36,12 @@ yarn add view-ui-plus-derive
22
36
  import { createApp } from 'vue'
23
37
  import ViewUIPlus from 'view-ui-plus'
24
38
  import 'view-ui-plus/dist/styles/viewuiplus.css'
25
- import plugin from 'view-ui-plus-derive' // 注册组件与指令
39
+ import iviewDerive from 'view-ui-plus-derive' // 包含所有组件与指令
26
40
  import 'view-ui-plus-derive/style' // 引入所有组件样式
27
41
 
28
42
  import App from './App.vue'
29
43
 
30
- createApp(App).use(ViewUIPlus).use(plugin).mount('#app')
44
+ createApp(App).use(ViewUIPlus).use(iviewDerive).mount('#app')
31
45
  ```
32
46
 
33
47
  ### 按需引入
@@ -44,7 +58,7 @@ import App from './App.vue'
44
58
  createApp(App).use(ViewUIPlus).component(Combi.name, Combi).mount('#app')
45
59
  ```
46
60
 
47
- 仅部分组件有对应样式,如图
61
+ 仅部分组件需要对应样式,如图
48
62
  ![css](./assets/import%20component%20css.png)
49
63
 
50
64
  ### 多语言
@@ -57,14 +71,14 @@ createApp(App).use(ViewUIPlus).component(Combi.name, Combi).mount('#app')
57
71
  import { createApp } from 'vue'
58
72
  import ViewUIPlus from 'view-ui-plus'
59
73
  import 'view-ui-plus/dist/styles/viewuiplus.css'
60
- import viewUiDerive from 'view-ui-plus-derive'
74
+ import iviewDerive from 'view-ui-plus-derive'
61
75
  import enUS from 'view-ui-plus-derive/locale/en-US'
62
76
 
63
77
  import App from './App.vue'
64
78
 
65
79
  createApp(App)
66
80
  .use(ViewUIPlus)
67
- .use(viewUiDerive, {
81
+ .use(iviewDerive, {
68
82
  msg: enUS
69
83
  })
70
84
  .mount('#app')
@@ -76,13 +90,13 @@ createApp(App)
76
90
  import { createApp } from 'vue'
77
91
  import ViewUIPlus from 'view-ui-plus'
78
92
  import 'view-ui-plus/dist/styles/viewuiplus.css'
79
- import viewUiDerive from 'view-ui-plus-derive'
93
+ import iviewDerive from 'view-ui-plus-derive'
80
94
 
81
95
  import App from './App.vue'
82
96
 
83
97
  createApp(App)
84
98
  .use(ViewUIPlus)
85
- .use(viewUiDerive, {
99
+ .use(iviewDerive, {
86
100
  msg: {
87
101
  d: {
88
102
  lang: 'zh-Hant',
@@ -136,7 +150,7 @@ import ViewUIPlus from 'view-ui-plus'
136
150
  import zh from 'view-ui-plus/dist/locale/zh-CN'
137
151
  import en from 'view-ui-plus/dist/locale/en-US'
138
152
  import 'view-ui-plus/dist/styles/viewuiplus.css'
139
- import viewUiDerive from 'view-ui-plus-derive'
153
+ import iviewDerive from 'view-ui-plus-derive'
140
154
  import zhCN from 'view-ui-plus-derive/locale/zh-CN'
141
155
  import enUS from 'view-ui-plus-derive/locale/en-US'
142
156
 
@@ -169,14 +183,14 @@ const i18n = createI18n({
169
183
  createApp(App)
170
184
  .use(i18n)
171
185
  .use(ViewUIPlus)
172
- .use(viewUiDerive, {
186
+ .use(iviewDerive, {
173
187
  i18n
174
188
  // msgPrefix: 'someKey' // 该值仅针对使用vue-i18n的情况生效
175
189
  })
176
190
  .mount('#app')
177
191
  ```
178
192
 
179
- ### 其它扩展
193
+ ### 更多优化
180
194
 
181
195
  - 为多选模式的iview Select添加全选功能。**若全局安装了插件则无需再次注册指令**
182
196
 
@@ -185,7 +199,7 @@ createApp(App)
185
199
  import { createApp } from 'vue'
186
200
  import ViewUIPlus from 'view-ui-plus'
187
201
  import 'view-ui-plus/dist/styles/viewuiplus.css'
188
- import { iviewSelect } from "view-ui-plus-derive";
202
+ import { iviewSelect } from "view-ui-plus-derive"
189
203
  import App from './App.vue'
190
204
 
191
205
  createApp(App).use(ViewUIPlus).directive('iviewSelect', iviewSelect).mount('#app')
@@ -221,19 +235,31 @@ import 'view-ui-plus-derive/iview-mods/table'
221
235
  也可以一次性引入iview-mods下的input-number、select、table
222
236
 
223
237
  ```js
238
+ // 本地引入
224
239
  import 'view-ui-plus-derive/iview-mod'
225
240
  ```
226
241
 
242
+ ```html
243
+ <!-- CDN引入 -->
244
+ <script src="https://unpkg.com/view-ui-plus-derive/dist/umd/iview-mod.js"></script>
245
+ ```
246
+
227
247
  针对iview组件的样式优化
228
248
 
229
249
  - 修复带有固定列的Table存在水平滚动条时,固定列下方的滚动条无法点中
230
250
  - 防止Select在关闭选项时可能出现的点击更换选项bug
231
- - 调整Input、InputNumber、Select、Button在禁用状态下非placeholder的文本颜色为#7a7a7a
251
+ - 适当调整Input、InputNumber、Select、Button在禁用状态下非placeholder的文本颜色
232
252
 
233
253
  ```js
254
+ // 本地引入
234
255
  import 'view-ui-plus-derive/iview-mod.css'
235
256
  ```
236
257
 
258
+ ```html
259
+ <!-- CDN引入 -->
260
+ <link rel="stylesheet" href="https://unpkg.com/view-ui-plus-derive/dist/iview-mod.css">
261
+ ```
262
+
237
263
  ### 组件
238
264
 
239
265
  #### AllCheckbox
@@ -326,7 +352,7 @@ default({item})
326
352
 
327
353
  #### BaseSwitch
328
354
 
329
- 省去重复写slot的Switch
355
+ 更易于使用的Switch
330
356
 
331
357
  ```html
332
358
  <template>
@@ -387,7 +413,7 @@ close()
387
413
 
388
414
  #### RemoteSelect
389
415
 
390
- 远程请求数据的Select
416
+ 远程Select
391
417
 
392
418
  ```html
393
419
  <template>
@@ -553,7 +579,7 @@ text( { text })
553
579
 
554
580
  #### CacheSelect
555
581
 
556
- 同一个cacheId只请求一次数据的RemoteSelect
582
+ 避免重复调用远程接口的RemoteSelect,同一个cacheId对应只触发一次请求
557
583
 
558
584
  ```html
559
585
  <template>
@@ -1687,7 +1713,7 @@ emit('load', res)
1687
1713
  * 勾选项变更后触发
1688
1714
  * @param selections 勾选项
1689
1715
  */
1690
- emit('select-rows', selections)
1716
+ emit('selection-change', selections)
1691
1717
 
1692
1718
  /**
1693
1719
  * 更改全选框后触发
package/dist/index.d.ts CHANGED
@@ -324,7 +324,6 @@ autoGet: boolean;
324
324
  textMode: boolean;
325
325
  cache: boolean;
326
326
  strict: boolean;
327
- check: Function;
328
327
  getSelected: Function;
329
328
  }> & Omit<{
330
329
  readonly all: boolean;
@@ -337,7 +336,6 @@ readonly autoGet: boolean;
337
336
  readonly textMode: boolean;
338
337
  readonly cache: boolean;
339
338
  readonly strict: boolean;
340
- readonly check: Function;
341
339
  readonly getSelected: Function;
342
340
  readonly list?: Obj[] | undefined;
343
341
  readonly modelValue?: SelectValue | undefined;
@@ -351,13 +349,14 @@ readonly optionTag?: Function | undefined;
351
349
  readonly loader?: Function | undefined;
352
350
  readonly chosen?: Record<string, any> | unknown[] | undefined;
353
351
  readonly formatLabel?: Function | undefined;
352
+ readonly check?: Function | undefined;
354
353
  readonly parentCode?: string | number | unknown[] | undefined;
355
354
  readonly "onUpdate:modelValue"?: ((val: SelectValue) => any) | undefined;
356
355
  readonly "onUpdate:chosen"?: ((item: Obj) => any) | undefined;
357
356
  readonly "onUpdate:list"?: ((list: Obj[]) => any) | undefined;
358
357
  readonly "onUpdate:refresh"?: ((handle: () => Promise<void>) => any) | undefined;
359
358
  readonly onLoad?: ((val: any) => any) | undefined;
360
- } & VNodeProps & AllowedComponentProps & ComponentCustomProps, "all" | "multiple" | "valueKey" | "labelKey" | "keyMap" | "valueAsKey" | "autoGet" | "textMode" | "cache" | "strict" | "check" | "getSelected">;
359
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps, "all" | "multiple" | "valueKey" | "labelKey" | "keyMap" | "valueAsKey" | "autoGet" | "textMode" | "cache" | "strict" | "getSelected">;
361
360
  $attrs: {
362
361
  [x: string]: unknown;
363
362
  };
@@ -403,7 +402,6 @@ type: FunctionConstructor;
403
402
  };
404
403
  check: {
405
404
  type: FunctionConstructor;
406
- default: () => boolean;
407
405
  };
408
406
  textMode: BooleanConstructor;
409
407
  textFormat: FunctionConstructor;
@@ -457,7 +455,6 @@ autoGet: boolean;
457
455
  textMode: boolean;
458
456
  cache: boolean;
459
457
  strict: boolean;
460
- check: Function;
461
458
  getSelected: Function;
462
459
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
463
460
  beforeCreate?: (() => void) | (() => void)[];
@@ -490,7 +487,6 @@ autoGet: boolean;
490
487
  textMode: boolean;
491
488
  cache: boolean;
492
489
  strict: boolean;
493
- check: Function;
494
490
  getSelected: Function;
495
491
  }> & Omit<Readonly<ExtractPropTypes< {
496
492
  modelValue: PropType<SelectValue>;
@@ -523,7 +519,6 @@ type: FunctionConstructor;
523
519
  };
524
520
  check: {
525
521
  type: FunctionConstructor;
526
- default: () => boolean;
527
522
  };
528
523
  textMode: BooleanConstructor;
529
524
  textFormat: FunctionConstructor;
@@ -554,7 +549,7 @@ default: boolean;
554
549
  "onUpdate:list"?: ((list: Obj[]) => any) | undefined;
555
550
  "onUpdate:refresh"?: ((handle: () => Promise<void>) => any) | undefined;
556
551
  onLoad?: ((val: any) => any) | undefined;
557
- }>, "code" | "search" | "changeCode" | "loaded" | "codes" | ("all" | "multiple" | "valueKey" | "labelKey" | "keyMap" | "valueAsKey" | "autoGet" | "textMode" | "cache" | "strict" | "check" | "getSelected")> & ShallowUnwrapRef< {
552
+ }>, "code" | "search" | "changeCode" | "loaded" | "codes" | ("all" | "multiple" | "valueKey" | "labelKey" | "keyMap" | "valueAsKey" | "autoGet" | "textMode" | "cache" | "strict" | "getSelected")> & ShallowUnwrapRef< {
558
553
  code: Ref<SelectValue, SelectValue>;
559
554
  changeCode: (val: SelectValue) => void;
560
555
  loaded: Ref<boolean, boolean>;
@@ -1967,7 +1962,7 @@ search: (stay?: boolean) => void;
1967
1962
  setMaxHeight: () => void;
1968
1963
  table: {
1969
1964
  data: Obj[];
1970
- maxHeight: number | string | void;
1965
+ maxHeight: string | number | undefined;
1971
1966
  selectType: {
1972
1967
  align: string;
1973
1968
  className: string;
@@ -1986,7 +1981,7 @@ load: (res: any) => any;
1986
1981
  "update:loading": (value: boolean | undefined) => any;
1987
1982
  "update:selection": (val: Obj[]) => any;
1988
1983
  "select-all": (val: Obj[], args_1: boolean) => any;
1989
- "select-rows": (val: Obj[]) => any;
1984
+ "selection-change": (val: Obj[]) => any;
1990
1985
  reload: () => any;
1991
1986
  "change-col": (val: Obj | Obj[]) => any;
1992
1987
  }, string, PublicProps, Readonly<ExtractPropTypes< {
@@ -2143,7 +2138,7 @@ onLoad?: ((res: any) => any) | undefined;
2143
2138
  "onUpdate:loading"?: ((value: boolean | undefined) => any) | undefined;
2144
2139
  "onUpdate:selection"?: ((val: Obj[]) => any) | undefined;
2145
2140
  "onSelect-all"?: ((val: Obj[], args_1: boolean) => any) | undefined;
2146
- "onSelect-rows"?: ((val: Obj[]) => any) | undefined;
2141
+ "onSelection-change"?: ((val: Obj[]) => any) | undefined;
2147
2142
  onReload?: (() => any) | undefined;
2148
2143
  "onChange-col"?: ((val: Obj | Obj[]) => any) | undefined;
2149
2144
  }>, {
@@ -2215,7 +2210,6 @@ type: FunctionConstructor;
2215
2210
  */
2216
2211
  check: {
2217
2212
  type: FunctionConstructor;
2218
- default: () => boolean;
2219
2213
  };
2220
2214
  textMode: BooleanConstructor;
2221
2215
  textFormat: FunctionConstructor;
@@ -2308,7 +2302,6 @@ type: FunctionConstructor;
2308
2302
  */
2309
2303
  check: {
2310
2304
  type: FunctionConstructor;
2311
- default: () => boolean;
2312
2305
  };
2313
2306
  textMode: BooleanConstructor;
2314
2307
  textFormat: FunctionConstructor;
@@ -2363,7 +2356,6 @@ autoGet: boolean;
2363
2356
  textMode: boolean;
2364
2357
  cache: boolean;
2365
2358
  strict: boolean;
2366
- check: Function;
2367
2359
  getSelected: Function;
2368
2360
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, Readonly<{
2369
2361
  default(_: {