@iamproperty/components 7.7.1--beta18 → 7.7.1--beta20
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/assets/css/components/carousel.component.css +1 -1
- package/assets/css/components/carousel.component.css.map +1 -1
- package/assets/css/components/carousel.config.css +1 -1
- package/assets/css/components/carousel.config.css.map +1 -1
- package/assets/css/components/skeleton.component.css +1 -0
- package/assets/css/components/skeleton.component.css.map +1 -0
- package/assets/css/components/skeleton.global.css +1 -0
- package/assets/css/components/skeleton.global.css.map +1 -0
- package/assets/css/core.min.css +1 -1
- package/assets/css/core.min.css.map +1 -1
- package/assets/css/elements/spinner.css +1 -0
- package/assets/css/elements/spinner.css.map +1 -0
- package/assets/css/style.min.css +1 -1
- package/assets/css/style.min.css.map +1 -1
- package/assets/js/components/accordion/accordion.component.min.js +1 -1
- package/assets/js/components/actionbar/actionbar.component.min.js +1 -1
- package/assets/js/components/address-lookup/address-lookup.component.min.js +1 -1
- package/assets/js/components/advanced-select/advanced-select.component.min.js +1 -1
- package/assets/js/components/applied-filters/applied-filters.component.min.js +1 -1
- package/assets/js/components/barchart/barchart.component.min.js +1 -1
- package/assets/js/components/bento-grid/bento-grid.component.min.js +1 -1
- package/assets/js/components/bone/bone.component.js +20 -0
- package/assets/js/components/bone/bone.component.min.js +9 -0
- package/assets/js/components/bone/bone.component.min.js.map +1 -0
- package/assets/js/components/button/button.component.min.js +1 -1
- package/assets/js/components/calendar/calendar.component.min.js +1 -1
- package/assets/js/components/card/card.component.min.js +1 -1
- package/assets/js/components/carousel/carousel.component.js +19 -38
- package/assets/js/components/carousel/carousel.component.min.js +8 -16
- package/assets/js/components/carousel/carousel.component.min.js.map +1 -1
- package/assets/js/components/collapsible-side/collapsible-side.component.min.js +1 -1
- package/assets/js/components/config/config.component.min.js +1 -1
- package/assets/js/components/content/content.component.js +2 -0
- package/assets/js/components/content/content.component.min.js +3 -3
- package/assets/js/components/content/content.component.min.js.map +1 -1
- package/assets/js/components/darkmode/darkmode.component.min.js +1 -1
- package/assets/js/components/doughnutchart/doughnutchart.component.min.js +1 -1
- package/assets/js/components/fileupload/fileupload.component.min.js +1 -1
- package/assets/js/components/filter-card/filter-card.component.min.js +1 -1
- package/assets/js/components/filterlist/filterlist.component.min.js +1 -1
- package/assets/js/components/form/form.component.js +40 -1
- package/assets/js/components/form/form.component.min.js +3 -3
- package/assets/js/components/form/form.component.min.js.map +1 -1
- package/assets/js/components/header/header.component.min.js +1 -1
- package/assets/js/components/inline-edit/inline-edit.component.min.js +1 -1
- package/assets/js/components/input/input.component.min.js +1 -1
- package/assets/js/components/input-range/input-range.component.min.js +1 -1
- package/assets/js/components/marketing/marketing.component.min.js +1 -1
- package/assets/js/components/menu/menu.component.min.js +1 -1
- package/assets/js/components/milestone/milestone.component.min.js +1 -1
- package/assets/js/components/milestone-group/milestone-group.component.min.js +1 -1
- package/assets/js/components/modal/modal.component.min.js +1 -1
- package/assets/js/components/multi-step/multi-step.component.min.js +1 -1
- package/assets/js/components/multi-step-modal/multi-step-modal.component.min.js +1 -1
- package/assets/js/components/multiselect/multiselect.component.min.js +1 -1
- package/assets/js/components/nav/nav.component.min.js +1 -1
- package/assets/js/components/notification/notification.component.min.js +1 -1
- package/assets/js/components/pagination/pagination.component.min.js +1 -1
- package/assets/js/components/password/password.component.min.js +1 -1
- package/assets/js/components/popover/popover.component.min.js +1 -1
- package/assets/js/components/rank/rank.component.min.js +1 -1
- package/assets/js/components/rankings/rankings.component.min.js +1 -1
- package/assets/js/components/rating/rating.component.min.js +1 -1
- package/assets/js/components/record-card/record-card.component.min.js +1 -1
- package/assets/js/components/search/search.component.min.js +1 -1
- package/assets/js/components/skeleton/skeleton.component.js +34 -0
- package/assets/js/components/skeleton/skeleton.component.min.js +11 -0
- package/assets/js/components/skeleton/skeleton.component.min.js.map +1 -0
- package/assets/js/components/slider/slider.component.min.js +1 -1
- package/assets/js/components/split-button/split-button.component.min.js +1 -1
- package/assets/js/components/std-address-lookup/std-address-lookup.component.min.js +1 -1
- package/assets/js/components/std-nav/std-nav.component.min.js +1 -1
- package/assets/js/components/std-nav-standalone/std-nav-standalone.component.min.js +1 -1
- package/assets/js/components/table/table.component.min.js +1 -1
- package/assets/js/components/table-ajax/table-ajax.component.min.js +1 -1
- package/assets/js/components/table-basic/table-basic.component.min.js +1 -1
- package/assets/js/components/table-no-submit/table-no-submit.component.min.js +1 -1
- package/assets/js/components/table-submit/table-submit.component.min.js +1 -1
- package/assets/js/components/tabs/tabs.component.min.js +1 -1
- package/assets/js/components/tag/tag.component.min.js +1 -1
- package/assets/js/components/tooltip/tooltip.component.min.js +1 -1
- package/assets/js/components/video/video.component.min.js +1 -1
- package/assets/js/components/video-card/video-card.component.min.js +1 -1
- package/assets/js/components/video-modal/video-modal.component.min.js +1 -1
- package/assets/js/components/word-count/word-count.component.min.js +1 -1
- package/assets/js/modules/content.js +11 -0
- package/assets/js/scripts.bundle.js +1 -1
- package/assets/js/scripts.bundle.min.js +1 -1
- package/assets/sass/_components.scss +1 -0
- package/assets/sass/_elements.scss +1 -0
- package/assets/sass/components/carousel.component.scss +0 -640
- package/assets/sass/components/carousel.config.scss +670 -7
- package/assets/sass/components/skeleton.component.scss +104 -0
- package/assets/sass/components/skeleton.global.scss +27 -0
- package/assets/sass/elements/spinner.css +29 -0
- package/assets/sass/foundations/reboot.scss +1 -0
- package/assets/sass/foundations/root.scss +7 -5
- package/assets/ts/components/bone/bone.component.ts +25 -0
- package/assets/ts/components/carousel/carousel.component.ts +29 -53
- package/assets/ts/components/content/content.component.ts +4 -0
- package/assets/ts/components/form/form.component.ts +58 -1
- package/assets/ts/components/skeleton/skeleton.component.ts +46 -0
- package/assets/ts/modules/content.ts +17 -0
- package/dist/components.es.js +51 -51
- package/dist/components.umd.js +127 -125
- package/package.json +1 -1
- package/src/components/Skeleton/Bone.vue +19 -0
- package/src/components/Skeleton/Skeleton.vue +19 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
|
|
3
|
+
::slotted(.heading) {
|
|
4
|
+
|
|
5
|
+
--bone-height: var(--h2-fs);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/* #region Cards */
|
|
9
|
+
:host(.hasCard) {
|
|
10
|
+
display: flex;
|
|
11
|
+
column-gap: 1rem;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@container (min-width: 36em) {
|
|
16
|
+
:host(.hasCard) {
|
|
17
|
+
|
|
18
|
+
flex-direction: row;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
::slotted(.card) {
|
|
23
|
+
|
|
24
|
+
background-color: var(--colour-light)!important;
|
|
25
|
+
height: unset!important;
|
|
26
|
+
min-height: unset!important;
|
|
27
|
+
aspect-ratio: 1.2/1;
|
|
28
|
+
border: 1px solid var(--colour-border);
|
|
29
|
+
display: flex!important;
|
|
30
|
+
padding: 1rem 0.75rem;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
justify-content: flex-end;
|
|
33
|
+
|
|
34
|
+
&:before {
|
|
35
|
+
|
|
36
|
+
margin-bottom: 0.75rem;
|
|
37
|
+
}
|
|
38
|
+
&:before,
|
|
39
|
+
&:after {
|
|
40
|
+
content: "";
|
|
41
|
+
display: block;
|
|
42
|
+
background-color: #D9D9D9; /* TODO: needs to be a variable */
|
|
43
|
+
display: block;
|
|
44
|
+
width: auto;
|
|
45
|
+
height: var(--bone-height);
|
|
46
|
+
border-radius: 0.5rem;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/* #endregion */
|
|
50
|
+
|
|
51
|
+
/* search */
|
|
52
|
+
::slotted(.search) {
|
|
53
|
+
|
|
54
|
+
background-color: var(--colour-white)!important;
|
|
55
|
+
height: 3rem!important;
|
|
56
|
+
min-height: 3rem!important;
|
|
57
|
+
border: 1px solid var(--colour-border)!important;
|
|
58
|
+
border-radius: 1.5rem!important;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* buttons */
|
|
62
|
+
::slotted(.btn) {
|
|
63
|
+
min-width: 19rem!important; /* 304px*/
|
|
64
|
+
width: 19rem!important; /* 304px*/
|
|
65
|
+
//min-height: calc(var(--btn-line-height) + var(--btn-padding-block) + var(--btn-padding-block))!important;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
::slotted(:is(.btn,.badge,.tag):empty):before {
|
|
69
|
+
content: "\00a0";
|
|
70
|
+
margin: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:host(:is(.hasBtn, .hasBadge, .hasTag)) {
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-wrap: wrap;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
::slotted(:is(.badge,.tag)) {
|
|
79
|
+
min-width: 5rem!important; /* 80px */
|
|
80
|
+
width: 5rem!important; /* 80px */
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
::slotted(.link) {
|
|
84
|
+
|
|
85
|
+
min-width: 8rem!important; /* 128px */
|
|
86
|
+
width: 8rem!important; /* 128px */
|
|
87
|
+
}
|
|
88
|
+
::slotted(.link):after {
|
|
89
|
+
|
|
90
|
+
margin-top: 0.25rem;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* spinner */
|
|
94
|
+
:host(.hasSpinner) ::slotted(*) {
|
|
95
|
+
|
|
96
|
+
width: var(--spinner-size)!important;
|
|
97
|
+
margin-inline: auto!important;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
::slotted(.spinner){
|
|
101
|
+
|
|
102
|
+
background-color: transparent!important;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
|
|
3
|
+
iam-skeleton {
|
|
4
|
+
--bone-height: 0.8125rem; /* 13px */;
|
|
5
|
+
--colour-heading: #D9D9D9;
|
|
6
|
+
--colour-underline: #D9D9D9;
|
|
7
|
+
container-type: inline-size;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
iam-bone {
|
|
11
|
+
background-color: #D9D9D9; /* TODO: needs to be a variable */
|
|
12
|
+
border: unset;
|
|
13
|
+
display: block;
|
|
14
|
+
width: 100%;
|
|
15
|
+
min-height: var(--bone-height);
|
|
16
|
+
pointer-events: none!important;
|
|
17
|
+
margin-bottom: 1rem;
|
|
18
|
+
|
|
19
|
+
&:not(.btn,.badge,.tag){
|
|
20
|
+
|
|
21
|
+
height: var(--bone-height);
|
|
22
|
+
border-radius: 0.5rem;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
.spinner {
|
|
4
|
+
|
|
5
|
+
font-size: var(--spinner-size);
|
|
6
|
+
|
|
7
|
+
display: block;
|
|
8
|
+
margin-inline: auto;
|
|
9
|
+
position: relative;
|
|
10
|
+
width: var(--spinner-size);
|
|
11
|
+
height: var(--spinner-size);
|
|
12
|
+
color: var(--colour-heading);
|
|
13
|
+
|
|
14
|
+
&:before {
|
|
15
|
+
font-family: var(--fa-family-classic);
|
|
16
|
+
content: '\f3f4';
|
|
17
|
+
position: absolute;
|
|
18
|
+
font-weight: 900;
|
|
19
|
+
color: var(--colour-heading);
|
|
20
|
+
animation: spin 1.5s infinite steps(10);
|
|
21
|
+
font-size: 1em;
|
|
22
|
+
top: 50%;
|
|
23
|
+
left: 50%;
|
|
24
|
+
translate: -50% -50%;
|
|
25
|
+
z-index: 1;
|
|
26
|
+
|
|
27
|
+
font-weight: normal;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -236,22 +236,24 @@
|
|
|
236
236
|
--max-height-lg: 37.5rem; /* 600px */
|
|
237
237
|
|
|
238
238
|
|
|
239
|
+
/* #region Dropdown */
|
|
239
240
|
--dropdown-bg: var(--colour-canvas-2);
|
|
240
241
|
--dropdown-margin-block: 0.25rem;
|
|
241
242
|
--dropdown-padding: 0.5rem;
|
|
242
243
|
--dropdown-border-radius: 0.5rem;
|
|
243
244
|
--dropdown-box-shadow: 0px 2px 9px rgba(0, 0, 0, 0.1);
|
|
244
|
-
|
|
245
245
|
--option-border-radius: 0.25rem;
|
|
246
|
-
|
|
247
|
-
--option-color: var(--colour-primary);
|
|
248
|
-
|
|
246
|
+
--option-color: var(--colour-primary);
|
|
249
247
|
--option-bg-hover: var(--colour-light);
|
|
250
248
|
--option-padding: 0.5rem;
|
|
251
249
|
--option-color-hover: #595959; /* Magic number */
|
|
252
250
|
--option-bg-active: hsl(from var(--colour-info) h s l / 10%);
|
|
253
|
-
|
|
254
251
|
--option-border-left-active: 4px solid var(--colour-info);
|
|
252
|
+
/* #endregion */
|
|
253
|
+
|
|
254
|
+
/* #region Spinner */
|
|
255
|
+
--spinner-size: 7rem; /* 112px */
|
|
256
|
+
/* #endregion */
|
|
255
257
|
|
|
256
258
|
/* Add in media query based updates to the global vars like updating the heading 1 font size */
|
|
257
259
|
@media screen and (min-width: 36em) {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { trackComponent, trackComponentRegistered } from '../_global';
|
|
2
|
+
|
|
3
|
+
trackComponentRegistered('iam-bone');
|
|
4
|
+
|
|
5
|
+
class iamBone extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.attachShadow({ mode: 'open' });
|
|
9
|
+
|
|
10
|
+
const template = document.createElement('template');
|
|
11
|
+
template.innerHTML = `
|
|
12
|
+
<div class="wrapper">
|
|
13
|
+
<slot></slot>
|
|
14
|
+
</div>
|
|
15
|
+
`;
|
|
16
|
+
this.shadowRoot?.appendChild(template.content.cloneNode(true));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
connectedCallback(): void {
|
|
20
|
+
console.log('bone');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
export default iamBone;
|
|
@@ -5,37 +5,6 @@ trackComponentRegistered('iam-carousel');
|
|
|
5
5
|
class iamCarousel extends HTMLElement {
|
|
6
6
|
constructor() {
|
|
7
7
|
super();
|
|
8
|
-
this.attachShadow({ mode: 'open' });
|
|
9
|
-
|
|
10
|
-
const assetLocation = document.body.hasAttribute('data-assets-location')
|
|
11
|
-
? document.body.getAttribute('data-assets-location')
|
|
12
|
-
: '/assets';
|
|
13
|
-
|
|
14
|
-
const loadCSS = `@import "${assetLocation}/css/components/carousel.component.css";`;
|
|
15
|
-
|
|
16
|
-
const template = document.createElement('template');
|
|
17
|
-
template.innerHTML = /* HTML */ `
|
|
18
|
-
<style>
|
|
19
|
-
${loadCSS}
|
|
20
|
-
${this.hasAttribute('css') ? `@import "${this.getAttribute('css')}";` : ``}
|
|
21
|
-
</style>
|
|
22
|
-
<div class="carousel-wrapper">
|
|
23
|
-
<div class="carousel" part="carousel">
|
|
24
|
-
<slot></slot>
|
|
25
|
-
</div>
|
|
26
|
-
<div class="carousel__controls"></div>
|
|
27
|
-
<div id="carousel__progress" class="carousel__progress">
|
|
28
|
-
<input type="range" min="0" max="100" value="0" step="1" />
|
|
29
|
-
</div>
|
|
30
|
-
<div id="carousel__progress-sm" class="carousel__progress">
|
|
31
|
-
<input type="range" min="0" max="100" value="0" step="1" />
|
|
32
|
-
</div>
|
|
33
|
-
<div id="carousel__progress-md" class="carousel__progress">
|
|
34
|
-
<input type="range" min="0" max="100" value="0" step="1" />
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
`;
|
|
38
|
-
this.shadowRoot.appendChild(template.content.cloneNode(true));
|
|
39
8
|
}
|
|
40
9
|
|
|
41
10
|
generateThumbnailList = (carouselComponent): any => {
|
|
@@ -78,12 +47,27 @@ class iamCarousel extends HTMLElement {
|
|
|
78
47
|
|
|
79
48
|
connectedCallback(): void {
|
|
80
49
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
50
|
+
this.insertAdjacentHTML('beforeend',`
|
|
51
|
+
<div class="carousel__controls">
|
|
52
|
+
<div class="carousel__pips"></div>
|
|
53
|
+
<div class="carousel__progress carousel__progress-xs">
|
|
54
|
+
<input type="range" min="0" max="100" value="0" step="1" />
|
|
55
|
+
</div>
|
|
56
|
+
<div class="carousel__progress carousel__progress-sm">
|
|
57
|
+
<input type="range" min="0" max="100" value="0" step="1" />
|
|
58
|
+
</div>
|
|
59
|
+
<div class="carousel__progress carousel__progress-md">
|
|
60
|
+
<input type="range" min="0" max="100" value="0" step="1" />
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
`)
|
|
64
|
+
|
|
65
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
66
|
+
const carouselElement = this;
|
|
67
|
+
const carouselProgress = this.querySelector('.carousel__progress-xs [type="range"]');
|
|
68
|
+
const carouselProgressSM = this.querySelector('.carousel__progress-sm [type="range"]');
|
|
69
|
+
const carouselProgressMD = this.querySelector('.carousel__progress-md [type="range"]');
|
|
70
|
+
const itemCount = this.querySelectorAll(':scope > *:not(.carousel__controls)').length;
|
|
87
71
|
const progressPercent = this.progressPercent;
|
|
88
72
|
|
|
89
73
|
let stepperInterval,
|
|
@@ -95,13 +79,10 @@ class iamCarousel extends HTMLElement {
|
|
|
95
79
|
stepperStart = 'touchstart';
|
|
96
80
|
}
|
|
97
81
|
|
|
98
|
-
|
|
99
|
-
carouselElement?.setAttribute('data-smcols',this.getAttribute('data-smcols'));
|
|
100
|
-
carouselElement?.setAttribute('data-mdcols',this.getAttribute('data-mdcols'));
|
|
101
|
-
|
|
82
|
+
|
|
102
83
|
carouselProgress.setAttribute('max', itemCount);
|
|
103
84
|
carouselProgress.style.setProperty('--percent', progressPercent(carouselProgress.value, itemCount));
|
|
104
|
-
|
|
85
|
+
|
|
105
86
|
carouselProgress.addEventListener(stepperStart, () => {
|
|
106
87
|
clearInterval(stepperInterval);
|
|
107
88
|
stepperInterval = setInterval(function () {
|
|
@@ -126,10 +107,9 @@ class iamCarousel extends HTMLElement {
|
|
|
126
107
|
behavior: 'smooth',
|
|
127
108
|
});
|
|
128
109
|
});
|
|
129
|
-
|
|
130
|
-
|
|
110
|
+
|
|
111
|
+
|
|
131
112
|
// SM Progress bar
|
|
132
|
-
|
|
133
113
|
const smStep = this.getAttribute('data-smcols') ? this.getAttribute('data-smcols') : 1;
|
|
134
114
|
const smItemCount = Math.floor(itemCount / smStep) * smStep;
|
|
135
115
|
|
|
@@ -156,8 +136,6 @@ class iamCarousel extends HTMLElement {
|
|
|
156
136
|
carouselProgressSM.style.setProperty('--percent', progressPercent(carouselProgressSM.value, smItemCount));
|
|
157
137
|
const scrollTo = Math.floor((carouselElement.scrollWidth / smItemCount) * carouselProgressSM.value);
|
|
158
138
|
|
|
159
|
-
console.log(carouselProgressSM.value);
|
|
160
|
-
|
|
161
139
|
carouselElement.scrollTo({
|
|
162
140
|
top: 0,
|
|
163
141
|
left: scrollTo,
|
|
@@ -193,8 +171,6 @@ class iamCarousel extends HTMLElement {
|
|
|
193
171
|
carouselProgressMD.style.setProperty('--percent', progressPercent(carouselProgressMD.value, mdItemCount));
|
|
194
172
|
const scrollTo = Math.floor((carouselElement.scrollWidth / mdItemCount) * carouselProgressMD.value);
|
|
195
173
|
|
|
196
|
-
console.log(carouselProgressMD.value);
|
|
197
|
-
|
|
198
174
|
carouselElement.scrollTo({
|
|
199
175
|
top: 0,
|
|
200
176
|
left: scrollTo,
|
|
@@ -204,17 +180,17 @@ class iamCarousel extends HTMLElement {
|
|
|
204
180
|
|
|
205
181
|
|
|
206
182
|
// Thumbnails
|
|
207
|
-
const
|
|
183
|
+
const carouselPips = this.querySelector('.carousel__pips');
|
|
208
184
|
|
|
209
185
|
if (carouselElement.querySelector('[data-thumbnail]')) {
|
|
210
186
|
const thumbnailImages = this.generateThumbnailList(carouselElement);
|
|
211
187
|
carouselElement.classList.add('thumbnails');
|
|
212
|
-
|
|
188
|
+
carouselPips.innerHTML = this.generatePipsHTML(carouselElement, thumbnailImages);
|
|
213
189
|
}
|
|
214
190
|
|
|
215
|
-
|
|
191
|
+
carouselPips.addEventListener('click', (event) => {
|
|
216
192
|
|
|
217
|
-
|
|
193
|
+
carouselPips?.querySelector('[aria-current]')?.removeAttribute('aria-current');
|
|
218
194
|
if(event.target.closest('button[data-slide]')){
|
|
219
195
|
|
|
220
196
|
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
|
|
2
|
+
import { transformButtons } from '../../modules/content';
|
|
3
|
+
|
|
1
4
|
class iamContent extends HTMLElement {
|
|
2
5
|
constructor() {
|
|
3
6
|
super();
|
|
@@ -136,6 +139,7 @@ class iamContent extends HTMLElement {
|
|
|
136
139
|
|
|
137
140
|
fixContent(component);
|
|
138
141
|
registerComponents(component);
|
|
142
|
+
transformButtons(component);
|
|
139
143
|
}
|
|
140
144
|
};
|
|
141
145
|
|
|
@@ -138,6 +138,61 @@ class iamForm extends HTMLElement {
|
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
getCheckboxLimit = (element):number => {
|
|
142
|
+
|
|
143
|
+
const limit = parseInt(element.getAttribute('data-checkbox-limit') || '10', 10);
|
|
144
|
+
|
|
145
|
+
return !isNaN(limit) && limit > 0 ? limit : 10;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
limitCheckboxes = (event?:Event):void => {
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
const target = event?.target instanceof HTMLInputElement ? event.target : null;
|
|
153
|
+
const changedCheckbox = target?.matches('input[type="checkbox"]') ? target : null;
|
|
154
|
+
const checkboxLimitGroup = changedCheckbox?.closest('[data-checkbox-limit]');
|
|
155
|
+
const checkboxLimitGroups = checkboxLimitGroup
|
|
156
|
+
? [checkboxLimitGroup]
|
|
157
|
+
: [
|
|
158
|
+
...(this.hasAttribute('data-checkbox-limit') ? [this] : []),
|
|
159
|
+
...Array.from(this.querySelectorAll('[data-checkbox-limit]')),
|
|
160
|
+
];
|
|
161
|
+
|
|
162
|
+
checkboxLimitGroups.forEach((group) => {
|
|
163
|
+
|
|
164
|
+
const limit = this.getCheckboxLimit(group);
|
|
165
|
+
const checked = Array.from(group.querySelectorAll('input[type="checkbox"]:checked'));
|
|
166
|
+
const notChecked = Array.from(group.querySelectorAll('input[type="checkbox"]:not(:checked)'));
|
|
167
|
+
|
|
168
|
+
notChecked.forEach((checkbox) => {
|
|
169
|
+
|
|
170
|
+
checkbox.setAttribute('disabled','disabled');
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
if(checked.length < limit){
|
|
174
|
+
notChecked.forEach((checkbox) => {
|
|
175
|
+
|
|
176
|
+
checkbox.removeAttribute('disabled');
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if(checked.length <= limit)
|
|
181
|
+
return;
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
if(changedCheckbox?.checked && group.contains(changedCheckbox)) {
|
|
185
|
+
changedCheckbox.checked = false;
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
checked.slice(limit).forEach((checkbox) => {
|
|
190
|
+
|
|
191
|
+
checkbox.checked = false;
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
|
|
141
196
|
connectedCallback(): void {
|
|
142
197
|
|
|
143
198
|
const form = this.querySelector('form');
|
|
@@ -181,9 +236,10 @@ class iamForm extends HTMLElement {
|
|
|
181
236
|
this.readonlyIf();
|
|
182
237
|
this.writeIf();
|
|
183
238
|
this.emptyIf();
|
|
239
|
+
this.limitCheckboxes();
|
|
184
240
|
|
|
185
241
|
|
|
186
|
-
form.addEventListener('change', () => {
|
|
242
|
+
form.addEventListener('change', (event) => {
|
|
187
243
|
|
|
188
244
|
this.showIf();
|
|
189
245
|
this.hideIf();
|
|
@@ -193,6 +249,7 @@ class iamForm extends HTMLElement {
|
|
|
193
249
|
this.readonlyIf();
|
|
194
250
|
this.writeIf();
|
|
195
251
|
this.emptyIf();
|
|
252
|
+
this.limitCheckboxes(event);
|
|
196
253
|
|
|
197
254
|
Array.from(form.querySelectorAll('.conditional [data-conditional-required], .conditional [data-conditional-data-required]')).forEach((input) => {
|
|
198
255
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { trackComponent, trackComponentRegistered } from '../_global';
|
|
2
|
+
|
|
3
|
+
trackComponentRegistered('iam-skeleton');
|
|
4
|
+
|
|
5
|
+
class iamSkeleton extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.attachShadow({ mode: 'open' });
|
|
9
|
+
|
|
10
|
+
const assetLocation = document.body.hasAttribute('data-assets-location')
|
|
11
|
+
? document.body.getAttribute('data-assets-location')
|
|
12
|
+
: '/assets';
|
|
13
|
+
|
|
14
|
+
const loadCSS = `@import "${assetLocation}/css/components/skeleton.component.css";`;
|
|
15
|
+
|
|
16
|
+
const template = document.createElement('template');
|
|
17
|
+
template.innerHTML = /* HTML */`
|
|
18
|
+
<style>
|
|
19
|
+
${loadCSS}
|
|
20
|
+
</style>
|
|
21
|
+
<slot></slot>
|
|
22
|
+
`;
|
|
23
|
+
this.shadowRoot?.appendChild(template.content.cloneNode(true));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
connectedCallback(): void {
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
if(this.querySelector('.card'))
|
|
30
|
+
this.classList.add('hasCard');
|
|
31
|
+
|
|
32
|
+
if(this.querySelector('.btn'))
|
|
33
|
+
this.classList.add('hasBtn');
|
|
34
|
+
|
|
35
|
+
if(this.querySelector('.tag'))
|
|
36
|
+
this.classList.add('hasTag');
|
|
37
|
+
|
|
38
|
+
if(this.querySelector('.badge'))
|
|
39
|
+
this.classList.add('hasBadge');
|
|
40
|
+
|
|
41
|
+
if(this.querySelector('.spinner'))
|
|
42
|
+
this.classList.add('hasSpinner');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default iamSkeleton;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const transformButtons = (component):void => {
|
|
2
|
+
|
|
3
|
+
Array.from(document.querySelectorAll('.wp-block-buttons')).forEach((buttons) => {
|
|
4
|
+
|
|
5
|
+
const fragment = document.createDocumentFragment();
|
|
6
|
+
|
|
7
|
+
Array.from(buttons.querySelectorAll('.wp-block-button')).forEach((element) => {
|
|
8
|
+
|
|
9
|
+
const link = element.querySelector('a');
|
|
10
|
+
link.setAttribute('class',element.getAttribute('class'));
|
|
11
|
+
|
|
12
|
+
fragment.appendChild(link);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
buttons.parentNode.replaceChild(fragment, buttons);
|
|
16
|
+
});
|
|
17
|
+
}
|