nexus-shared 3.1.0 → 3.2.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.
Files changed (104) hide show
  1. package/CHANGELOG.md +704 -446
  2. package/LICENSE +21 -21
  3. package/README.md +44 -5
  4. package/dist/Client.Index.d.ts +3 -0
  5. package/dist/Client.Index.js +3 -0
  6. package/dist/Components/Forms/Crud.js +322 -161
  7. package/dist/Components/Forms/CrudHistory.d.ts +66 -0
  8. package/dist/Components/Forms/CrudHistory.js +140 -0
  9. package/dist/Components/Forms/CrudParts.js +2 -1
  10. package/dist/Components/Forms/Form.js +4 -1
  11. package/dist/Components/Inputs/CodeBox.d.ts +69 -0
  12. package/dist/Components/Inputs/CodeBox.js +316 -0
  13. package/dist/Components/Inputs/DatePicker.js +4 -1
  14. package/dist/Components/Inputs/DateRangePicker.js +4 -1
  15. package/dist/Components/Inputs/DateTimePicker.js +4 -1
  16. package/dist/Components/Inputs/Dropdown.js +4 -1
  17. package/dist/Components/Inputs/InputRenderer.js +3 -0
  18. package/dist/Components/Inputs/NumberBox.js +4 -2
  19. package/dist/Components/Inputs/TextArea.js +4 -1
  20. package/dist/Components/Inputs/TextBox.js +4 -1
  21. package/dist/Components/Inputs/TimePicker.js +4 -1
  22. package/dist/Components/Inputs/TreeView.d.ts +55 -5
  23. package/dist/Components/Inputs/TreeView.js +372 -23
  24. package/dist/Components/Layouts/ThemePicker.d.ts +3 -2
  25. package/dist/Components/Layouts/ThemePicker.js +16 -4
  26. package/dist/Components/Viewers/DataTable.js +63 -21
  27. package/dist/Components/Viewers/DataTableParts.d.ts +26 -8
  28. package/dist/Components/Viewers/DataTableParts.js +39 -10
  29. package/dist/Helpers/ApiModules.d.ts +3 -34
  30. package/dist/Helpers/ApiModules.js +3 -3
  31. package/dist/Helpers/ApiRoutes.d.ts +68 -26
  32. package/dist/Helpers/ApiRoutes.js +31 -27
  33. package/dist/Helpers/ArrayHelpers.d.ts +0 -0
  34. package/dist/Helpers/ArrayHelpers.js +2 -0
  35. package/dist/Helpers/CodeHelpers.d.ts +97 -0
  36. package/dist/Helpers/CodeHelpers.js +332 -0
  37. package/dist/Helpers/CrudBackend.d.ts +94 -4
  38. package/dist/Helpers/CrudBackend.js +168 -9
  39. package/dist/Helpers/CrudColumns.d.ts +51 -0
  40. package/dist/Helpers/CrudColumns.js +69 -0
  41. package/dist/Helpers/CrudHelpers.d.ts +50 -5
  42. package/dist/Helpers/CrudHelpers.js +109 -12
  43. package/dist/Helpers/InputParamsHelpers.js +8 -0
  44. package/dist/Helpers/MessageBuilder.js +2 -0
  45. package/dist/Helpers/NexusHelpers.d.ts +0 -0
  46. package/dist/Helpers/NexusHelpers.js +1 -0
  47. package/dist/Helpers/RequestCache.d.ts +35 -0
  48. package/dist/Helpers/RequestCache.js +113 -0
  49. package/dist/Helpers/TableExport.js +12 -12
  50. package/dist/Helpers/TableHelpers.d.ts +1 -1
  51. package/dist/Helpers/TableHelpers.js +7 -2
  52. package/dist/Helpers/TableJoins.d.ts +70 -0
  53. package/dist/Helpers/TableJoins.js +250 -0
  54. package/dist/Helpers/TableStore.d.ts +5 -0
  55. package/dist/Helpers/TableStore.js +9 -0
  56. package/dist/Helpers/TreeStore.d.ts +225 -11
  57. package/dist/Helpers/TreeStore.js +683 -90
  58. package/dist/Helpers/UserPreferences.d.ts +8 -0
  59. package/dist/Helpers/UserPreferences.js +17 -0
  60. package/dist/Interfaces/CrudInterfaces.d.ts +47 -9
  61. package/dist/Interfaces/FormInterfaces.d.ts +4 -1
  62. package/dist/Interfaces/InputInterfaces.d.ts +24 -0
  63. package/dist/Interfaces/MessageInterfaces.d.ts +1 -1
  64. package/dist/Interfaces/PreferenceInterfaces.d.ts +8 -0
  65. package/dist/Interfaces/PreferenceInterfaces.js +2 -5
  66. package/dist/Interfaces/TableInterfaces.d.ts +86 -4
  67. package/dist/Services/ApiProxy.d.ts +36 -1
  68. package/dist/Services/ApiProxy.js +182 -52
  69. package/dist/Services/ApiProxyRules.d.ts +203 -0
  70. package/dist/Services/ApiProxyRules.js +426 -0
  71. package/dist/Services/JoinSources.d.ts +48 -0
  72. package/dist/Services/JoinSources.js +74 -0
  73. package/dist/Services/ServerApi.d.ts +13 -2
  74. package/dist/Services/ServerApi.js +8 -3
  75. package/dist/Shared.Index.d.ts +4 -0
  76. package/dist/Shared.Index.js +4 -0
  77. package/package.json +87 -85
  78. package/src/Styles/Nexus.Avatar.css +79 -79
  79. package/src/Styles/Nexus.Base.css +117 -117
  80. package/src/Styles/Nexus.Button.css +180 -180
  81. package/src/Styles/Nexus.Calendar.css +273 -273
  82. package/src/Styles/Nexus.Chat.css +1443 -1443
  83. package/src/Styles/Nexus.Choice.css +343 -343
  84. package/src/Styles/Nexus.Crud.css +168 -168
  85. package/src/Styles/Nexus.DateTime.css +81 -81
  86. package/src/Styles/Nexus.Dropdown.css +725 -725
  87. package/src/Styles/Nexus.Editor.css +295 -295
  88. package/src/Styles/Nexus.Excel.css +389 -389
  89. package/src/Styles/Nexus.Form.css +279 -279
  90. package/src/Styles/Nexus.Index.css +37 -37
  91. package/src/Styles/Nexus.Input.css +196 -4
  92. package/src/Styles/Nexus.Markdown.css +237 -237
  93. package/src/Styles/Nexus.Menu.css +237 -237
  94. package/src/Styles/Nexus.Popup.css +724 -724
  95. package/src/Styles/Nexus.Rows.css +637 -637
  96. package/src/Styles/Nexus.Slider.css +276 -276
  97. package/src/Styles/Nexus.Tab.Buttons.css +432 -432
  98. package/src/Styles/Nexus.Table.css +31 -30
  99. package/src/Styles/Nexus.Theme.Picker.css +59 -3
  100. package/src/Styles/Nexus.Themes.css +194 -194
  101. package/src/Styles/Nexus.Time.css +144 -144
  102. package/src/Styles/Nexus.Toast.css +263 -263
  103. package/src/Styles/Nexus.Tokens.css +89 -89
  104. package/src/Styles/Nexus.Tree.css +500 -431
@@ -1,180 +1,180 @@
1
- @layer nexus.components {
2
- .nx-btn {
3
- --nx-btn-height: var(--nx-control-md);
4
- --nx-btn-bg: var(--nx-surface);
5
- --nx-btn-bg-hover: var(--nx-surface-hover);
6
- --nx-btn-color: var(--nx-text);
7
- --nx-btn-border: var(--nx-border-strong);
8
-
9
- display: inline-flex;
10
- align-items: center;
11
- justify-content: center;
12
- gap: var(--nx-space-2);
13
- height: var(--nx-btn-height);
14
- padding: 0 var(--nx-space-3);
15
- border: 1px solid var(--nx-btn-border);
16
- border-radius: var(--nx-radius);
17
- background: var(--nx-btn-bg);
18
- color: var(--nx-btn-color);
19
- font-size: var(--nx-text-md);
20
- font-weight: 500;
21
- line-height: 1;
22
- white-space: nowrap;
23
- /* The same classes make a link look like a button, for a call to action that navigates. */
24
- text-decoration: none;
25
- cursor: pointer;
26
- user-select: none;
27
- box-shadow: var(--nx-shadow-sm);
28
- transition:
29
- background-color var(--nx-duration),
30
- border-color var(--nx-duration),
31
- color var(--nx-duration),
32
- box-shadow var(--nx-duration),
33
- transform var(--nx-duration);
34
- }
35
-
36
- .nx-btn .nx-icon {
37
- width: 1.15em;
38
- height: 1.15em;
39
- vertical-align: 0;
40
- }
41
-
42
- .nx-btn:hover:not(:disabled) {
43
- background: var(--nx-btn-bg-hover);
44
- }
45
-
46
- .nx-btn:active:not(:disabled) {
47
- transform: translateY(1px);
48
- }
49
-
50
- .nx-btn:focus-visible {
51
- outline: none;
52
- box-shadow: var(--nx-focus-ring);
53
- }
54
-
55
- .nx-btn:disabled {
56
- cursor: not-allowed;
57
- opacity: 0.55;
58
- box-shadow: none;
59
- }
60
-
61
- .nx-btn[aria-busy="true"] {
62
- cursor: progress;
63
- opacity: 0.8;
64
- }
65
-
66
- /* Variants */
67
- .nx-btn--primary {
68
- --nx-btn-bg: var(--nx-primary-solid);
69
- --nx-btn-bg-hover: var(--nx-primary-hover);
70
- --nx-btn-color: var(--nx-primary-text);
71
- --nx-btn-border: transparent;
72
- }
73
-
74
- .nx-btn--danger {
75
- --nx-btn-bg: var(--nx-danger-solid);
76
- --nx-btn-bg-hover: var(--nx-danger-hover);
77
- --nx-btn-color: var(--nx-danger-text);
78
- --nx-btn-border: transparent;
79
- }
80
-
81
- .nx-btn--ghost {
82
- --nx-btn-bg: transparent;
83
- --nx-btn-border: transparent;
84
- box-shadow: none;
85
- }
86
-
87
- /*
88
- * Hover tones: a secondary or ghost button stays neutral, then takes the tone on its border,
89
- * a soft background, and its text while hovered or focused from the keyboard.
90
- * Every tone meets WCAG AA contrast on its soft background (npm run check:themes).
91
- */
92
- .nx-btn--hover-primary {
93
- --nx-btn-tone: var(--nx-primary);
94
- --nx-btn-tone-soft: var(--nx-primary-soft);
95
- }
96
-
97
- .nx-btn--hover-danger {
98
- --nx-btn-tone: var(--nx-danger);
99
- --nx-btn-tone-soft: var(--nx-danger-soft);
100
- }
101
-
102
- .nx-btn--hover-success {
103
- --nx-btn-tone: var(--nx-success);
104
- --nx-btn-tone-soft: var(--nx-success-soft);
105
- }
106
-
107
- .nx-btn--hover-warning {
108
- --nx-btn-tone: var(--nx-warning);
109
- --nx-btn-tone-soft: var(--nx-warning-soft);
110
- }
111
-
112
- .nx-btn--hover-info {
113
- --nx-btn-tone: var(--nx-info);
114
- --nx-btn-tone-soft: var(--nx-info-soft);
115
- }
116
-
117
- :is(.nx-btn--secondary, .nx-btn--ghost):is(
118
- .nx-btn--hover-primary,
119
- .nx-btn--hover-danger,
120
- .nx-btn--hover-success,
121
- .nx-btn--hover-warning,
122
- .nx-btn--hover-info
123
- ):is(:hover, :focus-visible):not(:disabled) {
124
- --nx-btn-bg: var(--nx-btn-tone-soft);
125
- --nx-btn-bg-hover: var(--nx-btn-tone-soft);
126
- --nx-btn-border: var(--nx-btn-tone);
127
- --nx-btn-color: var(--nx-btn-tone);
128
- }
129
-
130
- /* Sizes */
131
- .nx-btn--sm {
132
- --nx-btn-height: var(--nx-control-sm);
133
- padding: 0 var(--nx-space-2);
134
- gap: 6px;
135
- font-size: var(--nx-text-sm);
136
- }
137
-
138
- .nx-btn--lg {
139
- --nx-btn-height: var(--nx-control-lg);
140
- padding: 0 var(--nx-space-4);
141
- font-size: var(--nx-text-lg);
142
- }
143
-
144
- .nx-btn--icon {
145
- width: var(--nx-btn-height);
146
- padding: 0;
147
- }
148
-
149
- .nx-btn--block {
150
- display: flex;
151
- width: 100%;
152
- }
153
-
154
- /* Something new behind the button (red), or a state that is on (primary): a dot on its corner, ringed in the
155
- surface so it reads over the icon. */
156
- .nx-btn:has(> .nx-btn__dot) {
157
- position: relative;
158
- }
159
-
160
- .nx-btn__dot {
161
- position: absolute;
162
- top: 6px;
163
- right: 6px;
164
- width: 7px;
165
- height: 7px;
166
- border: 1.5px solid var(--nx-surface);
167
- border-radius: 50%;
168
- background: var(--nx-danger-solid);
169
- }
170
-
171
- .nx-btn__dot[data-tone="primary"] {
172
- background: var(--nx-primary-solid);
173
- }
174
-
175
- /* A small icon sits nearer the corner: the dot moves into it, clear of a narrow icon such as ⋮. */
176
- .nx-btn--icon.nx-btn--sm > .nx-btn__dot {
177
- top: 3px;
178
- right: 3px;
179
- }
180
- }
1
+ @layer nexus.components {
2
+ .nx-btn {
3
+ --nx-btn-height: var(--nx-control-md);
4
+ --nx-btn-bg: var(--nx-surface);
5
+ --nx-btn-bg-hover: var(--nx-surface-hover);
6
+ --nx-btn-color: var(--nx-text);
7
+ --nx-btn-border: var(--nx-border-strong);
8
+
9
+ display: inline-flex;
10
+ align-items: center;
11
+ justify-content: center;
12
+ gap: var(--nx-space-2);
13
+ height: var(--nx-btn-height);
14
+ padding: 0 var(--nx-space-3);
15
+ border: 1px solid var(--nx-btn-border);
16
+ border-radius: var(--nx-radius);
17
+ background: var(--nx-btn-bg);
18
+ color: var(--nx-btn-color);
19
+ font-size: var(--nx-text-md);
20
+ font-weight: 500;
21
+ line-height: 1;
22
+ white-space: nowrap;
23
+ /* The same classes make a link look like a button, for a call to action that navigates. */
24
+ text-decoration: none;
25
+ cursor: pointer;
26
+ user-select: none;
27
+ box-shadow: var(--nx-shadow-sm);
28
+ transition:
29
+ background-color var(--nx-duration),
30
+ border-color var(--nx-duration),
31
+ color var(--nx-duration),
32
+ box-shadow var(--nx-duration),
33
+ transform var(--nx-duration);
34
+ }
35
+
36
+ .nx-btn .nx-icon {
37
+ width: 1.15em;
38
+ height: 1.15em;
39
+ vertical-align: 0;
40
+ }
41
+
42
+ .nx-btn:hover:not(:disabled) {
43
+ background: var(--nx-btn-bg-hover);
44
+ }
45
+
46
+ .nx-btn:active:not(:disabled) {
47
+ transform: translateY(1px);
48
+ }
49
+
50
+ .nx-btn:focus-visible {
51
+ outline: none;
52
+ box-shadow: var(--nx-focus-ring);
53
+ }
54
+
55
+ .nx-btn:disabled {
56
+ cursor: not-allowed;
57
+ opacity: 0.55;
58
+ box-shadow: none;
59
+ }
60
+
61
+ .nx-btn[aria-busy="true"] {
62
+ cursor: progress;
63
+ opacity: 0.8;
64
+ }
65
+
66
+ /* Variants */
67
+ .nx-btn--primary {
68
+ --nx-btn-bg: var(--nx-primary-solid);
69
+ --nx-btn-bg-hover: var(--nx-primary-hover);
70
+ --nx-btn-color: var(--nx-primary-text);
71
+ --nx-btn-border: transparent;
72
+ }
73
+
74
+ .nx-btn--danger {
75
+ --nx-btn-bg: var(--nx-danger-solid);
76
+ --nx-btn-bg-hover: var(--nx-danger-hover);
77
+ --nx-btn-color: var(--nx-danger-text);
78
+ --nx-btn-border: transparent;
79
+ }
80
+
81
+ .nx-btn--ghost {
82
+ --nx-btn-bg: transparent;
83
+ --nx-btn-border: transparent;
84
+ box-shadow: none;
85
+ }
86
+
87
+ /*
88
+ * Hover tones: a secondary or ghost button stays neutral, then takes the tone on its border,
89
+ * a soft background, and its text while hovered or focused from the keyboard.
90
+ * Every tone meets WCAG AA contrast on its soft background (npm run check:themes).
91
+ */
92
+ .nx-btn--hover-primary {
93
+ --nx-btn-tone: var(--nx-primary);
94
+ --nx-btn-tone-soft: var(--nx-primary-soft);
95
+ }
96
+
97
+ .nx-btn--hover-danger {
98
+ --nx-btn-tone: var(--nx-danger);
99
+ --nx-btn-tone-soft: var(--nx-danger-soft);
100
+ }
101
+
102
+ .nx-btn--hover-success {
103
+ --nx-btn-tone: var(--nx-success);
104
+ --nx-btn-tone-soft: var(--nx-success-soft);
105
+ }
106
+
107
+ .nx-btn--hover-warning {
108
+ --nx-btn-tone: var(--nx-warning);
109
+ --nx-btn-tone-soft: var(--nx-warning-soft);
110
+ }
111
+
112
+ .nx-btn--hover-info {
113
+ --nx-btn-tone: var(--nx-info);
114
+ --nx-btn-tone-soft: var(--nx-info-soft);
115
+ }
116
+
117
+ :is(.nx-btn--secondary, .nx-btn--ghost):is(
118
+ .nx-btn--hover-primary,
119
+ .nx-btn--hover-danger,
120
+ .nx-btn--hover-success,
121
+ .nx-btn--hover-warning,
122
+ .nx-btn--hover-info
123
+ ):is(:hover, :focus-visible):not(:disabled) {
124
+ --nx-btn-bg: var(--nx-btn-tone-soft);
125
+ --nx-btn-bg-hover: var(--nx-btn-tone-soft);
126
+ --nx-btn-border: var(--nx-btn-tone);
127
+ --nx-btn-color: var(--nx-btn-tone);
128
+ }
129
+
130
+ /* Sizes */
131
+ .nx-btn--sm {
132
+ --nx-btn-height: var(--nx-control-sm);
133
+ padding: 0 var(--nx-space-2);
134
+ gap: 6px;
135
+ font-size: var(--nx-text-sm);
136
+ }
137
+
138
+ .nx-btn--lg {
139
+ --nx-btn-height: var(--nx-control-lg);
140
+ padding: 0 var(--nx-space-4);
141
+ font-size: var(--nx-text-lg);
142
+ }
143
+
144
+ .nx-btn--icon {
145
+ width: var(--nx-btn-height);
146
+ padding: 0;
147
+ }
148
+
149
+ .nx-btn--block {
150
+ display: flex;
151
+ width: 100%;
152
+ }
153
+
154
+ /* Something new behind the button (red), or a state that is on (primary): a dot on its corner, ringed in the
155
+ surface so it reads over the icon. */
156
+ .nx-btn:has(> .nx-btn__dot) {
157
+ position: relative;
158
+ }
159
+
160
+ .nx-btn__dot {
161
+ position: absolute;
162
+ top: 6px;
163
+ right: 6px;
164
+ width: 7px;
165
+ height: 7px;
166
+ border: 1.5px solid var(--nx-surface);
167
+ border-radius: 50%;
168
+ background: var(--nx-danger-solid);
169
+ }
170
+
171
+ .nx-btn__dot[data-tone="primary"] {
172
+ background: var(--nx-primary-solid);
173
+ }
174
+
175
+ /* A small icon sits nearer the corner: the dot moves into it, clear of a narrow icon such as ⋮. */
176
+ .nx-btn--icon.nx-btn--sm > .nx-btn__dot {
177
+ top: 3px;
178
+ right: 3px;
179
+ }
180
+ }