qc-trousse-sdg 1.4.0 → 1.4.1
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 +4 -0
- package/dist/css/qc-sdg-no-grid.min.css +1 -1
- package/dist/css/qc-sdg.min.css +1 -1
- package/dist/js/qc-sdg.min.js +1 -1
- package/package.json +1 -1
- package/public/css/qc-sdg-no-grid.css +18 -28
- package/public/css/qc-sdg.css +18 -28
- package/public/js/qc-doc-sdg.js +4768 -3040
- package/public/js/qc-sdg.js +1832 -797
- package/src/sdg/components/DropdownList/DropdownListButton/DropdownListButton.svelte +7 -8
- package/src/sdg/components/DropdownList/DropdownListButton/_dropdownListButton.scss +2 -12
- package/src/sdg/components/TextField/TextField.svelte +7 -5
- package/src/sdg/components/TextField/TextFieldWC.svelte +1 -1
- package/tests/dropdown-list.spec.ts +1 -1
- package/tests/textfield-svelte.spec.ts +28 -0
- package/tests/textfield.spec.ts +22 -6
|
@@ -25,19 +25,18 @@
|
|
|
25
25
|
bind:this={button}
|
|
26
26
|
{...rest}
|
|
27
27
|
>
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
|
|
31
|
-
{
|
|
32
|
-
|
|
33
|
-
{/if}
|
|
34
|
-
</span>
|
|
28
|
+
{#if selectedOptionsText.length > 0}
|
|
29
|
+
<span class="qc-dropdown-choice">{@html selectedOptionsText}</span>
|
|
30
|
+
{:else}
|
|
31
|
+
<span class="qc-dropdown-placeholder">{@html placeholder}</span>
|
|
32
|
+
{/if}
|
|
35
33
|
|
|
36
|
-
<span class={["qc-dropdown-button-icon"
|
|
34
|
+
<span class={["qc-dropdown-button-icon"]}>
|
|
37
35
|
<Icon
|
|
38
36
|
type="chevron-up-thin"
|
|
39
37
|
color={disabled ? "grey-regular" : "blue-piv"}
|
|
40
38
|
size="sm"
|
|
39
|
+
rotate={expanded ? 0 : 180}
|
|
41
40
|
/>
|
|
42
41
|
</span>
|
|
43
42
|
</button>
|
|
@@ -30,12 +30,6 @@ $min-height: 40;
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
.qc-dropdown-text {
|
|
34
|
-
display: flex;
|
|
35
|
-
justify-items: start;
|
|
36
|
-
overflow: hidden;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
33
|
%dropdown-placeholder-text {
|
|
40
34
|
display: block;
|
|
41
35
|
justify-content: start;
|
|
@@ -56,10 +50,6 @@ $min-height: 40;
|
|
|
56
50
|
}
|
|
57
51
|
|
|
58
52
|
.qc-dropdown-button-icon {
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
display: flex;
|
|
54
|
+
align-content: center;
|
|
61
55
|
}
|
|
62
|
-
|
|
63
|
-
.qc-dropdown-button-icon-expanded {
|
|
64
|
-
transform: rotate(180deg);
|
|
65
|
-
}
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
|
|
10
10
|
let {
|
|
11
11
|
label = '',
|
|
12
|
-
required = $bindable(),
|
|
12
|
+
required = $bindable(false),
|
|
13
13
|
description,
|
|
14
14
|
size,
|
|
15
15
|
maxlength,
|
|
16
16
|
maxlengthReached = $bindable(false),
|
|
17
17
|
invalidAtSubmit = $bindable(false),
|
|
18
|
-
value = "",
|
|
19
|
-
invalid = $bindable(),
|
|
18
|
+
value = $bindable(""),
|
|
19
|
+
invalid = $bindable(false),
|
|
20
20
|
invalidText,
|
|
21
21
|
describedBy = $bindable([]),
|
|
22
22
|
labelElement = $bindable(),
|
|
@@ -71,6 +71,8 @@
|
|
|
71
71
|
}
|
|
72
72
|
})
|
|
73
73
|
|
|
74
|
+
|
|
75
|
+
|
|
74
76
|
$effect(() => {
|
|
75
77
|
charCountText = ''
|
|
76
78
|
if (!maxlength) return;
|
|
@@ -107,8 +109,8 @@
|
|
|
107
109
|
].filter(Boolean)
|
|
108
110
|
.join(' ')
|
|
109
111
|
)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
+
input.setAttribute('aria-invalid', invalid)
|
|
113
|
+
input.setAttribute('aria-required', required)
|
|
112
114
|
})
|
|
113
115
|
|
|
114
116
|
</script>
|
|
@@ -2,7 +2,7 @@ import { test, expect } from '@playwright/test';
|
|
|
2
2
|
import path = require('path');
|
|
3
3
|
|
|
4
4
|
test.beforeEach(async ({ page }) => {
|
|
5
|
-
const htmlFilePath = path.resolve(__dirname, '../public/
|
|
5
|
+
const htmlFilePath = path.resolve(__dirname, '../public/dropdownListBaseline.test.html');
|
|
6
6
|
await page.goto(`file://${htmlFilePath}`);
|
|
7
7
|
});
|
|
8
8
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { test, expect } from '@playwright/test';
|
|
2
|
+
import path = require('path');
|
|
3
|
+
|
|
4
|
+
test.beforeEach(async ({ page }) => {
|
|
5
|
+
const htmlFilePath = path.resolve(__dirname, '../public/textFieldSvelte.test.html');
|
|
6
|
+
await page.goto(`file://${htmlFilePath}`);
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
/* test des composants web de la trousse */
|
|
10
|
+
test('textfield ref', {
|
|
11
|
+
tag: ['@svelte', '@textfield']
|
|
12
|
+
}, async ({ page }) => {
|
|
13
|
+
await expect(page).toHaveScreenshot('textField.png', {fullPage: true});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test.describe('Aria', () => {
|
|
17
|
+
test('aria-required', async ({ page }) => {
|
|
18
|
+
await expect(page.getByRole('textbox', { name: 'Large', exact: true })).toHaveAttribute('aria-required', 'true');
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
test('aria-invalid', async ({ page }) => {
|
|
22
|
+
await expect(page.getByRole('textbox', { name: 'Moyen', exact: true })).toHaveAttribute('aria-invalid', 'true');
|
|
23
|
+
|
|
24
|
+
await page.getByRole('textbox', { name: 'Moyen' }).click();
|
|
25
|
+
await page.getByRole('textbox', { name: 'Moyen' }).fill('1');
|
|
26
|
+
await expect(page.getByRole('textbox', { name: 'Moyen', exact: true })).toHaveAttribute('aria-invalid', 'false');
|
|
27
|
+
});
|
|
28
|
+
});
|
package/tests/textfield.spec.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { test, expect } from '@playwright/test';
|
|
2
2
|
import path = require('path');
|
|
3
3
|
|
|
4
|
+
test.beforeEach(async ({ page }) => {
|
|
5
|
+
const htmlFilePath = path.resolve(__dirname, '../public/textFieldBaseline.test.html');
|
|
6
|
+
await page.goto(`file://${htmlFilePath}`);
|
|
7
|
+
})
|
|
8
|
+
|
|
4
9
|
/* test des composants web de la trousse */
|
|
5
10
|
test('textfield ref', {
|
|
6
11
|
tag: ['@baseline', '@textfield']
|
|
@@ -12,10 +17,21 @@ test('textfield ref', {
|
|
|
12
17
|
});
|
|
13
18
|
/* test des composants svelte */
|
|
14
19
|
test('textfield svelte', {
|
|
15
|
-
tag: ['@
|
|
20
|
+
tag: ['@baseline', '@textfield']
|
|
16
21
|
}, async ({ page }) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
})
|
|
22
|
+
await expect(page).toHaveScreenshot('textField.png', {fullPage: true});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test.describe('Aria', () => {
|
|
26
|
+
test('aria-required', async ({ page }) => {
|
|
27
|
+
await expect(page.getByRole('textbox', { name: 'Large', exact: true })).toHaveAttribute('aria-required', 'true');
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('aria-invalid', async ({ page }) => {
|
|
31
|
+
await expect(page.getByRole('textbox', { name: 'Moyen', exact: true })).toHaveAttribute('aria-invalid', 'true');
|
|
32
|
+
|
|
33
|
+
await page.getByRole('textbox', { name: 'Moyen' }).click();
|
|
34
|
+
await page.getByRole('textbox', { name: 'Moyen' }).fill('1');
|
|
35
|
+
await expect(page.getByRole('textbox', { name: 'Moyen', exact: true })).toHaveAttribute('aria-invalid', 'false');
|
|
36
|
+
});
|
|
37
|
+
});
|