tweak-ui 0.4.3 → 0.8.0
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/LICENSE +7 -7
- package/README.md +32 -32
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/lib/builder.d.ts +102 -162
- package/dist/lib/builder.d.ts.map +1 -1
- package/dist/lib/color/adapter.d.ts +7 -0
- package/dist/lib/color/adapter.d.ts.map +1 -0
- package/dist/lib/color/array-format.d.ts +9 -0
- package/dist/lib/color/array-format.d.ts.map +1 -0
- package/dist/lib/{color-formats → color}/converter.d.ts +18 -18
- package/dist/lib/color/converter.d.ts.map +1 -0
- package/dist/lib/color/css-string-format.d.ts +8 -0
- package/dist/lib/color/css-string-format.d.ts.map +1 -0
- package/dist/lib/color/formatter.d.ts +9 -0
- package/dist/lib/color/formatter.d.ts.map +1 -0
- package/dist/lib/color/hex-string-format.d.ts +9 -0
- package/dist/lib/color/hex-string-format.d.ts.map +1 -0
- package/dist/lib/{color-formats → color}/index.d.ts +3 -3
- package/dist/lib/color/index.d.ts.map +1 -0
- package/dist/lib/color/number-format.d.ts +9 -0
- package/dist/lib/color/number-format.d.ts.map +1 -0
- package/dist/lib/{color-formats → color}/object-format.d.ts +14 -14
- package/dist/lib/color/object-format.d.ts.map +1 -0
- package/dist/lib/{color-formats → color}/types.d.ts +107 -101
- package/dist/lib/color/types.d.ts.map +1 -0
- package/dist/lib/components/container/bar.d.ts +28 -0
- package/dist/lib/components/container/bar.d.ts.map +1 -0
- package/dist/lib/components/container/dialog.d.ts +14 -0
- package/dist/lib/components/container/dialog.d.ts.map +1 -0
- package/dist/lib/components/container/grid.d.ts +22 -0
- package/dist/lib/components/container/grid.d.ts.map +1 -0
- package/dist/lib/components/container/group.d.ts +55 -0
- package/dist/lib/components/container/group.d.ts.map +1 -0
- package/dist/lib/components/container/index.d.ts +10 -0
- package/dist/lib/components/container/index.d.ts.map +1 -0
- package/dist/lib/components/container/list.d.ts +25 -0
- package/dist/lib/components/container/list.d.ts.map +1 -0
- package/dist/lib/components/container/section.d.ts +28 -0
- package/dist/lib/components/container/section.d.ts.map +1 -0
- package/dist/lib/components/container/split.d.ts +40 -0
- package/dist/lib/components/container/split.d.ts.map +1 -0
- package/dist/lib/components/container/tabs.d.ts +23 -0
- package/dist/lib/components/container/tabs.d.ts.map +1 -0
- package/dist/lib/components/container/tree.d.ts +25 -0
- package/dist/lib/components/container/tree.d.ts.map +1 -0
- package/dist/lib/components/controls/angle.d.ts +47 -51
- package/dist/lib/components/controls/angle.d.ts.map +1 -1
- package/dist/lib/components/controls/bitmask.d.ts +41 -0
- package/dist/lib/components/controls/bitmask.d.ts.map +1 -0
- package/dist/lib/components/controls/bool.d.ts +52 -0
- package/dist/lib/components/controls/bool.d.ts.map +1 -0
- package/dist/lib/components/controls/color-picker.d.ts +41 -56
- package/dist/lib/components/controls/color-picker.d.ts.map +1 -1
- package/dist/lib/components/controls/color.d.ts +37 -51
- package/dist/lib/components/controls/color.d.ts.map +1 -1
- package/dist/lib/components/controls/index.d.ts +14 -10
- package/dist/lib/components/controls/index.d.ts.map +1 -1
- package/dist/lib/components/controls/input.d.ts +44 -0
- package/dist/lib/components/controls/input.d.ts.map +1 -0
- package/dist/lib/components/controls/matrix.d.ts +58 -0
- package/dist/lib/components/controls/matrix.d.ts.map +1 -0
- package/dist/lib/components/controls/point.d.ts +41 -47
- package/dist/lib/components/controls/point.d.ts.map +1 -1
- package/dist/lib/components/controls/poll.d.ts +12 -0
- package/dist/lib/components/controls/poll.d.ts.map +1 -0
- package/dist/lib/components/controls/scalar.d.ts +67 -0
- package/dist/lib/components/controls/scalar.d.ts.map +1 -0
- package/dist/lib/components/controls/select.d.ts +53 -59
- package/dist/lib/components/controls/select.d.ts.map +1 -1
- package/dist/lib/components/controls/spherical.d.ts +37 -74
- package/dist/lib/components/controls/spherical.d.ts.map +1 -1
- package/dist/lib/components/controls/string.d.ts +46 -0
- package/dist/lib/components/controls/string.d.ts.map +1 -0
- package/dist/lib/components/controls/vector.d.ts +54 -0
- package/dist/lib/components/controls/vector.d.ts.map +1 -0
- package/dist/lib/components/elements/button.d.ts +36 -0
- package/dist/lib/components/elements/button.d.ts.map +1 -0
- package/dist/lib/components/elements/divider.d.ts +4 -0
- package/dist/lib/components/elements/divider.d.ts.map +1 -0
- package/dist/lib/components/elements/graph.d.ts +8 -0
- package/dist/lib/components/elements/graph.d.ts.map +1 -0
- package/dist/lib/components/elements/image.d.ts +33 -0
- package/dist/lib/components/elements/image.d.ts.map +1 -0
- package/dist/lib/components/elements/index.d.ts +6 -0
- package/dist/lib/components/elements/index.d.ts.map +1 -0
- package/dist/lib/components/elements/widget.d.ts +27 -0
- package/dist/lib/components/elements/widget.d.ts.map +1 -0
- package/dist/lib/components/index.d.ts +3 -5
- package/dist/lib/components/index.d.ts.map +1 -1
- package/dist/lib/core/control.d.ts +20 -0
- package/dist/lib/core/control.d.ts.map +1 -0
- package/dist/lib/core/index.d.ts +3 -4
- package/dist/lib/core/index.d.ts.map +1 -1
- package/dist/lib/core/render.d.ts +7 -9
- package/dist/lib/core/render.d.ts.map +1 -1
- package/dist/lib/core/types.d.ts +73 -87
- package/dist/lib/core/types.d.ts.map +1 -1
- package/dist/lib/core/utils.d.ts +78 -93
- package/dist/lib/core/utils.d.ts.map +1 -1
- package/dist/lib/index.d.ts +21 -27
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/mount.d.ts +35 -45
- package/dist/lib/mount.d.ts.map +1 -1
- package/dist/lib/stats/index.d.ts +2 -0
- package/dist/lib/stats/index.d.ts.map +1 -0
- package/dist/lib/stats/sampler.d.ts +66 -0
- package/dist/lib/stats/sampler.d.ts.map +1 -0
- package/dist/lib/stats/stats-renderer.d.ts +16 -0
- package/dist/lib/stats/stats-renderer.d.ts.map +1 -0
- package/dist/style.css +1 -0
- package/dist/style.d.ts +4 -0
- package/dist/tweak-ui.module.js +2938 -2393
- package/dist/tweak-ui.module.js.map +1 -1
- package/dist/tweak-ui.umd.js +33 -4420
- package/dist/tweak-ui.umd.js.map +1 -1
- package/package.json +37 -51
- package/dist/index.html +0 -1063
- package/dist/lib/color-formats/array-format.d.ts +0 -9
- package/dist/lib/color-formats/array-format.d.ts.map +0 -1
- package/dist/lib/color-formats/array-format.spec.d.ts +0 -2
- package/dist/lib/color-formats/array-format.spec.d.ts.map +0 -1
- package/dist/lib/color-formats/converter.d.ts.map +0 -1
- package/dist/lib/color-formats/converter.spec.d.ts +0 -2
- package/dist/lib/color-formats/converter.spec.d.ts.map +0 -1
- package/dist/lib/color-formats/css-string-format.d.ts +0 -8
- package/dist/lib/color-formats/css-string-format.d.ts.map +0 -1
- package/dist/lib/color-formats/css-string-format.spec.d.ts +0 -2
- package/dist/lib/color-formats/css-string-format.spec.d.ts.map +0 -1
- package/dist/lib/color-formats/formatter.d.ts +0 -9
- package/dist/lib/color-formats/formatter.d.ts.map +0 -1
- package/dist/lib/color-formats/formatter.spec.d.ts +0 -2
- package/dist/lib/color-formats/formatter.spec.d.ts.map +0 -1
- package/dist/lib/color-formats/hex-string-format.d.ts +0 -8
- package/dist/lib/color-formats/hex-string-format.d.ts.map +0 -1
- package/dist/lib/color-formats/hex-string-format.spec.d.ts +0 -2
- package/dist/lib/color-formats/hex-string-format.spec.d.ts.map +0 -1
- package/dist/lib/color-formats/index.d.ts.map +0 -1
- package/dist/lib/color-formats/number-format.d.ts +0 -9
- package/dist/lib/color-formats/number-format.d.ts.map +0 -1
- package/dist/lib/color-formats/number-format.spec.d.ts +0 -2
- package/dist/lib/color-formats/number-format.spec.d.ts.map +0 -1
- package/dist/lib/color-formats/object-format.d.ts.map +0 -1
- package/dist/lib/color-formats/object-format.spec.d.ts +0 -2
- package/dist/lib/color-formats/object-format.spec.d.ts.map +0 -1
- package/dist/lib/color-formats/types.d.ts.map +0 -1
- package/dist/lib/components/button.d.ts +0 -29
- package/dist/lib/components/button.d.ts.map +0 -1
- package/dist/lib/components/content.d.ts +0 -22
- package/dist/lib/components/content.d.ts.map +0 -1
- package/dist/lib/components/controls/checkbox.d.ts +0 -29
- package/dist/lib/components/controls/checkbox.d.ts.map +0 -1
- package/dist/lib/components/controls/number.d.ts +0 -48
- package/dist/lib/components/controls/number.d.ts.map +0 -1
- package/dist/lib/components/controls/position.d.ts +0 -56
- package/dist/lib/components/controls/position.d.ts.map +0 -1
- package/dist/lib/components/controls/text.d.ts +0 -36
- package/dist/lib/components/controls/text.d.ts.map +0 -1
- package/dist/lib/components/groups/accordion.d.ts +0 -22
- package/dist/lib/components/groups/accordion.d.ts.map +0 -1
- package/dist/lib/components/groups/container.d.ts +0 -25
- package/dist/lib/components/groups/container.d.ts.map +0 -1
- package/dist/lib/components/groups/group.d.ts +0 -49
- package/dist/lib/components/groups/group.d.ts.map +0 -1
- package/dist/lib/components/groups/index.d.ts +0 -5
- package/dist/lib/components/groups/index.d.ts.map +0 -1
- package/dist/lib/components/groups/tabs.d.ts +0 -22
- package/dist/lib/components/groups/tabs.d.ts.map +0 -1
- package/dist/lib/components/image.d.ts +0 -37
- package/dist/lib/components/image.d.ts.map +0 -1
- package/dist/lib/core/registry.d.ts +0 -18
- package/dist/lib/core/registry.d.ts.map +0 -1
- package/dist/lib/core/value-accessor.d.ts +0 -18
- package/dist/lib/core/value-accessor.d.ts.map +0 -1
- package/dist/scss/_style.scss +0 -120
- package/dist/scss/_themes.scss +0 -23
- package/dist/scss/_utils.scss +0 -24
- package/dist/scss/_variables.scss +0 -30
- package/dist/scss/controls/_angle.scss +0 -64
- package/dist/scss/controls/_button.scss +0 -0
- package/dist/scss/controls/_checkbox.scss +0 -19
- package/dist/scss/controls/_color-picker.scss +0 -124
- package/dist/scss/controls/_color.scss +0 -14
- package/dist/scss/controls/_container.scss +0 -13
- package/dist/scss/controls/_group.scss +0 -69
- package/dist/scss/controls/_image.scss +0 -27
- package/dist/scss/controls/_number.scss +0 -38
- package/dist/scss/controls/_point.scss +0 -36
- package/dist/scss/controls/_position.scss +0 -9
- package/dist/scss/controls/_select.scss +0 -0
- package/dist/scss/controls/_spherical.scss +0 -87
- package/dist/scss/controls/_tabs.scss +0 -38
- package/dist/scss/controls/_text.scss +0 -0
- package/dist/scss/index.scss +0 -21
- package/dist/tweak-ui.css +0 -653
- package/dist/tweak-ui.css.map +0 -1
- package/dist/tweak-ui.min.css +0 -1
- package/dist/tweak-ui.min.css.map +0 -1
- package/dist/tweak-ui.umd.min.js +0 -17
- package/dist/tweak-ui.umd.min.js.map +0 -1
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*/
|
|
9
|
-
export declare function renderModel<T extends ComponentModel>(model: T): m.Vnode<import("./types").ComponentAttrs<any>, m.ClassComponent<import("./types").ComponentAttrs<any>>>;
|
|
1
|
+
import { default as m, ChildArrayOrPrimitive, Children, FactoryComponent, Vnode } from 'mithril';
|
|
2
|
+
import { ComponentChildren } from './types';
|
|
3
|
+
export declare function isVnode(child: Children): child is Vnode;
|
|
4
|
+
export declare function mapChildren(nodes: ChildArrayOrPrimitive | undefined, fn: (child: Vnode, index: number, all: Children[]) => Children): m.Children;
|
|
5
|
+
export declare function renderChildren(children: ComponentChildren): Children;
|
|
6
|
+
export type LabeledFn<T> = ((opts: T) => Vnode<T> | null) & ((label: string, opts: Omit<T, 'label'>) => Vnode<T> | null);
|
|
7
|
+
export declare function labeledFn<T>(component: FactoryComponent<T>): LabeledFn<T>;
|
|
10
8
|
//# sourceMappingURL=render.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/lib/core/render.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/lib/core/render.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,EAAE,EAAE,qBAAqB,EAAE,QAAQ,EAAE,gBA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-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
* @remarks
|
|
75
|
-
* Requires the `target` option to be set.
|
|
76
|
-
*/
|
|
77
|
-
property?: keyof T;
|
|
78
|
-
/**
|
|
79
|
-
* If `target` and `property` are not set, then this is used as the control value
|
|
80
|
-
*/
|
|
81
|
-
value?: V | I;
|
|
82
|
-
codec?: ValueCodec<I, V>;
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* @public
|
|
86
|
-
*/
|
|
87
|
-
export declare type ArrayOrSingleOf<T> = T | T[];
|
|
1
|
+
import { Children, ClassComponent, FactoryComponent } from 'mithril';
|
|
2
|
+
export type EventAttrs = Partial<GlobalEventHandlers>;
|
|
3
|
+
export type StyleAttr = Partial<CSSStyleDeclaration> & {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* A UI component, which can be either a Mithril factory component or a Mithril class component.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export type Component<Attr extends Object> = FactoryComponent<Attr> | ClassComponent<Attr>;
|
|
12
|
+
/**
|
|
13
|
+
* A descriptor for a component, which includes the component itself, its attributes, and optionally its children.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export type ComponentDescriptor<Attr extends Object> = {
|
|
18
|
+
component: Component<Attr> | string;
|
|
19
|
+
attributes: Attr;
|
|
20
|
+
children?: ComponentChildren;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
export type ComponentChildren = ComponentSchema | Children | (() => Children);
|
|
26
|
+
/**
|
|
27
|
+
* A schema for a set of components, which is an array of component descriptors.
|
|
28
|
+
*
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export type ComponentSchema = Array<ComponentDescriptor<any>>;
|
|
32
|
+
export declare function binding<T>(target: T, field: keyof T): ValueBinding<T, T[keyof T]>;
|
|
33
|
+
/**
|
|
34
|
+
* A get/set pair that encapsulates access to a value without exposing the source object.
|
|
35
|
+
*
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
export type ValueBinding<M, T> = {
|
|
39
|
+
get: (model: M, field?: keyof M) => T;
|
|
40
|
+
set?: (value: T, model: M, field?: keyof M) => void;
|
|
41
|
+
};
|
|
42
|
+
export type TweakableAttrs<T, Value = unknown> = {
|
|
43
|
+
/**
|
|
44
|
+
* The target object being tweaked.
|
|
45
|
+
*/
|
|
46
|
+
value: T;
|
|
47
|
+
/**
|
|
48
|
+
* The property on `value` to read from and write to
|
|
49
|
+
*/
|
|
50
|
+
field?: keyof T;
|
|
51
|
+
/**
|
|
52
|
+
* The custom binding controller
|
|
53
|
+
*/
|
|
54
|
+
binding?: ValueBinding<T, Value>;
|
|
55
|
+
/**
|
|
56
|
+
* An optional adapter to convert between the raw value and the control value.
|
|
57
|
+
*/
|
|
58
|
+
adapter?: ControlAdapter<any, Value>;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Converts between the raw stored value and the value the control operates on.
|
|
62
|
+
* Use when the control's internal representation differs from the source data format
|
|
63
|
+
* e.g. radians stored, degrees displayed; or a packed integer unpacked into a vector.
|
|
64
|
+
*
|
|
65
|
+
* @public
|
|
66
|
+
*/
|
|
67
|
+
export type ControlAdapter<RawValue, ControlValue> = {
|
|
68
|
+
toControl: (value: RawValue) => ControlValue;
|
|
69
|
+
fromControl: (value: ControlValue) => RawValue;
|
|
70
|
+
};
|
|
71
|
+
export type OmitIn<A, Keys extends keyof A> = {
|
|
72
|
+
[P in keyof A as P extends Keys ? never : P]: A[P];
|
|
73
|
+
};
|
|
88
74
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAEzE,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;AAErD,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,mBAAmB,CAAC,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAA;AAE7E;;;;GAIG;AACH,MAAM,MAAM,SAAS,CAAC,IAAI,SAAS,MAAM,IAAI,gBAAgB,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,CAAA;AAE1F;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,CAAC,IAAI,SAAS,MAAM,IAAI;IACrD,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,MAAM,CAAA;IACnC,UAAU,EAAE,IAAI,CAAA;IAChB,QAAQ,CAAC,EAAE,iBAAiB,CAAA;CAC7B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,eAAe,GAAG,QAAQ,GAAG,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AAI,CAAC,SAAS,IAAI,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACnD,CAAA"}
|
package/dist/lib/core/utils.d.ts
CHANGED
|
@@ -1,94 +1,79 @@
|
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
export
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
export declare function
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
* @
|
|
46
|
-
*/
|
|
47
|
-
export declare function
|
|
48
|
-
/**
|
|
49
|
-
*
|
|
50
|
-
* @
|
|
51
|
-
*/
|
|
52
|
-
export declare function
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
*/
|
|
80
|
-
export declare function viewFn<T extends ComponentModel>(fn: (data: T, node: Vnode<ComponentAttrs<T>>) => Children): (node: Vnode<ComponentAttrs<T>>) => Children;
|
|
81
|
-
export declare function dataFn<T extends ComponentModel, R>(node: Vnode<ComponentAttrs<T>>, fn: (data: T, node: Vnode<ComponentAttrs<T>>) => R): () => R;
|
|
82
|
-
export declare function dragUtil({ onStart, onMove, onEnd, }: {
|
|
83
|
-
onStart?: (e: MouseEvent) => void;
|
|
84
|
-
onMove?: (e: MouseEvent) => void;
|
|
85
|
-
onEnd?: (e: MouseEvent) => void;
|
|
86
|
-
}): {
|
|
87
|
-
target: HTMLElement;
|
|
88
|
-
activate: (e: MouseEvent) => void;
|
|
89
|
-
deactivate: () => void;
|
|
90
|
-
onStart: (e: MouseEvent) => void;
|
|
91
|
-
onMove: (e: MouseEvent) => void;
|
|
92
|
-
onEnd: (e: MouseEvent) => void;
|
|
93
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Checks if value is a string
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare function isString(v: any): v is string;
|
|
6
|
+
/**
|
|
7
|
+
* Checks if value is a number
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function isNumber(v: any): v is number;
|
|
11
|
+
/**
|
|
12
|
+
* Checks if value is a function
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function isFunction(v: any): v is (...args: any[]) => any;
|
|
16
|
+
/**
|
|
17
|
+
* Checks if value is an array
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export declare function isArray(v: any): v is any[];
|
|
21
|
+
/**
|
|
22
|
+
* Checks if value is an object
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export declare function isObject(v: any): v is object;
|
|
26
|
+
/**
|
|
27
|
+
* Calls a function if it is not null
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export declare function call<T extends (...args: any) => any>(cb: T | null | undefined, ...args: Parameters<T>): any;
|
|
31
|
+
/**
|
|
32
|
+
* Clamps a number value
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export declare function clamp(v: number, min: number, max: number): number;
|
|
36
|
+
export type ClassValue = string | null | undefined | false | ClassDictionary | ClassArray | (() => ClassValue);
|
|
37
|
+
export interface ClassDictionary {
|
|
38
|
+
[key: string]: boolean | (() => boolean);
|
|
39
|
+
}
|
|
40
|
+
export interface ClassArray extends Array<ClassValue> {
|
|
41
|
+
}
|
|
42
|
+
export declare function uiStyle(style: Partial<CSSStyleDeclaration> | undefined): Partial<CSSStyleDeclaration>;
|
|
43
|
+
/**
|
|
44
|
+
* Builds a css class from various argument types
|
|
45
|
+
* @param exp
|
|
46
|
+
*/
|
|
47
|
+
export declare function uiClass(...args: ClassValue[]): string;
|
|
48
|
+
/**
|
|
49
|
+
* Pads a string
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
export declare function padLeft(value: string, length: number, char: string): string;
|
|
53
|
+
/**
|
|
54
|
+
* Gets current mouse coordinates from mouse or touch event
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
export declare function getTouchPoint(e: MouseEvent | TouchEvent): [number, number];
|
|
58
|
+
export declare function getTouchInTarget(e: MouseEvent | TouchEvent, target?: HTMLElement | null, offset?: [number, number]): {
|
|
59
|
+
width: number;
|
|
60
|
+
height: number;
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
normalizedX: number;
|
|
64
|
+
normalizedY: number;
|
|
65
|
+
};
|
|
66
|
+
export declare function dragUtil({ onStart, onMove, onEnd, }: {
|
|
67
|
+
onStart?: (e: MouseEvent | TouchEvent) => void;
|
|
68
|
+
onMove?: (e: MouseEvent | TouchEvent) => void;
|
|
69
|
+
onEnd?: (e: MouseEvent | TouchEvent) => void;
|
|
70
|
+
}): {
|
|
71
|
+
target: HTMLElement | null;
|
|
72
|
+
activate: (e: MouseEvent) => void;
|
|
73
|
+
deactivate: () => void;
|
|
74
|
+
onStart: ((e: MouseEvent | TouchEvent) => void) | undefined;
|
|
75
|
+
onMove: ((e: MouseEvent | TouchEvent) => void) | undefined;
|
|
76
|
+
onEnd: ((e: MouseEvent | TouchEvent) => void) | undefined;
|
|
77
|
+
};
|
|
78
|
+
export declare function eventWithTimout(el: Element, event: string, timeout: number): Promise<boolean>;
|
|
94
79
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/core/utils.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/core/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,MAAM,CAE5C;AACD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,MAAM,CAE5C;AACD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAE/D;AACD;;;GAGG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,GAAG,EAAE,CAE1C;AACD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,MAAM,CAE5C;AACD;;;GAGG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,EAClD,EAAE,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EACxB,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,OAGvB;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAUjE;AAED,MAAM,MAAM,UAAU,GAClB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,UAAU,GAAG,UAAU,KAAK,IAAI;iBACjC,UAAU,GAAG,UAAU,KAAK,IAAI;gBACjC,UAAU,GAAG,UAAU,KAAK,IAAI;EAqC7C;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAiB7F"}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,28 +1,22 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tweak UI is a lightweight js library for building input controls with data binding
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* The library provides a set of common ui components built with mithriljs. The main objective
|
|
6
|
-
* is to allow a developer to rapidly scaffold input interfaces for manipulating javascript objects
|
|
7
|
-
* at runtime.
|
|
8
|
-
*
|
|
9
|
-
* Similar projects are:
|
|
10
|
-
* {@link https://github.com/dataarts/dat.gui | dat.GUI}
|
|
11
|
-
* {@link https://github.com/automat/controlkit.js | controlkit}
|
|
12
|
-
* {@link https://github.com/colejd/guify | guify}
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export * from './builder';
|
|
18
|
-
export * from './color
|
|
19
|
-
export * from './components';
|
|
20
|
-
export * from './core';
|
|
21
|
-
export * from './mount';
|
|
22
|
-
/**
|
|
23
|
-
* The version string
|
|
24
|
-
*
|
|
25
|
-
* @public
|
|
26
|
-
*/
|
|
27
|
-
export declare const VERSION: string;
|
|
1
|
+
/**
|
|
2
|
+
* Tweak UI is a lightweight js library for building input controls with data binding
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* The library provides a set of common ui components built with mithriljs. The main objective
|
|
6
|
+
* is to allow a developer to rapidly scaffold input interfaces for manipulating javascript objects
|
|
7
|
+
* at runtime.
|
|
8
|
+
*
|
|
9
|
+
* Similar projects are:
|
|
10
|
+
* {@link https://github.com/dataarts/dat.gui | dat.GUI}
|
|
11
|
+
* {@link https://github.com/automat/controlkit.js | controlkit}
|
|
12
|
+
* {@link https://github.com/colejd/guify | guify}
|
|
13
|
+
* {@link https://tweakpane.github.io/docs/ | tweakpane}
|
|
14
|
+
*
|
|
15
|
+
* @packageDocumentation
|
|
16
|
+
*/
|
|
17
|
+
export * from './builder';
|
|
18
|
+
export * from './color';
|
|
19
|
+
export * from './components';
|
|
20
|
+
export * from './core';
|
|
21
|
+
export * from './mount';
|
|
28
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA"}
|
package/dist/lib/mount.d.ts
CHANGED
|
@@ -1,46 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
*
|
|
37
|
-
* @public
|
|
38
|
-
* @remarks
|
|
39
|
-
* When changing the ui description object qui callbacks (e.g. `onInput` or `onChange`)
|
|
40
|
-
* the ui will redraw automatically.
|
|
41
|
-
*
|
|
42
|
-
* However if the ui description object is changed from outside the qui callback
|
|
43
|
-
* then this method must be called in order to update the visual state.
|
|
44
|
-
*/
|
|
45
|
-
export declare function redraw(): void;
|
|
1
|
+
import { default as m, ChildArray, Component } from 'mithril';
|
|
2
|
+
import { BuilderFn } from './builder';
|
|
3
|
+
/**
|
|
4
|
+
* Mithril's hyperscript function.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
* @remarks
|
|
8
|
+
* Useful to create custom components
|
|
9
|
+
*/
|
|
10
|
+
export declare const h: m.Static;
|
|
11
|
+
/**
|
|
12
|
+
* Mounts a ui to the given element
|
|
13
|
+
*/
|
|
14
|
+
export declare function mountUi(target: Element | string, data: ChildArray): void;
|
|
15
|
+
export declare function mountUi(target: Element | string, data: BuilderFn): void;
|
|
16
|
+
export declare function mountUi<A, S>(target: Element | string, data: Component<A, S>): void;
|
|
17
|
+
/**
|
|
18
|
+
* Unmounts the ui from given host element
|
|
19
|
+
*
|
|
20
|
+
* @public
|
|
21
|
+
* @param el - The ui host element
|
|
22
|
+
*/
|
|
23
|
+
export declare function unmountUi(target: Element | string): void;
|
|
24
|
+
/**
|
|
25
|
+
* Redraws the ui
|
|
26
|
+
*
|
|
27
|
+
* @public
|
|
28
|
+
* @remarks
|
|
29
|
+
* When changing the ui description object qui callbacks (e.g. `onInput` or `onChange`)
|
|
30
|
+
* the ui will redraw automatically.
|
|
31
|
+
*
|
|
32
|
+
* However if the ui description object is changed from outside the qui callback
|
|
33
|
+
* then this method must be called in order to update the visual state.
|
|
34
|
+
*/
|
|
35
|
+
export declare function redrawUi(): void;
|
|
46
36
|
//# sourceMappingURL=mount.d.ts.map
|
package/dist/lib/mount.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../src/lib/mount.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../src/lib/mount.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAW,SAAS,EAAE,MAAM,WAAW,CAAA;AAG9C;;;;;;GAMG;AACH,eAAO,MAAM,CAAC,UAAI,CAAA;AAElB;;GAEG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAAA;AACzE,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI,CAAA;AACxE,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAA;AAkBpF;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,QAGjD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,SAEvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/stats/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export type StatTransform = 'linear' | 'log' | 'exp';
|
|
2
|
+
export type SamplerConfig = {
|
|
3
|
+
/**
|
|
4
|
+
* Display name of the stat
|
|
5
|
+
*/
|
|
6
|
+
name?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Display color of the stat
|
|
9
|
+
*/
|
|
10
|
+
color?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Formatting for the current value
|
|
13
|
+
*/
|
|
14
|
+
fractionDigits?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Function that returns the current value of the stat
|
|
17
|
+
*/
|
|
18
|
+
sample: () => number;
|
|
19
|
+
/**
|
|
20
|
+
* Smoothing factor for EMA calculation.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* 0 is no smoothing, 0.9 is heavy smoothing. Don't set to 1 or it will never update! Default is 0 (no smoothing).
|
|
24
|
+
*/
|
|
25
|
+
smoothing?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Expected minimum value for display. Used for normalization and auto-ranging. Default is 0.
|
|
28
|
+
*/
|
|
29
|
+
min?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Expected maximum value for display. Used for normalization and auto-ranging. Default is 1.
|
|
32
|
+
*/
|
|
33
|
+
max?: number;
|
|
34
|
+
transform?: StatTransform;
|
|
35
|
+
noGraph?: boolean;
|
|
36
|
+
};
|
|
37
|
+
export interface Sampler {
|
|
38
|
+
color?: string;
|
|
39
|
+
noGraph?: boolean;
|
|
40
|
+
fractionDigits?: number;
|
|
41
|
+
smoothing: number;
|
|
42
|
+
transform: (v: number) => number;
|
|
43
|
+
min: number;
|
|
44
|
+
max: number;
|
|
45
|
+
sample: () => number;
|
|
46
|
+
value: number | null;
|
|
47
|
+
normalized: number;
|
|
48
|
+
buffer: Float32Array;
|
|
49
|
+
head: number;
|
|
50
|
+
count: number;
|
|
51
|
+
index: number;
|
|
52
|
+
sum: number;
|
|
53
|
+
avg: number;
|
|
54
|
+
minDeque: Float32Array;
|
|
55
|
+
maxDeque: Float32Array;
|
|
56
|
+
minIdx: Uint32Array;
|
|
57
|
+
maxIdx: Uint32Array;
|
|
58
|
+
minHead: number;
|
|
59
|
+
minTail: number;
|
|
60
|
+
maxHead: number;
|
|
61
|
+
maxTail: number;
|
|
62
|
+
minSeen: number;
|
|
63
|
+
maxSeen: number;
|
|
64
|
+
}
|
|
65
|
+
export declare function sampler(config: SamplerConfig, size: number): Sampler;
|
|
66
|
+
//# sourceMapp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