@lanaco/lnc-react-ui 4.0.2 → 4.0.5
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/Accordion.cjs +1 -1
- package/dist/Accordion.js +55 -50
- package/dist/AccordionDetails.cjs +1 -1
- package/dist/AccordionDetails.js +15 -15
- package/dist/AccordionSummary.cjs +1 -1
- package/dist/AccordionSummary.js +11 -11
- package/dist/ActionsToolbar.cjs +2 -2
- package/dist/ActionsToolbar.js +16 -16
- package/dist/Alert.cjs +1 -1
- package/dist/Alert.js +23 -23
- package/dist/Avatar.cjs +2 -2
- package/dist/Avatar.js +18 -21
- package/dist/Badge.cjs +1 -1
- package/dist/Badge.js +21 -14
- package/dist/Breadcrumbs.cjs +1 -1
- package/dist/Breadcrumbs.js +28 -28
- package/dist/Button.cjs +2 -2
- package/dist/Button.js +21 -22
- package/dist/ButtonGroup.cjs +1 -1
- package/dist/ButtonGroup.js +10 -6
- package/dist/CheckBoxInput.cjs +1 -1
- package/dist/CheckBoxInput.js +6 -6
- package/dist/Chip.cjs +1 -1
- package/dist/Chip.js +9 -9
- package/dist/ColorInput.cjs +1 -1
- package/dist/ColorInput.js +20 -20
- package/dist/ConfirmationForm.cjs +1 -1
- package/dist/ConfirmationForm.js +58 -58
- package/dist/Content.cjs +1 -1
- package/dist/Content.js +8 -8
- package/dist/{CustomStyles-nfD3J1mi.js → CustomStyles-BUSJ8bZt.js} +5 -5
- package/dist/{CustomStyles-CqlCjTgU.cjs → CustomStyles-Dlqxic2X.cjs} +1 -1
- package/dist/DataView.cjs +1 -1
- package/dist/DataView.js +35 -35
- package/dist/DateInput.cjs +4 -4
- package/dist/DateInput.js +491 -491
- package/dist/DecimalInput.cjs +1 -1
- package/dist/DecimalInput.js +43 -43
- package/dist/DetailsView.cjs +4 -4
- package/dist/DetailsView.js +40 -40
- package/dist/DoubleRangeSlider.cjs +1 -1
- package/dist/DoubleRangeSlider.js +33 -33
- package/dist/DragAndDropFile.cjs +1 -1
- package/dist/DragAndDropFile.js +165 -165
- package/dist/DragDropFiles.cjs +1 -1
- package/dist/DragDropFiles.js +31 -31
- package/dist/Drawer.cjs +1 -1
- package/dist/Drawer.js +47 -47
- package/dist/Dropdown.cjs +1 -1
- package/dist/Dropdown.js +39 -39
- package/dist/DropdownItem.cjs +1 -1
- package/dist/DropdownItem.js +23 -23
- package/dist/DropdownLookup.cjs +1 -1
- package/dist/DropdownLookup.js +36 -36
- package/dist/DropdownMenu.cjs +7 -1
- package/dist/DropdownMenu.js +192 -10
- package/dist/EditableTable.cjs +1 -1
- package/dist/EditableTable.js +4 -4
- package/dist/FileInput.cjs +1 -1
- package/dist/FileInput.js +24 -24
- package/dist/FlexBox.cjs +1 -1
- package/dist/FlexBox.js +14 -14
- package/dist/FlexGrid.cjs +1 -1
- package/dist/FlexGrid.js +30 -30
- package/dist/FlexGridItem.cjs +1 -1
- package/dist/FlexGridItem.js +16 -16
- package/dist/Footer.cjs +1 -1
- package/dist/Footer.js +5 -5
- package/dist/FormField.cjs +1 -1
- package/dist/FormField.js +8 -9
- package/dist/FormView.cjs +1 -1
- package/dist/FormView.js +31 -31
- package/dist/Grid.cjs +2 -3
- package/dist/Grid.js +38 -10
- package/dist/GridItem.cjs +2 -2
- package/dist/GridItem.js +29 -9
- package/dist/Header.cjs +1 -1
- package/dist/Header.js +7 -7
- package/dist/Icon.cjs +2 -2
- package/dist/Icon.js +35 -13
- package/dist/IconButton.cjs +1 -1
- package/dist/IconButton.js +51 -52
- package/dist/Kanban.cjs +12 -12
- package/dist/Kanban.js +891 -879
- package/dist/KanbanActionsToolbar.cjs +2 -2
- package/dist/KanbanActionsToolbar.js +28 -28
- package/dist/{KanbanCard-D9OhU8C6.js → KanbanCard-CHZ_C9kk.js} +50 -50
- package/dist/KanbanCard-DV3VnSUi.cjs +30 -0
- package/dist/KanbanCard.cjs +1 -1
- package/dist/KanbanCard.js +5 -5
- package/dist/KanbanFooter.cjs +1 -1
- package/dist/KanbanFooter.js +40 -40
- package/dist/KanbanHeader.cjs +2 -2
- package/dist/KanbanHeader.js +46 -46
- package/dist/KanbanView.cjs +1 -1
- package/dist/KanbanView.js +27 -27
- package/dist/Link.cjs +1 -1
- package/dist/Link.js +9 -9
- package/dist/MenuItem.cjs +1 -1
- package/dist/MenuItem.js +39 -39
- package/dist/Modal.cjs +1 -1
- package/dist/Modal.js +42 -42
- package/dist/MultiSelectDropdown.cjs +1 -1
- package/dist/MultiSelectDropdown.js +6 -6
- package/dist/MultiSelectDropdownLookup.cjs +1 -1
- package/dist/MultiSelectDropdownLookup.js +6 -6
- package/dist/NestedDropdownItem.cjs +1 -1
- package/dist/NestedDropdownItem.js +40 -40
- package/dist/NestedMenuItem.cjs +1 -1
- package/dist/NestedMenuItem.js +45 -45
- package/dist/Notification.cjs +1 -83
- package/dist/Notification.js +3 -1077
- package/dist/NotificationContainer.cjs +37 -0
- package/dist/NotificationContainer.js +162 -0
- package/dist/NotificationMessage.cjs +47 -0
- package/dist/NotificationMessage.js +133 -0
- package/dist/NumberInput.cjs +1 -1
- package/dist/NumberInput.js +17 -17
- package/dist/PageLayout.cjs +1 -1
- package/dist/PageLayout.js +32 -32
- package/dist/Pagination.cjs +12 -0
- package/dist/Pagination.js +248 -0
- package/dist/PasswordInput.cjs +1 -1
- package/dist/PasswordInput.js +33 -33
- package/dist/Popover.cjs +1 -0
- package/dist/Popover.js +36 -0
- package/dist/PopoverClose.cjs +1 -0
- package/dist/PopoverClose.js +15 -0
- package/dist/PopoverContent.cjs +10 -0
- package/dist/PopoverContent.js +68 -0
- package/dist/PopoverContext.cjs +1 -0
- package/dist/PopoverContext.js +5 -0
- package/dist/PopoverDescription.cjs +1 -0
- package/dist/PopoverDescription.js +16 -0
- package/dist/PopoverHeading.cjs +1 -0
- package/dist/PopoverHeading.js +16 -0
- package/dist/PopoverTrigger.cjs +1 -0
- package/dist/PopoverTrigger.js +38 -0
- package/dist/ProgressBar.cjs +1 -1
- package/dist/ProgressBar.js +35 -24
- package/dist/RadioGroup.cjs +1 -1
- package/dist/RadioGroup.js +13 -13
- package/dist/RadioInput.cjs +1 -1
- package/dist/RadioInput.js +10 -10
- package/dist/RangeSlider.cjs +1 -1
- package/dist/RangeSlider.js +27 -27
- package/dist/SearchBar.cjs +1 -1
- package/dist/SearchBar.js +77 -77
- package/dist/Separator.cjs +1 -1
- package/dist/Separator.js +9 -9
- package/dist/Sidebar.cjs +1 -1
- package/dist/Sidebar.js +13 -13
- package/dist/Spinner.cjs +1 -1
- package/dist/Spinner.js +25 -20
- package/dist/Surface.cjs +2 -2
- package/dist/Surface.js +14 -15
- package/dist/SwipeableDrawer.cjs +1 -1
- package/dist/SwipeableDrawer.js +18 -18
- package/dist/TabItem.cjs +26 -0
- package/dist/TabItem.js +210 -0
- package/dist/Table.cjs +20 -20
- package/dist/Table.js +13 -12
- package/dist/TableView.cjs +8 -1
- package/dist/TableView.js +238 -9
- package/dist/Tabs.cjs +1 -1
- package/dist/Tabs.js +33 -27
- package/dist/TextAreaInput.cjs +1 -1
- package/dist/TextAreaInput.js +35 -35
- package/dist/TextInput.cjs +1 -1
- package/dist/TextInput.js +24 -24
- package/dist/ThemeProvider.cjs +1 -1
- package/dist/ThemeProvider.js +85 -85
- package/dist/TimeInput.cjs +1 -1
- package/dist/TimeInput.js +13 -13
- package/dist/Toggle.cjs +1 -1
- package/dist/Toggle.js +4 -5
- package/dist/TreeMenu.cjs +1 -1
- package/dist/TreeMenu.js +57 -57
- package/dist/TreeMenuSeparator.cjs +3 -3
- package/dist/TreeMenuSeparator.js +11 -11
- package/dist/UploadedFile.cjs +1 -1
- package/dist/UploadedFile.js +29 -29
- package/dist/_commonjsHelpers-DKOUU3wS.cjs +1 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/{defineProperty-BHpTtkhC.js → defineProperty-B5pLF6px.js} +8 -8
- package/dist/{emotion-element-5486c51c.browser.esm-CSejtOeT.js → emotion-element-5486c51c.browser.esm-Bb4VkP8U.js} +4 -4
- package/dist/{emotion-is-prop-valid.esm-BzFBwmJz.js → emotion-is-prop-valid.esm-DkbeH1Xy.js} +1 -1
- package/dist/{emotion-react.browser.esm-OWM-uG8Q.js → emotion-react.browser.esm-CN-s34fZ.js} +6 -6
- package/dist/{emotion-react.browser.esm-DQBL7Wls.cjs → emotion-react.browser.esm-D7h2t2Bz.cjs} +1 -1
- package/dist/{emotion-styled.browser.esm-BZSYYThs.js → emotion-styled.browser.esm-BiK8DcgW.js} +12 -12
- package/dist/floating-ui.react.esm-72DKnou_.js +1198 -0
- package/dist/floating-ui.react.esm-C4vrBVJU.cjs +4 -0
- package/dist/{hoist-non-react-statics.cjs-Drf1aBlk.js → hoist-non-react-statics.cjs-CAHiRNzQ.js} +1 -1
- package/dist/{hoist-non-react-statics.cjs-B8r9S_ak.cjs → hoist-non-react-statics.cjs-Dr-ytKVG.cjs} +3 -3
- package/dist/{index-CZJEA84h.js → index--Kmch3aI.js} +1 -1
- package/dist/index-BIlhCoy2.cjs +20 -0
- package/dist/{index-BLQWNy78.js → index-BUChtubz.js} +4 -4
- package/dist/{index-Ds9PUTwb.js → index-BYnWp42a.js} +208 -213
- package/dist/{index-D5vEbKUT.js → index-CNBqQrtK.js} +1 -1
- package/dist/{index-IO9v6o0I.cjs → index-CSXL784P.cjs} +2 -2
- package/dist/{index-C29T0m2a.cjs → index-Ct1N7fF4.cjs} +1 -1
- package/dist/{index-BklgDeu4.js → index-Cu0xwYjD.js} +1 -1
- package/dist/{index-Cdkz-XH-.js → index-CvebWhtp.js} +1 -1
- package/dist/index-DAOBjHnD.cjs +1 -0
- package/dist/index-DBXXH_TD.cjs +1 -0
- package/dist/{index-B_da1uvD.js → index-DLVVKJXD.js} +1 -1
- package/dist/index-DaiUAQVF.cjs +1 -0
- package/dist/index.cjs +1 -26
- package/dist/index.js +180 -376
- package/dist/{motion-CtkUpWEn.js → motion-ecIGZGwI.js} +1 -1
- package/dist/react-toastify.esm-CkXGwKXL.js +798 -0
- package/dist/react-toastify.esm-Dqcb4SQT.cjs +1 -0
- package/dist/{setPrototypeOf-a891FLQJ.js → setPrototypeOf-CttqfWo1.js} +2 -2
- package/dist/style.css +1 -5
- package/dist/{tslib.es6-ZNVz5r_T.js → tslib.es6-DQ-SzcmG.js} +5 -5
- package/dist/usePopover.cjs +1 -0
- package/dist/usePopover.js +44 -0
- package/dist/{utils-DEke8iwo.js → utils-C52T57HO.js} +73 -73
- package/dist/{utils-hdRGTsQ7.cjs → utils-DTAPpJXU.cjs} +1 -1
- package/package.json +17 -5
- package/vite.config.js +16 -0
- package/custom-addons/ThemeSelector.js +0 -111
- package/custom-addons/register.js +0 -16
- package/custom-addons/theme-selector.css +0 -17
- package/dist/DropdownMenu-B6qr13ik.cjs +0 -19
- package/dist/DropdownMenu-DZi3TJ8Q.js +0 -1547
- package/dist/KanbanCard-ConTmu3w.cjs +0 -30
- package/dist/TableView-Cj5_fbSR.js +0 -481
- package/dist/TableView-D8ex512p.cjs +0 -19
- package/dist/index-BjdOz5Ok.cjs +0 -1
- package/dist/index-DXnSjbfJ.cjs +0 -20
- package/dist/index-Dzkd2i4n.cjs +0 -1
- package/dist/index-P-naJISQ.cjs +0 -1
package/dist/Surface.js
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import "
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const c = x.div`
|
|
2
|
+
import { n as x } from "./emotion-styled.browser.esm-BiK8DcgW.js";
|
|
3
|
+
import { P as r } from "./index-BYnWp42a.js";
|
|
4
|
+
import { j as u, b as f } from "./utils-C52T57HO.js";
|
|
5
|
+
import { u as p } from "./emotion-element-5486c51c.browser.esm-Bb4VkP8U.js";
|
|
6
|
+
const g = x.div`
|
|
8
7
|
padding: ${(e) => e.padding};
|
|
9
8
|
box-shadow: ${(e) => u(e.theme, e.boxShadow)};
|
|
10
|
-
border-radius: ${(e) =>
|
|
9
|
+
border-radius: ${(e) => f(e.theme, e.borderRadius)};
|
|
11
10
|
width: ${(e) => e.fullWidth ? "100%" : "fit-content"};
|
|
12
11
|
border-top: 1px solid rgba(0, 0, 0, 0.04);
|
|
13
|
-
`,
|
|
12
|
+
`, h = ({
|
|
14
13
|
children: e,
|
|
15
14
|
style: o = {},
|
|
16
15
|
className: s = "",
|
|
17
16
|
boxShadow: a = "s",
|
|
18
17
|
borderRadius: d = "regular",
|
|
19
18
|
padding: t = "s",
|
|
20
|
-
fullWidth:
|
|
19
|
+
fullWidth: l = !1
|
|
21
20
|
}) => {
|
|
22
|
-
const
|
|
21
|
+
const i = p(), m = {
|
|
23
22
|
xs: "0.25rem",
|
|
24
23
|
s: "0.5rem",
|
|
25
24
|
m: "0.75rem",
|
|
@@ -28,20 +27,20 @@ const c = x.div`
|
|
|
28
27
|
xxl: "1.5rem"
|
|
29
28
|
};
|
|
30
29
|
return /* @__PURE__ */ n(
|
|
31
|
-
|
|
30
|
+
g,
|
|
32
31
|
{
|
|
33
|
-
theme:
|
|
32
|
+
theme: i,
|
|
34
33
|
style: o,
|
|
35
34
|
className: "lnc-ui-surface " + s,
|
|
36
35
|
borderRadius: d,
|
|
37
36
|
boxShadow: a,
|
|
38
37
|
padding: m[t],
|
|
39
|
-
fullWidth:
|
|
38
|
+
fullWidth: l,
|
|
40
39
|
children: e
|
|
41
40
|
}
|
|
42
41
|
);
|
|
43
42
|
};
|
|
44
|
-
|
|
43
|
+
h.propTypes = {
|
|
45
44
|
borderRadius: r.oneOf([
|
|
46
45
|
"slight",
|
|
47
46
|
"regular",
|
|
@@ -56,5 +55,5 @@ g.propTypes = {
|
|
|
56
55
|
style: r.object
|
|
57
56
|
};
|
|
58
57
|
export {
|
|
59
|
-
|
|
58
|
+
h as default
|
|
60
59
|
};
|
package/dist/SwipeableDrawer.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const g=require("react/jsx-runtime"),u=require("react"),t=require("./index-
|
|
1
|
+
"use strict";const g=require("react/jsx-runtime"),u=require("react"),t=require("./index-BIlhCoy2.cjs"),v=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),y=require("./utils-DTAPpJXU.cjs"),V=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),X=(e,o,n,c,a)=>{if(e==="right"||e==="left"||o&&n)return"height: 100%;";if(!(o&&a===!0))return o?"height: "+c+";":"height: 0;"},Y=(e,o,n,c,a)=>{if(e==="top"||e==="bottom"||o&&n)return"width: 100%;";if(!(o&&a===!0))return o?"width: "+c+";":"width: 0;"},A=v.newStyled.div`
|
|
2
2
|
touch-action: none;
|
|
3
3
|
overflow: auto;
|
|
4
4
|
max-height: ${e=>e.isOpen||e.unsetHeight===!1?"100dvh":0};
|
package/dist/SwipeableDrawer.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as g, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { P as t } from "./index-
|
|
4
|
-
import { n as y } from "./emotion-styled.browser.esm-
|
|
5
|
-
import {
|
|
6
|
-
import { u as
|
|
7
|
-
const
|
|
2
|
+
import { forwardRef as V, useRef as q, useState as A, useImperativeHandle as B, useEffect as G } from "react";
|
|
3
|
+
import { P as t } from "./index-BYnWp42a.js";
|
|
4
|
+
import { n as y } from "./emotion-styled.browser.esm-BiK8DcgW.js";
|
|
5
|
+
import { a as $, g as J } from "./utils-C52T57HO.js";
|
|
6
|
+
import { u as K } from "./emotion-element-5486c51c.browser.esm-Bb4VkP8U.js";
|
|
7
|
+
const Q = (e, r, o, u, s) => {
|
|
8
8
|
if (e === "right" || e === "left" || r && o) return "height: 100%;";
|
|
9
9
|
if (!(r && s === !0))
|
|
10
10
|
return r ? "height: " + u + ";" : "height: 0;";
|
|
11
|
-
},
|
|
11
|
+
}, R = (e, r, o, u, s) => {
|
|
12
12
|
if (e === "top" || e === "bottom" || r && o) return "width: 100%;";
|
|
13
13
|
if (!(r && s === !0))
|
|
14
14
|
return r ? "width: " + u + ";" : "width: 0;";
|
|
15
|
-
},
|
|
15
|
+
}, Z = y.div`
|
|
16
16
|
touch-action: none;
|
|
17
17
|
overflow: auto;
|
|
18
18
|
max-height: ${(e) => e.isOpen || e.unsetHeight === !1 ? "100dvh" : 0};
|
|
19
|
-
${(e) =>
|
|
19
|
+
${(e) => Q(
|
|
20
20
|
e.direction,
|
|
21
21
|
e.isOpen,
|
|
22
22
|
e.isFullPage,
|
|
@@ -24,7 +24,7 @@ const J = (e, r, o, u, s) => {
|
|
|
24
24
|
e.unsetHeight
|
|
25
25
|
)}
|
|
26
26
|
max-width: ${(e) => e.isOpen || e.unsetWidth === !1 ? "100vw" : 0};
|
|
27
|
-
${(e) =>
|
|
27
|
+
${(e) => R(
|
|
28
28
|
e.direction,
|
|
29
29
|
e.isOpen,
|
|
30
30
|
e.isFullPage,
|
|
@@ -52,8 +52,8 @@ const J = (e, r, o, u, s) => {
|
|
|
52
52
|
"background"
|
|
53
53
|
)};
|
|
54
54
|
color: ${(e) => $(e.theme, "Drawer", e.color, "enabled", "text")};
|
|
55
|
-
${(e) =>
|
|
56
|
-
`,
|
|
55
|
+
${(e) => J(e.theme, "Drawer", e.size, "enabled")};
|
|
56
|
+
`, _ = y.div`
|
|
57
57
|
z-index: ${(e) => e.zIndex};
|
|
58
58
|
position: fixed;
|
|
59
59
|
top: 0;
|
|
@@ -62,7 +62,7 @@ const J = (e, r, o, u, s) => {
|
|
|
62
62
|
height: ${(e) => e.isOpen === !0 && e.enableOverlay === !0 ? "100dvh" : 0};
|
|
63
63
|
width: ${(e) => e.isOpen === !0 && e.enableOverlay === !0 ? "100vw" : 0};
|
|
64
64
|
background-color: ${(e) => e.overlayColor};
|
|
65
|
-
`, ee =
|
|
65
|
+
`, ee = V((e, r) => {
|
|
66
66
|
const {
|
|
67
67
|
direction: o = "right",
|
|
68
68
|
open: u = !1,
|
|
@@ -88,7 +88,7 @@ const J = (e, r, o, u, s) => {
|
|
|
88
88
|
drawerSize: F = "12.5rem",
|
|
89
89
|
children: W,
|
|
90
90
|
...E
|
|
91
|
-
} = e, M =
|
|
91
|
+
} = e, M = K(), i = q(), [f, b] = A(!1);
|
|
92
92
|
var d = null, h = null;
|
|
93
93
|
function j(n) {
|
|
94
94
|
return n.touches || n.originalEvent.touches;
|
|
@@ -103,7 +103,7 @@ const J = (e, r, o, u, s) => {
|
|
|
103
103
|
Math.abs(w) > Math.abs(v) ? w > 0 ? c == !0 && o == "left" && l() : c == !0 && o == "right" && l() : v > 0 ? c == !0 && o == "top" && l() : c == !0 && o == "bottom" && l(), d = null, h = null;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
|
|
106
|
+
B(r, () => ({
|
|
107
107
|
open() {
|
|
108
108
|
U();
|
|
109
109
|
},
|
|
@@ -119,7 +119,7 @@ const J = (e, r, o, u, s) => {
|
|
|
119
119
|
}, l = (n) => {
|
|
120
120
|
b(!1), C(n);
|
|
121
121
|
};
|
|
122
|
-
return
|
|
122
|
+
return G(() => {
|
|
123
123
|
const n = (a) => {
|
|
124
124
|
i != null && i.current && !(i != null && i.current.contains(a.target)) && x == !0 && l();
|
|
125
125
|
};
|
|
@@ -127,14 +127,14 @@ const J = (e, r, o, u, s) => {
|
|
|
127
127
|
document.removeEventListener("click", n, !0);
|
|
128
128
|
};
|
|
129
129
|
}, []), /* @__PURE__ */ g(Y, { children: /* @__PURE__ */ g(
|
|
130
|
-
|
|
130
|
+
_,
|
|
131
131
|
{
|
|
132
132
|
enableOverlay: O,
|
|
133
133
|
overlayColor: I,
|
|
134
134
|
isOpen: f,
|
|
135
135
|
zIndex: m,
|
|
136
136
|
children: /* @__PURE__ */ g(
|
|
137
|
-
|
|
137
|
+
Z,
|
|
138
138
|
{
|
|
139
139
|
ref: i,
|
|
140
140
|
zIndex: m,
|
package/dist/TabItem.cjs
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";const z=require("react/jsx-runtime"),m=require("react"),r=require("./index-BIlhCoy2.cjs"),E=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),t=require("./utils-DTAPpJXU.cjs"),N=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),y=require("./useUpdateEffect-BtMgpgIV.cjs"),S=e=>e=="small"?"3.125rem":e=="medium"?"3.375rem":"3.625rem",_=E.newStyled.div`
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
${e=>e.disabled===!0&&t.getDisabledStateCss(e.theme)};
|
|
4
|
+
min-width: 5.25rem;
|
|
5
|
+
${e=>e.fullWidth&&"width: 100%"};
|
|
6
|
+
display: flex;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
align-items: center;
|
|
9
|
+
|
|
10
|
+
height: ${e=>S(e.size)};
|
|
11
|
+
${e=>t.getComponentTypographyCss(e.theme,i(e.type),e.size,"enabled")};
|
|
12
|
+
${e=>!e.disabled&&"cursor: pointer"};
|
|
13
|
+
color: ${e=>!e.disabled&&t.getColorRgbaValue(e.theme,i(e.type),e.color,e.active?"active":"enabled","text")};
|
|
14
|
+
background-color: ${e=>e.type=="regular"||e.type=="pill"&&(e.disabled==!0||e.active==!1)?"transparent":!e.disabled&&t.getColorRgbaValue(e.theme,i(e.type),e.color,e.active?"active":"enabled","background","backgroundOpacity")};
|
|
15
|
+
${e=>e.type=="underline"&&e.last==!1&&"border-right: 1px solid "+t.getColorRgbaValue(e.theme,i(e.type),e.color,"enabled","line")};
|
|
16
|
+
${e=>h(e.theme,e.type,e.active,e.disabled,e.color,"enabled")};
|
|
17
|
+
${e=>D(e.theme,e.type,e.first,e.last)};
|
|
18
|
+
&:hover {
|
|
19
|
+
color: ${e=>!e.disabled&&t.getColorRgbaValue(e.theme,i(e.type),e.color,"hover","text")};
|
|
20
|
+
background-color: ${e=>e.type=="regular"?"transparent":!e.disabled&&t.getColorRgbaValue(e.theme,i(e.type),e.color,"hover","background","backgroundOpacity")};
|
|
21
|
+
${e=>h(e.theme,e.type,e.active,e.disabled,e.color,"hover")};
|
|
22
|
+
}
|
|
23
|
+
&:active {
|
|
24
|
+
background: ${e=>t.getColorRgbaValue(e.theme,i(e.type),e.color,"active","background","backgroundOpacity")};
|
|
25
|
+
}
|
|
26
|
+
`,i=e=>e=="underline"?"TabUnderline":e=="pill"?"TabPill":"TabRegular",D=(e,l,n,a)=>{if(l=="pill")return`border-radius: ${t.getBorderRadiusValueWithUnits(e,"regular")}`;if(l=="underline"&&n)return`border-radius: ${t.getBorderRadiusValueWithUnits(e,"regular")} 0 0 ${t.getBorderRadiusValueWithUnits(e,"regular")}`;if(l=="underline"&&a)return`border-radius: 0 ${t.getBorderRadiusValueWithUnits(e,"regular")} ${t.getBorderRadiusValueWithUnits(e,"regular")} 0`},h=(e,l,n,a,u,o)=>{if(l!="pill")return`border-bottom: ${!a&&(n||o=="hover")?e.components[l==="regular"?"TabRegular":"TabUnderline"].default.enabled.lineHeight+"":e.components[l==="regular"?"TabRegular":"TabUnderline"].default.hover.lineHeight+""} solid ${t.getColorRgbaValue(e,i(l),u,n&&!a?"active":a?"enabled":o,"line")}`},T=m.forwardRef((e,l)=>{const{type:n="underline",disabled:a,first:u=!1,last:o=!1,fullWidth:v=!1,active:c=!1,activeIndex:d,index:s,onFocus:$=()=>{},onBlur:R=()=>{},onClick:g=()=>{},onKeyDown:C=()=>{},itemClick:b=()=>{},size:P="small",color:k="primary",className:x="",style:V={},children:U,...w}=e,B=N.useTheme(),[W,f]=m.useState(c),q={theme:B,color:k,size:P,style:V,className:"lnc-ui-tabitem "+x},O=j=>{b&&!a&&b(s),g&&!a&&g(j)};return y.useUpdateEffect(()=>{f(c)},[c]),y.useUpdateEffect(()=>{f(d==s)},[d]),z.jsx(_,{ref:l,onFocus:$,onBlur:R,onClick:O,onKeyDown:C,disabled:a,type:n,first:u,last:o,fullWidth:v,active:W,...q,...w,children:U})});T.propTypes={type:r.PropTypes.oneOf(["regular","pill","underline"]),first:r.PropTypes.bool,last:r.PropTypes.bool,fullWidth:r.PropTypes.bool,active:r.PropTypes.bool,onClick:r.PropTypes.func,onBlur:r.PropTypes.func,onFocus:r.PropTypes.func,onKeyDown:r.PropTypes.func,className:r.PropTypes.string,style:r.PropTypes.object,color:r.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral","gray"]),size:r.PropTypes.oneOf(["small","medium","large"])};module.exports=T;
|
package/dist/TabItem.js
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { jsx as j } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as D, useState as H } from "react";
|
|
3
|
+
import { P as t } from "./index-BYnWp42a.js";
|
|
4
|
+
import { n as I } from "./emotion-styled.browser.esm-BiK8DcgW.js";
|
|
5
|
+
import { h as S, g as A, a as i, b as o } from "./utils-C52T57HO.js";
|
|
6
|
+
import { u as F } from "./emotion-element-5486c51c.browser.esm-Bb4VkP8U.js";
|
|
7
|
+
import { u as h } from "./useUpdateEffect-CuYWz7EA.js";
|
|
8
|
+
const K = (e) => e == "small" ? "3.125rem" : e == "medium" ? "3.375rem" : "3.625rem", V = I.div`
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
${(e) => e.disabled === !0 && S(e.theme)};
|
|
11
|
+
min-width: 5.25rem;
|
|
12
|
+
${(e) => e.fullWidth && "width: 100%"};
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
align-items: center;
|
|
16
|
+
|
|
17
|
+
height: ${(e) => K(e.size)};
|
|
18
|
+
${(e) => A(
|
|
19
|
+
e.theme,
|
|
20
|
+
a(e.type),
|
|
21
|
+
e.size,
|
|
22
|
+
"enabled"
|
|
23
|
+
)};
|
|
24
|
+
${(e) => !e.disabled && "cursor: pointer"};
|
|
25
|
+
color: ${(e) => !e.disabled && i(
|
|
26
|
+
e.theme,
|
|
27
|
+
a(e.type),
|
|
28
|
+
e.color,
|
|
29
|
+
e.active ? "active" : "enabled",
|
|
30
|
+
"text"
|
|
31
|
+
)};
|
|
32
|
+
background-color: ${(e) => e.type == "regular" || e.type == "pill" && (e.disabled == !0 || e.active == !1) ? "transparent" : !e.disabled && i(
|
|
33
|
+
e.theme,
|
|
34
|
+
a(e.type),
|
|
35
|
+
e.color,
|
|
36
|
+
e.active ? "active" : "enabled",
|
|
37
|
+
"background",
|
|
38
|
+
"backgroundOpacity"
|
|
39
|
+
)};
|
|
40
|
+
${(e) => e.type == "underline" && e.last == !1 && "border-right: 1px solid " + i(
|
|
41
|
+
e.theme,
|
|
42
|
+
a(e.type),
|
|
43
|
+
e.color,
|
|
44
|
+
"enabled",
|
|
45
|
+
"line"
|
|
46
|
+
)};
|
|
47
|
+
${(e) => y(
|
|
48
|
+
e.theme,
|
|
49
|
+
e.type,
|
|
50
|
+
e.active,
|
|
51
|
+
e.disabled,
|
|
52
|
+
e.color,
|
|
53
|
+
"enabled"
|
|
54
|
+
)};
|
|
55
|
+
${(e) => E(e.theme, e.type, e.first, e.last)};
|
|
56
|
+
&:hover {
|
|
57
|
+
color: ${(e) => !e.disabled && i(
|
|
58
|
+
e.theme,
|
|
59
|
+
a(e.type),
|
|
60
|
+
e.color,
|
|
61
|
+
"hover",
|
|
62
|
+
"text"
|
|
63
|
+
)};
|
|
64
|
+
background-color: ${(e) => e.type == "regular" ? "transparent" : !e.disabled && i(
|
|
65
|
+
e.theme,
|
|
66
|
+
a(e.type),
|
|
67
|
+
e.color,
|
|
68
|
+
"hover",
|
|
69
|
+
"background",
|
|
70
|
+
"backgroundOpacity"
|
|
71
|
+
)};
|
|
72
|
+
${(e) => y(
|
|
73
|
+
e.theme,
|
|
74
|
+
e.type,
|
|
75
|
+
e.active,
|
|
76
|
+
e.disabled,
|
|
77
|
+
e.color,
|
|
78
|
+
"hover"
|
|
79
|
+
)};
|
|
80
|
+
}
|
|
81
|
+
&:active {
|
|
82
|
+
background: ${(e) => i(
|
|
83
|
+
e.theme,
|
|
84
|
+
a(e.type),
|
|
85
|
+
e.color,
|
|
86
|
+
"active",
|
|
87
|
+
"background",
|
|
88
|
+
"backgroundOpacity"
|
|
89
|
+
)};
|
|
90
|
+
}
|
|
91
|
+
`, a = (e) => e == "underline" ? "TabUnderline" : e == "pill" ? "TabPill" : "TabRegular", E = (e, r, n, l) => {
|
|
92
|
+
if (r == "pill")
|
|
93
|
+
return `border-radius: ${o(e, "regular")}`;
|
|
94
|
+
if (r == "underline" && n)
|
|
95
|
+
return `border-radius: ${o(
|
|
96
|
+
e,
|
|
97
|
+
"regular"
|
|
98
|
+
)} 0 0 ${o(e, "regular")}`;
|
|
99
|
+
if (r == "underline" && l)
|
|
100
|
+
return `border-radius: 0 ${o(
|
|
101
|
+
e,
|
|
102
|
+
"regular"
|
|
103
|
+
)} ${o(e, "regular")} 0`;
|
|
104
|
+
}, y = (e, r, n, l, c, u) => {
|
|
105
|
+
if (r != "pill")
|
|
106
|
+
return `border-bottom: ${!l && (n || u == "hover") ? e.components[r === "regular" ? "TabRegular" : "TabUnderline"].default.enabled.lineHeight + "" : e.components[r === "regular" ? "TabRegular" : "TabUnderline"].default.hover.lineHeight + ""} solid ${i(
|
|
107
|
+
e,
|
|
108
|
+
a(r),
|
|
109
|
+
c,
|
|
110
|
+
n && !l ? "active" : l ? "enabled" : u,
|
|
111
|
+
"line"
|
|
112
|
+
)}`;
|
|
113
|
+
}, L = D((e, r) => {
|
|
114
|
+
const {
|
|
115
|
+
type: n = "underline",
|
|
116
|
+
disabled: l,
|
|
117
|
+
first: c = !1,
|
|
118
|
+
last: u = !1,
|
|
119
|
+
fullWidth: v = !1,
|
|
120
|
+
active: d = !1,
|
|
121
|
+
activeIndex: s,
|
|
122
|
+
index: b,
|
|
123
|
+
//----------------
|
|
124
|
+
onFocus: $ = () => {
|
|
125
|
+
},
|
|
126
|
+
onBlur: k = () => {
|
|
127
|
+
},
|
|
128
|
+
onClick: m = () => {
|
|
129
|
+
},
|
|
130
|
+
onKeyDown: T = () => {
|
|
131
|
+
},
|
|
132
|
+
itemClick: f = () => {
|
|
133
|
+
},
|
|
134
|
+
//----------------
|
|
135
|
+
size: x = "small",
|
|
136
|
+
color: C = "primary",
|
|
137
|
+
className: w = "",
|
|
138
|
+
style: R = {},
|
|
139
|
+
children: O,
|
|
140
|
+
...B
|
|
141
|
+
} = e, U = F(), [z, g] = H(d), N = {
|
|
142
|
+
theme: U,
|
|
143
|
+
color: C,
|
|
144
|
+
size: x,
|
|
145
|
+
style: R,
|
|
146
|
+
className: "lnc-ui-tabitem " + w
|
|
147
|
+
}, P = (W) => {
|
|
148
|
+
f && !l && f(b), m && !l && m(W);
|
|
149
|
+
};
|
|
150
|
+
return h(() => {
|
|
151
|
+
g(d);
|
|
152
|
+
}, [d]), h(() => {
|
|
153
|
+
g(s == b);
|
|
154
|
+
}, [s]), /* @__PURE__ */ j(
|
|
155
|
+
V,
|
|
156
|
+
{
|
|
157
|
+
ref: r,
|
|
158
|
+
onFocus: $,
|
|
159
|
+
onBlur: k,
|
|
160
|
+
onClick: P,
|
|
161
|
+
onKeyDown: T,
|
|
162
|
+
disabled: l,
|
|
163
|
+
type: n,
|
|
164
|
+
first: c,
|
|
165
|
+
last: u,
|
|
166
|
+
fullWidth: v,
|
|
167
|
+
active: z,
|
|
168
|
+
...N,
|
|
169
|
+
...B,
|
|
170
|
+
children: O
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
});
|
|
174
|
+
L.propTypes = {
|
|
175
|
+
type: t.oneOf(["regular", "pill", "underline"]),
|
|
176
|
+
/**
|
|
177
|
+
* Is it first Tab Item in Tab Wrapper
|
|
178
|
+
* }
|
|
179
|
+
*/
|
|
180
|
+
first: t.bool,
|
|
181
|
+
/**
|
|
182
|
+
* Is it last Tab Item in Tab Wrapper
|
|
183
|
+
* }
|
|
184
|
+
*/
|
|
185
|
+
last: t.bool,
|
|
186
|
+
fullWidth: t.bool,
|
|
187
|
+
active: t.bool,
|
|
188
|
+
//---------------------------------------------------------------
|
|
189
|
+
onClick: t.func,
|
|
190
|
+
onBlur: t.func,
|
|
191
|
+
onFocus: t.func,
|
|
192
|
+
onKeyDown: t.func,
|
|
193
|
+
//---------------------------------------------------------------
|
|
194
|
+
className: t.string,
|
|
195
|
+
style: t.object,
|
|
196
|
+
color: t.oneOf([
|
|
197
|
+
"primary",
|
|
198
|
+
"secondary",
|
|
199
|
+
"success",
|
|
200
|
+
"warning",
|
|
201
|
+
"danger",
|
|
202
|
+
"information",
|
|
203
|
+
"neutral",
|
|
204
|
+
"gray"
|
|
205
|
+
]),
|
|
206
|
+
size: t.oneOf(["small", "medium", "large"])
|
|
207
|
+
};
|
|
208
|
+
export {
|
|
209
|
+
L as default
|
|
210
|
+
};
|
package/dist/Table.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),b=require("react"),w=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),b=require("react"),w=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),r=require("./index-BIlhCoy2.cjs"),o=require("./utils-DTAPpJXU.cjs"),oe=require("./index-DBXXH_TD.cjs"),O=require("./_commonjsHelpers-DKOUU3wS.cjs"),A=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),$e=require("./index-DAOBjHnD.cjs"),ne=require("./CheckBoxInput.cjs"),Ne=require("./Icon.cjs"),De=require("./Spinner.cjs");var ke=o.isBrowser?b.useLayoutEffect:b.useEffect,le={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function ze(){var e=b.useState(null),d=e[0],t=e[1],n=b.useState(le),c=n[0],u=n[1],T=b.useMemo(function(){return new window.ResizeObserver(function(y){if(y[0]){var f=y[0].contentRect,E=f.x,C=f.y,P=f.width,h=f.height,R=f.top,j=f.left,x=f.bottom,p=f.right;u({x:E,y:C,width:P,height:h,top:R,left:j,bottom:x,right:p})}})},[]);return ke(function(){if(d)return T.observe(d),function(){T.disconnect()}},[d]),[t,c]}const Fe=o.isBrowser&&typeof window.ResizeObserver<"u"?ze:function(){return[o.noop,le]};var Ve=typeof O.commonjsGlobal=="object"&&O.commonjsGlobal&&O.commonjsGlobal.Object===Object&&O.commonjsGlobal,We=typeof self=="object"&&self&&self.Object===Object&&self,Ye=Ve||We||Function("return this")(),Ge=Ye.isFinite;function qe(e){return typeof e=="number"&&Ge(e)}var Ue=qe;const Me=O.getDefaultExportFromCjs(Ue);function Xe(e){var d=typeof e;return!!e&&(d=="object"||d=="function")}var Je=Xe;const Ke=O.getDefaultExportFromCjs(Je),Qe=w.newStyled.tbody``,W=e=>{const{__TYPE__:d="TABLE_BODY",className:t="",size:n="small",color:c="primary"}=e,u=A.useTheme(),T={className:t,size:n,color:c,theme:u};return a.jsx(Qe,{"data-tbody":!0,...T,children:e.children})};W.propTypes={__TYPE__:r.PropTypes.string,className:r.PropTypes.string,size:r.PropTypes.oneOf(["small","medium","large"]),color:r.PropTypes.oneOf(["primary","secondary","success","danger","warning","information","neutral","gray"])};W.displayName="TABLE_BODY";const Ze=w.newStyled.thead`
|
|
2
2
|
border-radius: 0.5rem 0.5rem 0 0;
|
|
3
|
-
`,
|
|
3
|
+
`,Y=e=>{const{__TYPE__:d="TABLE_HEAD",className:t="",size:n="small",color:c="primary"}=e,u=A.useTheme(),T={className:t,size:n,color:c,theme:u};return a.jsx(Ze,{...T,children:e.children})};Y.propTypes={__TYPE__:r.PropTypes.string,className:r.PropTypes.string,size:r.PropTypes.oneOf(["small","medium","large"]),color:r.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral","gray"])};Y.displayName="TABLE_HEAD";const er=w.newStyled.tr`
|
|
4
4
|
${e=>e.noBorder==!1&&`border-bottom: 1px solid ${o.getColorRgbaValue(e.theme,"TableRow",null,"enabled","border")};`}
|
|
5
5
|
${e=>e.noBorder==!1&&`border-left: 1px solid ${o.getColorRgbaValue(e.theme,"TableRow",null,"enabled","border")};`}
|
|
6
6
|
${e=>e.noBorder==!1&&`border-right: 1px solid ${o.getColorRgbaValue(e.theme,"TableRow",null,"enabled","border")};`}
|
|
@@ -21,7 +21,7 @@ ${e=>e.noBorder==!1&&`border-right: 1px solid ${o.getColorRgbaValue(e.theme,"Tab
|
|
|
21
21
|
background-color: ${o.getColorRgbaValue(e.theme,"TableRow",e.color,"active","background")};
|
|
22
22
|
}
|
|
23
23
|
`:""}
|
|
24
|
-
`,
|
|
24
|
+
`,G=e=>{const{__TYPE__:d="TABLE_ROW",onRowClick:t=()=>{},RowData:n={},Index:c,IsSelected:u=null,noBorder:T=!1,className:y="",size:f="small",color:E="primary"}=e,C=A.useTheme(),P={className:y,size:f,color:E,theme:C},h=R=>{R.stopPropagation(),R.nativeEvent.stopImmediatePropagation(),t&&t(R,n)};return b.createElement(er,{...P,IsSelected:u,key:c,onClick:h,noBorder:T},e.children)};G.propTypes={__TYPE__:r.PropTypes.string,onRowClick:r.PropTypes.func,RowData:r.PropTypes.object,IsSelected:r.PropTypes.bool,noBorder:r.PropTypes.bool,className:r.PropTypes.string,size:r.PropTypes.oneOf(["small","medium","large"]),color:r.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral","gray"])};G.displayName="TABLE_ROW";var rr="[object AsyncFunction]",or="[object Function]",tr="[object GeneratorFunction]",nr="[object Null]",lr="[object Proxy]",ar="[object Undefined]",sr=typeof O.commonjsGlobal=="object"&&O.commonjsGlobal&&O.commonjsGlobal.Object===Object&&O.commonjsGlobal,ir=typeof self=="object"&&self&&self.Object===Object&&self,dr=sr||ir||Function("return this")(),ae=Object.prototype,cr=ae.hasOwnProperty,se=ae.toString,te=dr.Symbol,B=te?te.toStringTag:void 0;function ur(e){return e==null?e===void 0?ar:nr:B&&B in Object(e)?mr(e):pr(e)}function mr(e){var d=cr.call(e,B),t=e[B];try{e[B]=void 0;var n=!0}catch{}var c=se.call(e);return n&&(d?e[B]=t:delete e[B]),c}function pr(e){return se.call(e)}function gr(e){if(!Tr(e))return!1;var d=ur(e);return d==or||d==tr||d==rr||d==lr}function Tr(e){var d=typeof e;return e!=null&&(d=="object"||d=="function")}var br=gr;const yr=O.getDefaultExportFromCjs(br),hr=w.newStyled.td`
|
|
25
25
|
white-space: nowrap;
|
|
26
26
|
overflow: hidden;
|
|
27
27
|
text-overflow: ellipsis;
|
|
@@ -33,19 +33,19 @@ ${e=>e.noBorder==!1&&`border-right: 1px solid ${o.getColorRgbaValue(e.theme,"Tab
|
|
|
33
33
|
${e=>e.bgColor}
|
|
34
34
|
|
|
35
35
|
${e=>o.getComponentTypographyCss(e.theme,"TableCell",e.size,"enabled")};
|
|
36
|
-
`,
|
|
36
|
+
`,q=e=>{const{__TYPE__:d="TABLE_CELL",Column:t={},RowData:n={},Index:c=0,EnableSelection:u=!1,EnableRowHighlight:T=!1,GetRowHighlightColor:y=()=>"",className:f="",size:E="small",color:C="primary"}=e,P=A.useTheme(),h={className:f,size:E,color:C,theme:P},R=i=>{const S=new Option().style;return S.color=i,S.color!==""},j=()=>t&&t.width?t.width+"%":"auto",x=()=>{var i=y(n);return T===!0&&R(i)?`
|
|
37
37
|
background-color: ${i};
|
|
38
|
-
`:""},p=()=>{if(t.render&&
|
|
38
|
+
`:""},p=()=>{if(t.render&&yr(t.render)){var i=t.render(n);if(b.isValidElement(i))return i;console.error(`${t.id}/${t.accessor}: invalid render function.`)}return $e.isEmpty(t.accessor)&&console.error(`${t.index}: accessor property is required when the render function is not suplied`),n[t.accessor]};return b.createElement(hr,{...h,bgColor:x(),selection:u,width:j(),key:c,title:n[t.accessor]},p())};q.propTypes={__TYPE__:r.PropTypes.string,Column:r.PropTypes.object,RowData:r.PropTypes.object,Index:r.PropTypes.number,EnableSelection:r.PropTypes.bool,EnableRowHighlight:r.PropTypes.bool,GetRowHighlightColor:r.PropTypes.func,className:r.PropTypes.string,size:r.PropTypes.oneOf(["small","medium","large"]),color:r.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral","gray"])};q.displayName="TABLE_CELL";const fr=w.newStyled.td`
|
|
39
39
|
padding: 0 0 0 1.25rem;
|
|
40
40
|
background-color: ${e=>o.getColorRgbaValue(e.theme,"TableRow",null,"enabled","background")};
|
|
41
41
|
|
|
42
42
|
width: ${e=>e.width}%;
|
|
43
43
|
${e=>e.bgColor}
|
|
44
|
-
`,
|
|
44
|
+
`,U=e=>{const{__TYPE__:d="TABLE_SELECTION_CELL",RowData:t={},onSelectRow:n=()=>{},IsSelected:c=null,Index:u=0,EnableRowHighlight:T=!1,GetRowHighlightColor:y=()=>"",className:f="",size:E="small",color:C="primary"}=e,P=A.useTheme(),h={className:f,size:E,color:C,theme:P},R=(p,i)=>{n(p,t,c)},j=p=>{const i=new Option().style;return i.color=p,i.color!==""},x=()=>{var p=y(t);return T===!0&&j(p)?`
|
|
45
45
|
background-color: ${p};
|
|
46
|
-
`:""};return b.createElement(
|
|
46
|
+
`:""};return b.createElement(fr,{bgColor:x(),...h,key:u,width:e.width},a.jsx(ne,{id:u,checked:c,onChange:R}))};U.propTypes={__TYPE__:r.PropTypes.string,Column:r.PropTypes.object,RowData:r.PropTypes.object,onSelectRow:r.PropTypes.func,Index:r.PropTypes.number,SelectedData:r.PropTypes.array,IsSelected:r.PropTypes.bool,EnableRowHighlight:r.PropTypes.bool,GetRowHighlightColor:r.PropTypes.func,className:r.PropTypes.string,size:r.PropTypes.oneOf(["small","medium","large"]),color:r.PropTypes.oneOf(["primary","secondary","success","danger","warning","information","neutral","gray"])};U.displayName="TABLE_SELECTION_CELL";const Cr=w.newStyled.tr`
|
|
47
47
|
border-radius: 0.5rem 0.5rem 0 0;
|
|
48
|
-
`,
|
|
48
|
+
`,M=e=>{const{__TYPE__:d="TABLE_HEAD_ROW",Index:t=0,className:n="",size:c="small",color:u="primary"}=e,T=A.useTheme(),y={className:n,size:c,color:u,theme:T};return b.createElement(Cr,{...y,key:t},e.children)};M.propTypes={__TYPE__:r.PropTypes.string,Index:r.PropTypes.any,className:r.PropTypes.string,size:r.PropTypes.oneOf(["small","medium","large"]),color:r.PropTypes.oneOf(["primary","secondary","success","danger","warning","information","neutral","gray"])};M.displayName="TABLE_HEAD_ROW";const Er=w.newStyled.th`
|
|
49
49
|
white-space: nowrap;
|
|
50
50
|
overflow: hidden;
|
|
51
51
|
text-overflow: ellipsis;
|
|
@@ -79,11 +79,11 @@ white-space: nowrap;
|
|
|
79
79
|
border-radius: 0 0.5rem 0 0;
|
|
80
80
|
border-right: ${e=>"1px solid "+o.getColorRgbaValue(e.theme,"TableHeadCell",null,"enabled","border")}};
|
|
81
81
|
}
|
|
82
|
-
`,
|
|
82
|
+
`,_r=w.newStyled.div`
|
|
83
83
|
display: flex;
|
|
84
84
|
flex-direction: row;
|
|
85
85
|
align-items: center;
|
|
86
|
-
`,
|
|
86
|
+
`,wr=w.newStyled.span`
|
|
87
87
|
padding-right: 0.25rem;
|
|
88
88
|
white-space: nowrap;
|
|
89
89
|
overflow: hidden;
|
|
@@ -92,13 +92,13 @@ white-space: nowrap;
|
|
|
92
92
|
color: ${e=>o.getColorRgbaValue(e.theme,"TableHeadCell",e.color,"enabled","text")};
|
|
93
93
|
|
|
94
94
|
font-weight: ${e=>o.getColorRgbaValue(e.theme,"TableHeadCell",e.color,"enabled","fontWeight")};
|
|
95
|
-
`,
|
|
95
|
+
`,Pr=w.newStyled.span`
|
|
96
96
|
& i {
|
|
97
97
|
color: ${e=>e.sort?"transparent":o.getColorRgbaValue(e.theme,"TableHeadCell",e.color,"enabled","text")};
|
|
98
98
|
|
|
99
99
|
font-weight: ${e=>o.getColorRgbaValue(e.theme,"TableHeadCell",e.color,"enabled","fontWeight")};
|
|
100
100
|
}
|
|
101
|
-
`,
|
|
101
|
+
`,X=e=>{const{__TYPE__:d="TABLE_HEAD_CELL",Column:t={},Ordering:n={},Index:c=0,onColumnClick:u=()=>{},EnableSelectAll:T=!1,EnableOrdering:y=!1,className:f="",size:E="small",color:C="primary"}=e,P=A.useTheme(),h={className:f,size:E,color:C,theme:P},R=()=>{if(t.sortable===!0&&y===!0){let p;return n&&n.columnId===t.id?(n.ascending===!0&&(p="angle-up"),n.descending===!0&&(p="angle-down"),n.ascending&&n.descending&&(p="sort")):p="sort",a.jsx(Pr,{...h,sort:p==="sort",children:a.jsx(Ne,{...h,sizeInUnits:"14px",icon:p})})}return a.jsx(a.Fragment,{})},j=p=>{var i={columnId:t.id,ascending:!1,descending:!0};y===!0&&t.sortable===!0&&n&&n.columnId===t.id&&(n.ascending===!0&&(i.ascending=!1,i.descending=!1),n.descending===!0&&(i.ascending=!0,i.descending=!1),n.descending===!1&&n.ascending===!1&&(i.ascending=!1,i.descending=!0),u(p,t,i)),y===!0&&t.sortable===!0&&n&&n.columnId!==t.id&&u(p,t,i),(t.sortable!==!0||y!==!0)&&u(p,t)},x=()=>t&&t.width?t.width+"%":"auto";return b.createElement(Er,{onClick:j,...h,selection:T,ordering:y===!0&&t.sortable===!0,key:c,width:x(),title:t.displayName},a.jsxs(_r,{...h,children:[a.jsx(wr,{...h,children:t.displayName}),R()]}))};X.propTypes={__TYPE__:r.PropTypes.string,Columns:r.PropTypes.object,Ordering:r.PropTypes.object,Index:r.PropTypes.any,EnableSelectAll:r.PropTypes.bool,EnableOrdering:r.PropTypes.bool,onColumnClick:r.PropTypes.func,className:r.PropTypes.string,size:r.PropTypes.oneOf(["small","medium","large"]),color:r.PropTypes.oneOf(["primary","secondary","success","danger","warning","information","neutral","gray"])};X.displayName="TABLE_HEAD_CELL";const Rr=w.newStyled.th`
|
|
102
102
|
text-align: left;
|
|
103
103
|
width: ${e=>e.width};
|
|
104
104
|
padding-left: 1.25rem;
|
|
@@ -108,17 +108,17 @@ white-space: nowrap;
|
|
|
108
108
|
border-bottom: ${e=>"1px solid "+o.getColorRgbaValue(e.theme,"TableHeadCell",null,"enabled","border")}};
|
|
109
109
|
|
|
110
110
|
border-radius: 0.5rem 0 0 0;
|
|
111
|
-
`,
|
|
111
|
+
`,J=e=>{const{__TYPE__:d="TABLE_HEAD_SELECTION_CELL",EnableSelectAll:t,IsSelected:n=null,Index:c=0,onSelectAll:u,className:T="",size:y="small",color:f="primary"}=e,E=A.useTheme(),C={className:T,size:y,color:f,theme:E};return b.createElement(Rr,{...C,selection:t,key:c,width:e.width},t&&a.jsx(ne,{id:c,checked:n||!1,onChange:P=>u(P,n)}))};J.propTypes={__TYPE__:r.PropTypes.string,Index:r.PropTypes.number,IsSelected:r.PropTypes.bool,EnableSelectAll:r.PropTypes.bool,className:r.PropTypes.string,size:r.PropTypes.oneOf(["small","medium","large"]),color:r.PropTypes.oneOf(["primary","secondary","success","danger","warning","information","neutral","gray"])};J.displayName="TABLE_HEAD_SELECTION_CELL";const Sr=w.newStyled.td`
|
|
112
112
|
white-space: nowrap;
|
|
113
113
|
overflow: hidden;
|
|
114
114
|
text-overflow: ellipsis;
|
|
115
115
|
padding: 0.25rem 0.125rem;
|
|
116
|
-
`,
|
|
116
|
+
`,Lr=w.newStyled.div`
|
|
117
117
|
width: ${e=>e.width};
|
|
118
118
|
height: 100%;
|
|
119
119
|
border-radius: 100px;
|
|
120
120
|
background-color: ${e=>e.bgColor} !important;
|
|
121
|
-
`,
|
|
121
|
+
`,K=e=>{const{__TYPE__:d="TABLE_ROW_STATUS_INDICATOR_CELL",RowData:t={},Index:n,GetRowStatusIndicatorColor:c,className:u="",size:T="small",color:y="Primary"}=e,f=A.useTheme(),E={className:u,size:T,color:y,theme:f},C=()=>"4px",P=h=>{const R=new Option().style;return R.color=h,R.color!==""};return b.createElement(Sr,{...E,width:C(),key:n,bgColor:()=>{var h=c(t);return P(h)?h:o.statusColor.NONE}},a.jsx(Lr,{...E,width:C(),bgColor:()=>{var h=c(t);return P(h)?h:o.statusColor.NONE}}))};K.propTypes={__TYPE__:r.PropTypes.string,Column:r.PropTypes.object,RowData:r.PropTypes.object,className:r.PropTypes.string,size:r.PropTypes.oneOf(["small","medium","large"]),color:r.PropTypes.oneOf(["primary","secondary","success","danger","warning","information","neutral","gray"])};K.displayName="TABLE_ROW_STATUS_INDICATOR_CELL";const Or=w.newStyled.th`
|
|
122
122
|
padding: 0.125rem;
|
|
123
123
|
width: 8px;
|
|
124
124
|
|
|
@@ -127,7 +127,7 @@ white-space: nowrap;
|
|
|
127
127
|
border-bottom: ${e=>"1px solid "+o.getColorRgbaValue(e.theme,"TableHeadCell",null,"enabled","border")}};
|
|
128
128
|
|
|
129
129
|
border-radius: 0.5rem 0 0 0;
|
|
130
|
-
`,
|
|
130
|
+
`,Q=e=>{const{__TYPE__:d="TABLE_HEAD_ROW_STATUS_INDICATOR_CELL",Index:t,className:n="",size:c="small",color:u="primary"}=e,T=A.useTheme(),y={className:n,size:c,color:u,theme:T};return b.createElement(Or,{...y,key:t})};Q.propTypes={__TYPE__:r.PropTypes.string,className:r.PropTypes.string,size:r.PropTypes.oneOf(["small","medium","large"]),color:r.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral","gray"])};Q.displayName="TABLE_HEAD_ROW_STATUS_INDICATOR_CELL";const Ar=w.newStyled.div`
|
|
131
131
|
display: flex;
|
|
132
132
|
flex-direction: column;
|
|
133
133
|
padding: 0.625rem;
|
|
@@ -138,7 +138,7 @@ white-space: nowrap;
|
|
|
138
138
|
position: relative;
|
|
139
139
|
|
|
140
140
|
${e=>o.getComponentTypographyCss(e.theme,"Table",e.size,"enabled")};
|
|
141
|
-
`,
|
|
141
|
+
`,xr=w.newStyled.div`
|
|
142
142
|
position: absolute;
|
|
143
143
|
top: 0px;
|
|
144
144
|
right: 0px;
|
|
@@ -152,7 +152,7 @@ white-space: nowrap;
|
|
|
152
152
|
display: flex;
|
|
153
153
|
align-items: center;
|
|
154
154
|
justify-content: center;
|
|
155
|
-
`,
|
|
155
|
+
`,jr=w.newStyled.table`
|
|
156
156
|
height: 1px;
|
|
157
157
|
width: ${e=>e.tableWidth};
|
|
158
158
|
white-space: nowrap;
|
|
@@ -161,10 +161,10 @@ white-space: nowrap;
|
|
|
161
161
|
border-style: hidden;
|
|
162
162
|
table-layout: fixed;
|
|
163
163
|
${e=>e.noBorder==!1&&`box-shadow: 0 0 0 0.0625rem ${o.getColorRgbaValue(e.theme,"Table",null,"enabled","border")};`}
|
|
164
|
-
`,
|
|
164
|
+
`,Ir=w.newStyled.span`
|
|
165
165
|
display: flex;
|
|
166
166
|
align-items: center;
|
|
167
167
|
justify-content: center;
|
|
168
168
|
${e=>o.getComponentTypographyCss(e.theme,"Table",e.size,"enabled")};
|
|
169
169
|
padding: 0.5rem;
|
|
170
|
-
`,
|
|
170
|
+
`,Hr={TableContainer:"TABLE_CONTAINER",TableRow:"TABLE_ROW",TableCell:"TABLE_CELL",TableSelectionCell:"TABLE_SELLECTION_CELL",TableHeadRow:"TABLE_HEAD_ROW",TableHeadCell:"TABLE_HEAD_CELL",TableHeadSelectionCell:"TABLE_HEAD_SELECTION_CELL",TableHeader:"TABLE_HEADER",TableFooter:"TABLE_FOOTER",TableSpecialLastRow:"TABLE_SPECIAL_LAST_ROW",TableRowStatusIndicatorCell:"TABLE_ROW_STATUS_INDICATOR_CELL",TableHeadRowStatusIndicatorCell:"TABLE_HEAD_ROW_STATUS_INDICATOR_CELL",TableLoader:"TABLE_LOADER",TableBody:"TABLE_BODY",TableHead:"TABLE_HEAD"},Z=b.forwardRef((e,d)=>{var{__TYPE__:t="TABLE",EnableSelection:n=!1,EnableOrdering:c=!1,EnableSelectAll:u=!1,EnableLoader:T=!1,PreRenderedTableBody:y=!1,PreRenderedTableHead:f=!1,noBorder:E=!1,EnableRowStatusIndicator:C=!1,EnableRowHighlight:P=!1,GetRowStatusIndicatorColor:h=()=>{},GetRowHighlightColor:R=()=>{},NoDataText:j="No data to show",NoDataComponent:x=null,Loading:p=!1,Columns:i=[],Data:S=[],SelectedData:F=[],SelectedEntirePage:ie=!1,RowIdentifier:$="id",VisibilityPattern:I=null,Ordering:de={},onColumnClick:ce=()=>{},onRowClick:ue=()=>{},onSelectRow:ee=()=>{},onSelectAll:me=()=>{},tableWidth:pe="100%",className:ge="",style:vr={},color:Te="primary",size:k="small"}=e;const re=A.useTheme(),_={theme:re,color:Te,size:k};b.useImperativeHandle(d,()=>({getTableData:()=>S}),[S]);const[be,{width:v}]=Fe();var ye=o.useScreenSize();b.useEffect(()=>{n===!0&&($===null||$==="")&&console.error("Error: Selection is enabled but the 'RowIdentifier' is empty")},[]),b.useEffect(()=>{(i==null||i.length===0)&&console.error("Error: Columns array must have at least one item.")},[i]),b.useEffect(()=>{I&&(I.hasOwnProperty(o.screenSizes.XS.type)||console.error(N(o.screenSizes.XS.type)),I.hasOwnProperty(o.screenSizes.S.type)||console.error(N(o.screenSizes.S.type)),I.hasOwnProperty(o.screenSizes.M.type)||console.error(N(o.screenSizes.M.type)),I.hasOwnProperty(o.screenSizes.L.type)||console.error(N(o.screenSizes.L.type)),I.hasOwnProperty(o.screenSizes.XL.type)||console.error(N(o.screenSizes.XL.type)))},[I]);const N=l=>`Error: 'VisibilityPattern' missing property ${l}.`,z=()=>{let l=[];if(Ke(I)){var s=0;if(l=I[ye].map(m=>({...i.find(L=>String(L.id)===String(m.id)),...m})),n===!0){var s=D()/v*100/l.length;C===!0&&(s+=3/v*100),l=l.map(g=>({...g,width:g.width-s}))}}else if(l=i.map(m=>({...m})),n===!0){var s=D()/v*100/l.length;C===!0&&(s+=3/v*100),l=l.map(g=>({...g,width:g.width-s}))}return l},he=(l,s)=>{if(l&&l.length>0){var m=0,g=l.map(H=>H.width).reduce((H,V)=>H+V);n===!0&&(m=D()/v*100);var L=g+m;Me(L)&&(L>101||L<98)&&console.error(`Error: Row ${s} - sum of column widths is ${L}.`)}},fe=l=>{let s={},m=F.find(g=>String(g[$])===String(l[$]));return m!=null?s.IsSelected=!0:s.IsSelected=!1,s},D=()=>k==="small"?37:k==="medium"?43:k==="large"?49:37,Ce=(l={},s)=>{let m={};var g=z();he(g,s),n===!0&&(m=fe(l));var L={onRowClick:ue,onSelectRow:ee,RowData:l,SelectedData:F,EnableSelection:n,Columns:i,ColumnsToRender:g,Index:s,key:s,..._,...m},H=a.jsxs(a.Fragment,{children:[C===!0&&xe(l),n===!0&&_e(m.IsSelected,l),g.map((V,Be)=>Ee(l,V,Be,s,g))]});return o.renderCustomElement(o.getCustomRender("TABLE_ROW",e.children),L,H)||b.createElement(G,{...L,key:s,noBorder:E},H)},Ee=(l,s,m,g,L)=>{var H={RowData:l,Column:s,ColumnsToRender:L,Index:m,RowIndex:g,key:m,EnableSelection:n,RowIdentifier:$,EnableRowHighlight:P,GetRowHighlightColor:R,..._};return o.renderCustomElement(o.getCustomRender("TABLE_CELL",e.children),H)||b.createElement(q,{...H,key:m})},_e=(l,s,m=-1)=>{var g={SelectedData:F,RowData:s,onSelectRow:ee,Index:m,key:m,IsSelected:l,EnableRowHighlight:P,GetRowHighlightColor:R,..._};return o.renderCustomElement(o.getCustomRender("TABLE_SELLECTION_CELL",e.children),g)||b.createElement(U,{...g,key:m,width:D()/v*100})},we=()=>{var l={Columns:i,..._},s=a.jsxs(a.Fragment,{children:[C===!0&&je(),n===!0&&Re(),z().map((m,g)=>Pe(m,g))]});return o.renderCustomElement(o.getCustomRender("TABLE_HEAD_ROW",e.children),l,s)||b.createElement(M,{...l,key:0},s)},Pe=(l,s,m)=>{var g={Index:s,Column:l,Ordering:de,EnableOrdering:c,EnableSelectAll:u,onColumnClick:ce,ColumnsToRender:m,..._};return o.renderCustomElement(o.getCustomRender("TABLE_HEAD_CELL",e.children),g)||b.createElement(X,{...g,key:s})},Re=()=>{var l={Index:-1,IsSelected:ie,onSelectAll:me,EnableSelectAll:u,..._};return o.renderCustomElement(o.getCustomRender("TABLE_HEAD_SELECTION_CELL",e.children),l)||b.createElement(J,{...l,key:-1,width:D()/v*100})},Se=()=>o.renderCustomElement(o.getCustomRender("TABLE_HEADER",e.children),{Data:S,Columns:i,..._})||a.jsx(a.Fragment,{}),Le=()=>o.renderCustomElement(o.getCustomRender("TABLE_FOOTER",e.children),{Data:S,Columns:i,..._})||a.jsx(a.Fragment,{}),Oe=()=>o.renderCustomElement(o.getCustomRender("TABLE_SPECIAL_LAST_ROW",e.children),{Data:S,Columns:i,ColumnsToRender:z(),Disabled:p,..._})||a.jsx(a.Fragment,{}),Ae=()=>{if(S==null||S&&S.length===0){var l=z().length;return n===!0&&l++,C===!0&&l++,a.jsx("tr",{children:a.jsx("td",{colSpan:l,children:x?a.jsx(x,{}):a.jsx(Ir,{..._,children:j})})})}return a.jsx(a.Fragment,{})},xe=l=>{var s={..._,key:-1,RowData:l,GetRowStatusIndicatorColor:h};return C===!0?a.jsx(a.Fragment,{children:o.renderCustomElement(o.getCustomRender("TABLE_ROW_STATUS_INDICATOR_CELL",e.children),s)||a.jsx(K,{...s,noBorder:E})}):a.jsx(a.Fragment,{})},je=()=>{var l={..._,key:-1};return C===!0?a.jsx(a.Fragment,{children:o.renderCustomElement(o.getCustomRender("TABLE_HEAD_ROW_STATUS_INDICATOR_CELL",e.children),l)||a.jsx(Q,{...l})}):a.jsx(a.Fragment,{})},Ie=()=>T===!0&&p===!0?a.jsx(a.Fragment,{children:a.jsx(xr,{theme:re,children:o.renderCustomElement(o.getCustomRender("TABLE_LOADER",e.children),{..._,Loading:p})||a.jsx(De,{..._})})}):a.jsx(a.Fragment,{}),He=()=>{var l=oe.cloneDeep(e);delete l.__TYPE__;var s=a.jsxs(a.Fragment,{children:[S.map((m,g)=>Ce(m,g)),Ae()]});return o.renderCustomElement(o.getCustomRender("TABLE_BODY",e.children),l,y?s:void 0)||a.jsx(W,{..._,children:s})},ve=()=>{var l=oe.cloneDeep(e);delete l.__TYPE__;var s=a.jsx(a.Fragment,{children:we()});return o.renderCustomElement(o.getCustomRender("TABLE_HEAD",e.children),l,f?s:null)||a.jsx(Y,{..._,children:s})};return(()=>{var l={className:ge,Loading:p,..._},s=a.jsxs(a.Fragment,{children:[Ie(),Se(),a.jsxs(jr,{..._,width:pe||"100%","data-table":!0,ref:be,noBorder:E,children:[ve(),He()]}),Oe(),Le()]});return o.renderCustomElement(o.getCustomRender("TABLE_CONTAINER",e.children),l,s)||a.jsx(Ar,{...l,isLoading:T?p:!1,children:s})})()});Z.propTypes={__TYPE__:r.PropTypes.string,ID:r.PropTypes.string,noBorder:r.PropTypes.bool,EnableSelection:r.PropTypes.bool,EnableOrdering:r.PropTypes.bool,EnableLoader:r.PropTypes.bool,EnableSelectAll:r.PropTypes.bool,EnableRowStatusIndicator:r.PropTypes.bool,EnableRowHighlight:r.PropTypes.bool,GetRowStatusIndicatorColor:r.PropTypes.func,GetRowHighlightColor:r.PropTypes.func,NoDataText:r.PropTypes.string,NoDataComponet:r.PropTypes.node,Loading:r.PropTypes.bool,Columns:r.PropTypes.arrayOf(r.PropTypes.object),Data:r.PropTypes.arrayOf(r.PropTypes.object),SelectedData:r.PropTypes.arrayOf(r.PropTypes.object),SelectedEntirePage:r.PropTypes.bool,RowIdentifier:r.PropTypes.string,VisibilityPattern:r.PropTypes.object,Ordering:r.PropTypes.shape({columnId:r.PropTypes.number,ascending:r.PropTypes.bool,descending:r.PropTypes.bool}),onColumnClick:r.PropTypes.func,onRowClick:r.PropTypes.func,onSelectRow:r.PropTypes.func,onSelectAll:r.PropTypes.func,tableWidth:r.PropTypes.string,className:r.PropTypes.string,size:r.PropTypes.oneOf(["small","medium","large"]),color:r.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral","gray"])};Z.displayName="TABLE";exports.TableComponentOverrides=Hr;exports.default=Z;
|