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
@@ -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,oBAAY,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;I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FactoryComponent, Vnode } from 'mithril';
2
+ import { TweakableAttrs } from '../../core';
3
+ import { CommonWidgetAttrs } from '../elements';
4
+ /**
5
+ * @public
6
+ */
7
+ export type BitmaskWidgetAttrs<T = unknown> = CommonWidgetAttrs & BitmaskInputAttrs<T>;
8
+ /**
9
+ * Bitmask component model
10
+ * @public
11
+ */
12
+ export type BitmaskInputAttrs<T = unknown> = TweakableAttrs<T, number> & {
13
+ /**
14
+ * This is called when the control value has been changed.
15
+ */
16
+ oninput?: (model: T, value: unknown) => void;
17
+ /**
18
+ * This is called once the control value is committed by the user.
19
+ *
20
+ * @remarks
21
+ * Unlike the `onInput` callback, this is not necessarily called for each value change.
22
+ */
23
+ onchange?: (model: T, value: unknown) => void;
24
+ /**
25
+ * Disables the control input
26
+ */
27
+ readonly?: boolean;
28
+ /**
29
+ * The number of bits in the mask
30
+ */
31
+ bitCount?: number;
32
+ /**
33
+ * Maaping of names to bit values. If provided, the control will display the names instead of the bit indices.
34
+ */
35
+ names?: Record<string, number>;
36
+ };
37
+ export declare function uiBitmaskWidget<T>(attrs: BitmaskWidgetAttrs<T>, children?: Children): Vnode<BitmaskWidgetAttrs<T>>;
38
+ export declare const BitmaskWidgetComponent: FactoryComponent<BitmaskWidgetAttrs>;
39
+ export declare function uiBitmaskInput<T>(attrs: BitmaskInputAttrs<T>, children?: Children): Vnode<BitmaskInputAttrs<T>>;
40
+ export declare const BitmaskInputComponent: FactoryComponent<BitmaskInputAttrs>;
41
+ //# sourceMappingURL=bitmask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bitmask.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/controls/bitmask.ts"],"names":[],"mappings":"AAAA,OAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC9D,OAAO,EAAoC,cAAc,EAAE,MAAM,YAAY,CAAA;AAE7E,OAAO,EAAE,iBAAiB,EAAsB,MAAM,aAAa,CAAA;AAEnE;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,GAAG,OAAO,IAAI,iBAAiB,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAA;AAEtF;;;GAGG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,OAAO,IAAI,cAAc,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG;IACvE;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IAE5C;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IAE7C;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/B,CAAA;AAED,wBAAgB,eAAe,CAAC,CAAC,EAC/B,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,EAC5B,QAAQ,CAAC,EAAE,QAAQ,GAClB,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAE9B;AAED,eAAO,MAAM,sBAAsB,EAAE,gBAAgB,CAAC,kBAAkB,CAavE,CAAA;AAED,wBAAgB,cAAc,CAAC,CAAC,EAC9B,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAC3B,QAAQ,CAAC,EAAE,QAAQ,GAClB,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAE7B;AAED,eAAO,MAAM,qBAAqB,EAAE,gBAAgB,CAAC,iBAAiB,CAqFrE,CAAA"}
@@ -0,0 +1,52 @@
1
+ import { Child, Children, FactoryComponent, Vnode } from 'mithril';
2
+ import { TweakableAttrs } from '../../core';
3
+ import { CommonWidgetAttrs } from '../elements';
4
+ export type BooleanWidgetAttrs<T = unknown> = CommonWidgetAttrs & BooleanInputAttrs<T>;
5
+ /**
6
+ * Describes a checkbox control
7
+ * @public
8
+ */
9
+ export type BooleanInputAttrs<T = unknown> = TweakableAttrs<T, boolean> & {
10
+ /**
11
+ * This is called when the control value changes
12
+ */
13
+ onchange?: (model: T, value: boolean) => void;
14
+ /**
15
+ * This is called when the control value changes
16
+ */
17
+ oninput?: (model: T, value: boolean) => void;
18
+ /**
19
+ * Content before the input field
20
+ */
21
+ slotBefore?: Child;
22
+ /**
23
+ * Content after the input field
24
+ */
25
+ slotAfter?: Child;
26
+ /**
27
+ * Content shown when the value is true
28
+ */
29
+ slotTrue?: Child;
30
+ /**
31
+ * Content shown when the value is false
32
+ */
33
+ slotFalse?: Child;
34
+ /**
35
+ * Disables the control input
36
+ */
37
+ readonly?: boolean;
38
+ /**
39
+ * Whether to use a toggle button style instead of a checkbox. By default, this is false (checkbox style).
40
+ */
41
+ toggle?: boolean;
42
+ /**
43
+ * Aligns the checkbox to the start or end of the control.
44
+ * By default, the checkbox is placed at the end of the control.
45
+ */
46
+ align?: 'start' | 'end';
47
+ };
48
+ export declare function uiBoolWidget<T>(attrs: BooleanWidgetAttrs<T>, children?: Children): Vnode<BooleanWidgetAttrs<T>>;
49
+ export declare function uiBoolInput<T>(attrs: BooleanInputAttrs<T>, children?: Children): Vnode<BooleanInputAttrs<T>>;
50
+ export declare const BoolWidgetComponent: FactoryComponent<BooleanWidgetAttrs>;
51
+ export declare const BoolInputComponent: FactoryComponent<BooleanInputAttrs>;
52
+ //# sourceMappingURL=bool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bool.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/controls/bool.ts"],"names":[],"mappings":"AAAA,OAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACrE,OAAO,EAAoC,cAAc,EAAE,MAAM,YAAY,CAAA;AAE7E,OAAO,EAAE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AAED,eAAO,MAAM,kBAAkB,EAAE,gBAAgB,CAAC,iBAAiB,CA+ClE,CAAA"}
@@ -1,57 +1,42 @@
1
- import { ComponentModel, ValueSource, ComponentAttrs } from '../../core';
2
- /**
3
- * Color picker component attributes
4
- *
5
- * @public
6
- */
7
- export declare type ColorPickerAttrs = ComponentAttrs<ColorPickerModel>;
8
- /**
9
- * Color picker component model
10
- *
11
- * @public
12
- */
13
- export interface ColorPickerModel<T = unknown, V = number | string | number[]> extends ComponentModel, ValueSource<T, V> {
14
- /**
15
- * The type name of the control
16
- */
17
- type: 'color-picker';
18
- /**
19
- * If `target` and `property` are not set, then this is used as the control value
20
- *
21
- * @remarks
22
- * The format is determined by the `format` property.
23
- *
24
- * It is allowed to omit the '#' character but the '#' will be added on change
25
- *
26
- * It is allowed to use single character form per component (#f00 instead of #ff0000)
27
- * but it will always be written back as #ff0000 on change
28
- */
29
- value?: V;
30
- /**
31
- * The format of the string value. Defaults to 'rgb'
32
- *
33
- * @remarks
34
- * This must be a combination of the letters `r`, `g`, `b` and `a`.
35
- *
36
- * A prefix of `#` indicates the input/output is a hex string. e.g. #rgba
37
- *
38
- * A prefix of `0x` indicates the input is a number. e.g. 0xrgba
39
- *
40
- * A prefix of `[]` indicates the input is an array of numbers. e.g. `[]rgba`
41
- *
42
- * If a prefix is missing `#` is assumed
43
- */
44
- format?: string;
45
- /**
46
- * This is called when the control value has been changed.
47
- */
48
- onInput?: (model: ColorPickerModel<T, V>, value: unknown) => void;
49
- /**
50
- * This is called once the control value is committed by the user.
51
- *
52
- * @remarks
53
- * Unlike the `onInput` callback, this is not necessarily called for each value change.
54
- */
55
- onChange?: (model: ColorPickerModel<T, V>, value: unknown) => void;
56
- }
1
+ import { Children, FactoryComponent, Vnode } from 'mithril';
2
+ import { TweakableAttrs } from '../../core';
3
+ import { CommonWidgetAttrs } from '../elements';
4
+ export type ColorPickerWidgetAttrs<T = unknown> = CommonWidgetAttrs & ColorPickerAttrs<T>;
5
+ /**
6
+ * Color picker component model
7
+ *
8
+ * @public
9
+ */
10
+ export type ColorPickerAttrs<T = unknown> = TweakableAttrs<T, any> & {
11
+ /**
12
+ * The format of the string value. Defaults to 'rgb'
13
+ *
14
+ * @remarks
15
+ * This must be a combination of the letters `r`, `g`, `b` and `a`.
16
+ *
17
+ * A prefix of `#` indicates the input/output is a hex string. e.g. #rgba
18
+ *
19
+ * A prefix of `0x` indicates the input is a number. e.g. 0xrgba
20
+ *
21
+ * A prefix of `[]` indicates the input is an array of numbers. e.g. `[]rgba`
22
+ *
23
+ * If a prefix is missing `#` is assumed
24
+ */
25
+ format?: string;
26
+ /**
27
+ * This is called when the control value has been changed.
28
+ */
29
+ oninput?: (model: T, value: any) => void;
30
+ /**
31
+ * This is called once the control value is committed by the user.
32
+ *
33
+ * @remarks
34
+ * Unlike the `onInput` callback, this is not necessarily called for each value change.
35
+ */
36
+ onchange?: (model: T, value: any) => void;
37
+ };
38
+ export declare function uiColorPickerWidget<T>(attrs: ColorPickerWidgetAttrs<T>, children?: Children): Vnode<ColorPickerWidgetAttrs<T>>;
39
+ export declare function uiColorPicker<T>(attrs: ColorPickerAttrs<T>, children?: Children): Vnode<ColorPickerAttrs<T>>;
40
+ export declare const ColorPickerWidgetComponent: FactoryComponent<ColorPickerWidgetAttrs>;
41
+ export declare const ColorPicker: FactoryComponent<ColorPickerAttrs>;
57
42
  //# sourceMappingURL=color-picker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"color-picker.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/controls/color-picker.ts"],"names":[],"mappings":"AAWA,OAAO,EAIL,cAAc,EACd,WAAW,EACX,cAAc,EACf,MAAM,YAAY,CAAA;AASnB;;;;GAIG;AACH,oBAAY,gBAAgB,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAAA;AAE/D;;;;GAIG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,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,EAAE,GAAG,KAAK,IAAI,CAAA;CAC1C,CAAA;AAED,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,KAAK,EAAE,sBAAsB,CAAC,CAAC,CAAC,EAChC,QAAQ,CAAC,EAAE,QAAQ,GAClB,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAElC;AAED,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAC1B,QAAQ,CAAC,EAAE,QAAQ,GAClB,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAE5B;AAED,eAAO,MAAM,0BAA0B,EAAE,gBAAgB,CAAC,sBAAsB,CAa/E,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,gBAAgB,CAAC,gBAAgB,CAoU1D,CAAA"}
@@ -1,52 +1,38 @@
1
- import { ComponentModel, ValueSource, ComponentAttrs } from '../../core';
2
- /**
3
- * Color component attributes
4
- * @public
5
- */
6
- export declare type ColorAttrs = ComponentAttrs<ColorModel>;
7
- /**
8
- * Color component model
9
- * @public
10
- */
11
- export interface ColorModel<T = unknown, V = number | string | number[]> extends ComponentModel, ValueSource<T, V> {
12
- /**
13
- * The type name of the control
14
- */
15
- type: 'color';
16
- /**
17
- * The color value as a string.
18
- *
19
- * @remarks
20
- * The format is determined by the `format` property.
21
- *
22
- * It is allowed to omit the '#' character but the '#' will be added on change
23
- *
24
- * It is allowed to use single character form per component (#f00 instead of #ff0000)
25
- * but it will always be written back as #ff0000 on change
26
- */
27
- value?: V;
28
- /**
29
- * The format of the string value. Defaults to 'rgb'
30
- *
31
- * @remarks
32
- * This must be a combination of the letters r, g, b and a
33
- * and it must match the input value.
34
- */
35
- format?: string;
36
- /**
37
- * Whether each component is normalized to range [0:1]
38
- */
39
- normalized?: boolean;
40
- /**
41
- * This is called when the control value has been changed.
42
- */
43
- onInput?: (model: ColorModel<T, V>, value: unknown) => void;
44
- /**
45
- * This is called once the control value is committed by the user.
46
- *
47
- * @remarks
48
- * Unlike the `onInput` callback, this is not necessarily called for each value change.
49
- */
50
- onChange?: (model: ColorModel<T, V>, value: unknown) => void;
51
- }
1
+ import { Children, FactoryComponent, Vnode } from 'mithril';
2
+ import { TweakableAttrs } from '../../core';
3
+ import { CommonWidgetAttrs } from '../elements';
4
+ export type ColorWidgetAttrs<T = unknown> = CommonWidgetAttrs & ColorAttrs<T>;
5
+ /**
6
+ * Color component model
7
+ * @public
8
+ */
9
+ export type ColorAttrs<T = unknown> = TweakableAttrs<T, any> & {
10
+ /**
11
+ * The format of the string value. Defaults to 'rgb'
12
+ *
13
+ * @remarks
14
+ * This must be a combination of the letters r, g, b and a
15
+ * and it must match the input value.
16
+ */
17
+ format?: string;
18
+ /**
19
+ * Whether each component is normalized to range [0:1]
20
+ */
21
+ normalized?: boolean;
22
+ /**
23
+ * This is called when the control value has been changed.
24
+ */
25
+ oninput?: (model: T, value: any) => void;
26
+ /**
27
+ * This is called once the control value is committed by the user.
28
+ *
29
+ * @remarks
30
+ * Unlike the `onInput` callback, this is not necessarily called for each value change.
31
+ */
32
+ onchange?: (model: T, value: any) => void;
33
+ };
34
+ export declare function uiColorWidget<T>(attrs: ColorWidgetAttrs<T>, children?: Children): Vnode<ColorWidgetAttrs<T>>;
35
+ export declare function uiColor<T>(attrs: ColorAttrs<T>, children?: Children): Vnode<ColorAttrs<T>>;
36
+ export declare const ColorWidgetComponent: FactoryComponent<ColorWidgetAttrs>;
37
+ export declare const ColorComponent: FactoryComponent<ColorAttrs>;
52
38
  //# sourceMappingURL=color.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/controls/color.ts"],"names":[],"mappings":"AAIA,OAAO,EAKL,cAAc,EACd,WAAW,EACX,cAAc,EACf,MAAM,YAAY,CAAA;AAcnB;;;GAGG;AACH,oBAAY,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC,CAAA;AAEnD;;;GAGG;AACH,MAAM,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EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;IAExC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;CAC1C,CAAA;AAED,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAC1B,QAAQ,CAAC,EAAE,QAAQ,GAClB,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAE5B;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAE1F;AAED,eAAO,MAAM,oBAAoB,EAAE,gBAAgB,CAAC,gBAAgB,CAanE,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,gBAAgB,CAAC,UAAU,CAoFvD,CAAA"}
@@ -1,11 +1,15 @@
1
- export * from './angle';
2
- export * from './checkbox';
3
- export * from './color-picker';
4
- export * from './color';
5
- export * from './number';
6
- export * from './point';
7
- export * from './position';
8
- export * from './select';
9
- export * from './spherical';
10
- export * from './text';
1
+ export * from './angle';
2
+ export * from './bool';
3
+ export * from './color';
4
+ export * from './color-picker';
5
+ export * from './input';
6
+ export * from './matrix';
7
+ export * from './point';
8
+ export * from './scalar';
9
+ export * from './select';
10
+ export * from './spherical';
11
+ export * from './string';
12
+ export * from './vector';
13
+ export * from './bitmask';
14
+ export * from './poll';
11
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/controls/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/controls/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA"}
@@ -0,0 +1,44 @@
1
+ import { Child, Children, FactoryComponent, Vnode } from 'mithril';
2
+ import { ValueWidgetAttrs } from '../elements';
3
+ /**
4
+ * Basic input component model
5
+ * @public
6
+ */
7
+ export type InputWidgetAttrs<T = unknown> = ValueWidgetAttrs<T, string> & {
8
+ /**
9
+ * The placeholder text
10
+ */
11
+ placeholder?: string;
12
+ /**
13
+ * Content before the input field
14
+ */
15
+ slotBefore?: Child;
16
+ /**
17
+ * Content after the input field
18
+ */
19
+ slotAfter?: Child;
20
+ /**
21
+ * This is called when the control value has been changed.
22
+ */
23
+ oninput?: (model: T, value: string) => void;
24
+ /**
25
+ * This is called once the control value is committed by the user.
26
+ *
27
+ * @remarks
28
+ * Unlike the `onInput` callback, this is not necessarily called for each value change.
29
+ */
30
+ onchange?: (model: T, value: string) => void;
31
+ /**
32
+ * Disables the control input
33
+ */
34
+ readonly?: boolean;
35
+ /**
36
+ *
37
+ */
38
+ type?: string;
39
+ };
40
+ export declare function uiInputWidget<T>(attrs: InputWidgetAttrs<T>, children?: Children): Vnode<InputWidgetAttrs<T>>;
41
+ export declare function uiInput<T>(attrs: InputWidgetAttrs<T>, children?: Children): Vnode<InputWidgetAttrs<T>>;
42
+ export declare const InputWidgetComponent: FactoryComponent<InputWidgetAttrs>;
43
+ export declare const InputComponent: FactoryComponent<InputWidgetAttrs>;
44
+ //# sourceMappingURL=input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/controls/input.ts"],"names":[],"mappings":"AAAA,OAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAErE,OAAO,EAAY,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAExD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,GAAG,OAAO,IAAI,gBAAgB,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG;IACxE;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAA;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAA;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAE3C;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAE5C;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAC1B,QAAQ,CAAC,EAAE,QAAQ,GAClB,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAE5B;AAED,wBAAgB,OAAO,CAAC,CAAC,EACvB,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAC1B,QAAQ,CAAC,EAAE,QAAQ,GAClB,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAE5B;AAED,eAAO,MAAM,oBAAoB,EAAE,gBAAgB,CAAC,gBAAgB,CAanE,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,gBAAgB,CAAC,gBAAgB,CA2B7D,CAAA"}
@@ -0,0 +1,58 @@
1
+ import { Children, FactoryComponent, Vnode } from 'mithril';
2
+ import { TweakableAttrs } from '../../core';
3
+ import { CommonWidgetAttrs } from '../elements';
4
+ /**
5
+ * @public
6
+ */
7
+ export type MatrixElements = number[];
8
+ export type MatrixWidgetAttrs<T = unknown> = CommonWidgetAttrs & MatrixInputAttrs<T>;
9
+ /**
10
+ * Matrix component model
11
+ * @public
12
+ */
13
+ export type MatrixInputAttrs<T = unknown> = TweakableAttrs<T, MatrixElements> & {
14
+ /**
15
+ * The number of rows in the matrix
16
+ */
17
+ rows: number;
18
+ /**
19
+ * The number of columns in the matrix
20
+ */
21
+ cols: number;
22
+ /**
23
+ * Whether the input values are ordered in row-major order. Default assumes column-major order.
24
+ */
25
+ rowMajor?: boolean;
26
+ /**
27
+ * The min value
28
+ */
29
+ min?: number;
30
+ /**
31
+ * The max value
32
+ */
33
+ max?: number;
34
+ /**
35
+ * The step value
36
+ */
37
+ step?: number;
38
+ /**
39
+ * This is called when the control value has been changed.
40
+ */
41
+ oninput?: (model: T, value: unknown) => void;
42
+ /**
43
+ * This is called once the control value is committed by the user.
44
+ *
45
+ * @remarks
46
+ * Unlike the `onInput` callback, this is not necessarily called for each value change.
47
+ */
48
+ onchange?: (model: T, value: unknown) => void;
49
+ /**
50
+ * Disables the control input
51
+ */
52
+ readonly?: boolean;
53
+ };
54
+ export declare function uiMatrixWidget<T>(attrs: MatrixWidgetAttrs<T>, children?: Children): Vnode<MatrixWidgetAttrs<T>>;
55
+ export declare const MatrixWidgetComponent: FactoryComponent<MatrixWidgetAttrs>;
56
+ export declare function uiMatrixInput<T>(attrs: MatrixInputAttrs<T>, children?: Children): Vnode<MatrixInputAttrs<T>>;
57
+ export declare const MatrixInputComponent: FactoryComponent<MatrixInputAttrs>;
58
+ //# sourceMappingURL=matrix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matrix.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/controls/matrix.ts"],"names":[],"mappings":"AAAA,OAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC9D,OAAO,EAAoC,cAAc,EAAE,MAAM,YAAY,CAAA;AAC7E,OAAO,EAAE,iBAAiB,EAAY,MAAM,aAAa,CAAA;AAGzD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,EAAE,CAAA;AACrC,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,OAAO,IAAI,iBAAiB,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAA;AAEpF;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,GAAG,OAAO,IAAI,cAAc,CAAC,CAAC,EAAE,cAAc,CAAC,GAAG;IAC9E;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IAC5C;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IAC7C;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,wBAAgB,cAAc,CAAC,CAAC,EAC9B,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAC3B,QAAQ,CAAC,EAAE,QAAQ,GAClB,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAE7B;AAED,eAAO,MAAM,qBAAqB,EAAE,gBAAgB,CAAC,iBAAiB,CAarE,CAAA;AACD,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAC1B,QAAQ,CAAC,EAAE,QAAQ,GAClB,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAE5B;AAED,eAAO,MAAM,oBAAoB,EAAE,gBAAgB,CAAC,gBAAgB,CAoDnE,CAAA"}
@@ -1,48 +1,42 @@
1
- import { ComponentModel, ValueSource, ComponentAttrs } from '../../core';
2
- /**
3
- * Point component attributes
4
- * @public
5
- */
6
- export declare type PointAttrs = ComponentAttrs<PointModel>;
7
- /**
8
- * Point component model
9
- * @public
10
- */
11
- export interface PointModel<T = unknown> extends ComponentModel, ValueSource<T, any> {
12
- /**
13
- * The type name of the control
14
- */
15
- type: 'point';
16
- /**
17
- * The object field names. Defaults to `['x', 'y']`
18
- */
19
- keys?: string[];
20
- /**
21
- * X-Axis min and max valuse
22
- */
23
- xRange?: [number, number];
24
- /**
25
- * Y-Axis min and max valuse
26
- */
27
- yRange?: [number, number];
28
- /**
29
- * Value to reset to when released
30
- */
31
- reset?: [number, number];
32
- /**
33
- * Snap to grid value
34
- */
35
- snap?: number;
36
- /**
37
- * This is called when the control value has been changed.
38
- */
39
- onInput?: (model: PointModel<T>, value: number) => void;
40
- /**
41
- * This is called once the control value is committed by the user.
42
- *
43
- * @remarks
44
- * Unlike the `onInput` callback, this is not necessarily called for each value change.
45
- */
46
- onChange?: (model: PointModel<T>, value: number) => void;
47
- }
1
+ import { Children, FactoryComponent, Vnode } from 'mithril';
2
+ import { ValueWidgetAttrs } from '../elements';
3
+ /**
4
+ * Point component model
5
+ * @public
6
+ */
7
+ export type PointAttrs<T = unknown> = ValueWidgetAttrs<T, any> & {
8
+ /**
9
+ * The object field names. Defaults to `['x', 'y']`
10
+ */
11
+ keys?: string[];
12
+ /**
13
+ * X-Axis min and max valuse
14
+ */
15
+ rangeX?: [number, number];
16
+ /**
17
+ * Y-Axis min and max valuse
18
+ */
19
+ rangeY?: [number, number];
20
+ /**
21
+ * Value to reset to when released
22
+ */
23
+ reset?: [number, number];
24
+ /**
25
+ * Snap to grid value
26
+ */
27
+ snap?: number;
28
+ /**
29
+ * This is called when the control value has been changed.
30
+ */
31
+ oninput?: (model: PointAttrs<T>, value: number) => void;
32
+ /**
33
+ * This is called once the control value is committed by the user.
34
+ *
35
+ * @remarks
36
+ * Unlike the `onInput` callback, this is not necessarily called for each value change.
37
+ */
38
+ onchange?: (model: PointAttrs<T>, value: number) => void;
39
+ };
40
+ export declare function uiPoint<T>(attrs: PointAttrs<T>, children?: Children): Vnode<PointAttrs<T>>;
41
+ export declare const PointComponent: FactoryComponent<PointAttrs>;
48
42
  //# sourceMappingURL=point.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/controls/point.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAG7F;;;GAGG;AACH,oBAAY,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,GAAG,CAAC;IAClF;;OAEG;IACH,IAAI,EAAE,OAAO,CAAA;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,MAAM,E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D;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACzD,CAAA;AAKD,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAE1F;AAED,eAAO,MAAM,cAAc,EAAE,gBAAgB,CAAC,UAAU,CAqJvD,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { Children, FactoryComponent, Vnode } from 'mithril';
2
+ import { TweakableAttrs } from '../../core';
3
+ import { CommonWidgetAttrs } from '../elements';
4
+ export type PollWidgetAttrs<T = unknown> = CommonWidgetAttrs & PollAttrs<T>;
5
+ export type PollAttrs<T = unknown> = TweakableAttrs<T, string | number | boolean> & {
6
+ interval?: number;
7
+ };
8
+ export declare function uiPollWidget<T>(attrs: PollWidgetAttrs<T>, children?: Children): Vnode<PollWidgetAttrs<T>>;
9
+ export declare function uiPoll<T>(attrs: PollAttrs<T>, children?: Children): Vnode<PollAttrs<T>>;
10
+ export declare const PollWidgetComponent: FactoryComponent<PollWidgetAttrs>;
11
+ export declare const PollComponent: FactoryComponent<PollWidgetAttrs>;
12
+ //# sourceMappingURL=poll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"poll.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/controls/poll.ts"],"names":[],"mappings":"AAAA,OAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC9D,OAAO,EAAmB,cAAc,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAY,MAAM,aAAa,CAAA;AAEzD,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,OAAO,IAAI,iBAAiB,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA;AAE3E,MAAM,MAAM,SAAS,CAAC,CAAC,GAAG,OAAO,IAAI,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG;IAClF,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,wBAAgB,YAAY,CAAC,CAAC,EAC5B,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,EACzB,QAAQ,CAAC,EAAE,QAAQ,GAClB,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAE3B;AAED,wBAAgB,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAEvF;AAED,eAAO,MAAM,mBAAmB,EAAE,gBAAgB,CAAC,eAAe,CAajE,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,gBAAgB,CAAC,eAAe,CAsB3D,CAAA"}