@newlogic-digital/ui 3.4.2 → 3.7.5
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 +21 -15
- package/package.json +32 -24
- package/src/data/main.json +25 -15
- package/src/emails/styles/main/+.css +3 -0
- package/src/emails/styles/main/Base/+.css +2 -0
- package/src/emails/styles/main/Base/config.css +22 -0
- package/src/emails/styles/main/Components/+.css +1 -0
- package/src/emails/styles/main/Components/Card.css +12 -0
- package/src/emails/styles/main/Ui/+.css +3 -0
- package/src/emails/styles/main/Ui/Btn.css +78 -0
- package/src/emails/styles/main/Ui/Heading.css +8 -0
- package/src/emails/styles/main/Ui/Text.css +12 -0
- package/src/emails/styles/main.css +92 -0
- package/src/emails/{templates/Layout.twig → templates.test/Layout.latte} +17 -5
- package/src/emails/templates.test/Sections/Footer.latte +22 -0
- package/src/emails/templates.test/Sections/Header.latte +37 -0
- package/src/emails/templates.test/Sections/Text.latte +24 -0
- package/src/icons.svg +27 -21
- package/src/scripts/Components/+.js +2 -1
- package/src/scripts/Components/Drawer.js +60 -0
- package/src/scripts/Components/Popover.js +65 -0
- package/src/scripts/Layout/+.js +0 -1
- package/src/scripts/Layout/Header.js +14 -24
- package/src/scripts/Libraries/+.js +4 -8
- package/src/scripts/Libraries/CookieConsent.js +65 -52
- package/src/scripts/Libraries/Dialog.js +19 -36
- package/src/scripts/Libraries/Form.js +5 -25
- package/src/scripts/Libraries/Naja.js +22 -20
- package/src/scripts/Libraries/ReCaptcha.js +8 -30
- package/src/scripts/Libraries/Reveal.js +32 -0
- package/src/scripts/Libraries/Ripple.js +6 -22
- package/src/scripts/Libraries/Stimulus.js +49 -5
- package/src/scripts/Libraries/Swup.js +45 -32
- package/src/scripts/Libraries/Toaster.js +55 -0
- package/src/scripts/Ui/+.js +3 -3
- package/src/scripts/Ui/Check.js +8 -0
- package/src/scripts/Ui/Control.js +194 -0
- package/src/scripts/Ui/ControlSelect.js +25 -0
- package/src/scripts/Ui/Text.js +9 -11
- package/src/scripts/Utils/+.js +3 -3
- package/src/scripts/Utils/cdn.js +1 -3
- package/src/scripts/Utils/initAfter.js +11 -0
- package/src/scripts/Utils/naja.js +41 -0
- package/src/scripts/Utils/utilities.js +8 -0
- package/src/scripts/main.js +2 -1
- package/src/styles/Components/+.css +4 -3
- package/src/styles/Components/Dialog/+.css +2 -0
- package/src/styles/Components/Dialog/Content.css +2 -0
- package/src/styles/Components/Dialog/CookieConsent.css +17 -0
- package/src/styles/Components/Dialog/Default.css +2 -43
- package/src/styles/Components/Drawer.css +18 -0
- package/src/styles/Components/Field.css +1 -0
- package/src/styles/Components/Popover.css +1 -0
- package/src/styles/Components/Toaster.css +2 -0
- package/src/styles/Layout/Header.css +9 -45
- package/src/styles/Layout/Main.css +11 -75
- package/src/styles/Layout/Nav.css +13 -33
- package/src/styles/Libraries/+.css +1 -7
- package/src/styles/Libraries/Datepicker.css +38 -229
- package/src/styles/Libraries/Pickr.css +13 -0
- package/src/styles/Ui/+.css +5 -5
- package/src/styles/Ui/Badge.css +8 -82
- package/src/styles/Ui/Btn.css +14 -226
- package/src/styles/Ui/Check.css +1 -0
- package/src/styles/Ui/Control.css +57 -0
- package/src/styles/Ui/ControlSelect.css +57 -0
- package/src/styles/Ui/Group.css +1 -0
- package/src/styles/Ui/Heading.css +4 -22
- package/src/styles/Ui/Image.css +1 -17
- package/src/styles/Ui/Info.css +1 -0
- package/src/styles/Ui/Label.css +1 -14
- package/src/styles/Ui/Link.css +6 -39
- package/src/styles/Ui/Notice.css +5 -43
- package/src/styles/Ui/Progress.css +1 -56
- package/src/styles/Ui/Switch.css +1 -70
- package/src/styles/Ui/Text.css +1 -254
- package/src/styles/Ui/Title.css +4 -15
- package/src/styles/Utils/+.css +6 -10
- package/src/styles/Utils/breakpoints.css +1 -9
- package/src/styles/Utils/config.css +16 -0
- package/src/styles/Utils/default.css +15 -26
- package/src/styles/Utils/keyframes.css +1 -182
- package/src/styles/Utils/theme/+.css +1 -1
- package/src/styles/Utils/theme/main.css +28 -23
- package/src/styles/Utils/utilities.css +42 -0
- package/src/styles/main.css +16 -14
- package/src/styles/tinymce.css +34 -0
- package/src/templates/Components/Dialog/Basic.latte +24 -0
- package/src/templates/Components/Dialog/CookieConsent.latte +27 -0
- package/src/templates/Components/Form/CookieConsent.latte +47 -0
- package/src/templates/Layout/Header.latte +38 -0
- package/src/templates/Layout/Main.latte +73 -0
- package/src/templates/Sections/CookieConsent.latte +69 -0
- package/src/templates/Sections/Site.latte +213 -0
- package/src/templates/Sections/Text.latte +64 -0
- package/src/templates/Sections/Ui/Docs/@intro.html +16 -65
- package/src/templates/Sections/Ui/Docs/@nav.html +68 -129
- package/src/templates/Sections/Ui/Docs/@styles.html +3 -7
- package/src/templates/Sections/Ui/Docs/Default.latte +979 -0
- package/src/templates/Sections/Ui/Icons.html +11 -9
- package/src/templates/Sections/Ui/Intro.html +62 -79
- package/src/templates/Sections/Ui.latte +8 -0
- package/src/templates/Ui/+.latte +5 -0
- package/src/templates/Ui/Check.latte +7 -0
- package/src/templates/Ui/Control.latte +9 -0
- package/src/templates/Ui/ControlDate.latte +14 -0
- package/src/templates/Ui/ControlSelect.latte +9 -0
- package/src/templates/Ui/ControlTime.latte +14 -0
- package/src/templates/Utils/sections.latte +3 -0
- package/src/views/dialog/basic.json.latte +5 -0
- package/src/views/email/email.latte +6 -0
- package/src/views/email/email.test.latte +6 -0
- package/src/views/gdpr.json +6 -4
- package/src/views/index.json +1 -1
- package/src/views/popover/info.json.latte +15 -0
- package/src/views/site.json +11 -0
- package/src/views/ui-icons.json +1 -1
- package/src/views/ui.json +1 -1
- package/vite.config.js +17 -16
- package/src/emails/styles/email.css +0 -77
- package/src/emails/templates/Content.twig +0 -16
- package/src/emails/templates/Header.twig +0 -14
- package/src/scripts/Components/CookieConsent.js +0 -83
- package/src/scripts/Layout/Main.js +0 -47
- package/src/scripts/Libraries/Anchor.js +0 -35
- package/src/scripts/Libraries/Drawer.js +0 -45
- package/src/scripts/Libraries/NativeSlider.js +0 -138
- package/src/scripts/Libraries/Script.js +0 -19
- package/src/scripts/Libraries/Tabs.js +0 -16
- package/src/scripts/Libraries/Tippy.js +0 -120
- package/src/scripts/Ui/Checkbox.js +0 -10
- package/src/scripts/Ui/Input.js +0 -259
- package/src/scripts/Ui/Select.js +0 -53
- package/src/scripts/Utils/Functions/+.js +0 -6
- package/src/scripts/Utils/Functions/checkValidity.js +0 -44
- package/src/scripts/Utils/Functions/dataValue.js +0 -52
- package/src/scripts/Utils/Functions/importScript.js +0 -17
- package/src/scripts/Utils/Functions/importStyle.js +0 -18
- package/src/scripts/Utils/Functions/loadStimulus.js +0 -42
- package/src/scripts/Utils/Functions/replaceTag.js +0 -12
- package/src/scripts/Utils/global.js +0 -15
- package/src/styles/Components/CookieConsent.css +0 -71
- package/src/styles/Components/Dropdown/+.css +0 -1
- package/src/styles/Components/Dropdown/Default.css +0 -5
- package/src/styles/Components/Form/+.css +0 -1
- package/src/styles/Components/Form/CookieConsent.css +0 -31
- package/src/styles/Libraries/Dialog.css +0 -35
- package/src/styles/Libraries/Drawer.css +0 -70
- package/src/styles/Libraries/Hint.css +0 -201
- package/src/styles/Libraries/NativeSlider.css +0 -60
- package/src/styles/Libraries/Ripple.css +0 -16
- package/src/styles/Libraries/Tabs.css +0 -19
- package/src/styles/Libraries/Tippy.css +0 -87
- package/src/styles/Ui/Checkbox.css +0 -150
- package/src/styles/Ui/Icon.css +0 -33
- package/src/styles/Ui/Input.css +0 -467
- package/src/styles/Ui/Radio.css +0 -4
- package/src/styles/Ui/Select.css +0 -137
- package/src/styles/Utils/icons.css +0 -9
- package/src/styles/Utils/normalize.css +0 -223
- package/src/styles/Utils/tailwind/+.css +0 -3
- package/src/styles/Utils/tailwind/base.css +0 -3
- package/src/styles/Utils/tailwind/gutters.css +0 -346
- package/src/styles/Utils/tailwind/utilities.css +0 -48
- package/src/styles/Utils/vars.css +0 -91
- package/src/styles/Utils/vendor.css +0 -2
- package/src/templates/Components/CookieConsent.twig +0 -30
- package/src/templates/Components/Dialogs/Basic.twig +0 -22
- package/src/templates/Layout/Header.twig +0 -42
- package/src/templates/Layout/Main.twig +0 -49
- package/src/templates/Sections/Gdpr.twig +0 -64
- package/src/templates/Sections/Ui/Docs/Default.twig +0 -1600
- package/src/templates/Sections/Ui.twig +0 -8
- package/src/templates/Utils/sections.twig +0 -3
- package/src/views/dialog/basic.json.twig +0 -3
- package/src/views/dropdown/tippy.json.twig +0 -16
- package/src/views/email/email.twig +0 -6
- /package/src/{styles/Utils/print.css → emails/styles/main/Base/font.css} +0 -0
- /package/src/{templates/Components/Items → emails/templates}/.gitkeep +0 -0
- /package/src/templates/Layout/{Footer.twig → Footer.latte} +0 -0
package/src/icons.svg
CHANGED
|
@@ -1,32 +1,38 @@
|
|
|
1
|
-
<svg
|
|
2
|
-
<symbol id="icon-chevron-left"
|
|
3
|
-
<path stroke-linecap="round" stroke-linejoin="round"
|
|
1
|
+
<svg class="hidden">
|
|
2
|
+
<symbol id="icon-chevron-left" viewBox="0 0 24 24">
|
|
3
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M15 19l-7-7 7-7" />
|
|
4
4
|
</symbol>
|
|
5
|
-
<symbol id="icon-chevron-right"
|
|
6
|
-
<path stroke-linecap="round" stroke-linejoin="round"
|
|
5
|
+
<symbol id="icon-chevron-right" viewBox="0 0 24 24">
|
|
6
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7" />
|
|
7
7
|
</symbol>
|
|
8
|
-
<symbol id="icon-
|
|
9
|
-
<path d="
|
|
8
|
+
<symbol id="icon-exclamation-circle" viewBox="0 0 24 24">
|
|
9
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
10
10
|
</symbol>
|
|
11
|
-
<symbol id="icon-
|
|
12
|
-
<path
|
|
11
|
+
<symbol id="icon-x-mark" viewBox="0 0 24 24">
|
|
12
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
|
|
13
|
+
</symbol>
|
|
14
|
+
<symbol id="icon-bars-3" viewBox="0 0 24 24">
|
|
15
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
|
|
13
16
|
</symbol>
|
|
14
|
-
<symbol id="icon-
|
|
15
|
-
<path stroke-linecap="round" stroke-linejoin="round"
|
|
17
|
+
<symbol id="icon-moon" viewBox="0 0 24 24">
|
|
18
|
+
<path stroke-linecap="round" stroke-linejoin="round" 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" />
|
|
16
19
|
</symbol>
|
|
17
|
-
<symbol id="icon-
|
|
18
|
-
<path stroke-linecap="round" stroke-linejoin="round"
|
|
20
|
+
<symbol id="icon-sun" viewBox="0 0 24 24">
|
|
21
|
+
<path stroke-linecap="round" stroke-linejoin="round" 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" />
|
|
19
22
|
</symbol>
|
|
20
|
-
<symbol id="icon-
|
|
21
|
-
<path stroke-linecap="round" stroke-linejoin="round"
|
|
23
|
+
<symbol id="icon-at-symbol" viewBox="0 0 24 24">
|
|
24
|
+
<path stroke-linecap="round" stroke-linejoin="round" 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" />
|
|
22
25
|
</symbol>
|
|
23
|
-
<symbol id="icon-
|
|
24
|
-
<path stroke-linecap="round" stroke-linejoin="round"
|
|
26
|
+
<symbol id="icon-calendar" viewBox="0 0 24 24">
|
|
27
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5" />
|
|
25
28
|
</symbol>
|
|
26
|
-
<symbol id="icon-
|
|
27
|
-
<path stroke-linecap="round" stroke-linejoin="round"
|
|
29
|
+
<symbol id="icon-clock" viewBox="0 0 24 24">
|
|
30
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
28
31
|
</symbol>
|
|
29
|
-
<symbol id="icon-
|
|
30
|
-
<path
|
|
32
|
+
<symbol id="icon-angle-down-solid" viewBox="0 0 24 24">
|
|
33
|
+
<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" />
|
|
34
|
+
</symbol>
|
|
35
|
+
<symbol id="icon-angle-up-solid" viewBox="0 0 24 24">
|
|
36
|
+
<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%;" />
|
|
31
37
|
</symbol>
|
|
32
38
|
</svg>
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import './
|
|
1
|
+
import './Drawer.js'
|
|
2
|
+
import './Popover.js'
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { LibStimulus, Controller } from '../Libraries/Stimulus.js'
|
|
2
|
+
import { showDrawer, closeDrawer, scrollDrawer } from 'winduum/src/components/drawer/index.js'
|
|
3
|
+
|
|
4
|
+
LibStimulus.register('c-drawer', class extends Controller {
|
|
5
|
+
static values = {
|
|
6
|
+
inertMatch: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: ':where(.c-drawer, .l-header)'
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
connect() {
|
|
13
|
+
this.scrollReset()
|
|
14
|
+
this.element.addEventListener('click', ({ target }) => {
|
|
15
|
+
if (target === this.element) this.close()
|
|
16
|
+
})
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
scrollReset() {
|
|
20
|
+
this.element.scroll({ left: this.element.scrollWidth, behavior: 'instant' })
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
scroll({ target }) {
|
|
24
|
+
scrollDrawer(target)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
inert(inert) {
|
|
28
|
+
[...document.body.children].forEach((element) => {
|
|
29
|
+
if (!element.matches(this.inertMatchValue)) (element.inert = inert)
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
show() {
|
|
34
|
+
this.scrollReset()
|
|
35
|
+
this.element.classList.add('active')
|
|
36
|
+
showDrawer(this.element)
|
|
37
|
+
this.inert(true)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
close() {
|
|
41
|
+
closeDrawer(this.element)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
toggle({ currentTarget }) {
|
|
45
|
+
this.activeButton = currentTarget
|
|
46
|
+
|
|
47
|
+
if (!currentTarget.classList.contains('active')) {
|
|
48
|
+
currentTarget.classList.add('active')
|
|
49
|
+
this.show()
|
|
50
|
+
} else {
|
|
51
|
+
this.close()
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
dismiss() {
|
|
56
|
+
this.element.classList.remove('active')
|
|
57
|
+
this.activeButton?.classList?.remove('active')
|
|
58
|
+
this.inert(false)
|
|
59
|
+
}
|
|
60
|
+
})
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Controller, LibStimulus } from '../Libraries/Stimulus.js'
|
|
2
|
+
import { dataset, fetchJson } from '@newlogic-digital/utils-js'
|
|
3
|
+
import initAfter from '../Utils/initAfter.js'
|
|
4
|
+
|
|
5
|
+
LibStimulus.register('c-popover', class extends Controller {
|
|
6
|
+
static values = {
|
|
7
|
+
url: String,
|
|
8
|
+
insertTo: String,
|
|
9
|
+
manual: Boolean
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
async toggle({ currentTarget, params }) {
|
|
13
|
+
const { togglePopover } = await import('winduum/src/components/popover/index.js')
|
|
14
|
+
const hasUrlValue = this.hasUrlValue && !this.popoverTarget
|
|
15
|
+
|
|
16
|
+
if (hasUrlValue) await this.fetch()
|
|
17
|
+
|
|
18
|
+
this.popoverTarget = document.getElementById(currentTarget.getAttribute('popovertarget'))
|
|
19
|
+
|
|
20
|
+
if (hasUrlValue) initAfter(this.popoverTarget)
|
|
21
|
+
|
|
22
|
+
await togglePopover(currentTarget, params)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async hide() {
|
|
26
|
+
if (this.popoverActionTarget.ariaExpanded !== 'true') return
|
|
27
|
+
|
|
28
|
+
const { hidePopover } = await import('winduum/src/components/popover/index.js')
|
|
29
|
+
|
|
30
|
+
await hidePopover(this.popoverActionTarget)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async dismiss({ target }) {
|
|
34
|
+
if (this.popoverActionTarget.ariaExpanded !== 'true') return
|
|
35
|
+
|
|
36
|
+
if (!this.popoverTarget.contains(target) && !this.popoverActionTarget.isEqualNode(target) && this.popoverActionTarget.ariaExpanded === 'true') {
|
|
37
|
+
await this.hide()
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async fetch() {
|
|
42
|
+
this.popoverActionTarget.classList.add('loading', 'cursor-wait')
|
|
43
|
+
|
|
44
|
+
const { content } = await fetchJson(this.urlValue)
|
|
45
|
+
|
|
46
|
+
this.popoverActionTarget.classList.remove('loading', 'cursor-wait')
|
|
47
|
+
|
|
48
|
+
const insertElement = !this.hasInsertToValue ? this.popoverActionTarget : document.querySelector(this.insertToValue)
|
|
49
|
+
insertElement.insertAdjacentHTML(!this.hasInsertToValue ? 'afterend' : 'beforeend', content)
|
|
50
|
+
|
|
51
|
+
return content
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
connect() {
|
|
55
|
+
this.popoverActionTarget = this.element.querySelector('[popovertargetaction]')
|
|
56
|
+
|
|
57
|
+
if (!this.popoverActionTarget) return
|
|
58
|
+
|
|
59
|
+
;(!this.hasManualValue || !this.manualValue) && dataset(this.popoverActionTarget, 'action').add(
|
|
60
|
+
`click->c-popover#${this.popoverActionTarget.getAttribute('popovertargetaction')}:prevent`,
|
|
61
|
+
'keydown.esc@window->c-popover#hide',
|
|
62
|
+
'click@window->c-popover#dismiss'
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
})
|
package/src/scripts/Layout/+.js
CHANGED
|
@@ -1,30 +1,20 @@
|
|
|
1
|
-
import { LibStimulus, Controller
|
|
1
|
+
import { LibStimulus, Controller } from '../Libraries/Stimulus.js'
|
|
2
2
|
|
|
3
|
-
LibStimulus.register('l-header',
|
|
4
|
-
|
|
5
|
-
class extends Controller {
|
|
6
|
-
connect() {
|
|
7
|
-
if (document.querySelector('#l-nav') === null) {
|
|
8
|
-
this.element.insertAdjacentHTML('afterend', `
|
|
9
|
-
<div id="l-nav" class="lib-drawer" data-lib-drawer-target="nav" data-action="scroll->lib-drawer#scroll" inert aria-hidden="true">
|
|
10
|
-
<div class="wrp_nav">
|
|
11
|
-
<div class="wrp_nav_head"></div>
|
|
12
|
-
<div class="wrp_nav_body"></div>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
`)
|
|
3
|
+
LibStimulus.register('l-header', class extends Controller {
|
|
4
|
+
static targets = ['logo', 'nav']
|
|
16
5
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
connect() {
|
|
7
|
+
if (!document.querySelector('.l-nav')) {
|
|
8
|
+
this.element.insertAdjacentHTML('afterend', `
|
|
9
|
+
<div class="l-nav c-drawer" data-controller="c-drawer" data-action="scroll->c-drawer#scroll c-drawer:close->c-drawer#dismiss" inert>
|
|
10
|
+
<div class="c-drawer-content"></div>
|
|
11
|
+
</div>
|
|
12
|
+
`)
|
|
20
13
|
|
|
21
|
-
|
|
22
|
-
const logo = this.element.querySelector('.elm_header_logo').outerHTML
|
|
23
|
-
const nav = this.element.querySelector('.elm_header_nav').outerHTML
|
|
14
|
+
const drawerContentElement = document.querySelector('.l-nav .c-drawer-content')
|
|
24
15
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
16
|
+
drawerContentElement.insertAdjacentHTML('beforeend', this.logoTarget.outerHTML)
|
|
17
|
+
drawerContentElement.insertAdjacentHTML('beforeend', this.navTarget.outerHTML)
|
|
28
18
|
}
|
|
29
19
|
}
|
|
30
|
-
)
|
|
20
|
+
})
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
export { default as CookieConsent } from './CookieConsent.js'
|
|
1
|
+
import './CookieConsent.js'
|
|
3
2
|
import './Dialog.js'
|
|
4
|
-
import './Drawer.js'
|
|
5
3
|
import './Form.js'
|
|
6
4
|
import './Naja.js'
|
|
7
|
-
export { default as NativeSlider } from './NativeSlider.js'
|
|
8
5
|
import './ReCaptcha.js'
|
|
9
|
-
|
|
10
|
-
import './
|
|
6
|
+
import './Reveal.js'
|
|
7
|
+
import './Ripple.js'
|
|
11
8
|
import './Stimulus.js'
|
|
12
9
|
export { default as Swup } from './Swup.js'
|
|
13
|
-
|
|
14
|
-
export { default as Tippy } from './Tippy.js'
|
|
10
|
+
import './Toaster.js'
|
|
@@ -1,67 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
},
|
|
5
|
-
getItem: (key) => {
|
|
6
|
-
return localStorage.getItem(key)
|
|
7
|
-
},
|
|
8
|
-
init: () => {
|
|
9
|
-
const type = LibCookieConsent.getItem('lib-cookieconsent')
|
|
1
|
+
import { LibStimulus, Controller } from './Stimulus.js'
|
|
2
|
+
import { appendCookieConsent, setCookieConsent } from '@newlogic-digital/cookieconsent-js'
|
|
3
|
+
import { showDialog, closeDialog } from 'winduum/src/components/dialog/index.js'
|
|
10
4
|
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
export const getCookieConsentItem = (key = 'cookieconsent-js') => localStorage.getItem(key)
|
|
6
|
+
|
|
7
|
+
export const initCookieConsent = (element = document, type = getCookieConsentItem() ?? []) => {
|
|
8
|
+
element.querySelectorAll('[data-lib-cookieconsent]').forEach((element) => {
|
|
9
|
+
if (type.includes(element.getAttribute('data-lib-cookieconsent'))) {
|
|
10
|
+
appendCookieConsent(element, {
|
|
11
|
+
ignoreAttributeName: /(type|data-lib-cookieconsent)/
|
|
12
|
+
})
|
|
13
|
+
}
|
|
14
|
+
})
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
LibStimulus.register('c-dialog-cookieconsent', class extends Controller {
|
|
18
|
+
async connect() {
|
|
19
|
+
initCookieConsent()
|
|
20
|
+
|
|
21
|
+
if (document.querySelector('.c-form-cookieconsent')) {
|
|
22
|
+
return
|
|
13
23
|
}
|
|
14
|
-
},
|
|
15
|
-
set: (type) => {
|
|
16
|
-
LibCookieConsent.setItem('lib-cookieconsent', JSON.stringify(type))
|
|
17
|
-
LibCookieConsent.setItem('lib-cookieconsent-expire', (Date.now() + 31556926 * 1000).toString())
|
|
18
24
|
|
|
19
|
-
if (
|
|
20
|
-
|
|
25
|
+
if (!getCookieConsentItem() || parseInt(getCookieConsentItem('cookieconsent-js-expire')) < Date.now()) {
|
|
26
|
+
setTimeout(async () => {
|
|
27
|
+
await showDialog(this.element, { closable: false })
|
|
28
|
+
}, 1500)
|
|
21
29
|
} else {
|
|
22
|
-
|
|
23
|
-
LibCookieConsent.remove()
|
|
30
|
+
this.element.remove()
|
|
24
31
|
}
|
|
25
|
-
}
|
|
26
|
-
remove: () => {
|
|
27
|
-
document.cookie.split(';').forEach(c => {
|
|
28
|
-
document.cookie = c.replace(/^ +/, '').replace(/=.*/, '=;expires=' + new Date().toUTCString() + ';path=/')
|
|
29
|
-
})
|
|
30
|
-
},
|
|
31
|
-
append: (type) => {
|
|
32
|
-
document.querySelectorAll('[data-lib-cookieconsent]').forEach(elm => {
|
|
33
|
-
if (type === 'all' || elm.getAttribute('data-lib-cookieconsent') === type) {
|
|
34
|
-
const script = document.createElement('script')
|
|
35
|
-
let delay = 0
|
|
32
|
+
}
|
|
36
33
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
script.setAttribute(attribute.name, attribute.value)
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
})
|
|
34
|
+
async approve() {
|
|
35
|
+
await this.hide(['performance', 'marketing'])
|
|
36
|
+
}
|
|
44
37
|
|
|
45
|
-
|
|
38
|
+
async decline() {
|
|
39
|
+
await this.hide([])
|
|
40
|
+
}
|
|
46
41
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
async hide(type) {
|
|
43
|
+
await setCookieConsent(type)
|
|
44
|
+
initCookieConsent(document, type)
|
|
45
|
+
await closeDialog(this.element, { remove: true })
|
|
46
|
+
}
|
|
47
|
+
})
|
|
50
48
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
} else if (elm.closest('head') !== null) {
|
|
55
|
-
document.head.appendChild(script)
|
|
56
|
-
}
|
|
49
|
+
LibStimulus.register('c-form-cookieconsent', class extends Controller {
|
|
50
|
+
connect() {
|
|
51
|
+
document.querySelector('.c-dialog-cookieconsent')?.close()
|
|
57
52
|
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
this.element.querySelectorAll('input:not([disabled])').forEach((input) => {
|
|
54
|
+
input.checked = false
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
JSON.parse(getCookieConsentItem())?.forEach((type) => {
|
|
58
|
+
if (this.element.querySelector(`input[value="${type}"]`) !== null) {
|
|
59
|
+
this.element.querySelector(`input[value="${type}"]`).checked = true
|
|
60
60
|
}
|
|
61
61
|
})
|
|
62
62
|
}
|
|
63
|
-
}
|
|
64
63
|
|
|
65
|
-
|
|
64
|
+
async update() {
|
|
65
|
+
const type = []
|
|
66
|
+
|
|
67
|
+
this.element.querySelectorAll('input:not([disabled])').forEach((input) => {
|
|
68
|
+
input.checked && type.push(input.value)
|
|
69
|
+
})
|
|
66
70
|
|
|
67
|
-
|
|
71
|
+
await setCookieConsent(type)
|
|
72
|
+
location.reload()
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
disconnect() {
|
|
76
|
+
if ((!getCookieConsentItem() || parseInt(getCookieConsentItem('cookieconsent-js-expire')) < Date.now())) {
|
|
77
|
+
document.querySelector('.c-dialog-cookieconsent')?.showModal()
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
})
|
|
@@ -1,45 +1,28 @@
|
|
|
1
|
-
import { Controller, LibStimulus
|
|
2
|
-
import { insertDialog, closeDialog,
|
|
1
|
+
import { Controller, LibStimulus } from './../Libraries/Stimulus.js'
|
|
2
|
+
import { insertDialog, closeDialog, dialogSelector } from 'winduum/src/components/dialog/index.js'
|
|
3
|
+
import initAfter from '../Utils/initAfter.js'
|
|
4
|
+
import { fetchJson } from '@newlogic-digital/utils-js'
|
|
3
5
|
|
|
4
6
|
LibStimulus.register('lib-dialog', class extends Controller {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
async show({ currentTarget, params }) {
|
|
8
|
+
const loadingClasses = (params.loadingClass ?? 'loading cursor-wait').split(' ')
|
|
9
|
+
|
|
10
|
+
currentTarget.classList.add(...loadingClasses)
|
|
11
|
+
|
|
12
|
+
await this.fetch(params.url, params)
|
|
9
13
|
|
|
10
|
-
|
|
11
|
-
if (this.hasOpenValue) {
|
|
12
|
-
if (this.hasUrlValue) {
|
|
13
|
-
await fetchDialog({
|
|
14
|
-
url: this.urlValue, insertOptions: { remove: true }
|
|
15
|
-
})
|
|
16
|
-
} else {
|
|
17
|
-
await insertDialog(document.querySelector(this.openValue).innerHTML, {
|
|
18
|
-
remove: true
|
|
19
|
-
})
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
loadStimulus(dialogSelector('.lib-dialog'))
|
|
23
|
-
}
|
|
14
|
+
currentTarget.classList.remove(...loadingClasses)
|
|
24
15
|
}
|
|
25
16
|
|
|
26
|
-
async
|
|
27
|
-
currentTarget.
|
|
28
|
-
currentTarget.classList.add('cursor-wait')
|
|
29
|
-
|
|
30
|
-
await fetchDialog({
|
|
31
|
-
url: params.url,
|
|
32
|
-
insertOptions: {
|
|
33
|
-
remove: params.remove ?? true,
|
|
34
|
-
append: params.append ?? false
|
|
35
|
-
}
|
|
36
|
-
}).then(() => loadStimulus(dialogSelector('.lib-dialog')))
|
|
37
|
-
|
|
38
|
-
currentTarget._removeDataValue('state', 'loading')
|
|
39
|
-
currentTarget.classList.remove('cursor-wait')
|
|
17
|
+
async close({ currentTarget, params }) {
|
|
18
|
+
await closeDialog(currentTarget.closest('dialog'), { remove: params.remove ?? true })
|
|
40
19
|
}
|
|
41
20
|
|
|
42
|
-
async
|
|
43
|
-
|
|
21
|
+
async fetch(url, options) {
|
|
22
|
+
const { content } = await fetchJson(url)
|
|
23
|
+
|
|
24
|
+
await insertDialog(content, options)
|
|
25
|
+
|
|
26
|
+
initAfter(dialogSelector('.c-dialog'))
|
|
44
27
|
}
|
|
45
28
|
})
|
|
@@ -1,33 +1,13 @@
|
|
|
1
1
|
import { LibStimulus, Controller } from './Stimulus.js'
|
|
2
|
-
import {
|
|
2
|
+
import { validateForm } from 'winduum/src/components/form/index.js'
|
|
3
3
|
|
|
4
4
|
LibStimulus.register('lib-form', class extends Controller {
|
|
5
5
|
connect() {
|
|
6
|
-
this.element.
|
|
7
|
-
this.element.addEventListener('submit',
|
|
6
|
+
this.element.noValidate = true
|
|
7
|
+
this.element.addEventListener('submit', this.validate)
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
e.preventDefault()
|
|
13
|
-
e.stopPropagation()
|
|
14
|
-
|
|
15
|
-
this.element.querySelector(':invalid').scrollIntoView({ behavior: 'smooth', block: 'center' })
|
|
16
|
-
this.element.querySelector(':invalid').focus()
|
|
17
|
-
} else {
|
|
18
|
-
this.element.querySelector('[type="submit"]')._addDataValue('state', 'loading')
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
this.element.querySelectorAll('.ui-input, [data-controller="ui-checkbox"], [data-controller="ui-radio"]').forEach(element => {
|
|
22
|
-
checkValidity(element, { message: true })
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
this.element.querySelectorAll('.ui-select:not([data-state*="active"]) select[required]').forEach(select => {
|
|
26
|
-
checkValidity(select.closest('.ui-select'), { message: true })
|
|
27
|
-
})
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
submitForm({ currentTarget }) {
|
|
31
|
-
currentTarget.form.dispatchEvent(new Event('submit', { bubbles: true, cancelable: true }))
|
|
10
|
+
async validate(event) {
|
|
11
|
+
validateForm(event)
|
|
32
12
|
}
|
|
33
13
|
})
|
|
@@ -1,35 +1,37 @@
|
|
|
1
|
+
import { Controller, LibStimulus, initStimulus } from './Stimulus.js'
|
|
2
|
+
import { initCookieConsent } from './CookieConsent.js'
|
|
3
|
+
import {
|
|
4
|
+
initNaja,
|
|
5
|
+
NajaRecaptchaExtension,
|
|
6
|
+
NajaFormValidityExtension
|
|
7
|
+
} from '../Utils/naja.js'
|
|
1
8
|
import naja from 'naja'
|
|
2
|
-
import
|
|
9
|
+
import LibSwup from './Swup.js'
|
|
3
10
|
|
|
4
11
|
LibStimulus.register('lib-naja', class extends Controller {
|
|
5
|
-
async
|
|
6
|
-
naja.uiHandler.
|
|
7
|
-
const element = detail.element
|
|
12
|
+
async initialize() {
|
|
13
|
+
naja.uiHandler.selector = '[data-naja]'
|
|
8
14
|
|
|
9
|
-
|
|
15
|
+
await initNaja(this.element, false)
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
if (naja.initialized) return
|
|
12
18
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
19
|
+
naja.uiHandler.addEventListener('interaction', ({ detail }) => {
|
|
20
|
+
detail.element.dispatchEvent(new CustomEvent('naja:interaction', { bubbles: true, cancelable: true }))
|
|
16
21
|
})
|
|
17
22
|
|
|
18
23
|
naja.snippetHandler.addEventListener('afterUpdate', ({ detail }) => {
|
|
19
|
-
detail
|
|
24
|
+
detail.snippet.dispatchEvent(new CustomEvent('naja:afterUpdate', { bubbles: true, cancelable: true }))
|
|
20
25
|
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
initStimulus(detail.snippet)
|
|
27
|
+
initNaja(detail.snippet)
|
|
28
|
+
initCookieConsent(detail.snippet)
|
|
23
29
|
|
|
24
|
-
|
|
25
|
-
naja.initialize({
|
|
26
|
-
history: false
|
|
30
|
+
LibSwup.cache.clear()
|
|
27
31
|
})
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
async fetch({ currentTarget }) {
|
|
31
|
-
arguments[0].preventDefault()
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
naja.registerExtension(NajaRecaptchaExtension)
|
|
34
|
+
naja.registerExtension(NajaFormValidityExtension)
|
|
35
|
+
naja.initialize()
|
|
34
36
|
}
|
|
35
37
|
})
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LibStimulus, Controller } from './Stimulus.js'
|
|
2
|
-
import
|
|
3
|
-
import importScript from '../Utils/Functions/importScript.js'
|
|
2
|
+
import { importScript } from '@newlogic-digital/utils-js'
|
|
4
3
|
import cdn from '../Utils/cdn.js'
|
|
5
4
|
|
|
6
5
|
LibStimulus.register('lib-recaptcha', class extends Controller {
|
|
@@ -13,35 +12,14 @@ LibStimulus.register('lib-recaptcha', class extends Controller {
|
|
|
13
12
|
importScript(cdn.recaptcha.replace('{apikey}', this.apiValue))
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
})
|
|
15
|
+
execute(event) {
|
|
16
|
+
if (event?.detail?.recaptchaExecuted) return
|
|
17
|
+
|
|
18
|
+
window.grecaptcha.enterprise.ready(() => {
|
|
19
|
+
window.grecaptcha.enterprise.execute(this.apiValue, { action: this.actionValue ?? 'form' }).then((token) => {
|
|
20
|
+
this.element.gtoken.value = token
|
|
21
|
+
this.element.dispatchEvent(new CustomEvent('submit', { cancelable: true, detail: { recaptchaExecuted: true } }))
|
|
23
22
|
})
|
|
24
23
|
})
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
async submit() {
|
|
28
|
-
if (this.element.reportValidity() === false) {
|
|
29
|
-
return false
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
arguments[0].preventDefault()
|
|
33
|
-
|
|
34
|
-
await this.execute()
|
|
35
|
-
this.element.submit()
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
async submitFetch() {
|
|
39
|
-
if (this.element.reportValidity() === false) {
|
|
40
|
-
return false
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
arguments[0].preventDefault()
|
|
44
|
-
await this.execute()
|
|
45
|
-
await naja.makeRequest(this.element.method, this.element.action, new FormData(this.element), { history: 'replace' })
|
|
46
|
-
}
|
|
47
25
|
})
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Controller, LibStimulus } from './Stimulus.js'
|
|
2
|
+
import { dataset } from '@newlogic-digital/utils-js'
|
|
3
|
+
|
|
4
|
+
LibStimulus.register('lib-reveal', class extends Controller {
|
|
5
|
+
static targets = ['item']
|
|
6
|
+
|
|
7
|
+
intersectionObserver() {
|
|
8
|
+
this.observer = new IntersectionObserver((entries, observer) => {
|
|
9
|
+
entries.forEach((entry) => {
|
|
10
|
+
if (entry.intersectionRatio > 0.1 && !entry.target.classList.contains('in')) {
|
|
11
|
+
entry.target.classList.add('in')
|
|
12
|
+
|
|
13
|
+
if (entry.target.dataset.controllerNameParam) {
|
|
14
|
+
dataset(entry.target, 'controller').add(entry.target.dataset.controllerNameParam)
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
}, {
|
|
19
|
+
threshold: 0.1
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
itemTargetConnected(element) {
|
|
24
|
+
if (!this.observer) this.intersectionObserver()
|
|
25
|
+
|
|
26
|
+
this.observer?.observe(element)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
itemTargetDisconnected(element) {
|
|
30
|
+
this.observer?.unobserve(element)
|
|
31
|
+
}
|
|
32
|
+
})
|