@iamproperty/components 4.1.0-beta → 4.1.0-beta-3

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.
Files changed (40) hide show
  1. package/assets/css/components/actionbar.css +1 -1
  2. package/assets/css/components/actionbar.css.map +1 -1
  3. package/assets/css/components/card-global.css +1 -1
  4. package/assets/css/components/card-global.css.map +1 -1
  5. package/assets/css/components/dialog.css +1 -1
  6. package/assets/css/components/dialog.css.map +1 -1
  7. package/assets/css/components/forms.css +1 -1
  8. package/assets/css/components/forms.css.map +1 -1
  9. package/assets/css/core.min.css +1 -1
  10. package/assets/css/core.min.css.map +1 -1
  11. package/assets/css/style.min.css +1 -1
  12. package/assets/css/style.min.css.map +1 -1
  13. package/assets/js/components/accordion/accordion.component.min.js +1 -1
  14. package/assets/js/components/actionbar/actionbar.component.min.js +4 -4
  15. package/assets/js/components/actionbar/actionbar.component.min.js.map +1 -1
  16. package/assets/js/components/applied-filters/applied-filters.component.min.js +1 -1
  17. package/assets/js/components/card/card.component.min.js +1 -1
  18. package/assets/js/components/collapsible-side/collapsible-side.component.min.js +1 -1
  19. package/assets/js/components/filterlist/filterlist.component.min.js +1 -1
  20. package/assets/js/components/header/header.component.min.js +1 -1
  21. package/assets/js/components/nav/nav.component.min.js +1 -1
  22. package/assets/js/components/notification/notification.component.min.js +1 -1
  23. package/assets/js/components/pagination/pagination.component.min.js +1 -1
  24. package/assets/js/components/table/table.component.min.js +1 -1
  25. package/assets/js/components/tabs/tabs.component.min.js +1 -1
  26. package/assets/js/dynamic.min.js +4 -4
  27. package/assets/js/dynamic.min.js.map +1 -1
  28. package/assets/js/modules/dialogs.js +20 -4
  29. package/assets/js/scripts.bundle.js +15 -15
  30. package/assets/js/scripts.bundle.js.map +1 -1
  31. package/assets/js/scripts.bundle.min.js +2 -2
  32. package/assets/js/scripts.bundle.min.js.map +1 -1
  33. package/assets/sass/components/actionbar.scss +7 -1
  34. package/assets/sass/components/card-global.scss +7 -0
  35. package/assets/sass/components/dialog.scss +56 -38
  36. package/assets/sass/components/forms.scss +112 -102
  37. package/assets/ts/modules/dialogs.ts +25 -5
  38. package/dist/components.es.js +409 -402
  39. package/dist/components.umd.js +43 -43
  40. package/package.json +1 -1
@@ -60,7 +60,10 @@
60
60
  justify-content: flex-end;
61
61
  align-items: center;
62
62
  height: rem(68);
63
- position: absolute;
63
+
64
+ @supports selector(:has(*)) {
65
+ position: absolute;
66
+ }
64
67
  inset: 0;
65
68
 
66
69
  @include container-up(sm) {
@@ -83,7 +86,10 @@
83
86
  }
84
87
 
85
88
  display: flex;
89
+
90
+ @supports selector(:has(*)) {
86
91
  opacity: 0;
92
+ }
87
93
  pointer-events: none;
88
94
  }
89
95
 
@@ -26,6 +26,12 @@ iam-card.card--flag {
26
26
  iam-card {
27
27
 
28
28
 
29
+ @supports not selector(:has(*)) {
30
+
31
+ margin-bottom: 2rem;
32
+ display: block;
33
+ }
34
+
29
35
  > div:has([type="checkbox"]) {
30
36
  display: contents;
31
37
 
@@ -43,6 +49,7 @@ iam-card {
43
49
  }
44
50
  }
45
51
 
52
+
46
53
  [data-select-container]:has([type="checkbox"]:checked) iam-card {
47
54
 
48
55
  > div:has([type="checkbox"]) {
@@ -24,13 +24,11 @@ dialog[open] {
24
24
  display: flex;
25
25
  flex-direction: column;
26
26
 
27
- > *:last-child,
28
- > .mh-lg > *:last-child{
27
+ > *:last-child {
29
28
  margin-bottom: 0;
30
29
  }
31
30
 
32
- > :is(p):last-child,
33
- > .mh-lg > :is(p):last-child {
31
+ > :is(p):last-child {
34
32
  padding-bottom: 0;
35
33
  }
36
34
  }
@@ -161,13 +159,13 @@ dialog[open] {
161
159
  padding-right: calc(var(--dialog-padding) - 10px);
162
160
  margin-right: calc((var(--dialog-padding) * -1) + 10px);
163
161
  margin-bottom: calc(var(--dialog-padding) * -1);
164
- padding-bottom: var(--dialog-padding);
165
- //max-height: none!important;
166
162
 
167
- &:before {
168
- top: 100%;
169
- height: var(--dialog-padding);
170
- margin-bottom: -2rem;
163
+ > *:last-child {
164
+ margin-bottom: 2rem!important;
165
+ }
166
+
167
+ > p:last-child {
168
+ padding-bottom: 0!important;
171
169
  }
172
170
  }
173
171
  }
@@ -279,10 +277,11 @@ dialog::backdrop {
279
277
  top: calc(var(--dialog-padding) * 4);
280
278
  }
281
279
 
280
+ @supports selector(:has(*)) {
282
281
  fieldset:not(.active) {
283
282
  display: none;
284
283
  }
285
-
284
+ }
286
285
  &:not(:has(fieldset.active)) fieldset:first-of-type{
287
286
  display: flex;
288
287
  flex-direction: column;
@@ -440,36 +439,55 @@ dialog::backdrop {
440
439
  margin-top: auto;
441
440
  text-align: right;
442
441
  }
443
- > form {
444
- display: contents
445
- }
446
- fieldset {
447
- display: flex;
448
- flex-direction: column;
449
- flex-grow: 1;
450
- position: relative;
442
+
443
+
444
+ @supports not selector(:has(*)) {
445
+ > form {
446
+ overflow: auto;
451
447
 
452
- overflow: auto;
453
- margin-bottom: calc(var(--dialog-padding) * -1);
454
- padding-bottom: var(--dialog-padding);
448
+ button:not([type="submit"]){
449
+ display: none;
450
+ }
451
+ }
452
+ }
453
+ @supports selector(:has(*)) {
454
+ > form {
455
+ display: contents
456
+ }
457
+ fieldset {
458
+ display: flex;
459
+ flex-direction: column;
460
+ flex-grow: 1;
461
+ position: relative;
462
+
463
+ overflow: auto;
464
+ margin-bottom: calc(var(--dialog-padding) * -1);
465
+ padding-right: calc(var(--dialog-padding) - 10px);
466
+ margin-right: calc((var(--dialog-padding) * -1) + 10px);
467
+
468
+ > :last-child {
469
+ margin-bottom: var(--dialog-padding)!important;
470
+ }
455
471
 
456
-
457
- padding-right: calc(var(--dialog-padding) - 10px);
458
- margin-right: calc((var(--dialog-padding) * -1) + 10px);
472
+ > p:last-child {
473
+ padding-bottom: 0!important;
474
+ margin-bottom: var(--dialog-padding)!important;
475
+ }
459
476
 
460
- &::before {
461
- content: "";
462
- top: 100%;
463
- bottom: 0;
464
- left: 0;
465
- right: 0;
466
- height: var(--dialog-padding);
467
- min-height: var(--dialog-padding);
468
- position: sticky;
469
- display: block;
470
- background: linear-gradient(180deg, transparent 0%, var(--colour-canvas-2) 100%);
471
- z-index: 2;
472
- margin-bottom: calc(var(--dialog-padding) * -1);;
477
+ &::before {
478
+ content: "";
479
+ top: 100%;
480
+ bottom: 0;
481
+ left: 0;
482
+ right: 0;
483
+ height: var(--dialog-padding);
484
+ min-height: var(--dialog-padding);
485
+ position: sticky;
486
+ display: block;
487
+ background: linear-gradient(180deg, transparent 0%, var(--colour-canvas-2) 100%);
488
+ z-index: 2;
489
+ margin-bottom: calc(var(--dialog-padding) * -1);;
490
+ }
473
491
  }
474
492
  }
475
493
  }
@@ -16,7 +16,7 @@ label {
16
16
  // #endregion
17
17
 
18
18
  // #region input field
19
- :is(input,textarea,output,select) {
19
+ :is(input:not([type="checkbox"]):not([type="radio"]),textarea,output,select) {
20
20
  display: block;
21
21
  width: 100%;
22
22
  max-width: $content-max-width;
@@ -108,7 +108,7 @@ div:has(> label:first-child):has(> input) {
108
108
  text-align: center;
109
109
  }
110
110
 
111
- input, output, .prefix, .suffix {
111
+ input:not([type="checkbox"]):not([type="radio"]), output, .prefix, .suffix {
112
112
  margin-bottom: 0;
113
113
  }
114
114
 
@@ -116,12 +116,12 @@ div:has(> label:first-child):has(> input) {
116
116
  flex-wrap: wrap;
117
117
  align-items: center;
118
118
 
119
- > *:not(input):not(output):not(.prefix):not(.suffix) {
119
+ > *:not(input:not([type="checkbox"]):not([type="radio"])):not(output):not(.prefix):not(.suffix) {
120
120
  flex-shrink: 0;
121
121
  width: 100%;
122
122
  }
123
123
 
124
- :is(input,textarea,output) {
124
+ :is(input:not([type="checkbox"]):not([type="radio"]),textarea,output) {
125
125
  flex-shrink: 1;
126
126
  flex-grow: 1;
127
127
  width: 0;
@@ -133,9 +133,9 @@ div:has(> label:first-child):has(> input) {
133
133
  }
134
134
 
135
135
  input[type="color"]{
136
- width: 3rem;
137
- flex-shrink: 0;
138
- flex-grow: 0;
136
+ width: 3rem!important;
137
+ flex-shrink: 0!important;
138
+ flex-grow: 0!important;
139
139
  border-start-end-radius: 0;
140
140
  border-end-end-radius: 0;
141
141
  padding: 0;
@@ -156,9 +156,10 @@ div:has(> label:first-child):has(> input) {
156
156
  }
157
157
 
158
158
  output {
159
- border-left: none;
160
- border-end-start-radius: 0;
161
- border-start-start-radius: 0;
159
+ border-left: none!important;
160
+ border-end-start-radius: 0!important;
161
+ border-start-start-radius: 0!important;
162
+ margin: 0!important;
162
163
  }
163
164
  }
164
165
 
@@ -192,111 +193,117 @@ div:has(> label:first-child):has(> input):has(> :is(.form-control-inline,.input-
192
193
 
193
194
  // #region prefix
194
195
  :is(.prefix, .suffix) {
195
- display: inline-block;
196
- width: auto;
197
- padding: var(--input-padding-block, #{rem(12)}) var(--input-padding-block, #{rem(16)});
198
- font-size: var(--input-fs, #{rem(16)});
199
- line-height: var(--input-lh, #{rem(20)});
200
- color: var(--colour-body);
201
- background-color: var(--colour-primary-theme);
202
- border: 2px solid var(--colour-primary);
203
- color: var(--colour-white);
204
- margin-bottom: 1rem;
205
- border-end-start-radius: rem(8);
206
- border-start-start-radius: rem(8);
207
- min-width: calc(#{rem(20 + 12 + 12)} + 4px);
208
- overflow: hidden;
209
- white-space: nowrap;
210
- text-align: center;
211
- text-overflow: ellipsis;
212
- position: relative;
213
-
214
- min-height: calc(var(--input-padding-block, #{rem(12)}) + var(--input-padding-block, #{rem(12)}) + var(--input-lh, #{rem(20)}) + 4px);
215
- max-height: calc(var(--input-padding-block, #{rem(12)}) + var(--input-padding-block, #{rem(12)}) + var(--input-lh, #{rem(20)}) + 4px);
216
-
196
+ display: none;
197
+ }
198
+ @supports selector(:has(*)) {
217
199
 
218
- &:after {
200
+ :is(.prefix, .suffix) {
219
201
  display: inline-block;
220
- max-width: rem(20);
221
- }
202
+ width: auto;
203
+ padding: var(--input-padding-block, #{rem(12)}) var(--input-padding-block, #{rem(16)});
204
+ font-size: var(--input-fs, #{rem(16)});
205
+ line-height: var(--input-lh, #{rem(20)});
206
+ color: var(--colour-body);
207
+ background-color: var(--colour-primary-theme);
208
+ border: 2px solid var(--colour-primary);
209
+ color: var(--colour-white);
210
+ margin-bottom: 1rem;
211
+ border-end-start-radius: rem(8);
212
+ border-start-start-radius: rem(8);
213
+ min-width: calc(#{rem(20 + 12 + 12)} + 4px);
214
+ overflow: hidden;
215
+ white-space: nowrap;
216
+ text-align: center;
217
+ text-overflow: ellipsis;
218
+ position: relative;
219
+
220
+ min-height: calc(var(--input-padding-block, #{rem(12)}) + var(--input-padding-block, #{rem(12)}) + var(--input-lh, #{rem(20)}) + 4px);
221
+ max-height: calc(var(--input-padding-block, #{rem(12)}) + var(--input-padding-block, #{rem(12)}) + var(--input-lh, #{rem(20)}) + 4px);
222
222
 
223
- &[class*="fa-"] {
224
- width: calc(#{rem(20 + 12 + 12)} + 4px);
225
- padding-inline: 0;
226
- }
227
223
 
228
- select {
229
- position: absolute;
230
- inset: 0;
231
- opacity: 0;
232
- cursor: pointer;
233
- }
224
+ &:after {
225
+ display: inline-block;
226
+ max-width: rem(20);
227
+ }
234
228
 
235
- span {
236
- display: none;
237
- }
229
+ &[class*="fa-"] {
230
+ width: calc(#{rem(20 + 12 + 12)} + 4px);
231
+ padding-inline: 0;
232
+ }
238
233
 
239
- select:has(option:nth-child(1):checked) ~ span:nth-of-type(1),
240
- select:has(option:nth-child(2):checked) ~ span:nth-of-type(2),
241
- select:has(option:nth-child(3):checked) ~ span:nth-of-type(3),
242
- select:has(option:nth-child(4):checked) ~ span:nth-of-type(4),
243
- select:has(option:nth-child(5):checked) ~ span:nth-of-type(5),
244
- select:has(option:nth-child(6):checked) ~ span:nth-of-type(6),
245
- select:has(option:nth-child(7):checked) ~ span:nth-of-type(7),
246
- select:has(option:nth-child(8):checked) ~ span:nth-of-type(8),
247
- select:has(option:nth-child(9):checked) ~ span:nth-of-type(9),
248
- select:has(option:nth-child(10):checked) ~ span:nth-of-type(10) {
234
+ select {
235
+ position: absolute;
236
+ inset: 0;
237
+ opacity: 0;
238
+ cursor: pointer;
239
+ }
249
240
 
250
- display: block;
251
- }
241
+ span {
242
+ display: none;
243
+ }
252
244
 
253
- select ~ span:after {
254
- content: " \f078";
255
- font-family: "Font Awesome 6 Pro";
256
- font-size: 0.8em;
257
- display: inline-block;
258
- padding-left: 1em;
259
- }
245
+ select:has(option:nth-child(1):checked) ~ span:nth-of-type(1),
246
+ select:has(option:nth-child(2):checked) ~ span:nth-of-type(2),
247
+ select:has(option:nth-child(3):checked) ~ span:nth-of-type(3),
248
+ select:has(option:nth-child(4):checked) ~ span:nth-of-type(4),
249
+ select:has(option:nth-child(5):checked) ~ span:nth-of-type(5),
250
+ select:has(option:nth-child(6):checked) ~ span:nth-of-type(6),
251
+ select:has(option:nth-child(7):checked) ~ span:nth-of-type(7),
252
+ select:has(option:nth-child(8):checked) ~ span:nth-of-type(8),
253
+ select:has(option:nth-child(9):checked) ~ span:nth-of-type(9),
254
+ select:has(option:nth-child(10):checked) ~ span:nth-of-type(10) {
255
+
256
+ display: block;
257
+ }
258
+
259
+ select ~ span:after {
260
+ content: " \f078";
261
+ font-family: "Font Awesome 6 Pro";
262
+ font-size: 0.8em;
263
+ display: inline-block;
264
+ padding-left: 1em;
265
+ }
260
266
 
261
- select:focus-visible ~ span:after {
262
- content: "\f077";
267
+ select:focus-visible ~ span:after {
268
+ content: "\f077";
269
+ }
263
270
  }
264
- }
265
271
 
266
- .prefix {
267
-
268
- border-right: none;
269
- }
272
+ .prefix {
273
+
274
+ border-right: none;
275
+ }
270
276
 
271
- .suffix {
272
-
273
- border-left: none;
274
- border-end-start-radius: 0;
275
- border-start-start-radius: 0;
276
- border-start-end-radius: rem(8)!important;
277
- border-end-end-radius: rem(8)!important;
278
- order: 2;
279
- }
277
+ .suffix {
278
+
279
+ border-left: none;
280
+ border-end-start-radius: 0;
281
+ border-start-start-radius: 0;
282
+ border-start-end-radius: rem(8)!important;
283
+ border-end-end-radius: rem(8)!important;
284
+ order: 2;
285
+ }
280
286
 
281
- .prefix span {
282
- display: none;
287
+ .prefix span {
288
+ display: none;
283
289
 
284
- small {
285
- font-size: 0.8em;
290
+ small {
291
+ font-size: 0.8em;
292
+ }
286
293
  }
287
- }
288
294
 
289
- .prefix ~ :is(input,textarea,output) {
290
-
291
- border-end-start-radius: 0;
292
- border-start-start-radius: 0;
293
- }
295
+ .prefix ~ :is(input:not([type="checkbox"]):not([type="radio"]),textarea,output) {
296
+
297
+ border-end-start-radius: 0!important;
298
+ border-start-start-radius: 0!important;
299
+ }
294
300
 
295
- .suffix ~ :is(input,textarea,output) {
296
- order: 1;
297
-
298
- border-start-end-radius: 0;
299
- border-end-end-radius: 0;
301
+ .suffix ~ :is(input:not([type="checkbox"]):not([type="radio"]),textarea,output) {
302
+ order: 1;
303
+
304
+ border-start-end-radius: 0!important;
305
+ border-end-end-radius: 0!important;
306
+ }
300
307
  }
301
308
  // #endregion
302
309
 
@@ -379,6 +386,8 @@ $icon-tick: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' view
379
386
  // #endregion
380
387
 
381
388
  // #region radio/checkbox field
389
+ @supports selector(:has(*)) {
390
+
382
391
  input:is([type="radio"],[type="checkbox"]) {
383
392
  position: absolute;
384
393
  top: 0;
@@ -392,8 +401,7 @@ input:is([type="radio"],[type="checkbox"]) {
392
401
 
393
402
  :is(div,fieldset):has(> input:is([type="radio"],[type="checkbox"])) {
394
403
  position: relative;
395
-
396
- padding-bottom: rem(24);
404
+ margin-bottom: rem(24);
397
405
  }
398
406
 
399
407
  :is(div,fieldset):has( > input[type="radio"]){
@@ -433,7 +441,7 @@ input:is([type="radio"],[type="checkbox"]) + label:not(:has(> iam-card)) {
433
441
 
434
442
  &:last-child {
435
443
 
436
- margin-bottom: rem(24);
444
+ margin-bottom: 0;
437
445
  }
438
446
 
439
447
  &:before {
@@ -497,7 +505,7 @@ input[type="radio"] + label:not(:has(> iam-card)) {
497
505
  }
498
506
 
499
507
  div:has(> :is(input[type="radio"],input[type="checkbox"]):nth-of-type(2)) {
500
- label:not(:has(> iam-card)):not(:last-of-type) {
508
+ label:not(:has(> iam-card)) {
501
509
  margin-bottom: 0rem;
502
510
  }
503
511
  }
@@ -629,6 +637,8 @@ input[type="checkbox"][disabled]:checked + label {
629
637
  border-color: #E0E0E0!important;
630
638
  }
631
639
  }
640
+
641
+ }
632
642
  // #endregion
633
643
 
634
644
  // #region Conditional reveal
@@ -261,6 +261,7 @@ export const createMultiFormDialog = (dialog) => {
261
261
 
262
262
  let buttons = "";
263
263
  let fieldsets = Array.from(dialog.querySelectorAll('fieldset[data-title]'));
264
+ let form = dialog.querySelector('form');
264
265
 
265
266
  fieldsets.forEach((fieldset,index) => {
266
267
  buttons += `<button data-title="${fieldset.getAttribute('data-title')}" type="button" class="${index == 0 ? "active":""}" tabindex="-1">${fieldset.getAttribute('data-title')}</button>`;
@@ -275,8 +276,18 @@ export const createMultiFormDialog = (dialog) => {
275
276
  if(index != fieldsets.length - 1)
276
277
  btnWrapper.innerHTML += `<button data-title="${fieldsets[index+1].getAttribute('data-title')}" class="btn btn-primary mb-0" data-next type="button">Next</button>`;
277
278
 
278
- if(index == fieldsets.length - 1)
279
- btnWrapper.innerHTML += `<button data-title="${fieldsets[index].getAttribute('data-title')}" class="btn btn-primary mb-0" data-next type="submit">Submit</button>`;
279
+ // Last fieldset
280
+ if(index == fieldsets.length - 1){
281
+ if(form && form.querySelector(':scope > button[type="submit"]')){
282
+
283
+ let existingButton = form.querySelector(':scope > button[type="submit"]');
284
+ existingButton.classList.add('mb-0')
285
+
286
+ btnWrapper.insertAdjacentElement('beforeend',existingButton);
287
+ }
288
+ else
289
+ btnWrapper.innerHTML += `<button data-title="${fieldsets[index].getAttribute('data-title')}" class="btn btn-primary mb-0" data-next type="submit">Submit</button>`;
290
+ }
280
291
  });
281
292
 
282
293
  dialog.insertAdjacentHTML('afterbegin',`<div class="steps bg-primary">${buttons}</div>`);
@@ -376,11 +387,12 @@ export const createMultiFormDialog = (dialog) => {
376
387
 
377
388
  const button = event.target.closest('button');
378
389
 
379
- if(event.keyCode == 13){
390
+ if(event.keyCode == 13 && button.getAttribute('type') != "submit"){
380
391
 
381
392
  event.preventDefault();
382
393
  validateFieldset(button);
383
394
  }
395
+
384
396
  }
385
397
 
386
398
  if (event && event.target instanceof HTMLElement && event.target.closest('input')){
@@ -388,13 +400,21 @@ export const createMultiFormDialog = (dialog) => {
388
400
 
389
401
  input.classList.remove('is-invalid');
390
402
 
391
-
403
+ if(event.keyCode == 13){
404
+
405
+ event.preventDefault();
406
+ }
392
407
  }
393
408
  });
394
409
 
395
410
 
396
411
  dialog.addEventListener('click', (event) => {
397
- if (event && event.target instanceof HTMLElement && event.target.closest('button[data-title]')){
412
+ if (event && event.target instanceof HTMLElement && event.target.closest('button[type="submit"]')){
413
+
414
+ const form = event.target.closest('form');
415
+ form.classList.add('was-validated');
416
+ }
417
+ else if (event && event.target instanceof HTMLElement && event.target.closest('button[data-title]')){
398
418
 
399
419
  const button = event.target.closest('button[data-title]');
400
420
  validateFieldset(button);