@wordpress/block-library
Version:
Block library for the WordPress editor.
30 lines (29 loc) • 1.43 kB
JavaScript
;
Object.defineProperties(exports, {
__esModule: { value: true },
[Symbol.toStringTag]: { value: "Module" }
});
let _wordpress_components = require("@wordpress/components");
let _wordpress_i18n = require("@wordpress/i18n");
let react_jsx_runtime = require("react/jsx-runtime");
// packages/block-library/src/terms-query/edit/inspector-controls/inherit-control.jsx
function InheritControl({ value, onChange, label }) {
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_wordpress_components.__experimentalToggleGroupControl, {
label,
isBlock: true,
onChange: (newValue) => {
onChange({ inherit: newValue === "default" });
},
help: value ? (0, _wordpress_i18n.__)("Display terms based on the current taxonomy archive. For hierarchical taxonomies, shows children of the current term. For non-hierarchical taxonomies, shows all terms.") : (0, _wordpress_i18n.__)("Display terms based on specific criteria."),
value: value ? "default" : "custom",
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.__experimentalToggleGroupControlOption, {
value: "default",
label: (0, _wordpress_i18n.__)("Default")
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.__experimentalToggleGroupControlOption, {
value: "custom",
label: (0, _wordpress_i18n.__)("Custom")
})]
});
}
exports.default = InheritControl;
//# sourceMappingURL=inherit-control.cjs.map