@primer/view-components 0.6.1-rc.d24b77ad → 0.6.1-rc.de1cd2ea
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/app/assets/javascripts/primer_view_components.js +1 -1
- package/app/assets/javascripts/primer_view_components.js.map +1 -1
- package/app/components/primer/alpha/action_menu/action_menu_element.js +8 -1
- package/package.json +1 -1
- package/static/arguments.json +12 -1
- package/static/info_arch.json +18 -1
@@ -141,8 +141,11 @@ let ActionMenuElement = class ActionMenuElement extends HTMLElement {
|
|
141
141
|
return;
|
142
142
|
const ariaChecked = item.getAttribute('aria-checked');
|
143
143
|
const checked = ariaChecked !== 'true';
|
144
|
-
item.setAttribute('aria-checked', `${checked}`);
|
145
144
|
if (this.selectVariant === 'single') {
|
145
|
+
// Only check, never uncheck here. Single-select mode does not allow unchecking a checked item.
|
146
|
+
if (checked) {
|
147
|
+
item.setAttribute('aria-checked', 'true');
|
148
|
+
}
|
146
149
|
for (const checkedItem of this.querySelectorAll('[aria-checked]')) {
|
147
150
|
if (checkedItem !== item) {
|
148
151
|
checkedItem.setAttribute('aria-checked', 'false');
|
@@ -150,6 +153,10 @@ let ActionMenuElement = class ActionMenuElement extends HTMLElement {
|
|
150
153
|
}
|
151
154
|
__classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_setDynamicLabel).call(this);
|
152
155
|
}
|
156
|
+
else {
|
157
|
+
// multi-select mode allows unchecking a checked item
|
158
|
+
item.setAttribute('aria-checked', `${checked}`);
|
159
|
+
}
|
153
160
|
__classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_updateInput).call(this);
|
154
161
|
if (event instanceof KeyboardEvent && event.target instanceof HTMLButtonElement) {
|
155
162
|
// prevent buttons from being clicked twice
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@primer/view-components",
|
3
|
-
"version": "0.6.1-rc.
|
3
|
+
"version": "0.6.1-rc.de1cd2ea",
|
4
4
|
"description": "ViewComponents for the Primer Design System",
|
5
5
|
"main": "app/assets/javascripts/primer_view_components.js",
|
6
6
|
"module": "app/components/primer/primer.js",
|
package/static/arguments.json
CHANGED
@@ -4248,7 +4248,18 @@
|
|
4248
4248
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/conditional_wrapper.rb",
|
4249
4249
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/conditional_wrapper/default/",
|
4250
4250
|
"parameters": [
|
4251
|
-
|
4251
|
+
{
|
4252
|
+
"name": "condition",
|
4253
|
+
"type": "Boolean",
|
4254
|
+
"default": "N/A",
|
4255
|
+
"description": "Whether or not to wrap the content in a `Primer::BaseComponent`."
|
4256
|
+
},
|
4257
|
+
{
|
4258
|
+
"name": "base_component_arguments",
|
4259
|
+
"type": "Hash",
|
4260
|
+
"default": "N/A",
|
4261
|
+
"description": "The arguments to pass to `Primer::BaseComponent`."
|
4262
|
+
}
|
4252
4263
|
]
|
4253
4264
|
},
|
4254
4265
|
{
|
package/static/info_arch.json
CHANGED
@@ -10271,7 +10271,13 @@
|
|
10271
10271
|
}
|
10272
10272
|
],
|
10273
10273
|
"methods": [
|
10274
|
+
{
|
10275
|
+
"name": "id",
|
10276
|
+
"description": "Returns the value of attribute id.",
|
10277
|
+
"parameters": [
|
10274
10278
|
|
10279
|
+
]
|
10280
|
+
}
|
10275
10281
|
],
|
10276
10282
|
"previews": [
|
10277
10283
|
|
@@ -14016,7 +14022,18 @@
|
|
14016
14022
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/conditional_wrapper.rb",
|
14017
14023
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/conditional_wrapper/default/",
|
14018
14024
|
"parameters": [
|
14019
|
-
|
14025
|
+
{
|
14026
|
+
"name": "condition",
|
14027
|
+
"type": "Boolean",
|
14028
|
+
"default": "N/A",
|
14029
|
+
"description": "Whether or not to wrap the content in a `Primer::BaseComponent`."
|
14030
|
+
},
|
14031
|
+
{
|
14032
|
+
"name": "base_component_arguments",
|
14033
|
+
"type": "Hash",
|
14034
|
+
"default": "N/A",
|
14035
|
+
"description": "The arguments to pass to `Primer::BaseComponent`."
|
14036
|
+
}
|
14020
14037
|
],
|
14021
14038
|
"slots": [
|
14022
14039
|
|