@openproject/primer-view-components 0.86.2-rc.9bb5c7250 → 0.87.0-rc.482ee0ea9
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 +14 -5
- package/app/components/primer/alpha/select_panel_element.js +11 -1
- package/app/components/primer/open_project/sub_header_element.js +3 -2
- package/package.json +1 -1
- package/static/arguments.json +9 -0
- package/static/audited_at.json +1 -0
- package/static/constants.json +6 -0
- package/static/info_arch.json +19 -0
- package/static/statuses.json +1 -0
|
@@ -469,6 +469,7 @@ _ActionMenuElement_handleItemActivated = function _ActionMenuElement_handleItemA
|
|
|
469
469
|
else {
|
|
470
470
|
// multi-select mode allows unchecking a checked item
|
|
471
471
|
item.setAttribute('aria-checked', `${checked}`);
|
|
472
|
+
__classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_setDynamicLabel).call(this);
|
|
472
473
|
}
|
|
473
474
|
__classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_updateInput).call(this);
|
|
474
475
|
this.dispatchEvent(new CustomEvent('itemActivated', {
|
|
@@ -498,21 +499,29 @@ _ActionMenuElement_isOpen = function _ActionMenuElement_isOpen() {
|
|
|
498
499
|
return this.popoverElement?.matches(':popover-open');
|
|
499
500
|
};
|
|
500
501
|
_ActionMenuElement_setDynamicLabel = function _ActionMenuElement_setDynamicLabel() {
|
|
501
|
-
if (this.selectVariant !== 'single')
|
|
502
|
-
return;
|
|
503
502
|
if (!this.dynamicLabel)
|
|
504
503
|
return;
|
|
505
504
|
const invokerLabel = this.invokerLabel;
|
|
506
505
|
if (!invokerLabel)
|
|
507
506
|
return;
|
|
508
507
|
__classPrivateFieldSet(this, _ActionMenuElement_originalLabel, __classPrivateFieldGet(this, _ActionMenuElement_originalLabel, "f") || (invokerLabel.textContent || ''), "f");
|
|
509
|
-
|
|
508
|
+
let itemLabel;
|
|
509
|
+
if (this.selectVariant === 'single') {
|
|
510
|
+
itemLabel = this.querySelector('[aria-checked=true] .ActionListItem-label')?.textContent?.trim();
|
|
511
|
+
}
|
|
512
|
+
else if (this.selectVariant === 'multiple') {
|
|
513
|
+
itemLabel = Array.from(this.querySelectorAll(`[aria-checked=true] .ActionListItem-label`))
|
|
514
|
+
.map(label => (label.textContent || '').trim())
|
|
515
|
+
.filter(Boolean)
|
|
516
|
+
.join(', ');
|
|
517
|
+
}
|
|
518
|
+
itemLabel || (itemLabel = __classPrivateFieldGet(this, _ActionMenuElement_originalLabel, "f"));
|
|
510
519
|
if (itemLabel && this.dynamicLabel) {
|
|
511
520
|
const prefixSpan = document.createElement('span');
|
|
512
521
|
prefixSpan.classList.add('color-fg-muted');
|
|
513
522
|
const contentSpan = document.createElement('span');
|
|
514
|
-
prefixSpan.textContent = this.dynamicLabelPrefix;
|
|
515
|
-
contentSpan.textContent = itemLabel
|
|
523
|
+
prefixSpan.textContent = this.dynamicLabelPrefix ? `${this.dynamicLabelPrefix} ` : '';
|
|
524
|
+
contentSpan.textContent = itemLabel;
|
|
516
525
|
invokerLabel.replaceChildren(prefixSpan, contentSpan);
|
|
517
526
|
}
|
|
518
527
|
else {
|
|
@@ -866,6 +866,7 @@ _SelectPanelElement_handleItemActivated = function _SelectPanelElement_handleIte
|
|
|
866
866
|
else {
|
|
867
867
|
__classPrivateFieldGet(this, _SelectPanelElement_instances, "m", _SelectPanelElement_removeSelectedItem).call(this, item);
|
|
868
868
|
}
|
|
869
|
+
__classPrivateFieldGet(this, _SelectPanelElement_instances, "m", _SelectPanelElement_setDynamicLabel).call(this);
|
|
869
870
|
}
|
|
870
871
|
__classPrivateFieldGet(this, _SelectPanelElement_instances, "m", _SelectPanelElement_updateInput).call(this);
|
|
871
872
|
__classPrivateFieldGet(this, _SelectPanelElement_instances, "m", _SelectPanelElement_updateTabIndices).call(this);
|
|
@@ -885,7 +886,16 @@ _SelectPanelElement_setDynamicLabel = function _SelectPanelElement_setDynamicLab
|
|
|
885
886
|
if (!invokerLabel)
|
|
886
887
|
return;
|
|
887
888
|
__classPrivateFieldSet(this, _SelectPanelElement_originalLabel, __classPrivateFieldGet(this, _SelectPanelElement_originalLabel, "f") || (invokerLabel.textContent || ''), "f");
|
|
888
|
-
|
|
889
|
+
let itemLabel;
|
|
890
|
+
if (this.selectVariant === 'single') {
|
|
891
|
+
itemLabel = this.querySelector(`[${this.ariaSelectionType}=true] .ActionListItem-label`)?.textContent;
|
|
892
|
+
}
|
|
893
|
+
else if (this.selectVariant === 'multiple') {
|
|
894
|
+
itemLabel = Array.from(this.querySelectorAll(`[${this.ariaSelectionType}=true] .ActionListItem-label`))
|
|
895
|
+
.map(label => label.textContent?.trim() ?? '')
|
|
896
|
+
.join(', ');
|
|
897
|
+
}
|
|
898
|
+
itemLabel || (itemLabel = __classPrivateFieldGet(this, _SelectPanelElement_originalLabel, "f"));
|
|
889
899
|
if (itemLabel) {
|
|
890
900
|
const prefixSpan = document.createElement('span');
|
|
891
901
|
prefixSpan.classList.add('color-fg-muted');
|
|
@@ -24,9 +24,10 @@ let SubHeaderElement = class SubHeaderElement extends HTMLElement {
|
|
|
24
24
|
}
|
|
25
25
|
expandFilterInput() {
|
|
26
26
|
for (const item of this.shownItemsOnExpandedFilter) {
|
|
27
|
-
item.classList.remove('d-none');
|
|
27
|
+
item.classList.remove('d-none', 'd-sm-none');
|
|
28
28
|
}
|
|
29
29
|
for (const item of this.filterExpandButton) {
|
|
30
|
+
item.classList.remove('d-inline-flex', 'd-sm-inline-flex');
|
|
30
31
|
item.classList.add('d-none');
|
|
31
32
|
}
|
|
32
33
|
this.classList.add('SubHeader--expandedSearch');
|
|
@@ -37,7 +38,7 @@ let SubHeaderElement = class SubHeaderElement extends HTMLElement {
|
|
|
37
38
|
item.classList.remove('d-none');
|
|
38
39
|
}
|
|
39
40
|
for (const item of this.shownItemsOnExpandedFilter) {
|
|
40
|
-
item.classList.add('d-none');
|
|
41
|
+
item.classList.add('d-none', 'd-sm-none');
|
|
41
42
|
}
|
|
42
43
|
this.classList.remove('SubHeader--expandedSearch');
|
|
43
44
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openproject/primer-view-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.87.0-rc.482ee0ea9",
|
|
4
4
|
"description": "ViewComponents of the Primer Design System for OpenProject",
|
|
5
5
|
"main": "app/assets/javascripts/primer_view_components.js",
|
|
6
6
|
"module": "app/components/primer/primer.js",
|
package/static/arguments.json
CHANGED
|
@@ -6599,6 +6599,15 @@
|
|
|
6599
6599
|
}
|
|
6600
6600
|
]
|
|
6601
6601
|
},
|
|
6602
|
+
{
|
|
6603
|
+
"component": "OpenProject::SubHeader::QuickActionComponent",
|
|
6604
|
+
"status": "open_project",
|
|
6605
|
+
"a11y_reviewed": false,
|
|
6606
|
+
"short_name": "OpenProjectSubHeaderQuickActionComponent",
|
|
6607
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/sub_header/quick_filter.rb",
|
|
6608
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/sub_header/quick_filter/default/",
|
|
6609
|
+
"parameters": []
|
|
6610
|
+
},
|
|
6602
6611
|
{
|
|
6603
6612
|
"component": "OpenProject::SubHeader::SegmentedControl",
|
|
6604
6613
|
"status": "open_project",
|
package/static/audited_at.json
CHANGED
|
@@ -173,6 +173,7 @@
|
|
|
173
173
|
"Primer::OpenProject::SubHeader::Button": "",
|
|
174
174
|
"Primer::OpenProject::SubHeader::ButtonGroup": "",
|
|
175
175
|
"Primer::OpenProject::SubHeader::Menu": "",
|
|
176
|
+
"Primer::OpenProject::SubHeader::QuickActionComponent": "",
|
|
176
177
|
"Primer::OpenProject::SubHeader::SegmentedControl": "2023-02-01",
|
|
177
178
|
"Primer::OpenProject::ZenModeButton": "",
|
|
178
179
|
"Primer::Tooltip": "",
|
package/static/constants.json
CHANGED
|
@@ -1984,16 +1984,19 @@
|
|
|
1984
1984
|
"Button": "Primer::OpenProject::SubHeader::Button",
|
|
1985
1985
|
"ButtonGroup": "Primer::OpenProject::SubHeader::ButtonGroup",
|
|
1986
1986
|
"DESKTOP_ACTIONS_DISPLAY": [
|
|
1987
|
+
"none",
|
|
1987
1988
|
"none",
|
|
1988
1989
|
"flex"
|
|
1989
1990
|
],
|
|
1990
1991
|
"FILTER_EXPAND_BUTTON_TARGET_SELECTOR": "sub-header.filterExpandButton",
|
|
1991
1992
|
"GeneratedSlotMethods": "Primer::OpenProject::SubHeader::GeneratedSlotMethods",
|
|
1992
1993
|
"MOBILE_ACTIONS_DISPLAY": [
|
|
1994
|
+
"flex",
|
|
1993
1995
|
"flex",
|
|
1994
1996
|
"none"
|
|
1995
1997
|
],
|
|
1996
1998
|
"Menu": "Primer::OpenProject::SubHeader::Menu",
|
|
1999
|
+
"QuickActionComponent": "Primer::OpenProject::SubHeader::QuickActionComponent",
|
|
1997
2000
|
"SHOWN_FILTER_TARGET_SELECTOR": "sub-header.shownItemsOnExpandedFilter",
|
|
1998
2001
|
"SegmentedControl": "Primer::OpenProject::SubHeader::SegmentedControl"
|
|
1999
2002
|
},
|
|
@@ -2006,6 +2009,9 @@
|
|
|
2006
2009
|
"Primer::OpenProject::SubHeader::Menu": {
|
|
2007
2010
|
"GeneratedSlotMethods": "Primer::OpenProject::SubHeader::Menu::GeneratedSlotMethods"
|
|
2008
2011
|
},
|
|
2012
|
+
"Primer::OpenProject::SubHeader::QuickActionComponent": {
|
|
2013
|
+
"GeneratedSlotMethods": "Primer::OpenProject::SubHeader::QuickActionComponent::GeneratedSlotMethods"
|
|
2014
|
+
},
|
|
2009
2015
|
"Primer::OpenProject::SubHeader::SegmentedControl": {
|
|
2010
2016
|
"GeneratedSlotMethods": "Primer::OpenProject::SubHeader::SegmentedControl::GeneratedSlotMethods"
|
|
2011
2017
|
},
|
package/static/info_arch.json
CHANGED
|
@@ -22107,6 +22107,25 @@
|
|
|
22107
22107
|
"previews": [],
|
|
22108
22108
|
"subcomponents": []
|
|
22109
22109
|
},
|
|
22110
|
+
{
|
|
22111
|
+
"fully_qualified_name": "Primer::OpenProject::SubHeader::QuickActionComponent",
|
|
22112
|
+
"description": "Thin wrapper for quick filter slots that defers BaseComponent construction to render time,\nallowing system arguments (e.g. display) to be mutated in before_render.\nDo not use standalone",
|
|
22113
|
+
"accessibility_docs": null,
|
|
22114
|
+
"is_form_component": false,
|
|
22115
|
+
"is_published": true,
|
|
22116
|
+
"requires_js": false,
|
|
22117
|
+
"component": "OpenProject::SubHeader::QuickActionComponent",
|
|
22118
|
+
"status": "open_project",
|
|
22119
|
+
"a11y_reviewed": false,
|
|
22120
|
+
"short_name": "OpenProjectSubHeaderQuickActionComponent",
|
|
22121
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/sub_header/quick_filter.rb",
|
|
22122
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/sub_header/quick_filter/default/",
|
|
22123
|
+
"parameters": [],
|
|
22124
|
+
"slots": [],
|
|
22125
|
+
"methods": [],
|
|
22126
|
+
"previews": [],
|
|
22127
|
+
"subcomponents": []
|
|
22128
|
+
},
|
|
22110
22129
|
{
|
|
22111
22130
|
"fully_qualified_name": "Primer::OpenProject::SubHeader::SegmentedControl",
|
|
22112
22131
|
"description": "A Helper class to create SegmentedControls inside the SubHeader action slot\nDo not use standalone",
|
package/static/statuses.json
CHANGED
|
@@ -173,6 +173,7 @@
|
|
|
173
173
|
"Primer::OpenProject::SubHeader::Button": "open_project",
|
|
174
174
|
"Primer::OpenProject::SubHeader::ButtonGroup": "open_project",
|
|
175
175
|
"Primer::OpenProject::SubHeader::Menu": "open_project",
|
|
176
|
+
"Primer::OpenProject::SubHeader::QuickActionComponent": "open_project",
|
|
176
177
|
"Primer::OpenProject::SubHeader::SegmentedControl": "open_project",
|
|
177
178
|
"Primer::OpenProject::ZenModeButton": "open_project",
|
|
178
179
|
"Primer::Tooltip": "deprecated",
|