udp-stencil-component-library 26.10.0-beta.3 → 26.10.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ag-grid-base_66.cjs.entry.js +17 -3
- package/dist/collection/components/fluent-ui/drawer/udp-fluent-drawer.js +17 -3
- package/dist/components/udp-fluent-drawer2.js +1 -1
- package/dist/docs.json +1 -1
- package/dist/esm/ag-grid-base_66.entry.js +17 -3
- package/dist/stencil-library/ag-grid-base_66.entry.js +1 -1
- package/package.json +1 -1
|
@@ -8256,6 +8256,7 @@ const UdpFluentDrawer = class {
|
|
|
8256
8256
|
this.checkScrollShadows();
|
|
8257
8257
|
};
|
|
8258
8258
|
this.handleToggle = (e) => {
|
|
8259
|
+
var _a, _b;
|
|
8259
8260
|
// Disclosure widgets inside the drawer (Fluent tree items, native popovers) emit
|
|
8260
8261
|
// bubbling `toggle` events with the same shape — collapsing a tree node must not
|
|
8261
8262
|
// read as the drawer closing. Only the drawer's own toggle drives open/close.
|
|
@@ -8275,6 +8276,12 @@ const UdpFluentDrawer = class {
|
|
|
8275
8276
|
}
|
|
8276
8277
|
}
|
|
8277
8278
|
else if (e.detail.newState === 'open') {
|
|
8279
|
+
// Fluent's show() lands a frame later; if `open` went false meanwhile, the close
|
|
8280
|
+
// has already run, so undo the late open quietly (no toggle, no drawerClose).
|
|
8281
|
+
if (!this.open) {
|
|
8282
|
+
(_b = (_a = this.drawerRef) === null || _a === void 0 ? void 0 : _a.dialog) === null || _b === void 0 ? void 0 : _b.close();
|
|
8283
|
+
return;
|
|
8284
|
+
}
|
|
8278
8285
|
if (!this.isLocked) {
|
|
8279
8286
|
this.handleLock(true);
|
|
8280
8287
|
this.isLocked = true;
|
|
@@ -8307,6 +8314,11 @@ const UdpFluentDrawer = class {
|
|
|
8307
8314
|
const hide = (_c = this.originalHide) !== null && _c !== void 0 ? _c : this.drawerRef.hide.bind(this.drawerRef);
|
|
8308
8315
|
hide();
|
|
8309
8316
|
}
|
|
8317
|
+
else if (this.isLocked) {
|
|
8318
|
+
// A show still pending (locked by the fallback) gets no closing toggle; release here.
|
|
8319
|
+
this.handleLock(false);
|
|
8320
|
+
this.isLocked = false;
|
|
8321
|
+
}
|
|
8310
8322
|
}
|
|
8311
8323
|
}
|
|
8312
8324
|
handleSizeChange() {
|
|
@@ -8330,11 +8342,13 @@ const UdpFluentDrawer = class {
|
|
|
8330
8342
|
* Sync initial open state after component loads.
|
|
8331
8343
|
*/
|
|
8332
8344
|
componentDidLoad() {
|
|
8333
|
-
var _a;
|
|
8345
|
+
var _a, _b, _c;
|
|
8334
8346
|
// Initialize effectiveSize after render when window dimensions are accurate
|
|
8335
8347
|
this.calculateEffectiveSize();
|
|
8336
8348
|
if (this.open) {
|
|
8337
|
-
|
|
8349
|
+
// The open watcher may already have shown it.
|
|
8350
|
+
if (!((_b = (_a = this.drawerRef) === null || _a === void 0 ? void 0 : _a.dialog) === null || _b === void 0 ? void 0 : _b.open))
|
|
8351
|
+
(_c = this.drawerRef) === null || _c === void 0 ? void 0 : _c.show();
|
|
8338
8352
|
if (!this.isLocked) {
|
|
8339
8353
|
this.handleLock(true);
|
|
8340
8354
|
this.isLocked = true;
|
|
@@ -8580,7 +8594,7 @@ const UdpFluentDrawer = class {
|
|
|
8580
8594
|
}
|
|
8581
8595
|
}
|
|
8582
8596
|
render() {
|
|
8583
|
-
return (index.h(index.Host, { key: '
|
|
8597
|
+
return (index.h(index.Host, { key: '3c97f812210b6afb63919f0459bfc9a7fc4a70f7', class: { 'has-footer': this.hasFooter, 'body-muted': this.bodyBackground === 'muted' } }, index.h("fluent-drawer", { key: '82bcdb32811adb0fa71c6945385dc0990ffe5800', ref: this.setDrawerRef, onToggle: this.handleToggle, type: "modal", position: this.position, size: this.effectiveSize }, index.h("fluent-drawer-body", { key: '7bc99c7657ad3fb8091848b95795e6335dd2527c' }, this.hasTitle ? (index.h("slot", { name: "title", slot: "title" })) : (index.h("udp-text", { variant: "subtitle1", slot: "title" }, this.drawerTitle)), index.h("udp-fluent-icon-button", { key: '064b541cf629e6fbb8c1d3ed5c5c3f23b125132d', slot: "close", appearance: "subtle", iconName: "dismiss", "aria-label": "close" }), this.hasToolbar && (index.h("udp-flexbox", { key: '475f3959438ae9010487bb9f2dd2ad783b865b64', class: "drawer-toolbar", direction: "row", width: "100%" }, index.h("slot", { key: '91d7fe3e7f77115c8754afa1e683d6526ff4dcd0', name: "toolbar" }))), index.h("div", { key: 'f8b28a6cf560f1bc9f717d9de6d7d2171854a4e4', class: "drawer-scroll-container", ref: el => (this.contentRef = el), onScroll: this.handleScroll }, index.h("div", { key: 'd3b38549ac0ee57b2dbc8b04d10e1c9a3c673a07', class: `scroll-shadow top ${this.showTopShadow ? 'visible' : ''}` }), index.h("div", { key: '80d6424a3a7130f50ee08d80bc8698feec46ce64', class: `drawer-content-inner${this.excludeVerticalPadding ? ' exclude-vertical' : ''}${this.excludeHorizontalPadding ? ' exclude-horizontal' : ''}${this.excludeBodyPadding ? ' no-body-padding' : ''}` }, index.h("slot", { key: '869eb8f1ee2a4f58aacd9084a4955f597ea1d76b' })), index.h("div", { key: '2945958300f808bdc43ddd21ce05aad64b0350bb', class: `scroll-shadow bottom ${this.showBottomShadow ? 'visible' : ''}` })), this.hasFooter && (index.h("udp-flexbox", { key: 'a87618d792e510eb4c3931a010df339054f6904b', slot: "footer", direction: "row" }, index.h("slot", { key: '99390f456163d3ee0545d9db299046218291c2bc', name: "footer" })))))));
|
|
8584
8598
|
}
|
|
8585
8599
|
get el() { return index.getElement(this); }
|
|
8586
8600
|
static get watchers() { return {
|
|
@@ -93,6 +93,7 @@ export class UdpFluentDrawer {
|
|
|
93
93
|
this.checkScrollShadows();
|
|
94
94
|
};
|
|
95
95
|
this.handleToggle = (e) => {
|
|
96
|
+
var _a, _b;
|
|
96
97
|
// Disclosure widgets inside the drawer (Fluent tree items, native popovers) emit
|
|
97
98
|
// bubbling `toggle` events with the same shape — collapsing a tree node must not
|
|
98
99
|
// read as the drawer closing. Only the drawer's own toggle drives open/close.
|
|
@@ -112,6 +113,12 @@ export class UdpFluentDrawer {
|
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
115
|
else if (e.detail.newState === 'open') {
|
|
116
|
+
// Fluent's show() lands a frame later; if `open` went false meanwhile, the close
|
|
117
|
+
// has already run, so undo the late open quietly (no toggle, no drawerClose).
|
|
118
|
+
if (!this.open) {
|
|
119
|
+
(_b = (_a = this.drawerRef) === null || _a === void 0 ? void 0 : _a.dialog) === null || _b === void 0 ? void 0 : _b.close();
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
115
122
|
if (!this.isLocked) {
|
|
116
123
|
this.handleLock(true);
|
|
117
124
|
this.isLocked = true;
|
|
@@ -144,6 +151,11 @@ export class UdpFluentDrawer {
|
|
|
144
151
|
const hide = (_c = this.originalHide) !== null && _c !== void 0 ? _c : this.drawerRef.hide.bind(this.drawerRef);
|
|
145
152
|
hide();
|
|
146
153
|
}
|
|
154
|
+
else if (this.isLocked) {
|
|
155
|
+
// A show still pending (locked by the fallback) gets no closing toggle; release here.
|
|
156
|
+
this.handleLock(false);
|
|
157
|
+
this.isLocked = false;
|
|
158
|
+
}
|
|
147
159
|
}
|
|
148
160
|
}
|
|
149
161
|
handleSizeChange() {
|
|
@@ -167,11 +179,13 @@ export class UdpFluentDrawer {
|
|
|
167
179
|
* Sync initial open state after component loads.
|
|
168
180
|
*/
|
|
169
181
|
componentDidLoad() {
|
|
170
|
-
var _a;
|
|
182
|
+
var _a, _b, _c;
|
|
171
183
|
// Initialize effectiveSize after render when window dimensions are accurate
|
|
172
184
|
this.calculateEffectiveSize();
|
|
173
185
|
if (this.open) {
|
|
174
|
-
|
|
186
|
+
// The open watcher may already have shown it.
|
|
187
|
+
if (!((_b = (_a = this.drawerRef) === null || _a === void 0 ? void 0 : _a.dialog) === null || _b === void 0 ? void 0 : _b.open))
|
|
188
|
+
(_c = this.drawerRef) === null || _c === void 0 ? void 0 : _c.show();
|
|
175
189
|
if (!this.isLocked) {
|
|
176
190
|
this.handleLock(true);
|
|
177
191
|
this.isLocked = true;
|
|
@@ -417,7 +431,7 @@ export class UdpFluentDrawer {
|
|
|
417
431
|
}
|
|
418
432
|
}
|
|
419
433
|
render() {
|
|
420
|
-
return (h(Host, { key: '
|
|
434
|
+
return (h(Host, { key: '3c97f812210b6afb63919f0459bfc9a7fc4a70f7', class: { 'has-footer': this.hasFooter, 'body-muted': this.bodyBackground === 'muted' } }, h("fluent-drawer", { key: '82bcdb32811adb0fa71c6945385dc0990ffe5800', ref: this.setDrawerRef, onToggle: this.handleToggle, type: "modal", position: this.position, size: this.effectiveSize }, h("fluent-drawer-body", { key: '7bc99c7657ad3fb8091848b95795e6335dd2527c' }, this.hasTitle ? (h("slot", { name: "title", slot: "title" })) : (h("udp-text", { variant: "subtitle1", slot: "title" }, this.drawerTitle)), h("udp-fluent-icon-button", { key: '064b541cf629e6fbb8c1d3ed5c5c3f23b125132d', slot: "close", appearance: "subtle", iconName: "dismiss", "aria-label": "close" }), this.hasToolbar && (h("udp-flexbox", { key: '475f3959438ae9010487bb9f2dd2ad783b865b64', class: "drawer-toolbar", direction: "row", width: "100%" }, h("slot", { key: '91d7fe3e7f77115c8754afa1e683d6526ff4dcd0', name: "toolbar" }))), h("div", { key: 'f8b28a6cf560f1bc9f717d9de6d7d2171854a4e4', class: "drawer-scroll-container", ref: el => (this.contentRef = el), onScroll: this.handleScroll }, h("div", { key: 'd3b38549ac0ee57b2dbc8b04d10e1c9a3c673a07', class: `scroll-shadow top ${this.showTopShadow ? 'visible' : ''}` }), h("div", { key: '80d6424a3a7130f50ee08d80bc8698feec46ce64', class: `drawer-content-inner${this.excludeVerticalPadding ? ' exclude-vertical' : ''}${this.excludeHorizontalPadding ? ' exclude-horizontal' : ''}${this.excludeBodyPadding ? ' no-body-padding' : ''}` }, h("slot", { key: '869eb8f1ee2a4f58aacd9084a4955f597ea1d76b' })), h("div", { key: '2945958300f808bdc43ddd21ce05aad64b0350bb', class: `scroll-shadow bottom ${this.showBottomShadow ? 'visible' : ''}` })), this.hasFooter && (h("udp-flexbox", { key: 'a87618d792e510eb4c3931a010df339054f6904b', slot: "footer", direction: "row" }, h("slot", { key: '99390f456163d3ee0545d9db299046218291c2bc', name: "footer" })))))));
|
|
421
435
|
}
|
|
422
436
|
static get is() { return "udp-fluent-drawer"; }
|
|
423
437
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,H as e,c as i,h as o,d as s,t as d}from"./index2.js";import"@fluentui/web-components/drawer.js";import"@fluentui/web-components/drawer-body.js";import"@fluentui/web-components/button.js";import{d as a}from"./udp-flexbox2.js";import{d as n}from"./udp-fluent-button2.js";import{d as r}from"./udp-fluent-icon2.js";import{d as l}from"./udp-fluent-icon-button2.js";import{d as h}from"./udp-spinner2.js";import{d as c}from"./udp-text2.js";const u={small:320,medium:590,large:940,full:1/0},p=t(class t extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.drawerCloseEvent=i(this,"drawerClose",3),this.open=!1,this.drawerTitle="",this.size="medium",this.position="end",this.excludeVerticalPadding=!1,this.excludeHorizontalPadding=!1,this.excludeBodyPadding=!1,this.bodyBackground="default",this.preventAutoClose=!1,this.hasFooter=!1,this.hasToolbar=!1,this.hasTitle=!1,this.showTopShadow=!1,this.showBottomShadow=!1,this.effectiveSize="medium",this.isLocked=!1,this.clickStartedOnBackdrop=!1,this.handleDialogMouseDown=t=>{this.drawerRef&&this.drawerRef.dialog&&(this.clickStartedOnBackdrop=t.target===this.drawerRef.dialog)},this.handleWindowResize=()=>{clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=setTimeout((()=>{this.calculateEffectiveSize()}),100)},this.handleScroll=()=>{this.checkScrollShadows()},this.handleToggle=t=>{t.target===this.drawerRef&&(t.stopPropagation(),"closed"===t.detail.newState?(this.isLocked&&(this.handleLock(!1),this.isLocked=!1),this.preventAutoClose||this.drawerCloseEvent.emit()):"open"===t.detail.newState&&(this.isLocked||(this.handleLock(!0),this.isLocked=!0)))},this.setDrawerRef=t=>{this.drawerRef=t}}handleOpenChange(t){var e,i,o;clearTimeout(this.lockFallbackTimer),t?((null===(e=this.drawerRef)||void 0===e?void 0:e.dialog)&&!this.drawerRef.dialog.open&&this.drawerRef.show(),this.lockFallbackTimer=setTimeout((()=>{this.open&&!this.isLocked&&(this.handleLock(!0),this.isLocked=!0)}),50)):(null===(i=this.drawerRef)||void 0===i?void 0:i.dialog)&&this.drawerRef.dialog.open&&(null!==(o=this.originalHide)&&void 0!==o?o:this.drawerRef.hide.bind(this.drawerRef))()}handleSizeChange(){this.calculateEffectiveSize()}componentWillLoad(){this.checkFooter(),this.checkToolbar(),this.checkTitle(),this.updateDrawerWidth()}updateDrawerWidth(){this.drawerWidth&&this.drawerWidth.length>0?this.el.style.setProperty("--drawer-width",this.drawerWidth):this.el.style.removeProperty("--drawer-width")}componentDidLoad(){var t;this.calculateEffectiveSize(),this.open&&(null===(t=this.drawerRef)||void 0===t||t.show(),this.isLocked||(this.handleLock(!0),this.isLocked=!0)),this.mutationObserver=new MutationObserver((()=>{this.checkFooter(),this.checkToolbar(),this.checkTitle(),this.checkScrollShadows()})),this.mutationObserver.observe(this.el,{childList:!0,subtree:!0}),this.contentRef&&(this.resizeObserver=new ResizeObserver((()=>{this.checkScrollShadows()})),this.resizeObserver.observe(this.contentRef),window.addEventListener("resize",this.handleWindowResize),this.checkScrollShadows()),this.patchHideForControlledClose(),this.setupBackdropClickHandling()}patchHideForControlledClose(){var t;if("function"!=typeof(null===(t=this.drawerRef)||void 0===t?void 0:t.hide))return;const e=this.drawerRef.hide.bind(this.drawerRef);this.originalHide=e,this.drawerRef.hide=()=>{this.preventAutoClose?this.drawerCloseEvent.emit():e()}}setupBackdropClickHandling(){if(!this.drawerRef||!this.drawerRef.dialog)return;const t=this.drawerRef.dialog;t.addEventListener("mousedown",this.handleDialogMouseDown);const e=this.drawerRef.clickHandler.bind(this.drawerRef);this.drawerRef.clickHandler=i=>i.target!==t||(this.open&&!this.clickStartedOnBackdrop?(i.preventDefault(),!0):e(i))}disconnectedCallback(){var e,i;clearTimeout(this.lockFallbackTimer),clearTimeout(this.resizeDebounceTimer),this.isLocked&&(this.handleLock(!1),this.isLocked=!1),0===t.openDrawers.size&&null!==t.unlockTimer&&(clearTimeout(t.unlockTimer),t.unlockTimer=null),null===(e=this.mutationObserver)||void 0===e||e.disconnect(),null===(i=this.resizeObserver)||void 0===i||i.disconnect(),window.removeEventListener("resize",this.handleWindowResize),this.drawerRef&&this.drawerRef.dialog&&this.drawerRef.dialog.removeEventListener("mousedown",this.handleDialogMouseDown)}checkFooter(){const t=Array.from(this.el.children);this.hasFooter=t.some((t=>"footer"===t.getAttribute("slot")))}checkToolbar(){const t=Array.from(this.el.children);this.hasToolbar=t.some((t=>"toolbar"===t.getAttribute("slot")))}checkTitle(){const t=Array.from(this.el.children);this.hasTitle=t.some((t=>"title"===t.getAttribute("slot")))}calculateEffectiveSize(){const t=window.innerWidth;let e=u.medium;if(this.drawerWidth&&this.drawerWidth.endsWith("px")){const t=parseInt(this.drawerWidth,10);!isNaN(t)&&t>0&&(e=t)}else this.size&&u[this.size]&&(e=u[this.size]);t<e?"full"!==this.effectiveSize&&(this.effectiveSize="full"):this.effectiveSize!==this.size&&(this.effectiveSize=this.size)}checkScrollShadows(){if(!this.contentRef)return;const{scrollTop:t,scrollHeight:e,clientHeight:i}=this.contentRef,o=t>0,s=Math.ceil(t+i)<e;this.showTopShadow!==o&&(this.showTopShadow=o),this.showBottomShadow!==s&&(this.showBottomShadow=s)}handleLock(e){e?(null!==t.unlockTimer&&(clearTimeout(t.unlockTimer),t.unlockTimer=null),0===t.openDrawers.size&&this.lockBodyScroll(),t.openDrawers.add(this)):(t.openDrawers.delete(this),0===t.openDrawers.size&&(t.unlockTimer=setTimeout((()=>{0===t.openDrawers.size&&this.unlockBodyScroll(),t.unlockTimer=null}),t.UNLOCK_DELAY_MS)))}getScrollbarWidth(){return window.innerWidth-document.documentElement.clientWidth}lockBodyScroll(){const e=document.documentElement,i=document.body;if("fixed"===i.style.position)return;null===t.originalBodyStyles&&(t.originalBodyStyles={htmlOverflow:e.style.overflow,bodyOverflow:i.style.overflow,bodyPosition:i.style.position,bodyTop:i.style.top,bodyWidth:i.style.width,bodyPaddingRight:i.style.paddingRight,bodyTouchAction:i.style.touchAction});const o=window.scrollY,s=this.getScrollbarWidth();e.style.overflow="hidden",i.style.overflow="hidden",i.style.position="fixed",i.style.top=`-${o}px`,i.style.width="100%",i.style.touchAction="none",s>0&&(i.style.paddingRight=`${s}px`)}unlockBodyScroll(){const e=document.documentElement,i=document.body,o=i.style.top;if(t.originalBodyStyles&&(e.style.overflow=t.originalBodyStyles.htmlOverflow,i.style.overflow=t.originalBodyStyles.bodyOverflow,i.style.position=t.originalBodyStyles.bodyPosition,i.style.top=t.originalBodyStyles.bodyTop,i.style.width=t.originalBodyStyles.bodyWidth,i.style.paddingRight=t.originalBodyStyles.bodyPaddingRight,i.style.touchAction=t.originalBodyStyles.bodyTouchAction,t.originalBodyStyles=null),o&&""!==o){const t=parseInt(o.replace("px",""),10);isNaN(t)||window.scrollTo(0,Math.abs(t))}}render(){return o(s,{key:"b5e39de09e89d6d103143b14b97d239370e99b38",class:{"has-footer":this.hasFooter,"body-muted":"muted"===this.bodyBackground}},o("fluent-drawer",{key:"2d276e61883f171ebf451523f315547f1d60f04f",ref:this.setDrawerRef,onToggle:this.handleToggle,type:"modal",position:this.position,size:this.effectiveSize},o("fluent-drawer-body",{key:"2169163d5f063a348f4b30c487497382c1a9d972"},this.hasTitle?o("slot",{name:"title",slot:"title"}):o("udp-text",{variant:"subtitle1",slot:"title"},this.drawerTitle),o("udp-fluent-icon-button",{key:"b7b6280ceef655e4c8b1102fe0422a7eacd5bc66",slot:"close",appearance:"subtle",iconName:"dismiss","aria-label":"close"}),this.hasToolbar&&o("udp-flexbox",{key:"a61ee0fa20b4f97f8cf0631f5e97003f2d9fe4f3",class:"drawer-toolbar",direction:"row",width:"100%"},o("slot",{key:"7090c6596724a2402fc743688bee724d38a92ee0",name:"toolbar"})),o("div",{key:"1ec9060f4f0c1a5449d1be2d5e304cbeb88ddc13",class:"drawer-scroll-container",ref:t=>this.contentRef=t,onScroll:this.handleScroll},o("div",{key:"6899ee5a89da9125539a1ed494eba054d40fb4d0",class:"scroll-shadow top "+(this.showTopShadow?"visible":"")}),o("div",{key:"177cb0241a681b797de81c401ff5dab22c6ae3cd",class:`drawer-content-inner${this.excludeVerticalPadding?" exclude-vertical":""}${this.excludeHorizontalPadding?" exclude-horizontal":""}${this.excludeBodyPadding?" no-body-padding":""}`},o("slot",{key:"db40fbc2bbac4d70080606bf2abc89162d1df477"})),o("div",{key:"7e9a783f8867b3df8c5d51db7aa3b5f3e7428c7a",class:"scroll-shadow bottom "+(this.showBottomShadow?"visible":"")})),this.hasFooter&&o("udp-flexbox",{key:"f8e11823296a61ad169eea0eb95c31f996a18a92",slot:"footer",direction:"row"},o("slot",{key:"141cf37ad21f4c3da617288ba5497dc351bb7e60",name:"footer"})))))}get el(){return this}static get watchers(){return{open:[{handleOpenChange:0}],size:[{handleSizeChange:0}],drawerWidth:[{updateDrawerWidth:0}]}}static get style(){return'fluent-drawer-body{padding:0;background-color:var(--colorNeutralBackground1)}:host(.body-muted) fluent-drawer-body{background-color:var(--colorNeutralBackground2)}fluent-drawer-body::part(header){background:var(--colorNeutralBackground1);overflow:visible;padding:var(--spacingHorizontalM);border-bottom:1px solid var(--colorNeutralStroke3)}fluent-drawer-body::part(content){overflow:hidden;display:flex;flex-direction:column;flex:1 1 auto;min-height:0;padding:0}fluent-button[slot="close"]{margin:2px;}fluent-drawer-body::part(footer){display:none}.drawer-toolbar{position:relative;z-index:10;background:var(--colorNeutralBackground1);padding:var(--spacingVerticalNone) var(--spacingHorizontalM);border-bottom:1px solid var(--colorNeutralStroke2);width:100%}.drawer-scroll-container{padding:0;overflow-y:auto;flex:1 1 auto;min-height:0;position:relative;display:flex;flex-direction:column}.drawer-content-inner{padding:var(--spacingHorizontalM);padding-bottom:var(--spacingVerticalXXXL);flex:1 0 auto;}.drawer-content-inner.exclude-vertical{padding-top:0;padding-bottom:0}.drawer-content-inner.exclude-horizontal{padding-left:0;padding-right:0}.drawer-content-inner.no-body-padding{padding:0;display:flex;flex-direction:column;flex:1 1 auto;min-height:0}.drawer-content-inner.no-body-padding{padding:0;display:flex;flex-direction:column;flex:1 1 auto;min-height:0}.scroll-shadow{position:sticky;left:0;right:0;height:24px;z-index:100;pointer-events:none;opacity:0;transition:opacity 0.2s ease;flex-shrink:0}.scroll-shadow.visible{opacity:1}.scroll-shadow.top{top:0;margin-bottom:-24px;background:linear-gradient(to bottom, rgba(0, 0, 0, 0.12), transparent)}.scroll-shadow.bottom{bottom:0;margin-top:-24px;background:linear-gradient(to top, rgba(0, 0, 0, 0.12), transparent)}:host(.has-footer) fluent-drawer-body::part(footer){display:block;background:var(--colorNeutralBackground1);border-top:1px solid var(--colorNeutralStroke3);padding-top:var(--spacingVerticalS);padding-bottom:var(--spacingVerticalM);padding-left:var(--spacingHorizontalM);padding-right:var(--spacingHorizontalM)}'}},[257,"udp-fluent-drawer",{open:[4],drawerTitle:[1,"drawer-title"],size:[1],position:[1],drawerWidth:[1,"drawer-width"],excludeVerticalPadding:[4,"exclude-vertical-padding"],excludeHorizontalPadding:[4,"exclude-horizontal-padding"],excludeBodyPadding:[4,"exclude-body-padding"],bodyBackground:[1,"body-background"],preventAutoClose:[4,"prevent-auto-close"],hasFooter:[32],hasToolbar:[32],hasTitle:[32],showTopShadow:[32],showBottomShadow:[32],effectiveSize:[32]},void 0,{open:[{handleOpenChange:0}],size:[{handleSizeChange:0}],drawerWidth:[{updateDrawerWidth:0}]}]);function f(){"undefined"!=typeof customElements&&["udp-fluent-drawer","udp-flexbox","udp-fluent-button","udp-fluent-icon","udp-fluent-icon-button","udp-spinner","udp-text"].forEach((t=>{switch(t){case"udp-fluent-drawer":customElements.get(d(t))||customElements.define(d(t),p);break;case"udp-flexbox":customElements.get(d(t))||a();break;case"udp-fluent-button":customElements.get(d(t))||n();break;case"udp-fluent-icon":customElements.get(d(t))||r();break;case"udp-fluent-icon-button":customElements.get(d(t))||l();break;case"udp-spinner":customElements.get(d(t))||h();break;case"udp-text":customElements.get(d(t))||c()}}))}p.openDrawers=new Set,p.unlockTimer=null,p.UNLOCK_DELAY_MS=300,p.originalBodyStyles=null;export{p as U,f as d}
|
|
1
|
+
import{p as t,H as e,c as i,h as o,d as s,t as d}from"./index2.js";import"@fluentui/web-components/drawer.js";import"@fluentui/web-components/drawer-body.js";import"@fluentui/web-components/button.js";import{d as n}from"./udp-flexbox2.js";import{d as r}from"./udp-fluent-button2.js";import{d as a}from"./udp-fluent-icon2.js";import{d as l}from"./udp-fluent-icon-button2.js";import{d as h}from"./udp-spinner2.js";import{d as c}from"./udp-text2.js";const u={small:320,medium:590,large:940,full:1/0},p=t(class t extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.drawerCloseEvent=i(this,"drawerClose",3),this.open=!1,this.drawerTitle="",this.size="medium",this.position="end",this.excludeVerticalPadding=!1,this.excludeHorizontalPadding=!1,this.excludeBodyPadding=!1,this.bodyBackground="default",this.preventAutoClose=!1,this.hasFooter=!1,this.hasToolbar=!1,this.hasTitle=!1,this.showTopShadow=!1,this.showBottomShadow=!1,this.effectiveSize="medium",this.isLocked=!1,this.clickStartedOnBackdrop=!1,this.handleDialogMouseDown=t=>{this.drawerRef&&this.drawerRef.dialog&&(this.clickStartedOnBackdrop=t.target===this.drawerRef.dialog)},this.handleWindowResize=()=>{clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=setTimeout((()=>{this.calculateEffectiveSize()}),100)},this.handleScroll=()=>{this.checkScrollShadows()},this.handleToggle=t=>{var e,i;if(t.target===this.drawerRef)if(t.stopPropagation(),"closed"===t.detail.newState)this.isLocked&&(this.handleLock(!1),this.isLocked=!1),this.preventAutoClose||this.drawerCloseEvent.emit();else if("open"===t.detail.newState){if(!this.open)return void(null===(i=null===(e=this.drawerRef)||void 0===e?void 0:e.dialog)||void 0===i||i.close());this.isLocked||(this.handleLock(!0),this.isLocked=!0)}},this.setDrawerRef=t=>{this.drawerRef=t}}handleOpenChange(t){var e,i,o;clearTimeout(this.lockFallbackTimer),t?((null===(e=this.drawerRef)||void 0===e?void 0:e.dialog)&&!this.drawerRef.dialog.open&&this.drawerRef.show(),this.lockFallbackTimer=setTimeout((()=>{this.open&&!this.isLocked&&(this.handleLock(!0),this.isLocked=!0)}),50)):(null===(i=this.drawerRef)||void 0===i?void 0:i.dialog)&&this.drawerRef.dialog.open?(null!==(o=this.originalHide)&&void 0!==o?o:this.drawerRef.hide.bind(this.drawerRef))():this.isLocked&&(this.handleLock(!1),this.isLocked=!1)}handleSizeChange(){this.calculateEffectiveSize()}componentWillLoad(){this.checkFooter(),this.checkToolbar(),this.checkTitle(),this.updateDrawerWidth()}updateDrawerWidth(){this.drawerWidth&&this.drawerWidth.length>0?this.el.style.setProperty("--drawer-width",this.drawerWidth):this.el.style.removeProperty("--drawer-width")}componentDidLoad(){var t,e,i;this.calculateEffectiveSize(),this.open&&((null===(e=null===(t=this.drawerRef)||void 0===t?void 0:t.dialog)||void 0===e?void 0:e.open)||null===(i=this.drawerRef)||void 0===i||i.show(),this.isLocked||(this.handleLock(!0),this.isLocked=!0)),this.mutationObserver=new MutationObserver((()=>{this.checkFooter(),this.checkToolbar(),this.checkTitle(),this.checkScrollShadows()})),this.mutationObserver.observe(this.el,{childList:!0,subtree:!0}),this.contentRef&&(this.resizeObserver=new ResizeObserver((()=>{this.checkScrollShadows()})),this.resizeObserver.observe(this.contentRef),window.addEventListener("resize",this.handleWindowResize),this.checkScrollShadows()),this.patchHideForControlledClose(),this.setupBackdropClickHandling()}patchHideForControlledClose(){var t;if("function"!=typeof(null===(t=this.drawerRef)||void 0===t?void 0:t.hide))return;const e=this.drawerRef.hide.bind(this.drawerRef);this.originalHide=e,this.drawerRef.hide=()=>{this.preventAutoClose?this.drawerCloseEvent.emit():e()}}setupBackdropClickHandling(){if(!this.drawerRef||!this.drawerRef.dialog)return;const t=this.drawerRef.dialog;t.addEventListener("mousedown",this.handleDialogMouseDown);const e=this.drawerRef.clickHandler.bind(this.drawerRef);this.drawerRef.clickHandler=i=>i.target!==t||(this.open&&!this.clickStartedOnBackdrop?(i.preventDefault(),!0):e(i))}disconnectedCallback(){var e,i;clearTimeout(this.lockFallbackTimer),clearTimeout(this.resizeDebounceTimer),this.isLocked&&(this.handleLock(!1),this.isLocked=!1),0===t.openDrawers.size&&null!==t.unlockTimer&&(clearTimeout(t.unlockTimer),t.unlockTimer=null),null===(e=this.mutationObserver)||void 0===e||e.disconnect(),null===(i=this.resizeObserver)||void 0===i||i.disconnect(),window.removeEventListener("resize",this.handleWindowResize),this.drawerRef&&this.drawerRef.dialog&&this.drawerRef.dialog.removeEventListener("mousedown",this.handleDialogMouseDown)}checkFooter(){const t=Array.from(this.el.children);this.hasFooter=t.some((t=>"footer"===t.getAttribute("slot")))}checkToolbar(){const t=Array.from(this.el.children);this.hasToolbar=t.some((t=>"toolbar"===t.getAttribute("slot")))}checkTitle(){const t=Array.from(this.el.children);this.hasTitle=t.some((t=>"title"===t.getAttribute("slot")))}calculateEffectiveSize(){const t=window.innerWidth;let e=u.medium;if(this.drawerWidth&&this.drawerWidth.endsWith("px")){const t=parseInt(this.drawerWidth,10);!isNaN(t)&&t>0&&(e=t)}else this.size&&u[this.size]&&(e=u[this.size]);t<e?"full"!==this.effectiveSize&&(this.effectiveSize="full"):this.effectiveSize!==this.size&&(this.effectiveSize=this.size)}checkScrollShadows(){if(!this.contentRef)return;const{scrollTop:t,scrollHeight:e,clientHeight:i}=this.contentRef,o=t>0,s=Math.ceil(t+i)<e;this.showTopShadow!==o&&(this.showTopShadow=o),this.showBottomShadow!==s&&(this.showBottomShadow=s)}handleLock(e){e?(null!==t.unlockTimer&&(clearTimeout(t.unlockTimer),t.unlockTimer=null),0===t.openDrawers.size&&this.lockBodyScroll(),t.openDrawers.add(this)):(t.openDrawers.delete(this),0===t.openDrawers.size&&(t.unlockTimer=setTimeout((()=>{0===t.openDrawers.size&&this.unlockBodyScroll(),t.unlockTimer=null}),t.UNLOCK_DELAY_MS)))}getScrollbarWidth(){return window.innerWidth-document.documentElement.clientWidth}lockBodyScroll(){const e=document.documentElement,i=document.body;if("fixed"===i.style.position)return;null===t.originalBodyStyles&&(t.originalBodyStyles={htmlOverflow:e.style.overflow,bodyOverflow:i.style.overflow,bodyPosition:i.style.position,bodyTop:i.style.top,bodyWidth:i.style.width,bodyPaddingRight:i.style.paddingRight,bodyTouchAction:i.style.touchAction});const o=window.scrollY,s=this.getScrollbarWidth();e.style.overflow="hidden",i.style.overflow="hidden",i.style.position="fixed",i.style.top=`-${o}px`,i.style.width="100%",i.style.touchAction="none",s>0&&(i.style.paddingRight=`${s}px`)}unlockBodyScroll(){const e=document.documentElement,i=document.body,o=i.style.top;if(t.originalBodyStyles&&(e.style.overflow=t.originalBodyStyles.htmlOverflow,i.style.overflow=t.originalBodyStyles.bodyOverflow,i.style.position=t.originalBodyStyles.bodyPosition,i.style.top=t.originalBodyStyles.bodyTop,i.style.width=t.originalBodyStyles.bodyWidth,i.style.paddingRight=t.originalBodyStyles.bodyPaddingRight,i.style.touchAction=t.originalBodyStyles.bodyTouchAction,t.originalBodyStyles=null),o&&""!==o){const t=parseInt(o.replace("px",""),10);isNaN(t)||window.scrollTo(0,Math.abs(t))}}render(){return o(s,{key:"3c97f812210b6afb63919f0459bfc9a7fc4a70f7",class:{"has-footer":this.hasFooter,"body-muted":"muted"===this.bodyBackground}},o("fluent-drawer",{key:"82bcdb32811adb0fa71c6945385dc0990ffe5800",ref:this.setDrawerRef,onToggle:this.handleToggle,type:"modal",position:this.position,size:this.effectiveSize},o("fluent-drawer-body",{key:"7bc99c7657ad3fb8091848b95795e6335dd2527c"},this.hasTitle?o("slot",{name:"title",slot:"title"}):o("udp-text",{variant:"subtitle1",slot:"title"},this.drawerTitle),o("udp-fluent-icon-button",{key:"064b541cf629e6fbb8c1d3ed5c5c3f23b125132d",slot:"close",appearance:"subtle",iconName:"dismiss","aria-label":"close"}),this.hasToolbar&&o("udp-flexbox",{key:"475f3959438ae9010487bb9f2dd2ad783b865b64",class:"drawer-toolbar",direction:"row",width:"100%"},o("slot",{key:"91d7fe3e7f77115c8754afa1e683d6526ff4dcd0",name:"toolbar"})),o("div",{key:"f8b28a6cf560f1bc9f717d9de6d7d2171854a4e4",class:"drawer-scroll-container",ref:t=>this.contentRef=t,onScroll:this.handleScroll},o("div",{key:"d3b38549ac0ee57b2dbc8b04d10e1c9a3c673a07",class:"scroll-shadow top "+(this.showTopShadow?"visible":"")}),o("div",{key:"80d6424a3a7130f50ee08d80bc8698feec46ce64",class:`drawer-content-inner${this.excludeVerticalPadding?" exclude-vertical":""}${this.excludeHorizontalPadding?" exclude-horizontal":""}${this.excludeBodyPadding?" no-body-padding":""}`},o("slot",{key:"869eb8f1ee2a4f58aacd9084a4955f597ea1d76b"})),o("div",{key:"2945958300f808bdc43ddd21ce05aad64b0350bb",class:"scroll-shadow bottom "+(this.showBottomShadow?"visible":"")})),this.hasFooter&&o("udp-flexbox",{key:"a87618d792e510eb4c3931a010df339054f6904b",slot:"footer",direction:"row"},o("slot",{key:"99390f456163d3ee0545d9db299046218291c2bc",name:"footer"})))))}get el(){return this}static get watchers(){return{open:[{handleOpenChange:0}],size:[{handleSizeChange:0}],drawerWidth:[{updateDrawerWidth:0}]}}static get style(){return'fluent-drawer-body{padding:0;background-color:var(--colorNeutralBackground1)}:host(.body-muted) fluent-drawer-body{background-color:var(--colorNeutralBackground2)}fluent-drawer-body::part(header){background:var(--colorNeutralBackground1);overflow:visible;padding:var(--spacingHorizontalM);border-bottom:1px solid var(--colorNeutralStroke3)}fluent-drawer-body::part(content){overflow:hidden;display:flex;flex-direction:column;flex:1 1 auto;min-height:0;padding:0}fluent-button[slot="close"]{margin:2px;}fluent-drawer-body::part(footer){display:none}.drawer-toolbar{position:relative;z-index:10;background:var(--colorNeutralBackground1);padding:var(--spacingVerticalNone) var(--spacingHorizontalM);border-bottom:1px solid var(--colorNeutralStroke2);width:100%}.drawer-scroll-container{padding:0;overflow-y:auto;flex:1 1 auto;min-height:0;position:relative;display:flex;flex-direction:column}.drawer-content-inner{padding:var(--spacingHorizontalM);padding-bottom:var(--spacingVerticalXXXL);flex:1 0 auto;}.drawer-content-inner.exclude-vertical{padding-top:0;padding-bottom:0}.drawer-content-inner.exclude-horizontal{padding-left:0;padding-right:0}.drawer-content-inner.no-body-padding{padding:0;display:flex;flex-direction:column;flex:1 1 auto;min-height:0}.drawer-content-inner.no-body-padding{padding:0;display:flex;flex-direction:column;flex:1 1 auto;min-height:0}.scroll-shadow{position:sticky;left:0;right:0;height:24px;z-index:100;pointer-events:none;opacity:0;transition:opacity 0.2s ease;flex-shrink:0}.scroll-shadow.visible{opacity:1}.scroll-shadow.top{top:0;margin-bottom:-24px;background:linear-gradient(to bottom, rgba(0, 0, 0, 0.12), transparent)}.scroll-shadow.bottom{bottom:0;margin-top:-24px;background:linear-gradient(to top, rgba(0, 0, 0, 0.12), transparent)}:host(.has-footer) fluent-drawer-body::part(footer){display:block;background:var(--colorNeutralBackground1);border-top:1px solid var(--colorNeutralStroke3);padding-top:var(--spacingVerticalS);padding-bottom:var(--spacingVerticalM);padding-left:var(--spacingHorizontalM);padding-right:var(--spacingHorizontalM)}'}},[257,"udp-fluent-drawer",{open:[4],drawerTitle:[1,"drawer-title"],size:[1],position:[1],drawerWidth:[1,"drawer-width"],excludeVerticalPadding:[4,"exclude-vertical-padding"],excludeHorizontalPadding:[4,"exclude-horizontal-padding"],excludeBodyPadding:[4,"exclude-body-padding"],bodyBackground:[1,"body-background"],preventAutoClose:[4,"prevent-auto-close"],hasFooter:[32],hasToolbar:[32],hasTitle:[32],showTopShadow:[32],showBottomShadow:[32],effectiveSize:[32]},void 0,{open:[{handleOpenChange:0}],size:[{handleSizeChange:0}],drawerWidth:[{updateDrawerWidth:0}]}]);function f(){"undefined"!=typeof customElements&&["udp-fluent-drawer","udp-flexbox","udp-fluent-button","udp-fluent-icon","udp-fluent-icon-button","udp-spinner","udp-text"].forEach((t=>{switch(t){case"udp-fluent-drawer":customElements.get(d(t))||customElements.define(d(t),p);break;case"udp-flexbox":customElements.get(d(t))||n();break;case"udp-fluent-button":customElements.get(d(t))||r();break;case"udp-fluent-icon":customElements.get(d(t))||a();break;case"udp-fluent-icon-button":customElements.get(d(t))||l();break;case"udp-spinner":customElements.get(d(t))||h();break;case"udp-text":customElements.get(d(t))||c()}}))}p.openDrawers=new Set,p.unlockTimer=null,p.UNLOCK_DELAY_MS=300,p.originalBodyStyles=null;export{p as U,f as d}
|
package/dist/docs.json
CHANGED
|
@@ -8250,6 +8250,7 @@ const UdpFluentDrawer = class {
|
|
|
8250
8250
|
this.checkScrollShadows();
|
|
8251
8251
|
};
|
|
8252
8252
|
this.handleToggle = (e) => {
|
|
8253
|
+
var _a, _b;
|
|
8253
8254
|
// Disclosure widgets inside the drawer (Fluent tree items, native popovers) emit
|
|
8254
8255
|
// bubbling `toggle` events with the same shape — collapsing a tree node must not
|
|
8255
8256
|
// read as the drawer closing. Only the drawer's own toggle drives open/close.
|
|
@@ -8269,6 +8270,12 @@ const UdpFluentDrawer = class {
|
|
|
8269
8270
|
}
|
|
8270
8271
|
}
|
|
8271
8272
|
else if (e.detail.newState === 'open') {
|
|
8273
|
+
// Fluent's show() lands a frame later; if `open` went false meanwhile, the close
|
|
8274
|
+
// has already run, so undo the late open quietly (no toggle, no drawerClose).
|
|
8275
|
+
if (!this.open) {
|
|
8276
|
+
(_b = (_a = this.drawerRef) === null || _a === void 0 ? void 0 : _a.dialog) === null || _b === void 0 ? void 0 : _b.close();
|
|
8277
|
+
return;
|
|
8278
|
+
}
|
|
8272
8279
|
if (!this.isLocked) {
|
|
8273
8280
|
this.handleLock(true);
|
|
8274
8281
|
this.isLocked = true;
|
|
@@ -8301,6 +8308,11 @@ const UdpFluentDrawer = class {
|
|
|
8301
8308
|
const hide = (_c = this.originalHide) !== null && _c !== void 0 ? _c : this.drawerRef.hide.bind(this.drawerRef);
|
|
8302
8309
|
hide();
|
|
8303
8310
|
}
|
|
8311
|
+
else if (this.isLocked) {
|
|
8312
|
+
// A show still pending (locked by the fallback) gets no closing toggle; release here.
|
|
8313
|
+
this.handleLock(false);
|
|
8314
|
+
this.isLocked = false;
|
|
8315
|
+
}
|
|
8304
8316
|
}
|
|
8305
8317
|
}
|
|
8306
8318
|
handleSizeChange() {
|
|
@@ -8324,11 +8336,13 @@ const UdpFluentDrawer = class {
|
|
|
8324
8336
|
* Sync initial open state after component loads.
|
|
8325
8337
|
*/
|
|
8326
8338
|
componentDidLoad() {
|
|
8327
|
-
var _a;
|
|
8339
|
+
var _a, _b, _c;
|
|
8328
8340
|
// Initialize effectiveSize after render when window dimensions are accurate
|
|
8329
8341
|
this.calculateEffectiveSize();
|
|
8330
8342
|
if (this.open) {
|
|
8331
|
-
|
|
8343
|
+
// The open watcher may already have shown it.
|
|
8344
|
+
if (!((_b = (_a = this.drawerRef) === null || _a === void 0 ? void 0 : _a.dialog) === null || _b === void 0 ? void 0 : _b.open))
|
|
8345
|
+
(_c = this.drawerRef) === null || _c === void 0 ? void 0 : _c.show();
|
|
8332
8346
|
if (!this.isLocked) {
|
|
8333
8347
|
this.handleLock(true);
|
|
8334
8348
|
this.isLocked = true;
|
|
@@ -8574,7 +8588,7 @@ const UdpFluentDrawer = class {
|
|
|
8574
8588
|
}
|
|
8575
8589
|
}
|
|
8576
8590
|
render() {
|
|
8577
|
-
return (h(Host, { key: '
|
|
8591
|
+
return (h(Host, { key: '3c97f812210b6afb63919f0459bfc9a7fc4a70f7', class: { 'has-footer': this.hasFooter, 'body-muted': this.bodyBackground === 'muted' } }, h("fluent-drawer", { key: '82bcdb32811adb0fa71c6945385dc0990ffe5800', ref: this.setDrawerRef, onToggle: this.handleToggle, type: "modal", position: this.position, size: this.effectiveSize }, h("fluent-drawer-body", { key: '7bc99c7657ad3fb8091848b95795e6335dd2527c' }, this.hasTitle ? (h("slot", { name: "title", slot: "title" })) : (h("udp-text", { variant: "subtitle1", slot: "title" }, this.drawerTitle)), h("udp-fluent-icon-button", { key: '064b541cf629e6fbb8c1d3ed5c5c3f23b125132d', slot: "close", appearance: "subtle", iconName: "dismiss", "aria-label": "close" }), this.hasToolbar && (h("udp-flexbox", { key: '475f3959438ae9010487bb9f2dd2ad783b865b64', class: "drawer-toolbar", direction: "row", width: "100%" }, h("slot", { key: '91d7fe3e7f77115c8754afa1e683d6526ff4dcd0', name: "toolbar" }))), h("div", { key: 'f8b28a6cf560f1bc9f717d9de6d7d2171854a4e4', class: "drawer-scroll-container", ref: el => (this.contentRef = el), onScroll: this.handleScroll }, h("div", { key: 'd3b38549ac0ee57b2dbc8b04d10e1c9a3c673a07', class: `scroll-shadow top ${this.showTopShadow ? 'visible' : ''}` }), h("div", { key: '80d6424a3a7130f50ee08d80bc8698feec46ce64', class: `drawer-content-inner${this.excludeVerticalPadding ? ' exclude-vertical' : ''}${this.excludeHorizontalPadding ? ' exclude-horizontal' : ''}${this.excludeBodyPadding ? ' no-body-padding' : ''}` }, h("slot", { key: '869eb8f1ee2a4f58aacd9084a4955f597ea1d76b' })), h("div", { key: '2945958300f808bdc43ddd21ce05aad64b0350bb', class: `scroll-shadow bottom ${this.showBottomShadow ? 'visible' : ''}` })), this.hasFooter && (h("udp-flexbox", { key: 'a87618d792e510eb4c3931a010df339054f6904b', slot: "footer", direction: "row" }, h("slot", { key: '99390f456163d3ee0545d9db299046218291c2bc', name: "footer" })))))));
|
|
8578
8592
|
}
|
|
8579
8593
|
get el() { return getElement(this); }
|
|
8580
8594
|
static get watchers() { return {
|