@addev-be/ui 0.16.9 → 0.16.10
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/dist/Icons.d.ts +3 -1
- package/dist/Icons.js +6 -1
- package/dist/components/auth/LoginForm.js +7 -5
- package/dist/components/auth/PasswordRecoveryForm.js +6 -5
- package/dist/components/auth/styles.d.ts +1 -3
- package/dist/components/data/DataGrid/DataGridCell.d.ts +1 -1
- package/dist/components/data/DataGrid/DataGridCell.js +25 -15
- package/dist/components/data/DataGrid/DataGridColumnsModal/hooks.js +2 -2
- package/dist/components/data/DataGrid/DataGridColumnsModal/index.js +17 -7
- package/dist/components/data/DataGrid/DataGridColumnsModal/styles.d.ts +6 -18
- package/dist/components/data/DataGrid/DataGridColumnsModal/styles.js +19 -9
- package/dist/components/data/DataGrid/DataGridEditableCell/CheckboxEditableCell.d.ts +1 -1
- package/dist/components/data/DataGrid/DataGridEditableCell/CheckboxEditableCell.js +3 -3
- package/dist/components/data/DataGrid/DataGridEditableCell/DateEditableCell.d.ts +1 -1
- package/dist/components/data/DataGrid/DataGridEditableCell/DateEditableCell.js +4 -4
- package/dist/components/data/DataGrid/DataGridEditableCell/NumberEditableCell.d.ts +4 -2
- package/dist/components/data/DataGrid/DataGridEditableCell/NumberEditableCell.js +7 -5
- package/dist/components/data/DataGrid/DataGridEditableCell/TextEditableCell.d.ts +1 -1
- package/dist/components/data/DataGrid/DataGridEditableCell/TextEditableCell.js +3 -3
- package/dist/components/data/DataGrid/DataGridEditableCell/index.js +12 -12
- package/dist/components/data/DataGrid/DataGridEditableCell/styles.js +1 -1
- package/dist/components/data/DataGrid/DataGridEditableCell/types.d.ts +3 -3
- package/dist/components/data/DataGrid/DataGridFilterMenu/FilterValuesScroller.js +19 -10
- package/dist/components/data/DataGrid/DataGridFilterMenu/helpers.d.ts +2 -0
- package/dist/components/data/DataGrid/DataGridFilterMenu/helpers.js +19 -0
- package/dist/components/data/DataGrid/DataGridFilterMenu/hooks.js +2 -2
- package/dist/components/data/DataGrid/DataGridFilterMenu/index.js +24 -19
- package/dist/components/data/DataGrid/DataGridFilterMenu/styles.d.ts +5 -15
- package/dist/components/data/DataGrid/DataGridFilterMenu/styles.js +5 -5
- package/dist/components/data/DataGrid/DataGridFooter.js +18 -10
- package/dist/components/data/DataGrid/DataGridHeader.js +20 -60
- package/dist/components/data/DataGrid/DataGridHeaderCell.js +22 -13
- package/dist/components/data/DataGrid/DataGridRowTemplate.js +22 -10
- package/dist/components/data/DataGrid/DataGridToolbar.d.ts +4 -0
- package/dist/components/data/DataGrid/DataGridToolbar.js +141 -0
- package/dist/components/data/DataGrid/FilterModalContent/index.js +22 -12
- package/dist/components/data/DataGrid/FilterModalContent/styles.d.ts +1 -3
- package/dist/components/data/DataGrid/helpers/columns.d.ts +11 -9
- package/dist/components/data/DataGrid/helpers/columns.js +38 -19
- package/dist/components/data/DataGrid/hooks/useDataGrid.js +6 -5
- package/dist/components/data/DataGrid/hooks/useDataGridChangedRows.d.ts +7 -7
- package/dist/components/data/DataGrid/hooks/useDataGridChangedRows.js +52 -32
- package/dist/components/data/DataGrid/hooks/useDataGridSettings.d.ts +8 -12
- package/dist/components/data/DataGrid/hooks/useDataGridSettings.js +2 -2
- package/dist/components/data/DataGrid/hooks/useRefreshModal.d.ts +5 -0
- package/dist/components/data/DataGrid/hooks/useRefreshModal.js +25 -0
- package/dist/components/data/DataGrid/index.d.ts +3 -6
- package/dist/components/data/DataGrid/index.js +42 -19
- package/dist/components/data/DataGrid/styles.d.ts +10 -18
- package/dist/components/data/DataGrid/styles.js +64 -37
- package/dist/components/data/DataGrid/types.d.ts +42 -30
- package/dist/components/data/DataGrid/types.js +25 -15
- package/dist/components/data/SqlRequestDataGrid/SqlRequestForeignListEditableCell.d.ts +2 -1
- package/dist/components/data/SqlRequestDataGrid/SqlRequestForeignListEditableCell.js +2 -3
- package/dist/components/data/SqlRequestDataGrid/helpers/columns.d.ts +1 -1
- package/dist/components/data/SqlRequestDataGrid/helpers/columns.js +70 -47
- package/dist/components/data/SqlRequestDataGrid/helpers/rows.d.ts +2 -0
- package/dist/components/data/SqlRequestDataGrid/helpers/rows.js +17 -0
- package/dist/components/data/SqlRequestDataGrid/index.d.ts +4 -11
- package/dist/components/data/SqlRequestDataGrid/index.js +50 -30
- package/dist/components/data/SqlRequestForeignList/index.d.ts +4 -3
- package/dist/components/data/SqlRequestForeignList/index.js +15 -15
- package/dist/components/data/SqlRequestForeignList/styles.js +1 -1
- package/dist/components/data/SqlRequestForeignList/types.d.ts +1 -1
- package/dist/components/data/SqlRequestForeignList/types.js +0 -1
- package/dist/components/data/SqlRequestGrid/filters/FiltersSidebar.js +19 -10
- package/dist/components/data/SqlRequestGrid/filters/styles.js +3 -3
- package/dist/components/data/SqlRequestGrid/index.d.ts +4 -3
- package/dist/components/data/SqlRequestGrid/index.js +26 -26
- package/dist/components/data/SqlRequestGrid/styles.d.ts +1 -3
- package/dist/components/data/SqlRequestGrid/types.js +0 -1
- package/dist/components/data/VirtualScroller/hooks.js +2 -2
- package/dist/components/data/VirtualScroller/index.js +17 -8
- package/dist/components/data/VirtualScroller/styles.d.ts +2 -6
- package/dist/components/data/VirtualScroller/styles.js +0 -1
- package/dist/components/data/VirtualScroller/types.js +0 -1
- package/dist/components/forms/AutoTextArea.js +2 -1
- package/dist/components/forms/Button.d.ts +4 -4
- package/dist/components/forms/Button.js +29 -19
- package/dist/components/forms/Form/Checkbox.d.ts +2 -2
- package/dist/components/forms/Form/Checkbox.js +2 -2
- package/dist/components/forms/Form/CustomSelect.d.ts +13 -0
- package/dist/components/forms/Form/CustomSelect.js +50 -0
- package/dist/components/forms/Form/FormGroup.d.ts +3 -1
- package/dist/components/forms/Form/FormGroup.js +2 -2
- package/dist/components/forms/Form/Input.d.ts +2 -2
- package/dist/components/forms/Form/Input.js +3 -2
- package/dist/components/forms/Form/Row.d.ts +9 -0
- package/dist/components/forms/Form/Row.js +10 -0
- package/dist/components/forms/Form/Select.d.ts +4 -8
- package/dist/components/forms/Form/Select.js +12 -8
- package/dist/components/forms/Form/TextArea.d.ts +2 -2
- package/dist/components/forms/Form/TextArea.js +3 -2
- package/dist/components/forms/Form/index.d.ts +40 -20
- package/dist/components/forms/Form/index.js +15 -8
- package/dist/components/forms/Form/styles.d.ts +10 -7
- package/dist/components/forms/Form/styles.js +31 -19
- package/dist/components/forms/IconButton.d.ts +8 -4
- package/dist/components/forms/IconButton.js +4 -4
- package/dist/components/forms/NumberInput.d.ts +9 -0
- package/dist/components/forms/NumberInput.js +40 -0
- package/dist/components/forms/index.d.ts +2 -1
- package/dist/components/forms/index.js +2 -1
- package/dist/components/forms/styles.d.ts +18 -6
- package/dist/components/forms/styles.js +25 -14
- package/dist/components/layout/Columns.d.ts +3 -1
- package/dist/components/layout/Columns.js +8 -6
- package/dist/components/layout/Dropdown/index.js +19 -9
- package/dist/components/layout/Dropdown/styles.d.ts +3 -6
- package/dist/components/layout/Dropdown/styles.js +22 -9
- package/dist/components/layout/Flexbox.d.ts +11 -0
- package/dist/components/layout/Flexbox.js +26 -0
- package/dist/components/layout/Grid/styles.d.ts +1 -3
- package/dist/components/layout/Loading/index.js +19 -9
- package/dist/components/layout/Loading/styles.d.ts +2 -6
- package/dist/components/layout/Modal/index.js +19 -9
- package/dist/components/layout/Modal/styles.d.ts +9 -27
- package/dist/components/layout/Modal/styles.js +21 -11
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout/index.js +1 -0
- package/dist/components/search/HighlightedText.js +11 -9
- package/dist/components/search/QuickSearchBar.d.ts +6 -2
- package/dist/components/search/QuickSearchBar.js +28 -25
- package/dist/components/search/QuickSearchResults.js +17 -7
- package/dist/components/search/styles.d.ts +9 -27
- package/dist/components/search/styles.js +5 -5
- package/dist/components/search/types.d.ts +3 -0
- package/dist/components/ui/Avatar/index.d.ts +1 -1
- package/dist/components/ui/Avatar/index.js +17 -7
- package/dist/components/ui/Avatar/styles.js +17 -7
- package/dist/components/ui/Card/styles.d.ts +3 -9
- package/dist/components/ui/Card/styles.js +3 -3
- package/dist/components/ui/ContextMenu/styles.d.ts +4 -12
- package/dist/components/ui/ContextMenu/styles.js +22 -12
- package/dist/components/ui/Ellipsis.d.ts +0 -1
- package/dist/components/ui/Label.d.ts +2 -1
- package/dist/components/ui/Label.js +23 -13
- package/dist/components/ui/Message/index.js +19 -9
- package/dist/components/ui/Message/styles.d.ts +4 -7
- package/dist/components/ui/Message/styles.js +20 -9
- package/dist/components/ui/TabsView/TabsList.d.ts +10 -0
- package/dist/components/ui/TabsView/TabsList.js +40 -0
- package/dist/components/ui/TabsView/TabsView.d.ts +9 -0
- package/dist/components/ui/TabsView/TabsView.js +17 -0
- package/dist/components/ui/TabsView/index.d.ts +3 -0
- package/dist/components/ui/TabsView/index.js +19 -0
- package/dist/components/ui/TabsView/styles.d.ts +11 -0
- package/dist/components/ui/TabsView/styles.js +57 -0
- package/dist/components/ui/TabsView/types.d.ts +10 -0
- package/dist/components/ui/TabsView/types.js +2 -0
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.js +1 -0
- package/dist/config/index.d.ts +1 -4
- package/dist/helpers/components.d.ts +2 -0
- package/dist/helpers/components.js +8 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.js +1 -0
- package/dist/helpers/react.d.ts +2 -0
- package/dist/helpers/react.js +8 -0
- package/dist/helpers/styled/index.d.ts +1 -0
- package/dist/helpers/styled/index.js +17 -0
- package/dist/helpers/styled/space.d.ts +39 -0
- package/dist/helpers/styled/space.js +90 -0
- package/dist/helpers/styled/typography.d.ts +9 -0
- package/dist/helpers/styled/typography.js +61 -0
- package/dist/helpers/types.d.ts +2 -0
- package/dist/helpers/types.js +8 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useMutableState.d.ts +8 -0
- package/dist/hooks/useMutableState.js +14 -0
- package/dist/index.d.ts +86 -5
- package/dist/index.js +86 -5
- package/dist/providers/AuthenticationProvider/index.d.ts +2 -1
- package/dist/providers/AuthenticationProvider/index.js +63 -21
- package/dist/providers/LoadingProvider/index.js +2 -2
- package/dist/providers/PortalsProvider/index.js +17 -7
- package/dist/providers/PortalsProvider/styles.d.ts +3 -9
- package/dist/providers/ThemeProvider/ThemeProvider.d.ts +1 -0
- package/dist/providers/ThemeProvider/ThemeProvider.js +11 -9
- package/dist/providers/ThemeProvider/defaultTheme.d.ts +1 -0
- package/dist/providers/ThemeProvider/defaultTheme.js +20 -1
- package/dist/providers/ThemeProvider/helpers.d.ts +12 -3
- package/dist/providers/ThemeProvider/helpers.js +54 -2
- package/dist/providers/ThemeProvider/index.d.ts +8 -3
- package/dist/providers/ThemeProvider/index.js +49 -18
- package/dist/providers/ThemeProvider/types.d.ts +3 -2
- package/dist/providers/ToastProvider/index.d.ts +12 -0
- package/dist/providers/ToastProvider/index.js +66 -0
- package/dist/providers/TrackingProvider/index.js +2 -2
- package/dist/providers/UiProviders/index.d.ts +4 -1
- package/dist/providers/UiProviders/index.js +20 -10
- package/dist/providers/UiProviders/styles.d.ts +1 -3
- package/dist/providers/UiProviders/styles.js +1 -1
- package/dist/providers/hooks.d.ts +6 -0
- package/dist/providers/hooks.js +4 -1
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.js +1 -0
- package/dist/services/WebSocketService.d.ts +8 -0
- package/dist/services/WebSocketService.js +34 -2
- package/dist/services/globalSearch.d.ts +5 -2
- package/dist/services/hooks.d.ts +10 -0
- package/dist/services/hooks.js +91 -4
- package/dist/services/index.js +17 -7
- package/dist/services/requests/auth.d.ts +9 -11
- package/dist/services/requests/generic.d.ts +62 -15
- package/dist/services/requests/generic.js +7 -7
- package/dist/services/requests/tracking.d.ts +4 -8
- package/dist/services/requests/userProfiles.d.ts +5 -5
- package/dist/services/requests/users.d.ts +11 -16
- package/dist/services/types/auth.d.ts +80 -82
- package/dist/services/types/auth.js +58 -48
- package/dist/services/types/base.d.ts +5 -5
- package/dist/services/types/base.js +21 -11
- package/dist/services/types/generic.d.ts +39 -40
- package/dist/services/types/generic.js +55 -49
- package/dist/services/types/tracking.d.ts +24 -24
- package/dist/services/types/tracking.js +30 -28
- package/dist/services/types/userProfiles.d.ts +60 -60
- package/dist/services/types/userProfiles.js +48 -45
- package/dist/services/types/users.d.ts +108 -114
- package/dist/services/types/users.js +56 -59
- package/dist/services/updateSqlRequests.js +0 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.js +2 -0
- package/eslint.config.js +28 -28
- package/package.json +1 -1
- package/src/components/data/DataGrid/DataGridEditableCell/index.tsx +7 -5
- package/src/components/data/DataGrid/DataGridHeader.tsx +4 -16
- package/src/components/data/DataGrid/DataGridRowTemplate.tsx +2 -4
- package/src/components/data/DataGrid/hooks/useDataGrid.tsx +6 -3
- package/src/components/data/DataGrid/hooks/useDataGridChangedRows.ts +32 -65
- package/src/components/data/DataGrid/styles.ts +2 -9
- package/src/components/data/DataGrid/types.ts +5 -5
- package/src/components/data/SqlRequestDataGrid/helpers/columns.tsx +3 -4
- package/src/components/layout/Modal/styles.ts +2 -6
- package/src/components/search/HighlightedText.tsx +20 -24
- package/src/components/search/QuickSearchBar.tsx +7 -11
- package/tsconfig.tsbuildinfo +1 -1
- package/src/components/data/DataGrid/hooks/useRefreshModal.tsx +0 -48
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
3
|
if (k2 === undefined) k2 = k;
|
|
15
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -26,43 +15,57 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
26
15
|
}) : function(o, v) {
|
|
27
16
|
o["default"] = v;
|
|
28
17
|
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
36
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.
|
|
38
|
-
var
|
|
36
|
+
exports.deleteUserProfileResponseDtoSchema = exports.deleteUserProfileRequestDtoSchema = exports.saveUserProfileResponseDtoSchema = exports.saveUserProfileRequestDtoSchema = exports.getAllUserProfilesResponseDtoSchema = exports.getAllUserProfilesRequestDtoSchema = exports.getUserProfileResponseDtoSchema = exports.getUserProfileRequestDtoSchema = exports.userProfileDtoSchema = void 0;
|
|
37
|
+
var z = __importStar(require("zod"));
|
|
39
38
|
var base_1 = require("./base");
|
|
40
|
-
exports.
|
|
39
|
+
exports.userProfileDtoSchema = base_1.baseModelDtoSchema.extend({
|
|
40
|
+
name: z.string(),
|
|
41
|
+
permissions: z.array(z.string()),
|
|
42
|
+
isAdmin: z.boolean(),
|
|
43
|
+
});
|
|
41
44
|
/*****/
|
|
42
|
-
exports.
|
|
43
|
-
id:
|
|
44
|
-
}
|
|
45
|
-
exports.
|
|
46
|
-
status:
|
|
47
|
-
data: exports.
|
|
48
|
-
}
|
|
45
|
+
exports.getUserProfileRequestDtoSchema = z.object({
|
|
46
|
+
id: z.string(),
|
|
47
|
+
});
|
|
48
|
+
exports.getUserProfileResponseDtoSchema = z.object({
|
|
49
|
+
status: z.number(),
|
|
50
|
+
data: exports.userProfileDtoSchema,
|
|
51
|
+
});
|
|
49
52
|
/*****/
|
|
50
|
-
exports.
|
|
51
|
-
exports.
|
|
52
|
-
data:
|
|
53
|
-
}
|
|
53
|
+
exports.getAllUserProfilesRequestDtoSchema = z.object({});
|
|
54
|
+
exports.getAllUserProfilesResponseDtoSchema = z.object({
|
|
55
|
+
data: z.array(exports.userProfileDtoSchema),
|
|
56
|
+
});
|
|
54
57
|
/*****/
|
|
55
|
-
exports.
|
|
56
|
-
data: exports.
|
|
57
|
-
}
|
|
58
|
-
exports.
|
|
59
|
-
status:
|
|
60
|
-
data: exports.
|
|
61
|
-
}
|
|
58
|
+
exports.saveUserProfileRequestDtoSchema = z.object({
|
|
59
|
+
data: exports.userProfileDtoSchema,
|
|
60
|
+
});
|
|
61
|
+
exports.saveUserProfileResponseDtoSchema = z.object({
|
|
62
|
+
status: z.number(),
|
|
63
|
+
data: exports.userProfileDtoSchema,
|
|
64
|
+
});
|
|
62
65
|
/*****/
|
|
63
|
-
exports.
|
|
64
|
-
id:
|
|
65
|
-
}
|
|
66
|
-
exports.
|
|
67
|
-
status:
|
|
68
|
-
}
|
|
66
|
+
exports.deleteUserProfileRequestDtoSchema = z.object({
|
|
67
|
+
id: z.string(),
|
|
68
|
+
});
|
|
69
|
+
exports.deleteUserProfileResponseDtoSchema = z.object({
|
|
70
|
+
status: z.number(),
|
|
71
|
+
});
|
|
@@ -1,118 +1,112 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export type UserDTO = t.TypeOf<typeof userDtoCodec>;
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
export declare const userDtoSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodUUID;
|
|
4
|
+
username: z.ZodString;
|
|
5
|
+
permissions: z.ZodArray<z.ZodString>;
|
|
6
|
+
isAdmin: z.ZodBoolean;
|
|
7
|
+
profile: z.ZodNullable<z.ZodObject<{
|
|
8
|
+
id: z.ZodUUID;
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
permissions: z.ZodArray<z.ZodString>;
|
|
11
|
+
isAdmin: z.ZodBoolean;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
name: z.ZodOptional<z.ZodString>;
|
|
14
|
+
email: z.ZodOptional<z.ZodString>;
|
|
15
|
+
lastLogin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export type UserDTO = z.infer<typeof userDtoSchema>;
|
|
19
18
|
/*****/
|
|
20
|
-
export declare const
|
|
21
|
-
id:
|
|
22
|
-
}>;
|
|
23
|
-
export declare const
|
|
24
|
-
status:
|
|
25
|
-
data:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
export type
|
|
43
|
-
export type GetUserResponseDTO = t.TypeOf<typeof getUserResponseDtoCodec>;
|
|
19
|
+
export declare const getUserRequestDtoSchema: z.ZodObject<{
|
|
20
|
+
id: z.ZodString;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export declare const getUserResponseDtoSchema: z.ZodObject<{
|
|
23
|
+
status: z.ZodNumber;
|
|
24
|
+
data: z.ZodObject<{
|
|
25
|
+
id: z.ZodUUID;
|
|
26
|
+
username: z.ZodString;
|
|
27
|
+
permissions: z.ZodArray<z.ZodString>;
|
|
28
|
+
isAdmin: z.ZodBoolean;
|
|
29
|
+
profile: z.ZodNullable<z.ZodObject<{
|
|
30
|
+
id: z.ZodUUID;
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
permissions: z.ZodArray<z.ZodString>;
|
|
33
|
+
isAdmin: z.ZodBoolean;
|
|
34
|
+
}, z.core.$strip>>;
|
|
35
|
+
name: z.ZodOptional<z.ZodString>;
|
|
36
|
+
email: z.ZodOptional<z.ZodString>;
|
|
37
|
+
lastLogin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export type GetUserRequestDTO = z.infer<typeof getUserRequestDtoSchema>;
|
|
41
|
+
export type GetUserResponseDTO = z.infer<typeof getUserResponseDtoSchema>;
|
|
44
42
|
/*****/
|
|
45
|
-
export declare const
|
|
46
|
-
export declare const
|
|
47
|
-
status:
|
|
48
|
-
data:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
export type
|
|
66
|
-
export type GetAllUsersResponseDTO = t.TypeOf<typeof getAllUsersResponseDtoCodec>;
|
|
43
|
+
export declare const getAllUsersRequestDtoSchema: z.ZodObject<{}, z.core.$strip>;
|
|
44
|
+
export declare const getAllUsersResponseDtoSchema: z.ZodObject<{
|
|
45
|
+
status: z.ZodNumber;
|
|
46
|
+
data: z.ZodArray<z.ZodObject<{
|
|
47
|
+
id: z.ZodUUID;
|
|
48
|
+
username: z.ZodString;
|
|
49
|
+
permissions: z.ZodArray<z.ZodString>;
|
|
50
|
+
isAdmin: z.ZodBoolean;
|
|
51
|
+
profile: z.ZodNullable<z.ZodObject<{
|
|
52
|
+
id: z.ZodUUID;
|
|
53
|
+
name: z.ZodString;
|
|
54
|
+
permissions: z.ZodArray<z.ZodString>;
|
|
55
|
+
isAdmin: z.ZodBoolean;
|
|
56
|
+
}, z.core.$strip>>;
|
|
57
|
+
name: z.ZodOptional<z.ZodString>;
|
|
58
|
+
email: z.ZodOptional<z.ZodString>;
|
|
59
|
+
lastLogin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
60
|
+
}, z.core.$strip>>;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
export type GetAllUsersRequestDTO = z.infer<typeof getAllUsersRequestDtoSchema>;
|
|
63
|
+
export type GetAllUsersResponseDTO = z.infer<typeof getAllUsersResponseDtoSchema>;
|
|
67
64
|
/*****/
|
|
68
|
-
export declare const
|
|
69
|
-
data:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
name:
|
|
97
|
-
permissions:
|
|
98
|
-
isAdmin:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}>;
|
|
108
|
-
export type SaveUserRequestDTO = t.TypeOf<typeof saveUserRequestDtoCodec>;
|
|
109
|
-
export type SaveUserResponseDTO = t.TypeOf<typeof saveUserResponseDtoCodec>;
|
|
65
|
+
export declare const saveUserRequestDtoSchema: z.ZodObject<{
|
|
66
|
+
data: z.ZodObject<{
|
|
67
|
+
id: z.ZodUUID;
|
|
68
|
+
username: z.ZodString;
|
|
69
|
+
permissions: z.ZodArray<z.ZodString>;
|
|
70
|
+
isAdmin: z.ZodBoolean;
|
|
71
|
+
profile: z.ZodNullable<z.ZodObject<{
|
|
72
|
+
id: z.ZodUUID;
|
|
73
|
+
name: z.ZodString;
|
|
74
|
+
permissions: z.ZodArray<z.ZodString>;
|
|
75
|
+
isAdmin: z.ZodBoolean;
|
|
76
|
+
}, z.core.$strip>>;
|
|
77
|
+
name: z.ZodOptional<z.ZodString>;
|
|
78
|
+
email: z.ZodOptional<z.ZodString>;
|
|
79
|
+
lastLogin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
80
|
+
password: z.ZodOptional<z.ZodString>;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
password: z.ZodString;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
export declare const saveUserResponseDtoSchema: z.ZodObject<{
|
|
85
|
+
status: z.ZodNumber;
|
|
86
|
+
data: z.ZodObject<{
|
|
87
|
+
id: z.ZodUUID;
|
|
88
|
+
username: z.ZodString;
|
|
89
|
+
permissions: z.ZodArray<z.ZodString>;
|
|
90
|
+
isAdmin: z.ZodBoolean;
|
|
91
|
+
profile: z.ZodNullable<z.ZodObject<{
|
|
92
|
+
id: z.ZodUUID;
|
|
93
|
+
name: z.ZodString;
|
|
94
|
+
permissions: z.ZodArray<z.ZodString>;
|
|
95
|
+
isAdmin: z.ZodBoolean;
|
|
96
|
+
}, z.core.$strip>>;
|
|
97
|
+
name: z.ZodOptional<z.ZodString>;
|
|
98
|
+
email: z.ZodOptional<z.ZodString>;
|
|
99
|
+
lastLogin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
100
|
+
}, z.core.$strip>;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
export type SaveUserRequestDTO = z.infer<typeof saveUserRequestDtoSchema>;
|
|
103
|
+
export type SaveUserResponseDTO = z.infer<typeof saveUserResponseDtoSchema>;
|
|
110
104
|
/*****/
|
|
111
|
-
export declare const
|
|
112
|
-
id:
|
|
113
|
-
}>;
|
|
114
|
-
export declare const
|
|
115
|
-
status:
|
|
116
|
-
}>;
|
|
117
|
-
export type DeleteUserRequestDTO =
|
|
118
|
-
export type DeleteUserResponseDTO =
|
|
105
|
+
export declare const deleteUserRequestDtoSchema: z.ZodObject<{
|
|
106
|
+
id: z.ZodString;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
export declare const deleteUserResponseDtoSchema: z.ZodObject<{
|
|
109
|
+
status: z.ZodNumber;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
export type DeleteUserRequestDTO = z.infer<typeof deleteUserRequestDtoSchema>;
|
|
112
|
+
export type DeleteUserResponseDTO = z.infer<typeof deleteUserResponseDtoSchema>;
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
3
|
if (k2 === undefined) k2 = k;
|
|
15
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -26,58 +15,66 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
26
15
|
}) : function(o, v) {
|
|
27
16
|
o["default"] = v;
|
|
28
17
|
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
36
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.
|
|
38
|
-
var
|
|
36
|
+
exports.deleteUserResponseDtoSchema = exports.deleteUserRequestDtoSchema = exports.saveUserResponseDtoSchema = exports.saveUserRequestDtoSchema = exports.getAllUsersResponseDtoSchema = exports.getAllUsersRequestDtoSchema = exports.getUserResponseDtoSchema = exports.getUserRequestDtoSchema = exports.userDtoSchema = void 0;
|
|
37
|
+
var z = __importStar(require("zod"));
|
|
39
38
|
var base_1 = require("./base");
|
|
40
39
|
var userProfiles_1 = require("./userProfiles");
|
|
41
|
-
exports.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
exports.userDtoSchema = base_1.baseModelDtoSchema.extend({
|
|
41
|
+
username: z.string(),
|
|
42
|
+
permissions: z.array(z.string()),
|
|
43
|
+
isAdmin: z.boolean(),
|
|
44
|
+
profile: userProfiles_1.userProfileDtoSchema.nullable(),
|
|
45
|
+
name: z.string().optional(),
|
|
46
|
+
email: z.string().optional(),
|
|
47
|
+
lastLogin: z.string().nullable().optional(),
|
|
48
|
+
});
|
|
49
49
|
/*****/
|
|
50
|
-
exports.
|
|
51
|
-
id:
|
|
52
|
-
}
|
|
53
|
-
exports.
|
|
54
|
-
status:
|
|
55
|
-
data: exports.
|
|
56
|
-
}
|
|
50
|
+
exports.getUserRequestDtoSchema = z.object({
|
|
51
|
+
id: z.string(),
|
|
52
|
+
});
|
|
53
|
+
exports.getUserResponseDtoSchema = z.object({
|
|
54
|
+
status: z.number(),
|
|
55
|
+
data: exports.userDtoSchema,
|
|
56
|
+
});
|
|
57
57
|
/*****/
|
|
58
|
-
exports.
|
|
59
|
-
exports.
|
|
60
|
-
status:
|
|
61
|
-
data:
|
|
62
|
-
}
|
|
58
|
+
exports.getAllUsersRequestDtoSchema = z.object({});
|
|
59
|
+
exports.getAllUsersResponseDtoSchema = z.object({
|
|
60
|
+
status: z.number(),
|
|
61
|
+
data: z.array(exports.userDtoSchema),
|
|
62
|
+
});
|
|
63
63
|
/*****/
|
|
64
|
-
exports.
|
|
65
|
-
data:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
status: t.number,
|
|
75
|
-
data: exports.userDtoCodec,
|
|
76
|
-
}, 'SaveUserResponseDTO');
|
|
64
|
+
exports.saveUserRequestDtoSchema = z.object({
|
|
65
|
+
data: exports.userDtoSchema.extend({
|
|
66
|
+
password: z.string().optional(),
|
|
67
|
+
}),
|
|
68
|
+
password: z.string(),
|
|
69
|
+
});
|
|
70
|
+
exports.saveUserResponseDtoSchema = z.object({
|
|
71
|
+
status: z.number(),
|
|
72
|
+
data: exports.userDtoSchema,
|
|
73
|
+
});
|
|
77
74
|
/*****/
|
|
78
|
-
exports.
|
|
79
|
-
id:
|
|
80
|
-
}
|
|
81
|
-
exports.
|
|
82
|
-
status:
|
|
83
|
-
}
|
|
75
|
+
exports.deleteUserRequestDtoSchema = z.object({
|
|
76
|
+
id: z.string(),
|
|
77
|
+
});
|
|
78
|
+
exports.deleteUserResponseDtoSchema = z.object({
|
|
79
|
+
status: z.number(),
|
|
80
|
+
});
|
|
@@ -2,6 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useUpdateSqlRequestHandler = void 0;
|
|
4
4
|
var hooks_1 = require("./hooks");
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
5
|
var useUpdateSqlRequestHandler = function (name) { return (0, hooks_1.useWebSocketRequestHandler)(name); };
|
|
7
6
|
exports.useUpdateSqlRequestHandler = useUpdateSqlRequestHandler;
|
package/dist/types.d.ts
ADDED
package/dist/types.js
ADDED
package/eslint.config.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import js from '@eslint/js'
|
|
2
|
-
import globals from 'globals'
|
|
3
|
-
import reactHooks from 'eslint-plugin-react-hooks'
|
|
4
|
-
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
5
|
-
import tseslint from 'typescript-eslint'
|
|
6
|
-
|
|
7
|
-
export default tseslint.config(
|
|
8
|
-
{ ignores: ['dist'] },
|
|
9
|
-
{
|
|
10
|
-
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
|
11
|
-
files: ['**/*.{ts,tsx}'],
|
|
12
|
-
languageOptions: {
|
|
13
|
-
ecmaVersion: 2020,
|
|
14
|
-
globals: globals.browser,
|
|
15
|
-
},
|
|
16
|
-
plugins: {
|
|
17
|
-
'react-hooks': reactHooks,
|
|
18
|
-
'react-refresh': reactRefresh,
|
|
19
|
-
},
|
|
20
|
-
rules: {
|
|
21
|
-
...reactHooks.configs.recommended.rules,
|
|
22
|
-
'react-refresh/only-export-components': [
|
|
23
|
-
'warn',
|
|
24
|
-
{ allowConstantExport: true },
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
)
|
|
1
|
+
import js from '@eslint/js'
|
|
2
|
+
import globals from 'globals'
|
|
3
|
+
import reactHooks from 'eslint-plugin-react-hooks'
|
|
4
|
+
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
5
|
+
import tseslint from 'typescript-eslint'
|
|
6
|
+
|
|
7
|
+
export default tseslint.config(
|
|
8
|
+
{ ignores: ['dist'] },
|
|
9
|
+
{
|
|
10
|
+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
|
11
|
+
files: ['**/*.{ts,tsx}'],
|
|
12
|
+
languageOptions: {
|
|
13
|
+
ecmaVersion: 2020,
|
|
14
|
+
globals: globals.browser,
|
|
15
|
+
},
|
|
16
|
+
plugins: {
|
|
17
|
+
'react-hooks': reactHooks,
|
|
18
|
+
'react-refresh': reactRefresh,
|
|
19
|
+
},
|
|
20
|
+
rules: {
|
|
21
|
+
...reactHooks.configs.recommended.rules,
|
|
22
|
+
'react-refresh/only-export-components': [
|
|
23
|
+
'warn',
|
|
24
|
+
{ allowConstantExport: true },
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
)
|
package/package.json
CHANGED
|
@@ -22,27 +22,29 @@ export const DataGridEditableCell = <R, T>({
|
|
|
22
22
|
const rowKey = rowKeyGetter(row);
|
|
23
23
|
|
|
24
24
|
const defaultItemToPartialRow = useCallback(
|
|
25
|
-
(
|
|
26
|
-
({
|
|
25
|
+
(row: R, newValue: T): Partial<R> =>
|
|
26
|
+
({ [columnKey]: newValue } as Partial<R>),
|
|
27
27
|
[columnKey]
|
|
28
28
|
);
|
|
29
29
|
const partialRowGetter: EditableDataGridColumn<R, T>['itemToPartialRow'] =
|
|
30
30
|
column.itemToPartialRow ?? defaultItemToPartialRow;
|
|
31
31
|
|
|
32
32
|
const save = useCallback(() => {
|
|
33
|
-
const rowIndex = rows.findIndex(
|
|
33
|
+
const rowIndex = rows.findIndex(
|
|
34
|
+
(r) => rowKeyGetter(r) === rowKeyGetter(row)
|
|
35
|
+
);
|
|
34
36
|
|
|
35
37
|
// If row is found
|
|
36
38
|
if (rowIndex >= 0) {
|
|
37
39
|
// Update the row with the new value
|
|
38
|
-
const partialRow = partialRowGetter(
|
|
40
|
+
const partialRow = partialRowGetter(row, value);
|
|
39
41
|
const newRow = {
|
|
40
42
|
...row,
|
|
41
43
|
...partialRow,
|
|
42
44
|
};
|
|
43
45
|
|
|
44
46
|
// Update the edited rows state
|
|
45
|
-
editRow(partialRow);
|
|
47
|
+
editRow(rowKey, partialRow);
|
|
46
48
|
|
|
47
49
|
// Update the rows
|
|
48
50
|
setRows?.((oldRows) => {
|
|
@@ -20,7 +20,6 @@ import { IndeterminateCheckbox } from '../../forms/IndeterminateCheckbox';
|
|
|
20
20
|
import { Loading } from '../../layout';
|
|
21
21
|
import { useDataGridColumnsModal } from './DataGridColumnsModal/hooks';
|
|
22
22
|
import { useDataGridContext } from './hooks';
|
|
23
|
-
import { useRefreshModal } from './hooks/useRefreshModal';
|
|
24
23
|
|
|
25
24
|
export const DataGridHeader = <R,>({
|
|
26
25
|
context,
|
|
@@ -90,27 +89,17 @@ export const DataGridHeader = <R,>({
|
|
|
90
89
|
const add = useCallback(async () => {
|
|
91
90
|
if (onAddClicked) {
|
|
92
91
|
const row = await onAddClicked();
|
|
93
|
-
|
|
92
|
+
const key = rowKeyGetter(row);
|
|
93
|
+
addRow(key, row);
|
|
94
94
|
}
|
|
95
|
-
}, [addRow, onAddClicked]);
|
|
95
|
+
}, [addRow, onAddClicked, rowKeyGetter]);
|
|
96
96
|
|
|
97
|
-
const
|
|
97
|
+
const onRefreshClicked = useCallback(() => {
|
|
98
98
|
refresh?.();
|
|
99
99
|
clearChangedRows();
|
|
100
100
|
setSelectedKeys([]);
|
|
101
101
|
}, [clearChangedRows, refresh, setSelectedKeys]);
|
|
102
102
|
|
|
103
|
-
const { openModal: openRefreshModal, modal: refreshModal } =
|
|
104
|
-
useRefreshModal(doRefresh);
|
|
105
|
-
|
|
106
|
-
const onRefreshClicked = useCallback(async () => {
|
|
107
|
-
if (addedRows.length + updatedRows.length > 0) {
|
|
108
|
-
openRefreshModal();
|
|
109
|
-
} else {
|
|
110
|
-
doRefresh();
|
|
111
|
-
}
|
|
112
|
-
}, [addedRows.length, doRefresh, openRefreshModal, updatedRows.length]);
|
|
113
|
-
|
|
114
103
|
const toolsRow = (
|
|
115
104
|
<styles.DataGridToolsRow>
|
|
116
105
|
<styles.DataGridToolsRowButtonsContainer>
|
|
@@ -154,7 +143,6 @@ export const DataGridHeader = <R,>({
|
|
|
154
143
|
return (
|
|
155
144
|
<>
|
|
156
145
|
{modal}
|
|
157
|
-
{refreshModal}
|
|
158
146
|
{toolsRow}
|
|
159
147
|
<styles.DataGridHeaderRow
|
|
160
148
|
$gridTemplateColumns={gridTemplateColumns}
|