@rhtml/component 0.0.134 → 0.0.136
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/README.md +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +4 -4
package/README.md
CHANGED
|
@@ -14,12 +14,12 @@ class CounterService {
|
|
|
14
14
|
|
|
15
15
|
const Providers = DefineDependencies(CounterService)(Container);
|
|
16
16
|
|
|
17
|
-
@Component
|
|
17
|
+
@Component({
|
|
18
18
|
Settings: {
|
|
19
19
|
selector: 'counter-component'
|
|
20
20
|
},
|
|
21
21
|
Providers,
|
|
22
|
-
State: function(this, [counterService]) {
|
|
22
|
+
State: function(this: CounterComponent, [counterService]) {
|
|
23
23
|
return interval(1000).pipe(
|
|
24
24
|
map(value => ({ counter: this.counter + counterService.counter + value }))
|
|
25
25
|
);
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export type RenderResult<S, D, K extends LitElement> = (deps: D) => (this: K, st
|
|
|
17
17
|
export interface Options extends Without<CustomElementConfig<never>, 'template'> {
|
|
18
18
|
deepCloneState?: boolean;
|
|
19
19
|
}
|
|
20
|
-
export declare const Partial: <S, D, K extends LitElement = LitElement>(options: Options) => (deps?: D) => (state?: StateToRender<S, D, K>) => (loading
|
|
20
|
+
export declare const Partial: <S, D, K extends LitElement = LitElement>(options: Options) => (deps?: D) => (state?: StateToRender<S, D, K>) => (loading?: () => PossibleRender) => (error?: (e: Error | unknown) => PossibleRender) => (render?: RenderResult<S, D, K>) => <K_1 extends new (...args: any[]) => {}>(Base: K_1) => {
|
|
21
21
|
new (...args: any[]): {
|
|
22
22
|
getTemplateResult(): any;
|
|
23
23
|
OnInit(): any;
|
package/dist/index.js
CHANGED
|
@@ -12,13 +12,13 @@ const DefineDependencies = (...deps) => (injection) => {
|
|
|
12
12
|
return deps;
|
|
13
13
|
};
|
|
14
14
|
exports.DefineDependencies = DefineDependencies;
|
|
15
|
-
const Partial = (options) => (deps = []) => (state = () => ({})) => (loading) => (error) => (render = () => state) => (0, lit_html_1.Component)(Object.assign(Object.assign({}, options), { template() {
|
|
15
|
+
const Partial = (options) => (deps = []) => (state = () => ({})) => (loading = () => null) => (error = () => null) => (render = () => state) => (0, lit_html_1.Component)(Object.assign(Object.assign({}, options), { template() {
|
|
16
16
|
return (0, lit_html_1.html) `
|
|
17
17
|
<r-renderer
|
|
18
18
|
.options=${{
|
|
19
19
|
state: state.bind(this).call(this, deps),
|
|
20
|
-
loading,
|
|
21
|
-
error,
|
|
20
|
+
loading: loading.bind(this),
|
|
21
|
+
error: error.bind(this),
|
|
22
22
|
deepCloneState: options.deepCloneState,
|
|
23
23
|
render: (state, setState, shadowRoot) => {
|
|
24
24
|
this.shadowRoot.append(shadowRoot);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,2BAAyB;AAEzB,6CAMwB;AAiBjB,MAAM,kBAAkB,GAC7B,CAA0B,GAAG,IAAO,EAAE,EAAE,CACxC,CAAC,SAAoB,EAAoB,EAAE;IACzC,KAAK,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;QAC1C,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE;YACjC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,IAAI,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;SACxE,CAAC,CAAC;IACL,CAAC;IACD,OAAO,IAAa,CAAC;AACvB,CAAC,CAAC;AATS,QAAA,kBAAkB,sBAS3B;AAsBG,MAAM,OAAO,GAClB,CAA0C,OAAgB,EAA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IAAI,CAAC;YACxC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YAC3B,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;YACvB,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,MAAM,EAAE,CACN,KAAQ,EACR,QAAwB,EACxB,UAAsB,EACtB,EAAE;gBACF,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;gBACnC,OAAO,MAAM,CAAC,IAAI,CAAC;qBAChB,IAAI,CAAC,IAAI,CAAC;qBACV,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;YAC7C,CAAC;SACO;;SAEb,CAAC;IACJ,CAAC,IACD,CAAC;AA/BM,QAAA,OAAO,WA+Bb;AAEP,SAAgB,SAAS,CAA0C,EACjE,QAAQ,EACR,SAAS,EACT,KAAK,EACL,MAAM,EACN,OAAO,EACP,KAAK,GAQN;IACC,OAAO,IAAA,eAAO,EAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC;AACrE,CAAC;AAhBD,8BAgBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rhtml/component",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.136",
|
|
4
4
|
"description": "Reactive HyperText Markup Language",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "npx parcel ./examples/index.html --out-dir build/examples",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@rxdi/lit-html": "^0.7.178",
|
|
21
|
-
"@rhtml/renderer": "0.0.
|
|
21
|
+
"@rhtml/renderer": "0.0.136"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"rxjs": "^7.8.0"
|
package/src/index.ts
CHANGED
|
@@ -58,8 +58,8 @@ export const Partial =
|
|
|
58
58
|
<S, D, K extends LitElement = LitElement>(options: Options) =>
|
|
59
59
|
(deps: D = [] as never) =>
|
|
60
60
|
(state: StateToRender<S, D, K> = () => ({} as never)) =>
|
|
61
|
-
(loading: () => PossibleRender) =>
|
|
62
|
-
(error: (e: Error | unknown) => PossibleRender) =>
|
|
61
|
+
(loading: () => PossibleRender = () => null) =>
|
|
62
|
+
(error: (e: Error | unknown) => PossibleRender = () => null) =>
|
|
63
63
|
(render: RenderResult<S, D, K> = () => state as never) =>
|
|
64
64
|
OriginalComponent<K>({
|
|
65
65
|
...options,
|
|
@@ -68,8 +68,8 @@ export const Partial =
|
|
|
68
68
|
<r-renderer
|
|
69
69
|
.options=${{
|
|
70
70
|
state: state.bind(this).call(this, deps),
|
|
71
|
-
loading,
|
|
72
|
-
error,
|
|
71
|
+
loading: loading.bind(this),
|
|
72
|
+
error: error.bind(this),
|
|
73
73
|
deepCloneState: options.deepCloneState,
|
|
74
74
|
render: (
|
|
75
75
|
state: S,
|