@lion/ui 0.14.3 → 0.15.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/icons.js +14 -2
- package/components/icon/test/hammer.svg.js +5 -2
- package/components/icon/test/heart.svg.js +5 -2
- package/components/icon/test/lion-icon.test.js +10 -4
- package/components/input-stepper/src/LionInputStepper.js +10 -10
- package/components/localize/src/getLocalizeManager.js +16 -10
- package/components/localize/test/getLocalizeManager.test.js +15 -7
- package/components/localize/test/side-effect-free-entrypoint.test.js +9 -3
- package/components/overlays/src/singleton.js +14 -4
- package/custom-elements.json +55 -13
- package/dist-types/components/icon/src/LionIcon.d.ts +1 -1
- package/dist-types/components/icon/src/LionIcon.d.ts.map +1 -1
- package/dist-types/components/icon/src/icons.d.ts +2 -1
- package/dist-types/components/icon/src/icons.d.ts.map +1 -1
- package/dist-types/components/icon/test/hammer.svg.d.ts +1 -1
- package/dist-types/components/icon/test/hammer.svg.d.ts.map +1 -1
- package/dist-types/components/icon/test/heart.svg.d.ts +1 -1
- package/dist-types/components/icon/test/heart.svg.d.ts.map +1 -1
- package/dist-types/components/input-stepper/src/LionInputStepper.d.ts +4 -4
- package/dist-types/components/input-stepper/src/LionInputStepper.d.ts.map +1 -1
- package/dist-types/components/localize/src/getLocalizeManager.d.ts +2 -58
- package/dist-types/components/localize/src/getLocalizeManager.d.ts.map +1 -1
- package/dist-types/components/localize/test/getLocalizeManager.test.d.ts +4 -1
- package/dist-types/components/localize/test/getLocalizeManager.test.d.ts.map +1 -1
- package/dist-types/components/localize/test/side-effect-free-entrypoint.test.d.ts +4 -0
- package/dist-types/components/localize/test/side-effect-free-entrypoint.test.d.ts.map +1 -1
- package/dist-types/components/overlays/src/singleton.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/form/use-cases.md +2 -2
- 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-file/overview.md +1 -1
- package/docs/components/input-iban/overview.md +2 -2
- package/docs/components/input-range/overview.md +2 -2
- package/docs/components/input-stepper/api-table.md +2 -0
- 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/listbox/use-cases.md +1 -1
- package/docs/components/radio-group/overview.md +3 -3
- package/docs/components/select/use-cases.md +1 -1
- package/docs/components/select-rich/use-cases.md +2 -2
- package/docs/components/tabs/examples.md +1 -1
- package/docs/fundamentals/index.md +4 -4
- 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/rationales/accessibility.md +1 -1
- package/docs/fundamentals/systems/core/SlotMixin.md +1 -1
- 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 +2 -2
- package/docs/fundamentals/systems/localize/overview.md +4 -4
- package/docs/fundamentals/systems/overlays/configuration.md +2 -2
- 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/create-a-form.md +4 -4
- 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 +2 -2
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
import { singletonManager } from 'singleton-manager';
|
|
1
|
+
import { singletonManager, lazifyInstantiation } from 'singleton-manager';
|
|
2
2
|
import { IconManager } from './IconManager.js';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @returns {IconManager}
|
|
6
|
+
*/
|
|
7
|
+
function getIconManager() {
|
|
8
|
+
if (!singletonManager.has('@lion/ui::icons::0.x')) {
|
|
9
|
+
const iconManager = new IconManager();
|
|
10
|
+
singletonManager.set('@lion/ui::icons::0.x', iconManager);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return singletonManager.get('@lion/ui::icons::0.x');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const icons = lazifyInstantiation(getIconManager);
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
export default /** @type {import("lit").TemplateResult} */ (
|
|
3
|
+
tag =>
|
|
4
|
+
tag`<svg focusable="false" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" data-test-id="svg-hammer"><path d="M.476 12.915L6.7 6 9 8.556l-6.223 6.915a1.542 1.542 0 0 1-1.15.529 1.54 1.54 0 0 1-1.15-.53c-.636-.706-.636-1.85 0-2.555zm12.638-9.031L16 6.863 12.866 10 4 .919 9.35 0l1.912 1.972.251-.251c.52-.52 2.4 1.363 1.88 1.882l-.279.28z"></path></svg>`
|
|
5
|
+
);
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
export default /** @type {import("lit").TemplateResult} */ (
|
|
3
|
+
tag =>
|
|
4
|
+
tag`<svg focusable="false" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" data-test-id="svg-heart"><path d="M8.002 14.867a.828.828 0 0 1-.324-.066C7.36 14.665 0 11.466 0 6.153 0 3.592 1.543.825 4.98 1.01c1.465.077 2.437.828 3.018 1.491.581-.667 1.553-1.414 3.023-1.491.107-.008.207-.008.31-.008C13.58 1.001 16 2.614 16 6.153c0 5.313-7.36 8.512-7.671 8.644a.787.787 0 0 1-.327.07z"></path></svg>`
|
|
5
|
+
);
|
|
@@ -183,13 +183,19 @@ describe('lion-icon', () => {
|
|
|
183
183
|
try {
|
|
184
184
|
icons.addIconResolver(
|
|
185
185
|
'foo',
|
|
186
|
-
|
|
187
|
-
|
|
186
|
+
() =>
|
|
187
|
+
/** @type {Promise<TemplateResult>} */ (
|
|
188
|
+
// eslint-disable-next-line no-promise-executor-return
|
|
189
|
+
new Promise(resolve => setTimeout(() => resolve(heartSvg)))
|
|
190
|
+
),
|
|
188
191
|
);
|
|
189
192
|
icons.addIconResolver(
|
|
190
193
|
'bar',
|
|
191
|
-
|
|
192
|
-
|
|
194
|
+
() =>
|
|
195
|
+
/** @type {Promise<TemplateResult>} */ (
|
|
196
|
+
// eslint-disable-next-line no-promise-executor-return
|
|
197
|
+
new Promise(resolve => setTimeout(() => resolve(hammerSvg)))
|
|
198
|
+
),
|
|
193
199
|
);
|
|
194
200
|
const el = await fixture(html`<lion-icon icon-id="foo:lorem:ipsum"></lion-icon>`);
|
|
195
201
|
|
|
@@ -94,8 +94,8 @@ export class LionInputStepper extends LocalizeMixin(LionInput) {
|
|
|
94
94
|
step: this.step,
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
-
this.
|
|
98
|
-
this.
|
|
97
|
+
this._increment = this._increment.bind(this);
|
|
98
|
+
this._decrement = this._decrement.bind(this);
|
|
99
99
|
this._onEnterButton = this._onEnterButton.bind(this);
|
|
100
100
|
this._onLeaveButton = this._onLeaveButton.bind(this);
|
|
101
101
|
}
|
|
@@ -192,11 +192,11 @@ export class LionInputStepper extends LocalizeMixin(LionInput) {
|
|
|
192
192
|
*/
|
|
193
193
|
__keyDownHandler(ev) {
|
|
194
194
|
if (ev.key === 'ArrowUp') {
|
|
195
|
-
this.
|
|
195
|
+
this._increment();
|
|
196
196
|
}
|
|
197
197
|
|
|
198
198
|
if (ev.key === 'ArrowDown') {
|
|
199
|
-
this.
|
|
199
|
+
this._decrement();
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
|
|
@@ -262,9 +262,9 @@ export class LionInputStepper extends LocalizeMixin(LionInput) {
|
|
|
262
262
|
|
|
263
263
|
/**
|
|
264
264
|
* Increment the value based on given step or default step value is 1
|
|
265
|
-
* @
|
|
265
|
+
* @protected
|
|
266
266
|
*/
|
|
267
|
-
|
|
267
|
+
_increment() {
|
|
268
268
|
const { step, min, max } = this.values;
|
|
269
269
|
const stepMin = min !== Infinity ? min : 0;
|
|
270
270
|
|
|
@@ -284,9 +284,9 @@ export class LionInputStepper extends LocalizeMixin(LionInput) {
|
|
|
284
284
|
|
|
285
285
|
/**
|
|
286
286
|
* Decrement the value based on given step or default step value is 1
|
|
287
|
-
* @
|
|
287
|
+
* @protected
|
|
288
288
|
*/
|
|
289
|
-
|
|
289
|
+
_decrement() {
|
|
290
290
|
const { step, max, min } = this.values;
|
|
291
291
|
const stepMin = min !== Infinity ? min : 0;
|
|
292
292
|
|
|
@@ -379,7 +379,7 @@ export class LionInputStepper extends LocalizeMixin(LionInput) {
|
|
|
379
379
|
return html`
|
|
380
380
|
<button
|
|
381
381
|
?disabled=${this.disabled || this.readOnly}
|
|
382
|
-
@click=${this.
|
|
382
|
+
@click=${this._decrement}
|
|
383
383
|
@focus=${this._onEnterButton}
|
|
384
384
|
@blur=${this._onLeaveButton}
|
|
385
385
|
type="button"
|
|
@@ -399,7 +399,7 @@ export class LionInputStepper extends LocalizeMixin(LionInput) {
|
|
|
399
399
|
return html`
|
|
400
400
|
<button
|
|
401
401
|
?disabled=${this.disabled || this.readOnly}
|
|
402
|
-
@click=${this.
|
|
402
|
+
@click=${this._increment}
|
|
403
403
|
@focus=${this._onEnterButton}
|
|
404
404
|
@blur=${this._onLeaveButton}
|
|
405
405
|
type="button"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
|
-
import { singletonManager } from 'singleton-manager';
|
|
2
|
+
import { singletonManager, lazifyInstantiation } from 'singleton-manager';
|
|
3
3
|
import { LocalizeManager } from './LocalizeManager.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -57,18 +57,24 @@ import { LocalizeManager } from './LocalizeManager.js';
|
|
|
57
57
|
* }
|
|
58
58
|
* ```
|
|
59
59
|
*
|
|
60
|
+
* @deprecated Use `localize` directly instead (as this is always side-effect free now)
|
|
61
|
+
*
|
|
60
62
|
* @returns {LocalizeManager}
|
|
61
63
|
*/
|
|
62
|
-
|
|
63
|
-
if (singletonManager.has('@lion/ui::localize::0.x')) {
|
|
64
|
-
|
|
64
|
+
function getLocalizeManager() {
|
|
65
|
+
if (!singletonManager.has('@lion/ui::localize::0.x')) {
|
|
66
|
+
const localizeManager = new LocalizeManager({
|
|
67
|
+
autoLoadOnLocaleChange: true,
|
|
68
|
+
fallbackLocale: 'en-GB',
|
|
69
|
+
});
|
|
70
|
+
singletonManager.set('@lion/ui::localize::0.x', localizeManager);
|
|
65
71
|
}
|
|
66
72
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
fallbackLocale: 'en-GB',
|
|
70
|
-
});
|
|
71
|
-
singletonManager.set('@lion/ui::localize::0.x', localizeManager);
|
|
73
|
+
return singletonManager.get('@lion/ui::localize::0.x');
|
|
74
|
+
}
|
|
72
75
|
|
|
73
|
-
|
|
76
|
+
function getLocalizeManagerLazily() {
|
|
77
|
+
return lazifyInstantiation(getLocalizeManager);
|
|
74
78
|
}
|
|
79
|
+
|
|
80
|
+
export { getLocalizeManagerLazily as getLocalizeManager };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { expect } from '@open-wc/testing';
|
|
2
|
+
import { getLocalizeManager } from '@lion/ui/localize-no-side-effects.js';
|
|
2
3
|
// @ts-ignore
|
|
3
4
|
import { singletonManager } from 'singleton-manager';
|
|
4
5
|
import { LocalizeManager } from '../src/LocalizeManager.js';
|
|
5
|
-
|
|
6
|
+
|
|
7
|
+
/** @typedef {LocalizeManager & { __instance_for_testing?: LocalizeManager }} LocalizeManagerForTesting */
|
|
6
8
|
|
|
7
9
|
describe('getLocalizeManager', () => {
|
|
8
10
|
beforeEach(() => {
|
|
@@ -12,20 +14,26 @@ describe('getLocalizeManager', () => {
|
|
|
12
14
|
|
|
13
15
|
it('gets a default instance when nothing registered on singletonManager with "@lion/ui::localize::0.x"', () => {
|
|
14
16
|
expect(singletonManager.get('@lion/ui::localize::0.x')).to.be.undefined;
|
|
15
|
-
const localizeManager = getLocalizeManager();
|
|
16
|
-
expect(localizeManager).to.equal(
|
|
17
|
+
const /** @type {LocalizeManagerForTesting} */ localizeManager = getLocalizeManager();
|
|
18
|
+
expect(localizeManager.__instance_for_testing).to.equal(
|
|
19
|
+
singletonManager.get('@lion/ui::localize::0.x'),
|
|
20
|
+
);
|
|
17
21
|
});
|
|
18
22
|
|
|
19
23
|
it('gets the same instance when called multiple times', () => {
|
|
20
|
-
const localizeManager = getLocalizeManager();
|
|
21
|
-
const localizeManagerSecondCall = getLocalizeManager();
|
|
22
|
-
expect(localizeManager).to.
|
|
24
|
+
const /** @type {LocalizeManagerForTesting} */ localizeManager = getLocalizeManager();
|
|
25
|
+
const /** @type {LocalizeManagerForTesting} */ localizeManagerSecondCall = getLocalizeManager();
|
|
26
|
+
expect(localizeManager.__instance_for_testing).not.to.be.undefined;
|
|
27
|
+
expect(localizeManager.__instance_for_testing).to.equal(
|
|
28
|
+
localizeManagerSecondCall.__instance_for_testing,
|
|
29
|
+
);
|
|
23
30
|
});
|
|
24
31
|
|
|
25
32
|
it('gets the instance that was registered on singletonManager with "@lion/ui::localize::0.x"', () => {
|
|
26
33
|
// Set your own for custom behavior or for deduping purposes
|
|
27
34
|
class MyLocalizeManager extends LocalizeManager {}
|
|
28
35
|
singletonManager.set('@lion/ui::localize::0.x', MyLocalizeManager);
|
|
29
|
-
|
|
36
|
+
const /** @type {LocalizeManagerForTesting} */ localizeManager = getLocalizeManager();
|
|
37
|
+
expect(localizeManager.__instance_for_testing).to.equal(MyLocalizeManager);
|
|
30
38
|
});
|
|
31
39
|
});
|
|
@@ -5,6 +5,7 @@ import { singletonManager } from 'singleton-manager';
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @typedef {import('../types/LocalizeMixinTypes.js').LocalizeMixin} LocalizeMixinHost
|
|
8
|
+
* @typedef {import('../../validate-messages/src/getLocalizedMessage.js').LocalizeManager & { __instance_for_testing?: import('../../validate-messages/src/getLocalizedMessage.js').LocalizeManager, aCallToRegisterLazilyLoadedInstance?: () => void }} LocalizeManagerForTesting
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
11
|
describe('Entrypoints localize', () => {
|
|
@@ -24,15 +25,20 @@ describe('Entrypoints localize', () => {
|
|
|
24
25
|
});
|
|
25
26
|
|
|
26
27
|
it('"@lion/ui/localize.js" has side effects (c.q. registers itself on singletonManager)', async () => {
|
|
27
|
-
await import(
|
|
28
|
+
const /** @type {{ localize: LocalizeManagerForTesting }} */ { localize } = await import(
|
|
29
|
+
'@lion/ui/localize.js'
|
|
30
|
+
);
|
|
31
|
+
localize.aCallToRegisterLazilyLoadedInstance?.();
|
|
28
32
|
|
|
29
33
|
expect(singletonManagerSetSpy).to.have.been.calledOnce;
|
|
30
34
|
|
|
31
|
-
const { getLocalizeManager }
|
|
35
|
+
const /** @type {{ getLocalizeManager: () => LocalizeManagerForTesting }} */ {
|
|
36
|
+
getLocalizeManager,
|
|
37
|
+
} = await import('@lion/ui/localize-no-side-effects.js');
|
|
32
38
|
|
|
33
39
|
expect(singletonManagerSetSpy).to.have.been.calledWith(
|
|
34
40
|
'@lion/ui::localize::0.x',
|
|
35
|
-
getLocalizeManager(),
|
|
41
|
+
getLocalizeManager().__instance_for_testing,
|
|
36
42
|
);
|
|
37
43
|
});
|
|
38
44
|
});
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
import { singletonManager } from 'singleton-manager';
|
|
1
|
+
import { singletonManager, lazifyInstantiation } from 'singleton-manager';
|
|
2
2
|
import { OverlaysManager } from './OverlaysManager.js';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @returns {OverlaysManager}
|
|
6
|
+
*/
|
|
7
|
+
function getOverlaysManager() {
|
|
8
|
+
if (!singletonManager.has('@lion/ui::overlays::0.x')) {
|
|
9
|
+
const overlaysManager = new OverlaysManager();
|
|
10
|
+
singletonManager.set('@lion/ui::overlays::0.x', overlaysManager);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return singletonManager.get('@lion/ui::overlays::0.x');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const overlays = lazifyInstantiation(getOverlaysManager);
|
package/custom-elements.json
CHANGED
|
@@ -98245,6 +98245,12 @@
|
|
|
98245
98245
|
"module": "components/form-core/src/LionField.js"
|
|
98246
98246
|
}
|
|
98247
98247
|
},
|
|
98248
|
+
{
|
|
98249
|
+
"kind": "method",
|
|
98250
|
+
"name": "_decrement",
|
|
98251
|
+
"description": "Decrement the value based on given step or default step value is 1",
|
|
98252
|
+
"privacy": "protected"
|
|
98253
|
+
},
|
|
98248
98254
|
{
|
|
98249
98255
|
"kind": "method",
|
|
98250
98256
|
"name": "_decrementorSignTemplate",
|
|
@@ -98467,6 +98473,12 @@
|
|
|
98467
98473
|
"module": "components/form-core/src/LionField.js"
|
|
98468
98474
|
}
|
|
98469
98475
|
},
|
|
98476
|
+
{
|
|
98477
|
+
"kind": "method",
|
|
98478
|
+
"name": "_increment",
|
|
98479
|
+
"description": "Increment the value based on given step or default step value is 1",
|
|
98480
|
+
"privacy": "protected"
|
|
98481
|
+
},
|
|
98470
98482
|
{
|
|
98471
98483
|
"kind": "method",
|
|
98472
98484
|
"name": "_incrementorSignTemplate",
|
|
@@ -99183,12 +99195,6 @@
|
|
|
99183
99195
|
"module": "components/form-core/src/LionField.js"
|
|
99184
99196
|
}
|
|
99185
99197
|
},
|
|
99186
|
-
{
|
|
99187
|
-
"kind": "method",
|
|
99188
|
-
"name": "__decrement",
|
|
99189
|
-
"description": "Decrement the value based on given step or default step value is 1",
|
|
99190
|
-
"privacy": "private"
|
|
99191
|
-
},
|
|
99192
99198
|
{
|
|
99193
99199
|
"kind": "method",
|
|
99194
99200
|
"name": "__delegateReadOnly",
|
|
@@ -99400,12 +99406,6 @@
|
|
|
99400
99406
|
"module": "components/form-core/src/LionField.js"
|
|
99401
99407
|
}
|
|
99402
99408
|
},
|
|
99403
|
-
{
|
|
99404
|
-
"kind": "method",
|
|
99405
|
-
"name": "__increment",
|
|
99406
|
-
"description": "Increment the value based on given step or default step value is 1",
|
|
99407
|
-
"privacy": "private"
|
|
99408
|
-
},
|
|
99409
99409
|
{
|
|
99410
99410
|
"kind": "method",
|
|
99411
99411
|
"name": "__initSlots",
|
|
@@ -120038,11 +120038,16 @@
|
|
|
120038
120038
|
"kind": "function",
|
|
120039
120039
|
"name": "getLocalizeManager",
|
|
120040
120040
|
"description": "Side-effect-free alternative for `localize` (the globally shared instance of LocalizeManager).\nWhen this function is imported, no side-effect happened yet, i.e. no global instance was registered yet.\nThe side effect-free approach generates:\n- smaller, optimized bundles\n- a predictable loading order, that allows for:\n - deduping strategies when multiple instances of the localizeManager are on a page\n - providing a customized extension of LocalizeManager\n\nUse it like this:\n\n```js\nfunction myFunction() {\n // note that 'localizeManager' is the same as former 'localize'\n const localizeManager = getLocalizeManger();\n // ...\n}\n```\n\nIn a class, we advise a shared instance:\n```js\nclass MyClass {\n constructor() {\n this._localizeManager = getLocalizeManger();\n }\n // ...\n}\n```\n\nMake sure to always call this method inside a function or class (otherwise side effects are created)\n\nDo you want to register your own LocalizeManager?\nMake sure it's registered before anyone called `getLocalizeManager()`\n\n```js\nimport { singletonManager } from 'singleton-manager';\nimport { getLocalizeManger } from '@lion/ui/localize-no-side-effects.js';\n\n// First register your own LocalizeManager (for deduping or other reasons)\nsingletonManager.set('lion/ui::localize::0.x', class MyLocalizeManager extends LocalizeManager {});\n\n// Now, all your code gets the right instance\nfunction myFuntion() {\n const localizeManager = getLocalizeManager();\n // ...\n}\n\nclass myClass() {\n constructor() {\n this._localizeManager = getLocalizeManager();\n // ...\n }\n}\n```",
|
|
120041
|
+
"deprecated": "Use `localize` directly instead (as this is always side-effect free now)",
|
|
120041
120042
|
"return": {
|
|
120042
120043
|
"type": {
|
|
120043
120044
|
"text": "LocalizeManager"
|
|
120044
120045
|
}
|
|
120045
120046
|
}
|
|
120047
|
+
},
|
|
120048
|
+
{
|
|
120049
|
+
"kind": "function",
|
|
120050
|
+
"name": "getLocalizeManagerLazily"
|
|
120046
120051
|
}
|
|
120047
120052
|
],
|
|
120048
120053
|
"exports": [
|
|
@@ -120050,7 +120055,7 @@
|
|
|
120050
120055
|
"kind": "js",
|
|
120051
120056
|
"name": "getLocalizeManager",
|
|
120052
120057
|
"declaration": {
|
|
120053
|
-
"name": "
|
|
120058
|
+
"name": "getLocalizeManagerLazily",
|
|
120054
120059
|
"module": "components/localize/src/getLocalizeManager.js"
|
|
120055
120060
|
}
|
|
120056
120061
|
}
|
|
@@ -149469,6 +149474,14 @@
|
|
|
149469
149474
|
}
|
|
149470
149475
|
],
|
|
149471
149476
|
"exports": [
|
|
149477
|
+
{
|
|
149478
|
+
"kind": "js",
|
|
149479
|
+
"name": "lazifyInstantiation",
|
|
149480
|
+
"declaration": {
|
|
149481
|
+
"name": "lazifyInstantiation",
|
|
149482
|
+
"module": "./lazifyInstantiation.js"
|
|
149483
|
+
}
|
|
149484
|
+
},
|
|
149472
149485
|
{
|
|
149473
149486
|
"kind": "js",
|
|
149474
149487
|
"name": "SingletonManagerClass",
|
|
@@ -153148,6 +153161,35 @@
|
|
|
153148
153161
|
}
|
|
153149
153162
|
]
|
|
153150
153163
|
},
|
|
153164
|
+
{
|
|
153165
|
+
"kind": "javascript-module",
|
|
153166
|
+
"path": "../singleton-manager/src/lazifyInstantiation.js",
|
|
153167
|
+
"declarations": [
|
|
153168
|
+
{
|
|
153169
|
+
"kind": "function",
|
|
153170
|
+
"name": "lazifyInstantiation",
|
|
153171
|
+
"parameters": [
|
|
153172
|
+
{
|
|
153173
|
+
"name": "registerSingleton"
|
|
153174
|
+
}
|
|
153175
|
+
],
|
|
153176
|
+
"description": "Lazifies the instantiation of singletons. It does so by wrapping the singleton in a Proxy, which delays\ninstantiation until one of its members gets called/set for the first time.\nThis is important in cases where a singleton needs to be overridden on an app level:\nlet's say there are two versions of",
|
|
153177
|
+
"type": {
|
|
153178
|
+
"text": "<T>(func: () => T) => T"
|
|
153179
|
+
}
|
|
153180
|
+
}
|
|
153181
|
+
],
|
|
153182
|
+
"exports": [
|
|
153183
|
+
{
|
|
153184
|
+
"kind": "js",
|
|
153185
|
+
"name": "lazifyInstantiation",
|
|
153186
|
+
"declaration": {
|
|
153187
|
+
"name": "lazifyInstantiation",
|
|
153188
|
+
"module": "../singleton-manager/src/lazifyInstantiation.js"
|
|
153189
|
+
}
|
|
153190
|
+
}
|
|
153191
|
+
]
|
|
153192
|
+
},
|
|
153151
153193
|
{
|
|
153152
153194
|
"kind": "javascript-module",
|
|
153153
153195
|
"path": "../../node_modules/lit-html/node/directives/ref.js",
|
|
@@ -62,7 +62,7 @@ export class LionIcon extends LitElement {
|
|
|
62
62
|
*/
|
|
63
63
|
protected _renderSvg(svgObject: TemplateResult | typeof nothing): void;
|
|
64
64
|
/** @protected */
|
|
65
|
-
protected get _iconManager():
|
|
65
|
+
protected get _iconManager(): import("./IconManager.js").IconManager;
|
|
66
66
|
/**
|
|
67
67
|
* @param {string} prevIconId
|
|
68
68
|
* @protected
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LionIcon.d.ts","sourceRoot":"","sources":["../../../../components/icon/src/LionIcon.js"],"names":[],"mappings":"AA6BA;;;;GAIG;AACH;IACE;QAEI;;;WAGG;;;;QAIH;;;WAGG;;;;;;QAMH;;;WAGG;;;;;MAMN;IAED,+CA6BC;IAaD;;;OAGG;IACH,oDAA4F;IAb1F,kBAAmB;IACnB,eAAgB;IAChB;;;OAGG;IACH,cAAoB;IAqBtB,+CAEC;IASD;;;;OAIG;IACH,0FAOC;IAED;;OAEG;IACH,uFAEC;IAED,iBAAiB;IACjB,kCAOC;IAED;;;OAGG;IACH,gCAHW,cAAc,iBAAU,QASlC;IAED,iBAAiB;IAEjB,
|
|
1
|
+
{"version":3,"file":"LionIcon.d.ts","sourceRoot":"","sources":["../../../../components/icon/src/LionIcon.js"],"names":[],"mappings":"AA6BA;;;;GAIG;AACH;IACE;QAEI;;;WAGG;;;;QAIH;;;WAGG;;;;;;QAMH;;;WAGG;;;;;MAMN;IAED,+CA6BC;IAaD;;;OAGG;IACH,oDAA4F;IAb1F,kBAAmB;IACnB,eAAgB;IAChB;;;OAGG;IACH,cAAoB;IAqBtB,+CAEC;IASD;;;;OAIG;IACH,0FAOC;IAED;;OAEG;IACH,uFAEC;IAED,iBAAiB;IACjB,kCAOC;IAED;;;OAGG;IACH,gCAHW,cAAc,iBAAU,QASlC;IAED,iBAAiB;IAEjB,qEAEC;IAED;;;OAGG;IACH,uCAHW,MAAM,iBAyBhB;CACF;6BA9MY,OAAO,KAAK,EAAE,cAAc;0CACZ,oBAAoB,WAAY,MAAM,EAAE,KAAK,MAAM,KAAK,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../../components/icon/src/icons.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../../components/icon/src/icons.js"],"names":[],"mappings":"AAeA,gCAAyD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hammer.svg.d.ts","sourceRoot":"","sources":["../../../../components/icon/test/hammer.svg.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hammer.svg.d.ts","sourceRoot":"","sources":["../../../../components/icon/test/hammer.svg.js"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heart.svg.d.ts","sourceRoot":"","sources":["../../../../components/icon/test/heart.svg.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"heart.svg.d.ts","sourceRoot":"","sources":["../../../../components/icon/test/heart.svg.js"],"names":[],"mappings":""}
|
|
@@ -36,14 +36,14 @@ export class LionInputStepper extends LionInputStepper_base {
|
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
38
|
* Increment the value based on given step or default step value is 1
|
|
39
|
-
* @
|
|
39
|
+
* @protected
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
protected _increment(): void;
|
|
42
42
|
/**
|
|
43
43
|
* Decrement the value based on given step or default step value is 1
|
|
44
|
-
* @
|
|
44
|
+
* @protected
|
|
45
45
|
*/
|
|
46
|
-
|
|
46
|
+
protected _decrement(): void;
|
|
47
47
|
/**
|
|
48
48
|
* @protected
|
|
49
49
|
* @param {Event} ev
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LionInputStepper.d.ts","sourceRoot":"","sources":["../../../../components/input-stepper/src/LionInputStepper.js"],"names":[],"mappings":";AAMA;;GAEG;AAEH;;;;GAIG;AACH;IACE,wFAsBC;IAED,kBAAkB;IAClB,6BAkBC;IAED,kGAGE;IAEF;;OAEG;IACH,2BAEC;IAQC,iCAAiC;IACjC,2BAAyB;IACzB,+BAA6B;IAC7B,YAAmB;IACnB,YAAmB;IACnB;;;OAGG;IACH;;MAA0B;IAC1B,aAAa;IACb;;;;MAIC;IAwKH;;;OAGG;IACH,
|
|
1
|
+
{"version":3,"file":"LionInputStepper.d.ts","sourceRoot":"","sources":["../../../../components/input-stepper/src/LionInputStepper.js"],"names":[],"mappings":";AAMA;;GAEG;AAEH;;;;GAIG;AACH;IACE,wFAsBC;IAED,kBAAkB;IAClB,6BAkBC;IAED,kGAGE;IAEF;;OAEG;IACH,2BAEC;IAQC,iCAAiC;IACjC,2BAAyB;IACzB,+BAA6B;IAC7B,YAAmB;IACnB,YAAmB;IACnB;;;OAGG;IACH;;MAA0B;IAC1B,aAAa;IACb;;;;MAIC;IAwKH;;;OAGG;IACH,6BAgBC;IAED;;;OAGG;IACH,6BAgBC;IA2HD;;;OAGG;IAEH,6BAHW,KAAK,QAQf;IAED;;;;;;;;;;;;OAYG;IAEH,6BAHW,KAAK,QASf;IArWD,0BAeC;IAED,6BAGC;IA0CD;;;;MAMC;IAED;;;OAGG;IACH,+BASC;IAED;;;;OAIG;IACH,yBAQC;IAED;;;OAGG;IACH,oCAeC;IAED;;OAEG;IACH,wCAoBC;IAZK,gCAA2D;IAcjE;;;;;OAKG;IACH,kBAMC;IA8CD;;;;OAIG;IACH,iCAWC;IAED;;;;OAIG;IACH,iCAWC;IAED;;;;OAIG;IACH,qCAGC;IAED;;;;OAIG;IAEH,sCAJa,SAAO,OAAO,KAAK,EAAE,cAAc,CAM/C;IAED;;;;OAIG;IAEH,sCAJa,SAAO,OAAO,KAAK,EAAE,cAAc,CAM/C;IAED;;;;OAIG;IACH,kCAHa,OAAO,KAAK,EAAE,cAAc,CAgBxC;IAED;;;;OAIG;IACH,kCAHa,OAAO,KAAK,EAAE,cAAc,CAgBxC;IAED,iBAAiB;IACjB,sEAYC;CAmCF;4BArcY,OAAO,KAAK,EAAE,aAAa"}
|
|
@@ -1,60 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* When this function is imported, no side-effect happened yet, i.e. no global instance was registered yet.
|
|
4
|
-
* The side effect-free approach generates:
|
|
5
|
-
* - smaller, optimized bundles
|
|
6
|
-
* - a predictable loading order, that allows for:
|
|
7
|
-
* - deduping strategies when multiple instances of the localizeManager are on a page
|
|
8
|
-
* - providing a customized extension of LocalizeManager
|
|
9
|
-
*
|
|
10
|
-
* Use it like this:
|
|
11
|
-
*
|
|
12
|
-
* ```js
|
|
13
|
-
* function myFunction() {
|
|
14
|
-
* // note that 'localizeManager' is the same as former 'localize'
|
|
15
|
-
* const localizeManager = getLocalizeManger();
|
|
16
|
-
* // ...
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* In a class, we advise a shared instance:
|
|
21
|
-
* ```js
|
|
22
|
-
* class MyClass {
|
|
23
|
-
* constructor() {
|
|
24
|
-
* this._localizeManager = getLocalizeManger();
|
|
25
|
-
* }
|
|
26
|
-
* // ...
|
|
27
|
-
* }
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* Make sure to always call this method inside a function or class (otherwise side effects are created)
|
|
31
|
-
*
|
|
32
|
-
* Do you want to register your own LocalizeManager?
|
|
33
|
-
* Make sure it's registered before anyone called `getLocalizeManager()`
|
|
34
|
-
*
|
|
35
|
-
* ```js
|
|
36
|
-
* import { singletonManager } from 'singleton-manager';
|
|
37
|
-
* import { getLocalizeManger } from '@lion/ui/localize-no-side-effects.js';
|
|
38
|
-
*
|
|
39
|
-
* // First register your own LocalizeManager (for deduping or other reasons)
|
|
40
|
-
* singletonManager.set('lion/ui::localize::0.x', class MyLocalizeManager extends LocalizeManager {});
|
|
41
|
-
*
|
|
42
|
-
* // Now, all your code gets the right instance
|
|
43
|
-
* function myFuntion() {
|
|
44
|
-
* const localizeManager = getLocalizeManager();
|
|
45
|
-
* // ...
|
|
46
|
-
* }
|
|
47
|
-
*
|
|
48
|
-
* class myClass() {
|
|
49
|
-
* constructor() {
|
|
50
|
-
* this._localizeManager = getLocalizeManager();
|
|
51
|
-
* // ...
|
|
52
|
-
* }
|
|
53
|
-
* }
|
|
54
|
-
* ```
|
|
55
|
-
*
|
|
56
|
-
* @returns {LocalizeManager}
|
|
57
|
-
*/
|
|
58
|
-
export function getLocalizeManager(): LocalizeManager;
|
|
1
|
+
export { getLocalizeManagerLazily as getLocalizeManager };
|
|
2
|
+
declare function getLocalizeManagerLazily(): LocalizeManager;
|
|
59
3
|
import { LocalizeManager } from "./LocalizeManager.js";
|
|
60
4
|
//# sourceMappingURL=getLocalizeManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocalizeManager.d.ts","sourceRoot":"","sources":["../../../../components/localize/src/getLocalizeManager.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getLocalizeManager.d.ts","sourceRoot":"","sources":["../../../../components/localize/src/getLocalizeManager.js"],"names":[],"mappings":";AA2EA,6DAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocalizeManager.test.d.ts","sourceRoot":"","sources":["../../../../components/localize/test/getLocalizeManager.test.js"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"getLocalizeManager.test.d.ts","sourceRoot":"","sources":["../../../../components/localize/test/getLocalizeManager.test.js"],"names":[],"mappings":"wCAMc,eAAe,GAAG;IAAE,sBAAsB,CAAC,EAAE,eAAe,CAAA;CAAE"}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export type LocalizeMixinHost = import('../types/LocalizeMixinTypes.js').LocalizeMixin;
|
|
2
|
+
export type LocalizeManagerForTesting = import('../../validate-messages/src/getLocalizedMessage.js').LocalizeManager & {
|
|
3
|
+
__instance_for_testing?: import('../../validate-messages/src/getLocalizedMessage.js').LocalizeManager;
|
|
4
|
+
aCallToRegisterLazilyLoadedInstance?: () => void;
|
|
5
|
+
};
|
|
2
6
|
//# sourceMappingURL=side-effect-free-entrypoint.test.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"side-effect-free-entrypoint.test.d.ts","sourceRoot":"","sources":["../../../../components/localize/test/side-effect-free-entrypoint.test.js"],"names":[],"mappings":"gCAMa,OAAO,gCAAgC,EAAE,aAAa"}
|
|
1
|
+
{"version":3,"file":"side-effect-free-entrypoint.test.d.ts","sourceRoot":"","sources":["../../../../components/localize/test/side-effect-free-entrypoint.test.js"],"names":[],"mappings":"gCAMa,OAAO,gCAAgC,EAAE,aAAa;wCACtD,OAAO,oDAAoD,EAAE,eAAe,GAAG;IAAE,sBAAsB,CAAC,EAAE,OAAO,oDAAoD,EAAE,eAAe,CAAC;IAAC,mCAAmC,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"singleton.d.ts","sourceRoot":"","sources":["../../../../components/overlays/src/singleton.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"singleton.d.ts","sourceRoot":"","sources":["../../../../components/overlays/src/singleton.js"],"names":[],"mappings":"AAeA,uCAAgE"}
|