import{j as e}from"./assertThisInitialized-ClXgY4BW.js";import{R as C}from"./utils-CkyKHvS2.js";import{a as t,r as a}from"./ideExtension-Duoj5XVI.js";import{l as T,b as h,s as F}from"./fieldDecorators-DYb0TeBY.js";import{R as c,S}from"./ReferenceArrayField-ctaku4-6.js";import{C as A}from"./ChipField-gLazJyjk.js";import{T as _}from"./TextField-n0Myx-gm.js";import"./index-BP8_t0zE.js";import"./defaultI18nProvider-C_r1y4tu.js";import"./index-BCKAMao3.js";import"./dataProvider-BSMCbdJg.js";import"./useResourceDefinitionContext-mEDLreK0.js";import"./Typography-E7d16C50.js";import"./Button-C3j8Wgdd.js";import"./useRecordContext-CmNI-aHo.js";import"./useGetList-Dit6Yzrj.js";import"./useQuery-DJhJ3Hj4.js";import"./useLogout-DAYYFX4P.js";import"./useDataProvider-BTi1EEZL.js";import"./ListBase-CEqRUlEo.js";import"./ListNoResults-BHi6V5m8.js";import"./pick-BQz50zYv.js";import"./hasIn-BUTlUeuZ.js";import"./_isIterateeCall-D0xvKagp.js";import"./identity-B2iMGpmP.js";import"./useRemoveFromStore-DvPdj666.js";import"./debounce-0x2xWYwC.js";import"./hooks-kyAPvxe4.js";import"./useAuthenticated-CxLvTTH7.js";import"./useAuthState-Chcbfem2.js";import"./colorManipulator-DXmmM2jC.js";import"./useResourceContext-BI9mATY-.js";import"./CardContent-C5u1opi3.js";import"./ResourceContextProvider-_t2ysSg2.js";import"./Datagrid-BK2vyqjN.js";import"./SwitchBase-GsdOADyY.js";import"./_baseUniq-BtunyI9N.js";import"./isArrayLikeObject-WBq23Ido.js";import"./useFormControl-D0zEVldg.js";import"./createSvgIcon-C1LdFc73.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"./ReferenceField-BimPKO3B.js";import"./Clear-2k3OxyE6.js";import"./useReference-jPRH6tHJ.js";import"./Chip-4IhPI0f3.js";import"./usePaginationState-CSxOqUBu.js";import"./useGetRecordRepresentation-DwGaoA_n.js";import"./DateField-Csy-M8g5.js";import"./Box-UI_bZnlM.js";import"./index-qEiLzbkV.js";import"./Stack-BmeOikgJ.js";const g=o=>e.jsx(C,{resources:[{name:"roles",recordRepresentation:"name"},{name:"users",recordRepresentation:"name"}],children:e.jsx(e.Fragment,{children:o()})}),Le={title:"Fields/ReferenceArrayField",component:c,parameters:{layout:"centered",controls:{exclude:["filter","pagination","perPage","source","reference","queryOptions","sort","sortBy"]}},decorators:[T,g,h,F],args:{source:"role_ids",reference:"users"},argTypes:{source:{control:"text"},reference:{control:"text"},filter:{control:"text"},pagination:{control:"text"},perPage:{control:"text"},queryOptions:{control:"text"},sort:{control:"text"},sortBy:{control:"text"}}},i={render:({source:o,reference:l,...r})=>e.jsx(c,{source:t("role_ids",{resourceSelectTitle:"Parent Resource Name",attributeSelectTitle:"Reference Attribute Name"}),reference:a("roles",{title:"Child Resource Name",allowContext:!1}),...r})},n={render:({source:o,reference:l,...r})=>e.jsx(c,{source:t("role_ids",{resourceSelectTitle:"Parent Resource Name",attributeSelectTitle:"Reference Attribute Name"}),reference:a("roles",{title:"Child Resource Name",allowContext:!1,resourceId:"referenced_resource"}),...r,children:e.jsx(S,{children:e.jsx(A,{source:t("name",{attributeSelectTitle:"Child Resource Representation Attribute",resourceId:"referenced_resource"})})})})},s={render:({source:o,reference:l,...r})=>e.jsx(c,{source:t("role_ids",{resourceSelectTitle:"Parent Resource Name",attributeSelectTitle:"Reference Attribute Name"}),reference:a("roles",{title:"Child Resource Name",allowContext:!1,resourceId:"referenced_resource"}),...r,children:e.jsx(S,{children:e.jsx(_,{source:t("name",{attributeSelectTitle:"Child Resource Representation Attribute",resourceId:"referenced_resource"})})})})};var m,u,p;i.parameters={...i.parameters,docs:{...(m=i.parameters)==null?void 0:m.docs,source:{originalSource:`{
  render: ({
    source,
    reference,
    ...props
  }) => {
    return <ReferenceArrayField source={attributeName("role_ids", {
      resourceSelectTitle: "Parent Resource Name",
      attributeSelectTitle: "Reference Attribute Name"
    })} reference={resourceName("roles", {
      title: "Child Resource Name",
      allowContext: false
    })} {...props} />;
  }
}`,...(p=(u=i.parameters)==null?void 0:u.docs)==null?void 0:p.source}}};var d,f,R;n.parameters={...n.parameters,docs:{...(d=n.parameters)==null?void 0:d.docs,source:{originalSource:`{
  render: ({
    source,
    reference,
    ...props
  }) => {
    return <ReferenceArrayField source={attributeName("role_ids", {
      resourceSelectTitle: "Parent Resource Name",
      attributeSelectTitle: "Reference Attribute Name"
    })} reference={resourceName("roles", {
      title: "Child Resource Name",
      allowContext: false,
      resourceId: "referenced_resource"
    })} {...props}>
        <SingleFieldList>
          <ChipField source={attributeName("name", {
          attributeSelectTitle: "Child Resource Representation Attribute",
          resourceId: "referenced_resource"
        })} />
        </SingleFieldList>
      </ReferenceArrayField>;
  }
}`,...(R=(f=n.parameters)==null?void 0:f.docs)==null?void 0:R.source}}};var x,N,b;s.parameters={...s.parameters,docs:{...(x=s.parameters)==null?void 0:x.docs,source:{originalSource:`{
  render: ({
    source,
    reference,
    ...props
  }) => {
    return <ReferenceArrayField source={attributeName("role_ids", {
      resourceSelectTitle: "Parent Resource Name",
      attributeSelectTitle: "Reference Attribute Name"
    })} reference={resourceName("roles", {
      title: "Child Resource Name",
      allowContext: false,
      resourceId: "referenced_resource"
    })} {...props}>
        <SingleFieldList>
          <TextField source={attributeName("name", {
          attributeSelectTitle: "Child Resource Representation Attribute",
          resourceId: "referenced_resource"
        })} />
        </SingleFieldList>
      </ReferenceArrayField>;
  }
}`,...(b=(N=s.parameters)==null?void 0:N.docs)==null?void 0:b.source}}};const Me=["Default","ManualChips","ManualTextField"];export{i as Default,n as ManualChips,s as ManualTextField,Me as __namedExportsOrder,Le as default};
