@antdv-next1/pro-field 1.0.7 → 1.0.8

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 ADDED
@@ -0,0 +1,86 @@
1
+ # @antdv-next1/pro-field
2
+
3
+ Rich field rendering component for Pro Components. Supports read-only and edit modes with 30+ built-in value types.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @antdv-next1/pro-field
9
+ # or
10
+ pnpm add @antdv-next1/pro-field
11
+ ```
12
+
13
+ ## Peer Dependencies
14
+
15
+ - `vue` >= 3.5.30
16
+ - `antdv-next` >= 1.3.4
17
+
18
+ ## Components
19
+
20
+ ### Main Components
21
+
22
+ | Component | Description |
23
+ |-----------|-------------|
24
+ | `ProField` | Unified field renderer with automatic value type mapping |
25
+ | `ProPureField` | Pure field renderer without form item wrapper |
26
+ | `ValueTypeToComponent` | Automatic value-type to component mapper |
27
+
28
+ ### Field Type Components
29
+
30
+ | Component | Value Type | Description |
31
+ |-----------|------------|-------------|
32
+ | `FieldText` | `text` | Plain text display / input |
33
+ | `FieldTextArea` | `textarea` | Multi-line text |
34
+ | `FieldPassword` | `password` | Password with visibility toggle |
35
+ | `FieldSelect` | `select` | Dropdown select |
36
+ | `FieldCheckbox` | `checkbox` | Checkbox input |
37
+ | `FieldRadio` | `radio` | Radio input |
38
+ | `FieldDigit` | `digit` | Numeric input |
39
+ | `FieldDigitRange` | `digitRange` | Numeric range input |
40
+ | `FieldMoney` | `money` | Currency display / input |
41
+ | `FieldPercent` | `percent` | Percentage display / input |
42
+ | `FieldProgress` | `progress` | Progress bar |
43
+ | `FieldRate` | `rate` | Star rating |
44
+ | `FieldSlider` | `slider` | Slider input |
45
+ | `FieldSwitch` | `switch` | Toggle switch |
46
+ | `FieldDatePicker` | `date` | Date picker |
47
+ | `FieldDateRangePicker` | `dateRange` | Date range picker |
48
+ | `FieldTimePicker` | `time` | Time picker |
49
+ | `FieldTimeRangePicker` | `timeRange` | Time range picker |
50
+ | `FieldFromNow` | `fromNow` | Relative time display |
51
+ | `FieldSecond` | `second` | Seconds display |
52
+ | `FieldCascader` | `cascader` | Cascading select |
53
+ | `FieldTreeSelect` | `treeSelect` | Tree select |
54
+ | `FieldColorPicker` | `colorPicker` | Color picker |
55
+ | `FieldImage` | `image` | Image display |
56
+ | `FieldCode` | `code` | Code block display |
57
+ | `FieldStatus` | `status` | Status badge |
58
+ | `FieldIndexColumn` | `indexColumn` | Index column |
59
+ | `FieldSegmented` | `segmented` | Segmented control |
60
+ | `FieldOptions` | `options` | Options group |
61
+
62
+ ## Usage
63
+
64
+ ```vue
65
+ <script setup lang="ts">
66
+ import { ProField } from '@antdv-next1/pro-field'
67
+ </script>
68
+
69
+ <template>
70
+ <!-- Read-only mode -->
71
+ <ProField :text="1000" mode="read" value-type="money" />
72
+
73
+ <!-- Edit mode -->
74
+ <ProField v-model:text="value" mode="edit" value-type="select" :field-props="{ options }" />
75
+ </template>
76
+ ```
77
+
78
+ ## Dependencies
79
+
80
+ - `@antdv-next1/pro-provider` — Theme and configuration context
81
+ - `@antdv-next1/pro-utils` — Shared utilities
82
+ - `swrv` — Stale-while-revalidate data fetching
83
+
84
+ ## License
85
+
86
+ [MIT](../../LICENSE)
@@ -146,10 +146,7 @@ const ProPureField = /* @__PURE__ */ defineComponent((props, { attrs, expose })
146
146
  type: Function,
147
147
  required: false
148
148
  },
149
- fieldProps: {
150
- type: Object,
151
- required: false
152
- },
149
+ fieldProps: { required: false },
153
150
  light: {
154
151
  type: Boolean,
155
152
  required: false,
@@ -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, "id" | "variant" | "text" | "fieldProps" | "light" | "label" | "lightLabel" | "labelTrigger" | "plain"> & {}, _$vue.PublicProps>;
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 };
@@ -32,6 +32,6 @@ declare const FieldCheckbox: _$vue.DefineSetupFnComponent<FieldCheckBoxProps, {}
32
32
  options?: CheckboxGroupProps["options"];
33
33
  } & {
34
34
  id?: string;
35
- } & Omit<FieldSelectProps, "id" | "variant" | "fieldProps" | "light" | "label" | "lightLabel" | "labelTrigger" | "plain"> & {}, _$vue.PublicProps>;
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,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, "value" | "mode">> & {}, _$vue.PublicProps>;
20
+ } & Partial<Omit<_$antdv_next_dist_color_picker_ColorPicker0.InternalColorPickerProps, "mode" | "value">> & {}, _$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, "defaultValue" | "value" | "onChange" | "placeholder"> & {
25
+ }>, _$_antdv_next1_pro_provider0.BaseProFieldFC<Omit<InputNumberProps, "placeholder" | "value" | "onChange" | "defaultValue"> & {
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, "defaultValue" | "value" | "onChange" | "placeholder"> & {
32
+ }> & _$_antdv_next1_pro_provider0.ProRenderFieldPropsType<Omit<InputNumberProps, "placeholder" | "value" | "onChange" | "defaultValue"> & {
33
33
  id?: string;
34
34
  placeholder?: string[];
35
35
  value?: ValuePair;
@@ -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, "id" | "variant" | "fieldProps" | "light" | "label" | "lightLabel" | "labelTrigger" | "plain"> & {}, _$vue.PublicProps>;
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, "id" | "variant" | "fieldProps" | "light" | "label" | "lightLabel" | "labelTrigger" | "plain"> & {}, _$vue.PublicProps>;
34
+ } & Omit<FieldSelectProps, "fieldProps" | "light" | "label" | "id" | "variant" | "lightLabel" | "labelTrigger" | "plain"> & {}, _$vue.PublicProps>;
35
35
  //#endregion
36
36
  export { FieldSegmentedProps, FieldSegmented as default };
@@ -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, "id" | "variant" | "fieldProps" | "light" | "label" | "lightLabel" | "labelTrigger" | "plain"> & {}, _$vue.PublicProps>;
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 };
@@ -71540,7 +71540,10 @@ var aR = /* @__PURE__ */ l((e, { expose: t }) => {
71540
71540
  type: Function,
71541
71541
  required: !1
71542
71542
  },
71543
- fieldProps: { required: !1 },
71543
+ fieldProps: {
71544
+ type: Object,
71545
+ required: !1
71546
+ },
71544
71547
  light: {
71545
71548
  type: Boolean,
71546
71549
  required: !1,
@@ -71749,10 +71752,7 @@ var cR = /* @__PURE__ */ l((e, { attrs: t, expose: n }) => {
71749
71752
  type: Function,
71750
71753
  required: !1
71751
71754
  },
71752
- fieldProps: {
71753
- type: Object,
71754
- required: !1
71755
- },
71755
+ fieldProps: { required: !1 },
71756
71756
  light: {
71757
71757
  type: Boolean,
71758
71758
  required: !1,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@antdv-next1/pro-field",
3
3
  "type": "module",
4
- "version": "1.0.7",
4
+ "version": "1.0.8",
5
5
  "description": "@antdv-next1/pro-field",
6
6
  "repository": {
7
7
  "type": "git",
@@ -44,13 +44,13 @@
44
44
  "ie >= 11"
45
45
  ],
46
46
  "peerDependencies": {
47
- "antdv-next": ">=1.1.6",
47
+ "antdv-next": ">=1.3.4",
48
48
  "vue": ">=3.5.30"
49
49
  },
50
50
  "dependencies": {
51
51
  "swrv": "^1.2.0",
52
- "@antdv-next1/pro-provider": "1.0.3",
53
- "@antdv-next1/pro-utils": "1.0.9"
52
+ "@antdv-next1/pro-provider": "1.0.4",
53
+ "@antdv-next1/pro-utils": "1.0.10"
54
54
  },
55
55
  "publishConfig": {
56
56
  "access": "public"