@lion/ui 0.6.0-alpha.0 → 0.6.0-alpha.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/components/core/src/ScopedElementsMixin.js +146 -0
- package/components/core/test/SlotMixin.test.js +9 -9
- package/components/form-core/src/validate/ValidateMixin.js +1 -1
- package/components/form-core/types/validate/ValidateMixinTypes.ts +14 -1
- package/components/input-datepicker/src/LionInputDatepicker.js +1 -1
- package/components/input-file/src/LionInputFile.js +1 -1
- package/components/input-file/src/LionSelectedFileList.js +1 -1
- package/components/input-tel-dropdown/test/LionInputTelDropdown.test.js +2 -1
- package/components/listbox/src/ListboxMixin.js +1 -1
- package/components/overlays/test/local-positioning.test.js +4 -2
- package/components/select-rich/src/LionSelectRich.js +1 -1
- package/components/switch/src/LionSwitch.js +1 -1
- package/components/textarea/test/lion-textarea.test.js +4 -2
- package/components/validate-messages/translations/fr.js +2 -2
- package/custom-elements.json +1949 -7
- package/dist-types/components/core/src/ScopedElementsMixin.d.ts +364 -0
- package/dist-types/components/core/src/ScopedElementsMixin.d.ts.map +1 -0
- package/dist-types/components/form-core/src/LionField.d.ts +1 -1
- package/dist-types/components/form-core/types/validate/ValidateMixinTypes.d.ts +13 -1
- package/dist-types/components/form-core/types/validate/ValidateMixinTypes.d.ts.map +1 -1
- package/dist-types/components/input-datepicker/src/LionInputDatepicker.d.ts +356 -1
- package/dist-types/components/input-datepicker/src/LionInputDatepicker.d.ts.map +1 -1
- package/dist-types/components/input-file/src/LionInputFile.d.ts +349 -1
- package/dist-types/components/input-file/src/LionInputFile.d.ts.map +1 -1
- package/dist-types/components/input-file/src/LionSelectedFileList.d.ts +345 -1
- package/dist-types/components/input-file/src/LionSelectedFileList.d.ts.map +1 -1
- package/dist-types/components/listbox/src/LionListbox.d.ts +1 -1
- package/dist-types/components/select-rich/src/LionSelectRich.d.ts +345 -1
- package/dist-types/components/select-rich/src/LionSelectRich.d.ts.map +1 -1
- package/dist-types/components/switch/src/LionSwitch.d.ts +348 -2
- package/dist-types/components/switch/src/LionSwitch.d.ts.map +1 -1
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/accordion/overview.md +2 -2
- 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-file/overview.md +1 -1
- package/docs/components/input-file/use-cases.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/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/input-tel-dropdown/src/intl-input-tel-dropdown.js +1 -1
- package/docs/components/radio-group/overview.md +3 -3
- package/docs/components/select-rich/use-cases.md +1 -1
- package/docs/components/switch/overview.md +2 -2
- 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/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 +1 -1
- package/docs/fundamentals/systems/localize/overview.md +4 -4
- package/docs/fundamentals/systems/overlays/assets/demo-el-using-overlaymixin.mjs +2 -1
- 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/scoped-elements.md +4 -3
- package/docs/guides/principles/styling.md +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is combination of '@open-wc/scoped-elements@v3/lit-element.js' and '@open-wc/scoped-elements@v3/html-element.js'.
|
|
3
|
+
* Then on top of those, some code from '@open-wc/scoped-elements@v2' is brought to to make polyfill not mandatory.
|
|
4
|
+
*
|
|
5
|
+
* ## Considerations
|
|
6
|
+
* In its current state, the [scoped-custom-element-registry](https://github.com/webcomponents/polyfills/tree/master/packages/scoped-custom-element-registry) draft spec has uncertainties:
|
|
7
|
+
* - the spec is not yet final; it's not clear how long it will be dependent on a polyfill
|
|
8
|
+
* - the polyfill conflicts with new browser functionality (form-associated custom elements in Safari, ShadowRoot.createElement in Chrome Canary, etc.).
|
|
9
|
+
* - the spsc is not compatible with SSR and it remains unclear if it will be in the future
|
|
10
|
+
*
|
|
11
|
+
* Also see: https://github.com/webcomponents/polyfills/issues?q=scoped-custom-element-registry
|
|
12
|
+
*
|
|
13
|
+
* In previous considerations (last year), we betted on the spec to evolve quickly and the polyfill to be stable.
|
|
14
|
+
* Till this day, little progress has been made. In the meantime. @lit-labs/ssr (incompatible with the spec) is released as well.
|
|
15
|
+
*
|
|
16
|
+
* This file aims to achieve two things:
|
|
17
|
+
* = being up to date with the latest version of @open-wc/scoped-elements (v3)
|
|
18
|
+
* - make the impact of this change for lion as minimal as possible
|
|
19
|
+
*
|
|
20
|
+
* In order to achieve the latter, we keep the ability to opt out of the polyfill.
|
|
21
|
+
* This can be beneficial for performance, bundle size, ease of use and SSR capabilities.
|
|
22
|
+
*
|
|
23
|
+
* We will keep a close eye on developments in spec and polyfill, and will re-evaluate the scoped-elements approach when the time is right.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import { dedupeMixin } from '@open-wc/dedupe-mixin';
|
|
27
|
+
import { adoptStyles } from 'lit';
|
|
28
|
+
import { ScopedElementsMixin as OpenWcLitScopedElementsMixin } from '@open-wc/scoped-elements/lit-element.js';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @typedef {import('@open-wc/scoped-elements/lit-element.js').ScopedElementsHost} ScopedElementsHost
|
|
32
|
+
* @typedef {import('../../form-core/types/validate/ValidateMixinTypes.js').ScopedElementsMap} ScopedElementsMap
|
|
33
|
+
* @typedef {import('lit').CSSResultOrNative} CSSResultOrNative
|
|
34
|
+
* @typedef {import('lit').LitElement} LitElement
|
|
35
|
+
* @typedef {typeof import('lit').LitElement} TypeofLitElement
|
|
36
|
+
* @typedef {import('@open-wc/dedupe-mixin').Constructor<LitElement>} LitElementConstructor
|
|
37
|
+
* @typedef {import('@open-wc/dedupe-mixin').Constructor<ScopedElementsHost>} ScopedElementsHostConstructor
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
const supportsScopedRegistry = Boolean(
|
|
41
|
+
// @ts-expect-error
|
|
42
|
+
ShadowRoot.prototype.createElement && ShadowRoot.prototype.importNode,
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @template {LitElementConstructor} T
|
|
47
|
+
* @param {T} superclass
|
|
48
|
+
*/
|
|
49
|
+
const ScopedElementsMixinImplementation = superclass =>
|
|
50
|
+
/** @type {ScopedElementsHost} */
|
|
51
|
+
class ScopedElementsHost extends OpenWcLitScopedElementsMixin(superclass) {
|
|
52
|
+
createScopedElement(/** @type {string} */ tagName) {
|
|
53
|
+
const root = supportsScopedRegistry ? this.shadowRoot : document;
|
|
54
|
+
// @ts-expect-error polyfill to support createElement on shadowRoot is loaded
|
|
55
|
+
return root.createElement(tagName);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Defines a scoped element.
|
|
60
|
+
*
|
|
61
|
+
* @param {string} tagName
|
|
62
|
+
* @param {typeof HTMLElement} klass
|
|
63
|
+
*/
|
|
64
|
+
defineScopedElement(tagName, klass) {
|
|
65
|
+
// @ts-ignore
|
|
66
|
+
const registeredClass = this.registry.get(tagName);
|
|
67
|
+
if (registeredClass && supportsScopedRegistry === false && registeredClass !== klass) {
|
|
68
|
+
// eslint-disable-next-line no-console
|
|
69
|
+
console.error(
|
|
70
|
+
[
|
|
71
|
+
`You are trying to re-register the "${tagName}" custom element with a different class via ScopedElementsMixin.`,
|
|
72
|
+
'This is only possible with a CustomElementRegistry.',
|
|
73
|
+
'Your browser does not support this feature so you will need to load a polyfill for it.',
|
|
74
|
+
'Load "@webcomponents/scoped-custom-element-registry" before you register ANY web component to the global customElements registry.',
|
|
75
|
+
'e.g. add "<script src="/node_modules/@webcomponents/scoped-custom-element-registry/scoped-custom-element-registry.min.js"></script>" as your first script tag.',
|
|
76
|
+
'For more details you can visit https://open-wc.org/docs/development/scoped-elements/',
|
|
77
|
+
].join('\n'),
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
if (!registeredClass) {
|
|
81
|
+
// @ts-ignore
|
|
82
|
+
return this.registry.define(tagName, klass);
|
|
83
|
+
}
|
|
84
|
+
// @ts-ignore
|
|
85
|
+
return this.registry.get(tagName);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @param {ShadowRootInit} options
|
|
90
|
+
* @returns {ShadowRoot}
|
|
91
|
+
*/
|
|
92
|
+
attachShadow(options) {
|
|
93
|
+
// @ts-ignore
|
|
94
|
+
const { scopedElements } = /** @type {typeof ScopedElementsHost} */ (this.constructor);
|
|
95
|
+
|
|
96
|
+
const shouldCreateRegistry =
|
|
97
|
+
!this.registry ||
|
|
98
|
+
// @ts-ignore
|
|
99
|
+
(this.registry === this.constructor.__registry &&
|
|
100
|
+
!Object.prototype.hasOwnProperty.call(this.constructor, '__registry'));
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Create a new registry if:
|
|
104
|
+
* - the registry is not defined
|
|
105
|
+
* - this class doesn't have its own registry *AND* has no shared registry
|
|
106
|
+
* This is important specifically for superclasses/inheritance
|
|
107
|
+
*/
|
|
108
|
+
if (shouldCreateRegistry) {
|
|
109
|
+
// @ts-ignore
|
|
110
|
+
this.registry = supportsScopedRegistry ? new CustomElementRegistry() : customElements;
|
|
111
|
+
for (const [tagName, klass] of Object.entries(scopedElements ?? {})) {
|
|
112
|
+
this.defineScopedElement(tagName, klass);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return Element.prototype.attachShadow.call(this, {
|
|
117
|
+
...options,
|
|
118
|
+
// The polyfill currently expects the registry to be passed as `customElements`
|
|
119
|
+
customElements: this.registry,
|
|
120
|
+
// But the proposal has moved forward, and renamed it to `registry`
|
|
121
|
+
// For backwards compatibility, we pass it as both
|
|
122
|
+
registry: this.registry,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
createRenderRoot() {
|
|
127
|
+
const { shadowRootOptions, elementStyles } = /** @type {TypeofLitElement} */ (
|
|
128
|
+
this.constructor
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
const createdRoot = this.attachShadow(shadowRootOptions);
|
|
132
|
+
if (supportsScopedRegistry) {
|
|
133
|
+
// @ts-expect-error
|
|
134
|
+
this.renderOptions.creationScope = createdRoot;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (createdRoot instanceof ShadowRoot) {
|
|
138
|
+
adoptStyles(createdRoot, elementStyles);
|
|
139
|
+
this.renderOptions.renderBefore = this.renderOptions.renderBefore || createdRoot.firstChild;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return createdRoot;
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export const ScopedElementsMixin = dedupeMixin(ScopedElementsMixinImplementation);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import sinon from 'sinon';
|
|
2
2
|
import { defineCE, expect, fixture, unsafeStatic, html } from '@open-wc/testing';
|
|
3
|
-
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
3
|
+
import { ScopedElementsMixin } from '@open-wc/scoped-elements/lit-element.js';
|
|
4
4
|
import { SlotMixin } from '@lion/ui/core.js';
|
|
5
5
|
import { LitElement } from 'lit';
|
|
6
6
|
|
|
@@ -8,25 +8,22 @@ import { LitElement } from 'lit';
|
|
|
8
8
|
* @typedef {import('../types/SlotMixinTypes.js').SlotHost} SlotHost
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
const createElementNative = ShadowRoot.prototype.createElement;
|
|
12
13
|
function mockScopedRegistry() {
|
|
13
14
|
const outputObj = { createElementCallCount: 0 };
|
|
14
15
|
// @ts-expect-error wait for browser support
|
|
15
|
-
ShadowRoot.prototype.createElement = () => {
|
|
16
|
+
ShadowRoot.prototype.createElement = (tagName, options) => {
|
|
16
17
|
outputObj.createElementCallCount += 1;
|
|
17
18
|
// Return an element that lit can use as render target
|
|
18
|
-
return
|
|
19
|
+
return createElementNative(tagName, options);
|
|
19
20
|
};
|
|
20
|
-
// @ts-expect-error wait for browser support
|
|
21
|
-
window.CustomElementRegistry = class {};
|
|
22
21
|
return outputObj;
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
function unMockScopedRegistry() {
|
|
26
25
|
// @ts-expect-error wait for browser support
|
|
27
|
-
|
|
28
|
-
// @ts-expect-error wait for browser support
|
|
29
|
-
delete window.CustomElementRegistry;
|
|
26
|
+
ShadowRoot.prototype.createElement = createElementNative;
|
|
30
27
|
}
|
|
31
28
|
|
|
32
29
|
describe('SlotMixin', () => {
|
|
@@ -468,6 +465,8 @@ describe('SlotMixin', () => {
|
|
|
468
465
|
});
|
|
469
466
|
|
|
470
467
|
it('does not scope elements when polyfill not loaded', async () => {
|
|
468
|
+
// @ts-expect-error
|
|
469
|
+
ShadowRoot.prototype.createElement = null;
|
|
471
470
|
class ScopedEl extends LitElement {}
|
|
472
471
|
|
|
473
472
|
const tagName = defineCE(
|
|
@@ -505,6 +504,7 @@ describe('SlotMixin', () => {
|
|
|
505
504
|
|
|
506
505
|
document.body.removeChild(renderTarget);
|
|
507
506
|
docSpy.restore();
|
|
507
|
+
unMockScopedRegistry();
|
|
508
508
|
});
|
|
509
509
|
});
|
|
510
510
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* eslint-disable class-methods-use-this, camelcase, no-param-reassign, max-classes-per-file */
|
|
2
2
|
import { SlotMixin, DisabledMixin } from '@lion/ui/core.js';
|
|
3
|
-
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
4
3
|
import { dedupeMixin } from '@open-wc/dedupe-mixin';
|
|
5
4
|
// TODO: make form-core independent from localize
|
|
6
5
|
import { getLocalizeManager } from '@lion/ui/localize-no-side-effects.js';
|
|
6
|
+
import { ScopedElementsMixin } from '../../../core/src/ScopedElementsMixin.js';
|
|
7
7
|
import { AsyncQueue } from '../utils/AsyncQueue.js';
|
|
8
8
|
import { pascalCase } from '../utils/pascalCase.js';
|
|
9
9
|
import { SyncUpdatableMixin } from '../utils/SyncUpdatableMixin.js';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import { Constructor } from '@open-wc/dedupe-mixin';
|
|
3
|
-
import { ScopedElementsHost } from '@open-wc/scoped-elements/types.js';
|
|
4
3
|
|
|
5
4
|
import { DisabledHost } from '../../../core/types/DisabledMixinTypes.js';
|
|
6
5
|
import { SlotHost } from '../../../core/types/SlotMixinTypes.js';
|
|
@@ -214,6 +213,20 @@ export declare class ValidateHost {
|
|
|
214
213
|
private __getFeedbackMessages(validators: Validator[]): Promise<FeedbackMessage[]>;
|
|
215
214
|
}
|
|
216
215
|
|
|
216
|
+
export type ScopedElementsMap = {
|
|
217
|
+
[key: string]: typeof HTMLElement;
|
|
218
|
+
};
|
|
219
|
+
export declare class ScopedElementsHost {
|
|
220
|
+
/**
|
|
221
|
+
* Obtains the scoped elements definitions map
|
|
222
|
+
*/
|
|
223
|
+
static scopedElements: ScopedElementsMap;
|
|
224
|
+
/**
|
|
225
|
+
* Obtains the CustomElementRegistry
|
|
226
|
+
*/
|
|
227
|
+
registry?: CustomElementRegistry;
|
|
228
|
+
}
|
|
229
|
+
|
|
217
230
|
export declare function ValidateImplementation<T extends Constructor<LitElement>>(
|
|
218
231
|
superclass: T,
|
|
219
232
|
): T &
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
2
|
import { LionCalendar } from '@lion/ui/calendar.js';
|
|
3
3
|
import { uuid } from '@lion/ui/core.js';
|
|
4
|
-
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
5
4
|
import { html, css } from 'lit';
|
|
6
5
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
7
6
|
import { LionInputDate } from '@lion/ui/input-date.js';
|
|
@@ -13,6 +12,7 @@ import {
|
|
|
13
12
|
ArrowMixin,
|
|
14
13
|
} from '@lion/ui/overlays.js';
|
|
15
14
|
import { LocalizeMixin } from '@lion/ui/localize-no-side-effects.js';
|
|
15
|
+
import { ScopedElementsMixin } from '../../core/src/ScopedElementsMixin.js';
|
|
16
16
|
import { localizeNamespaceLoader } from './localizeNamespaceLoader.js';
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LionField } from '@lion/ui/form-core.js';
|
|
2
2
|
import { LocalizeMixin } from '@lion/ui/localize.js';
|
|
3
|
-
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
4
3
|
import { css, html } from 'lit';
|
|
5
4
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
|
+
import { ScopedElementsMixin } from '../../core/src/ScopedElementsMixin.js';
|
|
6
6
|
import { FileHandle, MAX_FILE_SIZE } from './FileHandle.js';
|
|
7
7
|
import { LionSelectedFileList } from './LionSelectedFileList.js';
|
|
8
8
|
import { localizeNamespaceLoader } from './localizeNamespaceLoader.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { uuid } from '@lion/ui/core.js';
|
|
2
2
|
import { LionValidationFeedback } from '@lion/ui/form-core.js';
|
|
3
3
|
import { LocalizeMixin } from '@lion/ui/localize.js';
|
|
4
|
-
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
5
4
|
import { css, html, LitElement, nothing } from 'lit';
|
|
6
5
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
7
6
|
import { repeat } from 'lit/directives/repeat.js';
|
|
7
|
+
import { ScopedElementsMixin } from '../../core/src/ScopedElementsMixin.js';
|
|
8
8
|
import { localizeNamespaceLoader } from './localizeNamespaceLoader.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -49,7 +49,8 @@ class WithFormControlInputTelDropdown extends LionInputTelDropdown {
|
|
|
49
49
|
runInputTelSuite({ klass: LionInputTelDropdown });
|
|
50
50
|
runInputTelDropdownSuite();
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
// TODO: To be fixed in 4095205
|
|
53
|
+
describe.skip('WithFormControlInputTelDropdown', () => {
|
|
53
54
|
// @ts-expect-error
|
|
54
55
|
// Runs it for LionSelectRich, which uses .modelValue/@model-value-changed instead of .value/@change
|
|
55
56
|
runInputTelDropdownSuite({ klass: WithFormControlInputTelDropdown });
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { css, html } from 'lit';
|
|
2
2
|
import { SlotMixin, uuid } from '@lion/ui/core.js';
|
|
3
|
-
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
4
3
|
import { dedupeMixin } from '@open-wc/dedupe-mixin';
|
|
5
4
|
import { ChoiceGroupMixin, FormControlMixin, FormRegistrarMixin } from '@lion/ui/form-core.js';
|
|
5
|
+
import { ScopedElementsMixin } from '../../core/src/ScopedElementsMixin.js';
|
|
6
6
|
import { LionOptions } from './LionOptions.js';
|
|
7
7
|
|
|
8
8
|
// TODO: extract ListNavigationWithActiveDescendantMixin that can be reused in [role="menu"]
|
|
@@ -65,7 +65,8 @@ describe('Local Positioning', () => {
|
|
|
65
65
|
expect(ctrl._popper.state.modifiersData).to.exist;
|
|
66
66
|
});
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
// TODO: To be fixed in 4096926
|
|
69
|
+
it.skip('positions correctly', async () => {
|
|
69
70
|
// smoke test for integration of popper
|
|
70
71
|
const ctrl = new OverlayController({
|
|
71
72
|
...withLocalTestConfig(),
|
|
@@ -206,7 +207,8 @@ describe('Local Positioning', () => {
|
|
|
206
207
|
expect(ctrl._popper.state.modifiersData.offset.auto).to.eql({ x: 0, y: 16 });
|
|
207
208
|
});
|
|
208
209
|
|
|
209
|
-
|
|
210
|
+
// TODO: To be fixed in 4096926
|
|
211
|
+
it.skip('positions the Popper element correctly on show', async () => {
|
|
210
212
|
const ctrl = new OverlayController({
|
|
211
213
|
...withLocalTestConfig(),
|
|
212
214
|
contentNode: createContentSync({ width: 80, height: 20 }),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LionListbox } from '@lion/ui/listbox.js';
|
|
2
2
|
import { html } from 'lit';
|
|
3
3
|
import { SlotMixin, browserDetection } from '@lion/ui/core.js';
|
|
4
|
-
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
5
4
|
import { OverlayMixin, withDropdownConfig } from '@lion/ui/overlays.js';
|
|
5
|
+
import { ScopedElementsMixin } from '../../core/src/ScopedElementsMixin.js';
|
|
6
6
|
import { LionSelectInvoker } from './LionSelectInvoker.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { css, html } from 'lit';
|
|
2
|
-
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
3
2
|
import { ChoiceInputMixin, LionField } from '@lion/ui/form-core.js';
|
|
3
|
+
import { ScopedElementsMixin } from '../../core/src/ScopedElementsMixin.js';
|
|
4
4
|
import { LionSwitchButton } from './LionSwitchButton.js';
|
|
5
5
|
|
|
6
6
|
export class LionSwitch extends ScopedElementsMixin(ChoiceInputMixin(LionField)) {
|
|
@@ -98,7 +98,8 @@ describe('<lion-textarea>', () => {
|
|
|
98
98
|
expect(hightWith1Line < hightWith5TextLines).to.equal(true);
|
|
99
99
|
});
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
// TODO: To be fixed in 4096171
|
|
102
|
+
it.skip(`starts growing when content is bigger than "rows"
|
|
102
103
|
'and stops growing after property "maxRows" is reached`, async () => {
|
|
103
104
|
const el = await fixture(`<lion-textarea></lion-textarea>`);
|
|
104
105
|
return [1, 2, 3, 4, 5, 6, 7, 8].reduce(async (heightPromise, i) => {
|
|
@@ -120,7 +121,8 @@ describe('<lion-textarea>', () => {
|
|
|
120
121
|
});
|
|
121
122
|
|
|
122
123
|
// TODO: make test simpler => no reduce please (also update autosize npm dependency to latest version)
|
|
123
|
-
|
|
124
|
+
// TODO: To be fixed in 4096171
|
|
125
|
+
it.skip('stops growing after property "maxRows" is reached when there was an initial value', async () => {
|
|
124
126
|
const el = await fixture(html`<lion-textarea .modelValue="${'1\n2\n3'}"></lion-textarea>`);
|
|
125
127
|
|
|
126
128
|
return [4, 5, 6, 7, 8].reduce(async (heightPromise, i) => {
|
|
@@ -13,8 +13,8 @@ export default {
|
|
|
13
13
|
MaxNumber: 'Veuillez indiquer un(e) {fieldName} inférieur(e) à {params}.',
|
|
14
14
|
MinMaxNumber: 'Veuillez indiquer un(e) {fieldName} entre {params.min} et {params.max}.',
|
|
15
15
|
IsDate: ' Veuillez entrer la date (JJ-MM-AAAA).',
|
|
16
|
-
MinDate: 'Veuillez indiquer un(e) {fieldName} après {params
|
|
17
|
-
MaxDate: 'Veuillez indiquer un(e) {fieldName} avant {params
|
|
16
|
+
MinDate: 'Veuillez indiquer un(e) {fieldName} après {params, date, YYYYMMDD}.',
|
|
17
|
+
MaxDate: 'Veuillez indiquer un(e) {fieldName} avant {params, date, YYYYMMDD}.',
|
|
18
18
|
MinMaxDate:
|
|
19
19
|
'Veuillez indiquer un(e) {fieldName} entre {params.min, date, YYYYMMDD} et {params.max, date, YYYYMMDD}.',
|
|
20
20
|
IsDateDisabled: "Cette date n'est pas disponible, veuillez en choisir une autre.",
|