@stonecrop/aform 0.13.14 → 0.14.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/README.md +59 -9
- package/dist/aform.d.ts +24 -5
- package/dist/aform.js +2541 -2490
- package/dist/aform.js.map +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/probe.tsbuildinfo +1 -0
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -3
- package/dist/src/types/index.d.ts +21 -2
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/theme/login.css +1 -0
- package/package.json +7 -5
- package/src/components/AForm.vue +19 -8
- package/src/components/form/ACheckbox.vue +7 -3
- package/src/components/form/ADate.vue +12 -2
- package/src/components/form/ADatePicker.vue +85 -69
- package/src/components/form/ADateRange.vue +5 -2
- package/src/components/form/ADropdown.vue +18 -1
- package/src/components/form/ANumericInput.vue +8 -2
- package/src/components/form/ATextInput.vue +6 -3
- package/src/components/form/ATextarea.vue +31 -0
- package/src/components/utilities/Login.vue +0 -1
- package/src/index.ts +3 -3
- package/src/theme/login.css +0 -1
- package/src/types/index.ts +34 -3
- package/src/components/form/AComboBox.vue +0 -17
package/src/index.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { install as installATable } from '@stonecrop/atable'
|
|
|
4
4
|
import type { App } from 'vue'
|
|
5
5
|
|
|
6
6
|
import ACheckbox from './components/form/ACheckbox.vue'
|
|
7
|
-
import AComboBox from './components/form/AComboBox.vue'
|
|
8
7
|
import ADate from './components/form/ADate.vue'
|
|
9
8
|
import ADropdown from './components/form/ADropdown.vue'
|
|
10
9
|
import ADatePicker from './components/form/ADatePicker.vue'
|
|
@@ -18,6 +17,7 @@ import AForm from './components/AForm.vue'
|
|
|
18
17
|
import AFormLink from './components/form/AFormLink.vue'
|
|
19
18
|
import ANumericInput from './components/form/ANumericInput.vue'
|
|
20
19
|
import ATextInput from './components/form/ATextInput.vue'
|
|
20
|
+
import ATextarea from './components/form/ATextarea.vue'
|
|
21
21
|
import Login from './components/utilities/Login.vue'
|
|
22
22
|
export type * from './types'
|
|
23
23
|
|
|
@@ -30,7 +30,6 @@ function install(app: App /* options */) {
|
|
|
30
30
|
app.use(installATable) // Install ATable components for use within AForm
|
|
31
31
|
|
|
32
32
|
app.component('ACheckbox', ACheckbox)
|
|
33
|
-
app.component('AComboBox', AComboBox)
|
|
34
33
|
app.component('ADate', ADate)
|
|
35
34
|
app.component('ADropdown', ADropdown)
|
|
36
35
|
app.component('ADatePicker', ADatePicker)
|
|
@@ -43,12 +42,12 @@ function install(app: App /* options */) {
|
|
|
43
42
|
app.component('AFormLink', AFormLink)
|
|
44
43
|
app.component('ANumericInput', ANumericInput)
|
|
45
44
|
app.component('ATextInput', ATextInput)
|
|
45
|
+
app.component('ATextarea', ATextarea)
|
|
46
46
|
app.component('ADuration', ADuration)
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
export {
|
|
50
50
|
ACheckbox,
|
|
51
|
-
AComboBox,
|
|
52
51
|
ADate,
|
|
53
52
|
ADropdown,
|
|
54
53
|
ADatePicker,
|
|
@@ -62,6 +61,7 @@ export {
|
|
|
62
61
|
AFormLink,
|
|
63
62
|
ANumericInput,
|
|
64
63
|
ATextInput,
|
|
64
|
+
ATextarea,
|
|
65
65
|
Login,
|
|
66
66
|
install,
|
|
67
67
|
}
|
package/src/theme/login.css
CHANGED
package/src/types/index.ts
CHANGED
|
@@ -14,7 +14,18 @@ export type { InteractionMode } from '@stonecrop/schema'
|
|
|
14
14
|
|
|
15
15
|
// ---------------------------------------------------------------------------
|
|
16
16
|
// ResolvedField — the output-space type that AForm consumes
|
|
17
|
-
//
|
|
17
|
+
//
|
|
18
|
+
// Usually produced by resolveSchema() from an authoring-space DoctypeField[].
|
|
19
|
+
// It may also be hand-authored, for view chrome that has no backing doctype
|
|
20
|
+
// (see Desktop.vue's doctype list) — annotate such literals with `satisfies
|
|
21
|
+
// ResolvedTable`/`satisfies ResolvedField` so they stay checked.
|
|
22
|
+
//
|
|
23
|
+
// Authoring space and output space are NOT interchangeable. The trap is tables:
|
|
24
|
+
// an authoring TableField carries its columns under `columns`, while resolveSchema
|
|
25
|
+
// renames that key to `schema` (registry.ts) because `schema` is the ATable prop
|
|
26
|
+
// that runs schemaToColumns(). Hand-authoring `columns` here — or feeding an
|
|
27
|
+
// authoring-space field straight to AForm — produces a field AForm does not
|
|
28
|
+
// recognise as a table.
|
|
18
29
|
// ---------------------------------------------------------------------------
|
|
19
30
|
|
|
20
31
|
/**
|
|
@@ -60,6 +71,14 @@ export interface ResolvedLink {
|
|
|
60
71
|
* A resolved table — either from a Link with `noneOrMany`/`atLeastOne` cardinality,
|
|
61
72
|
* or from an inline TableField. ATable receives columns via `:schema` (ColumnSchema[])
|
|
62
73
|
* and row data via `:rows` from formData at render time.
|
|
74
|
+
*
|
|
75
|
+
* Note the key rename: an authoring `TableField` declares its columns under `columns`;
|
|
76
|
+
* `resolveSchema` moves them to `schema` here, because `schema` is the ATable prop that
|
|
77
|
+
* runs `schemaToColumns()` (ATable's own `columns` prop means already-converted
|
|
78
|
+
* `TableColumn[]`). A hand-authored table must therefore use `schema`, not `columns`.
|
|
79
|
+
*
|
|
80
|
+
* Rows are never part of the schema. AForm sources them from the data model at
|
|
81
|
+
* `dataModel[fieldname]`, so a `rows` key placed on this object is ignored.
|
|
63
82
|
* @public
|
|
64
83
|
*/
|
|
65
84
|
export interface ResolvedTable {
|
|
@@ -111,9 +130,13 @@ export interface ResolvedFieldset {
|
|
|
111
130
|
}
|
|
112
131
|
|
|
113
132
|
/**
|
|
114
|
-
* The discriminated union of all resolved field types — what AForm consumes
|
|
115
|
-
* after `resolveSchema()` has transformed the authoring `DoctypeField[]
|
|
133
|
+
* The discriminated union of all resolved field types — what AForm consumes,
|
|
134
|
+
* usually after `resolveSchema()` has transformed the authoring `DoctypeField[]`,
|
|
135
|
+
* but also valid hand-authored for view chrome with no backing doctype.
|
|
116
136
|
* Narrowed by `kind`: `'field'` | `'link'` | `'table'` | `'fieldset'`.
|
|
137
|
+
*
|
|
138
|
+
* `kind` is required — AForm dispatches on it alone and does not infer a field's
|
|
139
|
+
* type from its structure.
|
|
117
140
|
* @public
|
|
118
141
|
*/
|
|
119
142
|
export type ResolvedField = ResolvedScalar | ResolvedLink | ResolvedTable | ResolvedFieldset
|
|
@@ -182,6 +205,14 @@ export type ComponentProps = {
|
|
|
182
205
|
|
|
183
206
|
[key: string]: any
|
|
184
207
|
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Inline validation error messages to display on this field. Fed by the host
|
|
211
|
+
* (e.g. mapped from the core validation store) — the renderer stays dumb and just
|
|
212
|
+
* shows what it is given. Takes precedence over the static `validation.errorMessage`.
|
|
213
|
+
* @public
|
|
214
|
+
*/
|
|
215
|
+
errors?: string[]
|
|
185
216
|
}
|
|
186
217
|
|
|
187
218
|
/**
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<ATableModal :event="event" :cell-data="cellData" class="amodal">
|
|
3
|
-
<div>
|
|
4
|
-
<input type="text" />
|
|
5
|
-
<input type="text" />
|
|
6
|
-
<input type="text" />
|
|
7
|
-
</div>
|
|
8
|
-
</ATableModal>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script setup lang="ts">
|
|
12
|
-
import type { ComponentProps } from '../../types'
|
|
13
|
-
|
|
14
|
-
// TODO: change props from individual elements to the store object
|
|
15
|
-
// TODO: implement full mode/display support
|
|
16
|
-
defineProps<ComponentProps & { event?: any; cellData?: any; tableID?: string }>()
|
|
17
|
-
</script>
|