qc-trousse-sdg 1.4.4 → 1.4.6
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 +81 -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/plugins/buildHtmlDoc.js +5 -1
- package/public/css/qc-doc-sdg.css +31 -28
- package/public/css/qc-sdg-design-tokens.css +0 -2
- package/public/css/qc-sdg-no-grid.css +158 -112
- package/public/css/qc-sdg.css +158 -112
- 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 +37 -31
- package/public/js/qc-doc-sdg.js +7550 -4468
- package/public/js/qc-sdg.js +10295 -7247
- package/rollup.config.js +3 -4
- package/src/doc/_index.html +3 -0
- package/src/doc/components/Code.svelte +13 -5
- package/src/doc/components/Exemple.svelte +0 -13
- package/src/doc/scss/components/_code.scss +4 -21
- package/src/doc/scss/components/_exemple.scss +21 -0
- package/src/doc/scss/qc-doc-sdg.scss +1 -0
- package/src/sdg/_components.js +0 -1
- package/src/sdg/bases/form/_form.scss +0 -4
- package/src/sdg/bases/links/_links.html +10 -10
- package/src/sdg/components/Alert/Alert.svelte +1 -1
- package/src/sdg/components/Alert/_alert.html +2 -2
- 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/ChoiceGroup/_choiceGroup.html +0 -2
- 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/FormfieldRow/_formfieldRow.html +7 -7
- package/src/sdg/components/Label/_label.scss +1 -0
- package/src/sdg/components/Notice/_notice.html +3 -3
- 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 +14 -3
- package/src/sdg/components/PivHeader/Test/pivHeaderEmbeddedTest.svelte +2 -1
- package/src/sdg/components/PivHeader/Test/pivHeaderTest.js +9 -0
- package/src/sdg/components/PivHeader/_pivHeader.html +3 -2
- package/src/sdg/components/PivHeader/_pivHeader.scss +52 -23
- 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 +18 -8
- package/src/sdg/components/TextField/_textField.html +0 -5
- package/src/sdg/components/TextField/_textField.scss +6 -13
- package/src/sdg/components/utils.js +55 -14
- 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/src/sdg/components/CharCount/_charCount.html +0 -7
- package/src/sdg/components/RadioButton/_radioButton.html +0 -24
- package/tests/piv-header-svelte.spec.ts +0 -11
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
}}"/>
|
|
19
19
|
|
|
20
20
|
<script>
|
|
21
|
-
import {onDestroy, onMount} from "svelte";
|
|
21
|
+
import {onDestroy, onMount, tick} from "svelte";
|
|
22
22
|
import DropdownList from "./DropdownList.svelte";
|
|
23
23
|
import {Utils} from "../utils";
|
|
24
24
|
|
|
@@ -34,60 +34,60 @@
|
|
|
34
34
|
...rest
|
|
35
35
|
} = $props();
|
|
36
36
|
|
|
37
|
-
const availableWidths = ["xs", "sm", "md", "lg", "xl"];
|
|
38
|
-
|
|
39
37
|
let selectElement = $state();
|
|
40
38
|
let items = $state();
|
|
41
39
|
let labelElement = $state();
|
|
42
|
-
let observer;
|
|
40
|
+
let observer = new MutationObserver(setupItemsList);
|
|
41
|
+
let observerOptions = {
|
|
42
|
+
childList: true,
|
|
43
|
+
attributes: true,
|
|
44
|
+
subtree: true,
|
|
45
|
+
attributeFilter: ["label", "value", "disabled", "selected"]
|
|
46
|
+
};
|
|
43
47
|
let instance = $state();
|
|
44
48
|
let errorElement = $state();
|
|
45
49
|
let parentRow = $derived($host().closest(".qc-formfield-row"));
|
|
46
|
-
let
|
|
47
|
-
if (availableWidths.includes(width)) {
|
|
48
|
-
return `qc-dropdown-list-root-${width}`;
|
|
49
|
-
}
|
|
50
|
-
return `qc-dropdown-list-root-md`;
|
|
51
|
-
});
|
|
50
|
+
let internalChange = false;
|
|
52
51
|
|
|
53
52
|
onMount(() => {
|
|
54
53
|
selectElement = $host().querySelector("select");
|
|
55
54
|
labelElement = $host().querySelector("label");
|
|
56
|
-
|
|
57
55
|
if (labelElement) {
|
|
58
56
|
label = labelElement.innerHTML;
|
|
59
57
|
}
|
|
60
58
|
if (selectElement) {
|
|
61
59
|
multiple = selectElement.multiple;
|
|
62
60
|
disabled = selectElement.disabled;
|
|
63
|
-
}
|
|
64
61
|
|
|
62
|
+
selectElement.addEventListener("change", handleSelectChange);
|
|
63
|
+
observer.observe(selectElement, observerOptions);
|
|
64
|
+
}
|
|
65
65
|
setupItemsList();
|
|
66
|
-
|
|
66
|
+
$host().classList.add("qc-select");
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
onDestroy(() => {
|
|
70
70
|
observer?.disconnect();
|
|
71
|
+
selectElement.removeEventListener("change", handleSelectChange);
|
|
71
72
|
});
|
|
72
73
|
|
|
73
74
|
$effect(() => {
|
|
74
|
-
if (
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
option.selected = true;
|
|
85
|
-
} else {
|
|
86
|
-
option.removeAttribute('selected');
|
|
87
|
-
option.selected = false;
|
|
88
|
-
}
|
|
75
|
+
if (!selectElement) return;
|
|
76
|
+
if (!selectElement.options) return;
|
|
77
|
+
internalChange = true;
|
|
78
|
+
let newOptionSelected = false;
|
|
79
|
+
for (const option of selectElement.options) {
|
|
80
|
+
const selected = value.includes(option.value);
|
|
81
|
+
if (selected !== option.selected) {
|
|
82
|
+
option.toggleAttribute("selected", selected);
|
|
83
|
+
option.selected = selected;
|
|
84
|
+
newOptionSelected = true;
|
|
89
85
|
}
|
|
90
86
|
}
|
|
87
|
+
if (newOptionSelected) {
|
|
88
|
+
selectElement.dispatchEvent(new Event('change'));
|
|
89
|
+
}
|
|
90
|
+
tick().then(() => internalChange = false)
|
|
91
91
|
});
|
|
92
92
|
|
|
93
93
|
$effect(() => {
|
|
@@ -96,13 +96,6 @@
|
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
98
|
|
|
99
|
-
$effect(() => {
|
|
100
|
-
if (widthClass) {
|
|
101
|
-
$host().classList.add("qc-dropdown-list-root");
|
|
102
|
-
$host().classList.add(widthClass);
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
|
|
106
99
|
function setupItemsList() {
|
|
107
100
|
const options = selectElement?.querySelectorAll("option");
|
|
108
101
|
if (options && options.length > 0) {
|
|
@@ -117,21 +110,10 @@
|
|
|
117
110
|
}
|
|
118
111
|
}
|
|
119
112
|
|
|
120
|
-
function
|
|
121
|
-
if (
|
|
122
|
-
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
observer = new MutationObserver(setupItemsList);
|
|
126
|
-
observer.observe(selectElement, {
|
|
127
|
-
childList: true,
|
|
128
|
-
attributes: true,
|
|
129
|
-
attributeFilter: ["label", "value", "disabled", "selected"]
|
|
130
|
-
});
|
|
131
|
-
}
|
|
113
|
+
function handleSelectChange() {
|
|
114
|
+
if (internalChange) return;
|
|
115
|
+
setupItemsList();
|
|
132
116
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
117
|
</script>
|
|
136
118
|
|
|
137
119
|
<div hidden>
|
|
@@ -145,7 +127,6 @@
|
|
|
145
127
|
{placeholder}
|
|
146
128
|
{width}
|
|
147
129
|
webComponentMode={true}
|
|
148
|
-
webComponentParentRow={parentRow}
|
|
149
130
|
bind:value
|
|
150
131
|
bind:errorElement
|
|
151
132
|
bind:invalid
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import DropdownList from "../DropdownList.svelte";
|
|
7
7
|
import {Utils} from "../../utils";
|
|
8
8
|
import * as dropdownListTest from "./dropdownListTestUtils";
|
|
9
|
-
import Button from "../../Button/Button.svelte";
|
|
10
9
|
|
|
11
10
|
let singleChoiceOptions = $state(dropdownListTest.genericOptions());
|
|
12
11
|
let singleChoiceWithSearchOptions = $state(dropdownListTest.genericOptions());
|
|
@@ -15,8 +14,29 @@
|
|
|
15
14
|
let restaurants = $state(dropdownListTest.restaurantsArray());
|
|
16
15
|
let regions = $state(dropdownListTest.regionsArray());
|
|
17
16
|
|
|
17
|
+
let restaurantsDropdownList = $state(null);
|
|
18
|
+
let regionsDropdownList = $state(null);
|
|
19
|
+
|
|
18
20
|
singleChoiceOptions[0].checked = true;
|
|
19
21
|
singleChoiceWithSearchOptions[0].checked = true;
|
|
22
|
+
|
|
23
|
+
function validateForm(event) {
|
|
24
|
+
event.preventDefault();
|
|
25
|
+
|
|
26
|
+
if (restaurantsDropdownList && regionsDropdownList) {
|
|
27
|
+
let isValid = restaurantsDropdownList.value && restaurantsDropdownList.value.length > 0;
|
|
28
|
+
restaurantsDropdownList.invalid = !isValid;
|
|
29
|
+
|
|
30
|
+
if (isValid) {
|
|
31
|
+
const alertParts = [
|
|
32
|
+
"Formulaire soumis avec les données suivantes :",
|
|
33
|
+
"Type de restaurant: " + restaurantsDropdownList.value.join(", "),
|
|
34
|
+
"Régions desservies: " + regionsDropdownList.value.join(", ")
|
|
35
|
+
]
|
|
36
|
+
alert(alertParts.join("\n"));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
20
40
|
</script>
|
|
21
41
|
|
|
22
42
|
<DropdownList
|
|
@@ -62,8 +82,17 @@
|
|
|
62
82
|
items={JSON.parse(JSON.stringify(multipleChoiceOptions))}
|
|
63
83
|
/>
|
|
64
84
|
|
|
85
|
+
<DropdownList
|
|
86
|
+
id="dropdown-list-multiple-sm"
|
|
87
|
+
label="Débordement"
|
|
88
|
+
multiple
|
|
89
|
+
width="sm"
|
|
90
|
+
items={dropdownListTest.overflowOptions()}
|
|
91
|
+
/>
|
|
92
|
+
|
|
65
93
|
<form id="dropdown-list-embedded-test-form">
|
|
66
94
|
<DropdownList
|
|
95
|
+
bind:this={restaurantsDropdownList}
|
|
67
96
|
label="Types de restaurants"
|
|
68
97
|
required="true"
|
|
69
98
|
placeholder="Types de restaurants"
|
|
@@ -74,6 +103,7 @@
|
|
|
74
103
|
/>
|
|
75
104
|
|
|
76
105
|
<DropdownList
|
|
106
|
+
bind:this={regionsDropdownList}
|
|
77
107
|
label="Régions desservies"
|
|
78
108
|
multiple="true"
|
|
79
109
|
placeholder="Sélectionner une région"
|
|
@@ -83,7 +113,12 @@
|
|
|
83
113
|
width="lg"
|
|
84
114
|
/>
|
|
85
115
|
|
|
86
|
-
<
|
|
116
|
+
<button
|
|
117
|
+
type="submit" class="qc-button qc-primary qc-compact"
|
|
118
|
+
onclick={(event) => validateForm(event)}
|
|
119
|
+
>
|
|
120
|
+
Envoyer
|
|
121
|
+
</button>
|
|
87
122
|
</form>
|
|
88
123
|
|
|
89
124
|
<link rel='stylesheet' href='{Utils.cssPath}'>
|
package/src/sdg/components/DropdownList/Test/{dropdownListTest.html → dropdownListBaselineTest.html}
RENAMED
|
@@ -20,6 +20,15 @@
|
|
|
20
20
|
</select>
|
|
21
21
|
</qc-select>
|
|
22
22
|
|
|
23
|
+
<script>
|
|
24
|
+
const selectElement = document.getElementById("select-single-choice");
|
|
25
|
+
console.log("Select element options[0]:", selectElement.options[0]);
|
|
26
|
+
|
|
27
|
+
selectElement.addEventListener("change", (event) => {
|
|
28
|
+
console.log("Option sélectionnée :", event.target.value);
|
|
29
|
+
});
|
|
30
|
+
</script>
|
|
31
|
+
|
|
23
32
|
<div style="height: 40rem;">
|
|
24
33
|
<qc-select id="qc-select-single-choice-search" enable-search>
|
|
25
34
|
<label for="select-single-choice-search">Choix unique avec recherche</label>
|
|
@@ -68,7 +77,7 @@
|
|
|
68
77
|
|
|
69
78
|
<div class="qc-formfield-row">
|
|
70
79
|
<qc-select id="qc-select-invalid" invalid>
|
|
71
|
-
<label for="select-invalid">État invalide</label>
|
|
80
|
+
<label for="select-invalid">État initialement invalide dans .qc-formfield-row</label>
|
|
72
81
|
<select multiple id="select-invalid">
|
|
73
82
|
<option value="1">Option 1</option>
|
|
74
83
|
<option value="2">Option 2</option>
|
|
@@ -117,6 +126,15 @@
|
|
|
117
126
|
<select id="select-disabled" disabled>disabled</select>
|
|
118
127
|
</qc-select>
|
|
119
128
|
|
|
129
|
+
<qc-select id="qc-select-multiple-choices-sm" width="sm">
|
|
130
|
+
<label for="select-multiple-choices-sm">Débordement</label>
|
|
131
|
+
<select id="select-multiple-choices-sm" multiple>
|
|
132
|
+
<option value="1">Option 1 + texte de remplissage</option>
|
|
133
|
+
<option value="2">Option 2 + texte de remplissage</option>
|
|
134
|
+
<option value="3">Option 3 + texte de remplissage</option>
|
|
135
|
+
</select>
|
|
136
|
+
</qc-select>
|
|
137
|
+
|
|
120
138
|
<form id="dropdown-list-form">
|
|
121
139
|
<qc-select
|
|
122
140
|
id="dropdown-list-restaurants"
|
|
@@ -12,6 +12,20 @@ export function genericOptions() {
|
|
|
12
12
|
return genericOptions;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
export function overflowOptions() {
|
|
16
|
+
let overflowOptions = [];
|
|
17
|
+
for (let i = 1; i <= 3; i++) {
|
|
18
|
+
overflowOptions.push({
|
|
19
|
+
value: i,
|
|
20
|
+
label: `Option ${i} + texte de remplissage`,
|
|
21
|
+
disabled: false,
|
|
22
|
+
checked: false,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return overflowOptions;
|
|
27
|
+
}
|
|
28
|
+
|
|
15
29
|
export function restaurantsArray() {
|
|
16
30
|
return [
|
|
17
31
|
{
|
|
@@ -6,18 +6,11 @@
|
|
|
6
6
|
$min-height: 40;
|
|
7
7
|
$border: 1;
|
|
8
8
|
|
|
9
|
-
.qc-
|
|
9
|
+
.qc-select {
|
|
10
|
+
display: block;
|
|
10
11
|
margin-bottom: rem(32);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.qc-dropdown-list-root {
|
|
14
|
-
width: 100%;
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
&-sm { max-width: token-value(size, max-width, sm); }
|
|
18
|
-
&-md { max-width: token-value(size, max-width, md); }
|
|
19
|
-
&-lg { max-width: token-value(size, max-width, lg); }
|
|
20
|
-
&-xl { max-width: token-value(size, max-width, xl); }
|
|
13
|
+
max-width: 100%;
|
|
21
14
|
}
|
|
22
15
|
|
|
23
16
|
.qc-dropdown-list-container {
|
|
@@ -26,12 +19,6 @@ $border: 1;
|
|
|
26
19
|
.qc-label {
|
|
27
20
|
margin-bottom: rem(4);
|
|
28
21
|
}
|
|
29
|
-
|
|
30
|
-
&-xs { max-width: token-value(size, max-width, xs); }
|
|
31
|
-
&-sm { max-width: token-value(size, max-width, sm); }
|
|
32
|
-
&-md { max-width: token-value(size, max-width, md); }
|
|
33
|
-
&-lg { max-width: token-value(size, max-width, lg); }
|
|
34
|
-
&-xl { max-width: token-value(size, max-width, xl); }
|
|
35
22
|
}
|
|
36
23
|
|
|
37
24
|
.qc-dropdown-list {
|
|
@@ -40,6 +27,8 @@ $border: 1;
|
|
|
40
27
|
border: rem($border) solid token-value(color, grey, medium);
|
|
41
28
|
min-height: rem($min-height);
|
|
42
29
|
background-color: token-value(color, background);
|
|
30
|
+
max-width: 100%;
|
|
31
|
+
min-width: 0;
|
|
43
32
|
|
|
44
33
|
&.qc-dropdown-list-invalid {
|
|
45
34
|
border: rem(2) solid token-value(color, red, regular) !important;
|
|
@@ -48,6 +37,12 @@ $border: 1;
|
|
|
48
37
|
height: rem(36);
|
|
49
38
|
}
|
|
50
39
|
}
|
|
40
|
+
|
|
41
|
+
&-xs { width: token-value(size, max-width, xs); }
|
|
42
|
+
&-sm { width: token-value(size, max-width, sm); }
|
|
43
|
+
&-md { width: token-value(size, max-width, md); }
|
|
44
|
+
&-lg { width: token-value(size, max-width, lg); }
|
|
45
|
+
&-xl { width: token-value(size, max-width, xl); }
|
|
51
46
|
}
|
|
52
47
|
|
|
53
48
|
.qc-dropdown-list-search {
|
|
@@ -75,6 +75,15 @@
|
|
|
75
75
|
<option value="2">Option 2</option>
|
|
76
76
|
</select>
|
|
77
77
|
</qc-select>
|
|
78
|
+
|
|
79
|
+
<qc-select id="qc-select-multiple-choices-sm" width="sm">
|
|
80
|
+
<label for="select-multiple-choices-sm">Débordement</label>
|
|
81
|
+
<select id="select-multiple-choices-sm" multiple>
|
|
82
|
+
<option value="1">Option 1 + texte de remplissage</option>
|
|
83
|
+
<option value="2">Option 2 + texte de remplissage</option>
|
|
84
|
+
<option value="3">Option 3 + texte de remplissage</option>
|
|
85
|
+
</select>
|
|
86
|
+
</qc-select>
|
|
78
87
|
</qc-doc-exemple>
|
|
79
88
|
|
|
80
89
|
<h4>Documentation technique</h4>
|
|
@@ -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
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
<h3 id="champs-alignes">Champs alignés horizontalement (classe <code>qc‑
|
|
1
|
+
<h3 id="champs-alignes">Champs alignés horizontalement (classe <code>qc‑formfield‑row</code>)</h3>
|
|
2
2
|
|
|
3
|
-
<p>
|
|
3
|
+
<p>
|
|
4
|
+
Les champs regroupés sur une ligne doivent être placés dans un <code>div</code> avec la classe <code>qc-formfield-row</code>.
|
|
5
|
+
De cette façon, les messages d'erreur ne provoquent pas de décalage.
|
|
6
|
+
<br/><br/>
|
|
7
|
+
Voir le code des champs Téléphone et Poste dans l'exemple ci-dessus.
|
|
8
|
+
</p>
|
|
4
9
|
|
|
5
10
|
<h4>Exemple</h4>
|
|
6
11
|
<qc-doc-exemple caption="Exemple de champs sur une seule ligne">
|
|
@@ -101,8 +106,3 @@
|
|
|
101
106
|
}
|
|
102
107
|
});
|
|
103
108
|
</script>
|
|
104
|
-
|
|
105
|
-
<h4>Documentation technique</h4>
|
|
106
|
-
<p>Placer les champs à regrouper sur une seule ligne dans un div avec la classe <code>qc-formfield-row</code></p>
|
|
107
|
-
|
|
108
|
-
|
|
@@ -61,13 +61,13 @@
|
|
|
61
61
|
title="Des erreurs sont présentes dans le formulaire :">
|
|
62
62
|
<ul>
|
|
63
63
|
<li>
|
|
64
|
-
<a href="
|
|
64
|
+
<a href="#">Le champ « Nom de famille » est obligatoire ;</a>
|
|
65
65
|
</li>
|
|
66
66
|
<li>
|
|
67
|
-
<a href="
|
|
67
|
+
<a href="#">Le champ « Prénom » est obligatoire ;</a>
|
|
68
68
|
</li>
|
|
69
69
|
<li>
|
|
70
|
-
<a href="
|
|
70
|
+
<a href="#">Le champ « Numéro de dossier » est obligatoire.</a>
|
|
71
71
|
</li>
|
|
72
72
|
</ul>
|
|
73
73
|
</qc-notice>
|
|
@@ -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>
|