@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,useCallback as r,useContext as i,useMemo as a,useRef as o}from"react";import{filterDOMProps as s,mergeProps as c,mergeRefs as l,useLayoutEffect as u,useObjectRef as d}from"@react-aria/utils";import{FocusableContext as f}from"@react-aria/interactions";import"react-dom";import{mergeProps as p,useHover as m,useMenuItem as h}from"react-aria";import"react-stately";const g=Symbol(`default`);function _({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function v(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return a(()=>{let e,a,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,a=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??i,style:a||s?{...s,...a}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,o,s,c,l])}function y(e,t){let n=i(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||g;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 b(e,t,n){let{ref:r,...i}=y(n,e.slot)||{},o=d(a(()=>l(t,r),[t,r])),s=c(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(s.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[s,o]}function x(t,n,r){let{render:i,...s}=n,c=o(null),d=a(()=>l(r,c),[r,c]);u(()=>{},[t,i]);let f={...s,ref:d};return i?i(f,void 0):e.createElement(t,f)}const S={},C=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=S[t];return r||(r=n(x.bind(null,t)),S[t]=r),r}});
|
|
1
|
+
import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useMemo as a,useRef as o}from"react";import{filterDOMProps as s,mergeProps as c,mergeRefs as l,useLayoutEffect as u,useObjectRef as d}from"@react-aria/utils";import{FocusableContext as f}from"@react-aria/interactions";import"react-dom";import{mergeProps as p,useHover as m,useMenuItem as h}from"react-aria";import"react-stately";const g=Symbol(`default`);function _({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function v(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return a(()=>{let e,a,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,a=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??i,style:a||s?{...s,...a}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,o,s,c,l])}function y(e,t){let n=i(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||g;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 b(e,t,n){let{ref:r,...i}=y(n,e.slot)||{},o=d(a(()=>l(t,r),[t,r])),s=c(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(s.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[s,o]}function x(t,n,r){let{render:i,...s}=n,c=o(null),d=a(()=>l(r,c),[r,c]);u(()=>{},[t,i]);let f={...s,ref:d};return i?i(f,void 0):e.createElement(t,f)}const S={},C=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=S[t];return r||(r=n(x.bind(null,t)),S[t]=r),r}});var w=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}},T=class extends w{filter(e,t,n){let[r,i]=A(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},E=class extends w{};E.type=`header`;var D=class extends w{};D.type=`loader`;var O=class extends T{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};O.type=`item`;var k=class extends T{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}};k.type=`section`;function A(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;const j=t(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const M=t(null);function N(e){var t;return t=class extends w{},t.type=e,t}function P(t,n,a,o,s,c){typeof t==`string`&&(t=N(t));let l=r(e=>{e?.setProps(n,a,t,o,c)},[n,a,o,c,t]),u=i(M);if(u){let r=u.ownerDocument.nodesByProps.get(n);return r||(r=u.ownerDocument.createElement(t.type),r.setProps(n,a,t,o,c),u.appendChild(r),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,r)),s?e.createElement(M.Provider,{value:r},s):null}return e.createElement(t.type,{ref:l},s)}function F(t,r){let a=({node:e})=>r(e.props,e.props.ref,e),o=n((n,o)=>{let s=i(f);if(!i(j)){if(r.length>=3)throw Error(r.name+` cannot be rendered outside a collection.`);return r(n,o)}return P(t,n,o,`children`in n?n.children:null,null,t=>e.createElement(f.Provider,{value:s},e.createElement(a,{node:t})))});return o.displayName=r.name,o}const I=t({}),L=t({isSelected:!1}),R=t({}),z=t(null),B=t(null);var V=class extends w{filter(e,t,n){let r=e.getItem(this.firstChildKey);if(r&&n(r.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};V.type=`submenutrigger`;const H=t(null),U=F(O,function(t,n,r){[t,n]=b(t,n,H);let a=y(H)?.id,o=i(z),c=d(n),l=i(B),{menuItemProps:u,labelProps:f,descriptionProps:x,keyboardShortcutProps:S,...w}=h({...t,id:a,key:r.key,selectionManager:l},o,c),{hoverProps:T,isHovered:E}=m({isDisabled:w.isDisabled}),D=v({...t,id:void 0,children:r.rendered,defaultClassName:`react-aria-MenuItem`,values:{...w,isHovered:E,isFocusVisible:w.isFocusVisible,selectionMode:l.selectionMode,selectionBehavior:l.selectionBehavior,hasSubmenu:!!t[`aria-haspopup`],isOpen:t[`aria-expanded`]===`true`}}),O=t.href?C.a:C.div,k=s(t,{global:!0});return delete k.id,delete k.onClick,e.createElement(O,{...p(k,D,u,T),ref:c,"data-disabled":w.isDisabled||void 0,"data-hovered":E||void 0,"data-focused":w.isFocused||void 0,"data-focus-visible":w.isFocusVisible||void 0,"data-pressed":w.isPressed||void 0,"data-selected":w.isSelected||void 0,"data-selection-mode":l.selectionMode===`none`?void 0:l.selectionMode,"data-has-submenu":!!t[`aria-haspopup`]||void 0,"data-open":t[`aria-expanded`]===`true`||void 0},e.createElement(_,{values:[[I,{slots:{[g]:f,label:f,description:x}}],[R,S],[L,{isSelected:w.isSelected}]]},D.children))});export{U as MenuItem};
|
|
@@ -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}from"react";import{filterDOMProps as f,mergeRefs as p,useLayoutEffect as m}from"@react-aria/utils";import"@react-aria/interactions";import"react-dom";import{mergeProps as h,useMenuSection as g}from"react-aria";import"react-stately";const _=Symbol(`default`);function v({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function y(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values: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 b(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||_;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function x(e=!0){let[t,n]=d(e),r=u(!1),i=a(e=>{r.current=!0,n(!!e)},[]);return m(()=>{r.current||n(!1)},[]),[i,t]}function S(t,n,r){let{render:i,...a}=n,o=u(null),s=c(()=>p(r,o),[r,o]);m(()=>{},[t,i]);let l={...a,ref:s};return i?i(l,void 0):e.createElement(t,l)}const C={},w=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=C[t];return n||(n=r(S.bind(null,t)),C[t]=n),n}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;function T(e,t){return typeof t.getChildren==`function`?t.getChildren(e.key):e.childNodes}function E(e){return D(e,0)}function D(e,t){if(t<0)return;let n=0;for(let r of e){if(n===t)return r;n++}}function O(e,t,n){if(t.parentKey===n.parentKey)return t.index-n.index;let r=[...k(e,t),t],i=[...k(e,n),n],a=r.slice(0,i.length).findIndex((e,t)=>e!==i[t]);return a===-1?r.findIndex(e=>e===n)>=0?1:(i.findIndex(e=>e===t),-1):(t=r[a],n=i[a],t.index-n.index)}function k(e,t){let n=[],r=t;for(;r?.parentKey!=null;)r=e.getItem(r.parentKey),r&&n.unshift(r);return n}const A=typeof document<`u`?e.useInsertionEffect??e.useLayoutEffect:()=>{};function ee(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;A(()=>{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 j=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}},M=class extends j{filter(e,t,n){let[r,i]=I(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},N=class extends j{};N.type=`header`;var P=class extends j{};P.type=`loader`;var te=class extends M{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};te.type=`item`;var F=class extends M{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])}typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const R=n(null);function z(e){var t;return t=class extends j{},t.type=e,t}function B(t,n,r,i,s,c){typeof t==`string`&&(t=z(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(R);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(R.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function V(t,n,i=H){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>B(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function H(e){return L({...e,addIdAndValue:!0})}const U={CollectionRoot({collection:e,renderDropIndicator:t}){return W(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return W(e,t,n)}};function W(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,G(t,n,r))}})}function G(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 K=n(U),q=n({});var J=class e extends Set{constructor(t,n,r){super(t),t instanceof e?(this.anchorKey=n??t.anchorKey,this.currentKey=r??t.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}};function Y(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function X(e){let{selectionMode:t=`none`,disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i=`toggle`,disabledBehavior:a=`all`}=e,o=u(!1),[,l]=d(!1),f=u(null),p=u(null),[,m]=d(null),[h,g]=ee(c(()=>Z(e.selectedKeys),[e.selectedKeys]),c(()=>Z(e.defaultSelectedKeys,new J),[e.defaultSelectedKeys]),e.onSelectionChange),_=c(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),[v,y]=d(i);i===`replace`&&v===`toggle`&&typeof h==`object`&&h.size===0&&y(`replace`);let b=u(i);return s(()=>{i!==b.current&&(y(i),b.current=i)},[i]),{selectionMode:t,disallowEmptySelection:n,selectionBehavior:v,setSelectionBehavior:y,get isFocused(){return o.current},setFocused(e){o.current=e,l(e)},get focusedKey(){return f.current},get childFocusStrategy(){return p.current},setFocusedKey(e,t=`first`){f.current=e,p.current=t,m(e)},selectedKeys:h,setSelectedKeys(e){(r||!Y(e,h))&&g(e)},disabledKeys:_,disabledBehavior:a}}function Z(e,t){return e?e===`all`?`all`:new J(e):t}var ne=class e{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,t){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,t)}get selectedKeys(){return this.state.selectedKeys===`all`?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode===`none`)return!1;let t=this.getKey(e);return t==null?!1:this.state.selectedKeys===`all`?this.canSelectItem(t):this.state.selectedKeys.has(t)}get isEmpty(){return this.state.selectedKeys!==`all`&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys===`all`)return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),t=this.state.selectedKeys;return this._isSelectAll=e.every(e=>t.has(e)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&O(this.collection,n,e)<0)&&(e=n)}return e?.key??null}get lastSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&O(this.collection,n,e)>0)&&(e=n)}return e?.key??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n;if(this.state.selectedKeys===`all`)n=new J([t],t,t);else{let e=this.state.selectedKeys,r=e.anchorKey??t;n=new J(e,r,t);for(let i of this.getKeyRange(r,e.currentKey??t))n.delete(i);for(let e of this.getKeyRange(t,r))this.canSelectItem(e)&&n.add(e)}this.state.setSelectedKeys(n)}getKeyRange(e,t){let n=this.collection.getItem(e),r=this.collection.getItem(t);return n&&r?O(this.collection,n,r)<=0?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){if(this.layoutDelegate?.getKeyRange)return this.layoutDelegate.getKeyRange(e,t);let n=[],r=e;for(;r!=null;){let e=this.collection.getItem(r);if(e&&(e.type===`item`||e.type===`cell`&&this.allowsCellSelection)&&n.push(r),r===t)return n;r=this.collection.getKeyAfter(r)}return[]}getKey(e){let t=this.collection.getItem(e);if(!t||t.type===`cell`&&this.allowsCellSelection)return e;for(;t&&t.type!==`item`&&t.parentKey!=null;)t=this.collection.getItem(t.parentKey);return!t||t.type!==`item`?null:t.key}toggleSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`&&!this.isSelected(e)){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n=new J(this.state.selectedKeys===`all`?this.getSelectAllKeys():this.state.selectedKeys);n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode===`none`)return;let t=this.getKey(e);if(t==null)return;let n=this.canSelectItem(t)?new J([t],t,t):new J;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode===`none`)return;let t=new J;for(let n of e){let e=this.getKey(n);if(e!=null&&(t.add(e),this.selectionMode===`single`))break}this.state.setSelectedKeys(t)}getSelectAllKeys(){let e=[],t=n=>{for(;n!=null;){if(this.canSelectItem(n)){let r=this.collection.getItem(n);r?.type===`item`&&e.push(n),r?.hasChildNodes&&(this.allowsCellSelection||r.type!==`item`)&&t(E(T(r,this.collection))?.key??null)}n=this.collection.getKeyAfter(n)}};return t(this.collection.getFirstKey()),e}selectAll(){!this.isSelectAll&&this.selectionMode===`multiple`&&this.state.setSelectedKeys(`all`)}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys===`all`||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new J)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode!==`none`&&(this.selectionMode===`single`?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior===`toggle`||t&&(t.pointerType===`touch`||t.pointerType===`virtual`)?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let t=this.selectedKeys;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;for(let n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode===`none`||this.state.disabledKeys.has(e))return!1;let t=this.collection.getItem(e);return!(!t||t!=null&&t.props?.isDisabled||t.type===`cell`&&!this.allowsCellSelection)}isDisabled(e){var t;return this.state.disabledBehavior===`all`&&(this.state.disabledKeys.has(e)||!!((t=this.collection.getItem(e))!=null&&t.props?.isDisabled))}isLink(e){var t;return!!((t=this.collection.getItem(e))!=null&&t.props?.href)}getItemProps(e){return this.collection.getItem(e)?.props}withCollection(t){return new e(t,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(e,t,n){this.collection=e,this.state=t,this.allowsCellSelection=n?.allowsCellSelection??!1,this._isSelectAll=null,this.layoutDelegate=n?.layoutDelegate||null}};const re=n(null),Q=n(null);var ie=class extends j{filter(e,t,n){let r=e.getItem(this.firstChildKey);if(r&&n(r.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};ie.type=`submenutrigger`;var ae=class extends ne{get focusedKey(){return this.parent.focusedKey}get isFocused(){return this.parent.isFocused}setFocusedKey(e,t){return this.parent.setFocusedKey(e,t)}setFocused(e){this.parent.setFocused(e)}get childFocusStrategy(){return this.parent.childFocusStrategy}constructor(e,t){super(e.collection,t),this.parent=e}};function oe(t,n,r,i=`react-aria-MenuSection`){let a=o(re),{CollectionBranch:s}=o(K),[c,l]=x(),{headingProps:u,groupProps:d}=g({heading:l,"aria-label":r.props[`aria-label`]??void 0}),p=y({...t,id:void 0,children:void 0,defaultClassName:i,className:r.props?.className,style:r.props?.style,values:void 0}),m=o(Q),_=X(t),S=t.selectionMode==null?m:new ae(m,_),C=b($)?.shouldCloseOnSelect,T=f(t,{global:!0});return delete T.id,e.createElement(w.section,{...h(T,p,d),ref:n},e.createElement(v,{values:[[q,{...u,ref:c}],[Q,S],[$,{shouldCloseOnSelect:t.shouldCloseOnSelect??C}]]},e.createElement(s,{collection:a.collection,parent:r})))}const se=V(F,oe),$=n(null);export{se as MenuSection};
|
|
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}from"react";import{filterDOMProps as f,mergeRefs as p,useLayoutEffect as m}from"@react-aria/utils";import"@react-aria/interactions";import"react-dom";import{mergeProps as h,useMenuSection as g}from"react-aria";import"react-stately";const _=Symbol(`default`);function v({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function y(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values: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 b(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||_;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function x(e=!0){let[t,n]=d(e),r=u(!1),i=a(e=>{r.current=!0,n(!!e)},[]);return m(()=>{r.current||n(!1)},[]),[i,t]}function S(t,n,r){let{render:i,...a}=n,o=u(null),s=c(()=>p(r,o),[r,o]);m(()=>{},[t,i]);let l={...a,ref:s};return i?i(l,void 0):e.createElement(t,l)}const C={},w=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=C[t];return n||(n=r(S.bind(null,t)),C[t]=n),n}});function T(e,t){return typeof t.getChildren==`function`?t.getChildren(e.key):e.childNodes}function E(e){return D(e,0)}function D(e,t){if(t<0)return;let n=0;for(let r of e){if(n===t)return r;n++}}function O(e,t,n){if(t.parentKey===n.parentKey)return t.index-n.index;let r=[...k(e,t),t],i=[...k(e,n),n],a=r.slice(0,i.length).findIndex((e,t)=>e!==i[t]);return a===-1?r.findIndex(e=>e===n)>=0?1:(i.findIndex(e=>e===t),-1):(t=r[a],n=i[a],t.index-n.index)}function k(e,t){let n=[],r=t;for(;r?.parentKey!=null;)r=e.getItem(r.parentKey),r&&n.unshift(r);return n}const A=typeof document<`u`?e.useInsertionEffect??e.useLayoutEffect:()=>{};function ee(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;A(()=>{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 j=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}},M=class extends j{filter(e,t,n){let[r,i]=I(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},N=class extends j{};N.type=`header`;var P=class extends j{};P.type=`loader`;var te=class extends M{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};te.type=`item`;var F=class extends M{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,typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const R=n(null);function z(e){var t;return t=class extends j{},t.type=e,t}function B(t,n,r,i,s,c){typeof t==`string`&&(t=z(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(R);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(R.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function V(t,n,i=H){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>B(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function H(e){return L({...e,addIdAndValue:!0})}const U={CollectionRoot({collection:e,renderDropIndicator:t}){return W(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return W(e,t,n)}};function W(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,G(t,n,r))}})}function G(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 K=n(U),q=n({});var J=class e extends Set{constructor(t,n,r){super(t),t instanceof e?(this.anchorKey=n??t.anchorKey,this.currentKey=r??t.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}};function Y(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function X(e){let{selectionMode:t=`none`,disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i=`toggle`,disabledBehavior:a=`all`}=e,o=u(!1),[,l]=d(!1),f=u(null),p=u(null),[,m]=d(null),[h,g]=ee(c(()=>Z(e.selectedKeys),[e.selectedKeys]),c(()=>Z(e.defaultSelectedKeys,new J),[e.defaultSelectedKeys]),e.onSelectionChange),_=c(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),[v,y]=d(i);i===`replace`&&v===`toggle`&&typeof h==`object`&&h.size===0&&y(`replace`);let b=u(i);return s(()=>{i!==b.current&&(y(i),b.current=i)},[i]),{selectionMode:t,disallowEmptySelection:n,selectionBehavior:v,setSelectionBehavior:y,get isFocused(){return o.current},setFocused(e){o.current=e,l(e)},get focusedKey(){return f.current},get childFocusStrategy(){return p.current},setFocusedKey(e,t=`first`){f.current=e,p.current=t,m(e)},selectedKeys:h,setSelectedKeys(e){(r||!Y(e,h))&&g(e)},disabledKeys:_,disabledBehavior:a}}function Z(e,t){return e?e===`all`?`all`:new J(e):t}var ne=class e{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,t){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,t)}get selectedKeys(){return this.state.selectedKeys===`all`?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode===`none`)return!1;let t=this.getKey(e);return t==null?!1:this.state.selectedKeys===`all`?this.canSelectItem(t):this.state.selectedKeys.has(t)}get isEmpty(){return this.state.selectedKeys!==`all`&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys===`all`)return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),t=this.state.selectedKeys;return this._isSelectAll=e.every(e=>t.has(e)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&O(this.collection,n,e)<0)&&(e=n)}return e?.key??null}get lastSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&O(this.collection,n,e)>0)&&(e=n)}return e?.key??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n;if(this.state.selectedKeys===`all`)n=new J([t],t,t);else{let e=this.state.selectedKeys,r=e.anchorKey??t;n=new J(e,r,t);for(let i of this.getKeyRange(r,e.currentKey??t))n.delete(i);for(let e of this.getKeyRange(t,r))this.canSelectItem(e)&&n.add(e)}this.state.setSelectedKeys(n)}getKeyRange(e,t){let n=this.collection.getItem(e),r=this.collection.getItem(t);return n&&r?O(this.collection,n,r)<=0?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){if(this.layoutDelegate?.getKeyRange)return this.layoutDelegate.getKeyRange(e,t);let n=[],r=e;for(;r!=null;){let e=this.collection.getItem(r);if(e&&(e.type===`item`||e.type===`cell`&&this.allowsCellSelection)&&n.push(r),r===t)return n;r=this.collection.getKeyAfter(r)}return[]}getKey(e){let t=this.collection.getItem(e);if(!t||t.type===`cell`&&this.allowsCellSelection)return e;for(;t&&t.type!==`item`&&t.parentKey!=null;)t=this.collection.getItem(t.parentKey);return!t||t.type!==`item`?null:t.key}toggleSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`&&!this.isSelected(e)){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n=new J(this.state.selectedKeys===`all`?this.getSelectAllKeys():this.state.selectedKeys);n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode===`none`)return;let t=this.getKey(e);if(t==null)return;let n=this.canSelectItem(t)?new J([t],t,t):new J;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode===`none`)return;let t=new J;for(let n of e){let e=this.getKey(n);if(e!=null&&(t.add(e),this.selectionMode===`single`))break}this.state.setSelectedKeys(t)}getSelectAllKeys(){let e=[],t=n=>{for(;n!=null;){if(this.canSelectItem(n)){let r=this.collection.getItem(n);r?.type===`item`&&e.push(n),r?.hasChildNodes&&(this.allowsCellSelection||r.type!==`item`)&&t(E(T(r,this.collection))?.key??null)}n=this.collection.getKeyAfter(n)}};return t(this.collection.getFirstKey()),e}selectAll(){!this.isSelectAll&&this.selectionMode===`multiple`&&this.state.setSelectedKeys(`all`)}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys===`all`||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new J)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode!==`none`&&(this.selectionMode===`single`?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior===`toggle`||t&&(t.pointerType===`touch`||t.pointerType===`virtual`)?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let t=this.selectedKeys;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;for(let n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode===`none`||this.state.disabledKeys.has(e))return!1;let t=this.collection.getItem(e);return!(!t||t!=null&&t.props?.isDisabled||t.type===`cell`&&!this.allowsCellSelection)}isDisabled(e){var t;return this.state.disabledBehavior===`all`&&(this.state.disabledKeys.has(e)||!!((t=this.collection.getItem(e))!=null&&t.props?.isDisabled))}isLink(e){var t;return!!((t=this.collection.getItem(e))!=null&&t.props?.href)}getItemProps(e){return this.collection.getItem(e)?.props}withCollection(t){return new e(t,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(e,t,n){this.collection=e,this.state=t,this.allowsCellSelection=n?.allowsCellSelection??!1,this._isSelectAll=null,this.layoutDelegate=n?.layoutDelegate||null}};const re=n(null),Q=n(null);var ie=class extends j{filter(e,t,n){let r=e.getItem(this.firstChildKey);if(r&&n(r.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};ie.type=`submenutrigger`;var ae=class extends ne{get focusedKey(){return this.parent.focusedKey}get isFocused(){return this.parent.isFocused}setFocusedKey(e,t){return this.parent.setFocusedKey(e,t)}setFocused(e){this.parent.setFocused(e)}get childFocusStrategy(){return this.parent.childFocusStrategy}constructor(e,t){super(e.collection,t),this.parent=e}};function oe(t,n,r,i=`react-aria-MenuSection`){let a=o(re),{CollectionBranch:s}=o(K),[c,l]=x(),{headingProps:u,groupProps:d}=g({heading:l,"aria-label":r.props[`aria-label`]??void 0}),p=y({...t,id:void 0,children:void 0,defaultClassName:i,className:r.props?.className,style:r.props?.style,values:void 0}),m=o(Q),_=X(t),S=t.selectionMode==null?m:new ae(m,_),C=b($)?.shouldCloseOnSelect,T=f(t,{global:!0});return delete T.id,e.createElement(w.section,{...h(T,p,d),ref:n},e.createElement(v,{values:[[q,{...u,ref:c}],[Q,S],[$,{shouldCloseOnSelect:t.shouldCloseOnSelect??C}]]},e.createElement(s,{collection:a.collection,parent:r})))}const se=V(F,oe),$=n(null);export{se as MenuSection};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as MenuItem$1, r as MenuProps, t as Menu } from "../Menu-
|
|
2
|
-
import { n as MenuListItemProps, t as MenuItem } from "../MenuItem-
|
|
1
|
+
import { n as MenuItem$1, r as MenuProps, t as Menu } from "../Menu-BM9gC3Or.js";
|
|
2
|
+
import { n as MenuListItemProps, t as MenuItem } from "../MenuItem-Cw_-egy4.js";
|
|
3
3
|
export { Menu, MenuItem, type MenuItem$1 as MenuItemDefinition, type MenuListItemProps, type MenuProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ModalProps, t as Modal } from "../Modal
|
|
1
|
+
import { n as ModalProps, t as Modal } from "../Modal--xD51Y24.js";
|
|
2
2
|
export { Modal, type ModalProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as NumberInputProps, n as NumberInput, r as NumberInputComponent, t as ControlledNumberInputProps } from "../NumberInput-
|
|
1
|
+
import { i as NumberInputProps, n as NumberInput, r as NumberInputComponent, t as ControlledNumberInputProps } from "../NumberInput-Er4_JOdF.js";
|
|
2
2
|
export { ControlledNumberInputProps, NumberInput, NumberInputComponent, NumberInputProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as NumberRangeValue, n as NumberRangeInput, r as NumberRangeInputProps, t as ControlledNumberRangeInputProps } from "../NumberRangeInput-
|
|
1
|
+
import { i as NumberRangeValue, n as NumberRangeInput, r as NumberRangeInputProps, t as ControlledNumberRangeInputProps } from "../NumberRangeInput-Docbid25.js";
|
|
2
2
|
export { ControlledNumberRangeInputProps, NumberRangeInput, NumberRangeInputProps, type NumberRangeValue };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as PaginationListProps, t as PaginationList } from "../PaginationList-
|
|
1
|
+
import { n as PaginationListProps, t as PaginationList } from "../PaginationList-WMr1TrNu.js";
|
|
2
2
|
export { PaginationList, PaginationListProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as PaginationProps, t as Pagination } from "../Pagination-
|
|
1
|
+
import { n as PaginationProps, t as Pagination } from "../Pagination-oaAVGqb6.js";
|
|
2
2
|
export { Pagination, PaginationProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as PasswordInput, r as PasswordInputProps, t as ControlledPasswordInputProps } from "../PasswordInput-
|
|
1
|
+
import { n as PasswordInput, r as PasswordInputProps, t as ControlledPasswordInputProps } from "../PasswordInput-CMuecbth.js";
|
|
2
2
|
export { ControlledPasswordInputProps, PasswordInput, PasswordInputProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as PillButtonProps, t as PillButton } from "../PillButton-
|
|
1
|
+
import { n as PillButtonProps, t as PillButton } from "../PillButton-CENJX_j1.js";
|
|
2
2
|
export { PillButton, PillButtonProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as PillProps, t as Pill } from "../Pill-
|
|
1
|
+
import { n as PillProps, t as Pill } from "../Pill-Bhp_PzWU.js";
|
|
2
2
|
export { Pill, PillProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Pressable as e}from"react-aria";import"react-stately";export{e as Pressable};
|
|
1
|
+
import{Pressable as e}from"react-aria";import"react-stately";import"@react-aria/dnd";export{e as Pressable};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as FieldValues } from "../form.binding-
|
|
2
|
-
import { s as SelectItem } from "../SelectBase-
|
|
3
|
-
import { n as QueryFn, t as QueryAutocompleteProps } from "../queryAutocomplete.types-
|
|
1
|
+
import { n as FieldValues } from "../form.binding-K3vP-Nhi.js";
|
|
2
|
+
import { s as SelectItem } from "../SelectBase-BqiKBIUQ.js";
|
|
3
|
+
import { n as QueryFn, t as QueryAutocompleteProps } from "../queryAutocomplete.types-B6mZJnhq.js";
|
|
4
4
|
//#region src/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts
|
|
5
5
|
declare const QueryAutocompleteComponent: <TFieldValues extends FieldValues, TSelectItem extends SelectItem<any>, TQueryFn extends QueryFn>(props: QueryAutocompleteProps<TFieldValues, TSelectItem, TQueryFn>) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
declare const QueryAutocomplete: typeof QueryAutocompleteComponent;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as QuerySelectProps, t as QuerySelect } from "../QuerySelect-
|
|
1
|
+
import { n as QuerySelectProps, t as QuerySelect } from "../QuerySelect-spwFI_4I.js";
|
|
2
2
|
export { QuerySelect, QuerySelectProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as RadioGroup, r as RadioGroupProps, t as ControlledRadioGroupProps } from "../RadioGroup-
|
|
1
|
+
import { n as RadioGroup, r as RadioGroupProps, t as ControlledRadioGroupProps } from "../RadioGroup-DMke8FAY.js";
|
|
2
2
|
export { ControlledRadioGroupProps, RadioGroup, RadioGroupProps };
|
|
@@ -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,useState as l}from"react";import{filterDOMProps as u,inertValue as d,isScrollable as f,mergeRefs as p,useLayoutEffect as m,useLoadMoreSentinel as h,useObjectRef as g,useResizeObserver as _}from"@react-aria/utils";import{FocusableContext as v}from"@react-aria/interactions";import"react-dom";import{mergeProps as y}from"react-aria";import{useTableColumnResizeState as b}from"react-stately";function x(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 S(t,n,r){let{render:i,...a}=n,o=c(null),l=s(()=>p(r,o),[r,o]);m(()=>{},[t,i]);let u={...a,ref:l};return i?i(u,void 0):e.createElement(t,u)}const C={},w=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=C[t];return n||(n=r(S.bind(null,t)),C[t]=n),n}});
|
|
1
|
+
import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useMemo as s,useRef as c,useState as l}from"react";import{filterDOMProps as u,inertValue as d,isScrollable as f,mergeRefs as p,useLayoutEffect as m,useLoadMoreSentinel as h,useObjectRef as g,useResizeObserver as _}from"@react-aria/utils";import{FocusableContext as v}from"@react-aria/interactions";import"react-dom";import{mergeProps as y}from"react-aria";import{useTableColumnResizeState as b}from"react-stately";function x(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 S(t,n,r){let{render:i,...a}=n,o=c(null),l=s(()=>p(r,o),[r,o]);m(()=>{},[t,i]);let u={...a,ref:l};return i?i(u,void 0):e.createElement(t,u)}const C={},w=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=C[t];return n||(n=r(S.bind(null,t)),C[t]=n),n}});var T=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},E=class extends T{filter(e,t,n){let[r,i]=j(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},D=class extends T{};D.type=`header`;var O=class extends T{};O.type=`loader`;var k=class extends E{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};k.type=`item`;var A=class extends E{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};A.type=`section`;function j(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function M(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,c=s(()=>new WeakMap,o);return s(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=c.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),c.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,c,i,a])}String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;const N=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const P=n(null);function F(e){var t;return t=class extends T{},t.type=e,t}function I(t,n,r,i,s,c){typeof t==`string`&&(t=F(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(P);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(P.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function L(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(v);if(!o(N)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return I(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(v.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}const R={CollectionRoot({collection:e,renderDropIndicator:t}){return z(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return z(e,t,n)}};function z(t,n,r){return M({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,B(t,n,r))}})}function B(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const V=n(R),H=n(null),U=r(function(t,n){let r=g(n),i=c(null),a=c(null),[o,d]=l(0);m(()=>{let e=i.current;for(;e&&e!==r.current&&!f(e);)e=e.parentElement;a.current=e},[r]),_({ref:a,box:`border-box`,onResize(){d(a.current?.clientWidth??0)}}),m(()=>{d(a.current?.clientWidth??0)},[]);let p=s(()=>({tableRef:i,scrollRef:a,tableWidth:o,useTableColumnResizeState:b,onResizeStart:t.onResizeStart,onResize:t.onResize,onResizeEnd:t.onResizeEnd}),[i,o,t.onResizeStart,t.onResize,t.onResizeEnd]);return e.createElement(w.div,{render:t.render,...u(t,{global:!0}),ref:r,className:t.className||`react-aria-ResizableTableContainer`,style:t.style,onScroll:t.onScroll},e.createElement(H.Provider,{value:p},t.children))}),W=n(null);var G=class extends T{};G.type=`tableheader`;var K=class extends T{};K.type=`column`;var q=class extends E{};q.type=`tablebody`;var J=class extends T{filter(e,t,n){let r=e.getChildren(this.key);for(let i of r)if(n(i.textValue,i)){let n=this.clone();return t.addDescendants(n,e),n}return null}};J.type=`item`;let Y=r(function(t,n){let{isVirtualized:r}=o(V);return r?e.createElement(w.div,{...t,ref:n}):e.createElement(w.tr,{...t,ref:n})});var X=class extends T{};X.type=`cell`;let Z=r(function(t,n){let{isVirtualized:r}=o(V);return r?e.createElement(w.div,{...t,ref:n}):e.createElement(w.td,{...t,ref:n})});L(O,function(t,n,r){let i=o(W),{isVirtualized:a}=o(V),{isLoading:l,onLoadMore:f,scrollOffset:p,...m}=t,g=i.collection.columns.length,_=c(null),v=s(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:_,scrollOffset:p}),[f,p,i?.collection]);h(v,_);let b=x({...m,id:void 0,children:r.rendered,defaultClassName:`react-aria-TableLoadingIndicator`,values:void 0}),S={},C={},w={};return a?(C[`aria-colspan`]=g,w={display:`contents`}):C.colSpan=g,e.createElement(e.Fragment,null,e.createElement(Y,{style:{height:0},inert:d(!0)},e.createElement(Z,{style:{padding:0,border:0}},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:_,style:{position:`relative`,height:1,width:1}}))),l&&b.children&&e.createElement(Y,{...y(u(t,{global:!0}),S),...b,role:`row`,ref:n},e.createElement(Z,{role:`rowheader`,...C,style:w},b.children)))});export{U as ResizableTableContainer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ResponsivePopoverProps, t as ResponsivePopover } from "../ResponsivePopover-
|
|
1
|
+
import { n as ResponsivePopoverProps, t as ResponsivePopover } from "../ResponsivePopover-C7TatLOZ.js";
|
|
2
2
|
export { ResponsivePopover, ResponsivePopoverProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{RouterProvider as e}from"react-aria";import"react-stately";export{e as RouterProvider};
|
|
1
|
+
import{RouterProvider as e}from"react-aria";import"react-stately";import"@react-aria/dnd";export{e as RouterProvider};
|
|
@@ -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{createPortal as _}from"react-dom";import{mergeProps as v,useFocusRing as y,useHover as b,useTableRow as x,useTableSelectionCheckbox as S,useVisuallyHidden as C}from"react-aria";import"react-stately";const ee=n(null);n(null),n(null),n(null),n(null),n({}),n(null),n(null);const w=Symbol(`default`);function te({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function T(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 E(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 D={},O=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=D[t];return n||(n=r(E.bind(null,t)),D[t]=n),n}});String(Math.round(Math.random()*1e10));const k=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function A(){return!1}function j(){return!0}function M(e){return()=>{}}function N(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(M,A,j):o(k)}var P=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}},F=class extends P{filter(e,t,n){let[r,i]=ne(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},I=class extends P{};I.type=`header`;var L=class extends P{};L.type=`loader`;var R=class extends F{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};R.type=`item`;var z=class extends F{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}};z.type=`section`;function ne(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 B(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 V=n(!1),H=n(null);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const U=n(null);function re(e){var t;return t=class extends P{},t.type=e,t}function W(t,n,r,i,s,c){typeof t==`string`&&(t=re(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(U);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(U.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function ie(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(g);if(!o(V)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return W(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 ae(t,n,i=G){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>W(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function G(e){return B({...e,addIdAndValue:!0})}const K=n(null);function oe(t){let n=o(K),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=G({...t,idScope:i,dependencies:r});return o(H)&&(a=e.createElement(se,null,a)),n=c(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(K.Provider,{value:n},a)}function se({children:t}){let n=o(H),r=c(()=>e.createElement(H.Provider,{value:null},e.createElement(V.Provider,{value:!0},t)),[t]);return N()?e.createElement(U.Provider,{value:n},r):_(r,n)}const ce={CollectionRoot({collection:e,renderDropIndicator:t}){return q(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return q(e,t,n)}};function q(t,n,r){return B({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,le(t,n,r))}})}function le(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(ce),ue=n({}),de=n({}),Y=n({isSelected:!1}),X=n(null);var fe=class extends P{};fe.type=`tableheader`;var pe=class extends P{};pe.type=`column`;var me=class extends F{};me.type=`tablebody`;var Z=class extends P{filter(e,t,n){let r=e.getChildren(this.key);for(let i of r)if(n(i.textValue,i)){let n=this.clone();return t.addDescendants(n,e),n}return null}};Z.type=`item`;let Q=r(function(t,n){let{isVirtualized:r}=o(J);return r?e.createElement(O.div,{...t,ref:n}):e.createElement(O.tr,{...t,ref:n})});const he=ae(Z,(t,n,r)=>{let i=h(n),a=o(X),{dragAndDropHooks:c,dragState:d,dropState:f}=o(de),{isVirtualized:p,CollectionBranch:m}=o(J),{rowProps:g,..._}=x({node:r,shouldSelectOnPressUp:!!d,isVirtualized:p},a,i),{isFocused:E,isFocusVisible:D,focusProps:O}=y(),{isFocusVisible:k,focusProps:A}=y({within:!0}),{hoverProps:j,isHovered:M}=b({isDisabled:!_.allowsSelection&&!_.hasAction,onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),{checkboxProps:N}=S({key:r.key},a),P;d&&c&&(P=c.useDraggableItem({key:r.key,hasDragButton:!0},d));let F,I=l(null),{visuallyHiddenProps:L}=C();f&&c&&(F=c.useDropIndicator({target:{type:`item`,key:r.key,dropPosition:`on`}},f,I));let R=l(null);s(()=>{d&&R.current},[]);let z=d&&d.isDragging(r.key),{children:ne,...B}=t,V=T({...B,id:void 0,defaultClassName:`react-aria-Row`,values:{..._,isHovered:M,isFocused:E,isFocusVisible:D,selectionMode:a.selectionManager.selectionMode,selectionBehavior:a.selectionManager.selectionBehavior,isDragging:z,isDropTarget:F?.isDropTarget,isFocusVisibleWithin:k,id:r.key}}),H=u(t,{global:!0});return delete H.id,delete H.onClick,e.createElement(e.Fragment,null,F&&!F.isHidden&&e.createElement(Q,{role:`row`,style:{height:0}},e.createElement($,{role:`gridcell`,colSpan:a.collection.columnCount,style:{padding:0}},e.createElement(`div`,{role:`button`,...L,...F.dropIndicatorProps,ref:I}))),e.createElement(Q,{...v(H,V,g,O,j,P?.dragProps,A),ref:i,"data-disabled":_.isDisabled||void 0,"data-selected":_.isSelected||void 0,"data-hovered":M||void 0,"data-focused":_.isFocused||void 0,"data-focus-visible":D||void 0,"data-pressed":_.isPressed||void 0,"data-dragging":z||void 0,"data-drop-target":F?.isDropTarget||void 0,"data-selection-mode":a.selectionManager.selectionMode===`none`?void 0:a.selectionManager.selectionMode,"data-focus-visible-within":k||void 0},e.createElement(te,{values:[[ee,{slots:{[w]:{},selection:N}}],[ue,{slots:{[w]:{},drag:{...P?.dragButtonProps,ref:R,style:{pointerEvents:`none`}}}}],[Y,{isSelected:_.isSelected}]]},e.createElement(m,{collection:a.collection,parent:r}))))},t=>{if(t.id==null&&typeof t.children==`function`)throw Error(`No id detected for the Row element. The Row element requires a id to be provided to it when the cells are rendered dynamically.`);let n=[t.value].concat(t.dependencies);return e.createElement(oe,{dependencies:n,items:t.columns,idScope:t.id},t.children)});var ge=class extends P{};ge.type=`cell`;let $=r(function(t,n){let{isVirtualized:r}=o(J);return r?e.createElement(O.div,{...t,ref:n}):e.createElement(O.td,{...t,ref:n})});ie(L,function(t,n,r){let i=o(X),{isVirtualized:a}=o(J),{isLoading:s,onLoadMore:f,scrollOffset:p,...h}=t,g=i.collection.columns.length,_=l(null),y=c(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:_,scrollOffset:p}),[f,p,i?.collection]);m(y,_);let b=T({...h,id:void 0,children:r.rendered,defaultClassName:`react-aria-TableLoadingIndicator`,values:void 0}),x={},S={},C={};return a?(S[`aria-colspan`]=g,C={display:`contents`}):S.colSpan=g,e.createElement(e.Fragment,null,e.createElement(Q,{style:{height:0},inert:d(!0)},e.createElement($,{style:{padding:0,border:0}},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:_,style:{position:`relative`,height:1,width:1}}))),s&&b.children&&e.createElement(Q,{...v(u(t,{global:!0}),x),...b,role:`row`,ref:n},e.createElement($,{role:`rowheader`,...S,style:C},b.children)))});export{he as Row};
|
|
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{createPortal as _}from"react-dom";import{mergeProps as v,useFocusRing as y,useHover as b,useTableRow as x,useTableSelectionCheckbox as S,useVisuallyHidden as C}from"react-aria";import"react-stately";const ee=n(null);n(null),n(null),n(null),n(null),n({}),n(null),n(null);const w=Symbol(`default`);function te({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function T(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 E(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 D={},O=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=D[t];return n||(n=r(E.bind(null,t)),D[t]=n),n}});var k=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}},A=class extends k{filter(e,t,n){let[r,i]=F(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},j=class extends k{};j.type=`header`;var M=class extends k{};M.type=`loader`;var N=class extends A{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};N.type=`item`;var P=class extends A{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}};P.type=`section`;function F(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 I(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));const L=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function R(){return!1}function z(){return!0}function ne(e){return()=>{}}function B(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(ne,R,z):o(L)}const V=n(!1),H=n(null);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const U=n(null);function re(e){var t;return t=class extends k{},t.type=e,t}function W(t,n,r,i,s,c){typeof t==`string`&&(t=re(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(U);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(U.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function ie(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(g);if(!o(V)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return W(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 ae(t,n,i=G){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>W(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function G(e){return I({...e,addIdAndValue:!0})}const K=n(null);function oe(t){let n=o(K),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=G({...t,idScope:i,dependencies:r});return o(H)&&(a=e.createElement(se,null,a)),n=c(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(K.Provider,{value:n},a)}function se({children:t}){let n=o(H),r=c(()=>e.createElement(H.Provider,{value:null},e.createElement(V.Provider,{value:!0},t)),[t]);return B()?e.createElement(U.Provider,{value:n},r):_(r,n)}const ce={CollectionRoot({collection:e,renderDropIndicator:t}){return q(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return q(e,t,n)}};function q(t,n,r){return I({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,le(t,n,r))}})}function le(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(ce),ue=n({}),de=n({}),fe=n({isSelected:!1}),Y=n(null);var pe=class extends k{};pe.type=`tableheader`;var me=class extends k{};me.type=`column`;var X=class extends A{};X.type=`tablebody`;var Z=class extends k{filter(e,t,n){let r=e.getChildren(this.key);for(let i of r)if(n(i.textValue,i)){let n=this.clone();return t.addDescendants(n,e),n}return null}};Z.type=`item`;let Q=r(function(t,n){let{isVirtualized:r}=o(J);return r?e.createElement(O.div,{...t,ref:n}):e.createElement(O.tr,{...t,ref:n})});const he=ae(Z,(t,n,r)=>{let i=h(n),a=o(Y),{dragAndDropHooks:c,dragState:d,dropState:f}=o(de),{isVirtualized:p,CollectionBranch:m}=o(J),{rowProps:g,..._}=x({node:r,shouldSelectOnPressUp:!!d,isVirtualized:p},a,i),{isFocused:E,isFocusVisible:D,focusProps:O}=y(),{isFocusVisible:k,focusProps:A}=y({within:!0}),{hoverProps:j,isHovered:M}=b({isDisabled:!_.allowsSelection&&!_.hasAction,onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),{checkboxProps:N}=S({key:r.key},a),P;d&&c&&(P=c.useDraggableItem({key:r.key,hasDragButton:!0},d));let F,I=l(null),{visuallyHiddenProps:L}=C();f&&c&&(F=c.useDropIndicator({target:{type:`item`,key:r.key,dropPosition:`on`}},f,I));let R=l(null);s(()=>{d&&R.current},[]);let z=d&&d.isDragging(r.key),{children:ne,...B}=t,V=T({...B,id:void 0,defaultClassName:`react-aria-Row`,values:{..._,isHovered:M,isFocused:E,isFocusVisible:D,selectionMode:a.selectionManager.selectionMode,selectionBehavior:a.selectionManager.selectionBehavior,isDragging:z,isDropTarget:F?.isDropTarget,isFocusVisibleWithin:k,id:r.key}}),H=u(t,{global:!0});return delete H.id,delete H.onClick,e.createElement(e.Fragment,null,F&&!F.isHidden&&e.createElement(Q,{role:`row`,style:{height:0}},e.createElement($,{role:`gridcell`,colSpan:a.collection.columnCount,style:{padding:0}},e.createElement(`div`,{role:`button`,...L,...F.dropIndicatorProps,ref:I}))),e.createElement(Q,{...v(H,V,g,O,j,P?.dragProps,A),ref:i,"data-disabled":_.isDisabled||void 0,"data-selected":_.isSelected||void 0,"data-hovered":M||void 0,"data-focused":_.isFocused||void 0,"data-focus-visible":D||void 0,"data-pressed":_.isPressed||void 0,"data-dragging":z||void 0,"data-drop-target":F?.isDropTarget||void 0,"data-selection-mode":a.selectionManager.selectionMode===`none`?void 0:a.selectionManager.selectionMode,"data-focus-visible-within":k||void 0},e.createElement(te,{values:[[ee,{slots:{[w]:{},selection:N}}],[ue,{slots:{[w]:{},drag:{...P?.dragButtonProps,ref:R,style:{pointerEvents:`none`}}}}],[fe,{isSelected:_.isSelected}]]},e.createElement(m,{collection:a.collection,parent:r}))))},t=>{if(t.id==null&&typeof t.children==`function`)throw Error(`No id detected for the Row element. The Row element requires a id to be provided to it when the cells are rendered dynamically.`);let n=[t.value].concat(t.dependencies);return e.createElement(oe,{dependencies:n,items:t.columns,idScope:t.id},t.children)});var ge=class extends k{};ge.type=`cell`;let $=r(function(t,n){let{isVirtualized:r}=o(J);return r?e.createElement(O.div,{...t,ref:n}):e.createElement(O.td,{...t,ref:n})});ie(M,function(t,n,r){let i=o(Y),{isVirtualized:a}=o(J),{isLoading:s,onLoadMore:f,scrollOffset:p,...h}=t,g=i.collection.columns.length,_=l(null),y=c(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:_,scrollOffset:p}),[f,p,i?.collection]);m(y,_);let b=T({...h,id:void 0,children:r.rendered,defaultClassName:`react-aria-TableLoadingIndicator`,values:void 0}),x={},S={},C={};return a?(S[`aria-colspan`]=g,C={display:`contents`}):S.colSpan=g,e.createElement(e.Fragment,null,e.createElement(Q,{style:{height:0},inert:d(!0)},e.createElement($,{style:{padding:0,border:0}},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:_,style:{position:`relative`,height:1,width:1}}))),s&&b.children&&e.createElement(Q,{...v(u(t,{global:!0}),x),...b,role:`row`,ref:n},e.createElement($,{role:`rowheader`,...S,style:C},b.children)))});export{he as Row};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{cloneElement as t,createContext as n,forwardRef as r,useCallback as i,useContext as a,useMemo as o}from"react";import"@react-aria/interactions";import"react-dom";
|
|
1
|
+
import e,{cloneElement as t,createContext as n,forwardRef as r,useCallback as i,useContext as a,useMemo as o}from"react";import"@react-aria/interactions";import"react-dom";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]=p(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},l=class extends s{};l.type=`header`;var u=class extends s{};u.type=`loader`;var d=class extends c{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};d.type=`item`;var f=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}};f.type=`section`;function p(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function m(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:s=[]}=e,c=o(()=>new WeakMap,s);return o(()=>{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,typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const h=n(null);function g(e){var t;return t=class extends s{},t.type=e,t}function _(t,n,r,o,s,c){typeof t==`string`&&(t=g(t));let l=i(e=>{e?.setProps(n,r,t,o,c)},[n,r,o,c,t]),u=a(h);if(u){let i=u.ownerDocument.nodesByProps.get(n);return i||(i=u.ownerDocument.createElement(t.type),i.setProps(n,r,t,o,c),u.appendChild(i),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,i)),s?e.createElement(h.Provider,{value:i},s):null}return e.createElement(t.type,{ref:l},s)}function v(t,n,i=y){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>_(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function y(e){return m({...e,addIdAndValue:!0})}const b=n(null),x=v(`section`,(e,t,n)=>{let{name:r,render:i}=a(b);return i(e,t,n,`react-aria-Section`)});export{x as Section};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { o as SegmentProps, t as ControlledSegmentProps } from "../segment.types-
|
|
2
|
-
import { t as Segment } from "../Segment-
|
|
1
|
+
import { o as SegmentProps, t as ControlledSegmentProps } from "../segment.types-11U4nbX6.js";
|
|
2
|
+
import { t as Segment } from "../Segment-Cnmq-yRu.js";
|
|
3
3
|
export { type ControlledSegmentProps, Segment, type SegmentProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useMemo as a,useRef as o,useState as s,useSyncExternalStore as c}from"react";import{filterDOMProps as l,inertValue as u,mergeProps as d,mergeRefs as f,useLayoutEffect as p,useLoadMoreSentinel as m,useObjectRef as h,useResizeObserver as g}from"@react-aria/utils";import{FocusableContext as _}from"@react-aria/interactions";import"react-dom";import{HiddenSelect as ee,mergeProps as v,useFocusRing as y,useSelect as te}from"react-aria";import{useSelectState as b}from"react-stately";const x=Symbol(`default`);function ne({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function S(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return a(()=>{let e,a,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,a=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??i,style:a||s?{...s,...a}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,o,s,c,l])}function C(e,t){let n=i(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||x;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 w(e,t,n){let{ref:r,...i}=C(n,e.slot)||{},o=h(a(()=>f(t,r),[t,r])),s=d(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(s.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[s,o]}function re(e=!0){let[t,n]=s(e),i=o(!1),a=r(e=>{i.current=!0,n(!!e)},[]);return p(()=>{i.current||n(!1)},[]),[a,t]}function ie(e){let t=/^(data-.*)$/,n={};for(let r in e)t.test(r)||(n[r]=e[r]);return n}function T(t,n,r){let{render:i,...s}=n,c=o(null),l=a(()=>f(r,c),[r,c]);p(()=>{},[t,i]);let u={...s,ref:l};return i?i(u,void 0):e.createElement(t,u)}const E={},D=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=E[t];return r||(r=n(T.bind(null,t)),E[t]=r),r}});String(Math.round(Math.random()*1e10));const O=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function k(){return!1}function A(){return!0}function j(e){return()=>{}}function M(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(j,k,A):i(O)}var N=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}},P=class extends N{filter(e,t,n){let[r,i]=z(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},F=class extends N{};F.type=`header`;var I=class extends N{};I.type=`loader`;var L=class extends P{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};L.type=`item`;var R=class extends P{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}};R.type=`section`;var ae=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}},oe=class extends B{get isConnected(){return!0}createElement(e){return new V(e,this)}getMutableCollection(){return this.nextCollection||=this.collection.clone(),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let t of e)this.addNode(t);t.addNode(e.node)}removeNode(e){for(let t of e)this.removeNode(t);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let e of this.dirtyNodes)e instanceof V&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof V?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}};if(typeof HTMLTemplateElement<`u`){let e=Object.getOwnPropertyDescriptor(Node.prototype,`firstChild`).get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}const H=t(!1);function U(t){if(i(H))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(H.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}const W=t(!1),G=t(null);function K(t){if(i(G))return t.content;let{collection:n,document:r}=ue(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(U,null,e.createElement(G.Provider,{value:r},t.content)),e.createElement(se,{render:t.children,collection:n}))}function se({collection:e,render:t}){return t(e)}function ce(e,t,n){let i=M(),a=o(i);a.current=i;let s=r(()=>a.current?n():t(),[t,n]);return c(e,s)}const le=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:ce;function ue(e){let[t]=s(()=>new oe(e?.()||new ae)),n=r(e=>t.subscribe(e),[t]),i=r(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),a=r(()=>(t.isSSR=!0,t.getCollection()),[t]);return{collection:le(n,i,a),document:t}}const q=t(null);function de(e){var t;return t=class extends N{},t.type=e,t}function fe(t,n,a,o,s,c){typeof t==`string`&&(t=de(t));let l=r(e=>{e?.setProps(n,a,t,o,c)},[n,a,o,c,t]),u=i(q);if(u){let r=u.ownerDocument.nodesByProps.get(n);return r||(r=u.ownerDocument.createElement(t.type),r.setProps(n,a,t,o,c),u.appendChild(r),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,r)),s?e.createElement(q.Provider,{value:r},s):null}return e.createElement(t.type,{ref:l},s)}function pe(t,r){let a=({node:e})=>r(e.props,e.props.ref,e),o=n((n,o)=>{let s=i(_);if(!i(W)){if(r.length>=3)throw Error(r.name+` cannot be rendered outside a collection.`);return r(n,o)}return fe(t,n,o,`children`in n?n.children:null,null,t=>e.createElement(_.Provider,{value:s},e.createElement(a,{node:t})))});return o.displayName=r.name,o}const J=t({}),Y=t({}),X=t({}),me=t(null),he=t(null),ge=t(null),Z=t(null);pe(I,function(t,n,r){let s=i(Z),{isLoading:c,onLoadMore:d,scrollOffset:f,...p}=t,h=o(null),g=a(()=>({onLoadMore:d,collection:s?.collection,sentinelRef:h,scrollOffset:f}),[d,f,s?.collection]);m(g,h);let _=S({...p,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),c&&_.children&&e.createElement(D.div,{...v(l(t,{global:!0}),{tabIndex:-1}),..._,role:`option`,ref:n},_.children))});const _e=t(null),Q=t(null),$=t(null),ve=t(null),ye=n(function(t,n){[t,n]=w(t,n,$);let{children:r,isDisabled:i=!1,isInvalid:o=!1,isRequired:s=!1}=t,c=a(()=>typeof r==`function`?r({isOpen:!1,isDisabled:i,isInvalid:o,isRequired:s,isFocused:!1,isFocusVisible:!1,defaultChildren:null}):r,[r,i,o,s]);return e.createElement(K,{content:c},r=>e.createElement(xe,{props:t,collection:r,selectRef:n}))}),be=[J,Y,X];function xe({props:t,selectRef:n,collection:i}){let{validationBehavior:c}=C(he)||{},u=t.validationBehavior??c??`native`,f=b({...t,collection:i,children:void 0,validationBehavior:u}),{isFocusVisible:p,focusProps:m}=y({within:!0}),h=o(null),[_,v]=re(!t[`aria-label`]&&!t[`aria-labelledby`]),{labelProps:x,triggerProps:w,valueProps:T,menuProps:E,descriptionProps:O,errorMessageProps:k,hiddenSelectProps:A,...j}=te({...ie(t),label:v,validationBehavior:u},f,h),[M,N]=s(null),P=r(()=>{h.current&&N(h.current.offsetWidth+`px`)},[h]);g({ref:h,onResize:P});let F=a(()=>({isOpen:f.isOpen,isFocused:f.isFocused,isFocusVisible:p,isDisabled:t.isDisabled||!1,isInvalid:j.isInvalid||!1,isRequired:t.isRequired||!1}),[f.isOpen,f.isFocused,p,t.isDisabled,j.isInvalid,t.isRequired]),I=S({...t,values:F,defaultClassName:`react-aria-Select`}),L=l(t,{global:!0});delete L.id;let R=o(null);return e.createElement(ne,{values:[[$,t],[ve,f],[Se,T],[J,{...x,ref:_,elementType:`span`}],[Y,{...w,ref:h,isPressed:f.isOpen,autoFocus:t.autoFocus}],[Q,f],[_e,{trigger:`Select`,triggerRef:h,scrollRef:R,placement:`bottom start`,style:{"--trigger-width":M},"aria-labelledby":E[`aria-labelledby`],clearContexts:be}],[ge,{...E,ref:R}],[Z,f],[X,{slots:{description:O,errorMessage:k}}],[me,j]]},e.createElement(D.div,{...d(L,I,m),ref:n,slot:t.slot||void 0,"data-focused":f.isFocused||void 0,"data-focus-visible":p||void 0,"data-open":f.isOpen||void 0,"data-disabled":t.isDisabled||void 0,"data-invalid":j.isInvalid||void 0,"data-required":t.isRequired||void 0},I.children,e.createElement(ee,{...A,autoComplete:t.autoComplete})))}const Se=t(null);export{ye as Select};
|
|
1
|
+
import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useMemo as a,useRef as o,useState as s,useSyncExternalStore as c}from"react";import{filterDOMProps as l,inertValue as u,mergeProps as d,mergeRefs as f,useLayoutEffect as p,useLoadMoreSentinel as m,useObjectRef as h,useResizeObserver as g}from"@react-aria/utils";import{FocusableContext as _}from"@react-aria/interactions";import"react-dom";import{HiddenSelect as ee,mergeProps as v,useFocusRing as te,useSelect as ne}from"react-aria";import{useSelectState as y}from"react-stately";const b=Symbol(`default`);function re({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function x(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return a(()=>{let e,a,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,a=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??i,style:a||s?{...s,...a}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,o,s,c,l])}function S(e,t){let n=i(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||b;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function C(e,t,n){let{ref:r,...i}=S(n,e.slot)||{},o=h(a(()=>f(t,r),[t,r])),s=d(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(s.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[s,o]}function ie(e=!0){let[t,n]=s(e),i=o(!1),a=r(e=>{i.current=!0,n(!!e)},[]);return p(()=>{i.current||n(!1)},[]),[a,t]}function w(e){let t=/^(data-.*)$/,n={};for(let r in e)t.test(r)||(n[r]=e[r]);return n}function T(t,n,r){let{render:i,...s}=n,c=o(null),l=a(()=>f(r,c),[r,c]);p(()=>{},[t,i]);let u={...s,ref:l};return i?i(u,void 0):e.createElement(t,u)}const E={},D=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=E[t];return r||(r=n(T.bind(null,t)),E[t]=r),r}});var O=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}},k=class extends O{filter(e,t,n){let[r,i]=F(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},A=class extends O{};A.type=`header`;var j=class extends O{};j.type=`loader`;var M=class extends k{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};M.type=`item`;var N=class extends k{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}};N.type=`section`;var P=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]=F(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 F(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 I=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}},L=class e extends I{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}},R=class extends I{get isConnected(){return!0}createElement(e){return new L(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 L&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof L?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}};if(typeof HTMLTemplateElement<`u`){let e=Object.getOwnPropertyDescriptor(Node.prototype,`firstChild`).get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}const z=t(!1);function ae(t){if(i(z))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(z.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}String(Math.round(Math.random()*1e10));const B=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function V(){return!1}function H(){return!0}function U(e){return()=>{}}function W(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(U,V,H):i(B)}const G=t(!1),K=t(null);function q(t){if(i(K))return t.content;let{collection:n,document:r}=le(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(ae,null,e.createElement(K.Provider,{value:r},t.content)),e.createElement(oe,{render:t.children,collection:n}))}function oe({collection:e,render:t}){return t(e)}function se(e,t,n){let i=W(),a=o(i);a.current=i;let s=r(()=>a.current?n():t(),[t,n]);return c(e,s)}const ce=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:se;function le(e){let[t]=s(()=>new R(e?.()||new P)),n=r(e=>t.subscribe(e),[t]),i=r(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),a=r(()=>(t.isSSR=!0,t.getCollection()),[t]);return{collection:ce(n,i,a),document:t}}const J=t(null);function ue(e){var t;return t=class extends O{},t.type=e,t}function de(t,n,a,o,s,c){typeof t==`string`&&(t=ue(t));let l=r(e=>{e?.setProps(n,a,t,o,c)},[n,a,o,c,t]),u=i(J);if(u){let r=u.ownerDocument.nodesByProps.get(n);return r||(r=u.ownerDocument.createElement(t.type),r.setProps(n,a,t,o,c),u.appendChild(r),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,r)),s?e.createElement(J.Provider,{value:r},s):null}return e.createElement(t.type,{ref:l},s)}function fe(t,r){let a=({node:e})=>r(e.props,e.props.ref,e),o=n((n,o)=>{let s=i(_);if(!i(G)){if(r.length>=3)throw Error(r.name+` cannot be rendered outside a collection.`);return r(n,o)}return de(t,n,o,`children`in n?n.children:null,null,t=>e.createElement(_.Provider,{value:s},e.createElement(a,{node:t})))});return o.displayName=r.name,o}const Y=t({}),X=t({}),Z=t({}),pe=t(null),me=t(null),he=t(null),Q=t(null);fe(j,function(t,n,r){let s=i(Q),{isLoading:c,onLoadMore:d,scrollOffset:f,...p}=t,h=o(null),g=a(()=>({onLoadMore:d,collection:s?.collection,sentinelRef:h,scrollOffset:f}),[d,f,s?.collection]);m(g,h);let _=x({...p,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),c&&_.children&&e.createElement(D.div,{...v(l(t,{global:!0}),{tabIndex:-1}),..._,role:`option`,ref:n},_.children))});const ge=t(null),_e=t(null),$=t(null),ve=t(null),ye=n(function(t,n){[t,n]=C(t,n,$);let{children:r,isDisabled:i=!1,isInvalid:o=!1,isRequired:s=!1}=t,c=a(()=>typeof r==`function`?r({isOpen:!1,isDisabled:i,isInvalid:o,isRequired:s,isFocused:!1,isFocusVisible:!1,defaultChildren:null}):r,[r,i,o,s]);return e.createElement(q,{content:c},r=>e.createElement(xe,{props:t,collection:r,selectRef:n}))}),be=[Y,X,Z];function xe({props:t,selectRef:n,collection:i}){let{validationBehavior:c}=S(me)||{},u=t.validationBehavior??c??`native`,f=y({...t,collection:i,children:void 0,validationBehavior:u}),{isFocusVisible:p,focusProps:m}=te({within:!0}),h=o(null),[_,v]=ie(!t[`aria-label`]&&!t[`aria-labelledby`]),{labelProps:b,triggerProps:C,valueProps:T,menuProps:E,descriptionProps:O,errorMessageProps:k,hiddenSelectProps:A,...j}=ne({...w(t),label:v,validationBehavior:u},f,h),[M,N]=s(null),P=r(()=>{h.current&&N(h.current.offsetWidth+`px`)},[h]);g({ref:h,onResize:P});let F=a(()=>({isOpen:f.isOpen,isFocused:f.isFocused,isFocusVisible:p,isDisabled:t.isDisabled||!1,isInvalid:j.isInvalid||!1,isRequired:t.isRequired||!1}),[f.isOpen,f.isFocused,p,t.isDisabled,j.isInvalid,t.isRequired]),I=x({...t,values:F,defaultClassName:`react-aria-Select`}),L=l(t,{global:!0});delete L.id;let R=o(null);return e.createElement(re,{values:[[$,t],[ve,f],[Se,T],[Y,{...b,ref:_,elementType:`span`}],[X,{...C,ref:h,isPressed:f.isOpen,autoFocus:t.autoFocus}],[_e,f],[ge,{trigger:`Select`,triggerRef:h,scrollRef:R,placement:`bottom start`,style:{"--trigger-width":M},"aria-labelledby":E[`aria-labelledby`],clearContexts:be}],[he,{...E,ref:R}],[Q,f],[Z,{slots:{description:O,errorMessage:k}}],[pe,j]]},e.createElement(D.div,{...d(L,I,m),ref:n,slot:t.slot||void 0,"data-focused":f.isFocused||void 0,"data-focus-visible":p||void 0,"data-open":f.isOpen||void 0,"data-disabled":t.isDisabled||void 0,"data-invalid":j.isInvalid||void 0,"data-required":t.isRequired||void 0},I.children,e.createElement(ee,{...A,autoComplete:t.autoComplete})))}const Se=t(null);export{ye as Select};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as SelectAsyncProps, o as SelectBaseProps, s as SelectItem, t as DefaultInitialSelectItem } from "../SelectBase-
|
|
2
|
-
import { n as Select, r as SelectProps, t as ControlledSelectProps } from "../Select-
|
|
1
|
+
import { a as SelectAsyncProps, o as SelectBaseProps, s as SelectItem, t as DefaultInitialSelectItem } from "../SelectBase-BqiKBIUQ.js";
|
|
2
|
+
import { n as Select, r as SelectProps, t as ControlledSelectProps } from "../Select-DKNYrAih.js";
|
|
3
3
|
export { type ControlledSelectProps, type DefaultInitialSelectItem, Select, type SelectAsyncProps, type SelectBaseProps, type SelectItem, type SelectProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useMemo as a,useRef as o}from"react";import{filterDOMProps as s,mergeProps as c,mergeRefs as l,useLayoutEffect as u,useObjectRef as d}from"@react-aria/utils";import{FocusableContext as f}from"@react-aria/interactions";import"react-dom";import{useSeparator as p}from"react-aria";const m=Symbol(`default`);function h(e,t){let n=i(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||m;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 g(e,t,n){let{ref:r,...i}=h(n,e.slot)||{},o=d(a(()=>l(t,r),[t,r])),s=c(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(s.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[s,o]}function _(t,n,r){let{render:i,...s}=n,c=o(null),d=a(()=>l(r,c),[r,c]);u(()=>{},[t,i]);let f={...s,ref:d};return i?i(f,void 0):e.createElement(t,f)}const v={},y=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=v[t];return r||(r=n(_.bind(null,t)),v[t]=r),r}});
|
|
1
|
+
import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useMemo as a,useRef as o}from"react";import{filterDOMProps as s,mergeProps as c,mergeRefs as l,useLayoutEffect as u,useObjectRef as d}from"@react-aria/utils";import{FocusableContext as f}from"@react-aria/interactions";import"react-dom";import{useSeparator as p}from"react-aria";const m=Symbol(`default`);function h(e,t){let n=i(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||m;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 g(e,t,n){let{ref:r,...i}=h(n,e.slot)||{},o=d(a(()=>l(t,r),[t,r])),s=c(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(s.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[s,o]}function _(t,n,r){let{render:i,...s}=n,c=o(null),d=a(()=>l(r,c),[r,c]);u(()=>{},[t,i]);let f={...s,ref:d};return i?i(f,void 0):e.createElement(t,f)}const v={},y=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=v[t];return r||(r=n(_.bind(null,t)),v[t]=r),r}});var b=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},x=class extends b{filter(e,t,n){let[r,i]=E(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},S=class extends b{};S.type=`header`;var C=class extends b{};C.type=`loader`;var w=class extends x{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};w.type=`item`;var T=class extends x{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};T.type=`section`;function E(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;const D=t(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const O=t(null);function k(e){var t;return t=class extends b{},t.type=e,t}function A(t,n,a,o,s,c){typeof t==`string`&&(t=k(t));let l=r(e=>{e?.setProps(n,a,t,o,c)},[n,a,o,c,t]),u=i(O);if(u){let r=u.ownerDocument.nodesByProps.get(n);return r||(r=u.ownerDocument.createElement(t.type),r.setProps(n,a,t,o,c),u.appendChild(r),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,r)),s?e.createElement(O.Provider,{value:r},s):null}return e.createElement(t.type,{ref:l},s)}function j(t,r){let a=({node:e})=>r(e.props,e.props.ref,e),o=n((n,o)=>{let s=i(f);if(!i(D)){if(r.length>=3)throw Error(r.name+` cannot be rendered outside a collection.`);return r(n,o)}return A(t,n,o,`children`in n?n.children:null,null,t=>e.createElement(f.Provider,{value:s},e.createElement(a,{node:t})))});return o.displayName=r.name,o}const M=t({});var N=class extends b{filter(e,t){let n=t.getItem(this.prevKey);if(n&&n.type!==`separator`){let n=this.clone();return t.addDescendants(n,e),n}return null}};N.type=`separator`;const P=j(N,function(t,n){[t,n]=g(t,n,M);let{elementType:r,orientation:i,style:a,className:o,slot:l,...u}=t,d=r||`hr`;d===`hr`&&i===`vertical`&&(d=`div`);let f=y[d],{separatorProps:m}=p({...u,elementType:r,orientation:i}),h=s(t,{global:!0});return e.createElement(f,{render:t.render,...c(h,m),style:a,className:o??`react-aria-Separator`,ref:n,slot:l||void 0})});export{P as Separator};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as Slider, r as SliderProps, t as ControlledSliderProps } from "../Slider-
|
|
1
|
+
import { n as Slider, r as SliderProps, t as ControlledSliderProps } from "../Slider-BSr-DceL.js";
|
|
2
2
|
export { ControlledSliderProps, Slider, SliderProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SplitButtonProps, t as SplitButton } from "../SplitButton-
|
|
1
|
+
import { n as SplitButtonProps, t as SplitButton } from "../SplitButton-Cr_TZk_j.js";
|
|
2
2
|
export { SplitButton, SplitButtonProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SSRProvider as e}from"react-aria";import"react-stately";export{e as SSRProvider};
|
|
1
|
+
import{SSRProvider as e}from"react-aria";import"react-stately";import"@react-aria/dnd";export{e as SSRProvider};
|
|
@@ -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{mergeRefs as l,useLayoutEffect as u,useObjectRef as d}from"@react-aria/utils";import"@react-aria/interactions";import"react-dom";import{useSubmenuTrigger as f}from"react-aria";import{useSubmenuTriggerState as p}from"react-stately";function m({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function h(t,n,r){let{render:i,...a}=n,o=c(null),d=s(()=>l(r,o),[r,o]);u(()=>{},[t,i]);let f={...a,ref:d};return i?i(f,void 0):e.createElement(t,f)}const g={};new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=g[t];return n||(n=r(h.bind(null,t)),g[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{mergeRefs as l,useLayoutEffect as u,useObjectRef as d}from"@react-aria/utils";import"@react-aria/interactions";import"react-dom";import{useSubmenuTrigger as f}from"react-aria";import{useSubmenuTriggerState as p}from"react-stately";function m({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function h(t,n,r){let{render:i,...a}=n,o=c(null),d=s(()=>l(r,o),[r,o]);u(()=>{},[t,i]);let f={...a,ref:d};return i?i(f,void 0):e.createElement(t,f)}const g={};new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=g[t];return n||(n=r(h.bind(null,t)),g[t]=n),n}});var _=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 _{filter(e,t,n){let[r,i]=C(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},y=class extends _{};y.type=`header`;var b=class extends _{};b.type=`loader`;var x=class extends v{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};x.type=`item`;var S=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}};S.type=`section`;function C(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 w(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,typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const T=n(null);function E(e){var t;return t=class extends _{},t.type=e,t}function D(t,n,r,i,s,c){typeof t==`string`&&(t=E(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(T);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(T.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function O(t,n,i=k){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>D(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function k(e){return w({...e,addIdAndValue:!0})}const A={CollectionRoot({collection:e,renderDropIndicator:t}){return j(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return j(e,t,n)}};function j(t,n,r){return w({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,M(t,n,r))}})}function M(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 N=n(A),P=n(null),F=n(null),I=n(null),L=n(null),R=n(null);var z=class extends _{filter(e,t,n){let r=e.getItem(this.firstChildKey);if(r&&n(r.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};z.type=`submenutrigger`;const B=O(z,(t,n,r)=>{let{CollectionBranch:i}=o(N),a=o(I),s=o(L),l=p({triggerKey:r.key},s),u=c(null),h=d(n),{parentMenuRef:g,shouldUseVirtualFocus:_}=o(R),{submenuTriggerProps:v,submenuProps:y,popoverProps:b}=f({parentMenuRef:g,submenuRef:u,delay:t.delay,shouldUseVirtualFocus:_},l,h);return e.createElement(m,{values:[[V,{...v,onAction:void 0,ref:h}],[F,{ref:u,...y}],[H,l],[P,{trigger:`SubmenuTrigger`,triggerRef:h,placement:`end top`,"aria-labelledby":y[`aria-labelledby`],...b}]]},e.createElement(i,{collection:a.collection,parent:r}),t.children[1])},e=>e.children[0]),V=n(null),H=n(null);export{B as SubmenuTrigger};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useMemo as a,useRef as o}from"react";import{filterDOMProps as s,mergeRefs as c,useLayoutEffect as l,useObjectRef as u}from"@react-aria/utils";import{FocusableContext as d}from"@react-aria/interactions";import"react-dom";import{mergeProps as f,useFocusRing as p,useHover as m,useTab as h}from"react-aria";import"react-stately";function g(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return a(()=>{let e,a,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,a=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??i,style:a||s?{...s,...a}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,o,s,c,l])}function _(t,n,r){let{render:i,...s}=n,u=o(null),d=a(()=>c(r,u),[r,u]);l(()=>{},[t,i]);let f={...s,ref:d};return i?i(f,void 0):e.createElement(t,f)}const v={},y=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=v[t];return r||(r=n(_.bind(null,t)),v[t]=r),r}});
|
|
1
|
+
import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useMemo as a,useRef as o}from"react";import{filterDOMProps as s,mergeRefs as c,useLayoutEffect as l,useObjectRef as u}from"@react-aria/utils";import{FocusableContext as d}from"@react-aria/interactions";import"react-dom";import{mergeProps as f,useFocusRing as p,useHover as m,useTab as h}from"react-aria";import"react-stately";function g(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return a(()=>{let e,a,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,a=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??i,style:a||s?{...s,...a}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,o,s,c,l])}function _(t,n,r){let{render:i,...s}=n,u=o(null),d=a(()=>c(r,u),[r,u]);l(()=>{},[t,i]);let f={...s,ref:d};return i?i(f,void 0):e.createElement(t,f)}const v={},y=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=v[t];return r||(r=n(_.bind(null,t)),v[t]=r),r}});var b=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},x=class extends b{filter(e,t,n){let[r,i]=E(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},S=class extends b{};S.type=`header`;var C=class extends b{};C.type=`loader`;var w=class extends x{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};w.type=`item`;var T=class extends x{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};T.type=`section`;function E(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;const D=t(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const O=t(null);function k(e){var t;return t=class extends b{},t.type=e,t}function A(t,n,a,o,s,c){typeof t==`string`&&(t=k(t));let l=r(e=>{e?.setProps(n,a,t,o,c)},[n,a,o,c,t]),u=i(O);if(u){let r=u.ownerDocument.nodesByProps.get(n);return r||(r=u.ownerDocument.createElement(t.type),r.setProps(n,a,t,o,c),u.appendChild(r),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,r)),s?e.createElement(O.Provider,{value:r},s):null}return e.createElement(t.type,{ref:l},s)}function j(t,r){let a=({node:e})=>r(e.props,e.props.ref,e),o=n((n,o)=>{let s=i(d);if(!i(D)){if(r.length>=3)throw Error(r.name+` cannot be rendered outside a collection.`);return r(n,o)}return A(t,n,o,`children`in n?n.children:null,null,t=>e.createElement(d.Provider,{value:s},e.createElement(a,{node:t})))});return o.displayName=r.name,o}const M=t({isSelected:!1}),N=t(null);var P=class extends b{};P.type=`item`;const F=j(P,(t,n,r)=>{let a=i(N),o=u(n),{tabProps:c,isSelected:l,isDisabled:d,isPressed:_}=h({key:r.key,...t},a,o),{focusProps:v,isFocused:b,isFocusVisible:x}=p(),{hoverProps:S,isHovered:C}=m({isDisabled:d,onHoverStart:t.onHoverStart,onHoverEnd:t.onHoverEnd,onHoverChange:t.onHoverChange}),w=g({...t,id:void 0,children:r.rendered,defaultClassName:`react-aria-Tab`,values:{isSelected:l,isDisabled:d,isFocused:b,isFocusVisible:x,isPressed:_,isHovered:C}}),T=r.props.href?y.a:y.div,E=s(t,{global:!0});return delete E.id,delete E.onClick,e.createElement(T,{...f(E,w,c,v,S),ref:o,"data-selected":l||void 0,"data-disabled":d||void 0,"data-focused":b||void 0,"data-focus-visible":x||void 0,"data-pressed":_||void 0,"data-hovered":C||void 0},e.createElement(M.Provider,{value:{isSelected:l}},w.children))});export{F as Tab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useContext as a,useMemo as o,useRef as s}from"react";import{filterDOMProps as c,mergeRefs as l,useLayoutEffect as u,useObjectRef as d}from"@react-aria/utils";import"@react-aria/interactions";import{createPortal as f}from"react-dom";import{mergeProps as p,useTabList as m}from"react-aria";import"react-stately";const h=Symbol(`default`);function g(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:s,values:c,render:l}=e;return o(()=>{let e,o,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,o=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:a}):r??a,{className:e??i,style:o||s?{...s,...o}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,a,s,c,l])}function _(e,t){let n=a(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(t,n,r){let{render:i,...a}=n,c=s(null),d=o(()=>l(r,c),[r,c]);u(()=>{},[t,i]);let f={...a,ref:d};return i?i(f,void 0):e.createElement(t,f)}const y={},b=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=y[t];return n||(n=r(v.bind(null,t)),y[t]=n),n}});
|
|
1
|
+
import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useContext as a,useMemo as o,useRef as s}from"react";import{filterDOMProps as c,mergeRefs as l,useLayoutEffect as u,useObjectRef as d}from"@react-aria/utils";import"@react-aria/interactions";import{createPortal as f}from"react-dom";import{mergeProps as p,useTabList as m}from"react-aria";import"react-stately";const h=Symbol(`default`);function g(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:s,values:c,render:l}=e;return o(()=>{let e,o,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,o=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:a}):r??a,{className:e??i,style:o||s?{...s,...o}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,a,s,c,l])}function _(e,t){let n=a(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(t,n,r){let{render:i,...a}=n,c=s(null),d=o(()=>l(r,c),[r,c]);u(()=>{},[t,i]);let f={...a,ref:d};return i?i(f,void 0):e.createElement(t,f)}const y={},b=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=y[t];return n||(n=r(v.bind(null,t)),y[t]=n),n}});var x=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}},S=class extends x{filter(e,t,n){let[r,i]=D(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},C=class extends x{};C.type=`header`;var w=class extends x{};w.type=`loader`;var T=class extends S{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};T.type=`item`;var E=class extends S{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}};E.type=`section`;function D(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 O(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:s=[]}=e,c=o(()=>new WeakMap,s);return o(()=>{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));const k=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function A(){return!1}function j(){return!0}function M(e){return()=>{}}function N(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(M,A,j):a(k)}const P=n(!1),F=n(null);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const I=n(null);function L(e){return O({...e,addIdAndValue:!0})}const R=n(null);function z(t){let n=a(R),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,s=L({...t,idScope:i,dependencies:r});return a(F)&&(s=e.createElement(B,null,s)),n=o(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(R.Provider,{value:n},s)}function B({children:t}){let n=a(F),r=o(()=>e.createElement(F.Provider,{value:null},e.createElement(P.Provider,{value:!0},t)),[t]);return N()?e.createElement(I.Provider,{value:n},r):f(r,n)}const V={CollectionRoot({collection:e,renderDropIndicator:t}){return H(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return H(e,t,n)}};function H(t,n,r){return O({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,U(t,n,r))}})}function U(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 W=n(V);function G(e){return o(()=>e==null?null:new Set([e]),[e])}const K=n(null);function q(t){let n=s({});return e.createElement(K.Provider,{value:n},t.children)}const J=n(null),Y=n(null),X=r(function(t,n){return a(Y)?e.createElement(Z,{props:t,forwardedRef:n}):e.createElement(z,t)});function Z({props:t,forwardedRef:n}){let r=a(Y),{CollectionRoot:i}=a(W),{orientation:o=`horizontal`,keyboardActivation:s=`automatic`}=_(J),l=d(n),{tabListProps:u}=m({...t,orientation:o,keyboardActivation:s},r,l),f=g({...t,children:null,defaultClassName:`react-aria-TabList`,values:{orientation:o,state:r}}),h=c(t,{global:!0});return delete h.id,e.createElement(b.div,{...p(h,f,u),ref:l,"data-orientation":o||void 0},e.createElement(q,null,e.createElement(i,{collection:r.collection,persistedKeys:G(r.selectionManager.focusedKey)})))}var Q=class extends x{};Q.type=`item`;export{X as TabList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{cloneElement as t,createContext as n,forwardRef as r,useContext as i,useMemo as a,useRef as o}from"react";import{filterDOMProps as s,mergeRefs as c,useLayoutEffect as l,useObjectRef as u}from"@react-aria/utils";import"@react-aria/interactions";import{createPortal as d}from"react-dom";import"react-aria";import"react-stately";function f(t,n,r){let{render:i,...s}=n,u=o(null),d=a(()=>c(r,u),[r,u]);l(()=>{},[t,i]);let f={...s,ref:d};return i?i(f,void 0):e.createElement(t,f)}const p={},m=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=p[t];return n||(n=r(f.bind(null,t)),p[t]=n),n}});
|
|
1
|
+
import e,{cloneElement as t,createContext as n,forwardRef as r,useContext as i,useMemo as a,useRef as o}from"react";import{filterDOMProps as s,mergeRefs as c,useLayoutEffect as l,useObjectRef as u}from"@react-aria/utils";import"@react-aria/interactions";import{createPortal as d}from"react-dom";import"react-aria";import"react-stately";function f(t,n,r){let{render:i,...s}=n,u=o(null),d=a(()=>c(r,u),[r,u]);l(()=>{},[t,i]);let f={...s,ref:d};return i?i(f,void 0):e.createElement(t,f)}const p={},m=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=p[t];return n||(n=r(f.bind(null,t)),p[t]=n),n}});var h=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}},g=class extends h{filter(e,t,n){let[r,i]=x(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},_=class extends h{};_.type=`header`;var v=class extends h{};v.type=`loader`;var y=class extends g{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};y.type=`item`;var b=class extends g{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};b.type=`section`;function x(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 S(e){let{children:n,items:r,idScope:i,addIdAndValue:o,dependencies:s=[]}=e,c=a(()=>new WeakMap,s);return a(()=>{if(r&&typeof n==`function`){let e=[];for(let a of r){let r=c.get(a);if(!r){r=n(a);let e=r.props.id??a.key??a.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,o?{key:e,id:e,value:a}:{key:e}),c.set(a,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,c,i,o])}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 C=n(!1);function w(e){let t=(t,n)=>i(C)?null:e(t,n);return t.displayName=e.displayName||e.name,r(t)}String(Math.round(Math.random()*1e10));const T=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function E(){return!1}function D(){return!0}function O(e){return()=>{}}function k(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(O,E,D):i(T)}const A=n(!1),j=n(null);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const M=n(null);function N(e){return S({...e,addIdAndValue:!0})}const P=n(null);function F(t){let n=i(P),r=(n?.dependencies||[]).concat(t.dependencies),o=t.idScope??n?.idScope,s=N({...t,idScope:o,dependencies:r});return i(j)&&(s=e.createElement(I,null,s)),n=a(()=>({dependencies:r,idScope:o}),[o,...r]),e.createElement(P.Provider,{value:n},s)}function I({children:t}){let n=i(j),r=a(()=>e.createElement(j.Provider,{value:null},e.createElement(A.Provider,{value:!0},t)),[t]);return k()?e.createElement(M.Provider,{value:n},r):d(r,n)}const L=n(null);var R=class extends h{};R.type=`item`;const z=w(function(t,n){let r=i(L),a=u(n),c=o(r.selectedKey),d=o(null),f=o(null);l(()=>{let e=a.current;if(e){if(f.current??=/width|height|all/.test(window.getComputedStyle(e).transition),f.current&&c.current!=null&&c.current!==r.selectedKey){e.style.setProperty(`--tab-panel-width`,`auto`),e.style.setProperty(`--tab-panel-height`,`auto`);let{width:t,height:n}=e.getBoundingClientRect();d.current&&(d.current.width!==t||d.current.height!==n)&&(e.style.setProperty(`--tab-panel-width`,d.current.width+`px`),e.style.setProperty(`--tab-panel-height`,d.current.height+`px`),window.getComputedStyle(e).height,e.style.setProperty(`--tab-panel-width`,t+`px`),e.style.setProperty(`--tab-panel-height`,n+`px`),Promise.all(e.getAnimations().map(e=>e.finished)).then(()=>{e.style.setProperty(`--tab-panel-width`,`auto`),e.style.setProperty(`--tab-panel-height`,`auto`)}).catch(()=>{}))}c.current=r.selectedKey}},[a,r.selectedKey]),r.selectedKey!=null&&r.selectedKey!==c.current&&a.current&&f.current&&(d.current=a.current.getBoundingClientRect());let p=s(t,{labelable:!0,global:!0});return delete p.id,e.createElement(m.div,{render:t.render,...p,ref:a,style:t.style,className:t.className||`react-aria-TabPanels`},e.createElement(F,t))});export{z as TabPanels};
|