playbook-ui 18.3.0-rc.1 → 18.3.0-rc.2

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 (44) hide show
  1. package/dist/.vite/manifest.json +90 -17
  2. package/dist/advanced-table.js +1 -1
  3. package/dist/ai/all-schemas.json +56 -2
  4. package/dist/ai/external-dependencies.json +1 -1
  5. package/dist/ai/forms.json +2 -2
  6. package/dist/ai/index.json +3 -3
  7. package/dist/ai/kits/avatar.schema.json +1 -0
  8. package/dist/ai/kits/contact.schema.json +1 -0
  9. package/dist/ai/kits/date.schema.json +1 -0
  10. package/dist/ai/kits/date_range_inline.schema.json +1 -0
  11. package/dist/ai/kits/date_range_stacked.schema.json +1 -0
  12. package/dist/ai/kits/date_stacked.schema.json +1 -0
  13. package/dist/ai/kits/date_time.schema.json +1 -0
  14. package/dist/ai/kits/date_time_stacked.schema.json +1 -0
  15. package/dist/ai/kits/date_year_stacked.schema.json +1 -0
  16. package/dist/ai/kits/dropdown.schema.json +38 -1
  17. package/dist/ai/kits/image.schema.json +1 -0
  18. package/dist/ai/kits/person.schema.json +1 -0
  19. package/dist/ai/kits/rich_text_editor.schema.json +1 -1
  20. package/dist/ai/kits/time_range_inline.schema.json +1 -0
  21. package/dist/ai/kits/time_stacked.schema.json +1 -0
  22. package/dist/ai/kits/timestamp.schema.json +1 -0
  23. package/dist/ai/kits/user.schema.json +1 -0
  24. package/dist/ai/kits/user_badge.schema.json +1 -0
  25. package/dist/ai/kits/weekday_stacked.schema.json +1 -0
  26. package/dist/ai/playgrounds/dropdown.json +1 -1
  27. package/dist/ai/playgrounds/rich_text_editor.json +1 -1
  28. package/dist/chunks/{_pagination-D0hcdUl3.js → _pagination-CARbC_IN.js} +1 -1
  29. package/dist/chunks/{_tooltip-DfZEKsnv.js → _tooltip-UkcgcThO.js} +1 -1
  30. package/dist/chunks/{_typeahead-CmJ8Ggzz.js → _typeahead-NYVJDWmJ.js} +1 -1
  31. package/dist/chunks/index-4jrZjexD.js +1 -0
  32. package/dist/chunks/index-BAy61y8S.js +1 -0
  33. package/dist/chunks/index-Cb_SDipk.js +1 -0
  34. package/dist/chunks/index-D3RdsDp7.js +1 -0
  35. package/dist/chunks/index-D8PZIesy.js +1 -0
  36. package/dist/chunks/index-DIoc-aua.js +1 -0
  37. package/dist/chunks/index-qex65UMn.js +1 -0
  38. package/dist/chunks/vendor.js +2 -2
  39. package/dist/playbook-advanced-table.js +1 -1
  40. package/dist/playbook-rails-react-bindings.js +1 -1
  41. package/dist/playbook-rails.js +1 -1
  42. package/dist/playbook.css +1 -1
  43. package/dist/playbook.js +1 -1
  44. package/package.json +8 -8
@@ -1,15 +1,71 @@
1
1
  {
2
+ "../../node_modules/@tiptap/extension-image/dist/index.js": {
3
+ "file": "chunks/index-Cb_SDipk.js",
4
+ "name": "index",
5
+ "src": "../../node_modules/@tiptap/extension-image/dist/index.js",
6
+ "isDynamicEntry": true,
7
+ "imports": [
8
+ "_index-4jrZjexD.js",
9
+ "../../node_modules/prosemirror-model/dist/index.js"
10
+ ]
11
+ },
12
+ "../../node_modules/@tiptap/extension-text-align/dist/index.js": {
13
+ "file": "chunks/index-D8PZIesy.js",
14
+ "name": "index",
15
+ "src": "../../node_modules/@tiptap/extension-text-align/dist/index.js",
16
+ "isDynamicEntry": true,
17
+ "imports": [
18
+ "_index-4jrZjexD.js",
19
+ "../../node_modules/prosemirror-model/dist/index.js"
20
+ ]
21
+ },
22
+ "../../node_modules/@tiptap/extension-underline/dist/index.js": {
23
+ "file": "chunks/index-DIoc-aua.js",
24
+ "name": "index",
25
+ "src": "../../node_modules/@tiptap/extension-underline/dist/index.js",
26
+ "isDynamicEntry": true,
27
+ "imports": [
28
+ "_index-4jrZjexD.js",
29
+ "../../node_modules/prosemirror-model/dist/index.js"
30
+ ]
31
+ },
32
+ "../../node_modules/@tiptap/starter-kit/dist/index.js": {
33
+ "file": "chunks/index-qex65UMn.js",
34
+ "name": "index",
35
+ "src": "../../node_modules/@tiptap/starter-kit/dist/index.js",
36
+ "isDynamicEntry": true,
37
+ "imports": [
38
+ "_index-4jrZjexD.js",
39
+ "../../node_modules/@tiptap/extension-underline/dist/index.js",
40
+ "../../node_modules/prosemirror-model/dist/index.js"
41
+ ]
42
+ },
43
+ "../../node_modules/prosemirror-markdown/dist/index.js": {
44
+ "file": "chunks/index-BAy61y8S.js",
45
+ "name": "index",
46
+ "src": "../../node_modules/prosemirror-markdown/dist/index.js",
47
+ "isDynamicEntry": true,
48
+ "imports": [
49
+ "../../node_modules/prosemirror-model/dist/index.js"
50
+ ]
51
+ },
52
+ "../../node_modules/prosemirror-model/dist/index.js": {
53
+ "file": "chunks/index-D3RdsDp7.js",
54
+ "name": "index",
55
+ "src": "../../node_modules/prosemirror-model/dist/index.js",
56
+ "isDynamicEntry": true
57
+ },
2
58
  "_StickyLayoutHelper-DCzCcWUN.js": {
3
59
  "file": "chunks/StickyLayoutHelper-DCzCcWUN.js",
4
60
  "name": "StickyLayoutHelper"
5
61
  },
6
- "__pagination-D0hcdUl3.js": {
7
- "file": "chunks/_pagination-D0hcdUl3.js",
62
+ "__pagination-CARbC_IN.js": {
63
+ "file": "chunks/_pagination-CARbC_IN.js",
8
64
  "name": "_pagination",
9
65
  "imports": [
10
66
  "_globalProps-BivjwRew.js",
11
67
  "_lib-C50eCpoN.js",
12
- "__tooltip-DfZEKsnv.js",
68
+ "__tooltip-UkcgcThO.js",
13
69
  "_quickpickDateSync-DLDx4zce.js"
14
70
  ]
15
71
  },
@@ -21,21 +77,21 @@
21
77
  "_lib-C50eCpoN.js"
22
78
  ]
23
79
  },
24
- "__tooltip-DfZEKsnv.js": {
25
- "file": "chunks/_tooltip-DfZEKsnv.js",
80
+ "__tooltip-UkcgcThO.js": {
81
+ "file": "chunks/_tooltip-UkcgcThO.js",
26
82
  "name": "_tooltip",
27
83
  "imports": [
28
84
  "_globalProps-BivjwRew.js",
29
85
  "_lib-C50eCpoN.js"
30
86
  ]
31
87
  },
32
- "__typeahead-CmJ8Ggzz.js": {
33
- "file": "chunks/_typeahead-CmJ8Ggzz.js",
88
+ "__typeahead-NYVJDWmJ.js": {
89
+ "file": "chunks/_typeahead-NYVJDWmJ.js",
34
90
  "name": "_typeahead",
35
91
  "imports": [
36
92
  "_lib-C50eCpoN.js",
37
93
  "_globalProps-BivjwRew.js",
38
- "__tooltip-DfZEKsnv.js"
94
+ "__tooltip-UkcgcThO.js"
39
95
  ]
40
96
  },
41
97
  "_componentRegistry-DRSp5D_e.js": {
@@ -49,6 +105,14 @@
49
105
  "_lib-C50eCpoN.js"
50
106
  ]
51
107
  },
108
+ "_index-4jrZjexD.js": {
109
+ "file": "chunks/index-4jrZjexD.js",
110
+ "name": "index",
111
+ "isDynamicEntry": true,
112
+ "imports": [
113
+ "../../node_modules/prosemirror-model/dist/index.js"
114
+ ]
115
+ },
52
116
  "_lib-C50eCpoN.js": {
53
117
  "file": "chunks/lib-C50eCpoN.js",
54
118
  "name": "lib",
@@ -80,8 +144,8 @@
80
144
  "entrypoints/playbook-advanced-table.js",
81
145
  "_globalProps-BivjwRew.js",
82
146
  "_lib-C50eCpoN.js",
83
- "__pagination-D0hcdUl3.js",
84
- "__tooltip-DfZEKsnv.js",
147
+ "__pagination-CARbC_IN.js",
148
+ "__tooltip-UkcgcThO.js",
85
149
  "_quickpickDateSync-DLDx4zce.js",
86
150
  "_StickyLayoutHelper-DCzCcWUN.js"
87
151
  ]
@@ -116,10 +180,10 @@
116
180
  "isEntry": true,
117
181
  "imports": [
118
182
  "_componentRegistry-DRSp5D_e.js",
119
- "__typeahead-CmJ8Ggzz.js",
183
+ "__typeahead-NYVJDWmJ.js",
120
184
  "_lib-C50eCpoN.js",
121
185
  "_globalProps-BivjwRew.js",
122
- "__tooltip-DfZEKsnv.js"
186
+ "__tooltip-UkcgcThO.js"
123
187
  ]
124
188
  },
125
189
  "entrypoints/playbook-rails.js": {
@@ -129,14 +193,23 @@
129
193
  "isEntry": true,
130
194
  "imports": [
131
195
  "_lib-C50eCpoN.js",
132
- "__typeahead-CmJ8Ggzz.js",
196
+ "__typeahead-NYVJDWmJ.js",
133
197
  "_time_picker_helper-DfKvHCJu.js",
134
198
  "_quickpickDateSync-DLDx4zce.js",
135
199
  "_StickyLayoutHelper-DCzCcWUN.js",
136
200
  "entrypoints/playbook-rails-react-bindings.js",
137
201
  "_globalProps-BivjwRew.js",
138
- "__tooltip-DfZEKsnv.js",
202
+ "__tooltip-UkcgcThO.js",
139
203
  "_componentRegistry-DRSp5D_e.js"
204
+ ],
205
+ "dynamicImports": [
206
+ "../../node_modules/@tiptap/extension-underline/dist/index.js",
207
+ "../../node_modules/@tiptap/extension-text-align/dist/index.js",
208
+ "../../node_modules/@tiptap/extension-image/dist/index.js",
209
+ "_index-4jrZjexD.js",
210
+ "../../node_modules/@tiptap/starter-kit/dist/index.js",
211
+ "../../node_modules/prosemirror-markdown/dist/index.js",
212
+ "../../node_modules/prosemirror-model/dist/index.js"
140
213
  ]
141
214
  },
142
215
  "entrypoints/playbook.js": {
@@ -145,10 +218,10 @@
145
218
  "src": "entrypoints/playbook.js",
146
219
  "isEntry": true,
147
220
  "imports": [
148
- "__tooltip-DfZEKsnv.js",
149
- "__typeahead-CmJ8Ggzz.js",
221
+ "__tooltip-UkcgcThO.js",
222
+ "__typeahead-NYVJDWmJ.js",
150
223
  "entrypoints/playbook.js",
151
- "__pagination-D0hcdUl3.js",
224
+ "__pagination-CARbC_IN.js",
152
225
  "_lib-C50eCpoN.js",
153
226
  "_globalProps-BivjwRew.js",
154
227
  "_time_picker_helper-DfKvHCJu.js",
@@ -1,4 +1,4 @@
1
- import{jsx,jsxs,Fragment}from"react/jsx-runtime";import*as React from"react";import React__default,{createContext,useRef,useState,useCallback,useEffect,useMemo,useContext,useLayoutEffect}from"react";import{d as classnames,e as buildCss,g as globalProps,b as buildAriaProps,a as buildDataProps,c as buildHtmlProps}from"./chunks/globalProps-BivjwRew.js";import{C as Checkbox,P as PbReactPopover,S as SectionSeparator,L as LoadingInline,a as Pagination,F as FlexItem,T as Table}from"./chunks/_pagination-D0hcdUl3.js";import{flushSync}from"react-dom";import{m as measureElementHeight,s as scheduleStickyActionBarHeightUpdate,b as updateStickyLayoutHeights}from"./chunks/StickyLayoutHelper-DCzCcWUN.js";import{I as Icon,F as Flex,C as Caption,D as Detail,a as Card,T as Tooltip}from"./chunks/_tooltip-DfZEKsnv.js";import"./chunks/lib-C50eCpoN.js";import"./chunks/quickpickDateSync-DLDx4zce.js";function memo$1(getDeps,fn,opts){let deps=opts.initialDeps??[];let result;return()=>{var _a,_b,_c,_d;let depTime;if(opts.key&&((_a=opts.debug)==null?void 0:_a.call(opts)))depTime=Date.now();const newDeps=getDeps();const depsChanged=newDeps.length!==deps.length||newDeps.some(((dep,index)=>deps[index]!==dep));if(!depsChanged){return result}deps=newDeps;let resultTime;if(opts.key&&((_b=opts.debug)==null?void 0:_b.call(opts)))resultTime=Date.now();result=fn(...newDeps);if(opts.key&&((_c=opts.debug)==null?void 0:_c.call(opts))){const depEndTime=Math.round((Date.now()-depTime)*100)/100;const resultEndTime=Math.round((Date.now()-resultTime)*100)/100;const resultFpsPercentage=resultEndTime/16;const pad=(str,num)=>{str=String(str);while(str.length<num){str=" "+str}return str};console.info(`%c⏱ ${pad(resultEndTime,5)} /${pad(depEndTime,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*resultFpsPercentage,120))}deg 100% 31%);`,opts==null?void 0:opts.key)}(_d=opts==null?void 0:opts.onChange)==null?void 0:_d.call(opts,result);return result}}function notUndefined(value,msg){if(value===void 0){throw new Error(`Unexpected undefined${""}`)}else{return value}}const approxEqual=(a,b)=>Math.abs(a-b)<1;const debounce=(targetWindow,fn,ms)=>{let timeoutId;return function(...args){targetWindow.clearTimeout(timeoutId);timeoutId=targetWindow.setTimeout((()=>fn.apply(this,args)),ms)}};const defaultKeyExtractor=index=>index;const defaultRangeExtractor=range=>{const start=Math.max(range.startIndex-range.overscan,0);const end=Math.min(range.endIndex+range.overscan,range.count-1);const arr=[];for(let i=start;i<=end;i++){arr.push(i)}return arr};const observeElementRect=(instance,cb)=>{const element=instance.scrollElement;if(!element){return}const targetWindow=instance.targetWindow;if(!targetWindow){return}const handler=rect=>{const{width:width,height:height}=rect;cb({width:Math.round(width),height:Math.round(height)})};handler(element.getBoundingClientRect());if(!targetWindow.ResizeObserver){return()=>{}}const observer=new targetWindow.ResizeObserver((entries=>{const run=()=>{const entry=entries[0];if(entry==null?void 0:entry.borderBoxSize){const box=entry.borderBoxSize[0];if(box){handler({width:box.inlineSize,height:box.blockSize});return}}handler(element.getBoundingClientRect())};instance.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(run):run()}));observer.observe(element,{box:"border-box"});return()=>{observer.unobserve(element)}};const addEventListenerOptions={passive:true};const supportsScrollend=typeof window=="undefined"?true:"onscrollend"in window;const observeElementOffset=(instance,cb)=>{const element=instance.scrollElement;if(!element){return}const targetWindow=instance.targetWindow;if(!targetWindow){return}let offset=0;const fallback=instance.options.useScrollendEvent&&supportsScrollend?()=>void 0:debounce(targetWindow,(()=>{cb(offset,false)}),instance.options.isScrollingResetDelay);const createHandler=isScrolling=>()=>{const{horizontal:horizontal,isRtl:isRtl}=instance.options;offset=horizontal?element["scrollLeft"]*(isRtl&&-1||1):element["scrollTop"];fallback();cb(offset,isScrolling)};const handler=createHandler(true);const endHandler=createHandler(false);endHandler();element.addEventListener("scroll",handler,addEventListenerOptions);const registerScrollendEvent=instance.options.useScrollendEvent&&supportsScrollend;if(registerScrollendEvent){element.addEventListener("scrollend",endHandler,addEventListenerOptions)}return()=>{element.removeEventListener("scroll",handler);if(registerScrollendEvent){element.removeEventListener("scrollend",endHandler)}}};const measureElement=(element,entry,instance)=>{if(entry==null?void 0:entry.borderBoxSize){const box=entry.borderBoxSize[0];if(box){const size=Math.round(box[instance.options.horizontal?"inlineSize":"blockSize"]);return size}}return Math.round(element.getBoundingClientRect()[instance.options.horizontal?"width":"height"])};const elementScroll=(offset,{adjustments:adjustments=0,behavior:behavior},instance)=>{var _a,_b;const toOffset=offset+adjustments;(_b=(_a=instance.scrollElement)==null?void 0:_a.scrollTo)==null?void 0:_b.call(_a,{[instance.options.horizontal?"left":"top"]:toOffset,behavior:behavior})};class Virtualizer{constructor(opts){this.unsubs=[];this.scrollElement=null;this.targetWindow=null;this.isScrolling=false;this.scrollToIndexTimeoutId=null;this.measurementsCache=[];this.itemSizeCache=new Map;this.pendingMeasuredCacheIndexes=[];this.scrollRect=null;this.scrollOffset=null;this.scrollDirection=null;this.scrollAdjustments=0;this.elementsCache=new Map;this.observer=(()=>{let _ro=null;const get=()=>{if(_ro){return _ro}if(!this.targetWindow||!this.targetWindow.ResizeObserver){return null}return _ro=new this.targetWindow.ResizeObserver((entries=>{entries.forEach((entry=>{const run=()=>{this._measureElement(entry.target,entry)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(run):run()}))}))};return{disconnect:()=>{var _a;(_a=get())==null?void 0:_a.disconnect();_ro=null},observe:target=>{var _a;return(_a=get())==null?void 0:_a.observe(target,{box:"border-box"})},unobserve:target=>{var _a;return(_a=get())==null?void 0:_a.unobserve(target)}}})();this.range=null;this.setOptions=opts2=>{Object.entries(opts2).forEach((([key,value])=>{if(typeof value==="undefined")delete opts2[key]}));this.options={debug:false,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:false,getItemKey:defaultKeyExtractor,rangeExtractor:defaultRangeExtractor,onChange:()=>{},measureElement:measureElement,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:true,isRtl:false,useScrollendEvent:true,useAnimationFrameWithResizeObserver:false,...opts2}};this.notify=sync=>{var _a,_b;(_b=(_a=this.options).onChange)==null?void 0:_b.call(_a,this,sync)};this.maybeNotify=memo$1((()=>{this.calculateRange();return[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),(isScrolling=>{this.notify(isScrolling)}),{key:false,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]});this.cleanup=()=>{this.unsubs.filter(Boolean).forEach((d=>d()));this.unsubs=[];this.observer.disconnect();this.scrollElement=null;this.targetWindow=null};this._didMount=()=>()=>{this.cleanup()};this._willUpdate=()=>{var _a;const scrollElement=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==scrollElement){this.cleanup();if(!scrollElement){this.maybeNotify();return}this.scrollElement=scrollElement;if(this.scrollElement&&"ownerDocument"in this.scrollElement){this.targetWindow=this.scrollElement.ownerDocument.defaultView}else{this.targetWindow=((_a=this.scrollElement)==null?void 0:_a.window)??null}this.elementsCache.forEach((cached=>{this.observer.observe(cached)}));this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0});this.unsubs.push(this.options.observeElementRect(this,(rect=>{this.scrollRect=rect;this.maybeNotify()})));this.unsubs.push(this.options.observeElementOffset(this,((offset,isScrolling)=>{this.scrollAdjustments=0;this.scrollDirection=isScrolling?this.getScrollOffset()<offset?"forward":"backward":null;this.scrollOffset=offset;this.isScrolling=isScrolling;this.maybeNotify()})))}};this.getSize=()=>{if(!this.options.enabled){this.scrollRect=null;return 0}this.scrollRect=this.scrollRect??this.options.initialRect;return this.scrollRect[this.options.horizontal?"width":"height"]};this.getScrollOffset=()=>{if(!this.options.enabled){this.scrollOffset=null;return 0}this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==="function"?this.options.initialOffset():this.options.initialOffset);return this.scrollOffset};this.getFurthestMeasurement=(measurements,index)=>{const furthestMeasurementsFound=new Map;const furthestMeasurements=new Map;for(let m=index-1;m>=0;m--){const measurement=measurements[m];if(furthestMeasurementsFound.has(measurement.lane)){continue}const previousFurthestMeasurement=furthestMeasurements.get(measurement.lane);if(previousFurthestMeasurement==null||measurement.end>previousFurthestMeasurement.end){furthestMeasurements.set(measurement.lane,measurement)}else if(measurement.end<previousFurthestMeasurement.end){furthestMeasurementsFound.set(measurement.lane,true)}if(furthestMeasurementsFound.size===this.options.lanes){break}}return furthestMeasurements.size===this.options.lanes?Array.from(furthestMeasurements.values()).sort(((a,b)=>{if(a.end===b.end){return a.index-b.index}return a.end-b.end}))[0]:void 0};this.getMeasurementOptions=memo$1((()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled]),((count2,paddingStart,scrollMargin,getItemKey,enabled)=>{this.pendingMeasuredCacheIndexes=[];return{count:count2,paddingStart:paddingStart,scrollMargin:scrollMargin,getItemKey:getItemKey,enabled:enabled}}),{key:false});this.getMeasurements=memo$1((()=>[this.getMeasurementOptions(),this.itemSizeCache]),(({count:count2,paddingStart:paddingStart,scrollMargin:scrollMargin,getItemKey:getItemKey,enabled:enabled},itemSizeCache)=>{if(!enabled){this.measurementsCache=[];this.itemSizeCache.clear();return[]}if(this.measurementsCache.length===0){this.measurementsCache=this.options.initialMeasurementsCache;this.measurementsCache.forEach((item=>{this.itemSizeCache.set(item.key,item.size)}))}const min2=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const measurements=this.measurementsCache.slice(0,min2);for(let i=min2;i<count2;i++){const key=getItemKey(i);const furthestMeasurement=this.options.lanes===1?measurements[i-1]:this.getFurthestMeasurement(measurements,i);const start=furthestMeasurement?furthestMeasurement.end+this.options.gap:paddingStart+scrollMargin;const measuredSize=itemSizeCache.get(key);const size=typeof measuredSize==="number"?measuredSize:this.options.estimateSize(i);const end=start+size;const lane=furthestMeasurement?furthestMeasurement.lane:i%this.options.lanes;measurements[i]={index:i,start:start,size:size,end:end,key:key,lane:lane}}this.measurementsCache=measurements;return measurements}),{key:false,debug:()=>this.options.debug});this.calculateRange=memo$1((()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()]),((measurements,outerSize,scrollOffset)=>this.range=measurements.length>0&&outerSize>0?calculateRange({measurements:measurements,outerSize:outerSize,scrollOffset:scrollOffset}):null),{key:false,debug:()=>this.options.debug});this.getVirtualIndexes=memo$1((()=>{let startIndex=null;let endIndex=null;const range=this.calculateRange();if(range){startIndex=range.startIndex;endIndex=range.endIndex}return[this.options.rangeExtractor,this.options.overscan,this.options.count,startIndex,endIndex]}),((rangeExtractor,overscan,count2,startIndex,endIndex)=>startIndex===null||endIndex===null?[]:rangeExtractor({startIndex:startIndex,endIndex:endIndex,overscan:overscan,count:count2})),{key:false,debug:()=>this.options.debug});this.indexFromElement=node=>{const attributeName=this.options.indexAttribute;const indexStr=node.getAttribute(attributeName);if(!indexStr){console.warn(`Missing attribute name '${attributeName}={index}' on measured element.`);return-1}return parseInt(indexStr,10)};this._measureElement=(node,entry)=>{const index=this.indexFromElement(node);const item=this.measurementsCache[index];if(!item){return}const key=item.key;const prevNode=this.elementsCache.get(key);if(prevNode!==node){if(prevNode){this.observer.unobserve(prevNode)}this.observer.observe(node);this.elementsCache.set(key,node)}if(node.isConnected){this.resizeItem(index,this.options.measureElement(node,entry,this))}};this.resizeItem=(index,size)=>{const item=this.measurementsCache[index];if(!item){return}const itemSize=this.itemSizeCache.get(item.key)??item.size;const delta=size-itemSize;if(delta!==0){if(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(item,delta,this):item.start<this.getScrollOffset()+this.scrollAdjustments){this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=delta,behavior:void 0})}this.pendingMeasuredCacheIndexes.push(item.index);this.itemSizeCache=new Map(this.itemSizeCache.set(item.key,size));this.notify(false)}};this.measureElement=node=>{if(!node){this.elementsCache.forEach(((cached,key)=>{if(!cached.isConnected){this.observer.unobserve(cached);this.elementsCache.delete(key)}}));return}this._measureElement(node,void 0)};this.getVirtualItems=memo$1((()=>[this.getVirtualIndexes(),this.getMeasurements()]),((indexes,measurements)=>{const virtualItems=[];for(let k=0,len=indexes.length;k<len;k++){const i=indexes[k];const measurement=measurements[i];virtualItems.push(measurement)}return virtualItems}),{key:false,debug:()=>this.options.debug});this.getVirtualItemForOffset=offset=>{const measurements=this.getMeasurements();if(measurements.length===0){return void 0}return notUndefined(measurements[findNearestBinarySearch(0,measurements.length-1,(index=>notUndefined(measurements[index]).start),offset)])};this.getOffsetForAlignment=(toOffset,align)=>{const size=this.getSize();const scrollOffset=this.getScrollOffset();if(align==="auto"){if(toOffset>=scrollOffset+size){align="end"}}if(align==="end"){toOffset-=size}const scrollSizeProp=this.options.horizontal?"scrollWidth":"scrollHeight";const scrollSize=this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[scrollSizeProp]:this.scrollElement[scrollSizeProp]:0;const maxOffset=scrollSize-size;return Math.max(Math.min(maxOffset,toOffset),0)};this.getOffsetForIndex=(index,align="auto")=>{index=Math.max(0,Math.min(index,this.options.count-1));const item=this.measurementsCache[index];if(!item){return void 0}const size=this.getSize();const scrollOffset=this.getScrollOffset();if(align==="auto"){if(item.end>=scrollOffset+size-this.options.scrollPaddingEnd){align="end"}else if(item.start<=scrollOffset+this.options.scrollPaddingStart){align="start"}else{return[scrollOffset,align]}}const centerOffset=item.start-this.options.scrollPaddingStart+(item.size-size)/2;switch(align){case"center":return[this.getOffsetForAlignment(centerOffset,align),align];case"end":return[this.getOffsetForAlignment(item.end+this.options.scrollPaddingEnd,align),align];default:return[this.getOffsetForAlignment(item.start-this.options.scrollPaddingStart,align),align]}};this.isDynamicMode=()=>this.elementsCache.size>0;this.cancelScrollToIndex=()=>{if(this.scrollToIndexTimeoutId!==null&&this.targetWindow){this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId);this.scrollToIndexTimeoutId=null}};this.scrollToOffset=(toOffset,{align:align="start",behavior:behavior}={})=>{this.cancelScrollToIndex();if(behavior==="smooth"&&this.isDynamicMode()){console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.")}this._scrollToOffset(this.getOffsetForAlignment(toOffset,align),{adjustments:void 0,behavior:behavior})};this.scrollToIndex=(index,{align:initialAlign="auto",behavior:behavior}={})=>{index=Math.max(0,Math.min(index,this.options.count-1));this.cancelScrollToIndex();if(behavior==="smooth"&&this.isDynamicMode()){console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.")}const offsetAndAlign=this.getOffsetForIndex(index,initialAlign);if(!offsetAndAlign)return;const[offset,align]=offsetAndAlign;this._scrollToOffset(offset,{adjustments:void 0,behavior:behavior});if(behavior!=="smooth"&&this.isDynamicMode()&&this.targetWindow){this.scrollToIndexTimeoutId=this.targetWindow.setTimeout((()=>{this.scrollToIndexTimeoutId=null;const elementInDOM=this.elementsCache.has(this.options.getItemKey(index));if(elementInDOM){const[latestOffset]=notUndefined(this.getOffsetForIndex(index,align));if(!approxEqual(latestOffset,this.getScrollOffset())){this.scrollToIndex(index,{align:align,behavior:behavior})}}else{this.scrollToIndex(index,{align:align,behavior:behavior})}}))}};this.scrollBy=(delta,{behavior:behavior}={})=>{this.cancelScrollToIndex();if(behavior==="smooth"&&this.isDynamicMode()){console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.")}this._scrollToOffset(this.getScrollOffset()+delta,{adjustments:void 0,behavior:behavior})};this.getTotalSize=()=>{var _a;const measurements=this.getMeasurements();let end;if(measurements.length===0){end=this.options.paddingStart}else{end=this.options.lanes===1?((_a=measurements[measurements.length-1])==null?void 0:_a.end)??0:Math.max(...measurements.slice(-this.options.lanes).map((m=>m.end)))}return Math.max(end-this.options.scrollMargin+this.options.paddingEnd,0)};this._scrollToOffset=(offset,{adjustments:adjustments,behavior:behavior})=>{this.options.scrollToFn(offset,{behavior:behavior,adjustments:adjustments},this)};this.measure=()=>{this.itemSizeCache=new Map;this.notify(false)};this.setOptions(opts)}}const findNearestBinarySearch=(low,high,getCurrentValue,value)=>{while(low<=high){const middle=(low+high)/2|0;const currentValue=getCurrentValue(middle);if(currentValue<value){low=middle+1}else if(currentValue>value){high=middle-1}else{return middle}}if(low>0){return low-1}else{return 0}};function calculateRange({measurements:measurements,outerSize:outerSize,scrollOffset:scrollOffset}){const count2=measurements.length-1;const getOffset=index=>measurements[index].start;const startIndex=findNearestBinarySearch(0,count2,getOffset,scrollOffset);let endIndex=startIndex;while(endIndex<count2&&measurements[endIndex].end<scrollOffset+outerSize){endIndex++}return{startIndex:startIndex,endIndex:endIndex}}const useIsomorphicLayoutEffect=typeof document!=="undefined"?React.useLayoutEffect:React.useEffect;function useVirtualizerBase(options){const rerender=React.useReducer((()=>({})),{})[1];const resolvedOptions={...options,onChange:(instance2,sync)=>{var _a;if(sync){flushSync(rerender)}else{rerender()}(_a=options.onChange)==null?void 0:_a.call(options,instance2,sync)}};const[instance]=React.useState((()=>new Virtualizer(resolvedOptions)));instance.setOptions(resolvedOptions);useIsomorphicLayoutEffect((()=>instance._didMount()),[]);useIsomorphicLayoutEffect((()=>instance._willUpdate()));return instance}function useVirtualizer(options){return useVirtualizerBase({observeElementRect:observeElementRect,observeElementOffset:observeElementOffset,scrollToFn:elementScroll,...options})}const getVirtualizedContainerStyles=maxHeight=>{let heightValue="600px";if(maxHeight){switch(maxHeight){case"xs":heightValue="200px";break;case"sm":heightValue="300px";break;case"md":heightValue="400px";break;case"lg":heightValue="500px";break;case"xl":heightValue="600px";break;case"xxl":heightValue="700px";break;case"xxxl":heightValue="800px";break;default:if(maxHeight!=="auto"){heightValue=maxHeight}}}return{overflow:"auto",position:"relative",height:heightValue,width:"100%"}};const getVirtualizedRowStyle=startPosition=>({position:"absolute",top:0,left:0,height:"40px",transform:`translateY(${startPosition}px)`,tableLayout:"fixed"});const getRowHeightEstimate=rowType=>{switch(rowType){case"header":return 40;case"loading":return 30;case"footer":return 40;case"row":default:return 40}};const AdvancedTableContext=createContext({});const AdvancedTableProvider=({children:children,...props})=>{var _a;const tableContainerRef=useRef(null);const containerRef=props.tableContainerRef||tableContainerRef;const table=props.table;const isVirtualized=props.virtualizedRows||props.enableVirtualization;const headerRef=useRef(null);const sampleRowRef=useRef(null);const[headerHeight,setHeaderHeight]=useState(44);const[rowHeight,setRowHeight]=useState(38);const[actionBarHeight,setActionBarHeight]=useState(0);const measureHeights=useCallback((()=>{var _a2;const wrapper=((_a2=props.tableContainerRef)==null?void 0:_a2.current)||tableContainerRef.current;if(headerRef.current){const headerElement=headerRef.current;const headerRect=headerElement.getBoundingClientRect();if(headerRect.height>0){setHeaderHeight(headerRect.height)}}if(sampleRowRef.current){const rowRect=sampleRowRef.current.getBoundingClientRect();if(rowRect.height>0){setRowHeight(rowRect.height)}}if(wrapper){const actionBar=wrapper.querySelector(".row-selection-actions-card.is-visible, .row-selection-actions-card.show-action-card");const measuredActionBarHeight=actionBar?measureElementHeight(actionBar):0;setActionBarHeight(measuredActionBarHeight);wrapper.style.setProperty("--advanced-table-action-bar-height",`${measuredActionBarHeight}px`)}}),[props.tableContainerRef]);useEffect((()=>{var _a2;const resizeObserver=new ResizeObserver((()=>{measureHeights()}));if(headerRef.current){resizeObserver.observe(headerRef.current)}const wrapper=((_a2=props.tableContainerRef)==null?void 0:_a2.current)||tableContainerRef.current;const actionBar=wrapper==null?void 0:wrapper.querySelector(".row-selection-actions-card");if(actionBar){resizeObserver.observe(actionBar)}if(sampleRowRef.current){resizeObserver.observe(sampleRowRef.current)}const timeoutId=setTimeout(measureHeights,100);return()=>{resizeObserver.disconnect();clearTimeout(timeoutId)}}),[measureHeights]);const headerGroupCount=((_a=table==null?void 0:table.getHeaderGroups())==null?void 0:_a.length)??0;useEffect((()=>{measureHeights()}),[table==null?void 0:table.getRowModel().rows.length,headerGroupCount,props.isActionBarVisible,measureHeights]);const flattenedItems=useMemo((()=>{if(!isVirtualized||!table){return[]}const tableRows=table.getRowModel().rows;const items=[];const subRowHeaders=props.subRowHeaders;const inlineRowLoading=props.inlineRowLoading;const columnDefinitions=props.columnDefinitions;tableRows.forEach(((row,index)=>{var _a2,_b,_c;const isFirstChildofSubrow=row.depth>0&&row.index===0;if(isFirstChildofSubrow&&subRowHeaders){items.push({type:"header",row:row,id:`header-${row.id}-${index}`})}items.push({type:"row",row:row,id:`row-${row.id}-${index}`});const isExpandable=row.getIsExpanded();const rowHasNoChildren=((_a2=row.original)==null?void 0:_a2.children)&&!row.original.children.length?true:false;const isDataLoading=isExpandable&&(inlineRowLoading&&rowHasNoChildren)&&row.depth<(((_c=(_b=columnDefinitions[0])==null?void 0:_b.cellAccessors)==null?void 0:_c.length)||0);if(isDataLoading){items.push({type:"loading",row:row,id:`loading-${row.id}-${index}`})}}));const isFetching=props.isFetching||false;const shouldAddFooter=table&&!isFetching&&tableRows.length>0;if(shouldAddFooter){items.push({type:"footer",row:{},id:`footer-row`})}return items}),[isVirtualized,table,props.subRowHeaders,props.inlineRowLoading,props.columnDefinitions,table==null?void 0:table.getRowModel().rows.length,JSON.stringify((table==null?void 0:table.getState().sorting)||[]),JSON.stringify((table==null?void 0:table.getState().expanded)||{})]);const virtualizer=useVirtualizer({count:isVirtualized&&flattenedItems.length>0?flattenedItems.length:0,getScrollElement:()=>containerRef.current,estimateSize:index=>{if(!isVirtualized||flattenedItems.length===0)return 0;const item=flattenedItems[index];if(!item)return getRowHeightEstimate("row");return getRowHeightEstimate(item.type)},overscan:10,getItemKey:index=>{var _a2;if(!isVirtualized||flattenedItems.length===0||index>=flattenedItems.length){return`item-${index}`}return((_a2=flattenedItems[index])==null?void 0:_a2.id)||`item-${index}`}});useEffect((()=>{if(isVirtualized&&virtualizer&&table&&containerRef.current){virtualizer.setOptions({...virtualizer.options,count:flattenedItems.length});virtualizer.measure()}}),[isVirtualized,virtualizer,table,containerRef,JSON.stringify((table==null?void 0:table.getState().sorting)||[]),JSON.stringify((table==null?void 0:table.getState().expanded)||{}),flattenedItems.length]);const contextValue={...props,table:table,tableContainerRef:containerRef,virtualizer:isVirtualized?virtualizer:null,flattenedItems:flattenedItems,virtualizedRows:isVirtualized,enableVirtualization:isVirtualized,rowPinning:props.rowPinning,setRowPinning:props.setRowPinning,keepPinnedRows:props.keepPinnedRows,headerHeight:headerHeight,rowHeight:rowHeight,actionBarHeight:actionBarHeight,headerRef:headerRef,sampleRowRef:sampleRowRef,measureHeights:measureHeights};return jsx(AdvancedTableContext.Provider,{value:contextValue,children:children})};
1
+ import{jsx,jsxs,Fragment}from"react/jsx-runtime";import*as React from"react";import React__default,{createContext,useRef,useState,useCallback,useEffect,useMemo,useContext,useLayoutEffect}from"react";import{d as classnames,e as buildCss,g as globalProps,b as buildAriaProps,a as buildDataProps,c as buildHtmlProps}from"./chunks/globalProps-BivjwRew.js";import{C as Checkbox,P as PbReactPopover,S as SectionSeparator,L as LoadingInline,a as Pagination,F as FlexItem,T as Table}from"./chunks/_pagination-CARbC_IN.js";import{flushSync}from"react-dom";import{m as measureElementHeight,s as scheduleStickyActionBarHeightUpdate,b as updateStickyLayoutHeights}from"./chunks/StickyLayoutHelper-DCzCcWUN.js";import{I as Icon,F as Flex,C as Caption,D as Detail,a as Card,T as Tooltip}from"./chunks/_tooltip-UkcgcThO.js";import"./chunks/lib-C50eCpoN.js";import"./chunks/quickpickDateSync-DLDx4zce.js";function memo$1(getDeps,fn,opts){let deps=opts.initialDeps??[];let result;return()=>{var _a,_b,_c,_d;let depTime;if(opts.key&&((_a=opts.debug)==null?void 0:_a.call(opts)))depTime=Date.now();const newDeps=getDeps();const depsChanged=newDeps.length!==deps.length||newDeps.some(((dep,index)=>deps[index]!==dep));if(!depsChanged){return result}deps=newDeps;let resultTime;if(opts.key&&((_b=opts.debug)==null?void 0:_b.call(opts)))resultTime=Date.now();result=fn(...newDeps);if(opts.key&&((_c=opts.debug)==null?void 0:_c.call(opts))){const depEndTime=Math.round((Date.now()-depTime)*100)/100;const resultEndTime=Math.round((Date.now()-resultTime)*100)/100;const resultFpsPercentage=resultEndTime/16;const pad=(str,num)=>{str=String(str);while(str.length<num){str=" "+str}return str};console.info(`%c⏱ ${pad(resultEndTime,5)} /${pad(depEndTime,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*resultFpsPercentage,120))}deg 100% 31%);`,opts==null?void 0:opts.key)}(_d=opts==null?void 0:opts.onChange)==null?void 0:_d.call(opts,result);return result}}function notUndefined(value,msg){if(value===void 0){throw new Error(`Unexpected undefined${""}`)}else{return value}}const approxEqual=(a,b)=>Math.abs(a-b)<1;const debounce=(targetWindow,fn,ms)=>{let timeoutId;return function(...args){targetWindow.clearTimeout(timeoutId);timeoutId=targetWindow.setTimeout((()=>fn.apply(this,args)),ms)}};const defaultKeyExtractor=index=>index;const defaultRangeExtractor=range=>{const start=Math.max(range.startIndex-range.overscan,0);const end=Math.min(range.endIndex+range.overscan,range.count-1);const arr=[];for(let i=start;i<=end;i++){arr.push(i)}return arr};const observeElementRect=(instance,cb)=>{const element=instance.scrollElement;if(!element){return}const targetWindow=instance.targetWindow;if(!targetWindow){return}const handler=rect=>{const{width:width,height:height}=rect;cb({width:Math.round(width),height:Math.round(height)})};handler(element.getBoundingClientRect());if(!targetWindow.ResizeObserver){return()=>{}}const observer=new targetWindow.ResizeObserver((entries=>{const run=()=>{const entry=entries[0];if(entry==null?void 0:entry.borderBoxSize){const box=entry.borderBoxSize[0];if(box){handler({width:box.inlineSize,height:box.blockSize});return}}handler(element.getBoundingClientRect())};instance.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(run):run()}));observer.observe(element,{box:"border-box"});return()=>{observer.unobserve(element)}};const addEventListenerOptions={passive:true};const supportsScrollend=typeof window=="undefined"?true:"onscrollend"in window;const observeElementOffset=(instance,cb)=>{const element=instance.scrollElement;if(!element){return}const targetWindow=instance.targetWindow;if(!targetWindow){return}let offset=0;const fallback=instance.options.useScrollendEvent&&supportsScrollend?()=>void 0:debounce(targetWindow,(()=>{cb(offset,false)}),instance.options.isScrollingResetDelay);const createHandler=isScrolling=>()=>{const{horizontal:horizontal,isRtl:isRtl}=instance.options;offset=horizontal?element["scrollLeft"]*(isRtl&&-1||1):element["scrollTop"];fallback();cb(offset,isScrolling)};const handler=createHandler(true);const endHandler=createHandler(false);endHandler();element.addEventListener("scroll",handler,addEventListenerOptions);const registerScrollendEvent=instance.options.useScrollendEvent&&supportsScrollend;if(registerScrollendEvent){element.addEventListener("scrollend",endHandler,addEventListenerOptions)}return()=>{element.removeEventListener("scroll",handler);if(registerScrollendEvent){element.removeEventListener("scrollend",endHandler)}}};const measureElement=(element,entry,instance)=>{if(entry==null?void 0:entry.borderBoxSize){const box=entry.borderBoxSize[0];if(box){const size=Math.round(box[instance.options.horizontal?"inlineSize":"blockSize"]);return size}}return Math.round(element.getBoundingClientRect()[instance.options.horizontal?"width":"height"])};const elementScroll=(offset,{adjustments:adjustments=0,behavior:behavior},instance)=>{var _a,_b;const toOffset=offset+adjustments;(_b=(_a=instance.scrollElement)==null?void 0:_a.scrollTo)==null?void 0:_b.call(_a,{[instance.options.horizontal?"left":"top"]:toOffset,behavior:behavior})};class Virtualizer{constructor(opts){this.unsubs=[];this.scrollElement=null;this.targetWindow=null;this.isScrolling=false;this.scrollToIndexTimeoutId=null;this.measurementsCache=[];this.itemSizeCache=new Map;this.pendingMeasuredCacheIndexes=[];this.scrollRect=null;this.scrollOffset=null;this.scrollDirection=null;this.scrollAdjustments=0;this.elementsCache=new Map;this.observer=(()=>{let _ro=null;const get=()=>{if(_ro){return _ro}if(!this.targetWindow||!this.targetWindow.ResizeObserver){return null}return _ro=new this.targetWindow.ResizeObserver((entries=>{entries.forEach((entry=>{const run=()=>{this._measureElement(entry.target,entry)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(run):run()}))}))};return{disconnect:()=>{var _a;(_a=get())==null?void 0:_a.disconnect();_ro=null},observe:target=>{var _a;return(_a=get())==null?void 0:_a.observe(target,{box:"border-box"})},unobserve:target=>{var _a;return(_a=get())==null?void 0:_a.unobserve(target)}}})();this.range=null;this.setOptions=opts2=>{Object.entries(opts2).forEach((([key,value])=>{if(typeof value==="undefined")delete opts2[key]}));this.options={debug:false,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:false,getItemKey:defaultKeyExtractor,rangeExtractor:defaultRangeExtractor,onChange:()=>{},measureElement:measureElement,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:true,isRtl:false,useScrollendEvent:true,useAnimationFrameWithResizeObserver:false,...opts2}};this.notify=sync=>{var _a,_b;(_b=(_a=this.options).onChange)==null?void 0:_b.call(_a,this,sync)};this.maybeNotify=memo$1((()=>{this.calculateRange();return[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),(isScrolling=>{this.notify(isScrolling)}),{key:false,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]});this.cleanup=()=>{this.unsubs.filter(Boolean).forEach((d=>d()));this.unsubs=[];this.observer.disconnect();this.scrollElement=null;this.targetWindow=null};this._didMount=()=>()=>{this.cleanup()};this._willUpdate=()=>{var _a;const scrollElement=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==scrollElement){this.cleanup();if(!scrollElement){this.maybeNotify();return}this.scrollElement=scrollElement;if(this.scrollElement&&"ownerDocument"in this.scrollElement){this.targetWindow=this.scrollElement.ownerDocument.defaultView}else{this.targetWindow=((_a=this.scrollElement)==null?void 0:_a.window)??null}this.elementsCache.forEach((cached=>{this.observer.observe(cached)}));this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0});this.unsubs.push(this.options.observeElementRect(this,(rect=>{this.scrollRect=rect;this.maybeNotify()})));this.unsubs.push(this.options.observeElementOffset(this,((offset,isScrolling)=>{this.scrollAdjustments=0;this.scrollDirection=isScrolling?this.getScrollOffset()<offset?"forward":"backward":null;this.scrollOffset=offset;this.isScrolling=isScrolling;this.maybeNotify()})))}};this.getSize=()=>{if(!this.options.enabled){this.scrollRect=null;return 0}this.scrollRect=this.scrollRect??this.options.initialRect;return this.scrollRect[this.options.horizontal?"width":"height"]};this.getScrollOffset=()=>{if(!this.options.enabled){this.scrollOffset=null;return 0}this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==="function"?this.options.initialOffset():this.options.initialOffset);return this.scrollOffset};this.getFurthestMeasurement=(measurements,index)=>{const furthestMeasurementsFound=new Map;const furthestMeasurements=new Map;for(let m=index-1;m>=0;m--){const measurement=measurements[m];if(furthestMeasurementsFound.has(measurement.lane)){continue}const previousFurthestMeasurement=furthestMeasurements.get(measurement.lane);if(previousFurthestMeasurement==null||measurement.end>previousFurthestMeasurement.end){furthestMeasurements.set(measurement.lane,measurement)}else if(measurement.end<previousFurthestMeasurement.end){furthestMeasurementsFound.set(measurement.lane,true)}if(furthestMeasurementsFound.size===this.options.lanes){break}}return furthestMeasurements.size===this.options.lanes?Array.from(furthestMeasurements.values()).sort(((a,b)=>{if(a.end===b.end){return a.index-b.index}return a.end-b.end}))[0]:void 0};this.getMeasurementOptions=memo$1((()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled]),((count2,paddingStart,scrollMargin,getItemKey,enabled)=>{this.pendingMeasuredCacheIndexes=[];return{count:count2,paddingStart:paddingStart,scrollMargin:scrollMargin,getItemKey:getItemKey,enabled:enabled}}),{key:false});this.getMeasurements=memo$1((()=>[this.getMeasurementOptions(),this.itemSizeCache]),(({count:count2,paddingStart:paddingStart,scrollMargin:scrollMargin,getItemKey:getItemKey,enabled:enabled},itemSizeCache)=>{if(!enabled){this.measurementsCache=[];this.itemSizeCache.clear();return[]}if(this.measurementsCache.length===0){this.measurementsCache=this.options.initialMeasurementsCache;this.measurementsCache.forEach((item=>{this.itemSizeCache.set(item.key,item.size)}))}const min2=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const measurements=this.measurementsCache.slice(0,min2);for(let i=min2;i<count2;i++){const key=getItemKey(i);const furthestMeasurement=this.options.lanes===1?measurements[i-1]:this.getFurthestMeasurement(measurements,i);const start=furthestMeasurement?furthestMeasurement.end+this.options.gap:paddingStart+scrollMargin;const measuredSize=itemSizeCache.get(key);const size=typeof measuredSize==="number"?measuredSize:this.options.estimateSize(i);const end=start+size;const lane=furthestMeasurement?furthestMeasurement.lane:i%this.options.lanes;measurements[i]={index:i,start:start,size:size,end:end,key:key,lane:lane}}this.measurementsCache=measurements;return measurements}),{key:false,debug:()=>this.options.debug});this.calculateRange=memo$1((()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()]),((measurements,outerSize,scrollOffset)=>this.range=measurements.length>0&&outerSize>0?calculateRange({measurements:measurements,outerSize:outerSize,scrollOffset:scrollOffset}):null),{key:false,debug:()=>this.options.debug});this.getVirtualIndexes=memo$1((()=>{let startIndex=null;let endIndex=null;const range=this.calculateRange();if(range){startIndex=range.startIndex;endIndex=range.endIndex}return[this.options.rangeExtractor,this.options.overscan,this.options.count,startIndex,endIndex]}),((rangeExtractor,overscan,count2,startIndex,endIndex)=>startIndex===null||endIndex===null?[]:rangeExtractor({startIndex:startIndex,endIndex:endIndex,overscan:overscan,count:count2})),{key:false,debug:()=>this.options.debug});this.indexFromElement=node=>{const attributeName=this.options.indexAttribute;const indexStr=node.getAttribute(attributeName);if(!indexStr){console.warn(`Missing attribute name '${attributeName}={index}' on measured element.`);return-1}return parseInt(indexStr,10)};this._measureElement=(node,entry)=>{const index=this.indexFromElement(node);const item=this.measurementsCache[index];if(!item){return}const key=item.key;const prevNode=this.elementsCache.get(key);if(prevNode!==node){if(prevNode){this.observer.unobserve(prevNode)}this.observer.observe(node);this.elementsCache.set(key,node)}if(node.isConnected){this.resizeItem(index,this.options.measureElement(node,entry,this))}};this.resizeItem=(index,size)=>{const item=this.measurementsCache[index];if(!item){return}const itemSize=this.itemSizeCache.get(item.key)??item.size;const delta=size-itemSize;if(delta!==0){if(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(item,delta,this):item.start<this.getScrollOffset()+this.scrollAdjustments){this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=delta,behavior:void 0})}this.pendingMeasuredCacheIndexes.push(item.index);this.itemSizeCache=new Map(this.itemSizeCache.set(item.key,size));this.notify(false)}};this.measureElement=node=>{if(!node){this.elementsCache.forEach(((cached,key)=>{if(!cached.isConnected){this.observer.unobserve(cached);this.elementsCache.delete(key)}}));return}this._measureElement(node,void 0)};this.getVirtualItems=memo$1((()=>[this.getVirtualIndexes(),this.getMeasurements()]),((indexes,measurements)=>{const virtualItems=[];for(let k=0,len=indexes.length;k<len;k++){const i=indexes[k];const measurement=measurements[i];virtualItems.push(measurement)}return virtualItems}),{key:false,debug:()=>this.options.debug});this.getVirtualItemForOffset=offset=>{const measurements=this.getMeasurements();if(measurements.length===0){return void 0}return notUndefined(measurements[findNearestBinarySearch(0,measurements.length-1,(index=>notUndefined(measurements[index]).start),offset)])};this.getOffsetForAlignment=(toOffset,align)=>{const size=this.getSize();const scrollOffset=this.getScrollOffset();if(align==="auto"){if(toOffset>=scrollOffset+size){align="end"}}if(align==="end"){toOffset-=size}const scrollSizeProp=this.options.horizontal?"scrollWidth":"scrollHeight";const scrollSize=this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[scrollSizeProp]:this.scrollElement[scrollSizeProp]:0;const maxOffset=scrollSize-size;return Math.max(Math.min(maxOffset,toOffset),0)};this.getOffsetForIndex=(index,align="auto")=>{index=Math.max(0,Math.min(index,this.options.count-1));const item=this.measurementsCache[index];if(!item){return void 0}const size=this.getSize();const scrollOffset=this.getScrollOffset();if(align==="auto"){if(item.end>=scrollOffset+size-this.options.scrollPaddingEnd){align="end"}else if(item.start<=scrollOffset+this.options.scrollPaddingStart){align="start"}else{return[scrollOffset,align]}}const centerOffset=item.start-this.options.scrollPaddingStart+(item.size-size)/2;switch(align){case"center":return[this.getOffsetForAlignment(centerOffset,align),align];case"end":return[this.getOffsetForAlignment(item.end+this.options.scrollPaddingEnd,align),align];default:return[this.getOffsetForAlignment(item.start-this.options.scrollPaddingStart,align),align]}};this.isDynamicMode=()=>this.elementsCache.size>0;this.cancelScrollToIndex=()=>{if(this.scrollToIndexTimeoutId!==null&&this.targetWindow){this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId);this.scrollToIndexTimeoutId=null}};this.scrollToOffset=(toOffset,{align:align="start",behavior:behavior}={})=>{this.cancelScrollToIndex();if(behavior==="smooth"&&this.isDynamicMode()){console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.")}this._scrollToOffset(this.getOffsetForAlignment(toOffset,align),{adjustments:void 0,behavior:behavior})};this.scrollToIndex=(index,{align:initialAlign="auto",behavior:behavior}={})=>{index=Math.max(0,Math.min(index,this.options.count-1));this.cancelScrollToIndex();if(behavior==="smooth"&&this.isDynamicMode()){console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.")}const offsetAndAlign=this.getOffsetForIndex(index,initialAlign);if(!offsetAndAlign)return;const[offset,align]=offsetAndAlign;this._scrollToOffset(offset,{adjustments:void 0,behavior:behavior});if(behavior!=="smooth"&&this.isDynamicMode()&&this.targetWindow){this.scrollToIndexTimeoutId=this.targetWindow.setTimeout((()=>{this.scrollToIndexTimeoutId=null;const elementInDOM=this.elementsCache.has(this.options.getItemKey(index));if(elementInDOM){const[latestOffset]=notUndefined(this.getOffsetForIndex(index,align));if(!approxEqual(latestOffset,this.getScrollOffset())){this.scrollToIndex(index,{align:align,behavior:behavior})}}else{this.scrollToIndex(index,{align:align,behavior:behavior})}}))}};this.scrollBy=(delta,{behavior:behavior}={})=>{this.cancelScrollToIndex();if(behavior==="smooth"&&this.isDynamicMode()){console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.")}this._scrollToOffset(this.getScrollOffset()+delta,{adjustments:void 0,behavior:behavior})};this.getTotalSize=()=>{var _a;const measurements=this.getMeasurements();let end;if(measurements.length===0){end=this.options.paddingStart}else{end=this.options.lanes===1?((_a=measurements[measurements.length-1])==null?void 0:_a.end)??0:Math.max(...measurements.slice(-this.options.lanes).map((m=>m.end)))}return Math.max(end-this.options.scrollMargin+this.options.paddingEnd,0)};this._scrollToOffset=(offset,{adjustments:adjustments,behavior:behavior})=>{this.options.scrollToFn(offset,{behavior:behavior,adjustments:adjustments},this)};this.measure=()=>{this.itemSizeCache=new Map;this.notify(false)};this.setOptions(opts)}}const findNearestBinarySearch=(low,high,getCurrentValue,value)=>{while(low<=high){const middle=(low+high)/2|0;const currentValue=getCurrentValue(middle);if(currentValue<value){low=middle+1}else if(currentValue>value){high=middle-1}else{return middle}}if(low>0){return low-1}else{return 0}};function calculateRange({measurements:measurements,outerSize:outerSize,scrollOffset:scrollOffset}){const count2=measurements.length-1;const getOffset=index=>measurements[index].start;const startIndex=findNearestBinarySearch(0,count2,getOffset,scrollOffset);let endIndex=startIndex;while(endIndex<count2&&measurements[endIndex].end<scrollOffset+outerSize){endIndex++}return{startIndex:startIndex,endIndex:endIndex}}const useIsomorphicLayoutEffect=typeof document!=="undefined"?React.useLayoutEffect:React.useEffect;function useVirtualizerBase(options){const rerender=React.useReducer((()=>({})),{})[1];const resolvedOptions={...options,onChange:(instance2,sync)=>{var _a;if(sync){flushSync(rerender)}else{rerender()}(_a=options.onChange)==null?void 0:_a.call(options,instance2,sync)}};const[instance]=React.useState((()=>new Virtualizer(resolvedOptions)));instance.setOptions(resolvedOptions);useIsomorphicLayoutEffect((()=>instance._didMount()),[]);useIsomorphicLayoutEffect((()=>instance._willUpdate()));return instance}function useVirtualizer(options){return useVirtualizerBase({observeElementRect:observeElementRect,observeElementOffset:observeElementOffset,scrollToFn:elementScroll,...options})}const getVirtualizedContainerStyles=maxHeight=>{let heightValue="600px";if(maxHeight){switch(maxHeight){case"xs":heightValue="200px";break;case"sm":heightValue="300px";break;case"md":heightValue="400px";break;case"lg":heightValue="500px";break;case"xl":heightValue="600px";break;case"xxl":heightValue="700px";break;case"xxxl":heightValue="800px";break;default:if(maxHeight!=="auto"){heightValue=maxHeight}}}return{overflow:"auto",position:"relative",height:heightValue,width:"100%"}};const getVirtualizedRowStyle=startPosition=>({position:"absolute",top:0,left:0,height:"40px",transform:`translateY(${startPosition}px)`,tableLayout:"fixed"});const getRowHeightEstimate=rowType=>{switch(rowType){case"header":return 40;case"loading":return 30;case"footer":return 40;case"row":default:return 40}};const AdvancedTableContext=createContext({});const AdvancedTableProvider=({children:children,...props})=>{var _a;const tableContainerRef=useRef(null);const containerRef=props.tableContainerRef||tableContainerRef;const table=props.table;const isVirtualized=props.virtualizedRows||props.enableVirtualization;const headerRef=useRef(null);const sampleRowRef=useRef(null);const[headerHeight,setHeaderHeight]=useState(44);const[rowHeight,setRowHeight]=useState(38);const[actionBarHeight,setActionBarHeight]=useState(0);const measureHeights=useCallback((()=>{var _a2;const wrapper=((_a2=props.tableContainerRef)==null?void 0:_a2.current)||tableContainerRef.current;if(headerRef.current){const headerElement=headerRef.current;const headerRect=headerElement.getBoundingClientRect();if(headerRect.height>0){setHeaderHeight(headerRect.height)}}if(sampleRowRef.current){const rowRect=sampleRowRef.current.getBoundingClientRect();if(rowRect.height>0){setRowHeight(rowRect.height)}}if(wrapper){const actionBar=wrapper.querySelector(".row-selection-actions-card.is-visible, .row-selection-actions-card.show-action-card");const measuredActionBarHeight=actionBar?measureElementHeight(actionBar):0;setActionBarHeight(measuredActionBarHeight);wrapper.style.setProperty("--advanced-table-action-bar-height",`${measuredActionBarHeight}px`)}}),[props.tableContainerRef]);useEffect((()=>{var _a2;const resizeObserver=new ResizeObserver((()=>{measureHeights()}));if(headerRef.current){resizeObserver.observe(headerRef.current)}const wrapper=((_a2=props.tableContainerRef)==null?void 0:_a2.current)||tableContainerRef.current;const actionBar=wrapper==null?void 0:wrapper.querySelector(".row-selection-actions-card");if(actionBar){resizeObserver.observe(actionBar)}if(sampleRowRef.current){resizeObserver.observe(sampleRowRef.current)}const timeoutId=setTimeout(measureHeights,100);return()=>{resizeObserver.disconnect();clearTimeout(timeoutId)}}),[measureHeights]);const headerGroupCount=((_a=table==null?void 0:table.getHeaderGroups())==null?void 0:_a.length)??0;useEffect((()=>{measureHeights()}),[table==null?void 0:table.getRowModel().rows.length,headerGroupCount,props.isActionBarVisible,measureHeights]);const flattenedItems=useMemo((()=>{if(!isVirtualized||!table){return[]}const tableRows=table.getRowModel().rows;const items=[];const subRowHeaders=props.subRowHeaders;const inlineRowLoading=props.inlineRowLoading;const columnDefinitions=props.columnDefinitions;tableRows.forEach(((row,index)=>{var _a2,_b,_c;const isFirstChildofSubrow=row.depth>0&&row.index===0;if(isFirstChildofSubrow&&subRowHeaders){items.push({type:"header",row:row,id:`header-${row.id}-${index}`})}items.push({type:"row",row:row,id:`row-${row.id}-${index}`});const isExpandable=row.getIsExpanded();const rowHasNoChildren=((_a2=row.original)==null?void 0:_a2.children)&&!row.original.children.length?true:false;const isDataLoading=isExpandable&&(inlineRowLoading&&rowHasNoChildren)&&row.depth<(((_c=(_b=columnDefinitions[0])==null?void 0:_b.cellAccessors)==null?void 0:_c.length)||0);if(isDataLoading){items.push({type:"loading",row:row,id:`loading-${row.id}-${index}`})}}));const isFetching=props.isFetching||false;const shouldAddFooter=table&&!isFetching&&tableRows.length>0;if(shouldAddFooter){items.push({type:"footer",row:{},id:`footer-row`})}return items}),[isVirtualized,table,props.subRowHeaders,props.inlineRowLoading,props.columnDefinitions,table==null?void 0:table.getRowModel().rows.length,JSON.stringify((table==null?void 0:table.getState().sorting)||[]),JSON.stringify((table==null?void 0:table.getState().expanded)||{})]);const virtualizer=useVirtualizer({count:isVirtualized&&flattenedItems.length>0?flattenedItems.length:0,getScrollElement:()=>containerRef.current,estimateSize:index=>{if(!isVirtualized||flattenedItems.length===0)return 0;const item=flattenedItems[index];if(!item)return getRowHeightEstimate("row");return getRowHeightEstimate(item.type)},overscan:10,getItemKey:index=>{var _a2;if(!isVirtualized||flattenedItems.length===0||index>=flattenedItems.length){return`item-${index}`}return((_a2=flattenedItems[index])==null?void 0:_a2.id)||`item-${index}`}});useEffect((()=>{if(isVirtualized&&virtualizer&&table&&containerRef.current){virtualizer.setOptions({...virtualizer.options,count:flattenedItems.length});virtualizer.measure()}}),[isVirtualized,virtualizer,table,containerRef,JSON.stringify((table==null?void 0:table.getState().sorting)||[]),JSON.stringify((table==null?void 0:table.getState().expanded)||{}),flattenedItems.length]);const contextValue={...props,table:table,tableContainerRef:containerRef,virtualizer:isVirtualized?virtualizer:null,flattenedItems:flattenedItems,virtualizedRows:isVirtualized,enableVirtualization:isVirtualized,rowPinning:props.rowPinning,setRowPinning:props.setRowPinning,keepPinnedRows:props.keepPinnedRows,headerHeight:headerHeight,rowHeight:rowHeight,actionBarHeight:actionBarHeight,headerRef:headerRef,sampleRowRef:sampleRowRef,measureHeights:measureHeights};return jsx(AdvancedTableContext.Provider,{value:contextValue,children:children})};
2
2
  /**
3
3
  * table-core
4
4
  *
@@ -1712,6 +1712,7 @@
1712
1712
  }
1713
1713
  },
1714
1714
  "globalProps": true,
1715
+ "globalEventProps": true,
1715
1716
  "usage": {
1716
1717
  "react": {
1717
1718
  "import": "import { Avatar } from 'playbook-ui'",
@@ -3469,6 +3470,7 @@
3469
3470
  }
3470
3471
  },
3471
3472
  "globalProps": true,
3473
+ "globalEventProps": true,
3472
3474
  "usage": {
3473
3475
  "react": {
3474
3476
  "import": "import { Contact } from 'playbook-ui'",
@@ -3947,6 +3949,7 @@
3947
3949
  }
3948
3950
  },
3949
3951
  "globalProps": true,
3952
+ "globalEventProps": true,
3950
3953
  "usage": {
3951
3954
  "react": {
3952
3955
  "import": "import { Date } from 'playbook-ui'",
@@ -4625,6 +4628,7 @@
4625
4628
  }
4626
4629
  },
4627
4630
  "globalProps": true,
4631
+ "globalEventProps": true,
4628
4632
  "usage": {
4629
4633
  "react": {
4630
4634
  "import": "import { DateRangeInline } from 'playbook-ui'",
@@ -4673,6 +4677,7 @@
4673
4677
  }
4674
4678
  },
4675
4679
  "globalProps": true,
4680
+ "globalEventProps": true,
4676
4681
  "usage": {
4677
4682
  "react": {
4678
4683
  "import": "import { DateRangeStacked } from 'playbook-ui'",
@@ -4763,6 +4768,7 @@
4763
4768
  }
4764
4769
  },
4765
4770
  "globalProps": true,
4771
+ "globalEventProps": true,
4766
4772
  "usage": {
4767
4773
  "react": {
4768
4774
  "import": "import { DateStacked } from 'playbook-ui'",
@@ -4870,6 +4876,7 @@
4870
4876
  }
4871
4877
  },
4872
4878
  "globalProps": true,
4879
+ "globalEventProps": true,
4873
4880
  "usage": {
4874
4881
  "react": {
4875
4882
  "import": "import { DateTime } from 'playbook-ui'",
@@ -4944,6 +4951,7 @@
4944
4951
  }
4945
4952
  },
4946
4953
  "globalProps": true,
4954
+ "globalEventProps": true,
4947
4955
  "usage": {
4948
4956
  "react": {
4949
4957
  "import": "import { DateTimeStacked } from 'playbook-ui'",
@@ -4998,6 +5006,7 @@
4998
5006
  }
4999
5007
  },
5000
5008
  "globalProps": true,
5009
+ "globalEventProps": true,
5001
5010
  "usage": {
5002
5011
  "react": {
5003
5012
  "import": "import { DateYearStacked } from 'playbook-ui'",
@@ -5569,6 +5578,22 @@
5569
5578
  "react"
5570
5579
  ]
5571
5580
  },
5581
+ "enablePillReorder": {
5582
+ "type": "boolean",
5583
+ "platforms": [
5584
+ "react",
5585
+ "rails"
5586
+ ],
5587
+ "default": false
5588
+ },
5589
+ "externalDragHandle": {
5590
+ "type": "boolean",
5591
+ "platforms": [
5592
+ "react",
5593
+ "rails"
5594
+ ],
5595
+ "default": false
5596
+ },
5572
5597
  "isClosed": {
5573
5598
  "type": "boolean",
5574
5599
  "platforms": [
@@ -5641,6 +5666,14 @@
5641
5666
  ],
5642
5667
  "default": true
5643
5668
  },
5669
+ "showPillIndex": {
5670
+ "type": "boolean",
5671
+ "platforms": [
5672
+ "react",
5673
+ "rails"
5674
+ ],
5675
+ "default": false
5676
+ },
5644
5677
  "variant": {
5645
5678
  "type": "enum",
5646
5679
  "platforms": [
@@ -5844,7 +5877,7 @@
5844
5877
  "submission": {
5845
5878
  "submits": true,
5846
5879
  "value": "Selected option id in a CSS-hidden input (not input type=hidden).",
5847
- "multi": "syncHiddenInputs emits one hidden input per selected id in selection order, adds [] to the name only if absent and clears the original CSS-hidden input and removes its name while selections exist, so no blank array entry is submitted. When empty, the original name and required state are restored, including after Turbo reconnects. These submission fixes apply whether or not allow_option_creation is enabled. Comma-joining is used for default-value encoding, not as an additional submitted selection.",
5880
+ "multi": "syncHiddenInputs emits one hidden input per selected id in selection order, adds [] to the name only if absent and clears the original CSS-hidden input and removes its name while selections exist, so no blank array entry is submitted. When empty, the original name and required state are restored, including after Turbo reconnects. These submission fixes apply whether or not allow_option_creation is enabled. With enable_pill_reorder, drag or keyboard reordering updates that same selection order before syncHiddenInputs runs, so submitted values and pb:dropdown:reordered / pb:dropdown:selected details match the pill order. Comma-joining is used for default-value encoding, not as an additional submitted selection.",
5848
5881
  "dynamicOptions": "props.options_by_context with props.context_selector replaces the rendered options when the referenced element fires change, and props.clear_on_context_change (default true) then clears the selection, so a context change can submit an empty value. A pb:dropdown:updateOptions event, or an event named in props.options_event_type, replaces options the same way; clearSelection: false keeps only selections whose id exists in the replacement options."
5849
5882
  },
5850
5883
  "validation": {
@@ -5978,6 +6011,19 @@
5978
6011
  "form.rails.builder.simpleForm"
5979
6012
  ]
5980
6013
  },
6014
+ {
6015
+ "id": "dropdown.pill-reorder",
6016
+ "platforms": [
6017
+ "react",
6018
+ "rails"
6019
+ ],
6020
+ "questions": [
6021
+ "Can multi-select Dropdown pills be reordered?",
6022
+ "How do I enable draggable pills on Dropdown?",
6023
+ "Does pill reorder preserve form submission order?"
6024
+ ],
6025
+ "answer": "Opt in with enablePillReorder (Rails: enable_pill_reorder) on multi-select or multi-select + autocomplete. showPillIndex / show_pill_index numbers the pills. By default the whole pill is draggable with an in-pill grip; externalDragHandle / external_drag_handle requires an external grip. Focused pills reorder with ArrowLeft / ArrowRight. React onChange and Rails hidden inputs keep the new order; Rails also emits pb:dropdown:reordered (and pb:dropdown:selected) with the reordered array. Single-select is unaffected; reordering is off by default."
6026
+ },
5981
6027
  {
5982
6028
  "id": "dropdown.option-creation",
5983
6029
  "platforms": [
@@ -7972,6 +8018,7 @@
7972
8018
  }
7973
8019
  },
7974
8020
  "globalProps": true,
8021
+ "globalEventProps": true,
7975
8022
  "usage": {
7976
8023
  "react": {
7977
8024
  "import": "import { Image } from 'playbook-ui'",
@@ -10030,6 +10077,7 @@
10030
10077
  }
10031
10078
  },
10032
10079
  "globalProps": true,
10080
+ "globalEventProps": true,
10033
10081
  "usage": {
10034
10082
  "react": {
10035
10083
  "import": "import { Person } from 'playbook-ui'",
@@ -11274,7 +11322,7 @@
11274
11322
  "prosemirror-model"
11275
11323
  ],
11276
11324
  "optional": true,
11277
- "note": "Default React editor uses Trix (pass TrixEditor from react-trix). Advanced React editor uses TipTap, and the host app must already have the needed packages installed. Agents must not install packages — tell the user if they are missing. Rails loads TipTap from esm.sh and accepts only these extension strings: underline, text_align, horizontal_rule, image."
11325
+ "note": "Default React editor uses Trix (pass TrixEditor from react-trix). Advanced React editor uses TipTap, and the host app must already have the needed packages installed. Agents must not install packages — tell the user if they are missing. Rails bundles TipTap in playbook-rails.js (no host packages needed) and accepts only these extension strings: underline, text_align, horizontal_rule, image."
11278
11326
  }
11279
11327
  },
11280
11328
  "section_separator": {
@@ -14659,6 +14707,7 @@
14659
14707
  }
14660
14708
  },
14661
14709
  "globalProps": true,
14710
+ "globalEventProps": true,
14662
14711
  "usage": {
14663
14712
  "react": {
14664
14713
  "import": "import { TimeRangeInline } from 'playbook-ui'",
@@ -14729,6 +14778,7 @@
14729
14778
  }
14730
14779
  },
14731
14780
  "globalProps": true,
14781
+ "globalEventProps": true,
14732
14782
  "usage": {
14733
14783
  "react": {
14734
14784
  "import": "import { TimeStacked } from 'playbook-ui'",
@@ -14931,6 +14981,7 @@
14931
14981
  }
14932
14982
  },
14933
14983
  "globalProps": true,
14984
+ "globalEventProps": true,
14934
14985
  "usage": {
14935
14986
  "react": {
14936
14987
  "import": "import { Timestamp } from 'playbook-ui'",
@@ -16112,6 +16163,7 @@
16112
16163
  }
16113
16164
  },
16114
16165
  "globalProps": true,
16166
+ "globalEventProps": true,
16115
16167
  "usage": {
16116
16168
  "react": {
16117
16169
  "import": "import { User } from 'playbook-ui'",
@@ -16163,6 +16215,7 @@
16163
16215
  }
16164
16216
  },
16165
16217
  "globalProps": true,
16218
+ "globalEventProps": true,
16166
16219
  "usage": {
16167
16220
  "react": {
16168
16221
  "import": "import { UserBadge } from 'playbook-ui'",
@@ -16236,6 +16289,7 @@
16236
16289
  }
16237
16290
  },
16238
16291
  "globalProps": true,
16292
+ "globalEventProps": true,
16239
16293
  "usage": {
16240
16294
  "react": {
16241
16295
  "import": "import { WeekdayStacked } from 'playbook-ui'",
@@ -1 +1 @@
1
- {"description":"Kits that need host-app packages (from each kit’s docs/_playground.overrides.json → externalDependencies). Agents must NOT install packages — tell the user if they are missing.","bundledWithPlaybookUi":["flatpickr","intl-tel-input","@floating-ui/dom","@popperjs/core"],"kits":{"map":{"packages":["maplibre-gl"],"optional":true,"note":"Map wraps MapLibre. The host app must already have maplibre-gl (and any required CSS) installed. Agents must not install packages — tell the user if they are missing."},"pb_bar_graph":{"packages":["highcharts","highcharts-react-official"],"optional":true,"note":"This kit wraps Highcharts and does not ship it. The host app must already have these packages installed before using the kit. Agents must not install packages — tell the user if they are missing.","docs":"https://api.highcharts.com/highcharts/"},"pb_circle_chart":{"packages":["highcharts","highcharts-react-official"],"optional":true,"note":"This kit wraps Highcharts and does not ship it. The host app must already have these packages installed before using the kit. Agents must not install packages — tell the user if they are missing.","docs":"https://api.highcharts.com/highcharts/"},"pb_gauge_chart":{"packages":["highcharts","highcharts-react-official"],"optional":true,"note":"This kit wraps Highcharts and does not ship it. The host app must already have these packages installed before using the kit. Agents must not install packages — tell the user if they are missing.","docs":"https://api.highcharts.com/highcharts/"},"pb_line_graph":{"packages":["highcharts","highcharts-react-official"],"optional":true,"note":"This kit wraps Highcharts and does not ship it. The host app must already have these packages installed before using the kit. Agents must not install packages — tell the user if they are missing.","docs":"https://api.highcharts.com/highcharts/"},"rich_text_editor":{"packages":["react-trix","trix","@tiptap/react","@tiptap/starter-kit","@tiptap/extension-link","prosemirror-markdown","prosemirror-model"],"optional":true,"note":"Default React editor uses Trix (pass TrixEditor from react-trix). Advanced React editor uses TipTap, and the host app must already have the needed packages installed. Agents must not install packages — tell the user if they are missing. Rails loads TipTap from esm.sh and accepts only these extension strings: underline, text_align, horizontal_rule, image."}}}
1
+ {"description":"Kits that need host-app packages (from each kit’s docs/_playground.overrides.json → externalDependencies). Agents must NOT install packages — tell the user if they are missing.","bundledWithPlaybookUi":["flatpickr","intl-tel-input","@floating-ui/dom","@popperjs/core"],"kits":{"map":{"packages":["maplibre-gl"],"optional":true,"note":"Map wraps MapLibre. The host app must already have maplibre-gl (and any required CSS) installed. Agents must not install packages — tell the user if they are missing."},"pb_bar_graph":{"packages":["highcharts","highcharts-react-official"],"optional":true,"note":"This kit wraps Highcharts and does not ship it. The host app must already have these packages installed before using the kit. Agents must not install packages — tell the user if they are missing.","docs":"https://api.highcharts.com/highcharts/"},"pb_circle_chart":{"packages":["highcharts","highcharts-react-official"],"optional":true,"note":"This kit wraps Highcharts and does not ship it. The host app must already have these packages installed before using the kit. Agents must not install packages — tell the user if they are missing.","docs":"https://api.highcharts.com/highcharts/"},"pb_gauge_chart":{"packages":["highcharts","highcharts-react-official"],"optional":true,"note":"This kit wraps Highcharts and does not ship it. The host app must already have these packages installed before using the kit. Agents must not install packages — tell the user if they are missing.","docs":"https://api.highcharts.com/highcharts/"},"pb_line_graph":{"packages":["highcharts","highcharts-react-official"],"optional":true,"note":"This kit wraps Highcharts and does not ship it. The host app must already have these packages installed before using the kit. Agents must not install packages — tell the user if they are missing.","docs":"https://api.highcharts.com/highcharts/"},"rich_text_editor":{"packages":["react-trix","trix","@tiptap/react","@tiptap/starter-kit","@tiptap/extension-link","prosemirror-markdown","prosemirror-model"],"optional":true,"note":"Default React editor uses Trix (pass TrixEditor from react-trix). Advanced React editor uses TipTap, and the host app must already have the needed packages installed. Agents must not install packages — tell the user if they are missing. Rails bundles TipTap in playbook-rails.js (no host packages needed) and accepts only these extension strings: underline, text_align, horizontal_rule, image."}}}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "metadataVersion": 1,
3
- "version": "18.3.0-rc.1",
3
+ "version": "18.3.0-rc.2",
4
4
  "builder": {
5
5
  "class": "Playbook::Forms::Builder",
6
6
  "helper": "pb_form_with",
@@ -557,7 +557,7 @@
557
557
  "submission": {
558
558
  "submits": true,
559
559
  "value": "Selected option id in a CSS-hidden input (not input type=hidden).",
560
- "multi": "syncHiddenInputs emits one hidden input per selected id in selection order, adds [] to the name only if absent and clears the original CSS-hidden input and removes its name while selections exist, so no blank array entry is submitted. When empty, the original name and required state are restored, including after Turbo reconnects. These submission fixes apply whether or not allow_option_creation is enabled. Comma-joining is used for default-value encoding, not as an additional submitted selection.",
560
+ "multi": "syncHiddenInputs emits one hidden input per selected id in selection order, adds [] to the name only if absent and clears the original CSS-hidden input and removes its name while selections exist, so no blank array entry is submitted. When empty, the original name and required state are restored, including after Turbo reconnects. These submission fixes apply whether or not allow_option_creation is enabled. With enable_pill_reorder, drag or keyboard reordering updates that same selection order before syncHiddenInputs runs, so submitted values and pb:dropdown:reordered / pb:dropdown:selected details match the pill order. Comma-joining is used for default-value encoding, not as an additional submitted selection.",
561
561
  "dynamicOptions": "props.options_by_context with props.context_selector replaces the rendered options when the referenced element fires change, and props.clear_on_context_change (default true) then clears the selection, so a context change can submit an empty value. A pb:dropdown:updateOptions event, or an event named in props.options_event_type, replaces options the same way; clearSelection: false keeps only selections whose id exists in the replacement options."
562
562
  },
563
563
  "validation": {
@@ -1,8 +1,8 @@
1
1
  {
2
- "version": "18.3.0-rc.1",
2
+ "version": "18.3.0-rc.2",
3
3
  "metadataVersion": 1,
4
4
  "forms": "forms.json",
5
- "generated": "2026-10-26T19:43:37.493Z",
5
+ "generated": "2026-11-02T20:51:12.537Z",
6
6
  "schemas": {
7
7
  "globalProps": "global-props.schema.json",
8
8
  "globalEventProps": "global-event-props.schema.json",
@@ -838,7 +838,7 @@
838
838
  "prosemirror-model"
839
839
  ],
840
840
  "optional": true,
841
- "note": "Default React editor uses Trix (pass TrixEditor from react-trix). Advanced React editor uses TipTap, and the host app must already have the needed packages installed. Agents must not install packages — tell the user if they are missing. Rails loads TipTap from esm.sh and accepts only these extension strings: underline, text_align, horizontal_rule, image."
841
+ "note": "Default React editor uses Trix (pass TrixEditor from react-trix). Advanced React editor uses TipTap, and the host app must already have the needed packages installed. Agents must not install packages — tell the user if they are missing. Rails bundles TipTap in playbook-rails.js (no host packages needed) and accepts only these extension strings: underline, text_align, horizontal_rule, image."
842
842
  }
843
843
  },
844
844
  "section_separator": {
@@ -83,6 +83,7 @@
83
83
  }
84
84
  },
85
85
  "globalProps": true,
86
+ "globalEventProps": true,
86
87
  "usage": {
87
88
  "react": {
88
89
  "import": "import { Avatar } from 'playbook-ui'",
@@ -52,6 +52,7 @@
52
52
  }
53
53
  },
54
54
  "globalProps": true,
55
+ "globalEventProps": true,
55
56
  "usage": {
56
57
  "react": {
57
58
  "import": "import { Contact } from 'playbook-ui'",
@@ -90,6 +90,7 @@
90
90
  }
91
91
  },
92
92
  "globalProps": true,
93
+ "globalEventProps": true,
93
94
  "usage": {
94
95
  "react": {
95
96
  "import": "import { Date } from 'playbook-ui'",
@@ -71,6 +71,7 @@
71
71
  }
72
72
  },
73
73
  "globalProps": true,
74
+ "globalEventProps": true,
74
75
  "usage": {
75
76
  "react": {
76
77
  "import": "import { DateRangeInline } from 'playbook-ui'",
@@ -31,6 +31,7 @@
31
31
  }
32
32
  },
33
33
  "globalProps": true,
34
+ "globalEventProps": true,
34
35
  "usage": {
35
36
  "react": {
36
37
  "import": "import { DateRangeStacked } from 'playbook-ui'",
@@ -73,6 +73,7 @@
73
73
  }
74
74
  },
75
75
  "globalProps": true,
76
+ "globalEventProps": true,
76
77
  "usage": {
77
78
  "react": {
78
79
  "import": "import { DateStacked } from 'playbook-ui'",
@@ -90,6 +90,7 @@
90
90
  }
91
91
  },
92
92
  "globalProps": true,
93
+ "globalEventProps": true,
93
94
  "usage": {
94
95
  "react": {
95
96
  "import": "import { DateTime } from 'playbook-ui'",
@@ -57,6 +57,7 @@
57
57
  }
58
58
  },
59
59
  "globalProps": true,
60
+ "globalEventProps": true,
60
61
  "usage": {
61
62
  "react": {
62
63
  "import": "import { DateTimeStacked } from 'playbook-ui'",