@ifto/mantine-kit 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +471 -2
- package/dist/component/atom/AppMain/App.module.js +7 -0
- package/dist/component/atom/AppMain/App.module.js.map +1 -0
- package/dist/component/atom/AppMain/AppMain.d.ts +7 -0
- package/dist/component/atom/AppMain/AppMain.js +14 -0
- package/dist/component/atom/AppMain/AppMain.js.map +1 -0
- package/dist/component/atom/CancelEditButton/CancelEditButton.d.ts +6 -0
- package/dist/component/atom/CancelEditButton/CancelEditButton.js +24 -0
- package/dist/component/atom/CancelEditButton/CancelEditButton.js.map +1 -0
- package/dist/component/atom/ConfirmEditButton/ConfirmEditButton.d.ts +13 -0
- package/dist/component/atom/ConfirmEditButton/ConfirmEditButton.js +30 -0
- package/dist/component/atom/ConfirmEditButton/ConfirmEditButton.js.map +1 -0
- package/dist/component/atom/DateField/DateField.d.ts +7 -0
- package/dist/component/atom/DateField/DateField.js +21 -0
- package/dist/component/atom/DateField/DateField.js.map +1 -0
- package/dist/component/atom/EditValueButton/EditValueButton.d.ts +6 -0
- package/dist/component/atom/EditValueButton/EditValueButton.js +24 -0
- package/dist/component/atom/EditValueButton/EditValueButton.js.map +1 -0
- package/dist/component/atom/ErrorAlert/ErrorAlert.d.ts +8 -0
- package/dist/component/atom/ErrorAlert/ErrorAlert.js +21 -0
- package/dist/component/atom/ErrorAlert/ErrorAlert.js.map +1 -0
- package/dist/component/atom/Surface/Surface.d.ts +20 -0
- package/dist/component/atom/Surface/Surface.js +15 -0
- package/dist/component/atom/Surface/Surface.js.map +1 -0
- package/dist/component/molecule/Breadcrumb/Breadcrumb.d.ts +12 -0
- package/dist/component/molecule/Breadcrumb/Breadcrumb.js +38 -0
- package/dist/component/molecule/Breadcrumb/Breadcrumb.js.map +1 -0
- package/dist/component/molecule/ExportMenuButton/ExportMenuButton.d.ts +25 -0
- package/dist/component/molecule/ExportMenuButton/ExportMenuButton.js +49 -0
- package/dist/component/molecule/ExportMenuButton/ExportMenuButton.js.map +1 -0
- package/dist/component/molecule/PaperCard/PaperCard.d.ts +7 -0
- package/dist/component/molecule/PaperCard/PaperCard.js +17 -0
- package/dist/component/molecule/PaperCard/PaperCard.js.map +1 -0
- package/dist/component/molecule/PrintSection/PrintSection.d.ts +14 -0
- package/dist/component/molecule/PrintSection/PrintSection.js +29 -0
- package/dist/component/molecule/PrintSection/PrintSection.js.map +1 -0
- package/dist/component/molecule/SelectField/SelectField.d.ts +32 -0
- package/dist/component/molecule/SelectField/SelectField.js +38 -0
- package/dist/component/molecule/SelectField/SelectField.js.map +1 -0
- package/dist/component/molecule/StatsCard/Stats.module.js +15 -0
- package/dist/component/molecule/StatsCard/Stats.module.js.map +1 -0
- package/dist/component/molecule/StatsCard/StatsCard.d.ts +18 -0
- package/dist/component/molecule/StatsCard/StatsCard.js +60 -0
- package/dist/component/molecule/StatsCard/StatsCard.js.map +1 -0
- package/dist/component/organism/DataForm/DataForm.d.ts +26 -0
- package/dist/component/organism/DataForm/DataForm.js +83 -0
- package/dist/component/organism/DataForm/DataForm.js.map +1 -0
- package/dist/component/organism/DataTabList/DataTabList.d.ts +24 -0
- package/dist/component/organism/DataTabList/DataTabList.js +37 -0
- package/dist/component/organism/DataTabList/DataTabList.js.map +1 -0
- package/dist/component/organism/DataTabList/DataTabList.module.js +13 -0
- package/dist/component/organism/DataTabList/DataTabList.module.js.map +1 -0
- package/dist/component/organism/EChart/EChart.d.ts +47 -0
- package/dist/component/organism/EChart/EChart.js +37 -0
- package/dist/component/organism/EChart/EChart.js.map +1 -0
- package/dist/component/organism/EChart/buildEChartOption.d.ts +40 -0
- package/dist/component/organism/EChart/buildEChartOption.js +57 -0
- package/dist/component/organism/EChart/buildEChartOption.js.map +1 -0
- package/dist/component/organism/EChart/chart/BarChart.d.ts +22 -0
- package/dist/component/organism/EChart/chart/BarChart.js +34 -0
- package/dist/component/organism/EChart/chart/BarChart.js.map +1 -0
- package/dist/component/organism/EChart/chart/CartesianChart.d.ts +48 -0
- package/dist/component/organism/EChart/chart/CartesianChart.js +63 -0
- package/dist/component/organism/EChart/chart/CartesianChart.js.map +1 -0
- package/dist/component/organism/EChart/chart/ChartHeader.d.ts +36 -0
- package/dist/component/organism/EChart/chart/ChartHeader.js +105 -0
- package/dist/component/organism/EChart/chart/ChartHeader.js.map +1 -0
- package/dist/component/organism/EChart/chart/ChartSeries.d.ts +50 -0
- package/dist/component/organism/EChart/chart/ChartSeries.js +23 -0
- package/dist/component/organism/EChart/chart/ChartSeries.js.map +1 -0
- package/dist/component/organism/EChart/chart/ChartTexts.d.ts +12 -0
- package/dist/component/organism/EChart/chart/ChartTexts.js +21 -0
- package/dist/component/organism/EChart/chart/ChartTexts.js.map +1 -0
- package/dist/component/organism/EChart/chart/ChartType.d.ts +50 -0
- package/dist/component/organism/EChart/chart/ChartType.js +1 -0
- package/dist/component/organism/EChart/chart/ChartTypeId.d.ts +2 -0
- package/dist/component/organism/EChart/chart/ChartTypeId.js +1 -0
- package/dist/component/organism/EChart/chart/ChartTypes.d.ts +15 -0
- package/dist/component/organism/EChart/chart/ChartTypes.js +24 -0
- package/dist/component/organism/EChart/chart/ChartTypes.js.map +1 -0
- package/dist/component/organism/EChart/chart/DonutChart.d.ts +32 -0
- package/dist/component/organism/EChart/chart/DonutChart.js +111 -0
- package/dist/component/organism/EChart/chart/DonutChart.js.map +1 -0
- package/dist/component/organism/EChart/chart/LineChart.d.ts +11 -0
- package/dist/component/organism/EChart/chart/LineChart.js +20 -0
- package/dist/component/organism/EChart/chart/LineChart.js.map +1 -0
- package/dist/component/organism/EChart/chart/StackedBarChart.d.ts +15 -0
- package/dist/component/organism/EChart/chart/StackedBarChart.js +30 -0
- package/dist/component/organism/EChart/chart/StackedBarChart.js.map +1 -0
- package/dist/component/organism/EChart/chart/UnitPanels.d.ts +63 -0
- package/dist/component/organism/EChart/chart/UnitPanels.js +127 -0
- package/dist/component/organism/EChart/chart/UnitPanels.js.map +1 -0
- package/dist/component/organism/EChart/echartDefaults.d.ts +32 -0
- package/dist/component/organism/EChart/echartDefaults.js +47 -0
- package/dist/component/organism/EChart/echartDefaults.js.map +1 -0
- package/dist/component/organism/EChart/useEChart.d.ts +35 -0
- package/dist/component/organism/EChart/useEChart.js +112 -0
- package/dist/component/organism/EChart/useEChart.js.map +1 -0
- package/dist/component/organism/Navbar/NavItem.d.ts +16 -0
- package/dist/component/organism/Navbar/NavItem.js +1 -0
- package/dist/component/organism/Navbar/Navbar.d.ts +20 -0
- package/dist/component/organism/Navbar/Navbar.js +64 -0
- package/dist/component/organism/Navbar/Navbar.js.map +1 -0
- package/dist/component/organism/Navbar/Navbar.module.js +19 -0
- package/dist/component/organism/Navbar/Navbar.module.js.map +1 -0
- package/dist/component/organism/PageHeader/PageHeader.d.ts +14 -0
- package/dist/component/organism/PageHeader/PageHeader.js +55 -0
- package/dist/component/organism/PageHeader/PageHeader.js.map +1 -0
- package/dist/component/organism/StatsGrid/StatsGrid.d.ts +12 -0
- package/dist/component/organism/StatsGrid/StatsGrid.js +46 -0
- package/dist/component/organism/StatsGrid/StatsGrid.js.map +1 -0
- package/dist/component/organism/StatsGrid/StatsGrid.module.js +17 -0
- package/dist/component/organism/StatsGrid/StatsGrid.module.js.map +1 -0
- package/dist/component/organism/Table/RowActions.d.ts +23 -0
- package/dist/component/organism/Table/RowActions.js +121 -0
- package/dist/component/organism/Table/RowActions.js.map +1 -0
- package/dist/component/organism/Table/Table.d.ts +51 -0
- package/dist/component/organism/Table/Table.js +108 -0
- package/dist/component/organism/Table/Table.js.map +1 -0
- package/dist/component/organism/ViewTable/ColumnComparator.d.ts +11 -0
- package/dist/component/organism/ViewTable/ColumnComparator.js +25 -0
- package/dist/component/organism/ViewTable/ColumnComparator.js.map +1 -0
- package/dist/component/organism/ViewTable/ViewTable.d.ts +53 -0
- package/dist/component/organism/ViewTable/ViewTable.js +123 -0
- package/dist/component/organism/ViewTable/ViewTable.js.map +1 -0
- package/dist/component/template/CreateFormPage/CreateFormPage.d.ts +19 -0
- package/dist/component/template/CreateFormPage/CreateFormPage.js +41 -0
- package/dist/component/template/CreateFormPage/CreateFormPage.js.map +1 -0
- package/dist/component/template/EditFormPage/EditFormPage.d.ts +19 -0
- package/dist/component/template/EditFormPage/EditFormPage.js +42 -0
- package/dist/component/template/EditFormPage/EditFormPage.js.map +1 -0
- package/dist/component/template/FormPage/FormPage.d.ts +25 -0
- package/dist/component/template/FormPage/FormPage.js +130 -0
- package/dist/component/template/FormPage/FormPage.js.map +1 -0
- package/dist/component/template/FormPage/FormType.d.ts +6 -0
- package/dist/component/template/FormPage/FormType.js +12 -0
- package/dist/component/template/FormPage/FormType.js.map +1 -0
- package/dist/component/template/Layout/Layout.d.ts +21 -0
- package/dist/component/template/Layout/Layout.js +121 -0
- package/dist/component/template/Layout/Layout.js.map +1 -0
- package/dist/component/template/Layout/Layout.module.js +19 -0
- package/dist/component/template/Layout/Layout.module.js.map +1 -0
- package/dist/component/template/ListPage/ListPage.d.ts +32 -0
- package/dist/component/template/ListPage/ListPage.js +47 -0
- package/dist/component/template/ListPage/ListPage.js.map +1 -0
- package/dist/component/template/PrintPage/PrintPage.d.ts +25 -0
- package/dist/component/template/PrintPage/PrintPage.js +115 -0
- package/dist/component/template/PrintPage/PrintPage.js.map +1 -0
- package/dist/component/template/ViewPage/ViewPage.d.ts +11 -0
- package/dist/component/template/ViewPage/ViewPage.js +49 -0
- package/dist/component/template/ViewPage/ViewPage.js.map +1 -0
- package/dist/data/ListDataSource.d.ts +12 -0
- package/dist/data/ListDataSource.js +1 -0
- package/dist/data/SaveDataSource.d.ts +16 -0
- package/dist/data/SaveDataSource.js +1 -0
- package/dist/export/ExportCellText.d.ts +18 -0
- package/dist/export/ExportCellText.js +60 -0
- package/dist/export/ExportCellText.js.map +1 -0
- package/dist/export/ExportDocument.d.ts +127 -0
- package/dist/export/ExportDocument.js +59 -0
- package/dist/export/ExportDocument.js.map +1 -0
- package/dist/export/ExportDownload.d.ts +9 -0
- package/dist/export/ExportDownload.js +19 -0
- package/dist/export/ExportDownload.js.map +1 -0
- package/dist/export/ExportFileName.d.ts +11 -0
- package/dist/export/ExportFileName.js +24 -0
- package/dist/export/ExportFileName.js.map +1 -0
- package/dist/export/ExportFormat.d.ts +30 -0
- package/dist/export/ExportFormat.js +1 -0
- package/dist/export/ExportFormats.d.ts +12 -0
- package/dist/export/ExportFormats.js +16 -0
- package/dist/export/ExportFormats.js.map +1 -0
- package/dist/export/ExportTexts.d.ts +14 -0
- package/dist/export/ExportTexts.js +23 -0
- package/dist/export/ExportTexts.js.map +1 -0
- package/dist/export/csv/CsvFormat.d.ts +41 -0
- package/dist/export/csv/CsvFormat.js +91 -0
- package/dist/export/csv/CsvFormat.js.map +1 -0
- package/dist/export/xlsx/XlsxFormat.d.ts +35 -0
- package/dist/export/xlsx/XlsxFormat.js +66 -0
- package/dist/export/xlsx/XlsxFormat.js.map +1 -0
- package/dist/export/xlsx/XlsxNumberFormat.d.ts +8 -0
- package/dist/export/xlsx/XlsxNumberFormat.js +15 -0
- package/dist/export/xlsx/XlsxNumberFormat.js.map +1 -0
- package/dist/export/xlsx/XlsxSheetName.d.ts +12 -0
- package/dist/export/xlsx/XlsxSheetName.js +62 -0
- package/dist/export/xlsx/XlsxSheetName.js.map +1 -0
- package/dist/export/xlsx/XlsxSheetWriter.d.ts +67 -0
- package/dist/export/xlsx/XlsxSheetWriter.js +215 -0
- package/dist/export/xlsx/XlsxSheetWriter.js.map +1 -0
- package/dist/export/xlsx/XlsxStyle.d.ts +51 -0
- package/dist/export/xlsx/XlsxStyle.js +87 -0
- package/dist/export/xlsx/XlsxStyle.js.map +1 -0
- package/dist/hook/useIsMobile.d.ts +5 -0
- package/dist/hook/useIsMobile.js +16 -0
- package/dist/hook/useIsMobile.js.map +1 -0
- package/dist/hook/useKeyedService.d.ts +22 -0
- package/dist/hook/useKeyedService.js +38 -0
- package/dist/hook/useKeyedService.js.map +1 -0
- package/dist/hook/useLightColorSchemeOnPrint.d.ts +9 -0
- package/dist/hook/useLightColorSchemeOnPrint.js +36 -0
- package/dist/hook/useLightColorSchemeOnPrint.js.map +1 -0
- package/dist/hook/useService.d.ts +12 -0
- package/dist/hook/useService.js +29 -0
- package/dist/hook/useService.js.map +1 -0
- package/dist/http/ApiError.d.ts +13 -0
- package/dist/http/ApiError.js +22 -0
- package/dist/http/ApiError.js.map +1 -0
- package/dist/http/AxiosHttpClient.d.ts +21 -0
- package/dist/http/AxiosHttpClient.js +67 -0
- package/dist/http/AxiosHttpClient.js.map +1 -0
- package/dist/http/AxiosHttpClientConfig.d.ts +37 -0
- package/dist/http/AxiosHttpClientConfig.js +19 -0
- package/dist/http/AxiosHttpClientConfig.js.map +1 -0
- package/dist/i18n/KitLocale.d.ts +4 -0
- package/dist/i18n/KitLocale.js +7 -0
- package/dist/i18n/KitLocale.js.map +1 -0
- package/dist/i18n/KitMessages.d.ts +146 -0
- package/dist/i18n/KitMessages.js +1 -0
- package/dist/i18n/messages/enUS.d.ts +3 -0
- package/dist/i18n/messages/enUS.js +112 -0
- package/dist/i18n/messages/enUS.js.map +1 -0
- package/dist/i18n/messages/ptBR.d.ts +3 -0
- package/dist/i18n/messages/ptBR.js +97 -0
- package/dist/i18n/messages/ptBR.js.map +1 -0
- package/dist/i18n/resolveMessages.d.ts +13 -0
- package/dist/i18n/resolveMessages.js +29 -0
- package/dist/i18n/resolveMessages.js.map +1 -0
- package/dist/model/Identifiable.d.ts +7 -0
- package/dist/model/Identifiable.js +1 -0
- package/dist/provider/KitConfig.d.ts +26 -0
- package/dist/provider/KitConfig.js +1 -0
- package/dist/provider/KitContext.d.ts +9 -0
- package/dist/provider/KitContext.js +27 -0
- package/dist/provider/KitContext.js.map +1 -0
- package/dist/provider/KitProvider.d.ts +7 -0
- package/dist/provider/KitProvider.js +31 -0
- package/dist/provider/KitProvider.js.map +1 -0
- package/dist/provider/useKit.d.ts +15 -0
- package/dist/provider/useKit.js +28 -0
- package/dist/provider/useKit.js.map +1 -0
- package/dist/router/FormRouteSegments.d.ts +16 -0
- package/dist/router/FormRouteSegments.js +19 -0
- package/dist/router/FormRouteSegments.js.map +1 -0
- package/dist/router/RouterAdapter.d.ts +24 -0
- package/dist/router/RouterAdapter.js +1 -0
- package/dist/router/anchorRouter.d.ts +7 -0
- package/dist/router/anchorRouter.js +23 -0
- package/dist/router/anchorRouter.js.map +1 -0
- package/dist/styles/print.css +93 -0
- package/dist/styles.css +188 -0
- package/dist/util/ArrayUtil.d.ts +39 -0
- package/dist/util/ArrayUtil.js +48 -0
- package/dist/util/ArrayUtil.js.map +1 -0
- package/dist/util/ColorUtil.d.ts +7 -0
- package/dist/util/ColorUtil.js +16 -0
- package/dist/util/ColorUtil.js.map +1 -0
- package/dist/util/CompareUtil.d.ts +19 -0
- package/dist/util/CompareUtil.js +51 -0
- package/dist/util/CompareUtil.js.map +1 -0
- package/dist/util/DateUtil.d.ts +37 -0
- package/dist/util/DateUtil.js +53 -0
- package/dist/util/DateUtil.js.map +1 -0
- package/dist/util/DownloadUtil.d.ts +6 -0
- package/dist/util/DownloadUtil.js +25 -0
- package/dist/util/DownloadUtil.js.map +1 -0
- package/dist/util/EnumUtil.d.ts +19 -0
- package/dist/util/EnumUtil.js +32 -0
- package/dist/util/EnumUtil.js.map +1 -0
- package/dist/util/FormUtil.d.ts +8 -0
- package/dist/util/FormUtil.js +14 -0
- package/dist/util/FormUtil.js.map +1 -0
- package/dist/util/HtmlUtil.d.ts +8 -0
- package/dist/util/HtmlUtil.js +23 -0
- package/dist/util/HtmlUtil.js.map +1 -0
- package/dist/util/Notifications.d.ts +30 -0
- package/dist/util/Notifications.js +59 -0
- package/dist/util/Notifications.js.map +1 -0
- package/dist/util/NumberUtil.d.ts +19 -0
- package/dist/util/NumberUtil.js +33 -0
- package/dist/util/NumberUtil.js.map +1 -0
- package/dist/util/ObjectUtil.d.ts +22 -0
- package/dist/util/ObjectUtil.js +34 -0
- package/dist/util/ObjectUtil.js.map +1 -0
- package/dist/util/SearchParamsUtil.d.ts +23 -0
- package/dist/util/SearchParamsUtil.js +29 -0
- package/dist/util/SearchParamsUtil.js.map +1 -0
- package/dist/util/TransformData.d.ts +14 -0
- package/dist/util/TransformData.js +31 -0
- package/dist/util/TransformData.js.map +1 -0
- package/dist/util/ValidationUtil.d.ts +9 -0
- package/dist/util/ValidationUtil.js +16 -0
- package/dist/util/ValidationUtil.js.map +1 -0
- package/dist/util/parseActionsPageParams.d.ts +14 -0
- package/dist/util/parseActionsPageParams.js +29 -0
- package/dist/util/parseActionsPageParams.js.map +1 -0
- package/package.json +149 -5
package/dist/styles.css
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
.mk-App-module-main-8515C {
|
|
2
|
+
min-height: 95vh;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
[data-mantine-color-scheme='light'] .mk-App-module-main-8515C {
|
|
6
|
+
background-color: var(--mantine-color-gray-0);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
[data-mantine-color-scheme='dark'] .mk-App-module-main-8515C {
|
|
10
|
+
background-color: var(--mantine-color-dark-6);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* On paper, the page is white and only as tall as its content (see styles/print.css). */
|
|
14
|
+
@media print {.mk-App-module-main-8515C {
|
|
15
|
+
min-height: 0;
|
|
16
|
+
background-color: #fff !important
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
.mk-Stats-module-value-EAntx {
|
|
20
|
+
font-size: calc(1.5rem * var(--mantine-scale));
|
|
21
|
+
font-weight: 500;
|
|
22
|
+
line-height: 1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.mk-Stats-module-diff-r3gSM {
|
|
26
|
+
line-height: 1;
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
[data-mantine-color-scheme='dark'] .mk-Stats-module-icon-YG6b9 {
|
|
32
|
+
color: var(--mantine-color-dark-3);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[data-mantine-color-scheme='light'] .mk-Stats-module-icon-YG6b9 {
|
|
36
|
+
color: var(--mantine-color-gray-4);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.mk-Stats-module-title-MzSDP {
|
|
40
|
+
font-weight: 500;
|
|
41
|
+
text-transform: uppercase;
|
|
42
|
+
}
|
|
43
|
+
/*
|
|
44
|
+
* Tabs as wide as their own text (without stretching to fill the row), up to a maximum width.
|
|
45
|
+
* A title longer than the limit wraps in more than one line inside the tab, instead of widening it.
|
|
46
|
+
*/
|
|
47
|
+
.mk-DataTabList-module-tab-15vyU {
|
|
48
|
+
max-width: 14rem;
|
|
49
|
+
min-height: 2.5rem;
|
|
50
|
+
white-space: normal;
|
|
51
|
+
line-height: 1.25;
|
|
52
|
+
|
|
53
|
+
/* Border on the inactive tabs, so they look clickable, and not like loose text of the page. */
|
|
54
|
+
border: 1px solid var(--mantine-color-default-border);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.mk-DataTabList-module-tab-15vyU[data-active] {
|
|
58
|
+
border-color: var(--mantine-primary-color-filled);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Same size for any given icon, so all tabs have the same height. */
|
|
62
|
+
.mk-DataTabList-module-tabSection-WA0SY svg {
|
|
63
|
+
width: 1rem;
|
|
64
|
+
height: 1rem;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.mk-DataTabList-module-panel-R37nf {
|
|
68
|
+
padding-top: var(--mantine-spacing-xs);
|
|
69
|
+
}
|
|
70
|
+
.mk-Navbar-module-navbar-0W9zF {
|
|
71
|
+
padding: var(--mantine-spacing-md);
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-direction: column;
|
|
74
|
+
border-right: calc(0.0625rem * var(--mantine-scale)) solid var(--mantine-color-gray-3);
|
|
75
|
+
}
|
|
76
|
+
[data-mantine-color-scheme='dark'] .mk-Navbar-module-navbar-0W9zF {
|
|
77
|
+
border-right: calc(0.0625rem * var(--mantine-scale)) solid var(--mantine-color-dark-4);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.mk-Navbar-module-navbarMain-QxMWi {
|
|
81
|
+
flex: 1;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.mk-Navbar-module-header-q16r1 {
|
|
85
|
+
padding-bottom: var(--mantine-spacing-md);
|
|
86
|
+
margin-bottom: calc(var(--mantine-spacing-md) * 1.5);
|
|
87
|
+
border-bottom: calc(0.0625rem * var(--mantine-scale)) solid var(--mantine-color-gray-3);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
[data-mantine-color-scheme='dark'] .mk-Navbar-module-header-q16r1 {
|
|
91
|
+
border-bottom: calc(0.0625rem * var(--mantine-scale)) solid var(--mantine-color-dark-4);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.mk-Navbar-module-footer-48Z0e {
|
|
95
|
+
padding-top: var(--mantine-spacing-md);
|
|
96
|
+
margin-top: var(--mantine-spacing-md);
|
|
97
|
+
border-top: calc(0.0625rem * var(--mantine-scale)) solid var(--mantine-color-gray-3);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
[data-mantine-color-scheme='dark'] .mk-Navbar-module-footer-48Z0e {
|
|
101
|
+
border-top: calc(0.0625rem * var(--mantine-scale)) solid var(--mantine-color-dark-4);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.mk-Navbar-module-link-eQT-Z {
|
|
105
|
+
border-radius: var(--mantine-radius-md);
|
|
106
|
+
font-weight: 500;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.mk-Navbar-module-linkIcon-5b3By {
|
|
110
|
+
color: var(--mantine-color-gray-6);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
[data-mantine-color-scheme='dark'] .mk-Navbar-module-linkIcon-5b3By {
|
|
114
|
+
color: var(--mantine-color-dark-2);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.mk-Navbar-module-linkIcon-5b3By {
|
|
118
|
+
margin-right: var(--mantine-spacing-sm);
|
|
119
|
+
width: calc(1.5625rem * var(--mantine-scale));
|
|
120
|
+
height: calc(1.5625rem * var(--mantine-scale));
|
|
121
|
+
}
|
|
122
|
+
.mk-StatsGrid-module-root-zSIO5 {
|
|
123
|
+
padding: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.mk-StatsGrid-module-value-wk1kb {
|
|
127
|
+
font-size: calc(1.5rem * var(--mantine-scale));
|
|
128
|
+
font-weight: 500;
|
|
129
|
+
line-height: 1;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.mk-StatsGrid-module-diff-AUfON {
|
|
133
|
+
line-height: 1;
|
|
134
|
+
display: flex;
|
|
135
|
+
align-items: center;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
[data-mantine-color-scheme='dark'] .mk-StatsGrid-module-icon-ERQtf {
|
|
139
|
+
color: var(--mantine-color-dark-3);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
[data-mantine-color-scheme='light'] .mk-StatsGrid-module-icon-ERQtf {
|
|
143
|
+
color: var(--mantine-color-gray-4);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.mk-StatsGrid-module-title-yuu3f {
|
|
147
|
+
font-weight: 500;
|
|
148
|
+
text-transform: uppercase;
|
|
149
|
+
}
|
|
150
|
+
.mk-Layout-module-shrinkable-JUv2C {
|
|
151
|
+
min-width: 0;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.mk-Layout-module-fixed-Z1ueS {
|
|
155
|
+
flex-shrink: 0;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.mk-Layout-module-icon-EDq-h {
|
|
159
|
+
width: 20px;
|
|
160
|
+
height: 20px;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
[data-mantine-color-scheme='dark'] .mk-Layout-module-dark-Zx9Wz {
|
|
164
|
+
display: none;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
[data-mantine-color-scheme='light'] .mk-Layout-module-dark-Zx9Wz {
|
|
168
|
+
display: block;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
[data-mantine-color-scheme='light'] .mk-Layout-module-light--F7XT {
|
|
172
|
+
display: none;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
[data-mantine-color-scheme='dark'] .mk-Layout-module-light--F7XT {
|
|
176
|
+
display: block;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* Responsive spacing of the header groups: the `gap` prop of the Mantine Group accepts no values per breakpoint. */
|
|
180
|
+
.mk-Layout-module-headerGap-VrPBg {
|
|
181
|
+
gap: var(--mantine-spacing-xs);
|
|
182
|
+
}
|
|
183
|
+
@media (min-width: 48em) {
|
|
184
|
+
.mk-Layout-module-headerGap-VrPBg {
|
|
185
|
+
gap: var(--mantine-spacing-md)
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
/*$vite$:1*/
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates an array of the given size, with the values from 0 to size - 1.
|
|
3
|
+
* @param size size of the array
|
|
4
|
+
*/
|
|
5
|
+
export declare function createSequentialArray(size: number): number[];
|
|
6
|
+
/**
|
|
7
|
+
* Creates an array of any size, filled with the given value.
|
|
8
|
+
* @param size size of the array
|
|
9
|
+
* @param fillValue value of every element
|
|
10
|
+
*/
|
|
11
|
+
export declare function createFilledArray(size: number, fillValue?: number): number[];
|
|
12
|
+
/**
|
|
13
|
+
* Operation over two numbers that returns a new value from them.
|
|
14
|
+
* @param number1 a number
|
|
15
|
+
* @param number2 another number
|
|
16
|
+
* @return a new value computed from the two numbers
|
|
17
|
+
*/
|
|
18
|
+
export type NumbersMapFunction = (number1: number, number2: number) => number;
|
|
19
|
+
/**
|
|
20
|
+
* Applies an operation to the elements at the same position of two arrays, mapping each pair of values to a new value.
|
|
21
|
+
* @param array1 an array
|
|
22
|
+
* @param array2 another array
|
|
23
|
+
* @param operation operation applied to each pair of elements at the same position (see {@link NumbersMapFunction})
|
|
24
|
+
* @param defaultItemValue value used when one array has no element at a position of the other one (when the arrays
|
|
25
|
+
* have different sizes). A `NaN` (e.g. an empty year) is not replaced by the default: it propagates, so the
|
|
26
|
+
* result for that position is empty too.
|
|
27
|
+
* @return a new array with the result of the operation for each position
|
|
28
|
+
*/
|
|
29
|
+
export declare function arraysMap(array1: number[], array2: number[], operation: NumbersMapFunction, defaultItemValue?: number): number[];
|
|
30
|
+
/**
|
|
31
|
+
* Transposes a matrix, turning the rows into columns and vice versa.
|
|
32
|
+
* @param matrix matrix to transpose, where each row is an array of values
|
|
33
|
+
* @param defaultValForUndefinedCol value used when a row has no value for a column, which happens when the rows have
|
|
34
|
+
* different sizes. Without it, the missing column is `undefined`. The parameter has no default value on purpose:
|
|
35
|
+
* in JavaScript, passing `undefined` to a parameter with a default uses the default, so an `undefined`
|
|
36
|
+
* explicitly asked by the caller would become another value.
|
|
37
|
+
* @return the transposed matrix
|
|
38
|
+
*/
|
|
39
|
+
export declare function transposeMatrix(matrix: number[][], defaultValForUndefinedCol?: number): number[][];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
// src/util/ArrayUtil.ts
|
|
3
|
+
/**
|
|
4
|
+
* Creates an array of the given size, with the values from 0 to size - 1.
|
|
5
|
+
* @param size size of the array
|
|
6
|
+
*/
|
|
7
|
+
function createSequentialArray(size) {
|
|
8
|
+
return Array.from({ length: size }, (_, i) => i);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Creates an array of any size, filled with the given value.
|
|
12
|
+
* @param size size of the array
|
|
13
|
+
* @param fillValue value of every element
|
|
14
|
+
*/
|
|
15
|
+
function createFilledArray(size, fillValue = 0) {
|
|
16
|
+
return Array(size).fill(fillValue);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Applies an operation to the elements at the same position of two arrays, mapping each pair of values to a new value.
|
|
20
|
+
* @param array1 an array
|
|
21
|
+
* @param array2 another array
|
|
22
|
+
* @param operation operation applied to each pair of elements at the same position (see {@link NumbersMapFunction})
|
|
23
|
+
* @param defaultItemValue value used when one array has no element at a position of the other one (when the arrays
|
|
24
|
+
* have different sizes). A `NaN` (e.g. an empty year) is not replaced by the default: it propagates, so the
|
|
25
|
+
* result for that position is empty too.
|
|
26
|
+
* @return a new array with the result of the operation for each position
|
|
27
|
+
*/
|
|
28
|
+
function arraysMap(array1, array2, operation, defaultItemValue = 0) {
|
|
29
|
+
if (array1.length === 0) return array2;
|
|
30
|
+
if (array2.length === 0) return array1;
|
|
31
|
+
return createSequentialArray(Math.max(array1.length, array2.length)).map((i) => operation(array1[i] ?? defaultItemValue, array2[i] ?? defaultItemValue));
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Transposes a matrix, turning the rows into columns and vice versa.
|
|
35
|
+
* @param matrix matrix to transpose, where each row is an array of values
|
|
36
|
+
* @param defaultValForUndefinedCol value used when a row has no value for a column, which happens when the rows have
|
|
37
|
+
* different sizes. Without it, the missing column is `undefined`. The parameter has no default value on purpose:
|
|
38
|
+
* in JavaScript, passing `undefined` to a parameter with a default uses the default, so an `undefined`
|
|
39
|
+
* explicitly asked by the caller would become another value.
|
|
40
|
+
* @return the transposed matrix
|
|
41
|
+
*/
|
|
42
|
+
function transposeMatrix(matrix, defaultValForUndefinedCol) {
|
|
43
|
+
const reducer = (acc, curr) => curr > acc ? curr : acc;
|
|
44
|
+
return createSequentialArray(matrix.map((line) => line.length).reduce(reducer, 0)).map((col) => matrix.map((line) => line[col] ?? defaultValForUndefinedCol));
|
|
45
|
+
}
|
|
46
|
+
export { arraysMap, createFilledArray, createSequentialArray, transposeMatrix };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=ArrayUtil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArrayUtil.js","names":[],"sources":["../../src/util/ArrayUtil.ts"],"sourcesContent":["/**\n * Creates an array of the given size, with the values from 0 to size - 1.\n * @param size size of the array\n */\nexport function createSequentialArray(size: number): number[] {\n return Array.from({ length: size }, (_, i) => i);\n}\n\n/**\n * Creates an array of any size, filled with the given value.\n * @param size size of the array\n * @param fillValue value of every element\n */\nexport function createFilledArray(size: number, fillValue: number = 0): number[] {\n return Array(size).fill(fillValue);\n}\n\n/**\n * Operation over two numbers that returns a new value from them.\n * @param number1 a number\n * @param number2 another number\n * @return a new value computed from the two numbers\n */\nexport type NumbersMapFunction = (number1: number, number2: number) => number;\n\n/**\n * Applies an operation to the elements at the same position of two arrays, mapping each pair of values to a new value.\n * @param array1 an array\n * @param array2 another array\n * @param operation operation applied to each pair of elements at the same position (see {@link NumbersMapFunction})\n * @param defaultItemValue value used when one array has no element at a position of the other one (when the arrays\n * have different sizes). A `NaN` (e.g. an empty year) is not replaced by the default: it propagates, so the\n * result for that position is empty too.\n * @return a new array with the result of the operation for each position\n */\nexport function arraysMap(\n array1: number[],\n array2: number[],\n operation: NumbersMapFunction,\n defaultItemValue: number = 0\n): number[] {\n if (array1.length === 0) return array2;\n\n if (array2.length === 0) return array1;\n\n const maxLen = Math.max(array1.length, array2.length);\n\n /* An array with just the indexes of the longest array, so that the result has the size of the longest one while\n keeping the order of the arguments (which may change the result of the operation). */\n const indexesArray = createSequentialArray(maxLen);\n return indexesArray.map(i => operation(array1[i] ?? defaultItemValue, array2[i] ?? defaultItemValue));\n}\n\n/**\n * Transposes a matrix, turning the rows into columns and vice versa.\n * @param matrix matrix to transpose, where each row is an array of values\n * @param defaultValForUndefinedCol value used when a row has no value for a column, which happens when the rows have\n * different sizes. Without it, the missing column is `undefined`. The parameter has no default value on purpose:\n * in JavaScript, passing `undefined` to a parameter with a default uses the default, so an `undefined`\n * explicitly asked by the caller would become another value.\n * @return the transposed matrix\n */\nexport function transposeMatrix(matrix: number[][], defaultValForUndefinedCol?: number): number[][] {\n const reducer = (acc: number, curr: number) => (curr > acc ? curr : acc);\n\n // Length of the longest row of the matrix\n const maxCols = matrix.map(line => line.length).reduce(reducer, 0);\n const colIndexes = createSequentialArray(maxCols);\n // `??`, not `||`: a 0 (a real value) and a NaN (an empty year) are kept, and only a missing column uses the default.\n return colIndexes.map(col => matrix.map(line => line[col] ?? defaultValForUndefinedCol));\n}\n"],"mappings":";;;;;;AAIA,SAAgB,sBAAsB,MAAwB;CAC1D,OAAO,MAAM,KAAK,EAAE,QAAQ,KAAK,IAAI,GAAG,MAAM,CAAC;AACnD;;;;;;AAOA,SAAgB,kBAAkB,MAAc,YAAoB,GAAa;CAC7E,OAAO,MAAM,IAAI,CAAC,CAAC,KAAK,SAAS;AACrC;;;;;;;;;;;AAoBA,SAAgB,UACZ,QACA,QACA,WACA,mBAA2B,GACnB;CACR,IAAI,OAAO,WAAW,GAAG,OAAO;CAEhC,IAAI,OAAO,WAAW,GAAG,OAAO;CAOhC,OADqB,sBAJN,KAAK,IAAI,OAAO,QAAQ,OAAO,MAIH,CACpC,CAAA,CAAa,KAAI,MAAK,UAAU,OAAO,MAAM,kBAAkB,OAAO,MAAM,gBAAgB,CAAC;AACxG;;;;;;;;;;AAWA,SAAgB,gBAAgB,QAAoB,2BAAgD;CAChG,MAAM,WAAW,KAAa,SAAkB,OAAO,MAAM,OAAO;CAMpE,OAFmB,sBADH,OAAO,KAAI,SAAQ,KAAK,MAAM,CAAC,CAAC,OAAO,SAAS,CACvB,CAElC,CAAA,CAAW,KAAI,QAAO,OAAO,KAAI,SAAQ,KAAK,QAAQ,yBAAyB,CAAC;AAC3F"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Changes the shade of a hexadecimal color in the `#RRGGBB` format.
|
|
3
|
+
* @param hexColor hexadecimal color
|
|
4
|
+
* @param scale value added to (or, if negative, subtracted from) the color
|
|
5
|
+
* @return the hexadecimal color in a different shade, according to the scale
|
|
6
|
+
*/
|
|
7
|
+
export declare function changeColorShade(hexColor: string, scale: number): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
// src/util/ColorUtil.ts
|
|
3
|
+
/**
|
|
4
|
+
* Changes the shade of a hexadecimal color in the `#RRGGBB` format.
|
|
5
|
+
* @param hexColor hexadecimal color
|
|
6
|
+
* @param scale value added to (or, if negative, subtracted from) the color
|
|
7
|
+
* @return the hexadecimal color in a different shade, according to the scale
|
|
8
|
+
*/
|
|
9
|
+
function changeColorShade(hexColor, scale) {
|
|
10
|
+
if (!/^#[0-9A-Fa-f]{6}$/.test(hexColor)) throw new Error("Invalid hexadecimal color code");
|
|
11
|
+
const hexDigits = hexColor.substring(1);
|
|
12
|
+
return "#" + (parseInt(hexDigits, 16) + scale).toString(16);
|
|
13
|
+
}
|
|
14
|
+
export { changeColorShade };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=ColorUtil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorUtil.js","names":[],"sources":["../../src/util/ColorUtil.ts"],"sourcesContent":["/**\n * Changes the shade of a hexadecimal color in the `#RRGGBB` format.\n * @param hexColor hexadecimal color\n * @param scale value added to (or, if negative, subtracted from) the color\n * @return the hexadecimal color in a different shade, according to the scale\n */\nexport function changeColorShade(hexColor: string, scale: number): string {\n if (!/^#[0-9A-Fa-f]{6}$/.test(hexColor)) {\n throw new Error('Invalid hexadecimal color code');\n }\n\n // Hexadecimal code of the color, without the leading #\n const hexDigits = hexColor.substring(1);\n const gradedBgColorInt = parseInt(hexDigits, 16) + scale;\n return '#' + gradedBgColorInt.toString(16);\n}\n"],"mappings":";;;;;;;;AAMA,SAAgB,iBAAiB,UAAkB,OAAuB;CACtE,IAAI,CAAC,oBAAoB,KAAK,QAAQ,GAClC,MAAM,IAAI,MAAM,gCAAgC;CAIpD,MAAM,YAAY,SAAS,UAAU,CAAC;CAEtC,OAAO,OADkB,SAAS,WAAW,EAAE,IAAI,MAAA,CACrB,SAAS,EAAE;AAC7C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comparison functions used to sort lists and tables according to a locale.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Compares two texts according to a locale, to be used in `Array.prototype.sort`.
|
|
6
|
+
* @param locale locale of the comparison; defaults to `en-US`
|
|
7
|
+
* @return negative if `a` comes before `b`, positive if it comes after and 0 if they are equivalent
|
|
8
|
+
*/
|
|
9
|
+
export declare function compareText(a: string, b: string, locale?: string): number;
|
|
10
|
+
/** Tells whether a value is absent (`null` or `undefined`). */
|
|
11
|
+
export declare const isAbsent: (value: unknown) => value is null | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Compares two values of any type in ascending order, to be used in `Array.prototype.sort`: numbers and dates by
|
|
14
|
+
* value, texts according to the locale and the other values by their text representation. Absent values
|
|
15
|
+
* (`null`/`undefined`) always come last.
|
|
16
|
+
* @param locale locale of the text comparison; defaults to `en-US`
|
|
17
|
+
* @return negative if `a` comes before `b`, positive if it comes after and 0 if they are equivalent
|
|
18
|
+
*/
|
|
19
|
+
export declare function compareValues(a: unknown, b: unknown, locale?: string): number;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { DEFAULT_LOCALE } from "../i18n/KitLocale.js";
|
|
3
|
+
// src/util/CompareUtil.ts
|
|
4
|
+
/**
|
|
5
|
+
* Comparison functions used to sort lists and tables according to a locale.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Text collators already created, by locale. Creating an `Intl.Collator` is much more expensive than using it.
|
|
9
|
+
* Accented letters stay with the letter without accent and upper case letters with the lower case ones (e.g.
|
|
10
|
+
* "Émile" before "emma", which comes before "Frank"). Numbers inside the text are compared by value (`numeric`), so
|
|
11
|
+
* "District 2" comes before "District 10".
|
|
12
|
+
*/
|
|
13
|
+
var collators = /* @__PURE__ */ new Map();
|
|
14
|
+
/**
|
|
15
|
+
* Returns the text collator of a locale, created only the first time.
|
|
16
|
+
* @param locale locale of the comparison
|
|
17
|
+
*/
|
|
18
|
+
function collator(locale) {
|
|
19
|
+
let result = collators.get(locale);
|
|
20
|
+
if (!result) {
|
|
21
|
+
result = new Intl.Collator(locale, { numeric: true });
|
|
22
|
+
collators.set(locale, result);
|
|
23
|
+
}
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Compares two texts according to a locale, to be used in `Array.prototype.sort`.
|
|
28
|
+
* @param locale locale of the comparison; defaults to `en-US`
|
|
29
|
+
* @return negative if `a` comes before `b`, positive if it comes after and 0 if they are equivalent
|
|
30
|
+
*/
|
|
31
|
+
function compareText(a, b, locale = DEFAULT_LOCALE) {
|
|
32
|
+
return collator(locale).compare(a, b);
|
|
33
|
+
}
|
|
34
|
+
/** Tells whether a value is absent (`null` or `undefined`). */
|
|
35
|
+
var isAbsent = (value) => value === null || value === void 0;
|
|
36
|
+
/**
|
|
37
|
+
* Compares two values of any type in ascending order, to be used in `Array.prototype.sort`: numbers and dates by
|
|
38
|
+
* value, texts according to the locale and the other values by their text representation. Absent values
|
|
39
|
+
* (`null`/`undefined`) always come last.
|
|
40
|
+
* @param locale locale of the text comparison; defaults to `en-US`
|
|
41
|
+
* @return negative if `a` comes before `b`, positive if it comes after and 0 if they are equivalent
|
|
42
|
+
*/
|
|
43
|
+
function compareValues(a, b, locale = DEFAULT_LOCALE) {
|
|
44
|
+
if (isAbsent(a) || isAbsent(b)) return Number(isAbsent(a)) - Number(isAbsent(b));
|
|
45
|
+
if (typeof a === "number" && typeof b === "number") return a - b;
|
|
46
|
+
if (a instanceof Date && b instanceof Date) return a.getTime() - b.getTime();
|
|
47
|
+
return compareText(String(a), String(b), locale);
|
|
48
|
+
}
|
|
49
|
+
export { compareText, compareValues, isAbsent };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=CompareUtil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompareUtil.js","names":[],"sources":["../../src/util/CompareUtil.ts"],"sourcesContent":["/**\n * Comparison functions used to sort lists and tables according to a locale.\n */\n\nimport { DEFAULT_LOCALE } from '../i18n/KitLocale';\n\n/**\n * Text collators already created, by locale. Creating an `Intl.Collator` is much more expensive than using it.\n * Accented letters stay with the letter without accent and upper case letters with the lower case ones (e.g.\n * \"Émile\" before \"emma\", which comes before \"Frank\"). Numbers inside the text are compared by value (`numeric`), so\n * \"District 2\" comes before \"District 10\".\n */\nconst collators = new Map<string, Intl.Collator>();\n\n/**\n * Returns the text collator of a locale, created only the first time.\n * @param locale locale of the comparison\n */\nfunction collator(locale: string): Intl.Collator {\n let result = collators.get(locale);\n if (!result) {\n result = new Intl.Collator(locale, { numeric: true });\n collators.set(locale, result);\n }\n\n return result;\n}\n\n/**\n * Compares two texts according to a locale, to be used in `Array.prototype.sort`.\n * @param locale locale of the comparison; defaults to `en-US`\n * @return negative if `a` comes before `b`, positive if it comes after and 0 if they are equivalent\n */\nexport function compareText(a: string, b: string, locale: string = DEFAULT_LOCALE): number {\n return collator(locale).compare(a, b);\n}\n\n/** Tells whether a value is absent (`null` or `undefined`). */\nexport const isAbsent = (value: unknown): value is null | undefined => value === null || value === undefined;\n\n/**\n * Compares two values of any type in ascending order, to be used in `Array.prototype.sort`: numbers and dates by\n * value, texts according to the locale and the other values by their text representation. Absent values\n * (`null`/`undefined`) always come last.\n * @param locale locale of the text comparison; defaults to `en-US`\n * @return negative if `a` comes before `b`, positive if it comes after and 0 if they are equivalent\n */\nexport function compareValues(a: unknown, b: unknown, locale: string = DEFAULT_LOCALE): number {\n if (isAbsent(a) || isAbsent(b)) return Number(isAbsent(a)) - Number(isAbsent(b));\n if (typeof a === 'number' && typeof b === 'number') return a - b;\n if (a instanceof Date && b instanceof Date) return a.getTime() - b.getTime();\n\n return compareText(String(a), String(b), locale);\n}\n"],"mappings":";;;;;;;;;;;;AAYA,IAAM,4BAAY,IAAI,IAA2B;;;;;AAMjD,SAAS,SAAS,QAA+B;CAC7C,IAAI,SAAS,UAAU,IAAI,MAAM;CACjC,IAAI,CAAC,QAAQ;EACT,SAAS,IAAI,KAAK,SAAS,QAAQ,EAAE,SAAS,KAAK,CAAC;EACpD,UAAU,IAAI,QAAQ,MAAM;CAChC;CAEA,OAAO;AACX;;;;;;AAOA,SAAgB,YAAY,GAAW,GAAW,SAAiB,gBAAwB;CACvF,OAAO,SAAS,MAAM,CAAC,CAAC,QAAQ,GAAG,CAAC;AACxC;;AAGA,IAAa,YAAY,UAA8C,UAAU,QAAQ,UAAU,KAAA;;;;;;;;AASnG,SAAgB,cAAc,GAAY,GAAY,SAAiB,gBAAwB;CAC3F,IAAI,SAAS,CAAC,KAAK,SAAS,CAAC,GAAG,OAAO,OAAO,SAAS,CAAC,CAAC,IAAI,OAAO,SAAS,CAAC,CAAC;CAC/E,IAAI,OAAO,MAAM,YAAY,OAAO,MAAM,UAAU,OAAO,IAAI;CAC/D,IAAI,aAAa,QAAQ,aAAa,MAAM,OAAO,EAAE,QAAQ,IAAI,EAAE,QAAQ;CAE3E,OAAO,YAAY,OAAO,CAAC,GAAG,OAAO,CAAC,GAAG,MAAM;AACnD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { DateValue } from '@mantine/dates';
|
|
2
|
+
export declare const BR_DATE_FORMAT = "DD/MM/YYYY";
|
|
3
|
+
export declare const ISO_DATE_FORMAT = "YYYY-MM-DD";
|
|
4
|
+
/**
|
|
5
|
+
* Minimum value for a date to be considered valid when Zod coerces it. It is later than the date created by
|
|
6
|
+
* `new Date(null)` (12/31/1969), which Zod's `coerce` produces when a date field is not filled and receives `null`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const MIN_VALID_DATE: Date;
|
|
9
|
+
/**
|
|
10
|
+
* Formats a date.
|
|
11
|
+
* @param date date to format
|
|
12
|
+
* @param format format, in Day.js tokens; defaults to {@link BR_DATE_FORMAT}
|
|
13
|
+
* @return the formatted date, or `null` if there is no date
|
|
14
|
+
*/
|
|
15
|
+
export declare function formatDate(date: Date | undefined | null, format?: string): string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Formats a date in the ISO 8601 format.
|
|
18
|
+
* @param date date to format
|
|
19
|
+
* @see #ISO_DATE_FORMAT
|
|
20
|
+
*/
|
|
21
|
+
export declare function formatDateToISO(date: Date | undefined | null): string | null;
|
|
22
|
+
/**
|
|
23
|
+
* Converts a date in the given format to a `Date` object.
|
|
24
|
+
* @param dateValue date to convert
|
|
25
|
+
* @param format format of the date, in Day.js tokens; defaults to {@link BR_DATE_FORMAT}
|
|
26
|
+
* @return the date, or `null` if there is no date
|
|
27
|
+
*/
|
|
28
|
+
export declare function parseDate(dateValue: DateValue | string | undefined, format?: string): Date | null;
|
|
29
|
+
/** @return the current year and month in the `YYYY-MM` format */
|
|
30
|
+
export declare function getCurrentYearMonth(): string;
|
|
31
|
+
/**
|
|
32
|
+
* Checks whether the end date is after the start date.
|
|
33
|
+
* @param startDate start of the interval
|
|
34
|
+
* @param endDate end of the interval; an absent or empty (before {@link MIN_VALID_DATE}) end date is valid
|
|
35
|
+
* @return `true` if the interval is valid
|
|
36
|
+
*/
|
|
37
|
+
export declare function validDateInterval(startDate: Date, endDate: Date | undefined): boolean;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import dayjs from "dayjs";
|
|
3
|
+
// src/util/DateUtil.ts
|
|
4
|
+
var BR_DATE_FORMAT = "DD/MM/YYYY";
|
|
5
|
+
var ISO_DATE_FORMAT = "YYYY-MM-DD";
|
|
6
|
+
/**
|
|
7
|
+
* Minimum value for a date to be considered valid when Zod coerces it. It is later than the date created by
|
|
8
|
+
* `new Date(null)` (12/31/1969), which Zod's `coerce` produces when a date field is not filled and receives `null`.
|
|
9
|
+
*/
|
|
10
|
+
var MIN_VALID_DATE = /* @__PURE__ */ new Date("01/01/1970");
|
|
11
|
+
/**
|
|
12
|
+
* Formats a date.
|
|
13
|
+
* @param date date to format
|
|
14
|
+
* @param format format, in Day.js tokens; defaults to {@link BR_DATE_FORMAT}
|
|
15
|
+
* @return the formatted date, or `null` if there is no date
|
|
16
|
+
*/
|
|
17
|
+
function formatDate(date, format = BR_DATE_FORMAT) {
|
|
18
|
+
return date ? dayjs(date).format(format) : null;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Formats a date in the ISO 8601 format.
|
|
22
|
+
* @param date date to format
|
|
23
|
+
* @see #ISO_DATE_FORMAT
|
|
24
|
+
*/
|
|
25
|
+
function formatDateToISO(date) {
|
|
26
|
+
return date ? dayjs(date).format(ISO_DATE_FORMAT) : null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Converts a date in the given format to a `Date` object.
|
|
30
|
+
* @param dateValue date to convert
|
|
31
|
+
* @param format format of the date, in Day.js tokens; defaults to {@link BR_DATE_FORMAT}
|
|
32
|
+
* @return the date, or `null` if there is no date
|
|
33
|
+
*/
|
|
34
|
+
function parseDate(dateValue, format = BR_DATE_FORMAT) {
|
|
35
|
+
return dateValue ? dayjs(dateValue, format).toDate() : null;
|
|
36
|
+
}
|
|
37
|
+
/** @return the current year and month in the `YYYY-MM` format */
|
|
38
|
+
function getCurrentYearMonth() {
|
|
39
|
+
const currentDate = /* @__PURE__ */ new Date();
|
|
40
|
+
return `${currentDate.getFullYear()}-${(currentDate.getMonth() + 1).toString().padStart(2, "0")}`;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Checks whether the end date is after the start date.
|
|
44
|
+
* @param startDate start of the interval
|
|
45
|
+
* @param endDate end of the interval; an absent or empty (before {@link MIN_VALID_DATE}) end date is valid
|
|
46
|
+
* @return `true` if the interval is valid
|
|
47
|
+
*/
|
|
48
|
+
function validDateInterval(startDate, endDate) {
|
|
49
|
+
return !endDate || endDate <= MIN_VALID_DATE || endDate > startDate;
|
|
50
|
+
}
|
|
51
|
+
export { BR_DATE_FORMAT, ISO_DATE_FORMAT, MIN_VALID_DATE, formatDate, formatDateToISO, getCurrentYearMonth, parseDate, validDateInterval };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=DateUtil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateUtil.js","names":[],"sources":["../../src/util/DateUtil.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport type { DateValue } from '@mantine/dates';\n\nexport const BR_DATE_FORMAT = 'DD/MM/YYYY';\nexport const ISO_DATE_FORMAT = 'YYYY-MM-DD';\n\n/**\n * Minimum value for a date to be considered valid when Zod coerces it. It is later than the date created by\n * `new Date(null)` (12/31/1969), which Zod's `coerce` produces when a date field is not filled and receives `null`.\n */\nexport const MIN_VALID_DATE = new Date('01/01/1970');\n\n/**\n * Formats a date.\n * @param date date to format\n * @param format format, in Day.js tokens; defaults to {@link BR_DATE_FORMAT}\n * @return the formatted date, or `null` if there is no date\n */\nexport function formatDate(date: Date | undefined | null, format: string = BR_DATE_FORMAT): string | null {\n return date ? dayjs(date).format(format) : null;\n}\n\n/**\n * Formats a date in the ISO 8601 format.\n * @param date date to format\n * @see #ISO_DATE_FORMAT\n */\nexport function formatDateToISO(date: Date | undefined | null): string | null {\n return date ? dayjs(date).format(ISO_DATE_FORMAT) : null;\n}\n\n/**\n * Converts a date in the given format to a `Date` object.\n * @param dateValue date to convert\n * @param format format of the date, in Day.js tokens; defaults to {@link BR_DATE_FORMAT}\n * @return the date, or `null` if there is no date\n */\nexport function parseDate(dateValue: DateValue | string | undefined, format: string = BR_DATE_FORMAT): Date | null {\n return dateValue ? dayjs(dateValue, format).toDate() : null;\n}\n\n/** @return the current year and month in the `YYYY-MM` format */\nexport function getCurrentYearMonth(): string {\n const currentDate = new Date();\n const year = currentDate.getFullYear();\n const month = (currentDate.getMonth() + 1).toString().padStart(2, '0');\n return `${year}-${month}`;\n}\n\n/**\n * Checks whether the end date is after the start date.\n * @param startDate start of the interval\n * @param endDate end of the interval; an absent or empty (before {@link MIN_VALID_DATE}) end date is valid\n * @return `true` if the interval is valid\n */\nexport function validDateInterval(startDate: Date, endDate: Date | undefined): boolean {\n return !endDate || endDate <= MIN_VALID_DATE || endDate > startDate;\n}\n"],"mappings":";;;AAGA,IAAa,iBAAiB;AAC9B,IAAa,kBAAkB;;;;;AAM/B,IAAa,iCAAiB,IAAI,KAAK,YAAY;;;;;;;AAQnD,SAAgB,WAAW,MAA+B,SAAiB,gBAA+B;CACtG,OAAO,OAAO,MAAM,IAAI,CAAC,CAAC,OAAO,MAAM,IAAI;AAC/C;;;;;;AAOA,SAAgB,gBAAgB,MAA8C;CAC1E,OAAO,OAAO,MAAM,IAAI,CAAC,CAAC,OAAO,eAAe,IAAI;AACxD;;;;;;;AAQA,SAAgB,UAAU,WAA2C,SAAiB,gBAA6B;CAC/G,OAAO,YAAY,MAAM,WAAW,MAAM,CAAC,CAAC,OAAO,IAAI;AAC3D;;AAGA,SAAgB,sBAA8B;CAC1C,MAAM,8BAAc,IAAI,KAAK;CAG7B,OAAO,GAFM,YAAY,YAEf,EAAK,IADA,YAAY,SAAS,IAAI,EAAA,CAAG,SAAS,CAAC,CAAC,SAAS,GAAG,GAChD;AACtB;;;;;;;AAQA,SAAgB,kBAAkB,WAAiB,SAAoC;CACnF,OAAO,CAAC,WAAW,WAAW,kBAAkB,UAAU;AAC9D"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Makes the browser download a content generated in the page itself (e.g. an exported file), as a download link would.
|
|
3
|
+
* @param blob content of the file
|
|
4
|
+
* @param fileName name of the saved file
|
|
5
|
+
*/
|
|
6
|
+
export declare function downloadBlob(blob: Blob, fileName: string): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
// src/util/DownloadUtil.ts
|
|
3
|
+
/**
|
|
4
|
+
* Time (ms) until the URL of the downloaded content is released. The download starts after the click, asynchronously:
|
|
5
|
+
* releasing the URL right after makes some browsers (e.g. Firefox and Safari) cancel the download or save an empty file.
|
|
6
|
+
*/
|
|
7
|
+
var REVOKE_DELAY = 1e4;
|
|
8
|
+
/**
|
|
9
|
+
* Makes the browser download a content generated in the page itself (e.g. an exported file), as a download link would.
|
|
10
|
+
* @param blob content of the file
|
|
11
|
+
* @param fileName name of the saved file
|
|
12
|
+
*/
|
|
13
|
+
function downloadBlob(blob, fileName) {
|
|
14
|
+
const url = URL.createObjectURL(blob);
|
|
15
|
+
const link = document.createElement("a");
|
|
16
|
+
link.href = url;
|
|
17
|
+
link.download = fileName;
|
|
18
|
+
document.body.appendChild(link);
|
|
19
|
+
link.click();
|
|
20
|
+
link.remove();
|
|
21
|
+
setTimeout(() => URL.revokeObjectURL(url), REVOKE_DELAY);
|
|
22
|
+
}
|
|
23
|
+
export { downloadBlob };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=DownloadUtil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DownloadUtil.js","names":[],"sources":["../../src/util/DownloadUtil.ts"],"sourcesContent":["/**\n * Time (ms) until the URL of the downloaded content is released. The download starts after the click, asynchronously:\n * releasing the URL right after makes some browsers (e.g. Firefox and Safari) cancel the download or save an empty file.\n */\nconst REVOKE_DELAY = 10_000;\n\n/**\n * Makes the browser download a content generated in the page itself (e.g. an exported file), as a download link would.\n * @param blob content of the file\n * @param fileName name of the saved file\n */\nexport function downloadBlob(blob: Blob, fileName: string): void {\n const url = URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.download = fileName;\n document.body.appendChild(link);\n link.click();\n link.remove();\n setTimeout(() => URL.revokeObjectURL(url), REVOKE_DELAY);\n}\n"],"mappings":";;;;;;AAIA,IAAM,eAAe;;;;;;AAOrB,SAAgB,aAAa,MAAY,UAAwB;CAC7D,MAAM,MAAM,IAAI,gBAAgB,IAAI;CACpC,MAAM,OAAO,SAAS,cAAc,GAAG;CACvC,KAAK,OAAO;CACZ,KAAK,WAAW;CAChB,SAAS,KAAK,YAAY,IAAI;CAC9B,KAAK,MAAM;CACX,KAAK,OAAO;CACZ,iBAAiB,IAAI,gBAAgB,GAAG,GAAG,YAAY;AAC3D"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the number values of an enum. Values of other types are not returned.
|
|
3
|
+
* @param enumType enum to read the values from
|
|
4
|
+
*/
|
|
5
|
+
export declare function getEnumValues(enumType: object): number[];
|
|
6
|
+
/**
|
|
7
|
+
* Returns the keys of an enum.
|
|
8
|
+
* @param enumType enum to read the keys from
|
|
9
|
+
* @template KeyType type of the returned keys. The keys are strings by default. To use them to read the enum values
|
|
10
|
+
* as an array (`MyEnum[key]`), use `keyof typeof MyEnum`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getEnumKeys<KeyType = string>(enumType: object): KeyType[];
|
|
13
|
+
/**
|
|
14
|
+
* Returns a `Map` whose keys are the values of the enum items and whose values are the keys of these items.
|
|
15
|
+
* @param enumType enum to read the entries from
|
|
16
|
+
* @template KeyType type of the returned keys. The keys are strings by default. To use them to read the enum values
|
|
17
|
+
* as an array (`MyEnum[key]`), use `keyof typeof MyEnum`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getEnumEntries<KeyType = string>(enumType: object): Map<number, KeyType>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
// src/util/EnumUtil.ts
|
|
3
|
+
/**
|
|
4
|
+
* Returns the number values of an enum. Values of other types are not returned.
|
|
5
|
+
* @param enumType enum to read the values from
|
|
6
|
+
*/
|
|
7
|
+
function getEnumValues(enumType) {
|
|
8
|
+
return Object.values(enumType).filter((value) => typeof value === "number");
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Returns the keys of an enum.
|
|
12
|
+
* @param enumType enum to read the keys from
|
|
13
|
+
* @template KeyType type of the returned keys. The keys are strings by default. To use them to read the enum values
|
|
14
|
+
* as an array (`MyEnum[key]`), use `keyof typeof MyEnum`.
|
|
15
|
+
*/
|
|
16
|
+
function getEnumKeys(enumType) {
|
|
17
|
+
return Object.values(enumType).filter((key) => typeof key === "string").map((key) => key);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns a `Map` whose keys are the values of the enum items and whose values are the keys of these items.
|
|
21
|
+
* @param enumType enum to read the entries from
|
|
22
|
+
* @template KeyType type of the returned keys. The keys are strings by default. To use them to read the enum values
|
|
23
|
+
* as an array (`MyEnum[key]`), use `keyof typeof MyEnum`.
|
|
24
|
+
*/
|
|
25
|
+
function getEnumEntries(enumType) {
|
|
26
|
+
const map = /* @__PURE__ */ new Map();
|
|
27
|
+
Object.entries(enumType).filter(([, value]) => typeof value === "number").forEach(([key, value]) => map.set(value, key));
|
|
28
|
+
return map;
|
|
29
|
+
}
|
|
30
|
+
export { getEnumEntries, getEnumKeys, getEnumValues };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=EnumUtil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnumUtil.js","names":[],"sources":["../../src/util/EnumUtil.ts"],"sourcesContent":["/**\n * Returns the number values of an enum. Values of other types are not returned.\n * @param enumType enum to read the values from\n */\nexport function getEnumValues(enumType: object): number[] {\n return Object.values(enumType).filter(value => typeof value === 'number');\n}\n\n/**\n * Returns the keys of an enum.\n * @param enumType enum to read the keys from\n * @template KeyType type of the returned keys. The keys are strings by default. To use them to read the enum values\n * as an array (`MyEnum[key]`), use `keyof typeof MyEnum`.\n */\nexport function getEnumKeys<KeyType = string>(enumType: object): KeyType[] {\n return Object.values(enumType)\n .filter(key => typeof key === 'string')\n .map(key => key as KeyType);\n}\n\n/**\n * Returns a `Map` whose keys are the values of the enum items and whose values are the keys of these items.\n * @param enumType enum to read the entries from\n * @template KeyType type of the returned keys. The keys are strings by default. To use them to read the enum values\n * as an array (`MyEnum[key]`), use `keyof typeof MyEnum`.\n */\nexport function getEnumEntries<KeyType = string>(enumType: object): Map<number, KeyType> {\n const map = new Map<number, KeyType>();\n Object.entries(enumType)\n .filter(([, value]) => typeof value === 'number')\n .forEach(([key, value]) => map.set(value, key as KeyType));\n\n return map;\n}\n"],"mappings":";;;;;;AAIA,SAAgB,cAAc,UAA4B;CACtD,OAAO,OAAO,OAAO,QAAQ,CAAC,CAAC,QAAO,UAAS,OAAO,UAAU,QAAQ;AAC5E;;;;;;;AAQA,SAAgB,YAA8B,UAA6B;CACvE,OAAO,OAAO,OAAO,QAAQ,CAAC,CACzB,QAAO,QAAO,OAAO,QAAQ,QAAQ,CAAC,CACtC,KAAI,QAAO,GAAc;AAClC;;;;;;;AAQA,SAAgB,eAAiC,UAAwC;CACrF,MAAM,sBAAM,IAAI,IAAqB;CACrC,OAAO,QAAQ,QAAQ,CAAC,CACnB,QAAQ,GAAG,WAAW,OAAO,UAAU,QAAQ,CAAC,CAChD,SAAS,CAAC,KAAK,WAAW,IAAI,IAAI,OAAO,GAAc,CAAC;CAE7D,OAAO;AACX"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { UseFormReturnType } from '@mantine/form';
|
|
2
|
+
import { Identifiable } from '../model/Identifiable';
|
|
3
|
+
/**
|
|
4
|
+
* Fills a form with the data of a saved record. A record without an id (not saved yet) is ignored.
|
|
5
|
+
* @param initialize {@link UseFormReturnType#initialize} function of the form
|
|
6
|
+
* @param data data to fill the form with
|
|
7
|
+
*/
|
|
8
|
+
export declare function initForm<D extends Identifiable>(initialize: UseFormReturnType<D>['initialize'], data: D | null): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
// src/util/FormUtil.ts
|
|
3
|
+
/**
|
|
4
|
+
* Fills a form with the data of a saved record. A record without an id (not saved yet) is ignored.
|
|
5
|
+
* @param initialize {@link UseFormReturnType#initialize} function of the form
|
|
6
|
+
* @param data data to fill the form with
|
|
7
|
+
*/
|
|
8
|
+
function initForm(initialize, data) {
|
|
9
|
+
if (!data?.id) return;
|
|
10
|
+
initialize(data);
|
|
11
|
+
}
|
|
12
|
+
export { initForm };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=FormUtil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormUtil.js","names":[],"sources":["../../src/util/FormUtil.ts"],"sourcesContent":["import type { UseFormReturnType } from '@mantine/form';\n\nimport { Identifiable } from '../model/Identifiable';\n\n/**\n * Fills a form with the data of a saved record. A record without an id (not saved yet) is ignored.\n * @param initialize {@link UseFormReturnType#initialize} function of the form\n * @param data data to fill the form with\n */\nexport function initForm<D extends Identifiable>(initialize: UseFormReturnType<D>['initialize'], data: D | null): void {\n if (!data?.id) return;\n\n initialize(data);\n}\n"],"mappings":";;;;;;;AASA,SAAgB,SAAiC,YAAgD,MAAsB;CACnH,IAAI,CAAC,MAAM,IAAI;CAEf,WAAW,IAAI;AACnB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escapes the HTML special characters of a text, so it is shown as text, and not interpreted as HTML, when inserted in
|
|
3
|
+
* an HTML snippet built as a string (e.g. an ECharts tooltip). It prevents data typed by a user with a tag (e.g.
|
|
4
|
+
* `<img onerror=...>`) from running JavaScript (XSS).
|
|
5
|
+
* @param text text to escape
|
|
6
|
+
* @return the text with `&`, `<`, `>`, `"` and `'` replaced by the corresponding HTML entities
|
|
7
|
+
*/
|
|
8
|
+
export declare function escapeHtml(text: string): string;
|