@adcops/autocore-react 3.0.39 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/additional-docs/AutoCoreTagContext.md +441 -0
- package/dist/assets/BlocklyLogo.d.ts +1 -0
- package/dist/assets/BlocklyLogo.d.ts.map +1 -0
- package/dist/assets/Distance.d.ts +1 -0
- package/dist/assets/Distance.d.ts.map +1 -0
- package/dist/assets/JogLong.d.ts +1 -0
- package/dist/assets/JogLong.d.ts.map +1 -0
- package/dist/assets/JogMedium.d.ts +1 -0
- package/dist/assets/JogMedium.d.ts.map +1 -0
- package/dist/assets/JogShort.d.ts +1 -0
- package/dist/assets/JogShort.d.ts.map +1 -0
- package/dist/assets/PythonLogo.d.ts +1 -0
- package/dist/assets/PythonLogo.d.ts.map +1 -0
- package/dist/assets/Rotation3D.d.ts +1 -0
- package/dist/assets/Rotation3D.d.ts.map +1 -0
- package/dist/assets/RotationCcw.d.ts +1 -0
- package/dist/assets/RotationCcw.d.ts.map +1 -0
- package/dist/assets/RotationCcwA.d.ts +1 -0
- package/dist/assets/RotationCcwA.d.ts.map +1 -0
- package/dist/assets/RotationCcwB.d.ts +1 -0
- package/dist/assets/RotationCcwB.d.ts.map +1 -0
- package/dist/assets/RotationCcwC.d.ts +1 -0
- package/dist/assets/RotationCcwC.d.ts.map +1 -0
- package/dist/assets/RotationCw.d.ts +1 -0
- package/dist/assets/RotationCw.d.ts.map +1 -0
- package/dist/assets/RotationCwA.d.ts +1 -0
- package/dist/assets/RotationCwA.d.ts.map +1 -0
- package/dist/assets/RotationCwB.d.ts +1 -0
- package/dist/assets/RotationCwB.d.ts.map +1 -0
- package/dist/assets/RotationCwC.d.ts +1 -0
- package/dist/assets/RotationCwC.d.ts.map +1 -0
- package/dist/assets/Run.d.ts +1 -0
- package/dist/assets/Run.d.ts.map +1 -0
- package/dist/assets/Speed.d.ts +1 -0
- package/dist/assets/Speed.d.ts.map +1 -0
- package/dist/assets/SpeedFast.d.ts +1 -0
- package/dist/assets/SpeedFast.d.ts.map +1 -0
- package/dist/assets/SpeedMedium.d.ts +1 -0
- package/dist/assets/SpeedMedium.d.ts.map +1 -0
- package/dist/assets/SpeedNone.d.ts +1 -0
- package/dist/assets/SpeedNone.d.ts.map +1 -0
- package/dist/assets/SpeedSlow.d.ts +1 -0
- package/dist/assets/SpeedSlow.d.ts.map +1 -0
- package/dist/assets/Walk.d.ts +1 -0
- package/dist/assets/Walk.d.ts.map +1 -0
- package/dist/assets/index.d.ts +1 -0
- package/dist/assets/index.d.ts.map +1 -0
- package/dist/components/AutoCoreDevPanel.d.ts +144 -0
- package/dist/components/AutoCoreDevPanel.d.ts.map +1 -0
- package/dist/components/AutoCoreDevPanel.js +1 -0
- package/dist/components/BlocklyEditor.d.ts +1 -0
- package/dist/components/BlocklyEditor.d.ts.map +1 -0
- package/dist/components/BlocklyEditor.js +1 -1
- package/dist/components/CodeEditor.d.ts +2 -1
- package/dist/components/CodeEditor.d.ts.map +1 -0
- package/dist/components/CodeEditor.js +1 -1
- package/dist/components/FileList.d.ts +1 -0
- package/dist/components/FileList.d.ts.map +1 -0
- package/dist/components/FileList.js +1 -1
- package/dist/components/FileSelect.d.ts +1 -0
- package/dist/components/FileSelect.d.ts.map +1 -0
- package/dist/components/FileSelect.js +1 -1
- package/dist/components/FitText.d.ts +1 -0
- package/dist/components/FitText.d.ts.map +1 -0
- package/dist/components/FitText.js +1 -1
- package/dist/components/Indicator.d.ts +2 -1
- package/dist/components/Indicator.d.ts.map +1 -0
- package/dist/components/Indicator.js +1 -1
- package/dist/components/IndicatorButton.d.ts +23 -137
- package/dist/components/IndicatorButton.d.ts.map +1 -0
- package/dist/components/IndicatorButton.js +1 -1
- package/dist/components/IndicatorRect.d.ts +2 -1
- package/dist/components/IndicatorRect.d.ts.map +1 -0
- package/dist/components/JogPanel.d.ts +1 -0
- package/dist/components/JogPanel.d.ts.map +1 -0
- package/dist/components/Lamp.d.ts +2 -1
- package/dist/components/Lamp.d.ts.map +1 -0
- package/dist/components/Lamp.js +1 -1
- package/dist/components/Osk.d.ts +1 -0
- package/dist/components/Osk.d.ts.map +1 -0
- package/dist/components/Osk.js +1 -1
- package/dist/components/OskDialog.d.ts +1 -0
- package/dist/components/OskDialog.d.ts.map +1 -0
- package/dist/components/ProgressBarWithValue.d.ts +1 -0
- package/dist/components/ProgressBarWithValue.d.ts.map +1 -0
- package/dist/components/ProgressBarWithValue.js +1 -1
- package/dist/components/TextInput.d.ts +62 -103
- package/dist/components/TextInput.d.ts.map +1 -0
- package/dist/components/TextInput.js +1 -1
- package/dist/components/ToggleGroup.d.ts +2 -1
- package/dist/components/ToggleGroup.d.ts.map +1 -0
- package/dist/components/ToggleGroup.js +1 -1
- package/dist/components/ValueDisplay.d.ts +3 -2
- package/dist/components/ValueDisplay.d.ts.map +1 -0
- package/dist/components/ValueDisplay.js +1 -1
- package/dist/components/ValueIndicator.d.ts +2 -1
- package/dist/components/ValueIndicator.d.ts.map +1 -0
- package/dist/components/ValueIndicator.js +1 -1
- package/dist/components/ValueInput.d.ts +2 -1
- package/dist/components/ValueInput.d.ts.map +1 -0
- package/dist/components/ValueInput.js +1 -1
- package/dist/core/ActionMode.d.ts +1 -0
- package/dist/core/ActionMode.d.ts.map +1 -0
- package/dist/core/AutoCoreTagContext.d.ts +224 -0
- package/dist/core/AutoCoreTagContext.d.ts.map +1 -0
- package/dist/core/AutoCoreTagContext.js +1 -0
- package/dist/core/AutoCoreTagTypes.d.ts +162 -0
- package/dist/core/AutoCoreTagTypes.d.ts.map +1 -0
- package/dist/core/AutoCoreTagTypes.js +1 -0
- package/dist/core/EventEmitterContext.d.ts +295 -2
- package/dist/core/EventEmitterContext.d.ts.map +1 -0
- package/dist/core/EventEmitterContext.js +1 -1
- package/dist/core/IndicatorButtonState.d.ts +1 -0
- package/dist/core/IndicatorButtonState.d.ts.map +1 -0
- package/dist/core/IndicatorColor.d.ts +1 -0
- package/dist/core/IndicatorColor.d.ts.map +1 -0
- package/dist/core/MaskPatterns.d.ts +1 -0
- package/dist/core/MaskPatterns.d.ts.map +1 -0
- package/dist/core/NumerableTypes.d.ts +1 -0
- package/dist/core/NumerableTypes.d.ts.map +1 -0
- package/dist/core/NumerableTypes.js +1 -1
- package/dist/core/PositionContext.d.ts +1 -1
- package/dist/core/PositionContext.d.ts.map +1 -0
- package/dist/core/UniqueId.d.ts +1 -0
- package/dist/core/UniqueId.d.ts.map +1 -0
- package/dist/core/ValueSimulator.d.ts +2 -1
- package/dist/core/ValueSimulator.d.ts.map +1 -0
- package/dist/core/ValueSimulator.js +1 -1
- package/dist/core/hoc.d.ts +1 -0
- package/dist/core/hoc.d.ts.map +1 -0
- package/dist/core/hoc.js +1 -1
- package/dist/hooks/adsHooks.d.ts +1 -0
- package/dist/hooks/adsHooks.d.ts.map +1 -0
- package/dist/hooks/adsHooks.js +1 -1
- package/dist/hooks/commandHooks.d.ts +1 -0
- package/dist/hooks/commandHooks.d.ts.map +1 -0
- package/dist/hooks/commandHooks.js +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/useAutoCoreTag.d.ts +26 -0
- package/dist/hooks/useAutoCoreTag.d.ts.map +1 -0
- package/dist/hooks/useAutoCoreTag.js +1 -0
- package/dist/hooks/useScaledValue.d.ts +1 -0
- package/dist/hooks/useScaledValue.d.ts.map +1 -0
- package/dist/hooks/useScaledValue.js +1 -1
- package/dist/hub/CommandMessage.d.ts +1 -0
- package/dist/hub/CommandMessage.d.ts.map +1 -0
- package/dist/hub/HubBase.d.ts +3 -2
- package/dist/hub/HubBase.d.ts.map +1 -0
- package/dist/hub/HubSimulate.d.ts +2 -1
- package/dist/hub/HubSimulate.d.ts.map +1 -0
- package/dist/hub/HubSimulate.js +1 -1
- package/dist/hub/HubTauri.d.ts +2 -1
- package/dist/hub/HubTauri.d.ts.map +1 -0
- package/dist/hub/HubTauri.js +1 -1
- package/dist/hub/HubWebSocket.d.ts +2 -1
- package/dist/hub/HubWebSocket.d.ts.map +1 -0
- package/dist/hub/HubWebSocket.js +1 -1
- package/dist/hub/index.d.ts +2 -1
- package/dist/hub/index.d.ts.map +1 -0
- package/dist/hub/index.js +1 -1
- package/docs/.nojekyll +1 -0
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/highlight.css +134 -0
- package/docs/assets/icons.js +18 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +60 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1633 -0
- package/docs/classes/components_CodeEditor.CodeEditor.html +108 -101
- package/docs/classes/components_Indicator.Indicator.html +122 -0
- package/docs/classes/components_IndicatorRect.IndicatorRect.html +121 -0
- package/docs/classes/components_JogPanel.JogPanel.html +104 -106
- package/docs/classes/components_Lamp.Lamp.html +96 -79
- package/docs/classes/components_OskDialog.OskDialog.html +125 -0
- package/docs/classes/components_TextInput.TextInput.html +99 -89
- package/docs/classes/components_ValueDisplay.ValueDisplay.html +148 -0
- package/docs/classes/components_ValueIndicator.ValueIndicator.html +98 -91
- package/docs/classes/core_ValueSimulator.ValueSimulator.html +51 -0
- package/docs/classes/hub_HubBase.HubBase.html +106 -0
- package/docs/classes/hub_HubSimulate.HubSimulate.html +75 -0
- package/docs/classes/hub_HubTauri.HubTauri.html +93 -0
- package/docs/classes/hub_HubWebSocket.HubWebSocket.html +75 -69
- package/docs/documents/core_AutoCoreTagContext.AutoCoreTagContext.html +148 -0
- package/docs/enums/components_JogPanel.JogDistanceAction.html +5 -5
- package/docs/enums/components_JogPanel.JogPanelAction.html +18 -18
- package/docs/enums/components_JogPanel.JogSpeedAction.html +5 -5
- package/docs/enums/core_ActionMode.ActionMode.html +6 -6
- package/docs/enums/core_IndicatorColor.IndicatorColor.html +22 -22
- package/docs/functions/assets.BlocklyLogo.html +1 -0
- package/docs/functions/assets.Distance.html +1 -0
- package/docs/functions/assets.JogLong.html +1 -0
- package/docs/functions/assets.JogMedium.html +1 -0
- package/docs/functions/assets.JogShort.html +1 -0
- package/docs/functions/assets.PythonLogo.html +1 -0
- package/docs/functions/assets.Rotation3D.html +1 -0
- package/docs/functions/assets.RotationCcw.html +1 -0
- package/docs/functions/assets.RotationCcwA.html +1 -0
- package/docs/functions/assets.RotationCcwB.html +1 -0
- package/docs/functions/assets.RotationCcwC.html +1 -0
- package/docs/functions/assets.RotationCw.html +1 -0
- package/docs/functions/assets.RotationCwA.html +1 -0
- package/docs/functions/assets.RotationCwB.html +1 -0
- package/docs/functions/assets.RotationCwC.html +1 -0
- package/docs/functions/assets.Run.html +1 -0
- package/docs/functions/assets.Speed.html +1 -0
- package/docs/functions/assets.SpeedFast.html +1 -0
- package/docs/functions/assets.SpeedMedium.html +1 -0
- package/docs/functions/assets.SpeedNone.html +1 -0
- package/docs/functions/assets.SpeedSlow.html +1 -0
- package/docs/functions/assets.Walk.html +1 -0
- package/docs/functions/components_BlocklyEditor.createCustomToolbox.html +5 -5
- package/docs/functions/core_UniqueId.UniqueId.html +9 -0
- package/docs/functions/core_hoc.hocAddSubscription.html +6 -0
- package/docs/functions/hooks_adsHooks.useAdsRegisterSymbols.html +16 -0
- package/docs/functions/hooks_adsHooks.useAdsTapValue.html +8 -0
- package/docs/functions/hooks_adsHooks.useAdsWriteScaledValue.html +18 -0
- package/docs/functions/hooks_adsHooks.useAdsWriteValue.html +9 -0
- package/docs/functions/hooks_commandHooks.useRegisterSymbols.html +16 -0
- package/docs/functions/hooks_commandHooks.useTapValue.html +10 -0
- package/docs/functions/hooks_commandHooks.useWriteScaledValue.html +18 -0
- package/docs/functions/hooks_commandHooks.useWriteValue.html +11 -0
- package/docs/functions/hooks_useAutoCoreTag.ts.makeAutoCoreTagHooks.html +12 -0
- package/docs/functions/hooks_useScaledValue.useScaledValue.html +18 -0
- package/docs/functions/hub.createHub.html +3 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +148 -0
- package/docs/interfaces/components_IndicatorButton.IndicatorButtonProps.html +654 -0
- package/docs/interfaces/components_IndicatorRect.IndicatorRectProps.html +37 -0
- package/docs/interfaces/components_JogPanel.JogPanelButtonDefinition.html +5 -5
- package/docs/interfaces/components_ToggleGroup.ToggleGroupProps.html +545 -519
- package/docs/interfaces/core_AutoCoreTagTypes.BaseContextValue.html +12 -0
- package/docs/interfaces/core_AutoCoreTagTypes.ScaleConfig.html +13 -0
- package/docs/interfaces/core_EventEmitterContext.Action.html +8 -0
- package/docs/interfaces/core_EventEmitterContext.EventEmitterContextType.html +33 -0
- package/docs/interfaces/core_EventEmitterContext.State.html +8 -0
- package/docs/interfaces/core_EventEmitterContext.Subscription.html +6 -0
- package/docs/interfaces/core_IndicatorButtonState.IndicatorButtonState.html +10 -10
- package/docs/interfaces/core_PositionContext.IPositionContext.html +17 -0
- package/docs/interfaces/hub_CommandMessage.CommandMessage.html +6 -6
- package/docs/interfaces/hub_CommandMessage.CommandMessageResult.html +4 -4
- package/docs/modules/assets.html +1 -23
- package/docs/modules/assets_BlocklyLogo.html +1 -2
- package/docs/modules/assets_Distance.html +1 -2
- package/docs/modules/assets_JogLong.html +1 -2
- package/docs/modules/assets_JogMedium.html +1 -2
- package/docs/modules/assets_JogShort.html +1 -2
- package/docs/modules/assets_PythonLogo.html +1 -2
- package/docs/modules/assets_Rotation3D.html +1 -2
- package/docs/modules/assets_RotationCcw.html +1 -2
- package/docs/modules/assets_RotationCcwA.html +1 -2
- package/docs/modules/assets_RotationCcwB.html +1 -2
- package/docs/modules/assets_RotationCcwC.html +1 -2
- package/docs/modules/assets_RotationCw.html +1 -2
- package/docs/modules/assets_RotationCwA.html +1 -2
- package/docs/modules/assets_RotationCwB.html +1 -2
- package/docs/modules/assets_RotationCwC.html +1 -2
- package/docs/modules/assets_Run.html +1 -2
- package/docs/modules/assets_Speed.html +1 -2
- package/docs/modules/assets_SpeedFast.html +1 -2
- package/docs/modules/assets_SpeedMedium.html +1 -2
- package/docs/modules/assets_SpeedNone.html +1 -2
- package/docs/modules/assets_SpeedSlow.html +1 -2
- package/docs/modules/assets_Walk.html +1 -2
- package/docs/modules/components_AutoCoreDevPanel.html +20 -0
- package/docs/modules/components_BlocklyEditor.html +1 -5
- package/docs/modules/components_CodeEditor.html +1 -3
- package/docs/modules/components_FileList.html +1 -3
- package/docs/modules/components_FileSelect.html +1 -0
- package/docs/modules/components_FitText.html +1 -3
- package/docs/modules/components_Indicator.html +1 -0
- package/docs/modules/components_IndicatorButton.html +1 -0
- package/docs/modules/components_IndicatorRect.html +1 -0
- package/docs/modules/components_JogPanel.html +1 -9
- package/docs/modules/components_Lamp.html +1 -4
- package/docs/modules/components_Osk.html +1 -0
- package/docs/modules/components_OskDialog.html +1 -0
- package/docs/modules/components_ProgressBarWithValue.html +1 -0
- package/docs/modules/components_TextInput.html +1 -2
- package/docs/modules/components_ToggleGroup.html +1 -6
- package/docs/modules/components_ValueDisplay.html +1 -0
- package/docs/modules/components_ValueIndicator.html +1 -4
- package/docs/modules/components_ValueInput.html +1 -2
- package/docs/modules/core_ActionMode.html +1 -2
- package/docs/modules/core_AutoCoreTagContext.html +11 -0
- package/docs/modules/core_AutoCoreTagTypes.html +1 -0
- package/docs/modules/core_EventEmitterContext.html +53 -0
- package/docs/modules/core_IndicatorButtonState.html +1 -2
- package/docs/modules/core_IndicatorColor.html +1 -2
- package/docs/modules/core_MaskPatterns.html +1 -0
- package/docs/modules/core_NumerableTypes.html +1 -0
- package/docs/modules/core_PositionContext.html +1 -0
- package/docs/modules/core_UniqueId.html +1 -0
- package/docs/modules/core_ValueSimulator.html +1 -0
- package/docs/modules/core_hoc.html +1 -0
- package/docs/modules/hooks.html +1 -0
- package/docs/modules/hooks_adsHooks.html +1 -0
- package/docs/modules/hooks_commandHooks.html +1 -0
- package/docs/modules/hooks_useAutoCoreTag.ts.html +52 -0
- package/docs/modules/hooks_useScaledValue.html +1 -0
- package/docs/modules/hub.html +1 -0
- package/docs/modules/hub_CommandMessage.html +1 -3
- package/docs/modules/hub_HubBase.html +1 -0
- package/docs/modules/hub_HubSimulate.html +1 -0
- package/docs/modules/hub_HubTauri.html +1 -0
- package/docs/modules/hub_HubWebSocket.html +1 -2
- package/docs/modules.html +23 -0
- package/docs/types/components_IndicatorButton.IndicatorButtonOptionsType.html +1 -1
- package/docs/types/core_AutoCoreTagTypes.ExtractByTag.html +2 -0
- package/docs/types/core_AutoCoreTagTypes.PrimitiveKind.html +1 -0
- package/docs/types/core_AutoCoreTagTypes.TagConfig.html +16 -0
- package/docs/types/core_AutoCoreTagTypes.TagValueMap.html +1 -0
- package/docs/types/core_AutoCoreTagTypes.TagValueOf.html +1 -0
- package/docs/types/core_EventEmitterContext.EmitterDispatchFunction.html +3 -0
- package/docs/types/core_EventEmitterContext.EmitterSubscribeFunction.html +3 -0
- package/docs/types/core_EventEmitterContext.EmitterUnsubscribeFunction.html +3 -0
- package/docs/types/core_NumerableTypes.NumerableFormatOptions.html +4 -0
- package/docs/types/core_hoc.HocAddSubscriptionProps.html +6 -0
- package/docs/variables/components_AutoCoreDevPanel.AutoCoreDevPanel.html +43 -0
- package/docs/variables/components_BlocklyEditor.BlocklyEditor.html +13 -0
- package/docs/variables/components_BlocklyEditor.StandardToolbox.html +1 -1
- package/docs/variables/components_FileList.FileList.html +23 -0
- package/docs/variables/components_FileSelect.FileSelect.html +1 -0
- package/docs/variables/components_FitText.FitText.html +4 -0
- package/docs/variables/components_IndicatorButton.IndicatorButton.html +1 -0
- package/docs/variables/components_JogPanel.DefaultLinearJogButtons.html +2 -2
- package/docs/variables/components_JogPanel.DefaultRotationJogButtons.html +2 -2
- package/docs/variables/components_Osk.Osk.html +1 -0
- package/docs/variables/components_ProgressBarWithValue.ProgressBarWithValue.html +1 -0
- package/docs/variables/components_ToggleGroup.ToggleGroup.html +1 -0
- package/docs/variables/components_ValueInput.ValueInput.html +4 -0
- package/docs/variables/core_AutoCoreTagContext.AutoCoreTagContext.html +1 -0
- package/docs/variables/core_AutoCoreTagContext.AutoCoreTagProvider.html +7 -0
- package/docs/variables/core_EventEmitterContext.EventEmitterContext.html +64 -0
- package/docs/variables/core_EventEmitterContext.EventEmitterProvider.html +10 -0
- package/docs/variables/core_MaskPatterns.PrimeReactMaskPatterns.html +14 -0
- package/docs/variables/core_MaskPatterns.RegExMaskPatterns.html +15 -0
- package/docs/variables/core_PositionContext.DimensionsContext.html +6 -0
- package/docs/variables/hooks_useScaledValue.kMillimeters2Inches.html +2 -0
- package/docs/variables/hooks_useScaledValue.kNewtons2Pounds.html +2 -0
- package/package.json +32 -27
- package/readme.md +193 -22
- package/src/components/AutoCoreDevPanel.tsx +411 -0
- package/src/components/CodeEditor.tsx +2 -2
- package/src/components/FileList.tsx +2 -2
- package/src/components/Indicator.tsx +2 -2
- package/src/components/IndicatorButton.tsx +187 -333
- package/src/components/IndicatorRect.tsx +2 -2
- package/src/components/Lamp.tsx +3 -3
- package/src/components/TextInput.tsx +159 -240
- package/src/components/ToggleGroup.tsx +3 -3
- package/src/components/ValueDisplay.tsx +4 -4
- package/src/components/ValueIndicator.tsx +2 -2
- package/src/components/ValueInput.tsx +2 -2
- package/src/core/AutoCoreTagContext.tsx +698 -0
- package/src/core/AutoCoreTagTypes.ts +202 -0
- package/src/core/EventEmitterContext.tsx +582 -225
- package/src/core/ValueSimulator.ts +2 -2
- package/src/hooks/useAutoCoreTag.ts +103 -0
- package/src/hub/HubBase.ts +3 -3
- package/src/hub/HubSimulate.ts +2 -2
- package/src/hub/HubTauri.ts +3 -3
- package/src/hub/HubWebSocket.ts +29 -32
- package/src/hub/index.ts +2 -2
- package/tsconfig.json +43 -28
- package/docs/classes/components_BlocklyEditor.BlocklyEditor.html +0 -124
- package/docs/classes/components_ValueInput.ValueInput.html +0 -113
- package/docs/functions/assets_BlocklyLogo.default.html +0 -1
- package/docs/functions/assets_Distance.default.html +0 -1
- package/docs/functions/assets_JogLong.default.html +0 -1
- package/docs/functions/assets_JogMedium.default.html +0 -1
- package/docs/functions/assets_JogShort.default.html +0 -1
- package/docs/functions/assets_PythonLogo.default.html +0 -1
- package/docs/functions/assets_Rotation3D.default.html +0 -1
- package/docs/functions/assets_RotationCcw.default.html +0 -1
- package/docs/functions/assets_RotationCcwA.default.html +0 -1
- package/docs/functions/assets_RotationCcwB.default.html +0 -1
- package/docs/functions/assets_RotationCcwC.default.html +0 -1
- package/docs/functions/assets_RotationCw.default.html +0 -1
- package/docs/functions/assets_RotationCwA.default.html +0 -1
- package/docs/functions/assets_RotationCwB.default.html +0 -1
- package/docs/functions/assets_RotationCwC.default.html +0 -1
- package/docs/functions/assets_Run.default.html +0 -1
- package/docs/functions/assets_Speed.default.html +0 -1
- package/docs/functions/assets_SpeedFast.default.html +0 -1
- package/docs/functions/assets_SpeedMedium.default.html +0 -1
- package/docs/functions/assets_SpeedNone.default.html +0 -1
- package/docs/functions/assets_SpeedSlow.default.html +0 -1
- package/docs/functions/assets_Walk.default.html +0 -1
- package/docs/functions/components_FileList.FileList.html +0 -21
- package/docs/functions/components_FitText.FitText.html +0 -8
- package/docs/functions/components_ToggleGroup.ToggleGroup.html +0 -5
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (C) 2024 Automated Design Corp.. All Rights Reserved.
|
|
3
3
|
* Created Date: 2024-04-24 16:01:53
|
|
4
4
|
* -----
|
|
5
|
-
* Last Modified: 2025-
|
|
5
|
+
* Last Modified: 2025-09-05 14:53:22
|
|
6
6
|
* -----
|
|
7
7
|
*
|
|
8
8
|
*/
|
|
@@ -21,7 +21,7 @@ import { Column } from 'primereact/column';
|
|
|
21
21
|
import { Toolbar } from 'primereact/toolbar';
|
|
22
22
|
import { Button } from 'primereact/button';
|
|
23
23
|
import { confirmPopup } from 'primereact/confirmpopup';
|
|
24
|
-
import { FileUpload, FileUploadHandlerEvent} from 'primereact/fileupload';
|
|
24
|
+
import { FileUpload, type FileUploadHandlerEvent} from 'primereact/fileupload';
|
|
25
25
|
|
|
26
26
|
import { EventEmitterContext } from '../core/EventEmitterContext';
|
|
27
27
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (C) 2024 Automated Design Corp. All Rights Reserved.
|
|
3
3
|
* Created Date: 2024-01-16 14:39:41
|
|
4
4
|
* -----
|
|
5
|
-
* Last Modified:
|
|
5
|
+
* Last Modified: 2025-09-05 14:52:12
|
|
6
6
|
* -----
|
|
7
7
|
*
|
|
8
8
|
*/
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import React, { Component } from 'react';
|
|
12
12
|
//import clsx from 'clsx';
|
|
13
|
-
import { EventEmitterContext, EventEmitterContextType } from '../core/EventEmitterContext';
|
|
13
|
+
import { EventEmitterContext, type EventEmitterContextType } from '../core/EventEmitterContext';
|
|
14
14
|
//import { IPositionContext } from '../core/PositionContext';
|
|
15
15
|
import {IndicatorColor} from "../core/IndicatorColor";
|
|
16
16
|
export {IndicatorColor}
|
|
@@ -1,360 +1,214 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import { Component } from 'react';
|
|
13
|
-
import { Button, ButtonProps} from 'primereact/button';
|
|
14
|
-
import { EventEmitterContext, EventEmitterContextType } from '../core/EventEmitterContext';
|
|
15
|
-
import {IndicatorColor} from "../core/IndicatorColor";
|
|
16
|
-
export {IndicatorColor}
|
|
17
|
-
import { ActionMode } from '../core/ActionMode';
|
|
18
|
-
export {ActionMode};
|
|
19
|
-
|
|
20
|
-
import { IndicatorButtonState } from '../core/IndicatorButtonState';
|
|
21
|
-
|
|
22
|
-
export declare type IndicatorButtonOptionsType = string[] | undefined[] | undefined;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Common properties for an indicating button, toggle or similar component.
|
|
27
|
-
* These types of components both indicate a state and execute commands/signals.
|
|
28
|
-
* This type of component is very common in industrial HMIs.
|
|
29
|
-
*
|
|
30
|
-
* These properties support displaying values of boolean, number and string states.
|
|
31
|
-
*
|
|
32
|
-
* Available boolean states: **on**, **off** and **not available**:
|
|
33
|
-
*
|
|
34
|
-
* * `true` is treated as **on**
|
|
35
|
-
* * `false` is treated as **off**
|
|
36
|
-
* * `undefined` is treated as **not available**
|
|
37
|
-
*
|
|
38
|
-
* Numeric values can be used. When there is only 2 or less possible states,
|
|
39
|
-
* 0 will be considered false (OFF), anything else will be considered true (ON).
|
|
40
|
-
* Undefined will be treated as "not available.""
|
|
41
|
-
*
|
|
42
|
-
* When the indicator contains more than 2 states, then the number will be matched
|
|
43
|
-
* to the available state, in order. More than two states requires usage of the
|
|
44
|
-
* options field, and declaring more than two states there.
|
|
45
|
-
*
|
|
46
|
-
* If a string state is used, it will be matched exactly to the matching
|
|
47
|
-
* label in the `options` field.
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* For more information on the AutoCore Button API Specification, see
|
|
51
|
-
* [Additional Documentation](../additional-docs/ButtonApiSpecs.md).
|
|
52
|
-
*/
|
|
53
|
-
export interface IndicatorButtonProps extends Omit<ButtonProps, 'value'> {
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Topic name to monitor for state indication.
|
|
57
|
-
* If `value` field is not undefined, then that value is used instead.
|
|
58
|
-
*/
|
|
59
|
-
topic?: string;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* State to be displayed.
|
|
63
|
-
*
|
|
64
|
-
*/
|
|
65
|
-
value?: boolean | number | string;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Color for the button when the state is TRUE.
|
|
69
|
-
*/
|
|
70
|
-
onColor?: IndicatorColor;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Color for the button when the state is FALSE.
|
|
74
|
-
*/
|
|
75
|
-
offColor?: IndicatorColor;
|
|
76
|
-
|
|
77
|
-
// /**
|
|
78
|
-
// * Text displayed when the state is TRUE. Falls back to `label` if undefined.
|
|
79
|
-
// */
|
|
80
|
-
// onLabel?: string;
|
|
81
|
-
|
|
82
|
-
// /**
|
|
83
|
-
// * Text displayed when the state is FALSE. Falls back to `label` if undefined.
|
|
84
|
-
// */
|
|
85
|
-
// offLabel?: string;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* An array of string labels to display as the available options.
|
|
90
|
-
*
|
|
91
|
-
* For items with 2 states or less:
|
|
92
|
-
* Index 0 is the label when value is OFF.
|
|
93
|
-
* Index 1 is the label when value is ON.
|
|
94
|
-
*
|
|
95
|
-
* If only only value is given (Index 0), then that value is used for all states.
|
|
96
|
-
* For many controls, this is the same as setting the `label` field and leaving this
|
|
97
|
-
* field undefined.
|
|
98
|
-
*/
|
|
99
|
-
options? : IndicatorButtonOptionsType;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Icon to be displayed on the button. Overrideen by onIcon or offIcon if those
|
|
104
|
-
* are not undefined.
|
|
105
|
-
*/
|
|
106
|
-
icon? : string;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Icon displayed when the state is TRUE. Falls back to `icon` if undefined.
|
|
110
|
-
*/
|
|
111
|
-
onIcon? : string;
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Icon displayed when the state is FALSE. Falls back to `icon` if undefined.
|
|
115
|
-
*/
|
|
116
|
-
offIcon? : string;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Name of the command to invoke on button events.
|
|
121
|
-
* If command is "*", then the commandTopic will be dispatched
|
|
122
|
-
* internally.
|
|
123
|
-
*/
|
|
124
|
-
command?: string;
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Optional topic parameter to send along with the command.
|
|
128
|
-
* If set, will automatically be included with commandArgs as
|
|
129
|
-
* the value of field 'topic.'
|
|
130
|
-
*/
|
|
131
|
-
commandTopic? : string;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Optional arguments sent with the command.
|
|
135
|
-
*/
|
|
136
|
-
commandArgs?: any;
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Topic to disable button interaction.
|
|
140
|
-
*/
|
|
141
|
-
disableTopic?: string;
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Topic to control the visibility of the button.
|
|
145
|
-
*/
|
|
146
|
-
invisibleTopic?: string;
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Mode of input for the button (e.g., TAP, TOGGLE).
|
|
150
|
-
*/
|
|
151
|
-
actionMode?: ActionMode;
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Inverts the signal values for TAP, PRESSED, and RELEASED modes.
|
|
155
|
-
*/
|
|
156
|
-
invert?: boolean;
|
|
157
|
-
}
|
|
1
|
+
import React, { useCallback, useContext, useEffect, useState } from "react";
|
|
2
|
+
import { Button, type ButtonProps } from "primereact/button";
|
|
3
|
+
import {
|
|
4
|
+
EventEmitterContext,
|
|
5
|
+
type EventEmitterContextType,
|
|
6
|
+
} from "../core/EventEmitterContext";
|
|
7
|
+
import { IndicatorColor } from "../core/IndicatorColor";
|
|
8
|
+
export { IndicatorColor };
|
|
9
|
+
import { ActionMode } from "../core/ActionMode";
|
|
10
|
+
export { ActionMode };
|
|
158
11
|
|
|
12
|
+
export declare type IndicatorButtonOptionsType =
|
|
13
|
+
| string[]
|
|
14
|
+
| undefined[]
|
|
15
|
+
| undefined;
|
|
159
16
|
|
|
17
|
+
export interface IndicatorButtonProps extends Omit<ButtonProps, "value"> {
|
|
18
|
+
/** Topic name to monitor for state indication. If `value` is not undefined, that value is used instead. */
|
|
19
|
+
topic?: string;
|
|
160
20
|
|
|
161
|
-
|
|
162
|
-
|
|
21
|
+
/** State to be displayed. */
|
|
22
|
+
value?: boolean | number | string;
|
|
163
23
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
onColor: IndicatorColor.IndicatorGreen,
|
|
167
|
-
offColor: "gray", // Default offColor
|
|
168
|
-
// ... other default values for props ...
|
|
169
|
-
};
|
|
24
|
+
/** Color for the button when the state is TRUE. */
|
|
25
|
+
onColor?: IndicatorColor;
|
|
170
26
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
this.state = {
|
|
174
|
-
currentValue: undefined,
|
|
175
|
-
isDisabled: false,
|
|
176
|
-
isInvisible: false,
|
|
177
|
-
isPressed: false
|
|
178
|
-
};
|
|
179
|
-
}
|
|
27
|
+
/** Color for the button when the state is FALSE. */
|
|
28
|
+
offColor?: IndicatorColor;
|
|
180
29
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
30
|
+
/** Labels for available options (see docs). */
|
|
31
|
+
options?: IndicatorButtonOptionsType;
|
|
184
32
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
// Logic to handle updates in props, if necessary
|
|
188
|
-
}
|
|
33
|
+
/** Base icon class (overridden by onIcon/offIcon). */
|
|
34
|
+
icon?: string;
|
|
189
35
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}
|
|
36
|
+
/** Icon when TRUE. */
|
|
37
|
+
onIcon?: string;
|
|
193
38
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
*/
|
|
197
|
-
private setupSubscriptions() {
|
|
198
|
-
const { topic, disableTopic, invisibleTopic } = this.props;
|
|
199
|
-
const { subscribe } = this.context as EventEmitterContextType;
|
|
39
|
+
/** Icon when FALSE. */
|
|
40
|
+
offIcon?: string;
|
|
200
41
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
subscribe(topic, this.handleTopicUpdate);
|
|
204
|
-
}
|
|
42
|
+
/** Name of the command to invoke on button events. */
|
|
43
|
+
command?: string;
|
|
205
44
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
subscribe(disableTopic, this.handleDisableTopicUpdate);
|
|
209
|
-
}
|
|
45
|
+
/** Optional topic sent with the command payload. */
|
|
46
|
+
commandTopic?: string;
|
|
210
47
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
subscribe(invisibleTopic, this.handleInvisibleTopicUpdate);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
48
|
+
/** Optional args sent with the command payload. */
|
|
49
|
+
commandArgs?: any;
|
|
216
50
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
*/
|
|
220
|
-
private handleTopicUpdate = (value: boolean) => {
|
|
221
|
-
this.setState({ currentValue: value });
|
|
222
|
-
};
|
|
51
|
+
/** Input mode (Tap, Pressed, Released). */
|
|
52
|
+
actionMode?: ActionMode;
|
|
223
53
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
*/
|
|
227
|
-
private handleDisableTopicUpdate = (value: boolean) => {
|
|
228
|
-
this.setState({ isDisabled: value });
|
|
229
|
-
};
|
|
54
|
+
/** Inverts values for Tap/Pressed/Released dispatches. */
|
|
55
|
+
invert?: boolean;
|
|
230
56
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
*/
|
|
234
|
-
private handleInvisibleTopicUpdate = (value: boolean) => {
|
|
235
|
-
this.setState({ isInvisible: value });
|
|
236
|
-
};
|
|
57
|
+
/** Directly disables the button (replaces old disableTopic). */
|
|
58
|
+
disabled?: boolean;
|
|
237
59
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
protected handleOnPressed() {
|
|
242
|
-
const { isPressed } = this.state;
|
|
243
|
-
const {actionMode} = this.props;
|
|
244
|
-
|
|
245
|
-
if (!isPressed) {
|
|
246
|
-
this.setState({isPressed: true});
|
|
247
|
-
|
|
248
|
-
if (actionMode === ActionMode.Tap || actionMode === ActionMode.Pressed) {
|
|
249
|
-
this.dispatchCommand(true);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
60
|
+
/** Hides the button (replaces old invisibleTopic/hiddenTopic). */
|
|
61
|
+
hidden?: boolean;
|
|
62
|
+
}
|
|
253
63
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
64
|
+
const toPrimeIcon = (cls?: string) =>
|
|
65
|
+
cls ? (cls.includes("pi ") ? cls : `pi ${cls}`) : undefined;
|
|
66
|
+
|
|
67
|
+
export const IndicatorButton: React.FC<IndicatorButtonProps> = ({
|
|
68
|
+
topic,
|
|
69
|
+
value,
|
|
70
|
+
onColor = IndicatorColor.IndicatorGreen,
|
|
71
|
+
offColor = "gray",
|
|
72
|
+
options,
|
|
73
|
+
icon,
|
|
74
|
+
onIcon,
|
|
75
|
+
offIcon,
|
|
76
|
+
command,
|
|
77
|
+
commandTopic,
|
|
78
|
+
commandArgs,
|
|
79
|
+
actionMode,
|
|
80
|
+
invert,
|
|
81
|
+
className,
|
|
82
|
+
label,
|
|
83
|
+
style,
|
|
84
|
+
disabled,
|
|
85
|
+
hidden,
|
|
86
|
+
...restProps
|
|
87
|
+
}) => {
|
|
88
|
+
const { subscribe, unsubscribe, dispatch } = useContext(
|
|
89
|
+
EventEmitterContext
|
|
90
|
+
) as EventEmitterContextType;
|
|
91
|
+
|
|
92
|
+
const [currentValue, setCurrentValue] = useState<
|
|
93
|
+
boolean | number | string | undefined
|
|
94
|
+
>(undefined);
|
|
95
|
+
const [isPressed, setIsPressed] = useState(false);
|
|
96
|
+
|
|
97
|
+
// Subscribe using autocore-react pattern: subscribe() returns a token; unsubscribe(token)
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
if (!topic || !subscribe) return;
|
|
100
|
+
|
|
101
|
+
const token = subscribe(topic, (val: any) => setCurrentValue(val));
|
|
102
|
+
|
|
103
|
+
return () => {
|
|
104
|
+
try {
|
|
105
|
+
if (unsubscribe && token !== undefined) {
|
|
106
|
+
unsubscribe(token);
|
|
270
107
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
*/
|
|
277
|
-
protected dispatchCommand(value : any) {
|
|
278
|
-
|
|
279
|
-
const {command, commandTopic, commandArgs} = this.props;
|
|
280
|
-
const { dispatch } = this.context as EventEmitterContextType;
|
|
108
|
+
} catch {
|
|
109
|
+
/* no-op */
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}, [topic, subscribe, unsubscribe]);
|
|
281
113
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
const payload = {
|
|
285
|
-
topic: commandTopic,
|
|
286
|
-
value: value,
|
|
287
|
-
...commandArgs
|
|
288
|
-
};
|
|
114
|
+
// Decide which value to show (prop wins over topic-driven value)
|
|
115
|
+
const displayValue = value !== undefined ? value : currentValue;
|
|
289
116
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
});
|
|
117
|
+
// Resolve label based on options + value (supports 2-state and multi-state)
|
|
118
|
+
const resolveLabel = (): string | undefined => {
|
|
119
|
+
if (!options || options.length === 0) return label;
|
|
294
120
|
|
|
121
|
+
// Multi-state: number indexes, string match-by-equality
|
|
122
|
+
if (options.length > 2) {
|
|
123
|
+
if (typeof displayValue === "number") {
|
|
124
|
+
const idx = Math.trunc(displayValue);
|
|
125
|
+
if (idx >= 0 && idx < options.length && options[idx] != null) {
|
|
126
|
+
return String(options[idx]);
|
|
295
127
|
}
|
|
296
|
-
|
|
128
|
+
} else if (typeof displayValue === "string") {
|
|
129
|
+
const idx = options.findIndex((s) => s === displayValue);
|
|
130
|
+
if (idx >= 0) return String(options[idx]);
|
|
131
|
+
}
|
|
132
|
+
// Fallback to provided label if no match
|
|
133
|
+
return label;
|
|
297
134
|
}
|
|
298
135
|
|
|
136
|
+
// Two-state (or one): falsey -> options[0], truthy -> options[1]
|
|
137
|
+
const pick = displayValue ? options[1] : options[0];
|
|
138
|
+
if (pick !== undefined && pick !== null && String(pick).length > 0) {
|
|
139
|
+
return String(pick);
|
|
140
|
+
}
|
|
141
|
+
return label;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const btnLabel = resolveLabel();
|
|
145
|
+
|
|
146
|
+
// Icon selection
|
|
147
|
+
const chosenIcon = toPrimeIcon((displayValue ? onIcon : offIcon) ?? icon);
|
|
148
|
+
|
|
149
|
+
// Color selection (undefined -> invalid color)
|
|
150
|
+
let backgroundColor: string | IndicatorColor | undefined = displayValue
|
|
151
|
+
? onColor
|
|
152
|
+
: offColor;
|
|
153
|
+
if (displayValue === undefined) {
|
|
154
|
+
backgroundColor = IndicatorColor.IndicatorInvalid;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const dispatchCommand = useCallback(
|
|
158
|
+
(raw: boolean) => {
|
|
159
|
+
if (!command || !dispatch) return;
|
|
160
|
+
const payloadValue = invert ? !raw : raw;
|
|
161
|
+
const payload = {
|
|
162
|
+
topic: commandTopic,
|
|
163
|
+
value: payloadValue,
|
|
164
|
+
...(commandArgs ?? {}),
|
|
165
|
+
};
|
|
166
|
+
dispatch({ topic: command, payload });
|
|
167
|
+
},
|
|
168
|
+
[command, dispatch, invert, commandArgs, commandTopic]
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
const handleOnPressed = useCallback(() => {
|
|
172
|
+
if (isPressed) return;
|
|
173
|
+
setIsPressed(true);
|
|
174
|
+
|
|
175
|
+
if (actionMode === ActionMode.Tap || actionMode === ActionMode.Pressed) {
|
|
176
|
+
dispatchCommand(true);
|
|
177
|
+
}
|
|
178
|
+
}, [isPressed, actionMode, dispatchCommand]);
|
|
299
179
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
onColor, offColor, options, topic, command,
|
|
304
|
-
commandArgs, disableTopic, invisibleTopic, inputMode, invert,
|
|
305
|
-
onIcon, offIcon, icon,
|
|
306
|
-
...restProps
|
|
307
|
-
} = this.props;
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
//
|
|
311
|
-
// Load the value from the proper source.
|
|
312
|
-
// If the `value` property is undefined, that takes precedence.
|
|
313
|
-
//
|
|
314
|
-
let displayValue = currentValue;
|
|
315
|
-
if (value !== undefined) {
|
|
316
|
-
displayValue = value;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
// Determine the label and color based on the current state
|
|
320
|
-
let btnLabel = undefined;
|
|
321
|
-
if (options !== undefined && options !== null) {
|
|
322
|
-
btnLabel = displayValue ? options[1] : options[0];
|
|
323
|
-
if (btnLabel === undefined || btnLabel === null || btnLabel.length === 0)
|
|
324
|
-
btnLabel = label;
|
|
325
|
-
}
|
|
326
|
-
else {
|
|
327
|
-
btnLabel = label;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
let btnIcon = displayValue ? onIcon : offIcon;
|
|
331
|
-
if (btnIcon === undefined || btnIcon === null || btnIcon.length === 0)
|
|
332
|
-
btnIcon = icon;
|
|
333
|
-
|
|
334
|
-
let color = displayValue ? onColor : offColor;
|
|
335
|
-
|
|
336
|
-
// Handle special cases like undefined state or specific input modes
|
|
337
|
-
if (displayValue === undefined) {
|
|
338
|
-
color = IndicatorColor.IndicatorInvalid;
|
|
339
|
-
}
|
|
340
|
-
|
|
180
|
+
const handleOnReleased = useCallback(() => {
|
|
181
|
+
if (!isPressed) return;
|
|
182
|
+
setIsPressed(false);
|
|
341
183
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
className={className}
|
|
347
|
-
style={{ color: "white", backgroundColor: color, display: isInvisible ? 'none' : 'block' }}
|
|
348
|
-
disabled={isDisabled}
|
|
349
|
-
onMouseDown={() => this.handleOnPressed() }
|
|
350
|
-
onTouchStart={() => this.handleOnPressed() }
|
|
351
|
-
onMouseUp={() => this.handleOnReleased() }
|
|
352
|
-
onTouchEnd={() => this.handleOnReleased() }
|
|
353
|
-
value={disableTopic}
|
|
354
|
-
raised
|
|
355
|
-
/>
|
|
356
|
-
);
|
|
184
|
+
if (actionMode === ActionMode.Tap) {
|
|
185
|
+
dispatchCommand(false);
|
|
186
|
+
} else if (actionMode === ActionMode.Released) {
|
|
187
|
+
dispatchCommand(true);
|
|
357
188
|
}
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
|
|
189
|
+
}, [isPressed, actionMode, dispatchCommand]);
|
|
190
|
+
|
|
191
|
+
const mergedStyle: React.CSSProperties = {
|
|
192
|
+
color: "white",
|
|
193
|
+
backgroundColor,
|
|
194
|
+
display: hidden ? "none" : "block",
|
|
195
|
+
...(style ?? {}),
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
return (
|
|
199
|
+
<Button
|
|
200
|
+
{...restProps}
|
|
201
|
+
label={btnLabel}
|
|
202
|
+
icon={chosenIcon}
|
|
203
|
+
className={className}
|
|
204
|
+
style={mergedStyle}
|
|
205
|
+
disabled={!!disabled}
|
|
206
|
+
onMouseDown={handleOnPressed}
|
|
207
|
+
onTouchStart={handleOnPressed}
|
|
208
|
+
onMouseUp={handleOnReleased}
|
|
209
|
+
onTouchEnd={handleOnReleased}
|
|
210
|
+
/>
|
|
211
|
+
);
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
export default IndicatorButton;
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Copyright (C) 2025 Automated Design Corp.. All Rights Reserved.
|
|
3
3
|
* Created Date: 2025-01-20 15:09:55
|
|
4
4
|
* -----
|
|
5
|
-
* Last Modified: 2025-
|
|
5
|
+
* Last Modified: 2025-09-05 14:51:58
|
|
6
6
|
* -----
|
|
7
7
|
*
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { Component } from 'react';
|
|
11
|
-
import { EventEmitterContext, EventEmitterContextType } from '../core/EventEmitterContext';
|
|
11
|
+
import { EventEmitterContext, type EventEmitterContextType } from '../core/EventEmitterContext';
|
|
12
12
|
import { IndicatorColor } from "../core/IndicatorColor";
|
|
13
13
|
export { IndicatorColor };
|
|
14
14
|
|
package/src/components/Lamp.tsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (C) 2024 Automated Design Corp. All Rights Reserved.
|
|
3
3
|
* Created Date: 2024-01-16 14:39:41
|
|
4
4
|
* -----
|
|
5
|
-
* Last Modified:
|
|
5
|
+
* Last Modified: 2025-09-05 14:51:51
|
|
6
6
|
* -----
|
|
7
7
|
*
|
|
8
8
|
*/
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
|
|
74
74
|
import React, { Component } from 'react';
|
|
75
75
|
import clsx from 'clsx';
|
|
76
|
-
import { EventEmitterContext, EventEmitterContextType } from '../core/EventEmitterContext';
|
|
77
|
-
import { IPositionContext } from '../core/PositionContext';
|
|
76
|
+
import { EventEmitterContext, type EventEmitterContextType } from '../core/EventEmitterContext';
|
|
77
|
+
import type { IPositionContext } from '../core/PositionContext';
|
|
78
78
|
import {IndicatorColor} from "../core/IndicatorColor";
|
|
79
79
|
export {IndicatorColor}
|
|
80
80
|
|