@wordpress/block-library
Version:
Block library for the WordPress editor.
1 lines • 1.81 kB
Source Map (JSON)
{"version":3,"file":"inherit-control.cjs","names":["ToggleGroupControl","__","ToggleGroupControlOption"],"sources":["../../../../src/terms-query/edit/inspector-controls/inherit-control.jsx"],"sourcesContent":["import {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nexport default function InheritControl( { value, onChange, label } ) {\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\tlabel={ label }\n\t\t\tisBlock\n\t\t\tonChange={ ( newValue ) => {\n\t\t\t\tonChange( {\n\t\t\t\t\tinherit: newValue === 'default',\n\t\t\t\t} );\n\t\t\t} }\n\t\t\thelp={\n\t\t\t\tvalue\n\t\t\t\t\t? __(\n\t\t\t\t\t\t\t'Display terms based on the current taxonomy archive. For hierarchical taxonomies, shows children of the current term. For non-hierarchical taxonomies, shows all terms.'\n\t\t\t\t\t\t)\n\t\t\t\t\t: __( 'Display terms based on specific criteria.' )\n\t\t\t}\n\t\t\tvalue={ value ? 'default' : 'custom' }\n\t\t>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tvalue=\"default\"\n\t\t\t\tlabel={ __( 'Default' ) }\n\t\t\t/>\n\t\t\t<ToggleGroupControlOption value=\"custom\" label={ __( 'Custom' ) } />\n\t\t</ToggleGroupControl>\n\t);\n}\n"],"mappings":";;;;;;;;;AAMA,SAAwB,eAAgB,EAAE,OAAO,UAAU,SAAU;CACpE,OACC,iBAAA,GAAA,kBAAA,KAAA,CAACA,sBAAAA,kCAAD;EACS;EACR,SAAA;EACA,WAAa,aAAc;GAC1B,SAAU,EACT,SAAS,aAAa,UACvB,CAAE;EACH;EACA,MACC,SAAA,GACGC,gBAAAA,GAAAA,CACA,yKACD,KAAA,GACCA,gBAAAA,GAAAA,CAAI,2CAA4C;EAEpD,OAAQ,QAAQ,YAAY;EAf7B,UAAA,CAiBC,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,wCAAD;GACC,OAAM;GACN,QAAA,GAAQD,gBAAAA,GAAAA,CAAI,SAAU;EACtB,CAAA,GACD,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,wCAAD;GAA0B,OAAM;GAAS,QAAA,GAAQD,gBAAAA,GAAAA,CAAI,QAAS;EAAK,CAAA,CAChD;;AAEtB"}