@stonecrop/aform 0.16.0 → 0.16.2

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 CHANGED
@@ -20,7 +20,7 @@ Schema-driven form components for the Stonecrop framework. Renders a `ResolvedFi
20
20
  | `AFormLink` | Linked document selector with search dropdown and navigation arrow |
21
21
  | `ANumericInput` | Numeric input with type-specific formatting |
22
22
  | `ATextInput` | Single-line text input |
23
- | `ATextarea` | Multi-line text input |
23
+ | `ATextboxInput` | Multi-line long-text input |
24
24
 
25
25
  ## Installation
26
26
 
package/dist/aform.d.ts CHANGED
@@ -13,7 +13,8 @@ import AFormLink from './components/form/AFormLink.vue';
13
13
  import AFormLoading from './components/AFormLoading.vue';
14
14
  import ANumericInput from './components/form/ANumericInput.vue';
15
15
  import type { App } from 'vue';
16
- import ATextarea from './components/form/ATextarea.vue';
16
+ import AQuantityInput from './components/form/AQuantityInput.vue';
17
+ import ATextboxInput from './components/form/ATextboxInput.vue';
17
18
  import ATextInput from './components/form/ATextInput.vue';
18
19
  import type { ColumnSchema } from '@stonecrop/schema';
19
20
  import type { FieldValidation } from '@stonecrop/schema';
@@ -72,7 +73,9 @@ export { AFormLoading }
72
73
 
73
74
  export { ANumericInput }
74
75
 
75
- export { ATextarea }
76
+ export { AQuantityInput }
77
+
78
+ export { ATextboxInput }
76
79
 
77
80
  export { ATextInput }
78
81
 
@@ -163,6 +166,38 @@ export { InteractionMode }
163
166
 
164
167
  export { Login }
165
168
 
169
+ /**
170
+ * Type-specific configuration for AQuantityInput, passed via the field's `options` property.
171
+ * @public
172
+ */
173
+ export declare interface QuantityOptions {
174
+ /** Dropdown choices for the `uom` field */
175
+ uoms?: string[];
176
+ /** The item's base/stock unit of measure — fixed, not user-editable */
177
+ stockUom?: string;
178
+ /** Conversion factor lookup for each non-stock UOM, relative to `stockUom` (which is implicitly `1`) */
179
+ conversionFactors?: Record<string, number>;
180
+ }
181
+
182
+ /**
183
+ * The value shape for AQuantityInput — a quantity paired with its unit of measure, plus the
184
+ * derived stock-equivalent quantity/UOM. `conversionFactor` is carried on the value so it
185
+ * round-trips with the record even though it is never shown in the UI.
186
+ * @public
187
+ */
188
+ export declare interface QuantityValue {
189
+ /** The entered quantity, in `uom` units */
190
+ qty: number;
191
+ /** Unit of measure the user entered `qty` in */
192
+ uom: string;
193
+ /** `qty` converted into `stockUom` units — `qty * conversionFactor` */
194
+ stockQty: number;
195
+ /** The item's base/stock unit of measure — fixed, not user-editable */
196
+ stockUom: string;
197
+ /** Multiplier from `uom` to `stockUom` — hidden from the UI, drives `stockQty` */
198
+ conversionFactor: number;
199
+ }
200
+
166
201
  /**
167
202
  * The discriminated union of all resolved field types — what AForm consumes,
168
203
  * usually after `resolveSchema()` has transformed the authoring `DoctypeField[]`,