@ishibashi0112/spreadsheet-grid 1.14.0 → 1.16.0

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.
Files changed (98) hide show
  1. package/API_REFERENCE.md +155 -14
  2. package/README.md +12 -12
  3. package/dist/{ColumnFilterPopover-DObE236Y.cjs → ColumnFilterPopover-BAbebPGi.cjs} +1 -1
  4. package/dist/{ColumnFilterPopover-xpVqTNCI.js → ColumnFilterPopover-BvYD9Vkm.js} +14 -14
  5. package/dist/GridShell.d.ts +1 -1
  6. package/dist/common.d.ts +1 -1
  7. package/dist/features/cellSpan.d.ts +2 -0
  8. package/dist/features/pagination.d.ts +2 -0
  9. package/dist/features/types.d.ts +13 -0
  10. package/dist/hooks/useGridBarContext.d.ts +5 -3
  11. package/dist/hooks/useGridLocaleText.d.ts +1 -1
  12. package/dist/index.cjs +14 -13
  13. package/dist/index.js +4514 -4047
  14. package/dist/lite/{ColumnFilterPopover-DGBKLT_x.js → ColumnFilterPopover-DJqOffVo.js} +14 -14
  15. package/dist/lite/{ColumnFilterPopover-BXsxUZ-l.cjs → ColumnFilterPopover-DW0DqOzN.cjs} +1 -1
  16. package/dist/lite/{columnMenu-DcjRobOG.cjs → columnMenu-D7-Z54n9.cjs} +1 -1
  17. package/dist/lite/{contextMenu-Cb9KT0FS.js → contextMenu-CfenOCg4.js} +5 -5
  18. package/dist/lite/{contextMenu-C_EUynb4.cjs → contextMenu-QpgjA9UO.cjs} +1 -1
  19. package/dist/lite/createSpreadsheetGrid-B0C1IC8b.cjs +14 -0
  20. package/dist/lite/createSpreadsheetGrid-vxSCZBkg.js +5784 -0
  21. package/dist/lite/createSpreadsheetGrid.cjs +1 -1
  22. package/dist/lite/createSpreadsheetGrid.js +1 -1
  23. package/dist/lite/dateTimeEditors-BQHo30YV.cjs +1 -0
  24. package/dist/lite/{dateTimeEditors-CbxvlPg6.js → dateTimeEditors-D26TOWMw.js} +10 -10
  25. package/dist/lite/features/cellSpan.cjs +1 -0
  26. package/dist/lite/features/cellSpan.js +10 -0
  27. package/dist/lite/features/columnMenu.cjs +1 -1
  28. package/dist/lite/features/columnMenu.js +1 -1
  29. package/dist/lite/features/contextMenu.cjs +1 -1
  30. package/dist/lite/features/contextMenu.js +1 -1
  31. package/dist/lite/features/dateTimeEditors.cjs +1 -1
  32. package/dist/lite/features/dateTimeEditors.js +1 -1
  33. package/dist/lite/features/fillHandle.cjs +1 -1
  34. package/dist/lite/features/fillHandle.js +1 -1
  35. package/dist/lite/features/filtering.cjs +1 -1
  36. package/dist/lite/features/filtering.js +1 -1
  37. package/dist/lite/features/grouping.cjs +1 -1
  38. package/dist/lite/features/grouping.js +1 -1
  39. package/dist/lite/features/multiSelect.cjs +1 -1
  40. package/dist/lite/features/multiSelect.js +1 -1
  41. package/dist/lite/features/pagination.cjs +1 -0
  42. package/dist/lite/features/pagination.js +2 -0
  43. package/dist/lite/features/rowDrag.cjs +1 -1
  44. package/dist/lite/features/rowDrag.js +1 -1
  45. package/dist/lite/features/scrollHint.cjs +1 -1
  46. package/dist/lite/features/scrollHint.js +1 -1
  47. package/dist/lite/features/selectSearch.cjs +1 -1
  48. package/dist/lite/features/selectSearch.js +1 -1
  49. package/dist/lite/features/standard.cjs +1 -1
  50. package/dist/lite/features/standard.js +3 -3
  51. package/dist/lite/features/toolPanel.cjs +1 -1
  52. package/dist/lite/features/toolPanel.js +1 -1
  53. package/dist/lite/{fillHandle-pS7c7vQ2.js → fillHandle-CJ7G5gOc.js} +11 -11
  54. package/dist/lite/{fillHandle-4pow6QTn.cjs → fillHandle-DGSKtU4S.cjs} +1 -1
  55. package/dist/lite/{filtering-DaFmWbBq.js → filtering-CnIEcMBv.js} +1 -1
  56. package/dist/lite/{filtering-DskgJ8zD.cjs → filtering-D6JStdAV.cjs} +1 -1
  57. package/dist/lite/grouping-BKT6i8at.cjs +1 -0
  58. package/dist/lite/{grouping-u4J8Rl0V.js → grouping-CZ86adA8.js} +30 -30
  59. package/dist/lite/{lazyPopups-Cokq5TOf.cjs → lazyPopups-Deg8RLOp.cjs} +1 -1
  60. package/dist/lite/{lazyPopups-DlBfI7Iu.js → lazyPopups-FC3muc3A.js} +1 -1
  61. package/dist/lite/{multiSelect-CcxB2bAd.cjs → multiSelect-CiZACf9R.cjs} +1 -1
  62. package/dist/lite/pagination-C6zVQode.cjs +1 -0
  63. package/dist/lite/pagination-DJB7JLDr.js +114 -0
  64. package/dist/lite/rowDrag-DMI_HkRV.cjs +1 -0
  65. package/dist/lite/{rowDrag-e6TC1gsM.js → rowDrag-DZ5LiIQN.js} +20 -19
  66. package/dist/lite/scrollHint-Bn6YBjDF.js +210 -0
  67. package/dist/lite/scrollHint-CvLQcvC4.cjs +1 -0
  68. package/dist/lite/{selectSearch-UHDjcmLg.cjs → selectSearch-BHvehpN1.cjs} +1 -1
  69. package/dist/lite/{toolPanel-BEzcyMBS.js → toolPanel-C-kWDCnb.js} +1 -1
  70. package/dist/lite/{toolPanel-BD5l2a18.cjs → toolPanel-DeAKnVCk.cjs} +1 -1
  71. package/dist/lite/{toolPanelViews-WFJ3Pyv_.cjs → toolPanelViews-CfqsOZ3O.cjs} +1 -1
  72. package/dist/lite/{toolPanelViews-PPO_KXMP.js → toolPanelViews-DtZjUWBU.js} +21 -21
  73. package/dist/lite.cjs +1 -1
  74. package/dist/lite.d.ts +2 -0
  75. package/dist/lite.js +26 -24
  76. package/dist/model/gridTypes.d.ts +4 -0
  77. package/dist/style.css +1 -1
  78. package/dist/style.layer.css +1 -1
  79. package/dist/{toolPanelViews-GXwba3Zw.cjs → toolPanelViews-D0PXQUTs.cjs} +1 -1
  80. package/dist/{toolPanelViews-C8Vw3fEC.js → toolPanelViews-ViZu3POz.js} +21 -21
  81. package/dist/view/DefaultGridBottomBar.d.ts +3 -1
  82. package/dist/view/DefaultGridTopBar.d.ts +2 -1
  83. package/dist/view/GridBodyGroupRow.d.ts +2 -1
  84. package/dist/view/GridBodyLayer.d.ts +5 -1
  85. package/dist/view/GridPager.d.ts +13 -0
  86. package/dist/view/GridScrollHint.d.ts +3 -1
  87. package/package.json +2 -2
  88. package/skills/spreadsheet-grid/SKILL.md +6 -3
  89. package/dist/lite/createSpreadsheetGrid-Bn5cneMS.js +0 -5440
  90. package/dist/lite/createSpreadsheetGrid-Di5iNqyu.cjs +0 -13
  91. package/dist/lite/dateTimeEditors-BrNH3QkX.cjs +0 -1
  92. package/dist/lite/grouping-DKYPOjCk.cjs +0 -1
  93. package/dist/lite/rowDrag-Cn5fud6W.cjs +0 -1
  94. package/dist/lite/scrollHint-Bt8fuU7l.cjs +0 -1
  95. package/dist/lite/scrollHint-Dr4TOFNn.js +0 -196
  96. package/dist/lite/{columnMenu-CpfckJa8.js → columnMenu-CmSQBO6a.js} +1 -1
  97. package/dist/lite/{multiSelect-fz6tgldg.js → multiSelect-pn5viglb.js} +1 -1
  98. package/dist/lite/{selectSearch-n7CsaJiu.js → selectSearch-rvAF_O8j.js} +1 -1
@@ -1 +1 @@
1
- const e=require("./usePortalTokens-CeVR4LF2.cjs"),t=require("./useVirtualizerCore-CA1UYXG3.cjs"),n=require("./usePopupLocaleText-CmlJsMAf.cjs");let r=require("react"),i=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/cx"),a=require("react-dom"),o=require("@ishibashi0112/spreadsheet-grid-core/internal/controllers/escapeClaimController"),s=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards"),c=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText"),l=require("react/jsx-runtime"),u=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/editorValues"),d=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering"),f=require("@ishibashi0112/spreadsheet-grid-core/internal/utils/shadowDom"),p=require("@ishibashi0112/spreadsheet-grid-core/internal/controllers/dateRolloverStore"),m=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterPresets"),h=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFilters"),g=require("@ishibashi0112/spreadsheet-grid-core/internal/controllers/popoverSupport"),_=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/focusCycle"),v=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/setFilterSearch"),y=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/setFilterSelection"),b=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/numberFilterCondition"),x=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/textFilterCondition"),S=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterCondition"),C=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/datePickerCalendar"),w=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterTree");function T({value:e,onCommit:t,ariaLabel:a,inputRef:o,onRequestClose:p,align:m=`left`}){let h=n.t(),[g,_]=(0,r.useState)(null),[v,y]=(0,r.useState)(!1),[b,x]=(0,r.useState)(!1),[S,w]=(0,r.useState)(`days`),[T,E]=(0,r.useState)(()=>new Date().getFullYear()),[D,O]=(0,r.useState)(()=>new Date().getMonth()),k=(0,r.useRef)(null),A=g??(0,C.formatFilterDateDisplay)(e),j=(0,d.toDateKey)(new Date)??``,M=()=>{if(g===null)return;let e=g.trim();if(e===``){t(``),_(null),y(!1);return}let n=(0,u.parseFilterDateText)(e);if(n===null){y(!0);return}t(n),_(null),y(!1)},N=()=>{let[t,n]=(e===``?j:e).split(`-`);E(Number(t)),O(Number(n)-1),w(`days`),x(!0)},P=()=>{x(!1)},F=e=>{t(e),_(null),y(!1),P()};(0,r.useEffect)(()=>{if(!b)return;let e=e=>{let t=(0,f.getEventTarget)(e,k.current??null);t&&k.current?.contains(t)||x(!1)};return document.addEventListener(`pointerdown`,e,!0),()=>{document.removeEventListener(`pointerdown`,e,!0)}},[b]);let I=e=>{if(e.stopPropagation(),e.key===`Enter`){if((0,s.isImeComposingKeyEvent)(e.nativeEvent))return;e.preventDefault(),M(),P();return}if(e.key===`Escape`){if(e.preventDefault(),b){P();return}p()}},L=e=>({onPointerDown:t=>{t.preventDefault(),t.stopPropagation(),e()},onKeyDown:t=>{if(t.stopPropagation(),t.key===`Enter`||t.key===` `){t.preventDefault(),e();return}if(t.key===`Escape`){if(t.preventDefault(),b){P(),t.currentTarget.closest(`.ssg-dp-root`)?.querySelector(`.ssg-dp-input`)?.focus();return}p()}}}),R=e=>{if(S===`days`){let t=new Date(T,D+e,1);E(t.getFullYear()),O(t.getMonth());return}if(S===`months`){E(t=>t+e);return}E(t=>t+e*12)},z=()=>{w(e=>e===`days`?`months`:`years`)},B=()=>{w(e=>e===`years`?`months`:`days`)},V=S===`days`?(0,c.formatLocaleText)(h.calendarTitle,{year:T,month:D+1}):S===`months`?(0,c.formatLocaleText)(h.calendarYear,{year:T}):`${(0,C.yearGridStart)(T)} – ${(0,C.yearGridStart)(T)+11}`;return(0,l.jsxs)(`div`,{ref:k,className:`ssg-dp-root`,children:[(0,l.jsxs)(`div`,{className:(0,i.cx)(`ssg-dp-field`,b&&`ssg-dp-field--open`,v&&`ssg-dp-field--invalid`),children:[(0,l.jsx)(`input`,{ref:o,type:`text`,inputMode:`numeric`,value:A,placeholder:`yyyy/mm/dd`,"aria-label":a,"aria-invalid":v||void 0,className:`ssg-dp-input`,onChange:e=>{_(e.target.value),y(!1)},onKeyDown:I,onBlur:M}),(0,l.jsx)(`button`,{type:`button`,className:`ssg-dp-cal-btn`,"aria-label":b?h.calendarClose:h.calendarOpen,...L(()=>{b?P():N()}),children:(0,l.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,l.jsx)(`rect`,{x:`1.5`,y:`2.5`,width:`13`,height:`12`,rx:`1.5`,fill:`none`,stroke:`currentColor`}),(0,l.jsx)(`line`,{x1:`1.5`,y1:`6`,x2:`14.5`,y2:`6`,stroke:`currentColor`}),(0,l.jsx)(`line`,{x1:`5`,y1:`1`,x2:`5`,y2:`4`,stroke:`currentColor`}),(0,l.jsx)(`line`,{x1:`11`,y1:`1`,x2:`11`,y2:`4`,stroke:`currentColor`})]})})]}),b&&(0,l.jsxs)(`div`,{className:(0,i.cx)(`ssg-dp-panel`,m===`right`&&`ssg-dp-panel--right`),children:[(0,l.jsxs)(`div`,{className:`ssg-dp-nav`,children:[(0,l.jsx)(`button`,{type:`button`,className:`ssg-dp-nav-btn`,"aria-label":h.calendarPrevious,...L(()=>R(-1)),children:`‹`}),(0,l.jsx)(`button`,{type:`button`,className:`ssg-dp-nav-title`,disabled:S===`years`,"aria-label":h.calendarChangeView,...L(z),children:V}),(0,l.jsx)(`button`,{type:`button`,className:`ssg-dp-nav-btn`,"aria-label":h.calendarNext,...L(()=>R(1)),children:`›`})]}),S===`days`&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`div`,{className:`ssg-dp-dow`,children:h.calendarWeekdays.map((e,t)=>(0,l.jsx)(`span`,{className:(0,i.cx)(t===0&&`ssg-dp-dow--sun`,t===6&&`ssg-dp-dow--sat`),children:e},t))}),(0,l.jsx)(`div`,{className:`ssg-dp-days`,children:(0,C.buildCalendarDayCells)(T,D).map(t=>(0,l.jsx)(`button`,{type:`button`,className:(0,i.cx)(`ssg-dp-day`,!t.inCurrentMonth&&`ssg-dp-day--out`,t.key===j&&`ssg-dp-day--today`,t.key===e&&`ssg-dp-day--selected`),"aria-label":t.key,...L(()=>F(t.key)),children:t.day},t.key))})]}),S===`months`&&(0,l.jsx)(`div`,{className:`ssg-dp-grid`,children:h.calendarMonths.map((e,t)=>(0,l.jsx)(`button`,{type:`button`,className:(0,i.cx)(`ssg-dp-cell`,t===D&&`ssg-dp-cell--selected`),...L(()=>{O(t),w(`days`)}),children:e},t))}),S===`years`&&(0,l.jsx)(`div`,{className:`ssg-dp-grid`,children:(0,C.buildYearGrid)(T).map(e=>(0,l.jsx)(`button`,{type:`button`,className:(0,i.cx)(`ssg-dp-cell`,e===T&&`ssg-dp-cell--selected`),...L(()=>{E(e),w(`months`)}),children:e},e))}),(0,l.jsxs)(`div`,{className:`ssg-dp-foot`,children:[S!==`days`&&(0,l.jsx)(`button`,{type:`button`,className:`ssg-dp-foot-btn`,...L(B),children:h.calendarBack}),(0,l.jsx)(`button`,{type:`button`,className:`ssg-dp-foot-btn`,...L(()=>F(j)),children:h.calendarToday}),(0,l.jsx)(`button`,{type:`button`,className:`ssg-dp-foot-btn ssg-dp-foot-btn--muted`,...L(()=>F(``)),children:h.clear})]})]})]})}var E=24,D=40,O=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(pointer: coarse)`).matches?D:E,k=(e,t,n)=>e===``&&t===h.DEFAULT_FILTER_LOCALE_TEXT.blank?n:t,A=(e,t)=>t===h.DEFAULT_FILTER_LOCALE_TEXT.blank?e:e.map(e=>e.value===``&&e.label===h.DEFAULT_FILTER_LOCALE_TEXT.blank?{...e,label:t}:e);function j({options:e,setSelection:i,searchInputRef:a,onValueToggle:o,onSelectAllChange:u,onReplaceSelection:d,onRequestClose:f,isServerSide:p,selectAllUsesExplicitScope:m=!1,truncated:h=!1}){let g=n.t(),[_,b]=(0,r.useState)(``),x=(0,r.useDeferredValue)(_),S=(0,r.useMemo)(()=>A(e,g.blank),[e,g.blank]),C=(0,r.useMemo)(()=>(0,v.filterSetOptionsBySearch)(S,x),[S,x]),w=x.trim().length>0,T=(0,r.useRef)(null),[E]=(0,r.useState)(O),D=t.t({count:C.length,getScrollElement:()=>T.current,estimateSize:()=>E,overscan:10}),j=(0,r.useMemo)(()=>{if(i===null)return C.length;let e=0;for(let t of C)(0,y.isSetValueSelected)(i,t.value)&&(e+=1);return e},[i,C]),M=C.length>0&&j===C.length,N=j>0&&!M,P=(0,r.useMemo)(()=>new Set(e.map(e=>e.value)),[e]),F=(0,r.useMemo)(()=>{if(i===null)return e.length;let t=0;for(let e of i.values)P.has(e)&&(t+=1);return i.mode===`include`?t:e.length-t},[i,P,e.length]);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`input`,{ref:a,type:`text`,value:_,onChange:e=>b(e.target.value),onKeyDown:e=>{if(e.stopPropagation(),e.key===`Escape`&&(e.preventDefault(),f()),e.key===`Enter`){if((0,s.isImeComposingKeyEvent)(e.nativeEvent))return;e.preventDefault();let t=(0,v.resolveSetFilterEnterAction)(S,_);if(t.kind===`none`)return;t.kind===`replace`&&d(t.values),f()}},placeholder:g.filterSearchPlaceholder,"aria-label":g.filterSearchPlaceholder,className:`ssg-filter-input`}),(0,l.jsxs)(`label`,{className:`ssg-filter-selectall`,children:[(0,l.jsx)(`input`,{type:`checkbox`,checked:M,ref:e=>{e&&(e.indeterminate=N)},onChange:()=>{u(w||m?C.map(e=>e.value):`all`,!M)}}),(0,l.jsx)(`span`,{className:`ssg-filter-selectall-label`,children:w?g.filterSelectAllResults:g.filterSelectAll})]}),(0,l.jsx)(`div`,{ref:T,className:`ssg-filter-list`,children:C.length===0?(0,l.jsx)(`div`,{className:`ssg-filter-empty`,children:e.length===0?p?g.filterNoOptionsSource:g.noOptions:g.filterNoMatches}):(0,l.jsx)(`div`,{className:`ssg-filter-virt`,style:{height:D.getTotalSize()},children:D.getVirtualItems().map(e=>{let t=C[e.index];if(!t)return null;let n=(0,y.isSetValueSelected)(i,t.value);return(0,l.jsxs)(`label`,{className:`ssg-filter-option`,style:{transform:`translateY(${e.start}px)`,height:e.size},children:[(0,l.jsx)(`input`,{type:`checkbox`,checked:n,onChange:()=>o(t.value)}),(0,l.jsx)(`span`,{className:`ssg-filter-option-label`,children:k(t.value,t.label,g.blank)})]},t.value)})})}),(0,l.jsxs)(`div`,{className:`ssg-filter-meta`,children:[(0,c.formatLocaleText)(g.filterSelectedCount,{selected:F,total:e.length}),w?(0,c.formatLocaleText)(g.filterShownCount,{count:C.length}):``,h&&(0,l.jsx)(B,{})]})]})}var M=e=>{e.key!==`Escape`&&e.stopPropagation()},N=e=>e.nativeEvent.isComposing===!0,P=(e,t,n)=>{if(N(n)){e(t,{commit:!1});return}e(t)};function F({draft:e,valueInputRef:t,onDraftChange:r,onKeyDown:i}){let a=n.t(),o=(0,b.numberFilterOperandCount)(e.operator);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`select`,{value:e.operator,onChange:t=>r({...e,operator:t.target.value}),onKeyDown:i,className:`ssg-filter-select`,"aria-label":a.filterOperator,children:b.NUMBER_FILTER_OPERATOR_OPTIONS.map(e=>(0,l.jsx)(`option`,{value:e.value,children:a[e.labelKey]},e.value))}),o>0?(0,l.jsxs)(`div`,{className:`ssg-filter-cond-values`,children:[(0,l.jsx)(`input`,{ref:t,type:`text`,inputMode:`decimal`,value:e.value1,onChange:t=>P(r,{...e,value1:t.target.value},t),onCompositionEnd:t=>r({...e,value1:t.currentTarget.value}),onKeyDown:i,placeholder:o===2?a.filterMin:a.filterValuePlaceholder,className:`ssg-filter-input`,"aria-label":o===2?a.filterMin:a.filterValue}),o===2&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`span`,{className:`ssg-filter-cond-tilde`,children:a.filterRangeSeparator}),(0,l.jsx)(`input`,{type:`text`,inputMode:`decimal`,value:e.value2,onChange:t=>P(r,{...e,value2:t.target.value},t),onCompositionEnd:t=>r({...e,value2:t.currentTarget.value}),onKeyDown:i,placeholder:a.filterMax,className:`ssg-filter-input`,"aria-label":a.filterMax})]})]}):(0,l.jsx)(`div`,{className:`ssg-filter-meta`,children:a.filterNoValue})]})}function I({draft:e,valueInputRef:t,onDraftChange:r,onKeyDown:i}){let a=n.t(),o=(0,x.textFilterOperandCount)(e.operator);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`select`,{value:e.operator,onChange:t=>r({...e,operator:t.target.value}),onKeyDown:i,className:`ssg-filter-select`,"aria-label":a.filterOperator,children:x.TEXT_FILTER_OPERATOR_OPTIONS.map(e=>(0,l.jsx)(`option`,{value:e.value,children:a[e.labelKey]},e.value))}),o>0?(0,l.jsx)(`div`,{className:`ssg-filter-cond-values`,children:(0,l.jsx)(`input`,{ref:t,type:`text`,value:e.value,onChange:t=>P(r,{...e,value:t.target.value},t),onCompositionEnd:t=>r({...e,value:t.currentTarget.value}),onKeyDown:i,placeholder:a.filterValuePlaceholder,className:`ssg-filter-input`,"aria-label":a.filterValue})}):(0,l.jsx)(`div`,{className:`ssg-filter-meta`,children:a.filterNoValue})]})}function L({draft:e,valueInputRef:t,onDraftChange:r,onKeyDown:a,presets:o,renderDateInput:s,onRequestClose:c}){let u=n.t(),d=e.preset===null?(0,S.dateFilterOperandCount)(e.operator):0,f=(t,n)=>{r({...e,[t]:(0,S.normalizeFilterDateInputValue)(n),preset:null})};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`select`,{value:e.operator,onChange:t=>r({...e,operator:t.target.value,preset:null}),onKeyDown:a,className:`ssg-filter-select`,"aria-label":u.filterOperator,children:S.DATE_FILTER_OPERATOR_OPTIONS.map(e=>(0,l.jsx)(`option`,{value:e.value,children:u[e.labelKey]},e.value))}),d>0?(0,l.jsxs)(`div`,{className:`ssg-filter-cond-values`,children:[s?s({value:e.value1,onChange:e=>f(`value1`,e),ariaLabel:d===2?u.filterStartDate:u.filterDate,slot:d===2?`from`:`single`}):(0,l.jsx)(T,{value:e.value1,onCommit:t=>r({...e,value1:t,preset:null}),ariaLabel:d===2?u.filterStartDate:u.filterDate,inputRef:t,onRequestClose:c}),d===2&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`span`,{className:`ssg-filter-cond-tilde`,children:u.filterRangeSeparator}),s?s({value:e.value2,onChange:e=>f(`value2`,e),ariaLabel:u.filterEndDate,slot:`to`}):(0,l.jsx)(T,{value:e.value2,onCommit:t=>r({...e,value2:t,preset:null}),ariaLabel:u.filterEndDate,onRequestClose:c,align:`right`})]})]}):e.preset===null?(0,l.jsx)(`div`,{className:`ssg-filter-meta`,children:u.filterNoValue}):null,o.length>0&&(0,l.jsx)(`div`,{className:`ssg-filter-presets`,children:o.map(t=>(0,l.jsx)(`button`,{type:`button`,onPointerDown:n=>{n.preventDefault(),n.stopPropagation(),r({...e,preset:e.preset===t.id?null:t.id}),(0,g.keepFocusAfterPress)(n.currentTarget)},onKeyDown:n=>{M(n),(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),r({...e,preset:e.preset===t.id?null:t.id}))},className:(0,i.cx)(`ssg-filter-preset-chip`,e.preset===t.id&&`ssg-filter-preset-chip--active`),children:t.label},t.id))})]})}function R({options:e,setSelection:i,searchInputRef:a,onValueToggle:o,onSelectAllChange:u,onReplaceSelection:d,onRequestClose:f,isServerSide:p,truncated:m=!1}){let h=n.t(),[g,_]=(0,r.useState)(``),b=(0,r.useDeferredValue)(g),[x,S]=(0,r.useState)(()=>new Set),C=b.trim().length>0,T=(0,r.useMemo)(()=>A(e,h.blank),[e,h.blank]),E=(0,r.useMemo)(()=>(0,v.filterSetOptionsBySearch)(T,b),[T,b]),D=(0,r.useMemo)(()=>(0,w.buildDateTreeRows)(e,x,h),[e,x,h]),j=(0,r.useRef)(null),N=C?E.length:D.length,[P]=(0,r.useState)(O),F=t.t({count:N,getScrollElement:()=>j.current,estimateSize:()=>P,overscan:10}),I=(0,r.useMemo)(()=>(C?E:e).map(e=>e.value),[C,E,e]),L=(0,r.useMemo)(()=>{let e=0;for(let t of I)(0,y.isSetValueSelected)(i,t)&&(e+=1);return e},[I,i]),R=I.length>0&&L===I.length,z=L>0&&!R,V=(0,r.useMemo)(()=>new Set(e.map(e=>e.value)),[e]),H=(0,r.useMemo)(()=>{if(i===null)return e.length;let t=0;for(let e of i.values)V.has(e)&&(t+=1);return i.mode===`include`?t:e.length-t},[i,V,e.length]),U=e=>{S(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},W=e=>{let t=0;for(let n of e)(0,y.isSetValueSelected)(i,n)&&(t+=1);return t},G=e=>{if(e.type===`leaf`){o(e.key);return}let t=e.leafKeys.length>0&&W(e.leafKeys)===e.leafKeys.length;u(e.leafKeys,!t)},ee=e=>{let t=W(e.leafKeys),n=e.leafKeys.length>0&&t===e.leafKeys.length,r=t>0&&!n;return(0,l.jsxs)(l.Fragment,{children:[e.type===`group`?(0,l.jsx)(`button`,{type:`button`,onPointerDown:t=>{t.preventDefault(),t.stopPropagation(),U(e.key)},onKeyDown:t=>{M(t),(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),U(e.key))},className:`ssg-filter-tree-toggle`,"aria-label":e.expanded?h.treeCollapse:h.treeExpand,children:e.expanded?`▾`:`▸`}):(0,l.jsx)(`span`,{className:`ssg-filter-tree-toggle ssg-filter-tree-toggle--placeholder`}),(0,l.jsx)(`input`,{type:`checkbox`,checked:n,ref:e=>{e&&(e.indeterminate=r)},"aria-label":k(e.key,e.label,h.blank),onChange:()=>G(e)}),(0,l.jsx)(`span`,{className:`ssg-filter-option-label`,children:k(e.key,e.label,h.blank)})]})};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`input`,{ref:a,type:`text`,value:g,onChange:e=>_(e.target.value),onKeyDown:e=>{if(e.stopPropagation(),e.key===`Escape`&&(e.preventDefault(),f()),e.key===`Enter`){if((0,s.isImeComposingKeyEvent)(e.nativeEvent))return;e.preventDefault();let t=(0,v.resolveSetFilterEnterAction)(T,g);if(t.kind===`none`)return;t.kind===`replace`&&d(t.values),f()}},placeholder:h.filterSearchPlaceholder,"aria-label":h.filterSearchPlaceholder,className:`ssg-filter-input`}),(0,l.jsxs)(`label`,{className:`ssg-filter-selectall`,children:[(0,l.jsx)(`input`,{type:`checkbox`,checked:R,ref:e=>{e&&(e.indeterminate=z)},onChange:()=>u(I,!R)}),(0,l.jsx)(`span`,{className:`ssg-filter-selectall-label`,children:C?h.filterSelectAllResults:h.filterSelectAll})]}),(0,l.jsx)(`div`,{ref:j,className:`ssg-filter-list`,children:N===0?(0,l.jsx)(`div`,{className:`ssg-filter-empty`,children:e.length===0?p?h.filterNoOptionsSource:h.noOptions:h.filterNoMatches}):(0,l.jsx)(`div`,{className:`ssg-filter-virt`,style:{height:F.getTotalSize()},children:F.getVirtualItems().map(e=>{if(C){let t=E[e.index];return t?(0,l.jsxs)(`label`,{className:`ssg-filter-option`,style:{transform:`translateY(${e.start}px)`,height:e.size},children:[(0,l.jsx)(`input`,{type:`checkbox`,checked:(0,y.isSetValueSelected)(i,t.value),onChange:()=>o(t.value)}),(0,l.jsx)(`span`,{className:`ssg-filter-option-label`,children:k(t.value,t.label,h.blank)})]},t.value):null}let t=D[e.index];return t?(0,l.jsx)(`div`,{className:`ssg-filter-option`,style:{transform:`translateY(${e.start}px)`,height:e.size,paddingLeft:8+t.depth*16},onClick:e=>{e.target.closest(`button, input`)||G(t)},children:ee(t)},t.key):null})})}),(0,l.jsxs)(`div`,{className:`ssg-filter-meta`,children:[(0,c.formatLocaleText)(h.filterSelectedCount,{selected:H,total:e.length}),C?(0,c.formatLocaleText)(h.filterShownCount,{count:E.length}):``,m&&(0,l.jsx)(B,{})]})]})}function z({status:e,errorMessage:t,onRetry:r}){let i=n.t();return e===`loading`?(0,l.jsx)(`div`,{className:`ssg-filter-collecting`,children:i.filterOptionsLoading}):(0,l.jsxs)(`div`,{className:`ssg-filter-error`,role:`alert`,children:[(0,l.jsx)(`div`,{children:i.filterOptionsFailed}),t?(0,l.jsx)(`div`,{className:`ssg-filter-error-detail`,title:t,children:t}):null,r?(0,l.jsx)(`button`,{type:`button`,onPointerDown:e=>{e.preventDefault(),e.stopPropagation(),r()},onKeyDown:e=>{M(e),(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r())},className:`ssg-filter-btn-secondary`,children:i.retry}):null]})}function B(){return(0,l.jsx)(`span`,{className:`ssg-filter-truncated`,children:n.t().filterOptionsTruncated})}function V({conditionEditor:e,conditionActive:t,onConditionClear:r,options:i,setSelection:a,onSelectionClear:o,summaryText:s,children:u,optionsMeta:d}){let f=n.t();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`ssg-filter-sec-head`,children:[(0,l.jsx)(`span`,{className:`ssg-filter-sec-label`,children:f.filterConditionSection}),(0,l.jsx)(`button`,{type:`button`,onPointerDown:e=>{e.preventDefault(),e.stopPropagation(),r()},onKeyDown:e=>{M(e),(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r())},className:`ssg-filter-sec-clear`,disabled:!t,children:f.clear})]}),e,(0,l.jsx)(`div`,{className:`ssg-filter-sep`}),(0,l.jsxs)(`div`,{className:`ssg-filter-sec-head`,children:[(0,l.jsx)(`span`,{className:`ssg-filter-sec-label`,children:f.filterValuesSection}),(0,l.jsx)(`span`,{className:`ssg-filter-sec-meta`,children:d??(0,c.formatLocaleText)(t?f.filterMatchCount:f.filterTotalCount,{count:i.length})}),(0,l.jsx)(`button`,{type:`button`,onPointerDown:e=>{e.preventDefault(),e.stopPropagation(),o()},onKeyDown:e=>{M(e),(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())},className:`ssg-filter-sec-clear`,disabled:a===null,children:f.clear})]}),u,(0,l.jsxs)(`div`,{className:`ssg-filter-summary`,children:[`🔽 `,s]})]})}function H({isOpen:t,themeClassName:u,popoverSlot:d,title:f,filterType:h,draftValue:g,numberConditionDraft:v,onNumberConditionDraftChange:y,textConditionDraft:C,onTextConditionDraftChange:w,dateConditionDraft:T,onDateConditionDraftChange:E,datePresets:D,renderDateInput:O,onComboConditionClear:A,onComboSelectionClear:N,comboSummaryText:P,currentValueText:H,layout:U,selectOptions:W,optionsStatus:G,optionsProgress:ee,optionsTruncated:K=!1,optionsErrorMessage:te,onOptionsRetry:ne,setSelection:q,popoverRef:re,textInputRef:J,selectRef:ie,onRequestClose:Y,onDraftChange:ae,onApply:X,onClear:oe,onSetValueToggle:se,onSetSelectAllChange:ce,onSetClear:le,onSetReplaceSelection:ue,isServerSide:de=!1}){let Z=n.t(),fe=(0,r.useRef)(null),[pe]=(0,r.useState)(()=>new Date),[Q]=(0,r.useState)(p.createDateRolloverStore);e.o(Q,{active:t&&h===`dateSet`&&(T?.preset??null)!==null});let me=(0,S.resolveComboReferenceDate)(pe,(0,r.useSyncExternalStore)(Q.subscribe,Q.getSnapshot,Q.getSnapshot));e.i(re,t&&U!==null,u,{layout:U});let he=e.r(t&&U!==null);if(typeof document>`u`||!t||!U||!he)return null;let ge={top:U.top,left:U.left,width:U.width,maxHeight:U.maxHeight},_e=e=>{e.stopPropagation(),e.key===`Escape`&&!(0,o.isEscapePreventedInside)(e.nativeEvent)&&!(0,s.isImeComposingKeyEvent)(e.nativeEvent)&&(e.preventDefault(),Y())},ve=e=>{if(e.key!==`Tab`||e.altKey||e.ctrlKey||e.metaKey||(0,s.isImeComposingKeyEvent)(e.nativeEvent))return;let t=(0,_.resolveFocusWrapTarget)(e.currentTarget,e.target instanceof Element?e.target:null,e.shiftKey);t!==null&&(e.preventDefault(),t.focus())},ye=e=>{e.stopPropagation()},be=h===`set`,xe=h===`numberSet`,Se=h===`textSet`,Ce=h===`dateSet`,we=xe||Se||Ce,Te=be||we,Ee=G===`loading`||G===`error`,De=v??b.DEFAULT_NUMBER_FILTER_DRAFT,Oe=C??x.DEFAULT_TEXT_FILTER_DRAFT,ke=T??S.DEFAULT_DATE_FILTER_DRAFT,Ae=D??(0,m.normalizeDateFilterPresets)(void 0,Z),je=xe?(0,b.buildParsedNumberFilterFromDraft)(De):null,Me=Se?(0,x.buildParsedTextFilterFromDraft)(Oe):null,Ne=Ce?(0,S.buildParsedDateFilterFromDraft)(ke):null,Pe=je!==null||Me!==null||Ne!==null,$=xe?(0,b.filterOptionsByNumberCondition)(W,je):Se?(0,x.filterOptionsByTextCondition)(W,Me):Ce?(0,S.filterOptionsByDateCondition)(W,Ne,me,Ae):W,Fe=e=>{if(e.stopPropagation(),!(0,s.isImeComposingKeyEvent)(e.nativeEvent)){if(e.key===`Enter`){e.preventDefault(),X();return}e.key===`Escape`&&(e.preventDefault(),Y())}},Ie=xe?(0,l.jsx)(F,{draft:De,valueInputRef:J,onDraftChange:y,onKeyDown:Fe}):Se?(0,l.jsx)(I,{draft:Oe,valueInputRef:J,onDraftChange:w,onKeyDown:Fe}):(0,l.jsx)(L,{draft:ke,valueInputRef:J,onDraftChange:E,onKeyDown:Fe,presets:Ae,renderDateInput:O,onRequestClose:Y});return(0,a.createPortal)((0,l.jsxs)(`div`,{ref:re,onPointerDown:ye,onKeyDown:_e,onKeyDownCapture:ve,onPasteCapture:e=>{e.stopPropagation()},className:(0,i.cx)(`ssg-filter-popover`,u,d?.className),style:{...d?.style,...ge},role:`dialog`,"aria-label":(0,c.formatLocaleText)(Z.filterTitle,{column:f}),tabIndex:-1,children:[(0,l.jsx)(`div`,{className:`ssg-filter-title`,children:(0,c.formatLocaleText)(Z.filterTitle,{column:f})}),(Te||h===`select`)&&G===`collecting`?we?(0,l.jsx)(V,{conditionEditor:Ie,conditionActive:Pe,onConditionClear:A,options:$,setSelection:q,onSelectionClear:N,summaryText:P,optionsMeta:Z.filterOptionsLoadingShort,children:(0,l.jsx)(`div`,{className:`ssg-filter-collecting`,children:(0,c.formatLocaleText)(Z.filterCollecting,{percent:Math.round(ee*100)})})}):(0,l.jsx)(`div`,{className:`ssg-filter-collecting`,children:(0,c.formatLocaleText)(Z.filterCollecting,{percent:Math.round(ee*100)})}):(Te||h===`select`)&&Ee?we?(0,l.jsx)(V,{conditionEditor:Ie,conditionActive:Pe,onConditionClear:A,options:$,setSelection:q,onSelectionClear:N,summaryText:P,optionsMeta:G===`loading`?Z.filterOptionsLoadingShort:Z.filterOptionsFailedShort,children:(0,l.jsx)(z,{status:G===`loading`?`loading`:`error`,errorMessage:te,onRetry:ne})}):(0,l.jsx)(z,{status:G===`loading`?`loading`:`error`,errorMessage:te,onRetry:ne}):we?(0,l.jsx)(V,{conditionEditor:Ie,conditionActive:Pe,onConditionClear:A,options:$,setSelection:q,onSelectionClear:N,summaryText:P,children:Ce?(0,l.jsx)(R,{options:$,setSelection:q,searchInputRef:fe,onValueToggle:se,onSelectAllChange:ce,onReplaceSelection:ue,onRequestClose:Y,isServerSide:de,truncated:K}):(0,l.jsx)(j,{options:$,setSelection:q,searchInputRef:fe,onValueToggle:se,onSelectAllChange:ce,onReplaceSelection:ue,onRequestClose:Y,isServerSide:de,selectAllUsesExplicitScope:!0,truncated:K})}):be?(0,l.jsx)(j,{options:W,setSelection:q,searchInputRef:J,onValueToggle:se,onSelectAllChange:ce,onReplaceSelection:ue,onRequestClose:Y,isServerSide:de,truncated:K}):h===`number`?(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(F,{draft:De,valueInputRef:J,onDraftChange:y,onKeyDown:Fe})}):h===`select`?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`select`,{ref:ie,value:g,onChange:e=>ae(e.target.value),onKeyDown:e=>{if(e.stopPropagation(),e.key===`Enter`){e.preventDefault(),X();return}e.key===`Escape`&&(e.preventDefault(),Y())},className:`ssg-filter-select`,children:[(0,l.jsx)(`option`,{value:``,children:Z.filterAll}),W.map(e=>(0,l.jsx)(`option`,{value:e.value,children:k(e.value,e.label,Z.blank)},`${f}-${e.value}`))]}),(0,l.jsxs)(`div`,{className:`ssg-filter-meta`,children:[(0,c.formatLocaleText)(Z.filterOptionCount,{count:W.length}),K&&(0,l.jsx)(B,{})]})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`input`,{ref:J,type:`text`,value:g,onChange:e=>ae(e.target.value),onKeyDown:e=>{if(e.stopPropagation(),!(0,s.isImeComposingKeyEvent)(e.nativeEvent)){if(e.key===`Enter`){e.preventDefault(),X();return}e.key===`Escape`&&(e.preventDefault(),Y())}},placeholder:Z.filterTextPlaceholder,"aria-label":Z.filterTextPlaceholder,className:`ssg-filter-input`}),(0,l.jsx)(`div`,{className:`ssg-filter-meta ssg-filter-meta--ellipsis`,children:Z.filterTextHint})]}),!Te&&(0,l.jsx)(`div`,{className:`ssg-filter-meta ssg-filter-meta--ellipsis`,children:(0,c.formatLocaleText)(Z.filterCurrentValue,{value:H})}),(0,l.jsx)(`div`,{className:`ssg-filter-footer`,children:Te?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`button`,{type:`button`,onPointerDown:e=>{e.preventDefault(),e.stopPropagation(),le()},onKeyDown:e=>{M(e),(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),le())},className:`ssg-filter-btn-secondary`,children:Z.clear}),(0,l.jsx)(`button`,{type:`button`,onPointerDown:e=>{e.preventDefault(),e.stopPropagation(),Y()},onKeyDown:e=>{M(e),(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),Y())},className:`ssg-filter-btn-primary`,children:Z.close})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`button`,{type:`button`,onPointerDown:e=>{e.preventDefault(),e.stopPropagation(),oe()},onKeyDown:e=>{M(e),(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),oe())},className:`ssg-filter-btn-secondary`,children:Z.clear}),(0,l.jsx)(`button`,{type:`button`,onPointerDown:e=>{e.preventDefault(),e.stopPropagation(),X()},onKeyDown:e=>{M(e),(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),X())},className:`ssg-filter-btn-primary`,children:Z.apply})]})})]}),he)}exports.ColumnFilterPopover=H,exports.default=H;
1
+ const e=require("./usePortalTokens-CeVR4LF2.cjs"),t=require("./useVirtualizerCore-CA1UYXG3.cjs"),n=require("./usePopupLocaleText-CmlJsMAf.cjs");let r=require("react"),i=require("react-dom"),a=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/cx"),o=require("@ishibashi0112/spreadsheet-grid-core/internal/controllers/escapeClaimController"),s=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards"),c=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText"),l=require("react/jsx-runtime"),u=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/editorValues"),d=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering"),f=require("@ishibashi0112/spreadsheet-grid-core/internal/utils/shadowDom"),p=require("@ishibashi0112/spreadsheet-grid-core/internal/controllers/dateRolloverStore"),m=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterPresets"),h=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFilters"),g=require("@ishibashi0112/spreadsheet-grid-core/internal/controllers/popoverSupport"),_=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/focusCycle"),v=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/setFilterSearch"),y=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/setFilterSelection"),b=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/numberFilterCondition"),x=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/textFilterCondition"),S=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterCondition"),C=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/datePickerCalendar"),w=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterTree");function T({value:e,onCommit:t,ariaLabel:i,inputRef:o,onRequestClose:p,align:m=`left`}){let h=n.t(),[g,_]=(0,r.useState)(null),[v,y]=(0,r.useState)(!1),[b,x]=(0,r.useState)(!1),[S,w]=(0,r.useState)(`days`),[T,E]=(0,r.useState)(()=>new Date().getFullYear()),[D,O]=(0,r.useState)(()=>new Date().getMonth()),k=(0,r.useRef)(null),A=g??(0,C.formatFilterDateDisplay)(e),j=(0,d.toDateKey)(new Date)??``,M=()=>{if(g===null)return;let e=g.trim();if(e===``){t(``),_(null),y(!1);return}let n=(0,u.parseFilterDateText)(e);if(n===null){y(!0);return}t(n),_(null),y(!1)},N=()=>{let[t,n]=(e===``?j:e).split(`-`);E(Number(t)),O(Number(n)-1),w(`days`),x(!0)},P=()=>{x(!1)},F=e=>{t(e),_(null),y(!1),P()};(0,r.useEffect)(()=>{if(!b)return;let e=e=>{let t=(0,f.getEventTarget)(e,k.current??null);t&&k.current?.contains(t)||x(!1)};return document.addEventListener(`pointerdown`,e,!0),()=>{document.removeEventListener(`pointerdown`,e,!0)}},[b]);let I=e=>{if(e.stopPropagation(),e.key===`Enter`){if((0,s.isImeComposingKeyEvent)(e.nativeEvent))return;e.preventDefault(),M(),P();return}if(e.key===`Escape`){if(e.preventDefault(),b){P();return}p()}},L=e=>({onPointerDown:t=>{t.preventDefault(),t.stopPropagation(),e()},onKeyDown:t=>{if(t.stopPropagation(),t.key===`Enter`||t.key===` `){t.preventDefault(),e();return}if(t.key===`Escape`){if(t.preventDefault(),b){P(),t.currentTarget.closest(`.ssg-dp-root`)?.querySelector(`.ssg-dp-input`)?.focus();return}p()}}}),R=e=>{if(S===`days`){let t=new Date(T,D+e,1);E(t.getFullYear()),O(t.getMonth());return}if(S===`months`){E(t=>t+e);return}E(t=>t+e*12)},z=()=>{w(e=>e===`days`?`months`:`years`)},B=()=>{w(e=>e===`years`?`months`:`days`)},V=S===`days`?(0,c.formatLocaleText)(h.calendarTitle,{year:T,month:D+1}):S===`months`?(0,c.formatLocaleText)(h.calendarYear,{year:T}):`${(0,C.yearGridStart)(T)} – ${(0,C.yearGridStart)(T)+11}`;return(0,l.jsxs)(`div`,{ref:k,className:`ssg-dp-root`,children:[(0,l.jsxs)(`div`,{className:(0,a.cx)(`ssg-dp-field`,b&&`ssg-dp-field--open`,v&&`ssg-dp-field--invalid`),children:[(0,l.jsx)(`input`,{ref:o,type:`text`,inputMode:`numeric`,value:A,placeholder:`yyyy/mm/dd`,"aria-label":i,"aria-invalid":v||void 0,className:`ssg-dp-input`,onChange:e=>{_(e.target.value),y(!1)},onKeyDown:I,onBlur:M}),(0,l.jsx)(`button`,{type:`button`,className:`ssg-dp-cal-btn`,"aria-label":b?h.calendarClose:h.calendarOpen,...L(()=>{b?P():N()}),children:(0,l.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,l.jsx)(`rect`,{x:`1.5`,y:`2.5`,width:`13`,height:`12`,rx:`1.5`,fill:`none`,stroke:`currentColor`}),(0,l.jsx)(`line`,{x1:`1.5`,y1:`6`,x2:`14.5`,y2:`6`,stroke:`currentColor`}),(0,l.jsx)(`line`,{x1:`5`,y1:`1`,x2:`5`,y2:`4`,stroke:`currentColor`}),(0,l.jsx)(`line`,{x1:`11`,y1:`1`,x2:`11`,y2:`4`,stroke:`currentColor`})]})})]}),b&&(0,l.jsxs)(`div`,{className:(0,a.cx)(`ssg-dp-panel`,m===`right`&&`ssg-dp-panel--right`),children:[(0,l.jsxs)(`div`,{className:`ssg-dp-nav`,children:[(0,l.jsx)(`button`,{type:`button`,className:`ssg-dp-nav-btn`,"aria-label":h.calendarPrevious,...L(()=>R(-1)),children:`‹`}),(0,l.jsx)(`button`,{type:`button`,className:`ssg-dp-nav-title`,disabled:S===`years`,"aria-label":h.calendarChangeView,...L(z),children:V}),(0,l.jsx)(`button`,{type:`button`,className:`ssg-dp-nav-btn`,"aria-label":h.calendarNext,...L(()=>R(1)),children:`›`})]}),S===`days`&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`div`,{className:`ssg-dp-dow`,children:h.calendarWeekdays.map((e,t)=>(0,l.jsx)(`span`,{className:(0,a.cx)(t===0&&`ssg-dp-dow--sun`,t===6&&`ssg-dp-dow--sat`),children:e},t))}),(0,l.jsx)(`div`,{className:`ssg-dp-days`,children:(0,C.buildCalendarDayCells)(T,D).map(t=>(0,l.jsx)(`button`,{type:`button`,className:(0,a.cx)(`ssg-dp-day`,!t.inCurrentMonth&&`ssg-dp-day--out`,t.key===j&&`ssg-dp-day--today`,t.key===e&&`ssg-dp-day--selected`),"aria-label":t.key,...L(()=>F(t.key)),children:t.day},t.key))})]}),S===`months`&&(0,l.jsx)(`div`,{className:`ssg-dp-grid`,children:h.calendarMonths.map((e,t)=>(0,l.jsx)(`button`,{type:`button`,className:(0,a.cx)(`ssg-dp-cell`,t===D&&`ssg-dp-cell--selected`),...L(()=>{O(t),w(`days`)}),children:e},t))}),S===`years`&&(0,l.jsx)(`div`,{className:`ssg-dp-grid`,children:(0,C.buildYearGrid)(T).map(e=>(0,l.jsx)(`button`,{type:`button`,className:(0,a.cx)(`ssg-dp-cell`,e===T&&`ssg-dp-cell--selected`),...L(()=>{E(e),w(`months`)}),children:e},e))}),(0,l.jsxs)(`div`,{className:`ssg-dp-foot`,children:[S!==`days`&&(0,l.jsx)(`button`,{type:`button`,className:`ssg-dp-foot-btn`,...L(B),children:h.calendarBack}),(0,l.jsx)(`button`,{type:`button`,className:`ssg-dp-foot-btn`,...L(()=>F(j)),children:h.calendarToday}),(0,l.jsx)(`button`,{type:`button`,className:`ssg-dp-foot-btn ssg-dp-foot-btn--muted`,...L(()=>F(``)),children:h.clear})]})]})]})}var E=24,D=40,O=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(pointer: coarse)`).matches?D:E,k=(e,t,n)=>e===``&&t===h.DEFAULT_FILTER_LOCALE_TEXT.blank?n:t,A=(e,t)=>t===h.DEFAULT_FILTER_LOCALE_TEXT.blank?e:e.map(e=>e.value===``&&e.label===h.DEFAULT_FILTER_LOCALE_TEXT.blank?{...e,label:t}:e);function j({options:e,setSelection:i,searchInputRef:a,onValueToggle:o,onSelectAllChange:u,onReplaceSelection:d,onRequestClose:f,isServerSide:p,selectAllUsesExplicitScope:m=!1,truncated:h=!1}){let g=n.t(),[_,b]=(0,r.useState)(``),x=(0,r.useDeferredValue)(_),S=(0,r.useMemo)(()=>A(e,g.blank),[e,g.blank]),C=(0,r.useMemo)(()=>(0,v.filterSetOptionsBySearch)(S,x),[S,x]),w=x.trim().length>0,T=(0,r.useRef)(null),[E]=(0,r.useState)(O),D=t.t({count:C.length,getScrollElement:()=>T.current,estimateSize:()=>E,overscan:10}),j=(0,r.useMemo)(()=>{if(i===null)return C.length;let e=0;for(let t of C)(0,y.isSetValueSelected)(i,t.value)&&(e+=1);return e},[i,C]),M=C.length>0&&j===C.length,N=j>0&&!M,P=(0,r.useMemo)(()=>new Set(e.map(e=>e.value)),[e]),F=(0,r.useMemo)(()=>{if(i===null)return e.length;let t=0;for(let e of i.values)P.has(e)&&(t+=1);return i.mode===`include`?t:e.length-t},[i,P,e.length]);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`input`,{ref:a,type:`text`,value:_,onChange:e=>b(e.target.value),onKeyDown:e=>{if(e.stopPropagation(),e.key===`Escape`&&(e.preventDefault(),f()),e.key===`Enter`){if((0,s.isImeComposingKeyEvent)(e.nativeEvent))return;e.preventDefault();let t=(0,v.resolveSetFilterEnterAction)(S,_);if(t.kind===`none`)return;t.kind===`replace`&&d(t.values),f()}},placeholder:g.filterSearchPlaceholder,"aria-label":g.filterSearchPlaceholder,className:`ssg-filter-input`}),(0,l.jsxs)(`label`,{className:`ssg-filter-selectall`,children:[(0,l.jsx)(`input`,{type:`checkbox`,checked:M,ref:e=>{e&&(e.indeterminate=N)},onChange:()=>{u(w||m?C.map(e=>e.value):`all`,!M)}}),(0,l.jsx)(`span`,{className:`ssg-filter-selectall-label`,children:w?g.filterSelectAllResults:g.filterSelectAll})]}),(0,l.jsx)(`div`,{ref:T,className:`ssg-filter-list`,children:C.length===0?(0,l.jsx)(`div`,{className:`ssg-filter-empty`,children:e.length===0?p?g.filterNoOptionsSource:g.noOptions:g.filterNoMatches}):(0,l.jsx)(`div`,{className:`ssg-filter-virt`,style:{height:D.getTotalSize()},children:D.getVirtualItems().map(e=>{let t=C[e.index];if(!t)return null;let n=(0,y.isSetValueSelected)(i,t.value);return(0,l.jsxs)(`label`,{className:`ssg-filter-option`,style:{transform:`translateY(${e.start}px)`,height:e.size},children:[(0,l.jsx)(`input`,{type:`checkbox`,checked:n,onChange:()=>o(t.value)}),(0,l.jsx)(`span`,{className:`ssg-filter-option-label`,children:k(t.value,t.label,g.blank)})]},t.value)})})}),(0,l.jsxs)(`div`,{className:`ssg-filter-meta`,children:[(0,c.formatLocaleText)(g.filterSelectedCount,{selected:F,total:e.length}),w?(0,c.formatLocaleText)(g.filterShownCount,{count:C.length}):``,h&&(0,l.jsx)(B,{})]})]})}var M=e=>{e.key!==`Escape`&&e.stopPropagation()},N=e=>e.nativeEvent.isComposing===!0,P=(e,t,n)=>{if(N(n)){e(t,{commit:!1});return}e(t)};function F({draft:e,valueInputRef:t,onDraftChange:r,onKeyDown:i}){let a=n.t(),o=(0,b.numberFilterOperandCount)(e.operator);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`select`,{value:e.operator,onChange:t=>r({...e,operator:t.target.value}),onKeyDown:i,className:`ssg-filter-select`,"aria-label":a.filterOperator,children:b.NUMBER_FILTER_OPERATOR_OPTIONS.map(e=>(0,l.jsx)(`option`,{value:e.value,children:a[e.labelKey]},e.value))}),o>0?(0,l.jsxs)(`div`,{className:`ssg-filter-cond-values`,children:[(0,l.jsx)(`input`,{ref:t,type:`text`,inputMode:`decimal`,value:e.value1,onChange:t=>P(r,{...e,value1:t.target.value},t),onCompositionEnd:t=>r({...e,value1:t.currentTarget.value}),onKeyDown:i,placeholder:o===2?a.filterMin:a.filterValuePlaceholder,className:`ssg-filter-input`,"aria-label":o===2?a.filterMin:a.filterValue}),o===2&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`span`,{className:`ssg-filter-cond-tilde`,children:a.filterRangeSeparator}),(0,l.jsx)(`input`,{type:`text`,inputMode:`decimal`,value:e.value2,onChange:t=>P(r,{...e,value2:t.target.value},t),onCompositionEnd:t=>r({...e,value2:t.currentTarget.value}),onKeyDown:i,placeholder:a.filterMax,className:`ssg-filter-input`,"aria-label":a.filterMax})]})]}):(0,l.jsx)(`div`,{className:`ssg-filter-meta`,children:a.filterNoValue})]})}function I({draft:e,valueInputRef:t,onDraftChange:r,onKeyDown:i}){let a=n.t(),o=(0,x.textFilterOperandCount)(e.operator);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`select`,{value:e.operator,onChange:t=>r({...e,operator:t.target.value}),onKeyDown:i,className:`ssg-filter-select`,"aria-label":a.filterOperator,children:x.TEXT_FILTER_OPERATOR_OPTIONS.map(e=>(0,l.jsx)(`option`,{value:e.value,children:a[e.labelKey]},e.value))}),o>0?(0,l.jsx)(`div`,{className:`ssg-filter-cond-values`,children:(0,l.jsx)(`input`,{ref:t,type:`text`,value:e.value,onChange:t=>P(r,{...e,value:t.target.value},t),onCompositionEnd:t=>r({...e,value:t.currentTarget.value}),onKeyDown:i,placeholder:a.filterValuePlaceholder,className:`ssg-filter-input`,"aria-label":a.filterValue})}):(0,l.jsx)(`div`,{className:`ssg-filter-meta`,children:a.filterNoValue})]})}function L({draft:e,valueInputRef:t,onDraftChange:r,onKeyDown:i,presets:o,renderDateInput:s,onRequestClose:c}){let u=n.t(),d=e.preset===null?(0,S.dateFilterOperandCount)(e.operator):0,f=(t,n)=>{r({...e,[t]:(0,S.normalizeFilterDateInputValue)(n),preset:null})};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`select`,{value:e.operator,onChange:t=>r({...e,operator:t.target.value,preset:null}),onKeyDown:i,className:`ssg-filter-select`,"aria-label":u.filterOperator,children:S.DATE_FILTER_OPERATOR_OPTIONS.map(e=>(0,l.jsx)(`option`,{value:e.value,children:u[e.labelKey]},e.value))}),d>0?(0,l.jsxs)(`div`,{className:`ssg-filter-cond-values`,children:[s?s({value:e.value1,onChange:e=>f(`value1`,e),ariaLabel:d===2?u.filterStartDate:u.filterDate,slot:d===2?`from`:`single`}):(0,l.jsx)(T,{value:e.value1,onCommit:t=>r({...e,value1:t,preset:null}),ariaLabel:d===2?u.filterStartDate:u.filterDate,inputRef:t,onRequestClose:c}),d===2&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`span`,{className:`ssg-filter-cond-tilde`,children:u.filterRangeSeparator}),s?s({value:e.value2,onChange:e=>f(`value2`,e),ariaLabel:u.filterEndDate,slot:`to`}):(0,l.jsx)(T,{value:e.value2,onCommit:t=>r({...e,value2:t,preset:null}),ariaLabel:u.filterEndDate,onRequestClose:c,align:`right`})]})]}):e.preset===null?(0,l.jsx)(`div`,{className:`ssg-filter-meta`,children:u.filterNoValue}):null,o.length>0&&(0,l.jsx)(`div`,{className:`ssg-filter-presets`,children:o.map(t=>(0,l.jsx)(`button`,{type:`button`,onPointerDown:n=>{n.preventDefault(),n.stopPropagation(),r({...e,preset:e.preset===t.id?null:t.id}),(0,g.keepFocusAfterPress)(n.currentTarget)},onKeyDown:n=>{M(n),(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),r({...e,preset:e.preset===t.id?null:t.id}))},className:(0,a.cx)(`ssg-filter-preset-chip`,e.preset===t.id&&`ssg-filter-preset-chip--active`),children:t.label},t.id))})]})}function R({options:e,setSelection:i,searchInputRef:a,onValueToggle:o,onSelectAllChange:u,onReplaceSelection:d,onRequestClose:f,isServerSide:p,truncated:m=!1}){let h=n.t(),[g,_]=(0,r.useState)(``),b=(0,r.useDeferredValue)(g),[x,S]=(0,r.useState)(()=>new Set),C=b.trim().length>0,T=(0,r.useMemo)(()=>A(e,h.blank),[e,h.blank]),E=(0,r.useMemo)(()=>(0,v.filterSetOptionsBySearch)(T,b),[T,b]),D=(0,r.useMemo)(()=>(0,w.buildDateTreeRows)(e,x,h),[e,x,h]),j=(0,r.useRef)(null),N=C?E.length:D.length,[P]=(0,r.useState)(O),F=t.t({count:N,getScrollElement:()=>j.current,estimateSize:()=>P,overscan:10}),I=(0,r.useMemo)(()=>(C?E:e).map(e=>e.value),[C,E,e]),L=(0,r.useMemo)(()=>{let e=0;for(let t of I)(0,y.isSetValueSelected)(i,t)&&(e+=1);return e},[I,i]),R=I.length>0&&L===I.length,z=L>0&&!R,V=(0,r.useMemo)(()=>new Set(e.map(e=>e.value)),[e]),H=(0,r.useMemo)(()=>{if(i===null)return e.length;let t=0;for(let e of i.values)V.has(e)&&(t+=1);return i.mode===`include`?t:e.length-t},[i,V,e.length]),U=e=>{S(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},W=e=>{let t=0;for(let n of e)(0,y.isSetValueSelected)(i,n)&&(t+=1);return t},G=e=>{if(e.type===`leaf`){o(e.key);return}let t=e.leafKeys.length>0&&W(e.leafKeys)===e.leafKeys.length;u(e.leafKeys,!t)},ee=e=>{let t=W(e.leafKeys),n=e.leafKeys.length>0&&t===e.leafKeys.length,r=t>0&&!n;return(0,l.jsxs)(l.Fragment,{children:[e.type===`group`?(0,l.jsx)(`button`,{type:`button`,onPointerDown:t=>{t.preventDefault(),t.stopPropagation(),U(e.key)},onKeyDown:t=>{M(t),(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),U(e.key))},className:`ssg-filter-tree-toggle`,"aria-label":e.expanded?h.treeCollapse:h.treeExpand,children:e.expanded?`▾`:`▸`}):(0,l.jsx)(`span`,{className:`ssg-filter-tree-toggle ssg-filter-tree-toggle--placeholder`}),(0,l.jsx)(`input`,{type:`checkbox`,checked:n,ref:e=>{e&&(e.indeterminate=r)},"aria-label":k(e.key,e.label,h.blank),onChange:()=>G(e)}),(0,l.jsx)(`span`,{className:`ssg-filter-option-label`,children:k(e.key,e.label,h.blank)})]})};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`input`,{ref:a,type:`text`,value:g,onChange:e=>_(e.target.value),onKeyDown:e=>{if(e.stopPropagation(),e.key===`Escape`&&(e.preventDefault(),f()),e.key===`Enter`){if((0,s.isImeComposingKeyEvent)(e.nativeEvent))return;e.preventDefault();let t=(0,v.resolveSetFilterEnterAction)(T,g);if(t.kind===`none`)return;t.kind===`replace`&&d(t.values),f()}},placeholder:h.filterSearchPlaceholder,"aria-label":h.filterSearchPlaceholder,className:`ssg-filter-input`}),(0,l.jsxs)(`label`,{className:`ssg-filter-selectall`,children:[(0,l.jsx)(`input`,{type:`checkbox`,checked:R,ref:e=>{e&&(e.indeterminate=z)},onChange:()=>u(I,!R)}),(0,l.jsx)(`span`,{className:`ssg-filter-selectall-label`,children:C?h.filterSelectAllResults:h.filterSelectAll})]}),(0,l.jsx)(`div`,{ref:j,className:`ssg-filter-list`,children:N===0?(0,l.jsx)(`div`,{className:`ssg-filter-empty`,children:e.length===0?p?h.filterNoOptionsSource:h.noOptions:h.filterNoMatches}):(0,l.jsx)(`div`,{className:`ssg-filter-virt`,style:{height:F.getTotalSize()},children:F.getVirtualItems().map(e=>{if(C){let t=E[e.index];return t?(0,l.jsxs)(`label`,{className:`ssg-filter-option`,style:{transform:`translateY(${e.start}px)`,height:e.size},children:[(0,l.jsx)(`input`,{type:`checkbox`,checked:(0,y.isSetValueSelected)(i,t.value),onChange:()=>o(t.value)}),(0,l.jsx)(`span`,{className:`ssg-filter-option-label`,children:k(t.value,t.label,h.blank)})]},t.value):null}let t=D[e.index];return t?(0,l.jsx)(`div`,{className:`ssg-filter-option`,style:{transform:`translateY(${e.start}px)`,height:e.size,paddingLeft:8+t.depth*16},onClick:e=>{e.target.closest(`button, input`)||G(t)},children:ee(t)},t.key):null})})}),(0,l.jsxs)(`div`,{className:`ssg-filter-meta`,children:[(0,c.formatLocaleText)(h.filterSelectedCount,{selected:H,total:e.length}),C?(0,c.formatLocaleText)(h.filterShownCount,{count:E.length}):``,m&&(0,l.jsx)(B,{})]})]})}function z({status:e,errorMessage:t,onRetry:r}){let i=n.t();return e===`loading`?(0,l.jsx)(`div`,{className:`ssg-filter-collecting`,children:i.filterOptionsLoading}):(0,l.jsxs)(`div`,{className:`ssg-filter-error`,role:`alert`,children:[(0,l.jsx)(`div`,{children:i.filterOptionsFailed}),t?(0,l.jsx)(`div`,{className:`ssg-filter-error-detail`,title:t,children:t}):null,r?(0,l.jsx)(`button`,{type:`button`,onPointerDown:e=>{e.preventDefault(),e.stopPropagation(),r()},onKeyDown:e=>{M(e),(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r())},className:`ssg-filter-btn-secondary`,children:i.retry}):null]})}function B(){return(0,l.jsx)(`span`,{className:`ssg-filter-truncated`,children:n.t().filterOptionsTruncated})}function V({conditionEditor:e,conditionActive:t,onConditionClear:r,options:i,setSelection:a,onSelectionClear:o,summaryText:s,children:u,optionsMeta:d}){let f=n.t();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`ssg-filter-sec-head`,children:[(0,l.jsx)(`span`,{className:`ssg-filter-sec-label`,children:f.filterConditionSection}),(0,l.jsx)(`button`,{type:`button`,onPointerDown:e=>{e.preventDefault(),e.stopPropagation(),r()},onKeyDown:e=>{M(e),(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r())},className:`ssg-filter-sec-clear`,disabled:!t,children:f.clear})]}),e,(0,l.jsx)(`div`,{className:`ssg-filter-sep`}),(0,l.jsxs)(`div`,{className:`ssg-filter-sec-head`,children:[(0,l.jsx)(`span`,{className:`ssg-filter-sec-label`,children:f.filterValuesSection}),(0,l.jsx)(`span`,{className:`ssg-filter-sec-meta`,children:d??(0,c.formatLocaleText)(t?f.filterMatchCount:f.filterTotalCount,{count:i.length})}),(0,l.jsx)(`button`,{type:`button`,onPointerDown:e=>{e.preventDefault(),e.stopPropagation(),o()},onKeyDown:e=>{M(e),(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())},className:`ssg-filter-sec-clear`,disabled:a===null,children:f.clear})]}),u,(0,l.jsxs)(`div`,{className:`ssg-filter-summary`,children:[`🔽 `,s]})]})}function H({isOpen:t,themeClassName:u,popoverSlot:d,title:f,filterType:h,draftValue:g,numberConditionDraft:v,onNumberConditionDraftChange:y,textConditionDraft:C,onTextConditionDraftChange:w,dateConditionDraft:T,onDateConditionDraftChange:E,datePresets:D,renderDateInput:O,onComboConditionClear:A,onComboSelectionClear:N,comboSummaryText:P,currentValueText:H,layout:U,selectOptions:W,optionsStatus:G,optionsProgress:ee,optionsTruncated:K=!1,optionsErrorMessage:te,onOptionsRetry:ne,setSelection:q,popoverRef:re,textInputRef:J,selectRef:ie,onRequestClose:Y,onDraftChange:ae,onApply:X,onClear:oe,onSetValueToggle:se,onSetSelectAllChange:ce,onSetClear:le,onSetReplaceSelection:ue,isServerSide:de=!1}){let Z=n.t(),fe=(0,r.useRef)(null),[pe]=(0,r.useState)(()=>new Date),[Q]=(0,r.useState)(p.createDateRolloverStore);e.o(Q,{active:t&&h===`dateSet`&&(T?.preset??null)!==null});let me=(0,S.resolveComboReferenceDate)(pe,(0,r.useSyncExternalStore)(Q.subscribe,Q.getSnapshot,Q.getSnapshot));e.i(re,t&&U!==null,u,{layout:U});let he=e.r(t&&U!==null);if(typeof document>`u`||!t||!U||!he)return null;let ge={top:U.top,left:U.left,width:U.width,maxHeight:U.maxHeight},_e=e=>{e.stopPropagation(),e.key===`Escape`&&!(0,o.isEscapePreventedInside)(e.nativeEvent)&&!(0,s.isImeComposingKeyEvent)(e.nativeEvent)&&(e.preventDefault(),Y())},ve=e=>{if(e.key!==`Tab`||e.altKey||e.ctrlKey||e.metaKey||(0,s.isImeComposingKeyEvent)(e.nativeEvent))return;let t=(0,_.resolveFocusWrapTarget)(e.currentTarget,e.target instanceof Element?e.target:null,e.shiftKey);t!==null&&(e.preventDefault(),t.focus())},ye=e=>{e.stopPropagation()},be=h===`set`,xe=h===`numberSet`,Se=h===`textSet`,Ce=h===`dateSet`,we=xe||Se||Ce,Te=be||we,Ee=G===`loading`||G===`error`,De=v??b.DEFAULT_NUMBER_FILTER_DRAFT,Oe=C??x.DEFAULT_TEXT_FILTER_DRAFT,ke=T??S.DEFAULT_DATE_FILTER_DRAFT,Ae=D??(0,m.normalizeDateFilterPresets)(void 0,Z),je=xe?(0,b.buildParsedNumberFilterFromDraft)(De):null,Me=Se?(0,x.buildParsedTextFilterFromDraft)(Oe):null,Ne=Ce?(0,S.buildParsedDateFilterFromDraft)(ke):null,Pe=je!==null||Me!==null||Ne!==null,$=xe?(0,b.filterOptionsByNumberCondition)(W,je):Se?(0,x.filterOptionsByTextCondition)(W,Me):Ce?(0,S.filterOptionsByDateCondition)(W,Ne,me,Ae):W,Fe=e=>{if(e.stopPropagation(),!(0,s.isImeComposingKeyEvent)(e.nativeEvent)){if(e.key===`Enter`){e.preventDefault(),X();return}e.key===`Escape`&&(e.preventDefault(),Y())}},Ie=xe?(0,l.jsx)(F,{draft:De,valueInputRef:J,onDraftChange:y,onKeyDown:Fe}):Se?(0,l.jsx)(I,{draft:Oe,valueInputRef:J,onDraftChange:w,onKeyDown:Fe}):(0,l.jsx)(L,{draft:ke,valueInputRef:J,onDraftChange:E,onKeyDown:Fe,presets:Ae,renderDateInput:O,onRequestClose:Y});return(0,i.createPortal)((0,l.jsxs)(`div`,{ref:re,onPointerDown:ye,onKeyDown:_e,onKeyDownCapture:ve,onPasteCapture:e=>{e.stopPropagation()},className:(0,a.cx)(`ssg-filter-popover`,u,d?.className),style:{...d?.style,...ge},role:`dialog`,"aria-label":(0,c.formatLocaleText)(Z.filterTitle,{column:f}),tabIndex:-1,children:[(0,l.jsx)(`div`,{className:`ssg-filter-title`,children:(0,c.formatLocaleText)(Z.filterTitle,{column:f})}),(Te||h===`select`)&&G===`collecting`?we?(0,l.jsx)(V,{conditionEditor:Ie,conditionActive:Pe,onConditionClear:A,options:$,setSelection:q,onSelectionClear:N,summaryText:P,optionsMeta:Z.filterOptionsLoadingShort,children:(0,l.jsx)(`div`,{className:`ssg-filter-collecting`,children:(0,c.formatLocaleText)(Z.filterCollecting,{percent:Math.round(ee*100)})})}):(0,l.jsx)(`div`,{className:`ssg-filter-collecting`,children:(0,c.formatLocaleText)(Z.filterCollecting,{percent:Math.round(ee*100)})}):(Te||h===`select`)&&Ee?we?(0,l.jsx)(V,{conditionEditor:Ie,conditionActive:Pe,onConditionClear:A,options:$,setSelection:q,onSelectionClear:N,summaryText:P,optionsMeta:G===`loading`?Z.filterOptionsLoadingShort:Z.filterOptionsFailedShort,children:(0,l.jsx)(z,{status:G===`loading`?`loading`:`error`,errorMessage:te,onRetry:ne})}):(0,l.jsx)(z,{status:G===`loading`?`loading`:`error`,errorMessage:te,onRetry:ne}):we?(0,l.jsx)(V,{conditionEditor:Ie,conditionActive:Pe,onConditionClear:A,options:$,setSelection:q,onSelectionClear:N,summaryText:P,children:Ce?(0,l.jsx)(R,{options:$,setSelection:q,searchInputRef:fe,onValueToggle:se,onSelectAllChange:ce,onReplaceSelection:ue,onRequestClose:Y,isServerSide:de,truncated:K}):(0,l.jsx)(j,{options:$,setSelection:q,searchInputRef:fe,onValueToggle:se,onSelectAllChange:ce,onReplaceSelection:ue,onRequestClose:Y,isServerSide:de,selectAllUsesExplicitScope:!0,truncated:K})}):be?(0,l.jsx)(j,{options:W,setSelection:q,searchInputRef:J,onValueToggle:se,onSelectAllChange:ce,onReplaceSelection:ue,onRequestClose:Y,isServerSide:de,truncated:K}):h===`number`?(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(F,{draft:De,valueInputRef:J,onDraftChange:y,onKeyDown:Fe})}):h===`select`?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`select`,{ref:ie,value:g,onChange:e=>ae(e.target.value),onKeyDown:e=>{if(e.stopPropagation(),e.key===`Enter`){e.preventDefault(),X();return}e.key===`Escape`&&(e.preventDefault(),Y())},className:`ssg-filter-select`,children:[(0,l.jsx)(`option`,{value:``,children:Z.filterAll}),W.map(e=>(0,l.jsx)(`option`,{value:e.value,children:k(e.value,e.label,Z.blank)},`${f}-${e.value}`))]}),(0,l.jsxs)(`div`,{className:`ssg-filter-meta`,children:[(0,c.formatLocaleText)(Z.filterOptionCount,{count:W.length}),K&&(0,l.jsx)(B,{})]})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`input`,{ref:J,type:`text`,value:g,onChange:e=>ae(e.target.value),onKeyDown:e=>{if(e.stopPropagation(),!(0,s.isImeComposingKeyEvent)(e.nativeEvent)){if(e.key===`Enter`){e.preventDefault(),X();return}e.key===`Escape`&&(e.preventDefault(),Y())}},placeholder:Z.filterTextPlaceholder,"aria-label":Z.filterTextPlaceholder,className:`ssg-filter-input`}),(0,l.jsx)(`div`,{className:`ssg-filter-meta ssg-filter-meta--ellipsis`,children:Z.filterTextHint})]}),!Te&&(0,l.jsx)(`div`,{className:`ssg-filter-meta ssg-filter-meta--ellipsis`,children:(0,c.formatLocaleText)(Z.filterCurrentValue,{value:H})}),(0,l.jsx)(`div`,{className:`ssg-filter-footer`,children:Te?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`button`,{type:`button`,onPointerDown:e=>{e.preventDefault(),e.stopPropagation(),le()},onKeyDown:e=>{M(e),(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),le())},className:`ssg-filter-btn-secondary`,children:Z.clear}),(0,l.jsx)(`button`,{type:`button`,onPointerDown:e=>{e.preventDefault(),e.stopPropagation(),Y()},onKeyDown:e=>{M(e),(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),Y())},className:`ssg-filter-btn-primary`,children:Z.close})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`button`,{type:`button`,onPointerDown:e=>{e.preventDefault(),e.stopPropagation(),oe()},onKeyDown:e=>{M(e),(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),oe())},className:`ssg-filter-btn-secondary`,children:Z.clear}),(0,l.jsx)(`button`,{type:`button`,onPointerDown:e=>{e.preventDefault(),e.stopPropagation(),X()},onKeyDown:e=>{M(e),(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),X())},className:`ssg-filter-btn-primary`,children:Z.apply})]})})]}),he)}exports.ColumnFilterPopover=H,exports.default=H;
@@ -2,8 +2,8 @@ import { i as e, o as t, r as n } from "./usePortalTokens-CkjVoVTY.js";
2
2
  import { t as r } from "./useVirtualizerCore-BKZtPhuo.js";
3
3
  import { t as i } from "./usePopupLocaleText-Cfb4fQ8G.js";
4
4
  import { useDeferredValue as a, useEffect as o, useMemo as s, useRef as c, useState as l, useSyncExternalStore as u } from "react";
5
- import { cx as d } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/cx";
6
- import { createPortal as f } from "react-dom";
5
+ import { createPortal as d } from "react-dom";
6
+ import { cx as f } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/cx";
7
7
  import { isEscapePreventedInside as p } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/escapeClaimController";
8
8
  import { isImeComposingKeyEvent as m } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
9
9
  import { formatLocaleText as h } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
@@ -25,9 +25,9 @@ import { buildCalendarDayCells as W, buildYearGrid as G, formatFilterDateDisplay
25
25
  import { buildDateTreeRows as ie } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterTree";
26
26
  //#region src/view/FilterDateField.tsx
27
27
  function ae({ value: e, onCommit: t, ariaLabel: n, inputRef: r, onRequestClose: a, align: s = "left" }) {
28
- let u = i(), [f, p] = l(null), [S, C] = l(!1), [w, T] = l(!1), [E, D] = l("days"), [O, k] = l(() => (/* @__PURE__ */ new Date()).getFullYear()), [A, j] = l(() => (/* @__PURE__ */ new Date()).getMonth()), M = c(null), N = f ?? re(e), P = b(/* @__PURE__ */ new Date()) ?? "", F = () => {
29
- if (f === null) return;
30
- let e = f.trim();
28
+ let u = i(), [d, p] = l(null), [S, C] = l(!1), [w, T] = l(!1), [E, D] = l("days"), [O, k] = l(() => (/* @__PURE__ */ new Date()).getFullYear()), [A, j] = l(() => (/* @__PURE__ */ new Date()).getMonth()), M = c(null), N = d ?? re(e), P = b(/* @__PURE__ */ new Date()) ?? "", F = () => {
29
+ if (d === null) return;
30
+ let e = d.trim();
31
31
  if (e === "") {
32
32
  t(""), p(null), C(!1);
33
33
  return;
@@ -109,7 +109,7 @@ function ae({ value: e, onCommit: t, ariaLabel: n, inputRef: r, onRequestClose:
109
109
  ref: M,
110
110
  className: "ssg-dp-root",
111
111
  children: [/* @__PURE__ */ v("div", {
112
- className: d("ssg-dp-field", w && "ssg-dp-field--open", S && "ssg-dp-field--invalid"),
112
+ className: f("ssg-dp-field", w && "ssg-dp-field--open", S && "ssg-dp-field--invalid"),
113
113
  children: [/* @__PURE__ */ _("input", {
114
114
  ref: r,
115
115
  type: "text",
@@ -171,7 +171,7 @@ function ae({ value: e, onCommit: t, ariaLabel: n, inputRef: r, onRequestClose:
171
171
  })
172
172
  })]
173
173
  }), w && /* @__PURE__ */ v("div", {
174
- className: d("ssg-dp-panel", s === "right" && "ssg-dp-panel--right"),
174
+ className: f("ssg-dp-panel", s === "right" && "ssg-dp-panel--right"),
175
175
  children: [
176
176
  /* @__PURE__ */ v("div", {
177
177
  className: "ssg-dp-nav",
@@ -203,14 +203,14 @@ function ae({ value: e, onCommit: t, ariaLabel: n, inputRef: r, onRequestClose:
203
203
  E === "days" && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", {
204
204
  className: "ssg-dp-dow",
205
205
  children: u.calendarWeekdays.map((e, t) => /* @__PURE__ */ _("span", {
206
- className: d(t === 0 && "ssg-dp-dow--sun", t === 6 && "ssg-dp-dow--sat"),
206
+ className: f(t === 0 && "ssg-dp-dow--sun", t === 6 && "ssg-dp-dow--sat"),
207
207
  children: e
208
208
  }, t))
209
209
  }), /* @__PURE__ */ _("div", {
210
210
  className: "ssg-dp-days",
211
211
  children: W(O, A).map((t) => /* @__PURE__ */ _("button", {
212
212
  type: "button",
213
- className: d("ssg-dp-day", !t.inCurrentMonth && "ssg-dp-day--out", t.key === P && "ssg-dp-day--today", t.key === e && "ssg-dp-day--selected"),
213
+ className: f("ssg-dp-day", !t.inCurrentMonth && "ssg-dp-day--out", t.key === P && "ssg-dp-day--today", t.key === e && "ssg-dp-day--selected"),
214
214
  "aria-label": t.key,
215
215
  ...B(() => R(t.key)),
216
216
  children: t.day
@@ -220,7 +220,7 @@ function ae({ value: e, onCommit: t, ariaLabel: n, inputRef: r, onRequestClose:
220
220
  className: "ssg-dp-grid",
221
221
  children: u.calendarMonths.map((e, t) => /* @__PURE__ */ _("button", {
222
222
  type: "button",
223
- className: d("ssg-dp-cell", t === A && "ssg-dp-cell--selected"),
223
+ className: f("ssg-dp-cell", t === A && "ssg-dp-cell--selected"),
224
224
  ...B(() => {
225
225
  j(t), D("days");
226
226
  }),
@@ -231,7 +231,7 @@ function ae({ value: e, onCommit: t, ariaLabel: n, inputRef: r, onRequestClose:
231
231
  className: "ssg-dp-grid",
232
232
  children: G(O).map((e) => /* @__PURE__ */ _("button", {
233
233
  type: "button",
234
- className: d("ssg-dp-cell", e === O && "ssg-dp-cell--selected"),
234
+ className: f("ssg-dp-cell", e === O && "ssg-dp-cell--selected"),
235
235
  ...B(() => {
236
236
  k(e), D("months");
237
237
  }),
@@ -558,7 +558,7 @@ function fe({ draft: e, valueInputRef: t, onDraftChange: n, onKeyDown: r, preset
558
558
  preset: e.preset === t.id ? null : t.id
559
559
  }));
560
560
  },
561
- className: d("ssg-filter-preset-chip", e.preset === t.id && "ssg-filter-preset-chip--active"),
561
+ className: f("ssg-filter-preset-chip", e.preset === t.id && "ssg-filter-preset-chip--active"),
562
562
  children: t.label
563
563
  }, t.id))
564
564
  })
@@ -864,7 +864,7 @@ function Q({ isOpen: r, themeClassName: a, popoverSlot: o, title: s, filterType:
864
864
  renderDateInput: P,
865
865
  onRequestClose: Z
866
866
  });
867
- return f(/* @__PURE__ */ v("div", {
867
+ return d(/* @__PURE__ */ v("div", {
868
868
  ref: oe,
869
869
  onPointerDown: je,
870
870
  onKeyDown: ke,
@@ -872,7 +872,7 @@ function Q({ isOpen: r, themeClassName: a, popoverSlot: o, title: s, filterType:
872
872
  onPasteCapture: (e) => {
873
873
  e.stopPropagation();
874
874
  },
875
- className: d("ssg-filter-popover", a, o?.className),
875
+ className: f("ssg-filter-popover", a, o?.className),
876
876
  style: {
877
877
  ...o?.style,
878
878
  ...Oe
@@ -1,3 +1,3 @@
1
1
  import type { SpreadsheetGridProps } from './model/gridTypes.js';
2
2
  import type { GridShellFeatures } from './features/types.js';
3
- export declare function useGridShell<T extends object>({ rows: rowsProp, dataSource, serverSideRefreshToken, serverSideRefetch, onServerSideLoadError, onServerSideWriteError, columns: columnsProp, onRowsChange, onColumnsChange, rowKeyGetter, isRowExportable, createRow, createOverflowColumn, onPasteSkipped, pasteFillsSelection, copyFormat, copyHeaders, excelShortcuts, newRow, rowHeight: rowHeightProp, autoHeight, estimateRowHeight, verticalAlign, headerHeight: headerHeightProp, density, theme, motion, popupContainer, animateRows, showCopyRange, hoverHighlight, highlightChanges, showSaveStatus, rowDragMotion, columnDragMotion, find, onFindChange, rowHeaderWidth, height, maxHeight, readOnly, dimReadOnlyCells, canEditCell: canEditCellProp, enableUndoRedo, enableClearOnDelete, editorEnterMove, imeDirectInput, undoHistoryLimit, onUndoRedoStateChange, trackChanges, rangeDecorations, onChangesChange, enableRangeSelection, enableRowSelection, rowSelectionMode, enableSelectAllRows: enableSelectAllRowsProp, rowSelection: rowSelectionProp, selectedRowKeys: selectedRowKeysProp, onRowSelectionChange, enableGlobalFilter, globalFilterMatch, enableColumnFilter, renderFilterDateInput, getFilterOptions, enableSorting, manualFiltering, manualSorting, enableColumnResize, autoSizeColumns, showCellOverflowTooltip, showValidationMarks, enableRowHover, enableColumnHeaderHover, hoveredRowIndex: hoveredRowIndexProp, onHoveredRowChange, onCellClick, onCellDoubleClick, onActiveCellChange, enableColumnMenu, noMatchingRowsText, noRowsText, ariaLabel, showTopBar, showBottomBar, showTopBarSummary, showTopBarFilter, globalFilterPlaceholder, globalFilterIcon, localeText, showTopBarCounts, showBottomBarCounts, showSelectionAggregates, showFilterChipBar, renderTopBar, renderBottomBar, className, style, classNames, getRowClassName, detailRow, onExpandedDetailRowKeysChange, labelRow, totalRow, pinnedTopRows, pinnedBottomRows, pinnedBottomRowsPlacement, columnGroups: columnGroupsProp, columnGroupHeaderHeight: columnGroupHeaderHeightProp, onColumnGroupOpenChange, treeData, onTreeRowOpenChange, fillHandle, enableRowDrag, isRowDraggable, onRowMove, canDropRow, enableContextMenu, getContextMenuItems, onContextMenuOpen, scrollHint, ref, onStateChange, initialState, includeGroupingInState, activeCellFollows, onFiltersChange, onSortChange, onScroll, }: SpreadsheetGridProps<T>, features: GridShellFeatures): import("react").JSX.Element;
3
+ export declare function useGridShell<T extends object>({ rows: rowsProp, dataSource, serverSideRefreshToken, serverSideRefetch, loading, pagination, onPageChange, onServerSideLoadError, onServerSideWriteError, columns: columnsProp, onRowsChange, onColumnsChange, rowKeyGetter, isRowExportable, createRow, createOverflowColumn, onPasteSkipped, pasteFillsSelection, copyFormat, copyHeaders, excelShortcuts, newRow, rowHeight: rowHeightProp, autoHeight, estimateRowHeight, verticalAlign, headerHeight: headerHeightProp, density, theme, motion, popupContainer, animateRows, showCopyRange, hoverHighlight, highlightChanges, showSaveStatus, rowDragMotion, columnDragMotion, find, onFindChange, rowHeaderWidth, height, maxHeight, readOnly, dimReadOnlyCells, canEditCell: canEditCellProp, enableUndoRedo, enableClearOnDelete, editorEnterMove, imeDirectInput, undoHistoryLimit, onUndoRedoStateChange, trackChanges, rangeDecorations, onChangesChange, enableRangeSelection, enableRowSelection, rowSelectionMode, enableSelectAllRows: enableSelectAllRowsProp, rowSelection: rowSelectionProp, selectedRowKeys: selectedRowKeysProp, onRowSelectionChange, enableGlobalFilter, globalFilterMatch, enableColumnFilter, renderFilterDateInput, getFilterOptions, enableSorting, manualFiltering, manualSorting, enableColumnResize, autoSizeColumns, showCellOverflowTooltip, showValidationMarks, enableRowHover, enableColumnHeaderHover, hoveredRowIndex: hoveredRowIndexProp, onHoveredRowChange, onCellClick, onCellDoubleClick, onActiveCellChange, enableColumnMenu, noMatchingRowsText, noRowsText, ariaLabel, showTopBar, showBottomBar, showTopBarSummary, showTopBarFilter, globalFilterPlaceholder, globalFilterIcon, localeText, showTopBarCounts, showBottomBarCounts, showSelectionAggregates, showFilterChipBar, renderTopBar, renderBottomBar, className, style, classNames, getRowClassName, detailRow, onExpandedDetailRowKeysChange, labelRow, totalRow, pinnedTopRows, pinnedBottomRows, pinnedBottomRowsPlacement, columnGroups: columnGroupsProp, columnGroupHeaderHeight: columnGroupHeaderHeightProp, onColumnGroupOpenChange, treeData, onTreeRowOpenChange, fillHandle, enableRowDrag, isRowDraggable, onRowMove, canDropRow, enableContextMenu, getContextMenuItems, onContextMenuOpen, scrollHint, ref, onStateChange, initialState, includeGroupingInState, activeCellFollows, onFiltersChange, onSortChange, onScroll, }: SpreadsheetGridProps<T>, features: GridShellFeatures): import("react").JSX.Element;
package/dist/common.d.ts CHANGED
@@ -2,6 +2,6 @@ export { numberFormatter } from '@ishibashi0112/spreadsheet-grid-core/internal/l
2
2
  export { numberParser } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/valueParsers';
3
3
  export { restoreColumnsFromState } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/gridState';
4
4
  export { preloadGridPopups } from './view/lazyPopups.js';
5
- export type { SpreadsheetGridProps, GridColumn, GridColumnPinned, GridColumnEditor, EditorCommitDirection, EditorEnterMove, CellEditorContext, GridSelectEditorOption, GridSelectLoadOptionsParams, GridSelectFillRowContext, GridValidationMode, CellValidationContext, CellValidationResult, GridInvalidCell, EditorCommitResult, GridChanges, GridChangedRow, GridChangesSummary, GridChangesSavedTarget, GridAddedRow, GridRemovedRow, GridTrackChangesOptions, GridRangeDecoration, GridTreeDataOptions, GridTreeRow, CellTreeContext, CellTreeState, TreeRowOpenChangeParams, GridRevealRowOptions, GridRowKey, GridAggFuncName, GridAggFuncParams, GridAggFunc, GridGroupRow, GridSelectFilterOption, GetFilterOptionsParams, GetFilterOptionsResult, ColumnFilterTypeOption, ColumnFilterUiType, CellRenderContext, HeaderRenderContext, GridColumnGroup, GridColumnGroupCollapsible, ColumnGroupHeaderRenderContext, ColumnGroupOpenChangeParams, GridExportColumnGroup, CellStyleContext, CanEditCellContext, GridConditionalFormat, RowStyleContext, DetailRowOptions, GridClassNames, GridSlotProps, GridFrameworkTypes, ReactGridTypes, DetailRowRenderContext, CellDetailContext, LabelRowOptions, LabelRowRenderContext, GridLabelRow, LabelRowSortMode, TotalRowOptions, TotalRowCellContext, TotalRowCellKind, FillHandleOptions, GridFillValueParams, GridFillDirection, GridFillKind, RowDragContext, RowMoveParams, RowDropParams, GridCellRef, GridCellEventParams, GridCellDoubleClickParams, CellValueFormatter, CellValueFormatterParams, SpreadsheetGridSlotContext, SpreadsheetGridDerivedSummary, SpreadsheetGridSelectionStats, GridLocaleText, GridLocaleTextTemplate, GridVerticalAlign, GridTextEditorEnterKey, GlobalFilterStatus, GridSelectionAggregates, CellCoord, CellRange, GridSelection, GridSortState, GridSortEntry, GridSortDirection, ColumnFilterValue, GridFilterState, SetColumnFilterValue, NumberColumnFilterValue, NumberSetColumnFilterValue, ParsedNumberFilter, TextSetColumnFilterValue, ParsedTextFilter, DateSetColumnFilterValue, ParsedDateFilter, DateFilterPreset, DateFilterPresetOption, CustomDateFilterPreset, DateFilterPresetRange, FilterDateInputContext, TextColumnFilterValue, DateColumnFilterValue, SelectColumnFilterValue, CustomColumnFilterValue, ServerSideDataSource, ServerSideQuery, ServerSideGetRowsParams, ServerSideGetRowsResult, ServerSideLoadErrorParams, ServerSideCellChange, ServerSideRowUpdate, ServerSideUpdateRowsParams, ServerSideUpdateRowsResult, ServerSideWriteErrorParams, RowModel, SpreadsheetGridHandle, RowSelectionModel, RowSelectionMode, ScrollAlign, GridScrollPosition, GridScrollEventParams, CsvExportScope, CsvExportOptions, GridExportOptions, GridExportCell, GridExportData, GridState, GridStatePatch, GridColumnState, GridDensity, GridTheme, UndoRedoState, GridMotion, GridPopupContainer, GridGlobalFilterMatch, GridPasteSkippedCell, GridPasteSkippedParams, GridExcelShortcutsOptions, GridNewRowOptions, GridApplyRowsOptions, GridCellValueEdit, GridCellValueSkip, GridCellValueSkipReason, GridCellValueMarked, GridSetCellValuesOptions, GridSetCellValuesResult, GridRowCounts, GridPinnedRowPosition, FindOptions, FindChangeParams, GridFindOpenOptions, GridFindReplaceResult, GridDataBarFormat, GridColorScaleFormat, GridChipTone, GridChipSpec, GridChipMap, AutoSizeColumnsMode, GridContextMenuTarget, GridContextMenuParams, GridContextMenuItem, GridContextMenuActionItem, GridContextMenuLabelItem, GridContextMenuSeparatorItem, GridContextMenuCustomItem, ScrollHintOptions, ScrollHintTrigger, ScrollHintRenderArgs, } from './model/gridTypes.js';
5
+ export type { SpreadsheetGridProps, GridColumn, GridColumnPinned, GridColumnEditor, EditorCommitDirection, EditorEnterMove, CellEditorContext, GridSelectEditorOption, GridSelectLoadOptionsParams, GridSelectFillRowContext, GridSpanRowsParams, GridColSpanContext, GridValidationMode, CellValidationContext, CellValidationResult, GridInvalidCell, EditorCommitResult, GridChanges, GridChangedRow, GridChangesSummary, GridChangesSavedTarget, GridAddedRow, GridRemovedRow, GridTrackChangesOptions, GridRangeDecoration, GridTreeDataOptions, GridTreeRow, CellTreeContext, CellTreeState, TreeRowOpenChangeParams, GridRevealRowOptions, GridRowKey, GridAggFuncName, GridAggFuncParams, GridAggFunc, GridGroupRow, GridSelectFilterOption, GetFilterOptionsParams, GetFilterOptionsResult, ColumnFilterTypeOption, ColumnFilterUiType, CellRenderContext, HeaderRenderContext, GridColumnGroup, GridColumnGroupCollapsible, ColumnGroupHeaderRenderContext, ColumnGroupOpenChangeParams, GridExportColumnGroup, GridExportCellSpan, CellStyleContext, CanEditCellContext, GridConditionalFormat, RowStyleContext, DetailRowOptions, GridClassNames, GridSlotProps, GridFrameworkTypes, ReactGridTypes, DetailRowRenderContext, CellDetailContext, LabelRowOptions, LabelRowRenderContext, GridLabelRow, LabelRowSortMode, TotalRowOptions, TotalRowCellContext, TotalRowCellKind, FillHandleOptions, GridFillValueParams, GridFillDirection, GridFillKind, RowDragContext, RowMoveParams, RowDropParams, GridCellRef, GridCellEventParams, GridCellDoubleClickParams, CellValueFormatter, CellValueFormatterParams, SpreadsheetGridSlotContext, SpreadsheetGridDerivedSummary, SpreadsheetGridSelectionStats, GridLocaleText, GridLocaleTextTemplate, GridVerticalAlign, GridTextEditorEnterKey, GlobalFilterStatus, GridSelectionAggregates, CellCoord, CellRange, GridSelection, GridSortState, GridSortEntry, GridSortDirection, ColumnFilterValue, GridFilterState, SetColumnFilterValue, NumberColumnFilterValue, NumberSetColumnFilterValue, ParsedNumberFilter, TextSetColumnFilterValue, ParsedTextFilter, DateSetColumnFilterValue, ParsedDateFilter, DateFilterPreset, DateFilterPresetOption, CustomDateFilterPreset, DateFilterPresetRange, FilterDateInputContext, TextColumnFilterValue, DateColumnFilterValue, SelectColumnFilterValue, CustomColumnFilterValue, ServerSideDataSource, ServerSideQuery, ServerSideGetRowsParams, ServerSideGetRowsResult, ServerSideLoadErrorParams, ServerSideCellChange, ServerSideRowUpdate, ServerSideUpdateRowsParams, ServerSideUpdateRowsResult, ServerSideWriteErrorParams, RowModel, SpreadsheetGridHandle, RowSelectionModel, RowSelectionMode, ScrollAlign, GridScrollPosition, GridScrollEventParams, CsvExportScope, CsvExportOptions, GridExportOptions, GridExportCell, GridExportData, GridState, GridStatePatch, GridColumnState, GridDensity, GridTheme, UndoRedoState, GridMotion, GridPopupContainer, GridGlobalFilterMatch, GridPasteSkippedCell, GridPasteSkippedParams, GridExcelShortcutsOptions, GridNewRowOptions, GridApplyRowsOptions, GridCellValueEdit, GridCellValueSkip, GridCellValueSkipReason, GridCellValueMarked, GridSetCellValuesOptions, GridSetCellValuesResult, GridRowCounts, GridPaginationOptions, GridPageInfo, GridPaginationContext, GridPinnedRowPosition, FindOptions, FindChangeParams, GridFindOpenOptions, GridFindReplaceResult, GridDataBarFormat, GridColorScaleFormat, GridChipTone, GridChipSpec, GridChipMap, AutoSizeColumnsMode, GridContextMenuTarget, GridContextMenuParams, GridContextMenuItem, GridContextMenuActionItem, GridContextMenuLabelItem, GridContextMenuSeparatorItem, GridContextMenuCustomItem, ScrollHintOptions, ScrollHintTrigger, ScrollHintRenderArgs, } from './model/gridTypes.js';
6
6
  export type { NumberFormatterOptions } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/valueFormatters';
7
7
  export type { NumberParserOptions } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/valueParsers';
@@ -0,0 +1,2 @@
1
+ import type { GridFeature } from './types.js';
2
+ export declare const cellSpanFeature: GridFeature<"cellSpan">;
@@ -0,0 +1,2 @@
1
+ import type { GridFeature } from './types.js';
2
+ export declare const paginationFeature: GridFeature<"pagination">;
@@ -16,11 +16,14 @@ import type { ResolvedGridLocaleText } from '@ishibashi0112/spreadsheet-grid-cor
16
16
  import type { createRangeDecorationResolver } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/rangeDecorations';
17
17
  import type { describeChangeNavTarget, describeDiffCell, formatDiffOriginalText, formatDiffSummaryParts, nextChangeNavAnnouncement } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/diffView';
18
18
  import type { resolveNewRowPlaceholder } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/newRow';
19
+ import type { resolveAutoPageSize, resolvePaginationOptions } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/pagination';
20
+ import type { createCellSpanLayoutResolver, resolveCellSpanPlacement } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/cellSpanLayout';
19
21
  import type { GridUiAction } from '@ishibashi0112/spreadsheet-grid-core/internal/model/gridActions';
20
22
  import type { ColumnPane, GridPaneLayout } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/geometry';
21
23
  import type { DetailRowExtra, RowMetrics } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry';
22
24
  import type { CellCoord, ColumnFilterValue, GridColumn, GridContextMenuItem, GridContextMenuParams, GridContextMenuTarget, GridResolvedSlots, GridSelection, GridSelectionAggregates, GridLocaleText, GridUiState, GlobalFilterStatus, GridGlobalFilterMatch, GridRowKey, RowModel, SpreadsheetGridProps } from '../model/gridTypes.js';
23
25
  import type { GridFindBar } from '../view/GridFindBar.js';
26
+ import type { GridPager } from '../view/GridPager.js';
24
27
  import type { GridFindReplaceSection, GridFindReplaceToggle, GridFindScopeOverlay } from '../view/GridFindReplace.js';
25
28
  import type { GridScrollHint } from '../view/GridScrollHint.js';
26
29
  import type { GridTotalRow } from '../view/GridTotalRow.js';
@@ -181,6 +184,7 @@ export type RowDragFeatureArgs<T> = Omit<UseRowDragControllerArgs, 'getRowDragLa
181
184
  hasRowKeys: boolean;
182
185
  localeTexts: ResolvedGridLocaleText;
183
186
  blockedByRemovedRows?: boolean | undefined;
187
+ rowOffset?: number | undefined;
184
188
  };
185
189
  export type RowDragFeatureResult<T> = {
186
190
  renderHandleCell: (row: T, rowIndex: number) => ReactNode;
@@ -326,6 +330,15 @@ export type ReactGridFeatures = {
326
330
  newRow?: NonNullable<GridCoreFeatures['newRow']> & FeatureLocaleDefaults & {
327
331
  resolveNewRowPlaceholder: typeof resolveNewRowPlaceholder;
328
332
  } | undefined;
333
+ pagination?: NonNullable<GridCoreFeatures['pagination']> & FeatureLocaleDefaults & {
334
+ resolvePaginationOptions: typeof resolvePaginationOptions;
335
+ resolveAutoPageSize: typeof resolveAutoPageSize;
336
+ Pager: typeof GridPager;
337
+ } | undefined;
338
+ cellSpan?: NonNullable<GridCoreFeatures['cellSpan']> & {
339
+ createCellSpanLayoutResolver: typeof createCellSpanLayoutResolver;
340
+ resolveCellSpanPlacement: typeof resolveCellSpanPlacement;
341
+ } | undefined;
329
342
  treeData?: NonNullable<GridCoreFeatures['treeData']> & FeatureLocaleDefaults & {
330
343
  TreeCellPrefix: typeof GridTreeCellPrefix;
331
344
  TreeAggregateValue: typeof GridTreeAggregateValue;
@@ -1,6 +1,6 @@
1
- import type { GlobalFilterStatus, GridChangesSummary, GridColumn, GridSelectionAggregates, GridUiState, SpreadsheetGridSlotContext } from '../model/gridTypes.js';
1
+ import type { GlobalFilterStatus, GridChangesSummary, GridColumn, GridPaginationContext, GridSelectionAggregates, GridUiState, SpreadsheetGridSlotContext } from '../model/gridTypes.js';
2
2
  import type { ResolvedGridLocaleText } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText';
3
- type GridSlotContextBase<T> = Omit<SpreadsheetGridSlotContext<T>, 'setGlobalFilterText' | 'derivedSummary' | 'filteredRows' | 'globalFilterStatus' | 'globalFilterProgress' | 'selectionAggregates' | 'unsavedChanges'>;
3
+ type GridSlotContextBase<T> = Omit<SpreadsheetGridSlotContext<T>, 'setGlobalFilterText' | 'derivedSummary' | 'filteredRows' | 'globalFilterStatus' | 'globalFilterProgress' | 'selectionAggregates' | 'unsavedChanges' | 'pagination' | 'loading'>;
4
4
  type UseGridBarContextArgs<T> = {
5
5
  rows: T[];
6
6
  localeTexts: ResolvedGridLocaleText;
@@ -17,10 +17,12 @@ type UseGridBarContextArgs<T> = {
17
17
  globalFilterProgress: number;
18
18
  selectionAggregates?: GridSelectionAggregates | null;
19
19
  unsavedChanges?: GridChangesSummary | null;
20
+ pagination?: GridPaginationContext | null;
21
+ loading?: boolean;
20
22
  filtersApplied?: boolean;
21
23
  columnTitles?: ReadonlyMap<string, string> | null;
22
24
  };
23
- export declare const useGridBarContext: <T>({ rows, localeTexts, viewRowCount, totalRowCount, getFilteredRows, columns, visibleColumns, orderedColumns, labelViewIndexes, uiState, setGlobalFilterText, globalFilterStatus, globalFilterProgress, selectionAggregates, unsavedChanges, filtersApplied, columnTitles, }: UseGridBarContextArgs<T>) => {
25
+ export declare const useGridBarContext: <T>({ rows, localeTexts, viewRowCount, totalRowCount, getFilteredRows, columns, visibleColumns, orderedColumns, labelViewIndexes, uiState, setGlobalFilterText, globalFilterStatus, globalFilterProgress, selectionAggregates, unsavedChanges, pagination, loading, filtersApplied, columnTitles, }: UseGridBarContextArgs<T>) => {
24
26
  slotContextBase: GridSlotContextBase<T>;
25
27
  derivedSummary: import("@ishibashi0112/spreadsheet-grid-core").SpreadsheetGridDerivedSummary;
26
28
  slotContext: SpreadsheetGridSlotContext<T>;
@@ -1,5 +1,5 @@
1
1
  import { type FeatureLocaleText, type ResolvedGridLocaleText } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText';
2
- export declare const GridLocaleTextContext: import("react").Context<Readonly<Pick<import("@ishibashi0112/spreadsheet-grid-core").GridLocaleText, "none" | "blank" | "selection" | "globalFilterPlaceholder" | "rowCount" | "columnCount" | "filterSummary" | "filterGlobal" | "filterColumns" | "sortSummary" | "sortEntry" | "sortAscending" | "sortDescending" | "activeCell" | "selectionSize" | "selectedColumns" | "detailColumnName" | "rowDragColumnName" | "listSeparator" | "multiSelectSeparator" | "globalFilterLabel" | "clearGlobalFilter" | "toggleFilterPanel" | "clear" | "close" | "retry" | "noOptions" | "noRows" | "noMatchingRows" | "selectAllRows" | "selectRow" | "sortedAscending" | "sortedDescending" | "sortPriority" | "columnFiltered" | "dragColumn" | "columnMenu" | "columnMenuFor" | "showDetails" | "hideDetails" | "editCell" | "cellInput" | "sizingColumns" | "applyingFilter" | "resetColumnsHint" | "toolPanelFilters" | "toolPanelSort" | "toolPanelColumns" | "filterNone" | "filterCustom" | "filterExcluded" | "filterExcludedValues" | "filterSelected" | "filterMatches" | "filterBoth" | "conditionGreaterThanOrEqual" | "conditionGreaterThan" | "conditionLessThanOrEqual" | "conditionLessThan" | "conditionEquals" | "conditionNotEquals" | "conditionRange" | "conditionOnOrAfter" | "conditionOnOrBefore" | "conditionContains" | "conditionStartsWith" | "conditionEndsWith" | "conditionBlank" | "conditionNotBlank" | "datePresetToday" | "datePresetThisMonth" | "datePresetLast30Days" | "invalidValue" | "enterNumber" | "enterInteger" | "enterMin" | "enterMax" | "enterRange" | "enterDate" | "enterTime" | "enterDateTime" | "saveFailedCell" | "totalRowLabel" | "totalAverage" | "totalMin" | "totalMax" | "totalCount" | "exportSubtotal"> & Partial<import("@ishibashi0112/spreadsheet-grid-core").GridLocaleText>>>;
2
+ export declare const GridLocaleTextContext: import("react").Context<Readonly<Pick<import("@ishibashi0112/spreadsheet-grid-core").GridLocaleText, "none" | "blank" | "selection" | "globalFilterPlaceholder" | "rowCount" | "columnCount" | "filterSummary" | "filterGlobal" | "filterColumns" | "sortSummary" | "sortEntry" | "sortAscending" | "sortDescending" | "activeCell" | "selectionSize" | "selectedColumns" | "detailColumnName" | "rowDragColumnName" | "listSeparator" | "multiSelectSeparator" | "globalFilterLabel" | "clearGlobalFilter" | "toggleFilterPanel" | "clear" | "close" | "retry" | "noOptions" | "noRows" | "noMatchingRows" | "selectAllRows" | "selectRow" | "sortedAscending" | "sortedDescending" | "sortPriority" | "columnFiltered" | "dragColumn" | "columnMenu" | "columnMenuFor" | "showDetails" | "hideDetails" | "editCell" | "cellInput" | "sizingColumns" | "applyingFilter" | "resetColumnsHint" | "toolPanelFilters" | "toolPanelSort" | "toolPanelColumns" | "filterNone" | "filterCustom" | "filterExcluded" | "filterExcludedValues" | "filterSelected" | "filterMatches" | "filterBoth" | "conditionGreaterThanOrEqual" | "conditionGreaterThan" | "conditionLessThanOrEqual" | "conditionLessThan" | "conditionEquals" | "conditionNotEquals" | "conditionRange" | "conditionOnOrAfter" | "conditionOnOrBefore" | "conditionContains" | "conditionStartsWith" | "conditionEndsWith" | "conditionBlank" | "conditionNotBlank" | "datePresetToday" | "datePresetThisMonth" | "datePresetLast30Days" | "invalidValue" | "enterNumber" | "enterInteger" | "enterMin" | "enterMax" | "enterRange" | "enterDate" | "enterTime" | "enterDateTime" | "saveFailedCell" | "totalRowLabel" | "totalAverage" | "totalMin" | "totalMax" | "totalCount" | "exportSubtotal" | "loadingRows"> & Partial<import("@ishibashi0112/spreadsheet-grid-core").GridLocaleText>>>;
3
3
  export declare const useGridLocaleText: () => ResolvedGridLocaleText;
4
4
  export declare const useFeatureLocaleText: <D>() => FeatureLocaleText<D>;
5
5
  export declare const mergeFeatureLocaleDefaults: (features: object) => ResolvedGridLocaleText;