wrec 0.20.2 → 0.20.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/dist/wrec.d.ts +72 -41
- package/dist/wrec.es.js +529 -681
- package/dist/wrec.umd.js +4 -4
- package/package.json +5 -4
package/dist/wrec.d.ts
CHANGED
|
@@ -1,41 +1,72 @@
|
|
|
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
|
-
static
|
|
27
|
-
static
|
|
28
|
-
static
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
export declare type ChangeListener = {
|
|
2
|
+
changed: (statePath: string, componentProperty: string, newValue: unknown, oldValue: unknown, state: WrecState) => void;
|
|
3
|
+
};
|
|
4
|
+
|
|
5
|
+
export declare function createElement(name: string, attributes: Record<string, string>, innerHTML: string): HTMLElement;
|
|
6
|
+
|
|
7
|
+
export declare function css(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
8
|
+
|
|
9
|
+
export declare function getPathValue(obj: LooseObject_2, path: string): any;
|
|
10
|
+
|
|
11
|
+
export declare function html(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
12
|
+
|
|
13
|
+
declare type LooseObject = Record<string, unknown>;
|
|
14
|
+
|
|
15
|
+
declare type LooseObject_2 = Record<string, unknown>;
|
|
16
|
+
|
|
17
|
+
export declare function setPathValue(obj: LooseObject_2, path: string, value: unknown): void;
|
|
18
|
+
|
|
19
|
+
export declare abstract class Wrec extends HTMLElement implements ChangeListener {
|
|
20
|
+
#private;
|
|
21
|
+
static attrToPropMap: Map<string, string>;
|
|
22
|
+
static propToAttrMap: Map<string, string>;
|
|
23
|
+
static css: string;
|
|
24
|
+
static elementName: string;
|
|
25
|
+
static formAssociated: boolean;
|
|
26
|
+
static html: string;
|
|
27
|
+
static properties: Record<string, any>;
|
|
28
|
+
static propToComputedMap: Map<string, string[][]>;
|
|
29
|
+
static propToExprsMap: Map<string, string[]>;
|
|
30
|
+
static template: HTMLTemplateElement | null;
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
static define(elementName: string): void;
|
|
33
|
+
constructor();
|
|
34
|
+
attributeChangedCallback(attrName: string, oldValue: string, newValue: string | number | boolean | undefined): void;
|
|
35
|
+
changed(_statePath: string, componentProp: string, newValue: unknown): void;
|
|
36
|
+
connectedCallback(): void;
|
|
37
|
+
disconnectedCallback(): void;
|
|
38
|
+
dispatch(name: string, detail: any): void;
|
|
39
|
+
displayIfSet(value: any, display?: string): string;
|
|
40
|
+
formAssociatedCallback(): void;
|
|
41
|
+
formResetCallback(): void;
|
|
42
|
+
static getAttrName(propName: string): string;
|
|
43
|
+
static getPropName(attrName: string): string;
|
|
44
|
+
static get observedAttributes(): string[];
|
|
45
|
+
propertyChangedCallback(_propName: string, _oldValue: unknown, _newValue: unknown): void;
|
|
46
|
+
setAttributeSafe(name: string, value: string): void;
|
|
47
|
+
setFormValue(propName: string, value: string): void;
|
|
48
|
+
/**
|
|
49
|
+
* @param state - WrecState object
|
|
50
|
+
* @param map - object whose keys are state properties and
|
|
51
|
+
* whose values are component properties
|
|
52
|
+
*/
|
|
53
|
+
useState(state: WrecState, map?: Record<string, string>): void;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export declare class WrecState {
|
|
57
|
+
#private;
|
|
58
|
+
static get(name: string): WrecState | undefined;
|
|
59
|
+
[key: string]: unknown;
|
|
60
|
+
constructor(name: string, persist: boolean, initial?: LooseObject);
|
|
61
|
+
/**
|
|
62
|
+
* @param listener - object that has a "changed" method
|
|
63
|
+
* @param map - map from state property paths to component properties
|
|
64
|
+
*/
|
|
65
|
+
addListener(listener: ChangeListener, map?: Record<string, string>): void;
|
|
66
|
+
addProperty(propName: string, initialValue: unknown): void;
|
|
67
|
+
get id(): symbol;
|
|
68
|
+
log(): void;
|
|
69
|
+
removeListener(listener: ChangeListener): void;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { }
|