@iamproperty/components 5.7.1-beta5 → 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.
- package/assets/css/components/barchart.component.css +1 -1
- package/assets/css/components/barchart.component.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/charts.config.css +1 -1
- package/assets/css/components/charts.config.css.map +1 -1
- package/assets/css/components/charts.module.css +1 -1
- package/assets/css/components/charts.module.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 +1 -1
- package/assets/js/components/address-lookup/address-lookup.component.min.js +1 -1
- package/assets/js/components/applied-filters/applied-filters.component.min.js +1 -1
- package/assets/js/components/barchart/barchart.component.js +8 -6
- package/assets/js/components/barchart/barchart.component.min.js +4 -6
- package/assets/js/components/barchart/barchart.component.min.js.map +1 -1
- package/assets/js/components/card/card.component.js +28 -3
- package/assets/js/components/card/card.component.min.js +14 -7
- package/assets/js/components/card/card.component.min.js.map +1 -1
- package/assets/js/components/carousel/carousel.component.min.js +1 -1
- package/assets/js/components/collapsible-side/collapsible-side.component.min.js +1 -1
- package/assets/js/components/fileupload/fileupload.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 +1 -1
- package/assets/js/components/inline-edit/inline-edit.component.min.js +1 -1
- package/assets/js/components/marketing/marketing.component.min.js +1 -1
- 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 +1 -1
- package/assets/js/components/search/search.component.min.js +1 -1
- package/assets/js/components/slider/slider.component.min.js +1 -1
- package/assets/js/components/table/table.component.min.js +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/chart.module.js +46 -31
- package/assets/js/scripts.bundle.js +22 -15
- 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/barchart.component.scss +47 -3
- package/assets/sass/components/card.global.scss +7 -1
- package/assets/sass/components/card.scss +114 -45
- package/assets/sass/components/charts.config.scss +15 -10
- package/assets/sass/components/charts.module.scss +6 -0
- package/assets/sass/elements/badge-tag.scss +6 -0
- package/assets/sass/elements/dialog.scss +6 -2
- package/assets/ts/components/barchart/barchart.component.ts +10 -6
- package/assets/ts/components/card/card.component.ts +34 -3
- package/assets/ts/modules/chart.module.ts +67 -37
- package/dist/components.es.js +11 -11
- package/dist/components.umd.js +53 -46
- package/package.json +1 -1
- 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
|
|
@@ -267,13 +301,23 @@
|
|
|
267
301
|
}
|
|
268
302
|
}
|
|
269
303
|
|
|
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
|
+
|
|
270
314
|
.chart__wrapper {
|
|
271
315
|
|
|
272
316
|
|
|
273
317
|
@container (min-width: #{em($device-xs-width,16)}) {
|
|
274
318
|
--fc-group-width: #{rem(22)};
|
|
275
319
|
--fc-value-width: #{rem(24)};
|
|
276
|
-
|
|
320
|
+
|
|
277
321
|
}
|
|
278
322
|
}
|
|
279
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
|
-
&:
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
&:
|
|
93
|
-
|
|
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
|
-
|
|
96
|
-
|
|
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
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
&:is(:active, .active){
|
|
103
|
+
--card-icon-right: var(--card-icon-right-overide,0.5rem);
|
|
104
|
+
outline: none;
|
|
105
|
+
}
|
|
104
106
|
|
|
105
|
-
|
|
106
|
-
|
|
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
|
|
31
|
-
iam-barchart
|
|
32
|
-
iam-barchart
|
|
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
|
|
50
|
-
iam-barchart
|
|
51
|
-
iam-barchart
|
|
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
|
|
55
|
-
iam-barchart
|
|
56
|
-
iam-barchart
|
|
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
|
|
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
|
}
|
|
@@ -474,6 +474,12 @@ $chart-height-lg: #{rem(200)}!default;
|
|
|
474
474
|
position: relative;
|
|
475
475
|
padding: 0;
|
|
476
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
|
+
|
|
477
483
|
border-top-right-radius: 4px;
|
|
478
484
|
border-top-left-radius: 4px;
|
|
479
485
|
|
|
@@ -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
|
|
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,12 +57,18 @@ class iamBarChart extends HTMLElement {
|
|
|
59
57
|
if(barCount < 10){
|
|
60
58
|
|
|
61
59
|
chartComponent.classList.add('chart--fit-content');
|
|
62
|
-
chartComponent.classList.add('chart--display-data');
|
|
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');
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
setupChart(chartComponent,chartOuter,clonedTable);
|
|
66
70
|
setEventObservers(chartComponent,chartOuter);
|
|
67
|
-
setEventListener(chartOuter);
|
|
71
|
+
setEventListener(chartComponent,chartOuter);
|
|
68
72
|
setLongestLabel(chartOuter);
|
|
69
73
|
setLongestValue(chartOuter);
|
|
70
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
|
|
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}`);
|