@stonecrop/aform 0.15.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 CHANGED
@@ -10,8 +10,10 @@ import AFieldset from './components/form/AFieldset.vue';
10
10
  import AFileAttach from './components/form/AFileAttach.vue';
11
11
  import AForm from './components/AForm.vue';
12
12
  import AFormLink from './components/form/AFormLink.vue';
13
+ import AFormLoading from './components/AFormLoading.vue';
13
14
  import ANumericInput from './components/form/ANumericInput.vue';
14
15
  import type { App } from 'vue';
16
+ import AQuantityInput from './components/form/AQuantityInput.vue';
15
17
  import ATextarea from './components/form/ATextarea.vue';
16
18
  import ATextInput from './components/form/ATextInput.vue';
17
19
  import type { ColumnSchema } from '@stonecrop/schema';
@@ -67,8 +69,12 @@ export declare interface AFormLinkValue {
67
69
  [extra: string]: any;
68
70
  }
69
71
 
72
+ export { AFormLoading }
73
+
70
74
  export { ANumericInput }
71
75
 
76
+ export { AQuantityInput }
77
+
72
78
  export { ATextarea }
73
79
 
74
80
  export { ATextInput }
@@ -160,6 +166,38 @@ export { InteractionMode }
160
166
 
161
167
  export { Login }
162
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
+
163
201
  /**
164
202
  * The discriminated union of all resolved field types — what AForm consumes,
165
203
  * usually after `resolveSchema()` has transformed the authoring `DoctypeField[]`,