@statistikzh/leu 0.17.0 → 0.18.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/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +18 -0
- package/dist/Accordion.js +1 -1
- package/dist/Button.js +1 -1
- package/dist/ButtonGroup.js +1 -1
- package/dist/ChartWrapper.js +1 -1
- package/dist/Checkbox.js +1 -1
- package/dist/CheckboxGroup.js +1 -1
- package/dist/Chip.js +1 -1
- package/dist/ChipGroup.js +1 -1
- package/dist/ChipLink.js +1 -1
- package/dist/ChipRemovable.js +3 -1
- package/dist/ChipSelectable.js +1 -1
- package/dist/Dialog.js +3 -1
- package/dist/Dropdown.js +1 -1
- package/dist/Icon.d.ts +130 -2
- package/dist/Icon.js +96 -69
- package/dist/Input.d.ts +0 -9
- package/dist/Input.js +6 -23
- package/dist/{LeuElement-BRZYxDjR.js → LeuElement-DgiuzsX9.js} +1 -1
- package/dist/Menu.js +3 -1
- package/dist/MenuItem.js +3 -1
- package/dist/Message.js +1 -1
- package/dist/Pagination.js +1 -1
- package/dist/Placeholder.js +1 -1
- package/dist/Popup.js +1 -1
- package/dist/Radio.js +1 -1
- package/dist/RadioGroup.js +1 -1
- package/dist/Range.js +1 -1
- package/dist/ScrollTop.js +1 -1
- package/dist/Select.js +1 -1
- package/dist/Spinner.js +1 -1
- package/dist/Table.js +2 -2
- package/dist/Tag.js +1 -1
- package/dist/VisuallyHidden.js +1 -1
- package/dist/components/icon/Icon.d.ts +5 -2
- package/dist/components/icon/Icon.d.ts.map +1 -1
- package/dist/components/icon/paths.d.ts +48 -23
- package/dist/components/icon/paths.d.ts.map +1 -1
- package/dist/components/icon/stories/icon.stories.d.ts.map +1 -1
- package/dist/components/input/Input.d.ts +0 -9
- package/dist/components/input/Input.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/leu-accordion.js +1 -1
- package/dist/leu-button-group.js +1 -1
- package/dist/leu-button.js +1 -1
- package/dist/leu-chart-wrapper.js +1 -1
- package/dist/leu-checkbox-group.js +1 -1
- package/dist/leu-checkbox.js +1 -1
- package/dist/leu-chip-group.js +1 -1
- package/dist/leu-chip-link.js +1 -1
- package/dist/leu-chip-removable.js +3 -1
- package/dist/leu-chip-selectable.js +1 -1
- package/dist/leu-dialog.js +3 -1
- package/dist/leu-dropdown.js +1 -1
- package/dist/leu-icon.js +3 -1
- package/dist/leu-input.js +3 -1
- package/dist/leu-menu-item.js +3 -1
- package/dist/leu-menu.js +3 -1
- package/dist/leu-message.js +1 -1
- package/dist/leu-pagination.js +1 -1
- package/dist/leu-placeholder.js +1 -1
- package/dist/leu-popup.js +1 -1
- package/dist/leu-radio-group.js +1 -1
- package/dist/leu-radio.js +1 -1
- package/dist/leu-range.js +1 -1
- package/dist/leu-scroll-top.js +1 -1
- package/dist/leu-select.js +1 -1
- package/dist/leu-spinner.js +1 -1
- package/dist/leu-table.js +3 -3
- package/dist/leu-tag.js +1 -1
- package/dist/leu-visually-hidden.js +1 -1
- package/dist/vscode.html-custom-data.json +1 -1
- package/dist/web-types.json +2 -2
- package/package.json +1 -1
- package/src/components/icon/Icon.ts +7 -10
- package/src/components/icon/paths.ts +126 -77
- package/src/components/icon/stories/icon.stories.ts +5 -0
- package/src/components/icon/test/icon.test.ts +5 -4
- package/src/components/input/Input.ts +3 -26
|
@@ -2,16 +2,17 @@ import { html } from "lit"
|
|
|
2
2
|
import { fixture, expect } from "@open-wc/testing"
|
|
3
3
|
|
|
4
4
|
import "../leu-icon.js"
|
|
5
|
+
import { IconPathName } from "../paths.js"
|
|
5
6
|
|
|
6
|
-
async function defaultFixture(name = "close") {
|
|
7
|
+
async function defaultFixture(name: IconPathName | "" = "close") {
|
|
7
8
|
return fixture(html` <leu-icon name=${name}></leu-icon> `)
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
describe("LeuIcon", () => {
|
|
11
12
|
it("is a defined element", async () => {
|
|
12
|
-
const el =
|
|
13
|
+
const el = customElements.get("leu-icon")
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
expect(el).not.to.be.undefined
|
|
15
16
|
})
|
|
16
17
|
|
|
17
18
|
it("passes the a11y audit", async () => {
|
|
@@ -30,7 +31,7 @@ describe("LeuIcon", () => {
|
|
|
30
31
|
})
|
|
31
32
|
|
|
32
33
|
it("renders the correct icon path", async () => {
|
|
33
|
-
const el = await defaultFixture("
|
|
34
|
+
const el = await defaultFixture("angleDropUp")
|
|
34
35
|
|
|
35
36
|
const path = el.shadowRoot.querySelector("path")
|
|
36
37
|
expect(path).to.have.attribute("d", "M7 14.5L12 9.5L17 14.5H7Z")
|
|
@@ -250,29 +250,6 @@ export class LeuInput extends LeuElement {
|
|
|
250
250
|
)
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
/**
|
|
254
|
-
* Method for getting the id of the input element.
|
|
255
|
-
* If the id attribute is set, the value of the id attribute is returned.
|
|
256
|
-
* Otherwise a random id is generated and returned.
|
|
257
|
-
*
|
|
258
|
-
* @private
|
|
259
|
-
* @returns {string} id
|
|
260
|
-
*/
|
|
261
|
-
getId() {
|
|
262
|
-
const id = this.getAttribute("id")
|
|
263
|
-
|
|
264
|
-
if (id !== null && id !== "") {
|
|
265
|
-
return id
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
if (this._identifier !== "") {
|
|
269
|
-
return this._identifier
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
this._identifier = crypto.randomUUID()
|
|
273
|
-
return this._identifier
|
|
274
|
-
}
|
|
275
|
-
|
|
276
253
|
/**
|
|
277
254
|
* Merge custom and default validation messages.
|
|
278
255
|
* A validation message can be a function or a string.
|
|
@@ -352,7 +329,7 @@ export class LeuInput extends LeuElement {
|
|
|
352
329
|
}
|
|
353
330
|
|
|
354
331
|
return html`
|
|
355
|
-
<ul class="error" aria-errormessage
|
|
332
|
+
<ul class="error" aria-errormessage="input">
|
|
356
333
|
${errorMessages.map(
|
|
357
334
|
(message) => html`<li class="error-message">${message}</li>`,
|
|
358
335
|
)}
|
|
@@ -412,7 +389,7 @@ export class LeuInput extends LeuElement {
|
|
|
412
389
|
>
|
|
413
390
|
<input
|
|
414
391
|
class="input"
|
|
415
|
-
id="input
|
|
392
|
+
id="input"
|
|
416
393
|
type=${this.type}
|
|
417
394
|
name=${this.name}
|
|
418
395
|
@change=${this.handleChange}
|
|
@@ -431,7 +408,7 @@ export class LeuInput extends LeuElement {
|
|
|
431
408
|
ref=${ref(this._inputRef)}
|
|
432
409
|
aria-invalid=${isInvalid}
|
|
433
410
|
/>
|
|
434
|
-
<label for="input
|
|
411
|
+
<label for="input" class="label">${this.label}</label>
|
|
435
412
|
${this.prefix
|
|
436
413
|
? html`<div class="prefix" .aria-hidden=${true}>${this.prefix}</div>`
|
|
437
414
|
: nothing}
|