@addev-be/ui 3.2.9 → 3.3.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/assets/icons/arrow-down-1-9.svg +1 -1
- package/assets/icons/arrow-down-a-z.svg +1 -1
- package/assets/icons/arrow-up-z-a.svg +1 -1
- package/assets/icons/check.svg +1 -1
- package/assets/icons/circle-check.svg +1 -1
- package/assets/icons/down.svg +1 -1
- package/assets/icons/filter-full.svg +1 -1
- package/assets/icons/filter.svg +1 -1
- package/assets/icons/hashtag.svg +1 -1
- package/assets/icons/image-slash.svg +1 -1
- package/assets/icons/left.svg +1 -1
- package/assets/icons/magnifier.svg +1 -1
- package/assets/icons/phone.svg +1 -1
- package/assets/icons/right.svg +1 -1
- package/assets/icons/sort-calendar-ascending.svg +5 -5
- package/assets/icons/spinner-third.svg +1 -1
- package/assets/icons/table-columns.svg +1 -1
- package/assets/icons/table-footer-slash.svg +4 -4
- package/assets/icons/table-footer.svg +3 -3
- package/assets/icons/table.svg +1 -1
- package/assets/icons/up.svg +1 -1
- package/assets/icons/user-tie.svg +1 -1
- package/assets/icons/x-bar.svg +3 -3
- package/dist/components/auth/PasswordResetForm.js +7 -2
- package/dist/components/common/Accordion/Accordion.d.ts +14 -0
- package/dist/components/common/Accordion/Accordion.js +81 -0
- package/dist/components/common/Accordion/index.d.ts +2 -0
- package/dist/components/common/PropertiesList/PropertyInput.d.ts +7 -0
- package/dist/components/common/PropertiesList/PropertyInput.js +142 -0
- package/dist/components/common/PropertiesList/index.d.ts +8 -0
- package/dist/components/common/PropertiesList/index.js +28 -0
- package/dist/components/common/PropertiesList/types.d.ts +44 -0
- package/dist/components/common/TabsView/styles.js +10 -8
- package/dist/components/common/TreeView/TreeContext.d.ts +55 -0
- package/dist/components/common/TreeView/TreeContext.js +172 -0
- package/dist/components/common/TreeView/TreeView.d.ts +19 -0
- package/dist/components/common/TreeView/TreeView.js +202 -0
- package/dist/components/common/TreeView/index.d.ts +3 -0
- package/dist/components/common/index.d.ts +3 -0
- package/dist/components/common/index.js +25 -16
- package/dist/components/grid/DataGrid/DataGridCell.js +30 -29
- package/dist/components/grid/DataGrid/DataGridEditableCell/index.d.ts +1 -1
- package/dist/components/grid/DataGrid/DataGridEditableCell/index.js +37 -27
- package/dist/components/grid/DataGrid/DataGridRowTemplate.js +71 -56
- package/dist/components/layout/ContextMenu/ContextMenu.d.ts +42 -0
- package/dist/components/layout/ContextMenu/ContextMenu.js +252 -0
- package/dist/components/layout/ContextMenu/index.d.ts +2 -0
- package/dist/components/layout/LeftMenu/LeftMenu.d.ts +22 -0
- package/dist/components/layout/LeftMenu/LeftMenu.js +43 -0
- package/dist/components/layout/LeftMenu/index.d.ts +2 -0
- package/dist/components/layout/PanelContainer/PanelContainer.d.ts +16 -0
- package/dist/components/layout/PanelContainer/PanelContainer.js +121 -0
- package/dist/components/layout/PanelContainer/index.d.ts +2 -0
- package/dist/components/layout/index.d.ts +3 -0
- package/dist/components/layout/index.js +30 -15
- package/dist/helpers/cn.d.ts +2 -0
- package/dist/helpers/cn.js +8 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.js +33 -31
- package/eslint.config.js +3 -3
- package/package.json +5 -3
- package/src/components/auth/LoginForm.tsx +92 -92
- package/src/components/auth/LoginPage.tsx +32 -32
- package/src/components/auth/PasswordRecoveryForm.tsx +53 -53
- package/src/components/auth/PasswordResetForm.tsx +114 -114
- package/src/components/auth/index.ts +4 -4
- package/src/components/auth/styles.ts +14 -14
- package/src/components/common/Accordion/Accordion.tsx +140 -0
- package/src/components/common/Accordion/index.ts +2 -0
- package/src/components/common/Avatar/index.tsx +54 -54
- package/src/components/common/Avatar/styles.ts +61 -61
- package/src/components/common/Card/index.tsx +17 -17
- package/src/components/common/Card/styles.ts +38 -38
- package/src/components/common/ContextMenu/index.tsx +79 -79
- package/src/components/common/ContextMenu/styles.ts +119 -119
- package/src/components/common/Ellipsis.tsx +33 -33
- package/src/components/common/Label.tsx +93 -93
- package/src/components/common/Message/index.tsx +57 -57
- package/src/components/common/Message/styles.ts +44 -44
- package/src/components/common/PropertiesList/PropertyInput.tsx +173 -0
- package/src/components/common/PropertiesList/index.tsx +48 -0
- package/src/components/common/PropertiesList/types.ts +60 -0
- package/src/components/common/TabsView/TabsList.tsx +49 -49
- package/src/components/common/TabsView/TabsView.tsx +42 -42
- package/src/components/common/TabsView/index.ts +3 -3
- package/src/components/common/TabsView/styles.ts +83 -83
- package/src/components/common/TabsView/types.ts +12 -12
- package/src/components/common/TreeView/TreeContext.tsx +379 -0
- package/src/components/common/TreeView/TreeView.tsx +281 -0
- package/src/components/common/TreeView/index.ts +3 -0
- package/src/components/common/index.ts +10 -7
- package/src/components/forms/AutoTextArea.tsx +48 -48
- package/src/components/forms/BillitIdentifier/index.tsx +78 -78
- package/src/components/forms/BillitIdentifier/styles.tsx +43 -43
- package/src/components/forms/Button.tsx +130 -130
- package/src/components/forms/Form/Checkbox.tsx +12 -12
- package/src/components/forms/Form/CustomSelect.tsx +86 -86
- package/src/components/forms/Form/FormGroup.tsx +33 -33
- package/src/components/forms/Form/Input.tsx +16 -16
- package/src/components/forms/Form/Row.tsx +28 -28
- package/src/components/forms/Form/Select.tsx +99 -99
- package/src/components/forms/Form/TextArea.tsx +17 -17
- package/src/components/forms/Form/index.tsx +48 -48
- package/src/components/forms/Form/styles.ts +148 -148
- package/src/components/forms/IconButton.tsx +61 -61
- package/src/components/forms/IndeterminateCheckbox.tsx +46 -46
- package/src/components/forms/NumberInput.tsx +53 -53
- package/src/components/forms/Select.tsx +34 -34
- package/src/components/forms/VerticalLabel.tsx +20 -20
- package/src/components/forms/index.ts +11 -11
- package/src/components/forms/styles.ts +42 -42
- package/src/components/grid/DataGrid/DataGridCell.tsx +82 -81
- package/src/components/grid/DataGrid/DataGridColumnsModal/helpers.ts +9 -9
- package/src/components/grid/DataGrid/DataGridColumnsModal/hooks.tsx +59 -59
- package/src/components/grid/DataGrid/DataGridColumnsModal/index.tsx +182 -182
- package/src/components/grid/DataGrid/DataGridColumnsModal/styles.ts +104 -104
- package/src/components/grid/DataGrid/DataGridEditableCell/CheckboxEditableCell.tsx +37 -37
- package/src/components/grid/DataGrid/DataGridEditableCell/DateEditableCell.tsx +38 -38
- package/src/components/grid/DataGrid/DataGridEditableCell/NumberEditableCell.tsx +71 -71
- package/src/components/grid/DataGrid/DataGridEditableCell/TextEditableCell.tsx +37 -37
- package/src/components/grid/DataGrid/DataGridEditableCell/index.tsx +112 -106
- package/src/components/grid/DataGrid/DataGridEditableCell/styles.ts +35 -35
- package/src/components/grid/DataGrid/DataGridEditableCell/types.ts +18 -18
- package/src/components/grid/DataGrid/DataGridFilterMenu/FilterValuesScroller.tsx +129 -129
- package/src/components/grid/DataGrid/DataGridFilterMenu/helpers.ts +23 -23
- package/src/components/grid/DataGrid/DataGridFilterMenu/hooks.tsx +81 -81
- package/src/components/grid/DataGrid/DataGridFilterMenu/index.tsx +370 -370
- package/src/components/grid/DataGrid/DataGridFilterMenu/styles.ts +97 -97
- package/src/components/grid/DataGrid/DataGridFooter.tsx +48 -48
- package/src/components/grid/DataGrid/DataGridHeader.tsx +74 -74
- package/src/components/grid/DataGrid/DataGridHeaderCell.tsx +112 -112
- package/src/components/grid/DataGrid/DataGridRowTemplate.tsx +90 -83
- package/src/components/grid/DataGrid/DataGridToolbar.tsx +134 -134
- package/src/components/grid/DataGrid/FilterModalContent/index.tsx +137 -137
- package/src/components/grid/DataGrid/FilterModalContent/styles.ts +22 -22
- package/src/components/grid/DataGrid/constants.ts +6 -6
- package/src/components/grid/DataGrid/helpers/columns.tsx +452 -452
- package/src/components/grid/DataGrid/helpers/filters.ts +287 -287
- package/src/components/grid/DataGrid/helpers/index.ts +2 -2
- package/src/components/grid/DataGrid/hooks/index.ts +29 -29
- package/src/components/grid/DataGrid/hooks/useDataGrid.tsx +383 -383
- package/src/components/grid/DataGrid/hooks/useDataGridChangedRows.ts +97 -97
- package/src/components/grid/DataGrid/hooks/useDataGridCopy.ts +174 -174
- package/src/components/grid/DataGrid/hooks/useDataGridSettings.ts +48 -48
- package/src/components/grid/DataGrid/hooks/useRefreshModal.tsx +48 -48
- package/src/components/grid/DataGrid/index.tsx +111 -111
- package/src/components/grid/DataGrid/styles.ts +446 -446
- package/src/components/grid/DataGrid/types.ts +380 -380
- package/src/components/grid/SqlRequestDataGrid/helpers/columns.tsx +526 -526
- package/src/components/grid/SqlRequestDataGrid/helpers/index.ts +2 -2
- package/src/components/grid/SqlRequestDataGrid/helpers/rows.ts +24 -24
- package/src/components/grid/SqlRequestDataGrid/helpers/sqlRequests.ts +17 -17
- package/src/components/grid/SqlRequestDataGrid/index.tsx +417 -417
- package/src/components/grid/SqlRequestDataGrid/styles.ts +15 -15
- package/src/components/grid/SqlRequestDataGrid/types.ts +74 -74
- package/src/components/grid/SqlRequestForeignList/index.tsx +254 -254
- package/src/components/grid/SqlRequestForeignList/styles.ts +43 -43
- package/src/components/grid/SqlRequestForeignList/types.ts +32 -32
- package/src/components/grid/SqlRequestGrid/filters/FiltersSidebar.tsx +108 -108
- package/src/components/grid/SqlRequestGrid/filters/styles.ts +88 -88
- package/src/components/grid/SqlRequestGrid/helpers/index.ts +1 -1
- package/src/components/grid/SqlRequestGrid/helpers/sqlRequests.ts +16 -16
- package/src/components/grid/SqlRequestGrid/index.tsx +304 -304
- package/src/components/grid/SqlRequestGrid/styles.ts +20 -20
- package/src/components/grid/SqlRequestGrid/types.ts +73 -73
- package/src/components/grid/VirtualScroller/hooks.ts +71 -71
- package/src/components/grid/VirtualScroller/index.tsx +89 -89
- package/src/components/grid/VirtualScroller/styles.ts +57 -57
- package/src/components/grid/VirtualScroller/types.ts +10 -10
- package/src/components/grid/index.ts +11 -11
- package/src/components/layout/Columns.ts +28 -28
- package/src/components/layout/ContextMenu/ContextMenu.tsx +471 -0
- package/src/components/layout/ContextMenu/index.ts +23 -0
- package/src/components/layout/Dropdown/index.tsx +113 -113
- package/src/components/layout/Dropdown/styles.ts +53 -53
- package/src/components/layout/Flexbox.ts +21 -21
- package/src/components/layout/Grid/index.tsx +8 -8
- package/src/components/layout/Grid/styles.ts +34 -34
- package/src/components/layout/LeftMenu/LeftMenu.tsx +89 -0
- package/src/components/layout/LeftMenu/index.ts +2 -0
- package/src/components/layout/Loading/index.tsx +29 -29
- package/src/components/layout/Loading/styles.ts +29 -29
- package/src/components/layout/Masonry/index.tsx +29 -29
- package/src/components/layout/Masonry/styles.ts +20 -20
- package/src/components/layout/Modal/index.tsx +51 -51
- package/src/components/layout/Modal/styles.ts +125 -125
- package/src/components/layout/PanelContainer/PanelContainer.tsx +198 -0
- package/src/components/layout/PanelContainer/index.ts +2 -0
- package/src/components/layout/index.ts +10 -7
- package/src/components/search/HighlightedText.tsx +41 -41
- package/src/components/search/QuickSearchBar.tsx +125 -125
- package/src/components/search/QuickSearchResults.tsx +90 -90
- package/src/components/search/index.ts +5 -5
- package/src/components/search/styles.ts +96 -96
- package/src/components/search/types.ts +29 -29
- package/src/config/index.ts +10 -10
- package/src/helpers/cn.ts +6 -0
- package/src/helpers/components.ts +9 -9
- package/src/helpers/dates.ts +17 -17
- package/src/helpers/getScrollbarSize.ts +14 -14
- package/src/helpers/index.ts +8 -7
- package/src/helpers/numbers.ts +63 -63
- package/src/helpers/responsive.ts +83 -83
- package/src/helpers/styled/size.ts +24 -24
- package/src/helpers/styled/space.ts +111 -111
- package/src/helpers/styled/typography.ts +25 -25
- package/src/helpers/text.ts +13 -13
- package/src/helpers/types.ts +9 -9
- package/src/hooks/index.ts +9 -9
- package/src/hooks/providers.ts +14 -14
- package/src/hooks/useContainerMediaQuery.ts +7 -7
- package/src/hooks/useElementSize.ts +24 -24
- package/src/hooks/useMediaQuery.ts +9 -9
- package/src/hooks/useMediaQueryForWidth.ts +35 -35
- package/src/hooks/useMutableState.test.ts +410 -410
- package/src/hooks/useMutableState.ts +39 -39
- package/src/hooks/useShowArchived.ts +28 -28
- package/src/hooks/useWindowSize.ts +20 -20
- package/src/icons/index.tsx +138 -138
- package/src/providers/AuthenticationProvider/helpers.ts +3 -3
- package/src/providers/AuthenticationProvider/index.tsx +303 -303
- package/src/providers/LoadingProvider/index.tsx +47 -47
- package/src/providers/PortalsProvider/index.tsx +54 -54
- package/src/providers/PortalsProvider/styles.ts +31 -31
- package/src/providers/SettingsProvider/index.tsx +70 -70
- package/src/providers/ToastProvider/index.tsx +93 -93
- package/src/providers/TrackingProvider/hooks.ts +14 -14
- package/src/providers/TrackingProvider/index.tsx +71 -71
- package/src/providers/UiProviders/index.tsx +74 -74
- package/src/providers/UiProviders/styles.ts +10 -10
- package/src/providers/index.ts +6 -6
- package/src/services/HttpService.ts +92 -92
- package/src/services/WebSocketService.ts +155 -155
- package/src/services/advancedRequests.ts +102 -102
- package/src/services/base.ts +23 -23
- package/src/services/globalSearch.ts +32 -32
- package/src/services/hooks.ts +92 -92
- package/src/services/index.ts +20 -20
- package/src/services/requests/auth.ts +44 -44
- package/src/services/requests/generic.ts +76 -76
- package/src/services/requests/printing.ts +12 -12
- package/src/services/requests/tracking.ts +12 -12
- package/src/services/requests/userProfiles.ts +35 -35
- package/src/services/requests/users.ts +28 -28
- package/src/services/smartQueries.ts +122 -122
- package/src/services/sqlRequests.ts +119 -119
- package/src/services/types/auth.ts +98 -98
- package/src/services/types/base.ts +10 -10
- package/src/services/types/generic.ts +102 -102
- package/src/services/types/printing.ts +10 -10
- package/src/services/types/tracking.ts +29 -29
- package/src/services/types/userProfiles.ts +79 -79
- package/src/services/types/users.ts +74 -74
- package/src/services/updateSqlRequests.ts +32 -32
- package/src/styles/animations.scss +30 -30
- package/src/styles/index.scss +42 -42
- package/src/theme/ThemeProvider.ts +73 -73
- package/src/theme/defaultTheme.ts +471 -471
- package/src/theme/helpers.ts +89 -89
- package/src/theme/index.ts +4 -4
- package/src/theme/types.ts +139 -139
- package/src/types/index.ts +8 -8
- package/src/typings.d.ts +2 -2
- package/tsconfig.json +41 -41
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { jsx as t, jsxs as X } from "react/jsx-runtime";
|
|
2
|
+
import { useState as u, useRef as $, useEffect as B } from "react";
|
|
3
|
+
import v from "../../../assets/icons/chevron-left.svg.js";
|
|
4
|
+
import g from "../../../assets/icons/chevron-right.svg.js";
|
|
5
|
+
import { cn as r } from "../../../helpers/cn.js";
|
|
6
|
+
function H({
|
|
7
|
+
side: e = "left",
|
|
8
|
+
collapsible: w = !1,
|
|
9
|
+
size: b = "300px",
|
|
10
|
+
resizable: a = !1,
|
|
11
|
+
panel: x,
|
|
12
|
+
children: y,
|
|
13
|
+
className: N,
|
|
14
|
+
panelClassName: W,
|
|
15
|
+
contentClassName: C,
|
|
16
|
+
defaultCollapsed: R = !1,
|
|
17
|
+
panelOverflow: S = "overflow-y-auto",
|
|
18
|
+
contentOverflow: d = "none"
|
|
19
|
+
}) {
|
|
20
|
+
const [n, E] = u(R), [i, I] = u(
|
|
21
|
+
() => T(b)
|
|
22
|
+
), [l, m] = u(!1), c = $(null), M = 200, L = 600, j = () => {
|
|
23
|
+
E(!n);
|
|
24
|
+
};
|
|
25
|
+
B(() => {
|
|
26
|
+
if (!a || !l) return;
|
|
27
|
+
const s = (h) => {
|
|
28
|
+
if (!c.current) return;
|
|
29
|
+
const p = c.current.getBoundingClientRect();
|
|
30
|
+
let o;
|
|
31
|
+
e === "left" ? o = h.clientX - p.left : o = p.right - h.clientX, o = Math.max(M, Math.min(L, o)), I(o);
|
|
32
|
+
}, f = () => {
|
|
33
|
+
m(!1);
|
|
34
|
+
};
|
|
35
|
+
return document.addEventListener("mousemove", s), document.addEventListener("mouseup", f), () => {
|
|
36
|
+
document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", f);
|
|
37
|
+
};
|
|
38
|
+
}, [l, a, e]);
|
|
39
|
+
const k = (s) => {
|
|
40
|
+
s.preventDefault(), m(!0);
|
|
41
|
+
}, P = {
|
|
42
|
+
width: n ? 0 : i,
|
|
43
|
+
minWidth: n ? 0 : i,
|
|
44
|
+
maxWidth: n ? 0 : i,
|
|
45
|
+
transition: l ? "none" : "width 0.3s ease-in-out, min-width 0.3s ease-in-out, max-width 0.3s ease-in-out",
|
|
46
|
+
overflow: n ? "hidden" : "visible"
|
|
47
|
+
}, D = a ? /* @__PURE__ */ t(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
onMouseDown: k,
|
|
51
|
+
className: r(
|
|
52
|
+
"relative flex w-1 items-center justify-center bg-border hover:bg-primary transition-colors cursor-col-resize group",
|
|
53
|
+
l && "bg-primary"
|
|
54
|
+
),
|
|
55
|
+
style: { userSelect: "none" },
|
|
56
|
+
children: /* @__PURE__ */ t("div", { className: "absolute inset-y-0 w-3 -translate-x-1/2 left-1/2" })
|
|
57
|
+
}
|
|
58
|
+
) : null;
|
|
59
|
+
return /* @__PURE__ */ X(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
ref: c,
|
|
63
|
+
className: r(
|
|
64
|
+
"relative flex h-full w-full",
|
|
65
|
+
e === "left" ? "flex-row" : "flex-row-reverse",
|
|
66
|
+
N
|
|
67
|
+
),
|
|
68
|
+
style: { userSelect: l ? "none" : "auto" },
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ t(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
className: r("relative bg-background border-border", W),
|
|
74
|
+
style: P,
|
|
75
|
+
children: /* @__PURE__ */ t(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
className: r("h-full w-full", S),
|
|
79
|
+
style: {
|
|
80
|
+
opacity: n ? 0 : 1,
|
|
81
|
+
transition: "opacity 0.2s ease-in-out"
|
|
82
|
+
},
|
|
83
|
+
children: x
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
D,
|
|
89
|
+
/* @__PURE__ */ t(
|
|
90
|
+
"div",
|
|
91
|
+
{
|
|
92
|
+
className: r(
|
|
93
|
+
"relative flex-1 bg-background",
|
|
94
|
+
d !== "none" && d,
|
|
95
|
+
C
|
|
96
|
+
),
|
|
97
|
+
children: /* @__PURE__ */ t("div", { className: "h-full w-full", children: y })
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
w && /* @__PURE__ */ t(
|
|
101
|
+
"button",
|
|
102
|
+
{
|
|
103
|
+
onClick: j,
|
|
104
|
+
className: r(
|
|
105
|
+
"absolute top-4 z-50 flex h-6 w-6 items-center justify-center rounded-md border border-border bg-background shadow-md hover:bg-accent transition-all duration-300",
|
|
106
|
+
e === "left" ? "left-4" : "right-4"
|
|
107
|
+
),
|
|
108
|
+
"aria-label": n ? `Expand ${e} panel` : `Collapse ${e} panel`,
|
|
109
|
+
children: e === "left" ? n ? /* @__PURE__ */ t(g, { className: "h-4 w-4" }) : /* @__PURE__ */ t(v, { className: "h-4 w-4" }) : n ? /* @__PURE__ */ t(v, { className: "h-4 w-4" }) : /* @__PURE__ */ t(g, { className: "h-4 w-4" })
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
function T(e) {
|
|
117
|
+
return e.endsWith("px") ? parseInt(e.replace("px", ""), 10) : e.endsWith("rem") ? parseInt(e.replace("rem", ""), 10) * 16 : e.endsWith("em") ? parseInt(e.replace("em", ""), 10) * 16 : parseInt(e, 10) || 300;
|
|
118
|
+
}
|
|
119
|
+
export {
|
|
120
|
+
H as PanelContainer
|
|
121
|
+
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
export * from './ContextMenu';
|
|
1
2
|
export * from './Columns';
|
|
2
3
|
export * from './Dropdown';
|
|
3
4
|
export * from './Flexbox';
|
|
4
5
|
export * from './Grid';
|
|
5
6
|
export * from './Loading';
|
|
7
|
+
export * from './LeftMenu';
|
|
6
8
|
export * from './Masonry';
|
|
7
9
|
export * from './Modal';
|
|
10
|
+
export * from './PanelContainer';
|
|
@@ -1,17 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { ContextMenu as t, ContextMenuContent as n, ContextMenuItem as r, ContextMenuLabel as x, ContextMenuSeparator as u, ContextMenuSub as C, ContextMenuSubContent as m, ContextMenuSubTrigger as M, ContextMenuTrigger as p, GlobalContextMenuProvider as f } from "./ContextMenu/ContextMenu.js";
|
|
2
|
+
import { Column as l, Columns as b } from "./Columns.js";
|
|
3
|
+
import { Dropdown as d } from "./Dropdown/index.js";
|
|
4
|
+
import { Flexbox as S } from "./Flexbox.js";
|
|
5
|
+
import { Grid as s } from "./Grid/index.js";
|
|
6
|
+
import { Loading as P } from "./Loading/index.js";
|
|
7
|
+
import { LeftMenu as v } from "./LeftMenu/LeftMenu.js";
|
|
8
|
+
import { Masonry as y } from "./Masonry/index.js";
|
|
9
|
+
import { Modal as F } from "./Modal/index.js";
|
|
10
|
+
import { PanelContainer as c } from "./PanelContainer/PanelContainer.js";
|
|
8
11
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
C as
|
|
12
|
+
l as Column,
|
|
13
|
+
b as Columns,
|
|
14
|
+
t as ContextMenu,
|
|
15
|
+
n as ContextMenuContent,
|
|
16
|
+
r as ContextMenuItem,
|
|
17
|
+
x as ContextMenuLabel,
|
|
18
|
+
u as ContextMenuSeparator,
|
|
19
|
+
C as ContextMenuSub,
|
|
20
|
+
m as ContextMenuSubContent,
|
|
21
|
+
M as ContextMenuSubTrigger,
|
|
22
|
+
p as ContextMenuTrigger,
|
|
23
|
+
d as Dropdown,
|
|
24
|
+
S as Flexbox,
|
|
25
|
+
f as GlobalContextMenuProvider,
|
|
26
|
+
s as Grid,
|
|
27
|
+
v as LeftMenu,
|
|
28
|
+
P as Loading,
|
|
29
|
+
y as Masonry,
|
|
30
|
+
F as Modal,
|
|
31
|
+
c as PanelContainer
|
|
17
32
|
};
|
package/dist/helpers/index.d.ts
CHANGED
package/dist/helpers/index.js
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { cn as a } from "./cn.js";
|
|
2
|
+
import { formatDate as t, formatDateTime as m } from "./dates.js";
|
|
3
|
+
import { decimalSeparator as f, formatMoney as i, formatNumber as n, formatNumberInvariant as x, formatPercentage as s, getCurrencySymbol as c, parseNumber as u } from "./numbers.js";
|
|
4
|
+
import { escapeForRegExp as g, extractTextFromHTML as l } from "./text.js";
|
|
5
|
+
import { containerQueries as S, findBreakpoint as T, isGreaterThanOrEqual as b, isSmallerThanOrEqual as h, mediaQueries as E } from "./responsive.js";
|
|
6
|
+
import { extractSizeProps as P, size as q } from "./styled/size.js";
|
|
7
|
+
import { extractSpaceProps as D, margins as F, paddings as M, space as O } from "./styled/space.js";
|
|
8
|
+
import { StyledTypography as k, typography as v } from "./styled/typography.js";
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
i as
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
s as
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
10
|
+
k as StyledTypography,
|
|
11
|
+
a as cn,
|
|
12
|
+
S as containerQueries,
|
|
13
|
+
f as decimalSeparator,
|
|
14
|
+
g as escapeForRegExp,
|
|
15
|
+
P as extractSizeProps,
|
|
16
|
+
D as extractSpaceProps,
|
|
17
|
+
l as extractTextFromHTML,
|
|
18
|
+
T as findBreakpoint,
|
|
19
|
+
t as formatDate,
|
|
20
|
+
m as formatDateTime,
|
|
21
|
+
i as formatMoney,
|
|
22
|
+
n as formatNumber,
|
|
23
|
+
x as formatNumberInvariant,
|
|
24
|
+
s as formatPercentage,
|
|
25
|
+
c as getCurrencySymbol,
|
|
26
|
+
b as isGreaterThanOrEqual,
|
|
27
|
+
h as isSmallerThanOrEqual,
|
|
28
|
+
F as margins,
|
|
29
|
+
E as mediaQueries,
|
|
30
|
+
M as paddings,
|
|
31
|
+
u as parseNumber,
|
|
32
|
+
q as size,
|
|
33
|
+
O as space,
|
|
34
|
+
v as typography
|
|
33
35
|
};
|
package/eslint.config.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { eslintReactConfig } from '@addev-be/framework-utils/eslint/react.config.mjs';
|
|
2
|
-
|
|
3
|
-
export default [...eslintReactConfig, { ignores: ['dist'] }];
|
|
1
|
+
import { eslintReactConfig } from '@addev-be/framework-utils/eslint/react.config.mjs';
|
|
2
|
+
|
|
3
|
+
export default [...eslintReactConfig, { ignores: ['dist'] }];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@addev-be/ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"watch": "vite build --watch",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"types": "./dist/hooks/index.d.ts"
|
|
49
49
|
},
|
|
50
50
|
"./icons": {
|
|
51
|
-
"import": "./dist/icons/index.
|
|
51
|
+
"import": "./dist/icons/index.js",
|
|
52
52
|
"types": "./dist/icons/index.d.ts"
|
|
53
53
|
},
|
|
54
54
|
"./providers": {
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"update-version": "../../node/update-version.mjs"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@addev-be/framework-utils": "^3.
|
|
77
|
+
"@addev-be/framework-utils": "^3.3.0",
|
|
78
78
|
"@testing-library/dom": "^10.4.1",
|
|
79
79
|
"@testing-library/react": "^16.3.0",
|
|
80
80
|
"@testing-library/react-hooks": "^8.0.1",
|
|
@@ -102,6 +102,7 @@
|
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
104
|
"@addev-be/logiprint-common": "3.0.3",
|
|
105
|
+
"@addev-be/tailed-components": "*",
|
|
105
106
|
"@uidotdev/usehooks": "^2.4.1",
|
|
106
107
|
"hash.js": "^1.1.7",
|
|
107
108
|
"lodash": "^4.17.21",
|
|
@@ -110,6 +111,7 @@
|
|
|
110
111
|
"react-router-dom": "^7.9.1",
|
|
111
112
|
"react-toastify": "^11.0.5",
|
|
112
113
|
"rxjs": "^7.8.2",
|
|
114
|
+
"tailwind-merge": "^3.5.0",
|
|
113
115
|
"uuid": "^13.0.0",
|
|
114
116
|
"zod": "^4.1.9"
|
|
115
117
|
}
|
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
import { FC, useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { Link, redirect } from 'react-router-dom';
|
|
3
|
-
|
|
4
|
-
import { Button } from '../forms/Button';
|
|
5
|
-
import { Card } from '../common/Card';
|
|
6
|
-
import { FormContainer } from './styles';
|
|
7
|
-
import { Input } from '../forms/styles';
|
|
8
|
-
import { Message } from '../common/Message';
|
|
9
|
-
import { StackedLabel } from '../forms/VerticalLabel';
|
|
10
|
-
import { useAuthentication } from '@hooks';
|
|
11
|
-
|
|
12
|
-
export const LoginForm: FC = () => {
|
|
13
|
-
const [username, setUsername] = useState(
|
|
14
|
-
localStorage.getItem('username') || ''
|
|
15
|
-
);
|
|
16
|
-
const [password, setPassword] = useState('');
|
|
17
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
18
|
-
const [error, setError] = useState('');
|
|
19
|
-
const usernameInputRef = useRef<HTMLInputElement>(null);
|
|
20
|
-
const passwordInputRef = useRef<HTMLInputElement>(null);
|
|
21
|
-
|
|
22
|
-
const { login } = useAuthentication();
|
|
23
|
-
|
|
24
|
-
const onLoginClicked = useCallback(() => {
|
|
25
|
-
setError('');
|
|
26
|
-
setIsLoading(true);
|
|
27
|
-
login(username, password).then((success) => {
|
|
28
|
-
setIsLoading(false);
|
|
29
|
-
if (success) {
|
|
30
|
-
localStorage.setItem('username', username);
|
|
31
|
-
redirect('/');
|
|
32
|
-
} else {
|
|
33
|
-
setError('Identifiants invalides');
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}, [login, password, username]);
|
|
37
|
-
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
if (usernameInputRef.current && passwordInputRef.current) {
|
|
40
|
-
const input = !username
|
|
41
|
-
? usernameInputRef.current
|
|
42
|
-
: passwordInputRef.current;
|
|
43
|
-
input.select();
|
|
44
|
-
input.focus();
|
|
45
|
-
}
|
|
46
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
47
|
-
}, []);
|
|
48
|
-
|
|
49
|
-
if (isLoading) return <div>Chargement...</div>;
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
<Card>
|
|
53
|
-
<FormContainer>
|
|
54
|
-
<StackedLabel label="Adresse e-mail / Nom d'utilisateur">
|
|
55
|
-
<Input
|
|
56
|
-
ref={usernameInputRef}
|
|
57
|
-
type="email"
|
|
58
|
-
autoComplete="email"
|
|
59
|
-
required
|
|
60
|
-
value={username}
|
|
61
|
-
onChange={(e) => setUsername(e.target.value)}
|
|
62
|
-
data-testid="login-username"
|
|
63
|
-
/>
|
|
64
|
-
</StackedLabel>
|
|
65
|
-
|
|
66
|
-
<StackedLabel label="Mot de passe">
|
|
67
|
-
<Input
|
|
68
|
-
ref={passwordInputRef}
|
|
69
|
-
type="password"
|
|
70
|
-
autoComplete="current-password"
|
|
71
|
-
required
|
|
72
|
-
value={password}
|
|
73
|
-
onChange={(e) => setPassword(e.target.value)}
|
|
74
|
-
data-testid="login-password"
|
|
75
|
-
/>
|
|
76
|
-
</StackedLabel>
|
|
77
|
-
|
|
78
|
-
{error && <Message type="error">{error}</Message>}
|
|
79
|
-
|
|
80
|
-
<Button
|
|
81
|
-
$color="primary"
|
|
82
|
-
onClick={onLoginClicked}
|
|
83
|
-
data-testid="login-submit"
|
|
84
|
-
>
|
|
85
|
-
Se connecter
|
|
86
|
-
</Button>
|
|
87
|
-
|
|
88
|
-
<Link to="/recover">Mot de passe oublié ?</Link>
|
|
89
|
-
</FormContainer>
|
|
90
|
-
</Card>
|
|
91
|
-
);
|
|
92
|
-
};
|
|
1
|
+
import { FC, useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { Link, redirect } from 'react-router-dom';
|
|
3
|
+
|
|
4
|
+
import { Button } from '../forms/Button';
|
|
5
|
+
import { Card } from '../common/Card';
|
|
6
|
+
import { FormContainer } from './styles';
|
|
7
|
+
import { Input } from '../forms/styles';
|
|
8
|
+
import { Message } from '../common/Message';
|
|
9
|
+
import { StackedLabel } from '../forms/VerticalLabel';
|
|
10
|
+
import { useAuthentication } from '@hooks';
|
|
11
|
+
|
|
12
|
+
export const LoginForm: FC = () => {
|
|
13
|
+
const [username, setUsername] = useState(
|
|
14
|
+
localStorage.getItem('username') || ''
|
|
15
|
+
);
|
|
16
|
+
const [password, setPassword] = useState('');
|
|
17
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
18
|
+
const [error, setError] = useState('');
|
|
19
|
+
const usernameInputRef = useRef<HTMLInputElement>(null);
|
|
20
|
+
const passwordInputRef = useRef<HTMLInputElement>(null);
|
|
21
|
+
|
|
22
|
+
const { login } = useAuthentication();
|
|
23
|
+
|
|
24
|
+
const onLoginClicked = useCallback(() => {
|
|
25
|
+
setError('');
|
|
26
|
+
setIsLoading(true);
|
|
27
|
+
login(username, password).then((success) => {
|
|
28
|
+
setIsLoading(false);
|
|
29
|
+
if (success) {
|
|
30
|
+
localStorage.setItem('username', username);
|
|
31
|
+
redirect('/');
|
|
32
|
+
} else {
|
|
33
|
+
setError('Identifiants invalides');
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}, [login, password, username]);
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (usernameInputRef.current && passwordInputRef.current) {
|
|
40
|
+
const input = !username
|
|
41
|
+
? usernameInputRef.current
|
|
42
|
+
: passwordInputRef.current;
|
|
43
|
+
input.select();
|
|
44
|
+
input.focus();
|
|
45
|
+
}
|
|
46
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
47
|
+
}, []);
|
|
48
|
+
|
|
49
|
+
if (isLoading) return <div>Chargement...</div>;
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<Card>
|
|
53
|
+
<FormContainer>
|
|
54
|
+
<StackedLabel label="Adresse e-mail / Nom d'utilisateur">
|
|
55
|
+
<Input
|
|
56
|
+
ref={usernameInputRef}
|
|
57
|
+
type="email"
|
|
58
|
+
autoComplete="email"
|
|
59
|
+
required
|
|
60
|
+
value={username}
|
|
61
|
+
onChange={(e) => setUsername(e.target.value)}
|
|
62
|
+
data-testid="login-username"
|
|
63
|
+
/>
|
|
64
|
+
</StackedLabel>
|
|
65
|
+
|
|
66
|
+
<StackedLabel label="Mot de passe">
|
|
67
|
+
<Input
|
|
68
|
+
ref={passwordInputRef}
|
|
69
|
+
type="password"
|
|
70
|
+
autoComplete="current-password"
|
|
71
|
+
required
|
|
72
|
+
value={password}
|
|
73
|
+
onChange={(e) => setPassword(e.target.value)}
|
|
74
|
+
data-testid="login-password"
|
|
75
|
+
/>
|
|
76
|
+
</StackedLabel>
|
|
77
|
+
|
|
78
|
+
{error && <Message type="error">{error}</Message>}
|
|
79
|
+
|
|
80
|
+
<Button
|
|
81
|
+
$color="primary"
|
|
82
|
+
onClick={onLoginClicked}
|
|
83
|
+
data-testid="login-submit"
|
|
84
|
+
>
|
|
85
|
+
Se connecter
|
|
86
|
+
</Button>
|
|
87
|
+
|
|
88
|
+
<Link to="/recover">Mot de passe oublié ?</Link>
|
|
89
|
+
</FormContainer>
|
|
90
|
+
</Card>
|
|
91
|
+
);
|
|
92
|
+
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { Outlet } from 'react-router-dom';
|
|
3
|
-
|
|
4
|
-
export const LoginPage: FC = () => {
|
|
5
|
-
return (
|
|
6
|
-
<div className="flex flex-row h-full w-full">
|
|
7
|
-
<div className="relative hidden w-0 flex-1 lg:block">
|
|
8
|
-
<img className="absolute inset-0 h-full w-full object-cover" alt="" />
|
|
9
|
-
</div>
|
|
10
|
-
<div className="flex flex-1 flex-col justify-space-evenly overflow-y-auto px-4 py-12 sm:px-6 lg:flex-none lg:px-24 xl:px-36">
|
|
11
|
-
<div className="mx-auto w-full max-w-sm lg:max-w-96 lg:w-96 xl:max-w-[32rem] xl:w-[32rem]">
|
|
12
|
-
<div className="text-center">
|
|
13
|
-
<img
|
|
14
|
-
className="h-20 w-auto inline-block"
|
|
15
|
-
src="/logo192.png"
|
|
16
|
-
alt="Burotel"
|
|
17
|
-
/>
|
|
18
|
-
<h2 className="mt-8 text-2xl font-bold leading-9 tracking-tight text-gray-900">
|
|
19
|
-
Connectez-vous
|
|
20
|
-
</h2>
|
|
21
|
-
</div>
|
|
22
|
-
|
|
23
|
-
<div className="mt-10 sm:mx-auto sm:w-full sm:max-w-[640px]">
|
|
24
|
-
<div className="bg-white px-6 py-12 shadow sm:rounded-lg sm:px-12">
|
|
25
|
-
<Outlet />
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { Outlet } from 'react-router-dom';
|
|
3
|
+
|
|
4
|
+
export const LoginPage: FC = () => {
|
|
5
|
+
return (
|
|
6
|
+
<div className="flex flex-row h-full w-full">
|
|
7
|
+
<div className="relative hidden w-0 flex-1 lg:block">
|
|
8
|
+
<img className="absolute inset-0 h-full w-full object-cover" alt="" />
|
|
9
|
+
</div>
|
|
10
|
+
<div className="flex flex-1 flex-col justify-space-evenly overflow-y-auto px-4 py-12 sm:px-6 lg:flex-none lg:px-24 xl:px-36">
|
|
11
|
+
<div className="mx-auto w-full max-w-sm lg:max-w-96 lg:w-96 xl:max-w-[32rem] xl:w-[32rem]">
|
|
12
|
+
<div className="text-center">
|
|
13
|
+
<img
|
|
14
|
+
className="h-20 w-auto inline-block"
|
|
15
|
+
src="/logo192.png"
|
|
16
|
+
alt="Burotel"
|
|
17
|
+
/>
|
|
18
|
+
<h2 className="mt-8 text-2xl font-bold leading-9 tracking-tight text-gray-900">
|
|
19
|
+
Connectez-vous
|
|
20
|
+
</h2>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div className="mt-10 sm:mx-auto sm:w-full sm:max-w-[640px]">
|
|
24
|
+
<div className="bg-white px-6 py-12 shadow sm:rounded-lg sm:px-12">
|
|
25
|
+
<Outlet />
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
};
|