eai-frontend-components 2.0.13 → 2.0.15
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/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +13 -0
- package/dist/components/ui/alert-dialog.d.ts +25 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +27 -0
- package/dist/components/ui/alert.d.ts +9 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +22 -0
- package/dist/components/ui/avatar.d.ts +7 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +11 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +26 -0
- package/dist/components/ui/breadcrumb.d.ts +20 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.js +23 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +33 -0
- package/dist/components/ui/calendar.d.ts +9 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/calendar.js +70 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +16 -0
- package/dist/components/ui/carousel.d.ts +19 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel.js +98 -0
- package/dist/components/ui/chart.d.ts +63 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/chart.js +132 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +8 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +5 -0
- package/dist/components/ui/command.d.ts +81 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/command.js +28 -0
- package/dist/components/ui/context-menu.d.ts +28 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/context-menu.js +33 -0
- package/dist/components/ui/custom/date-picker.d.ts +12 -0
- package/dist/components/ui/custom/date-picker.d.ts.map +1 -0
- package/dist/components/ui/custom/date-picker.js +35 -0
- package/dist/components/ui/custom/form/checkbox.d.ts +13 -0
- package/dist/components/ui/custom/form/checkbox.d.ts.map +1 -0
- package/dist/components/ui/custom/form/checkbox.js +15 -0
- package/dist/components/ui/custom/form/color.d.ts +15 -0
- package/dist/components/ui/custom/form/color.d.ts.map +1 -0
- package/dist/components/ui/custom/form/color.js +40 -0
- package/dist/components/ui/custom/form/combobox.d.ts +37 -0
- package/dist/components/ui/custom/form/combobox.d.ts.map +1 -0
- package/dist/components/ui/custom/form/combobox.js +82 -0
- package/dist/components/ui/custom/form/cpf-cnpj.d.ts +16 -0
- package/dist/components/ui/custom/form/cpf-cnpj.d.ts.map +1 -0
- package/dist/components/ui/custom/form/cpf-cnpj.js +32 -0
- package/dist/components/ui/custom/form/currency.d.ts +14 -0
- package/dist/components/ui/custom/form/currency.d.ts.map +1 -0
- package/dist/components/ui/custom/form/currency.js +15 -0
- package/dist/components/ui/custom/form/date-range.d.ts +16 -0
- package/dist/components/ui/custom/form/date-range.d.ts.map +1 -0
- package/dist/components/ui/custom/form/date-range.js +24 -0
- package/dist/components/ui/custom/form/date.d.ts +16 -0
- package/dist/components/ui/custom/form/date.d.ts.map +1 -0
- package/dist/components/ui/custom/form/date.js +35 -0
- package/dist/components/ui/custom/form/decimal.d.ts +14 -0
- package/dist/components/ui/custom/form/decimal.d.ts.map +1 -0
- package/dist/components/ui/custom/form/decimal.js +15 -0
- package/dist/components/ui/custom/form/file.d.ts +15 -0
- package/dist/components/ui/custom/form/file.d.ts.map +1 -0
- package/dist/components/ui/custom/form/file.js +18 -0
- package/dist/components/ui/custom/form/form-help-text.d.ts +3 -0
- package/dist/components/ui/custom/form/form-help-text.d.ts.map +1 -0
- package/dist/components/ui/custom/form/form-help-text.js +7 -0
- package/dist/components/ui/custom/form/form-label.d.ts +7 -0
- package/dist/components/ui/custom/form/form-label.d.ts.map +1 -0
- package/dist/components/ui/custom/form/form-label.js +9 -0
- package/dist/components/ui/custom/form/form-message.d.ts +5 -0
- package/dist/components/ui/custom/form/form-message.d.ts.map +1 -0
- package/dist/components/ui/custom/form/form-message.js +5 -0
- package/dist/components/ui/custom/form/ghost.d.ts +8 -0
- package/dist/components/ui/custom/form/ghost.d.ts.map +1 -0
- package/dist/components/ui/custom/form/ghost.js +8 -0
- package/dist/components/ui/custom/form/input.d.ts +18 -0
- package/dist/components/ui/custom/form/input.d.ts.map +1 -0
- package/dist/components/ui/custom/form/input.js +14 -0
- package/dist/components/ui/custom/form/mask.d.ts +19 -0
- package/dist/components/ui/custom/form/mask.d.ts.map +1 -0
- package/dist/components/ui/custom/form/mask.js +19 -0
- package/dist/components/ui/custom/form/multi-select.d.ts +26 -0
- package/dist/components/ui/custom/form/multi-select.d.ts.map +1 -0
- package/dist/components/ui/custom/form/multi-select.js +66 -0
- package/dist/components/ui/custom/form/password.d.ts +16 -0
- package/dist/components/ui/custom/form/password.d.ts.map +1 -0
- package/dist/components/ui/custom/form/password.js +14 -0
- package/dist/components/ui/custom/form/percent.d.ts +14 -0
- package/dist/components/ui/custom/form/percent.d.ts.map +1 -0
- package/dist/components/ui/custom/form/percent.js +15 -0
- package/dist/components/ui/custom/form/phone.d.ts +16 -0
- package/dist/components/ui/custom/form/phone.d.ts.map +1 -0
- package/dist/components/ui/custom/form/phone.js +23 -0
- package/dist/components/ui/custom/form/radio-group.d.ts +23 -0
- package/dist/components/ui/custom/form/radio-group.d.ts.map +1 -0
- package/dist/components/ui/custom/form/radio-group.js +15 -0
- package/dist/components/ui/custom/form/select.d.ts +20 -0
- package/dist/components/ui/custom/form/select.d.ts.map +1 -0
- package/dist/components/ui/custom/form/select.js +12 -0
- package/dist/components/ui/custom/form/step-new-form.d.ts +10 -0
- package/dist/components/ui/custom/form/step-new-form.d.ts.map +1 -0
- package/dist/components/ui/custom/form/step-new-form.js +13 -0
- package/dist/components/ui/custom/form/switch.d.ts +13 -0
- package/dist/components/ui/custom/form/switch.d.ts.map +1 -0
- package/dist/components/ui/custom/form/switch.js +16 -0
- package/dist/components/ui/custom/form/text.d.ts +18 -0
- package/dist/components/ui/custom/form/text.d.ts.map +1 -0
- package/dist/components/ui/custom/form/text.js +14 -0
- package/dist/components/ui/custom/form/textarea.d.ts +16 -0
- package/dist/components/ui/custom/form/textarea.d.ts.map +1 -0
- package/dist/components/ui/custom/form/textarea.js +19 -0
- package/dist/components/ui/custom/form/utils.d.ts +18 -0
- package/dist/components/ui/custom/form/utils.d.ts.map +1 -0
- package/dist/components/ui/custom/form/utils.js +88 -0
- package/dist/components/ui/custom/header.d.ts +11 -0
- package/dist/components/ui/custom/header.d.ts.map +1 -0
- package/dist/components/ui/custom/header.js +74 -0
- package/dist/components/ui/custom/label.d.ts +13 -0
- package/dist/components/ui/custom/label.d.ts.map +1 -0
- package/dist/components/ui/custom/label.js +20 -0
- package/dist/components/ui/custom/not-found.d.ts +3 -0
- package/dist/components/ui/custom/not-found.d.ts.map +1 -0
- package/dist/components/ui/custom/not-found.js +9 -0
- package/dist/components/ui/custom/sidebar/module-switcher.d.ts +9 -0
- package/dist/components/ui/custom/sidebar/module-switcher.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/module-switcher.js +20 -0
- package/dist/components/ui/custom/sidebar/nav-footer.d.ts +7 -0
- package/dist/components/ui/custom/sidebar/nav-footer.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/nav-footer.js +13 -0
- package/dist/components/ui/custom/sidebar/nav-main.d.ts +7 -0
- package/dist/components/ui/custom/sidebar/nav-main.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/nav-main.js +27 -0
- package/dist/components/ui/custom/sidebar/nav-submenu-collapsible.d.ts +9 -0
- package/dist/components/ui/custom/sidebar/nav-submenu-collapsible.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/nav-submenu-collapsible.js +18 -0
- package/dist/components/ui/custom/sidebar/nav-submenu-dropdown.d.ts +10 -0
- package/dist/components/ui/custom/sidebar/nav-submenu-dropdown.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/nav-submenu-dropdown.js +10 -0
- package/dist/components/ui/custom/sidebar/nav-user.d.ts +9 -0
- package/dist/components/ui/custom/sidebar/nav-user.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/nav-user.js +24 -0
- package/dist/components/ui/custom/sidebar/sidebar-button.d.ts +9 -0
- package/dist/components/ui/custom/sidebar/sidebar-button.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/sidebar-button.js +7 -0
- package/dist/components/ui/custom/sidebar/sidebar-item-two-lines.d.ts +12 -0
- package/dist/components/ui/custom/sidebar/sidebar-item-two-lines.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/sidebar-item-two-lines.js +5 -0
- package/dist/components/ui/custom/sidebar/sidebar-item.d.ts +9 -0
- package/dist/components/ui/custom/sidebar/sidebar-item.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/sidebar-item.js +7 -0
- package/dist/components/ui/custom/sidebar/types/sidebar.d.ts +29 -0
- package/dist/components/ui/custom/sidebar/types/sidebar.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/types/sidebar.js +5 -0
- package/dist/components/ui/custom/table/data-table-export.d.ts +8 -0
- package/dist/components/ui/custom/table/data-table-export.d.ts.map +1 -0
- package/dist/components/ui/custom/table/data-table-export.js +65 -0
- package/dist/components/ui/custom/table/data-table-footer.d.ts +25 -0
- package/dist/components/ui/custom/table/data-table-footer.d.ts.map +1 -0
- package/dist/components/ui/custom/table/data-table-footer.js +39 -0
- package/dist/components/ui/custom/table/data-table-header.d.ts +9 -0
- package/dist/components/ui/custom/table/data-table-header.d.ts.map +1 -0
- package/dist/components/ui/custom/table/data-table-header.js +11 -0
- package/dist/components/ui/custom/table/data-table-rows.d.ts +13 -0
- package/dist/components/ui/custom/table/data-table-rows.d.ts.map +1 -0
- package/dist/components/ui/custom/table/data-table-rows.js +25 -0
- package/dist/components/ui/custom/table/data-table.d.ts +35 -0
- package/dist/components/ui/custom/table/data-table.d.ts.map +1 -0
- package/dist/components/ui/custom/table/data-table.js +99 -0
- package/dist/components/ui/custom/table/types/data-table.d.ts +29 -0
- package/dist/components/ui/custom/table/types/data-table.d.ts.map +1 -0
- package/dist/components/ui/custom/table/types/data-table.js +1 -0
- package/dist/components/ui/custom/theme-provider.d.ts +24 -0
- package/dist/components/ui/custom/theme-provider.d.ts.map +1 -0
- package/dist/components/ui/custom/theme-provider.js +79 -0
- package/dist/components/ui/dateRangePicker.d.ts +3 -0
- package/dist/components/ui/dateRangePicker.d.ts.map +1 -0
- package/dist/components/ui/dateRangePicker.js +15 -0
- package/dist/components/ui/dialog.d.ts +23 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +23 -0
- package/dist/components/ui/drawer.d.ts +23 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/drawer.js +22 -0
- package/dist/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +32 -0
- package/dist/components/ui/form.d.ts +24 -0
- package/dist/components/ui/form.d.ts.map +1 -0
- package/dist/components/ui/form.js +60 -0
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/hover-card.js +9 -0
- package/dist/components/ui/input.d.ts +24 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +71 -0
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +9 -0
- package/dist/components/ui/masks.d.ts +17 -0
- package/dist/components/ui/masks.d.ts.map +1 -0
- package/dist/components/ui/masks.js +25 -0
- package/dist/components/ui/pagination.d.ts +30 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/pagination.js +23 -0
- package/dist/components/ui/popover.d.ts +7 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +11 -0
- package/dist/components/ui/progress.d.ts +5 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +7 -0
- package/dist/components/ui/radio-group.d.ts +6 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +14 -0
- package/dist/components/ui/scroll-area.d.ts +6 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +11 -0
- package/dist/components/ui/select.d.ts +14 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +24 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +7 -0
- package/dist/components/ui/sheet.d.ts +26 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.js +37 -0
- package/dist/components/ui/sidebar.d.ts +67 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/sidebar.js +221 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +6 -0
- package/dist/components/ui/slider.d.ts +5 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/slider.js +7 -0
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +7 -0
- package/dist/components/ui/table.d.ts +11 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +20 -0
- package/dist/components/ui/tabs.d.ts +8 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +12 -0
- package/dist/components/ui/textarea.d.ts +4 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +14 -0
- package/dist/components/ui/toast.d.ts +16 -0
- package/dist/components/ui/toast.d.ts.map +1 -0
- package/dist/components/ui/toast.js +34 -0
- package/dist/components/ui/toaster.d.ts +2 -0
- package/dist/components/ui/toaster.d.ts.map +1 -0
- package/dist/components/ui/toaster.js +21 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +10 -0
- package/dist/components/ui/use-calendar.d.ts +7 -0
- package/dist/components/ui/use-calendar.d.ts.map +1 -0
- package/dist/components/ui/use-calendar.js +23 -0
- package/dist/components/ui/use-toast.d.ts +46 -0
- package/dist/components/ui/use-toast.d.ts.map +1 -0
- package/dist/components/ui/use-toast.js +125 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/index.d.ts +9 -9
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +7 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/lib/help/date-utils.d.ts +7 -0
- package/dist/lib/help/date-utils.d.ts.map +1 -0
- package/dist/lib/help/date-utils.js +34 -0
- package/dist/lib/help/format.d.ts +22 -0
- package/dist/lib/help/format.d.ts.map +1 -0
- package/dist/lib/help/format.js +140 -0
- package/dist/lib/help/theme.d.ts +291 -0
- package/dist/lib/help/theme.d.ts.map +1 -0
- package/dist/lib/help/theme.js +340 -0
- package/dist/lib/help/uuid.d.ts +2 -0
- package/dist/lib/help/uuid.d.ts.map +1 -0
- package/dist/lib/help/uuid.js +4 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const getFirstDayOfCurrentMonth: () => Date;
|
|
2
|
+
export declare const getFirstDayOf90DaysAgo: () => Date;
|
|
3
|
+
export declare const stringToDate: (dateString: string, separator?: string) => Date | undefined;
|
|
4
|
+
export declare const aYearAgo: () => Date;
|
|
5
|
+
export declare const invertDate: (date: string, separator?: string) => string;
|
|
6
|
+
export declare const addDaysToToday: (days: number) => Date;
|
|
7
|
+
//# sourceMappingURL=date-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/help/date-utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,QAAO,IAG5C,CAAC;AAEF,eAAO,MAAM,sBAAsB,QAAO,IAGzC,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,YAAY,MAAM,EAAE,YAAW,MAAY,KAAG,IAAI,GAAG,SAWjF,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAO,IAK3B,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,EAAE,YAAW,MAAY,KAAG,MAIlE,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,IAI7C,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const getFirstDayOfCurrentMonth = () => {
|
|
2
|
+
const now = new Date();
|
|
3
|
+
return new Date(now.getFullYear(), now.getMonth(), 1);
|
|
4
|
+
};
|
|
5
|
+
export const getFirstDayOf90DaysAgo = () => {
|
|
6
|
+
const now = new Date();
|
|
7
|
+
return new Date(now.getFullYear(), now.getMonth() - 3, 1);
|
|
8
|
+
};
|
|
9
|
+
export const stringToDate = (dateString, separator = '/') => {
|
|
10
|
+
if (!dateString)
|
|
11
|
+
return undefined;
|
|
12
|
+
const dateParts = dateString.split(separator);
|
|
13
|
+
if (dateParts.length !== 3)
|
|
14
|
+
return undefined;
|
|
15
|
+
const day = parseInt(dateParts[0], 10);
|
|
16
|
+
const month = parseInt(dateParts[1], 10) - 1; // Months are zero-based in JavaScript
|
|
17
|
+
const year = parseInt(dateParts[2], 10);
|
|
18
|
+
return new Date(year, month, day);
|
|
19
|
+
};
|
|
20
|
+
export const aYearAgo = () => {
|
|
21
|
+
const aYearAgo = new Date();
|
|
22
|
+
aYearAgo.setFullYear(aYearAgo.getFullYear() - 1);
|
|
23
|
+
return aYearAgo;
|
|
24
|
+
};
|
|
25
|
+
export const invertDate = (date, separator = '/') => {
|
|
26
|
+
if (!date)
|
|
27
|
+
return '';
|
|
28
|
+
return date.split(separator).reverse().join('-');
|
|
29
|
+
};
|
|
30
|
+
export const addDaysToToday = (days) => {
|
|
31
|
+
const date = new Date();
|
|
32
|
+
date.setDate(date.getDate() + days);
|
|
33
|
+
return date;
|
|
34
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare function formatPhone(telefone: string, removerCountryCode?: boolean): string;
|
|
2
|
+
export declare function formatCpfCnpj(cpfCnpj?: string): string;
|
|
3
|
+
export declare const formatDate: (date: string | Date | undefined, separator?: string) => string;
|
|
4
|
+
export declare const formatDateTime: (date: Date | undefined, returnSeconds?: boolean) => string;
|
|
5
|
+
export declare function formatDateCalendar(date: Date | undefined): string;
|
|
6
|
+
export declare function stringDateToDate(date: string | undefined, separator?: string): Date | undefined;
|
|
7
|
+
export declare const roundNumber: (value: number, fractionDigits?: number) => number;
|
|
8
|
+
export declare const stringToNumber: (value: string | undefined) => number;
|
|
9
|
+
export declare const convertMbToGb: (value: number) => number;
|
|
10
|
+
export declare const convertGbToMb: (value: number) => number;
|
|
11
|
+
export declare const convertSecondsToMinutes: (value: number) => number;
|
|
12
|
+
export declare const convertBytesToMB: (bytes: number) => number;
|
|
13
|
+
export declare const convertMonthToDays: (months: number) => number;
|
|
14
|
+
export declare const convertDaysToMonth: (days: number) => number;
|
|
15
|
+
export declare const formatNumber: (value: number) => string;
|
|
16
|
+
export declare const formatDecimal: (value: number, decimalPlaces?: number) => string;
|
|
17
|
+
export declare const formatPercent: (value: number, decimalPlaces?: number) => string;
|
|
18
|
+
export declare const formatCurrency: (value: number, decimalPlaces?: number) => string;
|
|
19
|
+
export declare const isInvalidCurrencyValue: (rawValue: string | undefined) => boolean;
|
|
20
|
+
export declare function formatMsisdn(value?: string): string;
|
|
21
|
+
export declare function formatCEP(cep?: string): string;
|
|
22
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/lib/help/format.ts"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,kBAAkB,UAAO,UAWtE;AAGD,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAMtD;AAeD,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,YAAW,MAAY,WAMlF,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,MAAM,IAAI,GAAG,SAAS,EAAE,gBAAe,OAAe,KAAG,MAQvF,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,MAAM,CAQjE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,GAAE,MAAY,GAAG,IAAI,GAAG,SAAS,CAOpG;AAGD,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,EAAE,iBAAgB,MAAU,KAAG,MAEvE,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,GAAG,SAAS,KAAG,MAQ1D,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,WAE1C,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,WAE1C,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,OAAO,MAAM,KAAG,MAEvD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,KAAG,MAGhD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,QAAQ,MAAM,KAAG,MAEnD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,KAAG,MAEjD,CAAC;AAGF,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,WAMzC,CAAC;AAGF,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,EAAE,gBAAe,MAAU,WAMrE,CAAC;AAGF,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,EAAE,gBAAe,MAAU,WAErE,CAAC;AAGF,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,EAAE,gBAAe,MAAU,WAOtE,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,UAAU,MAAM,GAAG,SAAS,KAAG,OAMrE,CAAC;AAGF,wBAAgB,YAAY,CAAC,KAAK,GAAE,MAAW,GAAG,MAAM,CAGvD;AAED,wBAAgB,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,UAOrC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { maskCpfCnpj, maskPhone } from "@/components/ui/masks";
|
|
2
|
+
import { format } from '@react-input/mask';
|
|
3
|
+
// PHONE
|
|
4
|
+
export function formatPhone(telefone, removerCountryCode = true) {
|
|
5
|
+
if (!telefone)
|
|
6
|
+
return '';
|
|
7
|
+
let numberPhone = telefone.replace(/\D/g, '');
|
|
8
|
+
// Remover código do país apenas se ele começar com '55'
|
|
9
|
+
if (removerCountryCode && numberPhone.startsWith('55')) {
|
|
10
|
+
numberPhone = numberPhone.substring(2);
|
|
11
|
+
}
|
|
12
|
+
return format(numberPhone, maskPhone(numberPhone));
|
|
13
|
+
}
|
|
14
|
+
// CPF/CNPJ
|
|
15
|
+
export function formatCpfCnpj(cpfCnpj) {
|
|
16
|
+
if (!cpfCnpj)
|
|
17
|
+
return '';
|
|
18
|
+
const numberCpfCnpj = cpfCnpj.replace(/\D/g, '');
|
|
19
|
+
return format(numberCpfCnpj, maskCpfCnpj(numberCpfCnpj));
|
|
20
|
+
}
|
|
21
|
+
// DATE
|
|
22
|
+
function getDay(date) {
|
|
23
|
+
return date.getDate().toString().padStart(2, '0');
|
|
24
|
+
}
|
|
25
|
+
function getMonth(date) {
|
|
26
|
+
return (date.getMonth() + 1).toString().padStart(2, '0');
|
|
27
|
+
}
|
|
28
|
+
function getYear(date) {
|
|
29
|
+
return date.getFullYear().toString();
|
|
30
|
+
}
|
|
31
|
+
export const formatDate = (date, separator = '/') => {
|
|
32
|
+
if (!date)
|
|
33
|
+
return '';
|
|
34
|
+
const d = new Date(date);
|
|
35
|
+
return d.toLocaleDateString('pt-BR');
|
|
36
|
+
};
|
|
37
|
+
export const formatDateTime = (date, returnSeconds = false) => {
|
|
38
|
+
if (!date)
|
|
39
|
+
return '';
|
|
40
|
+
const hours = date.getHours().toString().padStart(2, '0');
|
|
41
|
+
const minutes = date.getMinutes().toString().padStart(2, '0');
|
|
42
|
+
const seconds = returnSeconds ? `:${date.getSeconds().toString().padStart(2, '0')}` : '';
|
|
43
|
+
return `${formatDate(date)} ${hours}:${minutes}${seconds}`;
|
|
44
|
+
};
|
|
45
|
+
export function formatDateCalendar(date) {
|
|
46
|
+
if (!date)
|
|
47
|
+
return '';
|
|
48
|
+
const day = getDay(date);
|
|
49
|
+
const month = getMonth(date);
|
|
50
|
+
const year = getYear(date);
|
|
51
|
+
return `${year}-${month}-${day}`;
|
|
52
|
+
}
|
|
53
|
+
export function stringDateToDate(date, separator = '/') {
|
|
54
|
+
if (!date)
|
|
55
|
+
return undefined;
|
|
56
|
+
const [day, month, year] = date.split(separator).map(Number);
|
|
57
|
+
// new Date(ano, mês-1, dia) interpreta a data no fuso horário local
|
|
58
|
+
return new Date(year, month - 1, day);
|
|
59
|
+
}
|
|
60
|
+
// NUMBER
|
|
61
|
+
export const roundNumber = (value, fractionDigits = 2) => {
|
|
62
|
+
return Number(value.toFixed(fractionDigits));
|
|
63
|
+
};
|
|
64
|
+
export const stringToNumber = (value) => {
|
|
65
|
+
if (!value)
|
|
66
|
+
return 0;
|
|
67
|
+
const numericValue = value
|
|
68
|
+
.replace(/[^\d,-]/g, '')
|
|
69
|
+
.replace(/\./g, '')
|
|
70
|
+
.replace(',', '.');
|
|
71
|
+
return Number.parseFloat(numericValue);
|
|
72
|
+
};
|
|
73
|
+
export const convertMbToGb = (value) => {
|
|
74
|
+
return value > 0 ? roundNumber(value / 1024) : 0;
|
|
75
|
+
};
|
|
76
|
+
export const convertGbToMb = (value) => {
|
|
77
|
+
return value > 0 ? roundNumber(value * 1024) : 0;
|
|
78
|
+
};
|
|
79
|
+
export const convertSecondsToMinutes = (value) => {
|
|
80
|
+
return value > 0 ? roundNumber(value / 60) : 0;
|
|
81
|
+
};
|
|
82
|
+
export const convertBytesToMB = (bytes) => {
|
|
83
|
+
if (!bytes || Number.isNaN(bytes))
|
|
84
|
+
return 0;
|
|
85
|
+
return roundNumber(bytes / (1024 * 1024));
|
|
86
|
+
};
|
|
87
|
+
export const convertMonthToDays = (months) => {
|
|
88
|
+
return months > 0 ? months * 30 : 0;
|
|
89
|
+
};
|
|
90
|
+
export const convertDaysToMonth = (days) => {
|
|
91
|
+
return days > 0 ? roundNumber(days / 30) : 0;
|
|
92
|
+
};
|
|
93
|
+
// NUMBER
|
|
94
|
+
export const formatNumber = (value) => {
|
|
95
|
+
return value.toLocaleString('pt-BR', {
|
|
96
|
+
style: 'decimal',
|
|
97
|
+
minimumFractionDigits: 0,
|
|
98
|
+
maximumFractionDigits: 0,
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
// DECIMAL
|
|
102
|
+
export const formatDecimal = (value, decimalPlaces = 2) => {
|
|
103
|
+
return value.toLocaleString('pt-BR', {
|
|
104
|
+
style: 'decimal',
|
|
105
|
+
minimumFractionDigits: decimalPlaces,
|
|
106
|
+
maximumFractionDigits: decimalPlaces,
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
// PERCENT
|
|
110
|
+
export const formatPercent = (value, decimalPlaces = 2) => {
|
|
111
|
+
return `% ${formatDecimal(value, decimalPlaces)}`;
|
|
112
|
+
};
|
|
113
|
+
// CURRENCY
|
|
114
|
+
export const formatCurrency = (value, decimalPlaces = 2) => {
|
|
115
|
+
return value.toLocaleString('pt-BR', {
|
|
116
|
+
style: 'currency',
|
|
117
|
+
currency: 'BRL',
|
|
118
|
+
minimumFractionDigits: decimalPlaces,
|
|
119
|
+
maximumFractionDigits: decimalPlaces,
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
export const isInvalidCurrencyValue = (rawValue) => {
|
|
123
|
+
if (!rawValue || rawValue.trim() === '')
|
|
124
|
+
return true;
|
|
125
|
+
const numericValue = stringToNumber(rawValue);
|
|
126
|
+
return Number.isNaN(numericValue) || numericValue <= 0;
|
|
127
|
+
};
|
|
128
|
+
// OTHERS
|
|
129
|
+
export function formatMsisdn(value = '') {
|
|
130
|
+
const msisdn = value.replace(/\D/g, '');
|
|
131
|
+
return `(${msisdn.slice(2, 4)}) ${msisdn.slice(4, 9)}-${msisdn.slice(9)}`;
|
|
132
|
+
}
|
|
133
|
+
export function formatCEP(cep) {
|
|
134
|
+
if (!cep)
|
|
135
|
+
return '';
|
|
136
|
+
return cep
|
|
137
|
+
.replace(/\D/g, '')
|
|
138
|
+
.replace(/(\d{5})(\d)/, '$1-$2')
|
|
139
|
+
.replace(/(-\d{3})\d+?$/, '$1');
|
|
140
|
+
}
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
export declare function getTailwindColorShades(): {
|
|
2
|
+
slate: {
|
|
3
|
+
50: string;
|
|
4
|
+
100: string;
|
|
5
|
+
200: string;
|
|
6
|
+
300: string;
|
|
7
|
+
400: string;
|
|
8
|
+
500: string;
|
|
9
|
+
600: string;
|
|
10
|
+
700: string;
|
|
11
|
+
800: string;
|
|
12
|
+
900: string;
|
|
13
|
+
950: string;
|
|
14
|
+
};
|
|
15
|
+
gray: {
|
|
16
|
+
50: string;
|
|
17
|
+
100: string;
|
|
18
|
+
200: string;
|
|
19
|
+
300: string;
|
|
20
|
+
400: string;
|
|
21
|
+
500: string;
|
|
22
|
+
600: string;
|
|
23
|
+
700: string;
|
|
24
|
+
800: string;
|
|
25
|
+
900: string;
|
|
26
|
+
950: string;
|
|
27
|
+
};
|
|
28
|
+
zinc: {
|
|
29
|
+
50: string;
|
|
30
|
+
100: string;
|
|
31
|
+
200: string;
|
|
32
|
+
300: string;
|
|
33
|
+
400: string;
|
|
34
|
+
500: string;
|
|
35
|
+
600: string;
|
|
36
|
+
700: string;
|
|
37
|
+
800: string;
|
|
38
|
+
900: string;
|
|
39
|
+
950: string;
|
|
40
|
+
};
|
|
41
|
+
neutral: {
|
|
42
|
+
50: string;
|
|
43
|
+
100: string;
|
|
44
|
+
200: string;
|
|
45
|
+
300: string;
|
|
46
|
+
400: string;
|
|
47
|
+
500: string;
|
|
48
|
+
600: string;
|
|
49
|
+
700: string;
|
|
50
|
+
800: string;
|
|
51
|
+
900: string;
|
|
52
|
+
950: string;
|
|
53
|
+
};
|
|
54
|
+
stone: {
|
|
55
|
+
50: string;
|
|
56
|
+
100: string;
|
|
57
|
+
200: string;
|
|
58
|
+
300: string;
|
|
59
|
+
400: string;
|
|
60
|
+
500: string;
|
|
61
|
+
600: string;
|
|
62
|
+
700: string;
|
|
63
|
+
800: string;
|
|
64
|
+
900: string;
|
|
65
|
+
950: string;
|
|
66
|
+
};
|
|
67
|
+
red: {
|
|
68
|
+
50: string;
|
|
69
|
+
100: string;
|
|
70
|
+
200: string;
|
|
71
|
+
300: string;
|
|
72
|
+
400: string;
|
|
73
|
+
500: string;
|
|
74
|
+
600: string;
|
|
75
|
+
700: string;
|
|
76
|
+
800: string;
|
|
77
|
+
900: string;
|
|
78
|
+
950: string;
|
|
79
|
+
};
|
|
80
|
+
orange: {
|
|
81
|
+
50: string;
|
|
82
|
+
100: string;
|
|
83
|
+
200: string;
|
|
84
|
+
300: string;
|
|
85
|
+
400: string;
|
|
86
|
+
500: string;
|
|
87
|
+
600: string;
|
|
88
|
+
700: string;
|
|
89
|
+
800: string;
|
|
90
|
+
900: string;
|
|
91
|
+
950: string;
|
|
92
|
+
};
|
|
93
|
+
amber: {
|
|
94
|
+
50: string;
|
|
95
|
+
100: string;
|
|
96
|
+
200: string;
|
|
97
|
+
300: string;
|
|
98
|
+
400: string;
|
|
99
|
+
500: string;
|
|
100
|
+
600: string;
|
|
101
|
+
700: string;
|
|
102
|
+
800: string;
|
|
103
|
+
900: string;
|
|
104
|
+
950: string;
|
|
105
|
+
};
|
|
106
|
+
yellow: {
|
|
107
|
+
50: string;
|
|
108
|
+
100: string;
|
|
109
|
+
200: string;
|
|
110
|
+
300: string;
|
|
111
|
+
400: string;
|
|
112
|
+
500: string;
|
|
113
|
+
600: string;
|
|
114
|
+
700: string;
|
|
115
|
+
800: string;
|
|
116
|
+
900: string;
|
|
117
|
+
950: string;
|
|
118
|
+
};
|
|
119
|
+
lime: {
|
|
120
|
+
50: string;
|
|
121
|
+
100: string;
|
|
122
|
+
200: string;
|
|
123
|
+
300: string;
|
|
124
|
+
400: string;
|
|
125
|
+
500: string;
|
|
126
|
+
600: string;
|
|
127
|
+
700: string;
|
|
128
|
+
800: string;
|
|
129
|
+
900: string;
|
|
130
|
+
950: string;
|
|
131
|
+
};
|
|
132
|
+
green: {
|
|
133
|
+
50: string;
|
|
134
|
+
100: string;
|
|
135
|
+
200: string;
|
|
136
|
+
300: string;
|
|
137
|
+
400: string;
|
|
138
|
+
500: string;
|
|
139
|
+
600: string;
|
|
140
|
+
700: string;
|
|
141
|
+
800: string;
|
|
142
|
+
900: string;
|
|
143
|
+
950: string;
|
|
144
|
+
};
|
|
145
|
+
emerald: {
|
|
146
|
+
50: string;
|
|
147
|
+
100: string;
|
|
148
|
+
200: string;
|
|
149
|
+
300: string;
|
|
150
|
+
400: string;
|
|
151
|
+
500: string;
|
|
152
|
+
600: string;
|
|
153
|
+
700: string;
|
|
154
|
+
800: string;
|
|
155
|
+
900: string;
|
|
156
|
+
950: string;
|
|
157
|
+
};
|
|
158
|
+
teal: {
|
|
159
|
+
50: string;
|
|
160
|
+
100: string;
|
|
161
|
+
200: string;
|
|
162
|
+
300: string;
|
|
163
|
+
400: string;
|
|
164
|
+
500: string;
|
|
165
|
+
600: string;
|
|
166
|
+
700: string;
|
|
167
|
+
800: string;
|
|
168
|
+
900: string;
|
|
169
|
+
950: string;
|
|
170
|
+
};
|
|
171
|
+
cyan: {
|
|
172
|
+
50: string;
|
|
173
|
+
100: string;
|
|
174
|
+
200: string;
|
|
175
|
+
300: string;
|
|
176
|
+
400: string;
|
|
177
|
+
500: string;
|
|
178
|
+
600: string;
|
|
179
|
+
700: string;
|
|
180
|
+
800: string;
|
|
181
|
+
900: string;
|
|
182
|
+
950: string;
|
|
183
|
+
};
|
|
184
|
+
sky: {
|
|
185
|
+
50: string;
|
|
186
|
+
100: string;
|
|
187
|
+
200: string;
|
|
188
|
+
300: string;
|
|
189
|
+
400: string;
|
|
190
|
+
500: string;
|
|
191
|
+
600: string;
|
|
192
|
+
700: string;
|
|
193
|
+
800: string;
|
|
194
|
+
900: string;
|
|
195
|
+
950: string;
|
|
196
|
+
};
|
|
197
|
+
blue: {
|
|
198
|
+
50: string;
|
|
199
|
+
100: string;
|
|
200
|
+
200: string;
|
|
201
|
+
300: string;
|
|
202
|
+
400: string;
|
|
203
|
+
500: string;
|
|
204
|
+
600: string;
|
|
205
|
+
700: string;
|
|
206
|
+
800: string;
|
|
207
|
+
900: string;
|
|
208
|
+
950: string;
|
|
209
|
+
};
|
|
210
|
+
indigo: {
|
|
211
|
+
50: string;
|
|
212
|
+
100: string;
|
|
213
|
+
200: string;
|
|
214
|
+
300: string;
|
|
215
|
+
400: string;
|
|
216
|
+
500: string;
|
|
217
|
+
600: string;
|
|
218
|
+
700: string;
|
|
219
|
+
800: string;
|
|
220
|
+
900: string;
|
|
221
|
+
950: string;
|
|
222
|
+
};
|
|
223
|
+
violet: {
|
|
224
|
+
50: string;
|
|
225
|
+
100: string;
|
|
226
|
+
200: string;
|
|
227
|
+
300: string;
|
|
228
|
+
400: string;
|
|
229
|
+
500: string;
|
|
230
|
+
600: string;
|
|
231
|
+
700: string;
|
|
232
|
+
800: string;
|
|
233
|
+
900: string;
|
|
234
|
+
950: string;
|
|
235
|
+
};
|
|
236
|
+
purple: {
|
|
237
|
+
50: string;
|
|
238
|
+
100: string;
|
|
239
|
+
200: string;
|
|
240
|
+
300: string;
|
|
241
|
+
400: string;
|
|
242
|
+
500: string;
|
|
243
|
+
600: string;
|
|
244
|
+
700: string;
|
|
245
|
+
800: string;
|
|
246
|
+
900: string;
|
|
247
|
+
950: string;
|
|
248
|
+
};
|
|
249
|
+
fuchsia: {
|
|
250
|
+
50: string;
|
|
251
|
+
100: string;
|
|
252
|
+
200: string;
|
|
253
|
+
300: string;
|
|
254
|
+
400: string;
|
|
255
|
+
500: string;
|
|
256
|
+
600: string;
|
|
257
|
+
700: string;
|
|
258
|
+
800: string;
|
|
259
|
+
900: string;
|
|
260
|
+
950: string;
|
|
261
|
+
};
|
|
262
|
+
pink: {
|
|
263
|
+
50: string;
|
|
264
|
+
100: string;
|
|
265
|
+
200: string;
|
|
266
|
+
300: string;
|
|
267
|
+
400: string;
|
|
268
|
+
500: string;
|
|
269
|
+
600: string;
|
|
270
|
+
700: string;
|
|
271
|
+
800: string;
|
|
272
|
+
900: string;
|
|
273
|
+
950: string;
|
|
274
|
+
};
|
|
275
|
+
rose: {
|
|
276
|
+
50: string;
|
|
277
|
+
100: string;
|
|
278
|
+
200: string;
|
|
279
|
+
300: string;
|
|
280
|
+
400: string;
|
|
281
|
+
500: string;
|
|
282
|
+
600: string;
|
|
283
|
+
700: string;
|
|
284
|
+
800: string;
|
|
285
|
+
900: string;
|
|
286
|
+
950: string;
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
export type TailwindColorName = keyof ReturnType<typeof getTailwindColorShades>;
|
|
290
|
+
export declare const replaceThemeTailwindColors: (theme: string, tailwindColor: string) => HTMLStyleElement;
|
|
291
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/lib/help/theme.ts"],"names":[],"mappings":"AACA,wBAAgB,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmSrC;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEhF,eAAO,MAAM,0BAA0B,GAAI,OAAO,MAAM,EAAE,eAAe,MAAM,KAAG,gBAiDjF,CAAC"}
|