@spectrum-web-components/overlay 1.0.2 → 1.0.3
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/LICENSE +201 -0
- package/custom-elements.json +189 -73
- package/package.json +8 -7
- package/src/Overlay.d.ts +348 -18
- package/src/Overlay.dev.js +271 -12
- package/src/Overlay.dev.js.map +2 -2
- package/src/Overlay.js +4 -4
- package/src/Overlay.js.map +3 -3
- package/src/PlacementController.d.ts +118 -1
- package/src/PlacementController.dev.js +75 -0
- package/src/PlacementController.dev.js.map +2 -2
- package/src/PlacementController.js.map +2 -2
- package/src/overlay.css.dev.js +1 -1
- package/src/overlay.css.dev.js.map +1 -1
- package/src/overlay.css.js +1 -1
- package/src/overlay.css.js.map +1 -1
- package/stories/index.js +48 -0
- package/stories/index.js.map +7 -0
- package/stories/overlay-directive.stories.js +324 -0
- package/stories/overlay-directive.stories.js.map +7 -0
- package/stories/overlay-element.stories.js +675 -0
- package/stories/overlay-element.stories.js.map +7 -0
- package/stories/overlay-story-components.js +338 -0
- package/stories/overlay-story-components.js.map +7 -0
- package/stories/overlay.stories.js +1397 -0
- package/stories/overlay.stories.js.map +7 -0
- package/test/benchmark/basic-test.js +40 -0
- package/test/benchmark/basic-test.js.map +7 -0
- package/test/benchmark/directive-test.js +43 -0
- package/test/benchmark/directive-test.js.map +7 -0
- package/test/benchmark/element-test.js +40 -0
- package/test/benchmark/element-test.js.map +7 -0
- package/test/benchmark/lazy-test.js +47 -0
- package/test/benchmark/lazy-test.js.map +7 -0
- package/test/index.js +605 -0
- package/test/index.js.map +7 -0
- package/test/overlay-directive.test-vrt.js +5 -0
- package/test/overlay-directive.test-vrt.js.map +7 -0
- package/test/overlay-directive.test.js +162 -0
- package/test/overlay-directive.test.js.map +7 -0
- package/test/overlay-element.test-vrt.js +5 -0
- package/test/overlay-element.test-vrt.js.map +7 -0
- package/test/overlay-element.test.js +934 -0
- package/test/overlay-element.test.js.map +7 -0
- package/test/overlay-lifecycle.test.js +139 -0
- package/test/overlay-lifecycle.test.js.map +7 -0
- package/test/overlay-memory.test.js +10 -0
- package/test/overlay-memory.test.js.map +7 -0
- package/test/overlay-timer.test.js +118 -0
- package/test/overlay-timer.test.js.map +7 -0
- package/test/overlay-trigger-click.test.js +164 -0
- package/test/overlay-trigger-click.test.js.map +7 -0
- package/test/overlay-trigger-directive.test.js +75 -0
- package/test/overlay-trigger-directive.test.js.map +7 -0
- package/test/overlay-trigger-extended.test.js +235 -0
- package/test/overlay-trigger-extended.test.js.map +7 -0
- package/test/overlay-trigger-hover-click.test.js +225 -0
- package/test/overlay-trigger-hover-click.test.js.map +7 -0
- package/test/overlay-trigger-hover.test.js +308 -0
- package/test/overlay-trigger-hover.test.js.map +7 -0
- package/test/overlay-trigger-longpress.test.js +549 -0
- package/test/overlay-trigger-longpress.test.js.map +7 -0
- package/test/overlay-trigger-sync.test.js +5 -0
- package/test/overlay-trigger-sync.test.js.map +7 -0
- package/test/overlay-trigger.test.js +5 -0
- package/test/overlay-trigger.test.js.map +7 -0
- package/test/overlay-update.test.js +28 -0
- package/test/overlay-update.test.js.map +7 -0
- package/test/overlay-v1.test.js +569 -0
- package/test/overlay-v1.test.js.map +7 -0
- package/test/overlay.test-vrt.js +5 -0
- package/test/overlay.test-vrt.js.map +7 -0
- package/test/overlay.test.js +776 -0
- package/test/overlay.test.js.map +7 -0
package/custom-elements.json
CHANGED
|
@@ -1764,7 +1764,8 @@
|
|
|
1764
1764
|
"type": {
|
|
1765
1765
|
"text": "boolean"
|
|
1766
1766
|
},
|
|
1767
|
-
"description": "An Overlay that is `delayed` will wait until a warm-up period of 1000ms\nhas completed before opening. Once the
|
|
1767
|
+
"description": "An Overlay that is `delayed` will wait until a warm-up period of 1000ms\nhas completed before opening. Once the warm-up period has completed, all\nsubsequent Overlays will open immediately. When no Overlays are opened,\na cool-down period of 1000ms will begin. Once the cool-down has completed,\nthe next Overlay to be opened will be subject to the warm-up period if\nprovided that option.\n\nThis behavior helps to manage the performance and user experience by\npreventing multiple overlays from opening simultaneously and ensuring\na smooth transition between opening and closing overlays.",
|
|
1768
|
+
"default": "false",
|
|
1768
1769
|
"attribute": "delayed"
|
|
1769
1770
|
},
|
|
1770
1771
|
{
|
|
@@ -1781,7 +1782,8 @@
|
|
|
1781
1782
|
"name": "dialogEl",
|
|
1782
1783
|
"type": {
|
|
1783
1784
|
"text": "HTMLDialogElement & {\n showPopover(): void;\n hidePopover(): void;\n }"
|
|
1784
|
-
}
|
|
1785
|
+
},
|
|
1786
|
+
"description": "A reference to the dialog element within the overlay.\nThis element is expected to have `showPopover` and `hidePopover` methods."
|
|
1785
1787
|
},
|
|
1786
1788
|
{
|
|
1787
1789
|
"kind": "field",
|
|
@@ -1789,7 +1791,8 @@
|
|
|
1789
1791
|
"type": {
|
|
1790
1792
|
"text": "boolean"
|
|
1791
1793
|
},
|
|
1792
|
-
"description": "
|
|
1794
|
+
"description": "Indicates whether the overlay is currently functional or not.\n\nWhen set to `true`, the overlay is disabled, and any active strategy is aborted.\nThe overlay will also close if it is currently open. When set to `false`, the\noverlay will re-bind events and re-open if it was previously open.",
|
|
1795
|
+
"default": "false",
|
|
1793
1796
|
"attribute": "disabled"
|
|
1794
1797
|
},
|
|
1795
1798
|
{
|
|
@@ -1806,7 +1809,8 @@
|
|
|
1806
1809
|
"name": "elements",
|
|
1807
1810
|
"type": {
|
|
1808
1811
|
"text": "OpenableElement[]"
|
|
1809
|
-
}
|
|
1812
|
+
},
|
|
1813
|
+
"description": "A query to gather all elements slotted into the default slot, excluding elements\nwith the slot name \"longpress-describedby-descriptor\"."
|
|
1810
1814
|
},
|
|
1811
1815
|
{
|
|
1812
1816
|
"kind": "field",
|
|
@@ -1814,7 +1818,8 @@
|
|
|
1814
1818
|
"type": {
|
|
1815
1819
|
"text": "Overlay | undefined"
|
|
1816
1820
|
},
|
|
1817
|
-
"privacy": "public"
|
|
1821
|
+
"privacy": "public",
|
|
1822
|
+
"description": "A reference to the parent overlay that should be force-closed, if any."
|
|
1818
1823
|
},
|
|
1819
1824
|
{
|
|
1820
1825
|
"kind": "field",
|
|
@@ -1823,6 +1828,12 @@
|
|
|
1823
1828
|
"text": "boolean"
|
|
1824
1829
|
},
|
|
1825
1830
|
"privacy": "private",
|
|
1831
|
+
"description": "Determines if the overlay has a non-virtual trigger element.",
|
|
1832
|
+
"return": {
|
|
1833
|
+
"type": {
|
|
1834
|
+
"text": "boolean"
|
|
1835
|
+
}
|
|
1836
|
+
},
|
|
1826
1837
|
"readonly": true
|
|
1827
1838
|
},
|
|
1828
1839
|
{
|
|
@@ -1832,7 +1843,7 @@
|
|
|
1832
1843
|
"text": "number | [number, number]"
|
|
1833
1844
|
},
|
|
1834
1845
|
"default": "0",
|
|
1835
|
-
"description": "The `offset` property accepts either a single number
|
|
1846
|
+
"description": "The `offset` property accepts either a single number to define the offset of the\nOverlay along the main axis from the trigger, or a 2-tuple to define the offset\nalong both the main axis and the cross axis. This option has no effect when there\nis no trigger element.",
|
|
1836
1847
|
"attribute": "offset"
|
|
1837
1848
|
},
|
|
1838
1849
|
{
|
|
@@ -1842,6 +1853,12 @@
|
|
|
1842
1853
|
"text": "PlacementController"
|
|
1843
1854
|
},
|
|
1844
1855
|
"privacy": "protected",
|
|
1856
|
+
"description": "Provides an instance of the `PlacementController` for managing the positioning\nof the overlay relative to its trigger element.\n\nIf the `PlacementController` instance does not already exist, it is created and\nassigned to the `_placementController` property.",
|
|
1857
|
+
"return": {
|
|
1858
|
+
"type": {
|
|
1859
|
+
"text": "PlacementController"
|
|
1860
|
+
}
|
|
1861
|
+
},
|
|
1845
1862
|
"readonly": true
|
|
1846
1863
|
},
|
|
1847
1864
|
{
|
|
@@ -1850,7 +1867,8 @@
|
|
|
1850
1867
|
"type": {
|
|
1851
1868
|
"text": "boolean"
|
|
1852
1869
|
},
|
|
1853
|
-
"description": "
|
|
1870
|
+
"description": "Indicates whether the Overlay is projected onto the \"top layer\" or not.\n\nWhen set to `true`, the overlay is open and visible. When set to `false`, the overlay is closed and hidden.",
|
|
1871
|
+
"default": "false",
|
|
1854
1872
|
"attribute": "open",
|
|
1855
1873
|
"reflects": true
|
|
1856
1874
|
},
|
|
@@ -1870,7 +1888,8 @@
|
|
|
1870
1888
|
"text": "number"
|
|
1871
1889
|
},
|
|
1872
1890
|
"static": true,
|
|
1873
|
-
"default": "1"
|
|
1891
|
+
"default": "1",
|
|
1892
|
+
"description": "Tracks the number of overlays that have been opened.\n\nThis static property is used to manage the stacking context of multiple overlays."
|
|
1874
1893
|
},
|
|
1875
1894
|
{
|
|
1876
1895
|
"kind": "field",
|
|
@@ -1878,7 +1897,7 @@
|
|
|
1878
1897
|
"type": {
|
|
1879
1898
|
"text": "\"top\" | \"top-start\" | \"top-end\" | \"right\" | \"right-start\" | \"right-end\" | \"bottom\" | \"bottom-start\" | \"bottom-end\" | \"left\" | \"left-start\" | \"left-end\""
|
|
1880
1899
|
},
|
|
1881
|
-
"description": "Instruct the Overlay where to place itself in
|
|
1900
|
+
"description": "Instruct the Overlay where to place itself in relationship to the trigger element.",
|
|
1882
1901
|
"attribute": "placement"
|
|
1883
1902
|
},
|
|
1884
1903
|
{
|
|
@@ -1889,7 +1908,7 @@
|
|
|
1889
1908
|
},
|
|
1890
1909
|
"privacy": "private",
|
|
1891
1910
|
"default": "false",
|
|
1892
|
-
"description": "The state in which the last `request-slottable` event was dispatched.\
|
|
1911
|
+
"description": "The state in which the last `request-slottable` event was dispatched.\n\nThis property ensures that overlays do not dispatch the same state twice in a row."
|
|
1893
1912
|
},
|
|
1894
1913
|
{
|
|
1895
1914
|
"kind": "field",
|
|
@@ -1906,14 +1925,17 @@
|
|
|
1906
1925
|
"name": "slotEl",
|
|
1907
1926
|
"type": {
|
|
1908
1927
|
"text": "HTMLSlotElement"
|
|
1909
|
-
}
|
|
1928
|
+
},
|
|
1929
|
+
"description": "A reference to the slot element within the overlay.\n\nThis element is used to manage the content slotted into the overlay."
|
|
1910
1930
|
},
|
|
1911
1931
|
{
|
|
1912
1932
|
"kind": "field",
|
|
1913
1933
|
"name": "state",
|
|
1914
1934
|
"type": {
|
|
1915
1935
|
"text": "OverlayState"
|
|
1916
|
-
}
|
|
1936
|
+
},
|
|
1937
|
+
"description": "The current state of the overlay.\n\nThis property reflects the current state of the overlay, such as 'opened' or 'closed'.\nWhen the state changes, it triggers the appropriate actions and updates the component.",
|
|
1938
|
+
"default": "'closed'"
|
|
1917
1939
|
},
|
|
1918
1940
|
{
|
|
1919
1941
|
"kind": "field",
|
|
@@ -1929,23 +1951,25 @@
|
|
|
1929
1951
|
"type": {
|
|
1930
1952
|
"text": "ClickController | HoverController | LongpressController | undefined"
|
|
1931
1953
|
},
|
|
1932
|
-
"privacy": "public"
|
|
1954
|
+
"privacy": "public",
|
|
1955
|
+
"description": "The interaction strategy for opening the overlay.\nThis can be a ClickController, HoverController, or LongpressController."
|
|
1933
1956
|
},
|
|
1934
1957
|
{
|
|
1935
1958
|
"kind": "field",
|
|
1936
1959
|
"name": "tipPadding",
|
|
1937
1960
|
"type": {
|
|
1938
|
-
"text": "number
|
|
1961
|
+
"text": "number"
|
|
1939
1962
|
},
|
|
1963
|
+
"description": "The padding around the tip of the overlay.\nThis property defines the padding around the tip of the overlay, which can be used to adjust its positioning.",
|
|
1940
1964
|
"attribute": "tip-padding"
|
|
1941
1965
|
},
|
|
1942
1966
|
{
|
|
1943
1967
|
"kind": "field",
|
|
1944
1968
|
"name": "trigger",
|
|
1945
1969
|
"type": {
|
|
1946
|
-
"text": "string
|
|
1970
|
+
"text": "string"
|
|
1947
1971
|
},
|
|
1948
|
-
"description": "An optional ID reference for the trigger element combined with the optional\ninteraction (click | hover | longpress) by which the overlay
|
|
1972
|
+
"description": "An optional ID reference for the trigger element combined with the optional\ninteraction (click | hover | longpress) by which the overlay should open.\nThe format is `trigger@interaction`, e.g., `trigger@click` opens the overlay\nwhen an element with the ID \"trigger\" is clicked.",
|
|
1949
1973
|
"attribute": "trigger"
|
|
1950
1974
|
},
|
|
1951
1975
|
{
|
|
@@ -1955,15 +1979,15 @@
|
|
|
1955
1979
|
"text": "HTMLElement | VirtualTrigger | null"
|
|
1956
1980
|
},
|
|
1957
1981
|
"default": "null",
|
|
1958
|
-
"description": "An element reference for the trigger element that the overlay should relate to."
|
|
1982
|
+
"description": "An element reference for the trigger element that the overlay should relate to.\nThis property is not reflected as an attribute."
|
|
1959
1983
|
},
|
|
1960
1984
|
{
|
|
1961
1985
|
"kind": "field",
|
|
1962
1986
|
"name": "triggerInteraction",
|
|
1963
1987
|
"type": {
|
|
1964
|
-
"text": "TriggerInteraction
|
|
1988
|
+
"text": "TriggerInteraction"
|
|
1965
1989
|
},
|
|
1966
|
-
"description": "The specific interaction to listen for on the `triggerElement` to open the overlay."
|
|
1990
|
+
"description": "The specific interaction to listen for on the `triggerElement` to open the overlay.\nThis property is not reflected as an attribute."
|
|
1967
1991
|
},
|
|
1968
1992
|
{
|
|
1969
1993
|
"kind": "field",
|
|
@@ -1982,7 +2006,8 @@
|
|
|
1982
2006
|
"text": "boolean"
|
|
1983
2007
|
},
|
|
1984
2008
|
"privacy": "protected",
|
|
1985
|
-
"default": "false"
|
|
2009
|
+
"default": "false",
|
|
2010
|
+
"description": "Tracks whether the overlay was previously open.\nThis is used to restore the open state when re-enabling the overlay."
|
|
1986
2011
|
},
|
|
1987
2012
|
{
|
|
1988
2013
|
"kind": "field",
|
|
@@ -1991,6 +2016,12 @@
|
|
|
1991
2016
|
"text": "ElementResolutionController"
|
|
1992
2017
|
},
|
|
1993
2018
|
"privacy": "protected",
|
|
2019
|
+
"description": "Provides an instance of the `ElementResolutionController` for managing the element\nthat the overlay should be associated with. If the instance does not already exist,\nit is created and assigned to the `_elementResolver` property.",
|
|
2020
|
+
"return": {
|
|
2021
|
+
"type": {
|
|
2022
|
+
"text": "ElementResolutionController"
|
|
2023
|
+
}
|
|
2024
|
+
},
|
|
1994
2025
|
"readonly": true
|
|
1995
2026
|
},
|
|
1996
2027
|
{
|
|
@@ -2000,6 +2031,12 @@
|
|
|
2000
2031
|
"text": "boolean"
|
|
2001
2032
|
},
|
|
2002
2033
|
"privacy": "private",
|
|
2034
|
+
"description": "Determines if the overlay uses a dialog.\nReturns `true` if the overlay type is \"modal\" or \"page\".",
|
|
2035
|
+
"return": {
|
|
2036
|
+
"type": {
|
|
2037
|
+
"text": "boolean"
|
|
2038
|
+
}
|
|
2039
|
+
},
|
|
2003
2040
|
"readonly": true
|
|
2004
2041
|
},
|
|
2005
2042
|
{
|
|
@@ -2009,15 +2046,27 @@
|
|
|
2009
2046
|
"text": "'auto' | 'manual' | undefined"
|
|
2010
2047
|
},
|
|
2011
2048
|
"privacy": "private",
|
|
2049
|
+
"description": "Determines the value for the popover attribute based on the overlay type.",
|
|
2050
|
+
"return": {
|
|
2051
|
+
"type": {
|
|
2052
|
+
"text": "'auto' | 'manual' | undefined"
|
|
2053
|
+
}
|
|
2054
|
+
},
|
|
2012
2055
|
"readonly": true
|
|
2013
2056
|
},
|
|
2014
2057
|
{
|
|
2015
2058
|
"kind": "field",
|
|
2016
|
-
"name": "
|
|
2059
|
+
"name": "requiresPositioning",
|
|
2017
2060
|
"type": {
|
|
2018
2061
|
"text": "boolean"
|
|
2019
2062
|
},
|
|
2020
2063
|
"privacy": "protected",
|
|
2064
|
+
"description": "Determines if the overlay requires positioning based on its type and state.",
|
|
2065
|
+
"return": {
|
|
2066
|
+
"type": {
|
|
2067
|
+
"text": "boolean"
|
|
2068
|
+
}
|
|
2069
|
+
},
|
|
2021
2070
|
"readonly": true
|
|
2022
2071
|
},
|
|
2023
2072
|
{
|
|
@@ -2028,7 +2077,8 @@
|
|
|
2028
2077
|
"type": {
|
|
2029
2078
|
"text": "void"
|
|
2030
2079
|
}
|
|
2031
|
-
}
|
|
2080
|
+
},
|
|
2081
|
+
"description": "Manages the positioning of the overlay relative to its trigger element.\n\nThis method calculates the necessary parameters for positioning the overlay,\nsuch as offset, placement, and tip padding, and then delegates the actual\npositioning to the `PlacementController`."
|
|
2032
2082
|
},
|
|
2033
2083
|
{
|
|
2034
2084
|
"kind": "method",
|
|
@@ -2038,7 +2088,8 @@
|
|
|
2038
2088
|
"type": {
|
|
2039
2089
|
"text": "Promise<void>"
|
|
2040
2090
|
}
|
|
2041
|
-
}
|
|
2091
|
+
},
|
|
2092
|
+
"description": "Manages the process of opening the popover.\n\nThis method handles the necessary steps to open the popover, including managing delays,\nensuring the popover is in the DOM, making transitions, and applying focus."
|
|
2042
2093
|
},
|
|
2043
2094
|
{
|
|
2044
2095
|
"kind": "method",
|
|
@@ -2054,15 +2105,18 @@
|
|
|
2054
2105
|
"name": "targetOpenState",
|
|
2055
2106
|
"type": {
|
|
2056
2107
|
"text": "boolean"
|
|
2057
|
-
}
|
|
2108
|
+
},
|
|
2109
|
+
"description": "The target open state of the overlay."
|
|
2058
2110
|
},
|
|
2059
2111
|
{
|
|
2060
2112
|
"name": "focusEl",
|
|
2061
2113
|
"type": {
|
|
2062
2114
|
"text": "HTMLElement | null"
|
|
2063
|
-
}
|
|
2115
|
+
},
|
|
2116
|
+
"description": "The element to focus after opening the popover."
|
|
2064
2117
|
}
|
|
2065
|
-
]
|
|
2118
|
+
],
|
|
2119
|
+
"description": "Applies focus to the appropriate element after the popover has been opened.\n\nThis method handles the focus management for the overlay, ensuring that the correct\nelement receives focus based on the overlay's type and state."
|
|
2066
2120
|
},
|
|
2067
2121
|
{
|
|
2068
2122
|
"kind": "method",
|
|
@@ -2072,12 +2126,23 @@
|
|
|
2072
2126
|
"type": {
|
|
2073
2127
|
"text": "void"
|
|
2074
2128
|
}
|
|
2075
|
-
}
|
|
2129
|
+
},
|
|
2130
|
+
"description": "Returns focus to the trigger element if the overlay is closed.\n\nThis method ensures that focus is returned to the trigger element when the overlay is closed,\nunless the overlay is of type \"hint\" or the focus is already outside the overlay."
|
|
2076
2131
|
},
|
|
2077
2132
|
{
|
|
2078
2133
|
"kind": "field",
|
|
2079
2134
|
"name": "closeOnFocusOut",
|
|
2080
|
-
"privacy": "private"
|
|
2135
|
+
"privacy": "private",
|
|
2136
|
+
"description": "Handles the focus out event to close the overlay if the focus moves outside of it.\n\nThis method ensures that the overlay is closed when the focus moves to an element\noutside of the overlay, unless the focus is moved to a related element.",
|
|
2137
|
+
"parameters": [
|
|
2138
|
+
{
|
|
2139
|
+
"description": "The focus out event.",
|
|
2140
|
+
"name": "event",
|
|
2141
|
+
"type": {
|
|
2142
|
+
"text": "FocusEvent"
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
]
|
|
2081
2146
|
},
|
|
2082
2147
|
{
|
|
2083
2148
|
"kind": "method",
|
|
@@ -2093,9 +2158,11 @@
|
|
|
2093
2158
|
"name": "oldOpen",
|
|
2094
2159
|
"type": {
|
|
2095
2160
|
"text": "boolean"
|
|
2096
|
-
}
|
|
2161
|
+
},
|
|
2162
|
+
"description": "The previous open state of the overlay."
|
|
2097
2163
|
}
|
|
2098
|
-
]
|
|
2164
|
+
],
|
|
2165
|
+
"description": "Manages the process of opening or closing the overlay.\n\nThis method handles the necessary steps to open or close the overlay, including updating the state,\nmanaging the overlay stack, and handling focus events."
|
|
2099
2166
|
},
|
|
2100
2167
|
{
|
|
2101
2168
|
"kind": "method",
|
|
@@ -2105,7 +2172,8 @@
|
|
|
2105
2172
|
"type": {
|
|
2106
2173
|
"text": "void"
|
|
2107
2174
|
}
|
|
2108
|
-
}
|
|
2175
|
+
},
|
|
2176
|
+
"description": "Binds event handling strategies to the overlay based on the specified trigger interaction.\n\nThis method sets up the appropriate event handling strategy for the overlay, ensuring that\nit responds correctly to user interactions such as clicks, hovers, or long presses."
|
|
2109
2177
|
},
|
|
2110
2178
|
{
|
|
2111
2179
|
"kind": "method",
|
|
@@ -2121,9 +2189,11 @@
|
|
|
2121
2189
|
"name": "event",
|
|
2122
2190
|
"type": {
|
|
2123
2191
|
"text": "Event & { newState: string }"
|
|
2124
|
-
}
|
|
2192
|
+
},
|
|
2193
|
+
"description": "The `beforetoggle` event with the new state."
|
|
2125
2194
|
}
|
|
2126
|
-
]
|
|
2195
|
+
],
|
|
2196
|
+
"description": "Handles the `beforetoggle` event to manage the overlay's state.\n\nThis method checks the new state of the event and calls `handleBrowserClose`\nif the new state is not 'open'."
|
|
2127
2197
|
},
|
|
2128
2198
|
{
|
|
2129
2199
|
"kind": "method",
|
|
@@ -2139,9 +2209,11 @@
|
|
|
2139
2209
|
"name": "event",
|
|
2140
2210
|
"type": {
|
|
2141
2211
|
"text": "Event"
|
|
2142
|
-
}
|
|
2212
|
+
},
|
|
2213
|
+
"description": "The browser's close event."
|
|
2143
2214
|
}
|
|
2144
|
-
]
|
|
2215
|
+
],
|
|
2216
|
+
"description": "Handles the browser's close event to manage the overlay's state.\n\nThis method stops the propagation of the event and closes the overlay if it is not\nactively opening. If the overlay is actively opening, it calls `manuallyKeepOpen`."
|
|
2145
2217
|
},
|
|
2146
2218
|
{
|
|
2147
2219
|
"kind": "method",
|
|
@@ -2151,7 +2223,8 @@
|
|
|
2151
2223
|
"type": {
|
|
2152
2224
|
"text": "void"
|
|
2153
2225
|
}
|
|
2154
|
-
}
|
|
2226
|
+
},
|
|
2227
|
+
"description": "Manually keeps the overlay open.\n\nThis method sets the overlay to open, allows placement updates, and manages the open state."
|
|
2155
2228
|
},
|
|
2156
2229
|
{
|
|
2157
2230
|
"kind": "method",
|
|
@@ -2161,7 +2234,8 @@
|
|
|
2161
2234
|
"type": {
|
|
2162
2235
|
"text": "void"
|
|
2163
2236
|
}
|
|
2164
|
-
}
|
|
2237
|
+
},
|
|
2238
|
+
"description": "Handles the `slotchange` event to manage the overlay's state.\n\nThis method checks if there are any elements in the slot. If there are no elements,\nit releases the description from the strategy. If there are elements and the trigger\nis non-virtual, it prepares the description for the trigger element."
|
|
2165
2239
|
},
|
|
2166
2240
|
{
|
|
2167
2241
|
"kind": "method",
|
|
@@ -2171,7 +2245,8 @@
|
|
|
2171
2245
|
"type": {
|
|
2172
2246
|
"text": "boolean"
|
|
2173
2247
|
}
|
|
2174
|
-
}
|
|
2248
|
+
},
|
|
2249
|
+
"description": "Determines whether the overlay should prevent closing.\n\nThis method checks the `willPreventClose` flag and resets it to `false`.\nIt returns the value of the `willPreventClose` flag."
|
|
2175
2250
|
},
|
|
2176
2251
|
{
|
|
2177
2252
|
"kind": "method",
|
|
@@ -2181,7 +2256,8 @@
|
|
|
2181
2256
|
"type": {
|
|
2182
2257
|
"text": "void"
|
|
2183
2258
|
}
|
|
2184
|
-
}
|
|
2259
|
+
},
|
|
2260
|
+
"description": "Requests slottable content for the overlay.\n\nThis method dispatches a `SlottableRequestEvent` to request or remove slottable content\nbased on the current open state of the overlay. It ensures that the same state is not\ndispatched twice in a row."
|
|
2185
2261
|
},
|
|
2186
2262
|
{
|
|
2187
2263
|
"kind": "method",
|
|
@@ -2191,7 +2267,8 @@
|
|
|
2191
2267
|
"type": {
|
|
2192
2268
|
"text": "TemplateResult"
|
|
2193
2269
|
}
|
|
2194
|
-
}
|
|
2270
|
+
},
|
|
2271
|
+
"description": "Renders the content of the overlay.\n\nThis method returns a template result containing a slot element. The slot element\nlistens for the `slotchange` event to manage the overlay's state."
|
|
2195
2272
|
},
|
|
2196
2273
|
{
|
|
2197
2274
|
"kind": "field",
|
|
@@ -2200,6 +2277,12 @@
|
|
|
2200
2277
|
"text": "StyleInfo"
|
|
2201
2278
|
},
|
|
2202
2279
|
"privacy": "private",
|
|
2280
|
+
"description": "Generates a style map for the dialog element.\n\nThis method returns an object containing CSS custom properties for the dialog element.\nThe `--swc-overlay-open-count` custom property is set to the current open count of overlays.",
|
|
2281
|
+
"return": {
|
|
2282
|
+
"type": {
|
|
2283
|
+
"text": "StyleInfo"
|
|
2284
|
+
}
|
|
2285
|
+
},
|
|
2203
2286
|
"readonly": true
|
|
2204
2287
|
},
|
|
2205
2288
|
{
|
|
@@ -2210,7 +2293,8 @@
|
|
|
2210
2293
|
"type": {
|
|
2211
2294
|
"text": "TemplateResult"
|
|
2212
2295
|
}
|
|
2213
|
-
}
|
|
2296
|
+
},
|
|
2297
|
+
"description": "Renders the dialog element for the overlay.\n\nThis method returns a template result containing a dialog element. The dialog element\nincludes various attributes and event listeners to manage the overlay's state and behavior."
|
|
2214
2298
|
},
|
|
2215
2299
|
{
|
|
2216
2300
|
"kind": "method",
|
|
@@ -2220,7 +2304,8 @@
|
|
|
2220
2304
|
"type": {
|
|
2221
2305
|
"text": "TemplateResult"
|
|
2222
2306
|
}
|
|
2223
|
-
}
|
|
2307
|
+
},
|
|
2308
|
+
"description": "Renders the popover element for the overlay.\n\nThis method returns a template result containing a div element styled as a popover.\nThe popover element includes various attributes and event listeners to manage the overlay's state and behavior."
|
|
2224
2309
|
}
|
|
2225
2310
|
],
|
|
2226
2311
|
"events": [
|
|
@@ -2243,7 +2328,8 @@
|
|
|
2243
2328
|
"type": {
|
|
2244
2329
|
"text": "boolean"
|
|
2245
2330
|
},
|
|
2246
|
-
"description": "An Overlay that is `delayed` will wait until a warm-up period of 1000ms\nhas completed before opening. Once the
|
|
2331
|
+
"description": "An Overlay that is `delayed` will wait until a warm-up period of 1000ms\nhas completed before opening. Once the warm-up period has completed, all\nsubsequent Overlays will open immediately. When no Overlays are opened,\na cool-down period of 1000ms will begin. Once the cool-down has completed,\nthe next Overlay to be opened will be subject to the warm-up period if\nprovided that option.\n\nThis behavior helps to manage the performance and user experience by\npreventing multiple overlays from opening simultaneously and ensuring\na smooth transition between opening and closing overlays.",
|
|
2332
|
+
"default": "false",
|
|
2247
2333
|
"fieldName": "delayed"
|
|
2248
2334
|
},
|
|
2249
2335
|
{
|
|
@@ -2251,7 +2337,8 @@
|
|
|
2251
2337
|
"type": {
|
|
2252
2338
|
"text": "boolean"
|
|
2253
2339
|
},
|
|
2254
|
-
"description": "
|
|
2340
|
+
"description": "Indicates whether the overlay is currently functional or not.\n\nWhen set to `true`, the overlay is disabled, and any active strategy is aborted.\nThe overlay will also close if it is currently open. When set to `false`, the\noverlay will re-bind events and re-open if it was previously open.",
|
|
2341
|
+
"default": "false",
|
|
2255
2342
|
"fieldName": "disabled"
|
|
2256
2343
|
},
|
|
2257
2344
|
{
|
|
@@ -2260,7 +2347,7 @@
|
|
|
2260
2347
|
"text": "number | [number, number]"
|
|
2261
2348
|
},
|
|
2262
2349
|
"default": "0",
|
|
2263
|
-
"description": "The `offset` property accepts either a single number
|
|
2350
|
+
"description": "The `offset` property accepts either a single number to define the offset of the\nOverlay along the main axis from the trigger, or a 2-tuple to define the offset\nalong both the main axis and the cross axis. This option has no effect when there\nis no trigger element.",
|
|
2264
2351
|
"fieldName": "offset"
|
|
2265
2352
|
},
|
|
2266
2353
|
{
|
|
@@ -2268,7 +2355,8 @@
|
|
|
2268
2355
|
"type": {
|
|
2269
2356
|
"text": "boolean"
|
|
2270
2357
|
},
|
|
2271
|
-
"description": "
|
|
2358
|
+
"description": "Indicates whether the Overlay is projected onto the \"top layer\" or not.\n\nWhen set to `true`, the overlay is open and visible. When set to `false`, the overlay is closed and hidden.",
|
|
2359
|
+
"default": "false",
|
|
2272
2360
|
"fieldName": "open"
|
|
2273
2361
|
},
|
|
2274
2362
|
{
|
|
@@ -2276,7 +2364,7 @@
|
|
|
2276
2364
|
"type": {
|
|
2277
2365
|
"text": "\"top\" | \"top-start\" | \"top-end\" | \"right\" | \"right-start\" | \"right-end\" | \"bottom\" | \"bottom-start\" | \"bottom-end\" | \"left\" | \"left-start\" | \"left-end\""
|
|
2278
2366
|
},
|
|
2279
|
-
"description": "Instruct the Overlay where to place itself in
|
|
2367
|
+
"description": "Instruct the Overlay where to place itself in relationship to the trigger element.",
|
|
2280
2368
|
"fieldName": "placement"
|
|
2281
2369
|
},
|
|
2282
2370
|
{
|
|
@@ -2291,16 +2379,17 @@
|
|
|
2291
2379
|
{
|
|
2292
2380
|
"name": "tip-padding",
|
|
2293
2381
|
"type": {
|
|
2294
|
-
"text": "number
|
|
2382
|
+
"text": "number"
|
|
2295
2383
|
},
|
|
2384
|
+
"description": "The padding around the tip of the overlay.\nThis property defines the padding around the tip of the overlay, which can be used to adjust its positioning.",
|
|
2296
2385
|
"fieldName": "tipPadding"
|
|
2297
2386
|
},
|
|
2298
2387
|
{
|
|
2299
2388
|
"name": "trigger",
|
|
2300
2389
|
"type": {
|
|
2301
|
-
"text": "string
|
|
2390
|
+
"text": "string"
|
|
2302
2391
|
},
|
|
2303
|
-
"description": "An optional ID reference for the trigger element combined with the optional\ninteraction (click | hover | longpress) by which the overlay
|
|
2392
|
+
"description": "An optional ID reference for the trigger element combined with the optional\ninteraction (click | hover | longpress) by which the overlay should open.\nThe format is `trigger@interaction`, e.g., `trigger@click` opens the overlay\nwhen an element with the ID \"trigger\" is clicked.",
|
|
2304
2393
|
"fieldName": "trigger"
|
|
2305
2394
|
},
|
|
2306
2395
|
{
|
|
@@ -2314,7 +2403,7 @@
|
|
|
2314
2403
|
}
|
|
2315
2404
|
],
|
|
2316
2405
|
"superclass": {
|
|
2317
|
-
"name": "
|
|
2406
|
+
"name": "ComputedOverlayBase",
|
|
2318
2407
|
"module": "src/Overlay.ts"
|
|
2319
2408
|
},
|
|
2320
2409
|
"tagName": "sp-overlay",
|
|
@@ -3099,11 +3188,12 @@
|
|
|
3099
3188
|
"declarations": [
|
|
3100
3189
|
{
|
|
3101
3190
|
"kind": "variable",
|
|
3102
|
-
"name": "placementUpdatedSymbol"
|
|
3191
|
+
"name": "placementUpdatedSymbol",
|
|
3192
|
+
"description": "Symbol used to indicate that the placement has been updated."
|
|
3103
3193
|
},
|
|
3104
3194
|
{
|
|
3105
3195
|
"kind": "class",
|
|
3106
|
-
"description": "",
|
|
3196
|
+
"description": "Controller for managing the placement of an overlay.\n\nThis class implements the ReactiveController interface and provides methods\nfor managing the positioning and constraints of an overlay element.",
|
|
3107
3197
|
"name": "PlacementController",
|
|
3108
3198
|
"members": [
|
|
3109
3199
|
{
|
|
@@ -3112,21 +3202,24 @@
|
|
|
3112
3202
|
"type": {
|
|
3113
3203
|
"text": "() => void | undefined"
|
|
3114
3204
|
},
|
|
3115
|
-
"privacy": "private"
|
|
3205
|
+
"privacy": "private",
|
|
3206
|
+
"description": "Function to clean up resources when the controller is no longer needed."
|
|
3116
3207
|
},
|
|
3117
3208
|
{
|
|
3118
3209
|
"kind": "field",
|
|
3119
3210
|
"name": "initialHeight",
|
|
3120
3211
|
"type": {
|
|
3121
|
-
"text": "number
|
|
3122
|
-
}
|
|
3212
|
+
"text": "number"
|
|
3213
|
+
},
|
|
3214
|
+
"description": "Initial height of the overlay."
|
|
3123
3215
|
},
|
|
3124
3216
|
{
|
|
3125
3217
|
"kind": "field",
|
|
3126
3218
|
"name": "isConstrained",
|
|
3127
3219
|
"type": {
|
|
3128
|
-
"text": "boolean
|
|
3129
|
-
}
|
|
3220
|
+
"text": "boolean"
|
|
3221
|
+
},
|
|
3222
|
+
"description": "Indicates whether the overlay is constrained by available space."
|
|
3130
3223
|
},
|
|
3131
3224
|
{
|
|
3132
3225
|
"kind": "field",
|
|
@@ -3135,6 +3228,7 @@
|
|
|
3135
3228
|
"text": "ReactiveElement & { elements: OpenableElement[] }"
|
|
3136
3229
|
},
|
|
3137
3230
|
"privacy": "private",
|
|
3231
|
+
"description": "The host element that uses this controller.",
|
|
3138
3232
|
"default": "host"
|
|
3139
3233
|
},
|
|
3140
3234
|
{
|
|
@@ -3143,13 +3237,18 @@
|
|
|
3143
3237
|
"type": {
|
|
3144
3238
|
"text": "OverlayOptionsV1"
|
|
3145
3239
|
},
|
|
3146
|
-
"privacy": "private"
|
|
3240
|
+
"privacy": "private",
|
|
3241
|
+
"description": "Options for configuring the overlay placement."
|
|
3147
3242
|
},
|
|
3148
3243
|
{
|
|
3149
3244
|
"kind": "field",
|
|
3150
3245
|
"name": "originalPlacements",
|
|
3151
3246
|
"privacy": "private",
|
|
3152
|
-
"default": "new WeakMap<HTMLElement, Placement>()"
|
|
3247
|
+
"default": "new WeakMap<HTMLElement, Placement>()",
|
|
3248
|
+
"description": "A WeakMap to store the original placements of overlay elements.",
|
|
3249
|
+
"type": {
|
|
3250
|
+
"text": "WeakMap<HTMLElement, Placement>"
|
|
3251
|
+
}
|
|
3153
3252
|
},
|
|
3154
3253
|
{
|
|
3155
3254
|
"kind": "field",
|
|
@@ -3157,7 +3256,8 @@
|
|
|
3157
3256
|
"type": {
|
|
3158
3257
|
"text": "HTMLElement"
|
|
3159
3258
|
},
|
|
3160
|
-
"privacy": "private"
|
|
3259
|
+
"privacy": "private",
|
|
3260
|
+
"description": "The target element for the overlay."
|
|
3161
3261
|
},
|
|
3162
3262
|
{
|
|
3163
3263
|
"kind": "method",
|
|
@@ -3174,16 +3274,21 @@
|
|
|
3174
3274
|
"default": "this.target",
|
|
3175
3275
|
"type": {
|
|
3176
3276
|
"text": "HTMLElement"
|
|
3177
|
-
}
|
|
3277
|
+
},
|
|
3278
|
+
"description": "The target element for the overlay.",
|
|
3279
|
+
"optional": true
|
|
3178
3280
|
},
|
|
3179
3281
|
{
|
|
3180
3282
|
"name": "options",
|
|
3181
3283
|
"default": "this.options",
|
|
3182
3284
|
"type": {
|
|
3183
3285
|
"text": "OverlayOptionsV1"
|
|
3184
|
-
}
|
|
3286
|
+
},
|
|
3287
|
+
"description": "The options for configuring the overlay placement.",
|
|
3288
|
+
"optional": true
|
|
3185
3289
|
}
|
|
3186
|
-
]
|
|
3290
|
+
],
|
|
3291
|
+
"description": "Places the overlay relative to the target element.\n\nThis method sets up the necessary configurations and event listeners to manage the\npositioning and constraints of the overlay element."
|
|
3187
3292
|
},
|
|
3188
3293
|
{
|
|
3189
3294
|
"kind": "field",
|
|
@@ -3191,15 +3296,20 @@
|
|
|
3191
3296
|
"type": {
|
|
3192
3297
|
"text": "boolean"
|
|
3193
3298
|
},
|
|
3194
|
-
"
|
|
3299
|
+
"privacy": "public",
|
|
3300
|
+
"default": "false",
|
|
3301
|
+
"description": "Flag to allow or disallow placement updates."
|
|
3195
3302
|
},
|
|
3196
3303
|
{
|
|
3197
3304
|
"kind": "field",
|
|
3198
|
-
"name": "closeForAncestorUpdate"
|
|
3305
|
+
"name": "closeForAncestorUpdate",
|
|
3306
|
+
"description": "Closes the overlay if an ancestor element is updated.\n\nThis method checks if placement updates are allowed and if the overlay type is not 'modal'.\nIf these conditions are met and a cleanup function is defined, it dispatches a 'close' event\non the target element to close the overlay."
|
|
3199
3307
|
},
|
|
3200
3308
|
{
|
|
3201
3309
|
"kind": "field",
|
|
3202
|
-
"name": "updatePlacement"
|
|
3310
|
+
"name": "updatePlacement",
|
|
3311
|
+
"privacy": "private",
|
|
3312
|
+
"description": "Updates the placement of the overlay.\n\nThis method calls the computePlacement method to recalculate the overlay's position."
|
|
3203
3313
|
},
|
|
3204
3314
|
{
|
|
3205
3315
|
"kind": "method",
|
|
@@ -3208,7 +3318,8 @@
|
|
|
3208
3318
|
"type": {
|
|
3209
3319
|
"text": "Promise<void>"
|
|
3210
3320
|
}
|
|
3211
|
-
}
|
|
3321
|
+
},
|
|
3322
|
+
"description": "Computes the placement of the overlay relative to the target element.\n\nThis method calculates the necessary positioning and constraints for the overlay element\nusing various middleware functions. It updates the overlay's style and attributes based\non the computed position."
|
|
3212
3323
|
},
|
|
3213
3324
|
{
|
|
3214
3325
|
"kind": "method",
|
|
@@ -3218,12 +3329,14 @@
|
|
|
3218
3329
|
"type": {
|
|
3219
3330
|
"text": "void"
|
|
3220
3331
|
}
|
|
3221
|
-
}
|
|
3332
|
+
},
|
|
3333
|
+
"description": "Clears the overlay's position styles.\n\nThis method removes the max-height and max-width styles from the target element,\nand resets the initial height and constrained state of the overlay."
|
|
3222
3334
|
},
|
|
3223
3335
|
{
|
|
3224
3336
|
"kind": "field",
|
|
3225
3337
|
"name": "resetOverlayPosition",
|
|
3226
|
-
"privacy": "public"
|
|
3338
|
+
"privacy": "public",
|
|
3339
|
+
"description": "Resets the overlay's position.\n\nThis method clears the overlay's position, forces a reflow, and recomputes the placement."
|
|
3227
3340
|
},
|
|
3228
3341
|
{
|
|
3229
3342
|
"kind": "method",
|
|
@@ -3232,7 +3345,8 @@
|
|
|
3232
3345
|
"type": {
|
|
3233
3346
|
"text": "void"
|
|
3234
3347
|
}
|
|
3235
|
-
}
|
|
3348
|
+
},
|
|
3349
|
+
"description": "Lifecycle method called when the host element is connected to the DOM.\n\nThis method sets up an event listener to reset the overlay's position when the 'sp-update-overlays' event is dispatched."
|
|
3236
3350
|
},
|
|
3237
3351
|
{
|
|
3238
3352
|
"kind": "method",
|
|
@@ -3241,7 +3355,8 @@
|
|
|
3241
3355
|
"type": {
|
|
3242
3356
|
"text": "void"
|
|
3243
3357
|
}
|
|
3244
|
-
}
|
|
3358
|
+
},
|
|
3359
|
+
"description": "Lifecycle method called when the host element is updated.\n\nThis method cleans up resources if the overlay is not open."
|
|
3245
3360
|
},
|
|
3246
3361
|
{
|
|
3247
3362
|
"kind": "method",
|
|
@@ -3250,7 +3365,8 @@
|
|
|
3250
3365
|
"type": {
|
|
3251
3366
|
"text": "void"
|
|
3252
3367
|
}
|
|
3253
|
-
}
|
|
3368
|
+
},
|
|
3369
|
+
"description": "Lifecycle method called when the host element is disconnected from the DOM.\n\nThis method removes the event listener and cleans up resources."
|
|
3254
3370
|
}
|
|
3255
3371
|
]
|
|
3256
3372
|
}
|