@94ai/nf-search-form 8.3.23 → 9.0.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.
@@ -1,42 +1,36 @@
1
- declare const _default: import("vue-demi").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
2
- value?: string[] | undefined;
3
- endPlaceholder: string;
4
- startPlaceholder: string;
5
- }>, {
6
- value: () => never[];
7
- endPlaceholder: string;
8
- startPlaceholder: string;
9
- }>, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
10
- input: (event: [string | undefined, string | undefined]) => void;
11
- change: (event: [string | undefined, string | undefined]) => void;
12
- }, string, Readonly<import("vue-demi").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
13
- value?: string[] | undefined;
14
- endPlaceholder: string;
15
- startPlaceholder: string;
16
- }>, {
17
- value: () => never[];
18
- endPlaceholder: string;
19
- startPlaceholder: string;
20
- }>>>, {
21
- value: string[];
22
- endPlaceholder: string;
23
- startPlaceholder: string;
24
- }>;
25
- export default _default;
26
- declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
27
- declare type __VLS_TypePropsToRuntimeProps<T> = {
28
- [K in keyof T]-?: {} extends Pick<T, K> ? {
29
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
30
- } : {
31
- type: import('vue').PropType<T[K]>;
32
- required: true;
33
- };
34
- };
35
- declare type __VLS_WithDefaults<P, D> = {
36
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
37
- default: D[K];
38
- }> : P[K];
39
- };
40
- declare type __VLS_Prettify<T> = {
41
- [K in keyof T]: T[K];
42
- } & {};
1
+ declare const _default: import("vue-demi").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
2
+ value?: string[] | undefined;
3
+ endPlaceholder?: string | undefined;
4
+ startPlaceholder?: string | undefined;
5
+ }>, {
6
+ value: () => never[];
7
+ }>, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
8
+ input: (event: [string | undefined, string | undefined]) => void;
9
+ change: (event: [string | undefined, string | undefined]) => void;
10
+ }, string, Readonly<import("vue-demi").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
11
+ value?: string[] | undefined;
12
+ endPlaceholder?: string | undefined;
13
+ startPlaceholder?: string | undefined;
14
+ }>, {
15
+ value: () => never[];
16
+ }>>>, {
17
+ value: string[];
18
+ }>;
19
+ export default _default;
20
+ declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
21
+ declare type __VLS_TypePropsToRuntimeProps<T> = {
22
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
23
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
24
+ } : {
25
+ type: import('vue').PropType<T[K]>;
26
+ required: true;
27
+ };
28
+ };
29
+ declare type __VLS_WithDefaults<P, D> = {
30
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
31
+ default: D[K];
32
+ }> : P[K];
33
+ };
34
+ declare type __VLS_Prettify<T> = {
35
+ [K in keyof T]: T[K];
36
+ } & {};
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
package/lib/types.d.ts CHANGED
@@ -1,70 +1,87 @@
1
- interface IExchangeKey {
2
- type: number;
3
- value?: any;
4
- }
5
- export declare type NfSearchFormItemOption = {
6
- key?: string;
7
- _index?: number;
8
- __index?: number;
9
- initHidden?: boolean;
10
- destory?: boolean | ((any: any) => boolean);
11
- label?: string | ((any: any) => string);
12
- addLabel?: string;
13
- prop?: string;
14
- width?: string;
15
- isShowColon?: boolean;
16
- hidden?: boolean;
17
- required?: boolean;
18
- rules?: Record<string, any>;
19
- size?: 'medium' | 'small' | 'mini';
20
- labelWidth?: string;
21
- 'is-range'?: boolean;
22
- showMessage?: boolean;
23
- inlineMessage?: boolean;
24
- getOptions?: (callback: (options: any[]) => void, formData: Record<string, any>) => void;
25
- changeProps?: string[];
26
- show?: (formData: Record<string, any>) => boolean;
27
- exchangeKey?: IExchangeKey;
28
- category?: string;
29
- initValue?: any;
30
- slot?: string;
31
- labelSlot?: string;
32
- inputSlot?: {
33
- prepend?: string;
34
- append?: string;
35
- suffix?: string;
36
- prefix?: string;
37
- doublePrepend?: string;
38
- doubleAppend?: string;
39
- doubleSuffix?: string;
40
- doublePrefix?: string;
41
- doubleSegment?: string;
42
- };
43
- class?: string;
44
- tooltip?: {
45
- slot: string;
46
- };
47
- type?: 'monthrange' | 'datetimerange' | 'daterange' | 'yearrange' | 'halfyearrange' | 'quarterrange' | 'date' | 'month' | 'week' | 'dates';
48
- element?: 'el-input' | 'el-select' | 'custom-select' | 'ai-select' | 'ai-custom-select' | 'nf-lazy-select' | 'el-input-number' | 'el-date-picker' | 'el-cascader' | 'el-time-select' | 'el-time-picker' | 'number-range' | 'nf-date-picker' | 'nf-timezone-picker' | 'nf-quarter-picker' | 'nf-half-year-picker' | 'nf-double-year' | 'nf-double-week' | 'nf-double-half-year' | 'nf-double-quarter' | 'nf-transfer-select';
49
- events?: Record<string, Function>;
50
- placeholder?: string;
51
- virtualList?: boolean;
52
- 'controls-position'?: 'right' | 'left';
53
- clearable?: boolean;
54
- startPlaceholder?: string;
55
- rangeSeparator?: string;
56
- endPlaceholder?: string;
57
- defaultTime?: string[];
58
- options?: {
59
- label: string;
60
- value: string | number;
61
- }[];
62
- 'picker-options'?: {
63
- start: string;
64
- step: string;
65
- end: string;
66
- };
67
- valueFormat?: string;
68
- min?: 0;
69
- };
70
- export {};
1
+ export interface IBtnItems {
2
+ btnType?: 'search' | 'export' | 'reset';
3
+ name?: string;
4
+ type?: string;
5
+ icon?: string;
6
+ plain?: boolean;
7
+ size?: string;
8
+ round?: boolean;
9
+ circle?: boolean;
10
+ loading?: boolean;
11
+ disabled?: boolean;
12
+ class?: string;
13
+ validate?: boolean;
14
+ onClick?: (formData: Record<string, any>) => void;
15
+ show?: boolean | ((formData: Record<string, any>) => boolean);
16
+ [key: string]: any;
17
+ }
18
+ interface IExchangeKey {
19
+ type: number;
20
+ value?: any;
21
+ }
22
+ export declare type NfSearchFormItemOption = {
23
+ key?: string;
24
+ _index?: number;
25
+ __index?: number;
26
+ initHidden?: boolean;
27
+ destory?: boolean | ((any: any) => boolean);
28
+ label?: string | ((any: any) => string);
29
+ addLabel?: string;
30
+ prop?: string;
31
+ width?: string;
32
+ isShowColon?: boolean;
33
+ hidden?: boolean;
34
+ required?: boolean;
35
+ rules?: Record<string, any>;
36
+ size?: 'medium' | 'small' | 'mini';
37
+ labelWidth?: string;
38
+ 'is-range'?: boolean;
39
+ showMessage?: boolean;
40
+ inlineMessage?: boolean;
41
+ getOptions?: (callback: (options: any[]) => void, formData: Record<string, any>) => void;
42
+ changeProps?: string[];
43
+ show?: (formData: Record<string, any>) => boolean;
44
+ exchangeKey?: IExchangeKey;
45
+ category?: string;
46
+ initValue?: any;
47
+ slot?: string;
48
+ labelSlot?: string;
49
+ inputSlot?: {
50
+ prepend?: string;
51
+ append?: string;
52
+ suffix?: string;
53
+ prefix?: string;
54
+ doublePrepend?: string;
55
+ doubleAppend?: string;
56
+ doubleSuffix?: string;
57
+ doublePrefix?: string;
58
+ doubleSegment?: string;
59
+ };
60
+ class?: string;
61
+ tooltip?: {
62
+ slot: string;
63
+ };
64
+ type?: 'monthrange' | 'datetimerange' | 'daterange' | 'yearrange' | 'halfyearrange' | 'quarterrange' | 'date' | 'month' | 'week' | 'dates';
65
+ element?: 'el-input' | 'el-select' | 'custom-select' | 'ai-select' | 'ai-custom-select' | 'nf-lazy-select' | 'el-input-number' | 'el-date-picker' | 'el-cascader' | 'el-time-select' | 'el-time-picker' | 'number-range' | 'nf-date-picker' | 'nf-timezone-picker' | 'nf-quarter-picker' | 'nf-half-year-picker' | 'nf-double-year' | 'nf-double-week' | 'nf-double-half-year' | 'nf-double-quarter' | 'nf-transfer-select';
66
+ events?: Record<string, Function>;
67
+ placeholder?: string;
68
+ virtualList?: boolean;
69
+ 'controls-position'?: 'right' | 'left';
70
+ clearable?: boolean;
71
+ startPlaceholder?: string;
72
+ rangeSeparator?: string;
73
+ endPlaceholder?: string;
74
+ defaultTime?: string[];
75
+ options?: {
76
+ label: string;
77
+ value: string | number;
78
+ }[];
79
+ 'picker-options'?: {
80
+ start: string;
81
+ step: string;
82
+ end: string;
83
+ };
84
+ valueFormat?: string;
85
+ min?: 0;
86
+ };
87
+ export {};
@@ -62,9 +62,9 @@
62
62
  v-on="bindEvents"
63
63
  :type="itemOptions.type || 'datetimerange'"
64
64
  :clearable="itemOptions.clearable || true"
65
- :start-placeholder="itemOptions.startPlaceholder || '开始日期'"
65
+ :start-placeholder="itemOptions.startPlaceholder || t('nf.common.startDate')"
66
66
  :range-separator="itemOptions.rangeSeparator || '-'"
67
- :end-placeholder="itemOptions.endPlaceholder || '结束日期'"
67
+ :end-placeholder="itemOptions.endPlaceholder || t('nf.common.endDate')"
68
68
  :default-time="itemOptions.defaultTime || ['00:00:00', '23:59:59']"
69
69
  :value-format="itemOptions.valueFormat || 'yyyy-MM-dd HH:mm:ss'"
70
70
  @change="handleChange"
@@ -81,9 +81,9 @@
81
81
  v-on="bindEvents"
82
82
  :type="itemOptions.type || 'datetimerange'"
83
83
  :clearable="itemOptions.clearable || true"
84
- :start-placeholder="itemOptions.startPlaceholder || '开始日期'"
84
+ :start-placeholder="itemOptions.startPlaceholder || t('nf.common.startDate')"
85
85
  :range-separator="itemOptions.rangeSeparator || '-'"
86
- :end-placeholder="itemOptions.endPlaceholder || '结束日期'"
86
+ :end-placeholder="itemOptions.endPlaceholder || t('nf.common.endDate')"
87
87
  :default-time="itemOptions.defaultTime || ['00:00:00', '23:59:59']"
88
88
  :value-format="itemOptions.valueFormat || 'yyyy-MM-dd HH:mm:ss'"
89
89
  @change="handleChange"
@@ -101,9 +101,9 @@
101
101
  v-on="bindEvents"
102
102
  type="monthrange"
103
103
  :clearable="itemOptions.clearable || true"
104
- :start-placeholder="itemOptions.startPlaceholder || '开始日期'"
104
+ :start-placeholder="itemOptions.startPlaceholder || t('nf.common.startDate')"
105
105
  :range-separator="itemOptions.rangeSeparator || '-'"
106
- :end-placeholder="itemOptions.endPlaceholder || '结束日期'"
106
+ :end-placeholder="itemOptions.endPlaceholder || t('nf.common.endDate')"
107
107
  :value-format="itemOptions.valueFormat || 'yyyy-MM'"
108
108
  @change="handleChange"
109
109
  >
@@ -118,9 +118,9 @@
118
118
  v-on="bindEvents"
119
119
  type="monthrange"
120
120
  :clearable="itemOptions.clearable || true"
121
- :start-placeholder="itemOptions.startPlaceholder || '开始日期'"
121
+ :start-placeholder="itemOptions.startPlaceholder || t('nf.common.startDate')"
122
122
  :range-separator="itemOptions.rangeSeparator || '-'"
123
- :end-placeholder="itemOptions.endPlaceholder || '结束日期'"
123
+ :end-placeholder="itemOptions.endPlaceholder || t('nf.common.endDate')"
124
124
  :value-format="itemOptions.valueFormat || 'yyyy-MM'"
125
125
  @change="handleChange"
126
126
  >
@@ -134,7 +134,7 @@
134
134
  v-model="currentVal"
135
135
  v-bind="bindProps"
136
136
  v-on="bindEvents"
137
- :placeholder="itemOptions.placeholder || '请选择日期'"
137
+ :placeholder="itemOptions.placeholder || t('nf.common.selectDate')"
138
138
  :type="itemOptions.type"
139
139
  @change="handleChange"
140
140
  >
@@ -147,7 +147,7 @@
147
147
  v-model="currentVal"
148
148
  v-bind="bindProps"
149
149
  v-on="bindEvents"
150
- :placeholder="itemOptions.placeholder || '请选择日期'"
150
+ :placeholder="itemOptions.placeholder || t('nf.common.selectDate')"
151
151
  :type="itemOptions.type"
152
152
  @change="handleChange"
153
153
  >
@@ -160,7 +160,7 @@
160
160
  v-model="currentVal"
161
161
  v-bind="bindProps"
162
162
  v-on="bindEvents"
163
- :placeholder="itemOptions.placeholder || '请选择周'"
163
+ :placeholder="itemOptions.placeholder || t('nf.common.selectWeek')"
164
164
  >
165
165
  <slot slot="range-separator" :name="itemOptions.rangeSeparator">
166
166
  <span class="iconfont icon-dao" />
@@ -171,7 +171,7 @@
171
171
  v-model="currentVal"
172
172
  v-bind="bindProps"
173
173
  v-on="bindEvents"
174
- :placeholder="itemOptions.placeholder || '请选择年'"
174
+ :placeholder="itemOptions.placeholder || t('nf.common.selectYear')"
175
175
  >
176
176
  <slot slot="range-separator" :name="itemOptions.rangeSeparator">
177
177
  <span class="iconfont icon-dao" />
@@ -182,7 +182,7 @@
182
182
  v-model="currentVal"
183
183
  v-bind="bindProps"
184
184
  v-on="bindEvents"
185
- :placeholder="itemOptions.placeholder || '请选择季度'"
185
+ :placeholder="itemOptions.placeholder || t('nf.common.selectQuarter')"
186
186
  >
187
187
  <slot slot="range-separator" :name="itemOptions.rangeSeparator">
188
188
  <span class="iconfont icon-dao" />
@@ -193,7 +193,7 @@
193
193
  v-model="currentVal"
194
194
  v-bind="bindProps"
195
195
  v-on="bindEvents"
196
- :placeholder="itemOptions.placeholder || '请选择半年'"
196
+ :placeholder="itemOptions.placeholder || t('nf.common.selectHalfYear')"
197
197
  >
198
198
  <slot slot="range-separator" :name="itemOptions.rangeSeparator">
199
199
  <span class="iconfont icon-dao" />
@@ -204,7 +204,7 @@
204
204
  v-model="currentVal"
205
205
  v-bind="bindProps"
206
206
  v-on="bindEvents"
207
- :placeholder="itemOptions.placeholder || '请选择半年'"
207
+ :placeholder="itemOptions.placeholder || t('nf.common.selectHalfYear')"
208
208
  >
209
209
  <slot slot="range-separator" :name="itemOptions.rangeSeparator">
210
210
  <span class="iconfont icon-dao" />
@@ -215,7 +215,7 @@
215
215
  v-model="currentVal"
216
216
  v-bind="bindProps"
217
217
  v-on="bindEvents"
218
- :placeholder="itemOptions.placeholder || '请选择季度'"
218
+ :placeholder="itemOptions.placeholder || t('nf.common.selectQuarter')"
219
219
  >
220
220
  <slot slot="range-separator" :name="itemOptions.rangeSeparator">
221
221
  <span class="iconfont icon-dao" />
@@ -235,7 +235,7 @@
235
235
  v-model="currentVal"
236
236
  v-bind="bindProps"
237
237
  v-on="bindEvents"
238
- :placeholder="itemOptions.placeholder || '请选择时间'"
238
+ :placeholder="itemOptions.placeholder || t('nf.common.selectTime')"
239
239
  @change="handleChange"
240
240
  />
241
241
  <!-- el-time-select (type:range) -->
@@ -244,8 +244,8 @@
244
244
  v-model="currentVal"
245
245
  v-bind="bindProps"
246
246
  v-on="bindEvents"
247
- :start-placeholder="itemOptions.startPlaceholder || '开始时间'"
248
- :end-placeholder="itemOptions.endPlaceholder || '结束时间'"
247
+ :start-placeholder="itemOptions.startPlaceholder || t('nf.common.startTime')"
248
+ :end-placeholder="itemOptions.endPlaceholder || t('nf.common.endTime')"
249
249
  @change="handleChange"
250
250
  />
251
251
  <!-- el-time-picker -->
@@ -254,9 +254,9 @@
254
254
  v-model="currentVal"
255
255
  v-bind="bindProps"
256
256
  v-on="bindEvents"
257
- :placeholder="itemOptions.placeholder || '请选择时间'"
258
- :start-placeholder="itemOptions.startPlaceholder || '请选择时间'"
259
- :end-placeholder="itemOptions.endPlaceholder || '请选择时间'"
257
+ :placeholder="itemOptions.placeholder || t('nf.common.selectTime')"
258
+ :start-placeholder="itemOptions.startPlaceholder || t('nf.common.selectTime')"
259
+ :end-placeholder="itemOptions.endPlaceholder || t('nf.common.selectTime')"
260
260
  @change="handleChange"
261
261
  />
262
262
  <!-- 数字区间 -->
@@ -306,7 +306,7 @@ import {
306
306
  getCurrentInstance
307
307
  } from 'vue-demi'
308
308
  import { NfSearchFormItemOption } from '@94ai/nf-search-form/lib/types'
309
- import { createUniqueString } from '@94ai/common-utils'
309
+ import { createUniqueString, useLocale } from '@94ai/common-utils'
310
310
 
311
311
  const emit = defineEmits<{
312
312
  (e: 'input', event: any): void
@@ -341,6 +341,7 @@ const props = withDefaults(defineProps<{
341
341
  })
342
342
 
343
343
  const instance = getCurrentInstance()?.proxy
344
+ const { t } = useLocale()
344
345
 
345
346
  const slotName = computed(() => {
346
347
  return props.itemOptions.slot || ''