@antdv-next1/pro-field 1.0.4 → 1.0.6
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/dist/ProField.js +2 -17
- package/dist/ProPureField.js +3 -21
- package/dist/components/Cascader/index.js +1 -5
- package/dist/components/Checkbox/index.js +1 -5
- package/dist/components/Code/index.js +2 -3
- package/dist/components/DigitRange/index.js +0 -1
- package/dist/components/Image/index.d.ts +1 -1
- package/dist/components/Radio/index.js +1 -4
- package/dist/components/Segmented/index.js +1 -5
- package/dist/components/Select/index.js +15 -23
- package/dist/components/TreeSelect/index.js +1 -4
- package/dist/pro-field.esm.js +687 -401
- package/dist/pro-field.js +36 -36
- package/package.json +4 -4
package/dist/ProField.js
CHANGED
|
@@ -301,19 +301,7 @@ const ProField = /* @__PURE__ */ defineComponent((props, { expose }) => {
|
|
|
301
301
|
}, {
|
|
302
302
|
props: {
|
|
303
303
|
valueType: { required: false },
|
|
304
|
-
text: {
|
|
305
|
-
type: [
|
|
306
|
-
Object,
|
|
307
|
-
Function,
|
|
308
|
-
String,
|
|
309
|
-
Number,
|
|
310
|
-
null,
|
|
311
|
-
Boolean,
|
|
312
|
-
Array
|
|
313
|
-
],
|
|
314
|
-
required: false,
|
|
315
|
-
default: void 0
|
|
316
|
-
},
|
|
304
|
+
text: { required: false },
|
|
317
305
|
placeholder: {
|
|
318
306
|
type: [String, Array],
|
|
319
307
|
required: false
|
|
@@ -379,10 +367,7 @@ const ProField = /* @__PURE__ */ defineComponent((props, { expose }) => {
|
|
|
379
367
|
type: String,
|
|
380
368
|
required: false
|
|
381
369
|
},
|
|
382
|
-
request: {
|
|
383
|
-
type: Function,
|
|
384
|
-
required: false
|
|
385
|
-
},
|
|
370
|
+
request: { required: false },
|
|
386
371
|
emptyText: {
|
|
387
372
|
type: [
|
|
388
373
|
Object,
|
package/dist/ProPureField.js
CHANGED
|
@@ -107,19 +107,7 @@ const ProPureField = /* @__PURE__ */ defineComponent((props, { attrs, expose })
|
|
|
107
107
|
}, {
|
|
108
108
|
props: {
|
|
109
109
|
valueType: { required: false },
|
|
110
|
-
text: {
|
|
111
|
-
type: [
|
|
112
|
-
Object,
|
|
113
|
-
Function,
|
|
114
|
-
String,
|
|
115
|
-
Number,
|
|
116
|
-
null,
|
|
117
|
-
Boolean,
|
|
118
|
-
Array
|
|
119
|
-
],
|
|
120
|
-
required: false,
|
|
121
|
-
default: void 0
|
|
122
|
-
},
|
|
110
|
+
text: { required: false },
|
|
123
111
|
placeholder: {
|
|
124
112
|
type: [String, Array],
|
|
125
113
|
required: false
|
|
@@ -146,10 +134,7 @@ const ProPureField = /* @__PURE__ */ defineComponent((props, { attrs, expose })
|
|
|
146
134
|
type: Function,
|
|
147
135
|
required: false
|
|
148
136
|
},
|
|
149
|
-
fieldProps: {
|
|
150
|
-
type: Object,
|
|
151
|
-
required: false
|
|
152
|
-
},
|
|
137
|
+
fieldProps: { required: false },
|
|
153
138
|
light: {
|
|
154
139
|
type: Boolean,
|
|
155
140
|
required: false,
|
|
@@ -188,10 +173,7 @@ const ProPureField = /* @__PURE__ */ defineComponent((props, { attrs, expose })
|
|
|
188
173
|
type: String,
|
|
189
174
|
required: false
|
|
190
175
|
},
|
|
191
|
-
request: {
|
|
192
|
-
type: Function,
|
|
193
|
-
required: false
|
|
194
|
-
},
|
|
176
|
+
request: { required: false },
|
|
195
177
|
emptyText: {
|
|
196
178
|
type: [
|
|
197
179
|
Object,
|
|
@@ -53,7 +53,6 @@ const FieldCascader = /* @__PURE__ */ defineComponent((props, { expose }) => {
|
|
|
53
53
|
return () => {
|
|
54
54
|
const { mode, render, formItemRender, variant, placeholder: propsPlaceholder, ...rest } = props;
|
|
55
55
|
if (mode === "read") {
|
|
56
|
-
console.log(objectToMap(rest.valueEnum || optionsValueEnum.value), "optionsValueEnum=23");
|
|
57
56
|
const dom = createVNode(Fragment, null, [proFieldParsingText(rest.text, objectToMap(rest.valueEnum || optionsValueEnum.value))]);
|
|
58
57
|
if (render) return createVNode(Fragment, null, [render(rest.text, {
|
|
59
58
|
mode,
|
|
@@ -185,10 +184,7 @@ const FieldCascader = /* @__PURE__ */ defineComponent((props, { expose }) => {
|
|
|
185
184
|
type: Number,
|
|
186
185
|
required: false
|
|
187
186
|
},
|
|
188
|
-
request: {
|
|
189
|
-
type: Function,
|
|
190
|
-
required: false
|
|
191
|
-
},
|
|
187
|
+
request: { required: false },
|
|
192
188
|
params: { required: false },
|
|
193
189
|
defaultKeyWords: {
|
|
194
190
|
type: String,
|
|
@@ -17,7 +17,6 @@ const FieldCheckbox = /* @__PURE__ */ defineComponent((props, { expose, attrs })
|
|
|
17
17
|
const { token } = useToken();
|
|
18
18
|
const checkBoxRef = shallowRef(null);
|
|
19
19
|
expose({ fetchData: (keyWord) => fetchData(keyWord) });
|
|
20
|
-
console.log(checkBoxRef, "checkBoxRef");
|
|
21
20
|
return () => {
|
|
22
21
|
const { mode, render, formItemRender, options: propsOptions, request, params, debounceTime, defaultKeyWords, layout = "horizontal", ...rest } = props;
|
|
23
22
|
if (loading.value) return createVNode(Spin, { "size": "small" }, null);
|
|
@@ -132,10 +131,7 @@ const FieldCheckbox = /* @__PURE__ */ defineComponent((props, { expose, attrs })
|
|
|
132
131
|
type: Number,
|
|
133
132
|
required: false
|
|
134
133
|
},
|
|
135
|
-
request: {
|
|
136
|
-
type: Function,
|
|
137
|
-
required: false
|
|
138
|
-
},
|
|
134
|
+
request: { required: false },
|
|
139
135
|
params: { required: false },
|
|
140
136
|
defaultKeyWords: {
|
|
141
137
|
type: String,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, createVNode, defineComponent, mergeProps } from "vue";
|
|
2
2
|
import { proTheme } from "@antdv-next1/pro-provider";
|
|
3
|
-
import {
|
|
3
|
+
import { TextArea } from "antdv-next";
|
|
4
4
|
import { unit } from "@antdv-next/cssinjs";
|
|
5
5
|
//#region src/components/Code/index.tsx
|
|
6
6
|
function languageFormat(text, language) {
|
|
@@ -13,7 +13,7 @@ function languageFormat(text, language) {
|
|
|
13
13
|
const FieldCode = /* @__PURE__ */ defineComponent((props) => {
|
|
14
14
|
const { token } = proTheme.useToken();
|
|
15
15
|
return () => {
|
|
16
|
-
const { mode, text, render, language = "text", formItemRender,
|
|
16
|
+
const { mode, text, render, language = "text", formItemRender, fieldProps, ...rest } = props;
|
|
17
17
|
const code = languageFormat(text, language);
|
|
18
18
|
if (mode === "read") {
|
|
19
19
|
const dom = createVNode("pre", mergeProps(fieldProps, { "style": {
|
|
@@ -38,7 +38,6 @@ const FieldCode = /* @__PURE__ */ defineComponent((props) => {
|
|
|
38
38
|
if (mode === "edit" || mode === "update") {
|
|
39
39
|
fieldProps.value = code;
|
|
40
40
|
let dom = createVNode(TextArea, mergeProps({ "rows": 5 }, fieldProps), null);
|
|
41
|
-
if (plain) dom = createVNode(Input, fieldProps, null);
|
|
42
41
|
if (formItemRender) return createVNode(Fragment, null, [formItemRender(code, {
|
|
43
42
|
mode,
|
|
44
43
|
fieldProps,
|
|
@@ -52,7 +52,6 @@ const FieldDigitRange = /* @__PURE__ */ defineComponent((props) => {
|
|
|
52
52
|
const handleChange = (index, changedValue) => {
|
|
53
53
|
const newValuePair = [...valuePair.value || []];
|
|
54
54
|
newValuePair[index] = changedValue === null ? void 0 : changedValue;
|
|
55
|
-
console.log(newValuePair, index, "newValuePair");
|
|
56
55
|
setValuePair(newValuePair);
|
|
57
56
|
};
|
|
58
57
|
const placeholderValue = rest.fieldProps?.placeholder || propsPlaceholder || [intl.value.getMessage({
|
|
@@ -12,7 +12,7 @@ type FieldImageProps = ProFieldFC<{
|
|
|
12
12
|
}, ImageProps | InputProps>;
|
|
13
13
|
declare const FieldImage: _$vue.DefineSetupFnComponent<FieldImageProps, {}, CustomSlotsType<{
|
|
14
14
|
default?: () => VueNode;
|
|
15
|
-
}>, _$_antdv_next1_pro_provider0.BaseProFieldFC<
|
|
15
|
+
}>, _$_antdv_next1_pro_provider0.BaseProFieldFC<InputProps | ImageProps> & _$_antdv_next1_pro_provider0.ProRenderFieldPropsType<InputProps | ImageProps> & {
|
|
16
16
|
text: string;
|
|
17
17
|
width?: number;
|
|
18
18
|
placeholder?: string;
|
|
@@ -121,10 +121,7 @@ const FieldRadio = /* @__PURE__ */ defineComponent((props, { expose, attrs }) =>
|
|
|
121
121
|
type: Number,
|
|
122
122
|
required: false
|
|
123
123
|
},
|
|
124
|
-
request: {
|
|
125
|
-
type: Function,
|
|
126
|
-
required: false
|
|
127
|
-
},
|
|
124
|
+
request: { required: false },
|
|
128
125
|
params: { required: false },
|
|
129
126
|
defaultKeyWords: {
|
|
130
127
|
type: String,
|
|
@@ -9,7 +9,6 @@ const FieldSegmented = /* @__PURE__ */ defineComponent((props, { expose }) => {
|
|
|
9
9
|
expose({ fetchData: (keyWord) => fetchData(keyWord) });
|
|
10
10
|
return () => {
|
|
11
11
|
const { mode, render, formItemRender, options: propsOptions, fieldProps, emptyText = "-", ...rest } = props;
|
|
12
|
-
console.log("FieldSegmented:props", props, options);
|
|
13
12
|
if (loading.value) return createVNode(Spin, { "size": "small" }, null);
|
|
14
13
|
if (mode === "read") {
|
|
15
14
|
const optionsValueEnum = options.value?.length ? options.value?.reduce((pre, cur) => {
|
|
@@ -122,10 +121,7 @@ const FieldSegmented = /* @__PURE__ */ defineComponent((props, { expose }) => {
|
|
|
122
121
|
type: Number,
|
|
123
122
|
required: false
|
|
124
123
|
},
|
|
125
|
-
request: {
|
|
126
|
-
type: Function,
|
|
127
|
-
required: false
|
|
128
|
-
},
|
|
124
|
+
request: { required: false },
|
|
129
125
|
params: { required: false },
|
|
130
126
|
defaultKeyWords: {
|
|
131
127
|
type: String,
|
|
@@ -3,7 +3,7 @@ import LightSelect from "./LightSelect/index.js";
|
|
|
3
3
|
import SearchSelect from "./SearchSelect/index.js";
|
|
4
4
|
import { Fragment, computed, createVNode, defineComponent, mergeProps, ref, shallowRef } from "vue";
|
|
5
5
|
import { useIntl } from "@antdv-next1/pro-provider";
|
|
6
|
-
import { nanoid, objectToMap, proFieldParsingText, useDebounceValue, useEffect, useMemo, useMountMergeState, useRefFunction, useState } from "@antdv-next1/pro-utils";
|
|
6
|
+
import { nanoid, objectToMap, proFieldParsingText, stringify, useDebounceValue, useEffect, useMemo, useMountMergeState, useRefFunction, useState } from "@antdv-next1/pro-utils";
|
|
7
7
|
import { Spin, useConfig } from "antdv-next";
|
|
8
8
|
import { unit } from "@antdv-next/cssinjs";
|
|
9
9
|
import useSWRV from "swrv";
|
|
@@ -95,15 +95,19 @@ function useFieldFetchData(props) {
|
|
|
95
95
|
}, [() => valueEnum]);
|
|
96
96
|
const swrKey = useDebounceValue([
|
|
97
97
|
proFieldKeyRef.value,
|
|
98
|
-
props.params,
|
|
98
|
+
stringify(props.params),
|
|
99
99
|
keyWords.value
|
|
100
|
-
], debounceTime ?? fieldProps?.debounceTime ?? 0, [
|
|
100
|
+
], debounceTime ?? fieldProps?.debounceTime ?? 0, [
|
|
101
|
+
() => props.params,
|
|
102
|
+
keyWords,
|
|
103
|
+
proFieldKeyRef
|
|
104
|
+
]);
|
|
101
105
|
const { data, mutate: setLocaleData, isValidating } = useSWRV(() => {
|
|
102
106
|
if (!request) return null;
|
|
103
|
-
return swrKey.value;
|
|
104
|
-
}, (
|
|
105
|
-
...params,
|
|
106
|
-
keyWords:
|
|
107
|
+
return swrKey.value.join("-");
|
|
108
|
+
}, () => request?.({
|
|
109
|
+
...props.params,
|
|
110
|
+
keyWords: keyWords.value
|
|
107
111
|
}, props), {
|
|
108
112
|
shouldRetryOnError: false,
|
|
109
113
|
revalidateOnFocus: false
|
|
@@ -261,30 +265,18 @@ const FieldSelect = /* @__PURE__ */ defineComponent((props, { attrs, expose }) =
|
|
|
261
265
|
}, {
|
|
262
266
|
props: {
|
|
263
267
|
text: {
|
|
264
|
-
type:
|
|
265
|
-
|
|
266
|
-
Function,
|
|
267
|
-
String,
|
|
268
|
-
Number,
|
|
269
|
-
null,
|
|
270
|
-
Boolean,
|
|
271
|
-
Array
|
|
272
|
-
],
|
|
273
|
-
required: false,
|
|
274
|
-
default: void 0
|
|
268
|
+
type: void 0,
|
|
269
|
+
required: false
|
|
275
270
|
},
|
|
276
271
|
valueEnum: {
|
|
277
|
-
type:
|
|
272
|
+
type: void 0,
|
|
278
273
|
required: false
|
|
279
274
|
},
|
|
280
275
|
debounceTime: {
|
|
281
276
|
type: Number,
|
|
282
277
|
required: false
|
|
283
278
|
},
|
|
284
|
-
request: {
|
|
285
|
-
type: Function,
|
|
286
|
-
required: false
|
|
287
|
-
},
|
|
279
|
+
request: { required: false },
|
|
288
280
|
params: { required: false },
|
|
289
281
|
fieldProps: {
|
|
290
282
|
type: Object,
|
|
@@ -745,10 +745,7 @@ const FieldTreeSelect = /* @__PURE__ */ defineComponent((props, { expose, attrs
|
|
|
745
745
|
type: Number,
|
|
746
746
|
required: false
|
|
747
747
|
},
|
|
748
|
-
request: {
|
|
749
|
-
type: Function,
|
|
750
|
-
required: false
|
|
751
|
-
},
|
|
748
|
+
request: { required: false },
|
|
752
749
|
params: { required: false },
|
|
753
750
|
defaultKeyWords: {
|
|
754
751
|
type: String,
|