@texaryn/vue 0.1.2 → 0.3.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/CHANGELOG.md +52 -0
- package/README.md +7 -1
- package/dist/action-names.d.ts +20 -0
- package/dist/action-names.d.ts.map +1 -0
- package/dist/action-names.js +31 -0
- package/dist/action-names.js.map +1 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +2 -0
- package/dist/context.js.map +1 -1
- package/dist/field-props.d.ts +6 -2
- package/dist/field-props.d.ts.map +1 -1
- package/dist/field-props.js +12 -6
- package/dist/field-props.js.map +1 -1
- package/dist/id-prefix.d.ts +12 -0
- package/dist/id-prefix.d.ts.map +1 -0
- package/dist/id-prefix.js +30 -0
- package/dist/id-prefix.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/use-field-widget.d.ts.map +1 -1
- package/dist/use-field-widget.js +19 -6
- package/dist/use-field-widget.js.map +1 -1
- package/dist/widgets/FieldErrors.d.ts +1 -1
- package/dist/widgets/FieldErrors.d.ts.map +1 -1
- package/dist/widgets/FieldErrors.js +4 -5
- package/dist/widgets/FieldErrors.js.map +1 -1
- package/dist/widgets/containers.d.ts.map +1 -1
- package/dist/widgets/containers.js +47 -5
- package/dist/widgets/containers.js.map +1 -1
- package/dist/widgets/inputs.d.ts +2 -0
- package/dist/widgets/inputs.d.ts.map +1 -1
- package/dist/widgets/inputs.js +17 -1
- package/dist/widgets/inputs.js.map +1 -1
- package/package.json +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,57 @@
|
|
|
1
1
|
# @texaryn/vue
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 04270e8: Give every array action control an accessible name that says which row it acts on.
|
|
8
|
+
|
|
9
|
+
Five buttons all announced as "Remove" leave a screen reader user guessing. Each now carries the current 1-based position and whatever schema titles exist, so "Remove Contact 2 from Contacts", degrading to "Remove item 2" when nothing is titled. Reorder controls read "Move up Contact 2 in Contacts", and the per-array control reads "Add item to Contacts". The visible words stay "Remove", "Up" and "Add", with the longer string in `aria-label`, which contains the visible text so speech input still works.
|
|
10
|
+
|
|
11
|
+
The row's own value is deliberately not used: it is mutable, often blank, frequently duplicated, and sometimes sensitive. The position is recomputed on every render rather than captured when a row is created, because a row survives a move while its position does not.
|
|
12
|
+
|
|
13
|
+
The add control is named from the item template rather than from the first row, so an empty array still says "Add Tag" where naming it matters most. That needed the template's annotations, which the projection did not carry: `NodeProjection.itemAnnotations` is new and optional, so an adapter that cannot supply it stays valid, and `ArrayMeta.itemTitle` carries the result to renderers.
|
|
14
|
+
|
|
15
|
+
React exposes the decision as `useArrayActions` so its three widget sets cannot drift, and the name builders are exported for custom widgets. Reorder-control parity is unchanged: the three React sets still expose no reorder button.
|
|
16
|
+
- c9b930f: Show a required field's requirement to a sighted user, without announcing it twice.
|
|
17
|
+
|
|
18
|
+
Required was conveyed only through `aria-required`, so a sighted user had nothing to tell a required field from an optional one. Every required label now carries a visible `(required)`.
|
|
19
|
+
|
|
20
|
+
Three channels carry that one fact and are deliberately kept separate. The visible label reads "Full Name (required)". The accessible name stays exactly "Full Name", because the indicator is `aria-hidden` and `aria-required` already reports the state; putting it in the name as well makes some screen readers say it twice. WCAG's Label in Name allows exactly this omission when the state is surfaced programmatically.
|
|
21
|
+
|
|
22
|
+
The indicator is the word rather than an asterisk, so nothing has to be explained elsewhere on the form. `field.label` and `fieldLabel()` still return the raw schema title: the decoration lives in the label rendering, so a visual convention does not become the canonical field title a custom widget sees. React exposes `FieldLabelContent` so its three widget sets cannot drift, and each binding exports `REQUIRED_INDICATOR` so a custom widget can match the wording.
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies [04270e8]
|
|
27
|
+
- @texaryn/core@0.7.0
|
|
28
|
+
|
|
29
|
+
## 0.2.0
|
|
30
|
+
|
|
31
|
+
### Minor Changes
|
|
32
|
+
|
|
33
|
+
- 3545378: Expose a titled nested object as a named group in React and Vue, closing the last gap the DOM accessibility contract declared.
|
|
34
|
+
|
|
35
|
+
A nested object rendered as a plain `div` gives no indication where one group of fields ends and the next begins. It is now a `fieldset` named by its `legend`, matching what `@texaryn/web-components` already did. The element is chosen once at mount and only the grouping semantics are re-derived, because a conditional subschema can add or drop a title on any recompile and swapping `div` for `fieldset` at that moment would remount the subtree and take the caret with it. An untitled nested object stays a `fieldset` but carries `role="none"`, since an unnamed group is noise in the accessibility tree.
|
|
36
|
+
|
|
37
|
+
The decision is shared through a new `useObjectGroup` hook, so the three React widget sets cannot drift apart on it. The root object is still a plain container: it is the form itself, not a group inside one.
|
|
38
|
+
- 3e53ca9: Keep each field's error container mounted as a live region instead of inserting it with the message already inside.
|
|
39
|
+
|
|
40
|
+
A region that appears together with its content is not reliably announced, which is what every binding did: React and Vue rendered nothing until an error existed, and Web Components kept the node but hid it, which takes it out of the accessibility tree just the same. The container now exists from mount, stays empty while the field is valid, and only its contents change.
|
|
41
|
+
|
|
42
|
+
It is `aria-live="polite" aria-atomic="true"` rather than `role="alert"`. This is a public semantic change: `ErrorProps` promised `role: 'alert'` and now carries the live-region attributes instead. Alert is assertive, and validation runs on change, blur and submit, so keeping it would have interrupted typing and spoken once per failing field on submit. `aria-describedby` stays conditional, pointing at the region only while it has something to say. `ErrorSummary` loses its `role="alert"` and keeps rendering conditionally, because the fields now announce their own errors and an aggregate region would repeat the same validation event.
|
|
43
|
+
- 4a161b2: Give every rendering surface its own DOM id namespace, so two forms on one page no longer share ids or reference each other's elements.
|
|
44
|
+
|
|
45
|
+
`FormProvider` becomes a real component rather than an alias for `FormContext.Provider`, and owns the namespace for everything under it, `ErrorSummary` included. Rendering through `FormContext.Provider` now throws, because the context alone carries no namespace. `makeId`, `getInputProps`, `getLabelProps`, `getErrorProps` and `getDescriptionProps` take the prefix explicitly; there is no unprefixed fallback, which would let a custom widget reintroduce the collision. `@texaryn/vue` takes the prefix from `provideFormRuntime` and now requires Vue 3.5 for `useId`. Generated ids are opaque relationship identifiers rather than styling hooks.
|
|
46
|
+
- e7c00ce: Render a schema's `readOnly` as read-only rather than disabled, and enforce it in the runtime.
|
|
47
|
+
|
|
48
|
+
A disabled control is not focusable and is announced differently; a read-only one stays focusable and selectable, which is what `readOnly` means. Compiled nodes now carry a resolved `readOnly` that a read-only object or array passes to everything beneath it, because editing a descendant changes the ancestor's value. The runtime refuses `SetValue`, `InsertItem`, `RemoveItem` and `MoveItem` on a read-only node, so a custom widget set cannot write past the restriction; `Reset` stays allowed as the owning authority replacing state. Renderers use the native `readonly` attribute where HTML has one and `aria-readonly` plus refusing the change where it does not, which is select and checkbox. `disabled` remains part of the node API, but the compiler no longer derives it from `readOnly`, so compiled nodes currently resolve it to false.
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- Updated dependencies [e7c00ce]
|
|
53
|
+
- @texaryn/core@0.6.0
|
|
54
|
+
|
|
3
55
|
## 0.1.2
|
|
4
56
|
|
|
5
57
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ and a small set of native widgets.
|
|
|
11
11
|
pnpm add @texaryn/core @texaryn/schema-json @texaryn/vue vue
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
`@texaryn/vue` requires Vue 3.
|
|
14
|
+
`@texaryn/vue` requires Vue 3.5 or newer, for `useId`.
|
|
15
15
|
|
|
16
16
|
## Quick start
|
|
17
17
|
|
|
@@ -48,6 +48,12 @@ A component cannot inject what it provided itself, so `FormRoot` and anything
|
|
|
48
48
|
calling `useField` has to be a descendant of whichever component called
|
|
49
49
|
`provideFormRuntime`.
|
|
50
50
|
|
|
51
|
+
That call also opens the DOM id namespace for the form, which is why it sits
|
|
52
|
+
there rather than in `FormRoot`: a sibling added later shares the same scope.
|
|
53
|
+
Generated ids are opaque relationship identifiers rather than styling hooks, so
|
|
54
|
+
use classes or data attributes for CSS. Uniqueness is per Vue application, so
|
|
55
|
+
two independent apps on one page need distinct `app.config.idPrefix` values.
|
|
56
|
+
|
|
51
57
|
## Lifetime is a requirement, not a convention
|
|
52
58
|
|
|
53
59
|
`useForm` and `useStore` throw when called outside `setup()` or an active
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accessible names for the controls an array renders.
|
|
3
|
+
*
|
|
4
|
+
* A deliberate reimplementation of `@texaryn/react`'s helper rather than an
|
|
5
|
+
* import of it, for the same reason `fieldAria` is: this package must not
|
|
6
|
+
* depend on the React binding. Web Components carries the third copy. Nothing
|
|
7
|
+
* here is Vue specific, and extraction waits for a boundary rather than a copy
|
|
8
|
+
* count: configurable or localized wording, or another renderer-neutral
|
|
9
|
+
* presentation rule that needs the same home. Putting English control copy in
|
|
10
|
+
* the headless runtime would be the wrong home.
|
|
11
|
+
*
|
|
12
|
+
* The name carries the current 1-based position, because that is what a person
|
|
13
|
+
* means by "the second contact"; the stable item id is implementation identity.
|
|
14
|
+
* The row's own value is deliberately unused: mutable, often blank, frequently
|
|
15
|
+
* duplicated, sometimes sensitive.
|
|
16
|
+
*/
|
|
17
|
+
export declare function removeActionName(position: number, itemTitle: string | undefined, arrayTitle: string | undefined): string;
|
|
18
|
+
export declare function moveUpActionName(position: number, itemTitle: string | undefined, arrayTitle: string | undefined): string;
|
|
19
|
+
export declare function addActionName(itemTitle: string | undefined, arrayTitle: string | undefined): string;
|
|
20
|
+
//# sourceMappingURL=action-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-names.d.ts","sourceRoot":"","sources":["../src/action-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,MAAM,CAER;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,MAAM,CAER;AAED,wBAAgB,aAAa,CAC3B,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,MAAM,CAGR"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accessible names for the controls an array renders.
|
|
3
|
+
*
|
|
4
|
+
* A deliberate reimplementation of `@texaryn/react`'s helper rather than an
|
|
5
|
+
* import of it, for the same reason `fieldAria` is: this package must not
|
|
6
|
+
* depend on the React binding. Web Components carries the third copy. Nothing
|
|
7
|
+
* here is Vue specific, and extraction waits for a boundary rather than a copy
|
|
8
|
+
* count: configurable or localized wording, or another renderer-neutral
|
|
9
|
+
* presentation rule that needs the same home. Putting English control copy in
|
|
10
|
+
* the headless runtime would be the wrong home.
|
|
11
|
+
*
|
|
12
|
+
* The name carries the current 1-based position, because that is what a person
|
|
13
|
+
* means by "the second contact"; the stable item id is implementation identity.
|
|
14
|
+
* The row's own value is deliberately unused: mutable, often blank, frequently
|
|
15
|
+
* duplicated, sometimes sensitive.
|
|
16
|
+
*/
|
|
17
|
+
export function removeActionName(position, itemTitle, arrayTitle) {
|
|
18
|
+
return withContainer(`Remove ${itemTitle ?? 'item'} ${position}`, 'from', arrayTitle);
|
|
19
|
+
}
|
|
20
|
+
export function moveUpActionName(position, itemTitle, arrayTitle) {
|
|
21
|
+
return withContainer(`Move up ${itemTitle ?? 'item'} ${position}`, 'in', arrayTitle);
|
|
22
|
+
}
|
|
23
|
+
export function addActionName(itemTitle, arrayTitle) {
|
|
24
|
+
if (arrayTitle !== undefined)
|
|
25
|
+
return `Add item to ${arrayTitle}`;
|
|
26
|
+
return itemTitle === undefined ? 'Add item' : `Add ${itemTitle}`;
|
|
27
|
+
}
|
|
28
|
+
function withContainer(name, preposition, arrayTitle) {
|
|
29
|
+
return arrayTitle === undefined ? name : `${name} ${preposition} ${arrayTitle}`;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=action-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-names.js","sourceRoot":"","sources":["../src/action-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,gBAAgB,CAC9B,QAAgB,EAChB,SAA6B,EAC7B,UAA8B;IAE9B,OAAO,aAAa,CAAC,UAAU,SAAS,IAAI,MAAM,IAAI,QAAQ,EAAE,EAAE,MAAM,EAAE,UAAU,CAAC,CAAA;AACvF,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,QAAgB,EAChB,SAA6B,EAC7B,UAA8B;IAE9B,OAAO,aAAa,CAAC,WAAW,SAAS,IAAI,MAAM,IAAI,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,CAAC,CAAA;AACtF,CAAC;AAED,MAAM,UAAU,aAAa,CAC3B,SAA6B,EAC7B,UAA8B;IAE9B,IAAI,UAAU,KAAK,SAAS;QAAE,OAAO,eAAe,UAAU,EAAE,CAAA;IAChE,OAAO,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,SAAS,EAAE,CAAA;AAClE,CAAC;AAED,SAAS,aAAa,CAAC,IAAY,EAAE,WAAmB,EAAE,UAA8B;IACtF,OAAO,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,WAAW,IAAI,UAAU,EAAE,CAAA;AACjF,CAAC"}
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAGlD,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,WAAW,CAA6B,CAAA;AAClF,eAAO,MAAM,mBAAmB,EAAE,YAAY,CAAC,WAAW,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CACjE,CAAA;AAE5B,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAG7D;AAED,wBAAgB,cAAc,IAAI,WAAW,CAM5C;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,GAC5D,IAAI,CAEN;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,IAAI,WAAW,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAMpF"}
|
package/dist/context.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { computed, inject, provide, toValue } from 'vue';
|
|
2
|
+
import { provideIdPrefix } from './id-prefix.js';
|
|
2
3
|
export const FormRuntimeKey = Symbol('texaryn.runtime');
|
|
3
4
|
export const RendererRegistryKey = Symbol('texaryn.registry');
|
|
4
5
|
export function provideFormRuntime(runtime) {
|
|
5
6
|
provide(FormRuntimeKey, runtime);
|
|
7
|
+
provideIdPrefix();
|
|
6
8
|
}
|
|
7
9
|
export function useFormRuntime() {
|
|
8
10
|
const runtime = inject(FormRuntimeKey, null);
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAIxD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEhD,MAAM,CAAC,MAAM,cAAc,GAA8B,MAAM,CAAC,iBAAiB,CAAC,CAAA;AAClF,MAAM,CAAC,MAAM,mBAAmB,GAC9B,MAAM,CAAC,kBAAkB,CAAC,CAAA;AAE5B,MAAM,UAAU,kBAAkB,CAAC,OAAoB;IACrD,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,CAAA;IAChC,eAAe,EAAE,CAAA;AACnB,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,MAAM,OAAO,GAAG,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC,CAAA;IAC5C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,8EAA8E,CAAC,CAAA;IACjG,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CACrC,QAA6D;IAE7D,OAAO,CAAC,mBAAmB,EAAE,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;AACjE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB;IACjC,MAAM,QAAQ,GAAG,MAAM,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAA;IAClD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAA;IAC5E,CAAC;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC"}
|
package/dist/field-props.d.ts
CHANGED
|
@@ -14,16 +14,20 @@ export interface FieldAria {
|
|
|
14
14
|
id: string;
|
|
15
15
|
name: string;
|
|
16
16
|
disabled: boolean;
|
|
17
|
+
/** Native `readonly`, which HTML honours on text, number and textarea only. */
|
|
18
|
+
readonly?: boolean;
|
|
19
|
+
/** Set instead where HTML has no native read-only, so select and checkbox. */
|
|
20
|
+
'aria-readonly'?: true;
|
|
17
21
|
'aria-required': boolean;
|
|
18
22
|
'aria-invalid'?: boolean;
|
|
19
23
|
'aria-describedby'?: string;
|
|
20
24
|
placeholder?: string;
|
|
21
25
|
}
|
|
22
|
-
export declare function makeId(nodeId: string, suffix: string): string;
|
|
26
|
+
export declare function makeId(idPrefix: string, nodeId: string, suffix: string): string;
|
|
23
27
|
export declare function fieldAria(node: FieldNode, state: {
|
|
24
28
|
disabled: boolean;
|
|
25
29
|
showErrors: boolean;
|
|
26
30
|
errors: readonly ValidationError[];
|
|
27
|
-
}): FieldAria;
|
|
31
|
+
}, idPrefix: string, nativeReadOnly?: boolean): FieldAria;
|
|
28
32
|
export declare function fieldLabel(node: FieldNode): string;
|
|
29
33
|
//# sourceMappingURL=field-props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-props.d.ts","sourceRoot":"","sources":["../src/field-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/D;;;;;;;;;;GAUG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,OAAO,CAAA;IACjB,eAAe,EAAE,OAAO,CAAA;IACxB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"field-props.d.ts","sourceRoot":"","sources":["../src/field-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/D;;;;;;;;;;GAUG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,OAAO,CAAA;IACjB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,8EAA8E;IAC9E,eAAe,CAAC,EAAE,IAAI,CAAA;IACtB,eAAe,EAAE,OAAO,CAAA;IACxB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAE/E;AAED,wBAAgB,SAAS,CACvB,IAAI,EAAE,SAAS,EACf,KAAK,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAA;CAAE,EACrF,QAAQ,EAAE,MAAM,EAChB,cAAc,UAAO,GACpB,SAAS,CA2BX;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAElD"}
|
package/dist/field-props.js
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
export function makeId(nodeId, suffix) {
|
|
2
|
-
return
|
|
1
|
+
export function makeId(idPrefix, nodeId, suffix) {
|
|
2
|
+
return `${idPrefix}-${nodeId}-${suffix}`;
|
|
3
3
|
}
|
|
4
|
-
export function fieldAria(node, state) {
|
|
4
|
+
export function fieldAria(node, state, idPrefix, nativeReadOnly = true) {
|
|
5
5
|
const describedBy = [];
|
|
6
6
|
if (node.helpText ?? node.annotations?.description) {
|
|
7
|
-
describedBy.push(makeId(node.id, 'description'));
|
|
7
|
+
describedBy.push(makeId(idPrefix, node.id, 'description'));
|
|
8
8
|
}
|
|
9
9
|
const invalid = state.showErrors && state.errors.length > 0;
|
|
10
10
|
if (invalid) {
|
|
11
|
-
describedBy.push(makeId(node.id, 'error'));
|
|
11
|
+
describedBy.push(makeId(idPrefix, node.id, 'error'));
|
|
12
12
|
}
|
|
13
|
+
const readOnly = node.readOnly
|
|
14
|
+
? nativeReadOnly
|
|
15
|
+
? { readonly: true }
|
|
16
|
+
: { 'aria-readonly': true }
|
|
17
|
+
: {};
|
|
13
18
|
return {
|
|
14
|
-
id: makeId(node.id, 'input'),
|
|
19
|
+
id: makeId(idPrefix, node.id, 'input'),
|
|
15
20
|
name: node.dataPointer || node.id,
|
|
16
21
|
disabled: state.disabled,
|
|
22
|
+
...readOnly,
|
|
17
23
|
'aria-required': Boolean(node.constraints?.required),
|
|
18
24
|
'aria-invalid': invalid ? true : undefined,
|
|
19
25
|
'aria-describedby': describedBy.length > 0 ? describedBy.join(' ') : undefined,
|
package/dist/field-props.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-props.js","sourceRoot":"","sources":["../src/field-props.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"field-props.js","sourceRoot":"","sources":["../src/field-props.ts"],"names":[],"mappings":"AA2BA,MAAM,UAAU,MAAM,CAAC,QAAgB,EAAE,MAAc,EAAE,MAAc;IACrE,OAAO,GAAG,QAAQ,IAAI,MAAM,IAAI,MAAM,EAAE,CAAA;AAC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,SAAS;QAC9E,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,SAAS;KAC3C,CAAA;AACH,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAe;IACxC,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,EAAE,CAAA;AAC9D,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { InjectionKey } from 'vue';
|
|
2
|
+
export declare const IdPrefixKey: InjectionKey<string>;
|
|
3
|
+
/**
|
|
4
|
+
* Called from provideFormRuntime, so the namespace covers the whole
|
|
5
|
+
* provisioning scope rather than only what FormRoot renders.
|
|
6
|
+
*
|
|
7
|
+
* Uniqueness is per Vue application, not per page: independent apps need
|
|
8
|
+
* distinct `app.config.idPrefix` values to stay disjoint.
|
|
9
|
+
*/
|
|
10
|
+
export declare function provideIdPrefix(): void;
|
|
11
|
+
export declare function useFormIdPrefix(): string;
|
|
12
|
+
//# sourceMappingURL=id-prefix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id-prefix.d.ts","sourceRoot":"","sources":["../src/id-prefix.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,KAAK,CAAA;AAEvC,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,MAAM,CAA8B,CAAA;AAY3E;;;;;;GAMG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED,wBAAgB,eAAe,IAAI,MAAM,CASxC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { inject, provide, useId } from 'vue';
|
|
2
|
+
export const IdPrefixKey = Symbol('texaryn.idPrefix');
|
|
3
|
+
/**
|
|
4
|
+
* Vue's useId output format is not part of its contract, so encoding each code
|
|
5
|
+
* point to base 36 keeps the seed injective and identical between a server and
|
|
6
|
+
* a client render while restricting it to characters that need no escaping in
|
|
7
|
+
* a selector or a stylesheet.
|
|
8
|
+
*/
|
|
9
|
+
function encodeSeed(seed) {
|
|
10
|
+
return Array.from(seed, (char) => char.codePointAt(0).toString(36)).join('_');
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Called from provideFormRuntime, so the namespace covers the whole
|
|
14
|
+
* provisioning scope rather than only what FormRoot renders.
|
|
15
|
+
*
|
|
16
|
+
* Uniqueness is per Vue application, not per page: independent apps need
|
|
17
|
+
* distinct `app.config.idPrefix` values to stay disjoint.
|
|
18
|
+
*/
|
|
19
|
+
export function provideIdPrefix() {
|
|
20
|
+
provide(IdPrefixKey, `texaryn-${encodeSeed(useId())}`);
|
|
21
|
+
}
|
|
22
|
+
export function useFormIdPrefix() {
|
|
23
|
+
const prefix = inject(IdPrefixKey, null);
|
|
24
|
+
if (!prefix) {
|
|
25
|
+
throw new Error('No id prefix in scope. Call provideFormRuntime in the component that owns the form; ' +
|
|
26
|
+
'without it two forms on one page share ids.');
|
|
27
|
+
}
|
|
28
|
+
return prefix;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=id-prefix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id-prefix.js","sourceRoot":"","sources":["../src/id-prefix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,CAAA;AAG5C,MAAM,CAAC,MAAM,WAAW,GAAyB,MAAM,CAAC,kBAAkB,CAAC,CAAA;AAE3E;;;;;GAKG;AACH,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAChF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,CAAC,WAAW,EAAE,WAAW,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAA;AACxD,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IACxC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,sFAAsF;YACpF,6CAA6C,CAChD,CAAA;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export type { FieldArrayItem, UseFieldArrayReturn } from './use-field-array.js';
|
|
|
9
9
|
export { useFieldWidget } from './use-field-widget.js';
|
|
10
10
|
export type { FieldKind, FieldWidget } from './use-field-widget.js';
|
|
11
11
|
export { fieldAria, fieldLabel, makeId } from './field-props.js';
|
|
12
|
+
export { removeActionName, moveUpActionName, addActionName } from './action-names.js';
|
|
13
|
+
export { useFormIdPrefix } from './id-prefix.js';
|
|
12
14
|
export type { FieldAria } from './field-props.js';
|
|
13
15
|
export type { WidgetComponent } from './widget.js';
|
|
14
16
|
export { FormRoot } from './components/FormRoot.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAElD,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,mBAAmB,GACpB,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAA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AACpD,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAEjD,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACxF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,8 @@ export { useField } from './use-field.js';
|
|
|
5
5
|
export { useFieldArray } from './use-field-array.js';
|
|
6
6
|
export { useFieldWidget } from './use-field-widget.js';
|
|
7
7
|
export { fieldAria, fieldLabel, makeId } from './field-props.js';
|
|
8
|
+
export { removeActionName, moveUpActionName, addActionName } from './action-names.js';
|
|
9
|
+
export { useFormIdPrefix } from './id-prefix.js';
|
|
8
10
|
export { FormRoot } from './components/FormRoot.js';
|
|
9
11
|
export { NodeRenderer } from './components/NodeRenderer.js';
|
|
10
12
|
export { FieldErrors } from './widgets/FieldErrors.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAGvC,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,mBAAmB,GACpB,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAGtD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAGvC,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,mBAAmB,GACpB,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAGtD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAIhD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACxF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-field-widget.d.ts","sourceRoot":"","sources":["../src/use-field-widget.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE7D,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAG/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"use-field-widget.d.ts","sourceRoot":"","sources":["../src/use-field-widget.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE7D,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAG/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAKjD,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAGhE,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,CAKpD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAI7E;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAO7E;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IAC5B,IAAI,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IAC5B,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACnB,OAAO,EAAE,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,CAAA;IACrC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC1B,WAAW,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5C,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAClC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC5B,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC7B,IAAI,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IAC5B,6EAA6E;IAC7E,MAAM,EAAE,WAAW,CAAC,SAAS,eAAe,EAAE,CAAC,CAAA;IAC/C,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAC7B,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAA;IAC9B,MAAM,IAAI,IAAI,CAAA;CACf;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,gBAAgB,CAAC,SAAS,CAAC,GAAG,WAAW,CA8CnF"}
|
package/dist/use-field-widget.js
CHANGED
|
@@ -2,6 +2,7 @@ import { computed } from 'vue';
|
|
|
2
2
|
import { toValue } from 'vue';
|
|
3
3
|
import { useField } from './use-field.js';
|
|
4
4
|
import { fieldAria, fieldLabel, makeId } from './field-props.js';
|
|
5
|
+
import { useFormIdPrefix } from './id-prefix.js';
|
|
5
6
|
const NO_ERRORS = Object.freeze([]);
|
|
6
7
|
// Mirrors the default registry's ranking: enum outranks the primitive kind.
|
|
7
8
|
export function fieldKind(node) {
|
|
@@ -38,6 +39,7 @@ export function coerce(kind, node, raw) {
|
|
|
38
39
|
export function useFieldWidget(nodeSource) {
|
|
39
40
|
const node = computed(() => toValue(nodeSource));
|
|
40
41
|
const field = useField(() => node.value.id);
|
|
42
|
+
const idPrefix = useFormIdPrefix();
|
|
41
43
|
const kind = computed(() => fieldKind(node.value));
|
|
42
44
|
const errors = computed(() => (field.showErrors.value ? field.errors.value : NO_ERRORS));
|
|
43
45
|
const invalid = computed(() => errors.value.length > 0);
|
|
@@ -48,18 +50,29 @@ export function useFieldWidget(nodeSource) {
|
|
|
48
50
|
display: computed(() => displayValue(kind.value, field.value.value)),
|
|
49
51
|
label: computed(() => fieldLabel(node.value)),
|
|
50
52
|
description: computed(() => node.value.helpText ?? node.value.annotations.description),
|
|
51
|
-
descriptionId: computed(() => makeId(node.value.id, 'description')),
|
|
52
|
-
errorId: computed(() => makeId(node.value.id, 'error')),
|
|
53
|
-
labelFor: computed(() => makeId(node.value.id, 'input')),
|
|
53
|
+
descriptionId: computed(() => makeId(idPrefix, node.value.id, 'description')),
|
|
54
|
+
errorId: computed(() => makeId(idPrefix, node.value.id, 'error')),
|
|
55
|
+
labelFor: computed(() => makeId(idPrefix, node.value.id, 'input')),
|
|
54
56
|
aria: computed(() => fieldAria(node.value, {
|
|
55
57
|
disabled: field.disabled.value,
|
|
56
58
|
showErrors: field.showErrors.value,
|
|
57
59
|
errors: field.errors.value,
|
|
58
|
-
})),
|
|
60
|
+
}, idPrefix, kind.value !== 'enum' && kind.value !== 'boolean')),
|
|
59
61
|
errors,
|
|
60
62
|
invalid,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
// The runtime rejects the write too. Stopping here as well keeps the DOM
|
|
64
|
+
// from showing a change that was refused, which native readonly prevents
|
|
65
|
+
// for text-like controls but not for a select or a checkbox.
|
|
66
|
+
setRaw: (raw) => {
|
|
67
|
+
if (node.value.readOnly)
|
|
68
|
+
return;
|
|
69
|
+
field.onChange(coerce(kind.value, node.value, raw));
|
|
70
|
+
},
|
|
71
|
+
setValue: (value) => {
|
|
72
|
+
if (node.value.readOnly)
|
|
73
|
+
return;
|
|
74
|
+
field.onChange(value);
|
|
75
|
+
},
|
|
63
76
|
onBlur: field.onBlur,
|
|
64
77
|
};
|
|
65
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-field-widget.js","sourceRoot":"","sources":["../src/use-field-widget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAE9B,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAE7B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"use-field-widget.js","sourceRoot":"","sources":["../src/use-field-widget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAE9B,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAE7B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEhD,MAAM,SAAS,GAA+B,MAAM,CAAC,MAAM,CAAoB,EAAE,CAAC,CAAA;AAIlF,4EAA4E;AAC5E,MAAM,UAAU,SAAS,CAAC,IAAe;IACvC,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,MAAM,CAAA;IACxE,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;QAAE,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AAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAClE,IAAI,EAAE,QAAQ,CAAC,GAAG,EAAE,CAClB,SAAS,CACP,IAAI,CAAC,KAAK,EACV;YACE,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK;YAC9B,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,KAAK;YAClC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK;SAC3B,EACD,QAAQ,EACR,IAAI,CAAC,KAAK,KAAK,MAAM,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,CAClD,CACF;QACD,MAAM;QACN,OAAO;QACP,yEAAyE;QACzE,yEAAyE;QACzE,6DAA6D;QAC7D,MAAM,EAAE,CAAC,GAAW,EAAE,EAAE;YACtB,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ;gBAAE,OAAM;YAC/B,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAA;QACrD,CAAC;QACD,QAAQ,EAAE,CAAC,KAAc,EAAE,EAAE;YAC3B,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ;gBAAE,OAAM;YAC/B,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QACvB,CAAC;QACD,MAAM,EAAE,KAAK,CAAC,MAAM;KACrB,CAAA;AACH,CAAC"}
|
|
@@ -11,7 +11,7 @@ export declare const FieldErrors: import("vue").DefineComponent<import("vue").Ex
|
|
|
11
11
|
};
|
|
12
12
|
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
13
13
|
[key: string]: any;
|
|
14
|
-
}
|
|
14
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
15
|
id: {
|
|
16
16
|
type: StringConstructor;
|
|
17
17
|
required: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldErrors.d.ts","sourceRoot":"","sources":["../../src/widgets/FieldErrors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAEpD,eAAO,MAAM,WAAW;;;;;;cAIK,QAAQ,CAAC,SAAS,eAAe,EAAE,CAAC;;;;;;;;;;;cAApC,QAAQ,CAAC,SAAS,eAAe,EAAE,CAAC;;;
|
|
1
|
+
{"version":3,"file":"FieldErrors.d.ts","sourceRoot":"","sources":["../../src/widgets/FieldErrors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAEpD,eAAO,MAAM,WAAW;;;;;;cAIK,QAAQ,CAAC,SAAS,eAAe,EAAE,CAAC;;;;;;;;;;;cAApC,QAAQ,CAAC,SAAS,eAAe,EAAE,CAAC;;;iGAgB/D,CAAA"}
|
|
@@ -6,11 +6,10 @@ export const FieldErrors = defineComponent({
|
|
|
6
6
|
errors: { type: Array, required: true },
|
|
7
7
|
},
|
|
8
8
|
setup(props) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
9
|
+
// Always rendered, and empty while valid. A region inserted with its
|
|
10
|
+
// content already in place is not reliably announced, and polite rather
|
|
11
|
+
// than alert because validation runs on change, blur and submit.
|
|
12
|
+
return () => h('div', { id: props.id, 'aria-live': 'polite', 'aria-atomic': 'true' }, props.errors.map((error, index) => h('div', { key: `${error.instancePointer}:${error.keyword}:${index}` }, error.message ?? error.keyword)));
|
|
14
13
|
},
|
|
15
14
|
});
|
|
16
15
|
//# sourceMappingURL=FieldErrors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldErrors.js","sourceRoot":"","sources":["../../src/widgets/FieldErrors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIxC,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC;IACzC,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE;QACL,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;QACpC,MAAM,EAAE,EAAE,IAAI,EAAE,KAA6C,EAAE,QAAQ,EAAE,IAAI,EAAE;KAChF;IACD,KAAK,CAAC,KAAK;QACT,
|
|
1
|
+
{"version":3,"file":"FieldErrors.js","sourceRoot":"","sources":["../../src/widgets/FieldErrors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIxC,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC;IACzC,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE;QACL,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;QACpC,MAAM,EAAE,EAAE,IAAI,EAAE,KAA6C,EAAE,QAAQ,EAAE,IAAI,EAAE;KAChF;IACD,KAAK,CAAC,KAAK;QACT,qEAAqE;QACrE,wEAAwE;QACxE,iEAAiE;QACjE,OAAO,GAAG,EAAE,CACV,CAAC,CACC,KAAK,EACL,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,EAC9D,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAChC,CAAC,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,EAAE,EAAE,EACpE,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,CAClC,CACF,CAAA;IACL,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containers.d.ts","sourceRoot":"","sources":["../../src/widgets/containers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,KAAK,EAAiB,MAAM,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"containers.d.ts","sourceRoot":"","sources":["../../src/widgets/containers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,KAAK,EAAiB,MAAM,EAAE,MAAM,eAAe,CAAA;AAS1D,eAAO,MAAM,YAAY;;uBAFkB,QAAQ,CAAC,MAAM,CAAC;;;;;;;uBAAhB,QAAQ,CAAC,MAAM,CAAC;;;iGAyCzD,CAAA;AAEF,eAAO,MAAM,YAAY;;uBA3CkB,QAAQ,CAAC,MAAM,CAAC;;;;;;;uBAAhB,QAAQ,CAAC,MAAM,CAAC;;;iGAiHzD,CAAA"}
|
|
@@ -3,6 +3,7 @@ import { useFormRuntime } from '../context.js';
|
|
|
3
3
|
import { useStore } from '../use-store.js';
|
|
4
4
|
import { useFieldArray } from '../use-field-array.js';
|
|
5
5
|
import { NodeRenderer } from '../components/NodeRenderer.js';
|
|
6
|
+
import { addActionName, moveUpActionName, removeActionName } from '../action-names.js';
|
|
6
7
|
const nodeProp = { node: { type: Object, required: true } };
|
|
7
8
|
export const ObjectLayout = defineComponent({
|
|
8
9
|
name: 'ObjectLayout',
|
|
@@ -10,10 +11,30 @@ export const ObjectLayout = defineComponent({
|
|
|
10
11
|
setup(props) {
|
|
11
12
|
const runtime = useFormRuntime();
|
|
12
13
|
const document = useStore(runtime.document, runtime.document.getSnapshot());
|
|
13
|
-
|
|
14
|
+
// Whether a node is nested is fixed for its lifetime, but its title is
|
|
15
|
+
// not: a conditional subschema can add or drop one on any recompile.
|
|
16
|
+
// Choosing the element once and re-deriving only the grouping semantics
|
|
17
|
+
// keeps the subtree mounted, because swapping div for fieldset would
|
|
18
|
+
// remount it and drop focus.
|
|
19
|
+
const nested = props.node.parentId !== null;
|
|
20
|
+
const current = computed(() => (document.value.nodes[props.node.id] ?? props.node));
|
|
21
|
+
const title = computed(() => current.value.annotations.title);
|
|
22
|
+
const children = computed(() => current.value.children
|
|
14
23
|
.map((id) => document.value.nodes[id])
|
|
15
24
|
.filter((child) => child != null));
|
|
16
|
-
return () =>
|
|
25
|
+
return () => {
|
|
26
|
+
const rendered = children.value.map((child) => h(NodeRenderer, { key: child.id, node: child }));
|
|
27
|
+
if (!nested)
|
|
28
|
+
return h('div', rendered);
|
|
29
|
+
// The root object is the form itself, so only a nested titled object
|
|
30
|
+
// names a group. An unnamed group is noise, so the fieldset stops being
|
|
31
|
+
// one. Children sit in their own element so the legend is never a
|
|
32
|
+
// candidate for reorder.
|
|
33
|
+
return h('fieldset', { role: title.value === undefined ? 'none' : undefined }, [
|
|
34
|
+
...(title.value === undefined ? [] : [h('legend', title.value)]),
|
|
35
|
+
h('div', rendered),
|
|
36
|
+
]);
|
|
37
|
+
};
|
|
17
38
|
},
|
|
18
39
|
});
|
|
19
40
|
export const ArrayControl = defineComponent({
|
|
@@ -23,9 +44,14 @@ export const ArrayControl = defineComponent({
|
|
|
23
44
|
const runtime = useFormRuntime();
|
|
24
45
|
const document = useStore(runtime.document, runtime.document.getSnapshot());
|
|
25
46
|
const array = useFieldArray(() => props.node.id);
|
|
47
|
+
// Read from the document so a title added by a recompile reaches the name.
|
|
48
|
+
const currentArray = computed(() => (document.value.nodes[props.node.id] ?? props.node));
|
|
49
|
+
const arrayTitle = computed(() => currentArray.value.annotations.title);
|
|
50
|
+
const itemTemplateTitle = computed(() => currentArray.value.arrayMeta?.itemTitle);
|
|
26
51
|
return () => h('div', [
|
|
27
52
|
...array.items.value.map((item, index) => {
|
|
28
53
|
const child = item.nodeId ? document.value.nodes[item.nodeId] : undefined;
|
|
54
|
+
const itemTitle = child?.annotations.title;
|
|
29
55
|
return h('div',
|
|
30
56
|
// Keyed by the stable item id, never the positional node id. That
|
|
31
57
|
// is what makes a move preserve the row's component instance and
|
|
@@ -33,16 +59,32 @@ export const ArrayControl = defineComponent({
|
|
|
33
59
|
// different node than the one it mounted with.
|
|
34
60
|
{ key: item.id }, [
|
|
35
61
|
child ? h(NodeRenderer, { node: child }) : null,
|
|
62
|
+
// The visible word stays short; the distinguishing name goes in
|
|
63
|
+
// aria-label, which contains it so speech input still works.
|
|
36
64
|
array.canRemove.value
|
|
37
|
-
? h('button', {
|
|
65
|
+
? h('button', {
|
|
66
|
+
type: 'button',
|
|
67
|
+
'aria-label': removeActionName(index + 1, itemTitle, arrayTitle.value),
|
|
68
|
+
onClick: () => array.remove(index),
|
|
69
|
+
}, 'Remove')
|
|
38
70
|
: null,
|
|
39
71
|
array.canReorder.value && index > 0
|
|
40
|
-
? h('button', {
|
|
72
|
+
? h('button', {
|
|
73
|
+
type: 'button',
|
|
74
|
+
'aria-label': moveUpActionName(index + 1, itemTitle, arrayTitle.value),
|
|
75
|
+
onClick: () => array.move(index, index - 1),
|
|
76
|
+
}, 'Up')
|
|
41
77
|
: null,
|
|
42
78
|
]);
|
|
43
79
|
}),
|
|
44
80
|
array.canAdd.value
|
|
45
|
-
? h('button', {
|
|
81
|
+
? h('button', {
|
|
82
|
+
type: 'button',
|
|
83
|
+
// The item template's title, not the first row's: a row may
|
|
84
|
+
// not exist yet, which is when naming this matters most.
|
|
85
|
+
'aria-label': addActionName(itemTemplateTitle.value, arrayTitle.value),
|
|
86
|
+
onClick: () => array.add(),
|
|
87
|
+
}, 'Add')
|
|
46
88
|
: null,
|
|
47
89
|
]);
|
|
48
90
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containers.js","sourceRoot":"","sources":["../../src/widgets/containers.ts"],"names":[],"mappings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iB,CAAC,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC;oBACtE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE;iBAC3B,EACD,KAAK,CACN;gBACH,CAAC,CAAC,IAAI;SACT,CAAC,CAAA;IACN,CAAC;CACF,CAAC,CAAA"}
|
package/dist/widgets/inputs.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { PropType, VNode } from 'vue';
|
|
2
2
|
import type { UINode } from '@texaryn/core';
|
|
3
|
+
/** The wording every binding uses, so a custom widget can match it. */
|
|
4
|
+
export declare const REQUIRED_INDICATOR = "(required)";
|
|
3
5
|
export declare const TextInput: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
6
|
readonly node: {
|
|
5
7
|
readonly type: PropType<UINode>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../src/widgets/inputs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,KAAK,CAAA;AAC1C,OAAO,KAAK,EAAa,MAAM,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../src/widgets/inputs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,KAAK,CAAA;AAC1C,OAAO,KAAK,EAAa,MAAM,EAAE,MAAM,eAAe,CAAA;AAOtD,uEAAuE;AACvE,eAAO,MAAM,kBAAkB,eAAe,CAAA;AAyC9C,eAAO,MAAM,SAAS;;uBA5CqB,QAAQ,CAAC,MAAM,CAAC;;;;;;;uBAAhB,QAAQ,CAAC,MAAM,CAAC;;;iGA6DzD,CAAA;AAEF,eAAO,MAAM,WAAW;;uBA/DmB,QAAQ,CAAC,MAAM,CAAC;;;;;;;uBAAhB,QAAQ,CAAC,MAAM,CAAC;;;iGAgFzD,CAAA;AAEF,eAAO,MAAM,QAAQ;;uBAlFsB,QAAQ,CAAC,MAAM,CAAC;;;;;;;uBAAhB,QAAQ,CAAC,MAAM,CAAC;;;iGAkGzD,CAAA;AAEF,eAAO,MAAM,QAAQ;;uBApGsB,QAAQ,CAAC,MAAM,CAAC;;;;;;;uBAAhB,QAAQ,CAAC,MAAM,CAAC;;;iGAqHzD,CAAA;AAEF,eAAO,MAAM,MAAM;;uBAvHwB,QAAQ,CAAC,MAAM,CAAC;;;;;;;uBAAhB,QAAQ,CAAC,MAAM,CAAC;;;iGAiJzD,CAAA"}
|
package/dist/widgets/inputs.js
CHANGED
|
@@ -2,9 +2,25 @@ import { defineComponent, h } from 'vue';
|
|
|
2
2
|
import { useFieldWidget } from '../use-field-widget.js';
|
|
3
3
|
import { FieldErrors } from './FieldErrors.js';
|
|
4
4
|
const nodeProp = { node: { type: Object, required: true } };
|
|
5
|
+
/** The wording every binding uses, so a custom widget can match it. */
|
|
6
|
+
export const REQUIRED_INDICATOR = '(required)';
|
|
7
|
+
/**
|
|
8
|
+
* Three separate channels carry one fact and must not be collapsed. The
|
|
9
|
+
* sighted user reads "(required)"; the accessible name stays the label alone,
|
|
10
|
+
* because aria-required already reports the state and naming it too makes some
|
|
11
|
+
* screen readers say it twice; and the indicator says the word rather than an
|
|
12
|
+
* asterisk, so nobody has to be told elsewhere what a marker means.
|
|
13
|
+
*/
|
|
14
|
+
function labelContent(field) {
|
|
15
|
+
const content = [field.label.value];
|
|
16
|
+
if (field.aria.value['aria-required']) {
|
|
17
|
+
content.push(h('span', { 'aria-hidden': 'true' }, ` ${REQUIRED_INDICATOR}`));
|
|
18
|
+
}
|
|
19
|
+
return content;
|
|
20
|
+
}
|
|
5
21
|
function fieldShell(field, control) {
|
|
6
22
|
return h('div', [
|
|
7
|
-
h('label', { id: `${field.labelFor.value}-label`, for: field.labelFor.value }, field
|
|
23
|
+
h('label', { id: `${field.labelFor.value}-label`, for: field.labelFor.value }, labelContent(field)),
|
|
8
24
|
control,
|
|
9
25
|
field.description.value
|
|
10
26
|
? h('div', { id: field.descriptionId.value }, field.description.value)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputs.js","sourceRoot":"","sources":["../../src/widgets/inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGxC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,MAAM,QAAQ,GAAG,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAA0B,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAW,CAAA;AAExF,SAAS,UAAU,CAAC,KAAkB,EAAE,OAAc;IACpD,OAAO,CAAC,CAAC,KAAK,EAAE;QACd,CAAC,
|
|
1
|
+
{"version":3,"file":"inputs.js","sourceRoot":"","sources":["../../src/widgets/inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGxC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,MAAM,QAAQ,GAAG,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAA0B,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAW,CAAA;AAExF,uEAAuE;AACvE,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAA;AAE9C;;;;;;GAMG;AACH,SAAS,YAAY,CAAC,KAAkB;IACtC,MAAM,OAAO,GAA0B,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IAC1D,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC;QACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,aAAa,EAA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AC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CACpD,CAAC,CAAC,QAAQ,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EACpE,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CACxC;SACF,CACF,CACF,CAAA;IACL,CAAC;CACF,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@texaryn/vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Vue 3 bindings, composables, and default widgets for Texaryn",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue",
|
|
@@ -44,17 +44,18 @@
|
|
|
44
44
|
"CHANGELOG.md"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@texaryn/core": "^0.
|
|
47
|
+
"@texaryn/core": "^0.7.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"vue": ">=3.
|
|
50
|
+
"vue": ">=3.5.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
+
"@vue/server-renderer": "^3.5.0",
|
|
53
54
|
"@vue/test-utils": "^2.4.6",
|
|
54
55
|
"jsdom": "^25.0.0",
|
|
55
56
|
"vue": "^3.5.0",
|
|
56
|
-
"@texaryn/
|
|
57
|
-
"@texaryn/
|
|
57
|
+
"@texaryn/examples": "0.0.0",
|
|
58
|
+
"@texaryn/schema-json": "0.3.0"
|
|
58
59
|
},
|
|
59
60
|
"scripts": {
|
|
60
61
|
"build": "tsc --build"
|