@w0s/footnote-reference-popover 4.1.2 → 5.1.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 +13 -13
- package/dist/CustomElementPopover.d.ts +2 -0
- package/dist/CustomElementPopover.d.ts.map +1 -1
- package/dist/CustomElementPopover.js +205 -223
- package/dist/CustomElementPopover.js.map +1 -1
- package/dist/FootnoteReferencePopover.d.ts.map +1 -1
- package/dist/FootnoteReferencePopover.js +78 -75
- package/dist/FootnoteReferencePopover.js.map +1 -1
- package/dist/attribute/FootnoteElement.d.ts +12 -0
- package/dist/attribute/FootnoteElement.d.ts.map +1 -0
- package/dist/attribute/FootnoteElement.js +34 -0
- package/dist/attribute/FootnoteElement.js.map +1 -0
- package/dist/attribute/Mouseenter.d.ts +15 -0
- package/dist/attribute/Mouseenter.d.ts.map +1 -0
- package/dist/attribute/Mouseenter.js +26 -0
- package/dist/attribute/Mouseenter.js.map +1 -0
- package/dist/attribute/Mouseleave.d.ts +15 -0
- package/dist/attribute/Mouseleave.d.ts.map +1 -0
- package/dist/attribute/Mouseleave.js +26 -0
- package/dist/attribute/Mouseleave.js.map +1 -0
- package/dist/attribute/PopoverClass.d.ts +12 -0
- package/dist/attribute/PopoverClass.d.ts.map +1 -0
- package/dist/attribute/PopoverClass.js +19 -0
- package/dist/attribute/PopoverClass.js.map +1 -0
- package/dist/attribute/PopoverHide.d.ts +24 -0
- package/dist/attribute/PopoverHide.d.ts.map +1 -0
- package/dist/attribute/PopoverHide.js +57 -0
- package/dist/attribute/PopoverHide.js.map +1 -0
- package/dist/attribute/PopoverLabel.d.ts +12 -0
- package/dist/attribute/PopoverLabel.d.ts.map +1 -0
- package/dist/attribute/PopoverLabel.js +19 -0
- package/dist/attribute/PopoverLabel.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
<dt><code>href</code> [required]</dt>
|
|
64
64
|
<dd>URL hash value of the element that contains the content to be displayed in the popover. (e.g. <code>#footnote-1</code> )</dd>
|
|
65
65
|
<dt><code>data-popover-label</code> [optional]</dt>
|
|
66
|
-
<dd>Label to be set on popover (<code>aria-label</code> attribute value)
|
|
66
|
+
<dd>Label to be set on popover (<code>aria-label</code> attribute value).</dd>
|
|
67
67
|
<dt><code>data-popover-class</code> [optional]</dt>
|
|
68
|
-
<dd>Set the class name (<code>class</code> attribute value) on the
|
|
68
|
+
<dd>Set the class name (<code>class</code> attribute value) on the popover element. It is mainly used to customize the appearance with CSS.</dd>
|
|
69
69
|
<dt><code>data-popover-hide-text</code> [optional]</dt>
|
|
70
70
|
<dd>The text of the close button in the popover. If omitted, the default value is 'Close'.</dd>
|
|
71
71
|
<dt><code>data-popover-hide-image-src</code> [optional]</dt>
|
|
@@ -87,17 +87,15 @@ The popover markup looks like this.
|
|
|
87
87
|
```html
|
|
88
88
|
<a class="js-footnote-reference-popover" href="#footnote" data-popover-class="my-popover">[1]</a>
|
|
89
89
|
|
|
90
|
-
<x-popover class="my-popover">
|
|
90
|
+
<x-popover popover="" class="my-popover">
|
|
91
91
|
#shadow-root (open)
|
|
92
92
|
<span id="first-focusable" tabindex="0"></span>
|
|
93
93
|
|
|
94
|
-
<
|
|
94
|
+
<div tabindex="-1" part="content">
|
|
95
95
|
<slot>...</slot>
|
|
96
96
|
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
</form>
|
|
100
|
-
</dialog>
|
|
97
|
+
<button type="button" popovertarget="" popovertargetaction="hide" part="hide-button">Close</button>
|
|
98
|
+
</div>
|
|
101
99
|
|
|
102
100
|
<span id="last-focusable" tabindex="0"></span>
|
|
103
101
|
</x-popover>
|
|
@@ -106,11 +104,13 @@ The popover markup looks like this.
|
|
|
106
104
|
Therefore, you can customize the style using [`::part`](https://developer.mozilla.org/en-US/docs/Web/CSS/::part) CSS pseudo-element.
|
|
107
105
|
|
|
108
106
|
```css
|
|
109
|
-
.my-popover::part(
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
.my-popover::part(content) {
|
|
108
|
+
&::part(content) {
|
|
109
|
+
...
|
|
110
|
+
}
|
|
112
111
|
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
&::part(hide-button) {
|
|
113
|
+
...
|
|
114
|
+
}
|
|
115
115
|
}
|
|
116
116
|
```
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export interface ToggleEventDetail {
|
|
2
2
|
newState: 'open' | 'closed';
|
|
3
|
+
eventType: string;
|
|
3
4
|
}
|
|
4
5
|
/**
|
|
5
6
|
* Popover
|
|
@@ -22,5 +23,6 @@ export default class CustomElementPopover extends HTMLElement {
|
|
|
22
23
|
get hideImageHeight(): number | null;
|
|
23
24
|
set hideImageHeight(value: number | null);
|
|
24
25
|
get width(): number;
|
|
26
|
+
get hideButtonElement(): HTMLButtonElement;
|
|
25
27
|
}
|
|
26
28
|
//# sourceMappingURL=CustomElementPopover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomElementPopover.d.ts","sourceRoot":"","sources":["../src/CustomElementPopover.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IACjC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"CustomElementPopover.d.ts","sourceRoot":"","sources":["../src/CustomElementPopover.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IACjC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,WAAW;;IAmB5D,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;;IA2DD,iBAAiB,IAAI,IAAI;IAoBzB,oBAAoB,IAAI,IAAI;IAS5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IA0B/F,IAAI,KAAK,IAAI,MAAM,GAAG,IAAI,CAEzB;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAE7B;IAED,IAAI,QAAQ,IAAI,MAAM,GAAG,IAAI,CAE5B;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAUhC;IAED,IAAI,YAAY,IAAI,MAAM,GAAG,IAAI,CAEhC;IAED,IAAI,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAYpC;IAED,IAAI,cAAc,IAAI,MAAM,GAAG,IAAI,CAElC;IAED,IAAI,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAOtC;IAED,IAAI,eAAe,IAAI,MAAM,GAAG,IAAI,CAEnC;IAED,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAOvC;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,iBAAiB,IAAI,iBAAiB,CAEzC;CA0CD"}
|
|
@@ -1,224 +1,206 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Popover
|
|
3
|
-
*/
|
|
4
|
-
export default class CustomElementPopover extends HTMLElement {
|
|
5
|
-
#
|
|
6
|
-
#firstFocusableElement;
|
|
7
|
-
#lastFocusableElement;
|
|
8
|
-
#hideButtonElement;
|
|
9
|
-
#hideButtonImageElement;
|
|
10
|
-
#hideText = 'Close';
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
cssStyleSheet
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
this.#
|
|
58
|
-
this.#
|
|
59
|
-
this.#
|
|
60
|
-
this.#
|
|
61
|
-
this.#
|
|
62
|
-
this.#
|
|
63
|
-
this.#
|
|
64
|
-
this.#firstFocusableFocusEventListener = this.#firstFocusableFocusEvent.bind(this);
|
|
65
|
-
this.#lastFocusableFocusEventListener = this.#lastFocusableFocusEvent.bind(this);
|
|
66
|
-
}
|
|
67
|
-
connectedCallback() {
|
|
68
|
-
this.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
this.#
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
this.#
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
this.#
|
|
129
|
-
this.#
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
this.#
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
this.#
|
|
142
|
-
this.#hideButtonElement.
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
*
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
break;
|
|
207
|
-
}
|
|
208
|
-
default:
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* 最初の循環フォーカス要素にフォーカスされたときの処理
|
|
213
|
-
*/
|
|
214
|
-
#firstFocusableFocusEvent() {
|
|
215
|
-
this.#hideButtonElement.focus();
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* 最後の循環フォーカス要素にフォーカスされたときの処理
|
|
219
|
-
*/
|
|
220
|
-
#lastFocusableFocusEvent() {
|
|
221
|
-
this.#popoverElement.focus();
|
|
222
|
-
}
|
|
223
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Popover
|
|
3
|
+
*/
|
|
4
|
+
export default class CustomElementPopover extends HTMLElement {
|
|
5
|
+
#contentElement;
|
|
6
|
+
#firstFocusableElement;
|
|
7
|
+
#lastFocusableElement;
|
|
8
|
+
#hideButtonElement;
|
|
9
|
+
#hideButtonImageElement;
|
|
10
|
+
#hideText = 'Close';
|
|
11
|
+
#customToggleEventListener;
|
|
12
|
+
#firstFocusableFocusEventListener;
|
|
13
|
+
#lastFocusableFocusEventListener;
|
|
14
|
+
static get observedAttributes() {
|
|
15
|
+
return ['label', 'hide-text', 'hide-image-src', 'hide-image-width', 'hide-image-height'];
|
|
16
|
+
}
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
const cssString = `
|
|
20
|
+
:host {
|
|
21
|
+
position: absolute;
|
|
22
|
+
contain: layout;
|
|
23
|
+
margin: 0;
|
|
24
|
+
border: none;
|
|
25
|
+
padding: 0;
|
|
26
|
+
overflow: visible;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[part="content"] {
|
|
30
|
+
border: solid;
|
|
31
|
+
padding: 0.25em;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
[part="hide-button"] > img {
|
|
35
|
+
display: block flow;
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
const shadow = this.attachShadow({ mode: 'open' });
|
|
39
|
+
shadow.innerHTML = `
|
|
40
|
+
<span id="first-focusable" tabindex="0"></span>
|
|
41
|
+
<div tabindex="-1" part="content">
|
|
42
|
+
<slot></slot>
|
|
43
|
+
<button type="button" popovertargetaction="hide" part="hide-button"></button>
|
|
44
|
+
</div>
|
|
45
|
+
<span id="last-focusable" tabindex="0"></span>
|
|
46
|
+
`;
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
48
|
+
if (shadow.adoptedStyleSheets !== undefined) {
|
|
49
|
+
const cssStyleSheet = new CSSStyleSheet();
|
|
50
|
+
cssStyleSheet.replaceSync(cssString);
|
|
51
|
+
shadow.adoptedStyleSheets = [cssStyleSheet];
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
/* adoptedStyleSheets 未対応環境 */
|
|
55
|
+
shadow.innerHTML += `<style>${cssString}</style>`;
|
|
56
|
+
}
|
|
57
|
+
this.#contentElement = shadow.querySelector('[part="content"]');
|
|
58
|
+
this.#hideButtonElement = shadow.querySelector('[part="hide-button"]');
|
|
59
|
+
this.#firstFocusableElement = shadow.getElementById('first-focusable');
|
|
60
|
+
this.#lastFocusableElement = shadow.getElementById('last-focusable');
|
|
61
|
+
this.#hideButtonImageElement = document.createElement('img');
|
|
62
|
+
this.#hideButtonElement.textContent = this.#hideText;
|
|
63
|
+
this.#customToggleEventListener = this.#customToggleEvent.bind(this);
|
|
64
|
+
this.#firstFocusableFocusEventListener = this.#firstFocusableFocusEvent.bind(this);
|
|
65
|
+
this.#lastFocusableFocusEventListener = this.#lastFocusableFocusEvent.bind(this);
|
|
66
|
+
}
|
|
67
|
+
connectedCallback() {
|
|
68
|
+
this.popover = '';
|
|
69
|
+
this.#hideButtonElement.popoverTargetElement = this;
|
|
70
|
+
/* コピー元の HTML 中に id 属性が設定されていた場合、ページ中に ID が重複してしまうのを防ぐ */
|
|
71
|
+
const hostElement = this.shadowRoot?.host;
|
|
72
|
+
if (hostElement !== undefined) {
|
|
73
|
+
for (const element of hostElement.querySelectorAll('[id]')) {
|
|
74
|
+
element.removeAttribute('id');
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/* ポップオーバー状態変化 */
|
|
78
|
+
this.addEventListener('my-toggle', this.#customToggleEventListener, { passive: true });
|
|
79
|
+
/* 循環フォーカス */
|
|
80
|
+
this.#firstFocusableElement.addEventListener('focus', this.#firstFocusableFocusEventListener, { passive: true });
|
|
81
|
+
this.#lastFocusableElement.addEventListener('focus', this.#lastFocusableFocusEventListener, { passive: true });
|
|
82
|
+
}
|
|
83
|
+
disconnectedCallback() {
|
|
84
|
+
/* ポップオーバー状態変化 */
|
|
85
|
+
this.removeEventListener('my-toggle', this.#customToggleEventListener);
|
|
86
|
+
/* 循環フォーカス */
|
|
87
|
+
this.#firstFocusableElement.removeEventListener('focus', this.#firstFocusableFocusEventListener);
|
|
88
|
+
this.#lastFocusableElement.removeEventListener('focus', this.#lastFocusableFocusEventListener);
|
|
89
|
+
}
|
|
90
|
+
attributeChangedCallback(name, _oldValue, newValue) {
|
|
91
|
+
switch (name) {
|
|
92
|
+
case 'label': {
|
|
93
|
+
this.label = newValue;
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
case 'hide-text': {
|
|
97
|
+
this.hideText = newValue;
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
case 'hide-image-src': {
|
|
101
|
+
this.hideImageSrc = newValue;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
case 'hide-image-width': {
|
|
105
|
+
this.hideImageWidth = Number(newValue);
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
case 'hide-image-height': {
|
|
109
|
+
this.hideImageHeight = Number(newValue);
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
default:
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
get label() {
|
|
116
|
+
return this.ariaLabel;
|
|
117
|
+
}
|
|
118
|
+
set label(value) {
|
|
119
|
+
this.ariaLabel = value;
|
|
120
|
+
}
|
|
121
|
+
get hideText() {
|
|
122
|
+
return this.#hideText;
|
|
123
|
+
}
|
|
124
|
+
set hideText(value) {
|
|
125
|
+
if (value === null) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
this.#hideText = value;
|
|
129
|
+
this.#hideButtonElement.textContent = value;
|
|
130
|
+
this.#hideButtonImageElement.alt = this.#hideText;
|
|
131
|
+
}
|
|
132
|
+
get hideImageSrc() {
|
|
133
|
+
return this.#hideButtonImageElement.src;
|
|
134
|
+
}
|
|
135
|
+
set hideImageSrc(value) {
|
|
136
|
+
if (value === null) {
|
|
137
|
+
this.#hideButtonImageElement.removeAttribute('src');
|
|
138
|
+
this.#hideButtonElement.textContent = this.#hideText;
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
this.#hideButtonImageElement.src = value;
|
|
142
|
+
this.#hideButtonElement.textContent = '';
|
|
143
|
+
this.#hideButtonElement.appendChild(this.#hideButtonImageElement);
|
|
144
|
+
}
|
|
145
|
+
get hideImageWidth() {
|
|
146
|
+
return this.#hideButtonImageElement.width;
|
|
147
|
+
}
|
|
148
|
+
set hideImageWidth(value) {
|
|
149
|
+
if (value === null) {
|
|
150
|
+
this.#hideButtonImageElement.removeAttribute('width');
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
this.#hideButtonImageElement.width = value;
|
|
154
|
+
}
|
|
155
|
+
get hideImageHeight() {
|
|
156
|
+
return this.#hideButtonImageElement.height;
|
|
157
|
+
}
|
|
158
|
+
set hideImageHeight(value) {
|
|
159
|
+
if (value === null) {
|
|
160
|
+
this.#hideButtonImageElement.removeAttribute('height');
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
this.#hideButtonImageElement.height = value;
|
|
164
|
+
}
|
|
165
|
+
get width() {
|
|
166
|
+
return this.#contentElement.getBoundingClientRect().width;
|
|
167
|
+
}
|
|
168
|
+
get hideButtonElement() {
|
|
169
|
+
return this.#hideButtonElement;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* ポップオーバーの表示/非表示状態が変化したの処理
|
|
173
|
+
*
|
|
174
|
+
* @param ev - Event
|
|
175
|
+
*/
|
|
176
|
+
#customToggleEvent(ev) {
|
|
177
|
+
const detail = ev.detail;
|
|
178
|
+
switch (detail.newState) {
|
|
179
|
+
case 'open': {
|
|
180
|
+
this.showPopover();
|
|
181
|
+
if (detail.eventType === 'click') {
|
|
182
|
+
this.#contentElement.focus();
|
|
183
|
+
}
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
case 'closed': {
|
|
187
|
+
this.hidePopover();
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
default:
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* 最初の循環フォーカス要素にフォーカスされたときの処理
|
|
195
|
+
*/
|
|
196
|
+
#firstFocusableFocusEvent() {
|
|
197
|
+
this.#hideButtonElement.focus();
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* 最後の循環フォーカス要素にフォーカスされたときの処理
|
|
201
|
+
*/
|
|
202
|
+
#lastFocusableFocusEvent() {
|
|
203
|
+
this.#contentElement.focus();
|
|
204
|
+
}
|
|
205
|
+
}
|
|
224
206
|
//# sourceMappingURL=CustomElementPopover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomElementPopover.js","sourceRoot":"","sources":["../src/CustomElementPopover.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CustomElementPopover.js","sourceRoot":"","sources":["../src/CustomElementPopover.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,WAAW;IACnD,eAAe,CAAc;IAE7B,sBAAsB,CAAc;IAEpC,qBAAqB,CAAc;IAEnC,kBAAkB,CAAoB;IAEtC,uBAAuB,CAAmB;IAEnD,SAAS,GAAG,OAAO,CAAC;IAEX,0BAA0B,CAA4B;IAEtD,iCAAiC,CAAa;IAE9C,gCAAgC,CAAa;IAEtD,MAAM,KAAK,kBAAkB;QAC5B,OAAO,CAAC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;IAC1F,CAAC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AAC,MAA2B,CAAC;QAE9C,QAAQ,MAAM,CAAC,QAAQ,EAAE,CAAC;YACzB,KAAK,MAAM,CAAC,CAAC,CAAC;gBACb,IAAI,CAAC,WAAW,EAAE,CAAC;gBAEnB,IAAI,MAAM,CAAC,SAAS,KAAK,OAAO,EAAE,CAAC;oBAClC,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;gBAC9B,CAAC;gBAED,MAAM;YACP,CAAC;YACD,KAAK,QAAQ,CAAC,CAAC,CAAC;gBACf,IAAI,CAAC,WAAW,EAAE,CAAC;gBAEnB,MAAM;YACP,CAAC;YACD,QAAQ;QACT,CAAC;IACF,CAAC;IAED;;OAEG;IACH,yBAAyB;QACxB,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,wBAAwB;QACvB,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FootnoteReferencePopover.d.ts","sourceRoot":"","sources":["../src/FootnoteReferencePopover.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FootnoteReferencePopover.d.ts","sourceRoot":"","sources":["../src/FootnoteReferencePopover.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,MAAM,CAAC,OAAO;;IAuBb;;OAEG;gBACS,WAAW,EAAE,iBAAiB;CAgO1C"}
|