@darajs/components 1.12.5 → 1.12.7
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.
|
Binary file
|
|
@@ -9129,7 +9129,7 @@
|
|
|
9129
9129
|
var _a3;
|
|
9130
9130
|
return jsxRuntime.exports.jsxs(Wrapper$c, { className: props.className, style: props.style, children: [jsxRuntime.exports.jsxs(Loader, { color: props.color, size: props.size, children: [jsxRuntime.exports.jsx("div", { className: "sk-chase-dot" }), jsxRuntime.exports.jsx("div", { className: "sk-chase-dot" }), jsxRuntime.exports.jsx("div", { className: "sk-chase-dot" }), jsxRuntime.exports.jsx("div", { className: "sk-chase-dot" }), jsxRuntime.exports.jsx("div", { className: "sk-chase-dot" }), jsxRuntime.exports.jsx("div", { className: "sk-chase-dot" })] }), (props.showText || props.text) && jsxRuntime.exports.jsx(LoadingText, { color: props.color, children: (_a3 = props.text) !== null && _a3 !== void 0 ? _a3 : "LOADING" })] });
|
|
9131
9131
|
}
|
|
9132
|
-
var __rest$
|
|
9132
|
+
var __rest$g = globalThis && globalThis.__rest || function(s2, e3) {
|
|
9133
9133
|
var t2 = {};
|
|
9134
9134
|
for (var p2 in s2)
|
|
9135
9135
|
if (Object.prototype.hasOwnProperty.call(s2, p2) && e3.indexOf(p2) < 0)
|
|
@@ -9235,7 +9235,7 @@
|
|
|
9235
9235
|
secondary: SecondaryButton$1
|
|
9236
9236
|
};
|
|
9237
9237
|
function Button$2(_a3, ref) {
|
|
9238
|
-
var { autoFocus, children: children2, className, disabled: disabled2, download, href, loading, id: id2, onClick, outline = false, style: style2, styling = "primary", type = "button" } = _a3, props = __rest$
|
|
9238
|
+
var { autoFocus, children: children2, className, disabled: disabled2, download, href, loading, id: id2, onClick, outline = false, style: style2, styling = "primary", type = "button" } = _a3, props = __rest$g(_a3, ["autoFocus", "children", "className", "disabled", "download", "href", "loading", "id", "onClick", "outline", "style", "styling", "type"]);
|
|
9239
9239
|
const currentTheme = useClTheme();
|
|
9240
9240
|
const Component = stylingMap[styling];
|
|
9241
9241
|
const content2 = loading ? jsxRuntime.exports.jsx(StyledLoading, { color: outline ? currentTheme.colors.grey2 : currentTheme.colors.blue1 }) : children2;
|
|
@@ -14948,7 +14948,7 @@
|
|
|
14948
14948
|
|
|
14949
14949
|
width: 100%;
|
|
14950
14950
|
height: 100%;
|
|
14951
|
-
min-height: 3.
|
|
14951
|
+
min-height: 3.4rem;
|
|
14952
14952
|
padding: 1rem;
|
|
14953
14953
|
|
|
14954
14954
|
font-size: 1rem;
|
|
@@ -14959,14 +14959,14 @@
|
|
|
14959
14959
|
border-radius: 0.25rem;
|
|
14960
14960
|
outline: 0;
|
|
14961
14961
|
|
|
14962
|
-
:focus:not(:disabled) {
|
|
14963
|
-
border: 1px solid ${(props) => props.isErrored ? props.theme.colors.error : props.theme.colors.grey3};
|
|
14964
|
-
}
|
|
14965
|
-
|
|
14966
14962
|
:hover:not(:disabled) {
|
|
14967
14963
|
border: 1px solid ${(props) => props.isErrored ? props.theme.colors.error : props.theme.colors.grey2};
|
|
14968
14964
|
}
|
|
14969
14965
|
|
|
14966
|
+
:focus:not(:disabled) {
|
|
14967
|
+
border: 1px solid ${(props) => props.isErrored ? props.theme.colors.error : props.theme.colors.grey3};
|
|
14968
|
+
}
|
|
14969
|
+
|
|
14970
14970
|
:active:not(:disabled) {
|
|
14971
14971
|
border: 1px solid ${(props) => props.isErrored ? props.theme.colors.error : props.theme.colors.grey3};
|
|
14972
14972
|
}
|
|
@@ -14981,13 +14981,23 @@
|
|
|
14981
14981
|
`;
|
|
14982
14982
|
function TextArea({ autoFocus, className, disabled: disabled2, errorMsg, initialValue, keydownFilter, maxHeight, onBlur, onChange: onChange2, onClick, onComplete, placeholder, style: style2, value, resize }) {
|
|
14983
14983
|
const textareaRef = React__namespace.useRef(null);
|
|
14984
|
-
React__namespace.
|
|
14984
|
+
React__namespace.useLayoutEffect(() => {
|
|
14985
14985
|
if (maxHeight && textareaRef.current) {
|
|
14986
|
-
const
|
|
14987
|
-
|
|
14988
|
-
const
|
|
14986
|
+
const computedStyle = window.getComputedStyle(textareaRef.current);
|
|
14987
|
+
const minHeight = parseFloat(computedStyle.minHeight);
|
|
14988
|
+
const maxHeightInPx = parseFloat(computedStyle.maxHeight);
|
|
14989
|
+
textareaRef.current.style.height = `${minHeight}px`;
|
|
14990
|
+
const newHeight = textareaRef.current.scrollHeight;
|
|
14989
14991
|
if (minHeight < newHeight) {
|
|
14990
|
-
|
|
14992
|
+
const adjustedHeight = Math.min(newHeight, maxHeightInPx);
|
|
14993
|
+
textareaRef.current.style.height = `${adjustedHeight}px`;
|
|
14994
|
+
if (adjustedHeight >= maxHeightInPx) {
|
|
14995
|
+
textareaRef.current.style.overflowY = "auto";
|
|
14996
|
+
} else {
|
|
14997
|
+
textareaRef.current.style.overflowY = "hidden";
|
|
14998
|
+
}
|
|
14999
|
+
} else {
|
|
15000
|
+
textareaRef.current.style.overflowY = "hidden";
|
|
14991
15001
|
}
|
|
14992
15002
|
}
|
|
14993
15003
|
}, [maxHeight, value]);
|
|
@@ -32963,7 +32973,7 @@
|
|
|
32963
32973
|
}, [props.codeTheme, themeCtx.themeType]);
|
|
32964
32974
|
return jsxRuntime.exports.jsxs(CodeViewerContainer, { style: Object.assign({}, props.style), className: props.className, children: [jsxRuntime.exports.jsxs(TopBar, { "$isLightTheme": props.codeTheme !== "dark", children: [jsxRuntime.exports.jsx("span", { children: props.language }), isCopied ? jsxRuntime.exports.jsxs(CopyToClipboardContainer, { children: [jsxRuntime.exports.jsx(Check, {}), " Copied!"] }) : jsxRuntime.exports.jsxs(CopyToClipboardContainer, { style: { cursor: "pointer" }, onClick: () => copyCodeToClipboard(props.value), role: "button", children: [jsxRuntime.exports.jsx(Copy, {}), " Copy code"] })] }), jsxRuntime.exports.jsx(Highlight$1, Object.assign({}, defaultProps$6, { code: props.value, language: props.language, theme: viewerTheme, children: ({ className, style: style2, tokens: tokens2, getLineProps, getTokenProps }) => jsxRuntime.exports.jsx(StyledPre, { className, "$isLightTheme": props.codeTheme !== "dark", style: Object.assign({}, style2), children: tokens2.map((line, i2) => React.createElement("div", Object.assign({}, getLineProps({ key: i2, line }), { key: i2 }), line.map((token, key) => React.createElement("code", Object.assign({}, getTokenProps({ key, token }), { key }))))) }) }))] });
|
|
32965
32975
|
}
|
|
32966
|
-
var __rest$
|
|
32976
|
+
var __rest$f = globalThis && globalThis.__rest || function(s2, e3) {
|
|
32967
32977
|
var t2 = {};
|
|
32968
32978
|
for (var p2 in s2)
|
|
32969
32979
|
if (Object.prototype.hasOwnProperty.call(s2, p2) && e3.indexOf(p2) < 0)
|
|
@@ -33017,8 +33027,7 @@
|
|
|
33017
33027
|
}
|
|
33018
33028
|
|
|
33019
33029
|
blockquote {
|
|
33020
|
-
|
|
33021
|
-
quotes: '"\\201C""\\201D""\\2018""\\2019"';
|
|
33030
|
+
quotes: '\\201C' '\\201D' '\\2018' '\\2019';
|
|
33022
33031
|
|
|
33023
33032
|
margin-top: 1.5rem;
|
|
33024
33033
|
margin-bottom: 1.5rem;
|
|
@@ -33029,6 +33038,14 @@
|
|
|
33029
33038
|
color: ${(props) => props.theme.colors.grey6};
|
|
33030
33039
|
|
|
33031
33040
|
border-left: 0.25rem solid ${(props) => props.theme.colors.grey3};
|
|
33041
|
+
|
|
33042
|
+
p:first-of-type::before {
|
|
33043
|
+
content: open-quote;
|
|
33044
|
+
}
|
|
33045
|
+
|
|
33046
|
+
p:last-of-type::after {
|
|
33047
|
+
content: close-quote;
|
|
33048
|
+
}
|
|
33032
33049
|
}
|
|
33033
33050
|
|
|
33034
33051
|
h1 {
|
|
@@ -33041,7 +33058,7 @@
|
|
|
33041
33058
|
}
|
|
33042
33059
|
|
|
33043
33060
|
h2 {
|
|
33044
|
-
margin-top:
|
|
33061
|
+
margin-top: 2rem;
|
|
33045
33062
|
margin-bottom: 1rem;
|
|
33046
33063
|
|
|
33047
33064
|
font-size: 2rem;
|
|
@@ -33076,6 +33093,13 @@
|
|
|
33076
33093
|
}
|
|
33077
33094
|
}
|
|
33078
33095
|
|
|
33096
|
+
figcaption {
|
|
33097
|
+
margin-top: 0.875rem;
|
|
33098
|
+
color: ${(props) => props.theme.colors.grey5};
|
|
33099
|
+
font-size: 0.875rem;
|
|
33100
|
+
line-height: 1.5rem;
|
|
33101
|
+
}
|
|
33102
|
+
|
|
33079
33103
|
h2 code {
|
|
33080
33104
|
font-size: 0.875rem;
|
|
33081
33105
|
}
|
|
@@ -33143,10 +33167,6 @@
|
|
|
33143
33167
|
border-radius: 0.25rem;
|
|
33144
33168
|
}
|
|
33145
33169
|
|
|
33146
|
-
strong {
|
|
33147
|
-
font-style: italic;
|
|
33148
|
-
}
|
|
33149
|
-
|
|
33150
33170
|
p {
|
|
33151
33171
|
margin-top: 0.75rem;
|
|
33152
33172
|
margin-bottom: 0.75rem;
|
|
@@ -33162,6 +33182,15 @@
|
|
|
33162
33182
|
}
|
|
33163
33183
|
}
|
|
33164
33184
|
|
|
33185
|
+
ol > li::marker {
|
|
33186
|
+
font-weight: 400;
|
|
33187
|
+
color: ${(props) => props.theme.colors.text};
|
|
33188
|
+
}
|
|
33189
|
+
|
|
33190
|
+
ul > li::marker {
|
|
33191
|
+
color: ${(props) => props.theme.colors.grey4};
|
|
33192
|
+
}
|
|
33193
|
+
|
|
33165
33194
|
hr {
|
|
33166
33195
|
margin-top: 3rem;
|
|
33167
33196
|
margin-bottom: 3rem;
|
|
@@ -33170,12 +33199,22 @@
|
|
|
33170
33199
|
table {
|
|
33171
33200
|
font-size: 0.875rem;
|
|
33172
33201
|
line-height: 1.7;
|
|
33202
|
+
margin-top: 2rem;
|
|
33203
|
+
margin-bottom: 2rem;
|
|
33204
|
+
table-layout: auto;
|
|
33205
|
+
width: 100%;
|
|
33206
|
+
border-collapse: collapse;
|
|
33173
33207
|
|
|
33174
33208
|
thead {
|
|
33209
|
+
border-bottom: 1px solid ${(props) => props.theme.colors.grey3};
|
|
33210
|
+
|
|
33175
33211
|
th {
|
|
33176
33212
|
padding-right: 0.5rem;
|
|
33177
33213
|
padding-bottom: 0.5rem;
|
|
33178
33214
|
padding-left: 0.5rem;
|
|
33215
|
+
vertical-align: bottom;
|
|
33216
|
+
font-weight: 600;
|
|
33217
|
+
text-align: start;
|
|
33179
33218
|
}
|
|
33180
33219
|
|
|
33181
33220
|
th:first-child {
|
|
@@ -33187,17 +33226,36 @@
|
|
|
33187
33226
|
}
|
|
33188
33227
|
}
|
|
33189
33228
|
|
|
33190
|
-
|
|
33229
|
+
tfoot {
|
|
33230
|
+
border-top: 1px solid ${(props) => props.theme.colors.grey2};
|
|
33231
|
+
|
|
33191
33232
|
td {
|
|
33192
|
-
|
|
33233
|
+
vertical-align: top;
|
|
33234
|
+
text-align: start;
|
|
33193
33235
|
}
|
|
33236
|
+
}
|
|
33194
33237
|
|
|
33195
|
-
|
|
33196
|
-
|
|
33238
|
+
tbody {
|
|
33239
|
+
tr {
|
|
33240
|
+
border-bottom: 1px solid ${(props) => props.theme.colors.grey2};
|
|
33241
|
+
|
|
33242
|
+
&:last-child {
|
|
33243
|
+
border-bottom: 0;
|
|
33244
|
+
}
|
|
33197
33245
|
}
|
|
33198
33246
|
|
|
33199
|
-
td
|
|
33200
|
-
padding
|
|
33247
|
+
td {
|
|
33248
|
+
padding: 0.5rem;
|
|
33249
|
+
vertical-align: baseline;
|
|
33250
|
+
text-align: start;
|
|
33251
|
+
|
|
33252
|
+
&:first-child {
|
|
33253
|
+
padding-left: 0;
|
|
33254
|
+
}
|
|
33255
|
+
|
|
33256
|
+
&:last-child {
|
|
33257
|
+
padding-right: 0;
|
|
33258
|
+
}
|
|
33201
33259
|
}
|
|
33202
33260
|
}
|
|
33203
33261
|
}
|
|
@@ -33238,7 +33296,7 @@
|
|
|
33238
33296
|
`;
|
|
33239
33297
|
function CodeDisplay(props) {
|
|
33240
33298
|
const theme2 = useClTheme();
|
|
33241
|
-
const { children: children2 } = props, rest = __rest$
|
|
33299
|
+
const { children: children2 } = props, rest = __rest$f(props, ["children"]);
|
|
33242
33300
|
const match2 = /language-(\w+)/.exec(props.className || "");
|
|
33243
33301
|
const parsed = React__namespace.useMemo(() => {
|
|
33244
33302
|
return String(children2).trim().replace(/\n\n/g, "\n");
|
|
@@ -33250,7 +33308,7 @@
|
|
|
33250
33308
|
}
|
|
33251
33309
|
function Markdown$1(props) {
|
|
33252
33310
|
var _a3;
|
|
33253
|
-
const { markdown, className, style: style2 } = props, reactMarkdownProps = __rest$
|
|
33311
|
+
const { markdown, className, style: style2 } = props, reactMarkdownProps = __rest$f(props, ["markdown", "className", "style"]);
|
|
33254
33312
|
return jsxRuntime.exports.jsx(CustomMarkdownWrapper, { className, style: style2, children: jsxRuntime.exports.jsx(Markdown$2, Object.assign({}, reactMarkdownProps, { components: Object.assign({ code: CodeDisplay }, reactMarkdownProps.components), remarkPlugins: (_a3 = reactMarkdownProps.remarkPlugins) !== null && _a3 !== void 0 ? _a3 : [remarkGfm], children: markdown })) });
|
|
33255
33313
|
}
|
|
33256
33314
|
var top$1 = "top";
|
|
@@ -37487,7 +37545,7 @@
|
|
|
37487
37545
|
React__namespace.useLayoutEffect(() => {
|
|
37488
37546
|
scrollToBottom(chatBodyRef === null || chatBodyRef === void 0 ? void 0 : chatBodyRef.current);
|
|
37489
37547
|
}, []);
|
|
37490
|
-
return jsxRuntime.exports.jsxs(ChatWrapper, { className: props.className, style: props.style, "$isPopup": props.isPopup, children: [jsxRuntime.exports.jsxs(ChatTop, { children: [jsxRuntime.exports.jsx("span", { children: (_b = props.chatTitle) !== null && _b !== void 0 ? _b : "Chat" }), props.isPopup && jsxRuntime.exports.jsx(CloseIcon, { onClick: props.onClose, "aria-label": "Close chat" })] }), jsxRuntime.exports.jsxs(ChatBody, { ref: chatBodyRef, role: "log", children: [localMessages.map((message) => jsxRuntime.exports.jsx(MessageComponent, { onChange: onEditMessage, onDelete: onDeleteMessage, value: message, didUserWriteMessage: didUserWriteMessage(message, props.activeUser), isEditable: !props.isHistoryReadonly }, message.id)), props.loadingComponent] }), jsxRuntime.exports.jsxs(ReplyWrapper, { children: [jsxRuntime.exports.jsx(TextArea, { onChange: onChangeReply, onComplete: onSubmitMessage, placeholder: (_c = props.placeholder) !== null && _c !== void 0 ? _c : "Add a comment", resize: "none", maxHeight: 6, value: reply, style: { width: "100%" } }), jsxRuntime.exports.jsx(ReplyButtons, { children: jsxRuntime.exports.jsx(Button$3, { "aria-label": "Send", style: { height: "3.
|
|
37548
|
+
return jsxRuntime.exports.jsxs(ChatWrapper, { className: props.className, style: props.style, "$isPopup": props.isPopup, children: [jsxRuntime.exports.jsxs(ChatTop, { children: [jsxRuntime.exports.jsx("span", { children: (_b = props.chatTitle) !== null && _b !== void 0 ? _b : "Chat" }), props.isPopup && jsxRuntime.exports.jsx(CloseIcon, { onClick: props.onClose, "aria-label": "Close chat" })] }), jsxRuntime.exports.jsxs(ChatBody, { ref: chatBodyRef, role: "log", children: [localMessages.map((message) => jsxRuntime.exports.jsx(MessageComponent, { onChange: onEditMessage, onDelete: onDeleteMessage, value: message, didUserWriteMessage: didUserWriteMessage(message, props.activeUser), isEditable: !props.isHistoryReadonly }, message.id)), props.loadingComponent] }), jsxRuntime.exports.jsxs(ReplyWrapper, { children: [jsxRuntime.exports.jsx(TextArea, { onChange: onChangeReply, onComplete: onSubmitMessage, placeholder: (_c = props.placeholder) !== null && _c !== void 0 ? _c : "Add a comment", resize: "none", maxHeight: 6, value: reply, style: { width: "100%" } }), jsxRuntime.exports.jsx(ReplyButtons, { children: jsxRuntime.exports.jsx(Button$3, { "aria-label": "Send", style: { height: "3.4rem" }, disabled: !!props.loadingComponent || !(reply.trim().length > 0), onClick: onSubmitMessage, children: jsxRuntime.exports.jsx(PaperPlane, { onClick: onSubmitMessage }) }) })] })] });
|
|
37491
37549
|
}
|
|
37492
37550
|
const CheckboxWrapper$1 = styled__default.default.label`
|
|
37493
37551
|
cursor: ${(props) => props.disabled ? "not-allowed" : "pointer"};
|
|
@@ -37707,7 +37765,7 @@
|
|
|
37707
37765
|
return jsxRuntime.exports.jsx(CheckboxWrapper, { "aria-disabled": props.disabled, children: jsxRuntime.exports.jsx(Checkbox, { disabled: isSelectPermitted ? props.disabled : ((_a3 = checkedState.find((option) => option.value === item.value)) === null || _a3 === void 0 ? void 0 : _a3.state) === false, id: index2, isListStyle: props.isListStyle, label: item.label ? item.label : item.value, onChange: (checked, e3) => onChangeValue(e3), selected: (_b = checkedState.find((option) => option.value === item.value)) === null || _b === void 0 ? void 0 : _b.state }) }, `item-${index2}`);
|
|
37708
37766
|
})] });
|
|
37709
37767
|
}
|
|
37710
|
-
var __rest$
|
|
37768
|
+
var __rest$e = globalThis && globalThis.__rest || function(s2, e3) {
|
|
37711
37769
|
var t2 = {};
|
|
37712
37770
|
for (var p2 in s2)
|
|
37713
37771
|
if (Object.prototype.hasOwnProperty.call(s2, p2) && e3.indexOf(p2) < 0)
|
|
@@ -37763,35 +37821,25 @@
|
|
|
37763
37821
|
color: ${(props) => props.theme.colors.error};
|
|
37764
37822
|
`;
|
|
37765
37823
|
const Input$3 = React.forwardRef((_a3, ref) => {
|
|
37766
|
-
var { type = "text" } = _a3,
|
|
37767
|
-
const
|
|
37824
|
+
var { type = "text", onChange: onChange2, onKeyDown, keydownFilter, onComplete, maxValue, minValue, errorMsg, className, style: style2, initialValue } = _a3, rest = __rest$e(_a3, ["type", "onChange", "onKeyDown", "keydownFilter", "onComplete", "maxValue", "minValue", "errorMsg", "className", "style", "initialValue"]);
|
|
37825
|
+
const handleChange = (e3) => {
|
|
37768
37826
|
const target = e3.target;
|
|
37769
|
-
if (
|
|
37770
|
-
|
|
37827
|
+
if (onChange2) {
|
|
37828
|
+
onChange2(target.value, e3);
|
|
37771
37829
|
}
|
|
37772
37830
|
};
|
|
37773
|
-
const
|
|
37774
|
-
if (
|
|
37775
|
-
|
|
37831
|
+
const handleKeyDown = (e3) => {
|
|
37832
|
+
if (onKeyDown) {
|
|
37833
|
+
onKeyDown(e3);
|
|
37776
37834
|
}
|
|
37777
|
-
if (
|
|
37835
|
+
if (keydownFilter && !keydownFilter(e3)) {
|
|
37778
37836
|
e3.preventDefault();
|
|
37779
37837
|
}
|
|
37780
|
-
if (e3.key === Key.ENTER &&
|
|
37781
|
-
|
|
37782
|
-
}
|
|
37783
|
-
};
|
|
37784
|
-
const addOptionalItems = () => {
|
|
37785
|
-
const result = {};
|
|
37786
|
-
if (props.minValue) {
|
|
37787
|
-
result.minValue = props.minValue;
|
|
37788
|
-
}
|
|
37789
|
-
if (props.maxValue) {
|
|
37790
|
-
result.maxValue = props.minValue;
|
|
37838
|
+
if (e3.key === Key.ENTER && onComplete) {
|
|
37839
|
+
onComplete();
|
|
37791
37840
|
}
|
|
37792
|
-
return result;
|
|
37793
37841
|
};
|
|
37794
|
-
return jsxRuntime.exports.jsxs(InputWrapper$5, { className
|
|
37842
|
+
return jsxRuntime.exports.jsxs(InputWrapper$5, { className, style: style2, children: [jsxRuntime.exports.jsx(PrimaryInput, Object.assign({}, rest, { defaultValue: initialValue, isErrored: !!errorMsg, onChange: handleChange, onKeyDown: handleKeyDown, ref, type, min: minValue, max: maxValue })), errorMsg && jsxRuntime.exports.jsx(ErrorMessage$1, { children: errorMsg })] });
|
|
37795
37843
|
});
|
|
37796
37844
|
Input$3.displayName = "Input";
|
|
37797
37845
|
const Wrapper$b = styled__default.default.div`
|
|
@@ -40344,7 +40392,7 @@
|
|
|
40344
40392
|
activeIndex
|
|
40345
40393
|
};
|
|
40346
40394
|
}
|
|
40347
|
-
var __rest$
|
|
40395
|
+
var __rest$d = globalThis && globalThis.__rest || function(s2, e3) {
|
|
40348
40396
|
var t2 = {};
|
|
40349
40397
|
for (var p2 in s2)
|
|
40350
40398
|
if (Object.prototype.hasOwnProperty.call(s2, p2) && e3.indexOf(p2) < 0)
|
|
@@ -40365,11 +40413,11 @@
|
|
|
40365
40413
|
background-color: transparent !important;
|
|
40366
40414
|
`;
|
|
40367
40415
|
const ChevronButton = (_a3) => {
|
|
40368
|
-
var { getToggleButtonProps, disabled: disabled2, isOpen } = _a3, props = __rest$
|
|
40416
|
+
var { getToggleButtonProps, disabled: disabled2, isOpen } = _a3, props = __rest$d(_a3, ["getToggleButtonProps", "disabled", "isOpen"]);
|
|
40369
40417
|
return jsxRuntime.exports.jsx(StyledChevronButton, Object.assign({}, getToggleButtonProps(), props, { children: jsxRuntime.exports.jsx(Chevron$2, { disabled: disabled2, isOpen }) }));
|
|
40370
40418
|
};
|
|
40371
40419
|
const ChevronButton$1 = React__default.default.memo(ChevronButton);
|
|
40372
|
-
var __rest$
|
|
40420
|
+
var __rest$c = globalThis && globalThis.__rest || function(s2, e3) {
|
|
40373
40421
|
var t2 = {};
|
|
40374
40422
|
for (var p2 in s2)
|
|
40375
40423
|
if (Object.prototype.hasOwnProperty.call(s2, p2) && e3.indexOf(p2) < 0)
|
|
@@ -40422,7 +40470,7 @@
|
|
|
40422
40470
|
}
|
|
40423
40471
|
`;
|
|
40424
40472
|
const ListItem = ({ size: size2, title, item, index: index2, getItemProps, itemClass, children: children2, isHighlighted, isSelected }) => {
|
|
40425
|
-
const _a3 = getItemProps({ index: index2, item }), { itemClassName } = _a3, itemProps = __rest$
|
|
40473
|
+
const _a3 = getItemProps({ index: index2, item }), { itemClassName } = _a3, itemProps = __rest$c(_a3, ["itemClassName"]);
|
|
40426
40474
|
return jsxRuntime.exports.jsx(StyledListItem, Object.assign({}, itemProps, { className: itemClass ? `${itemClassName} ${itemClass}` : itemClassName, title, size: size2, item, isHighlighted, isSelected, children: children2 }));
|
|
40427
40475
|
};
|
|
40428
40476
|
ListItem.displayName = "ListItem";
|
|
@@ -47071,7 +47119,7 @@
|
|
|
47071
47119
|
} }]), a2;
|
|
47072
47120
|
}(), jt$1 = "input", Ht$1 = "navigate";
|
|
47073
47121
|
const reactDatepicker = "";
|
|
47074
|
-
var __rest$
|
|
47122
|
+
var __rest$b = globalThis && globalThis.__rest || function(s2, e3) {
|
|
47075
47123
|
var t2 = {};
|
|
47076
47124
|
for (var p2 in s2)
|
|
47077
47125
|
if (Object.prototype.hasOwnProperty.call(s2, p2) && e3.indexOf(p2) < 0)
|
|
@@ -47203,7 +47251,7 @@
|
|
|
47203
47251
|
}
|
|
47204
47252
|
`;
|
|
47205
47253
|
const DatepickerListItem = React__namespace.memo(({ item, index: index2, getItemProps, isSelected, size: size2, isHighlighted }) => {
|
|
47206
|
-
const _a3 = getItemProps({ index: index2, item }), itemProps = __rest$
|
|
47254
|
+
const _a3 = getItemProps({ index: index2, item }), itemProps = __rest$b(_a3, ["itemClassName"]);
|
|
47207
47255
|
return jsxRuntime.exports.jsx(StyledDatepickerListItem, Object.assign({}, itemProps, { isSelected, title: item.label, item, index: index2, size: size2, isHighlighted, children: item.label }));
|
|
47208
47256
|
});
|
|
47209
47257
|
const StyledDropdownList = React__namespace.memo(styled__default.default(DropdownList$1)`
|
|
@@ -48966,7 +49014,7 @@
|
|
|
48966
49014
|
};
|
|
48967
49015
|
return ReactDOM__default.default.createPortal(jsxRuntime.exports.jsx(Background$1, { id: props.id, onClick: props.onAttemptClose, onTransitionEnd, render: renderModal, children: jsxRuntime.exports.jsx(ModalWrapper, { className: `cl-modal-content ${(_a3 = props.className) !== null && _a3 !== void 0 ? _a3 : ""}`, onClick: stopPropagation, render: renderModal, style: props.style, children: props.children }) }), document.body);
|
|
48968
49016
|
}
|
|
48969
|
-
var __rest$
|
|
49017
|
+
var __rest$a = globalThis && globalThis.__rest || function(s2, e3) {
|
|
48970
49018
|
var t2 = {};
|
|
48971
49019
|
for (var p2 in s2)
|
|
48972
49020
|
if (Object.prototype.hasOwnProperty.call(s2, p2) && e3.indexOf(p2) < 0)
|
|
@@ -49112,7 +49160,7 @@
|
|
|
49112
49160
|
`;
|
|
49113
49161
|
function MultiSelect(_a3) {
|
|
49114
49162
|
var _b, _c;
|
|
49115
|
-
var { maxWidth = "100%", maxRows = 3 } = _a3, props = __rest$
|
|
49163
|
+
var { maxWidth = "100%", maxRows = 3 } = _a3, props = __rest$a(_a3, ["maxWidth", "maxRows"]);
|
|
49116
49164
|
const [inputValue, setInputValue] = React.useState("");
|
|
49117
49165
|
const { getSelectedItemProps, getDropdownProps, addSelectedItem, removeSelectedItem, selectedItems } = useMultipleSelection(Object.assign({ initialSelectedItems: (_b = props.initialValue) !== null && _b !== void 0 ? _b : [], onSelectedItemsChange: (changes) => {
|
|
49118
49166
|
if (props.onSelect) {
|
|
@@ -49431,6 +49479,18 @@
|
|
|
49431
49479
|
const stepDown = () => step2(amountToStep * -1);
|
|
49432
49480
|
return jsxRuntime.exports.jsxs(StepperWrapper, { disabled: disabled2, children: [jsxRuntime.exports.jsx(StepperButton, { disabled: disabled2, onClick: stepUp, styling: "ghost", tabIndex: -1, children: jsxRuntime.exports.jsx(ChevronUp, {}) }), jsxRuntime.exports.jsx(StepperButton, { disabled: disabled2, onClick: stepDown, styling: "ghost", tabIndex: -1, children: jsxRuntime.exports.jsx(ChevronDown, {}) })] });
|
|
49433
49481
|
};
|
|
49482
|
+
var __rest$9 = globalThis && globalThis.__rest || function(s2, e3) {
|
|
49483
|
+
var t2 = {};
|
|
49484
|
+
for (var p2 in s2)
|
|
49485
|
+
if (Object.prototype.hasOwnProperty.call(s2, p2) && e3.indexOf(p2) < 0)
|
|
49486
|
+
t2[p2] = s2[p2];
|
|
49487
|
+
if (s2 != null && typeof Object.getOwnPropertySymbols === "function")
|
|
49488
|
+
for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) {
|
|
49489
|
+
if (e3.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2]))
|
|
49490
|
+
t2[p2[i2]] = s2[p2[i2]];
|
|
49491
|
+
}
|
|
49492
|
+
return t2;
|
|
49493
|
+
};
|
|
49434
49494
|
const InputWrapper$2 = styled__default.default.div`
|
|
49435
49495
|
display: flex;
|
|
49436
49496
|
flex-direction: row;
|
|
@@ -49522,27 +49582,27 @@
|
|
|
49522
49582
|
}
|
|
49523
49583
|
return "";
|
|
49524
49584
|
};
|
|
49525
|
-
const NumericInput = React__namespace.forwardRef((
|
|
49585
|
+
const NumericInput = React__namespace.forwardRef((_a3, ref) => {
|
|
49586
|
+
var { value, onChange: onChange2, initialValue } = _a3, props = __rest$9(_a3, ["value", "onChange", "initialValue"]);
|
|
49526
49587
|
const keydownFilter = React.useMemo(() => numericFilter(props.integerOnly), [props.integerOnly]);
|
|
49527
|
-
const [input, setInput] = React.useState(getInitialValue(
|
|
49528
|
-
const step2 = (
|
|
49529
|
-
var _a3;
|
|
49588
|
+
const [input, setInput] = React.useState(getInitialValue(value, initialValue));
|
|
49589
|
+
const step2 = (v3) => {
|
|
49530
49590
|
if (!input || input === "-") {
|
|
49531
49591
|
return;
|
|
49532
49592
|
}
|
|
49533
49593
|
const isFloat = input.includes(".");
|
|
49534
49594
|
const parsedValue = isFloat ? parseFloat(input) : parseInt(input);
|
|
49535
|
-
let nextValueNumber = parsedValue +
|
|
49595
|
+
let nextValueNumber = parsedValue + v3;
|
|
49536
49596
|
let nextValueStr = String(nextValueNumber);
|
|
49537
49597
|
if (isFloat) {
|
|
49538
49598
|
const decimals = input.split(".")[1];
|
|
49539
49599
|
if (decimals) {
|
|
49540
|
-
nextValueStr = (parsedValue +
|
|
49600
|
+
nextValueStr = (parsedValue + v3 / Math.pow(10, decimals.length)).toFixed(decimals.length);
|
|
49541
49601
|
nextValueNumber = parseFloat(nextValueStr);
|
|
49542
49602
|
}
|
|
49543
49603
|
}
|
|
49544
|
-
if (
|
|
49545
|
-
|
|
49604
|
+
if (value !== void 0) {
|
|
49605
|
+
onChange2 === null || onChange2 === void 0 ? void 0 : onChange2(nextValueNumber, {
|
|
49546
49606
|
target: {
|
|
49547
49607
|
value: nextValueStr
|
|
49548
49608
|
}
|
|
@@ -49552,8 +49612,8 @@
|
|
|
49552
49612
|
}
|
|
49553
49613
|
};
|
|
49554
49614
|
const onKeyDown = (e3) => {
|
|
49555
|
-
var
|
|
49556
|
-
(
|
|
49615
|
+
var _a4, _b;
|
|
49616
|
+
(_a4 = props.onKeyDown) === null || _a4 === void 0 ? void 0 : _a4.call(props, e3);
|
|
49557
49617
|
if (!props.stepper) {
|
|
49558
49618
|
return;
|
|
49559
49619
|
}
|
|
@@ -49565,35 +49625,34 @@
|
|
|
49565
49625
|
step2(stepSkip * -1);
|
|
49566
49626
|
}
|
|
49567
49627
|
};
|
|
49568
|
-
const
|
|
49569
|
-
(
|
|
49570
|
-
|
|
49571
|
-
|
|
49572
|
-
|
|
49573
|
-
|
|
49574
|
-
(_a3 = props.onChange) === null || _a3 === void 0 ? void 0 : _a3.call(props, parsed, e3);
|
|
49628
|
+
const handleOnChange = React.useCallback(
|
|
49629
|
+
(v3, e3) => {
|
|
49630
|
+
const parsed = props.integerOnly ? parseInt(v3) : parseFloat(v3);
|
|
49631
|
+
if (value === void 0) {
|
|
49632
|
+
setInput(v3);
|
|
49633
|
+
onChange2 === null || onChange2 === void 0 ? void 0 : onChange2(parsed, e3);
|
|
49575
49634
|
return;
|
|
49576
49635
|
}
|
|
49577
|
-
if (
|
|
49578
|
-
setInput(
|
|
49636
|
+
if (v3.endsWith(".")) {
|
|
49637
|
+
setInput(v3);
|
|
49579
49638
|
return;
|
|
49580
49639
|
}
|
|
49581
|
-
if (
|
|
49582
|
-
setInput(
|
|
49640
|
+
if (v3.includes(".") && v3.endsWith("0")) {
|
|
49641
|
+
setInput(v3);
|
|
49583
49642
|
return;
|
|
49584
49643
|
}
|
|
49585
|
-
if (
|
|
49586
|
-
setInput(
|
|
49644
|
+
if (v3 === "-") {
|
|
49645
|
+
setInput(v3);
|
|
49587
49646
|
return;
|
|
49588
49647
|
}
|
|
49589
|
-
|
|
49648
|
+
onChange2 === null || onChange2 === void 0 ? void 0 : onChange2(parsed, e3);
|
|
49590
49649
|
},
|
|
49591
|
-
[props.integerOnly,
|
|
49650
|
+
[props.integerOnly, value, onChange2]
|
|
49592
49651
|
);
|
|
49593
49652
|
React.useEffect(() => {
|
|
49594
|
-
setInput(getInitialValue(
|
|
49595
|
-
}, [
|
|
49596
|
-
return jsxRuntime.exports.jsxs("div", { children: [jsxRuntime.exports.jsxs(InputWrapper$2, { disabled: props.disabled, errorMsg: props.errorMsg, stepper: props.stepper, style: props.style, children: [jsxRuntime.exports.jsx(Input$3, {
|
|
49653
|
+
setInput(getInitialValue(value, initialValue));
|
|
49654
|
+
}, [value]);
|
|
49655
|
+
return jsxRuntime.exports.jsxs("div", { children: [jsxRuntime.exports.jsxs(InputWrapper$2, { disabled: props.disabled, errorMsg: props.errorMsg, stepper: props.stepper, style: props.style, children: [jsxRuntime.exports.jsx(Input$3, Object.assign({}, props, { keydownFilter, onChange: handleOnChange, onKeyDown, ref, value: input })), props.stepper && jsxRuntime.exports.jsx(InputStepper, { disabled: props.disabled, step: step2, stepSkip: props.stepSkip })] }), props.errorMsg && jsxRuntime.exports.jsx(ErrorMessage$1, { children: props.errorMsg })] });
|
|
49597
49656
|
});
|
|
49598
49657
|
Input$3.displayName = "NumericInput";
|
|
49599
49658
|
var isArray$4 = isArray_1$1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@darajs/components",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.7",
|
|
4
4
|
"description": "Components for the Dara framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"prettier": "@darajs/prettier-config",
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@babel/core": "^7.23.5",
|
|
32
|
-
"@darajs/eslint-config": "1.12.
|
|
33
|
-
"@darajs/prettier-config": "1.12.
|
|
34
|
-
"@darajs/stylelint-config": "1.12.
|
|
32
|
+
"@darajs/eslint-config": "1.12.7",
|
|
33
|
+
"@darajs/prettier-config": "1.12.7",
|
|
34
|
+
"@darajs/stylelint-config": "1.12.7",
|
|
35
35
|
"@testing-library/react-hooks": "^3.4.2",
|
|
36
36
|
"@types/lodash": "^4.14.155",
|
|
37
37
|
"@types/react": "18.2.60",
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@bokeh/bokehjs": "~3.1.1",
|
|
57
|
-
"@darajs/core": "1.12.
|
|
58
|
-
"@darajs/styled-components": "1.12.
|
|
59
|
-
"@darajs/ui-causal-graph-editor": "1.12.
|
|
60
|
-
"@darajs/ui-code-editor": "1.12.
|
|
61
|
-
"@darajs/ui-components": "1.12.
|
|
62
|
-
"@darajs/ui-hierarchy-viewer": "1.12.
|
|
63
|
-
"@darajs/ui-icons": "1.12.
|
|
64
|
-
"@darajs/ui-utils": "1.12.
|
|
57
|
+
"@darajs/core": "1.12.7",
|
|
58
|
+
"@darajs/styled-components": "1.12.7",
|
|
59
|
+
"@darajs/ui-causal-graph-editor": "1.12.7",
|
|
60
|
+
"@darajs/ui-code-editor": "1.12.7",
|
|
61
|
+
"@darajs/ui-components": "1.12.7",
|
|
62
|
+
"@darajs/ui-hierarchy-viewer": "1.12.7",
|
|
63
|
+
"@darajs/ui-icons": "1.12.7",
|
|
64
|
+
"@darajs/ui-utils": "1.12.7",
|
|
65
65
|
"@popperjs/core": "2.4.0",
|
|
66
66
|
"date-fns": "2.9.0",
|
|
67
67
|
"immer": "^10.0.0",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"publishConfig": {
|
|
85
85
|
"access": "public"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "9c917889b0322e705c2980eee892bd742a99d24f"
|
|
88
88
|
}
|
|
Binary file
|