@lmvz-ds/components 0.18.2 → 0.19.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/CHANGELOG.md +6 -0
- package/README.md +45 -100
- package/cjs/ds.constants-DSnxZ3ia.js +16 -0
- package/cjs/{icons-swqMn6s2.js → icons-Tg7ySOh-.js} +54 -38
- package/cjs/index.cjs.js +9 -10
- package/cjs/lmvz-button.cjs.entry.js +2 -2
- package/cjs/lmvz-chip.cjs.entry.js +68 -4
- package/cjs/lmvz-components.cjs.js +1 -1
- package/cjs/lmvz-header_2.cjs.entry.js +2 -2
- package/cjs/lmvz-icon.cjs.entry.js +6 -6
- package/cjs/lmvz-input.cjs.entry.js +3 -3
- package/cjs/lmvz-menuitem.cjs.entry.js +2 -2
- package/cjs/lmvz-select.cjs.entry.js +2 -2
- package/cjs/loader.cjs.js +1 -1
- package/cjs/{reactive-controller-host-CtaVAiYJ.js → reactive-controller-host-Bi9eu2bV.js} +9 -9
- package/collection/api/ds.constants.js +2 -0
- package/collection/components/lmvz-button/lmvz-button.js +6 -3
- package/collection/components/lmvz-chip/lmvz-chip.css +84 -1
- package/collection/components/lmvz-chip/lmvz-chip.js +110 -13
- package/collection/components/lmvz-header/lmvz-header.js +2 -2
- package/collection/components/lmvz-icon/lmvz-icon.css +11 -10
- package/collection/components/lmvz-icon/lmvz-icon.js +7 -6
- package/collection/components/lmvz-input/lmvz-input.js +4 -4
- package/collection/components/lmvz-menuitem/lmvz-menuitem.js +11 -5
- package/collection/components/lmvz-select/lmvz-select.js +1 -1
- package/collection/index.js +1 -1
- package/collection/integration/header-integration/header-integration.js +1 -1
- package/collection/utils/aria/aria-validation-controller.js +1 -0
- package/collection/utils/reactive-controller-host.js +9 -9
- package/components/index.js +1 -1
- package/components/lmvz-button.js +1 -1
- package/components/lmvz-chip.js +1 -1
- package/components/lmvz-header.js +1 -1
- package/components/lmvz-icon.js +1 -1
- package/components/lmvz-input.js +1 -1
- package/components/lmvz-menuitem.js +1 -1
- package/components/lmvz-select.js +1 -1
- package/components/{p-DQEkWkMh.js → p-DIrAQ4IB.js} +1 -1
- package/esm/{aria-loader-BF_AYtbb.js → aria-loader-CES8Ae1e.js} +1 -1
- package/esm/ds.constants-Bmi89ll1.js +9 -0
- package/esm/{icons-Ca8oMiRa.js → icons-Bj4dF1-I.js} +55 -40
- package/esm/{index-7Ru1khgk.js → index-BvxaUA12.js} +1 -1
- package/esm/index.js +4 -11
- package/esm/lmvz-button.entry.js +3 -3
- package/esm/lmvz-chip.entry.js +69 -5
- package/esm/lmvz-components.js +1 -1
- package/esm/lmvz-header_2.entry.js +3 -3
- package/esm/lmvz-icon.entry.js +7 -7
- package/esm/lmvz-input.entry.js +4 -4
- package/esm/lmvz-menuitem.entry.js +3 -3
- package/esm/lmvz-select.entry.js +3 -3
- package/esm/loader.js +1 -1
- package/esm/{logger-fiRXhuXK.js → logger-0bL3pydp.js} +1 -1
- package/esm/{reactive-controller-host-sR2jJxNG.js → reactive-controller-host-J2thAxVH.js} +10 -10
- package/hydrate/index.js +92 -27
- package/hydrate/index.mjs +92 -27
- package/lmvz-components/index.esm.js +1 -1
- package/lmvz-components/lmvz-components.esm.js +1 -1
- package/lmvz-components/{p-fiRXhuXK.js → p-0bL3pydp.js} +1 -1
- package/lmvz-components/p-40569208.entry.js +1 -0
- package/lmvz-components/p-49ab22bd.entry.js +1 -0
- package/lmvz-components/{p-6dbb3f13.entry.js → p-6e8acbd9.entry.js} +1 -1
- package/lmvz-components/{p-59383f3a.entry.js → p-9212bd23.entry.js} +1 -1
- package/lmvz-components/p-9626e951.entry.js +1 -0
- package/lmvz-components/p-Bmi89ll1.js +1 -0
- package/lmvz-components/p-Bu4Z_PMf.js +1 -0
- package/lmvz-components/{p-Bkfdgg0T.js → p-BxHnZA0M.js} +1 -1
- package/lmvz-components/{p-DXOTa5VF.js → p-DHZwxmLb.js} +1 -1
- package/lmvz-components/{p-B3dnXEPG.js → p-DYaffOLo.js} +1 -1
- package/lmvz-components/{p-84267405.entry.js → p-e1b847d2.entry.js} +1 -1
- package/lmvz-components/{p-5aa17cd2.entry.js → p-ec96c6b6.entry.js} +1 -1
- package/manifest.json +139 -32
- package/package.json +1 -1
- package/types/api/ds.constants.d.ts +6 -1
- package/types/components/lmvz-action/lmvz-action.d.ts +0 -1
- package/types/components/lmvz-button/lmvz-button.d.ts +0 -1
- package/types/components/lmvz-card/lmvz-card.d.ts +0 -1
- package/types/components/lmvz-chip/lmvz-chip.d.ts +18 -3
- package/types/components/lmvz-header/lmvz-header.d.ts +0 -1
- package/types/components/lmvz-icon/lmvz-icon.d.ts +0 -1
- package/types/components/lmvz-input/lmvz-input.d.ts +0 -1
- package/types/components/lmvz-menuitem/lmvz-menuitem.d.ts +0 -1
- package/types/components/lmvz-select/lmvz-select.d.ts +0 -1
- package/types/components.d.ts +70 -12
- package/types/index.d.ts +1 -2
- package/types/utils/aria/aria-validation-controller.d.ts +1 -2
- package/types/utils/aria/element-activation-controller.d.ts +0 -1
- package/types/utils/aria/list-keyboard-controller.d.ts +0 -1
- package/types/utils/assets.d.ts +0 -1
- package/types/utils/component.d.ts +0 -1
- package/types/utils/environment.d.ts +0 -1
- package/types/utils/http.d.ts +0 -1
- package/types/utils/http.unit.d.ts +0 -1
- package/types/utils/icons/icons-registry.d.ts +0 -1
- package/types/utils/icons/icons.d.ts +0 -1
- package/types/utils/icons/icons.unit.d.ts +0 -1
- package/types/utils/icons/public.d.ts +0 -1
- package/types/utils/public.d.ts +0 -1
- package/types/utils/reactive-controller-host.d.ts +0 -1
- package/lmvz-components/p-0a41cc24.entry.js +0 -1
- package/lmvz-components/p-30b99f11.entry.js +0 -1
- package/lmvz-components/p-5f150890.entry.js +0 -1
- package/lmvz-components/p-Bh2Epkwf.js +0 -1
- /package/components/{p-CBLAeife.js → p-DbeHBSOe.js} +0 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,43 +1,60 @@
|
|
|
1
|
-
[](https://stenciljs.com)
|
|
2
|
-
|
|
3
|
-
Stencil is a compiler for building web apps using Web Components.
|
|
4
|
-
|
|
5
1
|
# LMVZ Component Library
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## About
|
|
3
|
+
[](https://stenciljs.com)
|
|
10
4
|
|
|
11
|
-
|
|
12
|
-
It also uses **Effect** (aka. effect-ts) for improved type-safety error handling
|
|
5
|
+
Web components for the LMVZ Design System.
|
|
13
6
|
|
|
14
|
-
##
|
|
7
|
+
## About
|
|
15
8
|
|
|
16
|
-
|
|
9
|
+
This package uses **Stencil** to create web components for browser-native usage and to generate integration artifacts consumed by sibling framework packages.
|
|
17
10
|
|
|
18
|
-
|
|
11
|
+
Please also read the Integration chapter of the Design Guide.
|
|
19
12
|
|
|
20
|
-
|
|
13
|
+
## Installation
|
|
21
14
|
|
|
22
15
|
```bash
|
|
23
16
|
npm i @lmvz-ds/components
|
|
24
17
|
```
|
|
25
18
|
|
|
19
|
+
> [!TIP]
|
|
20
|
+
> If you are building an Angular application, prefer the `@lmvz-ds/angular` wrapper package.
|
|
21
|
+
|
|
26
22
|
> [!TIP]
|
|
27
23
|
> Our @lmvz-ds/aria-validation sibling is only used for YOUR development mode, and thus, optional.
|
|
28
24
|
|
|
29
25
|
## Usage
|
|
30
26
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
Import individual components when you only need a subset:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import '@lmvz-ds/components/lmvz-button';
|
|
31
|
+
import '@lmvz-ds/components/lmvz-icon';
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Register all components globally via the loader when that is a better fit for your app shell:
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
import { defineCustomElements } from '@lmvz-ds/components/loader';
|
|
38
|
+
|
|
39
|
+
defineCustomElements(window);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
If your app has no own build/bundling process, directly import from the CDN (unpkg.com) using `<script type="module" href="[cdnurl]">`.
|
|
43
|
+
|
|
44
|
+
The package also exposes a /hydrate entry for server-side rendering workflows.
|
|
45
|
+
|
|
46
|
+
### Icons
|
|
47
|
+
|
|
48
|
+
The `<lmvz-icon>` component requires an icon provider to be registered before use. See [@lmvz-ds/icons](https://www.npmjs.com/package/@lmvz-ds/icons) for setup instructions and available provider modes.
|
|
34
49
|
|
|
35
50
|
### Runtime ARIA Validation (Opt-in)
|
|
36
51
|
|
|
37
|
-
ARIA validation is disabled by default and can be enabled on demand
|
|
52
|
+
ARIA validation is disabled by default and can be enabled on demand for development-time accessibility checks:
|
|
38
53
|
|
|
39
54
|
```ts
|
|
40
|
-
import '@lmvz-ds/components
|
|
55
|
+
import { enableAriaValidation } from '@lmvz-ds/components';
|
|
56
|
+
|
|
57
|
+
enableAriaValidation();
|
|
41
58
|
```
|
|
42
59
|
|
|
43
60
|
This import enables validation globally for all LMVZ components, independent of integration mode.
|
|
@@ -45,25 +62,25 @@ This import enables validation globally for all LMVZ components, independent of
|
|
|
45
62
|
To disable it again at runtime:
|
|
46
63
|
|
|
47
64
|
```ts
|
|
48
|
-
import { disableAriaValidation } from '@lmvz-ds/components
|
|
65
|
+
import { disableAriaValidation } from '@lmvz-ds/components';
|
|
49
66
|
|
|
50
67
|
disableAriaValidation();
|
|
51
68
|
```
|
|
52
69
|
|
|
53
|
-
###
|
|
54
|
-
|
|
55
|
-
Components are built in standalone mode, using [`dist-custom-elements`](https://stenciljs.com/docs/custom-elements). This way, you can import the components individually, wherever they are needed.
|
|
70
|
+
### Example
|
|
56
71
|
|
|
57
|
-
|
|
72
|
+
Import and register the component module before using its custom element:
|
|
58
73
|
|
|
59
74
|
```tsx
|
|
60
|
-
import '@lmvz-ds/components/
|
|
75
|
+
import { defineCustomElement as defineButtonElement } '@lmvz-ds/components/lmvz-button';
|
|
76
|
+
|
|
77
|
+
defineButtonElement();
|
|
61
78
|
|
|
62
79
|
function App() {
|
|
63
80
|
return (
|
|
64
81
|
<>
|
|
65
82
|
<div>
|
|
66
|
-
<
|
|
83
|
+
<lmvz-button variant="primary"></lmvz-button>
|
|
67
84
|
</div>
|
|
68
85
|
</>
|
|
69
86
|
);
|
|
@@ -72,81 +89,9 @@ function App() {
|
|
|
72
89
|
export default App;
|
|
73
90
|
```
|
|
74
91
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
## Making changes to this package
|
|
78
|
-
|
|
79
|
-
### Getting Started
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
npm install
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### Workflow
|
|
86
|
-
|
|
87
|
-
See the parent project's readme for the overarching process' description.
|
|
88
|
-
|
|
89
|
-
### Guidelines
|
|
90
|
-
|
|
91
|
-
- Components must each be provided as stand-alone bundles.
|
|
92
|
-
- Components must bring their own, ds-aligned, default styles. This increases flexibility (as components are usable stand-alone) and is achieved by build-time injection of defaults (based on base- and light-theme-variables). There is no need for importing any variables definitions. Instead, add base variables to the plugin config's list (`stencil.base.config.ts`).
|
|
93
|
-
- Font file contents are exempt from bundling, to allow for browser-caching!
|
|
94
|
-
- To prevent styles from leaking out of your Components (into the global scope), wrap your own styles and `@import`s in `:host`.
|
|
95
|
-
- Components depending on Fragments must import them into their :host selector, for proper encapsulation.
|
|
96
|
-
- This use of CSS' @import syntax is invalid, but properly handled by postcss.
|
|
97
|
-
- Consider using custom-property abstractions instead of importing whole fragments!
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
### Configuration
|
|
101
|
-
|
|
102
|
-
Different Stencil configs are necessary, since we need the following constellations (which are not possible with a single config):
|
|
103
|
-
|
|
104
|
-
- local Stencil dev-server: classic dev build
|
|
105
|
-
- Storybook integration: prod build + source maps (dev build does not generate source files in dist/)
|
|
106
|
-
- release build: prod build without source maps
|
|
107
|
-
|
|
108
|
-
package.json exports should be generated along with the Stencil build (for new components).
|
|
109
|
-
|
|
110
|
-
### Development
|
|
111
|
-
|
|
112
|
-
Use the `pnpm run start:dev` script to start Stencil's dev server.
|
|
113
|
-
(`start` will be called from the Storybook sibling package and will only run a (watching) production build).
|
|
114
|
-
|
|
115
|
-
### Building
|
|
116
|
-
|
|
117
|
-
To build the components (and styles) for production, run the build script. This will also sync changes to the wrapper projects.
|
|
118
|
-
|
|
119
|
-
```bash
|
|
120
|
-
pnpm run build
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### Creating New Components
|
|
124
|
-
|
|
125
|
-
Always use the `lmvz-` prefix when creating new components!
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
pnpm run @stencil/core generate lmvz-[component name]
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### Testing
|
|
132
|
-
|
|
133
|
-
To run the unit tests for the components, run:
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
npm test
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
#### Integration Testing
|
|
140
|
-
|
|
141
|
-
Since components can be integrated in various ways, always test integrations:
|
|
142
|
-
|
|
143
|
-
- Stencil dev mode and preview (see package scripts).
|
|
144
|
-
- With the Storybook package.
|
|
145
|
-
- Angular, React, ... wrappers
|
|
92
|
+
LMVZ component styles do not style native HTML elements outside the components. Import a theme, and any additional global style bundles you need, from `@lmvz-ds/styles` separately.
|
|
146
93
|
|
|
147
|
-
#### E2E
|
|
148
94
|
|
|
149
|
-
|
|
95
|
+
## Contributing
|
|
150
96
|
|
|
151
|
-
|
|
152
|
-
- Vitest-Browser + Stencil is bleeding edge and needs eval.
|
|
97
|
+
Contributor onboarding for local development, builds, testing, and authoring guidelines is in `DEVELOPMENT.md`.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const sizes = ['xs', 'sm', 'md', 'lg'];
|
|
4
|
+
const textSizes = [...sizes, 'xl'];
|
|
5
|
+
const inputTypes = ['text', 'email', 'password', 'tel', 'url', 'search', 'number'];
|
|
6
|
+
const iconSizes = [...sizes, 'inherit'];
|
|
7
|
+
const iconWeights = ['thin', 'medium', 'bold', 'filled'];
|
|
8
|
+
const chipTypes = ['active', 'warning', 'success', 'error', 'neutral'];
|
|
9
|
+
const chipSizes = ['default', 'small'];
|
|
10
|
+
|
|
11
|
+
exports.chipSizes = chipSizes;
|
|
12
|
+
exports.chipTypes = chipTypes;
|
|
13
|
+
exports.iconSizes = iconSizes;
|
|
14
|
+
exports.iconWeights = iconWeights;
|
|
15
|
+
exports.inputTypes = inputTypes;
|
|
16
|
+
exports.textSizes = textSizes;
|
|
@@ -2,6 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
var logger = require('./logger-Bn2yoZGP.js');
|
|
4
4
|
|
|
5
|
+
const IconProviderRegistryKey = Symbol.for('LMVZ__iconProviderRegistry');
|
|
6
|
+
const inMemoryRegistry = {};
|
|
7
|
+
function getRegistry() {
|
|
8
|
+
if (typeof window === 'undefined') {
|
|
9
|
+
return inMemoryRegistry;
|
|
10
|
+
}
|
|
11
|
+
return window[IconProviderRegistryKey] ?? (window[IconProviderRegistryKey] = {});
|
|
12
|
+
}
|
|
13
|
+
function registerIconProvider(id, provider) {
|
|
14
|
+
const registry = getRegistry();
|
|
15
|
+
const providerName = id;
|
|
16
|
+
if (Object.prototype.hasOwnProperty.call(registry, providerName)) {
|
|
17
|
+
console.warn(`Icon provider with name "${providerName}" is already registered. Overwriting existing provider.`);
|
|
18
|
+
}
|
|
19
|
+
registry[providerName] = provider;
|
|
20
|
+
}
|
|
21
|
+
function getRegisteredIconProvider(id) {
|
|
22
|
+
const registry = getRegistry();
|
|
23
|
+
if (id) {
|
|
24
|
+
return registry[id];
|
|
25
|
+
}
|
|
26
|
+
const providerNames = Object.keys(registry);
|
|
27
|
+
if (providerNames.length === 0) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
if (providerNames.length > 1) {
|
|
31
|
+
console.warn(`Multiple icon providers registered (${providerNames.join(', ')}). Using the first one: "${providerNames[0]}".`);
|
|
32
|
+
}
|
|
33
|
+
const firstProviderName = providerNames[0];
|
|
34
|
+
if (!firstProviderName) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
return registry[firstProviderName];
|
|
38
|
+
}
|
|
39
|
+
|
|
5
40
|
/**
|
|
6
41
|
* This module provides types and utility functions to create and work with branded types,
|
|
7
42
|
* which are TypeScript types with an added type tag to prevent accidental usage of a value in the wrong context.
|
|
@@ -56,57 +91,37 @@ class BrandValidationError extends logger.TaggedError('BrandValidationError') {
|
|
|
56
91
|
super(new Error(`Brand validation failed for type ${type}.`, { cause: error }));
|
|
57
92
|
}
|
|
58
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* Validates an SVG string against the branded `SVGString` type and returns the result effect.
|
|
96
|
+
*
|
|
97
|
+
* @param svg Raw SVG markup to validate.
|
|
98
|
+
*/
|
|
59
99
|
const createValidSVGString = (svg) => logger.try_({
|
|
60
|
-
try: () => SVGString(svg),
|
|
100
|
+
try: () => SVGString(sanitizeSvg(svg)),
|
|
61
101
|
catch: (error) => new BrandValidationError(error, 'SVGString'),
|
|
62
102
|
});
|
|
103
|
+
/**
|
|
104
|
+
* Checks whether a string can be parsed into an SVG document.
|
|
105
|
+
*
|
|
106
|
+
* @param svg Raw SVG markup to validate.
|
|
107
|
+
*/
|
|
63
108
|
function isValidSVG(svg) {
|
|
64
|
-
if (typeof svg !== 'string')
|
|
109
|
+
if (typeof svg !== 'string')
|
|
65
110
|
return false;
|
|
66
|
-
|
|
111
|
+
const sanitizedSvg = sanitizeSvg(svg);
|
|
67
112
|
try {
|
|
68
113
|
const parser = new DOMParser();
|
|
69
|
-
const doc = parser.parseFromString(
|
|
114
|
+
const doc = parser.parseFromString(sanitizedSvg, 'image/svg+xml');
|
|
70
115
|
return doc.documentElement.nodeName === 'svg';
|
|
71
116
|
}
|
|
72
117
|
catch {
|
|
73
118
|
return false;
|
|
74
119
|
}
|
|
75
120
|
}
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
if (typeof window === 'undefined') {
|
|
81
|
-
return inMemoryRegistry;
|
|
82
|
-
}
|
|
83
|
-
return window[IconProviderRegistryKey] ?? (window[IconProviderRegistryKey] = {});
|
|
84
|
-
}
|
|
85
|
-
function registerIconProvider(id, provider) {
|
|
86
|
-
const registry = getRegistry();
|
|
87
|
-
const providerName = id;
|
|
88
|
-
if (Object.prototype.hasOwnProperty.call(registry, providerName)) {
|
|
89
|
-
console.warn(`Icon provider with name "${providerName}" is already registered. Overwriting existing provider.`);
|
|
90
|
-
}
|
|
91
|
-
registry[providerName] = provider;
|
|
92
|
-
}
|
|
93
|
-
function getRegisteredIconProvider(id) {
|
|
94
|
-
const registry = getRegistry();
|
|
95
|
-
if (id) {
|
|
96
|
-
return registry[id];
|
|
97
|
-
}
|
|
98
|
-
const providerNames = Object.keys(registry);
|
|
99
|
-
if (providerNames.length === 0) {
|
|
100
|
-
return undefined;
|
|
101
|
-
}
|
|
102
|
-
if (providerNames.length > 1) {
|
|
103
|
-
console.warn(`Multiple icon providers registered (${providerNames.join(', ')}). Using the first one: "${providerNames[0]}".`);
|
|
104
|
-
}
|
|
105
|
-
const firstProviderName = providerNames[0];
|
|
106
|
-
if (!firstProviderName) {
|
|
107
|
-
return undefined;
|
|
108
|
-
}
|
|
109
|
-
return registry[firstProviderName];
|
|
121
|
+
function sanitizeSvg(svg) {
|
|
122
|
+
const dataUriPrefix = 'data:image/svg+xml,';
|
|
123
|
+
const base = svg.trim();
|
|
124
|
+
return !base.startsWith(dataUriPrefix) ? base : decodeURIComponent(base.slice(dataUriPrefix.length));
|
|
110
125
|
}
|
|
111
126
|
|
|
112
127
|
const emptyDefaultSvg = () => SVGString(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>`);
|
|
@@ -156,6 +171,7 @@ function typedIconFromSet(iconset, icon) {
|
|
|
156
171
|
};
|
|
157
172
|
}
|
|
158
173
|
|
|
174
|
+
exports.createValidSVGString = createValidSVGString;
|
|
159
175
|
exports.getRegisteredIconProvider = getRegisteredIconProvider;
|
|
160
176
|
exports.isValidSVG = isValidSVG;
|
|
161
177
|
exports.registerIconProvider = registerIconProvider;
|
package/cjs/index.cjs.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var ariaLoader = require('./aria-loader-CfFuAbJn.js');
|
|
4
|
-
var
|
|
4
|
+
var ds_constants = require('./ds.constants-DSnxZ3ia.js');
|
|
5
|
+
var icons = require('./icons-Tg7ySOh-.js');
|
|
5
6
|
require('./logger-Bn2yoZGP.js');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
const textSizes = [...sizes, 'xl'];
|
|
9
|
-
const inputTypes = ['text', 'email', 'password', 'tel', 'url', 'search', 'number'];
|
|
10
|
-
const iconSizes = [...sizes, 'inherit'];
|
|
11
|
-
const iconWeights = ['thin', 'medium', 'bold', 'filled'];
|
|
8
|
+
|
|
12
9
|
|
|
13
10
|
exports.ARIA_VALIDATION_RUNTIME_CHANGED_EVENT = ariaLoader.ARIA_VALIDATION_RUNTIME_CHANGED_EVENT;
|
|
14
11
|
exports.disableAriaValidation = ariaLoader.disableAriaValidation;
|
|
@@ -16,10 +13,12 @@ exports.enableAriaValidation = ariaLoader.enableAriaValidation;
|
|
|
16
13
|
exports.isAriaValidationEnabled = ariaLoader.isAriaValidationEnabled;
|
|
17
14
|
exports.queueValidation = ariaLoader.queueValidation;
|
|
18
15
|
exports.useVerboseLogging = ariaLoader.useVerboseLogging;
|
|
16
|
+
exports.chipSizes = ds_constants.chipSizes;
|
|
17
|
+
exports.chipTypes = ds_constants.chipTypes;
|
|
18
|
+
exports.iconSizes = ds_constants.iconSizes;
|
|
19
|
+
exports.iconWeights = ds_constants.iconWeights;
|
|
20
|
+
exports.inputTypes = ds_constants.inputTypes;
|
|
21
|
+
exports.textSizes = ds_constants.textSizes;
|
|
19
22
|
exports.getRegisteredIconProvider = icons.getRegisteredIconProvider;
|
|
20
23
|
exports.registerIconProvider = icons.registerIconProvider;
|
|
21
24
|
exports.typedIconFromSet = icons.typedIconFromSet;
|
|
22
|
-
exports.iconSizes = iconSizes;
|
|
23
|
-
exports.iconWeights = iconWeights;
|
|
24
|
-
exports.inputTypes = inputTypes;
|
|
25
|
-
exports.textSizes = textSizes;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-C2yDXRqP.js');
|
|
4
4
|
var index$1 = require('./index-Bp6Dd2i1.js');
|
|
5
|
-
var reactiveControllerHost = require('./reactive-controller-host-
|
|
5
|
+
var reactiveControllerHost = require('./reactive-controller-host-Bi9eu2bV.js');
|
|
6
6
|
var elementActivationController = require('./element-activation-controller-DC_6T0Rt.js');
|
|
7
7
|
var component = require('./component-Csg9MtNK.js');
|
|
8
8
|
require('./aria-loader-CfFuAbJn.js');
|
|
@@ -64,7 +64,7 @@ const LmvzButton = class extends reactiveControllerHost.ReactiveControllerHost {
|
|
|
64
64
|
};
|
|
65
65
|
render() {
|
|
66
66
|
this.renderHiddenButton();
|
|
67
|
-
return (index.h(index.Host, { key: '
|
|
67
|
+
return (index.h(index.Host, { key: 'ce82e749ffb9172a9421d303e0d7cc02de58dff9', "aria-disabled": this.disabled ? 'true' : null }, index.h("button", { key: 'acd0773f72e76139ec5495eb15fc3a5949029e40', ref: (e) => (this.validationEl = e), disabled: this.disabled, class: index$1.classNames(this.variant, { [this.scale ?? '']: !!this.scale, disabled: this.disabled }), ...this.inheritedAttributes }, index.h("slot", { key: 'f519e0f82e68811a8831214e83e609bd9501fed0' }))));
|
|
68
68
|
}
|
|
69
69
|
static get delegatesFocus() { return true; }
|
|
70
70
|
};
|
|
@@ -1,17 +1,81 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-C2yDXRqP.js');
|
|
4
|
+
var ds_constants = require('./ds.constants-DSnxZ3ia.js');
|
|
5
|
+
var reactiveControllerHost = require('./reactive-controller-host-Bi9eu2bV.js');
|
|
6
|
+
var ariaLoader = require('./aria-loader-CfFuAbJn.js');
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
function debounce(func, wait) {
|
|
9
|
+
let timeout;
|
|
10
|
+
return () => {
|
|
11
|
+
if (timeout !== undefined) {
|
|
12
|
+
window.clearTimeout(timeout);
|
|
13
|
+
}
|
|
14
|
+
timeout = window.setTimeout(() => {
|
|
15
|
+
func();
|
|
16
|
+
timeout = undefined;
|
|
17
|
+
}, wait);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
6
20
|
|
|
7
|
-
const
|
|
21
|
+
const lmvzChipCss = () => `:host { --lmvz-chip-border-color: var(--lmvz-semantic-color-status-on-neutral-subtle, #d4d4d4); --lmvz-chip-background-color: var(--lmvz-semantic-color-status-neutral, #fcfcfc); --lmvz-chip-foreground-color: var(--lmvz-semantic-color-status-on-neutral, #545454); padding-block: var(--lmvz-dimension-4-6, clamp(0.25rem, 0.22rem + 0.13vw, 0.38rem)); padding-inline: var(--lmvz-dimension-8-10, clamp(0.5rem, 0.47rem + 0.13vw, 0.63rem)); border: 1px solid var(--lmvz-chip-border-color); border-radius: var(--lmvz-semantic-border-radius-round, 999px); font: var(--lmvz-typography-body-xs-strong, 500 clamp(0.69rem, 0.67rem + 0.06vw, 0.75rem) / 1.4 Router); background-color: var(--lmvz-chip-background-color); color: var(--lmvz-chip-foreground-color); display: inline-flex; align-items: center; justify-content: center; gap: var(--lmvz-dimension-4-6, clamp(0.25rem, 0.22rem + 0.13vw, 0.38rem)); box-sizing: border-box; max-width: 100%; overflow: hidden; white-space: nowrap; > .content-overflow-wrapper { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } } :host([size='small']) { padding-block: var(--lmvz-dimension-2-4, clamp(0.13rem, 0.09rem + 0.13vw, 0.25rem)); padding-inline: var(--lmvz-dimension-6-8, clamp(0.38rem, 0.34rem + 0.13vw, 0.5rem)); font: var(--lmvz-typography-body-2xs-strong, 500 clamp(0.63rem, 0.61rem + 0.06vw, 0.69rem) / 1.4 Router); gap: var(--lmvz-dimension-2-4, clamp(0.13rem, 0.09rem + 0.13vw, 0.25rem)); } ::slotted(*) { display: inline; white-space: inherit; } ::slotted(lmvz-icon) { --lmvz-component-color: var(--lmvz-chip-foreground-color); --lmvz-component-size: var(--lmvz-dimension-12-14, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem)); } :host([size='small']) ::slotted(lmvz-icon) { --lmvz-component-size: var(--lmvz-dimension-10-12, clamp(0.63rem, 0.59rem + 0.13vw, 0.75rem)); } :host([type='active']) { --lmvz-chip-border-color: var(--lmvz-semantic-color-status-on-active-subtle, #c1e6fa); --lmvz-chip-background-color: var(--lmvz-semantic-color-status-active, #f1f9fe); --lmvz-chip-foreground-color: var(--lmvz-semantic-color-status-on-active, #0e7ab4); } :host([type='warning']) { --lmvz-chip-border-color: var(--lmvz-semantic-color-status-on-warning-subtle, #ffdf75); --lmvz-chip-background-color: var(--lmvz-semantic-color-status-warning, #fffbf0); --lmvz-chip-foreground-color: var(--lmvz-semantic-color-status-on-warning, #7a5e00); } :host([type='success']) { --lmvz-chip-border-color: var(--lmvz-semantic-color-status-on-success-subtle, #a5dad3); --lmvz-chip-background-color: var(--lmvz-semantic-color-status-success, #f1f9f8); --lmvz-chip-foreground-color: var(--lmvz-semantic-color-status-on-success, #37867c); } :host([type='error']) { --lmvz-chip-border-color: var(--lmvz-semantic-color-status-on-danger-subtle, #f7bfc2); --lmvz-chip-background-color: var(--lmvz-semantic-color-status-danger, #fdf1f2); --lmvz-chip-foreground-color: var(--lmvz-semantic-color-status-on-danger, #e52a31); } :host([type='neutral']) { --lmvz-chip-border-color: var(--lmvz-semantic-color-status-on-neutral-subtle, #d4d4d4); --lmvz-chip-background-color: var(--lmvz-semantic-color-status-neutral, #fcfcfc); --lmvz-chip-foreground-color: var(--lmvz-semantic-color-status-on-neutral, #545454); } `;
|
|
22
|
+
|
|
23
|
+
const LmvzChip = class extends reactiveControllerHost.ReactiveControllerHost {
|
|
24
|
+
ariaValidationController = new reactiveControllerHost.AriaValidationController(this);
|
|
25
|
+
beforeSlot;
|
|
26
|
+
defaultSlot;
|
|
27
|
+
afterSlot;
|
|
28
|
+
get el() { return index.getElement(this); }
|
|
29
|
+
get validationEl() {
|
|
30
|
+
return this.el;
|
|
31
|
+
}
|
|
32
|
+
type = 'active';
|
|
33
|
+
size = 'default';
|
|
8
34
|
constructor(hostRef) {
|
|
35
|
+
super();
|
|
9
36
|
index.registerInstance(this, hostRef);
|
|
37
|
+
this.addController(this.ariaValidationController);
|
|
38
|
+
}
|
|
39
|
+
normalizeType(value) {
|
|
40
|
+
const normalizedType = ds_constants.chipTypes.includes(value) ? value : 'active';
|
|
41
|
+
if (normalizedType !== this.type) {
|
|
42
|
+
this.type = normalizedType;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
normalizeSize(value) {
|
|
46
|
+
const normalizedSize = ds_constants.chipSizes.includes(value) ? value : 'default';
|
|
47
|
+
if (normalizedSize !== this.size) {
|
|
48
|
+
this.size = normalizedSize;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
componentWillLoad() {
|
|
52
|
+
this.normalizeType(this.type);
|
|
53
|
+
this.normalizeSize(this.size);
|
|
54
|
+
super.componentWillLoad();
|
|
55
|
+
}
|
|
56
|
+
connectedCallback() {
|
|
57
|
+
super.connectedCallback();
|
|
58
|
+
this.checkContent();
|
|
10
59
|
}
|
|
11
|
-
|
|
60
|
+
checkContent = debounce(() => {
|
|
61
|
+
if (!ariaLoader.isAriaValidationEnabled)
|
|
62
|
+
return;
|
|
63
|
+
const elements = [...(this.beforeSlot?.assignedElements() ?? []), ...(this.defaultSlot?.assignedElements() ?? []), ...(this.afterSlot?.assignedElements() ?? [])];
|
|
64
|
+
if (!elements.length) {
|
|
65
|
+
console.warn('LmvzChip has no assigned content. Please add content to the default slot or the before-text/after-text slots.');
|
|
66
|
+
}
|
|
67
|
+
}, 500);
|
|
12
68
|
render() {
|
|
13
|
-
return index.h(index.Host, { key: '
|
|
69
|
+
return (index.h(index.Host, { key: 'd34b677a3f6ac2cdb53453c774badb837a3b9e25', type: this.type, size: this.size }, index.h("slot", { key: 'c6f8beea28cd847f8d8b7c7a075c774f58e39262', name: "before-text", ref: (el) => (this.beforeSlot = el), onSlotchange: () => this.checkContent() }), index.h("span", { key: 'be784ef977bc1d0eae2fd2d9377642636bd325bc', class: "content-overflow-wrapper" }, index.h("slot", { key: '3730f2902bcae7917979dedd91264670fbff00de', ref: (el) => (this.defaultSlot = el), onSlotchange: () => this.checkContent() })), index.h("slot", { key: 'f827a03e407385c7bdfd483073453d97f6f73afb', name: "after-text", ref: (el) => (this.afterSlot = el), onSlotchange: () => this.checkContent() })));
|
|
14
70
|
}
|
|
71
|
+
static get watchers() { return {
|
|
72
|
+
"type": [{
|
|
73
|
+
"normalizeType": 0
|
|
74
|
+
}],
|
|
75
|
+
"size": [{
|
|
76
|
+
"normalizeSize": 0
|
|
77
|
+
}]
|
|
78
|
+
}; }
|
|
15
79
|
};
|
|
16
80
|
LmvzChip.style = lmvzChipCss();
|
|
17
81
|
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["lmvz-header_2.cjs",[[769,"lmvz-header",{"role":[2561],"lmvzActiveNav":[1,"lmvz-active-nav"]},null,{"lmvzActiveNav":[{"handleActiveNavChange":0}]}],[774,"lmvz-menuitem",{"role":[2561],"ti":[2562,"tabindex"]}]]],["lmvz-action.cjs",[[257,"lmvz-action"]]],["lmvz-button.cjs",[[785,"lmvz-button",{"ti":[2562,"tabindex"],"scale":[513],"variant":[513],"disabled":[516],"type":[1],"form":[1]}]]],["lmvz-card.cjs",[[774,"lmvz-card",{"cardTitle":[1,"card-title"],"imageUrl":[1,"image-url"],"description":[1],"primaryActionLabel":[1,"primary-action-label"]}]]],["lmvz-chip.cjs",[[
|
|
22
|
+
return index.bootstrapLazy([["lmvz-header_2.cjs",[[769,"lmvz-header",{"role":[2561],"lmvzActiveNav":[1,"lmvz-active-nav"]},null,{"lmvzActiveNav":[{"handleActiveNavChange":0}]}],[774,"lmvz-menuitem",{"role":[2561],"ti":[2562,"tabindex"]}]]],["lmvz-action.cjs",[[257,"lmvz-action"]]],["lmvz-button.cjs",[[785,"lmvz-button",{"ti":[2562,"tabindex"],"scale":[513],"variant":[513],"disabled":[516],"type":[1],"form":[1]}]]],["lmvz-card.cjs",[[774,"lmvz-card",{"cardTitle":[1,"card-title"],"imageUrl":[1,"image-url"],"description":[1],"primaryActionLabel":[1,"primary-action-label"]}]]],["lmvz-chip.cjs",[[769,"lmvz-chip",{"type":[1537],"size":[1537]},null,{"type":[{"normalizeType":0}],"size":[{"normalizeSize":0}]}]]],["lmvz-icon.cjs",[[514,"lmvz-icon",{"icon":[513],"weight":[513],"size":[513],"iconset":[513],"ariaLabel":[513,"aria-label"],"iconData":[32],"visible":[32]},null,{"icon":[{"loadIconPathData":0}],"iconset":[{"loadIconPathData":0}]}]]],["lmvz-input.cjs",[[838,"lmvz-input",{"value":[1025],"label":[1],"helperText":[1,"helper-text"],"placeholder":[1],"disabled":[516],"readonly":[516],"required":[516],"name":[1],"type":[1],"errorMessage":[1,"error-message"],"autocomplete":[1],"inputmode":[1],"autocorrect":[1],"autocapitalize":[1],"spellcheck":[4],"autofocus":[4],"minlength":[2],"maxlength":[2],"pattern":[1],"min":[8],"max":[8],"step":[8],"form":[1],"error":[6660],"nativeError":[32],"setValue":[64],"focusInput":[64],"blurInput":[64],"select":[64],"checkValidity":[64],"reportValidity":[64],"getInputElement":[64]},null,{"value":[{"handleValueChange":0}],"disabled":[{"handleDisabledChange":0}]}]]],["lmvz-menuitem.cjs",[[774,"lmvz-menuitem",{"role":[2561],"ti":[2562,"tabindex"]}]]],["lmvz-select.cjs",[[774,"lmvz-select",{"value":[1025],"label":[1],"helperText":[1,"helper-text"],"disabled":[516],"required":[516],"name":[1],"selectedLabel":[32]},null,{"value":[{"handleValueChange":0}]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-C2yDXRqP.js');
|
|
4
|
-
var reactiveControllerHost = require('./reactive-controller-host-
|
|
4
|
+
var reactiveControllerHost = require('./reactive-controller-host-Bi9eu2bV.js');
|
|
5
5
|
var component = require('./component-Csg9MtNK.js');
|
|
6
6
|
var lmvzMenuitem_entry = require('./lmvz-menuitem.cjs.entry.js');
|
|
7
7
|
require('./aria-loader-CfFuAbJn.js');
|
|
@@ -139,7 +139,7 @@ const LmvzHeader = class extends reactiveControllerHost.ReactiveControllerHost {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
render() {
|
|
142
|
-
return (index.h(index.Host, { key: '
|
|
142
|
+
return (index.h(index.Host, { key: '74061d97a6d4cdec1f445a91b9e819bb12565681', onFocus: this.delegateFocus.bind(this) }, index.h("div", { key: 'af7f08ff48a20b7d36df5ee233da7027cd30a047', class: "brand" }, index.h("slot", { key: '46be4fcf2798ac374ac967bc2742260c4d7e082b', name: "brand" }, index.h("img", { key: '3ee79f9732758a6ca5dd6e8264c67707917b358b', id: "fallback-logo-lmvz", src: logoSvg, alt: "Lehrmittelverlag Z\u00FCrich" }))), index.h("nav", { key: '8f37883454544a384bb35a151c4e24bb12c35f40', "aria-label": "Hauptnavigation" }, index.h("div", { key: 'a3166ad7e924dd72148d05c01160c889c8f07529', role: "menubar", class: "primary-menubar" }, index.h("slot", { key: 'aa600791e4d8f3463fefbc3b366831e3b3a3eaac', name: "nav-primary", ref: (el) => (this.primarySlot = el) }), index.h("div", { key: '6471256967f4d14c454205a330b2a97ecfcad7a8', role: "menu", id: "nav-secondary", class: "secondary-menubar", hidden: !this.lmvzActiveNav, ref: (el) => (this.secondaryNav = el) }, index.h("slot", { key: '1b9b461b958e76184938a1c65d032b296894e2dd', name: this.secondarySlotName, ref: (el) => (this.secondarySlot = el) })))), index.h("div", { key: '019d87472272df09ce99eeed405771229f326f1a', class: "actions" }, index.h("slot", { key: '18035fb0a51a26c96dc687547d17d57118a88e87', name: "actions" }))));
|
|
143
143
|
}
|
|
144
144
|
static get watchers() { return {
|
|
145
145
|
"lmvzActiveNav": [{
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-C2yDXRqP.js');
|
|
4
|
-
var icons = require('./icons-
|
|
5
|
-
var
|
|
6
|
-
require('./
|
|
4
|
+
var icons = require('./icons-Tg7ySOh-.js');
|
|
5
|
+
var logger = require('./logger-Bn2yoZGP.js');
|
|
6
|
+
var reactiveControllerHost = require('./reactive-controller-host-Bi9eu2bV.js');
|
|
7
7
|
require('./aria-loader-CfFuAbJn.js');
|
|
8
8
|
|
|
9
|
-
const lmvzIconCss = () => `.sc-lmvz-icon-h{--lmvz-icon-color:var(--lmvz-component-color, var(--lmvz-semantic-color-on-surface-input-primary, #000000));display:inline-block;line-height:0;svg{display:block}svg path{stroke:var(--lmvz-icon-color);fill:none}}[size='xs'].sc-lmvz-icon-h{svg{
|
|
9
|
+
const lmvzIconCss = () => `.sc-lmvz-icon-h{--lmvz-icon-color:var(--lmvz-component-color, var(--lmvz-semantic-color-on-surface-input-primary, #000000));--lmvz-icon-size:var(--lmvz-component-size, var(--lmvz-component-icon-size-md, clamp(1rem, 0.94rem + 0.26vw, 1.25rem)));display:inline-block;line-height:0;svg{display:block;height:var(--lmvz-icon-size);width:auto}svg path{stroke:var(--lmvz-icon-color);fill:none}}[size='xs'].sc-lmvz-icon-h{svg{--lmvz-icon-size:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem))}}[size='sm'].sc-lmvz-icon-h{svg{--lmvz-icon-size:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.84rem + 0.13vw, 1rem))}}[size='md'].sc-lmvz-icon-h{svg{--lmvz-icon-size:var(--lmvz-component-icon-size-md, clamp(1rem, 0.94rem + 0.26vw, 1.25rem))}}[size='lg'].sc-lmvz-icon-h{svg{--lmvz-icon-size:var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.44rem + 0.26vw, 1.75rem))}}[size='inherit'].sc-lmvz-icon-h{svg{height:var(--lmvz-component-size, inherit)}}[weight='light'].sc-lmvz-icon-h{svg path{stroke-width:1}}[weight='medium'].sc-lmvz-icon-h{svg path{stroke-width:1.5}}[weight='bold'].sc-lmvz-icon-h{svg path{stroke-width:2}}[weight='filled'].sc-lmvz-icon-h{svg path{stroke-width:2;fill:var(--lmvz-icon-color)}}`;
|
|
10
10
|
|
|
11
11
|
const LmvzIcon = class extends reactiveControllerHost.ReactiveControllerHost {
|
|
12
12
|
intersectionObserver;
|
|
@@ -48,7 +48,7 @@ const LmvzIcon = class extends reactiveControllerHost.ReactiveControllerHost {
|
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
50
|
if (icons.isValidSVG(icon)) {
|
|
51
|
-
this.iconData = icon;
|
|
51
|
+
this.iconData = await logger.runPromise(icons.createValidSVGString(icon));
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
this.iconData = await icons.resolveIconSvg({
|
|
@@ -62,7 +62,7 @@ const LmvzIcon = class extends reactiveControllerHost.ReactiveControllerHost {
|
|
|
62
62
|
super.componentDidRender();
|
|
63
63
|
}
|
|
64
64
|
render() {
|
|
65
|
-
return index.h(index.Host, { key: '
|
|
65
|
+
return index.h(index.Host, { key: 'c1e952e00df287c66c49eb043408514c07c3dc39', role: "img", "aria-hidden": `${this.ariaHidden}`, innerHTML: this.iconData });
|
|
66
66
|
}
|
|
67
67
|
waitUntilVisible(callback, rootMargin = 50) {
|
|
68
68
|
if (typeof window === 'undefined' || !window.IntersectionObserver) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-C2yDXRqP.js');
|
|
4
4
|
var index$1 = require('./index-Bp6Dd2i1.js');
|
|
5
|
-
var reactiveControllerHost = require('./reactive-controller-host-
|
|
5
|
+
var reactiveControllerHost = require('./reactive-controller-host-Bi9eu2bV.js');
|
|
6
6
|
var component = require('./component-Csg9MtNK.js');
|
|
7
7
|
require('./aria-loader-CfFuAbJn.js');
|
|
8
8
|
|
|
@@ -164,9 +164,9 @@ const LmvzInput = class extends reactiveControllerHost.ReactiveControllerHost {
|
|
|
164
164
|
render() {
|
|
165
165
|
const hasValue = Boolean(this.value);
|
|
166
166
|
const shouldFloatLabel = hasValue || Boolean(this.placeholder);
|
|
167
|
-
return (index.h("div", { key: '
|
|
167
|
+
return (index.h("div", { key: '22be29e5fcd4976fc6c4d125781be00acef0b359', class: index$1.classNames('input-container', {
|
|
168
168
|
'interaction-filled': hasValue,
|
|
169
|
-
}) }, index.h("div", { key: '
|
|
169
|
+
}) }, index.h("div", { key: 'ffeb620419316976e800b16b4a9fd9538f1efd26', class: "input-wrapper" }, index.h("slot", { key: '2a1a67f7fde0232b2bb5ce3cc228b869e5ac3516', name: "before-input" }), index.h("div", { key: '3bbe623cae67d376c60a28306164293a712b1bb5', class: "label-input-group" }, index.h("label", { key: 'c260b3eb249d5c785fe3b6e223c7428a8c147f50', htmlFor: this.inputId, class: index$1.classNames({ floating: shouldFloatLabel }) }, this.label, this.required && (index.h("span", { key: 'f43dd77efe7e319428dd72ec8933b7587635e767', class: "required-indicator", "aria-hidden": "true" }, ' ', "*"))), index.h("input", { key: 'eeb821a74a5ac7aab3fab65a48a37d21a22744e6', id: this.inputId, ref: (el) => (this.nativeInputElement = el), type: this.type, min: this.min, max: this.max, step: this.step, value: this.value, name: this.name, placeholder: this.placeholder, disabled: this.disabled, readOnly: this.readonly, required: this.required, form: this.form, autocomplete: this.autocomplete, inputmode: this.inputmode, autocorrect: this.autocorrect, autocapitalize: this.autocapitalize, spellcheck: this.spellcheck, autofocus: this.autofocus, minlength: this.minlength, maxlength: this.maxlength, pattern: this.pattern, "aria-invalid": this.error ? 'true' : 'false', "aria-required": this.required ? 'true' : 'false', "aria-describedby": this.describedBy, "aria-errormessage": this.errorId, onInput: this.handleInput, onChange: this.handleChange, onFocus: this.handleFocus, onBlur: this.handleBlur })), index.h("slot", { key: 'dd36a212c05c43ab2a8249750c14a7475b6d65d3', name: "after-input" })), index.h("div", { key: 'c2aedd67036faf4d3dc459c3c1fab8d07ee5a991', id: this.helperId, role: "status" }, this.helperText || null), index.h("div", { key: '01d2a6d6df9b3804a595711c7b57b6177d311c39', id: this.errorId, role: "alert" }, (this.showErrorMessage && this.errorMessage) || null)));
|
|
170
170
|
}
|
|
171
171
|
static get formAssociated() { return true; }
|
|
172
172
|
static get watchers() { return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-C2yDXRqP.js');
|
|
4
|
-
var reactiveControllerHost = require('./reactive-controller-host-
|
|
4
|
+
var reactiveControllerHost = require('./reactive-controller-host-Bi9eu2bV.js');
|
|
5
5
|
var elementActivationController = require('./element-activation-controller-DC_6T0Rt.js');
|
|
6
6
|
require('./aria-loader-CfFuAbJn.js');
|
|
7
7
|
|
|
@@ -28,7 +28,7 @@ const LmvzMenuItem = class extends reactiveControllerHost.ReactiveControllerHost
|
|
|
28
28
|
this.addController(new elementActivationController.ElementActivationController(this));
|
|
29
29
|
}
|
|
30
30
|
render() {
|
|
31
|
-
return (index.h(index.Host, { key: '
|
|
31
|
+
return (index.h(index.Host, { key: '0878343aec1c98c16c073c6cdd3382ee5c980799' }, index.h("slot", { key: 'f7a87d4c9d786bb4686d406d4313e9b5d79701d6', ref: (e) => (this.validationSlot = e) })));
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
LmvzMenuItem.style = lmvzMenuitemCss();
|