@stonecrop/aform 0.22.0 → 0.23.0
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 +32 -0
- package/dist/aform.js +1112 -1016
- package/dist/aform.js.map +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/src/index.d.ts +4 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -1
- package/dist/src/utils/badge.d.ts +25 -0
- package/dist/src/utils/badge.d.ts.map +1 -0
- package/dist/src/utils/badge.js +71 -0
- package/package.json +5 -5
- package/src/components/form/ABadge.vue +135 -0
- package/src/components/form/ADropdown.vue +81 -99
- package/src/index.ts +5 -0
- package/src/utils/badge.ts +94 -0
package/dist/aform.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import ABadge from './components/form/ABadge.vue';
|
|
1
2
|
import ACheckbox from './components/form/ACheckbox.vue';
|
|
2
3
|
import ACurrencyInput from './components/form/ACurrencyInput.vue';
|
|
3
4
|
import ADate from './components/form/ADate.vue';
|
|
@@ -18,13 +19,17 @@ import type { App } from 'vue';
|
|
|
18
19
|
import AQuantityInput from './components/form/AQuantityInput.vue';
|
|
19
20
|
import ATextboxInput from './components/form/ATextboxInput.vue';
|
|
20
21
|
import ATextInput from './components/form/ATextInput.vue';
|
|
22
|
+
import type { BadgeDescriptor } from '@stonecrop/schema';
|
|
21
23
|
import type { ColumnSchema } from '@stonecrop/schema';
|
|
24
|
+
import type { FieldOptions } from '@stonecrop/schema';
|
|
22
25
|
import type { FieldValidation } from '@stonecrop/schema';
|
|
23
26
|
import { InteractionMode } from '@stonecrop/schema';
|
|
24
27
|
import Login from './components/utilities/Login.vue';
|
|
25
28
|
import type { TableViewConfig } from '@stonecrop/schema';
|
|
26
29
|
import type { ValueField } from '@stonecrop/schema';
|
|
27
30
|
|
|
31
|
+
export { ABadge }
|
|
32
|
+
|
|
28
33
|
export { ACheckbox }
|
|
29
34
|
|
|
30
35
|
export { ACurrencyInput }
|
|
@@ -98,6 +103,27 @@ export { ATextboxInput }
|
|
|
98
103
|
|
|
99
104
|
export { ATextInput }
|
|
100
105
|
|
|
106
|
+
/**
|
|
107
|
+
* Row context passed to badge `format` functions in form fields.
|
|
108
|
+
* @public
|
|
109
|
+
*/
|
|
110
|
+
export declare type BadgeFormatContext = {
|
|
111
|
+
record?: Record<string, unknown>;
|
|
112
|
+
row?: Record<string, unknown>;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Badge-aware field `format` function signature.
|
|
117
|
+
* @public
|
|
118
|
+
*/
|
|
119
|
+
export declare type BadgeFormatFn = (value: unknown, context: BadgeFormatContext) => string | BadgeDescriptor;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* CSS custom properties for input-accent styling on a native input.
|
|
123
|
+
* @public
|
|
124
|
+
*/
|
|
125
|
+
export declare function badgeInputAccentStyle(descriptor: BadgeDescriptor | undefined): Record<string, string> | undefined;
|
|
126
|
+
|
|
101
127
|
/**
|
|
102
128
|
* Defined props for AForm components
|
|
103
129
|
* @public
|
|
@@ -369,6 +395,12 @@ export declare interface ResolvedTable {
|
|
|
369
395
|
validation?: FieldValidation;
|
|
370
396
|
}
|
|
371
397
|
|
|
398
|
+
/**
|
|
399
|
+
* Resolve a field value to a badge descriptor using format (if present) then options map.
|
|
400
|
+
* @public
|
|
401
|
+
*/
|
|
402
|
+
export declare function resolveFieldBadge(value: unknown, options: FieldOptions | undefined, format: string | BadgeFormatFn | undefined, context?: BadgeFormatContext): BadgeDescriptor | undefined;
|
|
403
|
+
|
|
372
404
|
|
|
373
405
|
export * from "@stonecrop/atable/types";
|
|
374
406
|
|