@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/dist/aform.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ 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 AQuantityInput from './components/form/AQuantityInput.vue';
|
|
16
17
|
import ATextarea from './components/form/ATextarea.vue';
|
|
17
18
|
import ATextInput from './components/form/ATextInput.vue';
|
|
18
19
|
import type { ColumnSchema } from '@stonecrop/schema';
|
|
@@ -72,6 +73,8 @@ export { AFormLoading }
|
|
|
72
73
|
|
|
73
74
|
export { ANumericInput }
|
|
74
75
|
|
|
76
|
+
export { AQuantityInput }
|
|
77
|
+
|
|
75
78
|
export { ATextarea }
|
|
76
79
|
|
|
77
80
|
export { ATextInput }
|
|
@@ -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[]`,
|