@adcops/autocore-react 3.0.1 → 3.0.4

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 (292) hide show
  1. package/dist/assets/BlocklyLogo.d.ts +3 -0
  2. package/dist/assets/BlocklyLogo.js +1 -0
  3. package/dist/assets/Distance.d.ts +3 -0
  4. package/dist/assets/Distance.js +1 -0
  5. package/dist/assets/JogLong.d.ts +3 -0
  6. package/dist/assets/JogLong.js +1 -0
  7. package/dist/assets/JogMedium.d.ts +3 -0
  8. package/dist/assets/JogMedium.js +1 -0
  9. package/dist/assets/JogShort.d.ts +3 -0
  10. package/dist/assets/JogShort.js +1 -0
  11. package/dist/assets/PythonLogo.d.ts +3 -0
  12. package/dist/assets/PythonLogo.js +1 -0
  13. package/dist/assets/Rotation3D.d.ts +3 -0
  14. package/dist/assets/Rotation3D.js +1 -0
  15. package/dist/assets/RotationCcw.d.ts +3 -0
  16. package/dist/assets/RotationCcw.js +1 -0
  17. package/dist/assets/RotationCcwA.d.ts +3 -0
  18. package/dist/assets/RotationCcwA.js +1 -0
  19. package/dist/assets/RotationCcwB.d.ts +3 -0
  20. package/dist/assets/RotationCcwB.js +1 -0
  21. package/dist/assets/RotationCcwC.d.ts +3 -0
  22. package/dist/assets/RotationCcwC.js +1 -0
  23. package/dist/assets/RotationCw.d.ts +3 -0
  24. package/dist/assets/RotationCw.js +1 -0
  25. package/dist/assets/RotationCwA.d.ts +3 -0
  26. package/dist/assets/RotationCwA.js +1 -0
  27. package/dist/assets/RotationCwB.d.ts +3 -0
  28. package/dist/assets/RotationCwB.js +1 -0
  29. package/dist/assets/RotationCwC.d.ts +3 -0
  30. package/dist/assets/RotationCwC.js +1 -0
  31. package/dist/assets/Run.d.ts +3 -0
  32. package/dist/assets/Run.js +1 -0
  33. package/dist/assets/Speed.d.ts +3 -0
  34. package/dist/assets/Speed.js +1 -0
  35. package/dist/assets/SpeedFast.d.ts +3 -0
  36. package/dist/assets/SpeedFast.js +1 -0
  37. package/dist/assets/SpeedMedium.d.ts +3 -0
  38. package/dist/assets/SpeedMedium.js +1 -0
  39. package/dist/assets/SpeedNone.d.ts +3 -0
  40. package/dist/assets/SpeedNone.js +1 -0
  41. package/dist/assets/SpeedSlow.d.ts +3 -0
  42. package/dist/assets/SpeedSlow.js +1 -0
  43. package/dist/assets/Walk.d.ts +3 -0
  44. package/dist/assets/Walk.js +1 -0
  45. package/dist/assets/index.d.ts +22 -0
  46. package/dist/assets/index.js +1 -0
  47. package/dist/assets/svg/blockly_logo.svg +82 -0
  48. package/dist/assets/svg/distance.svg +40 -0
  49. package/dist/assets/svg/jog_long.svg +1 -0
  50. package/dist/assets/svg/jog_medium.svg +1 -0
  51. package/dist/assets/svg/jog_short.svg +1 -0
  52. package/dist/assets/svg/python_logo.svg +246 -0
  53. package/dist/assets/svg/rotation_3d.svg +1 -0
  54. package/dist/assets/svg/rotation_ccw.svg +50 -0
  55. package/dist/assets/svg/rotation_ccw_a.svg +57 -0
  56. package/dist/assets/svg/rotation_ccw_b.svg +57 -0
  57. package/dist/assets/svg/rotation_ccw_c.svg +57 -0
  58. package/dist/assets/svg/rotation_cw.svg +49 -0
  59. package/dist/assets/svg/rotation_cw_a.svg +30 -0
  60. package/dist/assets/svg/rotation_cw_b.svg +30 -0
  61. package/dist/assets/svg/rotation_cw_c.svg +30 -0
  62. package/dist/assets/svg/run.svg +1 -0
  63. package/dist/assets/svg/speed.svg +39 -0
  64. package/dist/assets/svg/speed_fast.svg +1 -0
  65. package/dist/assets/svg/speed_medium.svg +1 -0
  66. package/dist/assets/svg/speed_none.svg +1 -0
  67. package/dist/assets/svg/speed_slow.svg +1 -0
  68. package/dist/assets/svg/walk.svg +1 -0
  69. package/dist/components/BlocklyEditor.css +25 -0
  70. package/dist/components/BlocklyEditor.d.ts +120 -0
  71. package/dist/components/BlocklyEditor.js +1 -0
  72. package/dist/components/CodeEditor.d.ts +76 -0
  73. package/dist/components/CodeEditor.js +1 -0
  74. package/dist/components/Indicator.d.ts +12 -27
  75. package/dist/components/Indicator.js +1 -1
  76. package/dist/components/IndicatorButton.d.ts +56 -37
  77. package/dist/components/IndicatorButton.js +1 -1
  78. package/dist/components/JogPanel.css +41 -0
  79. package/dist/components/JogPanel.d.ts +118 -0
  80. package/dist/components/JogPanel.js +1 -0
  81. package/dist/components/Lamp.d.ts +81 -0
  82. package/dist/components/Lamp.js +1 -0
  83. package/dist/components/ToggleGroup.d.ts +103 -0
  84. package/dist/components/ToggleGroup.js +1 -0
  85. package/dist/components/ValueInput.d.ts +109 -0
  86. package/dist/components/ValueInput.js +1 -0
  87. package/dist/core/ActionMode.d.ts +9 -0
  88. package/dist/core/ActionMode.js +1 -0
  89. package/dist/core/IndicatorButtonState.d.ts +21 -0
  90. package/dist/core/IndicatorButtonState.js +1 -0
  91. package/dist/core/MaskPatterns.d.ts +4 -0
  92. package/dist/core/MaskPatterns.js +1 -1
  93. package/docs/assets/highlight.css +25 -18
  94. package/docs/assets/navigation.js +1 -1
  95. package/docs/assets/search.js +1 -1
  96. package/docs/classes/components_BlocklyEditor.BlocklyEditor.html +124 -0
  97. package/docs/classes/components_CodeEditor.CodeEditor.html +128 -0
  98. package/docs/classes/components_Indicator.Indicator.html +8 -8
  99. package/docs/classes/components_IndicatorButton.IndicatorButton.html +17 -17
  100. package/docs/classes/components_JogPanel.JogPanel.html +138 -0
  101. package/docs/classes/components_Lamp.Lamp.html +105 -0
  102. package/docs/classes/components_OskDialog.OskDialog.html +5 -5
  103. package/docs/classes/components_ToggleGroup.ToggleGroup.html +118 -0
  104. package/docs/classes/components_ValueDisplay.ValueDisplay.html +4 -4
  105. package/docs/classes/components_ValueInput.ValueInput.html +115 -0
  106. package/docs/classes/core_ValueSimulator.ValueSimulator.html +2 -2
  107. package/docs/classes/hub_HubBase.HubBase.html +4 -4
  108. package/docs/classes/hub_HubSimulate.HubSimulate.html +2 -2
  109. package/docs/classes/hub_HubSocketIo.HubSocketIo.html +5 -5
  110. package/docs/classes/hub_HubTauri.HubTauri.html +5 -5
  111. package/docs/enums/components_JogPanel.JogDistanceAction.html +5 -0
  112. package/docs/enums/components_JogPanel.JogPanelAction.html +18 -0
  113. package/docs/enums/components_JogPanel.JogSpeedAction.html +5 -0
  114. package/docs/enums/core_ActionMode.ActionMode.html +6 -0
  115. package/docs/enums/core_IndicatorColor.IndicatorColor.html +23 -0
  116. package/docs/functions/assets_BlocklyLogo.default.html +1 -0
  117. package/docs/functions/assets_Distance.default.html +1 -0
  118. package/docs/functions/assets_JogLong.default.html +1 -0
  119. package/docs/functions/assets_JogMedium.default.html +1 -0
  120. package/docs/functions/assets_JogShort.default.html +1 -0
  121. package/docs/functions/assets_PythonLogo.default.html +1 -0
  122. package/docs/functions/assets_Rotation3D.default.html +1 -0
  123. package/docs/functions/assets_RotationCcw.default.html +1 -0
  124. package/docs/functions/assets_RotationCcwA.default.html +1 -0
  125. package/docs/functions/assets_RotationCcwB.default.html +1 -0
  126. package/docs/functions/assets_RotationCcwC.default.html +1 -0
  127. package/docs/functions/assets_RotationCw.default.html +1 -0
  128. package/docs/functions/assets_RotationCwA.default.html +1 -0
  129. package/docs/functions/assets_RotationCwB.default.html +1 -0
  130. package/docs/functions/assets_RotationCwC.default.html +1 -0
  131. package/docs/functions/assets_Run.default.html +1 -0
  132. package/docs/functions/assets_Speed.default.html +1 -0
  133. package/docs/functions/assets_SpeedFast.default.html +1 -0
  134. package/docs/functions/assets_SpeedMedium.default.html +1 -0
  135. package/docs/functions/assets_SpeedNone.default.html +1 -0
  136. package/docs/functions/assets_SpeedSlow.default.html +1 -0
  137. package/docs/functions/assets_Walk.default.html +1 -0
  138. package/docs/functions/components_BlocklyEditor.createCustomToolbox.html +6 -0
  139. package/docs/functions/components_Osk.Osk.html +2 -2
  140. package/docs/functions/core_EventEmitterContext.EventEmitterProvider.html +2 -2
  141. package/docs/functions/core_UniqueId.UniqueId.html +2 -2
  142. package/docs/functions/core_hoc.hocAddSubscription.html +2 -2
  143. package/docs/functions/hub.createHub.html +2 -2
  144. package/docs/hierarchy.html +1 -1
  145. package/docs/index.html +18 -2
  146. package/docs/interfaces/components_IndicatorButton.IndicatorButtonProps.html +160 -132
  147. package/docs/interfaces/components_JogPanel.JogPanelButtonDefinition.html +5 -0
  148. package/docs/interfaces/components_ToggleGroup.ToggleGroupProps.html +636 -0
  149. package/docs/interfaces/core_EventEmitterContext.Action.html +2 -2
  150. package/docs/interfaces/core_EventEmitterContext.EventEmitterContextType.html +2 -2
  151. package/docs/interfaces/core_EventEmitterContext.State.html +2 -2
  152. package/docs/interfaces/core_EventEmitterContext.Subscription.html +2 -2
  153. package/docs/interfaces/core_IndicatorButtonState.IndicatorButtonState.html +10 -0
  154. package/docs/interfaces/core_PositionContext.IPositionContext.html +2 -2
  155. package/docs/modules/assets.html +23 -0
  156. package/docs/modules/assets_BlocklyLogo.html +2 -0
  157. package/docs/modules/assets_Distance.html +2 -0
  158. package/docs/modules/assets_JogLong.html +2 -0
  159. package/docs/modules/assets_JogMedium.html +2 -0
  160. package/docs/modules/assets_JogShort.html +2 -0
  161. package/docs/modules/assets_PythonLogo.html +2 -0
  162. package/docs/modules/assets_Rotation3D.html +2 -0
  163. package/docs/modules/assets_RotationCcw.html +2 -0
  164. package/docs/modules/assets_RotationCcwA.html +2 -0
  165. package/docs/modules/assets_RotationCcwB.html +2 -0
  166. package/docs/modules/assets_RotationCcwC.html +2 -0
  167. package/docs/modules/assets_RotationCw.html +2 -0
  168. package/docs/modules/assets_RotationCwA.html +2 -0
  169. package/docs/modules/assets_RotationCwB.html +2 -0
  170. package/docs/modules/assets_RotationCwC.html +2 -0
  171. package/docs/modules/assets_Run.html +2 -0
  172. package/docs/modules/assets_Speed.html +2 -0
  173. package/docs/modules/assets_SpeedFast.html +2 -0
  174. package/docs/modules/assets_SpeedMedium.html +2 -0
  175. package/docs/modules/assets_SpeedNone.html +2 -0
  176. package/docs/modules/assets_SpeedSlow.html +2 -0
  177. package/docs/modules/assets_Walk.html +2 -0
  178. package/docs/modules/components_BlocklyEditor.html +5 -0
  179. package/docs/modules/components_CodeEditor.html +3 -0
  180. package/docs/modules/components_Indicator.html +2 -2
  181. package/docs/modules/components_IndicatorButton.html +4 -4
  182. package/docs/modules/components_JogPanel.html +9 -0
  183. package/docs/modules/components_Lamp.html +4 -0
  184. package/docs/modules/components_Osk.html +2 -2
  185. package/docs/modules/components_OskDialog.html +2 -2
  186. package/docs/modules/components_ToggleGroup.html +5 -0
  187. package/docs/modules/components_ValueDisplay.html +2 -2
  188. package/docs/modules/components_ValueInput.html +2 -0
  189. package/docs/modules/core_ActionMode.html +2 -0
  190. package/docs/modules/core_EventEmitterContext.html +2 -2
  191. package/docs/modules/{components_IndicatorColor.html → core_IndicatorButtonState.html} +2 -2
  192. package/docs/modules/core_IndicatorColor.html +2 -0
  193. package/docs/modules/core_MaskPatterns.html +2 -2
  194. package/docs/modules/core_NumerableTypes.html +2 -2
  195. package/docs/modules/core_PositionContext.html +2 -2
  196. package/docs/modules/core_UniqueId.html +2 -2
  197. package/docs/modules/core_ValueSimulator.html +2 -2
  198. package/docs/modules/core_hoc.html +2 -2
  199. package/docs/modules/hub.html +2 -2
  200. package/docs/modules/hub_HubBase.html +2 -2
  201. package/docs/modules/hub_HubSimulate.html +2 -2
  202. package/docs/modules/hub_HubSocketIo.html +2 -2
  203. package/docs/modules/hub_HubTauri.html +2 -2
  204. package/docs/types/components_IndicatorButton.IndicatorButtonOptionsType.html +1 -0
  205. package/docs/types/core_EventEmitterContext.EmitterDispatchFunction.html +2 -2
  206. package/docs/types/core_EventEmitterContext.EmitterSubscribeFunction.html +2 -2
  207. package/docs/types/core_EventEmitterContext.EmitterUnsubscribeFunction.html +2 -2
  208. package/docs/types/core_NumerableTypes.NumerableFormatOptions.html +2 -2
  209. package/docs/types/core_hoc.HocAddSubscriptionProps.html +2 -2
  210. package/docs/variables/components_BlocklyEditor.StandardToolbox.html +1 -0
  211. package/docs/variables/components_JogPanel.DefaultLinearJogButtons.html +2 -0
  212. package/docs/variables/components_JogPanel.DefaultRotationJogButtons.html +2 -0
  213. package/docs/variables/core_EventEmitterContext.EventEmitterContext.html +6 -6
  214. package/docs/variables/core_MaskPatterns.PrimeReactMaskPatterns.html +2 -2
  215. package/docs/variables/core_MaskPatterns.RegExMaskPatterns.html +3 -2
  216. package/docs/variables/core_PositionContext.DimensionsContext.html +2 -2
  217. package/package.json +8 -4
  218. package/readme.md +33 -0
  219. package/src/assets/BlocklyLogo.tsx +27 -0
  220. package/src/assets/Distance.tsx +18 -0
  221. package/src/assets/JogLong.tsx +13 -0
  222. package/src/assets/JogMedium.tsx +13 -0
  223. package/src/assets/JogShort.tsx +13 -0
  224. package/src/assets/PythonLogo.tsx +83 -0
  225. package/src/assets/Rotation3D.tsx +13 -0
  226. package/src/assets/RotationCcw.tsx +33 -0
  227. package/src/assets/RotationCcwA.tsx +45 -0
  228. package/src/assets/RotationCcwB.tsx +45 -0
  229. package/src/assets/RotationCcwC.tsx +45 -0
  230. package/src/assets/RotationCw.tsx +31 -0
  231. package/src/assets/RotationCwA.tsx +42 -0
  232. package/src/assets/RotationCwB.tsx +42 -0
  233. package/src/assets/RotationCwC.tsx +42 -0
  234. package/src/assets/Run.tsx +13 -0
  235. package/src/assets/Speed.tsx +18 -0
  236. package/src/assets/SpeedFast.tsx +13 -0
  237. package/src/assets/SpeedMedium.tsx +13 -0
  238. package/src/assets/SpeedNone.tsx +13 -0
  239. package/src/assets/SpeedSlow.tsx +13 -0
  240. package/src/assets/Walk.tsx +13 -0
  241. package/src/assets/index.ts +22 -0
  242. package/src/assets/svg/blockly_logo.svg +82 -0
  243. package/src/assets/svg/distance.svg +40 -0
  244. package/src/assets/svg/jog_long.svg +1 -0
  245. package/src/assets/svg/jog_medium.svg +1 -0
  246. package/src/assets/svg/jog_short.svg +1 -0
  247. package/src/assets/svg/python_logo.svg +246 -0
  248. package/src/assets/svg/rotation_3d.svg +1 -0
  249. package/src/assets/svg/rotation_ccw.svg +50 -0
  250. package/src/assets/svg/rotation_ccw_a.svg +57 -0
  251. package/src/assets/svg/rotation_ccw_b.svg +57 -0
  252. package/src/assets/svg/rotation_ccw_c.svg +57 -0
  253. package/src/assets/svg/rotation_cw.svg +49 -0
  254. package/src/assets/svg/rotation_cw_a.svg +30 -0
  255. package/src/assets/svg/rotation_cw_b.svg +30 -0
  256. package/src/assets/svg/rotation_cw_c.svg +30 -0
  257. package/src/assets/svg/run.svg +1 -0
  258. package/src/assets/svg/speed.svg +39 -0
  259. package/src/assets/svg/speed_fast.svg +1 -0
  260. package/src/assets/svg/speed_medium.svg +1 -0
  261. package/src/assets/svg/speed_none.svg +1 -0
  262. package/src/assets/svg/speed_slow.svg +1 -0
  263. package/src/assets/svg/walk.svg +1 -0
  264. package/src/components/BlocklyEditor.css +25 -0
  265. package/src/components/BlocklyEditor.tsx +598 -0
  266. package/src/components/CodeEditor.tsx +156 -0
  267. package/src/components/Indicator.tsx +63 -118
  268. package/src/components/IndicatorButton.tsx +104 -50
  269. package/src/components/JogPanel.css +41 -0
  270. package/src/components/JogPanel.tsx +461 -0
  271. package/src/components/Lamp.tsx +243 -0
  272. package/src/components/ToggleGroup.tsx +429 -0
  273. package/src/components/ValueInput.tsx +261 -0
  274. package/src/core/ActionMode.ts +20 -0
  275. package/src/core/IndicatorButtonState.ts +34 -0
  276. package/src/core/MaskPatterns.ts +7 -1
  277. package/tools/copy-distribution-files.cjs +3 -2
  278. package/dist/components/DPad.css +0 -522
  279. package/dist/components/DPad.d.ts +0 -34
  280. package/dist/components/DPad.js +0 -1
  281. package/docs/enums/components_DPad.VcJoyPadAction.html +0 -10
  282. package/docs/enums/components_DPad.VcJoyPadButtonId.html +0 -7
  283. package/docs/enums/components_IndicatorButton.ActionMode.html +0 -6
  284. package/docs/enums/components_IndicatorColor.IndicatorColor.html +0 -23
  285. package/docs/functions/components_DPad.VcDPad.html +0 -5
  286. package/docs/interfaces/components_IndicatorButton.IndicatorButtonState.html +0 -10
  287. package/docs/modules/components_DPad.html +0 -5
  288. package/src/components/DPad.css +0 -522
  289. package/src/components/DPad.tsx +0 -94
  290. /package/dist/{components → core}/IndicatorColor.d.ts +0 -0
  291. /package/dist/{components → core}/IndicatorColor.js +0 -0
  292. /package/src/{components → core}/IndicatorColor.ts +0 -0
@@ -0,0 +1,118 @@
1
+ import React from 'react';
2
+ import './JogPanel.css';
3
+ /**
4
+ * Enumerates the source button or action when an event occurs.
5
+ */
6
+ export declare enum JogPanelAction {
7
+ /** Invalid - Ignore this button */
8
+ Invalid = 0,
9
+ xPositive = 1,
10
+ xNegative = 2,
11
+ yPositive = 3,
12
+ yNegative = 4,
13
+ zPositive = 5,
14
+ zNegative = 6,
15
+ aPositive = 7,
16
+ aNegative = 8,
17
+ bPositive = 9,
18
+ bNegative = 16,
19
+ cPositive = 17,
20
+ cNegative = 18,
21
+ /** Stop, clear or reset */
22
+ Stop = 255
23
+ }
24
+ /**
25
+ * Enumerates the selected jog distance.
26
+ */
27
+ export declare enum JogDistanceAction {
28
+ Short = 0,
29
+ Medium = 16,
30
+ Long = 32
31
+ }
32
+ /**
33
+ * Enumerates the selected jog distance.
34
+ */
35
+ export declare enum JogSpeedAction {
36
+ Slow = 0,
37
+ Medium = 16,
38
+ Fast = 32
39
+ }
40
+ /**
41
+ * Jog button definition type for defining the button in the JogPanel.
42
+ */
43
+ export interface JogPanelButtonDefinition {
44
+ icon: string;
45
+ alt: string;
46
+ action: JogPanelAction;
47
+ }
48
+ /**
49
+ * Component properties of the directional pad.
50
+ */
51
+ interface JogPanelProps {
52
+ onClicked?: (action: JogPanelAction) => void;
53
+ onJogDistanceChanged?: (action: JogDistanceAction) => void;
54
+ onJogSpeedChanged?: (action: JogSpeedAction) => void;
55
+ buttonDefinitions: (JogPanelButtonDefinition | undefined)[][] | undefined;
56
+ defaultJogDistance: JogDistanceAction;
57
+ defaultJogSpeed: JogSpeedAction;
58
+ showDistanceControl: boolean;
59
+ showSpeedControl: boolean;
60
+ }
61
+ interface JogPanelState {
62
+ jogDistance: JogDistanceAction;
63
+ jogSpeed: JogSpeedAction;
64
+ }
65
+ /**
66
+ * A default jog button configuration for linear 3D motion.
67
+ */
68
+ export declare const DefaultLinearJogButtons: (JogPanelButtonDefinition | undefined)[][];
69
+ /**
70
+ * A default jog button configuration for rotational 3D motion.
71
+ */
72
+ export declare const DefaultRotationJogButtons: (JogPanelButtonDefinition | undefined)[][];
73
+ /**
74
+ * Jogging panel that supports 3D motion. In 3D:
75
+ * - Z is Up and Down,
76
+ * - Y is towards and away
77
+ * - X is left and right
78
+ *
79
+ * This Jog Panel is based upon a standard CNC mill and industrial standards.
80
+ *
81
+ * ## Parameters
82
+ * @param onClicked Callback any time a button is clicked. Includes argument for direction.
83
+ * @param buttonDefinitions A 3x3 matrix of (JogPanelButtonDefinition | undefined) that defines the button. If a button is undefined, it is disabled.
84
+ *
85
+ * ## Button definitions
86
+ *
87
+ * Example:
88
+ * ```
89
+ * export const kDefaultButtonDefinitions : (JogPanelButtonDefinition | undefined)[][] = [
90
+ * [{ icon: "pi pi-arrow-up-left", action: JogPanelAction.yPositive, alt: "Y Positive" }, { icon: "pi pi-arrow-up", action: JogPanelAction.zPositive, alt: "Z Positive" }, undefined],
91
+ * [{ icon: "pi pi-arrow-left", action: JogPanelAction.xNegative, alt: "X Negative" }, undefined, { icon: "pi pi-arrow-right", action: JogPanelAction.xPositive, alt: "X Positive" }],
92
+ * [undefined, { icon: "pi pi-arrow-down", action: JogPanelAction.zNegative, alt: "Z Negative" }, { icon: "pi pi-arrow-down-right", action: JogPanelAction.yNegative, alt: "Y Negative" }],
93
+ * ];
94
+ * ```
95
+ *
96
+ */
97
+ export declare class JogPanel extends React.Component<JogPanelProps, JogPanelState> {
98
+ static defaultProps: JogPanelProps;
99
+ private jogDistanceItems;
100
+ private jogSpeedItems;
101
+ constructor(props: JogPanelProps);
102
+ /**
103
+ * Handle a user action on the DirectionalPad
104
+ * @param action DirectionalPadAction
105
+ */
106
+ private handleClicked;
107
+ /**
108
+ * The user has selected a different jog distance.
109
+ * @param {JogDistanceAction} action The newly-selected distance.
110
+ */
111
+ private handleDistanceChanged;
112
+ private handleSpeedChanged;
113
+ emptyRow(): import("react/jsx-runtime").JSX.Element;
114
+ private actionToIcon;
115
+ standardButton(row: number, col: number): import("react/jsx-runtime").JSX.Element;
116
+ render(): import("react/jsx-runtime").JSX.Element;
117
+ }
118
+ export default JogPanel;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import React from"react";import{Button}from"primereact/button";import{SelectButton}from"primereact/selectbutton";import{Tooltip}from"primereact/tooltip";import"./JogPanel.css";import{Distance,JogShort,JogMedium,JogLong}from"../assets";import{Speed,SpeedSlow,SpeedMedium,SpeedFast}from"../assets";import{RotationCcwA,RotationCcwB,RotationCcwC}from"../assets";import{RotationCwA,RotationCwB,RotationCwC}from"../assets";export var JogPanelAction;!function(t){t[t.Invalid=0]="Invalid",t[t.xPositive=1]="xPositive",t[t.xNegative=2]="xNegative",t[t.yPositive=3]="yPositive",t[t.yNegative=4]="yNegative",t[t.zPositive=5]="zPositive",t[t.zNegative=6]="zNegative",t[t.aPositive=7]="aPositive",t[t.aNegative=8]="aNegative",t[t.bPositive=9]="bPositive",t[t.bNegative=16]="bNegative",t[t.cPositive=17]="cPositive",t[t.cNegative=18]="cNegative",t[t.Stop=255]="Stop"}(JogPanelAction||(JogPanelAction={}));export var JogDistanceAction;!function(t){t[t.Short=0]="Short",t[t.Medium=16]="Medium",t[t.Long=32]="Long"}(JogDistanceAction||(JogDistanceAction={}));export var JogSpeedAction;!function(t){t[t.Slow=0]="Slow",t[t.Medium=16]="Medium",t[t.Fast=32]="Fast"}(JogSpeedAction||(JogSpeedAction={}));export const DefaultLinearJogButtons=[[{icon:"pi pi-arrow-up-left",action:JogPanelAction.yPositive,alt:"Y Positive"},{icon:"pi pi-arrow-up",action:JogPanelAction.zPositive,alt:"Z Positive"},void 0],[{icon:"pi pi-arrow-left",action:JogPanelAction.xNegative,alt:"X Negative"},void 0,{icon:"pi pi-arrow-right",action:JogPanelAction.xPositive,alt:"X Positive"}],[void 0,{icon:"pi pi-arrow-down",action:JogPanelAction.zNegative,alt:"Z Negative"},{icon:"pi pi-arrow-down-right",action:JogPanelAction.yNegative,alt:"Y Negative"}]];export const DefaultRotationJogButtons=[[{icon:"pi",action:JogPanelAction.bPositive,alt:"Rot B Positive"},{icon:"pi",action:JogPanelAction.cPositive,alt:"Rot C Positive"},void 0],[{icon:"pi",action:JogPanelAction.aNegative,alt:"Rot A Negative"},void 0,{icon:"pi",action:JogPanelAction.aPositive,alt:"Rot A Positive"}],[void 0,{icon:"pi",action:JogPanelAction.cNegative,alt:"Rot C Negative"},{icon:"pi ",action:JogPanelAction.bNegative,alt:"Rot B Negative"}]];export class JogPanel extends React.Component{constructor(t){super(t),Object.defineProperty(this,"jogDistanceItems",{enumerable:!0,configurable:!0,writable:!0,value:[{name:"S",value:JogDistanceAction.Short},{name:"M",value:JogDistanceAction.Medium},{name:"L",value:JogDistanceAction.Long}]}),Object.defineProperty(this,"jogSpeedItems",{enumerable:!0,configurable:!0,writable:!0,value:[{name:"S",value:JogSpeedAction.Slow},{name:"M",value:JogSpeedAction.Medium},{name:"F",value:JogSpeedAction.Fast}]}),this.state={jogDistance:t.defaultJogDistance,jogSpeed:t.defaultJogSpeed}}handleClicked(t){null!=t&&this.props.onClicked&&this.props.onClicked(t)}handleDistanceChanged(t){this.setState({jogDistance:t}),this.props.onJogDistanceChanged&&this.props.onJogDistanceChanged(t)}handleSpeedChanged(t){this.setState({jogSpeed:t}),this.props.onJogSpeedChanged&&this.props.onJogSpeedChanged(t)}emptyRow(){return _jsxs("div",{className:"grid-row",children:[_jsx("div",{className:"button-item empty-slot"}),_jsx("div",{className:"button-item empty-slot"}),_jsx("div",{className:"button-item empty-slot"})]})}actionToIcon(t){return t==JogPanelAction.Invalid||t==JogPanelAction.Stop?_jsx("i",{}):t==JogPanelAction.xNegative?_jsx("i",{className:"pi pi-arrow-left"}):t==JogPanelAction.xPositive?_jsx("i",{className:"pi pi-arrow-right"}):t==JogPanelAction.yNegative?_jsx("i",{className:"pi pi-arrow-up-left"}):t==JogPanelAction.yPositive?_jsx("i",{className:"pi pi-arrow-down-right"}):t==JogPanelAction.zNegative?_jsx("i",{className:"pi pi-up"}):t==JogPanelAction.zPositive?_jsx("i",{className:"pi pi-down"}):t==JogPanelAction.aNegative?_jsx(RotationCcwA,{}):t==JogPanelAction.aPositive?_jsx(RotationCwA,{}):t==JogPanelAction.bNegative?_jsx(RotationCcwB,{}):t==JogPanelAction.bPositive?_jsx(RotationCwB,{}):t==JogPanelAction.cNegative?_jsx(RotationCcwC,{}):t==JogPanelAction.cPositive?_jsx(RotationCwC,{}):_jsx("i",{})}standardButton(t,i){if(void 0!==this.props.buttonDefinitions&&void 0!==this.props.buttonDefinitions[t]&&void 0!==this.props.buttonDefinitions[t][i]&&void 0!==this.props.buttonDefinitions[t][i]?.action){const o=this.props.buttonDefinitions[t][i]?.action;return void 0!==o&&o<JogPanelAction.aPositive?_jsx(Button,{icon:this.props.buttonDefinitions[t][i]?.icon,tooltip:this.props.buttonDefinitions[t][i]?.alt,onClick:()=>this.handleClicked(o),className:"button-item"},`${t}-${i}`):_jsx(Button,{tooltip:this.props.buttonDefinitions[t][i]?.alt,onClick:()=>this.handleClicked(o),className:"button-item",icon:()=>this.actionToIcon(o)},`${t}-${i}`)}return _jsx(Button,{icon:"pi",disabled:!0,className:"button-item empty-slot"},`${t}-${i}`)}render(){return _jsxs("div",{className:"jogpanel-container",children:[_jsx(Tooltip,{target:".distance-selector-button"}),_jsxs("div",{className:"grid-container",children:[_jsxs("div",{className:"grid-row",children:[this.standardButton(0,0),this.standardButton(0,1),this.standardButton(0,2)]},"0"),_jsxs("div",{className:"grid-row",children:[this.standardButton(1,0),this.standardButton(1,1),this.standardButton(1,2)]},"1"),_jsxs("div",{className:"grid-row",children:[this.standardButton(2,0),this.standardButton(2,1),this.standardButton(2,2)]},"2")]}),this.props.showDistanceControl&&_jsxs("div",{className:"distance-selector p-inputgroup flex-1",children:[_jsx("span",{className:"p-inputgroup-addon",children:_jsx(Distance,{width:16,height:16,fill:"white"})}),_jsx(SelectButton,{value:this.state.jogDistance,onChange:t=>this.handleDistanceChanged(t.value),optionLabel:"name",options:this.jogDistanceItems,allowEmpty:!1,itemTemplate:t=>t.value==JogDistanceAction.Short?_jsx(JogShort,{className:"distance-selector-button",width:16,height:16,"data-pr-tooltip":"Short Distance","data-pr-position":"bottom",fill:"white"}):t.value==JogDistanceAction.Medium?_jsx(JogMedium,{className:"distance-selector-button",width:16,height:16,"data-pr-tooltip":"Medium Distance","data-pr-position":"bottom",fill:"white"}):_jsx(JogLong,{className:"distance-selector-button",width:16,height:16,"data-pr-tooltip":"Long Distance","data-pr-position":"bottom",fill:"white"})})]}),this.props.showSpeedControl&&_jsxs("div",{className:"distance-selector p-inputgroup flex-1",children:[_jsx("span",{className:"p-inputgroup-addon",children:_jsx(Speed,{width:16,height:16,fill:"white"})}),_jsx(SelectButton,{value:this.state.jogSpeed,onChange:t=>this.handleSpeedChanged(t.value),optionLabel:"name",options:this.jogSpeedItems,allowEmpty:!1,itemTemplate:t=>t.value==JogSpeedAction.Slow?_jsx(SpeedSlow,{className:"distance-selector-button",width:16,height:16,"data-pr-tooltip":"Slow Speed","data-pr-position":"bottom",fill:"white"}):t.value==JogSpeedAction.Medium?_jsx(SpeedMedium,{className:"distance-selector-button",width:16,height:16,"data-pr-tooltip":"Medium Speed","data-pr-position":"bottom",fill:"white"}):_jsx(SpeedFast,{className:"distance-selector-button",width:16,height:16,"data-pr-tooltip":"Fast Speed","data-pr-position":"bottom",fill:"white"})})]})]})}}Object.defineProperty(JogPanel,"defaultProps",{enumerable:!0,configurable:!0,writable:!0,value:{onClicked:void 0,onJogDistanceChanged:void 0,buttonDefinitions:DefaultLinearJogButtons,defaultJogDistance:JogDistanceAction.Short,defaultJogSpeed:JogSpeedAction.Medium,showDistanceControl:!0,showSpeedControl:!0}});export default JogPanel;
@@ -0,0 +1,81 @@
1
+ import React, { Component } from 'react';
2
+ import { EventEmitterContextType } from '../core/EventEmitterContext';
3
+ import { IndicatorColor } from "../core/IndicatorColor";
4
+ export { IndicatorColor };
5
+ interface LampProps {
6
+ /**
7
+ * State to be displayed<br/>
8
+ *
9
+ * Available states: **on**, **off** and **not available**:
10
+ *
11
+ * * `true` is treated as **on**
12
+ * * `false` is treated as **off**
13
+ * * `undefined` is treated as **not available**
14
+ */
15
+ value?: boolean | undefined;
16
+ /**
17
+ * X position (in pixels)
18
+ */
19
+ x?: number;
20
+ /**
21
+ * Y position (in pixels)
22
+ */
23
+ y?: number;
24
+ /**
25
+ * Width (in pixels)
26
+ */
27
+ width?: number;
28
+ /**
29
+ * Height (in pixels)<br/>
30
+ * @default width
31
+ */
32
+ height?: number;
33
+ /**
34
+ * CSS color for **enabled** state
35
+ */
36
+ onColor?: string;
37
+ /**
38
+ * CSS color for **disabled** state
39
+ */
40
+ offColor?: string;
41
+ /**
42
+ * CSS color for **not available** state
43
+ */
44
+ invalidColor?: string;
45
+ /**
46
+ * Custom class name to be attached
47
+ */
48
+ className?: string;
49
+ /**
50
+ * Enable absolute positioning for the component, allowing it to be
51
+ * placed on a specific position of its parent. This is useful when
52
+ * laying components over an image or wireframe.
53
+ */
54
+ useAbsolutePositioning?: boolean;
55
+ /**
56
+ * The topic to monitor to display. Optional.
57
+ */
58
+ topic?: string;
59
+ }
60
+ interface LampState {
61
+ subscribedValue?: boolean | null;
62
+ fontSize?: string;
63
+ }
64
+ export declare class Lamp extends Component<LampProps, LampState> {
65
+ static contextType: React.Context<EventEmitterContextType>;
66
+ protected unsubscribeTopicId: number | null;
67
+ static defaultProps: {
68
+ width: number;
69
+ height: number;
70
+ onColor: string;
71
+ offColor: string;
72
+ invalidColor: string;
73
+ useAbsolutePositioning: boolean;
74
+ };
75
+ constructor(props: LampProps);
76
+ componentDidMount(): void;
77
+ componentDidUpdate(prevProps: LampProps): void;
78
+ componentWillUnmount(): void;
79
+ render(): import("react/jsx-runtime").JSX.Element;
80
+ }
81
+ export default Lamp;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{Component}from"react";import clsx from"clsx";import{EventEmitterContext}from"../core/EventEmitterContext";import{IndicatorColor}from"../core/IndicatorColor";export{IndicatorColor};export class Lamp extends Component{constructor(e){super(e),Object.defineProperty(this,"unsubscribeTopicId",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.state={subscribedValue:e.value,fontSize:"100%"}}componentDidMount(){const{topic:e}=this.props;if(e&&null===this.unsubscribeTopicId){const{subscribe:t}=this.context;this.unsubscribeTopicId=t(e,(e=>{this.setState({subscribedValue:e})}))}}componentDidUpdate(e){e.value!==this.props.value&&this.setState({subscribedValue:this.props.value})}componentWillUnmount(){if(null!==this.unsubscribeTopicId){const{unsubscribe:e}=this.context;e(this.unsubscribeTopicId),this.unsubscribeTopicId=null}}render(){const{x:e,y:t,width:o,height:i,className:s,onColor:r,offColor:n,invalidColor:l,useAbsolutePositioning:c}=this.props,{scale:a,xOffset:u,yOffset:p}=this.context,{subscribedValue:b}=this.state;let d=o||10;d<10&&(d=10);let m=i||10;m<10&&(m=10);let h,f=a||1;switch(0===f&&(f=1),b){case!0:h=r;break;case!1:h=n;break;default:h=l}const x={position:c?"absolute":"relative",display:c?"":"inline-block",verticalAlign:"middle",top:c&&t?`${p+f*t}px`:void 0,left:c&&e?`${u+f*e}px`:void 0,width:d?d*f+"px":void 0,height:m?m*f+"px":void 0,lineHeight:m?m*f+"px":void 0,backgroundColor:h,borderRadius:"20px"};return _jsx("div",{className:clsx(s),style:x})}}Object.defineProperty(Lamp,"contextType",{enumerable:!0,configurable:!0,writable:!0,value:EventEmitterContext}),Object.defineProperty(Lamp,"defaultProps",{enumerable:!0,configurable:!0,writable:!0,value:{width:22,height:22,onColor:"green",offColor:"gray",invalidColor:"black",useAbsolutePositioning:!1}});export default Lamp;
@@ -0,0 +1,103 @@
1
+ import { Component } from 'react';
2
+ import { SelectButtonProps } from 'primereact/selectbutton';
3
+ import { EventEmitterContextType } from '../core/EventEmitterContext';
4
+ import { IndicatorColor } from "../core/IndicatorColor";
5
+ export { IndicatorColor };
6
+ import { ActionMode } from '../core/ActionMode';
7
+ export { ActionMode };
8
+ import { IndicatorButtonState } from '../core/IndicatorButtonState';
9
+ export interface ToggleGroupProps extends SelectButtonProps {
10
+ /**
11
+ * Label of the group/row. Can be any element.
12
+ *
13
+ * ## Examples
14
+ * ```
15
+ * <ToggleGroup label="Simple Text" />
16
+ * <ToggleGroup label={<span><i className="pi pi-check"></i> Icon and Text</span>} />
17
+ * <ToggleGroup label={<YourCustomIconComponent />} />
18
+ * ```
19
+ */
20
+ label?: React.ReactNode;
21
+ /**
22
+ * Topic name to monitor for state indication.
23
+ * If `value` field is not undefined, then that value is used instead.
24
+ */
25
+ topic?: string;
26
+ /**
27
+ * Color for the button when the state is TRUE.
28
+ */
29
+ onColor?: IndicatorColor | IndicatorColor[];
30
+ /**
31
+ * Color for the button when the state is FALSE.
32
+ */
33
+ offColor?: IndicatorColor;
34
+ /**
35
+ * Name of the command to invoke on button events.
36
+ * If command is "*", then the commandTopic will be dispatched
37
+ * internally.
38
+ */
39
+ command?: string;
40
+ /**
41
+ * Optional topic parameter to send along with the command.
42
+ * If set, will automatically be included with commandArgs as
43
+ * the value of field 'topic.'
44
+ */
45
+ commandTopic?: string;
46
+ /**
47
+ * Optional arguments sent with the command.
48
+ */
49
+ commandArgs?: any;
50
+ /**
51
+ * Topic to disable button interaction.
52
+ */
53
+ disableTopic?: string;
54
+ /**
55
+ * Topic to control the visibility of the button.
56
+ */
57
+ invisibleTopic?: string;
58
+ /**
59
+ * Mode of input for the button (e.g., TAP, TOGGLE).
60
+ */
61
+ actionMode?: ActionMode;
62
+ /**
63
+ * Inverts the signal values for TAP, PRESSED, and RELEASED modes.
64
+ */
65
+ invert?: boolean;
66
+ }
67
+ export declare class ToggleGroup extends Component<ToggleGroupProps, IndicatorButtonState> {
68
+ static contextType: import("react").Context<EventEmitterContextType>;
69
+ constructor(props: ToggleGroupProps);
70
+ componentDidMount(): void;
71
+ componentDidUpdate(prevProps: ToggleGroupProps): void;
72
+ componentWillUnmount(): void;
73
+ /**
74
+ * Sets up subscriptions based on provided topics.
75
+ */
76
+ private setupSubscriptions;
77
+ /**
78
+ * Handles updates for the main topic.
79
+ */
80
+ private handleTopicUpdate;
81
+ /**
82
+ * Handles updates for the disable topic.
83
+ */
84
+ private handleDisableTopicUpdate;
85
+ /**
86
+ * Handles updates for the invisible topic.
87
+ */
88
+ private handleInvisibleTopicUpdate;
89
+ /**
90
+ * Handle the button being pressed down. Used for TAP and PRESSED action modes.
91
+ */
92
+ protected handleOnPressed(): void;
93
+ /**
94
+ * Handle the button being released. Used for TAP and RELEASED action modes.
95
+ */
96
+ protected handleOnReleased(): void;
97
+ /**
98
+ * Dispatch a value to any listeners.
99
+ * @param value The value to dispatch as part of the payload.
100
+ */
101
+ protected dispatchCommand(value: any): void;
102
+ render(): import("react/jsx-runtime").JSX.Element;
103
+ }
@@ -0,0 +1 @@
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Component}from"react";import{SelectButton}from"primereact/selectbutton";import{EventEmitterContext}from"../core/EventEmitterContext";import{IndicatorColor}from"../core/IndicatorColor";export{IndicatorColor};import{ActionMode}from"../core/ActionMode";export{ActionMode};function matchCurrentValue(e,t){if(null==t||0===t.length)return;let o=typeof e;if("boolean"==o){return e&&t.length>1?t[1]:t[0]}if("number"==o){let o=e;if(void 0!==o&&o<t.length)return t[o]}else if("string"==o)return e}function selectOnColor(e,t,o){if(!t||0===t.length)return IndicatorColor.IndicatorInvalid;let n=Array.isArray(o)?o:void 0!==o?[o]:[IndicatorColor.IndicatorInvalid],i=typeof e;if("boolean"===i)return e?n[0]:n.length>1?n[1]:n[0];if("number"===i&&t.length>e){if(n.length>e){return n[e]}return n[0]}if("string"===i){let o=t.indexOf(e);return-1!==o&&o<n.length?n[o]:n[0]}return null!=o?Array.isArray(o)?o[0]:o:IndicatorColor.IndicatorInvalid}export class ToggleGroup extends Component{constructor(e){super(e),Object.defineProperty(this,"handleTopicUpdate",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.setState({currentValue:e})}}),Object.defineProperty(this,"handleDisableTopicUpdate",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.setState({isDisabled:e})}}),Object.defineProperty(this,"handleInvisibleTopicUpdate",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.setState({isInvisible:e})}}),this.state={currentValue:void 0,isDisabled:!1,isInvisible:!1,isPressed:!1}}componentDidMount(){this.setupSubscriptions()}componentDidUpdate(e){}componentWillUnmount(){}setupSubscriptions(){const{topic:e,disableTopic:t,invisibleTopic:o}=this.props,{subscribe:n}=this.context;e&&n(e,this.handleTopicUpdate),t&&n(t,this.handleDisableTopicUpdate),o&&n(o,this.handleInvisibleTopicUpdate)}handleOnPressed(){const{isPressed:e}=this.state,{actionMode:t}=this.props;e||(this.setState({isPressed:!0}),t!==ActionMode.Tap&&t!==ActionMode.Pressed||this.dispatchCommand(!0))}handleOnReleased(){const{isPressed:e}=this.state,{actionMode:t}=this.props;e&&(this.setState({isPressed:!1}),t===ActionMode.Tap?this.dispatchCommand(!1):t===ActionMode.Released&&this.dispatchCommand(!0))}dispatchCommand(e){const{command:t,commandTopic:o,commandArgs:n}=this.props,{dispatch:i}=this.context;if(null!=t&&t.length>0){i({topic:t,payload:{topic:o,value:e,...n}})}}render(){const{currentValue:e,isDisabled:t,isInvisible:o}=this.state,{label:n,value:i,disabled:r,className:s,onColor:l,offColor:a,options:c,...d}=this.props;let p=e;void 0!==i&&(p=i);let u=selectOnColor(p,c,l);void 0===p&&(u=IndicatorColor.IndicatorInvalid);const h=null!=c&&c.length>2;return _jsxs("div",{className:"flex",children:[_jsx("style",{children:` \n ${void 0!==a?`\n .togglegroup-selectbutton-container .p-selectbutton .p-button {\n background-color: ${a};\n }\n `:""}\n .togglegroup-selectbutton-container .p-selectbutton .p-button.p-highlight {\n background-color: ${u} !important;\n border-color: ${u} !important;\n }\n .togglegroup-selectbutton-container .p-selectbutton .p-highlight {\n background-color: ${u} !important;\n border-color: ${u} !important;\n }\n `}),_jsxs("div",{className:"p-inputgroup togglegroup-selectbutton-container",children:[_jsx("span",{className:"p-inputgroup-addon",style:{flexGrow:1},children:n}),_jsx(SelectButton,{...d,options:c,disabled:t||r,multiple:h,className:`${s||""} ${void 0===p?"p-invalid":""}`.trim(),...o&&{style:{display:"none"}},value:matchCurrentValue(p,c),allowEmpty:!1,onMouseDown:()=>this.handleOnPressed(),onTouchStart:()=>this.handleOnPressed(),onMouseUp:()=>this.handleOnReleased(),onTouchEnd:()=>this.handleOnReleased()})]})]})}}Object.defineProperty(ToggleGroup,"contextType",{enumerable:!0,configurable:!0,writable:!0,value:EventEmitterContext});
@@ -0,0 +1,109 @@
1
+ import React from "react";
2
+ import { EventEmitterContext } from "../core/EventEmitterContext.js";
3
+ import { KeyFilterType } from "primereact/keyfilter";
4
+ /**
5
+ * Properties of the Configuration View
6
+ */
7
+ interface ValueInputProps {
8
+ /**
9
+ * The label for the ValueInput field.
10
+ */
11
+ label: React.ReactNode | undefined;
12
+ /**
13
+ * The value for the field.
14
+ */
15
+ value: string | undefined;
16
+ /**
17
+ * Optional filter for key entry. Not a validator, but won't accept keystrokes outside the filter.
18
+ * @type {RegExp | "pint" | "int" | "pnum" | "money" | "num" | "hex" | "email" | "alpha" | "alphanum"}
19
+ */
20
+ keyFilter: KeyFilterType | undefined;
21
+ /**
22
+ * An optional prefix before the data entry field.
23
+ */
24
+ prefix: React.ReactNode | undefined;
25
+ /**
26
+ * An optional prefix before the data entry field.
27
+ */
28
+ suffix: React.ReactNode | undefined;
29
+ /**
30
+ * A small, advisory text below the field.
31
+ */
32
+ description: React.ReactNode | undefined;
33
+ /**
34
+ * If true, all functions of the field will be disabled.
35
+ */
36
+ disabled: boolean | undefined;
37
+ /** Topic on which the value will be dispatched through the user interfave on successful data entry. */
38
+ dispatchTopic: string | undefined;
39
+ /**
40
+ * Placeholder string to display if the value is empty.
41
+ */
42
+ placeholder: string | undefined;
43
+ /**
44
+ * The user has accepted a new value.
45
+ * @param newValue New value accepted by the user.
46
+ */
47
+ onValueChanged?(newValue: string): void;
48
+ /** Regular expression used to validate the value before it is broadcast */
49
+ validator: RegExp;
50
+ }
51
+ /**
52
+ * State variables of the Configuration View
53
+ */
54
+ interface ValueInputState {
55
+ entryValue: string | undefined;
56
+ isValid: boolean;
57
+ editing: boolean;
58
+ }
59
+ /**
60
+ * A convenient field with all the usual features of inputing values.
61
+ * Wraps the common features of use of a InputText, p-inputgroup, some icon buttons,
62
+ * accepting and rejecting values and keyboard management.
63
+ */
64
+ export declare class ValueInput extends React.Component<ValueInputProps, ValueInputState> {
65
+ static contextType: React.Context<import("../core/EventEmitterContext.js").EventEmitterContextType>;
66
+ context: React.ContextType<typeof EventEmitterContext>;
67
+ /**
68
+ * Default properties for the component.
69
+ */
70
+ static defaultProps: {
71
+ label: string;
72
+ value: undefined;
73
+ keyFilter: undefined;
74
+ writeTopic: undefined;
75
+ onValueChanged: undefined;
76
+ description: undefined;
77
+ prefix: undefined;
78
+ suffix: undefined;
79
+ disabled: boolean;
80
+ dispatchTopic: undefined;
81
+ placeholder: undefined;
82
+ validator: undefined;
83
+ };
84
+ /**
85
+ *
86
+ * @param {FooterViewProps} props
87
+ */
88
+ constructor(props: ValueInputProps);
89
+ /**
90
+ * The component has been loaded into the DOM.
91
+ */
92
+ componentDidMount(): void;
93
+ /**
94
+ * Check the new value against the validator RegEx, if one was specified.
95
+ * @param val The new value.
96
+ * @returns True if no validator specified or the value is valid, false if not valid.
97
+ */
98
+ private validateValue;
99
+ /**
100
+ * The user has elected to accept the input value. Validate and store, if valid.
101
+ */
102
+ private onAcceptValue;
103
+ /**
104
+ * The user wishes to reset/cancel the previous value.
105
+ */
106
+ private onResetValue;
107
+ render(): import("react/jsx-runtime").JSX.Element;
108
+ }
109
+ export {};
@@ -0,0 +1 @@
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import React from"react";import{InputText}from"primereact/inputtext";import{Button}from"primereact/button";import{EventEmitterContext}from"../core/EventEmitterContext.js";export class ValueInput extends React.Component{constructor(e){super(e),Object.defineProperty(this,"validateValue",{enumerable:!0,configurable:!0,writable:!0,value:e=>void 0===this.props.validator||null===this.props.validator||this.props.validator.test(e)}),this.state={entryValue:e.value,isValid:void 0!==e.value&&this.validateValue(e.value),editing:!1}}componentDidMount(){}onAcceptValue(){void 0!==this.state.entryValue&&this.validateValue(this.state.entryValue)?(this.setState({isValid:!0,editing:!1}),this.props.onValueChanged&&this.props.onValueChanged(this.state.entryValue),void 0!==this.props.dispatchTopic&&this.context.dispatch({topic:this.props.dispatchTopic,payload:this.state.entryValue})):this.setState({isValid:!1})}onResetValue(){this.setState({entryValue:this.props.value,isValid:void 0!==this.props.value&&this.validateValue(this.props.value),editing:!1})}render(){return _jsxs("div",{children:[_jsxs("div",{className:"p-inputgroup flex-1",children:[_jsx("span",{className:"p-inputgroup-addon",children:this.props.label}),void 0!==this.props.prefix&&_jsx("span",{className:"p-inputgroup-addon",children:this.props.prefix}),_jsx(InputText,{keyfilter:this.props.keyFilter,placeholder:this.props.placeholder,value:this.state.entryValue,onChange:e=>{this.setState({entryValue:e.target.value,editing:!0})},className:this.state.isValid?"":"p-invalid",onKeyDown:e=>{"Enter"===e.key?this.onAcceptValue():"Escape"===e.key&&this.onResetValue()},disabled:this.props.disabled}),void 0!==this.props.suffix&&_jsx("span",{className:"p-inputgroup-addon",children:this.props.suffix}),_jsx(Button,{icon:"pi pi-check",disabled:this.props.disabled||!this.state.editing,className:"p-button-success",onClick:()=>this.onAcceptValue()}),_jsx(Button,{icon:"pi pi-times",disabled:this.props.disabled||!this.state.editing,className:"p-button-danger",onClickCapture:()=>this.onResetValue()})]}),void 0!==this.props.description&&_jsx("small",{children:this.props.description})]})}}Object.defineProperty(ValueInput,"contextType",{enumerable:!0,configurable:!0,writable:!0,value:EventEmitterContext}),Object.defineProperty(ValueInput,"defaultProps",{enumerable:!0,configurable:!0,writable:!0,value:{label:"",value:void 0,keyFilter:void 0,writeTopic:void 0,onValueChanged:void 0,description:void 0,prefix:void 0,suffix:void 0,disabled:!1,dispatchTopic:void 0,placeholder:void 0,validator:void 0}});
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Enum for different input modes of the IndicatorButton.
3
+ */
4
+ export declare enum ActionMode {
5
+ Tap = "Tap",
6
+ Toggle = "Toggle",
7
+ Pressed = "Pressed",
8
+ Released = "Released"
9
+ }
@@ -0,0 +1 @@
1
+ export var ActionMode;!function(e){e.Tap="Tap",e.Toggle="Toggle",e.Pressed="Pressed",e.Released="Released"}(ActionMode||(ActionMode={}));
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Common state for the indicator buttons, toggles or similar components.
3
+ */
4
+ export interface IndicatorButtonState {
5
+ /**
6
+ * Current value/state of the button based on the subscribed topic.
7
+ */
8
+ currentValue?: boolean | number | string;
9
+ /**
10
+ * Indicates whether the button is disabled.
11
+ */
12
+ isDisabled?: boolean;
13
+ /**
14
+ * Indicates whether the button is invisible.
15
+ */
16
+ isInvisible?: boolean;
17
+ /**
18
+ * The button is in the "down" state.
19
+ */
20
+ isPressed: boolean;
21
+ }
@@ -0,0 +1 @@
1
+ export{};
@@ -39,6 +39,10 @@ export declare const RegExMaskPatterns: {
39
39
  * Examples of valid inputs: "123"
40
40
  */
41
41
  readonly IntegerPositive: RegExp;
42
+ /**
43
+ * Regular expression for matching IPV4 address.
44
+ */
45
+ readonly Ipv4: RegExp;
42
46
  };
43
47
  /**
44
48
  * Patterns for use with PrimeReact.InputMask components
@@ -1 +1 @@
1
- export const RegExMaskPatterns={RealNumber:/^-?\d*(\.)?(\d+)?$/,RealNumberPositive:/^\d*(\.)?(\d+)?$/,Integer:/^-?\d*$/,IntegerPositive:/^\d+$/};export const PrimeReactMaskPatterns={SocialSecurityNumber:"999-99-9999",PhoneNumberUS:"(999) 999-9999? x99999",PhoneNumberInternational:"+999 999 999 9999? x99999",PhoneNumberJapan:"+81 9999 999 9999? x99999",PhoneNumberChina:"+86 999 999 9999? x99999",PhoneNumberVietnam:"+84 999 999 9999? x99999",PhoneNumberSouthKorea:"+82 99 9999 9999 x99999",PhoneNumberCanada:"+1 (999) 999-9999 x99999",PhoneNumberMexico:"+52 999 999 9999 x99999",PhoneNumberScotland:"+44 9999 999999 x99999",PhoneNumberEngland:"+44 9999 999999 x99999",PhoneNumberIreland:"+353 99 999 9999 x99999"};
1
+ export const RegExMaskPatterns={RealNumber:/^-?\d*(\.)?(\d+)?$/,RealNumberPositive:/^\d*(\.)?(\d+)?$/,Integer:/^-?\d*$/,IntegerPositive:/^\d+$/,Ipv4:/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/};export const PrimeReactMaskPatterns={SocialSecurityNumber:"999-99-9999",PhoneNumberUS:"(999) 999-9999? x99999",PhoneNumberInternational:"+999 999 999 9999? x99999",PhoneNumberJapan:"+81 9999 999 9999? x99999",PhoneNumberChina:"+86 999 999 9999? x99999",PhoneNumberVietnam:"+84 999 999 9999? x99999",PhoneNumberSouthKorea:"+82 99 9999 9999 x99999",PhoneNumberCanada:"+1 (999) 999-9999 x99999",PhoneNumberMexico:"+52 999 999 9999 x99999",PhoneNumberScotland:"+44 9999 999999 x99999",PhoneNumberEngland:"+44 9999 999999 x99999",PhoneNumberIreland:"+353 99 999 9999 x99999"};
@@ -3,26 +3,28 @@
3
3
  --dark-hl-0: #9CDCFE;
4
4
  --light-hl-1: #000000;
5
5
  --dark-hl-1: #D4D4D4;
6
- --light-hl-2: #008000;
7
- --dark-hl-2: #6A9955;
8
- --light-hl-3: #0000FF;
9
- --dark-hl-3: #569CD6;
10
- --light-hl-4: #000000;
11
- --dark-hl-4: #C8C8C8;
12
- --light-hl-5: #098658;
13
- --dark-hl-5: #B5CEA8;
14
- --light-hl-6: #267F99;
15
- --dark-hl-6: #4EC9B0;
16
- --light-hl-7: #0070C1;
17
- --dark-hl-7: #4FC1FF;
18
- --light-hl-8: #795E26;
19
- --dark-hl-8: #DCDCAA;
20
- --light-hl-9: #AF00DB;
21
- --dark-hl-9: #C586C0;
22
- --light-hl-10: #A31515;
23
- --dark-hl-10: #CE9178;
6
+ --light-hl-2: #AF00DB;
7
+ --dark-hl-2: #C586C0;
8
+ --light-hl-3: #A31515;
9
+ --dark-hl-3: #CE9178;
10
+ --light-hl-4: #098658;
11
+ --dark-hl-4: #B5CEA8;
12
+ --light-hl-5: #008000;
13
+ --dark-hl-5: #6A9955;
14
+ --light-hl-6: #0000FF;
15
+ --dark-hl-6: #569CD6;
16
+ --light-hl-7: #000000;
17
+ --dark-hl-7: #C8C8C8;
18
+ --light-hl-8: #267F99;
19
+ --dark-hl-8: #4EC9B0;
20
+ --light-hl-9: #0070C1;
21
+ --dark-hl-9: #4FC1FF;
22
+ --light-hl-10: #795E26;
23
+ --dark-hl-10: #DCDCAA;
24
24
  --light-hl-11: #CD3131;
25
25
  --dark-hl-11: #F44747;
26
+ --light-hl-12: #811F3F;
27
+ --dark-hl-12: #D16969;
26
28
  --light-code-background: #FFFFFF;
27
29
  --dark-code-background: #1E1E1E;
28
30
  }
@@ -40,6 +42,7 @@
40
42
  --hl-9: var(--light-hl-9);
41
43
  --hl-10: var(--light-hl-10);
42
44
  --hl-11: var(--light-hl-11);
45
+ --hl-12: var(--light-hl-12);
43
46
  --code-background: var(--light-code-background);
44
47
  } }
45
48
 
@@ -56,6 +59,7 @@
56
59
  --hl-9: var(--dark-hl-9);
57
60
  --hl-10: var(--dark-hl-10);
58
61
  --hl-11: var(--dark-hl-11);
62
+ --hl-12: var(--dark-hl-12);
59
63
  --code-background: var(--dark-code-background);
60
64
  } }
61
65
 
@@ -72,6 +76,7 @@
72
76
  --hl-9: var(--light-hl-9);
73
77
  --hl-10: var(--light-hl-10);
74
78
  --hl-11: var(--light-hl-11);
79
+ --hl-12: var(--light-hl-12);
75
80
  --code-background: var(--light-code-background);
76
81
  }
77
82
 
@@ -88,6 +93,7 @@
88
93
  --hl-9: var(--dark-hl-9);
89
94
  --hl-10: var(--dark-hl-10);
90
95
  --hl-11: var(--dark-hl-11);
96
+ --hl-12: var(--dark-hl-12);
91
97
  --code-background: var(--dark-code-background);
92
98
  }
93
99
 
@@ -103,4 +109,5 @@
103
109
  .hl-9 { color: var(--hl-9); }
104
110
  .hl-10 { color: var(--hl-10); }
105
111
  .hl-11 { color: var(--hl-11); }
112
+ .hl-12 { color: var(--hl-12); }
106
113
  pre, code { background: var(--code-background); }
@@ -1 +1 @@
1
- window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAACrWY207jMBCG3yW9RbscCgu9AwqiK7GtON0gFLmOIVaTOOs4iGrFu6+SNIljexyHltt25puZ3zNjt8//PEE+hDfxMItTlpBEZN6eh0MaBZwk3uS5MZguUODteSkSoTfxYhbkEcl+tm5+YfAjFHHk7XkrmgTe5NBMCsgryiPhBhu11hV0fHA2Ptoff+41vCf8m60XKDjHgrKkxZIkj3Vo17qb8KmBepELwZJZ4Mqt7W3krpaveVLmYmLqop6MP18k2CwJKEaCcaucjZXTATXWlywaBB5pntCZufSAwu5vBIMWOEJZBmEBVQ4OT80SV0frlnNl+21yS/hvEl2O0C99NU23LCCWOVHZrRM8LKD4tpPd8K2HUZwyGGbBWZq1sWgiCH9FeFC4kqE0wPEJHPNeIEG2jFky9JjGbh7QbaXpVr0M90LFtoXqTuM8W1mTnmernd1CNcthADppGTd6AdOSU7b5PFtNKYrYW19aldUuC5WIbuWqiRoGssUCKaur9glFOZnSLI3Q2pqwbOikwp88JhwtI3LNeIzEPC3PZ1iMEQgBnybGegxKdWLBxVV6yYphxgnwYrt6J4m4iqkQhF+ypPzUUC8nvsHSSdSbfDmQOKpc7NcIsAQBrOkh1120Bq+HdQrtWiAMALHFtW10IAqwwCVmvswwp+lwnWRPq1qVW9F/SODwerPL2mBinVqFMvsrIffPfh0cH+phN1kuyVfjagDHwI9Jtm1oA6I3uG1G3xGnxbYZ1pXdkEdQtAVn7zQg3HxrOYSrAdYL7RZlqwUqzM3LlhNfNnHaOgtOY3JHEBZmuiJbh2/2tUh2R96uPobH0dy0ELJKzb1SbBRIp67RTi49qa0VutnT3M1yJQuW0cLUft8oVts+YwCiyy9GMF91o6oBVE/bRp3SmCRZIWDfiKtQzdPaRo8J/ZuTmfFvGk78+msnuXWWsh4amhmr7IHySXNP4zyC/qvgxO8a7aArDECX/5OAXNtnm462pa4+ckOGgXxDht3eXQyfB4F8oSs/WKXBLpiAfd/lFGpuYDeUmWvmhpboCGF6Pob58utvz9q555l5ky83Z0XsDMnKxmJ4RcSM9bBaKwvrAeWc2kG1CUTBnCBBOvq0p1WAGgPtfDqpXKDMLI+/+XK7CVVBDpOpJVWPpMwyJqfOYF8H+JLBTsrswNxK1RNUym2YYLKmsm3N6ksGuylbhjmWrSWoll0zwWQNZcNz5dffuq4dBaVkV6HMzPrn+8t/QOSaZXgZAAA="
1
+ window.navigationData = "data:application/octet-stream;base64,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"