zuii 1.4.18 → 1.4.19

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 (32) hide show
  1. package/dist/components/Dashboard/style/index.css +1 -1
  2. package/dist/components/Form/js/tel-input.d.ts +20 -0
  3. package/dist/components/Form/js/tel-input.js +15 -4
  4. package/dist/components/Form/react/FormDate.js +44 -42
  5. package/dist/components/Form/react/TelInput.d.ts +9 -1
  6. package/dist/components/Form/react/TelInput.js +62 -37
  7. package/dist/components/Form/react/index.d.ts +1 -1
  8. package/dist/components/Form/style/index.css +1 -1
  9. package/dist/components/Group/react/index.d.ts +6 -2
  10. package/dist/components/Group/react/index.js +9 -7
  11. package/dist/components/Group/style/index.css +1 -1
  12. package/dist/components/Lang-selector/js/language-selector.d.ts +2 -1
  13. package/dist/components/Lang-selector/js/language-selector.js +5 -5
  14. package/dist/components/Lang-selector/react/index.d.ts +6 -1
  15. package/dist/components/Lang-selector/react/index.js +13 -11
  16. package/dist/components/Loader/react/index.d.ts +1 -1
  17. package/dist/components/Loader/react/index.js +8 -9
  18. package/dist/components/Nav/style/index.css +1 -1
  19. package/dist/components/Placeholder/style/index.css +1 -1
  20. package/dist/components/Tab/react/index.js +27 -28
  21. package/dist/components/Table/js/table.d.ts +4 -0
  22. package/dist/components/Table/react/index.d.ts +1 -1
  23. package/dist/components/Table/react/index.js +29 -27
  24. package/dist/templates/Forms/Forms-elements.tsx +5 -1
  25. package/dist/templates/Forms/Forms.tsx +2 -2
  26. package/dist/templates/Groups/Groups.d.ts +5 -0
  27. package/dist/templates/Groups/Groups.tsx +85 -0
  28. package/dist/templates/Sliders/Sliders.tsx +0 -1
  29. package/dist/templates/Tables/Tables.tsx +9 -0
  30. package/dist/templates/index.d.ts +1 -0
  31. package/dist/templates/index.ts +1 -0
  32. package/package.json +1 -1
@@ -1,34 +1,34 @@
1
1
  import { jsx as t, jsxs as L } from "react/jsx-runtime";
2
2
  import i, { useState as R } from "react";
3
- import { TabContainer as N, TabContent as T, TabPane as g, Tabs as V, Tab as x, Nav as q } from "react-bootstrap";
3
+ import { TabContainer as _, TabContent as N, TabPane as T, Tabs as V, Tab as g, Nav as q } from "react-bootstrap";
4
4
  import '../style/index.css';/* empty css */
5
- import { Group as _ } from "../../Group/react/index.js";
5
+ import { Group as K } from "../../Group/react/index.js";
6
6
  import { Button as w } from "../../Button/react/index.js";
7
7
  const s = ({
8
8
  items: n = [],
9
- children: P,
9
+ children: x,
10
10
  className: $ = "",
11
11
  vertical: d = !1,
12
- variant: v = "",
13
- border: S = !1,
14
- color: b = "primary",
15
- defaultActiveKey: j,
16
- activeKey: m,
12
+ variant: m = "",
13
+ border: P = !1,
14
+ color: v = "primary",
15
+ defaultActiveKey: S,
16
+ activeKey: b,
17
17
  onSelect: h,
18
- contentClassName: p = "tabs__content",
19
- ...f
18
+ contentClassName: j = "tabs__content",
19
+ ...p
20
20
  }) => {
21
- const [A, B] = R(j || (n.length > 0 ? n[0].eventKey : void 0)), o = m !== void 0 ? m : A, c = (e, r) => {
21
+ const [A, B] = R(S || (n.length > 0 ? n[0].eventKey : void 0)), o = b !== void 0 ? b : A, c = (e, r) => {
22
22
  e && B(e), h && h(e, r);
23
- }, a = "tabs", C = d ? `${a}--vertical` : "", u = v ? `${a}--${v}` : "", E = S ? `${a}--border` : "", y = `${a}--${b}`, K = `${a}__item btn btn-${b}`;
23
+ }, a = "tabs", C = d ? `${a}--vertical` : "", f = m ? `${a}--${m}` : "", E = P ? `${a}--border` : "", u = `${a}--${v}`, y = `${a}__item btn btn-${v}`;
24
24
  return n.length > 0 && d ? /* @__PURE__ */ t(
25
- N,
25
+ _,
26
26
  {
27
- ...f,
27
+ ...p,
28
28
  activeKey: o,
29
29
  onSelect: c,
30
- children: /* @__PURE__ */ L(_, { className: `${a} ${C} ${u} ${y} ${$}`.trim(), children: [
31
- /* @__PURE__ */ t(_, { vertical: !0, className: "tabs__nav", children: n.map((e, r) => /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
30
+ children: /* @__PURE__ */ L(K, { className: `${a} ${C} ${f} ${u} ${$}`.trim(), children: [
31
+ /* @__PURE__ */ t(K, { vertical: !0, className: "tabs__nav", children: n.map((e, r) => /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
32
32
  w,
33
33
  {
34
34
  variant: "transparent",
@@ -37,41 +37,40 @@ const s = ({
37
37
  children: e.header
38
38
  }
39
39
  ) }, r)) }),
40
- /* @__PURE__ */ t(T, { className: p, children: n.map((e, r) => /* @__PURE__ */ t(g, { eventKey: e.eventKey, children: e.body }, r)) })
40
+ /* @__PURE__ */ t(N, { className: j, children: n.map((e, r) => /* @__PURE__ */ t(T, { eventKey: e.eventKey, children: e.body }, r)) })
41
41
  ] })
42
42
  }
43
- ) : /* @__PURE__ */ t("div", { className: `${a} ${C} ${u} ${E} ${y} ${$}`.trim(), children: /* @__PURE__ */ t(
43
+ ) : /* @__PURE__ */ t("div", { className: `${a} ${C} ${f} ${E} ${u} ${$}`.trim(), children: /* @__PURE__ */ t(
44
44
  V,
45
45
  {
46
46
  activeKey: o,
47
47
  onSelect: c,
48
- contentClassName: p,
49
- ...f,
48
+ ...p,
50
49
  children: n.length > 0 ? n.map((e, r) => {
51
50
  const { header: l, body: G, ...I } = e;
52
51
  return /* @__PURE__ */ t(
53
- x,
52
+ g,
54
53
  {
55
54
  title: l,
56
55
  ...I,
57
- tabClassName: K,
56
+ tabClassName: y,
58
57
  children: /* @__PURE__ */ t("div", { className: `${a}__content`, children: G })
59
58
  },
60
59
  r
61
60
  );
62
61
  }) : (
63
62
  // Mode composé : injecter tabClassName sur chaque Tabs.Item enfant
64
- i.Children.map(P, (e) => i.isValidElement(e) ? i.cloneElement(e, {
65
- tabClassName: `${K} ${e.props.tabClassName || ""}`.trim()
63
+ i.Children.map(x, (e) => i.isValidElement(e) ? i.cloneElement(e, {
64
+ tabClassName: `${y} ${e.props.tabClassName || ""}`.trim()
66
65
  }) : e)
67
66
  )
68
67
  }
69
68
  ) });
70
69
  };
71
- s.Item = x;
72
- s.Container = N;
73
- s.Content = T;
74
- s.Pane = g;
70
+ s.Item = g;
71
+ s.Container = _;
72
+ s.Content = N;
73
+ s.Pane = T;
75
74
  s.Nav = q;
76
75
  export {
77
76
  s as Tabs
@@ -41,6 +41,10 @@ export interface TableOptions {
41
41
  * Active la sélection de lignes.
42
42
  */
43
43
  selectable?: boolean;
44
+ /**
45
+ * Fonction pour déterminer si une ligne est sélectionnable.
46
+ */
47
+ isRowSelectable?: (node: any) => boolean;
44
48
  /**
45
49
  * Active la pagination.
46
50
  */
@@ -10,5 +10,5 @@ interface Props extends TableOptions {
10
10
  * @param {Props} props - Les propriétés du composant.
11
11
  * @returns {JSX.Element} Le rendu du composant.
12
12
  */
13
- export declare const Table: ({ rowData, columnDefs, theme, className, selectable, pagination, paginationPageSize, pageSizeOptions, resizable, locale, selectionColumnDef, rowClassRules, rowModelType, datasource, cacheBlockSize, maxBlocksInCache, onGridReady, sortable, icons, emptyRowsHeight, rowHeight, getRowHeight }: Props) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const Table: ({ rowData, columnDefs, theme, className, selectable, pagination, paginationPageSize, pageSizeOptions, resizable, locale, selectionColumnDef, rowClassRules, rowModelType, datasource, cacheBlockSize, maxBlocksInCache, onGridReady, sortable, icons, emptyRowsHeight, rowHeight, getRowHeight, isRowSelectable }: Props) => import("react/jsx-runtime").JSX.Element;
14
14
  export type { RowData, ColumnDef, TableOptions };
@@ -1,12 +1,12 @@
1
- import { jsxs as K, jsx as r } from "react/jsx-runtime";
2
- import { useRef as O, useState as z, useMemo as x, useCallback as n, useEffect as U } from "react";
3
- import { AgGridReact as J } from "ag-grid-react";
4
- import { ModuleRegistry as Q, AllCommunityModule as V } from "ag-grid-community";
5
- import { processColumnDefs as X, getLocaleText as Y } from "../js/table.js";
6
- import { TablePagination as Z } from "./TablePagination.js";
1
+ import { jsxs as O, jsx as r } from "react/jsx-runtime";
2
+ import { useRef as U, useState as z, useMemo as x, useCallback as n, useEffect as J } from "react";
3
+ import { AgGridReact as Q } from "ag-grid-react";
4
+ import { ModuleRegistry as V, AllCommunityModule as X } from "ag-grid-community";
5
+ import { processColumnDefs as Y, getLocaleText as Z } from "../js/table.js";
6
+ import { TablePagination as v } from "./TablePagination.js";
7
7
  import '../style/index.css';/* empty css */
8
- Q.registerModules([V]);
9
- const le = ({
8
+ V.registerModules([X]);
9
+ const re = ({
10
10
  rowData: c,
11
11
  columnDefs: g = [],
12
12
  theme: G = "ag-theme-alpine",
@@ -28,54 +28,55 @@ const le = ({
28
28
  icons: S,
29
29
  emptyRowsHeight: h = "2rem",
30
30
  rowHeight: L = 25,
31
- getRowHeight: W
31
+ getRowHeight: W,
32
+ isRowSelectable: j
32
33
  }) => {
33
- const j = `datagrid ${G} ${T}`.trim(), l = O(null), [a, E] = z(null), [t, N] = z({
34
+ const E = `datagrid ${G} ${T}`.trim(), l = U(null), [a, N] = z(null), [t, _] = z({
34
35
  currentPage: 0,
35
36
  totalPages: 0,
36
37
  pageSize: M,
37
38
  totalRows: 0
38
- }), _ = x(() => X(g), [g]), C = x(() => Y(f), [f]), q = n((e) => {
39
- E(e.api), s && s(e);
40
- }, [s]), B = n((e) => {
39
+ }), q = x(() => Y(g), [g]), C = x(() => Z(f), [f]), B = n((e) => {
40
+ N(e.api), s && s(e);
41
+ }, [s]), F = n((e) => {
41
42
  if (e.api) {
42
43
  const i = e.api.paginationGetCurrentPage(), w = e.api.paginationGetTotalPages(), R = e.api.paginationGetPageSize(), b = e.api.paginationGetRowCount();
43
- N((o) => o.currentPage === i && o.totalPages === w && o.pageSize === R && o.totalRows === b ? o : {
44
+ _((o) => o.currentPage === i && o.totalPages === w && o.pageSize === R && o.totalRows === b ? o : {
44
45
  currentPage: i,
45
46
  totalPages: w,
46
47
  pageSize: R,
47
48
  totalRows: b
48
49
  });
49
50
  }
50
- }, []), F = n((e) => {
51
+ }, []), I = n((e) => {
51
52
  a?.paginationGoToPage(e);
52
- }, [a]), I = n((e) => {
53
+ }, [a]), K = n((e) => {
53
54
  a?.setGridOption("paginationPageSize", e);
54
55
  }, [a]);
55
- return U(() => {
56
+ return J(() => {
56
57
  if (!l.current) return;
57
58
  const e = l.current.querySelector(".ag-floating-bottom");
58
59
  if (e instanceof HTMLElement) {
59
60
  const i = t.totalRows > 0;
60
61
  e.style.minHeight = i ? "0" : `${h}`;
61
62
  }
62
- }, [h, a, c, d, t.totalRows]), /* @__PURE__ */ K("div", { className: j, style: { width: "100%" }, ref: l, children: [
63
+ }, [h, a, c, d, t.totalRows]), /* @__PURE__ */ O("div", { className: E, style: { width: "100%" }, ref: l, children: [
63
64
  /* @__PURE__ */ r("div", { className: "datagrid__container", children: /* @__PURE__ */ r(
64
- J,
65
+ Q,
65
66
  {
66
67
  theme: "legacy",
67
68
  rowData: m === "infinite" ? void 0 : c || [],
68
- columnDefs: _,
69
+ columnDefs: q,
69
70
  domLayout: "autoHeight",
70
71
  pagination: p,
71
72
  paginationPageSize: t.pageSize,
72
73
  suppressPaginationPanel: !0,
73
- onPaginationChanged: B,
74
+ onPaginationChanged: F,
74
75
  rowModelType: m,
75
76
  datasource: d,
76
77
  cacheBlockSize: A,
77
78
  maxBlocksInCache: $,
78
- onGridReady: q,
79
+ onGridReady: B,
79
80
  localeText: C,
80
81
  rowClassRules: k,
81
82
  icons: S || {
@@ -86,7 +87,8 @@ const le = ({
86
87
  headerCheckbox: !0,
87
88
  checkboxes: !0,
88
89
  enableSelectionWithoutKeys: !0,
89
- enableClickSelection: !1
90
+ enableClickSelection: !1,
91
+ isRowSelectable: j
90
92
  } : void 0,
91
93
  selectionColumnDef: u ? {
92
94
  pinned: "left",
@@ -113,20 +115,20 @@ const le = ({
113
115
  }
114
116
  ) }),
115
117
  p && /* @__PURE__ */ r(
116
- Z,
118
+ v,
117
119
  {
118
120
  currentPage: t.currentPage,
119
121
  totalPages: t.totalPages,
120
122
  pageSize: t.pageSize,
121
123
  totalRows: t.totalRows,
122
124
  pageSizeOptions: y,
123
- onPageChange: F,
124
- onPageSizeChange: I,
125
+ onPageChange: I,
126
+ onPageSizeChange: K,
125
127
  localeText: C
126
128
  }
127
129
  )
128
130
  ] });
129
131
  };
130
132
  export {
131
- le as Table
133
+ re as Table
132
134
  };
@@ -92,7 +92,11 @@ export const FormsElements = () => {
92
92
  ]} />
93
93
  <Form.Date />
94
94
  <Form.Color />
95
-
95
+ <Form.Group className="mb-3">
96
+ <Form.Label>Label</Form.Label>
97
+ <Form.Control as="textarea" rows={3} placeholder="Placeholder" />
98
+ </Form.Group>
99
+ <Form.Tel name='tel-test' nameFormat='tel-test-format' />
96
100
  <Form.Control type="submit" value="Submit" />
97
101
  </form>
98
102
 
@@ -150,10 +150,10 @@ export const Forms = () => {
150
150
  maxNumberOfFiles={5}
151
151
  maxFileSize={5 * 1024 * 1024} // 5 MB
152
152
  allowedFileTypes={['image/*', 'application/pdf']}
153
- onComplete={(result) => {
153
+ onComplete={(result: any) => {
154
154
  console.log('Téléchargement terminé:', result);
155
155
  }}
156
- onError={(error) => {
156
+ onError={(error: any) => {
157
157
  console.error('Erreur de téléchargement:', error);
158
158
  }}
159
159
  />
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Template de démonstration pour le composant Group.
3
+ * @returns {JSX.Element} La page de démo des groupes.
4
+ */
5
+ export declare const Groups: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,85 @@
1
+ import { Group } from '../../index';
2
+ import { Button } from '../../index';
3
+
4
+ const BOX_STYLE: React.CSSProperties = {
5
+ width: 200,
6
+ height: 120,
7
+ background: 'var(--color-neutral-100, #f1f5f9)',
8
+ border: '1px dashed var(--color-neutral-300, #cbd5e1)',
9
+ borderRadius: 8,
10
+ };
11
+
12
+ /**
13
+ * Template de démonstration pour le composant Group.
14
+ * @returns {JSX.Element} La page de démo des groupes.
15
+ */
16
+ export const Groups = () => {
17
+ const positions = [
18
+ 'top-left', 'top-center', 'top-right',
19
+ 'center-left', 'center', 'center-right',
20
+ 'bottom-left', 'bottom-center', 'bottom-right',
21
+ ] as const;
22
+
23
+
24
+ return (
25
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '2.5rem' }}>
26
+
27
+ {/* Direction */}
28
+ <section>
29
+ <h3>Direction</h3>
30
+ <Group gap="lg">
31
+ <div>
32
+ <p style={{ marginBottom: '0.5rem', fontWeight: 600 }}>Horizontal (défaut)</p>
33
+ <Group>
34
+ <Button>•</Button>
35
+ <Button>•</Button>
36
+ <Button>•</Button>
37
+ </Group>
38
+ </div>
39
+ <div>
40
+ <p style={{ marginBottom: '0.5rem', fontWeight: 600 }}>Vertical</p>
41
+ <Group vertical>
42
+ <Button>•</Button>
43
+ <Button>•</Button>
44
+ <Button>•</Button>
45
+ </Group>
46
+ </div>
47
+ </Group>
48
+ </section>
49
+
50
+
51
+ {/* Align (axe principal) */}
52
+ <section>
53
+ <h3>Alignement (align)</h3>
54
+ <Group vertical gap="md">
55
+ {(['start', 'center', 'end', 'between'] as const).map((a) => (
56
+ <div key={a} style={{ width: '100%' }}>
57
+ <p style={{ marginBottom: '0.25rem', fontSize: '0.8rem', opacity: 0.6 }}>align="{a}"</p>
58
+ <Group align={a} style={{ width: '100%', border: '1px dashed var(--color-neutral-300, #cbd5e1)', padding: '0.5rem', borderRadius: 6 }}>
59
+ <Button size="sm">•</Button>
60
+ <Button size="sm">•</Button>
61
+ <Button size="sm">•</Button>
62
+ </Group>
63
+ </div>
64
+ ))}
65
+ </Group>
66
+ </section>
67
+
68
+ {/* Position */}
69
+ <section>
70
+ <h3>Position (flexbox)</h3>
71
+ <Group gap="md" style={{ flexWrap: 'wrap' }}>
72
+ {positions.map((pos) => (
73
+ <div key={pos} style={{ display: 'flex', flexDirection: 'column', gap: '0.25rem' }}>
74
+ <p style={{ fontSize: '0.75rem', opacity: 0.6, textAlign: 'center' }}>{pos}</p>
75
+ <Group align={pos} style={BOX_STYLE}>
76
+ <Button size="sm">•</Button>
77
+ </Group>
78
+ </div>
79
+ ))}
80
+ </Group>
81
+ </section>
82
+
83
+ </div>
84
+ );
85
+ };
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import { Slider, SliderItem, Card, Button } from '../../index';
3
2
 
4
3
  /**
@@ -92,6 +92,15 @@ export const Tables = () => {
92
92
  <h5 className='mt-5'>Sélection Multi-lignes</h5>
93
93
  <Table rowData={dataSimple} columnDefs={columnsSimple} selectable={true} />
94
94
 
95
+ <h5 className='mt-5'>Sélection Désactivée (isRowSelectable)</h5>
96
+ <p className="text-muted mb-4">Exemple avec des lignes spécifiques non sélectionnables (ici, seuls les ID impairs sont sélectionnables).</p>
97
+ <Table
98
+ rowData={dataSimple}
99
+ columnDefs={columnsSimple}
100
+ selectable={true}
101
+ isRowSelectable={(node) => node.data ? node.data.id % 2 !== 0 : false}
102
+ />
103
+
95
104
  <h5 className='mt-5'>Avancé : Actions, Pagination et Redimensionnement</h5>
96
105
  <Table rowData={dataAdvanced} columnDefs={columnsAdvanced} selectable={true} resizable={true} pagination />
97
106
 
@@ -27,3 +27,4 @@ export * from './Loaders/Loaders';
27
27
  export * from './Grids/Grids';
28
28
  export * from './Sliders/Sliders';
29
29
  export * from './Cards/Cards';
30
+ export * from './Groups/Groups';
@@ -27,3 +27,4 @@ export * from './Loaders/Loaders';
27
27
  export * from './Grids/Grids';
28
28
  export * from './Sliders/Sliders';
29
29
  export * from './Cards/Cards';
30
+ export * from './Groups/Groups';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zuii",
3
- "version": "1.4.18",
3
+ "version": "1.4.19",
4
4
  "description": "Bibliothèque de composants UI légère, intuitive et modulaire pour les interfaces web modernes.",
5
5
  "type": "module",
6
6
  "repository": {