@majapisoftwares/ui 4.1.16 → 4.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.
- package/base.css +4 -4
- package/bootstrap/AppProps.d.ts +4 -5
- package/components/Accordion/Accordion.d.ts +1 -1
- package/components/Alert/Alert.d.ts +1 -1
- package/components/Alert/Alert.jsx +19 -19
- package/components/AntiClickjacking/AntiClickjacking.d.ts +1 -0
- package/components/AntiClickjacking/AntiClickjacking.jsx +17 -0
- package/components/AntiClickjacking/index.d.ts +2 -0
- package/components/AntiClickjacking/index.jsx +2 -0
- package/components/Autocomplete/Autocomplete.d.ts +1 -1
- package/components/Autocomplete/Autocomplete.jsx +3 -3
- package/components/Autocomplete/UnstyledAutocomplete.d.ts +2 -2
- package/components/Autocomplete/UnstyledAutocomplete.jsx +23 -24
- package/components/Badge/Badge.d.ts +1 -1
- package/components/Badge/Badge.jsx +9 -9
- package/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/components/Button/Button.d.ts +2 -2
- package/components/Button/Button.jsx +5 -5
- package/components/Carousel/Carousel.d.ts +2 -2
- package/components/Carousel/Carousel.jsx +13 -13
- package/components/Checkbox/Checkbox.d.ts +1 -1
- package/components/Checkbox/Checkbox.jsx +12 -12
- package/components/Code/Code.d.ts +1 -1
- package/components/Code/Code.jsx +15 -15
- package/components/ConfirmationButton/ConfirmationButton.d.ts +3 -3
- package/components/ConfirmationButton/ConfirmationButton.jsx +10 -10
- package/components/ContextMenu/ContextMenu.d.ts +1 -1
- package/components/ContextMenu/ContextMenu.jsx +22 -22
- package/components/DateInput/DateInput.d.ts +1 -1
- package/components/DateInput/DateInput.jsx +1 -1
- package/components/DateInput/DateTimeInput.d.ts +1 -1
- package/components/DateInput/DateTimeInput.jsx +1 -1
- package/components/DateInput/useRefValue.d.ts +1 -1
- package/components/DatePicker/DatePicker.d.ts +3 -3
- package/components/DatePicker/DatePicker.jsx +8 -8
- package/components/DateRangePicker/DateRangePicker.d.ts +2 -2
- package/components/DateRangePicker/DateRangePicker.jsx +8 -8
- package/components/Dialog/Dialog.d.ts +2 -2
- package/components/Dialog/Dialog.jsx +23 -23
- package/components/Dialog/Dialogs.jsx +4 -4
- package/components/Dialog/dialogs.state.d.ts +2 -2
- package/components/Drawer/Drawer.d.ts +1 -1
- package/components/Drawer/Drawer.jsx +41 -41
- package/components/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/components/DropdownMenu/DropdownMenu.jsx +23 -23
- package/components/ErrorBoundary/ErrorBoundary.d.ts +1 -1
- package/components/ErrorBoundary/ErrorBoundary.jsx +4 -4
- package/components/ErrorPage/ErrorPage.d.ts +1 -1
- package/components/ErrorPage/ErrorPage.jsx +16 -16
- package/components/FileInput/FileInput.d.ts +4 -4
- package/components/FileInput/FileInput.jsx +2 -2
- package/components/FileInput/PreviewFile.d.ts +2 -2
- package/components/FileSelect/FileSelect.d.ts +1 -1
- package/components/FileSelect/FileSelect.jsx +16 -13
- package/components/Footer/Footer.d.ts +1 -1
- package/components/Footer/Footer.jsx +22 -22
- package/components/GridPattern/GridPattern.d.ts +1 -1
- package/components/GridPattern/GridPattern.jsx +7 -7
- package/components/Header/Header.d.ts +1 -1
- package/components/Header/Header.jsx +2 -2
- package/components/ImageInput/ImageInput.d.ts +1 -1
- package/components/Input/Input.d.ts +1 -1
- package/components/Input/Input.jsx +7 -7
- package/components/Input/InputIcon.d.ts +1 -1
- package/components/Input/MultiSelectInput.d.ts +2 -2
- package/components/Input/MultiSelectInput.jsx +15 -15
- package/components/Input/NumericInput.d.ts +3 -3
- package/components/Input/NumericInput.jsx +1 -1
- package/components/Input/PatternInput.d.ts +3 -3
- package/components/Input/PatternInput.jsx +1 -1
- package/components/Input/UnstyledInput.d.ts +1 -1
- package/components/Input/UnstyledInput.jsx +12 -12
- package/components/Input2/InputWrapper.d.ts +1 -1
- package/components/Input2/InputWrapper.jsx +7 -7
- package/components/Link/Link.d.ts +1 -1
- package/components/Magnet/Magnet.d.ts +1 -1
- package/components/Markdown/Markdown.d.ts +1 -1
- package/components/Markdown/Markdown.jsx +2 -2
- package/components/Menu/Menu.d.ts +3 -3
- package/components/Menu/Menu.jsx +19 -19
- package/components/Modal/Modal.d.ts +1 -1
- package/components/Modal/Modal.jsx +26 -26
- package/components/ModeToggle/ModeToggle.d.ts +1 -1
- package/components/ModeToggle/ModeToggle.jsx +3 -3
- package/components/MultiSelect/MultiSelect.d.ts +2 -2
- package/components/MultiSelect/MultiSelect.jsx +2 -2
- package/components/MultiSelect/MultiSelectInput.d.ts +1 -1
- package/components/MultiText/MultiText.d.ts +1 -1
- package/components/MultiText/MultiText.jsx +0 -1
- package/components/NavigationDrawer/NavigationDrawer.d.ts +1 -1
- package/components/NavigationDrawer/NavigationDrawer.jsx +11 -11
- package/components/NavigationDrawer/NavigationItem.d.ts +1 -1
- package/components/NavigationDrawer/NavigationItem.jsx +2 -2
- package/components/NoSsr/NoSsr.d.ts +1 -1
- package/components/Notifications/Notifications.jsx +29 -29
- package/components/Notifications/notifications.state.d.ts +2 -2
- package/components/Notifications/notifications.state.js +1 -1
- package/components/Pagination/Pagination.jsx +15 -15
- package/components/Particles/Particles.jsx +55 -55
- package/components/PictureCropInput/PictureCropInput.d.ts +2 -2
- package/components/PictureCropInput/PictureCropInput.jsx +39 -39
- package/components/PictureCropInput/canvasPreview.d.ts +1 -1
- package/components/Popover/Popover.d.ts +1 -1
- package/components/Popover/Popover.jsx +6 -6
- package/components/Resizable/Resizable.d.ts +1 -1
- package/components/Resizable/Resizable.jsx +4 -4
- package/components/ScrollArea/ScrollArea.d.ts +1 -1
- package/components/ScrollArea/ScrollArea.jsx +11 -11
- package/components/Select/Select.d.ts +1 -1
- package/components/Select/Select.jsx +21 -21
- package/components/Skeleton/Skeleton.d.ts +1 -1
- package/components/Skeleton/Skeleton.jsx +4 -4
- package/components/StarBorder/StarBorder.d.ts +1 -2
- package/components/StarBorder/StarBorder.jsx +1 -1
- package/components/Switch/Switch.d.ts +2 -2
- package/components/Switch/Switch.jsx +9 -9
- package/components/Table/DataTable.d.ts +1 -1
- package/components/Table/DataTable.jsx +54 -54
- package/components/Table/Table.d.ts +1 -1
- package/components/Table/Table.jsx +7 -7
- package/components/Table/TableActionButton.d.ts +2 -2
- package/components/Table/TableActionButton.jsx +3 -3
- package/components/Table/TableBody.d.ts +1 -1
- package/components/Table/TableBody.jsx +4 -4
- package/components/Table/TableCell.d.ts +1 -1
- package/components/Table/TableCell.jsx +4 -4
- package/components/Table/TableFooter.d.ts +1 -1
- package/components/Table/TableFooter.jsx +2 -2
- package/components/Table/TableHead.d.ts +1 -1
- package/components/Table/TableHead.jsx +4 -4
- package/components/Table/TableHeader.d.ts +1 -1
- package/components/Table/TableHeader.jsx +10 -10
- package/components/Table/TableRow.d.ts +1 -1
- package/components/Table/TableRow.jsx +2 -2
- package/components/Tabs/Tabs.d.ts +2 -2
- package/components/Tabs/Tabs.jsx +6 -6
- package/components/TabsSwitcher/Tab.d.ts +1 -1
- package/components/TabsSwitcher/TabsSwitcher.d.ts +1 -1
- package/components/Text/Text.d.ts +1 -1
- package/components/Text/Text.jsx +1 -0
- package/components/Textarea/Textarea.d.ts +2 -2
- package/components/Textarea/Textarea.jsx +1 -1
- package/components/Tooltip/Tooltip.d.ts +1 -1
- package/components/Tooltip/Tooltip.jsx +12 -12
- package/components/VisibilityActivatedButton/VisibilityActivatedButton.d.ts +1 -1
- package/form.d.ts +4 -4
- package/form2.d.ts +1 -1
- package/form2.jsx +1 -0
- package/hooks/useDebounceEffect.d.ts +1 -1
- package/hooks/useDebouncedValue.d.ts +1 -1
- package/hooks/useDebouncedValue.js +1 -1
- package/hooks/useLagRadar.jsx +19 -19
- package/package.json +1 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/types.d.ts +1 -1
- package/types.js +1 -1
- package/utils/UseState.d.ts +2 -3
- package/utils/csvBlobToJson.d.ts +1 -1
- package/utils/csvBlobToJson.js +0 -1
- package/utils/ms.d.ts +1 -1
- package/utils/ms.js +6 -6
- package/utils/recursiveChildrenMap.d.ts +1 -1
- package/utils/smoothScrollToHref.d.ts +1 -1
- package/utils/smoothScrollToHref.js +7 -3
- package/utils/stopPropagation.d.ts +1 -1
- package/utils/xlsxBlobToJson.d.ts +1 -1
- package/utils/xlsxBlobToJson.js +3 -0
package/types.d.ts
CHANGED
package/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import { useState } from "react";
|
package/utils/UseState.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from "react";
|
|
2
|
-
type UseState<S> = [S, Dispatch<SetStateAction<S>>];
|
|
3
|
-
export default UseState;
|
|
1
|
+
import type { Dispatch, SetStateAction } from "react";
|
|
2
|
+
export type UseState<S> = [S, Dispatch<SetStateAction<S>>];
|
package/utils/csvBlobToJson.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ChangeEvent } from "react";
|
|
1
|
+
import type { ChangeEvent } from "react";
|
|
2
2
|
export default function csvBlobToJson(event: ChangeEvent<HTMLInputElement>, encoding: "windows-1252" | "utf8"): Promise<Record<string, string>[] | null>;
|
package/utils/csvBlobToJson.js
CHANGED
|
@@ -7,7 +7,6 @@ export default async function csvBlobToJson(event, encoding) {
|
|
|
7
7
|
message: "Nenhum arquivo foi selecionado",
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11
10
|
const csv = await blobToText(event.target.files[0], encoding);
|
|
12
11
|
event.target.value = "";
|
|
13
12
|
const rows = csv.trim().split("\r\n");
|
package/utils/ms.d.ts
CHANGED
package/utils/ms.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import vms from "ms";
|
|
1
|
+
import vms, {} from "ms";
|
|
2
2
|
const locale = {
|
|
3
3
|
["en"]: {
|
|
4
4
|
day: "day",
|
|
@@ -20,12 +20,12 @@ const locale = {
|
|
|
20
20
|
},
|
|
21
21
|
};
|
|
22
22
|
export function ms(value, options) {
|
|
23
|
-
if (typeof value === "number") {
|
|
23
|
+
if (typeof value === "number" && options?.locale) {
|
|
24
24
|
return vms(value, options)
|
|
25
|
-
.replace("day", locale[String(options
|
|
26
|
-
.replace("hour", locale[String(options
|
|
27
|
-
.replace("minute", locale[String(options
|
|
28
|
-
.replace("second", locale[String(options
|
|
25
|
+
.replace("day", locale[String(options.locale)].day)
|
|
26
|
+
.replace("hour", locale[String(options.locale)].hour)
|
|
27
|
+
.replace("minute", locale[String(options.locale)].minute)
|
|
28
|
+
.replace("second", locale[String(options.locale)].second);
|
|
29
29
|
}
|
|
30
30
|
return vms(value);
|
|
31
31
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ReactElement, ReactNode } from "react";
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
2
|
export default function recursiveChildrenMap<P>(children: ReactNode, fn: (child: ReactElement<P>) => ReactElement<P>): ReactNode;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { MouseEvent } from "react";
|
|
1
|
+
import type { MouseEvent } from "react";
|
|
2
2
|
export default function smoothScrollToHref(event: MouseEvent): void;
|
|
@@ -2,9 +2,13 @@ export default function smoothScrollToHref(event) {
|
|
|
2
2
|
event.preventDefault();
|
|
3
3
|
const href = event.currentTarget.getAttribute("href");
|
|
4
4
|
if (href) {
|
|
5
|
-
const
|
|
6
|
-
if (
|
|
7
|
-
|
|
5
|
+
const targetId = href.split("#")[1];
|
|
6
|
+
if (!targetId)
|
|
7
|
+
return;
|
|
8
|
+
const target = document.getElementById(targetId);
|
|
9
|
+
if (!target) {
|
|
10
|
+
return;
|
|
8
11
|
}
|
|
12
|
+
target.scrollIntoView({ behavior: "smooth" });
|
|
9
13
|
}
|
|
10
14
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { MouseEvent, TouchEvent } from "react";
|
|
1
|
+
import type { MouseEvent, TouchEvent } from "react";
|
|
2
2
|
export default function stopPropagation(event: MouseEvent | TouchEvent): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ChangeEvent } from "react";
|
|
1
|
+
import type { ChangeEvent } from "react";
|
|
2
2
|
export default function xlsxBlobToJson(event: ChangeEvent<HTMLInputElement>): Promise<Record<string, string>[] | null | undefined>;
|
package/utils/xlsxBlobToJson.js
CHANGED
|
@@ -14,6 +14,9 @@ export default async function xlsxBlobToJson(event) {
|
|
|
14
14
|
await workbook.xlsx.load(data); // Load the workbook from the array buffer
|
|
15
15
|
// Assuming the data is in the first sheet
|
|
16
16
|
const worksheet = workbook.worksheets[0]; // Get the first worksheet
|
|
17
|
+
if (!worksheet) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
17
20
|
const jsonData = [];
|
|
18
21
|
// Convert the worksheet to JSON
|
|
19
22
|
worksheet.eachRow((row) => {
|