@uva-glass/component-library 3.55.9 → 3.56.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 (43) hide show
  1. package/dist/DataTable-C46IkAmF.js +154 -0
  2. package/dist/DataTable-C46IkAmF.js.map +1 -0
  3. package/dist/assets/DataTable.css +1 -0
  4. package/dist/components/Accordion/Accordion.test.js +1 -1
  5. package/dist/components/AccordionCard/AccordionCard.test.js +1 -1
  6. package/dist/components/ActionList/ActionList.test.js +1 -1
  7. package/dist/components/AppStatusBar/AppStatusBar.test.js +1 -1
  8. package/dist/components/Attention/Attention.test.js +1 -1
  9. package/dist/components/Backdrop/Backdrop.test.js +1 -1
  10. package/dist/components/Buttons/Button.test.js +1 -1
  11. package/dist/components/Buttons/LinkButton.test.js +1 -1
  12. package/dist/components/Buttons/MenuButton.test.js +1 -1
  13. package/dist/components/Card/Card.test.js +1 -1
  14. package/dist/components/Checkbox/Checkbox.test.js +1 -1
  15. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js +1 -1
  16. package/dist/components/DataTable/DataTable.d.ts +39 -0
  17. package/dist/components/DataTable/DataTable.js +2 -0
  18. package/dist/components/DataTable/DataTable.stories.d.ts +26 -0
  19. package/dist/components/DataTable/DataTable.stories.js +40349 -0
  20. package/dist/components/DataTable/DataTable.stories.js.map +1 -0
  21. package/dist/components/DataTable/hooks/useVirtualScroll.d.ts +14 -0
  22. package/dist/components/DataTable/hooks/useVirtualScroll.js +35 -0
  23. package/dist/components/DataTable/hooks/useVirtualScroll.js.map +1 -0
  24. package/dist/components/DataTable/index.d.ts +1 -0
  25. package/dist/components/DataTable/index.js +2 -0
  26. package/dist/components/DataTable/mockDataTableData.d.ts +39 -0
  27. package/dist/components/FeedbackBar/FeedbackBar.test.js +1 -1
  28. package/dist/components/Label/Label.test.js +1 -1
  29. package/dist/components/MultiSelectBox/MultiSelectBox.test.js +1 -1
  30. package/dist/components/Notification/Notification.test.js +1 -1
  31. package/dist/components/RadioGroup/Radiogroup.test.js +1 -1
  32. package/dist/components/StatusBadge/StatusBadge.test.js +1 -1
  33. package/dist/components/TextArea/TextArea.test.js +1 -1
  34. package/dist/components/VarIndicator/VarIndicator.test.js +1 -1
  35. package/dist/components/index.d.ts +1 -0
  36. package/dist/components/index.js +43 -42
  37. package/dist/{dist-Cxk2-lJw.js → dist-Dlg0QxSO.js} +413 -193
  38. package/dist/dist-Dlg0QxSO.js.map +1 -0
  39. package/dist/index.js +43 -42
  40. package/dist/setupTests.js +9 -5
  41. package/dist/setupTests.js.map +1 -1
  42. package/package.json +1 -1
  43. package/dist/dist-Cxk2-lJw.js.map +0 -1
@@ -0,0 +1,14 @@
1
+ import { UIEvent } from 'react';
2
+ interface UseVirtualScrollProps {
3
+ rowHeight: number;
4
+ buffer?: number;
5
+ totalItems: number;
6
+ }
7
+ export declare function useVirtualScroll({ rowHeight, buffer, totalItems }: UseVirtualScrollProps): {
8
+ visibleItems: number[];
9
+ totalHeight: number;
10
+ offsetTop: number;
11
+ onScroll: (event: UIEvent<HTMLElement>) => void;
12
+ setContainerHeight: import('react').Dispatch<import('react').SetStateAction<number>>;
13
+ };
14
+ export {};
@@ -0,0 +1,35 @@
1
+ import { useCallback as e, useMemo as t, useState as n } from "react";
2
+ //#region src/components/DataTable/hooks/useVirtualScroll.tsx
3
+ var r = 2;
4
+ function i({ rowHeight: i, buffer: a = r, totalItems: o }) {
5
+ let [s, c] = n(0), [l, u] = n(0), { startIndex: d, endIndex: f } = t(() => {
6
+ if (i <= 0) return {
7
+ startIndex: 0,
8
+ endIndex: o - 1
9
+ };
10
+ let e = Math.ceil(l / i), t = Math.max(0, Math.floor(s / i) - a);
11
+ return {
12
+ startIndex: t,
13
+ endIndex: Math.min(o - 1, t + e + a * r)
14
+ };
15
+ }, [
16
+ s,
17
+ i,
18
+ o,
19
+ l,
20
+ a
21
+ ]), p = o * i, m = d * i;
22
+ return {
23
+ visibleItems: t(() => Array.from({ length: f - d + 1 }, (e, t) => d + t), [d, f]),
24
+ totalHeight: p,
25
+ offsetTop: m,
26
+ onScroll: e((e) => {
27
+ c(e.currentTarget.scrollTop);
28
+ }, []),
29
+ setContainerHeight: u
30
+ };
31
+ }
32
+ //#endregion
33
+ export { i as useVirtualScroll };
34
+
35
+ //# sourceMappingURL=useVirtualScroll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useVirtualScroll.js","names":[],"sources":["../../../../src/components/DataTable/hooks/useVirtualScroll.tsx"],"sourcesContent":["import { useState, useMemo, useCallback } from 'react';\r\n\r\nimport type { UIEvent } from 'react';\r\n\r\nconst DOUBLE = 2;\r\n\r\ninterface UseVirtualScrollProps {\r\n rowHeight: number;\r\n buffer?: number;\r\n totalItems: number;\r\n}\r\n\r\nexport function useVirtualScroll({ rowHeight, buffer = DOUBLE, totalItems }: UseVirtualScrollProps) {\r\n const [scrollTop, setScrollTop] = useState(0);\r\n const [containerHeight, setContainerHeight] = useState(0);\r\n\r\n const { startIndex, endIndex } = useMemo(() => {\r\n if (rowHeight <= 0) {\r\n return { startIndex: 0, endIndex: totalItems - 1 };\r\n }\r\n\r\n const visibleItemsCount = Math.ceil(containerHeight / rowHeight);\r\n const start = Math.max(0, Math.floor(scrollTop / rowHeight) - buffer);\r\n const end = Math.min(totalItems - 1, start + visibleItemsCount + buffer * DOUBLE);\r\n return { startIndex: start, endIndex: end };\r\n }, [scrollTop, rowHeight, totalItems, containerHeight, buffer]);\r\n\r\n const totalHeight = totalItems * rowHeight;\r\n\r\n const offsetTop = startIndex * rowHeight;\r\n\r\n const visibleItems = useMemo(\r\n () => Array.from({ length: endIndex - startIndex + 1 }, (_, counter) => startIndex + counter),\r\n [startIndex, endIndex]\r\n );\r\n\r\n const onScroll = useCallback((event: UIEvent<HTMLElement>) => {\r\n setScrollTop(event.currentTarget.scrollTop);\r\n }, []);\r\n\r\n return {\r\n visibleItems,\r\n totalHeight,\r\n offsetTop,\r\n onScroll,\r\n setContainerHeight,\r\n };\r\n}\r\n"],"mappings":";;AAIA,IAAM,IAAS;AAQf,SAAgB,EAAiB,EAAE,cAAW,YAAS,GAAQ,iBAAqC;CAClG,IAAM,CAAC,GAAW,KAAgB,EAAS,CAAC,GACtC,CAAC,GAAiB,KAAsB,EAAS,CAAC,GAElD,EAAE,eAAY,gBAAa,QAAc;EAC7C,IAAI,KAAa,GACf,OAAO;GAAE,YAAY;GAAG,UAAU,IAAa;EAAE;EAGnD,IAAM,IAAoB,KAAK,KAAK,IAAkB,CAAS,GACzD,IAAQ,KAAK,IAAI,GAAG,KAAK,MAAM,IAAY,CAAS,IAAI,CAAM;EAEpE,OAAO;GAAE,YAAY;GAAO,UADhB,KAAK,IAAI,IAAa,GAAG,IAAQ,IAAoB,IAAS,CACpC;EAAI;CAC5C,GAAG;EAAC;EAAW;EAAW;EAAY;EAAiB;CAAM,CAAC,GAExD,IAAc,IAAa,GAE3B,IAAY,IAAa;CAW/B,OAAO;EACL,cAVmB,QACb,MAAM,KAAK,EAAE,QAAQ,IAAW,IAAa,EAAE,IAAI,GAAG,MAAY,IAAa,CAAO,GAC5F,CAAC,GAAY,CAAQ,CAQrB;EACA;EACA;EACA,UARe,GAAa,MAAgC;GAC5D,EAAa,EAAM,cAAc,SAAS;EAC5C,GAAG,CAAC,CAMF;EACA;CACF;AACF"}
@@ -0,0 +1 @@
1
+ export * from './DataTable';
@@ -0,0 +1,2 @@
1
+ import { t as e } from "../../DataTable-C46IkAmF.js";
2
+ export { e as DataTable };
@@ -0,0 +1,39 @@
1
+ export const MOCK_DATA: ({
2
+ id: string;
3
+ first_name: string;
4
+ last_name: string;
5
+ email: string;
6
+ street: string;
7
+ street_number: string;
8
+ zipcode: string;
9
+ city: string;
10
+ country: string;
11
+ country_code: string;
12
+ trade: string;
13
+ language: string;
14
+ birthdate: string;
15
+ quote: string;
16
+ university: string;
17
+ appname: string;
18
+ appversion: string;
19
+ website: string;
20
+ } | {
21
+ id: string;
22
+ first_name: string;
23
+ last_name: string;
24
+ email: string;
25
+ street: string;
26
+ street_number: string;
27
+ zipcode: null;
28
+ city: string;
29
+ country: string;
30
+ country_code: string;
31
+ trade: string;
32
+ language: string;
33
+ birthdate: string;
34
+ quote: string;
35
+ university: string;
36
+ appname: string;
37
+ appversion: string;
38
+ website: string;
39
+ })[];
@@ -1,4 +1,4 @@
1
- import "../../dist-Cxk2-lJw.js";
1
+ import "../../dist-Dlg0QxSO.js";
2
2
  import { t as e } from "../../FeedbackBar-DRbJVniP.js";
3
3
  import { i as t, n, t as r } from "../../react.esm-GvSawg5E.js";
4
4
  import { jsx as i } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import "../../dist-Cxk2-lJw.js";
1
+ import "../../dist-Dlg0QxSO.js";
2
2
  import { t as e } from "../../Label-D0ACrYG3.js";
3
3
  import { i as t, n } from "../../react.esm-GvSawg5E.js";
4
4
  import { jsx as r } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import "../../dist-Cxk2-lJw.js";
1
+ import "../../dist-Dlg0QxSO.js";
2
2
  import { t as e } from "../../MultiSelectBox-BmBxa6PH.js";
3
3
  import { i as t, n, t as r } from "../../react.esm-GvSawg5E.js";
4
4
  import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import "../../dist-Cxk2-lJw.js";
1
+ import "../../dist-Dlg0QxSO.js";
2
2
  import { t as e } from "../../Notification-BAqCenxt.js";
3
3
  import { i as t, n } from "../../react.esm-GvSawg5E.js";
4
4
  import { jsx as r } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import "../../dist-Cxk2-lJw.js";
1
+ import "../../dist-Dlg0QxSO.js";
2
2
  import { t as e } from "../../RadioGroup-DhnnBRJu.js";
3
3
  import { i as t, n, t as r } from "../../react.esm-GvSawg5E.js";
4
4
  import { jsx as i } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import "../../dist-Cxk2-lJw.js";
1
+ import "../../dist-Dlg0QxSO.js";
2
2
  import { t as e } from "../../StatusBage-CfEIuIPa.js";
3
3
  import { i as t, n } from "../../react.esm-GvSawg5E.js";
4
4
  import { jsx as r } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import "../../dist-Cxk2-lJw.js";
1
+ import "../../dist-Dlg0QxSO.js";
2
2
  import { t as e } from "../../TextArea-GR2ZWwLh.js";
3
3
  import { i as t, n, t as r } from "../../react.esm-GvSawg5E.js";
4
4
  import { t as i } from "../../esm-BJhEQquH.js";
@@ -1,4 +1,4 @@
1
- import "../../dist-Cxk2-lJw.js";
1
+ import "../../dist-Dlg0QxSO.js";
2
2
  import { t as e } from "../../VarIndicator-DoMWwSUm.js";
3
3
  import { a as t, i as n, n as r } from "../../react.esm-GvSawg5E.js";
4
4
  import { t as i } from "../../esm-BJhEQquH.js";
@@ -13,6 +13,7 @@ export * from './CheckboxTree';
13
13
  export * from './Chip';
14
14
  export * from './ControlsButton';
15
15
  export * from './CopyableText';
16
+ export * from './DataTable';
16
17
  export * from './Drawer';
17
18
  export * from './EmptyStateDataDisplay';
18
19
  export * from './ExpandableInfoPanel';
@@ -19,45 +19,46 @@ import { t as _ } from "../ControlsButton-9uR_zW_F.js";
19
19
  import { d as v, f as y, h as b, m as x, n as S, t as C, u as w } from "../components-D6_Sx8Hs.js";
20
20
  import { t as T } from "../Chip-9XnXFhoJ.js";
21
21
  import { t as E } from "../CopyableText-hSqhyUWx.js";
22
- import { t as D } from "../Drawer-BbVJqFQI.js";
23
- import { t as O } from "../OverlayCloseButton-j-7mC4Zz.js";
24
- import { t as k } from "../EmptyStateDataDisplay-IT2P3ius.js";
25
- import { t as A } from "../ExpandableInfoPanel-DMfcJFP3.js";
26
- import { t as j } from "../FeedbackBar-DRbJVniP.js";
27
- import { t as M } from "../Repeater-Bnoqqz0X.js";
28
- import { t as N } from "../FieldHint-FEBzgLI_.js";
29
- import { t as P } from "../Spinner-BmPjd2Bv.js";
30
- import { t as F } from "../Fieldset-D01_rj_p.js";
31
- import { t as I } from "../FormField-CcV84TfI.js";
32
- import { GridRow as L } from "./GridRow/GridRow.js";
33
- import { t as R } from "../HorizontalList-CLlRGWZX.js";
34
- import { t as z } from "../IconButton-CSNMVEG1.js";
35
- import { t as B } from "../InfoBanner-DqBWtCVE.js";
36
- import { t as V } from "../InfoMessage-COywXu4O.js";
37
- import { t as H } from "../Input-BzKvzbzP.js";
38
- import { t as U } from "../InputField-T01uazlI.js";
39
- import { t as W } from "../MenuLink-La_3ANEL.js";
40
- import { t as G } from "../MetaDataBar-48J7yPrb.js";
41
- import { t as K } from "../MetaDataList-Co9WCexh.js";
42
- import { t as q } from "../ModalDialog-J7xcPcnS.js";
43
- import { t as J } from "../MultiSelectBox-BmBxa6PH.js";
44
- import { t as Y } from "../Notification-BAqCenxt.js";
45
- import { t as X } from "../OverlayStepBar-Cj_-0waE.js";
46
- import { t as Z } from "../PageOverlay-DqwdG5ve.js";
47
- import { t as Q } from "../Periods-C5cxLlWt.js";
48
- import { t as $ } from "../ProgrammeCard-CAAOSWKa.js";
49
- import { t as ee } from "../RadioButton-CKALsbBb.js";
50
- import { t as te } from "../RadioGroup-DhnnBRJu.js";
51
- import { SearchField as ne } from "./SearchField/SearchField.js";
52
- import { SelectProvider as re, useSelect as ie } from "./SelectListbox/SelectProvider.js";
53
- import { SelectListbox as ae } from "./SelectListbox/SelectListbox.js";
54
- import { t as oe } from "../Slider-dCmT0VM2.js";
55
- import { Sortable as se } from "./Sortable/Sortable.js";
56
- import { t as ce } from "../StatusBage-CfEIuIPa.js";
57
- import { t as le } from "../StatusPill-CbJV4t-V.js";
58
- import { t as ue } from "../TextArea-GR2ZWwLh.js";
59
- import { t as de } from "../ToggleSwitch-b54K58vY.js";
60
- import { t as fe } from "../Tooltip-DvkGwn4j.js";
61
- import { t as pe } from "../VarIndicator-DoMWwSUm.js";
62
- import { WeekSelector as me } from "./WeekSelector/WeekSelector.js";
63
- export { e as Accordion, n as AccordionCard, r as ActionList, s as AppStatusBar, c as Attention, l as Backdrop, i as Button, u as ButtonGroup, d as Card, p as Checkbox, m as CheckboxButtonBar, b as CheckboxTree, T as Chip, _ as ControlsButton, E as CopyableText, D as Drawer, k as EmptyStateDataDisplay, A as ExpandableInfoPanel, j as FeedbackBar, g as FeedbackBox, N as FieldHint, F as Fieldset, I as FormField, x as FormInput, L as GridRow, R as HorizontalList, t as Icon, z as IconButton, B as InfoBanner, V as InfoMessage, H as Input, U as InputField, h as Label, a as LinkButton, o as MenuButton, W as MenuLink, G as MetaDataBar, K as MetaDataList, q as ModalDialog, y as MultiSelect, J as MultiSelectBox, Y as Notification, O as OverlayCloseButton, X as OverlayStepBar, Z as PageOverlay, v as PeriodSelector, Q as Periods, $ as ProgrammeCard, ee as RadioButton, te as RadioGroup, w as RadioTabSelector, M as Repeater, C as Rte, S as RteEditor, ne as SearchField, f as SectionNotification, ae as SelectListbox, re as SelectProvider, oe as Slider, se as Sortable, P as Spinner, ce as StatusBadge, le as StatusPill, ue as TextArea, de as ToggleSwitch, fe as Tooltip, pe as VarIndicator, me as WeekSelector, ie as useSelect };
22
+ import { t as D } from "../DataTable-C46IkAmF.js";
23
+ import { t as O } from "../Drawer-BbVJqFQI.js";
24
+ import { t as k } from "../OverlayCloseButton-j-7mC4Zz.js";
25
+ import { t as A } from "../EmptyStateDataDisplay-IT2P3ius.js";
26
+ import { t as j } from "../ExpandableInfoPanel-DMfcJFP3.js";
27
+ import { t as M } from "../FeedbackBar-DRbJVniP.js";
28
+ import { t as N } from "../Repeater-Bnoqqz0X.js";
29
+ import { t as P } from "../FieldHint-FEBzgLI_.js";
30
+ import { t as F } from "../Spinner-BmPjd2Bv.js";
31
+ import { t as I } from "../Fieldset-D01_rj_p.js";
32
+ import { t as L } from "../FormField-CcV84TfI.js";
33
+ import { GridRow as R } from "./GridRow/GridRow.js";
34
+ import { t as z } from "../HorizontalList-CLlRGWZX.js";
35
+ import { t as B } from "../IconButton-CSNMVEG1.js";
36
+ import { t as V } from "../InfoBanner-DqBWtCVE.js";
37
+ import { t as H } from "../InfoMessage-COywXu4O.js";
38
+ import { t as U } from "../Input-BzKvzbzP.js";
39
+ import { t as W } from "../InputField-T01uazlI.js";
40
+ import { t as G } from "../MenuLink-La_3ANEL.js";
41
+ import { t as K } from "../MetaDataBar-48J7yPrb.js";
42
+ import { t as q } from "../MetaDataList-Co9WCexh.js";
43
+ import { t as J } from "../ModalDialog-J7xcPcnS.js";
44
+ import { t as Y } from "../MultiSelectBox-BmBxa6PH.js";
45
+ import { t as X } from "../Notification-BAqCenxt.js";
46
+ import { t as Z } from "../OverlayStepBar-Cj_-0waE.js";
47
+ import { t as Q } from "../PageOverlay-DqwdG5ve.js";
48
+ import { t as $ } from "../Periods-C5cxLlWt.js";
49
+ import { t as ee } from "../ProgrammeCard-CAAOSWKa.js";
50
+ import { t as te } from "../RadioButton-CKALsbBb.js";
51
+ import { t as ne } from "../RadioGroup-DhnnBRJu.js";
52
+ import { SearchField as re } from "./SearchField/SearchField.js";
53
+ import { SelectProvider as ie, useSelect as ae } from "./SelectListbox/SelectProvider.js";
54
+ import { SelectListbox as oe } from "./SelectListbox/SelectListbox.js";
55
+ import { t as se } from "../Slider-dCmT0VM2.js";
56
+ import { Sortable as ce } from "./Sortable/Sortable.js";
57
+ import { t as le } from "../StatusBage-CfEIuIPa.js";
58
+ import { t as ue } from "../StatusPill-CbJV4t-V.js";
59
+ import { t as de } from "../TextArea-GR2ZWwLh.js";
60
+ import { t as fe } from "../ToggleSwitch-b54K58vY.js";
61
+ import { t as pe } from "../Tooltip-DvkGwn4j.js";
62
+ import { t as me } from "../VarIndicator-DoMWwSUm.js";
63
+ import { WeekSelector as he } from "./WeekSelector/WeekSelector.js";
64
+ export { e as Accordion, n as AccordionCard, r as ActionList, s as AppStatusBar, c as Attention, l as Backdrop, i as Button, u as ButtonGroup, d as Card, p as Checkbox, m as CheckboxButtonBar, b as CheckboxTree, T as Chip, _ as ControlsButton, E as CopyableText, D as DataTable, O as Drawer, A as EmptyStateDataDisplay, j as ExpandableInfoPanel, M as FeedbackBar, g as FeedbackBox, P as FieldHint, I as Fieldset, L as FormField, x as FormInput, R as GridRow, z as HorizontalList, t as Icon, B as IconButton, V as InfoBanner, H as InfoMessage, U as Input, W as InputField, h as Label, a as LinkButton, o as MenuButton, G as MenuLink, K as MetaDataBar, q as MetaDataList, J as ModalDialog, y as MultiSelect, Y as MultiSelectBox, X as Notification, k as OverlayCloseButton, Z as OverlayStepBar, Q as PageOverlay, v as PeriodSelector, $ as Periods, ee as ProgrammeCard, te as RadioButton, ne as RadioGroup, w as RadioTabSelector, N as Repeater, C as Rte, S as RteEditor, re as SearchField, f as SectionNotification, oe as SelectListbox, ie as SelectProvider, se as Slider, ce as Sortable, F as Spinner, le as StatusBadge, ue as StatusPill, de as TextArea, fe as ToggleSwitch, pe as Tooltip, me as VarIndicator, he as WeekSelector, ae as useSelect };