@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.
Files changed (265) hide show
  1. package/assets/icons/arrow-down-1-9.svg +1 -1
  2. package/assets/icons/arrow-down-a-z.svg +1 -1
  3. package/assets/icons/arrow-up-z-a.svg +1 -1
  4. package/assets/icons/check.svg +1 -1
  5. package/assets/icons/circle-check.svg +1 -1
  6. package/assets/icons/down.svg +1 -1
  7. package/assets/icons/filter-full.svg +1 -1
  8. package/assets/icons/filter.svg +1 -1
  9. package/assets/icons/hashtag.svg +1 -1
  10. package/assets/icons/image-slash.svg +1 -1
  11. package/assets/icons/left.svg +1 -1
  12. package/assets/icons/magnifier.svg +1 -1
  13. package/assets/icons/phone.svg +1 -1
  14. package/assets/icons/right.svg +1 -1
  15. package/assets/icons/sort-calendar-ascending.svg +5 -5
  16. package/assets/icons/spinner-third.svg +1 -1
  17. package/assets/icons/table-columns.svg +1 -1
  18. package/assets/icons/table-footer-slash.svg +4 -4
  19. package/assets/icons/table-footer.svg +3 -3
  20. package/assets/icons/table.svg +1 -1
  21. package/assets/icons/up.svg +1 -1
  22. package/assets/icons/user-tie.svg +1 -1
  23. package/assets/icons/x-bar.svg +3 -3
  24. package/dist/components/auth/PasswordResetForm.js +7 -2
  25. package/dist/components/common/Accordion/Accordion.d.ts +14 -0
  26. package/dist/components/common/Accordion/Accordion.js +81 -0
  27. package/dist/components/common/Accordion/index.d.ts +2 -0
  28. package/dist/components/common/PropertiesList/PropertyInput.d.ts +7 -0
  29. package/dist/components/common/PropertiesList/PropertyInput.js +142 -0
  30. package/dist/components/common/PropertiesList/index.d.ts +8 -0
  31. package/dist/components/common/PropertiesList/index.js +28 -0
  32. package/dist/components/common/PropertiesList/types.d.ts +44 -0
  33. package/dist/components/common/TabsView/styles.js +10 -8
  34. package/dist/components/common/TreeView/TreeContext.d.ts +55 -0
  35. package/dist/components/common/TreeView/TreeContext.js +172 -0
  36. package/dist/components/common/TreeView/TreeView.d.ts +19 -0
  37. package/dist/components/common/TreeView/TreeView.js +202 -0
  38. package/dist/components/common/TreeView/index.d.ts +3 -0
  39. package/dist/components/common/index.d.ts +3 -0
  40. package/dist/components/common/index.js +25 -16
  41. package/dist/components/grid/DataGrid/DataGridCell.js +30 -29
  42. package/dist/components/grid/DataGrid/DataGridEditableCell/index.d.ts +1 -1
  43. package/dist/components/grid/DataGrid/DataGridEditableCell/index.js +37 -27
  44. package/dist/components/grid/DataGrid/DataGridRowTemplate.js +71 -56
  45. package/dist/components/layout/ContextMenu/ContextMenu.d.ts +42 -0
  46. package/dist/components/layout/ContextMenu/ContextMenu.js +252 -0
  47. package/dist/components/layout/ContextMenu/index.d.ts +2 -0
  48. package/dist/components/layout/LeftMenu/LeftMenu.d.ts +22 -0
  49. package/dist/components/layout/LeftMenu/LeftMenu.js +43 -0
  50. package/dist/components/layout/LeftMenu/index.d.ts +2 -0
  51. package/dist/components/layout/PanelContainer/PanelContainer.d.ts +16 -0
  52. package/dist/components/layout/PanelContainer/PanelContainer.js +121 -0
  53. package/dist/components/layout/PanelContainer/index.d.ts +2 -0
  54. package/dist/components/layout/index.d.ts +3 -0
  55. package/dist/components/layout/index.js +30 -15
  56. package/dist/helpers/cn.d.ts +2 -0
  57. package/dist/helpers/cn.js +8 -0
  58. package/dist/helpers/index.d.ts +1 -0
  59. package/dist/helpers/index.js +33 -31
  60. package/eslint.config.js +3 -3
  61. package/package.json +5 -3
  62. package/src/components/auth/LoginForm.tsx +92 -92
  63. package/src/components/auth/LoginPage.tsx +32 -32
  64. package/src/components/auth/PasswordRecoveryForm.tsx +53 -53
  65. package/src/components/auth/PasswordResetForm.tsx +114 -114
  66. package/src/components/auth/index.ts +4 -4
  67. package/src/components/auth/styles.ts +14 -14
  68. package/src/components/common/Accordion/Accordion.tsx +140 -0
  69. package/src/components/common/Accordion/index.ts +2 -0
  70. package/src/components/common/Avatar/index.tsx +54 -54
  71. package/src/components/common/Avatar/styles.ts +61 -61
  72. package/src/components/common/Card/index.tsx +17 -17
  73. package/src/components/common/Card/styles.ts +38 -38
  74. package/src/components/common/ContextMenu/index.tsx +79 -79
  75. package/src/components/common/ContextMenu/styles.ts +119 -119
  76. package/src/components/common/Ellipsis.tsx +33 -33
  77. package/src/components/common/Label.tsx +93 -93
  78. package/src/components/common/Message/index.tsx +57 -57
  79. package/src/components/common/Message/styles.ts +44 -44
  80. package/src/components/common/PropertiesList/PropertyInput.tsx +173 -0
  81. package/src/components/common/PropertiesList/index.tsx +48 -0
  82. package/src/components/common/PropertiesList/types.ts +60 -0
  83. package/src/components/common/TabsView/TabsList.tsx +49 -49
  84. package/src/components/common/TabsView/TabsView.tsx +42 -42
  85. package/src/components/common/TabsView/index.ts +3 -3
  86. package/src/components/common/TabsView/styles.ts +83 -83
  87. package/src/components/common/TabsView/types.ts +12 -12
  88. package/src/components/common/TreeView/TreeContext.tsx +379 -0
  89. package/src/components/common/TreeView/TreeView.tsx +281 -0
  90. package/src/components/common/TreeView/index.ts +3 -0
  91. package/src/components/common/index.ts +10 -7
  92. package/src/components/forms/AutoTextArea.tsx +48 -48
  93. package/src/components/forms/BillitIdentifier/index.tsx +78 -78
  94. package/src/components/forms/BillitIdentifier/styles.tsx +43 -43
  95. package/src/components/forms/Button.tsx +130 -130
  96. package/src/components/forms/Form/Checkbox.tsx +12 -12
  97. package/src/components/forms/Form/CustomSelect.tsx +86 -86
  98. package/src/components/forms/Form/FormGroup.tsx +33 -33
  99. package/src/components/forms/Form/Input.tsx +16 -16
  100. package/src/components/forms/Form/Row.tsx +28 -28
  101. package/src/components/forms/Form/Select.tsx +99 -99
  102. package/src/components/forms/Form/TextArea.tsx +17 -17
  103. package/src/components/forms/Form/index.tsx +48 -48
  104. package/src/components/forms/Form/styles.ts +148 -148
  105. package/src/components/forms/IconButton.tsx +61 -61
  106. package/src/components/forms/IndeterminateCheckbox.tsx +46 -46
  107. package/src/components/forms/NumberInput.tsx +53 -53
  108. package/src/components/forms/Select.tsx +34 -34
  109. package/src/components/forms/VerticalLabel.tsx +20 -20
  110. package/src/components/forms/index.ts +11 -11
  111. package/src/components/forms/styles.ts +42 -42
  112. package/src/components/grid/DataGrid/DataGridCell.tsx +82 -81
  113. package/src/components/grid/DataGrid/DataGridColumnsModal/helpers.ts +9 -9
  114. package/src/components/grid/DataGrid/DataGridColumnsModal/hooks.tsx +59 -59
  115. package/src/components/grid/DataGrid/DataGridColumnsModal/index.tsx +182 -182
  116. package/src/components/grid/DataGrid/DataGridColumnsModal/styles.ts +104 -104
  117. package/src/components/grid/DataGrid/DataGridEditableCell/CheckboxEditableCell.tsx +37 -37
  118. package/src/components/grid/DataGrid/DataGridEditableCell/DateEditableCell.tsx +38 -38
  119. package/src/components/grid/DataGrid/DataGridEditableCell/NumberEditableCell.tsx +71 -71
  120. package/src/components/grid/DataGrid/DataGridEditableCell/TextEditableCell.tsx +37 -37
  121. package/src/components/grid/DataGrid/DataGridEditableCell/index.tsx +112 -106
  122. package/src/components/grid/DataGrid/DataGridEditableCell/styles.ts +35 -35
  123. package/src/components/grid/DataGrid/DataGridEditableCell/types.ts +18 -18
  124. package/src/components/grid/DataGrid/DataGridFilterMenu/FilterValuesScroller.tsx +129 -129
  125. package/src/components/grid/DataGrid/DataGridFilterMenu/helpers.ts +23 -23
  126. package/src/components/grid/DataGrid/DataGridFilterMenu/hooks.tsx +81 -81
  127. package/src/components/grid/DataGrid/DataGridFilterMenu/index.tsx +370 -370
  128. package/src/components/grid/DataGrid/DataGridFilterMenu/styles.ts +97 -97
  129. package/src/components/grid/DataGrid/DataGridFooter.tsx +48 -48
  130. package/src/components/grid/DataGrid/DataGridHeader.tsx +74 -74
  131. package/src/components/grid/DataGrid/DataGridHeaderCell.tsx +112 -112
  132. package/src/components/grid/DataGrid/DataGridRowTemplate.tsx +90 -83
  133. package/src/components/grid/DataGrid/DataGridToolbar.tsx +134 -134
  134. package/src/components/grid/DataGrid/FilterModalContent/index.tsx +137 -137
  135. package/src/components/grid/DataGrid/FilterModalContent/styles.ts +22 -22
  136. package/src/components/grid/DataGrid/constants.ts +6 -6
  137. package/src/components/grid/DataGrid/helpers/columns.tsx +452 -452
  138. package/src/components/grid/DataGrid/helpers/filters.ts +287 -287
  139. package/src/components/grid/DataGrid/helpers/index.ts +2 -2
  140. package/src/components/grid/DataGrid/hooks/index.ts +29 -29
  141. package/src/components/grid/DataGrid/hooks/useDataGrid.tsx +383 -383
  142. package/src/components/grid/DataGrid/hooks/useDataGridChangedRows.ts +97 -97
  143. package/src/components/grid/DataGrid/hooks/useDataGridCopy.ts +174 -174
  144. package/src/components/grid/DataGrid/hooks/useDataGridSettings.ts +48 -48
  145. package/src/components/grid/DataGrid/hooks/useRefreshModal.tsx +48 -48
  146. package/src/components/grid/DataGrid/index.tsx +111 -111
  147. package/src/components/grid/DataGrid/styles.ts +446 -446
  148. package/src/components/grid/DataGrid/types.ts +380 -380
  149. package/src/components/grid/SqlRequestDataGrid/helpers/columns.tsx +526 -526
  150. package/src/components/grid/SqlRequestDataGrid/helpers/index.ts +2 -2
  151. package/src/components/grid/SqlRequestDataGrid/helpers/rows.ts +24 -24
  152. package/src/components/grid/SqlRequestDataGrid/helpers/sqlRequests.ts +17 -17
  153. package/src/components/grid/SqlRequestDataGrid/index.tsx +417 -417
  154. package/src/components/grid/SqlRequestDataGrid/styles.ts +15 -15
  155. package/src/components/grid/SqlRequestDataGrid/types.ts +74 -74
  156. package/src/components/grid/SqlRequestForeignList/index.tsx +254 -254
  157. package/src/components/grid/SqlRequestForeignList/styles.ts +43 -43
  158. package/src/components/grid/SqlRequestForeignList/types.ts +32 -32
  159. package/src/components/grid/SqlRequestGrid/filters/FiltersSidebar.tsx +108 -108
  160. package/src/components/grid/SqlRequestGrid/filters/styles.ts +88 -88
  161. package/src/components/grid/SqlRequestGrid/helpers/index.ts +1 -1
  162. package/src/components/grid/SqlRequestGrid/helpers/sqlRequests.ts +16 -16
  163. package/src/components/grid/SqlRequestGrid/index.tsx +304 -304
  164. package/src/components/grid/SqlRequestGrid/styles.ts +20 -20
  165. package/src/components/grid/SqlRequestGrid/types.ts +73 -73
  166. package/src/components/grid/VirtualScroller/hooks.ts +71 -71
  167. package/src/components/grid/VirtualScroller/index.tsx +89 -89
  168. package/src/components/grid/VirtualScroller/styles.ts +57 -57
  169. package/src/components/grid/VirtualScroller/types.ts +10 -10
  170. package/src/components/grid/index.ts +11 -11
  171. package/src/components/layout/Columns.ts +28 -28
  172. package/src/components/layout/ContextMenu/ContextMenu.tsx +471 -0
  173. package/src/components/layout/ContextMenu/index.ts +23 -0
  174. package/src/components/layout/Dropdown/index.tsx +113 -113
  175. package/src/components/layout/Dropdown/styles.ts +53 -53
  176. package/src/components/layout/Flexbox.ts +21 -21
  177. package/src/components/layout/Grid/index.tsx +8 -8
  178. package/src/components/layout/Grid/styles.ts +34 -34
  179. package/src/components/layout/LeftMenu/LeftMenu.tsx +89 -0
  180. package/src/components/layout/LeftMenu/index.ts +2 -0
  181. package/src/components/layout/Loading/index.tsx +29 -29
  182. package/src/components/layout/Loading/styles.ts +29 -29
  183. package/src/components/layout/Masonry/index.tsx +29 -29
  184. package/src/components/layout/Masonry/styles.ts +20 -20
  185. package/src/components/layout/Modal/index.tsx +51 -51
  186. package/src/components/layout/Modal/styles.ts +125 -125
  187. package/src/components/layout/PanelContainer/PanelContainer.tsx +198 -0
  188. package/src/components/layout/PanelContainer/index.ts +2 -0
  189. package/src/components/layout/index.ts +10 -7
  190. package/src/components/search/HighlightedText.tsx +41 -41
  191. package/src/components/search/QuickSearchBar.tsx +125 -125
  192. package/src/components/search/QuickSearchResults.tsx +90 -90
  193. package/src/components/search/index.ts +5 -5
  194. package/src/components/search/styles.ts +96 -96
  195. package/src/components/search/types.ts +29 -29
  196. package/src/config/index.ts +10 -10
  197. package/src/helpers/cn.ts +6 -0
  198. package/src/helpers/components.ts +9 -9
  199. package/src/helpers/dates.ts +17 -17
  200. package/src/helpers/getScrollbarSize.ts +14 -14
  201. package/src/helpers/index.ts +8 -7
  202. package/src/helpers/numbers.ts +63 -63
  203. package/src/helpers/responsive.ts +83 -83
  204. package/src/helpers/styled/size.ts +24 -24
  205. package/src/helpers/styled/space.ts +111 -111
  206. package/src/helpers/styled/typography.ts +25 -25
  207. package/src/helpers/text.ts +13 -13
  208. package/src/helpers/types.ts +9 -9
  209. package/src/hooks/index.ts +9 -9
  210. package/src/hooks/providers.ts +14 -14
  211. package/src/hooks/useContainerMediaQuery.ts +7 -7
  212. package/src/hooks/useElementSize.ts +24 -24
  213. package/src/hooks/useMediaQuery.ts +9 -9
  214. package/src/hooks/useMediaQueryForWidth.ts +35 -35
  215. package/src/hooks/useMutableState.test.ts +410 -410
  216. package/src/hooks/useMutableState.ts +39 -39
  217. package/src/hooks/useShowArchived.ts +28 -28
  218. package/src/hooks/useWindowSize.ts +20 -20
  219. package/src/icons/index.tsx +138 -138
  220. package/src/providers/AuthenticationProvider/helpers.ts +3 -3
  221. package/src/providers/AuthenticationProvider/index.tsx +303 -303
  222. package/src/providers/LoadingProvider/index.tsx +47 -47
  223. package/src/providers/PortalsProvider/index.tsx +54 -54
  224. package/src/providers/PortalsProvider/styles.ts +31 -31
  225. package/src/providers/SettingsProvider/index.tsx +70 -70
  226. package/src/providers/ToastProvider/index.tsx +93 -93
  227. package/src/providers/TrackingProvider/hooks.ts +14 -14
  228. package/src/providers/TrackingProvider/index.tsx +71 -71
  229. package/src/providers/UiProviders/index.tsx +74 -74
  230. package/src/providers/UiProviders/styles.ts +10 -10
  231. package/src/providers/index.ts +6 -6
  232. package/src/services/HttpService.ts +92 -92
  233. package/src/services/WebSocketService.ts +155 -155
  234. package/src/services/advancedRequests.ts +102 -102
  235. package/src/services/base.ts +23 -23
  236. package/src/services/globalSearch.ts +32 -32
  237. package/src/services/hooks.ts +92 -92
  238. package/src/services/index.ts +20 -20
  239. package/src/services/requests/auth.ts +44 -44
  240. package/src/services/requests/generic.ts +76 -76
  241. package/src/services/requests/printing.ts +12 -12
  242. package/src/services/requests/tracking.ts +12 -12
  243. package/src/services/requests/userProfiles.ts +35 -35
  244. package/src/services/requests/users.ts +28 -28
  245. package/src/services/smartQueries.ts +122 -122
  246. package/src/services/sqlRequests.ts +119 -119
  247. package/src/services/types/auth.ts +98 -98
  248. package/src/services/types/base.ts +10 -10
  249. package/src/services/types/generic.ts +102 -102
  250. package/src/services/types/printing.ts +10 -10
  251. package/src/services/types/tracking.ts +29 -29
  252. package/src/services/types/userProfiles.ts +79 -79
  253. package/src/services/types/users.ts +74 -74
  254. package/src/services/updateSqlRequests.ts +32 -32
  255. package/src/styles/animations.scss +30 -30
  256. package/src/styles/index.scss +42 -42
  257. package/src/theme/ThemeProvider.ts +73 -73
  258. package/src/theme/defaultTheme.ts +471 -471
  259. package/src/theme/helpers.ts +89 -89
  260. package/src/theme/index.ts +4 -4
  261. package/src/theme/types.ts +139 -139
  262. package/src/types/index.ts +8 -8
  263. package/src/typings.d.ts +2 -2
  264. package/tsconfig.json +41 -41
  265. package/tsconfig.tsbuildinfo +0 -1
@@ -1,64 +1,74 @@
1
1
  import { jsx as x } from "react/jsx-runtime";
2
- import { useMemo as I, useState as v, useRef as A, useCallback as p, useEffect as D } from "react";
3
- import { EditableCellContainer as M } from "./styles.js";
4
- import { useDataGridContext as V } from "../hooks/index.js";
5
- const S = ({
2
+ import { useMemo as I, useState as A, useRef as D, useCallback as p, useEffect as M } from "react";
3
+ import { EditableCellContainer as V } from "./styles.js";
4
+ import { useDataGridContext as j } from "../hooks/index.js";
5
+ const q = ({
6
6
  row: e,
7
7
  columnKey: s,
8
8
  column: t,
9
- context: a
9
+ context: a,
10
+ rowIndex: G,
11
+ columnIndex: T
10
12
  }) => {
11
- const { setEditingCell: u, setRows: C, editRow: R, rows: w, rowKeyGetter: l } = V(a), f = I(() => t.getter(e), [t, e]), [o, G] = v(f), r = A(null), d = l(e), T = p(
12
- (n, i, c) => ({ Id: n, [s]: c }),
13
+ const { setEditingCell: u, setRows: C, editRow: R, rows: w, rowKeyGetter: l } = j(a), d = I(() => t.getter(e), [t, e]), [o, P] = A(d), r = D(null), f = l(e), $ = p(
14
+ (i, n, c) => ({ Id: i, [s]: c }),
13
15
  [s]
14
- ), E = "itemToPartialRow" in t && t.itemToPartialRow || T, b = p(() => {
15
- const n = w.findIndex((i) => l(i) === d);
16
- if (n >= 0) {
17
- const i = E(d, e, o), c = {
16
+ ), b = "itemToPartialRow" in t && t.itemToPartialRow || $, E = p(() => {
17
+ const i = w.findIndex((n) => l(n) === f);
18
+ if (i >= 0) {
19
+ const n = b(f, e, o), c = {
18
20
  ...e,
19
- ...i
21
+ ...n
20
22
  };
21
- R(i), C?.((h) => {
22
- const m = [...h];
23
- return m[n] = c, m;
23
+ R(n), C?.((v) => {
24
+ const m = [...v];
25
+ return m[i] = c, m;
24
26
  });
25
27
  }
26
28
  }, [
27
29
  R,
28
- E,
30
+ b,
29
31
  e,
30
- d,
32
+ f,
31
33
  l,
32
34
  w,
33
35
  C,
34
36
  o
35
37
  ]), g = p(
36
- (n, i = [-1, -1]) => {
37
- n && o !== f && b(), u(i);
38
+ (i, n = [-1, -1]) => {
39
+ i && o !== d && E(), u(n);
38
40
  },
39
- [f, b, u, o]
41
+ [d, E, u, o]
40
42
  );
41
- D(() => {
43
+ M(() => {
42
44
  r.current && (r.current.focus(), r.current instanceof HTMLInputElement && r.current.select());
43
45
  }, [r]);
44
- const P = I(() => {
46
+ const h = I(() => {
45
47
  if (!("editable" in t) || !t.editable || !t.editComponent)
46
48
  return null;
47
- const n = t.editComponent;
49
+ const i = t.editComponent;
48
50
  return /* @__PURE__ */ x(
49
- n,
51
+ i,
50
52
  {
51
53
  row: e,
52
54
  ref: r,
53
55
  value: o,
54
- onChange: G,
56
+ onChange: P,
55
57
  onClose: g,
56
58
  context: a
57
59
  }
58
60
  );
59
61
  }, [t, a, g, e, o]);
60
- return /* @__PURE__ */ x(M, { $textAlign: t.textAlign, children: P }, s);
62
+ return /* @__PURE__ */ x(
63
+ V,
64
+ {
65
+ "data-testid": `editable-cell-${G}-${T}`,
66
+ $textAlign: t.textAlign,
67
+ children: h
68
+ },
69
+ s
70
+ );
61
71
  };
62
72
  export {
63
- S as DataGridEditableCell
73
+ q as DataGridEditableCell
64
74
  };
@@ -3,71 +3,86 @@ import { DataGridRow as m, LoadingCell as p, SelectionCell as b } from "./styles
3
3
  import { DataGridCell as f } from "./DataGridCell.js";
4
4
  import { useContext as k } from "react";
5
5
  const R = ({
6
- item: t,
7
- index: r,
8
- context: i
6
+ item: a,
7
+ index: o,
8
+ context: r
9
9
  }) => {
10
10
  const {
11
- visibleColumns: d,
12
- rowKeyGetter: c,
11
+ visibleColumns: c,
12
+ rowKeyGetter: d,
13
13
  toggleSelection: u,
14
14
  updatedRows: y,
15
15
  addedRows: h,
16
- ...a
17
- } = k(i);
18
- if (!t)
19
- return /* @__PURE__ */ n(m, { children: [
20
- !!a.selectable && /* @__PURE__ */ s(p, { className: "animate-pulse", children: /* @__PURE__ */ s("div", {}) }),
21
- d.map((e, o) => /* @__PURE__ */ s(
22
- p,
23
- {
24
- className: "animate-pulse",
25
- children: /* @__PURE__ */ s("div", {})
26
- },
27
- `loading-${r}-${o}`
28
- ))
29
- ] }, `loading-row-${r}`);
30
- const l = c(t), w = a.selectedKeys.includes(l), { className: C, style: g } = a.rowClassNameGetter?.(t) ?? {
16
+ ...i
17
+ } = k(r);
18
+ if (!a)
19
+ return /* @__PURE__ */ n(
20
+ m,
21
+ {
22
+ "data-testid": `loading-row-${o}`,
23
+ children: [
24
+ !!i.selectable && /* @__PURE__ */ s(p, { className: "animate-pulse", children: /* @__PURE__ */ s("div", {}) }),
25
+ c.map((e, l) => /* @__PURE__ */ s(
26
+ p,
27
+ {
28
+ className: "animate-pulse",
29
+ children: /* @__PURE__ */ s("div", {})
30
+ },
31
+ `loading-${o}-${l}`
32
+ ))
33
+ ]
34
+ },
35
+ `loading-row-${o}`
36
+ );
37
+ const t = d(a), $ = i.selectedKeys.includes(t), { className: g, style: w } = i.rowClassNameGetter?.(a) ?? {
31
38
  className: "",
32
39
  style: void 0
33
- }, _ = h.some((e) => c(e) === l), $ = y.some(
34
- (e) => c(e) === l
40
+ }, C = h.some((e) => d(e) === t), _ = y.some(
41
+ (e) => d(e) === t
35
42
  );
36
- return /* @__PURE__ */ n(m, { $edited: _ || $, children: [
37
- !!a.selectable && /* @__PURE__ */ s(
38
- b,
39
- {
40
- onClick: () => u(l),
41
- children: /* @__PURE__ */ s(
42
- "input",
43
+ return /* @__PURE__ */ n(
44
+ m,
45
+ {
46
+ $edited: C || _,
47
+ "data-testid": `row-${o}`,
48
+ children: [
49
+ !!i.selectable && /* @__PURE__ */ s(
50
+ b,
43
51
  {
44
- type: "checkbox",
45
- value: l,
46
- checked: w,
47
- readOnly: !0
48
- }
49
- )
50
- },
51
- "__select_checkbox__"
52
- ),
53
- d.map((e, o) => (
54
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
55
- /* @__PURE__ */ s(
56
- f,
57
- {
58
- ...o === 0 ? { className: C, style: g } : {},
59
- row: t,
60
- rowIndex: r,
61
- column: e,
62
- columnIndex: o,
63
- context: i,
64
- columnKey: e.key,
65
- color: e.color
66
- },
67
- `loading-${o}-${o}`
68
- )
69
- ))
70
- ] }, l);
52
+ onClick: () => u(t),
53
+ children: /* @__PURE__ */ s(
54
+ "input",
55
+ {
56
+ type: "checkbox",
57
+ value: t,
58
+ checked: $,
59
+ readOnly: !0
60
+ }
61
+ )
62
+ },
63
+ "__select_checkbox__"
64
+ ),
65
+ c.map((e, l) => (
66
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
67
+ /* @__PURE__ */ s(
68
+ f,
69
+ {
70
+ ...l === 0 ? { className: g, style: w } : {},
71
+ row: a,
72
+ rowIndex: o,
73
+ column: e,
74
+ columnIndex: l,
75
+ context: r,
76
+ columnKey: e.key,
77
+ color: e.color
78
+ },
79
+ `loading-${l}-${l}`
80
+ )
81
+ ))
82
+ ]
83
+ },
84
+ t
85
+ );
71
86
  };
72
87
  export {
73
88
  R as DataGridRowTemplate
@@ -0,0 +1,42 @@
1
+ import { default as React, HTMLAttributes } from 'react';
2
+ export declare const GlobalContextMenuProvider: React.FC<{
3
+ children: React.ReactNode;
4
+ }>;
5
+ export interface ContextMenuProps {
6
+ children: React.ReactNode;
7
+ }
8
+ export declare const ContextMenu: React.FC<ContextMenuProps>;
9
+ export interface ContextMenuTriggerProps extends HTMLAttributes<HTMLDivElement> {
10
+ children: React.ReactNode;
11
+ }
12
+ export declare const ContextMenuTrigger: React.ForwardRefExoticComponent<ContextMenuTriggerProps & React.RefAttributes<HTMLDivElement>>;
13
+ export interface ContextMenuContentProps extends HTMLAttributes<HTMLDivElement> {
14
+ children: React.ReactNode;
15
+ }
16
+ export declare const ContextMenuContent: React.ForwardRefExoticComponent<ContextMenuContentProps & React.RefAttributes<HTMLDivElement>>;
17
+ export interface ContextMenuItemProps extends HTMLAttributes<HTMLDivElement> {
18
+ children: React.ReactNode;
19
+ disabled?: boolean;
20
+ onSelect?: () => void;
21
+ }
22
+ export declare const ContextMenuItem: React.ForwardRefExoticComponent<ContextMenuItemProps & React.RefAttributes<HTMLDivElement>>;
23
+ export interface ContextMenuSeparatorProps extends HTMLAttributes<HTMLDivElement> {
24
+ }
25
+ export declare const ContextMenuSeparator: React.ForwardRefExoticComponent<ContextMenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
26
+ export interface ContextMenuLabelProps extends HTMLAttributes<HTMLDivElement> {
27
+ children: React.ReactNode;
28
+ }
29
+ export declare const ContextMenuLabel: React.ForwardRefExoticComponent<ContextMenuLabelProps & React.RefAttributes<HTMLDivElement>>;
30
+ export interface ContextMenuSubProps {
31
+ children: React.ReactNode;
32
+ }
33
+ export declare const ContextMenuSub: React.FC<ContextMenuSubProps>;
34
+ export interface ContextMenuSubTriggerProps extends HTMLAttributes<HTMLDivElement> {
35
+ children: React.ReactNode;
36
+ disabled?: boolean;
37
+ }
38
+ export declare const ContextMenuSubTrigger: React.ForwardRefExoticComponent<ContextMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
39
+ export interface ContextMenuSubContentProps extends HTMLAttributes<HTMLDivElement> {
40
+ children: React.ReactNode;
41
+ }
42
+ export declare const ContextMenuSubContent: React.ForwardRefExoticComponent<ContextMenuSubContentProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,252 @@
1
+ import { jsx as l, jsxs as k } from "react/jsx-runtime";
2
+ import p, { createContext as M, useRef as w, useEffect as C, useState as g, useContext as b } from "react";
3
+ import { cn as f } from "../../../helpers/cn.js";
4
+ const N = M(void 0), Z = ({ children: t }) => {
5
+ const [r, n] = g(null);
6
+ return C(() => {
7
+ const e = () => n(null);
8
+ return document.addEventListener("click", e), () => document.removeEventListener("click", e);
9
+ }, []), /* @__PURE__ */ l(
10
+ N.Provider,
11
+ {
12
+ value: { currentMenuId: r, setCurrentMenuId: n },
13
+ children: t
14
+ }
15
+ );
16
+ }, O = () => {
17
+ const t = b(N);
18
+ if (!t)
19
+ throw new Error(
20
+ "ContextMenu must be used within GlobalContextMenuProvider"
21
+ );
22
+ return t;
23
+ }, S = M(
24
+ void 0
25
+ ), y = () => {
26
+ const t = b(S);
27
+ if (!t)
28
+ throw new Error("ContextMenu components must be used within a ContextMenu");
29
+ return t;
30
+ };
31
+ let j = 0;
32
+ const q = ({ children: t }) => {
33
+ const { currentMenuId: r, setCurrentMenuId: n } = O(), [e] = g(() => `context-menu-${j++}`), [i, c] = g({ x: 0, y: 0 }), s = r === e, o = (x, u) => {
34
+ c({ x, y: u }), n(e);
35
+ }, d = () => {
36
+ r === e && n(null);
37
+ };
38
+ return /* @__PURE__ */ l(
39
+ S.Provider,
40
+ {
41
+ value: { menuId: e, isOpen: s, position: i, openMenu: o, closeMenu: d },
42
+ children: t
43
+ }
44
+ );
45
+ }, z = p.forwardRef(({ children: t, className: r, ...n }, e) => {
46
+ const { openMenu: i } = y();
47
+ return /* @__PURE__ */ l(
48
+ "div",
49
+ {
50
+ ref: e,
51
+ onContextMenu: (s) => {
52
+ s.preventDefault(), i(s.clientX, s.clientY);
53
+ },
54
+ className: f("cursor-pointer", r),
55
+ ...n,
56
+ children: t
57
+ }
58
+ );
59
+ });
60
+ z.displayName = "ContextMenuTrigger";
61
+ const B = p.forwardRef(({ children: t, className: r, ...n }, e) => {
62
+ const { isOpen: i, position: c } = y(), s = w(null);
63
+ return C(() => {
64
+ if (i && s.current) {
65
+ const o = s.current.getBoundingClientRect(), d = window.innerWidth, x = window.innerHeight;
66
+ let u = c.x, a = c.y;
67
+ c.x + o.width > d && (u = d - o.width - 10), c.y + o.height > x && (a = x - o.height - 10), s.current.style.left = `${u}px`, s.current.style.top = `${a}px`;
68
+ }
69
+ }, [i, c]), i ? /* @__PURE__ */ l(
70
+ "div",
71
+ {
72
+ ref: (o) => {
73
+ typeof e == "function" ? e(o) : e && (e.current = o), s.current = o;
74
+ },
75
+ className: f(
76
+ "fixed z-50 min-w-[12rem] bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",
77
+ "rounded-theme-md p-theme-xs",
78
+ r
79
+ ),
80
+ onClick: (o) => o.stopPropagation(),
81
+ ...n,
82
+ children: t
83
+ }
84
+ ) : null;
85
+ });
86
+ B.displayName = "ContextMenuContent";
87
+ const G = p.forwardRef(({ children: t, className: r, disabled: n, onSelect: e, ...i }, c) => {
88
+ const { closeMenu: s } = y(), o = () => {
89
+ !n && e && (e(), s());
90
+ };
91
+ return /* @__PURE__ */ l(
92
+ "div",
93
+ {
94
+ ref: c,
95
+ className: f(
96
+ "relative flex cursor-pointer select-none items-center text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",
97
+ "px-theme-sm py-theme-xs rounded-theme-sm",
98
+ n && "pointer-events-none opacity-50",
99
+ r
100
+ ),
101
+ onClick: o,
102
+ ...i,
103
+ children: t
104
+ }
105
+ );
106
+ });
107
+ G.displayName = "ContextMenuItem";
108
+ const H = p.forwardRef(({ className: t, ...r }, n) => /* @__PURE__ */ l(
109
+ "div",
110
+ {
111
+ ref: n,
112
+ className: f("bg-border h-px my-theme-xs", t),
113
+ ...r
114
+ }
115
+ ));
116
+ H.displayName = "ContextMenuSeparator";
117
+ const W = p.forwardRef(({ children: t, className: r, ...n }, e) => /* @__PURE__ */ l(
118
+ "div",
119
+ {
120
+ ref: e,
121
+ className: f(
122
+ "font-semibold text-foreground px-theme-sm py-theme-xs text-theme-sm",
123
+ r
124
+ ),
125
+ ...n,
126
+ children: t
127
+ }
128
+ ));
129
+ W.displayName = "ContextMenuLabel";
130
+ const E = M(
131
+ void 0
132
+ ), L = () => {
133
+ const t = b(E);
134
+ if (!t)
135
+ throw new Error("SubMenu components must be used within a ContextMenuSub");
136
+ return t;
137
+ }, A = ({ children: t }) => {
138
+ const [r, n] = g(!1), e = w(null), i = () => {
139
+ e.current && (clearTimeout(e.current), e.current = null), n(!0);
140
+ }, c = () => {
141
+ e.current = setTimeout(() => {
142
+ n(!1), e.current = null;
143
+ }, 150);
144
+ };
145
+ return C(() => () => {
146
+ e.current && clearTimeout(e.current);
147
+ }, []), /* @__PURE__ */ l(E.Provider, { value: { isOpen: r, openSubMenu: i, closeSubMenu: c }, children: /* @__PURE__ */ l("div", { className: "relative w-full", children: t }) });
148
+ }, $ = p.forwardRef(({ children: t, className: r, disabled: n, ...e }, i) => {
149
+ const { openSubMenu: c } = L();
150
+ return /* @__PURE__ */ k(
151
+ "div",
152
+ {
153
+ ref: i,
154
+ className: f(
155
+ "flex cursor-pointer select-none items-center justify-between text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",
156
+ "px-theme-sm py-theme-xs rounded-theme-sm",
157
+ n && "pointer-events-none opacity-50",
158
+ r
159
+ ),
160
+ onMouseEnter: c,
161
+ onClick: (s) => s.stopPropagation(),
162
+ ...e,
163
+ children: [
164
+ t,
165
+ /* @__PURE__ */ l(
166
+ "svg",
167
+ {
168
+ width: "15",
169
+ height: "15",
170
+ viewBox: "0 0 15 15",
171
+ fill: "none",
172
+ xmlns: "http://www.w3.org/2000/svg",
173
+ className: "ml-auto",
174
+ children: /* @__PURE__ */ l(
175
+ "path",
176
+ {
177
+ d: "M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",
178
+ fill: "currentColor",
179
+ fillRule: "evenodd",
180
+ clipRule: "evenodd"
181
+ }
182
+ )
183
+ }
184
+ )
185
+ ]
186
+ }
187
+ );
188
+ });
189
+ $.displayName = "ContextMenuSubTrigger";
190
+ const X = p.forwardRef(({ children: t, className: r, ...n }, e) => {
191
+ const { isOpen: i, openSubMenu: c, closeSubMenu: s } = L(), o = w(null), [d, x] = g({});
192
+ return C(() => {
193
+ const u = (m) => {
194
+ if (o.current && !o.current.contains(m.relatedTarget)) {
195
+ const v = o.current.parentElement;
196
+ v && !v.contains(m.relatedTarget) && s();
197
+ }
198
+ }, a = o.current?.parentElement;
199
+ if (a)
200
+ return a.addEventListener("mouseleave", u), () => a.removeEventListener("mouseleave", u);
201
+ }, [s]), C(() => {
202
+ if (i && o.current) {
203
+ const u = o.current.getBoundingClientRect(), a = o.current.parentElement;
204
+ if (a) {
205
+ const m = a.getBoundingClientRect(), v = window.innerWidth, R = window.innerHeight, P = v - m.right, T = m.left, h = {};
206
+ if (P >= u.width + 8 ? h.left = "100%" : T >= u.width + 8 ? h.right = "100%" : h.left = "100%", m.top + u.height > R) {
207
+ const I = Math.max(
208
+ 0,
209
+ R - u.height - 10
210
+ );
211
+ h.top = `${I - m.top}px`;
212
+ } else
213
+ h.top = "0";
214
+ x(h);
215
+ }
216
+ }
217
+ }, [i]), i ? /* @__PURE__ */ l(
218
+ "div",
219
+ {
220
+ ref: (u) => {
221
+ typeof e == "function" ? e(u) : e && (e.current = u), o.current = u;
222
+ },
223
+ className: f(
224
+ "absolute min-w-[12rem] overflow-hidden bg-popover text-popover-foreground shadow-lg border border-border animate-in fade-in-0 zoom-in-95 z-50",
225
+ "rounded-theme-md p-theme-xs",
226
+ r
227
+ ),
228
+ style: {
229
+ left: d.left,
230
+ right: d.right,
231
+ top: d.top || "0"
232
+ },
233
+ onMouseEnter: c,
234
+ onClick: (u) => u.stopPropagation(),
235
+ ...n,
236
+ children: t
237
+ }
238
+ ) : null;
239
+ });
240
+ X.displayName = "ContextMenuSubContent";
241
+ export {
242
+ q as ContextMenu,
243
+ B as ContextMenuContent,
244
+ G as ContextMenuItem,
245
+ W as ContextMenuLabel,
246
+ H as ContextMenuSeparator,
247
+ A as ContextMenuSub,
248
+ X as ContextMenuSubContent,
249
+ $ as ContextMenuSubTrigger,
250
+ z as ContextMenuTrigger,
251
+ Z as GlobalContextMenuProvider
252
+ };
@@ -0,0 +1,2 @@
1
+ export { GlobalContextMenuProvider, ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuSeparator, ContextMenuLabel, ContextMenuSub, ContextMenuSubTrigger, ContextMenuSubContent, } from './ContextMenu';
2
+ export type { ContextMenuProps, ContextMenuTriggerProps, ContextMenuContentProps, ContextMenuItemProps, ContextMenuSeparatorProps, ContextMenuLabelProps, ContextMenuSubProps, ContextMenuSubTriggerProps, ContextMenuSubContentProps, } from './ContextMenu';
@@ -0,0 +1,22 @@
1
+ import { IconFC } from '../../../icons';
2
+ export interface LeftMenuItem {
3
+ id: string;
4
+ label: string;
5
+ icon?: IconFC;
6
+ onClick?: () => void;
7
+ }
8
+ export interface LeftMenuGroup {
9
+ title?: string;
10
+ items: LeftMenuItem[];
11
+ }
12
+ export interface LeftMenuProps {
13
+ header?: {
14
+ title: string;
15
+ subtitle?: string;
16
+ };
17
+ groups: LeftMenuGroup[];
18
+ activeItemId?: string;
19
+ onItemClick?: (itemId: string) => void;
20
+ className?: string;
21
+ }
22
+ export declare function LeftMenu({ header, groups, activeItemId, onItemClick, className, }: LeftMenuProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,43 @@
1
+ import { jsxs as o, jsx as t } from "react/jsx-runtime";
2
+ import { cn as c } from "../../../helpers/cn.js";
3
+ function b({
4
+ header: r,
5
+ groups: i,
6
+ activeItemId: d,
7
+ onItemClick: n,
8
+ className: m
9
+ }) {
10
+ const f = (e) => {
11
+ e.onClick && e.onClick(), n && n(e.id);
12
+ };
13
+ return /* @__PURE__ */ o("aside", { className: c("h-full w-full bg-card flex flex-col", m), children: [
14
+ r && /* @__PURE__ */ o("div", { className: "p-6 border-b border-border", children: [
15
+ /* @__PURE__ */ t("h1", { className: "text-xl font-bold text-foreground", children: r.title }),
16
+ r.subtitle && /* @__PURE__ */ t("p", { className: "text-sm text-muted-foreground mt-1", children: r.subtitle })
17
+ ] }),
18
+ /* @__PURE__ */ t("nav", { className: "flex-1 overflow-y-auto p-4", children: i.map((e, s) => /* @__PURE__ */ o("div", { className: c(s > 0 && "mt-6"), children: [
19
+ e.title && /* @__PURE__ */ t("h3", { className: "px-4 text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2", children: e.title }),
20
+ /* @__PURE__ */ t("div", { className: "space-y-1", children: e.items.map((l) => {
21
+ const a = l.icon;
22
+ return /* @__PURE__ */ o(
23
+ "button",
24
+ {
25
+ onClick: () => f(l),
26
+ className: c(
27
+ "w-full flex items-center gap-3 px-4 py-2.5 rounded-lg text-sm font-medium transition-colors",
28
+ d === l.id ? "bg-primary text-primary-foreground" : "text-foreground hover:bg-accent hover:text-accent-foreground"
29
+ ),
30
+ children: [
31
+ a && /* @__PURE__ */ t(a, { className: "w-4 h-4" }),
32
+ l.label
33
+ ]
34
+ },
35
+ l.id
36
+ );
37
+ }) })
38
+ ] }, s)) })
39
+ ] });
40
+ }
41
+ export {
42
+ b as LeftMenu
43
+ };
@@ -0,0 +1,2 @@
1
+ export { LeftMenu } from './LeftMenu';
2
+ export type { LeftMenuProps, LeftMenuItem, LeftMenuGroup } from './LeftMenu';
@@ -0,0 +1,16 @@
1
+ import { ReactNode } from 'react';
2
+ export interface PanelContainerProps {
3
+ side?: 'left' | 'right';
4
+ collapsible?: boolean;
5
+ size?: string;
6
+ resizable?: boolean;
7
+ panel: ReactNode;
8
+ children: ReactNode;
9
+ className?: string;
10
+ panelClassName?: string;
11
+ contentClassName?: string;
12
+ defaultCollapsed?: boolean;
13
+ panelOverflow?: 'auto' | 'scroll' | 'hidden' | 'visible' | 'overflow-y-auto' | 'overflow-x-auto';
14
+ contentOverflow?: 'auto' | 'scroll' | 'hidden' | 'visible' | 'overflow-y-auto' | 'overflow-x-auto' | 'none';
15
+ }
16
+ export declare function PanelContainer({ side, collapsible, size, resizable, panel, children, className, panelClassName, contentClassName, defaultCollapsed, panelOverflow, contentOverflow, }: PanelContainerProps): import("react/jsx-runtime").JSX.Element;