@zcomponent/html 2.0.0-alpha.2 → 2.0.0-alpha.4
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/CSS.d.ts +3 -0
- package/lib/CSS.js +16 -9
- package/lib/HTMLElement.d.ts +11 -0
- package/lib/HTMLElement.js +26 -8
- package/lib/img.d.ts +1 -1
- package/package.json +73 -73
package/lib/CSS.d.ts
CHANGED
|
@@ -20,6 +20,9 @@ export declare class CSS extends Component {
|
|
|
20
20
|
protected constructorProps: CSSConstructorProps;
|
|
21
21
|
private _elm;
|
|
22
22
|
constructor(contextManager: ContextManager, constructorProps: CSSConstructorProps);
|
|
23
|
+
/**
|
|
24
|
+
* @zignore
|
|
25
|
+
*/
|
|
23
26
|
dispose(): never;
|
|
24
27
|
}
|
|
25
28
|
export {};
|
package/lib/CSS.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
2
|
+
var useValue = arguments.length > 2;
|
|
3
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
4
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
5
|
+
}
|
|
6
|
+
return useValue ? value : void 0;
|
|
7
|
+
};
|
|
1
8
|
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
9
|
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
10
|
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
@@ -25,14 +32,7 @@ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn,
|
|
|
25
32
|
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
33
|
done = true;
|
|
27
34
|
};
|
|
28
|
-
|
|
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 { Component, isDesignTime, registerLoadable, zComponent } from '@zcomponent/core';
|
|
35
|
+
import { Component, isDesignTime, registerLoadable, zComponent, zIgnore } from '@zcomponent/core';
|
|
36
36
|
import { HTMLContext } from './context';
|
|
37
37
|
const alreadyAdded = new Map();
|
|
38
38
|
/**
|
|
@@ -48,16 +48,20 @@ let CSS = (() => {
|
|
|
48
48
|
let _classExtraInitializers = [];
|
|
49
49
|
let _classThis;
|
|
50
50
|
let _classSuper = Component;
|
|
51
|
+
let _instanceExtraInitializers = [];
|
|
52
|
+
let _dispose_decorators;
|
|
51
53
|
var CSS = class extends _classSuper {
|
|
52
54
|
static { _classThis = this; }
|
|
53
55
|
static {
|
|
54
56
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
57
|
+
_dispose_decorators = [zIgnore()];
|
|
58
|
+
__esDecorate(this, null, _dispose_decorators, { kind: "method", name: "dispose", static: false, private: false, access: { has: obj => "dispose" in obj, get: obj => obj.dispose }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
55
59
|
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
56
60
|
CSS = _classThis = _classDescriptor.value;
|
|
57
61
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
58
62
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
59
63
|
}
|
|
60
|
-
constructorProps;
|
|
64
|
+
constructorProps = __runInitializers(this, _instanceExtraInitializers);
|
|
61
65
|
_elm;
|
|
62
66
|
constructor(contextManager, constructorProps) {
|
|
63
67
|
super(contextManager, constructorProps);
|
|
@@ -85,6 +89,9 @@ let CSS = (() => {
|
|
|
85
89
|
alreadyAdded.set(constructorProps.source, this._elm);
|
|
86
90
|
}
|
|
87
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* @zignore
|
|
94
|
+
*/
|
|
88
95
|
dispose() {
|
|
89
96
|
if (this._elm) {
|
|
90
97
|
this._elm[0] = this._elm[0] - 1;
|
package/lib/HTMLElement.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ export interface HTMLElementProps extends ConstructorProps {
|
|
|
6
6
|
innerText?: string;
|
|
7
7
|
}
|
|
8
8
|
export declare class ZHTMLElement<T extends HTMLElement> extends Component {
|
|
9
|
+
/**
|
|
10
|
+
* @zui
|
|
11
|
+
*/
|
|
9
12
|
onClick: Event<[MouseEvent]>;
|
|
10
13
|
/**
|
|
11
14
|
* The inner text of the element.
|
|
@@ -25,14 +28,19 @@ export declare class ZHTMLElement<T extends HTMLElement> extends Component {
|
|
|
25
28
|
* @param element - The element to wrap
|
|
26
29
|
*/
|
|
27
30
|
constructor(contextManager: ContextManager, props: HTMLElementProps, element: T);
|
|
31
|
+
/**
|
|
32
|
+
* @zignore
|
|
33
|
+
*/
|
|
28
34
|
connectElements(): void;
|
|
29
35
|
private _attachEvent;
|
|
30
36
|
/**
|
|
31
37
|
* @default ""
|
|
38
|
+
* @zui
|
|
32
39
|
*/
|
|
33
40
|
id: string;
|
|
34
41
|
/**
|
|
35
42
|
* @default []
|
|
43
|
+
* @zui
|
|
36
44
|
*/
|
|
37
45
|
classList: string[];
|
|
38
46
|
/**
|
|
@@ -178,6 +186,9 @@ export declare class ZHTMLElement<T extends HTMLElement> extends Component {
|
|
|
178
186
|
* @zgroup Display
|
|
179
187
|
*/
|
|
180
188
|
flexDirection: CSSFlexDirectionValue;
|
|
189
|
+
/**
|
|
190
|
+
* @zignore
|
|
191
|
+
*/
|
|
181
192
|
dispose(): never;
|
|
182
193
|
}
|
|
183
194
|
export declare const CSSLengthUnit: {
|
package/lib/HTMLElement.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
2
|
+
var useValue = arguments.length > 2;
|
|
3
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
4
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
5
|
+
}
|
|
6
|
+
return useValue ? value : void 0;
|
|
7
|
+
};
|
|
1
8
|
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
9
|
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
10
|
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
@@ -25,17 +32,11 @@ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn,
|
|
|
25
32
|
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
33
|
done = true;
|
|
27
34
|
};
|
|
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
35
|
import { Component, Event, zIgnore, zObserve, zUI } from '@zcomponent/core';
|
|
36
36
|
import { useOnNodeConstructed, useOnNodeDisposed } from './context';
|
|
37
37
|
let ZHTMLElement = (() => {
|
|
38
38
|
let _classSuper = Component;
|
|
39
|
+
let _instanceExtraInitializers = [];
|
|
39
40
|
let _onClick_decorators;
|
|
40
41
|
let _onClick_initializers = [];
|
|
41
42
|
let _onClick_extraInitializers = [];
|
|
@@ -45,6 +46,7 @@ let ZHTMLElement = (() => {
|
|
|
45
46
|
let _element_decorators;
|
|
46
47
|
let _element_initializers = [];
|
|
47
48
|
let _element_extraInitializers = [];
|
|
49
|
+
let _connectElements_decorators;
|
|
48
50
|
let _id_decorators;
|
|
49
51
|
let _id_initializers = [];
|
|
50
52
|
let _id_extraInitializers = [];
|
|
@@ -102,6 +104,7 @@ let ZHTMLElement = (() => {
|
|
|
102
104
|
let _flexDirection_decorators;
|
|
103
105
|
let _flexDirection_initializers = [];
|
|
104
106
|
let _flexDirection_extraInitializers = [];
|
|
107
|
+
let _dispose_decorators;
|
|
105
108
|
return class ZHTMLElement extends _classSuper {
|
|
106
109
|
static {
|
|
107
110
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
@@ -110,6 +113,7 @@ let ZHTMLElement = (() => {
|
|
|
110
113
|
instance.element.innerText = v;
|
|
111
114
|
})];
|
|
112
115
|
_element_decorators = [zIgnore()];
|
|
116
|
+
_connectElements_decorators = [zIgnore()];
|
|
113
117
|
_id_decorators = [zObserve((val, instance) => {
|
|
114
118
|
instance.element.id = val;
|
|
115
119
|
}), zUI()];
|
|
@@ -167,6 +171,9 @@ let ZHTMLElement = (() => {
|
|
|
167
171
|
_flexDirection_decorators = [zObserve((val, instance) => {
|
|
168
172
|
instance.element.style.flexDirection = val;
|
|
169
173
|
}), zUI({ group: 'Display' })];
|
|
174
|
+
_dispose_decorators = [zIgnore()];
|
|
175
|
+
__esDecorate(this, null, _connectElements_decorators, { kind: "method", name: "connectElements", static: false, private: false, access: { has: obj => "connectElements" in obj, get: obj => obj.connectElements }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
176
|
+
__esDecorate(this, null, _dispose_decorators, { kind: "method", name: "dispose", static: false, private: false, access: { has: obj => "dispose" in obj, get: obj => obj.dispose }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
170
177
|
__esDecorate(null, null, _onClick_decorators, { kind: "field", name: "onClick", static: false, private: false, access: { has: obj => "onClick" in obj, get: obj => obj.onClick, set: (obj, value) => { obj.onClick = value; } }, metadata: _metadata }, _onClick_initializers, _onClick_extraInitializers);
|
|
171
178
|
__esDecorate(null, null, _innerText_decorators, { kind: "field", name: "innerText", static: false, private: false, access: { has: obj => "innerText" in obj, get: obj => obj.innerText, set: (obj, value) => { obj.innerText = value; } }, metadata: _metadata }, _innerText_initializers, _innerText_extraInitializers);
|
|
172
179
|
__esDecorate(null, null, _element_decorators, { kind: "field", name: "element", static: false, private: false, access: { has: obj => "element" in obj, get: obj => obj.element, set: (obj, value) => { obj.element = value; } }, metadata: _metadata }, _element_initializers, _element_extraInitializers);
|
|
@@ -191,7 +198,10 @@ let ZHTMLElement = (() => {
|
|
|
191
198
|
__esDecorate(null, null, _flexDirection_decorators, { kind: "field", name: "flexDirection", static: false, private: false, access: { has: obj => "flexDirection" in obj, get: obj => obj.flexDirection, set: (obj, value) => { obj.flexDirection = value; } }, metadata: _metadata }, _flexDirection_initializers, _flexDirection_extraInitializers);
|
|
192
199
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
193
200
|
}
|
|
194
|
-
|
|
201
|
+
/**
|
|
202
|
+
* @zui
|
|
203
|
+
*/
|
|
204
|
+
onClick = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _onClick_initializers, new Event()));
|
|
195
205
|
/**
|
|
196
206
|
* The inner text of the element.
|
|
197
207
|
* @default ""
|
|
@@ -222,6 +232,9 @@ let ZHTMLElement = (() => {
|
|
|
222
232
|
this._attachEvent(this.onClick, 'click');
|
|
223
233
|
useOnNodeConstructed(contextManager).emit(this.element);
|
|
224
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* @zignore
|
|
237
|
+
*/
|
|
225
238
|
connectElements() {
|
|
226
239
|
let parent = this.parent;
|
|
227
240
|
while (parent) {
|
|
@@ -254,10 +267,12 @@ let ZHTMLElement = (() => {
|
|
|
254
267
|
}
|
|
255
268
|
/**
|
|
256
269
|
* @default ""
|
|
270
|
+
* @zui
|
|
257
271
|
*/
|
|
258
272
|
id = (__runInitializers(this, _element_extraInitializers), __runInitializers(this, _id_initializers, ''));
|
|
259
273
|
/**
|
|
260
274
|
* @default []
|
|
275
|
+
* @zui
|
|
261
276
|
*/
|
|
262
277
|
classList = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _classList_initializers, []));
|
|
263
278
|
/**
|
|
@@ -361,6 +376,9 @@ let ZHTMLElement = (() => {
|
|
|
361
376
|
* @zgroup Display
|
|
362
377
|
*/
|
|
363
378
|
flexDirection = (__runInitializers(this, _display_extraInitializers), __runInitializers(this, _flexDirection_initializers, CSSFlexDirection.row));
|
|
379
|
+
/**
|
|
380
|
+
* @zignore
|
|
381
|
+
*/
|
|
364
382
|
dispose() {
|
|
365
383
|
useOnNodeDisposed(this.contextManager).emit(this.element);
|
|
366
384
|
return super.dispose();
|
package/lib/img.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { HTMLElementProps, ZHTMLElement } from './HTMLElement';
|
|
|
3
3
|
export interface ImgConstructorProps extends HTMLElementProps {
|
|
4
4
|
/**
|
|
5
5
|
*/
|
|
6
|
-
src: ProjectFile<'*.jpg' | '*.jpeg' | '*.png'>;
|
|
6
|
+
src: ProjectFile<'*.jpg' | '*.jpeg' | '*.png' | '*.svg'>;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* @zcomponent
|
package/package.json
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
2
|
+
"name": "@zcomponent/html",
|
|
3
|
+
"version": "2.0.0-alpha.4",
|
|
4
|
+
"description": "Mattercraft support for HTML",
|
|
5
|
+
"author": "Zappar Limited",
|
|
6
|
+
"license": "Proprietary",
|
|
7
|
+
"main": "index.js",
|
|
8
|
+
"types": "index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"development": "./src/index.ts",
|
|
12
|
+
"types": "./index.d.ts",
|
|
13
|
+
"default": "./index.js"
|
|
14
|
+
},
|
|
15
|
+
"./*": {
|
|
16
|
+
"development": "./src/*.ts",
|
|
17
|
+
"types": "./lib/*.d.ts",
|
|
18
|
+
"default": "./lib/*.js"
|
|
19
|
+
},
|
|
20
|
+
"./lib/*": {
|
|
21
|
+
"development": "./src/*.ts",
|
|
22
|
+
"types": "./lib/*.d.ts",
|
|
23
|
+
"default": "./lib/*.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"zexports": [
|
|
27
|
+
"./lib/**/*"
|
|
28
|
+
],
|
|
29
|
+
"directories": {
|
|
30
|
+
"lib": "lib"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"index.js",
|
|
34
|
+
"index.d.ts",
|
|
35
|
+
"lib/**/*",
|
|
36
|
+
"public/**/*"
|
|
37
|
+
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "rm -rf lib && tspc && tsc-alias",
|
|
40
|
+
"watch": "tsc -w",
|
|
41
|
+
"docs": "typedoc --out docs",
|
|
42
|
+
"predocs": "npm run ctix",
|
|
43
|
+
"ctix": "ctix build"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"@zcomponent/core": "*"
|
|
47
|
+
},
|
|
48
|
+
"keywords": [],
|
|
49
|
+
"release": {
|
|
50
|
+
"extends": "semantic-release-commit-filter",
|
|
51
|
+
"ci": true,
|
|
52
|
+
"branches": [
|
|
53
|
+
"main",
|
|
54
|
+
{
|
|
55
|
+
"name": "beta",
|
|
56
|
+
"channel": "beta",
|
|
57
|
+
"prerelease": "beta"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "alpha",
|
|
61
|
+
"channel": "alpha",
|
|
62
|
+
"prerelease": "alpha"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"plugins": [
|
|
66
|
+
"@semantic-release/commit-analyzer",
|
|
67
|
+
"@semantic-release/release-notes-generator",
|
|
68
|
+
"@semantic-release/changelog",
|
|
69
|
+
"@semantic-release/npm",
|
|
70
|
+
"@semantic-release/gitlab",
|
|
71
|
+
"@semantic-release/git"
|
|
72
|
+
],
|
|
73
|
+
"tagFormat": "@zcomponent/html@${version}"
|
|
74
|
+
}
|
|
75
75
|
}
|