@wordpress/components
Version:
UI components for WordPress.
1 lines • 1.07 kB
Source Map (JSON)
{"version":3,"file":"author-select.mjs","names":[],"sources":["../../src/query-controls/author-select.tsx"],"sourcesContent":["import { buildTermsTree } from './terms';\nimport TreeSelect from '../tree-select';\nimport type { AuthorSelectProps } from './types';\n\nexport default function AuthorSelect( {\n\tlabel,\n\tnoOptionLabel,\n\tauthorList,\n\tselectedAuthorId,\n\tonChange: onChangeProp,\n}: AuthorSelectProps ) {\n\tif ( ! authorList ) {\n\t\treturn null;\n\t}\n\tconst termsTree = buildTermsTree( authorList );\n\treturn (\n\t\t<TreeSelect\n\t\t\t{ ...{\n\t\t\t\tlabel,\n\t\t\t\tnoOptionLabel,\n\t\t\t\tonChange: onChangeProp,\n\t\t\t} }\n\t\t\ttree={ termsTree }\n\t\t\tselectedId={\n\t\t\t\tselectedAuthorId !== undefined\n\t\t\t\t\t? String( selectedAuthorId )\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;AAIA,SAAwB,aAAc,EACrC,OACA,eACA,YACA,kBACA,UAAU,gBACY;CACtB,IAAK,CAAE,YACN,OAAO;CAER,MAAM,YAAY,eAAgB,UAAW;CAC7C,OACC,oBAAC,YAAD;EAEE;EACA;EACA,UAAU;EAEX,MAAO;EACP,YACC,qBAAqB,KAAA,IAClB,OAAQ,gBAAiB,IACzB,KAAA;CAEJ,CAAA;AAEH"}