@inceptionbg/iui 2.0.7 → 2.0.10

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 (148) hide show
  1. package/dist/NoAccessPage-DBq5IzIf.js +2 -0
  2. package/dist/{NoAccessPage-BozT_Suz.js.map → NoAccessPage-DBq5IzIf.js.map} +1 -1
  3. package/dist/NotFoundPage-DM-I96ar.js +2 -0
  4. package/dist/{NotFoundPage-WWiekDef.js.map → NotFoundPage-DM-I96ar.js.map} +1 -1
  5. package/dist/icons/index.d.ts +2 -2
  6. package/dist/icons/index.js +1 -1
  7. package/dist/index.d.ts +286 -259
  8. package/dist/index.js +1 -1
  9. package/dist/index.js.map +1 -1
  10. package/dist/iui.css +1 -1
  11. package/idea/GridTable/GridTable.tsx +119 -0
  12. package/idea/GridTable/gridTable.scss +42 -0
  13. package/{src/components → idea}/Table/Components/Print/CustomTablePrint.tsx +2 -2
  14. package/{src/components → idea}/Table/Components/Print/TablePrint.tsx +2 -2
  15. package/{src/components → idea}/Table/Components/SetTableFilter.tsx +1 -1
  16. package/{src/components → idea}/Table/Components/TableOptions.tsx +4 -4
  17. package/idea/{Table2 → Table}/Table.tsx +151 -281
  18. package/idea/Table/hooks/useDefaultTemplate.ts +20 -0
  19. package/{src/components → idea}/Table/hooks/useTableKeyboard.ts +1 -2
  20. package/idea/Table/hooks/useTableSelect.ts +11 -0
  21. package/package.json +3 -2
  22. package/src/assets/icons/index.ts +1 -1
  23. package/src/assets/icons/light/faClipboardCheck.ts +15 -0
  24. package/src/assets/icons/light/faHouse.ts +15 -15
  25. package/src/assets/icons/light/faIdBadge.ts +15 -15
  26. package/src/assets/icons/light/faPen.ts +15 -0
  27. package/src/components/Button/IconButton.tsx +3 -1
  28. package/src/components/Dialog/Dialog.tsx +60 -124
  29. package/src/components/Dialog/components/DialogFooter.tsx +92 -0
  30. package/src/components/Dialog/hooks/useDialogKeyboard.ts +6 -5
  31. package/src/components/Header/Components/ModuleSelect.tsx +1 -1
  32. package/src/components/Header/Header.tsx +1 -1
  33. package/src/components/Inputs/DateInput/DateInput.tsx +108 -101
  34. package/src/components/Inputs/DateInput/components/DatePartInput.tsx +7 -3
  35. package/src/components/Inputs/InputWrapper.tsx +6 -1
  36. package/src/components/Inputs/SearchInput.tsx +9 -4
  37. package/src/components/Inputs/Select2/Select.tsx +65 -30
  38. package/src/components/Inputs/Select2/select.scss +13 -14
  39. package/src/components/Inputs/Selects/components/SelectWrapper.tsx +4 -2
  40. package/src/components/Inputs/Selects/utils/selectStyles.ts +9 -12
  41. package/src/components/Menu/Menu.tsx +10 -2
  42. package/src/components/Menu/MenuItem.tsx +11 -10
  43. package/src/components/Menu/hooks/useMenuPosition.tsx +23 -6
  44. package/src/components/Pullover/Pullover.tsx +122 -59
  45. package/src/components/Table/Table.tsx +78 -342
  46. package/src/components/Table/components/edit/TableEditRow.tsx +69 -0
  47. package/src/components/Table/components/filters/FilterItem.tsx +15 -0
  48. package/src/components/Table/components/filters/TableFilters.tsx +125 -0
  49. package/src/components/Table/components/footer/TableFooter.tsx +128 -0
  50. package/src/components/Table/components/header/TableHeader.tsx +42 -0
  51. package/src/components/Table/components/header/TableHeaderRow.tsx +47 -0
  52. package/src/components/Table/components/items/TableItemActions.tsx +66 -0
  53. package/src/components/Table/components/select/TableSelect.tsx +49 -0
  54. package/src/components/Table/components/sort/TableSort.tsx +52 -0
  55. package/src/components/Table/contexts/TableContext.tsx +123 -0
  56. package/src/components/Table/hooks/localHooks/useLocalTableColumns.tsx +73 -0
  57. package/src/components/Table/hooks/localHooks/useLocalTableData.tsx +78 -0
  58. package/src/components/Table/hooks/localHooks/useLocalTableKeyboard.ts +173 -0
  59. package/src/components/Table/hooks/localHooks/useLocalTablePagination.ts +12 -0
  60. package/src/components/Table/hooks/useTableEdit.tsx +111 -0
  61. package/src/components/Table/hooks/useTableFilterFields.tsx +150 -0
  62. package/src/components/Table/hooks/useTablePagination.ts +16 -0
  63. package/src/components/Table/hooks/useTableSearch.ts +29 -0
  64. package/src/components/Table/hooks/useTableSort.ts +8 -0
  65. package/src/components/Tooltip/Tooltip.tsx +1 -1
  66. package/src/components/Wrappers/PageLayout.tsx +13 -18
  67. package/src/hooks/useGetFocusableElements.ts +42 -0
  68. package/src/hooks/useLocalPopoverControl.ts +38 -0
  69. package/src/hooks/usePopupControl.ts +13 -0
  70. package/src/index.ts +53 -39
  71. package/src/styles/common/_typography.scss +3 -0
  72. package/src/styles/common/helpers/_size.scss +1 -1
  73. package/src/styles/components/_accordions.scss +1 -1
  74. package/src/styles/components/_badge.scss +4 -3
  75. package/src/styles/components/_card.scss +1 -1
  76. package/src/styles/components/_dialog.scss +15 -13
  77. package/src/styles/components/_input.scss +1 -1
  78. package/src/styles/components/_inputCheckbox.scss +1 -1
  79. package/src/styles/components/_inputDateTime.scss +2 -2
  80. package/src/styles/components/_inputRadio.scss +1 -1
  81. package/src/styles/components/_inputSelect.scss +6 -4
  82. package/src/styles/components/_menu-v2.scss +1 -1
  83. package/src/styles/components/_menu.scss +23 -15
  84. package/src/styles/components/_page.scss +3 -2
  85. package/src/styles/components/_pullover.scss +74 -18
  86. package/src/styles/components/_table.scss +151 -142
  87. package/src/styles/components/_widget.scss +1 -1
  88. package/src/styles/variables/_bp.scss +1 -0
  89. package/src/styles/variables/_variables.scss +4 -2
  90. package/src/types/IKeyboard.ts +2 -1
  91. package/src/types/IMenu.ts +1 -0
  92. package/src/types/ISelect.ts +1 -0
  93. package/src/types/ITable.ts +87 -80
  94. package/src/utils/fileUtils.ts +7 -6
  95. package/src/utils/i18n/i18nIUICyrilic.ts +4 -0
  96. package/src/utils/i18n/i18nIUILatin.ts +3 -1
  97. package/src/utils/i18n/i18nIUIMe.ts +4 -0
  98. package/src/utils/{ObjectUtils.ts → objectUtils.ts} +8 -8
  99. package/src/utils/popupUtils.ts +82 -0
  100. package/src/utils/{TableUtils.ts → tableUtils.ts} +5 -5
  101. package/src/utils/{Toasts.ts → toasts.ts} +6 -6
  102. package/src/utils/{UrlUtils.ts → urlUtils.ts} +4 -4
  103. package/dist/NoAccessPage-BozT_Suz.js +0 -2
  104. package/dist/NotFoundPage-WWiekDef.js +0 -2
  105. package/idea/Table2/Components/Columns/ColumnsList.tsx +0 -56
  106. package/idea/Table2/Components/Columns/SetColumnsList.tsx +0 -107
  107. package/idea/Table2/Components/Edit/ItemActionsMenu.tsx +0 -87
  108. package/idea/Table2/Components/Edit/ItemEditOptionsButtons.tsx +0 -32
  109. package/idea/Table2/Components/Edit/TableEditRow.tsx +0 -56
  110. package/idea/Table2/Components/FilterItem.tsx +0 -20
  111. package/idea/Table2/Components/Header/TableHeader.tsx +0 -35
  112. package/idea/Table2/Components/Header/TableHeaderRow.tsx +0 -37
  113. package/idea/Table2/Components/Print/CustomTablePrint.tsx +0 -119
  114. package/idea/Table2/Components/Print/TablePrint.tsx +0 -208
  115. package/idea/Table2/Components/SetSortList.tsx +0 -33
  116. package/idea/Table2/Components/SetTableFilter.tsx +0 -90
  117. package/idea/Table2/Components/TableFooter.tsx +0 -107
  118. package/idea/Table2/Components/TableOptions.tsx +0 -211
  119. package/idea/Table2/Components/Templates/TemplateCreate.tsx +0 -75
  120. package/idea/Table2/Components/Templates/TemplateCreateDefault.tsx +0 -45
  121. package/idea/Table2/Components/Templates/TemplateList.tsx +0 -167
  122. package/idea/Table2/Components/Templates/repo/TemplateRepo.ts +0 -51
  123. package/idea/Table2/_table.scss +0 -300
  124. package/idea/Table2/hooks/useDefaultTemplate.ts +0 -22
  125. package/idea/Table2/hooks/useTableKeyboard.ts +0 -115
  126. package/src/assets/icons/light/faPenField.ts +0 -15
  127. package/src/assets/icons/solid/faMagnifyingGlass.ts +0 -15
  128. package/src/components/Dialog/DeleteItemDialog.tsx +0 -52
  129. package/src/components/Dialog/hooks/useDialogObserver.ts +0 -21
  130. /package/{src/components → idea}/Table/Components/Columns/ColumnsList.tsx +0 -0
  131. /package/{src/components → idea}/Table/Components/Columns/SetColumnsList.tsx +0 -0
  132. /package/{src/components → idea}/Table/Components/Edit/ItemActionsMenu.tsx +0 -0
  133. /package/{src/components → idea}/Table/Components/Edit/ItemEditOptionsButtons.tsx +0 -0
  134. /package/{src/components → idea}/Table/Components/Edit/TableEditRow.tsx +0 -0
  135. /package/{src/components → idea}/Table/Components/FilterItem.tsx +0 -0
  136. /package/{src/components → idea}/Table/Components/Header/TableHeader.tsx +0 -0
  137. /package/{src/components → idea}/Table/Components/Header/TableHeaderRow.tsx +0 -0
  138. /package/{src/components → idea}/Table/Components/SetSortList.tsx +0 -0
  139. /package/{src/components → idea}/Table/Components/TableFooter.tsx +0 -0
  140. /package/{src/components → idea}/Table/Components/Templates/TemplateCreate.tsx +0 -0
  141. /package/{src/components → idea}/Table/Components/Templates/TemplateCreateDefault.tsx +0 -0
  142. /package/{src/components → idea}/Table/Components/Templates/TemplateList.tsx +0 -0
  143. /package/{src/components → idea}/Table/Components/Templates/repo/TemplateRepo.ts +0 -0
  144. /package/src/utils/{DateUtils.ts → dateUtils.ts} +0 -0
  145. /package/src/utils/{LocalStorageHelper.ts → localStorageHelper.ts} +0 -0
  146. /package/src/utils/{NumberUtils.ts → numberUtils.ts} +0 -0
  147. /package/src/utils/{RootDir.ts → rootDir.ts} +0 -0
  148. /package/src/utils/{StringUtils.ts → stringUtils.ts} +0 -0
@@ -1,115 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
- import { ITableDataItem } from '../../../types/ITable';
3
- import { IKeyboardAction, ITableKeyboardActionsProp } from '../../../types/IKeyboard';
4
- import { useDialogObserver } from '../../Dialog/hooks/useDialogObserver';
5
- import { scrollToRow } from '../../../utils/TableUtils';
6
-
7
- export const useTableKeyboard = ({
8
- enabled,
9
- rows,
10
- actions,
11
- }: {
12
- enabled: boolean;
13
- rows: ITableDataItem[];
14
- actions: ITableKeyboardActionsProp;
15
- }) => {
16
- const [focusedRow, setFocusedRow] = useState<ITableDataItem | null>(null);
17
- const isDialogOpen = useDialogObserver();
18
-
19
- useEffect(() => {
20
- if (enabled && !isDialogOpen) {
21
- const isEditing = !!actions.edit?.item;
22
- const isAdding = !!actions.add?.isAdding;
23
-
24
- const handleKeyDown = (event: KeyboardEvent) => {
25
- const isControlKeyPressed = event.ctrlKey || event.metaKey;
26
- const rowIndex = focusedRow
27
- ? rows.findIndex(row => row.uuid === focusedRow.uuid)
28
- : -1;
29
-
30
- const allActions: IKeyboardAction[] = [
31
- {
32
- key: 'ArrowDown',
33
- isActive: !isEditing && !actions.moveDisabled,
34
- onAction: () => {
35
- // Leave action enabled to prevent default scroll movement
36
- const nextRow = rowIndex + 1;
37
- if (nextRow < rows.length) {
38
- // rowIndex will be -1 if no row is selected so the next row will be 0
39
- setFocusedRow(rows[nextRow]);
40
- scrollToRow(rows[nextRow].uuid);
41
- }
42
- },
43
- },
44
- {
45
- key: 'ArrowUp',
46
- isActive: !isEditing && !actions.moveDisabled,
47
- onAction: () => {
48
- if (rowIndex !== 0) {
49
- const prevRow = rowIndex > 0 ? rowIndex - 1 : rows.length - 1;
50
- setFocusedRow(rows[prevRow]);
51
- scrollToRow(rows[prevRow].uuid);
52
- }
53
- },
54
- },
55
- {
56
- key: 'e',
57
- normalizedKey: true,
58
- ctrl: true,
59
- isActive: !!actions.edit?.enabled && !!focusedRow,
60
- onAction: () => !isEditing && actions.edit?.setItem(focusedRow?.item ?? null),
61
- },
62
- {
63
- key: 'Enter',
64
- isActive: !isEditing && !isAdding && !!focusedRow?.onRowClick,
65
- onAction: focusedRow?.onRowClick!,
66
- },
67
- {
68
- key: 'Escape',
69
- isActive: !!focusedRow || !!isAdding,
70
- onAction: () =>
71
- isAdding
72
- ? actions.add?.setIsAdding(false)
73
- : actions.edit?.item
74
- ? actions.edit?.setItem(null)
75
- : setFocusedRow(null),
76
- },
77
- {
78
- key: 'Insert',
79
- isActive: !!actions.add?.enabled && !isAdding,
80
- onAction: () => {
81
- actions.add?.setIsAdding(true);
82
- setFocusedRow(null);
83
- },
84
- },
85
- {
86
- key: 'Delete',
87
- isActive: !isEditing && !!actions.delete?.enabled && !!focusedRow,
88
- onAction: () =>
89
- actions.delete?.onAction ?? actions.delete?.setItemUuid(focusedRow!.uuid),
90
- },
91
- ...(actions?.additional?.({ focusedRow, isEditing, isAdding }) || []),
92
- ];
93
-
94
- allActions.forEach(item => {
95
- if (
96
- item.isActive &&
97
- item.key === (item.normalizedKey ? event.key.toLowerCase() : event.key) &&
98
- !!item.ctrl === isControlKeyPressed
99
- ) {
100
- event.preventDefault();
101
- event.stopPropagation();
102
- item.onAction();
103
- }
104
- });
105
- };
106
-
107
- window.addEventListener('keydown', handleKeyDown);
108
- return () => {
109
- window.removeEventListener('keydown', handleKeyDown);
110
- };
111
- }
112
- }, [enabled, rows, focusedRow, actions, isDialogOpen]);
113
-
114
- return focusedRow;
115
- };
@@ -1,15 +0,0 @@
1
- import { IconDefinition } from "@fortawesome/fontawesome-svg-core";
2
-
3
- const prefix = "fal";
4
- const iconName = "pen-field";
5
- const width = 640;
6
- const height = 512;
7
- const unicode = "e211";
8
- const svgPathData =
9
- "M560 256C551.2 256 544 263.2 544 272V448c0 17.67-14.33 32-32 32H64c-17.67 0-32-14.33-32-32V192c0-17.67 14.33-32 32-32h240C312.8 160 320 152.8 320 144S312.8 128 304 128H63.1C28.65 128 0 156.7 0 192v256c0 35.35 28.65 64 63.1 64h447.1c35.35 0 63.1-28.65 63.1-63.1L576 272C576 263.2 568.8 256 560 256zM640 76.14c0-12.28-4.686-24.57-14.06-33.94l-28.13-28.14C588.4 4.688 576.2 0 563.9 0s-24.57 4.688-33.94 14.06l-207.5 207.5C313.5 230.5 307.4 241.9 304.9 254.3l-16.66 83.35c-.162 .8104-.2393 1.612-.2393 2.396C288 346.6 293.4 352 299.1 352c.7852 0 1.586-.0781 2.398-.2402l83.35-16.67c12.39-2.479 23.77-8.566 32.7-17.5l207.5-207.5C635.3 100.7 640 88.42 640 76.14zM395.8 294.1c-4.48 4.48-10.13 7.506-16.35 8.748L325.5 314.5l10.78-53.93c1.244-6.219 4.27-11.88 8.754-16.36l146.3-146.3l50.76 50.76L395.8 294.1zM603.3 87.45l-38.62 38.62l-50.76-50.76l38.62-38.62C556.6 32.61 561.4 32 563.9 32s7.236 .6094 11.31 4.686l28.13 28.14C607.4 68.9 608 73.66 608 76.14C608 78.61 607.4 83.38 603.3 87.45zM104 320c0 13.25 10.75 24 24 24S152 333.3 152 320c0-13.26-10.75-24-24-24S104 306.7 104 320zM200 320c0 13.25 10.75 24 24 24S248 333.3 248 320c0-13.26-10.75-24-24-24S200 306.7 200 320z";
10
-
11
- export const faPenField: IconDefinition = {
12
- prefix,
13
- iconName,
14
- icon: [width, height, [], unicode, svgPathData],
15
- };
@@ -1,15 +0,0 @@
1
- import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
2
-
3
- const prefix = 'fas';
4
- const iconName = 'magnifying-glass';
5
- const width = 512;
6
- const height = 512;
7
- const unicode = 'f002';
8
- const svgPathData =
9
- 'M500.3 443.7l-119.7-119.7c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723C99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9c53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0C515.9 484.7 515.9 459.3 500.3 443.7zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128c0 70.58-57.42 128-128 128S79.1 278.6 79.1 208z';
10
-
11
- export const faMagnifyingGlass: IconDefinition = {
12
- prefix,
13
- iconName,
14
- icon: [width, height, [], unicode, svgPathData],
15
- };
@@ -1,52 +0,0 @@
1
- import { Dispatch, FC, SetStateAction, useState } from 'react';
2
- import { useTranslation } from 'react-i18next';
3
- import { Dialog } from './Dialog';
4
- import { faTrashCan } from '../../assets/icons';
5
-
6
- interface Props {
7
- textId: string;
8
- itemUuid: string;
9
- setItemUuid: Dispatch<SetStateAction<string>>;
10
- reloadItems: () => void;
11
- deleteItemFunction: (itemUuid: string) => Promise<any>;
12
- }
13
-
14
- export const DeleteItemDialog: FC<Props> = ({
15
- textId,
16
- itemUuid,
17
- setItemUuid,
18
- reloadItems,
19
- deleteItemFunction,
20
- }) => {
21
- const [isLoading, setIsLoading] = useState(false);
22
-
23
- const { t } = useTranslation();
24
-
25
- const handOnDelete = () => {
26
- setIsLoading(true);
27
- deleteItemFunction(itemUuid)
28
- .then(() => {
29
- reloadItems();
30
- setItemUuid('');
31
- })
32
- .catch(() => {})
33
- .finally(() => setIsLoading(false));
34
- };
35
-
36
- return (
37
- <Dialog
38
- isOpen={!!itemUuid}
39
- onClose={() => setItemUuid('')}
40
- title={t(`Delete${textId}Title`)}
41
- desc={t(`Delete${textId}Desc`)}
42
- isLoading={isLoading}
43
- type="info"
44
- confirmButton={{
45
- label: t('Delete'),
46
- icon: faTrashCan,
47
- keepOpen: true,
48
- onClick: handOnDelete,
49
- }}
50
- />
51
- );
52
- };
@@ -1,21 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
- import { rootDir } from '../../../utils/RootDir';
3
-
4
- export const useDialogObserver = () => {
5
- const [isDialogOpen, setIsDialogOpen] = useState(false);
6
-
7
- useEffect(() => {
8
- const observer = new MutationObserver(mutationsList => {
9
- if (mutationsList.find(mutation => mutation.type === 'childList')) {
10
- const isDialogInRoot = rootDir.getElementsByClassName('iui-dialog').length > 0;
11
- setIsDialogOpen(isDialogInRoot);
12
- }
13
- });
14
-
15
- observer.observe(rootDir, { childList: true });
16
-
17
- return () => observer.disconnect();
18
- }, []);
19
-
20
- return isDialogOpen;
21
- };
File without changes
File without changes
File without changes
File without changes