UNPKG

@wordpress/block-library

Version:
43 lines (42 loc) • 1.25 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); let _wordpress_i18n = require("@wordpress/i18n"); let _wordpress_ui = require("@wordpress/ui"); let react_jsx_runtime = require("react/jsx-runtime"); // packages/block-library/src/terms-query/edit/inspector-controls/order-control.jsx function OrderControl({ orderBy, order, onChange, help, ...props }) { const orderOptions = [ { label: (0, _wordpress_i18n.__)("Name: A → Z"), value: "name/asc" }, { label: (0, _wordpress_i18n.__)("Name: Z → A"), value: "name/desc" }, { label: (0, _wordpress_i18n.__)("Count, high to low"), value: "count/desc" }, { label: (0, _wordpress_i18n.__)("Count, low to high"), value: "count/asc" } ]; return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_ui.SelectControl, { items: orderOptions, value: orderOptions.find((item) => item.value === orderBy + "/" + order) ?? null, onValueChange: (item) => { if (!item) return; const [newOrderBy, newOrder] = item.value.split("/"); onChange(newOrderBy, newOrder); }, description: help, ...props }); } exports.default = OrderControl; //# sourceMappingURL=order-control.cjs.map