@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.
- package/dist/aform.d.ts +35 -0
- package/dist/aform.js +2282 -2061
- package/dist/aform.js.map +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -1
- package/dist/src/types/index.d.ts +30 -0
- package/dist/src/types/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/components/form/AQuantityInput.vue +349 -0
- package/src/index.ts +3 -0
- package/src/types/index.ts +32 -0
package/src/types/index.ts
CHANGED
|
@@ -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
|
+
}
|