kelt-ui-kit-react 1.8.5 → 1.9.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.
Files changed (124) hide show
  1. package/dist/App.js +22 -0
  2. package/dist/App.menu.js +251 -0
  3. package/dist/App.routes.js +8 -0
  4. package/dist/_core/hooks/HistoryProvider.js +29 -0
  5. package/dist/_core/hooks/ImageChecker.js +68 -0
  6. package/dist/_core/hooks/imageExist.js +5 -0
  7. package/dist/_core/hooks/isEAN13.js +10 -0
  8. package/dist/_core/hooks/objectToQueryParams.js +28 -0
  9. package/dist/_core/hooks/useCurrency.js +12 -0
  10. package/dist/_core/hooks/useDateutils.js +59 -0
  11. package/dist/_core/hooks/useIsMobile.js +13 -0
  12. package/dist/_core/hooks/useToken.js +17 -0
  13. package/dist/_core/hooks/useValidate.js +15 -0
  14. package/dist/_core/hooks/widgetSupport.js +18 -0
  15. package/dist/action/Action.view.js +22 -0
  16. package/dist/action/ButtonAction.js +25 -0
  17. package/dist/badge/Badge.js +25 -0
  18. package/dist/badge/Badge.view.js +5 -0
  19. package/dist/button/Button.js +25 -0
  20. package/dist/button/Button.view.js +74 -0
  21. package/dist/button/button.interface.js +1 -0
  22. package/dist/button/buttonActions/ButtonActions.js +55 -0
  23. package/dist/button/buttonFile/ButtonFile.js +37 -0
  24. package/dist/button/buttonFile/ButtonFile.view.js +35 -0
  25. package/dist/button/buttonFilters/ButtonFilters.js +47 -0
  26. package/dist/card/Card.js +57 -0
  27. package/dist/card/Card.view.js +60 -0
  28. package/dist/card/card.interface.js +1 -0
  29. package/dist/card/cardAction/CardAction.js +66 -0
  30. package/dist/card/cardAction.interface.js +1 -0
  31. package/dist/card/hook/useCardInteractions.js +25 -0
  32. package/dist/carousel/Carousel.js +67 -0
  33. package/dist/carousel/Carousel.view.js +16 -0
  34. package/dist/damier/Damier.js +48 -0
  35. package/dist/damier/Damier.view.js +22 -0
  36. package/dist/damier/damierCell/DamierCell.js +21 -0
  37. package/dist/damier/damierCell/damierCell.interface.js +1 -0
  38. package/dist/dataTable/DataTable.js +117 -0
  39. package/dist/dataTable/DataTable.view.js +48 -0
  40. package/dist/dataTable/dataTable.interface.d.ts +4 -1
  41. package/dist/dataTable/dataTable.interface.js +1 -0
  42. package/dist/dataTable/dataTableActions/DataTableAction.js +26 -0
  43. package/dist/dataTable/dataTableColumn/DataTableColumn.js +21 -0
  44. package/dist/dataTable/dataTableLoading/DataTableLoading.js +16 -0
  45. package/dist/dataTable/dataTableRow/DataTableRow.js +39 -0
  46. package/dist/datePicker/DatePicker.js +64 -0
  47. package/dist/datePicker/DatePicker.view.js +5 -0
  48. package/dist/expands/Expands.js +28 -0
  49. package/dist/expands/Expands.view.js +67 -0
  50. package/dist/expands/expand/expand.interface.js +1 -0
  51. package/dist/expands/expand/expand.js +40 -0
  52. package/dist/filAriane/FilAriane.js +28 -0
  53. package/dist/filAriane/FilAriane.view.js +28 -0
  54. package/dist/filAriane/filAriane.interface.js +1 -0
  55. package/dist/form/Form.js +135 -0
  56. package/dist/form/Form.view.js +50 -0
  57. package/dist/form/form.enum.js +14 -0
  58. package/dist/form/form.interface.js +1 -0
  59. package/dist/form/input/Input.js +26 -0
  60. package/dist/form/inputNumber/InputNumber.js +57 -0
  61. package/dist/form/inputNumber/InputNumber.view.js +7 -0
  62. package/dist/form/inputPrice/InputPrice.js +36 -0
  63. package/dist/form/inputPrice/InputPrice.view.js +7 -0
  64. package/dist/form/textArea/TextArea.js +18 -0
  65. package/dist/form/textArea/TextArea.view.js +15 -0
  66. package/dist/grid/Grid.js +19 -0
  67. package/dist/grid/Grid.view.js +22 -0
  68. package/dist/grid/col/Col.js +17 -0
  69. package/dist/grid/col/colStyled/ColStyled.js +26 -0
  70. package/dist/grid/container/Container.js +17 -0
  71. package/dist/grid/grid.interface.js +1 -0
  72. package/dist/grid/row/Row.js +17 -0
  73. package/dist/header/Header.js +26 -0
  74. package/dist/header/Header.view.js +5 -0
  75. package/dist/header/header.interface.js +1 -0
  76. package/dist/home/Home.js +4 -0
  77. package/dist/icon/Icon.js +6 -0
  78. package/dist/icon/Icons.view.js +27 -0
  79. package/dist/icon/icon.interface.js +1 -0
  80. package/dist/icon/iconSize.enum.js +8 -0
  81. package/dist/index.js +50 -5356
  82. package/dist/loader/Loader.js +20 -0
  83. package/dist/loader/Loader.view.js +9 -0
  84. package/dist/main.js +7 -0
  85. package/dist/menus/Menus.js +23 -0
  86. package/dist/menus/Menus.view.js +48 -0
  87. package/dist/menus/menu/Menu.js +15 -0
  88. package/dist/menus/menu/menu.interface.js +1 -0
  89. package/dist/message/Message.js +33 -0
  90. package/dist/message/Message.view.js +11 -0
  91. package/dist/modal/Modal.js +27 -0
  92. package/dist/modal/Modal.view.js +22 -0
  93. package/dist/notFound/NotFound.js +4 -0
  94. package/dist/overlayPanel/OverlayPanel.js +132 -0
  95. package/dist/overlayPanel/OverlayPanel.view.js +20 -0
  96. package/dist/overlayPanel/overlay.context.js +26 -0
  97. package/dist/overlayPanel/overlayPanelStyled/OverlayPanelStyled.js +13 -0
  98. package/dist/pdfViewer/PdfViewer.js +71 -0
  99. package/dist/pdfViewer/PdfViewer.view.js +5 -0
  100. package/dist/quantity/Quantity.js +60 -0
  101. package/dist/quantity/Quantity.view.js +1 -0
  102. package/dist/search/Search.js +80 -0
  103. package/dist/search/Search.view.js +8 -0
  104. package/dist/select/Select.d.ts +2 -1
  105. package/dist/select/Select.js +41 -0
  106. package/dist/select/Select.view.js +75 -0
  107. package/dist/select/selectOption.interface.js +1 -0
  108. package/dist/sidebar/Sidebar.js +132 -0
  109. package/dist/sidebar/Sidebar.view.js +11 -0
  110. package/dist/sidebarData/SidebarData.js +17 -0
  111. package/dist/sidebarData/SidebarData.view.js +14 -0
  112. package/dist/style.css +1 -1
  113. package/dist/tabs/Tabs.js +41 -0
  114. package/dist/tabs/Tabs.view.js +26 -0
  115. package/dist/toaster/Toaster.js +37 -0
  116. package/dist/toaster/Toaster.view.js +16 -0
  117. package/dist/toaster/store/useToasterStore.js +22 -0
  118. package/package.json +1 -1
  119. package/src/dataTable/DataTable.tsx +55 -14
  120. package/src/dataTable/dataTable.css +26 -2
  121. package/src/dataTable/dataTable.interface.ts +4 -1
  122. package/src/dataTable/dataTableRow/DataTableRow.tsx +36 -11
  123. package/src/select/Select.tsx +4 -1
  124. package/vite.config.ts.timestamp-1787675603363-8ddae73d076bd.mjs +28 -0
package/dist/App.js ADDED
@@ -0,0 +1,22 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { StrictMode } from "react";
14
+ import { BrowserRouter as Router } from "react-router-dom";
15
+ import "./App.css";
16
+ import { AppMenu } from "./App.menu";
17
+ import { AppRoutes } from "./App.routes";
18
+ import { Header } from "./header/Header";
19
+ import { OverlayProvider } from "./overlayPanel/overlay.context";
20
+ import { Toaster } from "./toaster/Toaster";
21
+ var App = function () { return (_jsx(StrictMode, { children: _jsx(OverlayProvider, { children: _jsx(Router, { children: _jsxs("div", __assign({ className: "main-layout" }, { children: [_jsx(Toaster, {}), _jsx(Header, { showBackNavigation: true }), _jsxs("div", __assign({ className: "d-flex h-100" }, { children: [_jsx(AppMenu, {}), _jsx("div", __assign({ className: "main-layout-content" }, { children: _jsx(AppRoutes, {}) }))] }))] })) }) }) })); };
22
+ export default App;
@@ -0,0 +1,251 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { NavLink } from "react-router-dom";
14
+ import { ActionView } from "./action/Action.view";
15
+ import { BadgeView } from "./badge/Badge.view";
16
+ import { ButtonView } from "./button/Button.view";
17
+ import { ButtonFileView } from "./button/buttonFile/ButtonFile.view";
18
+ import { CardView } from "./card/Card.view";
19
+ import { CarouselView } from "./carousel/Carousel.view";
20
+ import { DamierView } from "./damier/Damier.view";
21
+ import { DataTableView } from "./dataTable/DataTable.view";
22
+ import { DatePickerView } from "./datePicker/DatePicker.view";
23
+ import { ExpandsView } from "./expands/Expands.view";
24
+ import { FilArianeView } from "./filAriane/FilAriane.view";
25
+ import { FormView } from "./form/Form.view";
26
+ import { InputNumberView } from "./form/inputNumber/InputNumber.view";
27
+ import { InputPriceView } from "./form/inputPrice/InputPrice.view";
28
+ import { TextAreaView } from "./form/textArea/TextArea.view";
29
+ import { GridView } from "./grid/Grid.view";
30
+ import { HeaderView } from "./header/Header.view";
31
+ import { IconsView } from "./icon/Icons.view";
32
+ import { LoaderView } from "./loader/Loader.view";
33
+ import { Menus } from "./menus/Menus";
34
+ import { MenusView } from "./menus/Menus.view";
35
+ import { MessageView } from "./message/Message.view";
36
+ import { ModalView } from "./modal/Modal.view";
37
+ import { OverlayPanelView } from "./overlayPanel/OverlayPanel.view";
38
+ import { SearchView } from "./search/Search.view";
39
+ import { SelectView } from "./select/Select.view";
40
+ import { SidebarView } from "./sidebar/Sidebar.view";
41
+ import { SidebarDataView } from "./sidebarData/SidebarData.view";
42
+ import { TabsView } from "./tabs/Tabs.view";
43
+ import { ToasterView } from "./toaster/Toaster.view";
44
+ export var MenuList = [
45
+ {
46
+ id: 1,
47
+ name: "Expands",
48
+ link: "/expands",
49
+ children: _jsx(NavLink, __assign({ to: "/expands" }, { children: "Expands" })),
50
+ element: _jsx(ExpandsView, {}),
51
+ },
52
+ {
53
+ id: 2,
54
+ name: "Menus",
55
+ link: "/menus",
56
+ children: _jsx(NavLink, __assign({ to: "/menus" }, { children: "Menus" })),
57
+ element: _jsx(MenusView, {}),
58
+ },
59
+ {
60
+ id: 3,
61
+ name: "Buttons",
62
+ link: "/buttons",
63
+ children: _jsx(NavLink, __assign({ to: "/buttons" }, { children: "Buttons" })),
64
+ element: _jsx(ButtonView, {}),
65
+ },
66
+ {
67
+ id: 4,
68
+ name: "Toasters",
69
+ link: "/toasters",
70
+ children: _jsx(NavLink, __assign({ to: "/toasters" }, { children: "Toasters" })),
71
+ element: _jsx(ToasterView, {}),
72
+ },
73
+ {
74
+ id: 5,
75
+ name: "Form",
76
+ link: "/form",
77
+ children: _jsx(NavLink, __assign({ to: "/form" }, { children: "Form" })),
78
+ element: _jsx(FormView, {}),
79
+ },
80
+ {
81
+ id: 6,
82
+ name: "Icons",
83
+ link: "/icons",
84
+ children: _jsx(NavLink, __assign({ to: "/icons" }, { children: "Icons" })),
85
+ element: _jsx(IconsView, {}),
86
+ },
87
+ {
88
+ id: 7,
89
+ name: "Header",
90
+ link: "/headers",
91
+ children: _jsx(NavLink, __assign({ to: "/headers" }, { children: "Header" })),
92
+ element: _jsx(HeaderView, {}),
93
+ },
94
+ {
95
+ id: 8,
96
+ name: "Sidebar",
97
+ link: "/sidebar",
98
+ children: _jsx(NavLink, __assign({ to: "/sidebar" }, { children: "Sidebar" })),
99
+ element: _jsx(SidebarView, {}),
100
+ },
101
+ {
102
+ id: 9,
103
+ name: "Grid",
104
+ link: "/grid",
105
+ children: _jsx(NavLink, __assign({ to: "/grid" }, { children: "Grid" })),
106
+ element: _jsx(GridView, {}),
107
+ },
108
+ {
109
+ id: 10,
110
+ name: "Overlay Panel",
111
+ link: "/overlay",
112
+ children: _jsx(NavLink, __assign({ to: "/overlay" }, { children: "Overlay Panel" })),
113
+ element: _jsx(OverlayPanelView, {}),
114
+ },
115
+ {
116
+ id: 11,
117
+ name: "Data search",
118
+ link: "/search",
119
+ children: _jsx(NavLink, __assign({ to: "/search" }, { children: "Data search" })),
120
+ element: _jsx(SearchView, {}),
121
+ },
122
+ {
123
+ id: 12,
124
+ name: "Card",
125
+ link: "/card",
126
+ children: _jsx(NavLink, __assign({ to: "/card" }, { children: "Card" })),
127
+ element: _jsx(CardView, {}),
128
+ },
129
+ {
130
+ id: 13,
131
+ name: "Sidebar Data",
132
+ link: "/sidebar-data",
133
+ children: _jsx(NavLink, __assign({ to: "/sidebar-data" }, { children: "Sidebar Data" })),
134
+ element: _jsx(SidebarDataView, {}),
135
+ },
136
+ {
137
+ id: 14,
138
+ name: "Damier",
139
+ link: "/damier",
140
+ children: _jsx(NavLink, __assign({ to: "/damier" }, { children: "Damier" })),
141
+ element: _jsx(DamierView, {}),
142
+ },
143
+ {
144
+ id: 15,
145
+ name: "Fil Ariane",
146
+ link: "/fil-ariane",
147
+ children: _jsx(NavLink, __assign({ to: "/fil-ariane" }, { children: "Fil Ariane" })),
148
+ element: _jsx(FilArianeView, {}),
149
+ },
150
+ {
151
+ id: 16,
152
+ name: "Loader",
153
+ link: "/loader",
154
+ children: _jsx(NavLink, __assign({ to: "/loader" }, { children: "Loader" })),
155
+ element: _jsx(LoaderView, {}),
156
+ },
157
+ {
158
+ id: 17,
159
+ name: "Carousel",
160
+ link: "/carousel",
161
+ children: _jsx(NavLink, __assign({ to: "/carousel" }, { children: "Carousel" })),
162
+ element: _jsx(CarouselView, {}),
163
+ },
164
+ {
165
+ id: 18,
166
+ name: "Action",
167
+ link: "/action",
168
+ children: _jsx(NavLink, __assign({ to: "/action" }, { children: "Action" })),
169
+ element: _jsx(ActionView, {}),
170
+ },
171
+ {
172
+ id: 19,
173
+ name: "Modal",
174
+ link: "/modal",
175
+ children: _jsx(NavLink, __assign({ to: "/modal" }, { children: "Modal" })),
176
+ element: _jsx(ModalView, {}),
177
+ },
178
+ {
179
+ id: 20,
180
+ name: "Badge",
181
+ link: "/badge",
182
+ children: _jsx(NavLink, __assign({ to: "/badge" }, { children: "Badge" })),
183
+ element: _jsx(BadgeView, {}),
184
+ },
185
+ {
186
+ id: 21,
187
+ name: "Data table",
188
+ link: "/data-table",
189
+ children: _jsx(NavLink, __assign({ to: "/data-table" }, { children: "Data table" })),
190
+ element: _jsx(DataTableView, {}),
191
+ },
192
+ {
193
+ id: 22,
194
+ name: "Select",
195
+ link: "/select",
196
+ children: _jsx(NavLink, __assign({ to: "/select" }, { children: "Select" })),
197
+ element: _jsx(SelectView, {}),
198
+ },
199
+ {
200
+ id: 23,
201
+ name: "TextArea",
202
+ link: "/text-area",
203
+ children: _jsx(NavLink, __assign({ to: "/text-area" }, { children: "Text" })),
204
+ element: _jsx(TextAreaView, {}),
205
+ },
206
+ {
207
+ id: 24,
208
+ name: "Date picker",
209
+ link: "/date-picker",
210
+ children: _jsx(NavLink, __assign({ to: "/date-picker" }, { children: "Date picker" })),
211
+ element: _jsx(DatePickerView, {}),
212
+ },
213
+ {
214
+ id: 25,
215
+ name: "Tabs",
216
+ link: "/tabs",
217
+ children: _jsx(NavLink, __assign({ to: "/tabs" }, { children: "Tabs" })),
218
+ element: _jsx(TabsView, {}),
219
+ },
220
+ {
221
+ id: 26,
222
+ name: "Messages",
223
+ link: "/messages",
224
+ children: _jsx(NavLink, __assign({ to: "/messages" }, { children: "Messages" })),
225
+ element: _jsx(MessageView, {}),
226
+ },
227
+ {
228
+ id: 27,
229
+ name: "Input Number",
230
+ link: "/input-number",
231
+ children: _jsx(NavLink, __assign({ to: "/input-number" }, { children: "Input Number" })),
232
+ element: _jsx(InputNumberView, {}),
233
+ },
234
+ {
235
+ id: 28,
236
+ name: "Input Price",
237
+ link: "/input-price",
238
+ children: _jsx(NavLink, __assign({ to: "/input-price" }, { children: "Input Price" })),
239
+ element: _jsx(InputPriceView, {}),
240
+ },
241
+ {
242
+ id: 29,
243
+ name: "Button File",
244
+ link: "/button-file",
245
+ children: _jsx(NavLink, __assign({ to: "/button-file" }, { children: "Button File" })),
246
+ element: _jsx(ButtonFileView, {}),
247
+ },
248
+ ];
249
+ export var AppMenu = function () {
250
+ return _jsx(Menus, { items: MenuList, className: "main-layout-menu" });
251
+ };
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Route, Routes } from "react-router-dom";
3
+ import { MenuList } from "./App.menu";
4
+ import { Home } from "./home/Home";
5
+ import { NotFound } from "./notFound/NotFound";
6
+ export var AppRoutes = function () {
7
+ return (_jsxs(Routes, { children: [MenuList.map(function (menu) { return (_jsx(Route, { path: menu.link, element: menu.element }, menu.id)); }), _jsx(Route, { path: "/", element: _jsx(Home, {}) }), _jsx(Route, { path: "*", element: _jsx(NotFound, {}) })] }));
8
+ };
@@ -0,0 +1,29 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { createContext, useContext, useEffect, useRef, useState } from "react";
14
+ import { useLocation } from "react-router-dom";
15
+ var HistoryDepthContext = createContext(1);
16
+ export function HistoryProvider(_a) {
17
+ var children = _a.children;
18
+ var location = useLocation();
19
+ var depthRef = useRef(1);
20
+ var _b = useState(1), depth = _b[0], setDepth = _b[1];
21
+ useEffect(function () {
22
+ depthRef.current += 1;
23
+ setDepth(depthRef.current);
24
+ }, [location]);
25
+ return (_jsx(HistoryDepthContext.Provider, __assign({ value: depth }, { children: children })));
26
+ }
27
+ export function useHistoryDepth() {
28
+ return useContext(HistoryDepthContext);
29
+ }
@@ -0,0 +1,68 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ import { jsx as _jsx } from "react/jsx-runtime";
38
+ import { useEffect, useState } from "react";
39
+ export var ImageChecker = function (_a) {
40
+ var imageUrl = _a.imageUrl;
41
+ var _b = useState(null), imageExists = _b[0], setImageExists = _b[1];
42
+ var testImg = function (path) { return __awaiter(void 0, void 0, void 0, function () {
43
+ var response, _a;
44
+ return __generator(this, function (_b) {
45
+ switch (_b.label) {
46
+ case 0:
47
+ _b.trys.push([0, 2, , 3]);
48
+ return [4 /*yield*/, fetch(path, { method: "HEAD" })];
49
+ case 1:
50
+ response = _b.sent();
51
+ console.log(response);
52
+ return [2 /*return*/, response.ok];
53
+ case 2:
54
+ _a = _b.sent();
55
+ return [2 /*return*/, false];
56
+ case 3: return [2 /*return*/];
57
+ }
58
+ });
59
+ }); };
60
+ useEffect(function () {
61
+ testImg(imageUrl).then(function (res) { return setImageExists(res); });
62
+ }, [imageUrl]);
63
+ if (imageExists === null)
64
+ return _jsx("p", { children: "V\u00E9rification en cours..." });
65
+ if (!imageExists)
66
+ return _jsx("p", { children: "L'image n'existe pas." });
67
+ return _jsx("img", { src: imageUrl, alt: "V\u00E9rifi\u00E9e" });
68
+ };
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export var ImageExist = function (_a) {
3
+ var imageUrl = _a.imageUrl;
4
+ return _jsx("img", { src: imageUrl, alt: "" });
5
+ };
@@ -0,0 +1,10 @@
1
+ export var isValidEAN13 = function (value) {
2
+ if (!/^\d{13}$/.test(value))
3
+ return false; // Vérifie que c'est bien 13 chiffres
4
+ // Calcul de la clé de contrôle (checksum)
5
+ var digits = value.split("").map(Number);
6
+ var checkDigit = digits.pop(); // Dernier chiffre (clé de contrôle)
7
+ var sum = digits.reduce(function (acc, digit, index) { return acc + digit * (index % 2 === 0 ? 1 : 3); }, 0);
8
+ var computedCheckDigit = (10 - (sum % 10)) % 10;
9
+ return checkDigit === computedCheckDigit;
10
+ };
@@ -0,0 +1,28 @@
1
+ export var objectToQueryParams = function (obj, prefix) {
2
+ if (prefix === void 0) { prefix = ""; }
3
+ var params = new URLSearchParams();
4
+ var processObject = function (currentObj, currentPrefix) {
5
+ Object.entries(currentObj).forEach(function (_a) {
6
+ var key = _a[0], value = _a[1];
7
+ var fullKey = currentPrefix ? "".concat(currentPrefix, "[").concat(key, "]") : key;
8
+ if (value === null || value === undefined) {
9
+ // Ignorer les valeurs null ou undefined
10
+ return;
11
+ }
12
+ if (typeof value === "object" && !Array.isArray(value)) {
13
+ // Appel récursif pour les objets imbriqués
14
+ processObject(value, fullKey);
15
+ }
16
+ else if (Array.isArray(value)) {
17
+ // Gérer les tableaux
18
+ value.forEach(function (item) { return params.append(fullKey, String(item)); });
19
+ }
20
+ else {
21
+ // Gérer les types primitifs
22
+ params.append(fullKey, String(value));
23
+ }
24
+ });
25
+ };
26
+ processObject(obj, prefix);
27
+ return params.toString();
28
+ };
@@ -0,0 +1,12 @@
1
+ import { useCallback } from "react";
2
+ export var useCurrency = function (locale, currency) {
3
+ if (locale === void 0) { locale = "fr-FR"; }
4
+ if (currency === void 0) { currency = "EUR"; }
5
+ var format = useCallback(function (value) {
6
+ return new Intl.NumberFormat(locale, {
7
+ style: "currency",
8
+ currency: currency,
9
+ }).format(value);
10
+ }, [locale, currency]);
11
+ return { formatCurrency: format };
12
+ };
@@ -0,0 +1,59 @@
1
+ export function FormatDate(date, format) {
2
+ var days = [
3
+ "Dimanche",
4
+ "Lundi",
5
+ "Mardi",
6
+ "Mercredi",
7
+ "Jeudi",
8
+ "Vendredi",
9
+ "Samedi",
10
+ ];
11
+ var months = [
12
+ "janvier",
13
+ "février",
14
+ "mars",
15
+ "avril",
16
+ "mai",
17
+ "juin",
18
+ "juillet",
19
+ "août",
20
+ "septembre",
21
+ "octobre",
22
+ "novembre",
23
+ "décembre",
24
+ ];
25
+ if (!date)
26
+ return "";
27
+ var year = date.getFullYear().toString();
28
+ var month = String(date.getMonth() + 1).padStart(2, "0"); // Mois en chiffres
29
+ var day = String(date.getDate()).padStart(2, "0");
30
+ var hours = String(date.getHours()).padStart(2, "0");
31
+ var minutes = String(date.getMinutes()).padStart(2, "0");
32
+ var seconds = String(date.getSeconds()).padStart(2, "0");
33
+ var dayName = days[date.getDay()];
34
+ var monthName = months[date.getMonth()];
35
+ return format
36
+ .replace("dddd", dayName) // Remplace d'abord "dddd"
37
+ .replace("MMMM", monthName) // Puis "MMMM" pour éviter de modifier "MM"
38
+ .replace("YYYY", year)
39
+ .replace("MM", month) // Enfin, "MM" pour éviter d'écraser les valeurs de "MMMM"
40
+ .replace("DD", day)
41
+ .replace("HH", hours)
42
+ .replace("mm", minutes)
43
+ .replace("ss", seconds);
44
+ }
45
+ export function LocalDateStringToUTC(dateStr) {
46
+ var _a = dateStr.split("-").map(Number), year = _a[0], month = _a[1], day = _a[2];
47
+ // Crée une date en heure locale
48
+ var localDate = new Date(year, month - 1, day, 0, 0, 0);
49
+ // Convertit en UTC ISO
50
+ return localDate.toISOString();
51
+ }
52
+ export function localDateStartToUTC(dateStr) {
53
+ var _a = dateStr.split("-").map(Number), y = _a[0], m = _a[1], d = _a[2];
54
+ return new Date(y, m - 1, d, 0, 0, 0, 0);
55
+ }
56
+ export function localDateEndToUTC(dateStr) {
57
+ var _a = dateStr.split("-").map(Number), y = _a[0], m = _a[1], d = _a[2];
58
+ return new Date(y, m - 1, d, 23, 59, 59, 999);
59
+ }
@@ -0,0 +1,13 @@
1
+ import { useEffect, useState } from "react";
2
+ export var useIsMobile = function (maxWidth) {
3
+ if (maxWidth === void 0) { maxWidth = 768; }
4
+ var _a = useState(typeof window !== "undefined" ? window.innerWidth <= maxWidth : false), isMobile = _a[0], setIsMobile = _a[1];
5
+ useEffect(function () {
6
+ var handleResize = function () {
7
+ setIsMobile(window.innerWidth <= maxWidth);
8
+ };
9
+ window.addEventListener("resize", handleResize);
10
+ return function () { return window.removeEventListener("resize", handleResize); };
11
+ }, [maxWidth]);
12
+ return isMobile;
13
+ };
@@ -0,0 +1,17 @@
1
+ import { jwtDecode } from "jwt-decode";
2
+ import { useCallback } from "react";
3
+ export var useToken = function () {
4
+ var getTokenValidate = useCallback(function () {
5
+ var token = localStorage.getItem("token");
6
+ if (!token) {
7
+ return null;
8
+ }
9
+ var decoded = jwtDecode(token);
10
+ var currentTime = Date.now() / 1000; // Convertir en secondes
11
+ if (!decoded.exp || decoded.exp < currentTime) {
12
+ return null;
13
+ }
14
+ return token;
15
+ }, []);
16
+ return { getTokenValidate: getTokenValidate };
17
+ };
@@ -0,0 +1,15 @@
1
+ export var useValidate = function () {
2
+ var isValidateEmail = function (input) {
3
+ var emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
4
+ return emailRegex.test(input);
5
+ };
6
+ var isValidateTel = function (input) {
7
+ var emailRegex = /^\+?[0-9\s.-]{7,15}$/;
8
+ return emailRegex.test(input);
9
+ };
10
+ var isValidateCodePostal = function (input) {
11
+ var emailRegex = /^[0-9]{5}$/;
12
+ return emailRegex.test(input);
13
+ };
14
+ return { isValidateEmail: isValidateEmail, isValidateTel: isValidateTel, isValidateCodePostal: isValidateCodePostal };
15
+ };
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useRef } from "react";
3
+ export var WidgetSupport = function () {
4
+ var targetRef = useRef(null);
5
+ useEffect(function () {
6
+ if (!targetRef.current)
7
+ return;
8
+ var script = document.createElement("script");
9
+ script.type = "text/javascript";
10
+ script.innerHTML = "\n !function(e,t,n){\n function a(){\n var e = t.getElementsByTagName(\"script\")[0],\n n = t.createElement(\"script\");\n n.type = \"text/javascript\";\n n.async = true;\n n.src = \"https://beacon-v2.helpscout.net\";\n e.parentNode.insertBefore(n,e);\n }\n if(e.Beacon = n = function(t,n,a){\n e.Beacon.readyQueue.push({method: t, options: n, data: a});\n }, n.readyQueue = [], t.readyState === \"complete\") return a();\n e.attachEvent ? e.attachEvent(\"onload\", a) : e.addEventListener(\"load\", a, false);\n }(window, document, window.Beacon || function(){});\n\n window.Beacon('init', '5deebca7-9d32-4a66-abba-f94a05fa0522');\n ";
11
+ targetRef.current.appendChild(script);
12
+ return function () {
13
+ var _a;
14
+ (_a = targetRef === null || targetRef === void 0 ? void 0 : targetRef.current) === null || _a === void 0 ? void 0 : _a.removeChild(script);
15
+ };
16
+ }, []);
17
+ return (_jsx("div", { children: _jsx("div", { ref: targetRef }) }));
18
+ };
@@ -0,0 +1,22 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { ButtonAction } from "./ButtonAction";
14
+ export var ActionView = function () {
15
+ return (_jsx("div", __assign({ className: "d-flex" }, { children: _jsx(ButtonAction, { className: "mr-2", onClick: function () { return console.log("Envoyer"); }, title: "Envoyer", classIcon: "bi-send", badge: {
16
+ className: "badge--primary",
17
+ title: "Badge",
18
+ sizeIcon: undefined,
19
+ classIcon: "bi-check-circle",
20
+ onClick: function () { return console.log("Badge clicked"); },
21
+ } }) })));
22
+ };
@@ -0,0 +1,25 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { Badge } from "../badge/Badge";
14
+ import { Icon } from "../icon/Icon";
15
+ import { IconSizeEnum } from "../icon/iconSize.enum";
16
+ import "./action.css";
17
+ export var ButtonAction = function (_a) {
18
+ var className = _a.className, onClick = _a.onClick, title = _a.title, classIcon = _a.classIcon, badge = _a.badge;
19
+ var handleClick = function (e) {
20
+ if (onClick) {
21
+ onClick(e);
22
+ }
23
+ };
24
+ return (_jsxs("div", __assign({ className: "action ".concat(className), onClick: handleClick }, { children: [badge && _jsx(Badge, __assign({}, badge)), classIcon && _jsx(Icon, { classIcon: classIcon, size: IconSizeEnum.LARGE }), _jsx("small", { children: title })] })));
25
+ };
@@ -0,0 +1,25 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { useCallback } from "react";
14
+ import { Icon } from "../icon/Icon";
15
+ import "./badge.css";
16
+ export var Badge = function (_a) {
17
+ var className = _a.className, onClick = _a.onClick, title = _a.title, sizeIcon = _a.sizeIcon, classIcon = _a.classIcon;
18
+ var handleClick = useCallback(function (e) {
19
+ e.stopPropagation();
20
+ if (onClick) {
21
+ onClick(e);
22
+ }
23
+ }, []);
24
+ return (_jsxs("div", __assign({ onClick: handleClick, className: "badge ".concat(className ? className : "") }, { children: [classIcon && _jsx(Icon, { size: sizeIcon, classIcon: classIcon }), _jsx("span", { children: title })] })));
25
+ };
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Badge } from "./Badge";
3
+ export var BadgeView = function () {
4
+ return (_jsx(_Fragment, { children: _jsx(Badge, { className: "badge--primary", title: "Badge", sizeIcon: undefined, classIcon: "bi-check-circle", onClick: function () { return console.log("Badge clicked"); } }) }));
5
+ };