@povio/ui 0.0.7 → 0.0.9
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/assets/icons/Calendar.js +1 -1
- package/dist/assets/icons/CheckCircle.js +3 -3
- package/dist/assets/icons/ChevronsLeft.js +11 -22
- package/dist/assets/icons/ChevronsRight.js +11 -22
- package/dist/assets/icons/DateTime.js +13 -6
- package/dist/assets/icons/Drag.js +1 -1
- package/dist/assets/icons/File.js +1 -1
- package/dist/assets/icons/Info.js +2 -4
- package/dist/assets/icons/Menu.js +1 -3
- package/dist/assets/icons/Send.js +1 -1
- package/dist/assets/icons/Upload.js +2 -2
- package/dist/assets/icons/{Warningfilled.js → WarningFilled.js} +1 -1
- package/dist/components/Menu/MenuPopover.js +1 -1
- package/dist/components/buttons/PillButton/pillButton.cva.js +1 -1
- package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -1
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +7 -4
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +10 -4
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +7 -4
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +16 -5
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +3 -2
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +30 -23
- package/dist/components/inputs/File/FileUpload.js +1 -1
- package/dist/components/inputs/File/InputUpload.js +1 -1
- package/dist/components/inputs/File/shared/FileUploadContentError.js +1 -1
- package/dist/components/inputs/File/shared/InputUploadContent.js +10 -4
- package/dist/components/inputs/File/shared/InputUploadFilled.js +36 -22
- package/dist/components/inputs/File/shared/fileUpload.cva.js +3 -2
- package/dist/components/inputs/File/shared/inputUploadButton.cva.js +6 -5
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +3 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +8 -2
- package/dist/components/inputs/Input/TextArea/TextArea.js +6 -9
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +1 -0
- package/dist/components/inputs/Input/TextInput/TextInput.js +26 -3
- package/dist/components/inputs/Input/shared/InputContent.js +67 -59
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/SelectBase.js +2 -1
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +84 -90
- package/dist/components/inputs/Selection/shared/SelectInputTags.d.ts +11 -0
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +22 -0
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +56 -45
- package/dist/components/inputs/Selection/shared/select.context.js +1 -0
- package/dist/components/inputs/Selection/shared/select.types.d.ts +8 -0
- package/dist/components/inputs/shared/InputClear.d.ts +3 -1
- package/dist/components/inputs/shared/InputClear.js +4 -3
- package/dist/components/inputs/shared/input.cva.js +18 -17
- package/dist/components/inputs/shared/label.cva.js +2 -2
- package/dist/components/overlays/BottomSheet/BottomSheet.js +17 -12
- package/dist/components/overlays/Tooltip/Tooltip.d.ts +4 -2
- package/dist/components/overlays/Tooltip/Tooltip.js +32 -6
- package/dist/components/overlays/Tooltip/tooltip.cva.d.ts +21 -0
- package/dist/components/overlays/Tooltip/tooltip.cva.js +60 -0
- package/dist/components/segment/Segment.js +8 -2
- package/dist/components/segment/SegmentItem.js +4 -2
- package/dist/components/table/CellText.js +2 -2
- package/dist/components/table/HeaderText.js +1 -1
- package/dist/components/table/Table.js +34 -16
- package/dist/components/table/table.cva.d.ts +7 -3
- package/dist/components/table/table.cva.js +37 -11
- package/dist/config/uiConfig.context.d.ts +3 -1
- package/dist/config/uiConfig.context.js +6 -1
- package/dist/config/uiStyle.context.d.ts +2 -1
- package/dist/helpers/dynamicColumns.js +2 -2
- package/dist/helpers/dynamicInputs.d.ts +2 -0
- package/dist/helpers/dynamicInputs.js +5 -3
- package/dist/hooks/useAutosave.js +4 -1
- package/dist/hooks/useTableColumnConfig.js +5 -1
- package/dist/index.d.ts +12 -6
- package/dist/index.js +15 -11
- package/dist/utils/date-time.utils.js +12 -12
- package/dist/utils/dom.utils.js +2 -2
- package/dist/utils/file.utils.js +1 -1
- package/dist/utils/isEqual.js +2 -1
- package/dist/utils/object.utils.js +2 -2
- package/dist/utils/{rest/rest.utils.js → rest.utils.js} +1 -1
- package/dist/utils/vendor/acl/AclGuard.d.ts +8 -0
- package/dist/utils/vendor/acl/AclGuard.js +15 -0
- package/dist/utils/vendor/acl/Can.d.ts +9 -0
- package/dist/utils/vendor/acl/Can.js +18 -0
- package/dist/utils/vendor/acl/ability.context.d.ts +15 -0
- package/dist/utils/vendor/acl/ability.context.js +37 -0
- package/dist/utils/vendor/acl/appAbility.types.d.ts +3 -0
- package/dist/utils/vendor/auth/AuthGuard.d.ts +6 -0
- package/dist/utils/vendor/auth/AuthGuard.js +26 -0
- package/dist/utils/vendor/auth/auth.context.d.ts +21 -0
- package/dist/utils/vendor/auth/auth.context.js +36 -0
- package/dist/utils/vendor/auth/withPrivateAuthGuard.d.ts +6 -0
- package/dist/utils/vendor/auth/withPrivateAuthGuard.js +17 -0
- package/dist/utils/vendor/error-handling.js +1 -1
- package/dist/utils/{rest/rest-client.d.ts → vendor/rest-client.types.d.ts} +8 -14
- package/dist/utils/zod.utils.d.ts +2 -1
- package/package.json +2 -2
- package/dist/hooks/useSingletonMutation.d.ts +0 -4
- package/dist/hooks/useSingletonMutation.js +0 -27
- package/dist/utils/rest/interceptors/logging.interceptor.d.ts +0 -2
- package/dist/utils/rest/interceptors/logging.interceptor.js +0 -17
- package/dist/utils/rest/interceptors/response.interceptor.d.ts +0 -2
- package/dist/utils/rest/interceptors/response.interceptor.js +0 -25
- package/dist/utils/rest/rest-client.js +0 -62
- /package/dist/assets/icons/{Warningfilled.d.ts → WarningFilled.d.ts} +0 -0
- /package/dist/utils/{rest/rest.utils.d.ts → rest.utils.d.ts} +0 -0
- /package/dist/utils/{rest/interceptors → vendor}/rest-interceptor.d.ts +0 -0
- /package/dist/utils/{rest/interceptors → vendor}/rest-interceptor.js +0 -0
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { LoggingInterceptor } from "./interceptors/logging.interceptor.js";
|
|
4
|
-
import { ResponseInterceptor } from "./interceptors/response.interceptor.js";
|
|
5
|
-
import { SharedErrorHandler } from "../vendor/error-handling.js";
|
|
6
|
-
class RestClient {
|
|
7
|
-
constructor({
|
|
8
|
-
config,
|
|
9
|
-
interceptors
|
|
10
|
-
} = {}) {
|
|
11
|
-
this.client = axios.create(config);
|
|
12
|
-
const defaultInterceptors = [LoggingInterceptor, ResponseInterceptor];
|
|
13
|
-
this.attachInterceptors(defaultInterceptors);
|
|
14
|
-
this.attachInterceptors(interceptors);
|
|
15
|
-
}
|
|
16
|
-
attachInterceptors(interceptors, ...args) {
|
|
17
|
-
if (interceptors != null) {
|
|
18
|
-
interceptors.forEach((interceptor) => this.attachInterceptor(interceptor, ...args));
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
attachInterceptor(interceptor, ...args) {
|
|
22
|
-
interceptor.addInterceptor(this.client, ...args);
|
|
23
|
-
}
|
|
24
|
-
ejectInterceptor(interceptor) {
|
|
25
|
-
interceptor.removeInterceptor(this.client);
|
|
26
|
-
}
|
|
27
|
-
async get(requestInfo, url, requestConfig) {
|
|
28
|
-
return this.makeRequest(requestInfo, { ...requestConfig, method: "get", url });
|
|
29
|
-
}
|
|
30
|
-
async post(requestInfo, url, data, requestConfig) {
|
|
31
|
-
return this.makeRequest(requestInfo, { ...requestConfig, method: "post", url, data });
|
|
32
|
-
}
|
|
33
|
-
async patch(requestInfo, url, data, requestConfig) {
|
|
34
|
-
return this.makeRequest(requestInfo, { ...requestConfig, method: "patch", url, data });
|
|
35
|
-
}
|
|
36
|
-
async put(requestInfo, url, data, requestConfig) {
|
|
37
|
-
return this.makeRequest(requestInfo, { ...requestConfig, method: "put", url, data });
|
|
38
|
-
}
|
|
39
|
-
async delete(requestInfo, url, data, requestConfig) {
|
|
40
|
-
return this.makeRequest(requestInfo, { ...requestConfig, method: "delete", url, data });
|
|
41
|
-
}
|
|
42
|
-
async makeRequest(requestInfo, requestConfig) {
|
|
43
|
-
const errorStack = new Error().stack;
|
|
44
|
-
try {
|
|
45
|
-
const { rawResponse, ...config } = requestConfig;
|
|
46
|
-
const res = await this.client(config);
|
|
47
|
-
const resData = requestInfo.resSchema.parse(res.data);
|
|
48
|
-
return rawResponse ? { ...res, data: resData } : resData;
|
|
49
|
-
} catch (e) {
|
|
50
|
-
if (e instanceof z.ZodError) {
|
|
51
|
-
e.name = "BE Response schema mismatch - ZodError";
|
|
52
|
-
e.stack = [e.stack, ...errorStack?.split("\n").slice(2) ?? []].join("\n");
|
|
53
|
-
}
|
|
54
|
-
const errorHandler = requestInfo.errorHandler ?? SharedErrorHandler;
|
|
55
|
-
errorHandler.rethrowError(e);
|
|
56
|
-
throw e;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
export {
|
|
61
|
-
RestClient
|
|
62
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|