nexus-shared 1.1.20 → 2.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/LICENSE +21 -0
- package/README.md +903 -0
- package/dist/Client.Index.d.ts +44 -0
- package/dist/Client.Index.js +49 -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 +238 -0
- package/dist/Components/Documents/SplitButton.d.ts +64 -0
- package/dist/Components/Documents/SplitButton.js +127 -0
- package/dist/Components/Documents/TabButtons.d.ts +62 -0
- package/dist/Components/Documents/TabButtons.js +19 -0
- package/dist/Components/Forms/ApiForm.d.ts +21 -0
- package/dist/Components/Forms/ApiForm.js +99 -0
- package/dist/Components/Forms/Crud.d.ts +17 -0
- package/dist/Components/Forms/Crud.js +556 -0
- package/dist/Components/Forms/CrudParts.d.ts +15 -0
- package/dist/Components/Forms/CrudParts.js +36 -0
- package/dist/Components/Forms/Form.d.ts +52 -0
- package/dist/Components/Forms/Form.js +319 -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 +399 -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 +170 -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 +35 -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 +116 -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 +104 -0
- package/dist/Components/Inputs/RowsInput.js +259 -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 +23 -0
- package/dist/Components/Inputs/TabularForm.js +283 -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 +239 -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 +29 -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 +542 -0
- package/dist/Components/Viewers/DataTableParts.d.ts +134 -0
- package/dist/Components/Viewers/DataTableParts.js +145 -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 +74 -0
- package/dist/Helpers/ApiClient.js +197 -0
- package/dist/Helpers/ApiFormHelpers.d.ts +26 -0
- package/dist/Helpers/ApiFormHelpers.js +56 -0
- package/dist/Helpers/ApiModules.d.ts +135 -0
- package/dist/Helpers/ApiModules.js +194 -0
- package/dist/Helpers/ApiResponses.d.ts +41 -0
- package/dist/Helpers/ApiResponses.js +159 -0
- package/dist/Helpers/ApiRoutes.d.ts +150 -0
- package/dist/Helpers/ApiRoutes.js +191 -0
- package/dist/Helpers/ApiToasts.d.ts +21 -0
- package/dist/Helpers/ApiToasts.js +22 -0
- package/dist/Helpers/ClassHelpers.d.ts +3 -0
- package/dist/Helpers/ClassHelpers.js +4 -0
- package/dist/Helpers/CrudBackend.d.ts +56 -0
- package/dist/Helpers/CrudBackend.js +119 -0
- package/dist/Helpers/CrudHelpers.d.ts +76 -0
- package/dist/Helpers/CrudHelpers.js +202 -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/FormDrafts.d.ts +18 -0
- package/dist/Helpers/FormDrafts.js +76 -0
- package/dist/Helpers/FormStore.d.ts +231 -0
- package/dist/Helpers/FormStore.js +734 -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 +254 -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 +43 -0
- package/dist/Helpers/PopoverHelpers.js +91 -0
- package/dist/Helpers/RichTextHelpers.d.ts +77 -0
- package/dist/Helpers/RichTextHelpers.js +1072 -0
- package/dist/Helpers/RowsStore.d.ts +160 -0
- package/dist/Helpers/RowsStore.js +584 -0
- package/dist/Helpers/TableColumns.d.ts +40 -0
- package/dist/Helpers/TableColumns.js +254 -0
- package/dist/Helpers/TableExport.d.ts +30 -0
- package/dist/Helpers/TableExport.js +97 -0
- package/dist/Helpers/TableHelpers.d.ts +102 -0
- package/dist/Helpers/TableHelpers.js +281 -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 +149 -0
- package/dist/Interfaces/ApiInterfaces.js +24 -0
- package/dist/Interfaces/CrudInterfaces.d.ts +171 -0
- package/{src/sso-client.tsx → dist/Interfaces/CrudInterfaces.js} +1 -1
- package/dist/Interfaces/DateInterfaces.d.ts +154 -0
- package/dist/Interfaces/DateInterfaces.js +29 -0
- package/dist/Interfaces/FormInterfaces.d.ts +352 -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 +291 -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 +78 -0
- package/dist/Services/BrowserApi.js +111 -0
- package/dist/Services/ServerApi.d.ts +49 -0
- package/dist/Services/ServerApi.js +75 -0
- package/dist/Services/ThemeService.d.ts +17 -0
- package/dist/Services/ThemeService.js +83 -0
- package/dist/Shared.Index.d.ts +43 -0
- package/dist/Shared.Index.js +47 -0
- package/package.json +82 -33
- package/src/Styles/Nexus.Base.css +70 -0
- package/src/Styles/Nexus.Button.css +151 -0
- package/src/Styles/Nexus.Calendar.css +275 -0
- package/src/Styles/Nexus.Choice.css +345 -0
- package/src/Styles/Nexus.Crud.css +84 -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.Form.css +298 -0
- package/src/Styles/Nexus.Index.css +34 -0
- package/src/Styles/Nexus.Input.css +637 -0
- package/src/Styles/Nexus.Markdown.css +265 -0
- package/src/Styles/Nexus.Menu.css +249 -0
- package/src/Styles/Nexus.Popup.css +731 -0
- package/src/Styles/Nexus.RichText.css +463 -0
- package/src/Styles/Nexus.Rows.css +566 -0
- package/src/Styles/Nexus.Slider.css +278 -0
- package/src/Styles/Nexus.Tab.Buttons.css +364 -0
- package/src/Styles/Nexus.Table.css +1014 -0
- package/src/Styles/Nexus.Theme.Picker.css +159 -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 -34
- package/src/client.ts +0 -31
- package/src/components/documents/button.tsx +0 -142
- 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 -59
- 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 -57
- 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 -49
- 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 -161
- 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.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
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
@layer nexus.components {
|
|
2
|
+
/*
|
|
3
|
+
* Tree view: a panel with a toolbar and a scrolling list of rows. Rows have a fixed height (the component places
|
|
4
|
+
* rows by it: keep --nx-tree-row and --nx-tree-pad in step with ROW_HEIGHT and PAD in TreeView.tsx). The checkbox
|
|
5
|
+
* is the CheckBox control itself, so checked, mixed, and read-only boxes look the same as everywhere else.
|
|
6
|
+
*/
|
|
7
|
+
.nx-tree {
|
|
8
|
+
--nx-tree-row: 32px;
|
|
9
|
+
--nx-tree-pad: 4px;
|
|
10
|
+
--nx-tree-indent: 20px;
|
|
11
|
+
--nx-tree-font: var(--nx-text-md);
|
|
12
|
+
--nx-tree-open: 200ms;
|
|
13
|
+
--nx-tree-close: 160ms;
|
|
14
|
+
/* A line under every parent's chevron, soft enough to leave the rows in front. */
|
|
15
|
+
--nx-tree-guide: color-mix(in oklab, var(--nx-border-strong) 55%, transparent);
|
|
16
|
+
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
min-width: 0;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
border: 1px solid var(--nx-field-border);
|
|
22
|
+
border-radius: var(--nx-radius);
|
|
23
|
+
background: var(--nx-field-bg);
|
|
24
|
+
color: var(--nx-text);
|
|
25
|
+
font-size: var(--nx-tree-font);
|
|
26
|
+
line-height: 1.35;
|
|
27
|
+
transition: border-color var(--nx-duration);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.nx-tree--sm {
|
|
31
|
+
--nx-tree-row: 28px;
|
|
32
|
+
--nx-tree-indent: 18px;
|
|
33
|
+
--nx-tree-font: var(--nx-text-sm);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.nx-tree--lg {
|
|
37
|
+
--nx-tree-row: 38px;
|
|
38
|
+
--nx-tree-indent: 22px;
|
|
39
|
+
--nx-tree-font: var(--nx-text-lg);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.nx-tree:hover {
|
|
43
|
+
border-color: var(--nx-field-border-hover);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.nx-tree:focus-within {
|
|
47
|
+
border-color: var(--nx-field-accent);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.nx-field:is([data-readonly], [data-disabled]) .nx-tree {
|
|
51
|
+
border-color: var(--nx-field-border);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Toolbar: select all and counts at the start, tools at the end, a line under it. */
|
|
55
|
+
.nx-tree__toolbar {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-wrap: wrap;
|
|
58
|
+
align-items: center;
|
|
59
|
+
gap: var(--nx-space-1) var(--nx-space-3);
|
|
60
|
+
min-height: calc(var(--nx-control-sm) + 12px);
|
|
61
|
+
padding: 6px 6px 6px var(--nx-space-3);
|
|
62
|
+
border-bottom: 1px solid var(--nx-border);
|
|
63
|
+
font-size: var(--nx-text-sm);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.nx-tree__all {
|
|
67
|
+
flex: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.nx-tree__all .nx-choice__label {
|
|
71
|
+
font-weight: 500;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* A read-only tree has one lock, after its label; select all still shows the note when clicked. */
|
|
75
|
+
.nx-tree__all .nx-field__lock {
|
|
76
|
+
display: none;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.nx-tree__summary {
|
|
80
|
+
display: inline-flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
gap: 6px;
|
|
83
|
+
min-width: 0;
|
|
84
|
+
margin-right: auto;
|
|
85
|
+
color: var(--nx-text-muted);
|
|
86
|
+
font-variant-numeric: tabular-nums;
|
|
87
|
+
white-space: nowrap;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.nx-tree__summary .nx-icon {
|
|
91
|
+
width: 14px;
|
|
92
|
+
height: 14px;
|
|
93
|
+
vertical-align: 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.nx-tree__tools {
|
|
97
|
+
display: inline-flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
gap: 2px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.nx-tree__tools .nx-btn--secondary {
|
|
103
|
+
margin-left: var(--nx-space-1);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* Rows */
|
|
107
|
+
.nx-tree__viewport {
|
|
108
|
+
position: relative;
|
|
109
|
+
overflow: auto;
|
|
110
|
+
overscroll-behavior: contain;
|
|
111
|
+
outline: none;
|
|
112
|
+
scrollbar-width: thin;
|
|
113
|
+
scrollbar-color: var(--nx-field-scrollbar) transparent;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.nx-tree__viewport:focus-visible {
|
|
117
|
+
box-shadow: inset 0 0 0 2px var(--nx-primary);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.nx-tree__list {
|
|
121
|
+
min-width: 0;
|
|
122
|
+
padding-inline: var(--nx-tree-pad);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.nx-tree__row {
|
|
126
|
+
--nx-tree-depth: 0;
|
|
127
|
+
/* Muted texts of a row. On a hovered or focused row they move toward the text color, so they keep 4.5:1 on the
|
|
128
|
+
hover tint in every theme. */
|
|
129
|
+
--nx-tree-muted: var(--nx-text-muted);
|
|
130
|
+
--nx-tree-count: color-mix(in oklab, var(--nx-text-muted), var(--nx-text) 25%);
|
|
131
|
+
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
gap: 6px;
|
|
135
|
+
height: var(--nx-tree-row);
|
|
136
|
+
padding: 0 4px 0 calc(var(--nx-tree-depth) * var(--nx-tree-indent));
|
|
137
|
+
border-radius: var(--nx-radius);
|
|
138
|
+
/* Guides: one line per level, centered under the chevron of the parent at that level. */
|
|
139
|
+
background-image: repeating-linear-gradient(
|
|
140
|
+
to right,
|
|
141
|
+
transparent 0 calc(var(--nx-tree-indent) / 2 - 0.5px),
|
|
142
|
+
var(--nx-tree-guide) calc(var(--nx-tree-indent) / 2 - 0.5px) calc(var(--nx-tree-indent) / 2 + 0.5px),
|
|
143
|
+
transparent calc(var(--nx-tree-indent) / 2 + 0.5px) var(--nx-tree-indent)
|
|
144
|
+
);
|
|
145
|
+
background-repeat: no-repeat;
|
|
146
|
+
background-size: calc(var(--nx-tree-depth) * var(--nx-tree-indent)) 100%;
|
|
147
|
+
white-space: nowrap;
|
|
148
|
+
cursor: pointer;
|
|
149
|
+
user-select: none;
|
|
150
|
+
outline: none;
|
|
151
|
+
-webkit-tap-highlight-color: transparent;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.nx-tree__row[role="treeitem"]:hover {
|
|
155
|
+
background-color: var(--nx-surface-hover);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.nx-tree__row:focus-visible {
|
|
159
|
+
background-color: var(--nx-surface-hover);
|
|
160
|
+
box-shadow: inset 0 0 0 2px var(--nx-primary);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.nx-tree__row[role="treeitem"]:is(:hover, :focus-visible) {
|
|
164
|
+
--nx-tree-muted: color-mix(in oklab, var(--nx-text-muted), var(--nx-text) 35%);
|
|
165
|
+
--nx-tree-count: color-mix(in oklab, var(--nx-text-muted), var(--nx-text) 50%);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.nx-tree__toggle {
|
|
169
|
+
display: grid;
|
|
170
|
+
flex: none;
|
|
171
|
+
place-items: center;
|
|
172
|
+
width: var(--nx-tree-indent);
|
|
173
|
+
height: var(--nx-tree-indent);
|
|
174
|
+
margin-right: -2px;
|
|
175
|
+
border-radius: var(--nx-radius-sm);
|
|
176
|
+
color: var(--nx-tree-muted);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.nx-tree__toggle .nx-icon {
|
|
180
|
+
width: 14px;
|
|
181
|
+
height: 14px;
|
|
182
|
+
vertical-align: 0;
|
|
183
|
+
transition: transform var(--nx-tree-open) cubic-bezier(0.2, 0, 0, 1);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.nx-tree__row[aria-expanded="true"] > .nx-tree__toggle .nx-icon {
|
|
187
|
+
transform: rotate(90deg);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.nx-tree__toggle:has(.nx-icon):hover {
|
|
191
|
+
background: color-mix(in oklab, var(--nx-text) 10%, transparent);
|
|
192
|
+
color: var(--nx-text);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* The CheckBox control, without its label's line-height offset; the row takes the clicks. */
|
|
196
|
+
.nx-tree__check {
|
|
197
|
+
flex: none;
|
|
198
|
+
align-items: center;
|
|
199
|
+
gap: 0;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.nx-tree__check .nx-choice__control {
|
|
203
|
+
margin: 0;
|
|
204
|
+
pointer-events: none;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.nx-tree__row:hover .nx-choice__control:not(:checked, :indeterminate, :disabled) {
|
|
208
|
+
border-color: var(--nx-choice-border-hover);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.nx-tree__icon {
|
|
212
|
+
display: grid;
|
|
213
|
+
flex: none;
|
|
214
|
+
place-items: center;
|
|
215
|
+
color: var(--nx-tree-muted);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.nx-tree__icon .nx-icon {
|
|
219
|
+
width: 1.15em;
|
|
220
|
+
height: 1.15em;
|
|
221
|
+
vertical-align: 0;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.nx-tree__text {
|
|
225
|
+
display: flex;
|
|
226
|
+
flex: 1 1 auto;
|
|
227
|
+
align-items: baseline;
|
|
228
|
+
gap: var(--nx-space-2);
|
|
229
|
+
min-width: 0;
|
|
230
|
+
overflow: hidden;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.nx-tree__label {
|
|
234
|
+
flex: 0 1 auto;
|
|
235
|
+
min-width: 2em;
|
|
236
|
+
overflow: hidden;
|
|
237
|
+
text-overflow: ellipsis;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.nx-tree__description {
|
|
241
|
+
flex: 0 100 auto;
|
|
242
|
+
min-width: 0;
|
|
243
|
+
overflow: hidden;
|
|
244
|
+
color: var(--nx-tree-muted);
|
|
245
|
+
font-size: calc(var(--nx-tree-font) - 1px);
|
|
246
|
+
text-overflow: ellipsis;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.nx-tree__count {
|
|
250
|
+
flex: none;
|
|
251
|
+
padding: 0 6px;
|
|
252
|
+
border-radius: var(--nx-radius-full);
|
|
253
|
+
background: color-mix(in oklab, var(--nx-text) 7%, transparent);
|
|
254
|
+
color: var(--nx-tree-count);
|
|
255
|
+
font-size: var(--nx-text-xs);
|
|
256
|
+
font-variant-numeric: tabular-nums;
|
|
257
|
+
line-height: 18px;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.nx-tree__lock,
|
|
261
|
+
.nx-tree__busy {
|
|
262
|
+
display: grid;
|
|
263
|
+
flex: none;
|
|
264
|
+
place-items: center;
|
|
265
|
+
color: var(--nx-tree-muted);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.nx-tree__lock .nx-icon,
|
|
269
|
+
.nx-tree__busy {
|
|
270
|
+
width: 14px;
|
|
271
|
+
height: 14px;
|
|
272
|
+
vertical-align: 0;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/* A locked item: the read-only box (data-readonly), a muted label, and a lock. */
|
|
276
|
+
.nx-tree__row--locked {
|
|
277
|
+
cursor: default;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.nx-tree__row--locked .nx-tree__label {
|
|
281
|
+
color: var(--nx-tree-muted);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/* Actions show on the row under the pointer or with focus; on touch screens, always. They keep their space, so
|
|
285
|
+
labels do not jump when they appear. */
|
|
286
|
+
.nx-tree__actions {
|
|
287
|
+
display: flex;
|
|
288
|
+
flex: none;
|
|
289
|
+
gap: 1px;
|
|
290
|
+
margin-left: auto;
|
|
291
|
+
visibility: hidden;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.nx-tree__row:is(:hover, :focus-visible, :focus-within) > .nx-tree__actions {
|
|
295
|
+
visibility: visible;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
@media (hover: none) {
|
|
299
|
+
.nx-tree__actions {
|
|
300
|
+
visibility: visible;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.nx-btn.nx-tree__action {
|
|
305
|
+
--nx-btn-height: calc(var(--nx-tree-row) - 6px);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.nx-tree__action .nx-icon {
|
|
309
|
+
width: 15px;
|
|
310
|
+
height: 15px;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/* The name box of a row being added or renamed. */
|
|
314
|
+
.nx-tree__edit {
|
|
315
|
+
display: flex;
|
|
316
|
+
flex: 1 1 auto;
|
|
317
|
+
align-items: center;
|
|
318
|
+
gap: 1px;
|
|
319
|
+
min-width: 0;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.nx-tree__input {
|
|
323
|
+
flex: 1 1 auto;
|
|
324
|
+
width: 0;
|
|
325
|
+
min-width: 6em;
|
|
326
|
+
height: calc(var(--nx-tree-row) - 6px);
|
|
327
|
+
margin: 0 2px 0 0;
|
|
328
|
+
padding: 0 6px;
|
|
329
|
+
border: 1px solid var(--nx-field-accent);
|
|
330
|
+
border-radius: var(--nx-radius-sm);
|
|
331
|
+
background: var(--nx-surface);
|
|
332
|
+
box-shadow: var(--nx-field-ring);
|
|
333
|
+
color: var(--nx-text);
|
|
334
|
+
font: inherit;
|
|
335
|
+
outline: none;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.nx-tree__input[aria-invalid="true"] {
|
|
339
|
+
border-color: var(--nx-danger);
|
|
340
|
+
box-shadow: 0 0 0 3px color-mix(in oklab, var(--nx-danger) 30%, transparent);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.nx-tree__input:read-only {
|
|
344
|
+
color: var(--nx-text-muted);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/*
|
|
348
|
+
* Expand and collapse: the rows that come or go sit in a group whose height opens from 0, or closes to 0. Only the
|
|
349
|
+
* rows in view are in the group, so opening 10,000 children animates about 30 rows.
|
|
350
|
+
*/
|
|
351
|
+
.nx-tree__motion {
|
|
352
|
+
height: var(--nx-tree-motion-height);
|
|
353
|
+
overflow: hidden;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.nx-tree__motion--open {
|
|
357
|
+
animation: nx-tree-open var(--nx-tree-open) cubic-bezier(0.2, 0, 0, 1);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.nx-tree__motion--close {
|
|
361
|
+
height: 0;
|
|
362
|
+
pointer-events: none;
|
|
363
|
+
animation: nx-tree-close var(--nx-tree-close) cubic-bezier(0.3, 0, 0.8, 0.15);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
@keyframes nx-tree-open {
|
|
367
|
+
from {
|
|
368
|
+
height: 0;
|
|
369
|
+
opacity: 0.35;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
@keyframes nx-tree-close {
|
|
374
|
+
from {
|
|
375
|
+
height: var(--nx-tree-motion-height);
|
|
376
|
+
opacity: 1;
|
|
377
|
+
}
|
|
378
|
+
to {
|
|
379
|
+
height: 0;
|
|
380
|
+
opacity: 0;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/* Loading and empty */
|
|
385
|
+
.nx-tree__row--skeleton {
|
|
386
|
+
cursor: default;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.nx-tree__skeleton {
|
|
390
|
+
display: inline-block;
|
|
391
|
+
height: 0.7em;
|
|
392
|
+
border-radius: var(--nx-radius-full);
|
|
393
|
+
background: color-mix(in oklab, var(--nx-text) 11%, transparent);
|
|
394
|
+
animation: nx-tree-pulse 1.2s ease-in-out infinite;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
@keyframes nx-tree-pulse {
|
|
398
|
+
50% {
|
|
399
|
+
opacity: 0.45;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.nx-tree__empty {
|
|
404
|
+
margin: 0;
|
|
405
|
+
padding: var(--nx-space-6) var(--nx-space-4);
|
|
406
|
+
color: var(--nx-text-muted);
|
|
407
|
+
font-size: var(--nx-text-sm);
|
|
408
|
+
text-align: center;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/* States of the whole tree */
|
|
412
|
+
.nx-field[data-disabled] .nx-tree__row {
|
|
413
|
+
cursor: not-allowed;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.nx-field[data-disabled] .nx-tree__row:hover {
|
|
417
|
+
background-color: transparent;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.nx-field[data-readonly] .nx-tree__row {
|
|
421
|
+
cursor: default;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
@media (prefers-reduced-motion: reduce) {
|
|
425
|
+
.nx-tree__motion,
|
|
426
|
+
.nx-tree__skeleton {
|
|
427
|
+
animation: none;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.nx-tree,
|
|
431
|
+
.nx-tree__toggle .nx-icon {
|
|
432
|
+
transition: none;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { GetSignOutPageURL } from "../helpers/browser-helpers";
|
|
2
|
-
import { BuildProxyApiUrl, EModules, ICurrentUser, IErrorRespose, ISuccessResponse } from "../interface";
|
|
3
|
-
import { HttpGet, HttpPost } from "../services/http-services";
|
|
4
|
-
import { ShowLoader } from "../services/loader-service";
|
|
5
|
-
|
|
6
|
-
export const GetProfileDetails = async (autoRefresh?: boolean): Promise<ICurrentUser | null> => {
|
|
7
|
-
//Profile/Details
|
|
8
|
-
const response = await HttpGet(BuildProxyApiUrl(EModules.Authentication, "Profile/Details"), null, 0);
|
|
9
|
-
if (response?.isSuccess) return response.result as ICurrentUser;
|
|
10
|
-
|
|
11
|
-
if (response?.code === 401 && autoRefresh) {
|
|
12
|
-
const refreshResponse = await RefreshAuthToken();
|
|
13
|
-
if (refreshResponse?.isSuccess) return GetProfileDetails(false);
|
|
14
|
-
else {
|
|
15
|
-
ShowLoader();
|
|
16
|
-
window.location.href = GetSignOutPageURL();
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return null;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const RefreshAuthToken = async (): Promise<ISuccessResponse | IErrorRespose> => HttpPost("/api/auth/refresh", null, null, null, 0);
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use server";
|
|
2
|
-
|
|
3
|
-
import { IThemeInformation } from "../interface";
|
|
4
|
-
import { EMenuTargets, IClientMenu, IPanelMenu, IUtilityMenu } from "../interfaces/menu-interfaces";
|
|
5
|
-
import { APIS, NEXUS_CONFIG, NEXUS_INFO } from "../nexus.environments";
|
|
6
|
-
import { HttpGet } from "../services/http-services";
|
|
7
|
-
|
|
8
|
-
const TOKEN_GLOBAL_CLIENT_MENU = "DJ3FKL4_IOR4U5_I4O5J4KDLJ_U_IO";
|
|
9
|
-
const TOKEN_GLOBAL_UTILITY_MENU = "DJ3FKL4_IOR4U5_I4O5J4KDLJ_dfj45k_d";
|
|
10
|
-
const TOKEN_GLOBAL_PANEL_MENU = "dj_dfjk3453IOR4U5_I4O5J4KDLJ_dfj45k_d";
|
|
11
|
-
const TOKEN_GLOBAL_THEMES = "DJWJR_GJDK_65GKD54ZJD_00";
|
|
12
|
-
|
|
13
|
-
export const GetClientMenusAsync = async (): Promise<IClientMenu[]> => {
|
|
14
|
-
const response = await HttpGet(`${APIS.CONFIGURATION}/Resources/GlobalMenus/${NEXUS_INFO.CURRENT_MODULE}/${NEXUS_INFO.IS_ADMIN_MODULE ? EMenuTargets.AdminModule : EMenuTargets.ClientModule}/${TOKEN_GLOBAL_CLIENT_MENU}`, null, NEXUS_CONFIG.DEFAULT_REVALIDATE_TIME_ONE_DAY);
|
|
15
|
-
if (!response.isSuccess) return [];
|
|
16
|
-
return response.result as IClientMenu[];
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const GetUtilityMenusAsync = async (): Promise<IUtilityMenu[]> => {
|
|
20
|
-
const response = await HttpGet(`${APIS.CONFIGURATION}/Resources/UtilityMenus/${NEXUS_INFO.CURRENT_MODULE}/${NEXUS_INFO.IS_ADMIN_MODULE ? EMenuTargets.AdminModule : EMenuTargets.ClientModule}/${TOKEN_GLOBAL_UTILITY_MENU}`, null, NEXUS_CONFIG.DEFAULT_REVALIDATE_TIME_ONE_DAY);
|
|
21
|
-
if (!response.isSuccess) return [];
|
|
22
|
-
return response.result as IUtilityMenu[];
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const GetUserPanelsAsync = async (): Promise<IPanelMenu[]> => {
|
|
26
|
-
const response = await HttpGet(`${APIS.CONFIGURATION}/Resources/PanelMenus/${NEXUS_INFO.CURRENT_MODULE}/${NEXUS_INFO.IS_ADMIN_MODULE ? EMenuTargets.AdminModule : EMenuTargets.ClientModule}/${TOKEN_GLOBAL_PANEL_MENU}`, null, NEXUS_CONFIG.DEFAULT_REVALIDATE_TIME_ONE_DAY);
|
|
27
|
-
if (!response.isSuccess) return [];
|
|
28
|
-
return response.result as IPanelMenu[];
|
|
29
|
-
};
|
|
30
|
-
export const GetSystemThemesAsync = async (): Promise<IThemeInformation[]> => {
|
|
31
|
-
const response = await HttpGet(`${APIS.CONFIGURATION}/Resources/Themes/${TOKEN_GLOBAL_THEMES}`, null, NEXUS_CONFIG.DEFAULT_REVALIDATE_TIME_ONE_DAY);
|
|
32
|
-
if (!response.isSuccess) return [];
|
|
33
|
-
return response.result as IThemeInformation[];
|
|
34
|
-
};
|
package/src/client.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// React hooks (useEffect / useState)
|
|
4
|
-
export * from "./components/documents/tab-button";
|
|
5
|
-
export * from "./components/layouts/global-dialogbox";
|
|
6
|
-
export * from "./components/layouts/layout-helpers";
|
|
7
|
-
export * from "./components/layouts/utility-menu";
|
|
8
|
-
export * from "./components/panels/theme-panel";
|
|
9
|
-
|
|
10
|
-
export * from "./components/inputs/checkbox-input";
|
|
11
|
-
export * from "./components/inputs/input-form";
|
|
12
|
-
export * from "./components/inputs/number-input";
|
|
13
|
-
export * from "./components/inputs/radiobox-input";
|
|
14
|
-
export * from "./components/inputs/textarea-input";
|
|
15
|
-
export * from "./components/inputs/textbox-input";
|
|
16
|
-
|
|
17
|
-
// document / window / localStorage
|
|
18
|
-
export * from "./components/documents/button";
|
|
19
|
-
export * from "./components/documents/icon-box";
|
|
20
|
-
export * from "./components/inputs/input";
|
|
21
|
-
export * from "./components/inputs/input-box";
|
|
22
|
-
export * from "./components/inputs/input-element";
|
|
23
|
-
export * from "./helpers/browser-helpers";
|
|
24
|
-
export * from "./services/http-client-services";
|
|
25
|
-
export * from "./services/loader-service";
|
|
26
|
-
export * from "./services/localstorage-service";
|
|
27
|
-
export * from "./services/user-services";
|
|
28
|
-
export * from "./services/message-services";
|
|
29
|
-
export * from "./services/theme-service";
|
|
30
|
-
// Core
|
|
31
|
-
export * from "./nexus-client";
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import Link from "next/link";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { IsValidURL } from "../../helpers/browser-helpers";
|
|
4
|
-
import { SetElementStyles } from "../../helpers/element-helpers";
|
|
5
|
-
import { DEFAULT_BUTTON_CLASS, DEFAULT_LINK_BUTTON_STYLE, EButtonTypes, ETargets, IButton } from "../../interfaces/button-interfaces";
|
|
6
|
-
import { DEFAULT_ICON_SIZE, EIconTypes } from "../../interfaces/icon-interfaces";
|
|
7
|
-
import { COLUMN_SIZE_ATTRIBUTE_KEY, EFlexPositions, EOpacity } from "../../interfaces/layout-interfaces";
|
|
8
|
-
import { EBackgroundColors, EBackgrounds } from "../../interfaces/theme-interfaces";
|
|
9
|
-
import { ClickHandler, UN } from "../../interfaces/type-interfaces";
|
|
10
|
-
import { NEXUS_CONFIG } from "../../nexus.environments";
|
|
11
|
-
import { CreateIcon, Icon } from "./icon-box";
|
|
12
|
-
|
|
13
|
-
export const SET_BUTTON_ACTIVE_CLASS = (isActive: boolean, element: HTMLElement, overrideBackgroundColor?: EBackgroundColors | UN, overrideBorderColor?: EBackgroundColors | UN, overrideTextColor?: EBackgroundColors | UN, overrideActiveClass?: string | UN) => {
|
|
14
|
-
if (!element) return;
|
|
15
|
-
|
|
16
|
-
if (isActive && overrideBackgroundColor) element.style.setProperty("--ACTIVE_BACKGROUND_COLOR", overrideBackgroundColor);
|
|
17
|
-
if (isActive && overrideBorderColor) element.style.setProperty("--ACTIVE_BORDER_COLOR", overrideBorderColor);
|
|
18
|
-
if (isActive && overrideTextColor) element.style.setProperty("--ACTIVE_TEXT_COLOR", overrideTextColor);
|
|
19
|
-
|
|
20
|
-
if (isActive) element.classList.add(overrideActiveClass ?? "active");
|
|
21
|
-
else element.classList.remove(overrideActiveClass ?? "active");
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const Button = ({ button, buttonType, styles, needColumnSize }: { button: IButton; buttonType?: EButtonTypes; styles?: React.CSSProperties | UN; needColumnSize?: boolean | UN }) => {
|
|
25
|
-
return IsValidURL(button.url) ? (
|
|
26
|
-
<Link href={button.url ?? "#"} style={styles ?? undefined} className={DEFAULT_BUTTON_CLASS(button.columnSize, undefined, button.borderSize, button.background, button.defaultClass, needColumnSize)} key={button.displayOrder ?? 0} type={buttonType ?? EButtonTypes.BUTTON} onClick={(event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => button.onClick?.(event, event.currentTarget as HTMLElement, button.data, button.displayOrder)}>
|
|
27
|
-
{button.icon && <Icon icon={button.icon} type={button.iconType ?? EIconTypes.OUTLINED} opacity={EOpacity.O08} size={button.iconSize ?? DEFAULT_ICON_SIZE} defaultClass="mr4" />}
|
|
28
|
-
<span>{button.label instanceof Function ? button.label(button.data) : button.label}</span>
|
|
29
|
-
</Link>
|
|
30
|
-
) : (
|
|
31
|
-
<button style={styles ?? { minHeight: "var(--IH)" }} className={DEFAULT_BUTTON_CLASS(button.columnSize, undefined, button.borderSize, button.background, button.defaultClass, needColumnSize)} key={button.displayOrder} type={buttonType ?? EButtonTypes.BUTTON} onClick={(event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => button.onClick?.(event, event.currentTarget as HTMLElement, button.data, button.displayOrder)}>
|
|
32
|
-
{button.icon && <Icon icon={button.icon} type={button.iconType ?? EIconTypes.OUTLINED} opacity={EOpacity.O08} size={button.iconSize ?? DEFAULT_ICON_SIZE} defaultClass="mr4" />}
|
|
33
|
-
<span>{button.label instanceof Function ? button.label(button.data) : button.label}</span>
|
|
34
|
-
</button>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
37
|
-
export const CreateButton = (param: IButton, parent?: HTMLElement | UN, styles?: React.CSSProperties | UN, needColumnSize?: boolean | UN) => {
|
|
38
|
-
const button = document.createElement(param.url ? "a" : "button");
|
|
39
|
-
button.setAttribute(COLUMN_SIZE_ATTRIBUTE_KEY, (param.columnSize ?? 12).toString());
|
|
40
|
-
if (param.icon) {
|
|
41
|
-
const icon = CreateIcon(param.icon, button, param.iconType ?? EIconTypes.OUTLINED, param.iconSize ?? DEFAULT_ICON_SIZE, null, null);
|
|
42
|
-
icon.classList.add("mr4");
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
SetElementStyles(button, styles);
|
|
46
|
-
|
|
47
|
-
button.className = DEFAULT_BUTTON_CLASS(param.columnSize ?? 0, 0, param.borderSize, param.background ?? NEXUS_CONFIG.DEFAULT_BACKGROUND, param.defaultClass, needColumnSize);
|
|
48
|
-
const span = document.createElement("span");
|
|
49
|
-
span.textContent = param.label instanceof Function ? (param.label(param.data) ?? null) : (param.label ?? null);
|
|
50
|
-
button.appendChild(span);
|
|
51
|
-
button.onclick = (e) => param.onClick?.(e, button, param.data, param.displayOrder);
|
|
52
|
-
button.style.height = "var(--IH)";
|
|
53
|
-
|
|
54
|
-
button.classList.add("df", "ac", "pl5", "pr5");
|
|
55
|
-
|
|
56
|
-
if (param.url) {
|
|
57
|
-
(button as HTMLAnchorElement).href = param.url;
|
|
58
|
-
(button as HTMLAnchorElement).target = param.target ?? ETargets.Blank;
|
|
59
|
-
}
|
|
60
|
-
if (parent) parent.appendChild(button);
|
|
61
|
-
return button;
|
|
62
|
-
};
|
|
63
|
-
export const Buttons = ({ buttons, buttonStyles, padding, border, maxHeight, boxDefaultClass, needColumnSize, pt }: { buttons: IButton[]; padding?: number; buttonStyles?: React.CSSProperties | UN; border?: number; maxHeight?: number; boxDefaultClass?: string; needColumnSize?: boolean; pt?: number }) => {
|
|
64
|
-
return (
|
|
65
|
-
<div className={`row ${maxHeight ? "sb" : ""} ${boxDefaultClass ?? ""} r sm p${padding ?? 5} b${border ?? 0} ${pt !== undefined ? `pt${pt}` : ""}`}>
|
|
66
|
-
{buttons.map((button) => (
|
|
67
|
-
<Button key={button.id} button={button} needColumnSize={needColumnSize} styles={buttonStyles} />
|
|
68
|
-
))}
|
|
69
|
-
</div>
|
|
70
|
-
);
|
|
71
|
-
};
|
|
72
|
-
export const CreateButtons = (buttons: IButton[], parent?: HTMLElement | UN, buttonStyles?: React.CSSProperties | UN, columns?: number | UN, padding?: number | UN, border?: number | UN, maxHeight?: number | UN, boxDefaultClass?: string | UN, needColumnSize?: boolean | UN) => {
|
|
73
|
-
if (!buttons || buttons.length === 0) return;
|
|
74
|
-
maxHeight ??= 25;
|
|
75
|
-
const sortButtons = buttons.sort((a, b) => (a.displayOrder ?? 0) - (b.displayOrder ?? 0));
|
|
76
|
-
const buttonBox = document.createElement("div");
|
|
77
|
-
if (maxHeight) buttonBox.style.maxHeight = `${maxHeight}rem`;
|
|
78
|
-
|
|
79
|
-
buttonBox.className = `row ${maxHeight ? "sb" : ""} ${boxDefaultClass ?? ""} r sm p${padding ?? 5} b${border ?? 0}`;
|
|
80
|
-
for (const button of sortButtons) {
|
|
81
|
-
// Set column size if valid columns provided
|
|
82
|
-
if (columns && !button.columnSize) button.columnSize = columns;
|
|
83
|
-
|
|
84
|
-
CreateButton(button, buttonBox, buttonStyles, needColumnSize);
|
|
85
|
-
}
|
|
86
|
-
if (parent) parent.appendChild(buttonBox);
|
|
87
|
-
return buttonBox;
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
interface ILinkButtonProps {
|
|
91
|
-
url: string;
|
|
92
|
-
label: string;
|
|
93
|
-
defaultClass?: string | UN;
|
|
94
|
-
linkDefaultClass?: string | UN;
|
|
95
|
-
onClicked?: ClickHandler | UN;
|
|
96
|
-
borderBottom?: boolean | UN;
|
|
97
|
-
background?: EBackgrounds | UN;
|
|
98
|
-
target?: ETargets | UN;
|
|
99
|
-
position?: EFlexPositions | UN;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const _getPDefaultClass = (defaultClass?: string | UN, position?: EFlexPositions | UN) => `${defaultClass ?? ""} df ${position ?? EFlexPositions.Center}`;
|
|
103
|
-
const _getLinkDefaultClass = (linkDefaultClass?: string | UN, background?: EBackgrounds | UN) => `${background ?? EBackgrounds.Background1} ${linkDefaultClass ?? "o08 ho1"} db h p2 r`;
|
|
104
|
-
const _getLinkDefaultStyle = (borderBottom?: boolean | UN) => (borderBottom ? DEFAULT_LINK_BUTTON_STYLE : { width: "fit-content" });
|
|
105
|
-
|
|
106
|
-
export const LinkButton = ({ url, label, defaultClass, linkDefaultClass, onClicked, borderBottom, background, target, position }: Readonly<ILinkButtonProps>) => {
|
|
107
|
-
return (
|
|
108
|
-
<p className={_getPDefaultClass(defaultClass, position)}>
|
|
109
|
-
<Link style={_getLinkDefaultStyle(borderBottom)} onClick={onClicked ?? undefined} target={target ?? undefined} className={_getLinkDefaultClass(linkDefaultClass, background)} href={url}>
|
|
110
|
-
{label}
|
|
111
|
-
</Link>
|
|
112
|
-
</p>
|
|
113
|
-
);
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
export const CreateLinkButton = (
|
|
117
|
-
parent: HTMLElement | UN,
|
|
118
|
-
//
|
|
119
|
-
url: string,
|
|
120
|
-
label: string,
|
|
121
|
-
onClicked?: ClickHandler | UN,
|
|
122
|
-
defaultClass?: string | UN,
|
|
123
|
-
linkDefaultClass?: string | UN,
|
|
124
|
-
borderBottom?: boolean | UN,
|
|
125
|
-
background?: EBackgrounds | UN,
|
|
126
|
-
target?: ETargets | UN,
|
|
127
|
-
position?: EFlexPositions | UN,
|
|
128
|
-
) => {
|
|
129
|
-
const p = document.createElement("p");
|
|
130
|
-
p.className = _getPDefaultClass(defaultClass, position);
|
|
131
|
-
const link = document.createElement("a");
|
|
132
|
-
link.href = url;
|
|
133
|
-
link.className = _getLinkDefaultClass(linkDefaultClass, background);
|
|
134
|
-
link.onclick = onClicked ?? null;
|
|
135
|
-
link.innerText = label;
|
|
136
|
-
|
|
137
|
-
if (parent) parent.appendChild(p);
|
|
138
|
-
p.appendChild(link);
|
|
139
|
-
|
|
140
|
-
if (target) link.target = target;
|
|
141
|
-
return p;
|
|
142
|
-
};
|