@etsoo/materialui 1.4.68 → 1.4.70
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/lib/cjs/AddresSelector.js +141 -0
- package/lib/cjs/AuditDisplay.js +52 -0
- package/lib/cjs/AutocompleteExtendedProps.js +2 -0
- package/lib/cjs/BackButton.js +38 -0
- package/lib/cjs/BridgeCloseButton.js +35 -0
- package/lib/cjs/ButtonLink.js +22 -0
- package/lib/cjs/ButtonPopover.js +63 -0
- package/lib/cjs/ComboBox.js +134 -0
- package/lib/cjs/ComboBoxMultiple.js +132 -0
- package/lib/cjs/ComboBoxPro.js +71 -0
- package/lib/cjs/CountdownButton.js +91 -0
- package/lib/cjs/CountryList.js +29 -0
- package/lib/cjs/CultureDataTable.js +48 -0
- package/lib/cjs/CustomFabProps.js +2 -0
- package/lib/cjs/DataGridEx.js +333 -0
- package/lib/cjs/DataGridRenderers.js +105 -0
- package/lib/cjs/DataSteps.js +93 -0
- package/lib/cjs/DataTable.js +52 -0
- package/lib/cjs/DialogButton.js +43 -0
- package/lib/cjs/DnDList.js +222 -0
- package/lib/cjs/DraggablePaperComponent.js +19 -0
- package/lib/cjs/EmailInput.js +17 -0
- package/lib/cjs/FabBox.js +42 -0
- package/lib/cjs/FieldSetEx.js +32 -0
- package/lib/cjs/FileUploadButton.js +46 -0
- package/lib/cjs/FlexBox.js +22 -0
- package/lib/cjs/GridDataCacheType.js +2 -0
- package/lib/cjs/GridDataFormat.js +46 -0
- package/lib/cjs/GridUtils.js +90 -0
- package/lib/cjs/HiSelector.js +49 -0
- package/lib/cjs/HiSelectorTL.js +43 -0
- package/lib/cjs/IconButtonLink.js +19 -0
- package/lib/cjs/InputField.js +54 -0
- package/lib/cjs/InputTipField.js +50 -0
- package/lib/cjs/IntInputField.js +116 -0
- package/lib/cjs/ItemList.js +71 -0
- package/lib/{LineChart.d.ts → cjs/LineChart.d.ts} +1 -1
- package/lib/cjs/LineChart.js +59 -0
- package/lib/cjs/ListChooser.js +95 -0
- package/lib/cjs/ListItemRightIcon.js +11 -0
- package/lib/cjs/ListMoreDisplay.js +101 -0
- package/lib/cjs/LoadingButton.js +47 -0
- package/lib/cjs/MUGlobal.js +189 -0
- package/lib/cjs/MUUtils.js +58 -0
- package/lib/cjs/MaskInput.d.ts +39 -0
- package/lib/cjs/MaskInput.js +47 -0
- package/lib/cjs/MenuButton.js +68 -0
- package/lib/cjs/MobileListItemRenderer.js +33 -0
- package/lib/cjs/MoneyInputField.js +18 -0
- package/lib/cjs/MoreFab.js +100 -0
- package/lib/cjs/NotifierMU.js +368 -0
- package/lib/cjs/NotifierPopupProps.js +2 -0
- package/lib/cjs/NotifierPromptProps.js +2 -0
- package/lib/cjs/NumberInputField.js +32 -0
- package/lib/cjs/OptionBool.js +17 -0
- package/lib/cjs/OptionGroup.js +108 -0
- package/lib/cjs/OptionGroupFlag.js +92 -0
- package/lib/cjs/PList.js +19 -0
- package/lib/cjs/PercentCircularProgress.js +20 -0
- package/lib/cjs/PercentLinearProgress.js +11 -0
- package/lib/cjs/ProgressCount.js +79 -0
- package/lib/cjs/PullToRefreshUI.js +29 -0
- package/lib/cjs/QuickList.js +48 -0
- package/lib/cjs/RegionsRQ.js +2 -0
- package/lib/cjs/ResponsibleContainer.js +196 -0
- package/lib/cjs/ResponsiveStyleValue.js +2 -0
- package/lib/cjs/ScrollTopFab.js +30 -0
- package/lib/cjs/ScrollerListEx.js +168 -0
- package/lib/cjs/SearchBar.js +270 -0
- package/lib/cjs/SearchField.js +52 -0
- package/lib/cjs/SearchOptionGroup.js +17 -0
- package/lib/cjs/SelectBool.js +22 -0
- package/lib/cjs/SelectEx.js +180 -0
- package/lib/cjs/ShowDataComparison.js +63 -0
- package/lib/cjs/Switch.js +40 -0
- package/lib/cjs/SwitchAnt.js +48 -0
- package/lib/cjs/SwitchField.js +36 -0
- package/lib/cjs/TabBox.js +34 -0
- package/lib/cjs/TableEx.js +294 -0
- package/lib/cjs/TagList.js +62 -0
- package/lib/cjs/TagListPro.js +66 -0
- package/lib/cjs/TextFieldEx.js +145 -0
- package/lib/cjs/Tiplist.js +211 -0
- package/lib/cjs/TiplistPro.js +206 -0
- package/lib/cjs/TooltipClick.js +46 -0
- package/lib/cjs/TwoFieldInput.js +69 -0
- package/lib/cjs/UserAvatar.js +26 -0
- package/lib/cjs/UserAvatarEditor.js +169 -0
- package/lib/cjs/app/CommonApp.js +32 -0
- package/lib/cjs/app/IServiceApp.js +11 -0
- package/lib/cjs/app/IServiceAppSettings.js +2 -0
- package/lib/cjs/app/IServicePage.js +2 -0
- package/lib/cjs/app/IServiceUser.js +2 -0
- package/lib/cjs/app/ISmartERPUser.js +2 -0
- package/lib/cjs/app/Labels.js +65 -0
- package/lib/cjs/app/ReactApp.js +387 -0
- package/lib/cjs/app/ServiceApp.js +232 -0
- package/lib/cjs/custom/CustomFieldUtils.js +152 -0
- package/lib/cjs/custom/CustomFieldViewer.js +57 -0
- package/lib/cjs/custom/CustomFieldWindow.js +95 -0
- package/lib/cjs/custom/FieldAmountLabel.js +47 -0
- package/lib/cjs/custom/FieldCheckbox.js +56 -0
- package/lib/cjs/custom/FieldCombobox.js +47 -0
- package/lib/cjs/custom/FieldDateInput.js +50 -0
- package/lib/cjs/custom/FieldDivider.js +19 -0
- package/lib/cjs/custom/FieldInput.js +34 -0
- package/lib/cjs/custom/FieldJson.js +57 -0
- package/lib/cjs/custom/FieldLabel.js +35 -0
- package/lib/cjs/custom/FieldNumberInput.js +44 -0
- package/lib/cjs/custom/FieldRadio.js +56 -0
- package/lib/cjs/custom/FieldSelect.js +55 -0
- package/lib/cjs/custom/FieldSwitch.js +49 -0
- package/lib/cjs/custom/FieldTexarea.js +35 -0
- package/lib/cjs/index.js +134 -0
- package/lib/cjs/messages/MessageUtils.js +76 -0
- package/lib/cjs/messages/OperationMessageContainer.js +49 -0
- package/lib/cjs/messages/OperationMessageDto.js +2 -0
- package/lib/cjs/messages/OperationMessageHandler.js +2 -0
- package/lib/cjs/messages/RefreshHandler.js +2 -0
- package/lib/cjs/messages/SignalRUser.js +2 -0
- package/lib/cjs/pages/CommonPage.js +74 -0
- package/lib/cjs/pages/DataGridPage.js +114 -0
- package/lib/cjs/pages/DataGridPageProps.js +2 -0
- package/lib/cjs/pages/DrawerHeader.js +16 -0
- package/lib/cjs/pages/EditPage.js +30 -0
- package/lib/cjs/pages/FixedListPage.js +104 -0
- package/lib/cjs/pages/LeftDrawer.js +37 -0
- package/lib/cjs/pages/ListPage.js +83 -0
- package/lib/cjs/pages/ResponsivePage.js +53 -0
- package/lib/cjs/pages/SearchPageProps.js +2 -0
- package/lib/cjs/pages/TablePage.js +72 -0
- package/lib/cjs/pages/UserMenu.js +91 -0
- package/lib/cjs/pages/ViewPage.js +160 -0
- package/lib/cjs/texts/DateText.js +28 -0
- package/lib/cjs/texts/MoneyText.js +19 -0
- package/lib/cjs/texts/NumberText.js +17 -0
- package/lib/mjs/AddresSelector.d.ts +107 -0
- package/lib/mjs/AuditDisplay.d.ts +31 -0
- package/lib/mjs/AutocompleteExtendedProps.d.ts +73 -0
- package/lib/mjs/BackButton.d.ts +12 -0
- package/lib/mjs/BridgeCloseButton.d.ts +22 -0
- package/lib/mjs/ButtonLink.d.ts +20 -0
- package/lib/mjs/ButtonPopover.d.ts +29 -0
- package/lib/mjs/ComboBox.d.ts +45 -0
- package/lib/mjs/ComboBoxMultiple.d.ts +41 -0
- package/lib/mjs/ComboBoxPro.d.ts +31 -0
- package/lib/mjs/CountdownButton.d.ts +27 -0
- package/lib/mjs/CountryList.d.ts +30 -0
- package/lib/mjs/CultureDataTable.d.ts +19 -0
- package/lib/mjs/CustomFabProps.d.ts +27 -0
- package/lib/mjs/DataGridEx.d.ts +101 -0
- package/lib/mjs/DataGridRenderers.d.ts +22 -0
- package/lib/mjs/DataSteps.d.ts +38 -0
- package/lib/mjs/DataTable.d.ts +27 -0
- package/lib/mjs/DialogButton.d.ts +54 -0
- package/lib/mjs/DnDList.d.ts +104 -0
- package/lib/mjs/DraggablePaperComponent.d.ts +7 -0
- package/lib/mjs/EmailInput.d.ts +10 -0
- package/lib/mjs/FabBox.d.ts +26 -0
- package/lib/mjs/FieldSetEx.d.ts +21 -0
- package/lib/mjs/FileUploadButton.d.ts +36 -0
- package/lib/mjs/FlexBox.d.ts +13 -0
- package/lib/mjs/GridDataCacheType.d.ts +9 -0
- package/lib/mjs/GridDataFormat.d.ts +10 -0
- package/lib/mjs/GridUtils.d.ts +44 -0
- package/lib/mjs/HiSelector.d.ts +79 -0
- package/lib/mjs/HiSelectorTL.d.ts +67 -0
- package/lib/mjs/IconButtonLink.d.ts +20 -0
- package/lib/mjs/InputField.d.ts +80 -0
- package/lib/mjs/InputTipField.d.ts +38 -0
- package/lib/mjs/IntInputField.d.ts +55 -0
- package/lib/mjs/ItemList.d.ts +68 -0
- package/lib/mjs/LineChart.d.ts +28 -0
- package/lib/{LineChart.js → mjs/LineChart.js} +2 -1
- package/lib/mjs/ListChooser.d.ts +64 -0
- package/lib/mjs/ListItemRightIcon.d.ts +5 -0
- package/lib/mjs/ListMoreDisplay.d.ts +38 -0
- package/lib/mjs/LoadingButton.d.ts +15 -0
- package/lib/mjs/MUGlobal.d.ts +101 -0
- package/lib/mjs/MUUtils.d.ts +22 -0
- package/lib/mjs/MaskInput.d.ts +39 -0
- package/lib/mjs/MaskInput.js +41 -0
- package/lib/mjs/MenuButton.d.ts +9 -0
- package/lib/mjs/MobileListItemRenderer.d.ts +17 -0
- package/lib/mjs/MoneyInputField.d.ts +10 -0
- package/lib/mjs/MoreFab.d.ts +45 -0
- package/lib/mjs/NotifierMU.d.ts +48 -0
- package/lib/mjs/NotifierPopupProps.d.ts +5 -0
- package/lib/mjs/NotifierPromptProps.d.ts +21 -0
- package/lib/mjs/NumberInputField.d.ts +42 -0
- package/lib/mjs/OptionBool.d.ts +12 -0
- package/lib/mjs/OptionGroup.d.ts +80 -0
- package/lib/mjs/OptionGroupFlag.d.ts +76 -0
- package/lib/mjs/PList.d.ts +14 -0
- package/lib/mjs/PercentCircularProgress.d.ts +7 -0
- package/lib/mjs/PercentLinearProgress.d.ts +7 -0
- package/lib/mjs/ProgressCount.d.ts +43 -0
- package/lib/mjs/PullToRefreshUI.d.ts +8 -0
- package/lib/mjs/QuickList.d.ts +56 -0
- package/lib/mjs/RegionsRQ.d.ts +22 -0
- package/lib/mjs/ResponsibleContainer.d.ts +98 -0
- package/lib/mjs/ResponsiveStyleValue.d.ts +7 -0
- package/lib/mjs/ScrollTopFab.d.ts +6 -0
- package/lib/mjs/ScrollerListEx.d.ts +75 -0
- package/lib/mjs/SearchBar.d.ts +32 -0
- package/lib/mjs/SearchField.d.ts +24 -0
- package/lib/mjs/SearchOptionGroup.d.ts +8 -0
- package/lib/mjs/SelectBool.d.ts +12 -0
- package/lib/mjs/SelectEx.d.ts +74 -0
- package/lib/mjs/ShowDataComparison.d.ts +15 -0
- package/lib/mjs/Switch.d.ts +28 -0
- package/lib/mjs/SwitchAnt.d.ts +24 -0
- package/lib/mjs/SwitchField.d.ts +45 -0
- package/lib/mjs/TabBox.d.ts +54 -0
- package/lib/mjs/TableEx.d.ts +64 -0
- package/lib/mjs/TagList.d.ts +21 -0
- package/lib/mjs/TagListPro.d.ts +22 -0
- package/lib/mjs/TextFieldEx.d.ts +157 -0
- package/lib/mjs/Tiplist.d.ts +29 -0
- package/lib/mjs/TiplistPro.d.ts +60 -0
- package/lib/mjs/TooltipClick.d.ts +15 -0
- package/lib/mjs/TwoFieldInput.d.ts +22 -0
- package/lib/mjs/UserAvatar.d.ts +23 -0
- package/lib/mjs/UserAvatarEditor.d.ts +60 -0
- package/lib/mjs/app/CommonApp.d.ts +21 -0
- package/lib/mjs/app/IServiceApp.d.ts +41 -0
- package/lib/mjs/app/IServiceAppSettings.d.ts +6 -0
- package/lib/mjs/app/IServicePage.d.ts +6 -0
- package/lib/mjs/app/IServiceUser.d.ts +42 -0
- package/lib/mjs/app/ISmartERPUser.d.ts +21 -0
- package/lib/mjs/app/Labels.d.ts +65 -0
- package/lib/mjs/app/ReactApp.d.ts +252 -0
- package/lib/mjs/app/ServiceApp.d.ts +76 -0
- package/lib/mjs/custom/CustomFieldUtils.d.ts +56 -0
- package/lib/mjs/custom/CustomFieldViewer.d.ts +50 -0
- package/lib/mjs/custom/CustomFieldWindow.d.ts +55 -0
- package/lib/mjs/custom/FieldAmountLabel.d.ts +7 -0
- package/lib/mjs/custom/FieldCheckbox.d.ts +8 -0
- package/lib/mjs/custom/FieldCombobox.d.ts +8 -0
- package/lib/mjs/custom/FieldDateInput.d.ts +7 -0
- package/lib/mjs/custom/FieldDivider.d.ts +7 -0
- package/lib/mjs/custom/FieldInput.d.ts +7 -0
- package/lib/mjs/custom/FieldJson.d.ts +7 -0
- package/lib/mjs/custom/FieldLabel.d.ts +7 -0
- package/lib/mjs/custom/FieldNumberInput.d.ts +7 -0
- package/lib/mjs/custom/FieldRadio.d.ts +8 -0
- package/lib/mjs/custom/FieldSelect.d.ts +8 -0
- package/lib/mjs/custom/FieldSwitch.d.ts +7 -0
- package/lib/mjs/custom/FieldTexarea.d.ts +7 -0
- package/lib/mjs/index.js +118 -0
- package/lib/mjs/messages/MessageUtils.d.ts +52 -0
- package/lib/mjs/messages/OperationMessageContainer.d.ts +24 -0
- package/lib/mjs/messages/OperationMessageDto.d.ts +26 -0
- package/lib/mjs/messages/OperationMessageHandler.d.ts +24 -0
- package/lib/mjs/messages/RefreshHandler.d.ts +5 -0
- package/lib/mjs/messages/SignalRUser.d.ts +31 -0
- package/lib/mjs/pages/CommonPage.d.ts +72 -0
- package/lib/{pages → mjs/pages}/CommonPage.js +16 -6
- package/lib/mjs/pages/DataGridPage.d.ts +7 -0
- package/lib/mjs/pages/DataGridPageProps.d.ts +18 -0
- package/lib/mjs/pages/DrawerHeader.d.ts +4 -0
- package/lib/mjs/pages/EditPage.d.ts +46 -0
- package/lib/mjs/pages/FixedListPage.d.ts +14 -0
- package/lib/mjs/pages/LeftDrawer.d.ts +35 -0
- package/lib/mjs/pages/ListPage.d.ts +12 -0
- package/lib/mjs/pages/ResponsivePage.d.ts +56 -0
- package/lib/mjs/pages/SearchPageProps.d.ts +36 -0
- package/lib/mjs/pages/TablePage.d.ts +13 -0
- package/lib/mjs/pages/UserMenu.d.ts +40 -0
- package/lib/mjs/pages/ViewPage.d.ts +104 -0
- package/lib/{pages → mjs/pages}/ViewPage.js +1 -1
- package/lib/mjs/texts/DateText.d.ts +33 -0
- package/lib/mjs/texts/MoneyText.d.ts +20 -0
- package/lib/mjs/texts/NumberText.d.ts +24 -0
- package/package.json +12 -6
- package/src/LineChart.tsx +3 -3
- package/src/MaskInput.tsx +30 -27
- package/src/pages/CommonPage.tsx +17 -4
- package/src/pages/ViewPage.tsx +1 -1
- package/tsconfig.cjs.json +19 -0
- package/tsconfig.json +1 -1
- package/lib/MaskInput.d.ts +0 -34
- package/lib/MaskInput.js +0 -42
- /package/lib/{AddresSelector.d.ts → cjs/AddresSelector.d.ts} +0 -0
- /package/lib/{AuditDisplay.d.ts → cjs/AuditDisplay.d.ts} +0 -0
- /package/lib/{AutocompleteExtendedProps.d.ts → cjs/AutocompleteExtendedProps.d.ts} +0 -0
- /package/lib/{BackButton.d.ts → cjs/BackButton.d.ts} +0 -0
- /package/lib/{BridgeCloseButton.d.ts → cjs/BridgeCloseButton.d.ts} +0 -0
- /package/lib/{ButtonLink.d.ts → cjs/ButtonLink.d.ts} +0 -0
- /package/lib/{ButtonPopover.d.ts → cjs/ButtonPopover.d.ts} +0 -0
- /package/lib/{ComboBox.d.ts → cjs/ComboBox.d.ts} +0 -0
- /package/lib/{ComboBoxMultiple.d.ts → cjs/ComboBoxMultiple.d.ts} +0 -0
- /package/lib/{ComboBoxPro.d.ts → cjs/ComboBoxPro.d.ts} +0 -0
- /package/lib/{CountdownButton.d.ts → cjs/CountdownButton.d.ts} +0 -0
- /package/lib/{CountryList.d.ts → cjs/CountryList.d.ts} +0 -0
- /package/lib/{CultureDataTable.d.ts → cjs/CultureDataTable.d.ts} +0 -0
- /package/lib/{CustomFabProps.d.ts → cjs/CustomFabProps.d.ts} +0 -0
- /package/lib/{DataGridEx.d.ts → cjs/DataGridEx.d.ts} +0 -0
- /package/lib/{DataGridRenderers.d.ts → cjs/DataGridRenderers.d.ts} +0 -0
- /package/lib/{DataSteps.d.ts → cjs/DataSteps.d.ts} +0 -0
- /package/lib/{DataTable.d.ts → cjs/DataTable.d.ts} +0 -0
- /package/lib/{DialogButton.d.ts → cjs/DialogButton.d.ts} +0 -0
- /package/lib/{DnDList.d.ts → cjs/DnDList.d.ts} +0 -0
- /package/lib/{DraggablePaperComponent.d.ts → cjs/DraggablePaperComponent.d.ts} +0 -0
- /package/lib/{EmailInput.d.ts → cjs/EmailInput.d.ts} +0 -0
- /package/lib/{FabBox.d.ts → cjs/FabBox.d.ts} +0 -0
- /package/lib/{FieldSetEx.d.ts → cjs/FieldSetEx.d.ts} +0 -0
- /package/lib/{FileUploadButton.d.ts → cjs/FileUploadButton.d.ts} +0 -0
- /package/lib/{FlexBox.d.ts → cjs/FlexBox.d.ts} +0 -0
- /package/lib/{GridDataCacheType.d.ts → cjs/GridDataCacheType.d.ts} +0 -0
- /package/lib/{GridDataFormat.d.ts → cjs/GridDataFormat.d.ts} +0 -0
- /package/lib/{GridUtils.d.ts → cjs/GridUtils.d.ts} +0 -0
- /package/lib/{HiSelector.d.ts → cjs/HiSelector.d.ts} +0 -0
- /package/lib/{HiSelectorTL.d.ts → cjs/HiSelectorTL.d.ts} +0 -0
- /package/lib/{IconButtonLink.d.ts → cjs/IconButtonLink.d.ts} +0 -0
- /package/lib/{InputField.d.ts → cjs/InputField.d.ts} +0 -0
- /package/lib/{InputTipField.d.ts → cjs/InputTipField.d.ts} +0 -0
- /package/lib/{IntInputField.d.ts → cjs/IntInputField.d.ts} +0 -0
- /package/lib/{ItemList.d.ts → cjs/ItemList.d.ts} +0 -0
- /package/lib/{ListChooser.d.ts → cjs/ListChooser.d.ts} +0 -0
- /package/lib/{ListItemRightIcon.d.ts → cjs/ListItemRightIcon.d.ts} +0 -0
- /package/lib/{ListMoreDisplay.d.ts → cjs/ListMoreDisplay.d.ts} +0 -0
- /package/lib/{LoadingButton.d.ts → cjs/LoadingButton.d.ts} +0 -0
- /package/lib/{MUGlobal.d.ts → cjs/MUGlobal.d.ts} +0 -0
- /package/lib/{MUUtils.d.ts → cjs/MUUtils.d.ts} +0 -0
- /package/lib/{MenuButton.d.ts → cjs/MenuButton.d.ts} +0 -0
- /package/lib/{MobileListItemRenderer.d.ts → cjs/MobileListItemRenderer.d.ts} +0 -0
- /package/lib/{MoneyInputField.d.ts → cjs/MoneyInputField.d.ts} +0 -0
- /package/lib/{MoreFab.d.ts → cjs/MoreFab.d.ts} +0 -0
- /package/lib/{NotifierMU.d.ts → cjs/NotifierMU.d.ts} +0 -0
- /package/lib/{NotifierPopupProps.d.ts → cjs/NotifierPopupProps.d.ts} +0 -0
- /package/lib/{NotifierPromptProps.d.ts → cjs/NotifierPromptProps.d.ts} +0 -0
- /package/lib/{NumberInputField.d.ts → cjs/NumberInputField.d.ts} +0 -0
- /package/lib/{OptionBool.d.ts → cjs/OptionBool.d.ts} +0 -0
- /package/lib/{OptionGroup.d.ts → cjs/OptionGroup.d.ts} +0 -0
- /package/lib/{OptionGroupFlag.d.ts → cjs/OptionGroupFlag.d.ts} +0 -0
- /package/lib/{PList.d.ts → cjs/PList.d.ts} +0 -0
- /package/lib/{PercentCircularProgress.d.ts → cjs/PercentCircularProgress.d.ts} +0 -0
- /package/lib/{PercentLinearProgress.d.ts → cjs/PercentLinearProgress.d.ts} +0 -0
- /package/lib/{ProgressCount.d.ts → cjs/ProgressCount.d.ts} +0 -0
- /package/lib/{PullToRefreshUI.d.ts → cjs/PullToRefreshUI.d.ts} +0 -0
- /package/lib/{QuickList.d.ts → cjs/QuickList.d.ts} +0 -0
- /package/lib/{RegionsRQ.d.ts → cjs/RegionsRQ.d.ts} +0 -0
- /package/lib/{ResponsibleContainer.d.ts → cjs/ResponsibleContainer.d.ts} +0 -0
- /package/lib/{ResponsiveStyleValue.d.ts → cjs/ResponsiveStyleValue.d.ts} +0 -0
- /package/lib/{ScrollTopFab.d.ts → cjs/ScrollTopFab.d.ts} +0 -0
- /package/lib/{ScrollerListEx.d.ts → cjs/ScrollerListEx.d.ts} +0 -0
- /package/lib/{SearchBar.d.ts → cjs/SearchBar.d.ts} +0 -0
- /package/lib/{SearchField.d.ts → cjs/SearchField.d.ts} +0 -0
- /package/lib/{SearchOptionGroup.d.ts → cjs/SearchOptionGroup.d.ts} +0 -0
- /package/lib/{SelectBool.d.ts → cjs/SelectBool.d.ts} +0 -0
- /package/lib/{SelectEx.d.ts → cjs/SelectEx.d.ts} +0 -0
- /package/lib/{ShowDataComparison.d.ts → cjs/ShowDataComparison.d.ts} +0 -0
- /package/lib/{Switch.d.ts → cjs/Switch.d.ts} +0 -0
- /package/lib/{SwitchAnt.d.ts → cjs/SwitchAnt.d.ts} +0 -0
- /package/lib/{SwitchField.d.ts → cjs/SwitchField.d.ts} +0 -0
- /package/lib/{TabBox.d.ts → cjs/TabBox.d.ts} +0 -0
- /package/lib/{TableEx.d.ts → cjs/TableEx.d.ts} +0 -0
- /package/lib/{TagList.d.ts → cjs/TagList.d.ts} +0 -0
- /package/lib/{TagListPro.d.ts → cjs/TagListPro.d.ts} +0 -0
- /package/lib/{TextFieldEx.d.ts → cjs/TextFieldEx.d.ts} +0 -0
- /package/lib/{Tiplist.d.ts → cjs/Tiplist.d.ts} +0 -0
- /package/lib/{TiplistPro.d.ts → cjs/TiplistPro.d.ts} +0 -0
- /package/lib/{TooltipClick.d.ts → cjs/TooltipClick.d.ts} +0 -0
- /package/lib/{TwoFieldInput.d.ts → cjs/TwoFieldInput.d.ts} +0 -0
- /package/lib/{UserAvatar.d.ts → cjs/UserAvatar.d.ts} +0 -0
- /package/lib/{UserAvatarEditor.d.ts → cjs/UserAvatarEditor.d.ts} +0 -0
- /package/lib/{app → cjs/app}/CommonApp.d.ts +0 -0
- /package/lib/{app → cjs/app}/IServiceApp.d.ts +0 -0
- /package/lib/{app → cjs/app}/IServiceAppSettings.d.ts +0 -0
- /package/lib/{app → cjs/app}/IServicePage.d.ts +0 -0
- /package/lib/{app → cjs/app}/IServiceUser.d.ts +0 -0
- /package/lib/{app → cjs/app}/ISmartERPUser.d.ts +0 -0
- /package/lib/{app → cjs/app}/Labels.d.ts +0 -0
- /package/lib/{app → cjs/app}/ReactApp.d.ts +0 -0
- /package/lib/{app → cjs/app}/ServiceApp.d.ts +0 -0
- /package/lib/{custom → cjs/custom}/CustomFieldUtils.d.ts +0 -0
- /package/lib/{custom → cjs/custom}/CustomFieldViewer.d.ts +0 -0
- /package/lib/{custom → cjs/custom}/CustomFieldWindow.d.ts +0 -0
- /package/lib/{custom → cjs/custom}/FieldAmountLabel.d.ts +0 -0
- /package/lib/{custom → cjs/custom}/FieldCheckbox.d.ts +0 -0
- /package/lib/{custom → cjs/custom}/FieldCombobox.d.ts +0 -0
- /package/lib/{custom → cjs/custom}/FieldDateInput.d.ts +0 -0
- /package/lib/{custom → cjs/custom}/FieldDivider.d.ts +0 -0
- /package/lib/{custom → cjs/custom}/FieldInput.d.ts +0 -0
- /package/lib/{custom → cjs/custom}/FieldJson.d.ts +0 -0
- /package/lib/{custom → cjs/custom}/FieldLabel.d.ts +0 -0
- /package/lib/{custom → cjs/custom}/FieldNumberInput.d.ts +0 -0
- /package/lib/{custom → cjs/custom}/FieldRadio.d.ts +0 -0
- /package/lib/{custom → cjs/custom}/FieldSelect.d.ts +0 -0
- /package/lib/{custom → cjs/custom}/FieldSwitch.d.ts +0 -0
- /package/lib/{custom → cjs/custom}/FieldTexarea.d.ts +0 -0
- /package/lib/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/lib/{messages → cjs/messages}/MessageUtils.d.ts +0 -0
- /package/lib/{messages → cjs/messages}/OperationMessageContainer.d.ts +0 -0
- /package/lib/{messages → cjs/messages}/OperationMessageDto.d.ts +0 -0
- /package/lib/{messages → cjs/messages}/OperationMessageHandler.d.ts +0 -0
- /package/lib/{messages → cjs/messages}/RefreshHandler.d.ts +0 -0
- /package/lib/{messages → cjs/messages}/SignalRUser.d.ts +0 -0
- /package/lib/{pages → cjs/pages}/CommonPage.d.ts +0 -0
- /package/lib/{pages → cjs/pages}/DataGridPage.d.ts +0 -0
- /package/lib/{pages → cjs/pages}/DataGridPageProps.d.ts +0 -0
- /package/lib/{pages → cjs/pages}/DrawerHeader.d.ts +0 -0
- /package/lib/{pages → cjs/pages}/EditPage.d.ts +0 -0
- /package/lib/{pages → cjs/pages}/FixedListPage.d.ts +0 -0
- /package/lib/{pages → cjs/pages}/LeftDrawer.d.ts +0 -0
- /package/lib/{pages → cjs/pages}/ListPage.d.ts +0 -0
- /package/lib/{pages → cjs/pages}/ResponsivePage.d.ts +0 -0
- /package/lib/{pages → cjs/pages}/SearchPageProps.d.ts +0 -0
- /package/lib/{pages → cjs/pages}/TablePage.d.ts +0 -0
- /package/lib/{pages → cjs/pages}/UserMenu.d.ts +0 -0
- /package/lib/{pages → cjs/pages}/ViewPage.d.ts +0 -0
- /package/lib/{texts → cjs/texts}/DateText.d.ts +0 -0
- /package/lib/{texts → cjs/texts}/MoneyText.d.ts +0 -0
- /package/lib/{texts → cjs/texts}/NumberText.d.ts +0 -0
- /package/lib/{AddresSelector.js → mjs/AddresSelector.js} +0 -0
- /package/lib/{AuditDisplay.js → mjs/AuditDisplay.js} +0 -0
- /package/lib/{AutocompleteExtendedProps.js → mjs/AutocompleteExtendedProps.js} +0 -0
- /package/lib/{BackButton.js → mjs/BackButton.js} +0 -0
- /package/lib/{BridgeCloseButton.js → mjs/BridgeCloseButton.js} +0 -0
- /package/lib/{ButtonLink.js → mjs/ButtonLink.js} +0 -0
- /package/lib/{ButtonPopover.js → mjs/ButtonPopover.js} +0 -0
- /package/lib/{ComboBox.js → mjs/ComboBox.js} +0 -0
- /package/lib/{ComboBoxMultiple.js → mjs/ComboBoxMultiple.js} +0 -0
- /package/lib/{ComboBoxPro.js → mjs/ComboBoxPro.js} +0 -0
- /package/lib/{CountdownButton.js → mjs/CountdownButton.js} +0 -0
- /package/lib/{CountryList.js → mjs/CountryList.js} +0 -0
- /package/lib/{CultureDataTable.js → mjs/CultureDataTable.js} +0 -0
- /package/lib/{CustomFabProps.js → mjs/CustomFabProps.js} +0 -0
- /package/lib/{DataGridEx.js → mjs/DataGridEx.js} +0 -0
- /package/lib/{DataGridRenderers.js → mjs/DataGridRenderers.js} +0 -0
- /package/lib/{DataSteps.js → mjs/DataSteps.js} +0 -0
- /package/lib/{DataTable.js → mjs/DataTable.js} +0 -0
- /package/lib/{DialogButton.js → mjs/DialogButton.js} +0 -0
- /package/lib/{DnDList.js → mjs/DnDList.js} +0 -0
- /package/lib/{DraggablePaperComponent.js → mjs/DraggablePaperComponent.js} +0 -0
- /package/lib/{EmailInput.js → mjs/EmailInput.js} +0 -0
- /package/lib/{FabBox.js → mjs/FabBox.js} +0 -0
- /package/lib/{FieldSetEx.js → mjs/FieldSetEx.js} +0 -0
- /package/lib/{FileUploadButton.js → mjs/FileUploadButton.js} +0 -0
- /package/lib/{FlexBox.js → mjs/FlexBox.js} +0 -0
- /package/lib/{GridDataCacheType.js → mjs/GridDataCacheType.js} +0 -0
- /package/lib/{GridDataFormat.js → mjs/GridDataFormat.js} +0 -0
- /package/lib/{GridUtils.js → mjs/GridUtils.js} +0 -0
- /package/lib/{HiSelector.js → mjs/HiSelector.js} +0 -0
- /package/lib/{HiSelectorTL.js → mjs/HiSelectorTL.js} +0 -0
- /package/lib/{IconButtonLink.js → mjs/IconButtonLink.js} +0 -0
- /package/lib/{InputField.js → mjs/InputField.js} +0 -0
- /package/lib/{InputTipField.js → mjs/InputTipField.js} +0 -0
- /package/lib/{IntInputField.js → mjs/IntInputField.js} +0 -0
- /package/lib/{ItemList.js → mjs/ItemList.js} +0 -0
- /package/lib/{ListChooser.js → mjs/ListChooser.js} +0 -0
- /package/lib/{ListItemRightIcon.js → mjs/ListItemRightIcon.js} +0 -0
- /package/lib/{ListMoreDisplay.js → mjs/ListMoreDisplay.js} +0 -0
- /package/lib/{LoadingButton.js → mjs/LoadingButton.js} +0 -0
- /package/lib/{MUGlobal.js → mjs/MUGlobal.js} +0 -0
- /package/lib/{MUUtils.js → mjs/MUUtils.js} +0 -0
- /package/lib/{MenuButton.js → mjs/MenuButton.js} +0 -0
- /package/lib/{MobileListItemRenderer.js → mjs/MobileListItemRenderer.js} +0 -0
- /package/lib/{MoneyInputField.js → mjs/MoneyInputField.js} +0 -0
- /package/lib/{MoreFab.js → mjs/MoreFab.js} +0 -0
- /package/lib/{NotifierMU.js → mjs/NotifierMU.js} +0 -0
- /package/lib/{NotifierPopupProps.js → mjs/NotifierPopupProps.js} +0 -0
- /package/lib/{NotifierPromptProps.js → mjs/NotifierPromptProps.js} +0 -0
- /package/lib/{NumberInputField.js → mjs/NumberInputField.js} +0 -0
- /package/lib/{OptionBool.js → mjs/OptionBool.js} +0 -0
- /package/lib/{OptionGroup.js → mjs/OptionGroup.js} +0 -0
- /package/lib/{OptionGroupFlag.js → mjs/OptionGroupFlag.js} +0 -0
- /package/lib/{PList.js → mjs/PList.js} +0 -0
- /package/lib/{PercentCircularProgress.js → mjs/PercentCircularProgress.js} +0 -0
- /package/lib/{PercentLinearProgress.js → mjs/PercentLinearProgress.js} +0 -0
- /package/lib/{ProgressCount.js → mjs/ProgressCount.js} +0 -0
- /package/lib/{PullToRefreshUI.js → mjs/PullToRefreshUI.js} +0 -0
- /package/lib/{QuickList.js → mjs/QuickList.js} +0 -0
- /package/lib/{RegionsRQ.js → mjs/RegionsRQ.js} +0 -0
- /package/lib/{ResponsibleContainer.js → mjs/ResponsibleContainer.js} +0 -0
- /package/lib/{ResponsiveStyleValue.js → mjs/ResponsiveStyleValue.js} +0 -0
- /package/lib/{ScrollTopFab.js → mjs/ScrollTopFab.js} +0 -0
- /package/lib/{ScrollerListEx.js → mjs/ScrollerListEx.js} +0 -0
- /package/lib/{SearchBar.js → mjs/SearchBar.js} +0 -0
- /package/lib/{SearchField.js → mjs/SearchField.js} +0 -0
- /package/lib/{SearchOptionGroup.js → mjs/SearchOptionGroup.js} +0 -0
- /package/lib/{SelectBool.js → mjs/SelectBool.js} +0 -0
- /package/lib/{SelectEx.js → mjs/SelectEx.js} +0 -0
- /package/lib/{ShowDataComparison.js → mjs/ShowDataComparison.js} +0 -0
- /package/lib/{Switch.js → mjs/Switch.js} +0 -0
- /package/lib/{SwitchAnt.js → mjs/SwitchAnt.js} +0 -0
- /package/lib/{SwitchField.js → mjs/SwitchField.js} +0 -0
- /package/lib/{TabBox.js → mjs/TabBox.js} +0 -0
- /package/lib/{TableEx.js → mjs/TableEx.js} +0 -0
- /package/lib/{TagList.js → mjs/TagList.js} +0 -0
- /package/lib/{TagListPro.js → mjs/TagListPro.js} +0 -0
- /package/lib/{TextFieldEx.js → mjs/TextFieldEx.js} +0 -0
- /package/lib/{Tiplist.js → mjs/Tiplist.js} +0 -0
- /package/lib/{TiplistPro.js → mjs/TiplistPro.js} +0 -0
- /package/lib/{TooltipClick.js → mjs/TooltipClick.js} +0 -0
- /package/lib/{TwoFieldInput.js → mjs/TwoFieldInput.js} +0 -0
- /package/lib/{UserAvatar.js → mjs/UserAvatar.js} +0 -0
- /package/lib/{UserAvatarEditor.js → mjs/UserAvatarEditor.js} +0 -0
- /package/lib/{app → mjs/app}/CommonApp.js +0 -0
- /package/lib/{app → mjs/app}/IServiceApp.js +0 -0
- /package/lib/{app → mjs/app}/IServiceAppSettings.js +0 -0
- /package/lib/{app → mjs/app}/IServicePage.js +0 -0
- /package/lib/{app → mjs/app}/IServiceUser.js +0 -0
- /package/lib/{app → mjs/app}/ISmartERPUser.js +0 -0
- /package/lib/{app → mjs/app}/Labels.js +0 -0
- /package/lib/{app → mjs/app}/ReactApp.js +0 -0
- /package/lib/{app → mjs/app}/ServiceApp.js +0 -0
- /package/lib/{custom → mjs/custom}/CustomFieldUtils.js +0 -0
- /package/lib/{custom → mjs/custom}/CustomFieldViewer.js +0 -0
- /package/lib/{custom → mjs/custom}/CustomFieldWindow.js +0 -0
- /package/lib/{custom → mjs/custom}/FieldAmountLabel.js +0 -0
- /package/lib/{custom → mjs/custom}/FieldCheckbox.js +0 -0
- /package/lib/{custom → mjs/custom}/FieldCombobox.js +0 -0
- /package/lib/{custom → mjs/custom}/FieldDateInput.js +0 -0
- /package/lib/{custom → mjs/custom}/FieldDivider.js +0 -0
- /package/lib/{custom → mjs/custom}/FieldInput.js +0 -0
- /package/lib/{custom → mjs/custom}/FieldJson.js +0 -0
- /package/lib/{custom → mjs/custom}/FieldLabel.js +0 -0
- /package/lib/{custom → mjs/custom}/FieldNumberInput.js +0 -0
- /package/lib/{custom → mjs/custom}/FieldRadio.js +0 -0
- /package/lib/{custom → mjs/custom}/FieldSelect.js +0 -0
- /package/lib/{custom → mjs/custom}/FieldSwitch.js +0 -0
- /package/lib/{custom → mjs/custom}/FieldTexarea.js +0 -0
- /package/lib/{index.js → mjs/index.d.ts} +0 -0
- /package/lib/{messages → mjs/messages}/MessageUtils.js +0 -0
- /package/lib/{messages → mjs/messages}/OperationMessageContainer.js +0 -0
- /package/lib/{messages → mjs/messages}/OperationMessageDto.js +0 -0
- /package/lib/{messages → mjs/messages}/OperationMessageHandler.js +0 -0
- /package/lib/{messages → mjs/messages}/RefreshHandler.js +0 -0
- /package/lib/{messages → mjs/messages}/SignalRUser.js +0 -0
- /package/lib/{pages → mjs/pages}/DataGridPage.js +0 -0
- /package/lib/{pages → mjs/pages}/DataGridPageProps.js +0 -0
- /package/lib/{pages → mjs/pages}/DrawerHeader.js +0 -0
- /package/lib/{pages → mjs/pages}/EditPage.js +0 -0
- /package/lib/{pages → mjs/pages}/FixedListPage.js +0 -0
- /package/lib/{pages → mjs/pages}/LeftDrawer.js +0 -0
- /package/lib/{pages → mjs/pages}/ListPage.js +0 -0
- /package/lib/{pages → mjs/pages}/ResponsivePage.js +0 -0
- /package/lib/{pages → mjs/pages}/SearchPageProps.js +0 -0
- /package/lib/{pages → mjs/pages}/TablePage.js +0 -0
- /package/lib/{pages → mjs/pages}/UserMenu.js +0 -0
- /package/lib/{texts → mjs/texts}/DateText.js +0 -0
- /package/lib/{texts → mjs/texts}/MoneyText.js +0 -0
- /package/lib/{texts → mjs/texts}/NumberText.js +0 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MoreFab = MoreFab;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const MoreHoriz_1 = __importDefault(require("@mui/icons-material/MoreHoriz"));
|
|
9
|
+
const react_1 = __importDefault(require("react"));
|
|
10
|
+
const material_1 = require("@mui/material");
|
|
11
|
+
const react_router_1 = require("react-router");
|
|
12
|
+
function getActions(input) {
|
|
13
|
+
// Actions
|
|
14
|
+
const actions = [];
|
|
15
|
+
input.forEach((action) => {
|
|
16
|
+
if (typeof action === "boolean")
|
|
17
|
+
return;
|
|
18
|
+
actions.push(action);
|
|
19
|
+
});
|
|
20
|
+
return actions;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* More fab
|
|
24
|
+
* @returns Component
|
|
25
|
+
*/
|
|
26
|
+
function MoreFab(props) {
|
|
27
|
+
// Destruct
|
|
28
|
+
const { actions, drawArrow = true, anchorOrigin = {
|
|
29
|
+
vertical: "top",
|
|
30
|
+
horizontal: "right"
|
|
31
|
+
}, color = "primary", icon = (0, jsx_runtime_1.jsx)(MoreHoriz_1.default, {}), iconButton = false, PaperProps = drawArrow
|
|
32
|
+
? {
|
|
33
|
+
elevation: 0,
|
|
34
|
+
sx: {
|
|
35
|
+
overflow: "visible",
|
|
36
|
+
filter: "drop-shadow(0px 2px 8px rgba(0,0,0,0.32))",
|
|
37
|
+
mt: -0.4,
|
|
38
|
+
"& .MuiAvatar-root": {
|
|
39
|
+
width: 32,
|
|
40
|
+
height: 32,
|
|
41
|
+
ml: -0.5,
|
|
42
|
+
mr: 1
|
|
43
|
+
},
|
|
44
|
+
"&:before": {
|
|
45
|
+
content: '""',
|
|
46
|
+
display: "block",
|
|
47
|
+
position: "absolute",
|
|
48
|
+
top: 0,
|
|
49
|
+
right: 14,
|
|
50
|
+
width: 10,
|
|
51
|
+
height: 10,
|
|
52
|
+
bgcolor: "background.paper",
|
|
53
|
+
transform: "translateY(-50%) rotate(45deg)",
|
|
54
|
+
zIndex: 0
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
: undefined, size, title, transformOrigin = {
|
|
59
|
+
vertical: "bottom",
|
|
60
|
+
horizontal: "right"
|
|
61
|
+
} } = props;
|
|
62
|
+
// State
|
|
63
|
+
const [anchorEl, setAnchorEl] = react_1.default.useState();
|
|
64
|
+
// Open state
|
|
65
|
+
const open = Boolean(anchorEl);
|
|
66
|
+
// Handle click
|
|
67
|
+
const handleClick = (event) => {
|
|
68
|
+
setAnchorEl(event.currentTarget);
|
|
69
|
+
};
|
|
70
|
+
// Handle close
|
|
71
|
+
const handleClose = () => {
|
|
72
|
+
setAnchorEl(undefined);
|
|
73
|
+
};
|
|
74
|
+
// No actions
|
|
75
|
+
if (actions == null || actions.length == 0)
|
|
76
|
+
return (0, jsx_runtime_1.jsx)(react_1.default.Fragment, {});
|
|
77
|
+
// Actions
|
|
78
|
+
const actionsLocal = getActions(actions);
|
|
79
|
+
// Has any icon
|
|
80
|
+
const hasIcon = actionsLocal.some((action) => action.icon != null);
|
|
81
|
+
// Main
|
|
82
|
+
const main = iconButton ? ((0, jsx_runtime_1.jsx)(material_1.IconButton, { color: color, size: size, title: title, onClick: handleClick, children: icon })) : ((0, jsx_runtime_1.jsx)(material_1.Fab, { color: color, size: size, title: title, onClick: handleClick, children: icon }));
|
|
83
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [main, (0, jsx_runtime_1.jsx)(material_1.Menu, { disableScrollLock: true, anchorEl: anchorEl, anchorOrigin: anchorOrigin, keepMounted: true, transformOrigin: transformOrigin, open: open, onClose: handleClose, PaperProps: PaperProps, children: actionsLocal.map(({ label, icon, action }, index) => label === "-" ? ((0, jsx_runtime_1.jsx)(material_1.Divider, {}, index)) : ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, { ...(typeof action === "string"
|
|
84
|
+
? action.includes("://")
|
|
85
|
+
? {
|
|
86
|
+
component: "a",
|
|
87
|
+
href: action,
|
|
88
|
+
target: "_blank"
|
|
89
|
+
}
|
|
90
|
+
: { component: react_router_1.Link, to: action }
|
|
91
|
+
: Array.isArray(action)
|
|
92
|
+
? { component: react_router_1.Link, to: action[0], state: action[1] }
|
|
93
|
+
: {
|
|
94
|
+
onClick: (event) => {
|
|
95
|
+
handleClose();
|
|
96
|
+
if (typeof action === "function")
|
|
97
|
+
action(event);
|
|
98
|
+
}
|
|
99
|
+
}), children: [icon != null && (0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: icon }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { inset: icon == null && hasIcon, children: label })] }, label))) })] }));
|
|
100
|
+
}
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NotifierMU = exports.NotificationMU = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const notificationbase_1 = require("@etsoo/notificationbase");
|
|
9
|
+
const shared_1 = require("@etsoo/shared");
|
|
10
|
+
const material_1 = require("@mui/material");
|
|
11
|
+
const icons_material_1 = require("@mui/icons-material");
|
|
12
|
+
const Close_1 = __importDefault(require("@mui/icons-material/Close"));
|
|
13
|
+
const react_1 = __importDefault(require("react"));
|
|
14
|
+
const react_2 = require("@etsoo/react");
|
|
15
|
+
const DraggablePaperComponent_1 = require("./DraggablePaperComponent");
|
|
16
|
+
const LoadingButton_1 = require("./LoadingButton");
|
|
17
|
+
const Labels_1 = require("./app/Labels");
|
|
18
|
+
// Custom icon dialog title bar
|
|
19
|
+
const IconDialogTitle = (0, material_1.styled)(material_1.DialogTitle, {
|
|
20
|
+
// Prevent the passing of the draggable prop to the underlying DOM element
|
|
21
|
+
shouldForwardProp: (prop) => prop !== "draggable"
|
|
22
|
+
}) `
|
|
23
|
+
${({ theme, draggable }) => `
|
|
24
|
+
cursor: ${draggable ? "move" : "default"};
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
& .dialogTitle {
|
|
28
|
+
font-weight: bold;
|
|
29
|
+
font-size: 1.17em;
|
|
30
|
+
flex-grow: 3;
|
|
31
|
+
text-overflow: ellipsis;
|
|
32
|
+
padding-left: ${theme.spacing(1)};
|
|
33
|
+
}
|
|
34
|
+
& .MuiDialogContent-root-close-button {
|
|
35
|
+
padding-left: ${theme.spacing(1)};
|
|
36
|
+
}
|
|
37
|
+
`}
|
|
38
|
+
`;
|
|
39
|
+
/**
|
|
40
|
+
* MU notification
|
|
41
|
+
*/
|
|
42
|
+
class NotificationMU extends react_2.NotificationReact {
|
|
43
|
+
// Create alert
|
|
44
|
+
createAlert(_props, className) {
|
|
45
|
+
const labels = Labels_1.Labels.NotificationMU;
|
|
46
|
+
const { buttons, inputs, fullScreen, fullWidth = true, maxWidth, okLabel = labels.alertOK, primaryButton = true, primaryButtonProps, closable = false, draggable = fullScreen === true ? false : true } = this.inputProps ?? {};
|
|
47
|
+
let title = this.title;
|
|
48
|
+
let icon;
|
|
49
|
+
if (this.type === notificationbase_1.NotificationMessageType.Success) {
|
|
50
|
+
icon = (0, jsx_runtime_1.jsx)(icons_material_1.Done, { color: "primary" });
|
|
51
|
+
title ??= labels.success;
|
|
52
|
+
}
|
|
53
|
+
else if (this.type === notificationbase_1.NotificationMessageType.Info) {
|
|
54
|
+
icon = (0, jsx_runtime_1.jsx)(icons_material_1.Info, {});
|
|
55
|
+
title ??= labels.info;
|
|
56
|
+
}
|
|
57
|
+
else if (this.type === notificationbase_1.NotificationMessageType.Warning) {
|
|
58
|
+
icon = (0, jsx_runtime_1.jsx)(icons_material_1.Warning, { color: "secondary" });
|
|
59
|
+
title ??= labels.warning;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
icon = (0, jsx_runtime_1.jsx)(icons_material_1.Error, { color: "error" });
|
|
63
|
+
title ??= labels.alertTitle;
|
|
64
|
+
}
|
|
65
|
+
const setupProps = {
|
|
66
|
+
color: "primary"
|
|
67
|
+
};
|
|
68
|
+
// Setup callback
|
|
69
|
+
const options = this.renderSetup ? this.renderSetup(setupProps) : undefined;
|
|
70
|
+
// Callback
|
|
71
|
+
const callback = async (_event) => {
|
|
72
|
+
await this.returnValue(undefined);
|
|
73
|
+
return true;
|
|
74
|
+
};
|
|
75
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Dialog, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent_1.DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, ...options, children: [(0, jsx_runtime_1.jsxs)(IconDialogTitle, { draggable: draggable, className: draggable ? "dialog-title draggable-dialog-title" : "dialog-title", children: [icon, (0, jsx_runtime_1.jsx)("span", { className: "dialogTitle", children: title }), closable && ((0, jsx_runtime_1.jsx)(material_1.IconButton, { className: "MuiDialogContent-root-close-button", size: "small", onClick: () => this.returnValue("CLOSE"), children: (0, jsx_runtime_1.jsx)(Close_1.default, {}) }))] }), (0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [typeof this.content === "string" ? ((0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: this.content })) : (this.content), inputs] }), (0, jsx_runtime_1.jsx)(material_1.DialogActions, { children: buttons
|
|
76
|
+
? buttons(this, callback)
|
|
77
|
+
: primaryButton && ((0, jsx_runtime_1.jsx)(LoadingButton_1.LoadingButton, { ...setupProps, onClick: callback, autoFocus: true, ...primaryButtonProps, children: okLabel })) })] }, this.id));
|
|
78
|
+
}
|
|
79
|
+
// Create confirm
|
|
80
|
+
createConfirm(_props, className) {
|
|
81
|
+
const labels = Labels_1.Labels.NotificationMU;
|
|
82
|
+
const title = this.title ?? labels.confirmTitle;
|
|
83
|
+
const { buttons, okLabel = labels.confirmYes, cancelLabel = labels.confirmNo, cancelButton = true, inputs, fullScreen, fullWidth = true, maxWidth, primaryButton = true, primaryButtonProps, closable = false, draggable = fullScreen === true ? false : true } = this.inputProps ?? {};
|
|
84
|
+
// Setup callback
|
|
85
|
+
const options = this.renderSetup ? this.renderSetup({}) : undefined;
|
|
86
|
+
const callback = async (_event, value) => {
|
|
87
|
+
await this.returnValue(value);
|
|
88
|
+
return true;
|
|
89
|
+
};
|
|
90
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Dialog, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent_1.DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, ...options, children: [(0, jsx_runtime_1.jsxs)(IconDialogTitle, { draggable: draggable, className: draggable ? "dialog-title draggable-dialog-title" : "dialog-title", children: [(0, jsx_runtime_1.jsx)(icons_material_1.Help, { color: "action" }), (0, jsx_runtime_1.jsx)("span", { className: "dialogTitle", children: title }), closable && ((0, jsx_runtime_1.jsx)(material_1.IconButton, { className: "MuiDialogContent-root-close-button", size: "small", onClick: () => this.returnValue("CLOSE"), children: (0, jsx_runtime_1.jsx)(Close_1.default, {}) }))] }), (0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [typeof this.content === "string" ? ((0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: this.content })) : (this.content), inputs] }), (0, jsx_runtime_1.jsx)(material_1.DialogActions, { children: buttons ? (buttons(this, callback)) : ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [cancelButton && ((0, jsx_runtime_1.jsx)(LoadingButton_1.LoadingButton, { color: "secondary", onClick: async (event) => await callback(event, false), children: cancelLabel })), primaryButton && ((0, jsx_runtime_1.jsx)(LoadingButton_1.LoadingButton, { color: "primary", onClick: async (event) => await callback(event, true), autoFocus: true, ...primaryButtonProps, children: okLabel }))] })) })] }, this.id));
|
|
91
|
+
}
|
|
92
|
+
createMessageColor() {
|
|
93
|
+
if (this.type === notificationbase_1.NotificationMessageType.Danger)
|
|
94
|
+
return "error";
|
|
95
|
+
if (this.type === notificationbase_1.NotificationMessageType.Success)
|
|
96
|
+
return "success";
|
|
97
|
+
if (this.type === notificationbase_1.NotificationMessageType.Warning)
|
|
98
|
+
return "warning";
|
|
99
|
+
return "info";
|
|
100
|
+
}
|
|
101
|
+
// Create message
|
|
102
|
+
createMessage(props, className) {
|
|
103
|
+
if (!this.open)
|
|
104
|
+
return (0, jsx_runtime_1.jsx)(react_1.default.Fragment, {}, this.id);
|
|
105
|
+
const { closable = false } = props;
|
|
106
|
+
const setupProps = {
|
|
107
|
+
severity: this.createMessageColor(),
|
|
108
|
+
variant: "filled"
|
|
109
|
+
};
|
|
110
|
+
// Setup callback
|
|
111
|
+
const options = this.renderSetup ? this.renderSetup(setupProps) : undefined;
|
|
112
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Fade, { in: true, children: (0, jsx_runtime_1.jsxs)(material_1.Alert, { ...setupProps, ...options, action: closable ? ((0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "small", onClick: () => this.returnValue("CLOSE"), children: (0, jsx_runtime_1.jsx)(Close_1.default, {}) })) : undefined, onClose: () => this.dismiss(), className: className, children: [this.title && (0, jsx_runtime_1.jsx)(material_1.AlertTitle, { children: this.title }), this.content] }) }, this.id));
|
|
113
|
+
}
|
|
114
|
+
// Create prompt
|
|
115
|
+
createPrompt(_props, className) {
|
|
116
|
+
const labels = Labels_1.Labels.NotificationMU;
|
|
117
|
+
const title = this.title ?? labels.promptTitle;
|
|
118
|
+
const { buttons, cancelLabel = labels.promptCancel, okLabel = labels.promptOK, cancelButton = true, inputs, type, fullScreen, fullWidth = true, maxWidth, primaryButton = true, primaryButtonProps, inputProps, closable = false, draggable = fullScreen === true ? false : true } = this.inputProps ?? {};
|
|
119
|
+
const inputRef = react_1.default.createRef();
|
|
120
|
+
const errorRef = react_1.default.createRef();
|
|
121
|
+
const setError = (error) => {
|
|
122
|
+
if (errorRef.current == null)
|
|
123
|
+
return;
|
|
124
|
+
errorRef.current.innerText = error ?? "";
|
|
125
|
+
};
|
|
126
|
+
const handleSubmit = async (event) => {
|
|
127
|
+
// Result
|
|
128
|
+
let result = undefined;
|
|
129
|
+
const input = inputRef.current;
|
|
130
|
+
if (this.onReturn) {
|
|
131
|
+
// Inputs case, no HTMLForm set to value, set the current form
|
|
132
|
+
if (inputs && value == null)
|
|
133
|
+
value = event.currentTarget.form;
|
|
134
|
+
if (input) {
|
|
135
|
+
if (type === "switch") {
|
|
136
|
+
const boolValue = input.value === "true";
|
|
137
|
+
result = this.onReturn(boolValue);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
const inputValue = shared_1.DomUtils.getInputValue(input);
|
|
141
|
+
if ((inputValue == null || inputValue === "") && input.required) {
|
|
142
|
+
input.focus();
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
result = this.onReturn(inputValue);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
else if (value != null) {
|
|
149
|
+
result = this.onReturn(value);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
// Get the value
|
|
153
|
+
// returns false to prevent default dismiss
|
|
154
|
+
const v = await result;
|
|
155
|
+
if (v === false) {
|
|
156
|
+
input?.focus();
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
if (typeof v === "string") {
|
|
160
|
+
setError(v);
|
|
161
|
+
input?.focus();
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
this.dismiss();
|
|
165
|
+
return true;
|
|
166
|
+
};
|
|
167
|
+
let localInputs;
|
|
168
|
+
let value = undefined;
|
|
169
|
+
if (inputs == null) {
|
|
170
|
+
if (type === "switch") {
|
|
171
|
+
localInputs = ((0, jsx_runtime_1.jsx)(material_1.Switch, { inputRef: inputRef, ...inputProps, value: "true", autoFocus: true, required: true }));
|
|
172
|
+
}
|
|
173
|
+
else if (type === "slider") {
|
|
174
|
+
localInputs = (0, jsx_runtime_1.jsx)(material_1.Slider, { onChange: (_e, v) => (value = v) });
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
localInputs = ((0, jsx_runtime_1.jsx)(material_1.TextField, { inputRef: inputRef, onChange: () => setError(undefined), autoFocus: true, margin: "dense", fullWidth: true, type: type, required: true, ...inputProps }));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
localInputs = inputs;
|
|
182
|
+
}
|
|
183
|
+
// Setup callback
|
|
184
|
+
const options = this.renderSetup ? this.renderSetup({}) : undefined;
|
|
185
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Dialog, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent_1.DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, ...options, children: (0, jsx_runtime_1.jsxs)("form", { onSubmit: (event) => {
|
|
186
|
+
event.preventDefault();
|
|
187
|
+
event.currentTarget.elements.namedItem("okButton")?.click();
|
|
188
|
+
return false;
|
|
189
|
+
}, children: [(0, jsx_runtime_1.jsxs)(IconDialogTitle, { draggable: draggable, className: draggable ? "dialog-title draggable-dialog-title" : "dialog-title", children: [(0, jsx_runtime_1.jsx)(icons_material_1.Info, { color: "primary" }), (0, jsx_runtime_1.jsx)("span", { className: "dialogTitle", children: title }), closable && ((0, jsx_runtime_1.jsx)(material_1.IconButton, { className: "MuiDialogContent-root-close-button", size: "small", onClick: () => this.returnValue("CLOSE"), children: (0, jsx_runtime_1.jsx)(Close_1.default, {}) }))] }), (0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [typeof this.content === "string" ? ((0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: this.content })) : (this.content), localInputs, (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", display: "block", ref: errorRef, color: "error" })] }), (0, jsx_runtime_1.jsx)(material_1.DialogActions, { children: buttons ? (buttons(this, handleSubmit)) : ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [cancelButton && ((0, jsx_runtime_1.jsx)(material_1.Button, { color: "secondary", onClick: () => {
|
|
190
|
+
if (this.onReturn)
|
|
191
|
+
this.onReturn(undefined);
|
|
192
|
+
this.dismiss();
|
|
193
|
+
}, children: cancelLabel })), primaryButton && ((0, jsx_runtime_1.jsx)(LoadingButton_1.LoadingButton, { color: "primary", autoFocus: true, onClick: handleSubmit, name: "okButton", ...primaryButtonProps, children: okLabel }))] })) })] }) }, this.id));
|
|
194
|
+
}
|
|
195
|
+
createPopup(_props, className) {
|
|
196
|
+
// Destruct
|
|
197
|
+
// dismiss will trigger onReturn callback
|
|
198
|
+
const { content, id, open } = this;
|
|
199
|
+
// Setup callback
|
|
200
|
+
const options = this.renderSetup ? this.renderSetup({}) : undefined;
|
|
201
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Popover, { open: open, className: className, onClose: () => this.dismiss(), ...options, children: content }, id));
|
|
202
|
+
}
|
|
203
|
+
// Create loading
|
|
204
|
+
createLoading(_props, className) {
|
|
205
|
+
// Properties
|
|
206
|
+
const setupProps = { color: "primary" };
|
|
207
|
+
const labels = Labels_1.Labels.NotificationMU;
|
|
208
|
+
// Input props
|
|
209
|
+
const { maxWidth = "xs" } = this.inputProps ?? {};
|
|
210
|
+
// Content
|
|
211
|
+
let content = this.content;
|
|
212
|
+
if (content === "@")
|
|
213
|
+
content = labels.loading.toString();
|
|
214
|
+
// Setup callback
|
|
215
|
+
const options = this.renderSetup ? this.renderSetup(setupProps) : undefined;
|
|
216
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Backdrop, { className: className, sx: {
|
|
217
|
+
color: "#fff",
|
|
218
|
+
zIndex: (theme) => theme.zIndex.modal + 1
|
|
219
|
+
}, open: this.open, ...options, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", flexDirection: "column", flexWrap: "nowrap", alignItems: "center", sx: {
|
|
220
|
+
"& > :not(style) + :not(style)": {
|
|
221
|
+
marginTop: (theme) => theme.spacing(1)
|
|
222
|
+
}
|
|
223
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.CircularProgress, { ...setupProps }), content && ((0, jsx_runtime_1.jsx)(material_1.Box, { maxWidth: maxWidth === false ? undefined : maxWidth, children: content }))] }) }, this.id));
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Render method
|
|
227
|
+
* @param props Props
|
|
228
|
+
* @param className Style class name
|
|
229
|
+
* @param classes Style classes
|
|
230
|
+
*/
|
|
231
|
+
render(props, className) {
|
|
232
|
+
// Loading bar
|
|
233
|
+
if (this.type === notificationbase_1.NotificationType.Loading) {
|
|
234
|
+
return this.createLoading(props, className);
|
|
235
|
+
}
|
|
236
|
+
else if (this.type === notificationbase_1.NotificationType.Confirm) {
|
|
237
|
+
return this.createConfirm(props, className);
|
|
238
|
+
}
|
|
239
|
+
else if (this.type === notificationbase_1.NotificationType.Prompt) {
|
|
240
|
+
return this.createPrompt(props, className);
|
|
241
|
+
}
|
|
242
|
+
else if (this.type === notificationbase_1.NotificationType.Popup) {
|
|
243
|
+
return this.createPopup(props, className);
|
|
244
|
+
}
|
|
245
|
+
else if (this.type === notificationbase_1.NotificationType.Error ||
|
|
246
|
+
(this.modal && this.type in notificationbase_1.NotificationMessageType)) {
|
|
247
|
+
// Alert or modal message
|
|
248
|
+
return this.createAlert(props, className);
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
return this.createMessage(props, className);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
exports.NotificationMU = NotificationMU;
|
|
256
|
+
/**
|
|
257
|
+
* Antd notifier
|
|
258
|
+
*/
|
|
259
|
+
class NotifierMU extends react_2.NotifierReact {
|
|
260
|
+
/**
|
|
261
|
+
* Create state and return provider
|
|
262
|
+
* @param className Style class name
|
|
263
|
+
* @param debug Debug mode
|
|
264
|
+
* @returns Provider
|
|
265
|
+
*/
|
|
266
|
+
static setup(className, debug = false) {
|
|
267
|
+
className ??= "notifier-mu";
|
|
268
|
+
// Create an instance
|
|
269
|
+
const instance = new NotifierMU();
|
|
270
|
+
instance.debug = debug;
|
|
271
|
+
const provider = instance.createProvider(className, debug);
|
|
272
|
+
react_2.NotifierReact.updateInstance(instance);
|
|
273
|
+
return provider;
|
|
274
|
+
}
|
|
275
|
+
// Calculate origin from align property
|
|
276
|
+
static getOrigin(align) {
|
|
277
|
+
if (align === notificationbase_1.NotificationAlign.TopLeft) {
|
|
278
|
+
return {
|
|
279
|
+
horizontal: "left",
|
|
280
|
+
vertical: "top"
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
if (align === notificationbase_1.NotificationAlign.TopCenter) {
|
|
284
|
+
return {
|
|
285
|
+
horizontal: "center",
|
|
286
|
+
vertical: "top"
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
if (align === notificationbase_1.NotificationAlign.TopRight) {
|
|
290
|
+
return {
|
|
291
|
+
horizontal: "right",
|
|
292
|
+
vertical: "top"
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
if (align === notificationbase_1.NotificationAlign.BottomLeft) {
|
|
296
|
+
return {
|
|
297
|
+
horizontal: "left",
|
|
298
|
+
vertical: "bottom"
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
if (align === notificationbase_1.NotificationAlign.BottomCenter) {
|
|
302
|
+
return {
|
|
303
|
+
horizontal: "center",
|
|
304
|
+
vertical: "bottom"
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
if (align === notificationbase_1.NotificationAlign.BottomRight) {
|
|
308
|
+
return {
|
|
309
|
+
horizontal: "right",
|
|
310
|
+
vertical: "bottom"
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
return {
|
|
314
|
+
horizontal: "center",
|
|
315
|
+
vertical: "top"
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Create align container
|
|
320
|
+
* @param align Align
|
|
321
|
+
* @param children Children
|
|
322
|
+
* @param options Other options
|
|
323
|
+
*/
|
|
324
|
+
createContainer = (align, children) => {
|
|
325
|
+
// Each align group, class equal to something similar to 'align-topleft'
|
|
326
|
+
const alignText = notificationbase_1.NotificationAlign[align].toLowerCase();
|
|
327
|
+
let className = `align-${alignText}`;
|
|
328
|
+
if (children.length === 0) {
|
|
329
|
+
return (0, jsx_runtime_1.jsx)("div", { className: className }, `empty-${alignText}`);
|
|
330
|
+
}
|
|
331
|
+
if (align === notificationbase_1.NotificationAlign.Unknown) {
|
|
332
|
+
// div container for style control
|
|
333
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: className, children: children }, `div-${alignText}`));
|
|
334
|
+
}
|
|
335
|
+
// Use SnackBar for layout
|
|
336
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Snackbar, { anchorOrigin: NotifierMU.getOrigin(align), className: className, sx: align === notificationbase_1.NotificationAlign.Center
|
|
337
|
+
? { position: "fixed", top: "50%!important" }
|
|
338
|
+
: undefined, open: true, children: (0, jsx_runtime_1.jsx)(material_1.Box, { display: "flex", flexDirection: "column", flexWrap: "nowrap", sx: {
|
|
339
|
+
"& > :not(style) + :not(style)": {
|
|
340
|
+
marginTop: (theme) => theme.spacing(1)
|
|
341
|
+
}
|
|
342
|
+
}, children: children }, `box-${alignText}`) }, `layout-${alignText}`));
|
|
343
|
+
};
|
|
344
|
+
/**
|
|
345
|
+
* Add raw definition
|
|
346
|
+
* @param data Notification data definition
|
|
347
|
+
* @param modal Show as modal
|
|
348
|
+
*/
|
|
349
|
+
addRaw(data, modal) {
|
|
350
|
+
// Destruct
|
|
351
|
+
const { type, content, title, align, timespan = modal ? 0 : undefined, ...rest } = data;
|
|
352
|
+
if (this.debug) {
|
|
353
|
+
console.debug("NotificationMU.addRaw", data);
|
|
354
|
+
}
|
|
355
|
+
// Setup
|
|
356
|
+
const n = new NotificationMU(type, content, title, align, timespan);
|
|
357
|
+
// Assign other properties
|
|
358
|
+
Object.assign(n, rest);
|
|
359
|
+
// Is modal
|
|
360
|
+
if (modal != null)
|
|
361
|
+
n.modal = modal;
|
|
362
|
+
// Add to the collection
|
|
363
|
+
this.add(n);
|
|
364
|
+
// Return
|
|
365
|
+
return n;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
exports.NotifierMU = NotifierMU;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NumberInputField = NumberInputField;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const InputField_1 = require("./InputField");
|
|
10
|
+
const material_1 = require("@mui/material");
|
|
11
|
+
const shared_1 = require("@etsoo/shared");
|
|
12
|
+
/**
|
|
13
|
+
* Number input field, for controlled only components, please see IntInputField and MoneyInputField
|
|
14
|
+
* @param props Props
|
|
15
|
+
* @returns Component
|
|
16
|
+
*/
|
|
17
|
+
function NumberInputField(props) {
|
|
18
|
+
const { currency, inputStyle, min = 0, step = 1, symbol = currency
|
|
19
|
+
? `${currency} ${shared_1.NumberUtils.getCurrencySymbol(currency)}`
|
|
20
|
+
: undefined, endSymbol, max = 9999999, InputProps, ...rest } = props;
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)(InputField_1.InputField, { type: "number", inputProps: {
|
|
22
|
+
min,
|
|
23
|
+
step,
|
|
24
|
+
max,
|
|
25
|
+
style: inputStyle,
|
|
26
|
+
inputMode: "numeric"
|
|
27
|
+
}, InputProps: {
|
|
28
|
+
startAdornment: symbol ? ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "start", children: symbol }) })) : undefined,
|
|
29
|
+
endAdornment: endSymbol ? ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "end", children: endSymbol })) : undefined,
|
|
30
|
+
...InputProps
|
|
31
|
+
}, ...rest }));
|
|
32
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OptionBool = OptionBool;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const ReactApp_1 = require("./app/ReactApp");
|
|
6
|
+
const OptionGroup_1 = require("./OptionGroup");
|
|
7
|
+
/**
|
|
8
|
+
* OptionBool (yes/no)
|
|
9
|
+
* @param props Props
|
|
10
|
+
* @returns Component
|
|
11
|
+
*/
|
|
12
|
+
function OptionBool(props) {
|
|
13
|
+
// Options
|
|
14
|
+
const options = ReactApp_1.globalApp?.getBools() ?? [];
|
|
15
|
+
// Layout
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(OptionGroup_1.OptionGroup, { options: options, row: true, multiple: false, ...props }));
|
|
17
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.OptionGroup = OptionGroup;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const shared_1 = require("@etsoo/shared");
|
|
9
|
+
const material_1 = require("@mui/material");
|
|
10
|
+
const OutlinedInput_1 = __importDefault(require("@mui/material/OutlinedInput"));
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
/**
|
|
13
|
+
* OptionGroup
|
|
14
|
+
* @param props Props
|
|
15
|
+
* @returns Component
|
|
16
|
+
*/
|
|
17
|
+
function OptionGroup(props) {
|
|
18
|
+
// Destruct
|
|
19
|
+
const { getOptionLabel, defaultValue, idField = "id", label, labelField = "label", multiple = false, mRef, name, onValueChange, options, readOnly, row, itemSize, helperText, variant, required, fullWidth, ...rest } = props;
|
|
20
|
+
// Outlined
|
|
21
|
+
const outlined = variant === "outlined";
|
|
22
|
+
// Get option value
|
|
23
|
+
// D type should be the source id type
|
|
24
|
+
const getOptionValue = (option) => {
|
|
25
|
+
const value = shared_1.DataTypes.getValue(option, idField);
|
|
26
|
+
if (value == null)
|
|
27
|
+
return null;
|
|
28
|
+
return value;
|
|
29
|
+
};
|
|
30
|
+
// Checkbox values
|
|
31
|
+
const [values, setValues] = react_1.default.useState([]);
|
|
32
|
+
// Values
|
|
33
|
+
const dv = react_1.default.useMemo(() => defaultValue == null
|
|
34
|
+
? []
|
|
35
|
+
: Array.isArray(defaultValue)
|
|
36
|
+
? defaultValue
|
|
37
|
+
: [defaultValue], [defaultValue]);
|
|
38
|
+
react_1.default.useEffect(() => {
|
|
39
|
+
setValues(dv);
|
|
40
|
+
}, [dv]);
|
|
41
|
+
// Disabled ids
|
|
42
|
+
const [disabledIds, setDisabledIds] = react_1.default.useState();
|
|
43
|
+
// Item checked
|
|
44
|
+
const itemChecked = (option) => {
|
|
45
|
+
// Value
|
|
46
|
+
const value = getOptionValue(option);
|
|
47
|
+
if (value == null)
|
|
48
|
+
return false;
|
|
49
|
+
return values.includes(value);
|
|
50
|
+
};
|
|
51
|
+
react_1.default.useImperativeHandle(mRef, () => ({
|
|
52
|
+
disable(ids) {
|
|
53
|
+
setDisabledIds(ids);
|
|
54
|
+
}
|
|
55
|
+
}));
|
|
56
|
+
// First item value
|
|
57
|
+
const firstOptionValue = getOptionValue(options[0]);
|
|
58
|
+
// Items
|
|
59
|
+
const list = options.map((option) => {
|
|
60
|
+
// Value
|
|
61
|
+
const ov = getOptionValue(option);
|
|
62
|
+
// Control
|
|
63
|
+
const control = multiple ? ((0, jsx_runtime_1.jsx)(material_1.Checkbox, { name: name, readOnly: readOnly, size: itemSize, checked: itemChecked(option), disabled: disabledIds?.includes(ov), onChange: (event) => {
|
|
64
|
+
if (firstOptionValue == null)
|
|
65
|
+
return;
|
|
66
|
+
const typeValue = shared_1.Utils.parseString(event.target.value, firstOptionValue);
|
|
67
|
+
const changedValues = [...values];
|
|
68
|
+
if (event.target.checked) {
|
|
69
|
+
if (changedValues.includes(typeValue))
|
|
70
|
+
return;
|
|
71
|
+
changedValues.push(typeValue);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
changedValues.remove(typeValue);
|
|
75
|
+
}
|
|
76
|
+
if (onValueChange)
|
|
77
|
+
onValueChange(changedValues);
|
|
78
|
+
setValues(changedValues);
|
|
79
|
+
} })) : ((0, jsx_runtime_1.jsx)(material_1.Radio, { disabled: disabledIds?.includes(ov), size: itemSize, readOnly: readOnly }));
|
|
80
|
+
// Label
|
|
81
|
+
const label = getOptionLabel == null ? `${option[labelField]}` : getOptionLabel(option);
|
|
82
|
+
// Value, convert to string
|
|
83
|
+
// Will fail when type is number
|
|
84
|
+
const value = getOptionValue(option);
|
|
85
|
+
return ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: control, value: value, label: label }, value));
|
|
86
|
+
});
|
|
87
|
+
// Group
|
|
88
|
+
const group = multiple ? ((0, jsx_runtime_1.jsx)(material_1.FormGroup, { row: row, children: list })) : ((0, jsx_runtime_1.jsx)(material_1.RadioGroup, { row: row, name: name, value: values[0] ?? "", onChange: (_event, value) => {
|
|
89
|
+
if (firstOptionValue == null)
|
|
90
|
+
return;
|
|
91
|
+
const typeValue = shared_1.Utils.parseString(value, firstOptionValue);
|
|
92
|
+
if (onValueChange)
|
|
93
|
+
onValueChange(typeValue);
|
|
94
|
+
setValues([typeValue]);
|
|
95
|
+
}, children: list }));
|
|
96
|
+
// Layout
|
|
97
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.FormControl, { fullWidth: fullWidth, ...rest, children: [label && ((0, jsx_runtime_1.jsx)(material_1.InputLabel, { required: required, variant: variant, shrink: true, children: label })), outlined ? ((0, jsx_runtime_1.jsx)(OutlinedInput_1.default, { label: label && required ? label + " *" : label, notched: true, endAdornment: group, sx: {
|
|
98
|
+
cursor: "default",
|
|
99
|
+
display: "flex",
|
|
100
|
+
gap: 1,
|
|
101
|
+
paddingX: 2,
|
|
102
|
+
paddingY: "7px",
|
|
103
|
+
width: fullWidth ? "100%" : "auto",
|
|
104
|
+
"& input": {
|
|
105
|
+
display: "none"
|
|
106
|
+
}
|
|
107
|
+
} })) : ((0, jsx_runtime_1.jsx)(material_1.Box, { paddingLeft: 2, paddingY: "7px", children: group }))] }), helperText && ((0, jsx_runtime_1.jsx)(material_1.FormHelperText, { sx: { marginLeft: 2, marginRight: 2 }, children: helperText }))] }));
|
|
108
|
+
}
|