@box-kite/react 2.2.18 → 2.3.1
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/.claude/rules/box-kite-rules.md +6 -2
- package/.claude/skills/box-kite/SKILL.md +19 -15
- package/.claude/skills/box-kite/references/patterns.md +1 -1
- package/.claude/skills/box-kite/references/styling.md +3 -3
- package/.cursor/rules/box-kite.mdc +7 -3
- package/AGENTS.md +7 -3
- package/BOX_AI_CONTEXT.md +81 -41
- package/BOX_KITE_AI_CONTEXT.md +81 -41
- package/README.md +13 -7
- package/behavior.cjs +1 -1
- package/behavior.mjs +1 -1
- package/box.cjs +1 -1
- package/box.d.ts +1 -0
- package/box.mjs +1 -1
- package/catalog.cjs +1 -1
- package/catalog.mjs +4 -1
- package/client.cjs +1 -1
- package/client.mjs +14 -14
- package/components/calendar.cjs +1 -1
- package/components/calendar.mjs +21 -20
- package/components/dashboard.cjs +1 -1
- package/components/dashboard.mjs +12 -12
- package/components/dataGrid/components/dataGridFooter.d.ts +6 -2
- package/components/dataGrid/models/gridModel.d.ts +21 -2
- package/components/dataGrid/models/groupRowModel.d.ts +1 -1
- package/components/dataGrid/models/rowModel.d.ts +1 -1
- package/components/dataGrid/models/sourceGroupRowModel.d.ts +5 -1
- package/components/dataGrid/models/sourceRowModel.d.ts +5 -1
- package/components/dataGrid.cjs +3 -3
- package/components/dataGrid.mjs +821 -771
- package/components/dateField.cjs +1 -1
- package/components/dateField.mjs +6 -6
- package/components/datePicker.cjs +1 -1
- package/components/datePicker.mjs +116 -111
- package/components/dialog.cjs +1 -1
- package/components/dialog.d.ts +1 -1
- package/components/dialog.mjs +1 -1
- package/components/dropdown.cjs +1 -1
- package/components/dropdown.mjs +8 -3
- package/components/menu.cjs +1 -1
- package/components/menu.mjs +10 -10
- package/components/overlay.cjs +1 -1
- package/components/overlay.mjs +6 -6
- package/components/popover.cjs +1 -1
- package/components/popover.d.ts +8 -2
- package/components/popover.mjs +58 -55
- package/components/slider.cjs +1 -1
- package/components/slider.mjs +8 -8
- package/components/sortableList.cjs +1 -1
- package/components/sortableList.mjs +1 -1
- package/components/svg.d.ts +2 -2
- package/components/swipeItem.cjs +1 -1
- package/components/swipeItem.mjs +11 -11
- package/components/tabs.cjs +1 -1
- package/components/tabs.mjs +9 -9
- package/dataGridList.cjs +1 -1
- package/dataGridList.mjs +3 -5
- package/docs/props.md +49 -25
- package/interactionListening.cjs +1 -1
- package/interactionListening.mjs +3 -3
- package/layer.cjs +1 -1
- package/layer.mjs +1 -1
- package/package.json +5 -5
- package/placement.cjs +1 -1
- package/placement.mjs +1 -1
- package/platform.cjs +1 -1
- package/platform.mjs +16 -11
- package/react-shared.cjs +1 -1
- package/react-shared.mjs +1 -1
- package/rsc.cjs +1 -1
- package/rsc.d.ts +1 -0
- package/rsc.mjs +1 -1
- package/utils/dom/domUtils.d.ts +2 -0
package/components/tabs.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { f as e } from "../react-shared.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { _ as t, d as n } from "../platform.mjs";
|
|
4
4
|
import { n as r } from "../effects.mjs";
|
|
5
5
|
import i from "../box.mjs";
|
|
6
6
|
import { a } from "../behavior.mjs";
|
|
@@ -161,7 +161,7 @@ function x(e) {
|
|
|
161
161
|
}
|
|
162
162
|
function S(e, o) {
|
|
163
163
|
let { children: s, label: c, labelledBy: l, props: d, ...f } = e, { value: _, orientation: y, activation: x, loop: S, indicator: C, tabStop: w, setTabStop: T, setIndicatorLive: E, select: D } = b("Tabs.List"), O = p(null), k = u((e) => {
|
|
164
|
-
O.current = e,
|
|
164
|
+
O.current = e, n(o, e);
|
|
165
165
|
}, [o]), [A, j] = m(), M = C === "sliding";
|
|
166
166
|
r(() => {
|
|
167
167
|
let e = O.current;
|
|
@@ -189,9 +189,9 @@ function S(e, o) {
|
|
|
189
189
|
t !== void 0 && T(t);
|
|
190
190
|
}, [w, T]);
|
|
191
191
|
let P = a((e) => {
|
|
192
|
-
let
|
|
193
|
-
if (!
|
|
194
|
-
let r = v.tabs(
|
|
192
|
+
let n = O.current;
|
|
193
|
+
if (!n || e.defaultPrevented || !v.owns(n, e.target)) return;
|
|
194
|
+
let r = v.tabs(n), i = v.indexOf(r, e.target);
|
|
195
195
|
if (i === -1) return;
|
|
196
196
|
if (x === "manual" && (e.key === "Enter" || e.key === " ")) {
|
|
197
197
|
let t = v.valueOf(r[i]);
|
|
@@ -202,7 +202,7 @@ function S(e, o) {
|
|
|
202
202
|
});
|
|
203
203
|
return;
|
|
204
204
|
}
|
|
205
|
-
let a = v.moveFor(e.key, y, n
|
|
205
|
+
let a = v.moveFor(e.key, y, t(n));
|
|
206
206
|
if (!a) return;
|
|
207
207
|
let o = v.target(r, i, a, S);
|
|
208
208
|
if (!o) return;
|
|
@@ -274,10 +274,10 @@ function C(e) {
|
|
|
274
274
|
});
|
|
275
275
|
}
|
|
276
276
|
C.displayName = "Tabs.Tab";
|
|
277
|
-
function w(e,
|
|
277
|
+
function w(e, t) {
|
|
278
278
|
let { children: o, props: s, ...l } = e, { value: d } = b("Tabs.Panels"), f = p(null), g = u((e) => {
|
|
279
|
-
f.current = e, t
|
|
280
|
-
}, [
|
|
279
|
+
f.current = e, n(t, e);
|
|
280
|
+
}, [t]), [_, y] = m(), [x, S] = m(!1), C = a(() => {
|
|
281
281
|
let e = f.current;
|
|
282
282
|
if (!e) return;
|
|
283
283
|
let t = v.visiblePanel(e)?.offsetHeight;
|
package/dataGridList.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./box.cjs"),t=require("./reporting.cjs"),n=require("./components/svg.cjs"),r=require("./components/button.cjs"),i=require("./components/visuallyHidden.cjs"),a=require("./components/flex.cjs"),o=require("./components/checkbox.cjs"),s=require("./components/textbox.cjs"),c=require("./components/semantics.cjs"),l=require("./components/dataGrid.cjs"),u=require("./components/dialog.cjs"),d=require("./components/list.cjs"),f=require("./components/radioButton.cjs"),p=require("./components/skeleton.cjs"),m=require("./dataGridListLayout.cjs");let h=require("react"),g=require("react/jsx-runtime");function _(e){let{cell:t}=e,{AggregateCell:n}=t.column;return n?(0,g.jsx)(n,{cell:t}):(0,g.jsx)(g.Fragment,{children:t.value??`—`})}_.displayName=`DataGridListAggregate`;function v(t){let{grid:n,shown:i}=t,{list:o,pagination:s,aggregation:c}=n,u=n.componentName,d=n.localeText,f=s.state,p=c.hasFooter?c.footerCells.value.filter(e=>e.column.aggregate):[];return(0,g.jsxs)(g.Fragment,{children:[p.length>0&&(0,g.jsxs)(e.default,{bgColor:`currentColor/3`,px:4,py:3,children:[(0,g.jsx)(e.default,{fontWeight:600,fontSize:14,mb:1,children:c.footerLabel}),(0,g.jsx)(e.default,{tag:`dl`,display:`grid`,gridTemplateColumns:2,columnGap:4,rowGap:2,m:0,children:p.map(t=>(0,g.jsxs)(e.default,{minWidth:0,children:[(0,g.jsx)(e.default,{tag:`dt`,component:`list.muted`,fontSize:12,lineHeight:16,children:t.column.header??String(t.column.key)}),(0,g.jsx)(e.default,{tag:`dd`,m:0,fontSize:14,lineHeight:20,fontWeight:600,children:(0,g.jsx)(_,{cell:t})})]},t.column.key))})]}),f?(0,g.jsx)(a.default,{component:`list.muted`,d:`column`,gap:2,ai:`center`,px:4,py:4,fontSize:13,css:{fontVariantNumeric:`tabular-nums`},children:(0,g.jsxs)(a.default,{ai:`center`,jc:`space-between`,gap:3,width:`fit`,children:[(0,g.jsx)(r.default,{type:`button`,component:`${u}.list.button`,...m.t.ICON_BUTTON,borderRadius:3,disabled:!s.canGoPrev,onClick:s.prevPage,props:{"aria-label":d.previousPage},children:(0,g.jsx)(l.f,{width:`18px`,height:`18px`,rotate:90,rtl:{rotate:-90}})}),(0,g.jsx)(e.default,{textAlign:`center`,children:d.pageRowRange(s.startItem,s.endItem,s.totalItems)}),(0,g.jsx)(r.default,{type:`button`,component:`${u}.list.button`,...m.t.ICON_BUTTON,borderRadius:3,disabled:!s.canGoNext,onClick:s.nextPage,props:{"aria-label":d.nextPage},children:(0,g.jsx)(l.f,{width:`18px`,height:`18px`,rotate:-90,rtl:{rotate:90}})})]})}):(o.hasMore||i!==void 0)&&(0,g.jsxs)(a.default,{component:`list.muted`,d:`column`,gap:2,ai:`center`,px:4,py:4,fontSize:13,css:{fontVariantNumeric:`tabular-nums`},children:[o.hasMore&&(0,g.jsx)(r.default,{type:`button`,component:`${u}.list.button`,width:`fit`,height:11,borderRadius:3,fontSize:15,fontWeight:500,color:`accent-600`,cursor:`pointer`,theme:{dark:{color:`accent-300`}},onClick:o.showMore,children:d.showMore(o.nextBatch)}),i!==void 0&&(0,g.jsx)(e.default,{children:d.shownCount(i,n.source.enabled?n.totalRowCount:n.filterStats.filtered)})]})]})}v.displayName=`DataGridListFooter`;function y(e){let{row:t}=e,{grid:n}=t,r=t.cells.flatMap(e=>e.aggregate?[e.aggregate]:[]),i=t.placeholder?``:String(t.groupValue);return(0,g.jsxs)(d.default.Item,{size:`sm`,bgColor:`currentColor/3`,ps:4+Math.min(t.depth,3)*4,props:{"aria-busy":t.placeholder||void 0},children:[n.list.selecting&&t.selectable&&(0,g.jsx)(d.default.Actions,{children:(0,g.jsx)(o.default,{variant:`datagrid`,checked:t.selected,indeterminate:t.indeterminate,onChange:t.toggleSelectAll,props:{"aria-label":n.localeText.selectGroupRows(i)}})}),(0,g.jsx)(l.f,{width:`16px`,height:`16px`,flexShrink:0,rotate:t.expanded?0:-90,rtl:{rotate:t.expanded?0:90}}),(0,g.jsxs)(d.default.Content,{children:[(0,g.jsx)(d.default.Title,{lines:1,fontSize:14,fontWeight:600,children:(0,g.jsx)(d.default.Action,{onClick:()=>t.toggleRow(),props:{"aria-expanded":t.expanded},children:i})}),r.length>0&&(0,g.jsx)(d.default.Row,{secondary:!0,wrap:!0,columnGap:4,fontSize:13,css:{fontVariantNumeric:`tabular-nums`},children:r.map(e=>(0,g.jsxs)(c.Span,{display:`inline-flex`,gap:1,children:[(0,g.jsx)(c.Span,{children:e.column.header??String(e.column.key)}),(0,g.jsx)(c.Span,{fontWeight:600,children:(0,g.jsx)(_,{cell:e})})]},e.column.key))})]}),(0,g.jsx)(d.default.Meta,{px:2,borderRadius:999,fontSize:12,fontWeight:600,lineHeight:20,bgColor:`currentColor/10`,alignSelf:`center`,children:t.count})]})}y.displayName=`DataGridListGroup`;var b=(0,h.memo)(y);function x(e){let{row:n,column:r}=e,i=n.cells.find(e=>e.column===r);if(!i)return null;if(r.Cell)return(0,g.jsx)(t.n,{children:(0,g.jsx)(r.Cell,{cell:i})});let{value:a}=i;if(typeof a==`boolean`)return(0,g.jsx)(g.Fragment,{children:a?i.grid.localeText.booleanTrue:i.grid.localeText.booleanFalse});let o=l.u(r,a);return o&&a!=null&&a!==``?(0,g.jsx)(l.l,{value:a,format:o}):(0,g.jsx)(g.Fragment,{children:a==null||a===``?`—`:String(a)})}x.displayName=`DataGridListValue`;function S(t){let{row:n,index:i,position:a,setSize:s}=t,{grid:u}=n,{list:f}=u,{title:h,kicker:_,subtitle:v,end:y,fields:b}=f.layout.value,{selecting:S}=f,C=f.recordViewEnabled&&!n.placeholder,w=l.p(n)?n:void 0,T=u.props.def.rowDetail,E=u.localeText,D={"aria-posinset":a,"aria-setsize":s};if(n.placeholder)return(0,g.jsx)(d.default.Item,{props:{...D,"aria-busy":!0},children:(0,g.jsx)(p.default,{lines:2,flex1:!0})});let O=h?(0,g.jsx)(x,{row:n,column:h}):E.unnamedRow(n.rowIndex+1),k=h?String(n.cells.find(e=>e.column===h)?.value??``):``,A=f.checkboxId(n.key);return(0,g.jsxs)(d.default.Item,{ai:`start`,selected:!!u.props.def.rowSelection&&n.selected,chevron:C&&!S,ps:w?4+Math.min(w.level,3)*4:void 0,props:{...D,"data-list-key":String(n.key)},children:[S&&(0,g.jsx)(d.default.Actions,{width:6,jc:`center`,alignSelf:`center`,children:(0,g.jsx)(o.default,{id:A,variant:`datagrid`,checked:n.selected,indeterminate:n.indeterminate,onChange:n.toggleSelection})}),(0,g.jsxs)(d.default.Content,{children:[_&&(0,g.jsx)(d.default.Overline,{lines:1,children:(0,g.jsx)(x,{row:n,column:_})}),(0,g.jsxs)(d.default.Row,{ai:`start`,gap:3,children:[(0,g.jsxs)(d.default.Row,{jc:`start`,ai:`center`,gap:1,flex1:!0,children:[w?.hasChildren&&(0,g.jsx)(d.default.Actions,{ms:-2,children:(0,g.jsx)(r.default,{type:`button`,component:`${u.componentName}.list.toggle`,...m.t.ICON_BUTTON,width:8,height:8,onClick:w.toggleTree,props:{"aria-expanded":w.treeExpanded,"aria-label":(w.treeExpanded?E.collapseTreeRow:E.expandTreeRow)(k||E.unnamedRow(n.rowIndex+1))},children:(0,g.jsx)(l.f,{width:`16px`,height:`16px`,rotate:w.treeExpanded?0:-90,rtl:{rotate:w.treeExpanded?0:90}})})}),(0,g.jsx)(d.default.Title,{lines:1,flex1:!0,fontWeight:600,children:S?(0,g.jsx)(d.default.Action,{props:{htmlFor:A},children:O}):C?(0,g.jsx)(d.default.Action,{props:{"aria-haspopup":`dialog`},onClick:()=>f.openRecord(n,i),children:O}):O})]}),y&&(0,g.jsxs)(d.default.End,{fontSize:16,fontWeight:600,lineHeight:22,...m.t.TRUNCATE,children:[(0,g.jsx)(x,{row:n,column:y}),(0,g.jsx)(d.default.Meta,{fontWeight:400,...m.t.LABEL,children:y.header??String(y.key)})]})]}),v.length>0&&(0,g.jsx)(d.default.Description,{lines:1,children:v.map((e,t)=>(0,g.jsxs)(c.Span,{children:[t>0&&` · `,(0,g.jsx)(x,{row:n,column:e})]},e.key))}),b.length>0&&(0,g.jsx)(d.default.Fields,{mt:2,css:{gridTemplateColumns:`repeat(2, minmax(0, 1fr))`},children:b.map(t=>(0,g.jsx)(d.default.Field,{label:t.header??String(t.key),children:(0,g.jsx)(e.default,{...m.t.TRUNCATE,children:(0,g.jsx)(x,{row:n,column:t})})},t.key))}),T&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(d.default.Actions,{alignSelf:`start`,mt:1,ms:-2,children:(0,g.jsxs)(r.default,{type:`button`,component:`${u.componentName}.list.toggle`,display:`inline-flex`,ai:`center`,gap:1,minHeight:8,px:2,borderRadius:2,fontSize:13,fontWeight:500,cursor:`pointer`,onClick:n.toggleDetail,props:{"aria-expanded":n.expanded},children:[(0,g.jsx)(l.f,{width:`14px`,height:`14px`,rotate:n.expanded?0:-90,rtl:{rotate:n.expanded?0:90}}),E.details]})}),n.expanded&&(0,g.jsx)(d.default.Actions,{display:`block`,mt:2,children:(0,g.jsx)(e.default,{component:`${u.componentName}.list.detail`,p:3,borderRadius:2,fontSize:14,children:T.content(n.data)})})]})]})]})}S.displayName=`DataGridListItem`;var C=(0,h.memo)(S);function w(e){return(0,g.jsx)(n.Svg,{viewBox:`0 0 24 24`,width:`1.25rem`,fill:`none`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,g.jsx)(n.Path,{d:`M6 6l12 12M18 6L6 18`,strokeLinecap:`round`})})}var T=80;function E(n){let{grid:i,open:o,onOpen:s,onClose:c,title:l,trigger:d,actions:f,footer:p,tall:_,bodyProps:v,bodyRef:y,onKeyDown:b,children:x}=n,S=i.componentName,C=`${S}.list.sheet.line`,E=(0,h.useRef)(null),D=(0,h.useCallback)(e=>{let t=e.currentTarget.closest(`dialog`);e.button!==0||!t||e.target.closest(`button`)||(E.current={id:e.pointerId,y:e.clientY,dy:0,dialog:t},e.currentTarget.setPointerCapture(e.pointerId))},[]),O=(0,h.useCallback)(e=>{let t=E.current;if(!t||t.id!==e.pointerId)return;let{dialog:n}=t;t.dy=Math.max(0,e.clientY-t.y),n.style.transition=`none`,n.style.translate=`0 ${t.dy}px`},[]),k=(0,h.useCallback)(()=>{let e=E.current;if(E.current=null,!e)return;let{dialog:t}=e;t.style.transition=``,t.style.translate=``,e.dy>T&&c()},[c]);return(0,g.jsx)(t.t,{children:(0,g.jsxs)(u.default,{component:`${S}.list.sheet`,display:`flex`,d:`column`,css:_?{minHeight:`min(32rem, calc(100dvh - 2rem))`}:void 0,open:o,onOpenChange:e=>e?s?.():c(),trigger:d,props:{onKeyDown:b},children:[(0,g.jsxs)(a.default,{d:`column`,flexShrink:0,css:{touchAction:`none`},props:{onPointerDown:D,onPointerMove:O,onPointerUp:k,onPointerCancel:k},children:[(0,g.jsx)(e.default,{width:9,height:1.25,mt:2,mx:`auto`,borderRadius:999,bgColor:`base-300`,theme:{dark:{bgColor:`base-600`}},props:{"aria-hidden":!0}}),(0,g.jsxs)(a.default,{component:`${C}`,ai:`center`,gap:2,ps:4,pe:2,py:2,bb:1,children:[(0,g.jsx)(u.default.Title,{flex1:!0,minWidth:0,m:0,fontSize:17,fontWeight:600,lineHeight:24,...m.t.TRUNCATE,children:l}),f,(0,g.jsx)(r.default,{type:`button`,component:`${S}.list.sheet.button`,...m.t.ICON_BUTTON,onClick:c,props:{"aria-label":i.localeText.close},children:(0,g.jsx)(w,{})})]})]}),(0,g.jsx)(e.default,{ref:y,flex1:!0,overflowY:`auto`,px:4,py:2,css:{overscrollBehavior:`contain`,touchAction:`pan-y`},props:v,children:x}),p&&(0,g.jsx)(a.default,{component:C,gap:3,flexShrink:0,px:4,pt:3,pb:4,bt:1,children:p})]})})}E.displayName=`DataGridListSheet`;var D=60;function O({cell:t,index:n}){let{grid:i,column:o}=t,s=i.componentName,c=String(o.header??o.key),{editing:u}=t,d=(0,h.useRef)(null),f=(0,h.useRef)(!1);return(0,h.useEffect)(()=>{f.current&&!u&&d.current?.focus(),f.current=u},[u]),(0,g.jsxs)(e.default,{component:`${s}.list.sheet.line`,py:3,bb:1,children:[(0,g.jsx)(e.default,{tag:`dt`,component:`list.muted`,fontSize:13,lineHeight:18,children:c}),(0,g.jsxs)(e.default,{tag:`dd`,display:`flex`,ai:`center`,gap:2,m:0,fontSize:16,lineHeight:24,css:{fontVariantNumeric:`tabular-nums`,overflowWrap:`anywhere`},children:[u?(0,g.jsx)(a.default,{component:`${s}.list.sheet.input`,...m.t.INPUT,flex1:!0,ai:`center`,px:1,children:(0,g.jsx)(l.d,{cell:t,row:-1,columnIndex:n})}):(0,g.jsx)(e.default,{flex1:!0,minWidth:0,children:(0,g.jsx)(x,{row:t.row,column:o})}),t.editable&&!u&&(0,g.jsx)(r.default,{ref:d,type:`button`,component:`${s}.list.sheet.button`,...m.t.SHEET_BUTTON,height:10,onClick:()=>t.beginEdit(),props:{"aria-label":i.localeText.editCell(c)},children:i.localeText.edit})]})]})}function k(n){let{grid:i}=n,{list:s}=i,u=i.componentName,d=i.localeText,f=s.record,p=s.recordPosition,{title:_}=s.layout.value,v=(0,h.useRef)(null),y=(0,h.useRef)(null),b=f?.key;(0,h.useEffect)(()=>{y.current?.scrollTo?.({top:0})},[b]);let S=(0,h.useCallback)(()=>{let e=s.record?.key;i.edits.cancel(),s.closeRecord(),requestAnimationFrame(()=>{let t=i.sizingElement?.querySelectorAll(`[data-list-key]`)??[];Array.from(t).find(t=>t.dataset.listKey===String(e))?.querySelector(`[data-list-action]`)?.focus()})},[i,s]),C=(0,h.useCallback)(e=>{i.edits.isOpen&&i.edits.commit(),i.edits.isOpen||s.stepRecord(e)},[i,s]),w=e=>{v.current=e.pointerType===`touch`?{x:e.clientX,y:e.clientY}:null},T=e=>{let t=v.current;if(v.current=null,!t)return;let n=e.clientX-t.x,r=e.clientY-t.y;Math.abs(n)<D||Math.abs(n)<Math.abs(r)*1.5||C(n<0===i.isRtl?-1:1)},k=e=>{if(e.target.closest(`input,select,textarea,[role="combobox"]`))return;let t=i.isRtl?`ArrowLeft`:`ArrowRight`,n=i.isRtl?`ArrowRight`:`ArrowLeft`;(e.key===t||e.key===n)&&(e.preventDefault(),C(e.key===t?1:-1))},A=f&&p&&(0,g.jsxs)(a.default,{ai:`center`,gap:.5,flexShrink:0,children:[(0,g.jsx)(r.default,{type:`button`,component:`${u}.list.sheet.button`,...m.t.ICON_BUTTON,disabled:!s.hasPreviousRecord,onClick:()=>C(-1),props:{"aria-label":d.previousRow},children:(0,g.jsx)(l.f,{width:`18px`,height:`18px`,rotate:90,rtl:{rotate:-90}})}),(0,g.jsx)(e.default,{fontSize:13,color:`base-500`,textWrap:`nowrap`,css:{fontVariantNumeric:`tabular-nums`},props:{"aria-live":`polite`},children:d.recordPosition(p.position,p.total)}),(0,g.jsx)(r.default,{type:`button`,component:`${u}.list.sheet.button`,...m.t.ICON_BUTTON,disabled:!s.hasNextRecord,onClick:()=>C(1),props:{"aria-label":d.nextRow},children:(0,g.jsx)(l.f,{width:`18px`,height:`18px`,rotate:-90,rtl:{rotate:90}})})]}),j=i.props.def.rowDetail;return(0,g.jsx)(E,{grid:i,open:!!f,onClose:S,tall:!0,title:f&&_?(0,g.jsx)(x,{row:f,column:_}):``,actions:A,onKeyDown:k,bodyRef:y,bodyProps:{onPointerDown:w,onPointerUp:T},children:f&&(0,g.jsxs)(g.Fragment,{children:[i.props.def.rowSelection&&(0,g.jsx)(e.default,{py:3,children:(0,g.jsx)(o.default,{variant:`datagrid`,checked:f.selected,onChange:f.toggleSelection,label:d.selectRow(f.rowIndex+1),labelProps:{display:`flex`,ai:`center`,gap:3,fontSize:15}})}),(0,g.jsx)(e.default,{tag:`dl`,m:0,children:s.recordColumns.map(e=>{let t=f.cells.findIndex(t=>t.column===e);return t===-1?null:(0,g.jsx)(O,{cell:f.cells[t],index:t},e.key)})}),j&&(0,g.jsxs)(a.default,{d:`column`,gap:2,py:3,children:[(0,g.jsx)(c.H3,{m:0,fontSize:14,fontWeight:600,children:d.details}),(0,g.jsx)(t.n,{children:j.content(f.data)})]})]})})}k.displayName=`DataGridListRecord`;function A(t){let{grid:n}=t,i=n.componentName,o=n.localeText,s=n.selectedRows.size;return!n.props.def.rowSelection||s===0?null:(0,g.jsxs)(a.default,{component:`${i}.list.selectionBar`,position:`sticky`,bottom:0,zIndex:2,ai:`center`,gap:2,px:4,py:2,fontSize:14,fontWeight:500,children:[(0,g.jsx)(e.default,{flex1:!0,minWidth:0,textWrap:`nowrap`,css:{fontVariantNumeric:`tabular-nums`},children:o.selectedRows(s)}),!n.allRowsSelected&&(0,g.jsx)(r.default,{type:`button`,minHeight:10,px:3,borderRadius:2,fontSize:14,fontWeight:500,cursor:`pointer`,active:{bgColor:`white/15`},theme:{dark:{active:{bgColor:`black/10`}}},onClick:n.toggleSelectAllRows,children:o.selectAll}),(0,g.jsx)(r.default,{type:`button`,minHeight:10,px:3,borderRadius:2,fontSize:14,fontWeight:500,cursor:`pointer`,active:{bgColor:`white/15`},theme:{dark:{active:{bgColor:`black/10`}}},onClick:n.clearSelection,children:o.clearSelection})]})}A.displayName=`DataGridListSelectionBar`;function j(e){return(0,g.jsx)(n.Svg,{viewBox:`0 0 24 24`,width:`1rem`,fill:`none`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,g.jsx)(n.Path,{d:`M4 6h16M7 12h10M10 18h4`,strokeLinecap:`round`})})}var M=8,N=[{value:`eq`,label:`=`},{value:`ne`,label:`≠`},{value:`gt`,label:`>`},{value:`gte`,label:`≥`},{value:`lt`,label:`<`},{value:`lte`,label:`≤`},{value:`between`,label:`↔`}];function P({column:e}){let{currentFilter:t}=e,n=e.grid.componentName,r=e.grid.localeText,[i,a]=(0,h.useState)(t?.type===`text`?t.value:``),{debounce:o}=l.s(t,e=>l.c.textMatches(i,e),e=>a(e?.type===`text`?e.value:``));return(0,g.jsx)(s.default,{component:`${n}.list.sheet.input`,...m.t.INPUT,type:`search`,value:i,placeholder:e.filterConfig?.placeholder??r.filterPlaceholder,onChange:t=>{let n=t.target.value;a(n),o(`value`,()=>e.setTextFilter(n))},props:{"aria-label":r.filterColumn(String(e.header??e.key))}})}function F({column:t}){let{currentFilter:n}=t,r=t.grid.componentName,i=t.grid.localeText,o=String(t.header??t.key),c=t.filterConfig,[u,d]=(0,h.useState)(()=>l.c.numberDraft(n)),f=(0,h.useRef)(u),p=(0,h.useCallback)(e=>{f.current=e,d(e)},[]),{debounce:_,cancel:v}=l.s(n,e=>l.c.numberMatches(u,e),e=>p(l.c.numberDraft(e))),y=(e,n)=>{p({...f.current,...e});let r=()=>t.setNumberFilter(f.current.operator,f.current.value,f.current.valueTo);n?_(`value`,r):(v(),r())},b=(e,t,n,i)=>(0,g.jsx)(s.default,{component:`${r}.list.sheet.input`,...m.t.INPUT,type:`number`,value:e,step:c?.step,placeholder:n,onChange:e=>y({[i]:e.target.value},!0),props:{"aria-label":t,inputMode:`decimal`,min:c?.min,max:c?.max}});return(0,g.jsxs)(a.default,{gap:2,ai:`center`,children:[(0,g.jsx)(e.default,{tag:`select`,component:`${r}.list.sheet.input`,...m.t.INPUT,width:18,flexShrink:0,props:{value:u.operator,"aria-label":i.filterComparison(o),onChange:e=>y({operator:e.target.value},!1)},children:N.map(e=>(0,g.jsx)(`option`,{value:e.value,children:e.label},e.value))}),b(u.value,u.operator===`between`?i.filterFrom(o):i.filterColumn(o),u.operator===`between`?i.filterFromPlaceholder:c?.placeholder??i.filterValuePlaceholder,`value`),u.operator===`between`&&b(u.valueTo,i.filterTo(o),i.filterToPlaceholder,`valueTo`)]})}function I({column:e}){let t=l.m(!0);return t?(0,g.jsx)(t.ListDateFilter,{column:e}):null}function L({column:e}){let{currentFilter:t}=e,n=e.grid.componentName,i=e.grid.localeText,c=t?.type===`multiselect`?t.values:[],l=e.filterOptions,[u,d]=(0,h.useState)(``),f=t=>{e.setMultiselectFilter(c.includes(t)?c.filter(e=>e!==t):[...c,t])};if(l.length<=M)return(0,g.jsx)(a.default,{flexWrap:`wrap`,gap:2,children:l.map(e=>(0,g.jsx)(r.default,{type:`button`,component:`${n}.list.sheet.chip`,display:`inline-flex`,ai:`center`,minHeight:10,px:3.5,borderRadius:999,fontSize:14,cursor:`pointer`,onClick:()=>f(e.value),props:{"aria-pressed":c.includes(e.value)},children:e.label},String(e.value)))});let p=u.trim().toLocaleLowerCase(),_=p?l.filter(e=>e.label.toLocaleLowerCase().includes(p)):l;return(0,g.jsxs)(a.default,{d:`column`,gap:2,children:[(0,g.jsx)(s.default,{component:`${n}.list.sheet.input`,...m.t.INPUT,type:`search`,value:u,placeholder:i.filterSelectSearchPlaceholder,onChange:e=>d(e.target.value),props:{"aria-label":i.filterColumn(String(e.header??e.key))}}),(0,g.jsx)(a.default,{d:`column`,maxHeight:64,overflowY:`auto`,children:_.map(e=>(0,g.jsx)(o.default,{checked:c.includes(e.value),onChange:()=>f(e.value),label:e.label,labelProps:{component:`${n}.list.sheet.line`,display:`flex`,ai:`center`,gap:3,minHeight:12,fontSize:16,bb:1}},String(e.value)))})]})}function R(e){let{column:t}=e;switch(t.filterConfig?.type){case void 0:return null;case`number`:return(0,g.jsx)(F,{column:t});case`multiselect`:return(0,g.jsx)(L,{column:t});case`date`:return(0,g.jsx)(I,{column:t});default:return(0,g.jsx)(P,{column:t})}}R.displayName=`DataGridListFilter`;function z(t){let{grid:n}=t,{list:i}=n,o=n.componentName,s=n.localeText,l=i.activeFilters.length,u=i.filterableColumns;return u.length===0?null:(0,g.jsx)(E,{grid:n,open:i.sheet===`filter`,onOpen:()=>i.openSheet(`filter`),onClose:()=>i.openSheet(null),title:s.filters,trigger:({ref:t,props:{onClick:n,...i}})=>(0,g.jsxs)(r.default,{type:`button`,component:`${o}.list.toolbar.button`,variant:{active:l>0},...m.t.PILL,ref:t,onClick:n,props:{...i,"aria-label":s.filtersLabel(l)},children:[(0,g.jsx)(j,{}),s.filters,l>0&&(0,g.jsx)(e.default,{tag:`span`,minWidth:5,height:5,px:1.5,borderRadius:999,bgColor:`accent-600`,color:`white`,fontSize:12,fontWeight:600,lineHeight:20,textAlign:`center`,props:{"aria-hidden":!0},children:l})]}),footer:(0,g.jsxs)(g.Fragment,{children:[l>0&&(0,g.jsx)(r.default,{type:`button`,component:`${o}.list.sheet.button`,...m.t.SHEET_BUTTON,onClick:n.clearColumnFilters,children:s.clearFilters}),(0,g.jsx)(r.default,{type:`button`,component:`${o}.list.sheet.primary`,...m.t.SHEET_BUTTON,flex1:!0,fontWeight:600,onClick:()=>i.openSheet(null),children:s.showRows(n.filterStats.filtered)})]}),children:u.map(e=>(0,g.jsxs)(a.default,{component:`${o}.list.sheet.line`,d:`column`,gap:2,py:3,bb:1,children:[(0,g.jsx)(c.H3,{m:0,fontSize:14,fontWeight:600,children:e.header??String(e.key)}),(0,g.jsx)(R,{column:e})]},e.key))})}z.displayName=`DataGridListFilterSheet`;function B(e){let{grid:t}=e,{list:n}=t,i=t.componentName,o=t.localeText,s=n.sortedColumn,c=t.sortDirection===`DESC`,u=`${t.identifier}-sort`,d={component:`${i}.list.sheet.line`,display:`flex`,ai:`center`,gap:3,minHeight:12,fontSize:16,cursor:`pointer`,bb:1};return(0,g.jsxs)(E,{grid:t,open:n.sheet===`sort`,onClose:()=>n.openSheet(null),title:o.sortBy,onOpen:()=>n.openSheet(`sort`),trigger:({ref:e,props:{onClick:t,...n}})=>(0,g.jsxs)(r.default,{type:`button`,component:`${i}.list.toolbar.button`,variant:{active:!!s},...m.t.PILL,ref:e,onClick:t,props:n,children:[(0,g.jsx)(l.o,{width:`16px`,height:`16px`,fill:`currentColor`,rotate:c?180:0}),s?o.sortedBy(String(s.header??s.key),c):o.sortBy]}),footer:(0,g.jsxs)(g.Fragment,{children:[s&&(0,g.jsx)(r.default,{type:`button`,component:`${i}.list.sheet.button`,...m.t.SHEET_BUTTON,onClick:()=>t.setSortColumn(s.key,void 0),children:o.clearSort}),(0,g.jsx)(r.default,{type:`button`,component:`${i}.list.sheet.primary`,...m.t.SHEET_BUTTON,flex1:!0,fontWeight:600,onClick:()=>n.openSheet(null),children:o.close})]}),children:[(0,g.jsx)(a.default,{tag:`fieldset`,d:`column`,b:0,m:0,p:0,props:{"aria-label":o.sortBy},children:n.sortableColumns.map(e=>(0,g.jsx)(f.default,{name:u,checked:s===e,onChange:()=>t.setSortColumn(e.key,c&&s?`DESC`:`ASC`),label:e.header??String(e.key),labelProps:d},e.key))}),s&&(0,g.jsx)(a.default,{tag:`fieldset`,d:`column`,b:0,m:0,p:0,pt:4,props:{"aria-label":`${o.sortBy}: ${s.header??s.key}`},children:[`ASC`,`DESC`].map(e=>(0,g.jsx)(f.default,{name:`${u}-direction`,checked:t.sortDirection===e,onChange:()=>t.setSortColumn(s.key,e),label:e===`ASC`?o.ascending:o.descending,labelProps:d},e))})]})}B.displayName=`DataGridListSortSheet`;function V({grid:e}){let t=e.componentName,[n,i]=(0,h.useState)(e.globalFilterValue),{debounce:o,cancel:c}=l.s(e.globalFilterValue,e=>e===n,i);return(0,g.jsxs)(a.default,{position:`relative`,ai:`center`,children:[(0,g.jsx)(a.default,{position:`absolute`,insetStart:3.5,pointerEvents:`none`,color:`base-500`,props:{"aria-hidden":!0},children:(0,g.jsx)(l.r,{fill:`currentColor`,width:`16px`})}),(0,g.jsx)(s.default,{component:`${t}.list.toolbar.search`,width:`fit`,height:11,ps:10,pe:10,b:0,borderRadius:3,fontSize:16,type:`search`,value:n,placeholder:e.localeText.searchPlaceholder,onChange:t=>{let n=t.target.value;i(n),o(`value`,()=>e.filter.setGlobalFilter(n))},props:{"aria-label":e.localeText.searchPlaceholder,enterKeyHint:`search`}}),n&&(0,g.jsx)(r.default,{type:`button`,component:`${t}.list.sheet.button`,display:`inline-flex`,ai:`center`,jc:`center`,width:7,height:7,borderRadius:999,cursor:`pointer`,position:`absolute`,insetEnd:2,onClick:()=>{c(),i(``),e.filter.setGlobalFilter(``)},props:{"aria-label":e.localeText.clearSearch},children:(0,g.jsx)(w,{width:`16px`})})]})}function H(t){let{grid:n}=t,{list:o}=n,{def:s}=n.props,c=n.componentName,u=n.localeText,{filtered:d,total:f}=n.filterStats,p=o.activeFilters,h=o.sortableColumns.length>0;return(0,g.jsxs)(a.default,{component:`${c}.list.toolbar`,d:`column`,gap:3,px:4,pt:4,pb:3,children:[(0,g.jsxs)(a.default,{ai:`center`,gap:3,flexWrap:`wrap`,children:[(0,g.jsxs)(a.default,{d:`column`,flex1:!0,minWidth:0,children:[s.title&&(0,g.jsx)(e.default,{id:n.titleId,fontSize:17,fontWeight:600,lineHeight:24,children:s.title}),(0,g.jsx)(e.default,{component:`${c}.list.toolbar.count`,fontSize:13,css:{fontVariantNumeric:`tabular-nums`},children:u.rowCount(d,f)})]}),s.topBar&&(0,g.jsxs)(a.default,{ai:`center`,gap:2,flexWrap:`wrap`,children:[(0,g.jsx)(l.n,{grid:n}),(0,g.jsx)(l.t,{grid:n})]})]}),s.globalFilter&&(0,g.jsx)(V,{grid:n}),(0,g.jsxs)(a.default,{gap:2,overflowX:`auto`,scrollbarWidth:`none`,mx:-4,px:4,children:[h&&(0,g.jsx)(B,{grid:n}),(0,g.jsx)(z,{grid:n}),s.rowSelection&&(0,g.jsx)(r.default,{type:`button`,component:`${c}.list.toolbar.button`,...m.t.PILL,variant:{active:o.selecting},onClick:()=>o.setSelecting(!o.selecting),props:{"aria-pressed":o.selecting},children:u.selectRows})]}),p.length>0&&(0,g.jsx)(a.default,{gap:2,overflowX:`auto`,scrollbarWidth:`none`,mx:-4,px:4,children:p.map(t=>(0,g.jsxs)(e.default,{tag:`span`,component:`${c}.list.toolbar.chip`,display:`inline-flex`,ai:`center`,gap:1,flexShrink:0,height:8,ps:3,pe:1,borderRadius:999,fontSize:13,textWrap:`nowrap`,children:[(0,g.jsxs)(e.default,{tag:`span`,fontWeight:500,children:[t.label,`:`]}),(0,g.jsx)(e.default,{tag:`span`,children:t.value}),(0,g.jsx)(r.default,{type:`button`,component:`${c}.list.sheet.button`,display:`inline-flex`,ai:`center`,jc:`center`,width:7,height:7,borderRadius:999,cursor:`pointer`,onClick:()=>t.column.clearFilter(),props:{"aria-label":u.clearFilter(t.label)},children:(0,g.jsx)(w,{width:`14px`})})]},t.column.key))}),s.topBarContent&&(0,g.jsx)(e.default,{children:s.topBarContent}),(0,g.jsx)(i.default,{props:{role:`status`},children:n.hasActiveFilters?u.rowCount(d,f):``})]})}H.displayName=`DataGridListToolbar`;function U(t){let{grid:n}=t,{list:r,source:i}=n,o=n.componentName,s=r.visibleItems,c=n.props.loading||i.isLoading,u=n.groupColumns.size===0&&!n.tree.enabled,f=i.enabled?n.totalRowCount:n.filterStats.filtered,{queryVersion:p}=i;return(0,h.useEffect)(()=>{i.enabled&&i.request(0,Math.max(s.length,1))},[i,p,s.length,n.page,n.pageSize,n.expansionVersion]),(0,g.jsxs)(a.default,{component:`${o}.list`,d:`column`,children:[(0,g.jsx)(H,{grid:n}),(0,g.jsx)(l.i,{grid:n}),c&&(0,g.jsx)(l.a,{grid:n}),s.length===0?(0,g.jsx)(e.default,{component:`list.muted`,px:4,py:10,textAlign:`center`,children:n.props.def.noDataComponent??(c?n.localeText.loadingRows:n.localeText.noRows)}):(0,g.jsx)(d.default,{props:{"aria-labelledby":n.props.def.title?n.titleId:void 0,"aria-busy":c||void 0},children:s.map(({row:e,index:t},r)=>e.kind===`group`?(0,g.jsx)(b,{row:e,version:n.rowVersion(e,t)},e.key):(0,g.jsx)(C,{row:e,index:t,position:u?r+1:void 0,setSize:u?f:void 0,version:n.rowVersion(e,t)},e.key))}),(0,g.jsx)(v,{grid:n,shown:u?s.length:void 0}),(0,g.jsx)(A,{grid:n}),(0,g.jsx)(k,{grid:n})]})}U.displayName=`DataGridList`,exports.default=U;
|
|
1
|
+
const e=require("./box.cjs"),t=require("./reporting.cjs"),n=require("./components/svg.cjs"),r=require("./components/button.cjs"),i=require("./components/visuallyHidden.cjs"),a=require("./components/flex.cjs"),o=require("./components/checkbox.cjs"),s=require("./components/textbox.cjs"),c=require("./components/semantics.cjs"),l=require("./components/dataGrid.cjs"),u=require("./components/dialog.cjs"),d=require("./components/list.cjs"),f=require("./components/radioButton.cjs"),p=require("./components/skeleton.cjs"),m=require("./dataGridListLayout.cjs");let h=require("react"),g=require("react/jsx-runtime");function _(e){let{cell:t}=e,{AggregateCell:n}=t.column;return n?(0,g.jsx)(n,{cell:t}):(0,g.jsx)(g.Fragment,{children:t.value??`—`})}_.displayName=`DataGridListAggregate`;function v(t){let{grid:n,shown:i}=t,{list:o,pagination:s,aggregation:c}=n,u=n.componentName,d=n.localeText,f=s.state,p=c.hasFooter?c.footerCells.value.filter(e=>e.column.aggregate):[];return(0,g.jsxs)(g.Fragment,{children:[p.length>0&&(0,g.jsxs)(e.default,{bgColor:`currentColor/3`,px:4,py:3,children:[(0,g.jsx)(e.default,{fontWeight:600,fontSize:14,mb:1,children:c.footerLabel}),(0,g.jsx)(e.default,{tag:`dl`,display:`grid`,gridTemplateColumns:2,columnGap:4,rowGap:2,m:0,children:p.map(t=>(0,g.jsxs)(e.default,{minWidth:0,children:[(0,g.jsx)(e.default,{tag:`dt`,component:`list.muted`,fontSize:12,lineHeight:16,children:t.column.header??String(t.column.key)}),(0,g.jsx)(e.default,{tag:`dd`,m:0,fontSize:14,lineHeight:20,fontWeight:600,children:(0,g.jsx)(_,{cell:t})})]},t.column.key))})]}),f?(0,g.jsx)(a.default,{component:`list.muted`,d:`column`,gap:2,ai:`center`,px:4,py:4,fontSize:13,css:{fontVariantNumeric:`tabular-nums`},children:(0,g.jsxs)(a.default,{ai:`center`,jc:`space-between`,gap:3,width:`fit`,children:[(0,g.jsx)(r.default,{type:`button`,component:`${u}.list.button`,...m.t.ICON_BUTTON,borderRadius:3,disabled:!s.canGoPrev,onClick:s.prevPage,props:{"aria-label":d.previousPage},children:(0,g.jsx)(l.f,{width:`18px`,height:`18px`,rotate:90,rtl:{rotate:-90}})}),(0,g.jsx)(e.default,{textAlign:`center`,children:d.pageRowRange(s.startItem,s.endItem,s.totalItems)}),(0,g.jsx)(r.default,{type:`button`,component:`${u}.list.button`,...m.t.ICON_BUTTON,borderRadius:3,disabled:!s.canGoNext,onClick:s.nextPage,props:{"aria-label":d.nextPage},children:(0,g.jsx)(l.f,{width:`18px`,height:`18px`,rotate:-90,rtl:{rotate:90}})})]})}):(o.hasMore||i!==void 0)&&(0,g.jsxs)(a.default,{component:`list.muted`,d:`column`,gap:2,ai:`center`,px:4,py:4,fontSize:13,css:{fontVariantNumeric:`tabular-nums`},children:[o.hasMore&&(0,g.jsx)(r.default,{type:`button`,component:`${u}.list.button`,width:`fit`,height:11,borderRadius:3,fontSize:15,fontWeight:500,color:`accent-600`,cursor:`pointer`,theme:{dark:{color:`accent-300`}},onClick:o.showMore,children:d.showMore(o.nextBatch)}),i!==void 0&&(0,g.jsx)(e.default,{children:d.shownCount(i,n.source.enabled?n.totalRowCount:n.filterStats.filtered)})]})]})}v.displayName=`DataGridListFooter`;function y(e){let{row:t}=e,{grid:n}=t,r=t.cells.flatMap(e=>e.aggregate?[e.aggregate]:[]),i=t.placeholder?``:String(t.groupValue);return(0,g.jsxs)(d.default.Item,{size:`sm`,bgColor:`currentColor/3`,ps:4+Math.min(t.depth,3)*4,props:{"aria-busy":t.placeholder||void 0},children:[n.list.selecting&&t.selectable&&(0,g.jsx)(d.default.Actions,{children:(0,g.jsx)(o.default,{variant:`datagrid`,checked:t.selected,indeterminate:t.indeterminate,onChange:t.toggleSelectAll,props:{"aria-label":n.localeText.selectGroupRows(i)}})}),(0,g.jsx)(l.f,{width:`16px`,height:`16px`,flexShrink:0,rotate:t.expanded?0:-90,rtl:{rotate:t.expanded?0:90}}),(0,g.jsxs)(d.default.Content,{children:[(0,g.jsx)(d.default.Title,{lines:1,fontSize:14,fontWeight:600,children:(0,g.jsx)(d.default.Action,{onClick:()=>t.toggleRow(),props:{"aria-expanded":t.expanded},children:i})}),r.length>0&&(0,g.jsx)(d.default.Row,{secondary:!0,wrap:!0,columnGap:4,fontSize:13,css:{fontVariantNumeric:`tabular-nums`},children:r.map(e=>(0,g.jsxs)(c.Span,{display:`inline-flex`,gap:1,children:[(0,g.jsx)(c.Span,{children:e.column.header??String(e.column.key)}),(0,g.jsx)(c.Span,{fontWeight:600,children:(0,g.jsx)(_,{cell:e})})]},e.column.key))})]}),(0,g.jsx)(d.default.Meta,{px:2,borderRadius:999,fontSize:12,fontWeight:600,lineHeight:20,bgColor:`currentColor/10`,alignSelf:`center`,children:t.count})]})}y.displayName=`DataGridListGroup`;var b=(0,h.memo)(y);function x(e){let{row:n,column:r}=e,i=n.cells.find(e=>e.column===r);if(!i)return null;if(r.Cell)return(0,g.jsx)(t.n,{children:(0,g.jsx)(r.Cell,{cell:i})});let{value:a}=i;if(typeof a==`boolean`)return(0,g.jsx)(g.Fragment,{children:a?i.grid.localeText.booleanTrue:i.grid.localeText.booleanFalse});let o=l.u(r,a);return o&&a!=null&&a!==``?(0,g.jsx)(l.l,{value:a,format:o}):(0,g.jsx)(g.Fragment,{children:a==null||a===``?`—`:String(a)})}x.displayName=`DataGridListValue`;function S(t){let{row:n,index:i,position:a,setSize:s}=t,{grid:u}=n,{list:f}=u,{title:h,kicker:_,subtitle:v,end:y,fields:b}=f.layout.value,{selecting:S}=f,C=f.recordViewEnabled&&!n.placeholder,w=l.p(n)?n:void 0,T=u.props.def.rowDetail,E=u.localeText,D={"aria-posinset":a,"aria-setsize":s};if(n.placeholder)return(0,g.jsx)(d.default.Item,{props:{...D,"aria-busy":!0},children:(0,g.jsx)(p.default,{lines:2,flex1:!0})});let O=h?(0,g.jsx)(x,{row:n,column:h}):E.unnamedRow(n.rowIndex+1),k=h?String(n.cells.find(e=>e.column===h)?.value??``):``,A=f.checkboxId(n.key);return(0,g.jsxs)(d.default.Item,{ai:`start`,selected:!!u.props.def.rowSelection&&n.selected,chevron:C&&!S,ps:w?4+Math.min(w.level,3)*4:void 0,props:{...D,"data-list-key":String(n.key)},children:[S&&(0,g.jsx)(d.default.Actions,{width:6,jc:`center`,alignSelf:`center`,children:(0,g.jsx)(o.default,{id:A,variant:`datagrid`,checked:n.selected,indeterminate:n.indeterminate,onChange:n.toggleSelection})}),(0,g.jsxs)(d.default.Content,{children:[_&&(0,g.jsx)(d.default.Overline,{lines:1,children:(0,g.jsx)(x,{row:n,column:_})}),(0,g.jsxs)(d.default.Row,{ai:`start`,gap:3,children:[(0,g.jsxs)(d.default.Row,{jc:`start`,ai:`center`,gap:1,flex1:!0,children:[w?.hasChildren&&(0,g.jsx)(d.default.Actions,{ms:-2,children:(0,g.jsx)(r.default,{type:`button`,component:`${u.componentName}.list.toggle`,...m.t.ICON_BUTTON,width:8,height:8,onClick:w.toggleTree,props:{"aria-expanded":w.treeExpanded,"aria-label":(w.treeExpanded?E.collapseTreeRow:E.expandTreeRow)(k||E.unnamedRow(n.rowIndex+1))},children:(0,g.jsx)(l.f,{width:`16px`,height:`16px`,rotate:w.treeExpanded?0:-90,rtl:{rotate:w.treeExpanded?0:90}})})}),(0,g.jsx)(d.default.Title,{lines:1,flex1:!0,fontWeight:600,children:S?(0,g.jsx)(d.default.Action,{props:{htmlFor:A},children:O}):C?(0,g.jsx)(d.default.Action,{props:{"aria-haspopup":`dialog`},onClick:()=>f.openRecord(n,i),children:O}):O})]}),y&&(0,g.jsxs)(d.default.End,{fontSize:16,fontWeight:600,lineHeight:22,...m.t.TRUNCATE,children:[(0,g.jsx)(x,{row:n,column:y}),(0,g.jsx)(d.default.Meta,{fontWeight:400,...m.t.LABEL,children:y.header??String(y.key)})]})]}),v.length>0&&(0,g.jsx)(d.default.Description,{lines:1,children:v.map((e,t)=>(0,g.jsxs)(c.Span,{children:[t>0&&` · `,(0,g.jsx)(x,{row:n,column:e})]},e.key))}),b.length>0&&(0,g.jsx)(d.default.Fields,{mt:2,css:{gridTemplateColumns:`repeat(2, minmax(0, 1fr))`},children:b.map(t=>(0,g.jsx)(d.default.Field,{label:t.header??String(t.key),children:(0,g.jsx)(e.default,{...m.t.TRUNCATE,children:(0,g.jsx)(x,{row:n,column:t})})},t.key))}),T&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(d.default.Actions,{alignSelf:`start`,mt:1,ms:-2,children:(0,g.jsxs)(r.default,{type:`button`,component:`${u.componentName}.list.toggle`,display:`inline-flex`,ai:`center`,gap:1,minHeight:8,px:2,borderRadius:2,fontSize:13,fontWeight:500,cursor:`pointer`,onClick:n.toggleDetail,props:{"aria-expanded":n.expanded},children:[(0,g.jsx)(l.f,{width:`14px`,height:`14px`,rotate:n.expanded?0:-90,rtl:{rotate:n.expanded?0:90}}),E.details]})}),n.expanded&&(0,g.jsx)(d.default.Actions,{display:`block`,mt:2,children:(0,g.jsx)(e.default,{component:`${u.componentName}.list.detail`,p:3,borderRadius:2,fontSize:14,children:T.content(n.data)})})]})]})]})}S.displayName=`DataGridListItem`;var C=(0,h.memo)(S);function w(e){return(0,g.jsx)(n.Svg,{viewBox:`0 0 24 24`,width:`1.25rem`,fill:`none`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,g.jsx)(n.Path,{d:`M6 6l12 12M18 6L6 18`,strokeLinecap:`round`})})}var T=80;function E(n){let{grid:i,open:o,onOpen:s,onClose:c,title:l,trigger:d,actions:f,footer:p,tall:_,bodyProps:v,bodyRef:y,onKeyDown:b,children:x}=n,S=i.componentName,C=`${S}.list.sheet.line`,E=(0,h.useRef)(null),D=(0,h.useCallback)(e=>{let t=e.currentTarget.closest(`dialog`);e.button!==0||!t||e.target.closest(`button`)||(E.current={id:e.pointerId,y:e.clientY,dy:0,dialog:t},e.currentTarget.setPointerCapture(e.pointerId))},[]),O=(0,h.useCallback)(e=>{let t=E.current;if(!t||t.id!==e.pointerId)return;let{dialog:n}=t;t.dy=Math.max(0,e.clientY-t.y),n.style.transition=`none`,n.style.translate=`0 ${t.dy}px`},[]),k=(0,h.useCallback)(()=>{let e=E.current;if(E.current=null,!e)return;let{dialog:t}=e;t.style.transition=``,t.style.translate=``,e.dy>T&&c()},[c]);return(0,g.jsx)(t.t,{children:(0,g.jsxs)(u.default,{component:`${S}.list.sheet`,display:`flex`,d:`column`,css:_?{minHeight:`min(32rem, calc(100dvh - 2rem))`}:void 0,open:o,onOpenChange:e=>e?s?.():c(),trigger:d,props:{onKeyDown:b},children:[(0,g.jsxs)(a.default,{d:`column`,flexShrink:0,touchAction:`none`,props:{onPointerDown:D,onPointerMove:O,onPointerUp:k,onPointerCancel:k},children:[(0,g.jsx)(e.default,{width:9,height:1.25,mt:2,mx:`auto`,borderRadius:999,bgColor:`base-300`,theme:{dark:{bgColor:`base-600`}},props:{"aria-hidden":!0}}),(0,g.jsxs)(a.default,{component:`${C}`,ai:`center`,gap:2,ps:4,pe:2,py:2,bb:1,children:[(0,g.jsx)(u.default.Title,{flex1:!0,minWidth:0,m:0,fontSize:17,fontWeight:600,lineHeight:24,...m.t.TRUNCATE,children:l}),f,(0,g.jsx)(r.default,{type:`button`,component:`${S}.list.sheet.button`,...m.t.ICON_BUTTON,onClick:c,props:{"aria-label":i.localeText.close},children:(0,g.jsx)(w,{})})]})]}),(0,g.jsx)(e.default,{ref:y,flex1:!0,overflowY:`auto`,px:4,py:2,touchAction:`pan-y`,css:{overscrollBehavior:`contain`},props:v,children:x}),p&&(0,g.jsx)(a.default,{component:C,gap:3,flexShrink:0,px:4,pt:3,pb:4,bt:1,children:p})]})})}E.displayName=`DataGridListSheet`;var D=60;function O({cell:t,index:n}){let{grid:i,column:o}=t,s=i.componentName,c=String(o.header??o.key),{editing:u}=t,d=(0,h.useRef)(null),f=(0,h.useRef)(!1);return(0,h.useEffect)(()=>{f.current&&!u&&d.current?.focus(),f.current=u},[u]),(0,g.jsxs)(e.default,{component:`${s}.list.sheet.line`,py:3,bb:1,children:[(0,g.jsx)(e.default,{tag:`dt`,component:`list.muted`,fontSize:13,lineHeight:18,children:c}),(0,g.jsxs)(e.default,{tag:`dd`,display:`flex`,ai:`center`,gap:2,m:0,fontSize:16,lineHeight:24,css:{fontVariantNumeric:`tabular-nums`,overflowWrap:`anywhere`},children:[u?(0,g.jsx)(a.default,{component:`${s}.list.sheet.input`,...m.t.INPUT,flex1:!0,ai:`center`,px:1,children:(0,g.jsx)(l.d,{cell:t,row:-1,columnIndex:n})}):(0,g.jsx)(e.default,{flex1:!0,minWidth:0,children:(0,g.jsx)(x,{row:t.row,column:o})}),t.editable&&!u&&(0,g.jsx)(r.default,{ref:d,type:`button`,component:`${s}.list.sheet.button`,...m.t.SHEET_BUTTON,height:10,onClick:()=>t.beginEdit(),props:{"aria-label":i.localeText.editCell(c)},children:i.localeText.edit})]})]})}function k(n){let{grid:i}=n,{list:s}=i,u=i.componentName,d=i.localeText,f=s.record,p=s.recordPosition,{title:_}=s.layout.value,v=(0,h.useRef)(null),y=(0,h.useRef)(null),b=f?.key;(0,h.useEffect)(()=>{y.current?.scrollTo?.({top:0})},[b]);let S=(0,h.useCallback)(()=>{let e=s.record?.key;i.edits.cancel(),s.closeRecord(),requestAnimationFrame(()=>{let t=i.sizingElement?.querySelectorAll(`[data-list-key]`)??[];Array.from(t).find(t=>t.dataset.listKey===String(e))?.querySelector(`[data-list-action]`)?.focus()})},[i,s]),C=(0,h.useCallback)(e=>{i.edits.isOpen&&i.edits.commit(),i.edits.isOpen||s.stepRecord(e)},[i,s]),w=e=>{v.current=e.pointerType===`touch`?{x:e.clientX,y:e.clientY}:null},T=e=>{let t=v.current;if(v.current=null,!t)return;let n=e.clientX-t.x,r=e.clientY-t.y;Math.abs(n)<D||Math.abs(n)<Math.abs(r)*1.5||C(n<0===i.isRtl?-1:1)},k=e=>{if(e.target.closest(`input,select,textarea,[role="combobox"]`))return;let t=i.isRtl?`ArrowLeft`:`ArrowRight`,n=i.isRtl?`ArrowRight`:`ArrowLeft`;(e.key===t||e.key===n)&&(e.preventDefault(),C(e.key===t?1:-1))},A=f&&p&&(0,g.jsxs)(a.default,{ai:`center`,gap:.5,flexShrink:0,children:[(0,g.jsx)(r.default,{type:`button`,component:`${u}.list.sheet.button`,...m.t.ICON_BUTTON,disabled:!s.hasPreviousRecord,onClick:()=>C(-1),props:{"aria-label":d.previousRow},children:(0,g.jsx)(l.f,{width:`18px`,height:`18px`,rotate:90,rtl:{rotate:-90}})}),(0,g.jsx)(e.default,{fontSize:13,color:`base-500`,textWrap:`nowrap`,css:{fontVariantNumeric:`tabular-nums`},props:{"aria-live":`polite`},children:d.recordPosition(p.position,p.total)}),(0,g.jsx)(r.default,{type:`button`,component:`${u}.list.sheet.button`,...m.t.ICON_BUTTON,disabled:!s.hasNextRecord,onClick:()=>C(1),props:{"aria-label":d.nextRow},children:(0,g.jsx)(l.f,{width:`18px`,height:`18px`,rotate:-90,rtl:{rotate:90}})})]}),j=i.props.def.rowDetail;return(0,g.jsx)(E,{grid:i,open:!!f,onClose:S,tall:!0,title:f&&_?(0,g.jsx)(x,{row:f,column:_}):``,actions:A,onKeyDown:k,bodyRef:y,bodyProps:{onPointerDown:w,onPointerUp:T},children:f&&(0,g.jsxs)(g.Fragment,{children:[i.props.def.rowSelection&&(0,g.jsx)(e.default,{py:3,children:(0,g.jsx)(o.default,{variant:`datagrid`,checked:f.selected,onChange:f.toggleSelection,label:d.selectRow(f.rowIndex+1),labelProps:{display:`flex`,ai:`center`,gap:3,fontSize:15}})}),(0,g.jsx)(e.default,{tag:`dl`,m:0,children:s.recordColumns.map(e=>{let t=f.cells.findIndex(t=>t.column===e);return t===-1?null:(0,g.jsx)(O,{cell:f.cells[t],index:t},e.key)})}),j&&(0,g.jsxs)(a.default,{d:`column`,gap:2,py:3,children:[(0,g.jsx)(c.H3,{m:0,fontSize:14,fontWeight:600,children:d.details}),(0,g.jsx)(t.n,{children:j.content(f.data)})]})]})})}k.displayName=`DataGridListRecord`;function A(t){let{grid:n}=t,i=n.componentName,o=n.localeText,s=n.selectedRows.size;return!n.props.def.rowSelection||s===0?null:(0,g.jsxs)(a.default,{component:`${i}.list.selectionBar`,position:`sticky`,bottom:0,zIndex:2,ai:`center`,gap:2,px:4,py:2,fontSize:14,fontWeight:500,children:[(0,g.jsx)(e.default,{flex1:!0,minWidth:0,textWrap:`nowrap`,css:{fontVariantNumeric:`tabular-nums`},children:o.selectedRows(s)}),!n.allRowsSelected&&(0,g.jsx)(r.default,{type:`button`,minHeight:10,px:3,borderRadius:2,fontSize:14,fontWeight:500,cursor:`pointer`,active:{bgColor:`white/15`},theme:{dark:{active:{bgColor:`black/10`}}},onClick:n.toggleSelectAllRows,children:o.selectAll}),(0,g.jsx)(r.default,{type:`button`,minHeight:10,px:3,borderRadius:2,fontSize:14,fontWeight:500,cursor:`pointer`,active:{bgColor:`white/15`},theme:{dark:{active:{bgColor:`black/10`}}},onClick:n.clearSelection,children:o.clearSelection})]})}A.displayName=`DataGridListSelectionBar`;function j(e){return(0,g.jsx)(n.Svg,{viewBox:`0 0 24 24`,width:`1rem`,fill:`none`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,g.jsx)(n.Path,{d:`M4 6h16M7 12h10M10 18h4`,strokeLinecap:`round`})})}var M=8,N=[{value:`eq`,label:`=`},{value:`ne`,label:`≠`},{value:`gt`,label:`>`},{value:`gte`,label:`≥`},{value:`lt`,label:`<`},{value:`lte`,label:`≤`},{value:`between`,label:`↔`}];function P({column:e}){let{currentFilter:t}=e,n=e.grid.componentName,r=e.grid.localeText,[i,a]=(0,h.useState)(t?.type===`text`?t.value:``),{debounce:o}=l.s(t,e=>l.c.textMatches(i,e),e=>a(e?.type===`text`?e.value:``));return(0,g.jsx)(s.default,{component:`${n}.list.sheet.input`,...m.t.INPUT,type:`search`,value:i,placeholder:e.filterConfig?.placeholder??r.filterPlaceholder,onChange:t=>{let n=t.target.value;a(n),o(`value`,()=>e.setTextFilter(n))},props:{"aria-label":r.filterColumn(String(e.header??e.key))}})}function F({column:t}){let{currentFilter:n}=t,r=t.grid.componentName,i=t.grid.localeText,o=String(t.header??t.key),c=t.filterConfig,[u,d]=(0,h.useState)(()=>l.c.numberDraft(n)),f=(0,h.useRef)(u),p=(0,h.useCallback)(e=>{f.current=e,d(e)},[]),{debounce:_,cancel:v}=l.s(n,e=>l.c.numberMatches(u,e),e=>p(l.c.numberDraft(e))),y=(e,n)=>{p({...f.current,...e});let r=()=>t.setNumberFilter(f.current.operator,f.current.value,f.current.valueTo);n?_(`value`,r):(v(),r())},b=(e,t,n,i)=>(0,g.jsx)(s.default,{component:`${r}.list.sheet.input`,...m.t.INPUT,type:`number`,value:e,step:c?.step,placeholder:n,onChange:e=>y({[i]:e.target.value},!0),props:{"aria-label":t,inputMode:`decimal`,min:c?.min,max:c?.max}});return(0,g.jsxs)(a.default,{gap:2,ai:`center`,children:[(0,g.jsx)(e.default,{tag:`select`,component:`${r}.list.sheet.input`,...m.t.INPUT,width:18,flexShrink:0,props:{value:u.operator,"aria-label":i.filterComparison(o),onChange:e=>y({operator:e.target.value},!1)},children:N.map(e=>(0,g.jsx)(`option`,{value:e.value,children:e.label},e.value))}),b(u.value,u.operator===`between`?i.filterFrom(o):i.filterColumn(o),u.operator===`between`?i.filterFromPlaceholder:c?.placeholder??i.filterValuePlaceholder,`value`),u.operator===`between`&&b(u.valueTo,i.filterTo(o),i.filterToPlaceholder,`valueTo`)]})}function I({column:e}){let t=l.m(!0);return t?(0,g.jsx)(t.ListDateFilter,{column:e}):null}function L({column:e}){let{currentFilter:t}=e,n=e.grid.componentName,i=e.grid.localeText,c=t?.type===`multiselect`?t.values:[],l=e.filterOptions,[u,d]=(0,h.useState)(``),f=t=>{e.setMultiselectFilter(c.includes(t)?c.filter(e=>e!==t):[...c,t])};if(l.length<=M)return(0,g.jsx)(a.default,{flexWrap:`wrap`,gap:2,children:l.map(e=>(0,g.jsx)(r.default,{type:`button`,component:`${n}.list.sheet.chip`,display:`inline-flex`,ai:`center`,minHeight:10,px:3.5,borderRadius:999,fontSize:14,cursor:`pointer`,onClick:()=>f(e.value),props:{"aria-pressed":c.includes(e.value)},children:e.label},String(e.value)))});let p=u.trim().toLocaleLowerCase(),_=p?l.filter(e=>e.label.toLocaleLowerCase().includes(p)):l;return(0,g.jsxs)(a.default,{d:`column`,gap:2,children:[(0,g.jsx)(s.default,{component:`${n}.list.sheet.input`,...m.t.INPUT,type:`search`,value:u,placeholder:i.filterSelectSearchPlaceholder,onChange:e=>d(e.target.value),props:{"aria-label":i.filterColumn(String(e.header??e.key))}}),(0,g.jsx)(a.default,{d:`column`,maxHeight:64,overflowY:`auto`,children:_.map(e=>(0,g.jsx)(o.default,{checked:c.includes(e.value),onChange:()=>f(e.value),label:e.label,labelProps:{component:`${n}.list.sheet.line`,display:`flex`,ai:`center`,gap:3,minHeight:12,fontSize:16,bb:1}},String(e.value)))})]})}function R(e){let{column:t}=e;switch(t.filterConfig?.type){case void 0:return null;case`number`:return(0,g.jsx)(F,{column:t});case`multiselect`:return(0,g.jsx)(L,{column:t});case`date`:return(0,g.jsx)(I,{column:t});default:return(0,g.jsx)(P,{column:t})}}R.displayName=`DataGridListFilter`;function z(t){let{grid:n}=t,{list:i}=n,o=n.componentName,s=n.localeText,l=i.activeFilters.length,u=i.filterableColumns;return u.length===0?null:(0,g.jsx)(E,{grid:n,open:i.sheet===`filter`,onOpen:()=>i.openSheet(`filter`),onClose:()=>i.openSheet(null),title:s.filters,trigger:({ref:t,props:{onClick:n,...i}})=>(0,g.jsxs)(r.default,{type:`button`,component:`${o}.list.toolbar.button`,variant:{active:l>0},...m.t.PILL,ref:t,onClick:n,props:{...i,"aria-label":s.filtersLabel(l)},children:[(0,g.jsx)(j,{}),s.filters,l>0&&(0,g.jsx)(e.default,{tag:`span`,minWidth:5,height:5,px:1.5,borderRadius:999,bgColor:`accent-600`,color:`white`,fontSize:12,fontWeight:600,lineHeight:20,textAlign:`center`,props:{"aria-hidden":!0},children:l})]}),footer:(0,g.jsxs)(g.Fragment,{children:[l>0&&(0,g.jsx)(r.default,{type:`button`,component:`${o}.list.sheet.button`,...m.t.SHEET_BUTTON,onClick:n.clearColumnFilters,children:s.clearFilters}),(0,g.jsx)(r.default,{type:`button`,component:`${o}.list.sheet.primary`,...m.t.SHEET_BUTTON,flex1:!0,fontWeight:600,onClick:()=>i.openSheet(null),children:s.showRows(n.filterStats.filtered)})]}),children:u.map(e=>(0,g.jsxs)(a.default,{component:`${o}.list.sheet.line`,d:`column`,gap:2,py:3,bb:1,children:[(0,g.jsx)(c.H3,{m:0,fontSize:14,fontWeight:600,children:e.header??String(e.key)}),(0,g.jsx)(R,{column:e})]},e.key))})}z.displayName=`DataGridListFilterSheet`;function B(e){let{grid:t}=e,{list:n}=t,i=t.componentName,o=t.localeText,s=n.sortedColumn,c=t.sortDirection===`DESC`,u=`${t.identifier}-sort`,d={component:`${i}.list.sheet.line`,display:`flex`,ai:`center`,gap:3,minHeight:12,fontSize:16,cursor:`pointer`,bb:1};return(0,g.jsxs)(E,{grid:t,open:n.sheet===`sort`,onClose:()=>n.openSheet(null),title:o.sortBy,onOpen:()=>n.openSheet(`sort`),trigger:({ref:e,props:{onClick:t,...n}})=>(0,g.jsxs)(r.default,{type:`button`,component:`${i}.list.toolbar.button`,variant:{active:!!s},...m.t.PILL,ref:e,onClick:t,props:n,children:[(0,g.jsx)(l.o,{width:`16px`,height:`16px`,fill:`currentColor`,rotate:c?180:0}),s?o.sortedBy(String(s.header??s.key),c):o.sortBy]}),footer:(0,g.jsxs)(g.Fragment,{children:[s&&(0,g.jsx)(r.default,{type:`button`,component:`${i}.list.sheet.button`,...m.t.SHEET_BUTTON,onClick:()=>t.setSortColumn(s.key,void 0),children:o.clearSort}),(0,g.jsx)(r.default,{type:`button`,component:`${i}.list.sheet.primary`,...m.t.SHEET_BUTTON,flex1:!0,fontWeight:600,onClick:()=>n.openSheet(null),children:o.close})]}),children:[(0,g.jsx)(a.default,{tag:`fieldset`,d:`column`,b:0,m:0,p:0,props:{"aria-label":o.sortBy},children:n.sortableColumns.map(e=>(0,g.jsx)(f.default,{name:u,checked:s===e,onChange:()=>t.setSortColumn(e.key,c&&s?`DESC`:`ASC`),label:e.header??String(e.key),labelProps:d},e.key))}),s&&(0,g.jsx)(a.default,{tag:`fieldset`,d:`column`,b:0,m:0,p:0,pt:4,props:{"aria-label":`${o.sortBy}: ${s.header??s.key}`},children:[`ASC`,`DESC`].map(e=>(0,g.jsx)(f.default,{name:`${u}-direction`,checked:t.sortDirection===e,onChange:()=>t.setSortColumn(s.key,e),label:e===`ASC`?o.ascending:o.descending,labelProps:d},e))})]})}B.displayName=`DataGridListSortSheet`;function V({grid:e}){let t=e.componentName,[n,i]=(0,h.useState)(e.globalFilterValue),{debounce:o,cancel:c}=l.s(e.globalFilterValue,e=>e===n,i);return(0,g.jsxs)(a.default,{position:`relative`,ai:`center`,children:[(0,g.jsx)(a.default,{position:`absolute`,insetStart:3.5,pointerEvents:`none`,color:`base-500`,props:{"aria-hidden":!0},children:(0,g.jsx)(l.r,{fill:`currentColor`,width:`16px`})}),(0,g.jsx)(s.default,{component:`${t}.list.toolbar.search`,width:`fit`,height:11,ps:10,pe:10,b:0,borderRadius:3,fontSize:16,type:`search`,value:n,placeholder:e.localeText.searchPlaceholder,onChange:t=>{let n=t.target.value;i(n),o(`value`,()=>e.filter.setGlobalFilter(n))},props:{"aria-label":e.localeText.searchPlaceholder,enterKeyHint:`search`}}),n&&(0,g.jsx)(r.default,{type:`button`,component:`${t}.list.sheet.button`,display:`inline-flex`,ai:`center`,jc:`center`,width:7,height:7,borderRadius:999,cursor:`pointer`,position:`absolute`,insetEnd:2,onClick:()=>{c(),i(``),e.filter.setGlobalFilter(``)},props:{"aria-label":e.localeText.clearSearch},children:(0,g.jsx)(w,{width:`16px`})})]})}function H(t){let{grid:n}=t,{list:o}=n,{def:s}=n.props,c=n.componentName,u=n.localeText,{filtered:d,total:f}=n.filterStats,p=o.activeFilters,h=o.sortableColumns.length>0;return(0,g.jsxs)(a.default,{component:`${c}.list.toolbar`,d:`column`,gap:3,px:4,pt:4,pb:3,children:[(0,g.jsxs)(a.default,{ai:`center`,gap:3,flexWrap:`wrap`,children:[(0,g.jsxs)(a.default,{d:`column`,flex1:!0,minWidth:0,children:[s.title&&(0,g.jsx)(e.default,{id:n.titleId,fontSize:17,fontWeight:600,lineHeight:24,children:s.title}),(0,g.jsx)(e.default,{component:`${c}.list.toolbar.count`,fontSize:13,css:{fontVariantNumeric:`tabular-nums`},children:u.rowCount(d,f)})]}),s.topBar&&(0,g.jsxs)(a.default,{ai:`center`,gap:2,flexWrap:`wrap`,children:[(0,g.jsx)(l.n,{grid:n}),(0,g.jsx)(l.t,{grid:n})]})]}),s.globalFilter&&(0,g.jsx)(V,{grid:n}),(0,g.jsxs)(a.default,{gap:2,overflowX:`auto`,scrollbarWidth:`none`,mx:-4,px:4,children:[h&&(0,g.jsx)(B,{grid:n}),(0,g.jsx)(z,{grid:n}),s.rowSelection&&(0,g.jsx)(r.default,{type:`button`,component:`${c}.list.toolbar.button`,...m.t.PILL,variant:{active:o.selecting},onClick:()=>o.setSelecting(!o.selecting),props:{"aria-pressed":o.selecting},children:u.selectRows})]}),p.length>0&&(0,g.jsx)(a.default,{gap:2,overflowX:`auto`,scrollbarWidth:`none`,mx:-4,px:4,children:p.map(t=>(0,g.jsxs)(e.default,{tag:`span`,component:`${c}.list.toolbar.chip`,display:`inline-flex`,ai:`center`,gap:1,flexShrink:0,height:8,ps:3,pe:1,borderRadius:999,fontSize:13,textWrap:`nowrap`,children:[(0,g.jsxs)(e.default,{tag:`span`,fontWeight:500,children:[t.label,`:`]}),(0,g.jsx)(e.default,{tag:`span`,children:t.value}),(0,g.jsx)(r.default,{type:`button`,component:`${c}.list.sheet.button`,display:`inline-flex`,ai:`center`,jc:`center`,width:7,height:7,borderRadius:999,cursor:`pointer`,onClick:()=>t.column.clearFilter(),props:{"aria-label":u.clearFilter(t.label)},children:(0,g.jsx)(w,{width:`14px`})})]},t.column.key))}),s.topBarContent&&(0,g.jsx)(e.default,{children:s.topBarContent}),(0,g.jsx)(i.default,{props:{role:`status`},children:n.hasActiveFilters?u.rowCount(d,f):``})]})}H.displayName=`DataGridListToolbar`;function U(t){let{grid:n}=t,{list:r,source:i}=n,o=n.componentName,s=r.visibleItems,c=n.props.loading||i.isLoading,u=n.groupColumns.size===0&&!n.tree.enabled,f=i.enabled?n.totalRowCount:n.filterStats.filtered,{queryVersion:p}=i;return(0,h.useEffect)(()=>{i.enabled&&i.request(0,Math.max(s.length,1))},[i,p,s.length,n.page,n.pageSize,n.expansionVersion]),(0,g.jsxs)(a.default,{component:`${o}.list`,d:`column`,children:[(0,g.jsx)(H,{grid:n}),(0,g.jsx)(l.i,{grid:n}),c&&(0,g.jsx)(l.a,{grid:n}),s.length===0?(0,g.jsx)(e.default,{component:`list.muted`,px:4,py:10,textAlign:`center`,children:n.props.def.noDataComponent??(c?n.localeText.loadingRows:n.localeText.noRows)}):(0,g.jsx)(d.default,{props:{"aria-labelledby":n.props.def.title?n.titleId:void 0,"aria-busy":c||void 0},children:s.map(({row:e,index:t},r)=>e.kind===`group`?(0,g.jsx)(b,{row:e,version:n.rowVersion(e,t)},e.key):(0,g.jsx)(C,{row:e,index:t,position:u?r+1:void 0,setSize:u?f:void 0,version:n.rowVersion(e,t)},e.key))}),(0,g.jsx)(v,{grid:n,shown:u?s.length:void 0}),(0,g.jsx)(A,{grid:n}),(0,g.jsx)(k,{grid:n})]})}U.displayName=`DataGridList`,exports.default=U;
|
package/dataGridList.mjs
CHANGED
|
@@ -433,7 +433,7 @@ function K(t) {
|
|
|
433
433
|
/* @__PURE__ */ R(s, {
|
|
434
434
|
d: "column",
|
|
435
435
|
flexShrink: 0,
|
|
436
|
-
|
|
436
|
+
touchAction: "none",
|
|
437
437
|
props: {
|
|
438
438
|
onPointerDown: x,
|
|
439
439
|
onPointerMove: S,
|
|
@@ -486,10 +486,8 @@ function K(t) {
|
|
|
486
486
|
overflowY: "auto",
|
|
487
487
|
px: 4,
|
|
488
488
|
py: 2,
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
touchAction: "pan-y"
|
|
492
|
-
},
|
|
489
|
+
touchAction: "pan-y",
|
|
490
|
+
css: { overscrollBehavior: "contain" },
|
|
493
491
|
props: m,
|
|
494
492
|
children: _
|
|
495
493
|
}),
|
package/docs/props.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Every prop (
|
|
1
|
+
# Every prop (238)
|
|
2
2
|
|
|
3
3
|
Generated from the prop registry of `@box-kite/react`. The description is the prop's own doc comment and the example is **measured** — the CSS beside a value is what the engine emits for it, not what a doc claims. Alphabetical; the registry's own order is what decides the cascade and is not this.
|
|
4
4
|
|
|
@@ -642,11 +642,11 @@ The cursor CSS property sets the mouse cursor, if any, to show when the mouse po
|
|
|
642
642
|
|
|
643
643
|
### `cx`
|
|
644
644
|
|
|
645
|
-
The centre of a `<circle>` or `<ellipse>`, horizontally, in user units. Real CSS, so unlike the attribute it transitions — moving a point on hover is one prop and no JavaScript.
|
|
645
|
+
The centre of a `<circle>` or `<ellipse>`, horizontally, in user units. Real CSS, so unlike the attribute it transitions — moving a point on hover is one prop and no JavaScript. Written in `px`, which is a user unit: Firefox and Safari drop a bare number here, and so does every geometry prop (bug #330).
|
|
646
646
|
|
|
647
647
|
- Writes: `cx`
|
|
648
648
|
- Values: a number, anything else the types allow
|
|
649
|
-
- Example: `cx={4}` → `cx:
|
|
649
|
+
- Example: `cx={4}` → `cx: 4px`
|
|
650
650
|
|
|
651
651
|
### `cy`
|
|
652
652
|
|
|
@@ -654,7 +654,7 @@ The cy CSS property positions the centre of a `<circle>` or an `<ellipse>` verti
|
|
|
654
654
|
|
|
655
655
|
- Writes: `cy`
|
|
656
656
|
- Values: a number, anything else the types allow
|
|
657
|
-
- Example: `cy={4}` → `cy:
|
|
657
|
+
- Example: `cy={4}` → `cy: 4px`
|
|
658
658
|
|
|
659
659
|
### `d`
|
|
660
660
|
|
|
@@ -770,10 +770,10 @@ Mirrors the element: `xAxis` flips it left to right, `yAxis` top to bottom. It w
|
|
|
770
770
|
|
|
771
771
|
### `fontSize`
|
|
772
772
|
|
|
773
|
-
The font-size CSS property sets the size of the font. Its divider is **16**, not the spacing scale’s 4, so the number is the pixel size a reader was reaching for: `fontSize={14}` is `0.875rem`. Font-size-relative units (`em`, `ex`) resolve against it.
|
|
773
|
+
The font-size CSS property sets the size of the font. Its divider is **16**, not the spacing scale’s 4, so the number is the pixel size a reader was reaching for: `fontSize={14}` is `0.875rem`. Font-size-relative units (`em`, `ex`) resolve against it. `'control'` is the text size of the size standard in force (`--control-font-size`).
|
|
774
774
|
|
|
775
775
|
- Writes: `font-size`
|
|
776
|
-
- Values: `inherit`, a number
|
|
776
|
+
- Values: `inherit` · `control` · `control-compact` · `control-normal` · `control-large`, a number
|
|
777
777
|
- Example: `fontSize={14}` → `font-size: 0.875rem`
|
|
778
778
|
|
|
779
779
|
### `fontStyle`
|
|
@@ -874,10 +874,10 @@ The grid-template-rows CSS property defines the line names and track sizing func
|
|
|
874
874
|
|
|
875
875
|
### `height`
|
|
876
876
|
|
|
877
|
-
The height CSS property specifies the height of an element. By default, the property defines the height of the content area. If box-sizing is set to border-box, however, it instead determines the height of the border area. It also takes `anchor-size()`, a length read off the anchor a floating layer is placed against.
|
|
877
|
+
The height CSS property specifies the height of an element. By default, the property defines the height of the content area. If box-sizing is set to border-box, however, it instead determines the height of the border area. It also takes `anchor-size()`, a length read off the anchor a floating layer is placed against, and the size standard: `'control'` is the height of the size in force (`--control-height`), `'control-compact'`/`'control-normal'`/`'control-large'` one by name.
|
|
878
878
|
|
|
879
879
|
- Writes: `height`
|
|
880
|
-
- Values: `fit` · `fit-screen` · `1/1` · `1/2` · `1/3` · `2/3` · `1/4` · `2/4` · `3/4` · `1/5` · `2/5` · `3/5` · `4/5` · `1/6` · `2/6` · `3/6` · `4/6` · `5/6` · `1/12` · `2/12` · `3/12` · `4/12` · `5/12` · `6/12` · `7/12` · `8/12` · `9/12` · `10/12` · `11/12` · `auto` · `fit-content` · `max-content` · `min-content`, a number, anything else the types allow
|
|
880
|
+
- Values: `fit` · `fit-screen` · `1/1` · `1/2` · `1/3` · `2/3` · `1/4` · `2/4` · `3/4` · `1/5` · `2/5` · `3/5` · `4/5` · `1/6` · `2/6` · `3/6` · `4/6` · `5/6` · `1/12` · `2/12` · `3/12` · `4/12` · `5/12` · `6/12` · `7/12` · `8/12` · `9/12` · `10/12` · `11/12` · `auto` · `fit-content` · `max-content` · `min-content` · `control` · `control-compact` · `control-normal` · `control-large`, a number, anything else the types allow
|
|
881
881
|
- Example: `height={4}` → `height: 1rem`
|
|
882
882
|
|
|
883
883
|
### `hueRotate`
|
|
@@ -1090,10 +1090,10 @@ The margin-inline-end CSS property sets the margin on the side the text ends at:
|
|
|
1090
1090
|
|
|
1091
1091
|
### `minHeight`
|
|
1092
1092
|
|
|
1093
|
-
The min-height CSS property sets the minimum height of an element. It prevents the used value of the height property from becoming smaller than the value specified for min-height. It also takes `anchor-size()`, a length read off the anchor a floating layer is placed against.
|
|
1093
|
+
The min-height CSS property sets the minimum height of an element. It prevents the used value of the height property from becoming smaller than the value specified for min-height. It also takes `anchor-size()`, a length read off the anchor a floating layer is placed against, and `'control'`/`'control-compact'`/`'control-normal'`/`'control-large'`, the size standard's heights.
|
|
1094
1094
|
|
|
1095
1095
|
- Writes: `min-height`
|
|
1096
|
-
- Values: `fit` · `fit-screen` · `1/1` · `1/2` · `1/3` · `2/3` · `1/4` · `2/4` · `3/4` · `1/5` · `2/5` · `3/5` · `4/5` · `1/6` · `2/6` · `3/6` · `4/6` · `5/6` · `1/12` · `2/12` · `3/12` · `4/12` · `5/12` · `6/12` · `7/12` · `8/12` · `9/12` · `10/12` · `11/12` · `auto` · `fit-content` · `max-content` · `min-content`, a number, anything else the types allow
|
|
1096
|
+
- Values: `fit` · `fit-screen` · `1/1` · `1/2` · `1/3` · `2/3` · `1/4` · `2/4` · `3/4` · `1/5` · `2/5` · `3/5` · `4/5` · `1/6` · `2/6` · `3/6` · `4/6` · `5/6` · `1/12` · `2/12` · `3/12` · `4/12` · `5/12` · `6/12` · `7/12` · `8/12` · `9/12` · `10/12` · `11/12` · `auto` · `fit-content` · `max-content` · `min-content` · `control` · `control-compact` · `control-normal` · `control-large`, a number, anything else the types allow
|
|
1097
1097
|
- Example: `minHeight={4}` → `min-height: 1rem`
|
|
1098
1098
|
|
|
1099
1099
|
### `minWidth`
|
|
@@ -1242,10 +1242,10 @@ The padding CSS shorthand property sets the padding area on all four sides of an
|
|
|
1242
1242
|
|
|
1243
1243
|
### `paintOrder`
|
|
1244
1244
|
|
|
1245
|
-
The paint-order CSS property sets what is painted first. `paintOrder="stroke"` puts the stroke behind the fill, which is how outlined SVG text stays legible.
|
|
1245
|
+
The paint-order CSS property sets what is painted first. `paintOrder="stroke"` puts the stroke behind the fill, which is how outlined SVG text stays legible. Up to three keywords in the order they paint (`'stroke fill markers'`); the ones left out follow in their usual order.
|
|
1246
1246
|
|
|
1247
1247
|
- Writes: `paint-order`
|
|
1248
|
-
- Values: `normal` · `fill` · `stroke` · `markers`
|
|
1248
|
+
- Values: `normal` · `fill` · `stroke` · `markers` · `fill stroke` · `fill markers` · `stroke fill` · `stroke markers` · `markers fill` · `markers stroke` · `fill stroke markers` · `fill markers stroke` · `stroke fill markers` · `stroke markers fill` · `markers fill stroke` · `markers stroke fill`
|
|
1249
1249
|
- Example: `paintOrder="normal"` → `paint-order: normal`
|
|
1250
1250
|
|
|
1251
1251
|
### `pb`
|
|
@@ -1290,10 +1290,10 @@ The place-items CSS shorthand sets `align-items` and `justify-items` in one decl
|
|
|
1290
1290
|
|
|
1291
1291
|
### `pointerEvents`
|
|
1292
1292
|
|
|
1293
|
-
The pointer-events CSS property sets under what circumstances (if any) a particular graphic element can become the target of pointer events.
|
|
1293
|
+
The pointer-events CSS property sets under what circumstances (if any) a particular graphic element can become the target of pointer events. On SVG the keywords say which part takes the press: `visibleStroke` over a wide transparent stroke is an edge's hit area. `bounding-box` is not in Firefox, which falls back to `visiblePainted`.
|
|
1294
1294
|
|
|
1295
1295
|
- Writes: `pointer-events`
|
|
1296
|
-
- Values: `none` · `auto` · `all`
|
|
1296
|
+
- Values: `none` · `auto` · `all` · `visiblePainted` · `visibleFill` · `visibleStroke` · `visible` · `painted` · `fill` · `stroke` · `bounding-box`
|
|
1297
1297
|
- Example: `pointerEvents="none"` → `pointer-events: none`
|
|
1298
1298
|
|
|
1299
1299
|
### `position`
|
|
@@ -1390,7 +1390,7 @@ The r CSS property sets the radius of a `<circle>`, in user units. Transition it
|
|
|
1390
1390
|
|
|
1391
1391
|
- Writes: `r`
|
|
1392
1392
|
- Values: a number, anything else the types allow
|
|
1393
|
-
- Example: `r={4}` → `r:
|
|
1393
|
+
- Example: `r={4}` → `r: 4px`
|
|
1394
1394
|
|
|
1395
1395
|
### `resize`
|
|
1396
1396
|
|
|
@@ -1446,7 +1446,7 @@ The horizontal radius of an `<ellipse>` or corner radius of a `<rect>` — `bord
|
|
|
1446
1446
|
|
|
1447
1447
|
- Writes: `rx`
|
|
1448
1448
|
- Values: `auto`, a number, anything else the types allow
|
|
1449
|
-
- Example: `rx={4}` → `rx:
|
|
1449
|
+
- Example: `rx={4}` → `rx: 4px`
|
|
1450
1450
|
|
|
1451
1451
|
### `ry`
|
|
1452
1452
|
|
|
@@ -1454,7 +1454,7 @@ The ry CSS property sets the vertical radius of an `<ellipse>` or the vertical c
|
|
|
1454
1454
|
|
|
1455
1455
|
- Writes: `ry`
|
|
1456
1456
|
- Values: `auto`, a number, anything else the types allow
|
|
1457
|
-
- Example: `ry={4}` → `ry:
|
|
1457
|
+
- Example: `ry={4}` → `ry: 4px`
|
|
1458
1458
|
|
|
1459
1459
|
### `saturate`
|
|
1460
1460
|
|
|
@@ -1562,10 +1562,10 @@ The stroke CSS property defines the color or SVG paint server used to draw an el
|
|
|
1562
1562
|
|
|
1563
1563
|
### `strokeDasharray`
|
|
1564
1564
|
|
|
1565
|
-
The stroke-dasharray CSS property turns an SVG stroke into dashes: a single number is the dash and the gap alike, a string is the full pattern (`'8 4'`). Lengths are user units.
|
|
1565
|
+
The stroke-dasharray CSS property turns an SVG stroke into dashes: a single number is the dash and the gap alike, a string is the full pattern (`'8 4'`). Lengths are user units. `dashed` (four widths on, two off) and `dotted` (one on, one off) follow the `strokeWidth` prop, so a thicker line keeps its pattern.
|
|
1566
1566
|
|
|
1567
1567
|
- Writes: `stroke-dasharray`
|
|
1568
|
-
- Values: a number, anything else the types allow
|
|
1568
|
+
- Values: `dashed` · `dotted`, a number, anything else the types allow
|
|
1569
1569
|
- Example: `strokeDasharray={4}` → `stroke-dasharray: 4`
|
|
1570
1570
|
|
|
1571
1571
|
### `strokeDashoffset`
|
|
@@ -1610,11 +1610,11 @@ The stroke-opacity CSS property defines the opacity of the paint applied to an S
|
|
|
1610
1610
|
|
|
1611
1611
|
### `strokeWidth`
|
|
1612
1612
|
|
|
1613
|
-
The stroke-width CSS property sets the width of an SVG element's stroke, in user units — `strokeWidth={2}` is `stroke-width: 2`, no divider.
|
|
1613
|
+
The stroke-width CSS property sets the width of an SVG element's stroke, in user units — `strokeWidth={2}` is `stroke-width: 2`, no divider. It also sets `--boxStrokeWidth`, which `strokeDasharray="dashed"` scales with. Firefox drops a unitless one inside `calc()`, hence the `px`.
|
|
1614
1614
|
|
|
1615
|
-
- Writes: `stroke-width`
|
|
1615
|
+
- Writes: `--boxStrokeWidth`, `stroke-width`
|
|
1616
1616
|
- Values: a number
|
|
1617
|
-
- Example: `strokeWidth={4}` →
|
|
1617
|
+
- Example: `strokeWidth={4}` → `--boxStrokeWidth: 4px; stroke-width: 4`
|
|
1618
1618
|
|
|
1619
1619
|
### `tableLayout`
|
|
1620
1620
|
|
|
@@ -1704,6 +1704,30 @@ The top CSS property sets the vertical position of a positioned element. This in
|
|
|
1704
1704
|
- Values: 55 named values, a number, anything else the types allow
|
|
1705
1705
|
- Example: `top={4}` → `top: 1rem`
|
|
1706
1706
|
|
|
1707
|
+
### `touchAction`
|
|
1708
|
+
|
|
1709
|
+
The touch-action CSS property sets which gestures the browser keeps for itself on a touch screen: `none` hands every press to the page, which is what a drag needs, and `pan-y` keeps the vertical scroll while a sideways swipe is the page's.
|
|
1710
|
+
|
|
1711
|
+
- Writes: `touch-action`
|
|
1712
|
+
- Values: `auto` · `none` · `manipulation` · `pan-x` · `pan-y` · `pinch-zoom` · `pan-x pan-y` · `pan-x pinch-zoom` · `pan-y pinch-zoom` · `pan-x pan-y pinch-zoom`
|
|
1713
|
+
- Example: `touchAction="auto"` → `touch-action: auto`
|
|
1714
|
+
|
|
1715
|
+
### `transformBox`
|
|
1716
|
+
|
|
1717
|
+
The box `transformOrigin` is measured in. An SVG shape's default is `view-box`, so it turns about the viewBox's corner; `transformBox="fill-box"` with `transformOrigin="center"` turns it about its own centre.
|
|
1718
|
+
|
|
1719
|
+
- Writes: `transform-box`
|
|
1720
|
+
- Values: `content-box` · `border-box` · `fill-box` · `stroke-box` · `view-box`
|
|
1721
|
+
- Example: `transformBox="content-box"` → `transform-box: content-box`
|
|
1722
|
+
|
|
1723
|
+
### `transformOrigin`
|
|
1724
|
+
|
|
1725
|
+
The point `rotate` and `scale` turn about: a keyword (`'center'`, `'top left'`), a fraction or a percentage, a number on the ÷4 scale, or two or three positions as CSS writes them (`'48px 48px'`, `'1/2 1/4'`).
|
|
1726
|
+
|
|
1727
|
+
- Writes: `transform-origin`
|
|
1728
|
+
- Values: a number, anything else the types allow
|
|
1729
|
+
- Example: `transformOrigin={4}` → `transform-origin: 1rem`
|
|
1730
|
+
|
|
1707
1731
|
### `transition`
|
|
1708
1732
|
|
|
1709
1733
|
What a transition applies to: `all` (what the base class already does), `none`, or one of the property groups — `colors`, `opacity`, `shadow`, `transform`, `size`, `filter`.
|
|
@@ -1866,11 +1890,11 @@ The will-change CSS property warns the browser that a property is about to chang
|
|
|
1866
1890
|
|
|
1867
1891
|
### `x`
|
|
1868
1892
|
|
|
1869
|
-
Positions a `<rect>`, `<image>`, `<use>`, `<foreignObject>` or nested `<svg>` horizontally, in user units. Not `<text>`, whose `x` takes a list of positions
|
|
1893
|
+
Positions a `<rect>`, `<image>`, `<use>`, `<foreignObject>` or nested `<svg>` horizontally, in user units. Not `<text>`, whose `x` takes a list of positions: `<SvgText x={4}>` writes it as the attribute.
|
|
1870
1894
|
|
|
1871
1895
|
- Writes: `x`
|
|
1872
1896
|
- Values: a number, anything else the types allow
|
|
1873
|
-
- Example: `x={4}` → `x:
|
|
1897
|
+
- Example: `x={4}` → `x: 4px`
|
|
1874
1898
|
|
|
1875
1899
|
### `y`
|
|
1876
1900
|
|
|
@@ -1878,7 +1902,7 @@ The y CSS property positions a `<rect>`, `<image>`, `<use>`, `<foreignObject>` o
|
|
|
1878
1902
|
|
|
1879
1903
|
- Writes: `y`
|
|
1880
1904
|
- Values: a number, anything else the types allow
|
|
1881
|
-
- Example: `y={4}` → `y:
|
|
1905
|
+
- Example: `y={4}` → `y: 4px`
|
|
1882
1906
|
|
|
1883
1907
|
### `zIndex`
|
|
1884
1908
|
|
package/interactionListening.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./platform.cjs");function t(e){let t=new WeakSet,n=JSON.stringify(e,(e,n)=>{if(typeof n==`bigint`)return n.toString();if(typeof n!=`object`||!n)return n;if(n instanceof Set)return Array.from(n);if(n instanceof Map)return Object.fromEntries(n);if(t.has(n))return;let r=Object.getPrototypeOf(n);if(!(!Array.isArray(n)&&(r!==Object.prototype&&r!==null||`$$typeof`in n)))return t.add(n),n});return n===void 0?void 0:JSON.parse(n)}var n=[`click`,`dblclick`,`keydown`,`pointerdown`,`pointerup`,`change`,`submit`,`copy`,`paste`,`focusout`],r=[`imperative`,`programmatic`,`timeout`],i=`a[href],button,input,select,textarea,summary,label,[tabindex],[role=option],[role=button]`;function a(e){let t=globalThis.scheduler;t?.postTask?t.postTask(e,{priority:`background`}):setTimeout(e,0)}function o(e){typeof reportError==`function`?reportError(e):setTimeout(()=>{throw e})}var s=e=>typeof Element<`u`&&e instanceof Element?e:void 0,c=e=>e?.closest(i)??void 0;function l({kind:e,input:n,event:i,handler:a,timeStamp:o,time:l,url:u},d){let f=d?[]:n.content??[],p=t(n.details&&Object.fromEntries(Object.entries(n.details).filter(([e])=>!f.includes(e)))),m=n.source??(n.reason&&r.includes(n.reason)?`app`:`user`);return{kind:e,component:n.component,type:n.type,reason:n.reason,value:f.includes(`value`)?void 0:t(n.value),details:p&&Object.keys(p).length>0?p:void 0,source:m,event:i,target:s(a)??c(s(i?.target))??n.target??s(i?.target),timeStamp:o,time:l,url:d?u:u.split(/[?#]/)[0]}}function u(t){let r=!1,i=()=>{r=!1;let e=t.queue.splice(0);if(t.listeners.size!==0)for(let n of e){if(n.kind===`dom`&&e.some(e=>e.kind!==`dom`&&e.event===n.event))continue;let r,i;t.listeners.forEach((e,t)=>{let a=e.content?r??=l(n,!0):i??=l(n,!1);try{t(a)}catch(e){o(e)}})}},u=()=>{r||(r=!0,a(i))};if(t.flush=i,t.schedule=u,t.queue.length>0&&u(),typeof addEventListener!=`function`)return;let d=n=>{let r=s(n.target);if(!r||t.listeners.size===0)return;if(!e.
|
|
1
|
+
const e=require("./platform.cjs");function t(e){let t=new WeakSet,n=JSON.stringify(e,(e,n)=>{if(typeof n==`bigint`)return n.toString();if(typeof n!=`object`||!n)return n;if(n instanceof Set)return Array.from(n);if(n instanceof Map)return Object.fromEntries(n);if(t.has(n))return;let r=Object.getPrototypeOf(n);if(!(!Array.isArray(n)&&(r!==Object.prototype&&r!==null||`$$typeof`in n)))return t.add(n),n});return n===void 0?void 0:JSON.parse(n)}var n=[`click`,`dblclick`,`keydown`,`pointerdown`,`pointerup`,`change`,`submit`,`copy`,`paste`,`focusout`],r=[`imperative`,`programmatic`,`timeout`],i=`a[href],button,input,select,textarea,summary,label,[tabindex],[role=option],[role=button]`;function a(e){let t=globalThis.scheduler;t?.postTask?t.postTask(e,{priority:`background`}):setTimeout(e,0)}function o(e){typeof reportError==`function`?reportError(e):setTimeout(()=>{throw e})}var s=e=>typeof Element<`u`&&e instanceof Element?e:void 0,c=e=>e?.closest(i)??void 0;function l({kind:e,input:n,event:i,handler:a,timeStamp:o,time:l,url:u},d){let f=d?[]:n.content??[],p=t(n.details&&Object.fromEntries(Object.entries(n.details).filter(([e])=>!f.includes(e)))),m=n.source??(n.reason&&r.includes(n.reason)?`app`:`user`);return{kind:e,component:n.component,type:n.type,reason:n.reason,value:f.includes(`value`)?void 0:t(n.value),details:p&&Object.keys(p).length>0?p:void 0,source:m,event:i,target:s(a)??c(s(i?.target))??n.target??s(i?.target),timeStamp:o,time:l,url:d?u:u.split(/[?#]/)[0]}}function u(t){let r=!1,i=()=>{r=!1;let e=t.queue.splice(0);if(t.listeners.size!==0)for(let n of e){if(n.kind===`dom`&&e.some(e=>e.kind!==`dom`&&e.event===n.event))continue;let r,i;t.listeners.forEach((e,t)=>{let a=e.content?r??=l(n,!0):i??=l(n,!1);try{t(a)}catch(e){o(e)}})}},u=()=>{r||(r=!0,a(i))};if(t.flush=i,t.schedule=u,t.queue.length>0&&u(),typeof addEventListener!=`function`)return;let d=n=>{let r=s(n.target);if(!r||t.listeners.size===0)return;if(!e.v()){e.a()&&e.x()&&!t.warned&&(t.warned=!0,console.warn(`[box-kite] Box.onInteraction hears no clicks without data-bk: write Box.configure({ componentAttribute: true }).`));return}let i=c(r),a=(i??r).closest(`[data-bk]`);if(!a)return;let o=r instanceof HTMLInputElement&&(r.type===`checkbox`||r.type===`radio`);t.queue.push({kind:`dom`,input:{component:a.getAttribute(`data-bk`)??``,type:n.type,value:n.type===`change`&&o?r.checked:void 0,details:{interactive:i!==void 0},target:i??a,source:n.isTrusted?`user`:`app`},event:n,timeStamp:performance.now(),time:Date.now(),url:location.href}),u()},f=!1,p=e=>{t.dispatching=e,f||(f=!0,setTimeout(()=>{f=!1,t.dispatching=void 0},0)),(e.type===`click`||e.type===`change`)&&d(e)};n.forEach(e=>{document.addEventListener(e,p,!0),addEventListener(e,e=>{t.dispatching===e&&(t.dispatching=void 0)})}),addEventListener(`pagehide`,i)}exports.default=u;
|
package/interactionListening.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as e, v as t, x as n } from "./platform.mjs";
|
|
2
2
|
//#region src/utils/interactions/interactionJson.ts
|
|
3
3
|
function r(e) {
|
|
4
4
|
let t = /* @__PURE__ */ new WeakSet(), n = JSON.stringify(e, (e, n) => {
|
|
@@ -80,8 +80,8 @@ function f(r) {
|
|
|
80
80
|
let p = (i) => {
|
|
81
81
|
let a = l(i.target);
|
|
82
82
|
if (!a || r.listeners.size === 0) return;
|
|
83
|
-
if (!
|
|
84
|
-
|
|
83
|
+
if (!t()) {
|
|
84
|
+
e() && n() && !r.warned && (r.warned = !0, console.warn("[box-kite] Box.onInteraction hears no clicks without data-bk: write Box.configure({ componentAttribute: true })."));
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
87
|
let o = u(a), s = (o ?? a).closest("[data-bk]");
|
package/layer.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./platform.cjs"),t=require("./effects.cjs"),n=require("./behavior.cjs"),r=require("./identity.cjs"),i=require("./reporting.cjs");let a=require("react");var o=()=>()=>{},s=()=>!0;function c(){return(0,a.useSyncExternalStore)(o,e.c,s)}function l(o){let{haspopup:s,id:l,idPrefix:u,open:d,defaultOpen:f=!1,onOpenChange:p,onOpened:m,onClosing:h,inside:g,interaction:_}=o,v=r.t(u),y=l??v,[b,x]=i.a({value:d,defaultValue:f,onChange:p,interaction:_}),[S,C]=(0,a.useState)(null),[w,T]=(0,a.useState)(null),E=c(),[D,O]=(0,a.useState)(!1),[k,A]=(0,a.useState)(),j=(0,a.useRef)(`imperative`),M=(0,a.useRef)(!1),N=(0,a.useRef)(null),P=n.a(m),F=n.a(h),I=n.a(e=>{let t=e.newState===`open`,n=e.currentTarget;if(t&&d===!1){e.preventDefault(),setTimeout(()=>x(!0,{reason:`trigger`,event:e}));return}let r=t?`trigger`:j.current;if(t){let e=document.activeElement;N.current=e instanceof HTMLElement&&e!==document.body?e:null}else M.current=n.contains(document.activeElement),F(M.current,S),r!==`outside-pointer`&&n.contains(document.activeElement)&&(N.current?.isConnected?N.current:S)?.focus({preventScroll:!0});O(t),j.current=`imperative`,x(t,{reason:r,event:e})}),L=n.a(e=>{let t=e.currentTarget;e.newState===`open`&&P(t)});t.n(()=>{if(!E||!w)return;let e=new AbortController;return w.addEventListener(`beforetoggle`,I,{signal:e.signal}),w.addEventListener(`toggle`,L,{signal:e.signal}),()=>e.abort()},[E,w,I,L]),t.n(()=>{!E||!e.c()||!w||b===D||(b?w.showPopover():w.hidePopover())},[b,D,w,E]),t.n(()=>{if(!E||!b)return;let t=new AbortController,n=(e,n)=>document.addEventListener(e,n,{signal:t.signal,capture:!0});return n(`keydown`,e=>{e.key===`Escape`&&(j.current=`escape`)}),n(`pointerdown`,t=>{let n=!!S&&e.
|
|
1
|
+
const e=require("./platform.cjs"),t=require("./effects.cjs"),n=require("./behavior.cjs"),r=require("./identity.cjs"),i=require("./reporting.cjs");let a=require("react");var o=()=>()=>{},s=()=>!0;function c(){return(0,a.useSyncExternalStore)(o,e.c,s)}function l(o){let{haspopup:s,id:l,idPrefix:u,open:d,defaultOpen:f=!1,onOpenChange:p,onOpened:m,onClosing:h,inside:g,interaction:_}=o,v=r.t(u),y=l??v,[b,x]=i.a({value:d,defaultValue:f,onChange:p,interaction:_}),[S,C]=(0,a.useState)(null),[w,T]=(0,a.useState)(null),E=c(),[D,O]=(0,a.useState)(!1),[k,A]=(0,a.useState)(),j=(0,a.useRef)(`imperative`),M=(0,a.useRef)(!1),N=(0,a.useRef)(null),P=n.a(m),F=n.a(h),I=n.a(e=>{let t=e.newState===`open`,n=e.currentTarget;if(t&&d===!1){e.preventDefault(),setTimeout(()=>x(!0,{reason:`trigger`,event:e}));return}let r=t?`trigger`:j.current;if(t){let e=document.activeElement;N.current=e instanceof HTMLElement&&e!==document.body?e:null}else M.current=n.contains(document.activeElement),F(M.current,S),r!==`outside-pointer`&&n.contains(document.activeElement)&&(N.current?.isConnected?N.current:S)?.focus({preventScroll:!0});O(t),j.current=`imperative`,x(t,{reason:r,event:e})}),L=n.a(e=>{let t=e.currentTarget;e.newState===`open`&&P(t)});t.n(()=>{if(!E||!w)return;let e=new AbortController;return w.addEventListener(`beforetoggle`,I,{signal:e.signal}),w.addEventListener(`toggle`,L,{signal:e.signal}),()=>e.abort()},[E,w,I,L]),t.n(()=>{!E||!e.c()||!w||b===D||(b?w.showPopover():w.hidePopover())},[b,D,w,E]),t.n(()=>{if(!E||!b)return;let t=new AbortController,n=(e,n)=>document.addEventListener(e,n,{signal:t.signal,capture:!0});return n(`keydown`,e=>{e.key===`Escape`&&(j.current=`escape`)}),n(`pointerdown`,t=>{let n=!!S&&e.g(t,[S]);j.current=n?`trigger`:`outside-pointer`}),()=>t.abort()},[E,b,S]),t.n(()=>{S&&(S.id||S.setAttribute(`id`,`${y}-trigger`),A(S.id))},[S,y]),t.n(()=>{if(!(!E||!S))return S.setAttribute(`popovertarget`,y),()=>S.removeAttribute(`popovertarget`)},[E,S,y]),t.n(()=>{E||!b||!w||P(w)},[E,b,w,P]),n.r({enabled:!E&&b,inside:[w,S,...g??[]],onDismiss:(e,t)=>x(!1,{reason:e,event:t})}),n.n({enabled:!E&&b,returnTo:S});let R=n.a(e=>{x(e=>!e,{reason:`trigger`,event:e})});return{platform:E,isOpen:b,setOpen:x,id:y,trigger:(0,a.useMemo)(()=>({ref:C,props:{"aria-expanded":b,"aria-haspopup":s,"aria-controls":b?y:void 0,...E?{}:{onClick:R}}}),[R,s,b,y,E]),triggerElement:S,triggerId:k,setPanel:T,panelElement:w}}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
|
package/layer.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box-kite/react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"pages/**"
|
|
@@ -548,7 +548,7 @@
|
|
|
548
548
|
"../dataGridDateParts.mjs"
|
|
549
549
|
],
|
|
550
550
|
"gzip": true,
|
|
551
|
-
"limit": "
|
|
551
|
+
"limit": "100.21 kB"
|
|
552
552
|
},
|
|
553
553
|
{
|
|
554
554
|
"name": "Interaction delivery, the chunk the first Box.onInteraction fetches",
|
|
@@ -614,7 +614,7 @@
|
|
|
614
614
|
"./interactionListening.mjs"
|
|
615
615
|
],
|
|
616
616
|
"gzip": true,
|
|
617
|
-
"limit": "
|
|
617
|
+
"limit": "170.45 kB"
|
|
618
618
|
}
|
|
619
619
|
],
|
|
620
620
|
"repository": {
|
|
@@ -648,13 +648,13 @@
|
|
|
648
648
|
"url": "https://github.com/box-kite/box-kite/issues"
|
|
649
649
|
},
|
|
650
650
|
"homepage": "https://www.box-kite.dev",
|
|
651
|
-
"description": "One React component
|
|
651
|
+
"description": "One React component that takes CSS properties as typed props and generates atomic CSS at runtime — no CSS files, no build step, renders in a Server Component.",
|
|
652
652
|
"peerDependencies": {
|
|
653
653
|
"react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
654
654
|
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
655
655
|
},
|
|
656
656
|
"dependencies": {
|
|
657
|
-
"@box-kite/core": "2.
|
|
657
|
+
"@box-kite/core": "2.3.1",
|
|
658
658
|
"csstype": "^3.2.3",
|
|
659
659
|
"use-sync-external-store": "^1.6.0"
|
|
660
660
|
},
|
package/placement.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./platform.cjs"),t=require("./effects.cjs"),n=require("./identity.cjs");let r=require("react");var i={top:`bottom`,bottom:`top`,start:`end`,end:`start`};function a(e){return e===`top`||e===`bottom`}function o(e,t){let n=a(e),r=n?e===`top`?`block-start`:`block-end`:e===`start`?`inline-start`:`inline-end`,i=t===`center`?`span-all`:`span-${n?`inline`:`block`}-${t===`start`?`end`:`start`}`;return n?`${r} ${i}`:`${i} ${r}`}function s(e){let[t,n]=e.trim().split(` `);return n===void 0?t===`block-start`?`top`:t===`block-end`?`bottom`:t===`inline-start`?`start`:t===`inline-end`?`end`:null:t===`start`?`top`:t===`end`?`bottom`:n===`start`?`start`:n===`end`?`end`:null}function c(e){return a(e)?`flip-block, flip-inline, flip-block flip-inline`:`flip-inline, flip-block, flip-inline flip-block`}function l(e,t,n,r){let i=u(t,r);return i===`top`?e.top-n.top:i===`bottom`?n.top+n.height-(e.top+e.height):i===`left`?e.left-n.left:n.left+n.width-(e.left+e.width)}function u(e,t){return e===`top`||e===`bottom`?e:e===`start`===t?`right`:`left`}function d(e,t,n,r){return Math.max(n,Math.min(e,n+r-t))}function f(e,t,n,r){let{align:o,offset:s,flip:c,rtl:f}=r,p=(a(r.side)?t.height:t.width)+s,m=c&&l(e,r.side,n,f)<p&&l(e,i[r.side],n,f)>=p?i[r.side]:r.side,h=u(m,f),g={top:e.top-t.height-s,bottom:e.top+e.height+s,left:e.left-t.width-s,right:e.left+e.width+s}[h],_=a(m),v=_?e.left:e.top,y=_?e.width:e.height,b=_?t.width:t.height,x=o===`center`?v+y/2-b/2:o===`start`===(_&&f)?v+y-b:v,S=_?d(x,t.width,n.left,n.width):d(x,t.height,n.top,n.height);return _?{top:g,left:S,side:m}:{top:S,left:g,side:m}}var p=4,m=16,h={top:`mb`,bottom:`mt`,start:`me`,end:`ms`};function g(){return typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`anchor-name: --a`)}function _(){let e=typeof document>`u`?null:document.documentElement,t=e?parseFloat(getComputedStyle(e).fontSize):NaN;return Number.isFinite(t)&&t>0?t:m}function v(e){let{top:t,left:n,width:r,height:i}=e.getBoundingClientRect();return{top:t,left:n,width:r,height:i}}function y(e,t){return e!==null&&e.top===t.top&&e.left===t.left&&e.side===t.side&&e.anchorWidth===t.anchorWidth}function b(i={}){let{side:a=`bottom`,align:l=`center`,offset:u=0,flip:d=!0,matchWidth:m=!1,name:b,anchor:x,trackSide:S=!1}=i,C=n.t(`anchor`),w=`--${(b??C).replace(/^--/,``)}`,[T,E]=(0,r.useState)(!0),[D,O]=(0,r.useState)(null),[k,A]=(0,r.useState)(null),[j,M]=(0,r.useState)(null),[N,P]=(0,r.useState)(null);t.n(()=>{g()||E(!1)},[]),t.n(()=>{let t=e.
|
|
1
|
+
const e=require("./platform.cjs"),t=require("./effects.cjs"),n=require("./identity.cjs");let r=require("react");var i={top:`bottom`,bottom:`top`,start:`end`,end:`start`};function a(e){return e===`top`||e===`bottom`}function o(e,t){let n=a(e),r=n?e===`top`?`block-start`:`block-end`:e===`start`?`inline-start`:`inline-end`,i=t===`center`?`span-all`:`span-${n?`inline`:`block`}-${t===`start`?`end`:`start`}`;return n?`${r} ${i}`:`${i} ${r}`}function s(e){let[t,n]=e.trim().split(` `);return n===void 0?t===`block-start`?`top`:t===`block-end`?`bottom`:t===`inline-start`?`start`:t===`inline-end`?`end`:null:t===`start`?`top`:t===`end`?`bottom`:n===`start`?`start`:n===`end`?`end`:null}function c(e){return a(e)?`flip-block, flip-inline, flip-block flip-inline`:`flip-inline, flip-block, flip-inline flip-block`}function l(e,t,n,r){let i=u(t,r);return i===`top`?e.top-n.top:i===`bottom`?n.top+n.height-(e.top+e.height):i===`left`?e.left-n.left:n.left+n.width-(e.left+e.width)}function u(e,t){return e===`top`||e===`bottom`?e:e===`start`===t?`right`:`left`}function d(e,t,n,r){return Math.max(n,Math.min(e,n+r-t))}function f(e,t,n,r){let{align:o,offset:s,flip:c,rtl:f}=r,p=(a(r.side)?t.height:t.width)+s,m=c&&l(e,r.side,n,f)<p&&l(e,i[r.side],n,f)>=p?i[r.side]:r.side,h=u(m,f),g={top:e.top-t.height-s,bottom:e.top+e.height+s,left:e.left-t.width-s,right:e.left+e.width+s}[h],_=a(m),v=_?e.left:e.top,y=_?e.width:e.height,b=_?t.width:t.height,x=o===`center`?v+y/2-b/2:o===`start`===(_&&f)?v+y-b:v,S=_?d(x,t.width,n.left,n.width):d(x,t.height,n.top,n.height);return _?{top:g,left:S,side:m}:{top:S,left:g,side:m}}var p=4,m=16,h={top:`mb`,bottom:`mt`,start:`me`,end:`ms`};function g(){return typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`anchor-name: --a`)}function _(){let e=typeof document>`u`?null:document.documentElement,t=e?parseFloat(getComputedStyle(e).fontSize):NaN;return Number.isFinite(t)&&t>0?t:m}function v(e){let{top:t,left:n,width:r,height:i}=e.getBoundingClientRect();return{top:t,left:n,width:r,height:i}}function y(e,t){return e!==null&&e.top===t.top&&e.left===t.left&&e.side===t.side&&e.anchorWidth===t.anchorWidth}function b(i={}){let{side:a=`bottom`,align:l=`center`,offset:u=0,flip:d=!0,matchWidth:m=!1,name:b,anchor:x,trackSide:S=!1}=i,C=n.t(`anchor`),w=`--${(b??C).replace(/^--/,``)}`,[T,E]=(0,r.useState)(!0),[D,O]=(0,r.useState)(null),[k,A]=(0,r.useState)(null),[j,M]=(0,r.useState)(null),[N,P]=(0,r.useState)(null);t.n(()=>{g()||E(!1)},[]),t.n(()=>{let t=e.h(x);if(t)return t.style.setProperty(`anchor-name`,w),()=>{t.style.removeProperty(`anchor-name`)}},[x,w]),t.n(()=>{!T||!S||!k||P(s(getComputedStyle(k).getPropertyValue(`position-area`)))},[T,S,k,a,l,d]),t.n(()=>{let t=e.h(x)??D;if(T||!t||!k)return;let n=()=>{let n=v(t),r=v(k),i={top:0,left:0,width:window.innerWidth,height:window.innerHeight},o=m?Math.max(r.width,n.width):r.width,s={...f(n,{...r,width:o},i,{side:a,align:l,offset:u/p*_(),flip:d,rtl:e._(t)}),anchorWidth:n.width};M(e=>y(e,s)?e:s)};n();let r=new AbortController;return document.addEventListener(`scroll`,n,{signal:r.signal,capture:!0,passive:!0}),window.addEventListener(`resize`,n,{signal:r.signal,passive:!0}),()=>r.abort()},[T,x,D,k,a,l,u,d,m]);let F=(0,r.useCallback)(e=>O(e),[]),I=(0,r.useCallback)(e=>A(e),[]),L={ref:T?void 0:F,style:{anchorName:w}};return T?{css:T,side:N??a,anchorProps:L,layerProps:{...S?{ref:I}:{},position:`fixed`,positionArea:o(a,l),...d?{positionTryFallbacks:c(a)}:{},...m?{minWidth:`anchor-size(width)`}:{},...u?{[h[a]]:u}:{},style:{positionAnchor:w}}}:{css:T,side:j?.side??a,anchorProps:L,layerProps:{ref:I,position:`fixed`,style:j?{top:`${j.top}px`,left:`${j.left}px`,...m?{minWidth:`${j.anchorWidth}px`}:{}}:{top:0,left:0,visibility:`hidden`}}}}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return b}});
|
package/placement.mjs
CHANGED
package/platform.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=globalThis[Symbol.for(`box-kite.componentAttribute`)]??={on:!1,warnings:!0},t=()=>e.on,n=()=>e.warnings;function r(t){e.on=t}function i(t){e.warnings=t}function a(e){return e?`current`in e?e.current:e:null}function o(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function s(e){let t=a(e);return t instanceof HTMLElement?t:null}function c(e,t){let n=typeof e.composedPath==`function`?e.composedPath():[];return t.some(t=>{let r=a(t);return r?n.includes(r)||e.target instanceof Node&&r.contains(e.target):!1})}function l(e){let t=a(e),n=t?.ownerDocument?.defaultView;return!!t&&!!n&&n.getComputedStyle(t).direction===`rtl`}function u(e){let t=a(e)?.ownerDocument?.defaultView?.getSelection();t&&!t.isCollapsed&&t.removeAllRanges()}var d=`box-kite:modal`;function f(e,t){e.ownerDocument.dispatchEvent(new CustomEvent(d,{detail:{dialog:e,open:t}}))}function p(){return typeof window<`u`&&window.document!==void 0}function
|
|
1
|
+
var e=globalThis[Symbol.for(`box-kite.componentAttribute`)]??={on:!1,warnings:!0},t=()=>e.on,n=()=>e.warnings;function r(t){e.on=t}function i(t){e.warnings=t}function a(e){return e?`current`in e?e.current:e:null}function o(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function s(e){let t=a(e);return t instanceof HTMLElement?t:null}function c(e,t){let n=typeof e.composedPath==`function`?e.composedPath():[];return t.some(t=>{let r=a(t);return r?n.includes(r)||e.target instanceof Node&&r.contains(e.target):!1})}function l(e){let t=a(e),n=t?.ownerDocument?.defaultView;return!!t&&!!n&&n.getComputedStyle(t).direction===`rtl`}function u(e){let t=a(e)?.ownerDocument?.defaultView?.getSelection();t&&!t.isCollapsed&&t.removeAllRanges()}var d=`box-kite:modal`;function f(e,t){e.ownerDocument.dispatchEvent(new CustomEvent(d,{detail:{dialog:e,open:t}}))}var p=`a[href],area[href],button,input:not([type="hidden"]),select,textarea,iframe,summary,[contenteditable]:not([contenteditable="false"]),[tabindex]`;function m(e){for(let t of e.querySelectorAll(p))if(!(t.tabIndex<0||t.matches(`:disabled`)||t.closest(`[inert]`))&&!(typeof t.checkVisibility==`function`&&!t.checkVisibility({visibilityProperty:!0})))return t;return null}function h(){return typeof window<`u`&&window.document!==void 0}function g(){try{return process.env.NODE_ENV!==`production`}catch{return!1}}function _(){return typeof document<`u`}function v(){return _()?document:null}function y(){return v()?.documentElement??null}function b(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype.showPopover==`function`}function x(){return typeof HTMLDialogElement<`u`&&`closedBy`in HTMLDialogElement.prototype}function S(e){return typeof window>`u`||typeof window.matchMedia!=`function`?null:window.matchMedia(e)}Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return i}});
|
package/platform.mjs
CHANGED
|
@@ -43,35 +43,40 @@ function f(e, t) {
|
|
|
43
43
|
open: t
|
|
44
44
|
} }));
|
|
45
45
|
}
|
|
46
|
+
var p = "a[href],area[href],button,input:not([type=\"hidden\"]),select,textarea,iframe,summary,[contenteditable]:not([contenteditable=\"false\"]),[tabindex]";
|
|
47
|
+
function m(e) {
|
|
48
|
+
for (let t of e.querySelectorAll(p)) if (!(t.tabIndex < 0 || t.matches(":disabled") || t.closest("[inert]")) && !(typeof t.checkVisibility == "function" && !t.checkVisibility({ visibilityProperty: !0 }))) return t;
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
46
51
|
//#endregion
|
|
47
52
|
//#region src/utils/environment/environmentUtils.ts
|
|
48
|
-
function
|
|
53
|
+
function h() {
|
|
49
54
|
return typeof window < "u" && window.document !== void 0;
|
|
50
55
|
}
|
|
51
|
-
function
|
|
56
|
+
function g() {
|
|
52
57
|
try {
|
|
53
58
|
return process.env.NODE_ENV !== "production";
|
|
54
59
|
} catch {
|
|
55
60
|
return !1;
|
|
56
61
|
}
|
|
57
62
|
}
|
|
58
|
-
function
|
|
63
|
+
function _() {
|
|
59
64
|
return typeof document < "u";
|
|
60
65
|
}
|
|
61
|
-
function
|
|
62
|
-
return
|
|
66
|
+
function v() {
|
|
67
|
+
return _() ? document : null;
|
|
63
68
|
}
|
|
64
|
-
function
|
|
65
|
-
return
|
|
69
|
+
function y() {
|
|
70
|
+
return v()?.documentElement ?? null;
|
|
66
71
|
}
|
|
67
|
-
function
|
|
72
|
+
function b() {
|
|
68
73
|
return typeof HTMLElement < "u" && typeof HTMLElement.prototype.showPopover == "function";
|
|
69
74
|
}
|
|
70
|
-
function
|
|
75
|
+
function x() {
|
|
71
76
|
return typeof HTMLDialogElement < "u" && "closedBy" in HTMLDialogElement.prototype;
|
|
72
77
|
}
|
|
73
|
-
function
|
|
78
|
+
function S(e) {
|
|
74
79
|
return typeof window > "u" || typeof window.matchMedia != "function" ? null : window.matchMedia(e);
|
|
75
80
|
}
|
|
76
81
|
//#endregion
|
|
77
|
-
export {
|
|
82
|
+
export { l as _, g as a, r as b, b as c, o as d, u as f, c as g, s as h, h as i, d as l, m, y as n, S as o, a as p, _ as r, x as s, v as t, f as u, t as v, n as x, i as y };
|