UNPKG

@wordpress/block-library

Version:
1 lines • 1.45 kB
{"version":3,"file":"order-control.mjs","names":["WCSelectControl"],"sources":["../../../../src/terms-query/edit/inspector-controls/order-control.jsx"],"sourcesContent":["import { __ } from '@wordpress/i18n';\nimport { SelectControl as WCSelectControl } from '@wordpress/components';\n\nexport default function OrderControl( { orderBy, order, onChange, ...props } ) {\n\treturn (\n\t\t<WCSelectControl\n\t\t\toptions={ [\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Name: A → Z' ),\n\t\t\t\t\tvalue: 'name/asc',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Name: Z → A' ),\n\t\t\t\t\tvalue: 'name/desc',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Count, high to low' ),\n\t\t\t\t\tvalue: 'count/desc',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Count, low to high' ),\n\t\t\t\t\tvalue: 'count/asc',\n\t\t\t\t},\n\t\t\t] }\n\t\t\tvalue={ orderBy + '/' + order }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\tconst [ newOrderBy, newOrder ] = value.split( '/' );\n\t\t\t\tonChange( newOrderBy, newOrder );\n\t\t\t} }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;AAGA,SAAwB,aAAc,EAAE,SAAS,OAAO,UAAU,GAAG,SAAU;CAC9E,OACC,oBAACA,eAAD;EACC,SAAU;GACT;IACC,OAAO,GAAI,aAAc;IACzB,OAAO;GACR;GACA;IACC,OAAO,GAAI,aAAc;IACzB,OAAO;GACR;GACA;IACC,OAAO,GAAI,oBAAqB;IAChC,OAAO;GACR;GACA;IACC,OAAO,GAAI,oBAAqB;IAChC,OAAO;GACR;EACD;EACA,OAAQ,UAAU,MAAM;EACxB,WAAa,UAAW;GACvB,MAAM,CAAE,YAAY,YAAa,MAAM,MAAO,GAAI;GAClD,SAAU,YAAY,QAAS;EAChC;EACA,GAAK;CACL,CAAA;AAEH"}