nexus-shared 1.1.21 → 3.0.0
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/CHANGELOG.md +262 -0
- package/LICENSE +21 -0
- package/README.md +1000 -0
- package/dist/Client.Index.d.ts +55 -0
- package/dist/Client.Index.js +60 -0
- package/dist/Components/Chats/Chat.d.ts +28 -0
- package/dist/Components/Chats/Chat.js +19 -0
- package/dist/Components/Chats/ChatButton.d.ts +26 -0
- package/dist/Components/Chats/ChatButton.js +41 -0
- package/dist/Components/Chats/ChatComposer.d.ts +41 -0
- package/dist/Components/Chats/ChatComposer.js +177 -0
- package/dist/Components/Chats/ChatConversations.d.ts +35 -0
- package/dist/Components/Chats/ChatConversations.js +38 -0
- package/dist/Components/Chats/ChatPanel.d.ts +66 -0
- package/dist/Components/Chats/ChatPanel.js +94 -0
- package/dist/Components/Chats/ChatParts.d.ts +87 -0
- package/dist/Components/Chats/ChatParts.js +100 -0
- package/dist/Components/Chats/ChatThread.d.ts +22 -0
- package/dist/Components/Chats/ChatThread.js +96 -0
- package/dist/Components/Documents/Button.d.ts +29 -0
- package/dist/Components/Documents/Button.js +11 -0
- package/dist/Components/Documents/Menu.d.ts +102 -0
- package/dist/Components/Documents/Menu.js +242 -0
- package/dist/Components/Documents/SplitButton.d.ts +64 -0
- package/dist/Components/Documents/SplitButton.js +129 -0
- package/dist/Components/Documents/TabButtons.d.ts +80 -0
- package/dist/Components/Documents/TabButtons.js +38 -0
- package/dist/Components/Forms/ApiForm.d.ts +23 -0
- package/dist/Components/Forms/ApiForm.js +100 -0
- package/dist/Components/Forms/Crud.d.ts +17 -0
- package/dist/Components/Forms/Crud.js +708 -0
- package/dist/Components/Forms/CrudParts.d.ts +15 -0
- package/dist/Components/Forms/CrudParts.js +36 -0
- package/dist/Components/Forms/ExcelImport.d.ts +42 -0
- package/dist/Components/Forms/ExcelImport.js +190 -0
- package/dist/Components/Forms/Form.d.ts +52 -0
- package/dist/Components/Forms/Form.js +323 -0
- package/dist/Components/Forms/SubmitForm.d.ts +65 -0
- package/dist/Components/Forms/SubmitForm.js +198 -0
- package/dist/Components/Inputs/Calendar.d.ts +69 -0
- package/dist/Components/Inputs/Calendar.js +258 -0
- package/dist/Components/Inputs/CheckBox.d.ts +53 -0
- package/dist/Components/Inputs/CheckBox.js +87 -0
- package/dist/Components/Inputs/CheckBoxGroup.d.ts +20 -0
- package/dist/Components/Inputs/CheckBoxGroup.js +80 -0
- package/dist/Components/Inputs/ChoiceField.d.ts +122 -0
- package/dist/Components/Inputs/ChoiceField.js +169 -0
- package/dist/Components/Inputs/DatePicker.d.ts +54 -0
- package/dist/Components/Inputs/DatePicker.js +246 -0
- package/dist/Components/Inputs/DateRangePicker.d.ts +62 -0
- package/dist/Components/Inputs/DateRangePicker.js +283 -0
- package/dist/Components/Inputs/DateTimePicker.d.ts +75 -0
- package/dist/Components/Inputs/DateTimePicker.js +400 -0
- package/dist/Components/Inputs/Dropdown.d.ts +117 -0
- package/dist/Components/Inputs/Dropdown.js +839 -0
- package/dist/Components/Inputs/DropdownParts.d.ts +84 -0
- package/dist/Components/Inputs/DropdownParts.js +102 -0
- package/dist/Components/Inputs/EditorShell.d.ts +45 -0
- package/dist/Components/Inputs/EditorShell.js +214 -0
- package/dist/Components/Inputs/Field.d.ts +53 -0
- package/dist/Components/Inputs/Field.js +16 -0
- package/dist/Components/Inputs/GroupForm.d.ts +20 -0
- package/dist/Components/Inputs/GroupForm.js +172 -0
- package/dist/Components/Inputs/InputField.d.ts +59 -0
- package/dist/Components/Inputs/InputField.js +169 -0
- package/dist/Components/Inputs/InputRenderer.d.ts +37 -0
- package/dist/Components/Inputs/InputRenderer.js +99 -0
- package/dist/Components/Inputs/MarkdownEditor.d.ts +67 -0
- package/dist/Components/Inputs/MarkdownEditor.js +289 -0
- package/dist/Components/Inputs/NumberBox.d.ts +53 -0
- package/dist/Components/Inputs/NumberBox.js +228 -0
- package/dist/Components/Inputs/RadioGroup.d.ts +20 -0
- package/dist/Components/Inputs/RadioGroup.js +43 -0
- package/dist/Components/Inputs/ReadOnlyNotice.d.ts +36 -0
- package/dist/Components/Inputs/ReadOnlyNotice.js +117 -0
- package/dist/Components/Inputs/RichTextEditor.d.ts +103 -0
- package/dist/Components/Inputs/RichTextEditor.js +1170 -0
- package/dist/Components/Inputs/RichTextParts.d.ts +63 -0
- package/dist/Components/Inputs/RichTextParts.js +157 -0
- package/dist/Components/Inputs/RowsInput.d.ts +115 -0
- package/dist/Components/Inputs/RowsInput.js +308 -0
- package/dist/Components/Inputs/Slider.d.ts +87 -0
- package/dist/Components/Inputs/Slider.js +216 -0
- package/dist/Components/Inputs/TabularForm.d.ts +27 -0
- package/dist/Components/Inputs/TabularForm.js +348 -0
- package/dist/Components/Inputs/TextArea.d.ts +43 -0
- package/dist/Components/Inputs/TextArea.js +31 -0
- package/dist/Components/Inputs/TextBox.d.ts +52 -0
- package/dist/Components/Inputs/TextBox.js +58 -0
- package/dist/Components/Inputs/TextField.d.ts +31 -0
- package/dist/Components/Inputs/TextField.js +35 -0
- package/dist/Components/Inputs/TimePanel.d.ts +34 -0
- package/dist/Components/Inputs/TimePanel.js +288 -0
- package/dist/Components/Inputs/TimePicker.d.ts +54 -0
- package/dist/Components/Inputs/TimePicker.js +240 -0
- package/dist/Components/Inputs/TreeView.d.ts +160 -0
- package/dist/Components/Inputs/TreeView.js +947 -0
- package/dist/Components/Layouts/MessageBox.d.ts +71 -0
- package/dist/Components/Layouts/MessageBox.js +104 -0
- package/dist/Components/Layouts/Popup.d.ts +92 -0
- package/dist/Components/Layouts/Popup.js +376 -0
- package/dist/Components/Layouts/PopupContext.d.ts +2 -0
- package/dist/Components/Layouts/PopupContext.js +4 -0
- package/dist/Components/Layouts/PopupDock.d.ts +22 -0
- package/dist/Components/Layouts/PopupDock.js +121 -0
- package/dist/Components/Layouts/PopupHost.d.ts +56 -0
- package/dist/Components/Layouts/PopupHost.js +163 -0
- package/dist/Components/Layouts/PopupRules.d.ts +30 -0
- package/dist/Components/Layouts/PopupRules.js +63 -0
- package/dist/Components/Layouts/ThemePicker.d.ts +13 -0
- package/dist/Components/Layouts/ThemePicker.js +22 -0
- package/dist/Components/Layouts/ThemeScript.d.ts +14 -0
- package/dist/Components/Layouts/ThemeScript.js +13 -0
- package/dist/Components/Layouts/ThemeSwitcher.d.ts +13 -0
- package/dist/Components/Layouts/ThemeSwitcher.js +49 -0
- package/dist/Components/Layouts/Toaster.d.ts +76 -0
- package/dist/Components/Layouts/Toaster.js +172 -0
- package/dist/Components/Viewers/DataTable.d.ts +25 -0
- package/dist/Components/Viewers/DataTable.js +596 -0
- package/dist/Components/Viewers/DataTableColumns.d.ts +28 -0
- package/dist/Components/Viewers/DataTableColumns.js +243 -0
- package/dist/Components/Viewers/DataTableParts.d.ts +138 -0
- package/dist/Components/Viewers/DataTableParts.js +157 -0
- package/dist/Components/Viewers/MarkdownView.d.ts +26 -0
- package/dist/Components/Viewers/MarkdownView.js +79 -0
- package/dist/Components/Viewers/RichTextView.d.ts +18 -0
- package/dist/Components/Viewers/RichTextView.js +17 -0
- package/dist/Helpers/AnimationHelpers.d.ts +6 -0
- package/dist/Helpers/AnimationHelpers.js +35 -0
- package/dist/Helpers/ApiClient.d.ts +96 -0
- package/dist/Helpers/ApiClient.js +200 -0
- package/dist/Helpers/ApiFormHelpers.d.ts +49 -0
- package/dist/Helpers/ApiFormHelpers.js +120 -0
- package/dist/Helpers/ApiModules.d.ts +131 -0
- package/dist/Helpers/ApiModules.js +195 -0
- package/dist/Helpers/ApiResponses.d.ts +51 -0
- package/dist/Helpers/ApiResponses.js +250 -0
- package/dist/Helpers/ApiRoutes.d.ts +140 -0
- package/dist/Helpers/ApiRoutes.js +183 -0
- package/dist/Helpers/ApiToasts.d.ts +21 -0
- package/dist/Helpers/ApiToasts.js +22 -0
- package/dist/Helpers/ChatBackend.d.ts +134 -0
- package/dist/Helpers/ChatBackend.js +332 -0
- package/dist/Helpers/ChatHelpers.d.ts +189 -0
- package/dist/Helpers/ChatHelpers.js +486 -0
- package/dist/Helpers/ChatHooks.d.ts +81 -0
- package/dist/Helpers/ChatHooks.js +175 -0
- package/dist/Helpers/ChatStore.d.ts +132 -0
- package/dist/Helpers/ChatStore.js +394 -0
- package/dist/Helpers/ChatSummaries.d.ts +39 -0
- package/dist/Helpers/ChatSummaries.js +118 -0
- package/dist/Helpers/ClassHelpers.d.ts +3 -0
- package/dist/Helpers/ClassHelpers.js +4 -0
- package/dist/Helpers/CrudBackend.d.ts +98 -0
- package/dist/Helpers/CrudBackend.js +214 -0
- package/dist/Helpers/CrudHelpers.d.ts +111 -0
- package/dist/Helpers/CrudHelpers.js +267 -0
- package/dist/Helpers/DateHelpers.d.ts +88 -0
- package/dist/Helpers/DateHelpers.js +363 -0
- package/dist/Helpers/DatePreferences.d.ts +14 -0
- package/dist/Helpers/DatePreferences.js +94 -0
- package/dist/Helpers/DateTimeHelpers.d.ts +87 -0
- package/dist/Helpers/DateTimeHelpers.js +286 -0
- package/dist/Helpers/DragHelpers.d.ts +129 -0
- package/dist/Helpers/DragHelpers.js +281 -0
- package/dist/Helpers/DropdownHelpers.d.ts +56 -0
- package/dist/Helpers/DropdownHelpers.js +180 -0
- package/dist/Helpers/ExcelBackend.d.ts +106 -0
- package/dist/Helpers/ExcelBackend.js +290 -0
- package/dist/Helpers/ExcelHelpers.d.ts +98 -0
- package/dist/Helpers/ExcelHelpers.js +302 -0
- package/dist/Helpers/FormDrafts.d.ts +18 -0
- package/dist/Helpers/FormDrafts.js +76 -0
- package/dist/Helpers/FormStore.d.ts +233 -0
- package/dist/Helpers/FormStore.js +752 -0
- package/dist/Helpers/InputParamsHelpers.d.ts +79 -0
- package/dist/Helpers/InputParamsHelpers.js +388 -0
- package/dist/Helpers/MarkdownEditing.d.ts +27 -0
- package/dist/Helpers/MarkdownEditing.js +250 -0
- package/dist/Helpers/MarkdownHelpers.d.ts +82 -0
- package/dist/Helpers/MarkdownHelpers.js +775 -0
- package/dist/Helpers/MessageBuilder.d.ts +74 -0
- package/dist/Helpers/MessageBuilder.js +252 -0
- package/dist/Helpers/NepaliCalendar.d.ts +25 -0
- package/dist/Helpers/NepaliCalendar.js +107 -0
- package/dist/Helpers/NumberHelpers.d.ts +71 -0
- package/dist/Helpers/NumberHelpers.js +202 -0
- package/dist/Helpers/Permissions.d.ts +62 -0
- package/dist/Helpers/Permissions.js +133 -0
- package/dist/Helpers/PopoverHelpers.d.ts +68 -0
- package/dist/Helpers/PopoverHelpers.js +195 -0
- package/dist/Helpers/RichTextHelpers.d.ts +77 -0
- package/dist/Helpers/RichTextHelpers.js +1072 -0
- package/dist/Helpers/RowsStore.d.ts +166 -0
- package/dist/Helpers/RowsStore.js +606 -0
- package/dist/Helpers/TableColumns.d.ts +47 -0
- package/dist/Helpers/TableColumns.js +282 -0
- package/dist/Helpers/TableExport.d.ts +30 -0
- package/dist/Helpers/TableExport.js +97 -0
- package/dist/Helpers/TableHelpers.d.ts +110 -0
- package/dist/Helpers/TableHelpers.js +301 -0
- package/dist/Helpers/TableStore.d.ts +142 -0
- package/dist/Helpers/TableStore.js +530 -0
- package/dist/Helpers/ThemeHelpers.d.ts +15 -0
- package/dist/Helpers/ThemeHelpers.js +16 -0
- package/dist/Helpers/TimeHelpers.d.ts +73 -0
- package/dist/Helpers/TimeHelpers.js +253 -0
- package/dist/Helpers/TreeStore.d.ts +188 -0
- package/dist/Helpers/TreeStore.js +577 -0
- package/dist/Helpers/ValidationHelpers.d.ts +124 -0
- package/dist/Helpers/ValidationHelpers.js +301 -0
- package/dist/Interfaces/ApiInterfaces.d.ts +174 -0
- package/dist/Interfaces/ApiInterfaces.js +30 -0
- package/dist/Interfaces/ChatInterfaces.d.ts +240 -0
- package/{src/sso-client.tsx → dist/Interfaces/ChatInterfaces.js} +1 -1
- package/dist/Interfaces/CrudInterfaces.d.ts +232 -0
- package/dist/Interfaces/CrudInterfaces.js +1 -0
- package/dist/Interfaces/DateInterfaces.d.ts +154 -0
- package/dist/Interfaces/DateInterfaces.js +29 -0
- package/dist/Interfaces/ExcelInterfaces.d.ts +215 -0
- package/dist/Interfaces/ExcelInterfaces.js +45 -0
- package/dist/Interfaces/FormInterfaces.d.ts +402 -0
- package/dist/Interfaces/FormInterfaces.js +1 -0
- package/dist/Interfaces/InputInterfaces.d.ts +141 -0
- package/dist/Interfaces/InputInterfaces.js +1 -0
- package/dist/Interfaces/MessageInterfaces.d.ts +111 -0
- package/dist/Interfaces/MessageInterfaces.js +5 -0
- package/dist/Interfaces/TableInterfaces.d.ts +351 -0
- package/dist/Interfaces/TableInterfaces.js +1 -0
- package/dist/Interfaces/ThemeInterfaces.d.ts +17 -0
- package/dist/Interfaces/ThemeInterfaces.js +17 -0
- package/dist/Interfaces/TypeInterfaces.d.ts +4 -0
- package/dist/Interfaces/TypeInterfaces.js +1 -0
- package/dist/Server.Index.d.ts +2 -0
- package/dist/Server.Index.js +5 -0
- package/dist/Services/ApiProxy.d.ts +32 -0
- package/dist/Services/ApiProxy.js +111 -0
- package/dist/Services/BrowserApi.d.ts +95 -0
- package/dist/Services/BrowserApi.js +129 -0
- package/dist/Services/ChatApi.d.ts +37 -0
- package/dist/Services/ChatApi.js +98 -0
- package/dist/Services/ExcelApi.d.ts +46 -0
- package/dist/Services/ExcelApi.js +196 -0
- package/dist/Services/ServerApi.d.ts +54 -0
- package/dist/Services/ServerApi.js +78 -0
- package/dist/Services/ThemeService.d.ts +17 -0
- package/dist/Services/ThemeService.js +83 -0
- package/dist/Shared.Index.d.ts +51 -0
- package/dist/Shared.Index.js +55 -0
- package/package.json +85 -33
- package/src/Styles/Nexus.Base.css +70 -0
- package/src/Styles/Nexus.Button.css +153 -0
- package/src/Styles/Nexus.Calendar.css +275 -0
- package/src/Styles/Nexus.Chat.css +1489 -0
- package/src/Styles/Nexus.Choice.css +345 -0
- package/src/Styles/Nexus.Crud.css +161 -0
- package/src/Styles/Nexus.DateTime.css +81 -0
- package/src/Styles/Nexus.Dropdown.css +774 -0
- package/src/Styles/Nexus.Editor.css +297 -0
- package/src/Styles/Nexus.Excel.css +370 -0
- package/src/Styles/Nexus.Form.css +321 -0
- package/src/Styles/Nexus.Index.css +36 -0
- package/src/Styles/Nexus.Input.css +637 -0
- package/src/Styles/Nexus.Markdown.css +265 -0
- package/src/Styles/Nexus.Menu.css +259 -0
- package/src/Styles/Nexus.Popup.css +731 -0
- package/src/Styles/Nexus.RichText.css +463 -0
- package/src/Styles/Nexus.Rows.css +596 -0
- package/src/Styles/Nexus.Slider.css +278 -0
- package/src/Styles/Nexus.Tab.Buttons.css +419 -0
- package/src/Styles/Nexus.Table.css +1296 -0
- package/src/Styles/Nexus.Theme.Picker.css +232 -0
- package/src/Styles/Nexus.Themes.css +194 -0
- package/src/Styles/Nexus.Time.css +147 -0
- package/src/Styles/Nexus.Toast.css +265 -0
- package/src/Styles/Nexus.Tokens.css +72 -0
- package/src/Styles/Nexus.Tree.css +435 -0
- package/src/api-services/authentication-service.tsx +0 -23
- package/src/api-services/preference-service.tsx +0 -5
- package/src/api-services/system-service.tsx +0 -29
- package/src/client.ts +0 -31
- package/src/components/documents/button.tsx +0 -133
- package/src/components/documents/icon-box.tsx +0 -93
- package/src/components/documents/page-title.tsx +0 -7
- package/src/components/documents/tab-button.tsx +0 -172
- package/src/components/documents/tag.tsx +0 -30
- package/src/components/index.js +0 -0
- package/src/components/inputs/checkbox-input.tsx +0 -66
- package/src/components/inputs/input-box.tsx +0 -48
- package/src/components/inputs/input-element.tsx +0 -65
- package/src/components/inputs/input-form.tsx +0 -164
- package/src/components/inputs/input.tsx +0 -181
- package/src/components/inputs/number-input.tsx +0 -108
- package/src/components/inputs/radiobox-input.tsx +0 -53
- package/src/components/inputs/textarea-input.tsx +0 -47
- package/src/components/inputs/textbox-input.tsx +0 -45
- package/src/components/layouts/global-dialogbox.tsx +0 -431
- package/src/components/layouts/global-layout.tsx +0 -64
- package/src/components/layouts/layout-helpers.tsx +0 -20
- package/src/components/layouts/panels/user-panel.tsx +0 -112
- package/src/components/layouts/utility-menu.tsx +0 -49
- package/src/components/panels/theme-panel.tsx +0 -46
- package/src/helpers/bitwise-helpers.tsx +0 -11
- package/src/helpers/browser-helpers.tsx +0 -156
- package/src/helpers/datasource-helpers.tsx +0 -99
- package/src/helpers/element-helpers.tsx +0 -123
- package/src/helpers/input-helpers.tsx +0 -74
- package/src/helpers/string-helpers.tsx +0 -28
- package/src/helpers/utility-helpers.tsx +0 -45
- package/src/helpers/validation-helpers.tsx +0 -302
- package/src/index.ts +0 -26
- package/src/interface.ts +0 -19
- package/src/interfaces/auth-token-interfaces.tsx +0 -6
- package/src/interfaces/browser-interfaces.tsx +0 -36
- package/src/interfaces/button-interfaces.tsx +0 -63
- package/src/interfaces/datasource-interfaces.tsx +0 -22
- package/src/interfaces/datatable-interfaces.tsx +0 -25
- package/src/interfaces/dialogbox-interfaces.tsx +0 -5
- package/src/interfaces/exception-interfaces.tsx +0 -99
- package/src/interfaces/http-interfaces.tsx +0 -129
- package/src/interfaces/icon-interfaces.tsx +0 -129
- package/src/interfaces/input-interfaces.tsx +0 -410
- package/src/interfaces/layout-interfaces.tsx +0 -191
- package/src/interfaces/menu-interfaces.tsx +0 -53
- package/src/interfaces/message-interfaces.tsx +0 -32
- package/src/interfaces/permission-interfaces.tsx +0 -9
- package/src/interfaces/storage-interfaces.tsx +0 -5
- package/src/interfaces/system-interfaces.tsx +0 -22
- package/src/interfaces/theme-interfaces.tsx +0 -123
- package/src/interfaces/type-interfaces.tsx +0 -28
- package/src/interfaces/user-interfaces.tsx +0 -47
- package/src/nexus-client.tsx +0 -21
- package/src/nexus.environments.tsx +0 -66
- package/src/proxy-api/proxy-backend.tsx +0 -60
- package/src/proxy-api/proxy-constants.tsx +0 -28
- package/src/proxy-api/proxy-helpers.tsx +0 -91
- package/src/proxy-api-client.tsx +0 -1
- package/src/proxy-api-server.tsx +0 -2
- package/src/services/http-client-services.tsx +0 -75
- package/src/services/http-services.tsx +0 -158
- package/src/services/loader-service.tsx +0 -185
- package/src/services/localstorage-service.tsx +0 -119
- package/src/services/message-services.tsx +0 -383
- package/src/services/theme-service.tsx +0 -163
- package/src/services/user-services.tsx +0 -10
- package/src/sso-config/auth-token-validation.ts +0 -16
- package/src/sso-config/callback-route.tsx +0 -35
- package/src/sso-config/cookie-encryption.ts +0 -51
- package/src/sso-config/cookie-helpers.tsx +0 -102
- package/src/sso-config/forgot-password-route.tsx +0 -36
- package/src/sso-config/oauth-callback-state.ts +0 -61
- package/src/sso-config/pkce-helpers.ts +0 -9
- package/src/sso-config/provider-complete-route.tsx +0 -18
- package/src/sso-config/redirect-context-actions.tsx +0 -45
- package/src/sso-config/redirect-context-helpers.tsx +0 -159
- package/src/sso-config/redirect-context-persist.tsx +0 -18
- package/src/sso-config/redirect-context-route.tsx +0 -45
- package/src/sso-config/refresh-route.tsx +0 -23
- package/src/sso-config/sign-in-route.tsx +0 -74
- package/src/sso-config/sign-out-route.tsx +0 -57
- package/src/sso-config/sign-up-route.tsx +0 -57
- package/src/sso-config/sso-backend-flow.ts +0 -38
- package/src/sso-config/sso-complete-route.tsx +0 -50
- package/src/sso-config/sso-config.ts +0 -59
- package/src/sso-config/sso-interfaces.tsx +0 -99
- package/src/sso-config/sso-response-helpers.tsx +0 -20
- package/src/sso-server.tsx +0 -21
- package/src/styles/nexus.animation.css +0 -269
- package/src/styles/nexus.core.css +0 -119
- package/src/styles/nexus.dialog.css +0 -144
- package/src/styles/nexus.grid-view.css +0 -42
- package/src/styles/nexus.icon.css +0 -51
- package/src/styles/nexus.input.css +0 -207
- package/src/styles/nexus.loader.css +0 -11
- package/src/styles/nexus.logic.css +0 -47
- package/src/styles/nexus.utility.css +0 -347
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import React, { JSX } from "react";
|
|
2
|
-
import { SetElementStyles } from "../../helpers/element-helpers";
|
|
3
|
-
import { DEFAULT_ICON_ELEMENT_NAME, EIcons, EIconTypes } from "../../interfaces/icon-interfaces";
|
|
4
|
-
import { EBadgeTypes, EOpacity, ESizes } from "../../interfaces/layout-interfaces";
|
|
5
|
-
import { EBackgrounds } from "../../interfaces/theme-interfaces";
|
|
6
|
-
import { ClickHandler, UN } from "../../interfaces/type-interfaces";
|
|
7
|
-
import { NEXUS_CONFIG } from "../../nexus.environments";
|
|
8
|
-
|
|
9
|
-
interface IIconBoxProps {
|
|
10
|
-
icon: EIcons;
|
|
11
|
-
children?: React.ReactNode | UN;
|
|
12
|
-
id?: string | UN;
|
|
13
|
-
iconType?: EIconTypes | UN;
|
|
14
|
-
iconSize?: ESizes | UN;
|
|
15
|
-
boxSize?: ESizes | UN;
|
|
16
|
-
background?: EBackgrounds | UN;
|
|
17
|
-
defaultClass?: string | UN;
|
|
18
|
-
iconDefaultClass?: string | UN;
|
|
19
|
-
badgeType?: EBadgeTypes | UN;
|
|
20
|
-
badgeCount?: number | UN;
|
|
21
|
-
iconOpacity?: EOpacity;
|
|
22
|
-
title?: string | UN;
|
|
23
|
-
dataKeys?: { key: string; val: string }[] | UN;
|
|
24
|
-
makeRound?: boolean | UN;
|
|
25
|
-
boxStyle?: React.CSSProperties | UN;
|
|
26
|
-
onClicked?: ClickHandler | UN;
|
|
27
|
-
onMouseEnter?: ClickHandler | UN;
|
|
28
|
-
disabledHoverEffect?: boolean | UN;
|
|
29
|
-
}
|
|
30
|
-
interface IIconProps {
|
|
31
|
-
icon: EIcons;
|
|
32
|
-
type?: EIconTypes | UN;
|
|
33
|
-
size?: ESizes | UN;
|
|
34
|
-
defaultClass?: string | UN;
|
|
35
|
-
opacity?: EOpacity | UN;
|
|
36
|
-
style?: React.CSSProperties | UN;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const _getIconClass = (size?: ESizes | UN, defaultClass?: string | UN, opacity?: EOpacity | UN) => `icon ${size ?? ESizes.Normal} ${defaultClass ?? ""} ${opacity ?? EOpacity.O08}`;
|
|
40
|
-
|
|
41
|
-
export const Icon = ({ icon, type, size, style, defaultClass, opacity }: IIconProps): JSX.Element => {
|
|
42
|
-
const c = _getIconClass(size, defaultClass, opacity ?? EOpacity.O06);
|
|
43
|
-
return React.createElement(DEFAULT_ICON_ELEMENT_NAME, {
|
|
44
|
-
name: `${icon ?? EIcons.HOME}${type ?? EIconTypes.OUTLINED}`,
|
|
45
|
-
style: style ?? undefined,
|
|
46
|
-
className: c,
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
export const CreateIcon = (icon: EIcons, parent?: HTMLElement | UN, type?: EIconTypes | UN, size?: ESizes | UN, defaultClass?: string | UN, opacity?: EOpacity | UN, style?: React.CSSProperties | UN) => {
|
|
50
|
-
const iconElement = document.createElement(DEFAULT_ICON_ELEMENT_NAME);
|
|
51
|
-
(iconElement as any).name = `${icon ?? EIcons.HOME}${type ?? EIconTypes.OUTLINED}` as string;
|
|
52
|
-
SetElementStyles(iconElement, style);
|
|
53
|
-
(iconElement as any).className = _getIconClass(size, defaultClass, opacity) as string;
|
|
54
|
-
if (parent) parent.appendChild(iconElement);
|
|
55
|
-
return iconElement;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const _getBoxClass = (background?: EBackgrounds | UN, makeRound?: boolean | UN, defaultClass?: string | UN, boxSize?: ESizes | UN, isNeedHover?: boolean | UN) => `ib ${background} ${makeRound !== false ? "r" : ""} r item ${defaultClass ?? ""} ${boxSize ?? ESizes.Normal} ${isNeedHover ? "h" : ""}`;
|
|
59
|
-
|
|
60
|
-
export const Iconbox = ({ children, id, icon, iconType, iconSize, boxSize, background, defaultClass, iconDefaultClass, badgeType, badgeCount, iconOpacity, title, dataKeys, makeRound, boxStyle, onClicked, onMouseEnter, disabledHoverEffect }: Readonly<IIconBoxProps>): JSX.Element => {
|
|
61
|
-
background = background ?? EBackgrounds.Background1;
|
|
62
|
-
const isNeedHover = disabledHoverEffect !== false;
|
|
63
|
-
const c = _getBoxClass(background, makeRound, defaultClass, boxSize, isNeedHover);
|
|
64
|
-
const dataAttributes = (dataKeys ?? []).reduce((acc, { key, val }) => {
|
|
65
|
-
(acc as any)[`data-${key}`] = val;
|
|
66
|
-
return acc;
|
|
67
|
-
}, {});
|
|
68
|
-
|
|
69
|
-
return (
|
|
70
|
-
<div {...dataAttributes} id={id ?? undefined} style={boxStyle ?? undefined} className={c} onClick={onClicked ?? undefined} onMouseEnter={onMouseEnter ?? undefined}>
|
|
71
|
-
{title && <span className="title nw">{title}</span>}
|
|
72
|
-
<Icon icon={icon} opacity={iconOpacity} type={iconType} size={iconSize} defaultClass={iconDefaultClass} />
|
|
73
|
-
{children}
|
|
74
|
-
</div>
|
|
75
|
-
);
|
|
76
|
-
};
|
|
77
|
-
export const CreateIconBox = (icon: EIcons, parent?: HTMLElement | UN, children?: HTMLElement | UN, id?: string | UN, iconType?: EIconTypes | UN, background?: EBackgrounds | UN, boxSize?: ESizes | UN, iconSize?: ESizes | UN, defaultClass?: string | UN, iconDefaultClass?: string | UN, badgeType?: EBadgeTypes | UN, badgeCount?: number | UN, iconOpacity?: EOpacity | UN, title?: string | UN, dataKeys?: { key: string; val: string }[] | UN, makeRound?: boolean | UN, boxStyle?: React.CSSProperties | UN, onClicked?: ClickHandler | UN, onMouseEnter?: ClickHandler | UN, disabledHoverEffect?: boolean | UN): HTMLElement => {
|
|
78
|
-
background = background ?? EBackgrounds.Background1;
|
|
79
|
-
const isNeedHover = disabledHoverEffect !== false;
|
|
80
|
-
const iconBox = document.createElement("div");
|
|
81
|
-
iconBox.className = _getBoxClass(background, makeRound, defaultClass, boxSize, isNeedHover);
|
|
82
|
-
SetElementStyles(iconBox, boxStyle);
|
|
83
|
-
|
|
84
|
-
if (onClicked) iconBox.onclick = onClicked;
|
|
85
|
-
if (onMouseEnter) iconBox.onmouseenter = onMouseEnter;
|
|
86
|
-
if (parent) parent.appendChild(iconBox);
|
|
87
|
-
|
|
88
|
-
CreateIcon(icon, iconBox, iconType, iconSize, iconDefaultClass, iconOpacity);
|
|
89
|
-
if (children) iconBox.appendChild(children as HTMLElement);
|
|
90
|
-
return iconBox;
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
export const CreateToggleButton = (parentElement?: HTMLElement | null, children?: HTMLElement | UN, id?: string | UN, boxSize?: ESizes | null, iconSize?: ESizes | null, opacity?: EOpacity | UN, iconType?: EIconTypes | null, boxBackground?: EBackgrounds) => CreateIconBox(EIcons.ELLIPSIS_HORIZONTAL, parentElement, children, id, iconType, boxBackground, boxSize, iconSize, `h ${boxBackground ?? NEXUS_CONFIG.DEFAULT_BACKGROUND} ml5`, "r90");
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
export const GLOBAL_PAGE_TITLE_CLASS = (defaultClass?: string, borderBottom?: number, marginBottom?: number, paddingBottom?: number) => `fs-12 o09 fw600 ${defaultClass ?? ""} bb${borderBottom ?? 0} mb${marginBottom ?? 0} pb${paddingBottom ?? 0}`;
|
|
4
|
-
|
|
5
|
-
export const PageTitle = ({ title, defaultClass, borderBottom, marginBottom }: { title: string; defaultClass?: string; borderBottom?: number; marginBottom?: number }) => {
|
|
6
|
-
return <h6 className={GLOBAL_PAGE_TITLE_CLASS(defaultClass, borderBottom, marginBottom, borderBottom ? 2 : 0)}>{title}</h6>;
|
|
7
|
-
};
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import React, { useEffect, useState } from "react";
|
|
4
|
-
import { CreateClone, DynamicSorting, GetVisibleAndHiddenItems } from "../../helpers/datasource-helpers";
|
|
5
|
-
import { RenderChildren } from "../../helpers/element-helpers";
|
|
6
|
-
import { IButton } from "../../interfaces/button-interfaces";
|
|
7
|
-
import { IDialogboxResults } from "../../interfaces/dialogbox-interfaces";
|
|
8
|
-
import { DEFAULT_ICON_ELEMENT_NAME, EIcons, EIconTypes } from "../../interfaces/icon-interfaces";
|
|
9
|
-
import { EPositions } from "../../interfaces/layout-interfaces";
|
|
10
|
-
import { ClickHandler, UN } from "../../interfaces/type-interfaces";
|
|
11
|
-
import { NEXUS_CONFIG } from "../../nexus.environments";
|
|
12
|
-
import { GlobalDialogbox, InitializeDialogbox } from "./../layouts/global-dialogbox";
|
|
13
|
-
import { Button, Buttons, CreateButton, CreateButtons, SET_BUTTON_ACTIVE_CLASS } from "./button";
|
|
14
|
-
import { CreateToggleButton, Iconbox } from "./icon-box";
|
|
15
|
-
|
|
16
|
-
export const THEME_MENU_ELIPSE_BTN_ID = "theme-menu-ellipse-btn";
|
|
17
|
-
|
|
18
|
-
const GetMaxVisibleButtons = (parentWidth: number) => (parentWidth > 1400 ? 8 : parentWidth > 1200 ? 7 : parentWidth > 1000 ? 6 : parentWidth > 950 ? 5 : parentWidth > 750 ? 4 : parentWidth > 600 ? 3 : 2);
|
|
19
|
-
|
|
20
|
-
export function CreateTabButtons<T>(buttons: IButton[], parent: HTMLElement | null, activeButton?: IButton | null, onClicked?: ClickHandler): HTMLElement | null {
|
|
21
|
-
if (!buttons || buttons.length === 0) return null;
|
|
22
|
-
const elementList: HTMLElement[] = [];
|
|
23
|
-
const toggleButton = CreateToggleButton();
|
|
24
|
-
const themeContainer = document.createElement("div");
|
|
25
|
-
const visibleItems: IButton[] = [];
|
|
26
|
-
const hiddenItems: IButton[] = [];
|
|
27
|
-
const dataKey = "code";
|
|
28
|
-
const dataAttributeKey = "data-menu-code";
|
|
29
|
-
let dialogBoxObject: IDialogboxResults | null = null;
|
|
30
|
-
let maxVisible = 6;
|
|
31
|
-
let activeItem = activeButton ?? buttons[0];
|
|
32
|
-
let linkButtons: HTMLElement | undefined = undefined;
|
|
33
|
-
|
|
34
|
-
toggleButton.appendChild(themeContainer);
|
|
35
|
-
|
|
36
|
-
const buttonContainer = document.createElement("div");
|
|
37
|
-
buttonContainer.className = "df ac jc r";
|
|
38
|
-
if (parent) parent.appendChild(buttonContainer);
|
|
39
|
-
|
|
40
|
-
const onButtonClicked: ClickHandler = (event, element, button, index) => {
|
|
41
|
-
if (button === activeItem) return;
|
|
42
|
-
activeItem = button;
|
|
43
|
-
if (onClicked) onClicked(event, element, button, index);
|
|
44
|
-
|
|
45
|
-
const isHiddenItemClicked = hiddenItems.some((item) => item === button);
|
|
46
|
-
GetVisibleAndHiddenItems(buttons, visibleItems, hiddenItems, activeItem, maxVisible);
|
|
47
|
-
RenderChildren(buttonContainer, elementList, toggleButton, activeItem, visibleItems, hiddenItems, createButton, refreshElementClass, false, isHiddenItemClicked, dataKey, dataAttributeKey);
|
|
48
|
-
};
|
|
49
|
-
for (const button of buttons) button.onClick = (event, element, data, index) => onButtonClicked(event as Event, element, button);
|
|
50
|
-
|
|
51
|
-
const createButton = (button: IButton) => {
|
|
52
|
-
const btn = CreateButton(button, buttonContainer, null, false);
|
|
53
|
-
if (button.id) {
|
|
54
|
-
btn.setAttribute(dataAttributeKey, `btn-code-${button.id}`);
|
|
55
|
-
btn.id = button.id;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
btn.classList.add("jc");
|
|
59
|
-
btn.style.height = "var(--IW)";
|
|
60
|
-
|
|
61
|
-
refreshElementClass(btn, activeItem);
|
|
62
|
-
return btn;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const refreshElementClass = (element: HTMLElement, activeItem: IButton | UN) => {
|
|
66
|
-
const menuCode = element?.getAttribute(dataAttributeKey);
|
|
67
|
-
const isActive = activeItem?.id && `btn-code-${activeItem?.id}` === menuCode;
|
|
68
|
-
SET_BUTTON_ACTIVE_CLASS(isActive as boolean, element);
|
|
69
|
-
const icon = element.querySelector(DEFAULT_ICON_ELEMENT_NAME);
|
|
70
|
-
if (isActive) {
|
|
71
|
-
element.classList.add("active");
|
|
72
|
-
if (document.activeElement) (document.activeElement as HTMLElement).blur();
|
|
73
|
-
if (icon) icon.setAttribute("name", activeItem.icon ?? "");
|
|
74
|
-
} else {
|
|
75
|
-
element.classList.remove("active");
|
|
76
|
-
if (activeItem)
|
|
77
|
-
if (icon) {
|
|
78
|
-
let iconName = icon.getAttribute("name");
|
|
79
|
-
if (iconName && !iconName.endsWith("-outline")) iconName += "-outline";
|
|
80
|
-
icon.setAttribute("name", iconName ?? "");
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
const onVisibility = () => {
|
|
85
|
-
if (linkButtons) linkButtons.remove();
|
|
86
|
-
linkButtons = CreateButtons(hiddenItems, themeContainer, null, 6, 0);
|
|
87
|
-
};
|
|
88
|
-
const parentBound = parent?.getBoundingClientRect();
|
|
89
|
-
const parentWidth = parentBound ? parentBound.width : 1000;
|
|
90
|
-
maxVisible = GetMaxVisibleButtons(parentWidth);
|
|
91
|
-
GetVisibleAndHiddenItems(buttons, visibleItems, hiddenItems, activeItem, maxVisible);
|
|
92
|
-
RenderChildren(buttonContainer, elementList, toggleButton, activeItem, visibleItems, hiddenItems, createButton, refreshElementClass, true, false, dataKey, dataAttributeKey);
|
|
93
|
-
|
|
94
|
-
if (hiddenItems.length > 0) {
|
|
95
|
-
linkButtons = CreateButtons(hiddenItems, themeContainer, null, 6, 0);
|
|
96
|
-
dialogBoxObject = InitializeDialogbox(toggleButton, themeContainer, true, undefined, undefined, 40, undefined, onVisibility, undefined, false, EPositions.Right, undefined, undefined, undefined, true);
|
|
97
|
-
dialogBoxObject?.visibility(false, true);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return buttonContainer;
|
|
101
|
-
}
|
|
102
|
-
export const TabButtons = ({ buttons, activeButton, onClicked }: { buttons: IButton[]; activeButton?: string | null | Function; onClicked?: ClickHandler }) => {
|
|
103
|
-
const [tabButtons, setTabButtons] = useState<ITab>({ visibleButtons: null, hiddenButtons: null });
|
|
104
|
-
const [activeItem, setActiveItem] = useState<string | null>(null);
|
|
105
|
-
const tabContainerRef = React.useRef<HTMLDivElement>(null);
|
|
106
|
-
|
|
107
|
-
useEffect(() => {
|
|
108
|
-
const timeout = setTimeout(() => {
|
|
109
|
-
clearTimeout(timeout);
|
|
110
|
-
|
|
111
|
-
const tabContainer = tabContainerRef.current;
|
|
112
|
-
if (!tabContainer || !buttons || buttons.length === 0) return;
|
|
113
|
-
|
|
114
|
-
const sortingButtons = DynamicSorting<IButton>(buttons, "displayOrder", true);
|
|
115
|
-
const newButtons = CreateClone(sortingButtons) as IButton[];
|
|
116
|
-
const parentBound = tabContainer.getBoundingClientRect();
|
|
117
|
-
const parentWidth = parentBound.width;
|
|
118
|
-
const maxVisible = GetMaxVisibleButtons(parentWidth);
|
|
119
|
-
const visibleItems: IButton[] = [];
|
|
120
|
-
const hiddenItems: IButton[] = [];
|
|
121
|
-
const active = typeof activeButton === "function" ? (newButtons.find((btn) => btn.id === activeButton()) ?? newButtons[0]) : (newButtons.find((btn) => btn.id === (activeItem ?? activeButton)) ?? newButtons[0]);
|
|
122
|
-
GetVisibleAndHiddenItems(newButtons, visibleItems, hiddenItems, active, maxVisible);
|
|
123
|
-
|
|
124
|
-
for (const btn of visibleItems) {
|
|
125
|
-
if (active && active.id && btn.id === active.id) {
|
|
126
|
-
btn.iconType = EIconTypes.OUTLINED;
|
|
127
|
-
btn.defaultClass = "btn active jc r";
|
|
128
|
-
} else btn.defaultClass = `jc r ${NEXUS_CONFIG.DEFAULT_BACKGROUND}`;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
for (const btn of hiddenItems) btn.defaultClass = NEXUS_CONFIG.DEFAULT_BACKGROUND;
|
|
132
|
-
|
|
133
|
-
for (const btn of newButtons) {
|
|
134
|
-
btn.onClick = (event, element, data, index) => {
|
|
135
|
-
if (btn.id === activeItem) return;
|
|
136
|
-
if (onClicked) onClicked(event, element, btn, index);
|
|
137
|
-
setActiveItem(btn.id ?? null);
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
setTabButtons({ visibleButtons: visibleItems, hiddenButtons: hiddenItems.length > 0 ? hiddenItems : null });
|
|
142
|
-
}, 0);
|
|
143
|
-
return () => clearTimeout(timeout);
|
|
144
|
-
}, [buttons, activeItem, onClicked]);
|
|
145
|
-
|
|
146
|
-
/* ---------------- render ---------------- */
|
|
147
|
-
return (
|
|
148
|
-
<div ref={tabContainerRef} className="df ac jc r">
|
|
149
|
-
{tabButtons.visibleButtons?.map((btn) => (
|
|
150
|
-
<Button
|
|
151
|
-
styles={{
|
|
152
|
-
height: "var(--IW)",
|
|
153
|
-
}}
|
|
154
|
-
key={btn.id}
|
|
155
|
-
button={btn}
|
|
156
|
-
/>
|
|
157
|
-
))}
|
|
158
|
-
|
|
159
|
-
{tabButtons.hiddenButtons && (
|
|
160
|
-
<Iconbox defaultClass="ml5" icon={EIcons.ELLIPSIS_HORIZONTAL} iconType={EIconTypes.OUTLINED} iconDefaultClass="r90" id={THEME_MENU_ELIPSE_BTN_ID}>
|
|
161
|
-
<GlobalDialogbox defaultPadding={0} iggnoreChildClick={false} buttonIdentity={THEME_MENU_ELIPSE_BTN_ID} position={EPositions.Right}>
|
|
162
|
-
<Buttons buttons={tabButtons.hiddenButtons} />
|
|
163
|
-
</GlobalDialogbox>
|
|
164
|
-
</Iconbox>
|
|
165
|
-
)}
|
|
166
|
-
</div>
|
|
167
|
-
);
|
|
168
|
-
};
|
|
169
|
-
interface ITab {
|
|
170
|
-
visibleButtons: IButton[] | null;
|
|
171
|
-
hiddenButtons: IButton[] | null;
|
|
172
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { CSSProperties } from "react";
|
|
2
|
-
import { EBackgrounds, EOpacity, EUserRoles, UN } from "../../interface";
|
|
3
|
-
|
|
4
|
-
export const GlobalTag = ({ value, background, isSmall, defaultClass, fontOpacity }: { value: string; background?: EBackgrounds; isSmall?: boolean; defaultClass?: string; fontOpacity?: EOpacity }) => {
|
|
5
|
-
isSmall = isSmall ?? true;
|
|
6
|
-
const style = { width: "fit-content" } as CSSProperties;
|
|
7
|
-
if (isSmall) style.minHeight = "1.2rem";
|
|
8
|
-
return (
|
|
9
|
-
<small style={style} className={`pr3 pl3 r pr item nw ${fontOpacity ?? EOpacity.O08} ${isSmall ? "fs-07" : "p1"} ${defaultClass ?? ""} df ac jc ${background ?? EBackgrounds.ThemeColor600}`}>
|
|
10
|
-
{value}
|
|
11
|
-
</small>
|
|
12
|
-
);
|
|
13
|
-
};
|
|
14
|
-
export function GetUserRoleTag(role: string | EUserRoles | UN, isShort?: boolean, defaultClass?: string): React.JSX.Element {
|
|
15
|
-
const status = role?.toString();
|
|
16
|
-
|
|
17
|
-
switch (status) {
|
|
18
|
-
case "3":
|
|
19
|
-
case "SuperAdmin":
|
|
20
|
-
return <GlobalTag isSmall={true} value={isShort ? "SA" : "Super"} defaultClass={defaultClass} />;
|
|
21
|
-
case "2":
|
|
22
|
-
case "Admin":
|
|
23
|
-
return <GlobalTag isSmall={true} value={isShort ? "A" : "Admin"} defaultClass={defaultClass} />;
|
|
24
|
-
case "1":
|
|
25
|
-
case "User":
|
|
26
|
-
return <GlobalTag isSmall={true} value={isShort ? "U" : "User"} defaultClass={defaultClass} />;
|
|
27
|
-
default:
|
|
28
|
-
return <GlobalTag isSmall={true} value={isShort ? "G" : "Guest"} defaultClass={defaultClass} />;
|
|
29
|
-
}
|
|
30
|
-
}
|
package/src/components/index.js
DELETED
|
File without changes
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { GetInputId, SetHaveValueClass } from "../../helpers/input-helpers";
|
|
2
|
-
import { EValueChangeTypes, ICheckbox, IInputCreateResults } from "../../interfaces/input-interfaces";
|
|
3
|
-
import { CreateInput } from "./input";
|
|
4
|
-
import { CreateInputBox, CreateInputWrapper } from "./input-box";
|
|
5
|
-
import { CreateRadiobox } from "./radiobox-input";
|
|
6
|
-
|
|
7
|
-
export const CreateCheckbox = (param: ICheckbox, parentElement: HTMLElement | null, isTabular: boolean) => {
|
|
8
|
-
if (param.groupId) return CreateRadiobox(param, parentElement, isTabular, true);
|
|
9
|
-
|
|
10
|
-
const input = CreateInput(param) as HTMLInputElement;
|
|
11
|
-
const ELEMENT_ID = GetInputId(param);
|
|
12
|
-
|
|
13
|
-
input.classList.add("pr");
|
|
14
|
-
input.classList.remove("ipt");
|
|
15
|
-
input.defaultChecked = param.defaultValue ?? false;
|
|
16
|
-
|
|
17
|
-
const box = CreateInputBox(param, input, null, isTabular);
|
|
18
|
-
const label = box.querySelector("label") as HTMLLabelElement;
|
|
19
|
-
if (label) label.className = "p2 ilb hc o08";
|
|
20
|
-
const wrapper = isTabular ? box : CreateInputWrapper(param, box, parentElement);
|
|
21
|
-
|
|
22
|
-
box.classList.add("df", "ac", "pl3", "ipt-bxh");
|
|
23
|
-
box.classList.remove("ipt-bx");
|
|
24
|
-
|
|
25
|
-
function notifyChanged(val: boolean, isInit: boolean, isForced: boolean, isDisposed: boolean) {
|
|
26
|
-
if (!param.checkedValue) param.onChanged?.(val, isInit, isForced, isDisposed, ELEMENT_ID, undefined);
|
|
27
|
-
else param.onChanged?.(val ? param.checkedValue : null, isInit, isForced, isDisposed, ELEMENT_ID, undefined);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function handleChanged(val: boolean, isInit: boolean, isForced: boolean, isDisposed: boolean, type?: EValueChangeTypes, invokeOnChanged?: boolean) {
|
|
31
|
-
SetHaveValueClass(input, val);
|
|
32
|
-
if (invokeOnChanged === false) return;
|
|
33
|
-
// Group members share one form key; only the checked member should report on init.
|
|
34
|
-
if (isInit && param.groupId && !val) return;
|
|
35
|
-
notifyChanged(val, isInit, isForced, isDisposed);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function forceChangeDefaultValue(defaultValue: boolean, type?: EValueChangeTypes, invokeOnChanged?: boolean): boolean {
|
|
39
|
-
input.checked = defaultValue;
|
|
40
|
-
handleChanged(defaultValue, false, true, false, type, invokeOnChanged);
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function onInputChanged() {
|
|
45
|
-
handleChanged(input.checked, false, false, false);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
input.addEventListener("input", onInputChanged);
|
|
49
|
-
|
|
50
|
-
input.checked = param.defaultValue ?? false;
|
|
51
|
-
handleChanged(input.checked, true, false, false);
|
|
52
|
-
|
|
53
|
-
return {
|
|
54
|
-
input: param,
|
|
55
|
-
inputElement: input,
|
|
56
|
-
rootElement: wrapper,
|
|
57
|
-
forceChangeDefaultValue: forceChangeDefaultValue,
|
|
58
|
-
dispose: function (invokeOnChanged?: boolean) {
|
|
59
|
-
if (invokeOnChanged !== false) handleChanged(param.defaultValue ?? false, false, true, true);
|
|
60
|
-
input.removeEventListener("input", onInputChanged);
|
|
61
|
-
input.remove();
|
|
62
|
-
box.remove();
|
|
63
|
-
wrapper.remove();
|
|
64
|
-
},
|
|
65
|
-
} as IInputCreateResults;
|
|
66
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { INPUT_ICON_BOX_CLASS } from "../../helpers/input-helpers";
|
|
2
|
-
import { DEFAULT_INPUT_BORDER_SIZE, IInputRootParameters, REQUIRED_TEXT1 } from "../../interfaces/input-interfaces";
|
|
3
|
-
import { EBackgrounds } from "../../interfaces/theme-interfaces";
|
|
4
|
-
import { NEXUS_CONFIG } from "../../nexus.environments";
|
|
5
|
-
import { CreateIconBox } from "../documents/icon-box";
|
|
6
|
-
|
|
7
|
-
export const CreateInputBox = (param: IInputRootParameters<any>, child: HTMLElement | null, parent: HTMLElement | null, isTabular: boolean) => {
|
|
8
|
-
const bg = param.background ?? NEXUS_CONFIG.DEFAULT_BACKGROUND;
|
|
9
|
-
|
|
10
|
-
const BORDER_SIZE = param.borderSize ?? DEFAULT_INPUT_BORDER_SIZE;
|
|
11
|
-
|
|
12
|
-
const border = BORDER_SIZE > 0 ? `b${BORDER_SIZE}` : "bat1";
|
|
13
|
-
const box = document.createElement("div");
|
|
14
|
-
box.className = `ipt-bx ${param.inputSize ?? ""} db bb anim ${border} pr r ${bg}`;
|
|
15
|
-
if (child) box.appendChild(child);
|
|
16
|
-
|
|
17
|
-
if (param.label && !isTabular) {
|
|
18
|
-
const label = document.createElement("label");
|
|
19
|
-
label.className = "pa t50 ty50 left ilb en anim ml2";
|
|
20
|
-
label.innerHTML = param.label + ((param as any).isRequired ? `<span style="color: var(--B13)" class="fs-08 ml1">${REQUIRED_TEXT1}</span>` : "");
|
|
21
|
-
label.htmlFor = param.id;
|
|
22
|
-
box.appendChild(label);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (param.icon) {
|
|
26
|
-
box.classList.add("df", "ac");
|
|
27
|
-
const I = param.icon;
|
|
28
|
-
const iconBox = CreateIconBox(I.icon, box, null, null, I.type, I.background ?? param.background ?? EBackgrounds.None, I.boxSize, I.iconSize, null, null, null, null, I.opacity, null, null, null, null, I.onClicked, I.onMouseEnter, (I.onClicked || I.onMouseEnter) !== undefined);
|
|
29
|
-
iconBox.classList.add(INPUT_ICON_BOX_CLASS);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (parent) parent.appendChild(box);
|
|
33
|
-
return box;
|
|
34
|
-
};
|
|
35
|
-
export const CreateInputWrapper = (param: IInputRootParameters<any>, child: HTMLElement | null, parent: HTMLElement | null) => {
|
|
36
|
-
const col = document.createElement("div");
|
|
37
|
-
const wp = document.createElement("div");
|
|
38
|
-
const smb = document.createElement("div");
|
|
39
|
-
col.className = !param.columnSize || param.columnSize === 12 ? "col-12" : `col-${param.columnSize}`;
|
|
40
|
-
if (param.autoAdjustColumn !== false) col.classList.add("col-sm-12");
|
|
41
|
-
wp.className = "ipt-wp";
|
|
42
|
-
smb.className = "smb";
|
|
43
|
-
if (child) wp.appendChild(child);
|
|
44
|
-
wp.appendChild(smb);
|
|
45
|
-
col.appendChild(wp);
|
|
46
|
-
if (parent) parent.appendChild(col);
|
|
47
|
-
return wp;
|
|
48
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { GetInputId } from "../../helpers/input-helpers";
|
|
2
|
-
import { EButtonTypes } from "../../interfaces/button-interfaces";
|
|
3
|
-
import { EIconTypes } from "../../interfaces/icon-interfaces";
|
|
4
|
-
import { IElement, IInputCreateResults, ILinkbutton, ISubmitbutton } from "../../interfaces/input-interfaces";
|
|
5
|
-
import { EBackgrounds } from "../../interfaces/theme-interfaces";
|
|
6
|
-
import { CreateLinkButton } from "../documents/button";
|
|
7
|
-
import { CreateIconBox } from "../documents/icon-box";
|
|
8
|
-
import { CreateInputBox, CreateInputWrapper } from "./input-box";
|
|
9
|
-
|
|
10
|
-
export const CreateElement = (param: IElement, parentElement: HTMLElement | null, isTabular: boolean): IInputCreateResults => {
|
|
11
|
-
const ELEMENT_ID = GetInputId(param);
|
|
12
|
-
const box = CreateInputBox(param, null, null, isTabular);
|
|
13
|
-
const label = box.querySelector("label") as HTMLLabelElement;
|
|
14
|
-
if (label) label.remove();
|
|
15
|
-
const wrapper = isTabular ? box : CreateInputWrapper(param, box, parentElement);
|
|
16
|
-
|
|
17
|
-
return {
|
|
18
|
-
input: param,
|
|
19
|
-
inputElement: box as HTMLInputElement,
|
|
20
|
-
rootElement: wrapper,
|
|
21
|
-
forceChangeDefaultValue: null,
|
|
22
|
-
dispose: function (invokeOnChanged?: boolean) {
|
|
23
|
-
if (invokeOnChanged !== false) param.onLoad?.(null, null, false, false, true, ELEMENT_ID, 0);
|
|
24
|
-
box.remove();
|
|
25
|
-
wrapper.remove();
|
|
26
|
-
},
|
|
27
|
-
} as IInputCreateResults;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const CreateInputLink = (param: ILinkbutton, parentElement: HTMLElement | null, isTabular: boolean): IInputCreateResults => {
|
|
31
|
-
const elementObject = CreateElement(param, parentElement, isTabular);
|
|
32
|
-
const box = elementObject.inputElement as HTMLDivElement;
|
|
33
|
-
box.classList.add("bat1", "df", "ac", "ipt-bxh");
|
|
34
|
-
box.classList.remove("ipt-bx");
|
|
35
|
-
const link = CreateLinkButton(box, param.href, param.label ?? "Nexus Link", param.onClicked, param.defaultClass, null, param.borderBottom, param.background, param.target, param.position);
|
|
36
|
-
|
|
37
|
-
link.classList.add("w100");
|
|
38
|
-
|
|
39
|
-
box.appendChild(link);
|
|
40
|
-
return elementObject;
|
|
41
|
-
};
|
|
42
|
-
export const CreateInputButton = (param: ISubmitbutton, parentElement: HTMLElement | null, isTabular: boolean): IInputCreateResults => {
|
|
43
|
-
const iconParam = param.icon;
|
|
44
|
-
const button = document.createElement("button");
|
|
45
|
-
param.icon = undefined;
|
|
46
|
-
const elementObject = CreateElement(param, parentElement, isTabular);
|
|
47
|
-
const box = elementObject.inputElement as HTMLDivElement;
|
|
48
|
-
box.appendChild(button);
|
|
49
|
-
box.classList.add("h");
|
|
50
|
-
button.type = param.type ?? EButtonTypes.SUBMIT;
|
|
51
|
-
|
|
52
|
-
button.classList.add("h", "df", "ac", "jc", "ipt", "h100", "sn", "w100", "r", param.background ?? EBackgrounds.PrimaryColor);
|
|
53
|
-
const value = param.placeholder ?? param.label ?? "Submit";
|
|
54
|
-
|
|
55
|
-
if (iconParam) {
|
|
56
|
-
const span = document.createElement("span");
|
|
57
|
-
span.textContent = value;
|
|
58
|
-
span.classList.add("nw", "toh", "fs-10", "fw-600");
|
|
59
|
-
const icon = CreateIconBox(iconParam.icon, button, null, null, iconParam.type ?? EIconTypes.OUTLINED, iconParam.background ?? param.background ?? EBackgrounds.None, iconParam.boxSize, iconParam.iconSize, null, null, null, null, iconParam.opacity, null, null, null, null, iconParam.onClicked, iconParam.onMouseEnter);
|
|
60
|
-
icon.classList.add("mr3");
|
|
61
|
-
button.appendChild(span);
|
|
62
|
-
} else button.innerText = value;
|
|
63
|
-
|
|
64
|
-
return elementObject;
|
|
65
|
-
};
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import React, { useEffect } from "react";
|
|
4
|
-
import { HideLoader, ShowLoader, SubmitApi, WarningMessage } from "../../client";
|
|
5
|
-
import { GetInputId, SetResponseErrorMessage } from "../../helpers/input-helpers";
|
|
6
|
-
import { IsValidInputs } from "../../helpers/validation-helpers";
|
|
7
|
-
import { EActions, EAnimationClasses, EBackgrounds, EButtonTypes, EFlexPositions, EIcons, EIconTypes, ESizes, GetApiInformations, GetButton, UN, VoidCallbackHandler } from "../../interface";
|
|
8
|
-
import { DEFAULT_ROW_GAP, EInputTypes, GetForms, IApiForm, IForm, IFormCreateResults, IInputCreateResults, ISubmitForm, ISubmitFormCreateResults, OnFormChangeHandler, OnFormSubmitHandler } from "../../interfaces/input-interfaces";
|
|
9
|
-
import { GetFormButtonPosition } from "../../services/localstorage-service";
|
|
10
|
-
import { CreateButton } from "../documents/button";
|
|
11
|
-
import { CreateInputs, DisposeInputs } from "./input";
|
|
12
|
-
|
|
13
|
-
const forceChangeDefaultValue = (inputResults: IInputCreateResults[], newDefaultValue: any): boolean => {
|
|
14
|
-
let isChanged = true;
|
|
15
|
-
for (const inputResult of inputResults) {
|
|
16
|
-
if (inputResult.forceChangeDefaultValue) {
|
|
17
|
-
const value = newDefaultValue ? (newDefaultValue[GetInputId(inputResult.input)] ?? null) : undefined;
|
|
18
|
-
const success = inputResult.forceChangeDefaultValue(value);
|
|
19
|
-
if (isChanged) isChanged = success;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return isChanged;
|
|
23
|
-
};
|
|
24
|
-
export const CreateForm = (param: IForm, parentIdentifier: HTMLElement | string | UN, rowGap?: number, onFormRendered?: VoidCallbackHandler): IFormCreateResults | null => {
|
|
25
|
-
const { inputs, onChanged, index, isTabularForm, defaultValue } = param;
|
|
26
|
-
const parentElement = typeof parentIdentifier === "string" ? document.getElementById(parentIdentifier) : parentIdentifier;
|
|
27
|
-
|
|
28
|
-
if (!parentElement || inputs.length === 0 || !onChanged) {
|
|
29
|
-
//TODO: WarningMessage("Invalid Inputs", "Please provide valid inputs, onChanged function and parent element.");
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
const rowElement = document.createElement("div");
|
|
33
|
-
if (parentElement) parentElement.appendChild(rowElement);
|
|
34
|
-
|
|
35
|
-
rowElement.className = `row g${rowGap ?? DEFAULT_ROW_GAP} sb fg`;
|
|
36
|
-
rowElement.style.paddingTop = "var(--IEM)";
|
|
37
|
-
|
|
38
|
-
const inputResults = CreateInputs(inputs, onChanged, index, isTabularForm, rowElement, defaultValue);
|
|
39
|
-
|
|
40
|
-
onFormRendered?.(inputResults);
|
|
41
|
-
|
|
42
|
-
return {
|
|
43
|
-
inputResults: inputResults,
|
|
44
|
-
formElement: rowElement,
|
|
45
|
-
dispose: (invokeOnChanged?: boolean) => {
|
|
46
|
-
DisposeInputs(inputResults, invokeOnChanged);
|
|
47
|
-
rowElement.remove();
|
|
48
|
-
},
|
|
49
|
-
forceChangeDefaultValue: (newDefaultValue: any) => forceChangeDefaultValue(inputResults, newDefaultValue),
|
|
50
|
-
} as IFormCreateResults;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const Form = ({ param, parentIdentifier, rowGap, onFormRendered }: { param: IForm; parentIdentifier: HTMLElement | string | UN; rowGap?: number; onFormRendered?: VoidCallbackHandler }): React.ReactNode => {
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
const formResults = CreateForm(param, parentIdentifier, rowGap, onFormRendered);
|
|
56
|
-
return () => formResults?.dispose();
|
|
57
|
-
}, [param, rowGap]);
|
|
58
|
-
return <React.Fragment></React.Fragment>;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export const CreateSubmitForm = (param: ISubmitForm, parentIdentifier: HTMLElement | string | UN, rowGap?: number, buttonPosition?: EFlexPositions, formAction?: EActions | UN, onFormRendered?: VoidCallbackHandler): ISubmitFormCreateResults | null => {
|
|
62
|
-
const parentElement = typeof parentIdentifier === "string" ? document.getElementById(parentIdentifier) : parentIdentifier;
|
|
63
|
-
buttonPosition = buttonPosition ?? GetFormButtonPosition();
|
|
64
|
-
|
|
65
|
-
if (!parentElement || !param.inputs || param.inputs.length === 0 || !param.onSubmit) return null;
|
|
66
|
-
|
|
67
|
-
let formValue: any | UN;
|
|
68
|
-
let defaultValue: any | UN = GetApiInformations.IS_API(param.defaultValue) ? null : param.defaultValue;
|
|
69
|
-
const onChangedHandler: OnFormChangeHandler = (currentValue, isInitilizing, isForcedChanged, isDisposed, currentKey, index, type, dataSource) => {
|
|
70
|
-
formValue = currentValue;
|
|
71
|
-
if (param.onChanged) param.onChanged(currentValue, isInitilizing, isForcedChanged, isDisposed, currentKey, index, type, dataSource);
|
|
72
|
-
};
|
|
73
|
-
const onFormSubmit = async (event: Event) => {
|
|
74
|
-
event.preventDefault();
|
|
75
|
-
const isValidForm = IsValidInputs(formResults?.inputResults, formValue, true, true);
|
|
76
|
-
const isValid = param.overrideValidation ? await param.overrideValidation(formValue, isValidForm, formResults, formAction) : isValidForm;
|
|
77
|
-
|
|
78
|
-
param.onSubmit({ ...formValue }, isValidForm, event, formResults!, defaultValue);
|
|
79
|
-
if (!isValid) WarningMessage("Invalid Inputs", "Please fill all required fields correctly.");
|
|
80
|
-
};
|
|
81
|
-
const formParameters = GetForms.FORM(param.inputs, onChangedHandler, defaultValue);
|
|
82
|
-
const formElement = document.createElement("form");
|
|
83
|
-
parentElement.appendChild(formElement);
|
|
84
|
-
const formResults = CreateForm(formParameters, formElement, rowGap, onFormRendered);
|
|
85
|
-
if (!formResults) return null;
|
|
86
|
-
formResults.formElement.classList.add("h100", "fg");
|
|
87
|
-
|
|
88
|
-
const submitButton = param.inputs.find((input) => input.inputType === EInputTypes.SubmitButton);
|
|
89
|
-
if (!submitButton) {
|
|
90
|
-
const buttonStyle: React.CSSProperties = {
|
|
91
|
-
width: "fit-content",
|
|
92
|
-
};
|
|
93
|
-
const DEFAULT_BUTTON_CLASS = "col- jc r";
|
|
94
|
-
rowGap = rowGap ?? DEFAULT_ROW_GAP;
|
|
95
|
-
const PADDING = rowGap * 2;
|
|
96
|
-
|
|
97
|
-
const buttonParam = GetButton("Submit", null, null, EIcons.SAVE, null, null, EBackgrounds.PrimaryColor, DEFAULT_BUTTON_CLASS, null, EIconTypes.OUTLINED, null, 0, null, EButtonTypes.SUBMIT);
|
|
98
|
-
const buttonContainer = document.createElement("div");
|
|
99
|
-
buttonContainer.className = `df ac pt1 pb5 ${buttonPosition} bb pr${PADDING} pl${PADDING}`;
|
|
100
|
-
buttonContainer.style.minHeight = "calc(var(--IH) * 1.5)";
|
|
101
|
-
|
|
102
|
-
formElement.appendChild(buttonContainer);
|
|
103
|
-
CreateButton(buttonParam, buttonContainer, buttonStyle, false);
|
|
104
|
-
|
|
105
|
-
if (param.onCancelClick) {
|
|
106
|
-
const buttonParam = GetButton("Cancel", null, null, EIcons.CLOSE, param.onCancelClick, null, EBackgrounds.ErrorColor, DEFAULT_BUTTON_CLASS + ` ml${PADDING}`, null, EIconTypes.OUTLINED, null, 0, null, EButtonTypes.BUTTON);
|
|
107
|
-
CreateButton(buttonParam, buttonContainer, buttonStyle, false);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
formElement.className = `df ddc w100 h100 oh fg pr`;
|
|
112
|
-
formElement.addEventListener("submit", onFormSubmit);
|
|
113
|
-
|
|
114
|
-
const onDispose = () => {
|
|
115
|
-
formResults?.dispose();
|
|
116
|
-
formElement.remove();
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
return {
|
|
120
|
-
formElement: formElement,
|
|
121
|
-
dispose: () => onDispose(),
|
|
122
|
-
formObject: formResults,
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
export const SubmitForm = ({ param, parentIdentifier, rowGap, buttonPosition, formAction, onFormRendered }: { param: ISubmitForm; parentIdentifier: HTMLElement | string | UN; rowGap?: number; buttonPosition?: EFlexPositions; formAction?: EActions | UN; onFormRendered?: VoidCallbackHandler }): React.ReactNode => {
|
|
127
|
-
useEffect(() => {
|
|
128
|
-
const submitForm = CreateSubmitForm(param, parentIdentifier, rowGap, buttonPosition, formAction, onFormRendered);
|
|
129
|
-
return () => submitForm?.dispose();
|
|
130
|
-
}, [param, parentIdentifier, rowGap, buttonPosition, formAction]);
|
|
131
|
-
return <React.Fragment></React.Fragment>;
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
export const CreateApiForm = (param: IApiForm, parentIdentifier: HTMLElement | string | UN, rowGap?: number, buttonPosition?: EFlexPositions, formAction?: EActions | UN, overrideLoaderParend?: HTMLElement | string | UN, successMessage?: boolean | UN, errorMessage?: boolean | UN, onFormRendered?: VoidCallbackHandler): ISubmitFormCreateResults | null => {
|
|
135
|
-
let isLoading = false;
|
|
136
|
-
const onFormSubmit: OnFormSubmitHandler = async (currentValue, isValidForm, event, form, defaultValue) => {
|
|
137
|
-
if (isLoading) return;
|
|
138
|
-
isLoading = true;
|
|
139
|
-
|
|
140
|
-
if (param.onSubmit) param.onSubmit(currentValue, isValidForm, event, form, defaultValue);
|
|
141
|
-
if (!isValidForm) return;
|
|
142
|
-
|
|
143
|
-
const loaderParent = overrideLoaderParend ?? submitForm?.formElement ?? parentIdentifier;
|
|
144
|
-
ShowLoader(loaderParent, EAnimationClasses.SPIN, true, ESizes.Normal, null, null, null, "r");
|
|
145
|
-
const apiResponse = await SubmitApi(param.api, currentValue, successMessage, errorMessage);
|
|
146
|
-
if (!apiResponse.isSuccess) SetResponseErrorMessage(apiResponse, submitForm?.formObject.inputResults);
|
|
147
|
-
HideLoader(loaderParent);
|
|
148
|
-
param.onApiSubmit(currentValue, apiResponse, submitForm!, defaultValue);
|
|
149
|
-
isLoading = false;
|
|
150
|
-
};
|
|
151
|
-
const submitFormParam = GetForms.SUBMITFORM(param?.inputs, onFormSubmit, param?.defaultValue, param?.overrideValidation, param?.onChanged, param?.onCancelClick);
|
|
152
|
-
const submitForm = CreateSubmitForm(submitFormParam, parentIdentifier, rowGap, buttonPosition, formAction, onFormRendered);
|
|
153
|
-
if (!submitForm) return null;
|
|
154
|
-
|
|
155
|
-
return submitForm;
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
export const ApiForm = ({ param, parentIdentifier, rowGap, buttonPosition, formAction, overrideLoaderParend, successMessage, errorMessage, onFormRendered }: { param: IApiForm; parentIdentifier: HTMLElement | string | UN; rowGap?: number; buttonPosition?: EFlexPositions; formAction?: EActions | UN; overrideLoaderParend?: HTMLElement | string | UN; successMessage?: boolean | UN; errorMessage?: boolean | UN; onFormRendered?: VoidCallbackHandler }): React.ReactNode => {
|
|
159
|
-
useEffect(() => {
|
|
160
|
-
const apiForm = CreateApiForm(param, parentIdentifier, rowGap, buttonPosition, formAction, overrideLoaderParend, successMessage, errorMessage, onFormRendered);
|
|
161
|
-
return () => apiForm?.dispose();
|
|
162
|
-
}, [param, parentIdentifier, rowGap, buttonPosition, formAction, overrideLoaderParend, successMessage, errorMessage]);
|
|
163
|
-
return <React.Fragment></React.Fragment>;
|
|
164
|
-
};
|