@povio/ui 3.4.0-rc.32 → 3.4.0-rc.34
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/{BottomSheet-Bf5YauUF.js → BottomSheet-CVIgVXNP.js} +2 -2
- package/dist/{Breadcrumbs-D8ngBc93.js → Breadcrumbs-BypydWR6.js} +2 -2
- package/dist/{Calendar-D2IPtih0.js → Calendar-CJscjq0V.js} +4 -4
- package/dist/{DatePicker-C5inJMib.js → DatePicker-DIad7xyY.js} +4 -4
- package/dist/{DatePickerInput-CtkeReVQ.js → DatePickerInput-g8VFnlw8.js} +1 -1
- package/dist/{DateRangePicker-BcYoPnDA.js → DateRangePicker-0vELBNcS.js} +3 -3
- package/dist/{DateTimePicker-CocJ2QGc.js → DateTimePicker-ChVdA0tD.js} +4 -4
- package/dist/{Dialog-CYPAuk4r.js → Dialog-B5J6LRRw.js} +2 -71
- package/dist/{Form-U_gaYtIz.d.ts → Form-C91OtvWn.d.ts} +1 -1
- package/dist/{InputItem-msRZqamc.js → InputItem-DRjyA0oH.js} +5 -5
- package/dist/{Inputs-D0nApWoP.d.ts → Inputs-CalpKD9s.d.ts} +1 -1
- package/dist/{Inputs-COn_OHA2.js → Inputs-Cmt2mxFU.js} +1 -1
- package/dist/{ListBox-CJbpH_Kh.js → ListBox-CIgWt1tg.js} +1 -1
- package/dist/{Menu-CXlFN-mb.js → Menu-BxbxSqMx.js} +2 -2
- package/dist/{MenuDesktop-CuQBZODp.js → MenuDesktop-Dv25P83N.js} +1 -1
- package/dist/{Modal-BbiLj4ai.js → Modal-CEJ2QkF0.js} +1 -1
- package/dist/{Modal-Cerq7LEf.js → Modal-r0ucQNPK.js} +2 -2
- package/dist/{Select-CO2ppqqL.js → Select-B7vfRfll.js} +1 -1
- package/dist/{TextEditor-CDv7Tf57.js → TextEditor-DScsU-U2.js} +3 -3
- package/dist/{TimePicker-BmTVdF1E.js → TimePicker-DC_MYdqe.js} +2 -2
- package/dist/components/action-modal.js +1 -1
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/bottom-sheet.js +2 -2
- package/dist/components/breadcrumb/react-aria.js +1 -11
- package/dist/components/breadcrumbs/react-aria.js +1 -11
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/cell/react-aria.js +1 -11
- package/dist/components/collection/react-aria.js +1 -11
- package/dist/components/color-swatch-picker/react-aria.js +1 -11
- package/dist/components/color-swatch-picker-item/react-aria.js +1 -11
- package/dist/components/column/react-aria.js +1 -11
- package/dist/components/column-resizer/react-aria.js +1 -11
- package/dist/components/combo-box/react-aria.js +1 -11
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-range-picker.js +1 -1
- package/dist/components/date-time-picker.js +1 -1
- package/dist/components/drawer.js +2 -2
- package/dist/components/grid-list/react-aria.js +1 -11
- package/dist/components/grid-list-header/react-aria.js +1 -11
- package/dist/components/grid-list-item/react-aria.js +1 -11
- package/dist/components/grid-list-load-more-item/react-aria.js +1 -11
- package/dist/components/grid-list-section/react-aria.js +1 -11
- package/dist/components/header/react-aria.js +1 -11
- package/dist/components/list-box/react-aria.js +1 -11
- package/dist/components/list-box-item/react-aria.js +1 -11
- package/dist/components/list-box-load-more-item/react-aria.js +1 -11
- package/dist/components/list-box-section/react-aria.js +1 -11
- package/dist/components/menu/react-aria.js +1 -11
- package/dist/components/menu-item/react-aria.js +1 -11
- package/dist/components/menu-section/react-aria.js +1 -11
- package/dist/components/menu.js +2 -2
- package/dist/components/modal.js +1 -1
- package/dist/components/query-autocomplete.d.ts +1 -1
- package/dist/components/query-autocomplete.js +3 -3
- package/dist/components/query-select.js +1 -1
- package/dist/components/resizable-table-container/react-aria.js +1 -11
- package/dist/components/responsive-popover.js +1 -1
- package/dist/components/row/react-aria.js +1 -11
- package/dist/components/section/react-aria.js +1 -11
- package/dist/components/select/react-aria.js +1 -11
- package/dist/components/select.js +1 -1
- package/dist/components/separator/react-aria.js +1 -11
- package/dist/components/split-button.js +1 -1
- package/dist/components/submenu-trigger/react-aria.js +1 -11
- package/dist/components/tab/react-aria.js +1 -11
- package/dist/components/tab-list/react-aria.js +1 -11
- package/dist/components/tab-panels/react-aria.js +1 -11
- package/dist/components/table/react-aria.js +1 -11
- package/dist/components/table-body/react-aria.js +1 -11
- package/dist/components/table-header/react-aria.js +1 -11
- package/dist/components/table-load-more-item/react-aria.js +1 -11
- package/dist/components/tabs/react-aria.js +1 -11
- package/dist/components/tag/react-aria.js +1 -11
- package/dist/components/tag-group/react-aria.js +1 -11
- package/dist/components/tag-list/react-aria.js +1 -11
- package/dist/components/time-picker.js +1 -1
- package/dist/components/tree/react-aria.js +1 -11
- package/dist/components/tree-item/react-aria.js +1 -11
- package/dist/components/tree-item-content/react-aria.js +1 -11
- package/dist/components/tree-load-more-item/react-aria.js +1 -11
- package/dist/{datePickerValue.utils-u6REHox2.js → datePickerValue.utils-n2HQDle8.js} +1 -1
- package/dist/{dynamicInputs-ByTvSdJe.d.ts → dynamicInputs-BasxVhHP.d.ts} +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +10 -10
- package/dist/{logger-BPhG2izn.js → logger-DpUn65wp.js} +23 -1
- package/dist/{query-autocomplete-CHtcx_ND.d.ts → query-autocomplete-E-PMmf1d.d.ts} +1 -1
- package/dist/{queryAutocomplete.types-DaTDttX5.d.ts → queryAutocomplete.types-BOH9QnRq.d.ts} +1 -0
- package/dist/rhf/date-picker.js +1 -1
- package/dist/rhf/date-range-picker.js +1 -1
- package/dist/rhf/date-time-picker.js +1 -1
- package/dist/rhf/inputs.d.ts +1 -1
- package/dist/rhf/query-autocomplete.d.ts +1 -1
- package/dist/rhf/select.js +1 -1
- package/dist/rhf/text-editor.js +1 -1
- package/dist/rhf/time-picker.js +1 -1
- package/dist/rhf.d.ts +2 -2
- package/dist/rhf.js +10 -10
- package/dist/{staticDateTimeSegments-qJUUAL8d.js → staticDateTimeSegments-B5Uuat4L.js} +2 -2
- package/dist/{staticSelect.utils-CRyAMXOL.js → staticSelect.utils-BqH-4vxg.js} +3 -3
- package/dist/tanstack/date-picker.js +1 -1
- package/dist/tanstack/date-range-picker.js +1 -1
- package/dist/tanstack/date-time-picker.js +1 -1
- package/dist/tanstack/form.d.ts +1 -1
- package/dist/tanstack/form.js +1 -1
- package/dist/tanstack/inputs.d.ts +2 -2
- package/dist/tanstack/inputs.js +1 -1
- package/dist/tanstack/select.js +1 -1
- package/dist/tanstack/table.js +1 -1
- package/dist/tanstack/text-editor.js +1 -1
- package/dist/tanstack/time-picker.js +1 -1
- package/dist/tanstack.d.ts +3 -3
- package/dist/tanstack.js +17 -17
- package/dist/text-editor.js +1 -1
- package/dist/{useFilter-Cz_G94ya.js → useFilter-BsjdRENO.js} +1 -1
- package/dist/{useFormAutosave-Cj75UzUP.js → useFormAutosave-C_SlCky9.js} +1 -1
- package/dist/{useTableColumnConfig-CXjUy_VP.js → useTableColumnConfig-BTsMxT8X.js} +2 -2
- package/dist/utils/logger.js +1 -1
- package/package.json +1 -1
- package/dist/rolldown-runtime-DUp30N8C.js +0 -28
|
@@ -1,11 +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}from"react";import{filterDOMProps as c,inertValue as l,mergeProps as u,mergeRefs as d,useLayoutEffect as f,useLoadMoreSentinel as p,useObjectRef as m,useResizeObserver as h}from"@react-aria/utils";import{FocusableContext as g}from"@react-aria/interactions";import"react-dom";import{HiddenSelect as _,mergeProps as v,useFocusRing as ee,useSelect as te}from"react-aria";import{useSelectState as ne}from"react-stately";var y=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),b=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});const x=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 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=m(a(()=>d(t,r),[t,r])),s=u(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(e=!0){let[t,n]=s(e),i=o(!1),a=r(e=>{i.current=!0,n(!!e)},[]);return f(()=>{i.current||n(!1)},[]),[a,t]}function E(e){let t=/^(data-.*)$/,n={};for(let r in e)t.test(r)||(n[r]=e[r]);return n}function D(t,n,r){let{render:i,...s}=n,c=o(null),l=a(()=>d(r,c),[r,c]);f(()=>{},[t,i]);let u={...s,ref:l};return i?i(u,void 0):e.createElement(t,u)}const O={},k=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=O[t];return r||(r=n(D.bind(null,t)),O[t]=r),r}});String(Math.round(Math.random()*1e10));const A=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function j(){return!1}function M(){return!0}function N(e){return()=>{}}function P(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(N,j,M):i(A)}var F=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},I=class extends F{filter(e,t,n){let[r,i]=B(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},L=class extends F{};L.type=`header`;var R=class extends F{};R.type=`loader`;var z=class extends I{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};z.type=`item`;var ie=class extends I{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};ie.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]=B(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 B(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 V=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}},H=class e extends V{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 V{get isConnected(){return!0}createElement(e){return new H(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 H&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof H?(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 U=t(!1);function W(t){if(i(U))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(U.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}
|
|
2
|
-
/**
|
|
3
|
-
* @license React
|
|
4
|
-
* use-sync-external-store-shim.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/
|
|
11
|
-
var G=y((e=>{var t=b(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),K=y(((e,t)=>{t.exports=G()}))();const se=t(!1),q=t(null);function ce(t){if(i(q))return t.content;let{collection:n,document:r}=fe(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(W,null,e.createElement(q.Provider,{value:r},t.content)),e.createElement(le,{render:t.children,collection:n}))}function le({collection:e,render:t}){return t(e)}function ue(e,t,n){let i=P(),a=o(i);a.current=i;let s=r(()=>a.current?n():t(),[t,n]);return(0,K.useSyncExternalStore)(e,s)}const de=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:ue;function fe(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:de(n,i,a),document:t}}const J=t(null);function pe(e){var t;return t=class extends F{},t.type=e,t}function me(t,n,a,o,s,c){typeof t==`string`&&(t=pe(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 he(t,r){let a=({node:e})=>r(e.props,e.props.ref,e),o=n((n,o)=>{let s=i(g);if(!i(se)){if(r.length>=3)throw Error(r.name+` cannot be rendered outside a collection.`);return r(n,o)}return me(t,n,o,`children`in n?n.children:null,null,t=>e.createElement(g.Provider,{value:s},e.createElement(a,{node:t})))});return o.displayName=r.name,o}const Y=t({}),X=t({}),Z=t({}),ge=t(null),_e=t(null),ve=t(null),Q=t(null);he(R,function(t,n,r){let s=i(Q),{isLoading:u,onLoadMore:d,scrollOffset:f,...m}=t,h=o(null),g=a(()=>({onLoadMore:d,collection:s?.collection,sentinelRef:h,scrollOffset:f}),[d,f,s?.collection]);p(g,h);let _=S({...m,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:l(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),u&&_.children&&e.createElement(k.div,{...v(c(t,{global:!0}),{tabIndex:-1}),..._,role:`option`,ref:n},_.children))});const ye=t(null),be=t(null),$=t(null),xe=t(null),Se=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(ce,{content:c},r=>e.createElement(we,{props:t,collection:r,selectRef:n}))}),Ce=[Y,X,Z];function we({props:t,selectRef:n,collection:i}){let{validationBehavior:l}=C(_e)||{},d=t.validationBehavior??l??`native`,f=ne({...t,collection:i,children:void 0,validationBehavior:d}),{isFocusVisible:p,focusProps:m}=ee({within:!0}),g=o(null),[v,y]=T(!t[`aria-label`]&&!t[`aria-labelledby`]),{labelProps:b,triggerProps:x,valueProps:w,menuProps:D,descriptionProps:O,errorMessageProps:A,hiddenSelectProps:j,...M}=te({...E(t),label:y,validationBehavior:d},f,g),[N,P]=s(null),F=r(()=>{g.current&&P(g.current.offsetWidth+`px`)},[g]);h({ref:g,onResize:F});let I=a(()=>({isOpen:f.isOpen,isFocused:f.isFocused,isFocusVisible:p,isDisabled:t.isDisabled||!1,isInvalid:M.isInvalid||!1,isRequired:t.isRequired||!1}),[f.isOpen,f.isFocused,p,t.isDisabled,M.isInvalid,t.isRequired]),L=S({...t,values:I,defaultClassName:`react-aria-Select`}),R=c(t,{global:!0});delete R.id;let z=o(null);return e.createElement(re,{values:[[$,t],[xe,f],[Te,w],[Y,{...b,ref:v,elementType:`span`}],[X,{...x,ref:g,isPressed:f.isOpen,autoFocus:t.autoFocus}],[be,f],[ye,{trigger:`Select`,triggerRef:g,scrollRef:z,placement:`bottom start`,style:{"--trigger-width":N},"aria-labelledby":D[`aria-labelledby`],clearContexts:Ce}],[ve,{...D,ref:z}],[Q,f],[Z,{slots:{description:O,errorMessage:A}}],[ge,M]]},e.createElement(k.div,{...u(R,L,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":M.isInvalid||void 0,"data-required":t.isRequired||void 0},L.children,e.createElement(_,{...j,autoComplete:t.autoComplete})))}const Te=t(null);export{Se 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 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,2 +1,2 @@
|
|
|
1
|
-
import { t as Select } from "../Select-
|
|
1
|
+
import { t as Select } from "../Select-B7vfRfll.js";
|
|
2
2
|
export { Select };
|
|
@@ -1,11 +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";
|
|
2
|
-
/**
|
|
3
|
-
* @license React
|
|
4
|
-
* use-sync-external-store-shim.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/
|
|
11
|
-
var k=m((e=>{var t=h(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore}));m(((e,t)=>{t.exports=k()}))();const A=t(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const j=t(null);function M(e){var t;return t=class extends S{},t.type=e,t}function N(t,n,a,o,s,c){typeof t==`string`&&(t=M(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 P(t,r){let a=({node:e})=>r(e.props,e.props.ref,e),o=n((n,o)=>{let s=i(f);if(!i(A)){if(r.length>=3)throw Error(r.name+` cannot be rendered outside a collection.`);return r(n,o)}return N(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 F=t({});var I=class extends S{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}};I.type=`separator`;const L=P(I,function(t,n){[t,n]=v(t,n,F);let{elementType:r,orientation:i,style:a,className:o,slot:l,...u}=t,d=r||`hr`;d===`hr`&&i===`vertical`&&(d=`div`);let f=x[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{L as Separator};
|
|
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}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;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]}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,11 +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";
|
|
2
|
-
/**
|
|
3
|
-
* @license React
|
|
4
|
-
* use-sync-external-store-shim.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/
|
|
11
|
-
var D=m((e=>{var t=h(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore}));m(((e,t)=>{t.exports=D()}))(),typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const O=n(null);function k(e){var t;return t=class extends y{},t.type=e,t}function A(t,n,r,i,s,c){typeof t==`string`&&(t=k(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(O);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(O.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function j(t,n,i=M){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>A(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function M(e){return E({...e,addIdAndValue:!0})}const N={CollectionRoot({collection:e,renderDropIndicator:t}){return P(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return P(e,t,n)}};function P(t,n,r){return E({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,F(t,n,r))}})}function F(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const I=n(N),L=n(null),R=n(null),z=n(null),B=n(null),V=n(null);var H=class extends y{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}};H.type=`submenutrigger`;const U=j(H,(t,n,r)=>{let{CollectionBranch:i}=o(I),a=o(z),s=o(B),l=p({triggerKey:r.key},s),u=c(null),m=d(n),{parentMenuRef:h,shouldUseVirtualFocus:_}=o(V),{submenuTriggerProps:v,submenuProps:y,popoverProps:b}=f({parentMenuRef:h,submenuRef:u,delay:t.delay,shouldUseVirtualFocus:_},l,m);return e.createElement(g,{values:[[W,{...v,onAction:void 0,ref:m}],[R,{ref:u,...y}],[G,l],[L,{trigger:`SubmenuTrigger`,triggerRef:m,placement:`end top`,"aria-labelledby":y[`aria-labelledby`],...b}]]},e.createElement(i,{collection:a.collection,parent:r}),t.children[1])},e=>e.children[0]),W=n(null),G=n(null);export{U as SubmenuTrigger};
|
|
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}}),String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;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])}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,11 +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";
|
|
2
|
-
/**
|
|
3
|
-
* @license React
|
|
4
|
-
* use-sync-external-store-shim.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/
|
|
11
|
-
var k=g((e=>{var t=_(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore}));g(((e,t)=>{t.exports=k()}))();const A=t(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const j=t(null);function M(e){var t;return t=class extends S{},t.type=e,t}function N(t,n,a,o,s,c){typeof t==`string`&&(t=M(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 P(t,r){let a=({node:e})=>r(e.props,e.props.ref,e),o=n((n,o)=>{let s=i(d);if(!i(A)){if(r.length>=3)throw Error(r.name+` cannot be rendered outside a collection.`);return r(n,o)}return N(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 F=t({isSelected:!1}),I=t(null);var L=class extends S{};L.type=`item`;const R=P(L,(t,n,r)=>{let a=i(I),o=u(n),{tabProps:c,isSelected:l,isDisabled:d,isPressed:g}=h({key:r.key,...t},a,o),{focusProps:_,isFocused:y,isFocusVisible:b}=p(),{hoverProps:S,isHovered:C}=m({isDisabled:d,onHoverStart:t.onHoverStart,onHoverEnd:t.onHoverEnd,onHoverChange:t.onHoverChange}),w=v({...t,id:void 0,children:r.rendered,defaultClassName:`react-aria-Tab`,values:{isSelected:l,isDisabled:d,isFocused:y,isFocusVisible:b,isPressed:g,isHovered:C}}),T=r.props.href?x.a:x.div,E=s(t,{global:!0});return delete E.id,delete E.onClick,e.createElement(T,{...f(E,w,c,_,S),ref:o,"data-selected":l||void 0,"data-disabled":d||void 0,"data-focused":y||void 0,"data-focus-visible":b||void 0,"data-pressed":g||void 0,"data-hovered":C||void 0},e.createElement(F.Provider,{value:{isSelected:l}},w.children))});export{R as Tab};
|
|
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}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;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]}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,11 +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";
|
|
2
|
-
/**
|
|
3
|
-
* @license React
|
|
4
|
-
* use-sync-external-store-shim.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/
|
|
11
|
-
var I=h((e=>{var t=g(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore}));h(((e,t)=>{t.exports=I()}))();const L=n(!1),R=n(null);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const ee=n(null);function z(e){return F({...e,addIdAndValue:!0})}const B=n(null);function V(t){let n=a(B),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,s=z({...t,idScope:i,dependencies:r});return a(R)&&(s=e.createElement(H,null,s)),n=o(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(B.Provider,{value:n},s)}function H({children:t}){let n=a(R),r=o(()=>e.createElement(R.Provider,{value:null},e.createElement(L.Provider,{value:!0},t)),[t]);return D()?e.createElement(ee.Provider,{value:n},r):f(r,n)}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 F({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);function q(e){return o(()=>e==null?null:new Set([e]),[e])}const J=n(null);function Y(t){let n=s({});return e.createElement(J.Provider,{value:n},t.children)}const X=n(null),Z=n(null),Q=r(function(t,n){return a(Z)?e.createElement($,{props:t,forwardedRef:n}):e.createElement(V,t)});function $({props:t,forwardedRef:n}){let r=a(Z),{CollectionRoot:i}=a(K),{orientation:o=`horizontal`,keyboardActivation:s=`automatic`}=y(X),l=d(n),{tabListProps:u}=m({...t,orientation:o,keyboardActivation:s},r,l),f=v({...t,children:null,defaultClassName:`react-aria-TabList`,values:{orientation:o,state:r}}),h=c(t,{global:!0});return delete h.id,e.createElement(S.div,{...p(h,f,u),ref:l,"data-orientation":o||void 0},e.createElement(Y,null,e.createElement(i,{collection:r.collection,persistedKeys:q(r.selectionManager.focusedKey)})))}var te=class extends O{};te.type=`item`;export{Q as TabList};
|
|
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}});String(Math.round(Math.random()*1e10));const x=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function S(){return!1}function C(){return!0}function w(e){return()=>{}}function T(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(w,S,C):a(x)}var E=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}},D=class extends E{filter(e,t,n){let[r,i]=M(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},O=class extends E{};O.type=`header`;var k=class extends E{};k.type=`loader`;var A=class extends D{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};A.type=`item`;var j=class extends D{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}};j.type=`section`;function M(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 N(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])}const P=n(!1),F=n(null);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const I=n(null);function L(e){return N({...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 T()?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 N({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 E{};Q.type=`item`;export{X as TabList};
|
|
@@ -1,11 +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";
|
|
2
|
-
/**
|
|
3
|
-
* @license React
|
|
4
|
-
* use-sync-external-store-shim.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/
|
|
11
|
-
var M=f((e=>{var t=p(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore}));f(((e,t)=>{t.exports=M()}))();const N=n(!1),P=n(null);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const F=n(null);function I(e){return k({...e,addIdAndValue:!0})}const L=n(null);function R(t){let n=i(L),r=(n?.dependencies||[]).concat(t.dependencies),o=t.idScope??n?.idScope,s=I({...t,idScope:o,dependencies:r});return i(P)&&(s=e.createElement(z,null,s)),n=a(()=>({dependencies:r,idScope:o}),[o,...r]),e.createElement(L.Provider,{value:n},s)}function z({children:t}){let n=i(P),r=a(()=>e.createElement(P.Provider,{value:null},e.createElement(N.Provider,{value:!0},t)),[t]);return x()?e.createElement(F.Provider,{value:n},r):d(r,n)}const B=n(null);var V=class extends S{};V.type=`item`;const H=j(function(t,n){let r=i(B),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(g.div,{render:t.render,...p,ref:a,style:t.style,className:t.className||`react-aria-TabPanels`},e.createElement(R,t))});export{H as TabPanels};
|
|
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}});String(Math.round(Math.random()*1e10));const h=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function g(){return!1}function _(){return!0}function v(e){return()=>{}}function y(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(v,g,_):i(h)}var b=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},x=class extends b{filter(e,t,n){let[r,i]=E(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},S=class extends b{};S.type=`header`;var C=class extends b{};C.type=`loader`;var w=class extends x{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};w.type=`item`;var T=class extends x{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};T.type=`section`;function E(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function D(e){let{children:n,items:r,idScope:i,addIdAndValue: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 O=n(!1);function k(e){let t=(t,n)=>i(O)?null:e(t,n);return t.displayName=e.displayName||e.name,r(t)}const A=n(!1),j=n(null);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const M=n(null);function N(e){return D({...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 y()?e.createElement(M.Provider,{value:n},r):d(r,n)}const L=n(null);var R=class extends b{};R.type=`item`;const z=k(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};
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useRef as l,useState as u}from"react";import{filterDOMProps as d,inertValue as ee,mergeProps as f,mergeRefs as p,useLayoutEffect as m,useLoadMoreSentinel as te,useObjectRef as h}from"@react-aria/utils";import{FocusableContext as g}from"@react-aria/interactions";import{createPortal as _}from"react-dom";import{FocusScope as ne,ListKeyboardDelegate as v,mergeProps as y,useFocusRing as b,useTable as re,useVisuallyHidden as x}from"react-aria";import{UNSTABLE_useFilteredTableState as ie,useMultipleSelectionState as S,useTableState as ae}from"react-stately";var C=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),w=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});n(null),n(null),n(null),n(null),n(null),n({});const oe=n(null),se=n(null),T=Symbol(`default`);function ce({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function E(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:l}=e;return c(()=>{let e,c,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,c=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:c||o?{...o,...c}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,s):void 0}},[t,n,r,i,a,o,s,l])}function D(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||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 O(e,t,n){let{ref:r,...i}=D(n,e.slot)||{},a=h(c(()=>p(t,r),[t,r])),o=f(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(o.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[o,a]}function k(t,n,r){let{render:i,...a}=n,o=l(null),s=c(()=>p(r,o),[r,o]);m(()=>{},[t,i]);let u={...a,ref:s};return i?i(u,void 0):e.createElement(t,u)}const A={},j=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=A[t];return n||(n=r(k.bind(null,t)),A[t]=n),n}});String(Math.round(Math.random()*1e10));const M=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function N(){return!1}function P(){return!0}function F(e){return()=>{}}function I(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(F,N,P):o(M)}var L=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}},R=class extends L{filter(e,t,n){let[r,i]=U(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},z=class extends L{};z.type=`header`;var B=class extends L{};B.type=`loader`;var le=class extends R{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};le.type=`item`;var V=class extends R{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};V.type=`section`;var H=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=U(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function U(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}var W=class{*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild??=e,this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,t){if(t==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=t,e.previousSibling=t.previousSibling,e.index=t.index-1,this.firstChild===t?this.firstChild=e:t.previousSibling&&(t.previousSibling.nextSibling=e),t.previousSibling=e,e.parentNode=t.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}},G=class e extends W{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof e?this.parentNode.level+ +(this.node?.type===`item`):0}getMutableNode(){return this.node==null?null:(this.isMutated||=(this.node=this.node.clone(),!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){let t=this.nextVisibleSibling,n=this.getMutableNode();if(n!=null&&(n.index=this.index,n.level=this.level,n.parentKey=this.parentNode instanceof e?this.parentNode.node?.key??null:null,n.prevKey=this.previousVisibleSibling?.node?.key??null,n.nextKey=t?.node?.key??null,n.hasChildNodes=!!this.firstChild,n.firstChildKey=this.firstVisibleChild?.node?.key??null,n.lastChildKey=this.lastVisibleChild?.node?.key??null,(n.colSpan!=null||n.colIndex!=null)&&t)){let e=(n.colIndex??n.index)+(n.colSpan??1);if(t.node!=null&&e!==t.node.colIndex){let n=t.getMutableNode();n.colIndex=e}}}setProps(e,t,n,r,i){let a,{value:o,textValue:s,id:c,...l}=e;if(this.node==null?(a=new n(c??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),l.ref=t,a.props=l,a.rendered=r,a.render=i,a.value=o,e[`aria-label`]&&(a[`aria-label`]=e[`aria-label`]),a.textValue=s||(typeof l.children==`string`?l.children:``)||e[`aria-label`]||``,c!=null&&c!==a.key)throw Error(`Cannot change the id of an item`);l.colSpan!=null&&(a.colSpan=l.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?`none`:``},set display(t){let n=t===`none`;if(e.isHidden!==n){(e.parentNode?.firstVisibleChild===e||e.parentNode?.lastVisibleChild===e)&&e.ownerDocument.markDirty(e.parentNode);let t=e.previousVisibleSibling,r=e.nextVisibleSibling;t&&e.ownerDocument.markDirty(t),r&&e.ownerDocument.markDirty(r),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,t){super(t),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},ue=class extends W{get isConnected(){return!0}createElement(e){return new G(e,this)}getMutableCollection(){return this.nextCollection||=this.collection.clone(),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let t of e)this.addNode(t);t.addNode(e.node)}removeNode(e){for(let t of e)this.removeNode(t);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let e of this.dirtyNodes)e instanceof G&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof G?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}};function K(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,s=c(()=>new WeakMap,o);return c(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=s.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),s.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,s,i,a])}if(typeof HTMLTemplateElement<`u`){let e=Object.getOwnPropertyDescriptor(Node.prototype,`firstChild`).get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}const q=n(!1);function de(t){if(o(q))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(q.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}
|
|
2
|
-
/**
|
|
3
|
-
* @license React
|
|
4
|
-
* use-sync-external-store-shim.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/
|
|
11
|
-
var fe=C((e=>{var t=w(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),pe=C(((e,t)=>{t.exports=fe()}))();const J=n(!1),Y=n(null);function me(t){if(o(Y))return t.content;let{collection:n,document:r}=ve(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(de,null,e.createElement(Y.Provider,{value:r},t.content)),e.createElement(he,{render:t.children,collection:n}))}function he({collection:e,render:t}){return t(e)}function ge(e,t,n){let r=I(),i=l(r);i.current=r;let o=a(()=>i.current?n():t(),[t,n]);return(0,pe.useSyncExternalStore)(e,o)}const _e=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:ge;function ve(e){let[t]=u(()=>new ue(e?.()||new H)),n=a(e=>t.subscribe(e),[t]),r=a(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),i=a(()=>(t.isSSR=!0,t.getCollection()),[t]);return{collection:_e(n,r,i),document:t}}const X=n(null);function ye(e){var t;return t=class extends L{},t.type=e,t}function be(t,n,r,i,s,c){typeof t==`string`&&(t=ye(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(X);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(X.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function xe(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(g);if(!o(J)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return be(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 Se(e){return K({...e,addIdAndValue:!0})}const Z=n(null);function Ce(t){let n=o(Z),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=Se({...t,idScope:i,dependencies:r});return o(Y)&&(a=e.createElement(we,null,a)),n=c(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(Z.Provider,{value:n},a)}function we({children:t}){let n=o(Y),r=c(()=>e.createElement(Y.Provider,{value:null},e.createElement(J.Provider,{value:!0},t)),[t]);return I()?e.createElement(X.Provider,{value:n},r):_(r,n)}const Te={CollectionRoot({collection:e,renderDropIndicator:t}){return Ee(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return Ee(e,t,n)}};function Ee(t,n,r){return K({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,De(t,n,r))}})}function De(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const Q=n(Te),Oe=n({}),ke=n(null);function Ae(e,t,n){let r=e.focusedKey,i=null;if(t!=null&&t.isVirtualDragging?.call(t)&&n?.target?.type===`item`&&(i=n.target.key,n.target.dropPosition===`after`)){let e=n.collection.getKeyAfter(i),t=null;if(e!=null){let r=n.collection.getItem(i)?.level??0;for(;e;){let i=n.collection.getItem(e);if(!i)break;if(i.type!==`item`){e=n.collection.getKeyAfter(e);continue}if((i.level??0)<=r)break;t=e,e=n.collection.getKeyAfter(e)}}i=e??t??i}return c(()=>new Set([r,i].filter(e=>e!=null)),[r,i])}const je=n(null);function Me(t){let n=l({});return e.createElement(je.Provider,{value:n},t.children)}const Ne=`row-header-column-`+Math.random().toString(36).slice(2);let Pe=`row-header-column-`+Math.random().toString(36).slice(2);for(;Ne===Pe;)Pe=`row-header-column-`+Math.random().toString(36).slice(2);function Fe(e,t){if(t.length===0)return[];let n=[],r=new Map;for(let a of t){let t=a.parentKey,o=[a];for(;t;){let n=e.get(t);if(!n)break;if(r.has(n)){var i;(i=n).colSpan??(i.colSpan=0),n.colSpan++,n.colspan=n.colSpan;let{column:e,index:t}=r.get(n);if(t>o.length)break;for(let n=t;n<o.length;n++)e.splice(n,0,null);for(let t=o.length;t<e.length;t++)e[t]&&r.has(e[t])&&(r.get(e[t]).index=t)}else n.colSpan=1,n.colspan=1,o.push(n),r.set(n,{column:o,index:o.length-1});t=n.parentKey}n.push(o),a.index=n.length-1}let a=Math.max(...n.map(e=>e.length)),o=Array(a).fill(0).map(()=>[]),s=0;for(let e of n){let t=a-1;for(let n of e){if(n){let e=o[t],r=e.reduce((e,t)=>e+(t.colSpan??1),0);if(r<s){let i={type:`placeholder`,key:`placeholder-`+n.key,colspan:s-r,colSpan:s-r,index:r,value:null,rendered:null,level:t,hasChildNodes:!1,childNodes:[],textValue:``};e.length>0&&(e[e.length-1].nextKey=i.key,i.prevKey=e[e.length-1].key),e.push(i)}e.length>0&&(e[e.length-1].nextKey=n.key,n.prevKey=e[e.length-1].key),n.level=t,n.colIndex=s,e.push(n)}t--}s++}let c=0;for(let e of o){let n=e.reduce((e,t)=>e+(t.colSpan??1),0);if(n<t.length){let r={type:`placeholder`,key:`placeholder-`+e[e.length-1].key,colSpan:t.length-n,colspan:t.length-n,index:n,value:null,rendered:null,level:c,hasChildNodes:!1,childNodes:[],textValue:``,prevKey:e[e.length-1].key};e.push(r)}c++}return o.map((e,t)=>({type:`headerrow`,key:`headerrow-`+t,index:t,value:null,rendered:null,level:0,hasChildNodes:!0,childNodes:e,textValue:``}))}var Ie=class extends H{addNode(e){super.addNode(e),this.columnsDirty||=e.type===`column`,e.type===`tableheader`&&(this.head=e),e.type===`tablebody`&&(this.body=e)}commit(e,t,n=!1){this.updateColumns(n),this.rows=[];for(let e of this.getChildren(this.body.key)){let t=e.lastChildKey;if(t!=null){let e=this.getItem(t),r=(e.colIndex??e.index)+(e.colSpan??1);if(r!==this.columns.length&&!n)throw Error(`Cell count must match column count. Found ${r} cells and ${this.columns.length} columns.`)}this.rows.push(e)}super.commit(e,t,n)}updateColumns(e){if(!this.columnsDirty)return;this.rowHeaderColumnKeys=new Set,this.columns=[];let t=new Map,n=e=>{e.type===`column`&&(t.set(e.key,e),e.hasChildNodes||(e.index=this.columns.length,this.columns.push(e),e.props.isRowHeader&&this.rowHeaderColumnKeys.add(e.key)));for(let t of this.getChildren(e.key))n(t)};for(let e of this.getChildren(this.head.key))n(e);if(this.headerRows=Fe(t,this.columns),this.columnsDirty=!1,this.rowHeaderColumnKeys.size===0&&this.columns.length>0&&!e)throw Error(`A table must have at least one Column with the isRowHeader prop set to true`)}get columnCount(){return this.columns.length}*[Symbol.iterator](){this.head.key!==-1&&(yield this.head,yield this.body)}getFirstKey(){return this.body.firstChildKey}getLastKey(){return this.body.lastChildKey}getKeyAfter(e){let t=this.getItem(e);return t?.type===`column`?t.nextKey??null:super.getKeyAfter(e)}getKeyBefore(e){let t=this.getItem(e);if(t?.type===`column`)return t.prevKey??null;let n=super.getKeyBefore(e);return n!=null&&this.getItem(n)?.type===`tablebody`?null:n}getChildren(e){if(!this.getItem(e)){for(let t of this.headerRows)if(t.key===e)return t.childNodes}return super.getChildren(e)}clone(){let e=super.clone();return e.headerRows=this.headerRows,e.columns=this.columns,e.rowHeaderColumnKeys=this.rowHeaderColumnKeys,e.head=this.head,e.body=this.body,e}getTextValue(e){let t=this.getItem(e);if(!t)return``;if(t.textValue)return t.textValue;let n=this.rowHeaderColumnKeys,r=[];for(let t of this.getChildren(e)){let e=this.columns[t.index];if(n.has(e.key)&&t.textValue&&r.push(t.textValue),r.length===n.size)break}return r.join(` `)}constructor(...e){super(...e),this.headerRows=[],this.columns=[],this.rows=[],this.rowHeaderColumnKeys=new Set,this.head=new We(-1),this.body=new Ke(-2),this.columnsDirty=!0}};const Le=n(null),Re=n(null),$=n(null),ze=n(null),Be=r(function(t,n){[t,n]=O(t,n,Re);let r=S(t),{selectionBehavior:i,selectionMode:a,disallowEmptySelection:o}=r,s=!!t.dragAndDropHooks?.useDraggableCollectionState,l=c(()=>({selectionBehavior:a===`none`?null:i,selectionMode:a,disallowEmptySelection:o,allowsDragging:s}),[i,a,o,s]),u=e.createElement(Ue.Provider,{value:l},e.createElement(Ce,t));return e.createElement(me,{content:u,createCollection:()=>new Ie},i=>e.createElement(He,{props:t,forwardedRef:n,selectionState:r,collection:i}))});let Ve=r(function(t,n){let{isVirtualized:r}=o(Q);return r?e.createElement(j.div,{...t,ref:n}):e.createElement(j.table,{...t,ref:n})});function He({props:t,forwardedRef:n,selectionState:r,collection:i}){[t,n]=O(t,n,oe);let{shouldUseVirtualFocus:a,disallowTypeAhead:u,filter:ee,...f}=t,m=o(Le);n=h(c(()=>p(n,m?.tableRef),[n,m?.tableRef]));let te=ae({...f,collection:i,children:void 0,UNSAFE_selectionState:r}),g=ie(te,ee),{isVirtualized:_,layoutDelegate:x,dropTargetDelegate:S,CollectionRoot:C}=o(Q),{dragAndDropHooks:w}=t,{gridProps:T}=re({...f,layoutDelegate:x,isVirtualized:_},g,n),D=g.selectionManager,k=!!w?.useDraggableCollectionState,A=!!w?.useDroppableCollectionState;l(k),l(A),s(()=>{},[k,A]);let j,M,N,P=!1,F=null,I=l(null);if(k&&w){j=w.useDraggableCollectionState({collection:g.collection,selectionManager:D,preview:w.renderDragPreview?I:void 0}),w.useDraggableCollection({},j,n);let t=w.DragPreview;F=w.renderDragPreview?e.createElement(t,{ref:I},w.renderDragPreview):null}if(A&&w){M=w.useDroppableCollectionState({collection:g.collection,selectionManager:D});let e=new v({collection:g.collection,disabledKeys:D.disabledKeys,disabledBehavior:D.disabledBehavior,ref:n,layoutDelegate:x}),t=w.dropTargetDelegate||S||new w.ListDropTargetDelegate(i.rows,n);N=w.useDroppableCollection({keyboardDelegate:e,dropTargetDelegate:t},M,n),P=M.isDropTarget({type:`root`})}let{focusProps:L,isFocused:R,isFocusVisible:z}=b(),B=E({...t,children:void 0,defaultClassName:`react-aria-Table`,values:{isDropTarget:P,isFocused:R,isFocusVisible:z,state:g}}),le=!!(k&&!j?.isDisabled),V=B.style,H=null;m&&(H=m.useTableColumnResizeState({tableWidth:m.tableWidth},g),_||(V={...V,tableLayout:`fixed`,width:`fit-content`}));let U=d(t,{global:!0});return e.createElement(ce,{values:[[$,g],[ze,H],[Oe,{dragAndDropHooks:w,dragState:j,dropState:M}],[ke,{render:Ze}],[oe,null],[se,null]]},e.createElement(ne,null,e.createElement(Ve,{...y(U,B,T,L,N?.collectionProps),style:V,ref:n,slot:t.slot||void 0,onScroll:t.onScroll,"data-allows-dragging":le||void 0,"data-drop-target":P||void 0,"data-focused":R||void 0,"data-focus-visible":z||void 0},e.createElement(Me,null,e.createElement(C,{collection:g.collection,scrollRef:m?.scrollRef??n,persistedKeys:Ae(D,w,M)})))),F)}const Ue=n(null);var We=class extends L{};We.type=`tableheader`;var Ge=class extends L{};Ge.type=`column`;var Ke=class extends R{};Ke.type=`tablebody`;var qe=class extends L{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}};qe.type=`item`;let Je=r(function(t,n){let{isVirtualized:r}=o(Q);return r?e.createElement(j.div,{...t,ref:n}):e.createElement(j.tr,{...t,ref:n})});var Ye=class extends L{};Ye.type=`cell`;let Xe=r(function(t,n){let{isVirtualized:r}=o(Q);return r?e.createElement(j.div,{...t,ref:n}):e.createElement(j.td,{...t,ref:n})});function Ze(t,n){n=h(n);let{dragAndDropHooks:r,dropState:i}=o(Oe),a=l(null),{dropIndicatorProps:s,isHidden:c,isDropTarget:u}=r.useDropIndicator(t,i,a);return c?null:e.createElement(tt,{...t,dropIndicatorProps:s,isDropTarget:u,buttonRef:a,ref:n})}let Qe=r(function(t,n){let{isVirtualized:r}=o(Q);return r?e.createElement(j.div,{...t,ref:n}):e.createElement(j.tr,{...t,ref:n})}),$e=r(function(t,n){let{isVirtualized:r}=o(Q);return r?e.createElement(j.div,{...t,ref:n}):e.createElement(j.td,{...t,ref:n})});function et(t,n){let{dropIndicatorProps:r,isDropTarget:i,buttonRef:a,...s}=t,c=o($),{visuallyHiddenProps:l}=x(),u=E({...s,defaultClassName:`react-aria-DropIndicator`,values:{isDropTarget:i}});return e.createElement(Qe,{...d(t,{global:!0}),...u,role:`row`,ref:n,"data-drop-target":i||void 0},e.createElement($e,{role:`gridcell`,colSpan:c.collection.columnCount,style:{padding:0}},e.createElement(`div`,{...l,role:`button`,...r,ref:a}),u.children))}const tt=r(et);xe(B,function(t,n,r){let i=o($),{isVirtualized:a}=o(Q),{isLoading:s,onLoadMore:u,scrollOffset:f,...p}=t,m=i.collection.columns.length,h=l(null),g=c(()=>({onLoadMore:u,collection:i?.collection,sentinelRef:h,scrollOffset:f}),[u,f,i?.collection]);te(g,h);let _=E({...p,id:void 0,children:r.rendered,defaultClassName:`react-aria-TableLoadingIndicator`,values:void 0}),ne={},v={},b={};return a?(v[`aria-colspan`]=m,b={display:`contents`}):v.colSpan=m,e.createElement(e.Fragment,null,e.createElement(Je,{style:{height:0},inert:ee(!0)},e.createElement(Xe,{style:{padding:0,border:0}},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`relative`,height:1,width:1}}))),s&&_.children&&e.createElement(Je,{...y(d(t,{global:!0}),ne),..._,role:`row`,ref:n},e.createElement(Xe,{role:`rowheader`,...v,style:b},_.children)))});export{Be as Table};
|
|
1
|
+
import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useRef as l,useState as u,useSyncExternalStore as d}from"react";import{filterDOMProps as f,inertValue as p,mergeProps as m,mergeRefs as h,useLayoutEffect as g,useLoadMoreSentinel as _,useObjectRef as v}from"@react-aria/utils";import{FocusableContext as y}from"@react-aria/interactions";import{createPortal as b}from"react-dom";import{FocusScope as x,ListKeyboardDelegate as S,mergeProps as ee,useFocusRing as te,useTable as ne,useVisuallyHidden as C}from"react-aria";import{UNSTABLE_useFilteredTableState as re,useMultipleSelectionState as w,useTableState as ie}from"react-stately";n(null),n(null),n(null),n(null),n(null),n({});const T=n(null),ae=n(null),E=Symbol(`default`);function oe({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function D(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:l}=e;return c(()=>{let e,c,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,c=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:c||o?{...o,...c}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,s):void 0}},[t,n,r,i,a,o,s,l])}function se(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||E;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function O(e,t,n){let{ref:r,...i}=se(n,e.slot)||{},a=v(c(()=>h(t,r),[t,r])),o=m(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(o.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[o,a]}function k(t,n,r){let{render:i,...a}=n,o=l(null),s=c(()=>h(r,o),[r,o]);g(()=>{},[t,i]);let u={...a,ref:s};return i?i(u,void 0):e.createElement(t,u)}const A={},j=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=A[t];return n||(n=r(k.bind(null,t)),A[t]=n),n}});String(Math.round(Math.random()*1e10));const M=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function N(){return!1}function P(){return!0}function F(e){return()=>{}}function I(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(F,N,P):o(M)}var L=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}},R=class extends L{filter(e,t,n){let[r,i]=W(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},z=class extends L{};z.type=`header`;var B=class extends L{};B.type=`loader`;var V=class extends R{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};V.type=`item`;var H=class extends R{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}};H.type=`section`;var U=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]=W(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 W(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}var G=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}},K=class e extends G{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}},ce=class extends G{get isConnected(){return!0}createElement(e){return new K(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 K&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof K?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}};function q(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,s=c(()=>new WeakMap,o);return c(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=s.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),s.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,s,i,a])}if(typeof HTMLTemplateElement<`u`){let e=Object.getOwnPropertyDescriptor(Node.prototype,`firstChild`).get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}const J=n(!1);function le(t){if(o(J))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(J.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}const Y=n(!1),X=n(null);function ue(t){if(o(X))return t.content;let{collection:n,document:r}=me(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(le,null,e.createElement(X.Provider,{value:r},t.content)),e.createElement(de,{render:t.children,collection:n}))}function de({collection:e,render:t}){return t(e)}function fe(e,t,n){let r=I(),i=l(r);i.current=r;let o=a(()=>i.current?n():t(),[t,n]);return d(e,o)}const pe=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:fe;function me(e){let[t]=u(()=>new ce(e?.()||new U)),n=a(e=>t.subscribe(e),[t]),r=a(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),i=a(()=>(t.isSSR=!0,t.getCollection()),[t]);return{collection:pe(n,r,i),document:t}}const Z=n(null);function he(e){var t;return t=class extends L{},t.type=e,t}function ge(t,n,r,i,s,c){typeof t==`string`&&(t=he(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(Z);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(Z.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function _e(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(y);if(!o(Y)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return ge(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(y.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function ve(e){return q({...e,addIdAndValue:!0})}const ye=n(null);function be(t){let n=o(ye),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=ve({...t,idScope:i,dependencies:r});return o(X)&&(a=e.createElement(xe,null,a)),n=c(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(ye.Provider,{value:n},a)}function xe({children:t}){let n=o(X),r=c(()=>e.createElement(X.Provider,{value:null},e.createElement(Y.Provider,{value:!0},t)),[t]);return I()?e.createElement(Z.Provider,{value:n},r):b(r,n)}const Se={CollectionRoot({collection:e,renderDropIndicator:t}){return Ce(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return Ce(e,t,n)}};function Ce(t,n,r){return q({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,we(t,n,r))}})}function we(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const Q=n(Se),Te=n({}),Ee=n(null);function De(e,t,n){let r=e.focusedKey,i=null;if(t!=null&&t.isVirtualDragging?.call(t)&&n?.target?.type===`item`&&(i=n.target.key,n.target.dropPosition===`after`)){let e=n.collection.getKeyAfter(i),t=null;if(e!=null){let r=n.collection.getItem(i)?.level??0;for(;e;){let i=n.collection.getItem(e);if(!i)break;if(i.type!==`item`){e=n.collection.getKeyAfter(e);continue}if((i.level??0)<=r)break;t=e,e=n.collection.getKeyAfter(e)}}i=e??t??i}return c(()=>new Set([r,i].filter(e=>e!=null)),[r,i])}const Oe=n(null);function ke(t){let n=l({});return e.createElement(Oe.Provider,{value:n},t.children)}const Ae=`row-header-column-`+Math.random().toString(36).slice(2);let je=`row-header-column-`+Math.random().toString(36).slice(2);for(;Ae===je;)je=`row-header-column-`+Math.random().toString(36).slice(2);function Me(e,t){if(t.length===0)return[];let n=[],r=new Map;for(let a of t){let t=a.parentKey,o=[a];for(;t;){let n=e.get(t);if(!n)break;if(r.has(n)){var i;(i=n).colSpan??(i.colSpan=0),n.colSpan++,n.colspan=n.colSpan;let{column:e,index:t}=r.get(n);if(t>o.length)break;for(let n=t;n<o.length;n++)e.splice(n,0,null);for(let t=o.length;t<e.length;t++)e[t]&&r.has(e[t])&&(r.get(e[t]).index=t)}else n.colSpan=1,n.colspan=1,o.push(n),r.set(n,{column:o,index:o.length-1});t=n.parentKey}n.push(o),a.index=n.length-1}let a=Math.max(...n.map(e=>e.length)),o=Array(a).fill(0).map(()=>[]),s=0;for(let e of n){let t=a-1;for(let n of e){if(n){let e=o[t],r=e.reduce((e,t)=>e+(t.colSpan??1),0);if(r<s){let i={type:`placeholder`,key:`placeholder-`+n.key,colspan:s-r,colSpan:s-r,index:r,value:null,rendered:null,level:t,hasChildNodes:!1,childNodes:[],textValue:``};e.length>0&&(e[e.length-1].nextKey=i.key,i.prevKey=e[e.length-1].key),e.push(i)}e.length>0&&(e[e.length-1].nextKey=n.key,n.prevKey=e[e.length-1].key),n.level=t,n.colIndex=s,e.push(n)}t--}s++}let c=0;for(let e of o){let n=e.reduce((e,t)=>e+(t.colSpan??1),0);if(n<t.length){let r={type:`placeholder`,key:`placeholder-`+e[e.length-1].key,colSpan:t.length-n,colspan:t.length-n,index:n,value:null,rendered:null,level:c,hasChildNodes:!1,childNodes:[],textValue:``,prevKey:e[e.length-1].key};e.push(r)}c++}return o.map((e,t)=>({type:`headerrow`,key:`headerrow-`+t,index:t,value:null,rendered:null,level:0,hasChildNodes:!0,childNodes:e,textValue:``}))}var Ne=class extends U{addNode(e){super.addNode(e),this.columnsDirty||=e.type===`column`,e.type===`tableheader`&&(this.head=e),e.type===`tablebody`&&(this.body=e)}commit(e,t,n=!1){this.updateColumns(n),this.rows=[];for(let e of this.getChildren(this.body.key)){let t=e.lastChildKey;if(t!=null){let e=this.getItem(t),r=(e.colIndex??e.index)+(e.colSpan??1);if(r!==this.columns.length&&!n)throw Error(`Cell count must match column count. Found ${r} cells and ${this.columns.length} columns.`)}this.rows.push(e)}super.commit(e,t,n)}updateColumns(e){if(!this.columnsDirty)return;this.rowHeaderColumnKeys=new Set,this.columns=[];let t=new Map,n=e=>{e.type===`column`&&(t.set(e.key,e),e.hasChildNodes||(e.index=this.columns.length,this.columns.push(e),e.props.isRowHeader&&this.rowHeaderColumnKeys.add(e.key)));for(let t of this.getChildren(e.key))n(t)};for(let e of this.getChildren(this.head.key))n(e);if(this.headerRows=Me(t,this.columns),this.columnsDirty=!1,this.rowHeaderColumnKeys.size===0&&this.columns.length>0&&!e)throw Error(`A table must have at least one Column with the isRowHeader prop set to true`)}get columnCount(){return this.columns.length}*[Symbol.iterator](){this.head.key!==-1&&(yield this.head,yield this.body)}getFirstKey(){return this.body.firstChildKey}getLastKey(){return this.body.lastChildKey}getKeyAfter(e){let t=this.getItem(e);return t?.type===`column`?t.nextKey??null:super.getKeyAfter(e)}getKeyBefore(e){let t=this.getItem(e);if(t?.type===`column`)return t.prevKey??null;let n=super.getKeyBefore(e);return n!=null&&this.getItem(n)?.type===`tablebody`?null:n}getChildren(e){if(!this.getItem(e)){for(let t of this.headerRows)if(t.key===e)return t.childNodes}return super.getChildren(e)}clone(){let e=super.clone();return e.headerRows=this.headerRows,e.columns=this.columns,e.rowHeaderColumnKeys=this.rowHeaderColumnKeys,e.head=this.head,e.body=this.body,e}getTextValue(e){let t=this.getItem(e);if(!t)return``;if(t.textValue)return t.textValue;let n=this.rowHeaderColumnKeys,r=[];for(let t of this.getChildren(e)){let e=this.columns[t.index];if(n.has(e.key)&&t.textValue&&r.push(t.textValue),r.length===n.size)break}return r.join(` `)}constructor(...e){super(...e),this.headerRows=[],this.columns=[],this.rows=[],this.rowHeaderColumnKeys=new Set,this.head=new Ve(-1),this.body=new Ue(-2),this.columnsDirty=!0}};const Pe=n(null),Fe=n(null),$=n(null),Ie=n(null),Le=r(function(t,n){[t,n]=O(t,n,Fe);let r=w(t),{selectionBehavior:i,selectionMode:a,disallowEmptySelection:o}=r,s=!!t.dragAndDropHooks?.useDraggableCollectionState,l=c(()=>({selectionBehavior:a===`none`?null:i,selectionMode:a,disallowEmptySelection:o,allowsDragging:s}),[i,a,o,s]),u=e.createElement(Be.Provider,{value:l},e.createElement(be,t));return e.createElement(ue,{content:u,createCollection:()=>new Ne},i=>e.createElement(ze,{props:t,forwardedRef:n,selectionState:r,collection:i}))});let Re=r(function(t,n){let{isVirtualized:r}=o(Q);return r?e.createElement(j.div,{...t,ref:n}):e.createElement(j.table,{...t,ref:n})});function ze({props:t,forwardedRef:n,selectionState:r,collection:i}){[t,n]=O(t,n,T);let{shouldUseVirtualFocus:a,disallowTypeAhead:u,filter:d,...p}=t,m=o(Pe);n=v(c(()=>h(n,m?.tableRef),[n,m?.tableRef]));let g=ie({...p,collection:i,children:void 0,UNSAFE_selectionState:r}),_=re(g,d),{isVirtualized:y,layoutDelegate:b,dropTargetDelegate:C,CollectionRoot:w}=o(Q),{dragAndDropHooks:E}=t,{gridProps:se}=ne({...p,layoutDelegate:b,isVirtualized:y},_,n),k=_.selectionManager,A=!!E?.useDraggableCollectionState,j=!!E?.useDroppableCollectionState;l(A),l(j),s(()=>{},[A,j]);let M,N,P,F=!1,I=null,L=l(null);if(A&&E){M=E.useDraggableCollectionState({collection:_.collection,selectionManager:k,preview:E.renderDragPreview?L:void 0}),E.useDraggableCollection({},M,n);let t=E.DragPreview;I=E.renderDragPreview?e.createElement(t,{ref:L},E.renderDragPreview):null}if(j&&E){N=E.useDroppableCollectionState({collection:_.collection,selectionManager:k});let e=new S({collection:_.collection,disabledKeys:k.disabledKeys,disabledBehavior:k.disabledBehavior,ref:n,layoutDelegate:b}),t=E.dropTargetDelegate||C||new E.ListDropTargetDelegate(i.rows,n);P=E.useDroppableCollection({keyboardDelegate:e,dropTargetDelegate:t},N,n),F=N.isDropTarget({type:`root`})}let{focusProps:R,isFocused:z,isFocusVisible:B}=te(),V=D({...t,children:void 0,defaultClassName:`react-aria-Table`,values:{isDropTarget:F,isFocused:z,isFocusVisible:B,state:_}}),H=!!(A&&!M?.isDisabled),U=V.style,W=null;m&&(W=m.useTableColumnResizeState({tableWidth:m.tableWidth},_),y||(U={...U,tableLayout:`fixed`,width:`fit-content`}));let G=f(t,{global:!0});return e.createElement(oe,{values:[[$,_],[Ie,W],[Te,{dragAndDropHooks:E,dragState:M,dropState:N}],[Ee,{render:Je}],[T,null],[ae,null]]},e.createElement(x,null,e.createElement(Re,{...ee(G,V,se,R,P?.collectionProps),style:U,ref:n,slot:t.slot||void 0,onScroll:t.onScroll,"data-allows-dragging":H||void 0,"data-drop-target":F||void 0,"data-focused":z||void 0,"data-focus-visible":B||void 0},e.createElement(ke,null,e.createElement(w,{collection:_.collection,scrollRef:m?.scrollRef??n,persistedKeys:De(k,E,N)})))),I)}const Be=n(null);var Ve=class extends L{};Ve.type=`tableheader`;var He=class extends L{};He.type=`column`;var Ue=class extends R{};Ue.type=`tablebody`;var We=class extends L{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}};We.type=`item`;let Ge=r(function(t,n){let{isVirtualized:r}=o(Q);return r?e.createElement(j.div,{...t,ref:n}):e.createElement(j.tr,{...t,ref:n})});var Ke=class extends L{};Ke.type=`cell`;let qe=r(function(t,n){let{isVirtualized:r}=o(Q);return r?e.createElement(j.div,{...t,ref:n}):e.createElement(j.td,{...t,ref:n})});function Je(t,n){n=v(n);let{dragAndDropHooks:r,dropState:i}=o(Te),a=l(null),{dropIndicatorProps:s,isHidden:c,isDropTarget:u}=r.useDropIndicator(t,i,a);return c?null:e.createElement(Qe,{...t,dropIndicatorProps:s,isDropTarget:u,buttonRef:a,ref:n})}let Ye=r(function(t,n){let{isVirtualized:r}=o(Q);return r?e.createElement(j.div,{...t,ref:n}):e.createElement(j.tr,{...t,ref:n})}),Xe=r(function(t,n){let{isVirtualized:r}=o(Q);return r?e.createElement(j.div,{...t,ref:n}):e.createElement(j.td,{...t,ref:n})});function Ze(t,n){let{dropIndicatorProps:r,isDropTarget:i,buttonRef:a,...s}=t,c=o($),{visuallyHiddenProps:l}=C(),u=D({...s,defaultClassName:`react-aria-DropIndicator`,values:{isDropTarget:i}});return e.createElement(Ye,{...f(t,{global:!0}),...u,role:`row`,ref:n,"data-drop-target":i||void 0},e.createElement(Xe,{role:`gridcell`,colSpan:c.collection.columnCount,style:{padding:0}},e.createElement(`div`,{...l,role:`button`,...r,ref:a}),u.children))}const Qe=r(Ze);_e(B,function(t,n,r){let i=o($),{isVirtualized:a}=o(Q),{isLoading:s,onLoadMore:u,scrollOffset:d,...m}=t,h=i.collection.columns.length,g=l(null),v=c(()=>({onLoadMore:u,collection:i?.collection,sentinelRef:g,scrollOffset:d}),[u,d,i?.collection]);_(v,g);let y=D({...m,id:void 0,children:r.rendered,defaultClassName:`react-aria-TableLoadingIndicator`,values:void 0}),b={},x={},S={};return a?(x[`aria-colspan`]=h,S={display:`contents`}):x.colSpan=h,e.createElement(e.Fragment,null,e.createElement(Ge,{style:{height:0},inert:p(!0)},e.createElement(qe,{style:{padding:0,border:0}},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:g,style:{position:`relative`,height:1,width:1}}))),s&&y.children&&e.createElement(Ge,{...ee(f(t,{global:!0}),b),...y,role:`row`,ref:n},e.createElement(qe,{role:`rowheader`,...x,style:S},y.children)))});export{Le as Table};
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useMemo as s,useRef as c}from"react";import{filterDOMProps as l,inertValue as u,mergeRefs as d,useLayoutEffect as f,useLoadMoreSentinel as p}from"@react-aria/utils";import{FocusableContext as m}from"@react-aria/interactions";import"react-dom";import{mergeProps as h,useTableRowGroup as g,useVisuallyHidden as _}from"react-aria";import"react-stately";
|
|
2
|
-
/**
|
|
3
|
-
* @license React
|
|
4
|
-
* use-sync-external-store-shim.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/
|
|
11
|
-
var j=v((e=>{var t=y(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore}));v(((e,t)=>{t.exports=j()}))();const M=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const N=n(null);function P(e){var t;return t=class extends w{},t.type=e,t}function F(t,n,r,i,s,c){typeof t==`string`&&(t=P(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(N);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(N.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function te(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(m);if(!o(M)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return F(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(m.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function I(t,n,i=L){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>F(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function L(e){return A({...e,addIdAndValue:!0})}const R={CollectionRoot({collection:e,renderDropIndicator:t}){return z(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return z(e,t,n)}};function z(t,n,r){return A({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,B(t,n,r))}})}function B(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const V=n(R),H=n({}),U=n(null),W=r(function(t,n){let{render:r}=o(U);return e.createElement(e.Fragment,null,r(t,n))});function G(t,n){let r=t?.renderDropIndicator,i=t?.isVirtualDragging?.call(t),o=a(t=>{if(i||n?.isDropTarget(t))return r?r(t):e.createElement(W,{target:t})},[n?.target,i,r]);return t?.useDropIndicator?o:void 0}const K=n(null);var q=class extends w{};q.type=`tableheader`;var J=class extends w{};J.type=`column`;var Y=class extends T{};Y.type=`tablebody`;let X=r(function(t,n){let{isVirtualized:r}=o(V);return r?e.createElement(C.div,{...t,ref:n}):e.createElement(C.tbody,{...t,ref:n})});const Z=I(Y,(t,n)=>{let r=o(K),{isVirtualized:i}=o(V),a=r.collection,{CollectionBranch:s}=o(V),{dragAndDropHooks:c,dropState:u}=o(H),d=!!c?.useDroppableCollectionState&&!u?.isDisabled,f=d&&!!u&&(u.isDropTarget({type:`root`})??!1),p=a.size===0,m={isDropTarget:f,isEmpty:p},_=b({...t,id:void 0,children:void 0,defaultClassName:`react-aria-TableBody`,values:m}),v,y=a.columnCount;if(p&&t.renderEmptyState&&r){let n={},r={},a={};i?(r[`aria-colspan`]=y,a={display:`contents`}):r.colSpan=y,v=e.createElement(Q,{role:`row`,...n,style:a},e.createElement($,{role:`rowheader`,...r,style:a},t.renderEmptyState(m)))}let{rowGroupProps:x}=g(),S=l(t,{global:!0});return e.createElement(X,{...h(S,_,x),ref:n,"data-empty":p||void 0},d&&e.createElement(ie,null),e.createElement(s,{collection:a,parent:a.body,renderDropIndicator:G(c,u)}),v)});var ne=class extends w{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}};ne.type=`item`;let Q=r(function(t,n){let{isVirtualized:r}=o(V);return r?e.createElement(C.div,{...t,ref:n}):e.createElement(C.tr,{...t,ref:n})});var re=class extends w{};re.type=`cell`;let $=r(function(t,n){let{isVirtualized:r}=o(V);return r?e.createElement(C.div,{...t,ref:n}):e.createElement(C.td,{...t,ref:n})});function ie(){let t=o(K),{dragAndDropHooks:n,dropState:r}=o(H),i=c(null),{dropIndicatorProps:a}=n.useDropIndicator({target:{type:`root`}},r,i),s=r.isDropTarget({type:`root`}),{visuallyHiddenProps:l}=_();return!s&&a[`aria-hidden`]?null:e.createElement(Q,{role:`row`,"aria-hidden":a[`aria-hidden`],style:{height:0}},e.createElement($,{role:`gridcell`,colSpan:t.collection.columnCount,style:{padding:0}},e.createElement(`div`,{role:`button`,...l,...a,ref:i})))}te(D,function(t,n,r){let i=o(K),{isVirtualized:a}=o(V),{isLoading:d,onLoadMore:f,scrollOffset:m,...g}=t,_=i.collection.columns.length,v=c(null),y=s(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:v,scrollOffset:m}),[f,m,i?.collection]);p(y,v);let x=b({...g,id:void 0,children:r.rendered,defaultClassName:`react-aria-TableLoadingIndicator`,values:void 0}),S={},C={},w={};return a?(C[`aria-colspan`]=_,w={display:`contents`}):C.colSpan=_,e.createElement(e.Fragment,null,e.createElement(Q,{style:{height:0},inert:u(!0)},e.createElement($,{style:{padding:0,border:0}},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:v,style:{position:`relative`,height:1,width:1}}))),d&&x.children&&e.createElement(Q,{...h(l(t,{global:!0}),S),...x,role:`row`,ref:n},e.createElement($,{role:`rowheader`,...C,style:w},x.children)))});export{Z as TableBody};
|
|
1
|
+
import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useMemo as s,useRef as c}from"react";import{filterDOMProps as l,inertValue as u,mergeRefs as d,useLayoutEffect as f,useLoadMoreSentinel as p}from"@react-aria/utils";import{FocusableContext as m}from"@react-aria/interactions";import"react-dom";import{mergeProps as h,useTableRowGroup as g,useVisuallyHidden as _}from"react-aria";import"react-stately";function v(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:c,render:l}=e;return s(()=>{let e,s,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,s=typeof n==`function`?n({...c,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:a}):r??a,{className:e??i,style:s||o?{...o,...s}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,a,o,c,l])}function y(t,n,r){let{render:i,...a}=n,o=c(null),l=s(()=>d(r,o),[r,o]);f(()=>{},[t,i]);let u={...a,ref:l};return i?i(u,void 0):e.createElement(t,u)}const b={},x=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=b[t];return n||(n=r(y.bind(null,t)),b[t]=n),n}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var S=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},C=class extends S{filter(e,t,n){let[r,i]=O(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},w=class extends S{};w.type=`header`;var T=class extends S{};T.type=`loader`;var E=class extends C{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};E.type=`item`;var D=class extends C{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};D.type=`section`;function O(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function k(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,c=s(()=>new WeakMap,o);return s(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=c.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),c.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,c,i,a])}const A=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const j=n(null);function M(e){var t;return t=class extends S{},t.type=e,t}function N(t,n,r,i,s,c){typeof t==`string`&&(t=M(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(j);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(j.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function P(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(m);if(!o(A)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return N(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(m.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function F(t,n,i=ee){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>N(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function ee(e){return k({...e,addIdAndValue:!0})}const I={CollectionRoot({collection:e,renderDropIndicator:t}){return L(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return L(e,t,n)}};function L(t,n,r){return k({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,R(t,n,r))}})}function R(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 z=n(I),B=n({}),V=n(null),H=r(function(t,n){let{render:r}=o(V);return e.createElement(e.Fragment,null,r(t,n))});function U(t,n){let r=t?.renderDropIndicator,i=t?.isVirtualDragging?.call(t),o=a(t=>{if(i||n?.isDropTarget(t))return r?r(t):e.createElement(H,{target:t})},[n?.target,i,r]);return t?.useDropIndicator?o:void 0}const W=n(null);var G=class extends S{};G.type=`tableheader`;var K=class extends S{};K.type=`column`;var q=class extends C{};q.type=`tablebody`;let J=r(function(t,n){let{isVirtualized:r}=o(z);return r?e.createElement(x.div,{...t,ref:n}):e.createElement(x.tbody,{...t,ref:n})});const Y=F(q,(t,n)=>{let r=o(W),{isVirtualized:i}=o(z),a=r.collection,{CollectionBranch:s}=o(z),{dragAndDropHooks:c,dropState:u}=o(B),d=!!c?.useDroppableCollectionState&&!u?.isDisabled,f=d&&!!u&&(u.isDropTarget({type:`root`})??!1),p=a.size===0,m={isDropTarget:f,isEmpty:p},_=v({...t,id:void 0,children:void 0,defaultClassName:`react-aria-TableBody`,values:m}),y,b=a.columnCount;if(p&&t.renderEmptyState&&r){let n={},r={},a={};i?(r[`aria-colspan`]=b,a={display:`contents`}):r.colSpan=b,y=e.createElement(Z,{role:`row`,...n,style:a},e.createElement($,{role:`rowheader`,...r,style:a},t.renderEmptyState(m)))}let{rowGroupProps:x}=g(),S=l(t,{global:!0});return e.createElement(J,{...h(S,_,x),ref:n,"data-empty":p||void 0},d&&e.createElement(te,null),e.createElement(s,{collection:a,parent:a.body,renderDropIndicator:U(c,u)}),y)});var X=class extends S{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}};X.type=`item`;let Z=r(function(t,n){let{isVirtualized:r}=o(z);return r?e.createElement(x.div,{...t,ref:n}):e.createElement(x.tr,{...t,ref:n})});var Q=class extends S{};Q.type=`cell`;let $=r(function(t,n){let{isVirtualized:r}=o(z);return r?e.createElement(x.div,{...t,ref:n}):e.createElement(x.td,{...t,ref:n})});function te(){let t=o(W),{dragAndDropHooks:n,dropState:r}=o(B),i=c(null),{dropIndicatorProps:a}=n.useDropIndicator({target:{type:`root`}},r,i),s=r.isDropTarget({type:`root`}),{visuallyHiddenProps:l}=_();return!s&&a[`aria-hidden`]?null:e.createElement(Z,{role:`row`,"aria-hidden":a[`aria-hidden`],style:{height:0}},e.createElement($,{role:`gridcell`,colSpan:t.collection.columnCount,style:{padding:0}},e.createElement(`div`,{role:`button`,...l,...a,ref:i})))}P(T,function(t,n,r){let i=o(W),{isVirtualized:a}=o(z),{isLoading:d,onLoadMore:f,scrollOffset:m,...g}=t,_=i.collection.columns.length,y=c(null),b=s(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:y,scrollOffset:m}),[f,m,i?.collection]);p(b,y);let x=v({...g,id:void 0,children:r.rendered,defaultClassName:`react-aria-TableLoadingIndicator`,values:void 0}),S={},C={},w={};return a?(C[`aria-colspan`]=_,w={display:`contents`}):C.colSpan=_,e.createElement(e.Fragment,null,e.createElement(Z,{style:{height:0},inert:u(!0)},e.createElement($,{style:{padding:0,border:0}},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:y,style:{position:`relative`,height:1,width:1}}))),d&&x.children&&e.createElement(Z,{...h(l(t,{global:!0}),S),...x,role:`row`,ref:n},e.createElement($,{role:`rowheader`,...C,style:w},x.children)))});export{Y as TableBody};
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useMemo as s,useRef as c}from"react";import{filterDOMProps as l,inertValue as u,mergeRefs as d,useLayoutEffect as f,useLoadMoreSentinel as
|
|
2
|
-
/**
|
|
3
|
-
* @license React
|
|
4
|
-
* use-sync-external-store-shim.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/
|
|
11
|
-
var oe=b((e=>{var t=x(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore}));b(((e,t)=>{t.exports=oe()}))();const I=n(!1),L=n(null);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const R=n(null);function z(e){var t;return t=class extends M{},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){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(p);if(!o(I)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return B(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(p.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function H(t,n,i=U){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 U(e){return F({...e,addIdAndValue:!0})}const W=n(null);function G(t){let n=o(W),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=U({...t,idScope:i,dependencies:r});return o(L)&&(a=e.createElement(K,null,a)),n=s(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(W.Provider,{value:n},a)}function K({children:t}){let n=o(L),r=s(()=>e.createElement(L.Provider,{value:null},e.createElement(I.Provider,{value:!0},t)),[t]);return j()?e.createElement(R.Provider,{value:n},r):m(r,n)}const se={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 F({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,ce(t,n,r))}})}function ce(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(se),Y=n(null);var X=class extends M{};X.type=`tableheader`;let Z=r(function(t,n){let{isVirtualized:r}=o(J);return r?e.createElement(D.div,{...t,ref:n}):e.createElement(D.thead,{...t,ref:n})});const le=H(X,(t,n)=>{let r=o(Y).collection,i=F({items:r.headerRows,children:a(t=>{switch(t.type){case`headerrow`:return e.createElement(de,{item:t});default:throw Error(`Unsupported node type in TableHeader: `+t.type)}},[])}),{rowGroupProps:s}=v(),{hoverProps:c,isHovered:u}=g({onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),d=w({...t,children:void 0,defaultClassName:`react-aria-TableHeader`,values:{isHovered:u}});return e.createElement(Z,{...h(l(t,{global:!0}),s,c),...d,ref:n,"data-hovered":u||void 0},i)},t=>e.createElement(G,{dependencies:t.dependencies,items:t.columns},t.children));let ue=r(function(t,n){let{isVirtualized:r}=o(J);return r?e.createElement(`div`,{...t,ref:n}):e.createElement(`tr`,{...t,ref:n})});function de({item:t}){let n=c(null),r=o(Y),{isVirtualized:i,CollectionBranch:a}=o(J),{rowProps:s}=_({node:t,isVirtualized:i},r,n),{checkboxProps:l}=y(r);return e.createElement(ue,{...s,ref:n},e.createElement(C,{values:[[S,{slots:{selection:l}}]]},e.createElement(a,{collection:r.collection,parent:t})))}var fe=class extends M{};fe.type=`column`;var pe=class extends N{};pe.type=`tablebody`;var me=class extends M{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}};me.type=`item`;let Q=r(function(t,n){let{isVirtualized:r}=o(J);return r?e.createElement(D.div,{...t,ref:n}):e.createElement(D.tr,{...t,ref:n})});var he=class extends M{};he.type=`cell`;let $=r(function(t,n){let{isVirtualized:r}=o(J);return r?e.createElement(D.div,{...t,ref:n}):e.createElement(D.td,{...t,ref:n})});V(P,function(t,n,r){let i=o(Y),{isVirtualized:a}=o(J),{isLoading:d,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]);ee(v,_);let y=w({...m,id:void 0,children:r.rendered,defaultClassName:`react-aria-TableLoadingIndicator`,values:void 0}),b={},x={},S={};return a?(x[`aria-colspan`]=g,S={display:`contents`}):x.colSpan=g,e.createElement(e.Fragment,null,e.createElement(Q,{style:{height:0},inert:u(!0)},e.createElement($,{style:{padding:0,border:0}},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:_,style:{position:`relative`,height:1,width:1}}))),d&&y.children&&e.createElement(Q,{...h(l(t,{global:!0}),b),...y,role:`row`,ref:n},e.createElement($,{role:`rowheader`,...x,style:S},y.children)))});export{le as TableHeader};
|
|
1
|
+
import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useMemo as s,useRef as c}from"react";import{filterDOMProps as l,inertValue as u,mergeRefs as d,useLayoutEffect as f,useLoadMoreSentinel as p}from"@react-aria/utils";import{FocusableContext as m}from"@react-aria/interactions";import{createPortal as h}from"react-dom";import{mergeProps as g,useHover as _,useTableHeaderRow as v,useTableRowGroup as y,useTableSelectAllCheckbox as b}from"react-aria";import"react-stately";const x=n(null);n(null),n(null),n(null),n(null),n({}),n(null),n(null);function S({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function C(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 w(t,n,r){let{render:i,...a}=n,o=c(null),l=s(()=>d(r,o),[r,o]);f(()=>{},[t,i]);let u={...a,ref:l};return i?i(u,void 0):e.createElement(t,u)}const T={},E=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=T[t];return n||(n=r(w.bind(null,t)),T[t]=n),n}});String(Math.round(Math.random()*1e10));const ee=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function te(){return!1}function D(){return!0}function ne(e){return()=>{}}function re(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(ne,te,D):o(ee)}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]=ie(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`;function ie(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 P(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,c=s(()=>new WeakMap,o);return s(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=c.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),c.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,c,i,a])}const F=n(!1),I=n(null);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const L=n(null);function ae(e){var t;return t=class extends O{},t.type=e,t}function R(t,n,r,i,s,c){typeof t==`string`&&(t=ae(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(L);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(L.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function z(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(m);if(!o(F)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return R(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(m.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function B(t,n,i=V){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>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 V(e){return P({...e,addIdAndValue:!0})}const H=n(null);function U(t){let n=o(H),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=V({...t,idScope:i,dependencies:r});return o(I)&&(a=e.createElement(W,null,a)),n=s(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(H.Provider,{value:n},a)}function W({children:t}){let n=o(I),r=s(()=>e.createElement(I.Provider,{value:null},e.createElement(F.Provider,{value:!0},t)),[t]);return re()?e.createElement(L.Provider,{value:n},r):h(r,n)}const G={CollectionRoot({collection:e,renderDropIndicator:t}){return K(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return K(e,t,n)}};function K(t,n,r){return P({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,q(t,n,r))}})}function q(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const J=n(G),Y=n(null);var X=class extends O{};X.type=`tableheader`;let oe=r(function(t,n){let{isVirtualized:r}=o(J);return r?e.createElement(E.div,{...t,ref:n}):e.createElement(E.thead,{...t,ref:n})});const se=B(X,(t,n)=>{let r=o(Y).collection,i=P({items:r.headerRows,children:a(t=>{switch(t.type){case`headerrow`:return e.createElement(le,{item:t});default:throw Error(`Unsupported node type in TableHeader: `+t.type)}},[])}),{rowGroupProps:s}=y(),{hoverProps:c,isHovered:u}=_({onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),d=C({...t,children:void 0,defaultClassName:`react-aria-TableHeader`,values:{isHovered:u}});return e.createElement(oe,{...g(l(t,{global:!0}),s,c),...d,ref:n,"data-hovered":u||void 0},i)},t=>e.createElement(U,{dependencies:t.dependencies,items:t.columns},t.children));let ce=r(function(t,n){let{isVirtualized:r}=o(J);return r?e.createElement(`div`,{...t,ref:n}):e.createElement(`tr`,{...t,ref:n})});function le({item:t}){let n=c(null),r=o(Y),{isVirtualized:i,CollectionBranch:a}=o(J),{rowProps:s}=v({node:t,isVirtualized:i},r,n),{checkboxProps:l}=b(r);return e.createElement(ce,{...s,ref:n},e.createElement(S,{values:[[x,{slots:{selection:l}}]]},e.createElement(a,{collection:r.collection,parent:t})))}var Z=class extends O{};Z.type=`column`;var ue=class extends k{};ue.type=`tablebody`;var de=class extends O{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}};de.type=`item`;let Q=r(function(t,n){let{isVirtualized:r}=o(J);return r?e.createElement(E.div,{...t,ref:n}):e.createElement(E.tr,{...t,ref:n})});var fe=class extends O{};fe.type=`cell`;let $=r(function(t,n){let{isVirtualized:r}=o(J);return r?e.createElement(E.div,{...t,ref:n}):e.createElement(E.td,{...t,ref:n})});z(j,function(t,n,r){let i=o(Y),{isVirtualized:a}=o(J),{isLoading:d,onLoadMore:f,scrollOffset:m,...h}=t,_=i.collection.columns.length,v=c(null),y=s(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:v,scrollOffset:m}),[f,m,i?.collection]);p(y,v);let b=C({...h,id:void 0,children:r.rendered,defaultClassName:`react-aria-TableLoadingIndicator`,values:void 0}),x={},S={},w={};return a?(S[`aria-colspan`]=_,w={display:`contents`}):S.colSpan=_,e.createElement(e.Fragment,null,e.createElement(Q,{style:{height:0},inert:u(!0)},e.createElement($,{style:{padding:0,border:0}},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:v,style:{position:`relative`,height:1,width:1}}))),d&&b.children&&e.createElement(Q,{...g(l(t,{global:!0}),x),...b,role:`row`,ref:n},e.createElement($,{role:`rowheader`,...S,style:w},b.children)))});export{se as TableHeader};
|