tweak-ui 0.4.3 → 0.5.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/lib/builder.d.ts +166 -162
- package/dist/lib/builder.d.ts.map +1 -1
- package/dist/lib/builder.js +250 -0
- package/dist/lib/builder.js.map +1 -0
- package/dist/lib/color-formats/array-format.d.ts +8 -8
- package/dist/lib/color-formats/array-format.js +18 -0
- package/dist/lib/color-formats/array-format.js.map +1 -0
- package/dist/lib/color-formats/converter.d.ts +18 -18
- package/dist/lib/color-formats/converter.js +85 -0
- package/dist/lib/color-formats/converter.js.map +1 -0
- package/dist/lib/color-formats/css-string-format.d.ts +7 -7
- package/dist/lib/color-formats/css-string-format.js +28 -0
- package/dist/lib/color-formats/css-string-format.js.map +1 -0
- package/dist/lib/color-formats/formatter.d.ts +8 -8
- package/dist/lib/color-formats/formatter.js +35 -0
- package/dist/lib/color-formats/formatter.js.map +1 -0
- package/dist/lib/color-formats/hex-string-format.d.ts +7 -7
- package/dist/lib/color-formats/hex-string-format.js +28 -0
- package/dist/lib/color-formats/hex-string-format.js.map +1 -0
- package/dist/lib/color-formats/index.d.ts +3 -3
- package/dist/lib/color-formats/index.js +4 -0
- package/dist/lib/color-formats/index.js.map +1 -0
- package/dist/lib/color-formats/number-format.d.ts +8 -8
- package/dist/lib/color-formats/number-format.js +23 -0
- package/dist/lib/color-formats/number-format.js.map +1 -0
- package/dist/lib/color-formats/object-format.d.ts +14 -14
- package/dist/lib/color-formats/object-format.js +23 -0
- package/dist/lib/color-formats/object-format.js.map +1 -0
- package/dist/lib/color-formats/types.d.ts +101 -101
- package/dist/lib/color-formats/types.js +2 -0
- package/dist/lib/color-formats/types.js.map +1 -0
- package/dist/lib/components/button.d.ts +28 -28
- package/dist/lib/components/button.d.ts.map +1 -1
- package/dist/lib/components/button.js +15 -0
- package/dist/lib/components/button.js.map +1 -0
- package/dist/lib/components/content.d.ts +21 -21
- package/dist/lib/components/content.d.ts.map +1 -1
- package/dist/lib/components/content.js +10 -0
- package/dist/lib/components/content.js.map +1 -0
- package/dist/lib/components/controls/angle.d.ts +51 -51
- package/dist/lib/components/controls/angle.d.ts.map +1 -1
- package/dist/lib/components/controls/angle.js +201 -0
- package/dist/lib/components/controls/angle.js.map +1 -0
- package/dist/lib/components/controls/checkbox.d.ts +28 -28
- package/dist/lib/components/controls/checkbox.d.ts.map +1 -1
- package/dist/lib/components/controls/checkbox.js +31 -0
- package/dist/lib/components/controls/checkbox.js.map +1 -0
- package/dist/lib/components/controls/color-picker.d.ts +56 -56
- package/dist/lib/components/controls/color-picker.d.ts.map +1 -1
- package/dist/lib/components/controls/color-picker.js +267 -0
- package/dist/lib/components/controls/color-picker.js.map +1 -0
- package/dist/lib/components/controls/color.d.ts +51 -51
- package/dist/lib/components/controls/color.d.ts.map +1 -1
- package/dist/lib/components/controls/color.js +77 -0
- package/dist/lib/components/controls/color.js.map +1 -0
- package/dist/lib/components/controls/index.d.ts +10 -10
- package/dist/lib/components/controls/index.js +11 -0
- package/dist/lib/components/controls/index.js.map +1 -0
- package/dist/lib/components/controls/number.d.ts +47 -47
- package/dist/lib/components/controls/number.d.ts.map +1 -1
- package/dist/lib/components/controls/number.js +142 -0
- package/dist/lib/components/controls/number.js.map +1 -0
- package/dist/lib/components/controls/point.d.ts +47 -47
- package/dist/lib/components/controls/point.d.ts.map +1 -1
- package/dist/lib/components/controls/point.js +137 -0
- package/dist/lib/components/controls/point.js.map +1 -0
- package/dist/lib/components/controls/position.d.ts +55 -55
- package/dist/lib/components/controls/position.d.ts.map +1 -1
- package/dist/lib/components/controls/position.js +36 -0
- package/dist/lib/components/controls/position.js.map +1 -0
- package/dist/lib/components/controls/select.d.ts +59 -59
- package/dist/lib/components/controls/select.d.ts.map +1 -1
- package/dist/lib/components/controls/select.js +132 -0
- package/dist/lib/components/controls/select.js.map +1 -0
- package/dist/lib/components/controls/spherical.d.ts +74 -74
- package/dist/lib/components/controls/spherical.d.ts.map +1 -1
- package/dist/lib/components/controls/spherical.js +302 -0
- package/dist/lib/components/controls/spherical.js.map +1 -0
- package/dist/lib/components/controls/text.d.ts +35 -35
- package/dist/lib/components/controls/text.d.ts.map +1 -1
- package/dist/lib/components/controls/text.js +24 -0
- package/dist/lib/components/controls/text.js.map +1 -0
- package/dist/lib/components/groups/accordion.d.ts +21 -21
- package/dist/lib/components/groups/accordion.d.ts.map +1 -1
- package/dist/lib/components/groups/accordion.js +34 -0
- package/dist/lib/components/groups/accordion.js.map +1 -0
- package/dist/lib/components/groups/container.d.ts +24 -24
- package/dist/lib/components/groups/container.d.ts.map +1 -1
- package/dist/lib/components/groups/container.js +19 -0
- package/dist/lib/components/groups/container.js.map +1 -0
- package/dist/lib/components/groups/group.d.ts +48 -48
- package/dist/lib/components/groups/group.d.ts.map +1 -1
- package/dist/lib/components/groups/group.js +50 -0
- package/dist/lib/components/groups/group.js.map +1 -0
- package/dist/lib/components/groups/index.d.ts +4 -4
- package/dist/lib/components/groups/index.js +5 -0
- package/dist/lib/components/groups/index.js.map +1 -0
- package/dist/lib/components/groups/tabs.d.ts +21 -21
- package/dist/lib/components/groups/tabs.d.ts.map +1 -1
- package/dist/lib/components/groups/tabs.js +31 -0
- package/dist/lib/components/groups/tabs.js.map +1 -0
- package/dist/lib/components/image.d.ts +36 -36
- package/dist/lib/components/image.d.ts.map +1 -1
- package/dist/lib/components/image.js +46 -0
- package/dist/lib/components/image.js.map +1 -0
- package/dist/lib/components/index.d.ts +5 -5
- package/dist/lib/components/index.js +6 -0
- package/dist/lib/components/index.js.map +1 -0
- package/dist/lib/core/index.d.ts +4 -4
- package/dist/lib/core/index.js +5 -0
- package/dist/lib/core/index.js.map +1 -0
- package/dist/lib/core/registry.d.ts +17 -17
- package/dist/lib/core/registry.js +30 -0
- package/dist/lib/core/registry.js.map +1 -0
- package/dist/lib/core/render.d.ts +9 -9
- package/dist/lib/core/render.d.ts.map +1 -1
- package/dist/lib/core/render.js +19 -0
- package/dist/lib/core/render.js.map +1 -0
- package/dist/lib/core/types.d.ts +87 -87
- package/dist/lib/core/types.d.ts.map +1 -1
- package/dist/lib/core/types.js +2 -0
- package/dist/lib/core/types.js.map +1 -0
- package/dist/lib/core/utils.d.ts +93 -93
- package/dist/lib/core/utils.d.ts.map +1 -1
- package/dist/lib/core/utils.js +193 -0
- package/dist/lib/core/utils.js.map +1 -0
- package/dist/lib/core/value-accessor.d.ts +17 -17
- package/dist/lib/core/value-accessor.js +52 -0
- package/dist/lib/core/value-accessor.js.map +1 -0
- package/dist/lib/index.d.ts +21 -27
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +29 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/mount.d.ts +45 -45
- package/dist/lib/mount.js +85 -0
- package/dist/lib/mount.js.map +1 -0
- package/dist/tweak-ui.css +133 -138
- package/dist/tweak-ui.css.map +1 -1
- package/dist/tweak-ui.min.css +1 -1
- package/dist/tweak-ui.min.css.map +1 -1
- package/dist/tweak-ui.module.js +2733 -2396
- package/dist/tweak-ui.module.js.map +1 -1
- package/dist/tweak-ui.umd.js +1 -4419
- package/dist/tweak-ui.umd.js.map +1 -1
- package/package.json +25 -42
- package/dist/index.html +0 -1063
- 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.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.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.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.spec.d.ts +0 -2
- package/dist/lib/color-formats/hex-string-format.spec.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.spec.d.ts +0 -2
- package/dist/lib/color-formats/object-format.spec.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.umd.min.js +0 -17
- package/dist/tweak-ui.umd.min.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './types';
|
|
2
|
-
export * from './converter';
|
|
3
|
-
export * from './formatter';
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './converter';
|
|
3
|
+
export * from './formatter';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/color-formats/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA","sourcesContent":["export * from './types'\r\nexport * from './converter'\r\nexport * from './formatter'\r\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ColorFormatter, RGBA } from './types';
|
|
2
|
-
export declare class NumberColorFormat implements ColorFormatter<number> {
|
|
3
|
-
private components;
|
|
4
|
-
private componentsRev;
|
|
5
|
-
constructor(components: string[]);
|
|
6
|
-
parse(v: number): RGBA;
|
|
7
|
-
format(rgba: RGBA): number;
|
|
8
|
-
}
|
|
1
|
+
import { ColorFormatter, RGBA } from './types';
|
|
2
|
+
export declare class NumberColorFormat implements ColorFormatter<number> {
|
|
3
|
+
private components;
|
|
4
|
+
private componentsRev;
|
|
5
|
+
constructor(components: string[]);
|
|
6
|
+
parse(v: number): RGBA;
|
|
7
|
+
format(rgba: RGBA): number;
|
|
8
|
+
}
|
|
9
9
|
//# sourceMappingURL=number-format.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// tslint:disable:no-bitwise
|
|
2
|
+
import { padLeft } from '../core/utils';
|
|
3
|
+
export class NumberColorFormat {
|
|
4
|
+
constructor(components) {
|
|
5
|
+
this.components = components;
|
|
6
|
+
this.componentsRev = components.slice().reverse();
|
|
7
|
+
}
|
|
8
|
+
parse(v) {
|
|
9
|
+
v = v || 0;
|
|
10
|
+
const result = { r: 0, g: 0, b: 0, a: 1 };
|
|
11
|
+
this.components.forEach((key, i) => {
|
|
12
|
+
result[key] = ((v >> (i * 8)) & 255) / 255;
|
|
13
|
+
});
|
|
14
|
+
return result;
|
|
15
|
+
}
|
|
16
|
+
format(rgba) {
|
|
17
|
+
const val = this.componentsRev
|
|
18
|
+
.map((key) => padLeft(Math.round(rgba[key] * 255 || 0).toString(16), 2, '0'))
|
|
19
|
+
.join('');
|
|
20
|
+
return parseInt('0x' + val, 16);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=number-format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number-format.js","sourceRoot":"","sources":["../../../src/lib/color-formats/number-format.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAGvC,MAAM,OAAO,iBAAiB;IAE5B,YAAoB,UAAoB;QAApB,eAAU,GAAV,UAAU,CAAU;QACtC,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,CAAA;IACnD,CAAC;IACM,KAAK,CAAC,CAAS;QACpB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACV,MAAM,MAAM,GAAS,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAA;QAC/C,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;YACjC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAA;QAC5C,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAA;IACf,CAAC;IAEM,MAAM,CAAC,IAAU;QACtB,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa;aAC3B,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CACX,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAC/D;aACA,IAAI,CAAC,EAAE,CAAC,CAAA;QACX,OAAO,QAAQ,CAAC,IAAI,GAAG,GAAG,EAAE,EAAE,CAAC,CAAA;IACjC,CAAC;CACF","sourcesContent":["// tslint:disable:no-bitwise\r\nimport { padLeft } from '../core/utils'\r\nimport { ColorFormatter, RGBA } from './types'\r\n\r\nexport class NumberColorFormat implements ColorFormatter<number> {\r\n private componentsRev: string[]\r\n constructor(private components: string[]) {\r\n this.componentsRev = components.slice().reverse()\r\n }\r\n public parse(v: number) {\r\n v = v || 0\r\n const result: RGBA = { r: 0, g: 0, b: 0, a: 1 }\r\n this.components.forEach((key, i) => {\r\n result[key] = ((v >> (i * 8)) & 255) / 255\r\n })\r\n return result\r\n }\r\n\r\n public format(rgba: RGBA) {\r\n const val = this.componentsRev\r\n .map((key) =>\r\n padLeft(Math.round(rgba[key] * 255 || 0).toString(16), 2, '0'),\r\n )\r\n .join('')\r\n return parseInt('0x' + val, 16)\r\n }\r\n}\r\n"]}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ColorFormatter, RGBA } from './types';
|
|
2
|
-
export declare class ObjectColorFormat implements ColorFormatter<{
|
|
3
|
-
[key: string]: number;
|
|
4
|
-
}> {
|
|
5
|
-
private components;
|
|
6
|
-
private normalized;
|
|
7
|
-
constructor(components: string[], normalized: boolean);
|
|
8
|
-
parse(v: {
|
|
9
|
-
[key: string]: number;
|
|
10
|
-
}): RGBA;
|
|
11
|
-
format(rgba: RGBA): {
|
|
12
|
-
[key: string]: number;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
1
|
+
import { ColorFormatter, RGBA } from './types';
|
|
2
|
+
export declare class ObjectColorFormat implements ColorFormatter<{
|
|
3
|
+
[key: string]: number;
|
|
4
|
+
}> {
|
|
5
|
+
private components;
|
|
6
|
+
private normalized;
|
|
7
|
+
constructor(components: string[], normalized: boolean);
|
|
8
|
+
parse(v: {
|
|
9
|
+
[key: string]: number;
|
|
10
|
+
}): RGBA;
|
|
11
|
+
format(rgba: RGBA): {
|
|
12
|
+
[key: string]: number;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
15
|
//# sourceMappingURL=object-format.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export class ObjectColorFormat {
|
|
2
|
+
constructor(components, normalized) {
|
|
3
|
+
this.components = components;
|
|
4
|
+
this.normalized = normalized;
|
|
5
|
+
}
|
|
6
|
+
parse(v) {
|
|
7
|
+
v = v || {};
|
|
8
|
+
const result = { r: 0, g: 0, b: 0, a: 1 };
|
|
9
|
+
this.components.forEach((key, i) => {
|
|
10
|
+
result[key] = (v[key] || 0) / (this.normalized ? 1 : 255);
|
|
11
|
+
});
|
|
12
|
+
return result;
|
|
13
|
+
}
|
|
14
|
+
format(rgba) {
|
|
15
|
+
const result = {};
|
|
16
|
+
this.components.forEach((key, i) => {
|
|
17
|
+
result[key] =
|
|
18
|
+
(this.normalized ? rgba[key] : Math.round(rgba[key] * 255)) || 0;
|
|
19
|
+
});
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=object-format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object-format.js","sourceRoot":"","sources":["../../../src/lib/color-formats/object-format.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,iBAAiB;IAE5B,YAAoB,UAAoB,EAAU,UAAmB;QAAjD,eAAU,GAAV,UAAU,CAAU;QAAU,eAAU,GAAV,UAAU,CAAS;IAAG,CAAC;IAClE,KAAK,CAAC,CAA4B;QACvC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;QACX,MAAM,MAAM,GAAS,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAA;QAC/C,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;YACjC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;QAC3D,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAA;IACf,CAAC;IAEM,MAAM,CAAC,IAAU;QACtB,MAAM,MAAM,GAA8B,EAAE,CAAA;QAC5C,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;YACjC,MAAM,CAAC,GAAG,CAAC;gBACT,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,CAAA;QACpE,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import { ColorFormatter, RGBA } from './types'\r\n\r\nexport class ObjectColorFormat\r\n implements ColorFormatter<{ [key: string]: number }> {\r\n constructor(private components: string[], private normalized: boolean) {}\r\n public parse(v: { [key: string]: number }) {\r\n v = v || {}\r\n const result: RGBA = { r: 0, g: 0, b: 0, a: 1 }\r\n this.components.forEach((key, i) => {\r\n result[key] = (v[key] || 0) / (this.normalized ? 1 : 255)\r\n })\r\n return result\r\n }\r\n\r\n public format(rgba: RGBA) {\r\n const result: { [key: string]: number } = {}\r\n this.components.forEach((key, i) => {\r\n result[key] =\r\n (this.normalized ? rgba[key] : Math.round(rgba[key] * 255)) || 0\r\n })\r\n return result\r\n }\r\n}\r\n"]}
|
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Describes a HSV color value
|
|
3
|
-
* @public
|
|
4
|
-
*/
|
|
5
|
-
export interface HSV {
|
|
6
|
-
[key: string]: number;
|
|
7
|
-
/**
|
|
8
|
-
* The hue component
|
|
9
|
-
*/
|
|
10
|
-
h: number;
|
|
11
|
-
/**
|
|
12
|
-
* The saturation component
|
|
13
|
-
*/
|
|
14
|
-
s: number;
|
|
15
|
-
/**
|
|
16
|
-
* The value component
|
|
17
|
-
*/
|
|
18
|
-
v: number;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Describes a HSV color value with alpha
|
|
22
|
-
* @public
|
|
23
|
-
*/
|
|
24
|
-
export interface HSVA extends HSV {
|
|
25
|
-
/**
|
|
26
|
-
* The alpha component
|
|
27
|
-
*/
|
|
28
|
-
a: number;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Describes a HSL color value
|
|
32
|
-
* @public
|
|
33
|
-
*/
|
|
34
|
-
export interface HSL {
|
|
35
|
-
[key: string]: number;
|
|
36
|
-
/**
|
|
37
|
-
* The hue component
|
|
38
|
-
*/
|
|
39
|
-
h: number;
|
|
40
|
-
/**
|
|
41
|
-
* The saturation component
|
|
42
|
-
*/
|
|
43
|
-
s: number;
|
|
44
|
-
/**
|
|
45
|
-
* The value component
|
|
46
|
-
*/
|
|
47
|
-
l: number;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Describes a HSL color value with alpha
|
|
51
|
-
* @public
|
|
52
|
-
*/
|
|
53
|
-
export interface HSLA extends HSL {
|
|
54
|
-
/**
|
|
55
|
-
* The alpha component
|
|
56
|
-
*/
|
|
57
|
-
a: number;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Describes an RGB color value
|
|
61
|
-
* @public
|
|
62
|
-
*/
|
|
63
|
-
export interface RGB {
|
|
64
|
-
[key: string]: number;
|
|
65
|
-
/**
|
|
66
|
-
* The red component
|
|
67
|
-
*/
|
|
68
|
-
r: number;
|
|
69
|
-
/**
|
|
70
|
-
* The green component
|
|
71
|
-
*/
|
|
72
|
-
g: number;
|
|
73
|
-
/**
|
|
74
|
-
* The blue component
|
|
75
|
-
*/
|
|
76
|
-
b: number;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Describes an RGB color value with alpha
|
|
80
|
-
* @public
|
|
81
|
-
*/
|
|
82
|
-
export interface RGBA extends RGB {
|
|
83
|
-
/**
|
|
84
|
-
* The alpha component
|
|
85
|
-
*/
|
|
86
|
-
a: number;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* An implementation to parse and format specific color format
|
|
90
|
-
* @public
|
|
91
|
-
*/
|
|
92
|
-
export interface ColorFormatter<T> {
|
|
93
|
-
/**
|
|
94
|
-
* Parses a color value and returns an RGBA object with all components normalized to [0:1]
|
|
95
|
-
*/
|
|
96
|
-
parse: (v: T) => RGBA;
|
|
97
|
-
/**
|
|
98
|
-
* Formats an RGBA color value into a target color format
|
|
99
|
-
*/
|
|
100
|
-
format: (rgba: RGBA) => T;
|
|
101
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Describes a HSV color value
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
5
|
+
export interface HSV {
|
|
6
|
+
[key: string]: number;
|
|
7
|
+
/**
|
|
8
|
+
* The hue component
|
|
9
|
+
*/
|
|
10
|
+
h: number;
|
|
11
|
+
/**
|
|
12
|
+
* The saturation component
|
|
13
|
+
*/
|
|
14
|
+
s: number;
|
|
15
|
+
/**
|
|
16
|
+
* The value component
|
|
17
|
+
*/
|
|
18
|
+
v: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Describes a HSV color value with alpha
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export interface HSVA extends HSV {
|
|
25
|
+
/**
|
|
26
|
+
* The alpha component
|
|
27
|
+
*/
|
|
28
|
+
a: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Describes a HSL color value
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
export interface HSL {
|
|
35
|
+
[key: string]: number;
|
|
36
|
+
/**
|
|
37
|
+
* The hue component
|
|
38
|
+
*/
|
|
39
|
+
h: number;
|
|
40
|
+
/**
|
|
41
|
+
* The saturation component
|
|
42
|
+
*/
|
|
43
|
+
s: number;
|
|
44
|
+
/**
|
|
45
|
+
* The value component
|
|
46
|
+
*/
|
|
47
|
+
l: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Describes a HSL color value with alpha
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
53
|
+
export interface HSLA extends HSL {
|
|
54
|
+
/**
|
|
55
|
+
* The alpha component
|
|
56
|
+
*/
|
|
57
|
+
a: number;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Describes an RGB color value
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
export interface RGB {
|
|
64
|
+
[key: string]: number;
|
|
65
|
+
/**
|
|
66
|
+
* The red component
|
|
67
|
+
*/
|
|
68
|
+
r: number;
|
|
69
|
+
/**
|
|
70
|
+
* The green component
|
|
71
|
+
*/
|
|
72
|
+
g: number;
|
|
73
|
+
/**
|
|
74
|
+
* The blue component
|
|
75
|
+
*/
|
|
76
|
+
b: number;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Describes an RGB color value with alpha
|
|
80
|
+
* @public
|
|
81
|
+
*/
|
|
82
|
+
export interface RGBA extends RGB {
|
|
83
|
+
/**
|
|
84
|
+
* The alpha component
|
|
85
|
+
*/
|
|
86
|
+
a: number;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* An implementation to parse and format specific color format
|
|
90
|
+
* @public
|
|
91
|
+
*/
|
|
92
|
+
export interface ColorFormatter<T> {
|
|
93
|
+
/**
|
|
94
|
+
* Parses a color value and returns an RGBA object with all components normalized to [0:1]
|
|
95
|
+
*/
|
|
96
|
+
parse: (v: T) => RGBA;
|
|
97
|
+
/**
|
|
98
|
+
* Formats an RGBA color value into a target color format
|
|
99
|
+
*/
|
|
100
|
+
format: (rgba: RGBA) => T;
|
|
101
|
+
}
|
|
102
102
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/lib/color-formats/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Describes a HSV color value\r\n * @public\r\n */\r\nexport interface HSV {\r\n [key: string]: number\r\n /**\r\n * The hue component\r\n */\r\n h: number\r\n /**\r\n * The saturation component\r\n */\r\n s: number\r\n /**\r\n * The value component\r\n */\r\n v: number\r\n}\r\n\r\n/**\r\n * Describes a HSV color value with alpha\r\n * @public\r\n */\r\nexport interface HSVA extends HSV {\r\n /**\r\n * The alpha component\r\n */\r\n a: number\r\n}\r\n\r\n/**\r\n * Describes a HSL color value\r\n * @public\r\n */\r\nexport interface HSL {\r\n [key: string]: number\r\n /**\r\n * The hue component\r\n */\r\n h: number\r\n /**\r\n * The saturation component\r\n */\r\n s: number\r\n /**\r\n * The value component\r\n */\r\n l: number\r\n}\r\n\r\n/**\r\n * Describes a HSL color value with alpha\r\n * @public\r\n */\r\nexport interface HSLA extends HSL {\r\n /**\r\n * The alpha component\r\n */\r\n a: number\r\n}\r\n\r\n/**\r\n * Describes an RGB color value\r\n * @public\r\n */\r\nexport interface RGB {\r\n [key: string]: number\r\n /**\r\n * The red component\r\n */\r\n r: number\r\n /**\r\n * The green component\r\n */\r\n g: number\r\n /**\r\n * The blue component\r\n */\r\n b: number\r\n}\r\n\r\n/**\r\n * Describes an RGB color value with alpha\r\n * @public\r\n */\r\nexport interface RGBA extends RGB {\r\n /**\r\n * The alpha component\r\n */\r\n a: number\r\n}\r\n\r\n/**\r\n * An implementation to parse and format specific color format\r\n * @public\r\n */\r\nexport interface ColorFormatter<T> {\r\n /**\r\n * Parses a color value and returns an RGBA object with all components normalized to [0:1]\r\n */\r\n parse: (v: T) => RGBA\r\n /**\r\n * Formats an RGBA color value into a target color format\r\n */\r\n format: (rgba: RGBA) => T\r\n}\r\n"]}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { ComponentAttrs, ComponentModel } from '../core';
|
|
2
|
-
/**
|
|
3
|
-
* Button component attribuets
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
export
|
|
7
|
-
/**
|
|
8
|
-
* Button component model
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export interface ButtonModel extends ComponentModel {
|
|
12
|
-
/**
|
|
13
|
-
* The type name of the control
|
|
14
|
-
*/
|
|
15
|
-
type: 'button';
|
|
16
|
-
/**
|
|
17
|
-
* The button text
|
|
18
|
-
*/
|
|
19
|
-
text?: string;
|
|
20
|
-
/**
|
|
21
|
-
* This is callend when the control is clicked
|
|
22
|
-
*/
|
|
23
|
-
onClick?: (ctrl: ButtonModel) => void;
|
|
24
|
-
/**
|
|
25
|
-
* Disables the control input
|
|
26
|
-
*/
|
|
27
|
-
disabled?: boolean;
|
|
28
|
-
}
|
|
1
|
+
import { ComponentAttrs, ComponentModel } from '../core';
|
|
2
|
+
/**
|
|
3
|
+
* Button component attribuets
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export type ButtonAttrs = ComponentAttrs<ButtonModel>;
|
|
7
|
+
/**
|
|
8
|
+
* Button component model
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export interface ButtonModel extends ComponentModel {
|
|
12
|
+
/**
|
|
13
|
+
* The type name of the control
|
|
14
|
+
*/
|
|
15
|
+
type: 'button';
|
|
16
|
+
/**
|
|
17
|
+
* The button text
|
|
18
|
+
*/
|
|
19
|
+
text?: string;
|
|
20
|
+
/**
|
|
21
|
+
* This is callend when the control is clicked
|
|
22
|
+
*/
|
|
23
|
+
onClick?: (ctrl: ButtonModel) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Disables the control input
|
|
26
|
+
*/
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
}
|
|
29
29
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/lib/components/button.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAGnE;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/lib/components/button.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAGnE;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,WAAW,CAAC,CAAA;AAErD;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAA;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAA;IACrC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import m from 'mithril';
|
|
2
|
+
import { component } from '../core';
|
|
3
|
+
import { call, twuiClass, viewFn } from '../core/utils';
|
|
4
|
+
const type = 'button';
|
|
5
|
+
component(type, (node) => {
|
|
6
|
+
return {
|
|
7
|
+
view: viewFn((data) => m(type, {
|
|
8
|
+
type: type,
|
|
9
|
+
class: twuiClass(type),
|
|
10
|
+
onclick: () => call(data.onClick, data),
|
|
11
|
+
disabled: data.disabled,
|
|
12
|
+
}, data.text)),
|
|
13
|
+
};
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/lib/components/button.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,SAAS,CAAA;AAEvB,OAAO,EAAE,SAAS,EAAkC,MAAM,SAAS,CAAA;AACnE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AA+BvD,MAAM,IAAI,GAAG,QAAQ,CAAA;AACrB,SAAS,CAAc,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE;IACpC,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CACpB,CAAC,CACC,IAAI,EACJ;YACE,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC;YACtB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC;YACvC,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,EACD,IAAI,CAAC,IAAI,CACV,CACF;KACF,CAAA;AACH,CAAC,CAAC,CAAA","sourcesContent":["import m from 'mithril'\r\n\r\nimport { component, ComponentAttrs, ComponentModel } from '../core'\r\nimport { call, twuiClass, viewFn } from '../core/utils'\r\n\r\n/**\r\n * Button component attribuets\r\n * @public\r\n */\r\nexport type ButtonAttrs = ComponentAttrs<ButtonModel>\r\n\r\n/**\r\n * Button component model\r\n * @public\r\n */\r\nexport interface ButtonModel extends ComponentModel {\r\n /**\r\n * The type name of the control\r\n */\r\n type: 'button'\r\n /**\r\n * The button text\r\n */\r\n text?: string\r\n /**\r\n * This is callend when the control is clicked\r\n */\r\n onClick?: (ctrl: ButtonModel) => void\r\n /**\r\n * Disables the control input\r\n */\r\n disabled?: boolean\r\n}\r\n\r\nconst type = 'button'\r\ncomponent<ButtonAttrs>(type, (node) => {\r\n return {\r\n view: viewFn((data) =>\r\n m(\r\n type,\r\n {\r\n type: type,\r\n class: twuiClass(type),\r\n onclick: () => call(data.onClick, data),\r\n disabled: data.disabled,\r\n },\r\n data.text,\r\n ),\r\n ),\r\n }\r\n})\r\n"]}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { Child } from 'mithril';
|
|
2
|
-
import { ComponentAttrs, ComponentModel } from '../core';
|
|
3
|
-
/**
|
|
4
|
-
* Content component attributes
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export
|
|
8
|
-
/**
|
|
9
|
-
* Content component model
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export interface ContentModel extends ComponentModel {
|
|
13
|
-
/**
|
|
14
|
-
* The type name of the control
|
|
15
|
-
*/
|
|
16
|
-
type: 'content';
|
|
17
|
-
/**
|
|
18
|
-
* A mithril child
|
|
19
|
-
*/
|
|
20
|
-
content?: Child;
|
|
21
|
-
}
|
|
1
|
+
import { Child } from 'mithril';
|
|
2
|
+
import { ComponentAttrs, ComponentModel } from '../core';
|
|
3
|
+
/**
|
|
4
|
+
* Content component attributes
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export type ContentAttrs = ComponentAttrs<ContentModel>;
|
|
8
|
+
/**
|
|
9
|
+
* Content component model
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export interface ContentModel extends ComponentModel {
|
|
13
|
+
/**
|
|
14
|
+
* The type name of the control
|
|
15
|
+
*/
|
|
16
|
+
type: 'content';
|
|
17
|
+
/**
|
|
18
|
+
* A mithril child
|
|
19
|
+
*/
|
|
20
|
+
content?: Child;
|
|
21
|
+
}
|
|
22
22
|
//# sourceMappingURL=content.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/lib/components/content.ts"],"names":[],"mappings":"AAAA,OAAU,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAElC,OAAO,EAAa,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAGnE;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/lib/components/content.ts"],"names":[],"mappings":"AAAA,OAAU,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAElC,OAAO,EAAa,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAGnE;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,YAAY,CAAC,CAAA;AAEvD;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,cAAc;IAClD;;OAEG;IACH,IAAI,EAAE,SAAS,CAAA;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAA;CAChB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import m from 'mithril';
|
|
2
|
+
import { component } from '../core';
|
|
3
|
+
import { viewFn } from '../core/utils';
|
|
4
|
+
const CONTENT = 'content';
|
|
5
|
+
component(CONTENT, () => {
|
|
6
|
+
return {
|
|
7
|
+
view: viewFn((data) => m.fragment({}, [data.content])),
|
|
8
|
+
};
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../../src/lib/components/content.ts"],"names":[],"mappings":"AAAA,OAAO,CAAY,MAAM,SAAS,CAAA;AAElC,OAAO,EAAE,SAAS,EAAkC,MAAM,SAAS,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAuBtC,MAAM,OAAO,GAAG,SAAS,CAAA;AAEzB,SAAS,CAAe,OAAO,EAAE,GAAG,EAAE;IACpC,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;KACvD,CAAA;AACH,CAAC,CAAC,CAAA","sourcesContent":["import m, { Child } from 'mithril'\r\n\r\nimport { component, ComponentAttrs, ComponentModel } from '../core'\r\nimport { viewFn } from '../core/utils'\r\n\r\n/**\r\n * Content component attributes\r\n * @public\r\n */\r\nexport type ContentAttrs = ComponentAttrs<ContentModel>\r\n\r\n/**\r\n * Content component model\r\n * @public\r\n */\r\nexport interface ContentModel extends ComponentModel {\r\n /**\r\n * The type name of the control\r\n */\r\n type: 'content'\r\n /**\r\n * A mithril child\r\n */\r\n content?: Child\r\n}\r\n\r\nconst CONTENT = 'content'\r\n\r\ncomponent<ContentAttrs>(CONTENT, () => {\r\n return {\r\n view: viewFn((data) => m.fragment({}, [data.content])),\r\n }\r\n})\r\n"]}
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { ComponentModel, ValueSource, ComponentAttrs, ValueCodec } from '../../core';
|
|
2
|
-
import { Direction } from './spherical';
|
|
3
|
-
/**
|
|
4
|
-
* Spherical component attributes
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export
|
|
8
|
-
/**
|
|
9
|
-
* Spherical component model
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export interface AngleModel<T = unknown> extends ComponentModel, ValueSource<T, number> {
|
|
13
|
-
/**
|
|
14
|
-
* The type name of the control
|
|
15
|
-
*/
|
|
16
|
-
type: 'angle';
|
|
17
|
-
/**
|
|
18
|
-
* Whether to use degrees instead of radians
|
|
19
|
-
*/
|
|
20
|
-
degree?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* This is called when the control value has been changed.
|
|
23
|
-
*/
|
|
24
|
-
onInput?: (model: AngleModel<T>, value: unknown) => void;
|
|
25
|
-
/**
|
|
26
|
-
* This is called once the control value is committed by the user.
|
|
27
|
-
*
|
|
28
|
-
* @remarks
|
|
29
|
-
* Unlike the `onInput` callback, this is not necessarily called for each value change.
|
|
30
|
-
*/
|
|
31
|
-
onChange?: (model: AngleModel<T>, value: unknown) => void;
|
|
32
|
-
}
|
|
33
|
-
export interface AngleCodecOptions<T> {
|
|
34
|
-
/**
|
|
35
|
-
* Maps object keys to cartesian axes. Defaults to `{ x: 'right', y: 'up' }`
|
|
36
|
-
*/
|
|
37
|
-
axes?: Record<string | number, Direction>;
|
|
38
|
-
/**
|
|
39
|
-
* The vector length (circle radius). Defaults to `1`
|
|
40
|
-
*/
|
|
41
|
-
length?: number | (() => number);
|
|
42
|
-
/**
|
|
43
|
-
* Gets the objec where the result should be stored. May return a new instance.
|
|
44
|
-
*/
|
|
45
|
-
result?: () => T;
|
|
46
|
-
}
|
|
47
|
-
export declare function angleCodec(): ValueCodec<{
|
|
48
|
-
x: number;
|
|
49
|
-
y: number;
|
|
50
|
-
}, number>;
|
|
51
|
-
export declare function angleCodec<T>(options: AngleCodecOptions<T>): ValueCodec<T, number>;
|
|
1
|
+
import { ComponentModel, ValueSource, ComponentAttrs, ValueCodec } from '../../core';
|
|
2
|
+
import { Direction } from './spherical';
|
|
3
|
+
/**
|
|
4
|
+
* Spherical component attributes
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export type AngleAttrs = ComponentAttrs<AngleModel>;
|
|
8
|
+
/**
|
|
9
|
+
* Spherical component model
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export interface AngleModel<T = unknown> extends ComponentModel, ValueSource<T, number> {
|
|
13
|
+
/**
|
|
14
|
+
* The type name of the control
|
|
15
|
+
*/
|
|
16
|
+
type: 'angle';
|
|
17
|
+
/**
|
|
18
|
+
* Whether to use degrees instead of radians
|
|
19
|
+
*/
|
|
20
|
+
degree?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* This is called when the control value has been changed.
|
|
23
|
+
*/
|
|
24
|
+
onInput?: (model: AngleModel<T>, value: unknown) => void;
|
|
25
|
+
/**
|
|
26
|
+
* This is called once the control value is committed by the user.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* Unlike the `onInput` callback, this is not necessarily called for each value change.
|
|
30
|
+
*/
|
|
31
|
+
onChange?: (model: AngleModel<T>, value: unknown) => void;
|
|
32
|
+
}
|
|
33
|
+
export interface AngleCodecOptions<T> {
|
|
34
|
+
/**
|
|
35
|
+
* Maps object keys to cartesian axes. Defaults to `{ x: 'right', y: 'up' }`
|
|
36
|
+
*/
|
|
37
|
+
axes?: Record<string | number, Direction>;
|
|
38
|
+
/**
|
|
39
|
+
* The vector length (circle radius). Defaults to `1`
|
|
40
|
+
*/
|
|
41
|
+
length?: number | (() => number);
|
|
42
|
+
/**
|
|
43
|
+
* Gets the objec where the result should be stored. May return a new instance.
|
|
44
|
+
*/
|
|
45
|
+
result?: () => T;
|
|
46
|
+
}
|
|
47
|
+
export declare function angleCodec(): ValueCodec<{
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
}, number>;
|
|
51
|
+
export declare function angleCodec<T>(options: AngleCodecOptions<T>): ValueCodec<T, number>;
|
|
52
52
|
//# sourceMappingURL=angle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angle.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/controls/angle.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,cAAc,EACd,WAAW,EACX,cAAc,EACd,UAAU,EACX,MAAM,YAAY,CAAA;AAGnB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"angle.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/controls/angle.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,cAAc,EACd,WAAW,EACX,cAAc,EACd,UAAU,EACX,MAAM,YAAY,CAAA;AAGnB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC,CAAA;AAEnD;;;GAGG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,cAAc,EAAE,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC;IACrF;;OAEG;IACH,IAAI,EAAE,OAAO,CAAA;IACb;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IACxD;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;CAC1D;AAsKD,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,SAAS,CAAC,CAAA;IACzC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAA;IAChC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,CAAA;CACjB;AAED,wBAAgB,UAAU,IAAI,UAAU,CAAC;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,MAAM,CAAC,CAAA;AAC1E,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA"}
|