UNPKG

@focuson/form_components

Version:

Components that can be used by @focuson/forms

16 lines (15 loc) 922 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LabelAndDropDownWithVaryingContent2 = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const labelAndDropdown_1 = require("./labelAndDropdown"); const utils_1 = require("@focuson/utils"); function LabelAndDropDownWithVaryingContent2(props) { const { state, selector1, selector2, enums, allButtons, defaultForSelector1 } = props; const s1 = selector1.optJson(); const s2 = selector2.optJson(); const fromSelector1 = s1 && enums[s1] ? enums[s1] : defaultForSelector1; const fromSelector2 = fromSelector1 && s2 ? fromSelector1[s2] : {}; return (0, jsx_runtime_1.jsx)(labelAndDropdown_1.LabelAndDropdown, Object.assign({}, props, { state: state, allButtons: allButtons, enums: (0, utils_1.safeObject)(fromSelector2) })); } exports.LabelAndDropDownWithVaryingContent2 = LabelAndDropDownWithVaryingContent2;