@inceptionbg/iui 2.0.11 → 2.0.13

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 (113) hide show
  1. package/dist/icons/index.d.ts +5 -1
  2. package/dist/icons/index.js +1 -1
  3. package/dist/index.d.ts +174 -79
  4. package/dist/index.js +1 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/iui.css +1 -1
  7. package/package.json +1 -1
  8. package/rollup.config.js +1 -5
  9. package/src/assets/icons/duotone/faCircleUser.ts +6 -6
  10. package/src/assets/icons/index.ts +2 -0
  11. package/src/assets/icons/light/faArrowDownShortWide.ts +1 -1
  12. package/src/assets/icons/light/faArrowDownWideShort.ts +1 -1
  13. package/src/assets/icons/light/faArrowUpArrowDown.ts +5 -5
  14. package/src/assets/icons/light/faArrowUpRightFromSquare.ts +1 -1
  15. package/src/assets/icons/light/faArrowsToLine.ts +1 -1
  16. package/src/assets/icons/light/faArrowsUpDown.ts +1 -1
  17. package/src/assets/icons/light/faBookmark.ts +15 -0
  18. package/src/assets/icons/light/faBookmarkSlash.ts +15 -0
  19. package/src/assets/icons/light/faCalendarPlus.ts +5 -5
  20. package/src/assets/icons/light/faCheck.ts +1 -1
  21. package/src/assets/icons/light/faChevronDown.ts +5 -5
  22. package/src/assets/icons/light/faChevronRight.ts +5 -5
  23. package/src/assets/icons/light/faCircleInfo.ts +5 -5
  24. package/src/assets/icons/light/faCircleXmark.ts +5 -5
  25. package/src/assets/icons/light/faClipboardCheck.ts +5 -5
  26. package/src/assets/icons/light/faClockRotateLeft.ts +1 -1
  27. package/src/assets/icons/light/faEllipsisVertical.ts +1 -1
  28. package/src/assets/icons/light/faEye.ts +5 -5
  29. package/src/assets/icons/light/faEyeSlash.ts +5 -5
  30. package/src/assets/icons/light/faFilter.ts +5 -5
  31. package/src/assets/icons/light/faGear.ts +1 -1
  32. package/src/assets/icons/light/faHouse.ts +5 -5
  33. package/src/assets/icons/light/faIdBadge.ts +5 -5
  34. package/src/assets/icons/light/faLineColumns.ts +5 -5
  35. package/src/assets/icons/light/faLink.ts +1 -1
  36. package/src/assets/icons/light/faMagnifyingGlass.ts +5 -5
  37. package/src/assets/icons/light/faPen.ts +5 -5
  38. package/src/assets/icons/light/faPrint.ts +5 -5
  39. package/src/assets/icons/light/faQuestion.ts +5 -5
  40. package/src/assets/icons/light/faRotateRight.ts +5 -5
  41. package/src/assets/icons/light/faTrashCan.ts +5 -5
  42. package/src/assets/icons/light/faTriangleExclamation.ts +5 -5
  43. package/src/assets/icons/light/faXmark.ts +1 -1
  44. package/src/assets/icons/regular/faArrowLeft.ts +6 -6
  45. package/src/assets/icons/regular/faArrowRightArrowLeft.ts +1 -1
  46. package/src/assets/icons/regular/faCircleCheck.ts +1 -1
  47. package/src/assets/icons/regular/faCircleExclamation.ts +1 -1
  48. package/src/assets/icons/regular/faCircleInfo.ts +1 -1
  49. package/src/assets/icons/regular/faFileArrowDown.ts +1 -1
  50. package/src/assets/icons/regular/faFilterCircleXmark.ts +1 -1
  51. package/src/assets/icons/regular/faTriangleExclamation.ts +1 -1
  52. package/src/assets/icons/solid/faAngleLeft.ts +1 -1
  53. package/src/assets/icons/solid/faAngleRight.ts +1 -1
  54. package/src/assets/icons/solid/faArrowDownWideShort.ts +1 -1
  55. package/src/assets/icons/solid/faCaretDown.ts +1 -1
  56. package/src/assets/icons/solid/faCheck.ts +5 -5
  57. package/src/assets/icons/solid/faEllipsisVertical.ts +1 -1
  58. package/src/assets/icons/solid/faFilter.ts +1 -1
  59. package/src/assets/icons/solid/faFloppyDisk.ts +1 -1
  60. package/src/assets/icons/solid/faGripDotsVertical.ts +1 -1
  61. package/src/assets/icons/solid/faListUl.ts +1 -1
  62. package/src/assets/icons/solid/faMinus.ts +6 -6
  63. package/src/assets/icons/solid/faPlus.ts +6 -6
  64. package/src/assets/icons/solid/faPrint.ts +1 -1
  65. package/src/assets/icons/solid/faRotateRight.ts +1 -1
  66. package/src/assets/icons/solid/faXmark.ts +1 -1
  67. package/src/components/Button/Button.tsx +2 -2
  68. package/src/components/Button/IconButton.tsx +1 -1
  69. package/src/components/Button/SplitButton.tsx +91 -0
  70. package/src/components/Dashboard/FastLinksWidget/FastLinksWidget.tsx +1 -1
  71. package/src/components/Dialog/components/DialogFooter.tsx +6 -2
  72. package/src/components/Header/Components/ModuleSelect.tsx +14 -6
  73. package/src/components/Inputs/InputWrapper.tsx +1 -1
  74. package/src/components/Inputs/TextInput.tsx +1 -1
  75. package/src/components/List/List.tsx +18 -0
  76. package/src/components/List/ListItem.tsx +24 -0
  77. package/src/components/Loader/ProgressBar.tsx +41 -0
  78. package/src/components/Menu/Menu.tsx +0 -3
  79. package/src/components/Menu/MenuItem.tsx +21 -23
  80. package/src/components/Menu/NewMenu.tsx +0 -3
  81. package/src/components/Pullover/Pullover.tsx +15 -6
  82. package/src/components/Sidebar/types/ISidebar.ts +1 -1
  83. package/src/components/Table/Table.tsx +18 -11
  84. package/src/components/Table/components/filters/TableFilters.tsx +3 -6
  85. package/src/components/Table/components/footer/TableFooter.tsx +6 -10
  86. package/src/components/Table/components/header/TableHeader.tsx +22 -24
  87. package/src/components/Table/components/header/TableHeaderRow.tsx +16 -7
  88. package/{idea/Table/Components/Print → src/components/Table/components/print}/TablePrint.tsx +89 -96
  89. package/src/components/Table/components/sort/TableSort.tsx +21 -1
  90. package/src/components/Table/components/templates/TableTemplates.tsx +98 -0
  91. package/src/components/Table/components/templates/components/CreateTemplateDialog.tsx +41 -0
  92. package/src/components/Table/hooks/useTablePrint.ts +75 -0
  93. package/src/index.ts +10 -0
  94. package/src/styles/App.scss +3 -0
  95. package/src/styles/common/_animations.scss +8 -14
  96. package/src/styles/common/helpers/_base.scss +0 -4
  97. package/src/styles/common/maps/_buttonMaps.scss +42 -0
  98. package/src/styles/components/_button.scss +11 -50
  99. package/src/styles/components/_buttonSplit.scss +90 -0
  100. package/src/styles/components/_header.scss +21 -9
  101. package/src/styles/components/_list.scss +41 -0
  102. package/src/styles/components/_loader.scss +3 -1
  103. package/src/styles/components/_menu.scss +19 -18
  104. package/src/styles/components/_print.scss +36 -46
  105. package/src/styles/components/_progressBar.scss +83 -0
  106. package/src/styles/components/_table.scss +17 -23
  107. package/src/styles/variables/_variables.scss +1 -0
  108. package/src/types/ITable.ts +42 -32
  109. package/src/utils/i18n/i18nIUICyrilic.ts +3 -2
  110. package/src/utils/i18n/i18nIUILatin.ts +18 -12
  111. package/src/utils/i18n/i18nIUIMe.ts +3 -2
  112. package/src/utils/icons.ts +1 -1
  113. package/tsconfig.json +2 -0
@@ -1,77 +1,84 @@
1
- import { FC, useEffect, useState } from 'react';
2
- import { createPortal } from 'react-dom';
3
- import { faFileArrowDown } from '../../../../assets/icons/regular/faFileArrowDown';
4
- import { faPrint } from '../../../../assets/icons/solid/faPrint';
5
- import { faXmark } from '../../../../assets/icons/solid/faXmark';
6
- import { IPrintData, ITableColumn, ITableDataItem } from '../../../../types/ITable';
7
- import { formatDate, getCurrentDateFormatted } from '../../../../utils/dateUtils';
8
- import { Button } from '../../../Button/Button';
9
- import { FullScreenLoader } from '../../../Loader/Loader';
1
+ import { useEffect, useMemo, type FC } from 'react';
2
+ import { IconButton } from '../../../Button/IconButton';
3
+ import { faPrint } from '../../../../assets/icons';
10
4
  import { useTranslation } from 'react-i18next';
11
- import { rootDir } from '../../../../utils/rootDir';
12
- import clsx from 'clsx';
13
- import { HeaderTable } from '../Header/TableHeader';
5
+ import { Pullover } from '../../../Pullover/Pullover';
6
+ import { useTableContext } from '../../contexts/TableContext';
7
+ import { IPrintData } from '../../../../types/ITable';
14
8
  import { useHideZendesk } from '../../../../hooks/useZendesk';
9
+ import { formatDate, getCurrentDateFormatted } from '../../../../utils/dateUtils';
10
+ import { HeaderTable } from '../header/TableHeader';
11
+ import clsx from 'clsx';
12
+ import { faFileArrowDown } from '../../../../assets/icons/regular/faFileArrowDown';
13
+ import { ProgressBar } from '../../../Loader/ProgressBar';
15
14
 
16
- interface Props extends IPrintData {
17
- isOpen: boolean;
18
- onClose: () => void;
19
- columns: ITableColumn[];
20
- excludeColumnIds?: string[];
21
- }
22
- export const TablePrint: FC<Props> = ({
23
- isOpen,
24
- onClose,
25
- columns,
26
- excludeColumnIds = [],
27
- customHeader,
28
- organization,
29
- filters,
30
- label,
31
- optionalNode,
32
- getPrintData,
33
- formatPrintData,
34
- saveXlsx,
35
- totals,
36
- }) => {
37
- const [data, setData] = useState<ITableDataItem[]>([]);
38
- const [offset, setOffset] = useState(0);
39
- const [isLoading, setIsLoading] = useState(false);
40
-
15
+ export const TablePrint: FC = () => {
41
16
  const { t } = useTranslation();
42
17
  useHideZendesk();
18
+ const { columns, printData } = useTableContext();
19
+
20
+ const {
21
+ label,
22
+ tableData: data,
23
+ isLoading,
24
+ progress,
25
+ paginationControl,
26
+ printPopupControl,
27
+ customHeader,
28
+ excludeColumnIds,
29
+ filters,
30
+ optionalNode,
31
+ organization,
32
+ saveXlsx,
33
+ totals,
34
+ } = useMemo(() => (printData ?? {}) as IPrintData, [printData]);
35
+ const { control, onOpen } = printPopupControl;
43
36
 
44
- const cols = columns.filter(
45
- e => !['actions', 'select', ...excludeColumnIds].includes(e.id)
37
+ const cols = useMemo(
38
+ () => columns.filter(e => !['actions', 'select', excludeColumnIds].includes(e.id)),
39
+ [columns, excludeColumnIds]
46
40
  );
47
41
 
48
42
  useEffect(() => {
49
- rootDir?.classList.add('hidden');
50
- return () => {
51
- rootDir?.classList.remove('hidden');
52
- };
53
- }, []);
43
+ if (control.isOpen) {
44
+ paginationControl?.setLimit(1000);
45
+ paginationControl?.setOffset(0);
46
+ }
47
+ }, [paginationControl, control.isOpen]);
54
48
 
55
- useEffect(() => {
56
- setIsLoading(true);
57
- getPrintData({ limit: 1000, offset })
58
- .then(e => {
59
- setData(prevState => {
60
- const data = !!e.data.length ? formatPrintData(e.data) : [];
61
- const newState = [...prevState, ...data];
62
- e.totalRows && e.totalRows > newState.length
63
- ? setOffset(offset + 1)
64
- : setIsLoading(false);
65
- return e.totalRows && e.totalRows > prevState.length ? newState : prevState;
66
- });
67
- })
68
- .catch(() => setIsLoading(false));
69
- }, [offset, formatPrintData, getPrintData]);
49
+ return (
50
+ printData && (
51
+ <>
52
+ <IconButton
53
+ tooltip={t('PrintExport')}
54
+ icon={faPrint}
55
+ onClick={onOpen}
56
+ size="s"
57
+ variant="outlined"
58
+ />
70
59
 
71
- return isOpen
72
- ? createPortal(
73
- <div className="iui-print-dialog">
74
- <div className="content">
60
+ <Pullover
61
+ control={control}
62
+ header={{ title: t('PrintExport') }}
63
+ footer={{
64
+ confirmButton: {
65
+ label: t('Print'),
66
+ onClick: window.print,
67
+ // type: 'submit',
68
+ },
69
+ additionalButton: saveXlsx
70
+ ? {
71
+ label: t('SaveXlsx'),
72
+ icon: faFileArrowDown,
73
+ onClick: saveXlsx,
74
+ }
75
+ : undefined,
76
+ }}
77
+ contentClassName="iui-print"
78
+ size="vw100"
79
+ portalTarget={document.body}
80
+ >
81
+ <div className="print-content">
75
82
  <div className="flex justify-between">
76
83
  {organization ? (
77
84
  <div>
@@ -121,11 +128,18 @@ export const TablePrint: FC<Props> = ({
121
128
  </div>
122
129
  )}
123
130
  {optionalNode?.aboveTable}
124
- {data && (
125
- <table width="100%" className="print-table">
126
- <HeaderTable columns={cols} customHeader={customHeader} headerWrap />
127
- <tbody>
128
- <>
131
+ {isLoading ? (
132
+ <ProgressBar progress={progress} />
133
+ ) : (
134
+ data && (
135
+ <table width="100%" className="print-table">
136
+ <HeaderTable
137
+ columns={cols}
138
+ customHeader={customHeader}
139
+ headerWrap
140
+ print
141
+ />
142
+ <tbody>
129
143
  {data.map(row => {
130
144
  let totalColsSpan = 0;
131
145
  return (
@@ -173,35 +187,14 @@ export const TablePrint: FC<Props> = ({
173
187
  ))}
174
188
  </tr>
175
189
  )}
176
- </>
177
- </tbody>
178
- </table>
190
+ </tbody>
191
+ </table>
192
+ )
179
193
  )}
180
194
  {optionalNode?.bellowTable}
181
195
  </div>
182
- <div className="iui-print-actions no-print">
183
- <Button
184
- label={t('Cancel')}
185
- icon={faXmark}
186
- onClick={e => {
187
- e.stopPropagation();
188
- onClose();
189
- }}
190
- className="mr-3"
191
- />
192
- {!!saveXlsx && (
193
- <Button
194
- label={t('SaveXlsx')}
195
- icon={faFileArrowDown}
196
- onClick={() => saveXlsx()}
197
- className="mr-3"
198
- />
199
- )}
200
- <Button label={t('Print')} icon={faPrint} onClick={() => window.print()} />
201
- </div>
202
- <FullScreenLoader isLoading={isLoading} />
203
- </div>,
204
- document.body
205
- )
206
- : null;
196
+ </Pullover>
197
+ </>
198
+ )
199
+ );
207
200
  };
@@ -1,4 +1,4 @@
1
- import { useState, type FC } from 'react';
1
+ import { useEffect, useState, type FC } from 'react';
2
2
  import { Menu } from '../../../Menu/Menu';
3
3
  import { Tooltip } from '../../../Tooltip/Tooltip';
4
4
  import { IconButton } from '../../../Button/IconButton';
@@ -15,6 +15,24 @@ export const TableSort: FC = () => {
15
15
  const { sortData } = useTableContext();
16
16
  const { sort, setSort, sortOptions } = sortData ?? {};
17
17
 
18
+ useEffect(() => {
19
+ if (isOpen) {
20
+ const handleKeyDown = (event: KeyboardEvent) => {
21
+ event.stopPropagation();
22
+ if (event.key === 'Escape') {
23
+ event.preventDefault();
24
+ event.stopPropagation();
25
+ setIsOpen(false);
26
+ }
27
+ };
28
+
29
+ document.addEventListener('keydown', handleKeyDown);
30
+ return () => {
31
+ document.removeEventListener('keydown', handleKeyDown);
32
+ };
33
+ }
34
+ }, [isOpen]);
35
+
18
36
  return sortData ? (
19
37
  <Menu
20
38
  isOpen={isOpen}
@@ -39,6 +57,8 @@ export const TableSort: FC = () => {
39
57
  label: e.label,
40
58
  onClick: () => setSort?.(sort === valueDesc ? valueAsc : valueDesc),
41
59
  active: sort?.startsWith(e.value),
60
+ className: 'table-sort-item',
61
+ keepOpen: true,
42
62
  icon:
43
63
  sort === valueDesc
44
64
  ? faArrowDownWideShort
@@ -0,0 +1,98 @@
1
+ import { useState, type FC } from 'react';
2
+ import { IconButton } from '../../../Button/IconButton';
3
+ import { useTranslation } from 'react-i18next';
4
+ import { useTableContext } from '../../contexts/TableContext';
5
+ import { faBookmark, faBookmarkSlash, faXmark } from '../../../../assets/icons';
6
+ import { usePopupControl } from '../../../../hooks/usePopupControl';
7
+ import { Pullover } from '../../../Pullover/Pullover';
8
+ import { List } from '../../../List/List';
9
+ import { Dialog } from '../../../Dialog/Dialog';
10
+ import { TextInput } from '../../../Inputs/TextInput';
11
+ import { CreateTemplateDialog } from './components/CreateTemplateDialog';
12
+
13
+ export const TableTemplates: FC = () => {
14
+ const { t } = useTranslation();
15
+ const { templateData: templates } = useTableContext();
16
+ const { control, onOpen } = usePopupControl();
17
+ // const { control: dialogControl, onOpen: onDialogOpen } = usePopupControl();
18
+
19
+ const [selectedItemId, setSelectedItemId] = useState<string | null>(null);
20
+
21
+ return (
22
+ <>
23
+ <IconButton
24
+ tooltip={t('Templates')}
25
+ icon={faBookmark}
26
+ active={control.isOpen}
27
+ onClick={onOpen}
28
+ size="s"
29
+ variant="outlined"
30
+ />
31
+ <Pullover
32
+ control={control}
33
+ header={{
34
+ title: t('Templates'),
35
+ onSearch: templates?.setSearch,
36
+ }}
37
+ onContentClick={() => setSelectedItemId(null)}
38
+ footer={{
39
+ confirmButton: {
40
+ label: t('ApplyTemplate'),
41
+ type: 'submit',
42
+ splitActions: [
43
+ {
44
+ label: t('CreateTemplateLong'),
45
+ icon: faBookmark,
46
+ // onClick: onDialogOpen,
47
+ },
48
+ {
49
+ label: t('CreateDefaultTemplate'),
50
+ icon: faBookmark,
51
+ onClick: () => {
52
+ // Handle use template action
53
+ },
54
+ },
55
+ ],
56
+ },
57
+ additionalButton: selectedItemId
58
+ ? {
59
+ label: t('DeleteTemplate'),
60
+ icon: faXmark,
61
+ color: 'danger',
62
+ onClick: () => {
63
+ // Handle delete template action
64
+ },
65
+ }
66
+ : {
67
+ label: t('ResetTemplate'),
68
+ icon: faBookmarkSlash,
69
+ onClick: () => {
70
+ // setSearchData?.(defaultSearch);
71
+ // onSearch?.(defaultSearch);
72
+ // onClose();
73
+ },
74
+ // disabled: defaultSearch
75
+ // ? JSON.stringify(searchData) === JSON.stringify(defaultSearch)
76
+ // : Object.keys(searchData).length === 0,
77
+ },
78
+ }}
79
+ onCloseCallback={() => {
80
+ templates?.setSearch?.('');
81
+ setSelectedItemId(null);
82
+ }}
83
+ size="w600"
84
+ >
85
+ <List
86
+ items={templates?.items.map(item => ({
87
+ id: item.uuid,
88
+ label: item.name,
89
+ active: selectedItemId === item.uuid,
90
+ // desc: item.isPublic ? t('Public') : t('Private'),
91
+ onClick: () => setSelectedItemId(item.uuid),
92
+ }))}
93
+ />
94
+ {/* <CreateTemplateDialog control={dialogControl} /> */}
95
+ </Pullover>
96
+ </>
97
+ );
98
+ };
@@ -0,0 +1,41 @@
1
+ import { useState, type FC } from 'react';
2
+ import { IPopupControl } from '../../../../../types/IPopup';
3
+ import { useTranslation } from 'react-i18next';
4
+ import { Dialog } from '../../../../Dialog/Dialog';
5
+ import { TextInput } from '../../../../Inputs/TextInput';
6
+ import { Checkbox } from '../../../../Inputs/Checkbox';
7
+ import { IReportTemplate } from '../../../../../types/ITable';
8
+ import { useTableContext } from '../../../contexts/TableContext';
9
+
10
+ interface Props {
11
+ control: IPopupControl['control'];
12
+ }
13
+
14
+ export const CreateTemplateDialog: FC<Props> = ({ control }) => {
15
+ const { t } = useTranslation();
16
+ const { templateData } = useTableContext();
17
+
18
+ const [formData, setFormData] = useState<Partial<IReportTemplate>>({});
19
+
20
+ return (
21
+ <Dialog
22
+ title={t('CreateTemplateLong')}
23
+ control={control}
24
+ onFormSubmit={() => console.log('Template saved!')}
25
+ footer={{ confirmButton: { label: t('CreateTemplate'), type: 'submit' } }}
26
+ >
27
+ <TextInput
28
+ label={t('TemplateName')}
29
+ value={formData.name}
30
+ setValue={name => setFormData({ ...formData, name })}
31
+ />
32
+ {templateData?.allowPublicCreate && (
33
+ <Checkbox
34
+ label={t('PublicTemplate')}
35
+ value={formData.isPublic}
36
+ setValue={isPublic => setFormData({ ...formData, isPublic })}
37
+ />
38
+ )}
39
+ </Dialog>
40
+ );
41
+ };
@@ -0,0 +1,75 @@
1
+ import { useEffect, useState } from 'react';
2
+ import { IGetPrintData, IPrintData } from '../../../types/ITable';
3
+ import { usePopupControl } from '../../../hooks/usePopupControl';
4
+
5
+ type Props<T> = {
6
+ getPrintData: IGetPrintData<T>;
7
+ totalRows?: number;
8
+ };
9
+
10
+ const limit = 1000;
11
+ const defaultData = { items: [], totalRows: 0 };
12
+
13
+ export const useTablePrint = <T>({
14
+ getPrintData,
15
+ totalRows: initialTotalRows = 0,
16
+ }: Props<T>) => {
17
+ const printPopupControl = usePopupControl();
18
+
19
+ const [data, setData] = useState<{ items: T[]; totalRows: number }>(defaultData);
20
+ const [offset, setOffset] = useState(0);
21
+ const [isLoading, setIsLoading] = useState(false);
22
+
23
+ useEffect(() => {
24
+ if (printPopupControl.control.isOpen) {
25
+ setIsLoading(true);
26
+ setOffset(0);
27
+ }
28
+ return () => {
29
+ setIsLoading(false);
30
+ setData(defaultData);
31
+ setOffset(0);
32
+ };
33
+ }, [printPopupControl.control.isOpen]);
34
+
35
+ useEffect(() => {
36
+ if (printPopupControl.control.isOpen) {
37
+ getPrintData({
38
+ pagination: { limit, offset },
39
+ noTotalRows: !!initialTotalRows || offset > 0,
40
+ })
41
+ .then(({ items, totalRows: newTotalRows }) => {
42
+ setData(prevState => {
43
+ const newData = offset === 0 ? items : prevState.items.concat(items);
44
+ const totalRows =
45
+ newTotalRows || initialTotalRows || prevState.totalRows || 0;
46
+
47
+ if (items?.length === limit) {
48
+ setOffset(offset => offset + 1);
49
+ } else {
50
+ setIsLoading(false);
51
+ }
52
+
53
+ return { items: newData, totalRows };
54
+ });
55
+ })
56
+ .catch(() => setIsLoading(false));
57
+ }
58
+ // eslint-disable-next-line react-hooks/exhaustive-deps
59
+ }, [printPopupControl.control.isOpen, initialTotalRows, offset]);
60
+
61
+ const loaded = data.items.length;
62
+ const progress = data.totalRows ? (loaded / data.totalRows) * 100 : 0;
63
+
64
+ const printData: Pick<
65
+ IPrintData<T>,
66
+ 'printPopupControl' | 'isLoading' | 'progress' | 'items'
67
+ > = {
68
+ printPopupControl,
69
+ isLoading,
70
+ progress,
71
+ items: data.items ?? [],
72
+ };
73
+
74
+ return printData;
75
+ };
package/src/index.ts CHANGED
@@ -22,6 +22,7 @@ import type { IError } from './types/IError';
22
22
  import type { ISelectData } from './types/ISelect';
23
23
  import type { ITab } from './types/ITab';
24
24
  import type {
25
+ IGetPrintData,
25
26
  IPagination,
26
27
  IPaginationControl,
27
28
  ITable,
@@ -49,6 +50,7 @@ import { NotificationBadge } from './components/Badge/NotificationBadge';
49
50
  import { PillBadge } from './components/Badge/PillBadge';
50
51
  import { Button } from './components/Button/Button';
51
52
  import { IconButton } from './components/Button/IconButton';
53
+ import { SplitButton } from './components/Button/SplitButton';
52
54
  import { Dashboard } from './components/Dashboard/Dashboard';
53
55
  import { DashboardWidget } from './components/Dashboard/DashboardWidget';
54
56
  import { FastLinksWidget } from './components/Dashboard/FastLinksWidget/FastLinksWidget';
@@ -70,7 +72,9 @@ import {
70
72
  SelectCreatable,
71
73
  } from './components/Inputs/Selects/Select';
72
74
  import { TextInput } from './components/Inputs/TextInput';
75
+ import { List } from './components/List/List';
73
76
  import { FullScreenLoader, LazyLoader, Loader } from './components/Loader/Loader';
77
+ import { ProgressBar } from './components/Loader/ProgressBar';
74
78
  import { Menu } from './components/Menu/Menu';
75
79
  import { MenuItem } from './components/Menu/MenuItem';
76
80
  // import { ItemActionsMenu } from './components/Table/Components/Edit/ItemActionsMenu';
@@ -97,6 +101,7 @@ import { useDefaultTemplate } from './components/Table/hooks/useDefaultTemplate'
97
101
  import { useTableEdit } from './components/Table/hooks/useTableEdit';
98
102
  import { useTableFilterFields } from './components/Table/hooks/useTableFilterFields';
99
103
  import { useTablePagination } from './components/Table/hooks/useTablePagination';
104
+ import { useTablePrint } from './components/Table/hooks/useTablePrint';
100
105
  import { useTableSearch } from './components/Table/hooks/useTableSearch';
101
106
  import { useTableSelect } from './components/Table/hooks/useTableSelect';
102
107
  import { useTableSort } from './components/Table/hooks/useTableSort';
@@ -196,12 +201,14 @@ export {
196
201
  TextAreaInput,
197
202
  LazyLoader,
198
203
  Loader,
204
+ List,
199
205
  Menu,
200
206
  MenuItem,
201
207
  NotificationBadge,
202
208
  NumberInput,
203
209
  PageLayout,
204
210
  PasswordInput,
211
+ ProgressBar,
205
212
  Pullover,
206
213
  PillBadge,
207
214
  Radio,
@@ -210,6 +217,7 @@ export {
210
217
  Select,
211
218
  SelectAsyncPaginate,
212
219
  SelectCreatable,
220
+ SplitButton,
213
221
  tableCustomLimit1000,
214
222
  Tabs,
215
223
  TextInput,
@@ -230,6 +238,7 @@ export {
230
238
  useTableEdit,
231
239
  useTableFilterFields,
232
240
  useTablePagination,
241
+ useTablePrint,
233
242
  useTableSearch,
234
243
  useTableSelect,
235
244
  useTableSort,
@@ -267,6 +276,7 @@ export type {
267
276
  ITableFilterData,
268
277
  ITableFilterItem,
269
278
  ITableSort,
279
+ IGetPrintData,
270
280
  ITreeItem,
271
281
  IValueLabel,
272
282
  IconDefinition,
@@ -15,6 +15,7 @@
15
15
  @use './components/alert';
16
16
  @use './components/badge';
17
17
  @use './components/button';
18
+ @use './components/buttonSplit';
18
19
  @use './components/card';
19
20
  // @use './components/menu-v2';
20
21
  @use './components/dialog';
@@ -25,11 +26,13 @@
25
26
  @use './components/inputDateTime';
26
27
  @use './components/inputRadio';
27
28
  @use './components/inputSelect';
29
+ @use './components/list';
28
30
  @use './components/loader';
29
31
  @use './components/menu';
30
32
  @use './components/page';
31
33
  @use './components/portal';
32
34
  @use './components/print';
35
+ @use './components/progressBar';
33
36
  @use './components/pullover';
34
37
  @use './components/scrollbar';
35
38
  @use './components/sidebar';
@@ -24,20 +24,14 @@
24
24
  }
25
25
  }
26
26
 
27
- // @keyframes linear-progress {
28
- // 0% {
29
- // background-size: 200% 100%;
30
- // background-position: left -31.25% top 0%;
31
- // }
32
- // 50% {
33
- // background-size: 800% 100%;
34
- // background-position: left -49% top 0%;
35
- // }
36
- // 100% {
37
- // background-size: 400% 100%;
38
- // background-position: left -102% top 0%;
39
- // }
40
- // }
27
+ @keyframes shimmer {
28
+ 0% {
29
+ left: -100%;
30
+ }
31
+ 100% {
32
+ left: 100%;
33
+ }
34
+ }
41
35
 
42
36
  @keyframes auto-fill {
43
37
  to {
@@ -49,7 +49,3 @@ a {
49
49
  .hover-neutral:hover {
50
50
  background-color: var(--neutral-hover);
51
51
  }
52
-
53
- .no-border {
54
- border: none !important;
55
- }
@@ -0,0 +1,42 @@
1
+ $text-button-sizes: (
2
+ xs: (
3
+ font-size: 10px,
4
+ svg: 12px,
5
+ padding: 0 10px,
6
+ height: 24px,
7
+ gap: 6px,
8
+ ),
9
+ s: (
10
+ font-size: 12px,
11
+ svg: 14px,
12
+ padding: 0 12px,
13
+ height: 30px,
14
+ ),
15
+ m: (
16
+ font-size: 14px,
17
+ svg: 16px,
18
+ padding: 0 14px,
19
+ height: 36px,
20
+ ),
21
+ l: (
22
+ font-size: 16px,
23
+ svg: 20px,
24
+ padding: 0 18px,
25
+ height: 48px,
26
+ ),
27
+ );
28
+
29
+ $icon-button-sizes: (
30
+ s: (
31
+ size: 32px,
32
+ svg: 16px,
33
+ ),
34
+ m: (
35
+ size: 40px,
36
+ svg: 20px,
37
+ ),
38
+ l: (
39
+ size: 44px,
40
+ svg: 24px,
41
+ ),
42
+ );