@inceptionbg/iui 2.0.12 → 2.0.14

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 (51) hide show
  1. package/dist/index.d.ts +112 -53
  2. package/dist/index.js +1 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/iui.css +1 -1
  5. package/package.json +1 -1
  6. package/rollup.config.js +1 -5
  7. package/src/assets/icons/light/faBookmark.ts +15 -15
  8. package/src/assets/icons/light/faBookmarkSlash.ts +15 -15
  9. package/src/assets/images/logo/inception.svg +22 -0
  10. package/src/components/Button/Button.tsx +1 -1
  11. package/src/components/Button/SplitButton.tsx +91 -0
  12. package/src/components/Dialog/components/DialogFooter.tsx +5 -1
  13. package/src/components/Header/Components/ModuleSelect.tsx +15 -10
  14. package/src/components/Header/Components/UserMenu.tsx +1 -0
  15. package/src/components/List/List.tsx +5 -3
  16. package/src/components/List/ListItem.tsx +58 -13
  17. package/src/components/Menu/Menu.tsx +5 -1
  18. package/src/components/Pullover/Pullover.tsx +25 -9
  19. package/src/components/Sidebar/Sidebar.tsx +6 -4
  20. package/src/components/Table/Table.tsx +2 -5
  21. package/src/components/Table/components/edit/TableEditRow.tsx +4 -1
  22. package/src/components/Table/components/filters/TableFilters.tsx +4 -1
  23. package/src/components/Table/components/items/TableItemActions.tsx +12 -3
  24. package/src/components/Table/components/print/TablePrint.tsx +4 -1
  25. package/src/components/Table/components/sort/TableSort.tsx +19 -1
  26. package/src/components/Table/components/templates/TableTemplates.tsx +56 -45
  27. package/src/components/Table/contexts/TableContext.tsx +13 -17
  28. package/src/components/Table/hooks/localHooks/useLocalTableColumns.tsx +8 -10
  29. package/src/components/Table/hooks/localHooks/useLocalTableData.tsx +1 -1
  30. package/src/components/Table/hooks/useTableColumns.ts +28 -0
  31. package/src/components/Table/hooks/useTablePagination.ts +10 -7
  32. package/src/components/Table/hooks/useTableSelect.ts +15 -7
  33. package/src/index.ts +14 -2
  34. package/src/styles/App.scss +1 -0
  35. package/src/styles/common/maps/_buttonMaps.scss +42 -0
  36. package/src/styles/components/_button.scss +11 -50
  37. package/src/styles/components/_buttonSplit.scss +90 -0
  38. package/src/styles/components/_header.scss +26 -5
  39. package/src/styles/components/_list.scss +19 -1
  40. package/src/styles/components/_page.scss +2 -1
  41. package/src/styles/components/_sidebar.scss +2 -2
  42. package/src/styles/components/_table.scss +6 -6
  43. package/src/styles/variables/_variables.scss +1 -0
  44. package/src/types/ITable.ts +40 -44
  45. package/src/utils/i18n/i18nIUICyrilic.ts +22 -13
  46. package/src/utils/i18n/i18nIUILatin.ts +15 -7
  47. package/src/utils/i18n/i18nIUIMe.ts +21 -11
  48. package/src/utils/logoUtils.ts +7 -0
  49. package/src/utils/tableUtils.ts +5 -5
  50. package/tsconfig.json +2 -0
  51. package/src/components/Table/hooks/useDefaultTemplate.ts +0 -20
package/dist/index.d.ts CHANGED
@@ -13,7 +13,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
13
13
 
14
14
  type IButtonColor = 'primary' | 'neutral' | 'danger';
15
15
  type IButtonVariant = 'solid' | 'outlined' | 'simple';
16
- interface IButtonProps {
16
+ interface IButtonProps$1 {
17
17
  label: string;
18
18
  icon?: IconDefinition;
19
19
  iconEnd?: IconDefinition;
@@ -28,7 +28,7 @@ interface IButtonProps {
28
28
  buttonProps?: ButtonHTMLAttributes<HTMLButtonElement>;
29
29
  ref?: Ref<HTMLButtonElement>;
30
30
  }
31
- declare const Button: FC<IButtonProps>;
31
+ declare const Button: FC<IButtonProps$1>;
32
32
 
33
33
  interface IFormWrapper {
34
34
  isLoading: boolean;
@@ -95,29 +95,17 @@ interface IPopupControl {
95
95
  }
96
96
 
97
97
  interface ITable<T = unknown> {
98
- columns: ITableColumn[];
98
+ columnData: ITableColumnsData;
99
99
  data: ITableDataItem[];
100
- dataActions?: {
101
- edit?: {
102
- hasAccess: boolean;
103
- };
104
- delete?: {
105
- onClick: (itemUuid: string) => void;
106
- hasAccess: boolean;
107
- };
108
- actions?: {
109
- label: string;
110
- onClick: (item: ITableDataItem) => void;
111
- hasAccess: boolean;
112
- }[];
113
- };
100
+ dataActions?: ITableDataActions;
114
101
  rowSelect?: {
115
102
  selectedRows: Set<string>;
116
103
  setSelectedRows: Dispatch<SetStateAction<Set<string>>>;
117
- actions: ITableSelectedActions[];
104
+ actions: ITableSelectedAction[];
118
105
  };
119
106
  filterData?: ITableFilterData;
120
107
  sortData?: ITableSortData;
108
+ templateData?: ITableTemplateData;
121
109
  printData?: IPrintData<T>;
122
110
  sumRows?: ITableDataItem[];
123
111
  editable?: ITableEdit;
@@ -141,14 +129,6 @@ interface ITable<T = unknown> {
141
129
  className?: string;
142
130
  rowHeight?: 'xs' | 's' | 'm';
143
131
  maxHeight?: string;
144
- templates?: {
145
- identifier: string;
146
- setSearch?: (search: string) => void;
147
- items: {
148
- uuid: string;
149
- name: string;
150
- }[];
151
- };
152
132
  }
153
133
  interface ITableColumn {
154
134
  id: string;
@@ -196,6 +176,20 @@ interface ITableDataItemCells {
196
176
  printValue?: string;
197
177
  };
198
178
  }
179
+ interface ITableDataActions {
180
+ edit?: {
181
+ hasAccess: boolean;
182
+ };
183
+ delete?: {
184
+ onClick: (itemUuid: string) => void;
185
+ hasAccess: boolean;
186
+ };
187
+ actions?: {
188
+ label: string;
189
+ onClick: (item: ITableDataItem) => void;
190
+ hasAccess: boolean;
191
+ }[];
192
+ }
199
193
  interface ITableFilterData {
200
194
  filters: ITableFilter;
201
195
  customFilterIdList?: string[];
@@ -226,17 +220,30 @@ interface ITableSort {
226
220
  value: string;
227
221
  }
228
222
  interface ITableColumnsData {
223
+ defaultColumns: ITableColumn[];
229
224
  columns: ITableColumn[];
230
- setColumns: (columns: ITableColumn[]) => void;
231
- withSearch?: boolean;
225
+ setColumns?: (columns: ITableColumn[]) => void;
232
226
  }
233
- interface ITableSelectedActions {
227
+ interface ITableSelectedAction {
234
228
  label: string;
235
229
  onClick: (selected: Set<string>) => void;
236
230
  hidden?: boolean;
237
231
  disabled?: boolean;
238
232
  clearSelected?: boolean;
239
233
  }
234
+ interface ITableTemplateData {
235
+ identifier: string;
236
+ popupController: IPopupControl;
237
+ items: IReportTemplate[];
238
+ isLoading?: boolean;
239
+ isFetching?: boolean;
240
+ setSearch?: (search: string) => void;
241
+ initiateCreate: () => void;
242
+ initiateCreateDefault: () => void;
243
+ setItemToDeleteUuids: (itemUuids: string[]) => void;
244
+ allowPublicCreate?: boolean;
245
+ TemplateNode: ReactNode;
246
+ }
240
247
  interface ITableEdit<T = any> {
241
248
  selectedItem: T | null;
242
249
  setSelectedItem: (item: T | null) => void;
@@ -324,6 +331,11 @@ interface IReportTemplateFilterValue {
324
331
  name?: string;
325
332
  type: 'STRING' | 'ARRAY' | 'OBJECT' | 'BOOLEAN';
326
333
  }
334
+ interface IReportTemplateData {
335
+ searchData: IAnyObject;
336
+ visibleColumns?: string[];
337
+ sorts?: string[];
338
+ }
327
339
  declare const tableCustomLimit1000: number[];
328
340
 
329
341
  interface IKeyboardAction {
@@ -522,9 +534,12 @@ interface Props$l {
522
534
  }
523
535
  declare const Header: FC<Props$l>;
524
536
 
537
+ type IOrgLogo = 'MTS' | 'PPL' | 'INC';
538
+
525
539
  interface ISidebarProps {
526
540
  items: ISidebarItem[][];
527
- logo?: string;
541
+ logo?: IOrgLogo;
542
+ customLogo?: string;
528
543
  appVersion?: string;
529
544
  }
530
545
  declare const Sidebar: FC<ISidebarProps>;
@@ -596,6 +611,23 @@ interface IIconButtonProps {
596
611
  }
597
612
  declare const IconButton: FC<IIconButtonProps>;
598
613
 
614
+ type ISplitAction = Pick<IMenuItem, 'label' | 'onClick'> & Partial<Pick<IMenuItem, 'icon' | 'active' | 'disabled' | 'hidden'>>;
615
+ interface IButtonProps {
616
+ label: string;
617
+ icon?: IconDefinition;
618
+ onClick?: MouseEventHandler<HTMLButtonElement>;
619
+ splitActions?: ISplitAction[];
620
+ menuPlacement?: IMenuPlacement;
621
+ variant?: 'solid' | 'outlined';
622
+ size?: 'xs' | 's' | 'm' | 'l';
623
+ disabled?: boolean;
624
+ type?: ButtonHTMLAttributes<HTMLButtonElement>['type'];
625
+ className?: string;
626
+ buttonProps?: ButtonHTMLAttributes<HTMLButtonElement>;
627
+ ref?: Ref<HTMLButtonElement>;
628
+ }
629
+ declare const SplitButton: FC<IButtonProps>;
630
+
599
631
  declare const Dashboard: FC<{
600
632
  children: ReactNode;
601
633
  }>;
@@ -629,6 +661,7 @@ interface IDialogFooterActions {
629
661
  color?: IButtonColor;
630
662
  isKeyboardDisabled?: boolean;
631
663
  type?: ButtonHTMLAttributes<HTMLButtonElement>['type'];
664
+ splitActions?: ISplitAction[];
632
665
  };
633
666
  cancelButton?: {
634
667
  label?: string;
@@ -863,17 +896,26 @@ interface ITextInputProps {
863
896
  }
864
897
  declare const TextInput: FC<ITextInputProps>;
865
898
 
899
+ interface IListItemAction {
900
+ icon: IconDefinition;
901
+ onClick: () => void;
902
+ disabled?: boolean;
903
+ color?: IButtonColor;
904
+ hidden?: boolean;
905
+ }
866
906
  interface IListItem {
867
907
  id?: string;
868
908
  label: string;
869
909
  desc?: string;
910
+ actions?: IListItemAction[];
870
911
  onClick?: () => void;
871
912
  active?: boolean;
872
913
  disabled?: boolean;
873
914
  }
874
915
 
875
916
  interface Props$a {
876
- items: IListItem[];
917
+ items?: IListItem[];
918
+ noItemsMessage?: string;
877
919
  }
878
920
  declare const List: FC<Props$a>;
879
921
 
@@ -978,8 +1020,10 @@ interface Props$2 {
978
1020
  title: string;
979
1021
  onSearch?: (search: string) => void;
980
1022
  };
1023
+ isFetching?: boolean;
981
1024
  isLoading?: boolean;
982
1025
  onFormSubmit?: () => void;
1026
+ onContentClick?: () => void;
983
1027
  onCloseCallback?: () => void;
984
1028
  footer?: IDialogFooterActions;
985
1029
  size?: 'vw25' | 'vw50' | 'vw75' | 'vw100' | 'w500' | 'w600';
@@ -992,7 +1036,11 @@ declare const Pullover: FC<Props$2>;
992
1036
 
993
1037
  declare const Table: FC<ITable>;
994
1038
 
995
- declare const useDefaultTemplate: (identifier?: string) => void;
1039
+ interface ITableColumnsProps {
1040
+ defaultColumns: ITableColumn[];
1041
+ templateColumns?: ITableColumn[];
1042
+ }
1043
+ declare const useTableColumns: ({ defaultColumns, templateColumns, }: ITableColumnsProps) => ITableColumnsData;
996
1044
 
997
1045
  interface BaseItemProps$1<T> {
998
1046
  id: keyof T;
@@ -1089,10 +1137,13 @@ declare const useTableSearch: <T>({ setOffset, resetSelectedRows, defaultSearch,
1089
1137
  onSearch: (filters: T) => void;
1090
1138
  };
1091
1139
 
1092
- declare const useTableSelect: () => {
1140
+ declare const useTableSelect: ({ actions }: {
1141
+ actions: ITableSelectedAction[];
1142
+ }) => {
1093
1143
  selectedRows: Set<string>;
1094
1144
  setSelectedRows: react.Dispatch<react.SetStateAction<Set<string>>>;
1095
1145
  resetSelectedRows: () => void;
1146
+ actions: ITableSelectedAction[];
1096
1147
  };
1097
1148
 
1098
1149
  declare const useTableSort: (sortOptions: ITableSort[]) => {
@@ -1176,9 +1227,9 @@ declare const getVisibleColumnsIds: (tableCols: ITableColumn[], isPrint?: boolea
1176
1227
  declare const getPrintColumns: (tableCols: ITableColumn[]) => string[];
1177
1228
  declare const convertSearchToReportTemplateFilter: (search: IAnyObject) => IReportTemplateFilterValue[];
1178
1229
  declare const convertReportTemplateFilterToSearch: (filterValues: IReportTemplateFilterValue[]) => any;
1179
- declare const setTemplateData: ({ template, columnsData, setFilters, setSort, }: {
1230
+ declare const setTemplateData: ({ template, columnData, setFilters, setSort, }: {
1180
1231
  template: IReportTemplate;
1181
- columnsData?: ITableColumnsData;
1232
+ columnData?: ITableColumnsData;
1182
1233
  setFilters?: (filters: IAnyObject) => void;
1183
1234
  setSort?: (sort: string) => void;
1184
1235
  }) => void;
@@ -1251,13 +1302,23 @@ declare const i18nIUILatin: {
1251
1302
  Templates: string;
1252
1303
  ApplyTemplate: string;
1253
1304
  ResetTemplate: string;
1305
+ DeleteTemplate: string;
1306
+ CreateTemplateLong: string;
1307
+ CreateDefaultTemplate: string;
1308
+ CreateTemplate: string;
1309
+ TemplateName: string;
1310
+ NoTemplatesAvailable: string;
1311
+ PublicTemplate: string;
1312
+ PrivateTemplate: string;
1254
1313
  FastLinks: string;
1255
1314
  CharMin: string;
1256
1315
  CharRange: string;
1257
1316
  CharNumber: string;
1317
+ Pending: string;
1258
1318
  Successfully: string;
1259
1319
  DeletedSuccessfully: string;
1260
1320
  ErrorMessage: string;
1321
+ TryAgain: string;
1261
1322
  ReturnToHomepage: string;
1262
1323
  FooterText: string;
1263
1324
  PageNotFound: string;
@@ -1319,17 +1380,16 @@ declare const i18nIUICyrilic: {
1319
1380
  Sort: string;
1320
1381
  AddItem: string;
1321
1382
  Templates: string;
1322
- SelectTemplate: string;
1323
- TemplateList: string;
1324
- PublicTemplate: string;
1325
- PublicTemplates: string;
1326
- DefaultTemplate: string;
1327
- RemoveFiltersAndLook: string;
1383
+ ApplyTemplate: string;
1384
+ ResetTemplate: string;
1385
+ DeleteTemplate: string;
1328
1386
  CreateTemplateLong: string;
1329
1387
  CreateDefaultTemplate: string;
1330
1388
  CreateTemplate: string;
1331
- DeleteTemplateDesc: string;
1332
- DeleteTemplateTitle: string;
1389
+ TemplateName: string;
1390
+ NoTemplatesAvailable: string;
1391
+ PublicTemplate: string;
1392
+ PrivateTemplate: string;
1333
1393
  FastLinks: string;
1334
1394
  CharMin: string;
1335
1395
  CharRange: string;
@@ -1400,17 +1460,16 @@ declare const i18nIUIMe: {
1400
1460
  Sort: string;
1401
1461
  AddItem: string;
1402
1462
  Templates: string;
1403
- SelectTemplate: string;
1404
- TemplateList: string;
1405
- PublicTemplate: string;
1406
- PublicTemplates: string;
1407
- DefaultTemplate: string;
1408
- RemoveFiltersAndLook: string;
1463
+ ApplyTemplate: string;
1464
+ ResetTemplate: string;
1465
+ DeleteTemplate: string;
1409
1466
  CreateTemplateLong: string;
1410
1467
  CreateDefaultTemplate: string;
1411
1468
  CreateTemplate: string;
1412
- DeleteTemplateDesc: string;
1413
- DeleteTemplateTitle: string;
1469
+ TemplateName: string;
1470
+ NoTemplatesAvailable: string;
1471
+ PublicTemplate: string;
1472
+ PrivateTemplate: string;
1414
1473
  FastLinks: string;
1415
1474
  CharMin: string;
1416
1475
  CharRange: string;
@@ -1448,5 +1507,5 @@ declare const useIsMenuOpen: () => {
1448
1507
 
1449
1508
  declare const usePopupControl: () => IPopupControl;
1450
1509
 
1451
- export { Accordions, Alert, Button, Checkbox, Collapse, ConditionalWrapper, CurrencyInput, Dashboard, DashboardWidget, DateInput, Dialog, DotBadge, FastLinksWidget, FormWrapper, FullScreenLoader, IconButton, LazyLoader, List, Loader, Menu, MenuItem, NotificationBadge, NumberInput, PageLayout, PasswordInput, PillBadge, ProgressBar, Pullover, Radio, RadioLarge, Router, SearchInput, Select, SelectAsyncPaginate, SelectCreatable, Table, Tabs, TextAreaInput, TextInput, TimeInput, Tooltip, Tree, areStringArraysEqual, calculateFilesSize, checkIfExpired, compareArrayItemsIndex, convertArrayToBooleanObject, convertBooleanObjectToArray, convertReportTemplateFilterToSearch, convertSearchToReportTemplateFilter, dataURLtoFile, dateAddDays, deepCopy, deleteEmptyProps, deleteEmptyPropsIncludingArray, deleteProps, deletePropsThatEndsWith, downloadDocumentFile, downloadFile, formatCurrency, formatCurrencyNoDecimals, formatDate, formatDateAndTime, formatDateYMD, formatDecimalNumber, formatTime, formatYearMonth, getActiveFilterNumber, getActiveOrgUuid, getBase64FromFile, getBase64FromUrl, getCurrentDateFormatted, getCurrentDateFormattedYMD, getDaysLeft, getDefaultOrgUuid, getExtensionFromFilename, getFileFromUrl, getInputHelperText, getInputMinMaxPattern, getPrintColumns, getVisibleColumnsIds, i18nIUICyrilic, i18nIUILatin, i18nIUIMe, inputPattern, intersectArrays, lsGet, lsRemove, lsSet, maxChar, parseUrlSearch, rootDir, rotateBase64Image, setActiveOrgUuid, setDefaultOrgUuid, setTemplateData, sizeInBytesPretty, splitBase64File, tableCustomLimit1000, toastError, toastSuccess, useDefaultTemplate, useHideZendesk, useIsMenuOpen, useOnEsc, usePopupControl, useTableEdit, useTableFilterFields, useTablePagination, useTablePrint, useTableSearch, useTableSelect, useTableSort };
1452
- export type { DeepPartial, IAlertProps, IAnyObject, IBooleanObject, IError, IFormWrapper, IGetPrintData, IHeaderAction, IHeaderUserMenuProps, IKeyboardAction, IMenuItem, IMenuPlacement, IPagination, IPaginationControl, IPopupControl, IRoute, ISelectData, ISidebarItem, ISimpleObject, ISimpleObjectWithCode, IStringObject, ITab, ITable, ITableColumn, ITableDataItem, ITableDataItemCells, ITableEdit, ITableFilter, ITableFilterData, ITableFilterItem, ITableSort, ITreeItem, IValueLabel, PopupControlRef };
1510
+ export { Accordions, Alert, Button, Checkbox, Collapse, ConditionalWrapper, CurrencyInput, Dashboard, DashboardWidget, DateInput, Dialog, DotBadge, FastLinksWidget, FormWrapper, FullScreenLoader, IconButton, LazyLoader, List, Loader, Menu, MenuItem, NotificationBadge, NumberInput, PageLayout, PasswordInput, PillBadge, ProgressBar, Pullover, Radio, RadioLarge, Router, SearchInput, Select, SelectAsyncPaginate, SelectCreatable, SplitButton, Table, Tabs, TextAreaInput, TextInput, TimeInput, Tooltip, Tree, areStringArraysEqual, calculateFilesSize, checkIfExpired, compareArrayItemsIndex, convertArrayToBooleanObject, convertBooleanObjectToArray, convertReportTemplateFilterToSearch, convertSearchToReportTemplateFilter, dataURLtoFile, dateAddDays, deepCopy, deleteEmptyProps, deleteEmptyPropsIncludingArray, deleteProps, deletePropsThatEndsWith, downloadDocumentFile, downloadFile, formatCurrency, formatCurrencyNoDecimals, formatDate, formatDateAndTime, formatDateYMD, formatDecimalNumber, formatTime, formatYearMonth, getActiveFilterNumber, getActiveOrgUuid, getBase64FromFile, getBase64FromUrl, getCurrentDateFormatted, getCurrentDateFormattedYMD, getDaysLeft, getDefaultOrgUuid, getExtensionFromFilename, getFileFromUrl, getInputHelperText, getInputMinMaxPattern, getPrintColumns, getVisibleColumnsIds, i18nIUICyrilic, i18nIUILatin, i18nIUIMe, inputPattern, intersectArrays, lsGet, lsRemove, lsSet, maxChar, parseUrlSearch, rootDir, rotateBase64Image, setActiveOrgUuid, setDefaultOrgUuid, setTemplateData, sizeInBytesPretty, splitBase64File, tableCustomLimit1000, toastError, toastSuccess, useHideZendesk, useIsMenuOpen, useOnEsc, usePopupControl, useTableColumns, useTableEdit, useTableFilterFields, useTablePagination, useTablePrint, useTableSearch, useTableSelect, useTableSort };
1511
+ export type { DeepPartial, IAlertProps, IAnyObject, IBooleanObject, IError, IFormWrapper, IGetPrintData, IHeaderAction, IHeaderUserMenuProps, IKeyboardAction, IMenuItem, IMenuPlacement, IPagination, IPaginationControl, IPopupControl, IReportTemplate, IReportTemplateData, IReportTemplateFilterValue, IRoute, ISelectData, ISidebarItem, ISimpleObject, ISimpleObjectWithCode, IStringObject, ITab, ITable, ITableColumn, ITableDataActions, ITableDataItem, ITableDataItemCells, ITableEdit, ITableFilter, ITableFilterData, ITableFilterItem, ITableSort, ITableTemplateData, ITreeItem, IValueLabel, PopupControlRef };