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.
Files changed (200) hide show
  1. package/LICENSE +7 -7
  2. package/README.md +32 -32
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/lib/builder.d.ts +102 -162
  6. package/dist/lib/builder.d.ts.map +1 -1
  7. package/dist/lib/color/adapter.d.ts +7 -0
  8. package/dist/lib/color/adapter.d.ts.map +1 -0
  9. package/dist/lib/color/array-format.d.ts +9 -0
  10. package/dist/lib/color/array-format.d.ts.map +1 -0
  11. package/dist/lib/{color-formats → color}/converter.d.ts +18 -18
  12. package/dist/lib/color/converter.d.ts.map +1 -0
  13. package/dist/lib/color/css-string-format.d.ts +8 -0
  14. package/dist/lib/color/css-string-format.d.ts.map +1 -0
  15. package/dist/lib/color/formatter.d.ts +9 -0
  16. package/dist/lib/color/formatter.d.ts.map +1 -0
  17. package/dist/lib/color/hex-string-format.d.ts +9 -0
  18. package/dist/lib/color/hex-string-format.d.ts.map +1 -0
  19. package/dist/lib/{color-formats → color}/index.d.ts +3 -3
  20. package/dist/lib/color/index.d.ts.map +1 -0
  21. package/dist/lib/color/number-format.d.ts +9 -0
  22. package/dist/lib/color/number-format.d.ts.map +1 -0
  23. package/dist/lib/{color-formats → color}/object-format.d.ts +14 -14
  24. package/dist/lib/color/object-format.d.ts.map +1 -0
  25. package/dist/lib/{color-formats → color}/types.d.ts +107 -101
  26. package/dist/lib/color/types.d.ts.map +1 -0
  27. package/dist/lib/components/container/bar.d.ts +28 -0
  28. package/dist/lib/components/container/bar.d.ts.map +1 -0
  29. package/dist/lib/components/container/dialog.d.ts +14 -0
  30. package/dist/lib/components/container/dialog.d.ts.map +1 -0
  31. package/dist/lib/components/container/grid.d.ts +22 -0
  32. package/dist/lib/components/container/grid.d.ts.map +1 -0
  33. package/dist/lib/components/container/group.d.ts +55 -0
  34. package/dist/lib/components/container/group.d.ts.map +1 -0
  35. package/dist/lib/components/container/index.d.ts +10 -0
  36. package/dist/lib/components/container/index.d.ts.map +1 -0
  37. package/dist/lib/components/container/list.d.ts +25 -0
  38. package/dist/lib/components/container/list.d.ts.map +1 -0
  39. package/dist/lib/components/container/section.d.ts +28 -0
  40. package/dist/lib/components/container/section.d.ts.map +1 -0
  41. package/dist/lib/components/container/split.d.ts +40 -0
  42. package/dist/lib/components/container/split.d.ts.map +1 -0
  43. package/dist/lib/components/container/tabs.d.ts +23 -0
  44. package/dist/lib/components/container/tabs.d.ts.map +1 -0
  45. package/dist/lib/components/container/tree.d.ts +25 -0
  46. package/dist/lib/components/container/tree.d.ts.map +1 -0
  47. package/dist/lib/components/controls/angle.d.ts +47 -51
  48. package/dist/lib/components/controls/angle.d.ts.map +1 -1
  49. package/dist/lib/components/controls/bitmask.d.ts +41 -0
  50. package/dist/lib/components/controls/bitmask.d.ts.map +1 -0
  51. package/dist/lib/components/controls/bool.d.ts +52 -0
  52. package/dist/lib/components/controls/bool.d.ts.map +1 -0
  53. package/dist/lib/components/controls/color-picker.d.ts +41 -56
  54. package/dist/lib/components/controls/color-picker.d.ts.map +1 -1
  55. package/dist/lib/components/controls/color.d.ts +37 -51
  56. package/dist/lib/components/controls/color.d.ts.map +1 -1
  57. package/dist/lib/components/controls/index.d.ts +14 -10
  58. package/dist/lib/components/controls/index.d.ts.map +1 -1
  59. package/dist/lib/components/controls/input.d.ts +44 -0
  60. package/dist/lib/components/controls/input.d.ts.map +1 -0
  61. package/dist/lib/components/controls/matrix.d.ts +58 -0
  62. package/dist/lib/components/controls/matrix.d.ts.map +1 -0
  63. package/dist/lib/components/controls/point.d.ts +41 -47
  64. package/dist/lib/components/controls/point.d.ts.map +1 -1
  65. package/dist/lib/components/controls/poll.d.ts +12 -0
  66. package/dist/lib/components/controls/poll.d.ts.map +1 -0
  67. package/dist/lib/components/controls/scalar.d.ts +67 -0
  68. package/dist/lib/components/controls/scalar.d.ts.map +1 -0
  69. package/dist/lib/components/controls/select.d.ts +53 -59
  70. package/dist/lib/components/controls/select.d.ts.map +1 -1
  71. package/dist/lib/components/controls/spherical.d.ts +37 -74
  72. package/dist/lib/components/controls/spherical.d.ts.map +1 -1
  73. package/dist/lib/components/controls/string.d.ts +46 -0
  74. package/dist/lib/components/controls/string.d.ts.map +1 -0
  75. package/dist/lib/components/controls/vector.d.ts +54 -0
  76. package/dist/lib/components/controls/vector.d.ts.map +1 -0
  77. package/dist/lib/components/elements/button.d.ts +36 -0
  78. package/dist/lib/components/elements/button.d.ts.map +1 -0
  79. package/dist/lib/components/elements/divider.d.ts +4 -0
  80. package/dist/lib/components/elements/divider.d.ts.map +1 -0
  81. package/dist/lib/components/elements/graph.d.ts +8 -0
  82. package/dist/lib/components/elements/graph.d.ts.map +1 -0
  83. package/dist/lib/components/elements/image.d.ts +33 -0
  84. package/dist/lib/components/elements/image.d.ts.map +1 -0
  85. package/dist/lib/components/elements/index.d.ts +6 -0
  86. package/dist/lib/components/elements/index.d.ts.map +1 -0
  87. package/dist/lib/components/elements/widget.d.ts +27 -0
  88. package/dist/lib/components/elements/widget.d.ts.map +1 -0
  89. package/dist/lib/components/index.d.ts +3 -5
  90. package/dist/lib/components/index.d.ts.map +1 -1
  91. package/dist/lib/core/control.d.ts +20 -0
  92. package/dist/lib/core/control.d.ts.map +1 -0
  93. package/dist/lib/core/index.d.ts +3 -4
  94. package/dist/lib/core/index.d.ts.map +1 -1
  95. package/dist/lib/core/render.d.ts +7 -9
  96. package/dist/lib/core/render.d.ts.map +1 -1
  97. package/dist/lib/core/types.d.ts +73 -87
  98. package/dist/lib/core/types.d.ts.map +1 -1
  99. package/dist/lib/core/utils.d.ts +78 -93
  100. package/dist/lib/core/utils.d.ts.map +1 -1
  101. package/dist/lib/index.d.ts +21 -27
  102. package/dist/lib/index.d.ts.map +1 -1
  103. package/dist/lib/mount.d.ts +35 -45
  104. package/dist/lib/mount.d.ts.map +1 -1
  105. package/dist/lib/stats/index.d.ts +2 -0
  106. package/dist/lib/stats/index.d.ts.map +1 -0
  107. package/dist/lib/stats/sampler.d.ts +66 -0
  108. package/dist/lib/stats/sampler.d.ts.map +1 -0
  109. package/dist/lib/stats/stats-renderer.d.ts +16 -0
  110. package/dist/lib/stats/stats-renderer.d.ts.map +1 -0
  111. package/dist/style.css +1 -0
  112. package/dist/style.d.ts +4 -0
  113. package/dist/tweak-ui.module.js +2938 -2393
  114. package/dist/tweak-ui.module.js.map +1 -1
  115. package/dist/tweak-ui.umd.js +33 -4420
  116. package/dist/tweak-ui.umd.js.map +1 -1
  117. package/package.json +37 -51
  118. package/dist/index.html +0 -1063
  119. package/dist/lib/color-formats/array-format.d.ts +0 -9
  120. package/dist/lib/color-formats/array-format.d.ts.map +0 -1
  121. package/dist/lib/color-formats/array-format.spec.d.ts +0 -2
  122. package/dist/lib/color-formats/array-format.spec.d.ts.map +0 -1
  123. package/dist/lib/color-formats/converter.d.ts.map +0 -1
  124. package/dist/lib/color-formats/converter.spec.d.ts +0 -2
  125. package/dist/lib/color-formats/converter.spec.d.ts.map +0 -1
  126. package/dist/lib/color-formats/css-string-format.d.ts +0 -8
  127. package/dist/lib/color-formats/css-string-format.d.ts.map +0 -1
  128. package/dist/lib/color-formats/css-string-format.spec.d.ts +0 -2
  129. package/dist/lib/color-formats/css-string-format.spec.d.ts.map +0 -1
  130. package/dist/lib/color-formats/formatter.d.ts +0 -9
  131. package/dist/lib/color-formats/formatter.d.ts.map +0 -1
  132. package/dist/lib/color-formats/formatter.spec.d.ts +0 -2
  133. package/dist/lib/color-formats/formatter.spec.d.ts.map +0 -1
  134. package/dist/lib/color-formats/hex-string-format.d.ts +0 -8
  135. package/dist/lib/color-formats/hex-string-format.d.ts.map +0 -1
  136. package/dist/lib/color-formats/hex-string-format.spec.d.ts +0 -2
  137. package/dist/lib/color-formats/hex-string-format.spec.d.ts.map +0 -1
  138. package/dist/lib/color-formats/index.d.ts.map +0 -1
  139. package/dist/lib/color-formats/number-format.d.ts +0 -9
  140. package/dist/lib/color-formats/number-format.d.ts.map +0 -1
  141. package/dist/lib/color-formats/number-format.spec.d.ts +0 -2
  142. package/dist/lib/color-formats/number-format.spec.d.ts.map +0 -1
  143. package/dist/lib/color-formats/object-format.d.ts.map +0 -1
  144. package/dist/lib/color-formats/object-format.spec.d.ts +0 -2
  145. package/dist/lib/color-formats/object-format.spec.d.ts.map +0 -1
  146. package/dist/lib/color-formats/types.d.ts.map +0 -1
  147. package/dist/lib/components/button.d.ts +0 -29
  148. package/dist/lib/components/button.d.ts.map +0 -1
  149. package/dist/lib/components/content.d.ts +0 -22
  150. package/dist/lib/components/content.d.ts.map +0 -1
  151. package/dist/lib/components/controls/checkbox.d.ts +0 -29
  152. package/dist/lib/components/controls/checkbox.d.ts.map +0 -1
  153. package/dist/lib/components/controls/number.d.ts +0 -48
  154. package/dist/lib/components/controls/number.d.ts.map +0 -1
  155. package/dist/lib/components/controls/position.d.ts +0 -56
  156. package/dist/lib/components/controls/position.d.ts.map +0 -1
  157. package/dist/lib/components/controls/text.d.ts +0 -36
  158. package/dist/lib/components/controls/text.d.ts.map +0 -1
  159. package/dist/lib/components/groups/accordion.d.ts +0 -22
  160. package/dist/lib/components/groups/accordion.d.ts.map +0 -1
  161. package/dist/lib/components/groups/container.d.ts +0 -25
  162. package/dist/lib/components/groups/container.d.ts.map +0 -1
  163. package/dist/lib/components/groups/group.d.ts +0 -49
  164. package/dist/lib/components/groups/group.d.ts.map +0 -1
  165. package/dist/lib/components/groups/index.d.ts +0 -5
  166. package/dist/lib/components/groups/index.d.ts.map +0 -1
  167. package/dist/lib/components/groups/tabs.d.ts +0 -22
  168. package/dist/lib/components/groups/tabs.d.ts.map +0 -1
  169. package/dist/lib/components/image.d.ts +0 -37
  170. package/dist/lib/components/image.d.ts.map +0 -1
  171. package/dist/lib/core/registry.d.ts +0 -18
  172. package/dist/lib/core/registry.d.ts.map +0 -1
  173. package/dist/lib/core/value-accessor.d.ts +0 -18
  174. package/dist/lib/core/value-accessor.d.ts.map +0 -1
  175. package/dist/scss/_style.scss +0 -120
  176. package/dist/scss/_themes.scss +0 -23
  177. package/dist/scss/_utils.scss +0 -24
  178. package/dist/scss/_variables.scss +0 -30
  179. package/dist/scss/controls/_angle.scss +0 -64
  180. package/dist/scss/controls/_button.scss +0 -0
  181. package/dist/scss/controls/_checkbox.scss +0 -19
  182. package/dist/scss/controls/_color-picker.scss +0 -124
  183. package/dist/scss/controls/_color.scss +0 -14
  184. package/dist/scss/controls/_container.scss +0 -13
  185. package/dist/scss/controls/_group.scss +0 -69
  186. package/dist/scss/controls/_image.scss +0 -27
  187. package/dist/scss/controls/_number.scss +0 -38
  188. package/dist/scss/controls/_point.scss +0 -36
  189. package/dist/scss/controls/_position.scss +0 -9
  190. package/dist/scss/controls/_select.scss +0 -0
  191. package/dist/scss/controls/_spherical.scss +0 -87
  192. package/dist/scss/controls/_tabs.scss +0 -38
  193. package/dist/scss/controls/_text.scss +0 -0
  194. package/dist/scss/index.scss +0 -21
  195. package/dist/tweak-ui.css +0 -653
  196. package/dist/tweak-ui.css.map +0 -1
  197. package/dist/tweak-ui.min.css +0 -1
  198. package/dist/tweak-ui.min.css.map +0 -1
  199. package/dist/tweak-ui.umd.min.js +0 -17
  200. package/dist/tweak-ui.umd.min.js.map +0 -1
package/LICENSE CHANGED
@@ -1,7 +1,7 @@
1
- Copyright 2018 Alexander Gräfenstein
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
-
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright 2018 Alexander Gräfenstein
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,32 +1,32 @@
1
- ![Latest NPM release][version-shield]
2
- [![License][license-shield]][license-url]
3
-
4
- # Tweak UI
5
- Tweak UI is a lightweight js library providing simple tweak controls
6
-
7
- It provides a set of common ui components built with mithriljs. The main objective
8
- is to allow a developer to rapidly scaffold input interfaces for manipulating javascript objects
9
- at runtime.
10
-
11
- ## Installation
12
-
13
- ### NPM
14
-
15
- `npm -i tweak-ui`
16
-
17
- ### CDN
18
-
19
- ```html
20
- <style link="https://unpkg.com/tweak-ui@x.x.x/dist/tweakui.min.css"></style>
21
- <script src="https://unpkg.com/tweak-ui@x.x.x/dist/tweakui.umd.min.js"></script>
22
- ```
23
-
24
- ## Alternatives
25
-
26
- * [dat.gui](https://github.com/dataarts/dat.gui)
27
- * [controlkit.js](https://github.com/automat/controlkit.js)
28
- * [guify](https://github.com/colejd/guify)
29
-
30
- [license-url]: ./LICENSE
31
- [license-shield]: https://img.shields.io/npm/l/tweak-ui.svg
32
- [version-shield]: https://img.shields.io/npm/v/tweak-ui.svg
1
+ ![Latest NPM release][version-shield]
2
+ [![License][license-shield]][license-url]
3
+
4
+ # Tweak UI
5
+ Tweak UI is a lightweight js library providing simple tweak controls
6
+
7
+ It provides a set of common ui components built with mithriljs. The main objective
8
+ is to allow a developer to rapidly scaffold input interfaces for manipulating javascript objects
9
+ at runtime.
10
+
11
+ ## Installation
12
+
13
+ ### NPM
14
+
15
+ `npm -i tweak-ui`
16
+
17
+ ### CDN
18
+
19
+ ```html
20
+ <style link="https://unpkg.com/tweak-ui@x.x.x/dist/tweakui.min.css"></style>
21
+ <script src="https://unpkg.com/tweak-ui@x.x.x/dist/tweakui.umd.min.js"></script>
22
+ ```
23
+
24
+ ## Alternatives
25
+
26
+ * [dat.gui](https://github.com/dataarts/dat.gui)
27
+ * [controlkit.js](https://github.com/automat/controlkit.js)
28
+ * [guify](https://github.com/colejd/guify)
29
+
30
+ [license-url]: ./LICENSE
31
+ [license-shield]: https://img.shields.io/npm/l/tweak-ui.svg
32
+ [version-shield]: https://img.shields.io/npm/v/tweak-ui.svg
@@ -0,0 +1,2 @@
1
+ export * from './lib';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAA;AACrB,cAAc,OAAO,CAAA"}
@@ -1,163 +1,103 @@
1
- import { ComponentModel } from './core';
2
- import { AccordeonModel, AngleModel, ButtonModel, CheckboxModel, ContainerModel, ColorModel, ColorPickerModel, ContentModel, GroupModel, ImageModel, NumberModel, PointModel, SelectModel, SphericalModel, TabsModel, TextModel, PositionModel } from './components';
3
- import { Child } from 'mithril';
4
- /**
5
- *
6
- * @public
7
- */
8
- export interface Removable {
9
- remove?: () => void;
10
- }
11
- /**
12
- * Union type of all build in models
13
- * @public
14
- */
15
- export declare type BuildInComponent = AccordeonModel | AngleModel | ButtonModel | CheckboxModel | ColorModel | ColorPickerModel | ContainerModel | ContentModel | GroupModel | ImageModel | NumberModel | PointModel | SelectModel | SphericalModel | TabsModel | TextModel | PositionModel;
16
- /**
17
- * @public
18
- */
19
- export declare type BuilderFn = (b: Builder) => void;
20
- /**
21
- * @public
22
- */
23
- export declare type TabsBuilderFn = (b: TabsBuilder) => void;
24
- /**
25
- * @public
26
- */
27
- export declare type AccordeonBuilderFn = (b: AccordeonBuilder) => void;
28
- /**
29
- * @public
30
- */
31
- export interface TabsBuilder {
32
- group(label: string, builder: BuilderFn): GroupModel & Removable;
33
- }
34
- /**
35
- * @public
36
- */
37
- export interface AccordeonBuilder {
38
- /**
39
- * Adds a control group
40
- *
41
- * @param title - The group label
42
- * @param builder - A callback allowing to build sub controls
43
- */
44
- group(title: string, builder: BuilderFn): GroupModel & Removable;
45
- /**
46
- * Adds a control group
47
- *
48
- * @param title - The group label
49
- * @param opts - Additional control options
50
- * @param builder - A callback allowing to build sub controls
51
- */
52
- group(title: string, opts: Partial<GroupModel>, builder?: BuilderFn): GroupModel & Removable;
53
- group(title: string, builder: BuilderFn): GroupModel & Removable;
54
- }
55
- /**
56
- *
57
- * @public
58
- */
59
- export declare class Builder {
60
- /**
61
- * Collection of created controls
62
- */
63
- controls: ComponentModel[];
64
- group(builder: BuilderFn): GroupModel & Removable;
65
- group(opts: Partial<GroupModel>): GroupModel & Removable;
66
- group(opts: Partial<GroupModel>, builder: BuilderFn): GroupModel & Removable;
67
- group(label: string, builder: BuilderFn): GroupModel & Removable;
68
- group(label: string, opts: Partial<GroupModel>): GroupModel & Removable;
69
- group(label: string, opts: Partial<GroupModel>, builder: BuilderFn): GroupModel & Removable;
70
- collapsible(builder: BuilderFn): GroupModel & Removable;
71
- collapsible(opts: Partial<GroupModel>): GroupModel & Removable;
72
- collapsible(opts: Partial<GroupModel>, builder: BuilderFn): GroupModel & Removable;
73
- collapsible(label: string, builder: BuilderFn): GroupModel & Removable;
74
- collapsible(label: string, opts: Partial<GroupModel>): GroupModel & Removable;
75
- collapsible(label: string, opts: Partial<GroupModel>, builder: BuilderFn): GroupModel & Removable;
76
- container(builder: BuilderFn): ContainerModel & Removable;
77
- container(opts: Partial<ContainerModel>): ContainerModel & Removable;
78
- container(opts: Partial<ContainerModel>, builder: BuilderFn): ContainerModel & Removable;
79
- container(label: string, builder: BuilderFn): ContainerModel & Removable;
80
- container(label: string, opts: Partial<ContainerModel>): ContainerModel & Removable;
81
- container(label: string, opts: Partial<ContainerModel>, builder: BuilderFn): ContainerModel & Removable;
82
- tabs(builder: TabsBuilderFn): TabsModel & Removable;
83
- tabs(opts: Partial<TabsModel>): TabsModel & Removable;
84
- tabs(opts: Partial<TabsModel>, builder: TabsBuilderFn): TabsModel & Removable;
85
- tabs(label: string, builder: TabsBuilderFn): TabsModel & Removable;
86
- tabs(label: string, opts: Partial<TabsModel>): TabsModel & Removable;
87
- tabs(label: string, opts: Partial<TabsModel>, builder: TabsBuilderFn): TabsModel & Removable;
88
- accordion(builder: AccordeonBuilderFn): AccordeonModel & Removable;
89
- accordion(opts: Partial<AccordeonModel>): AccordeonModel & Removable;
90
- accordion(opts: Partial<AccordeonModel>, builder: AccordeonBuilderFn): AccordeonModel & Removable;
91
- accordion(label: string, builder: AccordeonBuilderFn): AccordeonModel & Removable;
92
- accordion(label: string, opts: Partial<AccordeonModel>): AccordeonModel & Removable;
93
- accordion(label: string, opts: Partial<AccordeonModel>, builder: AccordeonBuilderFn): AccordeonModel & Removable;
94
- checkbox(opts: Partial<CheckboxModel>): CheckboxModel;
95
- checkbox<T>(target: T, property: keyof T): CheckboxModel<T>;
96
- checkbox<T>(target: T, property: keyof T, opts: Partial<CheckboxModel<T>>): CheckboxModel<T>;
97
- text(opts: Partial<TextModel>): TextModel;
98
- text<T>(target: T, property: keyof T): TextModel<T>;
99
- text<T>(target: T, property: keyof T, opts: Partial<TextModel<T>>): TextModel<T>;
100
- number(opts: Partial<NumberModel>): NumberModel;
101
- number<T>(target: T, property: keyof T): NumberModel<T>;
102
- number<T>(target: T, property: keyof T, opts: Partial<NumberModel<T>>): NumberModel<T>;
103
- slider(opts: Partial<NumberModel>): NumberModel;
104
- slider<T>(target: T, property: keyof T): NumberModel<T>;
105
- slider<T>(target: T, property: keyof T, opts: Partial<NumberModel<T>>): NumberModel<T>;
106
- position(opts: Partial<PositionModel>): PositionModel;
107
- position<T>(target: T, property: keyof T): PositionModel<T>;
108
- position<T>(target: T, property: keyof T, opts: Partial<PositionModel<T>>): PositionModel<T>;
109
- select(opts: Partial<SelectModel>): SelectModel;
110
- select<T>(target: T, property: keyof T): SelectModel<T>;
111
- select<T>(target: T, property: keyof T, opts: Partial<SelectModel<T>>): SelectModel<T>;
112
- color(opts: Partial<ColorModel>): ColorModel;
113
- color<T>(target: T, property: keyof T): ColorModel<T>;
114
- color<T>(target: T, property: keyof T, opts: Partial<ColorModel<T>>): ColorModel<T>;
115
- colorPicker(opts: Partial<ColorPickerModel>): ColorPickerModel;
116
- colorPicker<T>(target: T, property: keyof T): ColorPickerModel<T>;
117
- colorPicker<T>(target: T, property: keyof T, opts: Partial<ColorPickerModel<T>>): ColorPickerModel<T>;
118
- point(opts: Partial<PointModel>): PointModel;
119
- point<T>(target: T, property: keyof T): PointModel<T>;
120
- point<T>(target: T, property: keyof T, opts: Partial<PointModel<T>>): PointModel<T>;
121
- spherical(opts: Partial<SphericalModel>): SphericalModel;
122
- spherical<T>(target: T, property: keyof T): SphericalModel<T>;
123
- spherical<T>(target: T, property: keyof T, opts: Partial<SphericalModel<T>>): SphericalModel<T>;
124
- angle(opts: Partial<AngleModel>): AngleModel;
125
- angle<T>(target: T, property: keyof T): AngleModel<T>;
126
- angle<T>(target: T, property: keyof T, opts: Partial<AngleModel<T>>): AngleModel<T>;
127
- /**
128
- * Adds a button control
129
- *
130
- * @param text - The button text
131
- * @param opts - Additional options for the control
132
- */
133
- button(text: string, opts?: Partial<ButtonModel>): ButtonModel & Removable;
134
- /**
135
- * Adds an image control
136
- *
137
- * @param label - The control label
138
- * @param opts - Additional options for the control
139
- */
140
- image(opts: Partial<ImageModel>): ImageModel & Removable;
141
- image(label: string, opts: Partial<ImageModel>): ImageModel & Removable;
142
- /**
143
- * Adds a description text
144
- *
145
- * @param label - The control label
146
- * @param text - The text message
147
- * @param opts - Additional options for the control
148
- */
149
- content(label: string, content: Child, opts?: Partial<ContentModel>): ContentModel & Removable;
150
- /**
151
- * Adds a build in control
152
- *
153
- * @param def - The control definition
154
- */
155
- add<T extends BuildInComponent>(def: T): T & Removable;
156
- /**
157
- * Adds a control
158
- *
159
- * @param def - The control definition
160
- */
161
- add<T extends ComponentModel>(def: T): T & Removable;
162
- }
1
+ import { Children } from 'mithril';
2
+ import { ButtonAttrs, GraphAttrs, GroupAttrs, ImageAttrs, TreeAttrs, WidgetAttrs } from './components';
3
+ import { Component, ComponentChildren, ComponentSchema, OmitIn, TweakableAttrs } from './core';
4
+ /**
5
+ * @public
6
+ */
7
+ export type BuilderFn = (b: Builder) => void;
8
+ /**
9
+ * @public
10
+ */
11
+ export type TabsBuilderFn = (b: TabsBuilder) => void;
12
+ /**
13
+ * @public
14
+ */
15
+ export interface TabsBuilder {
16
+ group(label: string, builder: BuilderFn): GroupAttrs;
17
+ }
18
+ /**
19
+ *
20
+ * @public
21
+ */
22
+ export declare class Builder {
23
+ static build(fn: BuilderFn): ComponentSchema;
24
+ schema: ComponentSchema;
25
+ close(): ComponentSchema;
26
+ group: GroupGenerator<GroupAttrs>;
27
+ flex: ComponentGenerator<import('./components').ListAttrs>;
28
+ grid: ComponentGenerator<import('./components').GridAttrs>;
29
+ tabs: ComponentGenerator<import('./components').TabsAttrs>;
30
+ split: ComponentGenerator<import('./components').SplitAttr>;
31
+ splitContent: ComponentGenerator<import('./components').SplitContentAttr>;
32
+ section: ComponentGenerator<import('mithril').Attributes>;
33
+ sectionHeader: ComponentGenerator<import('mithril').Attributes>;
34
+ sectionFooter: ComponentGenerator<import('mithril').Attributes>;
35
+ bar: ComponentGenerator<import('mithril').Attributes>;
36
+ barStart: ComponentGenerator<import('mithril').Attributes>;
37
+ barEnd: ComponentGenerator<import('mithril').Attributes>;
38
+ barContent: ComponentGenerator<import('mithril').Attributes>;
39
+ bool: FieldGenerator<import('./components').BooleanWidgetAttrs<unknown>>;
40
+ string: FieldGenerator<import('./components').StringWidgetAttrs<unknown>>;
41
+ scalar: FieldGenerator<import('./components').ScalarWidgetAttrs<unknown>>;
42
+ vector: FieldGenerator<import('./components').VectorWidgetAttrs<unknown>>;
43
+ matrix: FieldGenerator<import('./components').MatrixWidgetAttrs<unknown>>;
44
+ select: FieldGenerator<import('./components').SelectAttrs<unknown, any>>;
45
+ angle: FieldGenerator<import('./components').AngleWidgetAttrs<unknown>>;
46
+ bitmask: FieldGenerator<import('./components').BitmaskWidgetAttrs<unknown>>;
47
+ poll: FieldGenerator<import('./components').PollWidgetAttrs<unknown>>;
48
+ color: FieldGenerator<import('./components').ColorWidgetAttrs<unknown>>;
49
+ colorPicker: FieldGenerator<import('./components').ColorPickerWidgetAttrs<unknown>>;
50
+ boolInput: FieldGenerator<import('./components').BooleanInputAttrs<unknown>>;
51
+ stringInput: FieldGenerator<import('./components').StringInputAttrs<unknown>>;
52
+ scalarInput: FieldGenerator<import('./components').ScalarInputAttrs<unknown>>;
53
+ vectorInput: FieldGenerator<import('./components').VectorInputAttrs<unknown>>;
54
+ matrixInput: FieldGenerator<import('./components').MatrixInputAttrs<unknown>>;
55
+ selectInput: FieldGenerator<import('./components').SelectAttrs<unknown, any>>;
56
+ angleInput: FieldGenerator<import('./components').AngleInputAttrs<unknown>>;
57
+ bitmaskInput: FieldGenerator<import('./components').BitmaskInputAttrs<unknown>>;
58
+ pollInput: FieldGenerator<import('./components').PollWidgetAttrs<unknown>>;
59
+ colorInput: FieldGenerator<import('./components').ColorAttrs<unknown>>;
60
+ colorPickerInput: FieldGenerator<import('./components').ColorPickerAttrs<unknown>>;
61
+ point: FieldGenerator<import('./components').PointAttrs<unknown>>;
62
+ spherical: FieldGenerator<import('./components').SphericalAttrs<unknown>>;
63
+ button(text: string, opts?: ButtonAttrs): void;
64
+ image(opts: ImageAttrs): void;
65
+ divider(content?: Children): void;
66
+ tree<T>(opts: TreeAttrs<T>): void;
67
+ graph(opts: GraphAttrs): void;
68
+ widget(label: string, children?: ComponentChildren): void;
69
+ pre(label: string, children?: ComponentChildren): void;
70
+ /**
71
+ * Adds a render function as a component
72
+ * This breaks out of the static builder schema and allows for dynamic content.
73
+ */
74
+ view(view: () => Children): void;
75
+ /**
76
+ * Adds a render function as a component
77
+ * This breaks out of the static builder schema and allows for dynamic content.
78
+ */
79
+ control(attrs: WidgetAttrs, children?: ComponentChildren): void;
80
+ /**
81
+ * Adds a component to the builder schema
82
+ */
83
+ add<Attrs extends Object>(component: Component<Attrs> | string, attributes?: Attrs, children?: ComponentChildren): void;
84
+ }
85
+ export type GroupGenerator<T extends Object> = {
86
+ (builder: BuilderFn): void;
87
+ (opts: Partial<T>): void;
88
+ (opts: Partial<T>, builder: BuilderFn): void;
89
+ (label: string, builder: BuilderFn): void;
90
+ (label: string, opts: Partial<T>): void;
91
+ (label: string, opts: Partial<T>, builder: BuilderFn): void;
92
+ };
93
+ export type FieldGenerator<A extends TweakableAttrs<any, any>> = {
94
+ (opts: A): void;
95
+ <V, K extends keyof V>(target: V, property: K): void;
96
+ <V, K extends keyof V>(target: V, property: K, opts: OmitIn<A, 'value' | 'field'>): void;
97
+ };
98
+ export type ComponentGenerator<T extends Object> = {
99
+ (builder: BuilderFn): void;
100
+ (opts: Partial<T>): void;
101
+ (opts: Partial<T>, builder: BuilderFn): void;
102
+ };
163
103
  //# sourceMappingURL=builder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/lib/builder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAoC,MAAM,QAAQ,CAAA;AAEzE,OAAO,EACL,cAAc,EACd,UAAU,EACV,WAAW,EACX,aAAa,EACb,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,cAAc,EACd,SAAS,EACT,SAAS,EACT,aAAa,EACd,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CACpB;AAED;;;GAGG;AACH,oBAAY,gBAAgB,GACzB,cAAc,GACd,UAAU,GACV,WAAW,GACX,aAAa,GACb,UAAU,GACV,gBAAgB,GAChB,cAAc,GACd,YAAY,GACZ,UAAU,GACV,UAAU,GACV,WAAW,GACX,UAAU,GACV,WAAW,GACX,cAAc,GACd,SAAS,GACT,SAAS,GACT,aAAa,CAAA;AAEhB;;GAEG;AACH,oBAAY,SAAS,GAAG,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;AAE5C;;GAEG;AACH,oBAAY,aAAa,GAAG,CAAC,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;AAEpD;;GAEG;AACH,oBAAY,kBAAkB,GAAG,CAAC,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAA;AAE9D;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,CAAA;CACjE;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,GAAG,UA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C7C,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { ColorAdapter } from './types';
2
+ export declare const ColorVec3Adapter: ColorAdapter<{
3
+ x: number;
4
+ y: number;
5
+ z: number;
6
+ }>;
7
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/lib/color/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC,eAAO,MAAM,gBAAgB,EAAE,YAAY,CAAC;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAiB9E,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { ColorAdapter, RGBA } from './types';
2
+ export declare class ArrayColorAdapter implements ColorAdapter<number[]> {
3
+ private components;
4
+ private normalized;
5
+ constructor(components: string[], normalized: boolean);
6
+ toControl(v: number[]): RGBA;
7
+ fromControl(rgba: RGBA): number[];
8
+ }
9
+ //# sourceMappingURL=array-format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array-format.d.ts","sourceRoot":"","sources":["../../../src/lib/color/array-format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE5C,qBAAa,iBAAkB,YAAW,YAAY,CAAC,MAAM,EAAE,CAAC;IAE5D,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,UAAU;gBADV,UAAU,EAAE,MAAM,EAAE,EACpB,UAAU,EAAE,OAAO;IAItB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE;IASrB,WAAW,CAAC,IAAI,EAAE,IAAI;CAK9B"}
@@ -1,19 +1,19 @@
1
- import { HSV, RGB } from './types';
2
- /**
3
- * Converts hsv to rgb
4
- *
5
- * @public
6
- * @param hsv - HSV components where H is in range [0:360] and S and V are in range [0:1]
7
- * @returns RGB color components in range [0:1]
8
- */
9
- export declare function hsv2rgb(hsv: HSV): RGB;
10
- /**
11
- * Converts rgb to hsv
12
- *
13
- * @public
14
- * @remarks
15
- * The RGB components are assumed to be in range [0:1].
16
- * The resulting H component is in range [0:360] and S and V in range [0:1]
17
- */
18
- export declare function rgb2hsv(rgb: RGB): HSV;
1
+ import { HSV, RGB } from './types';
2
+ /**
3
+ * Converts hsv to rgb
4
+ *
5
+ * @public
6
+ * @param hsv - HSV components where H is in range [0:360] and S and V are in range [0:1]
7
+ * @returns RGB color components in range [0:1]
8
+ */
9
+ export declare function hsv2rgb(hsv: HSV): RGB;
10
+ /**
11
+ * Converts rgb to hsv
12
+ *
13
+ * @public
14
+ * @remarks
15
+ * The RGB components are assumed to be in range [0:1].
16
+ * The resulting H component is in range [0:360] and S and V in range [0:1]
17
+ */
18
+ export declare function rgb2hsv(rgb: RGB): HSV;
19
19
  //# sourceMappingURL=converter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"converter.d.ts","sourceRoot":"","sources":["../../../src/lib/color/converter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAElC;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAyCrC;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAyBrC"}
@@ -0,0 +1,8 @@
1
+ import { ColorAdapter, RGBA } from './types';
2
+ export declare class CssColorAdapter implements ColorAdapter<string> {
3
+ private components;
4
+ constructor(components: string[]);
5
+ toControl(value: string): RGBA;
6
+ fromControl(rgba: RGBA): string;
7
+ }
8
+ //# sourceMappingURL=css-string-format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css-string-format.d.ts","sourceRoot":"","sources":["../../../src/lib/color/css-string-format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE5C,qBAAa,eAAgB,YAAW,YAAY,CAAC,MAAM,CAAC;IAC1D,OAAO,CAAC,UAAU,CAAiC;gBAEhC,UAAU,EAAE,MAAM,EAAE;IAIhC,SAAS,CAAC,KAAK,EAAE,MAAM;IAavB,WAAW,CAAC,IAAI,EAAE,IAAI;CAY9B"}
@@ -0,0 +1,9 @@
1
+ import { ColorAdapter } from './types';
2
+ /**
3
+ * Gets a formatter implementation for the given format
4
+ *
5
+ * @public
6
+ * @param format - The format code
7
+ */
8
+ export declare function getColorAdapter(format?: string): ColorAdapter<any>;
9
+ //# sourceMappingURL=formatter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../../../src/lib/color/formatter.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAItC;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,GAAE,MAAgB,GAAG,YAAY,CAAC,GAAG,CAAC,CA6E3E"}
@@ -0,0 +1,9 @@
1
+ import { ColorAdapter, RGBA } from './types';
2
+ export declare class HexColorAdapter implements ColorAdapter<string> {
3
+ private components;
4
+ private prefix;
5
+ constructor(components: string[], prefix?: string);
6
+ toControl(value?: string): RGBA;
7
+ fromControl(rgba: RGBA): string;
8
+ }
9
+ //# sourceMappingURL=hex-string-format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hex-string-format.d.ts","sourceRoot":"","sources":["../../../src/lib/color/hex-string-format.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE5C,qBAAa,eAAgB,YAAW,YAAY,CAAC,MAAM,CAAC;IAExD,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,MAAM;gBADN,UAAU,EAAE,MAAM,EAAE,EACpB,MAAM,SAAM;IAEf,SAAS,CAAC,KAAK,CAAC,EAAE,MAAM;IAmBxB,WAAW,CAAC,IAAI,EAAE,IAAI;CAQ9B"}
@@ -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.d.ts","sourceRoot":"","sources":["../../../src/lib/color/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { ColorAdapter, RGBA } from './types';
2
+ export declare class NumberColorAdapter implements ColorAdapter<number> {
3
+ private components;
4
+ private componentsRev;
5
+ constructor(components: string[]);
6
+ toControl(v: number): RGBA;
7
+ fromControl(rgba: RGBA): number;
8
+ }
9
+ //# sourceMappingURL=number-format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-format.d.ts","sourceRoot":"","sources":["../../../src/lib/color/number-format.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE5C,qBAAa,kBAAmB,YAAW,YAAY,CAAC,MAAM,CAAC;IAEjD,OAAO,CAAC,UAAU;IAD9B,OAAO,CAAC,aAAa,CAAU;gBACX,UAAU,EAAE,MAAM,EAAE;IAGjC,SAAS,CAAC,CAAC,EAAE,MAAM;IASnB,WAAW,CAAC,IAAI,EAAE,IAAI;CAM9B"}
@@ -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 { ColorAdapter, RGBA } from './types';
2
+ export declare class ObjectColorCodec implements ColorAdapter<{
3
+ [key: string]: number;
4
+ }> {
5
+ private components;
6
+ private normalized;
7
+ constructor(components: string[], normalized: boolean);
8
+ toControl(v: {
9
+ [key: string]: number;
10
+ }): RGBA;
11
+ fromControl(rgba: RGBA): {
12
+ [key: string]: number;
13
+ };
14
+ }
15
15
  //# sourceMappingURL=object-format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object-format.d.ts","sourceRoot":"","sources":["../../../src/lib/color/object-format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAG5C,qBAAa,gBAAiB,YAAW,YAAY,CAAC;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;IAE5E,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,UAAU;gBADV,UAAU,EAAE,MAAM,EAAE,EACpB,UAAU,EAAE,OAAO;IAItB,SAAS,CAAC,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;IAStC,WAAW,CAAC,IAAI,EAAE,IAAI;;;CAO9B"}