@iamproperty/components 5.5.1-beta-5 → 5.6.1-beta1
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/actionbar.css +1 -1
- package/assets/css/components/actionbar.css.map +1 -1
- package/assets/css/components/card.css +1 -1
- package/assets/css/components/card.css.map +1 -1
- package/assets/css/components/card.global.css +1 -1
- package/assets/css/components/card.global.css.map +1 -1
- package/assets/css/components/pagination.css +1 -1
- package/assets/css/components/pagination.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/actionbar/actionbar.component.min.js +4 -4
- package/assets/js/components/address-lookup/address-lookup.component.min.js +1 -1
- package/assets/js/components/applied-filters/applied-filters.component.min.js +2 -2
- package/assets/js/components/applied-filters/applied-filters.component.min.js.map +1 -1
- package/assets/js/components/card/card.component.js +8 -5
- package/assets/js/components/card/card.component.min.js +8 -6
- package/assets/js/components/card/card.component.min.js.map +1 -1
- package/assets/js/components/carousel/carousel.component.min.js +28 -0
- package/assets/js/components/carousel/carousel.component.min.js.map +1 -0
- package/assets/js/components/collapsible-side/collapsible-side.component.min.js +1 -1
- package/assets/js/components/fileupload/fileupload.component.js +4 -3
- package/assets/js/components/fileupload/fileupload.component.min.js +5 -5
- package/assets/js/components/fileupload/fileupload.component.min.js.map +1 -1
- package/assets/js/components/filterlist/filterlist.component.min.js +1 -1
- package/assets/js/components/header/header.component.min.js +1 -1
- package/assets/js/components/inline-edit/inline-edit.component.js +2 -4
- package/assets/js/components/inline-edit/inline-edit.component.min.js +2 -2
- package/assets/js/components/inline-edit/inline-edit.component.min.js.map +1 -1
- package/assets/js/components/marketing/marketing.component.min.js +17 -0
- package/assets/js/components/marketing/marketing.component.min.js.map +1 -0
- 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 +2 -2
- package/assets/js/components/search/search.component.min.js +1 -1
- package/assets/js/components/slider/slider.component.min.js +19 -0
- package/assets/js/components/slider/slider.component.min.js.map +1 -0
- package/assets/js/components/table/table.component.min.js +4 -4
- 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 +1 -1
- package/assets/js/modules/applied-filters.js +5 -1
- package/assets/js/modules/fileupload.js +9 -0
- package/assets/js/modules/table.js +6 -0
- package/assets/js/scripts.bundle.js +11 -9
- 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/components/actionbar.scss +1 -0
- package/assets/sass/components/card.global.scss +30 -1
- package/assets/sass/components/card.scss +80 -33
- package/assets/sass/components/pagination.scss +1 -1
- package/assets/sass/elements/badge-tag.scss +11 -4
- package/assets/sass/elements/forms.scss +9 -3
- package/assets/ts/components/card/card.component.ts +8 -5
- package/assets/ts/components/fileupload/fileupload.component.ts +4 -3
- package/assets/ts/components/inline-edit/inline-edit.component.ts +2 -8
- package/assets/ts/modules/applied-filters.ts +4 -1
- package/assets/ts/modules/fileupload.ts +15 -0
- package/assets/ts/modules/table.ts +10 -0
- package/dist/components.es.js +497 -592
- package/dist/components.umd.js +78 -128
- package/package.json +1 -1
- package/src/components/AddressLookup/AddressLookup.vue +1 -1
- package/src/components/AppliedFilters/AppliedFilters.vue +13 -7
- package/src/components/Card/Card.vue +2 -2
- package/src/components/Carousel/Carousel.vue +1 -1
- package/src/components/Marketing/Marketing.vue +1 -1
- package/src/components/Slider/Slider.vue +1 -1
- package/src/components/Tabs/Tabs.vue +2 -2
- package/dist/README.md +0 -21
|
@@ -11,6 +11,7 @@ iam-card {
|
|
|
11
11
|
display: block;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
|
|
14
15
|
> div:has([type="checkbox"]) {
|
|
15
16
|
display: contents;
|
|
16
17
|
|
|
@@ -27,6 +28,30 @@ iam-card {
|
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
|
|
31
|
+
&:has([type="checkbox"]:checked) {
|
|
32
|
+
--hover-outline-colour: var(--colour-info);
|
|
33
|
+
--outline-colour: var(--colour-info);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&:has([type="checkbox"] + label:hover) {
|
|
37
|
+
//pointer-events: none;
|
|
38
|
+
|
|
39
|
+
--hover-outline-colour: transparent;
|
|
40
|
+
--hover-icon-bg: var(--colour-warning);
|
|
41
|
+
--hover-icon-colour: var(--colour-primary-theme);
|
|
42
|
+
--card-icon-right-overide:1rem;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:has([type="checkbox"]:active) {
|
|
46
|
+
//pointer-events: none;
|
|
47
|
+
|
|
48
|
+
--hover-outline-colour: transparent;
|
|
49
|
+
--hover-icon-bg: var(--colour-warning);
|
|
50
|
+
--hover-icon-colour: var(--colour-primary-theme);
|
|
51
|
+
--card-icon-right-overide:1rem;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
30
55
|
&.card--has-icon:not(.card--filter):not(.card--secondary) i {
|
|
31
56
|
position: absolute;
|
|
32
57
|
top: calc(50% - 0.5rem - 2px);
|
|
@@ -34,7 +59,11 @@ iam-card {
|
|
|
34
59
|
}
|
|
35
60
|
|
|
36
61
|
.badge {
|
|
37
|
-
|
|
62
|
+
|
|
63
|
+
i {
|
|
64
|
+
position: static!important;
|
|
65
|
+
margin-right: 0.25rem;
|
|
66
|
+
}
|
|
38
67
|
}
|
|
39
68
|
}
|
|
40
69
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
overflow: hidden;
|
|
19
19
|
z-index: 0;
|
|
20
20
|
background: var(--colour-canvas-2);
|
|
21
|
-
outline: 2px solid var(--colour-canvas-2);
|
|
21
|
+
outline: 2px solid var(--outline-colour,--colour-canvas-2);
|
|
22
22
|
outline-offset: -2px;
|
|
23
23
|
|
|
24
24
|
> *:not(.btn-compact) {
|
|
@@ -81,32 +81,25 @@
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
&:is(:hover,:focus,.hover) {
|
|
84
|
-
--
|
|
85
|
-
outline: 2px solid var(--colour, var(--colour-
|
|
84
|
+
--hover-outline-colour-default: var(--colour, var(--colour-primary));
|
|
85
|
+
outline: 2px solid var(--hover-outline-colour, var(--hover-outline-colour-default));
|
|
86
86
|
outline-offset: -2px;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
// Update arrow cololur
|
|
90
|
-
&:not([class*="colour-"]):is(:hover,:focus,.hover) {
|
|
90
|
+
&:not([class*="colour-"]):is(:hover,:focus,.hover,:active, .active) {
|
|
91
91
|
|
|
92
92
|
&:before {
|
|
93
|
-
background: var(--colour-primary-theme);
|
|
93
|
+
background: var(--hover-icon-bg, var(--colour-primary-theme));
|
|
94
94
|
}
|
|
95
95
|
&:after {
|
|
96
|
-
background: #ffffff;
|
|
96
|
+
background: var(--hover-icon-colour, #ffffff);
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
&:is(:active, .active){
|
|
101
|
-
--card-icon-right: 0.5rem;
|
|
101
|
+
--card-icon-right: var(--card-icon-right-overide,0.5rem);
|
|
102
102
|
outline: none;
|
|
103
|
-
|
|
104
|
-
&:before {
|
|
105
|
-
background: var(--colour-warning);
|
|
106
|
-
}
|
|
107
|
-
&:after {
|
|
108
|
-
background: var(--colour-primary);
|
|
109
|
-
}
|
|
110
103
|
}
|
|
111
104
|
|
|
112
105
|
&:is(:active){
|
|
@@ -115,7 +108,7 @@
|
|
|
115
108
|
|
|
116
109
|
|
|
117
110
|
|
|
118
|
-
span
|
|
111
|
+
span{
|
|
119
112
|
display: block;
|
|
120
113
|
font-weight: bold;
|
|
121
114
|
padding-top: rem(24);
|
|
@@ -190,29 +183,42 @@
|
|
|
190
183
|
font-weight: normal!important;
|
|
191
184
|
font-size: rem(16)!important;
|
|
192
185
|
}
|
|
186
|
+
::slotted(small){
|
|
187
|
+
padding-top: rem(16)!important;
|
|
188
|
+
display: block!important;
|
|
189
|
+
font-weight: normal!important;
|
|
190
|
+
padding-bottom: 0!important;
|
|
191
|
+
color: var(--colour-body);
|
|
192
|
+
}
|
|
193
193
|
::slotted(span:not(.badge):not([class*="pt-"])){
|
|
194
194
|
padding-top: rem(24)!important;
|
|
195
195
|
}
|
|
196
196
|
// #endregion
|
|
197
197
|
|
|
198
198
|
// #region card bages
|
|
199
|
-
.card__badges {
|
|
199
|
+
.card__head .card__badges {
|
|
200
|
+
|
|
200
201
|
position: absolute;
|
|
201
|
-
top:
|
|
202
|
-
|
|
203
|
-
|
|
202
|
+
top: 1rem;
|
|
203
|
+
text-align: left;
|
|
204
|
+
left: 1rem;
|
|
204
205
|
z-index: 9;
|
|
205
|
-
text-align: right;
|
|
206
|
-
width: 1;
|
|
207
206
|
}
|
|
208
|
-
|
|
207
|
+
|
|
208
|
+
.card__body .card__badges.card__badges--inline {
|
|
209
|
+
|
|
210
|
+
margin-top: -1rem;
|
|
211
|
+
min-height: 1rem;
|
|
212
|
+
}
|
|
213
|
+
.card__body .card__badges:not(.card__badges--inline) {
|
|
209
214
|
|
|
210
|
-
|
|
211
|
-
|
|
215
|
+
position: absolute;
|
|
216
|
+
top: 0.5rem;
|
|
212
217
|
text-align: left;
|
|
213
|
-
|
|
214
|
-
|
|
218
|
+
right: 0.75rem;
|
|
219
|
+
z-index: 9;
|
|
215
220
|
}
|
|
221
|
+
|
|
216
222
|
// #endregion
|
|
217
223
|
|
|
218
224
|
// #region border left
|
|
@@ -258,6 +264,9 @@
|
|
|
258
264
|
.card__body {
|
|
259
265
|
background: none;
|
|
260
266
|
}
|
|
267
|
+
.card__footer {
|
|
268
|
+
background: none;
|
|
269
|
+
}
|
|
261
270
|
}
|
|
262
271
|
|
|
263
272
|
&.card--has-icon {
|
|
@@ -304,7 +313,7 @@
|
|
|
304
313
|
.card:has(.card__head) {
|
|
305
314
|
.card__head {
|
|
306
315
|
padding-bottom: 0;
|
|
307
|
-
padding-top: 27
|
|
316
|
+
padding-top: var(--img-height, 27%);
|
|
308
317
|
position: relative;
|
|
309
318
|
overflow: hidden;
|
|
310
319
|
background: rgba(0,0,0,0.1);
|
|
@@ -379,15 +388,20 @@
|
|
|
379
388
|
z-index: 99;
|
|
380
389
|
}
|
|
381
390
|
|
|
382
|
-
|
|
391
|
+
// For docs
|
|
392
|
+
.card--secondary.secondary-hover {
|
|
383
393
|
|
|
384
|
-
|
|
385
|
-
outline:
|
|
394
|
+
outline: 2px solid var(--colour, var(--colour-primary));
|
|
395
|
+
outline-offset: -2px;
|
|
386
396
|
|
|
387
|
-
.
|
|
388
|
-
background:
|
|
389
|
-
|
|
397
|
+
.btn-compact {
|
|
398
|
+
background-color: var(--colour);
|
|
399
|
+
color: var(--colour-primary-theme);
|
|
400
|
+
border-color: rgba(0, 0, 0, 0) !important;
|
|
390
401
|
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.card--secondary:has(.btn-compact:is(:hover, :focus, :active)) {
|
|
391
405
|
|
|
392
406
|
.btn-compact {
|
|
393
407
|
pointer-events: all;
|
|
@@ -401,3 +415,36 @@
|
|
|
401
415
|
line-height: rem(40);
|
|
402
416
|
}
|
|
403
417
|
// #endregion
|
|
418
|
+
|
|
419
|
+
//#region Record card
|
|
420
|
+
|
|
421
|
+
.card--record{
|
|
422
|
+
--img-height: 40%;
|
|
423
|
+
|
|
424
|
+
&:before,
|
|
425
|
+
&:after {
|
|
426
|
+
display: none;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
slot[name="btns"] {
|
|
431
|
+
display: flex;
|
|
432
|
+
flex-direction: row;
|
|
433
|
+
flex-wrap: nowrap;
|
|
434
|
+
justify-content: flex-end;
|
|
435
|
+
margin-right: calc(var(--card-right-padding) * -1);
|
|
436
|
+
|
|
437
|
+
margin-bottom: calc(var(--card-bottom-padding) * -1);
|
|
438
|
+
padding-right: 1rem;
|
|
439
|
+
padding-bottom: 1rem;
|
|
440
|
+
|
|
441
|
+
pointer-events: none;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
::slotted([slot="btns"]){
|
|
445
|
+
|
|
446
|
+
pointer-events: all;
|
|
447
|
+
margin: 0!important;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
//#endregion
|
|
@@ -5,10 +5,8 @@
|
|
|
5
5
|
font-size: rem(16);
|
|
6
6
|
line-height: rem(26);
|
|
7
7
|
border: none!important;
|
|
8
|
-
outline: 1px solid var(--colour-canvas);
|
|
9
|
-
outline-offset: -1px;
|
|
10
|
-
padding: 0 rem(16);
|
|
11
|
-
border-radius: rem(16);
|
|
8
|
+
//outline: 1px solid var(--colour-canvas);
|
|
9
|
+
//outline-offset: -1px;
|
|
12
10
|
margin: 0;
|
|
13
11
|
display: inline-block;
|
|
14
12
|
text-align: center;
|
|
@@ -28,8 +26,17 @@
|
|
|
28
26
|
}
|
|
29
27
|
}
|
|
30
28
|
|
|
29
|
+
.badge {
|
|
30
|
+
|
|
31
|
+
border-radius: rem(6);
|
|
32
|
+
padding: 0 rem(8);
|
|
33
|
+
}
|
|
34
|
+
|
|
31
35
|
.tag {
|
|
32
36
|
|
|
37
|
+
border-radius: rem(16);
|
|
38
|
+
padding: 0 rem(16);
|
|
39
|
+
|
|
33
40
|
&:after {
|
|
34
41
|
content: '\2715';
|
|
35
42
|
margin-left: 0.6em;
|
|
@@ -50,6 +50,10 @@ $icon-tick: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' view
|
|
|
50
50
|
min-height: calc(var(--input-padding-block, #{rem(12)}) + var(--input-padding-block, #{rem(12)}) + var(--input-lh, #{rem(20)}) + 4px);
|
|
51
51
|
max-height: calc(var(--input-padding-block, #{rem(12)}) + var(--input-padding-block, #{rem(12)}) + var(--input-lh, #{rem(20)}) + 4px);
|
|
52
52
|
|
|
53
|
+
&:is(textarea) {
|
|
54
|
+
max-height: 100%
|
|
55
|
+
}
|
|
56
|
+
|
|
53
57
|
// Customize the `:focus` state to imitate native WebKit styles.
|
|
54
58
|
&:is(:focus,.focus):not(:disabled) {
|
|
55
59
|
border-color: var(--colour-info);
|
|
@@ -80,7 +84,6 @@ $icon-tick: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' view
|
|
|
80
84
|
|
|
81
85
|
textarea {
|
|
82
86
|
min-height: calc(var(--input-padding-block, #{rem(12)}) + var(--input-padding-block, #{rem(12)}) + (var(--input-lh, #{rem(20)}) * 3) + 4px)!important;
|
|
83
|
-
max-height: calc(var(--input-padding-block, #{rem(12)}) + var(--input-padding-block, #{rem(12)}) + (var(--input-lh, #{rem(20)}) * 3) + 4px)!important;
|
|
84
87
|
}
|
|
85
88
|
// #endregion
|
|
86
89
|
|
|
@@ -615,7 +618,7 @@ label:not(.tag):has(input[type="checkbox"]:not([disabled]):checked) {
|
|
|
615
618
|
}
|
|
616
619
|
}
|
|
617
620
|
|
|
618
|
-
input[type="checkbox"]:checked + label,
|
|
621
|
+
input[type="checkbox"]:checked + label:not(:has(> iam-card)),
|
|
619
622
|
label:not(.tag):has(input[type="checkbox"]:checked) {
|
|
620
623
|
|
|
621
624
|
&:after {
|
|
@@ -674,6 +677,7 @@ label:not(.tag):has(input:is([type="radio"],[type="checkbox"]):checked:is(:focus
|
|
|
674
677
|
}
|
|
675
678
|
|
|
676
679
|
input:is([type="radio"],[type="checkbox"]):is(:focus,:hover,.focus) + label,
|
|
680
|
+
input:is([type="radio"],[type="checkbox"]) + label.hover,
|
|
677
681
|
label:not(.tag):has(input:is([type="radio"],[type="checkbox"]):is(:focus,:hover,.focus)) {
|
|
678
682
|
|
|
679
683
|
--tick-colour: var(--colour-muted);
|
|
@@ -684,6 +688,7 @@ label:not(.tag):has(input:is([type="radio"],[type="checkbox"]):is(:focus,:hover,
|
|
|
684
688
|
}
|
|
685
689
|
}
|
|
686
690
|
input:is([type="radio"],[type="checkbox"]):is(:active,.active) + label,
|
|
691
|
+
input:is([type="radio"],[type="checkbox"]) + label.active,
|
|
687
692
|
label:not(.tag):has(input:is([type="radio"],[type="checkbox"]):is(:active,.active)) {
|
|
688
693
|
|
|
689
694
|
--tick-colour: var(--colour-light);
|
|
@@ -827,7 +832,8 @@ div:has(> select){
|
|
|
827
832
|
border: none;
|
|
828
833
|
display: inline-block;
|
|
829
834
|
margin: 0;
|
|
830
|
-
padding: 0 calc(1.25em + 0.8ch) 0 0.25em!important;
|
|
835
|
+
padding: 0 calc(1.25em + 0.8ch) 0 var(--select-padding-left, 0.25em)!important;
|
|
836
|
+
|
|
831
837
|
height: auto;
|
|
832
838
|
cursor: pointer;
|
|
833
839
|
|
|
@@ -14,7 +14,7 @@ class iamCard extends HTMLElement {
|
|
|
14
14
|
super();
|
|
15
15
|
this.attachShadow({ mode: 'open'});
|
|
16
16
|
|
|
17
|
-
if(this.querySelector('[class*="fa-"]'))
|
|
17
|
+
if(this.querySelector('*:not(.badge):not(small):not(.btn) > [class*="fa-"]:not(.btn)'))
|
|
18
18
|
this.classList.add('card--has-icon');
|
|
19
19
|
|
|
20
20
|
let classList = this.classList.toString();
|
|
@@ -35,7 +35,8 @@ class iamCard extends HTMLElement {
|
|
|
35
35
|
<div class="card ${classList}" tabindex="0" part="card">
|
|
36
36
|
${this.hasAttribute('data-image') ? `<div class="card__head"><img src="${this.getAttribute('data-image')}" alt="" loading="lazy" /><div class="card__badges"><slot name="badges"></slot></div></div>` : ''}
|
|
37
37
|
<div class="card__body">
|
|
38
|
-
${!this.hasAttribute('data-image') ? `<div class="card__badges"><slot name="badges"></slot></div>` : ''}
|
|
38
|
+
${!this.hasAttribute('data-image') && this.querySelector('[slot="badges"]') && this.querySelector('[slot="checkbox"]') ? `<div class="card__badges card__badges--inline"><slot name="badges"></slot></div>` : ''}
|
|
39
|
+
${!this.hasAttribute('data-image') && this.querySelector('[slot="badges"]') ? `<div class="card__badges"><slot name="badges"></slot></div>` : ''}
|
|
39
40
|
${this.hasAttribute('data-illustration') ? `<div class="card__illustration"><img src="${this.getAttribute('data-illustration')}" alt="" loading="lazy" /></div>` : ''}
|
|
40
41
|
<slot></slot>
|
|
41
42
|
${this.hasAttribute('data-total') ? `<div class="card__total">${this.getAttribute('data-total')}</div>` : ''}
|
|
@@ -44,6 +45,7 @@ class iamCard extends HTMLElement {
|
|
|
44
45
|
<slot name="checkbox"></slot>
|
|
45
46
|
<div class="card__footer">
|
|
46
47
|
<slot name="footer"></slot>
|
|
48
|
+
<slot name="btns"></slot>
|
|
47
49
|
${this.hasAttribute('data-cta') ? `<span class="link d-inline-block pt-0 mb-0">${this.getAttribute('data-cta')}</span>` : ''}
|
|
48
50
|
</div>
|
|
49
51
|
</div>
|
|
@@ -60,11 +62,12 @@ class iamCard extends HTMLElement {
|
|
|
60
62
|
this.classList.add('loaded');
|
|
61
63
|
|
|
62
64
|
// Mimic clicking the parent node so the focus and target events can be on the card
|
|
63
|
-
const parentNode = this.parentNode.closest('a, button, label')
|
|
65
|
+
const parentNode = this.parentNode.closest('a, button, label, router-link')
|
|
64
66
|
const card = this.shadowRoot.querySelector('.card')
|
|
65
67
|
const btnCompact = this.shadowRoot.querySelector('.btn-compact');
|
|
66
68
|
|
|
67
|
-
parentNode
|
|
69
|
+
if(parentNode)
|
|
70
|
+
parentNode.setAttribute('tabindex','-1');
|
|
68
71
|
|
|
69
72
|
|
|
70
73
|
if(parentNode.matches('label[for]')){
|
|
@@ -190,7 +193,7 @@ class iamCard extends HTMLElement {
|
|
|
190
193
|
case "class": {
|
|
191
194
|
let classList = this.classList.toString();
|
|
192
195
|
|
|
193
|
-
if(this.querySelector('[class*="fa-"]'))
|
|
196
|
+
if(this.querySelector('*:not(.badge):not(small):not(.btn) > [class*="fa-"]:not(.btn)'))
|
|
194
197
|
classList += ' card--has-icon';
|
|
195
198
|
|
|
196
199
|
this.shadowRoot.querySelector('.card').setAttribute('class',`card ${classList}`);
|
|
@@ -27,8 +27,8 @@ class iamFileupload extends HTMLElement {
|
|
|
27
27
|
</style>
|
|
28
28
|
<div class="file-upload">
|
|
29
29
|
<span class="file-upload__title">Upload file</span>
|
|
30
|
-
<p class="helper-text"></p>
|
|
31
|
-
<button class="btn btn-primary"><slot name="btn"></slot> Upload
|
|
30
|
+
<p class="helper-text"><slot name="helper"></slot></p>
|
|
31
|
+
<button class="btn btn-primary"><slot name="btn"></slot> Upload ${this.hasAttribute('data-filetype') ? this.getAttribute('data-filetype') : 'file'}</button>
|
|
32
32
|
<div class="drop-area"></div>
|
|
33
33
|
<hr/>
|
|
34
34
|
<slot></slot>
|
|
@@ -46,7 +46,8 @@ class iamFileupload extends HTMLElement {
|
|
|
46
46
|
const input = this.querySelector('input');
|
|
47
47
|
const helperText = this.shadowRoot.querySelector('.helper-text');
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
if(!this.querySelector('[slot="helper"]'))
|
|
50
|
+
helperText.innerHTML = `${this.hasAttribute('data-maxsize') ? `Max file size is ${this.getAttribute('data-maxsize')}kb. ` : '' }${ input.hasAttribute('accept') ? `Supported file types are ${input.getAttribute('accept')}` : '' }`;
|
|
50
51
|
|
|
51
52
|
fileupload(this,wrapper);
|
|
52
53
|
}
|
|
@@ -58,12 +58,8 @@ class iamInlineEdit extends HTMLElement {
|
|
|
58
58
|
// cancel
|
|
59
59
|
cancelButton.addEventListener('click', (event) => {
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
console.log(originalValue)
|
|
63
|
-
|
|
64
61
|
input.value = originalValue;
|
|
65
62
|
|
|
66
|
-
|
|
67
63
|
input.blur();
|
|
68
64
|
inlineEdit.blur();
|
|
69
65
|
|
|
@@ -101,7 +97,7 @@ class iamInlineEdit extends HTMLElement {
|
|
|
101
97
|
});
|
|
102
98
|
|
|
103
99
|
// Save
|
|
104
|
-
if(input.tagName === '
|
|
100
|
+
if(input.tagName === 'INPUT'){
|
|
105
101
|
input.addEventListener('keydown', (event) => {
|
|
106
102
|
|
|
107
103
|
switch (event.key) { // change to event.key to key to use the above variable
|
|
@@ -166,12 +162,10 @@ class iamInlineEdit extends HTMLElement {
|
|
|
166
162
|
}
|
|
167
163
|
|
|
168
164
|
//blur it should autosave
|
|
169
|
-
|
|
165
|
+
input.addEventListener('blur',(event) => {
|
|
170
166
|
|
|
171
167
|
if(input.value != originalValue){
|
|
172
168
|
|
|
173
|
-
let feedbackText = '(Unsaved)';
|
|
174
|
-
|
|
175
169
|
if(inlineEdit.hasAttribute('data-autosave')) {
|
|
176
170
|
|
|
177
171
|
originalValue = input.value;
|
|
@@ -6,9 +6,12 @@ function createAppliedFilters(container,filters) {
|
|
|
6
6
|
|
|
7
7
|
let shouldRemoveFilter = false;
|
|
8
8
|
let inputName = input.getAttribute('name');
|
|
9
|
+
|
|
10
|
+
if(!inputName){ return false; }
|
|
9
11
|
|
|
10
|
-
if(inputName.includes('[]'))
|
|
12
|
+
if(inputName.includes('[]')){
|
|
11
13
|
inputName = inputName.replace('[]',`[${input.value}]`);
|
|
14
|
+
}
|
|
12
15
|
|
|
13
16
|
let filter = filters.querySelector(`[data-name="${inputName}"]`);
|
|
14
17
|
|
|
@@ -120,6 +120,21 @@ function fileupload(fileupload: Element, wrapper: Element) {
|
|
|
120
120
|
if(filename)
|
|
121
121
|
filesWrapper.innerHTML += `<span class="file">${filename} <button data-file="${filename}">Remove</button></span>`;
|
|
122
122
|
}
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
// Change the filename
|
|
126
|
+
wrapper.addEventListener('click', (event) => {
|
|
127
|
+
|
|
128
|
+
if (event && event.target instanceof HTMLElement && event.target.closest('.btn-primary')){
|
|
129
|
+
|
|
130
|
+
const button = event.target.closest('.btn-primary');
|
|
131
|
+
|
|
132
|
+
// If the input allows multiples then use the buffer clone input
|
|
133
|
+
const inputTrigger = input.hasAttribute('multiple') ? cloneInput : input;
|
|
134
|
+
|
|
135
|
+
inputTrigger.click();
|
|
136
|
+
}
|
|
137
|
+
});
|
|
123
138
|
}
|
|
124
139
|
|
|
125
140
|
export default fileupload;
|
|
@@ -283,6 +283,16 @@ export const addFilterEventListeners = (table, form, pagination, wrapper, savedT
|
|
|
283
283
|
|
|
284
284
|
formSubmit(event);
|
|
285
285
|
}
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
if(event && event.target instanceof HTMLElement && event.target.hasAttribute('id')){
|
|
289
|
+
|
|
290
|
+
let id = event.target.getAttribute('id');
|
|
291
|
+
|
|
292
|
+
if(document.querySelector(`[data-duplicate="${id}"]`)){
|
|
293
|
+
document.querySelector(`[data-duplicate="${id}"]`).checked = event.target.checked;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
286
296
|
});
|
|
287
297
|
|
|
288
298
|
|