@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,211 @@
|
|
|
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.Tiplist = Tiplist;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("@etsoo/react");
|
|
9
|
+
const shared_1 = require("@etsoo/shared");
|
|
10
|
+
const material_1 = require("@mui/material");
|
|
11
|
+
const react_2 = __importDefault(require("react"));
|
|
12
|
+
const ReactApp_1 = require("./app/ReactApp");
|
|
13
|
+
const SearchField_1 = require("./SearchField");
|
|
14
|
+
const InputField_1 = require("./InputField");
|
|
15
|
+
/**
|
|
16
|
+
* Tiplist
|
|
17
|
+
* @param props Props
|
|
18
|
+
* @returns Component
|
|
19
|
+
*/
|
|
20
|
+
function Tiplist(props) {
|
|
21
|
+
// Labels
|
|
22
|
+
const { noOptions, loading, more, open: openDefault } = ReactApp_1.globalApp?.getLabels("noOptions", "loading", "more", "open") ?? {};
|
|
23
|
+
// Destruct
|
|
24
|
+
const { search = false, idField = "id", idValue, inputAutoComplete = "off", inputError, inputHelperText, inputMargin, inputOnChange, inputRequired, inputReset, inputVariant, label, loadData, defaultValue, value, maxItems = 16, width = search ? 160 : undefined, name, readOnly, onChange, onValueChange, openOnFocus = true, noOptionsText = noOptions, loadingText = loading, openText = openDefault, getOptionLabel, getOptionDisabled, sx = {}, minChars, ...rest } = props;
|
|
25
|
+
if (width && sx)
|
|
26
|
+
Object.assign(sx, { width: `${width}px` });
|
|
27
|
+
// Value input ref
|
|
28
|
+
const inputRef = react_2.default.createRef();
|
|
29
|
+
// Local value
|
|
30
|
+
let localValue = value ?? defaultValue;
|
|
31
|
+
// One time calculation for input's default value (uncontrolled)
|
|
32
|
+
const localIdValue = idValue ?? shared_1.DataTypes.getValue(localValue, idField);
|
|
33
|
+
// Changable states
|
|
34
|
+
const [states, stateUpdate] = react_2.default.useReducer((currentState, newState) => {
|
|
35
|
+
return { ...currentState, ...newState };
|
|
36
|
+
}, {
|
|
37
|
+
// Loading unknown
|
|
38
|
+
open: false,
|
|
39
|
+
options: [],
|
|
40
|
+
value: null
|
|
41
|
+
});
|
|
42
|
+
// Input value
|
|
43
|
+
const inputValue = react_2.default.useMemo(() => states.value && typeof states.value === "object"
|
|
44
|
+
? states.value[idField]
|
|
45
|
+
: undefined, [states.value]);
|
|
46
|
+
react_2.default.useEffect(() => {
|
|
47
|
+
if (localValue != null)
|
|
48
|
+
stateUpdate({ value: localValue });
|
|
49
|
+
}, [localValue]);
|
|
50
|
+
// Ref
|
|
51
|
+
const state = react_2.default.useRef({
|
|
52
|
+
idLoaded: false,
|
|
53
|
+
idSet: false,
|
|
54
|
+
isMounted: false
|
|
55
|
+
});
|
|
56
|
+
// Add readOnly
|
|
57
|
+
const addReadOnly = (params) => {
|
|
58
|
+
if (readOnly != null) {
|
|
59
|
+
Object.assign(params, { readOnly });
|
|
60
|
+
}
|
|
61
|
+
// https://stackoverflow.com/questions/15738259/disabling-chrome-autofill
|
|
62
|
+
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html
|
|
63
|
+
Object.assign(params.inputProps, {
|
|
64
|
+
autoComplete: inputAutoComplete,
|
|
65
|
+
"data-reset": inputReset
|
|
66
|
+
});
|
|
67
|
+
return params;
|
|
68
|
+
};
|
|
69
|
+
// Change handler
|
|
70
|
+
const changeHandle = (event) => {
|
|
71
|
+
// Stop processing with auto trigger event
|
|
72
|
+
if (event.nativeEvent.cancelable && !event.nativeEvent.composed) {
|
|
73
|
+
stateUpdate({ options: [] });
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
// Stop bubble
|
|
77
|
+
event.stopPropagation();
|
|
78
|
+
// Call with delay
|
|
79
|
+
delayed.call(undefined, event.currentTarget.value);
|
|
80
|
+
};
|
|
81
|
+
// Directly load data
|
|
82
|
+
const loadDataDirect = (keyword, id) => {
|
|
83
|
+
// Reset options
|
|
84
|
+
// setOptions([]);
|
|
85
|
+
if (id == null) {
|
|
86
|
+
// Reset real value
|
|
87
|
+
const input = inputRef.current;
|
|
88
|
+
if (input && input.value !== "") {
|
|
89
|
+
// Different value, trigger change event
|
|
90
|
+
react_1.ReactUtils.triggerChange(input, "", false);
|
|
91
|
+
}
|
|
92
|
+
if (states.options.length > 0) {
|
|
93
|
+
// Reset options
|
|
94
|
+
stateUpdate({ options: [] });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// Loading indicator
|
|
98
|
+
if (!states.loading)
|
|
99
|
+
stateUpdate({ loading: true });
|
|
100
|
+
// Load list
|
|
101
|
+
loadData(keyword, id, maxItems).then((options) => {
|
|
102
|
+
if (!state.current.isMounted)
|
|
103
|
+
return;
|
|
104
|
+
if (options != null && options.length >= maxItems) {
|
|
105
|
+
options.push({ [idField]: "n/a" });
|
|
106
|
+
}
|
|
107
|
+
if (id && options && onValueChange) {
|
|
108
|
+
const option = options.find((o) => o[idField] === id);
|
|
109
|
+
if (option)
|
|
110
|
+
onValueChange(option);
|
|
111
|
+
}
|
|
112
|
+
// Indicates loading completed
|
|
113
|
+
stateUpdate({
|
|
114
|
+
loading: false,
|
|
115
|
+
...(options != null && { options })
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
const delayed = (0, react_1.useDelayedExecutor)(loadDataDirect, 480);
|
|
120
|
+
const setInputValue = (value) => {
|
|
121
|
+
stateUpdate({ value });
|
|
122
|
+
// Input value
|
|
123
|
+
const input = inputRef.current;
|
|
124
|
+
if (input) {
|
|
125
|
+
// Update value
|
|
126
|
+
const newValue = shared_1.DataTypes.getStringValue(value, idField) ?? "";
|
|
127
|
+
if (newValue !== input.value) {
|
|
128
|
+
// Different value, trigger change event
|
|
129
|
+
react_1.ReactUtils.triggerChange(input, newValue, false);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
react_2.default.useEffect(() => {
|
|
134
|
+
if (localIdValue == null) {
|
|
135
|
+
if (inputValue != null)
|
|
136
|
+
setInputValue(null);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
if (state.current.idLoaded) {
|
|
140
|
+
state.current.idLoaded = false;
|
|
141
|
+
state.current.idSet = false;
|
|
142
|
+
}
|
|
143
|
+
}, [localIdValue]);
|
|
144
|
+
react_2.default.useEffect(() => {
|
|
145
|
+
if (localIdValue != null && localIdValue !== "") {
|
|
146
|
+
if (state.current.idLoaded) {
|
|
147
|
+
// Set default
|
|
148
|
+
if (!state.current.idSet && states.options.length > 0) {
|
|
149
|
+
const item = states.options.find((o) => o[idField] === localIdValue);
|
|
150
|
+
if (item) {
|
|
151
|
+
stateUpdate({
|
|
152
|
+
value: states.options[0]
|
|
153
|
+
});
|
|
154
|
+
state.current.idSet = true;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
// Load id data
|
|
160
|
+
loadDataDirect(undefined, localIdValue);
|
|
161
|
+
state.current.idLoaded = true;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}, [localIdValue, states.options]);
|
|
165
|
+
react_2.default.useEffect(() => {
|
|
166
|
+
state.current.isMounted = true;
|
|
167
|
+
return () => {
|
|
168
|
+
state.current.isMounted = false;
|
|
169
|
+
delayed.clear();
|
|
170
|
+
};
|
|
171
|
+
}, []);
|
|
172
|
+
// Layout
|
|
173
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("input", { ref: inputRef, "data-reset": inputReset ?? true, type: "text", style: { display: "none" }, name: name, value: `${inputValue ?? (state.current.idSet ? "" : localIdValue ?? "")}`, readOnly: true, onChange: inputOnChange }), (0, jsx_runtime_1.jsx)(material_1.Autocomplete, { filterOptions: (options, _state) => options, value: states.value, options: states.options, onChange: (event, value, reason, details) => {
|
|
174
|
+
// Set value
|
|
175
|
+
setInputValue(value);
|
|
176
|
+
// Custom
|
|
177
|
+
if (onChange != null)
|
|
178
|
+
onChange(event, value, reason, details);
|
|
179
|
+
if (onValueChange)
|
|
180
|
+
onValueChange(value);
|
|
181
|
+
// For clear case
|
|
182
|
+
if (reason === "clear") {
|
|
183
|
+
stateUpdate({ options: [], open: event.type === "click" });
|
|
184
|
+
loadDataDirect();
|
|
185
|
+
}
|
|
186
|
+
}, open: states.open, openOnFocus: openOnFocus, onOpen: () => {
|
|
187
|
+
// Should load
|
|
188
|
+
const loading = states.loading ? true : states.options.length === 0;
|
|
189
|
+
stateUpdate({ open: true, loading });
|
|
190
|
+
// If not loading
|
|
191
|
+
if (loading)
|
|
192
|
+
loadDataDirect(undefined, states.value == null ? undefined : states.value[idField]);
|
|
193
|
+
}, onClose: () => {
|
|
194
|
+
stateUpdate({
|
|
195
|
+
open: false,
|
|
196
|
+
...(!states.value && { options: [] })
|
|
197
|
+
});
|
|
198
|
+
}, loading: states.loading, renderInput: (params) => search ? ((0, jsx_runtime_1.jsx)(SearchField_1.SearchField, { onChange: changeHandle, ...addReadOnly(params), readOnly: readOnly, label: label, name: name + "Input", margin: inputMargin, minChars: minChars, variant: inputVariant, required: inputRequired, autoComplete: inputAutoComplete, error: inputError, helperText: inputHelperText })) : ((0, jsx_runtime_1.jsx)(InputField_1.InputField, { onChange: changeHandle, ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, minChars: minChars, variant: inputVariant, required: inputRequired, autoComplete: inputAutoComplete, error: inputError, helperText: inputHelperText })), isOptionEqualToValue: (option, value) => option[idField] === value[idField], sx: sx, noOptionsText: noOptionsText, loadingText: loadingText, openText: openText, getOptionDisabled: (item) => {
|
|
199
|
+
if (item[idField] === "n/a")
|
|
200
|
+
return true;
|
|
201
|
+
return getOptionDisabled ? getOptionDisabled(item) : false;
|
|
202
|
+
}, getOptionLabel: (item) => {
|
|
203
|
+
if (typeof item !== "object")
|
|
204
|
+
return `${item}`;
|
|
205
|
+
if (item[idField] === "n/a")
|
|
206
|
+
return (more ?? "More") + "...";
|
|
207
|
+
return getOptionLabel
|
|
208
|
+
? getOptionLabel(item)
|
|
209
|
+
: shared_1.DataTypes.getObjectItemLabel(item);
|
|
210
|
+
}, ...rest })] }));
|
|
211
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
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.TiplistPro = TiplistPro;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("@etsoo/react");
|
|
9
|
+
const shared_1 = require("@etsoo/shared");
|
|
10
|
+
const material_1 = require("@mui/material");
|
|
11
|
+
const react_2 = __importDefault(require("react"));
|
|
12
|
+
const InputField_1 = require("./InputField");
|
|
13
|
+
const ReactApp_1 = require("./app/ReactApp");
|
|
14
|
+
/**
|
|
15
|
+
* TiplistPro
|
|
16
|
+
* @param props Props
|
|
17
|
+
* @returns Component
|
|
18
|
+
*/
|
|
19
|
+
function TiplistPro(props) {
|
|
20
|
+
// Labels
|
|
21
|
+
const { noOptions, loading, more, open: openDefault } = ReactApp_1.globalApp?.getLabels("noOptions", "loading", "more", "open") ?? {};
|
|
22
|
+
// Destruct
|
|
23
|
+
const { label, loadData, defaultValue, value, idValue, maxItems = 16, width, name, inputOnChange, inputProps, inputReset, sx, openOnFocus = true, noOptionsText = noOptions, loadingText = loading, openText = openDefault, getOptionDisabled, getOptionLabel, onChange, onValueChange, minChars, ...rest } = props;
|
|
24
|
+
if (width && sx)
|
|
25
|
+
Object.assign(sx, { width: `${width}px` });
|
|
26
|
+
// Value input ref
|
|
27
|
+
const inputRef = react_2.default.createRef();
|
|
28
|
+
// Local value
|
|
29
|
+
let localValue = value ?? defaultValue;
|
|
30
|
+
// One time calculation for input's default value (uncontrolled)
|
|
31
|
+
const localIdValue = idValue ??
|
|
32
|
+
(localValue != null && typeof localValue === "object"
|
|
33
|
+
? localValue.id
|
|
34
|
+
: null);
|
|
35
|
+
// Changable states
|
|
36
|
+
const [states, stateUpdate] = react_2.default.useReducer((currentState, newState) => {
|
|
37
|
+
return { ...currentState, ...newState };
|
|
38
|
+
}, {
|
|
39
|
+
// Loading unknown
|
|
40
|
+
open: false,
|
|
41
|
+
options: [],
|
|
42
|
+
value: null
|
|
43
|
+
});
|
|
44
|
+
react_2.default.useEffect(() => {
|
|
45
|
+
if (localValue != value)
|
|
46
|
+
stateUpdate({ value: localValue });
|
|
47
|
+
}, [localValue]);
|
|
48
|
+
// Input value
|
|
49
|
+
const inputValue = react_2.default.useMemo(() => states.value && typeof states.value === "object"
|
|
50
|
+
? states.value.id
|
|
51
|
+
: undefined, [states.value]);
|
|
52
|
+
// Ref
|
|
53
|
+
const state = react_2.default.useRef({
|
|
54
|
+
idLoaded: false,
|
|
55
|
+
idSet: false,
|
|
56
|
+
isMounted: false
|
|
57
|
+
});
|
|
58
|
+
// Change handler
|
|
59
|
+
const changeHandle = (event) => {
|
|
60
|
+
// Stop processing with auto trigger event
|
|
61
|
+
if (event.nativeEvent.cancelable && !event.nativeEvent.composed) {
|
|
62
|
+
stateUpdate({ options: [] });
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
// Stop bubble
|
|
66
|
+
event.stopPropagation();
|
|
67
|
+
// Call with delay
|
|
68
|
+
delayed.call(undefined, event.currentTarget.value);
|
|
69
|
+
};
|
|
70
|
+
// Directly load data
|
|
71
|
+
const loadDataDirect = (keyword, id) => {
|
|
72
|
+
// Reset options
|
|
73
|
+
// setOptions([]);
|
|
74
|
+
if (id == null) {
|
|
75
|
+
// Reset real value
|
|
76
|
+
const input = inputRef.current;
|
|
77
|
+
if (input && input.value !== "") {
|
|
78
|
+
// Different value, trigger change event
|
|
79
|
+
react_1.ReactUtils.triggerChange(input, "", false);
|
|
80
|
+
}
|
|
81
|
+
if (states.options.length > 0) {
|
|
82
|
+
// Reset options
|
|
83
|
+
stateUpdate({ options: [] });
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// Loading indicator
|
|
87
|
+
if (!states.loading)
|
|
88
|
+
stateUpdate({ loading: true });
|
|
89
|
+
// Load list
|
|
90
|
+
loadData(keyword, id, maxItems).then((options) => {
|
|
91
|
+
if (!state.current.isMounted)
|
|
92
|
+
return;
|
|
93
|
+
if (options != null && options.length >= maxItems) {
|
|
94
|
+
options.push({ id: -1, name: "n/a" });
|
|
95
|
+
}
|
|
96
|
+
if (id && options && onValueChange) {
|
|
97
|
+
const option = options.find((o) => o["id"] === id);
|
|
98
|
+
if (option)
|
|
99
|
+
onValueChange(option);
|
|
100
|
+
}
|
|
101
|
+
// Indicates loading completed
|
|
102
|
+
stateUpdate({
|
|
103
|
+
loading: false,
|
|
104
|
+
...(options != null && { options })
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
const delayed = (0, react_1.useDelayedExecutor)(loadDataDirect, 480);
|
|
109
|
+
const setInputValue = (value) => {
|
|
110
|
+
stateUpdate({ value });
|
|
111
|
+
// Input value
|
|
112
|
+
const input = inputRef.current;
|
|
113
|
+
if (input) {
|
|
114
|
+
// Update value
|
|
115
|
+
const newValue = value?.id.toString() ?? "";
|
|
116
|
+
if (newValue !== input.value) {
|
|
117
|
+
// Different value, trigger change event
|
|
118
|
+
react_1.ReactUtils.triggerChange(input, newValue, false);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
react_2.default.useEffect(() => {
|
|
123
|
+
if (localIdValue == null) {
|
|
124
|
+
if (inputValue != null)
|
|
125
|
+
setInputValue(null);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (state.current.idLoaded) {
|
|
129
|
+
state.current.idLoaded = false;
|
|
130
|
+
state.current.idSet = false;
|
|
131
|
+
}
|
|
132
|
+
}, [localIdValue]);
|
|
133
|
+
react_2.default.useEffect(() => {
|
|
134
|
+
if (localIdValue != null && localIdValue !== "") {
|
|
135
|
+
if (state.current.idLoaded) {
|
|
136
|
+
// Set default
|
|
137
|
+
if (!state.current.idSet && states.options.length > 0) {
|
|
138
|
+
stateUpdate({
|
|
139
|
+
value: states.options.find((o) => o.id === localIdValue)
|
|
140
|
+
});
|
|
141
|
+
state.current.idSet = true;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
// Load id data
|
|
146
|
+
loadDataDirect(undefined, localIdValue);
|
|
147
|
+
state.current.idLoaded = true;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}, [localIdValue, states.options]);
|
|
151
|
+
react_2.default.useEffect(() => {
|
|
152
|
+
state.current.isMounted = true;
|
|
153
|
+
return () => {
|
|
154
|
+
state.current.isMounted = false;
|
|
155
|
+
delayed.clear();
|
|
156
|
+
};
|
|
157
|
+
}, []);
|
|
158
|
+
// Layout
|
|
159
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("input", { ref: inputRef, "data-reset": inputReset ?? true, type: "text", style: { display: "none" }, name: name, value: inputValue ?? (state.current.idSet ? "" : localIdValue ?? ""), readOnly: true, onChange: inputOnChange }), (0, jsx_runtime_1.jsx)(material_1.Autocomplete, { filterOptions: (options, _state) => options, value: states.value, options: states.options, freeSolo: true, clearOnBlur: false, onChange: (event, value, reason, details) => {
|
|
160
|
+
if (typeof value === "object") {
|
|
161
|
+
// Set value
|
|
162
|
+
setInputValue(value);
|
|
163
|
+
}
|
|
164
|
+
// Custom
|
|
165
|
+
if (onChange != null)
|
|
166
|
+
onChange(event, value, reason, details);
|
|
167
|
+
if (onValueChange) {
|
|
168
|
+
if (typeof value === "object")
|
|
169
|
+
onValueChange(value == null ? null : value);
|
|
170
|
+
}
|
|
171
|
+
// For clear case
|
|
172
|
+
if (reason === "clear") {
|
|
173
|
+
stateUpdate({ options: [], open: event.type === "click" });
|
|
174
|
+
loadDataDirect();
|
|
175
|
+
}
|
|
176
|
+
}, open: states.open, openOnFocus: openOnFocus, onOpen: () => {
|
|
177
|
+
// Should load
|
|
178
|
+
const loading = states.loading ? true : states.options.length === 0;
|
|
179
|
+
stateUpdate({ open: true, loading });
|
|
180
|
+
// If not loading
|
|
181
|
+
if (loading)
|
|
182
|
+
loadDataDirect(undefined, states.value && typeof states.value === "object"
|
|
183
|
+
? states.value.id
|
|
184
|
+
: undefined);
|
|
185
|
+
}, onClose: () => {
|
|
186
|
+
stateUpdate({
|
|
187
|
+
open: false,
|
|
188
|
+
...(!states.value && { options: [] })
|
|
189
|
+
});
|
|
190
|
+
}, loading: states.loading, renderInput: (params) => ((0, jsx_runtime_1.jsx)(InputField_1.InputField, { minChars: minChars, ...inputProps, ...params, onChange: changeHandle, label: label, name: name + "Input", onBlur: (event) => {
|
|
191
|
+
if (states.value == null && onChange)
|
|
192
|
+
onChange(event, event.target.value, "blur", undefined);
|
|
193
|
+
}, "data-reset": inputReset })), isOptionEqualToValue: (option, value) => option.id === value.id, sx: sx, noOptionsText: noOptionsText, loadingText: loadingText, openText: openText, getOptionDisabled: (item) => {
|
|
194
|
+
if (item.id === -1)
|
|
195
|
+
return true;
|
|
196
|
+
return getOptionDisabled ? getOptionDisabled(item) : false;
|
|
197
|
+
}, getOptionLabel: (item) => {
|
|
198
|
+
if (typeof item === "string")
|
|
199
|
+
return item;
|
|
200
|
+
if (item["id"] === -1)
|
|
201
|
+
return (more ?? "More") + "...";
|
|
202
|
+
if (getOptionLabel == null)
|
|
203
|
+
return shared_1.DataTypes.getListItemLabel(item);
|
|
204
|
+
return getOptionLabel(item);
|
|
205
|
+
}, ...rest })] }));
|
|
206
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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.TooltipClick = TooltipClick;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("@etsoo/react");
|
|
9
|
+
const material_1 = require("@mui/material");
|
|
10
|
+
const react_2 = __importDefault(require("react"));
|
|
11
|
+
/**
|
|
12
|
+
* Tooltip with click visibility
|
|
13
|
+
* @param props Props
|
|
14
|
+
* @returns Component
|
|
15
|
+
*/
|
|
16
|
+
function TooltipClick(props) {
|
|
17
|
+
// Destruct
|
|
18
|
+
// leaveDelay set to 5 seconds to hide the tooltip automatically
|
|
19
|
+
const { children, disableHoverListener = true, leaveDelay = 5000, onClose, title, ...rest } = props;
|
|
20
|
+
// State
|
|
21
|
+
const [localTitle, setTitle] = react_2.default.useState(title);
|
|
22
|
+
const [open, setOpen] = react_2.default.useState(false);
|
|
23
|
+
const delayed = leaveDelay > 0
|
|
24
|
+
? (0, react_1.useDelayedExecutor)(() => setOpen(false), leaveDelay)
|
|
25
|
+
: undefined;
|
|
26
|
+
// Callback for open the tooltip
|
|
27
|
+
const openTooltip = (newTitle) => {
|
|
28
|
+
setOpen(true);
|
|
29
|
+
if (newTitle)
|
|
30
|
+
setTitle(newTitle);
|
|
31
|
+
delayed?.call();
|
|
32
|
+
};
|
|
33
|
+
react_2.default.useEffect(() => {
|
|
34
|
+
return () => {
|
|
35
|
+
delayed?.clear();
|
|
36
|
+
};
|
|
37
|
+
}, []);
|
|
38
|
+
// Layout
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)(material_1.ClickAwayListener, { onClickAway: () => setOpen(false), children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, { PopperProps: {
|
|
40
|
+
disablePortal: true
|
|
41
|
+
}, onClose: (event) => {
|
|
42
|
+
setOpen(false);
|
|
43
|
+
if (onClose)
|
|
44
|
+
onClose(event);
|
|
45
|
+
}, title: localTitle, open: open, disableFocusListener: true, disableTouchListener: true, disableHoverListener: disableHoverListener, onMouseOver: disableHoverListener ? undefined : () => setOpen(true), ...rest, children: children(openTooltip) }) }));
|
|
46
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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.TwoFieldInput = TwoFieldInput;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const material_1 = require("@mui/material");
|
|
9
|
+
const ArrowRightAlt_1 = __importDefault(require("@mui/icons-material/ArrowRightAlt"));
|
|
10
|
+
const react_1 = require("@etsoo/react");
|
|
11
|
+
const react_2 = __importDefault(require("react"));
|
|
12
|
+
const shared_1 = require("@etsoo/shared");
|
|
13
|
+
const InputField_1 = require("./InputField");
|
|
14
|
+
/**
|
|
15
|
+
* TwoField Input
|
|
16
|
+
* @param props Props
|
|
17
|
+
* @returns Component
|
|
18
|
+
*/
|
|
19
|
+
function TwoFieldInput(props) {
|
|
20
|
+
// Destruct
|
|
21
|
+
const { name, inputProps, type = inputProps?.inputMode, values, onValuesChange, onChange, onInput, ...rest } = props;
|
|
22
|
+
// Local values
|
|
23
|
+
const localValues = values == null
|
|
24
|
+
? [null, null]
|
|
25
|
+
: Array.isArray(values)
|
|
26
|
+
? values
|
|
27
|
+
: [values, null];
|
|
28
|
+
// Ref
|
|
29
|
+
const valueRef = react_2.default.useRef(localValues);
|
|
30
|
+
// Watch container
|
|
31
|
+
const { dimensions } = (0, react_1.useDimensions)(1, (target, rect) => {
|
|
32
|
+
const width = (rect.width - 64) / 2;
|
|
33
|
+
const inputs = target.querySelectorAll("input");
|
|
34
|
+
inputs[0].style.width = `${width}px`;
|
|
35
|
+
inputs[1].parentElement.style.width = `${width}px`;
|
|
36
|
+
}, 0);
|
|
37
|
+
// Handle change
|
|
38
|
+
const handleChange = (event) => {
|
|
39
|
+
const value = shared_1.DomUtils.getInputValue(event.target);
|
|
40
|
+
const index = event.target.name.endsWith("-start") ? 0 : 1;
|
|
41
|
+
valueRef.current[index] = value;
|
|
42
|
+
if (onValuesChange) {
|
|
43
|
+
if (onValuesChange(valueRef.current) === false)
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (onChange)
|
|
47
|
+
onChange(event);
|
|
48
|
+
};
|
|
49
|
+
const formatValue = (v, type) => {
|
|
50
|
+
if (v == null)
|
|
51
|
+
return "";
|
|
52
|
+
if (typeof v === "number")
|
|
53
|
+
return v;
|
|
54
|
+
if (type === "date" || type === "datetime-local")
|
|
55
|
+
return shared_1.DateUtils.formatForInput(v, type);
|
|
56
|
+
return v;
|
|
57
|
+
};
|
|
58
|
+
react_2.default.useEffect(() => {
|
|
59
|
+
valueRef.current = localValues;
|
|
60
|
+
}, [localValues]);
|
|
61
|
+
// Layout
|
|
62
|
+
return ((0, jsx_runtime_1.jsx)(InputField_1.InputField, { name: `${name}-start`, type: type, value: formatValue(localValues[0], type), ref: dimensions[0][0], inputProps: inputProps, InputProps: {
|
|
63
|
+
endAdornment: ((0, jsx_runtime_1.jsxs)(material_1.InputAdornment, { position: "end", sx: {
|
|
64
|
+
display: "flex",
|
|
65
|
+
alignItems: "center",
|
|
66
|
+
gap: 1
|
|
67
|
+
}, children: [(0, jsx_runtime_1.jsx)(ArrowRightAlt_1.default, {}), (0, jsx_runtime_1.jsx)(material_1.Input, { type: type, name: `${name}-end`, value: formatValue(localValues[1], type), disableUnderline: true, onInput: onInput, onChange: handleChange, inputProps: inputProps })] }))
|
|
68
|
+
}, onInput: onInput, onChange: handleChange, ...rest }));
|
|
69
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserAvatar = UserAvatar;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const appscript_1 = require("@etsoo/appscript");
|
|
7
|
+
const ReactApp_1 = require("./app/ReactApp");
|
|
8
|
+
/**
|
|
9
|
+
* User avatar
|
|
10
|
+
* @param props Props
|
|
11
|
+
* @returns Component
|
|
12
|
+
*/
|
|
13
|
+
function UserAvatar(props) {
|
|
14
|
+
// Destruct
|
|
15
|
+
const { src, title, formatTitle = (title) => {
|
|
16
|
+
return appscript_1.BusinessUtils.formatAvatarTitle(title, 3, ReactApp_1.globalApp?.get("me") ?? "ME");
|
|
17
|
+
} } = props;
|
|
18
|
+
// Format
|
|
19
|
+
const fTitle = formatTitle(title);
|
|
20
|
+
const count = fTitle.length;
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Avatar, { title: title, src: src, sx: {
|
|
22
|
+
width: 48,
|
|
23
|
+
height: 32,
|
|
24
|
+
fontSize: count <= 2 ? "15px" : "12px"
|
|
25
|
+
}, children: fTitle }));
|
|
26
|
+
}
|