@stonecrop/aform 0.9.2 → 0.10.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.
package/dist/aform.d.ts CHANGED
@@ -55,10 +55,10 @@ export declare type BaseSchema = {
55
55
  */
56
56
  component?: string;
57
57
  /**
58
- * A placeholder value for the field
59
- * @beta
58
+ * Per-field rendering mode override; takes precedence over the AForm-level `mode` prop
59
+ * @public
60
60
  */
61
- value?: any;
61
+ mode?: FormMode;
62
62
  };
63
63
 
64
64
  /**
@@ -77,7 +77,10 @@ export declare type ComponentProps = {
77
77
  */
78
78
  label?: string;
79
79
  /**
80
- * The masking string to apply to inputs inside the component
80
+ * The mask to apply to inputs inside the component. Accepts either a plain
81
+ * mask string (e.g. `"(###) ###-####"`) or a stringified arrow function that
82
+ * receives `locale` and returns a mask string
83
+ * (e.g. `"(locale) => locale === 'en-US' ? '(###) ###-####' : '####-######'"`).
81
84
  * @public
82
85
  */
83
86
  mask?: string;
@@ -87,10 +90,10 @@ export declare type ComponentProps = {
87
90
  */
88
91
  required?: boolean;
89
92
  /**
90
- * Indicate whether elements inside the component are read-only
93
+ * The rendering mode for the component
91
94
  * @public
92
95
  */
93
- readOnly?: boolean;
96
+ mode?: FormMode;
94
97
  /**
95
98
  * Set a unique identifier for elements inside the component
96
99
  * @public
@@ -147,11 +150,6 @@ export declare type DoctypeSchema = BaseSchema & {
147
150
  * @public
148
151
  */
149
152
  schema?: SchemaTypes[];
150
- /**
151
- * Indicate whether the nested form is read-only
152
- * @public
153
- */
154
- readOnly?: boolean;
155
153
  };
156
154
 
157
155
  /**
@@ -176,6 +174,12 @@ export declare type FieldsetSchema = BaseSchema & {
176
174
  collapsible?: boolean;
177
175
  };
178
176
 
177
+ /**
178
+ * The rendering mode for AForm components
179
+ * @public
180
+ */
181
+ export declare type FormMode = 'edit' | 'read' | 'display';
182
+
179
183
  /**
180
184
  * Schema structure for defining forms inside AForm
181
185
  * @public
@@ -193,17 +197,6 @@ export declare type FormSchema = BaseSchema & {
193
197
  edit?: boolean;
194
198
  /**
195
199
  * The field type for the schema field
196
- *
197
- * @remarks
198
- * This must be a string that represents the field type. A mask string will be automatically
199
- * applied for the following field types:
200
- * - Date ('##/##/####')
201
- * - Datetime ('####/##/## ##:##')
202
- * - Time ('##:##')
203
- * - Fulltime ('##:##:##')
204
- * - Phone ('(###) ### - ####')
205
- * - Card ('#### #### #### ####')
206
- *
207
200
  * @public
208
201
  */
209
202
  fieldtype?: string;
@@ -223,8 +216,11 @@ export declare type FormSchema = BaseSchema & {
223
216
  */
224
217
  width?: string;
225
218
  /**
226
- * The mask string for the field
227
- * @beta
219
+ * The mask to apply to the field. Accepts either a plain mask string
220
+ * (e.g. `"##/##/####"`) or a stringified arrow function that receives `locale`
221
+ * and returns a mask string
222
+ * (e.g. `"(locale) => locale === 'en-US' ? '(###) ###-####' : '####-######'"`).
223
+ * @public
228
224
  */
229
225
  mask?: string;
230
226
  };
@@ -290,11 +286,6 @@ export declare type TableDoctypeSchema = BaseSchema & {
290
286
  * @public
291
287
  */
292
288
  rows?: TableRow[];
293
- /**
294
- * Indicate whether the table is read-only
295
- * @public
296
- */
297
- readOnly?: boolean;
298
289
  };
299
290
 
300
291
  /**