@iamproperty/components 3.7.9 → 3.8.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/assets/css/components/accordion.css.map +1 -1
- package/assets/css/components/dialog.css +1 -1
- package/assets/css/components/dialog.css.map +1 -1
- package/assets/css/components/fileupload.css.map +1 -1
- package/assets/css/components/forms.css +1 -1
- package/assets/css/components/forms.css.map +1 -1
- package/assets/css/components/header.css +1 -1
- package/assets/css/components/header.css.map +1 -1
- package/assets/css/components/lists.css.map +1 -1
- package/assets/css/components/nav.css +1 -1
- package/assets/css/components/nav.css.map +1 -1
- package/assets/css/components/property-searchbar.css +1 -1
- package/assets/css/components/property-searchbar.css.map +1 -1
- package/assets/css/core.min.css +1 -1
- package/assets/css/core.min.css.map +1 -1
- 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/applied-filters/applied-filters.component.min.js +1 -1
- package/assets/js/components/card/card.component.min.js +1 -1
- package/assets/js/components/filterlist/filterlist.component.min.js +1 -1
- package/assets/js/components/header/header.component.min.js +2 -2
- 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/table/table.component.min.js +12 -12
- package/assets/js/components/table/table.component.min.js.map +1 -1
- package/assets/js/components/tabs/tabs.component.min.js +1 -1
- package/assets/js/dynamic.min.js +3 -3
- package/assets/js/dynamic.min.js.map +1 -1
- package/assets/js/modules/dialogs.js +15 -5
- package/assets/js/modules/table.js +23 -5
- package/assets/js/scripts.bundle.js +13 -13
- package/assets/js/scripts.bundle.js.map +1 -1
- package/assets/js/scripts.bundle.min.js +2 -2
- package/assets/js/scripts.bundle.min.js.map +1 -1
- package/assets/sass/_functions/variables.scss +4 -2
- package/assets/sass/components/dialog.scss +89 -1
- package/assets/sass/components/forms.scss +67 -21
- package/assets/sass/foundations/buttons.scss +48 -0
- package/assets/ts/modules/dialogs.ts +18 -6
- package/assets/ts/modules/table.ts +29 -7
- package/dist/components.es.js +838 -830
- package/dist/components.umd.js +28 -28
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -178,7 +178,8 @@ $non-theme-colors: map-merge((
|
|
|
178
178
|
"btn-secondary-bg": transparent,
|
|
179
179
|
"btn-secondary-bg-hover": var(--colour-primary-theme),
|
|
180
180
|
"btn-secondary-hover": var(--colour-inverted),
|
|
181
|
-
"canvas-2": var(--colour-canvas)
|
|
181
|
+
"canvas-2": var(--colour-canvas),
|
|
182
|
+
"btn-action-hover-bg": var(--colour-light)
|
|
182
183
|
), $non-theme-colors);
|
|
183
184
|
|
|
184
185
|
@each $color, $value in $non-theme-colors {
|
|
@@ -219,7 +220,8 @@ $dark-mode-functional-colors: (
|
|
|
219
220
|
"btn-secondary-border": var(--colour-white),
|
|
220
221
|
"btn-secondary-bg": transparent,
|
|
221
222
|
"btn-secondary-bg-hover": var(--colour-white),
|
|
222
|
-
"btn-secondary-hover": var(--colour-primary-theme)
|
|
223
|
+
"btn-secondary-hover": var(--colour-primary-theme),
|
|
224
|
+
"btn-action-hover-bg": var(--colour-canvas-2)
|
|
223
225
|
);
|
|
224
226
|
|
|
225
227
|
|
|
@@ -183,6 +183,7 @@ dialog::backdrop {
|
|
|
183
183
|
|
|
184
184
|
text-align: center;
|
|
185
185
|
|
|
186
|
+
|
|
186
187
|
&:before {
|
|
187
188
|
content: "\f05a";
|
|
188
189
|
font-weight: 300;
|
|
@@ -205,6 +206,38 @@ dialog::backdrop {
|
|
|
205
206
|
clear: both;
|
|
206
207
|
}
|
|
207
208
|
|
|
209
|
+
&:has(> i):before{
|
|
210
|
+
|
|
211
|
+
display: none;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
&:has(> i) > i{
|
|
215
|
+
|
|
216
|
+
display: var(--fa-display,inline-block);
|
|
217
|
+
line-height: 1;
|
|
218
|
+
font-size: 3rem;
|
|
219
|
+
@include media-breakpoint-up(md) {
|
|
220
|
+
font-size: 4rem;
|
|
221
|
+
}
|
|
222
|
+
margin-top: 0;
|
|
223
|
+
margin-bottom: rem(24);
|
|
224
|
+
line-height: 1;
|
|
225
|
+
color: var(--colour-heading);
|
|
226
|
+
clear: both;
|
|
227
|
+
|
|
228
|
+
&:has(> i){
|
|
229
|
+
position: relative;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
> i:before {
|
|
233
|
+
content: "\f2ed";
|
|
234
|
+
position: absolute;
|
|
235
|
+
top: 0;
|
|
236
|
+
left: 50%;
|
|
237
|
+
transform: scale(0.5) translate(-100%,0);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
208
241
|
> form:first-child button,
|
|
209
242
|
> button:first-child {
|
|
210
243
|
display: none;
|
|
@@ -508,7 +541,7 @@ dialog::backdrop {
|
|
|
508
541
|
z-index: var(--index-floating);
|
|
509
542
|
min-width: rem(320);
|
|
510
543
|
border-radius: rem(16);
|
|
511
|
-
width: rem(
|
|
544
|
+
width: rem(320);
|
|
512
545
|
padding: rem(24);
|
|
513
546
|
|
|
514
547
|
@include media-breakpoint-up(sm) {
|
|
@@ -517,6 +550,61 @@ dialog::backdrop {
|
|
|
517
550
|
@include media-breakpoint-up(md) {
|
|
518
551
|
width: rem(360);
|
|
519
552
|
}
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
&.dialog--list {
|
|
556
|
+
|
|
557
|
+
width: fit-content!important;
|
|
558
|
+
min-width: rem(140)!important;
|
|
559
|
+
max-width: rem(280)!important;
|
|
560
|
+
padding: rem(16);
|
|
561
|
+
margin: 0;
|
|
562
|
+
|
|
563
|
+
.btn-action {
|
|
564
|
+
border: none;
|
|
565
|
+
padding: 0;
|
|
566
|
+
margin: 0;
|
|
567
|
+
padding-block: rem(6);
|
|
568
|
+
line-height: rem(20);
|
|
569
|
+
background: none;
|
|
570
|
+
white-space: inherit;
|
|
571
|
+
max-width: 100%;
|
|
572
|
+
min-width: 100%;
|
|
573
|
+
|
|
574
|
+
&:before {
|
|
575
|
+
min-width: rem(20);
|
|
576
|
+
display: inline-block;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
&::after {
|
|
580
|
+
float: right;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
hr {
|
|
585
|
+
height: 2px;
|
|
586
|
+
background: var(--colour-border);
|
|
587
|
+
margin-left: -#{rem(16)};
|
|
588
|
+
margin-right: -#{rem(16)};
|
|
589
|
+
margin-block: 0.25rem;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
.radio--tick {
|
|
593
|
+
margin-right: 0;
|
|
594
|
+
padding-left: 1.5rem;
|
|
595
|
+
margin-bottom: 0;
|
|
596
|
+
|
|
597
|
+
&:before {
|
|
598
|
+
left: 0;
|
|
599
|
+
font-size: 1em;
|
|
600
|
+
top: 0.75rem;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
dialog[open] {
|
|
606
|
+
display: contents;
|
|
607
|
+
}
|
|
520
608
|
}
|
|
521
609
|
|
|
522
610
|
&.dialog__wrapper--right > dialog[open]{
|
|
@@ -9,7 +9,7 @@ label {
|
|
|
9
9
|
color: var(--colour-heading);
|
|
10
10
|
display: block;
|
|
11
11
|
|
|
12
|
-
&:has(+ input:not(:disabled):not([readonly]):not(:required):not([type='radio']):not([type='file'])):after {
|
|
12
|
+
&:has(+ input:not(:disabled):not([readonly]):not(:required):not([type='radio']):not([type='checkbox']):not([type='file'])):after {
|
|
13
13
|
content: " (Optional)";
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -66,6 +66,29 @@ textarea {
|
|
|
66
66
|
// #endregion
|
|
67
67
|
|
|
68
68
|
|
|
69
|
+
// #region legend
|
|
70
|
+
fieldset {
|
|
71
|
+
width: 100%;
|
|
72
|
+
}
|
|
73
|
+
legend {
|
|
74
|
+
font-family: $headings-font-family;
|
|
75
|
+
font-style: $headings-font-style;
|
|
76
|
+
font-weight: $headings-font-weight;
|
|
77
|
+
line-height: $headings-line-height;
|
|
78
|
+
color: $headings-color;
|
|
79
|
+
margin: 0;
|
|
80
|
+
clear: both;
|
|
81
|
+
display: block;
|
|
82
|
+
float: none;
|
|
83
|
+
font-size: rem(map-get($heading-sizes,"h4_fs"));
|
|
84
|
+
line-height: rem(map-get($heading-sizes,"h4_lh"));
|
|
85
|
+
padding-bottom: 0.5rem;
|
|
86
|
+
max-width: var(--content-max-width);
|
|
87
|
+
min-width: 100%;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// #endregion
|
|
91
|
+
|
|
69
92
|
// #region wrappers
|
|
70
93
|
div:has(> label:first-child):has(> input) {
|
|
71
94
|
position: relative;
|
|
@@ -304,27 +327,38 @@ $icon-error: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' vie
|
|
|
304
327
|
$icon-tick: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d='M441 103c9.4 9.4 9.4 24.6 0 33.9L177 401c-9.4 9.4-24.6 9.4-33.9 0L7 265c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l119 119L407 103c9.4-9.4 24.6-9.4 33.9 0z' fill='#0f9d58' /></svg>");
|
|
305
328
|
|
|
306
329
|
|
|
307
|
-
.was-validated
|
|
330
|
+
.was-validated *:not(button):is(:invalid, .is-invalid):not(.is-valid) {
|
|
308
331
|
|
|
332
|
+
--colour-check-border: var(--colour-danger);
|
|
309
333
|
border-color: var(--colour-danger);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.was-validated *:not(button):is(:invalid, .is-invalid):not(.is-valid) + label {
|
|
337
|
+
|
|
338
|
+
--colour-check-border: var(--colour-danger);
|
|
339
|
+
--colour-check-bg: #FCEBEC;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.was-validated input:is(:invalid, .is-invalid) {
|
|
310
343
|
|
|
311
344
|
background-image: escape-svg($icon-error);
|
|
312
345
|
background-repeat: no-repeat;
|
|
313
346
|
background-position: right var(--input-padding-inline, #{rem(16)}) center;
|
|
314
347
|
background-size: var(--input-lh, #{rem(20)}) var(--input-lh, #{rem(20)});;
|
|
315
|
-
|
|
316
348
|
padding-right: calc(var(--input-lh, #{rem(20)}) + var(--input-padding-inline, #{rem(16)}) + var(--input-padding-inline, #{rem(16)}));
|
|
317
349
|
}
|
|
318
350
|
|
|
319
|
-
.was-validated
|
|
351
|
+
.was-validated *:not(button):is(:valid, .is-valid):not(.is-invalid) {
|
|
320
352
|
|
|
321
353
|
border-color: var(--colour-complete);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.was-validated input:is(:valid, .is-valid) {
|
|
322
357
|
|
|
323
358
|
background-image: escape-svg($icon-tick);
|
|
324
359
|
background-repeat: no-repeat;
|
|
325
360
|
background-position: right var(--input-padding-inline, #{rem(16)}) center;
|
|
326
361
|
background-size: var(--input-lh, #{rem(20)}) var(--input-lh, #{rem(20)});;
|
|
327
|
-
|
|
328
362
|
padding-right: calc(var(--input-lh, #{rem(20)}) + var(--input-padding-inline, #{rem(16)}) + var(--input-padding-inline, #{rem(16)}));
|
|
329
363
|
}
|
|
330
364
|
|
|
@@ -339,12 +373,12 @@ $icon-tick: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' view
|
|
|
339
373
|
display: none;
|
|
340
374
|
}
|
|
341
375
|
|
|
342
|
-
.was-validated:has(
|
|
376
|
+
.was-validated:has(*:is(:invalid, .is-invalid)) .invalid-feedback {
|
|
343
377
|
display: block;
|
|
344
378
|
}
|
|
345
379
|
// #endregion
|
|
346
380
|
|
|
347
|
-
// #region radio field
|
|
381
|
+
// #region radio/checkbox field
|
|
348
382
|
input:is([type="radio"],[type="checkbox"]) {
|
|
349
383
|
position: absolute;
|
|
350
384
|
top: 0;
|
|
@@ -355,18 +389,21 @@ input:is([type="radio"],[type="checkbox"]) {
|
|
|
355
389
|
margin: 0;
|
|
356
390
|
}
|
|
357
391
|
|
|
358
|
-
div:has(> input:is([type="radio"],[type="checkbox"])) {
|
|
392
|
+
:is(div,fieldset):has(> input:is([type="radio"],[type="checkbox"])) {
|
|
359
393
|
position: relative;
|
|
394
|
+
|
|
395
|
+
padding-bottom: rem(24);
|
|
360
396
|
}
|
|
361
397
|
|
|
362
|
-
div:has( > input[type="radio"]){
|
|
398
|
+
:is(div,fieldset):has( > input[type="radio"]){
|
|
363
399
|
|
|
364
400
|
--border-radius: 50%;
|
|
365
401
|
--outline-width: #{rem(8)};
|
|
366
402
|
}
|
|
367
|
-
div:has( > input[type="checkbox"]) {
|
|
368
403
|
|
|
369
|
-
|
|
404
|
+
:is(div,fieldset):has( > input[type="checkbox"]) {
|
|
405
|
+
|
|
406
|
+
--border-radius: #{rem(4)};
|
|
370
407
|
--outline-width: #{rem(4)};
|
|
371
408
|
}
|
|
372
409
|
|
|
@@ -385,16 +422,30 @@ input:is([type="radio"],[type="checkbox"]) + label:not(:has(> iam-card)) {
|
|
|
385
422
|
margin-right: rem(24);
|
|
386
423
|
cursor: pointer;
|
|
387
424
|
|
|
425
|
+
&:has(+ span){
|
|
426
|
+
margin-bottom: 0;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
&:has(+ input){
|
|
430
|
+
margin-bottom: 0;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
&:last-child {
|
|
434
|
+
|
|
435
|
+
margin-bottom: rem(24);
|
|
436
|
+
}
|
|
437
|
+
|
|
388
438
|
&:before {
|
|
389
439
|
content: "";
|
|
390
|
-
border: 2px solid var(--colour-primary);
|
|
440
|
+
border: 2px solid var(--colour-check-border, var(--colour-primary));
|
|
441
|
+
background: var(--colour-check-bg, transparent);
|
|
391
442
|
border-radius: var(--border-radius);
|
|
392
443
|
height: rem(24);
|
|
393
444
|
width: rem(24);
|
|
394
445
|
display: inline-block;
|
|
395
446
|
position: absolute;
|
|
396
447
|
top: rem(10 - 2);
|
|
397
|
-
left:
|
|
448
|
+
left: var(--outline-width);
|
|
398
449
|
}
|
|
399
450
|
}
|
|
400
451
|
|
|
@@ -490,7 +541,7 @@ input[type="checkbox"]:checked + label {
|
|
|
490
541
|
border: none!important;
|
|
491
542
|
outline: none!important;
|
|
492
543
|
top: rem(10 - 2);
|
|
493
|
-
left:
|
|
544
|
+
left: var(--outline-width);
|
|
494
545
|
text-align: center;
|
|
495
546
|
}
|
|
496
547
|
}
|
|
@@ -504,7 +555,7 @@ input:is([type="radio"],[type="checkbox"]):is(:focus,:hover,.focus) + label {
|
|
|
504
555
|
--tick-colour: var(--colour-muted);
|
|
505
556
|
|
|
506
557
|
&:before {
|
|
507
|
-
background: var(--colour-light);
|
|
558
|
+
background: var(--colour-check-bg, var(--colour-light));
|
|
508
559
|
outline: var(--outline-width) solid var(--colour-light);
|
|
509
560
|
}
|
|
510
561
|
}
|
|
@@ -513,7 +564,7 @@ input:is([type="radio"],[type="checkbox"]):is(:active,.active) + label {
|
|
|
513
564
|
--tick-colour: var(--colour-light);
|
|
514
565
|
|
|
515
566
|
&:before {
|
|
516
|
-
background: #E0E0E0;
|
|
567
|
+
background: var(--colour-check-bg, #E0E0E0);
|
|
517
568
|
outline: var(--outline-width) solid #E0E0E0;
|
|
518
569
|
}
|
|
519
570
|
}
|
|
@@ -551,11 +602,6 @@ input[type="checkbox"][disabled]:checked + label {
|
|
|
551
602
|
}
|
|
552
603
|
// #endregion
|
|
553
604
|
|
|
554
|
-
// #region checkbox
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
// #endregion
|
|
558
|
-
|
|
559
605
|
// #region Conditional reveal
|
|
560
606
|
.conditional {
|
|
561
607
|
display: none;
|
|
@@ -90,6 +90,38 @@ a:is(:hover, :focus, .hover, :active, .active):not([disabled]) .btn-secondary,
|
|
|
90
90
|
}
|
|
91
91
|
// #endregion
|
|
92
92
|
|
|
93
|
+
// #region Action button
|
|
94
|
+
.btn-action {
|
|
95
|
+
background-color: var(--colour-canvas-2);
|
|
96
|
+
border: 1px solid var(--colour-muted);
|
|
97
|
+
border-radius: rem(4)!important;
|
|
98
|
+
font-weight: 400!important;
|
|
99
|
+
font-size: 1rem;
|
|
100
|
+
line-height: rem(20);
|
|
101
|
+
padding: rem(6);
|
|
102
|
+
color: var(--colour-heading);
|
|
103
|
+
|
|
104
|
+
&.btn[class*=fa-]:before {
|
|
105
|
+
margin-right: rem(6);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
a:is(:hover, :focus, .hover, :focus-within):not([disabled],:active, .active) &,
|
|
110
|
+
&:is(:hover, :focus, .hover, :focus-within):not([disabled],:active, .active) {
|
|
111
|
+
background: var(--colour-btn-action-hover-bg);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
a:is(:active, .active):not([disabled]) &,
|
|
116
|
+
&:is(:active, .active):not([disabled]) {
|
|
117
|
+
|
|
118
|
+
filter: brightness(85%);
|
|
119
|
+
transition: background .1s, color .1s;
|
|
120
|
+
color: var(--colour-heading);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
// #endregion
|
|
124
|
+
|
|
93
125
|
// #region button with icon
|
|
94
126
|
.btn {
|
|
95
127
|
&[class*="fa-"]:before {
|
|
@@ -166,6 +198,22 @@ a:is(:hover, :focus, .hover, :active, .active):not([disabled]) .btn-secondary,
|
|
|
166
198
|
position: relative;
|
|
167
199
|
font-size: rem(20);
|
|
168
200
|
|
|
201
|
+
&.btn-sm {
|
|
202
|
+
|
|
203
|
+
font-size: 1rem;
|
|
204
|
+
padding: rem(6)!important;
|
|
205
|
+
height: auto!important;
|
|
206
|
+
line-height: rem(20);
|
|
207
|
+
height: rem(20 + 6 + 6);
|
|
208
|
+
width: rem(20 + 6 + 6);
|
|
209
|
+
min-width: rem(20 + 6 + 6);
|
|
210
|
+
|
|
211
|
+
&:before {
|
|
212
|
+
line-height: rem(20 + 6 + 6);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
|
|
169
217
|
&:before {
|
|
170
218
|
position: absolute;
|
|
171
219
|
top: 0;
|
|
@@ -77,7 +77,12 @@ const extendDialogs = (body) => {
|
|
|
77
77
|
|
|
78
78
|
// Close the modal when clicked on the backdrop
|
|
79
79
|
if (event && event.target instanceof HTMLElement && event.target.closest('dialog[open]')){
|
|
80
|
-
|
|
80
|
+
let dialog = event.target.closest('dialog[open]');
|
|
81
|
+
|
|
82
|
+
// Small fix to make sure the dialog isn't a dialog inside of a dialog.
|
|
83
|
+
var style = window.getComputedStyle(dialog);
|
|
84
|
+
if(style.display === 'contents')
|
|
85
|
+
dialog = dialog.parentNode.closest('dialog[open]');
|
|
81
86
|
|
|
82
87
|
// Dont allow the backdrop to be clicked when transactional
|
|
83
88
|
if(!dialog.querySelector(':scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child') || dialog.classList.contains('dialog--multi')){
|
|
@@ -106,8 +111,8 @@ const extendDialogs = (body) => {
|
|
|
106
111
|
let dataEvent = "openPopover"
|
|
107
112
|
let popover = parent.querySelector(':scope > dialog');
|
|
108
113
|
|
|
109
|
-
if(document.querySelector('dialog[open]') && document.querySelector('dialog[open]') != popover)
|
|
110
|
-
document.querySelector('dialog[open]').close();
|
|
114
|
+
if(document.querySelector('*:not([data-keep-open]) > dialog[open]') && document.querySelector('*:not([data-keep-open]) > dialog[open]') != popover)
|
|
115
|
+
document.querySelector('*:not([data-keep-open]) > dialog[open]').close();
|
|
111
116
|
|
|
112
117
|
// Remove active class from exiting active buttons
|
|
113
118
|
Array.from(document.querySelectorAll('.dialog__wrapper > button')).forEach((btnElement,index) => {
|
|
@@ -152,8 +157,14 @@ const extendDialogs = (body) => {
|
|
|
152
157
|
if(popoverBottom > windowPos){
|
|
153
158
|
|
|
154
159
|
let currentStyle = popover.hasAttribute('style') ? popover.getAttribute('style')+' ' : '';
|
|
155
|
-
|
|
156
160
|
popover.setAttribute('style',currentStyle+`transform: translate(0, calc(-100% - 4rem))`);
|
|
161
|
+
|
|
162
|
+
// Check that the dialog doesn't go over the top of the page
|
|
163
|
+
boundingRec = popover.getBoundingClientRect();
|
|
164
|
+
let popoverTop = boundingRec.top - window.scrollY;
|
|
165
|
+
|
|
166
|
+
if(popoverTop < 100)
|
|
167
|
+
popover.removeAttribute('style');
|
|
157
168
|
}
|
|
158
169
|
|
|
159
170
|
window.dataLayer = window.dataLayer || [];
|
|
@@ -199,6 +210,7 @@ export const createDialog = (dialog) => {
|
|
|
199
210
|
createMultiFormDialog(dialog);
|
|
200
211
|
}
|
|
201
212
|
|
|
213
|
+
// If you are using Vue eevents and bindings its recommended to add in the .mh-lg div manually to the dialog
|
|
202
214
|
if(!dialog.querySelector(':scope > .mh-lg') && !dialog.classList.contains('dialog--multi')){
|
|
203
215
|
dialog.innerHTML = `<div class="mh-lg">${dialog.innerHTML}</div>`;
|
|
204
216
|
|
|
@@ -218,7 +230,7 @@ export const createDialog = (dialog) => {
|
|
|
218
230
|
|
|
219
231
|
// Create close button is needed
|
|
220
232
|
if(!dialog.querySelector(':scope > button:first-child'))
|
|
221
|
-
dialog.
|
|
233
|
+
dialog.insertAdjacentHTML('afterbegin', `<button class="dialog__close">Close</button>`);
|
|
222
234
|
|
|
223
235
|
}
|
|
224
236
|
|
|
@@ -244,7 +256,7 @@ export const createMultiFormDialog = (dialog) => {
|
|
|
244
256
|
btnWrapper.innerHTML += `<button data-title="${fieldsets[index].getAttribute('data-title')}" class="btn btn-primary mb-0" data-next type="submit">Submit</button>`;
|
|
245
257
|
});
|
|
246
258
|
|
|
247
|
-
dialog.
|
|
259
|
+
dialog.insertAdjacentHTML('afterbegin',`<div class="steps bg-primary">${buttons}</div>`);
|
|
248
260
|
|
|
249
261
|
|
|
250
262
|
// Open the fieldset with an error inside
|
|
@@ -453,15 +453,26 @@ export const filterTable = (table, form, wrapper) => {
|
|
|
453
453
|
});
|
|
454
454
|
}
|
|
455
455
|
|
|
456
|
-
//Display the filter count
|
|
456
|
+
// Display the filter count
|
|
457
457
|
Array.from(form.querySelectorAll('[data-filter-count]')).forEach((element, index) => {
|
|
458
458
|
element.innerHTML = '';
|
|
459
|
+
element.parentNode.classList.remove('hover');
|
|
459
460
|
});
|
|
460
461
|
|
|
461
|
-
|
|
462
|
-
|
|
462
|
+
let filterCount = 0;
|
|
463
|
+
Object.values(filters).forEach((filter, index) => {
|
|
464
|
+
|
|
465
|
+
if(typeof filter == "object" && Object.values(filter).length)
|
|
466
|
+
filterCount += Object.values(filter).length;
|
|
467
|
+
else
|
|
468
|
+
filterCount++;
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
if(filterCount) {
|
|
472
|
+
|
|
463
473
|
Array.from(form.querySelectorAll('[data-filter-count]')).forEach((element, index) => {
|
|
464
|
-
element.innerHTML += `(${
|
|
474
|
+
element.innerHTML += `(${filterCount})`;
|
|
475
|
+
element.parentNode.classList.add('hover');
|
|
465
476
|
});
|
|
466
477
|
}
|
|
467
478
|
|
|
@@ -829,12 +840,23 @@ export const loadAjaxTable = async function (table, form, pagination, wrapper){
|
|
|
829
840
|
|
|
830
841
|
Array.from(form.querySelectorAll('[data-filter-count]')).forEach((element, index) => {
|
|
831
842
|
element.innerHTML = '';
|
|
843
|
+
element.parentNode.classList.remove('hover');
|
|
832
844
|
});
|
|
833
845
|
|
|
834
|
-
|
|
835
|
-
|
|
846
|
+
let filterCount = 0;
|
|
847
|
+
Object.values(filters).forEach((filter, index) => {
|
|
848
|
+
|
|
849
|
+
if(typeof filter == "object" && Object.values(filter).length)
|
|
850
|
+
filterCount += Object.values(filter).length;
|
|
851
|
+
else
|
|
852
|
+
filterCount++;
|
|
853
|
+
});
|
|
854
|
+
|
|
855
|
+
if(filterCount) {
|
|
856
|
+
|
|
836
857
|
Array.from(form.querySelectorAll('[data-filter-count]')).forEach((element, index) => {
|
|
837
|
-
element.innerHTML += `(${
|
|
858
|
+
element.innerHTML += `(${filterCount})`;
|
|
859
|
+
element.parentNode.classList.add('hover');
|
|
838
860
|
});
|
|
839
861
|
}
|
|
840
862
|
|