@iamproperty/components 7.6.4--beta1 → 7.6.4--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.
- package/assets/css/components/actionbar.component.css +1 -1
- package/assets/css/components/actionbar.component.css.map +1 -1
- package/assets/css/components/address-lookup.component.css +1 -1
- package/assets/css/components/address-lookup.component.css.map +1 -1
- package/assets/css/components/calendar.component.css +1 -1
- package/assets/css/components/calendar.component.css.map +1 -1
- package/assets/css/components/fileupload.css +1 -1
- package/assets/css/components/fileupload.css.map +1 -1
- package/assets/css/components/multiselect.css +1 -1
- package/assets/css/components/multiselect.css.map +1 -1
- package/assets/css/components/multiselect.preload.css +1 -1
- package/assets/css/components/multiselect.preload.css.map +1 -1
- package/assets/css/components/nav.component.css +1 -1
- package/assets/css/components/nav.component.css.map +1 -1
- package/assets/css/components/pagination.css +1 -1
- package/assets/css/components/pagination.css.map +1 -1
- package/assets/css/components/slider.css +1 -1
- package/assets/css/components/slider.css.map +1 -1
- package/assets/css/components/tag.component.css +1 -1
- package/assets/css/components/tag.component.css.map +1 -1
- package/assets/css/components/tag.preload.css +1 -1
- package/assets/css/components/tag.preload.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 +2 -2
- package/assets/js/components/actionbar/actionbar.component.min.js.map +1 -1
- package/assets/js/components/address-lookup/address-lookup.component.js +11 -5
- package/assets/js/components/address-lookup/address-lookup.component.min.js +4 -4
- package/assets/js/components/address-lookup/address-lookup.component.min.js.map +1 -1
- package/assets/js/components/advanced-select/advanced-select.component.min.js +1 -1
- package/assets/js/components/advanced-select/advanced-select.component.min.js.map +1 -1
- package/assets/js/components/applied-filters/applied-filters.component.min.js +1 -1
- package/assets/js/components/barchart/barchart.component.min.js +1 -1
- package/assets/js/components/barchart/barchart.component.min.js.map +1 -1
- package/assets/js/components/bento-grid/bento-grid.component.min.js +1 -1
- package/assets/js/components/calendar/calendar.component.min.js +2 -2
- package/assets/js/components/calendar/calendar.component.min.js.map +1 -1
- package/assets/js/components/card/card.component.min.js +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/content/content.component.min.js +1 -1
- package/assets/js/components/darkmode/darkmode.component.min.js +1 -1
- package/assets/js/components/doughnutchart/doughnutchart.component.min.js +1 -1
- package/assets/js/components/doughnutchart/doughnutchart.component.min.js.map +1 -1
- package/assets/js/components/fileupload/fileupload.component.min.js +2 -2
- package/assets/js/components/filter-card/filter-card.component.min.js +1 -1
- package/assets/js/components/filterlist/filterlist.component.min.js +1 -1
- package/assets/js/components/form/form.component.js +68 -0
- package/assets/js/components/form/form.component.min.js +9 -0
- package/assets/js/components/form/form.component.min.js.map +1 -0
- 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/input/input.component.js +7 -5
- package/assets/js/components/input/input.component.min.js +2 -2
- package/assets/js/components/input/input.component.min.js.map +1 -1
- package/assets/js/components/input-range/input-range.component.min.js +1 -1
- package/assets/js/components/marketing/marketing.component.min.js +1 -1
- package/assets/js/components/menu/menu.component.min.js +1 -1
- package/assets/js/components/milestone/milestone.component.min.js +1 -1
- package/assets/js/components/milestone-group/milestone-group.component.min.js +1 -1
- package/assets/js/components/modal/modal.component.js +1 -1
- package/assets/js/components/modal/modal.component.min.js +2 -2
- package/assets/js/components/modal/modal.component.min.js.map +1 -1
- package/assets/js/components/multi-step/multi-step.component.min.js +1 -1
- package/assets/js/components/multi-step-modal/multi-step-modal.component.min.js +1 -1
- package/assets/js/components/multiselect/multiselect.component.js +9 -76
- package/assets/js/components/multiselect/multiselect.component.min.js +4 -4
- package/assets/js/components/multiselect/multiselect.component.min.js.map +1 -1
- package/assets/js/components/nav/nav.component.min.js +2 -2
- package/assets/js/components/notification/notification.component.min.js +1 -1
- package/assets/js/components/pagination/pagination.component.min.js +3 -3
- package/assets/js/components/password/password.component.min.js +1 -1
- package/assets/js/components/popover/popover.component.min.js +1 -1
- package/assets/js/components/rank/rank.component.min.js +1 -1
- package/assets/js/components/rankings/rankings.component.min.js +1 -1
- package/assets/js/components/rating/rating.component.min.js +1 -1
- package/assets/js/components/record-card/record-card.component.min.js +1 -1
- package/assets/js/components/search/search.component.min.js +1 -1
- package/assets/js/components/search/search.component.min.js.map +1 -1
- package/assets/js/components/slider/slider.component.min.js +2 -2
- package/assets/js/components/split-button/split-button.component.min.js +1 -1
- package/assets/js/components/std-address-lookup/std-address-lookup.component.js +59 -2
- package/assets/js/components/std-address-lookup/std-address-lookup.component.min.js +10 -9
- package/assets/js/components/std-address-lookup/std-address-lookup.component.min.js.map +1 -1
- package/assets/js/components/table/table.component.min.js +1 -1
- package/assets/js/components/table/table.component.min.js.map +1 -1
- package/assets/js/components/table-ajax/table-ajax.component.min.js +1 -1
- package/assets/js/components/table-ajax/table-ajax.component.min.js.map +1 -1
- package/assets/js/components/table-basic/table-basic.component.min.js +1 -1
- package/assets/js/components/table-basic/table-basic.component.min.js.map +1 -1
- package/assets/js/components/table-no-submit/table-no-submit.component.min.js +1 -1
- package/assets/js/components/table-no-submit/table-no-submit.component.min.js.map +1 -1
- package/assets/js/components/table-submit/table-submit.component.min.js +1 -1
- package/assets/js/components/table-submit/table-submit.component.min.js.map +1 -1
- package/assets/js/components/tabs/tabs.component.min.js +1 -1
- package/assets/js/components/tabs/tabs.component.min.js.map +1 -1
- package/assets/js/components/tag/tag.component.js +6 -1
- package/assets/js/components/tag/tag.component.min.js +4 -4
- package/assets/js/components/tag/tag.component.min.js.map +1 -1
- package/assets/js/components/tooltip/tooltip.component.min.js +1 -1
- package/assets/js/components/video-card/video-card.component.min.js +1 -1
- package/assets/js/components/video-modal/video-modal.component.min.js +1 -1
- package/assets/js/components/word-count/word-count.component.min.js +1 -1
- package/assets/js/modules/dropdown.js +97 -4
- package/assets/js/modules/helpers.js +26 -22
- package/assets/js/scripts.bundle.js +2 -2
- 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.scss +0 -2
- package/assets/sass/_elements.scss +1 -0
- package/assets/sass/components/multiselect.preload.scss +0 -55
- package/assets/sass/components/multiselect.scss +172 -174
- package/assets/sass/components/tag.component.scss +38 -57
- package/assets/sass/components/tag.preload.scss +1 -26
- package/assets/sass/elements/dropdown.scss +87 -0
- package/assets/sass/elements/forms.scss +14 -14
- package/assets/sass/elements/icons.css +4 -4
- package/assets/sass/elements/input.scss +0 -14
- package/assets/sass/elements/textarea.scss +97 -0
- package/assets/sass/templates/form.scss +14 -5
- package/assets/ts/components/address-lookup/address-lookup.component.ts +12 -5
- package/assets/ts/components/form/form.component.ts +102 -0
- package/assets/ts/components/input/input.component.ts +8 -6
- package/assets/ts/components/modal/modal.component.ts +1 -1
- package/assets/ts/components/multiselect/multiselect.component.ts +10 -78
- package/assets/ts/components/std-address-lookup/std-address-lookup.component.ts +83 -2
- package/assets/ts/components/tag/tag.component.ts +8 -11
- package/assets/ts/modules/dropdown.ts +117 -5
- package/assets/ts/modules/helpers.ts +32 -27
- package/dist/components.es.js +28 -28
- package/dist/components.umd.js +225 -211
- package/package.json +2 -2
- package/src/components/Form/Form.vue +22 -0
|
@@ -1,78 +1,59 @@
|
|
|
1
1
|
@use '../_func' as *;
|
|
2
2
|
@use '../elements/forms';
|
|
3
|
-
|
|
4
3
|
@use '../elements/admin-panel.scss' as *;
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
@use '../elements/dropdown.scss' as *;
|
|
7
5
|
@use '../utilities/visually-hidden' as *;
|
|
8
6
|
@use '../utilities/display' as *;
|
|
7
|
+
|
|
9
8
|
*,
|
|
10
9
|
*::before,
|
|
11
10
|
*::after {
|
|
12
11
|
box-sizing: border-box;
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
.wrapper {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
14
|
+
@layer components {
|
|
15
|
+
.wrapper {
|
|
16
|
+
|
|
17
|
+
position: relative;
|
|
18
|
+
display: inline-block;
|
|
19
|
+
margin-bottom: 1rem;
|
|
20
|
+
|
|
21
|
+
input {
|
|
22
|
+
position: absolute;
|
|
23
|
+
min-height: unset;
|
|
24
|
+
top: 50%;
|
|
25
|
+
left: 0;
|
|
26
|
+
transform: translate(0,-50%);
|
|
27
|
+
z-index: -99;
|
|
28
|
+
opacity: 0;
|
|
29
|
+
}
|
|
30
30
|
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
::slotted(*) {
|
|
34
|
-
margin-bottom: 0!important;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
input:focus {
|
|
41
|
-
|
|
42
|
-
opacity: 1;
|
|
43
|
-
z-index: 99;
|
|
44
|
-
}
|
|
45
31
|
|
|
32
|
+
::slotted(*) {
|
|
33
|
+
margin-bottom: 0!important;
|
|
34
|
+
}
|
|
46
35
|
|
|
47
|
-
.dropdown {
|
|
48
|
-
position: absolute;
|
|
49
|
-
top: calc(100% + 0.5rem);
|
|
50
|
-
padding: 0;
|
|
51
|
-
left: 0;
|
|
52
|
-
width: 100%;
|
|
53
|
-
margin: 0;
|
|
54
|
-
z-index: 99;
|
|
55
|
-
display: none;
|
|
56
|
-
max-height: rem(244) !important;
|
|
57
|
-
overflow: auto;
|
|
58
36
|
|
|
59
|
-
|
|
60
|
-
|
|
37
|
+
input:focus {
|
|
38
|
+
|
|
39
|
+
opacity: 1;
|
|
40
|
+
z-index: 99;
|
|
61
41
|
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.wrapper:is(:focus-within) .dropdown {
|
|
65
|
-
display: var(--display-panel, none);
|
|
66
|
-
}
|
|
67
42
|
|
|
68
|
-
|
|
69
|
-
.wrapper .dropdown:hover {
|
|
43
|
+
.wrapper:is(:focus-within) .dropdown {
|
|
70
44
|
display: var(--display-panel, none);
|
|
71
45
|
}
|
|
72
|
-
}
|
|
73
46
|
|
|
74
|
-
@media (hover:
|
|
75
|
-
|
|
76
|
-
|
|
47
|
+
@media (hover: hover) {
|
|
48
|
+
.wrapper .dropdown:hover {
|
|
49
|
+
display: var(--display-panel, none);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@media (hover: none) {
|
|
54
|
+
:host(.hover) .wrapper .dropdown {
|
|
55
|
+
display: block;
|
|
56
|
+
}
|
|
77
57
|
}
|
|
78
|
-
|
|
58
|
+
|
|
59
|
+
}
|
|
@@ -2,32 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
@layer components {
|
|
5
|
-
|
|
6
|
-
//margin-bottom: 0.5rem;
|
|
7
|
-
order: var(--order, 1);
|
|
8
|
-
//margin-inline: rem(3);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
iam-tag .tag:not([slot='checked']) {
|
|
12
|
-
display: block;
|
|
13
|
-
width: 100%;
|
|
14
|
-
max-width: 100%;
|
|
15
|
-
margin: 0;
|
|
16
|
-
text-align: left;
|
|
17
|
-
border-radius: 0;
|
|
18
|
-
padding-inline: 1rem;
|
|
19
|
-
outline: none;
|
|
20
|
-
padding-block: 0.5rem;
|
|
21
|
-
|
|
22
|
-
&:not(:hover, :focus, :active, :focus-within) {
|
|
23
|
-
background: none !important;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&::after {
|
|
27
|
-
display: none;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
5
|
+
|
|
31
6
|
iam-tag:has(label:not([slot='checked']):not([slot='notmatched'])) {
|
|
32
7
|
--display-panel: block;
|
|
33
8
|
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
@use '../_func' as *;
|
|
2
|
+
|
|
3
|
+
@layer elements {
|
|
4
|
+
|
|
5
|
+
// #region Dropdown
|
|
6
|
+
.dropdown {
|
|
7
|
+
position: absolute;
|
|
8
|
+
top: calc(100% + 0.5rem);
|
|
9
|
+
padding: 0;
|
|
10
|
+
left: 0;
|
|
11
|
+
width: 100%;
|
|
12
|
+
margin: 0;
|
|
13
|
+
z-index: 99;
|
|
14
|
+
display: none;
|
|
15
|
+
max-height: rem(244) !important;
|
|
16
|
+
overflow: auto;
|
|
17
|
+
|
|
18
|
+
&:before {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// #endregion
|
|
24
|
+
|
|
25
|
+
// #region Needed for the component files
|
|
26
|
+
:is(iam-tag,iam-multiselect):has(label:not([slot='checked'])) {
|
|
27
|
+
--display-panel: block;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:is(iam-tag,iam-multiselect):has(label[slot='checked']) {
|
|
31
|
+
--display-button: block;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:is(iam-tag,iam-multiselect)[data-single] .tag[slot='checked'],
|
|
35
|
+
:is(iam-tag,iam-multiselect)[data-single] .tag[slot='checked'] * {
|
|
36
|
+
pointer-events: none!important;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@container style(--theme: dark) {
|
|
40
|
+
:host :is(.tag, .badge):not([slot='checked']) {
|
|
41
|
+
color: var(--colour-heading);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// #endregion
|
|
45
|
+
|
|
46
|
+
// #region Indivitual options
|
|
47
|
+
.dropdown__option[slot='checked'] {
|
|
48
|
+
order: var(--order, 1);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.dropdown__option:not([slot='checked']) {
|
|
52
|
+
display: block;
|
|
53
|
+
width: 100%;
|
|
54
|
+
max-width: 100%;
|
|
55
|
+
margin: 0;
|
|
56
|
+
text-align: left;
|
|
57
|
+
border-radius: 0;
|
|
58
|
+
padding-inline: 1rem;
|
|
59
|
+
outline: none;
|
|
60
|
+
padding-block: 0.5rem;
|
|
61
|
+
|
|
62
|
+
padding-bottom: 0.25em;
|
|
63
|
+
text-overflow: ellipsis;
|
|
64
|
+
overflow: hidden;
|
|
65
|
+
|
|
66
|
+
&:not(:hover, :focus, :active, :focus-within) {
|
|
67
|
+
background: none !important;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&::after {
|
|
71
|
+
display: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&[data-email] {
|
|
75
|
+
|
|
76
|
+
&::after {
|
|
77
|
+
content: attr(data-email);
|
|
78
|
+
display: block;
|
|
79
|
+
line-height: 1;
|
|
80
|
+
padding-bottom: 0.25em;
|
|
81
|
+
text-overflow: ellipsis;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// #endregion
|
|
87
|
+
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
@use './label' as *;
|
|
7
7
|
@use './input' as *;
|
|
8
|
+
@use './textarea' as *;
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
$icon-error: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d='M256 32a224 224 0 1 1 0 448 224 224 0 1 1 0-448zm0 480A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c-8.8 0-16 7.2-16 16V272c0 8.8 7.2 16 16 16s16-7.2 16-16V144c0-8.8-7.2-16-16-16zm24 224a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z' fill='#dc3545'/></svg>");
|
|
@@ -17,8 +18,7 @@ $icon-tick: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' view
|
|
|
17
18
|
|
|
18
19
|
// 1. Remove the margin in Firefox and Safari
|
|
19
20
|
select,
|
|
20
|
-
optgroup
|
|
21
|
-
textarea {
|
|
21
|
+
optgroup {
|
|
22
22
|
margin: 0; // 1
|
|
23
23
|
font-family: inherit;
|
|
24
24
|
font-size: inherit;
|
|
@@ -45,13 +45,6 @@ $icon-tick: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' view
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
// 1. Textareas should really only resize vertically so they don't break their (horizontal) containers.
|
|
50
|
-
|
|
51
|
-
textarea {
|
|
52
|
-
resize: vertical; // 1
|
|
53
|
-
}
|
|
54
|
-
|
|
55
48
|
// 1. Browsers set a default `min-width: min-content;` on fieldsets,
|
|
56
49
|
// unlike e.g. `<div>`s, which have `min-width: 0;` by default.
|
|
57
50
|
// So we reset that to ensure fieldsets behave more like a standard block element.
|
|
@@ -165,6 +158,7 @@ $icon-tick: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' view
|
|
|
165
158
|
// #region legend
|
|
166
159
|
fieldset {
|
|
167
160
|
width: 100%;
|
|
161
|
+
position: relative;
|
|
168
162
|
}
|
|
169
163
|
legend {
|
|
170
164
|
font-family: var(--font-heading);
|
|
@@ -209,7 +203,7 @@ $icon-tick: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' view
|
|
|
209
203
|
width: 100%;
|
|
210
204
|
}
|
|
211
205
|
|
|
212
|
-
:is(input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='range']),
|
|
206
|
+
:is(input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='range']), output) {
|
|
213
207
|
flex-shrink: 1;
|
|
214
208
|
flex-grow: 1;
|
|
215
209
|
width: 0;
|
|
@@ -279,14 +273,12 @@ $icon-tick: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' view
|
|
|
279
273
|
input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='range']):not([type='date']):not(
|
|
280
274
|
[type='time']
|
|
281
275
|
),
|
|
282
|
-
textarea,
|
|
283
276
|
output
|
|
284
277
|
),
|
|
285
278
|
:is(
|
|
286
279
|
input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='range']):not([type='date']):not(
|
|
287
280
|
[type='time']
|
|
288
281
|
),
|
|
289
|
-
textarea,
|
|
290
282
|
output
|
|
291
283
|
):has(~ .suffix) {
|
|
292
284
|
order: 1;
|
|
@@ -660,7 +652,9 @@ $icon-tick: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' view
|
|
|
660
652
|
|
|
661
653
|
input:checked + .conditional,
|
|
662
654
|
input:checked + label + .conditional,
|
|
663
|
-
label:has(:checked) + .conditional
|
|
655
|
+
label:has(:checked) + .conditional,
|
|
656
|
+
.was-validated .conditional:has(input[required]:invalid),
|
|
657
|
+
.was-validated .conditional:focus-within {
|
|
664
658
|
display: block;
|
|
665
659
|
clear: both;
|
|
666
660
|
}
|
|
@@ -833,7 +827,7 @@ $icon-tick: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' view
|
|
|
833
827
|
margin-bottom: 1.5rem;
|
|
834
828
|
max-width: var(--input-max-width);
|
|
835
829
|
|
|
836
|
-
:is(input:not([type='range']), select
|
|
830
|
+
:is(input:not([type='range']), select) {
|
|
837
831
|
margin-top: 0.5rem;
|
|
838
832
|
margin-bottom: 0 !important;
|
|
839
833
|
}
|
|
@@ -1035,6 +1029,7 @@ $icon-tick: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' view
|
|
|
1035
1029
|
padding-right: 3rem;
|
|
1036
1030
|
}
|
|
1037
1031
|
|
|
1032
|
+
|
|
1038
1033
|
.empty {
|
|
1039
1034
|
position: absolute;
|
|
1040
1035
|
bottom: 0.5rem;
|
|
@@ -1057,6 +1052,11 @@ $icon-tick: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' view
|
|
|
1057
1052
|
font-size: 1.5rem;
|
|
1058
1053
|
}
|
|
1059
1054
|
}
|
|
1055
|
+
|
|
1056
|
+
&:has([name="postcode"][disabled]) .empty{
|
|
1057
|
+
|
|
1058
|
+
display: none;
|
|
1059
|
+
}
|
|
1060
1060
|
|
|
1061
1061
|
&:has(input:is([name$="Alt"]):not([data-value],[data-placeholder])) .empty {
|
|
1062
1062
|
display: none;
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
|
|
38
38
|
.icon[class*='fa-'][class*='bg-'] {
|
|
39
39
|
aspect-ratio: 1 / 1;
|
|
40
|
-
width: calc(1lh + 0.
|
|
41
|
-
min-width: calc(1lh + 0.
|
|
42
|
-
max-width: calc(1lh + 0.
|
|
40
|
+
width: calc(1lh + 0.5em);
|
|
41
|
+
min-width: calc(1lh + 0.5em);
|
|
42
|
+
max-width: calc(1lh + 0.5em);
|
|
43
43
|
text-align: center;
|
|
44
|
-
padding: 0.
|
|
44
|
+
padding: 0.25em;
|
|
45
45
|
border-radius: 50% !important;
|
|
46
46
|
display: inline-block;
|
|
47
47
|
}
|
|
@@ -131,7 +131,6 @@
|
|
|
131
131
|
// #region input field
|
|
132
132
|
:is(
|
|
133
133
|
input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='range']),
|
|
134
|
-
textarea,
|
|
135
134
|
output
|
|
136
135
|
) {
|
|
137
136
|
display: block;
|
|
@@ -182,11 +181,6 @@
|
|
|
182
181
|
}
|
|
183
182
|
}
|
|
184
183
|
|
|
185
|
-
textarea {
|
|
186
|
-
max-height: 100%;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
184
|
input[type='color'] {
|
|
191
185
|
|
|
192
186
|
padding: 0!important;
|
|
@@ -195,7 +189,6 @@
|
|
|
195
189
|
|
|
196
190
|
[disabled] :is(
|
|
197
191
|
input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='range']),
|
|
198
|
-
textarea,
|
|
199
192
|
output,
|
|
200
193
|
select:not(.select--minimal, .btn)
|
|
201
194
|
) {
|
|
@@ -215,13 +208,6 @@
|
|
|
215
208
|
max-width: var(--input-max-width);
|
|
216
209
|
}
|
|
217
210
|
|
|
218
|
-
textarea {
|
|
219
|
-
--textarea-height-scale: 3;
|
|
220
|
-
min-height: calc(
|
|
221
|
-
var(--input-padding-block, 0.75rem) + var(--input-padding-block, 0.75rem) +
|
|
222
|
-
(var(--input-lh, 1.25rem) * var(--textarea-height-scale)) + 4px
|
|
223
|
-
) !important;
|
|
224
|
-
}
|
|
225
211
|
// #endregion
|
|
226
212
|
|
|
227
213
|
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:math';
|
|
3
|
+
|
|
4
|
+
@use '../_func' as *;
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@layer elements {
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
textarea {
|
|
11
|
+
|
|
12
|
+
--textarea-height-scale: 3;
|
|
13
|
+
|
|
14
|
+
margin: 0; // 1
|
|
15
|
+
font-family: inherit;
|
|
16
|
+
|
|
17
|
+
resize: vertical; // 1
|
|
18
|
+
display: block;
|
|
19
|
+
width: 100%;
|
|
20
|
+
display: block;
|
|
21
|
+
width: 100%;
|
|
22
|
+
padding: var(--input-padding-block, 0.75rem) var(--input-padding-inline, 1rem);
|
|
23
|
+
font-size: var(--input-fs, 1rem);
|
|
24
|
+
line-height: var(--input-lh, 1.25rem);
|
|
25
|
+
color: var(--colour-heading);
|
|
26
|
+
background-color: var(--colour-canvas-2);
|
|
27
|
+
background-clip: padding-box;
|
|
28
|
+
border: 2px solid var(--colour-primary);
|
|
29
|
+
appearance: none; // Fix appearance for date inputs in Safari
|
|
30
|
+
border-radius: 0.5rem;
|
|
31
|
+
margin-bottom: 1.5rem;
|
|
32
|
+
max-height: 100%;
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
&:not([rows]){
|
|
36
|
+
|
|
37
|
+
min-height: calc(
|
|
38
|
+
var(--input-padding-block, 0.75rem) + var(--input-padding-block, 0.75rem) +
|
|
39
|
+
(var(--input-lh, 1.25rem) * var(--textarea-height-scale)) + 4px
|
|
40
|
+
) !important;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&[rows="1"] {
|
|
44
|
+
|
|
45
|
+
--textarea-height-scale: 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&[rows="2"] {
|
|
49
|
+
|
|
50
|
+
--textarea-height-scale: 2;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:is([rows="2"],[rows="2"]) {
|
|
54
|
+
min-height: calc(
|
|
55
|
+
var(--input-padding-block, 0.75rem) + var(--input-padding-block, 0.75rem) +
|
|
56
|
+
(var(--input-lh, 1.25rem) * var(--textarea-height-scale)) + 4px
|
|
57
|
+
) !important;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Customize the `:focus` state to imitate native WebKit styles.
|
|
61
|
+
&:is(:focus, .focus):not(:disabled) {
|
|
62
|
+
border-color: var(--colour-info);
|
|
63
|
+
outline: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&:is(:focus, .focus):not(:disabled):not(:invalid) {
|
|
67
|
+
box-shadow: 0 0 0 0.1rem rgba(30, 190, 230, 0.25);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
// Disabled inputs
|
|
72
|
+
&:disabled {
|
|
73
|
+
background-color: #ccd6d8;
|
|
74
|
+
opacity: 0.4;
|
|
75
|
+
cursor: not-allowed;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
[disabled] textarea {
|
|
80
|
+
background-color: #ccd6d8;
|
|
81
|
+
opacity: 0.4;
|
|
82
|
+
cursor: not-allowed;
|
|
83
|
+
pointer-events: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
label:not(.tag):has(textarea) {
|
|
87
|
+
display: block;
|
|
88
|
+
margin-bottom: 1.5rem;
|
|
89
|
+
max-width: var(--input-max-width);
|
|
90
|
+
|
|
91
|
+
textarea {
|
|
92
|
+
margin-top: 0.5rem;
|
|
93
|
+
margin-bottom: 0 !important;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
}
|
|
@@ -50,21 +50,30 @@
|
|
|
50
50
|
outline: var(--contrast-outline-width, 0px) solid var(--colour-primary);
|
|
51
51
|
width: 100%;
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
> *:last-child {
|
|
54
|
+
margin-bottom: 0 !important;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@media screen and (min-width: 36em) {
|
|
59
|
+
.form-panel {
|
|
54
60
|
max-width: calc(100% - 5rem); // Guess
|
|
55
61
|
margin-inline: auto;
|
|
56
62
|
}
|
|
63
|
+
}
|
|
57
64
|
|
|
58
|
-
|
|
65
|
+
@media screen and (min-width: 62em) {
|
|
66
|
+
.form-panel {
|
|
59
67
|
max-width: rem(924); // Guess
|
|
60
68
|
border-radius: 0.5rem;
|
|
61
69
|
padding-inline: rem(94);
|
|
62
70
|
padding-block: 2.5rem;
|
|
63
71
|
margin-bottom: 2rem;
|
|
64
72
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
73
|
+
|
|
74
|
+
.form-panel--sm {
|
|
75
|
+
max-width: 40rem; /* 640px */
|
|
76
|
+
padding-inline: 2rem;
|
|
68
77
|
}
|
|
69
78
|
}
|
|
70
79
|
|
|
@@ -617,19 +617,26 @@ class iamAddressLookup extends HTMLElement {
|
|
|
617
617
|
// #endregion
|
|
618
618
|
|
|
619
619
|
advancedSelect(this, lookup, list, true);
|
|
620
|
+
|
|
621
|
+
if (this.hasAttribute('data-disabled'))
|
|
622
|
+
lookup?.setAttribute('disabled','disabled');
|
|
620
623
|
}
|
|
621
624
|
|
|
622
625
|
static get observedAttributes(): any {
|
|
623
|
-
return ['data-
|
|
626
|
+
return ['data-disabled'];
|
|
624
627
|
}
|
|
625
628
|
|
|
626
629
|
attributeChangedCallback(attrName, oldVal, newVal): void {
|
|
627
|
-
const
|
|
630
|
+
const lookup = this.shadowRoot.querySelector('[name="postcode"]');
|
|
628
631
|
|
|
629
632
|
switch (attrName) {
|
|
630
|
-
case 'data-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
+
case 'data-disabled': {
|
|
634
|
+
console.log(newVal);
|
|
635
|
+
if (oldVal != newVal && newVal == 'disabled') {
|
|
636
|
+
lookup?.setAttribute('disabled','disabled');
|
|
637
|
+
}
|
|
638
|
+
else if (oldVal != newVal) {
|
|
639
|
+
lookup?.removeAttribute('disabled');
|
|
633
640
|
}
|
|
634
641
|
break;
|
|
635
642
|
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { trackComponent, trackComponentRegistered } from '../_global';
|
|
2
|
+
import { searchAjax, filterList, setTag } from '../../modules/dropdown';
|
|
3
|
+
|
|
4
|
+
trackComponentRegistered('iam-tag');
|
|
5
|
+
|
|
6
|
+
class iamTag extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.attachShadow({ mode: 'open' });
|
|
10
|
+
|
|
11
|
+
const template = document.createElement('template');
|
|
12
|
+
template.innerHTML = `
|
|
13
|
+
<div class="wrapper">
|
|
14
|
+
<slot></slot>
|
|
15
|
+
</div>
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
this.shadowRoot.appendChild(template.content.cloneNode(true));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
isFormValid(form):boolean {
|
|
22
|
+
|
|
23
|
+
if (form.querySelector(':invalid'))
|
|
24
|
+
return false;
|
|
25
|
+
|
|
26
|
+
if (form.querySelector('.pwd-checker[data-strength="1"]') || form.querySelector('.pwd-checker[data-strength="2"]'))
|
|
27
|
+
return false;
|
|
28
|
+
|
|
29
|
+
if (form.querySelector('iam-multiselect[data-is-required][data-error]'))
|
|
30
|
+
return false;
|
|
31
|
+
|
|
32
|
+
return true;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
connectedCallback(): void {
|
|
36
|
+
|
|
37
|
+
const form = this.querySelector('form');
|
|
38
|
+
|
|
39
|
+
if(!form)
|
|
40
|
+
return false;
|
|
41
|
+
|
|
42
|
+
form.setAttribute('novalidate','true');
|
|
43
|
+
|
|
44
|
+
// Form validation
|
|
45
|
+
form.addEventListener('submit', (e) => {
|
|
46
|
+
|
|
47
|
+
form.classList.add('was-validated');
|
|
48
|
+
|
|
49
|
+
if (!this.isFormValid(form)) {
|
|
50
|
+
|
|
51
|
+
console.log('hey2');
|
|
52
|
+
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
form?.querySelector('input:invalid')?.scrollIntoView();
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
// conditional reveal required fields
|
|
60
|
+
Array.from(form.querySelectorAll('.conditional [required]')).forEach((input) => {
|
|
61
|
+
|
|
62
|
+
input.setAttribute('data-conditional-required','true');
|
|
63
|
+
input.removeAttribute('required');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// conditional reveal required fields (for fields inside of components like the address lookup)
|
|
67
|
+
Array.from(form.querySelectorAll('.conditional [data-required]')).forEach((input) => {
|
|
68
|
+
|
|
69
|
+
input.setAttribute('data-conditional-data-required','true');
|
|
70
|
+
input.removeAttribute('data-required');
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
form.addEventListener('change', () => {
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
Array.from(form.querySelectorAll('.conditional [data-conditional-required], .conditional [data-conditional-data-required]')).forEach((input) => {
|
|
77
|
+
|
|
78
|
+
input.removeAttribute('required');
|
|
79
|
+
input.removeAttribute('data-required');
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
Array.from(form.querySelectorAll('.conditional [data-conditional-required]')).forEach((input) => {
|
|
84
|
+
|
|
85
|
+
const conditionalStyles = window.getComputedStyle(input.closest('.conditional'));
|
|
86
|
+
|
|
87
|
+
if(conditionalStyles.getPropertyValue("display") == 'block')
|
|
88
|
+
input.setAttribute('required', 'required');
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
Array.from(form.querySelectorAll('.conditional [data-conditional-data-required]')).forEach((input) => {
|
|
92
|
+
|
|
93
|
+
const conditionalStyles = window.getComputedStyle(input.closest('.conditional'));
|
|
94
|
+
|
|
95
|
+
if(conditionalStyles.getPropertyValue("display") == 'block')
|
|
96
|
+
input.setAttribute('data-required', 'true');
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export default iamTag;
|
|
@@ -66,16 +66,18 @@ class iamInput extends HTMLElement {
|
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
const setCurrencyRules = (): void => {
|
|
69
|
-
|
|
69
|
+
let originalValue = input.value.replace(',','');
|
|
70
|
+
|
|
71
|
+
input?.setAttribute('data-value',originalValue);
|
|
70
72
|
input.setAttribute('type','text');
|
|
71
|
-
|
|
72
|
-
input.value = new Intl.NumberFormat("en-GB", {
|
|
73
|
+
originalValue = new Intl.NumberFormat("en-GB", {
|
|
73
74
|
style: "currency",
|
|
74
75
|
currency: "GBP",
|
|
75
|
-
minimumFractionDigits: Number.isInteger(
|
|
76
|
-
maximumFractionDigits: Number.isInteger(
|
|
76
|
+
minimumFractionDigits: Number.isInteger(originalValue) ? 0 : 2,
|
|
77
|
+
maximumFractionDigits: Number.isInteger(originalValue) ? 0 : 2,
|
|
77
78
|
trailingZeroDisplay: 'stripIfInteger' // Strip zeros if it's an integer
|
|
78
|
-
}).format(
|
|
79
|
+
}).format(originalValue).replace("£", "");
|
|
80
|
+
input.value = originalValue;
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
|