@zcomponent/html 1.4.2 → 2.0.0-alpha.2

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/lib/button.js CHANGED
@@ -1,11 +1,73 @@
1
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
+ var _, done = false;
7
+ for (var i = decorators.length - 1; i >= 0; i--) {
8
+ var context = {};
9
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
+ if (kind === "accessor") {
14
+ if (result === void 0) continue;
15
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
+ if (_ = accept(result.get)) descriptor.get = _;
17
+ if (_ = accept(result.set)) descriptor.set = _;
18
+ if (_ = accept(result.init)) initializers.unshift(_);
19
+ }
20
+ else if (_ = accept(result)) {
21
+ if (kind === "field") initializers.unshift(_);
22
+ else descriptor[key] = _;
23
+ }
24
+ }
25
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
+ done = true;
27
+ };
28
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
+ var useValue = arguments.length > 2;
30
+ for (var i = 0; i < initializers.length; i++) {
31
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
+ }
33
+ return useValue ? value : void 0;
34
+ };
35
+ import { zComponent } from '@zcomponent/core';
1
36
  import { ZHTMLElement } from './HTMLElement';
2
- /** @zcomponent
37
+ /**
38
+ *
39
+ * A HTML Button component.
40
+ *
41
+ * You can access the underlying HTMLButtonElement using the `element` property.
42
+ * @zcomponent
43
+ * @zicon html
3
44
  * @ztag html/element/button
4
45
  * @zparents html/element/**
5
- * @zicon html
6
46
  */
7
- export class Button extends ZHTMLElement {
8
- constructor(mgr, props) {
9
- super(mgr, props, document.createElement('button'));
10
- }
11
- }
47
+ let Button = (() => {
48
+ let _classDecorators = [zComponent({ tags: ['html/element/button'], parents: ['html/element/**'], icon: 'html' })];
49
+ let _classDescriptor;
50
+ let _classExtraInitializers = [];
51
+ let _classThis;
52
+ let _classSuper = ZHTMLElement;
53
+ var Button = class extends _classSuper {
54
+ static { _classThis = this; }
55
+ static {
56
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
57
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
58
+ Button = _classThis = _classDescriptor.value;
59
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
60
+ __runInitializers(_classThis, _classExtraInitializers);
61
+ }
62
+ /**
63
+ *
64
+ * @param mgr - The context manager
65
+ * @param props - The properties of the button
66
+ */
67
+ constructor(mgr, props) {
68
+ super(mgr, props, document.createElement('button'));
69
+ }
70
+ };
71
+ return Button = _classThis;
72
+ })();
73
+ export { Button };
package/lib/context.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Event, ContextManager, Context } from '@zcomponent/core';
1
+ import { Context, ContextManager, Event } from '@zcomponent/core';
2
2
  export declare class HTMLContext extends Context {
3
3
  onNodeConstructed: Event<[Node]>;
4
4
  onNodeDisposed: Event<[Node]>;
package/lib/context.js CHANGED
@@ -1,11 +1,8 @@
1
- import { Event, Context } from '@zcomponent/core';
1
+ import { Context, Event } from '@zcomponent/core';
2
2
  export class HTMLContext extends Context {
3
- constructor() {
4
- super(...arguments);
5
- this.onNodeConstructed = new Event();
6
- this.onNodeDisposed = new Event();
7
- this.onCSSChanged = new Event();
8
- }
3
+ onNodeConstructed = new Event();
4
+ onNodeDisposed = new Event();
5
+ onCSSChanged = new Event();
9
6
  }
10
7
  export function useOnNodeConstructed(mgr) {
11
8
  return mgr.get(HTMLContext).onNodeConstructed;
package/lib/div.d.ts CHANGED
@@ -1,10 +1,19 @@
1
1
  import { ContextManager } from '@zcomponent/core';
2
2
  import { HTMLElementProps, ZHTMLElement } from './HTMLElement';
3
- /** @zcomponent
3
+ /**
4
+ * A HTML Div component. It can be childed under any HTML element.
5
+ *
6
+ * You can access the underlying HTMLDivElement using the `element` property.
7
+ * @zcomponent
8
+ * @zicon html
4
9
  * @ztag html/element/div
5
10
  * @zparents html/element/**
6
- * @zicon html
7
11
  */
8
12
  export declare class Div extends ZHTMLElement<HTMLDivElement> {
13
+ /**
14
+ * Creates a new Div component.
15
+ * @param mgr - The context manager
16
+ * @param props - The properties of the div
17
+ */
9
18
  constructor(mgr: ContextManager, props: HTMLElementProps);
10
19
  }
package/lib/div.js CHANGED
@@ -1,11 +1,72 @@
1
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
+ var _, done = false;
7
+ for (var i = decorators.length - 1; i >= 0; i--) {
8
+ var context = {};
9
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
+ if (kind === "accessor") {
14
+ if (result === void 0) continue;
15
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
+ if (_ = accept(result.get)) descriptor.get = _;
17
+ if (_ = accept(result.set)) descriptor.set = _;
18
+ if (_ = accept(result.init)) initializers.unshift(_);
19
+ }
20
+ else if (_ = accept(result)) {
21
+ if (kind === "field") initializers.unshift(_);
22
+ else descriptor[key] = _;
23
+ }
24
+ }
25
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
+ done = true;
27
+ };
28
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
+ var useValue = arguments.length > 2;
30
+ for (var i = 0; i < initializers.length; i++) {
31
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
+ }
33
+ return useValue ? value : void 0;
34
+ };
35
+ import { zComponent } from '@zcomponent/core';
1
36
  import { ZHTMLElement } from './HTMLElement';
2
- /** @zcomponent
37
+ /**
38
+ * A HTML Div component. It can be childed under any HTML element.
39
+ *
40
+ * You can access the underlying HTMLDivElement using the `element` property.
41
+ * @zcomponent
42
+ * @zicon html
3
43
  * @ztag html/element/div
4
44
  * @zparents html/element/**
5
- * @zicon html
6
45
  */
7
- export class Div extends ZHTMLElement {
8
- constructor(mgr, props) {
9
- super(mgr, props, document.createElement('div'));
10
- }
11
- }
46
+ let Div = (() => {
47
+ let _classDecorators = [zComponent({ tags: ['html/element/div'], parents: ['html/element/**'], icon: 'html' })];
48
+ let _classDescriptor;
49
+ let _classExtraInitializers = [];
50
+ let _classThis;
51
+ let _classSuper = ZHTMLElement;
52
+ var Div = class extends _classSuper {
53
+ static { _classThis = this; }
54
+ static {
55
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
56
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
57
+ Div = _classThis = _classDescriptor.value;
58
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
59
+ __runInitializers(_classThis, _classExtraInitializers);
60
+ }
61
+ /**
62
+ * Creates a new Div component.
63
+ * @param mgr - The context manager
64
+ * @param props - The properties of the div
65
+ */
66
+ constructor(mgr, props) {
67
+ super(mgr, props, document.createElement('div'));
68
+ }
69
+ };
70
+ return Div = _classThis;
71
+ })();
72
+ export { Div };
package/lib/headings.d.ts CHANGED
@@ -1,55 +1,61 @@
1
1
  import { ContextManager } from '@zcomponent/core';
2
2
  import { HTMLElementProps, ZHTMLElement } from './HTMLElement';
3
- /** @zcomponent
3
+ /**
4
+ * @zcomponent
5
+ * @zicon html
6
+ * @zgroup Heading
4
7
  * @ztag html/element/h1
5
8
  * @zparents html/element/**
6
- * @zgroup Heading
7
- * @zicon html
8
9
  */
9
10
  export declare class H1 extends ZHTMLElement<HTMLHeadingElement> {
10
11
  constructor(mgr: ContextManager, props: HTMLElementProps);
11
12
  }
12
- /** @zcomponent
13
+ /**
14
+ * @zcomponent
15
+ * @zicon html
16
+ * @zgroup Heading
13
17
  * @ztag html/element/h2
14
18
  * @zparents html/element/**
15
- * @zgroup Heading
16
- * @zicon html
17
19
  */
18
20
  export declare class H2 extends ZHTMLElement<HTMLHeadingElement> {
19
21
  constructor(mgr: ContextManager, props: HTMLElementProps);
20
22
  }
21
- /** @zcomponent
22
- * @ztag html/element/h3
23
- * @zparents html/element/**
23
+ /**
24
+ * @zcomponent
24
25
  * @zicon html
25
26
  * @zgroup Heading
27
+ * @ztag html/element/h3
28
+ * @zparents html/element/**
26
29
  */
27
30
  export declare class H3 extends ZHTMLElement<HTMLHeadingElement> {
28
31
  constructor(mgr: ContextManager, props: HTMLElementProps);
29
32
  }
30
- /** @zcomponent
31
- * @ztag html/element/h4
32
- * @zparents html/element/**
33
+ /**
34
+ * @zcomponent
33
35
  * @zicon html
34
36
  * @zgroup Heading
37
+ * @ztag html/element/h4
38
+ * @zparents html/element/**
35
39
  */
36
40
  export declare class H4 extends ZHTMLElement<HTMLHeadingElement> {
37
41
  constructor(mgr: ContextManager, props: HTMLElementProps);
38
42
  }
39
- /** @zcomponent
40
- * @ztag html/element/h5
41
- * @zparents html/element/**
43
+ /**
44
+ * @zcomponent
42
45
  * @zicon html
43
46
  * @zgroup Heading
47
+ * @ztag html/element/h5
48
+ * @zparents html/element/**
44
49
  */
45
50
  export declare class H5 extends ZHTMLElement<HTMLHeadingElement> {
46
51
  constructor(mgr: ContextManager, props: HTMLElementProps);
47
52
  }
48
- /** @zcomponent
49
- * @ztag html/element/h6
50
- * @zparents html/element/**
53
+ /**
54
+ * @zcomponent
51
55
  * @zicon html
52
56
  * @zgroup Heading
57
+ * @ztag html/element/h6
58
+ * @zparents html/element/**
53
59
  */
54
60
  export declare class H6 extends ZHTMLElement<HTMLHeadingElement> {
55
61
  constructor(mgr: ContextManager, props: HTMLElementProps);
package/lib/headings.js CHANGED
@@ -1,67 +1,215 @@
1
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
+ var _, done = false;
7
+ for (var i = decorators.length - 1; i >= 0; i--) {
8
+ var context = {};
9
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
+ if (kind === "accessor") {
14
+ if (result === void 0) continue;
15
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
+ if (_ = accept(result.get)) descriptor.get = _;
17
+ if (_ = accept(result.set)) descriptor.set = _;
18
+ if (_ = accept(result.init)) initializers.unshift(_);
19
+ }
20
+ else if (_ = accept(result)) {
21
+ if (kind === "field") initializers.unshift(_);
22
+ else descriptor[key] = _;
23
+ }
24
+ }
25
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
+ done = true;
27
+ };
28
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
+ var useValue = arguments.length > 2;
30
+ for (var i = 0; i < initializers.length; i++) {
31
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
+ }
33
+ return useValue ? value : void 0;
34
+ };
35
+ import { zComponent } from '@zcomponent/core';
1
36
  import { ZHTMLElement } from './HTMLElement';
2
- /** @zcomponent
37
+ const common = {
38
+ parents: ['html/element/**'],
39
+ icon: 'html',
40
+ group: 'Heading',
41
+ };
42
+ /**
43
+ * @zcomponent
44
+ * @zicon html
45
+ * @zgroup Heading
3
46
  * @ztag html/element/h1
4
47
  * @zparents html/element/**
5
- * @zgroup Heading
6
- * @zicon html
7
48
  */
8
- export class H1 extends ZHTMLElement {
9
- constructor(mgr, props) {
10
- super(mgr, props, document.createElement('h1'));
11
- }
12
- }
13
- /** @zcomponent
49
+ let H1 = (() => {
50
+ let _classDecorators = [zComponent({ tags: ['html/element/h1'], ...common })];
51
+ let _classDescriptor;
52
+ let _classExtraInitializers = [];
53
+ let _classThis;
54
+ let _classSuper = ZHTMLElement;
55
+ var H1 = class extends _classSuper {
56
+ static { _classThis = this; }
57
+ static {
58
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
59
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
60
+ H1 = _classThis = _classDescriptor.value;
61
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
62
+ __runInitializers(_classThis, _classExtraInitializers);
63
+ }
64
+ constructor(mgr, props) {
65
+ super(mgr, props, document.createElement('h1'));
66
+ }
67
+ };
68
+ return H1 = _classThis;
69
+ })();
70
+ export { H1 };
71
+ /**
72
+ * @zcomponent
73
+ * @zicon html
74
+ * @zgroup Heading
14
75
  * @ztag html/element/h2
15
76
  * @zparents html/element/**
16
- * @zgroup Heading
17
- * @zicon html
18
77
  */
19
- export class H2 extends ZHTMLElement {
20
- constructor(mgr, props) {
21
- super(mgr, props, document.createElement('h2'));
22
- }
23
- }
24
- /** @zcomponent
78
+ let H2 = (() => {
79
+ let _classDecorators = [zComponent({ tags: ['html/element/h2'], ...common })];
80
+ let _classDescriptor;
81
+ let _classExtraInitializers = [];
82
+ let _classThis;
83
+ let _classSuper = ZHTMLElement;
84
+ var H2 = class extends _classSuper {
85
+ static { _classThis = this; }
86
+ static {
87
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
88
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
89
+ H2 = _classThis = _classDescriptor.value;
90
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
91
+ __runInitializers(_classThis, _classExtraInitializers);
92
+ }
93
+ constructor(mgr, props) {
94
+ super(mgr, props, document.createElement('h2'));
95
+ }
96
+ };
97
+ return H2 = _classThis;
98
+ })();
99
+ export { H2 };
100
+ /**
101
+ * @zcomponent
102
+ * @zicon html
103
+ * @zgroup Heading
25
104
  * @ztag html/element/h3
26
105
  * @zparents html/element/**
106
+ */
107
+ let H3 = (() => {
108
+ let _classDecorators = [zComponent({ tags: ['html/element/h3'], ...common })];
109
+ let _classDescriptor;
110
+ let _classExtraInitializers = [];
111
+ let _classThis;
112
+ let _classSuper = ZHTMLElement;
113
+ var H3 = class extends _classSuper {
114
+ static { _classThis = this; }
115
+ static {
116
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
117
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
118
+ H3 = _classThis = _classDescriptor.value;
119
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
120
+ __runInitializers(_classThis, _classExtraInitializers);
121
+ }
122
+ constructor(mgr, props) {
123
+ super(mgr, props, document.createElement('h3'));
124
+ }
125
+ };
126
+ return H3 = _classThis;
127
+ })();
128
+ export { H3 };
129
+ /**
130
+ * @zcomponent
27
131
  * @zicon html
28
132
  * @zgroup Heading
29
- */
30
- export class H3 extends ZHTMLElement {
31
- constructor(mgr, props) {
32
- super(mgr, props, document.createElement('h3'));
33
- }
34
- }
35
- /** @zcomponent
36
133
  * @ztag html/element/h4
37
134
  * @zparents html/element/**
135
+ */
136
+ let H4 = (() => {
137
+ let _classDecorators = [zComponent({ tags: ['html/element/h4'], ...common })];
138
+ let _classDescriptor;
139
+ let _classExtraInitializers = [];
140
+ let _classThis;
141
+ let _classSuper = ZHTMLElement;
142
+ var H4 = class extends _classSuper {
143
+ static { _classThis = this; }
144
+ static {
145
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
146
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
147
+ H4 = _classThis = _classDescriptor.value;
148
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
149
+ __runInitializers(_classThis, _classExtraInitializers);
150
+ }
151
+ constructor(mgr, props) {
152
+ super(mgr, props, document.createElement('h4'));
153
+ }
154
+ };
155
+ return H4 = _classThis;
156
+ })();
157
+ export { H4 };
158
+ /**
159
+ * @zcomponent
38
160
  * @zicon html
39
161
  * @zgroup Heading
40
- */
41
- export class H4 extends ZHTMLElement {
42
- constructor(mgr, props) {
43
- super(mgr, props, document.createElement('h4'));
44
- }
45
- }
46
- /** @zcomponent
47
162
  * @ztag html/element/h5
48
163
  * @zparents html/element/**
164
+ */
165
+ let H5 = (() => {
166
+ let _classDecorators = [zComponent({ tags: ['html/element/h5'], ...common })];
167
+ let _classDescriptor;
168
+ let _classExtraInitializers = [];
169
+ let _classThis;
170
+ let _classSuper = ZHTMLElement;
171
+ var H5 = class extends _classSuper {
172
+ static { _classThis = this; }
173
+ static {
174
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
175
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
176
+ H5 = _classThis = _classDescriptor.value;
177
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
178
+ __runInitializers(_classThis, _classExtraInitializers);
179
+ }
180
+ constructor(mgr, props) {
181
+ super(mgr, props, document.createElement('h5'));
182
+ }
183
+ };
184
+ return H5 = _classThis;
185
+ })();
186
+ export { H5 };
187
+ /**
188
+ * @zcomponent
49
189
  * @zicon html
50
190
  * @zgroup Heading
51
- */
52
- export class H5 extends ZHTMLElement {
53
- constructor(mgr, props) {
54
- super(mgr, props, document.createElement('h5'));
55
- }
56
- }
57
- /** @zcomponent
58
191
  * @ztag html/element/h6
59
192
  * @zparents html/element/**
60
- * @zicon html
61
- * @zgroup Heading
62
193
  */
63
- export class H6 extends ZHTMLElement {
64
- constructor(mgr, props) {
65
- super(mgr, props, document.createElement('h6'));
66
- }
67
- }
194
+ let H6 = (() => {
195
+ let _classDecorators = [zComponent({ tags: ['html/element/h6'], ...common })];
196
+ let _classDescriptor;
197
+ let _classExtraInitializers = [];
198
+ let _classThis;
199
+ let _classSuper = ZHTMLElement;
200
+ var H6 = class extends _classSuper {
201
+ static { _classThis = this; }
202
+ static {
203
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
204
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
205
+ H6 = _classThis = _classDescriptor.value;
206
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
207
+ __runInitializers(_classThis, _classExtraInitializers);
208
+ }
209
+ constructor(mgr, props) {
210
+ super(mgr, props, document.createElement('h6'));
211
+ }
212
+ };
213
+ return H6 = _classThis;
214
+ })();
215
+ export { H6 };
package/lib/i.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import { ContextManager } from '@zcomponent/core';
2
2
  import { HTMLElementProps, ZHTMLElement } from './HTMLElement';
3
- /** @zcomponent
3
+ /**
4
+ * @zcomponent
5
+ * @zicon html
4
6
  * @ztag html/element/i
5
7
  * @zparents html/element/**
6
- * @zicon html
7
8
  */
8
9
  export declare class I extends ZHTMLElement<HTMLElement> {
9
10
  constructor(mgr: ContextManager, props: HTMLElementProps);
package/lib/i.js CHANGED
@@ -1,11 +1,64 @@
1
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
+ var _, done = false;
7
+ for (var i = decorators.length - 1; i >= 0; i--) {
8
+ var context = {};
9
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
+ if (kind === "accessor") {
14
+ if (result === void 0) continue;
15
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
+ if (_ = accept(result.get)) descriptor.get = _;
17
+ if (_ = accept(result.set)) descriptor.set = _;
18
+ if (_ = accept(result.init)) initializers.unshift(_);
19
+ }
20
+ else if (_ = accept(result)) {
21
+ if (kind === "field") initializers.unshift(_);
22
+ else descriptor[key] = _;
23
+ }
24
+ }
25
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
+ done = true;
27
+ };
28
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
+ var useValue = arguments.length > 2;
30
+ for (var i = 0; i < initializers.length; i++) {
31
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
+ }
33
+ return useValue ? value : void 0;
34
+ };
35
+ import { zComponent } from '@zcomponent/core';
1
36
  import { ZHTMLElement } from './HTMLElement';
2
- /** @zcomponent
37
+ /**
38
+ * @zcomponent
39
+ * @zicon html
3
40
  * @ztag html/element/i
4
41
  * @zparents html/element/**
5
- * @zicon html
6
42
  */
7
- export class I extends ZHTMLElement {
8
- constructor(mgr, props) {
9
- super(mgr, props, document.createElement('i'));
10
- }
11
- }
43
+ let I = (() => {
44
+ let _classDecorators = [zComponent({ tags: ['html/element/i'], parents: ['html/element/**'], icon: 'html' })];
45
+ let _classDescriptor;
46
+ let _classExtraInitializers = [];
47
+ let _classThis;
48
+ let _classSuper = ZHTMLElement;
49
+ var I = class extends _classSuper {
50
+ static { _classThis = this; }
51
+ static {
52
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
53
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
54
+ I = _classThis = _classDescriptor.value;
55
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
56
+ __runInitializers(_classThis, _classExtraInitializers);
57
+ }
58
+ constructor(mgr, props) {
59
+ super(mgr, props, document.createElement('i'));
60
+ }
61
+ };
62
+ return I = _classThis;
63
+ })();
64
+ export { I };
package/lib/img.d.ts CHANGED
@@ -1,18 +1,18 @@
1
- import { ContextManager } from '@zcomponent/core';
1
+ import { ContextManager, ProjectFile } from '@zcomponent/core';
2
2
  import { HTMLElementProps, ZHTMLElement } from './HTMLElement';
3
3
  export interface ImgConstructorProps extends HTMLElementProps {
4
- /** @zprop
5
- * @zvalues files *.jpg
6
- * @zvalues files *.jpeg
7
- * @zvalues files *.png
4
+ /**
8
5
  */
9
- src: string;
6
+ src: ProjectFile<'*.jpg' | '*.jpeg' | '*.png'>;
10
7
  }
11
- /** @zcomponent
12
- * @ztag html/element/img
8
+ /**
9
+ * @zcomponent
13
10
  * @zicon html
11
+ * @ztag html/element/img
14
12
  * @zparents html/element/**
15
13
  */
16
14
  export declare class Img extends ZHTMLElement<HTMLImageElement> {
15
+ private _src;
17
16
  constructor(mgr: ContextManager, props: ImgConstructorProps);
17
+ private _load;
18
18
  }