@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,45 @@
|
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),t=require("./index-DXnSjbfJ.cjs"),l=require("react"),U=require("./index-BjdOz5Ok.cjs"),d=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),n=require("./utils-hdRGTsQ7.cjs"),A=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),B=d.newStyled.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
|
|
5
|
+
min-height: ${e=>n.getSizeValueWithUnits(e.theme,e.size)};
|
|
6
|
+
max-height: ${e=>n.getSizeValueWithUnits(e.theme,e.size)};
|
|
7
|
+
background-color: ${e=>n.getColorRgbaValue(e.theme,"Input",e.color,"enabled","background")};
|
|
8
|
+
border: 1px solid
|
|
9
|
+
${e=>n.getColorRgbaValue(e.theme,"Input",e.focused===!0?"primary":e.color,e.disabled===!0?"disabled":"enabled","border")};
|
|
10
|
+
border-radius: ${e=>n.getBorderRadiusValueWithUnits(e.theme,"regular")};
|
|
11
|
+
|
|
12
|
+
${e=>e.focused&&e.readOnly!==!0?n.getOutlineCss(e.theme):""}
|
|
13
|
+
${e=>e.disabled===!0?n.getDisabledStateCss(e.theme):""}
|
|
14
|
+
`,S=d.newStyled.span`
|
|
15
|
+
padding: 0 12px;
|
|
16
|
+
color: ${e=>n.getColorRgbaValue(e.theme,"Input",e.focused===!0?"primary":e.color,"enabled","prefix")};
|
|
17
|
+
`,D=d.newStyled(S)``,G=d.newStyled.input`
|
|
18
|
+
background: none;
|
|
19
|
+
border: none;
|
|
20
|
+
outline: none;
|
|
21
|
+
padding-top: 0.625rem;
|
|
22
|
+
padding-bottom: 0.625rem;
|
|
23
|
+
width: 100%;
|
|
24
|
+
|
|
25
|
+
${e=>n.getComponentTypographyCss(e.theme,"Input",e.size,"enabled")}
|
|
26
|
+
min-height: ${e=>n.getSizeValueWithUnits(e.theme,e.size)};
|
|
27
|
+
max-height: ${e=>n.getSizeValueWithUnits(e.theme,e.size)};
|
|
28
|
+
color: ${e=>n.getColorRgbaValue(e.theme,"Input",e.focused===!0?"primary":e.color,"enabled","text")};
|
|
29
|
+
caret-color: ${e=>n.getColorRgbaValue(e.theme,"Input",e.color,"enabled","caret")};
|
|
30
|
+
padding-right: ${e=>e.suffix?"0":"0.75rem"};
|
|
31
|
+
padding-left: ${e=>e.prefix?"0":"0.75rem"};
|
|
32
|
+
|
|
33
|
+
&::placeholder {
|
|
34
|
+
color: ${e=>n.getColorRgbaValue(e.theme,"Input",e.color,"enabled","placeholder")};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&:read-only {
|
|
38
|
+
cursor: default;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:disabled {
|
|
42
|
+
${e=>n.getDisabledStateCss(e.theme)}
|
|
43
|
+
background: none;
|
|
44
|
+
}
|
|
45
|
+
`,$=l.forwardRef((e,C)=>{const{disabled:h,readOnly:f,debounceTime:V=180,step:I=1,min:R=Number.MIN_SAFE_INTEGER,max:z=Number.MAX_SAFE_INTEGER,prefix:c,suffix:m,placeholder:N,value:o,defaultValue:w,onChange:s,onBlur:p,onFocus:y,className:O="",style:E={},size:T="small",color:a="primary",..._}=e,u=A.useTheme(),[q,x]=l.useState(o||w||""),[g,P]=l.useState(!1);l.useEffect(()=>{o!=null&&x(o)},[o]);const v=l.useCallback(U.debounce((r,b)=>j(r,b),V),[s]),j=(r,b)=>{s&&(s==null||s(r,b))},W=r=>{x(r.target.value),v(r,r.target.value)},k=r=>{P(!0),y==null||y(r)},F=r=>{P(!1),p==null||p(r)};return i.jsxs(B,{style:E,className:O,theme:u,color:a,size:T,focused:g,disabled:h,readOnly:f,children:[c&&i.jsx(S,{theme:u,color:a,focused:g,className:"lnc-input-prefix",children:c}),i.jsx(G,{ref:C,type:"number",theme:u,color:a,size:T,placeholder:N,prefix:c,suffix:m,disabled:h,readOnly:f,step:I,min:R,max:z,value:q,onFocus:k,onBlur:F,onChange:W,..._}),m&&i.jsx(D,{theme:u,color:a,focused:g,className:"lnc-input-suffix",children:m})]})});$.propTypes={id:t.PropTypes.string,value:t.PropTypes.any,defaultValue:t.PropTypes.any,disabled:t.PropTypes.bool,readOnly:t.PropTypes.bool,debounceTime:t.PropTypes.number,step:t.PropTypes.number,min:t.PropTypes.number,max:t.PropTypes.number,prefix:t.PropTypes.oneOfType([t.PropTypes.string,t.PropTypes.element]),suffix:t.PropTypes.oneOfType([t.PropTypes.string,t.PropTypes.element]),placeholder:t.PropTypes.string,tabIndex:t.PropTypes.number,onChange:t.PropTypes.func,onBlur:t.PropTypes.func,onFocus:t.PropTypes.func,className:t.PropTypes.string,style:t.PropTypes.object,size:t.PropTypes.oneOf(["small","medium","large"]),color:t.PropTypes.oneOf(["primary","secondary","success","danger","warning","information","neutral","gray"])};module.exports=$;
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { jsxs as A, jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { P as n } from "./index-Ds9PUTwb.js";
|
|
3
|
+
import P, { useState as C, useEffect as W, useCallback as G } from "react";
|
|
4
|
+
import { d as M } from "./index-D5vEbKUT.js";
|
|
5
|
+
import { n as i } from "./emotion-styled.browser.esm-BZSYYThs.js";
|
|
6
|
+
import { f as d, b as a, c as U, h as D, g as S, a as X } from "./utils-DEke8iwo.js";
|
|
7
|
+
import { u as q } from "./emotion-element-5486c51c.browser.esm-CSejtOeT.js";
|
|
8
|
+
const H = i.div`
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
|
|
12
|
+
min-height: ${(e) => d(e.theme, e.size)};
|
|
13
|
+
max-height: ${(e) => d(e.theme, e.size)};
|
|
14
|
+
background-color: ${(e) => a(
|
|
15
|
+
e.theme,
|
|
16
|
+
"Input",
|
|
17
|
+
e.color,
|
|
18
|
+
"enabled",
|
|
19
|
+
"background"
|
|
20
|
+
)};
|
|
21
|
+
border: 1px solid
|
|
22
|
+
${(e) => a(
|
|
23
|
+
e.theme,
|
|
24
|
+
"Input",
|
|
25
|
+
e.focused === !0 ? "primary" : e.color,
|
|
26
|
+
e.disabled === !0 ? "disabled" : "enabled",
|
|
27
|
+
"border"
|
|
28
|
+
)};
|
|
29
|
+
border-radius: ${(e) => U(e.theme, "regular")};
|
|
30
|
+
|
|
31
|
+
${(e) => e.focused && e.readOnly !== !0 ? D(e.theme) : ""}
|
|
32
|
+
${(e) => e.disabled === !0 ? S(e.theme) : ""}
|
|
33
|
+
`, N = i.span`
|
|
34
|
+
padding: 0 12px;
|
|
35
|
+
color: ${(e) => a(
|
|
36
|
+
e.theme,
|
|
37
|
+
"Input",
|
|
38
|
+
e.focused === !0 ? "primary" : e.color,
|
|
39
|
+
"enabled",
|
|
40
|
+
"prefix"
|
|
41
|
+
)};
|
|
42
|
+
`, J = i(N)``, K = i.input`
|
|
43
|
+
background: none;
|
|
44
|
+
border: none;
|
|
45
|
+
outline: none;
|
|
46
|
+
padding-top: 0.625rem;
|
|
47
|
+
padding-bottom: 0.625rem;
|
|
48
|
+
width: 100%;
|
|
49
|
+
|
|
50
|
+
${(e) => X(e.theme, "Input", e.size, "enabled")}
|
|
51
|
+
min-height: ${(e) => d(e.theme, e.size)};
|
|
52
|
+
max-height: ${(e) => d(e.theme, e.size)};
|
|
53
|
+
color: ${(e) => a(
|
|
54
|
+
e.theme,
|
|
55
|
+
"Input",
|
|
56
|
+
e.focused === !0 ? "primary" : e.color,
|
|
57
|
+
"enabled",
|
|
58
|
+
"text"
|
|
59
|
+
)};
|
|
60
|
+
caret-color: ${(e) => a(e.theme, "Input", e.color, "enabled", "caret")};
|
|
61
|
+
padding-right: ${(e) => e.suffix ? "0" : "0.75rem"};
|
|
62
|
+
padding-left: ${(e) => e.prefix ? "0" : "0.75rem"};
|
|
63
|
+
|
|
64
|
+
&::placeholder {
|
|
65
|
+
color: ${(e) => a(
|
|
66
|
+
e.theme,
|
|
67
|
+
"Input",
|
|
68
|
+
e.color,
|
|
69
|
+
"enabled",
|
|
70
|
+
"placeholder"
|
|
71
|
+
)};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:read-only {
|
|
75
|
+
cursor: default;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&:disabled {
|
|
79
|
+
${(e) => S(e.theme)}
|
|
80
|
+
background: none;
|
|
81
|
+
}
|
|
82
|
+
`, L = P.forwardRef((e, T) => {
|
|
83
|
+
const {
|
|
84
|
+
disabled: y,
|
|
85
|
+
readOnly: p,
|
|
86
|
+
debounceTime: O = 180,
|
|
87
|
+
step: V = 1,
|
|
88
|
+
min: z = Number.MIN_SAFE_INTEGER,
|
|
89
|
+
max: v = Number.MAX_SAFE_INTEGER,
|
|
90
|
+
prefix: s,
|
|
91
|
+
suffix: m,
|
|
92
|
+
placeholder: E,
|
|
93
|
+
value: r,
|
|
94
|
+
defaultValue: F,
|
|
95
|
+
//----------------
|
|
96
|
+
onChange: l,
|
|
97
|
+
onBlur: c,
|
|
98
|
+
onFocus: f,
|
|
99
|
+
//----------------
|
|
100
|
+
className: R = "",
|
|
101
|
+
style: _ = {},
|
|
102
|
+
size: x = "small",
|
|
103
|
+
color: o = "primary",
|
|
104
|
+
...k
|
|
105
|
+
} = e, u = q(), [w, $] = C(r || F || ""), [h, I] = C(!1);
|
|
106
|
+
W(() => {
|
|
107
|
+
r != null && $(r);
|
|
108
|
+
}, [r]);
|
|
109
|
+
const B = G(
|
|
110
|
+
M((t, b) => j(t, b), O),
|
|
111
|
+
[l]
|
|
112
|
+
), j = (t, b) => {
|
|
113
|
+
l && (l == null || l(t, b));
|
|
114
|
+
};
|
|
115
|
+
return /* @__PURE__ */ A(
|
|
116
|
+
H,
|
|
117
|
+
{
|
|
118
|
+
style: _,
|
|
119
|
+
className: R,
|
|
120
|
+
theme: u,
|
|
121
|
+
color: o,
|
|
122
|
+
size: x,
|
|
123
|
+
focused: h,
|
|
124
|
+
disabled: y,
|
|
125
|
+
readOnly: p,
|
|
126
|
+
children: [
|
|
127
|
+
s && /* @__PURE__ */ g(
|
|
128
|
+
N,
|
|
129
|
+
{
|
|
130
|
+
theme: u,
|
|
131
|
+
color: o,
|
|
132
|
+
focused: h,
|
|
133
|
+
className: "lnc-input-prefix",
|
|
134
|
+
children: s
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
/* @__PURE__ */ g(
|
|
138
|
+
K,
|
|
139
|
+
{
|
|
140
|
+
ref: T,
|
|
141
|
+
type: "number",
|
|
142
|
+
theme: u,
|
|
143
|
+
color: o,
|
|
144
|
+
size: x,
|
|
145
|
+
placeholder: E,
|
|
146
|
+
prefix: s,
|
|
147
|
+
suffix: m,
|
|
148
|
+
disabled: y,
|
|
149
|
+
readOnly: p,
|
|
150
|
+
step: V,
|
|
151
|
+
min: z,
|
|
152
|
+
max: v,
|
|
153
|
+
value: w,
|
|
154
|
+
onFocus: (t) => {
|
|
155
|
+
I(!0), f == null || f(t);
|
|
156
|
+
},
|
|
157
|
+
onBlur: (t) => {
|
|
158
|
+
I(!1), c == null || c(t);
|
|
159
|
+
},
|
|
160
|
+
onChange: (t) => {
|
|
161
|
+
$(t.target.value), B(t, t.target.value);
|
|
162
|
+
},
|
|
163
|
+
...k
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
m && /* @__PURE__ */ g(
|
|
167
|
+
J,
|
|
168
|
+
{
|
|
169
|
+
theme: u,
|
|
170
|
+
color: o,
|
|
171
|
+
focused: h,
|
|
172
|
+
className: "lnc-input-suffix",
|
|
173
|
+
children: m
|
|
174
|
+
}
|
|
175
|
+
)
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
);
|
|
179
|
+
});
|
|
180
|
+
L.propTypes = {
|
|
181
|
+
id: n.string,
|
|
182
|
+
value: n.any,
|
|
183
|
+
defaultValue: n.any,
|
|
184
|
+
disabled: n.bool,
|
|
185
|
+
readOnly: n.bool,
|
|
186
|
+
/**
|
|
187
|
+
* Time in miliseconds before onChange event fires after it has been triggered.
|
|
188
|
+
*/
|
|
189
|
+
debounceTime: n.number,
|
|
190
|
+
/**
|
|
191
|
+
* The amount that is added to the current value in the input if its incremented using the arrows/spinners.
|
|
192
|
+
*/
|
|
193
|
+
step: n.number,
|
|
194
|
+
/**
|
|
195
|
+
* Minimum number value user can input.
|
|
196
|
+
*/
|
|
197
|
+
min: n.number,
|
|
198
|
+
/**
|
|
199
|
+
* Maximum number value user can input.
|
|
200
|
+
*/
|
|
201
|
+
max: n.number,
|
|
202
|
+
/**
|
|
203
|
+
* Reserved space before input. Intented to be used with plain text or `Icon` component.
|
|
204
|
+
*/
|
|
205
|
+
prefix: n.oneOfType([n.string, n.element]),
|
|
206
|
+
/**
|
|
207
|
+
* Reserved space after input. Intented to be used with plain text or `Icon` component.
|
|
208
|
+
*/
|
|
209
|
+
suffix: n.oneOfType([n.string, n.element]),
|
|
210
|
+
placeholder: n.string,
|
|
211
|
+
tabIndex: n.number,
|
|
212
|
+
/**
|
|
213
|
+
* `(event, value) => void`
|
|
214
|
+
*/
|
|
215
|
+
onChange: n.func,
|
|
216
|
+
/**
|
|
217
|
+
* `(event) => void`
|
|
218
|
+
*/
|
|
219
|
+
onBlur: n.func,
|
|
220
|
+
/**
|
|
221
|
+
* `(event) => void`
|
|
222
|
+
*/
|
|
223
|
+
onFocus: n.func,
|
|
224
|
+
//----------------
|
|
225
|
+
className: n.string,
|
|
226
|
+
style: n.object,
|
|
227
|
+
size: n.oneOf(["small", "medium", "large"]),
|
|
228
|
+
color: n.oneOf([
|
|
229
|
+
"primary",
|
|
230
|
+
"secondary",
|
|
231
|
+
"success",
|
|
232
|
+
"danger",
|
|
233
|
+
"warning",
|
|
234
|
+
"information",
|
|
235
|
+
"neutral",
|
|
236
|
+
"gray"
|
|
237
|
+
])
|
|
238
|
+
};
|
|
239
|
+
export {
|
|
240
|
+
L as default
|
|
241
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";const x=require("react/jsx-runtime"),a=require("react"),E=require("./index-DXnSjbfJ.cjs"),S=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),c=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),T=S.newStyled.section`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex: auto;
|
|
4
|
+
flex-direction: ${s=>s.hasSidebar?"row":"column"};
|
|
5
|
+
height: ${s=>s.isChild?"100%":"100dvh"};
|
|
6
|
+
|
|
7
|
+
* {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
& header,
|
|
12
|
+
footer {
|
|
13
|
+
flex: 0 0 auto;
|
|
14
|
+
min-height: 4rem;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
& main {
|
|
18
|
+
flex: auto;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
& aside {
|
|
23
|
+
flex: 0 0 15rem;
|
|
24
|
+
height: 100%;
|
|
25
|
+
}
|
|
26
|
+
`,u=a.forwardRef((s,f)=>{const{children:o,isChild:h,__TYPE__:C="PageLayout",...p}=s,P=c.useTheme(),g=a.Children.toArray(o).some(e=>{var t;return e.props.__TYPE__||((t=e==null?void 0:e.type)==null?void 0:t.displayName)=="Sidebar"}),m=e=>{let t,i,l;if(a.Children.forEach(e,(r,d)=>{var _,n,y;if(r.props.__TYPE__=="Sidebar"||((_=r==null?void 0:r.type)==null?void 0:_.displayName)==="Sidebar"){if(i)throw"Found multiple ocurrences of Sidebar component on the same level in the component tree.";i=d+1}else if(r.props.__TYPE__=="PageLayout"||((n=r==null?void 0:r.type)==null?void 0:n.displayName)==="PageLayout"){if(t)throw"Found multiple ocurrences of PageLayout component on the same level in the component tree.";t=d+1}else if(r.props.__TYPE__=="Content"||((y=r==null?void 0:r.type)==null?void 0:y.displayName)==="Content"){if(l)throw"Found multiple ocurrences of Content component on the same level in the component tree.";l=d+1}}),t&&i)return i<t?"left":"right";if(l&&i)return i<l?"left":"right"},b=a.Children.map(o,e=>{var t,i;if(a.isValidElement(e)){if(e.props.__TYPE__=="Sidebar"||((t=e.type)==null?void 0:t.displayName)==="Sidebar")return a.cloneElement(e,{placement:m(o)});if(e.props.__TYPE__=="PageLayout"||((i=e.type)==null?void 0:i.displayName)==="PageLayout")return a.cloneElement(e,{isChild:!0})}return e});return x.jsx(T,{isChild:h,hasSidebar:g,theme:P,ref:f,...p,children:b})});u.propTypes={__TYPE__:E.PropTypes.string};u.displayName="PageLayout";module.exports=u;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsx as E } from "react/jsx-runtime";
|
|
2
|
+
import i from "react";
|
|
3
|
+
import { P as x } from "./index-Ds9PUTwb.js";
|
|
4
|
+
import { n as S } from "./emotion-styled.browser.esm-BZSYYThs.js";
|
|
5
|
+
import { u as T } from "./emotion-element-5486c51c.browser.esm-CSejtOeT.js";
|
|
6
|
+
const C = S.section`
|
|
7
|
+
display: flex;
|
|
8
|
+
flex: auto;
|
|
9
|
+
flex-direction: ${(s) => s.hasSidebar ? "row" : "column"};
|
|
10
|
+
height: ${(s) => s.isChild ? "100%" : "100dvh"};
|
|
11
|
+
|
|
12
|
+
* {
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
& header,
|
|
17
|
+
footer {
|
|
18
|
+
flex: 0 0 auto;
|
|
19
|
+
min-height: 4rem;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
& main {
|
|
23
|
+
flex: auto;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
& aside {
|
|
28
|
+
flex: 0 0 15rem;
|
|
29
|
+
height: 100%;
|
|
30
|
+
}
|
|
31
|
+
`, y = i.forwardRef((s, h) => {
|
|
32
|
+
const { children: o, isChild: n, __TYPE__: L = "PageLayout", ...p } = s, m = T(), P = i.Children.toArray(o).some(
|
|
33
|
+
(e) => {
|
|
34
|
+
var t;
|
|
35
|
+
return e.props.__TYPE__ || ((t = e == null ? void 0 : e.type) == null ? void 0 : t.displayName) == "Sidebar";
|
|
36
|
+
}
|
|
37
|
+
), g = (e) => {
|
|
38
|
+
let t, a, l;
|
|
39
|
+
if (i.Children.forEach(e, (r, d) => {
|
|
40
|
+
var f, u, _;
|
|
41
|
+
if (r.props.__TYPE__ == "Sidebar" || ((f = r == null ? void 0 : r.type) == null ? void 0 : f.displayName) === "Sidebar") {
|
|
42
|
+
if (a)
|
|
43
|
+
throw "Found multiple ocurrences of Sidebar component on the same level in the component tree.";
|
|
44
|
+
a = d + 1;
|
|
45
|
+
} else if (r.props.__TYPE__ == "PageLayout" || ((u = r == null ? void 0 : r.type) == null ? void 0 : u.displayName) === "PageLayout") {
|
|
46
|
+
if (t)
|
|
47
|
+
throw "Found multiple ocurrences of PageLayout component on the same level in the component tree.";
|
|
48
|
+
t = d + 1;
|
|
49
|
+
} else if (r.props.__TYPE__ == "Content" || ((_ = r == null ? void 0 : r.type) == null ? void 0 : _.displayName) === "Content") {
|
|
50
|
+
if (l)
|
|
51
|
+
throw "Found multiple ocurrences of Content component on the same level in the component tree.";
|
|
52
|
+
l = d + 1;
|
|
53
|
+
}
|
|
54
|
+
}), t && a)
|
|
55
|
+
return a < t ? "left" : "right";
|
|
56
|
+
if (l && a)
|
|
57
|
+
return a < l ? "left" : "right";
|
|
58
|
+
}, b = i.Children.map(o, (e) => {
|
|
59
|
+
var t, a;
|
|
60
|
+
if (i.isValidElement(e)) {
|
|
61
|
+
if (e.props.__TYPE__ == "Sidebar" || ((t = e.type) == null ? void 0 : t.displayName) === "Sidebar")
|
|
62
|
+
return i.cloneElement(e, {
|
|
63
|
+
placement: g(o)
|
|
64
|
+
});
|
|
65
|
+
if (e.props.__TYPE__ == "PageLayout" || ((a = e.type) == null ? void 0 : a.displayName) === "PageLayout")
|
|
66
|
+
return i.cloneElement(e, { isChild: !0 });
|
|
67
|
+
}
|
|
68
|
+
return e;
|
|
69
|
+
});
|
|
70
|
+
return /* @__PURE__ */ E(
|
|
71
|
+
C,
|
|
72
|
+
{
|
|
73
|
+
isChild: n,
|
|
74
|
+
hasSidebar: P,
|
|
75
|
+
theme: m,
|
|
76
|
+
ref: h,
|
|
77
|
+
...p,
|
|
78
|
+
children: b
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
});
|
|
82
|
+
y.propTypes = {
|
|
83
|
+
/**
|
|
84
|
+
* Do not override this property.
|
|
85
|
+
* Should only be used as indicator for type if you are passing custom component.
|
|
86
|
+
*/
|
|
87
|
+
__TYPE__: x.string
|
|
88
|
+
};
|
|
89
|
+
y.displayName = "PageLayout";
|
|
90
|
+
export {
|
|
91
|
+
y as default
|
|
92
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";const a=require("react/jsx-runtime"),s=require("react"),n=require("./index-DXnSjbfJ.cjs"),L=require("./index-BjdOz5Ok.cjs"),D=require("./Icon.cjs"),h=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),r=require("./utils-hdRGTsQ7.cjs"),A=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),G=h.newStyled.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
|
|
5
|
+
min-height: ${e=>r.getSizeValueWithUnits(e.theme,e.size)};
|
|
6
|
+
max-height: ${e=>r.getSizeValueWithUnits(e.theme,e.size)};
|
|
7
|
+
background-color: ${e=>r.getColorRgbaValue(e.theme,"Input",e.color,"enabled","background")};
|
|
8
|
+
border: 1px solid
|
|
9
|
+
${e=>r.getColorRgbaValue(e.theme,"Input",e.focused===!0?"primary":e.color,e.disabled===!0?"disabled":"enabled","border")};
|
|
10
|
+
border-radius: ${e=>r.getBorderRadiusValueWithUnits(e.theme,"regular")};
|
|
11
|
+
|
|
12
|
+
${e=>e.focused&&e.readOnly!==!0?r.getOutlineCss(e.theme):""}
|
|
13
|
+
${e=>e.disabled===!0?r.getDisabledStateCss(e.theme):""}
|
|
14
|
+
`,S=h.newStyled.span`
|
|
15
|
+
padding: 0 12px;
|
|
16
|
+
color: ${e=>r.getColorRgbaValue(e.theme,"Input",e.focused===!0?"primary":e.color,"enabled","prefix")};
|
|
17
|
+
`,H=h.newStyled(S)``,J=h.newStyled(S)`
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
`,K=h.newStyled.input`
|
|
20
|
+
background: none;
|
|
21
|
+
border: none;
|
|
22
|
+
outline: none;
|
|
23
|
+
padding-top: 0.625rem;
|
|
24
|
+
padding-bottom: 0.625rem;
|
|
25
|
+
width: 100%;
|
|
26
|
+
|
|
27
|
+
${e=>r.getComponentTypographyCss(e.theme,"Input",e.size,"enabled")}
|
|
28
|
+
min-height: ${e=>r.getSizeValueWithUnits(e.theme,e.size)};
|
|
29
|
+
max-height: ${e=>r.getSizeValueWithUnits(e.theme,e.size)};
|
|
30
|
+
color: ${e=>r.getColorRgbaValue(e.theme,"Input",e.focused===!0?"primary":e.color,"enabled","text")};
|
|
31
|
+
caret-color: ${e=>r.getColorRgbaValue(e.theme,"Input",e.color,"enabled","caret")};
|
|
32
|
+
padding-right: ${e=>e.suffix?"0":"0.75rem"};
|
|
33
|
+
padding-left: ${e=>e.prefix?"0":"0.75rem"};
|
|
34
|
+
|
|
35
|
+
&::placeholder {
|
|
36
|
+
color: ${e=>r.getColorRgbaValue(e.theme,"Input",e.color,"enabled","placeholder")};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&:read-only {
|
|
40
|
+
cursor: default;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&:disabled {
|
|
44
|
+
${e=>r.getDisabledStateCss(e.theme)}
|
|
45
|
+
background: none;
|
|
46
|
+
}
|
|
47
|
+
`,I=s.forwardRef((e,m)=>{const{wrapperRef:V,disabled:T,readOnly:$,debounceTime:z=180,placeholder:R,prefix:b,suffix:f,value:c,defaultValue:k,onChange:u,onBlur:p,onFocus:x,className:v="",style:j={},size:C="small",color:i="primary",...q}=e,o=s.useRef(),d=A.useTheme(),[O,P]=s.useState(c||k||"");s.useEffect(()=>{c!=null&&P(c)},[c]);const[y,W]=s.useState(!0),[g,w]=s.useState(!1);s.useEffect(()=>{var l;const t=((l=o==null?void 0:o.current)==null?void 0:l.value)||"";o.current.selectionStart=t!=null&&t.length?t.length:0,o.current.selectionEnd=t!=null&&t.length?t.length:0},[y]),s.useEffect(()=>{m!=null&&(m.current=o.current)},[m,o]);const E=s.useCallback(L.debounce((t,l)=>U(t,l),z),[u]),U=(t,l)=>{u&&(u==null||u(t,l))},N=t=>{P(t.target.value),E(t,t.target.value)},_=()=>{W(!y),o.current.focus()},B=t=>{w(!0),x==null||x(t)},F=t=>{w(!1),p==null||p(t)};return a.jsxs(G,{ref:V,style:j,className:v,theme:d,color:i,size:C,focused:g,disabled:T,readOnly:$,children:[b&&a.jsx(S,{theme:d,color:i,focused:g,className:"lnc-input-prefix",children:b}),a.jsx(K,{ref:o,type:y?"password":"text",theme:d,color:i,size:C,placeholder:R,prefix:b,suffix:f,disabled:T,readOnly:$,focused:g,onFocus:B,onBlur:F,onChange:N,value:O,...q}),a.jsx(J,{theme:d,color:i,focused:g,onClick:_,children:a.jsx(D,{icon:y?"eye-slash":"eye"})}),f&&a.jsx(H,{theme:d,color:i,focused:g,className:"lnc-input-suffix",children:f})]})});I.propTypes={id:n.PropTypes.string,value:n.PropTypes.string,defaultValue:n.PropTypes.string,disabled:n.PropTypes.bool,readOnly:n.PropTypes.bool,debounceTime:n.PropTypes.number,placeholder:n.PropTypes.string,tabIndex:n.PropTypes.number,onChange:n.PropTypes.func,onBlur:n.PropTypes.func,onFocus:n.PropTypes.func,className:n.PropTypes.string,style:n.PropTypes.object,size:n.PropTypes.oneOf(["small","medium","large"]),color:n.PropTypes.oneOf(["primary","secondary","success","danger","warning","information","neutral","gray"])};module.exports=I;
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { jsxs as D, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import q, { useRef as A, useState as $, useEffect as I, useCallback as G } from "react";
|
|
3
|
+
import { P as n } from "./index-Ds9PUTwb.js";
|
|
4
|
+
import { d as H } from "./index-D5vEbKUT.js";
|
|
5
|
+
import J from "./Icon.js";
|
|
6
|
+
import { n as m } from "./emotion-styled.browser.esm-BZSYYThs.js";
|
|
7
|
+
import { f as g, b as a, c as K, h as M, g as O, a as Q } from "./utils-DEke8iwo.js";
|
|
8
|
+
import { u as X } from "./emotion-element-5486c51c.browser.esm-CSejtOeT.js";
|
|
9
|
+
const Y = m.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
|
|
13
|
+
min-height: ${(e) => g(e.theme, e.size)};
|
|
14
|
+
max-height: ${(e) => g(e.theme, e.size)};
|
|
15
|
+
background-color: ${(e) => a(
|
|
16
|
+
e.theme,
|
|
17
|
+
"Input",
|
|
18
|
+
e.color,
|
|
19
|
+
"enabled",
|
|
20
|
+
"background"
|
|
21
|
+
)};
|
|
22
|
+
border: 1px solid
|
|
23
|
+
${(e) => a(
|
|
24
|
+
e.theme,
|
|
25
|
+
"Input",
|
|
26
|
+
e.focused === !0 ? "primary" : e.color,
|
|
27
|
+
e.disabled === !0 ? "disabled" : "enabled",
|
|
28
|
+
"border"
|
|
29
|
+
)};
|
|
30
|
+
border-radius: ${(e) => K(e.theme, "regular")};
|
|
31
|
+
|
|
32
|
+
${(e) => e.focused && e.readOnly !== !0 ? M(e.theme) : ""}
|
|
33
|
+
${(e) => e.disabled === !0 ? O(e.theme) : ""}
|
|
34
|
+
`, C = m.span`
|
|
35
|
+
padding: 0 12px;
|
|
36
|
+
color: ${(e) => a(
|
|
37
|
+
e.theme,
|
|
38
|
+
"Input",
|
|
39
|
+
e.focused === !0 ? "primary" : e.color,
|
|
40
|
+
"enabled",
|
|
41
|
+
"prefix"
|
|
42
|
+
)};
|
|
43
|
+
`, Z = m(C)``, ee = m(C)`
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
`, te = m.input`
|
|
46
|
+
background: none;
|
|
47
|
+
border: none;
|
|
48
|
+
outline: none;
|
|
49
|
+
padding-top: 0.625rem;
|
|
50
|
+
padding-bottom: 0.625rem;
|
|
51
|
+
width: 100%;
|
|
52
|
+
|
|
53
|
+
${(e) => Q(e.theme, "Input", e.size, "enabled")}
|
|
54
|
+
min-height: ${(e) => g(e.theme, e.size)};
|
|
55
|
+
max-height: ${(e) => g(e.theme, e.size)};
|
|
56
|
+
color: ${(e) => a(
|
|
57
|
+
e.theme,
|
|
58
|
+
"Input",
|
|
59
|
+
e.focused === !0 ? "primary" : e.color,
|
|
60
|
+
"enabled",
|
|
61
|
+
"text"
|
|
62
|
+
)};
|
|
63
|
+
caret-color: ${(e) => a(e.theme, "Input", e.color, "enabled", "caret")};
|
|
64
|
+
padding-right: ${(e) => e.suffix ? "0" : "0.75rem"};
|
|
65
|
+
padding-left: ${(e) => e.prefix ? "0" : "0.75rem"};
|
|
66
|
+
|
|
67
|
+
&::placeholder {
|
|
68
|
+
color: ${(e) => a(
|
|
69
|
+
e.theme,
|
|
70
|
+
"Input",
|
|
71
|
+
e.color,
|
|
72
|
+
"enabled",
|
|
73
|
+
"placeholder"
|
|
74
|
+
)};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&:read-only {
|
|
78
|
+
cursor: default;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&:disabled {
|
|
82
|
+
${(e) => O(e.theme)}
|
|
83
|
+
background: none;
|
|
84
|
+
}
|
|
85
|
+
`, ne = q.forwardRef((e, h) => {
|
|
86
|
+
const {
|
|
87
|
+
wrapperRef: T,
|
|
88
|
+
disabled: S,
|
|
89
|
+
readOnly: k,
|
|
90
|
+
debounceTime: R = 180,
|
|
91
|
+
placeholder: V,
|
|
92
|
+
prefix: b,
|
|
93
|
+
suffix: y,
|
|
94
|
+
value: l,
|
|
95
|
+
defaultValue: B,
|
|
96
|
+
//----------------
|
|
97
|
+
onChange: s,
|
|
98
|
+
onBlur: p,
|
|
99
|
+
onFocus: x,
|
|
100
|
+
//----------------
|
|
101
|
+
className: F = "",
|
|
102
|
+
style: N = {},
|
|
103
|
+
size: v = "small",
|
|
104
|
+
color: d = "primary",
|
|
105
|
+
...P
|
|
106
|
+
} = e, r = A(), c = X(), [j, z] = $(l || B || "");
|
|
107
|
+
I(() => {
|
|
108
|
+
l != null && z(l);
|
|
109
|
+
}, [l]);
|
|
110
|
+
const [f, L] = $(!0), [i, w] = $(!1);
|
|
111
|
+
I(() => {
|
|
112
|
+
var o;
|
|
113
|
+
const t = ((o = r == null ? void 0 : r.current) == null ? void 0 : o.value) || "";
|
|
114
|
+
r.current.selectionStart = t != null && t.length ? t.length : 0, r.current.selectionEnd = t != null && t.length ? t.length : 0;
|
|
115
|
+
}, [f]), I(() => {
|
|
116
|
+
h != null && (h.current = r.current);
|
|
117
|
+
}, [h, r]);
|
|
118
|
+
const W = G(
|
|
119
|
+
H((t, o) => E(t, o), R),
|
|
120
|
+
[s]
|
|
121
|
+
), E = (t, o) => {
|
|
122
|
+
s && (s == null || s(t, o));
|
|
123
|
+
}, U = (t) => {
|
|
124
|
+
z(t.target.value), W(t, t.target.value);
|
|
125
|
+
}, _ = () => {
|
|
126
|
+
L(!f), r.current.focus();
|
|
127
|
+
};
|
|
128
|
+
return /* @__PURE__ */ D(
|
|
129
|
+
Y,
|
|
130
|
+
{
|
|
131
|
+
ref: T,
|
|
132
|
+
style: N,
|
|
133
|
+
className: F,
|
|
134
|
+
theme: c,
|
|
135
|
+
color: d,
|
|
136
|
+
size: v,
|
|
137
|
+
focused: i,
|
|
138
|
+
disabled: S,
|
|
139
|
+
readOnly: k,
|
|
140
|
+
children: [
|
|
141
|
+
b && /* @__PURE__ */ u(
|
|
142
|
+
C,
|
|
143
|
+
{
|
|
144
|
+
theme: c,
|
|
145
|
+
color: d,
|
|
146
|
+
focused: i,
|
|
147
|
+
className: "lnc-input-prefix",
|
|
148
|
+
children: b
|
|
149
|
+
}
|
|
150
|
+
),
|
|
151
|
+
/* @__PURE__ */ u(
|
|
152
|
+
te,
|
|
153
|
+
{
|
|
154
|
+
ref: r,
|
|
155
|
+
type: f ? "password" : "text",
|
|
156
|
+
theme: c,
|
|
157
|
+
color: d,
|
|
158
|
+
size: v,
|
|
159
|
+
placeholder: V,
|
|
160
|
+
prefix: b,
|
|
161
|
+
suffix: y,
|
|
162
|
+
disabled: S,
|
|
163
|
+
readOnly: k,
|
|
164
|
+
focused: i,
|
|
165
|
+
onFocus: (t) => {
|
|
166
|
+
w(!0), x == null || x(t);
|
|
167
|
+
},
|
|
168
|
+
onBlur: (t) => {
|
|
169
|
+
w(!1), p == null || p(t);
|
|
170
|
+
},
|
|
171
|
+
onChange: U,
|
|
172
|
+
value: j,
|
|
173
|
+
...P
|
|
174
|
+
}
|
|
175
|
+
),
|
|
176
|
+
/* @__PURE__ */ u(
|
|
177
|
+
ee,
|
|
178
|
+
{
|
|
179
|
+
theme: c,
|
|
180
|
+
color: d,
|
|
181
|
+
focused: i,
|
|
182
|
+
onClick: _,
|
|
183
|
+
children: /* @__PURE__ */ u(J, { icon: f ? "eye-slash" : "eye" })
|
|
184
|
+
}
|
|
185
|
+
),
|
|
186
|
+
y && /* @__PURE__ */ u(
|
|
187
|
+
Z,
|
|
188
|
+
{
|
|
189
|
+
theme: c,
|
|
190
|
+
color: d,
|
|
191
|
+
focused: i,
|
|
192
|
+
className: "lnc-input-suffix",
|
|
193
|
+
children: y
|
|
194
|
+
}
|
|
195
|
+
)
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
});
|
|
200
|
+
ne.propTypes = {
|
|
201
|
+
id: n.string,
|
|
202
|
+
value: n.string,
|
|
203
|
+
defaultValue: n.string,
|
|
204
|
+
disabled: n.bool,
|
|
205
|
+
readOnly: n.bool,
|
|
206
|
+
debounceTime: n.number,
|
|
207
|
+
placeholder: n.string,
|
|
208
|
+
tabIndex: n.number,
|
|
209
|
+
//----------------
|
|
210
|
+
onChange: n.func,
|
|
211
|
+
onBlur: n.func,
|
|
212
|
+
onFocus: n.func,
|
|
213
|
+
//----------------
|
|
214
|
+
className: n.string,
|
|
215
|
+
style: n.object,
|
|
216
|
+
size: n.oneOf(["small", "medium", "large"]),
|
|
217
|
+
color: n.oneOf([
|
|
218
|
+
"primary",
|
|
219
|
+
"secondary",
|
|
220
|
+
"success",
|
|
221
|
+
"danger",
|
|
222
|
+
"warning",
|
|
223
|
+
"information",
|
|
224
|
+
"neutral",
|
|
225
|
+
"gray"
|
|
226
|
+
])
|
|
227
|
+
};
|
|
228
|
+
export {
|
|
229
|
+
ne as default
|
|
230
|
+
};
|