@ibyar/elements 0.6.1 → 0.8.3
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 +5 -2
- package/accessibility/a11y.d.ts +1 -0
- package/accessibility/a11y.js +39 -0
- package/accessibility/a11y.js.map +1 -0
- package/accessibility/drag-and-drop.d.ts +11 -0
- package/accessibility/drag-and-drop.js +9 -0
- package/accessibility/drag-and-drop.js.map +1 -0
- package/accessibility/index.d.ts +5 -0
- package/accessibility/index.js +6 -0
- package/accessibility/index.js.map +1 -0
- package/accessibility/region.d.ts +17 -0
- package/accessibility/region.js +13 -0
- package/accessibility/region.js.map +1 -0
- package/accessibility/relationship.d.ts +77 -0
- package/accessibility/relationship.js +42 -0
- package/accessibility/relationship.js.map +1 -0
- package/accessibility/widget.d.ts +77 -0
- package/accessibility/widget.js +53 -0
- package/accessibility/widget.js.map +1 -0
- package/ast/dom.d.ts +36 -0
- package/ast/dom.js +36 -0
- package/ast/dom.js.map +1 -1
- package/attributes/attributes.js +0 -1
- package/attributes/attributes.js.map +1 -1
- package/attributes/common.d.ts +11 -0
- package/attributes/common.js +16 -0
- package/attributes/common.js.map +1 -0
- package/attributes/form.d.ts +34 -3
- package/attributes/form.js +88 -7
- package/attributes/form.js.map +1 -1
- package/attributes/shadow.js +1 -1
- package/attributes/shadow.js.map +1 -1
- package/attributes/tags.d.ts +0 -11
- package/attributes/tags.js +1 -15
- package/attributes/tags.js.map +1 -1
- package/index.d.ts +2 -1
- package/index.js +2 -1
- package/index.js.map +1 -1
- package/node/html-parser.d.ts +11 -6
- package/node/html-parser.js +213 -134
- package/node/html-parser.js.map +1 -1
- package/node.d.ts +4 -0
- package/node.js +5 -0
- package/node.js.map +1 -0
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Ibyar Elements
|
|
2
2
|
|
|
3
3
|
[![NPM Version][npm-image]][npm-url]
|
|
4
4
|
[![NPM Downloads][downloads-image]][downloads-url]
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
[lerna-url]: https://lerna.js.org/
|
|
17
17
|
[contributors]: https://img.shields.io/github/contributors/ibyar/aurora
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Ibyar elements, hold info about HTMLElements class, attributes and tag name.
|
|
20
20
|
|
|
21
21
|
## `Install`
|
|
22
22
|
|
|
@@ -28,6 +28,9 @@ npm i --save @ibyar/elements
|
|
|
28
28
|
yarn add @ibyar/elements
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
+
## Try the parser
|
|
32
|
+
- Ibyar Elements parser: https://ibyar.github.io/astexplorer/
|
|
33
|
+
|
|
31
34
|
|
|
32
35
|
## Example
|
|
33
36
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ARIAMixinAttributes: (keyof ARIAMixin)[];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export const ARIAMixinAttributes = [
|
|
2
|
+
'ariaAtomic',
|
|
3
|
+
'ariaAutoComplete',
|
|
4
|
+
'ariaBusy',
|
|
5
|
+
'ariaChecked',
|
|
6
|
+
'ariaColCount',
|
|
7
|
+
'ariaColIndex',
|
|
8
|
+
'ariaColSpan',
|
|
9
|
+
'ariaCurrent',
|
|
10
|
+
'ariaDisabled',
|
|
11
|
+
'ariaExpanded',
|
|
12
|
+
'ariaHasPopup',
|
|
13
|
+
'ariaHidden',
|
|
14
|
+
'ariaKeyShortcuts',
|
|
15
|
+
'ariaLabel',
|
|
16
|
+
'ariaLevel',
|
|
17
|
+
'ariaLive',
|
|
18
|
+
'ariaModal',
|
|
19
|
+
'ariaMultiLine',
|
|
20
|
+
'ariaMultiSelectable',
|
|
21
|
+
'ariaOrientation',
|
|
22
|
+
'ariaPlaceholder',
|
|
23
|
+
'ariaPosInSet',
|
|
24
|
+
'ariaPressed',
|
|
25
|
+
'ariaReadOnly',
|
|
26
|
+
'ariaRequired',
|
|
27
|
+
'ariaRoleDescription',
|
|
28
|
+
'ariaRowCount',
|
|
29
|
+
'ariaRowIndex',
|
|
30
|
+
'ariaRowSpan',
|
|
31
|
+
'ariaSelected',
|
|
32
|
+
'ariaSetSize',
|
|
33
|
+
'ariaSort',
|
|
34
|
+
'ariaValueMax',
|
|
35
|
+
'ariaValueMin',
|
|
36
|
+
'ariaValueNow',
|
|
37
|
+
'ariaValueText'
|
|
38
|
+
];
|
|
39
|
+
//# sourceMappingURL=a11y.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a11y.js","sourceRoot":"","sources":["../../../src/elements/accessibility/a11y.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAwB;IACvD,YAAY;IACZ,kBAAkB;IAClB,UAAU;IACV,aAAa;IACb,cAAc;IACd,cAAc;IACd,aAAa;IACb,aAAa;IACb,cAAc;IACd,cAAc;IACd,cAAc;IACd,YAAY;IACZ,kBAAkB;IAClB,WAAW;IACX,WAAW;IACX,UAAU;IACV,WAAW;IACX,eAAe;IACf,qBAAqB;IACrB,iBAAiB;IACjB,iBAAiB;IACjB,cAAc;IACd,aAAa;IACb,cAAc;IACd,cAAc;IACd,qBAAqB;IACrB,cAAc;IACd,cAAc;IACd,aAAa;IACb,cAAc;IACd,aAAa;IACb,UAAU;IACV,cAAc;IACd,cAAc;IACd,cAAc;IACd,eAAe;CACf,CAAC","sourcesContent":["export const ARIAMixinAttributes: (keyof ARIAMixin)[] = [\n\t'ariaAtomic',\n\t'ariaAutoComplete',\n\t'ariaBusy',\n\t'ariaChecked',\n\t'ariaColCount',\n\t'ariaColIndex',\n\t'ariaColSpan',\n\t'ariaCurrent',\n\t'ariaDisabled',\n\t'ariaExpanded',\n\t'ariaHasPopup',\n\t'ariaHidden',\n\t'ariaKeyShortcuts',\n\t'ariaLabel',\n\t'ariaLevel',\n\t'ariaLive',\n\t'ariaModal',\n\t'ariaMultiLine',\n\t'ariaMultiSelectable',\n\t'ariaOrientation',\n\t'ariaPlaceholder',\n\t'ariaPosInSet',\n\t'ariaPressed',\n\t'ariaReadOnly',\n\t'ariaRequired',\n\t'ariaRoleDescription',\n\t'ariaRowCount',\n\t'ariaRowIndex',\n\t'ariaRowSpan',\n\t'ariaSelected',\n\t'ariaSetSize',\n\t'ariaSort',\n\t'ariaValueMax',\n\t'ariaValueMin',\n\t'ariaValueNow',\n\t'ariaValueText'\n];\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare type AriaDropEffect = 'copy' | 'execute' | 'link' | 'move' | 'none' | 'popup';
|
|
2
|
+
export declare type AriaGrabbed = boolean | undefined;
|
|
3
|
+
export interface DragAndDropModel {
|
|
4
|
+
ariaDropEffect: AriaDropEffect;
|
|
5
|
+
ariaGrabbed: AriaGrabbed;
|
|
6
|
+
}
|
|
7
|
+
export declare const DragAndDropAttributes: string[];
|
|
8
|
+
export declare const DragAndDropAttributesMap: {
|
|
9
|
+
'aria-dropeffect': string;
|
|
10
|
+
'aria-grabbed': string;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drag-and-drop.js","sourceRoot":"","sources":["../../../src/elements/accessibility/drag-and-drop.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACpC,iBAAiB;IACjB,cAAc;CACd,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACvC,iBAAiB,EAAE,gBAAgB;IACnC,cAAc,EAAE,aAAa;CAC7B,CAAC","sourcesContent":["export type AriaDropEffect = 'copy' | 'execute' | 'link' | 'move' | 'none' | 'popup';\n\nexport type AriaGrabbed = boolean | undefined;\n\nexport interface DragAndDropModel {\n\tariaDropEffect: AriaDropEffect,\n\tariaGrabbed: AriaGrabbed,\n}\n\nexport const DragAndDropAttributes = [\n\t'aria-dropeffect',\n\t'aria-grabbed',\n];\n\nexport const DragAndDropAttributesMap = {\n\t'aria-dropeffect': 'ariaDropEffect',\n\t'aria-grabbed': 'ariaGrabbed',\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/elements/accessibility/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC","sourcesContent":["export * from './a11y.js';\nexport * from './relationship.js';\nexport * from './widget.js';\nexport * from './region.js';\nexport * from './drag-and-drop.js';"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare type AriaBusy = boolean;
|
|
2
|
+
export declare type AriaLive = 'assertive' | 'off' | 'polite';
|
|
3
|
+
export declare type AriaRelevant = 'additions' | 'removals' | 'text' | 'additions text' | 'all';
|
|
4
|
+
export declare type AriaAtomic = boolean;
|
|
5
|
+
export interface LiveRegionModel {
|
|
6
|
+
ariaBusy: AriaBusy;
|
|
7
|
+
ariaLive: AriaLive;
|
|
8
|
+
ariaRelevant: AriaRelevant;
|
|
9
|
+
ariaAtomic: AriaAtomic;
|
|
10
|
+
}
|
|
11
|
+
export declare const LiveRegionAttributes: string[];
|
|
12
|
+
export declare const LiveRegionAttributesMap: {
|
|
13
|
+
'aria-busy': string;
|
|
14
|
+
'aria-live': string;
|
|
15
|
+
'aria-relevant': string;
|
|
16
|
+
'aria-atomic': string;
|
|
17
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const LiveRegionAttributes = [
|
|
2
|
+
'aria-busy',
|
|
3
|
+
'aria-live',
|
|
4
|
+
'aria-relevant',
|
|
5
|
+
'aria-atomic',
|
|
6
|
+
];
|
|
7
|
+
export const LiveRegionAttributesMap = {
|
|
8
|
+
'aria-busy': 'ariaBusy',
|
|
9
|
+
'aria-live': 'ariaLive',
|
|
10
|
+
'aria-relevant': 'ariaRelevant',
|
|
11
|
+
'aria-atomic': 'ariaAtomic',
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=region.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"region.js","sourceRoot":"","sources":["../../../src/elements/accessibility/region.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IACnC,WAAW;IACX,WAAW;IACX,eAAe;IACf,aAAa;CACb,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACtC,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,UAAU;IACvB,eAAe,EAAE,cAAc;IAC/B,aAAa,EAAE,YAAY;CAC3B,CAAC","sourcesContent":["export type AriaBusy = boolean;\n\nexport type AriaLive = 'assertive' | 'off' | 'polite';\n\nexport type AriaRelevant = 'additions' | 'removals' | 'text' | 'additions text' | 'all';\n\n\nexport type AriaAtomic = boolean;\n\nexport interface LiveRegionModel {\n\tariaBusy: AriaBusy,\n\tariaLive: AriaLive,\n\tariaRelevant: AriaRelevant,\n\tariaAtomic: AriaAtomic,\n}\n\nexport const LiveRegionAttributes = [\n\t'aria-busy',\n\t'aria-live',\n\t'aria-relevant',\n\t'aria-atomic',\n];\n\nexport const LiveRegionAttributesMap = {\n\t'aria-busy': 'ariaBusy',\n\t'aria-live': 'ariaLive',\n\t'aria-relevant': 'ariaRelevant',\n\t'aria-atomic': 'ariaAtomic',\n};\n"]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* element id attribute
|
|
3
|
+
*/
|
|
4
|
+
export declare type ElementID = string;
|
|
5
|
+
export declare type AriaActiveDescendantElement = ElementID;
|
|
6
|
+
export declare type AriaActiveDescendantElementRole = 'application' | 'combobox' | 'composite' | 'group' | 'textbox';
|
|
7
|
+
export declare type AriaColCount = number;
|
|
8
|
+
export declare type AriaColCountRole = 'table' | 'grid' | 'treegrid';
|
|
9
|
+
export declare type AriaColIndex = number;
|
|
10
|
+
export declare type AriaColIndexRole = 'cell' | 'row' | 'columnheader' | 'gridcell' | 'rowheader';
|
|
11
|
+
export declare type AriaColSpan = number;
|
|
12
|
+
export declare type AriaColSpanRole = 'cell' | 'columnheader' | 'rowheader';
|
|
13
|
+
export declare type AriaControlsElements = ElementID | ElementID[];
|
|
14
|
+
export declare type AriaDescribedByElements = ElementID | ElementID[];
|
|
15
|
+
export declare type AriaDetailsElements = ElementID | ElementID[];
|
|
16
|
+
export declare type AriaDescription = string;
|
|
17
|
+
export declare type AriaErrorMessageElement = ElementID;
|
|
18
|
+
export declare type AriaErrorMessageElementRole = 'application' | 'checkbox' | 'combobox' | 'gridcell' | 'listbox' | 'radiogroup' | 'slider' | 'spinbutton' | 'textbox' | 'tree' | 'columnheader' | 'rowheader' | 'searchbox' | 'switch' | 'treegrid';
|
|
19
|
+
export declare type AriaFlowToElements = ElementID | ElementID[];
|
|
20
|
+
export declare type AriaLabelledByElements = ElementID | ElementID[];
|
|
21
|
+
export declare type AriaOwnsElements = ElementID | ElementID[];
|
|
22
|
+
export declare type AriaPosInSet = number;
|
|
23
|
+
/**
|
|
24
|
+
* The number of rows in the full table or -1 is the table size is not known.
|
|
25
|
+
*/
|
|
26
|
+
export declare type AriaRowCount = number;
|
|
27
|
+
/**
|
|
28
|
+
* An integer greater than or equal to 1, greater than the aria-rowindex of the previous row, if any, and less than or equal to the value of aria-rowcount.
|
|
29
|
+
*/
|
|
30
|
+
export declare type AriaRowIndex = number;
|
|
31
|
+
/**
|
|
32
|
+
* An integer greater than or equal to 0 and less than would cause a cell to overlap the next cell in the same column.
|
|
33
|
+
*/
|
|
34
|
+
export declare type AriaRowSpan = number;
|
|
35
|
+
/**
|
|
36
|
+
* The number of items in the full set or -1 is the set size is unknown.
|
|
37
|
+
*/
|
|
38
|
+
export declare type AriaSetSize = number;
|
|
39
|
+
export interface RelationshipModel {
|
|
40
|
+
ariaActiveDescendantElement: AriaActiveDescendantElement;
|
|
41
|
+
ariaColCount: AriaColCount;
|
|
42
|
+
ariaColIndex: AriaColIndex;
|
|
43
|
+
ariaColSpan: AriaColSpan;
|
|
44
|
+
ariaControlsElements: AriaControlsElements;
|
|
45
|
+
ariaDescribedByElements: AriaDescribedByElements;
|
|
46
|
+
ariaDescription: AriaDescription;
|
|
47
|
+
ariaDetailsElements: AriaDetailsElements;
|
|
48
|
+
ariaErrorMessageElement: AriaErrorMessageElement;
|
|
49
|
+
ariaFlowToElements: AriaFlowToElements;
|
|
50
|
+
ariaLabelledByElements: AriaLabelledByElements;
|
|
51
|
+
ariaOwnsElements: AriaOwnsElements;
|
|
52
|
+
ariaPosInSet: AriaPosInSet;
|
|
53
|
+
ariaRowCount: AriaRowCount;
|
|
54
|
+
ariaRowIndex: AriaRowIndex;
|
|
55
|
+
ariaRowSpan: AriaRowSpan;
|
|
56
|
+
ariaSetSize: AriaSetSize;
|
|
57
|
+
}
|
|
58
|
+
export declare const RelationshipAttributes: string[];
|
|
59
|
+
export declare const RelationshipAttributesMap: {
|
|
60
|
+
'aria-activedescendant': string;
|
|
61
|
+
'aria-colcount': string;
|
|
62
|
+
'aria-colindex': string;
|
|
63
|
+
'aria-colspan': string;
|
|
64
|
+
'aria-controls': string;
|
|
65
|
+
'aria-describedby': string;
|
|
66
|
+
'aria-description': string;
|
|
67
|
+
'aria-details': string;
|
|
68
|
+
'aria-errormessage': string;
|
|
69
|
+
'aria-flowto': string;
|
|
70
|
+
'aria-labelledby': string;
|
|
71
|
+
'aria-owns': string;
|
|
72
|
+
'aria-posinset': string;
|
|
73
|
+
'aria-rowcount': string;
|
|
74
|
+
'aria-rowindex': string;
|
|
75
|
+
'aria-rowspan': string;
|
|
76
|
+
'aria-setsize': string;
|
|
77
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
;
|
|
2
|
+
;
|
|
3
|
+
;
|
|
4
|
+
export const RelationshipAttributes = [
|
|
5
|
+
'aria-activedescendant',
|
|
6
|
+
'aria-colcount',
|
|
7
|
+
'aria-colindex',
|
|
8
|
+
'aria-colspan',
|
|
9
|
+
'aria-controls',
|
|
10
|
+
'aria-describedby',
|
|
11
|
+
'aria-description',
|
|
12
|
+
'aria-details',
|
|
13
|
+
'aria-errormessage',
|
|
14
|
+
'aria-flowto',
|
|
15
|
+
'aria-labelledby',
|
|
16
|
+
'aria-owns',
|
|
17
|
+
'aria-posinset',
|
|
18
|
+
'aria-rowcount',
|
|
19
|
+
'aria-rowindex',
|
|
20
|
+
'aria-rowspan',
|
|
21
|
+
'aria-setsize',
|
|
22
|
+
];
|
|
23
|
+
export const RelationshipAttributesMap = {
|
|
24
|
+
'aria-activedescendant': 'ariaActiveDescendantElement',
|
|
25
|
+
'aria-colcount': 'ariaColCount',
|
|
26
|
+
'aria-colindex': 'ariaColIndex',
|
|
27
|
+
'aria-colspan': 'ariaColSpan',
|
|
28
|
+
'aria-controls': 'ariaControlsElements',
|
|
29
|
+
'aria-describedby': 'ariaDescribedByElements',
|
|
30
|
+
'aria-description': 'ariaDescription',
|
|
31
|
+
'aria-details': 'ariaDetailsElements',
|
|
32
|
+
'aria-errormessage': 'ariaErrorMessageElement',
|
|
33
|
+
'aria-flowto': 'ariaFlowToElements',
|
|
34
|
+
'aria-labelledby': 'ariaLabelledByElements',
|
|
35
|
+
'aria-owns': 'ariaOwnsElements',
|
|
36
|
+
'aria-posinset': 'ariaPosInSet',
|
|
37
|
+
'aria-rowcount': 'ariaRowCount',
|
|
38
|
+
'aria-rowindex': 'ariaRowIndex',
|
|
39
|
+
'aria-rowspan': 'ariaRowSpan',
|
|
40
|
+
'aria-setsize': 'ariaSetSize',
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=relationship.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relationship.js","sourceRoot":"","sources":["../../../src/elements/accessibility/relationship.ts"],"names":[],"mappings":"AAgC2D,CAAC;AAEE,CAAC;AAEL,CAAC;AAoE3D,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC,uBAAuB;IACvB,eAAe;IACf,eAAe;IACf,cAAc;IACd,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,cAAc;IACd,mBAAmB;IACnB,aAAa;IACb,iBAAiB;IACjB,WAAW;IACX,eAAe;IACf,eAAe;IACf,eAAe;IACf,cAAc;IACd,cAAc;CACd,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACxC,uBAAuB,EAAE,6BAA6B;IACtD,eAAe,EAAE,cAAc;IAC/B,eAAe,EAAE,cAAc;IAC/B,cAAc,EAAE,aAAa;IAC7B,eAAe,EAAE,sBAAsB;IACvC,kBAAkB,EAAE,yBAAyB;IAC7C,kBAAkB,EAAE,iBAAiB;IACrC,cAAc,EAAE,qBAAqB;IACrC,mBAAmB,EAAE,yBAAyB;IAC9C,aAAa,EAAE,oBAAoB;IACnC,iBAAiB,EAAE,wBAAwB;IAC3C,WAAW,EAAE,kBAAkB;IAC/B,eAAe,EAAE,cAAc;IAC/B,eAAe,EAAE,cAAc;IAC/B,eAAe,EAAE,cAAc;IAC/B,cAAc,EAAE,aAAa;IAC7B,cAAc,EAAE,aAAa;CAC7B,CAAC","sourcesContent":["\n/**\n * element id attribute\n */\nexport type ElementID = string;\nexport type AriaActiveDescendantElement = ElementID;\n\nexport type AriaActiveDescendantElementRole =\n\t| 'application'\n\t| 'combobox'\n\t| 'composite'\n\t| 'group'\n\t| 'textbox';\n\n\nexport type AriaColCount = number;\nexport type AriaColCountRole = 'table' | 'grid' | 'treegrid';\n\nexport type AriaColIndex = number;\n\nexport type AriaColIndexRole =\n\t| 'cell'\n\t| 'row'\n\t| 'columnheader'\n\t| 'gridcell'\n\t| 'rowheader';\n\n\nexport type AriaColSpan = number;\nexport type AriaColSpanRole = 'cell' | 'columnheader' | 'rowheader';\n\n\nexport type AriaControlsElements = ElementID | ElementID[];;\n\nexport type AriaDescribedByElements = ElementID | ElementID[];;\n\nexport type AriaDetailsElements = ElementID | ElementID[];;\n\n\nexport type AriaDescription = string;\n\nexport type AriaErrorMessageElement = ElementID;\nexport type AriaErrorMessageElementRole =\n\t| 'application'\n\t| 'checkbox'\n\t| 'combobox'\n\t| 'gridcell'\n\t| 'listbox'\n\t| 'radiogroup'\n\t| 'slider'\n\t| 'spinbutton'\n\t| 'textbox'\n\t| 'tree'\n\t| 'columnheader'\n\t| 'rowheader'\n\t| 'searchbox'\n\t| 'switch'\n\t| 'treegrid';\n\nexport type AriaFlowToElements = ElementID | ElementID[];\nexport type AriaLabelledByElements = ElementID | ElementID[];\nexport type AriaOwnsElements = ElementID | ElementID[];\nexport type AriaPosInSet = number;\n\n/**\n * The number of rows in the full table or -1 is the table size is not known.\n */\nexport type AriaRowCount = number;\n\n/**\n * An integer greater than or equal to 1, greater than the aria-rowindex of the previous row, if any, and less than or equal to the value of aria-rowcount.\n */\nexport type AriaRowIndex = number;\n\n/**\n * An integer greater than or equal to 0 and less than would cause a cell to overlap the next cell in the same column.\n */\nexport type AriaRowSpan = number;\n\n/**\n * The number of items in the full set or -1 is the set size is unknown.\n */\nexport type AriaSetSize = number;\n\nexport interface RelationshipModel {\n\tariaActiveDescendantElement: AriaActiveDescendantElement,\n\tariaColCount: AriaColCount,\n\tariaColIndex: AriaColIndex,\n\tariaColSpan: AriaColSpan,\n\tariaControlsElements: AriaControlsElements,\n\tariaDescribedByElements: AriaDescribedByElements,\n\tariaDescription: AriaDescription,\n\tariaDetailsElements: AriaDetailsElements,\n\tariaErrorMessageElement: AriaErrorMessageElement,\n\tariaFlowToElements: AriaFlowToElements,\n\tariaLabelledByElements: AriaLabelledByElements\n\tariaOwnsElements: AriaOwnsElements,\n\tariaPosInSet: AriaPosInSet,\n\tariaRowCount: AriaRowCount,\n\tariaRowIndex: AriaRowIndex,\n\tariaRowSpan: AriaRowSpan,\n\tariaSetSize: AriaSetSize,\n}\n\nexport const RelationshipAttributes = [\n\t'aria-activedescendant',\n\t'aria-colcount',\n\t'aria-colindex',\n\t'aria-colspan',\n\t'aria-controls',\n\t'aria-describedby',\n\t'aria-description',\n\t'aria-details',\n\t'aria-errormessage',\n\t'aria-flowto',\n\t'aria-labelledby',\n\t'aria-owns',\n\t'aria-posinset',\n\t'aria-rowcount',\n\t'aria-rowindex',\n\t'aria-rowspan',\n\t'aria-setsize',\n];\n\nexport const RelationshipAttributesMap = {\n\t'aria-activedescendant': 'ariaActiveDescendantElement',\n\t'aria-colcount': 'ariaColCount',\n\t'aria-colindex': 'ariaColIndex',\n\t'aria-colspan': 'ariaColSpan',\n\t'aria-controls': 'ariaControlsElements',\n\t'aria-describedby': 'ariaDescribedByElements',\n\t'aria-description': 'ariaDescription',\n\t'aria-details': 'ariaDetailsElements',\n\t'aria-errormessage': 'ariaErrorMessageElement',\n\t'aria-flowto': 'ariaFlowToElements',\n\t'aria-labelledby': 'ariaLabelledByElements',\n\t'aria-owns': 'ariaOwnsElements',\n\t'aria-posinset': 'ariaPosInSet',\n\t'aria-rowcount': 'ariaRowCount',\n\t'aria-rowindex': 'ariaRowIndex',\n\t'aria-rowspan': 'ariaRowSpan',\n\t'aria-setsize': 'ariaSetSize',\n};\n"]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { AriaErrorMessageElement } from './relationship.js';
|
|
2
|
+
export declare type AriaAutocomplete = 'none' | 'inline' | 'list' | 'booth';
|
|
3
|
+
export declare type AriaChecked = true | false | undefined | 'mixed';
|
|
4
|
+
export declare type AriaDisabled = boolean;
|
|
5
|
+
export declare type AriaExpanded = boolean | undefined;
|
|
6
|
+
export declare type AriaHasPopup = boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
|
|
7
|
+
export declare type AriaHidden = boolean | undefined;
|
|
8
|
+
export declare type AriaInvalid = 'grammar' | 'spelling' | boolean;
|
|
9
|
+
export declare type AriaLabel = string;
|
|
10
|
+
export declare type AriaLevel = number;
|
|
11
|
+
export declare type AriaModal = boolean;
|
|
12
|
+
export declare type AriaMultiline = boolean;
|
|
13
|
+
export declare type AriaMultiSelectable = boolean;
|
|
14
|
+
export declare type AriaOrientation = 'horizontal' | 'vertical';
|
|
15
|
+
export declare type AriaPlaceholder = string;
|
|
16
|
+
export declare type AriaPressed = boolean | 'mixed' | undefined;
|
|
17
|
+
export declare type AriaReadonly = boolean;
|
|
18
|
+
export declare type AriaRequired = boolean;
|
|
19
|
+
export declare type AriaSelected = boolean | undefined;
|
|
20
|
+
export declare type AriaSort = 'ascending' | 'descending' | 'none' | 'other';
|
|
21
|
+
export declare type AriaValueMax = number;
|
|
22
|
+
export declare type AriaValueMin = number;
|
|
23
|
+
export declare type AriaValueNow = number;
|
|
24
|
+
export declare type AriaValueText = string;
|
|
25
|
+
export interface WidgetModel {
|
|
26
|
+
ariaAutocomplete: AriaAutocomplete;
|
|
27
|
+
ariaChecked: AriaChecked;
|
|
28
|
+
ariaDisabled: AriaDisabled;
|
|
29
|
+
ariaErrorMessageElement: AriaErrorMessageElement;
|
|
30
|
+
ariaExpanded: AriaExpanded;
|
|
31
|
+
ariaHasPopup: AriaHasPopup;
|
|
32
|
+
ariaHidden: AriaHidden;
|
|
33
|
+
ariaInvalid: AriaInvalid;
|
|
34
|
+
ariaLabel: AriaLabel;
|
|
35
|
+
ariaLevel: AriaLevel;
|
|
36
|
+
ariaModal: AriaModal;
|
|
37
|
+
ariaMultiline: AriaMultiline;
|
|
38
|
+
ariaMultiSelectable: AriaMultiSelectable;
|
|
39
|
+
ariaOrientation: AriaOrientation;
|
|
40
|
+
ariaPlaceholder: AriaPlaceholder;
|
|
41
|
+
ariaPressed: AriaPressed;
|
|
42
|
+
ariaReadonly: AriaReadonly;
|
|
43
|
+
ariaRequired: AriaRequired;
|
|
44
|
+
ariaSelected: AriaSelected;
|
|
45
|
+
ariaSort: AriaSort;
|
|
46
|
+
ariaValueMax: AriaValueMax;
|
|
47
|
+
ariaValueMin: AriaValueMin;
|
|
48
|
+
ariaValueNow: AriaValueNow;
|
|
49
|
+
ariaValueText: AriaValueText;
|
|
50
|
+
}
|
|
51
|
+
export declare const WidgetAttributes: string[];
|
|
52
|
+
export declare const WidgetAttributesMap: {
|
|
53
|
+
'aria-autocomplete': string;
|
|
54
|
+
'aria-checked': string;
|
|
55
|
+
'aria-disabled': string;
|
|
56
|
+
'aria-errormessage': string;
|
|
57
|
+
'aria-expanded': string;
|
|
58
|
+
'aria-haspopup': string;
|
|
59
|
+
'aria-hidden': string;
|
|
60
|
+
'aria-invalid': string;
|
|
61
|
+
'aria-label': string;
|
|
62
|
+
'aria-level': string;
|
|
63
|
+
'aria-modal': string;
|
|
64
|
+
'aria-multiline': string;
|
|
65
|
+
'aria-multiselectable': string;
|
|
66
|
+
'aria-orientation': string;
|
|
67
|
+
'aria-placeholder': string;
|
|
68
|
+
'aria-pressed': string;
|
|
69
|
+
'aria-readonly': string;
|
|
70
|
+
'aria-required': string;
|
|
71
|
+
'aria-selected': string;
|
|
72
|
+
'aria-sort': string;
|
|
73
|
+
'aria-valuemax': string;
|
|
74
|
+
'aria-valuemin': string;
|
|
75
|
+
'aria-valuenow': string;
|
|
76
|
+
'aria-valuetext': string;
|
|
77
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export const WidgetAttributes = [
|
|
2
|
+
'aria-autocomplete',
|
|
3
|
+
'aria-checked',
|
|
4
|
+
'aria-disabled',
|
|
5
|
+
'aria-errormessage',
|
|
6
|
+
'aria-expanded',
|
|
7
|
+
'aria-haspopup',
|
|
8
|
+
'aria-hidden',
|
|
9
|
+
'aria-invalid',
|
|
10
|
+
'aria-label',
|
|
11
|
+
'aria-level',
|
|
12
|
+
'aria-modal',
|
|
13
|
+
'aria-multiline',
|
|
14
|
+
'aria-multiselectable',
|
|
15
|
+
'aria-orientation',
|
|
16
|
+
'aria-placeholder',
|
|
17
|
+
'aria-pressed',
|
|
18
|
+
'aria-readonly',
|
|
19
|
+
'aria-required',
|
|
20
|
+
'aria-selected',
|
|
21
|
+
'aria-sort',
|
|
22
|
+
'aria-valuemax',
|
|
23
|
+
'aria-valuemin',
|
|
24
|
+
'aria-valuenow',
|
|
25
|
+
'aria-valuetext',
|
|
26
|
+
];
|
|
27
|
+
export const WidgetAttributesMap = {
|
|
28
|
+
'aria-autocomplete': 'ariaAutoComplete',
|
|
29
|
+
'aria-checked': 'ariaChecked',
|
|
30
|
+
'aria-disabled': 'ariaDisabled',
|
|
31
|
+
'aria-errormessage': 'ariaErrorMessageElement',
|
|
32
|
+
'aria-expanded': 'ariaExpanded',
|
|
33
|
+
'aria-haspopup': 'ariaHasPopup',
|
|
34
|
+
'aria-hidden': 'ariaHidden',
|
|
35
|
+
'aria-invalid': 'ariaInvalid',
|
|
36
|
+
'aria-label': 'ariaLabel',
|
|
37
|
+
'aria-level': 'ariaLevel',
|
|
38
|
+
'aria-modal': 'ariaModal',
|
|
39
|
+
'aria-multiline': 'ariaMultiLine',
|
|
40
|
+
'aria-multiselectable': 'ariaMultiSelectable',
|
|
41
|
+
'aria-orientation': 'ariaOrientation',
|
|
42
|
+
'aria-placeholder': 'ariaPlaceholder',
|
|
43
|
+
'aria-pressed': 'ariaPressed',
|
|
44
|
+
'aria-readonly': 'ariaReadOnly',
|
|
45
|
+
'aria-required': 'ariaRequired',
|
|
46
|
+
'aria-selected': 'ariaSelected',
|
|
47
|
+
'aria-sort': 'ariaSort',
|
|
48
|
+
'aria-valuemax': 'ariaValueMax',
|
|
49
|
+
'aria-valuemin': 'ariaValueMin',
|
|
50
|
+
'aria-valuenow': 'ariaValueNow',
|
|
51
|
+
'aria-valuetext': 'ariaValueText',
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget.js","sourceRoot":"","sources":["../../../src/elements/accessibility/widget.ts"],"names":[],"mappings":"AA6EA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC/B,mBAAmB;IACnB,cAAc;IACd,eAAe;IACf,mBAAmB;IACnB,eAAe;IACf,eAAe;IACf,aAAa;IACb,cAAc;IACd,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,gBAAgB;IAChB,sBAAsB;IACtB,kBAAkB;IAClB,kBAAkB;IAClB,cAAc;IACd,eAAe;IACf,eAAe;IACf,eAAe;IACf,WAAW;IACX,eAAe;IACf,eAAe;IACf,eAAe;IACf,gBAAgB;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAClC,mBAAmB,EAAE,kBAAkB;IACvC,cAAc,EAAE,aAAa;IAC7B,eAAe,EAAE,cAAc;IAC/B,mBAAmB,EAAE,yBAAyB;IAC9C,eAAe,EAAE,cAAc;IAC/B,eAAe,EAAE,cAAc;IAC/B,aAAa,EAAE,YAAY;IAC3B,cAAc,EAAE,aAAa;IAC7B,YAAY,EAAE,WAAW;IACzB,YAAY,EAAE,WAAW;IACzB,YAAY,EAAE,WAAW;IACzB,gBAAgB,EAAE,eAAe;IACjC,sBAAsB,EAAE,qBAAqB;IAC7C,kBAAkB,EAAE,iBAAiB;IACrC,kBAAkB,EAAE,iBAAiB;IACrC,cAAc,EAAE,aAAa;IAC7B,eAAe,EAAE,cAAc;IAC/B,eAAe,EAAE,cAAc;IAC/B,eAAe,EAAE,cAAc;IAC/B,WAAW,EAAE,UAAU;IACvB,eAAe,EAAE,cAAc;IAC/B,eAAe,EAAE,cAAc;IAC/B,eAAe,EAAE,cAAc;IAC/B,gBAAgB,EAAE,eAAe;CACjC,CAAC","sourcesContent":["import { AriaErrorMessageElement } from './relationship.js';\n\nexport type AriaAutocomplete = 'none' | 'inline' | 'list' | 'booth';\n\nexport type AriaChecked = true | false | undefined | 'mixed';\n\nexport type AriaDisabled = boolean;\n\nexport type AriaExpanded = boolean | undefined;\n\nexport type AriaHasPopup = boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';\n\nexport type AriaHidden = boolean | undefined;\n\nexport type AriaInvalid = 'grammar' | 'spelling' | boolean;\n\nexport type AriaLabel = string;\n\nexport type AriaLevel = number;\n\nexport type AriaModal = boolean;\n\nexport type AriaMultiline = boolean;\n\nexport type AriaMultiSelectable = boolean;\n\nexport type AriaOrientation = 'horizontal' | 'vertical';\n\nexport type AriaPlaceholder = string;\n\nexport type AriaPressed = boolean | 'mixed' | undefined;\n\nexport type AriaReadonly = boolean;\n\nexport type AriaRequired = boolean;\n\nexport type AriaSelected = boolean | undefined;\n\nexport type AriaSort = 'ascending' | 'descending' | 'none' | 'other';\n\nexport type AriaValueMax = number;\n\nexport type AriaValueMin = number;\n\nexport type AriaValueNow = number;\n\nexport type AriaValueText = string;\n\n\nexport interface WidgetModel {\n\tariaAutocomplete: AriaAutocomplete,\n\tariaChecked: AriaChecked,\n\tariaDisabled: AriaDisabled,\n\tariaErrorMessageElement: AriaErrorMessageElement,\n\tariaExpanded: AriaExpanded,\n\tariaHasPopup: AriaHasPopup,\n\tariaHidden: AriaHidden,\n\tariaInvalid: AriaInvalid,\n\tariaLabel: AriaLabel,\n\tariaLevel: AriaLevel,\n\tariaModal: AriaModal,\n\n\tariaMultiline: AriaMultiline,\n\tariaMultiSelectable: AriaMultiSelectable,\n\tariaOrientation: AriaOrientation,\n\tariaPlaceholder: AriaPlaceholder,\n\tariaPressed: AriaPressed,\n\tariaReadonly: AriaReadonly,\n\tariaRequired: AriaRequired,\n\tariaSelected: AriaSelected,\n\tariaSort: AriaSort,\n\tariaValueMax: AriaValueMax,\n\tariaValueMin: AriaValueMin,\n\tariaValueNow: AriaValueNow,\n\tariaValueText: AriaValueText,\n}\n\nexport const WidgetAttributes = [\n\t'aria-autocomplete',\n\t'aria-checked',\n\t'aria-disabled',\n\t'aria-errormessage',\n\t'aria-expanded',\n\t'aria-haspopup',\n\t'aria-hidden',\n\t'aria-invalid',\n\t'aria-label',\n\t'aria-level',\n\t'aria-modal',\n\t'aria-multiline',\n\t'aria-multiselectable',\n\t'aria-orientation',\n\t'aria-placeholder',\n\t'aria-pressed',\n\t'aria-readonly',\n\t'aria-required',\n\t'aria-selected',\n\t'aria-sort',\n\t'aria-valuemax',\n\t'aria-valuemin',\n\t'aria-valuenow',\n\t'aria-valuetext',\n];\n\nexport const WidgetAttributesMap = {\n\t'aria-autocomplete': 'ariaAutoComplete',\n\t'aria-checked': 'ariaChecked',\n\t'aria-disabled': 'ariaDisabled',\n\t'aria-errormessage': 'ariaErrorMessageElement',\n\t'aria-expanded': 'ariaExpanded',\n\t'aria-haspopup': 'ariaHasPopup',\n\t'aria-hidden': 'ariaHidden',\n\t'aria-invalid': 'ariaInvalid',\n\t'aria-label': 'ariaLabel',\n\t'aria-level': 'ariaLevel',\n\t'aria-modal': 'ariaModal',\n\t'aria-multiline': 'ariaMultiLine',\n\t'aria-multiselectable': 'ariaMultiSelectable',\n\t'aria-orientation': 'ariaOrientation',\n\t'aria-placeholder': 'ariaPlaceholder',\n\t'aria-pressed': 'ariaPressed',\n\t'aria-readonly': 'ariaReadOnly',\n\t'aria-required': 'ariaRequired',\n\t'aria-selected': 'ariaSelected',\n\t'aria-sort': 'ariaSort',\n\t'aria-valuemax': 'ariaValueMax',\n\t'aria-valuemin': 'ariaValueMin',\n\t'aria-valuenow': 'ariaValueNow',\n\t'aria-valuetext': 'ariaValueText',\n};\n"]}
|
package/ast/dom.d.ts
CHANGED
|
@@ -5,13 +5,22 @@ export declare class Attribute<N, V> {
|
|
|
5
5
|
name: N;
|
|
6
6
|
value: V;
|
|
7
7
|
constructor(name: N, value: V);
|
|
8
|
+
toJSON(): this & {
|
|
9
|
+
type: string;
|
|
10
|
+
};
|
|
8
11
|
}
|
|
9
12
|
export declare class ElementAttribute<N, V> extends Attribute<N, V> {
|
|
13
|
+
toJSON(): this & {
|
|
14
|
+
type: string;
|
|
15
|
+
};
|
|
10
16
|
}
|
|
11
17
|
/**
|
|
12
18
|
* an attribute with its source value for binding
|
|
13
19
|
*/
|
|
14
20
|
export declare class LiveAttribute extends Attribute<string, string> {
|
|
21
|
+
toJSON(): this & {
|
|
22
|
+
type: string;
|
|
23
|
+
};
|
|
15
24
|
}
|
|
16
25
|
/**
|
|
17
26
|
*
|
|
@@ -26,11 +35,17 @@ export declare function createLiveAttribute(name: string, value: string): LiveAt
|
|
|
26
35
|
export declare class TextContent extends Attribute<'textContent', string> {
|
|
27
36
|
static propName: 'textContent';
|
|
28
37
|
constructor(text: string);
|
|
38
|
+
toJSON(): this & {
|
|
39
|
+
type: string;
|
|
40
|
+
};
|
|
29
41
|
}
|
|
30
42
|
/**
|
|
31
43
|
* a text that its content is binding to variable from the component model.
|
|
32
44
|
*/
|
|
33
45
|
export declare class LiveTextContent extends TextContent {
|
|
46
|
+
toJSON(): this & {
|
|
47
|
+
type: string;
|
|
48
|
+
};
|
|
34
49
|
}
|
|
35
50
|
export declare function isLiveTextContent(text: object): text is LiveTextContent;
|
|
36
51
|
/**
|
|
@@ -39,6 +54,9 @@ export declare function isLiveTextContent(text: object): text is LiveTextContent
|
|
|
39
54
|
export declare class CommentNode {
|
|
40
55
|
comment: string;
|
|
41
56
|
constructor(comment: string);
|
|
57
|
+
toJSON(): this & {
|
|
58
|
+
type: string;
|
|
59
|
+
};
|
|
42
60
|
}
|
|
43
61
|
export declare class BaseNode {
|
|
44
62
|
/**
|
|
@@ -70,6 +88,9 @@ export declare class BaseNode {
|
|
|
70
88
|
addOutput(eventName: string, handlerSource: string): void;
|
|
71
89
|
addTwoWayBinding(eventName: string, handlerSource: string): void;
|
|
72
90
|
addTemplateAttr(attrName: string, valueSource: string): void;
|
|
91
|
+
toJSON(): this & {
|
|
92
|
+
type: string;
|
|
93
|
+
};
|
|
73
94
|
}
|
|
74
95
|
export declare class DomAttributeDirectiveNode extends BaseNode {
|
|
75
96
|
/**
|
|
@@ -81,6 +102,9 @@ export declare class DomAttributeDirectiveNode extends BaseNode {
|
|
|
81
102
|
*/
|
|
82
103
|
attributeDirectives: undefined;
|
|
83
104
|
constructor(name: string);
|
|
105
|
+
toJSON(): this & {
|
|
106
|
+
type: string;
|
|
107
|
+
};
|
|
84
108
|
}
|
|
85
109
|
export declare class DomParentNode extends BaseNode {
|
|
86
110
|
/**
|
|
@@ -89,12 +113,18 @@ export declare class DomParentNode extends BaseNode {
|
|
|
89
113
|
children?: DomChild[];
|
|
90
114
|
addChild(child: DomChild): void;
|
|
91
115
|
addTextChild(text: string): void;
|
|
116
|
+
toJSON(): this & {
|
|
117
|
+
type: string;
|
|
118
|
+
};
|
|
92
119
|
}
|
|
93
120
|
/**
|
|
94
121
|
* parent for a list of elements
|
|
95
122
|
*/
|
|
96
123
|
export declare class DomFragmentNode extends DomParentNode {
|
|
97
124
|
constructor(children?: DomChild[]);
|
|
125
|
+
toJSON(): this & {
|
|
126
|
+
type: string;
|
|
127
|
+
};
|
|
98
128
|
}
|
|
99
129
|
export declare class DomElementNode extends DomParentNode {
|
|
100
130
|
/**
|
|
@@ -112,6 +142,9 @@ export declare class DomElementNode extends DomParentNode {
|
|
|
112
142
|
constructor(tagName: string, is?: string);
|
|
113
143
|
setTagName(tagName: string): void;
|
|
114
144
|
setTemplateRefName(name: string, value?: string): void;
|
|
145
|
+
toJSON(): this & {
|
|
146
|
+
type: string;
|
|
147
|
+
};
|
|
115
148
|
}
|
|
116
149
|
/**
|
|
117
150
|
* structural directive
|
|
@@ -130,6 +163,9 @@ export declare class DomStructuralDirectiveNode extends BaseNode {
|
|
|
130
163
|
*/
|
|
131
164
|
node: DomNode;
|
|
132
165
|
constructor(name: string, node: DomNode, value?: string);
|
|
166
|
+
toJSON(): this & {
|
|
167
|
+
type: string;
|
|
168
|
+
};
|
|
133
169
|
}
|
|
134
170
|
export declare function isDOMDirectiveNode(node: object): node is DomStructuralDirectiveNode;
|
|
135
171
|
export declare type DomChild = DomElementNode | DomStructuralDirectiveNode | CommentNode | TextContent | LiveTextContent;
|
package/ast/dom.js
CHANGED
|
@@ -6,13 +6,22 @@ export class Attribute {
|
|
|
6
6
|
this.name = name;
|
|
7
7
|
this.value = value;
|
|
8
8
|
}
|
|
9
|
+
toJSON() {
|
|
10
|
+
return Object.assign({}, this, { type: 'Attribute' });
|
|
11
|
+
}
|
|
9
12
|
}
|
|
10
13
|
export class ElementAttribute extends Attribute {
|
|
14
|
+
toJSON() {
|
|
15
|
+
return Object.assign({}, this, { type: 'ElementAttribute' });
|
|
16
|
+
}
|
|
11
17
|
}
|
|
12
18
|
/**
|
|
13
19
|
* an attribute with its source value for binding
|
|
14
20
|
*/
|
|
15
21
|
export class LiveAttribute extends Attribute {
|
|
22
|
+
toJSON() {
|
|
23
|
+
return Object.assign({}, this, { type: 'LiveAttribute' });
|
|
24
|
+
}
|
|
16
25
|
}
|
|
17
26
|
/**
|
|
18
27
|
*
|
|
@@ -30,12 +39,18 @@ export class TextContent extends Attribute {
|
|
|
30
39
|
constructor(text) {
|
|
31
40
|
super(TextContent.propName, text);
|
|
32
41
|
}
|
|
42
|
+
toJSON() {
|
|
43
|
+
return Object.assign({}, this, { type: 'TextContent' });
|
|
44
|
+
}
|
|
33
45
|
}
|
|
34
46
|
TextContent.propName = 'textContent';
|
|
35
47
|
/**
|
|
36
48
|
* a text that its content is binding to variable from the component model.
|
|
37
49
|
*/
|
|
38
50
|
export class LiveTextContent extends TextContent {
|
|
51
|
+
toJSON() {
|
|
52
|
+
return Object.assign({}, this, { type: 'LiveTextContent' });
|
|
53
|
+
}
|
|
39
54
|
}
|
|
40
55
|
export function isLiveTextContent(text) {
|
|
41
56
|
return text instanceof LiveTextContent;
|
|
@@ -47,6 +62,9 @@ export class CommentNode {
|
|
|
47
62
|
constructor(comment) {
|
|
48
63
|
this.comment = comment;
|
|
49
64
|
}
|
|
65
|
+
toJSON() {
|
|
66
|
+
return Object.assign({}, this, { type: 'CommentNode' });
|
|
67
|
+
}
|
|
50
68
|
}
|
|
51
69
|
export class BaseNode {
|
|
52
70
|
addAttribute(attrName, value) {
|
|
@@ -100,12 +118,18 @@ export class BaseNode {
|
|
|
100
118
|
this.templateAttrs = [new LiveAttribute(attrName, valueSource)];
|
|
101
119
|
}
|
|
102
120
|
}
|
|
121
|
+
toJSON() {
|
|
122
|
+
return Object.assign({}, this, { type: 'BaseNode' });
|
|
123
|
+
}
|
|
103
124
|
}
|
|
104
125
|
export class DomAttributeDirectiveNode extends BaseNode {
|
|
105
126
|
constructor(name) {
|
|
106
127
|
super();
|
|
107
128
|
this.name = name;
|
|
108
129
|
}
|
|
130
|
+
toJSON() {
|
|
131
|
+
return Object.assign({}, this, { type: 'DomAttributeDirectiveNode' });
|
|
132
|
+
}
|
|
109
133
|
}
|
|
110
134
|
export class DomParentNode extends BaseNode {
|
|
111
135
|
addChild(child) {
|
|
@@ -120,6 +144,9 @@ export class DomParentNode extends BaseNode {
|
|
|
120
144
|
const children = (this.children ?? (this.children = []));
|
|
121
145
|
parseTextChild(text).forEach(childText => children.push(childText));
|
|
122
146
|
}
|
|
147
|
+
toJSON() {
|
|
148
|
+
return Object.assign({}, this, { type: 'DomParentNode' });
|
|
149
|
+
}
|
|
123
150
|
}
|
|
124
151
|
/**
|
|
125
152
|
* parent for a list of elements
|
|
@@ -131,6 +158,9 @@ export class DomFragmentNode extends DomParentNode {
|
|
|
131
158
|
this.children = children;
|
|
132
159
|
}
|
|
133
160
|
}
|
|
161
|
+
toJSON() {
|
|
162
|
+
return Object.assign({}, this, { type: 'DomFragmentNode' });
|
|
163
|
+
}
|
|
134
164
|
}
|
|
135
165
|
export class DomElementNode extends DomParentNode {
|
|
136
166
|
constructor(tagName, is) {
|
|
@@ -146,6 +176,9 @@ export class DomElementNode extends DomParentNode {
|
|
|
146
176
|
setTemplateRefName(name, value) {
|
|
147
177
|
this.templateRefName = new Attribute(name, value);
|
|
148
178
|
}
|
|
179
|
+
toJSON() {
|
|
180
|
+
return Object.assign({}, this, { type: 'DomElementNode' });
|
|
181
|
+
}
|
|
149
182
|
}
|
|
150
183
|
/**
|
|
151
184
|
* structural directive
|
|
@@ -157,6 +190,9 @@ export class DomStructuralDirectiveNode extends BaseNode {
|
|
|
157
190
|
this.node = node;
|
|
158
191
|
this.value = value;
|
|
159
192
|
}
|
|
193
|
+
toJSON() {
|
|
194
|
+
return Object.assign({}, this, { type: 'DomStructuralDirectiveNode' });
|
|
195
|
+
}
|
|
160
196
|
}
|
|
161
197
|
export function isDOMDirectiveNode(node) {
|
|
162
198
|
return node instanceof DomStructuralDirectiveNode;
|