@newlogic-digital/ui 3.0.3 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -22
- package/package.json +25 -14
- package/src/{main.json → data/main.json} +13 -11
- package/src/emails/email.css +3 -3
- package/src/emails/email.twig +1 -1
- package/src/icons.svg +32 -0
- package/src/scripts/Components/+.js +1 -2
- package/src/scripts/Components/CookieConsent.js +68 -64
- package/src/scripts/Layout/+.js +2 -1
- package/src/scripts/Layout/Header.js +18 -0
- package/src/scripts/Layout/Main.js +49 -45
- package/src/scripts/Libraries/+.js +13 -10
- package/src/scripts/Libraries/Anchor.js +18 -43
- package/src/scripts/Libraries/CookieConsent.js +42 -57
- package/src/scripts/Libraries/Dialog.js +56 -55
- package/src/scripts/Libraries/Drawer.js +23 -23
- package/src/scripts/Libraries/Form.js +37 -0
- package/src/scripts/Libraries/NativeSlider.js +86 -86
- package/src/scripts/Libraries/ReCaptcha.js +20 -18
- package/src/scripts/Libraries/Ripple.js +16 -32
- package/src/scripts/Libraries/Script.js +19 -0
- package/src/scripts/Libraries/Stimulus.js +30 -34
- package/src/scripts/Libraries/Swup.js +45 -55
- package/src/scripts/Libraries/Tabs.js +12 -18
- package/src/scripts/Libraries/Tippy.js +118 -0
- package/src/scripts/Ui/+.js +5 -3
- package/src/scripts/Ui/Checkbox.js +19 -0
- package/src/scripts/Ui/Input.js +188 -161
- package/src/scripts/Ui/Radio.js +23 -0
- package/src/scripts/Ui/Select.js +64 -37
- package/src/scripts/Ui/Text.js +25 -0
- package/src/scripts/Utils/+.js +3 -0
- package/src/scripts/Utils/Functions/+.js +6 -6
- package/src/scripts/Utils/Functions/dataValue.js +28 -25
- package/src/scripts/Utils/Functions/importScript.js +9 -11
- package/src/scripts/Utils/Functions/importStyle.js +18 -5
- package/src/scripts/Utils/Functions/inView.js +19 -21
- package/src/scripts/Utils/Functions/loadStimulus.js +22 -20
- package/src/scripts/Utils/Functions/replaceTag.js +12 -0
- package/src/scripts/Utils/cdn.js +6 -4
- package/src/scripts/Utils/global.js +10 -33
- package/src/scripts/main.js +6 -6
- package/src/styles/Components/CookieConsent.css +40 -179
- package/src/styles/Components/Dialog/Default.css +12 -15
- package/src/styles/Components/Form/CookieConsent.css +7 -12
- package/src/styles/Layout/+.css +2 -0
- package/src/styles/Layout/Header.css +54 -0
- package/src/styles/Layout/Main.css +28 -63
- package/src/styles/Layout/Nav.css +43 -0
- package/src/styles/Libraries/+.css +1 -1
- package/src/styles/Libraries/Datepicker.css +85 -39
- package/src/styles/Libraries/Dialog.css +6 -5
- package/src/styles/Libraries/Drawer.css +15 -14
- package/src/styles/Libraries/Hint.css +29 -23
- package/src/styles/Libraries/Lazysizes.css +2 -1
- package/src/styles/Libraries/NativeSlider.css +19 -18
- package/src/styles/Libraries/Ripple.css +8 -5
- package/src/styles/Libraries/Tabs.css +4 -4
- package/src/styles/Libraries/Tippy.css +87 -0
- package/src/styles/Ui/+.css +5 -1
- package/src/styles/Ui/Badge.css +33 -19
- package/src/styles/Ui/Btn.css +80 -53
- package/src/styles/Ui/Checkbox.css +80 -41
- package/src/styles/Ui/Dropdown.css +5 -0
- package/src/styles/Ui/Heading.css +12 -12
- package/src/styles/Ui/Icon.css +27 -8
- package/src/styles/Ui/Image.css +23 -0
- package/src/styles/Ui/Input.css +295 -220
- package/src/styles/Ui/Label.css +14 -0
- package/src/styles/Ui/Link.css +3 -3
- package/src/styles/Ui/Notice.css +14 -16
- package/src/styles/Ui/Progress.css +10 -21
- package/src/styles/Ui/Radio.css +3 -8
- package/src/styles/Ui/Select.css +63 -112
- package/src/styles/Ui/Switch.css +70 -0
- package/src/styles/Ui/{Wsw.css → Text.css} +61 -80
- package/src/styles/Ui/Title.css +8 -4
- package/src/styles/Utils/+.css +9 -0
- package/src/styles/Utils/default.css +75 -67
- package/src/styles/Utils/icons.css +9 -0
- package/src/styles/Utils/keyframes.css +182 -0
- package/src/styles/Utils/normalize.css +223 -0
- package/src/styles/Utils/print.css +1 -1
- package/src/styles/Utils/tailwind/+.css +2 -0
- package/src/styles/Utils/tailwind/base.css +15 -0
- package/src/styles/Utils/tailwind/gutters.css +264 -263
- package/src/styles/Utils/theme/+.css +1 -0
- package/src/styles/Utils/theme/main.css +24 -21
- package/src/styles/Utils/vars.css +58 -35
- package/src/styles/Utils/vendor.css +1 -2
- package/src/styles/main.css +8 -3
- package/src/templates/Components/CookieConsent.twig +30 -0
- package/src/templates/Components/Dialogs/Basic.twig +7 -3
- package/src/templates/Layout/Header.twig +42 -0
- package/src/templates/Layout/Main.twig +52 -67
- package/src/templates/Sections/Gdpr.twig +64 -0
- package/src/templates/Sections/Ui.twig +2093 -0
- package/src/views/dialog-basic.json.twig +3 -0
- package/src/views/gdpr.json +11 -0
- package/src/views/index.json +12 -0
- package/src/views/json-tippy.json.twig +16 -0
- package/src/views/ui.json +11 -0
- package/vite.config.js +6 -0
- package/CHANGELOG +0 -231
- package/gulpfile.js +0 -192
- package/src/icons/iconfont.css +0 -171
- package/src/icons/selection.json +0 -1
- package/src/icons/variables.css +0 -31
- package/src/scripts/Components/Form.js +0 -26
- package/src/scripts/Ui/Wsw.js +0 -25
- package/src/scripts/Utils/Functions/bodyLoaded.js +0 -12
- package/src/styles/Libraries/Animate.css +0 -184
- package/src/styles/Utils/reference.css +0 -2
- package/src/styles/Utils/tailwind/content.css +0 -24
- package/src/styles/Utils/theme/vars.css +0 -19
- package/src/styles/preload.css +0 -29
- package/src/styles/tailwind.css +0 -5
- package/src/templates/Sections/.gitkeep +0 -0
- package/src/templates/dialog-basic.twig +0 -3
- package/src/templates/index.json +0 -6
package/README.md
CHANGED
|
@@ -10,9 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
# 🎨 Newlogic UI
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Modern and modular CSS framework with the best principles.
|
|
13
|
+
Lightweight, modern and modular CSS framework with the best principles
|
|
16
14
|
|
|
17
15
|
- 💡 Modern
|
|
18
16
|
- 📦 Modular
|
|
@@ -20,11 +18,14 @@ Modern and modular CSS framework with the best principles.
|
|
|
20
18
|
- ✨️ Progressive
|
|
21
19
|
- ⚡️ Fast
|
|
22
20
|
|
|
23
|
-
Newlogic UI is component framework with
|
|
21
|
+
Newlogic UI is component framework with easy syntax. Modern approach of CSS properties, enriched with utility classes from Tailwind. Inspired by favourite frameworks like Boostrap and Bulma
|
|
22
|
+
|
|
23
|
+
Javascript implementation is mainly intended for use on backend rendered websites and applications such as with PHP
|
|
24
24
|
|
|
25
25
|
## ⚙️ Under the hood
|
|
26
|
-
* **[
|
|
27
|
-
* **[
|
|
26
|
+
* **[Vituum](https://vituum.dev/)** - a small wrapper around Vite, adds support of template engines and more
|
|
27
|
+
* **[Newlogic Core](https://github.com/newlogic-digital/core)** - integration for Vituum, adds pre-defined config of integrations and more
|
|
28
|
+
* **[ESM](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules)** - completely written in modern JS syntax - ES8+, ES module, etc.
|
|
28
29
|
* **[PostCSS](https://postcss.org/)** - completely written in modern CSS syntax - nesting, variables, etc.
|
|
29
30
|
* **[Tailwind CSS](https://tailwindcss.com/)** - rich utility classes for everything
|
|
30
31
|
* **[Stimulus](https://stimulus.hotwire.dev/)** - a modest JavaScript framework for the HTML you already have
|
|
@@ -32,53 +33,50 @@ Newlogic UI is component framework with simple syntax. Inspired by popular frame
|
|
|
32
33
|
* **Easy syntax** - .ui-btn (ui elements), .c-component (components), .c-section (sections) etc.
|
|
33
34
|
|
|
34
35
|
|
|
35
|
-
The core of the Newlogic UI is Newlogic Core, which compiles modern JS and CSS
|
|
36
|
+
The core of the Newlogic UI is Vituum with Newlogic Core, which compiles modern JS and CSS syntax and contains other tools for web development. Source code can be used with any other tools or even different environment than NodeJS, eg. Deno and is written in W3C standards and should be runnable in current or future version of browsers. The framework is modular, and you can really use only what is needed for your project.
|
|
36
37
|
|
|
37
|
-
## 🪄
|
|
38
|
+
## 🪄 Get started
|
|
38
39
|
|
|
39
|
-
Creating a new project (using
|
|
40
|
+
Creating a new project (using Vituum)
|
|
40
41
|
```sh
|
|
41
42
|
$ git clone --depth 1 https://github.com/newlogic-digital/ui.git newlogic-ui-project
|
|
42
43
|
$ cd newlogic-ui-project && npm i
|
|
43
44
|
```
|
|
44
45
|
```sh
|
|
45
|
-
$
|
|
46
|
+
$ vite
|
|
46
47
|
```
|
|
47
48
|
or
|
|
48
49
|
```sh
|
|
49
|
-
$
|
|
50
|
+
$ vituum build
|
|
50
51
|
```
|
|
51
52
|
___
|
|
52
53
|
Or in any other environment
|
|
53
54
|
```sh
|
|
54
|
-
$ npm i @newlogic-
|
|
55
|
+
$ npm i @newlogic-digital/ui
|
|
55
56
|
```
|
|
56
57
|
|
|
57
58
|
```css
|
|
58
59
|
/* main.css or individual modules */
|
|
59
|
-
@import "node_modules/@newlogic/ui/src/
|
|
60
|
-
@import "node_modules/@newlogic/ui/src/styles/main.css"
|
|
60
|
+
@import "node_modules/@newlogic-digital/ui/src/styles/main.css"
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
```js
|
|
64
64
|
/* main.js or individual modules */
|
|
65
|
-
import "node_modules/@newlogic/ui/src/scripts/main.js"
|
|
65
|
+
import "node_modules/@newlogic-digital/ui/src/scripts/main.js"
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
### Requirements
|
|
69
69
|
|
|
70
|
-
- [Node.js LTS (
|
|
71
|
-
- [NPM (7.x)](https://www.npmjs.com/package/npm) or
|
|
70
|
+
- [Node.js LTS (16.x)](https://nodejs.org/en/download/)
|
|
71
|
+
- [NPM (7.x)](https://www.npmjs.com/package/npm) or any other package manager
|
|
72
72
|
|
|
73
73
|
### Config
|
|
74
74
|
|
|
75
|
-
Each
|
|
75
|
+
Each Vituum project has to have config via `vite.config.js`, docs - [vituum.dev](https://vituum.dev)
|
|
76
76
|
|
|
77
77
|
## 📌 Future plans
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
- upgrading form elements
|
|
81
|
-
- new elements - dropdown, notificaton, snack and more
|
|
78
|
+
- support for new modern web features `:has`, `<dialog>`
|
|
79
|
+
- performance optimization
|
|
82
80
|
|
|
83
81
|
## Licence
|
|
84
82
|
GNU GPLv3
|
package/package.json
CHANGED
|
@@ -1,31 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newlogic-digital/ui",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "vite.config.js",
|
|
6
6
|
"author": "New Logic Studio s.r.o.",
|
|
7
|
-
"description": "
|
|
7
|
+
"description": "Lightweight, modern and modular CSS framework with the best principles",
|
|
8
8
|
"license": "GNU GPLv3",
|
|
9
|
-
"
|
|
9
|
+
"scripts": {
|
|
10
|
+
"dev": "vite",
|
|
11
|
+
"preview": "vite preview",
|
|
12
|
+
"build": "vituum build",
|
|
13
|
+
"build:headless": "vituum headless",
|
|
14
|
+
"cleanup": "vituum cleanup",
|
|
15
|
+
"eslint": "eslint 'src/scripts/**/*.js'",
|
|
16
|
+
"eslint:fix": "eslint 'src/scripts/**/*.js' --fix",
|
|
17
|
+
"stylelint": "stylelint 'src/styles/**/*.css'",
|
|
18
|
+
"stylelint:fix": "stylelint 'src/styles/**/*.css' --fix"
|
|
19
|
+
},
|
|
10
20
|
"dependencies": {
|
|
11
|
-
"@simonwep/pickr": "^1.8.
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"vanillajs-datepicker": "^1.
|
|
21
|
+
"@simonwep/pickr": "^1.8.2",
|
|
22
|
+
"@hotwired/stimulus": "3.1.0",
|
|
23
|
+
"swup": "2.0.19",
|
|
24
|
+
"tippy.js": "^6.3.7",
|
|
25
|
+
"vanillajs-datepicker": "^1.2.0"
|
|
16
26
|
},
|
|
17
27
|
"devDependencies": {
|
|
18
|
-
"@newlogic-digital/core": "^0.
|
|
19
|
-
"
|
|
28
|
+
"@newlogic-digital/core": "^1.0.0",
|
|
29
|
+
"vituum": "^0.0.28",
|
|
30
|
+
"eslint-config-standard": "^17.0.0",
|
|
31
|
+
"stylelint-config-standard": "^28.0.0"
|
|
20
32
|
},
|
|
21
33
|
"files": [
|
|
22
34
|
"src",
|
|
23
35
|
"gulpfile.js"
|
|
24
36
|
],
|
|
25
37
|
"engines": {
|
|
26
|
-
"node": ">=
|
|
27
|
-
"npm": ">=7.10.0"
|
|
28
|
-
"yarn": ">=2.3.0"
|
|
38
|
+
"node": ">=16.0.0",
|
|
39
|
+
"npm": ">=7.10.0"
|
|
29
40
|
},
|
|
30
41
|
"repository": {
|
|
31
42
|
"type": "git",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
+
"template": "templates/Layout/Main.twig",
|
|
2
3
|
"prefetch": [
|
|
3
4
|
"https://cdn.jsdelivr.net",
|
|
4
5
|
"https://fonts.gstatic.com",
|
|
@@ -8,27 +9,28 @@
|
|
|
8
9
|
"css": {
|
|
9
10
|
"all": [
|
|
10
11
|
"/src/styles/main.css",
|
|
11
|
-
"https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=block"
|
|
12
|
-
"/src/icons/iconfont.css"
|
|
12
|
+
"https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=block"
|
|
13
13
|
],
|
|
14
|
-
"preload": "/src/styles/preload.css",
|
|
15
14
|
"tailwind": "/temp/tailwind.css",
|
|
16
|
-
"tailwind.src": "/src/styles/tailwind.css"
|
|
15
|
+
"tailwind.src": "/src/styles/tailwind.css",
|
|
16
|
+
"ratio": "/temp/ratio.css"
|
|
17
17
|
},
|
|
18
18
|
"js": {
|
|
19
19
|
"importmap": "/public/importmap.json",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"lazysizes": "https://cdn.jsdelivr.net/npm/lazysizes@5.2.2/lazysizes.min.js"
|
|
20
|
+
"main": "/src/scripts/main.js",
|
|
21
|
+
"lazysizes": "https://cdn.jsdelivr.net/npm/lazysizes@5.3.2/lazysizes.min.js"
|
|
23
22
|
}
|
|
24
23
|
},
|
|
25
24
|
"layout": {
|
|
26
|
-
"
|
|
27
|
-
"cookies": true,
|
|
25
|
+
"cookies": false,
|
|
28
26
|
"nav": [
|
|
29
27
|
{
|
|
30
|
-
"name": "
|
|
28
|
+
"name": "Home",
|
|
31
29
|
"url": "/"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "Documentation",
|
|
33
|
+
"url": "/ui"
|
|
32
34
|
}
|
|
33
35
|
]
|
|
34
36
|
},
|
|
@@ -47,4 +49,4 @@
|
|
|
47
49
|
"8x5": "data:image/gif;base64,R0lGODlhCAAFAIAAAP///wAAACwAAAAACAAFAAACBYSPqctYADs=",
|
|
48
50
|
"3x2": "data:image/gif;base64,R0lGODlhAwACAIAAAP///wAAACwAAAAAAwACAAACAoRfADs="
|
|
49
51
|
}
|
|
50
|
-
}
|
|
52
|
+
}
|
package/src/emails/email.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@import "../styles/Utils/theme/main.css";
|
|
2
2
|
|
|
3
3
|
:root {
|
|
4
|
-
--width
|
|
4
|
+
--width: 660px;
|
|
5
5
|
--container: 30px;
|
|
6
6
|
}
|
|
7
7
|
|
|
@@ -72,6 +72,6 @@ p {
|
|
|
72
72
|
|
|
73
73
|
@media print {
|
|
74
74
|
* {
|
|
75
|
-
-webkit-print-color-adjust:exact;
|
|
75
|
+
-webkit-print-color-adjust: exact;
|
|
76
76
|
}
|
|
77
|
-
}
|
|
77
|
+
}
|
package/src/emails/email.twig
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]-->
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
8
8
|
<style type="text/css" n:syntax="off">
|
|
9
|
-
|
|
9
|
+
@import './email.css';
|
|
10
10
|
</style>
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
package/src/icons.svg
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<svg hidden="">
|
|
2
|
+
<symbol id="icon-chevron-left" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
3
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
|
|
4
|
+
</symbol>
|
|
5
|
+
<symbol id="icon-chevron-right" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
6
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
|
7
|
+
</symbol>
|
|
8
|
+
<symbol id="icon-angle-down" fill="currentColor" viewBox="0 0 24 24" stroke="currentColor">
|
|
9
|
+
<path d="M10.998 15.467c.491.71 1.513.71 2.004 0l3.767-5.453c.581-.843 0-2.013-1.002-2.014H8.234C7.232 8 6.65 9.17 7.231 10.014z" />
|
|
10
|
+
</symbol>
|
|
11
|
+
<symbol id="icon-angle-up" fill="currentColor" viewBox="0 0 24 24" stroke="currentColor">
|
|
12
|
+
<path d="M10.998 15.467c.491.71 1.513.71 2.004 0l3.767-5.453c.581-.843 0-2.013-1.002-2.014H8.234C7.232 8 6.65 9.17 7.231 10.014z" style="transform: scaleY(-1) translateY(1px); transform-origin: 50% 50%;" />
|
|
13
|
+
</symbol>
|
|
14
|
+
<symbol id="icon-exclamation-circle" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
15
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
16
|
+
</symbol>
|
|
17
|
+
<symbol id="icon-x" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
18
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.75" d="M6 18L18 6M6 6l12 12" />
|
|
19
|
+
</symbol>
|
|
20
|
+
<symbol id="icon-menu" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
21
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
|
|
22
|
+
</symbol>
|
|
23
|
+
<symbol id="icon-moon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
24
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z" />
|
|
25
|
+
</symbol>
|
|
26
|
+
<symbol id="icon-sun" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
27
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z" />
|
|
28
|
+
</symbol>
|
|
29
|
+
<symbol id="icon-at-symbol" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
30
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 12a4 4 0 10-8 0 4 4 0 008 0zm0 0v1.5a2.5 2.5 0 005 0V12a9 9 0 10-9 9m4.5-1.206a8.959 8.959 0 01-4.5 1.207" />
|
|
31
|
+
</symbol>
|
|
32
|
+
</svg>
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import './CookieConsent.js'
|
|
2
|
-
import './Form.js';
|
|
1
|
+
import './CookieConsent.js'
|
|
@@ -1,80 +1,84 @@
|
|
|
1
|
-
import {LibStimulus, Controller} from
|
|
2
|
-
import LibCookieConsent from
|
|
1
|
+
import { LibStimulus, Controller } from '../Libraries/Stimulus.js'
|
|
2
|
+
import LibCookieConsent from '../Libraries/CookieConsent.js'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
LibStimulus.register("c-cookieconsent", class extends Controller {
|
|
4
|
+
LibStimulus.register('c-cookieconsent', class extends Controller {
|
|
7
5
|
connect() {
|
|
8
|
-
const selector = this.element
|
|
6
|
+
const selector = this.element
|
|
7
|
+
|
|
8
|
+
if (document.querySelector('.c-form-cookieconsent') !== null) {
|
|
9
|
+
return
|
|
10
|
+
}
|
|
9
11
|
|
|
10
|
-
if (
|
|
12
|
+
if (LibCookieConsent.getItem('lib-cookieconsent') === null || parseInt(LibCookieConsent.getItem('lib-cookieconsent-expire')) < Date.now()) {
|
|
11
13
|
setTimeout(() => {
|
|
12
|
-
selector._addDataValue(
|
|
13
|
-
selector.classList.add(
|
|
14
|
-
},1500)
|
|
14
|
+
selector._addDataValue('state', 'active')
|
|
15
|
+
selector.classList.add('is-animate')
|
|
16
|
+
}, 1500)
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
selector.addEventListener(
|
|
18
|
-
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
selector.querySelector(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
setTimeout(function(){
|
|
36
|
-
selector._removeDataValue("state", "active");
|
|
37
|
-
selector.remove();
|
|
38
|
-
},500);
|
|
39
|
-
});
|
|
19
|
+
selector.querySelector('[data-lib-cookieconsent-approve]').addEventListener('click', () => {
|
|
20
|
+
this.hide(['performance', 'marketing'])
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
selector.querySelector('[data-lib-cookieconsent-decline]').addEventListener('click', () => {
|
|
24
|
+
this.hide([])
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
hide(type) {
|
|
29
|
+
LibCookieConsent.set(type)
|
|
30
|
+
this.element.classList.remove('is-animate')
|
|
31
|
+
|
|
32
|
+
setTimeout(() => {
|
|
33
|
+
this.element._removeDataValue('state', 'active')
|
|
34
|
+
this.element.remove()
|
|
35
|
+
}, 500)
|
|
40
36
|
}
|
|
41
|
-
})
|
|
37
|
+
})
|
|
42
38
|
|
|
43
|
-
LibStimulus.register(
|
|
39
|
+
LibStimulus.register('c-form-cookieconsent', class extends Controller {
|
|
44
40
|
connect() {
|
|
45
|
-
const selector = this.element
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
41
|
+
const selector = this.element
|
|
42
|
+
const type = LibCookieConsent.getItem('lib-cookieconsent')
|
|
43
|
+
const modal = document.querySelector('.c-cookieconsent')
|
|
44
|
+
|
|
45
|
+
if (modal) {
|
|
46
|
+
modal.classList.remove('is-animate')
|
|
47
|
+
modal._removeDataValue('state', 'active')
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (type !== null) {
|
|
51
|
+
this.element.querySelectorAll('input:not([disabled])').forEach(input => {
|
|
52
|
+
input.checked = false
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
JSON.parse(type).forEach(type => {
|
|
56
|
+
if (selector.querySelector(`input[value="${type}"]`) !== null) {
|
|
57
|
+
selector.querySelector(`input[value="${type}"]`).checked = true
|
|
58
58
|
}
|
|
59
|
-
}
|
|
60
|
-
selector.querySelector(`input[value="decline"]`).checked = true;
|
|
61
|
-
}
|
|
59
|
+
})
|
|
62
60
|
}
|
|
63
61
|
|
|
64
|
-
selector.addEventListener(
|
|
65
|
-
e.preventDefault()
|
|
62
|
+
selector.addEventListener('submit', e => {
|
|
63
|
+
e.preventDefault()
|
|
64
|
+
|
|
65
|
+
const type = []
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
this.element.querySelectorAll('input:not([disabled])').forEach(input => {
|
|
68
|
+
input.checked && type.push(input.value)
|
|
69
|
+
})
|
|
68
70
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
location.reload();
|
|
72
|
-
} else if (value === "performance") {
|
|
73
|
-
LibCookieConsent.set("performance");
|
|
74
|
-
location.reload();
|
|
75
|
-
} else if (value === "decline") {
|
|
76
|
-
LibCookieConsent.set("decline", () => location.reload());
|
|
77
|
-
}
|
|
71
|
+
LibCookieConsent.set(type)
|
|
72
|
+
location.reload()
|
|
78
73
|
})
|
|
79
74
|
}
|
|
80
|
-
|
|
75
|
+
|
|
76
|
+
disconnect() {
|
|
77
|
+
const modal = document.querySelector('.c-cookieconsent')
|
|
78
|
+
|
|
79
|
+
if (modal && (LibCookieConsent.getItem('lib-cookieconsent') === null || parseInt(LibCookieConsent.getItem('lib-cookieconsent-expire')) < Date.now())) {
|
|
80
|
+
modal._addDataValue('state', 'active')
|
|
81
|
+
modal.classList.add('is-animate')
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
})
|
package/src/scripts/Layout/+.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import './
|
|
1
|
+
import './Header.js'
|
|
2
|
+
import './Main.js'
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LibStimulus, Controller, getController } from '../Libraries/Stimulus.js'
|
|
2
|
+
|
|
3
|
+
LibStimulus.register('l-header', class extends Controller {
|
|
4
|
+
connect() {
|
|
5
|
+
if (document.querySelector('#l-nav') === null) {
|
|
6
|
+
this.element.insertAdjacentHTML('afterend', '<div id="l-nav" class="lib-drawer" data-lib-drawer-target="nav" data-action="scroll->lib-drawer#scroll"><div class="wrp_nav"><div class="wrp_nav_head"></div><div class="wrp_nav_body"></div></div></div>')
|
|
7
|
+
|
|
8
|
+
getController(document.body, 'lib-drawer').init()
|
|
9
|
+
|
|
10
|
+
const layoutNav = document.querySelector('#l-nav')
|
|
11
|
+
const logo = this.element.querySelector('.elm_header_logo').outerHTML
|
|
12
|
+
const nav = this.element.querySelector('.elm_header_nav').outerHTML
|
|
13
|
+
|
|
14
|
+
layoutNav.querySelector('.wrp_nav_head').insertAdjacentHTML('beforeend', logo)
|
|
15
|
+
layoutNav.querySelector('.wrp_nav_body').insertAdjacentHTML('beforeend', nav)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
})
|
|
@@ -1,76 +1,80 @@
|
|
|
1
|
-
import {LibStimulus, Controller, loadStimulus} from
|
|
2
|
-
import {
|
|
3
|
-
import LibRipple from
|
|
4
|
-
import LibAnchor from
|
|
5
|
-
import LibDialog from
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
1
|
+
import { LibStimulus, Controller, loadStimulus } from '../Libraries/Stimulus.js'
|
|
2
|
+
import { importScript } from '../Utils/Functions/+.js'
|
|
3
|
+
import LibRipple from '../Libraries/Ripple.js'
|
|
4
|
+
import LibAnchor from '../Libraries/Anchor.js'
|
|
5
|
+
import LibDialog from '../Libraries/Dialog.js'
|
|
6
|
+
import LibTippy from '../Libraries/Tippy.js'
|
|
7
|
+
import LibTabs from '../Libraries/Tabs.js'
|
|
8
|
+
import LibNativeSlider from '../Libraries/NativeSlider.js'
|
|
9
|
+
import cdn from '../Utils/cdn.js'
|
|
10
|
+
|
|
11
|
+
LibStimulus.register('lib', class extends Controller {
|
|
12
|
+
connect() {
|
|
13
|
+
if (!('scrollBehavior' in document.documentElement.style)) {
|
|
14
|
+
importScript(cdn.seamless).then(() => window.seamless.polyfill())
|
|
15
|
+
}
|
|
16
|
+
}
|
|
9
17
|
|
|
10
|
-
LibStimulus.register("lib", class extends Controller {
|
|
11
18
|
ripple(e) {
|
|
12
|
-
LibRipple(e
|
|
19
|
+
LibRipple(e)
|
|
13
20
|
}
|
|
14
21
|
|
|
15
22
|
anchor(e) {
|
|
16
|
-
e.preventDefault()
|
|
23
|
+
e.preventDefault()
|
|
17
24
|
LibAnchor.action(e.currentTarget)
|
|
18
25
|
}
|
|
19
26
|
|
|
20
|
-
darkMode(
|
|
21
|
-
let currentTarget = e.currentTarget;
|
|
22
|
-
|
|
27
|
+
darkMode() {
|
|
23
28
|
if (document.documentElement.classList.contains('dark')) {
|
|
24
|
-
localStorage.theme = 'light'
|
|
25
|
-
document.documentElement.classList.remove('dark')
|
|
26
|
-
currentTarget.classList.remove("icon-light");
|
|
29
|
+
localStorage.theme = 'light'
|
|
30
|
+
document.documentElement.classList.remove('dark')
|
|
27
31
|
} else {
|
|
28
|
-
localStorage.theme = 'dark'
|
|
29
|
-
document.documentElement.classList.add('dark')
|
|
30
|
-
currentTarget.classList.add("icon-light");
|
|
32
|
+
localStorage.theme = 'dark'
|
|
33
|
+
document.documentElement.classList.add('dark')
|
|
31
34
|
}
|
|
32
35
|
}
|
|
33
|
-
})
|
|
36
|
+
})
|
|
34
37
|
|
|
35
|
-
LibStimulus.register(
|
|
36
|
-
connect() {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (typeof element.dataset.libDialogOpen !== "undefined") {
|
|
40
|
-
let url = element.getAttribute("data-action-url");
|
|
38
|
+
LibStimulus.register('lib-dialog', class extends Controller {
|
|
39
|
+
async connect() {
|
|
40
|
+
if (this.element.getAttribute('data-lib-dialog-open')) {
|
|
41
|
+
const url = this.element.getAttribute('data-action-url')
|
|
41
42
|
|
|
42
43
|
if (url) {
|
|
43
|
-
LibDialog.action(element, url, () => loadStimulus(document.querySelector(
|
|
44
|
+
await LibDialog.action(this.element, url, () => loadStimulus(document.querySelector('.lib-dialog')))
|
|
44
45
|
} else {
|
|
45
|
-
LibDialog.show(document.querySelector(element.
|
|
46
|
+
await LibDialog.show(document.querySelector(this.element.getAttribute('data-lib-dialog-open')).innerHTML, () => loadStimulus(document.querySelector('.lib-dialog')))
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
show(
|
|
51
|
-
|
|
52
|
-
let url = element.getAttribute("data-action-url");
|
|
51
|
+
async show({ currentTarget }) {
|
|
52
|
+
const url = currentTarget.getAttribute('data-action-url')
|
|
53
53
|
|
|
54
|
-
LibDialog.action(
|
|
54
|
+
await LibDialog.action(currentTarget, url)
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
hide() {
|
|
58
|
-
LibDialog.hide()
|
|
57
|
+
async hide() {
|
|
58
|
+
await LibDialog.hide()
|
|
59
59
|
}
|
|
60
|
-
})
|
|
60
|
+
})
|
|
61
61
|
|
|
62
|
-
LibStimulus.register(
|
|
62
|
+
LibStimulus.register('lib-tabs', class extends Controller {
|
|
63
63
|
connect() {
|
|
64
|
-
LibTabs(this.element)
|
|
64
|
+
LibTabs(this.element)
|
|
65
65
|
}
|
|
66
|
-
})
|
|
66
|
+
})
|
|
67
67
|
|
|
68
|
-
LibStimulus.register(
|
|
68
|
+
LibStimulus.register('lib-ns', class extends Controller {
|
|
69
69
|
connect() {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
LibNativeSlider(this.element.querySelector('[data-lib-ns]'), this.element)
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
LibStimulus.register('lib-tippy', class extends Controller {
|
|
75
|
+
connect() {
|
|
76
|
+
const attributes = this.element.getAttribute('data-lib-tippy')
|
|
73
77
|
|
|
74
|
-
|
|
78
|
+
new LibTippy(this.element, attributes !== null ? attributes.replace(/\s/g, '').split(',') : undefined)
|
|
75
79
|
}
|
|
76
|
-
})
|
|
80
|
+
})
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
export { default as Anchor } from './Anchor.js'
|
|
2
|
-
export { default as CookieConsent } from './CookieConsent.js'
|
|
3
|
-
export { default as Dialog } from './Dialog.js'
|
|
4
|
-
import './Drawer.js'
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
export { default as Anchor } from './Anchor.js'
|
|
2
|
+
export { default as CookieConsent } from './CookieConsent.js'
|
|
3
|
+
export { default as Dialog } from './Dialog.js'
|
|
4
|
+
import './Drawer.js'
|
|
5
|
+
import './Form.js'
|
|
6
|
+
export { default as NativeSlider } from './NativeSlider.js'
|
|
7
|
+
import './ReCaptcha.js'
|
|
8
|
+
export { default as Ripple } from './Ripple.js'
|
|
9
|
+
import './Script.js'
|
|
10
|
+
import './Stimulus.js'
|
|
11
|
+
export { default as Swup } from './Swup.js'
|
|
12
|
+
export { default as Tabs } from './Tabs.js'
|
|
13
|
+
export { default as Tippy } from './Tippy.js'
|