@dilicorp/ui 0.0.68 → 0.0.69
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/atoms/button.d.ts +1 -0
- package/dist/atoms/button.d.ts.map +1 -1
- package/dist/atoms/button.js +2 -2
- package/dist/components/page-list/column-management-components/button-config.d.ts +6 -2
- package/dist/components/page-list/column-management-components/button-config.d.ts.map +1 -1
- package/dist/components/page-list/column-management-components/button-config.js +14 -9
- package/dist/components/page-list/page-limit/page-limit.d.ts +10 -0
- package/dist/components/page-list/page-limit/page-limit.d.ts.map +1 -0
- package/dist/components/page-list/page-limit/page-limit.js +8 -0
- package/dist/components/page-list/page-list-get-filters.d.ts +7 -0
- package/dist/components/page-list/page-list-get-filters.d.ts.map +1 -1
- package/dist/components/page-list/page-list-get-filters.js +10 -2
- package/dist/components/page-list/page-list.d.ts +4 -1
- package/dist/components/page-list/page-list.d.ts.map +1 -1
- package/dist/components/page-list/page-list.js +2 -2
- package/dist/components/page-show/page-show.d.ts +7 -0
- package/dist/components/page-show/page-show.d.ts.map +1 -1
- package/dist/components/page-show/page-show.js +10 -5
- package/dist/components/side-navigation-bar/side-navigation-bar.d.ts.map +1 -1
- package/dist/components/side-navigation-bar/side-navigation-bar.js +19 -17
- package/dist/molecules/dropdown/dropdown-item.d.ts +8 -1
- package/dist/molecules/dropdown/dropdown-item.d.ts.map +1 -1
- package/dist/molecules/dropdown/dropdown-item.js +2 -0
- package/package.json +1 -1
package/dist/atoms/button.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export declare type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
10
10
|
innerRef?: React.Ref<HTMLButtonElement>;
|
|
11
11
|
href?: string;
|
|
12
12
|
'aria-label'?: string;
|
|
13
|
+
target?: string;
|
|
13
14
|
};
|
|
14
15
|
export declare const Button: React.FC<ButtonProps>;
|
|
15
16
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/atoms/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAGnD,oBAAY,WAAW,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IAClE,KAAK,CAAC,EAAE,SAAS,GAAC,WAAW,GAAC,SAAS,GAAC,QAAQ,GAAC,MAAM,GAAC,SAAS,GAAC,SAAS,CAAA;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,GAAG,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;IACvC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/atoms/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAGnD,oBAAY,WAAW,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IAClE,KAAK,CAAC,EAAE,SAAS,GAAC,WAAW,GAAC,SAAS,GAAC,QAAQ,GAAC,MAAM,GAAC,SAAS,GAAC,SAAS,CAAA;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,GAAG,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;IACvC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAqDxC,CAAA"}
|
package/dist/atoms/button.js
CHANGED
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
export const Button = (_a) => {
|
|
15
|
-
var { children, active, block, className, color = 'primary', disabled, small = false, href, outline, innerRef, 'aria-label': ariaLabel } = _a, props = __rest(_a, ["children", "active", "block", "className", "color", "disabled", "small", "href", "outline", "innerRef", 'aria-label']);
|
|
15
|
+
var { children, active, block, className, color = 'primary', disabled, small = false, href, outline, innerRef, target, 'aria-label': ariaLabel } = _a, props = __rest(_a, ["children", "active", "block", "className", "color", "disabled", "small", "href", "outline", "innerRef", "target", 'aria-label']);
|
|
16
16
|
let { tag: Tag = 'button' } = props;
|
|
17
17
|
const handleClick = (e) => {
|
|
18
18
|
if (disabled) {
|
|
@@ -27,5 +27,5 @@ export const Button = (_a) => {
|
|
|
27
27
|
if (href && Tag === 'button') {
|
|
28
28
|
Tag = 'a';
|
|
29
29
|
}
|
|
30
|
-
return (React.createElement(Tag, Object.assign({}, (Tag === 'button' && props.onClick && { type: 'button' }), props, (href && { href }), { className: classes, ref: innerRef, onClick: handleClick, "aria-label": ariaLabel }), children));
|
|
30
|
+
return (React.createElement(Tag, Object.assign({}, (Tag === 'button' && props.onClick && { type: 'button' }), props, (href && { href }), (target && { target }), { className: classes, ref: innerRef, onClick: handleClick, "aria-label": ariaLabel }), children));
|
|
31
31
|
};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
declare type Item = {
|
|
3
|
+
label: string;
|
|
4
|
+
onClick?: () => void;
|
|
5
|
+
};
|
|
6
|
+
declare type ItemProps = Item | React.ReactElement;
|
|
2
7
|
declare type Props = {
|
|
3
|
-
|
|
8
|
+
items?: ItemProps[];
|
|
4
9
|
className?: string;
|
|
5
10
|
show?: boolean;
|
|
6
|
-
onClick?: () => void;
|
|
7
11
|
};
|
|
8
12
|
export declare const ButtonConfig: React.FC<Props>;
|
|
9
13
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-config.d.ts","sourceRoot":"","sources":["../../../../src/components/page-list/column-management-components/button-config.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,aAAK,
|
|
1
|
+
{"version":3,"file":"button-config.d.ts","sourceRoot":"","sources":["../../../../src/components/page-list/column-management-components/button-config.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,aAAK,IAAI,GAAG;IACV,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,aAAK,SAAS,GAAG,IAAI,GAAG,KAAK,CAAC,YAAY,CAAA;AAE1C,aAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,SAAS,EAAE,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAiCxC,CAAA"}
|
|
@@ -3,15 +3,20 @@ import classNames from 'classnames';
|
|
|
3
3
|
import { Icon } from '../../../atoms/icon';
|
|
4
4
|
import { Dropdown } from '../../../molecules/dropdown/dropdown';
|
|
5
5
|
export const ButtonConfig = (props) => {
|
|
6
|
-
const { className,
|
|
6
|
+
const { className, items, show = true } = props;
|
|
7
7
|
const classes = classNames(className, show ? 'd-inline-block' : 'd-none', 'btn btn-default mb-3 ms-3');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
const remap = items === null || items === void 0 ? void 0 : items.map(item => {
|
|
9
|
+
if (React.isValidElement(item))
|
|
10
|
+
return { element: item };
|
|
11
|
+
return {
|
|
12
|
+
label: item.label,
|
|
13
|
+
onClick: () => {
|
|
14
|
+
if (item.onClick)
|
|
15
|
+
item.onClick();
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
console.log('items', items);
|
|
20
|
+
console.log('remap', remap);
|
|
21
|
+
return (React.createElement(Dropdown, { tag: 'div', color: "default", className: classes, align: "right", label: React.createElement(Icon, { icon: "faCog" }), items: remap || [] }));
|
|
17
22
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type PageLimitProps = {
|
|
3
|
+
onChange: (newValue: number) => void;
|
|
4
|
+
label?: string;
|
|
5
|
+
limit?: number;
|
|
6
|
+
options?: number[];
|
|
7
|
+
divider?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const PageLimit: ({ label, options, limit, onChange, divider }: PageLimitProps) => JSX.Element;
|
|
10
|
+
//# sourceMappingURL=page-limit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-limit.d.ts","sourceRoot":"","sources":["../../../../src/components/page-list/page-limit/page-limit.tsx"],"names":[],"mappings":";AAEA,oBAAY,cAAc,GAAG;IACzB,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,SAAS,iDAA8F,cAAc,gBAajI,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export const PageLimit = ({ label = 'Items per page', options = [10, 20, 50, 100], limit = 20, onChange, divider }) => {
|
|
3
|
+
return (React.createElement(React.Fragment, null,
|
|
4
|
+
divider && React.createElement("div", { className: "dropdown-divider" }),
|
|
5
|
+
React.createElement("div", { style: { display: 'flex', flexDirection: 'column', padding: '.25rem 1rem' } },
|
|
6
|
+
React.createElement("p", null, label),
|
|
7
|
+
React.createElement("select", { className: 'form-control', name: "items_per_page", id: "items_per_page", onChange: (value) => onChange(Number(value.target.value)) }, options.map(opt => React.createElement("option", { selected: opt === limit, value: opt }, opt))))));
|
|
8
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { PageLimitProps } from './page-limit/page-limit';
|
|
2
3
|
declare type Item = {
|
|
3
4
|
id: string;
|
|
4
5
|
title: string;
|
|
@@ -27,7 +28,13 @@ declare type PageListGetFiltersProps = {
|
|
|
27
28
|
};
|
|
28
29
|
numFiltersVisible?: number;
|
|
29
30
|
columnManagement?: ColumnManagementProps;
|
|
31
|
+
pageLimit?: PageLimitProps;
|
|
32
|
+
configItems?: ConfigItemProps[];
|
|
30
33
|
};
|
|
34
|
+
export declare type ConfigItemProps = {
|
|
35
|
+
label: string;
|
|
36
|
+
onClick?: () => void;
|
|
37
|
+
} | React.ReactElement;
|
|
31
38
|
export declare const PageListGetFilters: React.FC<PageListGetFiltersProps>;
|
|
32
39
|
export {};
|
|
33
40
|
//# sourceMappingURL=page-list-get-filters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-list-get-filters.d.ts","sourceRoot":"","sources":["../../../src/components/page-list/page-list-get-filters.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"page-list-get-filters.d.ts","sourceRoot":"","sources":["../../../src/components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,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA+FhE,CAAA"}
|
|
@@ -10,6 +10,7 @@ import { Button } from '../../atoms/button';
|
|
|
10
10
|
import { ButtonConfig } from './column-management-components/button-config';
|
|
11
11
|
import { Alert } from '../../molecules/alert';
|
|
12
12
|
import { ModalConfig } from './column-management-components/modal-config';
|
|
13
|
+
import { PageLimit } from './page-limit/page-limit';
|
|
13
14
|
const setValue = (element, value) => {
|
|
14
15
|
return Object.assign(Object.assign({}, element), { props: Object.assign(Object.assign({}, element.props), { value: value }) });
|
|
15
16
|
};
|
|
@@ -18,7 +19,7 @@ export const PageListGetFilters = (props) => {
|
|
|
18
19
|
filterLabel: 'Filters',
|
|
19
20
|
submitLabel: 'Filter',
|
|
20
21
|
clearLabel: 'Clear'
|
|
21
|
-
}, columnManagement } = props;
|
|
22
|
+
}, columnManagement, pageLimit, configItems } = props;
|
|
22
23
|
const filters = filterList === null || filterList === void 0 ? void 0 : filterList.props.children;
|
|
23
24
|
if (!filterList)
|
|
24
25
|
return null;
|
|
@@ -30,6 +31,13 @@ export const PageListGetFilters = (props) => {
|
|
|
30
31
|
open: () => { var _a; return (_a = modal === null || modal === void 0 ? void 0 : modal.current) === null || _a === void 0 ? void 0 : _a.open(); },
|
|
31
32
|
close: () => { var _a; return (_a = modal === null || modal === void 0 ? void 0 : modal.current) === null || _a === void 0 ? void 0 : _a.close(); },
|
|
32
33
|
};
|
|
34
|
+
const configurationList = [];
|
|
35
|
+
if (columnManagement)
|
|
36
|
+
configurationList.push({ label: columnManagement.title, onClick: () => modalActions.open() });
|
|
37
|
+
if (configItems)
|
|
38
|
+
configurationList.push(...configItems);
|
|
39
|
+
if (pageLimit)
|
|
40
|
+
configurationList.push(React.createElement(PageLimit, Object.assign({}, pageLimit, { divider: configurationList.length > 0 })));
|
|
33
41
|
return (React.createElement(React.Fragment, null,
|
|
34
42
|
React.createElement(FilterForm, { search: search },
|
|
35
43
|
React.createElement(Row, null,
|
|
@@ -41,7 +49,7 @@ export const PageListGetFilters = (props) => {
|
|
|
41
49
|
React.createElement(ButtonFilter, { submitLabel: filter.submitLabel, className: "me-3" }),
|
|
42
50
|
React.createElement(ButtonFilterClear, { clearLabel: filter.clearLabel, className: "me-3", search: search }),
|
|
43
51
|
Boolean(hidden.length) && React.createElement(ButtonFilters, { show: showFilter, setShow: setShowFilter, filterLabel: filter.filterLabel }),
|
|
44
|
-
|
|
52
|
+
configurationList.length > 0 && React.createElement(ButtonConfig, { items: configurationList }))))),
|
|
45
53
|
Boolean(hidden.length) && (React.createElement("div", { className: `aside-filter ${showFilter ? 'in' : ''}` },
|
|
46
54
|
React.createElement("div", { className: "mb-3 text-right" },
|
|
47
55
|
React.createElement(Button, { color: "primary", outline: showFilter, onClick: () => setShowFilter(prev => !prev), small: true },
|
|
@@ -2,7 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { ButtonProps } from '../../atoms/button';
|
|
3
3
|
import { IconProps } from '../../atoms/icon';
|
|
4
4
|
import { DropdownItemProps } from '../../molecules/dropdown/dropdown-item';
|
|
5
|
-
import { ColumnManagementProps } from './page-list-get-filters';
|
|
5
|
+
import { ColumnManagementProps, ConfigItemProps } from './page-list-get-filters';
|
|
6
|
+
import { PageLimitProps } from './page-limit/page-limit';
|
|
6
7
|
declare type BtnProps = {
|
|
7
8
|
uri: string;
|
|
8
9
|
label: string;
|
|
@@ -42,6 +43,8 @@ export declare type PageListProps = ChildrenProps & {
|
|
|
42
43
|
metaTranslate?: string;
|
|
43
44
|
columnManagement?: ColumnManagementProps;
|
|
44
45
|
extraButtonsInline?: ExportButtonProps[];
|
|
46
|
+
pageLimit?: PageLimitProps;
|
|
47
|
+
configItems?: ConfigItemProps[];
|
|
45
48
|
};
|
|
46
49
|
export declare const PageList: React.FC<PageListProps>;
|
|
47
50
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-list.d.ts","sourceRoot":"","sources":["../../../src/components/page-list/page-list.tsx"],"names":[],"mappings":"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AS,CAAC,EAAE,QAAQ,CAAC;IACrB,YAAY,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAClC,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACjC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA;IACD,IAAI,CAAC,EAAE;QACL,YAAY,EAAE,MAAM,CAAA;QACpB,QAAQ,EAAE,MAAM,CAAA;QAChB,KAAK,EAAE,MAAM,CAAA;QACb,EAAE,EAAE,MAAM,CAAA;QACV,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;IACD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,qBAAqB,CAAA;IACxC,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAA;IACxC,SAAS,CAAC,EAAE,cAAc,CAAA;IAC1B,WAAW,CAAC,EAAE,eAAe,EAAE,CAAA;CAChC,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAiG5C,CAAA"}
|
|
@@ -12,7 +12,7 @@ import uriHelper from '../../utils/uri-helper';
|
|
|
12
12
|
import { PageListGetFilters } from './page-list-get-filters';
|
|
13
13
|
import { Spinner } from '../../atoms/spinner';
|
|
14
14
|
export const PageList = (props) => {
|
|
15
|
-
const { title, addButton, extraButtons = [], meta, filter, customizeFilter, loading = false, metaTranslate = '%1 out of %2 records', columnManagement, extraButtonsInline = [], children } = props;
|
|
15
|
+
const { title, addButton, extraButtons = [], meta, filter, customizeFilter, loading = false, metaTranslate = '%1 out of %2 records', columnManagement, extraButtonsInline = [], pageLimit, configItems, children } = props;
|
|
16
16
|
const totalRecords = (meta === null || meta === void 0 ? void 0 : meta.to) ? (meta.to - meta.from) + 1 : 0;
|
|
17
17
|
const history = useLocation();
|
|
18
18
|
const search = uriHelper.parse(history.search);
|
|
@@ -37,7 +37,7 @@ export const PageList = (props) => {
|
|
|
37
37
|
React.createElement(Icon, { icon: "faPlus", className: "me-1" }), addButton === null || addButton === void 0 ? void 0 :
|
|
38
38
|
addButton.label))))),
|
|
39
39
|
!!customizeFilter && customizeFilter,
|
|
40
|
-
!customizeFilter && filterList && (React.createElement(PageListGetFilters, { filterList: filterList, search: search, filter: filter, key: JSON.stringify(history), columnManagement: columnManagement })),
|
|
40
|
+
!customizeFilter && filterList && (React.createElement(PageListGetFilters, { filterList: filterList, search: search, filter: filter, key: JSON.stringify(history), columnManagement: columnManagement, pageLimit: pageLimit, configItems: configItems })),
|
|
41
41
|
React.createElement("div", null, restList),
|
|
42
42
|
meta && React.createElement(Paginate, { activePage: meta.current_page, perPage: meta.per_page, totalItems: meta.total, from: meta.from, to: meta.to, currentCount: totalRecords, translate: metaTranslate })));
|
|
43
43
|
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ButtonProps, IconProps } from '../../';
|
|
2
3
|
import { DropdownItemProps } from '../../molecules/dropdown/dropdown-item';
|
|
4
|
+
declare type ExtraButtonsInlineProps = ButtonProps & {
|
|
5
|
+
label?: string;
|
|
6
|
+
icon?: IconProps;
|
|
7
|
+
};
|
|
3
8
|
export declare type PageShowProps = {
|
|
4
9
|
children: React.ReactNode;
|
|
5
10
|
title: string | React.ReactNode;
|
|
@@ -9,6 +14,8 @@ export declare type PageShowProps = {
|
|
|
9
14
|
uri: string;
|
|
10
15
|
label: string;
|
|
11
16
|
};
|
|
17
|
+
extraButtonsInline?: ExtraButtonsInlineProps[];
|
|
12
18
|
};
|
|
13
19
|
export declare const PageShow: React.FC<PageShowProps>;
|
|
20
|
+
export {};
|
|
14
21
|
//# sourceMappingURL=page-show.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-show.d.ts","sourceRoot":"","sources":["../../../src/components/page-show/page-show.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"page-show.d.ts","sourceRoot":"","sources":["../../../src/components/page-show/page-show.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAU,WAAW,EAAuB,SAAS,EAA6C,MAAM,QAAQ,CAAA;AACvH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAE1E,aAAK,uBAAuB,GAAG,WAAW,GAAG;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAAA;AAED,oBAAY,aAAa,GAAG;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;IAC/B,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAClC,UAAU,CAAC,EAAE;QACX,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,kBAAkB,CAAC,EAAE,uBAAuB,EAAE,CAAA;CAC/C,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAyD5C,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button, Col, Dropdown, Icon, Link, Row, Separator, Spinner, Typography } from '../../';
|
|
3
3
|
export const PageShow = (props) => {
|
|
4
|
-
const { loading = true, children, extraButtons = [], backButton, title } = props;
|
|
4
|
+
const { loading = true, children, extraButtons = [], backButton, title, extraButtonsInline = [], } = props;
|
|
5
5
|
if (loading)
|
|
6
6
|
return React.createElement(Spinner, null);
|
|
7
7
|
return (React.createElement("div", null,
|
|
@@ -9,10 +9,15 @@ export const PageShow = (props) => {
|
|
|
9
9
|
React.createElement(Col, null,
|
|
10
10
|
React.createElement(Typography, { lineBottom: true, variant: "h4", tag: "h1" }, title)),
|
|
11
11
|
React.createElement(Col, { className: "ms-auto" },
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
React.createElement("div", { className: 'extra-buttons-container' },
|
|
13
|
+
Boolean(extraButtons.length) && (React.createElement(Dropdown, { color: "default", className: "me-2", align: "right", label: React.createElement(Icon, { icon: "faEllipsisH" }), items: extraButtons })),
|
|
14
|
+
Boolean(extraButtonsInline.length) &&
|
|
15
|
+
extraButtonsInline.map((item, index) => (React.createElement(Button, Object.assign({ key: `export-button-${index}` }, item),
|
|
16
|
+
item.label,
|
|
17
|
+
item.icon && React.createElement(Icon, Object.assign({}, item.icon))))),
|
|
18
|
+
Boolean(backButton) && (React.createElement(Button, { tag: Link, href: backButton === null || backButton === void 0 ? void 0 : backButton.uri, color: "danger" },
|
|
19
|
+
React.createElement(Icon, { icon: "faAngleLeft", className: "me-1" }), backButton === null || backButton === void 0 ? void 0 :
|
|
20
|
+
backButton.label))))),
|
|
16
21
|
React.createElement(Separator, null),
|
|
17
22
|
children));
|
|
18
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"side-navigation-bar.d.ts","sourceRoot":"","sources":["../../../src/components/side-navigation-bar/side-navigation-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"side-navigation-bar.d.ts","sourceRoot":"","sources":["../../../src/components/side-navigation-bar/side-navigation-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyE,MAAM,OAAO,CAAA;AAC7F,OAAO,EAAyB,0BAA0B,EAAE,MAAM,4BAA4B,CAAA;AAI9F,oBAAY,sBAAsB,GAAG;IACnC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE;QACP,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;IACD,KAAK,EAAE,0BAA0B,EAAE,CAAA;IACnC,MAAM,EAAE,OAAO,CAAA;CAChB,CAAA;AAiCD,eAAO,MAAM,iBAAiB,oCAAgB,sBAAsB,iBAqElE,CAAA"}
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
import React, { memo, useEffect, useRef, useState } from 'react';
|
|
1
|
+
import React, { memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { SideNavigationBarItem } from './side-navigation-bar-item';
|
|
3
3
|
import { Icon } from '../../atoms/icon';
|
|
4
4
|
import { storageHelper } from '../../index';
|
|
5
5
|
const STORAGE_NAME = 'SIDEBAR_ACTIVE';
|
|
6
6
|
const useOutsideClick = (ref) => {
|
|
7
7
|
const [data, setData] = useState({ isClicked: false, isLink: false });
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
23
|
-
}
|
|
8
|
+
const handleClickOutside = useCallback((event) => {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
const isLink = ((_b = (_a = event.target) === null || _a === void 0 ? void 0 : _a.attributes['data-link']) === null || _b === void 0 ? void 0 : _b.value) === 'link';
|
|
11
|
+
if (ref.current && !ref.current.contains(event.target)) {
|
|
12
|
+
setData({
|
|
13
|
+
isLink,
|
|
14
|
+
isClicked: true
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
setData({
|
|
19
|
+
isLink,
|
|
20
|
+
isClicked: false
|
|
21
|
+
});
|
|
24
22
|
}
|
|
23
|
+
}, []);
|
|
24
|
+
useEffect(() => {
|
|
25
25
|
document.addEventListener("mousedown", handleClickOutside);
|
|
26
|
+
document.addEventListener("touchstart", handleClickOutside);
|
|
26
27
|
return () => {
|
|
27
28
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
29
|
+
document.removeEventListener("touchstart", handleClickOutside);
|
|
28
30
|
};
|
|
29
31
|
}, [ref]);
|
|
30
32
|
return Object.assign({}, data);
|
|
@@ -5,9 +5,11 @@ interface DropdownItemBaseProps {
|
|
|
5
5
|
uri: string;
|
|
6
6
|
target?: '_self' | '_blank';
|
|
7
7
|
onClick?: any;
|
|
8
|
+
element?: React.ReactElement;
|
|
8
9
|
}
|
|
9
10
|
interface DropdownSeparatorProps {
|
|
10
11
|
separator?: true;
|
|
12
|
+
element?: React.ReactElement;
|
|
11
13
|
}
|
|
12
14
|
interface DropdownOnClickProps {
|
|
13
15
|
separator?: false;
|
|
@@ -15,8 +17,13 @@ interface DropdownOnClickProps {
|
|
|
15
17
|
uri?: string;
|
|
16
18
|
target?: '_self' | '_blank';
|
|
17
19
|
onClick: () => void;
|
|
20
|
+
element?: React.ReactElement;
|
|
18
21
|
}
|
|
19
|
-
|
|
22
|
+
interface DropdownElementProps {
|
|
23
|
+
separator?: true;
|
|
24
|
+
element?: React.ReactElement;
|
|
25
|
+
}
|
|
26
|
+
export declare type DropdownItemProps = DropdownItemBaseProps | DropdownSeparatorProps | DropdownOnClickProps | DropdownElementProps;
|
|
20
27
|
export declare const DropdownItem: React.FC<DropdownItemProps>;
|
|
21
28
|
export {};
|
|
22
29
|
//# sourceMappingURL=dropdown-item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-item.d.ts","sourceRoot":"","sources":["../../../src/molecules/dropdown/dropdown-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,UAAU,qBAAqB;IAC7B,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"dropdown-item.d.ts","sourceRoot":"","sources":["../../../src/molecules/dropdown/dropdown-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,UAAU,qBAAqB;IAC7B,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IAC3B,OAAO,CAAC,EAAE,GAAG,CAAA;IACb,OAAO,CAAC,EAAE,KAAK,CAAC,YAAY,CAAA;CAC7B;AAED,UAAU,sBAAsB;IAC9B,SAAS,CAAC,EAAE,IAAI,CAAA;IAChB,OAAO,CAAC,EAAE,KAAK,CAAC,YAAY,CAAA;CAC7B;AAED,UAAU,oBAAoB;IAC5B,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,OAAO,CAAC,EAAE,KAAK,CAAC,YAAY,CAAA;CAC7B;AAED,UAAU,oBAAoB;IAC5B,SAAS,CAAC,EAAE,IAAI,CAAA;IAChB,OAAO,CAAC,EAAE,KAAK,CAAC,YAAY,CAAA;CAC7B;AAED,oBAAY,iBAAiB,GAAG,qBAAqB,GAAG,sBAAsB,GAAG,oBAAoB,GAAG,oBAAoB,CAAA;AAE5H,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAapD,CAAA"}
|
|
@@ -12,6 +12,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { Link } from '../../atoms/link';
|
|
14
14
|
export const DropdownItem = (props) => {
|
|
15
|
+
if (React.isValidElement(props.element))
|
|
16
|
+
return React.createElement(React.Fragment, null, props.element);
|
|
15
17
|
if (props.separator)
|
|
16
18
|
return React.createElement("div", { className: "dropdown-divider" });
|
|
17
19
|
const _a = props, { uri, label, onClick } = _a, attrs = __rest(_a, ["uri", "label", "onClick"]);
|