@neovici/cosmoz-utils 5.15.0 → 5.16.1

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.
@@ -4,12 +4,12 @@ declare class PortalDirective extends AsyncDirective {
4
4
  _op?: ChildPart;
5
5
  _outlet?: HTMLElement;
6
6
  _content?: Part;
7
- render(): import("lit-html").TemplateResult<1>;
8
- update(part: Part, [content, outlet]: [Part, HTMLElement]): import("lit-html").TemplateResult<1>;
7
+ render(content: Part, outlet?: HTMLElement): import("lit-html").TemplateResult<1>;
8
+ update(part: Part, [content, outlet]: [Part, HTMLElement?]): import("lit-html").TemplateResult<1>;
9
9
  updateOutlet(outlet: HTMLElement, content: Part): void;
10
10
  clearOutlet(): void;
11
11
  disconnected(): void;
12
12
  reconnected(): void;
13
13
  }
14
- export declare const portal: () => import("lit-html/directive").DirectiveResult<typeof PortalDirective>;
14
+ export declare const portal: (content: Part, outlet?: HTMLElement | undefined) => import("lit-html/directive").DirectiveResult<typeof PortalDirective>;
15
15
  export {};
@@ -17,7 +17,8 @@ class PortalDirective extends AsyncDirective {
17
17
  _op;
18
18
  _outlet;
19
19
  _content;
20
- render() {
20
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
21
+ render(content, outlet = document.body) {
21
22
  return html `<disconnect-observer
22
23
  .onDisconnect=${() => {
23
24
  this.isConnected = false;
@@ -27,7 +28,7 @@ class PortalDirective extends AsyncDirective {
27
28
  }
28
29
  update(part, [content, outlet = document.body]) {
29
30
  this.updateOutlet(outlet, content);
30
- return this.render();
31
+ return this.render(content, outlet);
31
32
  }
32
33
  updateOutlet(outlet, content) {
33
34
  if (this._outlet !== outlet) {
@@ -2,8 +2,8 @@ import { AttributePart } from 'lit-html';
2
2
  import { Directive } from 'lit-html/directive.js';
3
3
  declare class SpreadPropsDirective<T extends object> extends Directive {
4
4
  _props?: T;
5
- render(): symbol;
5
+ render(props: T): symbol;
6
6
  update(part: AttributePart, [props]: [T]): symbol;
7
7
  }
8
- export declare const spreadProps: () => import("lit-html/directive.js").DirectiveResult<typeof SpreadPropsDirective>;
8
+ export declare const spreadProps: (props: object) => import("lit-html/directive.js").DirectiveResult<typeof SpreadPropsDirective>;
9
9
  export {};
@@ -9,7 +9,8 @@ const undefs = (prev, obj) => {
9
9
  };
10
10
  class SpreadPropsDirective extends Directive {
11
11
  _props;
12
- render() {
12
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
13
+ render(props) {
13
14
  return noChange;
14
15
  }
15
16
  update(part, [props]) {
@@ -1,2 +1,2 @@
1
- declare const notifyProperty: <K extends string, T extends HTMLElement & { [key in K]?: unknown; }>(host: T, name: K, value: T[K]) => void, useNotifyProperty: <T extends HTMLElement, K extends Extract<keyof T, string>, V extends T[K]>(name: K, value: V) => void;
1
+ declare const notifyProperty: <K extends string, T extends HTMLElement & { [key in K]?: unknown; }>(host: T, name: K, value: T[K]) => void, useNotifyProperty: <T extends HTMLElement, K extends Extract<keyof T, string>, V extends T[K]>(name: K, value: V, deps?: unknown[]) => void;
2
2
  export { notifyProperty, useNotifyProperty };
@@ -10,10 +10,10 @@ notifyProperty = (host, name, value) => {
10
10
  host.dispatchEvent(new CustomEvent(name.replace(UPPER, '-$1').toLowerCase() + '-changed', {
11
11
  detail: { value },
12
12
  }));
13
- }, useNotifyProperty = (name, value) => {
13
+ }, useNotifyProperty = (name, value, deps = [value]) => {
14
14
  const host = useHost();
15
15
  useEffect(() => {
16
16
  notifyProperty(host, name, value);
17
- }, [value]);
17
+ }, deps);
18
18
  };
19
19
  export { notifyProperty, useNotifyProperty };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-utils",
3
- "version": "5.15.0",
3
+ "version": "5.16.1",
4
4
  "description": "Date, money and template management functions commonly needed in Cosmoz views.",
5
5
  "keywords": [
6
6
  "polymer",