@ktnpm_devops/react-component 0.23.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/composites/DatePickerDropdown/DatePickerDropdown.d.ts +1 -1
- package/dist/composites/DatePickerDropdown/DatePickerDropdown.d.ts.map +1 -1
- package/dist/composites/DatePickerDropdown/DatePickerDropdown.types.d.ts +6 -0
- package/dist/composites/DatePickerDropdown/DatePickerDropdown.types.d.ts.map +1 -1
- package/dist/composites/DatePickerDropdown/calendarDates.d.ts +9 -0
- package/dist/composites/DatePickerDropdown/calendarDates.d.ts.map +1 -0
- 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 +2 -11
- package/dist/index100.cjs.map +1 -1
- package/dist/index100.js +2 -11
- package/dist/index100.js.map +1 -1
- package/dist/index101.cjs +18 -18
- package/dist/index101.js +19 -19
- package/dist/index102.cjs +34 -10
- package/dist/index102.cjs.map +1 -1
- package/dist/index102.js +34 -10
- package/dist/index102.js.map +1 -1
- package/dist/index103.cjs +25 -64
- package/dist/index103.cjs.map +1 -1
- package/dist/index103.js +25 -64
- package/dist/index103.js.map +1 -1
- package/dist/index104.cjs +1 -4
- package/dist/index104.cjs.map +1 -1
- package/dist/index104.js +1 -4
- package/dist/index104.js.map +1 -1
- package/dist/index105.cjs +19 -16
- package/dist/index105.cjs.map +1 -1
- package/dist/index105.js +20 -17
- package/dist/index105.js.map +1 -1
- package/dist/index106.cjs +17 -2
- package/dist/index106.cjs.map +1 -1
- package/dist/index106.js +18 -3
- package/dist/index106.js.map +1 -1
- package/dist/index107.cjs +34 -16
- package/dist/index107.cjs.map +1 -1
- package/dist/index107.js +34 -16
- package/dist/index107.js.map +1 -1
- package/dist/index108.cjs +43 -6
- package/dist/index108.cjs.map +1 -1
- package/dist/index108.js +42 -5
- package/dist/index108.js.map +1 -1
- package/dist/index109.cjs +24 -24
- package/dist/index109.cjs.map +1 -1
- package/dist/index109.js +23 -23
- package/dist/index109.js.map +1 -1
- package/dist/index11.cjs +2 -2
- package/dist/index11.js +2 -2
- package/dist/index110.cjs +34 -68
- package/dist/index110.cjs.map +1 -1
- package/dist/index110.js +35 -69
- package/dist/index110.js.map +1 -1
- package/dist/index111.cjs +9 -34
- package/dist/index111.cjs.map +1 -1
- package/dist/index111.js +8 -33
- package/dist/index111.js.map +1 -1
- package/dist/index112.cjs +10 -6
- package/dist/index112.cjs.map +1 -1
- package/dist/index112.js +9 -5
- package/dist/index112.js.map +1 -1
- package/dist/index113.cjs +20 -40
- package/dist/index113.cjs.map +1 -1
- package/dist/index113.js +19 -39
- package/dist/index113.js.map +1 -1
- package/dist/index114.cjs +14 -85
- package/dist/index114.cjs.map +1 -1
- package/dist/index114.js +13 -84
- package/dist/index114.js.map +1 -1
- package/dist/index115.cjs +10 -51
- package/dist/index115.cjs.map +1 -1
- package/dist/index115.js +9 -50
- package/dist/index115.js.map +1 -1
- package/dist/index116.cjs +62 -14
- package/dist/index116.cjs.map +1 -1
- package/dist/index116.js +63 -15
- package/dist/index116.js.map +1 -1
- package/dist/index117.cjs +16 -13
- package/dist/index117.cjs.map +1 -1
- package/dist/index117.js +17 -14
- package/dist/index117.js.map +1 -1
- package/dist/index118.cjs +70 -6
- package/dist/index118.cjs.map +1 -1
- package/dist/index118.js +69 -5
- package/dist/index118.js.map +1 -1
- package/dist/index119.cjs +50 -24
- package/dist/index119.cjs.map +1 -1
- package/dist/index119.js +49 -23
- package/dist/index119.js.map +1 -1
- package/dist/index12.cjs +2 -2
- package/dist/index12.js +2 -2
- package/dist/index120.cjs +6 -19
- package/dist/index120.cjs.map +1 -1
- package/dist/index120.js +5 -18
- package/dist/index120.js.map +1 -1
- package/dist/index121.cjs +28 -7
- package/dist/index121.cjs.map +1 -1
- package/dist/index121.js +27 -6
- package/dist/index121.js.map +1 -1
- package/dist/index122.cjs +82 -4
- package/dist/index122.cjs.map +1 -1
- package/dist/index122.js +83 -5
- package/dist/index122.js.map +1 -1
- package/dist/index123.cjs +3 -30
- package/dist/index123.cjs.map +1 -1
- package/dist/index123.js +3 -30
- package/dist/index123.js.map +1 -1
- package/dist/index124.cjs +9 -9
- package/dist/index124.js +10 -10
- package/dist/index125.cjs +2 -11
- package/dist/index125.cjs.map +1 -1
- package/dist/index125.js +2 -11
- package/dist/index125.js.map +1 -1
- package/dist/index126.cjs +19 -52
- package/dist/index126.cjs.map +1 -1
- package/dist/index126.js +19 -52
- package/dist/index126.js.map +1 -1
- package/dist/index127.cjs +28 -16
- package/dist/index127.cjs.map +1 -1
- package/dist/index127.js +28 -16
- package/dist/index127.js.map +1 -1
- package/dist/index128.cjs +13 -19
- package/dist/index128.cjs.map +1 -1
- package/dist/index128.js +14 -20
- package/dist/index128.js.map +1 -1
- package/dist/index129.cjs +30 -15
- package/dist/index129.cjs.map +1 -1
- package/dist/index129.js +30 -15
- package/dist/index129.js.map +1 -1
- package/dist/index13.cjs +2 -2
- package/dist/index13.js +2 -2
- package/dist/index131.cjs +15 -36
- package/dist/index131.cjs.map +1 -1
- package/dist/index131.js +15 -36
- package/dist/index131.js.map +1 -1
- package/dist/index132.cjs +36 -51
- package/dist/index132.cjs.map +1 -1
- package/dist/index132.js +36 -51
- package/dist/index132.js.map +1 -1
- package/dist/index133.cjs +14 -14
- package/dist/index133.js +15 -15
- package/dist/index134.cjs +21 -34
- package/dist/index134.cjs.map +1 -1
- package/dist/index134.js +20 -33
- package/dist/index134.js.map +1 -1
- package/dist/index135.cjs +38 -1162
- package/dist/index135.cjs.map +1 -1
- package/dist/index135.js +37 -1162
- package/dist/index135.js.map +1 -1
- package/dist/index136.cjs +85 -1568
- package/dist/index136.cjs.map +1 -1
- package/dist/index136.js +84 -1568
- package/dist/index136.js.map +1 -1
- package/dist/index137.cjs +40 -49
- package/dist/index137.cjs.map +1 -1
- package/dist/index137.js +39 -48
- package/dist/index137.js.map +1 -1
- package/dist/index138.cjs +15 -75
- package/dist/index138.cjs.map +1 -1
- package/dist/index138.js +14 -74
- package/dist/index138.js.map +1 -1
- package/dist/index139.cjs +87 -0
- package/dist/index139.cjs.map +1 -0
- package/dist/index139.js +87 -0
- package/dist/index139.js.map +1 -0
- 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 +3 -3
- package/dist/index16.js +3 -3
- 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 +3 -3
- package/dist/index23.js +3 -3
- package/dist/index24.cjs +4 -4
- package/dist/index24.js +4 -4
- package/dist/index25.cjs +4 -4
- package/dist/index25.js +4 -4
- 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 -184
- package/dist/index29.cjs.map +1 -1
- package/dist/index29.js +58 -184
- 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 +126 -136
- 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 +85 -100
- 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 +107 -58
- package/dist/index43.cjs.map +1 -1
- package/dist/index43.js +108 -59
- package/dist/index43.js.map +1 -1
- package/dist/index44.cjs +66 -76
- 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 +128 -73
- 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 +66 -181
- 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 +15 -64
- package/dist/index60.cjs.map +1 -1
- package/dist/index60.js +17 -66
- package/dist/index60.js.map +1 -1
- package/dist/index61.cjs +67 -15
- package/dist/index61.cjs.map +1 -1
- package/dist/index61.js +66 -14
- package/dist/index61.js.map +1 -1
- package/dist/index62.cjs +4 -28
- package/dist/index62.cjs.map +1 -1
- package/dist/index62.js +3 -27
- package/dist/index62.js.map +1 -1
- package/dist/index63.cjs +10 -24
- package/dist/index63.cjs.map +1 -1
- package/dist/index63.js +9 -23
- package/dist/index63.js.map +1 -1
- package/dist/index64.cjs +15 -18
- package/dist/index64.cjs.map +1 -1
- package/dist/index64.js +15 -18
- package/dist/index64.js.map +1 -1
- package/dist/index65.cjs +22 -22
- package/dist/index65.js +22 -22
- package/dist/index66.cjs +19 -4
- package/dist/index66.cjs.map +1 -1
- package/dist/index66.js +18 -3
- package/dist/index66.js.map +1 -1
- package/dist/index67.cjs +18 -10
- package/dist/index67.cjs.map +1 -1
- package/dist/index67.js +17 -9
- package/dist/index67.js.map +1 -1
- package/dist/index68.cjs +151 -19
- package/dist/index68.cjs.map +1 -1
- package/dist/index68.js +149 -17
- package/dist/index68.js.map +1 -1
- package/dist/index69.cjs +18 -15
- package/dist/index69.cjs.map +1 -1
- package/dist/index69.js +18 -15
- package/dist/index69.js.map +1 -1
- package/dist/index70.cjs +19 -145
- package/dist/index70.cjs.map +1 -1
- package/dist/index70.js +17 -143
- package/dist/index70.js.map +1 -1
- package/dist/index71.cjs +22 -37
- package/dist/index71.cjs.map +1 -1
- package/dist/index71.js +22 -37
- package/dist/index71.js.map +1 -1
- package/dist/index72.cjs +22 -134
- package/dist/index72.cjs.map +1 -1
- package/dist/index72.js +21 -133
- 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 +22 -25
- package/dist/index74.cjs.map +1 -1
- package/dist/index74.js +23 -26
- package/dist/index74.js.map +1 -1
- package/dist/index75.cjs +9 -113
- package/dist/index75.cjs.map +1 -1
- package/dist/index75.js +9 -113
- package/dist/index75.js.map +1 -1
- package/dist/index76.cjs +40 -25
- package/dist/index76.cjs.map +1 -1
- package/dist/index76.js +41 -26
- 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 +25 -40
- package/dist/index78.cjs.map +1 -1
- package/dist/index78.js +26 -41
- package/dist/index78.js.map +1 -1
- package/dist/index79.cjs +70 -32
- package/dist/index79.cjs.map +1 -1
- package/dist/index79.js +70 -32
- package/dist/index79.js.map +1 -1
- package/dist/index80.cjs +57 -43
- package/dist/index80.cjs.map +1 -1
- package/dist/index80.js +56 -42
- package/dist/index80.js.map +1 -1
- package/dist/index81.cjs +15 -24
- package/dist/index81.cjs.map +1 -1
- package/dist/index81.js +14 -23
- package/dist/index81.js.map +1 -1
- package/dist/index82.cjs +132 -38
- package/dist/index82.cjs.map +1 -1
- package/dist/index82.js +132 -38
- package/dist/index82.js.map +1 -1
- package/dist/index83.cjs +46 -9
- package/dist/index83.cjs.map +1 -1
- package/dist/index83.js +45 -8
- package/dist/index83.js.map +1 -1
- package/dist/index84.cjs +9 -10
- package/dist/index84.cjs.map +1 -1
- package/dist/index84.js +8 -9
- package/dist/index84.js.map +1 -1
- package/dist/index85.cjs +34 -20
- package/dist/index85.cjs.map +1 -1
- package/dist/index85.js +33 -19
- package/dist/index85.js.map +1 -1
- package/dist/index86.cjs +52 -14
- package/dist/index86.cjs.map +1 -1
- package/dist/index86.js +51 -13
- package/dist/index86.js.map +1 -1
- package/dist/index87.cjs +33 -10
- package/dist/index87.cjs.map +1 -1
- package/dist/index87.js +33 -10
- package/dist/index87.js.map +1 -1
- package/dist/index88.cjs +8 -62
- package/dist/index88.cjs.map +1 -1
- package/dist/index88.js +9 -63
- package/dist/index88.js.map +1 -1
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +1 -1
- package/dist/index93.cjs +10 -48
- package/dist/index93.cjs.map +1 -1
- package/dist/index93.js +9 -47
- package/dist/index93.js.map +1 -1
- package/dist/index94.cjs +45 -15
- package/dist/index94.cjs.map +1 -1
- package/dist/index94.js +45 -15
- package/dist/index94.js.map +1 -1
- package/dist/index95.cjs +18 -37
- package/dist/index95.cjs.map +1 -1
- package/dist/index95.js +17 -36
- package/dist/index95.js.map +1 -1
- package/dist/index96.cjs +36 -39
- package/dist/index96.cjs.map +1 -1
- package/dist/index96.js +35 -38
- package/dist/index96.js.map +1 -1
- package/dist/index97.cjs +6 -92
- package/dist/index97.cjs.map +1 -1
- package/dist/index97.js +5 -91
- package/dist/index97.js.map +1 -1
- package/dist/index98.cjs +64 -34
- package/dist/index98.cjs.map +1 -1
- package/dist/index98.js +64 -34
- package/dist/index98.js.map +1 -1
- package/dist/index99.cjs +17 -6
- package/dist/index99.cjs.map +1 -1
- package/dist/index99.js +16 -5
- 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/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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MAAM;AACxE,QAAM,EAAE,UAAU;AAClB,QAAM,EAAE,MAAM,UAAA,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,QAC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