@mixtint/primer-view-components 0.86.2 → 0.89.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/app/assets/javascripts/primer_view_components.js +1 -1
- package/app/assets/javascripts/primer_view_components.js.map +1 -1
- package/app/assets/styles/primer_view_components.css +13 -10
- package/app/assets/styles/primer_view_components.css.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/alpha/tree_view/tree_view.js +27 -11
- package/app/components/primer/alpha/tree_view.css +11 -8
- package/app/components/primer/alpha/tree_view.css.json +1 -2
- package/app/components/primer/open_project/avatar_fallback.js +1 -1
- package/app/components/primer/open_project/border_box/collapsible_header.js +1 -1
- package/app/components/primer/open_project/collapsible_section.js +1 -1
- package/app/components/primer/open_project/danger_dialog_form_helper.js +1 -1
- package/app/components/primer/open_project/filterable_tree_view.css +2 -2
- package/app/components/primer/open_project/filterable_tree_view.js +12 -5
- package/app/components/primer/open_project/page_header_element.js +1 -1
- package/app/components/primer/open_project/sub_header_element.js +4 -3
- package/app/components/primer/open_project/zen_mode_button.js +1 -1
- package/package.json +11 -11
- package/static/arguments.json +8 -8
- package/static/audited_at.json +1 -1
- package/static/constants.json +3 -3
- package/static/info_arch.json +33 -10
- package/static/previews.json +23 -10
- package/static/statuses.json +1 -1
|
@@ -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');
|
|
@@ -15,7 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
16
16
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
17
17
|
};
|
|
18
|
-
var _TreeViewElement_instances, _TreeViewElement_abortController, _TreeViewElement_autoExpandFrom, _TreeViewElement_eventIsActivation, _TreeViewElement_nodeForEvent, _TreeViewElement_handleNodeEvent, _TreeViewElement_eventIsCheckboxToggle, _TreeViewElement_handleCheckboxToggle, _TreeViewElement_eventIsSingleSelection, _TreeViewElement_handleNodeActivated, _TreeViewElement_handleNodeFocused, _TreeViewElement_handleNodeKeyboardEvent;
|
|
18
|
+
var _TreeViewElement_instances, _TreeViewElement_abortController, _TreeViewElement_autoExpandFrom, _TreeViewElement_eventIsActivation, _TreeViewElement_nodeForEvent, _TreeViewElement_handleNodeEvent, _TreeViewElement_eventIsCheckboxToggle, _TreeViewElement_handleCheckboxToggle, _TreeViewElement_eventIsSingleSelection, _TreeViewElement_handleNodeActivated, _TreeViewElement_handleNodeFocused, _TreeViewElement_handleNodeKeyboardEvent, _TreeViewElement_checkNodeOnly;
|
|
19
19
|
import { controller, target } from '@github/catalyst';
|
|
20
20
|
import { useRovingTabIndex } from './tree_view_roving_tab_index';
|
|
21
21
|
let TreeViewElement = class TreeViewElement extends HTMLElement {
|
|
@@ -97,8 +97,8 @@ let TreeViewElement = class TreeViewElement extends HTMLElement {
|
|
|
97
97
|
// behavior for these element types is user- or browser-defined
|
|
98
98
|
if (!(node instanceof HTMLDivElement))
|
|
99
99
|
return;
|
|
100
|
-
const
|
|
101
|
-
const nodeInfo = this.infoFromNode(node,
|
|
100
|
+
const newCheckedValue = this.getNodeCheckedValue(node) === 'true' ? 'false' : 'true';
|
|
101
|
+
const nodeInfo = this.infoFromNode(node, newCheckedValue);
|
|
102
102
|
const checkSuccess = this.dispatchEvent(new CustomEvent('treeViewBeforeNodeChecked', {
|
|
103
103
|
bubbles: true,
|
|
104
104
|
cancelable: true,
|
|
@@ -106,11 +106,11 @@ let TreeViewElement = class TreeViewElement extends HTMLElement {
|
|
|
106
106
|
}));
|
|
107
107
|
if (!checkSuccess)
|
|
108
108
|
return;
|
|
109
|
-
if (
|
|
109
|
+
if (newCheckedValue === 'false') {
|
|
110
110
|
this.setNodeCheckedValue(node, 'false');
|
|
111
111
|
}
|
|
112
112
|
else {
|
|
113
|
-
this.
|
|
113
|
+
__classPrivateFieldGet(this, _TreeViewElement_instances, "m", _TreeViewElement_checkNodeOnly).call(this, node);
|
|
114
114
|
}
|
|
115
115
|
this.dispatchEvent(new CustomEvent('treeViewNodeChecked', {
|
|
116
116
|
bubbles: true,
|
|
@@ -142,7 +142,7 @@ let TreeViewElement = class TreeViewElement extends HTMLElement {
|
|
|
142
142
|
return this.querySelector('[aria-current=true]');
|
|
143
143
|
}
|
|
144
144
|
get activeNodes() {
|
|
145
|
-
return
|
|
145
|
+
return this.querySelectorAll('[aria-checked="true"]');
|
|
146
146
|
}
|
|
147
147
|
expandAtPath(path) {
|
|
148
148
|
const node = this.subTreeAtPath(path);
|
|
@@ -175,10 +175,10 @@ let TreeViewElement = class TreeViewElement extends HTMLElement {
|
|
|
175
175
|
this.setNodeCheckedValue(node, 'false');
|
|
176
176
|
}
|
|
177
177
|
checkOnlyAtPath(path) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
this.
|
|
178
|
+
const node = this.nodeAtPath(path);
|
|
179
|
+
if (!node)
|
|
180
|
+
return;
|
|
181
|
+
__classPrivateFieldGet(this, _TreeViewElement_instances, "m", _TreeViewElement_checkNodeOnly).call(this, node);
|
|
182
182
|
}
|
|
183
183
|
toggleCheckedAtPath(path) {
|
|
184
184
|
const node = this.nodeAtPath(path);
|
|
@@ -286,6 +286,9 @@ let TreeViewElement = class TreeViewElement extends HTMLElement {
|
|
|
286
286
|
const payload = {
|
|
287
287
|
path: this.getNodePath(node),
|
|
288
288
|
};
|
|
289
|
+
const nodeId = node.getAttribute('data-node-id');
|
|
290
|
+
if (nodeId)
|
|
291
|
+
payload.nodeId = nodeId;
|
|
289
292
|
const inputValue = this.getFormInputValueForNode(node);
|
|
290
293
|
if (inputValue)
|
|
291
294
|
payload.value = inputValue;
|
|
@@ -424,7 +427,12 @@ _TreeViewElement_handleNodeKeyboardEvent = function _TreeViewElement_handleNodeK
|
|
|
424
427
|
}
|
|
425
428
|
else if (this.selectVariant(node) === 'single') {
|
|
426
429
|
event.preventDefault();
|
|
427
|
-
|
|
430
|
+
if (this.getNodeCheckedValue(node) === 'true') {
|
|
431
|
+
this.setNodeCheckedValue(node, 'false');
|
|
432
|
+
}
|
|
433
|
+
else {
|
|
434
|
+
__classPrivateFieldGet(this, _TreeViewElement_instances, "m", _TreeViewElement_checkNodeOnly).call(this, node);
|
|
435
|
+
}
|
|
428
436
|
}
|
|
429
437
|
else if (node instanceof HTMLAnchorElement) {
|
|
430
438
|
// simulate click on space
|
|
@@ -433,6 +441,14 @@ _TreeViewElement_handleNodeKeyboardEvent = function _TreeViewElement_handleNodeK
|
|
|
433
441
|
break;
|
|
434
442
|
}
|
|
435
443
|
};
|
|
444
|
+
_TreeViewElement_checkNodeOnly = function _TreeViewElement_checkNodeOnly(node) {
|
|
445
|
+
for (const el of this.activeNodes) {
|
|
446
|
+
if (el === node)
|
|
447
|
+
continue;
|
|
448
|
+
this.setNodeCheckedValue(el, 'false');
|
|
449
|
+
}
|
|
450
|
+
this.setNodeCheckedValue(node, 'true');
|
|
451
|
+
};
|
|
436
452
|
__decorate([
|
|
437
453
|
target
|
|
438
454
|
], TreeViewElement.prototype, "formInputContainer", void 0);
|
|
@@ -304,28 +304,31 @@
|
|
|
304
304
|
|
|
305
305
|
/* The visual icons should appear vertically centered for single-line items, but remain at the top for items that wrap
|
|
306
306
|
across more lines. */
|
|
307
|
+
align-self: baseline;
|
|
307
308
|
height: var(--custom-line-height, 1.3rem);
|
|
308
309
|
color: var(--fgColor-muted);
|
|
309
310
|
align-items: center;
|
|
310
311
|
}
|
|
311
312
|
|
|
312
313
|
.TreeViewRootUlStyles .TreeViewItemLeadingAction {
|
|
313
|
-
display: flex;
|
|
314
|
-
color: var(--fgColor-muted);
|
|
315
314
|
grid-area: leadingAction;
|
|
316
315
|
}
|
|
317
316
|
|
|
318
|
-
:is(.TreeViewRootUlStyles .TreeViewItemLeadingAction) > button {
|
|
319
|
-
flex-shrink: 1;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
317
|
.TreeViewRootUlStyles .TreeViewItemTrailingAction {
|
|
318
|
+
grid-area: trailingAction;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.TreeViewRootUlStyles .TreeViewItemTrailingAction,.TreeViewRootUlStyles .TreeViewItemLeadingAction {
|
|
323
322
|
display: flex;
|
|
324
323
|
color: var(--fgColor-muted);
|
|
325
|
-
|
|
324
|
+
/* The dynamic top and bottom padding to maintain the minimum item height for single line items while cancelling out the invisible area of the button */
|
|
325
|
+
/* stylelint-disable-next-line primer/spacing */
|
|
326
|
+
padding-top: calc((var(--min-item-height) - var(--custom-line-height, 1.3rem) - 12px) / 2);
|
|
327
|
+
/* stylelint-disable-next-line primer/spacing */
|
|
328
|
+
padding-bottom: calc((var(--min-item-height) - var(--custom-line-height, 1.3rem) - 12px) / 2);
|
|
326
329
|
}
|
|
327
330
|
|
|
328
|
-
:is(.TreeViewRootUlStyles .TreeViewItemTrailingAction) > button {
|
|
331
|
+
:is(.TreeViewRootUlStyles .TreeViewItemTrailingAction,.TreeViewRootUlStyles .TreeViewItemLeadingAction) > button {
|
|
329
332
|
flex-shrink: 1;
|
|
330
333
|
}
|
|
331
334
|
|
|
@@ -37,9 +37,8 @@
|
|
|
37
37
|
".TreeViewRootUlStyles:where([data-truncate-text='false']) .TreeViewItemContentText",
|
|
38
38
|
".TreeViewRootUlStyles .TreeViewItemVisual",
|
|
39
39
|
".TreeViewRootUlStyles .TreeViewItemLeadingAction",
|
|
40
|
-
":is(.TreeViewRootUlStyles .TreeViewItemLeadingAction) > button",
|
|
41
40
|
".TreeViewRootUlStyles .TreeViewItemTrailingAction",
|
|
42
|
-
":is(.TreeViewRootUlStyles .TreeViewItemTrailingAction) > button",
|
|
41
|
+
":is(.TreeViewRootUlStyles .TreeViewItemTrailingAction,.TreeViewRootUlStyles .TreeViewItemLeadingAction) > button",
|
|
43
42
|
".TreeViewRootUlStyles .TreeViewItemLevelLine",
|
|
44
43
|
".TreeViewRootUlStyles:hover .TreeViewItemLevelLine",
|
|
45
44
|
".TreeViewRootUlStyles:focus-within .TreeViewItemLevelLine",
|
|
@@ -62,7 +62,7 @@ __decorate([
|
|
|
62
62
|
attr
|
|
63
63
|
], DangerDialogFormHelperElement.prototype, "confirmationLiveMessageUnchecked", void 0);
|
|
64
64
|
DangerDialogFormHelperElement = __decorate([
|
|
65
|
-
controller
|
|
65
|
+
controller('danger-dialog-form-helper')
|
|
66
66
|
], DangerDialogFormHelperElement);
|
|
67
67
|
if (!window.customElements.get('danger-dialog-form-helper')) {
|
|
68
68
|
window.DangerDialogFormHelperElement = DangerDialogFormHelperElement;
|
|
@@ -32,7 +32,7 @@ filterable-tree-view {
|
|
|
32
32
|
/* Highlight style for CSS Custom Highlight API */
|
|
33
33
|
|
|
34
34
|
::highlight(primer-filterable-tree-view-search-results) {
|
|
35
|
-
background-color: var(--
|
|
35
|
+
background-color: var(--display-yellow-scale-2);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/* Fallback: <mark> elements used when CSS Custom Highlight API is unavailable */
|
|
@@ -40,7 +40,7 @@ filterable-tree-view {
|
|
|
40
40
|
/* stylelint-disable-next-line selector-max-type */
|
|
41
41
|
|
|
42
42
|
filterable-tree-view mark {
|
|
43
|
-
background-color: var(--
|
|
43
|
+
background-color: var(--display-yellow-scale-2);
|
|
44
44
|
color: inherit;
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -15,7 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
16
16
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
17
17
|
};
|
|
18
|
-
var _FilterableTreeViewElement_instances, _FilterableTreeViewElement_filterFn, _FilterableTreeViewElement_abortController, _FilterableTreeViewElement_stateMap, _FilterableTreeViewElement_debounceTimer, _FilterableTreeViewElement_fetchAbortController, _FilterableTreeViewElement_expansionSnapshot, _FilterableTreeViewElement_selectedModeSnapshot, _FilterableTreeViewElement_checkedNodeIds, _FilterableTreeViewElement_checkedNodeFormPayloads, _FilterableTreeViewElement_isFiltered, _FilterableTreeViewElement_src_get, _FilterableTreeViewElement_isAsyncMode_get, _FilterableTreeViewElement_handleTreeViewEvent, _FilterableTreeViewElement_updateCheckedNodeIds, _FilterableTreeViewElement_handleTreeViewNodeChecked, _FilterableTreeViewElement_restoreNodeState, _FilterableTreeViewElement_handleFilterModeEvent, _FilterableTreeViewElement_undoClientSideFilter, _FilterableTreeViewElement_handleFilterInputEvent, _FilterableTreeViewElement_handleIncludeSubItemsCheckBoxEvent, _FilterableTreeViewElement_includeSubItems, _FilterableTreeViewElement_includeSubItemsUnder, _FilterableTreeViewElement_restoreAllNodeStates, _FilterableTreeViewElement_scheduleAsyncFetch, _FilterableTreeViewElement_fetchAndReplaceTree, _FilterableTreeViewElement_captureExpansionState, _FilterableTreeViewElement_applyExpansionSnapshot, _FilterableTreeViewElement_snapshotExpansionState, _FilterableTreeViewElement_restoreExpansionState, _FilterableTreeViewElement_restoreSelectionState, _FilterableTreeViewElement_expandAllSubTrees, _FilterableTreeViewElement_applyAsyncHighlights, _FilterableTreeViewElement_updateRetainedSelections, _FilterableTreeViewElement_applyFilterOptions, _FilterableTreeViewElement_applyHighlights, _FilterableTreeViewElement_applyManualHighlights, _FilterableTreeViewElement_removeHighlights;
|
|
18
|
+
var _FilterableTreeViewElement_instances, _FilterableTreeViewElement_filterFn, _FilterableTreeViewElement_abortController, _FilterableTreeViewElement_stateMap, _FilterableTreeViewElement_debounceTimer, _FilterableTreeViewElement_fetchAbortController, _FilterableTreeViewElement_expansionSnapshot, _FilterableTreeViewElement_selectedModeSnapshot, _FilterableTreeViewElement_checkedNodeIds, _FilterableTreeViewElement_checkedNodeFormPayloads, _FilterableTreeViewElement_isFiltered, _FilterableTreeViewElement_src_get, _FilterableTreeViewElement_isAsyncMode_get, _FilterableTreeViewElement_clientHighlightsEnabled_get, _FilterableTreeViewElement_handleTreeViewEvent, _FilterableTreeViewElement_updateCheckedNodeIds, _FilterableTreeViewElement_handleTreeViewNodeChecked, _FilterableTreeViewElement_restoreNodeState, _FilterableTreeViewElement_handleFilterModeEvent, _FilterableTreeViewElement_undoClientSideFilter, _FilterableTreeViewElement_handleFilterInputEvent, _FilterableTreeViewElement_handleIncludeSubItemsCheckBoxEvent, _FilterableTreeViewElement_includeSubItems, _FilterableTreeViewElement_includeSubItemsUnder, _FilterableTreeViewElement_restoreAllNodeStates, _FilterableTreeViewElement_scheduleAsyncFetch, _FilterableTreeViewElement_fetchAndReplaceTree, _FilterableTreeViewElement_captureExpansionState, _FilterableTreeViewElement_applyExpansionSnapshot, _FilterableTreeViewElement_snapshotExpansionState, _FilterableTreeViewElement_restoreExpansionState, _FilterableTreeViewElement_restoreSelectionState, _FilterableTreeViewElement_expandAllSubTrees, _FilterableTreeViewElement_applyAsyncHighlights, _FilterableTreeViewElement_updateRetainedSelections, _FilterableTreeViewElement_applyFilterOptions, _FilterableTreeViewElement_applyHighlights, _FilterableTreeViewElement_applyManualHighlights, _FilterableTreeViewElement_removeHighlights;
|
|
19
19
|
import { controller, target } from '@github/catalyst';
|
|
20
20
|
import { TreeViewElement } from '../alpha/tree_view/tree_view';
|
|
21
21
|
import { TreeViewSubTreeNodeElement } from '../alpha/tree_view/tree_view_sub_tree_node_element';
|
|
@@ -190,6 +190,9 @@ _FilterableTreeViewElement_src_get = function _FilterableTreeViewElement_src_get
|
|
|
190
190
|
_FilterableTreeViewElement_isAsyncMode_get = function _FilterableTreeViewElement_isAsyncMode_get() {
|
|
191
191
|
return !!__classPrivateFieldGet(this, _FilterableTreeViewElement_instances, "a", _FilterableTreeViewElement_src_get);
|
|
192
192
|
};
|
|
193
|
+
_FilterableTreeViewElement_clientHighlightsEnabled_get = function _FilterableTreeViewElement_clientHighlightsEnabled_get() {
|
|
194
|
+
return this.getAttribute('data-show-search-highlighting') !== 'false';
|
|
195
|
+
};
|
|
193
196
|
_FilterableTreeViewElement_handleTreeViewEvent = function _FilterableTreeViewElement_handleTreeViewEvent(origEvent) {
|
|
194
197
|
const event = origEvent;
|
|
195
198
|
// NOTE: This event only fires if someone actually activates the check mark, i.e. does not fire
|
|
@@ -224,6 +227,7 @@ _FilterableTreeViewElement_updateCheckedNodeIds = function _FilterableTreeViewEl
|
|
|
224
227
|
}
|
|
225
228
|
__classPrivateFieldGet(this, _FilterableTreeViewElement_checkedNodeIds, "f").set(nodeId, nodeInfo.checkedValue);
|
|
226
229
|
const payload = { path: nodeInfo.path };
|
|
230
|
+
payload.nodeId = nodeId;
|
|
227
231
|
const dataValue = node.getAttribute('data-value');
|
|
228
232
|
if (dataValue)
|
|
229
233
|
payload.value = dataValue;
|
|
@@ -432,13 +436,15 @@ _FilterableTreeViewElement_fetchAndReplaceTree = async function _FilterableTreeV
|
|
|
432
436
|
}
|
|
433
437
|
if (requestWasFiltered) {
|
|
434
438
|
__classPrivateFieldGet(this, _FilterableTreeViewElement_instances, "m", _FilterableTreeViewElement_expandAllSubTrees).call(this);
|
|
435
|
-
__classPrivateFieldGet(this, _FilterableTreeViewElement_instances, "
|
|
439
|
+
if (__classPrivateFieldGet(this, _FilterableTreeViewElement_instances, "a", _FilterableTreeViewElement_clientHighlightsEnabled_get))
|
|
440
|
+
__classPrivateFieldGet(this, _FilterableTreeViewElement_instances, "m", _FilterableTreeViewElement_applyAsyncHighlights).call(this, query);
|
|
436
441
|
const hasResults = !!this.treeViewList?.querySelector('[role=treeitem]');
|
|
437
442
|
this.noResultsMessage.toggleAttribute('hidden', hasResults);
|
|
438
443
|
this.treeViewList?.toggleAttribute('hidden', !hasResults);
|
|
439
444
|
}
|
|
440
445
|
else {
|
|
441
|
-
__classPrivateFieldGet(this, _FilterableTreeViewElement_instances, "
|
|
446
|
+
if (__classPrivateFieldGet(this, _FilterableTreeViewElement_instances, "a", _FilterableTreeViewElement_clientHighlightsEnabled_get))
|
|
447
|
+
__classPrivateFieldGet(this, _FilterableTreeViewElement_instances, "m", _FilterableTreeViewElement_removeHighlights).call(this);
|
|
442
448
|
__classPrivateFieldGet(this, _FilterableTreeViewElement_instances, "m", _FilterableTreeViewElement_restoreExpansionState).call(this);
|
|
443
449
|
this.noResultsMessage.setAttribute('hidden', 'hidden');
|
|
444
450
|
this.treeViewList?.removeAttribute('hidden');
|
|
@@ -624,7 +630,8 @@ _FilterableTreeViewElement_applyFilterOptions = function _FilterableTreeViewElem
|
|
|
624
630
|
else {
|
|
625
631
|
this.treeViewList.removeAttribute('hidden');
|
|
626
632
|
this.noResultsMessage.setAttribute('hidden', 'hidden');
|
|
627
|
-
__classPrivateFieldGet(this, _FilterableTreeViewElement_instances, "
|
|
633
|
+
if (__classPrivateFieldGet(this, _FilterableTreeViewElement_instances, "a", _FilterableTreeViewElement_clientHighlightsEnabled_get))
|
|
634
|
+
__classPrivateFieldGet(this, _FilterableTreeViewElement_instances, "m", _FilterableTreeViewElement_applyHighlights).call(this, allRanges);
|
|
628
635
|
}
|
|
629
636
|
};
|
|
630
637
|
_FilterableTreeViewElement_applyHighlights = function _FilterableTreeViewElement_applyHighlights(ranges) {
|
|
@@ -689,7 +696,7 @@ __decorate([
|
|
|
689
696
|
target
|
|
690
697
|
], FilterableTreeViewElement.prototype, "includeSubItemsCheckBox", void 0);
|
|
691
698
|
FilterableTreeViewElement = __decorate([
|
|
692
|
-
controller
|
|
699
|
+
controller('filterable-tree-view')
|
|
693
700
|
], FilterableTreeViewElement);
|
|
694
701
|
export { FilterableTreeViewElement };
|
|
695
702
|
if (!window.customElements.get('filterable-tree-view')) {
|
|
@@ -15,7 +15,7 @@ let PageHeaderElement = class PageHeaderElement extends HTMLElement {
|
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
PageHeaderElement = __decorate([
|
|
18
|
-
controller
|
|
18
|
+
controller('page-header')
|
|
19
19
|
], PageHeaderElement);
|
|
20
20
|
if (!window.customElements.get('page-header')) {
|
|
21
21
|
window.PageHeaderElement = PageHeaderElement;
|
|
@@ -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
|
}
|
|
@@ -68,7 +69,7 @@ __decorate([
|
|
|
68
69
|
targets
|
|
69
70
|
], SubHeaderElement.prototype, "filterExpandButton", void 0);
|
|
70
71
|
SubHeaderElement = __decorate([
|
|
71
|
-
controller
|
|
72
|
+
controller('sub-header')
|
|
72
73
|
], SubHeaderElement);
|
|
73
74
|
if (!window.customElements.get('sub-header')) {
|
|
74
75
|
window.SubHeaderElement = SubHeaderElement;
|
|
@@ -56,7 +56,7 @@ __decorate([
|
|
|
56
56
|
target
|
|
57
57
|
], ZenModeButtonElement.prototype, "button", void 0);
|
|
58
58
|
ZenModeButtonElement = __decorate([
|
|
59
|
-
controller
|
|
59
|
+
controller('zen-mode-button')
|
|
60
60
|
], ZenModeButtonElement);
|
|
61
61
|
if (!window.customElements.get('zen-mode-button')) {
|
|
62
62
|
window.ZenModeButtonElement = ZenModeButtonElement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mixtint/primer-view-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.89.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"@github/auto-check-element": "^6.0.0",
|
|
50
50
|
"@github/auto-complete-element": "^3.8.0",
|
|
51
51
|
"@github/catalyst": "^1.8.1",
|
|
52
|
-
"@github/clipboard-copy-element": "^1.3.
|
|
52
|
+
"@github/clipboard-copy-element": "^1.3.2",
|
|
53
53
|
"@github/details-menu-element": "^1.0.13",
|
|
54
54
|
"@github/image-crop-element": "^5.0.0",
|
|
55
55
|
"@github/include-fragment-element": "^6.4.1",
|
|
56
|
-
"@github/relative-time-element": "^5.
|
|
56
|
+
"@github/relative-time-element": "^5.2.0",
|
|
57
57
|
"@github/remote-input-element": "^0.4.0",
|
|
58
58
|
"@github/tab-container-element": "^3.4.0",
|
|
59
59
|
"@oddbird/popover-polyfill": "^0.5.2",
|
|
@@ -68,15 +68,15 @@
|
|
|
68
68
|
"@changesets/cli": "^2.31.0",
|
|
69
69
|
"@github/axe-github": "^0.8.1",
|
|
70
70
|
"@github/browserslist-config": "^1.0.0",
|
|
71
|
-
"@github/markdownlint-github": "^0.8.
|
|
71
|
+
"@github/markdownlint-github": "^0.8.2",
|
|
72
72
|
"@github/prettier-config": "0.0.6",
|
|
73
|
-
"@playwright/test": "^1.
|
|
73
|
+
"@playwright/test": "^1.61.1",
|
|
74
74
|
"@primer/css": "22.1.1",
|
|
75
75
|
"@primer/primitives": "^11.9.0",
|
|
76
76
|
"@primer/stylelint-config": "^13.6.0",
|
|
77
77
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
78
78
|
"@rollup/plugin-typescript": "^8.5.0",
|
|
79
|
-
"axe-core": "^4.
|
|
79
|
+
"axe-core": "^4.12.1",
|
|
80
80
|
"chokidar-cli": "^3.0.0",
|
|
81
81
|
"css-what": "^7.0.0",
|
|
82
82
|
"cssnano": "^7.1.9",
|
|
@@ -85,19 +85,19 @@
|
|
|
85
85
|
"glob": "^11.1.0",
|
|
86
86
|
"markdownlint-cli2": "^0.22.1",
|
|
87
87
|
"mocha": "^11.7.6",
|
|
88
|
-
"playwright": "^1.
|
|
89
|
-
"postcss": "^8.5.
|
|
88
|
+
"playwright": "^1.61.1",
|
|
89
|
+
"postcss": "^8.5.16",
|
|
90
90
|
"postcss-cli": "^11.0.1",
|
|
91
91
|
"postcss-import": "^16.1.1",
|
|
92
92
|
"postcss-mixins": "^12.1.2",
|
|
93
|
-
"postcss-preset-env": "^11.3.
|
|
94
|
-
"prettier": "^3.
|
|
93
|
+
"postcss-preset-env": "^11.3.2",
|
|
94
|
+
"prettier": "^3.9.4",
|
|
95
95
|
"rollup": "^2.80.0",
|
|
96
96
|
"rollup-plugin-terser": "^7.0.2",
|
|
97
97
|
"stylelint-actions-formatters": "^16.3.1",
|
|
98
98
|
"tslib": "^2.8.1",
|
|
99
99
|
"typescript": "^5.9.3",
|
|
100
|
-
"vite": "^8.
|
|
100
|
+
"vite": "^8.1.1",
|
|
101
101
|
"vite-plugin-ruby": "^5.2.2"
|
|
102
102
|
},
|
|
103
103
|
"prettier": "@github/prettier-config",
|
package/static/arguments.json
CHANGED
|
@@ -6188,25 +6188,25 @@
|
|
|
6188
6188
|
{
|
|
6189
6189
|
"name": "filter_input_arguments",
|
|
6190
6190
|
"type": "Hash",
|
|
6191
|
-
"default": "`
|
|
6191
|
+
"default": "`{}`",
|
|
6192
6192
|
"description": "Arguments that will be passed to the [TextField](/components/alpha/textfield) component."
|
|
6193
6193
|
},
|
|
6194
6194
|
{
|
|
6195
6195
|
"name": "filter_mode_control_arguments",
|
|
6196
6196
|
"type": "Hash",
|
|
6197
|
-
"default": "`
|
|
6197
|
+
"default": "`{}`",
|
|
6198
6198
|
"description": "Arguments that will be passed to the [SegmentedControl](/components/alpha/segmentedcontrol) component."
|
|
6199
6199
|
},
|
|
6200
6200
|
{
|
|
6201
6201
|
"name": "include_sub_items_check_box_arguments",
|
|
6202
6202
|
"type": "Hash",
|
|
6203
|
-
"default": "`
|
|
6203
|
+
"default": "`{}`",
|
|
6204
6204
|
"description": "Arguments that will be passed to the [CheckBox](/components/alpha/checkbox) component."
|
|
6205
6205
|
},
|
|
6206
6206
|
{
|
|
6207
6207
|
"name": "no_results_node_arguments",
|
|
6208
6208
|
"type": "Hash",
|
|
6209
|
-
"default": "`
|
|
6209
|
+
"default": "`{}`",
|
|
6210
6210
|
"description": "Arguments that will be passed to a [TreeView::LeafNode](/components/alpha/treeviewleafnode) component that appears when no items match the filter criteria."
|
|
6211
6211
|
}
|
|
6212
6212
|
]
|
|
@@ -6600,12 +6600,12 @@
|
|
|
6600
6600
|
]
|
|
6601
6601
|
},
|
|
6602
6602
|
{
|
|
6603
|
-
"component": "OpenProject::SubHeader::
|
|
6603
|
+
"component": "OpenProject::SubHeader::QuickAction",
|
|
6604
6604
|
"status": "open_project",
|
|
6605
6605
|
"a11y_reviewed": false,
|
|
6606
|
-
"short_name": "
|
|
6607
|
-
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/sub_header/
|
|
6608
|
-
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/sub_header/
|
|
6606
|
+
"short_name": "OpenProjectSubHeaderQuickAction",
|
|
6607
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/sub_header/quick_action_component.rb",
|
|
6608
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/sub_header/quick_action/default/",
|
|
6609
6609
|
"parameters": []
|
|
6610
6610
|
},
|
|
6611
6611
|
{
|
package/static/audited_at.json
CHANGED
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
"Primer::OpenProject::SubHeader::Button": "",
|
|
174
174
|
"Primer::OpenProject::SubHeader::ButtonGroup": "",
|
|
175
175
|
"Primer::OpenProject::SubHeader::Menu": "",
|
|
176
|
-
"Primer::OpenProject::SubHeader::
|
|
176
|
+
"Primer::OpenProject::SubHeader::QuickActionComponent": "",
|
|
177
177
|
"Primer::OpenProject::SubHeader::SegmentedControl": "2023-02-01",
|
|
178
178
|
"Primer::OpenProject::ZenModeButton": "",
|
|
179
179
|
"Primer::Tooltip": "",
|
package/static/constants.json
CHANGED
|
@@ -1996,7 +1996,7 @@
|
|
|
1996
1996
|
"none"
|
|
1997
1997
|
],
|
|
1998
1998
|
"Menu": "Primer::OpenProject::SubHeader::Menu",
|
|
1999
|
-
"
|
|
1999
|
+
"QuickActionComponent": "Primer::OpenProject::SubHeader::QuickActionComponent",
|
|
2000
2000
|
"SHOWN_FILTER_TARGET_SELECTOR": "sub-header.shownItemsOnExpandedFilter",
|
|
2001
2001
|
"SegmentedControl": "Primer::OpenProject::SubHeader::SegmentedControl"
|
|
2002
2002
|
},
|
|
@@ -2009,8 +2009,8 @@
|
|
|
2009
2009
|
"Primer::OpenProject::SubHeader::Menu": {
|
|
2010
2010
|
"GeneratedSlotMethods": "Primer::OpenProject::SubHeader::Menu::GeneratedSlotMethods"
|
|
2011
2011
|
},
|
|
2012
|
-
"Primer::OpenProject::SubHeader::
|
|
2013
|
-
"GeneratedSlotMethods": "Primer::OpenProject::SubHeader::
|
|
2012
|
+
"Primer::OpenProject::SubHeader::QuickActionComponent": {
|
|
2013
|
+
"GeneratedSlotMethods": "Primer::OpenProject::SubHeader::QuickActionComponent::GeneratedSlotMethods"
|
|
2014
2014
|
},
|
|
2015
2015
|
"Primer::OpenProject::SubHeader::SegmentedControl": {
|
|
2016
2016
|
"GeneratedSlotMethods": "Primer::OpenProject::SubHeader::SegmentedControl::GeneratedSlotMethods"
|
package/static/info_arch.json
CHANGED
|
@@ -20383,25 +20383,25 @@
|
|
|
20383
20383
|
{
|
|
20384
20384
|
"name": "filter_input_arguments",
|
|
20385
20385
|
"type": "Hash",
|
|
20386
|
-
"default": "`
|
|
20386
|
+
"default": "`{}`",
|
|
20387
20387
|
"description": "Arguments that will be passed to the {{#link_to_component}}Primer::Alpha::TextField{{/link_to_component}} component."
|
|
20388
20388
|
},
|
|
20389
20389
|
{
|
|
20390
20390
|
"name": "filter_mode_control_arguments",
|
|
20391
20391
|
"type": "Hash",
|
|
20392
|
-
"default": "`
|
|
20392
|
+
"default": "`{}`",
|
|
20393
20393
|
"description": "Arguments that will be passed to the {{#link_to_component}}Primer::Alpha::SegmentedControl{{/link_to_component}} component."
|
|
20394
20394
|
},
|
|
20395
20395
|
{
|
|
20396
20396
|
"name": "include_sub_items_check_box_arguments",
|
|
20397
20397
|
"type": "Hash",
|
|
20398
|
-
"default": "`
|
|
20398
|
+
"default": "`{}`",
|
|
20399
20399
|
"description": "Arguments that will be passed to the {{#link_to_component}}Primer::Alpha::CheckBox{{/link_to_component}} component."
|
|
20400
20400
|
},
|
|
20401
20401
|
{
|
|
20402
20402
|
"name": "no_results_node_arguments",
|
|
20403
20403
|
"type": "Hash",
|
|
20404
|
-
"default": "`
|
|
20404
|
+
"default": "`{}`",
|
|
20405
20405
|
"description": "Arguments that will be passed to a {{#link_to_component}}Primer::Alpha::TreeView::LeafNode{{/link_to_component}} component that appears when no items match the filter criteria."
|
|
20406
20406
|
}
|
|
20407
20407
|
],
|
|
@@ -21067,6 +21067,19 @@
|
|
|
21067
21067
|
"color-contrast"
|
|
21068
21068
|
]
|
|
21069
21069
|
}
|
|
21070
|
+
},
|
|
21071
|
+
{
|
|
21072
|
+
"preview_path": "primer/open_project/input_group/with_error_message",
|
|
21073
|
+
"name": "with_error_message",
|
|
21074
|
+
"snapshot": "true",
|
|
21075
|
+
"skip_rules": {
|
|
21076
|
+
"wont_fix": [
|
|
21077
|
+
"region"
|
|
21078
|
+
],
|
|
21079
|
+
"will_fix": [
|
|
21080
|
+
"color-contrast"
|
|
21081
|
+
]
|
|
21082
|
+
}
|
|
21070
21083
|
}
|
|
21071
21084
|
],
|
|
21072
21085
|
"subcomponents": []
|
|
@@ -21800,9 +21813,19 @@
|
|
|
21800
21813
|
"description": "A button or custom content that will render on the left-hand side of the component, next to the filter input.\n\nTo render a button, call the `with_filter_button` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Button{{/link_to_component}}.\n\nTo render custom content, call the `with_filter_component` method and pass a block that returns HTML.",
|
|
21801
21814
|
"parameters": []
|
|
21802
21815
|
},
|
|
21816
|
+
{
|
|
21817
|
+
"name": "quick_sort",
|
|
21818
|
+
"description": "A slot for a generic sorting component. Will be rendered next to the search input",
|
|
21819
|
+
"parameters": []
|
|
21820
|
+
},
|
|
21821
|
+
{
|
|
21822
|
+
"name": "quick_group",
|
|
21823
|
+
"description": "A slot for a generic sorting component. Will be rendered next to the sorting button",
|
|
21824
|
+
"parameters": []
|
|
21825
|
+
},
|
|
21803
21826
|
{
|
|
21804
21827
|
"name": "quick_filters",
|
|
21805
|
-
"description": "Quick filters shown in the left pane next to the search bar (0–5 items).\nHidden on
|
|
21828
|
+
"description": "Quick filters shown in the left pane next to the search bar (0–5 items total across all types).\nHidden on smaller screens when more than one `quick_filter` is provided. Requires `filter_button` when using more than one `quick_filter`.\nSupports ActionMenus, Buttons, IconButtons, SelectPanels, and SegmentedControls inside the block.",
|
|
21806
21829
|
"parameters": []
|
|
21807
21830
|
},
|
|
21808
21831
|
{
|
|
@@ -22108,18 +22131,18 @@
|
|
|
22108
22131
|
"subcomponents": []
|
|
22109
22132
|
},
|
|
22110
22133
|
{
|
|
22111
|
-
"fully_qualified_name": "Primer::OpenProject::SubHeader::
|
|
22134
|
+
"fully_qualified_name": "Primer::OpenProject::SubHeader::QuickActionComponent",
|
|
22112
22135
|
"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
22136
|
"accessibility_docs": null,
|
|
22114
22137
|
"is_form_component": false,
|
|
22115
22138
|
"is_published": true,
|
|
22116
22139
|
"requires_js": false,
|
|
22117
|
-
"component": "OpenProject::SubHeader::
|
|
22140
|
+
"component": "OpenProject::SubHeader::QuickAction",
|
|
22118
22141
|
"status": "open_project",
|
|
22119
22142
|
"a11y_reviewed": false,
|
|
22120
|
-
"short_name": "
|
|
22121
|
-
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/sub_header/
|
|
22122
|
-
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/sub_header/
|
|
22143
|
+
"short_name": "OpenProjectSubHeaderQuickAction",
|
|
22144
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/sub_header/quick_action_component.rb",
|
|
22145
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/sub_header/quick_action/default/",
|
|
22123
22146
|
"parameters": [],
|
|
22124
22147
|
"slots": [],
|
|
22125
22148
|
"methods": [],
|