@ktnpm_devops/react-component 0.24.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/constants.d.ts +6 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/data/DataTableCard/DataTableCard.d.ts +13 -0
- package/dist/data/DataTableCard/DataTableCard.d.ts.map +1 -0
- package/dist/data/DataTableCard/DataTableCard.types.d.ts +41 -0
- package/dist/data/DataTableCard/DataTableCard.types.d.ts.map +1 -0
- package/dist/data/DataTableCard/index.d.ts +3 -0
- package/dist/data/DataTableCard/index.d.ts.map +1 -0
- package/dist/data/LiveExplorerTable/LiveExplorerBody.d.ts +8 -0
- package/dist/data/LiveExplorerTable/LiveExplorerBody.d.ts.map +1 -0
- package/dist/data/LiveExplorerTable/LiveExplorerDataRow.d.ts +5 -0
- package/dist/data/LiveExplorerTable/LiveExplorerDataRow.d.ts.map +1 -0
- package/dist/data/LiveExplorerTable/LiveExplorerHeaderCell.d.ts +8 -0
- package/dist/data/LiveExplorerTable/LiveExplorerHeaderCell.d.ts.map +1 -0
- package/dist/data/LiveExplorerTable/LiveExplorerTable.d.ts +2 -2
- package/dist/data/LiveExplorerTable/LiveExplorerTable.d.ts.map +1 -1
- package/dist/data/LiveExplorerTable/LiveExplorerTable.types.d.ts +122 -25
- package/dist/data/LiveExplorerTable/LiveExplorerTable.types.d.ts.map +1 -1
- package/dist/data/LiveExplorerTable/columnClasses.d.ts +5 -0
- package/dist/data/LiveExplorerTable/columnClasses.d.ts.map +1 -0
- package/dist/data/LiveExplorerTable/groupRows.d.ts +8 -0
- package/dist/data/LiveExplorerTable/groupRows.d.ts.map +1 -0
- package/dist/data/LiveExplorerTable/groupRows.test.d.ts +2 -0
- package/dist/data/LiveExplorerTable/groupRows.test.d.ts.map +1 -0
- package/dist/data/LiveExplorerTable/index.d.ts +1 -1
- package/dist/data/LiveExplorerTable/index.d.ts.map +1 -1
- package/dist/data/LiveExplorerTable/nextSortState.d.ts +8 -0
- package/dist/data/LiveExplorerTable/nextSortState.d.ts.map +1 -0
- package/dist/data/LiveExplorerTable/nextSortState.test.d.ts +2 -0
- package/dist/data/LiveExplorerTable/nextSortState.test.d.ts.map +1 -0
- package/dist/data/LiveExplorerTable/useColumnResize.d.ts +8 -0
- package/dist/data/LiveExplorerTable/useColumnResize.d.ts.map +1 -0
- package/dist/index.cjs +34 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -32
- package/dist/index.js.map +1 -1
- package/dist/index10.cjs +2 -2
- package/dist/index10.js +2 -2
- package/dist/index100.cjs +6 -92
- package/dist/index100.cjs.map +1 -1
- package/dist/index100.js +5 -91
- package/dist/index100.js.map +1 -1
- package/dist/index101.cjs +19 -34
- package/dist/index101.cjs.map +1 -1
- package/dist/index101.js +20 -35
- package/dist/index101.js.map +1 -1
- package/dist/index102.cjs +39 -22
- package/dist/index102.cjs.map +1 -1
- package/dist/index102.js +38 -21
- package/dist/index102.js.map +1 -1
- package/dist/index103.cjs +30 -69
- package/dist/index103.cjs.map +1 -1
- package/dist/index103.js +29 -68
- package/dist/index103.js.map +1 -1
- package/dist/index104.cjs +6 -6
- package/dist/index104.cjs.map +1 -1
- package/dist/index104.js +5 -5
- package/dist/index104.js.map +1 -1
- package/dist/index105.cjs +15 -30
- package/dist/index105.cjs.map +1 -1
- package/dist/index105.js +16 -31
- package/dist/index105.js.map +1 -1
- package/dist/index106.cjs +21 -35
- package/dist/index106.cjs.map +1 -1
- package/dist/index106.js +20 -34
- package/dist/index106.js.map +1 -1
- package/dist/index107.cjs +30 -38
- package/dist/index107.cjs.map +1 -1
- package/dist/index107.js +30 -38
- package/dist/index107.js.map +1 -1
- package/dist/index108.cjs +41 -22
- package/dist/index108.cjs.map +1 -1
- package/dist/index108.js +42 -23
- package/dist/index108.js.map +1 -1
- package/dist/index109.cjs +17 -32
- package/dist/index109.cjs.map +1 -1
- package/dist/index109.js +17 -32
- package/dist/index109.js.map +1 -1
- package/dist/index11.cjs +2 -2
- package/dist/index11.js +2 -2
- package/dist/index110.cjs +39 -8
- package/dist/index110.cjs.map +1 -1
- package/dist/index110.js +39 -8
- package/dist/index110.js.map +1 -1
- package/dist/index111.cjs +8 -10
- package/dist/index111.cjs.map +1 -1
- package/dist/index111.js +8 -10
- package/dist/index111.js.map +1 -1
- package/dist/index112.cjs +10 -19
- package/dist/index112.cjs.map +1 -1
- package/dist/index112.js +10 -19
- package/dist/index112.js.map +1 -1
- package/dist/index113.cjs +18 -12
- package/dist/index113.cjs.map +1 -1
- package/dist/index113.js +19 -13
- package/dist/index113.js.map +1 -1
- package/dist/index114.cjs +13 -10
- package/dist/index114.cjs.map +1 -1
- package/dist/index114.js +13 -10
- package/dist/index114.js.map +1 -1
- package/dist/index115.cjs +10 -69
- package/dist/index115.cjs.map +1 -1
- package/dist/index115.js +9 -68
- package/dist/index115.js.map +1 -1
- package/dist/index116.cjs +64 -13
- package/dist/index116.cjs.map +1 -1
- package/dist/index116.js +65 -14
- package/dist/index116.js.map +1 -1
- package/dist/index117.cjs +20 -2
- package/dist/index117.cjs.map +1 -1
- package/dist/index117.js +20 -2
- package/dist/index117.js.map +1 -1
- package/dist/index118.cjs +70 -57
- package/dist/index118.cjs.map +1 -1
- package/dist/index118.js +69 -56
- package/dist/index118.js.map +1 -1
- package/dist/index119.cjs +50 -39
- package/dist/index119.cjs.map +1 -1
- package/dist/index119.js +49 -38
- package/dist/index119.js.map +1 -1
- package/dist/index12.cjs +2 -2
- package/dist/index12.js +2 -2
- package/dist/index120.cjs +6 -22
- package/dist/index120.cjs.map +1 -1
- package/dist/index120.js +5 -21
- package/dist/index120.js.map +1 -1
- package/dist/index121.cjs +25 -131
- package/dist/index121.cjs.map +1 -1
- package/dist/index121.js +26 -132
- package/dist/index121.js.map +1 -1
- package/dist/index122.cjs +82 -40
- package/dist/index122.cjs.map +1 -1
- package/dist/index122.js +82 -40
- package/dist/index122.js.map +1 -1
- package/dist/index123.cjs +2 -11
- package/dist/index123.cjs.map +1 -1
- package/dist/index123.js +2 -11
- package/dist/index123.js.map +1 -1
- package/dist/index124.cjs +15 -36
- package/dist/index124.cjs.map +1 -1
- package/dist/index124.js +16 -37
- package/dist/index124.js.map +1 -1
- package/dist/index125.cjs +2 -5
- package/dist/index125.cjs.map +1 -1
- package/dist/index125.js +2 -5
- package/dist/index125.js.map +1 -1
- package/dist/index126.cjs +25 -116
- package/dist/index126.cjs.map +1 -1
- package/dist/index126.js +24 -115
- package/dist/index126.js.map +1 -1
- package/dist/index127.cjs +28 -37
- package/dist/index127.cjs.map +1 -1
- package/dist/index127.js +28 -37
- package/dist/index127.js.map +1 -1
- package/dist/index128.cjs +13 -13
- package/dist/index128.js +13 -13
- package/dist/index129.cjs +26 -32
- package/dist/index129.cjs.map +1 -1
- package/dist/index129.js +26 -32
- package/dist/index129.js.map +1 -1
- package/dist/index13.cjs +2 -2
- package/dist/index13.js +2 -2
- package/dist/index130.cjs +31 -7
- package/dist/index130.cjs.map +1 -1
- package/dist/index130.js +32 -8
- package/dist/index130.js.map +1 -1
- package/dist/index131.cjs +13 -22
- package/dist/index131.cjs.map +1 -1
- package/dist/index131.js +14 -23
- package/dist/index131.js.map +1 -1
- package/dist/index132.cjs +36 -30
- package/dist/index132.cjs.map +1 -1
- package/dist/index132.js +36 -30
- package/dist/index132.js.map +1 -1
- package/dist/index133.cjs +18 -36
- package/dist/index133.cjs.map +1 -1
- package/dist/index133.js +18 -36
- package/dist/index133.js.map +1 -1
- package/dist/index134.cjs +16 -16
- package/dist/index134.js +17 -17
- package/dist/index135.cjs +36 -45
- package/dist/index135.cjs.map +1 -1
- package/dist/index135.js +36 -45
- package/dist/index135.js.map +1 -1
- package/dist/index136.cjs +87 -70
- package/dist/index136.cjs.map +1 -1
- package/dist/index136.js +88 -71
- package/dist/index136.js.map +1 -1
- package/dist/index137.cjs +40 -1164
- package/dist/index137.cjs.map +1 -1
- package/dist/index137.js +38 -1163
- package/dist/index137.js.map +1 -1
- package/dist/index138.cjs +15 -1575
- package/dist/index138.cjs.map +1 -1
- package/dist/index138.js +14 -1575
- package/dist/index138.js.map +1 -1
- package/dist/index139.cjs +84 -34
- package/dist/index139.cjs.map +1 -1
- package/dist/index139.js +83 -33
- package/dist/index139.js.map +1 -1
- package/dist/index14.cjs +2 -2
- package/dist/index14.js +2 -2
- package/dist/index140.cjs +9 -0
- package/dist/index140.cjs.map +1 -0
- package/dist/index140.js +9 -0
- package/dist/index140.js.map +1 -0
- package/dist/index141.cjs +51 -0
- package/dist/index141.cjs.map +1 -0
- package/dist/index141.js +51 -0
- package/dist/index141.js.map +1 -0
- package/dist/index142.cjs +78 -0
- package/dist/index142.cjs.map +1 -0
- package/dist/index142.js +78 -0
- package/dist/index142.js.map +1 -0
- package/dist/index143.cjs +1166 -0
- package/dist/index143.cjs.map +1 -0
- package/dist/index143.js +1167 -0
- package/dist/index143.js.map +1 -0
- package/dist/index144.cjs +1578 -0
- package/dist/index144.cjs.map +1 -0
- package/dist/index144.js +1579 -0
- package/dist/index144.js.map +1 -0
- package/dist/index145.cjs +10 -0
- package/dist/index145.cjs.map +1 -0
- package/dist/index145.js +10 -0
- package/dist/index145.js.map +1 -0
- package/dist/index146.cjs +15 -0
- package/dist/index146.cjs.map +1 -0
- package/dist/index146.js +15 -0
- package/dist/index146.js.map +1 -0
- package/dist/index147.cjs +51 -0
- package/dist/index147.cjs.map +1 -0
- package/dist/index147.js +51 -0
- package/dist/index147.js.map +1 -0
- package/dist/index148.cjs +37 -0
- package/dist/index148.cjs.map +1 -0
- package/dist/index148.js +37 -0
- package/dist/index148.js.map +1 -0
- package/dist/index15.cjs +2 -2
- package/dist/index15.js +2 -2
- package/dist/index16.cjs +2 -2
- package/dist/index16.js +2 -2
- package/dist/index17.cjs +2 -2
- package/dist/index17.js +2 -2
- package/dist/index18.cjs +2 -2
- package/dist/index18.js +2 -2
- package/dist/index19.cjs +2 -2
- package/dist/index19.js +2 -2
- package/dist/index20.cjs +2 -2
- package/dist/index20.js +2 -2
- package/dist/index21.cjs +2 -2
- package/dist/index21.js +2 -2
- package/dist/index22.cjs +2 -2
- package/dist/index22.js +2 -2
- package/dist/index23.cjs +2 -2
- package/dist/index23.js +2 -2
- package/dist/index24.cjs +3 -3
- package/dist/index24.js +3 -3
- package/dist/index25.cjs +3 -3
- package/dist/index25.js +3 -3
- package/dist/index26.cjs +4 -4
- package/dist/index26.js +4 -4
- package/dist/index27.cjs +2 -1
- package/dist/index27.cjs.map +1 -1
- package/dist/index27.js +2 -1
- package/dist/index27.js.map +1 -1
- package/dist/index28.cjs +2 -2
- package/dist/index28.js +2 -2
- package/dist/index29.cjs +58 -158
- package/dist/index29.cjs.map +1 -1
- package/dist/index29.js +58 -158
- package/dist/index29.js.map +1 -1
- package/dist/index30.cjs +161 -21
- package/dist/index30.cjs.map +1 -1
- package/dist/index30.js +162 -22
- package/dist/index30.js.map +1 -1
- package/dist/index31.cjs +20 -143
- package/dist/index31.cjs.map +1 -1
- package/dist/index31.js +21 -144
- package/dist/index31.js.map +1 -1
- package/dist/index32.cjs +125 -135
- package/dist/index32.cjs.map +1 -1
- package/dist/index32.js +127 -137
- package/dist/index32.js.map +1 -1
- package/dist/index33.cjs +135 -67
- package/dist/index33.cjs.map +1 -1
- package/dist/index33.js +134 -66
- package/dist/index33.js.map +1 -1
- package/dist/index34.cjs +83 -98
- package/dist/index34.cjs.map +1 -1
- package/dist/index34.js +84 -99
- package/dist/index34.js.map +1 -1
- package/dist/index35.cjs +100 -6
- package/dist/index35.cjs.map +1 -1
- package/dist/index35.js +101 -7
- package/dist/index35.js.map +1 -1
- package/dist/index36.cjs +7 -140
- package/dist/index36.cjs.map +1 -1
- package/dist/index36.js +9 -142
- package/dist/index36.js.map +1 -1
- package/dist/index37.cjs +108 -54
- package/dist/index37.cjs.map +1 -1
- package/dist/index37.js +110 -56
- package/dist/index37.js.map +1 -1
- package/dist/index38.cjs +49 -13
- package/dist/index38.cjs.map +1 -1
- package/dist/index38.js +51 -15
- package/dist/index38.js.map +1 -1
- package/dist/index39.cjs +20 -43
- package/dist/index39.cjs.map +1 -1
- package/dist/index39.js +21 -44
- package/dist/index39.js.map +1 -1
- package/dist/index40.cjs +39 -304
- package/dist/index40.cjs.map +1 -1
- package/dist/index40.js +40 -305
- package/dist/index40.js.map +1 -1
- package/dist/index41.cjs +302 -28
- package/dist/index41.cjs.map +1 -1
- package/dist/index41.js +304 -30
- package/dist/index41.js.map +1 -1
- package/dist/index42.cjs +30 -113
- package/dist/index42.cjs.map +1 -1
- package/dist/index42.js +31 -114
- package/dist/index42.js.map +1 -1
- package/dist/index43.cjs +106 -57
- package/dist/index43.cjs.map +1 -1
- package/dist/index43.js +108 -59
- package/dist/index43.js.map +1 -1
- package/dist/index44.cjs +65 -75
- package/dist/index44.cjs.map +1 -1
- package/dist/index44.js +67 -77
- package/dist/index44.js.map +1 -1
- package/dist/index45.cjs +76 -57
- package/dist/index45.cjs.map +1 -1
- package/dist/index45.js +78 -59
- package/dist/index45.js.map +1 -1
- package/dist/index46.cjs +56 -150
- package/dist/index46.cjs.map +1 -1
- package/dist/index46.js +58 -152
- package/dist/index46.js.map +1 -1
- package/dist/index47.cjs +127 -72
- package/dist/index47.cjs.map +1 -1
- package/dist/index47.js +123 -68
- package/dist/index47.js.map +1 -1
- package/dist/index48.cjs +94 -68
- package/dist/index48.cjs.map +1 -1
- package/dist/index48.js +96 -70
- package/dist/index48.js.map +1 -1
- package/dist/index49.cjs +71 -7
- package/dist/index49.cjs.map +1 -1
- package/dist/index49.js +72 -8
- package/dist/index49.js.map +1 -1
- package/dist/index50.cjs +8 -17
- package/dist/index50.cjs.map +1 -1
- package/dist/index50.js +9 -18
- package/dist/index50.js.map +1 -1
- package/dist/index51.cjs +15 -75
- package/dist/index51.cjs.map +1 -1
- package/dist/index51.js +16 -76
- package/dist/index51.js.map +1 -1
- package/dist/index52.cjs +65 -180
- package/dist/index52.cjs.map +1 -1
- package/dist/index52.js +68 -183
- package/dist/index52.js.map +1 -1
- package/dist/index53.cjs +180 -52
- package/dist/index53.cjs.map +1 -1
- package/dist/index53.js +181 -53
- package/dist/index53.js.map +1 -1
- package/dist/index54.cjs +61 -111
- package/dist/index54.cjs.map +1 -1
- package/dist/index54.js +62 -112
- package/dist/index54.js.map +1 -1
- package/dist/index55.cjs +111 -44
- package/dist/index55.cjs.map +1 -1
- package/dist/index55.js +112 -45
- package/dist/index55.js.map +1 -1
- package/dist/index56.cjs +47 -6
- package/dist/index56.cjs.map +1 -1
- package/dist/index56.js +48 -7
- package/dist/index56.js.map +1 -1
- package/dist/index57.cjs +6 -145
- package/dist/index57.cjs.map +1 -1
- package/dist/index57.js +7 -146
- package/dist/index57.js.map +1 -1
- package/dist/index58.cjs +144 -7
- package/dist/index58.cjs.map +1 -1
- package/dist/index58.js +146 -9
- package/dist/index58.js.map +1 -1
- package/dist/index59.cjs +6 -15
- package/dist/index59.cjs.map +1 -1
- package/dist/index59.js +6 -15
- package/dist/index59.js.map +1 -1
- package/dist/index60.cjs +14 -63
- package/dist/index60.cjs.map +1 -1
- package/dist/index60.js +16 -65
- package/dist/index60.js.map +1 -1
- package/dist/index61.cjs +66 -2
- package/dist/index61.cjs.map +1 -1
- package/dist/index61.js +67 -3
- package/dist/index61.js.map +1 -1
- package/dist/index62.cjs +3 -10
- package/dist/index62.cjs.map +1 -1
- package/dist/index62.js +3 -10
- package/dist/index62.js.map +1 -1
- package/dist/index63.cjs +11 -16
- package/dist/index63.cjs.map +1 -1
- package/dist/index63.js +10 -15
- package/dist/index63.js.map +1 -1
- package/dist/index64.cjs +15 -24
- package/dist/index64.cjs.map +1 -1
- package/dist/index64.js +15 -24
- package/dist/index64.js.map +1 -1
- package/dist/index65.cjs +20 -11
- package/dist/index65.cjs.map +1 -1
- package/dist/index65.js +20 -11
- package/dist/index65.js.map +1 -1
- package/dist/index66.cjs +13 -22
- package/dist/index66.cjs.map +1 -1
- package/dist/index66.js +13 -22
- package/dist/index66.js.map +1 -1
- package/dist/index68.cjs +6 -0
- package/dist/index68.cjs.map +1 -1
- package/dist/index68.js +6 -0
- package/dist/index68.js.map +1 -1
- package/dist/index69.cjs +16 -64
- package/dist/index69.cjs.map +1 -1
- package/dist/index69.js +16 -64
- package/dist/index69.js.map +1 -1
- package/dist/index70.cjs +14 -2
- package/dist/index70.cjs.map +1 -1
- package/dist/index70.js +15 -3
- package/dist/index70.js.map +1 -1
- package/dist/index71.cjs +20 -17
- package/dist/index71.cjs.map +1 -1
- package/dist/index71.js +21 -18
- package/dist/index71.js.map +1 -1
- package/dist/index72.cjs +16 -10
- package/dist/index72.cjs.map +1 -1
- package/dist/index72.js +16 -10
- package/dist/index72.js.map +1 -1
- package/dist/index73.cjs +25 -12
- package/dist/index73.cjs.map +1 -1
- package/dist/index73.js +24 -11
- package/dist/index73.js.map +1 -1
- package/dist/index74.cjs +33 -15
- package/dist/index74.cjs.map +1 -1
- package/dist/index74.js +34 -16
- package/dist/index74.js.map +1 -1
- package/dist/index75.cjs +12 -25
- package/dist/index75.cjs.map +1 -1
- package/dist/index75.js +11 -24
- package/dist/index75.js.map +1 -1
- package/dist/index76.cjs +57 -73
- package/dist/index76.cjs.map +1 -1
- package/dist/index76.js +56 -72
- package/dist/index76.js.map +1 -1
- package/dist/index77.cjs +116 -34
- package/dist/index77.cjs.map +1 -1
- package/dist/index77.js +115 -33
- package/dist/index77.js.map +1 -1
- package/dist/index78.cjs +38 -2
- package/dist/index78.cjs.map +1 -1
- package/dist/index78.js +39 -3
- package/dist/index78.js.map +1 -1
- package/dist/index79.cjs +73 -84
- package/dist/index79.cjs.map +1 -1
- package/dist/index79.js +72 -83
- package/dist/index79.js.map +1 -1
- package/dist/index80.cjs +49 -43
- package/dist/index80.cjs.map +1 -1
- package/dist/index80.js +50 -44
- package/dist/index80.js.map +1 -1
- package/dist/index81.cjs +16 -34
- package/dist/index81.cjs.map +1 -1
- package/dist/index81.js +15 -33
- package/dist/index81.js.map +1 -1
- package/dist/index82.cjs +134 -19
- package/dist/index82.cjs.map +1 -1
- package/dist/index82.js +133 -18
- package/dist/index82.js.map +1 -1
- package/dist/index83.cjs +40 -16
- package/dist/index83.cjs.map +1 -1
- package/dist/index83.js +40 -16
- package/dist/index83.js.map +1 -1
- package/dist/index84.cjs +4 -16
- package/dist/index84.cjs.map +1 -1
- package/dist/index84.js +5 -17
- package/dist/index84.js.map +1 -1
- package/dist/index85.cjs +29 -2
- package/dist/index85.cjs.map +1 -1
- package/dist/index85.js +30 -3
- package/dist/index85.js.map +1 -1
- package/dist/index86.cjs +47 -2
- package/dist/index86.cjs.map +1 -1
- package/dist/index86.js +48 -3
- package/dist/index86.js.map +1 -1
- package/dist/index87.cjs +34 -25
- package/dist/index87.cjs.map +1 -1
- package/dist/index87.js +33 -24
- package/dist/index87.js.map +1 -1
- package/dist/index88.cjs +10 -16
- package/dist/index88.cjs.map +1 -1
- package/dist/index88.js +10 -16
- package/dist/index88.js.map +1 -1
- package/dist/index89.cjs +22 -9
- package/dist/index89.cjs.map +1 -1
- package/dist/index89.js +21 -8
- package/dist/index89.js.map +1 -1
- package/dist/index90.cjs +68 -46
- package/dist/index90.cjs.map +1 -1
- package/dist/index90.js +69 -47
- package/dist/index90.js.map +1 -1
- package/dist/index91.cjs +6 -17
- package/dist/index91.cjs.map +1 -1
- package/dist/index91.js +6 -17
- package/dist/index91.js.map +1 -1
- package/dist/index92.cjs +34 -31
- package/dist/index92.cjs.map +1 -1
- package/dist/index92.js +34 -31
- package/dist/index92.js.map +1 -1
- package/dist/index93.cjs +9 -17
- package/dist/index93.cjs.map +1 -1
- package/dist/index93.js +8 -16
- package/dist/index93.js.map +1 -1
- package/dist/index94.cjs +48 -7
- package/dist/index94.cjs.map +1 -1
- package/dist/index94.js +47 -6
- package/dist/index94.js.map +1 -1
- package/dist/index95.cjs +18 -55
- package/dist/index95.cjs.map +1 -1
- package/dist/index95.js +17 -54
- package/dist/index95.js.map +1 -1
- package/dist/index96.cjs +31 -28
- package/dist/index96.cjs.map +1 -1
- package/dist/index96.js +31 -28
- package/dist/index96.js.map +1 -1
- package/dist/index97.cjs +2 -53
- package/dist/index97.cjs.map +1 -1
- package/dist/index97.js +3 -54
- package/dist/index97.js.map +1 -1
- package/dist/index98.cjs +64 -16
- package/dist/index98.cjs.map +1 -1
- package/dist/index98.js +64 -16
- package/dist/index98.js.map +1 -1
- package/dist/index99.cjs +16 -38
- package/dist/index99.cjs.map +1 -1
- package/dist/index99.js +16 -38
- package/dist/index99.js.map +1 -1
- package/dist/labels/ComponentLabels.types.d.ts +2 -0
- package/dist/labels/ComponentLabels.types.d.ts.map +1 -1
- package/dist/labels/defaults.d.ts.map +1 -1
- package/dist/style.css +382 -214
- package/package.json +1 -1
package/dist/index139.js
CHANGED
|
@@ -1,37 +1,87 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
const root = "krc-root-WYIsp";
|
|
2
|
+
const trigger = "krc-trigger-UedSS";
|
|
3
|
+
const active = "krc-active-cH8Tl";
|
|
4
|
+
const triggerContent = "krc-triggerContent-Kkhoi";
|
|
5
|
+
const chevron = "krc-chevron-NoNsI";
|
|
6
|
+
const label = "krc-label-RPlXR";
|
|
7
|
+
const valueGroup = "krc-valueGroup-xfNcx";
|
|
8
|
+
const value = "krc-value-aKdIW";
|
|
9
|
+
const badge = "krc-badge-yVq9o";
|
|
10
|
+
const clear = "krc-clear-11V9Q";
|
|
11
|
+
const panel = "krc-panel-xf2f8";
|
|
12
|
+
const header = "krc-header--VMR-";
|
|
13
|
+
const search = "krc-search-4gQgB";
|
|
14
|
+
const headerActions = "krc-headerActions-orxXD";
|
|
15
|
+
const chip = "krc-chip--n-9m";
|
|
16
|
+
const chipGhost = "krc-chipGhost-oayjh";
|
|
17
|
+
const list = "krc-list-NRoxf";
|
|
18
|
+
const status = "krc-status-j7xbM";
|
|
19
|
+
const statusError = "krc-statusError-u6rfB";
|
|
20
|
+
const option = "krc-option-ZAXum";
|
|
21
|
+
const optionLabel = "krc-optionLabel-MdDyI";
|
|
22
|
+
const optionCount = "krc-optionCount-JSQl9";
|
|
23
|
+
const create = "krc-create-hO8Cq";
|
|
24
|
+
const footer = "krc-footer-2yk6S";
|
|
25
|
+
const selection = "krc-selection-aYDH-";
|
|
26
|
+
const selectionDelta = "krc-selectionDelta-S1dV7";
|
|
27
|
+
const footerActions = "krc-footerActions-77iCX";
|
|
28
|
+
const styles = {
|
|
29
|
+
root,
|
|
30
|
+
trigger,
|
|
31
|
+
active,
|
|
32
|
+
triggerContent,
|
|
33
|
+
chevron,
|
|
34
|
+
label,
|
|
35
|
+
valueGroup,
|
|
36
|
+
value,
|
|
37
|
+
badge,
|
|
38
|
+
clear,
|
|
39
|
+
panel,
|
|
40
|
+
header,
|
|
41
|
+
search,
|
|
42
|
+
headerActions,
|
|
43
|
+
chip,
|
|
44
|
+
chipGhost,
|
|
45
|
+
list,
|
|
46
|
+
status,
|
|
47
|
+
statusError,
|
|
48
|
+
option,
|
|
49
|
+
optionLabel,
|
|
50
|
+
optionCount,
|
|
51
|
+
create,
|
|
52
|
+
footer,
|
|
53
|
+
selection,
|
|
54
|
+
selectionDelta,
|
|
55
|
+
footerActions
|
|
31
56
|
};
|
|
32
|
-
const sameViewport = (a, b) => a.zoom === b.zoom && a.center[0] === b.center[0] && a.center[1] === b.center[1] && a.bounds.west === b.bounds.west && a.bounds.south === b.bounds.south && a.bounds.east === b.bounds.east && a.bounds.north === b.bounds.north;
|
|
33
57
|
export {
|
|
34
|
-
|
|
35
|
-
|
|
58
|
+
active,
|
|
59
|
+
badge,
|
|
60
|
+
chevron,
|
|
61
|
+
chip,
|
|
62
|
+
chipGhost,
|
|
63
|
+
clear,
|
|
64
|
+
create,
|
|
65
|
+
styles as default,
|
|
66
|
+
footer,
|
|
67
|
+
footerActions,
|
|
68
|
+
header,
|
|
69
|
+
headerActions,
|
|
70
|
+
label,
|
|
71
|
+
list,
|
|
72
|
+
option,
|
|
73
|
+
optionCount,
|
|
74
|
+
optionLabel,
|
|
75
|
+
panel,
|
|
76
|
+
root,
|
|
77
|
+
search,
|
|
78
|
+
selection,
|
|
79
|
+
selectionDelta,
|
|
80
|
+
status,
|
|
81
|
+
statusError,
|
|
82
|
+
trigger,
|
|
83
|
+
triggerContent,
|
|
84
|
+
value,
|
|
85
|
+
valueGroup
|
|
36
86
|
};
|
|
37
87
|
//# sourceMappingURL=index139.js.map
|
package/dist/index139.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index139.js","sources":[
|
|
1
|
+
{"version":3,"file":"index139.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index14.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
|
-
const clsx = require("./
|
|
6
|
-
const Button_module = require("./
|
|
5
|
+
const clsx = require("./index64.cjs");
|
|
6
|
+
const Button_module = require("./index65.cjs");
|
|
7
7
|
const Button = react.forwardRef(
|
|
8
8
|
({ className, variant = "primary", size = "md", type = "button", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
9
9
|
"button",
|
package/dist/index14.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { clsx } from "./
|
|
4
|
-
import styles from "./
|
|
3
|
+
import { clsx } from "./index64.js";
|
|
4
|
+
import styles from "./index65.js";
|
|
5
5
|
const Button = forwardRef(
|
|
6
6
|
({ className, variant = "primary", size = "md", type = "button", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7
7
|
"button",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const root = "krc-root-bWynN";
|
|
4
|
+
const styles = {
|
|
5
|
+
root
|
|
6
|
+
};
|
|
7
|
+
exports.default = styles;
|
|
8
|
+
exports.root = root;
|
|
9
|
+
//# sourceMappingURL=index140.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index140.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/dist/index140.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index140.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const CLIPPING_OVERFLOW = /* @__PURE__ */ new Set(["hidden", "auto", "scroll", "clip"]);
|
|
4
|
+
const CONTAINING_CONTAIN = /paint|layout|strict|content/;
|
|
5
|
+
const CONTAINING_WILL_CHANGE = /transform|perspective|filter/;
|
|
6
|
+
const isSet = (value) => Boolean(value) && value !== "none";
|
|
7
|
+
function trapsFixed(style) {
|
|
8
|
+
return isSet(style.transform) || isSet(style.perspective) || isSet(style.filter) || isSet(style.backdropFilter) || CONTAINING_CONTAIN.test(style.contain ?? "") || CONTAINING_WILL_CHANGE.test(style.willChange ?? "") || isSet(style.containerType) && style.containerType !== "normal";
|
|
9
|
+
}
|
|
10
|
+
function clipsVertically(style) {
|
|
11
|
+
if (CLIPPING_OVERFLOW.has(style.overflowY)) return true;
|
|
12
|
+
return style.overflowX !== "clip" && CLIPPING_OVERFLOW.has(style.overflowX);
|
|
13
|
+
}
|
|
14
|
+
const intersect = (a, b) => ({
|
|
15
|
+
top: Math.max(a.top, b.top),
|
|
16
|
+
bottom: Math.min(a.bottom, b.bottom)
|
|
17
|
+
});
|
|
18
|
+
function getClippingRect(element) {
|
|
19
|
+
const root = document.documentElement;
|
|
20
|
+
const viewport = { top: 0, bottom: root.clientHeight };
|
|
21
|
+
let horizontal = null;
|
|
22
|
+
const clippers = [];
|
|
23
|
+
let trapped = false;
|
|
24
|
+
for (let el = element.parentElement; el; el = el.parentElement) {
|
|
25
|
+
const style = getComputedStyle(el);
|
|
26
|
+
if (!trapped && trapsFixed(style)) trapped = true;
|
|
27
|
+
if (el === document.body || el === root) continue;
|
|
28
|
+
const clipsX = CLIPPING_OVERFLOW.has(style.overflowX);
|
|
29
|
+
const clipsY = clipsVertically(style);
|
|
30
|
+
if (!clipsX && !clipsY) continue;
|
|
31
|
+
const rect = el.getBoundingClientRect();
|
|
32
|
+
if (clipsX && !horizontal) {
|
|
33
|
+
const left = rect.left + el.clientLeft;
|
|
34
|
+
horizontal = { left, right: left + el.clientWidth };
|
|
35
|
+
}
|
|
36
|
+
if (clipsY) {
|
|
37
|
+
const top = rect.top + el.clientTop;
|
|
38
|
+
clippers.push({ top, bottom: top + el.clientHeight });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const viewportWidth = root.clientWidth;
|
|
42
|
+
const outermost = clippers[clippers.length - 1];
|
|
43
|
+
return {
|
|
44
|
+
horizontal: horizontal ? { left: Math.max(horizontal.left, 0), right: Math.min(horizontal.right, viewportWidth) } : { left: 0, right: viewportWidth },
|
|
45
|
+
vertical: clippers.reduce(intersect, viewport),
|
|
46
|
+
viewport,
|
|
47
|
+
escape: trapped || clippers.length < 2 ? null : intersect(outermost, viewport)
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
exports.getClippingRect = getClippingRect;
|
|
51
|
+
//# sourceMappingURL=index141.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index141.cjs","sources":["../src/utils/clippingRect.ts"],"sourcesContent":["import type { ClippingBox, HorizontalRect, VerticalRect } from './panelPlacement.types';\n\nconst CLIPPING_OVERFLOW = new Set(['hidden', 'auto', 'scroll', 'clip']);\nconst CONTAINING_CONTAIN = /paint|layout|strict|content/;\nconst CONTAINING_WILL_CHANGE = /transform|perspective|filter/;\n\nconst isSet = (value: string | undefined) => Boolean(value) && value !== 'none';\n\n/**\n * Whether `style` makes its element the containing block of `position: fixed`\n * descendants, so they are no longer positioned against the viewport.\n */\nfunction trapsFixed(style: CSSStyleDeclaration): boolean {\n return (\n isSet(style.transform) ||\n isSet(style.perspective) ||\n isSet(style.filter) ||\n isSet(style.backdropFilter) ||\n CONTAINING_CONTAIN.test(style.contain ?? '') ||\n CONTAINING_WILL_CHANGE.test(style.willChange ?? '') ||\n (isSet(style.containerType) && style.containerType !== 'normal')\n );\n}\n\n/**\n * `overflow-y` clips when it is not `visible`, and also when only `overflow-x` is set:\n * CSS computes a `visible` axis to `auto` when the other one is not `visible` (except\n * with `clip`). Browsers report the computed value; this also covers test DOMs that\n * reflect inline styles only.\n */\nfunction clipsVertically(style: CSSStyleDeclaration): boolean {\n if (CLIPPING_OVERFLOW.has(style.overflowY)) return true;\n return style.overflowX !== 'clip' && CLIPPING_OVERFLOW.has(style.overflowX);\n}\n\nconst intersect = (a: VerticalRect, b: VerticalRect): VerticalRect => ({\n top: Math.max(a.top, b.top),\n bottom: Math.min(a.bottom, b.bottom),\n});\n\n/**\n * The boxes that clip `element`'s overflow, measured as inner boxes (no border, no\n * scrollbar) and intersected with the viewport:\n * - horizontally, the nearest ancestor whose `overflow-x` is not `visible`;\n * - vertically, every ancestor whose `overflow-y` is not `visible`;\n * - the escape box, the outermost of those, when there are at least two.\n *\n * The overflow walk stops below `<body>`: overflow set on `<body>` or `<html>` applies\n * to the viewport, which is already the outer limit. The fixed-position trap is checked\n * up to `<html>`.\n */\nexport function getClippingRect(element: HTMLElement): ClippingBox {\n const root = document.documentElement;\n const viewport: VerticalRect = { top: 0, bottom: root.clientHeight };\n let horizontal: HorizontalRect | null = null;\n const clippers: VerticalRect[] = [];\n let trapped = false;\n\n for (let el = element.parentElement; el; el = el.parentElement) {\n const style = getComputedStyle(el);\n if (!trapped && trapsFixed(style)) trapped = true;\n if (el === document.body || el === root) continue;\n\n const clipsX = CLIPPING_OVERFLOW.has(style.overflowX);\n const clipsY = clipsVertically(style);\n if (!clipsX && !clipsY) continue;\n\n const rect = el.getBoundingClientRect();\n if (clipsX && !horizontal) {\n const left = rect.left + el.clientLeft;\n horizontal = { left, right: left + el.clientWidth };\n }\n if (clipsY) {\n const top = rect.top + el.clientTop;\n clippers.push({ top, bottom: top + el.clientHeight });\n }\n }\n\n const viewportWidth = root.clientWidth;\n const outermost = clippers[clippers.length - 1];\n return {\n horizontal: horizontal\n ? { left: Math.max(horizontal.left, 0), right: Math.min(horizontal.right, viewportWidth) }\n : { left: 0, right: viewportWidth },\n vertical: clippers.reduce(intersect, viewport),\n viewport,\n escape: trapped || clippers.length < 2 ? null : intersect(outermost, viewport),\n };\n}\n"],"names":[],"mappings":";;AAEA,MAAM,wCAAwB,IAAI,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AACtE,MAAM,qBAAqB;AAC3B,MAAM,yBAAyB;AAE/B,MAAM,QAAQ,CAAC,UAA8B,QAAQ,KAAK,KAAK,UAAU;AAMzE,SAAS,WAAW,OAAqC;AACvD,SACE,MAAM,MAAM,SAAS,KACrB,MAAM,MAAM,WAAW,KACvB,MAAM,MAAM,MAAM,KAClB,MAAM,MAAM,cAAc,KAC1B,mBAAmB,KAAK,MAAM,WAAW,EA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,SAAO;AAAA,IACL,YAAY,aACR,EAAE,MAAM,KAAK,IAAI,WAAW,MAAM,CAAC,GAAG,OAAO,KAAK,IAAI,WAAW,OAAO,aAAa,EAAA,IACrF,EAAE,MAAM,GAAG,OAAO,cAAA;AAAA,IACtB,UAAU,SAAS,OAAO,WAAW,QAAQ;AAAA,IAC7C;AAAA,IACA,QAAQ,WAAW,SAAS,SAAS,IAAI,OAAO,UAAU,WAAW,QAAQ;AAAA,EAAA;AAEjF;;"}
|
package/dist/index141.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const CLIPPING_OVERFLOW = /* @__PURE__ */ new Set(["hidden", "auto", "scroll", "clip"]);
|
|
2
|
+
const CONTAINING_CONTAIN = /paint|layout|strict|content/;
|
|
3
|
+
const CONTAINING_WILL_CHANGE = /transform|perspective|filter/;
|
|
4
|
+
const isSet = (value) => Boolean(value) && value !== "none";
|
|
5
|
+
function trapsFixed(style) {
|
|
6
|
+
return isSet(style.transform) || isSet(style.perspective) || isSet(style.filter) || isSet(style.backdropFilter) || CONTAINING_CONTAIN.test(style.contain ?? "") || CONTAINING_WILL_CHANGE.test(style.willChange ?? "") || isSet(style.containerType) && style.containerType !== "normal";
|
|
7
|
+
}
|
|
8
|
+
function clipsVertically(style) {
|
|
9
|
+
if (CLIPPING_OVERFLOW.has(style.overflowY)) return true;
|
|
10
|
+
return style.overflowX !== "clip" && CLIPPING_OVERFLOW.has(style.overflowX);
|
|
11
|
+
}
|
|
12
|
+
const intersect = (a, b) => ({
|
|
13
|
+
top: Math.max(a.top, b.top),
|
|
14
|
+
bottom: Math.min(a.bottom, b.bottom)
|
|
15
|
+
});
|
|
16
|
+
function getClippingRect(element) {
|
|
17
|
+
const root = document.documentElement;
|
|
18
|
+
const viewport = { top: 0, bottom: root.clientHeight };
|
|
19
|
+
let horizontal = null;
|
|
20
|
+
const clippers = [];
|
|
21
|
+
let trapped = false;
|
|
22
|
+
for (let el = element.parentElement; el; el = el.parentElement) {
|
|
23
|
+
const style = getComputedStyle(el);
|
|
24
|
+
if (!trapped && trapsFixed(style)) trapped = true;
|
|
25
|
+
if (el === document.body || el === root) continue;
|
|
26
|
+
const clipsX = CLIPPING_OVERFLOW.has(style.overflowX);
|
|
27
|
+
const clipsY = clipsVertically(style);
|
|
28
|
+
if (!clipsX && !clipsY) continue;
|
|
29
|
+
const rect = el.getBoundingClientRect();
|
|
30
|
+
if (clipsX && !horizontal) {
|
|
31
|
+
const left = rect.left + el.clientLeft;
|
|
32
|
+
horizontal = { left, right: left + el.clientWidth };
|
|
33
|
+
}
|
|
34
|
+
if (clipsY) {
|
|
35
|
+
const top = rect.top + el.clientTop;
|
|
36
|
+
clippers.push({ top, bottom: top + el.clientHeight });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const viewportWidth = root.clientWidth;
|
|
40
|
+
const outermost = clippers[clippers.length - 1];
|
|
41
|
+
return {
|
|
42
|
+
horizontal: horizontal ? { left: Math.max(horizontal.left, 0), right: Math.min(horizontal.right, viewportWidth) } : { left: 0, right: viewportWidth },
|
|
43
|
+
vertical: clippers.reduce(intersect, viewport),
|
|
44
|
+
viewport,
|
|
45
|
+
escape: trapped || clippers.length < 2 ? null : intersect(outermost, viewport)
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
getClippingRect
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=index141.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index141.js","sources":["../src/utils/clippingRect.ts"],"sourcesContent":["import type { ClippingBox, HorizontalRect, VerticalRect } from './panelPlacement.types';\n\nconst CLIPPING_OVERFLOW = new Set(['hidden', 'auto', 'scroll', 'clip']);\nconst CONTAINING_CONTAIN = /paint|layout|strict|content/;\nconst CONTAINING_WILL_CHANGE = /transform|perspective|filter/;\n\nconst isSet = (value: string | undefined) => Boolean(value) && value !== 'none';\n\n/**\n * Whether `style` makes its element the containing block of `position: fixed`\n * descendants, so they are no longer positioned against the viewport.\n */\nfunction trapsFixed(style: CSSStyleDeclaration): boolean {\n return (\n isSet(style.transform) ||\n isSet(style.perspective) ||\n isSet(style.filter) ||\n isSet(style.backdropFilter) ||\n CONTAINING_CONTAIN.test(style.contain ?? '') ||\n CONTAINING_WILL_CHANGE.test(style.willChange ?? '') ||\n (isSet(style.containerType) && style.containerType !== 'normal')\n );\n}\n\n/**\n * `overflow-y` clips when it is not `visible`, and also when only `overflow-x` is set:\n * CSS computes a `visible` axis to `auto` when the other one is not `visible` (except\n * with `clip`). Browsers report the computed value; this also covers test DOMs that\n * reflect inline styles only.\n */\nfunction clipsVertically(style: CSSStyleDeclaration): boolean {\n if (CLIPPING_OVERFLOW.has(style.overflowY)) return true;\n return style.overflowX !== 'clip' && CLIPPING_OVERFLOW.has(style.overflowX);\n}\n\nconst intersect = (a: VerticalRect, b: VerticalRect): VerticalRect => ({\n top: Math.max(a.top, b.top),\n bottom: Math.min(a.bottom, b.bottom),\n});\n\n/**\n * The boxes that clip `element`'s overflow, measured as inner boxes (no border, no\n * scrollbar) and intersected with the viewport:\n * - horizontally, the nearest ancestor whose `overflow-x` is not `visible`;\n * - vertically, every ancestor whose `overflow-y` is not `visible`;\n * - the escape box, the outermost of those, when there are at least two.\n *\n * The overflow walk stops below `<body>`: overflow set on `<body>` or `<html>` applies\n * to the viewport, which is already the outer limit. The fixed-position trap is checked\n * up to `<html>`.\n */\nexport function getClippingRect(element: HTMLElement): ClippingBox {\n const root = document.documentElement;\n const viewport: VerticalRect = { top: 0, bottom: root.clientHeight };\n let horizontal: HorizontalRect | null = null;\n const clippers: VerticalRect[] = [];\n let trapped = false;\n\n for (let el = element.parentElement; el; el = el.parentElement) {\n const style = getComputedStyle(el);\n if (!trapped && trapsFixed(style)) trapped = true;\n if (el === document.body || el === root) continue;\n\n const clipsX = CLIPPING_OVERFLOW.has(style.overflowX);\n const clipsY = clipsVertically(style);\n if (!clipsX && !clipsY) continue;\n\n const rect = el.getBoundingClientRect();\n if (clipsX && !horizontal) {\n const left = rect.left + el.clientLeft;\n horizontal = { left, right: left + el.clientWidth };\n }\n if (clipsY) {\n const top = rect.top + el.clientTop;\n clippers.push({ top, bottom: top + el.clientHeight });\n }\n }\n\n const viewportWidth = root.clientWidth;\n const outermost = clippers[clippers.length - 1];\n return {\n horizontal: horizontal\n ? { left: Math.max(horizontal.left, 0), right: Math.min(horizontal.right, viewportWidth) }\n : { left: 0, right: viewportWidth },\n vertical: clippers.reduce(intersect, viewport),\n viewport,\n escape: trapped || clippers.length < 2 ? null : intersect(outermost, viewport),\n };\n}\n"],"names":[],"mappings":"AAEA,MAAM,wCAAwB,IAAI,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AACtE,MAAM,qBAAqB;AAC3B,MAAM,yBAAyB;AAE/B,MAAM,QAAQ,CAAC,UAA8B,QAAQ,KAAK,KAAK,UAAU;AAMzE,SAAS,WAAW,OAAqC;AACvD,SACE,MAAM,MAAM,SAAS,KACrB,MAAM,MAAM,WAAW,KACvB,MAAM,MAAM,MAAM,KAClB,MAAM,MAAM,cAAc,KAC1B,mBAAmB,KAAK,MAAM,WAAW,EAAE,KAC3C,uBAAuB,KAAK,MAAM,cAAc,EAAE,KACjD,MAAM,MAAM,aAAa,KAAK,MAAM,kBAAkB;AAE3D;AAQA,SAAS,gBAAgB,OAAqC;AAC5D,MAAI,kBAAkB,IAAI,MAAM,SAAS,EAAG,QAAO;AACnD,SAAO,MAAM,cAAc,UAAU,kBAAkB,IAAI,MAAM,SAAS;AAC5E;AAEA,MAAM,YAAY,CAAC,GAAiB,OAAmC;AAAA,EACrE,KAAK,KAAK,IAAI,EAAE,KAAK,EAAE,GAAG;AAAA,EAC1B,QAAQ,KAAK,IAAI,EAAE,QAAQ,EAAE,MAAM;AACrC;AAaO,SAAS,gBAAgB,SAAmC;AACjE,QAAM,OAAO,SAAS;AACtB,QAAM,WAAyB,EAAE,KAAK,GAAG,QAAQ,KAAK,aAAA;AACtD,MAAI,aAAoC;AACxC,QAAM,WAA2B,CAAA;AACjC,MAAI,UAAU;AAEd,WAAS,KAAK,QAAQ,eAAe,IAAI,KAAK,GAAG,eAAe;AAC9D,UAAM,QAAQ,iBAAiB,EAAE;AACjC,QAAI,CAAC,WAAW,WAAW,KAAK,EAAG,WAAU;AAC7C,QAAI,OAAO,SAAS,QAAQ,OAAO,KAAM;AAEzC,UAAM,SAAS,kBAAkB,IAAI,MAAM,SAAS;AACpD,UAAM,SAAS,gBAAgB,KAAK;AACpC,QAAI,CAAC,UAAU,CAAC,OAAQ;AAExB,UAAM,OAAO,GAAG,sBAAA;AAChB,QAAI,UAAU,CAAC,YAAY;AACzB,YAAM,OAAO,KAAK,OAAO,GAAG;AAC5B,mBAAa,EAAE,MAAM,OAAO,OAAO,GAAG,YAAA;AAAA,IACxC;AACA,QAAI,QAAQ;AACV,YAAM,MAAM,KAAK,MAAM,GAAG;AAC1B,eAAS,KAAK,EAAE,KAAK,QAAQ,MAAM,GAAG,cAAc;AAAA,IACtD;AAAA,EACF;AAEA,QAAM,gBAAgB,KAAK;AAC3B,QAAM,YAAY,SAAS,SAAS,SAAS,CAAC;AAC9C,SAAO;AAAA,IACL,YAAY,aACR,EAAE,MAAM,KAAK,IAAI,WAAW,MAAM,CAAC,GAAG,OAAO,KAAK,IAAI,WAAW,OAAO,aAAa,EAAA,IACrF,EAAE,MAAM,GAAG,OAAO,cAAA;AAAA,IACtB,UAAU,SAAS,OAAO,WAAW,QAAQ;AAAA,IAC7C;AAAA,IACA,QAAQ,WAAW,SAAS,SAAS,IAAI,OAAO,UAAU,WAAW,QAAQ;AAAA,EAAA;AAEjF;"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const constants = require("./index68.cjs");
|
|
4
|
+
const DEFAULT_PLACEMENT = { align: "start", side: "bottom" };
|
|
5
|
+
function resolveHorizontal(anchor, width, boundary, margin) {
|
|
6
|
+
const left = boundary.left + margin;
|
|
7
|
+
const right = boundary.right - margin;
|
|
8
|
+
if (anchor.left + width <= right) return { align: "start" };
|
|
9
|
+
if (anchor.right - width >= left) return { align: "end" };
|
|
10
|
+
return { align: "start", shift: Math.max(right - width, left) - anchor.left };
|
|
11
|
+
}
|
|
12
|
+
const shrink = (rect, margin) => ({
|
|
13
|
+
top: rect.top + margin,
|
|
14
|
+
bottom: rect.bottom - margin
|
|
15
|
+
});
|
|
16
|
+
function resolveVertical(anchor, panel, box, currentSide, margin) {
|
|
17
|
+
const inside = shrink(box.vertical, margin);
|
|
18
|
+
const escape = box.escape && shrink(box.escape, margin);
|
|
19
|
+
const room = (side2, rect) => side2 === "bottom" ? rect.bottom - (anchor.bottom + panel.gap) : anchor.top - panel.gap - rect.top;
|
|
20
|
+
const candidates = [
|
|
21
|
+
{ side: "bottom", outside: false },
|
|
22
|
+
{ side: "top", outside: false }
|
|
23
|
+
];
|
|
24
|
+
if (escape) candidates.push({ side: "bottom", outside: true }, { side: "top", outside: true });
|
|
25
|
+
const fits = (c) => panel.height <= room(c.side, c.outside && escape ? escape : inside);
|
|
26
|
+
const kept = currentSide && candidates.find((c) => c.side === currentSide && fits(c));
|
|
27
|
+
const first = kept || candidates.find(fits);
|
|
28
|
+
if (first) return first;
|
|
29
|
+
const limit = escape ?? inside;
|
|
30
|
+
const side = room("bottom", limit) >= room("top", limit) ? "bottom" : "top";
|
|
31
|
+
return {
|
|
32
|
+
side,
|
|
33
|
+
outside: room(side, inside) < room(side, limit),
|
|
34
|
+
maxHeight: Math.max(room(side, limit), 0)
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function fixedStyle(anchor, panel, viewportBottom, horizontal, vertical) {
|
|
38
|
+
const below = vertical.side === "bottom";
|
|
39
|
+
return {
|
|
40
|
+
position: "fixed",
|
|
41
|
+
top: below ? anchor.bottom + panel.gap : "auto",
|
|
42
|
+
bottom: below ? "auto" : viewportBottom - anchor.top + panel.gap,
|
|
43
|
+
left: horizontal.align === "start" ? anchor.left + (horizontal.shift ?? 0) : anchor.right - panel.width,
|
|
44
|
+
right: "auto",
|
|
45
|
+
width: panel.width,
|
|
46
|
+
boxSizing: "border-box"
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function resolvePanelPlacement({
|
|
50
|
+
anchor,
|
|
51
|
+
panel,
|
|
52
|
+
box,
|
|
53
|
+
currentSide,
|
|
54
|
+
margin = constants.PANEL_EDGE_MARGIN
|
|
55
|
+
}) {
|
|
56
|
+
if (panel.width === 0 || panel.height === 0) return DEFAULT_PLACEMENT;
|
|
57
|
+
const horizontal = resolveHorizontal(anchor, panel.width, box.horizontal, margin);
|
|
58
|
+
const vertical = resolveVertical(anchor, panel, box, currentSide, margin);
|
|
59
|
+
const { align } = horizontal;
|
|
60
|
+
const { side, maxHeight } = vertical;
|
|
61
|
+
const style = vertical.outside ? fixedStyle(anchor, panel, box.viewport.bottom, horizontal, vertical) : {};
|
|
62
|
+
if (!vertical.outside && horizontal.shift !== void 0) {
|
|
63
|
+
style.transform = `translateX(${horizontal.shift}px)`;
|
|
64
|
+
}
|
|
65
|
+
if (maxHeight !== void 0) style.maxHeight = maxHeight;
|
|
66
|
+
return Object.keys(style).length ? { align, side, style } : { align, side };
|
|
67
|
+
}
|
|
68
|
+
const sameStyle = (a = {}, b = {}) => {
|
|
69
|
+
const keys = Object.keys(a);
|
|
70
|
+
return keys.length === Object.keys(b).length && keys.every((key) => a[key] === b[key]);
|
|
71
|
+
};
|
|
72
|
+
const samePlacement = (a, b) => a.align === b.align && a.side === b.side && sameStyle(a.style, b.style);
|
|
73
|
+
exports.DEFAULT_PLACEMENT = DEFAULT_PLACEMENT;
|
|
74
|
+
exports.resolveHorizontal = resolveHorizontal;
|
|
75
|
+
exports.resolvePanelPlacement = resolvePanelPlacement;
|
|
76
|
+
exports.resolveVertical = resolveVertical;
|
|
77
|
+
exports.samePlacement = samePlacement;
|
|
78
|
+
//# sourceMappingURL=index142.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index142.cjs","sources":["../src/utils/panelPlacement.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport { PANEL_EDGE_MARGIN } from '../constants';\nimport type {\n AnchorRect,\n ClippingBox,\n HorizontalRect,\n PanelAlign,\n PanelPlacement,\n PanelSide,\n PanelSize,\n PlacementInput,\n VerticalRect,\n} from './panelPlacement.types';\n\nexport const DEFAULT_PLACEMENT: PanelPlacement = { align: 'start', side: 'bottom' };\n\ninterface HorizontalPlacement {\n align: PanelAlign;\n /** Px to move the start-aligned panel by, when it fits on neither side. */\n shift?: number;\n}\n\ninterface VerticalPlacement {\n side: PanelSide;\n /** True when the panel is placed against the viewport, outside the clipping box. */\n outside: boolean;\n maxHeight?: number;\n}\n\n/**\n * Left-aligned if it fits rightwards, else right-aligned if it fits leftwards, else\n * shifted just enough to fit, keeping its left edge visible first.\n */\nexport function resolveHorizontal(\n anchor: HorizontalRect,\n width: number,\n boundary: HorizontalRect,\n margin: number,\n): HorizontalPlacement {\n const left = boundary.left + margin;\n const right = boundary.right - margin;\n\n if (anchor.left + width <= right) return { align: 'start' };\n if (anchor.right - width >= left) return { align: 'end' };\n return { align: 'start', shift: Math.max(right - width, left) - anchor.left };\n}\n\nconst shrink = (rect: VerticalRect, margin: number): VerticalRect => ({\n top: rect.top + margin,\n bottom: rect.bottom - margin,\n});\n\n/**\n * Below, else above, inside the clipping box; else below, else above, in the escape\n * box; else on the side with more room, with the height limited to it. While open, the\n * current side is kept as long as the panel still fits on it.\n */\nexport function resolveVertical(\n anchor: VerticalRect,\n panel: PanelSize,\n box: ClippingBox,\n currentSide: PanelSide | null,\n margin: number,\n): VerticalPlacement {\n const inside = shrink(box.vertical, margin);\n const escape = box.escape && shrink(box.escape, margin);\n const room = (side: PanelSide, rect: VerticalRect) =>\n side === 'bottom'\n ? rect.bottom - (anchor.bottom + panel.gap)\n : anchor.top - panel.gap - rect.top;\n\n const candidates: VerticalPlacement[] = [\n { side: 'bottom', outside: false },\n { side: 'top', outside: false },\n ];\n if (escape) candidates.push({ side: 'bottom', outside: true }, { side: 'top', outside: true });\n const fits = (c: VerticalPlacement) =>\n panel.height <= room(c.side, c.outside && escape ? escape : inside);\n\n const kept = currentSide && candidates.find((c) => c.side === currentSide && fits(c));\n const first = kept || candidates.find(fits);\n if (first) return first;\n\n const limit = escape ?? inside;\n const side: PanelSide = room('bottom', limit) >= room('top', limit) ? 'bottom' : 'top';\n return {\n side,\n outside: room(side, inside) < room(side, limit),\n maxHeight: Math.max(room(side, limit), 0),\n };\n}\n\nfunction fixedStyle(\n anchor: AnchorRect,\n panel: PanelSize,\n viewportBottom: number,\n horizontal: HorizontalPlacement,\n vertical: VerticalPlacement,\n): CSSProperties {\n const below = vertical.side === 'bottom';\n return {\n position: 'fixed',\n top: below ? anchor.bottom + panel.gap : 'auto',\n bottom: below ? 'auto' : viewportBottom - anchor.top + panel.gap,\n left:\n horizontal.align === 'start'\n ? anchor.left + (horizontal.shift ?? 0)\n : anchor.right - panel.width,\n right: 'auto',\n width: panel.width,\n boxSizing: 'border-box',\n };\n}\n\n/**\n * Places a dropdown panel against its trigger so the boxes that clip it never cut it\n * off. Pure: takes the measured trigger, the panel measured in its default layout and\n * the clipping box. A panel that was never laid out keeps the default placement.\n */\nexport function resolvePanelPlacement({\n anchor,\n panel,\n box,\n currentSide,\n margin = PANEL_EDGE_MARGIN,\n}: PlacementInput): PanelPlacement {\n if (panel.width === 0 || panel.height === 0) return DEFAULT_PLACEMENT;\n\n const horizontal = resolveHorizontal(anchor, panel.width, box.horizontal, margin);\n const vertical = resolveVertical(anchor, panel, box, currentSide, margin);\n const { align } = horizontal;\n const { side, maxHeight } = vertical;\n\n const style: CSSProperties = vertical.outside\n ? fixedStyle(anchor, panel, box.viewport.bottom, horizontal, vertical)\n : {};\n if (!vertical.outside && horizontal.shift !== undefined) {\n style.transform = `translateX(${horizontal.shift}px)`;\n }\n if (maxHeight !== undefined) style.maxHeight = maxHeight;\n\n return Object.keys(style).length ? { align, side, style } : { align, side };\n}\n\nconst sameStyle = (a: CSSProperties = {}, b: CSSProperties = {}) => {\n const keys = Object.keys(a) as (keyof CSSProperties)[];\n return keys.length === Object.keys(b).length && keys.every((key) => a[key] === b[key]);\n};\n\nexport const samePlacement = (a: PanelPlacement, b: PanelPlacement) =>\n a.align === b.align && a.side === b.side && sameStyle(a.style, b.style);\n"],"names":["side","PANEL_EDGE_MARGIN"],"mappings":";;;AAcO,MAAM,oBAAoC,EAAE,OAAO,SAAS,MAAM,SAAA;AAmBlE,SAAS,kBACd,QACA,OACA,UACA,QACqB;AACrB,QAAM,OAAO,SAAS,OAAO;AAC7B,QAAM,QAAQ,SAAS,QAAQ;AAE/B,MAAI,OAAO,OAAO,SAAS,MAAO,QAAO,EAAE,OAAO,QAAA;AAClD,MAAI,OAAO,QAAQ,SAAS,KAAM,QAAO,EAAE,OAAO,MAAA;AAClD,SAAO,EAAE,OAAO,SAAS,OAAO,KAAK,IAAI,QAAQ,OAAO,IAAI,IAAI,OAAO,KAAA;AACzE;AAEA,MAAM,SAAS,CAAC,MAAoB,YAAkC;AAAA,EACpE,KAAK,KAAK,MAAM;AAAA,EAChB,QAAQ,KAAK,SAAS;AACxB;AAOO,SAAS,gBACd,QACA,OACA,KACA,aACA,QACmB;AACnB,QAAM,SAAS,OAAO,IAAI,UAAU,MAAM;AAC1C,QAAM,SAAS,IAAI,UAAU,OAAO,IAAI,QAAQ,MAAM;AACtD,QAAM,OAAO,CAACA,OAAiB,SAC7BA,UAAS,WACL,KAAK,UAAU,OAAO,SAAS,MAAM,OACrC,OAAO,MAAM,MAAM,MAAM,KAAK;AAEpC,QAAM,aAAkC;AAAA,IACtC,EAAE,MAAM,UAAU,SAAS,MAAA;AAAA,IAC3B,EAAE,MAAM,OAAO,SAAS,MAAA;AAAA,EAAM;AAEhC,MAAI,OAAQ,YAAW,KAAK,EAAE,MAAM,UAAU,SAAS,KAAA,GAAQ,EAAE,MA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,IAAc;AAE5B,QAAM,QAAuB,SAAS,UAClC,WAAW,QAAQ,OAAO,IAAI,SAAS,QAAQ,YAAY,QAAQ,IACnE,CAAA;AACJ,MAAI,CAAC,SAAS,WAAW,WAAW,UAAU,QAAW;AACvD,UAAM,YAAY,cAAc,WAAW,KAAK;AAAA,EAClD;AACA,MAAI,cAAc,OAAW,OAAM,YAAY;AAE/C,SAAO,OAAO,KAAK,KAAK,EAAE,SAAS,EAAE,OAAO,MAAM,MAAA,IAAU,EAAE,OAAO,KAAA;AACvE;AAEA,MAAM,YAAY,CAAC,IAAmB,IAAI,IAAmB,CAAA,MAAO;AAClE,QAAM,OAAO,OAAO,KAAK,CAAC;AAC1B,SAAO,KAAK,WAAW,OAAO,KAAK,CAAC,EAAE,UAAU,KAAK,MAAM,CAAC,QAAQ,EAAE,GAAG,MAAM,EAAE,GAAG,CAAC;AACvF;AAEO,MAAM,gBAAgB,CAAC,GAAmB,MAC/C,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,UAAU,EAAE,OAAO,EAAE,KAAK;;;;;;"}
|
package/dist/index142.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { PANEL_EDGE_MARGIN } from "./index68.js";
|
|
2
|
+
const DEFAULT_PLACEMENT = { align: "start", side: "bottom" };
|
|
3
|
+
function resolveHorizontal(anchor, width, boundary, margin) {
|
|
4
|
+
const left = boundary.left + margin;
|
|
5
|
+
const right = boundary.right - margin;
|
|
6
|
+
if (anchor.left + width <= right) return { align: "start" };
|
|
7
|
+
if (anchor.right - width >= left) return { align: "end" };
|
|
8
|
+
return { align: "start", shift: Math.max(right - width, left) - anchor.left };
|
|
9
|
+
}
|
|
10
|
+
const shrink = (rect, margin) => ({
|
|
11
|
+
top: rect.top + margin,
|
|
12
|
+
bottom: rect.bottom - margin
|
|
13
|
+
});
|
|
14
|
+
function resolveVertical(anchor, panel, box, currentSide, margin) {
|
|
15
|
+
const inside = shrink(box.vertical, margin);
|
|
16
|
+
const escape = box.escape && shrink(box.escape, margin);
|
|
17
|
+
const room = (side2, rect) => side2 === "bottom" ? rect.bottom - (anchor.bottom + panel.gap) : anchor.top - panel.gap - rect.top;
|
|
18
|
+
const candidates = [
|
|
19
|
+
{ side: "bottom", outside: false },
|
|
20
|
+
{ side: "top", outside: false }
|
|
21
|
+
];
|
|
22
|
+
if (escape) candidates.push({ side: "bottom", outside: true }, { side: "top", outside: true });
|
|
23
|
+
const fits = (c) => panel.height <= room(c.side, c.outside && escape ? escape : inside);
|
|
24
|
+
const kept = currentSide && candidates.find((c) => c.side === currentSide && fits(c));
|
|
25
|
+
const first = kept || candidates.find(fits);
|
|
26
|
+
if (first) return first;
|
|
27
|
+
const limit = escape ?? inside;
|
|
28
|
+
const side = room("bottom", limit) >= room("top", limit) ? "bottom" : "top";
|
|
29
|
+
return {
|
|
30
|
+
side,
|
|
31
|
+
outside: room(side, inside) < room(side, limit),
|
|
32
|
+
maxHeight: Math.max(room(side, limit), 0)
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function fixedStyle(anchor, panel, viewportBottom, horizontal, vertical) {
|
|
36
|
+
const below = vertical.side === "bottom";
|
|
37
|
+
return {
|
|
38
|
+
position: "fixed",
|
|
39
|
+
top: below ? anchor.bottom + panel.gap : "auto",
|
|
40
|
+
bottom: below ? "auto" : viewportBottom - anchor.top + panel.gap,
|
|
41
|
+
left: horizontal.align === "start" ? anchor.left + (horizontal.shift ?? 0) : anchor.right - panel.width,
|
|
42
|
+
right: "auto",
|
|
43
|
+
width: panel.width,
|
|
44
|
+
boxSizing: "border-box"
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function resolvePanelPlacement({
|
|
48
|
+
anchor,
|
|
49
|
+
panel,
|
|
50
|
+
box,
|
|
51
|
+
currentSide,
|
|
52
|
+
margin = PANEL_EDGE_MARGIN
|
|
53
|
+
}) {
|
|
54
|
+
if (panel.width === 0 || panel.height === 0) return DEFAULT_PLACEMENT;
|
|
55
|
+
const horizontal = resolveHorizontal(anchor, panel.width, box.horizontal, margin);
|
|
56
|
+
const vertical = resolveVertical(anchor, panel, box, currentSide, margin);
|
|
57
|
+
const { align } = horizontal;
|
|
58
|
+
const { side, maxHeight } = vertical;
|
|
59
|
+
const style = vertical.outside ? fixedStyle(anchor, panel, box.viewport.bottom, horizontal, vertical) : {};
|
|
60
|
+
if (!vertical.outside && horizontal.shift !== void 0) {
|
|
61
|
+
style.transform = `translateX(${horizontal.shift}px)`;
|
|
62
|
+
}
|
|
63
|
+
if (maxHeight !== void 0) style.maxHeight = maxHeight;
|
|
64
|
+
return Object.keys(style).length ? { align, side, style } : { align, side };
|
|
65
|
+
}
|
|
66
|
+
const sameStyle = (a = {}, b = {}) => {
|
|
67
|
+
const keys = Object.keys(a);
|
|
68
|
+
return keys.length === Object.keys(b).length && keys.every((key) => a[key] === b[key]);
|
|
69
|
+
};
|
|
70
|
+
const samePlacement = (a, b) => a.align === b.align && a.side === b.side && sameStyle(a.style, b.style);
|
|
71
|
+
export {
|
|
72
|
+
DEFAULT_PLACEMENT,
|
|
73
|
+
resolveHorizontal,
|
|
74
|
+
resolvePanelPlacement,
|
|
75
|
+
resolveVertical,
|
|
76
|
+
samePlacement
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=index142.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index142.js","sources":["../src/utils/panelPlacement.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport { PANEL_EDGE_MARGIN } from '../constants';\nimport type {\n AnchorRect,\n ClippingBox,\n HorizontalRect,\n PanelAlign,\n PanelPlacement,\n PanelSide,\n PanelSize,\n PlacementInput,\n VerticalRect,\n} from './panelPlacement.types';\n\nexport const DEFAULT_PLACEMENT: PanelPlacement = { align: 'start', side: 'bottom' };\n\ninterface HorizontalPlacement {\n align: PanelAlign;\n /** Px to move the start-aligned panel by, when it fits on neither side. */\n shift?: number;\n}\n\ninterface VerticalPlacement {\n side: PanelSide;\n /** True when the panel is placed against the viewport, outside the clipping box. */\n outside: boolean;\n maxHeight?: number;\n}\n\n/**\n * Left-aligned if it fits rightwards, else right-aligned if it fits leftwards, else\n * shifted just enough to fit, keeping its left edge visible first.\n */\nexport function resolveHorizontal(\n anchor: HorizontalRect,\n width: number,\n boundary: HorizontalRect,\n margin: number,\n): HorizontalPlacement {\n const left = boundary.left + margin;\n const right = boundary.right - margin;\n\n if (anchor.left + width <= right) return { align: 'start' };\n if (anchor.right - width >= left) return { align: 'end' };\n return { align: 'start', shift: Math.max(right - width, left) - anchor.left };\n}\n\nconst shrink = (rect: VerticalRect, margin: number): VerticalRect => ({\n top: rect.top + margin,\n bottom: rect.bottom - margin,\n});\n\n/**\n * Below, else above, inside the clipping box; else below, else above, in the escape\n * box; else on the side with more room, with the height limited to it. While open, the\n * current side is kept as long as the panel still fits on it.\n */\nexport function resolveVertical(\n anchor: VerticalRect,\n panel: PanelSize,\n box: ClippingBox,\n currentSide: PanelSide | null,\n margin: number,\n): VerticalPlacement {\n const inside = shrink(box.vertical, margin);\n const escape = box.escape && shrink(box.escape, margin);\n const room = (side: PanelSide, rect: VerticalRect) =>\n side === 'bottom'\n ? rect.bottom - (anchor.bottom + panel.gap)\n : anchor.top - panel.gap - rect.top;\n\n const candidates: VerticalPlacement[] = [\n { side: 'bottom', outside: false },\n { side: 'top', outside: false },\n ];\n if (escape) candidates.push({ side: 'bottom', outside: true }, { side: 'top', outside: true });\n const fits = (c: VerticalPlacement) =>\n panel.height <= room(c.side, c.outside && escape ? escape : inside);\n\n const kept = currentSide && candidates.find((c) => c.side === currentSide && fits(c));\n const first = kept || candidates.find(fits);\n if (first) return first;\n\n const limit = escape ?? inside;\n const side: PanelSide = room('bottom', limit) >= room('top', limit) ? 'bottom' : 'top';\n return {\n side,\n outside: room(side, inside) < room(side, limit),\n maxHeight: Math.max(room(side, limit), 0),\n };\n}\n\nfunction fixedStyle(\n anchor: AnchorRect,\n panel: PanelSize,\n viewportBottom: number,\n horizontal: HorizontalPlacement,\n vertical: VerticalPlacement,\n): CSSProperties {\n const below = vertical.side === 'bottom';\n return {\n position: 'fixed',\n top: below ? anchor.bottom + panel.gap : 'auto',\n bottom: below ? 'auto' : viewportBottom - anchor.top + panel.gap,\n left:\n horizontal.align === 'start'\n ? anchor.left + (horizontal.shift ?? 0)\n : anchor.right - panel.width,\n right: 'auto',\n width: panel.width,\n boxSizing: 'border-box',\n };\n}\n\n/**\n * Places a dropdown panel against its trigger so the boxes that clip it never cut it\n * off. Pure: takes the measured trigger, the panel measured in its default layout and\n * the clipping box. A panel that was never laid out keeps the default placement.\n */\nexport function resolvePanelPlacement({\n anchor,\n panel,\n box,\n currentSide,\n margin = PANEL_EDGE_MARGIN,\n}: PlacementInput): PanelPlacement {\n if (panel.width === 0 || panel.height === 0) return DEFAULT_PLACEMENT;\n\n const horizontal = resolveHorizontal(anchor, panel.width, box.horizontal, margin);\n const vertical = resolveVertical(anchor, panel, box, currentSide, margin);\n const { align } = horizontal;\n const { side, maxHeight } = vertical;\n\n const style: CSSProperties = vertical.outside\n ? fixedStyle(anchor, panel, box.viewport.bottom, horizontal, vertical)\n : {};\n if (!vertical.outside && horizontal.shift !== undefined) {\n style.transform = `translateX(${horizontal.shift}px)`;\n }\n if (maxHeight !== undefined) style.maxHeight = maxHeight;\n\n return Object.keys(style).length ? { align, side, style } : { align, side };\n}\n\nconst sameStyle = (a: CSSProperties = {}, b: CSSProperties = {}) => {\n const keys = Object.keys(a) as (keyof CSSProperties)[];\n return keys.length === Object.keys(b).length && keys.every((key) => a[key] === b[key]);\n};\n\nexport const samePlacement = (a: PanelPlacement, b: PanelPlacement) =>\n a.align === b.align && a.side === b.side && sameStyle(a.style, b.style);\n"],"names":["side"],"mappings":";AAcO,MAAM,oBAAoC,EAAE,OAAO,SAAS,MAAM,SAAA;AAmBlE,SAAS,kBACd,QACA,OACA,UACA,QACqB;AACrB,QAAM,OAAO,SAAS,OAAO;AAC7B,QAAM,QAAQ,SAAS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