@momentum-design/components 0.27.2 → 0.27.4
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/dist/browser/index.js +68 -68
- package/dist/browser/index.js.map +3 -3
- package/dist/components/avatarbutton/avatarbutton.component.d.ts +5 -0
- package/dist/components/avatarbutton/avatarbutton.component.js +5 -0
- package/dist/components/button/button.component.d.ts +5 -0
- package/dist/components/button/button.component.js +25 -16
- package/dist/components/buttonsimple/buttonsimple.component.d.ts +5 -0
- package/dist/components/buttonsimple/buttonsimple.component.js +5 -0
- package/dist/components/checkbox/checkbox.component.d.ts +3 -0
- package/dist/components/checkbox/checkbox.component.js +3 -0
- package/dist/components/icon/icon.component.js +29 -16
- package/dist/components/icon/icon.utils.d.ts +2 -2
- package/dist/components/icon/icon.utils.js +2 -2
- package/dist/components/iconprovider/iconprovider.component.d.ts +33 -29
- package/dist/components/iconprovider/iconprovider.component.js +33 -5
- package/dist/components/iconprovider/iconprovider.constants.d.ts +1 -0
- package/dist/components/iconprovider/iconprovider.constants.js +1 -0
- package/dist/components/iconprovider/iconprovider.context.d.ts +3 -1
- package/dist/components/iconprovider/iconprovider.types.d.ts +3 -0
- package/dist/components/iconprovider/iconprovider.types.js +1 -0
- package/dist/components/input/input.component.d.ts +5 -0
- package/dist/components/input/input.component.js +5 -0
- package/dist/components/radio/radio.component.d.ts +3 -0
- package/dist/components/radio/radio.component.js +3 -0
- package/dist/components/tab/tab.component.d.ts +5 -0
- package/dist/components/tab/tab.component.js +5 -0
- package/dist/components/toggle/toggle.component.d.ts +3 -0
- package/dist/components/toggle/toggle.component.js +3 -0
- package/dist/components/virtualizedlist/virtualizedlist.component.d.ts +2 -0
- package/dist/components/virtualizedlist/virtualizedlist.component.js +2 -0
- package/dist/custom-elements.json +261 -21
- package/dist/react/avatarbutton/index.d.ts +11 -1
- package/dist/react/avatarbutton/index.js +11 -1
- package/dist/react/button/index.d.ts +11 -1
- package/dist/react/button/index.js +11 -1
- package/dist/react/buttonsimple/index.d.ts +11 -1
- package/dist/react/buttonsimple/index.js +11 -1
- package/dist/react/checkbox/index.d.ts +8 -1
- package/dist/react/checkbox/index.js +8 -1
- package/dist/react/iconprovider/index.d.ts +11 -5
- package/dist/react/iconprovider/index.js +11 -5
- package/dist/react/input/index.d.ts +12 -1
- package/dist/react/input/index.js +12 -1
- package/dist/react/radio/index.d.ts +8 -1
- package/dist/react/radio/index.js +8 -1
- package/dist/react/tab/index.d.ts +11 -1
- package/dist/react/tab/index.js +11 -1
- package/dist/react/toggle/index.d.ts +8 -1
- package/dist/react/toggle/index.js +8 -1
- package/dist/react/virtualizedlist/index.d.ts +5 -1
- package/dist/react/virtualizedlist/index.js +5 -1
- package/package.json +1 -1
@@ -10,6 +10,11 @@ declare const AvatarButton_base: import("../../utils/mixins/index.types").Constr
|
|
10
10
|
*
|
11
11
|
* @dependency mdc-avatar
|
12
12
|
*
|
13
|
+
* @event click - (React: onClick) This event is dispatched when the avatarbutton is clicked.
|
14
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the avatarbutton.
|
15
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the avatarbutton.
|
16
|
+
* @event focus - (React: onFocus) This event is dispatched when the avatarbutton receives focus.
|
17
|
+
*
|
13
18
|
* @tagname mdc-avatarbutton
|
14
19
|
*/
|
15
20
|
declare class AvatarButton extends AvatarButton_base {
|
@@ -24,6 +24,11 @@ import styles from './avatarbutton.styles';
|
|
24
24
|
*
|
25
25
|
* @dependency mdc-avatar
|
26
26
|
*
|
27
|
+
* @event click - (React: onClick) This event is dispatched when the avatarbutton is clicked.
|
28
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the avatarbutton.
|
29
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the avatarbutton.
|
30
|
+
* @event focus - (React: onFocus) This event is dispatched when the avatarbutton receives focus.
|
31
|
+
*
|
27
32
|
* @tagname mdc-avatarbutton
|
28
33
|
*/
|
29
34
|
class AvatarButton extends AvatarComponentMixin(IconNameMixin(Buttonsimple)) {
|
@@ -30,6 +30,11 @@ import type { ButtonColor, ButtonVariant, IconButtonSize, PillButtonSize } from
|
|
30
30
|
*
|
31
31
|
* @dependency mdc-icon
|
32
32
|
*
|
33
|
+
* @event click - (React: onClick) This event is dispatched when the button is clicked.
|
34
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the button.
|
35
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the button.
|
36
|
+
* @event focus - (React: onFocus) This event is dispatched when the button receives focus.
|
37
|
+
*
|
33
38
|
* @tagname mdc-button
|
34
39
|
*
|
35
40
|
* @slot - Text label of the button.
|
@@ -41,6 +41,11 @@ import { getIconNameWithoutStyle, getIconSize } from './button.utils';
|
|
41
41
|
*
|
42
42
|
* @dependency mdc-icon
|
43
43
|
*
|
44
|
+
* @event click - (React: onClick) This event is dispatched when the button is clicked.
|
45
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the button.
|
46
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the button.
|
47
|
+
* @event focus - (React: onFocus) This event is dispatched when the button receives focus.
|
48
|
+
*
|
44
49
|
* @tagname mdc-button
|
45
50
|
*
|
46
51
|
* @slot - Text label of the button.
|
@@ -152,8 +157,8 @@ class Button extends Buttonsimple {
|
|
152
157
|
setSize(size) {
|
153
158
|
const isIconType = this.typeInternal === BUTTON_TYPE_INTERNAL.ICON;
|
154
159
|
const isValidSize = isIconType
|
155
|
-
?
|
156
|
-
&& !(size === ICON_BUTTON_SIZES[20] && this.variant !== BUTTON_VARIANTS.TERTIARY)
|
160
|
+
? Object.values(ICON_BUTTON_SIZES).includes(size)
|
161
|
+
&& !(size === ICON_BUTTON_SIZES[20] && this.variant !== BUTTON_VARIANTS.TERTIARY)
|
157
162
|
: Object.values(PILL_BUTTON_SIZES).includes(size);
|
158
163
|
this.setAttribute('size', isValidSize ? `${size}` : `${DEFAULTS.SIZE}`);
|
159
164
|
this.iconSize = getIconSize(size);
|
@@ -194,21 +199,25 @@ class Button extends Buttonsimple {
|
|
194
199
|
}
|
195
200
|
render() {
|
196
201
|
return html `
|
197
|
-
${this.prefixIcon
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
202
|
+
${this.prefixIcon
|
203
|
+
? html ` <mdc-icon
|
204
|
+
name="${this.prefixIcon}"
|
205
|
+
part="prefix-icon"
|
206
|
+
size=${this.iconSize}
|
207
|
+
length-unit="rem"
|
208
|
+
>
|
209
|
+
</mdc-icon>`
|
210
|
+
: ''}
|
204
211
|
<slot @slotchange=${this.inferButtonType}></slot>
|
205
|
-
${this.postfixIcon
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
+
${this.postfixIcon
|
213
|
+
? html ` <mdc-icon
|
214
|
+
name="${this.postfixIcon}"
|
215
|
+
part="postfix-icon"
|
216
|
+
size=${this.iconSize}
|
217
|
+
length-unit="rem"
|
218
|
+
>
|
219
|
+
</mdc-icon>`
|
220
|
+
: ''}
|
212
221
|
`;
|
213
222
|
}
|
214
223
|
}
|
@@ -8,6 +8,11 @@ declare const Buttonsimple_base: import("../../utils/mixins/index.types").Constr
|
|
8
8
|
* It is used as an internal component and is not intended to be used directly by consumers.
|
9
9
|
* Consumers should use the `mdc-button` component instead.
|
10
10
|
*
|
11
|
+
* @event click - (React: onClick) This event is dispatched when the button is clicked.
|
12
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the button.
|
13
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the button.
|
14
|
+
* @event focus - (React: onFocus) This event is dispatched when the button receives focus.
|
15
|
+
*
|
11
16
|
* @tagname mdc-buttonsimple
|
12
17
|
*/
|
13
18
|
declare class Buttonsimple extends Buttonsimple_base {
|
@@ -19,6 +19,11 @@ import styles from './buttonsimple.styles';
|
|
19
19
|
* It is used as an internal component and is not intended to be used directly by consumers.
|
20
20
|
* Consumers should use the `mdc-button` component instead.
|
21
21
|
*
|
22
|
+
* @event click - (React: onClick) This event is dispatched when the button is clicked.
|
23
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the button.
|
24
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the button.
|
25
|
+
* @event focus - (React: onFocus) This event is dispatched when the button receives focus.
|
26
|
+
*
|
22
27
|
* @tagname mdc-buttonsimple
|
23
28
|
*/
|
24
29
|
class Buttonsimple extends TabIndexMixin(DisabledMixin(Component)) {
|
@@ -13,6 +13,9 @@ declare const Checkbox_base: import("../../utils/mixins/index.types").Constructo
|
|
13
13
|
*
|
14
14
|
* @tagname mdc-checkbox
|
15
15
|
*
|
16
|
+
* @event change - (React: onChange) Event that gets dispatched when the checkbox state changes.
|
17
|
+
* @event focus - (React: onFocus) Event that gets dispatched when the checkbox receives focus.
|
18
|
+
*
|
16
19
|
* @cssproperty --mdc-checkbox-background-color-hover - Allows customization of the background color on hover.
|
17
20
|
* @cssproperty --mdc-checkbox-border-color - Border color in high contrast.
|
18
21
|
* @cssproperty --mdc-checkbox-checked-background-color - Background color for a selected checkbox.
|
@@ -29,6 +29,9 @@ import styles from './checkbox.styles';
|
|
29
29
|
*
|
30
30
|
* @tagname mdc-checkbox
|
31
31
|
*
|
32
|
+
* @event change - (React: onChange) Event that gets dispatched when the checkbox state changes.
|
33
|
+
* @event focus - (React: onFocus) Event that gets dispatched when the checkbox receives focus.
|
34
|
+
*
|
32
35
|
* @cssproperty --mdc-checkbox-background-color-hover - Allows customization of the background color on hover.
|
33
36
|
* @cssproperty --mdc-checkbox-border-color - Border color in high contrast.
|
34
37
|
* @cssproperty --mdc-checkbox-checked-background-color - Background color for a selected checkbox.
|
@@ -13,7 +13,7 @@ import styles from './icon.styles';
|
|
13
13
|
import { Component } from '../../models';
|
14
14
|
import providerUtils from '../../utils/provider';
|
15
15
|
import IconProvider from '../iconprovider/iconprovider.component';
|
16
|
-
import {
|
16
|
+
import { svgFetch } from './icon.utils';
|
17
17
|
import { DEFAULTS } from './icon.constants';
|
18
18
|
/**
|
19
19
|
* Icon component that dynamically displays SVG icons based on a valid name.
|
@@ -101,8 +101,8 @@ class Icon extends Component {
|
|
101
101
|
*/
|
102
102
|
async getIconData() {
|
103
103
|
if (this.iconProviderContext.value) {
|
104
|
-
const { fileExtension, url, cacheName, cacheStrategy } = this.iconProviderContext.value;
|
105
|
-
if (url && fileExtension && this.name) {
|
104
|
+
const { fileExtension, url, cacheName, iconSet, cacheStrategy } = this.iconProviderContext.value;
|
105
|
+
if (iconSet === 'custom-icons' && url && fileExtension && this.name) {
|
106
106
|
// function to abort the fetch request and create a new signal
|
107
107
|
// (directly passing the abortcontroller to the fetch request per reference
|
108
108
|
// will not work due to JS call-by-sharing behavior)
|
@@ -111,25 +111,38 @@ class Icon extends Component {
|
|
111
111
|
this.abortController = new AbortController();
|
112
112
|
return this.abortController.signal;
|
113
113
|
};
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
114
|
+
// fetch icon data (including caching logic)
|
115
|
+
return svgFetch({
|
116
|
+
url,
|
117
|
+
name: this.name,
|
118
|
+
fileExtension,
|
119
|
+
cacheName,
|
120
|
+
cacheStrategy,
|
121
|
+
renewSignal,
|
122
|
+
})
|
123
|
+
.then((iconData) => {
|
124
124
|
// parse the fetched icon string to an html element and set the attributes
|
125
125
|
const iconElement = this.prepareIconElement(iconData);
|
126
126
|
this.handleIconLoadedSuccess(iconElement);
|
127
|
-
}
|
128
|
-
|
127
|
+
})
|
128
|
+
.catch((error) => {
|
129
129
|
this.handleIconLoadedFailure(error);
|
130
|
-
}
|
130
|
+
});
|
131
|
+
}
|
132
|
+
if (iconSet === 'momentum-icons' && this.name) {
|
133
|
+
// dynamic import of the lit template from the momentum icons package
|
134
|
+
return import(`@momentum-design/icons/dist/ts/${this.name}.ts`)
|
135
|
+
.then((module) => {
|
136
|
+
this.handleIconLoadedSuccess(module.default());
|
137
|
+
})
|
138
|
+
.catch((error) => {
|
139
|
+
this.handleIconLoadedFailure(error);
|
140
|
+
});
|
131
141
|
}
|
132
142
|
}
|
143
|
+
const noIconProviderError = new Error('IconProvider not found or not properly set up.');
|
144
|
+
this.handleIconLoadedFailure(noIconProviderError);
|
145
|
+
return Promise.reject(noIconProviderError);
|
133
146
|
}
|
134
147
|
/**
|
135
148
|
* Sets the iconData state to the fetched icon.
|
@@ -28,5 +28,5 @@ interface Args {
|
|
28
28
|
* @returns Response string from the fetch
|
29
29
|
* @throws Error if the response is not ok
|
30
30
|
*/
|
31
|
-
declare const
|
32
|
-
export {
|
31
|
+
declare const svgFetch: ({ url, name, fileExtension, cacheStrategy, cacheName, renewSignal, }: Args) => Promise<string>;
|
32
|
+
export { svgFetch };
|
@@ -33,7 +33,7 @@ const fetchIcon = async (request) => fetch(request).then((response) => {
|
|
33
33
|
* @returns Response string from the fetch
|
34
34
|
* @throws Error if the response is not ok
|
35
35
|
*/
|
36
|
-
const
|
36
|
+
const svgFetch = async ({ url, name, fileExtension, cacheStrategy, cacheName, renewSignal, }) => {
|
37
37
|
// abort the previous fetch request if it is still pending
|
38
38
|
// and create a new signal
|
39
39
|
const signal = renewSignal();
|
@@ -76,4 +76,4 @@ const dynamicSVGImport = async ({ url, name, fileExtension, cacheStrategy, cache
|
|
76
76
|
throw new Error(`Error in caching the Icon ${name}, ${error}`);
|
77
77
|
}));
|
78
78
|
};
|
79
|
-
export {
|
79
|
+
export { svgFetch };
|
@@ -1,15 +1,22 @@
|
|
1
1
|
import { Provider } from '../../models';
|
2
2
|
import IconProviderContext from './iconprovider.context';
|
3
|
+
import type { CacheStrategy, IconSet } from './iconprovider.types';
|
3
4
|
/**
|
4
5
|
* IconProvider component, which allows to be consumed from sub components
|
5
6
|
* (see `providerUtils.consume` for how to consume)
|
6
7
|
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
8
|
+
* Attribute `iconSet` can be set to either `momentum-icons` or `custom-icons`.
|
9
|
+
* If `momentum-icons` is selected, the icons will be fetched from the
|
10
|
+
* Momentum Design System icon set per a dynamic JS Import (no need to provide a URL).
|
11
|
+
* This requires the consumer to have the `@momentum-designs` package installed and the
|
12
|
+
* build tooling needs to support dynamic imports.
|
10
13
|
*
|
11
|
-
* If `
|
12
|
-
*
|
14
|
+
* If `custom-icons` is selected, the icons will be fetched from the provided URL.
|
15
|
+
* This requires the consumer to provide a URL from which the icons will be fetched and
|
16
|
+
* the consumer needs to make sure to bundle the icons in the application.
|
17
|
+
*
|
18
|
+
* If `cacheStrategy` is provided (only works with iconSet = `custom-icons`), the
|
19
|
+
* IconProvider will cache the icons in the selected cache (either web-api-cache or in-memory-cache),
|
13
20
|
* to avoid fetching the same icon multiple times over the network.
|
14
21
|
* This is useful when the same icon is used multiple times in the application.
|
15
22
|
* To consider:
|
@@ -28,36 +35,31 @@ declare class IconProvider extends Provider<IconProviderContext> {
|
|
28
35
|
* Context object of the IconProvider, to be consumed by child components
|
29
36
|
*/
|
30
37
|
static get Context(): {
|
31
|
-
/**
|
32
|
-
* IconProvider component, which allows to be consumed from sub components
|
33
|
-
* (see `providerUtils.consume` for how to consume)
|
34
|
-
*
|
35
|
-
* Bundling icons will be up to the consumer of this component, such
|
36
|
-
* that only a url has to be passed in from which the icons will be
|
37
|
-
* fetched.
|
38
|
-
*
|
39
|
-
* If `cacheStrategy` is provided, the IconProvider will cache the icons
|
40
|
-
* in the selected cache (either web-api-cache or in-memory-cache),
|
41
|
-
* to avoid fetching the same icon multiple times over the network.
|
42
|
-
* This is useful when the same icon is used multiple times in the application.
|
43
|
-
* To consider:
|
44
|
-
* - The `in-memory-cache` is not persisted and will be lost when the
|
45
|
-
* IconProvider is removed from the DOM.
|
46
|
-
* - The `web-api-cache` is persisted, but only works in https environments
|
47
|
-
* (https://developer.mozilla.org/en-US/docs/Web/API/Cache).
|
48
|
-
*
|
49
|
-
* @tagname mdc-iconprovider
|
50
|
-
*
|
51
|
-
* @slot - children
|
52
|
-
*/
|
53
38
|
__context__: IconProviderContext;
|
54
39
|
};
|
40
|
+
/**
|
41
|
+
* Icon set to be used
|
42
|
+
*
|
43
|
+
* If `momentum-icons` is selected, the icons will be fetched from the
|
44
|
+
* Momentum Design System icon set per a dynamic JS Import (no need to provide a URL).
|
45
|
+
* This requires the consumer to have the `@momentum-designs` package installed and the
|
46
|
+
* build tooling needs to support dynamic imports.
|
47
|
+
*
|
48
|
+
* If `custom-icons` is selected, the icons will be fetched from the provided URL.
|
49
|
+
* This requires the consumer to provide a URL from which the icons will be fetched and
|
50
|
+
* the consumer needs to make sure to bundle the icons in the application.
|
51
|
+
*
|
52
|
+
* @default momentum-icons
|
53
|
+
*/
|
54
|
+
iconSet?: IconSet;
|
55
55
|
/**
|
56
56
|
* Url of where icons will be fetched from
|
57
|
+
* (if Icon set is `custom-icons`, this will be the base url)
|
57
58
|
*/
|
58
59
|
url?: string;
|
59
60
|
/**
|
60
61
|
* File extension of icons
|
62
|
+
* (if Icon set is `custom-icons`, this will be the file extension for icons)
|
61
63
|
* @default svg
|
62
64
|
*/
|
63
65
|
fileExtension?: string;
|
@@ -75,6 +77,8 @@ declare class IconProvider extends Provider<IconProviderContext> {
|
|
75
77
|
/**
|
76
78
|
* Icons Cache Strategy to use
|
77
79
|
*
|
80
|
+
* **Can only be used if Icon set is `custom-icons`**
|
81
|
+
*
|
78
82
|
* Choose `in-memory-cache` to cache icons in a JS cache (in-memory cache).
|
79
83
|
* Choose `web-cache-api` to cache icons using the Web Cache API.
|
80
84
|
*
|
@@ -83,9 +87,9 @@ declare class IconProvider extends Provider<IconProviderContext> {
|
|
83
87
|
* If not provided or invalid value provided, the icons will not be cached.
|
84
88
|
* @default undefined
|
85
89
|
*/
|
86
|
-
cacheStrategy?:
|
90
|
+
cacheStrategy?: CacheStrategy;
|
87
91
|
/**
|
88
|
-
* Icons Cache Name to use
|
92
|
+
* Icons Cache Name to use (cache strategy must be provided)
|
89
93
|
*
|
90
94
|
* If provided, Icons inside the provider will be cached in the
|
91
95
|
* cache (determined by `cache-strategy`) with the provided name.
|
@@ -15,12 +15,18 @@ import { ALLOWED_FILE_EXTENSIONS, DEFAULTS, ALLOWED_LENGTH_UNITS } from './iconp
|
|
15
15
|
* IconProvider component, which allows to be consumed from sub components
|
16
16
|
* (see `providerUtils.consume` for how to consume)
|
17
17
|
*
|
18
|
-
*
|
19
|
-
*
|
20
|
-
*
|
18
|
+
* Attribute `iconSet` can be set to either `momentum-icons` or `custom-icons`.
|
19
|
+
* If `momentum-icons` is selected, the icons will be fetched from the
|
20
|
+
* Momentum Design System icon set per a dynamic JS Import (no need to provide a URL).
|
21
|
+
* This requires the consumer to have the `@momentum-designs` package installed and the
|
22
|
+
* build tooling needs to support dynamic imports.
|
21
23
|
*
|
22
|
-
* If `
|
23
|
-
*
|
24
|
+
* If `custom-icons` is selected, the icons will be fetched from the provided URL.
|
25
|
+
* This requires the consumer to provide a URL from which the icons will be fetched and
|
26
|
+
* the consumer needs to make sure to bundle the icons in the application.
|
27
|
+
*
|
28
|
+
* If `cacheStrategy` is provided (only works with iconSet = `custom-icons`), the
|
29
|
+
* IconProvider will cache the icons in the selected cache (either web-api-cache or in-memory-cache),
|
24
30
|
* to avoid fetching the same icon multiple times over the network.
|
25
31
|
* This is useful when the same icon is used multiple times in the application.
|
26
32
|
* To consider:
|
@@ -40,8 +46,24 @@ class IconProvider extends Provider {
|
|
40
46
|
context: IconProviderContext.context,
|
41
47
|
initialValue: new IconProviderContext(),
|
42
48
|
});
|
49
|
+
/**
|
50
|
+
* Icon set to be used
|
51
|
+
*
|
52
|
+
* If `momentum-icons` is selected, the icons will be fetched from the
|
53
|
+
* Momentum Design System icon set per a dynamic JS Import (no need to provide a URL).
|
54
|
+
* This requires the consumer to have the `@momentum-designs` package installed and the
|
55
|
+
* build tooling needs to support dynamic imports.
|
56
|
+
*
|
57
|
+
* If `custom-icons` is selected, the icons will be fetched from the provided URL.
|
58
|
+
* This requires the consumer to provide a URL from which the icons will be fetched and
|
59
|
+
* the consumer needs to make sure to bundle the icons in the application.
|
60
|
+
*
|
61
|
+
* @default momentum-icons
|
62
|
+
*/
|
63
|
+
this.iconSet = DEFAULTS.ICON_SET;
|
43
64
|
/**
|
44
65
|
* File extension of icons
|
66
|
+
* (if Icon set is `custom-icons`, this will be the file extension for icons)
|
45
67
|
* @default svg
|
46
68
|
*/
|
47
69
|
this.fileExtension = DEFAULTS.FILE_EXTENSION;
|
@@ -73,6 +95,7 @@ class IconProvider extends Provider {
|
|
73
95
|
this.fileExtension = DEFAULTS.FILE_EXTENSION;
|
74
96
|
this.context.value.fileExtension = DEFAULTS.FILE_EXTENSION;
|
75
97
|
}
|
98
|
+
this.context.value.iconSet = this.iconSet;
|
76
99
|
this.context.value.url = this.url;
|
77
100
|
this.context.value.size = this.size;
|
78
101
|
this.context.value.cacheName = this.cacheName;
|
@@ -88,6 +111,7 @@ class IconProvider extends Provider {
|
|
88
111
|
}
|
89
112
|
updateContext() {
|
90
113
|
if (this.context.value.fileExtension !== this.fileExtension
|
114
|
+
|| this.context.value.iconSet !== this.iconSet
|
91
115
|
|| this.context.value.url !== this.url
|
92
116
|
|| this.context.value.lengthUnit !== this.lengthUnit
|
93
117
|
|| this.context.value.size !== this.size
|
@@ -98,6 +122,10 @@ class IconProvider extends Provider {
|
|
98
122
|
}
|
99
123
|
}
|
100
124
|
}
|
125
|
+
__decorate([
|
126
|
+
property({ type: String, attribute: 'icon-set', reflect: true }),
|
127
|
+
__metadata("design:type", String)
|
128
|
+
], IconProvider.prototype, "iconSet", void 0);
|
101
129
|
__decorate([
|
102
130
|
property({ type: String }),
|
103
131
|
__metadata("design:type", String)
|
@@ -1,10 +1,12 @@
|
|
1
|
+
import type { IconSet, CacheStrategy } from './iconprovider.types';
|
1
2
|
declare class IconProviderContext {
|
3
|
+
iconSet?: IconSet;
|
2
4
|
fileExtension?: string;
|
3
5
|
url?: string;
|
4
6
|
lengthUnit?: string;
|
5
7
|
size?: number;
|
6
8
|
cacheName?: string;
|
7
|
-
cacheStrategy?:
|
9
|
+
cacheStrategy?: CacheStrategy;
|
8
10
|
static readonly context: {
|
9
11
|
__context__: IconProviderContext;
|
10
12
|
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -17,6 +17,11 @@ declare const Input_base: import("../../utils/mixins/index.types").Constructor<i
|
|
17
17
|
*
|
18
18
|
* @tagname mdc-input
|
19
19
|
*
|
20
|
+
* @event input - (React: onInput) This event is dispatched when the value of the input field changes (every press).
|
21
|
+
* @event change - (React: onChange) This event is dispatched when the value of the input field changes (on blur).
|
22
|
+
* @event focus - (React: onFocus) This event is dispatched when the input receives focus.
|
23
|
+
* @event blur - (React: onBlur) This event is dispatched when the input loses focus.
|
24
|
+
*
|
20
25
|
* @dependency mdc-icon
|
21
26
|
* @dependency mdc-text
|
22
27
|
* @dependency mdc-button
|
@@ -31,6 +31,11 @@ import { DataAriaLabelMixin } from '../../utils/mixins/DataAriaLabelMixin';
|
|
31
31
|
*
|
32
32
|
* @tagname mdc-input
|
33
33
|
*
|
34
|
+
* @event input - (React: onInput) This event is dispatched when the value of the input field changes (every press).
|
35
|
+
* @event change - (React: onChange) This event is dispatched when the value of the input field changes (on blur).
|
36
|
+
* @event focus - (React: onFocus) This event is dispatched when the input receives focus.
|
37
|
+
* @event blur - (React: onBlur) This event is dispatched when the input loses focus.
|
38
|
+
*
|
34
39
|
* @dependency mdc-icon
|
35
40
|
* @dependency mdc-text
|
36
41
|
* @dependency mdc-button
|
@@ -10,6 +10,9 @@ declare const Radio_base: import("../../utils/mixins/index.types").Constructor<i
|
|
10
10
|
*
|
11
11
|
* @tagname mdc-radio
|
12
12
|
*
|
13
|
+
* @event change - (React: onChange) Event that gets dispatched when the radio state changes.
|
14
|
+
* @event focus - (React: onFocus) Event that gets dispatched when the radio receives focus.
|
15
|
+
*
|
13
16
|
* @cssproperty --mdc-radio-inner-circle-size - size of the inner circle
|
14
17
|
* @cssproperty --mdc-radio-text-disabled-color - color of the label when disabled
|
15
18
|
* @cssproperty --mdc-radio-disabled-border-color - color of the radio button border when disabled
|
@@ -25,6 +25,9 @@ import { DEFAULTS as FORMFIELD_DEFAULTS } from '../formfieldwrapper/formfieldwra
|
|
25
25
|
*
|
26
26
|
* @tagname mdc-radio
|
27
27
|
*
|
28
|
+
* @event change - (React: onChange) Event that gets dispatched when the radio state changes.
|
29
|
+
* @event focus - (React: onFocus) Event that gets dispatched when the radio receives focus.
|
30
|
+
*
|
28
31
|
* @cssproperty --mdc-radio-inner-circle-size - size of the inner circle
|
29
32
|
* @cssproperty --mdc-radio-text-disabled-color - color of the label when disabled
|
30
33
|
* @cssproperty --mdc-radio-disabled-border-color - color of the radio button border when disabled
|
@@ -19,6 +19,11 @@ declare const Tab_base: import("../../utils/mixins/index.types").Constructor<imp
|
|
19
19
|
* @dependency mdc-icon
|
20
20
|
* @dependency mdc-text
|
21
21
|
*
|
22
|
+
* @event click - (React: onClick) This event is dispatched when the tab is clicked.
|
23
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the tab.
|
24
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the tab.
|
25
|
+
* @event focus - (React: onFocus) This event is dispatched when the tab receives focus.
|
26
|
+
*
|
22
27
|
* @tagname mdc-tab
|
23
28
|
*
|
24
29
|
* @cssproperty --mdc-tab-content-gap - Gap between the badge(if provided), icon and text.
|
@@ -32,6 +32,11 @@ import { IconNameMixin } from '../../utils/mixins/IconNameMixin';
|
|
32
32
|
* @dependency mdc-icon
|
33
33
|
* @dependency mdc-text
|
34
34
|
*
|
35
|
+
* @event click - (React: onClick) This event is dispatched when the tab is clicked.
|
36
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the tab.
|
37
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the tab.
|
38
|
+
* @event focus - (React: onFocus) This event is dispatched when the tab receives focus.
|
39
|
+
*
|
35
40
|
* @tagname mdc-tab
|
36
41
|
*
|
37
42
|
* @cssproperty --mdc-tab-content-gap - Gap between the badge(if provided), icon and text.
|
@@ -16,6 +16,9 @@ declare const Toggle_base: import("../../utils/mixins/index.types").Constructor<
|
|
16
16
|
*
|
17
17
|
* @tagname mdc-toggle
|
18
18
|
*
|
19
|
+
* @event change - (React: onChange) Event that gets dispatched when the toggle state changes.
|
20
|
+
* @event focus - (React: onFocus) Event that gets dispatched when the toggle receives focus.
|
21
|
+
*
|
19
22
|
* @cssproperty --mdc-toggle-width - width of the toggle
|
20
23
|
* @cssproperty --mdc-toggle-height - height of the toggle
|
21
24
|
* @cssproperty --mdc-toggle-width-compact - width of the toggle when it's size is compact
|
@@ -31,6 +31,9 @@ import { DataAriaLabelMixin } from '../../utils/mixins/DataAriaLabelMixin';
|
|
31
31
|
*
|
32
32
|
* @tagname mdc-toggle
|
33
33
|
*
|
34
|
+
* @event change - (React: onChange) Event that gets dispatched when the toggle state changes.
|
35
|
+
* @event focus - (React: onFocus) Event that gets dispatched when the toggle receives focus.
|
36
|
+
*
|
34
37
|
* @cssproperty --mdc-toggle-width - width of the toggle
|
35
38
|
* @cssproperty --mdc-toggle-height - height of the toggle
|
36
39
|
* @cssproperty --mdc-toggle-width-compact - width of the toggle when it's size is compact
|
@@ -13,6 +13,8 @@ import { SetListDataProps, VirtualizerProps } from './virtualizedlist.types';
|
|
13
13
|
*
|
14
14
|
* @tagname mdc-virtualizedlist
|
15
15
|
*
|
16
|
+
* @event onscroll - (React: onScroll) Event that gets called when user scrolls inside of list.
|
17
|
+
*
|
16
18
|
* @slot - Client side List with nested list items.
|
17
19
|
*/
|
18
20
|
declare class VirtualizedList extends Component {
|
@@ -24,6 +24,8 @@ import { DEFAULTS } from './virtualizedlist.constants';
|
|
24
24
|
*
|
25
25
|
* @tagname mdc-virtualizedlist
|
26
26
|
*
|
27
|
+
* @event onscroll - (React: onScroll) Event that gets called when user scrolls inside of list.
|
28
|
+
*
|
27
29
|
* @slot - Client side List with nested list items.
|
28
30
|
*/
|
29
31
|
class VirtualizedList extends Component {
|