@lanaco/lnc-react-ui 3.11.35 → 4.0.2
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/README.md +0 -3
- package/dist/Accordion.cjs +6 -0
- package/dist/Accordion.js +65 -0
- package/dist/AccordionDetails.cjs +7 -0
- package/dist/AccordionDetails.js +32 -0
- package/dist/AccordionSummary.cjs +12 -0
- package/dist/AccordionSummary.js +78 -0
- package/dist/ActionsToolbar.cjs +19 -0
- package/dist/ActionsToolbar.js +225 -0
- package/dist/Alert.cjs +40 -0
- package/dist/Alert.js +138 -0
- package/dist/Avatar.cjs +16 -0
- package/dist/Avatar.js +114 -0
- package/dist/Badge.cjs +17 -0
- package/dist/Badge.js +70 -0
- package/dist/Breadcrumbs.cjs +8 -0
- package/dist/Breadcrumbs.js +131 -0
- package/dist/Button.cjs +127 -0
- package/dist/Button.js +542 -0
- package/dist/ButtonGroup.cjs +44 -0
- package/dist/ButtonGroup.js +112 -0
- package/dist/CheckBoxInput.cjs +118 -0
- package/dist/CheckBoxInput.js +348 -0
- package/dist/Chip.cjs +27 -0
- package/dist/Chip.js +189 -0
- package/dist/ColorInput.cjs +60 -0
- package/dist/ColorInput.js +256 -0
- package/dist/ConfirmationForm.cjs +22 -0
- package/dist/ConfirmationForm.js +169 -0
- package/dist/Content.cjs +1 -0
- package/dist/Content.js +18 -0
- package/dist/CustomStyles-CqlCjTgU.cjs +8 -0
- package/dist/CustomStyles-nfD3J1mi.js +2881 -0
- package/dist/DataView.cjs +1 -0
- package/dist/DataView.js +62 -0
- package/dist/DateInput.cjs +296 -0
- package/dist/DateInput.js +7042 -0
- package/dist/DecimalInput.cjs +54 -0
- package/dist/DecimalInput.js +697 -0
- package/dist/DetailsView.cjs +18 -0
- package/dist/DetailsView.js +243 -0
- package/dist/DoubleRangeSlider.cjs +114 -0
- package/dist/DoubleRangeSlider.js +289 -0
- package/dist/DragAndDropFile.cjs +31 -0
- package/dist/DragAndDropFile.js +2331 -0
- package/dist/DragDropFiles.cjs +14 -0
- package/dist/DragDropFiles.js +175 -0
- package/dist/Drawer.cjs +6 -0
- package/dist/Drawer.js +206 -0
- package/dist/Dropdown.cjs +1 -0
- package/dist/Dropdown.js +266 -0
- package/dist/DropdownItem.cjs +36 -0
- package/dist/DropdownItem.js +241 -0
- package/dist/DropdownLookup.cjs +1 -0
- package/dist/DropdownLookup.js +325 -0
- package/dist/DropdownMenu-B6qr13ik.cjs +19 -0
- package/dist/DropdownMenu-DZi3TJ8Q.js +1547 -0
- package/dist/DropdownMenu.cjs +1 -0
- package/dist/DropdownMenu.js +12 -0
- package/dist/EditableTable.cjs +21 -0
- package/dist/EditableTable.js +462 -0
- package/dist/FileInput.cjs +47 -0
- package/dist/FileInput.js +206 -0
- package/dist/FlexBox.cjs +9 -0
- package/dist/FlexBox.js +97 -0
- package/dist/FlexGrid.cjs +1 -0
- package/dist/FlexGrid.js +78 -0
- package/dist/FlexGridItem.cjs +7 -0
- package/dist/FlexGridItem.js +97 -0
- package/dist/Footer.cjs +1 -0
- package/dist/Footer.js +18 -0
- package/dist/FormField.cjs +11 -0
- package/dist/FormField.js +65 -0
- package/dist/FormView.cjs +13 -0
- package/dist/FormView.js +354 -0
- package/dist/Grid.cjs +13 -0
- package/dist/Grid.js +62 -0
- package/dist/GridItem.cjs +15 -0
- package/dist/GridItem.js +72 -0
- package/dist/Header.cjs +1 -0
- package/dist/Header.js +18 -0
- package/dist/Icon.cjs +8 -0
- package/dist/Icon.js +59 -0
- package/dist/IconButton.cjs +122 -0
- package/dist/IconButton.js +481 -0
- package/dist/Kanban.cjs +85 -0
- package/dist/Kanban.js +4793 -0
- package/dist/KanbanActionsToolbar.cjs +19 -0
- package/dist/KanbanActionsToolbar.js +152 -0
- package/dist/KanbanCard-ConTmu3w.cjs +30 -0
- package/dist/KanbanCard-D9OhU8C6.js +175 -0
- package/dist/KanbanCard.cjs +1 -0
- package/dist/KanbanCard.js +12 -0
- package/dist/KanbanFooter.cjs +5 -0
- package/dist/KanbanFooter.js +84 -0
- package/dist/KanbanHeader.cjs +15 -0
- package/dist/KanbanHeader.js +127 -0
- package/dist/KanbanView.cjs +8 -0
- package/dist/KanbanView.js +255 -0
- package/dist/Link.cjs +15 -0
- package/dist/Link.js +62 -0
- package/dist/MenuItem.cjs +36 -0
- package/dist/MenuItem.js +230 -0
- package/dist/Modal.cjs +84 -0
- package/dist/Modal.js +372 -0
- package/dist/MultiSelectDropdown.cjs +1 -0
- package/dist/MultiSelectDropdown.js +261 -0
- package/dist/MultiSelectDropdownLookup.cjs +1 -0
- package/dist/MultiSelectDropdownLookup.js +274 -0
- package/dist/NestedDropdownItem.cjs +6 -0
- package/dist/NestedDropdownItem.js +102 -0
- package/dist/NestedMenuItem.cjs +6 -0
- package/dist/NestedMenuItem.js +115 -0
- package/dist/Notification.cjs +83 -0
- package/dist/Notification.js +1079 -0
- package/dist/NumberInput.cjs +45 -0
- package/dist/NumberInput.js +241 -0
- package/dist/PageLayout.cjs +26 -0
- package/dist/PageLayout.js +92 -0
- package/dist/PasswordInput.cjs +47 -0
- package/dist/PasswordInput.js +230 -0
- package/dist/ProgressBar.cjs +22 -0
- package/dist/ProgressBar.js +92 -0
- package/dist/RadioGroup.cjs +7 -0
- package/dist/RadioGroup.js +104 -0
- package/dist/RadioInput.cjs +117 -0
- package/dist/RadioInput.js +362 -0
- package/dist/RangeSlider.cjs +72 -0
- package/dist/RangeSlider.js +253 -0
- package/dist/SearchBar.cjs +100 -0
- package/dist/SearchBar.js +994 -0
- package/dist/Separator.cjs +6 -0
- package/dist/Separator.js +37 -0
- package/dist/Sidebar.cjs +39 -0
- package/dist/Sidebar.js +123 -0
- package/dist/Spinner.cjs +38 -0
- package/dist/Spinner.js +114 -0
- package/dist/Surface.cjs +7 -0
- package/dist/Surface.js +60 -0
- package/dist/SwipeableDrawer.cjs +33 -0
- package/dist/SwipeableDrawer.js +213 -0
- package/dist/Table.cjs +170 -0
- package/dist/Table.js +1408 -0
- package/dist/TableView-Cj5_fbSR.js +481 -0
- package/dist/TableView-D8ex512p.cjs +19 -0
- package/dist/TableView.cjs +1 -0
- package/dist/TableView.js +11 -0
- package/dist/Tabs.cjs +7 -0
- package/dist/Tabs.js +72 -0
- package/dist/TextAreaInput.cjs +33 -0
- package/dist/TextAreaInput.js +320 -0
- package/dist/TextInput.cjs +45 -0
- package/dist/TextInput.js +227 -0
- package/dist/ThemeProvider.cjs +113 -0
- package/dist/ThemeProvider.js +1340 -0
- package/dist/TimeInput.cjs +31 -0
- package/dist/TimeInput.js +133 -0
- package/dist/Toggle.cjs +151 -0
- package/dist/Toggle.js +421 -0
- package/dist/TreeMenu.cjs +15 -0
- package/dist/TreeMenu.js +108 -0
- package/dist/TreeMenuSeparator.cjs +6 -0
- package/dist/TreeMenuSeparator.js +40 -0
- package/dist/UploadedFile.cjs +39 -0
- package/dist/UploadedFile.js +192 -0
- package/dist/defineProperty-BHpTtkhC.js +110 -0
- package/dist/defineProperty-DHvxLH8G.cjs +1 -0
- package/dist/emotion-element-5486c51c.browser.esm-CSejtOeT.js +886 -0
- package/dist/emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs +1 -0
- package/dist/emotion-is-prop-valid.esm-BzFBwmJz.js +10 -0
- package/dist/emotion-is-prop-valid.esm-CMrshNb7.cjs +1 -0
- package/dist/emotion-react.browser.esm-DQBL7Wls.cjs +1 -0
- package/dist/emotion-react.browser.esm-OWM-uG8Q.js +94 -0
- package/dist/emotion-styled.browser.esm-BZSYYThs.js +210 -0
- package/dist/emotion-styled.browser.esm-Cbp_XsK4.cjs +1 -0
- package/dist/floating-ui.dom-1F2mTXOe.cjs +1 -0
- package/dist/floating-ui.dom-BdUovkEr.js +938 -0
- package/dist/hoist-non-react-statics.cjs-B8r9S_ak.cjs +15 -0
- package/dist/hoist-non-react-statics.cjs-Drf1aBlk.js +235 -0
- package/dist/index-BLQWNy78.js +109 -0
- package/dist/index-BP5r5zGN.cjs +1 -0
- package/dist/index-B_da1uvD.js +451 -0
- package/dist/index-BjdOz5Ok.cjs +1 -0
- package/dist/index-BklgDeu4.js +42 -0
- package/dist/index-C29T0m2a.cjs +174 -0
- package/dist/index-CZJEA84h.js +19069 -0
- package/dist/index-Cdkz-XH-.js +127 -0
- package/dist/index-D5vEbKUT.js +81 -0
- package/dist/index-DXnSjbfJ.cjs +20 -0
- package/dist/index-Ds9PUTwb.js +667 -0
- package/dist/index-Dzkd2i4n.cjs +1 -0
- package/dist/index-IO9v6o0I.cjs +5 -0
- package/dist/index-P-naJISQ.cjs +1 -0
- package/dist/index.cjs +26 -0
- package/dist/index.js +378 -0
- package/dist/motion-CtkUpWEn.js +3785 -0
- package/dist/motion-Oud-wpUz.cjs +1 -0
- package/dist/objectWithoutPropertiesLoose-Bz3hwpmU.cjs +1 -0
- package/dist/objectWithoutPropertiesLoose-DwEN6RBQ.js +12 -0
- package/dist/setPrototypeOf-4aSEnBDm.cjs +1 -0
- package/dist/setPrototypeOf-a891FLQJ.js +13 -0
- package/dist/style.css +5 -0
- package/dist/tslib.es6-ZNVz5r_T.js +90 -0
- package/dist/tslib.es6-fPwcSa2V.cjs +1 -0
- package/dist/use-isomorphic-layout-effect.browser.esm-CkGv31zs.cjs +1 -0
- package/dist/use-isomorphic-layout-effect.browser.esm-DERp5kr6.js +5 -0
- package/dist/useUpdateEffect-BtMgpgIV.cjs +1 -0
- package/dist/useUpdateEffect-CuYWz7EA.js +15 -0
- package/dist/utils-DEke8iwo.js +10196 -0
- package/dist/utils-hdRGTsQ7.cjs +13 -0
- package/eslint.config.js +38 -0
- package/package.json +137 -58
- package/vite.config.js +135 -0
- package/jest.config.js +0 -7
- package/lib/index.esm.js +0 -84028
- package/lib/index.js +0 -84165
- package/rc1 +0 -0
- package/test/jest/__mocks__/styleMock.js +0 -1
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
import { jsx as s, jsxs as H, Fragment as me } from "react/jsx-runtime";
|
|
2
|
+
import fe, { useState as J } from "react";
|
|
3
|
+
import { P as e } from "./index-Ds9PUTwb.js";
|
|
4
|
+
import { n as Z } from "./emotion-styled.browser.esm-BZSYYThs.js";
|
|
5
|
+
import ge from "./ActionsToolbar.js";
|
|
6
|
+
import P from "./Button.js";
|
|
7
|
+
import L from "./IconButton.js";
|
|
8
|
+
import be from "./ButtonGroup.js";
|
|
9
|
+
import { u as he } from "./emotion-element-5486c51c.browser.esm-CSejtOeT.js";
|
|
10
|
+
import { u as q } from "./useUpdateEffect-CuYWz7EA.js";
|
|
11
|
+
import { r as W, e as Y } from "./utils-DEke8iwo.js";
|
|
12
|
+
import we from "./Table.js";
|
|
13
|
+
const ye = Z.div`
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
flex-wrap: wrap;
|
|
16
|
+
width: 100%;
|
|
17
|
+
gap: 0.375rem;
|
|
18
|
+
justify-content: ${(h) => h.horizontalAlignment};
|
|
19
|
+
`, Ce = Z.div`
|
|
20
|
+
& > .button-group-pagination-lnc {
|
|
21
|
+
width: 100%;
|
|
22
|
+
justify-content: ${(h) => h.horizontalAlignment};
|
|
23
|
+
}
|
|
24
|
+
`, K = (h) => {
|
|
25
|
+
const {
|
|
26
|
+
icons: w = {},
|
|
27
|
+
borderRadius: y = "regular",
|
|
28
|
+
currentPage: D = 1,
|
|
29
|
+
buttonType: t = "outline",
|
|
30
|
+
currentPageButtonType: n = "tinted",
|
|
31
|
+
withFirstLast: v = !0,
|
|
32
|
+
withButtonGroup: R = !0,
|
|
33
|
+
disabledNext: O = !1,
|
|
34
|
+
disabledPrevious: U = !1,
|
|
35
|
+
disabledFirst: j = !1,
|
|
36
|
+
disabledLast: F = !1,
|
|
37
|
+
disabled: f = !1,
|
|
38
|
+
totalNumberOfPages: C = 1,
|
|
39
|
+
pagesOffset: E = 0,
|
|
40
|
+
horizontalAlignment: x = "left",
|
|
41
|
+
//------------------
|
|
42
|
+
onPageChange: I = () => {
|
|
43
|
+
},
|
|
44
|
+
//------------------
|
|
45
|
+
className: k = "",
|
|
46
|
+
style: A = {},
|
|
47
|
+
color: V = "primary",
|
|
48
|
+
size: G = "small"
|
|
49
|
+
} = h, u = { theme: he(), size: G, color: V, btnType: t }, [a, g] = J(D);
|
|
50
|
+
q(() => {
|
|
51
|
+
g(D);
|
|
52
|
+
}, [D]), q(() => {
|
|
53
|
+
I(a);
|
|
54
|
+
}, [a]);
|
|
55
|
+
const b = (c, o) => {
|
|
56
|
+
o == "next" && a < C ? g(a + 1) : o == "previous" && a > 1 ? g(a - 1) : o == "last" && a != C ? g(C) : o == "first" && a != 1 ? g(1) : isNaN(+o) || g(o);
|
|
57
|
+
}, M = () => {
|
|
58
|
+
let c = [];
|
|
59
|
+
for (let o = a - E > 0 ? a - E : 1; o < a && o > 0; o++)
|
|
60
|
+
c.push(
|
|
61
|
+
/* @__PURE__ */ s(
|
|
62
|
+
P,
|
|
63
|
+
{
|
|
64
|
+
...u,
|
|
65
|
+
borderRadius: y,
|
|
66
|
+
onClick: (r) => b(r, o),
|
|
67
|
+
btnType: "basic",
|
|
68
|
+
text: o.toString(),
|
|
69
|
+
disabled: f
|
|
70
|
+
},
|
|
71
|
+
o
|
|
72
|
+
)
|
|
73
|
+
);
|
|
74
|
+
c.push(
|
|
75
|
+
/* @__PURE__ */ s(
|
|
76
|
+
P,
|
|
77
|
+
{
|
|
78
|
+
...u,
|
|
79
|
+
borderRadius: y,
|
|
80
|
+
btnType: n,
|
|
81
|
+
text: a.toString(),
|
|
82
|
+
disabled: f
|
|
83
|
+
},
|
|
84
|
+
a
|
|
85
|
+
)
|
|
86
|
+
);
|
|
87
|
+
for (let o = a + 1; o <= a + E && o <= C; o++)
|
|
88
|
+
c.push(
|
|
89
|
+
/* @__PURE__ */ s(
|
|
90
|
+
P,
|
|
91
|
+
{
|
|
92
|
+
...u,
|
|
93
|
+
borderRadius: y,
|
|
94
|
+
onClick: (r) => b(r, o),
|
|
95
|
+
btnType: "basic",
|
|
96
|
+
text: o.toString(),
|
|
97
|
+
disabled: f
|
|
98
|
+
},
|
|
99
|
+
o
|
|
100
|
+
)
|
|
101
|
+
);
|
|
102
|
+
return c;
|
|
103
|
+
}, B = (c = null) => {
|
|
104
|
+
var o = {};
|
|
105
|
+
return c && (o.borderRadius = c), /* @__PURE__ */ H(me, { children: [
|
|
106
|
+
v && /* @__PURE__ */ s(
|
|
107
|
+
L,
|
|
108
|
+
{
|
|
109
|
+
...u,
|
|
110
|
+
icon: w.doubleLeft || "angle-double-left",
|
|
111
|
+
disabled: j || f,
|
|
112
|
+
onClick: (r) => b(r, "first"),
|
|
113
|
+
...o
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
/* @__PURE__ */ s(
|
|
117
|
+
L,
|
|
118
|
+
{
|
|
119
|
+
...u,
|
|
120
|
+
icon: w.left || "angle-left",
|
|
121
|
+
disabled: U || f,
|
|
122
|
+
onClick: (r) => b(r, "previous"),
|
|
123
|
+
...o
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
M(),
|
|
127
|
+
/* @__PURE__ */ s(
|
|
128
|
+
L,
|
|
129
|
+
{
|
|
130
|
+
...u,
|
|
131
|
+
icon: w.right || "angle-right",
|
|
132
|
+
disabled: O || f,
|
|
133
|
+
onClick: (r) => b(r, "next"),
|
|
134
|
+
...o
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
v && /* @__PURE__ */ s(
|
|
138
|
+
L,
|
|
139
|
+
{
|
|
140
|
+
...u,
|
|
141
|
+
icon: w.doubleRight || "angle-double-right",
|
|
142
|
+
disabled: F || f,
|
|
143
|
+
onClick: (r) => b(r, "last"),
|
|
144
|
+
...o
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
] });
|
|
148
|
+
};
|
|
149
|
+
return R ? /* @__PURE__ */ s(Ce, { horizontalAlignment: x, children: /* @__PURE__ */ s(
|
|
150
|
+
be,
|
|
151
|
+
{
|
|
152
|
+
className: "button-group-pagination-lnc " + k,
|
|
153
|
+
style: A,
|
|
154
|
+
borderRadius: y,
|
|
155
|
+
children: B()
|
|
156
|
+
}
|
|
157
|
+
) }) : /* @__PURE__ */ s(
|
|
158
|
+
ye,
|
|
159
|
+
{
|
|
160
|
+
horizontalAlignment: x,
|
|
161
|
+
className: k,
|
|
162
|
+
style: A,
|
|
163
|
+
children: B(y)
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
};
|
|
167
|
+
K.propTypes = {
|
|
168
|
+
icons: e.shape({
|
|
169
|
+
left: e.element,
|
|
170
|
+
right: e.element,
|
|
171
|
+
doubleLeft: e.element,
|
|
172
|
+
doubleRight: e.element
|
|
173
|
+
}),
|
|
174
|
+
/**
|
|
175
|
+
* Applies to the movement buttons and to the page number buttons
|
|
176
|
+
*/
|
|
177
|
+
disabled: e.bool,
|
|
178
|
+
borderRadius: e.oneOf([
|
|
179
|
+
"slight",
|
|
180
|
+
"regular",
|
|
181
|
+
"edged",
|
|
182
|
+
"curved",
|
|
183
|
+
"none"
|
|
184
|
+
]),
|
|
185
|
+
/**
|
|
186
|
+
* Sets the button `type`
|
|
187
|
+
*/
|
|
188
|
+
buttonType: e.oneOf(["filled", "tinted", "outline", "basic"]),
|
|
189
|
+
/**
|
|
190
|
+
* Set button `type` of the current page button
|
|
191
|
+
*/
|
|
192
|
+
currentPageButtonType: e.oneOf([
|
|
193
|
+
"filled",
|
|
194
|
+
"tinted",
|
|
195
|
+
"outline",
|
|
196
|
+
"basic"
|
|
197
|
+
]),
|
|
198
|
+
/**
|
|
199
|
+
* Show the First and Last buttons
|
|
200
|
+
*/
|
|
201
|
+
withFirstLast: e.bool,
|
|
202
|
+
/**
|
|
203
|
+
* Wrap the buttons in a `ButtonGroup` component
|
|
204
|
+
*/
|
|
205
|
+
withButtonGroup: e.bool,
|
|
206
|
+
/**
|
|
207
|
+
* Active page number
|
|
208
|
+
*/
|
|
209
|
+
currentPage: e.number,
|
|
210
|
+
totalNumberOfPages: e.number,
|
|
211
|
+
/**
|
|
212
|
+
* how many page numbers will be shown to the right/left of the current page
|
|
213
|
+
*/
|
|
214
|
+
pagesOffset: e.number,
|
|
215
|
+
/**
|
|
216
|
+
* Applies to the Next button
|
|
217
|
+
*/
|
|
218
|
+
disabledNext: e.bool,
|
|
219
|
+
/**
|
|
220
|
+
* Applies to the Previous button
|
|
221
|
+
*/
|
|
222
|
+
disabledPrevious: e.bool,
|
|
223
|
+
/**
|
|
224
|
+
* Applies to the First button
|
|
225
|
+
*/
|
|
226
|
+
disabledFirst: e.bool,
|
|
227
|
+
/**
|
|
228
|
+
* Applies to the Last button
|
|
229
|
+
*/
|
|
230
|
+
disabledLast: e.bool,
|
|
231
|
+
horizontalAlignment: e.oneOf(["left", "center", "right"]),
|
|
232
|
+
//-------------------------------
|
|
233
|
+
onPageChange: e.func,
|
|
234
|
+
//-------------------------------
|
|
235
|
+
className: e.string,
|
|
236
|
+
style: e.object,
|
|
237
|
+
size: e.oneOf(["small", "medium", "large"]),
|
|
238
|
+
color: e.oneOf([
|
|
239
|
+
"primary",
|
|
240
|
+
"secondary",
|
|
241
|
+
"success",
|
|
242
|
+
"warning",
|
|
243
|
+
"danger",
|
|
244
|
+
"information",
|
|
245
|
+
"neutral",
|
|
246
|
+
"gray"
|
|
247
|
+
])
|
|
248
|
+
};
|
|
249
|
+
const pe = Z.div`
|
|
250
|
+
& .table-view-pagination-lnc {
|
|
251
|
+
padding: 0 0.625rem;
|
|
252
|
+
}
|
|
253
|
+
& .table-view-toolbar-lnc {
|
|
254
|
+
margin: 0 0.625rem;
|
|
255
|
+
}
|
|
256
|
+
`, Q = fe.forwardRef((h, w) => {
|
|
257
|
+
const {
|
|
258
|
+
__TYPE__: y = "TABLE_VIEW",
|
|
259
|
+
goToPreviousView: D,
|
|
260
|
+
tableProps: t = {},
|
|
261
|
+
paginationProps: n = {},
|
|
262
|
+
actionsToolbarProps: v = {},
|
|
263
|
+
rowsSingleSelect: R = !0,
|
|
264
|
+
rowsMultiSelect: O = !1,
|
|
265
|
+
loading: U = !1,
|
|
266
|
+
showCreate: j = !0,
|
|
267
|
+
enableCreate: F = !0,
|
|
268
|
+
enableDetails: f = !0,
|
|
269
|
+
showEdit: C,
|
|
270
|
+
enableEditOnSelection: E,
|
|
271
|
+
showDelete: x = !0,
|
|
272
|
+
enableDeleteOnSelection: I = !0,
|
|
273
|
+
showCopy: k = !0,
|
|
274
|
+
enableCopyOnSelection: A = !0,
|
|
275
|
+
customActions: V,
|
|
276
|
+
pagination: G = !0,
|
|
277
|
+
readOnly: $ = !1,
|
|
278
|
+
actionsDropdownZIndex: u = null,
|
|
279
|
+
actionsDropdownPlacement: a = null,
|
|
280
|
+
actionDropdownProps: g,
|
|
281
|
+
//----------------
|
|
282
|
+
onCreate: b = () => {
|
|
283
|
+
},
|
|
284
|
+
onEdit: M = () => {
|
|
285
|
+
},
|
|
286
|
+
onDelete: B = () => {
|
|
287
|
+
},
|
|
288
|
+
onDetails: c = () => {
|
|
289
|
+
},
|
|
290
|
+
onCopy: o = () => {
|
|
291
|
+
},
|
|
292
|
+
onFilter: r = () => {
|
|
293
|
+
},
|
|
294
|
+
onSort: Te = () => {
|
|
295
|
+
},
|
|
296
|
+
onPageChange: X = () => {
|
|
297
|
+
},
|
|
298
|
+
onEmptyRowsSelection: Se = () => {
|
|
299
|
+
},
|
|
300
|
+
//------------------
|
|
301
|
+
className: ze = "",
|
|
302
|
+
style: Ne = {},
|
|
303
|
+
color: p = "primary",
|
|
304
|
+
size: T = "small",
|
|
305
|
+
children: S,
|
|
306
|
+
...ee
|
|
307
|
+
} = h, l = {
|
|
308
|
+
...v,
|
|
309
|
+
showCreate: j,
|
|
310
|
+
enableCreate: F,
|
|
311
|
+
showCopy: k,
|
|
312
|
+
enableCopyOnSelection: A,
|
|
313
|
+
showEdit: C,
|
|
314
|
+
enableEditOnSelection: E,
|
|
315
|
+
showDelete: x,
|
|
316
|
+
enableDeleteOnSelection: I,
|
|
317
|
+
customActions: V,
|
|
318
|
+
readOnly: $
|
|
319
|
+
}, [m, z] = J([]), oe = (i, d) => {
|
|
320
|
+
d ? O ? z([...m, i]) : R && z([i]) : z(O ? (N) => N.filter((_) => _ != i) : []);
|
|
321
|
+
}, te = (i, d) => {
|
|
322
|
+
var N, _;
|
|
323
|
+
((N = i.target) == null ? void 0 : N.type) !== "checkbox" && ((_ = i.target) == null ? void 0 : _.className) !== "checkmark" && (t != null && t.onRowClick && t.onRowClick(i, d), ne(d, i));
|
|
324
|
+
}, ne = (i, d) => {
|
|
325
|
+
c(i, d);
|
|
326
|
+
}, le = (i) => {
|
|
327
|
+
b(i);
|
|
328
|
+
}, ie = (i) => {
|
|
329
|
+
o(m, i);
|
|
330
|
+
}, ae = (i) => {
|
|
331
|
+
M(m, i), z([]);
|
|
332
|
+
}, se = (i) => {
|
|
333
|
+
B(m, i), z([]);
|
|
334
|
+
}, re = (i) => {
|
|
335
|
+
X(i);
|
|
336
|
+
}, ce = () => W(
|
|
337
|
+
Y("ACTIONS_TOOLBAR", S),
|
|
338
|
+
{
|
|
339
|
+
...l,
|
|
340
|
+
size: l != null && l.size ? l.size : T,
|
|
341
|
+
color: l != null && l.color ? l.color : p,
|
|
342
|
+
className: "table-view-toolbar-lnc " + (l == null ? void 0 : l.className)
|
|
343
|
+
},
|
|
344
|
+
S
|
|
345
|
+
) || /* @__PURE__ */ s(
|
|
346
|
+
ge,
|
|
347
|
+
{
|
|
348
|
+
...l,
|
|
349
|
+
className: "table-view-toolbar-lnc " + (l == null ? void 0 : l.className),
|
|
350
|
+
size: l != null && l.size ? l.size : T,
|
|
351
|
+
color: l != null && l.color ? l.color : p,
|
|
352
|
+
selectedRowsLength: m != null && m.length ? m.length : 0,
|
|
353
|
+
onCreate: le,
|
|
354
|
+
onCopy: ie,
|
|
355
|
+
onEdit: ae,
|
|
356
|
+
onDelete: se,
|
|
357
|
+
actionsDropdownZIndex: u,
|
|
358
|
+
actionDropdownProps: g,
|
|
359
|
+
actionsDropdownPlacement: a
|
|
360
|
+
}
|
|
361
|
+
), de = () => W(
|
|
362
|
+
Y("TABLE", S),
|
|
363
|
+
{
|
|
364
|
+
...t,
|
|
365
|
+
size: t != null && t.size ? t.size : T,
|
|
366
|
+
color: t != null && t.color ? t.color : p,
|
|
367
|
+
className: "table-view-pagination-lnc " + (t == null ? void 0 : t.className)
|
|
368
|
+
},
|
|
369
|
+
S
|
|
370
|
+
) || /* @__PURE__ */ s(
|
|
371
|
+
we,
|
|
372
|
+
{
|
|
373
|
+
size: t != null && t.size ? t.size : T,
|
|
374
|
+
color: t != null && t.color ? t.color : p,
|
|
375
|
+
EnableSelection: (R || O) && $ == !1,
|
|
376
|
+
onSelectRow: (i, d, N) => oe(d, !N),
|
|
377
|
+
SelectedData: m,
|
|
378
|
+
onRowClick: (i, d) => te(i, d),
|
|
379
|
+
...t
|
|
380
|
+
}
|
|
381
|
+
), ue = () => W(
|
|
382
|
+
Y("PAGINATION", S),
|
|
383
|
+
{
|
|
384
|
+
...n,
|
|
385
|
+
size: n != null && n.size ? n.size : T,
|
|
386
|
+
color: n != null && n.color ? n.color : p,
|
|
387
|
+
className: "table-view-pagination-lnc " + (n == null ? void 0 : n.className)
|
|
388
|
+
},
|
|
389
|
+
S
|
|
390
|
+
) || /* @__PURE__ */ s(
|
|
391
|
+
K,
|
|
392
|
+
{
|
|
393
|
+
...n,
|
|
394
|
+
size: n != null && n.size ? n.size : T,
|
|
395
|
+
color: n != null && n.color ? n.color : p,
|
|
396
|
+
className: "table-view-pagination-lnc " + (n == null ? void 0 : n.className),
|
|
397
|
+
onPageChange: re
|
|
398
|
+
}
|
|
399
|
+
);
|
|
400
|
+
return /* @__PURE__ */ H(pe, { ref: w, ...ee, children: [
|
|
401
|
+
ce(),
|
|
402
|
+
de(),
|
|
403
|
+
G == !0 && ue()
|
|
404
|
+
] });
|
|
405
|
+
});
|
|
406
|
+
Q.propTypes = {
|
|
407
|
+
__TYPE__: e.string,
|
|
408
|
+
tableProps: e.object,
|
|
409
|
+
actionsToolbarProps: e.object,
|
|
410
|
+
paginationProps: e.object,
|
|
411
|
+
rowsSingleSelect: e.bool,
|
|
412
|
+
rowsMultiSelect: e.bool,
|
|
413
|
+
loading: e.bool,
|
|
414
|
+
showCreate: e.bool,
|
|
415
|
+
actionsDropdownZIndex: e.any,
|
|
416
|
+
actionsDropdownPlacement: e.any,
|
|
417
|
+
/**
|
|
418
|
+
* Enable create
|
|
419
|
+
*/
|
|
420
|
+
enableCreate: e.bool,
|
|
421
|
+
/**
|
|
422
|
+
* Enable details on row click
|
|
423
|
+
*/
|
|
424
|
+
enableDetails: e.bool,
|
|
425
|
+
showEdit: e.bool,
|
|
426
|
+
/**
|
|
427
|
+
* Enable edit when one row is selected
|
|
428
|
+
*/
|
|
429
|
+
enableEditOnSelection: e.bool,
|
|
430
|
+
showDelete: e.bool,
|
|
431
|
+
/**
|
|
432
|
+
* Enable delete when one row is selected
|
|
433
|
+
*/
|
|
434
|
+
enableDeleteOnSelection: e.bool,
|
|
435
|
+
showCopy: e.bool,
|
|
436
|
+
/**
|
|
437
|
+
* Enable copy when one row is selected
|
|
438
|
+
*/
|
|
439
|
+
enableCopyOnSelection: e.bool,
|
|
440
|
+
/**
|
|
441
|
+
* Actions that will be shown in toolbar with existing actions
|
|
442
|
+
* type of [{name: `<string>`, show: `<bool>`, enable: `<bool>`, enableOnSelection: `<bool>`, onAction: `<func>`, customAction: `<elemet>`}, ...]
|
|
443
|
+
*/
|
|
444
|
+
customActions: e.array,
|
|
445
|
+
/**
|
|
446
|
+
* Determines whether will pagination be shown in view
|
|
447
|
+
*/
|
|
448
|
+
pagination: e.bool,
|
|
449
|
+
/**
|
|
450
|
+
* If `readOnly={true}` actions Delete, Edit and Copy won't be shown. Row Selction will be disabled.
|
|
451
|
+
*/
|
|
452
|
+
readOnly: e.bool,
|
|
453
|
+
//-------------------------------------------------------------
|
|
454
|
+
onCreate: e.func,
|
|
455
|
+
onEdit: e.func,
|
|
456
|
+
onDelete: e.func,
|
|
457
|
+
onDetails: e.func,
|
|
458
|
+
onCopy: e.func,
|
|
459
|
+
onFilter: e.func,
|
|
460
|
+
onSort: e.func,
|
|
461
|
+
onPageChange: e.func,
|
|
462
|
+
//------------------------------------------------------------
|
|
463
|
+
className: e.string,
|
|
464
|
+
style: e.object,
|
|
465
|
+
size: e.oneOf(["small", "medium", "large"]),
|
|
466
|
+
color: e.oneOf([
|
|
467
|
+
"primary",
|
|
468
|
+
"secondary",
|
|
469
|
+
"success",
|
|
470
|
+
"danger",
|
|
471
|
+
"warning",
|
|
472
|
+
"information",
|
|
473
|
+
"neutral",
|
|
474
|
+
"gray"
|
|
475
|
+
])
|
|
476
|
+
};
|
|
477
|
+
Q.displayName = "TABLE_VIEW";
|
|
478
|
+
export {
|
|
479
|
+
K as P,
|
|
480
|
+
Q as T
|
|
481
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),W=require("react"),e=require("./index-DXnSjbfJ.cjs"),Y=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),pe=require("./ActionsToolbar.cjs"),M=require("./Button.cjs"),B=require("./IconButton.cjs"),ue=require("./ButtonGroup.cjs"),de=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),J=require("./useUpdateEffect-BtMgpgIV.cjs"),z=require("./utils-hdRGTsQ7.cjs"),ye=require("./Table.cjs"),Te=Y.newStyled.div`
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
flex-wrap: wrap;
|
|
4
|
+
width: 100%;
|
|
5
|
+
gap: 0.375rem;
|
|
6
|
+
justify-content: ${b=>b.horizontalAlignment};
|
|
7
|
+
`,ge=Y.newStyled.div`
|
|
8
|
+
& > .button-group-pagination-lnc {
|
|
9
|
+
width: 100%;
|
|
10
|
+
justify-content: ${b=>b.horizontalAlignment};
|
|
11
|
+
}
|
|
12
|
+
`,Z=b=>{const{icons:m={},borderRadius:f="regular",currentPage:O=1,buttonType:n="outline",currentPageButtonType:t="tinted",withFirstLast:j=!0,withButtonGroup:R=!0,disabledNext:N=!1,disabledPrevious:H=!1,disabledFirst:q=!1,disabledLast:L=!1,disabled:y=!1,totalNumberOfPages:h=1,pagesOffset:E=0,horizontalAlignment:D="left",onPageChange:I=()=>{},className:v="",style:_={},color:F="primary",size:V="small"}=b,u={theme:de.useTheme(),size:V,color:F,btnType:n},[r,T]=W.useState(O);J.useUpdateEffect(()=>{T(O)},[O]),J.useUpdateEffect(()=>{I(r)},[r]);const g=(c,o)=>{o=="next"&&r<h?T(r+1):o=="previous"&&r>1?T(r-1):o=="last"&&r!=h?T(h):o=="first"&&r!=1?T(1):isNaN(+o)||T(o)},U=()=>{let c=[];for(let o=r-E>0?r-E:1;o<r&&o>0;o++)c.push(i.jsx(M,{...u,borderRadius:f,onClick:a=>g(a,o),btnType:"basic",text:o.toString(),disabled:y},o));c.push(i.jsx(M,{...u,borderRadius:f,btnType:t,text:r.toString(),disabled:y},r));for(let o=r+1;o<=r+E&&o<=h;o++)c.push(i.jsx(M,{...u,borderRadius:f,onClick:a=>g(a,o),btnType:"basic",text:o.toString(),disabled:y},o));return c},k=(c=null)=>{var o={};return c&&(o.borderRadius=c),i.jsxs(i.Fragment,{children:[j&&i.jsx(B,{...u,icon:m.doubleLeft||"angle-double-left",disabled:q||y,onClick:a=>g(a,"first"),...o}),i.jsx(B,{...u,icon:m.left||"angle-left",disabled:H||y,onClick:a=>g(a,"previous"),...o}),U(),i.jsx(B,{...u,icon:m.right||"angle-right",disabled:N||y,onClick:a=>g(a,"next"),...o}),j&&i.jsx(B,{...u,icon:m.doubleRight||"angle-double-right",disabled:L||y,onClick:a=>g(a,"last"),...o})]})};return R?i.jsx(ge,{horizontalAlignment:D,children:i.jsx(ue,{className:"button-group-pagination-lnc "+v,style:_,borderRadius:f,children:k()})}):i.jsx(Te,{horizontalAlignment:D,className:v,style:_,children:k(f)})};Z.propTypes={icons:e.PropTypes.shape({left:e.PropTypes.element,right:e.PropTypes.element,doubleLeft:e.PropTypes.element,doubleRight:e.PropTypes.element}),disabled:e.PropTypes.bool,borderRadius:e.PropTypes.oneOf(["slight","regular","edged","curved","none"]),buttonType:e.PropTypes.oneOf(["filled","tinted","outline","basic"]),currentPageButtonType:e.PropTypes.oneOf(["filled","tinted","outline","basic"]),withFirstLast:e.PropTypes.bool,withButtonGroup:e.PropTypes.bool,currentPage:e.PropTypes.number,totalNumberOfPages:e.PropTypes.number,pagesOffset:e.PropTypes.number,disabledNext:e.PropTypes.bool,disabledPrevious:e.PropTypes.bool,disabledFirst:e.PropTypes.bool,disabledLast:e.PropTypes.bool,horizontalAlignment:e.PropTypes.oneOf(["left","center","right"]),onPageChange:e.PropTypes.func,className:e.PropTypes.string,style:e.PropTypes.object,size:e.PropTypes.oneOf(["small","medium","large"]),color:e.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral","gray"])};const be=Y.newStyled.div`
|
|
13
|
+
& .table-view-pagination-lnc {
|
|
14
|
+
padding: 0 0.625rem;
|
|
15
|
+
}
|
|
16
|
+
& .table-view-toolbar-lnc {
|
|
17
|
+
margin: 0 0.625rem;
|
|
18
|
+
}
|
|
19
|
+
`,$=W.forwardRef((b,m)=>{const{__TYPE__:f="TABLE_VIEW",goToPreviousView:O,tableProps:n={},paginationProps:t={},actionsToolbarProps:j={},rowsSingleSelect:R=!0,rowsMultiSelect:N=!1,loading:H=!1,showCreate:q=!0,enableCreate:L=!0,enableDetails:y=!0,showEdit:h,enableEditOnSelection:E,showDelete:D=!0,enableDeleteOnSelection:I=!0,showCopy:v=!0,enableCopyOnSelection:_=!0,customActions:F,pagination:V=!0,readOnly:G=!1,actionsDropdownZIndex:u=null,actionsDropdownPlacement:r=null,actionDropdownProps:T,onCreate:g=()=>{},onEdit:U=()=>{},onDelete:k=()=>{},onDetails:c=()=>{},onCopy:o=()=>{},onFilter:a=()=>{},onSort:me=()=>{},onPageChange:K=()=>{},onEmptyRowsSelection:fe=()=>{},className:he="",style:Pe={},color:P="primary",size:w="small",children:C,...Q}=b,s={...j,showCreate:q,enableCreate:L,showCopy:v,enableCopyOnSelection:_,showEdit:h,enableEditOnSelection:E,showDelete:D,enableDeleteOnSelection:I,customActions:F,readOnly:G},[d,S]=W.useState([]),X=(l,p)=>{p?N?S([...d,l]):R&&S([l]):S(N?x=>x.filter(A=>A!=l):[])},ee=(l,p)=>{var x,A;((x=l.target)==null?void 0:x.type)!=="checkbox"&&((A=l.target)==null?void 0:A.className)!=="checkmark"&&(n!=null&&n.onRowClick&&n.onRowClick(l,p),oe(p,l))},oe=(l,p)=>{c(l,p)},ne=l=>{g(l)},te=l=>{o(d,l)},se=l=>{U(d,l),S([])},le=l=>{k(d,l),S([])},re=l=>{K(l)},ie=()=>z.renderCustomElement(z.getCustomRender("ACTIONS_TOOLBAR",C),{...s,size:s!=null&&s.size?s.size:w,color:s!=null&&s.color?s.color:P,className:"table-view-toolbar-lnc "+(s==null?void 0:s.className)},C)||i.jsx(pe,{...s,className:"table-view-toolbar-lnc "+(s==null?void 0:s.className),size:s!=null&&s.size?s.size:w,color:s!=null&&s.color?s.color:P,selectedRowsLength:d!=null&&d.length?d.length:0,onCreate:ne,onCopy:te,onEdit:se,onDelete:le,actionsDropdownZIndex:u,actionDropdownProps:T,actionsDropdownPlacement:r}),ae=()=>z.renderCustomElement(z.getCustomRender("TABLE",C),{...n,size:n!=null&&n.size?n.size:w,color:n!=null&&n.color?n.color:P,className:"table-view-pagination-lnc "+(n==null?void 0:n.className)},C)||i.jsx(ye.default,{size:n!=null&&n.size?n.size:w,color:n!=null&&n.color?n.color:P,EnableSelection:(R||N)&&G==!1,onSelectRow:(l,p,x)=>X(p,!x),SelectedData:d,onRowClick:(l,p)=>ee(l,p),...n}),ce=()=>z.renderCustomElement(z.getCustomRender("PAGINATION",C),{...t,size:t!=null&&t.size?t.size:w,color:t!=null&&t.color?t.color:P,className:"table-view-pagination-lnc "+(t==null?void 0:t.className)},C)||i.jsx(Z,{...t,size:t!=null&&t.size?t.size:w,color:t!=null&&t.color?t.color:P,className:"table-view-pagination-lnc "+(t==null?void 0:t.className),onPageChange:re});return i.jsxs(be,{ref:m,...Q,children:[ie(),ae(),V==!0&&ce()]})});$.propTypes={__TYPE__:e.PropTypes.string,tableProps:e.PropTypes.object,actionsToolbarProps:e.PropTypes.object,paginationProps:e.PropTypes.object,rowsSingleSelect:e.PropTypes.bool,rowsMultiSelect:e.PropTypes.bool,loading:e.PropTypes.bool,showCreate:e.PropTypes.bool,actionsDropdownZIndex:e.PropTypes.any,actionsDropdownPlacement:e.PropTypes.any,enableCreate:e.PropTypes.bool,enableDetails:e.PropTypes.bool,showEdit:e.PropTypes.bool,enableEditOnSelection:e.PropTypes.bool,showDelete:e.PropTypes.bool,enableDeleteOnSelection:e.PropTypes.bool,showCopy:e.PropTypes.bool,enableCopyOnSelection:e.PropTypes.bool,customActions:e.PropTypes.array,pagination:e.PropTypes.bool,readOnly:e.PropTypes.bool,onCreate:e.PropTypes.func,onEdit:e.PropTypes.func,onDelete:e.PropTypes.func,onDetails:e.PropTypes.func,onCopy:e.PropTypes.func,onFilter:e.PropTypes.func,onSort:e.PropTypes.func,onPageChange:e.PropTypes.func,className:e.PropTypes.string,style:e.PropTypes.object,size:e.PropTypes.oneOf(["small","medium","large"]),color:e.PropTypes.oneOf(["primary","secondary","success","danger","warning","information","neutral","gray"])};$.displayName="TABLE_VIEW";exports.Pagination=Z;exports.TableView=$;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require("react/jsx-runtime");require("react");require("./index-DXnSjbfJ.cjs");require("./emotion-styled.browser.esm-Cbp_XsK4.cjs");require("./ActionsToolbar.cjs");const e=require("./TableView-D8ex512p.cjs");require("./utils-hdRGTsQ7.cjs");require("./Table.cjs");module.exports=e.TableView;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import "./index-Ds9PUTwb.js";
|
|
4
|
+
import "./emotion-styled.browser.esm-BZSYYThs.js";
|
|
5
|
+
import "./ActionsToolbar.js";
|
|
6
|
+
import { T as d } from "./TableView-Cj5_fbSR.js";
|
|
7
|
+
import "./utils-DEke8iwo.js";
|
|
8
|
+
import "./Table.js";
|
|
9
|
+
export {
|
|
10
|
+
d as default
|
|
11
|
+
};
|
package/dist/Tabs.cjs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";const P=require("react/jsx-runtime"),r=require("react"),e=require("./index-DXnSjbfJ.cjs"),j=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),q=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),w=j.newStyled.div`
|
|
2
|
+
background: transparent;
|
|
3
|
+
display: flex;
|
|
4
|
+
justify-content: ${s=>s.fullWidth?"space-evenly":"none"};
|
|
5
|
+
gap: ${s=>s.type=="pill"?"10px":"0"};
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
`,p=r.forwardRef((s,d)=>{const{type:l="regular",fullWidth:t=!1,className:m="",style:u={},color:i="primary",size:c="small",children:a,...y}=s,h=q.useTheme(),[f,b]=r.useState(),g={theme:h,color:i,size:c,style:u,className:"lnc-ui-tabs "+m},T=n=>{b(n)},x=r.Children.map(a,(n,o)=>r.cloneElement(n,{type:l,first:o==0,last:o==r.Children.toArray(a).length-1,fullWidth:t,index:o,itemClick:T,activeIndex:f,color:i,size:c,fullWidth:t}));return P.jsx(w,{ref:d,type:l,fullWidth:t,...g,...y,children:x})});p.propTypes={type:e.PropTypes.oneOf(["regular","pill","underline"]),fullWidth:e.PropTypes.bool,className:e.PropTypes.string,style:e.PropTypes.object,color:e.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral","gray"]),size:e.PropTypes.oneOf(["small","medium","large"])};module.exports=p;
|
package/dist/Tabs.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx as T } from "react/jsx-runtime";
|
|
2
|
+
import r, { useState as j } from "react";
|
|
3
|
+
import { P as e } from "./index-Ds9PUTwb.js";
|
|
4
|
+
import { n as v } from "./emotion-styled.browser.esm-BZSYYThs.js";
|
|
5
|
+
import { u as C } from "./emotion-element-5486c51c.browser.esm-CSejtOeT.js";
|
|
6
|
+
const P = v.div`
|
|
7
|
+
background: transparent;
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: ${(t) => t.fullWidth ? "space-evenly" : "none"};
|
|
10
|
+
gap: ${(t) => t.type == "pill" ? "10px" : "0"};
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
`, W = r.forwardRef((t, m) => {
|
|
13
|
+
const {
|
|
14
|
+
type: a = "regular",
|
|
15
|
+
fullWidth: s = !1,
|
|
16
|
+
//----------------
|
|
17
|
+
className: p = "",
|
|
18
|
+
style: d = {},
|
|
19
|
+
color: n = "primary",
|
|
20
|
+
size: i = "small",
|
|
21
|
+
children: c,
|
|
22
|
+
...f
|
|
23
|
+
} = t, u = C(), [y, h] = j(), g = { theme: u, color: n, size: i, style: d, className: "lnc-ui-tabs " + p }, b = (l) => {
|
|
24
|
+
h(l);
|
|
25
|
+
}, x = r.Children.map(
|
|
26
|
+
c,
|
|
27
|
+
(l, o) => r.cloneElement(l, {
|
|
28
|
+
type: a,
|
|
29
|
+
first: o == 0,
|
|
30
|
+
last: o == r.Children.toArray(c).length - 1,
|
|
31
|
+
fullWidth: s,
|
|
32
|
+
index: o,
|
|
33
|
+
itemClick: b,
|
|
34
|
+
activeIndex: y,
|
|
35
|
+
color: n,
|
|
36
|
+
size: i,
|
|
37
|
+
fullWidth: s
|
|
38
|
+
})
|
|
39
|
+
);
|
|
40
|
+
return /* @__PURE__ */ T(
|
|
41
|
+
P,
|
|
42
|
+
{
|
|
43
|
+
ref: m,
|
|
44
|
+
type: a,
|
|
45
|
+
fullWidth: s,
|
|
46
|
+
...g,
|
|
47
|
+
...f,
|
|
48
|
+
children: x
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
});
|
|
52
|
+
W.propTypes = {
|
|
53
|
+
type: e.oneOf(["regular", "pill", "underline"]),
|
|
54
|
+
fullWidth: e.bool,
|
|
55
|
+
//---------------------------------------------------------------
|
|
56
|
+
className: e.string,
|
|
57
|
+
style: e.object,
|
|
58
|
+
color: e.oneOf([
|
|
59
|
+
"primary",
|
|
60
|
+
"secondary",
|
|
61
|
+
"success",
|
|
62
|
+
"warning",
|
|
63
|
+
"danger",
|
|
64
|
+
"information",
|
|
65
|
+
"neutral",
|
|
66
|
+
"gray"
|
|
67
|
+
]),
|
|
68
|
+
size: e.oneOf(["small", "medium", "large"])
|
|
69
|
+
};
|
|
70
|
+
export {
|
|
71
|
+
W as default
|
|
72
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";const O=require("react/jsx-runtime"),a=require("./index-DXnSjbfJ.cjs"),c=require("react"),X=require("./index-BjdOz5Ok.cjs"),Z=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),g=require("./utils-hdRGTsQ7.cjs"),V=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),J=require("./objectWithoutPropertiesLoose-Bz3hwpmU.cjs"),K=require("./use-isomorphic-layout-effect.browser.esm-CkGv31zs.cjs");function Q(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const x=Q(c),ee=Z.newStyled.div`
|
|
2
|
+
& textarea {
|
|
3
|
+
${e=>g.getComponentTypographyCss(e.theme,"Input",e.size,"enabled")}
|
|
4
|
+
min-height: ${e=>g.getSizeValueWithUnits(e.theme,e.size)};
|
|
5
|
+
background-color: ${e=>g.getColorRgbaValue(e.theme,"Input",e.color,"enabled","background")};
|
|
6
|
+
border: 1px solid
|
|
7
|
+
${e=>g.getColorRgbaValue(e.theme,"Input",e.focused===!0?"primary":e.color,e.disabled===!0?"disabled":"enabled","border")};
|
|
8
|
+
border-radius: ${e=>g.getBorderRadiusValueWithUnits(e.theme,"regular")};
|
|
9
|
+
color: ${e=>g.getColorRgbaValue(e.theme,"Input",e.focused===!0?"primary":e.color,"enabled","text")};
|
|
10
|
+
caret-color: ${e=>g.getColorRgbaValue(e.theme,"Input",e.color,"enabled","caret")};
|
|
11
|
+
overflow: ${e=>e.collapseOnBlur&&e.focused===!1?"hidden":"auto"};
|
|
12
|
+
transition: height 0.2s ease-out;
|
|
13
|
+
padding: 0.563rem 0.75rem;
|
|
14
|
+
min-width: 100%;
|
|
15
|
+
max-width: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
& textarea::placeholder {
|
|
19
|
+
color: ${e=>g.getColorRgbaValue(e.theme,"Input",e.color,"enabled","placeholder")};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
& textarea:read-only {
|
|
23
|
+
cursor: default;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
& textarea:focus {
|
|
27
|
+
${e=>e.readOnly!==!0?g.getOutlineCss(e.theme):"outline: none"}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
& textarea:disabled {
|
|
31
|
+
${e=>g.getDisabledStateCss(e.theme)}
|
|
32
|
+
}
|
|
33
|
+
`;var te=function(t){var r=x.useRef(t);return K.index(function(){r.current=t}),r},$=function(t,r){if(typeof t=="function"){t(r);return}t.current=r},re=function(t,r){var n=c.useRef();return c.useCallback(function(o){t.current=o,n.current&&$(n.current,null),n.current=r,r&&$(r,o)},[r])},W={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},ne=function(t){Object.keys(W).forEach(function(r){t.style.setProperty(r,W[r],"important")})},F=ne,s=null,_=function(t,r){var n=t.scrollHeight;return r.sizingStyle.boxSizing==="border-box"?n+r.borderSize:n-r.paddingSize};function oe(e,t,r,n){r===void 0&&(r=1),n===void 0&&(n=1/0),s||(s=document.createElement("textarea"),s.setAttribute("tabindex","-1"),s.setAttribute("aria-hidden","true"),F(s)),s.parentNode===null&&document.body.appendChild(s);var o=e.paddingSize,p=e.borderSize,d=e.sizingStyle,T=d.boxSizing;Object.keys(d).forEach(function(b){var m=b;s.style[m]=d[m]}),F(s),s.value=t;var i=_(s,e);s.value=t,i=_(s,e),s.value="x";var u=s.scrollHeight-o,l=u*r;T==="border-box"&&(l=l+o+p),i=Math.max(l,i);var f=u*n;return T==="border-box"&&(f=f+o+p),i=Math.min(f,i),[i,u]}var j=function(){},ae=function(t,r){return t.reduce(function(n,o){return n[o]=r[o],n},{})},ie=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],se=!!document.documentElement.currentStyle,ue=function(t){var r=window.getComputedStyle(t);if(r===null)return null;var n=ae(ie,r),o=n.boxSizing;if(o==="")return null;se&&o==="border-box"&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+"px");var p=parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),d=parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth);return{sizingStyle:n,paddingSize:p,borderSize:d}},de=ue;function k(e,t,r){var n=te(r);x.useLayoutEffect(function(){var o=function(d){return n.current(d)};if(e)return e.addEventListener(t,o),function(){return e.removeEventListener(t,o)}},[])}var le=function(t){k(window,"resize",t)},ce=function(t){k(document.fonts,"loadingdone",t)},fe=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],he=function(t,r){var n=t.cacheMeasurements,o=t.maxRows,p=t.minRows,d=t.onChange,T=d===void 0?j:d,i=t.onHeightChange,u=i===void 0?j:i,l=J._objectWithoutPropertiesLoose(t,fe),f=l.value!==void 0,b=x.useRef(null),m=re(b,r),C=x.useRef(0),w=x.useRef(),S=function(){var v=b.current,R=n&&w.current?w.current:de(v);if(R){w.current=R;var P=oe(R,v.value||v.placeholder||"x",p,o),y=P[0],L=P[1];C.current!==y&&(C.current=y,v.style.setProperty("height",y+"px","important"),u(y,{rowHeight:L}))}},E=function(v){f||S(),T(v)};return x.useLayoutEffect(S),le(S),ce(S),x.createElement("textarea",V._extends({},l,{onChange:E,ref:m}))},ge=x.forwardRef(he);const B=c.forwardRef((e,t)=>{const{disabled:r,readOnly:n,value:o,defaultValue:p,debounceTime:d=180,type:T="textarea",collapseOnBlur:i=!1,minRows:u=0,maxRows:l,onChange:f,onBlur:b,onFocus:m,className:C="",style:w={},size:S="small",color:E="primary",...H}=e,[v,R]=c.useState(o||p||""),P=V.useTheme(),[y,L]=c.useState(!1),[M,q]=c.useState(u),[N,z]=c.useState(i?u:l);c.useEffect(()=>{o!=null&&R(o)},[o]),c.useEffect(()=>{q(u),i&&y===!1&&z(u)},[u,l]),c.useEffect(()=>{z(i?y===!0?l:u:l)},[i]);const A=c.useCallback(X.debounce((h,I)=>D(h,I),d),[f]),D=(h,I)=>{f&&(f==null||f(h,I))},U=h=>{R(h.target.value),A(h,h.target.value)},G=h=>{L(!0),i&&z(l),m==null||m(h)},Y=h=>{L(!1),i&&z(u),b==null||b(h)};return O.jsx(ee,{style:w,className:C,theme:P,color:E,size:S,focused:y,disabled:r,readOnly:n,collapseOnBlur:i,children:O.jsx(ge,{ref:t,disabled:r,value:v,readOnly:n,minRows:M,maxRows:N,onChange:U,onFocus:G,onBlur:Y,...H})})});B.propTypes={id:a.PropTypes.string,defaultValue:a.PropTypes.string,value:a.PropTypes.string,disabled:a.PropTypes.bool,readOnly:a.PropTypes.bool,debounceTime:a.PropTypes.number,placeholder:a.PropTypes.string,tabIndex:a.PropTypes.number,collapseOnBlur:a.PropTypes.bool,minRows:a.PropTypes.number,maxRows:a.PropTypes.number,onChange:a.PropTypes.func,onBlur:a.PropTypes.func,onFocus:a.PropTypes.func,className:a.PropTypes.string,style:a.PropTypes.object,size:a.PropTypes.oneOf(["small","medium","large"]),color:a.PropTypes.oneOf(["primary","secondary","success","danger","warning","information","neutral","gray"])};module.exports=B;
|