├── images
├── tl1.png
├── tl2.png
├── tl3.png
├── tl4.png
├── tl5.png
├── tl6.png
├── tl7.png
├── tl8.png
├── tl9.png
├── yrftx.jpg
├── icon-1.png
└── icon-144.png
├── css
├── font_2768819_g3u1ca8dk06.ttf
├── font_2768819_g3u1ca8dk06.woff
├── font_2768819_g3u1ca8dk06.woff2
└── font_2768819_g3u1ca8dk06.css
├── manifest.json
├── .gitignore
├── file-cache-demo3.html
├── file-cache-demo1.html
├── file-cache-demo2.html
├── font-size.html
├── typeit.html
├── font-v-middle.html
├── prepared.html
├── v-middle.html
├── css_var.html
├── aspect-ratio.html
├── number-input.html
├── div-canvas.html
├── nth-child.html
├── multipleTag.html
├── pwa.html
├── css-infinity.html
├── svgdemo.html
├── background.html
├── consoledemo.html
├── percent-demo.html
├── bodysize.html
├── flex-direction.html
├── fixed-size.html
├── span-margin-top.html
├── writing-mode.html
├── color.html
├── form-submit.html
├── margin-collapse.html
├── onlyoffice-excel.html
├── onlyoffice-word.html
├── box.html
├── onlyoffice-ppt.html
├── test.html
├── margin.html
├── css_func.html
├── js
├── prepared.js
└── ResizeObserver.js
├── resize.html
├── flex-transition-demo2.html
├── download.html
├── touch-scope-demo.html
├── alignitem-stretch-demo.html
├── scrollHeight.html
├── focus-within.html
├── gap-test.html
├── overflow.html
├── ulli.html
├── floatDemo2.html
├── flex_demo.html
├── test22.html
├── drag-hidden.html
├── scheme.html
├── innerClick.html
├── overflow-x.html
├── textarea.html
├── copyspan.html
├── drag-div.html
├── justify-content-scroll.html
├── mobile-scroll.html
├── 1219.html
├── multi_item_center.html
├── 100percent.html
├── trafter.html
├── content-line.html
├── gap.html
├── word-break.html
├── scroll.html
├── flex-transition-demo.html
├── map.html
├── height-transition.html
├── sticky.html
├── dark_demo.html
├── timeline.html
├── container_no.html
├── floatDemo.html
├── scroll-custom.html
├── print_header.html
├── thead.html
└── index.html
/images/tl1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzsh/st-html-demo/HEAD/images/tl1.png
--------------------------------------------------------------------------------
/images/tl2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzsh/st-html-demo/HEAD/images/tl2.png
--------------------------------------------------------------------------------
/images/tl3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzsh/st-html-demo/HEAD/images/tl3.png
--------------------------------------------------------------------------------
/images/tl4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzsh/st-html-demo/HEAD/images/tl4.png
--------------------------------------------------------------------------------
/images/tl5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzsh/st-html-demo/HEAD/images/tl5.png
--------------------------------------------------------------------------------
/images/tl6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzsh/st-html-demo/HEAD/images/tl6.png
--------------------------------------------------------------------------------
/images/tl7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzsh/st-html-demo/HEAD/images/tl7.png
--------------------------------------------------------------------------------
/images/tl8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzsh/st-html-demo/HEAD/images/tl8.png
--------------------------------------------------------------------------------
/images/tl9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzsh/st-html-demo/HEAD/images/tl9.png
--------------------------------------------------------------------------------
/images/yrftx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzsh/st-html-demo/HEAD/images/yrftx.jpg
--------------------------------------------------------------------------------
/images/icon-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzsh/st-html-demo/HEAD/images/icon-1.png
--------------------------------------------------------------------------------
/images/icon-144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzsh/st-html-demo/HEAD/images/icon-144.png
--------------------------------------------------------------------------------
/css/font_2768819_g3u1ca8dk06.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzsh/st-html-demo/HEAD/css/font_2768819_g3u1ca8dk06.ttf
--------------------------------------------------------------------------------
/css/font_2768819_g3u1ca8dk06.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzsh/st-html-demo/HEAD/css/font_2768819_g3u1ca8dk06.woff
--------------------------------------------------------------------------------
/css/font_2768819_g3u1ca8dk06.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzsh/st-html-demo/HEAD/css/font_2768819_g3u1ca8dk06.woff2
--------------------------------------------------------------------------------
/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Test",
3 | "display": "standalone",
4 | "start_url": "./pwa.html",
5 | "icons":
6 | [{
7 | "src": "images/icon-144.png",
8 | "sizes": "144x144",
9 | "type": "image/png"
10 | }]
11 | }
12 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | /dist/
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Editor directories and files
9 | .idea
10 | .vscode
11 | *.suo
12 | *.ntvs*
13 | *.njsproj
14 | *.sln
15 | package-lock.json
16 |
--------------------------------------------------------------------------------
/file-cache-demo3.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Document
7 |
8 |
9 | http://www.a.com/file-cache-demo1.html
10 |
11 |
12 |
--------------------------------------------------------------------------------
/file-cache-demo1.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/file-cache-demo2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/font-size.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 | │你好xltRegE一
12 |
13 |
14 |
--------------------------------------------------------------------------------
/typeit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
15 |
16 |
--------------------------------------------------------------------------------
/font-v-middle.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
13 |
14 |
15 |
16 | demo
17 | test
18 | x你好世界
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/prepared.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
15 |
16 |
17 | submit
18 |
19 |
20 |
--------------------------------------------------------------------------------
/v-middle.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 | abcjy你好
12 |
13 |
14 | jyabcs
15 |
16 |
17 |
--------------------------------------------------------------------------------
/css_var.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | css var
8 |
16 |
17 |
18 | xiaoshan.bug
19 | hello world
20 |
21 |
--------------------------------------------------------------------------------
/aspect-ratio.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
15 |
16 |
17 |
18 | 12312asdflkjasdlf
19 |
20 |
21 |
--------------------------------------------------------------------------------
/number-input.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Document
7 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/css/font_2768819_g3u1ca8dk06.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: "iconfont"; /* Project id 2768819 */
3 | src: url('./font_2768819_g3u1ca8dk06.woff2?t=1670691719763') format('woff2'),
4 | url('./font_2768819_g3u1ca8dk06.woff?t=1670691719763') format('woff'),
5 | url('./font_2768819_g3u1ca8dk06.ttf?t=1670691719763') format('truetype');
6 | }
7 |
8 | .iconfont {
9 | font-family: "iconfont" !important;
10 | font-size: 16px;
11 | font-style: normal;
12 | -webkit-font-smoothing: antialiased;
13 | -moz-osx-font-smoothing: grayscale;
14 | }
15 |
16 | .icon-qiehuan:before {
17 | content: "\e656";
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/div-canvas.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/nth-child.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | nth-child
9 |
14 |
15 |
16 |
17 | 这是标题
18 |
19 |
第n个段落。
20 |
第n个段落。
21 |
=-----
22 |
23 | 第一个段落。
24 | 第二个段落。
25 | 第三个段落。
26 | 第四个段落。
27 | 第五个段落。
28 | 第六个段落。
29 |
30 |
31 |
--------------------------------------------------------------------------------
/multipleTag.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
14 |
15 |
16 |
17 |
18 | 张三
19 | 李四
20 | 王五
21 | 李四
22 | 王五
23 | 李四
24 | 王五
25 |
26 |
27 |
--------------------------------------------------------------------------------
/pwa.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 | test
11 | 添加
12 |
13 |
24 |
25 |
--------------------------------------------------------------------------------
/css-infinity.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Document
6 |
37 |
38 |
39 | 程序员小山与Bug
40 |
41 |
--------------------------------------------------------------------------------
/svgdemo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/background.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | background
8 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/consoledemo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
14 | xiaoshan.bug
15 |
16 |
33 |
34 |
--------------------------------------------------------------------------------
/percent-demo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
13 |
14 |
15 |
19 |
20 |
--------------------------------------------------------------------------------
/bodysize.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
16 |
17 |
18 |
19 | 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123
20 |
21 |
22 |
--------------------------------------------------------------------------------
/flex-direction.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
18 |
19 |
20 |
21 |
test
22 |
test
23 |
test
24 |
25 |
26 |
--------------------------------------------------------------------------------
/fixed-size.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
22 |
23 |
24 |
25 |
26 | wrapper
27 |
test
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/span-margin-top.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
24 |
25 |
26 |
29 | asfsdf
30 |
31 |
--------------------------------------------------------------------------------
/writing-mode.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
29 |
30 |
31 | test
32 |
33 |
--------------------------------------------------------------------------------
/color.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/form-submit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Document
7 |
8 |
9 |
12 |
13 |
14 | 12312
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/margin-collapse.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Document
7 |
26 |
27 |
28 |
33 |
34 |
--------------------------------------------------------------------------------
/onlyoffice-excel.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Excel
9 |
10 |
11 |
14 |
15 |
16 |
17 |
24 |
25 |
--------------------------------------------------------------------------------
/onlyoffice-word.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Word
9 |
10 |
11 |
14 |
15 |
16 |
17 |
24 |
25 |
--------------------------------------------------------------------------------
/box.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
27 |
28 |
29 |
30 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/onlyoffice-ppt.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | PPT
9 |
10 |
11 |
12 |
15 |
16 |
17 |
18 |
19 |
26 |
27 |
--------------------------------------------------------------------------------
/test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
23 |
24 |
25 |
26 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/margin.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | margin demo
8 |
24 |
25 |
26 |
29 |
30 |
--------------------------------------------------------------------------------
/css_func.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | test
8 |
25 |
26 |
27 |
28 |
hello world asdf
29 |
30 |
31 |
--------------------------------------------------------------------------------
/js/prepared.js:
--------------------------------------------------------------------------------
1 | function Prepared(count, repeatable = false){
2 |
3 |
4 | let _preparedCount, _preparedResolve, _prepared, _callback, _this
5 |
6 |
7 | const reset = () => {
8 | _preparedCount = count
9 | _prepared = new Promise((resolve, reject) => {
10 | _preparedResolve = resolve
11 | })
12 | if (_callback) {
13 | _prepared.then(_callback)
14 | }
15 | return _preparedCount
16 | }
17 | const ready = (callback) => {
18 | _callback = callback
19 | _prepared.then(_callback)
20 | return _this
21 | }
22 | const submit = () => {
23 | _preparedCount--
24 | if (_preparedCount === 0) {
25 | _preparedResolve()
26 | if (repeatable) {
27 | reset();
28 | }
29 | }
30 | return _preparedCount;
31 | }
32 | _this = { reset, ready, submit }
33 | reset()
34 | return _this
35 | }
--------------------------------------------------------------------------------
/resize.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
28 |
29 |
--------------------------------------------------------------------------------
/flex-transition-demo2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
26 |
27 |
28 |
29 |
111
30 |
22222
31 |
3333333
32 |
33 |
34 |
--------------------------------------------------------------------------------
/download.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 | test
11 |
12 | test
13 |
14 |
26 |
27 |
--------------------------------------------------------------------------------
/touch-scope-demo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
24 |
30 |
31 |
32 |
33 |
34 | test
35 |
36 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/alignitem-stretch-demo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Document
7 |
26 |
27 |
28 |
29 |
30 |
item-a
31 |
item-b item-b item-b item-b
32 |
item-c item-c
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/scrollHeight.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
19 |
20 |
21 |
22 |
23 |
24 |
test
25 |
test
26 |
test
27 |
test
28 |
test
29 |
test
30 |
test
31 |
test
32 |
test
33 |
test
34 |
test
35 |
test
36 |
test
37 |
test
38 |
test
39 |
test
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/focus-within.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
36 |
37 |
--------------------------------------------------------------------------------
/gap-test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
25 |
26 |
27 |
28 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/overflow.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
27 |
28 |
29 |
30 |
31 |
对这个 世界 如果你
32 |
有太多的 抱怨。
33 |
跌倒了 就不敢 继续 往前走
34 |
珍惜一切 就算 没有拥有
35 |
xiaoshan.bug
36 | nihao
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/ulli.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
33 |
34 |
35 |
36 | X
37 |
38 |
39 |
--------------------------------------------------------------------------------
/floatDemo2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
38 |
39 |
40 |
43 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/flex_demo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
27 |
28 |
29 |
30 |
31 | 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/test22.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 | test
11 |
40 |
41 |
--------------------------------------------------------------------------------
/drag-hidden.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
19 |
24 |
25 |
26 |
27 |
28 |
1
29 |
2
30 |
3
31 |
32 |
33 | 4
34 |
35 |
5
36 |
37 |
38 | zzzz zzzz zzzz zzzz zzzz zzzz zzzz zzzz zzzz
39 |
40 |
41 |
--------------------------------------------------------------------------------
/scheme.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
38 | Restart iThrown
39 |
40 |
--------------------------------------------------------------------------------
/innerClick.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Document
7 |
24 |
38 |
39 |
40 |
44 |
45 |
--------------------------------------------------------------------------------
/overflow-x.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
01
40 |
02
41 |
03
42 |
04
43 |
05
44 |
06
45 |
07
46 |
08
47 |
09
48 |
10
49 |
11
50 |
12
51 |
13
52 |
14
53 |
15
54 |
16
55 |
17
56 |
18
57 |
19
58 |
20
59 |
60 |
61 |
--------------------------------------------------------------------------------
/textarea.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
30 |
31 |
32 |
33 |
Div 1 23423 23423 23423 23423 23423 23423
Div 2
Div 3 werwer
36 |
37 |
38 |
--------------------------------------------------------------------------------
/copyspan.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
13 |
21 |
29 |
30 |
31 |
32 | abc %%BR%% 111
33 |
34 |
35 | sssss %%BR%% 222
36 |
37 |
38 | abc %%BR%% 111
39 |
40 |
41 |
--------------------------------------------------------------------------------
/drag-div.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
18 |
19 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/justify-content-scroll.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
47 |
48 |
49 |
50 |
51 |
1
52 |
2
53 |
3
54 |
4
55 |
5
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/mobile-scroll.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 | 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123
12 | 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123
13 | 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123
14 | 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123
15 | 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123
16 | 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123
17 |
18 |
19 |
--------------------------------------------------------------------------------
/1219.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 梦的光点
9 |
10 |
11 |
12 |
13 |
14 |
15 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/multi_item_center.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Document
7 |
50 |
51 |
52 |
53 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/100percent.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
19 |
20 |
21 |
22 | test
23 | test
24 | test
25 | test
26 | test
27 | test
28 | test
29 | test
30 | test
31 | test
32 | test
33 | test
34 | test
35 | test
36 | test
37 | test
38 | test
39 | test
40 | test
41 | test
42 | test
43 | test
44 | test
45 | test
46 | test
47 | test
48 | test
49 | test
50 | test
51 | test
52 | test
53 | test
54 | test
55 | test
56 | test
57 | test
58 | test
59 | test
60 | test
61 | test
62 | test
63 | test
64 | test
65 | test
66 | test
67 | test
68 | test
69 | test
70 | test
71 | test
72 | test
73 | test
74 | test
75 | test
76 | test
77 | test
78 | test
79 | test
80 | test
81 | test
82 |
83 |
84 |
--------------------------------------------------------------------------------
/trafter.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
36 |
37 |
38 |
39 |
40 | 1
41 | 2
42 | 3
43 |
44 |
45 | 4
46 | 5
47 | 6
48 |
49 |
50 | 7
51 | 8
52 | 9
53 |
54 |
55 |
65 |
66 |
--------------------------------------------------------------------------------
/content-line.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
27 |
28 |
29 |
30 |
31 |
32 | lkjlkjflaskdjflaskjdflasjdflks jdfaasdflkjasdfl
33 | asdflkajsdlfkjasldfkjasdlf
34 | asdfjlaskjdflaksjdflakkjasdlf
35 | asdfjlaskjdflaksjdflakkjasdlf
36 | asdfjlaskjdflaksjdflak
37 |
38 |
39 |
40 |
55 |
56 |
--------------------------------------------------------------------------------
/gap.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
44 |
45 |
46 |
51 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/word-break.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | Loooooooooong texxxxt
41 |
42 |
43 |
44 |
vip
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | Loxxxxxxoong texxt
55 |
56 |
57 |
58 |
vip
59 |
60 |
61 |
62 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/scroll.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
27 |
37 |
38 |
39 |
40 |
46 |
47 |
48 |
49 |
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
50 |
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
51 |
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/flex-transition-demo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
44 |
45 |
46 |
47 |
48 |
111
49 |
50 | asdkfjasldfkjas;ldf
51 | asdflkajsdfl
52 |
53 |
54 |
55 |
222
56 |
57 | 1231
58 |
59 |
60 |
61 |
333
62 |
63 | 43laksdjflaskdj
64 |
65 |
66 |
67 |
76 |
77 |
--------------------------------------------------------------------------------
/map.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Map Demo
9 |
50 |
51 |
52 |
53 |
54 |
63 |
64 |
69 |
70 |
--------------------------------------------------------------------------------
/height-transition.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
69 |
70 |
71 |
72 |
73 |
74 |
aslkdfjalskdjf
75 |
aslkdfjalskdjf
76 |
aslkdfjalskdjf
77 |
aslkdfjalskdjf
78 |
aslkdfjalskdjf
79 |
aslkdfjalskdjf
80 |
aslkdfjalskdjf
81 |
aslkdfjalskdjf
82 |
aslkdfjalskdjf
83 |
aslkdfjalskdjf
84 |
aslkdfjalskdjf
85 |
aslkdfjalskdjf
86 |
aslkdfjalskdjf
87 |
88 |
89 |
90 |
91 |
--------------------------------------------------------------------------------
/sticky.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | top-bar - demo
8 |
36 |
37 |
38 |
39 |
40 |
牛仔很忙
41 |
牛仔很忙
42 |
牛仔很忙
43 |
牛仔很忙
44 |
牛仔很忙
45 |
46 |
47 |
48 |
呜啦啦啦火车笛 随着奔腾的马蹄
49 |
小妹妹吹着口琴 夕阳下美了剪影
50 |
我用子弹写日记 介绍完了风景
51 |
接下来换介绍我自己
52 |
我虽然是个牛仔 在酒吧只点牛奶
53 |
为什么不喝啤酒 因为啤酒伤身体
54 |
很多人不长眼睛 嚣张都靠武器
55 |
赤手空拳就缩成蚂蚁
56 |
不用麻烦了 不用麻烦了
57 |
不用麻烦 不用麻烦了 不用麻烦了
58 |
你们一起上 我在赶时间
59 |
每天决斗观众都累了 英雄也累了
60 |
不用麻烦了 不用麻烦了
61 |
副歌不长你们有几个 一起上好了
62 |
正义呼唤我 美女需要我
63 |
牛仔很忙的
64 |
我啦啦啦骑毛驴 因为马跨不上去
65 |
洗澡都洗泡泡浴 因为可以玩玩具
66 |
我有颗善良的心 都只穿假牛皮
67 |
喔跌倒时尽量不压草皮
68 |
枪口它没长眼睛 我曾经答应上帝
69 |
除非是万不得已 我尽量射橡皮筋
70 |
老板先来杯奶昔 要逃命前请你
71 |
顺便喂喂我那只小毛驴
72 |
不用麻烦了 不用麻烦了
73 |
不用麻烦 不用麻烦了 不用麻烦了
74 |
你们一起上 我在赶时间
75 |
每天决斗观众都累了 英雄也累了
76 |
不用麻烦了 不用麻烦了
77 |
副歌不长你们有几个 一起上好了
78 |
正义呼唤我 美女需要我
79 |
牛仔很忙的
80 |
不用麻烦了 不用麻烦了
81 |
不用麻烦 不用麻烦了 不用麻烦了
82 |
你们一起上 我在赶时间
83 |
每天决斗观众都累了 英雄也累了
84 |
不用麻烦了 不用麻烦了
85 |
副歌不长你们有几个 一起上好了
86 |
正义呼唤我 美女需要我
87 |
牛仔很忙的
88 |
89 |
90 |
93 |
94 |
--------------------------------------------------------------------------------
/dark_demo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
《本草纲目》
71 |
如果华佗再世 崇洋都被医治 外邦来学汉字 激发我民族意识 马钱子决明子苍耳子 还有莲子 黄药子苦豆子川楝子 我要面子 用我的方式 改写一部历史 没什么别的事 跟着我念几个字 山药当归枸杞 GO 山药 当归 枸杞 GO 看我抓一把中药 服下一帖骄傲 我表情悠哉 跳个大概 动作轻松自在 你学不来 霓虹的招牌 调整好状态 在华丽的城市 等待醒来 我表情悠哉 跳个大概 用书法书朝代 内力传开 豪气挥正楷 给一拳对白 结局平躺下来 看谁厉害 炼成什么丹 揉成什么丸 鹿茸切片不能太薄 老师傅的手法不能这样乱抄 龟苓膏云南白药 还有冬虫夏草 自己的音乐自己的药 分量刚刚好 听我说中药苦 抄袭应该更苦 快翻开本草纲目 多看一些善本书 蟾酥地龙 已翻过江湖 这些老祖宗的辛苦 我们一定不能输 就是这个光 就是这个光 一起唱 (就是这个光 就是这个光 Hey~) 让我来调个偏方 专治你媚外的内伤 已扎根千年的汉方 有别人不知道的力量 我表情悠哉 跳个大概 动作轻松自在 你学不来 霓虹的招牌 调整好状态 在华丽的城市 等待醒来 我表情悠哉 跳个大概 用书法书朝代 内力传开 豪气挥正楷 给一拳对白 结局平躺下来 看谁厉害 又蹲 小僵尸蹲 暗巷点灯 又蹲 小僵尸蹲 钻萝卜坑 又蹲 小僵尸蹲 念咒语哼 蹲 小僵尸 蹲 小僵尸 蹲 又蹲 小僵尸蹲 暗巷点灯 又蹲 小僵尸蹲 钻萝卜坑 又蹲 小僵尸蹲 念咒语哼 啦啦啦啦啦(啦啦啦啦啦) 啦啦啦啦啦(啦啦啦啦啦 嘿~) 啦啦啦啦啦(啦啦啦啦啦) 啦啦啦啦啦(啦啦啦啦啦)
72 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/timeline.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/container_no.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Document
7 |
42 |
94 |
95 |
96 |
97 |
98 |
99 |
集装箱号:
100 |
101 |
❌
102 |
✅
103 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/floatDemo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
400-000-0000
18 |
(9:00-21:00)
19 |
20 |
21 |
您好,欢迎来到!
22 |
|
23 |
登录
24 |
|
25 |
免费注册
26 |
|
27 |
帮助中心
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
47 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/scroll-custom.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 自定义滚动条
6 |
52 |
53 |
54 |
57 |
58 |
59 |
jQuery是一个快速、简洁的JavaScript框架,是继Prototype之后又一个优秀的JavaScript代码库(或JavaScript框架)。jQuery设计的宗旨是“write Less,Do More”,即倡导写更少的代码,做更多的事情。它封装JavaScript常用的功能代码,提供一种简便的JavaScript设计模式,优化HTML文档操作、事件处理、动画设计和Ajax交互。
60 |
jQuery的核心特性可以总结为:具有独特的链式语法和短小清晰的多功能接口;具有高效灵活的css选择器,并且可对CSS选择器进行扩展;拥有便捷的插件扩展机制和丰富的插件。jQuery兼容各种主流浏览器,如IE 6.0+、FF 1.5+、Safari 2.0+、Opera 9.0+等。
61 |
2006年1月John Resig等人创建了jQuery;8月,jQuery的第一个稳定版本,并且已经支持CSS选择符、事件处理和AJAX交互。
62 |
2007年7月,jQuery 1.1.3版发布,这次小版本的变化包含了对jQuery选择符引擎执行速度的显著提升。从这个版本开始,jQuery的性能达到了Prototype、Mootools以及Dojo等同类JavaScript库的水平。同年9月,jQuery 1.2版发布,它去掉了对XPath选择符的支持,原因是相对于CSS语法它已经变得多余了。这一版能够对效果进行更为灵活的定制,而且借助新增的命名空间事件,也使插件开发变得更容易。同时,jQuery UI项目也开始启动,这个新的套件是作为曾经流行但已过时的Interface插件的替代项目而发布的。jQuery UI中包含大量预定义好的部件(widget),以及一组用于构建高级元素(例如可拖放、拖拽、排序)的工具。
63 |
2008年5月,jQuery 1.2.6版发布,这版主要是将Brandon Aaron开发的流行的Dimensions插件的功能移植到了核心库中,同时也修改了许多BUG,而且有不少的性能得到提高。因此,如果以前的jQuery版本升级到1.2.6,那么完全可以从代码中排除Dimensions插件(一个获得元素尺寸、定位的插件)。
64 |
2010年1月,也是jQuery的四周年生日,jQuery 1.4版发布,为了庆祝jQuery四周岁生日,jQuery团队特别创建了jquery14.com站点,带来了连续14天的新版本专题介绍。
65 |
66 |
67 |
68 |
105 |
106 |
107 |
108 |
--------------------------------------------------------------------------------
/print_header.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
11 |
12 |
13 |
14 |
15 | 班级
16 | 姓名
17 | 性别
18 | 年龄
19 |
20 |
21 | 1
22 | 张三
23 | 男
24 | 20
25 |
26 |
27 | 2
28 | 李四
29 | 男
30 | 21
31 |
32 |
33 | 3
34 | 王五
35 | 男
36 | 22
37 |
38 |
39 | 4
40 | 赵六
41 | 男
42 | 23
43 |
44 |
45 | 5
46 | 钱七
47 | 男
48 | 24
49 |
50 |
51 | 1
52 | 张三
53 | 男
54 | 20
55 |
56 |
57 | 2
58 | 李四
59 | 男
60 | 21
61 |
62 |
63 | 3
64 | 王五
65 | 男
66 | 22
67 |
68 |
69 | 4
70 | 赵六
71 | 男
72 | 23
73 |
74 |
75 | 5
76 | 钱七
77 | 男
78 | 24
79 |
80 |
81 | 1
82 | 张三
83 | 男
84 | 20
85 |
86 |
87 | 2
88 | 李四
89 | 男
90 | 21
91 |
92 |
93 | 3
94 | 王五
95 | 男
96 | 22
97 |
98 |
99 | 4
100 | 赵六
101 | 男
102 | 23
103 |
104 |
105 | 5
106 | 钱七
107 | 男
108 | 24
109 |
110 |
111 | 1
112 | 张三
113 | 男
114 | 20
115 |
116 |
117 | 2
118 | 李四
119 | 男
120 | 21
121 |
122 |
123 | 3
124 | 王五
125 | 男
126 | 22
127 |
128 |
129 | 4
130 | 赵六
131 | 男
132 | 23
133 |
134 |
135 | 5
136 | 钱七
137 | 男
138 | 24
139 |
140 |
141 | 4
142 | 赵六
143 | 男
144 | 23
145 |
146 |
147 | 5
148 | 钱七
149 | 男
150 | 24
151 |
152 |
153 | 1
154 | 张三
155 | 男
156 | 20
157 |
158 |
159 | 2
160 | 李四
161 | 男
162 | 21
163 |
164 |
165 | 3
166 | 王五
167 | 男
168 | 22
169 |
170 |
171 | 4
172 | 赵六
173 | 男
174 | 23
175 |
176 |
177 | 5
178 | 钱七
179 | 男
180 | 24
181 |
182 |
183 | 4
184 | 赵六
185 | 男
186 | 23
187 |
188 |
189 | 5
190 | 钱七
191 | 男
192 | 24
193 |
194 |
195 | 1
196 | 张三
197 | 男
198 | 20
199 |
200 |
201 | 2
202 | 李四
203 | 男
204 | 21
205 |
206 |
207 | 3
208 | 王五
209 | 男
210 | 22
211 |
212 |
213 | 4
214 | 赵六
215 | 男
216 | 23
217 |
218 |
219 | 5
220 | 钱七
221 | 男
222 | 24
223 |
224 |
225 | 4
226 | 赵六
227 | 男
228 | 23
229 |
230 |
231 | 5
232 | 钱七
233 | 男
234 | 24
235 |
236 |
237 | 1
238 | 张三
239 | 男
240 | 20
241 |
242 |
243 | 2
244 | 李四
245 | 男
246 | 21
247 |
248 |
249 | 3
250 | 王五
251 | 男
252 | 22
253 |
254 |
255 | 4
256 | 赵六
257 | 男
258 | 23
259 |
260 |
261 | 5
262 | 钱七
263 | 男
264 | 24
265 |
266 |
267 |
268 | 合计
269 | -
270 | -
271 | 24
272 |
273 |
274 |
275 |
276 |
279 |
280 |
--------------------------------------------------------------------------------
/thead.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
38 |
39 |
40 |
41 |
42 |
43 | 班级
44 | 姓名
45 | 性别
46 | 年龄
47 |
48 |
49 |
50 | 1
51 | 张三
52 | 男
53 | 20
54 |
55 |
56 | 2
57 | 李四
58 | 男
59 | 21
60 |
61 |
62 | 3
63 | 王五
64 | 男
65 | 22
66 |
67 |
68 | 4
69 | 赵六
70 | 男
71 | 23
72 |
73 |
74 | 5
75 | 钱七
76 | 男
77 | 24
78 |
79 |
80 | 1
81 | 张三
82 | 男
83 | 20
84 |
85 |
86 | 2
87 | 李四
88 | 男
89 | 21
90 |
91 |
92 | 3
93 | 王五
94 | 男
95 | 22
96 |
97 |
98 | 4
99 | 赵六
100 | 男
101 | 23
102 |
103 |
104 | 5
105 | 钱七
106 | 男
107 | 24
108 |
109 |
110 | 1
111 | 张三
112 | 男
113 | 20
114 |
115 |
116 | 2
117 | 李四
118 | 男
119 | 21
120 |
121 |
122 | 3
123 | 王五
124 | 男
125 | 22
126 |
127 |
128 | 4
129 | 赵六
130 | 男
131 | 23
132 |
133 |
134 | 5
135 | 钱七
136 | 男
137 | 24
138 |
139 |
140 | 1
141 | 张三
142 | 男
143 | 20
144 |
145 |
146 | 2
147 | 李四
148 | 男
149 | 21
150 |
151 |
152 | 3
153 | 王五
154 | 男
155 | 22
156 |
157 |
158 | 4
159 | 赵六
160 | 男
161 | 23
162 |
163 |
164 | 5
165 | 钱七
166 | 男
167 | 24
168 |
169 |
170 | 4
171 | 赵六
172 | 男
173 | 23
174 |
175 |
176 | 5
177 | 钱七
178 | 男
179 | 24
180 |
181 |
182 | 1
183 | 张三
184 | 男
185 | 20
186 |
187 |
188 | 2
189 | 李四
190 | 男
191 | 21
192 |
193 |
194 | 3
195 | 王五
196 | 男
197 | 22
198 |
199 |
200 | 4
201 | 赵六
202 | 男
203 | 23
204 |
205 |
206 | 5
207 | 钱七
208 | 男
209 | 24
210 |
211 |
212 | 4
213 | 赵六
214 | 男
215 | 23
216 |
217 |
218 | 5
219 | 钱七
220 | 男
221 | 24
222 |
223 |
224 | 1
225 | 张三
226 | 男
227 | 20
228 |
229 |
230 | 2
231 | 李四
232 | 男
233 | 21
234 |
235 |
236 | 3
237 | 王五
238 | 男
239 | 22
240 |
241 |
242 | 4
243 | 赵六
244 | 男
245 | 23
246 |
247 |
248 | 5
249 | 钱七
250 | 男
251 | 24
252 |
253 |
254 | 4
255 | 赵六
256 | 男
257 | 23
258 |
259 |
260 | 5
261 | 钱七
262 | 男
263 | 24
264 |
265 |
266 | 1
267 | 张三
268 | 男
269 | 20
270 |
271 |
272 | 2
273 | 李四
274 | 男
275 | 21
276 |
277 |
278 | 3
279 | 王五
280 | 男
281 | 22
282 |
283 |
284 | 4
285 | 赵六
286 | 男
287 | 23
288 |
289 |
290 | 5
291 | 钱七
292 | 男
293 | 24
294 |
295 |
296 |
297 | 合计
298 | -
299 | -
300 | 24
301 |
302 |
303 |
304 |
305 |
306 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | listing directory /
7 |
278 |
344 |
345 |
346 |
347 |
423 |
424 |
--------------------------------------------------------------------------------
/js/ResizeObserver.js:
--------------------------------------------------------------------------------
1 | (function (global, factory) {
2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3 | typeof define === 'function' && define.amd ? define(factory) :
4 | (global.ResizeObserver = factory());
5 | }(this, (function () { 'use strict';
6 |
7 | /**
8 | * A collection of shims that provide minimal functionality of the ES6 collections.
9 | *
10 | * These implementations are not meant to be used outside of the ResizeObserver
11 | * modules as they cover only a limited range of use cases.
12 | */
13 | /* eslint-disable require-jsdoc, valid-jsdoc */
14 | var MapShim = (function () {
15 | if (typeof Map !== 'undefined') {
16 | return Map;
17 | }
18 | /**
19 | * Returns index in provided array that matches the specified key.
20 | *
21 | * @param {Array} arr
22 | * @param {*} key
23 | * @returns {number}
24 | */
25 | function getIndex(arr, key) {
26 | var result = -1;
27 | arr.some(function (entry, index) {
28 | if (entry[0] === key) {
29 | result = index;
30 | return true;
31 | }
32 | return false;
33 | });
34 | return result;
35 | }
36 | return /** @class */ (function () {
37 | function class_1() {
38 | this.__entries__ = [];
39 | }
40 | Object.defineProperty(class_1.prototype, "size", {
41 | /**
42 | * @returns {boolean}
43 | */
44 | get: function () {
45 | return this.__entries__.length;
46 | },
47 | enumerable: true,
48 | configurable: true
49 | });
50 | /**
51 | * @param {*} key
52 | * @returns {*}
53 | */
54 | class_1.prototype.get = function (key) {
55 | var index = getIndex(this.__entries__, key);
56 | var entry = this.__entries__[index];
57 | return entry && entry[1];
58 | };
59 | /**
60 | * @param {*} key
61 | * @param {*} value
62 | * @returns {void}
63 | */
64 | class_1.prototype.set = function (key, value) {
65 | var index = getIndex(this.__entries__, key);
66 | if (~index) {
67 | this.__entries__[index][1] = value;
68 | }
69 | else {
70 | this.__entries__.push([key, value]);
71 | }
72 | };
73 | /**
74 | * @param {*} key
75 | * @returns {void}
76 | */
77 | class_1.prototype.delete = function (key) {
78 | var entries = this.__entries__;
79 | var index = getIndex(entries, key);
80 | if (~index) {
81 | entries.splice(index, 1);
82 | }
83 | };
84 | /**
85 | * @param {*} key
86 | * @returns {void}
87 | */
88 | class_1.prototype.has = function (key) {
89 | return !!~getIndex(this.__entries__, key);
90 | };
91 | /**
92 | * @returns {void}
93 | */
94 | class_1.prototype.clear = function () {
95 | this.__entries__.splice(0);
96 | };
97 | /**
98 | * @param {Function} callback
99 | * @param {*} [ctx=null]
100 | * @returns {void}
101 | */
102 | class_1.prototype.forEach = function (callback, ctx) {
103 | if (ctx === void 0) { ctx = null; }
104 | for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
105 | var entry = _a[_i];
106 | callback.call(ctx, entry[1], entry[0]);
107 | }
108 | };
109 | return class_1;
110 | }());
111 | })();
112 |
113 | /**
114 | * Detects whether window and document objects are available in current environment.
115 | */
116 | var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;
117 |
118 | // Returns global object of a current environment.
119 | var global$1 = (function () {
120 | if (typeof global !== 'undefined' && global.Math === Math) {
121 | return global;
122 | }
123 | if (typeof self !== 'undefined' && self.Math === Math) {
124 | return self;
125 | }
126 | if (typeof window !== 'undefined' && window.Math === Math) {
127 | return window;
128 | }
129 | // eslint-disable-next-line no-new-func
130 | return Function('return this')();
131 | })();
132 |
133 | /**
134 | * A shim for the requestAnimationFrame which falls back to the setTimeout if
135 | * first one is not supported.
136 | *
137 | * @returns {number} Requests' identifier.
138 | */
139 | var requestAnimationFrame$1 = (function () {
140 | if (typeof requestAnimationFrame === 'function') {
141 | // It's required to use a bounded function because IE sometimes throws
142 | // an "Invalid calling object" error if rAF is invoked without the global
143 | // object on the left hand side.
144 | return requestAnimationFrame.bind(global$1);
145 | }
146 | return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };
147 | })();
148 |
149 | // Defines minimum timeout before adding a trailing call.
150 | var trailingTimeout = 2;
151 | /**
152 | * Creates a wrapper function which ensures that provided callback will be
153 | * invoked only once during the specified delay period.
154 | *
155 | * @param {Function} callback - Function to be invoked after the delay period.
156 | * @param {number} delay - Delay after which to invoke callback.
157 | * @returns {Function}
158 | */
159 | function throttle (callback, delay) {
160 | var leadingCall = false, trailingCall = false, lastCallTime = 0;
161 | /**
162 | * Invokes the original callback function and schedules new invocation if
163 | * the "proxy" was called during current request.
164 | *
165 | * @returns {void}
166 | */
167 | function resolvePending() {
168 | if (leadingCall) {
169 | leadingCall = false;
170 | callback();
171 | }
172 | if (trailingCall) {
173 | proxy();
174 | }
175 | }
176 | /**
177 | * Callback invoked after the specified delay. It will further postpone
178 | * invocation of the original function delegating it to the
179 | * requestAnimationFrame.
180 | *
181 | * @returns {void}
182 | */
183 | function timeoutCallback() {
184 | requestAnimationFrame$1(resolvePending);
185 | }
186 | /**
187 | * Schedules invocation of the original function.
188 | *
189 | * @returns {void}
190 | */
191 | function proxy() {
192 | var timeStamp = Date.now();
193 | if (leadingCall) {
194 | // Reject immediately following calls.
195 | if (timeStamp - lastCallTime < trailingTimeout) {
196 | return;
197 | }
198 | // Schedule new call to be in invoked when the pending one is resolved.
199 | // This is important for "transitions" which never actually start
200 | // immediately so there is a chance that we might miss one if change
201 | // happens amids the pending invocation.
202 | trailingCall = true;
203 | }
204 | else {
205 | leadingCall = true;
206 | trailingCall = false;
207 | setTimeout(timeoutCallback, delay);
208 | }
209 | lastCallTime = timeStamp;
210 | }
211 | return proxy;
212 | }
213 |
214 | // Minimum delay before invoking the update of observers.
215 | var REFRESH_DELAY = 20;
216 | // A list of substrings of CSS properties used to find transition events that
217 | // might affect dimensions of observed elements.
218 | var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];
219 | // Check if MutationObserver is available.
220 | var mutationObserverSupported = typeof MutationObserver !== 'undefined';
221 | /**
222 | * Singleton controller class which handles updates of ResizeObserver instances.
223 | */
224 | var ResizeObserverController = /** @class */ (function () {
225 | /**
226 | * Creates a new instance of ResizeObserverController.
227 | *
228 | * @private
229 | */
230 | function ResizeObserverController() {
231 | /**
232 | * Indicates whether DOM listeners have been added.
233 | *
234 | * @private {boolean}
235 | */
236 | this.connected_ = false;
237 | /**
238 | * Tells that controller has subscribed for Mutation Events.
239 | *
240 | * @private {boolean}
241 | */
242 | this.mutationEventsAdded_ = false;
243 | /**
244 | * Keeps reference to the instance of MutationObserver.
245 | *
246 | * @private {MutationObserver}
247 | */
248 | this.mutationsObserver_ = null;
249 | /**
250 | * A list of connected observers.
251 | *
252 | * @private {Array}
253 | */
254 | this.observers_ = [];
255 | this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
256 | this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
257 | }
258 | /**
259 | * Adds observer to observers list.
260 | *
261 | * @param {ResizeObserverSPI} observer - Observer to be added.
262 | * @returns {void}
263 | */
264 | ResizeObserverController.prototype.addObserver = function (observer) {
265 | if (!~this.observers_.indexOf(observer)) {
266 | this.observers_.push(observer);
267 | }
268 | // Add listeners if they haven't been added yet.
269 | if (!this.connected_) {
270 | this.connect_();
271 | }
272 | };
273 | /**
274 | * Removes observer from observers list.
275 | *
276 | * @param {ResizeObserverSPI} observer - Observer to be removed.
277 | * @returns {void}
278 | */
279 | ResizeObserverController.prototype.removeObserver = function (observer) {
280 | var observers = this.observers_;
281 | var index = observers.indexOf(observer);
282 | // Remove observer if it's present in registry.
283 | if (~index) {
284 | observers.splice(index, 1);
285 | }
286 | // Remove listeners if controller has no connected observers.
287 | if (!observers.length && this.connected_) {
288 | this.disconnect_();
289 | }
290 | };
291 | /**
292 | * Invokes the update of observers. It will continue running updates insofar
293 | * it detects changes.
294 | *
295 | * @returns {void}
296 | */
297 | ResizeObserverController.prototype.refresh = function () {
298 | var changesDetected = this.updateObservers_();
299 | // Continue running updates if changes have been detected as there might
300 | // be future ones caused by CSS transitions.
301 | if (changesDetected) {
302 | this.refresh();
303 | }
304 | };
305 | /**
306 | * Updates every observer from observers list and notifies them of queued
307 | * entries.
308 | *
309 | * @private
310 | * @returns {boolean} Returns "true" if any observer has detected changes in
311 | * dimensions of it's elements.
312 | */
313 | ResizeObserverController.prototype.updateObservers_ = function () {
314 | // Collect observers that have active observations.
315 | var activeObservers = this.observers_.filter(function (observer) {
316 | return observer.gatherActive(), observer.hasActive();
317 | });
318 | // Deliver notifications in a separate cycle in order to avoid any
319 | // collisions between observers, e.g. when multiple instances of
320 | // ResizeObserver are tracking the same element and the callback of one
321 | // of them changes content dimensions of the observed target. Sometimes
322 | // this may result in notifications being blocked for the rest of observers.
323 | activeObservers.forEach(function (observer) { return observer.broadcastActive(); });
324 | return activeObservers.length > 0;
325 | };
326 | /**
327 | * Initializes DOM listeners.
328 | *
329 | * @private
330 | * @returns {void}
331 | */
332 | ResizeObserverController.prototype.connect_ = function () {
333 | // Do nothing if running in a non-browser environment or if listeners
334 | // have been already added.
335 | if (!isBrowser || this.connected_) {
336 | return;
337 | }
338 | // Subscription to the "Transitionend" event is used as a workaround for
339 | // delayed transitions. This way it's possible to capture at least the
340 | // final state of an element.
341 | document.addEventListener('transitionend', this.onTransitionEnd_);
342 | window.addEventListener('resize', this.refresh);
343 | if (mutationObserverSupported) {
344 | this.mutationsObserver_ = new MutationObserver(this.refresh);
345 | this.mutationsObserver_.observe(document, {
346 | attributes: true,
347 | childList: true,
348 | characterData: true,
349 | subtree: true
350 | });
351 | }
352 | else {
353 | document.addEventListener('DOMSubtreeModified', this.refresh);
354 | this.mutationEventsAdded_ = true;
355 | }
356 | this.connected_ = true;
357 | };
358 | /**
359 | * Removes DOM listeners.
360 | *
361 | * @private
362 | * @returns {void}
363 | */
364 | ResizeObserverController.prototype.disconnect_ = function () {
365 | // Do nothing if running in a non-browser environment or if listeners
366 | // have been already removed.
367 | if (!isBrowser || !this.connected_) {
368 | return;
369 | }
370 | document.removeEventListener('transitionend', this.onTransitionEnd_);
371 | window.removeEventListener('resize', this.refresh);
372 | if (this.mutationsObserver_) {
373 | this.mutationsObserver_.disconnect();
374 | }
375 | if (this.mutationEventsAdded_) {
376 | document.removeEventListener('DOMSubtreeModified', this.refresh);
377 | }
378 | this.mutationsObserver_ = null;
379 | this.mutationEventsAdded_ = false;
380 | this.connected_ = false;
381 | };
382 | /**
383 | * "Transitionend" event handler.
384 | *
385 | * @private
386 | * @param {TransitionEvent} event
387 | * @returns {void}
388 | */
389 | ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {
390 | var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;
391 | // Detect whether transition may affect dimensions of an element.
392 | var isReflowProperty = transitionKeys.some(function (key) {
393 | return !!~propertyName.indexOf(key);
394 | });
395 | if (isReflowProperty) {
396 | this.refresh();
397 | }
398 | };
399 | /**
400 | * Returns instance of the ResizeObserverController.
401 | *
402 | * @returns {ResizeObserverController}
403 | */
404 | ResizeObserverController.getInstance = function () {
405 | if (!this.instance_) {
406 | this.instance_ = new ResizeObserverController();
407 | }
408 | return this.instance_;
409 | };
410 | /**
411 | * Holds reference to the controller's instance.
412 | *
413 | * @private {ResizeObserverController}
414 | */
415 | ResizeObserverController.instance_ = null;
416 | return ResizeObserverController;
417 | }());
418 |
419 | /**
420 | * Defines non-writable/enumerable properties of the provided target object.
421 | *
422 | * @param {Object} target - Object for which to define properties.
423 | * @param {Object} props - Properties to be defined.
424 | * @returns {Object} Target object.
425 | */
426 | var defineConfigurable = (function (target, props) {
427 | for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
428 | var key = _a[_i];
429 | Object.defineProperty(target, key, {
430 | value: props[key],
431 | enumerable: false,
432 | writable: false,
433 | configurable: true
434 | });
435 | }
436 | return target;
437 | });
438 |
439 | /**
440 | * Returns the global object associated with provided element.
441 | *
442 | * @param {Object} target
443 | * @returns {Object}
444 | */
445 | var getWindowOf = (function (target) {
446 | // Assume that the element is an instance of Node, which means that it
447 | // has the "ownerDocument" property from which we can retrieve a
448 | // corresponding global object.
449 | var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
450 | // Return the local global object if it's not possible extract one from
451 | // provided element.
452 | return ownerGlobal || global$1;
453 | });
454 |
455 | // Placeholder of an empty content rectangle.
456 | var emptyRect = createRectInit(0, 0, 0, 0);
457 | /**
458 | * Converts provided string to a number.
459 | *
460 | * @param {number|string} value
461 | * @returns {number}
462 | */
463 | function toFloat(value) {
464 | return parseFloat(value) || 0;
465 | }
466 | /**
467 | * Extracts borders size from provided styles.
468 | *
469 | * @param {CSSStyleDeclaration} styles
470 | * @param {...string} positions - Borders positions (top, right, ...)
471 | * @returns {number}
472 | */
473 | function getBordersSize(styles) {
474 | var positions = [];
475 | for (var _i = 1; _i < arguments.length; _i++) {
476 | positions[_i - 1] = arguments[_i];
477 | }
478 | return positions.reduce(function (size, position) {
479 | var value = styles['border-' + position + '-width'];
480 | return size + toFloat(value);
481 | }, 0);
482 | }
483 | /**
484 | * Extracts paddings sizes from provided styles.
485 | *
486 | * @param {CSSStyleDeclaration} styles
487 | * @returns {Object} Paddings box.
488 | */
489 | function getPaddings(styles) {
490 | var positions = ['top', 'right', 'bottom', 'left'];
491 | var paddings = {};
492 | for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
493 | var position = positions_1[_i];
494 | var value = styles['padding-' + position];
495 | paddings[position] = toFloat(value);
496 | }
497 | return paddings;
498 | }
499 | /**
500 | * Calculates content rectangle of provided SVG element.
501 | *
502 | * @param {SVGGraphicsElement} target - Element content rectangle of which needs
503 | * to be calculated.
504 | * @returns {DOMRectInit}
505 | */
506 | function getSVGContentRect(target) {
507 | var bbox = target.getBBox();
508 | return createRectInit(0, 0, bbox.width, bbox.height);
509 | }
510 | /**
511 | * Calculates content rectangle of provided HTMLElement.
512 | *
513 | * @param {HTMLElement} target - Element for which to calculate the content rectangle.
514 | * @returns {DOMRectInit}
515 | */
516 | function getHTMLElementContentRect(target) {
517 | // Client width & height properties can't be
518 | // used exclusively as they provide rounded values.
519 | var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
520 | // By this condition we can catch all non-replaced inline, hidden and
521 | // detached elements. Though elements with width & height properties less
522 | // than 0.5 will be discarded as well.
523 | //
524 | // Without it we would need to implement separate methods for each of
525 | // those cases and it's not possible to perform a precise and performance
526 | // effective test for hidden elements. E.g. even jQuery's ':visible' filter
527 | // gives wrong results for elements with width & height less than 0.5.
528 | if (!clientWidth && !clientHeight) {
529 | return emptyRect;
530 | }
531 | var styles = getWindowOf(target).getComputedStyle(target);
532 | var paddings = getPaddings(styles);
533 | var horizPad = paddings.left + paddings.right;
534 | var vertPad = paddings.top + paddings.bottom;
535 | // Computed styles of width & height are being used because they are the
536 | // only dimensions available to JS that contain non-rounded values. It could
537 | // be possible to utilize the getBoundingClientRect if only it's data wasn't
538 | // affected by CSS transformations let alone paddings, borders and scroll bars.
539 | var width = toFloat(styles.width), height = toFloat(styles.height);
540 | // Width & height include paddings and borders when the 'border-box' box
541 | // model is applied (except for IE).
542 | if (styles.boxSizing === 'border-box') {
543 | // Following conditions are required to handle Internet Explorer which
544 | // doesn't include paddings and borders to computed CSS dimensions.
545 | //
546 | // We can say that if CSS dimensions + paddings are equal to the "client"
547 | // properties then it's either IE, and thus we don't need to subtract
548 | // anything, or an element merely doesn't have paddings/borders styles.
549 | if (Math.round(width + horizPad) !== clientWidth) {
550 | width -= getBordersSize(styles, 'left', 'right') + horizPad;
551 | }
552 | if (Math.round(height + vertPad) !== clientHeight) {
553 | height -= getBordersSize(styles, 'top', 'bottom') + vertPad;
554 | }
555 | }
556 | // Following steps can't be applied to the document's root element as its
557 | // client[Width/Height] properties represent viewport area of the window.
558 | // Besides, it's as well not necessary as the itself neither has
559 | // rendered scroll bars nor it can be clipped.
560 | if (!isDocumentElement(target)) {
561 | // In some browsers (only in Firefox, actually) CSS width & height
562 | // include scroll bars size which can be removed at this step as scroll
563 | // bars are the only difference between rounded dimensions + paddings
564 | // and "client" properties, though that is not always true in Chrome.
565 | var vertScrollbar = Math.round(width + horizPad) - clientWidth;
566 | var horizScrollbar = Math.round(height + vertPad) - clientHeight;
567 | // Chrome has a rather weird rounding of "client" properties.
568 | // E.g. for an element with content width of 314.2px it sometimes gives
569 | // the client width of 315px and for the width of 314.7px it may give
570 | // 314px. And it doesn't happen all the time. So just ignore this delta
571 | // as a non-relevant.
572 | if (Math.abs(vertScrollbar) !== 1) {
573 | width -= vertScrollbar;
574 | }
575 | if (Math.abs(horizScrollbar) !== 1) {
576 | height -= horizScrollbar;
577 | }
578 | }
579 | return createRectInit(paddings.left, paddings.top, width, height);
580 | }
581 | /**
582 | * Checks whether provided element is an instance of the SVGGraphicsElement.
583 | *
584 | * @param {Element} target - Element to be checked.
585 | * @returns {boolean}
586 | */
587 | var isSVGGraphicsElement = (function () {
588 | // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement
589 | // interface.
590 | if (typeof SVGGraphicsElement !== 'undefined') {
591 | return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };
592 | }
593 | // If it's so, then check that element is at least an instance of the
594 | // SVGElement and that it has the "getBBox" method.
595 | // eslint-disable-next-line no-extra-parens
596 | return function (target) { return (target instanceof getWindowOf(target).SVGElement &&
597 | typeof target.getBBox === 'function'); };
598 | })();
599 | /**
600 | * Checks whether provided element is a document element ().
601 | *
602 | * @param {Element} target - Element to be checked.
603 | * @returns {boolean}
604 | */
605 | function isDocumentElement(target) {
606 | return target === getWindowOf(target).document.documentElement;
607 | }
608 | /**
609 | * Calculates an appropriate content rectangle for provided html or svg element.
610 | *
611 | * @param {Element} target - Element content rectangle of which needs to be calculated.
612 | * @returns {DOMRectInit}
613 | */
614 | function getContentRect(target) {
615 | if (!isBrowser) {
616 | return emptyRect;
617 | }
618 | if (isSVGGraphicsElement(target)) {
619 | return getSVGContentRect(target);
620 | }
621 | return getHTMLElementContentRect(target);
622 | }
623 | /**
624 | * Creates rectangle with an interface of the DOMRectReadOnly.
625 | * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly
626 | *
627 | * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.
628 | * @returns {DOMRectReadOnly}
629 | */
630 | function createReadOnlyRect(_a) {
631 | var x = _a.x, y = _a.y, width = _a.width, height = _a.height;
632 | // If DOMRectReadOnly is available use it as a prototype for the rectangle.
633 | var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;
634 | var rect = Object.create(Constr.prototype);
635 | // Rectangle's properties are not writable and non-enumerable.
636 | defineConfigurable(rect, {
637 | x: x, y: y, width: width, height: height,
638 | top: y,
639 | right: x + width,
640 | bottom: height + y,
641 | left: x
642 | });
643 | return rect;
644 | }
645 | /**
646 | * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.
647 | * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit
648 | *
649 | * @param {number} x - X coordinate.
650 | * @param {number} y - Y coordinate.
651 | * @param {number} width - Rectangle's width.
652 | * @param {number} height - Rectangle's height.
653 | * @returns {DOMRectInit}
654 | */
655 | function createRectInit(x, y, width, height) {
656 | return { x: x, y: y, width: width, height: height };
657 | }
658 |
659 | /**
660 | * Class that is responsible for computations of the content rectangle of
661 | * provided DOM element and for keeping track of it's changes.
662 | */
663 | var ResizeObservation = /** @class */ (function () {
664 | /**
665 | * Creates an instance of ResizeObservation.
666 | *
667 | * @param {Element} target - Element to be observed.
668 | */
669 | function ResizeObservation(target) {
670 | /**
671 | * Broadcasted width of content rectangle.
672 | *
673 | * @type {number}
674 | */
675 | this.broadcastWidth = 0;
676 | /**
677 | * Broadcasted height of content rectangle.
678 | *
679 | * @type {number}
680 | */
681 | this.broadcastHeight = 0;
682 | /**
683 | * Reference to the last observed content rectangle.
684 | *
685 | * @private {DOMRectInit}
686 | */
687 | this.contentRect_ = createRectInit(0, 0, 0, 0);
688 | this.target = target;
689 | }
690 | /**
691 | * Updates content rectangle and tells whether it's width or height properties
692 | * have changed since the last broadcast.
693 | *
694 | * @returns {boolean}
695 | */
696 | ResizeObservation.prototype.isActive = function () {
697 | var rect = getContentRect(this.target);
698 | this.contentRect_ = rect;
699 | return (rect.width !== this.broadcastWidth ||
700 | rect.height !== this.broadcastHeight);
701 | };
702 | /**
703 | * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data
704 | * from the corresponding properties of the last observed content rectangle.
705 | *
706 | * @returns {DOMRectInit} Last observed content rectangle.
707 | */
708 | ResizeObservation.prototype.broadcastRect = function () {
709 | var rect = this.contentRect_;
710 | this.broadcastWidth = rect.width;
711 | this.broadcastHeight = rect.height;
712 | return rect;
713 | };
714 | return ResizeObservation;
715 | }());
716 |
717 | var ResizeObserverEntry = /** @class */ (function () {
718 | /**
719 | * Creates an instance of ResizeObserverEntry.
720 | *
721 | * @param {Element} target - Element that is being observed.
722 | * @param {DOMRectInit} rectInit - Data of the element's content rectangle.
723 | */
724 | function ResizeObserverEntry(target, rectInit) {
725 | var contentRect = createReadOnlyRect(rectInit);
726 | // According to the specification following properties are not writable
727 | // and are also not enumerable in the native implementation.
728 | //
729 | // Property accessors are not being used as they'd require to define a
730 | // private WeakMap storage which may cause memory leaks in browsers that
731 | // don't support this type of collections.
732 | defineConfigurable(this, { target: target, contentRect: contentRect });
733 | }
734 | return ResizeObserverEntry;
735 | }());
736 |
737 | var ResizeObserverSPI = /** @class */ (function () {
738 | /**
739 | * Creates a new instance of ResizeObserver.
740 | *
741 | * @param {ResizeObserverCallback} callback - Callback function that is invoked
742 | * when one of the observed elements changes it's content dimensions.
743 | * @param {ResizeObserverController} controller - Controller instance which
744 | * is responsible for the updates of observer.
745 | * @param {ResizeObserver} callbackCtx - Reference to the public
746 | * ResizeObserver instance which will be passed to callback function.
747 | */
748 | function ResizeObserverSPI(callback, controller, callbackCtx) {
749 | /**
750 | * Collection of resize observations that have detected changes in dimensions
751 | * of elements.
752 | *
753 | * @private {Array}
754 | */
755 | this.activeObservations_ = [];
756 | /**
757 | * Registry of the ResizeObservation instances.
758 | *
759 | * @private {Map}
760 | */
761 | this.observations_ = new MapShim();
762 | if (typeof callback !== 'function') {
763 | throw new TypeError('The callback provided as parameter 1 is not a function.');
764 | }
765 | this.callback_ = callback;
766 | this.controller_ = controller;
767 | this.callbackCtx_ = callbackCtx;
768 | }
769 | /**
770 | * Starts observing provided element.
771 | *
772 | * @param {Element} target - Element to be observed.
773 | * @returns {void}
774 | */
775 | ResizeObserverSPI.prototype.observe = function (target) {
776 | if (!arguments.length) {
777 | throw new TypeError('1 argument required, but only 0 present.');
778 | }
779 | // Do nothing if current environment doesn't have the Element interface.
780 | if (typeof Element === 'undefined' || !(Element instanceof Object)) {
781 | return;
782 | }
783 | if (!(target instanceof getWindowOf(target).Element)) {
784 | throw new TypeError('parameter 1 is not of type "Element".');
785 | }
786 | var observations = this.observations_;
787 | // Do nothing if element is already being observed.
788 | if (observations.has(target)) {
789 | return;
790 | }
791 | observations.set(target, new ResizeObservation(target));
792 | this.controller_.addObserver(this);
793 | // Force the update of observations.
794 | this.controller_.refresh();
795 | };
796 | /**
797 | * Stops observing provided element.
798 | *
799 | * @param {Element} target - Element to stop observing.
800 | * @returns {void}
801 | */
802 | ResizeObserverSPI.prototype.unobserve = function (target) {
803 | if (!arguments.length) {
804 | throw new TypeError('1 argument required, but only 0 present.');
805 | }
806 | // Do nothing if current environment doesn't have the Element interface.
807 | if (typeof Element === 'undefined' || !(Element instanceof Object)) {
808 | return;
809 | }
810 | if (!(target instanceof getWindowOf(target).Element)) {
811 | throw new TypeError('parameter 1 is not of type "Element".');
812 | }
813 | var observations = this.observations_;
814 | // Do nothing if element is not being observed.
815 | if (!observations.has(target)) {
816 | return;
817 | }
818 | observations.delete(target);
819 | if (!observations.size) {
820 | this.controller_.removeObserver(this);
821 | }
822 | };
823 | /**
824 | * Stops observing all elements.
825 | *
826 | * @returns {void}
827 | */
828 | ResizeObserverSPI.prototype.disconnect = function () {
829 | this.clearActive();
830 | this.observations_.clear();
831 | this.controller_.removeObserver(this);
832 | };
833 | /**
834 | * Collects observation instances the associated element of which has changed
835 | * it's content rectangle.
836 | *
837 | * @returns {void}
838 | */
839 | ResizeObserverSPI.prototype.gatherActive = function () {
840 | var _this = this;
841 | this.clearActive();
842 | this.observations_.forEach(function (observation) {
843 | if (observation.isActive()) {
844 | _this.activeObservations_.push(observation);
845 | }
846 | });
847 | };
848 | /**
849 | * Invokes initial callback function with a list of ResizeObserverEntry
850 | * instances collected from active resize observations.
851 | *
852 | * @returns {void}
853 | */
854 | ResizeObserverSPI.prototype.broadcastActive = function () {
855 | // Do nothing if observer doesn't have active observations.
856 | if (!this.hasActive()) {
857 | return;
858 | }
859 | var ctx = this.callbackCtx_;
860 | // Create ResizeObserverEntry instance for every active observation.
861 | var entries = this.activeObservations_.map(function (observation) {
862 | return new ResizeObserverEntry(observation.target, observation.broadcastRect());
863 | });
864 | this.callback_.call(ctx, entries, ctx);
865 | this.clearActive();
866 | };
867 | /**
868 | * Clears the collection of active observations.
869 | *
870 | * @returns {void}
871 | */
872 | ResizeObserverSPI.prototype.clearActive = function () {
873 | this.activeObservations_.splice(0);
874 | };
875 | /**
876 | * Tells whether observer has active observations.
877 | *
878 | * @returns {boolean}
879 | */
880 | ResizeObserverSPI.prototype.hasActive = function () {
881 | return this.activeObservations_.length > 0;
882 | };
883 | return ResizeObserverSPI;
884 | }());
885 |
886 | // Registry of internal observers. If WeakMap is not available use current shim
887 | // for the Map collection as it has all required methods and because WeakMap
888 | // can't be fully polyfilled anyway.
889 | var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();
890 | /**
891 | * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation
892 | * exposing only those methods and properties that are defined in the spec.
893 | */
894 | var ResizeObserver = /** @class */ (function () {
895 | /**
896 | * Creates a new instance of ResizeObserver.
897 | *
898 | * @param {ResizeObserverCallback} callback - Callback that is invoked when
899 | * dimensions of the observed elements change.
900 | */
901 | function ResizeObserver(callback) {
902 | if (!(this instanceof ResizeObserver)) {
903 | throw new TypeError('Cannot call a class as a function.');
904 | }
905 | if (!arguments.length) {
906 | throw new TypeError('1 argument required, but only 0 present.');
907 | }
908 | var controller = ResizeObserverController.getInstance();
909 | var observer = new ResizeObserverSPI(callback, controller, this);
910 | observers.set(this, observer);
911 | }
912 | return ResizeObserver;
913 | }());
914 | // Expose public methods of ResizeObserver.
915 | [
916 | 'observe',
917 | 'unobserve',
918 | 'disconnect'
919 | ].forEach(function (method) {
920 | ResizeObserver.prototype[method] = function () {
921 | var _a;
922 | return (_a = observers.get(this))[method].apply(_a, arguments);
923 | };
924 | });
925 |
926 | var index = (function () {
927 | // Export existing implementation if available.
928 | if (typeof global$1.ResizeObserver !== 'undefined') {
929 | return global$1.ResizeObserver;
930 | }
931 | return ResizeObserver;
932 | })();
933 |
934 | return index;
935 |
936 | })));
937 |
--------------------------------------------------------------------------------