view-ui-plus-derive 0.0.1 → 0.0.3

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,7 +36,7 @@ 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 plugin from 'view-ui-plus-derive' // 包含所有组件与指令
26
40
  import 'view-ui-plus-derive/style' // 引入所有组件样式
27
41
 
28
42
  import App from './App.vue'
@@ -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
  ### 多语言
@@ -102,7 +116,7 @@ createApp(App)
102
116
  beginHolder: '開始時間',
103
117
  endHolder: '結束時間'
104
118
  },
105
- dCalendar: {
119
+ mCalendar: {
106
120
  mini: ['日', '一', '二', '三', '四', '五', '六'],
107
121
  short: ['週日', '週一', '週二', '週三', '週四', '週五', '週六'],
108
122
  long: ['禮拜日', '禮拜一', '禮拜二', '禮拜三', '禮拜四', '禮拜五', '禮拜六']
@@ -176,7 +190,7 @@ createApp(App)
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>
@@ -895,7 +921,6 @@ actionCol: {
895
921
  type: Object,
896
922
  default(props) {
897
923
  return {
898
- title: props.actionText,
899
924
  slot: 'action',
900
925
  width: props.actionWidth,
901
926
  align: props.actionAlign,
package/dist/index.d.ts CHANGED
@@ -90,10 +90,7 @@ modelValue: PropType<CheckValue>;
90
90
  /**
91
91
  * 全选框显示文本,默认“全选”
92
92
  */
93
- title: {
94
- type: StringConstructor;
95
- default(): string;
96
- };
93
+ title: StringConstructor;
97
94
  /**
98
95
  * 选项数组,数组成员可以是数组或对象
99
96
  */
@@ -140,10 +137,7 @@ modelValue: PropType<CheckValue>;
140
137
  /**
141
138
  * 全选框显示文本,默认“全选”
142
139
  */
143
- title: {
144
- type: StringConstructor;
145
- default(): string;
146
- };
140
+ title: StringConstructor;
147
141
  /**
148
142
  * 选项数组,数组成员可以是数组或对象
149
143
  */
@@ -187,7 +181,6 @@ all: BooleanConstructor;
187
181
  [x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
188
182
  }>, {
189
183
  all: boolean;
190
- title: string;
191
184
  hideAll: boolean;
192
185
  list: Obj[];
193
186
  valueKey: string | number;
@@ -699,17 +692,11 @@ maxClass: (ArrayConstructor | StringConstructor | ObjectConstructor)[];
699
692
  /**
700
693
  * 最小值占位文本
701
694
  */
702
- minHolder: {
703
- type: StringConstructor;
704
- default(): string;
705
- };
695
+ minHolder: StringConstructor;
706
696
  /**
707
697
  * 最大值占位文本
708
698
  */
709
- maxHolder: {
710
- type: StringConstructor;
711
- default(): string;
712
- };
699
+ maxHolder: StringConstructor;
713
700
  controlsOutside: BooleanConstructor;
714
701
  step: NumberConstructor;
715
702
  readonly: BooleanConstructor;
@@ -798,17 +785,11 @@ maxClass: (ArrayConstructor | StringConstructor | ObjectConstructor)[];
798
785
  /**
799
786
  * 最小值占位文本
800
787
  */
801
- minHolder: {
802
- type: StringConstructor;
803
- default(): string;
804
- };
788
+ minHolder: StringConstructor;
805
789
  /**
806
790
  * 最大值占位文本
807
791
  */
808
- maxHolder: {
809
- type: StringConstructor;
810
- default(): string;
811
- };
792
+ maxHolder: StringConstructor;
812
793
  controlsOutside: BooleanConstructor;
813
794
  step: NumberConstructor;
814
795
  readonly: BooleanConstructor;
@@ -858,8 +839,6 @@ controlsOutside: boolean;
858
839
  hideJoiner: boolean;
859
840
  begin: CountValue;
860
841
  end: CountValue;
861
- minHolder: string;
862
- maxHolder: string;
863
842
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
864
843
 
865
844
  export declare type CountValue = number | null | undefined;
@@ -908,17 +887,13 @@ actionFixed: StringConstructor;
908
887
  /**
909
888
  * 控制列表头文本
910
889
  */
911
- actionText: {
912
- type: StringConstructor;
913
- default(): string;
914
- };
890
+ actionText: StringConstructor;
915
891
  /**
916
892
  * 右侧控制列
917
893
  */
918
894
  actionCol: {
919
895
  type: ObjectConstructor;
920
896
  default(props: Obj): {
921
- title: any;
922
897
  slot: string;
923
898
  width: any;
924
899
  align: any;
@@ -975,10 +950,7 @@ delBtn: {
975
950
  type: ObjectConstructor;
976
951
  default: () => {};
977
952
  };
978
- addText: {
979
- type: StringConstructor;
980
- default(): string;
981
- };
953
+ addText: StringConstructor;
982
954
  /**
983
955
  * 是否隐藏每行的删除按钮,通过函数返回值决定
984
956
  */
@@ -1039,17 +1011,13 @@ actionFixed: StringConstructor;
1039
1011
  /**
1040
1012
  * 控制列表头文本
1041
1013
  */
1042
- actionText: {
1043
- type: StringConstructor;
1044
- default(): string;
1045
- };
1014
+ actionText: StringConstructor;
1046
1015
  /**
1047
1016
  * 右侧控制列
1048
1017
  */
1049
1018
  actionCol: {
1050
1019
  type: ObjectConstructor;
1051
1020
  default(props: Obj): {
1052
- title: any;
1053
1021
  slot: string;
1054
1022
  width: any;
1055
1023
  align: any;
@@ -1106,10 +1074,7 @@ delBtn: {
1106
1074
  type: ObjectConstructor;
1107
1075
  default: () => {};
1108
1076
  };
1109
- addText: {
1110
- type: StringConstructor;
1111
- default(): string;
1112
- };
1077
+ addText: StringConstructor;
1113
1078
  /**
1114
1079
  * 是否隐藏每行的删除按钮,通过函数返回值决定
1115
1080
  */
@@ -1134,7 +1099,6 @@ columns: Obj[];
1134
1099
  addable: boolean;
1135
1100
  actionWidth: number;
1136
1101
  actionAlign: string;
1137
- actionText: string;
1138
1102
  actionCol: Record<string, any>;
1139
1103
  addRow: Function;
1140
1104
  addBtnType: string;
@@ -1145,7 +1109,6 @@ delBtnType: string;
1145
1109
  delBtnSize: string;
1146
1110
  delBtnGhost: boolean;
1147
1111
  delBtn: Record<string, any>;
1148
- addText: string;
1149
1112
  delBtnDisabled: Function;
1150
1113
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>, Partial<Record<any, (_: any) => any>> & {
1151
1114
  moreAction?(_: {
@@ -1206,17 +1169,11 @@ endClass: (ArrayConstructor | StringConstructor | ObjectConstructor)[];
1206
1169
  /**
1207
1170
  * 开始时间placeholder
1208
1171
  */
1209
- beginHolder: {
1210
- type: StringConstructor;
1211
- default(): string;
1212
- };
1172
+ beginHolder: StringConstructor;
1213
1173
  /**
1214
1174
  * 结束时间placeholder
1215
1175
  */
1216
- endHolder: {
1217
- type: StringConstructor;
1218
- default(): string;
1219
- };
1176
+ endHolder: StringConstructor;
1220
1177
  /**
1221
1178
  * 一次性传给开始组件的prop
1222
1179
  */
@@ -1299,17 +1256,11 @@ endClass: (ArrayConstructor | StringConstructor | ObjectConstructor)[];
1299
1256
  /**
1300
1257
  * 开始时间placeholder
1301
1258
  */
1302
- beginHolder: {
1303
- type: StringConstructor;
1304
- default(): string;
1305
- };
1259
+ beginHolder: StringConstructor;
1306
1260
  /**
1307
1261
  * 结束时间placeholder
1308
1262
  */
1309
- endHolder: {
1310
- type: StringConstructor;
1311
- default(): string;
1312
- };
1263
+ endHolder: StringConstructor;
1313
1264
  /**
1314
1265
  * 一次性传给开始组件的prop
1315
1266
  */
@@ -1353,8 +1304,6 @@ endDisabled: boolean;
1353
1304
  disableToday: boolean;
1354
1305
  autoNext: boolean;
1355
1306
  limitBegin: boolean;
1356
- beginHolder: string;
1357
- endHolder: string;
1358
1307
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
1359
1308
 
1360
1309
  export declare const DateRangePicker: DefineComponent<ExtractPropTypes< {
@@ -1741,17 +1690,11 @@ modelValue: BooleanConstructor;
1741
1690
  /**
1742
1691
  * 确定按钮文本
1743
1692
  */
1744
- okText: {
1745
- type: StringConstructor;
1746
- default(): string;
1747
- };
1693
+ okText: StringConstructor;
1748
1694
  /**
1749
1695
  * 取消按钮文本
1750
1696
  */
1751
- cancelText: {
1752
- type: StringConstructor;
1753
- default(): string;
1754
- };
1697
+ cancelText: StringConstructor;
1755
1698
  /**
1756
1699
  * 传递给确定按钮的props
1757
1700
  */
@@ -1803,17 +1746,11 @@ modelValue: BooleanConstructor;
1803
1746
  /**
1804
1747
  * 确定按钮文本
1805
1748
  */
1806
- okText: {
1807
- type: StringConstructor;
1808
- default(): string;
1809
- };
1749
+ okText: StringConstructor;
1810
1750
  /**
1811
1751
  * 取消按钮文本
1812
1752
  */
1813
- cancelText: {
1814
- type: StringConstructor;
1815
- default(): string;
1816
- };
1753
+ cancelText: StringConstructor;
1817
1754
  /**
1818
1755
  * 传递给确定按钮的props
1819
1756
  */
@@ -1867,8 +1804,6 @@ okDisabled: boolean;
1867
1804
  cancelLoading: boolean;
1868
1805
  cancelDisabled: boolean;
1869
1806
  rightCancel: boolean;
1870
- okText: string;
1871
- cancelText: string;
1872
1807
  cancelType: string;
1873
1808
  hasOk: boolean;
1874
1809
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
@@ -2007,10 +1942,7 @@ pure: BooleanConstructor;
2007
1942
  /**
2008
1943
  * head title
2009
1944
  */
2010
- title: {
2011
- type: StringConstructor;
2012
- default(): string;
2013
- };
1945
+ title: StringConstructor;
2014
1946
  /**
2015
1947
  * 是否显示header
2016
1948
  */
@@ -2184,10 +2116,7 @@ pure: BooleanConstructor;
2184
2116
  /**
2185
2117
  * head title
2186
2118
  */
2187
- title: {
2188
- type: StringConstructor;
2189
- default(): string;
2190
- };
2119
+ title: StringConstructor;
2191
2120
  /**
2192
2121
  * 是否显示header
2193
2122
  */
@@ -2218,7 +2147,6 @@ onLoad?: ((res: any) => any) | undefined;
2218
2147
  onReload?: (() => any) | undefined;
2219
2148
  "onChange-col"?: ((val: Obj | Obj[]) => any) | undefined;
2220
2149
  }>, {
2221
- title: string;
2222
2150
  transfer: boolean;
2223
2151
  modelValue: Obj[];
2224
2152
  border: boolean;
@@ -2469,10 +2397,7 @@ export declare const ToggleColumn: __VLS_WithTemplateSlots_10<DefineComponent<Ex
2469
2397
  modelValue: {
2470
2398
  type: ArrayConstructor;
2471
2399
  };
2472
- title: {
2473
- type: StringConstructor;
2474
- default(): string;
2475
- };
2400
+ title: StringConstructor;
2476
2401
  /**
2477
2402
  * 仅显示图标
2478
2403
  */
@@ -2504,10 +2429,7 @@ change: (val: Obj | Obj[]) => any;
2504
2429
  modelValue: {
2505
2430
  type: ArrayConstructor;
2506
2431
  };
2507
- title: {
2508
- type: StringConstructor;
2509
- default(): string;
2510
- };
2432
+ title: StringConstructor;
2511
2433
  /**
2512
2434
  * 仅显示图标
2513
2435
  */
@@ -2537,7 +2459,6 @@ storeAt: StringConstructor;
2537
2459
  onChange?: ((val: Obj | Obj[]) => any) | undefined;
2538
2460
  }>, {
2539
2461
  all: boolean;
2540
- title: string;
2541
2462
  transfer: boolean;
2542
2463
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
2543
2464
  default?(_: {}): any;