import{j as e}from"./assertThisInitialized-ClXgY4BW.js";import{R as b}from"./utils-CkyKHvS2.js";import{a as i,r as s}from"./ideExtension-Duoj5XVI.js";import{l as C,b as h,s as F,a as S}from"./fieldDecorators-DYb0TeBY.js";import{R as a}from"./ReferenceField-BimPKO3B.js";import{C as T}from"./ChipField-gLazJyjk.js";import"./index-BP8_t0zE.js";import"./defaultI18nProvider-C_r1y4tu.js";import"./index-BCKAMao3.js";import"./dataProvider-BSMCbdJg.js";import"./useResourceDefinitionContext-mEDLreK0.js";import"./TextField-n0Myx-gm.js";import"./Typography-E7d16C50.js";import"./Button-C3j8Wgdd.js";import"./useRecordContext-CmNI-aHo.js";import"./ReferenceArrayField-ctaku4-6.js";import"./Box-UI_bZnlM.js";import"./hooks-kyAPvxe4.js";import"./index-qEiLzbkV.js";import"./Stack-BmeOikgJ.js";import"./Chip-4IhPI0f3.js";import"./useQuery-DJhJ3Hj4.js";import"./useLogout-DAYYFX4P.js";import"./SwitchBase-GsdOADyY.js";import"./pick-BQz50zYv.js";import"./hasIn-BUTlUeuZ.js";import"./_isIterateeCall-D0xvKagp.js";import"./identity-B2iMGpmP.js";import"./_baseUniq-BtunyI9N.js";import"./isArrayLikeObject-WBq23Ido.js";import"./useFormControl-D0zEVldg.js";import"./useDataProvider-BTi1EEZL.js";import"./useGetList-Dit6Yzrj.js";import"./usePaginationState-CSxOqUBu.js";import"./useRemoveFromStore-DvPdj666.js";import"./useResourceContext-BI9mATY-.js";import"./createSvgIcon-C1LdFc73.js";import"./useGetRecordRepresentation-DwGaoA_n.js";import"./useAuthenticated-CxLvTTH7.js";import"./useAuthState-Chcbfem2.js";import"./colorManipulator-DXmmM2jC.js";import"./ListNoResults-BHi6V5m8.js";import"./debounce-0x2xWYwC.js";import"./CardContent-C5u1opi3.js";import"./ResourceContextProvider-_t2ysSg2.js";import"./ListBase-CEqRUlEo.js";import"./Datagrid-BK2vyqjN.js";import"./getFieldLabelTranslationArgs-DwcCC9dO.js";import"./ExpandMore-Bu7ZqolT.js";import"./createSvgIcon-BeVLBbd8.js";import"./TopToolbar-BqW7kXvQ.js";import"./Toolbar-C8uTbHq-.js";import"./Confirm-BXDL5GEC.js";import"./Modal-CloRq8hE.js";import"./useMutation-DBpLFNEy.js";import"./undoableEventEmitter-DTIdLI-s.js";import"./useRefresh-BVYjI9Ho.js";import"./DateField-Csy-M8g5.js";import"./Clear-2k3OxyE6.js";import"./useReference-jPRH6tHJ.js";const y=r=>e.jsx(b,{resources:{name:"departments",recordRepresentation:"name"},children:e.jsx(e.Fragment,{children:r()})}),Pe={title:"Fields/ReferenceField",component:a,parameters:{layout:"centered",controls:{exclude:["source","reference","filter","link","queryOptions","sortBy","label","emptyText"]}},decorators:[C,y,h,F],args:{source:"department_id"},argTypes:{source:{control:"text"},reference:{control:"text"},emptyText:{control:"text"},label:{control:"text"},link:{control:"text"},queryOptions:{control:"text"},sortBy:{control:"text"}}},t={render:({...r})=>e.jsx(a,{source:i("department_id",{resourceSelectTitle:"Parent Resource Name",attributeSelectTitle:"Reference Attribute Name"}),reference:s("departments",{title:"Child Resource Name",allowContext:!1})})},o={render:({...r})=>e.jsx(a,{source:i("department_id",{resourceSelectTitle:"Parent Resource Name",attributeSelectTitle:"Reference Attribute Name"}),reference:s("departments",{title:"Child Resource Name",allowContext:!1}),children:e.jsx(S,{source:"name",render:N=>`${N.name}`.toUpperCase()})})},n={render:({...r})=>e.jsx(a,{source:i("department_id",{resourceSelectTitle:"Parent Resource Name",attributeSelectTitle:"Reference Attribute Name"}),reference:s("departments",{title:"Referenced Resource Name",resourceId:"referenced_resource",allowContext:!1}),children:e.jsx(T,{source:i("name",{resourceId:"referenced_resource",attributeSelectTitle:"Chip Label Attribute Name"})})})};var c,m,p;t.parameters={...t.parameters,docs:{...(c=t.parameters)==null?void 0:c.docs,source:{originalSource:`{
  render: ({
    ...props
  }) => {
    return <ReferenceField source={attributeName("department_id", {
      resourceSelectTitle: "Parent Resource Name",
      attributeSelectTitle: "Reference Attribute Name"
    })} reference={resourceName("departments", {
      title: "Child Resource Name",
      allowContext: false
    })} />;
  }
}`,...(p=(m=t.parameters)==null?void 0:m.docs)==null?void 0:p.source}}};var l,u,d;o.parameters={...o.parameters,docs:{...(l=o.parameters)==null?void 0:l.docs,source:{originalSource:`{
  render: ({
    ...props
  }) => {
    return <ReferenceField source={attributeName("department_id", {
      resourceSelectTitle: "Parent Resource Name",
      attributeSelectTitle: "Reference Attribute Name"
    })} reference={resourceName("departments", {
      title: "Child Resource Name",
      allowContext: false
    })}>
        <FunctionField source="name" render={record => \`\${record.name}\`.toUpperCase()} />
      </ReferenceField>;
  }
}`,...(d=(u=o.parameters)==null?void 0:u.docs)==null?void 0:d.source}}};var f,R,x;n.parameters={...n.parameters,docs:{...(f=n.parameters)==null?void 0:f.docs,source:{originalSource:`{
  render: ({
    ...props
  }) => {
    return <ReferenceField source={attributeName("department_id", {
      resourceSelectTitle: "Parent Resource Name",
      attributeSelectTitle: "Reference Attribute Name"
    })} reference={resourceName("departments", {
      title: "Referenced Resource Name",
      resourceId: "referenced_resource",
      allowContext: false
    })}>
        <ChipField source={attributeName("name", {
        resourceId: "referenced_resource",
        attributeSelectTitle: "Chip Label Attribute Name"
      })} />
      </ReferenceField>;
  }
}`,...(x=(R=n.parameters)==null?void 0:R.docs)==null?void 0:x.source}}};const Be=["DisplayByRecordRepresentation","DisplayWithCustomField","ChipReference"];export{n as ChipReference,t as DisplayByRecordRepresentation,o as DisplayWithCustomField,Be as __namedExportsOrder,Pe as default};
