@nu-art/thunderstorm-frontend 0.400.5
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/_ats/ATS_ActionProcessor/ATS_ActionProcessor.d.ts +17 -0
- package/_ats/ATS_ActionProcessor/ATS_ActionProcessor.js +52 -0
- package/_ats/ATS_ActionProcessor/ATS_ActionProcessor.scss +43 -0
- package/_ats/ATS_AppConfigEditor/ATS_AppConfigEditor.d.ts +25 -0
- package/_ats/ATS_AppConfigEditor/ATS_AppConfigEditor.js +88 -0
- package/_ats/ATS_AppConfigEditor/ATS_AppConfigEditor.scss +117 -0
- package/_ats/ATS_CollectionUpgrades/ATS_CollectionUpgrades.d.ts +17 -0
- package/_ats/ATS_CollectionUpgrades/ATS_CollectionUpgrades.js +45 -0
- package/_ats/ATS_CollectionUpgrades/ATS_CollectionUpgrades.scss +24 -0
- package/_ats/ATS_CrudOperations/ATS_CrudOperations.d.ts +29 -0
- package/_ats/ATS_CrudOperations/ATS_CrudOperations.js +93 -0
- package/_ats/ATS_CrudOperations/ATS_CrudOperations.scss +46 -0
- package/_ats/ATS_CrudOperations/ui-components.d.ts +24 -0
- package/_ats/ATS_CrudOperations/ui-components.js +11 -0
- package/_ats/ATS_EditableItem/ATS_EditableItem.d.ts +16 -0
- package/_ats/ATS_EditableItem/ATS_EditableItem.js +48 -0
- package/_ats/ATS_IDBCacheComparison/ATS_IDBCacheComparison.d.ts +18 -0
- package/_ats/ATS_IDBCacheComparison/ATS_IDBCacheComparison.js +28 -0
- package/_ats/ATS_IDBCacheComparison/ATS_IDBCacheComparison.scss +7 -0
- package/_ats/ATS_IDBCacheComparison/Component_CollectionGrid.d.ts +23 -0
- package/_ats/ATS_IDBCacheComparison/Component_CollectionGrid.js +66 -0
- package/_ats/ATS_IDBCacheComparison/Component_CollectionGrid.scss +52 -0
- package/_ats/ATS_IDBCacheComparison/Dialog_IDBCacheComparison.d.ts +17 -0
- package/_ats/ATS_IDBCacheComparison/Dialog_IDBCacheComparison.js +30 -0
- package/_ats/ATS_IDBCacheComparison/Dialog_IDBCacheComparison.scss +25 -0
- package/_ats/ATS_Printables/ATS_AbstractPrintable.d.ts +16 -0
- package/_ats/ATS_Printables/ATS_AbstractPrintable.js +37 -0
- package/_ats/ATS_Printables/ATS_Printable.d.ts +13 -0
- package/_ats/ATS_Printables/ATS_Printable.js +45 -0
- package/_ats/ATS_Printables/ATS_Printable.scss +40 -0
- package/_ats/ATS_ProtoComponent/ATS_ProtoComponent.d.ts +33 -0
- package/_ats/ATS_ProtoComponent/ATS_ProtoComponent.js +80 -0
- package/_ats/ATS_ProtoComponent/ATS_ProtoComponent.scss +19 -0
- package/_ats/ATS_SyncEnv/ATS_SyncEnv.d.ts +51 -0
- package/_ats/ATS_SyncEnv/ATS_SyncEnv.js +215 -0
- package/_ats/ATS_SyncEnv/ATS_SyncEnv.scss +172 -0
- package/_ats/ATS_Toaster/ATS_Toaster.d.ts +23 -0
- package/_ats/ATS_Toaster/ATS_Toaster.js +48 -0
- package/_ats/ATS_Toaster/ATS_Toaster.scss +2 -0
- package/_ats/ATS_Toaster/index.d.ts +1 -0
- package/_ats/ATS_Toaster/index.js +1 -0
- package/_ats/dialogs/Dialog_ActionProcessorConfirmation/Dialog_ActionProcessorConfirmation.d.ts +18 -0
- package/_ats/dialogs/Dialog_ActionProcessorConfirmation/Dialog_ActionProcessorConfirmation.js +41 -0
- package/_ats/dialogs/Dialog_ActionProcessorConfirmation/Dialog_ActionProcessorConfirmation.scss +71 -0
- package/_ats/dialogs/index.d.ts +1 -0
- package/_ats/dialogs/index.js +1 -0
- package/_ats/index.d.ts +8 -0
- package/_ats/index.js +8 -0
- package/_entity/app-config/ModuleFE_AppConfig.d.ts +24 -0
- package/_entity/app-config/ModuleFE_AppConfig.js +52 -0
- package/_entity/app-config/index.d.ts +2 -0
- package/_entity/app-config/index.js +2 -0
- package/_entity/app-config/module-pack.d.ts +1 -0
- package/_entity/app-config/module-pack.js +2 -0
- package/_entity/editable-test/ModuleFE_EditableTest.d.ts +11 -0
- package/_entity/editable-test/ModuleFE_EditableTest.js +12 -0
- package/_entity/editable-test/index.d.ts +2 -0
- package/_entity/editable-test/index.js +2 -0
- package/_entity/editable-test/module-pack.d.ts +1 -0
- package/_entity/editable-test/module-pack.js +2 -0
- package/_entity/editable-test/ui-components.d.ts +37 -0
- package/_entity/editable-test/ui-components.js +21 -0
- package/_entity.d.ts +2 -0
- package/_entity.js +2 -0
- package/_to-refactor/MenuAndButton.d.ts +1 -0
- package/_to-refactor/MenuAndButton.js +87 -0
- package/behavior-functions/index.d.ts +1 -0
- package/behavior-functions/index.js +1 -0
- package/behavior-functions/scroll-into-view.d.ts +6 -0
- package/behavior-functions/scroll-into-view.js +55 -0
- package/component-modules/ModuleFE_Dialog.d.ts +27 -0
- package/component-modules/ModuleFE_Dialog.js +48 -0
- package/component-modules/ModuleFE_Notifications.d.ts +45 -0
- package/component-modules/ModuleFE_Notifications.js +133 -0
- package/component-modules/ModuleFE_Toaster.d.ts +28 -0
- package/component-modules/ModuleFE_Toaster.js +97 -0
- package/component-modules/mouse-interactivity/ModuleFE_MouseInteractivity.d.ts +9 -0
- package/component-modules/mouse-interactivity/ModuleFE_MouseInteractivity.js +35 -0
- package/component-modules/mouse-interactivity/helper-functions.d.ts +108 -0
- package/component-modules/mouse-interactivity/helper-functions.js +339 -0
- package/component-modules/mouse-interactivity/index.d.ts +3 -0
- package/component-modules/mouse-interactivity/index.js +3 -0
- package/component-modules/mouse-interactivity/types.d.ts +37 -0
- package/component-modules/mouse-interactivity/types.js +2 -0
- package/components/ActionButton.d.ts +7 -0
- package/components/ActionButton.js +29 -0
- package/components/AwaitModules/AwaitModules.d.ts +40 -0
- package/components/AwaitModules/AwaitModules.js +95 -0
- package/components/AwaitModules/AwaitModules.scss +53 -0
- package/components/AwaitSync/AwaitSync.d.ts +18 -0
- package/components/AwaitSync/AwaitSync.js +25 -0
- package/components/AwaitSync/AwaitSync.scss +13 -0
- package/components/Button/ATS_Button.d.ts +21 -0
- package/components/Button/ATS_Button.js +66 -0
- package/components/Button/ATS_Button.scss +19 -0
- package/components/Button/Button.d.ts +40 -0
- package/components/Button/Button.js +94 -0
- package/components/Button/Button.scss +151 -0
- package/components/FrameLayout/FrameLayout.d.ts +7 -0
- package/components/FrameLayout/FrameLayout.js +10 -0
- package/components/FrameLayout/FrameLayout.scss +5 -0
- package/components/FrameLayout/index.d.ts +1 -0
- package/components/FrameLayout/index.js +1 -0
- package/components/GenericDropDown/GenericDropDownV3.d.ts +108 -0
- package/components/GenericDropDown/GenericDropDownV3.js +98 -0
- package/components/GenericDropDown/index.d.ts +1 -0
- package/components/GenericDropDown/index.js +1 -0
- package/components/GenericRenderer/Component_GenericRenderer.d.ts +15 -0
- package/components/GenericRenderer/Component_GenericRenderer.js +13 -0
- package/components/HeightBounder.d.ts +11 -0
- package/components/HeightBounder.js +25 -0
- package/components/Label/ATS_Label.d.ts +12 -0
- package/components/Label/ATS_Label.js +34 -0
- package/components/Label/ATS_Label.scss +24 -0
- package/components/Label/Label.d.ts +30 -0
- package/components/Label/Label.js +84 -0
- package/components/Label/Label.scss +89 -0
- package/components/Layouts/Layouts.d.ts +38 -0
- package/components/Layouts/Layouts.js +56 -0
- package/components/Layouts/_Layouts.scss +53 -0
- package/components/Layouts/_Layouts_.scss +69 -0
- package/components/Layouts/index.d.ts +1 -0
- package/components/Layouts/index.js +21 -0
- package/components/Page_ItemsEditor/Page_ItemsEditor.d.ts +66 -0
- package/components/Page_ItemsEditor/Page_ItemsEditor.js +134 -0
- package/components/Page_ItemsEditor/Page_ItemsEditor.scss +104 -0
- package/components/Page_ItemsEditor/defaults/ItemEditor_DefaultFilter/ItemEditor_DefaultFilter.d.ts +16 -0
- package/components/Page_ItemsEditor/defaults/ItemEditor_DefaultFilter/ItemEditor_DefaultFilter.js +15 -0
- package/components/Page_ItemsEditor/defaults/ItemEditor_DefaultFilter/ItemEditor_DefaultFilter.scss +4 -0
- package/components/Page_ItemsEditor/defaults/ItemEditor_DefaultFilter/index.d.ts +1 -0
- package/components/Page_ItemsEditor/defaults/ItemEditor_DefaultFilter/index.js +1 -0
- package/components/Page_ItemsEditor/defaults/ItemEditor_ListRenderer/ItemEditor_DefaultList.d.ts +26 -0
- package/components/Page_ItemsEditor/defaults/ItemEditor_ListRenderer/ItemEditor_DefaultList.js +68 -0
- package/components/Page_ItemsEditor/defaults/ItemEditor_ListRenderer/ItemEditor_DefaultList.scss +4 -0
- package/components/Page_ItemsEditor/defaults/ItemEditor_ListRenderer/index.d.ts +1 -0
- package/components/Page_ItemsEditor/defaults/ItemEditor_ListRenderer/index.js +1 -0
- package/components/Page_ItemsEditor/index.d.ts +1 -0
- package/components/Page_ItemsEditor/index.js +1 -0
- package/components/Page_ItemsEditor/types.d.ts +4 -0
- package/components/Page_ItemsEditor/types.js +1 -0
- package/components/RelativeLayout/RelativeLayout.d.ts +7 -0
- package/components/RelativeLayout/RelativeLayout.js +10 -0
- package/components/RelativeLayout/RelativeLayout.scss +3 -0
- package/components/RelativeLayout/index.d.ts +1 -0
- package/components/RelativeLayout/index.js +1 -0
- package/components/Show.d.ts +20 -0
- package/components/Show.js +30 -0
- package/components/TS_AppTools/TS_AppTools.d.ts +30 -0
- package/components/TS_AppTools/TS_AppTools.js +144 -0
- package/components/TS_AppTools/TS_AppTools.scss +193 -0
- package/components/TS_AppTools/TS_AppTools_Default.d.ts +7 -0
- package/components/TS_AppTools/TS_AppTools_Default.js +16 -0
- package/components/TS_AppTools/index.d.ts +2 -0
- package/components/TS_AppTools/index.js +22 -0
- package/components/TS_AppTools/types.d.ts +19 -0
- package/components/TS_AppTools/types.js +6 -0
- package/components/TS_ButtonGroup/TS_ButtonGroup.d.ts +12 -0
- package/components/TS_ButtonGroup/TS_ButtonGroup.js +94 -0
- package/components/TS_ButtonGroup/TS_ButtonGroup.scss +58 -0
- package/components/TS_ButtonGroup/index.d.ts +2 -0
- package/components/TS_ButtonGroup/index.js +2 -0
- package/components/TS_ButtonGroup/types.d.ts +38 -0
- package/components/TS_ButtonGroup/types.js +1 -0
- package/components/TS_ButtonLoader/TS_ButtonLoader.d.ts +5 -0
- package/components/TS_ButtonLoader/TS_ButtonLoader.js +8 -0
- package/components/TS_ButtonLoader/TS_ButtonLoader.scss +63 -0
- package/components/TS_ButtonLoader/index.d.ts +1 -0
- package/components/TS_ButtonLoader/index.js +1 -0
- package/components/TS_Card/TS_Card.d.ts +7 -0
- package/components/TS_Card/TS_Card.js +14 -0
- package/components/TS_Card/TS_Card.scss +7 -0
- package/components/TS_Card/index.d.ts +1 -0
- package/components/TS_Card/index.js +1 -0
- package/components/TS_Checkbox/ATS_CheckboxV2.d.ts +3 -0
- package/components/TS_Checkbox/ATS_CheckboxV2.js +30 -0
- package/components/TS_Checkbox/ATS_CheckboxV2.scss +4 -0
- package/components/TS_Checkbox/TS_Checkbox.d.ts +48 -0
- package/components/TS_Checkbox/TS_Checkbox.js +46 -0
- package/components/TS_Checkbox/TS_Checkbox.scss +62 -0
- package/components/TS_Checkbox/TS_CheckboxV2.d.ts +37 -0
- package/components/TS_Checkbox/TS_CheckboxV2.js +53 -0
- package/components/TS_Checkbox/TS_CheckboxV2.scss +97 -0
- package/components/TS_Checkbox/index.d.ts +1 -0
- package/components/TS_Checkbox/index.js +21 -0
- package/components/TS_CheckboxGroup/ATS_CheckboxGroup.d.ts +19 -0
- package/components/TS_CheckboxGroup/ATS_CheckboxGroup.js +89 -0
- package/components/TS_CheckboxGroup/ATS_CheckboxGroup.scss +6 -0
- package/components/TS_CheckboxGroup/TS_CheckboxGroup.d.ts +35 -0
- package/components/TS_CheckboxGroup/TS_CheckboxGroup.js +47 -0
- package/components/TS_CheckboxGroup/TS_CheckboxGroup.scss +32 -0
- package/components/TS_CheckboxGroup/index.d.ts +1 -0
- package/components/TS_CheckboxGroup/index.js +1 -0
- package/components/TS_CollapsableContainer/TS_CollapsableContainer.d.ts +44 -0
- package/components/TS_CollapsableContainer/TS_CollapsableContainer.js +80 -0
- package/components/TS_CollapsableContainer/TS_CollapsableContainer.scss +47 -0
- package/components/TS_CollapsableContainer/index.d.ts +1 -0
- package/components/TS_CollapsableContainer/index.js +1 -0
- package/components/TS_CollapsableContainerV2/TS_CollapsableContainerV2.d.ts +36 -0
- package/components/TS_CollapsableContainerV2/TS_CollapsableContainerV2.js +46 -0
- package/components/TS_CollapsableContainerV2/TS_CollapsableContainerV2.scss +66 -0
- package/components/TS_CollapsableContainerV2/ats.d.ts +3 -0
- package/components/TS_CollapsableContainerV2/ats.js +39 -0
- package/components/TS_CollapsableContainerV2/ats.scss +35 -0
- package/components/TS_CollapsableContainerV2/index.d.ts +2 -0
- package/components/TS_CollapsableContainerV2/index.js +2 -0
- package/components/TS_ComponentTransition/TS_ComponentTransition.d.ts +25 -0
- package/components/TS_ComponentTransition/TS_ComponentTransition.js +65 -0
- package/components/TS_ComponentTransition/index.d.ts +1 -0
- package/components/TS_ComponentTransition/index.js +1 -0
- package/components/TS_CopyToClipboard/TS_CopyToClipboard.d.ts +4 -0
- package/components/TS_CopyToClipboard/TS_CopyToClipboard.js +11 -0
- package/components/TS_CopyToClipboard/index.d.ts +1 -0
- package/components/TS_CopyToClipboard/index.js +21 -0
- package/components/TS_Dialog/TS_Dialog.d.ts +89 -0
- package/components/TS_Dialog/TS_Dialog.js +140 -0
- package/components/TS_Dialog/TS_Dialog.scss +116 -0
- package/components/TS_Dialog/TS_DialogOverlay.d.ts +15 -0
- package/components/TS_Dialog/TS_DialogOverlay.js +48 -0
- package/components/TS_Dialog/TS_DialogOverlay.scss +41 -0
- package/components/TS_Dialog/TS_SimpleDialog.d.ts +21 -0
- package/components/TS_Dialog/TS_SimpleDialog.js +37 -0
- package/components/TS_Dialog/TS_SimpleDialog.scss +5 -0
- package/components/TS_Dialog/TS_SimpleDialogue.d.ts +28 -0
- package/components/TS_Dialog/TS_SimpleDialogue.js +38 -0
- package/components/TS_Dialog/index.d.ts +2 -0
- package/components/TS_Dialog/index.js +22 -0
- package/components/TS_DragAndDrop/TS_DragAndDrop.d.ts +48 -0
- package/components/TS_DragAndDrop/TS_DragAndDrop.js +105 -0
- package/components/TS_DragAndDrop/TS_DragAndDrop.scss +61 -0
- package/components/TS_DragAndDrop/index.d.ts +1 -0
- package/components/TS_DragAndDrop/index.js +21 -0
- package/components/TS_Dropdown/TS_DropDown.d.ts +120 -0
- package/components/TS_Dropdown/TS_DropDown.js +332 -0
- package/components/TS_Dropdown/TS_DropDown.scss +134 -0
- package/components/TS_Dropdown/index.d.ts +1 -0
- package/components/TS_Dropdown/index.js +21 -0
- package/components/TS_EditableContent/TS_EditableContent.d.ts +19 -0
- package/components/TS_EditableContent/TS_EditableContent.js +32 -0
- package/components/TS_EditableContent/types.d.ts +4 -0
- package/components/TS_EditableContent/types.js +1 -0
- package/components/TS_EditableItemComponent/TS_EditableItemComponent.d.ts +23 -0
- package/components/TS_EditableItemComponent/TS_EditableItemComponent.js +47 -0
- package/components/TS_EditableItemController/TS_EditableItemController.d.ts +36 -0
- package/components/TS_EditableItemController/TS_EditableItemController.js +54 -0
- package/components/TS_EditableItemController/TS_EditableItemController.scss +3 -0
- package/components/TS_EditableItemController/index.d.ts +1 -0
- package/components/TS_EditableItemController/index.js +1 -0
- package/components/TS_EditableItemControllerProto/TS_EditableItemControllerProto.d.ts +32 -0
- package/components/TS_EditableItemControllerProto/TS_EditableItemControllerProto.js +53 -0
- package/components/TS_EditableItemControllerProto/TS_EditableItemControllerProto.scss +3 -0
- package/components/TS_EditableItemControllerProto/index.d.ts +1 -0
- package/components/TS_EditableItemControllerProto/index.js +1 -0
- package/components/TS_EditableItemStatus/TS_EditableItemStatus.d.ts +20 -0
- package/components/TS_EditableItemStatus/TS_EditableItemStatus.js +34 -0
- package/components/TS_EditableText/TS_EditableText.d.ts +57 -0
- package/components/TS_EditableText/TS_EditableText.js +100 -0
- package/components/TS_EditableText/TS_EditableText.scss +90 -0
- package/components/TS_EditableText/index.d.ts +1 -0
- package/components/TS_EditableText/index.js +1 -0
- package/components/TS_ErrorBoundary/TS_ErrorBoundary.d.ts +54 -0
- package/components/TS_ErrorBoundary/TS_ErrorBoundary.js +103 -0
- package/components/TS_ErrorBoundary/TS_ErrorBoundary.scss +95 -0
- package/components/TS_ErrorBoundary/index.d.ts +1 -0
- package/components/TS_ErrorBoundary/index.js +21 -0
- package/components/TS_Form/TS_Form.d.ts +9 -0
- package/components/TS_Form/TS_Form.js +11 -0
- package/components/TS_Form/TS_Form.scss +0 -0
- package/components/TS_Form/consts.d.ts +1 -0
- package/components/TS_Form/consts.js +1 -0
- package/components/TS_Form/index.d.ts +3 -0
- package/components/TS_Form/index.js +3 -0
- package/components/TS_Form/types.d.ts +13 -0
- package/components/TS_Form/types.js +1 -0
- package/components/TS_GridTableProto/TS_GridTableProto.d.ts +18 -0
- package/components/TS_GridTableProto/TS_GridTableProto.js +22 -0
- package/components/TS_GridTableProto/TS_GridTableProto.scss +4 -0
- package/components/TS_GridTableProto/index.d.ts +1 -0
- package/components/TS_GridTableProto/index.js +1 -0
- package/components/TS_Input/ATS_TextArea.d.ts +14 -0
- package/components/TS_Input/ATS_TextArea.js +24 -0
- package/components/TS_Input/ATS_TextArea.scss +24 -0
- package/components/TS_Input/TS_BaseInput.d.ts +44 -0
- package/components/TS_Input/TS_BaseInput.js +47 -0
- package/components/TS_Input/TS_Input.d.ts +24 -0
- package/components/TS_Input/TS_Input.js +53 -0
- package/components/TS_Input/TS_Input.scss +64 -0
- package/components/TS_Input/TS_TextArea.d.ts +14 -0
- package/components/TS_Input/TS_TextArea.js +72 -0
- package/components/TS_Input/TS_TextArea.scss +41 -0
- package/components/TS_Input/index.d.ts +4 -0
- package/components/TS_Input/index.js +25 -0
- package/components/TS_JSONViewer/TS_JSONViewer.d.ts +18 -0
- package/components/TS_JSONViewer/TS_JSONViewer.js +64 -0
- package/components/TS_JSONViewer/TS_JSONViewer.scss +87 -0
- package/components/TS_JSONViewer/types.d.ts +10 -0
- package/components/TS_JSONViewer/types.js +1 -0
- package/components/TS_Link/TS_Link.d.ts +15 -0
- package/components/TS_Link/TS_Link.js +36 -0
- package/components/TS_Link/TS_Link.scss +32 -0
- package/components/TS_Link/index.d.ts +1 -0
- package/components/TS_Link/index.js +21 -0
- package/components/TS_ListOrganizer/TS_ListOrganizer.d.ts +33 -0
- package/components/TS_ListOrganizer/TS_ListOrganizer.js +64 -0
- package/components/TS_ListOrganizer/TS_ListOrganizer.scss +37 -0
- package/components/TS_ListOrganizer/index.d.ts +1 -0
- package/components/TS_ListOrganizer/index.js +21 -0
- package/components/TS_Loader/TS_Loader.d.ts +6 -0
- package/components/TS_Loader/TS_Loader.js +9 -0
- package/components/TS_Loader/TS_Loader.scss +71 -0
- package/components/TS_Loader/index.d.ts +1 -0
- package/components/TS_Loader/index.js +1 -0
- package/components/TS_MemoryMonitor/TS_MemoryMonitor.d.ts +10 -0
- package/components/TS_MemoryMonitor/TS_MemoryMonitor.js +48 -0
- package/components/TS_MemoryMonitor/TS_MemoryMonitor.scss +31 -0
- package/components/TS_MemoryMonitor/index.d.ts +1 -0
- package/components/TS_MemoryMonitor/index.js +21 -0
- package/components/TS_MouseInteractivity/TS_PopUp/TS_PopUp.d.ts +9 -0
- package/components/TS_MouseInteractivity/TS_PopUp/TS_PopUp.js +28 -0
- package/components/TS_MouseInteractivity/TS_PopUp/TS_PopUp.scss +53 -0
- package/components/TS_MouseInteractivity/TS_Tooltip/TS_ToolTip.d.ts +12 -0
- package/components/TS_MouseInteractivity/TS_Tooltip/TS_ToolTip.js +65 -0
- package/components/TS_MouseInteractivity/TS_Tooltip/TS_ToolTip.scss +46 -0
- package/components/TS_MouseInteractivity/base/TS_MouseInteractivity.d.ts +18 -0
- package/components/TS_MouseInteractivity/base/TS_MouseInteractivity.js +100 -0
- package/components/TS_MouseInteractivity/index.d.ts +2 -0
- package/components/TS_MouseInteractivity/index.js +22 -0
- package/components/TS_MultiSelect/TS_MultiSelect.scss +34 -0
- package/components/TS_MultiSelect/TS_MultiSelect_V2.d.ts +36 -0
- package/components/TS_MultiSelect/TS_MultiSelect_V2.js +41 -0
- package/components/TS_MultiSelect/index.d.ts +1 -0
- package/components/TS_MultiSelect/index.js +21 -0
- package/components/TS_Notifications/TS_Notifications.d.ts +22 -0
- package/components/TS_Notifications/TS_Notifications.js +96 -0
- package/components/TS_Notifications/TS_Notifications.scss +120 -0
- package/components/TS_Notifications/genericNotificationAction.d.ts +8 -0
- package/components/TS_Notifications/genericNotificationAction.js +16 -0
- package/components/TS_Notifications/index.d.ts +2 -0
- package/components/TS_Notifications/index.js +2 -0
- package/components/TS_Overlay/TS_Overlay.d.ts +12 -0
- package/components/TS_Overlay/TS_Overlay.js +32 -0
- package/components/TS_Overlay/TS_Overlay.scss +41 -0
- package/components/TS_Overlay/index.d.ts +1 -0
- package/components/TS_Overlay/index.js +21 -0
- package/components/TS_Printable/TS_Printable.d.ts +13 -0
- package/components/TS_Printable/TS_Printable.js +20 -0
- package/components/TS_Printable/TS_Printable.scss +47 -0
- package/components/TS_Printable/index.d.ts +1 -0
- package/components/TS_Printable/index.js +21 -0
- package/components/TS_ProgressBar/TS_ProgressBar.d.ts +22 -0
- package/components/TS_ProgressBar/TS_ProgressBar.js +47 -0
- package/components/TS_ProgressBar/TS_ProgressBar.scss +79 -0
- package/components/TS_ProgressBar/index.d.ts +1 -0
- package/components/TS_ProgressBar/index.js +1 -0
- package/components/TS_PropRenderer/TS_PropRenderer.d.ts +18 -0
- package/components/TS_PropRenderer/TS_PropRenderer.js +36 -0
- package/components/TS_PropRenderer/TS_PropRenderer.scss +19 -0
- package/components/TS_PropRenderer/index.d.ts +1 -0
- package/components/TS_PropRenderer/index.js +1 -0
- package/components/TS_Radio/TS_Radio.d.ts +34 -0
- package/components/TS_Radio/TS_Radio.js +49 -0
- package/components/TS_Radio/TS_Radio.scss +68 -0
- package/components/TS_Radio/index.d.ts +1 -0
- package/components/TS_Radio/index.js +1 -0
- package/components/TS_ReadMore/TS_ReadMore.d.ts +26 -0
- package/components/TS_ReadMore/TS_ReadMore.js +86 -0
- package/components/TS_ReadMore/TS_ReadMore.scss +36 -0
- package/components/TS_ReadMore/index.d.ts +1 -0
- package/components/TS_ReadMore/index.js +1 -0
- package/components/TS_Slider/TS_Slider.d.ts +26 -0
- package/components/TS_Slider/TS_Slider.js +42 -0
- package/components/TS_Slider/TS_Slider.scss +68 -0
- package/components/TS_Slider/index.d.ts +1 -0
- package/components/TS_Slider/index.js +1 -0
- package/components/TS_Space/TS_Space.d.ts +8 -0
- package/components/TS_Space/TS_Space.js +8 -0
- package/components/TS_Space/index.d.ts +1 -0
- package/components/TS_Space/index.js +1 -0
- package/components/TS_Space/ts-space.scss +3 -0
- package/components/TS_Table/TS_Table.d.ts +42 -0
- package/components/TS_Table/TS_Table.js +74 -0
- package/components/TS_Table/TS_Table.scss +51 -0
- package/components/TS_Table/index.d.ts +1 -0
- package/components/TS_Table/index.js +21 -0
- package/components/TS_Tabs/TS_Tabs.d.ts +55 -0
- package/components/TS_Tabs/TS_Tabs.js +102 -0
- package/components/TS_Tabs/TS_Tabs.scss +103 -0
- package/components/TS_Tabs/index.d.ts +1 -0
- package/components/TS_Tabs/index.js +21 -0
- package/components/TS_Toaster/TS_Toast.d.ts +5 -0
- package/components/TS_Toaster/TS_Toast.js +9 -0
- package/components/TS_Toaster/TS_Toast.scss +80 -0
- package/components/TS_Toaster/TS_ToastOverlay.d.ts +16 -0
- package/components/TS_Toaster/TS_ToastOverlay.js +26 -0
- package/components/TS_Toaster/TS_ToastOverlay.scss +33 -0
- package/components/TS_Toaster/index.d.ts +2 -0
- package/components/TS_Toaster/index.js +22 -0
- package/components/TS_Toggle/ATS_Toggle.d.ts +11 -0
- package/components/TS_Toggle/ATS_Toggle.js +18 -0
- package/components/TS_Toggle/TS_Toggle.d.ts +21 -0
- package/components/TS_Toggle/TS_Toggle.js +26 -0
- package/components/TS_Toggle/TS_Toggle.scss +56 -0
- package/components/TS_Toggle/index.d.ts +2 -0
- package/components/TS_Toggle/index.js +2 -0
- package/components/TS_Toggler/TS_Toggler.d.ts +23 -0
- package/components/TS_Toggler/TS_Toggler.js +50 -0
- package/components/TS_Toggler/TS_Toggler.scss +83 -0
- package/components/TS_Toggler/index.d.ts +1 -0
- package/components/TS_Toggler/index.js +1 -0
- package/components/TS_Tree/SimpleTreeNodeRenderer.d.ts +9 -0
- package/components/TS_Tree/SimpleTreeNodeRenderer.js +53 -0
- package/components/TS_Tree/TS_Tree.d.ts +68 -0
- package/components/TS_Tree/TS_Tree.js +174 -0
- package/components/TS_Tree/TS_Tree.scss +44 -0
- package/components/TS_Tree/index.d.ts +3 -0
- package/components/TS_Tree/index.js +23 -0
- package/components/TS_Tree/types.d.ts +4 -0
- package/components/TS_Tree/types.js +21 -0
- package/components/TS_V2_Input/TS_InputV2.d.ts +93 -0
- package/components/TS_V2_Input/TS_InputV2.js +220 -0
- package/components/TS_V2_Input/index.d.ts +1 -0
- package/components/TS_V2_Input/index.js +21 -0
- package/components/TS_V2_TextArea/TS_BaseInput.d.ts +42 -0
- package/components/TS_V2_TextArea/TS_BaseInput.js +46 -0
- package/components/TS_V2_TextArea/TS_TextAreaV2.d.ts +78 -0
- package/components/TS_V2_TextArea/TS_TextAreaV2.js +178 -0
- package/components/TS_V2_TextArea/TS_TextAreaV2.scss +49 -0
- package/components/TS_V2_TextArea/index.d.ts +2 -0
- package/components/TS_V2_TextArea/index.js +22 -0
- package/components/TS_VirtualizedList/TS_VirtualizedList.d.ts +14 -0
- package/components/TS_VirtualizedList/TS_VirtualizedList.js +22 -0
- package/components/TS_VirtualizedList/index.d.ts +1 -0
- package/components/TS_VirtualizedList/index.js +1 -0
- package/components/Video/Video.d.ts +16 -0
- package/components/Video/Video.js +40 -0
- package/components/Video/VideoDialog.d.ts +20 -0
- package/components/Video/VideoDialog.js +44 -0
- package/components/Video/VideoDialog.scss +31 -0
- package/components/Video/types.d.ts +20 -0
- package/components/Video/types.js +1 -0
- package/components/_TS_MultiSelect/DBItemDropDownMultiSelector.d.ts +57 -0
- package/components/_TS_MultiSelect/DBItemDropDownMultiSelector.js +63 -0
- package/components/adapter/Adapter.d.ts +139 -0
- package/components/adapter/Adapter.js +259 -0
- package/components/adapter/BaseRenderer.d.ts +24 -0
- package/components/adapter/BaseRenderer.js +31 -0
- package/components/ats-group.d.ts +2 -0
- package/components/ats-group.js +14 -0
- package/components/form/Form.d.ts +24 -0
- package/components/form/Form.js +34 -0
- package/components/form/types.d.ts +23 -0
- package/components/form/types.js +21 -0
- package/components/formv3/FormV3.d.ts +25 -0
- package/components/formv3/FormV3.js +23 -0
- package/components/formv3/types.d.ts +29 -0
- package/components/formv3/types.js +1 -0
- package/components/treeicons.d.ts +10 -0
- package/components/treeicons.js +3 -0
- package/components/types.d.ts +23 -0
- package/components/types.js +22 -0
- package/components/utils.d.ts +1 -0
- package/components/utils.js +7 -0
- package/consts.d.ts +2 -0
- package/consts.js +2 -0
- package/core/AppPage.d.ts +11 -0
- package/core/AppPage.js +52 -0
- package/core/AppPageV2.d.ts +9 -0
- package/core/AppPageV2.js +53 -0
- package/core/AppWrapper.d.ts +4 -0
- package/core/AppWrapper.js +34 -0
- package/core/ComponentAsync.d.ts +16 -0
- package/core/ComponentAsync.js +64 -0
- package/core/ComponentBase.d.ts +28 -0
- package/core/ComponentBase.js +152 -0
- package/core/ComponentSync.d.ts +13 -0
- package/core/ComponentSync.js +49 -0
- package/core/Controller.d.ts +13 -0
- package/core/Controller.js +28 -0
- package/core/IndexedDB.d.ts +42 -0
- package/core/IndexedDB.js +259 -0
- package/core/IndexedDBV3.d.ts +43 -0
- package/core/IndexedDBV3.js +259 -0
- package/core/IndexedDBV4/IndexedDB_Database.d.ts +20 -0
- package/core/IndexedDBV4/IndexedDB_Database.js +268 -0
- package/core/IndexedDBV4/IndexedDB_Store.d.ts +34 -0
- package/core/IndexedDBV4/IndexedDB_Store.js +207 -0
- package/core/IndexedDBV4/ModuleFE_IDBManager.d.ts +11 -0
- package/core/IndexedDBV4/ModuleFE_IDBManager.js +19 -0
- package/core/IndexedDBV4/types.d.ts +16 -0
- package/core/IndexedDBV4/types.js +1 -0
- package/core/SimpleScriptInjector.d.ts +13 -0
- package/core/SimpleScriptInjector.js +42 -0
- package/core/Thunder.d.ts +37 -0
- package/core/Thunder.js +139 -0
- package/core/ThunderstormDefaultApp.d.ts +12 -0
- package/core/ThunderstormDefaultApp.js +29 -0
- package/core/consts.d.ts +6 -0
- package/core/consts.js +2 -0
- package/core/db-api-gen/consts.d.ts +22 -0
- package/core/db-api-gen/consts.js +25 -0
- package/core/db-api-gen/db-def.d.ts +9 -0
- package/core/db-api-gen/db-def.js +16 -0
- package/core/db-api-gen/types.d.ts +23 -0
- package/core/db-api-gen/types.js +3 -0
- package/core/proto-component/ProtoComponent.d.ts +57 -0
- package/core/proto-component/ProtoComponent.js +73 -0
- package/core/proto-component/UrlState.d.ts +42 -0
- package/core/proto-component/UrlState.js +59 -0
- package/core/proto-component/index.d.ts +2 -0
- package/core/proto-component/index.js +2 -0
- package/core/proto-component/types.d.ts +25 -0
- package/core/proto-component/types.js +15 -0
- package/core/thunder-dispatcher.d.ts +13 -0
- package/core/thunder-dispatcher.js +69 -0
- package/core/thunder-helpers.d.ts +7 -0
- package/core/thunder-helpers.js +171 -0
- package/core/thunder-modulepack.d.ts +3 -0
- package/core/thunder-modulepack.js +34 -0
- package/core/typed-api.d.ts +6 -0
- package/core/typed-api.js +41 -0
- package/core/types.d.ts +6 -0
- package/core/types.js +1 -0
- package/editable-item.d.ts +7 -0
- package/editable-item.js +7 -0
- package/index.d.ts +112 -0
- package/index.js +134 -0
- package/modules/ModuleFE_BaseTheme.d.ts +18 -0
- package/modules/ModuleFE_BaseTheme.js +27 -0
- package/modules/ModuleFE_BroadcastChannel/ModuleFE_BroadcastChannel.d.ts +20 -0
- package/modules/ModuleFE_BroadcastChannel/ModuleFE_BroadcastChannel.js +66 -0
- package/modules/ModuleFE_BrowserHistory.d.ts +46 -0
- package/modules/ModuleFE_BrowserHistory.js +165 -0
- package/modules/ModuleFE_BrowserHistoryV2.d.ts +43 -0
- package/modules/ModuleFE_BrowserHistoryV2.js +113 -0
- package/modules/ModuleFE_CSVParser.d.ts +12 -0
- package/modules/ModuleFE_CSVParser.js +52 -0
- package/modules/ModuleFE_CollectionActions.d.ts +10 -0
- package/modules/ModuleFE_CollectionActions.js +18 -0
- package/modules/ModuleFE_ConnectivityModule.d.ts +15 -0
- package/modules/ModuleFE_ConnectivityModule.js +31 -0
- package/modules/ModuleFE_ForceUpgrade.d.ts +20 -0
- package/modules/ModuleFE_ForceUpgrade.js +54 -0
- package/modules/ModuleFE_LocalStorage.d.ts +46 -0
- package/modules/ModuleFE_LocalStorage.js +179 -0
- package/modules/ModuleFE_Locale.d.ts +44 -0
- package/modules/ModuleFE_Locale.js +83 -0
- package/modules/ModuleFE_Print.d.ts +16 -0
- package/modules/ModuleFE_Print.js +116 -0
- package/modules/ModuleFE_StorageCleaner.d.ts +17 -0
- package/modules/ModuleFE_StorageCleaner.js +90 -0
- package/modules/ModuleFE_Thunderstorm.d.ts +31 -0
- package/modules/ModuleFE_Thunderstorm.js +122 -0
- package/modules/ModuleFE_Utils/ModuleFE_Utils.d.ts +29 -0
- package/modules/ModuleFE_Utils/ModuleFE_Utils.js +43 -0
- package/modules/ModuleFE_Window.d.ts +19 -0
- package/modules/ModuleFE_Window.js +42 -0
- package/modules/ModuleFE_WindowMessenger.d.ts +62 -0
- package/modules/ModuleFE_WindowMessenger.js +128 -0
- package/modules/action-processor/ModuleFE_ActionProcessor.d.ts +9 -0
- package/modules/action-processor/ModuleFE_ActionProcessor.js +14 -0
- package/modules/archiving/ModuleFE_Archiving.d.ts +8 -0
- package/modules/archiving/ModuleFE_Archiving.js +15 -0
- package/modules/clearWebsiteDataDispatcher.d.ts +5 -0
- package/modules/clearWebsiteDataDispatcher.js +2 -0
- package/modules/component-loader/ReactEntryComponentInjector.d.ts +23 -0
- package/modules/component-loader/ReactEntryComponentInjector.js +59 -0
- package/modules/component-loader/entry-component-loading-module.d.ts +7 -0
- package/modules/component-loader/entry-component-loading-module.js +52 -0
- package/modules/component-loader/index.d.ts +2 -0
- package/modules/component-loader/index.js +2 -0
- package/modules/db-api-gen/ModuleFE_BaseApi.d.ts +45 -0
- package/modules/db-api-gen/ModuleFE_BaseApi.js +152 -0
- package/modules/db-api-gen/ModuleFE_BaseDB.d.ts +146 -0
- package/modules/db-api-gen/ModuleFE_BaseDB.js +433 -0
- package/modules/db-api-gen/types.d.ts +13 -0
- package/modules/db-api-gen/types.js +6 -0
- package/modules/http/ModuleFE_XHR.d.ts +20 -0
- package/modules/http/ModuleFE_XHR.js +175 -0
- package/modules/routing/LocationChangeListener.d.ts +6 -0
- package/modules/routing/LocationChangeListener.js +15 -0
- package/modules/routing/ModuleFE_Routing.d.ts +30 -0
- package/modules/routing/ModuleFE_Routing.js +122 -0
- package/modules/routing/ModuleFE_RoutingV2.d.ts +25 -0
- package/modules/routing/ModuleFE_RoutingV2.js +143 -0
- package/modules/routing/index.d.ts +5 -0
- package/modules/routing/index.js +5 -0
- package/modules/routing/route.d.ts +22 -0
- package/modules/routing/route.js +83 -0
- package/modules/routing/types.d.ts +20 -0
- package/modules/routing/types.js +1 -0
- package/modules/sync-env/ModuleFE_SyncEnvV2.d.ts +8 -0
- package/modules/sync-env/ModuleFE_SyncEnvV2.js +18 -0
- package/modules/sync-manager/ModuleFE_SyncManager.d.ts +59 -0
- package/modules/sync-manager/ModuleFE_SyncManager.js +378 -0
- package/modules/sync-manager/ModuleFE_SyncManager_CSV.d.ts +11 -0
- package/modules/sync-manager/ModuleFE_SyncManager_CSV.js +121 -0
- package/package.json +107 -0
- package/server-info/Button_VersionUpdate.d.ts +15 -0
- package/server-info/Button_VersionUpdate.js +29 -0
- package/server-info/Button_VersionUpdate.scss +29 -0
- package/server-info/ModuleFE_ServerInfo.d.ts +26 -0
- package/server-info/ModuleFE_ServerInfo.js +73 -0
- package/server-info/index.d.ts +2 -0
- package/server-info/index.js +2 -0
- package/shared.d.ts +1 -0
- package/shared.js +21 -0
- package/styles/declaration/basic.scss +155 -0
- package/styles/declaration/mixins.scss +58 -0
- package/styles/impl/basic.scss +141 -0
- package/styles/impl/icons.scss +34 -0
- package/styles.scss +40 -0
- package/utils/EditableItem.d.ts +240 -0
- package/utils/EditableItem.js +552 -0
- package/utils/console/LogClient_ConsoleInterceptor.d.ts +5 -0
- package/utils/console/LogClient_ConsoleInterceptor.js +70 -0
- package/utils/perform-action/genereteToasts.d.ts +3 -0
- package/utils/perform-action/genereteToasts.js +14 -0
- package/utils/perform-action/index.d.ts +2 -0
- package/utils/perform-action/index.js +2 -0
- package/utils/perform-action/notification-dispatchers.d.ts +6 -0
- package/utils/perform-action/notification-dispatchers.js +2 -0
- package/utils/perform-action/performAction.d.ts +34 -0
- package/utils/perform-action/performAction.js +77 -0
- package/utils/perform-action/resolve-dependency-toast/ResolveDependencyToast.d.ts +8 -0
- package/utils/perform-action/resolve-dependency-toast/ResolveDependencyToast.js +11 -0
- package/utils/perform-action/resolve-dependency-toast/ResolveDependencyToast.scss +12 -0
- package/utils/tools.d.ts +31 -0
- package/utils/tools.js +138 -0
- package/utils/types.d.ts +3 -0
- package/utils/types.js +1 -0
- package/widgets/FieldEditor.d.ts +29 -0
- package/widgets/FieldEditor.js +47 -0
- package/widgets/FieldEditorClick.d.ts +33 -0
- package/widgets/FieldEditorClick.js +49 -0
- package/widgets/FieldEditorWithButtons.d.ts +32 -0
- package/widgets/FieldEditorWithButtons.js +42 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Thunderstorm is a full web app framework!
|
|
3
|
+
*
|
|
4
|
+
* Typescript & Express backend infrastructure that natively runs on firebase function
|
|
5
|
+
* Typescript & React frontend infrastructure
|
|
6
|
+
*
|
|
7
|
+
* Copyright (C) 2020 Adam van der Kruk aka TacB0sS
|
|
8
|
+
*
|
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
* you may not use this file except in compliance with the License.
|
|
11
|
+
* You may obtain a copy of the License at
|
|
12
|
+
*
|
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
* See the License for the specific language governing permissions and
|
|
19
|
+
* limitations under the License.
|
|
20
|
+
*/
|
|
21
|
+
import { _keys, BadImplementationException, Module } from '@nu-art/ts-common';
|
|
22
|
+
import { ModuleFE_Toaster } from '../component-modules/ModuleFE_Toaster.js';
|
|
23
|
+
import { composeURL } from './ModuleFE_BrowserHistory.js';
|
|
24
|
+
import { HttpMethod } from '@nu-art/thunderstorm-shared';
|
|
25
|
+
import { base64ToBlob } from '../utils/tools.js';
|
|
26
|
+
import { ModuleFE_XHR } from './http/ModuleFE_XHR.js';
|
|
27
|
+
import { dispatch_onClearWebsiteData } from './clearWebsiteDataDispatcher.js';
|
|
28
|
+
class ModuleFE_Thunderstorm_Class extends Module {
|
|
29
|
+
constructor() {
|
|
30
|
+
super();
|
|
31
|
+
this.setDefaultConfig({ appName: 'Thunderstorm-WebApp' });
|
|
32
|
+
}
|
|
33
|
+
init() {
|
|
34
|
+
this.setAppName(this.config.appName);
|
|
35
|
+
this.setChromeThemeColor(this.config.themeColor);
|
|
36
|
+
}
|
|
37
|
+
setAppName(appName) {
|
|
38
|
+
document.title = appName;
|
|
39
|
+
}
|
|
40
|
+
setChromeThemeColor(themeColor) {
|
|
41
|
+
let themeTag = document.head.querySelector('meta[name="theme-color"]');
|
|
42
|
+
if (!themeTag) {
|
|
43
|
+
themeTag = document.createElement('meta');
|
|
44
|
+
themeTag.name = 'theme-color';
|
|
45
|
+
document.getElementsByTagName('head')[0].appendChild(themeTag);
|
|
46
|
+
}
|
|
47
|
+
themeTag.setAttribute('content', themeColor);
|
|
48
|
+
}
|
|
49
|
+
async clearWebsiteData() {
|
|
50
|
+
this.logInfo('Cleaning IDB called.');
|
|
51
|
+
return await dispatch_onClearWebsiteData.dispatchModuleAsync();
|
|
52
|
+
}
|
|
53
|
+
async copyToClipboard(toCopy, customSuccessMessage) {
|
|
54
|
+
try {
|
|
55
|
+
await navigator.clipboard.writeText(toCopy);
|
|
56
|
+
ModuleFE_Toaster.toastInfo(customSuccessMessage ?? `Copied to Clipboard:\n"${toCopy}"`);
|
|
57
|
+
}
|
|
58
|
+
catch (e) {
|
|
59
|
+
ModuleFE_Toaster.toastError(`Failed to copy to Clipboard:\n"${toCopy}"`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async readFileContent(file) {
|
|
63
|
+
const fullUrl = URL.createObjectURL(file);
|
|
64
|
+
const content = ModuleFE_XHR.createRequest({ method: HttpMethod.GET, fullUrl, path: '' }).executeSync();
|
|
65
|
+
URL.revokeObjectURL(fullUrl);
|
|
66
|
+
return content;
|
|
67
|
+
}
|
|
68
|
+
async writeToClipboard(imageAsBase64, contentType = 'image/png') {
|
|
69
|
+
try {
|
|
70
|
+
// const clipboardItem = new ClipboardItem({'image/png': imageAsBase64});
|
|
71
|
+
const clipboardItem = new ClipboardItem({ contentType: await base64ToBlob(imageAsBase64) });
|
|
72
|
+
await navigator.clipboard.write([clipboardItem]);
|
|
73
|
+
// TODO: Render Blob in toast
|
|
74
|
+
ModuleFE_Toaster.toastInfo(`Copied image Clipboard`);
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
ModuleFE_Toaster.toastError(`Failed to copy image to Clipboard`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
getAppName() {
|
|
81
|
+
return this.config.appName;
|
|
82
|
+
}
|
|
83
|
+
openUrl(url, target) {
|
|
84
|
+
if (!window)
|
|
85
|
+
throw new BadImplementationException('no window in vm context');
|
|
86
|
+
let urlObj = url;
|
|
87
|
+
if (typeof urlObj === 'string')
|
|
88
|
+
urlObj = { url: urlObj };
|
|
89
|
+
const params = urlObj.params || {};
|
|
90
|
+
const calculatedParams = _keys(params || {}).reduce((toRet, key) => {
|
|
91
|
+
const param = params[key];
|
|
92
|
+
if (typeof param === 'function') {
|
|
93
|
+
const value = param?.();
|
|
94
|
+
if (value)
|
|
95
|
+
toRet[key] = value;
|
|
96
|
+
}
|
|
97
|
+
else
|
|
98
|
+
toRet[key] = param;
|
|
99
|
+
return toRet;
|
|
100
|
+
}, {});
|
|
101
|
+
window.open(composeURL(urlObj.url, calculatedParams), target || '_self');
|
|
102
|
+
}
|
|
103
|
+
downloadFile(props) {
|
|
104
|
+
if (!document)
|
|
105
|
+
return;
|
|
106
|
+
const element = document.createElement('a');
|
|
107
|
+
if (props.content) {
|
|
108
|
+
let content;
|
|
109
|
+
if (typeof props.content === 'string')
|
|
110
|
+
content = encodeURIComponent(props.content);
|
|
111
|
+
else
|
|
112
|
+
content = URL.createObjectURL(props.content);
|
|
113
|
+
element.setAttribute('href', `data:${props.mimeType || 'text/text'};charset=${props.charset || 'utf-8'},${content}`);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
element.setAttribute('href', props.url);
|
|
117
|
+
}
|
|
118
|
+
element.setAttribute('download', `${props.fileName}`);
|
|
119
|
+
element.click();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
export const ModuleFE_Thunderstorm = new ModuleFE_Thunderstorm_Class();
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DB_Object, DBProto, Module } from '@nu-art/ts-common';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
type Config = {};
|
|
4
|
+
interface BaseRendererParam<K extends string, P> {
|
|
5
|
+
key: K;
|
|
6
|
+
props: P;
|
|
7
|
+
}
|
|
8
|
+
type RendererParams<T extends BaseRendererParam<string, any>> = {
|
|
9
|
+
[K in T['key']]: Extract<T, {
|
|
10
|
+
key: K;
|
|
11
|
+
}>['props'];
|
|
12
|
+
};
|
|
13
|
+
type AssertionCallbacksMapper<T extends DB_Object> = {
|
|
14
|
+
[key: string]: (item: T) => any;
|
|
15
|
+
};
|
|
16
|
+
declare class ModuleFE_Utils_Class<T extends BaseRendererParam<string, any>> extends Module<Config> {
|
|
17
|
+
renderers: Partial<{
|
|
18
|
+
[K in T['key']]: React.ComponentType<any>;
|
|
19
|
+
}>;
|
|
20
|
+
processors: Partial<AssertionCallbacksMapper<any>>;
|
|
21
|
+
registerRenderer<K extends string, P>(key: K, renderer: React.ComponentType<P>): ModuleFE_Utils_Class<BaseRendererParam<K, P>>;
|
|
22
|
+
removeRenderer<K extends T['key']>(key: K): void;
|
|
23
|
+
getRenderer<K extends T['key']>(key: K, props: RendererParams<T>[K]): React.ComponentType<RendererParams<T>[K]>;
|
|
24
|
+
registerProcessors<K extends string, T extends DBProto<any>>(key: K, assertionCallback: AssertionCallbacksMapper<T['dbType']>[K]): any;
|
|
25
|
+
removeProcessors<K extends T['key']>(key: K): void;
|
|
26
|
+
getProcessor<T extends DBProto<any>, K extends keyof AssertionCallbacksMapper<T['dbType']>>(key: K): AssertionCallbacksMapper<T['dbType']>[K];
|
|
27
|
+
}
|
|
28
|
+
export declare const ModuleFE_Utils: ModuleFE_Utils_Class<BaseRendererParam<string, any>>;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Module } from '@nu-art/ts-common';
|
|
2
|
+
//TODO: re think about the typing in this class its far from perfect
|
|
3
|
+
class ModuleFE_Utils_Class extends Module {
|
|
4
|
+
renderers = {};
|
|
5
|
+
processors = {};
|
|
6
|
+
// renderers
|
|
7
|
+
// Method to register a renderer
|
|
8
|
+
registerRenderer(key, renderer) {
|
|
9
|
+
this.renderers[key] = renderer;
|
|
10
|
+
return this;
|
|
11
|
+
}
|
|
12
|
+
// Method to remove a renderer
|
|
13
|
+
removeRenderer(key) {
|
|
14
|
+
delete this.renderers[key];
|
|
15
|
+
}
|
|
16
|
+
// Method to get a renderer by key and pass props
|
|
17
|
+
getRenderer(key, props) {
|
|
18
|
+
const renderer = this.renderers[key];
|
|
19
|
+
if (!renderer) {
|
|
20
|
+
throw new Error(`Renderer not found for key: ${key}`);
|
|
21
|
+
}
|
|
22
|
+
return renderer;
|
|
23
|
+
}
|
|
24
|
+
// assertion callbacks
|
|
25
|
+
// Method to register a renderer
|
|
26
|
+
registerProcessors(key, assertionCallback) {
|
|
27
|
+
this.processors[key] = assertionCallback;
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
// Method to remove a renderer
|
|
31
|
+
removeProcessors(key) {
|
|
32
|
+
delete this.processors[key];
|
|
33
|
+
}
|
|
34
|
+
// Method to get a renderer by key and pass props
|
|
35
|
+
getProcessor(key) {
|
|
36
|
+
const callback = this.processors[key];
|
|
37
|
+
if (!callback) {
|
|
38
|
+
throw new Error(`assertion callback not found for key: ${key}`);
|
|
39
|
+
}
|
|
40
|
+
return callback;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export const ModuleFE_Utils = new ModuleFE_Utils_Class();
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Module } from '@nu-art/ts-common';
|
|
2
|
+
type Config = {};
|
|
3
|
+
export interface OnWindowResized {
|
|
4
|
+
__onWindowResized(): void;
|
|
5
|
+
}
|
|
6
|
+
export interface OnWindowReceivedFocus {
|
|
7
|
+
__onWindowReceivedFocus(): void;
|
|
8
|
+
}
|
|
9
|
+
export interface OnWindowLostFocus {
|
|
10
|
+
__onWindowLostFocus(): void;
|
|
11
|
+
}
|
|
12
|
+
export declare class ModuleFE_Window_Class extends Module<Config> {
|
|
13
|
+
protected init(): void;
|
|
14
|
+
private onWindowResized;
|
|
15
|
+
private onWindowReceivedFocus;
|
|
16
|
+
private onWindowLostFocus;
|
|
17
|
+
}
|
|
18
|
+
export declare const ModuleFE_Window: ModuleFE_Window_Class;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Thunderstorm is a full web app framework!
|
|
3
|
+
*
|
|
4
|
+
* Typescript & Express backend infrastructure that natively runs on firebase function
|
|
5
|
+
* Typescript & React frontend infrastructure
|
|
6
|
+
*
|
|
7
|
+
* Copyright (C) 2020 Adam van der Kruk aka TacB0sS
|
|
8
|
+
*
|
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
* you may not use this file except in compliance with the License.
|
|
11
|
+
* You may obtain a copy of the License at
|
|
12
|
+
*
|
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
* See the License for the specific language governing permissions and
|
|
19
|
+
* limitations under the License.
|
|
20
|
+
*/
|
|
21
|
+
import { Module, } from '@nu-art/ts-common';
|
|
22
|
+
import { ThunderDispatcher } from '../core/thunder-dispatcher.js';
|
|
23
|
+
const dispatch_WindowResized = new ThunderDispatcher('__onWindowResized');
|
|
24
|
+
const dispatch_WindowReceivedFocus = new ThunderDispatcher('__onWindowReceivedFocus');
|
|
25
|
+
const dispatch_WindowLostFocus = new ThunderDispatcher('__onWindowLostFocus');
|
|
26
|
+
export class ModuleFE_Window_Class extends Module {
|
|
27
|
+
init() {
|
|
28
|
+
window.addEventListener('resize', this.onWindowResized);
|
|
29
|
+
window.addEventListener('focus', this.onWindowReceivedFocus);
|
|
30
|
+
window.addEventListener('blur', this.onWindowLostFocus);
|
|
31
|
+
}
|
|
32
|
+
onWindowResized = () => {
|
|
33
|
+
dispatch_WindowResized.dispatchAll();
|
|
34
|
+
};
|
|
35
|
+
onWindowReceivedFocus = () => {
|
|
36
|
+
dispatch_WindowReceivedFocus.dispatchAll();
|
|
37
|
+
};
|
|
38
|
+
onWindowLostFocus = () => {
|
|
39
|
+
dispatch_WindowLostFocus.dispatchAll();
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export const ModuleFE_Window = new ModuleFE_Window_Class();
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Logger, Module } from '@nu-art/ts-common';
|
|
2
|
+
export declare const Key_UndefinedMessage = "undefined-message";
|
|
3
|
+
/**
|
|
4
|
+
* Subset of interface Window, which contains postMessage functions
|
|
5
|
+
*/
|
|
6
|
+
interface Messagable {
|
|
7
|
+
postMessage(message: any, targetOrigin: string, transfer?: Transferable[]): void;
|
|
8
|
+
postMessage(message: any, options?: WindowPostMessageOptions): void;
|
|
9
|
+
}
|
|
10
|
+
export type Message = {
|
|
11
|
+
key: string;
|
|
12
|
+
};
|
|
13
|
+
declare class ModuleFE_WindowMessenger_Class extends Module {
|
|
14
|
+
readonly receivers: BaseReceiver<any>[];
|
|
15
|
+
private listener?;
|
|
16
|
+
addReceiver(receiver: BaseReceiver<any>): void;
|
|
17
|
+
removeReceiver(receiver: BaseReceiver<any>): void;
|
|
18
|
+
sendMessage<T extends Message>(message: T, target: Messagable): void;
|
|
19
|
+
createMessenger<T extends Message>(target: Messagable): Messenger<T>;
|
|
20
|
+
createReceiver<T extends Message>(origin?: string, transformer?: (data: any) => T[]): Receiver<T>;
|
|
21
|
+
createRawReceiver(execute: (message: any) => void, origin?: string): RawReceiver;
|
|
22
|
+
}
|
|
23
|
+
export declare const ModuleFE_WindowMessenger: ModuleFE_WindowMessenger_Class;
|
|
24
|
+
export declare class Messenger<T extends Message> {
|
|
25
|
+
readonly target: Messagable;
|
|
26
|
+
constructor(target: Messagable);
|
|
27
|
+
sendMessage(message: T): void;
|
|
28
|
+
}
|
|
29
|
+
export declare abstract class BaseReceiver<T = any> extends Logger {
|
|
30
|
+
readonly origin: string;
|
|
31
|
+
private readonly regex;
|
|
32
|
+
private filter;
|
|
33
|
+
constructor(origin?: string);
|
|
34
|
+
mount(): this;
|
|
35
|
+
unmount(): this;
|
|
36
|
+
readonly execute: (origin: string, message: T) => void;
|
|
37
|
+
abstract executeImpl(message: T): void;
|
|
38
|
+
setFilter(filter: (message: any) => boolean): this;
|
|
39
|
+
}
|
|
40
|
+
export declare class RawReceiver extends BaseReceiver {
|
|
41
|
+
readonly execute: (message: any) => void;
|
|
42
|
+
constructor(execute: (message: any) => void, origin?: string);
|
|
43
|
+
executeImpl(message: any): void;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Need to add a processor per each key prop's value that can be returned in the transformer output.
|
|
47
|
+
*/
|
|
48
|
+
export declare class Receiver<T extends Message> extends BaseReceiver {
|
|
49
|
+
private readonly messageProcessorMap;
|
|
50
|
+
private readonly transform;
|
|
51
|
+
private defaultProcessor?;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @param origin window.origin
|
|
55
|
+
* @param transform Receives the MessageEvent and needs to transform it into an array of objects, each having prop "key". To each potential "key", you need to add an appropriate processor.
|
|
56
|
+
*/
|
|
57
|
+
constructor(origin?: string, transform?: (data: any) => T[]);
|
|
58
|
+
setDefaultProcessor(processor: (transformedMessage: T, message: any) => void): this;
|
|
59
|
+
addProcessor<K extends T>(key: K['key'], processor: (message: K) => void): this;
|
|
60
|
+
executeImpl(message: any): void;
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { Logger, Module, removeItemFromArray } from '@nu-art/ts-common';
|
|
2
|
+
export const Key_UndefinedMessage = 'undefined-message';
|
|
3
|
+
class ModuleFE_WindowMessenger_Class extends Module {
|
|
4
|
+
//######################### Static #########################
|
|
5
|
+
receivers = [];
|
|
6
|
+
listener;
|
|
7
|
+
//######################### Life Cycle #########################
|
|
8
|
+
addReceiver(receiver) {
|
|
9
|
+
if (this.receivers.includes(receiver))
|
|
10
|
+
return;
|
|
11
|
+
this.receivers.push(receiver);
|
|
12
|
+
if (this.receivers.length > 0 && !this.listener)
|
|
13
|
+
window.addEventListener('message', this.listener = (e) => {
|
|
14
|
+
const { data, origin } = e;
|
|
15
|
+
this.receivers.forEach(receiver => receiver.execute(origin, data));
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
removeReceiver(receiver) {
|
|
19
|
+
removeItemFromArray(this.receivers, receiver);
|
|
20
|
+
if (this.receivers.length === 0) {
|
|
21
|
+
window.removeEventListener('message', this.listener);
|
|
22
|
+
delete this.listener;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
sendMessage(message, target) {
|
|
26
|
+
target.postMessage(message, '*');
|
|
27
|
+
}
|
|
28
|
+
createMessenger(target) {
|
|
29
|
+
return new Messenger(target);
|
|
30
|
+
}
|
|
31
|
+
createReceiver(origin, transformer) {
|
|
32
|
+
return new Receiver(origin, transformer);
|
|
33
|
+
}
|
|
34
|
+
createRawReceiver(execute, origin) {
|
|
35
|
+
return new RawReceiver(execute, origin);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export const ModuleFE_WindowMessenger = new ModuleFE_WindowMessenger_Class();
|
|
39
|
+
//Message Sender
|
|
40
|
+
export class Messenger {
|
|
41
|
+
target;
|
|
42
|
+
constructor(target) {
|
|
43
|
+
this.target = target;
|
|
44
|
+
}
|
|
45
|
+
sendMessage(message) {
|
|
46
|
+
ModuleFE_WindowMessenger.sendMessage(message, this.target);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//Message Receiver
|
|
50
|
+
export class BaseReceiver extends Logger {
|
|
51
|
+
origin;
|
|
52
|
+
regex;
|
|
53
|
+
filter = (message) => true;
|
|
54
|
+
constructor(origin = '.*') {
|
|
55
|
+
super();
|
|
56
|
+
this.setTag(`Receiver (${origin})`);
|
|
57
|
+
this.origin = origin;
|
|
58
|
+
this.regex = new RegExp(origin);
|
|
59
|
+
}
|
|
60
|
+
mount() {
|
|
61
|
+
ModuleFE_WindowMessenger.addReceiver(this);
|
|
62
|
+
return this;
|
|
63
|
+
}
|
|
64
|
+
unmount() {
|
|
65
|
+
ModuleFE_WindowMessenger.removeReceiver(this);
|
|
66
|
+
return this;
|
|
67
|
+
}
|
|
68
|
+
execute = (origin, message) => {
|
|
69
|
+
if (!this.regex.test(origin))
|
|
70
|
+
return;
|
|
71
|
+
if (!this.filter(message))
|
|
72
|
+
return;
|
|
73
|
+
this.executeImpl(message);
|
|
74
|
+
};
|
|
75
|
+
setFilter(filter) {
|
|
76
|
+
this.filter = filter;
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export class RawReceiver extends BaseReceiver {
|
|
81
|
+
execute;
|
|
82
|
+
constructor(execute, origin = '.*') {
|
|
83
|
+
super(origin);
|
|
84
|
+
this.execute = execute;
|
|
85
|
+
}
|
|
86
|
+
executeImpl(message) {
|
|
87
|
+
this.execute(message);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Need to add a processor per each key prop's value that can be returned in the transformer output.
|
|
92
|
+
*/
|
|
93
|
+
export class Receiver extends BaseReceiver {
|
|
94
|
+
messageProcessorMap = {};
|
|
95
|
+
transform; // Receives one window message, returns array with 1 or more transformed messages., each message needs prop 'key' with a matching processor added.
|
|
96
|
+
defaultProcessor;
|
|
97
|
+
/**
|
|
98
|
+
*
|
|
99
|
+
* @param origin window.origin
|
|
100
|
+
* @param transform Receives the MessageEvent and needs to transform it into an array of objects, each having prop "key". To each potential "key", you need to add an appropriate processor.
|
|
101
|
+
*/
|
|
102
|
+
constructor(origin = '.*', transform = data => [data]) {
|
|
103
|
+
super();
|
|
104
|
+
this.setTag(`Receiver (${origin})`);
|
|
105
|
+
this.transform = transform;
|
|
106
|
+
}
|
|
107
|
+
setDefaultProcessor(processor) {
|
|
108
|
+
this.defaultProcessor = processor;
|
|
109
|
+
return this;
|
|
110
|
+
}
|
|
111
|
+
addProcessor(key, processor) {
|
|
112
|
+
this.messageProcessorMap[key] = processor;
|
|
113
|
+
return this;
|
|
114
|
+
}
|
|
115
|
+
executeImpl(message) {
|
|
116
|
+
const transformedMessages = this.transform(message);
|
|
117
|
+
transformedMessages.forEach(_transformedMessage => {
|
|
118
|
+
const processor = this.messageProcessorMap[_transformedMessage.key];
|
|
119
|
+
if (processor) {
|
|
120
|
+
processor(_transformedMessage);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
this.logDebug(`No message processor defined for key ${message.key}`);
|
|
124
|
+
this.defaultProcessor?.(_transformedMessage, message);
|
|
125
|
+
return;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Module } from '@nu-art/ts-common';
|
|
2
|
+
import { ApiDefCaller } from '../../shared.js';
|
|
3
|
+
import { ApiStruct_ActionProcessing } from '@nu-art/thunderstorm-shared/action-processor/index';
|
|
4
|
+
declare class ModuleFE_ActionProcessor_Class extends Module {
|
|
5
|
+
readonly vv1: ApiDefCaller<ApiStruct_ActionProcessing>['vv1'];
|
|
6
|
+
constructor();
|
|
7
|
+
}
|
|
8
|
+
export declare const ModuleFE_ActionProcessor: ModuleFE_ActionProcessor_Class;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Module } from '@nu-art/ts-common';
|
|
2
|
+
import { ApiDef_ActionProcessing } from '@nu-art/thunderstorm-shared/action-processor/index';
|
|
3
|
+
import { apiWithBody, apiWithQuery } from '../../core/typed-api.js';
|
|
4
|
+
class ModuleFE_ActionProcessor_Class extends Module {
|
|
5
|
+
vv1;
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.vv1 = {
|
|
9
|
+
execute: apiWithBody(ApiDef_ActionProcessing.vv1.execute),
|
|
10
|
+
list: apiWithQuery(ApiDef_ActionProcessing.vv1.list),
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export const ModuleFE_ActionProcessor = new ModuleFE_ActionProcessor_Class();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Module } from '@nu-art/ts-common';
|
|
2
|
+
import { ApiDefCaller, ApiStruct_Archiving } from '@nu-art/thunderstorm-shared';
|
|
3
|
+
declare class ModuleFE_Archiving_Class extends Module {
|
|
4
|
+
readonly vv1: ApiDefCaller<ApiStruct_Archiving>['vv1'];
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
7
|
+
export declare const ModuleFE_Archiving: ModuleFE_Archiving_Class;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Module } from '@nu-art/ts-common';
|
|
2
|
+
import { ApiDef_Archiving } from '@nu-art/thunderstorm-shared';
|
|
3
|
+
import { apiWithBody, apiWithQuery } from '../../core/typed-api.js';
|
|
4
|
+
class ModuleFE_Archiving_Class extends Module {
|
|
5
|
+
vv1;
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.vv1 = {
|
|
9
|
+
hardDeleteAll: apiWithQuery(ApiDef_Archiving.vv1.hardDeleteAll),
|
|
10
|
+
hardDeleteUnique: apiWithBody(ApiDef_Archiving.vv1.hardDeleteUnique),
|
|
11
|
+
getDocumentHistory: apiWithQuery(ApiDef_Archiving.vv1.getDocumentHistory)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export const ModuleFE_Archiving = new ModuleFE_Archiving_Class();
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { OnRequestListener } from '@nu-art/thunderstorm-shared/request-types';
|
|
3
|
+
export type LoaderProps = {
|
|
4
|
+
progress: number;
|
|
5
|
+
};
|
|
6
|
+
type Props = {
|
|
7
|
+
loader?: React.ElementType<LoaderProps>;
|
|
8
|
+
src: string;
|
|
9
|
+
};
|
|
10
|
+
type State = {
|
|
11
|
+
loading: boolean;
|
|
12
|
+
progress: number;
|
|
13
|
+
};
|
|
14
|
+
export declare class ReactEntryComponentInjector extends React.Component<Props, State> implements OnRequestListener {
|
|
15
|
+
private myRef;
|
|
16
|
+
constructor(props: Props);
|
|
17
|
+
__onRequestCompleted: (key: string, success: boolean) => void;
|
|
18
|
+
private injectComponent;
|
|
19
|
+
componentDidMount(): void;
|
|
20
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
private extracted;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Thunderstorm is a full web app framework!
|
|
4
|
+
*
|
|
5
|
+
* Typescript & Express backend infrastructure that natively runs on firebase function
|
|
6
|
+
* Typescript & React frontend infrastructure
|
|
7
|
+
*
|
|
8
|
+
* Copyright (C) 2020 Adam van der Kruk aka TacB0sS
|
|
9
|
+
*
|
|
10
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
+
* you may not use this file except in compliance with the License.
|
|
12
|
+
* You may obtain a copy of the License at
|
|
13
|
+
*
|
|
14
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
*
|
|
16
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
17
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
+
* See the License for the specific language governing permissions and
|
|
20
|
+
* limitations under the License.
|
|
21
|
+
*/
|
|
22
|
+
import * as React from 'react';
|
|
23
|
+
import { EntryComponentLoadingModule } from './entry-component-loading-module.js';
|
|
24
|
+
export class ReactEntryComponentInjector extends React.Component {
|
|
25
|
+
myRef = React.createRef();
|
|
26
|
+
constructor(props) {
|
|
27
|
+
super(props);
|
|
28
|
+
this.state = { loading: false, progress: 0 };
|
|
29
|
+
}
|
|
30
|
+
__onRequestCompleted = (key, success) => {
|
|
31
|
+
if (key !== this.props.src)
|
|
32
|
+
return;
|
|
33
|
+
if (!success)
|
|
34
|
+
// Need to add error handling here...
|
|
35
|
+
return;
|
|
36
|
+
this.injectComponent(EntryComponentLoadingModule.getNode(key));
|
|
37
|
+
};
|
|
38
|
+
injectComponent(node) {
|
|
39
|
+
this.myRef.current?.appendChild(node);
|
|
40
|
+
this.setState({ loading: false });
|
|
41
|
+
}
|
|
42
|
+
componentDidMount() {
|
|
43
|
+
const src = this.props.src;
|
|
44
|
+
const node = EntryComponentLoadingModule.getNode(src);
|
|
45
|
+
if (node)
|
|
46
|
+
return this.injectComponent(node);
|
|
47
|
+
EntryComponentLoadingModule.loadScript(src, (progress) => this.setState({ progress }));
|
|
48
|
+
this.setState({ loading: true });
|
|
49
|
+
}
|
|
50
|
+
render() {
|
|
51
|
+
return _jsx("div", { ref: this.myRef, id: this.props.src, children: this.extracted() });
|
|
52
|
+
}
|
|
53
|
+
extracted() {
|
|
54
|
+
const Loader = this.props.loader;
|
|
55
|
+
if (Loader)
|
|
56
|
+
return _jsx(Loader, { progress: this.state.progress });
|
|
57
|
+
return _jsxs("div", { style: { width: '100%', height: '100%' }, children: [this.state.progress, " %"] });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Module } from '@nu-art/ts-common';
|
|
2
|
+
export declare class PageLoadingModule_Class extends Module<{}> {
|
|
3
|
+
private readonly injected;
|
|
4
|
+
loadScript(src: string, progressListener: (progress: number) => void): void;
|
|
5
|
+
getNode(src: string): HTMLScriptElement;
|
|
6
|
+
}
|
|
7
|
+
export declare const EntryComponentLoadingModule: PageLoadingModule_Class;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Thunderstorm is a full web app framework!
|
|
3
|
+
*
|
|
4
|
+
* Typescript & Express backend infrastructure that natively runs on firebase function
|
|
5
|
+
* Typescript & React frontend infrastructure
|
|
6
|
+
*
|
|
7
|
+
* Copyright (C) 2020 Adam van der Kruk aka TacB0sS
|
|
8
|
+
*
|
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
* you may not use this file except in compliance with the License.
|
|
11
|
+
* You may obtain a copy of the License at
|
|
12
|
+
*
|
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
* See the License for the specific language governing permissions and
|
|
19
|
+
* limitations under the License.
|
|
20
|
+
*/
|
|
21
|
+
import { Module } from '@nu-art/ts-common';
|
|
22
|
+
// noinspection TypeScriptPreferShortImport
|
|
23
|
+
import { ModuleFE_XHR } from '../http/ModuleFE_XHR.js';
|
|
24
|
+
import { ModuleFE_BrowserHistory } from '../ModuleFE_BrowserHistory.js';
|
|
25
|
+
import { HttpMethod } from '@nu-art/thunderstorm-shared';
|
|
26
|
+
export class PageLoadingModule_Class extends Module {
|
|
27
|
+
injected = {};
|
|
28
|
+
loadScript(src, progressListener) {
|
|
29
|
+
const apiDef = {
|
|
30
|
+
method: HttpMethod.GET,
|
|
31
|
+
baseUrl: ModuleFE_BrowserHistory.getOrigin(),
|
|
32
|
+
path: src
|
|
33
|
+
};
|
|
34
|
+
ModuleFE_XHR
|
|
35
|
+
.createRequest(apiDef)
|
|
36
|
+
.setOnProgressListener((ev) => {
|
|
37
|
+
const progress = ev.loaded / ev.total;
|
|
38
|
+
progressListener(progress);
|
|
39
|
+
})
|
|
40
|
+
.execute(response => {
|
|
41
|
+
const divElement = document.createElement('script');
|
|
42
|
+
// divElement.innerHTML = response;
|
|
43
|
+
divElement.id = src;
|
|
44
|
+
divElement.async = true;
|
|
45
|
+
this.injected[src] = divElement;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
getNode(src) {
|
|
49
|
+
return this.injected[src];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
export const EntryComponentLoadingModule = new PageLoadingModule_Class();
|