qc-trousse-sdg 1.4.4 → 1.4.5
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/README.md +75 -53
- package/dist/css/qc-sdg-design-tokens.min.css +1 -1
- package/dist/css/qc-sdg-no-grid.min.css +1 -1
- package/dist/css/qc-sdg.min.css +1 -1
- package/dist/img/QUEBEC_blanc.svg +3 -12
- package/dist/img/QUEBEC_couleur.svg +3 -23
- package/dist/js/qc-sdg.min.js +1 -1
- package/index.html +1 -1
- package/package.json +1 -1
- package/public/css/qc-sdg-design-tokens.css +0 -2
- package/public/css/qc-sdg-no-grid.css +119 -87
- package/public/css/qc-sdg.css +119 -87
- package/public/img/QUEBEC_blanc.svg +3 -12
- package/public/img/QUEBEC_couleur.svg +3 -23
- package/public/img/favicon.ico +0 -0
- package/public/index.html +13 -0
- package/public/js/qc-doc-sdg.js +443 -1380
- package/public/js/qc-sdg.js +320 -577
- package/src/doc/_index.html +3 -0
- package/src/sdg/_components.js +0 -1
- package/src/sdg/bases/form/_form.scss +0 -4
- package/src/sdg/components/Alert/Alert.svelte +1 -1
- package/src/sdg/components/Checkbox/Checkbox.svelte +3 -3
- package/src/sdg/components/Checkbox/CheckboxWC.svelte +3 -3
- package/src/sdg/components/Checkbox/{updateInput.svelte.js → updateChoiceInput.svelte.js} +6 -1
- package/src/sdg/components/ChoiceGroup/ChoiceGroup.svelte +2 -2
- package/src/sdg/components/ChoiceGroup/Test/ChoiceGroupeEmbededTest.svelte +3 -0
- package/src/sdg/components/ChoiceGroup/Test/checkboxBaselineTest.html +3 -0
- package/src/sdg/components/DropdownList/DropdownList.svelte +4 -7
- package/src/sdg/components/DropdownList/DropdownListItems/DropdownListItems.svelte +1 -6
- package/src/sdg/components/DropdownList/DropdownListItems/DropdownListItemsMultiple/_dropdownListItemsMultiple.scss +3 -8
- package/src/sdg/components/DropdownList/DropdownListItems/DropdownListItemsSingle/_dropdownListItemsSingle.scss +1 -2
- package/src/sdg/components/DropdownList/DropdownListItems/_dropdownListItems.scss +2 -4
- package/src/sdg/components/DropdownList/SelectWC.svelte +31 -50
- package/src/sdg/components/DropdownList/Test/DropdownListSvelteTest.svelte +37 -2
- package/src/sdg/components/DropdownList/Test/{dropdownListTest.html → dropdownListBaselineTest.html} +19 -1
- package/src/sdg/components/DropdownList/Test/dropdownListTestUtils.js +14 -0
- package/src/sdg/components/DropdownList/_dropdownList.scss +11 -16
- package/src/sdg/components/DropdownList/_select.html +9 -0
- package/src/sdg/components/Fieldset/_fieldset.scss +17 -4
- package/src/sdg/components/Label/_label.scss +1 -0
- package/src/sdg/components/PivFooter/PivFooter.svelte +2 -2
- package/src/sdg/components/PivHeader/PivHeader.svelte +79 -74
- package/src/sdg/components/PivHeader/Test/pivHeaderBaselineTest.html +12 -1
- package/src/sdg/components/PivHeader/Test/pivHeaderTest.js +9 -0
- package/src/sdg/components/PivHeader/_pivHeader.html +1 -0
- package/src/sdg/components/PivHeader/_pivHeader.scss +46 -19
- package/src/sdg/components/TextField/Test/textFieldBaselineTest.html +24 -5
- package/src/sdg/components/TextField/TextField.svelte +29 -25
- package/src/sdg/components/TextField/TextFieldWC.svelte +8 -0
- package/src/sdg/components/TextField/_textField.scss +6 -13
- package/src/sdg/qc-sdg-test.js +4 -0
- package/src/sdg/scss/settings/_tokens.scss +0 -4
- package/tests/buildSvelteTestsIgnore.json +2 -1
- package/tests/dropdown-list-baseline.spec.ts +51 -4
- package/tests/piv-header-baseline.spec.ts +3 -0
- package/src/sdg/components/Button/Button.svelte +0 -50
- package/src/sdg/components/Button/ButtonWC.svelte +0 -36
- package/tests/piv-header-svelte.spec.ts +0 -11
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use "qc-sdg-lib" as *;
|
|
2
|
+
@use "sass:map";
|
|
2
3
|
|
|
3
4
|
.qc-fieldset {
|
|
4
5
|
border: none;
|
|
@@ -76,7 +77,8 @@ $invalid-border-width: 2px;
|
|
|
76
77
|
gap: 0 rem(32);
|
|
77
78
|
flex-wrap: wrap;
|
|
78
79
|
margin-bottom: rem(32);
|
|
79
|
-
|
|
80
|
+
$mb : token-value(spacer, xs);
|
|
81
|
+
margin-top: calc(-1 * $mb);
|
|
80
82
|
|
|
81
83
|
> .qc-form-error {
|
|
82
84
|
width: 100%;
|
|
@@ -84,12 +86,23 @@ $invalid-border-width: 2px;
|
|
|
84
86
|
qc-textfield,
|
|
85
87
|
.qc-textfield {
|
|
86
88
|
margin-top: token-value(spacer, xs);
|
|
87
|
-
display: block;
|
|
88
|
-
width: auto;
|
|
89
89
|
margin-bottom: 0;
|
|
90
|
+
min-width: 0;
|
|
91
|
+
|
|
92
|
+
$sizes: map.get($lg-tokens, size, max-width);
|
|
93
|
+
@each $size, $width in $sizes {
|
|
94
|
+
[size="#{$size}"] {
|
|
95
|
+
input {
|
|
96
|
+
width: $width;
|
|
97
|
+
max-width: $width;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
90
101
|
}
|
|
91
|
-
|
|
102
|
+
|
|
103
|
+
.qc-select {
|
|
92
104
|
margin-top: token-value(spacer, xs);
|
|
93
105
|
margin-bottom: 0;
|
|
106
|
+
width: fit-content;
|
|
94
107
|
}
|
|
95
108
|
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
let {
|
|
6
6
|
logoUrl = '/',
|
|
7
|
-
logoSrc = Utils.imagesRelativePath + '
|
|
8
|
-
logoSrcDarkTheme = Utils.imagesRelativePath + '
|
|
7
|
+
logoSrc = Utils.imagesRelativePath + 'QUEBEC_couleur.svg',
|
|
8
|
+
logoSrcDarkTheme = Utils.imagesRelativePath + 'QUEBEC_blanc.svg',
|
|
9
9
|
logoAlt = lang === 'fr' ? 'Logo du gouvernement du Québec' : 'Logo of the Quebec government',
|
|
10
10
|
logoWidth = 139,
|
|
11
11
|
logoHeight = 50,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import {onMount, tick} from "svelte";
|
|
3
|
+
import {Utils} from "../utils"
|
|
4
4
|
|
|
5
5
|
const lang = Utils.getPageLanguage();
|
|
6
6
|
|
|
@@ -46,93 +46,98 @@
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
onMount(() => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
containerClass += fullWidth === 'true' ? '-fluid' : '';
|
|
50
|
+
if (showSearch === 'true') {
|
|
51
|
+
enableSearch = 'true'
|
|
52
|
+
displaySearchForm = true;
|
|
53
|
+
}
|
|
54
54
|
});
|
|
55
55
|
</script>
|
|
56
56
|
|
|
57
57
|
<div role="banner"
|
|
58
58
|
class="qc-piv-header qc-component"
|
|
59
|
-
style="--logo-src:url({logoSrc})"
|
|
60
59
|
>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
60
|
+
<div class="{containerClass}">
|
|
61
|
+
{#if goToContent === 'true'}
|
|
62
|
+
<div class="go-to-content">
|
|
63
|
+
<a href="{goToContentAnchor}">
|
|
64
|
+
{goToContentText}
|
|
65
|
+
</a>
|
|
66
|
+
</div>
|
|
67
|
+
{/if}
|
|
68
|
+
{#snippet title()}
|
|
69
|
+
{#if titleText}
|
|
70
|
+
<div class="title">
|
|
71
|
+
{#if titleUrl && titleUrl.length > 0}
|
|
72
|
+
<a class="page-title" href="{titleUrl}">{titleText}</a>
|
|
73
|
+
{:else}
|
|
74
|
+
<span class="page-title" role="heading" aria-level="1">{titleText}</span>
|
|
75
|
+
{/if}
|
|
76
|
+
</div>
|
|
77
|
+
{/if}
|
|
78
|
+
{/snippet}
|
|
79
|
+
<div class="piv-top">
|
|
80
|
+
<div class="signature-group">
|
|
81
|
+
<div class="logo">
|
|
82
|
+
<a
|
|
83
|
+
href="{logoUrl}"
|
|
84
|
+
rel="noreferrer"
|
|
85
|
+
>
|
|
86
|
+
<img src="{logoSrc}" alt="{logoAlt}" />
|
|
87
|
+
</a>
|
|
88
|
+
</div>
|
|
79
89
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
rel="noreferrer"
|
|
83
|
-
aria-label="{logoAlt}"
|
|
84
|
-
>
|
|
85
|
-
<div role="img"></div>
|
|
86
|
-
</a>
|
|
90
|
+
{@render title()}
|
|
91
|
+
</div>
|
|
87
92
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
onclick = {(evt) => {
|
|
93
|
+
<div class="right-section">
|
|
94
|
+
{#if Utils.isTruthy(enableSearch)}
|
|
95
|
+
<a class="qc-search"
|
|
96
|
+
href="/"
|
|
97
|
+
role="button"
|
|
98
|
+
onclick={(evt) => {
|
|
95
99
|
evt.preventDefault();
|
|
96
100
|
displaySearchForm = !displaySearchForm;
|
|
97
101
|
tick().then(() => {
|
|
98
102
|
focusOnSearchInput()
|
|
99
103
|
});
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
<div class="links">
|
|
106
|
-
{#if (!slots || slots['links']) && linksSlot }
|
|
107
|
-
{@render linksSlot()}
|
|
108
|
-
<!-- Le bloc else est present uniquement pour le cas ou PivHeader est utilise sans le wrapper PivHeaderWC.svelte -->
|
|
109
|
-
{:else}
|
|
110
|
-
{#if joinUsUrl || altLanguageUrl}
|
|
111
|
-
<nav aria-label="{linksLabel}">
|
|
112
|
-
<ul>
|
|
113
|
-
{#if altLanguageUrl}
|
|
114
|
-
<li><a href="{altLanguageUrl}">{altLanguageText}</a></li>
|
|
115
|
-
{/if}
|
|
116
|
-
{#if joinUsUrl}
|
|
117
|
-
<li><a href="{joinUsUrl}">{joinUsText}</a></li>
|
|
118
|
-
{/if}
|
|
119
|
-
</ul>
|
|
120
|
-
</nav>
|
|
104
|
+
}}
|
|
105
|
+
>
|
|
106
|
+
<span class="no-link-title" role="heading"
|
|
107
|
+
aria-level="1">{displaySearchForm ? hideSearchText : displaySearchText}</span>
|
|
108
|
+
</a>
|
|
121
109
|
{/if}
|
|
110
|
+
<div class="links">
|
|
111
|
+
{#if (!slots || slots['links']) && linksSlot }
|
|
112
|
+
{@render linksSlot()}
|
|
113
|
+
<!-- Le bloc else est present uniquement pour le cas ou PivHeader est utilise sans le wrapper PivHeaderWC.svelte -->
|
|
114
|
+
{:else}
|
|
115
|
+
{#if joinUsUrl || altLanguageUrl}
|
|
116
|
+
<nav aria-label="{linksLabel}">
|
|
117
|
+
<ul>
|
|
118
|
+
{#if altLanguageUrl}
|
|
119
|
+
<li><a href="{altLanguageUrl}">{altLanguageText}</a></li>
|
|
120
|
+
{/if}
|
|
121
|
+
{#if joinUsUrl}
|
|
122
|
+
<li><a href="{joinUsUrl}">{joinUsText}</a></li>
|
|
123
|
+
{/if}
|
|
124
|
+
</ul>
|
|
125
|
+
</nav>
|
|
126
|
+
{/if}
|
|
127
|
+
{/if}
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
{@render title()}
|
|
132
|
+
|
|
133
|
+
<div class="piv-bottom">
|
|
134
|
+
{#if displaySearchForm}
|
|
135
|
+
<div class="search-zone" bind:this={searchZone}>
|
|
136
|
+
{#if searchZoneSlot}
|
|
137
|
+
{@render searchZoneSlot()}
|
|
138
|
+
{/if}
|
|
139
|
+
</div>
|
|
122
140
|
{/if}
|
|
123
141
|
</div>
|
|
124
|
-
</div>
|
|
125
142
|
</div>
|
|
126
|
-
{@render title()}
|
|
127
|
-
|
|
128
|
-
<div class="piv-bottom">
|
|
129
|
-
{#if displaySearchForm}
|
|
130
|
-
<div class="search-zone" bind:this={searchZone}>
|
|
131
|
-
{#if searchZoneSlot}
|
|
132
|
-
{@render searchZoneSlot()}
|
|
133
|
-
{/if}
|
|
134
|
-
</div>
|
|
135
|
-
{/if}
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
143
|
</div>
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
<div id="pivEnteteExempleRecherchePersonnalisee">
|
|
25
25
|
<qc-piv-header title-text="Titre du site ou du service"
|
|
26
|
+
title-url=""
|
|
26
27
|
alt-logo="Accédez à Québec.ca"
|
|
27
28
|
enable-search="true"
|
|
28
29
|
show-search="true">
|
|
@@ -40,4 +41,14 @@
|
|
|
40
41
|
piv-background=""></qc-search-bar>
|
|
41
42
|
</form>
|
|
42
43
|
</qc-piv-header>
|
|
43
|
-
</div>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<br>
|
|
47
|
+
|
|
48
|
+
<qc-piv-header
|
|
49
|
+
id="piv-header-mce"
|
|
50
|
+
alt-logo="Accédez à Québec.ca"
|
|
51
|
+
join-us-url="#join-us"
|
|
52
|
+
alt-language-url="#fakeEnglish"
|
|
53
|
+
>
|
|
54
|
+
</qc-piv-header>
|
|
@@ -44,27 +44,48 @@ qc-piv-header {
|
|
|
44
44
|
}
|
|
45
45
|
.piv-top {
|
|
46
46
|
display: flex;
|
|
47
|
+
flex-wrap: nowrap;
|
|
48
|
+
gap: token-value(spacer sm);
|
|
47
49
|
align-items: start;
|
|
48
50
|
min-width: rem(72);
|
|
49
|
-
|
|
51
|
+
|
|
52
|
+
.signature-group {
|
|
50
53
|
display: flex;
|
|
51
|
-
flex-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
background-size: 100%;
|
|
57
|
-
background-position: center;
|
|
58
|
-
margin-right: 16px;
|
|
59
|
-
min-width: 150px;
|
|
60
|
-
width: 100%;
|
|
61
|
-
max-width: rem(200);
|
|
54
|
+
flex-grow: 1;
|
|
55
|
+
flex-wrap: wrap;
|
|
56
|
+
align-items: start;
|
|
57
|
+
margin-right: auto;
|
|
58
|
+
& > * {
|
|
62
59
|
min-height: rem(72);
|
|
63
60
|
}
|
|
61
|
+
|
|
62
|
+
.logo {
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
flex-basis: rem(264);
|
|
66
|
+
|
|
67
|
+
a {
|
|
68
|
+
display: flex;
|
|
69
|
+
height: fit-content;
|
|
70
|
+
width: fit-content;
|
|
71
|
+
outline-offset: rem(4);
|
|
72
|
+
|
|
73
|
+
img {
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-basis: min-content;
|
|
76
|
+
min-width: 150px;
|
|
77
|
+
width: 100%;
|
|
78
|
+
height: 100%;
|
|
79
|
+
max-width: rem(200);
|
|
80
|
+
min-height: rem(40);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
64
84
|
}
|
|
85
|
+
|
|
65
86
|
.title {
|
|
66
|
-
|
|
67
|
-
align-
|
|
87
|
+
display: block;
|
|
88
|
+
align-content: center;
|
|
68
89
|
}
|
|
69
90
|
.right-section {
|
|
70
91
|
min-width: fit-content;
|
|
@@ -108,10 +129,14 @@ qc-piv-header {
|
|
|
108
129
|
}
|
|
109
130
|
}
|
|
110
131
|
|
|
132
|
+
.page-title {
|
|
133
|
+
display: inline-block;
|
|
134
|
+
}
|
|
135
|
+
|
|
111
136
|
qc-piv-header,
|
|
112
137
|
.qc-piv-header {
|
|
113
138
|
a {
|
|
114
|
-
--qc-color-link-focus-outline: #{
|
|
139
|
+
--qc-color-link-focus-outline: #{map.get($colors, blue, pale)};
|
|
115
140
|
--qc-color-link-hover: white;
|
|
116
141
|
--qc-color-link-text: white;
|
|
117
142
|
--qc-color-link-visited: white;
|
|
@@ -161,10 +186,6 @@ qc-piv-header,
|
|
|
161
186
|
flex: 1 1 auto;
|
|
162
187
|
margin-right: auto;
|
|
163
188
|
min-width: 0;
|
|
164
|
-
img {
|
|
165
|
-
width: 100%;
|
|
166
|
-
margin-right: rem(16);
|
|
167
|
-
}
|
|
168
189
|
}
|
|
169
190
|
|
|
170
191
|
.title {
|
|
@@ -191,6 +212,12 @@ qc-piv-header,
|
|
|
191
212
|
}
|
|
192
213
|
}
|
|
193
214
|
|
|
215
|
+
.no-link-title {
|
|
216
|
+
margin: 0;
|
|
217
|
+
font-weight: token-value(font weight regular);
|
|
218
|
+
font-size: token-value(font size md);
|
|
219
|
+
}
|
|
220
|
+
|
|
194
221
|
|
|
195
222
|
|
|
196
223
|
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
name="text-lg"
|
|
36
36
|
/>
|
|
37
37
|
</qc-textfield>
|
|
38
|
-
|
|
39
38
|
<qc-textfield
|
|
40
39
|
label="Très large"
|
|
41
40
|
size="xl"
|
|
@@ -47,11 +46,23 @@
|
|
|
47
46
|
disabled
|
|
48
47
|
/>
|
|
49
48
|
</qc-textfield>
|
|
49
|
+
<div style="width: 500px; max-width: 100%;padding: 10px; border: 1px solid #ccc;">
|
|
50
|
+
<qc-textfield
|
|
51
|
+
label="Très large"
|
|
52
|
+
size="xl"
|
|
50
53
|
|
|
54
|
+
>
|
|
55
|
+
<input type="text"
|
|
56
|
+
placeholder="Long placeholder lorem ipsum dolor sit amet"
|
|
57
|
+
name="text-xl"
|
|
58
|
+
disabled
|
|
59
|
+
/>
|
|
60
|
+
</qc-textfield>
|
|
61
|
+
</div>
|
|
51
62
|
<div class="qc-formfield-row">
|
|
52
63
|
<qc-textfield
|
|
53
|
-
label="Combiné 1"
|
|
54
|
-
size="
|
|
64
|
+
label="Combiné 1 Long placeholder lorem ipsum dolor sit amet"
|
|
65
|
+
size="lg"
|
|
55
66
|
>
|
|
56
67
|
<input type="text"
|
|
57
68
|
placeholder="Long placeholder lorem ipsum dolor sit amet"
|
|
@@ -60,7 +71,7 @@
|
|
|
60
71
|
</qc-textfield>
|
|
61
72
|
|
|
62
73
|
<qc-textfield
|
|
63
|
-
label="Combiné 2"
|
|
74
|
+
label="Combiné 2 Long placeholder lorem ipsum dolor sit amet"
|
|
64
75
|
size="xs"
|
|
65
76
|
>
|
|
66
77
|
<input type="text"
|
|
@@ -92,12 +103,20 @@
|
|
|
92
103
|
</div>
|
|
93
104
|
|
|
94
105
|
<qc-textfield label="Commentaires"
|
|
95
|
-
size="lg"
|
|
96
106
|
description="Vous pouvez entrer des commentaires dans la zone de texte ci-dessous."
|
|
97
107
|
>
|
|
98
108
|
<textarea name="zone-lg" id="zone-lg"></textarea>
|
|
99
109
|
</qc-textfield>
|
|
100
110
|
|
|
111
|
+
<qc-textfield label="Commentaires"
|
|
112
|
+
description="Vous pouvez entrer des commentaires dans la zone de texte ci-dessous."
|
|
113
|
+
>
|
|
114
|
+
<input type="text"
|
|
115
|
+
name="zone-lg-input"
|
|
116
|
+
placeholder="Long placeholder lorem ipsum dolor sit amet"
|
|
117
|
+
/>
|
|
118
|
+
</qc-textfield>
|
|
119
|
+
|
|
101
120
|
<qc-textfield
|
|
102
121
|
label="Suggestions"
|
|
103
122
|
description="Vous pouvez entrer des suggestions dans la zone de texte ci-dessous."
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import {
|
|
2
|
+
import {Utils} from "../utils";
|
|
3
3
|
import Label from "../Label/Label.svelte";
|
|
4
4
|
import {getContext, onMount} from "svelte";
|
|
5
5
|
import FormError from "../FormError/FormError.svelte";
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
label = '',
|
|
12
12
|
required = $bindable(false),
|
|
13
13
|
description,
|
|
14
|
-
size,
|
|
14
|
+
size = $bindable(),
|
|
15
15
|
maxlength,
|
|
16
16
|
maxlengthReached = $bindable(false),
|
|
17
17
|
invalidAtSubmit = $bindable(false),
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
onMount(() => {
|
|
45
45
|
if (webComponentMode) return;
|
|
46
|
-
if (!
|
|
46
|
+
if (!input) {
|
|
47
47
|
input = rootElement.querySelector('input,textarea');
|
|
48
48
|
}
|
|
49
49
|
onMountInput(
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
)
|
|
55
55
|
})
|
|
56
56
|
|
|
57
|
+
$effect(() => {
|
|
58
|
+
if (size) return;
|
|
59
|
+
if (!input) return;
|
|
60
|
+
size = input.tagName === 'INPUT' ? 'md' : 'lg';
|
|
61
|
+
})
|
|
62
|
+
|
|
57
63
|
$effect(() => {
|
|
58
64
|
invalidAtSubmit = (required && !value) || maxlengthReached;
|
|
59
65
|
})
|
|
@@ -72,7 +78,6 @@
|
|
|
72
78
|
})
|
|
73
79
|
|
|
74
80
|
|
|
75
|
-
|
|
76
81
|
$effect(() => {
|
|
77
82
|
charCountText = ''
|
|
78
83
|
if (!maxlength) return;
|
|
@@ -83,12 +88,12 @@
|
|
|
83
88
|
const s = over > 1 ? 's' : '';
|
|
84
89
|
charCountText =
|
|
85
90
|
remaining >= 0
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
? lang === 'fr'
|
|
92
|
+
? `${remaining} caractère${s} restant${s}`
|
|
93
|
+
: `${remaining} character${s} remaining`
|
|
94
|
+
: lang === 'fr'
|
|
95
|
+
? `${over} caractère${s} en trop`
|
|
96
|
+
: `${over} character${s} over the limit`
|
|
92
97
|
|
|
93
98
|
});
|
|
94
99
|
|
|
@@ -107,7 +112,7 @@
|
|
|
107
112
|
invalid && errorId,
|
|
108
113
|
maxlength && charCountId,
|
|
109
114
|
].filter(Boolean)
|
|
110
|
-
|
|
115
|
+
.join(' ')
|
|
111
116
|
)
|
|
112
117
|
input.setAttribute('aria-invalid', invalid)
|
|
113
118
|
input.setAttribute('aria-required', required)
|
|
@@ -116,7 +121,6 @@
|
|
|
116
121
|
</script>
|
|
117
122
|
|
|
118
123
|
{#snippet textfield()}
|
|
119
|
-
|
|
120
124
|
{#if label}
|
|
121
125
|
<Label
|
|
122
126
|
{required}
|
|
@@ -124,29 +128,29 @@
|
|
|
124
128
|
text={label}
|
|
125
129
|
forId={input?.id}
|
|
126
130
|
bind:rootElement={labelElement}
|
|
127
|
-
|
|
131
|
+
/>
|
|
128
132
|
{/if}
|
|
129
133
|
|
|
130
134
|
{#if description}
|
|
131
135
|
<div
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
+
bind:this={descriptionElement}
|
|
137
|
+
id={descriptionId}
|
|
138
|
+
class="qc-description">
|
|
139
|
+
{@html description}
|
|
136
140
|
</div>
|
|
137
141
|
{/if}
|
|
138
142
|
|
|
139
143
|
{@render children()}
|
|
140
144
|
|
|
141
|
-
{#if maxlength !== null}
|
|
145
|
+
{#if maxlength && maxlength !== null}
|
|
142
146
|
<div
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
bind:this={maxlengthElement}
|
|
148
|
+
id={charCountId}
|
|
149
|
+
class={[
|
|
150
|
+
'qc-textfield-charcount',
|
|
151
|
+
maxlengthReached && 'qc-max-reached'
|
|
152
|
+
]}
|
|
153
|
+
aria-live="polite"
|
|
150
154
|
>
|
|
151
155
|
{@html charCountText}
|
|
152
156
|
</div>
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
description,
|
|
27
27
|
required,
|
|
28
28
|
maxlength,
|
|
29
|
+
size,
|
|
29
30
|
maxlengthReached = $bindable(false),
|
|
30
31
|
invalidAtSubmit = $bindable(false),
|
|
31
32
|
} = $props();
|
|
@@ -46,6 +47,12 @@
|
|
|
46
47
|
invalidParam => invalid = invalidParam
|
|
47
48
|
)
|
|
48
49
|
})
|
|
50
|
+
|
|
51
|
+
$effect(() => {
|
|
52
|
+
if (!size) return;
|
|
53
|
+
$host().setAttribute('size', size);
|
|
54
|
+
})
|
|
55
|
+
|
|
49
56
|
$effect(() => {
|
|
50
57
|
if (!input) return;
|
|
51
58
|
if (label) {
|
|
@@ -75,6 +82,7 @@
|
|
|
75
82
|
{required}
|
|
76
83
|
{maxlength}
|
|
77
84
|
{value}
|
|
85
|
+
bind:size
|
|
78
86
|
bind:invalid
|
|
79
87
|
bind:invalidText
|
|
80
88
|
bind:maxlengthReached
|
|
@@ -62,18 +62,10 @@ textarea {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
$sizes: map.get($lg-tokens, size, max-width);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
max-width: token-value(size input max-width);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
textarea,
|
|
73
|
-
textarea + .qc-textfield-charcount {
|
|
74
|
-
.qc-textfield &,
|
|
75
|
-
qc-textfield & {
|
|
76
|
-
max-width: token-value(size textarea max-width);
|
|
65
|
+
|
|
66
|
+
@each $size, $width in $sizes {
|
|
67
|
+
[size="#{$size}"] {
|
|
68
|
+
max-width: 100%;
|
|
77
69
|
}
|
|
78
70
|
}
|
|
79
71
|
|
|
@@ -84,7 +76,8 @@ textarea,
|
|
|
84
76
|
& + .qc-textfield-charcount {
|
|
85
77
|
@each $size, $width in $sizes {
|
|
86
78
|
[size="#{$size}"] & {
|
|
87
|
-
max-width:
|
|
79
|
+
max-width: 100%;
|
|
80
|
+
width: $width;
|
|
88
81
|
}
|
|
89
82
|
}
|
|
90
83
|
}
|
package/src/sdg/qc-sdg-test.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {setMcePivHeaderLogoSrc} from "./components/PivHeader/Test/pivHeaderTest";
|
|
2
|
+
|
|
3
|
+
setMcePivHeaderLogoSrc();
|
|
4
|
+
|
|
1
5
|
export * from './bases/Icon/Test/IconEmbeddedTest.svelte';
|
|
2
6
|
export * from './components/TextField/Test/TextFieldEmbededTest.svelte';
|
|
3
7
|
export * from "./components/DropdownList/Test/DropdownListSvelteTest.svelte";
|