@momentum-design/components 0.95.3 → 0.95.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 +1 -1
- package/dist/browser/index.js.map +3 -3
- package/dist/components/select/select.component.d.ts +7 -0
- package/dist/components/select/select.component.js +16 -0
- package/dist/custom-elements.json +159 -148
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +1 -1
- package/package.json +1 -1
@@ -187,6 +187,13 @@ declare class Select extends Select_base implements AssociatedFormControl {
|
|
187
187
|
* @internal
|
188
188
|
*/
|
189
189
|
private handleNativeInputFocus;
|
190
|
+
/**
|
191
|
+
* Updates the state of the select component.
|
192
|
+
* This public method should be fired when the selected on the option components is updated from the outside.
|
193
|
+
* It ensures that the selected attribute is set correctly on the options
|
194
|
+
* and that the aria-selected attribute is updated accordingly.
|
195
|
+
*/
|
196
|
+
updateState(): void;
|
190
197
|
render(): import("lit-html").TemplateResult<1>;
|
191
198
|
static styles: Array<CSSResult>;
|
192
199
|
}
|
@@ -419,6 +419,22 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
|
419
419
|
handleNativeInputFocus() {
|
420
420
|
this.visualCombobox.focus();
|
421
421
|
}
|
422
|
+
/**
|
423
|
+
* Updates the state of the select component.
|
424
|
+
* This public method should be fired when the selected on the option components is updated from the outside.
|
425
|
+
* It ensures that the selected attribute is set correctly on the options
|
426
|
+
* and that the aria-selected attribute is updated accordingly.
|
427
|
+
*/
|
428
|
+
updateState() {
|
429
|
+
var _a;
|
430
|
+
const newSelectedOption = this.getFirstSelectedOption();
|
431
|
+
if (!newSelectedOption) {
|
432
|
+
this.setSelectedOption(this.placeholder ? null : this.getFirstValidOption());
|
433
|
+
}
|
434
|
+
else if (((_a = this.selectedOption) === null || _a === void 0 ? void 0 : _a.value) !== newSelectedOption.value) {
|
435
|
+
this.setSelectedOption(newSelectedOption);
|
436
|
+
}
|
437
|
+
}
|
422
438
|
render() {
|
423
439
|
var _a, _b, _c, _d, _e, _f;
|
424
440
|
return html `
|
@@ -29837,6 +29837,17 @@
|
|
29837
29837
|
],
|
29838
29838
|
"description": "Handles the keydown event on the select element when the popover is open.\nThe options are as follows:\n- HOME: Sets focus and tabindex on the first option.\n- END: Sets focus and tabindex on the last option.\n- ARROW_DOWN, ARROW_UP, PAGE_DOWN, PAGE_UP: Handles navigation between options."
|
29839
29839
|
},
|
29840
|
+
{
|
29841
|
+
"kind": "method",
|
29842
|
+
"name": "updateState",
|
29843
|
+
"privacy": "public",
|
29844
|
+
"return": {
|
29845
|
+
"type": {
|
29846
|
+
"text": "void"
|
29847
|
+
}
|
29848
|
+
},
|
29849
|
+
"description": "Updates the state of the select component.\nThis public method should be fired when the selected on the option components is updated from the outside.\nIt ensures that the selected attribute is set correctly on the options\nand that the aria-selected attribute is updated accordingly."
|
29850
|
+
},
|
29840
29851
|
{
|
29841
29852
|
"kind": "field",
|
29842
29853
|
"name": "name",
|
@@ -31014,6 +31025,154 @@
|
|
31014
31025
|
}
|
31015
31026
|
]
|
31016
31027
|
},
|
31028
|
+
{
|
31029
|
+
"kind": "javascript-module",
|
31030
|
+
"path": "components/staticradio/staticradio.component.js",
|
31031
|
+
"declarations": [
|
31032
|
+
{
|
31033
|
+
"kind": "class",
|
31034
|
+
"description": "This is a decorative component that is styled to look as a radio.\nIt has 2 properties - checked and disabled.\n\nWe are using the same styling that has been created for the `mdc-radio` component.",
|
31035
|
+
"name": "StaticRadio",
|
31036
|
+
"cssProperties": [
|
31037
|
+
{
|
31038
|
+
"description": "size of the inner circle",
|
31039
|
+
"name": "--mdc-staticradio-inner-circle-size"
|
31040
|
+
},
|
31041
|
+
{
|
31042
|
+
"description": "color of the label when disabled",
|
31043
|
+
"name": "--mdc-staticradio-text-disabled-color"
|
31044
|
+
},
|
31045
|
+
{
|
31046
|
+
"description": "color of the radio button border when normal",
|
31047
|
+
"name": "--mdc-staticradio-normal-border-color"
|
31048
|
+
},
|
31049
|
+
{
|
31050
|
+
"description": "color of the radio button border when disabled",
|
31051
|
+
"name": "--mdc-staticradio-disabled-border-color"
|
31052
|
+
},
|
31053
|
+
{
|
31054
|
+
"description": "background color of the inner circle when normal",
|
31055
|
+
"name": "--mdc-staticradio-inner-circle-normal-background"
|
31056
|
+
},
|
31057
|
+
{
|
31058
|
+
"description": "background color of the inner circle when disabled",
|
31059
|
+
"name": "--mdc-staticradio-inner-circle-disabled-background"
|
31060
|
+
},
|
31061
|
+
{
|
31062
|
+
"description": "color of the radio button when inactive",
|
31063
|
+
"name": "--mdc-staticradio-control-inactive-color"
|
31064
|
+
},
|
31065
|
+
{
|
31066
|
+
"description": "background color of the radio button when inactive and disabled",
|
31067
|
+
"name": "--mdc-staticradio-control-inactive-disabled-background"
|
31068
|
+
},
|
31069
|
+
{
|
31070
|
+
"description": "color of the radio button when active",
|
31071
|
+
"name": "--mdc-staticradio-control-active-color"
|
31072
|
+
},
|
31073
|
+
{
|
31074
|
+
"description": "background color of the radio button when active and disabled",
|
31075
|
+
"name": "--mdc-staticradio-control-active-disabled-background"
|
31076
|
+
}
|
31077
|
+
],
|
31078
|
+
"members": [
|
31079
|
+
{
|
31080
|
+
"kind": "field",
|
31081
|
+
"name": "checked",
|
31082
|
+
"type": {
|
31083
|
+
"text": "boolean"
|
31084
|
+
},
|
31085
|
+
"default": "false",
|
31086
|
+
"description": "Determines whether the radio is selected or unselected.",
|
31087
|
+
"attribute": "checked",
|
31088
|
+
"reflects": true
|
31089
|
+
},
|
31090
|
+
{
|
31091
|
+
"kind": "field",
|
31092
|
+
"name": "readonly",
|
31093
|
+
"type": {
|
31094
|
+
"text": "boolean"
|
31095
|
+
},
|
31096
|
+
"default": "false",
|
31097
|
+
"description": "Determines whether the radio is read-only.",
|
31098
|
+
"attribute": "readonly",
|
31099
|
+
"reflects": true
|
31100
|
+
},
|
31101
|
+
{
|
31102
|
+
"kind": "field",
|
31103
|
+
"name": "disabled",
|
31104
|
+
"type": {
|
31105
|
+
"text": "boolean | undefined"
|
31106
|
+
},
|
31107
|
+
"description": "Indicates whether the component is disabled.\nWhen the component is disabled for user interaction; it is not focusable or clickable.",
|
31108
|
+
"default": "undefined",
|
31109
|
+
"attribute": "disabled",
|
31110
|
+
"reflects": true,
|
31111
|
+
"inheritedFrom": {
|
31112
|
+
"name": "DisabledMixin",
|
31113
|
+
"module": "utils/mixins/DisabledMixin.js"
|
31114
|
+
}
|
31115
|
+
}
|
31116
|
+
],
|
31117
|
+
"attributes": [
|
31118
|
+
{
|
31119
|
+
"name": "checked",
|
31120
|
+
"type": {
|
31121
|
+
"text": "boolean"
|
31122
|
+
},
|
31123
|
+
"default": "false",
|
31124
|
+
"description": "Determines whether the radio is selected or unselected.",
|
31125
|
+
"fieldName": "checked"
|
31126
|
+
},
|
31127
|
+
{
|
31128
|
+
"name": "readonly",
|
31129
|
+
"type": {
|
31130
|
+
"text": "boolean"
|
31131
|
+
},
|
31132
|
+
"default": "false",
|
31133
|
+
"description": "Determines whether the radio is read-only.",
|
31134
|
+
"fieldName": "readonly"
|
31135
|
+
},
|
31136
|
+
{
|
31137
|
+
"name": "disabled",
|
31138
|
+
"type": {
|
31139
|
+
"text": "boolean | undefined"
|
31140
|
+
},
|
31141
|
+
"description": "Indicates whether the component is disabled.\nWhen the component is disabled for user interaction; it is not focusable or clickable.",
|
31142
|
+
"default": "undefined",
|
31143
|
+
"fieldName": "disabled",
|
31144
|
+
"inheritedFrom": {
|
31145
|
+
"name": "DisabledMixin",
|
31146
|
+
"module": "src/utils/mixins/DisabledMixin.ts"
|
31147
|
+
}
|
31148
|
+
}
|
31149
|
+
],
|
31150
|
+
"mixins": [
|
31151
|
+
{
|
31152
|
+
"name": "DisabledMixin",
|
31153
|
+
"module": "/src/utils/mixins/DisabledMixin"
|
31154
|
+
}
|
31155
|
+
],
|
31156
|
+
"superclass": {
|
31157
|
+
"name": "Component",
|
31158
|
+
"module": "/src/models"
|
31159
|
+
},
|
31160
|
+
"tagName": "mdc-staticradio",
|
31161
|
+
"jsDoc": "/**\n * This is a decorative component that is styled to look as a radio.\n * It has 2 properties - checked and disabled.\n *\n * We are using the same styling that has been created for the `mdc-radio` component.\n *\n * @tagname mdc-staticradio\n *\n * @cssproperty --mdc-staticradio-inner-circle-size - size of the inner circle\n * @cssproperty --mdc-staticradio-text-disabled-color - color of the label when disabled\n * @cssproperty --mdc-staticradio-normal-border-color - color of the radio button border when normal\n * @cssproperty --mdc-staticradio-disabled-border-color - color of the radio button border when disabled\n * @cssproperty --mdc-staticradio-inner-circle-normal-background - background color of the inner circle when normal\n * @cssproperty --mdc-staticradio-inner-circle-disabled-background - background color of the inner circle when disabled\n * @cssproperty --mdc-staticradio-control-inactive-color - color of the radio button when inactive\n * @cssproperty --mdc-staticradio-control-inactive-disabled-background - background color of the radio button when\n * inactive and disabled\n * @cssproperty --mdc-staticradio-control-active-color - color of the radio button when active\n * @cssproperty --mdc-staticradio-control-active-disabled-background - background color of the radio button\n * when active and disabled\n */",
|
31162
|
+
"customElement": true
|
31163
|
+
}
|
31164
|
+
],
|
31165
|
+
"exports": [
|
31166
|
+
{
|
31167
|
+
"kind": "js",
|
31168
|
+
"name": "default",
|
31169
|
+
"declaration": {
|
31170
|
+
"name": "StaticRadio",
|
31171
|
+
"module": "components/staticradio/staticradio.component.js"
|
31172
|
+
}
|
31173
|
+
}
|
31174
|
+
]
|
31175
|
+
},
|
31017
31176
|
{
|
31018
31177
|
"kind": "javascript-module",
|
31019
31178
|
"path": "components/statictoggle/statictoggle.component.js",
|
@@ -32091,154 +32250,6 @@
|
|
32091
32250
|
}
|
32092
32251
|
]
|
32093
32252
|
},
|
32094
|
-
{
|
32095
|
-
"kind": "javascript-module",
|
32096
|
-
"path": "components/staticradio/staticradio.component.js",
|
32097
|
-
"declarations": [
|
32098
|
-
{
|
32099
|
-
"kind": "class",
|
32100
|
-
"description": "This is a decorative component that is styled to look as a radio.\nIt has 2 properties - checked and disabled.\n\nWe are using the same styling that has been created for the `mdc-radio` component.",
|
32101
|
-
"name": "StaticRadio",
|
32102
|
-
"cssProperties": [
|
32103
|
-
{
|
32104
|
-
"description": "size of the inner circle",
|
32105
|
-
"name": "--mdc-staticradio-inner-circle-size"
|
32106
|
-
},
|
32107
|
-
{
|
32108
|
-
"description": "color of the label when disabled",
|
32109
|
-
"name": "--mdc-staticradio-text-disabled-color"
|
32110
|
-
},
|
32111
|
-
{
|
32112
|
-
"description": "color of the radio button border when normal",
|
32113
|
-
"name": "--mdc-staticradio-normal-border-color"
|
32114
|
-
},
|
32115
|
-
{
|
32116
|
-
"description": "color of the radio button border when disabled",
|
32117
|
-
"name": "--mdc-staticradio-disabled-border-color"
|
32118
|
-
},
|
32119
|
-
{
|
32120
|
-
"description": "background color of the inner circle when normal",
|
32121
|
-
"name": "--mdc-staticradio-inner-circle-normal-background"
|
32122
|
-
},
|
32123
|
-
{
|
32124
|
-
"description": "background color of the inner circle when disabled",
|
32125
|
-
"name": "--mdc-staticradio-inner-circle-disabled-background"
|
32126
|
-
},
|
32127
|
-
{
|
32128
|
-
"description": "color of the radio button when inactive",
|
32129
|
-
"name": "--mdc-staticradio-control-inactive-color"
|
32130
|
-
},
|
32131
|
-
{
|
32132
|
-
"description": "background color of the radio button when inactive and disabled",
|
32133
|
-
"name": "--mdc-staticradio-control-inactive-disabled-background"
|
32134
|
-
},
|
32135
|
-
{
|
32136
|
-
"description": "color of the radio button when active",
|
32137
|
-
"name": "--mdc-staticradio-control-active-color"
|
32138
|
-
},
|
32139
|
-
{
|
32140
|
-
"description": "background color of the radio button when active and disabled",
|
32141
|
-
"name": "--mdc-staticradio-control-active-disabled-background"
|
32142
|
-
}
|
32143
|
-
],
|
32144
|
-
"members": [
|
32145
|
-
{
|
32146
|
-
"kind": "field",
|
32147
|
-
"name": "checked",
|
32148
|
-
"type": {
|
32149
|
-
"text": "boolean"
|
32150
|
-
},
|
32151
|
-
"default": "false",
|
32152
|
-
"description": "Determines whether the radio is selected or unselected.",
|
32153
|
-
"attribute": "checked",
|
32154
|
-
"reflects": true
|
32155
|
-
},
|
32156
|
-
{
|
32157
|
-
"kind": "field",
|
32158
|
-
"name": "readonly",
|
32159
|
-
"type": {
|
32160
|
-
"text": "boolean"
|
32161
|
-
},
|
32162
|
-
"default": "false",
|
32163
|
-
"description": "Determines whether the radio is read-only.",
|
32164
|
-
"attribute": "readonly",
|
32165
|
-
"reflects": true
|
32166
|
-
},
|
32167
|
-
{
|
32168
|
-
"kind": "field",
|
32169
|
-
"name": "disabled",
|
32170
|
-
"type": {
|
32171
|
-
"text": "boolean | undefined"
|
32172
|
-
},
|
32173
|
-
"description": "Indicates whether the component is disabled.\nWhen the component is disabled for user interaction; it is not focusable or clickable.",
|
32174
|
-
"default": "undefined",
|
32175
|
-
"attribute": "disabled",
|
32176
|
-
"reflects": true,
|
32177
|
-
"inheritedFrom": {
|
32178
|
-
"name": "DisabledMixin",
|
32179
|
-
"module": "utils/mixins/DisabledMixin.js"
|
32180
|
-
}
|
32181
|
-
}
|
32182
|
-
],
|
32183
|
-
"attributes": [
|
32184
|
-
{
|
32185
|
-
"name": "checked",
|
32186
|
-
"type": {
|
32187
|
-
"text": "boolean"
|
32188
|
-
},
|
32189
|
-
"default": "false",
|
32190
|
-
"description": "Determines whether the radio is selected or unselected.",
|
32191
|
-
"fieldName": "checked"
|
32192
|
-
},
|
32193
|
-
{
|
32194
|
-
"name": "readonly",
|
32195
|
-
"type": {
|
32196
|
-
"text": "boolean"
|
32197
|
-
},
|
32198
|
-
"default": "false",
|
32199
|
-
"description": "Determines whether the radio is read-only.",
|
32200
|
-
"fieldName": "readonly"
|
32201
|
-
},
|
32202
|
-
{
|
32203
|
-
"name": "disabled",
|
32204
|
-
"type": {
|
32205
|
-
"text": "boolean | undefined"
|
32206
|
-
},
|
32207
|
-
"description": "Indicates whether the component is disabled.\nWhen the component is disabled for user interaction; it is not focusable or clickable.",
|
32208
|
-
"default": "undefined",
|
32209
|
-
"fieldName": "disabled",
|
32210
|
-
"inheritedFrom": {
|
32211
|
-
"name": "DisabledMixin",
|
32212
|
-
"module": "src/utils/mixins/DisabledMixin.ts"
|
32213
|
-
}
|
32214
|
-
}
|
32215
|
-
],
|
32216
|
-
"mixins": [
|
32217
|
-
{
|
32218
|
-
"name": "DisabledMixin",
|
32219
|
-
"module": "/src/utils/mixins/DisabledMixin"
|
32220
|
-
}
|
32221
|
-
],
|
32222
|
-
"superclass": {
|
32223
|
-
"name": "Component",
|
32224
|
-
"module": "/src/models"
|
32225
|
-
},
|
32226
|
-
"tagName": "mdc-staticradio",
|
32227
|
-
"jsDoc": "/**\n * This is a decorative component that is styled to look as a radio.\n * It has 2 properties - checked and disabled.\n *\n * We are using the same styling that has been created for the `mdc-radio` component.\n *\n * @tagname mdc-staticradio\n *\n * @cssproperty --mdc-staticradio-inner-circle-size - size of the inner circle\n * @cssproperty --mdc-staticradio-text-disabled-color - color of the label when disabled\n * @cssproperty --mdc-staticradio-normal-border-color - color of the radio button border when normal\n * @cssproperty --mdc-staticradio-disabled-border-color - color of the radio button border when disabled\n * @cssproperty --mdc-staticradio-inner-circle-normal-background - background color of the inner circle when normal\n * @cssproperty --mdc-staticradio-inner-circle-disabled-background - background color of the inner circle when disabled\n * @cssproperty --mdc-staticradio-control-inactive-color - color of the radio button when inactive\n * @cssproperty --mdc-staticradio-control-inactive-disabled-background - background color of the radio button when\n * inactive and disabled\n * @cssproperty --mdc-staticradio-control-active-color - color of the radio button when active\n * @cssproperty --mdc-staticradio-control-active-disabled-background - background color of the radio button\n * when active and disabled\n */",
|
32228
|
-
"customElement": true
|
32229
|
-
}
|
32230
|
-
],
|
32231
|
-
"exports": [
|
32232
|
-
{
|
32233
|
-
"kind": "js",
|
32234
|
-
"name": "default",
|
32235
|
-
"declaration": {
|
32236
|
-
"name": "StaticRadio",
|
32237
|
-
"module": "components/staticradio/staticradio.component.js"
|
32238
|
-
}
|
32239
|
-
}
|
32240
|
-
]
|
32241
|
-
},
|
32242
32253
|
{
|
32243
32254
|
"kind": "javascript-module",
|
32244
32255
|
"path": "components/text/text.component.js",
|
package/dist/react/index.d.ts
CHANGED
@@ -56,10 +56,10 @@ export { default as SideNavigation } from './sidenavigation';
|
|
56
56
|
export { default as Skeleton } from './skeleton';
|
57
57
|
export { default as Spinner } from './spinner';
|
58
58
|
export { default as StaticCheckbox } from './staticcheckbox';
|
59
|
+
export { default as StaticRadio } from './staticradio';
|
59
60
|
export { default as StaticToggle } from './statictoggle';
|
60
61
|
export { default as Tab } from './tab';
|
61
62
|
export { default as TabList } from './tablist';
|
62
|
-
export { default as StaticRadio } from './staticradio';
|
63
63
|
export { default as Text } from './text';
|
64
64
|
export { default as Textarea } from './textarea';
|
65
65
|
export { default as ThemeProvider } from './themeprovider';
|
package/dist/react/index.js
CHANGED
@@ -56,10 +56,10 @@ export { default as SideNavigation } from './sidenavigation';
|
|
56
56
|
export { default as Skeleton } from './skeleton';
|
57
57
|
export { default as Spinner } from './spinner';
|
58
58
|
export { default as StaticCheckbox } from './staticcheckbox';
|
59
|
+
export { default as StaticRadio } from './staticradio';
|
59
60
|
export { default as StaticToggle } from './statictoggle';
|
60
61
|
export { default as Tab } from './tab';
|
61
62
|
export { default as TabList } from './tablist';
|
62
|
-
export { default as StaticRadio } from './staticradio';
|
63
63
|
export { default as Text } from './text';
|
64
64
|
export { default as Textarea } from './textarea';
|
65
65
|
export { default as ThemeProvider } from './themeprovider';
|