지창언

css/html prototype added

Showing 497 changed files with 3060 additions and 2 deletions
...@@ -10,6 +10,7 @@ var loginRouter = require('./routes/login') ...@@ -10,6 +10,7 @@ var loginRouter = require('./routes/login')
10 var sign_upRouter = require('./routes/sign_up') 10 var sign_upRouter = require('./routes/sign_up')
11 var lpgRouter = require('./routes/lpg') 11 var lpgRouter = require('./routes/lpg')
12 var weatherRouter = require('./routes/weather') 12 var weatherRouter = require('./routes/weather')
13 +var menuRouter = require('./routes/menu')
13 var app = express(); 14 var app = express();
14 15
15 // get port 16 // get port
...@@ -19,14 +20,21 @@ app.set('port',port); ...@@ -19,14 +20,21 @@ app.set('port',port);
19 //for using bodyParser 20 //for using bodyParser
20 app.use(bodyParser.urlencoded({ extended: false })); 21 app.use(bodyParser.urlencoded({ extended: false }));
21 22
23 +
24 +
22 //ejs engine for html 25 //ejs engine for html
23 app.set('views',__dirname+'/views') 26 app.set('views',__dirname+'/views')
24 app.set('view engine', 'ejs'); 27 app.set('view engine', 'ejs');
25 app.engine('html', require('ejs').renderFile); 28 app.engine('html', require('ejs').renderFile);
26 app.use(express.static(path.join(__dirname, 'public'))); 29 app.use(express.static(path.join(__dirname, 'public')));
27 // 30 //
31 +//
32 +app.use('/js', express.static(__dirname + '/node_modules/bootstrap/dist/js')); // redirect bootstrap JS
33 +app.use('/css', express.static(__dirname + '/node_modules/bootstrap/dist/css')); // redirect CSS bootstrap
34 +
28 35
29 // 36 //
37 +app.use('/menu',menuRouter)
30 app.use('/login',loginRouter); // login page route 38 app.use('/login',loginRouter); // login page route
31 app.use('/weather',weatherRouter) 39 app.use('/weather',weatherRouter)
32 app.use('/lpg',lpgRouter) 40 app.use('/lpg',lpgRouter)
......
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
1 +/*!
2 +* Start Bootstrap - Modern Business v5.0.6 (https://startbootstrap.com/template-overviews/modern-business)
3 +* Copyright 2013-2022 Start Bootstrap
4 +* Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-modern-business/blob/master/LICENSE)
5 +*/
6 +// This file is intentionally blank
7 +// Use this file to add JavaScript to your project
...\ No newline at end of file ...\ No newline at end of file
...@@ -3,7 +3,7 @@ var router = express.Router(); ...@@ -3,7 +3,7 @@ var router = express.Router();
3 3
4 4
5 router.get('/',function(req,res){ 5 router.get('/',function(req,res){
6 - res.render('mainpage.html') 6 + res.render('index.html')
7 }) 7 })
8 8
9 9
......
1 +var express = require('express')
2 +var router = express.Router()
3 +
4 +router.get('/',function(req,res){
5 + res.render('menu.html')
6 +})
7 +
8 +module.exports = router
...\ No newline at end of file ...\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +<!DOCTYPE html>
2 +<html lang="en">
3 + <head>
4 + <meta charset="utf-8" />
5 + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
6 + <meta name="description" content="" />
7 + <meta name="author" content="" />
8 + <title>Modern Business - Start Bootstrap Template</title>
9 + <!-- Favicon-->
10 + <link rel="icon" type="image/x-icon" href="assets/favicon.ico" />
11 + <!-- Bootstrap icons-->
12 + <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet" />
13 + <!-- Core theme CSS (includes Bootstrap)-->
14 + <link href="css/styles.css" rel="stylesheet" />
15 + </head>
16 + <body class="d-flex flex-column">
17 + <main class="flex-shrink-0">
18 + <!-- Navigation-->
19 + <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
20 + <div class="container px-5">
21 + <a class="navbar-brand" href="/">휴게소 정보</a>
22 + <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
23 + <div class="collapse navbar-collapse" id="navbarSupportedContent">
24 + <ul class="navbar-nav ms-auto mb-2 mb-lg-0">
25 + <li class="nav-item"><a class="nav-link" href="/">Home</a></li>
26 + <li class="nav-item"><a class="nav-link" href="/menu">휴게소 메뉴</a></li>
27 + <li class="nav-item"><a class="nav-link" href="/weather">날씨</a></li>
28 + <li class="nav-item"><a class="nav-link" href="/lpg">LPG</a></li>
29 + <li class="nav-item"><a class="nav-link" href="faq.html">FAQ</a></li>
30 + <li class="nav-item dropdown">
31 + <a class="nav-link dropdown-toggle" id="navbarDropdownBlog" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">Blog</a>
32 + <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdownBlog">
33 + <li><a class="dropdown-item" href="blog-home.html">Blog Home</a></li>
34 + <li><a class="dropdown-item" href="blog-post.html">Blog Post</a></li>
35 + </ul>
36 + </li>
37 + <li class="nav-item dropdown">
38 + <a class="nav-link dropdown-toggle" id="navbarDropdownPortfolio" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">Portfolio</a>
39 + <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdownPortfolio">
40 + <li><a class="dropdown-item" href="portfolio-overview.html">Portfolio Overview</a></li>
41 + <li><a class="dropdown-item" href="portfolio-item.html">Portfolio Item</a></li>
42 + </ul>
43 + </li>
44 + </ul>
45 + </div>
46 + </div>
47 + </nav>
48 + <!-- Header-->
49 + <header class="py-5">
50 + <div class="container px-5">
51 + <div class="row justify-content-center">
52 + <div class="col-lg-8 col-xxl-6">
53 + <div class="text-center my-5">
54 + <h1 class="fw-bolder mb-3">Our mission is to make building websites easier for everyone.</h1>
55 + <p class="lead fw-normal text-muted mb-4">Start Bootstrap was built on the idea that quality, functional website templates and themes should be available to everyone. Use our open source, free products, or support us by purchasing one of our premium products or services.</p>
56 + <a class="btn btn-primary btn-lg" href="#scroll-target">Read our story</a>
57 + </div>
58 + </div>
59 + </div>
60 + </div>
61 + </header>
62 + <!-- About section one-->
63 + <section class="py-5 bg-light" id="scroll-target">
64 + <div class="container px-5 my-5">
65 + <div class="row gx-5 align-items-center">
66 + <div class="col-lg-6"><img class="img-fluid rounded mb-5 mb-lg-0" src="https://dummyimage.com/600x400/343a40/6c757d" alt="..." /></div>
67 + <div class="col-lg-6">
68 + <h2 class="fw-bolder">Our founding</h2>
69 + <p class="lead fw-normal text-muted mb-0">Lorem ipsum dolor sit amet consectetur adipisicing elit. Iusto est, ut esse a labore aliquam beatae expedita. Blanditiis impedit numquam libero molestiae et fugit cupiditate, quibusdam expedita, maiores eaque quisquam.</p>
70 + </div>
71 + </div>
72 + </div>
73 + </section>
74 + <!-- About section two-->
75 + <section class="py-5">
76 + <div class="container px-5 my-5">
77 + <div class="row gx-5 align-items-center">
78 + <div class="col-lg-6 order-first order-lg-last"><img class="img-fluid rounded mb-5 mb-lg-0" src="https://dummyimage.com/600x400/343a40/6c757d" alt="..." /></div>
79 + <div class="col-lg-6">
80 + <h2 class="fw-bolder">Growth &amp; beyond</h2>
81 + <p class="lead fw-normal text-muted mb-0">Lorem ipsum dolor sit amet consectetur adipisicing elit. Iusto est, ut esse a labore aliquam beatae expedita. Blanditiis impedit numquam libero molestiae et fugit cupiditate, quibusdam expedita, maiores eaque quisquam.</p>
82 + </div>
83 + </div>
84 + </div>
85 + </section>
86 + <!-- Team members section-->
87 + <section class="py-5 bg-light">
88 + <div class="container px-5 my-5">
89 + <div class="text-center">
90 + <h2 class="fw-bolder">Our team</h2>
91 + <p class="lead fw-normal text-muted mb-5">Dedicated to quality and your success</p>
92 + </div>
93 + <div class="row gx-5 row-cols-1 row-cols-sm-2 row-cols-xl-4 justify-content-center">
94 + <div class="col mb-5 mb-5 mb-xl-0">
95 + <div class="text-center">
96 + <img class="img-fluid rounded-circle mb-4 px-4" src="https://dummyimage.com/150x150/ced4da/6c757d" alt="..." />
97 + <h5 class="fw-bolder">Ibbie Eckart</h5>
98 + <div class="fst-italic text-muted">Founder &amp; CEO</div>
99 + </div>
100 + </div>
101 + <div class="col mb-5 mb-5 mb-xl-0">
102 + <div class="text-center">
103 + <img class="img-fluid rounded-circle mb-4 px-4" src="https://dummyimage.com/150x150/ced4da/6c757d" alt="..." />
104 + <h5 class="fw-bolder">Arden Vasek</h5>
105 + <div class="fst-italic text-muted">CFO</div>
106 + </div>
107 + </div>
108 + <div class="col mb-5 mb-5 mb-sm-0">
109 + <div class="text-center">
110 + <img class="img-fluid rounded-circle mb-4 px-4" src="https://dummyimage.com/150x150/ced4da/6c757d" alt="..." />
111 + <h5 class="fw-bolder">Toribio Nerthus</h5>
112 + <div class="fst-italic text-muted">Operations Manager</div>
113 + </div>
114 + </div>
115 + <div class="col mb-5">
116 + <div class="text-center">
117 + <img class="img-fluid rounded-circle mb-4 px-4" src="https://dummyimage.com/150x150/ced4da/6c757d" alt="..." />
118 + <h5 class="fw-bolder">Malvina Cilla</h5>
119 + <div class="fst-italic text-muted">CTO</div>
120 + </div>
121 + </div>
122 + </div>
123 + </div>
124 + </section>
125 + </main>
126 + <!-- Footer-->
127 + <footer class="bg-dark py-4 mt-auto">
128 + <div class="container px-5">
129 + <div class="row align-items-center justify-content-between flex-column flex-sm-row">
130 + <div class="col-auto"><div class="small m-0 text-white">Copyright &copy; Your Website 2022</div></div>
131 + <div class="col-auto">
132 + <a class="link-light small" href="#!">Privacy</a>
133 + <span class="text-white mx-1">&middot;</span>
134 + <a class="link-light small" href="#!">Terms</a>
135 + <span class="text-white mx-1">&middot;</span>
136 + <a class="link-light small" href="#!">Contact</a>
137 + </div>
138 + </div>
139 + </div>
140 + </footer>
141 + <!-- Bootstrap core JS-->
142 + <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
143 + <!-- Core theme JS-->
144 + <script src="js/scripts.js"></script>
145 + </body>
146 +</html>
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
98 <div class="icon"> 98 <div class="icon">
99 <span style="color:white; font-size:20px;"><a href = "/weather"><b>날씨</b></a></span> 99 <span style="color:white; font-size:20px;"><a href = "/weather"><b>날씨</b></a></span>
100 <span style="color:white; font-size:20px;"><a href = "/menu"><b>메뉴</b></a></span> 100 <span style="color:white; font-size:20px;"><a href = "/menu"><b>메뉴</b></a></span>
101 - <span style="color:white; font-size:20px;"><a href = "lpg"><b>LPG</b></a></span> 101 + <span style="color:white; font-size:20px;"><a href = "/lpg"><b>LPG</b></a></span>
102 </div> 102 </div>
103 </div> 103 </div>
104 </div> 104 </div>
......
1 +<!DOCTYPE html>
2 +<html lang="en">
3 + <head>
4 + <meta charset="utf-8" />
5 + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
6 + <meta name="description" content="" />
7 + <meta name="author" content="" />
8 + <title>Modern Business - Start Bootstrap Template</title>
9 + <!-- Favicon-->
10 + <link rel="icon" type="image/x-icon" href="assets/favicon.ico" />
11 + <!-- Bootstrap icons-->
12 + <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet" />
13 + <!-- Core theme CSS (includes Bootstrap)-->
14 + <link href="css/styles.css" rel="stylesheet" />
15 + </head>
16 + <body class="d-flex flex-column">
17 + <main class="flex-shrink-0">
18 + <!-- Navigation-->
19 + <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
20 + <div class="container px-5">
21 + <a class="navbar-brand" href="/">휴게소 정보</a>
22 + <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
23 + <div class="collapse navbar-collapse" id="navbarSupportedContent">
24 + <ul class="navbar-nav ms-auto mb-2 mb-lg-0">
25 + <li class="nav-item"><a class="nav-link" href="/">Home</a></li>
26 + <li class="nav-item"><a class="nav-link" href="/menu">휴게소 메뉴</a></li>
27 + <li class="nav-item"><a class="nav-link" href="/weather">날씨</a></li>
28 + <li class="nav-item"><a class="nav-link" href="/lpg">LPG</a></li>
29 + <li class="nav-item"><a class="nav-link" href="faq.html">FAQ</a></li>
30 + <li class="nav-item dropdown">
31 + <a class="nav-link dropdown-toggle" id="navbarDropdownBlog" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">Blog</a>
32 + <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdownBlog">
33 + <li><a class="dropdown-item" href="blog-home.html">Blog Home</a></li>
34 + <li><a class="dropdown-item" href="blog-post.html">Blog Post</a></li>
35 + </ul>
36 + </li>
37 + <li class="nav-item dropdown">
38 + <a class="nav-link dropdown-toggle" id="navbarDropdownPortfolio" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">Portfolio</a>
39 + <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdownPortfolio">
40 + <li><a class="dropdown-item" href="portfolio-overview.html">Portfolio Overview</a></li>
41 + <li><a class="dropdown-item" href="portfolio-item.html">Portfolio Item</a></li>
42 + </ul>
43 + </li>
44 + </ul>
45 + </div>
46 + </div>
47 + </nav>
48 + <!-- Header-->
49 + <header class="py-5">
50 + <div class="container px-5">
51 + <div class="row justify-content-center">
52 + <div class="col-lg-8 col-xxl-6">
53 + <div class="text-center my-5">
54 + <h1 class="fw-bolder mb-3">휴게소 메뉴 정보 .</h1>
55 + <p class="lead fw-normal text-muted mb-4">Start Bootstrap was built on the idea that quality, functional website templates and themes should be available to everyone. Use our open source, free products, or support us by purchasing one of our premium products or services.</p>
56 + <a class="btn btn-primary btn-lg" href="#scroll-target">이 자리에 드랍다운 2개 넣고, 각 고속도로, 휴게소 선택하도록</a>
57 + </div>
58 + </div>
59 + </div>
60 + </div>
61 + </header>
62 + <!-- About section one-->
63 + <section class="py-5 bg-light" id="scroll-target">
64 + <div class="container px-5 my-5">
65 + <div class="row gx-5 align-items-center">
66 + <div class="col-lg-6"><img class="img-fluid rounded mb-5 mb-lg-0" src="https://dummyimage.com/600x400/343a40/6c757d" alt="..." /></div>
67 + <div class="col-lg-6">
68 + <h2 class="fw-bolder">Our founding</h2>
69 + <p class="lead fw-normal text-muted mb-0">Lorem ipsum dolor sit amet consectetur adipisicing elit. Iusto est, ut esse a labore aliquam beatae expedita. Blanditiis impedit numquam libero molestiae et fugit cupiditate, quibusdam expedita, maiores eaque quisquam.</p>
70 + </div>
71 + </div>
72 + </div>
73 + </section>
74 + <!-- About section two-->
75 + <section class="py-5">
76 + <div class="container px-5 my-5">
77 + <div class="row gx-5 align-items-center">
78 + <div class="col-lg-6 order-first order-lg-last"><img class="img-fluid rounded mb-5 mb-lg-0" src="https://dummyimage.com/600x400/343a40/6c757d" alt="..." /></div>
79 + <div class="col-lg-6">
80 + <h2 class="fw-bolder">Growth &amp; beyond</h2>
81 + <p class="lead fw-normal text-muted mb-0">Lorem ipsum dolor sit amet consectetur adipisicing elit. Iusto est, ut esse a labore aliquam beatae expedita. Blanditiis impedit numquam libero molestiae et fugit cupiditate, quibusdam expedita, maiores eaque quisquam.</p>
82 + </div>
83 + </div>
84 + </div>
85 + </section>
86 + <!-- Team members section-->
87 + <section class="py-5 bg-light">
88 + <div class="container px-5 my-5">
89 + <div class="text-center">
90 + <h2 class="fw-bolder">Our team</h2>
91 + <p class="lead fw-normal text-muted mb-5">Dedicated to quality and your success</p>
92 + </div>
93 + <div class="row gx-5 row-cols-1 row-cols-sm-2 row-cols-xl-4 justify-content-center">
94 + <div class="col mb-5 mb-5 mb-xl-0">
95 + <div class="text-center">
96 + <img class="img-fluid rounded-circle mb-4 px-4" src="https://dummyimage.com/150x150/ced4da/6c757d" alt="..." />
97 + <h5 class="fw-bolder">Ibbie Eckart</h5>
98 + <div class="fst-italic text-muted">Founder &amp; CEO</div>
99 + </div>
100 + </div>
101 + <div class="col mb-5 mb-5 mb-xl-0">
102 + <div class="text-center">
103 + <img class="img-fluid rounded-circle mb-4 px-4" src="https://dummyimage.com/150x150/ced4da/6c757d" alt="..." />
104 + <h5 class="fw-bolder">Arden Vasek</h5>
105 + <div class="fst-italic text-muted">CFO</div>
106 + </div>
107 + </div>
108 + <div class="col mb-5 mb-5 mb-sm-0">
109 + <div class="text-center">
110 + <img class="img-fluid rounded-circle mb-4 px-4" src="https://dummyimage.com/150x150/ced4da/6c757d" alt="..." />
111 + <h5 class="fw-bolder">Toribio Nerthus</h5>
112 + <div class="fst-italic text-muted">Operations Manager</div>
113 + </div>
114 + </div>
115 + <div class="col mb-5">
116 + <div class="text-center">
117 + <img class="img-fluid rounded-circle mb-4 px-4" src="https://dummyimage.com/150x150/ced4da/6c757d" alt="..." />
118 + <h5 class="fw-bolder">Malvina Cilla</h5>
119 + <div class="fst-italic text-muted">CTO</div>
120 + </div>
121 + </div>
122 + </div>
123 + </div>
124 + </section>
125 + </main>
126 + <!-- Footer-->
127 + <footer class="bg-dark py-4 mt-auto">
128 + <div class="container px-5">
129 + <div class="row align-items-center justify-content-between flex-column flex-sm-row">
130 + <div class="col-auto"><div class="small m-0 text-white">Copyright &copy; Your Website 2022</div></div>
131 + <div class="col-auto">
132 + <a class="link-light small" href="#!">Privacy</a>
133 + <span class="text-white mx-1">&middot;</span>
134 + <a class="link-light small" href="#!">Terms</a>
135 + <span class="text-white mx-1">&middot;</span>
136 + <a class="link-light small" href="#!">Contact</a>
137 + </div>
138 + </div>
139 + </div>
140 + </footer>
141 + <!-- Bootstrap core JS-->
142 + <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
143 + <!-- Core theme JS-->
144 + <script src="js/scripts.js"></script>
145 + </body>
146 +</html>
1 +<!DOCTYPE html>
2 +<html lang="en">
3 + <head>
4 + <meta charset="utf-8" />
5 + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
6 + <meta name="description" content="" />
7 + <meta name="author" content="" />
8 + <title>Modern Business - Start Bootstrap Template</title>
9 + <!-- Favicon-->
10 + <link rel="icon" type="image/x-icon" href="assets/favicon.ico" />
11 + <!-- Bootstrap icons-->
12 + <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet" />
13 + <!-- Core theme CSS (includes Bootstrap)-->
14 + <link href="css/styles.css" rel="stylesheet" />
15 + </head>
16 + <body class="d-flex flex-column">
17 + <main class="flex-shrink-0">
18 + <!-- Navigation-->
19 + <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
20 + <div class="container px-5">
21 + <a class="navbar-brand" href="/">휴게소 정보</a>
22 + <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
23 + <div class="collapse navbar-collapse" id="navbarSupportedContent">
24 + <ul class="navbar-nav ms-auto mb-2 mb-lg-0">
25 + <li class="nav-item"><a class="nav-link" href="/">Home</a></li>
26 + <li class="nav-item"><a class="nav-link" href="/menu">휴게소 메뉴</a></li>
27 + <li class="nav-item"><a class="nav-link" href="/weather">날씨</a></li>
28 + <li class="nav-item"><a class="nav-link" href="/lpg">LPG</a></li>
29 + <li class="nav-item"><a class="nav-link" href="faq.html">FAQ</a></li>
30 + <li class="nav-item dropdown">
31 + <a class="nav-link dropdown-toggle" id="navbarDropdownBlog" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">Blog</a>
32 + <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdownBlog">
33 + <li><a class="dropdown-item" href="blog-home.html">Blog Home</a></li>
34 + <li><a class="dropdown-item" href="blog-post.html">Blog Post</a></li>
35 + </ul>
36 + </li>
37 + <li class="nav-item dropdown">
38 + <a class="nav-link dropdown-toggle" id="navbarDropdownPortfolio" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">Portfolio</a>
39 + <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdownPortfolio">
40 + <li><a class="dropdown-item" href="portfolio-overview.html">Portfolio Overview</a></li>
41 + <li><a class="dropdown-item" href="portfolio-item.html">Portfolio Item</a></li>
42 + </ul>
43 + </li>
44 + </ul>
45 + </div>
46 + </div>
47 + </nav>
48 + <!-- Header-->
49 + <header class="py-5">
50 + <div class="container px-5">
51 + <div class="row justify-content-center">
52 + <div class="col-lg-8 col-xxl-6">
53 + <div class="text-center my-5">
54 + <h1 class="fw-bolder mb-3">휴게소 날씨.</h1>
55 + <p class="lead fw-normal text-muted mb-4">Start Bootstrap was built on the idea that quality, functional website templates and themes should be available to everyone. Use our open source, free products, or support us by purchasing one of our premium products or services.</p>
56 + <a class="btn btn-primary btn-lg" href="#scroll-target">여기도 메뉴페이지 비슷하게 드랍다운 2개</a>
57 + </div>
58 + </div>
59 + </div>
60 + </div>
61 + </header>
62 + <!-- About section one-->
63 + <section class="py-5 bg-light" id="scroll-target">
64 + <div class="container px-5 my-5">
65 + <div class="row gx-5 align-items-center">
66 + <div class="col-lg-6"><img class="img-fluid rounded mb-5 mb-lg-0" src="https://dummyimage.com/600x400/343a40/6c757d" alt="..." /></div>
67 + <div class="col-lg-6">
68 + <h2 class="fw-bolder">Our founding</h2>
69 + <p class="lead fw-normal text-muted mb-0">Lorem ipsum dolor sit amet consectetur adipisicing elit. Iusto est, ut esse a labore aliquam beatae expedita. Blanditiis impedit numquam libero molestiae et fugit cupiditate, quibusdam expedita, maiores eaque quisquam.</p>
70 + </div>
71 + </div>
72 + </div>
73 + </section>
74 + <!-- About section two-->
75 + <section class="py-5">
76 + <div class="container px-5 my-5">
77 + <div class="row gx-5 align-items-center">
78 + <div class="col-lg-6 order-first order-lg-last"><img class="img-fluid rounded mb-5 mb-lg-0" src="https://dummyimage.com/600x400/343a40/6c757d" alt="..." /></div>
79 + <div class="col-lg-6">
80 + <h2 class="fw-bolder">Growth &amp; beyond</h2>
81 + <p class="lead fw-normal text-muted mb-0">Lorem ipsum dolor sit amet consectetur adipisicing elit. Iusto est, ut esse a labore aliquam beatae expedita. Blanditiis impedit numquam libero molestiae et fugit cupiditate, quibusdam expedita, maiores eaque quisquam.</p>
82 + </div>
83 + </div>
84 + </div>
85 + </section>
86 + <!-- Team members section-->
87 + <section class="py-5 bg-light">
88 + <div class="container px-5 my-5">
89 + <div class="text-center">
90 + <h2 class="fw-bolder">Our team</h2>
91 + <p class="lead fw-normal text-muted mb-5">Dedicated to quality and your success</p>
92 + </div>
93 + <div class="row gx-5 row-cols-1 row-cols-sm-2 row-cols-xl-4 justify-content-center">
94 + <div class="col mb-5 mb-5 mb-xl-0">
95 + <div class="text-center">
96 + <img class="img-fluid rounded-circle mb-4 px-4" src="https://dummyimage.com/150x150/ced4da/6c757d" alt="..." />
97 + <h5 class="fw-bolder">Ibbie Eckart</h5>
98 + <div class="fst-italic text-muted">Founder &amp; CEO</div>
99 + </div>
100 + </div>
101 + <div class="col mb-5 mb-5 mb-xl-0">
102 + <div class="text-center">
103 + <img class="img-fluid rounded-circle mb-4 px-4" src="https://dummyimage.com/150x150/ced4da/6c757d" alt="..." />
104 + <h5 class="fw-bolder">Arden Vasek</h5>
105 + <div class="fst-italic text-muted">CFO</div>
106 + </div>
107 + </div>
108 + <div class="col mb-5 mb-5 mb-sm-0">
109 + <div class="text-center">
110 + <img class="img-fluid rounded-circle mb-4 px-4" src="https://dummyimage.com/150x150/ced4da/6c757d" alt="..." />
111 + <h5 class="fw-bolder">Toribio Nerthus</h5>
112 + <div class="fst-italic text-muted">Operations Manager</div>
113 + </div>
114 + </div>
115 + <div class="col mb-5">
116 + <div class="text-center">
117 + <img class="img-fluid rounded-circle mb-4 px-4" src="https://dummyimage.com/150x150/ced4da/6c757d" alt="..." />
118 + <h5 class="fw-bolder">Malvina Cilla</h5>
119 + <div class="fst-italic text-muted">CTO</div>
120 + </div>
121 + </div>
122 + </div>
123 + </div>
124 + </section>
125 + </main>
126 + <!-- Footer-->
127 + <footer class="bg-dark py-4 mt-auto">
128 + <div class="container px-5">
129 + <div class="row align-items-center justify-content-between flex-column flex-sm-row">
130 + <div class="col-auto"><div class="small m-0 text-white">Copyright &copy; Your Website 2022</div></div>
131 + <div class="col-auto">
132 + <a class="link-light small" href="#!">Privacy</a>
133 + <span class="text-white mx-1">&middot;</span>
134 + <a class="link-light small" href="#!">Terms</a>
135 + <span class="text-white mx-1">&middot;</span>
136 + <a class="link-light small" href="#!">Contact</a>
137 + </div>
138 + </div>
139 + </div>
140 + </footer>
141 + <!-- Bootstrap core JS-->
142 + <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
143 + <!-- Core theme JS-->
144 + <script src="js/scripts.js"></script>
145 + </body>
146 +</html>
1 +<!DOCTYPE html>
2 +<html lang="en">
3 + <head>
4 + <meta charset="utf-8" />
5 + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
6 + <meta name="description" content="" />
7 + <meta name="author" content="" />
8 + <title>Modern Business - Start Bootstrap Template</title>
9 + <!-- Favicon-->
10 + <link rel="icon" type="image/x-icon" href="assets/favicon.ico" />
11 + <!-- Bootstrap icons-->
12 + <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet" />
13 + <!-- Core theme CSS (includes Bootstrap)-->
14 + <link href="css/styles.css" rel="stylesheet" />
15 + </head>
16 + <body class="d-flex flex-column">
17 + <main class="flex-shrink-0">
18 + <!-- Navigation-->
19 + <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
20 + <div class="container px-5">
21 + <a class="navbar-brand" href="index.html">Start Bootstrap</a>
22 + <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
23 + <div class="collapse navbar-collapse" id="navbarSupportedContent">
24 + <ul class="navbar-nav ms-auto mb-2 mb-lg-0">
25 + <li class="nav-item"><a class="nav-link" href="index.html">Home</a></li>
26 + <li class="nav-item"><a class="nav-link" href="about.html">About</a></li>
27 + <li class="nav-item"><a class="nav-link" href="contact.html">Contact</a></li>
28 + <li class="nav-item"><a class="nav-link" href="pricing.html">Pricing</a></li>
29 + <li class="nav-item"><a class="nav-link" href="faq.html">FAQ</a></li>
30 + <li class="nav-item dropdown">
31 + <a class="nav-link dropdown-toggle" id="navbarDropdownBlog" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">Blog</a>
32 + <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdownBlog">
33 + <li><a class="dropdown-item" href="blog-home.html">Blog Home</a></li>
34 + <li><a class="dropdown-item" href="blog-post.html">Blog Post</a></li>
35 + </ul>
36 + </li>
37 + <li class="nav-item dropdown">
38 + <a class="nav-link dropdown-toggle" id="navbarDropdownPortfolio" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">Portfolio</a>
39 + <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdownPortfolio">
40 + <li><a class="dropdown-item" href="portfolio-overview.html">Portfolio Overview</a></li>
41 + <li><a class="dropdown-item" href="portfolio-item.html">Portfolio Item</a></li>
42 + </ul>
43 + </li>
44 + </ul>
45 + </div>
46 + </div>
47 + </nav>
48 + <!-- Header-->
49 + <header class="py-5">
50 + <div class="container px-5">
51 + <div class="row justify-content-center">
52 + <div class="col-lg-8 col-xxl-6">
53 + <div class="text-center my-5">
54 + <h1 class="fw-bolder mb-3">Our mission is to make building websites easier for everyone.</h1>
55 + <p class="lead fw-normal text-muted mb-4">Start Bootstrap was built on the idea that quality, functional website templates and themes should be available to everyone. Use our open source, free products, or support us by purchasing one of our premium products or services.</p>
56 + <a class="btn btn-primary btn-lg" href="#scroll-target">Read our story</a>
57 + </div>
58 + </div>
59 + </div>
60 + </div>
61 + </header>
62 + <!-- About section one-->
63 + <section class="py-5 bg-light" id="scroll-target">
64 + <div class="container px-5 my-5">
65 + <div class="row gx-5 align-items-center">
66 + <div class="col-lg-6"><img class="img-fluid rounded mb-5 mb-lg-0" src="https://dummyimage.com/600x400/343a40/6c757d" alt="..." /></div>
67 + <div class="col-lg-6">
68 + <h2 class="fw-bolder">Our founding</h2>
69 + <p class="lead fw-normal text-muted mb-0">Lorem ipsum dolor sit amet consectetur adipisicing elit. Iusto est, ut esse a labore aliquam beatae expedita. Blanditiis impedit numquam libero molestiae et fugit cupiditate, quibusdam expedita, maiores eaque quisquam.</p>
70 + </div>
71 + </div>
72 + </div>
73 + </section>
74 + <!-- About section two-->
75 + <section class="py-5">
76 + <div class="container px-5 my-5">
77 + <div class="row gx-5 align-items-center">
78 + <div class="col-lg-6 order-first order-lg-last"><img class="img-fluid rounded mb-5 mb-lg-0" src="https://dummyimage.com/600x400/343a40/6c757d" alt="..." /></div>
79 + <div class="col-lg-6">
80 + <h2 class="fw-bolder">Growth &amp; beyond</h2>
81 + <p class="lead fw-normal text-muted mb-0">Lorem ipsum dolor sit amet consectetur adipisicing elit. Iusto est, ut esse a labore aliquam beatae expedita. Blanditiis impedit numquam libero molestiae et fugit cupiditate, quibusdam expedita, maiores eaque quisquam.</p>
82 + </div>
83 + </div>
84 + </div>
85 + </section>
86 + <!-- Team members section-->
87 + <section class="py-5 bg-light">
88 + <div class="container px-5 my-5">
89 + <div class="text-center">
90 + <h2 class="fw-bolder">Our team</h2>
91 + <p class="lead fw-normal text-muted mb-5">Dedicated to quality and your success</p>
92 + </div>
93 + <div class="row gx-5 row-cols-1 row-cols-sm-2 row-cols-xl-4 justify-content-center">
94 + <div class="col mb-5 mb-5 mb-xl-0">
95 + <div class="text-center">
96 + <img class="img-fluid rounded-circle mb-4 px-4" src="https://dummyimage.com/150x150/ced4da/6c757d" alt="..." />
97 + <h5 class="fw-bolder">Ibbie Eckart</h5>
98 + <div class="fst-italic text-muted">Founder &amp; CEO</div>
99 + </div>
100 + </div>
101 + <div class="col mb-5 mb-5 mb-xl-0">
102 + <div class="text-center">
103 + <img class="img-fluid rounded-circle mb-4 px-4" src="https://dummyimage.com/150x150/ced4da/6c757d" alt="..." />
104 + <h5 class="fw-bolder">Arden Vasek</h5>
105 + <div class="fst-italic text-muted">CFO</div>
106 + </div>
107 + </div>
108 + <div class="col mb-5 mb-5 mb-sm-0">
109 + <div class="text-center">
110 + <img class="img-fluid rounded-circle mb-4 px-4" src="https://dummyimage.com/150x150/ced4da/6c757d" alt="..." />
111 + <h5 class="fw-bolder">Toribio Nerthus</h5>
112 + <div class="fst-italic text-muted">Operations Manager</div>
113 + </div>
114 + </div>
115 + <div class="col mb-5">
116 + <div class="text-center">
117 + <img class="img-fluid rounded-circle mb-4 px-4" src="https://dummyimage.com/150x150/ced4da/6c757d" alt="..." />
118 + <h5 class="fw-bolder">Malvina Cilla</h5>
119 + <div class="fst-italic text-muted">CTO</div>
120 + </div>
121 + </div>
122 + </div>
123 + </div>
124 + </section>
125 + </main>
126 + <!-- Footer-->
127 + <footer class="bg-dark py-4 mt-auto">
128 + <div class="container px-5">
129 + <div class="row align-items-center justify-content-between flex-column flex-sm-row">
130 + <div class="col-auto"><div class="small m-0 text-white">Copyright &copy; Your Website 2022</div></div>
131 + <div class="col-auto">
132 + <a class="link-light small" href="#!">Privacy</a>
133 + <span class="text-white mx-1">&middot;</span>
134 + <a class="link-light small" href="#!">Terms</a>
135 + <span class="text-white mx-1">&middot;</span>
136 + <a class="link-light small" href="#!">Contact</a>
137 + </div>
138 + </div>
139 + </div>
140 + </footer>
141 + <!-- Bootstrap core JS-->
142 + <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
143 + <!-- Core theme JS-->
144 + <script src="js/scripts.js"></script>
145 + </body>
146 +</html>
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +/*!
2 +* Start Bootstrap - Modern Business v5.0.6 (https://startbootstrap.com/template-overviews/modern-business)
3 +* Copyright 2013-2022 Start Bootstrap
4 +* Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-modern-business/blob/master/LICENSE)
5 +*/
6 +// This file is intentionally blank
7 +// Use this file to add JavaScript to your project
...\ No newline at end of file ...\ No newline at end of file
1 +<!DOCTYPE html>
2 +<html lang="en">
3 + <head>
4 + <meta charset="utf-8" />
5 + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
6 + <meta name="description" content="" />
7 + <meta name="author" content="" />
8 + <title>Modern Business - Start Bootstrap Template</title>
9 + <!-- Favicon-->
10 + <link rel="icon" type="image/x-icon" href="assets/favicon.ico" />
11 + <!-- Bootstrap icons-->
12 + <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet" />
13 + <!-- Core theme CSS (includes Bootstrap)-->
14 + <link href="css/styles.css" rel="stylesheet" />
15 + </head>
16 + <body class="d-flex flex-column h-100">
17 + <main class="flex-shrink-0">
18 + <!-- Navigation-->
19 + <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
20 + <div class="container px-5">
21 + <a class="navbar-brand" href="index.html">Start Bootstrap</a>
22 + <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
23 + <div class="collapse navbar-collapse" id="navbarSupportedContent">
24 + <ul class="navbar-nav ms-auto mb-2 mb-lg-0">
25 + <li class="nav-item"><a class="nav-link" href="index.html">Home</a></li>
26 + <li class="nav-item"><a class="nav-link" href="about.html">About</a></li>
27 + <li class="nav-item"><a class="nav-link" href="contact.html">Contact</a></li>
28 + <li class="nav-item"><a class="nav-link" href="pricing.html">Pricing</a></li>
29 + <li class="nav-item"><a class="nav-link" href="faq.html">FAQ</a></li>
30 + <li class="nav-item dropdown">
31 + <a class="nav-link dropdown-toggle" id="navbarDropdownBlog" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">Blog</a>
32 + <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdownBlog">
33 + <li><a class="dropdown-item" href="blog-home.html">Blog Home</a></li>
34 + <li><a class="dropdown-item" href="blog-post.html">Blog Post</a></li>
35 + </ul>
36 + </li>
37 + <li class="nav-item dropdown">
38 + <a class="nav-link dropdown-toggle" id="navbarDropdownPortfolio" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">Portfolio</a>
39 + <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdownPortfolio">
40 + <li><a class="dropdown-item" href="portfolio-overview.html">Portfolio Overview</a></li>
41 + <li><a class="dropdown-item" href="portfolio-item.html">Portfolio Item</a></li>
42 + </ul>
43 + </li>
44 + </ul>
45 + </div>
46 + </div>
47 + </nav>
48 + <!-- Page Content-->
49 + <section class="py-5">
50 + <div class="container px-5 my-5">
51 + <div class="row gx-5 justify-content-center">
52 + <div class="col-lg-6">
53 + <div class="text-center mb-5">
54 + <h1 class="fw-bolder">Project Title</h1>
55 + <p class="lead fw-normal text-muted mb-0">Lorem ipsum dolor sit amet consectetur adipisicing elit. Ab similique, ducimus ut alias sit accusamus illum, asperiores deserunt dolorum quaerat qui! Ab, quisquam explicabo magni dolores unde beatae quam a.</p>
56 + </div>
57 + </div>
58 + </div>
59 + <div class="row gx-5">
60 + <div class="col-12"><img class="img-fluid rounded-3 mb-5" src="https://dummyimage.com/1300x700/343a40/6c757d" alt="..." /></div>
61 + <div class="col-lg-6"><img class="img-fluid rounded-3 mb-5" src="https://dummyimage.com/600x400/343a40/6c757d" alt="..." /></div>
62 + <div class="col-lg-6"><img class="img-fluid rounded-3 mb-5" src="https://dummyimage.com/600x400/343a40/6c757d" alt="..." /></div>
63 + </div>
64 + <div class="row gx-5 justify-content-center">
65 + <div class="col-lg-6">
66 + <div class="text-center mb-5">
67 + <p class="lead fw-normal text-muted">Lorem, ipsum dolor sit amet consectetur adipisicing elit. Totam deserunt architecto enim eos accusantium fugit recusandae illo iste dignissimos possimus facere ducimus odit voluptatibus exercitationem, ex laudantium illum voluptatum corporis.</p>
68 + <a class="text-decoration-none" href="#!">
69 + View project
70 + <i class="bi-arrow-right"></i>
71 + </a>
72 + </div>
73 + </div>
74 + </div>
75 + </div>
76 + </section>
77 + </main>
78 + <!-- Footer-->
79 + <footer class="bg-dark py-4 mt-auto">
80 + <div class="container px-5">
81 + <div class="row align-items-center justify-content-between flex-column flex-sm-row">
82 + <div class="col-auto"><div class="small m-0 text-white">Copyright &copy; Your Website 2022</div></div>
83 + <div class="col-auto">
84 + <a class="link-light small" href="#!">Privacy</a>
85 + <span class="text-white mx-1">&middot;</span>
86 + <a class="link-light small" href="#!">Terms</a>
87 + <span class="text-white mx-1">&middot;</span>
88 + <a class="link-light small" href="#!">Contact</a>
89 + </div>
90 + </div>
91 + </div>
92 + </footer>
93 + <!-- Bootstrap core JS-->
94 + <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
95 + <!-- Core theme JS-->
96 + <script src="js/scripts.js"></script>
97 + </body>
98 +</html>
1 +<!DOCTYPE html>
2 +<html lang="en">
3 + <head>
4 + <meta charset="utf-8" />
5 + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
6 + <meta name="description" content="" />
7 + <meta name="author" content="" />
8 + <title>Modern Business - Start Bootstrap Template</title>
9 + <!-- Favicon-->
10 + <link rel="icon" type="image/x-icon" href="assets/favicon.ico" />
11 + <!-- Bootstrap icons-->
12 + <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet" />
13 + <!-- Core theme CSS (includes Bootstrap)-->
14 + <link href="css/styles.css" rel="stylesheet" />
15 + </head>
16 + <body class="d-flex flex-column h-100">
17 + <main class="flex-shrink-0">
18 + <!-- Navigation-->
19 + <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
20 + <div class="container px-5">
21 + <a class="navbar-brand" href="index.html">Start Bootstrap</a>
22 + <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
23 + <div class="collapse navbar-collapse" id="navbarSupportedContent">
24 + <ul class="navbar-nav ms-auto mb-2 mb-lg-0">
25 + <li class="nav-item"><a class="nav-link" href="index.html">Home</a></li>
26 + <li class="nav-item"><a class="nav-link" href="about.html">About</a></li>
27 + <li class="nav-item"><a class="nav-link" href="contact.html">Contact</a></li>
28 + <li class="nav-item"><a class="nav-link" href="pricing.html">Pricing</a></li>
29 + <li class="nav-item"><a class="nav-link" href="faq.html">FAQ</a></li>
30 + <li class="nav-item dropdown">
31 + <a class="nav-link dropdown-toggle" id="navbarDropdownBlog" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">Blog</a>
32 + <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdownBlog">
33 + <li><a class="dropdown-item" href="blog-home.html">Blog Home</a></li>
34 + <li><a class="dropdown-item" href="blog-post.html">Blog Post</a></li>
35 + </ul>
36 + </li>
37 + <li class="nav-item dropdown">
38 + <a class="nav-link dropdown-toggle" id="navbarDropdownPortfolio" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">Portfolio</a>
39 + <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdownPortfolio">
40 + <li><a class="dropdown-item" href="portfolio-overview.html">Portfolio Overview</a></li>
41 + <li><a class="dropdown-item" href="portfolio-item.html">Portfolio Item</a></li>
42 + </ul>
43 + </li>
44 + </ul>
45 + </div>
46 + </div>
47 + </nav>
48 + <!-- Page Content-->
49 + <section class="py-5">
50 + <div class="container px-5 my-5">
51 + <div class="text-center mb-5">
52 + <h1 class="fw-bolder">Our Work</h1>
53 + <p class="lead fw-normal text-muted mb-0">Company portfolio</p>
54 + </div>
55 + <div class="row gx-5">
56 + <div class="col-lg-6">
57 + <div class="position-relative mb-5">
58 + <img class="img-fluid rounded-3 mb-3" src="https://dummyimage.com/600x400/343a40/6c757d" alt="..." />
59 + <a class="h3 fw-bolder text-decoration-none link-dark stretched-link" href="#!">Project name</a>
60 + </div>
61 + </div>
62 + <div class="col-lg-6">
63 + <div class="position-relative mb-5">
64 + <img class="img-fluid rounded-3 mb-3" src="https://dummyimage.com/600x400/343a40/6c757d" alt="..." />
65 + <a class="h3 fw-bolder text-decoration-none link-dark stretched-link" href="#!">Project name</a>
66 + </div>
67 + </div>
68 + <div class="col-lg-6">
69 + <div class="position-relative mb-5 mb-lg-0">
70 + <img class="img-fluid rounded-3 mb-3" src="https://dummyimage.com/600x400/343a40/6c757d" alt="..." />
71 + <a class="h3 fw-bolder text-decoration-none link-dark stretched-link" href="#!">Project name</a>
72 + </div>
73 + </div>
74 + <div class="col-lg-6">
75 + <div class="position-relative">
76 + <img class="img-fluid rounded-3 mb-3" src="https://dummyimage.com/600x400/343a40/6c757d" alt="..." />
77 + <a class="h3 fw-bolder text-decoration-none link-dark stretched-link" href="#!">Project name</a>
78 + </div>
79 + </div>
80 + </div>
81 + </div>
82 + </section>
83 + <section class="py-5 bg-light">
84 + <div class="container px-5 my-5">
85 + <h2 class="display-4 fw-bolder mb-4">Let's build something together</h2>
86 + <a class="btn btn-lg btn-primary" href="#!">Contact us</a>
87 + </div>
88 + </section>
89 + </main>
90 + <!-- Footer-->
91 + <footer class="bg-dark py-4 mt-auto">
92 + <div class="container px-5">
93 + <div class="row align-items-center justify-content-between flex-column flex-sm-row">
94 + <div class="col-auto"><div class="small m-0 text-white">Copyright &copy; Your Website 2022</div></div>
95 + <div class="col-auto">
96 + <a class="link-light small" href="#!">Privacy</a>
97 + <span class="text-white mx-1">&middot;</span>
98 + <a class="link-light small" href="#!">Terms</a>
99 + <span class="text-white mx-1">&middot;</span>
100 + <a class="link-light small" href="#!">Contact</a>
101 + </div>
102 + </div>
103 + </div>
104 + </footer>
105 + <!-- Bootstrap core JS-->
106 + <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
107 + <!-- Core theme JS-->
108 + <script src="js/scripts.js"></script>
109 + </body>
110 +</html>
This diff is collapsed. Click to expand it.
...@@ -4,6 +4,16 @@ ...@@ -4,6 +4,16 @@
4 "lockfileVersion": 2, 4 "lockfileVersion": 2,
5 "requires": true, 5 "requires": true,
6 "packages": { 6 "packages": {
7 + "node_modules/@popperjs/core": {
8 + "version": "2.11.5",
9 + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz",
10 + "integrity": "sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==",
11 + "peer": true,
12 + "funding": {
13 + "type": "opencollective",
14 + "url": "https://opencollective.com/popperjs"
15 + }
16 + },
7 "node_modules/accepts": { 17 "node_modules/accepts": {
8 "version": "1.3.8", 18 "version": "1.3.8",
9 "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", 19 "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
...@@ -68,6 +78,18 @@ ...@@ -68,6 +78,18 @@
68 "npm": "1.2.8000 || >= 1.4.16" 78 "npm": "1.2.8000 || >= 1.4.16"
69 } 79 }
70 }, 80 },
81 + "node_modules/bootstrap": {
82 + "version": "5.1.3",
83 + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.3.tgz",
84 + "integrity": "sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q==",
85 + "funding": {
86 + "type": "opencollective",
87 + "url": "https://opencollective.com/bootstrap"
88 + },
89 + "peerDependencies": {
90 + "@popperjs/core": "^2.10.2"
91 + }
92 + },
71 "node_modules/brace-expansion": { 93 "node_modules/brace-expansion": {
72 "version": "1.1.11", 94 "version": "1.1.11",
73 "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 95 "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
......
1 +The MIT License (MIT)
2 +
3 +Copyright (c) 2019 Federico Zivolo
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining a copy of
6 +this software and associated documentation files (the "Software"), to deal in
7 +the Software without restriction, including without limitation the rights to
8 +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 +the Software, and to permit persons to whom the Software is furnished to do so,
10 +subject to the following conditions:
11 +
12 +The above copyright notice and this permission notice shall be included in all
13 +copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This diff is collapsed. Click to expand it.
1 +/**
2 + * @popperjs/core v2.11.5 - MIT License
3 + */
4 +
5 +'use strict';
6 +
7 +Object.defineProperty(exports, '__esModule', { value: true });
8 +
9 +var top = 'top';
10 +var bottom = 'bottom';
11 +var right = 'right';
12 +var left = 'left';
13 +var auto = 'auto';
14 +var basePlacements = [top, bottom, right, left];
15 +var start = 'start';
16 +var end = 'end';
17 +var clippingParents = 'clippingParents';
18 +var viewport = 'viewport';
19 +var popper = 'popper';
20 +var reference = 'reference';
21 +var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
22 + return acc.concat([placement + "-" + start, placement + "-" + end]);
23 +}, []);
24 +var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
25 + return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
26 +}, []); // modifiers that need to read the DOM
27 +
28 +var beforeRead = 'beforeRead';
29 +var read = 'read';
30 +var afterRead = 'afterRead'; // pure-logic modifiers
31 +
32 +var beforeMain = 'beforeMain';
33 +var main = 'main';
34 +var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
35 +
36 +var beforeWrite = 'beforeWrite';
37 +var write = 'write';
38 +var afterWrite = 'afterWrite';
39 +var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
40 +
41 +exports.afterMain = afterMain;
42 +exports.afterRead = afterRead;
43 +exports.afterWrite = afterWrite;
44 +exports.auto = auto;
45 +exports.basePlacements = basePlacements;
46 +exports.beforeMain = beforeMain;
47 +exports.beforeRead = beforeRead;
48 +exports.beforeWrite = beforeWrite;
49 +exports.bottom = bottom;
50 +exports.clippingParents = clippingParents;
51 +exports.end = end;
52 +exports.left = left;
53 +exports.main = main;
54 +exports.modifierPhases = modifierPhases;
55 +exports.placements = placements;
56 +exports.popper = popper;
57 +exports.read = read;
58 +exports.reference = reference;
59 +exports.right = right;
60 +exports.start = start;
61 +exports.top = top;
62 +exports.variationPlacements = variationPlacements;
63 +exports.viewport = viewport;
64 +exports.write = write;
65 +//# sourceMappingURL=enums.js.map
1 +// @flow
2 +
3 +export * from '../../lib/enums.js'
1 +{"version":3,"file":"enums.js","sources":["../../src/enums.js"],"sourcesContent":["// @flow\nexport const top: 'top' = 'top';\nexport const bottom: 'bottom' = 'bottom';\nexport const right: 'right' = 'right';\nexport const left: 'left' = 'left';\nexport const auto: 'auto' = 'auto';\nexport type BasePlacement =\n | typeof top\n | typeof bottom\n | typeof right\n | typeof left;\nexport const basePlacements: Array<BasePlacement> = [top, bottom, right, left];\n\nexport const start: 'start' = 'start';\nexport const end: 'end' = 'end';\nexport type Variation = typeof start | typeof end;\n\nexport const clippingParents: 'clippingParents' = 'clippingParents';\nexport const viewport: 'viewport' = 'viewport';\nexport type Boundary = Element | Array<Element> | typeof clippingParents;\nexport type RootBoundary = typeof viewport | 'document';\n\nexport const popper: 'popper' = 'popper';\nexport const reference: 'reference' = 'reference';\nexport type Context = typeof popper | typeof reference;\n\nexport type VariationPlacement =\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'right-start'\n | 'right-end'\n | 'left-start'\n | 'left-end';\nexport type AutoPlacement = 'auto' | 'auto-start' | 'auto-end';\nexport type ComputedPlacement = VariationPlacement | BasePlacement;\nexport type Placement = AutoPlacement | BasePlacement | VariationPlacement;\n\nexport const variationPlacements: Array<VariationPlacement> = basePlacements.reduce(\n (acc: Array<VariationPlacement>, placement: BasePlacement) =>\n acc.concat([(`${placement}-${start}`: any), (`${placement}-${end}`: any)]),\n []\n);\nexport const placements: Array<Placement> = [...basePlacements, auto].reduce(\n (\n acc: Array<Placement>,\n placement: BasePlacement | typeof auto\n ): Array<Placement> =>\n acc.concat([\n placement,\n (`${placement}-${start}`: any),\n (`${placement}-${end}`: any),\n ]),\n []\n);\n\n// modifiers that need to read the DOM\nexport const beforeRead: 'beforeRead' = 'beforeRead';\nexport const read: 'read' = 'read';\nexport const afterRead: 'afterRead' = 'afterRead';\n// pure-logic modifiers\nexport const beforeMain: 'beforeMain' = 'beforeMain';\nexport const main: 'main' = 'main';\nexport const afterMain: 'afterMain' = 'afterMain';\n// modifier with the purpose to write to the DOM (or write into a framework state)\nexport const beforeWrite: 'beforeWrite' = 'beforeWrite';\nexport const write: 'write' = 'write';\nexport const afterWrite: 'afterWrite' = 'afterWrite';\nexport const modifierPhases: Array<ModifierPhases> = [\n beforeRead,\n read,\n afterRead,\n beforeMain,\n main,\n afterMain,\n beforeWrite,\n write,\n afterWrite,\n];\n\nexport type ModifierPhases =\n | typeof beforeRead\n | typeof read\n | typeof afterRead\n | typeof beforeMain\n | typeof main\n | typeof afterMain\n | typeof beforeWrite\n | typeof write\n | typeof afterWrite;\n"],"names":["top","bottom","right","left","auto","basePlacements","start","end","clippingParents","viewport","popper","reference","variationPlacements","reduce","acc","placement","concat","placements","beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite","modifierPhases"],"mappings":";;;;;;;;IACaA,GAAU,GAAG;IACbC,MAAgB,GAAG;IACnBC,KAAc,GAAG;IACjBC,IAAY,GAAG;IACfC,IAAY,GAAG;IAMfC,cAAoC,GAAG,CAACL,GAAD,EAAMC,MAAN,EAAcC,KAAd,EAAqBC,IAArB;IAEvCG,KAAc,GAAG;IACjBC,GAAU,GAAG;IAGbC,eAAkC,GAAG;IACrCC,QAAoB,GAAG;IAIvBC,MAAgB,GAAG;IACnBC,SAAsB,GAAG;IAgBzBC,mBAA8C,gBAAGP,cAAc,CAACQ,MAAf,CAC5D,UAACC,GAAD,EAAiCC,SAAjC;AAAA,SACED,GAAG,CAACE,MAAJ,CAAW,CAAKD,SAAL,SAAkBT,KAAlB,EAAqCS,SAArC,SAAkDR,GAAlD,CAAX,CADF;AAAA,CAD4D,EAG5D,EAH4D;IAKjDU,UAA4B,gBAAG,UAAIZ,cAAJ,GAAoBD,IAApB,GAA0BS,MAA1B,CAC1C,UACEC,GADF,EAEEC,SAFF;AAAA,SAIED,GAAG,CAACE,MAAJ,CAAW,CACTD,SADS,EAELA,SAFK,SAEQT,KAFR,EAGLS,SAHK,SAGQR,GAHR,CAAX,CAJF;AAAA,CAD0C,EAU1C,EAV0C;;IAc/BW,UAAwB,GAAG;IAC3BC,IAAY,GAAG;IACfC,SAAsB,GAAG;;IAEzBC,UAAwB,GAAG;IAC3BC,IAAY,GAAG;IACfC,SAAsB,GAAG;;IAEzBC,WAA0B,GAAG;IAC7BC,KAAc,GAAG;IACjBC,UAAwB,GAAG;IAC3BC,cAAqC,GAAG,CACnDT,UADmD,EAEnDC,IAFmD,EAGnDC,SAHmD,EAInDC,UAJmD,EAKnDC,IALmD,EAMnDC,SANmD,EAOnDC,WAPmD,EAQnDC,KARmD,EASnDC,UATmD;;;;;;;;;;;;;;;;;;;;;;;;;"}
...\ No newline at end of file ...\ No newline at end of file
This diff is collapsed. Click to expand it.
1 +// @flow
2 +
3 +export * from '../../lib/popper-base.js'
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +// @flow
2 +
3 +export * from '../../lib/popper-lite.js'
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
1 +// @flow
2 +
3 +export * from '../../lib/popper.js'
This diff could not be displayed because it is too large.
1 +import getCompositeRect from "./dom-utils/getCompositeRect.js";
2 +import getLayoutRect from "./dom-utils/getLayoutRect.js";
3 +import listScrollParents from "./dom-utils/listScrollParents.js";
4 +import getOffsetParent from "./dom-utils/getOffsetParent.js";
5 +import getComputedStyle from "./dom-utils/getComputedStyle.js";
6 +import orderModifiers from "./utils/orderModifiers.js";
7 +import debounce from "./utils/debounce.js";
8 +import validateModifiers from "./utils/validateModifiers.js";
9 +import uniqueBy from "./utils/uniqueBy.js";
10 +import getBasePlacement from "./utils/getBasePlacement.js";
11 +import mergeByName from "./utils/mergeByName.js";
12 +import detectOverflow from "./utils/detectOverflow.js";
13 +import { isElement } from "./dom-utils/instanceOf.js";
14 +import { auto } from "./enums.js";
15 +var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';
16 +var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';
17 +var DEFAULT_OPTIONS = {
18 + placement: 'bottom',
19 + modifiers: [],
20 + strategy: 'absolute'
21 +};
22 +
23 +function areValidElements() {
24 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
25 + args[_key] = arguments[_key];
26 + }
27 +
28 + return !args.some(function (element) {
29 + return !(element && typeof element.getBoundingClientRect === 'function');
30 + });
31 +}
32 +
33 +export function popperGenerator(generatorOptions) {
34 + if (generatorOptions === void 0) {
35 + generatorOptions = {};
36 + }
37 +
38 + var _generatorOptions = generatorOptions,
39 + _generatorOptions$def = _generatorOptions.defaultModifiers,
40 + defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
41 + _generatorOptions$def2 = _generatorOptions.defaultOptions,
42 + defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
43 + return function createPopper(reference, popper, options) {
44 + if (options === void 0) {
45 + options = defaultOptions;
46 + }
47 +
48 + var state = {
49 + placement: 'bottom',
50 + orderedModifiers: [],
51 + options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
52 + modifiersData: {},
53 + elements: {
54 + reference: reference,
55 + popper: popper
56 + },
57 + attributes: {},
58 + styles: {}
59 + };
60 + var effectCleanupFns = [];
61 + var isDestroyed = false;
62 + var instance = {
63 + state: state,
64 + setOptions: function setOptions(setOptionsAction) {
65 + var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
66 + cleanupModifierEffects();
67 + state.options = Object.assign({}, defaultOptions, state.options, options);
68 + state.scrollParents = {
69 + reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
70 + popper: listScrollParents(popper)
71 + }; // Orders the modifiers based on their dependencies and `phase`
72 + // properties
73 +
74 + var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
75 +
76 + state.orderedModifiers = orderedModifiers.filter(function (m) {
77 + return m.enabled;
78 + }); // Validate the provided modifiers so that the consumer will get warned
79 + // if one of the modifiers is invalid for any reason
80 +
81 + if (false) {
82 + var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {
83 + var name = _ref.name;
84 + return name;
85 + });
86 + validateModifiers(modifiers);
87 +
88 + if (getBasePlacement(state.options.placement) === auto) {
89 + var flipModifier = state.orderedModifiers.find(function (_ref2) {
90 + var name = _ref2.name;
91 + return name === 'flip';
92 + });
93 +
94 + if (!flipModifier) {
95 + console.error(['Popper: "auto" placements require the "flip" modifier be', 'present and enabled to work.'].join(' '));
96 + }
97 + }
98 +
99 + var _getComputedStyle = getComputedStyle(popper),
100 + marginTop = _getComputedStyle.marginTop,
101 + marginRight = _getComputedStyle.marginRight,
102 + marginBottom = _getComputedStyle.marginBottom,
103 + marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can
104 + // cause bugs with positioning, so we'll warn the consumer
105 +
106 +
107 + if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {
108 + return parseFloat(margin);
109 + })) {
110 + console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));
111 + }
112 + }
113 +
114 + runModifierEffects();
115 + return instance.update();
116 + },
117 + // Sync update – it will always be executed, even if not necessary. This
118 + // is useful for low frequency updates where sync behavior simplifies the
119 + // logic.
120 + // For high frequency updates (e.g. `resize` and `scroll` events), always
121 + // prefer the async Popper#update method
122 + forceUpdate: function forceUpdate() {
123 + if (isDestroyed) {
124 + return;
125 + }
126 +
127 + var _state$elements = state.elements,
128 + reference = _state$elements.reference,
129 + popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
130 + // anymore
131 +
132 + if (!areValidElements(reference, popper)) {
133 + if (false) {
134 + console.error(INVALID_ELEMENT_ERROR);
135 + }
136 +
137 + return;
138 + } // Store the reference and popper rects to be read by modifiers
139 +
140 +
141 + state.rects = {
142 + reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
143 + popper: getLayoutRect(popper)
144 + }; // Modifiers have the ability to reset the current update cycle. The
145 + // most common use case for this is the `flip` modifier changing the
146 + // placement, which then needs to re-run all the modifiers, because the
147 + // logic was previously ran for the previous placement and is therefore
148 + // stale/incorrect
149 +
150 + state.reset = false;
151 + state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
152 + // is filled with the initial data specified by the modifier. This means
153 + // it doesn't persist and is fresh on each update.
154 + // To ensure persistent data, use `${name}#persistent`
155 +
156 + state.orderedModifiers.forEach(function (modifier) {
157 + return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
158 + });
159 + var __debug_loops__ = 0;
160 +
161 + for (var index = 0; index < state.orderedModifiers.length; index++) {
162 + if (false) {
163 + __debug_loops__ += 1;
164 +
165 + if (__debug_loops__ > 100) {
166 + console.error(INFINITE_LOOP_ERROR);
167 + break;
168 + }
169 + }
170 +
171 + if (state.reset === true) {
172 + state.reset = false;
173 + index = -1;
174 + continue;
175 + }
176 +
177 + var _state$orderedModifie = state.orderedModifiers[index],
178 + fn = _state$orderedModifie.fn,
179 + _state$orderedModifie2 = _state$orderedModifie.options,
180 + _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
181 + name = _state$orderedModifie.name;
182 +
183 + if (typeof fn === 'function') {
184 + state = fn({
185 + state: state,
186 + options: _options,
187 + name: name,
188 + instance: instance
189 + }) || state;
190 + }
191 + }
192 + },
193 + // Async and optimistically optimized update – it will not be executed if
194 + // not necessary (debounced to run at most once-per-tick)
195 + update: debounce(function () {
196 + return new Promise(function (resolve) {
197 + instance.forceUpdate();
198 + resolve(state);
199 + });
200 + }),
201 + destroy: function destroy() {
202 + cleanupModifierEffects();
203 + isDestroyed = true;
204 + }
205 + };
206 +
207 + if (!areValidElements(reference, popper)) {
208 + if (false) {
209 + console.error(INVALID_ELEMENT_ERROR);
210 + }
211 +
212 + return instance;
213 + }
214 +
215 + instance.setOptions(options).then(function (state) {
216 + if (!isDestroyed && options.onFirstUpdate) {
217 + options.onFirstUpdate(state);
218 + }
219 + }); // Modifiers have the ability to execute arbitrary code before the first
220 + // update cycle runs. They will be executed in the same order as the update
221 + // cycle. This is useful when a modifier adds some persistent data that
222 + // other modifiers need to use, but the modifier is run after the dependent
223 + // one.
224 +
225 + function runModifierEffects() {
226 + state.orderedModifiers.forEach(function (_ref3) {
227 + var name = _ref3.name,
228 + _ref3$options = _ref3.options,
229 + options = _ref3$options === void 0 ? {} : _ref3$options,
230 + effect = _ref3.effect;
231 +
232 + if (typeof effect === 'function') {
233 + var cleanupFn = effect({
234 + state: state,
235 + name: name,
236 + instance: instance,
237 + options: options
238 + });
239 +
240 + var noopFn = function noopFn() {};
241 +
242 + effectCleanupFns.push(cleanupFn || noopFn);
243 + }
244 + });
245 + }
246 +
247 + function cleanupModifierEffects() {
248 + effectCleanupFns.forEach(function (fn) {
249 + return fn();
250 + });
251 + effectCleanupFns = [];
252 + }
253 +
254 + return instance;
255 + };
256 +}
257 +export var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules
258 +
259 +export { detectOverflow };
...\ No newline at end of file ...\ No newline at end of file
1 +import { isShadowRoot } from "./instanceOf.js";
2 +export default function contains(parent, child) {
3 + var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
4 +
5 + if (parent.contains(child)) {
6 + return true;
7 + } // then fallback to custom implementation with Shadow DOM support
8 + else if (rootNode && isShadowRoot(rootNode)) {
9 + var next = child;
10 +
11 + do {
12 + if (next && parent.isSameNode(next)) {
13 + return true;
14 + } // $FlowFixMe[prop-missing]: need a better way to handle this...
15 +
16 +
17 + next = next.parentNode || next.host;
18 + } while (next);
19 + } // Give up, the result is false
20 +
21 +
22 + return false;
23 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import { isHTMLElement } from "./instanceOf.js";
2 +import { round } from "../utils/math.js";
3 +export default function getBoundingClientRect(element, includeScale) {
4 + if (includeScale === void 0) {
5 + includeScale = false;
6 + }
7 +
8 + var rect = element.getBoundingClientRect();
9 + var scaleX = 1;
10 + var scaleY = 1;
11 +
12 + if (isHTMLElement(element) && includeScale) {
13 + var offsetHeight = element.offsetHeight;
14 + var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
15 + // Fallback to 1 in case both values are `0`
16 +
17 + if (offsetWidth > 0) {
18 + scaleX = round(rect.width) / offsetWidth || 1;
19 + }
20 +
21 + if (offsetHeight > 0) {
22 + scaleY = round(rect.height) / offsetHeight || 1;
23 + }
24 + }
25 +
26 + return {
27 + width: rect.width / scaleX,
28 + height: rect.height / scaleY,
29 + top: rect.top / scaleY,
30 + right: rect.right / scaleX,
31 + bottom: rect.bottom / scaleY,
32 + left: rect.left / scaleX,
33 + x: rect.left / scaleX,
34 + y: rect.top / scaleY
35 + };
36 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import { viewport } from "../enums.js";
2 +import getViewportRect from "./getViewportRect.js";
3 +import getDocumentRect from "./getDocumentRect.js";
4 +import listScrollParents from "./listScrollParents.js";
5 +import getOffsetParent from "./getOffsetParent.js";
6 +import getDocumentElement from "./getDocumentElement.js";
7 +import getComputedStyle from "./getComputedStyle.js";
8 +import { isElement, isHTMLElement } from "./instanceOf.js";
9 +import getBoundingClientRect from "./getBoundingClientRect.js";
10 +import getParentNode from "./getParentNode.js";
11 +import contains from "./contains.js";
12 +import getNodeName from "./getNodeName.js";
13 +import rectToClientRect from "../utils/rectToClientRect.js";
14 +import { max, min } from "../utils/math.js";
15 +
16 +function getInnerBoundingClientRect(element) {
17 + var rect = getBoundingClientRect(element);
18 + rect.top = rect.top + element.clientTop;
19 + rect.left = rect.left + element.clientLeft;
20 + rect.bottom = rect.top + element.clientHeight;
21 + rect.right = rect.left + element.clientWidth;
22 + rect.width = element.clientWidth;
23 + rect.height = element.clientHeight;
24 + rect.x = rect.left;
25 + rect.y = rect.top;
26 + return rect;
27 +}
28 +
29 +function getClientRectFromMixedType(element, clippingParent) {
30 + return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
31 +} // A "clipping parent" is an overflowable container with the characteristic of
32 +// clipping (or hiding) overflowing elements with a position different from
33 +// `initial`
34 +
35 +
36 +function getClippingParents(element) {
37 + var clippingParents = listScrollParents(getParentNode(element));
38 + var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
39 + var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
40 +
41 + if (!isElement(clipperElement)) {
42 + return [];
43 + } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
44 +
45 +
46 + return clippingParents.filter(function (clippingParent) {
47 + return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
48 + });
49 +} // Gets the maximum area that the element is visible in due to any number of
50 +// clipping parents
51 +
52 +
53 +export default function getClippingRect(element, boundary, rootBoundary) {
54 + var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
55 + var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
56 + var firstClippingParent = clippingParents[0];
57 + var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
58 + var rect = getClientRectFromMixedType(element, clippingParent);
59 + accRect.top = max(rect.top, accRect.top);
60 + accRect.right = min(rect.right, accRect.right);
61 + accRect.bottom = min(rect.bottom, accRect.bottom);
62 + accRect.left = max(rect.left, accRect.left);
63 + return accRect;
64 + }, getClientRectFromMixedType(element, firstClippingParent));
65 + clippingRect.width = clippingRect.right - clippingRect.left;
66 + clippingRect.height = clippingRect.bottom - clippingRect.top;
67 + clippingRect.x = clippingRect.left;
68 + clippingRect.y = clippingRect.top;
69 + return clippingRect;
70 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import getBoundingClientRect from "./getBoundingClientRect.js";
2 +import getNodeScroll from "./getNodeScroll.js";
3 +import getNodeName from "./getNodeName.js";
4 +import { isHTMLElement } from "./instanceOf.js";
5 +import getWindowScrollBarX from "./getWindowScrollBarX.js";
6 +import getDocumentElement from "./getDocumentElement.js";
7 +import isScrollParent from "./isScrollParent.js";
8 +import { round } from "../utils/math.js";
9 +
10 +function isElementScaled(element) {
11 + var rect = element.getBoundingClientRect();
12 + var scaleX = round(rect.width) / element.offsetWidth || 1;
13 + var scaleY = round(rect.height) / element.offsetHeight || 1;
14 + return scaleX !== 1 || scaleY !== 1;
15 +} // Returns the composite rect of an element relative to its offsetParent.
16 +// Composite means it takes into account transforms as well as layout.
17 +
18 +
19 +export default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
20 + if (isFixed === void 0) {
21 + isFixed = false;
22 + }
23 +
24 + var isOffsetParentAnElement = isHTMLElement(offsetParent);
25 + var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
26 + var documentElement = getDocumentElement(offsetParent);
27 + var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
28 + var scroll = {
29 + scrollLeft: 0,
30 + scrollTop: 0
31 + };
32 + var offsets = {
33 + x: 0,
34 + y: 0
35 + };
36 +
37 + if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
38 + if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
39 + isScrollParent(documentElement)) {
40 + scroll = getNodeScroll(offsetParent);
41 + }
42 +
43 + if (isHTMLElement(offsetParent)) {
44 + offsets = getBoundingClientRect(offsetParent, true);
45 + offsets.x += offsetParent.clientLeft;
46 + offsets.y += offsetParent.clientTop;
47 + } else if (documentElement) {
48 + offsets.x = getWindowScrollBarX(documentElement);
49 + }
50 + }
51 +
52 + return {
53 + x: rect.left + scroll.scrollLeft - offsets.x,
54 + y: rect.top + scroll.scrollTop - offsets.y,
55 + width: rect.width,
56 + height: rect.height
57 + };
58 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import getWindow from "./getWindow.js";
2 +export default function getComputedStyle(element) {
3 + return getWindow(element).getComputedStyle(element);
4 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import { isElement } from "./instanceOf.js";
2 +export default function getDocumentElement(element) {
3 + // $FlowFixMe[incompatible-return]: assume body is always available
4 + return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
5 + element.document) || window.document).documentElement;
6 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import getDocumentElement from "./getDocumentElement.js";
2 +import getComputedStyle from "./getComputedStyle.js";
3 +import getWindowScrollBarX from "./getWindowScrollBarX.js";
4 +import getWindowScroll from "./getWindowScroll.js";
5 +import { max } from "../utils/math.js"; // Gets the entire size of the scrollable document area, even extending outside
6 +// of the `<html>` and `<body>` rect bounds if horizontally scrollable
7 +
8 +export default function getDocumentRect(element) {
9 + var _element$ownerDocumen;
10 +
11 + var html = getDocumentElement(element);
12 + var winScroll = getWindowScroll(element);
13 + var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
14 + var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
15 + var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
16 + var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
17 + var y = -winScroll.scrollTop;
18 +
19 + if (getComputedStyle(body || html).direction === 'rtl') {
20 + x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
21 + }
22 +
23 + return {
24 + width: width,
25 + height: height,
26 + x: x,
27 + y: y
28 + };
29 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function getHTMLElementScroll(element) {
2 + return {
3 + scrollLeft: element.scrollLeft,
4 + scrollTop: element.scrollTop
5 + };
6 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import getBoundingClientRect from "./getBoundingClientRect.js"; // Returns the layout rect of an element relative to its offsetParent. Layout
2 +// means it doesn't take into account transforms.
3 +
4 +export default function getLayoutRect(element) {
5 + var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
6 + // Fixes https://github.com/popperjs/popper-core/issues/1223
7 +
8 + var width = element.offsetWidth;
9 + var height = element.offsetHeight;
10 +
11 + if (Math.abs(clientRect.width - width) <= 1) {
12 + width = clientRect.width;
13 + }
14 +
15 + if (Math.abs(clientRect.height - height) <= 1) {
16 + height = clientRect.height;
17 + }
18 +
19 + return {
20 + x: element.offsetLeft,
21 + y: element.offsetTop,
22 + width: width,
23 + height: height
24 + };
25 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function getNodeName(element) {
2 + return element ? (element.nodeName || '').toLowerCase() : null;
3 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import getWindowScroll from "./getWindowScroll.js";
2 +import getWindow from "./getWindow.js";
3 +import { isHTMLElement } from "./instanceOf.js";
4 +import getHTMLElementScroll from "./getHTMLElementScroll.js";
5 +export default function getNodeScroll(node) {
6 + if (node === getWindow(node) || !isHTMLElement(node)) {
7 + return getWindowScroll(node);
8 + } else {
9 + return getHTMLElementScroll(node);
10 + }
11 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import getWindow from "./getWindow.js";
2 +import getNodeName from "./getNodeName.js";
3 +import getComputedStyle from "./getComputedStyle.js";
4 +import { isHTMLElement, isShadowRoot } from "./instanceOf.js";
5 +import isTableElement from "./isTableElement.js";
6 +import getParentNode from "./getParentNode.js";
7 +
8 +function getTrueOffsetParent(element) {
9 + if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
10 + getComputedStyle(element).position === 'fixed') {
11 + return null;
12 + }
13 +
14 + return element.offsetParent;
15 +} // `.offsetParent` reports `null` for fixed elements, while absolute elements
16 +// return the containing block
17 +
18 +
19 +function getContainingBlock(element) {
20 + var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;
21 + var isIE = navigator.userAgent.indexOf('Trident') !== -1;
22 +
23 + if (isIE && isHTMLElement(element)) {
24 + // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
25 + var elementCss = getComputedStyle(element);
26 +
27 + if (elementCss.position === 'fixed') {
28 + return null;
29 + }
30 + }
31 +
32 + var currentNode = getParentNode(element);
33 +
34 + if (isShadowRoot(currentNode)) {
35 + currentNode = currentNode.host;
36 + }
37 +
38 + while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
39 + var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
40 + // create a containing block.
41 + // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
42 +
43 + if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {
44 + return currentNode;
45 + } else {
46 + currentNode = currentNode.parentNode;
47 + }
48 + }
49 +
50 + return null;
51 +} // Gets the closest ancestor positioned element. Handles some edge cases,
52 +// such as table ancestors and cross browser bugs.
53 +
54 +
55 +export default function getOffsetParent(element) {
56 + var window = getWindow(element);
57 + var offsetParent = getTrueOffsetParent(element);
58 +
59 + while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
60 + offsetParent = getTrueOffsetParent(offsetParent);
61 + }
62 +
63 + if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
64 + return window;
65 + }
66 +
67 + return offsetParent || getContainingBlock(element) || window;
68 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import getNodeName from "./getNodeName.js";
2 +import getDocumentElement from "./getDocumentElement.js";
3 +import { isShadowRoot } from "./instanceOf.js";
4 +export default function getParentNode(element) {
5 + if (getNodeName(element) === 'html') {
6 + return element;
7 + }
8 +
9 + return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
10 + // $FlowFixMe[incompatible-return]
11 + // $FlowFixMe[prop-missing]
12 + element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
13 + element.parentNode || ( // DOM Element detected
14 + isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
15 + // $FlowFixMe[incompatible-call]: HTMLElement is a Node
16 + getDocumentElement(element) // fallback
17 +
18 + );
19 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import getParentNode from "./getParentNode.js";
2 +import isScrollParent from "./isScrollParent.js";
3 +import getNodeName from "./getNodeName.js";
4 +import { isHTMLElement } from "./instanceOf.js";
5 +export default function getScrollParent(node) {
6 + if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
7 + // $FlowFixMe[incompatible-return]: assume body is always available
8 + return node.ownerDocument.body;
9 + }
10 +
11 + if (isHTMLElement(node) && isScrollParent(node)) {
12 + return node;
13 + }
14 +
15 + return getScrollParent(getParentNode(node));
16 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import getWindow from "./getWindow.js";
2 +import getDocumentElement from "./getDocumentElement.js";
3 +import getWindowScrollBarX from "./getWindowScrollBarX.js";
4 +export default function getViewportRect(element) {
5 + var win = getWindow(element);
6 + var html = getDocumentElement(element);
7 + var visualViewport = win.visualViewport;
8 + var width = html.clientWidth;
9 + var height = html.clientHeight;
10 + var x = 0;
11 + var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper
12 + // can be obscured underneath it.
13 + // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even
14 + // if it isn't open, so if this isn't available, the popper will be detected
15 + // to overflow the bottom of the screen too early.
16 +
17 + if (visualViewport) {
18 + width = visualViewport.width;
19 + height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)
20 + // In Chrome, it returns a value very close to 0 (+/-) but contains rounding
21 + // errors due to floating point numbers, so we need to check precision.
22 + // Safari returns a number <= 0, usually < -1 when pinch-zoomed
23 + // Feature detection fails in mobile emulation mode in Chrome.
24 + // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <
25 + // 0.001
26 + // Fallback here: "Not Safari" userAgent
27 +
28 + if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
29 + x = visualViewport.offsetLeft;
30 + y = visualViewport.offsetTop;
31 + }
32 + }
33 +
34 + return {
35 + width: width,
36 + height: height,
37 + x: x + getWindowScrollBarX(element),
38 + y: y
39 + };
40 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function getWindow(node) {
2 + if (node == null) {
3 + return window;
4 + }
5 +
6 + if (node.toString() !== '[object Window]') {
7 + var ownerDocument = node.ownerDocument;
8 + return ownerDocument ? ownerDocument.defaultView || window : window;
9 + }
10 +
11 + return node;
12 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import getWindow from "./getWindow.js";
2 +export default function getWindowScroll(node) {
3 + var win = getWindow(node);
4 + var scrollLeft = win.pageXOffset;
5 + var scrollTop = win.pageYOffset;
6 + return {
7 + scrollLeft: scrollLeft,
8 + scrollTop: scrollTop
9 + };
10 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import getBoundingClientRect from "./getBoundingClientRect.js";
2 +import getDocumentElement from "./getDocumentElement.js";
3 +import getWindowScroll from "./getWindowScroll.js";
4 +export default function getWindowScrollBarX(element) {
5 + // If <html> has a CSS width greater than the viewport, then this will be
6 + // incorrect for RTL.
7 + // Popper 1 is broken in this case and never had a bug report so let's assume
8 + // it's not an issue. I don't think anyone ever specifies width on <html>
9 + // anyway.
10 + // Browsers where the left scrollbar doesn't cause an issue report `0` for
11 + // this (e.g. Edge 2019, IE11, Safari)
12 + return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
13 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import getWindow from "./getWindow.js";
2 +
3 +function isElement(node) {
4 + var OwnElement = getWindow(node).Element;
5 + return node instanceof OwnElement || node instanceof Element;
6 +}
7 +
8 +function isHTMLElement(node) {
9 + var OwnElement = getWindow(node).HTMLElement;
10 + return node instanceof OwnElement || node instanceof HTMLElement;
11 +}
12 +
13 +function isShadowRoot(node) {
14 + // IE 11 has no ShadowRoot
15 + if (typeof ShadowRoot === 'undefined') {
16 + return false;
17 + }
18 +
19 + var OwnElement = getWindow(node).ShadowRoot;
20 + return node instanceof OwnElement || node instanceof ShadowRoot;
21 +}
22 +
23 +export { isElement, isHTMLElement, isShadowRoot };
...\ No newline at end of file ...\ No newline at end of file
1 +import getComputedStyle from "./getComputedStyle.js";
2 +export default function isScrollParent(element) {
3 + // Firefox wants us to check `-x` and `-y` variations as well
4 + var _getComputedStyle = getComputedStyle(element),
5 + overflow = _getComputedStyle.overflow,
6 + overflowX = _getComputedStyle.overflowX,
7 + overflowY = _getComputedStyle.overflowY;
8 +
9 + return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
10 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import getNodeName from "./getNodeName.js";
2 +export default function isTableElement(element) {
3 + return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
4 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import getScrollParent from "./getScrollParent.js";
2 +import getParentNode from "./getParentNode.js";
3 +import getWindow from "./getWindow.js";
4 +import isScrollParent from "./isScrollParent.js";
5 +/*
6 +given a DOM element, return the list of all scroll parents, up the list of ancesors
7 +until we get to the top window object. This list is what we attach scroll listeners
8 +to, because if any of these parent elements scroll, we'll need to re-calculate the
9 +reference element's position.
10 +*/
11 +
12 +export default function listScrollParents(element, list) {
13 + var _element$ownerDocumen;
14 +
15 + if (list === void 0) {
16 + list = [];
17 + }
18 +
19 + var scrollParent = getScrollParent(element);
20 + var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
21 + var win = getWindow(scrollParent);
22 + var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
23 + var updatedList = list.concat(target);
24 + return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
25 + updatedList.concat(listScrollParents(getParentNode(target)));
26 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export var top = 'top';
2 +export var bottom = 'bottom';
3 +export var right = 'right';
4 +export var left = 'left';
5 +export var auto = 'auto';
6 +export var basePlacements = [top, bottom, right, left];
7 +export var start = 'start';
8 +export var end = 'end';
9 +export var clippingParents = 'clippingParents';
10 +export var viewport = 'viewport';
11 +export var popper = 'popper';
12 +export var reference = 'reference';
13 +export var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
14 + return acc.concat([placement + "-" + start, placement + "-" + end]);
15 +}, []);
16 +export var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
17 + return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
18 +}, []); // modifiers that need to read the DOM
19 +
20 +export var beforeRead = 'beforeRead';
21 +export var read = 'read';
22 +export var afterRead = 'afterRead'; // pure-logic modifiers
23 +
24 +export var beforeMain = 'beforeMain';
25 +export var main = 'main';
26 +export var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
27 +
28 +export var beforeWrite = 'beforeWrite';
29 +export var write = 'write';
30 +export var afterWrite = 'afterWrite';
31 +export var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
...\ No newline at end of file ...\ No newline at end of file
1 +export * from "./enums.js";
2 +export * from "./modifiers/index.js"; // eslint-disable-next-line import/no-unused-modules
3 +
4 +export { popperGenerator, detectOverflow, createPopper as createPopperBase } from "./createPopper.js"; // eslint-disable-next-line import/no-unused-modules
5 +
6 +export { createPopper } from "./popper.js"; // eslint-disable-next-line import/no-unused-modules
7 +
8 +export { createPopper as createPopperLite } from "./popper-lite.js";
...\ No newline at end of file ...\ No newline at end of file
1 +import getNodeName from "../dom-utils/getNodeName.js";
2 +import { isHTMLElement } from "../dom-utils/instanceOf.js"; // This modifier takes the styles prepared by the `computeStyles` modifier
3 +// and applies them to the HTMLElements such as popper and arrow
4 +
5 +function applyStyles(_ref) {
6 + var state = _ref.state;
7 + Object.keys(state.elements).forEach(function (name) {
8 + var style = state.styles[name] || {};
9 + var attributes = state.attributes[name] || {};
10 + var element = state.elements[name]; // arrow is optional + virtual elements
11 +
12 + if (!isHTMLElement(element) || !getNodeName(element)) {
13 + return;
14 + } // Flow doesn't support to extend this property, but it's the most
15 + // effective way to apply styles to an HTMLElement
16 + // $FlowFixMe[cannot-write]
17 +
18 +
19 + Object.assign(element.style, style);
20 + Object.keys(attributes).forEach(function (name) {
21 + var value = attributes[name];
22 +
23 + if (value === false) {
24 + element.removeAttribute(name);
25 + } else {
26 + element.setAttribute(name, value === true ? '' : value);
27 + }
28 + });
29 + });
30 +}
31 +
32 +function effect(_ref2) {
33 + var state = _ref2.state;
34 + var initialStyles = {
35 + popper: {
36 + position: state.options.strategy,
37 + left: '0',
38 + top: '0',
39 + margin: '0'
40 + },
41 + arrow: {
42 + position: 'absolute'
43 + },
44 + reference: {}
45 + };
46 + Object.assign(state.elements.popper.style, initialStyles.popper);
47 + state.styles = initialStyles;
48 +
49 + if (state.elements.arrow) {
50 + Object.assign(state.elements.arrow.style, initialStyles.arrow);
51 + }
52 +
53 + return function () {
54 + Object.keys(state.elements).forEach(function (name) {
55 + var element = state.elements[name];
56 + var attributes = state.attributes[name] || {};
57 + var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
58 +
59 + var style = styleProperties.reduce(function (style, property) {
60 + style[property] = '';
61 + return style;
62 + }, {}); // arrow is optional + virtual elements
63 +
64 + if (!isHTMLElement(element) || !getNodeName(element)) {
65 + return;
66 + }
67 +
68 + Object.assign(element.style, style);
69 + Object.keys(attributes).forEach(function (attribute) {
70 + element.removeAttribute(attribute);
71 + });
72 + });
73 + };
74 +} // eslint-disable-next-line import/no-unused-modules
75 +
76 +
77 +export default {
78 + name: 'applyStyles',
79 + enabled: true,
80 + phase: 'write',
81 + fn: applyStyles,
82 + effect: effect,
83 + requires: ['computeStyles']
84 +};
...\ No newline at end of file ...\ No newline at end of file
1 +import getBasePlacement from "../utils/getBasePlacement.js";
2 +import getLayoutRect from "../dom-utils/getLayoutRect.js";
3 +import contains from "../dom-utils/contains.js";
4 +import getOffsetParent from "../dom-utils/getOffsetParent.js";
5 +import getMainAxisFromPlacement from "../utils/getMainAxisFromPlacement.js";
6 +import { within } from "../utils/within.js";
7 +import mergePaddingObject from "../utils/mergePaddingObject.js";
8 +import expandToHashMap from "../utils/expandToHashMap.js";
9 +import { left, right, basePlacements, top, bottom } from "../enums.js";
10 +import { isHTMLElement } from "../dom-utils/instanceOf.js"; // eslint-disable-next-line import/no-unused-modules
11 +
12 +var toPaddingObject = function toPaddingObject(padding, state) {
13 + padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
14 + placement: state.placement
15 + })) : padding;
16 + return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
17 +};
18 +
19 +function arrow(_ref) {
20 + var _state$modifiersData$;
21 +
22 + var state = _ref.state,
23 + name = _ref.name,
24 + options = _ref.options;
25 + var arrowElement = state.elements.arrow;
26 + var popperOffsets = state.modifiersData.popperOffsets;
27 + var basePlacement = getBasePlacement(state.placement);
28 + var axis = getMainAxisFromPlacement(basePlacement);
29 + var isVertical = [left, right].indexOf(basePlacement) >= 0;
30 + var len = isVertical ? 'height' : 'width';
31 +
32 + if (!arrowElement || !popperOffsets) {
33 + return;
34 + }
35 +
36 + var paddingObject = toPaddingObject(options.padding, state);
37 + var arrowRect = getLayoutRect(arrowElement);
38 + var minProp = axis === 'y' ? top : left;
39 + var maxProp = axis === 'y' ? bottom : right;
40 + var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
41 + var startDiff = popperOffsets[axis] - state.rects.reference[axis];
42 + var arrowOffsetParent = getOffsetParent(arrowElement);
43 + var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
44 + var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
45 + // outside of the popper bounds
46 +
47 + var min = paddingObject[minProp];
48 + var max = clientSize - arrowRect[len] - paddingObject[maxProp];
49 + var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
50 + var offset = within(min, center, max); // Prevents breaking syntax highlighting...
51 +
52 + var axisProp = axis;
53 + state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
54 +}
55 +
56 +function effect(_ref2) {
57 + var state = _ref2.state,
58 + options = _ref2.options;
59 + var _options$element = options.element,
60 + arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
61 +
62 + if (arrowElement == null) {
63 + return;
64 + } // CSS selector
65 +
66 +
67 + if (typeof arrowElement === 'string') {
68 + arrowElement = state.elements.popper.querySelector(arrowElement);
69 +
70 + if (!arrowElement) {
71 + return;
72 + }
73 + }
74 +
75 + if (false) {
76 + if (!isHTMLElement(arrowElement)) {
77 + console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));
78 + }
79 + }
80 +
81 + if (!contains(state.elements.popper, arrowElement)) {
82 + if (false) {
83 + console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', 'element.'].join(' '));
84 + }
85 +
86 + return;
87 + }
88 +
89 + state.elements.arrow = arrowElement;
90 +} // eslint-disable-next-line import/no-unused-modules
91 +
92 +
93 +export default {
94 + name: 'arrow',
95 + enabled: true,
96 + phase: 'main',
97 + fn: arrow,
98 + effect: effect,
99 + requires: ['popperOffsets'],
100 + requiresIfExists: ['preventOverflow']
101 +};
...\ No newline at end of file ...\ No newline at end of file
1 +import { top, left, right, bottom, end } from "../enums.js";
2 +import getOffsetParent from "../dom-utils/getOffsetParent.js";
3 +import getWindow from "../dom-utils/getWindow.js";
4 +import getDocumentElement from "../dom-utils/getDocumentElement.js";
5 +import getComputedStyle from "../dom-utils/getComputedStyle.js";
6 +import getBasePlacement from "../utils/getBasePlacement.js";
7 +import getVariation from "../utils/getVariation.js";
8 +import { round } from "../utils/math.js"; // eslint-disable-next-line import/no-unused-modules
9 +
10 +var unsetSides = {
11 + top: 'auto',
12 + right: 'auto',
13 + bottom: 'auto',
14 + left: 'auto'
15 +}; // Round the offsets to the nearest suitable subpixel based on the DPR.
16 +// Zooming can change the DPR, but it seems to report a value that will
17 +// cleanly divide the values into the appropriate subpixels.
18 +
19 +function roundOffsetsByDPR(_ref) {
20 + var x = _ref.x,
21 + y = _ref.y;
22 + var win = window;
23 + var dpr = win.devicePixelRatio || 1;
24 + return {
25 + x: round(x * dpr) / dpr || 0,
26 + y: round(y * dpr) / dpr || 0
27 + };
28 +}
29 +
30 +export function mapToStyles(_ref2) {
31 + var _Object$assign2;
32 +
33 + var popper = _ref2.popper,
34 + popperRect = _ref2.popperRect,
35 + placement = _ref2.placement,
36 + variation = _ref2.variation,
37 + offsets = _ref2.offsets,
38 + position = _ref2.position,
39 + gpuAcceleration = _ref2.gpuAcceleration,
40 + adaptive = _ref2.adaptive,
41 + roundOffsets = _ref2.roundOffsets,
42 + isFixed = _ref2.isFixed;
43 + var _offsets$x = offsets.x,
44 + x = _offsets$x === void 0 ? 0 : _offsets$x,
45 + _offsets$y = offsets.y,
46 + y = _offsets$y === void 0 ? 0 : _offsets$y;
47 +
48 + var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
49 + x: x,
50 + y: y
51 + }) : {
52 + x: x,
53 + y: y
54 + };
55 +
56 + x = _ref3.x;
57 + y = _ref3.y;
58 + var hasX = offsets.hasOwnProperty('x');
59 + var hasY = offsets.hasOwnProperty('y');
60 + var sideX = left;
61 + var sideY = top;
62 + var win = window;
63 +
64 + if (adaptive) {
65 + var offsetParent = getOffsetParent(popper);
66 + var heightProp = 'clientHeight';
67 + var widthProp = 'clientWidth';
68 +
69 + if (offsetParent === getWindow(popper)) {
70 + offsetParent = getDocumentElement(popper);
71 +
72 + if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {
73 + heightProp = 'scrollHeight';
74 + widthProp = 'scrollWidth';
75 + }
76 + } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
77 +
78 +
79 + offsetParent = offsetParent;
80 +
81 + if (placement === top || (placement === left || placement === right) && variation === end) {
82 + sideY = bottom;
83 + var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
84 + offsetParent[heightProp];
85 + y -= offsetY - popperRect.height;
86 + y *= gpuAcceleration ? 1 : -1;
87 + }
88 +
89 + if (placement === left || (placement === top || placement === bottom) && variation === end) {
90 + sideX = right;
91 + var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
92 + offsetParent[widthProp];
93 + x -= offsetX - popperRect.width;
94 + x *= gpuAcceleration ? 1 : -1;
95 + }
96 + }
97 +
98 + var commonStyles = Object.assign({
99 + position: position
100 + }, adaptive && unsetSides);
101 +
102 + var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
103 + x: x,
104 + y: y
105 + }) : {
106 + x: x,
107 + y: y
108 + };
109 +
110 + x = _ref4.x;
111 + y = _ref4.y;
112 +
113 + if (gpuAcceleration) {
114 + var _Object$assign;
115 +
116 + return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
117 + }
118 +
119 + return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
120 +}
121 +
122 +function computeStyles(_ref5) {
123 + var state = _ref5.state,
124 + options = _ref5.options;
125 + var _options$gpuAccelerat = options.gpuAcceleration,
126 + gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
127 + _options$adaptive = options.adaptive,
128 + adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
129 + _options$roundOffsets = options.roundOffsets,
130 + roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
131 +
132 + if (false) {
133 + var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';
134 +
135 + if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {
136 + return transitionProperty.indexOf(property) >= 0;
137 + })) {
138 + console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: "transform", "top", "right", "bottom", "left".', '\n\n', 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\n\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));
139 + }
140 + }
141 +
142 + var commonStyles = {
143 + placement: getBasePlacement(state.placement),
144 + variation: getVariation(state.placement),
145 + popper: state.elements.popper,
146 + popperRect: state.rects.popper,
147 + gpuAcceleration: gpuAcceleration,
148 + isFixed: state.options.strategy === 'fixed'
149 + };
150 +
151 + if (state.modifiersData.popperOffsets != null) {
152 + state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
153 + offsets: state.modifiersData.popperOffsets,
154 + position: state.options.strategy,
155 + adaptive: adaptive,
156 + roundOffsets: roundOffsets
157 + })));
158 + }
159 +
160 + if (state.modifiersData.arrow != null) {
161 + state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
162 + offsets: state.modifiersData.arrow,
163 + position: 'absolute',
164 + adaptive: false,
165 + roundOffsets: roundOffsets
166 + })));
167 + }
168 +
169 + state.attributes.popper = Object.assign({}, state.attributes.popper, {
170 + 'data-popper-placement': state.placement
171 + });
172 +} // eslint-disable-next-line import/no-unused-modules
173 +
174 +
175 +export default {
176 + name: 'computeStyles',
177 + enabled: true,
178 + phase: 'beforeWrite',
179 + fn: computeStyles,
180 + data: {}
181 +};
...\ No newline at end of file ...\ No newline at end of file
1 +import getWindow from "../dom-utils/getWindow.js"; // eslint-disable-next-line import/no-unused-modules
2 +
3 +var passive = {
4 + passive: true
5 +};
6 +
7 +function effect(_ref) {
8 + var state = _ref.state,
9 + instance = _ref.instance,
10 + options = _ref.options;
11 + var _options$scroll = options.scroll,
12 + scroll = _options$scroll === void 0 ? true : _options$scroll,
13 + _options$resize = options.resize,
14 + resize = _options$resize === void 0 ? true : _options$resize;
15 + var window = getWindow(state.elements.popper);
16 + var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
17 +
18 + if (scroll) {
19 + scrollParents.forEach(function (scrollParent) {
20 + scrollParent.addEventListener('scroll', instance.update, passive);
21 + });
22 + }
23 +
24 + if (resize) {
25 + window.addEventListener('resize', instance.update, passive);
26 + }
27 +
28 + return function () {
29 + if (scroll) {
30 + scrollParents.forEach(function (scrollParent) {
31 + scrollParent.removeEventListener('scroll', instance.update, passive);
32 + });
33 + }
34 +
35 + if (resize) {
36 + window.removeEventListener('resize', instance.update, passive);
37 + }
38 + };
39 +} // eslint-disable-next-line import/no-unused-modules
40 +
41 +
42 +export default {
43 + name: 'eventListeners',
44 + enabled: true,
45 + phase: 'write',
46 + fn: function fn() {},
47 + effect: effect,
48 + data: {}
49 +};
...\ No newline at end of file ...\ No newline at end of file
1 +import getOppositePlacement from "../utils/getOppositePlacement.js";
2 +import getBasePlacement from "../utils/getBasePlacement.js";
3 +import getOppositeVariationPlacement from "../utils/getOppositeVariationPlacement.js";
4 +import detectOverflow from "../utils/detectOverflow.js";
5 +import computeAutoPlacement from "../utils/computeAutoPlacement.js";
6 +import { bottom, top, start, right, left, auto } from "../enums.js";
7 +import getVariation from "../utils/getVariation.js"; // eslint-disable-next-line import/no-unused-modules
8 +
9 +function getExpandedFallbackPlacements(placement) {
10 + if (getBasePlacement(placement) === auto) {
11 + return [];
12 + }
13 +
14 + var oppositePlacement = getOppositePlacement(placement);
15 + return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
16 +}
17 +
18 +function flip(_ref) {
19 + var state = _ref.state,
20 + options = _ref.options,
21 + name = _ref.name;
22 +
23 + if (state.modifiersData[name]._skip) {
24 + return;
25 + }
26 +
27 + var _options$mainAxis = options.mainAxis,
28 + checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
29 + _options$altAxis = options.altAxis,
30 + checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
31 + specifiedFallbackPlacements = options.fallbackPlacements,
32 + padding = options.padding,
33 + boundary = options.boundary,
34 + rootBoundary = options.rootBoundary,
35 + altBoundary = options.altBoundary,
36 + _options$flipVariatio = options.flipVariations,
37 + flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
38 + allowedAutoPlacements = options.allowedAutoPlacements;
39 + var preferredPlacement = state.options.placement;
40 + var basePlacement = getBasePlacement(preferredPlacement);
41 + var isBasePlacement = basePlacement === preferredPlacement;
42 + var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
43 + var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
44 + return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
45 + placement: placement,
46 + boundary: boundary,
47 + rootBoundary: rootBoundary,
48 + padding: padding,
49 + flipVariations: flipVariations,
50 + allowedAutoPlacements: allowedAutoPlacements
51 + }) : placement);
52 + }, []);
53 + var referenceRect = state.rects.reference;
54 + var popperRect = state.rects.popper;
55 + var checksMap = new Map();
56 + var makeFallbackChecks = true;
57 + var firstFittingPlacement = placements[0];
58 +
59 + for (var i = 0; i < placements.length; i++) {
60 + var placement = placements[i];
61 +
62 + var _basePlacement = getBasePlacement(placement);
63 +
64 + var isStartVariation = getVariation(placement) === start;
65 + var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
66 + var len = isVertical ? 'width' : 'height';
67 + var overflow = detectOverflow(state, {
68 + placement: placement,
69 + boundary: boundary,
70 + rootBoundary: rootBoundary,
71 + altBoundary: altBoundary,
72 + padding: padding
73 + });
74 + var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
75 +
76 + if (referenceRect[len] > popperRect[len]) {
77 + mainVariationSide = getOppositePlacement(mainVariationSide);
78 + }
79 +
80 + var altVariationSide = getOppositePlacement(mainVariationSide);
81 + var checks = [];
82 +
83 + if (checkMainAxis) {
84 + checks.push(overflow[_basePlacement] <= 0);
85 + }
86 +
87 + if (checkAltAxis) {
88 + checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
89 + }
90 +
91 + if (checks.every(function (check) {
92 + return check;
93 + })) {
94 + firstFittingPlacement = placement;
95 + makeFallbackChecks = false;
96 + break;
97 + }
98 +
99 + checksMap.set(placement, checks);
100 + }
101 +
102 + if (makeFallbackChecks) {
103 + // `2` may be desired in some cases – research later
104 + var numberOfChecks = flipVariations ? 3 : 1;
105 +
106 + var _loop = function _loop(_i) {
107 + var fittingPlacement = placements.find(function (placement) {
108 + var checks = checksMap.get(placement);
109 +
110 + if (checks) {
111 + return checks.slice(0, _i).every(function (check) {
112 + return check;
113 + });
114 + }
115 + });
116 +
117 + if (fittingPlacement) {
118 + firstFittingPlacement = fittingPlacement;
119 + return "break";
120 + }
121 + };
122 +
123 + for (var _i = numberOfChecks; _i > 0; _i--) {
124 + var _ret = _loop(_i);
125 +
126 + if (_ret === "break") break;
127 + }
128 + }
129 +
130 + if (state.placement !== firstFittingPlacement) {
131 + state.modifiersData[name]._skip = true;
132 + state.placement = firstFittingPlacement;
133 + state.reset = true;
134 + }
135 +} // eslint-disable-next-line import/no-unused-modules
136 +
137 +
138 +export default {
139 + name: 'flip',
140 + enabled: true,
141 + phase: 'main',
142 + fn: flip,
143 + requiresIfExists: ['offset'],
144 + data: {
145 + _skip: false
146 + }
147 +};
...\ No newline at end of file ...\ No newline at end of file
1 +import { top, bottom, left, right } from "../enums.js";
2 +import detectOverflow from "../utils/detectOverflow.js";
3 +
4 +function getSideOffsets(overflow, rect, preventedOffsets) {
5 + if (preventedOffsets === void 0) {
6 + preventedOffsets = {
7 + x: 0,
8 + y: 0
9 + };
10 + }
11 +
12 + return {
13 + top: overflow.top - rect.height - preventedOffsets.y,
14 + right: overflow.right - rect.width + preventedOffsets.x,
15 + bottom: overflow.bottom - rect.height + preventedOffsets.y,
16 + left: overflow.left - rect.width - preventedOffsets.x
17 + };
18 +}
19 +
20 +function isAnySideFullyClipped(overflow) {
21 + return [top, right, bottom, left].some(function (side) {
22 + return overflow[side] >= 0;
23 + });
24 +}
25 +
26 +function hide(_ref) {
27 + var state = _ref.state,
28 + name = _ref.name;
29 + var referenceRect = state.rects.reference;
30 + var popperRect = state.rects.popper;
31 + var preventedOffsets = state.modifiersData.preventOverflow;
32 + var referenceOverflow = detectOverflow(state, {
33 + elementContext: 'reference'
34 + });
35 + var popperAltOverflow = detectOverflow(state, {
36 + altBoundary: true
37 + });
38 + var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
39 + var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
40 + var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
41 + var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
42 + state.modifiersData[name] = {
43 + referenceClippingOffsets: referenceClippingOffsets,
44 + popperEscapeOffsets: popperEscapeOffsets,
45 + isReferenceHidden: isReferenceHidden,
46 + hasPopperEscaped: hasPopperEscaped
47 + };
48 + state.attributes.popper = Object.assign({}, state.attributes.popper, {
49 + 'data-popper-reference-hidden': isReferenceHidden,
50 + 'data-popper-escaped': hasPopperEscaped
51 + });
52 +} // eslint-disable-next-line import/no-unused-modules
53 +
54 +
55 +export default {
56 + name: 'hide',
57 + enabled: true,
58 + phase: 'main',
59 + requiresIfExists: ['preventOverflow'],
60 + fn: hide
61 +};
...\ No newline at end of file ...\ No newline at end of file
1 +export { default as applyStyles } from "./applyStyles.js";
2 +export { default as arrow } from "./arrow.js";
3 +export { default as computeStyles } from "./computeStyles.js";
4 +export { default as eventListeners } from "./eventListeners.js";
5 +export { default as flip } from "./flip.js";
6 +export { default as hide } from "./hide.js";
7 +export { default as offset } from "./offset.js";
8 +export { default as popperOffsets } from "./popperOffsets.js";
9 +export { default as preventOverflow } from "./preventOverflow.js";
...\ No newline at end of file ...\ No newline at end of file
1 +import getBasePlacement from "../utils/getBasePlacement.js";
2 +import { top, left, right, placements } from "../enums.js"; // eslint-disable-next-line import/no-unused-modules
3 +
4 +export function distanceAndSkiddingToXY(placement, rects, offset) {
5 + var basePlacement = getBasePlacement(placement);
6 + var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
7 +
8 + var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
9 + placement: placement
10 + })) : offset,
11 + skidding = _ref[0],
12 + distance = _ref[1];
13 +
14 + skidding = skidding || 0;
15 + distance = (distance || 0) * invertDistance;
16 + return [left, right].indexOf(basePlacement) >= 0 ? {
17 + x: distance,
18 + y: skidding
19 + } : {
20 + x: skidding,
21 + y: distance
22 + };
23 +}
24 +
25 +function offset(_ref2) {
26 + var state = _ref2.state,
27 + options = _ref2.options,
28 + name = _ref2.name;
29 + var _options$offset = options.offset,
30 + offset = _options$offset === void 0 ? [0, 0] : _options$offset;
31 + var data = placements.reduce(function (acc, placement) {
32 + acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
33 + return acc;
34 + }, {});
35 + var _data$state$placement = data[state.placement],
36 + x = _data$state$placement.x,
37 + y = _data$state$placement.y;
38 +
39 + if (state.modifiersData.popperOffsets != null) {
40 + state.modifiersData.popperOffsets.x += x;
41 + state.modifiersData.popperOffsets.y += y;
42 + }
43 +
44 + state.modifiersData[name] = data;
45 +} // eslint-disable-next-line import/no-unused-modules
46 +
47 +
48 +export default {
49 + name: 'offset',
50 + enabled: true,
51 + phase: 'main',
52 + requires: ['popperOffsets'],
53 + fn: offset
54 +};
...\ No newline at end of file ...\ No newline at end of file
1 +import computeOffsets from "../utils/computeOffsets.js";
2 +
3 +function popperOffsets(_ref) {
4 + var state = _ref.state,
5 + name = _ref.name;
6 + // Offsets are the actual position the popper needs to have to be
7 + // properly positioned near its reference element
8 + // This is the most basic placement, and will be adjusted by
9 + // the modifiers in the next step
10 + state.modifiersData[name] = computeOffsets({
11 + reference: state.rects.reference,
12 + element: state.rects.popper,
13 + strategy: 'absolute',
14 + placement: state.placement
15 + });
16 +} // eslint-disable-next-line import/no-unused-modules
17 +
18 +
19 +export default {
20 + name: 'popperOffsets',
21 + enabled: true,
22 + phase: 'read',
23 + fn: popperOffsets,
24 + data: {}
25 +};
...\ No newline at end of file ...\ No newline at end of file
1 +import { top, left, right, bottom, start } from "../enums.js";
2 +import getBasePlacement from "../utils/getBasePlacement.js";
3 +import getMainAxisFromPlacement from "../utils/getMainAxisFromPlacement.js";
4 +import getAltAxis from "../utils/getAltAxis.js";
5 +import { within, withinMaxClamp } from "../utils/within.js";
6 +import getLayoutRect from "../dom-utils/getLayoutRect.js";
7 +import getOffsetParent from "../dom-utils/getOffsetParent.js";
8 +import detectOverflow from "../utils/detectOverflow.js";
9 +import getVariation from "../utils/getVariation.js";
10 +import getFreshSideObject from "../utils/getFreshSideObject.js";
11 +import { min as mathMin, max as mathMax } from "../utils/math.js";
12 +
13 +function preventOverflow(_ref) {
14 + var state = _ref.state,
15 + options = _ref.options,
16 + name = _ref.name;
17 + var _options$mainAxis = options.mainAxis,
18 + checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
19 + _options$altAxis = options.altAxis,
20 + checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
21 + boundary = options.boundary,
22 + rootBoundary = options.rootBoundary,
23 + altBoundary = options.altBoundary,
24 + padding = options.padding,
25 + _options$tether = options.tether,
26 + tether = _options$tether === void 0 ? true : _options$tether,
27 + _options$tetherOffset = options.tetherOffset,
28 + tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
29 + var overflow = detectOverflow(state, {
30 + boundary: boundary,
31 + rootBoundary: rootBoundary,
32 + padding: padding,
33 + altBoundary: altBoundary
34 + });
35 + var basePlacement = getBasePlacement(state.placement);
36 + var variation = getVariation(state.placement);
37 + var isBasePlacement = !variation;
38 + var mainAxis = getMainAxisFromPlacement(basePlacement);
39 + var altAxis = getAltAxis(mainAxis);
40 + var popperOffsets = state.modifiersData.popperOffsets;
41 + var referenceRect = state.rects.reference;
42 + var popperRect = state.rects.popper;
43 + var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
44 + placement: state.placement
45 + })) : tetherOffset;
46 + var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
47 + mainAxis: tetherOffsetValue,
48 + altAxis: tetherOffsetValue
49 + } : Object.assign({
50 + mainAxis: 0,
51 + altAxis: 0
52 + }, tetherOffsetValue);
53 + var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
54 + var data = {
55 + x: 0,
56 + y: 0
57 + };
58 +
59 + if (!popperOffsets) {
60 + return;
61 + }
62 +
63 + if (checkMainAxis) {
64 + var _offsetModifierState$;
65 +
66 + var mainSide = mainAxis === 'y' ? top : left;
67 + var altSide = mainAxis === 'y' ? bottom : right;
68 + var len = mainAxis === 'y' ? 'height' : 'width';
69 + var offset = popperOffsets[mainAxis];
70 + var min = offset + overflow[mainSide];
71 + var max = offset - overflow[altSide];
72 + var additive = tether ? -popperRect[len] / 2 : 0;
73 + var minLen = variation === start ? referenceRect[len] : popperRect[len];
74 + var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
75 + // outside the reference bounds
76 +
77 + var arrowElement = state.elements.arrow;
78 + var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
79 + width: 0,
80 + height: 0
81 + };
82 + var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
83 + var arrowPaddingMin = arrowPaddingObject[mainSide];
84 + var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
85 + // to include its full size in the calculation. If the reference is small
86 + // and near the edge of a boundary, the popper can overflow even if the
87 + // reference is not overflowing as well (e.g. virtual elements with no
88 + // width or height)
89 +
90 + var arrowLen = within(0, referenceRect[len], arrowRect[len]);
91 + var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
92 + var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
93 + var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
94 + var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
95 + var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
96 + var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
97 + var tetherMax = offset + maxOffset - offsetModifierValue;
98 + var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);
99 + popperOffsets[mainAxis] = preventedOffset;
100 + data[mainAxis] = preventedOffset - offset;
101 + }
102 +
103 + if (checkAltAxis) {
104 + var _offsetModifierState$2;
105 +
106 + var _mainSide = mainAxis === 'x' ? top : left;
107 +
108 + var _altSide = mainAxis === 'x' ? bottom : right;
109 +
110 + var _offset = popperOffsets[altAxis];
111 +
112 + var _len = altAxis === 'y' ? 'height' : 'width';
113 +
114 + var _min = _offset + overflow[_mainSide];
115 +
116 + var _max = _offset - overflow[_altSide];
117 +
118 + var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
119 +
120 + var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
121 +
122 + var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
123 +
124 + var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
125 +
126 + var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
127 +
128 + popperOffsets[altAxis] = _preventedOffset;
129 + data[altAxis] = _preventedOffset - _offset;
130 + }
131 +
132 + state.modifiersData[name] = data;
133 +} // eslint-disable-next-line import/no-unused-modules
134 +
135 +
136 +export default {
137 + name: 'preventOverflow',
138 + enabled: true,
139 + phase: 'main',
140 + fn: preventOverflow,
141 + requiresIfExists: ['offset']
142 +};
...\ No newline at end of file ...\ No newline at end of file
1 +import { createPopper, popperGenerator, detectOverflow } from "./createPopper.js";
2 +// eslint-disable-next-line import/no-unused-modules
3 +export { createPopper, popperGenerator, detectOverflow };
...\ No newline at end of file ...\ No newline at end of file
1 +import { popperGenerator, detectOverflow } from "./createPopper.js";
2 +import eventListeners from "./modifiers/eventListeners.js";
3 +import popperOffsets from "./modifiers/popperOffsets.js";
4 +import computeStyles from "./modifiers/computeStyles.js";
5 +import applyStyles from "./modifiers/applyStyles.js";
6 +var defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles];
7 +var createPopper = /*#__PURE__*/popperGenerator({
8 + defaultModifiers: defaultModifiers
9 +}); // eslint-disable-next-line import/no-unused-modules
10 +
11 +export { createPopper, popperGenerator, defaultModifiers, detectOverflow };
...\ No newline at end of file ...\ No newline at end of file
1 +import { popperGenerator, detectOverflow } from "./createPopper.js";
2 +import eventListeners from "./modifiers/eventListeners.js";
3 +import popperOffsets from "./modifiers/popperOffsets.js";
4 +import computeStyles from "./modifiers/computeStyles.js";
5 +import applyStyles from "./modifiers/applyStyles.js";
6 +import offset from "./modifiers/offset.js";
7 +import flip from "./modifiers/flip.js";
8 +import preventOverflow from "./modifiers/preventOverflow.js";
9 +import arrow from "./modifiers/arrow.js";
10 +import hide from "./modifiers/hide.js";
11 +var defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];
12 +var createPopper = /*#__PURE__*/popperGenerator({
13 + defaultModifiers: defaultModifiers
14 +}); // eslint-disable-next-line import/no-unused-modules
15 +
16 +export { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules
17 +
18 +export { createPopper as createPopperLite } from "./popper-lite.js"; // eslint-disable-next-line import/no-unused-modules
19 +
20 +export * from "./modifiers/index.js";
...\ No newline at end of file ...\ No newline at end of file
1 +import getVariation from "./getVariation.js";
2 +import { variationPlacements, basePlacements, placements as allPlacements } from "../enums.js";
3 +import detectOverflow from "./detectOverflow.js";
4 +import getBasePlacement from "./getBasePlacement.js";
5 +export default function computeAutoPlacement(state, options) {
6 + if (options === void 0) {
7 + options = {};
8 + }
9 +
10 + var _options = options,
11 + placement = _options.placement,
12 + boundary = _options.boundary,
13 + rootBoundary = _options.rootBoundary,
14 + padding = _options.padding,
15 + flipVariations = _options.flipVariations,
16 + _options$allowedAutoP = _options.allowedAutoPlacements,
17 + allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;
18 + var variation = getVariation(placement);
19 + var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
20 + return getVariation(placement) === variation;
21 + }) : basePlacements;
22 + var allowedPlacements = placements.filter(function (placement) {
23 + return allowedAutoPlacements.indexOf(placement) >= 0;
24 + });
25 +
26 + if (allowedPlacements.length === 0) {
27 + allowedPlacements = placements;
28 +
29 + if (false) {
30 + console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(' '));
31 + }
32 + } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
33 +
34 +
35 + var overflows = allowedPlacements.reduce(function (acc, placement) {
36 + acc[placement] = detectOverflow(state, {
37 + placement: placement,
38 + boundary: boundary,
39 + rootBoundary: rootBoundary,
40 + padding: padding
41 + })[getBasePlacement(placement)];
42 + return acc;
43 + }, {});
44 + return Object.keys(overflows).sort(function (a, b) {
45 + return overflows[a] - overflows[b];
46 + });
47 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import getBasePlacement from "./getBasePlacement.js";
2 +import getVariation from "./getVariation.js";
3 +import getMainAxisFromPlacement from "./getMainAxisFromPlacement.js";
4 +import { top, right, bottom, left, start, end } from "../enums.js";
5 +export default function computeOffsets(_ref) {
6 + var reference = _ref.reference,
7 + element = _ref.element,
8 + placement = _ref.placement;
9 + var basePlacement = placement ? getBasePlacement(placement) : null;
10 + var variation = placement ? getVariation(placement) : null;
11 + var commonX = reference.x + reference.width / 2 - element.width / 2;
12 + var commonY = reference.y + reference.height / 2 - element.height / 2;
13 + var offsets;
14 +
15 + switch (basePlacement) {
16 + case top:
17 + offsets = {
18 + x: commonX,
19 + y: reference.y - element.height
20 + };
21 + break;
22 +
23 + case bottom:
24 + offsets = {
25 + x: commonX,
26 + y: reference.y + reference.height
27 + };
28 + break;
29 +
30 + case right:
31 + offsets = {
32 + x: reference.x + reference.width,
33 + y: commonY
34 + };
35 + break;
36 +
37 + case left:
38 + offsets = {
39 + x: reference.x - element.width,
40 + y: commonY
41 + };
42 + break;
43 +
44 + default:
45 + offsets = {
46 + x: reference.x,
47 + y: reference.y
48 + };
49 + }
50 +
51 + var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
52 +
53 + if (mainAxis != null) {
54 + var len = mainAxis === 'y' ? 'height' : 'width';
55 +
56 + switch (variation) {
57 + case start:
58 + offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
59 + break;
60 +
61 + case end:
62 + offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
63 + break;
64 +
65 + default:
66 + }
67 + }
68 +
69 + return offsets;
70 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function debounce(fn) {
2 + var pending;
3 + return function () {
4 + if (!pending) {
5 + pending = new Promise(function (resolve) {
6 + Promise.resolve().then(function () {
7 + pending = undefined;
8 + resolve(fn());
9 + });
10 + });
11 + }
12 +
13 + return pending;
14 + };
15 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import getClippingRect from "../dom-utils/getClippingRect.js";
2 +import getDocumentElement from "../dom-utils/getDocumentElement.js";
3 +import getBoundingClientRect from "../dom-utils/getBoundingClientRect.js";
4 +import computeOffsets from "./computeOffsets.js";
5 +import rectToClientRect from "./rectToClientRect.js";
6 +import { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from "../enums.js";
7 +import { isElement } from "../dom-utils/instanceOf.js";
8 +import mergePaddingObject from "./mergePaddingObject.js";
9 +import expandToHashMap from "./expandToHashMap.js"; // eslint-disable-next-line import/no-unused-modules
10 +
11 +export default function detectOverflow(state, options) {
12 + if (options === void 0) {
13 + options = {};
14 + }
15 +
16 + var _options = options,
17 + _options$placement = _options.placement,
18 + placement = _options$placement === void 0 ? state.placement : _options$placement,
19 + _options$boundary = _options.boundary,
20 + boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
21 + _options$rootBoundary = _options.rootBoundary,
22 + rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
23 + _options$elementConte = _options.elementContext,
24 + elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
25 + _options$altBoundary = _options.altBoundary,
26 + altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
27 + _options$padding = _options.padding,
28 + padding = _options$padding === void 0 ? 0 : _options$padding;
29 + var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
30 + var altContext = elementContext === popper ? reference : popper;
31 + var popperRect = state.rects.popper;
32 + var element = state.elements[altBoundary ? altContext : elementContext];
33 + var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
34 + var referenceClientRect = getBoundingClientRect(state.elements.reference);
35 + var popperOffsets = computeOffsets({
36 + reference: referenceClientRect,
37 + element: popperRect,
38 + strategy: 'absolute',
39 + placement: placement
40 + });
41 + var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
42 + var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
43 + // 0 or negative = within the clipping rect
44 +
45 + var overflowOffsets = {
46 + top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
47 + bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
48 + left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
49 + right: elementClientRect.right - clippingClientRect.right + paddingObject.right
50 + };
51 + var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
52 +
53 + if (elementContext === popper && offsetData) {
54 + var offset = offsetData[placement];
55 + Object.keys(overflowOffsets).forEach(function (key) {
56 + var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
57 + var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
58 + overflowOffsets[key] += offset[axis] * multiply;
59 + });
60 + }
61 +
62 + return overflowOffsets;
63 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function expandToHashMap(value, keys) {
2 + return keys.reduce(function (hashMap, key) {
3 + hashMap[key] = value;
4 + return hashMap;
5 + }, {});
6 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function format(str) {
2 + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
3 + args[_key - 1] = arguments[_key];
4 + }
5 +
6 + return [].concat(args).reduce(function (p, c) {
7 + return p.replace(/%s/, c);
8 + }, str);
9 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function getAltAxis(axis) {
2 + return axis === 'x' ? 'y' : 'x';
3 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function getAltLen(len) {
2 + return len === 'width' ? 'height' : 'width';
3 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import { auto } from "../enums.js";
2 +export default function getBasePlacement(placement) {
3 + return placement.split('-')[0];
4 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function getFreshSideObject() {
2 + return {
3 + top: 0,
4 + right: 0,
5 + bottom: 0,
6 + left: 0
7 + };
8 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function getMainAxisFromPlacement(placement) {
2 + return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
3 +}
...\ No newline at end of file ...\ No newline at end of file
1 +var hash = {
2 + left: 'right',
3 + right: 'left',
4 + bottom: 'top',
5 + top: 'bottom'
6 +};
7 +export default function getOppositePlacement(placement) {
8 + return placement.replace(/left|right|bottom|top/g, function (matched) {
9 + return hash[matched];
10 + });
11 +}
...\ No newline at end of file ...\ No newline at end of file
1 +var hash = {
2 + start: 'end',
3 + end: 'start'
4 +};
5 +export default function getOppositeVariationPlacement(placement) {
6 + return placement.replace(/start|end/g, function (matched) {
7 + return hash[matched];
8 + });
9 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function getVariation(placement) {
2 + return placement.split('-')[1];
3 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export var max = Math.max;
2 +export var min = Math.min;
3 +export var round = Math.round;
...\ No newline at end of file ...\ No newline at end of file
1 +export default function mergeByName(modifiers) {
2 + var merged = modifiers.reduce(function (merged, current) {
3 + var existing = merged[current.name];
4 + merged[current.name] = existing ? Object.assign({}, existing, current, {
5 + options: Object.assign({}, existing.options, current.options),
6 + data: Object.assign({}, existing.data, current.data)
7 + }) : current;
8 + return merged;
9 + }, {}); // IE11 does not support Object.values
10 +
11 + return Object.keys(merged).map(function (key) {
12 + return merged[key];
13 + });
14 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import getFreshSideObject from "./getFreshSideObject.js";
2 +export default function mergePaddingObject(paddingObject) {
3 + return Object.assign({}, getFreshSideObject(), paddingObject);
4 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import { modifierPhases } from "../enums.js"; // source: https://stackoverflow.com/questions/49875255
2 +
3 +function order(modifiers) {
4 + var map = new Map();
5 + var visited = new Set();
6 + var result = [];
7 + modifiers.forEach(function (modifier) {
8 + map.set(modifier.name, modifier);
9 + }); // On visiting object, check for its dependencies and visit them recursively
10 +
11 + function sort(modifier) {
12 + visited.add(modifier.name);
13 + var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
14 + requires.forEach(function (dep) {
15 + if (!visited.has(dep)) {
16 + var depModifier = map.get(dep);
17 +
18 + if (depModifier) {
19 + sort(depModifier);
20 + }
21 + }
22 + });
23 + result.push(modifier);
24 + }
25 +
26 + modifiers.forEach(function (modifier) {
27 + if (!visited.has(modifier.name)) {
28 + // check for visited object
29 + sort(modifier);
30 + }
31 + });
32 + return result;
33 +}
34 +
35 +export default function orderModifiers(modifiers) {
36 + // order based on dependencies
37 + var orderedModifiers = order(modifiers); // order based on phase
38 +
39 + return modifierPhases.reduce(function (acc, phase) {
40 + return acc.concat(orderedModifiers.filter(function (modifier) {
41 + return modifier.phase === phase;
42 + }));
43 + }, []);
44 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function rectToClientRect(rect) {
2 + return Object.assign({}, rect, {
3 + left: rect.x,
4 + top: rect.y,
5 + right: rect.x + rect.width,
6 + bottom: rect.y + rect.height
7 + });
8 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function uniqueBy(arr, fn) {
2 + var identifiers = new Set();
3 + return arr.filter(function (item) {
4 + var identifier = fn(item);
5 +
6 + if (!identifiers.has(identifier)) {
7 + identifiers.add(identifier);
8 + return true;
9 + }
10 + });
11 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import format from "./format.js";
2 +import { modifierPhases } from "../enums.js";
3 +var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';
4 +var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available';
5 +var VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options'];
6 +export default function validateModifiers(modifiers) {
7 + modifiers.forEach(function (modifier) {
8 + [].concat(Object.keys(modifier), VALID_PROPERTIES) // IE11-compatible replacement for `new Set(iterable)`
9 + .filter(function (value, index, self) {
10 + return self.indexOf(value) === index;
11 + }).forEach(function (key) {
12 + switch (key) {
13 + case 'name':
14 + if (typeof modifier.name !== 'string') {
15 + console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', "\"" + String(modifier.name) + "\""));
16 + }
17 +
18 + break;
19 +
20 + case 'enabled':
21 + if (typeof modifier.enabled !== 'boolean') {
22 + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\""));
23 + }
24 +
25 + break;
26 +
27 + case 'phase':
28 + if (modifierPhases.indexOf(modifier.phase) < 0) {
29 + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\""));
30 + }
31 +
32 + break;
33 +
34 + case 'fn':
35 + if (typeof modifier.fn !== 'function') {
36 + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', "\"" + String(modifier.fn) + "\""));
37 + }
38 +
39 + break;
40 +
41 + case 'effect':
42 + if (modifier.effect != null && typeof modifier.effect !== 'function') {
43 + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\""));
44 + }
45 +
46 + break;
47 +
48 + case 'requires':
49 + if (modifier.requires != null && !Array.isArray(modifier.requires)) {
50 + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\""));
51 + }
52 +
53 + break;
54 +
55 + case 'requiresIfExists':
56 + if (!Array.isArray(modifier.requiresIfExists)) {
57 + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', "\"" + String(modifier.requiresIfExists) + "\""));
58 + }
59 +
60 + break;
61 +
62 + case 'options':
63 + case 'data':
64 + break;
65 +
66 + default:
67 + console.error("PopperJS: an invalid property has been provided to the \"" + modifier.name + "\" modifier, valid properties are " + VALID_PROPERTIES.map(function (s) {
68 + return "\"" + s + "\"";
69 + }).join(', ') + "; but \"" + key + "\" was provided.");
70 + }
71 +
72 + modifier.requires && modifier.requires.forEach(function (requirement) {
73 + if (modifiers.find(function (mod) {
74 + return mod.name === requirement;
75 + }) == null) {
76 + console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));
77 + }
78 + });
79 + });
80 + });
81 +}
...\ No newline at end of file ...\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.