jmx-runtime 0.0.30 → 0.0.32
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/base.d.ts +6 -6
- package/dist/index.js +183 -182
- package/dist/index.js.map +1 -1
- package/dist/jmx.d.ts.map +1 -1
- package/jmx.ts +2 -1
- package/package.json +1 -1
- package/rollup.config.js +1 -1
- package/dist/base.ts +0 -27
- package/dist/h.ts +0 -89
- package/dist/index.ts +0 -5
- package/dist/jmx.ts +0 -186
- package/dist/jsx.ts +0 -748
- package/dist/lib.ts +0 -29
package/dist/lib.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Props, IClassComponent, H, FComponentT, Children } from 'h'
|
|
2
|
-
import { updateview } from './jmx'
|
|
3
|
-
|
|
4
|
-
export type DeepReadonly<T> = { readonly [K in keyof T]: T[K] extends Record<string, unknown> ? DeepReadonly<T[K]> : T[K]; }
|
|
5
|
-
|
|
6
|
-
export const When = ({ cond }: { cond: boolean }, cn: Children) => cond ? { cn } : void 0;
|
|
7
|
-
|
|
8
|
-
export abstract class JMXComp<P extends Props = {}> implements IClassComponent {
|
|
9
|
-
|
|
10
|
-
// assigned by jmx framework
|
|
11
|
-
element!: HTMLElement
|
|
12
|
-
|
|
13
|
-
// we provide this ctor for jsx which uses ctor arguments as properties of class components.
|
|
14
|
-
// at runtime, we pass the props directly
|
|
15
|
-
constructor(public props: P) { }
|
|
16
|
-
|
|
17
|
-
// overrides
|
|
18
|
-
mounted() { }
|
|
19
|
-
update(uc?: IUpdateContext): boolean | void { }
|
|
20
|
-
abstract view(): H
|
|
21
|
-
|
|
22
|
-
// utility: updates the component's view
|
|
23
|
-
updateview() { updateview(this.element) }
|
|
24
|
-
get ismounted():boolean { return this.element as any }
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function cc(...namesOrObjects: (string | any)[]): string {
|
|
28
|
-
return namesOrObjects.flatMap(n => (n.trim ? n : Object.keys(n).filter(k => n[k]))).join(' ') // n.trim distinguishes strings from objects
|
|
29
|
-
}
|