@antdv-next1/pro-field 1.0.3 → 1.0.5
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/LICENSE +21 -0
- package/dist/components/Cascader/index.d.ts +1 -1
- package/dist/components/Cascader/index.js +0 -1
- package/dist/components/Checkbox/index.d.ts +1 -1
- package/dist/components/Checkbox/index.js +0 -1
- package/dist/components/Code/index.js +2 -3
- package/dist/components/ColorPicker/index.d.ts +1 -1
- package/dist/components/DigitRange/index.d.ts +2 -2
- package/dist/components/DigitRange/index.js +0 -1
- package/dist/components/Radio/index.d.ts +1 -1
- package/dist/components/Segmented/index.d.ts +1 -1
- package/dist/components/Segmented/index.js +0 -1
- package/dist/components/TreeSelect/index.d.ts +1 -1
- package/dist/pro-field.esm.js +15 -16
- package/dist/pro-field.js +14 -14
- package/package.json +14 -14
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 asuradaSong
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -35,6 +35,6 @@ declare const FieldCascader: _$vue.DefineSetupFnComponent<FieldCascaderProps, {}
|
|
|
35
35
|
variant?: "outlined" | "borderless" | "filled";
|
|
36
36
|
} & {
|
|
37
37
|
id?: string;
|
|
38
|
-
} & Omit<FieldSelectProps, "text" | "fieldProps" | "light" | "label" | "id" | "variant" | "
|
|
38
|
+
} & Omit<FieldSelectProps, "text" | "fieldProps" | "light" | "label" | "id" | "variant" | "lightLabel" | "labelTrigger" | "plain"> & {}, _$vue.PublicProps>;
|
|
39
39
|
//#endregion
|
|
40
40
|
export { FieldCascaderProps, FieldCascaderRef, FieldCascader as default };
|
|
@@ -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,
|
|
@@ -32,6 +32,6 @@ declare const FieldCheckbox: _$vue.DefineSetupFnComponent<FieldCheckBoxProps, {}
|
|
|
32
32
|
options?: CheckboxGroupProps["options"];
|
|
33
33
|
} & {
|
|
34
34
|
id?: string;
|
|
35
|
-
} & Omit<FieldSelectProps, "fieldProps" | "light" | "label" | "id" | "variant" | "
|
|
35
|
+
} & Omit<FieldSelectProps, "fieldProps" | "light" | "label" | "id" | "variant" | "lightLabel" | "labelTrigger" | "plain"> & {}, _$vue.PublicProps>;
|
|
36
36
|
//#endregion
|
|
37
37
|
export { FieldCheckBoxProps, FieldCheckboxRef, FieldCheckbox as default };
|
|
@@ -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);
|
|
@@ -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,
|
|
@@ -17,6 +17,6 @@ declare const FieldColorPicker: _$vue.DefineSetupFnComponent<FieldColorPickerPro
|
|
|
17
17
|
mode?: "read" | "edit" | "update";
|
|
18
18
|
} & {
|
|
19
19
|
id?: string;
|
|
20
|
-
} & Partial<Omit<_$antdv_next_dist_color_picker_ColorPicker0.InternalColorPickerProps, "
|
|
20
|
+
} & Partial<Omit<_$antdv_next_dist_color_picker_ColorPicker0.InternalColorPickerProps, "value" | "mode">> & {}, _$vue.PublicProps>;
|
|
21
21
|
//#endregion
|
|
22
22
|
export { FieldColorPickerProps, FieldColorPicker as default };
|
|
@@ -22,14 +22,14 @@ type FieldDigitRangeProps = ProFieldFC<{
|
|
|
22
22
|
}>;
|
|
23
23
|
declare const FieldDigitRange: _$vue.DefineSetupFnComponent<FieldDigitRangeProps, {}, CustomSlotsType<{
|
|
24
24
|
default?: () => VueNode;
|
|
25
|
-
}>, _$_antdv_next1_pro_provider0.BaseProFieldFC<Omit<InputNumberProps, "
|
|
25
|
+
}>, _$_antdv_next1_pro_provider0.BaseProFieldFC<Omit<InputNumberProps, "value" | "onChange" | "defaultValue" | "placeholder"> & {
|
|
26
26
|
id?: string;
|
|
27
27
|
placeholder?: string[];
|
|
28
28
|
value?: ValuePair;
|
|
29
29
|
onChange?: (value?: ValuePair) => void;
|
|
30
30
|
defaultValue?: ValuePair;
|
|
31
31
|
intlProps?: Intl.NumberFormatOptions;
|
|
32
|
-
}> & _$_antdv_next1_pro_provider0.ProRenderFieldPropsType<Omit<InputNumberProps, "
|
|
32
|
+
}> & _$_antdv_next1_pro_provider0.ProRenderFieldPropsType<Omit<InputNumberProps, "value" | "onChange" | "defaultValue" | "placeholder"> & {
|
|
33
33
|
id?: string;
|
|
34
34
|
placeholder?: string[];
|
|
35
35
|
value?: ValuePair;
|
|
@@ -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({
|
|
@@ -31,6 +31,6 @@ declare const FieldRadio: _$vue.DefineSetupFnComponent<FieldRadioProps, {}, Cust
|
|
|
31
31
|
radioType?: RadioGroupProps["optionType"];
|
|
32
32
|
} & {
|
|
33
33
|
id?: string;
|
|
34
|
-
} & Omit<FieldSelectProps, "fieldProps" | "light" | "label" | "id" | "variant" | "
|
|
34
|
+
} & Omit<FieldSelectProps, "fieldProps" | "light" | "label" | "id" | "variant" | "lightLabel" | "labelTrigger" | "plain"> & {}, _$vue.PublicProps>;
|
|
35
35
|
//#endregion
|
|
36
36
|
export { FieldRadioProps, FieldRadio as default };
|
|
@@ -31,6 +31,6 @@ declare const FieldSegmented: _$vue.DefineSetupFnComponent<FieldSegmentedProps,
|
|
|
31
31
|
emptyText?: VueNode$1;
|
|
32
32
|
} & {
|
|
33
33
|
id?: string;
|
|
34
|
-
} & Omit<FieldSelectProps, "fieldProps" | "light" | "label" | "id" | "variant" | "
|
|
34
|
+
} & Omit<FieldSelectProps, "fieldProps" | "light" | "label" | "id" | "variant" | "lightLabel" | "labelTrigger" | "plain"> & {}, _$vue.PublicProps>;
|
|
35
35
|
//#endregion
|
|
36
36
|
export { FieldSegmentedProps, FieldSegmented as default };
|
|
@@ -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) => {
|
|
@@ -40,6 +40,6 @@ declare const FieldTreeSelect: _$vue.DefineSetupFnComponent<FieldTreeSelectProps
|
|
|
40
40
|
fetchDataOnSearch?: boolean;
|
|
41
41
|
} & {
|
|
42
42
|
id?: string;
|
|
43
|
-
} & TreeSelectProps<any, _$_v_c_tree_select0.DataNode> & Omit<FieldSelectProps, "fieldProps" | "light" | "label" | "id" | "variant" | "
|
|
43
|
+
} & TreeSelectProps<any, _$_v_c_tree_select0.DataNode> & Omit<FieldSelectProps, "fieldProps" | "light" | "label" | "id" | "variant" | "lightLabel" | "labelTrigger" | "plain"> & {}, _$vue.PublicProps>;
|
|
44
44
|
//#endregion
|
|
45
45
|
export { FieldTreeSelectProps, FieldTreeSelect as default };
|
package/dist/pro-field.esm.js
CHANGED
|
@@ -66376,7 +66376,6 @@ var $I = /* @__PURE__ */ l((e, { attrs: n, expose: r }) => {
|
|
|
66376
66376
|
}), () => {
|
|
66377
66377
|
let { mode: n, render: r, formItemRender: o, variant: l, placeholder: h, ...g } = e;
|
|
66378
66378
|
if (n === "read") {
|
|
66379
|
-
console.log(AI(g.valueEnum || m.value), "optionsValueEnum=23");
|
|
66380
66379
|
let e = c(t, null, [MI(g.text, AI(g.valueEnum || m.value))]);
|
|
66381
66380
|
return r ? c(t, null, [r(g.text, {
|
|
66382
66381
|
mode: n,
|
|
@@ -66536,7 +66535,7 @@ function nL(e) {
|
|
|
66536
66535
|
//#region src/components/Checkbox/index.tsx
|
|
66537
66536
|
var rL = /* @__PURE__ */ l((e, { expose: n, attrs: r }) => {
|
|
66538
66537
|
let i = Tt(), a = h_(), s = o(() => i.value.getPrefixCls("pro-field-checkbox")), [l, u, d] = QI(e), { wrapSSR: f, hashId: p } = nL(s), { token: m } = LF(), h = M(null);
|
|
66539
|
-
return n({ fetchData: (e) => d(e) }),
|
|
66538
|
+
return n({ fetchData: (e) => d(e) }), () => {
|
|
66540
66539
|
let { mode: n, render: i, formItemRender: o, options: d, request: g, params: _, debounceTime: y, defaultKeyWords: b, layout: x = "horizontal", ...S } = e;
|
|
66541
66540
|
if (l.value) return c(VM, { size: "small" }, null);
|
|
66542
66541
|
if (n === "read") {
|
|
@@ -66670,9 +66669,9 @@ function iL(e, t) {
|
|
|
66670
66669
|
var aL = /* @__PURE__ */ l((e) => {
|
|
66671
66670
|
let { token: n } = IF.useToken();
|
|
66672
66671
|
return () => {
|
|
66673
|
-
let { mode: r, text: i, render: a, language: o = "text", formItemRender: s,
|
|
66672
|
+
let { mode: r, text: i, render: a, language: o = "text", formItemRender: s, fieldProps: l, ...u } = e, d = iL(i, o);
|
|
66674
66673
|
if (r === "read") {
|
|
66675
|
-
let e = c("pre", v(
|
|
66674
|
+
let e = c("pre", v(l, { style: {
|
|
66676
66675
|
padding: Q(16),
|
|
66677
66676
|
overflow: "auto",
|
|
66678
66677
|
fontSize: "85%",
|
|
@@ -66682,21 +66681,21 @@ var aL = /* @__PURE__ */ l((e) => {
|
|
|
66682
66681
|
backgroundColor: "rgba(150, 150, 150, 0.1)",
|
|
66683
66682
|
borderRadius: Q(3),
|
|
66684
66683
|
width: "min-content",
|
|
66685
|
-
...
|
|
66686
|
-
} }), [c("code", null, [
|
|
66687
|
-
return a ? c(t, null, [a(
|
|
66684
|
+
...l?.style
|
|
66685
|
+
} }), [c("code", null, [d])]);
|
|
66686
|
+
return a ? c(t, null, [a(d, {
|
|
66688
66687
|
mode: r,
|
|
66689
|
-
...
|
|
66690
|
-
fieldProps:
|
|
66688
|
+
...u,
|
|
66689
|
+
fieldProps: l
|
|
66691
66690
|
}, e)]) : e;
|
|
66692
66691
|
}
|
|
66693
66692
|
if (r === "edit" || r === "update") {
|
|
66694
|
-
|
|
66695
|
-
let e = c(tM, v({ rows: 5 },
|
|
66696
|
-
return
|
|
66693
|
+
l.value = d;
|
|
66694
|
+
let e = c(tM, v({ rows: 5 }, l), null);
|
|
66695
|
+
return s ? c(t, null, [s(d, {
|
|
66697
66696
|
mode: r,
|
|
66698
|
-
fieldProps:
|
|
66699
|
-
...
|
|
66697
|
+
fieldProps: l,
|
|
66698
|
+
...u
|
|
66700
66699
|
}, e) ?? null]) : e;
|
|
66701
66700
|
}
|
|
66702
66701
|
return null;
|
|
@@ -67371,7 +67370,7 @@ var dL = /* @__PURE__ */ l((e) => {
|
|
|
67371
67370
|
}
|
|
67372
67371
|
}, l = (e, t) => {
|
|
67373
67372
|
let n = [...i.value || []];
|
|
67374
|
-
n[e] = t === null ? void 0 : t,
|
|
67373
|
+
n[e] = t === null ? void 0 : t, a(n);
|
|
67375
67374
|
}, h = m.fieldProps?.placeholder || u || [n.value.getMessage({
|
|
67376
67375
|
id: "tableForm.inputPlaceholder",
|
|
67377
67376
|
defaultMessage: "请输入"
|
|
@@ -69579,7 +69578,7 @@ var UL = /* @__PURE__ */ l((e) => {
|
|
|
69579
69578
|
let r = k(), [i, a, o] = QI(e);
|
|
69580
69579
|
return n({ fetchData: (e) => o(e) }), () => {
|
|
69581
69580
|
let { mode: n, render: o, formItemRender: s, options: l, fieldProps: u, emptyText: d = "-", ...f } = e;
|
|
69582
|
-
if (
|
|
69581
|
+
if (i.value) return c(VM, { size: "small" }, null);
|
|
69583
69582
|
if (n === "read") {
|
|
69584
69583
|
let e = a.value?.length ? a.value?.reduce((e, t) => ({
|
|
69585
69584
|
...e,
|