@inceptionbg/iui 1.0.5 → 1.0.6
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.
- package/dist/index.css +1 -0
- package/dist/index.d.ts +407 -0
- package/dist/index.js +269 -0
- package/dist/index.js.map +1 -0
- package/package.json +5 -5
- package/src/Elements/Accordions/Accordions.tsx +0 -63
- package/src/Elements/Alert/Alert.tsx +0 -31
- package/src/Elements/Alert/alert.scss +0 -36
- package/src/Elements/Button/Button.tsx +0 -55
- package/src/Elements/Button/IconButton.tsx +0 -42
- package/src/Elements/Button/button.scss +0 -97
- package/src/Elements/Dialog/Dialog.tsx +0 -175
- package/src/Elements/Helper/Collapse.tsx +0 -39
- package/src/Elements/Helper/NoAccessInfo.tsx +0 -195
- package/src/Elements/Tooltip/Tooltip.tsx +0 -116
- package/src/Elements/Tooltip/tooltip.scss +0 -46
- package/src/Elements/Wrappers/ConditionalWrapper.tsx +0 -10
- package/src/Elements/Wrappers/FormWrapper.tsx +0 -67
- package/src/Elements/Wrappers/FullPageWrapper.tsx +0 -87
- package/src/icons/duotone/faArrowLeftFromLine.ts +0 -17
- package/src/icons/duotone/faArrowRightToLine.ts +0 -17
- package/src/icons/duotone/faBell.ts +0 -17
- package/src/icons/duotone/faEye.ts +0 -17
- package/src/icons/duotone/faEyeSlash.ts +0 -17
- package/src/icons/duotone/faHouseHeart.ts +0 -17
- package/src/icons/duotone/faPlusCircle.ts +0 -18
- package/src/icons/duotone/faUser.ts +0 -18
- package/src/icons/duotone/index.ts +0 -19
- package/src/icons/light/faAngleDown.ts +0 -15
- package/src/icons/light/faArrowDownShortWide.ts +0 -15
- package/src/icons/light/faArrowDownWideShort.ts +0 -15
- package/src/icons/light/faArrowsToLine.ts +0 -15
- package/src/icons/light/faArrowsUpDown.ts +0 -15
- package/src/icons/light/faBell.ts +0 -15
- package/src/icons/light/faCheck.ts +0 -15
- package/src/icons/light/faClockRotateLeft.ts +0 -15
- package/src/icons/light/faEllipsisVertical.ts +0 -15
- package/src/icons/light/faXmark.ts +0 -15
- package/src/icons/light/index.ts +0 -23
- package/src/icons/regular/faArrowRightArrowLeft.ts +0 -15
- package/src/icons/regular/faCalendar.ts +0 -15
- package/src/icons/regular/faCircleCheck.ts +0 -15
- package/src/icons/regular/faCircleExclamation.ts +0 -15
- package/src/icons/regular/faCircleInfo.ts +0 -15
- package/src/icons/regular/faFileArrowDown.ts +0 -15
- package/src/icons/regular/faFilterCircleXmark.ts +0 -15
- package/src/icons/regular/faTriangleExclamation.ts +0 -15
- package/src/icons/solid/faAngleLeft.ts +0 -15
- package/src/icons/solid/faAngleRight.ts +0 -15
- package/src/icons/solid/faArrowDownWideShort.ts +0 -15
- package/src/icons/solid/faArrowLeft.ts +0 -15
- package/src/icons/solid/faEllipsisVertical.ts +0 -15
- package/src/icons/solid/faFilter.ts +0 -15
- package/src/icons/solid/faGripDotsVertical.ts +0 -15
- package/src/icons/solid/faListUl.ts +0 -15
- package/src/icons/solid/faMagnifyingGlass.ts +0 -15
- package/src/icons/solid/faPrint.ts +0 -15
- package/src/icons/solid/faRotateRight.ts +0 -15
- package/src/icons/solid/faXmark.ts +0 -15
- package/src/styles/App.scss +0 -25
- package/src/styles/iui/common/_animations.scss +0 -56
- package/src/styles/iui/common/_typography.scss +0 -76
- package/src/styles/iui/common/_variables.scss +0 -56
- package/src/styles/iui/common/helpers/_base.scss +0 -32
- package/src/styles/iui/common/helpers/_color.scss +0 -7
- package/src/styles/iui/common/helpers/_display.scss +0 -54
- package/src/styles/iui/common/helpers/_size.scss +0 -17
- package/src/styles/iui/common/maps/_align.scss +0 -24
- package/src/styles/iui/common/maps/_spacing.scss +0 -78
- package/src/styles/iui/components/_accordions.scss +0 -47
- package/src/styles/iui/components/_badge.scss +0 -52
- package/src/styles/iui/components/_card.scss +0 -24
- package/src/styles/iui/components/_dialog.scss +0 -75
- package/src/styles/iui/components/_header.scss +0 -22
- package/src/styles/iui/components/_input.scss +0 -225
- package/src/styles/iui/components/_loader.scss +0 -93
- package/src/styles/iui/components/_menu.scss +0 -44
- package/src/styles/iui/components/_notifications.scss +0 -86
- package/src/styles/iui/components/_page.scss +0 -50
- package/src/styles/iui/components/_pagePrelogin.scss +0 -66
- package/src/styles/iui/components/_portal.scss +0 -8
- package/src/styles/iui/components/_print.scss +0 -92
- package/src/styles/iui/components/_scrollbar.scss +0 -18
- package/src/styles/iui/components/_selectInput.scss +0 -15
- package/src/styles/iui/components/_sidebar.scss +0 -171
- package/src/styles/iui/components/_smallComponents.scss +0 -24
- package/src/styles/iui/components/_table.scss +0 -207
- package/src/styles/iui/components/_tabs.scss +0 -94
- package/src/styles/iui.scss +0 -28
- package/src/styles/red-variables.scss +0 -9
- package/src/types/IBasic.ts +0 -31
- package/src/types/IError.ts +0 -4
- package/src/types/IHeaderAction.ts +0 -12
- package/src/types/ISelect.ts +0 -6
- package/src/types/ISidebar.ts +0 -29
- package/src/types/ITab.ts +0 -10
- package/src/types/ITable.ts +0 -210
- package/src/types/custom.d.ts +0 -9
- package/src/utils/DateUtils.ts +0 -30
- package/src/utils/NumberUtils.ts +0 -21
- package/src/utils/ObjectUtils.ts +0 -49
- package/src/utils/StringUtils.ts +0 -2
- package/src/utils/Toasts.ts +0 -6
- package/src/utils/icons.ts +0 -11
- package/src/utils/index.ts +0 -41
- package/tsconfig.json +0 -20
package/src/styles/iui.scss
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
@import "./iui/common/variables";
|
|
2
|
-
@import "./iui/common/typography";
|
|
3
|
-
@import "./iui/common/animations";
|
|
4
|
-
@import "./iui/common/maps/align";
|
|
5
|
-
@import "./iui/common/maps/spacing";
|
|
6
|
-
@import "./iui/common/helpers/base";
|
|
7
|
-
@import "./iui/common/helpers/color";
|
|
8
|
-
@import "./iui/common/helpers/display";
|
|
9
|
-
@import "./iui/common/helpers/size";
|
|
10
|
-
|
|
11
|
-
@import "./iui/components/accordions";
|
|
12
|
-
@import "./iui/components/badge";
|
|
13
|
-
@import "./iui/components/card";
|
|
14
|
-
@import "./iui/components/dialog";
|
|
15
|
-
@import "./iui/components/header";
|
|
16
|
-
@import "./iui/components/input";
|
|
17
|
-
@import "./iui/components/loader";
|
|
18
|
-
@import "./iui/components/menu";
|
|
19
|
-
@import "./iui/components/notifications";
|
|
20
|
-
@import "./iui/components/page";
|
|
21
|
-
@import "./iui/components/portal";
|
|
22
|
-
@import "./iui/components/print";
|
|
23
|
-
@import "./iui/components/scrollbar";
|
|
24
|
-
@import "./iui/components/selectInput";
|
|
25
|
-
@import "./iui/components/sidebar";
|
|
26
|
-
@import "./iui/components/smallComponents";
|
|
27
|
-
@import "./iui/components/table";
|
|
28
|
-
@import "./iui/components/tabs";
|
package/src/types/IBasic.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export interface IAnyObject {
|
|
2
|
-
[id: string]: any;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export interface IStringObject {
|
|
6
|
-
[id: string]: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface IBooleanObject {
|
|
10
|
-
[id: string]: boolean;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface ISimpleObject {
|
|
14
|
-
uuid: string;
|
|
15
|
-
name: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface ISimpleObjectWithCode extends ISimpleObject {
|
|
19
|
-
code: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface ISimpleObjectWithCodeNew {
|
|
23
|
-
uuid?: string;
|
|
24
|
-
name?: string;
|
|
25
|
-
code?: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface IValueLabel {
|
|
29
|
-
value: any;
|
|
30
|
-
label: string;
|
|
31
|
-
}
|
package/src/types/IError.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IconDefinition, RotateProp } from "@fortawesome/fontawesome-svg-core";
|
|
2
|
-
|
|
3
|
-
export interface IHeaderAction {
|
|
4
|
-
label: string;
|
|
5
|
-
icon?: IconDefinition;
|
|
6
|
-
iconRotation?: RotateProp;
|
|
7
|
-
to?: string;
|
|
8
|
-
onClick?: () => void;
|
|
9
|
-
primary?: boolean;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
hidden?: boolean;
|
|
12
|
-
}
|
package/src/types/ISelect.ts
DELETED
package/src/types/ISidebar.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { IconDefinition } from "@fortawesome/fontawesome-svg-core";
|
|
2
|
-
|
|
3
|
-
export interface ISidebarItem {
|
|
4
|
-
label: string;
|
|
5
|
-
icon: IconDefinition;
|
|
6
|
-
to?: string;
|
|
7
|
-
content?: ISidebarSubItem[];
|
|
8
|
-
menu?: {
|
|
9
|
-
content: ISidebarSubItem[];
|
|
10
|
-
openedMenu: string;
|
|
11
|
-
setOpenedMenu: (label: string) => void;
|
|
12
|
-
};
|
|
13
|
-
hidden?: boolean;
|
|
14
|
-
badge?: number;
|
|
15
|
-
addUrl?: string;
|
|
16
|
-
collapsed?: boolean;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface ISidebarSubItem {
|
|
20
|
-
label: string;
|
|
21
|
-
to?: string;
|
|
22
|
-
content?: ISidebarItem[];
|
|
23
|
-
hidden?: boolean;
|
|
24
|
-
tooltip?: string;
|
|
25
|
-
badge?: number;
|
|
26
|
-
addUrl?: string;
|
|
27
|
-
primary?: boolean;
|
|
28
|
-
collapsed?: boolean;
|
|
29
|
-
}
|
package/src/types/ITab.ts
DELETED
package/src/types/ITable.ts
DELETED
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Dispatch,
|
|
3
|
-
FunctionComponent,
|
|
4
|
-
MouseEventHandler,
|
|
5
|
-
ReactElement,
|
|
6
|
-
ReactNode,
|
|
7
|
-
RefObject,
|
|
8
|
-
SetStateAction,
|
|
9
|
-
} from 'react';
|
|
10
|
-
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
11
|
-
import { IAnyObject } from './IBasic';
|
|
12
|
-
|
|
13
|
-
export interface ITable {
|
|
14
|
-
columns: ITableColumn[];
|
|
15
|
-
setColumns?: (data: ITableColumn[]) => void;
|
|
16
|
-
firstHeaderRow?: ITableColumn[];
|
|
17
|
-
secondHeaderRow?: ITableColumn[];
|
|
18
|
-
data: ITableDataItem[];
|
|
19
|
-
totals?: ITableDataItem;
|
|
20
|
-
isLoading?: boolean;
|
|
21
|
-
loaderLogo?: string;
|
|
22
|
-
serverSidePagination?: IServerSidePagination;
|
|
23
|
-
customPagination?: {
|
|
24
|
-
defaultLimit?: number;
|
|
25
|
-
customLimit?: number[];
|
|
26
|
-
};
|
|
27
|
-
selectedRowUuid?: string;
|
|
28
|
-
footerAction?: {
|
|
29
|
-
icon?: IconDefinition;
|
|
30
|
-
onClick: () => void;
|
|
31
|
-
};
|
|
32
|
-
headerWrap?: boolean;
|
|
33
|
-
hideFooter?: boolean;
|
|
34
|
-
showLastBorder?: boolean;
|
|
35
|
-
filterData?: ITableFilterData;
|
|
36
|
-
sortData?: ITableSortData;
|
|
37
|
-
printData?: IPrintData;
|
|
38
|
-
additionsalOptions?: ReactNode;
|
|
39
|
-
selectedOptions?: ReactNode;
|
|
40
|
-
translations?: ITableTranslations;
|
|
41
|
-
className?: string;
|
|
42
|
-
editable?: {
|
|
43
|
-
selectedItem: any;
|
|
44
|
-
setSelectedItem: (item: any) => void;
|
|
45
|
-
defaultDataValue?: any;
|
|
46
|
-
EditableRow?: FunctionComponent<ITableEditRow>;
|
|
47
|
-
onSubmit: (data: any, onSubmitCallback?: () => void) => void;
|
|
48
|
-
disabled?: boolean;
|
|
49
|
-
inputFocusRef?: RefObject<any>;
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export interface ITableColumn {
|
|
54
|
-
id: string;
|
|
55
|
-
label?: string;
|
|
56
|
-
align?: 'center' | 'left' | 'right' | 'justify' | undefined;
|
|
57
|
-
hidden?: boolean;
|
|
58
|
-
unavailable?: boolean;
|
|
59
|
-
width?: string;
|
|
60
|
-
minWidth?: string;
|
|
61
|
-
colSpan?: number;
|
|
62
|
-
rowSpan?: number;
|
|
63
|
-
break?: boolean;
|
|
64
|
-
sortOptions?: {
|
|
65
|
-
asc: string;
|
|
66
|
-
desc: string;
|
|
67
|
-
label: string;
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export interface ITableDataItem {
|
|
72
|
-
uuid: string;
|
|
73
|
-
onRowClick?: MouseEventHandler<HTMLTableRowElement>;
|
|
74
|
-
className?: string;
|
|
75
|
-
cells: {
|
|
76
|
-
[id: string]: {
|
|
77
|
-
value: any;
|
|
78
|
-
align?: ITableColumn['align'];
|
|
79
|
-
className?: string;
|
|
80
|
-
onClick?: MouseEventHandler<HTMLTableCellElement>;
|
|
81
|
-
link?: boolean;
|
|
82
|
-
tooltip?: string;
|
|
83
|
-
span?: number;
|
|
84
|
-
unclickable?: boolean;
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
extendable?: {
|
|
88
|
-
element: ReactElement;
|
|
89
|
-
isLoading?: boolean;
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export interface ITableFilterData {
|
|
94
|
-
columns: string[];
|
|
95
|
-
filters: ITableFilter;
|
|
96
|
-
activeFilterNo?: number;
|
|
97
|
-
additionalFilters?: ReactElement;
|
|
98
|
-
search: IAnyObject;
|
|
99
|
-
searchData: IAnyObject;
|
|
100
|
-
setSearchData: (search: IAnyObject) => void;
|
|
101
|
-
onSubmit: (search: IAnyObject) => void;
|
|
102
|
-
resetData?: IAnyObject;
|
|
103
|
-
excludeFromSearch?: string[];
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export interface ITableFilterItem {
|
|
107
|
-
label: string;
|
|
108
|
-
field: ReactElement;
|
|
109
|
-
resetField: () => void;
|
|
110
|
-
}
|
|
111
|
-
export interface ITableFilter {
|
|
112
|
-
[id: string]: ITableFilterItem;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export interface ITableSortData {
|
|
116
|
-
sort: string;
|
|
117
|
-
setSort: (sort: string) => void;
|
|
118
|
-
sortOptions: ITableSort;
|
|
119
|
-
menuSize?: 's' | 'm' | 'l';
|
|
120
|
-
}
|
|
121
|
-
export interface ITableSort {
|
|
122
|
-
[id: string]: {
|
|
123
|
-
label: string;
|
|
124
|
-
asc: string;
|
|
125
|
-
desc: string;
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export interface ITableColumnsData {
|
|
130
|
-
columns: ITableColumn[];
|
|
131
|
-
setColumns: (data: any) => void;
|
|
132
|
-
}
|
|
133
|
-
export interface IPrintData {
|
|
134
|
-
label: string;
|
|
135
|
-
organization?: {
|
|
136
|
-
name?: string;
|
|
137
|
-
taxId?: string;
|
|
138
|
-
registrationNumber?: string;
|
|
139
|
-
jbkjs?: string;
|
|
140
|
-
email?: string;
|
|
141
|
-
};
|
|
142
|
-
filters?: {
|
|
143
|
-
basic?: { label: string; value?: string }[];
|
|
144
|
-
date?: { label: string; from?: string; to?: string }[];
|
|
145
|
-
};
|
|
146
|
-
getPrintData: (pagination: IPagination) => Promise<IAnyObject>;
|
|
147
|
-
formatPrintData: (data: any) => ITableDataItem[];
|
|
148
|
-
saveXlsx?: () => void;
|
|
149
|
-
totals?: ITableDataItem;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export interface IPagination {
|
|
153
|
-
limit: number;
|
|
154
|
-
offset: number;
|
|
155
|
-
}
|
|
156
|
-
export interface IServerSidePagination {
|
|
157
|
-
limit: number;
|
|
158
|
-
offset: number;
|
|
159
|
-
setLimit: Dispatch<SetStateAction<number>>;
|
|
160
|
-
setOffset: Dispatch<SetStateAction<number>>;
|
|
161
|
-
totalRows: number;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export interface ITableEditRow {
|
|
165
|
-
columns: ITableColumn[];
|
|
166
|
-
data: any;
|
|
167
|
-
setData: (data: any) => void;
|
|
168
|
-
item?: any;
|
|
169
|
-
clearItem: () => void;
|
|
170
|
-
defaultDataValue?: any;
|
|
171
|
-
inputFocusRef?: RefObject<any>;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export interface ITableTranslations {
|
|
175
|
-
noDataText?: string;
|
|
176
|
-
pagination?: {
|
|
177
|
-
rowsPerPage: string;
|
|
178
|
-
of: string;
|
|
179
|
-
allResults: string;
|
|
180
|
-
page: string;
|
|
181
|
-
};
|
|
182
|
-
Sort?: string;
|
|
183
|
-
filter?: {
|
|
184
|
-
Filter?: string;
|
|
185
|
-
ResetFilter?: string;
|
|
186
|
-
Search?: string;
|
|
187
|
-
Delete?: string;
|
|
188
|
-
};
|
|
189
|
-
print?: {
|
|
190
|
-
Print?: string;
|
|
191
|
-
PrintExport?: string;
|
|
192
|
-
TaxId?: string;
|
|
193
|
-
RegistrationNumber?: string;
|
|
194
|
-
PrintDate?: string;
|
|
195
|
-
from?: string;
|
|
196
|
-
to?: string;
|
|
197
|
-
SaveXlsx?: string;
|
|
198
|
-
};
|
|
199
|
-
Cancel?: string;
|
|
200
|
-
Confirm?: string;
|
|
201
|
-
columns?: {
|
|
202
|
-
Columns?: string;
|
|
203
|
-
DragDropListsInfo?: string;
|
|
204
|
-
HiddenColumns?: string;
|
|
205
|
-
SelectedColumns?: string;
|
|
206
|
-
};
|
|
207
|
-
editable?: {
|
|
208
|
-
Actions?: string;
|
|
209
|
-
};
|
|
210
|
-
}
|
package/src/types/custom.d.ts
DELETED
package/src/utils/DateUtils.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import moment from 'moment/moment';
|
|
2
|
-
|
|
3
|
-
export const formatDate = (date?: string) =>
|
|
4
|
-
date ? moment(date).format(`DD.MM.YYYY.`) : '/';
|
|
5
|
-
export const formatDateYMD = (date: string | Date) => moment(date).format(`yyyy-MM-DD`);
|
|
6
|
-
|
|
7
|
-
export const formatDateAndTime = (date?: string, withSeconds?: boolean) =>
|
|
8
|
-
date ? moment(date).format(`DD.MM.YYYY. HH:mm${withSeconds ? ':ss' : ''}`) : '/';
|
|
9
|
-
|
|
10
|
-
export const formatTime = (date?: string, withSeconds?: boolean) =>
|
|
11
|
-
date ? moment(date).format(`HH:mm${withSeconds ? ':ss' : ''}`) : '/';
|
|
12
|
-
|
|
13
|
-
export const dateAddDays = (date: string, addDays: number) =>
|
|
14
|
-
moment(date).add(addDays, 'days').toISOString();
|
|
15
|
-
|
|
16
|
-
export const checkIfExpired = (date?: string) =>
|
|
17
|
-
date ? moment(new Date()) > moment(date) : true;
|
|
18
|
-
|
|
19
|
-
export const getCurrentDateFormatted = () => moment().format('DD.MM.YYYY.').toString();
|
|
20
|
-
export const getCurrentDateFormattedYMD = () => moment().format('yyyy-MM-DD').toString();
|
|
21
|
-
|
|
22
|
-
export const getDaysLeft = (date?: string) => moment(date).diff(new Date(), 'days');
|
|
23
|
-
|
|
24
|
-
export const formatYearMonth = (year: number, month: number) =>
|
|
25
|
-
`${year}-${month < 10 ? `0${month}` : month}`;
|
|
26
|
-
|
|
27
|
-
// export const getDayInputRegex = (max: number) =>
|
|
28
|
-
// `(0[1-9]|1[0-9]|2[0-${max === 28 ? "8" : "9"}]${
|
|
29
|
-
// max > 29 && `|3[0${max > 30 && "-1"}]`
|
|
30
|
-
// })`;
|
package/src/utils/NumberUtils.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// export const toNumberOrZero = (value?: string | number) => (!!value ? +value : 0);
|
|
2
|
-
|
|
3
|
-
export const formatCurrency = (
|
|
4
|
-
number?: string | number,
|
|
5
|
-
minimumFractionDigits?: number,
|
|
6
|
-
maximumFractionDigits?: number
|
|
7
|
-
) =>
|
|
8
|
-
Number(number || 0).toLocaleString('sr-RS', {
|
|
9
|
-
minimumFractionDigits: minimumFractionDigits || 2,
|
|
10
|
-
maximumFractionDigits: maximumFractionDigits || 2,
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
export const formatCurrencyNoDecimals = (number?: string | number) =>
|
|
14
|
-
// number?.toString().replace(',', '.') || 0;
|
|
15
|
-
Number(number || 0).toLocaleString('sr-RS');
|
|
16
|
-
|
|
17
|
-
// export const formatDecimalNumber = (number?: string | number) =>
|
|
18
|
-
// number?.toString().replace('.', ',') || 0;
|
|
19
|
-
|
|
20
|
-
// export const roundTwoDecimals = (value?: string | number) =>
|
|
21
|
-
// !!value ? Math.round(+value * 100) / 100 : 0;
|
package/src/utils/ObjectUtils.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { IAnyObject } from "../types/IBasic";
|
|
2
|
-
import { ITableColumn } from "../types/ITable";
|
|
3
|
-
|
|
4
|
-
export const deleteProps = (obj: any, props: string[]) => {
|
|
5
|
-
let newObj = { ...obj };
|
|
6
|
-
props.forEach((e) => delete newObj[e]);
|
|
7
|
-
return newObj;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const deleteEmptyProps = (obj: IAnyObject) =>
|
|
11
|
-
Object.entries(obj).reduce(
|
|
12
|
-
(a: any, [k, v]) =>
|
|
13
|
-
[null, undefined, ""].includes(v) ? a : ((a[k] = v), a),
|
|
14
|
-
{}
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
export const deleteEmptyPropsIncludingArray = (obj: IAnyObject) =>
|
|
18
|
-
Object.entries(obj).reduce(
|
|
19
|
-
(a: any, [k, v]) =>
|
|
20
|
-
[null, undefined, ""].includes(v) || (Array.isArray(v) && !v.length)
|
|
21
|
-
? a
|
|
22
|
-
: ((a[k] = v), a),
|
|
23
|
-
{}
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
export const getActiveFilterNumber = (obj: any) => Object.keys(obj).length;
|
|
27
|
-
|
|
28
|
-
export const getPrintColumns = (tableCols: ITableColumn[]) =>
|
|
29
|
-
tableCols.reduce(
|
|
30
|
-
(arr: string[], col) =>
|
|
31
|
-
col.hidden || col.unavailable ? arr : arr.concat(col.id),
|
|
32
|
-
[]
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
export const getVisibleColumnsIds = (
|
|
36
|
-
tableCols: ITableColumn[],
|
|
37
|
-
isPrint?: boolean
|
|
38
|
-
) =>
|
|
39
|
-
tableCols.reduce(
|
|
40
|
-
(arr: string[], col) =>
|
|
41
|
-
col.hidden ||
|
|
42
|
-
col.unavailable ||
|
|
43
|
-
(isPrint && ["select", "icons", "actions"].includes(col.id))
|
|
44
|
-
? arr
|
|
45
|
-
: arr.concat(col.id),
|
|
46
|
-
[]
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
export const deepCopy = (el: any[] | object) => JSON.parse(JSON.stringify(el));
|
package/src/utils/StringUtils.ts
DELETED
package/src/utils/Toasts.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { toast } from "react-toastify";
|
|
2
|
-
|
|
3
|
-
export const toastSuccess = (message: string) => toast.success(message);
|
|
4
|
-
export const toastError = (message: string) => toast.error(message, { autoClose: false });
|
|
5
|
-
// export const toastInfo = (message: string) => toast.info(message);
|
|
6
|
-
// export const toastWarn = (message: string) => toast.warn(message);
|
package/src/utils/icons.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { faCircleCheck } from "../icons/regular/faCircleCheck";
|
|
2
|
-
import { faCircleExclamation } from "../icons/regular/faCircleExclamation";
|
|
3
|
-
import { faCircleInfo } from "../icons/regular/faCircleInfo";
|
|
4
|
-
import { faTriangleExclamation } from "../icons/regular/faTriangleExclamation";
|
|
5
|
-
|
|
6
|
-
export const infoIcons = {
|
|
7
|
-
error: faCircleExclamation,
|
|
8
|
-
success: faCircleCheck,
|
|
9
|
-
info: faCircleInfo,
|
|
10
|
-
warning: faTriangleExclamation,
|
|
11
|
-
};
|
package/src/utils/index.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
checkIfExpired,
|
|
3
|
-
dateAddDays,
|
|
4
|
-
formatDate,
|
|
5
|
-
formatDateAndTime,
|
|
6
|
-
formatTime,
|
|
7
|
-
formatYearMonth,
|
|
8
|
-
getCurrentDateFormattedYMD,
|
|
9
|
-
getDaysLeft,
|
|
10
|
-
} from "./DateUtils";
|
|
11
|
-
import { formatCurrency, formatCurrencyNoDecimals } from "./NumberUtils";
|
|
12
|
-
import {
|
|
13
|
-
deleteEmptyProps,
|
|
14
|
-
deleteEmptyPropsIncludingArray,
|
|
15
|
-
deleteProps,
|
|
16
|
-
getActiveFilterNumber,
|
|
17
|
-
getVisibleColumnsIds,
|
|
18
|
-
} from "./ObjectUtils";
|
|
19
|
-
import { maxChar } from "./StringUtils";
|
|
20
|
-
|
|
21
|
-
export {
|
|
22
|
-
checkIfExpired,
|
|
23
|
-
dateAddDays,
|
|
24
|
-
formatDate,
|
|
25
|
-
formatDateAndTime,
|
|
26
|
-
formatTime,
|
|
27
|
-
formatYearMonth,
|
|
28
|
-
getCurrentDateFormattedYMD,
|
|
29
|
-
getDaysLeft,
|
|
30
|
-
formatCurrency,
|
|
31
|
-
formatCurrencyNoDecimals,
|
|
32
|
-
deleteEmptyProps,
|
|
33
|
-
deleteEmptyPropsIncludingArray,
|
|
34
|
-
deleteProps,
|
|
35
|
-
getActiveFilterNumber,
|
|
36
|
-
getVisibleColumnsIds,
|
|
37
|
-
// apiResponseHandler,
|
|
38
|
-
// toastError,
|
|
39
|
-
// toastSuccess,
|
|
40
|
-
maxChar,
|
|
41
|
-
};
|
package/tsconfig.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "esnext",
|
|
4
|
-
"module": "esnext",
|
|
5
|
-
"strict": true,
|
|
6
|
-
"esModuleInterop": true,
|
|
7
|
-
"jsx": "react-jsx",
|
|
8
|
-
"rootDir": "src",
|
|
9
|
-
"outDir": "dist",
|
|
10
|
-
"sourceMap": true,
|
|
11
|
-
"moduleResolution": "node",
|
|
12
|
-
"forceConsistentCasingInFileNames": true,
|
|
13
|
-
"skipLibCheck": true,
|
|
14
|
-
"emitDeclarationOnly": true,
|
|
15
|
-
"declaration": true,
|
|
16
|
-
"declarationDir": "dist/types"
|
|
17
|
-
},
|
|
18
|
-
"include": ["src"],
|
|
19
|
-
"exclude": ["node_modules"]
|
|
20
|
-
}
|