@esri/calcite-components 1.0.0-next.408 → 1.0.0-next.410
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/calcite/calcite.esm.js +1 -1
- package/dist/calcite/p-8f93be14.system.js +1 -1
- package/dist/calcite/p-a6261f6b.system.entry.js +5 -0
- package/dist/calcite/p-d2a1cbbf.entry.js +5 -0
- package/dist/calcite/{p-bac18793.system.entry.js → p-eb43eb28.system.entry.js} +1 -1
- package/dist/calcite/p-fad60503.entry.js +5 -0
- package/dist/cjs/calcite-graph_2.cjs.entry.js +26 -26
- package/dist/cjs/calcite-tree_2.cjs.entry.js +55 -55
- package/dist/cjs/calcite.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/slider/slider.js +26 -26
- package/dist/collection/components/tree/tree.js +61 -0
- package/dist/collection/components/tree-item/tree-item.js +0 -55
- package/dist/components/calcite-slider.js +26 -26
- package/dist/components/calcite-tree-item.js +0 -55
- package/dist/components/calcite-tree.js +56 -1
- package/dist/custom-elements/index.js +82 -82
- package/dist/esm/calcite-graph_2.entry.js +26 -26
- package/dist/esm/calcite-tree_2.entry.js +55 -55
- package/dist/esm/calcite.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/calcite-graph_2.entry.js +1 -1
- package/dist/esm-es5/calcite-tree_2.entry.js +1 -1
- package/dist/esm-es5/calcite.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/extras/docs-json.json +6 -1
- package/dist/types/components/slider/slider.d.ts +2 -2
- package/dist/types/components/tree/tree.d.ts +1 -0
- package/hydrate/index.js +82 -82
- package/package.json +1 -1
- package/readme.md +2 -2
- package/dist/calcite/p-03a6680c.entry.js +0 -5
- package/dist/calcite/p-38c4fbab.system.entry.js +0 -5
- package/dist/calcite/p-5ea8668d.entry.js +0 -5
|
@@ -18329,72 +18329,72 @@ let Slider = class extends HTMLElement$1 {
|
|
|
18329
18329
|
const mirror = this.shouldMirror();
|
|
18330
18330
|
const leftThumbOffset = `${mirror ? 100 - minInterval : minInterval}%`;
|
|
18331
18331
|
const rightThumbOffset = `${mirror ? maxInterval : 100 - maxInterval}%`;
|
|
18332
|
-
const handle = (h("
|
|
18332
|
+
const handle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.isRange ? this.maxLabel : this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": value, class: {
|
|
18333
18333
|
thumb: true,
|
|
18334
18334
|
"thumb--value": true,
|
|
18335
18335
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp
|
|
18336
|
-
},
|
|
18337
|
-
const labeledHandle = (h("
|
|
18336
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = maxProp), onPointerDown: () => this.dragStart(maxProp), ref: (el) => (this.maxHandle = el), role: "slider", style: { right: rightThumbOffset }, tabIndex: 0 }, h("div", { class: "handle" })));
|
|
18337
|
+
const labeledHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.isRange ? this.maxLabel : this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": value, class: {
|
|
18338
18338
|
thumb: true,
|
|
18339
18339
|
"thumb--value": true,
|
|
18340
18340
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp
|
|
18341
|
-
},
|
|
18342
|
-
const histogramLabeledHandle = (h("
|
|
18341
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = maxProp), onPointerDown: () => this.dragStart(maxProp), ref: (el) => (this.maxHandle = el), role: "slider", style: { right: rightThumbOffset }, tabIndex: 0 }, h("span", { "aria-hidden": "true", class: "handle__label handle__label--value" }, value ? value.toLocaleString() : value), h("span", { "aria-hidden": "true", class: "handle__label handle__label--value static" }, value ? value.toLocaleString() : value), h("span", { "aria-hidden": "true", class: "handle__label handle__label--value transformed" }, value ? value.toLocaleString() : value), h("div", { class: "handle" })));
|
|
18342
|
+
const histogramLabeledHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.isRange ? this.maxLabel : this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": value, class: {
|
|
18343
18343
|
thumb: true,
|
|
18344
18344
|
"thumb--value": true,
|
|
18345
18345
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp
|
|
18346
|
-
},
|
|
18347
|
-
const preciseHandle = (h("
|
|
18346
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = maxProp), onPointerDown: () => this.dragStart(maxProp), ref: (el) => (this.maxHandle = el), role: "slider", style: { right: rightThumbOffset }, tabIndex: 0 }, h("div", { class: "handle" }), h("span", { "aria-hidden": "true", class: "handle__label handle__label--value" }, value ? value.toLocaleString() : value), h("span", { "aria-hidden": "true", class: "handle__label handle__label--value static" }, value ? value.toLocaleString() : value), h("span", { "aria-hidden": "true", class: "handle__label handle__label--value transformed" }, value ? value.toLocaleString() : value)));
|
|
18347
|
+
const preciseHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.isRange ? this.maxLabel : this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": value, class: {
|
|
18348
18348
|
thumb: true,
|
|
18349
18349
|
"thumb--value": true,
|
|
18350
18350
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp,
|
|
18351
18351
|
"thumb--precise": true
|
|
18352
|
-
},
|
|
18353
|
-
const histogramPreciseHandle = (h("
|
|
18352
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = maxProp), onPointerDown: () => this.dragStart(maxProp), ref: (el) => (this.maxHandle = el), role: "slider", style: { right: rightThumbOffset }, tabIndex: 0 }, h("div", { class: "handle" }), h("div", { class: "handle-extension" })));
|
|
18353
|
+
const histogramPreciseHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.isRange ? this.maxLabel : this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": value, class: {
|
|
18354
18354
|
thumb: true,
|
|
18355
18355
|
"thumb--value": true,
|
|
18356
18356
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp,
|
|
18357
18357
|
"thumb--precise": true
|
|
18358
|
-
},
|
|
18359
|
-
const labeledPreciseHandle = (h("
|
|
18358
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = maxProp), onPointerDown: () => this.dragStart(maxProp), ref: (el) => (this.maxHandle = el), role: "slider", style: { right: rightThumbOffset }, tabIndex: 0 }, h("div", { class: "handle-extension" }), h("div", { class: "handle" })));
|
|
18359
|
+
const labeledPreciseHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.isRange ? this.maxLabel : this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": value, class: {
|
|
18360
18360
|
thumb: true,
|
|
18361
18361
|
"thumb--value": true,
|
|
18362
18362
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp,
|
|
18363
18363
|
"thumb--precise": true
|
|
18364
|
-
},
|
|
18365
|
-
const histogramLabeledPreciseHandle = (h("
|
|
18364
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = maxProp), onPointerDown: () => this.dragStart(maxProp), ref: (el) => (this.maxHandle = el), role: "slider", style: { right: rightThumbOffset }, tabIndex: 0 }, h("span", { "aria-hidden": "true", class: "handle__label handle__label--value" }, value ? value.toLocaleString() : value), h("span", { "aria-hidden": "true", class: "handle__label handle__label--value static" }, value ? value.toLocaleString() : value), h("span", { "aria-hidden": "true", class: "handle__label handle__label--value transformed" }, value ? value.toLocaleString() : value), h("div", { class: "handle" }), h("div", { class: "handle-extension" })));
|
|
18365
|
+
const histogramLabeledPreciseHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.isRange ? this.maxLabel : this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": value, class: {
|
|
18366
18366
|
thumb: true,
|
|
18367
18367
|
"thumb--value": true,
|
|
18368
18368
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp,
|
|
18369
18369
|
"thumb--precise": true
|
|
18370
|
-
},
|
|
18371
|
-
const minHandle = (h("
|
|
18370
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = maxProp), onPointerDown: () => this.dragStart(maxProp), ref: (el) => (this.maxHandle = el), role: "slider", style: { right: rightThumbOffset }, tabIndex: 0 }, h("div", { class: "handle-extension" }), h("div", { class: "handle" }), h("span", { "aria-hidden": "true", class: "handle__label handle__label--value" }, value ? value.toLocaleString() : value), h("span", { "aria-hidden": "true", class: "handle__label handle__label--value static" }, value ? value.toLocaleString() : value), h("span", { "aria-hidden": "true", class: "handle__label handle__label--value transformed" }, value ? value.toLocaleString() : value)));
|
|
18371
|
+
const minHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": this.minValue, class: {
|
|
18372
18372
|
thumb: true,
|
|
18373
18373
|
"thumb--minValue": true,
|
|
18374
18374
|
"thumb--active": this.dragProp === "minValue"
|
|
18375
|
-
},
|
|
18376
|
-
const minLabeledHandle = (h("
|
|
18375
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = "minValue"), onPointerDown: () => this.dragStart("minValue"), ref: (el) => (this.minHandle = el), role: "slider", style: { left: leftThumbOffset }, tabIndex: 0 }, h("div", { class: "handle" })));
|
|
18376
|
+
const minLabeledHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": this.minValue, class: {
|
|
18377
18377
|
thumb: true,
|
|
18378
18378
|
"thumb--minValue": true,
|
|
18379
18379
|
"thumb--active": this.dragProp === "minValue"
|
|
18380
|
-
},
|
|
18381
|
-
const minHistogramLabeledHandle = (h("
|
|
18380
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = "minValue"), onPointerDown: () => this.dragStart("minValue"), ref: (el) => (this.minHandle = el), role: "slider", style: { left: leftThumbOffset }, tabIndex: 0 }, h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue" }, this.minValue && this.minValue.toLocaleString()), h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue static" }, this.minValue && this.minValue.toLocaleString()), h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue transformed" }, this.minValue && this.minValue.toLocaleString()), h("div", { class: "handle" })));
|
|
18381
|
+
const minHistogramLabeledHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": this.minValue, class: {
|
|
18382
18382
|
thumb: true,
|
|
18383
18383
|
"thumb--minValue": true,
|
|
18384
18384
|
"thumb--active": this.dragProp === "minValue"
|
|
18385
|
-
},
|
|
18386
|
-
const minPreciseHandle = (h("
|
|
18385
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = "minValue"), onPointerDown: () => this.dragStart("minValue"), ref: (el) => (this.minHandle = el), role: "slider", style: { left: leftThumbOffset }, tabIndex: 0 }, h("div", { class: "handle" }), h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue" }, this.minValue && this.minValue.toLocaleString()), h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue static" }, this.minValue && this.minValue.toLocaleString()), h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue transformed" }, this.minValue && this.minValue.toLocaleString())));
|
|
18386
|
+
const minPreciseHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": this.minValue, class: {
|
|
18387
18387
|
thumb: true,
|
|
18388
18388
|
"thumb--minValue": true,
|
|
18389
18389
|
"thumb--active": this.dragProp === "minValue",
|
|
18390
18390
|
"thumb--precise": true
|
|
18391
|
-
},
|
|
18392
|
-
const minLabeledPreciseHandle = (h("
|
|
18391
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = "minValue"), onPointerDown: () => this.dragStart("minValue"), ref: (el) => (this.minHandle = el), role: "slider", style: { left: leftThumbOffset }, tabIndex: 0 }, h("div", { class: "handle-extension" }), h("div", { class: "handle" })));
|
|
18392
|
+
const minLabeledPreciseHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": this.minValue, class: {
|
|
18393
18393
|
thumb: true,
|
|
18394
18394
|
"thumb--minValue": true,
|
|
18395
18395
|
"thumb--active": this.dragProp === "minValue",
|
|
18396
18396
|
"thumb--precise": true
|
|
18397
|
-
},
|
|
18397
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = "minValue"), onPointerDown: () => this.dragStart("minValue"), ref: (el) => (this.minHandle = el), role: "slider", style: { left: leftThumbOffset }, tabIndex: 0 }, h("div", { class: "handle-extension" }), h("div", { class: "handle" }), h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue" }, this.minValue && this.minValue.toLocaleString()), h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue static" }, this.minValue && this.minValue.toLocaleString()), h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue transformed" }, this.minValue && this.minValue.toLocaleString())));
|
|
18398
18398
|
return (h(Host, { id: id, onTouchStart: this.handleTouchStart }, h("div", { class: {
|
|
18399
18399
|
["container"]: true,
|
|
18400
18400
|
["container--range"]: this.isRange,
|
|
@@ -18866,7 +18866,7 @@ let Slider = class extends HTMLElement$1 {
|
|
|
18866
18866
|
return Math.max(rangeLabelOverlap, 0);
|
|
18867
18867
|
}
|
|
18868
18868
|
/**
|
|
18869
|
-
* Returns a boolean value representing if the minLabel span element is obscured (being overlapped) by the given handle
|
|
18869
|
+
* Returns a boolean value representing if the minLabel span element is obscured (being overlapped) by the given handle div element.
|
|
18870
18870
|
* @param minLabel
|
|
18871
18871
|
* @param handle
|
|
18872
18872
|
*/
|
|
@@ -18876,7 +18876,7 @@ let Slider = class extends HTMLElement$1 {
|
|
|
18876
18876
|
return intersects(minLabelBounds, handleBounds);
|
|
18877
18877
|
}
|
|
18878
18878
|
/**
|
|
18879
|
-
* Returns a boolean value representing if the maxLabel span element is obscured (being overlapped) by the given handle
|
|
18879
|
+
* Returns a boolean value representing if the maxLabel span element is obscured (being overlapped) by the given handle div element.
|
|
18880
18880
|
* @param maxLabel
|
|
18881
18881
|
* @param handle
|
|
18882
18882
|
*/
|
|
@@ -24921,6 +24921,61 @@ let Tree = class extends HTMLElement$1 {
|
|
|
24921
24921
|
selected: nodeListToArray(this.el.querySelectorAll("calcite-tree-item")).filter((i) => i.selected)
|
|
24922
24922
|
});
|
|
24923
24923
|
}
|
|
24924
|
+
keyDownHandler(event) {
|
|
24925
|
+
var _a;
|
|
24926
|
+
const root = this.el.closest("calcite-tree:not([child])");
|
|
24927
|
+
const target = event.target;
|
|
24928
|
+
if (root === this.el && target.tagName === "CALCITE-TREE-ITEM" && this.el.contains(target)) {
|
|
24929
|
+
switch (event.key) {
|
|
24930
|
+
case "ArrowDown":
|
|
24931
|
+
const next = target.nextElementSibling;
|
|
24932
|
+
if (next && next.matches("calcite-tree-item")) {
|
|
24933
|
+
next.focus();
|
|
24934
|
+
event.preventDefault();
|
|
24935
|
+
}
|
|
24936
|
+
break;
|
|
24937
|
+
case "ArrowLeft":
|
|
24938
|
+
// When focus is on an open node, closes the node.
|
|
24939
|
+
if (target.hasChildren && target.expanded) {
|
|
24940
|
+
target.expanded = false;
|
|
24941
|
+
event.preventDefault();
|
|
24942
|
+
break;
|
|
24943
|
+
}
|
|
24944
|
+
// When focus is on a child node that is also either an end node or a closed node, moves focus to its parent node.
|
|
24945
|
+
const parentItem = target.parentElement.closest("calcite-tree-item");
|
|
24946
|
+
if (parentItem && (!target.hasChildren || target.expanded === false)) {
|
|
24947
|
+
parentItem.focus();
|
|
24948
|
+
event.preventDefault();
|
|
24949
|
+
break;
|
|
24950
|
+
}
|
|
24951
|
+
// When focus is on a root node that is also either an end node or a closed node, does nothing.
|
|
24952
|
+
break;
|
|
24953
|
+
case "ArrowRight":
|
|
24954
|
+
if (!target.hasChildren) {
|
|
24955
|
+
break;
|
|
24956
|
+
}
|
|
24957
|
+
if (target.expanded && document.activeElement === target) {
|
|
24958
|
+
// When focus is on an open node, moves focus to the first child node.
|
|
24959
|
+
(_a = target.querySelector("calcite-tree-item")) === null || _a === void 0 ? void 0 : _a.focus();
|
|
24960
|
+
event.preventDefault();
|
|
24961
|
+
}
|
|
24962
|
+
else {
|
|
24963
|
+
// When focus is on a closed node, opens the node; focus does not move.
|
|
24964
|
+
target.expanded = true;
|
|
24965
|
+
event.preventDefault();
|
|
24966
|
+
}
|
|
24967
|
+
// When focus is on an end node, does nothing.
|
|
24968
|
+
break;
|
|
24969
|
+
case "ArrowUp":
|
|
24970
|
+
const previous = target.previousElementSibling;
|
|
24971
|
+
if (previous && previous.matches("calcite-tree-item")) {
|
|
24972
|
+
previous.focus();
|
|
24973
|
+
event.preventDefault();
|
|
24974
|
+
}
|
|
24975
|
+
break;
|
|
24976
|
+
}
|
|
24977
|
+
}
|
|
24978
|
+
}
|
|
24924
24979
|
updateAncestorTree(e) {
|
|
24925
24980
|
const item = e.target;
|
|
24926
24981
|
const children = item.querySelectorAll("calcite-tree-item");
|
|
@@ -25012,12 +25067,6 @@ let TreeItem = class extends HTMLElement$1 {
|
|
|
25012
25067
|
this.iconClickHandler = (event) => {
|
|
25013
25068
|
event.stopPropagation();
|
|
25014
25069
|
this.expanded = !this.expanded;
|
|
25015
|
-
if (this.selectionMode !== TreeSelectionMode.Ancestors) {
|
|
25016
|
-
this.calciteTreeItemSelect.emit({
|
|
25017
|
-
modifyCurrentSelection: this.isSelectionMultiLike,
|
|
25018
|
-
forceToggle: true
|
|
25019
|
-
});
|
|
25020
|
-
}
|
|
25021
25070
|
};
|
|
25022
25071
|
this.childrenClickHandler = (event) => event.stopPropagation();
|
|
25023
25072
|
//--------------------------------------------------------------------------
|
|
@@ -25144,7 +25193,6 @@ let TreeItem = class extends HTMLElement$1 {
|
|
|
25144
25193
|
});
|
|
25145
25194
|
}
|
|
25146
25195
|
keyDownHandler(e) {
|
|
25147
|
-
var _a;
|
|
25148
25196
|
let root;
|
|
25149
25197
|
switch (e.key) {
|
|
25150
25198
|
case " ":
|
|
@@ -25153,7 +25201,6 @@ let TreeItem = class extends HTMLElement$1 {
|
|
|
25153
25201
|
forceToggle: false
|
|
25154
25202
|
});
|
|
25155
25203
|
e.preventDefault();
|
|
25156
|
-
e.stopPropagation();
|
|
25157
25204
|
break;
|
|
25158
25205
|
case "Enter":
|
|
25159
25206
|
// activates a node, i.e., performs its default action. For parent nodes, one possible default action is to open or close the node. In single-select trees where selection does not follow focus (see note below), the default action is typically to select the focused node.
|
|
@@ -25169,53 +25216,6 @@ let TreeItem = class extends HTMLElement$1 {
|
|
|
25169
25216
|
});
|
|
25170
25217
|
}
|
|
25171
25218
|
e.preventDefault();
|
|
25172
|
-
e.stopPropagation();
|
|
25173
|
-
break;
|
|
25174
|
-
case "ArrowLeft":
|
|
25175
|
-
// When focus is on an open node, closes the node.
|
|
25176
|
-
if (this.hasChildren && this.expanded) {
|
|
25177
|
-
this.expanded = false;
|
|
25178
|
-
e.preventDefault();
|
|
25179
|
-
e.stopPropagation();
|
|
25180
|
-
break;
|
|
25181
|
-
}
|
|
25182
|
-
// When focus is on a child node that is also either an end node or a closed node, moves focus to its parent node.
|
|
25183
|
-
const parentItem = this.parentTreeItem;
|
|
25184
|
-
if (parentItem && (!this.hasChildren || this.expanded === false)) {
|
|
25185
|
-
parentItem.focus();
|
|
25186
|
-
e.preventDefault();
|
|
25187
|
-
e.stopPropagation();
|
|
25188
|
-
break;
|
|
25189
|
-
}
|
|
25190
|
-
// When focus is on a root node that is also either an end node or a closed node, does nothing.
|
|
25191
|
-
break;
|
|
25192
|
-
case "ArrowRight":
|
|
25193
|
-
// When focus is on a closed node, opens the node; focus does not move.
|
|
25194
|
-
if (this.hasChildren && this.expanded === false) {
|
|
25195
|
-
this.expanded = true;
|
|
25196
|
-
e.preventDefault();
|
|
25197
|
-
e.stopPropagation();
|
|
25198
|
-
break;
|
|
25199
|
-
}
|
|
25200
|
-
// When focus is on a open node, moves focus to the first child node.
|
|
25201
|
-
if (this.hasChildren && this.expanded) {
|
|
25202
|
-
(_a = this.el.querySelector("calcite-tree-item")) === null || _a === void 0 ? void 0 : _a.focus();
|
|
25203
|
-
e.stopPropagation();
|
|
25204
|
-
break;
|
|
25205
|
-
}
|
|
25206
|
-
// When focus is on an end node, does nothing.
|
|
25207
|
-
break;
|
|
25208
|
-
case "ArrowUp":
|
|
25209
|
-
const previous = this.el.previousElementSibling;
|
|
25210
|
-
if (previous && previous.matches("calcite-tree-item")) {
|
|
25211
|
-
previous.focus();
|
|
25212
|
-
}
|
|
25213
|
-
break;
|
|
25214
|
-
case "ArrowDown":
|
|
25215
|
-
const next = this.el.nextElementSibling;
|
|
25216
|
-
if (next && next.matches("calcite-tree-item")) {
|
|
25217
|
-
next.focus();
|
|
25218
|
-
}
|
|
25219
25219
|
break;
|
|
25220
25220
|
case "Home":
|
|
25221
25221
|
root = this.el.closest("calcite-tree:not([child])");
|
|
@@ -25659,7 +25659,7 @@ const CalciteTipGroup = /*@__PURE__*/proxyCustomElement(TipGroup, [1,"calcite-ti
|
|
|
25659
25659
|
const CalciteTipManager = /*@__PURE__*/proxyCustomElement(TipManager, [1,"calcite-tip-manager",{"closed":[1540],"headingLevel":[2,"heading-level"],"intlClose":[1,"intl-close"],"intlDefaultTitle":[1,"intl-default-title"],"intlNext":[1,"intl-next"],"intlPaginationLabel":[1,"intl-pagination-label"],"intlPrevious":[1,"intl-previous"],"selectedIndex":[32],"tips":[32],"total":[32],"direction":[32],"groupTitle":[32]}]);
|
|
25660
25660
|
const CalciteTooltip = /*@__PURE__*/proxyCustomElement(Tooltip, [1,"calcite-tooltip",{"label":[1],"offsetDistance":[514,"offset-distance"],"offsetSkidding":[514,"offset-skidding"],"open":[516],"overlayPositioning":[1,"overlay-positioning"],"placement":[513],"referenceElement":[1,"reference-element"],"effectiveReferenceElement":[32]}]);
|
|
25661
25661
|
const CalciteTooltipManager = /*@__PURE__*/proxyCustomElement(TooltipManager, [1,"calcite-tooltip-manager",{"selector":[1]},[[4,"keyup","keyUpHandler"],[3,"mouseover","mouseEnterShow"],[3,"mouseout","mouseLeaveHide"],[2,"click","clickHandler"],[2,"focus","focusShow"],[2,"blur","blurHide"]]]);
|
|
25662
|
-
const CalciteTree = /*@__PURE__*/proxyCustomElement(Tree, [1,"calcite-tree",{"lines":[1540],"inputEnabled":[4,"input-enabled"],"child":[1540],"scale":[1537],"selectionMode":[1537,"selection-mode"]},[[0,"focus","onFocus"],[0,"focusin","onFocusIn"],[0,"focusout","onFocusOut"],[0,"calciteTreeItemSelect","onClick"]]]);
|
|
25662
|
+
const CalciteTree = /*@__PURE__*/proxyCustomElement(Tree, [1,"calcite-tree",{"lines":[1540],"inputEnabled":[4,"input-enabled"],"child":[1540],"scale":[1537],"selectionMode":[1537,"selection-mode"]},[[0,"focus","onFocus"],[0,"focusin","onFocusIn"],[0,"focusout","onFocusOut"],[0,"calciteTreeItemSelect","onClick"],[0,"keydown","keyDownHandler"]]]);
|
|
25663
25663
|
const CalciteTreeItem = /*@__PURE__*/proxyCustomElement(TreeItem, [1,"calcite-tree-item",{"selected":[1540],"expanded":[1540],"parentExpanded":[4,"parent-expanded"],"depth":[1538],"hasChildren":[1540,"has-children"],"lines":[1540],"inputEnabled":[4,"input-enabled"],"scale":[1537],"indeterminate":[516],"selectionMode":[1025,"selection-mode"]},[[0,"click","onClick"],[0,"keydown","keyDownHandler"]]]);
|
|
25664
25664
|
const CalciteValueList = /*@__PURE__*/proxyCustomElement(ValueList, [1,"calcite-value-list",{"disabled":[516],"dragEnabled":[516,"drag-enabled"],"filterEnabled":[516,"filter-enabled"],"filterPlaceholder":[513,"filter-placeholder"],"group":[1],"loading":[516],"multiple":[516],"selectionFollowsFocus":[4,"selection-follows-focus"],"selectedValues":[32],"dataForFilter":[32]},[[0,"calciteListItemRemove","calciteListItemRemoveHandler"],[0,"calciteListItemChange","calciteListItemChangeHandler"],[0,"calciteListItemPropsChange","calciteListItemPropsChangeHandler"],[0,"calciteListItemValueChange","calciteListItemValueChangeHandler"]]]);
|
|
25665
25665
|
const CalciteValueListItem = /*@__PURE__*/proxyCustomElement(ValueListItem, [1,"calcite-value-list-item",{"description":[513],"disabled":[516],"disableDeselect":[4,"disable-deselect"],"nonInteractive":[516,"non-interactive"],"handleActivated":[1028,"handle-activated"],"icon":[513],"label":[513],"metadata":[16],"removable":[516],"selected":[1540],"value":[8]},[[0,"calciteListItemChange","calciteListItemChangeHandler"]]]);
|
|
@@ -352,72 +352,72 @@ let Slider = class {
|
|
|
352
352
|
const mirror = this.shouldMirror();
|
|
353
353
|
const leftThumbOffset = `${mirror ? 100 - minInterval : minInterval}%`;
|
|
354
354
|
const rightThumbOffset = `${mirror ? maxInterval : 100 - maxInterval}%`;
|
|
355
|
-
const handle = (h("
|
|
355
|
+
const handle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.isRange ? this.maxLabel : this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": value, class: {
|
|
356
356
|
thumb: true,
|
|
357
357
|
"thumb--value": true,
|
|
358
358
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp
|
|
359
|
-
},
|
|
360
|
-
const labeledHandle = (h("
|
|
359
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = maxProp), onPointerDown: () => this.dragStart(maxProp), ref: (el) => (this.maxHandle = el), role: "slider", style: { right: rightThumbOffset }, tabIndex: 0 }, h("div", { class: "handle" })));
|
|
360
|
+
const labeledHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.isRange ? this.maxLabel : this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": value, class: {
|
|
361
361
|
thumb: true,
|
|
362
362
|
"thumb--value": true,
|
|
363
363
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp
|
|
364
|
-
},
|
|
365
|
-
const histogramLabeledHandle = (h("
|
|
364
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = maxProp), onPointerDown: () => this.dragStart(maxProp), ref: (el) => (this.maxHandle = el), role: "slider", style: { right: rightThumbOffset }, tabIndex: 0 }, h("span", { "aria-hidden": "true", class: "handle__label handle__label--value" }, value ? value.toLocaleString() : value), h("span", { "aria-hidden": "true", class: "handle__label handle__label--value static" }, value ? value.toLocaleString() : value), h("span", { "aria-hidden": "true", class: "handle__label handle__label--value transformed" }, value ? value.toLocaleString() : value), h("div", { class: "handle" })));
|
|
365
|
+
const histogramLabeledHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.isRange ? this.maxLabel : this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": value, class: {
|
|
366
366
|
thumb: true,
|
|
367
367
|
"thumb--value": true,
|
|
368
368
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp
|
|
369
|
-
},
|
|
370
|
-
const preciseHandle = (h("
|
|
369
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = maxProp), onPointerDown: () => this.dragStart(maxProp), ref: (el) => (this.maxHandle = el), role: "slider", style: { right: rightThumbOffset }, tabIndex: 0 }, h("div", { class: "handle" }), h("span", { "aria-hidden": "true", class: "handle__label handle__label--value" }, value ? value.toLocaleString() : value), h("span", { "aria-hidden": "true", class: "handle__label handle__label--value static" }, value ? value.toLocaleString() : value), h("span", { "aria-hidden": "true", class: "handle__label handle__label--value transformed" }, value ? value.toLocaleString() : value)));
|
|
370
|
+
const preciseHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.isRange ? this.maxLabel : this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": value, class: {
|
|
371
371
|
thumb: true,
|
|
372
372
|
"thumb--value": true,
|
|
373
373
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp,
|
|
374
374
|
"thumb--precise": true
|
|
375
|
-
},
|
|
376
|
-
const histogramPreciseHandle = (h("
|
|
375
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = maxProp), onPointerDown: () => this.dragStart(maxProp), ref: (el) => (this.maxHandle = el), role: "slider", style: { right: rightThumbOffset }, tabIndex: 0 }, h("div", { class: "handle" }), h("div", { class: "handle-extension" })));
|
|
376
|
+
const histogramPreciseHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.isRange ? this.maxLabel : this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": value, class: {
|
|
377
377
|
thumb: true,
|
|
378
378
|
"thumb--value": true,
|
|
379
379
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp,
|
|
380
380
|
"thumb--precise": true
|
|
381
|
-
},
|
|
382
|
-
const labeledPreciseHandle = (h("
|
|
381
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = maxProp), onPointerDown: () => this.dragStart(maxProp), ref: (el) => (this.maxHandle = el), role: "slider", style: { right: rightThumbOffset }, tabIndex: 0 }, h("div", { class: "handle-extension" }), h("div", { class: "handle" })));
|
|
382
|
+
const labeledPreciseHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.isRange ? this.maxLabel : this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": value, class: {
|
|
383
383
|
thumb: true,
|
|
384
384
|
"thumb--value": true,
|
|
385
385
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp,
|
|
386
386
|
"thumb--precise": true
|
|
387
|
-
},
|
|
388
|
-
const histogramLabeledPreciseHandle = (h("
|
|
387
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = maxProp), onPointerDown: () => this.dragStart(maxProp), ref: (el) => (this.maxHandle = el), role: "slider", style: { right: rightThumbOffset }, tabIndex: 0 }, h("span", { "aria-hidden": "true", class: "handle__label handle__label--value" }, value ? value.toLocaleString() : value), h("span", { "aria-hidden": "true", class: "handle__label handle__label--value static" }, value ? value.toLocaleString() : value), h("span", { "aria-hidden": "true", class: "handle__label handle__label--value transformed" }, value ? value.toLocaleString() : value), h("div", { class: "handle" }), h("div", { class: "handle-extension" })));
|
|
388
|
+
const histogramLabeledPreciseHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.isRange ? this.maxLabel : this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": value, class: {
|
|
389
389
|
thumb: true,
|
|
390
390
|
"thumb--value": true,
|
|
391
391
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp,
|
|
392
392
|
"thumb--precise": true
|
|
393
|
-
},
|
|
394
|
-
const minHandle = (h("
|
|
393
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = maxProp), onPointerDown: () => this.dragStart(maxProp), ref: (el) => (this.maxHandle = el), role: "slider", style: { right: rightThumbOffset }, tabIndex: 0 }, h("div", { class: "handle-extension" }), h("div", { class: "handle" }), h("span", { "aria-hidden": "true", class: "handle__label handle__label--value" }, value ? value.toLocaleString() : value), h("span", { "aria-hidden": "true", class: "handle__label handle__label--value static" }, value ? value.toLocaleString() : value), h("span", { "aria-hidden": "true", class: "handle__label handle__label--value transformed" }, value ? value.toLocaleString() : value)));
|
|
394
|
+
const minHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": this.minValue, class: {
|
|
395
395
|
thumb: true,
|
|
396
396
|
"thumb--minValue": true,
|
|
397
397
|
"thumb--active": this.dragProp === "minValue"
|
|
398
|
-
},
|
|
399
|
-
const minLabeledHandle = (h("
|
|
398
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = "minValue"), onPointerDown: () => this.dragStart("minValue"), ref: (el) => (this.minHandle = el), role: "slider", style: { left: leftThumbOffset }, tabIndex: 0 }, h("div", { class: "handle" })));
|
|
399
|
+
const minLabeledHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": this.minValue, class: {
|
|
400
400
|
thumb: true,
|
|
401
401
|
"thumb--minValue": true,
|
|
402
402
|
"thumb--active": this.dragProp === "minValue"
|
|
403
|
-
},
|
|
404
|
-
const minHistogramLabeledHandle = (h("
|
|
403
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = "minValue"), onPointerDown: () => this.dragStart("minValue"), ref: (el) => (this.minHandle = el), role: "slider", style: { left: leftThumbOffset }, tabIndex: 0 }, h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue" }, this.minValue && this.minValue.toLocaleString()), h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue static" }, this.minValue && this.minValue.toLocaleString()), h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue transformed" }, this.minValue && this.minValue.toLocaleString()), h("div", { class: "handle" })));
|
|
404
|
+
const minHistogramLabeledHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": this.minValue, class: {
|
|
405
405
|
thumb: true,
|
|
406
406
|
"thumb--minValue": true,
|
|
407
407
|
"thumb--active": this.dragProp === "minValue"
|
|
408
|
-
},
|
|
409
|
-
const minPreciseHandle = (h("
|
|
408
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = "minValue"), onPointerDown: () => this.dragStart("minValue"), ref: (el) => (this.minHandle = el), role: "slider", style: { left: leftThumbOffset }, tabIndex: 0 }, h("div", { class: "handle" }), h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue" }, this.minValue && this.minValue.toLocaleString()), h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue static" }, this.minValue && this.minValue.toLocaleString()), h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue transformed" }, this.minValue && this.minValue.toLocaleString())));
|
|
409
|
+
const minPreciseHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": this.minValue, class: {
|
|
410
410
|
thumb: true,
|
|
411
411
|
"thumb--minValue": true,
|
|
412
412
|
"thumb--active": this.dragProp === "minValue",
|
|
413
413
|
"thumb--precise": true
|
|
414
|
-
},
|
|
415
|
-
const minLabeledPreciseHandle = (h("
|
|
414
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = "minValue"), onPointerDown: () => this.dragStart("minValue"), ref: (el) => (this.minHandle = el), role: "slider", style: { left: leftThumbOffset }, tabIndex: 0 }, h("div", { class: "handle-extension" }), h("div", { class: "handle" })));
|
|
415
|
+
const minLabeledPreciseHandle = (h("div", { "aria-disabled": this.disabled, "aria-label": this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": this.minValue, class: {
|
|
416
416
|
thumb: true,
|
|
417
417
|
"thumb--minValue": true,
|
|
418
418
|
"thumb--active": this.dragProp === "minValue",
|
|
419
419
|
"thumb--precise": true
|
|
420
|
-
},
|
|
420
|
+
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = "minValue"), onPointerDown: () => this.dragStart("minValue"), ref: (el) => (this.minHandle = el), role: "slider", style: { left: leftThumbOffset }, tabIndex: 0 }, h("div", { class: "handle-extension" }), h("div", { class: "handle" }), h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue" }, this.minValue && this.minValue.toLocaleString()), h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue static" }, this.minValue && this.minValue.toLocaleString()), h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue transformed" }, this.minValue && this.minValue.toLocaleString())));
|
|
421
421
|
return (h(Host, { id: id, onTouchStart: this.handleTouchStart }, h("div", { class: {
|
|
422
422
|
["container"]: true,
|
|
423
423
|
["container--range"]: this.isRange,
|
|
@@ -889,7 +889,7 @@ let Slider = class {
|
|
|
889
889
|
return Math.max(rangeLabelOverlap, 0);
|
|
890
890
|
}
|
|
891
891
|
/**
|
|
892
|
-
* Returns a boolean value representing if the minLabel span element is obscured (being overlapped) by the given handle
|
|
892
|
+
* Returns a boolean value representing if the minLabel span element is obscured (being overlapped) by the given handle div element.
|
|
893
893
|
* @param minLabel
|
|
894
894
|
* @param handle
|
|
895
895
|
*/
|
|
@@ -899,7 +899,7 @@ let Slider = class {
|
|
|
899
899
|
return intersects(minLabelBounds, handleBounds);
|
|
900
900
|
}
|
|
901
901
|
/**
|
|
902
|
-
* Returns a boolean value representing if the maxLabel span element is obscured (being overlapped) by the given handle
|
|
902
|
+
* Returns a boolean value representing if the maxLabel span element is obscured (being overlapped) by the given handle div element.
|
|
903
903
|
* @param maxLabel
|
|
904
904
|
* @param handle
|
|
905
905
|
*/
|
|
@@ -157,6 +157,61 @@ let Tree = class {
|
|
|
157
157
|
selected: nodeListToArray(this.el.querySelectorAll("calcite-tree-item")).filter((i) => i.selected)
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
|
+
keyDownHandler(event) {
|
|
161
|
+
var _a;
|
|
162
|
+
const root = this.el.closest("calcite-tree:not([child])");
|
|
163
|
+
const target = event.target;
|
|
164
|
+
if (root === this.el && target.tagName === "CALCITE-TREE-ITEM" && this.el.contains(target)) {
|
|
165
|
+
switch (event.key) {
|
|
166
|
+
case "ArrowDown":
|
|
167
|
+
const next = target.nextElementSibling;
|
|
168
|
+
if (next && next.matches("calcite-tree-item")) {
|
|
169
|
+
next.focus();
|
|
170
|
+
event.preventDefault();
|
|
171
|
+
}
|
|
172
|
+
break;
|
|
173
|
+
case "ArrowLeft":
|
|
174
|
+
// When focus is on an open node, closes the node.
|
|
175
|
+
if (target.hasChildren && target.expanded) {
|
|
176
|
+
target.expanded = false;
|
|
177
|
+
event.preventDefault();
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
// When focus is on a child node that is also either an end node or a closed node, moves focus to its parent node.
|
|
181
|
+
const parentItem = target.parentElement.closest("calcite-tree-item");
|
|
182
|
+
if (parentItem && (!target.hasChildren || target.expanded === false)) {
|
|
183
|
+
parentItem.focus();
|
|
184
|
+
event.preventDefault();
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
// When focus is on a root node that is also either an end node or a closed node, does nothing.
|
|
188
|
+
break;
|
|
189
|
+
case "ArrowRight":
|
|
190
|
+
if (!target.hasChildren) {
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
if (target.expanded && document.activeElement === target) {
|
|
194
|
+
// When focus is on an open node, moves focus to the first child node.
|
|
195
|
+
(_a = target.querySelector("calcite-tree-item")) === null || _a === void 0 ? void 0 : _a.focus();
|
|
196
|
+
event.preventDefault();
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
// When focus is on a closed node, opens the node; focus does not move.
|
|
200
|
+
target.expanded = true;
|
|
201
|
+
event.preventDefault();
|
|
202
|
+
}
|
|
203
|
+
// When focus is on an end node, does nothing.
|
|
204
|
+
break;
|
|
205
|
+
case "ArrowUp":
|
|
206
|
+
const previous = target.previousElementSibling;
|
|
207
|
+
if (previous && previous.matches("calcite-tree-item")) {
|
|
208
|
+
previous.focus();
|
|
209
|
+
event.preventDefault();
|
|
210
|
+
}
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
160
215
|
updateAncestorTree(e) {
|
|
161
216
|
const item = e.target;
|
|
162
217
|
const children = item.querySelectorAll("calcite-tree-item");
|
|
@@ -246,12 +301,6 @@ let TreeItem = class {
|
|
|
246
301
|
this.iconClickHandler = (event) => {
|
|
247
302
|
event.stopPropagation();
|
|
248
303
|
this.expanded = !this.expanded;
|
|
249
|
-
if (this.selectionMode !== TreeSelectionMode.Ancestors) {
|
|
250
|
-
this.calciteTreeItemSelect.emit({
|
|
251
|
-
modifyCurrentSelection: this.isSelectionMultiLike,
|
|
252
|
-
forceToggle: true
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
304
|
};
|
|
256
305
|
this.childrenClickHandler = (event) => event.stopPropagation();
|
|
257
306
|
//--------------------------------------------------------------------------
|
|
@@ -378,7 +427,6 @@ let TreeItem = class {
|
|
|
378
427
|
});
|
|
379
428
|
}
|
|
380
429
|
keyDownHandler(e) {
|
|
381
|
-
var _a;
|
|
382
430
|
let root;
|
|
383
431
|
switch (e.key) {
|
|
384
432
|
case " ":
|
|
@@ -387,7 +435,6 @@ let TreeItem = class {
|
|
|
387
435
|
forceToggle: false
|
|
388
436
|
});
|
|
389
437
|
e.preventDefault();
|
|
390
|
-
e.stopPropagation();
|
|
391
438
|
break;
|
|
392
439
|
case "Enter":
|
|
393
440
|
// activates a node, i.e., performs its default action. For parent nodes, one possible default action is to open or close the node. In single-select trees where selection does not follow focus (see note below), the default action is typically to select the focused node.
|
|
@@ -403,53 +450,6 @@ let TreeItem = class {
|
|
|
403
450
|
});
|
|
404
451
|
}
|
|
405
452
|
e.preventDefault();
|
|
406
|
-
e.stopPropagation();
|
|
407
|
-
break;
|
|
408
|
-
case "ArrowLeft":
|
|
409
|
-
// When focus is on an open node, closes the node.
|
|
410
|
-
if (this.hasChildren && this.expanded) {
|
|
411
|
-
this.expanded = false;
|
|
412
|
-
e.preventDefault();
|
|
413
|
-
e.stopPropagation();
|
|
414
|
-
break;
|
|
415
|
-
}
|
|
416
|
-
// When focus is on a child node that is also either an end node or a closed node, moves focus to its parent node.
|
|
417
|
-
const parentItem = this.parentTreeItem;
|
|
418
|
-
if (parentItem && (!this.hasChildren || this.expanded === false)) {
|
|
419
|
-
parentItem.focus();
|
|
420
|
-
e.preventDefault();
|
|
421
|
-
e.stopPropagation();
|
|
422
|
-
break;
|
|
423
|
-
}
|
|
424
|
-
// When focus is on a root node that is also either an end node or a closed node, does nothing.
|
|
425
|
-
break;
|
|
426
|
-
case "ArrowRight":
|
|
427
|
-
// When focus is on a closed node, opens the node; focus does not move.
|
|
428
|
-
if (this.hasChildren && this.expanded === false) {
|
|
429
|
-
this.expanded = true;
|
|
430
|
-
e.preventDefault();
|
|
431
|
-
e.stopPropagation();
|
|
432
|
-
break;
|
|
433
|
-
}
|
|
434
|
-
// When focus is on a open node, moves focus to the first child node.
|
|
435
|
-
if (this.hasChildren && this.expanded) {
|
|
436
|
-
(_a = this.el.querySelector("calcite-tree-item")) === null || _a === void 0 ? void 0 : _a.focus();
|
|
437
|
-
e.stopPropagation();
|
|
438
|
-
break;
|
|
439
|
-
}
|
|
440
|
-
// When focus is on an end node, does nothing.
|
|
441
|
-
break;
|
|
442
|
-
case "ArrowUp":
|
|
443
|
-
const previous = this.el.previousElementSibling;
|
|
444
|
-
if (previous && previous.matches("calcite-tree-item")) {
|
|
445
|
-
previous.focus();
|
|
446
|
-
}
|
|
447
|
-
break;
|
|
448
|
-
case "ArrowDown":
|
|
449
|
-
const next = this.el.nextElementSibling;
|
|
450
|
-
if (next && next.matches("calcite-tree-item")) {
|
|
451
|
-
next.focus();
|
|
452
|
-
}
|
|
453
453
|
break;
|
|
454
454
|
case "Home":
|
|
455
455
|
root = this.el.closest("calcite-tree:not([child])");
|