@stonecrop/aform 0.2.64 → 0.2.66

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
@@ -1,20 +1,15 @@
1
- import ACheckbox from '@/components/form/ACheckbox.vue';
2
- import AComboBox from '@/components/form/AComboBox.vue';
3
- import ADate from '@/components/form/ADate.vue';
4
- import ADatePicker from '@/components/form/ADatePicker.vue';
5
- import ADropdown from '@/components/form/ADropdown.vue';
6
- import AFieldset from '@/components/form/AFieldset.vue';
7
- import AFileAttach from '@/components/form/AFileAttach.vue';
8
- import AForm from '@/components/AForm.vue';
9
- import ANumericInput from '@/components/form/ANumericInput.vue';
1
+ import ACheckbox from './components/form/ACheckbox.vue';
2
+ import AComboBox from './components/form/AComboBox.vue';
3
+ import ADate from './components/form/ADate.vue';
4
+ import ADatePicker from './components/form/ADatePicker.vue';
5
+ import ADropdown from './components/form/ADropdown.vue';
6
+ import AFieldset from './components/form/AFieldset.vue';
7
+ import AFileAttach from './components/form/AFileAttach.vue';
8
+ import AForm from './components/AForm.vue';
9
+ import ANumericInput from './components/form/ANumericInput.vue';
10
10
  import { App } from 'vue';
11
- import ATextInput from '@/components/form/ATextInput.vue';
12
- import { BasicSchema } from '@/types';
13
- import { FieldsetSchema } from '@/types';
14
- import { FormSchema } from '@/types';
15
- import Login from '@/components/utilities/Login.vue';
16
- import { SchemaTypes } from '@/types';
17
- import { TableSchema } from '@/types';
11
+ import ATextInput from './components/form/ATextInput.vue';
12
+ import Login from './components/utilities/Login.vue';
18
13
 
19
14
  export { ACheckbox }
20
15
 
@@ -36,11 +31,51 @@ export { ANumericInput }
36
31
 
37
32
  export { ATextInput }
38
33
 
39
- export { BasicSchema }
34
+ /**
35
+ * Base schemda for AForm components
36
+ * @beta
37
+ */
38
+ export declare type BasicSchema = {
39
+ component: string;
40
+ fieldname: string;
41
+ value: any;
42
+ };
40
43
 
41
- export { FieldsetSchema }
44
+ /**
45
+ * Table cell context definition.
46
+ * @public
47
+ */
48
+ declare type CellContext = {
49
+ row: TableRow;
50
+ column: TableColumn;
51
+ table: {
52
+ [key: string]: any;
53
+ };
54
+ };
55
+
56
+ /**
57
+ * Fieldset schema
58
+ * @beta
59
+ */
60
+ export declare type FieldsetSchema = BasicSchema & {
61
+ label: string;
62
+ schema: (FormSchema | TableSchema)[];
63
+ collapsible?: boolean;
64
+ };
42
65
 
43
- export { FormSchema }
66
+ /**
67
+ * Form schema
68
+ * @beta
69
+ */
70
+ export declare type FormSchema = BasicSchema & {
71
+ align: string;
72
+ edit: boolean;
73
+ fieldtype: string;
74
+ label: string;
75
+ name: string;
76
+ width: string;
77
+ mask?: string;
78
+ };
44
79
 
45
80
  /**
46
81
  * Install all AForm components
@@ -51,8 +86,66 @@ export declare function install(app: App): void;
51
86
 
52
87
  export { Login }
53
88
 
54
- export { SchemaTypes }
89
+ /**
90
+ * Superset of schema types
91
+ * @public
92
+ */
93
+ export declare type SchemaTypes = FormSchema | TableSchema | FieldsetSchema;
55
94
 
56
- export { TableSchema }
95
+ /**
96
+ * Table column definition.
97
+ * @public
98
+ */
99
+ declare type TableColumn = {
100
+ name: string;
101
+ align?: CanvasTextAlign;
102
+ edit?: boolean;
103
+ label?: string;
104
+ type?: string;
105
+ width?: string;
106
+ pinned?: boolean;
107
+ cellComponent?: string;
108
+ cellComponentProps?: Record<string, any>;
109
+ modalComponent?: string | ((context?: CellContext) => string);
110
+ modalComponentExtraProps?: Record<string, any>;
111
+ format?: string | ((value: any, context?: CellContext) => string);
112
+ mask?: (value: any) => any;
113
+ };
114
+
115
+ /**
116
+ * Table configuration definition.
117
+ * @public
118
+ */
119
+ declare type TableConfig = {
120
+ /**
121
+ * The type of view to display the table in. Possible values:
122
+ * - `uncounted` - row numbers are not displayed in the table
123
+ * - `list` - row numbers are displayed in the table
124
+ * - `list-expansion` - carets are displayed in the number column that expand/collapse the row inline
125
+ * - `tree` - carets are displayed in the number column that expand/collapse grouped rows
126
+ */
127
+ view?: 'uncounted' | 'list' | 'list-expansion' | 'tree';
128
+ fullWidth?: boolean;
129
+ };
130
+
131
+ /**
132
+ * Table row definition.
133
+ * @public
134
+ */
135
+ declare type TableRow = {
136
+ [key: string]: any;
137
+ indent?: number;
138
+ parent?: number;
139
+ };
140
+
141
+ /**
142
+ * Table schema
143
+ * @beta
144
+ */
145
+ export declare type TableSchema = BasicSchema & {
146
+ columns: TableColumn[];
147
+ config: TableConfig;
148
+ rows: TableRow[];
149
+ };
57
150
 
58
151
  export { }