@iamproperty/components 5.7.1-beta3 → 5.7.1-beta4

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 (48) hide show
  1. package/assets/css/components/barchart.component.css +1 -0
  2. package/assets/css/components/barchart.component.css.map +1 -0
  3. package/assets/css/components/charts.config.css +1 -0
  4. package/assets/css/components/charts.config.css.map +1 -0
  5. package/assets/css/components/charts.module.css +1 -0
  6. package/assets/css/components/charts.module.css.map +1 -0
  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/components/accordion/accordion.component.min.js +1 -1
  12. package/assets/js/components/actionbar/actionbar.component.min.js +1 -1
  13. package/assets/js/components/address-lookup/address-lookup.component.min.js +1 -1
  14. package/assets/js/components/applied-filters/applied-filters.component.min.js +1 -1
  15. package/assets/js/components/barchart/barchart.component.js +53 -0
  16. package/assets/js/components/barchart/barchart.component.min.js +21 -0
  17. package/assets/js/components/barchart/barchart.component.min.js.map +1 -0
  18. package/assets/js/components/card/card.component.min.js +1 -1
  19. package/assets/js/components/carousel/carousel.component.min.js +1 -1
  20. package/assets/js/components/collapsible-side/collapsible-side.component.min.js +1 -1
  21. package/assets/js/components/fileupload/fileupload.component.min.js +1 -1
  22. package/assets/js/components/filterlist/filterlist.component.min.js +1 -1
  23. package/assets/js/components/header/header.component.min.js +1 -1
  24. package/assets/js/components/inline-edit/inline-edit.component.min.js +1 -1
  25. package/assets/js/components/marketing/marketing.component.min.js +1 -1
  26. package/assets/js/components/multiselect/multiselect.component.min.js +1 -1
  27. package/assets/js/components/nav/nav.component.min.js +1 -1
  28. package/assets/js/components/notification/notification.component.min.js +1 -1
  29. package/assets/js/components/pagination/pagination.component.min.js +1 -1
  30. package/assets/js/components/search/search.component.min.js +1 -1
  31. package/assets/js/components/slider/slider.component.min.js +1 -1
  32. package/assets/js/components/table/table.component.min.js +1 -1
  33. package/assets/js/components/tabs/tabs.component.min.js +1 -1
  34. package/assets/js/dynamic.min.js +1 -1
  35. package/assets/js/modules/chart.module.js +350 -0
  36. package/assets/js/scripts.bundle.js +1 -1
  37. package/assets/js/scripts.bundle.min.js +1 -1
  38. package/assets/sass/_corefiles.scss +2 -0
  39. package/assets/sass/components/barchart.component.scss +341 -0
  40. package/assets/sass/components/charts.config.scss +79 -0
  41. package/assets/sass/components/charts.module.scss +652 -0
  42. package/assets/ts/components/barchart/README.md +37 -0
  43. package/assets/ts/components/barchart/barchart.component.ts +79 -0
  44. package/assets/ts/modules/chart.module.ts +506 -0
  45. package/dist/components.es.js +11 -11
  46. package/dist/components.umd.js +11 -11
  47. package/package.json +1 -1
  48. package/src/components/BarChart/BarChart.vue +25 -0
@@ -0,0 +1,341 @@
1
+ @use "../_func.scss" as *;
2
+ @use "charts.module.scss" as *;
3
+
4
+
5
+
6
+ // #region Hide data sets
7
+ .chart__outer > input[type="checkbox"]:not(:checked) ~ .chart__wrapper table tbody tr td:not(:first-child) {
8
+ //display: none;
9
+ }
10
+
11
+ @for $i from 1 to 10 {
12
+
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
+ display: none;
15
+ }
16
+ }
17
+ // #endregion
18
+
19
+ // #region Bar chart (Horizontal)
20
+ :host(.chart--horizontal) .chart__outer {
21
+
22
+ tbody {
23
+ --chart-direction: 90deg;
24
+ --chart-day-bg-pos: calc(var(--single-day) * 7) 100%;
25
+ --bar-gap: 0;
26
+ }
27
+
28
+ .chart__guidelines {
29
+ position: absolute;
30
+
31
+ .guideline {
32
+ bottom: auto;
33
+ left: var(--percent);
34
+ height: 100%;
35
+ border-left: 1px dashed #eee;
36
+ width: 0;
37
+
38
+ span{
39
+ display: block;
40
+ font-size: var(--label-size);
41
+ position: absolute;
42
+ top: 100%;
43
+ transform: translate(-50%,0.2em);
44
+ opacity: 1;
45
+ }
46
+ }
47
+ }
48
+
49
+ .chart__yaxis {
50
+
51
+ display: none;
52
+ }
53
+
54
+ table {
55
+
56
+ padding-top: 0;
57
+ }
58
+
59
+ table tbody {
60
+
61
+ flex-direction: column;
62
+ position: relative;
63
+ }
64
+
65
+ table tbody tr {
66
+ flex-direction: column;
67
+ align-items: flex-start;
68
+ margin-bottom: 0.5rem;
69
+ padding: 0;
70
+
71
+ td { // part=value
72
+
73
+ height: var(--bar-height, #{rem(24)});
74
+ bottom: 0;
75
+ left: var(--bottom, 0%);
76
+ width: var(--comparison,var(--percent));
77
+ max-width: 100%;
78
+ border-top-left-radius: 0;
79
+ border-bottom-right-radius: 4px;
80
+ }
81
+
82
+ td:first-child { // part=xaxis-label
83
+ position: static;
84
+ transform: none;
85
+ display: block!important;
86
+ height: var(--bar-height, #{rem(24)});
87
+ line-height: var(--bar-height, #{rem(24)});
88
+ }
89
+ }
90
+
91
+ .chart__wrapper[data-longest-label]:before {
92
+ display: block;
93
+ content: attr(data-longest-label);
94
+ font-size: var(--label-size);
95
+ padding-right: 0.5em;
96
+ opacity: 0;
97
+ pointer-events: none;
98
+ white-space: nowrap;
99
+ }
100
+
101
+ &:has(td .tooltip) .chart__wrapper[data-longest-label]:before {
102
+
103
+ padding-right: 2em;
104
+ }
105
+
106
+ .chart__wrapper[data-longest-label] table tbody tr td:first-child {
107
+
108
+ position: absolute;
109
+ //transform: translate(-100%, -50%)!important;
110
+ display: block !important;
111
+ max-height: 1.5rem;
112
+ z-index: var(--index-above);
113
+ top: 0%;
114
+ left: auto!important;
115
+ right: 100%!important;
116
+ padding-right: 0.5em;
117
+
118
+ }
119
+
120
+
121
+ .chart__spacer span {
122
+ display: none!important;
123
+ }
124
+
125
+ }
126
+ // #endregion
127
+
128
+ // #region stacked
129
+ .chart--stacked .chart__wrapper {
130
+ table tbody tr {
131
+ --bar-gap: 0;
132
+ flex-direction: column-reverse;
133
+ justify-content: flex-start;
134
+ align-items: center;
135
+
136
+ td {
137
+ border-radius: 0!important;
138
+ }
139
+ }
140
+ }
141
+ // #endregion
142
+
143
+ // #region animation
144
+
145
+ #{'.chart--animate.animating.inview'} {
146
+
147
+ --animation-left: 2s;
148
+
149
+ table tbody tr td:not(:first-child){
150
+
151
+ transition: height 2s ease-out, width 2s ease-out, bottom 2s ease-out, left var(--animation-left) ease-out;
152
+ transition-delay: calc(var(--row-index) * 0.1s);
153
+ }
154
+ }
155
+
156
+ #{'.chart--animate:not(.inview)'} {
157
+
158
+ table tbody tr td:not(:first-child) {
159
+ --bottom: var(--min-bottom, 0%)!important;
160
+ --percent: 0%!important;
161
+ --axis: 0%!important;
162
+ --comparison: 0%!important;
163
+ }
164
+ }
165
+
166
+ .chart--animate.animating {
167
+
168
+ table tbody tr td:not(:first-child) {
169
+ overflow: hidden;
170
+ }
171
+ }
172
+
173
+ // #endregion
174
+
175
+
176
+ // #region Display data modifier class
177
+ :host(.chart--display-data) {
178
+ table tbody tr {
179
+
180
+ td:not(:first-child) {
181
+
182
+ &:after {
183
+
184
+ content: attr(data-value);
185
+
186
+
187
+ position: absolute;
188
+ opacity: 1!important;
189
+ //z-index: var(--index-above);
190
+ bottom: 100%;
191
+ left: 50%;
192
+
193
+ transform: translate(-50%,0);
194
+
195
+ display: block!important;
196
+ height: fit-content;
197
+
198
+ margin: 0;
199
+
200
+
201
+ }
202
+ }
203
+ }
204
+ }
205
+
206
+
207
+ :host(.chart--display-data.chart--horizontal) {
208
+ table tbody tr td:not(:first-child) {
209
+ &:after {
210
+
211
+ bottom: 50%;
212
+ left: calc(100% + 0.5rem);
213
+ transform: translate(0,50%);
214
+ }
215
+ }
216
+
217
+
218
+ .chart__wrapper[data-longest-value]:after {
219
+ display: block;
220
+ content: attr(data-longest-value);
221
+ font-size: var(--label-size);
222
+ padding-left: 0.5em;
223
+ opacity: 0;
224
+ pointer-events: none;
225
+ white-space: nowrap;
226
+ }
227
+ }
228
+
229
+ :host(.chart--display-data.chart--fit-content:not(.chart--horizontal)) {
230
+ .chart__outer {
231
+ padding-top: 1rem;
232
+ }
233
+ }
234
+ // #endregion
235
+
236
+
237
+ :host(.chart--fit-content:not(.chart--horizontal)) {
238
+
239
+ width: fit-content;
240
+ display: block;
241
+
242
+ table {
243
+ width: fit-content!important;
244
+ padding-top: 0;
245
+ height: var(--chart-height-resp,#{rem(120)});
246
+ }
247
+
248
+ tbody {
249
+ position: relative;
250
+ }
251
+
252
+ [part="group"]{
253
+ min-width: fit-content;
254
+ width: fit-content;
255
+ max-width: fit-content;
256
+ padding-right: var(--fc-group-width, #{rem(16)});
257
+ }
258
+
259
+ [part="value"]{
260
+ min-width: var(--fc-value-width, #{rem(12)});
261
+ width: var(--fc-value-width, #{rem(12)});
262
+ max-width: var(--fc-value-width, #{rem(12)});
263
+ }
264
+ }
265
+
266
+ .chart__outer {
267
+
268
+ @container (min-width: 36em) {
269
+ --fc-group-width: #{rem(22)};
270
+ --fc-value-width: #{rem(24)};
271
+
272
+
273
+ }
274
+ }
275
+
276
+
277
+ // #region tooltip
278
+ button.tooltip {
279
+
280
+
281
+ &:after{
282
+
283
+ content: "?";
284
+ margin-left: 0.25rem;
285
+ display: inline-block;
286
+ border: 1px solid currentColor;
287
+ }
288
+
289
+ }
290
+
291
+ .tooltip__content[popover] {
292
+
293
+ //display: block;
294
+ z-index: var(--index-floating);
295
+ background: var(--colour-primary);
296
+ color: var(--colour-white);
297
+ padding: rem(24);
298
+
299
+ border-radius: 0.5rem;
300
+ box-shadow: 0px 2px 9px rgba(0, 0, 0, 0.11);
301
+
302
+
303
+ white-space: normal;
304
+ //transform: none;
305
+ //inset: auto;
306
+
307
+ position: fixed;
308
+ //inset-area: bottom center;
309
+ //position-area: bottom center;
310
+ border: none;
311
+ margin: 0;
312
+ box-sizing: border-box;
313
+
314
+ //top: anchor(bottom);
315
+
316
+ //left: anchor(center);
317
+
318
+
319
+ inset-area: bottom center;
320
+
321
+
322
+ overflow: visible;
323
+
324
+ width: calc(anchor-size(width) + var(--container-padding-x) + var(--container-padding-x) + #{rem(24)})!important;
325
+
326
+ &::after {
327
+ content: "";
328
+ position: absolute;
329
+ bottom: 100%;
330
+ left: 50%;
331
+ margin-left: -0.25rem;
332
+ border-width: 0.5rem;
333
+ border-style: solid;
334
+ border-color: transparent transparent var(--colour-primary) transparent;
335
+ margin-bottom: -1px;
336
+ }
337
+ }
338
+
339
+
340
+
341
+ // #endregion
@@ -0,0 +1,79 @@
1
+ iam-barchart {
2
+
3
+ --chart-bar-alignment: left;
4
+ --chart-text-color: var(--colour-heading);
5
+ }
6
+
7
+ iam-barchart:not(.chart--horizontal)::part(xaxis-label) {
8
+
9
+ text-align: left;
10
+ transform-origin: 0rem 1rem;
11
+ transform: rotate(45deg);
12
+ max-width: 5rem;
13
+ font-size: 1rem;
14
+ color: var(--colour-heading);
15
+ }
16
+
17
+ iam-barchart:not(.chart--horizontal)::part(spacer) {
18
+
19
+ aspect-ratio: 1/1;
20
+ display: block;
21
+ width: fit-content;
22
+ }
23
+
24
+ iam-barchart:not(.chart--horizontal)::part(chart-key) {
25
+
26
+ padding-top: 2rem;
27
+ order: 3;
28
+ }
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) {
33
+
34
+ --key-border-radius: 50%;
35
+ --btn-border-width: 1px;
36
+ --btn-padding-block: #{rem(6)};
37
+ --btn-padding-inline: #{rem(6)};
38
+
39
+ background-color: var(--colour-canvas-2);
40
+ border: var(--btn-border-width) solid var(--colour-muted);
41
+ border-radius: rem(4)!important;
42
+ font-weight: 400!important;
43
+ font-size: 1rem;
44
+ line-height: rem(20);
45
+ padding: calc(var(--btn-padding-block) - var(--btn-border-width)) calc(var(--btn-padding-inline) - var(--btn-border-width));
46
+ color: var(--colour-heading);
47
+ }
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) {
52
+ background: var(--colour-btn-action-hover-bg);
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){
57
+ background: var(--colour-btn-action-hover-bg);
58
+ }
59
+
60
+ iam-barchart:not(.chart--horizontal)::part(key-unchecked) {
61
+
62
+ opacity: 0.25;
63
+ }
64
+ iam-barchart::part(tooltip) {
65
+ text-decoration: none!important;
66
+ }
67
+ iam-barchart::part(tooltip):after{
68
+
69
+ font-family: "Font Awesome 6 Pro";
70
+ font-weight: 900;
71
+ content: "\f059";
72
+ display: inline-block;
73
+ margin-left: 0.2em;
74
+ margin-right: 0.1em;
75
+ margin-bottom: 0.1em;
76
+ color: var(--colour-primary);
77
+ border: none;
78
+
79
+ }