chore: move icon intro to icon package so it can be extended
This commit is contained in:
parent
e1af39320f
commit
3ae448f826
12 changed files with 17 additions and 19 deletions
|
|
@ -61,7 +61,6 @@ export const FocusMixin = dedupeMixin(
|
||||||
}
|
}
|
||||||
|
|
||||||
__registerEventsForFocusMixin() {
|
__registerEventsForFocusMixin() {
|
||||||
// focus
|
|
||||||
this.__redispatchFocus = ev => {
|
this.__redispatchFocus = ev => {
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
this.dispatchEvent(new Event('focus'));
|
this.dispatchEvent(new Event('focus'));
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { expect, fixture, html } from '@open-wc/testing';
|
import { expect, fixture, html } from '@open-wc/testing';
|
||||||
import './helpers/umbrella-form.js';
|
import './helpers/umbrella-form.js';
|
||||||
|
|
||||||
// Test umbrella form
|
// Test umbrella form.
|
||||||
describe('Form Integrations', () => {
|
describe('Form Integrations', () => {
|
||||||
it('".serializedValue" returns all non disabled fields based on form structure', async () => {
|
it('".serializedValue" returns all non disabled fields based on form structure', async () => {
|
||||||
const el = await fixture(html`<umbrella-form></umbrella-form>`);
|
const el = await fixture(html`<umbrella-form></umbrella-form>`);
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ Icons are SVGs so they can be easily scaled and styled with CSS.
|
||||||
## Packages
|
## Packages
|
||||||
|
|
||||||
| Package | Version | Description |
|
| Package | Version | Description |
|
||||||
| --------------------------------------------- | ------------------------------------------------------------------------------------------------ | ----------- |
|
| ----------------------------------------- | ------------------------------------------------------------------------------------------------ | ----------- |
|
||||||
| [icon](?path=/docs/icons-icon--default-story) | [](https://www.npmjs.com/package/@lion/icon) | Icon |
|
| [icon](?path=/docs/icons-icon--main#icon) | [](https://www.npmjs.com/package/@lion/icon) | Icon |
|
||||||
|
|
||||||
```js script
|
```js script
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -16,7 +16,7 @@ function validateSvg(svg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom element for rendering SVG icons
|
* Custom element for rendering SVG icons.
|
||||||
*/
|
*/
|
||||||
export class LionIcon extends LitElement {
|
export class LionIcon extends LitElement {
|
||||||
static get properties() {
|
static get properties() {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { formatNumber, getFractionDigits, normalizeCurrencyLabel } from '@lion/localize';
|
import { formatNumber, getFractionDigits, normalizeCurrencyLabel } from '@lion/localize';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Formats a number considering the default fraction digits provided by Intl
|
* Formats a number considering the default fraction digits provided by Intl.
|
||||||
*
|
*
|
||||||
* @param {float} modelValue Number to format
|
* @param {float} modelValue Number to format
|
||||||
* @param {object} givenOptions Options for Intl
|
* @param {object} givenOptions Options for Intl
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
import { IsDate } from '@lion/form-core';
|
||||||
import { LionInput } from '@lion/input';
|
import { LionInput } from '@lion/input';
|
||||||
import { formatDate, LocalizeMixin, parseDate } from '@lion/localize';
|
import { formatDate, LocalizeMixin, parseDate } from '@lion/localize';
|
||||||
import { IsDate } from '@lion/form-core';
|
|
||||||
|
|
||||||
function isValidDate(date) {
|
function isValidDate(date) {
|
||||||
// to make sure it is a valid date we use isNaN and not Number.isNaN
|
// to make sure it is a valid date we use isNaN and not Number.isNaN
|
||||||
|
|
@ -48,7 +48,7 @@ export class LionInputDate extends LocalizeMixin(LionInput) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
// modelValue is localized, so we take the timezone offset in milliseconds and subtract it
|
// modelValue is localized, so we take the timezone offset in milliseconds and subtract it
|
||||||
// before converting it to ISO string
|
// before converting it to ISO string.
|
||||||
const offset = modelValue.getTimezoneOffset() * 60000;
|
const offset = modelValue.getTimezoneOffset() * 60000;
|
||||||
return new Date(modelValue - offset).toISOString().slice(0, 10);
|
return new Date(modelValue - offset).toISOString().slice(0, 10);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ export class LionInputDatepicker extends ScopedElementsMixin(OverlayMixin(LionIn
|
||||||
/**
|
/**
|
||||||
* The heading to be added on top of the calendar overlay.
|
* The heading to be added on top of the calendar overlay.
|
||||||
* Naming chosen from an Application Developer perspective.
|
* Naming chosen from an Application Developer perspective.
|
||||||
* For a Subclasser 'calendarOverlayHeading' would be more appropriate
|
* For a Subclasser 'calendarOverlayHeading' would be more appropriate.
|
||||||
*/
|
*/
|
||||||
calendarHeading: {
|
calendarHeading: {
|
||||||
type: String,
|
type: String,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { LocalizeMixin } from '@lion/localize';
|
|
||||||
import { LionInput } from '@lion/input';
|
|
||||||
import { IsEmail } from '@lion/form-core';
|
import { IsEmail } from '@lion/form-core';
|
||||||
|
import { LionInput } from '@lion/input';
|
||||||
|
import { LocalizeMixin } from '@lion/localize';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LionInputEmail: extension of lion-input
|
* LionInputEmail: extension of lion-input
|
||||||
|
|
@ -12,7 +12,7 @@ export class LionInputEmail extends LocalizeMixin(LionInput) {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
// local-part@domain where the local part may be up to 64 characters long
|
// local-part@domain where the local part may be up to 64 characters long
|
||||||
// and the domain may have a maximum of 255 characters
|
// and the domain may have a maximum of 255 characters.
|
||||||
// @see https://www.wikiwand.com/en/Email_address
|
// @see https://www.wikiwand.com/en/Email_address
|
||||||
// however, the longest active email is even bigger
|
// however, the longest active email is even bigger
|
||||||
// @see https://laughingsquid.com/the-worlds-longest-active-email-address/
|
// @see https://laughingsquid.com/the-worlds-longest-active-email-address/
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { friendlyFormatIBAN } from 'ibantools';
|
||||||
* @return {string} formatted value
|
* @return {string} formatted value
|
||||||
*/
|
*/
|
||||||
export function formatIBAN(modelValue) {
|
export function formatIBAN(modelValue) {
|
||||||
// defensive code because of ibantools
|
// defensive code because of ibantools.
|
||||||
if (!modelValue) {
|
if (!modelValue) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
/* eslint-disable import/no-extraneous-dependencies */
|
/* eslint-disable import/no-extraneous-dependencies */
|
||||||
import { LocalizeMixin, formatNumber } from '@lion/localize';
|
import { css, html, unsafeCSS } from '@lion/core';
|
||||||
import { LionInput } from '@lion/input';
|
import { LionInput } from '@lion/input';
|
||||||
import { html, css, unsafeCSS } from '@lion/core';
|
import { formatNumber, LocalizeMixin } from '@lion/localize';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LionInputRange: extension of lion-input
|
* LionInputRange: extension of lion-input.
|
||||||
*
|
*
|
||||||
* @customElement `lion-input-range`
|
* @customElement `lion-input-range`
|
||||||
* @extends LionInput
|
* @extends LionInput
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { LionField } from '@lion/form-core';
|
import { LionField } from '@lion/form-core';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LionInput: extension of lion-field with native input element in place and user friendly API
|
* LionInput: extension of lion-field with native input element in place and user friendly API.
|
||||||
*
|
*
|
||||||
* @customElement lion-input
|
* @customElement lion-input
|
||||||
* @extends {LionField}
|
* @extends {LionField}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ import { LionInput } from '@lion/input';
|
||||||
* Example:
|
* Example:
|
||||||
* <lion-radio checked>
|
* <lion-radio checked>
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @customElement lion-radio
|
* @customElement lion-radio
|
||||||
* @extends {LionInput}
|
* @extends {LionInput}
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue