@povio/ui 3.4.0-rc.44 → 3.4.0-rc.46
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-Ba1AN8Oh.d.ts} +1 -1
- package/dist/{ActionModal-CKS0t-n3.d.ts → ActionModal-Cr1duuOL.d.ts} +1 -1
- package/dist/{Autocomplete-CLcRRdiL.d.ts → Autocomplete-DP8yKVLd.d.ts} +3 -3
- package/dist/{Breadcrumbs-C46_H95J.d.ts → Breadcrumbs-DrBp4vnI.d.ts} +2 -2
- package/dist/{Button-D0M9lMOR.d.ts → Button-DIy4SCYi.d.ts} +8 -8
- package/dist/{Checkbox-DC_1l0o7.d.ts → Checkbox-BEONSfOL.d.ts} +7 -7
- package/dist/{CheckboxGroup-DnWeRs5l.d.ts → CheckboxGroup-DYdyX_0H.d.ts} +8 -8
- package/dist/{DatePicker-KFZRDJfS.d.ts → DatePicker-DSa6RE1Z.d.ts} +5 -5
- package/dist/{DatePickerInput-B7yVoI9Y.d.ts → DatePickerInput-Cgf12rqY.d.ts} +3 -3
- package/dist/{DateRangePicker-DcZ1l894.d.ts → DateRangePicker-DduITEx6.d.ts} +10 -10
- package/dist/{DateTimePicker-DWlstLhf.d.ts → DateTimePicker-tN-z-tVd.d.ts} +6 -6
- package/dist/{FileUpload-Czof_aOb.d.ts → FileUpload-vWf9nvu_.d.ts} +2 -2
- package/dist/{FileUploadContainer--YlhZO19.d.ts → FileUploadContainer-DQp3ma_5.d.ts} +1 -1
- package/dist/{Form-Cnm0yRXZ.d.ts → Form-ClkPByHS.d.ts} +2 -2
- package/dist/{FormField-Iy2O8A4g.d.ts → FormField-H4QV55fT.d.ts} +2 -2
- package/dist/{IconButton-CUpL6CsP.d.ts → IconButton-DnEa5FjJ.d.ts} +2 -2
- package/dist/{InlineIconButton-AQ8SViM3.d.ts → InlineIconButton-C1ay6KJI.d.ts} +2 -3
- package/dist/{InputContent-jcMfOzpN.d.ts → InputContent-DCqetjPw.d.ts} +2 -2
- package/dist/{InputUpload-D-C-886F.d.ts → InputUpload-toP6to1k.d.ts} +4 -4
- package/dist/{Inputs-Cm1abCeb.d.ts → Inputs-DnyhKDWY.d.ts} +2 -2
- package/dist/{Link-CKi4C00S.d.ts → Link-DLX0WJRh.d.ts} +8 -6
- package/dist/{Menu-BHpiqpJ9.d.ts → Menu-BM9gC3Or.d.ts} +2 -2
- package/dist/{MenuItem-DLKC94Qs.d.ts → MenuItem-Cw_-egy4.d.ts} +1 -1
- package/dist/{Modal-BfN_MfR-.d.ts → Modal--xD51Y24.d.ts} +2 -2
- package/dist/{NumberInput-BIRmzsPb.d.ts → NumberInput-Er4_JOdF.d.ts} +5 -5
- package/dist/{NumberRangeInput-1ic7kLIS.d.ts → NumberRangeInput-Docbid25.d.ts} +4 -4
- package/dist/{Pagination-uuqyFAu_.d.ts → Pagination-oaAVGqb6.d.ts} +1 -1
- package/dist/{PaginationList-CmZBILfU.d.ts → PaginationList-WMr1TrNu.d.ts} +1 -1
- package/dist/{PasswordInput-DNUEWDEM.d.ts → PasswordInput-CMuecbth.d.ts} +3 -3
- package/dist/{Pill-vCBJdOTY.d.ts → Pill-Bhp_PzWU.d.ts} +1 -1
- package/dist/{PillButton-CEF431l4.d.ts → PillButton-CENJX_j1.d.ts} +1 -1
- package/dist/{QuerySelect-vWifN5XC.d.ts → QuerySelect-spwFI_4I.d.ts} +4 -4
- package/dist/{RadioGroup-Dd7xBSCW.d.ts → RadioGroup-DMke8FAY.d.ts} +8 -8
- package/dist/{ResponsivePopover-BmURECUv.d.ts → ResponsivePopover-C7TatLOZ.d.ts} +1 -1
- package/dist/{Segment-BZdZb436.d.ts → Segment-Cnmq-yRu.d.ts} +3 -3
- package/dist/{Select-Bm2C6tHz.d.ts → Select-DKNYrAih.d.ts} +3 -3
- package/dist/{SelectBase-DD8_4B-r.d.ts → SelectBase-BqiKBIUQ.d.ts} +5 -5
- package/dist/{Slider-C6UeThGK.d.ts → Slider-BSr-DceL.d.ts} +8 -8
- package/dist/{SplitButton-CR4psHKW.d.ts → SplitButton-Cr_TZk_j.d.ts} +3 -3
- package/dist/{Tag-DUvBTljf.d.ts → Tag-Da5X5cTK.d.ts} +1 -1
- package/dist/{TextArea-B8Yvkkxr.d.ts → TextArea-DTnFqwbo.d.ts} +8 -8
- package/dist/{TextButton-cigitfeH.d.ts → TextButton-CEueS1ax.d.ts} +3 -3
- package/dist/{TextEditor-DILzgUAj.d.ts → TextEditor-CDgUmfAI.d.ts} +3 -3
- package/dist/{TextInput-Df0Pkuk-.d.ts → TextInput-CIR7FMvy.d.ts} +5 -5
- package/dist/{TimePicker-BcAaXiku.d.ts → TimePicker-DzEDojxz.d.ts} +4 -4
- package/dist/{Toggle-Ca_t66zh.d.ts → Toggle-BTyx3bF-.d.ts} +3 -3
- package/dist/ToggleButton-CWCpemW4.d.ts +12 -0
- package/dist/{Tooltip-D1oFPqFF.d.ts → Tooltip-DuSQBQG8.d.ts} +4 -4
- package/dist/{autocomplete-CIDaulwN.d.ts → autocomplete-_Z_vjt1R.d.ts} +3 -3
- package/dist/button-bDCNbu2s.d.ts +2 -0
- package/dist/{checkbox-4smu5B-h.d.ts → checkbox-DFNzE8SC.d.ts} +1 -1
- package/dist/{checkbox-group-C55R3YH5.d.ts → checkbox-group-C9ZNl3az.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 +3 -3
- 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/use-toast.d.ts +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 +2 -2
- package/dist/{confirmation.context-D_kJeU8m.d.ts → confirmation.context-CmbxKmXo.d.ts} +1 -1
- package/dist/{date-picker-D2W1Bor7.d.ts → date-picker-D3U7KFrt.d.ts} +1 -1
- package/dist/{date-range-picker-Cm0OPO-n.d.ts → date-range-picker-D5SU50_L.d.ts} +1 -1
- package/dist/{date-time-picker-QcvD8deo.d.ts → date-time-picker-Ce4YSseQ.d.ts} +1 -1
- package/dist/{dynamicInputs-DhCSXGpC.d.ts → dynamicInputs-BeAeCoCp.d.ts} +82 -83
- package/dist/{file-upload-Ba6NwH0N.d.ts → file-upload-DkyiGZ7E.d.ts} +2 -2
- package/dist/{fileUpload.types-ZUblxJUi.d.ts → fileUpload.types-BDhN2rsb.d.ts} +6 -6
- package/dist/{form.binding-Cu03pQ8Y.d.ts → form.binding-K3vP-Nhi.d.ts} +3 -3
- package/dist/{form.types-qEwMTXTZ.d.ts → form.types-BXiBJ8-5.d.ts} +1 -1
- package/dist/icons.d.ts +2 -2
- package/dist/index.d.ts +70 -71
- package/dist/index.js +1 -1
- package/dist/{input-upload-BxRgcRt4.d.ts → input-upload-Dem5wN3q.d.ts} +1 -1
- package/dist/{link.context-C1RcdC0i.d.ts → link.context-BoEOZqJY.d.ts} +1 -1
- package/dist/{number-input-BoUfnoR2.d.ts → number-input-BqozX92g.d.ts} +1 -1
- package/dist/{number-range-input-BkHzkO1m.d.ts → number-range-input-D7oH1mFY.d.ts} +1 -1
- package/dist/{password-input-BPAjcIly.d.ts → password-input-C-vVqZOQ.d.ts} +1 -1
- package/dist/{query-autocomplete-Dh1Yeu4p.d.ts → query-autocomplete-BAAoA4cn.d.ts} +2 -2
- package/dist/{query-select-7lNZcE_x.d.ts → query-select-CC4UIjSF.d.ts} +3 -3
- package/dist/{queryAutocomplete.types-D7SmWVq-.d.ts → queryAutocomplete.types-B6mZJnhq.d.ts} +4 -4
- package/dist/{radio-group-DmilCTsI.d.ts → radio-group-9Nn3LIbn.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 +70 -71
- package/dist/rhf.js +1 -1
- package/dist/{segment-BOELlo1K.d.ts → segment-DnRosWxP.d.ts} +2 -2
- package/dist/{segment.types-BYTmg69p.d.ts → segment.types-11U4nbX6.d.ts} +3 -3
- package/dist/{select-CD3fNAgK.d.ts → select-B8ei3QXS.d.ts} +3 -3
- package/dist/{slider-tx1tub5d.d.ts → slider-Vfx_Q9t3.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 +2 -2
- 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/table.d.ts +1 -1
- package/dist/tanstack/table.js +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 +56 -56
- package/dist/tanstack.js +1 -1
- package/dist/{text-area-kb2PxyJb.d.ts → text-area-00UEdcjI.d.ts} +1 -1
- package/dist/{text-editor-CDECpKqj.d.ts → text-editor-n_MOxVhe.d.ts} +1 -1
- package/dist/text-editor.d.ts +1 -1
- package/dist/{text-input-VqRJ0y7Y.d.ts → text-input-C0JhuyKl.d.ts} +1 -1
- package/dist/{time-picker-CZLL-OEe.d.ts → time-picker-Stm-htK8.d.ts} +1 -1
- package/dist/{toggle-DK5CDOtt.d.ts → toggle-BkjWTQJR.d.ts} +1 -1
- package/dist/{uiConfig.context-Bjb9TQ6Y.d.ts → uiConfig.context-D9Aig1NJ.d.ts} +1 -1
- package/dist/{useTableColumnConfig-D2H_RUmX.js → useTableColumnConfig-BGfALpxU.js} +5 -5
- package/dist/{useTableNav-aDO5L4da.d.ts → useTableNav-DUNcrp60.d.ts} +2 -2
- package/dist/useToast-COxVxlxx.d.ts +16 -0
- package/package.json +24 -5
- package/dist/ToggleButton-3lINwoaV.d.ts +0 -12
- package/dist/button-BQmy1LZS.d.ts +0 -1
- package/dist/index-B8r_kiw4.d.ts +0 -193
- package/dist/index-DCUSluLL.d.ts +0 -269
- package/dist/lucide-react-BJRvqSeV.d.ts +0 -23
- package/dist/types-BT18i837.d.ts +0 -69
- package/dist/types-ZbFfCz06.d.ts +0 -823
- package/dist/useToast-q70ayd29.d.ts +0 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{createContext as t,forwardRef as n,useContext as r,useMemo as i,useRef as a}from"react";import{filterDOMProps as o,mergeRefs as s,useLayoutEffect as c,useObjectRef as l}from"@react-aria/utils";import{
|
|
1
|
+
import e,{createContext as t,forwardRef as n,useContext as r,useMemo as i,useRef as a}from"react";import{filterDOMProps as o,mergeRefs as s,useLayoutEffect as c,useObjectRef as l}from"@react-aria/utils";import{useUNSAFE_PortalContext as u}from"@react-aria/overlays";import{createPortal as d}from"react-dom";import{mergeProps as f,useFocusRing as p,useHover as m,useLocale as h,useToastRegion as g}from"react-aria";import{useToastQueue as _}from"react-stately";function v(e){let{className:t,style:n,children:r,defaultClassName:a,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return i(()=>{let e,i,u;return e=typeof t==`function`?t({...c,defaultClassName:a}):t,i=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??a,style:i||s?{...s,...i}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,a,o,s,c,l])}function y(t,n,r){let{render:o,...l}=n,u=a(null),d=i(()=>s(r,u),[r,u]);c(()=>{},[t,o]);let f={...l,ref:d};return o?o(f,void 0):e.createElement(t,f)}const b={},x=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=b[t];return r||(r=n(y.bind(null,t)),b[t]=r),r}});String(Math.round(Math.random()*1e10));const S=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function C(){return!1}function w(){return!0}function T(e){return()=>{}}function E(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(T,C,w):r(S)}const D=t(null),O=n(function(t,n){let r=E(),i=_(t.queue),a=l(n),{regionProps:s}=g(t,i,a),{focusProps:c,isFocused:y,isFocusVisible:b}=p(),{hoverProps:S,isHovered:C}=m({}),w=v({...t,children:void 0,defaultClassName:`react-aria-ToastRegion`,values:{visibleToasts:i.visibleToasts,isHovered:C,isFocused:y,isFocusVisible:b}}),{direction:T}=h(),O,{getContainer:A}=u();r||(O=document.body,A&&(O=A()));let j=o(t,{global:!0}),M=e.createElement(D.Provider,{value:i},e.createElement(x.div,{...f(j,w,s,c,S),dir:T,ref:a,"data-hovered":C||void 0,"data-focused":y||void 0,"data-focus-visible":b||void 0},typeof t.children==`function`?e.createElement(k,{...t,render:void 0,className:void 0,style:{display:`contents`}},t.children):t.children));return i.visibleToasts.length>0&&O?d(M,O):null}),k=n(function(t,n){let i=r(D),{hoverProps:a,isHovered:o}=m({}),s=v({...t,children:void 0,defaultClassName:`react-aria-ToastList`,values:{visibleToasts:i.visibleToasts,isFocused:!1,isFocusVisible:!1,isHovered:o}});return e.createElement(x.ol,{...a,...s,ref:n},i.visibleToasts.map(n=>e.createElement(`li`,{key:n.key,style:{display:`contents`}},t.children({toast:n}))))});export{O as UNSTABLE_ToastRegion};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ToggleButtonProps, t as ToggleButton } from "../ToggleButton-
|
|
1
|
+
import { n as ToggleButtonProps, t as ToggleButton } from "../ToggleButton-CWCpemW4.js";
|
|
2
2
|
export { ToggleButton, ToggleButtonProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as Toggle, r as ToggleProps, t as ControlledToggleProps } from "../Toggle-
|
|
1
|
+
import { n as Toggle, r as ToggleProps, t as ControlledToggleProps } from "../Toggle-BTyx3bF-.js";
|
|
2
2
|
export { ControlledToggleProps, Toggle, ToggleProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{createContext as t,forwardRef as n,useContext as r,useMemo as i,useRef as a,useState as o}from"react";import{filterDOMProps as s,mergeProps as c,mergeRefs as l,nodeContains as u,useLayoutEffect as d,useObjectRef as f}from"@react-aria/utils";import{
|
|
1
|
+
import e,{createContext as t,forwardRef as n,useContext as r,useMemo as i,useRef as a,useState as o}from"react";import{filterDOMProps as s,mergeProps as c,mergeRefs as l,nodeContains as u,useLayoutEffect as d,useObjectRef as f}from"@react-aria/utils";import{createFocusManager as p}from"@react-aria/focus";import{useLocale as m}from"@react-aria/i18n";const h=Symbol(`default`);function g(e){let{className:t,style:n,children:r,defaultClassName:a,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return i(()=>{let e,i,u;return e=typeof t==`function`?t({...c,defaultClassName:a}):t,i=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??a,style:i||s?{...s,...i}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,a,o,s,c,l])}function _(e,t){let n=r(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||h;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 v(e,t,n){let{ref:r,...a}=_(n,e.slot)||{},o=f(i(()=>l(t,r),[t,r])),s=c(a,e);return`style`in a&&a.style&&`style`in e&&e.style&&(s.style=typeof a.style==`function`||typeof e.style==`function`?t=>{let n=typeof a.style==`function`?a.style(t):a.style,r={...t.defaultStyle,...n},i=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...i}}:{...a.style,...e.style}),[s,o]}function y(t,n,r){let{render:o,...s}=n,c=a(null),u=i(()=>l(r,c),[r,c]);d(()=>{},[t,o]);let f={...s,ref:u};return o?o(f,void 0):e.createElement(t,f)}const b={},x=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=b[t];return r||(r=n(y.bind(null,t)),b[t]=r),r}});function S(e,t){let{"aria-label":n,"aria-labelledby":r,orientation:i=`horizontal`}=e,[c,l]=o(!1);d(()=>{l(!!(t.current&&t.current.parentElement?.closest(`[role="toolbar"]`)))});let{direction:f}=m(),h=f===`rtl`&&i===`horizontal`,g=p(t),_=e=>{if(u(e.currentTarget,e.target)){if(i===`horizontal`&&e.key===`ArrowRight`||i===`vertical`&&e.key===`ArrowDown`)h?g.focusPrevious():g.focusNext();else if(i===`horizontal`&&e.key===`ArrowLeft`||i===`vertical`&&e.key===`ArrowUp`)h?g.focusNext():g.focusPrevious();else if(e.key===`Tab`){e.stopPropagation(),v.current=document.activeElement,e.shiftKey?g.focusFirst():g.focusLast();return}else return;e.stopPropagation(),e.preventDefault()}},v=a(null),y=e=>{!u(e.currentTarget,e.relatedTarget)&&!v.current&&(v.current=e.target)},b=e=>{if(v.current&&!u(e.currentTarget,e.relatedTarget)&&u(t.current,e.target)){var n;(n=v.current)==null||n.focus(),v.current=null}};return{toolbarProps:{...s(e,{labelable:!0}),role:c?`group`:`toolbar`,"aria-orientation":i,"aria-label":n,"aria-labelledby":n==null?r:void 0,onKeyDownCapture:c?void 0:_,onFocusCapture:c?void 0:b,onBlurCapture:c?void 0:y}}}const C=t({}),w=n(function(t,n){[t,n]=v(t,n,C);let{toolbarProps:r}=S(t,n),i=g({...t,values:{orientation:t.orientation||`horizontal`},defaultClassName:`react-aria-Toolbar`}),a=s(t,{global:!0});return delete a.id,e.createElement(x.div,{...c(a,i,r),ref:n,slot:t.slot||void 0,"data-orientation":t.orientation||`horizontal`},i.children)});export{w as Toolbar};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TooltipProps, t as Tooltip } from "../Tooltip-
|
|
1
|
+
import { n as TooltipProps, t as Tooltip } from "../Tooltip-DuSQBQG8.js";
|
|
2
2
|
export { Tooltip, TooltipProps };
|
|
@@ -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,useReducer as l,useRef as u,useState as d,useSyncExternalStore as f}from"react";import{filterDOMProps as p,inertValue as m,mergeProps as h,mergeRefs as g,useLayoutEffect as _,useLoadMoreSentinel as v,useObjectRef as y}from"@react-aria/utils";import{FocusableContext as b}from"@react-aria/interactions";import{createPortal as x}from"react-dom";import{FocusScope as S,ListKeyboardDelegate as C,mergeProps as w,useCollator as T,useFocusRing as ee,useLocale as te,useTree as ne,useTreeItem as E,useVisuallyHidden as D}from"react-aria";import{useTreeState as re}from"react-stately";const O=Symbol(`default`);function ie({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function k(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 ae(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||O;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 A(e,t,n){let{ref:r,...i}=ae(n,e.slot)||{},a=y(c(()=>g(t,r),[t,r])),o=h(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 j(t,n,r){let{render:i,...a}=n,o=u(null),s=c(()=>g(r,o),[r,o]);_(()=>{},[t,i]);let l={...a,ref:s};return i?i(l,void 0):e.createElement(t,l)}const M={},N=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=M[t];return n||(n=r(j.bind(null,t)),M[t]=n),n}});String(Math.round(Math.random()*1e10));const P=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function F(){return!1}function I(){return!0}function L(e){return()=>{}}function R(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(L,F,I):o(P)}const z=typeof document<`u`?e.useInsertionEffect??e.useLayoutEffect:()=>{};function oe(e,t,n){let[r,i]=d(e||t),o=u(r),c=u(e!==void 0),f=e!==void 0;s(()=>{c.current,c.current=f},[f]);let p=f?e:r;z(()=>{o.current=p});let[,m]=l(()=>({}),{});return[p,a((e,...t)=>{let r=typeof e==`function`?e(o.current):e;Object.is(o.current,r)||(o.current=r,i(r),m(),n?.(r,...t))},[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}},V=class extends B{filter(e,t,n){let[r,i]=q(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},H=class extends B{};H.type=`header`;var U=class extends B{};U.type=`loader`;var W=class extends V{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 G=class extends V{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}};G.type=`section`;var K=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]=q(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 q(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 J=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}},Y=class e extends J{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}},X=class extends J{get isConnected(){return!0}createElement(e){return new Y(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 Y&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof Y?(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 se(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 ce=n(!1);function le(t){if(o(ce))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(ce.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}const ue=n(!1),Z=n(null);function de(t){if(o(Z))return t.content;let{collection:n,document:r}=he(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(le,null,e.createElement(Z.Provider,{value:r},t.content)),e.createElement(fe,{render:t.children,collection:n}))}function fe({collection:e,render:t}){return t(e)}function pe(e,t,n){let r=R(),i=u(r);i.current=r;let o=a(()=>i.current?n():t(),[t,n]);return f(e,o)}const me=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:pe;function he(e){let[t]=d(()=>new X(e?.()||new K)),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:me(n,r,i),document:t}}const Q=n(null);function ge(e){var t;return t=class extends B{},t.type=e,t}function _e(t,n,r,i,s,c){typeof t==`string`&&(t=ge(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 ve(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(b);if(!o(ue)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return _e(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(b.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function ye(e){return se({...e,addIdAndValue:!0})}const be=n(null);function xe(t){let n=o(be),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=ye({...t,idScope:i,dependencies:r});return o(Z)&&(a=e.createElement(Se,null,a)),n=c(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(be.Provider,{value:n},a)}function Se({children:t}){let n=o(Z),r=c(()=>e.createElement(Z.Provider,{value:null},e.createElement(ue.Provider,{value:!0},t)),[t]);return R()?e.createElement(Q.Provider,{value:n},r):x(r,n)}const Ce={CollectionRoot({collection:e,renderDropIndicator:t}){return we(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return we(e,t,n)}};function we(t,n,r){return se({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,Te(t,n,r))}})}function Te(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 Ee=n(Ce),$=n({}),De=n(null),Oe=r(function(t,n){let{render:r}=o(De);return e.createElement(e.Fragment,null,r(t,n))});function ke(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(Oe,{target:t})},[n?.target,i,r]);return t?.useDropIndicator?o:void 0}function Ae(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 je=n(null);function Me(t){let n=u({});return e.createElement(je.Provider,{value:n},t.children)}var Ne=class{setup(e,t,n){this.delegate=e,this.state=t,this.direction=n}getDropTargetFromPoint(e,t,n){let r=this.delegate.getDropTargetFromPoint(e,t,n);return!r||r.type===`root`?r:this.resolveDropTarget(r,e,t,n)}resolveDropTarget(e,t,n,r){let i=this.pointerTracking,a=n-i.lastY,o=t-i.lastX,s=i.yDirection,c=i.xDirection;if(Math.abs(a)>5&&(s=a>0?`down`:`up`,i.yDirection=s,i.lastY=n),Math.abs(o)>10&&(c=o>0?`right`:`left`,i.xDirection=c,i.lastX=t),e.dropPosition===`before`){let t=this.state.collection.getKeyBefore(e.key);if(t!=null){let n={type:`item`,key:t,dropPosition:`after`};r(n)&&(e=n)}}let l=this.getPotentialTargets(e,r);if(l.length===0)return{type:`root`};let u;return l.length>1?u=this.selectTarget(l,e,t,n,s,c):(u=l[0],i.boundaryContext=null),u}getPotentialTargets(e,t){if(e.dropPosition===`on`)return[e];let n=e,r=this.state.collection,i=r.getItem(n.key);for(;i&&i?.type!==`item`&&i.nextKey!=null;)n.key=i.nextKey,i=r.getItem(i.nextKey);let a=[n];if(i&&i.hasChildNodes&&this.state.expandedKeys.has(i.key)&&r.getChildren&&n.dropPosition===`after`){let e=null;for(let t of r.getChildren(i.key))if(t.type===`item`){e=t;break}if(e){let n={type:`item`,key:e.key,dropPosition:`before`};return t(n)?[n]:[]}}if(i?.nextKey!=null)return[e];let o=i?.parentKey,s=[];for(;o;){let e=r.getItem(o),n=e?.nextKey?r.getItem(e.nextKey):null;if(!n||n.parentKey!==o){let e={type:`item`,key:o,dropPosition:`after`};if(t(e)&&s.push(e),n)break}o=e?.parentKey}if(s.length>0&&a.push(...s),a.length===1){let e=r.getKeyAfter(n.key),a=e?r.getItem(e):null;if(e!=null&&a&&i&&a.level!=null&&i.level!=null&&a.level>i.level){let n={type:`item`,key:e,dropPosition:`before`};if(t(n))return[n]}}return a.filter(t)}selectTarget(e,t,n,r,i,a){if(e.length<2)return e[0];let o=this.pointerTracking,s=this.state.collection.getItem(t.key)?.parentKey;if(!s)return e[0];(!o.boundaryContext||o.boundaryContext.parentKey!==s)&&(o.boundaryContext={parentKey:s,preferredTargetIndex:o.yDirection===`up`?e.length-1:0,lastSwitchY:r,lastSwitchX:n});let c=o.boundaryContext,l=Math.abs(n-c.lastSwitchX);if(Math.abs(r-c.lastSwitchY)>5&&i){let t=c.preferredTargetIndex||0;i===`down`&&t===0?c.preferredTargetIndex=e.length-1:i===`up`&&t===e.length-1&&(c.preferredTargetIndex=0),o.xDirection=null}if(l>10&&a){let t=c.preferredTargetIndex||0;a===`left`?this.direction===`ltr`?t<e.length-1&&(c.preferredTargetIndex=t+1,c.lastSwitchX=n):t>0&&(c.preferredTargetIndex=t-1,c.lastSwitchX=n):a===`right`&&(this.direction===`ltr`?t>0&&(c.preferredTargetIndex=t-1,c.lastSwitchX=n):t<e.length-1&&(c.preferredTargetIndex=t+1,c.lastSwitchX=n)),o.yDirection=null}return e[Math.max(0,Math.min(c.preferredTargetIndex||0,e.length-1))]}constructor(){this.delegate=null,this.state=null,this.direction=`ltr`,this.pointerTracking={lastY:0,lastX:0,yDirection:null,xDirection:null,boundaryContext:null}}},Pe=class{*[Symbol.iterator](){yield*this.flattenedRows}get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}getItem(e){return this.keyMap.get(e)||null}at(e){return this.flattenedRows[e]}getFirstKey(){return this.flattenedRows[0]?.key}getLastKey(){return this.flattenedRows[this.flattenedRows.length-1]?.key}getKeyAfter(e){let t=this.flattenedRows.findIndex(t=>t.key===e);return this.flattenedRows[t+1]?.key}getKeyBefore(e){let t=this.flattenedRows.findIndex(t=>t.key===e);return this.flattenedRows[t-1]?.key}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)}}}getTextValue(e){let t=this.getItem(e);return t?t.textValue:``}constructor(e){this.keyMap=new Map,this.itemCount=0;let{collection:t,expandedKeys:n}=e,{flattenedRows:r,keyMap:i,itemCount:a}=Ue(t,{expandedKeys:n});this.flattenedRows=r,this.keyMap=i,this.itemCount=a}};const Fe=n(null),Ie=n(null),Le=r(function(t,n){return[t,n]=A(t,n,Fe),e.createElement(de,{content:e.createElement(xe,t)},r=>e.createElement(ze,{props:t,collection:r,treeRef:n}))}),Re={expand:{ltr:`ArrowRight`,rtl:`ArrowLeft`},collapse:{ltr:`ArrowLeft`,rtl:`ArrowRight`}};function ze({props:t,collection:n,treeRef:r}){let{dragAndDropHooks:i}=t,{direction:a}=te(),l=T({usage:`search`,sensitivity:`base`}),f=!!i?.useDraggableCollectionState,m=!!i?.useDroppableCollectionState,h=u(f),g=u(m);s(()=>{h.current!==f&&console.warn(`Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.`),g.current!==m&&console.warn(`Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.`)},[f,m]);let{selectionMode:_=`none`,expandedKeys:v,defaultExpandedKeys:y,onExpandedChange:b,disabledBehavior:x=`all`}=t,{CollectionRoot:E,isVirtualized:D,layoutDelegate:O,dropTargetDelegate:ae}=o(Ee),[A,j]=oe(v?He(v):void 0,y?He(y):new Set,b),M=c(()=>new Pe({collection:n,expandedKeys:A}),[n,A]),P=re({...t,selectionMode:_,expandedKeys:A,onExpandedChange:j,collection:M,children:void 0,disabledBehavior:x}),{gridProps:F}=ne({...t,isVirtualized:D,layoutDelegate:O},P,r),I,L,R,z=!1,B=null,V=u(null);if(f&&i){I=i.useDraggableCollectionState({collection:P.collection,selectionManager:P.selectionManager,preview:i.renderDragPreview?V:void 0}),i.useDraggableCollection({},I,r);let t=i.DragPreview;B=i.renderDragPreview?e.createElement(t,{ref:V},i.renderDragPreview):null}let[H]=d(()=>new Ne);if(m&&i){L=i.useDroppableCollectionState({collection:P.collection,selectionManager:P.selectionManager});let e=i.dropTargetDelegate||ae||new i.ListDropTargetDelegate(P.collection,r,{direction:a});H.setup(e,P,a);let t=new C({collection:P.collection,collator:l,ref:r,disabledKeys:P.selectionManager.disabledKeys,disabledBehavior:P.selectionManager.disabledBehavior,direction:a,layoutDelegate:O});R=i.useDroppableCollection({keyboardDelegate:t,dropTargetDelegate:H,onDropActivate:e=>{if(e.target.type===`item`){let t=e.target.key,n=P.collection.getItem(t),r=A!==`all`&&A.has(t);n&&n.hasChildNodes&&(!r||i!=null&&i.isVirtualDragging?.call(i))&&P.toggleKey(t)}},onKeyDown:e=>{let t=L?.target;if(t&&t.type===`item`&&t.dropPosition===`on`){let n=P.collection.getItem(t.key);(e.key===Re.expand[a]&&n?.hasChildNodes&&!P.expandedKeys.has(t.key)||e.key===Re.collapse[a]&&n?.hasChildNodes&&P.expandedKeys.has(t.key))&&P.toggleKey(t.key)}}},L,r);let n=L.getDropOperation;L.getDropOperation=e=>{let{target:t,isInternal:r}=e,i=I?.draggingKeys??new Set;if(r&&t.type===`item`&&i.size>0){if(i.has(t.key)&&t.dropPosition===`on`)return`cancel`;let e=t.key;for(;e!=null;){let t=P.collection.getItem(e)?.parentKey;if(t!=null&&i.has(t))return`cancel`;e=t??null}}return n(e)},z=L.isDropTarget({type:`root`})}let U=!!(f&&!I?.isDisabled),{focusProps:W,isFocused:G,isFocusVisible:K}=ee(),q={isEmpty:P.collection.size===0,isFocused:G,isFocusVisible:K,isDropTarget:z,selectionMode:P.selectionManager.selectionMode,allowsDragging:!!U,state:P},J=k({...t,children:void 0,defaultClassName:`react-aria-Tree`,values:q}),Y=null;if(P.collection.size===0&&t.renderEmptyState){let{isEmpty:n,...r}=q,i=t.renderEmptyState({...r});Y=e.createElement(`div`,{role:`row`,style:{display:`contents`},"aria-level":1},e.createElement(`div`,{role:`gridcell`,style:{display:`contents`}},i))}let X=p(t,{global:!0});return e.createElement(e.Fragment,null,e.createElement(S,null,e.createElement(N.div,{...w(X,J,F,W,R?.collectionProps),ref:r,slot:t.slot||void 0,"data-empty":P.collection.size===0||void 0,"data-focused":G||void 0,"data-drop-target":z||void 0,"data-focus-visible":K||void 0,"data-selection-mode":P.selectionManager.selectionMode===`none`?void 0:P.selectionManager.selectionMode,"data-allows-dragging":!!U||void 0},e.createElement(ie,{values:[[Ie,P],[$,{dragAndDropHooks:i,dragState:I,dropState:L}],[De,{render:We}]]},m&&e.createElement(qe,null),e.createElement(Me,null,e.createElement(E,{collection:P.collection,persistedKeys:Ae(P.selectionManager,i,L),scrollRef:r,renderDropIndicator:ke(i,L)}))),Y)),B)}var Be=class extends B{};Be.type=`content`;var Ve=class extends B{};Ve.type=`item`,ve(U,function(t,n,r){let{isVirtualized:i}=o(Ee),a=o(Ie),{isLoading:s,onLoadMore:l,scrollOffset:d,...f}=t,h=u(null),g=c(()=>({onLoadMore:l,collection:a?.collection,sentinelRef:h,scrollOffset:d}),[l,d,a?.collection]);v(g,h),n=y(n);let{rowProps:_,gridCellProps:b}=E({node:r},a,n),x=_[`aria-level`]||1,S={role:`row`,"aria-level":_[`aria-level`]},C=k({...f,id:void 0,children:r.rendered,defaultClassName:`react-aria-TreeLoader`,values:{level:x}}),T={};return i&&(T={display:`contents`}),e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:m(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),s&&C.children&&e.createElement(N.div,{ref:n,...w(p(t),S),...C,"data-level":x},e.createElement(`div`,{...b,style:T},C.children)))});function He(e){return e?e===`all`?`all`:new Set(e):new Set}function Ue(e,t){let{expandedKeys:n=new Set}=t,r=new Map,i=[],a=0,o=new Map,s=t=>{if(t.type===`item`||t.type===`loader`){let s=t?.parentKey,c={...t};s==null?r.set(t.key,t):([...e.getChildren(s)][0].type!==`item`&&(c.index=t?.index==null?0:t?.index-1),t.type===`loader`&&(c.level=t.level+1),r.set(c.key,c));let l=r.get(t.key)||t;(l.level===0||l.parentKey!=null&&n.has(l.parentKey)&&o.get(l.parentKey))&&(l.type===`item`&&a++,i.push(l),o.set(l.key,!0))}else t.type!==null&&r.set(t.key,t);for(let n of e.getChildren(t.key))s(n)};for(let t of e)s(t);return{flattenedRows:i,keyMap:r,itemCount:a}}function We(t,n){n=y(n);let{dragAndDropHooks:r,dropState:i}=o($),a=u(null),{dropIndicatorProps:s,isHidden:c,isDropTarget:l}=r.useDropIndicator(t,i,a);if(c)return null;let d=i&&t.target.type===`item`?(i.collection.getItem(t.target.key)?.level||0)+1:1;return e.createElement(Ke,{...t,dropIndicatorProps:s,isDropTarget:l,ref:n,buttonRef:a,level:d})}function Ge(t,n){let{dropIndicatorProps:r,isDropTarget:i,buttonRef:a,level:o,...s}=t,{visuallyHiddenProps:c}=D(),l=k({...s,defaultClassName:`react-aria-DropIndicator`,defaultStyle:{position:`relative`,"--tree-item-level":o},values:{isDropTarget:i}});return e.createElement(N.div,{...l,role:`row`,"aria-level":o,ref:n,"data-drop-target":i||void 0},e.createElement(`div`,{role:`gridcell`},e.createElement(`div`,{...c,role:`button`,...r,ref:a}),l.children))}const Ke=r(Ge);function qe(){let{dragAndDropHooks:t,dropState:n}=o($),r=u(null),{dropIndicatorProps:i}=t.useDropIndicator({target:{type:`root`}},n,r),a=n.isDropTarget({type:`root`}),{visuallyHiddenProps:s}=D();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})))}export{Le as Tree};
|
|
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,useReducer as l,useRef as u,useState as d,useSyncExternalStore as f}from"react";import{filterDOMProps as p,inertValue as m,mergeProps as h,mergeRefs as g,useLayoutEffect as _,useLoadMoreSentinel as v,useObjectRef as y}from"@react-aria/utils";import{FocusableContext as b}from"@react-aria/interactions";import{createPortal as x}from"react-dom";import{FocusScope as ee,ListKeyboardDelegate as S,mergeProps as C,useCollator as w,useFocusRing as te,useLocale as ne,useTree as re,useTreeItem as ie,useVisuallyHidden as T}from"react-aria";import{useTreeState as ae}from"react-stately";const E=Symbol(`default`);function oe({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function D(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 se(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||E;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 O(e,t,n){let{ref:r,...i}=se(n,e.slot)||{},a=y(c(()=>g(t,r),[t,r])),o=h(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 ce(t,n,r){let{render:i,...a}=n,o=u(null),s=c(()=>g(r,o),[r,o]);_(()=>{},[t,i]);let l={...a,ref:s};return i?i(l,void 0):e.createElement(t,l)}const k={},A=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=k[t];return n||(n=r(ce.bind(null,t)),k[t]=n),n}}),j=typeof document<`u`?e.useInsertionEffect??e.useLayoutEffect:()=>{};function le(e,t,n){let[r,i]=d(e||t),o=u(r),c=u(e!==void 0),f=e!==void 0;s(()=>{c.current,c.current=f},[f]);let p=f?e:r;j(()=>{o.current=p});let[,m]=l(()=>({}),{});return[p,a((e,...t)=>{let r=typeof e==`function`?e(o.current):e;Object.is(o.current,r)||(o.current=r,i(r),m(),n?.(r,...t))},[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]=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}},H=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}};function U(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 W=n(!1);function G(t){if(o(W))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(W.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}String(Math.round(Math.random()*1e10));const K=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function q(){return!1}function ue(){return!0}function de(e){return()=>{}}function J(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(de,q,ue):o(K)}const fe=n(!1),Y=n(null);function pe(t){if(o(Y))return t.content;let{collection:n,document:r}=_e(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(G,null,e.createElement(Y.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=J(),i=u(r);i.current=r;let o=a(()=>i.current?n():t(),[t,n]);return f(e,o)}const ge=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:he;function _e(e){let[t]=d(()=>new H(e?.()||new R)),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 X=n(null);function ve(e){var t;return t=class extends M{},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(X);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(X.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(b);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(b.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function xe(e){return U({...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(Y)&&(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(Y),r=c(()=>e.createElement(Y.Provider,{value:null},e.createElement(fe.Provider,{value:!0},t)),[t]);return J()?e.createElement(X.Provider,{value:n},r):x(r,n)}const Te={CollectionRoot({collection:e,renderDropIndicator:t}){return Ee(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return Ee(e,t,n)}};function Ee(t,n,r){return U({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,De(t,n,r))}})}function De(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 Oe=n(Te),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(null);function Pe(t){let n=u({});return e.createElement(Ne.Provider,{value:n},t.children)}var Fe=class{setup(e,t,n){this.delegate=e,this.state=t,this.direction=n}getDropTargetFromPoint(e,t,n){let r=this.delegate.getDropTargetFromPoint(e,t,n);return!r||r.type===`root`?r:this.resolveDropTarget(r,e,t,n)}resolveDropTarget(e,t,n,r){let i=this.pointerTracking,a=n-i.lastY,o=t-i.lastX,s=i.yDirection,c=i.xDirection;if(Math.abs(a)>5&&(s=a>0?`down`:`up`,i.yDirection=s,i.lastY=n),Math.abs(o)>10&&(c=o>0?`right`:`left`,i.xDirection=c,i.lastX=t),e.dropPosition===`before`){let t=this.state.collection.getKeyBefore(e.key);if(t!=null){let n={type:`item`,key:t,dropPosition:`after`};r(n)&&(e=n)}}let l=this.getPotentialTargets(e,r);if(l.length===0)return{type:`root`};let u;return l.length>1?u=this.selectTarget(l,e,t,n,s,c):(u=l[0],i.boundaryContext=null),u}getPotentialTargets(e,t){if(e.dropPosition===`on`)return[e];let n=e,r=this.state.collection,i=r.getItem(n.key);for(;i&&i?.type!==`item`&&i.nextKey!=null;)n.key=i.nextKey,i=r.getItem(i.nextKey);let a=[n];if(i&&i.hasChildNodes&&this.state.expandedKeys.has(i.key)&&r.getChildren&&n.dropPosition===`after`){let e=null;for(let t of r.getChildren(i.key))if(t.type===`item`){e=t;break}if(e){let n={type:`item`,key:e.key,dropPosition:`before`};return t(n)?[n]:[]}}if(i?.nextKey!=null)return[e];let o=i?.parentKey,s=[];for(;o;){let e=r.getItem(o),n=e?.nextKey?r.getItem(e.nextKey):null;if(!n||n.parentKey!==o){let e={type:`item`,key:o,dropPosition:`after`};if(t(e)&&s.push(e),n)break}o=e?.parentKey}if(s.length>0&&a.push(...s),a.length===1){let e=r.getKeyAfter(n.key),a=e?r.getItem(e):null;if(e!=null&&a&&i&&a.level!=null&&i.level!=null&&a.level>i.level){let n={type:`item`,key:e,dropPosition:`before`};if(t(n))return[n]}}return a.filter(t)}selectTarget(e,t,n,r,i,a){if(e.length<2)return e[0];let o=this.pointerTracking,s=this.state.collection.getItem(t.key)?.parentKey;if(!s)return e[0];(!o.boundaryContext||o.boundaryContext.parentKey!==s)&&(o.boundaryContext={parentKey:s,preferredTargetIndex:o.yDirection===`up`?e.length-1:0,lastSwitchY:r,lastSwitchX:n});let c=o.boundaryContext,l=Math.abs(n-c.lastSwitchX);if(Math.abs(r-c.lastSwitchY)>5&&i){let t=c.preferredTargetIndex||0;i===`down`&&t===0?c.preferredTargetIndex=e.length-1:i===`up`&&t===e.length-1&&(c.preferredTargetIndex=0),o.xDirection=null}if(l>10&&a){let t=c.preferredTargetIndex||0;a===`left`?this.direction===`ltr`?t<e.length-1&&(c.preferredTargetIndex=t+1,c.lastSwitchX=n):t>0&&(c.preferredTargetIndex=t-1,c.lastSwitchX=n):a===`right`&&(this.direction===`ltr`?t>0&&(c.preferredTargetIndex=t-1,c.lastSwitchX=n):t<e.length-1&&(c.preferredTargetIndex=t+1,c.lastSwitchX=n)),o.yDirection=null}return e[Math.max(0,Math.min(c.preferredTargetIndex||0,e.length-1))]}constructor(){this.delegate=null,this.state=null,this.direction=`ltr`,this.pointerTracking={lastY:0,lastX:0,yDirection:null,xDirection:null,boundaryContext:null}}},Ie=class{*[Symbol.iterator](){yield*this.flattenedRows}get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}getItem(e){return this.keyMap.get(e)||null}at(e){return this.flattenedRows[e]}getFirstKey(){return this.flattenedRows[0]?.key}getLastKey(){return this.flattenedRows[this.flattenedRows.length-1]?.key}getKeyAfter(e){let t=this.flattenedRows.findIndex(t=>t.key===e);return this.flattenedRows[t+1]?.key}getKeyBefore(e){let t=this.flattenedRows.findIndex(t=>t.key===e);return this.flattenedRows[t-1]?.key}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)}}}getTextValue(e){let t=this.getItem(e);return t?t.textValue:``}constructor(e){this.keyMap=new Map,this.itemCount=0;let{collection:t,expandedKeys:n}=e,{flattenedRows:r,keyMap:i,itemCount:a}=Ue(t,{expandedKeys:n});this.flattenedRows=r,this.keyMap=i,this.itemCount=a}};const Le=n(null),Re=n(null),ze=r(function(t,n){return[t,n]=O(t,n,Le),e.createElement(pe,{content:e.createElement(Ce,t)},r=>e.createElement(Be,{props:t,collection:r,treeRef:n}))}),Q={expand:{ltr:`ArrowRight`,rtl:`ArrowLeft`},collapse:{ltr:`ArrowLeft`,rtl:`ArrowRight`}};function Be({props:t,collection:n,treeRef:r}){let{dragAndDropHooks:i}=t,{direction:a}=ne(),l=w({usage:`search`,sensitivity:`base`}),f=!!i?.useDraggableCollectionState,m=!!i?.useDroppableCollectionState,h=u(f),g=u(m);s(()=>{h.current!==f&&console.warn(`Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.`),g.current!==m&&console.warn(`Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.`)},[f,m]);let{selectionMode:_=`none`,expandedKeys:v,defaultExpandedKeys:y,onExpandedChange:b,disabledBehavior:x=`all`}=t,{CollectionRoot:ie,isVirtualized:T,layoutDelegate:E,dropTargetDelegate:se}=o(Oe),[O,ce]=le(v?$(v):void 0,y?$(y):new Set,b),k=c(()=>new Ie({collection:n,expandedKeys:O}),[n,O]),j=ae({...t,selectionMode:_,expandedKeys:O,onExpandedChange:ce,collection:k,children:void 0,disabledBehavior:x}),{gridProps:M}=re({...t,isVirtualized:T,layoutDelegate:E},j,r),N,P,F,I=!1,L=null,R=u(null);if(f&&i){N=i.useDraggableCollectionState({collection:j.collection,selectionManager:j.selectionManager,preview:i.renderDragPreview?R:void 0}),i.useDraggableCollection({},N,r);let t=i.DragPreview;L=i.renderDragPreview?e.createElement(t,{ref:R},i.renderDragPreview):null}let[z]=d(()=>new Fe);if(m&&i){P=i.useDroppableCollectionState({collection:j.collection,selectionManager:j.selectionManager});let e=i.dropTargetDelegate||se||new i.ListDropTargetDelegate(j.collection,r,{direction:a});z.setup(e,j,a);let t=new S({collection:j.collection,collator:l,ref:r,disabledKeys:j.selectionManager.disabledKeys,disabledBehavior:j.selectionManager.disabledBehavior,direction:a,layoutDelegate:E});F=i.useDroppableCollection({keyboardDelegate:t,dropTargetDelegate:z,onDropActivate:e=>{if(e.target.type===`item`){let t=e.target.key,n=j.collection.getItem(t),r=O!==`all`&&O.has(t);n&&n.hasChildNodes&&(!r||i!=null&&i.isVirtualDragging?.call(i))&&j.toggleKey(t)}},onKeyDown:e=>{let t=P?.target;if(t&&t.type===`item`&&t.dropPosition===`on`){let n=j.collection.getItem(t.key);(e.key===Q.expand[a]&&n?.hasChildNodes&&!j.expandedKeys.has(t.key)||e.key===Q.collapse[a]&&n?.hasChildNodes&&j.expandedKeys.has(t.key))&&j.toggleKey(t.key)}}},P,r);let n=P.getDropOperation;P.getDropOperation=e=>{let{target:t,isInternal:r}=e,i=N?.draggingKeys??new Set;if(r&&t.type===`item`&&i.size>0){if(i.has(t.key)&&t.dropPosition===`on`)return`cancel`;let e=t.key;for(;e!=null;){let t=j.collection.getItem(e)?.parentKey;if(t!=null&&i.has(t))return`cancel`;e=t??null}}return n(e)},I=P.isDropTarget({type:`root`})}let B=!!(f&&!N?.isDisabled),{focusProps:V,isFocused:H,isFocusVisible:U}=te(),W={isEmpty:j.collection.size===0,isFocused:H,isFocusVisible:U,isDropTarget:I,selectionMode:j.selectionManager.selectionMode,allowsDragging:!!B,state:j},G=D({...t,children:void 0,defaultClassName:`react-aria-Tree`,values:W}),K=null;if(j.collection.size===0&&t.renderEmptyState){let{isEmpty:n,...r}=W,i=t.renderEmptyState({...r});K=e.createElement(`div`,{role:`row`,style:{display:`contents`},"aria-level":1},e.createElement(`div`,{role:`gridcell`,style:{display:`contents`}},i))}let q=p(t,{global:!0});return e.createElement(e.Fragment,null,e.createElement(ee,null,e.createElement(A.div,{...C(q,G,M,V,F?.collectionProps),ref:r,slot:t.slot||void 0,"data-empty":j.collection.size===0||void 0,"data-focused":H||void 0,"data-drop-target":I||void 0,"data-focus-visible":U||void 0,"data-selection-mode":j.selectionManager.selectionMode===`none`?void 0:j.selectionManager.selectionMode,"data-allows-dragging":!!B||void 0},e.createElement(oe,{values:[[Re,j],[Z,{dragAndDropHooks:i,dragState:N,dropState:P}],[ke,{render:We}]]},m&&e.createElement(qe,null),e.createElement(Pe,null,e.createElement(ie,{collection:j.collection,persistedKeys:Me(j.selectionManager,i,P),scrollRef:r,renderDropIndicator:je(i,P)}))),K)),L)}var Ve=class extends M{};Ve.type=`content`;var He=class extends M{};He.type=`item`,be(F,function(t,n,r){let{isVirtualized:i}=o(Oe),a=o(Re),{isLoading:s,onLoadMore:l,scrollOffset:d,...f}=t,h=u(null),g=c(()=>({onLoadMore:l,collection:a?.collection,sentinelRef:h,scrollOffset:d}),[l,d,a?.collection]);v(g,h),n=y(n);let{rowProps:_,gridCellProps:b}=ie({node:r},a,n),x=_[`aria-level`]||1,ee={role:`row`,"aria-level":_[`aria-level`]},S=D({...f,id:void 0,children:r.rendered,defaultClassName:`react-aria-TreeLoader`,values:{level:x}}),w={};return i&&(w={display:`contents`}),e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:m(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),s&&S.children&&e.createElement(A.div,{ref:n,...C(p(t),ee),...S,"data-level":x},e.createElement(`div`,{...b,style:w},S.children)))});function $(e){return e?e===`all`?`all`:new Set(e):new Set}function Ue(e,t){let{expandedKeys:n=new Set}=t,r=new Map,i=[],a=0,o=new Map,s=t=>{if(t.type===`item`||t.type===`loader`){let s=t?.parentKey,c={...t};s==null?r.set(t.key,t):([...e.getChildren(s)][0].type!==`item`&&(c.index=t?.index==null?0:t?.index-1),t.type===`loader`&&(c.level=t.level+1),r.set(c.key,c));let l=r.get(t.key)||t;(l.level===0||l.parentKey!=null&&n.has(l.parentKey)&&o.get(l.parentKey))&&(l.type===`item`&&a++,i.push(l),o.set(l.key,!0))}else t.type!==null&&r.set(t.key,t);for(let n of e.getChildren(t.key))s(n)};for(let t of e)s(t);return{flattenedRows:i,keyMap:r,itemCount:a}}function We(t,n){n=y(n);let{dragAndDropHooks:r,dropState:i}=o(Z),a=u(null),{dropIndicatorProps:s,isHidden:c,isDropTarget:l}=r.useDropIndicator(t,i,a);if(c)return null;let d=i&&t.target.type===`item`?(i.collection.getItem(t.target.key)?.level||0)+1:1;return e.createElement(Ke,{...t,dropIndicatorProps:s,isDropTarget:l,ref:n,buttonRef:a,level:d})}function Ge(t,n){let{dropIndicatorProps:r,isDropTarget:i,buttonRef:a,level:o,...s}=t,{visuallyHiddenProps:c}=T(),l=D({...s,defaultClassName:`react-aria-DropIndicator`,defaultStyle:{position:`relative`,"--tree-item-level":o},values:{isDropTarget:i}});return e.createElement(A.div,{...l,role:`row`,"aria-level":o,ref:n,"data-drop-target":i||void 0},e.createElement(`div`,{role:`gridcell`},e.createElement(`div`,{...c,role:`button`,...r,ref:a}),l.children))}const Ke=r(Ge);function qe(){let{dragAndDropHooks:t,dropState:n}=o(Z),r=u(null),{dropIndicatorProps:i}=t.useDropIndicator({target:{type:`root`}},n,r),a=n.isDropTarget({type:`root`}),{visuallyHiddenProps:s}=T();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})))}export{ze as Tree};
|
|
@@ -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,useGridListSelectionCheckbox as ee,useHover as y,useId as b,useTreeItem as x,useVisuallyHidden as S}from"react-aria";import"react-stately";const C=n(null);n(null),n(null),n(null),n(null),n({}),n(null),n(null);const w=Symbol(`default`);function T({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function E(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 D(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 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)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;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]=I(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`;function I(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 L(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])}const R=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const z=n(null);function B(e){var t;return t=class extends A{},t.type=e,t}function V(t,n,r,i,s,c){typeof t==`string`&&(t=B(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 H(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(g);if(!o(R)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return V(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}function U(t,n,i=W){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>V(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function W(e){return L({...e,addIdAndValue:!0})}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 L({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),te=n({}),ne=n({}),re=n({isSelected:!1}),Y=n(null);var X=class extends A{};X.type=`content`;const ie=n(null);var Z=class extends A{};Z.type=`item`;const Q=U(Z,(t,n,r)=>{let i=o(Y);n=h(n);let{dragAndDropHooks:a,dragState:c,dropState:d}=o(ne),{rowProps:f,gridCellProps:p,expandButtonProps:m,descriptionProps:g,...D}=x({node:r,shouldSelectOnPressUp:!!c},i,n),O=f[`aria-expanded`]===!0,A=t.hasChildItems||[...i.collection.getChildren(r.key)].length>1,j=f[`aria-level`]||1,{hoverProps:M,isHovered:N}=y({isDisabled:!D.allowsSelection&&!D.hasAction,onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),{isFocusVisible:P,focusProps:F}=v(),{isFocusVisible:I,focusProps:R}=v({within:!0}),{checkboxProps:z}=ee({key:r.key},i),B=null;c&&a&&(B=a.useDraggableItem({key:r.key,hasDragButton:!0},c));let V=null,H=l(null),U=l(null),W=l(null),{visuallyHiddenProps:G}=S();d&&a&&(V=a.useDropIndicator({target:{type:`item`,key:r.key,dropPosition:`on`},activateButtonRef:W},d,U));let K=c&&c.isDragging(r.key),q=V?.isDropTarget,J=i.selectionManager.selectionMode,X=i.selectionManager.selectionBehavior,Z=e.useMemo(()=>({...D,isHovered:N,isFocusVisible:P,isExpanded:O,hasChildItems:A,level:j,selectionMode:J,selectionBehavior:X,isFocusVisibleWithin:I,state:i,id:r.key,allowsDragging:!!c,isDragging:K,isDropTarget:q}),[D,N,P,O,A,j,I,i,r.key,c,K,q,X,J]),Q=E({...t,id:void 0,children:r.rendered,defaultClassName:`react-aria-TreeItem`,defaultStyle:{"--tree-item-level":j},values:Z});s(()=>{r.textValue},[r.textValue]),s(()=>{A&&H.current},[]);let ae=l(null);s(()=>{c&&ae.current},[]);let oe=L({items:i.collection.getChildren(r.key),children:t=>{switch(t.type){case`content`:return t.render(t);case`loader`:case`item`:return e.createElement(e.Fragment,null);default:throw Error(`Unsupported element type in TreeRow: `+t.type)}}}),se=b(),$=u(t,{global:!0});return delete $.id,delete $.onClick,e.createElement(e.Fragment,null,V&&!V.isHidden&&e.createElement(`div`,{role:`row`,"aria-level":f[`aria-level`],"aria-expanded":f[`aria-expanded`],"aria-label":V.dropIndicatorProps[`aria-label`]},e.createElement(`div`,{role:`gridcell`,"aria-colindex":1,style:{display:`contents`}},e.createElement(`div`,{role:`button`,...G,...V.dropIndicatorProps,ref:U}),f[`aria-expanded`]==null?null:e.createElement(`div`,{role:`button`,...G,id:se,"aria-label":m[`aria-label`],"aria-labelledby":`${se} ${f.id}`,tabIndex:-1,ref:W}))),e.createElement(k.div,{..._($,f,F,M,R,B?.dragProps),...Q,ref:n,"data-expanded":A&&O||void 0,"data-has-child-items":A||void 0,"data-level":j,"data-selected":D.isSelected||void 0,"data-disabled":D.isDisabled||void 0,"data-hovered":N||void 0,"data-focused":D.isFocused||void 0,"data-focus-visible":P||void 0,"data-pressed":D.isPressed||void 0,"data-selection-mode":i.selectionManager.selectionMode===`none`?void 0:i.selectionManager.selectionMode,"data-allows-dragging":!!c||void 0,"data-dragging":K||void 0,"data-drop-target":q||void 0},e.createElement(`div`,{...p,style:{display:`contents`}},e.createElement(T,{values:[[C,{slots:{selection:z}}],[te,{slots:{[w]:{},chevron:{...m,ref:H},drag:{...B?.dragButtonProps,ref:ae,style:{pointerEvents:`none`}}}}],[ie,{...Z}],[re,{isSelected:D.isSelected}]]},oe))))});H(N,function(t,n,r){let{isVirtualized:i}=o(J),a=o(Y),{isLoading:s,onLoadMore:f,scrollOffset:p,...g}=t,v=l(null),ee=c(()=>({onLoadMore:f,collection:a?.collection,sentinelRef:v,scrollOffset:p}),[f,p,a?.collection]);m(ee,v),n=h(n);let{rowProps:y,gridCellProps:b}=x({node:r},a,n),S=y[`aria-level`]||1,C={role:`row`,"aria-level":y[`aria-level`]},w=E({...g,id:void 0,children:r.rendered,defaultClassName:`react-aria-TreeLoader`,values:{level:S}}),T={};return i&&(T={display:`contents`}),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:v,style:{position:`absolute`,height:1,width:1}})),s&&w.children&&e.createElement(k.div,{ref:n,..._(u(t),C),...w,"data-level":S},e.createElement(`div`,{...b,style:T},w.children)))});export{Q as TreeItem};
|
|
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,useGridListSelectionCheckbox as ee,useHover as y,useId as b,useTreeItem as x,useVisuallyHidden as S}from"react-aria";import"react-stately";const C=n(null);n(null),n(null),n(null),n(null),n({}),n(null),n(null);const w=Symbol(`default`);function T({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function E(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 D(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 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]=I(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`;function I(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 L(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 R=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const z=n(null);function B(e){var t;return t=class extends A{},t.type=e,t}function V(t,n,r,i,s,c){typeof t==`string`&&(t=B(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 H(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(g);if(!o(R)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return V(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}function U(t,n,i=W){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>V(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function W(e){return L({...e,addIdAndValue:!0})}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 L({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),te=n({}),ne=n({}),re=n({isSelected:!1}),Y=n(null);var X=class extends A{};X.type=`content`;const ie=n(null);var Z=class extends A{};Z.type=`item`;const Q=U(Z,(t,n,r)=>{let i=o(Y);n=h(n);let{dragAndDropHooks:a,dragState:c,dropState:d}=o(ne),{rowProps:f,gridCellProps:p,expandButtonProps:m,descriptionProps:g,...D}=x({node:r,shouldSelectOnPressUp:!!c},i,n),O=f[`aria-expanded`]===!0,A=t.hasChildItems||[...i.collection.getChildren(r.key)].length>1,j=f[`aria-level`]||1,{hoverProps:M,isHovered:N}=y({isDisabled:!D.allowsSelection&&!D.hasAction,onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),{isFocusVisible:P,focusProps:F}=v(),{isFocusVisible:I,focusProps:R}=v({within:!0}),{checkboxProps:z}=ee({key:r.key},i),B=null;c&&a&&(B=a.useDraggableItem({key:r.key,hasDragButton:!0},c));let V=null,H=l(null),U=l(null),W=l(null),{visuallyHiddenProps:G}=S();d&&a&&(V=a.useDropIndicator({target:{type:`item`,key:r.key,dropPosition:`on`},activateButtonRef:W},d,U));let K=c&&c.isDragging(r.key),q=V?.isDropTarget,J=i.selectionManager.selectionMode,X=i.selectionManager.selectionBehavior,Z=e.useMemo(()=>({...D,isHovered:N,isFocusVisible:P,isExpanded:O,hasChildItems:A,level:j,selectionMode:J,selectionBehavior:X,isFocusVisibleWithin:I,state:i,id:r.key,allowsDragging:!!c,isDragging:K,isDropTarget:q}),[D,N,P,O,A,j,I,i,r.key,c,K,q,X,J]),Q=E({...t,id:void 0,children:r.rendered,defaultClassName:`react-aria-TreeItem`,defaultStyle:{"--tree-item-level":j},values:Z});s(()=>{r.textValue},[r.textValue]),s(()=>{A&&H.current},[]);let ae=l(null);s(()=>{c&&ae.current},[]);let oe=L({items:i.collection.getChildren(r.key),children:t=>{switch(t.type){case`content`:return t.render(t);case`loader`:case`item`:return e.createElement(e.Fragment,null);default:throw Error(`Unsupported element type in TreeRow: `+t.type)}}}),se=b(),$=u(t,{global:!0});return delete $.id,delete $.onClick,e.createElement(e.Fragment,null,V&&!V.isHidden&&e.createElement(`div`,{role:`row`,"aria-level":f[`aria-level`],"aria-expanded":f[`aria-expanded`],"aria-label":V.dropIndicatorProps[`aria-label`]},e.createElement(`div`,{role:`gridcell`,"aria-colindex":1,style:{display:`contents`}},e.createElement(`div`,{role:`button`,...G,...V.dropIndicatorProps,ref:U}),f[`aria-expanded`]==null?null:e.createElement(`div`,{role:`button`,...G,id:se,"aria-label":m[`aria-label`],"aria-labelledby":`${se} ${f.id}`,tabIndex:-1,ref:W}))),e.createElement(k.div,{..._($,f,F,M,R,B?.dragProps),...Q,ref:n,"data-expanded":A&&O||void 0,"data-has-child-items":A||void 0,"data-level":j,"data-selected":D.isSelected||void 0,"data-disabled":D.isDisabled||void 0,"data-hovered":N||void 0,"data-focused":D.isFocused||void 0,"data-focus-visible":P||void 0,"data-pressed":D.isPressed||void 0,"data-selection-mode":i.selectionManager.selectionMode===`none`?void 0:i.selectionManager.selectionMode,"data-allows-dragging":!!c||void 0,"data-dragging":K||void 0,"data-drop-target":q||void 0},e.createElement(`div`,{...p,style:{display:`contents`}},e.createElement(T,{values:[[C,{slots:{selection:z}}],[te,{slots:{[w]:{},chevron:{...m,ref:H},drag:{...B?.dragButtonProps,ref:ae,style:{pointerEvents:`none`}}}}],[ie,{...Z}],[re,{isSelected:D.isSelected}]]},oe))))});H(N,function(t,n,r){let{isVirtualized:i}=o(J),a=o(Y),{isLoading:s,onLoadMore:f,scrollOffset:p,...g}=t,v=l(null),ee=c(()=>({onLoadMore:f,collection:a?.collection,sentinelRef:v,scrollOffset:p}),[f,p,a?.collection]);m(ee,v),n=h(n);let{rowProps:y,gridCellProps:b}=x({node:r},a,n),S=y[`aria-level`]||1,C={role:`row`,"aria-level":y[`aria-level`]},w=E({...g,id:void 0,children:r.rendered,defaultClassName:`react-aria-TreeLoader`,values:{level:S}}),T={};return i&&(T={display:`contents`}),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:v,style:{position:`absolute`,height:1,width:1}})),s&&w.children&&e.createElement(k.div,{ref:n,..._(u(t),C),...w,"data-level":S},e.createElement(`div`,{...b,style:T},w.children)))});export{Q as TreeItem};
|
|
@@ -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,useTreeItem as _}from"react-aria";import"react-stately";function v(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 y(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 b={},x=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=b[t];return n||(n=r(y.bind(null,t)),b[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,useTreeItem as _}from"react-aria";import"react-stately";function v(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 y(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 b={},x=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=b[t];return n||(n=r(y.bind(null,t)),b[t]=n),n}});var S=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}},C=class extends S{filter(e,t,n){let[r,i]=O(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},w=class extends S{};w.type=`header`;var T=class extends S{};T.type=`loader`;var E=class extends C{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};E.type=`item`;var D=class extends C{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}};D.type=`section`;function O(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 k(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 A=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const j=n(null);function M(e){var t;return t=class extends S{},t.type=e,t}function N(t,n,r,i,s,c){typeof t==`string`&&(t=M(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(j);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(j.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function P(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(h);if(!o(A)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return N(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}const F={CollectionRoot({collection:e,renderDropIndicator:t}){return I(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return I(e,t,n)}};function I(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,L(t,n,r))}})}function L(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 R=n(F),z=n(null);var B=class extends S{};B.type=`content`;const V=P(B,function(t){let n=o(H),r=v({children:t.children,values:n});return e.createElement(R.Provider,{value:F},r.children)}),H=n(null);var U=class extends S{};U.type=`item`,P(T,function(t,n,r){let{isVirtualized:i}=o(R),a=o(z),{isLoading:d,onLoadMore:f,scrollOffset:h,...y}=t,b=c(null),S=s(()=>({onLoadMore:f,collection:a?.collection,sentinelRef:b,scrollOffset:h}),[f,h,a?.collection]);p(S,b),n=m(n);let{rowProps:C,gridCellProps:w}=_({node:r},a,n),T=C[`aria-level`]||1,E={role:`row`,"aria-level":C[`aria-level`]},D=v({...y,id:void 0,children:r.rendered,defaultClassName:`react-aria-TreeLoader`,values:{level:T}}),O={};return i&&(O={display:`contents`}),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:b,style:{position:`absolute`,height:1,width:1}})),d&&D.children&&e.createElement(x.div,{ref:n,...g(l(t),E),...D,"data-level":T},e.createElement(`div`,{...w,style:O},D.children)))});export{V as TreeItemContent};
|
|
@@ -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,useTreeItem as _}from"react-aria";import"react-stately";function v(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 y(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 b={},x=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=b[t];return n||(n=r(y.bind(null,t)),b[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,useTreeItem as _}from"react-aria";import"react-stately";function v(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 y(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 b={},x=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=b[t];return n||(n=r(y.bind(null,t)),b[t]=n),n}});var S=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}},C=class extends S{filter(e,t,n){let[r,i]=O(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},w=class extends S{};w.type=`header`;var T=class extends S{};T.type=`loader`;var E=class extends C{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};E.type=`item`;var D=class extends C{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}};D.type=`section`;function O(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 k(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 A=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const j=n(null);function M(e){var t;return t=class extends S{},t.type=e,t}function N(t,n,r,i,s,c){typeof t==`string`&&(t=M(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(j);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(j.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function P(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(h);if(!o(A)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return N(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}const F={CollectionRoot({collection:e,renderDropIndicator:t}){return I(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return I(e,t,n)}};function I(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,L(t,n,r))}})}function L(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 R=n(F),z=n(null);var B=class extends S{};B.type=`content`;var V=class extends S{};V.type=`item`;const H=P(T,function(t,n,r){let{isVirtualized:i}=o(R),a=o(z),{isLoading:d,onLoadMore:f,scrollOffset:h,...y}=t,b=c(null),S=s(()=>({onLoadMore:f,collection:a?.collection,sentinelRef:b,scrollOffset:h}),[f,h,a?.collection]);p(S,b),n=m(n);let{rowProps:C,gridCellProps:w}=_({node:r},a,n),T=C[`aria-level`]||1,E={role:`row`,"aria-level":C[`aria-level`]},D=v({...y,id:void 0,children:r.rendered,defaultClassName:`react-aria-TreeLoader`,values:{level:T}}),O={};return i&&(O={display:`contents`}),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:b,style:{position:`absolute`,height:1,width:1}})),d&&D.children&&e.createElement(x.div,{ref:n,...g(l(t),E),...D,"data-level":T},e.createElement(`div`,{...w,style:O},D.children)))});export{H as TreeLoadMoreItem};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ToastParams, r as useToast, t as ToastOptions } from "../useToast-
|
|
1
|
+
import { n as ToastParams, r as useToast, t as ToastOptions } from "../useToast-COxVxlxx.js";
|
|
2
2
|
export { ToastOptions, ToastParams, useToast };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{cloneElement as t,createContext as n,isValidElement as r,useCallback as i,useContext as a,useEffect as o,useMemo as s,useRef as c,useState as l}from"react";import{useEffectEvent as u,useEvent as d,useLayoutEffect as f,useResizeObserver as p}from"@react-aria/utils";import{useLocale as m}from"@react-aria/i18n";import{flushSync as h}from"react-dom";function g(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])}const _={CollectionRoot({collection:e,renderDropIndicator:t}){return v(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return v(e,t,n)}};function v(t,n,r){return g({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,y(t,n,r))}})}function y(e,n,i){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=i({type:`item`,key:a.key,dropPosition:`after`});r(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const b=n(_);var x=class e{copy(){return new e(this.x,this.y)}equals(e){return this.x===e.x&&this.y===e.y}isOrigin(){return this.x===0&&this.y===0}constructor(e=0,t=0){this.x=e,this.y=t}},S=class e{get maxX(){return this.x+this.width}get maxY(){return this.y+this.height}get area(){return this.width*this.height}get topLeft(){return new x(this.x,this.y)}get topRight(){return new x(this.maxX,this.y)}get bottomLeft(){return new x(this.x,this.maxY)}get bottomRight(){return new x(this.maxX,this.maxY)}intersects(e){return this.area>0&&e.area>0&&this.x<=e.x+e.width&&e.x<=this.x+this.width&&this.y<=e.y+e.height&&e.y<=this.y+this.height}containsRect(e){return this.x<=e.x&&this.y<=e.y&&this.maxX>=e.maxX&&this.maxY>=e.maxY}containsPoint(e){return this.x<=e.x&&this.y<=e.y&&this.maxX>=e.x&&this.maxY>=e.y}getCornerInRect(e){for(let t of[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`])if(e.containsPoint(this[t]))return t;return null}equals(e){return e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height}pointEquals(e){return this.x===e.x&&this.y===e.y}sizeEquals(e){return this.width===e.width&&this.height===e.height}union(t){let n=Math.min(this.x,t.x),r=Math.min(this.y,t.y),i=Math.max(this.maxX,t.maxX)-n,a=Math.max(this.maxY,t.maxY)-r;return new e(n,r,i,a)}intersection(t){if(!this.intersects(t))return new e(0,0,0,0);let n=Math.max(this.x,t.x),r=Math.max(this.y,t.y);return new e(n,r,Math.min(this.maxX,t.maxX)-n,Math.min(this.maxY,t.maxY)-r)}copy(){return new e(this.x,this.y,this.width,this.height)}constructor(e=0,t=0,n=0,r=0){this.x=e,this.y=t,this.width=n,this.height=r}},C=class e{copy(){return new e(this.width,this.height)}equals(e){return this.width===e.width&&this.height===e.height}get area(){return this.width*this.height}constructor(e=0,t=0){this.width=Math.max(e,0),this.height=Math.max(t,0)}};let w=0;var T=class{prepareForReuse(){this.content=null,this.rendered=null,this.layoutInfo=null}getReusableView(e){let t=this.reusableViews.get(e);return t&&t.length>0?t.shift():new D(this.virtualizer,this,e)}reuseChild(e){e.prepareForReuse();let t=this.reusableViews.get(e.viewType);t||(t=[],this.reusableViews.set(e.viewType,t)),t.push(e)}constructor(e,t){this.virtualizer=e,this.key=++w,this.viewType=t,this.children=new Set,this.reusableViews=new Map,this.layoutInfo=null,this.content=null,this.rendered=null}},E=class extends T{constructor(e){super(e,`root`)}},D=class extends T{constructor(e,t,n){super(e,n),this.parent=t}};function O(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}var k=class{setVisibleRect(e){let t=performance.now()-this.startTime;t<500&&(e.x!==this.visibleRect.x&&t>0&&(this.velocity.x=(e.x-this.visibleRect.x)/t),e.y!==this.visibleRect.y&&t>0&&(this.velocity.y=(e.y-this.visibleRect.y)/t)),this.startTime=performance.now(),this.visibleRect=e}getOverscannedRect(){let e=this.visibleRect.copy(),t=this.visibleRect.height/3;if(e.height+=t,this.velocity.y<0&&(e.y-=t),this.velocity.x!==0){let t=this.visibleRect.width/3;e.width+=t,this.velocity.x<0&&(e.x-=t)}return e}constructor(){this.startTime=0,this.velocity=new x(0,0),this.visibleRect=new S}},A=class{isPersistedKey(e){if(this.persistedKeys.has(e))return!0;for(let t of this.persistedKeys)for(;t!=null;){let n=this.layout.getLayoutInfo(t);if(!n||n.parentKey==null)break;if(t=n.parentKey,t===e)return!0}return!1}getParentView(e){return e.parentKey==null?this._rootView:this._visibleViews.get(e.parentKey)}getReusableView(e){let t=this.getParentView(e).getReusableView(e.type);return t.layoutInfo=e,this._renderView(t),t}_renderView(e){if(e.layoutInfo){let{type:t,key:n,content:r}=e.layoutInfo;e.content=r||this.collection.getItem(n),e.rendered=this._renderContent(t,e.content)}}_renderContent(e,t){let n=t==null?null:this._renderedContent.get(t);if(n!=null)return n;let r=this.delegate.renderView(e,t);return t&&this._renderedContent.set(t,r),r}keyAtPoint(e){let t=new S(e.x,e.y,1,1),n=t.area===0?[]:this.layout.getVisibleLayoutInfos(t);for(let e of n)if(e.rect.intersects(t))return e.key;return null}relayout(e={}){this.layout.update(e),this.contentSize=this.layout.getContentSize();let t=this.visibleRect,n=e.contentChanged?0:t.x,r=e.contentChanged?0:t.y;if(n=Math.max(0,Math.min(this.contentSize.width-t.width,n)),r=Math.max(0,Math.min(this.contentSize.height-t.height,r)),n!==t.x||r!==t.y){let e=new S(n,r,t.width,t.height);this.delegate.setVisibleRect(e)}else this.updateSubviews()}getVisibleLayoutInfos(){let e;e=this._overscanManager.getOverscannedRect();let t=this.layout.getVisibleLayoutInfos(e),n=new Map;for(let e of t)n.set(e.key,e);return n}updateSubviews(){let e=this.getVisibleLayoutInfos(),t=new Set;for(let[n,r]of this._visibleViews){let i=e.get(n);(!i||r.parent!==this.getParentView(i))&&(this._visibleViews.delete(n),r.parent.reuseChild(r),t.add(r))}for(let[n,r]of e){let e=this._visibleViews.get(n);if(!e)e=this.getReusableView(r),e.parent.children.add(e),this._visibleViews.set(n,e),t.delete(e);else{e.layoutInfo=r;let t=this.collection.getItem(r.key);e.content!==t&&(e.content!=null&&this._renderedContent.delete(e.content),this._renderView(e))}}for(let e of t)e.parent.children.delete(e),e.parent.reusableViews.clear();if(!this._isScrolling)for(let t of e.keys()){let e=this._visibleViews.get(t);e.parent.children.delete(e),e.parent.children.add(e)}}render(e){let t=this,n=!1,r=!1,i=!1,a=!1,o=!1,s=!1;return e.collection!==this.collection&&(t.collection=e.collection,n=!0),(e.layout!==this.layout||this.layout.virtualizer!==this)&&(this.layout&&(this.layout.virtualizer=null),e.layout.virtualizer=this,t.layout=e.layout,n=!0),e.persistedKeys&&!O(e.persistedKeys,this.persistedKeys)&&(t.persistedKeys=e.persistedKeys,s=!0),this.visibleRect.equals(e.visibleRect)||(this._overscanManager.setVisibleRect(e.visibleRect),this.layout.shouldInvalidate(e.visibleRect,this.visibleRect)?(r=!e.visibleRect.pointEquals(this.visibleRect),i=!e.visibleRect.sizeEquals(this.visibleRect),n=!0):s=!0,t.visibleRect=e.visibleRect),e.invalidationContext!==this._invalidationContext&&(e.invalidationContext&&(i||=e.invalidationContext.sizeChanged||!1,r||=e.invalidationContext.offsetChanged||!1,a||=e.invalidationContext.itemSizeChanged||!1,o||=e.invalidationContext.layoutOptions!=null&&this._invalidationContext.layoutOptions!=null&&e.invalidationContext.layoutOptions!==this._invalidationContext.layoutOptions&&this.layout.shouldInvalidateLayoutOptions(e.invalidationContext.layoutOptions,this._invalidationContext.layoutOptions),n||=a||i||r||o),this._invalidationContext=e.invalidationContext),e.isScrolling!==this._isScrolling&&(this._isScrolling=e.isScrolling,e.isScrolling||(s=!0)),n?this.relayout({offsetChanged:r,sizeChanged:i,itemSizeChanged:a,layoutOptionsChanged:o,layoutOptions:this._invalidationContext.layoutOptions}):s&&this.updateSubviews(),Array.from(this._rootView.children)}getVisibleView(e){return this._visibleViews.get(e)}invalidate(e){this.delegate.invalidate(e)}updateItemSize(e,t){this.layout.updateItemSize&&this.layout.updateItemSize(e,t)&&this.invalidate({itemSizeChanged:!0})}constructor(e){this.delegate=e.delegate,this.collection=e.collection,this.layout=e.layout,this.contentSize=new C,this.visibleRect=new S,this.persistedKeys=new Set,this._visibleViews=new Map,this._renderedContent=new WeakMap,this._rootView=new E(this),this._isScrolling=!1,this._invalidationContext={},this._overscanManager=new k}};const j=typeof document<`u`?e.useLayoutEffect:()=>{};function M(e){let[t,n]=l(new S(0,0,0,0)),[r,a]=l(!1),[o,u]=l({}),d=c(!1),[f]=l(()=>new A({collection:e.collection,layout:e.layout,delegate:{setVisibleRect(e){n(e),d.current=!0},renderView:e.renderView,invalidate:u}}));j(()=>{d.current&&(d.current=!1,e.onVisibleRectChange(t))});let p=s(()=>e.layoutOptions==null?o:{...o,layoutOptions:e.layoutOptions},[o,e.layoutOptions]),m=f.render({layout:e.layout,collection:e.collection,persistedKeys:e.persistedKeys,layoutOptions:e.layoutOptions,visibleRect:t,invalidationContext:p,isScrolling:r}),h=f.contentSize,g=i(()=>{a(!0)},[]),_=i(()=>{a(!1)},[]);return s(()=>({virtualizer:f,visibleViews:m,setVisibleRect:n,contentSize:h,isScrolling:r,startScrolling:g,endScrolling:_}),[f,m,n,h,r,g,_])}let N=null;function P(e=!1){if(N===null||e){let e=document.createElement(`div`),t=e.style;t.width=`50px`,t.height=`50px`,t.overflow=`scroll`,t.direction=`rtl`;let n=document.createElement(`div`),r=n.style;return r.width=`100px`,r.height=`100px`,e.appendChild(n),document.body.appendChild(e),e.scrollLeft>0?N=`positive-descending`:(e.scrollLeft=1,N=e.scrollLeft===0?`negative`:`positive-ascending`),document.body.removeChild(e),N}return N}function F(e,t){let{scrollLeft:n}=e;if(t===`rtl`){let{scrollWidth:t,clientWidth:r}=e;switch(P()){case`negative`:n=-n;break;case`positive-descending`:n=t-r-n}}return n}function I(e,t){let{contentSize:n,onVisibleRectChange:r,innerStyle:a,onScrollStart:s,onScrollEnd:g,scrollDirection:_=`both`,...v}=e,y=c({scrollTop:0,scrollLeft:0,scrollEndTime:0,scrollTimeout:null,width:0,height:0,isScrolling:!1}).current,{direction:b}=m(),[x,C]=l(!1),w=i(t=>{t.target===t.currentTarget&&(e.onScroll&&e.onScroll(t),h(()=>{let e=t.currentTarget.scrollTop,i=F(t.currentTarget,b);y.scrollTop=Math.max(0,Math.min(e,n.height-y.height)),y.scrollLeft=Math.max(0,Math.min(i,n.width-y.width)),r(new S(y.scrollLeft,y.scrollTop,y.width,y.height)),y.isScrolling||(y.isScrolling=!0,C(!0),window.dispatchEvent(new Event(`tk.disconnect-observer`)),s&&s());let a=Date.now();y.scrollEndTime<=a+50&&(y.scrollEndTime=a+300,y.scrollTimeout!=null&&clearTimeout(y.scrollTimeout),y.scrollTimeout=setTimeout(()=>{y.isScrolling=!1,C(!1),y.scrollTimeout=null,window.dispatchEvent(new Event(`tk.connect-observer`)),g&&g()},300))}))},[e,b,y,n,r,s,g]);d(t,`scroll`,w),o(()=>()=>{y.scrollTimeout!=null&&clearTimeout(y.scrollTimeout),y.isScrolling&&window.dispatchEvent(new Event(`tk.connect-observer`))},[]);let T=c(!1),E=i(e=>{let n=t.current;if(!n||T.current)return;T.current=!0,Object.getOwnPropertyNames(window.HTMLElement.prototype).includes(`clientWidth`),Object.getOwnPropertyNames(window.HTMLElement.prototype).includes(`clientHeight`);let i=n.clientWidth,a=n.clientHeight,o=i,s=a;(y.width!==o||y.height!==s)&&(y.width=o,y.height=s,e(()=>{r(new S(y.scrollLeft,y.scrollTop,o,s))}),(i!==n.clientWidth||a!==n.clientHeight)&&(y.width=n.clientWidth,y.height=n.clientHeight,e(()=>{r(new S(y.scrollLeft,y.scrollTop,y.width,y.height))}))),T.current=!1},[t,y,r]),D=u(E),O=c(null),[k,A]=l({});f(()=>{if(!T.current&&(O.current==null||!n.equals(O.current)))if(typeof IS_REACT_ACT_ENVIRONMENT==`boolean`?IS_REACT_ACT_ENVIRONMENT:typeof jest<`u`){A({}),O.current=n;return}else queueMicrotask(()=>D(h));O.current=n}),f(()=>{D(e=>e())},[k]);let j=i(()=>{E(h)},[E]);p({ref:t,box:`border-box`,onResize:j});let M={padding:0,...v.style};return _===`horizontal`?(M.overflowX=`auto`,M.overflowY=`hidden`):_===`vertical`||n.width===y.width?(M.overflowY=`auto`,M.overflowX=`hidden`):M.overflow=`auto`,a={width:Number.isFinite(n.width)?n.width:void 0,height:Number.isFinite(n.height)?n.height:void 0,pointerEvents:x?`none`:`auto`,position:`relative`,...a},{isScrolling:x,scrollViewProps:{...v,style:M},contentProps:{role:`presentation`,style:a}}}function L(e){let{layoutInfo:t,virtualizer:n,ref:r}=e,a=t?.key,o=i(()=>{if(a!=null&&r.current){let e=R(r.current);n.updateItemSize(a,e)}},[n,a,r]);return f(()=>{t?.estimatedSize&&o()}),{updateSize:o}}function R(e){let t=e.style.height;e.style.height=``;let n=new C(e.scrollWidth,e.scrollHeight);return e.style.height=t,n}function z(t){let{style:n,className:r,layoutInfo:i,virtualizer:a,parent:o,children:s}=t,{direction:l}=m(),u=c(null);return L({layoutInfo:i,virtualizer:a,ref:u}),e.createElement(`div`,{role:`presentation`,ref:u,className:r,style:{...V(i,l,o),...n}},s)}let B=new WeakMap;function V(e,t,n){let r=t===`rtl`?`right`:`left`,i=B.get(e);if(i&&i[r]!=null){if(!n)return i;let t=e.rect.y-n.rect.y,a=e.rect.x-n.rect.x;if(i.top===t&&i[r]===a)return i}let a={top:e.rect.y-(n&&!(n.allowOverflow&&e.isSticky)?n.rect.y:0),[r]:e.rect.x-(n&&!(n.allowOverflow&&e.isSticky)?n.rect.x:0),width:e.rect.width,height:e.rect.height};Object.entries(a).forEach(([e,t])=>{Number.isFinite(t)||(a[e]=void 0)});let o={position:e.isSticky?`sticky`:`absolute`,display:e.isSticky?`inline-block`:void 0,overflow:e.allowOverflow?`visible`:`hidden`,opacity:e.opacity,zIndex:e.zIndex,transform:e.transform??void 0,contain:`size layout style`,...a};return B.set(e,o),o}const H=n(null),U=n(null);function W(t){let{children:n,layout:r,layoutOptions:i}=t,a=s(()=>typeof r==`function`?new r:r,[r]),o=s(()=>({isVirtualized:!0,layoutDelegate:a,dropTargetDelegate:a.getDropTargetFromPoint?a:void 0,CollectionRoot:G,CollectionBranch:K}),[a]);return e.createElement(b.Provider,{value:o},e.createElement(U.Provider,{value:{layout:a,layoutOptions:i}},n))}function G({collection:t,persistedKeys:n,scrollRef:r,renderDropIndicator:i}){let{layout:o,layoutOptions:c}=a(U),l=o.useLayoutOptions?.call(o),u=M({layout:o,collection:t,renderView:(e,t)=>t?.render?.call(t,t),onVisibleRectChange(e){let t=r?.current;t&&(t.scrollLeft=e.x,t.scrollTop=e.y)},persistedKeys:n,layoutOptions:s(()=>c&&l?{...c,...l}:c||l,[c,l])}),{contentProps:d}=I({onVisibleRectChange:u.setVisibleRect,contentSize:u.contentSize,onScrollStart:u.startScrolling,onScrollEnd:u.endScrolling},r);return e.createElement(`div`,d,e.createElement(H.Provider,{value:u},q(null,u.visibleViews,i)))}function K({parent:e,renderDropIndicator:t}){let n=a(H).virtualizer.getVisibleView(e.key);return q(n,Array.from(n.children),t)}function q(e,t,n){return t.map(t=>J(e,t,n))}function J(t,n,r){let i=e.createElement(z,{key:n.key,layoutInfo:n.layoutInfo,virtualizer:n.virtualizer,parent:t?.layoutInfo},n.rendered),{collection:a,layout:o}=n.virtualizer,s=n.content;return s?.type===`item`&&r&&o.getDropTargetLayoutInfo&&(i=e.createElement(e.Fragment,{key:n.key},Y(t,n,{type:`item`,key:n.content.key,dropPosition:`before`},r),i,y(a,s,e=>Y(t,n,e,r)))),i}function Y(t,n,r,i){let a=i(r);if(a){let i=n.virtualizer.layout.getDropTargetLayoutInfo(r);a=e.createElement(z,{layoutInfo:i,virtualizer:n.virtualizer,parent:t?.layoutInfo},a)}return a}export{W as Virtualizer};
|
|
1
|
+
import e,{cloneElement as t,createContext as n,isValidElement as r,useCallback as i,useContext as a,useEffect as o,useMemo as s,useRef as c,useState as l}from"react";import{useEffectEvent as u,useEvent as d,useLayoutEffect as f,useResizeObserver as p}from"@react-aria/utils";import{flushSync as m}from"react-dom";import{useLocale as h}from"@react-aria/i18n";function g(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])}const _={CollectionRoot({collection:e,renderDropIndicator:t}){return v(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return v(e,t,n)}};function v(t,n,r){return g({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,y(t,n,r))}})}function y(e,n,i){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=i({type:`item`,key:a.key,dropPosition:`after`});r(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const b=n(_);var x=class e{copy(){return new e(this.x,this.y)}equals(e){return this.x===e.x&&this.y===e.y}isOrigin(){return this.x===0&&this.y===0}constructor(e=0,t=0){this.x=e,this.y=t}},S=class e{get maxX(){return this.x+this.width}get maxY(){return this.y+this.height}get area(){return this.width*this.height}get topLeft(){return new x(this.x,this.y)}get topRight(){return new x(this.maxX,this.y)}get bottomLeft(){return new x(this.x,this.maxY)}get bottomRight(){return new x(this.maxX,this.maxY)}intersects(e){return this.area>0&&e.area>0&&this.x<=e.x+e.width&&e.x<=this.x+this.width&&this.y<=e.y+e.height&&e.y<=this.y+this.height}containsRect(e){return this.x<=e.x&&this.y<=e.y&&this.maxX>=e.maxX&&this.maxY>=e.maxY}containsPoint(e){return this.x<=e.x&&this.y<=e.y&&this.maxX>=e.x&&this.maxY>=e.y}getCornerInRect(e){for(let t of[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`])if(e.containsPoint(this[t]))return t;return null}equals(e){return e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height}pointEquals(e){return this.x===e.x&&this.y===e.y}sizeEquals(e){return this.width===e.width&&this.height===e.height}union(t){let n=Math.min(this.x,t.x),r=Math.min(this.y,t.y),i=Math.max(this.maxX,t.maxX)-n,a=Math.max(this.maxY,t.maxY)-r;return new e(n,r,i,a)}intersection(t){if(!this.intersects(t))return new e(0,0,0,0);let n=Math.max(this.x,t.x),r=Math.max(this.y,t.y);return new e(n,r,Math.min(this.maxX,t.maxX)-n,Math.min(this.maxY,t.maxY)-r)}copy(){return new e(this.x,this.y,this.width,this.height)}constructor(e=0,t=0,n=0,r=0){this.x=e,this.y=t,this.width=n,this.height=r}},C=class e{copy(){return new e(this.width,this.height)}equals(e){return this.width===e.width&&this.height===e.height}get area(){return this.width*this.height}constructor(e=0,t=0){this.width=Math.max(e,0),this.height=Math.max(t,0)}};let w=0;var T=class{prepareForReuse(){this.content=null,this.rendered=null,this.layoutInfo=null}getReusableView(e){let t=this.reusableViews.get(e);return t&&t.length>0?t.shift():new D(this.virtualizer,this,e)}reuseChild(e){e.prepareForReuse();let t=this.reusableViews.get(e.viewType);t||(t=[],this.reusableViews.set(e.viewType,t)),t.push(e)}constructor(e,t){this.virtualizer=e,this.key=++w,this.viewType=t,this.children=new Set,this.reusableViews=new Map,this.layoutInfo=null,this.content=null,this.rendered=null}},E=class extends T{constructor(e){super(e,`root`)}},D=class extends T{constructor(e,t,n){super(e,n),this.parent=t}};function O(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}var k=class{setVisibleRect(e){let t=performance.now()-this.startTime;t<500&&(e.x!==this.visibleRect.x&&t>0&&(this.velocity.x=(e.x-this.visibleRect.x)/t),e.y!==this.visibleRect.y&&t>0&&(this.velocity.y=(e.y-this.visibleRect.y)/t)),this.startTime=performance.now(),this.visibleRect=e}getOverscannedRect(){let e=this.visibleRect.copy(),t=this.visibleRect.height/3;if(e.height+=t,this.velocity.y<0&&(e.y-=t),this.velocity.x!==0){let t=this.visibleRect.width/3;e.width+=t,this.velocity.x<0&&(e.x-=t)}return e}constructor(){this.startTime=0,this.velocity=new x(0,0),this.visibleRect=new S}},A=class{isPersistedKey(e){if(this.persistedKeys.has(e))return!0;for(let t of this.persistedKeys)for(;t!=null;){let n=this.layout.getLayoutInfo(t);if(!n||n.parentKey==null)break;if(t=n.parentKey,t===e)return!0}return!1}getParentView(e){return e.parentKey==null?this._rootView:this._visibleViews.get(e.parentKey)}getReusableView(e){let t=this.getParentView(e).getReusableView(e.type);return t.layoutInfo=e,this._renderView(t),t}_renderView(e){if(e.layoutInfo){let{type:t,key:n,content:r}=e.layoutInfo;e.content=r||this.collection.getItem(n),e.rendered=this._renderContent(t,e.content)}}_renderContent(e,t){let n=t==null?null:this._renderedContent.get(t);if(n!=null)return n;let r=this.delegate.renderView(e,t);return t&&this._renderedContent.set(t,r),r}keyAtPoint(e){let t=new S(e.x,e.y,1,1),n=t.area===0?[]:this.layout.getVisibleLayoutInfos(t);for(let e of n)if(e.rect.intersects(t))return e.key;return null}relayout(e={}){this.layout.update(e),this.contentSize=this.layout.getContentSize();let t=this.visibleRect,n=e.contentChanged?0:t.x,r=e.contentChanged?0:t.y;if(n=Math.max(0,Math.min(this.contentSize.width-t.width,n)),r=Math.max(0,Math.min(this.contentSize.height-t.height,r)),n!==t.x||r!==t.y){let e=new S(n,r,t.width,t.height);this.delegate.setVisibleRect(e)}else this.updateSubviews()}getVisibleLayoutInfos(){let e;e=this._overscanManager.getOverscannedRect();let t=this.layout.getVisibleLayoutInfos(e),n=new Map;for(let e of t)n.set(e.key,e);return n}updateSubviews(){let e=this.getVisibleLayoutInfos(),t=new Set;for(let[n,r]of this._visibleViews){let i=e.get(n);(!i||r.parent!==this.getParentView(i))&&(this._visibleViews.delete(n),r.parent.reuseChild(r),t.add(r))}for(let[n,r]of e){let e=this._visibleViews.get(n);if(!e)e=this.getReusableView(r),e.parent.children.add(e),this._visibleViews.set(n,e),t.delete(e);else{e.layoutInfo=r;let t=this.collection.getItem(r.key);e.content!==t&&(e.content!=null&&this._renderedContent.delete(e.content),this._renderView(e))}}for(let e of t)e.parent.children.delete(e),e.parent.reusableViews.clear();if(!this._isScrolling)for(let t of e.keys()){let e=this._visibleViews.get(t);e.parent.children.delete(e),e.parent.children.add(e)}}render(e){let t=this,n=!1,r=!1,i=!1,a=!1,o=!1,s=!1;return e.collection!==this.collection&&(t.collection=e.collection,n=!0),(e.layout!==this.layout||this.layout.virtualizer!==this)&&(this.layout&&(this.layout.virtualizer=null),e.layout.virtualizer=this,t.layout=e.layout,n=!0),e.persistedKeys&&!O(e.persistedKeys,this.persistedKeys)&&(t.persistedKeys=e.persistedKeys,s=!0),this.visibleRect.equals(e.visibleRect)||(this._overscanManager.setVisibleRect(e.visibleRect),this.layout.shouldInvalidate(e.visibleRect,this.visibleRect)?(r=!e.visibleRect.pointEquals(this.visibleRect),i=!e.visibleRect.sizeEquals(this.visibleRect),n=!0):s=!0,t.visibleRect=e.visibleRect),e.invalidationContext!==this._invalidationContext&&(e.invalidationContext&&(i||=e.invalidationContext.sizeChanged||!1,r||=e.invalidationContext.offsetChanged||!1,a||=e.invalidationContext.itemSizeChanged||!1,o||=e.invalidationContext.layoutOptions!=null&&this._invalidationContext.layoutOptions!=null&&e.invalidationContext.layoutOptions!==this._invalidationContext.layoutOptions&&this.layout.shouldInvalidateLayoutOptions(e.invalidationContext.layoutOptions,this._invalidationContext.layoutOptions),n||=a||i||r||o),this._invalidationContext=e.invalidationContext),e.isScrolling!==this._isScrolling&&(this._isScrolling=e.isScrolling,e.isScrolling||(s=!0)),n?this.relayout({offsetChanged:r,sizeChanged:i,itemSizeChanged:a,layoutOptionsChanged:o,layoutOptions:this._invalidationContext.layoutOptions}):s&&this.updateSubviews(),Array.from(this._rootView.children)}getVisibleView(e){return this._visibleViews.get(e)}invalidate(e){this.delegate.invalidate(e)}updateItemSize(e,t){this.layout.updateItemSize&&this.layout.updateItemSize(e,t)&&this.invalidate({itemSizeChanged:!0})}constructor(e){this.delegate=e.delegate,this.collection=e.collection,this.layout=e.layout,this.contentSize=new C,this.visibleRect=new S,this.persistedKeys=new Set,this._visibleViews=new Map,this._renderedContent=new WeakMap,this._rootView=new E(this),this._isScrolling=!1,this._invalidationContext={},this._overscanManager=new k}};const j=typeof document<`u`?e.useLayoutEffect:()=>{};function M(e){let[t,n]=l(new S(0,0,0,0)),[r,a]=l(!1),[o,u]=l({}),d=c(!1),[f]=l(()=>new A({collection:e.collection,layout:e.layout,delegate:{setVisibleRect(e){n(e),d.current=!0},renderView:e.renderView,invalidate:u}}));j(()=>{d.current&&(d.current=!1,e.onVisibleRectChange(t))});let p=s(()=>e.layoutOptions==null?o:{...o,layoutOptions:e.layoutOptions},[o,e.layoutOptions]),m=f.render({layout:e.layout,collection:e.collection,persistedKeys:e.persistedKeys,layoutOptions:e.layoutOptions,visibleRect:t,invalidationContext:p,isScrolling:r}),h=f.contentSize,g=i(()=>{a(!0)},[]),_=i(()=>{a(!1)},[]);return s(()=>({virtualizer:f,visibleViews:m,setVisibleRect:n,contentSize:h,isScrolling:r,startScrolling:g,endScrolling:_}),[f,m,n,h,r,g,_])}let N=null;function P(e=!1){if(N===null||e){let e=document.createElement(`div`),t=e.style;t.width=`50px`,t.height=`50px`,t.overflow=`scroll`,t.direction=`rtl`;let n=document.createElement(`div`),r=n.style;return r.width=`100px`,r.height=`100px`,e.appendChild(n),document.body.appendChild(e),e.scrollLeft>0?N=`positive-descending`:(e.scrollLeft=1,N=e.scrollLeft===0?`negative`:`positive-ascending`),document.body.removeChild(e),N}return N}function F(e,t){let{scrollLeft:n}=e;if(t===`rtl`){let{scrollWidth:t,clientWidth:r}=e;switch(P()){case`negative`:n=-n;break;case`positive-descending`:n=t-r-n}}return n}function I(e,t){let{contentSize:n,onVisibleRectChange:r,innerStyle:a,onScrollStart:s,onScrollEnd:g,scrollDirection:_=`both`,...v}=e,y=c({scrollTop:0,scrollLeft:0,scrollEndTime:0,scrollTimeout:null,width:0,height:0,isScrolling:!1}).current,{direction:b}=h(),[x,C]=l(!1),w=i(t=>{t.target===t.currentTarget&&(e.onScroll&&e.onScroll(t),m(()=>{let e=t.currentTarget.scrollTop,i=F(t.currentTarget,b);y.scrollTop=Math.max(0,Math.min(e,n.height-y.height)),y.scrollLeft=Math.max(0,Math.min(i,n.width-y.width)),r(new S(y.scrollLeft,y.scrollTop,y.width,y.height)),y.isScrolling||(y.isScrolling=!0,C(!0),window.dispatchEvent(new Event(`tk.disconnect-observer`)),s&&s());let a=Date.now();y.scrollEndTime<=a+50&&(y.scrollEndTime=a+300,y.scrollTimeout!=null&&clearTimeout(y.scrollTimeout),y.scrollTimeout=setTimeout(()=>{y.isScrolling=!1,C(!1),y.scrollTimeout=null,window.dispatchEvent(new Event(`tk.connect-observer`)),g&&g()},300))}))},[e,b,y,n,r,s,g]);d(t,`scroll`,w),o(()=>()=>{y.scrollTimeout!=null&&clearTimeout(y.scrollTimeout),y.isScrolling&&window.dispatchEvent(new Event(`tk.connect-observer`))},[]);let T=c(!1),E=i(e=>{let n=t.current;if(!n||T.current)return;T.current=!0,Object.getOwnPropertyNames(window.HTMLElement.prototype).includes(`clientWidth`),Object.getOwnPropertyNames(window.HTMLElement.prototype).includes(`clientHeight`);let i=n.clientWidth,a=n.clientHeight,o=i,s=a;(y.width!==o||y.height!==s)&&(y.width=o,y.height=s,e(()=>{r(new S(y.scrollLeft,y.scrollTop,o,s))}),(i!==n.clientWidth||a!==n.clientHeight)&&(y.width=n.clientWidth,y.height=n.clientHeight,e(()=>{r(new S(y.scrollLeft,y.scrollTop,y.width,y.height))}))),T.current=!1},[t,y,r]),D=u(E),O=c(null),[k,A]=l({});f(()=>{if(!T.current&&(O.current==null||!n.equals(O.current)))if(typeof IS_REACT_ACT_ENVIRONMENT==`boolean`?IS_REACT_ACT_ENVIRONMENT:typeof jest<`u`){A({}),O.current=n;return}else queueMicrotask(()=>D(m));O.current=n}),f(()=>{D(e=>e())},[k]);let j=i(()=>{E(m)},[E]);p({ref:t,box:`border-box`,onResize:j});let M={padding:0,...v.style};return _===`horizontal`?(M.overflowX=`auto`,M.overflowY=`hidden`):_===`vertical`||n.width===y.width?(M.overflowY=`auto`,M.overflowX=`hidden`):M.overflow=`auto`,a={width:Number.isFinite(n.width)?n.width:void 0,height:Number.isFinite(n.height)?n.height:void 0,pointerEvents:x?`none`:`auto`,position:`relative`,...a},{isScrolling:x,scrollViewProps:{...v,style:M},contentProps:{role:`presentation`,style:a}}}function L(e){let{layoutInfo:t,virtualizer:n,ref:r}=e,a=t?.key,o=i(()=>{if(a!=null&&r.current){let e=R(r.current);n.updateItemSize(a,e)}},[n,a,r]);return f(()=>{t?.estimatedSize&&o()}),{updateSize:o}}function R(e){let t=e.style.height;e.style.height=``;let n=new C(e.scrollWidth,e.scrollHeight);return e.style.height=t,n}function z(t){let{style:n,className:r,layoutInfo:i,virtualizer:a,parent:o,children:s}=t,{direction:l}=h(),u=c(null);return L({layoutInfo:i,virtualizer:a,ref:u}),e.createElement(`div`,{role:`presentation`,ref:u,className:r,style:{...V(i,l,o),...n}},s)}let B=new WeakMap;function V(e,t,n){let r=t===`rtl`?`right`:`left`,i=B.get(e);if(i&&i[r]!=null){if(!n)return i;let t=e.rect.y-n.rect.y,a=e.rect.x-n.rect.x;if(i.top===t&&i[r]===a)return i}let a={top:e.rect.y-(n&&!(n.allowOverflow&&e.isSticky)?n.rect.y:0),[r]:e.rect.x-(n&&!(n.allowOverflow&&e.isSticky)?n.rect.x:0),width:e.rect.width,height:e.rect.height};Object.entries(a).forEach(([e,t])=>{Number.isFinite(t)||(a[e]=void 0)});let o={position:e.isSticky?`sticky`:`absolute`,display:e.isSticky?`inline-block`:void 0,overflow:e.allowOverflow?`visible`:`hidden`,opacity:e.opacity,zIndex:e.zIndex,transform:e.transform??void 0,contain:`size layout style`,...a};return B.set(e,o),o}const H=n(null),U=n(null);function W(t){let{children:n,layout:r,layoutOptions:i}=t,a=s(()=>typeof r==`function`?new r:r,[r]),o=s(()=>({isVirtualized:!0,layoutDelegate:a,dropTargetDelegate:a.getDropTargetFromPoint?a:void 0,CollectionRoot:G,CollectionBranch:K}),[a]);return e.createElement(b.Provider,{value:o},e.createElement(U.Provider,{value:{layout:a,layoutOptions:i}},n))}function G({collection:t,persistedKeys:n,scrollRef:r,renderDropIndicator:i}){let{layout:o,layoutOptions:c}=a(U),l=o.useLayoutOptions?.call(o),u=M({layout:o,collection:t,renderView:(e,t)=>t?.render?.call(t,t),onVisibleRectChange(e){let t=r?.current;t&&(t.scrollLeft=e.x,t.scrollTop=e.y)},persistedKeys:n,layoutOptions:s(()=>c&&l?{...c,...l}:c||l,[c,l])}),{contentProps:d}=I({onVisibleRectChange:u.setVisibleRect,contentSize:u.contentSize,onScrollStart:u.startScrolling,onScrollEnd:u.endScrolling},r);return e.createElement(`div`,d,e.createElement(H.Provider,{value:u},q(null,u.visibleViews,i)))}function K({parent:e,renderDropIndicator:t}){let n=a(H).virtualizer.getVisibleView(e.key);return q(n,Array.from(n.children),t)}function q(e,t,n){return t.map(t=>J(e,t,n))}function J(t,n,r){let i=e.createElement(z,{key:n.key,layoutInfo:n.layoutInfo,virtualizer:n.virtualizer,parent:t?.layoutInfo},n.rendered),{collection:a,layout:o}=n.virtualizer,s=n.content;return s?.type===`item`&&r&&o.getDropTargetLayoutInfo&&(i=e.createElement(e.Fragment,{key:n.key},Y(t,n,{type:`item`,key:n.content.key,dropPosition:`before`},r),i,y(a,s,e=>Y(t,n,e,r)))),i}function Y(t,n,r,i){let a=i(r);if(a){let i=n.virtualizer.layout.getDropTargetLayoutInfo(r);a=e.createElement(z,{layoutInfo:i,virtualizer:n.virtualizer,parent:t?.layoutInfo},a)}return a}export{W as Virtualizer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{VisuallyHidden as e}from"react-aria";import"react-stately";export{e as VisuallyHidden};
|
|
1
|
+
import{VisuallyHidden as e}from"react-aria";import"react-stately";import"@react-aria/dnd";export{e as VisuallyHidden};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Confirmation } from "../confirmation.context-
|
|
1
|
+
import { t as Confirmation } from "../confirmation.context-CmbxKmXo.js";
|
|
2
2
|
export { Confirmation };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as LinkNavigationProps } from "../Link-
|
|
2
|
-
import { t as LinkContext } from "../link.context-
|
|
1
|
+
import { n as LinkNavigationProps } from "../Link-DLX0WJRh.js";
|
|
2
|
+
import { t as LinkContext } from "../link.context-BoEOZqJY.js";
|
|
3
3
|
export { LinkContext, type LinkNavigationProps };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as DateRangeResolvedValue, i as DateRangeRelativeOption } from "../DateRangePicker-
|
|
2
|
-
import { t as UIConfig } from "../uiConfig.context-
|
|
1
|
+
import { a as DateRangeResolvedValue, i as DateRangeRelativeOption } from "../DateRangePicker-DduITEx6.js";
|
|
2
|
+
import { t as UIConfig } from "../uiConfig.context-D9Aig1NJ.js";
|
|
3
3
|
export { type DateRangeRelativeOption, type DateRangeResolvedValue, UIConfig };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as DatePickerProps } from "./DatePicker-
|
|
1
|
+
import { r as DatePickerProps } from "./DatePicker-DSa6RE1Z.js";
|
|
2
2
|
import { t as ControlProps } from "./form.types-ZNGbcqJS.js";
|
|
3
3
|
import { t as FireBlurOnChangeProps } from "./fieldAdapter-C4sDFC8f.js";
|
|
4
4
|
import { FieldValues } from "react-hook-form";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as DateRangePickerProps } from "./DateRangePicker-
|
|
1
|
+
import { r as DateRangePickerProps } from "./DateRangePicker-DduITEx6.js";
|
|
2
2
|
import { t as ControlProps } from "./form.types-ZNGbcqJS.js";
|
|
3
3
|
import { t as FireBlurOnChangeProps } from "./fieldAdapter-C4sDFC8f.js";
|
|
4
4
|
import { FieldValues } from "react-hook-form";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as DateTimePickerProps } from "./DateTimePicker-
|
|
1
|
+
import { r as DateTimePickerProps } from "./DateTimePicker-tN-z-tVd.js";
|
|
2
2
|
import { t as ControlProps } from "./form.types-ZNGbcqJS.js";
|
|
3
3
|
import { t as FireBlurOnChangeProps } from "./fieldAdapter-C4sDFC8f.js";
|
|
4
4
|
import { FieldValues } from "react-hook-form";
|