@zcomponent/html 0.0.2 → 0.0.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/lib/CSS.d.ts CHANGED
@@ -4,6 +4,11 @@ interface CSSConstructorProps {
4
4
  * @zvalues files *.css
5
5
  */
6
6
  source: string;
7
+ /**
8
+ * @zprop
9
+ * @zdefault true
10
+ */
11
+ includeAtDesignTime: boolean;
7
12
  }
8
13
  /**
9
14
  * The CSS component will ensure that the CSS file referenced by its `source` constructor prop is added to your page and loaded by the browser.
package/lib/CSS.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Component, registerLoadable } from '@zcomponent/core';
1
+ import { Component, isDesignTime, registerLoadable } from '@zcomponent/core';
2
2
  const alreadyAdded = new Map();
3
3
  /**
4
4
  * The CSS component will ensure that the CSS file referenced by its `source` constructor prop is added to your page and loaded by the browser.
@@ -12,7 +12,7 @@ export class CSS extends Component {
12
12
  constructor(contextManager, constructorProps) {
13
13
  super(contextManager, constructorProps);
14
14
  this.constructorProps = constructorProps;
15
- if (!constructorProps.source)
15
+ if (!constructorProps.source || (constructorProps.includeAtDesignTime === false && isDesignTime(contextManager)))
16
16
  return;
17
17
  this._elm = alreadyAdded.get(constructorProps.source);
18
18
  if (this._elm)
@@ -120,7 +120,7 @@ export class ZHTMLElement extends Component {
120
120
  const handler = (e) => {
121
121
  evt.emit(e);
122
122
  };
123
- evt.hasBindings.withValue(b => {
123
+ evt.hasListeners.addListener(b => {
124
124
  if (b)
125
125
  this.element.addEventListener(evtName, handler);
126
126
  else
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zcomponent/html",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "author": "Zappar Limited",
19
19
  "license": "Proprietary",
20
20
  "dependencies": {
21
- "@zcomponent/core": "~0.0.9"
21
+ "@zcomponent/core": "~0.0.15"
22
22
  },
23
23
  "devDependencies": {
24
24
  "typescript": "^4.9.4"