@iamproperty/components 5.4.2-beta2 → 5.4.2-beta3

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 (69) 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/actionbar.global.css +1 -1
  4. package/assets/css/components/actionbar.global.css.map +1 -1
  5. package/assets/css/components/table.global.css +1 -1
  6. package/assets/css/components/table.global.css.map +1 -1
  7. package/assets/css/core.min.css +1 -1
  8. package/assets/css/core.min.css.map +1 -1
  9. package/assets/css/style.min.css +1 -1
  10. package/assets/css/style.min.css.map +1 -1
  11. package/assets/js/bundle.js +0 -1
  12. package/assets/js/components/accordion/accordion.component.js +24 -11
  13. package/assets/js/components/accordion/accordion.component.min.js +13 -9
  14. package/assets/js/components/accordion/accordion.component.min.js.map +1 -1
  15. package/assets/js/components/actionbar/actionbar.component.js +3 -3
  16. package/assets/js/components/actionbar/actionbar.component.min.js +5 -5
  17. package/assets/js/components/actionbar/actionbar.component.min.js.map +1 -1
  18. package/assets/js/components/address-lookup/address-lookup.component.min.js +1 -1
  19. package/assets/js/components/applied-filters/applied-filters.component.min.js +1 -1
  20. package/assets/js/components/card/card.component.min.js +1 -1
  21. package/assets/js/components/collapsible-side/collapsible-side.component.min.js +1 -1
  22. package/assets/js/components/fileupload/fileupload.component.min.js +1 -1
  23. package/assets/js/components/filterlist/filterlist.component.min.js +1 -1
  24. package/assets/js/components/header/header.component.min.js +1 -1
  25. package/assets/js/components/nav/nav.component.min.js +1 -1
  26. package/assets/js/components/notification/notification.component.min.js +1 -1
  27. package/assets/js/components/pagination/pagination.component.min.js +1 -1
  28. package/assets/js/components/search/search.component.min.js +1 -1
  29. package/assets/js/components/search/search.component.min.js.map +1 -1
  30. package/assets/js/components/table/table.component.min.js +2 -2
  31. package/assets/js/components/table/table.component.min.js.map +1 -1
  32. package/assets/js/components/tabs/tabs.component.min.js +1 -1
  33. package/assets/js/dynamic.js +0 -1
  34. package/assets/js/dynamic.min.js +2 -2
  35. package/assets/js/dynamic.min.js.map +1 -1
  36. package/assets/js/flat-components.js +0 -5
  37. package/assets/js/modules/helpers.js +3 -0
  38. package/assets/js/scripts.bundle.js +26 -20
  39. package/assets/js/scripts.bundle.js.map +1 -1
  40. package/assets/js/scripts.bundle.min.js +2 -2
  41. package/assets/js/scripts.bundle.min.js.map +1 -1
  42. package/assets/sass/_elements.scss +1 -0
  43. package/assets/sass/components/actionbar.global.scss +9 -0
  44. package/assets/sass/components/actionbar.scss +4 -0
  45. package/assets/sass/components/table.global.scss +2 -2
  46. package/assets/sass/elements/details.scss +118 -0
  47. package/assets/sass/elements/dialog.scss +1 -1
  48. package/assets/sass/elements/type.scss +10 -8
  49. package/assets/ts/bundle.ts +0 -1
  50. package/assets/ts/components/accordion/README.md +0 -1
  51. package/assets/ts/components/accordion/accordion.component.ts +26 -12
  52. package/assets/ts/components/actionbar/actionbar.component.ts +3 -3
  53. package/assets/ts/dynamic.ts +0 -1
  54. package/assets/ts/flat-components.ts +0 -6
  55. package/assets/ts/modules/helpers.ts +3 -0
  56. package/dist/components.es.js +222 -224
  57. package/dist/components.umd.js +57 -109
  58. package/package.json +1 -1
  59. package/src/components/Accordion/Accordion.vue +1 -1
  60. package/src/components/Accordion/AccordionItem.vue +1 -1
  61. package/src/components/Actionbar/Actionbar.vue +1 -1
  62. package/assets/css/components/accordion.css +0 -1
  63. package/assets/css/components/accordion.css.map +0 -1
  64. package/assets/css/components/accordion.global.css +0 -1
  65. package/assets/css/components/accordion.global.css.map +0 -1
  66. package/assets/js/modules/accordion.js +0 -30
  67. package/assets/sass/components/accordion.global.scss +0 -135
  68. package/assets/sass/components/accordion.scss +0 -27
  69. package/assets/ts/modules/accordion.ts +0 -38
@@ -16,3 +16,4 @@
16
16
  @import "elements/forms.scss";
17
17
 
18
18
  @import "elements/badge.scss";
19
+ @import "elements/details.scss";
@@ -145,6 +145,15 @@ iam-actionbar {
145
145
 
146
146
  background: none;
147
147
  border: none;
148
+ text-indent: 0;
149
+ width: 100%;
150
+ display: block;
151
+ max-width: 100%;
152
+ text-align: left;
153
+
154
+ &:before {
155
+ position: static;
156
+ }
148
157
  }
149
158
  button[slot="overflow"],
150
159
  button[slot="selected-overflow"] {
@@ -1,5 +1,9 @@
1
1
  @use "../_func.scss" as *;
2
2
 
3
+ :host {
4
+ background-color: #FCFCFC;
5
+ }
6
+
3
7
  .actionbar__wrapper {
4
8
  position: relative;
5
9
  z-index: 10;
@@ -357,7 +357,7 @@ table {
357
357
  color: var(--colour-muted);
358
358
  }
359
359
 
360
- :is([data-content="requires approval"],[data-content="approval required"],[data-content="upcoming"]):after {
360
+ :is([data-content="requires approval"],[data-content="approval required"],[data-content="action required"],[data-content="upcoming"]):after {
361
361
 
362
362
  content: "\f024";
363
363
  color: var(--colour-warning);
@@ -369,7 +369,7 @@ table {
369
369
  color: var(--colour-warning);
370
370
  }
371
371
 
372
- :is([data-content="verified"],[data-content="completed"],[data-content="complete"]):after {
372
+ :is([data-content="manually verified"],[data-content="verified"],[data-content="completed"],[data-content="complete"]):after {
373
373
 
374
374
  content: "\f00c";
375
375
  font-weight: normal;
@@ -0,0 +1,118 @@
1
+ details {
2
+
3
+ --inline-padding: #{rem(2)};
4
+ --border-radius: #{rem(8)} #{rem(8)} 0 0;
5
+ --icon-top: #{rem(14)};
6
+ --line-height: #{rem(24)};
7
+
8
+ *:not(iam-tabs) > &:not([open]){
9
+
10
+ padding-bottom: rem(42);
11
+ }
12
+
13
+ @include media-breakpoint-up(sm) {
14
+
15
+ --inline-padding: #{rem(30)};
16
+ --icon-top: #{rem(24)};
17
+ --line-height: #{rem(24)};
18
+ }
19
+
20
+ summary {
21
+
22
+ border-bottom: 1px solid var(--colour-border);
23
+ padding-left: var(--inline-padding);
24
+ padding-right: calc(var(--inline-padding) + #{rem(24)} + #{rem(24)});
25
+ padding-block: rem(14)!important;
26
+ position: relative;
27
+ color: $headings-color;
28
+
29
+ &:is(:hover,:focus-visible) {
30
+ background: var(--colour-light);
31
+ border-radius: var(--border-radius);
32
+ }
33
+
34
+
35
+ h3,.h3 {
36
+ all: unset!important;
37
+ }
38
+
39
+ *:is(h1,h2,h4,h5,h6,.h1,.h2,.h4,.h5,.h6){
40
+ max-width: 100%;
41
+ padding: 0;
42
+ margin: 0;
43
+
44
+ &:after {
45
+ content: "\f055";
46
+ position: absolute;
47
+ font-size: rem(24);
48
+ top: calc((#{var(--line-height)} / 2) - #{rem(12)} + #{rem(14)});
49
+ right: var(--inline-padding);
50
+ width: rem(24);
51
+ height: rem(24);
52
+ line-height: rem(24);
53
+ font-weight: 300;
54
+ font-family: "Font Awesome 6 Pro";
55
+ }
56
+ }
57
+ }
58
+
59
+ &[open] summary {
60
+ margin-bottom: 2rem;
61
+ }
62
+
63
+ &[open] summary :is(h1,h2,h4,h5,h6,.h1,.h2,.h4,.h5,.h6) {
64
+
65
+ &:after {
66
+ content: "\f056";
67
+ font-weight: 900;
68
+ }
69
+ }
70
+
71
+ summary:not(:has(h1,h2,h4,h5,h6,.h1,.h2,.h4,.h5,.h6)) { // h3 purposelessly missed out
72
+
73
+ font-family: $headings-font-family;
74
+ font-style: $headings-font-style;
75
+ color: $headings-color;
76
+ clear: both;
77
+ display: block;
78
+
79
+ [class*="fa-"] {
80
+ margin-right: 0.5rem;
81
+ }
82
+
83
+ font-size: rem(18);
84
+ line-height: var(--line-height);
85
+ padding-bottom: rem(map-get($heading-sizes,"h3_pb"));
86
+ font-weight: 700;
87
+ max-width: 100%;
88
+
89
+ &:after {
90
+ content: "\f055";
91
+ position: absolute;
92
+ font-size: rem(24);
93
+ top: calc((#{var(--line-height)} / 2) - #{rem(12)} + #{rem(14)});
94
+ right: var(--inline-padding);
95
+ width: rem(24);
96
+ height: rem(24);
97
+ line-height: rem(24);
98
+ font-weight: 300;
99
+ font-family: "Font Awesome 6 Pro";
100
+ }
101
+
102
+ @include media-breakpoint-up(sm) {
103
+
104
+ font-size: rem(map-get($heading-sizes,"h3_fs_sm"));
105
+ --line-height: #{rem(map-get($heading-sizes,"h3_lh_sm"))};
106
+ padding-bottom: rem(map-get($heading-sizes,"h3_pb_sm"));
107
+ font-weight: 900;
108
+ }
109
+ }
110
+
111
+ &[open] summary:not(:has(h1,h2,h4,h5,h6,.h1,.h2,.h4,.h5,.h6)) {
112
+
113
+ &:after {
114
+ content: "\f056";
115
+ font-weight: 900;
116
+ }
117
+ }
118
+ }
@@ -529,7 +529,7 @@ dialog::backdrop {
529
529
 
530
530
  margin-bottom: 0.25rem;
531
531
 
532
- &:not(.btn-compact):after {
532
+ &:not(.btn-compact):not([class*="fa-"]):after {
533
533
  content: "";
534
534
 
535
535
  display: inline-block;
@@ -11,13 +11,14 @@ mark {
11
11
 
12
12
  // #region headings
13
13
  %heading {
14
+ --line-height: #{$headings-line-height};
14
15
  // From bootstrap reboot
15
16
  margin-top: 0; // 1
16
17
  margin-bottom: $headings-margin-bottom;
17
18
  font-family: $headings-font-family;
18
19
  font-style: $headings-font-style;
19
20
  font-weight: bold;
20
- line-height: $headings-line-height;
21
+ line-height: var(--line-height);
21
22
  color: $headings-color;
22
23
  // END:Bootstap reboot
23
24
  clear: both;
@@ -35,36 +36,37 @@ mark {
35
36
  }
36
37
 
37
38
  :is(.h1, h1) {
39
+ --line-height: #{rem(map-get($heading-sizes,"h1_lh"))};
40
+
38
41
  font-size: rem(map-get($heading-sizes,"h1_fs"));
39
- line-height: rem(map-get($heading-sizes,"h1_lh"));
40
42
  padding-bottom: rem(map-get($heading-sizes,"h1_pb"));
41
43
  font-weight: 900;
42
44
 
43
45
  @include media-breakpoint-up(sm) {
44
46
 
45
47
  font-size: rem(map-get($heading-sizes,"h1_fs_sm"));
46
- line-height: rem(map-get($heading-sizes,"h1_lh_sm"));
48
+ --line-height: #{rem(map-get($heading-sizes,"h1_lh_sm"))};
47
49
  padding-bottom: rem(map-get($heading-sizes,"h1_pb_sm"));
48
50
  }
49
51
  }
50
52
 
51
53
  :is(h2, .h2) {
52
54
  font-size: rem(map-get($heading-sizes,"h2_fs"));
53
- line-height: rem(map-get($heading-sizes,"h2_lh"));
55
+ --line-height: #{rem(map-get($heading-sizes,"h2_lh"))};
54
56
  padding-bottom: rem(map-get($heading-sizes,"h1_pb"));
55
57
  font-weight: 900;
56
58
 
57
59
  @include media-breakpoint-up(sm) {
58
60
 
59
61
  font-size: rem(map-get($heading-sizes,"h2_fs_sm"));
60
- line-height: rem(map-get($heading-sizes,"h2_lh_sm"));
62
+ --line-height: #{rem(map-get($heading-sizes,"h2_lh_sm"))};
61
63
  padding-bottom: rem(map-get($heading-sizes,"h2_pb_sm"));
62
64
  }
63
65
  }
64
66
 
65
67
  :is(h3, .h3) {
66
68
  font-size: rem(map-get($heading-sizes,"h3_fs"));
67
- line-height: rem(map-get($heading-sizes,"h3_lh"));
69
+ --line-height: #{rem(map-get($heading-sizes,"h3_lh"))};
68
70
  padding-bottom: rem(map-get($heading-sizes,"h3_pb"));
69
71
  max-width: var(--content-max-width);
70
72
  font-weight: 900;
@@ -72,14 +74,14 @@ mark {
72
74
  @include media-breakpoint-up(sm) {
73
75
 
74
76
  font-size: rem(map-get($heading-sizes,"h3_fs_sm"));
75
- line-height: rem(map-get($heading-sizes,"h3_lh_sm"));
77
+ --line-height: #{rem(map-get($heading-sizes,"h3_lh_sm"))};
76
78
  padding-bottom: rem(map-get($heading-sizes,"h3_pb_sm"));
77
79
  }
78
80
  }
79
81
 
80
82
  :is(.h4, h4, .h5, h5, .h6, h6) {
81
83
  font-size: rem(map-get($heading-sizes,"h4_fs"));
82
- line-height: rem(map-get($heading-sizes,"h4_lh"));
84
+ --line-height: #{rem(map-get($heading-sizes,"h4_lh"))};
83
85
  padding-bottom: rem(map-get($heading-sizes,"h4_pb"));
84
86
  max-width: var(--content-max-width);
85
87
 
@@ -5,7 +5,6 @@ import extendDialogs from '../js/modules/dialogs'
5
5
  import createDataLayer from '../js/modules/data-layer'
6
6
  import extendInputs from '../js/modules/inputs';
7
7
  import nav from '../js/modules/nav'
8
- //import accordion from './modules/accordion'
9
8
  import testimonial from '../js/modules/testimonial'
10
9
  import carousel from '../js/modules/carousel'
11
10
  import form from '../js/modules/form'
@@ -29,4 +29,3 @@ import('../node_modules/@iamproperty/components/assets/js/components/accordion/a
29
29
  ### Class modifiers
30
30
 
31
31
  - Adding a class of **.accordion--keep-open** to the accordion will stop the items from closing when another one is opened.
32
- - Adding a class of **.accordion--straight** to the accordion will remove the slight indentation of the accordion.
@@ -1,5 +1,4 @@
1
1
  // @ts-nocheck
2
- import accordion from "../../modules/accordion";
3
2
 
4
3
  // Data layer Web component created
5
4
  window.dataLayer = window.dataLayer || [];
@@ -16,30 +15,45 @@ class iamAccordion extends HTMLElement {
16
15
 
17
16
  const assetLocation = document.body.hasAttribute('data-assets-location') ? document.body.getAttribute('data-assets-location') : '/assets'
18
17
  const coreCSS = document.body.hasAttribute('data-core-css') ? document.body.getAttribute('data-core-css') : `${assetLocation}/css/core.min.css`;
19
- const loadCSS = `@import "${assetLocation}/css/components/accordion.css";`;
20
- const loadExtraCSS = `@import "${assetLocation}/css/components/accordion.global.css";`;
21
18
 
22
19
  const template = document.createElement('template');
23
20
  template.innerHTML = `
24
21
  <style>
25
22
  @import "${coreCSS}";
26
- ${loadCSS}
27
- ${this.hasAttribute('css') ? `@import "${this.getAttribute('css')}";` : ``}
23
+
24
+ :host {
25
+ margin-bottom: 2.5rem;
26
+ display: block;
27
+ }
28
+
29
+ ::slotted(details) {
30
+ --border-radius: 0!important;
31
+ padding-bottom: 0!important;
32
+ }
28
33
  </style>
29
- <div class="accordion">
30
34
  <slot></slot>
31
- </div>
32
35
  `;
33
36
  this.shadowRoot.appendChild(template.content.cloneNode(true));
34
-
35
- // insert extra CSS
36
- if(!document.getElementById('accordionGlobal'))
37
- document.head.insertAdjacentHTML('beforeend',`<style id="accordionGlobal">${loadExtraCSS}</style>`);
38
37
  }
39
38
 
40
39
  connectedCallback() {
41
40
 
42
- accordion(this);
41
+ if(!this.classList.contains('accordion--keep-open')){
42
+
43
+ const details: NodeListOf<HTMLElement> = this.querySelectorAll(":scope > details");
44
+
45
+ // Add the toggle listeners.
46
+ details.forEach((targetDetail) => {
47
+ targetDetail.addEventListener("toggle", () => {
48
+ // Close all the details that are not targetDetail.
49
+ details.forEach((detail) => {
50
+ if (detail !== targetDetail && targetDetail.hasAttribute('open')) {
51
+ detail.removeAttribute("open");
52
+ }
53
+ });
54
+ });
55
+ });
56
+ }
43
57
  }
44
58
  }
45
59
 
@@ -276,7 +276,7 @@ class iamActionbar extends HTMLElement {
276
276
  modifier = screenWidth/375;
277
277
  }
278
278
 
279
- // Work out the safe sapce width depending upon the wrappers width and modifier
279
+ // Work out the safe sapce width depending upon the wrappers width and modifier comp
280
280
  if (wrapperWidth >= 992 && wrapperWidth <= 1280){
281
281
  safeAreaWidth = safeAreaWidth*modifier;
282
282
  }
@@ -293,7 +293,7 @@ class iamActionbar extends HTMLElement {
293
293
  // If the wrapper width is small we want to reduce the btn sizes by adding or removing btn-compact classes
294
294
  if (wrapperWidth < 576) {
295
295
 
296
- Array.from(that.querySelectorAll(':scope > .btn:not(.js-updated)')).forEach((element,index) => {
296
+ Array.from(that.querySelectorAll(':scope > .btn:not(.js-updated), :scope > .dialog__wrapper > .btn:first-child:not(.js-updated)')).forEach((element,index) => {
297
297
 
298
298
  element.className = element.className.replace(' btn-compact',' _btn-compact');
299
299
  element.classList.add('btn-compact');
@@ -302,7 +302,7 @@ class iamActionbar extends HTMLElement {
302
302
  }
303
303
  else {
304
304
 
305
- Array.from(that.querySelectorAll(':scope > .btn.js-updated')).forEach((element,index) => {
305
+ Array.from(that.querySelectorAll(':scope > .btn.js-updated, :scope > .dialog__wrapper > .btn.js-updated:first-child')).forEach((element,index) => {
306
306
 
307
307
  element.classList.remove('btn-compact');
308
308
  element.classList.remove('js-updated');
@@ -6,7 +6,6 @@ import createDataLayer from '../js/modules/data-layer'
6
6
  import extendInputs from '../js/modules/inputs';
7
7
  import nav from '../js/modules/nav'
8
8
  import table from '../js/modules/table'
9
- //import accordion from './modules/accordion'
10
9
  import testimonial from '../js/modules/testimonial'
11
10
  import carousel from '../js/modules/carousel'
12
11
  import form from '../js/modules/form'
@@ -6,7 +6,6 @@ import createDataLayer from '../js/modules/data-layer'
6
6
  import extendInputs from '../js/modules/inputs';
7
7
  import nav from '../js/modules/nav'
8
8
  import * as tableModule from './modules/table'
9
- import accordion from './modules/accordion'
10
9
  import testimonial from '../js/modules/testimonial'
11
10
  import carousel from '../js/modules/carousel'
12
11
  import form from '../js/modules/form'
@@ -48,11 +47,6 @@ document.addEventListener("DOMContentLoaded", function() {
48
47
  }
49
48
  });
50
49
 
51
- // Accordions
52
- Array.from(document.querySelectorAll('.accordion')).forEach((arrayElement) => {
53
- accordion(arrayElement);
54
- });
55
-
56
50
  // Testimonial
57
51
  Array.from(document.querySelectorAll('.testimonial')).forEach((arrayElement) => {
58
52
  testimonial(arrayElement);
@@ -31,6 +31,7 @@ export const addGlobalEvents = (body) => {
31
31
  const label = document.querySelector(`label[for="${hash.replace('#','')}"]`);
32
32
  const summary = document.querySelector(hash+' summary');
33
33
  const dialog = document.querySelector(`dialog${hash}`);
34
+ const detail = document.querySelector(`detail${hash}`);
34
35
 
35
36
  if(label instanceof HTMLElement)
36
37
  label.click();
@@ -38,6 +39,8 @@ export const addGlobalEvents = (body) => {
38
39
  summary.click();
39
40
  else if(dialog instanceof HTMLElement)
40
41
  dialog.showModal();
42
+ else if(detail instanceof HTMLElement)
43
+ detail.addAttribute('open');
41
44
  }
42
45
 
43
46
  if(location.hash)