@luscii-healthtech/web-ui 2.58.0 → 2.58.1
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/components/Page/CRUDPage.d.ts +1 -19
- package/dist/components/Page/CRUDPage.types.d.ts +30 -0
- package/dist/components/Page/index.d.ts +3 -0
- package/dist/components/PageHeader/PageHeader.d.ts +3 -11
- package/dist/components/PageHeader/PageHeader.types.d.ts +13 -0
- package/dist/components/PageHeader/index.d.ts +2 -0
- package/dist/index.d.ts +2 -3
- package/dist/web-ui-tailwind.css +12 -4
- package/dist/web-ui.cjs.development.js +186 -179
- package/dist/web-ui.cjs.development.js.map +1 -1
- package/dist/web-ui.cjs.production.min.js +1 -1
- package/dist/web-ui.cjs.production.min.js.map +1 -1
- package/dist/web-ui.esm.js +186 -179
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,22 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { ButtonProps } from "../Button/Button.types";
|
|
4
|
-
declare type CRUDPageButtonProps = Pick<ButtonProps, "onClick" | "text">;
|
|
5
|
-
declare type CRUDPageProps = {
|
|
6
|
-
dataTestId?: string;
|
|
7
|
-
title: string;
|
|
8
|
-
submitButtonProps?: CRUDPageButtonProps;
|
|
9
|
-
deleteButtonProps?: CRUDPageButtonProps;
|
|
10
|
-
cancelButtonProps?: CRUDPageButtonProps;
|
|
11
|
-
icon?: string;
|
|
12
|
-
className?: string;
|
|
13
|
-
isLoading?: boolean;
|
|
14
|
-
isSubmitting?: boolean;
|
|
15
|
-
navMenuComponent?: React.ReactNode;
|
|
16
|
-
stepTitles?: StepsProps["orderedStepTitles"];
|
|
17
|
-
currentStep?: StepsProps["currentStep"];
|
|
18
|
-
localization?: StepsProps["localization"];
|
|
19
|
-
children?: React.ReactNode;
|
|
20
|
-
};
|
|
2
|
+
import type { CRUDPageProps } from "./CRUDPage.types";
|
|
21
3
|
declare const CRUDPage: React.FC<CRUDPageProps>;
|
|
22
4
|
export default CRUDPage;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { BaseButtonProps } from "../ButtonV2/ButtonProps.type";
|
|
3
|
+
import type { PageHeaderProps } from "../PageHeader";
|
|
4
|
+
import type { StepsProps } from "../Steps/Steps";
|
|
5
|
+
declare type CRUDPageButtonProps = Pick<BaseButtonProps, "onClick" | "text">;
|
|
6
|
+
declare type CRUDPageTitle = {
|
|
7
|
+
text: string;
|
|
8
|
+
icon?: string;
|
|
9
|
+
};
|
|
10
|
+
declare type CRUDPageHeader = Omit<PageHeaderProps, "navigation" | "isPolling" | "accessories">;
|
|
11
|
+
declare type CRUDPagePropsWithoutHeaderOrTitle = {
|
|
12
|
+
dataTestId?: string;
|
|
13
|
+
submitButtonProps?: CRUDPageButtonProps;
|
|
14
|
+
cancelButtonProps?: CRUDPageButtonProps;
|
|
15
|
+
className?: string;
|
|
16
|
+
isLoading?: boolean;
|
|
17
|
+
isSubmitting?: boolean;
|
|
18
|
+
stepTitles?: StepsProps["orderedStepTitles"];
|
|
19
|
+
currentStep?: StepsProps["currentStep"];
|
|
20
|
+
localization?: StepsProps["localization"];
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
};
|
|
23
|
+
export declare type CRUDPageProps = (CRUDPagePropsWithoutHeaderOrTitle & {
|
|
24
|
+
title: CRUDPageTitle;
|
|
25
|
+
header?: never;
|
|
26
|
+
}) | (CRUDPagePropsWithoutHeaderOrTitle & {
|
|
27
|
+
header: CRUDPageHeader;
|
|
28
|
+
title?: never;
|
|
29
|
+
});
|
|
30
|
+
export {};
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
navigation?: Omit<TabbarProps, "withoutPadding">;
|
|
6
|
-
breadcrumbs?: BreadcrumbProps["crumbs"];
|
|
7
|
-
dataTestId?: string;
|
|
8
|
-
title: string;
|
|
9
|
-
isPolling?: boolean;
|
|
10
|
-
accessories?: React.ReactNode;
|
|
11
|
-
}
|
|
12
|
-
export declare const PageHeader: React.VoidFunctionComponent<PageHeaderProps>;
|
|
2
|
+
import { PageHeaderProps } from "./PageHeader.types";
|
|
3
|
+
declare const PageHeader: React.FC<PageHeaderProps>;
|
|
4
|
+
export default PageHeader;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { BreadcrumbProps } from "../Breadcrumbs/Breadcrumbs";
|
|
3
|
+
import type { TabbarProps } from "../Tabbar/Tabbar";
|
|
4
|
+
export interface PageHeaderProps {
|
|
5
|
+
navigation?: Omit<TabbarProps, "withoutPadding">;
|
|
6
|
+
breadcrumbs?: BreadcrumbProps["crumbs"];
|
|
7
|
+
dataTestId?: string;
|
|
8
|
+
title: string;
|
|
9
|
+
isPolling?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
contained?: boolean;
|
|
12
|
+
accessories?: React.ReactNode;
|
|
13
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -38,8 +38,7 @@ export { MultiSelect } from "./components/MultiSelect/MultiSelect";
|
|
|
38
38
|
export { NavLayout, NavMenuLayoutProps } from "./components/NavMenu/NavLayout";
|
|
39
39
|
export { NavMenu } from "./components/NavMenu/NavMenu";
|
|
40
40
|
export { NotificationBanner, NotificationBannerColor, NotificationBannerLinkProps, } from "./components/NotificationBanner/NotificationBanner";
|
|
41
|
-
export {
|
|
42
|
-
export { default as CRUDPage } from "./components/Page/CRUDPage";
|
|
41
|
+
export { Page, CRUDPage, CRUDPageProps } from "./components/Page";
|
|
43
42
|
export { PaginationMenu } from "./components/PaginationMenu/PaginationMenu";
|
|
44
43
|
export { PageSize as PaginationMenuPageSize, OnPaginationChange as OnPaginationMenuChange, Localization as PaginationMenuLocalization, PaginationMenuProps, } from "./components/PaginationMenu/PaginationMenu.types";
|
|
45
44
|
export { default as PreviewPhone } from "./components/PreviewPhone/PreviewPhone";
|
|
@@ -58,7 +57,7 @@ export { default as Switcher } from "./components/Switcher/Switcher";
|
|
|
58
57
|
export { ImagePicker, TargetProps } from "./components/ImagePicker/ImagePicker";
|
|
59
58
|
export { default as Tabbar, TabbarProps, TabItemDetails, } from "./components/Tabbar/Tabbar";
|
|
60
59
|
export { Breadcrumbs, BreadcrumbProps, } from "./components/Breadcrumbs/Breadcrumbs";
|
|
61
|
-
export { PageHeader, PageHeaderProps
|
|
60
|
+
export { PageHeader, PageHeaderProps } from "./components/PageHeader";
|
|
62
61
|
export { default as TabLinks } from "./components/TabLinks/TabLinks";
|
|
63
62
|
export { default as Tag } from "./components/Tag/Tag";
|
|
64
63
|
export { default as TagGroup } from "./components/Tag/TagGroup";
|
package/dist/web-ui-tailwind.css
CHANGED
|
@@ -1552,10 +1552,6 @@ video {
|
|
|
1552
1552
|
margin-top: 4.25rem;
|
|
1553
1553
|
}
|
|
1554
1554
|
|
|
1555
|
-
.mb-20 {
|
|
1556
|
-
margin-bottom: 5rem;
|
|
1557
|
-
}
|
|
1558
|
-
|
|
1559
1555
|
.mt-auto {
|
|
1560
1556
|
margin-top: auto;
|
|
1561
1557
|
}
|
|
@@ -1787,6 +1783,14 @@ video {
|
|
|
1787
1783
|
padding-right: 4.25rem;
|
|
1788
1784
|
}
|
|
1789
1785
|
|
|
1786
|
+
.pr-0 {
|
|
1787
|
+
padding-right: 0;
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
.pl-0 {
|
|
1791
|
+
padding-left: 0;
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1790
1794
|
.pb-1 {
|
|
1791
1795
|
padding-bottom: 0.25rem;
|
|
1792
1796
|
}
|
|
@@ -1815,6 +1819,10 @@ video {
|
|
|
1815
1819
|
padding-left: 1.5rem;
|
|
1816
1820
|
}
|
|
1817
1821
|
|
|
1822
|
+
.pb-8 {
|
|
1823
|
+
padding-bottom: 2rem;
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1818
1826
|
.pt-11 {
|
|
1819
1827
|
padding-top: 2.75rem;
|
|
1820
1828
|
}
|
|
@@ -6494,65 +6494,215 @@ var Steps = function Steps(_ref) {
|
|
|
6494
6494
|
}, renderedSteps);
|
|
6495
6495
|
};
|
|
6496
6496
|
|
|
6497
|
-
var
|
|
6497
|
+
var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
6498
|
+
var crumbs = _ref.crumbs;
|
|
6499
|
+
var breadcrumbItems = crumbs.map(function (_ref2) {
|
|
6500
|
+
var name = _ref2.name,
|
|
6501
|
+
link = _ref2.link,
|
|
6502
|
+
key = _ref2.key;
|
|
6503
|
+
return /*#__PURE__*/React__default.createElement("li", {
|
|
6504
|
+
key: key || name,
|
|
6505
|
+
className: "flex flex-row items-center slash-split "
|
|
6506
|
+
}, link ? /*#__PURE__*/React__default.createElement(router.Link, {
|
|
6507
|
+
to: link
|
|
6508
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
6509
|
+
text: name,
|
|
6510
|
+
color: "blue-800"
|
|
6511
|
+
})) : /*#__PURE__*/React__default.createElement(Text, {
|
|
6512
|
+
text: name,
|
|
6513
|
+
type: "strong"
|
|
6514
|
+
}));
|
|
6515
|
+
});
|
|
6516
|
+
return /*#__PURE__*/React__default.createElement("ul", {
|
|
6517
|
+
"data-test-id": "breadcrumbs",
|
|
6518
|
+
className: "flex flex-row items-center space-x-2 "
|
|
6519
|
+
}, breadcrumbItems);
|
|
6520
|
+
};
|
|
6521
|
+
|
|
6522
|
+
var TabbarItem = function TabbarItem(_ref) {
|
|
6498
6523
|
var title = _ref.title,
|
|
6499
|
-
|
|
6524
|
+
index = _ref.index,
|
|
6525
|
+
isSelected = _ref.isSelected,
|
|
6526
|
+
onSelect = _ref.onSelect,
|
|
6527
|
+
className = _ref.className,
|
|
6528
|
+
_ref$badgeCount = _ref.badgeCount,
|
|
6529
|
+
badgeCount = _ref$badgeCount === void 0 ? 0 : _ref$badgeCount,
|
|
6530
|
+
_ref$isLoading = _ref.isLoading,
|
|
6531
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
6532
|
+
_ref$dataTestId = _ref.dataTestId,
|
|
6533
|
+
dataTestId = _ref$dataTestId === void 0 ? "" : _ref$dataTestId;
|
|
6534
|
+
|
|
6535
|
+
var handleTabClick = function handleTabClick() {
|
|
6536
|
+
return onSelect && onSelect(index);
|
|
6537
|
+
};
|
|
6538
|
+
|
|
6539
|
+
var itemClassName = classNames("flex first:ml-0 ml-2 flex-row cursor-pointer py-2 px-3 rounded-lg focus:outline-primary transition ease-in duration-150", className, {
|
|
6540
|
+
"bg-slate-100 text-slate-800 hover:text-slate-800 focus:text-slate-800": isSelected,
|
|
6541
|
+
"bg-slate-50 text-slate-500 hover:bg-slate-100 hover:text-slate-500 focus:text-slate-500 opacity-75": !isSelected
|
|
6542
|
+
});
|
|
6543
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
6544
|
+
className: itemClassName,
|
|
6545
|
+
onClick: handleTabClick,
|
|
6546
|
+
"data-test-id": dataTestId
|
|
6547
|
+
}, typeof title === "string" && /*#__PURE__*/React__default.createElement(Text, {
|
|
6548
|
+
text: title,
|
|
6549
|
+
type: isSelected ? "strong" : "base",
|
|
6550
|
+
inline: true
|
|
6551
|
+
}), typeof title !== "string" && title, badgeCount > 0 && /*#__PURE__*/React__default.createElement(Badge, {
|
|
6552
|
+
className: "ml-1",
|
|
6553
|
+
badgeCount: badgeCount
|
|
6554
|
+
}), isLoading && /*#__PURE__*/React__default.createElement(LoadingIndicator, {
|
|
6555
|
+
asSpinner: true,
|
|
6556
|
+
spinnerColor: "gray",
|
|
6557
|
+
className: "w-6"
|
|
6558
|
+
}));
|
|
6559
|
+
};
|
|
6560
|
+
|
|
6561
|
+
var Tabbar = function Tabbar(_ref) {
|
|
6562
|
+
var _ref$tabs = _ref.tabs,
|
|
6563
|
+
tabs = _ref$tabs === void 0 ? [] : _ref$tabs,
|
|
6564
|
+
selectedIndex = _ref.selectedIndex,
|
|
6565
|
+
onSelect = _ref.onSelect,
|
|
6566
|
+
_ref$className = _ref.className,
|
|
6567
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
6568
|
+
_ref$withoutPadding = _ref.withoutPadding,
|
|
6569
|
+
withoutPadding = _ref$withoutPadding === void 0 ? false : _ref$withoutPadding;
|
|
6570
|
+
|
|
6571
|
+
var _useState = React.useState(selectedIndex),
|
|
6572
|
+
innerSelectedIndex = _useState[0],
|
|
6573
|
+
setInnerSelectedIndex = _useState[1];
|
|
6574
|
+
|
|
6575
|
+
React.useEffect(function () {
|
|
6576
|
+
setInnerSelectedIndex(selectedIndex);
|
|
6577
|
+
}, [selectedIndex]);
|
|
6578
|
+
|
|
6579
|
+
var handleOnTabSelect = function handleOnTabSelect(index) {
|
|
6580
|
+
setInnerSelectedIndex(index);
|
|
6581
|
+
onSelect == null ? void 0 : onSelect({
|
|
6582
|
+
index: index,
|
|
6583
|
+
selectedTab: tabs[index]
|
|
6584
|
+
});
|
|
6585
|
+
};
|
|
6586
|
+
|
|
6587
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
6588
|
+
className: classNames("flex flex-row w-full bg-white rounded-xl " + className, {
|
|
6589
|
+
"p-2": !withoutPadding
|
|
6590
|
+
})
|
|
6591
|
+
}, tabs == null ? void 0 : tabs.map(function (tabItemProps, index) {
|
|
6592
|
+
var _tabItemProps$dataTes;
|
|
6593
|
+
|
|
6594
|
+
var itemProps = _extends({
|
|
6595
|
+
index: index,
|
|
6596
|
+
onSelect: handleOnTabSelect,
|
|
6597
|
+
isSelected: innerSelectedIndex === index
|
|
6598
|
+
}, tabItemProps);
|
|
6599
|
+
|
|
6600
|
+
return /*#__PURE__*/React__default.createElement(TabbarItem, _extends({
|
|
6601
|
+
key: (_tabItemProps$dataTes = tabItemProps.dataTestId) != null ? _tabItemProps$dataTes : index
|
|
6602
|
+
}, itemProps));
|
|
6603
|
+
}));
|
|
6604
|
+
};
|
|
6605
|
+
|
|
6606
|
+
var PageHeader = function PageHeader(_ref) {
|
|
6607
|
+
var navigation = _ref.navigation,
|
|
6608
|
+
breadcrumbs = _ref.breadcrumbs,
|
|
6609
|
+
dataTestId = _ref.dataTestId,
|
|
6610
|
+
accessories = _ref.accessories,
|
|
6611
|
+
isPolling = _ref.isPolling,
|
|
6612
|
+
title = _ref.title,
|
|
6613
|
+
contained = _ref.contained,
|
|
6614
|
+
className = _ref.className;
|
|
6615
|
+
var withContained = {
|
|
6616
|
+
"max-w-3xl m-auto": contained
|
|
6617
|
+
};
|
|
6618
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
6619
|
+
"data-test-id": "page-header",
|
|
6620
|
+
className: classNames("p-4 space-y-4 bg-white", className, {
|
|
6621
|
+
"w-full pl-0 pr-0": contained
|
|
6622
|
+
})
|
|
6623
|
+
}, !!(breadcrumbs != null && breadcrumbs.length) && /*#__PURE__*/React__default.createElement("div", {
|
|
6624
|
+
className: classNames("mb-4 space-y-4", withContained)
|
|
6625
|
+
}, /*#__PURE__*/React__default.createElement(Breadcrumbs, {
|
|
6626
|
+
crumbs: breadcrumbs
|
|
6627
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
6628
|
+
className: "mb-4 border-b border-slate-100"
|
|
6629
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
6630
|
+
className: classNames("flex flex-row items-center justify-between", withContained)
|
|
6631
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
6632
|
+
className: "flex flex-row items-center space-x-3"
|
|
6633
|
+
}, /*#__PURE__*/React__default.createElement(Title, {
|
|
6634
|
+
"data-test-id": dataTestId + "-title",
|
|
6635
|
+
text: title
|
|
6636
|
+
}), isPolling && /*#__PURE__*/React__default.createElement(LoadingIndicator, {
|
|
6637
|
+
asSpinner: true,
|
|
6638
|
+
className: "page-spinner",
|
|
6639
|
+
spinnerColor: "gray"
|
|
6640
|
+
})), accessories && /*#__PURE__*/React__default.createElement("div", {
|
|
6641
|
+
"data-test-id": "page-header-accessories"
|
|
6642
|
+
}, accessories)), navigation && /*#__PURE__*/React__default.createElement(Tabbar, _extends({}, navigation, {
|
|
6643
|
+
withoutPadding: true,
|
|
6644
|
+
className: classNames(navigation.className, withContained)
|
|
6645
|
+
})));
|
|
6646
|
+
};
|
|
6647
|
+
|
|
6648
|
+
var CRUDPage = function CRUDPage(_ref) {
|
|
6649
|
+
var stepTitles = _ref.stepTitles,
|
|
6500
6650
|
_ref$currentStep = _ref.currentStep,
|
|
6501
6651
|
currentStep = _ref$currentStep === void 0 ? 1 : _ref$currentStep,
|
|
6502
6652
|
submitButtonProps = _ref.submitButtonProps,
|
|
6503
|
-
deleteButtonProps = _ref.deleteButtonProps,
|
|
6504
6653
|
cancelButtonProps = _ref.cancelButtonProps,
|
|
6505
|
-
icon = _ref.icon,
|
|
6506
6654
|
className = _ref.className,
|
|
6507
6655
|
children = _ref.children,
|
|
6508
6656
|
isLoading = _ref.isLoading,
|
|
6509
6657
|
isSubmitting = _ref.isSubmitting,
|
|
6510
6658
|
localization = _ref.localization,
|
|
6511
|
-
_ref$navMenuComponent = _ref.navMenuComponent,
|
|
6512
|
-
navMenuComponent = _ref$navMenuComponent === void 0 ? null : _ref$navMenuComponent,
|
|
6513
6659
|
_ref$dataTestId = _ref.dataTestId,
|
|
6514
|
-
dataTestId = _ref$dataTestId === void 0 ? "page" : _ref$dataTestId
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
var
|
|
6660
|
+
dataTestId = _ref$dataTestId === void 0 ? "page" : _ref$dataTestId,
|
|
6661
|
+
title = _ref.title,
|
|
6662
|
+
header = _ref.header;
|
|
6663
|
+
var mergedClasses = classNames("cweb-crud-page", "w-full mb-0 mx-auto pb-8", className);
|
|
6664
|
+
var submitButton = submitButtonProps && /*#__PURE__*/React__default.createElement(PrimaryButton, _extends({
|
|
6518
6665
|
"data-test-id": "submit-button",
|
|
6519
6666
|
key: "submit-button",
|
|
6520
6667
|
role: BUTTON_ROLES.PRIMARY,
|
|
6521
6668
|
isPending: isSubmitting
|
|
6522
6669
|
}, submitButtonProps));
|
|
6523
|
-
var
|
|
6524
|
-
"data-test-id": "delete-button",
|
|
6525
|
-
key: "delete-button",
|
|
6526
|
-
role: BUTTON_ROLES.NEGATIVE
|
|
6527
|
-
}, deleteButtonProps));
|
|
6528
|
-
var cancelButton = cancelButtonProps && /*#__PURE__*/React__default.createElement(Button, _extends({
|
|
6670
|
+
var cancelButton = cancelButtonProps && /*#__PURE__*/React__default.createElement(TertiaryButton, _extends({
|
|
6529
6671
|
"data-test-id": "cancel-button",
|
|
6530
6672
|
key: "cancel-button",
|
|
6531
6673
|
role: BUTTON_ROLES.SECONDARY
|
|
6532
6674
|
}, cancelButtonProps));
|
|
6533
|
-
var
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6675
|
+
var pageHeader;
|
|
6676
|
+
|
|
6677
|
+
if (title) {
|
|
6678
|
+
pageHeader = /*#__PURE__*/React__default.createElement("div", {
|
|
6679
|
+
className: "flex flex-row justify-start align-center max-w-3xl mx-auto w-full mt-8"
|
|
6680
|
+
}, title.icon && /*#__PURE__*/React__default.createElement("img", {
|
|
6681
|
+
id: "title-icon",
|
|
6682
|
+
src: title.icon,
|
|
6683
|
+
className: "mr-4 w-11 h-11",
|
|
6684
|
+
alt: "title icon"
|
|
6685
|
+
}), /*#__PURE__*/React__default.createElement(Title, {
|
|
6686
|
+
text: title.text,
|
|
6687
|
+
type: "lg"
|
|
6688
|
+
}));
|
|
6689
|
+
} else {
|
|
6690
|
+
pageHeader = /*#__PURE__*/React__default.createElement(PageHeader, _extends({
|
|
6691
|
+
contained: true
|
|
6692
|
+
}, header));
|
|
6693
|
+
}
|
|
6694
|
+
|
|
6544
6695
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
6545
|
-
className:
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
}, /*#__PURE__*/React__default.createElement(React__default.Fragment, null, isLoading && /*#__PURE__*/React__default.createElement("div", {
|
|
6696
|
+
className: "cweb-crud-page-container",
|
|
6697
|
+
"data-test-id": dataTestId
|
|
6698
|
+
}, isLoading && /*#__PURE__*/React__default.createElement("div", {
|
|
6549
6699
|
className: classNames(mergedClasses, "overflow-y-hidden relative", "cweb-crud-page-loading-container"),
|
|
6550
6700
|
style: {
|
|
6551
6701
|
height: "90vh"
|
|
6552
6702
|
}
|
|
6553
6703
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
6554
6704
|
className: "flex flex-row justify-start align-center"
|
|
6555
|
-
},
|
|
6705
|
+
}, pageHeader), /*#__PURE__*/React__default.createElement(LoadingIndicator, {
|
|
6556
6706
|
className: classNames("crud-page-loader", "absolute top-0 right-0 bottom-0 left-0 m-auto h-12 w-12"),
|
|
6557
6707
|
asModal: false
|
|
6558
6708
|
})), !isLoading && /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -6560,18 +6710,18 @@ var CRUDPage = function CRUDPage(_ref) {
|
|
|
6560
6710
|
"data-test-id": dataTestId
|
|
6561
6711
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
6562
6712
|
className: "flex flex-row justify-start align-center"
|
|
6563
|
-
},
|
|
6564
|
-
className: classNames("cweb-crud-page-form-container", "bg-white rounded lg p-6 mt-4")
|
|
6713
|
+
}, pageHeader), /*#__PURE__*/React__default.createElement("div", {
|
|
6714
|
+
className: classNames("cweb-crud-page-form-container", "max-w-3xl mx-auto bg-white rounded lg p-6 mt-4")
|
|
6565
6715
|
}, stepTitles && stepTitles.length > 0 && localization && /*#__PURE__*/React__default.createElement(Steps, {
|
|
6566
6716
|
orderedStepTitles: stepTitles,
|
|
6567
6717
|
currentStep: currentStep,
|
|
6568
6718
|
className: "mb-4",
|
|
6569
6719
|
localization: localization
|
|
6570
6720
|
}), children, /*#__PURE__*/React__default.createElement(Line, {
|
|
6571
|
-
left: [cancelButton
|
|
6721
|
+
left: [cancelButton],
|
|
6572
6722
|
right: [submitButton],
|
|
6573
6723
|
className: classNames("cweb-crud-page-button-line", "border-t border-solid border-color-divider pt-4 mt-4")
|
|
6574
|
-
}))))
|
|
6724
|
+
}))));
|
|
6575
6725
|
};
|
|
6576
6726
|
|
|
6577
6727
|
var img$h = "data:image/svg+xml,%3csvg width='340' height='638' viewBox='0 0 340 638' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3crect x='8' y='60' width='50' height='8' rx='4' transform='rotate(90 8 60)' fill='%23111827'/%3e %3crect x='8' y='118' width='50' height='8' rx='4' transform='rotate(90 8 118)' fill='%23111827'/%3e %3crect x='340' y='67' width='30' height='8' rx='4' transform='rotate(90 340 67)' fill='%23111827'/%3e %3cpath fill-rule='evenodd' clip-rule='evenodd' d='M36 0C18.3269 0 4 14.3269 4 32V606C4 623.673 18.3269 638 36 638H304C321.673 638 336 623.673 336 606V32C336 14.3269 321.673 0 304 0H36ZM28 43C23.5817 43 20 46.5817 20 51V549C20 553.418 23.5817 557 28 557H312C316.418 557 320 553.418 320 549V51C320 46.5817 316.418 43 312 43H28Z' fill='%23374151'/%3e %3ccircle cx='171' cy='598' r='16' fill='%236B7280'/%3e %3ccircle cx='105.5' cy='22.5' r='4.5' fill='%236B7280'/%3e %3crect x='118' y='18' width='104' height='9' rx='4' fill='%239CA3AF'/%3e%3c/svg%3e";
|
|
@@ -7455,149 +7605,6 @@ var ImagePicker = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
7455
7605
|
}));
|
|
7456
7606
|
});
|
|
7457
7607
|
|
|
7458
|
-
var TabbarItem = function TabbarItem(_ref) {
|
|
7459
|
-
var title = _ref.title,
|
|
7460
|
-
index = _ref.index,
|
|
7461
|
-
isSelected = _ref.isSelected,
|
|
7462
|
-
onSelect = _ref.onSelect,
|
|
7463
|
-
className = _ref.className,
|
|
7464
|
-
_ref$badgeCount = _ref.badgeCount,
|
|
7465
|
-
badgeCount = _ref$badgeCount === void 0 ? 0 : _ref$badgeCount,
|
|
7466
|
-
_ref$isLoading = _ref.isLoading,
|
|
7467
|
-
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
7468
|
-
_ref$dataTestId = _ref.dataTestId,
|
|
7469
|
-
dataTestId = _ref$dataTestId === void 0 ? "" : _ref$dataTestId;
|
|
7470
|
-
|
|
7471
|
-
var handleTabClick = function handleTabClick() {
|
|
7472
|
-
return onSelect && onSelect(index);
|
|
7473
|
-
};
|
|
7474
|
-
|
|
7475
|
-
var itemClassName = classNames("flex first:ml-0 ml-2 flex-row cursor-pointer py-2 px-3 rounded-lg focus:outline-primary transition ease-in duration-150", className, {
|
|
7476
|
-
"bg-slate-100 text-slate-800 hover:text-slate-800 focus:text-slate-800": isSelected,
|
|
7477
|
-
"bg-slate-50 text-slate-500 hover:bg-slate-100 hover:text-slate-500 focus:text-slate-500 opacity-75": !isSelected
|
|
7478
|
-
});
|
|
7479
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
7480
|
-
className: itemClassName,
|
|
7481
|
-
onClick: handleTabClick,
|
|
7482
|
-
"data-test-id": dataTestId
|
|
7483
|
-
}, typeof title === "string" && /*#__PURE__*/React__default.createElement(Text, {
|
|
7484
|
-
text: title,
|
|
7485
|
-
type: isSelected ? "strong" : "base",
|
|
7486
|
-
inline: true
|
|
7487
|
-
}), typeof title !== "string" && title, badgeCount > 0 && /*#__PURE__*/React__default.createElement(Badge, {
|
|
7488
|
-
className: "ml-1",
|
|
7489
|
-
badgeCount: badgeCount
|
|
7490
|
-
}), isLoading && /*#__PURE__*/React__default.createElement(LoadingIndicator, {
|
|
7491
|
-
asSpinner: true,
|
|
7492
|
-
spinnerColor: "gray",
|
|
7493
|
-
className: "w-6"
|
|
7494
|
-
}));
|
|
7495
|
-
};
|
|
7496
|
-
|
|
7497
|
-
var Tabbar = function Tabbar(_ref) {
|
|
7498
|
-
var _ref$tabs = _ref.tabs,
|
|
7499
|
-
tabs = _ref$tabs === void 0 ? [] : _ref$tabs,
|
|
7500
|
-
selectedIndex = _ref.selectedIndex,
|
|
7501
|
-
onSelect = _ref.onSelect,
|
|
7502
|
-
_ref$className = _ref.className,
|
|
7503
|
-
className = _ref$className === void 0 ? "" : _ref$className,
|
|
7504
|
-
_ref$withoutPadding = _ref.withoutPadding,
|
|
7505
|
-
withoutPadding = _ref$withoutPadding === void 0 ? false : _ref$withoutPadding;
|
|
7506
|
-
|
|
7507
|
-
var _useState = React.useState(selectedIndex),
|
|
7508
|
-
innerSelectedIndex = _useState[0],
|
|
7509
|
-
setInnerSelectedIndex = _useState[1];
|
|
7510
|
-
|
|
7511
|
-
React.useEffect(function () {
|
|
7512
|
-
setInnerSelectedIndex(selectedIndex);
|
|
7513
|
-
}, [selectedIndex]);
|
|
7514
|
-
|
|
7515
|
-
var handleOnTabSelect = function handleOnTabSelect(index) {
|
|
7516
|
-
setInnerSelectedIndex(index);
|
|
7517
|
-
onSelect == null ? void 0 : onSelect({
|
|
7518
|
-
index: index,
|
|
7519
|
-
selectedTab: tabs[index]
|
|
7520
|
-
});
|
|
7521
|
-
};
|
|
7522
|
-
|
|
7523
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
7524
|
-
className: classNames("flex flex-row w-full bg-white rounded-xl " + className, {
|
|
7525
|
-
"p-2": !withoutPadding
|
|
7526
|
-
})
|
|
7527
|
-
}, tabs == null ? void 0 : tabs.map(function (tabItemProps, index) {
|
|
7528
|
-
var _tabItemProps$dataTes;
|
|
7529
|
-
|
|
7530
|
-
var itemProps = _extends({
|
|
7531
|
-
index: index,
|
|
7532
|
-
onSelect: handleOnTabSelect,
|
|
7533
|
-
isSelected: innerSelectedIndex === index
|
|
7534
|
-
}, tabItemProps);
|
|
7535
|
-
|
|
7536
|
-
return /*#__PURE__*/React__default.createElement(TabbarItem, _extends({
|
|
7537
|
-
key: (_tabItemProps$dataTes = tabItemProps.dataTestId) != null ? _tabItemProps$dataTes : index
|
|
7538
|
-
}, itemProps));
|
|
7539
|
-
}));
|
|
7540
|
-
};
|
|
7541
|
-
|
|
7542
|
-
var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
7543
|
-
var crumbs = _ref.crumbs;
|
|
7544
|
-
var breadcrumbItems = crumbs.map(function (_ref2) {
|
|
7545
|
-
var name = _ref2.name,
|
|
7546
|
-
link = _ref2.link,
|
|
7547
|
-
key = _ref2.key;
|
|
7548
|
-
return /*#__PURE__*/React__default.createElement("li", {
|
|
7549
|
-
key: key || name,
|
|
7550
|
-
className: "flex flex-row items-center slash-split "
|
|
7551
|
-
}, link ? /*#__PURE__*/React__default.createElement(router.Link, {
|
|
7552
|
-
to: link
|
|
7553
|
-
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7554
|
-
text: name,
|
|
7555
|
-
color: "blue-800"
|
|
7556
|
-
})) : /*#__PURE__*/React__default.createElement(Text, {
|
|
7557
|
-
text: name,
|
|
7558
|
-
type: "strong"
|
|
7559
|
-
}));
|
|
7560
|
-
});
|
|
7561
|
-
return /*#__PURE__*/React__default.createElement("ul", {
|
|
7562
|
-
"data-test-id": "breadcrumbs",
|
|
7563
|
-
className: "flex flex-row items-center space-x-2 "
|
|
7564
|
-
}, breadcrumbItems);
|
|
7565
|
-
};
|
|
7566
|
-
|
|
7567
|
-
var PageHeader = function PageHeader(_ref) {
|
|
7568
|
-
var navigation = _ref.navigation,
|
|
7569
|
-
breadcrumbs = _ref.breadcrumbs,
|
|
7570
|
-
dataTestId = _ref.dataTestId,
|
|
7571
|
-
accessories = _ref.accessories,
|
|
7572
|
-
isPolling = _ref.isPolling,
|
|
7573
|
-
title = _ref.title;
|
|
7574
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
7575
|
-
"data-test-id": "page-header",
|
|
7576
|
-
className: "p-4 space-y-4 bg-white"
|
|
7577
|
-
}, !!(breadcrumbs != null && breadcrumbs.length) && /*#__PURE__*/React__default.createElement("div", {
|
|
7578
|
-
className: "mb-4 space-y-4"
|
|
7579
|
-
}, /*#__PURE__*/React__default.createElement(Breadcrumbs, {
|
|
7580
|
-
crumbs: breadcrumbs
|
|
7581
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
7582
|
-
className: "mb-4 border-b border-slate-100"
|
|
7583
|
-
})), /*#__PURE__*/React__default.createElement("div", {
|
|
7584
|
-
className: "flex flex-row items-center justify-between"
|
|
7585
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
7586
|
-
className: "flex flex-row items-center space-x-3"
|
|
7587
|
-
}, /*#__PURE__*/React__default.createElement(Title, {
|
|
7588
|
-
"data-test-id": dataTestId + "-title",
|
|
7589
|
-
text: title
|
|
7590
|
-
}), isPolling && /*#__PURE__*/React__default.createElement(LoadingIndicator, {
|
|
7591
|
-
asSpinner: true,
|
|
7592
|
-
className: "page-spinner",
|
|
7593
|
-
spinnerColor: "gray"
|
|
7594
|
-
})), accessories && /*#__PURE__*/React__default.createElement("div", {
|
|
7595
|
-
"data-test-id": "page-header-accessories"
|
|
7596
|
-
}, accessories)), navigation && /*#__PURE__*/React__default.createElement(Tabbar, _extends({}, navigation, {
|
|
7597
|
-
withoutPadding: true
|
|
7598
|
-
})));
|
|
7599
|
-
};
|
|
7600
|
-
|
|
7601
7608
|
var TabLinksSelect = function TabLinksSelect(_ref) {
|
|
7602
7609
|
var items = _ref.items,
|
|
7603
7610
|
navigate = _ref.navigate,
|