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,237 +1,237 @@
1
- @layer nexus.components {
2
- /*
3
- * Menu: a list of actions in a native popover. It shares the .nx-popover panel (border, raised background, shadow)
4
- * with tight padding, so items sit close to the edge. Hover and keyboard focus highlight an item the same way,
5
- * because focus follows the pointer.
6
- */
7
- .nx-menu {
8
- --nx-menu-item-height: var(--nx-row);
9
- --nx-menu-font: var(--nx-text-md);
10
- --nx-menu-pad-x: var(--nx-space-2);
11
- --nx-popover-pad: 4px;
12
-
13
- position: fixed;
14
- inset: auto;
15
- min-width: 180px;
16
- max-width: min(360px, calc(100% - 16px));
17
- outline: none;
18
- }
19
-
20
- /* The items scroll inside the panel (`.nx-popover__scroll`): a block, so a long menu scrolls instead of squeezing
21
- its items the way flex children would. */
22
- .nx-menu__list {
23
- display: block;
24
- }
25
-
26
- .nx-menu--sm {
27
- --nx-menu-item-height: calc(var(--nx-row) - 4px);
28
- --nx-menu-font: var(--nx-text-sm);
29
- }
30
-
31
- .nx-menu--lg {
32
- --nx-menu-item-height: calc(var(--nx-row) + 6px);
33
- --nx-menu-font: var(--nx-text-lg);
34
- --nx-menu-pad-x: 10px;
35
- }
36
-
37
- .nx-menu__item {
38
- display: flex;
39
- align-items: center;
40
- gap: var(--nx-space-2);
41
- width: 100%;
42
- min-height: var(--nx-menu-item-height);
43
- margin: 0;
44
- padding: 5px var(--nx-menu-pad-x);
45
- border: 0;
46
- border-radius: var(--nx-radius);
47
- background: none;
48
- color: var(--nx-text);
49
- font: inherit;
50
- font-size: var(--nx-menu-font);
51
- line-height: 1.35;
52
- text-align: left;
53
- text-decoration: none;
54
- cursor: pointer;
55
- user-select: none;
56
- outline: none;
57
- }
58
-
59
- .nx-menu__item:is(:hover, :focus) {
60
- background: var(--nx-surface-hover);
61
- }
62
-
63
- .nx-menu__item[aria-disabled="true"] {
64
- background: none;
65
- opacity: 0.5;
66
- cursor: not-allowed;
67
- }
68
-
69
- /* The icon column: the same width on every item, empty on items without an icon. */
70
- .nx-menu__icon {
71
- display: grid;
72
- flex-shrink: 0;
73
- place-items: center;
74
- width: 1.15em;
75
- height: 1.15em;
76
- }
77
-
78
- .nx-menu__item .nx-icon {
79
- width: 1.15em;
80
- height: 1.15em;
81
- color: var(--nx-text-muted);
82
- vertical-align: 0;
83
- }
84
-
85
- .nx-menu__item--danger {
86
- color: var(--nx-danger);
87
- }
88
-
89
- .nx-menu__item--danger .nx-icon {
90
- color: inherit;
91
- }
92
-
93
- .nx-menu__item--danger:is(:hover, :focus) {
94
- background: var(--nx-danger-soft);
95
- }
96
-
97
- /* The check column of radio and checkbox menus: every item keeps the space, the checked one shows the mark. */
98
- .nx-menu__check {
99
- display: grid;
100
- flex-shrink: 0;
101
- place-items: center;
102
- width: 16px;
103
- color: var(--nx-primary);
104
- }
105
-
106
- .nx-menu__check .nx-icon {
107
- color: inherit;
108
- }
109
-
110
- .nx-menu__body {
111
- display: grid;
112
- flex: 1 1 auto;
113
- min-width: 0;
114
- }
115
-
116
- .nx-menu__label {
117
- overflow: hidden;
118
- text-overflow: ellipsis;
119
- white-space: nowrap;
120
- }
121
-
122
- .nx-menu__description {
123
- color: var(--nx-text-muted);
124
- font-size: var(--nx-text-xs);
125
- line-height: 1.4;
126
- }
127
-
128
- .nx-menu__shortcut {
129
- flex-shrink: 0;
130
- margin-left: auto;
131
- padding-left: var(--nx-space-4);
132
- color: var(--nx-text-subtle);
133
- font-family: var(--nx-font);
134
- font-size: var(--nx-text-xs);
135
- font-weight: 500;
136
- }
137
-
138
- .nx-menu__separator {
139
- height: 1px;
140
- margin: 4px 0;
141
- background: var(--nx-border);
142
- }
143
-
144
- .nx-menu__heading {
145
- padding: 6px var(--nx-menu-pad-x) 2px;
146
- color: var(--nx-text-subtle);
147
- font-size: var(--nx-text-xs);
148
- font-weight: 600;
149
- letter-spacing: 0.06em;
150
- text-transform: uppercase;
151
- }
152
-
153
- /* The context menu's wrapper takes no space, so it can wrap a table or a grid cell. */
154
- .nx-context-target {
155
- display: contents;
156
- }
157
-
158
- /*
159
- * Split button: the main action and an arrow that opens the alternatives. Two buttons joined at the middle,
160
- * with one shared edge; on primary and danger, whose borders are invisible, a faint line marks the split.
161
- */
162
- .nx-split {
163
- --nx-split-divider: transparent;
164
-
165
- display: inline-flex;
166
- align-items: stretch;
167
- vertical-align: middle;
168
- }
169
-
170
- .nx-split--block {
171
- display: flex;
172
- width: 100%;
173
- }
174
-
175
- .nx-split--block .nx-split__main {
176
- flex: 1 1 auto;
177
- }
178
-
179
- .nx-split--primary {
180
- --nx-split-divider: color-mix(in oklab, var(--nx-primary-text) 30%, transparent);
181
- }
182
-
183
- .nx-split--danger {
184
- --nx-split-divider: color-mix(in oklab, var(--nx-danger-text) 30%, transparent);
185
- }
186
-
187
- .nx-split .nx-split__main {
188
- border-start-end-radius: 0;
189
- border-end-end-radius: 0;
190
- }
191
-
192
- .nx-split .nx-split__toggle {
193
- width: calc(var(--nx-btn-height) - 6px);
194
- margin-left: -1px;
195
- padding: 0;
196
- border-start-start-radius: 0;
197
- border-end-start-radius: 0;
198
- box-shadow:
199
- inset 1px 0 0 var(--nx-split-divider),
200
- var(--nx-shadow-sm);
201
- }
202
-
203
- .nx-split .nx-split__toggle:disabled {
204
- box-shadow: inset 1px 0 0 var(--nx-split-divider);
205
- }
206
-
207
- /* Ghost halves have no shadow; a faint line still marks the split. */
208
- .nx-split--ghost {
209
- --nx-split-divider: var(--nx-border);
210
- }
211
-
212
- .nx-split--ghost .nx-split__toggle {
213
- box-shadow: inset 1px 0 0 var(--nx-split-divider);
214
- }
215
-
216
- /* The hovered or focused half paints over the shared edge. */
217
- .nx-split .nx-btn:is(:hover, :focus-visible) {
218
- position: relative;
219
- z-index: 1;
220
- }
221
-
222
- .nx-split .nx-split__toggle .nx-icon {
223
- transition: transform 160ms ease;
224
- }
225
-
226
- .nx-split .nx-split__toggle[aria-expanded="true"] .nx-icon {
227
- transform: rotate(180deg);
228
- }
229
-
230
- .nx-split__menu {
231
- min-width: 240px;
232
- }
233
-
234
- [data-nx-motion="reduce"] .nx-split .nx-split__toggle .nx-icon {
235
- transition: none;
236
- }
237
- }
1
+ @layer nexus.components {
2
+ /*
3
+ * Menu: a list of actions in a native popover. It shares the .nx-popover panel (border, raised background, shadow)
4
+ * with tight padding, so items sit close to the edge. Hover and keyboard focus highlight an item the same way,
5
+ * because focus follows the pointer.
6
+ */
7
+ .nx-menu {
8
+ --nx-menu-item-height: var(--nx-row);
9
+ --nx-menu-font: var(--nx-text-md);
10
+ --nx-menu-pad-x: var(--nx-space-2);
11
+ --nx-popover-pad: 4px;
12
+
13
+ position: fixed;
14
+ inset: auto;
15
+ min-width: 180px;
16
+ max-width: min(360px, calc(100% - 16px));
17
+ outline: none;
18
+ }
19
+
20
+ /* The items scroll inside the panel (`.nx-popover__scroll`): a block, so a long menu scrolls instead of squeezing
21
+ its items the way flex children would. */
22
+ .nx-menu__list {
23
+ display: block;
24
+ }
25
+
26
+ .nx-menu--sm {
27
+ --nx-menu-item-height: calc(var(--nx-row) - 4px);
28
+ --nx-menu-font: var(--nx-text-sm);
29
+ }
30
+
31
+ .nx-menu--lg {
32
+ --nx-menu-item-height: calc(var(--nx-row) + 6px);
33
+ --nx-menu-font: var(--nx-text-lg);
34
+ --nx-menu-pad-x: 10px;
35
+ }
36
+
37
+ .nx-menu__item {
38
+ display: flex;
39
+ align-items: center;
40
+ gap: var(--nx-space-2);
41
+ width: 100%;
42
+ min-height: var(--nx-menu-item-height);
43
+ margin: 0;
44
+ padding: 5px var(--nx-menu-pad-x);
45
+ border: 0;
46
+ border-radius: var(--nx-radius);
47
+ background: none;
48
+ color: var(--nx-text);
49
+ font: inherit;
50
+ font-size: var(--nx-menu-font);
51
+ line-height: 1.35;
52
+ text-align: left;
53
+ text-decoration: none;
54
+ cursor: pointer;
55
+ user-select: none;
56
+ outline: none;
57
+ }
58
+
59
+ .nx-menu__item:is(:hover, :focus) {
60
+ background: var(--nx-surface-hover);
61
+ }
62
+
63
+ .nx-menu__item[aria-disabled="true"] {
64
+ background: none;
65
+ opacity: 0.5;
66
+ cursor: not-allowed;
67
+ }
68
+
69
+ /* The icon column: the same width on every item, empty on items without an icon. */
70
+ .nx-menu__icon {
71
+ display: grid;
72
+ flex-shrink: 0;
73
+ place-items: center;
74
+ width: 1.15em;
75
+ height: 1.15em;
76
+ }
77
+
78
+ .nx-menu__item .nx-icon {
79
+ width: 1.15em;
80
+ height: 1.15em;
81
+ color: var(--nx-text-muted);
82
+ vertical-align: 0;
83
+ }
84
+
85
+ .nx-menu__item--danger {
86
+ color: var(--nx-danger);
87
+ }
88
+
89
+ .nx-menu__item--danger .nx-icon {
90
+ color: inherit;
91
+ }
92
+
93
+ .nx-menu__item--danger:is(:hover, :focus) {
94
+ background: var(--nx-danger-soft);
95
+ }
96
+
97
+ /* The check column of radio and checkbox menus: every item keeps the space, the checked one shows the mark. */
98
+ .nx-menu__check {
99
+ display: grid;
100
+ flex-shrink: 0;
101
+ place-items: center;
102
+ width: 16px;
103
+ color: var(--nx-primary);
104
+ }
105
+
106
+ .nx-menu__check .nx-icon {
107
+ color: inherit;
108
+ }
109
+
110
+ .nx-menu__body {
111
+ display: grid;
112
+ flex: 1 1 auto;
113
+ min-width: 0;
114
+ }
115
+
116
+ .nx-menu__label {
117
+ overflow: hidden;
118
+ text-overflow: ellipsis;
119
+ white-space: nowrap;
120
+ }
121
+
122
+ .nx-menu__description {
123
+ color: var(--nx-text-muted);
124
+ font-size: var(--nx-text-xs);
125
+ line-height: 1.4;
126
+ }
127
+
128
+ .nx-menu__shortcut {
129
+ flex-shrink: 0;
130
+ margin-left: auto;
131
+ padding-left: var(--nx-space-4);
132
+ color: var(--nx-text-subtle);
133
+ font-family: var(--nx-font);
134
+ font-size: var(--nx-text-xs);
135
+ font-weight: 500;
136
+ }
137
+
138
+ .nx-menu__separator {
139
+ height: 1px;
140
+ margin: 4px 0;
141
+ background: var(--nx-border);
142
+ }
143
+
144
+ .nx-menu__heading {
145
+ padding: 6px var(--nx-menu-pad-x) 2px;
146
+ color: var(--nx-text-subtle);
147
+ font-size: var(--nx-text-xs);
148
+ font-weight: 600;
149
+ letter-spacing: 0.06em;
150
+ text-transform: uppercase;
151
+ }
152
+
153
+ /* The context menu's wrapper takes no space, so it can wrap a table or a grid cell. */
154
+ .nx-context-target {
155
+ display: contents;
156
+ }
157
+
158
+ /*
159
+ * Split button: the main action and an arrow that opens the alternatives. Two buttons joined at the middle,
160
+ * with one shared edge; on primary and danger, whose borders are invisible, a faint line marks the split.
161
+ */
162
+ .nx-split {
163
+ --nx-split-divider: transparent;
164
+
165
+ display: inline-flex;
166
+ align-items: stretch;
167
+ vertical-align: middle;
168
+ }
169
+
170
+ .nx-split--block {
171
+ display: flex;
172
+ width: 100%;
173
+ }
174
+
175
+ .nx-split--block .nx-split__main {
176
+ flex: 1 1 auto;
177
+ }
178
+
179
+ .nx-split--primary {
180
+ --nx-split-divider: color-mix(in oklab, var(--nx-primary-text) 30%, transparent);
181
+ }
182
+
183
+ .nx-split--danger {
184
+ --nx-split-divider: color-mix(in oklab, var(--nx-danger-text) 30%, transparent);
185
+ }
186
+
187
+ .nx-split .nx-split__main {
188
+ border-start-end-radius: 0;
189
+ border-end-end-radius: 0;
190
+ }
191
+
192
+ .nx-split .nx-split__toggle {
193
+ width: calc(var(--nx-btn-height) - 6px);
194
+ margin-left: -1px;
195
+ padding: 0;
196
+ border-start-start-radius: 0;
197
+ border-end-start-radius: 0;
198
+ box-shadow:
199
+ inset 1px 0 0 var(--nx-split-divider),
200
+ var(--nx-shadow-sm);
201
+ }
202
+
203
+ .nx-split .nx-split__toggle:disabled {
204
+ box-shadow: inset 1px 0 0 var(--nx-split-divider);
205
+ }
206
+
207
+ /* Ghost halves have no shadow; a faint line still marks the split. */
208
+ .nx-split--ghost {
209
+ --nx-split-divider: var(--nx-border);
210
+ }
211
+
212
+ .nx-split--ghost .nx-split__toggle {
213
+ box-shadow: inset 1px 0 0 var(--nx-split-divider);
214
+ }
215
+
216
+ /* The hovered or focused half paints over the shared edge. */
217
+ .nx-split .nx-btn:is(:hover, :focus-visible) {
218
+ position: relative;
219
+ z-index: 1;
220
+ }
221
+
222
+ .nx-split .nx-split__toggle .nx-icon {
223
+ transition: transform 160ms ease;
224
+ }
225
+
226
+ .nx-split .nx-split__toggle[aria-expanded="true"] .nx-icon {
227
+ transform: rotate(180deg);
228
+ }
229
+
230
+ .nx-split__menu {
231
+ min-width: 240px;
232
+ }
233
+
234
+ [data-nx-motion="reduce"] .nx-split .nx-split__toggle .nx-icon {
235
+ transition: none;
236
+ }
237
+ }