@povio/ui 3.4.0-rc.44 → 3.4.0-rc.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Accordion-DonRhvvW.d.ts → Accordion-UtY7wEp-.d.ts} +2 -1
- package/dist/{ActionModal-CKS0t-n3.d.ts → ActionModal-CzM2hcr0.d.ts} +1 -1
- package/dist/{Autocomplete-CLcRRdiL.d.ts → Autocomplete-B9GmXJF4.d.ts} +3 -2
- package/dist/{Breadcrumbs-C46_H95J.d.ts → Breadcrumbs-BLBMJpe1.d.ts} +3 -2
- package/dist/{Button-D0M9lMOR.d.ts → Button-DZZporg_.d.ts} +3 -3
- package/dist/{Checkbox-DC_1l0o7.d.ts → Checkbox-JJwUwUxc.d.ts} +1 -1
- package/dist/{CheckboxGroup-DnWeRs5l.d.ts → CheckboxGroup-Cw-SKIqN.d.ts} +2 -2
- package/dist/{DatePicker-KFZRDJfS.d.ts → DatePicker-DAd7ncHf.d.ts} +3 -3
- package/dist/{DatePickerInput-B7yVoI9Y.d.ts → DatePickerInput-CusTFCKQ.d.ts} +3 -3
- package/dist/{DateRangePicker-DcZ1l894.d.ts → DateRangePicker-CMbIzR3m.d.ts} +4 -4
- package/dist/{DateTimePicker-DWlstLhf.d.ts → DateTimePicker-Dc6_5X1V.d.ts} +4 -4
- package/dist/{FileUpload-Czof_aOb.d.ts → FileUpload-B7gn4UwN.d.ts} +1 -1
- package/dist/{FileUploadContainer--YlhZO19.d.ts → FileUploadContainer-C4PRM8Io.d.ts} +1 -1
- package/dist/{Form-Cnm0yRXZ.d.ts → Form-CQRpe7ZJ.d.ts} +1 -1
- package/dist/{FormField-Iy2O8A4g.d.ts → FormField-BuKYUy28.d.ts} +1 -1
- package/dist/{IconButton-CUpL6CsP.d.ts → IconButton-Drlnq7ik.d.ts} +2 -2
- package/dist/{InlineIconButton-AQ8SViM3.d.ts → InlineIconButton-C7_CmWFj.d.ts} +3 -3
- package/dist/{InputContent-jcMfOzpN.d.ts → InputContent-DguS6x2Q.d.ts} +2 -2
- package/dist/{InputUpload-D-C-886F.d.ts → InputUpload-BZqamXus.d.ts} +2 -2
- package/dist/{Inputs-Cm1abCeb.d.ts → Inputs-NL0LZbhc.d.ts} +1 -1
- package/dist/{Link-CKi4C00S.d.ts → Link-D85-7S3h.d.ts} +1 -1
- package/dist/{Menu-BHpiqpJ9.d.ts → Menu-DzTYbIHz.d.ts} +2 -2
- package/dist/{MenuItem-DLKC94Qs.d.ts → MenuItem-DVFyNRhi.d.ts} +1 -1
- package/dist/{Modal-BfN_MfR-.d.ts → Modal-4GP9tQLf.d.ts} +1 -1
- package/dist/{NumberInput-BIRmzsPb.d.ts → NumberInput-DjuZmkzv.d.ts} +3 -3
- package/dist/{NumberRangeInput-1ic7kLIS.d.ts → NumberRangeInput-DKVN5j9j.d.ts} +2 -2
- package/dist/{Pagination-uuqyFAu_.d.ts → Pagination-fLbLp_Ro.d.ts} +1 -1
- package/dist/{PaginationList-CmZBILfU.d.ts → PaginationList-DKYcaO7E.d.ts} +1 -1
- package/dist/{PasswordInput-DNUEWDEM.d.ts → PasswordInput-TIBbZOFu.d.ts} +1 -1
- package/dist/{Pill-vCBJdOTY.d.ts → Pill-BuC3w3xn.d.ts} +1 -1
- package/dist/{PillButton-CEF431l4.d.ts → PillButton-JjV_kJ6L.d.ts} +1 -1
- package/dist/{QuerySelect-vWifN5XC.d.ts → QuerySelect--pihqb-N.d.ts} +4 -3
- package/dist/{RadioGroup-Dd7xBSCW.d.ts → RadioGroup-Bp77H9AM.d.ts} +2 -2
- package/dist/{ResponsivePopover-BmURECUv.d.ts → ResponsivePopover-C76oaVmY.d.ts} +1 -1
- package/dist/{Segment-BZdZb436.d.ts → Segment-AtakFKus.d.ts} +3 -2
- package/dist/{Select-Bm2C6tHz.d.ts → Select-ChzbiDjh.d.ts} +3 -2
- package/dist/{SelectBase-DD8_4B-r.d.ts → SelectBase-DKJuFnvX.d.ts} +3 -3
- package/dist/{Slider-C6UeThGK.d.ts → Slider-BmoZiiSt.d.ts} +2 -2
- package/dist/{SplitButton-CR4psHKW.d.ts → SplitButton-BEYV4IPB.d.ts} +3 -3
- package/dist/{Tag-DUvBTljf.d.ts → Tag-BfmQ9BIV.d.ts} +1 -1
- package/dist/{TextArea-B8Yvkkxr.d.ts → TextArea-CbZ9kNwo.d.ts} +2 -2
- package/dist/{TextButton-cigitfeH.d.ts → TextButton-BZxhaNnh.d.ts} +3 -3
- package/dist/{TextEditor-DILzgUAj.d.ts → TextEditor-KzRofqtx.d.ts} +1 -1
- package/dist/{TextInput-Df0Pkuk-.d.ts → TextInput-ChVYCxjg.d.ts} +3 -3
- package/dist/{TimePicker-BcAaXiku.d.ts → TimePicker-CMhURRER.d.ts} +2 -2
- package/dist/{Toggle-Ca_t66zh.d.ts → Toggle-pQ0-MbwL.d.ts} +1 -1
- package/dist/{ToggleButton-3lINwoaV.d.ts → ToggleButton-DRTGhnjR.d.ts} +2 -2
- package/dist/{Tooltip-D1oFPqFF.d.ts → Tooltip-BxixKjWm.d.ts} +1 -1
- package/dist/{autocomplete-CIDaulwN.d.ts → autocomplete-BY74KiVw.d.ts} +4 -3
- package/dist/button-COs7mrbm.d.ts +1 -0
- package/dist/{checkbox-4smu5B-h.d.ts → checkbox-DLczwKKs.d.ts} +1 -1
- package/dist/{checkbox-group-C55R3YH5.d.ts → checkbox-group-DT7hMwsc.d.ts} +1 -1
- package/dist/components/accordion.d.ts +1 -1
- package/dist/components/action-modal.d.ts +1 -1
- package/dist/components/autocomplete/react-aria.js +1 -1
- package/dist/components/autocomplete.d.ts +1 -1
- package/dist/components/breadcrumb/react-aria.js +1 -1
- package/dist/components/breadcrumbs/react-aria.js +1 -1
- package/dist/components/breadcrumbs.d.ts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/cell/react-aria.js +1 -1
- package/dist/components/checkbox-group.d.ts +1 -1
- package/dist/components/checkbox.d.ts +1 -1
- package/dist/components/collection/react-aria.js +1 -1
- package/dist/components/color-swatch-picker/react-aria.js +1 -1
- package/dist/components/color-swatch-picker-item/react-aria.js +1 -1
- package/dist/components/column/react-aria.js +1 -1
- package/dist/components/column-resizer/react-aria.js +1 -1
- package/dist/components/combo-box/react-aria.js +1 -1
- package/dist/components/date-picker.d.ts +1 -1
- package/dist/components/date-range-picker.d.ts +1 -1
- package/dist/components/date-time-picker.d.ts +1 -1
- package/dist/components/file-upload-container.d.ts +2 -2
- package/dist/components/file-upload.d.ts +2 -2
- package/dist/components/focusable/react-aria.js +1 -1
- package/dist/components/form-field.d.ts +1 -1
- package/dist/components/grid-list/react-aria.js +1 -1
- package/dist/components/grid-list-header/react-aria.js +1 -1
- package/dist/components/grid-list-item/react-aria.js +1 -1
- package/dist/components/grid-list-load-more-item/react-aria.js +1 -1
- package/dist/components/grid-list-section/react-aria.js +1 -1
- package/dist/components/header/react-aria.js +1 -1
- package/dist/components/i18n-provider/react-aria.js +1 -1
- package/dist/components/icon-button.d.ts +1 -1
- package/dist/components/inline-icon-button.d.ts +1 -1
- package/dist/components/input-upload.d.ts +1 -1
- package/dist/components/link.d.ts +1 -1
- package/dist/components/list-box/react-aria.js +1 -1
- package/dist/components/list-box-item/react-aria.js +1 -1
- package/dist/components/list-box-load-more-item/react-aria.js +1 -1
- package/dist/components/list-box-section/react-aria.js +1 -1
- package/dist/components/menu/react-aria.js +1 -1
- package/dist/components/menu-item/react-aria.js +1 -1
- package/dist/components/menu-section/react-aria.js +1 -1
- package/dist/components/menu.d.ts +2 -2
- package/dist/components/modal.d.ts +1 -1
- package/dist/components/number-input.d.ts +1 -1
- package/dist/components/number-range-input.d.ts +1 -1
- package/dist/components/pagination-list.d.ts +1 -1
- package/dist/components/pagination.d.ts +1 -1
- package/dist/components/password-input.d.ts +1 -1
- package/dist/components/pill-button.d.ts +1 -1
- package/dist/components/pill.d.ts +1 -1
- package/dist/components/pressable/react-aria.js +1 -1
- package/dist/components/query-autocomplete.d.ts +2 -2
- package/dist/components/query-select.d.ts +1 -1
- package/dist/components/radio-group.d.ts +1 -1
- package/dist/components/resizable-table-container/react-aria.js +1 -1
- package/dist/components/responsive-popover.d.ts +1 -1
- package/dist/components/router-provider/react-aria.js +1 -1
- package/dist/components/row/react-aria.js +1 -1
- package/dist/components/section/react-aria.js +1 -1
- package/dist/components/segment.d.ts +2 -2
- package/dist/components/select/react-aria.js +1 -1
- package/dist/components/select.d.ts +2 -2
- package/dist/components/separator/react-aria.js +1 -1
- package/dist/components/slider.d.ts +1 -1
- package/dist/components/split-button.d.ts +1 -1
- package/dist/components/ssr-provider/react-aria.js +1 -1
- package/dist/components/submenu-trigger/react-aria.js +1 -1
- package/dist/components/tab/react-aria.js +1 -1
- package/dist/components/tab-list/react-aria.js +1 -1
- package/dist/components/tab-panels/react-aria.js +1 -1
- package/dist/components/table/react-aria.js +1 -1
- package/dist/components/table-body/react-aria.js +1 -1
- package/dist/components/table-header/react-aria.js +1 -1
- package/dist/components/table-load-more-item/react-aria.js +1 -1
- package/dist/components/tabs/react-aria.js +1 -1
- package/dist/components/tag/react-aria.js +1 -1
- package/dist/components/tag-group/react-aria.js +1 -1
- package/dist/components/tag-list/react-aria.js +1 -1
- package/dist/components/tag.d.ts +1 -1
- package/dist/components/text-area.d.ts +1 -1
- package/dist/components/text-button.d.ts +1 -1
- package/dist/components/text-input.d.ts +1 -1
- package/dist/components/time-picker.d.ts +1 -1
- package/dist/components/toast/react-aria.js +1 -1
- package/dist/components/toast-content/react-aria.js +1 -1
- package/dist/components/toast-list/react-aria.js +1 -1
- package/dist/components/toast-region/react-aria.js +1 -1
- package/dist/components/toggle-button.d.ts +1 -1
- package/dist/components/toggle.d.ts +1 -1
- package/dist/components/toolbar/react-aria.js +1 -1
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/tree/react-aria.js +1 -1
- package/dist/components/tree-item/react-aria.js +1 -1
- package/dist/components/tree-item-content/react-aria.js +1 -1
- package/dist/components/tree-load-more-item/react-aria.js +1 -1
- package/dist/components/virtualizer/react-aria.js +1 -1
- package/dist/components/visually-hidden/react-aria.js +1 -1
- package/dist/config/confirmation.d.ts +1 -1
- package/dist/config/link-context.d.ts +2 -2
- package/dist/config/ui-config.d.ts +1 -1
- package/dist/{confirmation.context-D_kJeU8m.d.ts → confirmation.context-CuufQTQR.d.ts} +1 -1
- package/dist/{date-picker-D2W1Bor7.d.ts → date-picker-CuNJV9nJ.d.ts} +1 -1
- package/dist/{date-range-picker-Cm0OPO-n.d.ts → date-range-picker-CJOhtloN.d.ts} +1 -1
- package/dist/{date-time-picker-QcvD8deo.d.ts → date-time-picker-MIDzdeQN.d.ts} +1 -1
- package/dist/{dynamicInputs-DhCSXGpC.d.ts → dynamicInputs-2kB0x8BT.d.ts} +70 -70
- package/dist/{file-upload-Ba6NwH0N.d.ts → file-upload-C0kwtd3Z.d.ts} +2 -2
- package/dist/{fileUpload.types-ZUblxJUi.d.ts → fileUpload.types-DFg9wCbc.d.ts} +3 -3
- package/dist/{index-DCUSluLL.d.ts → index-CXUySbXH.d.ts} +110 -1
- package/dist/index.d.ts +66 -66
- package/dist/{input-upload-BxRgcRt4.d.ts → input-upload-CFcsHAOE.d.ts} +1 -1
- package/dist/{link.context-C1RcdC0i.d.ts → link.context-BUxUXeo6.d.ts} +1 -1
- package/dist/{number-input-BoUfnoR2.d.ts → number-input-DhLfHuVP.d.ts} +1 -1
- package/dist/{number-range-input-BkHzkO1m.d.ts → number-range-input-CLsMdwqJ.d.ts} +1 -1
- package/dist/{password-input-BPAjcIly.d.ts → password-input--nSBPzos.d.ts} +1 -1
- package/dist/{query-autocomplete-Dh1Yeu4p.d.ts → query-autocomplete-vHRKodn0.d.ts} +2 -2
- package/dist/{query-select-7lNZcE_x.d.ts → query-select-CvoVhXu1.d.ts} +4 -3
- package/dist/{queryAutocomplete.types-D7SmWVq-.d.ts → queryAutocomplete.types-Cn4fe0OX.d.ts} +3 -3
- package/dist/{radio-group-DmilCTsI.d.ts → radio-group-rmH66jpI.d.ts} +1 -1
- package/dist/rhf/autocomplete.d.ts +2 -2
- package/dist/rhf/checkbox-group.d.ts +2 -2
- package/dist/rhf/checkbox.d.ts +2 -2
- package/dist/rhf/date-picker.d.ts +2 -2
- package/dist/rhf/date-range-picker.d.ts +2 -2
- package/dist/rhf/date-time-picker.d.ts +2 -2
- package/dist/rhf/file-upload.d.ts +2 -2
- package/dist/rhf/input-upload.d.ts +2 -2
- package/dist/rhf/inputs.d.ts +1 -1
- package/dist/rhf/number-input.d.ts +2 -2
- package/dist/rhf/number-range-input.d.ts +2 -2
- package/dist/rhf/password-input.d.ts +2 -2
- package/dist/rhf/query-autocomplete.d.ts +1 -1
- package/dist/rhf/query-select.d.ts +1 -1
- package/dist/rhf/radio-group.d.ts +2 -2
- package/dist/rhf/segment.d.ts +2 -2
- package/dist/rhf/select.d.ts +2 -2
- package/dist/rhf/slider.d.ts +2 -2
- package/dist/rhf/text-area.d.ts +2 -2
- package/dist/rhf/text-editor.d.ts +2 -2
- package/dist/rhf/text-input.d.ts +2 -2
- package/dist/rhf/time-picker.d.ts +2 -2
- package/dist/rhf/toggle.d.ts +2 -2
- package/dist/rhf.d.ts +66 -66
- package/dist/{segment-BOELlo1K.d.ts → segment-e0jd1JbP.d.ts} +3 -2
- package/dist/{segment.types-BYTmg69p.d.ts → segment.types-DUstTZeA.d.ts} +2 -1
- package/dist/{select-CD3fNAgK.d.ts → select-Bvt1d_ly.d.ts} +4 -3
- package/dist/{slider-tx1tub5d.d.ts → slider-CRnAZyb_.d.ts} +1 -1
- package/dist/tanstack/autocomplete.d.ts +1 -1
- package/dist/tanstack/checkbox-group.d.ts +1 -1
- package/dist/tanstack/checkbox.d.ts +1 -1
- package/dist/tanstack/date-picker.d.ts +1 -1
- package/dist/tanstack/date-range-picker.d.ts +1 -1
- package/dist/tanstack/date-time-picker.d.ts +1 -1
- package/dist/tanstack/file-upload.d.ts +2 -2
- package/dist/tanstack/form.d.ts +1 -1
- package/dist/tanstack/input-upload.d.ts +1 -1
- package/dist/tanstack/inputs.d.ts +2 -2
- package/dist/tanstack/number-input.d.ts +1 -1
- package/dist/tanstack/number-range-input.d.ts +1 -1
- package/dist/tanstack/password-input.d.ts +1 -1
- package/dist/tanstack/query-select.d.ts +1 -1
- package/dist/tanstack/radio-group.d.ts +1 -1
- package/dist/tanstack/segment.d.ts +2 -2
- package/dist/tanstack/select.d.ts +1 -1
- package/dist/tanstack/slider.d.ts +1 -1
- package/dist/tanstack/text-area.d.ts +1 -1
- package/dist/tanstack/text-editor.d.ts +1 -1
- package/dist/tanstack/text-input.d.ts +1 -1
- package/dist/tanstack/time-picker.d.ts +1 -1
- package/dist/tanstack/toggle.d.ts +1 -1
- package/dist/tanstack.d.ts +50 -50
- package/dist/{text-area-kb2PxyJb.d.ts → text-area-KsaEQpPz.d.ts} +1 -1
- package/dist/{text-editor-CDECpKqj.d.ts → text-editor-CYU0teJy.d.ts} +1 -1
- package/dist/text-editor.d.ts +1 -1
- package/dist/{text-input-VqRJ0y7Y.d.ts → text-input-dZeNDTtP.d.ts} +1 -1
- package/dist/{time-picker-CZLL-OEe.d.ts → time-picker-CcHlAJUk.d.ts} +1 -1
- package/dist/{toggle-DK5CDOtt.d.ts → toggle-BGOUUhAG.d.ts} +1 -1
- package/dist/{types-ZbFfCz06.d.ts → types-CaqW-yY5.d.ts} +20 -27
- package/dist/types-Dugk_Mie.d.ts +581 -0
- package/package.json +23 -1
- package/dist/button-BQmy1LZS.d.ts +0 -1
- package/dist/types-BT18i837.d.ts +0 -69
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useMemo as a,useRef as o,useState as s,useSyncExternalStore as c}from"react";import{filterDOMProps as l,inertValue as u,mergeProps as d,mergeRefs as f,useLayoutEffect as p,useLoadMoreSentinel as m,useObjectRef as h,useResizeObserver as g}from"@react-aria/utils";import{FocusableContext as _}from"@react-aria/interactions";import"react-dom";import{mergeProps as v,useComboBox as ee,useFilter as te}from"react-aria";import{useComboBoxState as ne}from"react-stately";const y=Symbol(`default`);function re({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function b(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return a(()=>{let e,a,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,a=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??i,style:a||s?{...s,...a}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,o,s,c,l])}function x(e,t){let n=i(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||y;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function S(e,t,n){let{ref:r,...i}=x(n,e.slot)||{},o=h(a(()=>f(t,r),[t,r])),s=d(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(s.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[s,o]}function C(e=!0){let[t,n]=s(e),i=o(!1),a=r(e=>{i.current=!0,n(!!e)},[]);return p(()=>{i.current||n(!1)},[]),[a,t]}function ie(e){let t=/^(data-.*)$/,n={};for(let r in e)t.test(r)||(n[r]=e[r]);return n}function w(t,n,r){let{render:i,...s}=n,c=o(null),l=a(()=>f(r,c),[r,c]);p(()=>{},[t,i]);let u={...s,ref:l};return i?i(u,void 0):e.createElement(t,u)}const T={},E=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=T[t];return r||(r=n(w.bind(null,t)),T[t]=r),r}});String(Math.round(Math.random()*1e10));const D=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function O(){return!1}function k(){return!0}function A(e){return()=>{}}function j(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(A,O,k):i(D)}var M=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},N=class extends M{filter(e,t,n){let[r,i]=z(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},P=class extends M{};P.type=`header`;var F=class extends M{};F.type=`loader`;var I=class extends N{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};I.type=`item`;var L=class extends N{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};L.type=`section`;var R=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=z(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function z(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}var B=class{*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild??=e,this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,t){if(t==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=t,e.previousSibling=t.previousSibling,e.index=t.index-1,this.firstChild===t?this.firstChild=e:t.previousSibling&&(t.previousSibling.nextSibling=e),t.previousSibling=e,e.parentNode=t.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}},V=class e extends B{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof e?this.parentNode.level+ +(this.node?.type===`item`):0}getMutableNode(){return this.node==null?null:(this.isMutated||=(this.node=this.node.clone(),!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){let t=this.nextVisibleSibling,n=this.getMutableNode();if(n!=null&&(n.index=this.index,n.level=this.level,n.parentKey=this.parentNode instanceof e?this.parentNode.node?.key??null:null,n.prevKey=this.previousVisibleSibling?.node?.key??null,n.nextKey=t?.node?.key??null,n.hasChildNodes=!!this.firstChild,n.firstChildKey=this.firstVisibleChild?.node?.key??null,n.lastChildKey=this.lastVisibleChild?.node?.key??null,(n.colSpan!=null||n.colIndex!=null)&&t)){let e=(n.colIndex??n.index)+(n.colSpan??1);if(t.node!=null&&e!==t.node.colIndex){let n=t.getMutableNode();n.colIndex=e}}}setProps(e,t,n,r,i){let a,{value:o,textValue:s,id:c,...l}=e;if(this.node==null?(a=new n(c??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),l.ref=t,a.props=l,a.rendered=r,a.render=i,a.value=o,e[`aria-label`]&&(a[`aria-label`]=e[`aria-label`]),a.textValue=s||(typeof l.children==`string`?l.children:``)||e[`aria-label`]||``,c!=null&&c!==a.key)throw Error(`Cannot change the id of an item`);l.colSpan!=null&&(a.colSpan=l.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?`none`:``},set display(t){let n=t===`none`;if(e.isHidden!==n){(e.parentNode?.firstVisibleChild===e||e.parentNode?.lastVisibleChild===e)&&e.ownerDocument.markDirty(e.parentNode);let t=e.previousVisibleSibling,r=e.nextVisibleSibling;t&&e.ownerDocument.markDirty(t),r&&e.ownerDocument.markDirty(r),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,t){super(t),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},ae=class extends B{get isConnected(){return!0}createElement(e){return new V(e,this)}getMutableCollection(){return this.nextCollection||=this.collection.clone(),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let t of e)this.addNode(t);t.addNode(e.node)}removeNode(e){for(let t of e)this.removeNode(t);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let e of this.dirtyNodes)e instanceof V&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof V?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}};if(typeof HTMLTemplateElement<`u`){let e=Object.getOwnPropertyDescriptor(Node.prototype,`firstChild`).get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}const H=t(!1);function oe(t){if(i(H))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(H.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}const se=t(!1),U=t(null);function W(t){if(i(U))return t.content;let{collection:n,document:r}=ue(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(oe,null,e.createElement(U.Provider,{value:r},t.content)),e.createElement(G,{render:t.children,collection:n}))}function G({collection:e,render:t}){return t(e)}function ce(e,t,n){let i=j(),a=o(i);a.current=i;let s=r(()=>a.current?n():t(),[t,n]);return c(e,s)}const le=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:ce;function ue(e){let[t]=s(()=>new ae(e?.()||new R)),n=r(e=>t.subscribe(e),[t]),i=r(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),a=r(()=>(t.isSSR=!0,t.getCollection()),[t]);return{collection:le(n,i,a),document:t}}const K=t(null);function de(e){var t;return t=class extends M{},t.type=e,t}function fe(t,n,a,o,s,c){typeof t==`string`&&(t=de(t));let l=r(e=>{e?.setProps(n,a,t,o,c)},[n,a,o,c,t]),u=i(K);if(u){let r=u.ownerDocument.nodesByProps.get(n);return r||(r=u.ownerDocument.createElement(t.type),r.setProps(n,a,t,o,c),u.appendChild(r),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,r)),s?e.createElement(K.Provider,{value:r},s):null}return e.createElement(t.type,{ref:l},s)}function pe(t,r){let a=({node:e})=>r(e.props,e.props.ref,e),o=n((n,o)=>{let s=i(_);if(!i(se)){if(r.length>=3)throw Error(r.name+` cannot be rendered outside a collection.`);return r(n,o)}return fe(t,n,o,`children`in n?n.children:null,null,t=>e.createElement(_.Provider,{value:s},e.createElement(a,{node:t})))});return o.displayName=r.name,o}const q=t({}),J=t({}),Y=t({}),me=t(null),he=t(null),X=t({}),Z=t({}),Q=t(null),$=t(null);pe(F,function(t,n,r){let s=i($),{isLoading:c,onLoadMore:d,scrollOffset:f,...p}=t,h=o(null),g=a(()=>({onLoadMore:d,collection:s?.collection,sentinelRef:h,scrollOffset:f}),[d,f,s?.collection]);m(g,h);let _=b({...p,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),c&&_.children&&e.createElement(E.div,{...v(l(t,{global:!0}),{tabIndex:-1}),..._,role:`option`,ref:n},_.children))});const ge=t(null),_e=t(null),ve=t(null),ye=t(null),be=n(function(t,n){[t,n]=S(t,n,ve);let{children:r,isDisabled:i=!1,isInvalid:o=!1,isRequired:s=!1}=t,c=a(()=>e.createElement(Q.Provider,{value:{items:t.items??t.defaultItems}},typeof r==`function`?r({isOpen:!1,isDisabled:i,isInvalid:o,isRequired:s,defaultChildren:null}):r),[r,i,o,s,t.items,t.defaultItems]);return e.createElement(W,{content:c},r=>e.createElement(Se,{props:t,collection:r,comboBoxRef:n}))}),xe=[q,J,Z,X,Y];function Se({props:t,collection:n,comboBoxRef:i}){let{name:c,formValue:u=`key`,allowsCustomValue:d}=t;d&&(u=`text`);let{validationBehavior:f}=x(he)||{},p=t.validationBehavior??f??`native`,{contains:m}=te({sensitivity:`base`}),h=ne({...t,defaultFilter:t.defaultFilter||m,items:t.items,children:void 0,collection:n,validationBehavior:p}),_=o(null),v=o(null),y=o(null),S=o(null),[w,T]=C(!t[`aria-label`]&&!t[`aria-labelledby`]),{buttonProps:D,inputProps:O,listBoxProps:k,labelProps:A,descriptionProps:j,errorMessageProps:M,...N}=ee({...ie(t),label:T,inputRef:v,buttonRef:_,listBoxRef:y,popoverRef:S,name:u===`text`?c:void 0,validationBehavior:p},h),[P,F]=s(null),I=r(()=>{if(v.current){let e=_.current?.getBoundingClientRect(),t=v.current.getBoundingClientRect(),n=e?Math.min(e.left,t.left):t.left,r=e?Math.max(e.right,t.right):t.right;F(r-n+`px`)}},[_,v,F]);g({ref:v,onResize:I});let L=a(()=>({isOpen:h.isOpen,isDisabled:t.isDisabled||!1,isInvalid:N.isInvalid||!1,isRequired:t.isRequired||!1}),[h.isOpen,t.isDisabled,N.isInvalid,t.isRequired]),R=b({...t,values:L,defaultClassName:`react-aria-ComboBox`}),z=l(t,{global:!0});return delete z.id,e.createElement(re,{values:[[ye,h],[q,{...A,ref:w}],[J,{...D,ref:_,isPressed:h.isOpen}],[Z,{...O,ref:v}],[_e,h],[ge,{ref:S,triggerRef:v,scrollRef:y,placement:`bottom start`,isNonModal:!0,trigger:`ComboBox`,style:{"--trigger-width":P},clearContexts:xe}],[Q,{...k,ref:y}],[$,h],[Y,{slots:{description:j,errorMessage:M}}],[X,{isInvalid:N.isInvalid,isDisabled:t.isDisabled||!1}],[me,N]]},e.createElement(E.div,{...z,...R,ref:i,slot:t.slot||void 0,"data-focused":h.isFocused||void 0,"data-open":h.isOpen||void 0,"data-disabled":t.isDisabled||void 0,"data-invalid":N.isInvalid||void 0,"data-required":t.isRequired||void 0}),c&&u===`key`&&e.createElement(`input`,{type:`hidden`,name:c,form:t.form,value:h.selectedKey??``}))}export{be as ComboBox};
|
|
1
|
+
import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useMemo as a,useRef as o,useState as s,useSyncExternalStore as c}from"react";import{filterDOMProps as l,inertValue as u,mergeProps as d,mergeRefs as f,useLayoutEffect as p,useLoadMoreSentinel as m,useObjectRef as h,useResizeObserver as g}from"@react-aria/utils";import{FocusableContext as _}from"@react-aria/interactions";import"react-dom";import{mergeProps as v,useComboBox as ee,useFilter as y}from"react-aria";import{useComboBoxState as te}from"react-stately";const b=Symbol(`default`);function ne({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function x(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return a(()=>{let e,a,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,a=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??i,style:a||s?{...s,...a}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,o,s,c,l])}function S(e,t){let n=i(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||b;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function C(e,t,n){let{ref:r,...i}=S(n,e.slot)||{},o=h(a(()=>f(t,r),[t,r])),s=d(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(s.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[s,o]}function re(e=!0){let[t,n]=s(e),i=o(!1),a=r(e=>{i.current=!0,n(!!e)},[]);return p(()=>{i.current||n(!1)},[]),[a,t]}function ie(e){let t=/^(data-.*)$/,n={};for(let r in e)t.test(r)||(n[r]=e[r]);return n}function w(t,n,r){let{render:i,...s}=n,c=o(null),l=a(()=>f(r,c),[r,c]);p(()=>{},[t,i]);let u={...s,ref:l};return i?i(u,void 0):e.createElement(t,u)}const T={},E=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=T[t];return r||(r=n(w.bind(null,t)),T[t]=r),r}});var D=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},O=class extends D{filter(e,t,n){let[r,i]=P(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},k=class extends D{};k.type=`header`;var A=class extends D{};A.type=`loader`;var j=class extends O{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};j.type=`item`;var M=class extends O{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};M.type=`section`;var N=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=P(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function P(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}var F=class{*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild??=e,this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,t){if(t==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=t,e.previousSibling=t.previousSibling,e.index=t.index-1,this.firstChild===t?this.firstChild=e:t.previousSibling&&(t.previousSibling.nextSibling=e),t.previousSibling=e,e.parentNode=t.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}},I=class e extends F{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof e?this.parentNode.level+ +(this.node?.type===`item`):0}getMutableNode(){return this.node==null?null:(this.isMutated||=(this.node=this.node.clone(),!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){let t=this.nextVisibleSibling,n=this.getMutableNode();if(n!=null&&(n.index=this.index,n.level=this.level,n.parentKey=this.parentNode instanceof e?this.parentNode.node?.key??null:null,n.prevKey=this.previousVisibleSibling?.node?.key??null,n.nextKey=t?.node?.key??null,n.hasChildNodes=!!this.firstChild,n.firstChildKey=this.firstVisibleChild?.node?.key??null,n.lastChildKey=this.lastVisibleChild?.node?.key??null,(n.colSpan!=null||n.colIndex!=null)&&t)){let e=(n.colIndex??n.index)+(n.colSpan??1);if(t.node!=null&&e!==t.node.colIndex){let n=t.getMutableNode();n.colIndex=e}}}setProps(e,t,n,r,i){let a,{value:o,textValue:s,id:c,...l}=e;if(this.node==null?(a=new n(c??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),l.ref=t,a.props=l,a.rendered=r,a.render=i,a.value=o,e[`aria-label`]&&(a[`aria-label`]=e[`aria-label`]),a.textValue=s||(typeof l.children==`string`?l.children:``)||e[`aria-label`]||``,c!=null&&c!==a.key)throw Error(`Cannot change the id of an item`);l.colSpan!=null&&(a.colSpan=l.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?`none`:``},set display(t){let n=t===`none`;if(e.isHidden!==n){(e.parentNode?.firstVisibleChild===e||e.parentNode?.lastVisibleChild===e)&&e.ownerDocument.markDirty(e.parentNode);let t=e.previousVisibleSibling,r=e.nextVisibleSibling;t&&e.ownerDocument.markDirty(t),r&&e.ownerDocument.markDirty(r),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,t){super(t),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},L=class extends F{get isConnected(){return!0}createElement(e){return new I(e,this)}getMutableCollection(){return this.nextCollection||=this.collection.clone(),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let t of e)this.addNode(t);t.addNode(e.node)}removeNode(e){for(let t of e)this.removeNode(t);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let e of this.dirtyNodes)e instanceof I&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof I?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}};if(typeof HTMLTemplateElement<`u`){let e=Object.getOwnPropertyDescriptor(Node.prototype,`firstChild`).get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}const R=t(!1);function z(t){if(i(R))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(R.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}String(Math.round(Math.random()*1e10));const ae=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function oe(){return!1}function B(){return!0}function se(e){return()=>{}}function V(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(se,oe,B):i(ae)}const H=t(!1),U=t(null);function W(t){if(i(U))return t.content;let{collection:n,document:r}=ue(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(z,null,e.createElement(U.Provider,{value:r},t.content)),e.createElement(G,{render:t.children,collection:n}))}function G({collection:e,render:t}){return t(e)}function ce(e,t,n){let i=V(),a=o(i);a.current=i;let s=r(()=>a.current?n():t(),[t,n]);return c(e,s)}const le=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:ce;function ue(e){let[t]=s(()=>new L(e?.()||new N)),n=r(e=>t.subscribe(e),[t]),i=r(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),a=r(()=>(t.isSSR=!0,t.getCollection()),[t]);return{collection:le(n,i,a),document:t}}const K=t(null);function de(e){var t;return t=class extends D{},t.type=e,t}function fe(t,n,a,o,s,c){typeof t==`string`&&(t=de(t));let l=r(e=>{e?.setProps(n,a,t,o,c)},[n,a,o,c,t]),u=i(K);if(u){let r=u.ownerDocument.nodesByProps.get(n);return r||(r=u.ownerDocument.createElement(t.type),r.setProps(n,a,t,o,c),u.appendChild(r),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,r)),s?e.createElement(K.Provider,{value:r},s):null}return e.createElement(t.type,{ref:l},s)}function pe(t,r){let a=({node:e})=>r(e.props,e.props.ref,e),o=n((n,o)=>{let s=i(_);if(!i(H)){if(r.length>=3)throw Error(r.name+` cannot be rendered outside a collection.`);return r(n,o)}return fe(t,n,o,`children`in n?n.children:null,null,t=>e.createElement(_.Provider,{value:s},e.createElement(a,{node:t})))});return o.displayName=r.name,o}const q=t({}),J=t({}),Y=t({}),me=t(null),he=t(null),X=t({}),Z=t({}),Q=t(null),$=t(null);pe(A,function(t,n,r){let s=i($),{isLoading:c,onLoadMore:d,scrollOffset:f,...p}=t,h=o(null),g=a(()=>({onLoadMore:d,collection:s?.collection,sentinelRef:h,scrollOffset:f}),[d,f,s?.collection]);m(g,h);let _=x({...p,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),c&&_.children&&e.createElement(E.div,{...v(l(t,{global:!0}),{tabIndex:-1}),..._,role:`option`,ref:n},_.children))});const ge=t(null),_e=t(null),ve=t(null),ye=t(null),be=n(function(t,n){[t,n]=C(t,n,ve);let{children:r,isDisabled:i=!1,isInvalid:o=!1,isRequired:s=!1}=t,c=a(()=>e.createElement(Q.Provider,{value:{items:t.items??t.defaultItems}},typeof r==`function`?r({isOpen:!1,isDisabled:i,isInvalid:o,isRequired:s,defaultChildren:null}):r),[r,i,o,s,t.items,t.defaultItems]);return e.createElement(W,{content:c},r=>e.createElement(Se,{props:t,collection:r,comboBoxRef:n}))}),xe=[q,J,Z,X,Y];function Se({props:t,collection:n,comboBoxRef:i}){let{name:c,formValue:u=`key`,allowsCustomValue:d}=t;d&&(u=`text`);let{validationBehavior:f}=S(he)||{},p=t.validationBehavior??f??`native`,{contains:m}=y({sensitivity:`base`}),h=te({...t,defaultFilter:t.defaultFilter||m,items:t.items,children:void 0,collection:n,validationBehavior:p}),_=o(null),v=o(null),b=o(null),C=o(null),[w,T]=re(!t[`aria-label`]&&!t[`aria-labelledby`]),{buttonProps:D,inputProps:O,listBoxProps:k,labelProps:A,descriptionProps:j,errorMessageProps:M,...N}=ee({...ie(t),label:T,inputRef:v,buttonRef:_,listBoxRef:b,popoverRef:C,name:u===`text`?c:void 0,validationBehavior:p},h),[P,F]=s(null),I=r(()=>{if(v.current){let e=_.current?.getBoundingClientRect(),t=v.current.getBoundingClientRect(),n=e?Math.min(e.left,t.left):t.left,r=e?Math.max(e.right,t.right):t.right;F(r-n+`px`)}},[_,v,F]);g({ref:v,onResize:I});let L=a(()=>({isOpen:h.isOpen,isDisabled:t.isDisabled||!1,isInvalid:N.isInvalid||!1,isRequired:t.isRequired||!1}),[h.isOpen,t.isDisabled,N.isInvalid,t.isRequired]),R=x({...t,values:L,defaultClassName:`react-aria-ComboBox`}),z=l(t,{global:!0});return delete z.id,e.createElement(ne,{values:[[ye,h],[q,{...A,ref:w}],[J,{...D,ref:_,isPressed:h.isOpen}],[Z,{...O,ref:v}],[_e,h],[ge,{ref:C,triggerRef:v,scrollRef:b,placement:`bottom start`,isNonModal:!0,trigger:`ComboBox`,style:{"--trigger-width":P},clearContexts:xe}],[Q,{...k,ref:b}],[$,h],[Y,{slots:{description:j,errorMessage:M}}],[X,{isInvalid:N.isInvalid,isDisabled:t.isDisabled||!1}],[me,N]]},e.createElement(E.div,{...z,...R,ref:i,slot:t.slot||void 0,"data-focused":h.isFocused||void 0,"data-open":h.isOpen||void 0,"data-disabled":t.isDisabled||void 0,"data-invalid":N.isInvalid||void 0,"data-required":t.isRequired||void 0}),c&&u===`key`&&e.createElement(`input`,{type:`hidden`,name:c,form:t.form,value:h.selectedKey??``}))}export{be as ComboBox};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as DatePicker, r as DatePickerProps, t as ControlledDatePickerProps } from "../DatePicker-
|
|
1
|
+
import { n as DatePicker, r as DatePickerProps, t as ControlledDatePickerProps } from "../DatePicker-DAd7ncHf.js";
|
|
2
2
|
export { type ControlledDatePickerProps, DatePicker, type DatePickerProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as DateRangeResolvedValue, i as DateRangeRelativeOption, n as DateRangePicker, r as DateRangePickerProps, t as ControlledDateRangePickerProps } from "../DateRangePicker-
|
|
1
|
+
import { a as DateRangeResolvedValue, i as DateRangeRelativeOption, n as DateRangePicker, r as DateRangePickerProps, t as ControlledDateRangePickerProps } from "../DateRangePicker-CMbIzR3m.js";
|
|
2
2
|
import { CalendarDate } from "@internationalized/date";
|
|
3
3
|
//#region src/components/inputs/DateTime/DateRangePicker/dateRangePreset.utils.d.ts
|
|
4
4
|
declare const dateRangePresetValues: readonly ["thisWeek", "lastWeek", "thisAndLastWeek", "thisMonth", "thisAndLastMonth", "thisYear", "lastYear", "thisAndLastYear", "soFar"];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as DateTimePicker, r as DateTimePickerProps, t as ControlledDateTimePickerProps } from "../DateTimePicker-
|
|
1
|
+
import { n as DateTimePicker, r as DateTimePickerProps, t as ControlledDateTimePickerProps } from "../DateTimePicker-Dc6_5X1V.js";
|
|
2
2
|
export { type ControlledDateTimePickerProps, DateTimePicker, type DateTimePickerProps };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as FileUploadContainerProps } from "../fileUpload.types-
|
|
2
|
-
import { t as FileUploadContainer } from "../FileUploadContainer
|
|
1
|
+
import { i as FileUploadContainerProps } from "../fileUpload.types-DFg9wCbc.js";
|
|
2
|
+
import { t as FileUploadContainer } from "../FileUploadContainer-C4PRM8Io.js";
|
|
3
3
|
export { FileUploadContainer, type FileUploadContainerProps };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as FileUploadError, c as FileUploadResponse, l as FileUploadState, n as FileUploadBaseProps, o as FileUploadProps, r as FileUploadButtonProps, s as FileUploadRequest, t as DefaultFile } from "../fileUpload.types-
|
|
2
|
-
import { t as FileUpload } from "../FileUpload-
|
|
1
|
+
import { a as FileUploadError, c as FileUploadResponse, l as FileUploadState, n as FileUploadBaseProps, o as FileUploadProps, r as FileUploadButtonProps, s as FileUploadRequest, t as DefaultFile } from "../fileUpload.types-DFg9wCbc.js";
|
|
2
|
+
import { t as FileUpload } from "../FileUpload-B7gn4UwN.js";
|
|
3
3
|
export { type DefaultFile, FileUpload, type FileUploadBaseProps, type FileUploadButtonProps, type FileUploadError, type FileUploadProps, type FileUploadRequest, type FileUploadResponse, type FileUploadState };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Focusable as e}from"react-aria";import"react-stately";export{e as Focusable};
|
|
1
|
+
import{Focusable as e}from"react-aria";import"react-stately";import"@react-aria/dnd";export{e as Focusable};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as FormFieldProps, t as FormField } from "../FormField-
|
|
1
|
+
import { n as FormFieldProps, t as FormField } from "../FormField-BuKYUy28.js";
|
|
2
2
|
export { FormField, FormFieldProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useRef as l,useState as u,useSyncExternalStore as d}from"react";import{filterDOMProps as f,inertValue as p,mergeProps as m,mergeRefs as h,useLayoutEffect as g,useLoadMoreSentinel as _,useObjectRef as v}from"@react-aria/utils";import{FocusableContext as y}from"@react-aria/interactions";import{createPortal as ee}from"react-dom";import{FocusScope as te,ListKeyboardDelegate as b,mergeProps as x,useCollator as ne,useFocusRing as re,useGridList as ie,useLocale as ae,useVisuallyHidden as S}from"react-aria";import{UNSTABLE_useFilteredListState as oe,useListState as se}from"react-stately";n(null),n(null),n(null),n(null),n(null),n({});const ce=n(null);n(null);const C=Symbol(`default`);function le({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function w(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:l}=e;return c(()=>{let e,c,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,c=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:c||o?{...o,...c}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,s):void 0}},[t,n,r,i,a,o,s,l])}function T(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||C;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function E(e,t,n){let{ref:r,...i}=T(n,e.slot)||{},a=v(c(()=>h(t,r),[t,r])),o=m(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(o.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[o,a]}function D(t,n,r){let{render:i,...a}=n,o=l(null),s=c(()=>h(r,o),[r,o]);g(()=>{},[t,i]);let u={...a,ref:s};return i?i(u,void 0):e.createElement(t,u)}const O={},k=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=O[t];return n||(n=r(D.bind(null,t)),O[t]=n),n}});String(Math.round(Math.random()*1e10));const A=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function j(){return!1}function M(){return!0}function N(e){return()=>{}}function P(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(N,j,M):o(A)}var F=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},I=class extends F{filter(e,t,n){let[r,i]=H(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},L=class extends F{};L.type=`header`;var R=class extends F{};R.type=`loader`;var z=class extends I{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};z.type=`item`;var B=class extends I{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};B.type=`section`;var V=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=H(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function H(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}var U=class{*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild??=e,this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,t){if(t==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=t,e.previousSibling=t.previousSibling,e.index=t.index-1,this.firstChild===t?this.firstChild=e:t.previousSibling&&(t.previousSibling.nextSibling=e),t.previousSibling=e,e.parentNode=t.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}},W=class e extends U{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof e?this.parentNode.level+ +(this.node?.type===`item`):0}getMutableNode(){return this.node==null?null:(this.isMutated||=(this.node=this.node.clone(),!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){let t=this.nextVisibleSibling,n=this.getMutableNode();if(n!=null&&(n.index=this.index,n.level=this.level,n.parentKey=this.parentNode instanceof e?this.parentNode.node?.key??null:null,n.prevKey=this.previousVisibleSibling?.node?.key??null,n.nextKey=t?.node?.key??null,n.hasChildNodes=!!this.firstChild,n.firstChildKey=this.firstVisibleChild?.node?.key??null,n.lastChildKey=this.lastVisibleChild?.node?.key??null,(n.colSpan!=null||n.colIndex!=null)&&t)){let e=(n.colIndex??n.index)+(n.colSpan??1);if(t.node!=null&&e!==t.node.colIndex){let n=t.getMutableNode();n.colIndex=e}}}setProps(e,t,n,r,i){let a,{value:o,textValue:s,id:c,...l}=e;if(this.node==null?(a=new n(c??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),l.ref=t,a.props=l,a.rendered=r,a.render=i,a.value=o,e[`aria-label`]&&(a[`aria-label`]=e[`aria-label`]),a.textValue=s||(typeof l.children==`string`?l.children:``)||e[`aria-label`]||``,c!=null&&c!==a.key)throw Error(`Cannot change the id of an item`);l.colSpan!=null&&(a.colSpan=l.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?`none`:``},set display(t){let n=t===`none`;if(e.isHidden!==n){(e.parentNode?.firstVisibleChild===e||e.parentNode?.lastVisibleChild===e)&&e.ownerDocument.markDirty(e.parentNode);let t=e.previousVisibleSibling,r=e.nextVisibleSibling;t&&e.ownerDocument.markDirty(t),r&&e.ownerDocument.markDirty(r),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,t){super(t),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},G=class extends U{get isConnected(){return!0}createElement(e){return new W(e,this)}getMutableCollection(){return this.nextCollection||=this.collection.clone(),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let t of e)this.addNode(t);t.addNode(e.node)}removeNode(e){for(let t of e)this.removeNode(t);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let e of this.dirtyNodes)e instanceof W&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof W?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}};function K(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,s=c(()=>new WeakMap,o);return c(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=s.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),s.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,s,i,a])}if(typeof HTMLTemplateElement<`u`){let e=Object.getOwnPropertyDescriptor(Node.prototype,`firstChild`).get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}const q=n(!1);function J(t){if(o(q))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(q.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}const Y=n(!1),X=n(null);function ue(t){if(o(X))return t.content;let{collection:n,document:r}=me(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(J,null,e.createElement(X.Provider,{value:r},t.content)),e.createElement(de,{render:t.children,collection:n}))}function de({collection:e,render:t}){return t(e)}function fe(e,t,n){let r=P(),i=l(r);i.current=r;let o=a(()=>i.current?n():t(),[t,n]);return d(e,o)}const pe=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:fe;function me(e){let[t]=u(()=>new G(e?.()||new V)),n=a(e=>t.subscribe(e),[t]),r=a(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),i=a(()=>(t.isSSR=!0,t.getCollection()),[t]);return{collection:pe(n,r,i),document:t}}const Z=n(null);function he(e){var t;return t=class extends F{},t.type=e,t}function ge(t,n,r,i,s,c){typeof t==`string`&&(t=he(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(Z);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(Z.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function _e(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(y);if(!o(Y)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return ge(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(y.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function ve(e){return K({...e,addIdAndValue:!0})}const ye=n(null);function be(t){let n=o(ye),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=ve({...t,idScope:i,dependencies:r});return o(X)&&(a=e.createElement(xe,null,a)),n=c(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(ye.Provider,{value:n},a)}function xe({children:t}){let n=o(X),r=c(()=>e.createElement(X.Provider,{value:null},e.createElement(Y.Provider,{value:!0},t)),[t]);return P()?e.createElement(Z.Provider,{value:n},r):ee(r,n)}const Se={CollectionRoot({collection:e,renderDropIndicator:t}){return Ce(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return Ce(e,t,n)}};function Ce(t,n,r){return K({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,we(t,n,r))}})}function we(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const Te=n(Se),Q=n({}),Ee=n(null),De=r(function(t,n){let{render:r}=o(Ee);return e.createElement(e.Fragment,null,r(t,n))});function Oe(t,n){let r=t?.renderDropIndicator,i=t?.isVirtualDragging?.call(t),o=a(t=>{if(i||n?.isDropTarget(t))return r?r(t):e.createElement(De,{target:t})},[n?.target,i,r]);return t?.useDropIndicator?o:void 0}function ke(e,t,n){let r=e.focusedKey,i=null;if(t!=null&&t.isVirtualDragging?.call(t)&&n?.target?.type===`item`&&(i=n.target.key,n.target.dropPosition===`after`)){let e=n.collection.getKeyAfter(i),t=null;if(e!=null){let r=n.collection.getItem(i)?.level??0;for(;e;){let i=n.collection.getItem(e);if(!i)break;if(i.type!==`item`){e=n.collection.getKeyAfter(e);continue}if((i.level??0)<=r)break;t=e,e=n.collection.getKeyAfter(e)}}i=e??t??i}return c(()=>new Set([r,i].filter(e=>e!=null)),[r,i])}const Ae=n(null);function je(t){let n=l({});return e.createElement(Ae.Provider,{value:n},t.children)}const $=n(null);_e(R,function(t,n,r){let i=o($),{isLoading:a,onLoadMore:s,scrollOffset:u,...d}=t,m=l(null),h=c(()=>({onLoadMore:s,collection:i?.collection,sentinelRef:m,scrollOffset:u}),[s,u,i?.collection]);_(h,m);let g=w({...d,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:p(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:m,style:{position:`absolute`,height:1,width:1}})),a&&g.children&&e.createElement(k.div,{...x(f(t,{global:!0}),{tabIndex:-1}),...g,role:`option`,ref:n},g.children))});const Me=n(null),Ne=r(function(t,n){return[t,n]=E(t,n,Me),e.createElement(ue,{content:e.createElement(be,t)},r=>e.createElement(Pe,{props:t,collection:r,gridListRef:n}))});function Pe({props:t,collection:n,gridListRef:r}){[t,r]=E(t,r,ce);let{shouldUseVirtualFocus:i,filter:a,disallowTypeAhead:u,...d}=t,{dragAndDropHooks:p,keyboardNavigationBehavior:m=`arrow`,layout:h=`stack`}=t,{CollectionRoot:g,isVirtualized:_,layoutDelegate:v,dropTargetDelegate:y}=o(Te),ee=se({...d,collection:n,children:void 0,layoutDelegate:v}),S=oe(ee,a),C=ne({usage:`search`,sensitivity:`base`}),{disabledBehavior:T,disabledKeys:D}=S.selectionManager,{direction:O}=ae(),A=c(()=>new b({collection:S.collection,collator:C,ref:r,disabledKeys:D,disabledBehavior:T,layoutDelegate:v,layout:h,direction:O}),[S.collection,r,h,D,T,v,C,O]),{gridProps:j}=ie({...d,keyboardDelegate:A,keyboardNavigationBehavior:h===`grid`?`tab`:m,isVirtualized:_,shouldSelectOnPressUp:t.shouldSelectOnPressUp,disallowTypeAhead:u},S,r),M=S.selectionManager,N=!!p?.useDraggableCollectionState,P=!!p?.useDroppableCollectionState;l(N),l(P),s(()=>{},[N,P]);let F,I,L,R=!1,z=null,B=l(null);if(N&&p){F=p.useDraggableCollectionState({collection:S.collection,selectionManager:M,preview:p.renderDragPreview?B:void 0}),p.useDraggableCollection({},F,r);let t=p.DragPreview;z=p.renderDragPreview?e.createElement(t,{ref:B},p.renderDragPreview):null}if(P&&p){I=p.useDroppableCollectionState({collection:S.collection,selectionManager:M});let e=new b({collection:S.collection,disabledKeys:M.disabledKeys,disabledBehavior:M.disabledBehavior,ref:r}),t=p.dropTargetDelegate||y||new p.ListDropTargetDelegate(n,r,{layout:h,direction:O});L=p.useDroppableCollection({keyboardDelegate:e,dropTargetDelegate:t},I,r),R=I.isDropTarget({type:`root`})}let{focusProps:V,isFocused:H,isFocusVisible:U}=re(),W=S.collection.size===0,G={isDropTarget:R,isEmpty:W,isFocused:H,isFocusVisible:U,layout:h,state:S},K=w({...t,children:void 0,defaultClassName:`react-aria-GridList`,values:G}),q=null;if(W&&t.renderEmptyState){let n=t.renderEmptyState(G);q=e.createElement(`div`,{role:`row`,"aria-rowindex":1,style:{display:`contents`}},e.createElement(`div`,{role:`gridcell`,style:{display:`contents`}},n))}let J=f(t,{global:!0});return e.createElement(te,null,e.createElement(k.div,{...x(J,K,j,V,L?.collectionProps,null),ref:r,slot:t.slot||void 0,onScroll:t.onScroll,"data-drop-target":R||void 0,"data-empty":W||void 0,"data-focused":H||void 0,"data-focus-visible":U||void 0,"data-layout":h},e.createElement(le,{values:[[$,S],[Q,{dragAndDropHooks:p,dragState:F,dropState:I}],[Ee,{render:Fe}]]},P&&e.createElement(Re,null),e.createElement(je,null,e.createElement(g,{collection:S.collection,scrollRef:r,persistedKeys:ke(M,p,I),renderDropIndicator:Oe(p,I)}))),q,z))}function Fe(t,n){n=v(n);let{dragAndDropHooks:r,dropState:i}=o(Q),a=l(null),{dropIndicatorProps:s,isHidden:c,isDropTarget:u}=r.useDropIndicator(t,i,a);return c?null:e.createElement(Le,{...t,dropIndicatorProps:s,isDropTarget:u,buttonRef:a,ref:n})}function Ie(t,n){let{dropIndicatorProps:r,isDropTarget:i,buttonRef:a,...o}=t,{visuallyHiddenProps:s}=S(),c=w({...o,defaultClassName:`react-aria-DropIndicator`,values:{isDropTarget:i}});return e.createElement(k.div,{...c,role:`row`,ref:n,"data-drop-target":i||void 0},e.createElement(`div`,{role:`gridcell`},e.createElement(`div`,{...s,role:`button`,...r,ref:a}),c.children))}const Le=r(Ie);function Re(){let{dragAndDropHooks:t,dropState:n}=o(Q),r=l(null),{dropIndicatorProps:i}=t.useDropIndicator({target:{type:`root`}},n,r),a=n.isDropTarget({type:`root`}),{visuallyHiddenProps:s}=S();return!a&&i[`aria-hidden`]?null:e.createElement(`div`,{role:`row`,"aria-hidden":i[`aria-hidden`],style:{position:`absolute`}},e.createElement(`div`,{role:`gridcell`},e.createElement(`div`,{role:`button`,...s,...i,ref:r})))}_e(R,function(t,n,r){let i=o($),{isVirtualized:a}=o(Te),{isLoading:s,onLoadMore:u,scrollOffset:d,...m}=t,h=l(null),g=c(()=>({onLoadMore:u,collection:i?.collection,sentinelRef:h,scrollOffset:d}),[u,d,i?.collection]);_(g,h);let v=w({...m,id:void 0,children:r.rendered,defaultClassName:`react-aria-GridListLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:p(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),s&&v.children&&e.createElement(k.div,{...v,...f(t,{global:!0}),role:`row`,ref:n},e.createElement(`div`,{"aria-colindex":a?1:void 0,role:`gridcell`},v.children)))});export{Ne as GridList};
|
|
1
|
+
import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useRef as l,useState as u,useSyncExternalStore as d}from"react";import{filterDOMProps as f,inertValue as p,mergeProps as m,mergeRefs as h,useLayoutEffect as g,useLoadMoreSentinel as _,useObjectRef as v}from"@react-aria/utils";import{FocusableContext as y}from"@react-aria/interactions";import{createPortal as b}from"react-dom";import{FocusScope as ee,ListKeyboardDelegate as x,mergeProps as te,useCollator as ne,useFocusRing as re,useGridList as ie,useLocale as ae,useVisuallyHidden as S}from"react-aria";import{UNSTABLE_useFilteredListState as oe,useListState as se}from"react-stately";n(null),n(null),n(null),n(null),n(null),n({});const ce=n(null);n(null);const C=Symbol(`default`);function le({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function w(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:l}=e;return c(()=>{let e,c,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,c=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:c||o?{...o,...c}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,s):void 0}},[t,n,r,i,a,o,s,l])}function T(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||C;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function E(e,t,n){let{ref:r,...i}=T(n,e.slot)||{},a=v(c(()=>h(t,r),[t,r])),o=m(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(o.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[o,a]}function D(t,n,r){let{render:i,...a}=n,o=l(null),s=c(()=>h(r,o),[r,o]);g(()=>{},[t,i]);let u={...a,ref:s};return i?i(u,void 0):e.createElement(t,u)}const O={},k=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=O[t];return n||(n=r(D.bind(null,t)),O[t]=n),n}});var A=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},j=class extends A{filter(e,t,n){let[r,i]=L(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},M=class extends A{};M.type=`header`;var N=class extends A{};N.type=`loader`;var P=class extends j{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};P.type=`item`;var F=class extends j{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};F.type=`section`;var I=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=L(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function L(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}var R=class{*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild??=e,this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,t){if(t==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=t,e.previousSibling=t.previousSibling,e.index=t.index-1,this.firstChild===t?this.firstChild=e:t.previousSibling&&(t.previousSibling.nextSibling=e),t.previousSibling=e,e.parentNode=t.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}},z=class e extends R{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof e?this.parentNode.level+ +(this.node?.type===`item`):0}getMutableNode(){return this.node==null?null:(this.isMutated||=(this.node=this.node.clone(),!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){let t=this.nextVisibleSibling,n=this.getMutableNode();if(n!=null&&(n.index=this.index,n.level=this.level,n.parentKey=this.parentNode instanceof e?this.parentNode.node?.key??null:null,n.prevKey=this.previousVisibleSibling?.node?.key??null,n.nextKey=t?.node?.key??null,n.hasChildNodes=!!this.firstChild,n.firstChildKey=this.firstVisibleChild?.node?.key??null,n.lastChildKey=this.lastVisibleChild?.node?.key??null,(n.colSpan!=null||n.colIndex!=null)&&t)){let e=(n.colIndex??n.index)+(n.colSpan??1);if(t.node!=null&&e!==t.node.colIndex){let n=t.getMutableNode();n.colIndex=e}}}setProps(e,t,n,r,i){let a,{value:o,textValue:s,id:c,...l}=e;if(this.node==null?(a=new n(c??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),l.ref=t,a.props=l,a.rendered=r,a.render=i,a.value=o,e[`aria-label`]&&(a[`aria-label`]=e[`aria-label`]),a.textValue=s||(typeof l.children==`string`?l.children:``)||e[`aria-label`]||``,c!=null&&c!==a.key)throw Error(`Cannot change the id of an item`);l.colSpan!=null&&(a.colSpan=l.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?`none`:``},set display(t){let n=t===`none`;if(e.isHidden!==n){(e.parentNode?.firstVisibleChild===e||e.parentNode?.lastVisibleChild===e)&&e.ownerDocument.markDirty(e.parentNode);let t=e.previousVisibleSibling,r=e.nextVisibleSibling;t&&e.ownerDocument.markDirty(t),r&&e.ownerDocument.markDirty(r),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,t){super(t),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},B=class extends R{get isConnected(){return!0}createElement(e){return new z(e,this)}getMutableCollection(){return this.nextCollection||=this.collection.clone(),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let t of e)this.addNode(t);t.addNode(e.node)}removeNode(e){for(let t of e)this.removeNode(t);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let e of this.dirtyNodes)e instanceof z&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof z?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}};function V(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,s=c(()=>new WeakMap,o);return c(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=s.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),s.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,s,i,a])}if(typeof HTMLTemplateElement<`u`){let e=Object.getOwnPropertyDescriptor(Node.prototype,`firstChild`).get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}const H=n(!1);function U(t){if(o(H))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(H.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}String(Math.round(Math.random()*1e10));const W=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function G(){return!1}function K(){return!0}function q(e){return()=>{}}function J(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(q,G,K):o(W)}const Y=n(!1),X=n(null);function ue(t){if(o(X))return t.content;let{collection:n,document:r}=me(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(U,null,e.createElement(X.Provider,{value:r},t.content)),e.createElement(de,{render:t.children,collection:n}))}function de({collection:e,render:t}){return t(e)}function fe(e,t,n){let r=J(),i=l(r);i.current=r;let o=a(()=>i.current?n():t(),[t,n]);return d(e,o)}const pe=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:fe;function me(e){let[t]=u(()=>new B(e?.()||new I)),n=a(e=>t.subscribe(e),[t]),r=a(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),i=a(()=>(t.isSSR=!0,t.getCollection()),[t]);return{collection:pe(n,r,i),document:t}}const Z=n(null);function he(e){var t;return t=class extends A{},t.type=e,t}function ge(t,n,r,i,s,c){typeof t==`string`&&(t=he(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(Z);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(Z.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function _e(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(y);if(!o(Y)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return ge(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(y.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function ve(e){return V({...e,addIdAndValue:!0})}const ye=n(null);function be(t){let n=o(ye),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=ve({...t,idScope:i,dependencies:r});return o(X)&&(a=e.createElement(xe,null,a)),n=c(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(ye.Provider,{value:n},a)}function xe({children:t}){let n=o(X),r=c(()=>e.createElement(X.Provider,{value:null},e.createElement(Y.Provider,{value:!0},t)),[t]);return J()?e.createElement(Z.Provider,{value:n},r):b(r,n)}const Se={CollectionRoot({collection:e,renderDropIndicator:t}){return Ce(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return Ce(e,t,n)}};function Ce(t,n,r){return V({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,we(t,n,r))}})}function we(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const Te=n(Se),Q=n({}),Ee=n(null),De=r(function(t,n){let{render:r}=o(Ee);return e.createElement(e.Fragment,null,r(t,n))});function Oe(t,n){let r=t?.renderDropIndicator,i=t?.isVirtualDragging?.call(t),o=a(t=>{if(i||n?.isDropTarget(t))return r?r(t):e.createElement(De,{target:t})},[n?.target,i,r]);return t?.useDropIndicator?o:void 0}function ke(e,t,n){let r=e.focusedKey,i=null;if(t!=null&&t.isVirtualDragging?.call(t)&&n?.target?.type===`item`&&(i=n.target.key,n.target.dropPosition===`after`)){let e=n.collection.getKeyAfter(i),t=null;if(e!=null){let r=n.collection.getItem(i)?.level??0;for(;e;){let i=n.collection.getItem(e);if(!i)break;if(i.type!==`item`){e=n.collection.getKeyAfter(e);continue}if((i.level??0)<=r)break;t=e,e=n.collection.getKeyAfter(e)}}i=e??t??i}return c(()=>new Set([r,i].filter(e=>e!=null)),[r,i])}const Ae=n(null);function je(t){let n=l({});return e.createElement(Ae.Provider,{value:n},t.children)}const $=n(null);_e(N,function(t,n,r){let i=o($),{isLoading:a,onLoadMore:s,scrollOffset:u,...d}=t,m=l(null),h=c(()=>({onLoadMore:s,collection:i?.collection,sentinelRef:m,scrollOffset:u}),[s,u,i?.collection]);_(h,m);let g=w({...d,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:p(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:m,style:{position:`absolute`,height:1,width:1}})),a&&g.children&&e.createElement(k.div,{...te(f(t,{global:!0}),{tabIndex:-1}),...g,role:`option`,ref:n},g.children))});const Me=n(null),Ne=r(function(t,n){return[t,n]=E(t,n,Me),e.createElement(ue,{content:e.createElement(be,t)},r=>e.createElement(Pe,{props:t,collection:r,gridListRef:n}))});function Pe({props:t,collection:n,gridListRef:r}){[t,r]=E(t,r,ce);let{shouldUseVirtualFocus:i,filter:a,disallowTypeAhead:u,...d}=t,{dragAndDropHooks:p,keyboardNavigationBehavior:m=`arrow`,layout:h=`stack`}=t,{CollectionRoot:g,isVirtualized:_,layoutDelegate:v,dropTargetDelegate:y}=o(Te),b=se({...d,collection:n,children:void 0,layoutDelegate:v}),S=oe(b,a),C=ne({usage:`search`,sensitivity:`base`}),{disabledBehavior:T,disabledKeys:D}=S.selectionManager,{direction:O}=ae(),A=c(()=>new x({collection:S.collection,collator:C,ref:r,disabledKeys:D,disabledBehavior:T,layoutDelegate:v,layout:h,direction:O}),[S.collection,r,h,D,T,v,C,O]),{gridProps:j}=ie({...d,keyboardDelegate:A,keyboardNavigationBehavior:h===`grid`?`tab`:m,isVirtualized:_,shouldSelectOnPressUp:t.shouldSelectOnPressUp,disallowTypeAhead:u},S,r),M=S.selectionManager,N=!!p?.useDraggableCollectionState,P=!!p?.useDroppableCollectionState;l(N),l(P),s(()=>{},[N,P]);let F,I,L,R=!1,z=null,B=l(null);if(N&&p){F=p.useDraggableCollectionState({collection:S.collection,selectionManager:M,preview:p.renderDragPreview?B:void 0}),p.useDraggableCollection({},F,r);let t=p.DragPreview;z=p.renderDragPreview?e.createElement(t,{ref:B},p.renderDragPreview):null}if(P&&p){I=p.useDroppableCollectionState({collection:S.collection,selectionManager:M});let e=new x({collection:S.collection,disabledKeys:M.disabledKeys,disabledBehavior:M.disabledBehavior,ref:r}),t=p.dropTargetDelegate||y||new p.ListDropTargetDelegate(n,r,{layout:h,direction:O});L=p.useDroppableCollection({keyboardDelegate:e,dropTargetDelegate:t},I,r),R=I.isDropTarget({type:`root`})}let{focusProps:V,isFocused:H,isFocusVisible:U}=re(),W=S.collection.size===0,G={isDropTarget:R,isEmpty:W,isFocused:H,isFocusVisible:U,layout:h,state:S},K=w({...t,children:void 0,defaultClassName:`react-aria-GridList`,values:G}),q=null;if(W&&t.renderEmptyState){let n=t.renderEmptyState(G);q=e.createElement(`div`,{role:`row`,"aria-rowindex":1,style:{display:`contents`}},e.createElement(`div`,{role:`gridcell`,style:{display:`contents`}},n))}let J=f(t,{global:!0});return e.createElement(ee,null,e.createElement(k.div,{...te(J,K,j,V,L?.collectionProps,null),ref:r,slot:t.slot||void 0,onScroll:t.onScroll,"data-drop-target":R||void 0,"data-empty":W||void 0,"data-focused":H||void 0,"data-focus-visible":U||void 0,"data-layout":h},e.createElement(le,{values:[[$,S],[Q,{dragAndDropHooks:p,dragState:F,dropState:I}],[Ee,{render:Fe}]]},P&&e.createElement(Re,null),e.createElement(je,null,e.createElement(g,{collection:S.collection,scrollRef:r,persistedKeys:ke(M,p,I),renderDropIndicator:Oe(p,I)}))),q,z))}function Fe(t,n){n=v(n);let{dragAndDropHooks:r,dropState:i}=o(Q),a=l(null),{dropIndicatorProps:s,isHidden:c,isDropTarget:u}=r.useDropIndicator(t,i,a);return c?null:e.createElement(Le,{...t,dropIndicatorProps:s,isDropTarget:u,buttonRef:a,ref:n})}function Ie(t,n){let{dropIndicatorProps:r,isDropTarget:i,buttonRef:a,...o}=t,{visuallyHiddenProps:s}=S(),c=w({...o,defaultClassName:`react-aria-DropIndicator`,values:{isDropTarget:i}});return e.createElement(k.div,{...c,role:`row`,ref:n,"data-drop-target":i||void 0},e.createElement(`div`,{role:`gridcell`},e.createElement(`div`,{...s,role:`button`,...r,ref:a}),c.children))}const Le=r(Ie);function Re(){let{dragAndDropHooks:t,dropState:n}=o(Q),r=l(null),{dropIndicatorProps:i}=t.useDropIndicator({target:{type:`root`}},n,r),a=n.isDropTarget({type:`root`}),{visuallyHiddenProps:s}=S();return!a&&i[`aria-hidden`]?null:e.createElement(`div`,{role:`row`,"aria-hidden":i[`aria-hidden`],style:{position:`absolute`}},e.createElement(`div`,{role:`gridcell`},e.createElement(`div`,{role:`button`,...s,...i,ref:r})))}_e(N,function(t,n,r){let i=o($),{isVirtualized:a}=o(Te),{isLoading:s,onLoadMore:u,scrollOffset:d,...m}=t,h=l(null),g=c(()=>({onLoadMore:u,collection:i?.collection,sentinelRef:h,scrollOffset:d}),[u,d,i?.collection]);_(g,h);let v=w({...m,id:void 0,children:r.rendered,defaultClassName:`react-aria-GridListLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:p(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),s&&v.children&&e.createElement(k.div,{...v,...f(t,{global:!0}),role:`row`,ref:n},e.createElement(`div`,{"aria-colindex":a?1:void 0,role:`gridcell`},v.children)))});export{Ne as GridList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useMemo as s,useRef as c}from"react";import{filterDOMProps as l,inertValue as u,mergeProps as d,mergeRefs as f,useLayoutEffect as p,useLoadMoreSentinel as m,useObjectRef as h}from"@react-aria/utils";import{FocusableContext as g}from"@react-aria/interactions";import"react-dom";import{mergeProps as _}from"react-aria";import"react-stately";const v=Symbol(`default`);function y(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:c,render:l}=e;return s(()=>{let e,s,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,s=typeof n==`function`?n({...c,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:a}):r??a,{className:e??i,style:s||o?{...o,...s}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,a,o,c,l])}function b(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||v;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function x(e,t,n){let{ref:r,...i}=b(n,e.slot)||{},a=h(s(()=>f(t,r),[t,r])),o=d(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(o.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[o,a]}function S(t,n,r){let{render:i,...a}=n,o=c(null),l=s(()=>f(r,o),[r,o]);p(()=>{},[t,i]);let u={...a,ref:l};return i?i(u,void 0):e.createElement(t,u)}const C={},w=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=C[t];return n||(n=r(S.bind(null,t)),C[t]=n),n}});
|
|
1
|
+
import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useMemo as s,useRef as c}from"react";import{filterDOMProps as l,inertValue as u,mergeProps as d,mergeRefs as f,useLayoutEffect as p,useLoadMoreSentinel as m,useObjectRef as h}from"@react-aria/utils";import{FocusableContext as g}from"@react-aria/interactions";import"react-dom";import{mergeProps as _}from"react-aria";import"react-stately";const v=Symbol(`default`);function y(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:c,render:l}=e;return s(()=>{let e,s,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,s=typeof n==`function`?n({...c,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:a}):r??a,{className:e??i,style:s||o?{...o,...s}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,a,o,c,l])}function b(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||v;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function x(e,t,n){let{ref:r,...i}=b(n,e.slot)||{},a=h(s(()=>f(t,r),[t,r])),o=d(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(o.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[o,a]}function S(t,n,r){let{render:i,...a}=n,o=c(null),l=s(()=>f(r,o),[r,o]);p(()=>{},[t,i]);let u={...a,ref:l};return i?i(u,void 0):e.createElement(t,u)}const C={},w=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=C[t];return n||(n=r(S.bind(null,t)),C[t]=n),n}});var T=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},E=class extends T{filter(e,t,n){let[r,i]=j(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},D=class extends T{};D.type=`header`;var O=class extends T{};O.type=`loader`;var k=class extends E{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};k.type=`item`;var A=class extends E{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};A.type=`section`;function j(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function M(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,c=s(()=>new WeakMap,o);return s(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=c.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),c.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,c,i,a])}String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;const N=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const P=n(null);function F(e){var t;return t=class extends T{},t.type=e,t}function I(t,n,r,i,s,c){typeof t==`string`&&(t=F(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(P);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(P.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function L(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(g);if(!o(N)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return I(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(g.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}const R={CollectionRoot({collection:e,renderDropIndicator:t}){return z(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return z(e,t,n)}};function z(t,n,r){return M({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,B(t,n,r))}})}function B(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const V=n(R),H=n(null);L(O,function(t,n,r){let i=o(H),{isLoading:a,onLoadMore:d,scrollOffset:f,...p}=t,h=c(null),g=s(()=>({onLoadMore:d,collection:i?.collection,sentinelRef:h,scrollOffset:f}),[d,f,i?.collection]);m(g,h);let v=y({...p,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),a&&v.children&&e.createElement(w.div,{..._(l(t,{global:!0}),{tabIndex:-1}),...v,role:`option`,ref:n},v.children))}),L(O,function(t,n,r){let i=o(H),{isVirtualized:a}=o(V),{isLoading:d,onLoadMore:f,scrollOffset:p,...h}=t,g=c(null),_=s(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:g,scrollOffset:p}),[f,p,i?.collection]);m(_,g);let v=y({...h,id:void 0,children:r.rendered,defaultClassName:`react-aria-GridListLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:g,style:{position:`absolute`,height:1,width:1}})),d&&v.children&&e.createElement(w.div,{...v,...l(t,{global:!0}),role:`row`,ref:n},e.createElement(`div`,{"aria-colindex":a?1:void 0,role:`gridcell`},v.children)))});const U=n({}),W=n(null),G=L(D,function(t,n){[t,n]=x(t,n,U);let r=o(W);return e.createElement(w.div,{render:t.render,className:`react-aria-GridListHeader`,ref:n,...t},e.createElement(`div`,{...r,style:{display:`contents`}},t.children))});export{G as GridListHeader};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useRef as l}from"react";import{filterDOMProps as u,inertValue as d,mergeRefs as f,useLayoutEffect as p,useLoadMoreSentinel as m,useObjectRef as h}from"@react-aria/utils";import{FocusableContext as g}from"@react-aria/interactions";import"react-dom";import{mergeProps as _,useFocusRing as v,useGridListItem as y,useGridListSelectionCheckbox as b,useHover as x,useVisuallyHidden as S}from"react-aria";import"react-stately";const C=n(null);n(null),n(null),n(null),n(null),n({});const w=n(null),T=n(null),E=Symbol(`default`);function D({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function O(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:l}=e;return c(()=>{let e,c,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,c=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:c||o?{...o,...c}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,s):void 0}},[t,n,r,i,a,o,s,l])}function k(t,n,r){let{render:i,...a}=n,o=l(null),s=c(()=>f(r,o),[r,o]);p(()=>{},[t,i]);let u={...a,ref:s};return i?i(u,void 0):e.createElement(t,u)}const A={},j=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=A[t];return n||(n=r(k.bind(null,t)),A[t]=n),n}});
|
|
1
|
+
import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useRef as l}from"react";import{filterDOMProps as u,inertValue as d,mergeRefs as f,useLayoutEffect as p,useLoadMoreSentinel as m,useObjectRef as h}from"@react-aria/utils";import{FocusableContext as g}from"@react-aria/interactions";import"react-dom";import{mergeProps as _,useFocusRing as v,useGridListItem as y,useGridListSelectionCheckbox as b,useHover as x,useVisuallyHidden as S}from"react-aria";import"react-stately";const C=n(null);n(null),n(null),n(null),n(null),n({});const w=n(null),T=n(null),E=Symbol(`default`);function D({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function O(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:l}=e;return c(()=>{let e,c,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,c=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:c||o?{...o,...c}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,s):void 0}},[t,n,r,i,a,o,s,l])}function k(t,n,r){let{render:i,...a}=n,o=l(null),s=c(()=>f(r,o),[r,o]);p(()=>{},[t,i]);let u={...a,ref:s};return i?i(u,void 0):e.createElement(t,u)}const A={},j=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=A[t];return n||(n=r(k.bind(null,t)),A[t]=n),n}});var M=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},N=class extends M{filter(e,t,n){let[r,i]=R(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},P=class extends M{};P.type=`header`;var F=class extends M{};F.type=`loader`;var I=class extends N{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};I.type=`item`;var L=class extends N{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};L.type=`section`;function R(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function z(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,s=c(()=>new WeakMap,o);return c(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=s.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),s.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,s,i,a])}String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;const B=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const V=n(null);function H(e){var t;return t=class extends M{},t.type=e,t}function U(t,n,r,i,s,c){typeof t==`string`&&(t=H(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(V);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(V.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function W(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(g);if(!o(B)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return U(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(g.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}const G={CollectionRoot({collection:e,renderDropIndicator:t}){return K(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return K(e,t,n)}};function K(t,n,r){return z({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,q(t,n,r))}})}function q(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const J=n(G),Y=n({}),X=n({}),Z=n({}),Q=n({isSelected:!1}),$=n(null);W(F,function(t,n,r){let i=o($),{isLoading:a,onLoadMore:s,scrollOffset:f,...p}=t,h=l(null),g=c(()=>({onLoadMore:s,collection:i?.collection,sentinelRef:h,scrollOffset:f}),[s,f,i?.collection]);m(g,h);let v=O({...p,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:d(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),a&&v.children&&e.createElement(j.div,{..._(u(t,{global:!0}),{tabIndex:-1}),...v,role:`option`,ref:n},v.children))});const ee=W(I,function(t,n,r){let i=o($),{dragAndDropHooks:a,dragState:c,dropState:d}=o(Z),f=h(n),{isVirtualized:p}=o(J),{rowProps:m,gridCellProps:g,descriptionProps:k,...A}=y({node:r,shouldSelectOnPressUp:!!c,isVirtualized:p},i,f),{hoverProps:M,isHovered:N}=x({isDisabled:!A.allowsSelection&&!A.hasAction,onHoverStart:r.props.onHoverStart,onHoverChange:r.props.onHoverChange,onHoverEnd:r.props.onHoverEnd}),{isFocusVisible:P,focusProps:F}=v(),{checkboxProps:I}=b({key:r.key},i),L=i.selectionManager.disabledBehavior===`all`&&A.isDisabled?{isDisabled:!0}:{},R=null;c&&a&&(R=a.useDraggableItem({key:r.key,hasDragButton:!0},c));let z=null,B=l(null),{visuallyHiddenProps:V}=S();d&&a&&(z=a.useDropIndicator({target:{type:`item`,key:r.key,dropPosition:`on`}},d,B));let H=c&&c.isDragging(r.key),U=O({...t,id:void 0,children:r.rendered,defaultClassName:`react-aria-GridListItem`,values:{...A,isHovered:N,isFocusVisible:P,selectionMode:i.selectionManager.selectionMode,selectionBehavior:i.selectionManager.selectionBehavior,allowsDragging:!!c,isDragging:H,isDropTarget:z?.isDropTarget}}),W=l(null);s(()=>{c&&!W.current&&console.warn(`Draggable items in a GridList must contain a <Button slot="drag"> element so that keyboard and screen reader users can drag them.`)},[]),s(()=>{r.textValue},[r.textValue]);let K=u(t,{global:!0});return delete K.id,delete K.onClick,e.createElement(e.Fragment,null,z&&!z.isHidden&&e.createElement(`div`,{role:`row`,style:{position:`absolute`}},e.createElement(`div`,{role:`gridcell`},e.createElement(`div`,{role:`button`,...V,...z?.dropIndicatorProps,ref:B}))),e.createElement(j.div,{..._(K,U,m,F,M,R?.dragProps),ref:f,"data-selected":A.isSelected||void 0,"data-disabled":A.isDisabled||void 0,"data-hovered":N||void 0,"data-focused":A.isFocused||void 0,"data-focus-visible":P||void 0,"data-pressed":A.isPressed||void 0,"data-allows-dragging":!!c||void 0,"data-dragging":H||void 0,"data-drop-target":z?.isDropTarget||void 0,"data-selection-mode":i.selectionManager.selectionMode===`none`?void 0:i.selectionManager.selectionMode},e.createElement(`div`,{...g,style:{display:`contents`}},e.createElement(D,{values:[[C,{slots:{[E]:{},selection:I}}],[Y,{slots:{[E]:L,drag:{...R?.dragButtonProps,ref:W,style:{pointerEvents:`none`}}}}],[X,{slots:{[E]:{},description:k}}],[J,G],[$,null],[w,null],[T,null],[Q,{isSelected:A.isSelected}]]},U.children))))});W(F,function(t,n,r){let i=o($),{isVirtualized:a}=o(J),{isLoading:s,onLoadMore:f,scrollOffset:p,...h}=t,g=l(null),_=c(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:g,scrollOffset:p}),[f,p,i?.collection]);m(_,g);let v=O({...h,id:void 0,children:r.rendered,defaultClassName:`react-aria-GridListLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:d(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:g,style:{position:`absolute`,height:1,width:1}})),s&&v.children&&e.createElement(j.div,{...v,...u(t,{global:!0}),role:`row`,ref:n},e.createElement(`div`,{"aria-colindex":a?1:void 0,role:`gridcell`},v.children)))});export{ee as GridListItem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useMemo as s,useRef as c}from"react";import{filterDOMProps as l,inertValue as u,mergeRefs as d,useLayoutEffect as f,useLoadMoreSentinel as p}from"@react-aria/utils";import{FocusableContext as m}from"@react-aria/interactions";import"react-dom";import{mergeProps as h}from"react-aria";import"react-stately";function g(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:c,render:l}=e;return s(()=>{let e,s,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,s=typeof n==`function`?n({...c,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:a}):r??a,{className:e??i,style:s||o?{...o,...s}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,a,o,c,l])}function _(t,n,r){let{render:i,...a}=n,o=c(null),l=s(()=>d(r,o),[r,o]);f(()=>{},[t,i]);let u={...a,ref:l};return i?i(u,void 0):e.createElement(t,u)}const v={},y=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=v[t];return n||(n=r(_.bind(null,t)),v[t]=n),n}});
|
|
1
|
+
import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useMemo as s,useRef as c}from"react";import{filterDOMProps as l,inertValue as u,mergeRefs as d,useLayoutEffect as f,useLoadMoreSentinel as p}from"@react-aria/utils";import{FocusableContext as m}from"@react-aria/interactions";import"react-dom";import{mergeProps as h}from"react-aria";import"react-stately";function g(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:c,render:l}=e;return s(()=>{let e,s,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,s=typeof n==`function`?n({...c,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:a}):r??a,{className:e??i,style:s||o?{...o,...s}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,a,o,c,l])}function _(t,n,r){let{render:i,...a}=n,o=c(null),l=s(()=>d(r,o),[r,o]);f(()=>{},[t,i]);let u={...a,ref:l};return i?i(u,void 0):e.createElement(t,u)}const v={},y=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=v[t];return n||(n=r(_.bind(null,t)),v[t]=n),n}});var b=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},x=class extends b{filter(e,t,n){let[r,i]=E(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},S=class extends b{};S.type=`header`;var C=class extends b{};C.type=`loader`;var w=class extends x{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};w.type=`item`;var T=class extends x{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};T.type=`section`;function E(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function D(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,c=s(()=>new WeakMap,o);return s(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=c.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),c.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,c,i,a])}String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;const O=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const k=n(null);function A(e){var t;return t=class extends b{},t.type=e,t}function j(t,n,r,i,s,c){typeof t==`string`&&(t=A(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(k);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(k.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function M(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(m);if(!o(O)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return j(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(m.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}const N={CollectionRoot({collection:e,renderDropIndicator:t}){return P(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return P(e,t,n)}};function P(t,n,r){return D({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,F(t,n,r))}})}function F(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const I=n(N),L=n(null);M(C,function(t,n,r){let i=o(L),{isLoading:a,onLoadMore:d,scrollOffset:f,...m}=t,_=c(null),v=s(()=>({onLoadMore:d,collection:i?.collection,sentinelRef:_,scrollOffset:f}),[d,f,i?.collection]);p(v,_);let b=g({...m,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:_,style:{position:`absolute`,height:1,width:1}})),a&&b.children&&e.createElement(y.div,{...h(l(t,{global:!0}),{tabIndex:-1}),...b,role:`option`,ref:n},b.children))});const R=M(C,function(t,n,r){let i=o(L),{isVirtualized:a}=o(I),{isLoading:d,onLoadMore:f,scrollOffset:m,...h}=t,_=c(null),v=s(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:_,scrollOffset:m}),[f,m,i?.collection]);p(v,_);let b=g({...h,id:void 0,children:r.rendered,defaultClassName:`react-aria-GridListLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:_,style:{position:`absolute`,height:1,width:1}})),d&&b.children&&e.createElement(y.div,{...b,...l(t,{global:!0}),role:`row`,ref:n},e.createElement(`div`,{"aria-colindex":a?1:void 0,role:`gridcell`},b.children)))});export{R as GridListLoadMoreItem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useMemo as s,useRef as c}from"react";import{filterDOMProps as l,inertValue as u,mergeRefs as d,useLayoutEffect as f,useLoadMoreSentinel as p,useObjectRef as m}from"@react-aria/utils";import{FocusableContext as h}from"@react-aria/interactions";import"react-dom";import{mergeProps as g,useGridListSection as _}from"react-aria";import"react-stately";function v({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function y(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:c,render:l}=e;return s(()=>{let e,s,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,s=typeof n==`function`?n({...c,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:a}):r??a,{className:e??i,style:s||o?{...o,...s}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,a,o,c,l])}function b(t,n,r){let{render:i,...a}=n,o=c(null),l=s(()=>d(r,o),[r,o]);f(()=>{},[t,i]);let u={...a,ref:l};return i?i(u,void 0):e.createElement(t,u)}const x={},S=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=x[t];return n||(n=r(b.bind(null,t)),x[t]=n),n}});
|
|
1
|
+
import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useMemo as s,useRef as c}from"react";import{filterDOMProps as l,inertValue as u,mergeRefs as d,useLayoutEffect as f,useLoadMoreSentinel as p,useObjectRef as m}from"@react-aria/utils";import{FocusableContext as h}from"@react-aria/interactions";import"react-dom";import{mergeProps as g,useGridListSection as _}from"react-aria";import"react-stately";function v({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function y(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:c,render:l}=e;return s(()=>{let e,s,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,s=typeof n==`function`?n({...c,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:a}):r??a,{className:e??i,style:s||o?{...o,...s}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,a,o,c,l])}function b(t,n,r){let{render:i,...a}=n,o=c(null),l=s(()=>d(r,o),[r,o]);f(()=>{},[t,i]);let u={...a,ref:l};return i?i(u,void 0):e.createElement(t,u)}const x={},S=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=x[t];return n||(n=r(b.bind(null,t)),x[t]=n),n}});var C=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},w=class extends C{filter(e,t,n){let[r,i]=k(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},T=class extends C{};T.type=`header`;var E=class extends C{};E.type=`loader`;var D=class extends w{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};D.type=`item`;var O=class extends w{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};O.type=`section`;function k(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function A(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,c=s(()=>new WeakMap,o);return s(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=c.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),c.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,c,i,a])}String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;const j=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const M=n(null);function N(e){var t;return t=class extends C{},t.type=e,t}function P(t,n,r,i,s,c){typeof t==`string`&&(t=N(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(M);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(M.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function F(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(h);if(!o(j)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return P(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(h.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function I(t,n,i=L){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>P(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function L(e){return A({...e,addIdAndValue:!0})}const R={CollectionRoot({collection:e,renderDropIndicator:t}){return z(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return z(e,t,n)}};function z(t,n,r){return A({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,B(t,n,r))}})}function B(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const V=n(R),H=n(null);F(E,function(t,n,r){let i=o(H),{isLoading:a,onLoadMore:d,scrollOffset:f,...m}=t,h=c(null),_=s(()=>({onLoadMore:d,collection:i?.collection,sentinelRef:h,scrollOffset:f}),[d,f,i?.collection]);p(_,h);let v=y({...m,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),a&&v.children&&e.createElement(S.div,{...g(l(t,{global:!0}),{tabIndex:-1}),...v,role:`option`,ref:n},v.children))}),F(E,function(t,n,r){let i=o(H),{isVirtualized:a}=o(V),{isLoading:d,onLoadMore:f,scrollOffset:m,...h}=t,g=c(null),_=s(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:g,scrollOffset:m}),[f,m,i?.collection]);p(_,g);let v=y({...h,id:void 0,children:r.rendered,defaultClassName:`react-aria-GridListLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:g,style:{position:`absolute`,height:1,width:1}})),d&&v.children&&e.createElement(S.div,{...v,...l(t,{global:!0}),role:`row`,ref:n},e.createElement(`div`,{"aria-colindex":a?1:void 0,role:`gridcell`},v.children)))});const U=I(O,(t,n,r)=>{let i=o(H),{CollectionBranch:a}=o(V),s=c(null);n=m(n);let{rowHeaderProps:u,rowProps:d,rowGroupProps:f}=_({"aria-label":t[`aria-label`]??void 0},i,n),p=y({...t,id:void 0,children:void 0,defaultClassName:`react-aria-GridListSection`,values:void 0}),h=l(t,{global:!0});return delete h.id,e.createElement(S.div,{...g(h,p,f),ref:n},e.createElement(v,{values:[[W,{...d,ref:s}],[G,{...u}]]},e.createElement(a,{collection:i.collection,parent:r})))}),W=n({}),G=n(null);export{U as GridListSection};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useMemo as a,useRef as o}from"react";import{mergeProps as s,mergeRefs as c,useLayoutEffect as l,useObjectRef as u}from"@react-aria/utils";import{FocusableContext as d}from"@react-aria/interactions";import"react-dom";const f=Symbol(`default`);function p(e,t){let n=i(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||f;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function m(e,t,n){let{ref:r,...i}=p(n,e.slot)||{},o=u(a(()=>c(t,r),[t,r])),l=s(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(l.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[l,o]}function h(t,n,r){let{render:i,...s}=n,u=o(null),d=a(()=>c(r,u),[r,u]);l(()=>{},[t,i]);let f={...s,ref:d};return i?i(f,void 0):e.createElement(t,f)}const g={},_=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=g[t];return r||(r=n(h.bind(null,t)),g[t]=r),r}});
|
|
1
|
+
import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useMemo as a,useRef as o}from"react";import{mergeProps as s,mergeRefs as c,useLayoutEffect as l,useObjectRef as u}from"@react-aria/utils";import{FocusableContext as d}from"@react-aria/interactions";import"react-dom";const f=Symbol(`default`);function p(e,t){let n=i(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||f;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function m(e,t,n){let{ref:r,...i}=p(n,e.slot)||{},o=u(a(()=>c(t,r),[t,r])),l=s(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(l.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[l,o]}function h(t,n,r){let{render:i,...s}=n,u=o(null),d=a(()=>c(r,u),[r,u]);l(()=>{},[t,i]);let f={...s,ref:d};return i?i(f,void 0):e.createElement(t,f)}const g={},_=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=g[t];return r||(r=n(h.bind(null,t)),g[t]=r),r}});var v=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},y=class extends v{filter(e,t,n){let[r,i]=w(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},b=class extends v{};b.type=`header`;var x=class extends v{};x.type=`loader`;var S=class extends y{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};S.type=`item`;var C=class extends y{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};C.type=`section`;function w(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;const T=t(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const E=t(null);function D(e){var t;return t=class extends v{},t.type=e,t}function O(t,n,a,o,s,c){typeof t==`string`&&(t=D(t));let l=r(e=>{e?.setProps(n,a,t,o,c)},[n,a,o,c,t]),u=i(E);if(u){let r=u.ownerDocument.nodesByProps.get(n);return r||(r=u.ownerDocument.createElement(t.type),r.setProps(n,a,t,o,c),u.appendChild(r),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,r)),s?e.createElement(E.Provider,{value:r},s):null}return e.createElement(t.type,{ref:l},s)}function k(t,r){let a=({node:e})=>r(e.props,e.props.ref,e),o=n((n,o)=>{let s=i(d);if(!i(T)){if(r.length>=3)throw Error(r.name+` cannot be rendered outside a collection.`);return r(n,o)}return O(t,n,o,`children`in n?n.children:null,null,t=>e.createElement(d.Provider,{value:s},e.createElement(a,{node:t})))});return o.displayName=r.name,o}const A=t({}),j=k(b,function(t,n){return[t,n]=m(t,n,A),e.createElement(_.header,{className:`react-aria-Header`,...t,ref:n},t.children)});export{j as Header};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I18nProvider as e}from"react-aria";import"react-stately";export{e as I18nProvider};
|
|
1
|
+
import{I18nProvider as e}from"react-aria";import"react-stately";import"@react-aria/dnd";export{e as I18nProvider};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as IconButtonProps, t as IconButton } from "../IconButton-
|
|
1
|
+
import { n as IconButtonProps, t as IconButton } from "../IconButton-Drlnq7ik.js";
|
|
2
2
|
export { IconButton, IconButtonProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as InlineIconButtonProps, t as InlineIconButton } from "../InlineIconButton-
|
|
1
|
+
import { n as InlineIconButtonProps, t as InlineIconButton } from "../InlineIconButton-C7_CmWFj.js";
|
|
2
2
|
export { InlineIconButton, InlineIconButtonProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as InputUploadBaseProps, r as InputUploadProps, t as InputUpload } from "../InputUpload-
|
|
1
|
+
import { n as InputUploadBaseProps, r as InputUploadProps, t as InputUpload } from "../InputUpload-BZqamXus.js";
|
|
2
2
|
export { InputUpload, type InputUploadBaseProps, type InputUploadProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as LinkNavigationProps, r as LinkProps, t as Link } from "../Link-
|
|
1
|
+
import { n as LinkNavigationProps, r as LinkProps, t as Link } from "../Link-D85-7S3h.js";
|
|
2
2
|
export { Link, type LinkNavigationProps, type LinkProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useRef as l,useState as u,useSyncExternalStore as d}from"react";import{filterDOMProps as f,inertValue as p,mergeProps as m,mergeRefs as h,useLayoutEffect as g,useLoadMoreSentinel as _,useObjectRef as v}from"@react-aria/utils";import{FocusableContext as y}from"@react-aria/interactions";import{createPortal as b}from"react-dom";import{FocusScope as ee,ListKeyboardDelegate as te,mergeProps as x,useCollator as ne,useFocusRing as re,useListBox as ie,useListBoxSection as S,useLocale as ae}from"react-aria";import{UNSTABLE_useFilteredListState as oe,useListState as se}from"react-stately";n(null),n(null),n(null),n(null),n(null),n({});const ce=n(null);n(null);const C=Symbol(`default`);function le({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function w(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:l}=e;return c(()=>{let e,c,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,c=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:c||o?{...o,...c}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,s):void 0}},[t,n,r,i,a,o,s,l])}function T(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||C;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function E(e,t,n){let{ref:r,...i}=T(n,e.slot)||{},a=v(c(()=>h(t,r),[t,r])),o=m(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(o.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[o,a]}function D(e=!0){let[t,n]=u(e),r=l(!1),i=a(e=>{r.current=!0,n(!!e)},[]);return g(()=>{r.current||n(!1)},[]),[i,t]}function O(t,n,r){let{render:i,...a}=n,o=l(null),s=c(()=>h(r,o),[r,o]);g(()=>{},[t,i]);let u={...a,ref:s};return i?i(u,void 0):e.createElement(t,u)}const k={},A=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=k[t];return n||(n=r(O.bind(null,t)),k[t]=n),n}});String(Math.round(Math.random()*1e10));const j=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function M(){return!1}function N(){return!0}function P(e){return()=>{}}function F(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(P,M,N):o(j)}var I=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},L=class extends I{filter(e,t,n){let[r,i]=U(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},R=class extends I{};R.type=`header`;var z=class extends I{};z.type=`loader`;var B=class extends L{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};B.type=`item`;var V=class extends L{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};V.type=`section`;var H=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=U(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function U(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}var W=class{*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild??=e,this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,t){if(t==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=t,e.previousSibling=t.previousSibling,e.index=t.index-1,this.firstChild===t?this.firstChild=e:t.previousSibling&&(t.previousSibling.nextSibling=e),t.previousSibling=e,e.parentNode=t.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}},G=class e extends W{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof e?this.parentNode.level+ +(this.node?.type===`item`):0}getMutableNode(){return this.node==null?null:(this.isMutated||=(this.node=this.node.clone(),!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){let t=this.nextVisibleSibling,n=this.getMutableNode();if(n!=null&&(n.index=this.index,n.level=this.level,n.parentKey=this.parentNode instanceof e?this.parentNode.node?.key??null:null,n.prevKey=this.previousVisibleSibling?.node?.key??null,n.nextKey=t?.node?.key??null,n.hasChildNodes=!!this.firstChild,n.firstChildKey=this.firstVisibleChild?.node?.key??null,n.lastChildKey=this.lastVisibleChild?.node?.key??null,(n.colSpan!=null||n.colIndex!=null)&&t)){let e=(n.colIndex??n.index)+(n.colSpan??1);if(t.node!=null&&e!==t.node.colIndex){let n=t.getMutableNode();n.colIndex=e}}}setProps(e,t,n,r,i){let a,{value:o,textValue:s,id:c,...l}=e;if(this.node==null?(a=new n(c??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),l.ref=t,a.props=l,a.rendered=r,a.render=i,a.value=o,e[`aria-label`]&&(a[`aria-label`]=e[`aria-label`]),a.textValue=s||(typeof l.children==`string`?l.children:``)||e[`aria-label`]||``,c!=null&&c!==a.key)throw Error(`Cannot change the id of an item`);l.colSpan!=null&&(a.colSpan=l.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?`none`:``},set display(t){let n=t===`none`;if(e.isHidden!==n){(e.parentNode?.firstVisibleChild===e||e.parentNode?.lastVisibleChild===e)&&e.ownerDocument.markDirty(e.parentNode);let t=e.previousVisibleSibling,r=e.nextVisibleSibling;t&&e.ownerDocument.markDirty(t),r&&e.ownerDocument.markDirty(r),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,t){super(t),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},ue=class extends W{get isConnected(){return!0}createElement(e){return new G(e,this)}getMutableCollection(){return this.nextCollection||=this.collection.clone(),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let t of e)this.addNode(t);t.addNode(e.node)}removeNode(e){for(let t of e)this.removeNode(t);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let e of this.dirtyNodes)e instanceof G&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof G?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}};function K(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,s=c(()=>new WeakMap,o);return c(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=s.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),s.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,s,i,a])}if(typeof HTMLTemplateElement<`u`){let e=Object.getOwnPropertyDescriptor(Node.prototype,`firstChild`).get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}const q=n(!1);function de(t){if(o(q))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(q.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}const fe=n(!1),J=n(null);function pe(t){if(o(J))return t.content;let{collection:n,document:r}=_e(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(de,null,e.createElement(J.Provider,{value:r},t.content)),e.createElement(me,{render:t.children,collection:n}))}function me({collection:e,render:t}){return t(e)}function he(e,t,n){let r=F(),i=l(r);i.current=r;let o=a(()=>i.current?n():t(),[t,n]);return d(e,o)}const ge=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:he;function _e(e){let[t]=u(()=>new ue(e?.()||new H)),n=a(e=>t.subscribe(e),[t]),r=a(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),i=a(()=>(t.isSSR=!0,t.getCollection()),[t]);return{collection:ge(n,r,i),document:t}}const Y=n(null);function ve(e){var t;return t=class extends I{},t.type=e,t}function ye(t,n,r,i,s,c){typeof t==`string`&&(t=ve(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(Y);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(Y.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function be(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(y);if(!o(fe)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return ye(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(y.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function xe(e){return K({...e,addIdAndValue:!0})}const Se=n(null);function Ce(t){let n=o(Se),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=xe({...t,idScope:i,dependencies:r});return o(J)&&(a=e.createElement(we,null,a)),n=c(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(Se.Provider,{value:n},a)}function we({children:t}){let n=o(J),r=c(()=>e.createElement(J.Provider,{value:null},e.createElement(fe.Provider,{value:!0},t)),[t]);return F()?e.createElement(Y.Provider,{value:n},r):b(r,n)}const Te=n(null),Ee={CollectionRoot({collection:e,renderDropIndicator:t}){return De(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return De(e,t,n)}};function De(t,n,r){return K({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,Oe(t,n,r))}})}function Oe(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const X=n(Ee),Z=n({}),ke=n(null),Ae=r(function(t,n){let{render:r}=o(ke);return e.createElement(e.Fragment,null,r(t,n))});function je(t,n){let r=t?.renderDropIndicator,i=t?.isVirtualDragging?.call(t),o=a(t=>{if(i||n?.isDropTarget(t))return r?r(t):e.createElement(Ae,{target:t})},[n?.target,i,r]);return t?.useDropIndicator?o:void 0}function Me(e,t,n){let r=e.focusedKey,i=null;if(t!=null&&t.isVirtualDragging?.call(t)&&n?.target?.type===`item`&&(i=n.target.key,n.target.dropPosition===`after`)){let e=n.collection.getKeyAfter(i),t=null;if(e!=null){let r=n.collection.getItem(i)?.level??0;for(;e;){let i=n.collection.getItem(e);if(!i)break;if(i.type!==`item`){e=n.collection.getKeyAfter(e);continue}if((i.level??0)<=r)break;t=e,e=n.collection.getKeyAfter(e)}}i=e??t??i}return c(()=>new Set([r,i].filter(e=>e!=null)),[r,i])}const Ne=n({}),Pe=n(null);function Fe(t){let n=l({});return e.createElement(Pe.Provider,{value:n},t.children)}const Ie=n({});var Le=class extends I{filter(e,t){let n=t.getItem(this.prevKey);if(n&&n.type!==`separator`){let n=this.clone();return t.addDescendants(n,e),n}return null}};Le.type=`separator`;const Re=n(null),Q=n(null),ze=r(function(t,n){[t,n]=E(t,n,Re);let r=o(Q);return r?e.createElement($,{state:r,props:t,listBoxRef:n}):e.createElement(pe,{content:e.createElement(Ce,t)},r=>e.createElement(Be,{props:t,listBoxRef:n,collection:r}))});function Be({props:t,listBoxRef:n,collection:r}){t={...t,collection:r,children:null,items:null};let{layoutDelegate:i}=o(X),a=se({...t,layoutDelegate:i});return e.createElement($,{state:a,props:t,listBoxRef:n})}function $({state:t,props:n,listBoxRef:r}){[n,r]=E(n,r,ce);let{dragAndDropHooks:i,layout:a=`stack`,orientation:u=`vertical`,filter:d}=n,p=oe(t,d),{collection:m,selectionManager:h}=p,g=!!i?.useDraggableCollectionState,_=!!i?.useDroppableCollectionState,{direction:v}=ae(),{disabledBehavior:y,disabledKeys:b}=h,S=ne({usage:`search`,sensitivity:`base`}),{isVirtualized:se,layoutDelegate:C,dropTargetDelegate:T,CollectionRoot:D}=o(X),O=c(()=>n.keyboardDelegate||new te({collection:m,collator:S,ref:r,disabledKeys:b,disabledBehavior:y,layout:a,orientation:u,direction:v,layoutDelegate:C}),[m,S,r,y,b,u,v,n.keyboardDelegate,a,C]),{listBoxProps:k}=ie({...n,shouldSelectOnPressUp:g||n.shouldSelectOnPressUp,keyboardDelegate:O,isVirtualized:se},p,r);l(g),l(_),s(()=>{},[g,_]);let j,M,N,P=!1,F=null,I=l(null);if(g&&i){j=i.useDraggableCollectionState({collection:m,selectionManager:h,preview:i.renderDragPreview?I:void 0}),i.useDraggableCollection({},j,r);let t=i.DragPreview;F=i.renderDragPreview?e.createElement(t,{ref:I},i.renderDragPreview):null}if(_&&i){M=i.useDroppableCollectionState({collection:m,selectionManager:h});let e=i.dropTargetDelegate||T||new i.ListDropTargetDelegate(m,r,{orientation:u,layout:a,direction:v});N=i.useDroppableCollection({keyboardDelegate:O,dropTargetDelegate:e},M,r),P=M.isDropTarget({type:`root`})}let{focusProps:L,isFocused:R,isFocusVisible:z}=re(),B=p.collection.size===0,V={isDropTarget:P,isEmpty:B,isFocused:R,isFocusVisible:z,layout:n.layout||`stack`,state:p},H=w({...n,children:void 0,defaultClassName:`react-aria-ListBox`,values:V}),U=null;B&&n.renderEmptyState&&(U=e.createElement(`div`,{role:`option`,style:{display:`contents`}},n.renderEmptyState(V)));let W=f(n,{global:!0});return e.createElement(ee,null,e.createElement(A.div,{...x(W,H,k,L,N?.collectionProps),ref:r,slot:n.slot||void 0,onScroll:n.onScroll,"data-drop-target":P||void 0,"data-empty":B||void 0,"data-focused":R||void 0,"data-focus-visible":z||void 0,"data-layout":n.layout||`stack`,"data-orientation":n.orientation||`vertical`},e.createElement(le,{values:[[Re,n],[Q,p],[Z,{dragAndDropHooks:i,dragState:j,dropState:M}],[Ie,{elementType:`div`}],[ke,{render:He}],[Te,{name:`ListBoxSection`,render:Ve}]]},e.createElement(Fe,null,e.createElement(D,{collection:m,scrollRef:r,persistedKeys:Me(h,i,M),renderDropIndicator:je(i,M)}))),U,F))}function Ve(t,n,r,i=`react-aria-ListBoxSection`){let a=o(Q),{dragAndDropHooks:s,dropState:c}=o(Z),{CollectionBranch:l}=o(X),[u,d]=D(),{headingProps:p,groupProps:m}=S({heading:d,"aria-label":t[`aria-label`]??void 0}),h=w({...t,id:void 0,children:void 0,defaultClassName:i,values:void 0}),g=f(t,{global:!0});return delete g.id,e.createElement(A.section,{...x(g,h,m),ref:n},e.createElement(Ne.Provider,{value:{...p,ref:u}},e.createElement(l,{collection:a.collection,parent:r,renderDropIndicator:je(s,c)})))}function He(t,n){n=v(n);let{dragAndDropHooks:r,dropState:i}=o(Z),{dropIndicatorProps:a,isHidden:s,isDropTarget:c}=r.useDropIndicator(t,i,n);return s?null:e.createElement(We,{...t,dropIndicatorProps:a,isDropTarget:c,ref:n})}function Ue(t,n){let{dropIndicatorProps:r,isDropTarget:i,...a}=t,o=w({...a,defaultClassName:`react-aria-DropIndicator`,values:{isDropTarget:i}});return e.createElement(A.div,{...r,...o,role:`option`,ref:n,"data-drop-target":i||void 0})}const We=r(Ue);be(z,function(t,n,r){let i=o(Q),{isLoading:a,onLoadMore:s,scrollOffset:u,...d}=t,m=l(null),h=c(()=>({onLoadMore:s,collection:i?.collection,sentinelRef:m,scrollOffset:u}),[s,u,i?.collection]);_(h,m);let g=w({...d,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:p(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:m,style:{position:`absolute`,height:1,width:1}})),a&&g.children&&e.createElement(A.div,{...x(f(t,{global:!0}),{tabIndex:-1}),...g,role:`option`,ref:n},g.children))});export{ze as ListBox};
|
|
1
|
+
import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useRef as l,useState as u,useSyncExternalStore as d}from"react";import{filterDOMProps as f,inertValue as p,mergeProps as m,mergeRefs as h,useLayoutEffect as g,useLoadMoreSentinel as _,useObjectRef as v}from"@react-aria/utils";import{FocusableContext as y}from"@react-aria/interactions";import{createPortal as b}from"react-dom";import{FocusScope as ee,ListKeyboardDelegate as te,mergeProps as x,useCollator as ne,useFocusRing as re,useListBox as ie,useListBoxSection as S,useLocale as ae}from"react-aria";import{UNSTABLE_useFilteredListState as oe,useListState as se}from"react-stately";n(null),n(null),n(null),n(null),n(null),n({});const ce=n(null);n(null);const C=Symbol(`default`);function le({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function w(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:l}=e;return c(()=>{let e,c,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,c=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:c||o?{...o,...c}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,s):void 0}},[t,n,r,i,a,o,s,l])}function T(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||C;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function ue(e,t,n){let{ref:r,...i}=T(n,e.slot)||{},a=v(c(()=>h(t,r),[t,r])),o=m(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(o.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[o,a]}function E(e=!0){let[t,n]=u(e),r=l(!1),i=a(e=>{r.current=!0,n(!!e)},[]);return g(()=>{r.current||n(!1)},[]),[i,t]}function D(t,n,r){let{render:i,...a}=n,o=l(null),s=c(()=>h(r,o),[r,o]);g(()=>{},[t,i]);let u={...a,ref:s};return i?i(u,void 0):e.createElement(t,u)}const O={},k=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=O[t];return n||(n=r(D.bind(null,t)),O[t]=n),n}});var A=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},j=class extends A{filter(e,t,n){let[r,i]=L(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},M=class extends A{};M.type=`header`;var N=class extends A{};N.type=`loader`;var P=class extends j{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};P.type=`item`;var F=class extends j{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};F.type=`section`;var I=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=L(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function L(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}var R=class{*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild??=e,this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,t){if(t==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=t,e.previousSibling=t.previousSibling,e.index=t.index-1,this.firstChild===t?this.firstChild=e:t.previousSibling&&(t.previousSibling.nextSibling=e),t.previousSibling=e,e.parentNode=t.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}},z=class e extends R{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof e?this.parentNode.level+ +(this.node?.type===`item`):0}getMutableNode(){return this.node==null?null:(this.isMutated||=(this.node=this.node.clone(),!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){let t=this.nextVisibleSibling,n=this.getMutableNode();if(n!=null&&(n.index=this.index,n.level=this.level,n.parentKey=this.parentNode instanceof e?this.parentNode.node?.key??null:null,n.prevKey=this.previousVisibleSibling?.node?.key??null,n.nextKey=t?.node?.key??null,n.hasChildNodes=!!this.firstChild,n.firstChildKey=this.firstVisibleChild?.node?.key??null,n.lastChildKey=this.lastVisibleChild?.node?.key??null,(n.colSpan!=null||n.colIndex!=null)&&t)){let e=(n.colIndex??n.index)+(n.colSpan??1);if(t.node!=null&&e!==t.node.colIndex){let n=t.getMutableNode();n.colIndex=e}}}setProps(e,t,n,r,i){let a,{value:o,textValue:s,id:c,...l}=e;if(this.node==null?(a=new n(c??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),l.ref=t,a.props=l,a.rendered=r,a.render=i,a.value=o,e[`aria-label`]&&(a[`aria-label`]=e[`aria-label`]),a.textValue=s||(typeof l.children==`string`?l.children:``)||e[`aria-label`]||``,c!=null&&c!==a.key)throw Error(`Cannot change the id of an item`);l.colSpan!=null&&(a.colSpan=l.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?`none`:``},set display(t){let n=t===`none`;if(e.isHidden!==n){(e.parentNode?.firstVisibleChild===e||e.parentNode?.lastVisibleChild===e)&&e.ownerDocument.markDirty(e.parentNode);let t=e.previousVisibleSibling,r=e.nextVisibleSibling;t&&e.ownerDocument.markDirty(t),r&&e.ownerDocument.markDirty(r),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,t){super(t),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},B=class extends R{get isConnected(){return!0}createElement(e){return new z(e,this)}getMutableCollection(){return this.nextCollection||=this.collection.clone(),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let t of e)this.addNode(t);t.addNode(e.node)}removeNode(e){for(let t of e)this.removeNode(t);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let e of this.dirtyNodes)e instanceof z&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof z?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}};function V(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,s=c(()=>new WeakMap,o);return c(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=s.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),s.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,s,i,a])}if(typeof HTMLTemplateElement<`u`){let e=Object.getOwnPropertyDescriptor(Node.prototype,`firstChild`).get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}const H=n(!1);function U(t){if(o(H))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(H.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}String(Math.round(Math.random()*1e10));const de=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function fe(){return!1}function pe(){return!0}function me(e){return()=>{}}function W(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(me,fe,pe):o(de)}const G=n(!1),K=n(null);function he(t){if(o(K))return t.content;let{collection:n,document:r}=ye(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(U,null,e.createElement(K.Provider,{value:r},t.content)),e.createElement(ge,{render:t.children,collection:n}))}function ge({collection:e,render:t}){return t(e)}function _e(e,t,n){let r=W(),i=l(r);i.current=r;let o=a(()=>i.current?n():t(),[t,n]);return d(e,o)}const ve=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:_e;function ye(e){let[t]=u(()=>new B(e?.()||new I)),n=a(e=>t.subscribe(e),[t]),r=a(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),i=a(()=>(t.isSSR=!0,t.getCollection()),[t]);return{collection:ve(n,r,i),document:t}}const q=n(null);function be(e){var t;return t=class extends A{},t.type=e,t}function xe(t,n,r,i,s,c){typeof t==`string`&&(t=be(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(q);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(q.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function Se(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(y);if(!o(G)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return xe(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(y.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function Ce(e){return V({...e,addIdAndValue:!0})}const J=n(null);function we(t){let n=o(J),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=Ce({...t,idScope:i,dependencies:r});return o(K)&&(a=e.createElement(Te,null,a)),n=c(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(J.Provider,{value:n},a)}function Te({children:t}){let n=o(K),r=c(()=>e.createElement(K.Provider,{value:null},e.createElement(G.Provider,{value:!0},t)),[t]);return W()?e.createElement(q.Provider,{value:n},r):b(r,n)}const Ee=n(null),De={CollectionRoot({collection:e,renderDropIndicator:t}){return Y(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return Y(e,t,n)}};function Y(t,n,r){return V({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,Oe(t,n,r))}})}function Oe(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const X=n(De),Z=n({}),Q=n(null),ke=r(function(t,n){let{render:r}=o(Q);return e.createElement(e.Fragment,null,r(t,n))});function Ae(t,n){let r=t?.renderDropIndicator,i=t?.isVirtualDragging?.call(t),o=a(t=>{if(i||n?.isDropTarget(t))return r?r(t):e.createElement(ke,{target:t})},[n?.target,i,r]);return t?.useDropIndicator?o:void 0}function je(e,t,n){let r=e.focusedKey,i=null;if(t!=null&&t.isVirtualDragging?.call(t)&&n?.target?.type===`item`&&(i=n.target.key,n.target.dropPosition===`after`)){let e=n.collection.getKeyAfter(i),t=null;if(e!=null){let r=n.collection.getItem(i)?.level??0;for(;e;){let i=n.collection.getItem(e);if(!i)break;if(i.type!==`item`){e=n.collection.getKeyAfter(e);continue}if((i.level??0)<=r)break;t=e,e=n.collection.getKeyAfter(e)}}i=e??t??i}return c(()=>new Set([r,i].filter(e=>e!=null)),[r,i])}const Me=n({}),Ne=n(null);function Pe(t){let n=l({});return e.createElement(Ne.Provider,{value:n},t.children)}const Fe=n({});var Ie=class extends A{filter(e,t){let n=t.getItem(this.prevKey);if(n&&n.type!==`separator`){let n=this.clone();return t.addDescendants(n,e),n}return null}};Ie.type=`separator`;const Le=n(null),$=n(null),Re=r(function(t,n){[t,n]=ue(t,n,Le);let r=o($);return r?e.createElement(Be,{state:r,props:t,listBoxRef:n}):e.createElement(he,{content:e.createElement(we,t)},r=>e.createElement(ze,{props:t,listBoxRef:n,collection:r}))});function ze({props:t,listBoxRef:n,collection:r}){t={...t,collection:r,children:null,items:null};let{layoutDelegate:i}=o(X),a=se({...t,layoutDelegate:i});return e.createElement(Be,{state:a,props:t,listBoxRef:n})}function Be({state:t,props:n,listBoxRef:r}){[n,r]=ue(n,r,ce);let{dragAndDropHooks:i,layout:a=`stack`,orientation:u=`vertical`,filter:d}=n,p=oe(t,d),{collection:m,selectionManager:h}=p,g=!!i?.useDraggableCollectionState,_=!!i?.useDroppableCollectionState,{direction:v}=ae(),{disabledBehavior:y,disabledKeys:b}=h,S=ne({usage:`search`,sensitivity:`base`}),{isVirtualized:se,layoutDelegate:C,dropTargetDelegate:T,CollectionRoot:E}=o(X),D=c(()=>n.keyboardDelegate||new te({collection:m,collator:S,ref:r,disabledKeys:b,disabledBehavior:y,layout:a,orientation:u,direction:v,layoutDelegate:C}),[m,S,r,y,b,u,v,n.keyboardDelegate,a,C]),{listBoxProps:O}=ie({...n,shouldSelectOnPressUp:g||n.shouldSelectOnPressUp,keyboardDelegate:D,isVirtualized:se},p,r);l(g),l(_),s(()=>{},[g,_]);let A,j,M,N=!1,P=null,F=l(null);if(g&&i){A=i.useDraggableCollectionState({collection:m,selectionManager:h,preview:i.renderDragPreview?F:void 0}),i.useDraggableCollection({},A,r);let t=i.DragPreview;P=i.renderDragPreview?e.createElement(t,{ref:F},i.renderDragPreview):null}if(_&&i){j=i.useDroppableCollectionState({collection:m,selectionManager:h});let e=i.dropTargetDelegate||T||new i.ListDropTargetDelegate(m,r,{orientation:u,layout:a,direction:v});M=i.useDroppableCollection({keyboardDelegate:D,dropTargetDelegate:e},j,r),N=j.isDropTarget({type:`root`})}let{focusProps:I,isFocused:L,isFocusVisible:R}=re(),z=p.collection.size===0,B={isDropTarget:N,isEmpty:z,isFocused:L,isFocusVisible:R,layout:n.layout||`stack`,state:p},V=w({...n,children:void 0,defaultClassName:`react-aria-ListBox`,values:B}),H=null;z&&n.renderEmptyState&&(H=e.createElement(`div`,{role:`option`,style:{display:`contents`}},n.renderEmptyState(B)));let U=f(n,{global:!0});return e.createElement(ee,null,e.createElement(k.div,{...x(U,V,O,I,M?.collectionProps),ref:r,slot:n.slot||void 0,onScroll:n.onScroll,"data-drop-target":N||void 0,"data-empty":z||void 0,"data-focused":L||void 0,"data-focus-visible":R||void 0,"data-layout":n.layout||`stack`,"data-orientation":n.orientation||`vertical`},e.createElement(le,{values:[[Le,n],[$,p],[Z,{dragAndDropHooks:i,dragState:A,dropState:j}],[Fe,{elementType:`div`}],[Q,{render:He}],[Ee,{name:`ListBoxSection`,render:Ve}]]},e.createElement(Pe,null,e.createElement(E,{collection:m,scrollRef:r,persistedKeys:je(h,i,j),renderDropIndicator:Ae(i,j)}))),H,P))}function Ve(t,n,r,i=`react-aria-ListBoxSection`){let a=o($),{dragAndDropHooks:s,dropState:c}=o(Z),{CollectionBranch:l}=o(X),[u,d]=E(),{headingProps:p,groupProps:m}=S({heading:d,"aria-label":t[`aria-label`]??void 0}),h=w({...t,id:void 0,children:void 0,defaultClassName:i,values:void 0}),g=f(t,{global:!0});return delete g.id,e.createElement(k.section,{...x(g,h,m),ref:n},e.createElement(Me.Provider,{value:{...p,ref:u}},e.createElement(l,{collection:a.collection,parent:r,renderDropIndicator:Ae(s,c)})))}function He(t,n){n=v(n);let{dragAndDropHooks:r,dropState:i}=o(Z),{dropIndicatorProps:a,isHidden:s,isDropTarget:c}=r.useDropIndicator(t,i,n);return s?null:e.createElement(We,{...t,dropIndicatorProps:a,isDropTarget:c,ref:n})}function Ue(t,n){let{dropIndicatorProps:r,isDropTarget:i,...a}=t,o=w({...a,defaultClassName:`react-aria-DropIndicator`,values:{isDropTarget:i}});return e.createElement(k.div,{...r,...o,role:`option`,ref:n,"data-drop-target":i||void 0})}const We=r(Ue);Se(N,function(t,n,r){let i=o($),{isLoading:a,onLoadMore:s,scrollOffset:u,...d}=t,m=l(null),h=c(()=>({onLoadMore:s,collection:i?.collection,sentinelRef:m,scrollOffset:u}),[s,u,i?.collection]);_(h,m);let g=w({...d,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:p(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:m,style:{position:`absolute`,height:1,width:1}})),a&&g.children&&e.createElement(k.div,{...x(f(t,{global:!0}),{tabIndex:-1}),...g,role:`option`,ref:n},g.children))});export{Re as ListBox};
|