@lion/ui 0.0.13 → 0.1.0
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/components/icon/src/LionIcon.js +11 -4
- package/components/localize/src/LocalizeMixin.js +4 -3
- package/components/localize/types/LocalizeMixinTypes.ts +2 -1
- package/custom-elements.json +4 -4
- package/dist-types/components/icon/src/LionIcon.d.ts.map +1 -1
- package/dist-types/components/localize/src/LocalizeMixin.d.ts +1 -0
- package/dist-types/components/localize/src/LocalizeMixin.d.ts.map +1 -1
- package/dist-types/components/localize/types/LocalizeMixinTypes.d.ts +2 -1
- package/dist-types/components/localize/types/LocalizeMixinTypes.d.ts.map +1 -1
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/checkbox-group/overview.md +2 -2
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/combobox/overview.md +1 -1
- package/docs/components/combobox/use-cases.md +1 -1
- package/docs/components/dialog/overview.md +1 -1
- package/docs/components/fieldset/overview.md +5 -5
- package/docs/components/form/overview.md +3 -3
- package/docs/components/icon/use-cases.md +1 -1
- package/docs/components/input/overview.md +1 -1
- package/docs/components/input-amount/overview.md +3 -3
- package/docs/components/input-date/overview.md +3 -3
- package/docs/components/input-datepicker/overview.md +5 -5
- package/docs/components/input-email/overview.md +2 -2
- package/docs/components/input-iban/overview.md +2 -2
- package/docs/components/input-range/overview.md +2 -2
- package/docs/components/input-stepper/overview.md +1 -1
- package/docs/components/input-tel/overview.md +1 -1
- package/docs/components/input-tel/use-cases.md +6 -6
- package/docs/components/input-tel-dropdown/overview.md +1 -1
- package/docs/components/radio-group/overview.md +3 -3
- package/docs/components/select-rich/use-cases.md +1 -1
- package/docs/components/tabs/examples.md +1 -1
- package/docs/fundamentals/index.md +4 -4
- package/docs/fundamentals/node-tools/providence-analytics/LocalConfiguration.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/QueryResult.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/analyzer.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/dashboard.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/overview.md +3 -3
- package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
- package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
- package/docs/fundamentals/systems/core/overview.md +1 -1
- package/docs/fundamentals/systems/form/formatting-and-parsing.md +4 -4
- package/docs/fundamentals/systems/form/model-value.md +1 -1
- package/docs/fundamentals/systems/form/overview.md +28 -28
- package/docs/fundamentals/systems/form/validate.md +1 -1
- package/docs/fundamentals/systems/localize/overview.md +4 -4
- package/docs/fundamentals/systems/overlays/configuration.md +12 -10
- package/docs/fundamentals/systems/overlays/overview.md +5 -5
- package/docs/fundamentals/systems/overlays/use-cases.md +2 -2
- package/docs/fundamentals/tools/helpers/overview.md +1 -1
- package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
- package/docs/guides/how-to/create-a-custom-field.md +5 -5
- package/docs/guides/how-to/extend-a-native-input.md +2 -2
- package/docs/guides/index.md +8 -8
- package/docs/guides/principles/index.md +5 -5
- package/docs/guides/principles/styling.md +1 -1
- package/package.json +1 -1
|
@@ -194,11 +194,18 @@ export class LionIcon extends LitElement {
|
|
|
194
194
|
}
|
|
195
195
|
} else {
|
|
196
196
|
const iconIdBeforeResolve = this.iconId;
|
|
197
|
-
const svg = await this._iconManager.resolveIconForId(iconIdBeforeResolve);
|
|
198
197
|
|
|
199
|
-
//
|
|
200
|
-
|
|
201
|
-
|
|
198
|
+
// Wrap in try-catch so error is non-fatal.
|
|
199
|
+
// Failure to load an icon (asset) should not crash the entire app.
|
|
200
|
+
try {
|
|
201
|
+
const svg = await this._iconManager.resolveIconForId(iconIdBeforeResolve);
|
|
202
|
+
// update SVG if it did not change in the meantime to avoid race conditions
|
|
203
|
+
if (this.iconId === iconIdBeforeResolve) {
|
|
204
|
+
this.svg = svg;
|
|
205
|
+
}
|
|
206
|
+
} catch (e) {
|
|
207
|
+
// eslint-disable-next-line no-console
|
|
208
|
+
console.error(e);
|
|
202
209
|
}
|
|
203
210
|
}
|
|
204
211
|
}
|
|
@@ -6,6 +6,7 @@ import { localize } from './singleton.js';
|
|
|
6
6
|
/**
|
|
7
7
|
* @typedef {import('lit/directive.js').DirectiveResult} DirectiveResult
|
|
8
8
|
* @typedef {import('../types/LocalizeMixinTypes.js').LocalizeMixin} LocalizeMixin
|
|
9
|
+
* @typedef {import('../types/LocalizeMixinTypes.js').NamespaceObject} NamespaceObject
|
|
9
10
|
*/
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -17,7 +18,7 @@ const LocalizeMixinImplementation = superclass =>
|
|
|
17
18
|
// @ts-ignore https://github.com/microsoft/TypeScript/issues/36821#issuecomment-588375051
|
|
18
19
|
class LocalizeMixin extends superclass {
|
|
19
20
|
/**
|
|
20
|
-
* @returns {
|
|
21
|
+
* @returns {NamespaceObject[]}
|
|
21
22
|
*/
|
|
22
23
|
static get localizeNamespaces() {
|
|
23
24
|
return [];
|
|
@@ -106,11 +107,11 @@ const LocalizeMixinImplementation = superclass =>
|
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
/**
|
|
109
|
-
* @returns {
|
|
110
|
+
* @returns {NamespaceObject[]}
|
|
110
111
|
* @private
|
|
111
112
|
*/
|
|
112
113
|
__getUniqueNamespaces() {
|
|
113
|
-
/** @type {
|
|
114
|
+
/** @type {NamespaceObject[]} */
|
|
114
115
|
const uniqueNamespaces = [];
|
|
115
116
|
|
|
116
117
|
// IE11 does not support iterable in the constructor
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Constructor } from '@open-wc/dedupe-mixin';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
|
+
import { DirectiveResult } from 'lit/directive.js';
|
|
3
4
|
|
|
4
5
|
export interface FormatNumberPart {
|
|
5
6
|
type: string;
|
|
@@ -75,7 +76,7 @@ export declare class LocalizeMixinHost {
|
|
|
75
76
|
public onLocaleUpdated(): void;
|
|
76
77
|
public connectedCallback(): void;
|
|
77
78
|
public disconnectedCallback(): void;
|
|
78
|
-
public msgLit(keys: string | string[], variables?: msgVariables, options?: msgOptions):
|
|
79
|
+
public msgLit(keys: string | string[], variables?: msgVariables, options?: msgOptions): string | DirectiveResult;
|
|
79
80
|
|
|
80
81
|
private __boundLocalizeOnLocaleChanged(...args: Object[]): void;
|
|
81
82
|
private __boundLocalizeOnLocaleChanging(...args: Object[]): void;
|
package/custom-elements.json
CHANGED
|
@@ -27177,7 +27177,7 @@
|
|
|
27177
27177
|
"static": true,
|
|
27178
27178
|
"return": {
|
|
27179
27179
|
"type": {
|
|
27180
|
-
"text": "
|
|
27180
|
+
"text": "NamespaceObject[]"
|
|
27181
27181
|
}
|
|
27182
27182
|
}
|
|
27183
27183
|
},
|
|
@@ -27237,7 +27237,7 @@
|
|
|
27237
27237
|
"name": "__getUniqueNamespaces",
|
|
27238
27238
|
"return": {
|
|
27239
27239
|
"type": {
|
|
27240
|
-
"text": "
|
|
27240
|
+
"text": "NamespaceObject[]"
|
|
27241
27241
|
}
|
|
27242
27242
|
},
|
|
27243
27243
|
"privacy": "private"
|
|
@@ -27610,7 +27610,7 @@
|
|
|
27610
27610
|
"privacy": "public",
|
|
27611
27611
|
"return": {
|
|
27612
27612
|
"type": {
|
|
27613
|
-
"text": "
|
|
27613
|
+
"text": "string | DirectiveResult"
|
|
27614
27614
|
}
|
|
27615
27615
|
},
|
|
27616
27616
|
"parameters": [
|
|
@@ -62409,7 +62409,7 @@
|
|
|
62409
62409
|
"name": "msgLit",
|
|
62410
62410
|
"return": {
|
|
62411
62411
|
"type": {
|
|
62412
|
-
"text": "
|
|
62412
|
+
"text": "string | DirectiveResult"
|
|
62413
62413
|
}
|
|
62414
62414
|
},
|
|
62415
62415
|
"parameters": [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LionIcon.d.ts","sourceRoot":"","sources":["../../../../components/icon/src/LionIcon.js"],"names":[],"mappings":"AA6BA;;GAEG;AACH;IACE;QAEI;;;WAGG;;;;QAIH;;;WAGG;;;;;;QAMH;;;WAGG;;;;;QAKH;;WAEG;;;;;;MAON;IAED,+CA6BC;IAIC,aAAiB;IACjB,kBAAmB;IACnB,eAAgB;IAChB;;;OAGG;IACH,cAAoB;IAetB,+CAEC;IAQD;;;;OAIG;IACH,sFAOC;IAED;;OAEG;IACH,mFAEC;IAED,iBAAiB;IACjB,kCAOC;IAED;;;OAGG;IACH,gCAHW,cAAc,iBAAU,QASlC;IAED,iBAAiB;IAEjB,kCAEC;IAED;;;OAGG;IACH,uCAHW,MAAM,
|
|
1
|
+
{"version":3,"file":"LionIcon.d.ts","sourceRoot":"","sources":["../../../../components/icon/src/LionIcon.js"],"names":[],"mappings":"AA6BA;;GAEG;AACH;IACE;QAEI;;;WAGG;;;;QAIH;;;WAGG;;;;;;QAMH;;;WAGG;;;;;QAKH;;WAEG;;;;;;MAON;IAED,+CA6BC;IAIC,aAAiB;IACjB,kBAAmB;IACnB,eAAgB;IAChB;;;OAGG;IACH,cAAoB;IAetB,+CAEC;IAQD;;;;OAIG;IACH,sFAOC;IAED;;OAEG;IACH,mFAEC;IAED,iBAAiB;IACjB,kCAOC;IAED;;;OAGG;IACH,gCAHW,cAAc,iBAAU,QASlC;IAED,iBAAiB;IAEjB,kCAEC;IAED;;;OAGG;IACH,uCAHW,MAAM,iBAyBhB;CACF;6BA9MY,OAAO,KAAK,EAAE,cAAc;0CACZ,oBAAoB,WAAY,MAAM,EAAE,KAAK,MAAM,KAAK,MAAM"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type LocalizeMixin = import('../types/LocalizeMixinTypes.js').LocalizeMixin;
|
|
2
2
|
export const LocalizeMixin: <T extends import("@open-wc/dedupe-mixin").Constructor<import("lit").LitElement>>(superclass: T) => T & import("@open-wc/dedupe-mixin").Constructor<import("../types/LocalizeMixinTypes.js").LocalizeMixinHost> & Pick<typeof import("../types/LocalizeMixinTypes.js").LocalizeMixinHost, "prototype" | "localizeNamespaces" | "waitForLocalizeNamespaces"> & Pick<typeof import("lit").LitElement, "prototype" | "_$litElement$" | "enabledWarnings" | "enableWarning" | "disableWarning" | "addInitializer" | "_initializers" | "elementProperties" | "properties" | "elementStyles" | "styles" | "observedAttributes" | "createProperty" | "getPropertyOptions" | "shadowRootOptions">;
|
|
3
3
|
export type DirectiveResult = import('lit/directive.js').DirectiveResult;
|
|
4
|
+
export type NamespaceObject = import('../types/LocalizeMixinTypes.js').NamespaceObject;
|
|
4
5
|
//# sourceMappingURL=LocalizeMixin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalizeMixin.d.ts","sourceRoot":"","sources":["../../../../components/localize/src/LocalizeMixin.js"],"names":[],"mappings":"4BAOa,OAAO,gCAAgC,EAAE,aAAa;
|
|
1
|
+
{"version":3,"file":"LocalizeMixin.d.ts","sourceRoot":"","sources":["../../../../components/localize/src/LocalizeMixin.js"],"names":[],"mappings":"4BAOa,OAAO,gCAAgC,EAAE,aAAa;AA8JnE,srBAAsE;8BA/JzD,OAAO,kBAAkB,EAAE,eAAe;8BAE1C,OAAO,gCAAgC,EAAE,eAAe"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Constructor } from '@open-wc/dedupe-mixin';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
|
+
import { DirectiveResult } from 'lit/directive.js';
|
|
3
4
|
export interface FormatNumberPart {
|
|
4
5
|
type: string;
|
|
5
6
|
value: string;
|
|
@@ -51,7 +52,7 @@ export declare class LocalizeMixinHost {
|
|
|
51
52
|
onLocaleUpdated(): void;
|
|
52
53
|
connectedCallback(): void;
|
|
53
54
|
disconnectedCallback(): void;
|
|
54
|
-
msgLit(keys: string | string[], variables?: msgVariables, options?: msgOptions):
|
|
55
|
+
msgLit(keys: string | string[], variables?: msgVariables, options?: msgOptions): string | DirectiveResult;
|
|
55
56
|
private __boundLocalizeOnLocaleChanged;
|
|
56
57
|
private __boundLocalizeOnLocaleChanging;
|
|
57
58
|
private __getUniqueNamespaces;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalizeMixinTypes.d.ts","sourceRoot":"","sources":["../../../../components/localize/types/LocalizeMixinTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"LocalizeMixinTypes.d.ts","sourceRoot":"","sources":["../../../../components/localize/types/LocalizeMixinTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,OAAO,UAAU,+BAA+B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;AAEvE,oBAAY,iBAAiB,GAAG,OAAO,+BAA+B,CAAC;AAGvE,MAAM,CAAC,OAAO,WAAW,iBAAkB,SAAQ,IAAI,CAAC,qBAAqB;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAEzB,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;CACjD;AAED,OAAO,UAAU,iCAAiC,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;AAE3E,oBAAY,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