@fluentui/react-positioning 9.4.2 → 9.5.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.json CHANGED
@@ -2,7 +2,37 @@
2
2
  "name": "@fluentui/react-positioning",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 13 Feb 2023 23:40:50 GMT",
5
+ "date": "Wed, 22 Feb 2023 23:04:47 GMT",
6
+ "tag": "@fluentui/react-positioning_v9.5.0",
7
+ "version": "9.5.0",
8
+ "comments": {
9
+ "minor": [
10
+ {
11
+ "author": "lingfangao@hotmail.com",
12
+ "package": "@fluentui/react-positioning",
13
+ "commit": "9231f2bdb426a3f8223335cccac171a68ecbb485",
14
+ "comment": "feat: Set overflow on positioned element when `autosize` is applied"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Wed, 15 Feb 2023 11:44:52 GMT",
21
+ "tag": "@fluentui/react-positioning_v9.4.3",
22
+ "version": "9.4.3",
23
+ "comments": {
24
+ "patch": [
25
+ {
26
+ "author": "beachball",
27
+ "package": "@fluentui/react-positioning",
28
+ "comment": "Bump @fluentui/react-utilities to v9.6.0",
29
+ "commit": "087d981aab96bef2e332a373069a19bc702a7ca2"
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ {
35
+ "date": "Mon, 13 Feb 2023 23:43:14 GMT",
6
36
  "tag": "@fluentui/react-positioning_v9.4.2",
7
37
  "version": "9.4.2",
8
38
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,30 @@
1
1
  # Change Log - @fluentui/react-positioning
2
2
 
3
- This log was last generated on Mon, 13 Feb 2023 23:40:50 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 22 Feb 2023 23:04:47 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.5.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.5.0)
8
+
9
+ Wed, 22 Feb 2023 23:04:47 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.4.3..@fluentui/react-positioning_v9.5.0)
11
+
12
+ ### Minor changes
13
+
14
+ - feat: Set overflow on positioned element when `autosize` is applied ([PR #26868](https://github.com/microsoft/fluentui/pull/26868) by lingfangao@hotmail.com)
15
+
16
+ ## [9.4.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.4.3)
17
+
18
+ Wed, 15 Feb 2023 11:44:52 GMT
19
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.4.2..@fluentui/react-positioning_v9.4.3)
20
+
21
+ ### Patches
22
+
23
+ - Bump @fluentui/react-utilities to v9.6.0 ([PR #26845](https://github.com/microsoft/fluentui/pull/26845) by beachball)
24
+
7
25
  ## [9.4.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.4.2)
8
26
 
9
- Mon, 13 Feb 2023 23:40:50 GMT
27
+ Mon, 13 Feb 2023 23:43:14 GMT
10
28
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.4.1..@fluentui/react-positioning_v9.4.2)
11
29
 
12
30
  ### Patches
@@ -21,13 +21,15 @@ export function maxSize(autoSize, options) {
21
21
  if (applyMaxHeight) {
22
22
  Object.assign(elements.floating.style, {
23
23
  maxHeight: `${availableHeight}px`,
24
- boxSizing: 'border-box'
24
+ boxSizing: 'border-box',
25
+ overflowY: 'auto'
25
26
  });
26
27
  }
27
28
  if (applyMaxWidth) {
28
29
  Object.assign(elements.floating.style, {
29
30
  maxWidth: `${availableWidth}px`,
30
- boxSizing: 'border-box'
31
+ boxSizing: 'border-box',
32
+ overflowX: 'auto'
31
33
  });
32
34
  }
33
35
  }
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,SAASA,IAAI,QAAQ,kBAAkB;AAGvC,SAASC,WAAW,QAAQ,sBAAsB;AAKlD,OAAM,SAAUC,OAAO,CAACC,QAAwC,EAAEC,OAAiC;EACjG,MAAM;IAAEC,SAAS;IAAEC;EAAgB,CAAE,GAAGF,OAAO;EAC/C,OAAOJ,IAAI,CAAC;IACV,IAAIM,gBAAgB,IAAI;MAAEC,WAAW,EAAE,IAAI;MAAEC,QAAQ,EAAEP,WAAW,CAACI,SAAS,EAAEC,gBAAgB;IAAC,CAAE,CAAC;IAClGG,KAAK,CAAC;MAAEC,eAAe;MAAEC,cAAc;MAAEC,QAAQ;MAAEC;IAAK,CAAE;MACxD,MAAMC,aAAa,GACjBX,QAAQ,KAAK,QAAQ,IACrBA,QAAQ,KAAK,cAAc,IAC1BU,KAAK,CAACE,QAAQ,CAACC,KAAK,GAAGL,cAAc,KAAKR,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAK,OAAO,CAAE;MAExF,MAAMc,cAAc,GAClBd,QAAQ,KAAK,QAAQ,IACrBA,QAAQ,KAAK,eAAe,IAC3BU,KAAK,CAACE,QAAQ,CAACG,MAAM,GAAGR,eAAe,KAAKP,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAK,QAAQ,CAAE;MAE3F,IAAIc,cAAc,EAAE;QAClBE,MAAM,CAACC,MAAM,CAACR,QAAQ,CAACG,QAAQ,CAACM,KAAK,EAAE;UACrCC,SAAS,EAAE,GAAGZ,eAAe,IAAI;UACjCa,SAAS,EAAE;SACZ,CAAC;;MAGJ,IAAIT,aAAa,EAAE;QACjBK,MAAM,CAACC,MAAM,CAACR,QAAQ,CAACG,QAAQ,CAACM,KAAK,EAAE;UACrCG,QAAQ,EAAE,GAAGb,cAAc,IAAI;UAC/BY,SAAS,EAAE;SACZ,CAAC;;IAEN;GACD,CAAC;AACJ","names":["size","getBoundary","maxSize","autoSize","options","container","overflowBoundary","altBoundary","boundary","apply","availableHeight","availableWidth","elements","rects","applyMaxWidth","floating","width","applyMaxHeight","height","Object","assign","style","maxHeight","boxSizing","maxWidth"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/middleware/maxSize.ts"],"sourcesContent":["import { size } from '@floating-ui/dom';\nimport type { Middleware } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary } from '../utils/getBoundary';\nexport interface MaxSizeMiddlewareOptions extends Pick<PositioningOptions, 'overflowBoundary'> {\n container: HTMLElement | null;\n}\n\nexport function maxSize(autoSize: PositioningOptions['autoSize'], options: MaxSizeMiddlewareOptions): Middleware {\n const { container, overflowBoundary } = options;\n return size({\n ...(overflowBoundary && { altBoundary: true, boundary: getBoundary(container, overflowBoundary) }),\n apply({ availableHeight, availableWidth, elements, rects }) {\n const applyMaxWidth =\n autoSize === 'always' ||\n autoSize === 'width-always' ||\n (rects.floating.width > availableWidth && (autoSize === true || autoSize === 'width'));\n\n const applyMaxHeight =\n autoSize === 'always' ||\n autoSize === 'height-always' ||\n (rects.floating.height > availableHeight && (autoSize === true || autoSize === 'height'));\n\n if (applyMaxHeight) {\n Object.assign(elements.floating.style, {\n maxHeight: `${availableHeight}px`,\n boxSizing: 'border-box',\n });\n }\n\n if (applyMaxWidth) {\n Object.assign(elements.floating.style, {\n maxWidth: `${availableWidth}px`,\n boxSizing: 'border-box',\n });\n }\n },\n });\n}\n"]}
1
+ {"version":3,"mappings":"AAAA,SAASA,IAAI,QAAQ,kBAAkB;AAGvC,SAASC,WAAW,QAAQ,sBAAsB;AAKlD,OAAM,SAAUC,OAAO,CAACC,QAAwC,EAAEC,OAAiC;EACjG,MAAM;IAAEC,SAAS;IAAEC;EAAgB,CAAE,GAAGF,OAAO;EAC/C,OAAOJ,IAAI,CAAC;IACV,IAAIM,gBAAgB,IAAI;MAAEC,WAAW,EAAE,IAAI;MAAEC,QAAQ,EAAEP,WAAW,CAACI,SAAS,EAAEC,gBAAgB;IAAC,CAAE,CAAC;IAClGG,KAAK,CAAC;MAAEC,eAAe;MAAEC,cAAc;MAAEC,QAAQ;MAAEC;IAAK,CAAE;MACxD,MAAMC,aAAa,GACjBX,QAAQ,KAAK,QAAQ,IACrBA,QAAQ,KAAK,cAAc,IAC1BU,KAAK,CAACE,QAAQ,CAACC,KAAK,GAAGL,cAAc,KAAKR,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAK,OAAO,CAAE;MAExF,MAAMc,cAAc,GAClBd,QAAQ,KAAK,QAAQ,IACrBA,QAAQ,KAAK,eAAe,IAC3BU,KAAK,CAACE,QAAQ,CAACG,MAAM,GAAGR,eAAe,KAAKP,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAK,QAAQ,CAAE;MAE3F,IAAIc,cAAc,EAAE;QAClBE,MAAM,CAACC,MAAM,CAAoDR,QAAQ,CAACG,QAAQ,CAACM,KAAK,EAAE;UACxFC,SAAS,EAAE,GAAGZ,eAAe,IAAI;UACjCa,SAAS,EAAE,YAAY;UACvBC,SAAS,EAAE;SACZ,CAAC;;MAGJ,IAAIV,aAAa,EAAE;QACjBK,MAAM,CAACC,MAAM,CAAoDR,QAAQ,CAACG,QAAQ,CAACM,KAAK,EAAE;UACxFI,QAAQ,EAAE,GAAGd,cAAc,IAAI;UAC/BY,SAAS,EAAE,YAAY;UACvBG,SAAS,EAAE;SACZ,CAAC;;IAEN;GACD,CAAC;AACJ","names":["size","getBoundary","maxSize","autoSize","options","container","overflowBoundary","altBoundary","boundary","apply","availableHeight","availableWidth","elements","rects","applyMaxWidth","floating","width","applyMaxHeight","height","Object","assign","style","maxHeight","boxSizing","overflowY","maxWidth","overflowX"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/middleware/maxSize.ts"],"sourcesContent":["import { size } from '@floating-ui/dom';\nimport type { Middleware } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary } from '../utils/getBoundary';\nexport interface MaxSizeMiddlewareOptions extends Pick<PositioningOptions, 'overflowBoundary'> {\n container: HTMLElement | null;\n}\n\nexport function maxSize(autoSize: PositioningOptions['autoSize'], options: MaxSizeMiddlewareOptions): Middleware {\n const { container, overflowBoundary } = options;\n return size({\n ...(overflowBoundary && { altBoundary: true, boundary: getBoundary(container, overflowBoundary) }),\n apply({ availableHeight, availableWidth, elements, rects }) {\n const applyMaxWidth =\n autoSize === 'always' ||\n autoSize === 'width-always' ||\n (rects.floating.width > availableWidth && (autoSize === true || autoSize === 'width'));\n\n const applyMaxHeight =\n autoSize === 'always' ||\n autoSize === 'height-always' ||\n (rects.floating.height > availableHeight && (autoSize === true || autoSize === 'height'));\n\n if (applyMaxHeight) {\n Object.assign<CSSStyleDeclaration, Partial<CSSStyleDeclaration>>(elements.floating.style, {\n maxHeight: `${availableHeight}px`,\n boxSizing: 'border-box',\n overflowY: 'auto',\n });\n }\n\n if (applyMaxWidth) {\n Object.assign<CSSStyleDeclaration, Partial<CSSStyleDeclaration>>(elements.floating.style, {\n maxWidth: `${availableWidth}px`,\n boxSizing: 'border-box',\n overflowX: 'auto',\n });\n }\n },\n });\n}\n"]}
@@ -16,12 +16,14 @@ define(["require", "exports", "tslib", "@floating-ui/dom", "../utils/getBoundary
16
16
  Object.assign(elements.floating.style, {
17
17
  maxHeight: availableHeight + "px",
18
18
  boxSizing: 'border-box',
19
+ overflowY: 'auto',
19
20
  });
20
21
  }
21
22
  if (applyMaxWidth) {
22
23
  Object.assign(elements.floating.style, {
23
24
  maxWidth: availableWidth + "px",
24
25
  boxSizing: 'border-box',
26
+ overflowX: 'auto',
25
27
  });
26
28
  }
27
29
  } }));
@@ -1 +1 @@
1
- {"version":3,"file":"maxSize.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-positioning/src/middleware/maxSize.ts"],"names":[],"mappings":";;;;IAQA,SAAgB,OAAO,CAAC,QAAwC,EAAE,OAAiC;QACzF,IAAA,SAAS,GAAuB,OAAO,UAA9B,EAAE,gBAAgB,GAAK,OAAO,iBAAZ,CAAa;QAChD,OAAO,UAAI,uCACN,CAAC,gBAAgB,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,yBAAW,CAAC,SAAS,EAAE,gBAAgB,CAAC,EAAE,CAAC,KAClG,KAAK,YAAC,EAAoD;oBAAlD,eAAe,qBAAA,EAAE,cAAc,oBAAA,EAAE,QAAQ,cAAA,EAAE,KAAK,WAAA;gBACtD,IAAM,aAAa,GACjB,QAAQ,KAAK,QAAQ;oBACrB,QAAQ,KAAK,cAAc;oBAC3B,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,GAAG,cAAc,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC;gBAEzF,IAAM,cAAc,GAClB,QAAQ,KAAK,QAAQ;oBACrB,QAAQ,KAAK,eAAe;oBAC5B,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,eAAe,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC;gBAE5F,IAAI,cAAc,EAAE;oBAClB,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE;wBACrC,SAAS,EAAK,eAAe,OAAI;wBACjC,SAAS,EAAE,YAAY;qBACxB,CAAC,CAAC;iBACJ;gBAED,IAAI,aAAa,EAAE;oBACjB,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE;wBACrC,QAAQ,EAAK,cAAc,OAAI;wBAC/B,SAAS,EAAE,YAAY;qBACxB,CAAC,CAAC;iBACJ;YACH,CAAC,IACD,CAAC;IACL,CAAC;IA9BD,0BA8BC","sourcesContent":["import { size } from '@floating-ui/dom';\nimport type { Middleware } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary } from '../utils/getBoundary';\nexport interface MaxSizeMiddlewareOptions extends Pick<PositioningOptions, 'overflowBoundary'> {\n container: HTMLElement | null;\n}\n\nexport function maxSize(autoSize: PositioningOptions['autoSize'], options: MaxSizeMiddlewareOptions): Middleware {\n const { container, overflowBoundary } = options;\n return size({\n ...(overflowBoundary && { altBoundary: true, boundary: getBoundary(container, overflowBoundary) }),\n apply({ availableHeight, availableWidth, elements, rects }) {\n const applyMaxWidth =\n autoSize === 'always' ||\n autoSize === 'width-always' ||\n (rects.floating.width > availableWidth && (autoSize === true || autoSize === 'width'));\n\n const applyMaxHeight =\n autoSize === 'always' ||\n autoSize === 'height-always' ||\n (rects.floating.height > availableHeight && (autoSize === true || autoSize === 'height'));\n\n if (applyMaxHeight) {\n Object.assign(elements.floating.style, {\n maxHeight: `${availableHeight}px`,\n boxSizing: 'border-box',\n });\n }\n\n if (applyMaxWidth) {\n Object.assign(elements.floating.style, {\n maxWidth: `${availableWidth}px`,\n boxSizing: 'border-box',\n });\n }\n },\n });\n}\n"]}
1
+ {"version":3,"file":"maxSize.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-positioning/src/middleware/maxSize.ts"],"names":[],"mappings":";;;;IAQA,SAAgB,OAAO,CAAC,QAAwC,EAAE,OAAiC;QACzF,IAAA,SAAS,GAAuB,OAAO,UAA9B,EAAE,gBAAgB,GAAK,OAAO,iBAAZ,CAAa;QAChD,OAAO,UAAI,uCACN,CAAC,gBAAgB,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,yBAAW,CAAC,SAAS,EAAE,gBAAgB,CAAC,EAAE,CAAC,KAClG,KAAK,EAAL,UAAM,EAAoD;oBAAlD,eAAe,qBAAA,EAAE,cAAc,oBAAA,EAAE,QAAQ,cAAA,EAAE,KAAK,WAAA;gBACtD,IAAM,aAAa,GACjB,QAAQ,KAAK,QAAQ;oBACrB,QAAQ,KAAK,cAAc;oBAC3B,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,GAAG,cAAc,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC;gBAEzF,IAAM,cAAc,GAClB,QAAQ,KAAK,QAAQ;oBACrB,QAAQ,KAAK,eAAe;oBAC5B,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,eAAe,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC;gBAE5F,IAAI,cAAc,EAAE;oBAClB,MAAM,CAAC,MAAM,CAAoD,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE;wBACxF,SAAS,EAAK,eAAe,OAAI;wBACjC,SAAS,EAAE,YAAY;wBACvB,SAAS,EAAE,MAAM;qBAClB,CAAC,CAAC;iBACJ;gBAED,IAAI,aAAa,EAAE;oBACjB,MAAM,CAAC,MAAM,CAAoD,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE;wBACxF,QAAQ,EAAK,cAAc,OAAI;wBAC/B,SAAS,EAAE,YAAY;wBACvB,SAAS,EAAE,MAAM;qBAClB,CAAC,CAAC;iBACJ;YACH,CAAC,IACD,CAAC;IACL,CAAC;IAhCD,0BAgCC","sourcesContent":["import { size } from '@floating-ui/dom';\nimport type { Middleware } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary } from '../utils/getBoundary';\nexport interface MaxSizeMiddlewareOptions extends Pick<PositioningOptions, 'overflowBoundary'> {\n container: HTMLElement | null;\n}\n\nexport function maxSize(autoSize: PositioningOptions['autoSize'], options: MaxSizeMiddlewareOptions): Middleware {\n const { container, overflowBoundary } = options;\n return size({\n ...(overflowBoundary && { altBoundary: true, boundary: getBoundary(container, overflowBoundary) }),\n apply({ availableHeight, availableWidth, elements, rects }) {\n const applyMaxWidth =\n autoSize === 'always' ||\n autoSize === 'width-always' ||\n (rects.floating.width > availableWidth && (autoSize === true || autoSize === 'width'));\n\n const applyMaxHeight =\n autoSize === 'always' ||\n autoSize === 'height-always' ||\n (rects.floating.height > availableHeight && (autoSize === true || autoSize === 'height'));\n\n if (applyMaxHeight) {\n Object.assign<CSSStyleDeclaration, Partial<CSSStyleDeclaration>>(elements.floating.style, {\n maxHeight: `${availableHeight}px`,\n boxSizing: 'border-box',\n overflowY: 'auto',\n });\n }\n\n if (applyMaxWidth) {\n Object.assign<CSSStyleDeclaration, Partial<CSSStyleDeclaration>>(elements.floating.style, {\n maxWidth: `${availableWidth}px`,\n boxSizing: 'border-box',\n overflowX: 'auto',\n });\n }\n },\n });\n}\n"]}
@@ -27,13 +27,15 @@ function maxSize(autoSize, options) {
27
27
  if (applyMaxHeight) {
28
28
  Object.assign(elements.floating.style, {
29
29
  maxHeight: `${availableHeight}px`,
30
- boxSizing: 'border-box'
30
+ boxSizing: 'border-box',
31
+ overflowY: 'auto'
31
32
  });
32
33
  }
33
34
  if (applyMaxWidth) {
34
35
  Object.assign(elements.floating.style, {
35
36
  maxWidth: `${availableWidth}px`,
36
- boxSizing: 'border-box'
37
+ boxSizing: 'border-box',
38
+ overflowX: 'auto'
37
39
  });
38
40
  }
39
41
  }
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AAGA;AAKA,SAAgBA,OAAO,CAACC,QAAwC,EAAEC,OAAiC;EACjG,MAAM;IAAEC,SAAS;IAAEC;EAAgB,CAAE,GAAGF,OAAO;EAC/C,OAAOG,UAAI,CAAC;IACV,IAAID,gBAAgB,IAAI;MAAEE,WAAW,EAAE,IAAI;MAAEC,QAAQ,EAAEC,yBAAW,CAACL,SAAS,EAAEC,gBAAgB;IAAC,CAAE,CAAC;IAClGK,KAAK,CAAC;MAAEC,eAAe;MAAEC,cAAc;MAAEC,QAAQ;MAAEC;IAAK,CAAE;MACxD,MAAMC,aAAa,GACjBb,QAAQ,KAAK,QAAQ,IACrBA,QAAQ,KAAK,cAAc,IAC1BY,KAAK,CAACE,QAAQ,CAACC,KAAK,GAAGL,cAAc,KAAKV,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAK,OAAO,CAAE;MAExF,MAAMgB,cAAc,GAClBhB,QAAQ,KAAK,QAAQ,IACrBA,QAAQ,KAAK,eAAe,IAC3BY,KAAK,CAACE,QAAQ,CAACG,MAAM,GAAGR,eAAe,KAAKT,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAK,QAAQ,CAAE;MAE3F,IAAIgB,cAAc,EAAE;QAClBE,MAAM,CAACC,MAAM,CAACR,QAAQ,CAACG,QAAQ,CAACM,KAAK,EAAE;UACrCC,SAAS,EAAE,GAAGZ,eAAe,IAAI;UACjCa,SAAS,EAAE;SACZ,CAAC;;MAGJ,IAAIT,aAAa,EAAE;QACjBK,MAAM,CAACC,MAAM,CAACR,QAAQ,CAACG,QAAQ,CAACM,KAAK,EAAE;UACrCG,QAAQ,EAAE,GAAGb,cAAc,IAAI;UAC/BY,SAAS,EAAE;SACZ,CAAC;;IAEN;GACD,CAAC;AACJ;AA9BAE","names":["maxSize","autoSize","options","container","overflowBoundary","dom_1","altBoundary","boundary","getBoundary_1","apply","availableHeight","availableWidth","elements","rects","applyMaxWidth","floating","width","applyMaxHeight","height","Object","assign","style","maxHeight","boxSizing","maxWidth","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/middleware/maxSize.ts"],"sourcesContent":["import { size } from '@floating-ui/dom';\nimport type { Middleware } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary } from '../utils/getBoundary';\nexport interface MaxSizeMiddlewareOptions extends Pick<PositioningOptions, 'overflowBoundary'> {\n container: HTMLElement | null;\n}\n\nexport function maxSize(autoSize: PositioningOptions['autoSize'], options: MaxSizeMiddlewareOptions): Middleware {\n const { container, overflowBoundary } = options;\n return size({\n ...(overflowBoundary && { altBoundary: true, boundary: getBoundary(container, overflowBoundary) }),\n apply({ availableHeight, availableWidth, elements, rects }) {\n const applyMaxWidth =\n autoSize === 'always' ||\n autoSize === 'width-always' ||\n (rects.floating.width > availableWidth && (autoSize === true || autoSize === 'width'));\n\n const applyMaxHeight =\n autoSize === 'always' ||\n autoSize === 'height-always' ||\n (rects.floating.height > availableHeight && (autoSize === true || autoSize === 'height'));\n\n if (applyMaxHeight) {\n Object.assign(elements.floating.style, {\n maxHeight: `${availableHeight}px`,\n boxSizing: 'border-box',\n });\n }\n\n if (applyMaxWidth) {\n Object.assign(elements.floating.style, {\n maxWidth: `${availableWidth}px`,\n boxSizing: 'border-box',\n });\n }\n },\n });\n}\n"]}
1
+ {"version":3,"mappings":";;;;;;AAAA;AAGA;AAKA,SAAgBA,OAAO,CAACC,QAAwC,EAAEC,OAAiC;EACjG,MAAM;IAAEC,SAAS;IAAEC;EAAgB,CAAE,GAAGF,OAAO;EAC/C,OAAOG,UAAI,CAAC;IACV,IAAID,gBAAgB,IAAI;MAAEE,WAAW,EAAE,IAAI;MAAEC,QAAQ,EAAEC,yBAAW,CAACL,SAAS,EAAEC,gBAAgB;IAAC,CAAE,CAAC;IAClGK,KAAK,CAAC;MAAEC,eAAe;MAAEC,cAAc;MAAEC,QAAQ;MAAEC;IAAK,CAAE;MACxD,MAAMC,aAAa,GACjBb,QAAQ,KAAK,QAAQ,IACrBA,QAAQ,KAAK,cAAc,IAC1BY,KAAK,CAACE,QAAQ,CAACC,KAAK,GAAGL,cAAc,KAAKV,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAK,OAAO,CAAE;MAExF,MAAMgB,cAAc,GAClBhB,QAAQ,KAAK,QAAQ,IACrBA,QAAQ,KAAK,eAAe,IAC3BY,KAAK,CAACE,QAAQ,CAACG,MAAM,GAAGR,eAAe,KAAKT,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAK,QAAQ,CAAE;MAE3F,IAAIgB,cAAc,EAAE;QAClBE,MAAM,CAACC,MAAM,CAAoDR,QAAQ,CAACG,QAAQ,CAACM,KAAK,EAAE;UACxFC,SAAS,EAAE,GAAGZ,eAAe,IAAI;UACjCa,SAAS,EAAE,YAAY;UACvBC,SAAS,EAAE;SACZ,CAAC;;MAGJ,IAAIV,aAAa,EAAE;QACjBK,MAAM,CAACC,MAAM,CAAoDR,QAAQ,CAACG,QAAQ,CAACM,KAAK,EAAE;UACxFI,QAAQ,EAAE,GAAGd,cAAc,IAAI;UAC/BY,SAAS,EAAE,YAAY;UACvBG,SAAS,EAAE;SACZ,CAAC;;IAEN;GACD,CAAC;AACJ;AAhCAC","names":["maxSize","autoSize","options","container","overflowBoundary","dom_1","altBoundary","boundary","getBoundary_1","apply","availableHeight","availableWidth","elements","rects","applyMaxWidth","floating","width","applyMaxHeight","height","Object","assign","style","maxHeight","boxSizing","overflowY","maxWidth","overflowX","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/middleware/maxSize.ts"],"sourcesContent":["import { size } from '@floating-ui/dom';\nimport type { Middleware } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary } from '../utils/getBoundary';\nexport interface MaxSizeMiddlewareOptions extends Pick<PositioningOptions, 'overflowBoundary'> {\n container: HTMLElement | null;\n}\n\nexport function maxSize(autoSize: PositioningOptions['autoSize'], options: MaxSizeMiddlewareOptions): Middleware {\n const { container, overflowBoundary } = options;\n return size({\n ...(overflowBoundary && { altBoundary: true, boundary: getBoundary(container, overflowBoundary) }),\n apply({ availableHeight, availableWidth, elements, rects }) {\n const applyMaxWidth =\n autoSize === 'always' ||\n autoSize === 'width-always' ||\n (rects.floating.width > availableWidth && (autoSize === true || autoSize === 'width'));\n\n const applyMaxHeight =\n autoSize === 'always' ||\n autoSize === 'height-always' ||\n (rects.floating.height > availableHeight && (autoSize === true || autoSize === 'height'));\n\n if (applyMaxHeight) {\n Object.assign<CSSStyleDeclaration, Partial<CSSStyleDeclaration>>(elements.floating.style, {\n maxHeight: `${availableHeight}px`,\n boxSizing: 'border-box',\n overflowY: 'auto',\n });\n }\n\n if (applyMaxWidth) {\n Object.assign<CSSStyleDeclaration, Partial<CSSStyleDeclaration>>(elements.floating.style, {\n maxWidth: `${availableWidth}px`,\n boxSizing: 'border-box',\n overflowX: 'auto',\n });\n }\n },\n });\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-positioning",
3
- "version": "9.4.2",
3
+ "version": "9.5.0",
4
4
  "description": "A react wrapper around Popper.js for Fluent UI",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -31,7 +31,7 @@
31
31
  "@floating-ui/dom": "^1.2.0",
32
32
  "@fluentui/react-shared-contexts": "^9.2.0",
33
33
  "@fluentui/react-theme": "^9.1.5",
34
- "@fluentui/react-utilities": "^9.5.3",
34
+ "@fluentui/react-utilities": "^9.6.0",
35
35
  "@griffel/react": "^1.5.2",
36
36
  "tslib": "^2.1.0"
37
37
  },