@iamproperty/components 5.7.1-beta4 → 5.7.1-beta6

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 (60) hide show
  1. package/assets/css/components/barchart.component.css +1 -1
  2. package/assets/css/components/barchart.component.css.map +1 -1
  3. package/assets/css/components/card.css +1 -1
  4. package/assets/css/components/card.css.map +1 -1
  5. package/assets/css/components/card.global.css +1 -1
  6. package/assets/css/components/card.global.css.map +1 -1
  7. package/assets/css/components/charts.config.css +1 -1
  8. package/assets/css/components/charts.config.css.map +1 -1
  9. package/assets/css/components/charts.module.css +1 -1
  10. package/assets/css/components/charts.module.css.map +1 -1
  11. package/assets/css/core.min.css +1 -1
  12. package/assets/css/core.min.css.map +1 -1
  13. package/assets/css/style.min.css +1 -1
  14. package/assets/css/style.min.css.map +1 -1
  15. package/assets/js/components/accordion/accordion.component.min.js +1 -1
  16. package/assets/js/components/actionbar/actionbar.component.min.js +1 -1
  17. package/assets/js/components/address-lookup/address-lookup.component.min.js +1 -1
  18. package/assets/js/components/applied-filters/applied-filters.component.min.js +1 -1
  19. package/assets/js/components/barchart/barchart.component.js +8 -5
  20. package/assets/js/components/barchart/barchart.component.min.js +4 -6
  21. package/assets/js/components/barchart/barchart.component.min.js.map +1 -1
  22. package/assets/js/components/card/card.component.js +28 -3
  23. package/assets/js/components/card/card.component.min.js +14 -7
  24. package/assets/js/components/card/card.component.min.js.map +1 -1
  25. package/assets/js/components/carousel/carousel.component.min.js +1 -1
  26. package/assets/js/components/collapsible-side/collapsible-side.component.min.js +1 -1
  27. package/assets/js/components/fileupload/fileupload.component.min.js +1 -1
  28. package/assets/js/components/filterlist/filterlist.component.min.js +1 -1
  29. package/assets/js/components/header/header.component.min.js +1 -1
  30. package/assets/js/components/inline-edit/inline-edit.component.min.js +1 -1
  31. package/assets/js/components/marketing/marketing.component.min.js +1 -1
  32. package/assets/js/components/multiselect/multiselect.component.min.js +1 -1
  33. package/assets/js/components/nav/nav.component.min.js +1 -1
  34. package/assets/js/components/notification/notification.component.min.js +1 -1
  35. package/assets/js/components/pagination/pagination.component.min.js +1 -1
  36. package/assets/js/components/search/search.component.min.js +1 -1
  37. package/assets/js/components/slider/slider.component.min.js +1 -1
  38. package/assets/js/components/table/table.component.min.js +1 -1
  39. package/assets/js/components/tabs/tabs.component.min.js +1 -1
  40. package/assets/js/dynamic.min.js +1 -1
  41. package/assets/js/modules/chart.module.js +46 -31
  42. package/assets/js/scripts.bundle.js +22 -15
  43. package/assets/js/scripts.bundle.js.map +1 -1
  44. package/assets/js/scripts.bundle.min.js +2 -2
  45. package/assets/js/scripts.bundle.min.js.map +1 -1
  46. package/assets/sass/components/barchart.component.scss +55 -7
  47. package/assets/sass/components/card.global.scss +7 -1
  48. package/assets/sass/components/card.scss +114 -45
  49. package/assets/sass/components/charts.config.scss +15 -10
  50. package/assets/sass/components/charts.module.scss +21 -20
  51. package/assets/sass/elements/admin-panel.scss +1 -1
  52. package/assets/sass/elements/badge-tag.scss +6 -0
  53. package/assets/sass/elements/dialog.scss +6 -2
  54. package/assets/ts/components/barchart/barchart.component.ts +10 -5
  55. package/assets/ts/components/card/card.component.ts +34 -3
  56. package/assets/ts/modules/chart.module.ts +67 -37
  57. package/dist/components.es.js +11 -11
  58. package/dist/components.umd.js +53 -46
  59. package/package.json +1 -1
  60. package/src/components/BarChart/BarChart.vue +1 -1
@@ -12,6 +12,7 @@
12
12
 
13
13
  .chart__outer > input[type="checkbox"]:nth-of-type(#{$i}):not(:checked) ~ .chart__wrapper table tbody tr td:not(:first-child):nth-child(#{$i+1}) {
14
14
  display: none;
15
+ opacity: 0;
15
16
  }
16
17
  }
17
18
  // #endregion
@@ -85,6 +86,13 @@
85
86
  display: block!important;
86
87
  height: var(--bar-height, #{rem(24)});
87
88
  line-height: var(--bar-height, #{rem(24)});
89
+ max-width: var(--xaxis-max-width, none);
90
+
91
+ > *:not([popover]) {
92
+ max-width: 100%;
93
+ text-overflow: ellipsis;
94
+ overflow: hidden;
95
+ }
88
96
  }
89
97
  }
90
98
 
@@ -96,11 +104,14 @@
96
104
  opacity: 0;
97
105
  pointer-events: none;
98
106
  white-space: nowrap;
107
+
108
+ width: var(--xaxis-max-width, none);
99
109
  }
100
110
 
101
111
  &:has(td .tooltip) .chart__wrapper[data-longest-label]:before {
102
112
 
103
113
  padding-right: 2em;
114
+ width: calc(var(--xaxis-max-width, none) - 1rem);
104
115
  }
105
116
 
106
117
  .chart__wrapper[data-longest-label] table tbody tr td:first-child {
@@ -114,7 +125,7 @@
114
125
  left: auto!important;
115
126
  right: 100%!important;
116
127
  padding-right: 0.5em;
117
-
128
+ width: fit-content;
118
129
  }
119
130
 
120
131
 
@@ -126,7 +137,7 @@
126
137
  // #endregion
127
138
 
128
139
  // #region stacked
129
- .chart--stacked .chart__wrapper {
140
+ :host(.chart--stacked) .chart__wrapper {
130
141
  table tbody tr {
131
142
  --bar-gap: 0;
132
143
  flex-direction: column-reverse;
@@ -138,6 +149,29 @@
138
149
  }
139
150
  }
140
151
  }
152
+ :host(.chart--stacked.chart--horizontal) .chart__wrapper table tbody tr {
153
+
154
+ flex-direction: row;
155
+
156
+ &::after {
157
+ content: attr(data-numeric);
158
+ position: absolute;
159
+ opacity: 1 !important;
160
+ bottom: 100%;
161
+ left: 50%;
162
+ transform: translate(-50%, 0);
163
+ display: block !important;
164
+ height: fit-content;
165
+ margin: 0;
166
+ bottom: 50%;
167
+ left: calc(var(--percent) + .5rem);
168
+ transform: translate(0, 50%);
169
+ }
170
+
171
+ td:after {
172
+ content: none;
173
+ }
174
+ }
141
175
  // #endregion
142
176
 
143
177
  // #region animation
@@ -236,9 +270,13 @@
236
270
 
237
271
  :host(.chart--fit-content:not(.chart--horizontal)) {
238
272
 
239
- width: fit-content;
273
+ width: 100%;
240
274
  display: block;
241
275
 
276
+ .chart__wrapper {
277
+ width: fit-content;
278
+ }
279
+
242
280
  table {
243
281
  width: fit-content!important;
244
282
  padding-top: 0;
@@ -263,13 +301,23 @@
263
301
  }
264
302
  }
265
303
 
266
- .chart__outer {
304
+ :host(.chart--fit-content:not(.chart--horizontal).chart--no-scale) {
305
+ --fc-group-width: #{rem(22)};
306
+ --fc-value-width: #{rem(24)};
307
+
308
+ table{
309
+ height: var(--chart-height-lg-set,#{rem(120)});
310
+ }
311
+
312
+ }
313
+
314
+ .chart__wrapper {
267
315
 
268
- @container (min-width: 36em) {
316
+
317
+ @container (min-width: #{em($device-xs-width,16)}) {
269
318
  --fc-group-width: #{rem(22)};
270
319
  --fc-value-width: #{rem(24)};
271
-
272
-
320
+
273
321
  }
274
322
  }
275
323
 
@@ -4,6 +4,8 @@
4
4
 
5
5
  iam-card {
6
6
 
7
+ margin-bottom: 1.5rem;
8
+ display: block;
7
9
 
8
10
  @supports not selector(:has(*)) {
9
11
 
@@ -67,6 +69,10 @@ iam-card {
67
69
  }
68
70
  }
69
71
 
72
+ :is(a, button, label) iam-card{
73
+ margin-bottom: 0!important;
74
+ }
75
+
70
76
 
71
77
  [data-select-container]:has([type="checkbox"]:checked) iam-card {
72
78
 
@@ -93,4 +99,4 @@ iam-card {
93
99
  a[target="_blank"] iam-card::part(card) {
94
100
 
95
101
  --icon: var(--icon-new-tab);
96
- }
102
+ }
@@ -55,59 +55,61 @@
55
55
  }
56
56
  }
57
57
 
58
- &:before,
59
- &:after {
60
- content: "";
61
- position: absolute;
62
- right: var(--card-icon-right);
63
- bottom: var(--card-bottom-padding);
64
- height: rem(24);
65
- width: rem(24);
66
- background: var(--colour-warning);
67
- border-radius: 50%;
68
- }
58
+ &:not(:has(.dialog__wrapper)){
69
59
 
70
- &:after {
71
- background: var(--colour-primary-theme);
72
- mask-image: var(--icon,var(--icon-arrow));
73
- mask-size: 50%;
74
- mask-repeat: no-repeat;
75
- mask-position: 50% 50%;
76
- -webkit-mask-image: var(--icon,var(--icon-arrow));
77
- -webkit-mask-size: 50%;
78
- -webkit-mask-repeat: no-repeat;
79
- -webkit-mask-position: 50% 50%;
80
- z-index: 2;
81
- }
60
+ &:before,
61
+ &:after {
62
+ content: "";
63
+ position: absolute;
64
+ right: var(--card-icon-right);
65
+ bottom: var(--card-bottom-padding);
66
+ height: rem(24);
67
+ width: rem(24);
68
+ background: var(--colour-warning);
69
+ border-radius: 50%;
70
+ }
82
71
 
83
- &:is(:hover,:focus,.hover) {
84
- --hover-outline-colour-default: var(--colour, var(--colour-primary));
85
- outline: 2px solid var(--hover-outline-colour, var(--hover-outline-colour-default));
86
- outline-offset: -2px;
87
- }
88
-
89
- // Update arrow cololur
90
- &:not([class*="colour-"]):is(:hover,:focus,.hover,:active, .active) {
72
+ &:after {
73
+ background: var(--colour-primary-theme);
74
+ mask-image: var(--icon,var(--icon-arrow));
75
+ mask-size: 50%;
76
+ mask-repeat: no-repeat;
77
+ mask-position: 50% 50%;
78
+ -webkit-mask-image: var(--icon,var(--icon-arrow));
79
+ -webkit-mask-size: 50%;
80
+ -webkit-mask-repeat: no-repeat;
81
+ -webkit-mask-position: 50% 50%;
82
+ z-index: 2;
83
+ }
91
84
 
92
- &:before {
93
- background: var(--hover-icon-bg, var(--colour-primary-theme));
85
+ &:is(:hover,:focus,.hover) {
86
+ --hover-outline-colour-default: var(--colour, var(--colour-primary));
87
+ outline: 2px solid var(--hover-outline-colour, var(--hover-outline-colour-default));
88
+ outline-offset: -2px;
94
89
  }
95
- &:after {
96
- background: var(--hover-icon-colour, #ffffff);
90
+
91
+ // Update arrow cololur
92
+ &:not([class*="colour-"]):is(:hover,:focus,.hover,:active, .active) {
93
+
94
+ &:before {
95
+ background: var(--hover-icon-bg, var(--colour-primary-theme));
96
+ }
97
+ &:after {
98
+ background: var(--hover-icon-colour, #ffffff);
99
+ }
97
100
  }
98
- }
99
101
 
100
- &:is(:active, .active){
101
- --card-icon-right: var(--card-icon-right-overide,0.5rem);
102
- outline: none;
103
- }
102
+ &:is(:active, .active){
103
+ --card-icon-right: var(--card-icon-right-overide,0.5rem);
104
+ outline: none;
105
+ }
104
106
 
105
- &:is(:active){
106
- background: #FCFCFC;
107
+ &:is(:active){
108
+ background: #FCFCFC;
109
+ }
110
+
107
111
  }
108
112
 
109
-
110
-
111
113
  span{
112
114
  display: block;
113
115
  font-weight: bold;
@@ -534,4 +536,71 @@ slot[name="btns"] {
534
536
  margin: 0!important;
535
537
  }
536
538
 
537
- //#endregion
539
+ //#endregion
540
+
541
+ .dialog__wrapper {
542
+ position: absolute;
543
+ right: 1rem;
544
+ bottom: 2rem;
545
+ min-width: 3rem !important;
546
+ left: auto;
547
+ z-index: 999;
548
+
549
+ > dialog {
550
+
551
+ display: var(--menu-display, none);
552
+ position: fixed;
553
+ top: anchor(top);
554
+ position-anchor: --anchor-el;
555
+ left: anchor(right);
556
+ right: auto;
557
+ margin: 0 0 0 #{rem(4)};
558
+ padding: rem(16);
559
+
560
+
561
+ &::backdrop {
562
+ display: none;
563
+ }
564
+ }
565
+
566
+ > dialog:popover-open {
567
+
568
+ display: block!important;
569
+ }
570
+
571
+ &:has(dialog:popover-open) > button {
572
+ background-color: var(--colour);
573
+ }
574
+
575
+ > button {
576
+ margin: 0;
577
+ anchor-name: --anchor-el;
578
+
579
+ &:not(:hover,:focus,:focus-within,:active){
580
+
581
+ background: var(--ellipsis-bg);
582
+ }
583
+ }
584
+ }
585
+ ::slotted([slot="actions"]){
586
+ border: none !important;
587
+ margin: 0 !important;
588
+ display: block!important;
589
+ width: fit-content;
590
+ }
591
+ ::slotted([slot="primary-action"]){
592
+ overflow: hidden;
593
+ background-color: transparent;
594
+ text-indent: -300%;
595
+ position: absolute!important;
596
+ inset: 0;
597
+ margin: 0!important;
598
+ z-index: 99;
599
+ border: none;
600
+ }
601
+ ::slotted([slot="primary-action"]:is(:hover,:focus,.hover)) {
602
+ --hover-outline-colour-default: var(--colour, var(--colour-primary));
603
+ outline: 2px solid var(--hover-outline-colour, var(--hover-outline-colour-default));
604
+ outline-offset: -2px;
605
+ border-radius: var(--card-border-radius)!important;
606
+ }
@@ -27,9 +27,9 @@ iam-barchart:not(.chart--horizontal)::part(chart-key) {
27
27
  order: 3;
28
28
  }
29
29
 
30
- iam-barchart:not(.chart--horizontal)::part(key),
31
- iam-barchart:not(.chart--horizontal)::part(key-checked),
32
- iam-barchart:not(.chart--horizontal)::part(key-unchecked) {
30
+ iam-barchart::part(key),
31
+ iam-barchart::part(key-checked),
32
+ iam-barchart::part(key-unchecked) {
33
33
 
34
34
  --key-border-radius: 50%;
35
35
  --btn-border-width: 1px;
@@ -46,21 +46,22 @@ iam-barchart:not(.chart--horizontal)::part(key-unchecked) {
46
46
  color: var(--colour-heading);
47
47
  }
48
48
 
49
- iam-barchart:not(.chart--horizontal)::part(key):is(:hover, :focus, .hover, :focus-within):not([disabled],:active, .active),
50
- iam-barchart:not(.chart--horizontal)::part(key-checked):is(:hover, :focus, .hover, :focus-within):not([disabled],:active, .active),
51
- iam-barchart:not(.chart--horizontal)::part(key-unchecked):is(:hover, :focus, .hover, :focus-within):not([disabled],:active, .active) {
49
+ iam-barchart::part(key):is(:hover, :focus, .hover, :focus-within):not([disabled],:active, .active),
50
+ iam-barchart::part(key-checked):is(:hover, :focus, .hover, :focus-within):not([disabled],:active, .active),
51
+ iam-barchart::part(key-unchecked):is(:hover, :focus, .hover, :focus-within):not([disabled],:active, .active) {
52
52
  background: var(--colour-btn-action-hover-bg);
53
53
  }
54
- iam-barchart:not(.chart--horizontal)::part(key):is(:hover, :focus, .hover, :focus-within),
55
- iam-barchart:not(.chart--horizontal)::part(key-checked):is(:hover, :focus, .hover, :focus-within),
56
- iam-barchart:not(.chart--horizontal)::part(key-unchecked):is(:hover, :focus, .hover, :focus-within){
54
+ iam-barchart::part(key):is(:hover, :focus, .hover, :focus-within),
55
+ iam-barchart::part(key-checked):is(:hover, :focus, .hover, :focus-within),
56
+ iam-barchart::part(key-unchecked):is(:hover, :focus, .hover, :focus-within){
57
57
  background: var(--colour-btn-action-hover-bg);
58
58
  }
59
59
 
60
- iam-barchart:not(.chart--horizontal)::part(key-unchecked) {
60
+ iam-barchart::part(key-unchecked) {
61
61
 
62
62
  opacity: 0.25;
63
63
  }
64
+
64
65
  iam-barchart::part(tooltip) {
65
66
  text-decoration: none!important;
66
67
  }
@@ -76,4 +77,8 @@ iam-barchart::part(tooltip):after{
76
77
  color: var(--colour-primary);
77
78
  border: none;
78
79
 
80
+ }
81
+
82
+ iam-barchart{
83
+ //--xaxis-max-width: 3rem;
79
84
  }
@@ -91,18 +91,19 @@ $chart-height-lg: #{rem(200)}!default;
91
91
  ::slotted(table) {
92
92
  display: none!important;
93
93
  }
94
-
94
+ :host {
95
+ container-type: inline-size;
96
+ margin-bottom: 2rem;
97
+ display: block;
98
+ }
95
99
  .chart__outer {
96
100
 
97
- container-type: inline-size;
98
101
  display: flex;
99
102
  flex-direction: column;
100
103
 
101
104
  font-weight: var(--chart-font-weight, bold);;
102
105
  color: var(--chart-text-color, black);
103
106
 
104
- margin-bottom: 2rem;
105
-
106
107
 
107
108
  > * {
108
109
  display: block;
@@ -142,7 +143,7 @@ $chart-height-lg: #{rem(200)}!default;
142
143
  --yaxis-last-point-transform: translate(0,-50%);
143
144
  --bar-gap: min(10%, 0.75rem);
144
145
 
145
- @container (max-width: 36em) {
146
+ @container (min-width: #{em($device-xs-width,16)}) {
146
147
 
147
148
  :has(tr:nth-child(5) td:nth-child(4)),
148
149
  :has(tr:nth-child(10)){
@@ -152,17 +153,7 @@ $chart-height-lg: #{rem(200)}!default;
152
153
  --yaxis-last-point-transform: translate(0,-100%);
153
154
  --bar-gap: 0;
154
155
  }
155
- }
156
-
157
- @container (max-width: 63em) {
158
- :has(tr:nth-child(10)){
159
-
160
- --bar-gap: 0;
161
- }
162
- }
163
156
 
164
- @container (min-width: 36em) {
165
-
166
157
  .chart__wrapper {
167
158
  --chart-height-resp: var(--chart-height-lg-set);
168
159
  --pie-size: calc(33.333% - 1.4rem);
@@ -172,8 +163,12 @@ $chart-height-lg: #{rem(200)}!default;
172
163
  --yaxis-last-point-transform: translate(0,-50%);
173
164
  }
174
165
  }
175
-
176
- @container (min-width: 62em) {
166
+
167
+ @container (min-width: #{em($device-sm-width,16)}) {
168
+ :has(tr:nth-child(10)){
169
+
170
+ --bar-gap: 0;
171
+ }
177
172
 
178
173
  .chart__wrapper {
179
174
 
@@ -448,7 +443,7 @@ $chart-height-lg: #{rem(200)}!default;
448
443
  font-size: var(--label-size);
449
444
  text-align: center;
450
445
 
451
- @container (min-width: 62em) {
446
+ @container (min-width: #{em($device-sm-width,16)}) {
452
447
 
453
448
  display: block;
454
449
  }
@@ -479,6 +474,12 @@ $chart-height-lg: #{rem(200)}!default;
479
474
  position: relative;
480
475
  padding: 0;
481
476
  background: var(--chart-colour);
477
+
478
+ @media screen and (prefers-color-scheme: dark) {
479
+
480
+ background: color-mix(in oklab, var(--chart-colour), black 20%);
481
+ }
482
+
482
483
  border-top-right-radius: 4px;
483
484
  border-top-left-radius: 4px;
484
485
 
@@ -538,7 +539,7 @@ $chart-height-lg: #{rem(200)}!default;
538
539
  }
539
540
 
540
541
  // change the look of chart when crowded
541
- @container (max-width: 36em) {
542
+ @container (min-width: #{em($device-sm-width,16)}) {
542
543
  tbody:has(tr:nth-child(5) td:nth-child(4)) tr,
543
544
  tbody:has(tr:nth-child(10)) tr {
544
545
 
@@ -577,7 +578,7 @@ $chart-height-lg: #{rem(200)}!default;
577
578
  }
578
579
  }
579
580
  // Hide labels when it gets crowded
580
- @container (min-width: 36em) {
581
+ @container (min-width: #{em($device-xs-width,16)}) {
581
582
 
582
583
  tbody:has(tr:nth-child(25)){
583
584
  tr td:first-child {
@@ -1,7 +1,7 @@
1
1
  @use "../_func" as *;
2
2
 
3
3
  .admin-panel {
4
- --padding-x: #{rem(32)};
4
+ --padding-x: #{rem(24)};
5
5
  --padding-top: #{rem(16)};
6
6
  --padding-bottom: #{rem(24)};
7
7
  --mh-modifier: #{rem(56 + 16)};
@@ -30,6 +30,12 @@
30
30
 
31
31
  border-radius: rem(6);
32
32
  padding: 0 rem(8);
33
+
34
+ &--rounded {
35
+ border-radius: 1rem;
36
+ min-width: 1.625rem;
37
+ padding: 0;
38
+ }
33
39
  }
34
40
 
35
41
  .tag {
@@ -7,8 +7,7 @@ body:not(.js-enabled) dialog:not([open]):target {
7
7
  }
8
8
 
9
9
  // #region Default styling of both modals and popovers
10
- dialog[open] {
11
-
10
+ dialog {
12
11
  --dialog-padding: #{rem(24)};
13
12
 
14
13
  --mh-padding-inline: var(--dialog-padding);
@@ -22,7 +21,12 @@ dialog[open] {
22
21
  border-radius: rem(10);
23
22
  padding: var(--dialog-padding);
24
23
  outline: var(--contrast-outline-width, 0px) solid var(--colour-primary);
24
+ }
25
+
25
26
 
27
+ dialog[open] {
28
+
29
+
26
30
  display: flex;
27
31
  flex-direction: column;
28
32
 
@@ -19,7 +19,6 @@ class iamBarChart extends HTMLElement {
19
19
  <style>
20
20
  ${loadCSS}
21
21
  </style>
22
- <slot name="before"></slot>
23
22
  <div class="chart__outer" part="outer">
24
23
  <div class="chart__key" part="chart-key"></div>
25
24
  <div class="chart__wrapper" part="wrapper">
@@ -29,8 +28,7 @@ class iamBarChart extends HTMLElement {
29
28
  </div>
30
29
  </div>
31
30
  <div class="chart__spacer"><span part="spacer"></span</div>
32
- </div>
33
- <slot name="after"></slot>`;
31
+ </div>`;
34
32
 
35
33
  this.shadowRoot.appendChild(template.content.cloneNode(true));
36
34
  }
@@ -51,7 +49,7 @@ class iamBarChart extends HTMLElement {
51
49
 
52
50
  chart.appendChild(clonedTable);
53
51
 
54
- addClasses(chartComponent);
52
+ addClasses(chartComponent, chartOuter);
55
53
 
56
54
 
57
55
  const barCount = chart.querySelectorAll('td:not(:first-child)').length;
@@ -59,11 +57,18 @@ class iamBarChart extends HTMLElement {
59
57
  if(barCount < 10){
60
58
 
61
59
  chartComponent.classList.add('chart--fit-content');
60
+ //chartComponent.classList.add('chart--display-data');
61
+ }
62
+
63
+ if(barCount < 5){
64
+
65
+ chartComponent.classList.add('chart--no-scale');
66
+ //chartComponent.classList.add('chart--display-data');
62
67
  }
63
68
 
64
69
  setupChart(chartComponent,chartOuter,clonedTable);
65
70
  setEventObservers(chartComponent,chartOuter);
66
- setEventListener(chartOuter);
71
+ setEventListener(chartComponent,chartOuter);
67
72
  setLongestLabel(chartOuter);
68
73
  setLongestValue(chartOuter);
69
74
 
@@ -14,7 +14,7 @@ class iamCard extends HTMLElement {
14
14
  super();
15
15
  this.attachShadow({ mode: 'open'});
16
16
 
17
- if(this.querySelector('*:not(.badge):not(small):not(.btn) > [class*="fa-"]:not(.btn)'))
17
+ if(this.querySelector('*:not(.badge):not(small):not(.btn):not(button) > [class*="fa-"]:not(.btn)'))
18
18
  this.classList.add('card--has-icon');
19
19
 
20
20
  let classList = this.classList.toString();
@@ -45,6 +45,7 @@ class iamCard extends HTMLElement {
45
45
 
46
46
  const createCardConent () {
47
47
 
48
+ // TODO split this out a bit
48
49
  return `${this.hasAttribute('data-image') || this.hasAttribute('data-record') ? `<div class="card__head">${this.hasAttribute('data-image') ? `<img src="${this.getAttribute('data-image')}" alt="" loading="lazy" />` : ``} <div class="card__badges"><slot name="badges"></slot></div></div>` : ''}
49
50
  <div class="card__body" part="body">
50
51
  ${!this.hasAttribute('data-image') && this.querySelector('[slot="badges"]') && this.querySelector('[slot="checkbox"]') ? `<div class="card__badges card__badges--inline"><slot name="badges"></slot></div>` : ''}
@@ -55,6 +56,13 @@ class iamCard extends HTMLElement {
55
56
  </div>
56
57
  ${this.hasAttribute('data-add-link') ? `<button class="btn btn-compact btn-secondary fa-plus">Add property</button>` : ''}
57
58
  <slot name="checkbox"></slot>
59
+ <slot name="primary-action"></slot>
60
+ <div class="dialog__wrapper d-none">
61
+ <button class="btn btn-secondary btn-compact fa-ellipsis-vertical" popovertarget="actions" title="${this.hasAttribute('data-menu-title') ? this.getAttribute('data-menu-title') : 'Further actions'}">Lorum ipsum</button>
62
+ <dialog class="dialog--fix dialog--list" id="actions" popover>
63
+ <slot name="actions"></slot>
64
+ </dialog>
65
+ </div>
58
66
  <div class="card__footer" part="footer">
59
67
  <slot name="footer"></slot>
60
68
  <slot name="btns"></slot>
@@ -66,11 +74,34 @@ class iamCard extends HTMLElement {
66
74
  this.classList.add('loaded');
67
75
 
68
76
  // Mimic clicking the parent node so the focus and target events can be on the card
69
- const parentNode = this.parentNode.closest('a, button, label, router-link')
77
+ const component = this;
78
+ const parentNode = component.parentNode.closest('a, button, label, router-link');
70
79
  const card = this.shadowRoot.querySelector('.card')
71
80
  const btnCompact = this.shadowRoot.querySelector('.btn-compact');
72
81
  const recordType = this.hasAttribute('data-record') ? this.getAttribute('data-record') : '';
73
82
 
83
+
84
+ // Add the actions slot to the buttons and links to move them into a dialog warpper
85
+ const actionsWrapper = this.shadowRoot.querySelector('.dialog__wrapper');
86
+ let buttons = component.querySelectorAll('button[slot="actions"],a[slot="actions"]');
87
+ if(buttons.length){
88
+
89
+ const actionsWrapper = this.shadowRoot.querySelector('.dialog__wrapper');
90
+ const actionsDialog = this.shadowRoot.querySelector('.dialog__wrapper dialog');
91
+ const actionsBtn = actionsWrapper.querySelector('button');
92
+
93
+ actionsWrapper.classList.remove('d-none');
94
+
95
+ Array.from(buttons).forEach((button,index)=>{
96
+
97
+ button.classList.add('btn');
98
+ button.classList.add('btn-action');
99
+ });
100
+ }
101
+ else {
102
+ actionsWrapper.remove();
103
+ }
104
+
74
105
  /*
75
106
  If the parentNode is actually just a div,
76
107
  we don't want to look for anything or add events
@@ -209,7 +240,7 @@ class iamCard extends HTMLElement {
209
240
  if(oldVal != newVal){
210
241
  let classList = this.classList.toString();
211
242
 
212
- if(this.querySelector('*:not(.badge):not(small):not(.btn) > [class*="fa-"]:not(.btn)'))
243
+ if(this.querySelector('*:not(.badge):not(small):not(.btn):not(button) > [class*="fa-"]:not(.btn)'))
213
244
  classList += ' card--has-icon';
214
245
 
215
246
  this.shadowRoot.querySelector('.card').setAttribute('class',`card ${classList}`);