@newlogic-digital/ui 3.5.0 → 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 +11 -1
- package/package.json +29 -22
- package/src/data/main.json +23 -8
- 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.test/Layout.latte +16 -4
- 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 +28 -28
- 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 -26
- package/src/scripts/Libraries/+.js +3 -5
- package/src/scripts/Libraries/CookieConsent.js +65 -52
- package/src/scripts/Libraries/Dialog.js +19 -38
- package/src/scripts/Libraries/Form.js +6 -19
- package/src/scripts/Libraries/Naja.js +22 -18
- package/src/scripts/Libraries/ReCaptcha.js +9 -26
- package/src/scripts/Libraries/Reveal.js +32 -0
- package/src/scripts/Libraries/Ripple.js +3 -3
- package/src/scripts/Libraries/Stimulus.js +50 -5
- package/src/scripts/Libraries/Swup.js +44 -59
- package/src/scripts/Libraries/Toaster.js +55 -0
- package/src/scripts/Ui/Check.js +3 -3
- package/src/scripts/Ui/Control.js +42 -34
- package/src/scripts/Ui/ControlSelect.js +6 -5
- package/src/scripts/Ui/Text.js +6 -6
- package/src/scripts/Utils/+.js +3 -3
- package/src/scripts/Utils/cdn.js +0 -1
- 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 +3 -2
- 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 -26
- package/src/styles/Components/Drawer.css +18 -0
- package/src/styles/Components/Field.css +1 -1
- package/src/styles/Components/Popover.css +1 -0
- package/src/styles/Components/Toaster.css +2 -0
- package/src/styles/Layout/Header.css +7 -39
- package/src/styles/Layout/Main.css +9 -6
- package/src/styles/Layout/Nav.css +6 -30
- package/src/styles/Libraries/+.css +0 -5
- package/src/styles/Ui/+.css +0 -1
- package/src/styles/Ui/Badge.css +1 -0
- package/src/styles/Ui/Btn.css +6 -5
- package/src/styles/Ui/Check.css +1 -1
- package/src/styles/Ui/Control.css +14 -4
- package/src/styles/Ui/ControlSelect.css +10 -19
- package/src/styles/Ui/Group.css +1 -1
- package/src/styles/Ui/Heading.css +1 -0
- package/src/styles/Ui/Image.css +1 -1
- package/src/styles/Ui/Info.css +1 -1
- package/src/styles/Ui/Label.css +1 -1
- package/src/styles/Ui/Link.css +7 -1
- package/src/styles/Ui/Notice.css +9 -1
- package/src/styles/Ui/Progress.css +1 -1
- package/src/styles/Ui/Switch.css +1 -1
- package/src/styles/Ui/Text.css +1 -8
- package/src/styles/Ui/Title.css +1 -4
- package/src/styles/Utils/+.css +1 -3
- package/src/styles/Utils/config.css +14 -3
- package/src/styles/Utils/default.css +11 -4
- package/src/styles/Utils/theme/+.css +1 -1
- package/src/styles/Utils/theme/main.css +27 -13
- package/src/styles/Utils/utilities.css +42 -0
- package/src/styles/main.css +1 -4
- 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 +31 -33
- package/src/templates/Layout/Main.latte +39 -28
- package/src/templates/Sections/CookieConsent.latte +69 -0
- package/src/templates/Sections/Site.latte +80 -8
- package/src/templates/Sections/Text.latte +64 -0
- package/src/templates/Sections/Ui/Docs/@intro.html +5 -5
- package/src/templates/Sections/Ui/Docs/@nav.html +50 -60
- package/src/templates/Sections/Ui/Docs/@styles.html +1 -1
- package/src/templates/Sections/Ui/Docs/Default.latte +86 -166
- package/src/templates/Sections/Ui/Icons.html +1 -1
- package/src/templates/Sections/Ui/Intro.html +33 -79
- package/src/templates/Ui/ControlDate.latte +1 -1
- package/src/templates/Ui/ControlTime.latte +1 -1
- package/src/views/dialog/basic.json.latte +1 -1
- package/src/views/email/email.latte +2 -2
- package/src/views/email/email.test.latte +2 -2
- package/src/views/gdpr.json +6 -4
- package/src/views/popover/info.json.latte +15 -0
- package/vite.config.js +17 -10
- package/src/emails/styles/email.css +0 -77
- package/src/emails/templates.test/Content.latte +0 -24
- package/src/emails/templates.test/Header.latte +0 -14
- package/src/scripts/Components/CookieConsent.js +0 -78
- package/src/scripts/Layout/Main.js +0 -50
- package/src/scripts/Libraries/Drawer.js +0 -42
- package/src/scripts/Libraries/Script.js +0 -18
- package/src/scripts/Libraries/Slider.js +0 -160
- package/src/scripts/Libraries/Tippy.js +0 -117
- package/src/scripts/Utils/Functions/+.js +0 -7
- package/src/scripts/Utils/Functions/importScript.js +0 -17
- package/src/scripts/Utils/Functions/importStyle.js +0 -18
- package/src/scripts/Utils/Functions/inputStep.js +0 -9
- package/src/scripts/Utils/Functions/inputValidity.js +0 -57
- package/src/scripts/Utils/Functions/loadStimulus.js +0 -42
- package/src/scripts/Utils/Functions/replaceScript.js +0 -4
- package/src/scripts/Utils/Functions/replaceTag.js +0 -8
- package/src/scripts/Utils/global.js +0 -15
- package/src/styles/Components/CookieConsent.css +0 -68
- package/src/styles/Components/Dropdown/+.css +0 -1
- package/src/styles/Components/Dropdown/Default.css +0 -8
- package/src/styles/Libraries/Dialog.css +0 -1
- package/src/styles/Libraries/Drawer.css +0 -64
- package/src/styles/Libraries/Hint.css +0 -186
- package/src/styles/Libraries/Ripple.css +0 -1
- package/src/styles/Libraries/Tippy.css +0 -73
- package/src/styles/Ui/Dot.css +0 -22
- package/src/styles/Utils/icons.css +0 -5
- package/src/styles/Utils/tailwind.css +0 -50
- package/src/templates/Components/CookieConsent.latte +0 -28
- package/src/templates/Components/Dialogs/Basic.latte +0 -22
- package/src/templates/Components/Items/.gitkeep +0 -0
- package/src/templates/Sections/Gdpr.latte +0 -127
- package/src/views/dropdown/tippy.json.latte +0 -19
- /package/src/{styles/Utils/print.css → emails/styles/main/Base/font.css} +0 -0
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
const defaultOptions = {
|
|
2
|
-
behavior: 'smooth',
|
|
3
|
-
init: {
|
|
4
|
-
pauseSelector: [],
|
|
5
|
-
paginationSelector: null,
|
|
6
|
-
paginationItemClass: null,
|
|
7
|
-
progressSelector: null,
|
|
8
|
-
counterMinSelector: null,
|
|
9
|
-
counterMaxSelector: null,
|
|
10
|
-
autoplay: false
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const prevSlide = (selector) => {
|
|
15
|
-
selector.scroll({ left: selector.scrollLeft - selector.children[0].clientWidth, behavior: defaultOptions.behavior })
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const nextSlide = (selector) => {
|
|
19
|
-
selector.scroll({ left: selector.scrollLeft + selector.children[0].clientWidth, behavior: defaultOptions.behavior })
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export const selectSlide = (selector, selected = 0) => {
|
|
23
|
-
const position = selector.scrollLeft / selector.children[0].clientWidth
|
|
24
|
-
|
|
25
|
-
if (position - selected <= 0) {
|
|
26
|
-
selector.scroll({ left: selector.scrollLeft + selector.children[0].clientWidth * (selected - 1 - position), behavior: defaultOptions.behavior })
|
|
27
|
-
} else {
|
|
28
|
-
selector.scroll({ left: selector.scrollLeft - selector.children[0].clientWidth * (position - selected + 1), behavior: defaultOptions.behavior })
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export const initSlider = (selector, options = defaultOptions.init) => {
|
|
33
|
-
let isDown; let paused; let startX; let scrollLeft = null
|
|
34
|
-
|
|
35
|
-
function isElementInViewport (element) {
|
|
36
|
-
const rect = element.getBoundingClientRect()
|
|
37
|
-
const sliderRect = selector.getBoundingClientRect()
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
rect.left >= sliderRect.left &&
|
|
41
|
-
rect.right <= sliderRect.right
|
|
42
|
-
)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function setProgressValue () {
|
|
46
|
-
if (options.progressSelector) {
|
|
47
|
-
options.progressSelector.value = ((selector.scrollLeft + selector.clientWidth) / selector.scrollWidth * 100).toFixed(2)
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (!selector.classList.contains('is-fade')) {
|
|
52
|
-
const grabbing = () => {
|
|
53
|
-
isDown = false
|
|
54
|
-
paused = false
|
|
55
|
-
selector.classList.remove('is-grabbing')
|
|
56
|
-
selector.scrollLeft = selector.scrollLeft - 1
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
selector.addEventListener('mouseleave', grabbing)
|
|
60
|
-
|
|
61
|
-
selector.addEventListener('mouseup', grabbing)
|
|
62
|
-
|
|
63
|
-
selector.addEventListener('mousedown', ({ pageX }) => {
|
|
64
|
-
isDown = true
|
|
65
|
-
paused = true
|
|
66
|
-
startX = pageX - selector.offsetLeft
|
|
67
|
-
scrollLeft = selector.scrollLeft
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
selector.addEventListener('mousemove', e => {
|
|
71
|
-
if (!isDown) return
|
|
72
|
-
e.preventDefault()
|
|
73
|
-
const x = e.pageX - selector.offsetLeft
|
|
74
|
-
const walk = (x - startX) * 1.25
|
|
75
|
-
|
|
76
|
-
selector.classList.add('is-grabbing')
|
|
77
|
-
selector.scrollLeft = scrollLeft - walk
|
|
78
|
-
|
|
79
|
-
selector.ondragstart = dragEvent => dragEvent.preventDefault()
|
|
80
|
-
})
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const itemsCount = selector.clientWidth > selector.children[0].clientWidth
|
|
84
|
-
? [...selector.children].reduce((item, children) =>
|
|
85
|
-
(selector.scrollWidth - selector.clientWidth > item.itemsWidth + children.clientWidth / 2)
|
|
86
|
-
? { itemsWidth: item.itemsWidth + children.clientWidth, count: item.count + 1 }
|
|
87
|
-
: item, { itemsWidth: 0, count: 0 }).count + 1
|
|
88
|
-
: Math.ceil((selector.scrollWidth) / selector.children[0].clientWidth)
|
|
89
|
-
|
|
90
|
-
if (options.counterMinSelector) {
|
|
91
|
-
options.counterMinSelector.textContent = 1
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (options.counterMaxSelector) {
|
|
95
|
-
options.counterMaxSelector.textContent = itemsCount
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (options.paginationSelector) {
|
|
99
|
-
options.paginationSelector.insertAdjacentHTML('beforeend', [...Array(itemsCount)].map((_, i) => `
|
|
100
|
-
<div class="${options.paginationItemClass ?? ''}${i === 0 ? ' active' : ''}"></div>
|
|
101
|
-
`).join(''))
|
|
102
|
-
|
|
103
|
-
;[...options.paginationSelector.children].forEach((children) => {
|
|
104
|
-
children.addEventListener('click', ({ currentTarget }) => {
|
|
105
|
-
selectSlide(selector, [...options.paginationSelector.children].indexOf(currentTarget) + 1)
|
|
106
|
-
})
|
|
107
|
-
})
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
setProgressValue()
|
|
111
|
-
|
|
112
|
-
selector.addEventListener('scroll', () => {
|
|
113
|
-
const activeSlide = parseInt((selector.scrollLeft / selector.children[0].clientWidth).toFixed(0))
|
|
114
|
-
|
|
115
|
-
for (const children of [...selector.children]) {
|
|
116
|
-
if (isElementInViewport(children)) {
|
|
117
|
-
children.classList.add('active')
|
|
118
|
-
} else {
|
|
119
|
-
children.classList.remove('active')
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
if (options.paginationSelector) {
|
|
124
|
-
[...options.paginationSelector.children].forEach(children => children.classList.remove('active'))
|
|
125
|
-
|
|
126
|
-
options.paginationSelector.children[activeSlide].classList.add('active')
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
setProgressValue()
|
|
130
|
-
|
|
131
|
-
if (options.counterMinSelector) {
|
|
132
|
-
options.counterMinSelector.textContent = activeSlide + 1
|
|
133
|
-
}
|
|
134
|
-
}, { passive: true })
|
|
135
|
-
|
|
136
|
-
if (options.progressSelector) {
|
|
137
|
-
options.progressSelector.addEventListener('click', ({ clientX, target }) => {
|
|
138
|
-
selector.scrollLeft = (selector.scrollWidth / 100) * (clientX - target.offsetLeft) / target.clientWidth * 100
|
|
139
|
-
})
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
;[...options.pauseSelector, options.progressSelector, options.paginationSelector, selector].forEach(element => {
|
|
143
|
-
if (typeof element !== 'undefined' && element !== null) {
|
|
144
|
-
element.addEventListener('mouseenter', () => (paused = true))
|
|
145
|
-
element.addEventListener('mouseleave', () => (paused = false))
|
|
146
|
-
}
|
|
147
|
-
})
|
|
148
|
-
|
|
149
|
-
if (options.autoplay && !isNaN(options.autoplay)) {
|
|
150
|
-
setInterval(() => {
|
|
151
|
-
if (!paused) {
|
|
152
|
-
if (selector.scrollLeft < selector.children[0].clientWidth * (selector.children.length - 1)) {
|
|
153
|
-
selector.scroll({ left: selector.scrollLeft + selector.children[0].clientWidth, behavior: self.behavior })
|
|
154
|
-
} else {
|
|
155
|
-
selector.scroll({ left: 0, behavior: options.behavior })
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}, options.autoplay)
|
|
159
|
-
}
|
|
160
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { loadStimulus, importStyle } from '../Utils/Functions/+.js'
|
|
2
|
-
import cdn from '../Utils/cdn.js'
|
|
3
|
-
|
|
4
|
-
export default class LibTippy {
|
|
5
|
-
async init (element, options, template) {
|
|
6
|
-
const tippy = (await import('tippy.js')).default
|
|
7
|
-
const { roundArrow } = await import('tippy.js')
|
|
8
|
-
|
|
9
|
-
await importStyle(cdn.tippy)
|
|
10
|
-
|
|
11
|
-
if (typeof element._tippy !== 'undefined') {
|
|
12
|
-
return false
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if (this.type.includes('dropdown')) {
|
|
16
|
-
this.options.placement = 'bottom-end'
|
|
17
|
-
this.options.maxWidth = 'none'
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (this.type.includes('arrow')) {
|
|
21
|
-
options.arrow = roundArrow
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (!template.startsWith('/')) {
|
|
25
|
-
if (template !== '') {
|
|
26
|
-
options.content = document.querySelector('#' + template).innerHTML
|
|
27
|
-
} else {
|
|
28
|
-
options.content = `
|
|
29
|
-
<div class="c-dropdown">
|
|
30
|
-
<div class="c_dropdown_body">
|
|
31
|
-
${element.getAttribute('aria-label')}
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
`
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (element.dataset.libTippySlot) {
|
|
39
|
-
for (const [key, value] of Object.entries(JSON.parse(element.dataset.libTippySlot))) {
|
|
40
|
-
options.content = options.content.replaceAll(`{${key}}`, value.toString()).replaceAll(`%7B${key}%7B`, value.toString())
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
tippy(element, options)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
constructor (element, attributes = ['tooltip', '']) {
|
|
48
|
-
const self = this
|
|
49
|
-
|
|
50
|
-
this.options = {
|
|
51
|
-
content: '',
|
|
52
|
-
placement: 'bottom',
|
|
53
|
-
trigger: 'mouseenter focus',
|
|
54
|
-
interactive: true,
|
|
55
|
-
appendTo: 'parent',
|
|
56
|
-
arrow: false,
|
|
57
|
-
animation: 'scale',
|
|
58
|
-
inertia: true,
|
|
59
|
-
allowHTML: true,
|
|
60
|
-
onShow: (instance) => {
|
|
61
|
-
if (this.type.includes('-full')) {
|
|
62
|
-
instance.popper.classList.add('is-full')
|
|
63
|
-
document.documentElement.classList.add('max-md:is-body-overlay')
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
instance.popper.querySelector('.tippy-box').setAttribute('data-name', this.template ?? this.type)
|
|
67
|
-
|
|
68
|
-
loadStimulus(instance.popper.querySelector('.tippy-content'))
|
|
69
|
-
},
|
|
70
|
-
onHide: () => {
|
|
71
|
-
if (this.type.includes('-full')) {
|
|
72
|
-
setTimeout(() => document.documentElement.classList.remove('max-md:is-body-overlay'), 50)
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
this.type = attributes[0]
|
|
78
|
-
this.template = attributes[1]
|
|
79
|
-
|
|
80
|
-
if (this.type.includes('dropdown')) {
|
|
81
|
-
this.options.trigger = 'click'
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (typeof element.dataset.tippyTrigger !== 'undefined') {
|
|
85
|
-
this.options.trigger = element.dataset.tippyTrigger
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
this.options.showOnCreate = true
|
|
89
|
-
|
|
90
|
-
this.options.trigger !== 'manual' && this.options.trigger.split(' ').forEach(event => {
|
|
91
|
-
element.addEventListener(event, async function e () {
|
|
92
|
-
if (self.template.startsWith('/') && self.options.content === '') {
|
|
93
|
-
element.style.cursor = 'wait'
|
|
94
|
-
element.classList.add('loading')
|
|
95
|
-
|
|
96
|
-
fetch(self.template, { headers: { 'X-Requested-With': 'XMLHttpRequest' } }).then(response => {
|
|
97
|
-
return response.json()
|
|
98
|
-
}).then(async data => {
|
|
99
|
-
self.options.content = data.content
|
|
100
|
-
element.style.cursor = ''
|
|
101
|
-
element.classList.remove('loading')
|
|
102
|
-
|
|
103
|
-
await self.init(element, self.options, self.template)
|
|
104
|
-
element.removeEventListener(event, e)
|
|
105
|
-
})
|
|
106
|
-
} else {
|
|
107
|
-
await self.init(element, self.options, self.template)
|
|
108
|
-
element.removeEventListener(event, e)
|
|
109
|
-
}
|
|
110
|
-
})
|
|
111
|
-
})
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export function hideTippy () {
|
|
116
|
-
document.querySelectorAll('[data-controller~="lib-tippy"][aria-expanded="true"]').forEach(element => element?._tippy?.hide())
|
|
117
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { default as importScript } from './importScript.js'
|
|
2
|
-
export { default as importStyle } from './importStyle.js'
|
|
3
|
-
export { default as inputStep } from './inputStep.js'
|
|
4
|
-
export { default as inputValidity } from './inputValidity.js'
|
|
5
|
-
export { default as loadStimulus } from './loadStimulus.js'
|
|
6
|
-
export { default as replaceScript } from './replaceScript.js'
|
|
7
|
-
export { default as replaceTag } from './replaceTag.js'
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export default function importScript (url) {
|
|
2
|
-
return new Promise((resolve, reject) => {
|
|
3
|
-
if (document.querySelector(`script[src="${url}"]`) === null) {
|
|
4
|
-
const script = document.createElement('script')
|
|
5
|
-
|
|
6
|
-
script._importScript = new Promise((resolve, reject) => {
|
|
7
|
-
script.src = url
|
|
8
|
-
script.onload = resolve
|
|
9
|
-
script.onerror = reject
|
|
10
|
-
}).then(resolve).catch(reject)
|
|
11
|
-
|
|
12
|
-
document.head.appendChild(script)
|
|
13
|
-
} else {
|
|
14
|
-
document.querySelector(`script[src="${url}"]`)._importScript.then(resolve)
|
|
15
|
-
}
|
|
16
|
-
})
|
|
17
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export default function importStyle (url) {
|
|
2
|
-
return new Promise((resolve, reject) => {
|
|
3
|
-
if (document.querySelector(`link[href="${url}"]`) === null) {
|
|
4
|
-
const style = document.createElement('link')
|
|
5
|
-
|
|
6
|
-
style._importStyle = new Promise((resolve, reject) => {
|
|
7
|
-
style.href = url
|
|
8
|
-
style.rel = 'stylesheet'
|
|
9
|
-
style.onload = resolve
|
|
10
|
-
style.onerror = reject
|
|
11
|
-
}).then(resolve).catch(reject)
|
|
12
|
-
|
|
13
|
-
document.head.prepend(style)
|
|
14
|
-
} else {
|
|
15
|
-
document.querySelector(`link[href="${url}"]`)._importStyle.then(resolve)
|
|
16
|
-
}
|
|
17
|
-
})
|
|
18
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export default function inputStep (input, increase, callback) {
|
|
2
|
-
const value = parseInt(input.value === '' ? 0 : input.value)
|
|
3
|
-
|
|
4
|
-
if ((increase && (value < input.max || input.max === '')) || (!increase && (value > input.min || input.min === ''))) {
|
|
5
|
-
input.value = increase ? (value + 1).toString() : (value - 1).toString()
|
|
6
|
-
callback && callback()
|
|
7
|
-
input.dispatchEvent(new Event('change', { bubbles: true }))
|
|
8
|
-
}
|
|
9
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
export default function inputValidity (element, options = {}) {
|
|
2
|
-
const { validate, message, iconElements } = {
|
|
3
|
-
validate: true,
|
|
4
|
-
message: false,
|
|
5
|
-
iconElements: '.ui-control',
|
|
6
|
-
...options
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const selectors = element.querySelectorAll('input, textarea, select')
|
|
10
|
-
|
|
11
|
-
selectors.forEach(selector => {
|
|
12
|
-
if (selector.closest('.air-datepicker')) {
|
|
13
|
-
return
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const validationMessage = selector.dataset.validationMessage ?? selector.validationMessage
|
|
17
|
-
const validityElement = element?.closest('.c-field')?.querySelector('.ui-info.validity')
|
|
18
|
-
|
|
19
|
-
if (!selector.outerHTML.match(/(data-novalidate|readonly|hidden)/) && validate) {
|
|
20
|
-
element.classList.remove('valid', 'invalid', 'active')
|
|
21
|
-
|
|
22
|
-
if (element.closest(iconElements) && element.querySelector('[class^="icon"] [class*="valid"]') !== null) {
|
|
23
|
-
element.querySelector('[class^="icon"] [class*="valid"]').remove()
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (selector.checkValidity()) {
|
|
27
|
-
element.classList.add('valid')
|
|
28
|
-
|
|
29
|
-
if (validityElement) {
|
|
30
|
-
validityElement.remove()
|
|
31
|
-
}
|
|
32
|
-
} else {
|
|
33
|
-
element.classList.add('invalid')
|
|
34
|
-
|
|
35
|
-
if (!validityElement && message) {
|
|
36
|
-
element?.closest('.c-field')?.insertAdjacentHTML('beforeend', `<div class="ui-info validity text-error">${validationMessage}</div>`)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (element.closest(iconElements) && element.querySelector('[class^="icon"] [class*="valid"]') === null) {
|
|
40
|
-
if (!element.querySelector('.icon-r')) {
|
|
41
|
-
element.insertAdjacentHTML('beforeend', '<div class="icon-r"></div>')
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
element.querySelector('.icon-r').insertAdjacentHTML('afterbegin', `
|
|
45
|
-
<div class="invalid lib-hint-top" tabindex="0" aria-label="${validationMessage}">
|
|
46
|
-
<svg class="text-error"><use href="#icon-exclamation-circle"></use></svg>
|
|
47
|
-
</div>
|
|
48
|
-
`)
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (selector.value !== '') {
|
|
54
|
-
element.classList.add('active')
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import naja from 'naja'
|
|
2
|
-
|
|
3
|
-
const dynamicControllers = ['ui-control', 'ui-text', 'ui-check']
|
|
4
|
-
const dynamicActions = [['.ui-btn', 'click->lib-ripple#show'], ['.ui-check', 'change->ui-check#validity']]
|
|
5
|
-
|
|
6
|
-
function loadControllers (parent, selectors) {
|
|
7
|
-
if (parent !== null) {
|
|
8
|
-
selectors.forEach(selector => {
|
|
9
|
-
[...parent.getElementsByClassName(selector)].forEach(element => {
|
|
10
|
-
const attribute = element.getAttribute('data-controller')
|
|
11
|
-
|
|
12
|
-
if (attribute === null) {
|
|
13
|
-
element.setAttribute('data-controller', selector)
|
|
14
|
-
} else {
|
|
15
|
-
element.setAttribute('data-controller', `${attribute} ${selector}`)
|
|
16
|
-
}
|
|
17
|
-
})
|
|
18
|
-
})
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function loadActions (parent, selectors) {
|
|
23
|
-
if (parent !== null) {
|
|
24
|
-
selectors.forEach(selector => {
|
|
25
|
-
parent.querySelectorAll(selector[0]).forEach(element => {
|
|
26
|
-
const attribute = element.getAttribute('data-action')
|
|
27
|
-
|
|
28
|
-
if (attribute === null) {
|
|
29
|
-
element.setAttribute('data-action', selector[1])
|
|
30
|
-
} else if (attribute.indexOf(selector[1]) === -1) {
|
|
31
|
-
element.setAttribute('data-action', `${attribute} ${selector[1]}`)
|
|
32
|
-
}
|
|
33
|
-
})
|
|
34
|
-
})
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export default function loadStimulus (selector, najaLoad = true) {
|
|
39
|
-
loadControllers(selector, dynamicControllers)
|
|
40
|
-
loadActions(selector, dynamicActions)
|
|
41
|
-
najaLoad && naja.uiHandler.bindUI(selector)
|
|
42
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export default function replaceTag (documentElement) {
|
|
2
|
-
documentElement.querySelectorAll('[data-lib-replace-tag]').forEach(element => {
|
|
3
|
-
const replaceTag = document.querySelector(`[data-lib-replace-tag=${element.dataset.libReplaceTag}]`)
|
|
4
|
-
const placement = element.closest('head') ? document.head : replaceTag.parentElement
|
|
5
|
-
|
|
6
|
-
replaceTag ? (replaceTag.outerHTML = element.outerHTML) : placement.insertAdjacentHTML('beforeend', element.outerHTML)
|
|
7
|
-
})
|
|
8
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
!CSS.supports('selector(:has(*))') && (async () => (await import('css-has-pseudo/browser')).default(document))()
|
|
2
|
-
|
|
3
|
-
if ('serviceWorker' in navigator && location.protocol === 'https:') {
|
|
4
|
-
window.addEventListener('load', () => {
|
|
5
|
-
if (!document.documentElement.classList.contains('no-sw')) {
|
|
6
|
-
navigator.serviceWorker.register('/sw.js').catch(e => console.error(e))
|
|
7
|
-
} else {
|
|
8
|
-
navigator.serviceWorker.getRegistrations().then(async registrations => {
|
|
9
|
-
for (const registration of registrations) {
|
|
10
|
-
await registration.unregister()
|
|
11
|
-
}
|
|
12
|
-
})
|
|
13
|
-
}
|
|
14
|
-
})
|
|
15
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
.c-cookieconsent {
|
|
2
|
-
position: fixed;
|
|
3
|
-
inset: 0;
|
|
4
|
-
display: none;
|
|
5
|
-
z-index: var(--z-50);
|
|
6
|
-
background-color: rgb(var(--color-dark-rgb) / 75%);
|
|
7
|
-
justify-content: center;
|
|
8
|
-
align-items: center;
|
|
9
|
-
flex-direction: column;
|
|
10
|
-
|
|
11
|
-
@media print {
|
|
12
|
-
display: none !important;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
&:not(.is-animate) {
|
|
16
|
-
animation: 0.5s ease 0s forwards 1 fade-out;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&.is-animate {
|
|
20
|
-
animation: 0.5s ease 0s backwards 1 fade-in;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&.active {
|
|
24
|
-
display: flex;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
> .c {
|
|
28
|
-
max-width: 32rem;
|
|
29
|
-
width: calc(100% - 2rem);
|
|
30
|
-
border-radius: var(--rounded-2xl);
|
|
31
|
-
padding: 1rem;
|
|
32
|
-
background-color: var(--color-body-primary);
|
|
33
|
-
|
|
34
|
-
@media (--media-md) {
|
|
35
|
-
padding: 2rem;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
> .c_head {
|
|
39
|
-
margin-bottom: 1rem;
|
|
40
|
-
|
|
41
|
-
@media (--media-md) {
|
|
42
|
-
margin-bottom: 1.5rem;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
> .c_foot {
|
|
47
|
-
display: flex;
|
|
48
|
-
align-items: center;
|
|
49
|
-
margin-top: 1.5rem;
|
|
50
|
-
|
|
51
|
-
@media (--media-md) {
|
|
52
|
-
margin-top: 2rem;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&.is-center {
|
|
58
|
-
> .c {
|
|
59
|
-
max-width: 27rem;
|
|
60
|
-
text-align: center;
|
|
61
|
-
|
|
62
|
-
& .ui-image {
|
|
63
|
-
margin-left: auto;
|
|
64
|
-
margin-right: auto;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import "Default.css";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import "winduum/src/libraries/dialog.css";
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
.lib-drawer {
|
|
2
|
-
--lib-drawer-opacity: 0;
|
|
3
|
-
|
|
4
|
-
z-index: var(--z-30);
|
|
5
|
-
width: 100%;
|
|
6
|
-
height: 100%;
|
|
7
|
-
position: fixed;
|
|
8
|
-
inset: 0;
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-direction: row;
|
|
12
|
-
|
|
13
|
-
& > div {
|
|
14
|
-
scroll-snap-align: end;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
&[data-action*="scroll"] {
|
|
18
|
-
overflow-x: auto;
|
|
19
|
-
overflow-y: hidden;
|
|
20
|
-
-webkit-overflow-scrolling: touch;
|
|
21
|
-
user-select: none;
|
|
22
|
-
scrollbar-width: none;
|
|
23
|
-
-ms-overflow-style: none;
|
|
24
|
-
|
|
25
|
-
&.active {
|
|
26
|
-
scroll-snap-type: x proximity;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&::-webkit-scrollbar {
|
|
30
|
-
width: 0;
|
|
31
|
-
height: 0;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
&::before {
|
|
36
|
-
position: fixed;
|
|
37
|
-
inset: 0;
|
|
38
|
-
z-index: -1;
|
|
39
|
-
background-color: rgb(var(--color-dark-rgb) / 50%);
|
|
40
|
-
content: "";
|
|
41
|
-
opacity: var(--lib-drawer-opacity);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
&::after {
|
|
45
|
-
content: "";
|
|
46
|
-
display: block;
|
|
47
|
-
min-width: 100vw;
|
|
48
|
-
scroll-snap-align: end;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&.is-opacity {
|
|
52
|
-
&::before {
|
|
53
|
-
transition: var(--transition-opacity);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&:not(.active) {
|
|
58
|
-
pointer-events: none;
|
|
59
|
-
|
|
60
|
-
&::before {
|
|
61
|
-
opacity: 0;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|