xmlui 0.7.15 → 0.7.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{apiInterceptorWorker-yKpXImCG.mjs → apiInterceptorWorker-21XItUaB.mjs} +1 -1
- package/dist/{grammar.tmLanguage-D3zpG8BQ.mjs → grammar.tmLanguage-Qpdanc5_.mjs} +6 -6
- package/dist/{index-XNGGyvQ0.mjs → index-CFCUmuUo.mjs} +4386 -4343
- package/dist/scripts/package.json +1 -1
- package/dist/scripts/src/components/Backdrop/BackdropNative.js +2 -2
- package/dist/scripts/src/components/Card/CardNative.js +1 -1
- package/dist/scripts/src/components/Footer/FooterNative.js +2 -2
- package/dist/scripts/src/components/Form/Form.js +1 -1
- package/dist/scripts/src/components/Form/FormNative.js +3 -3
- package/dist/scripts/src/components/Heading/Heading.js +1 -1
- package/dist/scripts/src/components/Heading/HeadingNative.js +13 -11
- package/dist/scripts/src/components/Icon/Icon.js +1 -1
- package/dist/scripts/src/components/Icon/IconNative.js +2 -2
- package/dist/scripts/src/components/Input/InputAdornment.js +1 -1
- package/dist/scripts/src/components/Link/LinkNative.js +5 -5
- package/dist/scripts/src/components/Logo/LogoNative.js +4 -4
- package/dist/scripts/src/components/Markdown/Markdown.js +1 -1
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +16 -16
- package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +1 -1
- package/dist/scripts/src/components/NoResult/NoResultNative.js +4 -4
- package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +3 -4
- package/dist/scripts/src/components/ProgressBar/ProgressBarNative.js +2 -2
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +3 -4
- package/dist/scripts/src/components/Range/RangeNative.js +4 -4
- package/dist/scripts/src/components/Select/Select.js +1 -1
- package/dist/scripts/src/components/Select/SelectNative.js +6 -7
- package/dist/scripts/src/components/Slider/Slider.js +1 -1
- package/dist/scripts/src/components/Slider/SliderNative.js +4 -4
- package/dist/scripts/src/components/Spinner/SpinnerNative.js +7 -6
- package/dist/scripts/src/components/Splitter/Splitter.js +1 -1
- package/dist/scripts/src/components/Splitter/SplitterNative.js +2 -2
- package/dist/scripts/src/components/Stack/Stack.js +1 -1
- package/dist/scripts/src/components/Stack/StackNative.js +2 -2
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +1 -1
- package/dist/scripts/src/components/TableOfContents/TableOfContentsNative.js +5 -4
- package/dist/scripts/src/components/TextBox/TextBoxNative.js +1 -1
- package/dist/scripts/src/components/ThemeChanger/ThemeChanger.js +1 -1
- package/dist/scripts/src/components/Toggle/Toggle.js +4 -5
- package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +1 -1
- package/dist/scripts/src/syntax/grammar.tmLanguage.json +31 -11
- package/dist/xmlui-metadata.mjs +1370 -1365
- package/dist/xmlui-metadata.umd.js +16 -16
- package/dist/xmlui-standalone.umd.js +69 -69
- package/dist/xmlui.d.ts +3 -3
- package/dist/xmlui.mjs +1 -1
- package/package.json +1 -1
|
@@ -9,6 +9,6 @@ const react_1 = require("react");
|
|
|
9
9
|
const Backdrop_module_scss_1 = __importDefault(require("./Backdrop.module.scss"));
|
|
10
10
|
exports.Backdrop = (0, react_1.forwardRef)(function Backdrop({ style, children, overlayTemplate, backgroundColor = "black", opacity = "0.1" }, forwardedRef) {
|
|
11
11
|
var _a;
|
|
12
|
-
const styleWithoutDims = { width: undefined };
|
|
13
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: Backdrop_module_scss_1.default.backdropContainer, style:
|
|
12
|
+
const styleWithoutDims = Object.assign(Object.assign({}, style), { width: undefined });
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: Backdrop_module_scss_1.default.backdropContainer, style: { width: (_a = style.width) !== null && _a !== void 0 ? _a : "fit-content" }, ref: forwardedRef, children: [children, (0, jsx_runtime_1.jsx)("div", { className: Backdrop_module_scss_1.default.backdrop, style: Object.assign(Object.assign({}, styleWithoutDims), { backgroundColor, opacity }) }), overlayTemplate && (0, jsx_runtime_1.jsx)("div", { className: Backdrop_module_scss_1.default.overlay, children: overlayTemplate })] }));
|
|
14
14
|
});
|
|
@@ -22,5 +22,5 @@ exports.Card = (0, react_1.forwardRef)(function Card({ children, orientation = e
|
|
|
22
22
|
[Card_module_scss_1.default.isClickable]: !!onClick,
|
|
23
23
|
[Card_module_scss_1.default.vertical]: orientation === "vertical",
|
|
24
24
|
[Card_module_scss_1.default.horizontal]: orientation === "horizontal",
|
|
25
|
-
}), style: style, onClick: onClick, children: [[title, subtitle, avatarUrl, showAvatar].some(Boolean) && ((0, jsx_runtime_1.jsxs)(StackNative_1.Stack, { orientation: "horizontal", verticalAlignment: "center",
|
|
25
|
+
}), style: style, onClick: onClick, children: [[title, subtitle, avatarUrl, showAvatar].some(Boolean) && ((0, jsx_runtime_1.jsxs)(StackNative_1.Stack, { orientation: "horizontal", verticalAlignment: "center", style: { gap: "1rem" }, children: [showAvatar && (0, jsx_runtime_1.jsx)(AvatarNative_1.Avatar, { url: avatarUrl, name: title }), (0, jsx_runtime_1.jsxs)(StackNative_1.Stack, { orientation: "vertical", children: [linkTo ? (title ? ((0, jsx_runtime_1.jsx)(LinkNative_1.LocalLink, { to: linkTo + "", children: (0, jsx_runtime_1.jsx)(HeadingNative_1.Heading, Object.assign({}, titleProps, { children: title })) })) : null) : title ? ((0, jsx_runtime_1.jsx)(HeadingNative_1.Heading, Object.assign({}, titleProps, { children: title }))) : null, subtitle !== undefined && (0, jsx_runtime_1.jsx)(TextNative_1.Text, { variant: "small", children: subtitle })] })] })), children] }));
|
|
26
26
|
});
|
|
@@ -14,7 +14,7 @@ const AppLayoutContext_1 = require("@components/App/AppLayoutContext");
|
|
|
14
14
|
exports.Footer = (0, react_1.forwardRef)(function Footer({ children, style, className, }, forwardedRef) {
|
|
15
15
|
const { layout } = (0, AppLayoutContext_1.useAppLayoutContext)() || {};
|
|
16
16
|
const canRestrictContentWidth = layout !== "vertical-full-header";
|
|
17
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: Footer_module_scss_1.default.outerWrapper, ref: forwardedRef, children: (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(Footer_module_scss_1.default.wrapper, className, {
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: Footer_module_scss_1.default.outerWrapper, ref: forwardedRef, style: style, children: (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(Footer_module_scss_1.default.wrapper, className, {
|
|
18
18
|
[Footer_module_scss_1.default.full]: !canRestrictContentWidth,
|
|
19
|
-
}),
|
|
19
|
+
}), children: children }) }));
|
|
20
20
|
});
|
|
@@ -85,5 +85,5 @@ exports.FormMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
85
85
|
},
|
|
86
86
|
});
|
|
87
87
|
exports.formComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.FormMd, ({ node, renderChild, extractValue, layoutCss, lookupEventHandler, registerComponentApi }) => {
|
|
88
|
-
return ((0, jsx_runtime_1.jsx)(FormNative_1.FormWithContextVar, { node: node, renderChild: renderChild, extractValue: extractValue, lookupEventHandler: lookupEventHandler,
|
|
88
|
+
return ((0, jsx_runtime_1.jsx)(FormNative_1.FormWithContextVar, { node: node, renderChild: renderChild, extractValue: extractValue, lookupEventHandler: lookupEventHandler, style: layoutCss, registerComponentApi: registerComponentApi }));
|
|
89
89
|
});
|
|
@@ -290,10 +290,10 @@ const Form = (0, react_2.forwardRef)(function ({ formState, dispatch, initialVal
|
|
|
290
290
|
reset: doReset,
|
|
291
291
|
});
|
|
292
292
|
}, [doReset, registerComponentApi]);
|
|
293
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("form", { style: style, className: Form_module_scss_1.default.wrapper, onSubmit: doSubmit, onReset: doReset, id: id, ref: formRef, children: [(0, jsx_runtime_1.jsx)(ValidationSummary_1.ValidationSummary, { generalValidationResults: formState.generalValidationResults }), (0, jsx_runtime_1.jsx)(FormContext_1.FormContext.Provider, { value: formContextValue, children: children }), buttonRow || ((0, jsx_runtime_1.jsxs)("div", { className: Form_module_scss_1.default.buttonRow, children: [swapCancelAndSave && [submitButton, cancelButton], !swapCancelAndSave && [cancelButton, submitButton]] }))] }), confirmSubmitModalVisible && ((0, jsx_runtime_1.jsx)(ModalDialogNative_1.ModalDialog, { onClose: () => setConfirmSubmitModalVisible(false), isInitiallyOpen: true, title: "Are you sure want to move forward?", children: (0, jsx_runtime_1.jsxs)(StackNative_1.Stack, { orientation: "vertical",
|
|
293
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("form", { style: style, className: Form_module_scss_1.default.wrapper, onSubmit: doSubmit, onReset: doReset, id: id, ref: formRef, children: [(0, jsx_runtime_1.jsx)(ValidationSummary_1.ValidationSummary, { generalValidationResults: formState.generalValidationResults }), (0, jsx_runtime_1.jsx)(FormContext_1.FormContext.Provider, { value: formContextValue, children: children }), buttonRow || ((0, jsx_runtime_1.jsxs)("div", { className: Form_module_scss_1.default.buttonRow, children: [swapCancelAndSave && [submitButton, cancelButton], !swapCancelAndSave && [cancelButton, submitButton]] }))] }), confirmSubmitModalVisible && ((0, jsx_runtime_1.jsx)(ModalDialogNative_1.ModalDialog, { onClose: () => setConfirmSubmitModalVisible(false), isInitiallyOpen: true, title: "Are you sure want to move forward?", children: (0, jsx_runtime_1.jsxs)(StackNative_1.Stack, { orientation: "vertical", style: { gap: "0.5rem" }, children: [(0, jsx_runtime_1.jsx)(TextNative_1.Text, { children: "The following warnings were found during validation. Please make sure you are willing to move forward despite these issues." }), (0, jsx_runtime_1.jsx)(ValidationSummary_1.ValidationSummary, { generalValidationResults: formState.generalValidationResults, fieldValidationResults: formState.validationResults }), (0, jsx_runtime_1.jsxs)(StackNative_1.Stack, { orientation: "horizontal", horizontalAlignment: "end", style: { gap: "1em" }, children: [(0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { variant: "ghost", themeColor: "secondary", onClick: () => setConfirmSubmitModalVisible(false), children: "No" }), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: () => doSubmit(), autoFocus: true, children: "Yes, proceed" })] })] }) }))] }));
|
|
294
294
|
});
|
|
295
295
|
Form.displayName = "Form";
|
|
296
|
-
function FormWithContextVar({ node, renderChild, extractValue,
|
|
296
|
+
function FormWithContextVar({ node, renderChild, extractValue, style, lookupEventHandler, registerComponentApi, }) {
|
|
297
297
|
const [formState, dispatch] = (0, react_2.useReducer)(formReducer, initialState);
|
|
298
298
|
const nodeWithItem = (0, react_2.useMemo)(() => {
|
|
299
299
|
return {
|
|
@@ -308,7 +308,7 @@ function FormWithContextVar({ node, renderChild, extractValue, layoutCss, lookup
|
|
|
308
308
|
const submitMethod = extractValue.asOptionalString(node.props.submitMethod) || (initialValue ? "put" : "post");
|
|
309
309
|
const submitUrl = extractValue.asOptionalString(node.props.submitUrl) ||
|
|
310
310
|
extractValue.asOptionalString(node.props._data_url);
|
|
311
|
-
return ((0, jsx_runtime_1.jsx)(Form, { keepModalOpenOnSubmit: extractValue.asOptionalBoolean(node.props.keepModalOpenOnSubmit), itemLabelPosition: extractValue.asOptionalString(node.props.itemLabelPosition), itemLabelBreak: extractValue.asOptionalBoolean(node.props.itemLabelBreak), itemLabelWidth: extractValue.asOptionalString(node.props.itemLabelWidth), formState: formState, dispatch: dispatch, id: node.uid, style:
|
|
311
|
+
return ((0, jsx_runtime_1.jsx)(Form, { keepModalOpenOnSubmit: extractValue.asOptionalBoolean(node.props.keepModalOpenOnSubmit), itemLabelPosition: extractValue.asOptionalString(node.props.itemLabelPosition), itemLabelBreak: extractValue.asOptionalBoolean(node.props.itemLabelBreak), itemLabelWidth: extractValue.asOptionalString(node.props.itemLabelWidth), formState: formState, dispatch: dispatch, id: node.uid, style: style, cancelLabel: extractValue(node.props.cancelLabel), saveLabel: extractValue(node.props.saveLabel), saveInProgressLabel: extractValue(node.props.saveInProgressLabel), swapCancelAndSave: extractValue.asOptionalBoolean(node.props.swapCancelAndSave, false), onSubmit: lookupEventHandler("submit", {
|
|
312
312
|
defaultHandler: submitUrl
|
|
313
313
|
? `(eventArgs)=> Actions.callApi({ url: "${submitUrl}", method: "${submitMethod}", body: eventArgs })`
|
|
314
314
|
: undefined,
|
|
@@ -184,7 +184,7 @@ exports.H6Md = (0, ComponentDefs_1.createMetadata)({
|
|
|
184
184
|
});
|
|
185
185
|
function renderHeading({ node, extractValue, layoutCss, level, renderChild }) {
|
|
186
186
|
var _a;
|
|
187
|
-
return ((0, jsx_runtime_1.jsx)(HeadingNative_1.Heading, { uid: node.uid, level: ((_a = extractValue.asOptionalString(level)) !== null && _a !== void 0 ? _a : "h1"), maxLines: extractValue.asOptionalNumber(node.props.maxLines), preserveLinebreaks: extractValue.asOptionalBoolean(node.props.preserveLinebreaks, false), ellipses: extractValue.asOptionalBoolean(node.props.ellipses, true),
|
|
187
|
+
return ((0, jsx_runtime_1.jsx)(HeadingNative_1.Heading, { uid: node.uid, level: ((_a = extractValue.asOptionalString(level)) !== null && _a !== void 0 ? _a : "h1"), maxLines: extractValue.asOptionalNumber(node.props.maxLines), preserveLinebreaks: extractValue.asOptionalBoolean(node.props.preserveLinebreaks, false), ellipses: extractValue.asOptionalBoolean(node.props.ellipses, true), style: layoutCss, children: extractValue.asDisplayText(node.props.value) || renderChild(node.children) }));
|
|
188
188
|
}
|
|
189
189
|
exports.headingComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.HeadingMd, ({ node, extractValue, layoutCss, layoutNonCss, renderChild }) => {
|
|
190
190
|
return renderHeading({
|
|
@@ -6,27 +6,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Heading = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = require("react");
|
|
9
|
+
const react_2 = require("react");
|
|
9
10
|
const Heading_module_scss_1 = __importDefault(require("./Heading.module.scss"));
|
|
10
11
|
const classnames_1 = __importDefault(require("@components-core/utils/classnames"));
|
|
11
12
|
const css_utils_1 = require("@components-core/utils/css-utils");
|
|
12
13
|
const TableOfContentsContext_1 = require("@components-core/TableOfContentsContext");
|
|
14
|
+
const react_compose_refs_1 = require("@radix-ui/react-compose-refs");
|
|
13
15
|
const HeadingLevelKeys = ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
14
|
-
|
|
16
|
+
exports.Heading = (0, react_1.forwardRef)(function Heading({ uid, level = "h1", children, sx, style, title, maxLines = 0, preserveLinebreaks, ellipses = true, className, }, forwardedRef) {
|
|
15
17
|
const Element = level === null || level === void 0 ? void 0 : level.toLowerCase();
|
|
16
|
-
const elementRef = (0,
|
|
17
|
-
const [anchorId, setAnchorId] = (0,
|
|
18
|
-
const anchorRef = (0,
|
|
19
|
-
const tableOfContentsContext = (0,
|
|
18
|
+
const elementRef = (0, react_2.useRef)(null);
|
|
19
|
+
const [anchorId, setAnchorId] = (0, react_2.useState)(null);
|
|
20
|
+
const anchorRef = (0, react_2.useRef)(null);
|
|
21
|
+
const tableOfContentsContext = (0, react_2.useContext)(TableOfContentsContext_1.TableOfContentsContext);
|
|
20
22
|
const registerHeading = tableOfContentsContext === null || tableOfContentsContext === void 0 ? void 0 : tableOfContentsContext.registerHeading;
|
|
21
23
|
const observeIntersection = tableOfContentsContext === null || tableOfContentsContext === void 0 ? void 0 : tableOfContentsContext.observeIntersection;
|
|
22
|
-
(0,
|
|
24
|
+
const ref = forwardedRef ? (0, react_compose_refs_1.composeRefs)(elementRef, forwardedRef) : elementRef;
|
|
25
|
+
(0, react_2.useEffect)(() => {
|
|
23
26
|
var _a, _b, _c, _d;
|
|
24
27
|
if (observeIntersection && elementRef.current) {
|
|
25
28
|
const newAnchorId = (_d = (_c = (_b = (_a = elementRef.current.textContent) === null || _a === void 0 ? void 0 : _a.trim()) === null || _b === void 0 ? void 0 : _b.replace(/[^\w\s-]/g, "")) === null || _c === void 0 ? void 0 : _c.replace(/\s+/g, "-")) === null || _d === void 0 ? void 0 : _d.toLowerCase();
|
|
26
29
|
setAnchorId(newAnchorId || null);
|
|
27
30
|
}
|
|
28
31
|
}, [observeIntersection]);
|
|
29
|
-
(0,
|
|
32
|
+
(0, react_2.useEffect)(() => {
|
|
30
33
|
if (observeIntersection && elementRef.current && anchorId) {
|
|
31
34
|
return registerHeading === null || registerHeading === void 0 ? void 0 : registerHeading({
|
|
32
35
|
id: anchorId,
|
|
@@ -36,10 +39,9 @@ const Heading = ({ uid, level = "h1", children, sx, layout, title, maxLines = 0,
|
|
|
36
39
|
});
|
|
37
40
|
}
|
|
38
41
|
}, [anchorId, observeIntersection, registerHeading, level]);
|
|
39
|
-
return ((0, jsx_runtime_1.jsxs)(Element, { ref:
|
|
42
|
+
return ((0, jsx_runtime_1.jsxs)(Element, { ref: ref, id: uid, title: title, style: Object.assign(Object.assign(Object.assign({}, sx), style), (0, css_utils_1.getMaxLinesStyle)(maxLines)), className: (0, classnames_1.default)(Heading_module_scss_1.default.heading, Heading_module_scss_1.default[Element], className || "", {
|
|
40
43
|
[Heading_module_scss_1.default.truncateOverflow]: maxLines > 0,
|
|
41
44
|
[Heading_module_scss_1.default.preserveLinebreaks]: preserveLinebreaks,
|
|
42
45
|
[Heading_module_scss_1.default.noEllipsis]: !ellipses,
|
|
43
|
-
}), children: [anchorId && observeIntersection && (0, jsx_runtime_1.jsx)("span", { ref: anchorRef, id: anchorId, style: { width: 0, height: 0 } }), children] }));
|
|
44
|
-
};
|
|
45
|
-
exports.Heading = Heading;
|
|
46
|
+
}), children: [anchorId && observeIntersection && ((0, jsx_runtime_1.jsx)("span", { ref: anchorRef, id: anchorId, style: { width: 0, height: 0 } })), children] }));
|
|
47
|
+
});
|
|
@@ -28,5 +28,5 @@ exports.IconMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
28
28
|
},
|
|
29
29
|
});
|
|
30
30
|
exports.iconComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.IconMd, ({ node, extractValue, layoutCss }) => {
|
|
31
|
-
return ((0, jsx_runtime_1.jsx)(IconNative_1.default, { name: extractValue.asOptionalString(node.props.name), size: extractValue(node.props.size),
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(IconNative_1.default, { name: extractValue.asOptionalString(node.props.name), size: extractValue(node.props.size), style: layoutCss, fallback: extractValue.asOptionalString(node.props.fallback) }));
|
|
32
32
|
});
|
|
@@ -25,14 +25,14 @@ const StyleParser_1 = require("../../parsers/style-parser/StyleParser");
|
|
|
25
25
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
26
26
|
exports.Icon = (0, react_1.forwardRef)(function Icon(_a, ref) {
|
|
27
27
|
var _b;
|
|
28
|
-
var { name, fallback,
|
|
28
|
+
var { name, fallback, style, className } = _a, restProps = __rest(_a, ["name", "fallback", "style", "className"]);
|
|
29
29
|
const iconRenderer = useFindIconRenderer(name, fallback);
|
|
30
30
|
const computedSize = typeof (restProps === null || restProps === void 0 ? void 0 : restProps.size) === "string" ? mapSizeToIconPack(restProps.size) : restProps === null || restProps === void 0 ? void 0 : restProps.size;
|
|
31
31
|
const width = computedSize || restProps.width;
|
|
32
32
|
const height = computedSize || restProps.height;
|
|
33
33
|
const computedProps = Object.assign(Object.assign({
|
|
34
34
|
// className is needed to apply a default color to the icon, thus other component classes can override this one
|
|
35
|
-
className: (0, classnames_1.default)(Icon_module_scss_1.default.base, className) }, restProps), { size: computedSize, width: width, height: height, style: Object.assign(Object.assign({},
|
|
35
|
+
className: (0, classnames_1.default)(Icon_module_scss_1.default.base, className) }, restProps), { size: computedSize, width: width, height: height, style: Object.assign(Object.assign({}, style), { "--icon-width": width, "--icon-height": height }) });
|
|
36
36
|
// ---
|
|
37
37
|
const customIconUrl = useCustomIconUrl(name);
|
|
38
38
|
if (customIconUrl) {
|
|
@@ -10,5 +10,5 @@ const TextNative_1 = require("../Text/TextNative");
|
|
|
10
10
|
const InputAdornment_module_scss_1 = __importDefault(require("./InputAdornment.module.scss"));
|
|
11
11
|
const classnames_1 = __importDefault(require("@components-core/utils/classnames"));
|
|
12
12
|
function Adornment({ iconName, text, className }) {
|
|
13
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: iconName || text ? ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(InputAdornment_module_scss_1.default.wrapper, className), children: [(0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: iconName,
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: iconName || text ? ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(InputAdornment_module_scss_1.default.wrapper, className), children: [(0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: iconName, style: { color: "inherit" } }), text && ((0, jsx_runtime_1.jsx)("div", { style: { display: "flex", userSelect: "none" }, children: (0, jsx_runtime_1.jsx)(TextNative_1.Text, { style: { fontSize: "inherit" }, children: text }) }))] })) : null }));
|
|
14
14
|
}
|
|
@@ -7,20 +7,20 @@ exports.LocalLink = void 0;
|
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = require("@remix-run/react");
|
|
9
9
|
const react_2 = require("react");
|
|
10
|
+
const react_3 = require("react");
|
|
10
11
|
const Link_module_scss_1 = __importDefault(require("./Link.module.scss"));
|
|
11
12
|
const classnames_1 = __importDefault(require("@components-core/utils/classnames"));
|
|
12
13
|
const IconNative_1 = require("@components/Icon/IconNative");
|
|
13
14
|
const component_utils_1 = require("@components/component-utils");
|
|
14
|
-
|
|
15
|
+
exports.LocalLink = (0, react_2.forwardRef)(function LocalLink({ to, children, icon, active, onClick, target, disabled, style }, forwardedRef) {
|
|
15
16
|
const iconLink = !!icon && !children;
|
|
16
|
-
const smartTo = (0,
|
|
17
|
+
const smartTo = (0, react_3.useMemo)(() => {
|
|
17
18
|
return (0, component_utils_1.createUrlWithQueryParams)(to);
|
|
18
19
|
}, [to]);
|
|
19
20
|
const Node = !to ? "div" : react_1.Link;
|
|
20
|
-
return ((0, jsx_runtime_1.jsxs)(Node, { to: smartTo, style: style, target: target, onClick: onClick, className: (0, classnames_1.default)(Link_module_scss_1.default.container, {
|
|
21
|
+
return ((0, jsx_runtime_1.jsxs)(Node, { ref: forwardedRef, to: smartTo, style: style, target: target, onClick: onClick, className: (0, classnames_1.default)(Link_module_scss_1.default.container, {
|
|
21
22
|
[Link_module_scss_1.default.iconLink]: iconLink,
|
|
22
23
|
[Link_module_scss_1.default.active]: active,
|
|
23
24
|
[Link_module_scss_1.default.disabled]: disabled,
|
|
24
25
|
}), children: [icon && ((0, jsx_runtime_1.jsx)("div", { className: Link_module_scss_1.default.iconWrapper, children: (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: icon }) })), children] }));
|
|
25
|
-
};
|
|
26
|
-
exports.LocalLink = LocalLink;
|
|
26
|
+
});
|
|
@@ -4,12 +4,12 @@ exports.Logo = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const ImageNative_1 = require("@components/Image/ImageNative");
|
|
6
6
|
const AppHeaderNative_1 = require("@components/AppHeader/AppHeaderNative");
|
|
7
|
-
const
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
exports.Logo = (0, react_1.forwardRef)(function Logo({ style, }, forwardedRef) {
|
|
8
9
|
const logoUrl = (0, AppHeaderNative_1.useLogoUrl)();
|
|
9
10
|
if (!logoUrl) {
|
|
10
11
|
return null;
|
|
11
12
|
}
|
|
12
13
|
//width auto for safari
|
|
13
|
-
return ((0, jsx_runtime_1.jsx)(ImageNative_1.Image, { src: logoUrl, alt: "Logo", style: Object.assign({ width: "auto", boxShadow: "none" }, style) }));
|
|
14
|
-
};
|
|
15
|
-
exports.Logo = Logo;
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(ImageNative_1.Image, { ref: forwardedRef, src: logoUrl, alt: "Logo", style: Object.assign({ width: "auto", boxShadow: "none" }, style) }));
|
|
15
|
+
});
|
|
@@ -41,5 +41,5 @@ exports.MarkdownMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
41
41
|
});
|
|
42
42
|
exports.markdownComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.MarkdownMd, ({ node, extractValue, renderChild, layoutCss }) => {
|
|
43
43
|
const content = extractValue.asString(node.props.content);
|
|
44
|
-
return ((0, jsx_runtime_1.jsx)(MarkdownNative_1.Markdown, {
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(MarkdownNative_1.Markdown, { style: layoutCss, removeIndents: extractValue.asOptionalBoolean(node.props.removeIndents, false), children: content || renderChild(node.children) }));
|
|
45
45
|
});
|
|
@@ -12,15 +12,15 @@ const HeadingNative_1 = require("@components/Heading/HeadingNative");
|
|
|
12
12
|
const TextNative_1 = require("../Text/TextNative");
|
|
13
13
|
const LinkNative_1 = require("@components/Link/LinkNative");
|
|
14
14
|
const ImageNative_1 = require("@components/Image/ImageNative");
|
|
15
|
-
exports.Markdown = (0, react_1.memo)(function Markdown({ removeIndents = false, children,
|
|
15
|
+
exports.Markdown = (0, react_1.memo)(function Markdown({ removeIndents = false, children, style }) {
|
|
16
16
|
if (typeof children !== "string") {
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
19
19
|
children = removeIndents ? removeTextIndents(children) : children;
|
|
20
|
-
const textLayoutToUse = { textAlign:
|
|
20
|
+
const textLayoutToUse = { textAlign: style === null || style === void 0 ? void 0 : style.textAlign };
|
|
21
21
|
return ((0, jsx_runtime_1.jsx)(react_markdown_1.default, { components: {
|
|
22
22
|
h1({ id, children }) {
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)(HeadingNative_1.Heading, { uid: id,
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)(HeadingNative_1.Heading, { uid: id, style: textLayoutToUse, level: "h1", sx: { lineHeight: "initial" }, children: children }));
|
|
24
24
|
},
|
|
25
25
|
h2({ id, children }) {
|
|
26
26
|
return ((0, jsx_runtime_1.jsx)(HeadingNative_1.Heading, { uid: id, level: "h2", sx: { lineHeight: "initial" }, children: children }));
|
|
@@ -38,7 +38,7 @@ exports.Markdown = (0, react_1.memo)(function Markdown({ removeIndents = false,
|
|
|
38
38
|
return ((0, jsx_runtime_1.jsx)(HeadingNative_1.Heading, { uid: id, level: "h6", sx: { lineHeight: "initial" }, children: children }));
|
|
39
39
|
},
|
|
40
40
|
p({ id, children }) {
|
|
41
|
-
return (0, jsx_runtime_1.jsx)(TextNative_1.Text, { uid: id,
|
|
41
|
+
return (0, jsx_runtime_1.jsx)(TextNative_1.Text, { uid: id, style: textLayoutToUse, children: children });
|
|
42
42
|
},
|
|
43
43
|
code({ id, children }) {
|
|
44
44
|
return ((0, jsx_runtime_1.jsx)(TextNative_1.Text, { uid: id, variant: "code", children: children }));
|
|
@@ -53,16 +53,16 @@ exports.Markdown = (0, react_1.memo)(function Markdown({ removeIndents = false,
|
|
|
53
53
|
return ((0, jsx_runtime_1.jsx)(TextNative_1.Text, { uid: id, variant: "em", children: children }));
|
|
54
54
|
},
|
|
55
55
|
blockquote({ children }) {
|
|
56
|
-
return (0, jsx_runtime_1.jsx)(Blockquote, {
|
|
56
|
+
return (0, jsx_runtime_1.jsx)(Blockquote, { style: textLayoutToUse, children: children });
|
|
57
57
|
},
|
|
58
58
|
ol({ children }) {
|
|
59
|
-
return (0, jsx_runtime_1.jsx)(OrderedList, {
|
|
59
|
+
return (0, jsx_runtime_1.jsx)(OrderedList, { style: textLayoutToUse, children: children });
|
|
60
60
|
},
|
|
61
61
|
ul({ children }) {
|
|
62
|
-
return (0, jsx_runtime_1.jsx)(UnorderedList, {
|
|
62
|
+
return (0, jsx_runtime_1.jsx)(UnorderedList, { style: textLayoutToUse, children: children });
|
|
63
63
|
},
|
|
64
64
|
li({ children }) {
|
|
65
|
-
return (0, jsx_runtime_1.jsx)(ListItem, {
|
|
65
|
+
return (0, jsx_runtime_1.jsx)(ListItem, { style: textLayoutToUse, children: children });
|
|
66
66
|
},
|
|
67
67
|
// This needs a parser plugin for the ~ and ~~ signs that are available via react-markdown-gfm
|
|
68
68
|
// or we implement our own parser?
|
|
@@ -93,15 +93,15 @@ function removeTextIndents(input) {
|
|
|
93
93
|
const HorizontalRule = () => {
|
|
94
94
|
return (0, jsx_runtime_1.jsx)("hr", { className: Markdown_module_scss_1.default.horizontalRule });
|
|
95
95
|
};
|
|
96
|
-
const Blockquote = ({ children,
|
|
97
|
-
return (0, jsx_runtime_1.jsx)("blockquote", { className: Markdown_module_scss_1.default.blockquote, style:
|
|
96
|
+
const Blockquote = ({ children, style }) => {
|
|
97
|
+
return (0, jsx_runtime_1.jsx)("blockquote", { className: Markdown_module_scss_1.default.blockquote, style: style, children: children });
|
|
98
98
|
};
|
|
99
|
-
const UnorderedList = ({ children,
|
|
100
|
-
return (0, jsx_runtime_1.jsx)("ul", { className: Markdown_module_scss_1.default.unorderedList, style:
|
|
99
|
+
const UnorderedList = ({ children, style }) => {
|
|
100
|
+
return (0, jsx_runtime_1.jsx)("ul", { className: Markdown_module_scss_1.default.unorderedList, style: style, children: children });
|
|
101
101
|
};
|
|
102
|
-
const OrderedList = ({ children,
|
|
103
|
-
return (0, jsx_runtime_1.jsx)("ol", { className: Markdown_module_scss_1.default.orderedList, style:
|
|
102
|
+
const OrderedList = ({ children, style }) => {
|
|
103
|
+
return (0, jsx_runtime_1.jsx)("ol", { className: Markdown_module_scss_1.default.orderedList, style: style, children: children });
|
|
104
104
|
};
|
|
105
|
-
const ListItem = ({ children,
|
|
106
|
-
return (0, jsx_runtime_1.jsx)("li", { className: Markdown_module_scss_1.default.listItem, style:
|
|
105
|
+
const ListItem = ({ children, style }) => {
|
|
106
|
+
return (0, jsx_runtime_1.jsx)("li", { className: Markdown_module_scss_1.default.listItem, style: style, children: children });
|
|
107
107
|
};
|
|
@@ -107,7 +107,7 @@ const ConfirmationModalContextProvider = ({ children }) => {
|
|
|
107
107
|
confirm: handleShow,
|
|
108
108
|
};
|
|
109
109
|
}, [handleShow]);
|
|
110
|
-
return ((0, jsx_runtime_1.jsxs)(ConfirmationModalContext.Provider, { value: contextValue, children: [children, showConfirmationModal && ((0, jsx_runtime_1.jsx)(Dialog_1.Dialog, { title: title, description: message, isOpen: true, onClose: handleCancel, buttons: (0, jsx_runtime_1.jsxs)(StackNative_1.Stack, { orientation: "horizontal", horizontalAlignment: "end",
|
|
110
|
+
return ((0, jsx_runtime_1.jsxs)(ConfirmationModalContext.Provider, { value: contextValue, children: [children, showConfirmationModal && ((0, jsx_runtime_1.jsx)(Dialog_1.Dialog, { title: title, description: message, isOpen: true, onClose: handleCancel, buttons: (0, jsx_runtime_1.jsxs)(StackNative_1.Stack, { orientation: "horizontal", horizontalAlignment: "end", style: { width: "100%", gap: "1em" }, ref: buttonsRef, children: [(0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { variant: "ghost", themeColor: "secondary", size: "sm", onClick: handleCancel, children: "Cancel" }), buttons.length > 1 ? (0, jsx_runtime_1.jsx)("div", { style: { flex: 1 } }) : undefined, buttons.map(({ label, value, variant = "solid", themeColor = "attention" }, index) => {
|
|
111
111
|
return ((0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { variant: variant, themeColor: themeColor, size: "sm", type: "submit", onClick: () => {
|
|
112
112
|
handleOk(value);
|
|
113
113
|
}, children: label }, index));
|
|
@@ -7,7 +7,7 @@ exports.NoResult = void 0;
|
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const IconNative_1 = require("@components/Icon/IconNative");
|
|
9
9
|
const NoResult_module_scss_1 = __importDefault(require("./NoResult.module.scss"));
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
exports.NoResult = (0, react_1.forwardRef)(function NoResult({ label, icon, hideIcon = false, style }, forwardedRef) {
|
|
12
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: NoResult_module_scss_1.default.wrapper, style: style, ref: forwardedRef, children: [!hideIcon && (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: icon !== null && icon !== void 0 ? icon : "noresult", className: NoResult_module_scss_1.default.icon }), label] }));
|
|
13
|
+
});
|
|
@@ -48,7 +48,7 @@ const ButtonNative_1 = require("@components/Button/ButtonNative");
|
|
|
48
48
|
const misc_1 = require("@components-core/utils/misc");
|
|
49
49
|
const ItemWithLabel_1 = require("@components/FormItem/ItemWithLabel");
|
|
50
50
|
const numberbox_abstractions_1 = require("./numberbox-abstractions");
|
|
51
|
-
|
|
51
|
+
exports.NumberBox = (0, react_1.forwardRef)(function NumberBox({ id, value, initialValue, style, enabled = true, placeholder, validationStatus = "none", hasSpinBox = true, step, integersOnly = false, zeroOrPositive = false, min = zeroOrPositive ? 0 : -numberbox_abstractions_1.NUMBERBOX_MAX_VALUE, max = numberbox_abstractions_1.NUMBERBOX_MAX_VALUE, maxLength, updateState = constants_1.noop, onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, registerComponentApi, startText, startIcon, endText, endIcon, autoFocus, readOnly, required, label, labelPosition, labelWidth, labelBreak, }, forwardedRef) {
|
|
52
52
|
var _a;
|
|
53
53
|
// Ensure the provided minimum is not smaller than the 0 if zeroOrPositive is set to true
|
|
54
54
|
min = Math.max(zeroOrPositive ? 0 : -numberbox_abstractions_1.NUMBERBOX_MAX_VALUE, min);
|
|
@@ -278,7 +278,7 @@ const NumberBox = ({ id, value, initialValue, style, enabled = true, placeholder
|
|
|
278
278
|
setValue,
|
|
279
279
|
});
|
|
280
280
|
}, [focus, registerComponentApi, setValue]);
|
|
281
|
-
return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, style: style, children: (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(NumberBox_module_scss_1.default.inputRoot, {
|
|
281
|
+
return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { ref: forwardedRef, labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, style: style, children: (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(NumberBox_module_scss_1.default.inputRoot, {
|
|
282
282
|
[NumberBox_module_scss_1.default.readOnly]: readOnly,
|
|
283
283
|
[NumberBox_module_scss_1.default.disabled]: !enabled,
|
|
284
284
|
[NumberBox_module_scss_1.default.noSpinBox]: !hasSpinBox,
|
|
@@ -289,8 +289,7 @@ const NumberBox = ({ id, value, initialValue, style, enabled = true, placeholder
|
|
|
289
289
|
var _a;
|
|
290
290
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
291
291
|
}, children: [(0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { text: startText, iconName: startIcon, className: NumberBox_module_scss_1.default.adornment }), (0, jsx_runtime_1.jsx)("input", { id: id, type: "text", inputMode: "numeric", className: (0, classnames_1.default)(NumberBox_module_scss_1.default.input, { [NumberBox_module_scss_1.default.readOnly]: readOnly }), disabled: !enabled, value: valueStrRep, step: step, placeholder: placeholder, onChange: onInputChange, onFocus: handleOnFocus, onBlur: handleOnBlur, onBeforeInput: handleOnBeforeInput, onKeyDown: handleOnKey, readOnly: readOnly, ref: inputRef, autoFocus: autoFocus, maxLength: maxLength, required: required, "aria-required": required }), (0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { text: endText, iconName: endIcon, className: NumberBox_module_scss_1.default.adornment }), hasSpinBox && ((0, jsx_runtime_1.jsxs)("div", { className: NumberBox_module_scss_1.default.spinnerBox, children: [(0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { "data-spinner": "up", type: "button", variant: "ghost", themeColor: "secondary", tabIndex: -1, className: NumberBox_module_scss_1.default.spinnerButton, disabled: !enabled || readOnly, ref: upButton, children: (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: "chevronup", size: "sm" }) }), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { "data-spinner": "down", type: "button", tabIndex: -1, variant: "ghost", themeColor: "secondary", className: NumberBox_module_scss_1.default.spinnerButton, disabled: !enabled || readOnly, ref: downButton, children: (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: "chevrondown", size: "sm" }) })] }))] }) }));
|
|
292
|
-
};
|
|
293
|
-
exports.NumberBox = NumberBox;
|
|
292
|
+
});
|
|
294
293
|
function applyStep(valueStrRep, step, min, max, integersOnly) {
|
|
295
294
|
const currentValue = (0, numberbox_abstractions_1.toUsableNumber)(valueStrRep, integersOnly);
|
|
296
295
|
if ((0, numberbox_abstractions_1.isEmptyLike)(currentValue)) {
|
|
@@ -7,6 +7,6 @@ exports.ProgressBar = void 0;
|
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const ProgressBar_module_scss_1 = __importDefault(require("./ProgressBar.module.scss"));
|
|
9
9
|
const react_1 = require("react");
|
|
10
|
-
exports.ProgressBar = (0, react_1.forwardRef)(function ProgressBar({ value = 0, style },
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: ProgressBar_module_scss_1.default.wrapper, style: style, ref:
|
|
10
|
+
exports.ProgressBar = (0, react_1.forwardRef)(function ProgressBar({ value = 0, style }, forwardedRef) {
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: ProgressBar_module_scss_1.default.wrapper, style: style, ref: forwardedRef, children: (0, jsx_runtime_1.jsx)("div", { style: { width: `${value * 100}%` }, className: ProgressBar_module_scss_1.default.bar }) }));
|
|
12
12
|
});
|
|
@@ -64,5 +64,5 @@ exports.RadioGroupMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
64
64
|
},
|
|
65
65
|
});
|
|
66
66
|
exports.radioGroupRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.RadioGroupMd, ({ node, extractValue, layoutCss, state, updateState, lookupEventHandler, renderChild, registerComponentApi, }) => {
|
|
67
|
-
return ((0, jsx_runtime_1.jsx)(RadioGroupNative_1.RadioGroup, { enabled: extractValue.asOptionalBoolean(node.props.enabled),
|
|
67
|
+
return ((0, jsx_runtime_1.jsx)(RadioGroupNative_1.RadioGroup, { enabled: extractValue.asOptionalBoolean(node.props.enabled), style: layoutCss, initialValue: extractValue(node.props.initialValue), value: state === null || state === void 0 ? void 0 : state.value, updateState: updateState, validationStatus: extractValue(node.props.validationStatus), onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), registerComponentApi: registerComponentApi, label: extractValue.asOptionalString(node.props.label), labelPosition: extractValue(node.props.labelPosition), labelWidth: extractValue(node.props.labelWidth), labelBreak: extractValue(node.props.labelBreak), required: extractValue.asOptionalBoolean(node.props.required), children: renderChild(node.children) }));
|
|
68
68
|
});
|
|
@@ -49,7 +49,7 @@ const OptionTypeProvider_1 = __importDefault(require("@components/Option/OptionT
|
|
|
49
49
|
const RadioGroupValidationStatusContext = (0, react_1.createContext)({
|
|
50
50
|
status: "none",
|
|
51
51
|
});
|
|
52
|
-
|
|
52
|
+
exports.RadioGroup = (0, react_1.forwardRef)(function RadioGroup({ id, value = "", initialValue = "", enabled = true, validationStatus = "none", label, labelPosition, labelWidth, labelBreak, required = false, updateState = constants_1.noop, onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, children, registerComponentApi, style, }, forwardedRef) {
|
|
53
53
|
const [focused, setFocused] = react_1.default.useState(false);
|
|
54
54
|
// --- Initialize the related field with the input's initial value
|
|
55
55
|
(0, react_1.useEffect)(() => {
|
|
@@ -84,12 +84,11 @@ const RadioGroup = ({ id, value = "", initialValue = "", enabled = true, validat
|
|
|
84
84
|
const contextValue = (0, react_1.useMemo)(() => {
|
|
85
85
|
return { value, status: validationStatus };
|
|
86
86
|
}, [value, validationStatus]);
|
|
87
|
-
return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, children: (0, jsx_runtime_1.jsx)(OptionTypeProvider_1.default, { Component: exports.RadioGroupOption, children: (0, jsx_runtime_1.jsx)(RadioGroupValidationStatusContext.Provider, { value: contextValue, children: (0, jsx_runtime_1.jsx)(InnerRadioGroup.Root, { id: id, onBlur: handleOnBlur, onFocus: handleOnFocus, onValueChange: onInputChange, value: value, disabled: !enabled, className: (0, classnames_1.default)(RadioGroup_module_scss_1.default.radioGroupContainer, {
|
|
87
|
+
return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { ref: forwardedRef, labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, style: style, children: (0, jsx_runtime_1.jsx)(OptionTypeProvider_1.default, { Component: exports.RadioGroupOption, children: (0, jsx_runtime_1.jsx)(RadioGroupValidationStatusContext.Provider, { value: contextValue, children: (0, jsx_runtime_1.jsx)(InnerRadioGroup.Root, { id: id, onBlur: handleOnBlur, onFocus: handleOnFocus, onValueChange: onInputChange, value: value, disabled: !enabled, className: (0, classnames_1.default)(RadioGroup_module_scss_1.default.radioGroupContainer, {
|
|
88
88
|
[RadioGroup_module_scss_1.default.focused]: focused,
|
|
89
89
|
[RadioGroup_module_scss_1.default.disabled]: !enabled,
|
|
90
90
|
}), children: children }) }) }) }));
|
|
91
|
-
};
|
|
92
|
-
exports.RadioGroup = RadioGroup;
|
|
91
|
+
});
|
|
93
92
|
const RadioGroupOption = ({ value, label, enabled = true }) => {
|
|
94
93
|
const id = (0, react_1.useId)();
|
|
95
94
|
const validationContext = (0, react_1.useContext)(RadioGroupValidationStatusContext);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Range = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
exports.Range = (0, react_1.forwardRef)(function Range({ style }, forwardedRef) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)("div", { ref: forwardedRef, style: Object.assign({ backgroundColor: "orangered", color: "white", padding: 2 }, style), children: "Range component is not implemented yet" }));
|
|
8
|
+
});
|
|
@@ -84,7 +84,7 @@ exports.SelectMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
84
84
|
},
|
|
85
85
|
});
|
|
86
86
|
exports.selectComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.SelectMd, ({ node, state, updateState, extractValue, renderChild, lookupEventHandler, layoutCss, registerComponentApi, }) => {
|
|
87
|
-
return ((0, jsx_runtime_1.jsx)(SelectNative_1.Select, { multiSelect: extractValue.asOptionalBoolean(node.props.multiSelect),
|
|
87
|
+
return ((0, jsx_runtime_1.jsx)(SelectNative_1.Select, { multiSelect: extractValue.asOptionalBoolean(node.props.multiSelect), style: layoutCss, updateState: updateState, searchable: extractValue.asOptionalBoolean(node.props.searchable), initialValue: extractValue(node.props.initialValue), value: state === null || state === void 0 ? void 0 : state.value, autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus), enabled: extractValue.asOptionalBoolean(node.props.enabled), placeholder: extractValue.asOptionalString(node.props.placeholder), validationStatus: extractValue(node.props.validationStatus), onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), registerComponentApi: registerComponentApi, emptyListTemplate: renderChild(node.props.emptyListTemplate), dropdownHeight: extractValue(node.props.dropdownHeight), label: extractValue(node.props.label), labelPosition: extractValue(node.props.labelPosition), labelWidth: extractValue(node.props.labelWidth), labelBreak: extractValue.asOptionalBoolean(node.props.labelBreak), required: extractValue.asOptionalBoolean(node.props.required), optionLabelRenderer: node.props.optionLabelTemplate
|
|
88
88
|
? (item) => {
|
|
89
89
|
return ((0, jsx_runtime_1.jsx)(container_helpers_1.MemoizedItem, { node: node.props.optionLabelTemplate, item: item, renderChild: renderChild }));
|
|
90
90
|
}
|
|
@@ -71,7 +71,7 @@ const SimpleSelect = (0, react_1.forwardRef)(function SimpleSelect(props, forwar
|
|
|
71
71
|
[Select_module_scss_1.default.valid]: validationStatus === "valid",
|
|
72
72
|
}), ref: ref, autoFocus: autoFocus, children: [(0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.selectValue, children: (0, jsx_runtime_1.jsx)(react_select_1.Value, { placeholder: placeholder }) }), (0, jsx_runtime_1.jsx)(react_select_1.Icon, { asChild: true, children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "chevrondown" }) })] }), (0, jsx_runtime_1.jsx)(react_select_1.Portal, { container: root, children: (0, jsx_runtime_1.jsxs)(react_select_1.Content, { className: Select_module_scss_1.default.selectContent, position: "popper", style: { height: height }, children: [(0, jsx_runtime_1.jsx)(react_select_1.ScrollUpButton, { className: Select_module_scss_1.default.selectScrollUpButton, children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "chevronup" }) }), (0, jsx_runtime_1.jsx)(react_select_1.Viewport, { className: (0, classnames_1.default)(Select_module_scss_1.default.selectViewport), children: children }), (0, jsx_runtime_1.jsx)(react_select_1.ScrollDownButton, { className: Select_module_scss_1.default.selectScrollDownButton, children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "chevrondown" }) })] }) })] }) }));
|
|
73
73
|
});
|
|
74
|
-
exports.Select = (0, react_1.forwardRef)(function Select({ id, initialValue, value, enabled = true, placeholder, updateState = constants_1.noop, validationStatus = "none", onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, registerComponentApi, emptyListTemplate, optionLabelRenderer, valueRenderer,
|
|
74
|
+
exports.Select = (0, react_1.forwardRef)(function Select({ id, initialValue, value, enabled = true, placeholder, updateState = constants_1.noop, validationStatus = "none", onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, registerComponentApi, emptyListTemplate, optionLabelRenderer, valueRenderer, style, dropdownHeight, children, autoFocus = false, searchable = false, multiSelect = false, label, labelPosition, labelWidth, labelBreak, required = false, }, ref) {
|
|
75
75
|
var _a;
|
|
76
76
|
const [referenceElement, setReferenceElement] = (0, react_2.useState)(null);
|
|
77
77
|
const [open, setOpen] = (0, react_2.useState)(false);
|
|
@@ -155,7 +155,7 @@ exports.Select = (0, react_1.forwardRef)(function Select({ id, initialValue, val
|
|
|
155
155
|
optionLabelRenderer,
|
|
156
156
|
onChange: toggleOption,
|
|
157
157
|
}), [multiSelect, toggleOption, value, optionLabelRenderer]);
|
|
158
|
-
return ((0, jsx_runtime_1.jsx)(SelectContext_1.SelectContext.Provider, { value: selectContextValue, children: (0, jsx_runtime_1.jsx)(OptionContext_1.OptionContext.Provider, { value: optionContextValue, children: searchable || multiSelect ? ((0, jsx_runtime_1.jsxs)(OptionTypeProvider_1.default, { Component: HiddenOption, children: [children, (0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { ref: ref, labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, style:
|
|
158
|
+
return ((0, jsx_runtime_1.jsx)(SelectContext_1.SelectContext.Provider, { value: selectContextValue, children: (0, jsx_runtime_1.jsx)(OptionContext_1.OptionContext.Provider, { value: optionContextValue, children: searchable || multiSelect ? ((0, jsx_runtime_1.jsxs)(OptionTypeProvider_1.default, { Component: HiddenOption, children: [children, (0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { ref: ref, labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, style: style, children: (0, jsx_runtime_1.jsxs)(react_popover_1.Popover, { open: open, onOpenChange: setOpen, modal: false, children: [(0, jsx_runtime_1.jsx)(react_popover_1.PopoverTrigger, { asChild: true, children: (0, jsx_runtime_1.jsxs)("button", { id: id, ref: setReferenceElement, onFocus: onFocus, onBlur: onBlur, disabled: !enabled, "aria-expanded": open, onClick: () => setOpen((prev) => !prev), className: (0, classnames_1.default)(Select_module_scss_1.default.selectTrigger, Select_module_scss_1.default[validationStatus], {
|
|
159
159
|
[Select_module_scss_1.default.disabled]: !enabled,
|
|
160
160
|
[Select_module_scss_1.default.multi]: multiSelect,
|
|
161
161
|
}), autoFocus: autoFocus, children: [multiSelect ? (Array.isArray(value) && value.length > 0 ? ((0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.badgeListContainer, children: (0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.badgeList, children: value.map((v) => {
|
|
@@ -176,18 +176,17 @@ exports.Select = (0, react_1.forwardRef)(function Select({ id, initialValue, val
|
|
|
176
176
|
return 0;
|
|
177
177
|
}, children: [searchable ? ((0, jsx_runtime_1.jsxs)("div", { className: Select_module_scss_1.default.commandInputContainer, children: [(0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "search" }), (0, jsx_runtime_1.jsx)(cmdk_1.CommandInput, { className: (0, classnames_1.default)(Select_module_scss_1.default.commandInput), placeholder: "Search..." })] })) : (
|
|
178
178
|
// https://github.com/pacocoursey/cmdk/issues/322#issuecomment-2444703817
|
|
179
|
-
(0, jsx_runtime_1.jsx)("button", { autoFocus: true, "aria-hidden": "true", className: Select_module_scss_1.default.srOnly })), (0, jsx_runtime_1.jsxs)(cmdk_1.CommandList, { className: Select_module_scss_1.default.commandList, children: [Array.from(options).map(({ value, label, enabled, keywords }) => ((0, jsx_runtime_1.jsx)(exports.ComboboxOption, { value: value, label: label, enabled: enabled, keywords: keywords }, value))), (0, jsx_runtime_1.jsx)(cmdk_1.CommandEmpty, { children: emptyListNode })] })] }) }) })] }) })] })) : ((0, jsx_runtime_1.jsx)(SimpleSelect, { ref: ref, value: value, options: options, onValueChange: toggleOption, id: id, style:
|
|
179
|
+
(0, jsx_runtime_1.jsx)("button", { autoFocus: true, "aria-hidden": "true", className: Select_module_scss_1.default.srOnly })), (0, jsx_runtime_1.jsxs)(cmdk_1.CommandList, { className: Select_module_scss_1.default.commandList, children: [Array.from(options).map(({ value, label, enabled, keywords }) => ((0, jsx_runtime_1.jsx)(exports.ComboboxOption, { value: value, label: label, enabled: enabled, keywords: keywords }, value))), (0, jsx_runtime_1.jsx)(cmdk_1.CommandEmpty, { children: emptyListNode })] })] }) }) })] }) })] })) : ((0, jsx_runtime_1.jsx)(SimpleSelect, { ref: ref, value: value, options: options, onValueChange: toggleOption, id: id, style: style, onFocus: onFocus, onBlur: onBlur, enabled: enabled, validationStatus: validationStatus, triggerRef: setReferenceElement, autoFocus: autoFocus, placeholder: placeholder, height: dropdownHeight, children: children || emptyListNode })) }) }));
|
|
180
180
|
});
|
|
181
|
-
|
|
181
|
+
exports.ComboboxOption = (0, react_1.forwardRef)(function Combobox(option, forwardedRef) {
|
|
182
182
|
const id = (0, react_2.useId)();
|
|
183
183
|
const { label, value, enabled = true, keywords } = option;
|
|
184
184
|
const { value: selectedValue, onChange, multi, optionLabelRenderer } = (0, SelectContext_1.useSelect)();
|
|
185
185
|
const selected = Array.isArray(selectedValue) && multi ? selectedValue.includes(value) : selectedValue === value;
|
|
186
|
-
return ((0, jsx_runtime_1.jsxs)(cmdk_1.CommandItem, { id: id, disabled: !enabled, value: value, className: Select_module_scss_1.default.multiComboboxOption, onSelect: () => {
|
|
186
|
+
return ((0, jsx_runtime_1.jsxs)(cmdk_1.CommandItem, { id: id, ref: forwardedRef, disabled: !enabled, value: value, className: Select_module_scss_1.default.multiComboboxOption, onSelect: () => {
|
|
187
187
|
onChange(value);
|
|
188
188
|
}, "data-state": selected ? "checked" : undefined, keywords: keywords, children: [optionLabelRenderer ? optionLabelRenderer({ label, value }) : label, selected && (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "checkmark" })] }, id));
|
|
189
|
-
};
|
|
190
|
-
exports.ComboboxOption = ComboboxOption;
|
|
189
|
+
});
|
|
191
190
|
function HiddenOption(option) {
|
|
192
191
|
const { onOptionRemove, onOptionAdd } = (0, OptionContext_1.useOption)();
|
|
193
192
|
const [node, setNode] = (0, react_2.useState)(null);
|
|
@@ -50,5 +50,5 @@ exports.SliderMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
50
50
|
},
|
|
51
51
|
});
|
|
52
52
|
exports.sliderComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.SliderMd, ({ node, extractValue, lookupEventHandler, layoutCss }) => {
|
|
53
|
-
return (0, jsx_runtime_1.jsx)(SliderNative_1.Slider, {});
|
|
53
|
+
return (0, jsx_runtime_1.jsx)(SliderNative_1.Slider, { style: layoutCss });
|
|
54
54
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Slider = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
exports.Slider = (0, react_1.forwardRef)(function Slider({ style }, forwardedRef) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)("div", { ref: forwardedRef, style: Object.assign({ backgroundColor: "orangered", color: "white", padding: 2 }, style), children: "Slider component is not implemented yet" }));
|
|
8
|
+
});
|
|
@@ -3,14 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Spinner =
|
|
6
|
+
exports.Spinner = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const Spinner_module_scss_1 = __importDefault(require("./Spinner.module.scss"));
|
|
9
9
|
const react_1 = require("react");
|
|
10
|
+
const react_2 = require("react");
|
|
10
11
|
// source https://loading.io/css/
|
|
11
|
-
function Spinner({ delay = 400, fullScreen = false, style }) {
|
|
12
|
-
const [pastDelay, setPastDelay] = (0,
|
|
13
|
-
(0,
|
|
12
|
+
exports.Spinner = (0, react_1.forwardRef)(function Spinner({ delay = 400, fullScreen = false, style }, forwardedRef) {
|
|
13
|
+
const [pastDelay, setPastDelay] = (0, react_2.useState)(delay === 0);
|
|
14
|
+
(0, react_2.useEffect)(() => {
|
|
14
15
|
const timeout = setTimeout(() => {
|
|
15
16
|
setPastDelay(true);
|
|
16
17
|
}, delay);
|
|
@@ -18,7 +19,7 @@ function Spinner({ delay = 400, fullScreen = false, style }) {
|
|
|
18
19
|
clearTimeout(timeout);
|
|
19
20
|
};
|
|
20
21
|
}, [delay]);
|
|
21
|
-
const spinner = ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("div", { className: Spinner_module_scss_1.default["lds-ring"], style: style, children: [(0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)("div", {})] }) }));
|
|
22
|
+
const spinner = ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("div", { className: Spinner_module_scss_1.default["lds-ring"], style: style, ref: forwardedRef, children: [(0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)("div", {})] }) }));
|
|
22
23
|
if (!pastDelay) {
|
|
23
24
|
return null;
|
|
24
25
|
}
|
|
@@ -28,4 +29,4 @@ function Spinner({ delay = 400, fullScreen = false, style }) {
|
|
|
28
29
|
}
|
|
29
30
|
return spinner;
|
|
30
31
|
}
|
|
31
|
-
}
|
|
32
|
+
});
|
|
@@ -53,7 +53,7 @@ function renderSplitter(_a) {
|
|
|
53
53
|
if (!(0, misc_1.isComponentDefChildren)(node.children)) {
|
|
54
54
|
throw new EngineError_1.NotAComponentDefError();
|
|
55
55
|
}
|
|
56
|
-
return ((0, jsx_runtime_1.jsx)(SplitterNative_1.Splitter, {
|
|
56
|
+
return ((0, jsx_runtime_1.jsx)(SplitterNative_1.Splitter, { style: layoutCss, swapped: extractValue.asOptionalBoolean((_c = node.props) === null || _c === void 0 ? void 0 : _c.swapped), orientation: orientation, splitterTemplate: renderChild((_d = node.props) === null || _d === void 0 ? void 0 : _d.splitterTemplate), initialPrimarySize: extractValue((_e = node.props) === null || _e === void 0 ? void 0 : _e.initialPrimarySize), minPrimarySize: extractValue((_f = node.props) === null || _f === void 0 ? void 0 : _f.minPrimarySize), maxPrimarySize: extractValue((_g = node.props) === null || _g === void 0 ? void 0 : _g.maxPrimarySize), floating: extractValue.asOptionalBoolean((_h = node.props) === null || _h === void 0 ? void 0 : _h.floating), resize: lookupEventHandler("resize"), children: renderChild(node.children) }));
|
|
57
57
|
}
|
|
58
58
|
exports.splitterComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.SplitterMd, ({ node, extractValue, renderChild, layoutCss, layoutNonCss, lookupEventHandler }) => {
|
|
59
59
|
return renderSplitter({
|