fit2cloud-ui-plus 1.2.0-beta.0 → 1.2.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.
Files changed (43) hide show
  1. package/README.md +1 -1
  2. package/lib/fit2cloud-ui-plus.es.js +63 -56
  3. package/lib/fit2cloud-ui-plus.umd.js +1 -1
  4. package/package.json +2 -1
  5. package/src/components/table/table-column-select/FuTableColumnSelectPopover.vue +0 -7
  6. package/src/hooks/use-global-config/index.ts +1 -0
  7. package/src/hooks/use-locale/index.ts +23 -13
  8. package/src/index.ts +2 -1
  9. package/src/locale/lang/ja.ts +2 -2
  10. package/src/locale/lang/pt-br.ts +1 -1
  11. package/src/locale/lang/ru.ts +1 -1
  12. package/src/locale/lang/zh-cn.ts +1 -1
  13. package/src/locale/lang/zh-tw.ts +1 -1
  14. package/src/styles/components/filter-bar.scss +4 -2
  15. package/types/examples/locale/index.d.ts +416 -0
  16. package/types/src/hooks/use-global-config/index.d.ts +1 -0
  17. package/types/src/hooks/use-locale/index.d.ts +1 -0
  18. package/types/examples/pages/search/attributes.d.ts +0 -57
  19. package/types/examples/pages/search/demo/BaseSearchbar.vue.d.ts +0 -66
  20. package/types/examples/pages/search/demo/ComplexComponentsDemo.vue.d.ts +0 -60
  21. package/types/examples/pages/search/demo/ComplexSearchDemo.vue.d.ts +0 -84
  22. package/types/examples/pages/search/demo/CustomComponentsDemo.vue.d.ts +0 -50
  23. package/types/examples/pages/search/demo/EchoConditionsDemo.vue.d.ts +0 -52
  24. package/types/examples/pages/search/demo/QuickSearchDemo.vue.d.ts +0 -18
  25. package/types/examples/pages/search/demo/SearchBarButtonDemo.vue.d.ts +0 -54
  26. package/types/examples/pages/search/index.vue.d.ts +0 -150
  27. package/types/src/components/ steps/FuHorizontalNavigation.vue.d.ts +0 -13
  28. package/types/src/components/ steps/FuHorizontalSteps.vue.d.ts +0 -6
  29. package/types/src/components/ steps/FuStep.vue.d.ts +0 -2
  30. package/types/src/components/ steps/FuStepButton.vue.d.ts +0 -2
  31. package/types/src/components/ steps/FuSteps.vue.d.ts +0 -12
  32. package/types/src/components/ steps/FuStepsFooter.d.ts +0 -6
  33. package/types/src/components/ steps/FuVerticalNavigation.vue.d.ts +0 -14
  34. package/types/src/components/ steps/FuVerticalSteps.vue.d.ts +0 -6
  35. package/types/src/components/ steps/Stepper.d.ts +0 -39
  36. package/types/src/components/ steps/index.d.ts +0 -2
  37. package/types/src/components/ steps/types.d.ts +0 -27
  38. package/types/src/components/filter-bar/FuSearchInput.vue.d.ts +0 -17
  39. package/types/src/components/search-bar/complex-components/index.d.ts +0 -0
  40. package/types/src/components/search-bar/complex-components/mixins.d.ts +0 -6
  41. package/types/src/components/table/FuTableBody-backup.d.ts +0 -3
  42. package/types/src/components/table/types.d.ts +0 -2
  43. package/types/src/tools/utils.d.ts +0 -2
@@ -1,10 +1,10 @@
1
- import { computed, isRef, ref, unref } from 'vue'
2
- import { get } from 'lodash-unified'
1
+ import {computed, isRef, ref, unref} from 'vue'
2
+ import {get} from 'lodash-unified'
3
3
  import Chinese from '@/locale/lang/zh-cn'
4
- import { useGlobalConfig } from '@/hooks'
5
- import type { MaybeRef } from '@vueuse/core'
6
- import type { Ref } from 'vue'
7
- import type { Language } from '@/locale'
4
+ import {useGlobalConfig} from '@/hooks'
5
+ import type {MaybeRef} from '@vueuse/core'
6
+ import type {Ref} from 'vue'
7
+ import type {Language} from '@/locale'
8
8
 
9
9
  export type TranslatorOption = Record<string, string | number>
10
10
  export type Translator = (path: string, option?: TranslatorOption) => string
@@ -16,18 +16,22 @@ export type LocaleContext = {
16
16
 
17
17
  export const buildTranslator =
18
18
  (locale: MaybeRef<Language>): Translator =>
19
- (path, option) =>
20
- translate(path, option, unref(locale))
19
+ (path, option) =>
20
+ translate(path, option, unref(locale))
21
21
 
22
22
  export const translate = (
23
23
  path: string,
24
24
  option: undefined | TranslatorOption,
25
25
  locale: Language
26
- ): string =>
27
- (get(locale, path, path) as string).replace(
28
- /\{(\w+)\}/g,
29
- (_, key) => `${option?.[key] ?? `{${key}}`}`
30
- )
26
+ ): string => {
27
+ if (!i18nHandler) {
28
+ return (get(locale, path, path) as string).replace(
29
+ /\{(\w+)\}/g,
30
+ (_, key) => `${option?.[key] ?? `{${key}}`}`
31
+ )
32
+ }
33
+ return i18nHandler(path);
34
+ }
31
35
 
32
36
  export const buildLocaleContext = (
33
37
  locale: MaybeRef<Language>
@@ -45,3 +49,9 @@ export const useLocale = () => {
45
49
  const locale = useGlobalConfig('locale')
46
50
  return buildLocaleContext(computed(() => locale.value || Chinese))
47
51
  }
52
+
53
+ let i18nHandler: Function;
54
+
55
+ export const i18n = (fn: Function | undefined) => {
56
+ i18nHandler = fn || i18nHandler;
57
+ };
package/src/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import PackageJSON from "../package.json"
2
2
 
3
3
  import type {App} from 'vue'
4
- import {GlobalConfig, provideGlobalConfig} from "@/hooks";
4
+ import {GlobalConfig, i18n, provideGlobalConfig} from "@/hooks";
5
5
 
6
6
  const components = import.meta.globEager('@/components/*/index.ts');
7
7
 
@@ -10,6 +10,7 @@ const install = (app: App, config: GlobalConfig): void => {
10
10
  let component = components[key].default;
11
11
  app.use(component)
12
12
  })
13
+ i18n(config.i18n)
13
14
  provideGlobalConfig(config)
14
15
  }
15
16
 
@@ -44,10 +44,10 @@ export default {
44
44
  table: {
45
45
  ok: "確定",
46
46
  cancel: "キャンセル",
47
- custom_table_fields: "テーブルフィールドのカスタマイズ",
47
+ custom_table_fields: "フィールドを選択",
48
48
  custom_table_fields_desc: "固定フィールドは選択範囲外で、ドラッグして順序をカスタマイズできます",
49
49
  custom_table_rows: "オプション列",
50
- more: "もっと見る"
50
+ more: "もっと"
51
51
  },
52
52
  steps: {
53
53
  cancel: "キャンセル",
@@ -44,7 +44,7 @@ export default {
44
44
  table: {
45
45
  ok: "Confirmar",
46
46
  cancel: "Cancelar",
47
- custom_table_fields: "Personalizar campos da tabela",
47
+ custom_table_fields: "Selecione o campo",
48
48
  custom_table_fields_desc: "Campos fixos não estão disponíveis para seleção. Arraste para personalizar a ordem.",
49
49
  custom_table_rows: "Colunas de opções",
50
50
  more: "Mais"
@@ -44,7 +44,7 @@ export default {
44
44
  table: {
45
45
  ok: "ОК",
46
46
  cancel: "Отмена",
47
- custom_table_fields: "Настройка полей таблицы",
47
+ custom_table_fields: "Выберите поле",
48
48
  custom_table_fields_desc: "Фиксированные поля не доступны для выбора, можно перетаскивать для изменения порядка",
49
49
  custom_table_rows: "Столбцы с опциями",
50
50
  more: "Еще"
@@ -44,7 +44,7 @@ export default {
44
44
  table: {
45
45
  ok: "确定",
46
46
  cancel: "取消",
47
- custom_table_fields: "自定义表格字段",
47
+ custom_table_fields: "选择字段",
48
48
  custom_table_fields_desc: "固定字段不在选择范围,可拖拽自定义顺序",
49
49
  custom_table_rows: "选项列",
50
50
  more: "更多"
@@ -44,7 +44,7 @@ export default {
44
44
  table: {
45
45
  ok: "確定",
46
46
  cancel: "取消",
47
- custom_table_fields: "自定義表格字段",
47
+ custom_table_fields: "選項字段",
48
48
  custom_table_fields_desc: "固定欄位不在選擇範圍,可拖拽自定義順序",
49
49
  custom_table_rows: "選項列",
50
50
  more: "更多"
@@ -76,11 +76,13 @@
76
76
  font-size: 14px;
77
77
  line-height: 22px;
78
78
  height: 22px;
79
- min-width: 76px;
80
- max-width: 76px;
81
79
  color: var(--fu-filter-bar-color);
82
80
  cursor: pointer;
83
81
  margin-left: 6px;
82
+
83
+ & > i.el-icon {
84
+ margin-right: 4px;
85
+ }
84
86
  }
85
87
 
86
88
  @include e(drawer) {
@@ -0,0 +1,416 @@
1
+ declare const i18n: import("vue-i18n").I18n<{
2
+ zh: {
3
+ name: string;
4
+ fu: {
5
+ filter_bar: {
6
+ filter: string;
7
+ results: string;
8
+ clear: string;
9
+ drawer_title: string;
10
+ cancel: string;
11
+ search: string;
12
+ refresh: string;
13
+ select_all: string;
14
+ more: string;
15
+ };
16
+ search_bar: {
17
+ search: string;
18
+ adv_search: string;
19
+ ok: string;
20
+ cancel: string;
21
+ please_select: string;
22
+ please_input: string;
23
+ like: string;
24
+ not_like: string;
25
+ in: string;
26
+ not_in: string;
27
+ gt: string;
28
+ ge: string;
29
+ lt: string;
30
+ le: string;
31
+ eq: string;
32
+ ne: string;
33
+ between: string;
34
+ select_date: string;
35
+ start_date: string;
36
+ end_date: string;
37
+ select_date_time: string;
38
+ start_date_time: string;
39
+ end_date_time: string;
40
+ range_separator: string;
41
+ data_time_error: string;
42
+ clean: string;
43
+ refresh: string;
44
+ };
45
+ table: {
46
+ ok: string;
47
+ cancel: string;
48
+ custom_table_fields: string;
49
+ custom_table_fields_desc: string;
50
+ custom_table_rows: string;
51
+ more: string;
52
+ };
53
+ steps: {
54
+ cancel: string;
55
+ next: string;
56
+ prev: string;
57
+ finish: string;
58
+ };
59
+ };
60
+ };
61
+ tw: {
62
+ name: string;
63
+ fu: {
64
+ filter_bar: {
65
+ filter: string;
66
+ results: string;
67
+ clear: string;
68
+ drawer_title: string;
69
+ cancel: string;
70
+ search: string;
71
+ refresh: string;
72
+ select_all: string;
73
+ more: string;
74
+ };
75
+ search_bar: {
76
+ search: string;
77
+ adv_search: string;
78
+ ok: string;
79
+ cancel: string;
80
+ please_select: string;
81
+ please_input: string;
82
+ like: string;
83
+ not_like: string;
84
+ in: string;
85
+ not_in: string;
86
+ gt: string;
87
+ ge: string;
88
+ lt: string;
89
+ le: string;
90
+ eq: string;
91
+ ne: string;
92
+ between: string;
93
+ select_date: string;
94
+ start_date: string;
95
+ end_date: string;
96
+ select_date_time: string;
97
+ start_date_time: string;
98
+ end_date_time: string;
99
+ range_separator: string;
100
+ data_time_error: string;
101
+ clean: string;
102
+ refresh: string;
103
+ };
104
+ table: {
105
+ ok: string;
106
+ cancel: string;
107
+ custom_table_fields: string;
108
+ custom_table_fields_desc: string;
109
+ custom_table_rows: string;
110
+ more: string;
111
+ };
112
+ steps: {
113
+ cancel: string;
114
+ next: string;
115
+ prev: string;
116
+ finish: string;
117
+ };
118
+ };
119
+ };
120
+ ru: {
121
+ name: string;
122
+ fu: {
123
+ filter_bar: {
124
+ filter: string;
125
+ results: string;
126
+ clear: string;
127
+ drawer_title: string;
128
+ cancel: string;
129
+ search: string;
130
+ refresh: string;
131
+ select_all: string;
132
+ more: string;
133
+ };
134
+ search_bar: {
135
+ search: string;
136
+ adv_search: string;
137
+ ok: string;
138
+ cancel: string;
139
+ please_select: string;
140
+ please_input: string;
141
+ like: string;
142
+ not_like: string;
143
+ in: string;
144
+ not_in: string;
145
+ gt: string;
146
+ ge: string;
147
+ lt: string;
148
+ le: string;
149
+ eq: string;
150
+ ne: string;
151
+ between: string;
152
+ select_date: string;
153
+ start_date: string;
154
+ end_date: string;
155
+ select_date_time: string;
156
+ start_date_time: string;
157
+ end_date_time: string;
158
+ range_separator: string;
159
+ data_time_error: string;
160
+ clean: string;
161
+ refresh: string;
162
+ };
163
+ table: {
164
+ ok: string;
165
+ cancel: string;
166
+ custom_table_fields: string;
167
+ custom_table_fields_desc: string;
168
+ custom_table_rows: string;
169
+ more: string;
170
+ };
171
+ steps: {
172
+ cancel: string;
173
+ next: string;
174
+ prev: string;
175
+ finish: string;
176
+ };
177
+ };
178
+ };
179
+ en: {
180
+ name: string;
181
+ fu: {
182
+ filter_bar: {
183
+ filter: string;
184
+ results: string;
185
+ clear: string;
186
+ drawer_title: string;
187
+ cancel: string;
188
+ search: string;
189
+ refresh: string;
190
+ select_all: string;
191
+ more: string;
192
+ };
193
+ search_bar: {
194
+ search: string;
195
+ adv_search: string;
196
+ ok: string;
197
+ cancel: string;
198
+ please_select: string;
199
+ please_input: string;
200
+ like: string;
201
+ not_like: string;
202
+ in: string;
203
+ not_in: string;
204
+ gt: string;
205
+ ge: string;
206
+ lt: string;
207
+ le: string;
208
+ eq: string;
209
+ ne: string;
210
+ between: string;
211
+ select_date: string;
212
+ start_date: string;
213
+ end_date: string;
214
+ select_date_time: string;
215
+ start_date_time: string;
216
+ end_date_time: string;
217
+ range_separator: string;
218
+ data_time_error: string;
219
+ clean: string;
220
+ refresh: string;
221
+ };
222
+ table: {
223
+ ok: string;
224
+ cancel: string;
225
+ custom_table_fields: string;
226
+ custom_table_fields_desc: string;
227
+ custom_table_rows: string;
228
+ more: string;
229
+ };
230
+ steps: {
231
+ cancel: string;
232
+ next: string;
233
+ prev: string;
234
+ finish: string;
235
+ };
236
+ };
237
+ };
238
+ ja: {
239
+ name: string;
240
+ fu: {
241
+ filter_bar: {
242
+ filter: string;
243
+ results: string;
244
+ clear: string;
245
+ drawer_title: string;
246
+ cancel: string;
247
+ search: string;
248
+ refresh: string;
249
+ select_all: string;
250
+ more: string;
251
+ };
252
+ search_bar: {
253
+ search: string;
254
+ adv_search: string;
255
+ ok: string;
256
+ cancel: string;
257
+ please_select: string;
258
+ please_input: string;
259
+ like: string;
260
+ not_like: string;
261
+ in: string;
262
+ not_in: string;
263
+ gt: string;
264
+ ge: string;
265
+ lt: string;
266
+ le: string;
267
+ eq: string;
268
+ ne: string;
269
+ between: string;
270
+ select_date: string;
271
+ start_date: string;
272
+ end_date: string;
273
+ select_date_time: string;
274
+ start_date_time: string;
275
+ end_date_time: string;
276
+ range_separator: string;
277
+ data_time_error: string;
278
+ clean: string;
279
+ refresh: string;
280
+ };
281
+ table: {
282
+ ok: string;
283
+ cancel: string;
284
+ custom_table_fields: string;
285
+ custom_table_fields_desc: string;
286
+ custom_table_rows: string;
287
+ more: string;
288
+ };
289
+ steps: {
290
+ cancel: string;
291
+ next: string;
292
+ prev: string;
293
+ finish: string;
294
+ };
295
+ };
296
+ };
297
+ ms: {
298
+ name: string;
299
+ fu: {
300
+ filter_bar: {
301
+ filter: string;
302
+ results: string;
303
+ clear: string;
304
+ drawer_title: string;
305
+ cancel: string;
306
+ search: string;
307
+ refresh: string;
308
+ select_all: string;
309
+ more: string;
310
+ };
311
+ search_bar: {
312
+ search: string;
313
+ adv_search: string;
314
+ ok: string;
315
+ cancel: string;
316
+ please_select: string;
317
+ please_input: string;
318
+ like: string;
319
+ not_like: string;
320
+ in: string;
321
+ not_in: string;
322
+ gt: string;
323
+ ge: string;
324
+ lt: string;
325
+ le: string;
326
+ eq: string;
327
+ ne: string;
328
+ between: string;
329
+ select_date: string;
330
+ start_date: string;
331
+ end_date: string;
332
+ select_date_time: string;
333
+ start_date_time: string;
334
+ end_date_time: string;
335
+ range_separator: string;
336
+ data_time_error: string;
337
+ clean: string;
338
+ refresh: string;
339
+ };
340
+ table: {
341
+ ok: string;
342
+ cancel: string;
343
+ custom_table_fields: string;
344
+ custom_table_fields_desc: string;
345
+ custom_table_rows: string;
346
+ more: string;
347
+ };
348
+ steps: {
349
+ cancel: string;
350
+ next: string;
351
+ prev: string;
352
+ finish: string;
353
+ };
354
+ };
355
+ };
356
+ pt: {
357
+ name: string;
358
+ fu: {
359
+ filter_bar: {
360
+ filter: string;
361
+ results: string;
362
+ clear: string;
363
+ drawer_title: string;
364
+ cancel: string;
365
+ search: string;
366
+ refresh: string;
367
+ select_all: string;
368
+ more: string;
369
+ };
370
+ search_bar: {
371
+ search: string;
372
+ adv_search: string;
373
+ ok: string;
374
+ cancel: string;
375
+ please_select: string;
376
+ please_input: string;
377
+ like: string;
378
+ not_like: string;
379
+ in: string;
380
+ not_in: string;
381
+ gt: string;
382
+ ge: string;
383
+ lt: string;
384
+ le: string;
385
+ eq: string;
386
+ ne: string;
387
+ between: string;
388
+ select_date: string;
389
+ start_date: string;
390
+ end_date: string;
391
+ select_date_time: string;
392
+ start_date_time: string;
393
+ end_date_time: string;
394
+ range_separator: string;
395
+ data_time_error: string;
396
+ clean: string;
397
+ refresh: string;
398
+ };
399
+ table: {
400
+ ok: string;
401
+ cancel: string;
402
+ custom_table_fields: string;
403
+ custom_table_fields_desc: string;
404
+ custom_table_rows: string;
405
+ more: string;
406
+ };
407
+ steps: {
408
+ cancel: string;
409
+ next: string;
410
+ prev: string;
411
+ finish: string;
412
+ };
413
+ };
414
+ };
415
+ }, {}, {}, string, false>;
416
+ export default i18n;
@@ -4,6 +4,7 @@ export declare const globalConfigKey: InjectionKey<Ref<GlobalConfig>>;
4
4
  export interface GlobalConfig {
5
5
  size?: string;
6
6
  locale?: any;
7
+ i18n?: Function;
7
8
  }
8
9
  export declare function useGlobalConfig(key?: keyof any, defaultValue?: undefined): Ref<any>;
9
10
  export declare const provideGlobalConfig: (config: MaybeRef<GlobalConfig>, app?: App<any> | undefined) => import("vue").ComputedRef<GlobalConfig>;
@@ -12,3 +12,4 @@ export declare const buildTranslator: (locale: MaybeRef<Language>) => Translator
12
12
  export declare const translate: (path: string, option: undefined | TranslatorOption, locale: Language) => string;
13
13
  export declare const buildLocaleContext: (locale: MaybeRef<Language>) => LocaleContext;
14
14
  export declare const useLocale: () => LocaleContext;
15
+ export declare const i18n: (fn: Function | undefined) => void;
@@ -1,57 +0,0 @@
1
- declare var _default: {
2
- name: string;
3
- children: ({
4
- name: string;
5
- header: {
6
- prop: string;
7
- desc: string;
8
- type: string;
9
- enum: string;
10
- default: string;
11
- event?: undefined;
12
- value?: undefined;
13
- name?: undefined;
14
- };
15
- table: {
16
- prop: string;
17
- desc: string;
18
- type: string;
19
- enum: string;
20
- default: string;
21
- }[];
22
- } | {
23
- name: string;
24
- header: {
25
- event: string;
26
- desc: string;
27
- value: string;
28
- prop?: undefined;
29
- type?: undefined;
30
- enum?: undefined;
31
- default?: undefined;
32
- name?: undefined;
33
- };
34
- table: {
35
- event: string;
36
- desc: string;
37
- value: string;
38
- }[];
39
- } | {
40
- name: string;
41
- header: {
42
- name: string;
43
- desc: string;
44
- prop?: undefined;
45
- type?: undefined;
46
- enum?: undefined;
47
- default?: undefined;
48
- event?: undefined;
49
- value?: undefined;
50
- };
51
- table: {
52
- name: string;
53
- desc: string;
54
- }[];
55
- })[];
56
- }[];
57
- export default _default;
@@ -1,66 +0,0 @@
1
- declare namespace _default {
2
- const name: string;
3
- function data(): {
4
- components: ({
5
- field: string;
6
- label: string;
7
- component: string;
8
- options?: undefined;
9
- change?: undefined;
10
- } | {
11
- field: string;
12
- label: string;
13
- component: string;
14
- options: {
15
- label: string;
16
- value: string;
17
- }[];
18
- change: (val: any) => void;
19
- } | {
20
- field: string;
21
- label: string;
22
- component: string;
23
- options: {
24
- label: string;
25
- value: string;
26
- }[];
27
- change?: undefined;
28
- })[];
29
- condition: {};
30
- };
31
- function data(): {
32
- components: ({
33
- field: string;
34
- label: string;
35
- component: string;
36
- options?: undefined;
37
- change?: undefined;
38
- } | {
39
- field: string;
40
- label: string;
41
- component: string;
42
- options: {
43
- label: string;
44
- value: string;
45
- }[];
46
- change: (val: any) => void;
47
- } | {
48
- field: string;
49
- label: string;
50
- component: string;
51
- options: {
52
- label: string;
53
- value: string;
54
- }[];
55
- change?: undefined;
56
- })[];
57
- condition: {};
58
- };
59
- namespace methods {
60
- function close(): void;
61
- function close(): void;
62
- function search(condition: any): void;
63
- function search(condition: any): void;
64
- }
65
- }
66
- export default _default;