@stonecrop/aform 0.16.0 → 0.16.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.
@@ -236,3 +236,35 @@ export interface AFormLinkNavigator {
236
236
  /** Navigate to the linked document. Implementation is app-defined. */
237
237
  navigate(doctype: string, id: string | number): void
238
238
  }
239
+
240
+ /**
241
+ * The value shape for AQuantityInput — a quantity paired with its unit of measure, plus the
242
+ * derived stock-equivalent quantity/UOM. `conversionFactor` is carried on the value so it
243
+ * round-trips with the record even though it is never shown in the UI.
244
+ * @public
245
+ */
246
+ export interface QuantityValue {
247
+ /** The entered quantity, in `uom` units */
248
+ qty: number
249
+ /** Unit of measure the user entered `qty` in */
250
+ uom: string
251
+ /** `qty` converted into `stockUom` units — `qty * conversionFactor` */
252
+ stockQty: number
253
+ /** The item's base/stock unit of measure — fixed, not user-editable */
254
+ stockUom: string
255
+ /** Multiplier from `uom` to `stockUom` — hidden from the UI, drives `stockQty` */
256
+ conversionFactor: number
257
+ }
258
+
259
+ /**
260
+ * Type-specific configuration for AQuantityInput, passed via the field's `options` property.
261
+ * @public
262
+ */
263
+ export interface QuantityOptions {
264
+ /** Dropdown choices for the `uom` field */
265
+ uoms?: string[]
266
+ /** The item's base/stock unit of measure — fixed, not user-editable */
267
+ stockUom?: string
268
+ /** Conversion factor lookup for each non-stock UOM, relative to `stockUom` (which is implicitly `1`) */
269
+ conversionFactors?: Record<string, number>
270
+ }