@1money/component-ui 0.0.94-alpha.0 → 0.0.94-alpha.1

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.
@@ -119,6 +119,20 @@ export interface ProFormContextValue<Values = Record<string, any>> extends ProFo
119
119
  export interface ProFormTypedFieldProps<Values = Record<string, any>, Name extends ProFormFieldName<Values> = ProFormFieldName<Values>, FieldProps = Record<string, any>, FieldParams = Record<string, any>> {
120
120
  name?: Name;
121
121
  label?: ReactNode;
122
+ /**
123
+ * Defaults to `true`. No marker is drawn for a required field — instead,
124
+ * `required={false}` appends the italic `(Optional)` suffix to the label,
125
+ * matching the Input/Select/Calendar field shells.
126
+ *
127
+ * This is label copy only; it does NOT add or remove validation. Keep it in
128
+ * step with `rules` yourself — a field with `rules: [{ required: true }]`
129
+ * should not also say `(Optional)`.
130
+ *
131
+ * Note this is a field-level prop, not `fieldProps.required`: the label is
132
+ * rendered by `ProFormItem`, so a `required` buried in `fieldProps` reaches
133
+ * a control that has no label and shows nothing.
134
+ */
135
+ required?: boolean;
122
136
  rules?: FormRule<Values>[];
123
137
  description?: ReactNode;
124
138
  feedback?: ReactNode;
@@ -168,6 +182,12 @@ export interface ProFormItemProps<Values = Record<string, any>, Name extends Pro
168
182
  prefixCls?: string;
169
183
  label?: ReactNode;
170
184
  name?: Name;
185
+ /**
186
+ * Defaults to `true`. `required={false}` appends the italic `(Optional)`
187
+ * suffix to the label — there is no required marker. Label copy only; it
188
+ * does not affect validation.
189
+ */
190
+ required?: boolean;
171
191
  rules?: FormRule<Values>[];
172
192
  description?: ReactNode;
173
193
  feedback?: ReactNode;
@@ -37,6 +37,10 @@
37
37
  padding: 0;
38
38
  }
39
39
 
40
+ .om-component-ui-form-item-optional {
41
+ margin-inline-start: var(--om-spacing-100, 4px);
42
+ }
43
+
40
44
  .om-component-ui-form-item-label-wrapper-left {
41
45
  text-align: left;
42
46
  }