@webtides/element-library 0.3.0 → 0.4.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.
Files changed (199) hide show
  1. package/CHANGELOG.md +208 -0
  2. package/README.md +72 -56
  3. package/all.js +16 -0
  4. package/catalog.js +17 -1
  5. package/custom-elements.json +14731 -10193
  6. package/package.json +1 -1
  7. package/src/components/accordion/accordion.changelog.md +11 -0
  8. package/src/components/accordion/accordion.js +15 -3
  9. package/src/components/accordion/accordion.readme.md +27 -1
  10. package/src/components/accordion/accordion.style.js +19 -0
  11. package/src/components/app-bar/app-bar.changelog.md +24 -0
  12. package/src/components/app-bar/app-bar.define.js +3 -0
  13. package/src/components/app-bar/app-bar.js +91 -0
  14. package/src/components/app-bar/app-bar.readme.md +130 -0
  15. package/src/components/app-bar/app-bar.style.js +103 -0
  16. package/src/components/app-frame/app-frame.changelog.md +45 -0
  17. package/src/components/app-frame/app-frame.define.js +3 -0
  18. package/src/components/app-frame/app-frame.events.js +6 -0
  19. package/src/components/app-frame/app-frame.js +1073 -0
  20. package/src/components/app-frame/app-frame.readme.md +416 -0
  21. package/src/components/app-frame/app-frame.style.js +527 -0
  22. package/src/components/button/button.changelog.md +25 -0
  23. package/src/components/button/button.events.js +3 -0
  24. package/src/components/button/button.js +209 -14
  25. package/src/components/button/button.readme.md +82 -6
  26. package/src/components/button/button.style.js +161 -7
  27. package/src/components/checkbox-field/checkbox-field.changelog.md +6 -0
  28. package/src/components/checkbox-field/checkbox-field.js +7 -1
  29. package/src/components/description-list/description-list.changelog.md +25 -0
  30. package/src/components/description-list/description-list.define.js +3 -0
  31. package/src/components/description-list/description-list.js +44 -0
  32. package/src/components/description-list/description-list.readme.md +135 -0
  33. package/src/components/description-list/description-list.style.js +140 -0
  34. package/src/components/dialog/dialog.changelog.md +7 -0
  35. package/src/components/dialog/dialog.readme.md +5 -0
  36. package/src/components/dialog/dialog.style.js +17 -2
  37. package/src/components/drawer/drawer.changelog.md +7 -0
  38. package/src/components/drawer/drawer.readme.md +7 -6
  39. package/src/components/drawer/drawer.style.js +35 -2
  40. package/src/components/dropdown/dropdown.readme.md +6 -1
  41. package/src/components/list/list.changelog.md +24 -0
  42. package/src/components/list/list.define.js +3 -0
  43. package/src/components/list/list.js +66 -0
  44. package/src/components/list/list.readme.md +122 -0
  45. package/src/components/list/list.style.js +56 -0
  46. package/src/components/list-item/list-item.changelog.md +24 -0
  47. package/src/components/list-item/list-item.define.js +3 -0
  48. package/src/components/list-item/list-item.js +128 -0
  49. package/src/components/list-item/list-item.readme.md +126 -0
  50. package/src/components/list-item/list-item.style.js +234 -0
  51. package/src/components/menu/menu.changelog.md +27 -0
  52. package/src/components/menu/menu.define.js +3 -0
  53. package/src/components/menu/menu.events.js +5 -0
  54. package/src/components/menu/menu.js +570 -0
  55. package/src/components/menu/menu.readme.md +272 -0
  56. package/src/components/menu/menu.style.js +55 -0
  57. package/src/components/menu-group/menu-group.changelog.md +20 -0
  58. package/src/components/menu-group/menu-group.define.js +3 -0
  59. package/src/components/menu-group/menu-group.js +44 -0
  60. package/src/components/menu-group/menu-group.readme.md +74 -0
  61. package/src/components/menu-group/menu-group.style.js +38 -0
  62. package/src/components/menu-item/menu-item.changelog.md +24 -0
  63. package/src/components/menu-item/menu-item.define.js +3 -0
  64. package/src/components/menu-item/menu-item.js +130 -0
  65. package/src/components/menu-item/menu-item.readme.md +94 -0
  66. package/src/components/menu-item/menu-item.style.js +87 -0
  67. package/src/components/nav/nav.changelog.md +35 -0
  68. package/src/components/nav/nav.define.js +3 -0
  69. package/src/components/nav/nav.js +212 -0
  70. package/src/components/nav/nav.readme.md +248 -0
  71. package/src/components/nav/nav.style.js +269 -0
  72. package/src/components/nav-item/nav-item.changelog.md +25 -0
  73. package/src/components/nav-item/nav-item.define.js +3 -0
  74. package/src/components/nav-item/nav-item.js +75 -0
  75. package/src/components/nav-item/nav-item.readme.md +111 -0
  76. package/src/components/nav-item/nav-item.style.js +159 -0
  77. package/src/components/pagination/pagination.changelog.md +8 -0
  78. package/src/components/pagination/pagination.js +123 -49
  79. package/src/components/pagination/pagination.readme.md +24 -6
  80. package/src/components/pagination/pagination.style.js +11 -1
  81. package/src/components/scroll-to-top/scroll-to-top.changelog.md +7 -5
  82. package/src/components/scroll-to-top/scroll-to-top.js +16 -12
  83. package/src/components/scroll-to-top/scroll-to-top.readme.md +2 -0
  84. package/src/components/segmented-field/segmented-field.changelog.md +27 -0
  85. package/src/components/segmented-field/segmented-field.define.js +3 -0
  86. package/src/components/segmented-field/segmented-field.js +175 -0
  87. package/src/components/segmented-field/segmented-field.readme.md +140 -0
  88. package/src/components/segmented-field/segmented-field.style.js +193 -0
  89. package/src/components/splitter/splitter.changelog.md +24 -0
  90. package/src/components/splitter/splitter.define.js +3 -0
  91. package/src/components/splitter/splitter.events.js +4 -0
  92. package/src/components/splitter/splitter.js +237 -0
  93. package/src/components/splitter/splitter.readme.md +164 -0
  94. package/src/components/splitter/splitter.style.js +100 -0
  95. package/src/components/status-bar/status-bar.changelog.md +25 -0
  96. package/src/components/status-bar/status-bar.define.js +3 -0
  97. package/src/components/status-bar/status-bar.js +74 -0
  98. package/src/components/status-bar/status-bar.readme.md +139 -0
  99. package/src/components/status-bar/status-bar.style.js +122 -0
  100. package/src/components/switch-field/switch-field.changelog.md +6 -0
  101. package/src/components/switch-field/switch-field.js +7 -1
  102. package/src/components/tab-group/tab-group.changelog.md +7 -0
  103. package/src/components/tab-group/tab-group.js +30 -9
  104. package/src/components/tab-group/tab-group.readme.md +14 -0
  105. package/src/components/toast/toast.changelog.md +6 -0
  106. package/src/components/toast/toast.readme.md +5 -3
  107. package/src/components/toast/toast.style.js +22 -6
  108. package/src/components/toolbar/toolbar.changelog.md +24 -0
  109. package/src/components/toolbar/toolbar.define.js +3 -0
  110. package/src/components/toolbar/toolbar.js +233 -0
  111. package/src/components/toolbar/toolbar.readme.md +156 -0
  112. package/src/components/toolbar/toolbar.style.js +49 -0
  113. package/src/components/tooltip/tooltip.changelog.md +11 -0
  114. package/src/components/tooltip/tooltip.js +51 -4
  115. package/src/components/tooltip/tooltip.readme.md +26 -1
  116. package/src/components/tree/tree.changelog.md +23 -0
  117. package/src/components/tree/tree.define.js +3 -0
  118. package/src/components/tree/tree.js +138 -0
  119. package/src/components/tree/tree.readme.md +119 -0
  120. package/src/components/tree/tree.style.js +16 -0
  121. package/src/components/tree-item/tree-item.changelog.md +23 -0
  122. package/src/components/tree-item/tree-item.define.js +3 -0
  123. package/src/components/tree-item/tree-item.events.js +3 -0
  124. package/src/components/tree-item/tree-item.js +246 -0
  125. package/src/components/tree-item/tree-item.readme.md +128 -0
  126. package/src/components/tree-item/tree-item.style.js +226 -0
  127. package/src/styles/appearance.style.js +47 -0
  128. package/src/styles/choice-group.style.js +1 -1
  129. package/src/styles/modal.style.js +14 -1
  130. package/src/styles/size.style.js +41 -0
  131. package/src/utils/focus.js +69 -0
  132. package/src/utils/scroll.js +24 -0
  133. package/types/all.d.ts +16 -0
  134. package/types/src/components/accordion/accordion.d.ts +3 -1
  135. package/types/src/components/app-bar/app-bar.d.ts +43 -0
  136. package/types/src/components/app-bar/app-bar.define.d.ts +1 -0
  137. package/types/src/components/app-bar/app-bar.style.d.ts +2 -0
  138. package/types/src/components/app-frame/app-frame.d.ts +491 -0
  139. package/types/src/components/app-frame/app-frame.define.d.ts +1 -0
  140. package/types/src/components/app-frame/app-frame.events.d.ts +7 -0
  141. package/types/src/components/app-frame/app-frame.style.d.ts +8 -0
  142. package/types/src/components/button/button.d.ts +97 -7
  143. package/types/src/components/button/button.events.d.ts +4 -0
  144. package/types/src/components/description-list/description-list.d.ts +29 -0
  145. package/types/src/components/description-list/description-list.define.d.ts +1 -0
  146. package/types/src/components/description-list/description-list.style.d.ts +2 -0
  147. package/types/src/components/list/list.d.ts +39 -0
  148. package/types/src/components/list/list.define.d.ts +1 -0
  149. package/types/src/components/list/list.style.d.ts +2 -0
  150. package/types/src/components/list-item/list-item.d.ts +62 -0
  151. package/types/src/components/list-item/list-item.define.d.ts +1 -0
  152. package/types/src/components/list-item/list-item.style.d.ts +2 -0
  153. package/types/src/components/menu/menu.d.ts +266 -0
  154. package/types/src/components/menu/menu.define.d.ts +1 -0
  155. package/types/src/components/menu/menu.events.d.ts +6 -0
  156. package/types/src/components/menu/menu.style.d.ts +2 -0
  157. package/types/src/components/menu-group/menu-group.d.ts +24 -0
  158. package/types/src/components/menu-group/menu-group.define.d.ts +1 -0
  159. package/types/src/components/menu-group/menu-group.style.d.ts +2 -0
  160. package/types/src/components/menu-item/menu-item.d.ts +59 -0
  161. package/types/src/components/menu-item/menu-item.define.d.ts +1 -0
  162. package/types/src/components/menu-item/menu-item.style.d.ts +2 -0
  163. package/types/src/components/nav/nav.d.ts +103 -0
  164. package/types/src/components/nav/nav.define.d.ts +1 -0
  165. package/types/src/components/nav/nav.style.d.ts +2 -0
  166. package/types/src/components/nav-item/nav-item.d.ts +39 -0
  167. package/types/src/components/nav-item/nav-item.define.d.ts +1 -0
  168. package/types/src/components/nav-item/nav-item.style.d.ts +2 -0
  169. package/types/src/components/pagination/pagination.d.ts +31 -2
  170. package/types/src/components/scroll-to-top/scroll-to-top.d.ts +6 -5
  171. package/types/src/components/segmented-field/segmented-field.d.ts +85 -0
  172. package/types/src/components/segmented-field/segmented-field.define.d.ts +1 -0
  173. package/types/src/components/segmented-field/segmented-field.style.d.ts +2 -0
  174. package/types/src/components/splitter/splitter.d.ts +127 -0
  175. package/types/src/components/splitter/splitter.define.d.ts +1 -0
  176. package/types/src/components/splitter/splitter.events.d.ts +5 -0
  177. package/types/src/components/splitter/splitter.style.d.ts +2 -0
  178. package/types/src/components/status-bar/status-bar.d.ts +44 -0
  179. package/types/src/components/status-bar/status-bar.define.d.ts +1 -0
  180. package/types/src/components/status-bar/status-bar.style.d.ts +2 -0
  181. package/types/src/components/tab-group/tab-group.d.ts +17 -0
  182. package/types/src/components/toolbar/toolbar.d.ts +96 -0
  183. package/types/src/components/toolbar/toolbar.define.d.ts +1 -0
  184. package/types/src/components/toolbar/toolbar.style.d.ts +2 -0
  185. package/types/src/components/tooltip/tooltip.d.ts +26 -0
  186. package/types/src/components/tree/tree.d.ts +62 -0
  187. package/types/src/components/tree/tree.define.d.ts +1 -0
  188. package/types/src/components/tree/tree.style.d.ts +2 -0
  189. package/types/src/components/tree-item/tree-item.d.ts +106 -0
  190. package/types/src/components/tree-item/tree-item.define.d.ts +1 -0
  191. package/types/src/components/tree-item/tree-item.events.d.ts +4 -0
  192. package/types/src/components/tree-item/tree-item.style.d.ts +2 -0
  193. package/types/src/styles/appearance.style.d.ts +31 -0
  194. package/types/src/styles/choice-group.style.d.ts +1 -1
  195. package/types/src/styles/modal.style.d.ts +5 -0
  196. package/types/src/styles/size.style.d.ts +24 -0
  197. package/types/src/utils/focus.d.ts +25 -0
  198. package/types/src/utils/scroll.d.ts +11 -0
  199. package/web-types.json +2530 -393
@@ -0,0 +1,43 @@
1
+ import { TemplateElement } from '@webtides/element-js';
2
+ /**
3
+ * The bar at the top of a view: which view this is, a way back or to the navigation at its start,
4
+ * and a few actions at its end. One row: a title that does not fit is cut with an ellipsis and
5
+ * never pushes the actions out.
6
+ *
7
+ * In the header of an `el-app-frame` the surface of the bar reaches up under the status bar of a
8
+ * phone, and its content stays below it. The bar is no landmark: the `header` of the page is.
9
+ *
10
+ * The look is the stylesheet alone, so a server-rendered bar does not change when the element
11
+ * takes over.
12
+ *
13
+ * @element el-app-bar
14
+ *
15
+ * @slot - The title of the view.
16
+ * @slot start - What is in front of the title: a button back, or the one for the navigation.
17
+ * @slot end - The actions of the view, at the end of the bar.
18
+ *
19
+ * @csspart base - The bar: its surface and the line to the content.
20
+ * @csspart row - The row of the start, the title and the end.
21
+ * @csspart start - The region in front of the title.
22
+ * @csspart title - The title. A heading while `heading-level` is set.
23
+ * @csspart end - The region at the end.
24
+ *
25
+ * @property {number} headingLevel - Makes the title the heading of the view, at this level
26
+ * (1 to 6). Unset, the title is text. Default `0`.
27
+ * @property {'filled'|'outlined'|'plain'} appearance - The appearance of the buttons in the bar
28
+ * that have none of their own. Default `'plain'`. Reflected to the `appearance` attribute.
29
+ */
30
+ export default class AppBar extends TemplateElement {
31
+ constructor();
32
+ properties(): {
33
+ headingLevel: number;
34
+ appearance: string;
35
+ };
36
+ events(): {
37
+ "[part~='base']": {
38
+ slotchange: () => any;
39
+ };
40
+ };
41
+ template(): any;
42
+ }
43
+ export declare function define(): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const _default: string;
2
+ export default _default;
@@ -0,0 +1,491 @@
1
+ import { TemplateElement } from '@webtides/element-js';
2
+ import Events from './app-frame.events.js';
3
+ /**
4
+ * The frame of an application: it fills what the browser shows and lays out five regions, a
5
+ * header, a footer, a navigation at the start side, an aside at the end side, and the content.
6
+ * The header and the footer stay in view, and the content scrolls between them.
7
+ *
8
+ * The frame knows regions, not what they mean. The page writes the elements that say so, the
9
+ * landmarks, and slots them: `<header slot="header">`, `<nav slot="navigation" aria-label="…">`,
10
+ * `<main id="…">`, `<aside slot="aside">`, `<footer slot="footer">`. The frame adds the layout,
11
+ * the room for the notch and the home indicator of a phone, and a link that skips to the content
12
+ * as the first stop of the Tab key.
13
+ *
14
+ * From the width `wide-from` names, the navigation and the aside are columns beside the content,
15
+ * and each scrolls on its own. Where the frame is narrow, the content and the aside are one
16
+ * column that scrolls, and the navigation does not show: it opens as a drawer from the start
17
+ * edge, from any element with `data-navigation-toggle`. The page writes the navigation once.
18
+ *
19
+ * The width is the one of the frame, and the stylesheet alone decides: a server-rendered frame
20
+ * has its layout before the script has run.
21
+ *
22
+ * `resizable` names the columns whose width the user sets by dragging their edge, an
23
+ * `el-splitter` of the frame. `navigation-size` and `aside-size` are those widths: the frame tells
24
+ * of them, and the page keeps them and gives them back.
25
+ *
26
+ * Where a browser lays its on-screen keyboard over the page, the frame is as high as what shows
27
+ * above the keyboard, and where that part is: the header stays in view, and the field the user
28
+ * types into does. That needs the script.
29
+ *
30
+ * With `status-bar-tap` a tap on the status bar of an iPhone brings the content to its top, as it
31
+ * does in an application. iOS scrolls the document for that tap and never a region, so the frame
32
+ * keeps the document scrolled by one pixel there, and hears it go back. The document snaps to
33
+ * that pixel: a script of the page that scrolls the window does not move it, and is no tap.
34
+ *
35
+ * @element el-app-frame
36
+ *
37
+ * @fires {CustomEvent<{ open: boolean }>} app-frame-navigation-toggle - Fired when the drawer of
38
+ * the navigation opens or closes, with the new state in `detail.open`.
39
+ * @fires {CustomEvent<{ region: 'navigation'|'aside', size: number }>} app-frame-resize - Fired
40
+ * with every change the user makes to the width of a column: while its edge is dragged, and
41
+ * with every key. The new width in pixels is in `detail.size`.
42
+ * @fires {CustomEvent<{ region: 'navigation'|'aside', size: number }>} app-frame-resize-end -
43
+ * Fired once the user has set a width: when the pointer lets go of the edge, and with every
44
+ * key. The width to keep is in `detail.size`.
45
+ * @fires {CustomEvent} app-frame-status-bar-tap - Fired when the user has tapped the status bar of
46
+ * an iPhone, with `status-bar-tap`. The frame scrolls its content to the top after it, unless a
47
+ * listener calls `preventDefault()`: a view whose columns scroll brings those to their tops.
48
+ *
49
+ * @slot - The content of the view: the `main` of the page, with an id for the skip link.
50
+ * @slot header - The region at the top, an app bar as a rule. Left out while it is empty.
51
+ * @slot navigation - The region at the start side, and the content of the drawer where the frame
52
+ * is narrow. Left out while it is empty.
53
+ * @slot aside - The region at the end side. Left out while it is empty.
54
+ * @slot footer - The region at the lower edge. Left out while it is empty.
55
+ *
56
+ * @csspart base - The frame: the grid of the regions.
57
+ * @csspart skip-link - The link that skips to the content. It shows while it has the focus.
58
+ * @csspart header - The region at the top. Its surface reaches under the status bar of a phone.
59
+ * @csspart navigation - The region at the start side, where the frame is wide.
60
+ * @csspart body - The content and the aside. Where the frame is narrow, it is what scrolls.
61
+ * @csspart content - The region of the content. Where the frame is wide, it is what scrolls.
62
+ * @csspart aside - The region at the end side.
63
+ * @csspart footer - The region at the lower edge. Its surface reaches under the home indicator.
64
+ * @csspart drawer - The surface of the drawer the navigation is in where the frame is narrow.
65
+ * @csspart drawer-header - The header of that drawer, with its title and its close button.
66
+ * @csspart drawer-title - The title of that drawer.
67
+ * @csspart drawer-close-button - The close button of that drawer.
68
+ * @csspart drawer-body - The body of that drawer: the navigation of the page is in it.
69
+ * @csspart navigation-splitter - The edge of the navigation the user drags, an `el-splitter`.
70
+ * @csspart aside-splitter - The edge of the aside the user drags, an `el-splitter`.
71
+ *
72
+ * @cssproperty --el-app-frame-navigation-size - The width of the navigation where the frame is
73
+ * wide, and of its drawer where it is narrow. Default `16rem`. `auto` is the width of what is
74
+ * in it.
75
+ * @cssproperty --el-app-frame-aside-size - The width of the aside where the frame is wide.
76
+ * Default `20rem`.
77
+ * @cssproperty --el-app-frame-navigation-min-size - The least width of a navigation that is
78
+ * resizable. Default `10rem`.
79
+ * @cssproperty --el-app-frame-navigation-max-size - The greatest width of a navigation that is
80
+ * resizable. Default `min(30rem, 40cqi)`: two fifths of the width of the frame at most.
81
+ * @cssproperty --el-app-frame-aside-min-size - The least width of an aside that is resizable.
82
+ * Default `10rem`.
83
+ * @cssproperty --el-app-frame-aside-max-size - The greatest width of an aside that is resizable.
84
+ * Default `min(30rem, 40cqi)`.
85
+ *
86
+ * @cssstate navigation-open - Set while the drawer of the navigation is open.
87
+ * @cssstate keyboard - Set while an on-screen keyboard covers a part of the viewport, and the
88
+ * frame is as high as what shows above it.
89
+ *
90
+ * @property {string} skipLabel - The text of the link that skips to the content. Default
91
+ * `'Skip to content'`.
92
+ * @property {'30rem'|'40rem'|'48rem'|'64rem'|'80rem'} wideFrom - The width of the frame from
93
+ * which the navigation and the aside are columns beside the content. One of the steps the
94
+ * stylesheet knows, another value is the default. Default `'48rem'`.
95
+ * @property {string} narrowOnly - The regions that are there only where the frame is narrow, as
96
+ * their names with a space between them: `header`, `navigation`, `aside`, `footer`. A bar of
97
+ * destinations in the footer of a phone, for example (`narrow-only="footer"`). Default `''`.
98
+ * @property {string} wideOnly - The regions that are there only where the frame is wide, named
99
+ * the same way. Default `''`.
100
+ * @property {'drawer'|'bar'} narrowNavigation - What the navigation is where the frame is narrow.
101
+ * `drawer`: it does not show, and opens as a drawer. `bar`: its region lies at the lower edge,
102
+ * for an `el-nav` whose destinations are a bar there and a rail in the column of the wide
103
+ * frame. Default `'drawer'`.
104
+ * @property {boolean} navigationOpen - Whether the drawer of the navigation is open. It is one
105
+ * only where the frame is narrow: elsewhere the property is `false`. Reflected to the
106
+ * `navigation-open` attribute.
107
+ * @property {string} navigationLabel - The title of the drawer of the navigation, and its name
108
+ * for assistive technology. Default `'Navigation'`.
109
+ * @property {string} closeLabel - The name of the close button of that drawer. Default
110
+ * `'Close'`.
111
+ * @property {string} resizable - The columns whose width the user sets by dragging their edge,
112
+ * as their names with a space between them: `navigation`, `aside`. Default `''`.
113
+ * @property {number} navigationSize - The width of the navigation where the frame is wide, in
114
+ * pixels: the one the user has set, or the one the page has kept. `0` is the width of the
115
+ * stylesheet (`--el-app-frame-navigation-size`). Default `0`.
116
+ * @property {number} asideSize - The width of the aside where the frame is wide, in pixels. `0`
117
+ * is the width of the stylesheet (`--el-app-frame-aside-size`). Default `0`.
118
+ * @property {string} asideLabel - The name of the aside for assistive technology, on the edge
119
+ * that sizes it. The edge of the navigation has `navigation-label`. Default `'Aside'`.
120
+ * @property {boolean} statusBarTap - Whether a tap on the status bar of an iPhone brings the
121
+ * content to its top. The document of the page is one pixel higher than the viewport then, and
122
+ * snaps to that pixel. Default `false`.
123
+ */
124
+ export default class AppFrame extends TemplateElement {
125
+ navigationOpen: boolean;
126
+ asideSize: number;
127
+ navigationSize: number;
128
+ /**
129
+ * Tells of every change of a size: of the frame, which can make it wide or narrow, and of a
130
+ * region, which can make it scroll or stop it from scrolling.
131
+ * @private
132
+ * @type {ResizeObserver | undefined}
133
+ */
134
+ private _resizeObserver;
135
+ /**
136
+ * Whether the navigation is in a drawer: the frame is narrow, and has a navigation there.
137
+ * Only the script knows, so a server and the first render in the browser have the region.
138
+ * @private
139
+ */
140
+ private _inDrawer;
141
+ /**
142
+ * What the frame has said of its drawer last, so it says a change once.
143
+ * @private
144
+ */
145
+ private _saidOpen;
146
+ /**
147
+ * Whether the script has started. The edges to drag are there from then on: they do nothing
148
+ * before, and a server leaves them out.
149
+ * @private
150
+ */
151
+ private _started;
152
+ /**
153
+ * The height of what scrolls the content, as it was last: a field the user types into is
154
+ * brought back into view when that height gets less.
155
+ * @private
156
+ */
157
+ private _scrollerSize;
158
+ /**
159
+ * Whether an on-screen keyboard covers a part of the viewport, as the frame has said last
160
+ * (`:state(keyboard)`). Kept here, and not read back from the states of the element: WebKit
161
+ * forgets what was added to them a moment later (`states.has()` is `false`), while the state
162
+ * still matches.
163
+ * @private
164
+ */
165
+ private _keyboard;
166
+ /**
167
+ * Tells of a visual viewport that changes: an on-screen keyboard that comes or goes, or the
168
+ * page that the browser moves behind it.
169
+ * @private
170
+ * @param {Event} event
171
+ */
172
+ private _onViewport;
173
+ /**
174
+ * What the frame keeps while it listens for a tap on the status bar: the element that makes
175
+ * the document one pixel higher than the viewport, whether the document snaps to that pixel
176
+ * and what the page had in the place of that rule, whether a script can move the document all
177
+ * the same, how many fingers are on the screen, until when a scroll of the document is
178
+ * somebody else's, whether the document is scrolling and when it was last heard of, when the
179
+ * frame has put it on its pixel last, and the timer that does so.
180
+ * @private
181
+ * @type {{ sentinel: HTMLElement, snaps: boolean, snapBefore: string, held: boolean, touches: number, dragged: boolean, quietUntil: number, scrolling: boolean, scrolledAt: number, armedAt: number, timer: number } | undefined}
182
+ */
183
+ private _statusBar;
184
+ /** @private */
185
+ private _onDocumentScroll;
186
+ /**
187
+ * The scroll of the document is over: it can have its pixel back.
188
+ * @private
189
+ */
190
+ private _onDocumentScrollEnd;
191
+ /**
192
+ * A finger has come or gone. One that has dragged the document, from the header or the
193
+ * footer, leaves a page that swings back: for that moment a scroll is not a tap. One that has
194
+ * scrolled the content has moved no document, and a tap right after it counts.
195
+ * @private
196
+ * @param {TouchEvent} event
197
+ */
198
+ private _onTouch;
199
+ /**
200
+ * A wheel or a key: over the header they scroll the document, as the tap does.
201
+ * @private
202
+ */
203
+ private _onInput;
204
+ constructor();
205
+ properties(): {
206
+ skipLabel: string;
207
+ wideFrom: string;
208
+ narrowOnly: string;
209
+ wideOnly: string;
210
+ narrowNavigation: string;
211
+ navigationOpen: boolean;
212
+ navigationLabel: string;
213
+ closeLabel: string;
214
+ resizable: string;
215
+ navigationSize: number;
216
+ asideSize: number;
217
+ asideLabel: string;
218
+ statusBarTap: boolean;
219
+ };
220
+ connected(): void;
221
+ disconnected(): void;
222
+ afterUpdate(): void;
223
+ watch(): {
224
+ narrowNavigation: () => void;
225
+ wideOnly: () => void;
226
+ statusBarTap: () => void;
227
+ navigationOpen: () => void;
228
+ };
229
+ events(): {
230
+ this: {
231
+ click: (event: any) => void;
232
+ };
233
+ "[part~='base']": {
234
+ slotchange: () => void;
235
+ };
236
+ "[part~='skip-link']": {
237
+ click: (event: any) => void;
238
+ };
239
+ 'el-drawer': {
240
+ 'drawer-show': (event: any) => any;
241
+ 'drawer-after-show': (event: any) => any;
242
+ 'drawer-initial-focus': (event: any) => any;
243
+ 'drawer-request-close': (event: any) => any;
244
+ 'drawer-hide': (event: any) => void;
245
+ 'drawer-after-hide': (event: any) => any;
246
+ };
247
+ 'el-splitter': {
248
+ 'splitter-resize': (event: any) => void;
249
+ 'splitter-resize-end': (event: any) => void;
250
+ };
251
+ };
252
+ /**
253
+ * Whether the frame is wide: the navigation, the content and the aside are beside each other.
254
+ * The stylesheet decides, by the width of the frame and its `wide-from`; this reads what it
255
+ * has decided, so the width is written in one place.
256
+ * @returns {boolean}
257
+ */
258
+ get wide(): boolean;
259
+ /**
260
+ * The element that scrolls the content: the region of the content where the frame is wide,
261
+ * the column of the content and the aside where it is narrow. For a page that sets the scroll
262
+ * back after a change of the view, or brings a position back. The window does not scroll in a
263
+ * frame.
264
+ * @returns {HTMLElement | undefined}
265
+ */
266
+ get scroller(): HTMLElement | undefined;
267
+ /**
268
+ * The element of the page the skip link leads to: its `main`, or the first element that is in
269
+ * no named slot.
270
+ * @private
271
+ * @returns {Element | undefined}
272
+ */
273
+ private _content;
274
+ /**
275
+ * The names of regions in an attribute of the page, and nothing else.
276
+ * @private
277
+ * @param {string} names
278
+ * @returns {string[]}
279
+ */
280
+ private _regionsOf;
281
+ /**
282
+ * The columns the page lets the user size.
283
+ * @private
284
+ * @returns {string[]}
285
+ */
286
+ private _resizable;
287
+ /**
288
+ * An edge says the width of its column, and the least and the greatest one. The stylesheet
289
+ * has them, in any unit, and the edge needs pixels: they are read from the column as it is
290
+ * laid out. A limit that is no length there, a percentage, is none for the edge. The
291
+ * stylesheet keeps it all the same, and the width is read again after every change.
292
+ * @private
293
+ */
294
+ private _syncEdges;
295
+ /**
296
+ * The user has moved an edge: the column takes the width, and the frame tells of it in its
297
+ * own words.
298
+ * @private
299
+ * @param {CustomEvent<{ value: number }>} event
300
+ * @param {string} name - The event of the frame.
301
+ */
302
+ private _onResize;
303
+ /**
304
+ * A browser that lays its on-screen keyboard over the page leaves the layout as it is: the
305
+ * frame is as high as the viewport, and its lower part is under the keyboard. To show the
306
+ * field the user types into, the browser moves the page up behind the keyboard, and the
307
+ * header leaves the screen with it.
308
+ *
309
+ * The visual viewport is what shows. While it is less high than the layout by more than a
310
+ * scrollbar, and the user types into something, the frame takes its place and its height:
311
+ * the header is at the top of what shows, the footer above the keyboard, and the content
312
+ * scrolls between them. The browser tells of the viewport once it has moved it, so for the
313
+ * moment the keyboard comes in the regions are on their way.
314
+ *
315
+ * A viewport that shows less is no keyboard by itself. Safari on iOS makes the visual
316
+ * viewport less high while a finger pulls the page past its top, by the length of the pull
317
+ * and with the numbers of a keyboard. A keyboard is there for a field, so the frame takes
318
+ * one that has the focus for the sign.
319
+ *
320
+ * Only a frame that fills the viewport follows, and not while the user has zoomed in: what
321
+ * shows is a part of the page then, by the will of the user.
322
+ * @private
323
+ */
324
+ private _syncViewport;
325
+ /**
326
+ * Whether the user types into something: a field or a text they edit has the focus, in the
327
+ * page or in a shadow root that is open, or a frame with another page has it, which keeps
328
+ * to itself what has the focus in it. An on-screen keyboard is there for one of these.
329
+ * @private
330
+ * @returns {boolean}
331
+ */
332
+ private _isTyping;
333
+ /**
334
+ * Whether the frame listens for a tap on the status bar: the page asks for it, the frame
335
+ * fills the viewport, and the browser is one of iOS, which has that tap and nothing that
336
+ * tells of it. `-webkit-touch-callout` is a property only its WebKit knows.
337
+ * @private
338
+ * @returns {boolean}
339
+ */
340
+ private _wantsStatusBarTap;
341
+ /**
342
+ * Starts or stops listening for a tap on the status bar.
343
+ *
344
+ * iOS scrolls the document to its top for that tap, and a frame leaves the document nothing
345
+ * to scroll. So an element makes the document one pixel higher than what the browser shows,
346
+ * and the document rests scrolled down by that pixel: it snaps there. The frame is fixed to
347
+ * the viewport and does not move with it. A tap takes the document back to zero, past the
348
+ * snap, which the frame hears.
349
+ * @private
350
+ */
351
+ private _syncStatusBar;
352
+ /**
353
+ * Makes the document snap to its one pixel, or lets it go.
354
+ *
355
+ * What snaps is where a scroll ends, also the one of a script: `window.scrollTo(0, 0)` of a
356
+ * router leaves the document on its pixel. And a finger that has dragged the page lets it go
357
+ * back there. The tap on the status bar is the one scroll iOS does not snap.
358
+ *
359
+ * The rule is one for the element of the document, the only place the browser reads it for
360
+ * the viewport: the frame writes it there, and puts back what the page had.
361
+ * @private
362
+ * @param {boolean} on
363
+ */
364
+ private _snap;
365
+ /**
366
+ * From now on, for a moment, a scroll of the document is not the doing of a tap on the status
367
+ * bar: a finger drags the page, a keyboard moves it, the phone is turned.
368
+ * @private
369
+ */
370
+ private _quiet;
371
+ /**
372
+ * Whether something else than a tap on the status bar is moving the document.
373
+ * @private
374
+ * @returns {boolean}
375
+ */
376
+ private _isMoved;
377
+ /**
378
+ * Whether the document is scrolling: it has scrolled, and the browser has not said that this
379
+ * is over. A browser that never says so is given the time the longest scroll takes.
380
+ * @private
381
+ * @returns {boolean}
382
+ */
383
+ private _isScrolling;
384
+ /**
385
+ * Scrolls the document down by its one pixel, once nothing else moves it and its scroll is
386
+ * over: iOS takes the document back to the top for as long as it is on its way there. Until
387
+ * then it looks again: a finger can stay on the screen for long.
388
+ *
389
+ * And it asks what tells the tap from a script: whether a script can scroll the document to
390
+ * zero. Where the browser snaps the scroll of a script, it cannot. Where it can, the two look
391
+ * the same, and the frame takes no scroll for the tap.
392
+ * @private
393
+ */
394
+ private _arm;
395
+ /**
396
+ * The document has scrolled. At zero, with nothing else that moves it, the user has tapped
397
+ * the status bar: the content goes to its top, as the document of a page would.
398
+ *
399
+ * A script of the page does not get the document there, a router that sets the scroll of the
400
+ * window back after a change of the view for one: the document snaps to its pixel.
401
+ * @private
402
+ */
403
+ private _onStatusBarScroll;
404
+ /**
405
+ * The regions have changed their sizes. Where what scrolls the content got less high, a
406
+ * keyboard has come in or the window got smaller, and the field the user types into may be
407
+ * out of view now.
408
+ * @private
409
+ */
410
+ private _syncFocus;
411
+ /**
412
+ * Brings the field the user types into back into view, in the region that scrolls it. A
413
+ * field in a dialog or a popover is in the top layer and in no region: the browser shows it.
414
+ * @private
415
+ */
416
+ private _showFocus;
417
+ /**
418
+ * Takes what the stylesheet has decided: where the frame is narrow and has a navigation
419
+ * there, the navigation is in a drawer. Where it is wide again, the drawer goes, open or
420
+ * not: the platform takes a dialog that leaves the page out of the top layer, and the drawer
421
+ * gives the scroll of the page back.
422
+ * @private
423
+ */
424
+ private _syncView;
425
+ /**
426
+ * The elements of the page that open and close the navigation.
427
+ * @private
428
+ * @returns {HTMLElement[]}
429
+ */
430
+ private _toggles;
431
+ /**
432
+ * A toggle says whether the navigation is open, and is not there where there is no drawer to
433
+ * open. An `el-button` reads that from the stylesheet of the frame, before the script has
434
+ * run; any other element is hidden here.
435
+ * @private
436
+ */
437
+ private _syncToggles;
438
+ /**
439
+ * A click on a toggle opens or closes the drawer. A click on a link in the open drawer closes
440
+ * it: the user has chosen where to go, also where the page changes the view without loading.
441
+ * @private
442
+ * @param {MouseEvent} event
443
+ */
444
+ private _onClick;
445
+ /**
446
+ * The regions that can scroll, each with the elements of the page that are in it.
447
+ * @private
448
+ * @returns {Array<[HTMLElement, Element[]]>}
449
+ */
450
+ private _regions;
451
+ /**
452
+ * Watches the sizes of the frame, of the regions and of what the page has put into them.
453
+ * @private
454
+ */
455
+ private _observeSizes;
456
+ /**
457
+ * A region that scrolls and has nothing in it that takes the focus is a stop of the Tab key
458
+ * itself: without one the keyboard cannot scroll it. Some browsers do that by themselves, and
459
+ * this does it for the others.
460
+ * @private
461
+ */
462
+ private _syncTabStops;
463
+ /**
464
+ * After the skip link the content is in view from its start, the keys scroll it, and the Tab
465
+ * key goes on inside of it: the region of the content has the focus.
466
+ *
467
+ * The link is a link to the id of the content, which a browser follows before the script has
468
+ * run. From then on the script does the same and leaves the address alone: a page that keeps
469
+ * its route in the fragment would lose it.
470
+ * @private
471
+ * @param {MouseEvent} event
472
+ */
473
+ private _onSkip;
474
+ /**
475
+ * The navigation: a region of the frame, or the content of a drawer where the frame is
476
+ * narrow. One slot either way, so the page writes the navigation once and no node is moved.
477
+ * @private
478
+ */
479
+ private navigationTemplate;
480
+ /**
481
+ * The edge of a column the user drags: an `el-splitter` at the side that faces the content.
482
+ * Only where the page asks for it, the column is there, and the script runs. Where the
483
+ * navigation is a drawer, it has no edge.
484
+ * @private
485
+ * @param {'navigation'|'aside'} region
486
+ */
487
+ private edgeTemplate;
488
+ template(): any;
489
+ }
490
+ export declare function define(): void;
491
+ export { Events };
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ NAVIGATION_TOGGLE: string;
3
+ RESIZE: string;
4
+ RESIZE_END: string;
5
+ STATUS_BAR_TAP: string;
6
+ };
7
+ export default _default;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The widths from which a frame can be wide. A stylesheet cannot read the width of a query from a
3
+ * custom property, so there is a query per step, and the frame names the one that counts.
4
+ */
5
+ export declare const STEPS: string[];
6
+ export declare const DEFAULT_STEP = "48rem";
7
+ declare const _default: string;
8
+ export default _default;