@esri/calcite-components 1.0.0-next.422 → 1.0.0-next.425
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-afe59546.entry.js → p-2139226c.entry.js} +1 -1
- package/dist/calcite/p-2692ac43.entry.js +5 -0
- package/dist/calcite/p-58392046.system.entry.js +5 -0
- package/dist/calcite/p-62afcb36.system.js +1 -1
- package/dist/calcite/p-7b238036.entry.js +5 -0
- package/dist/calcite/p-cedd48fe.system.entry.js +5 -0
- package/dist/calcite/{p-9ad8c7c5.system.entry.js → p-fe3f4e0e.system.entry.js} +1 -1
- package/dist/cjs/calcite-date-picker_4.cjs.entry.js +27 -19
- package/dist/cjs/calcite-graph_2.cjs.entry.js +67 -38
- package/dist/cjs/calcite-tab_4.cjs.entry.js +31 -32
- package/dist/collection/components/date-picker-month-header/date-picker-month-header.js +27 -19
- package/dist/collection/components/slider/slider.js +76 -41
- package/dist/collection/components/tab/tab.js +10 -12
- package/dist/collection/components/tab-nav/tab-nav.js +8 -5
- package/dist/collection/components/tab-title/tab-title.js +13 -12
- package/dist/collection/components/tabs/tabs.js +0 -3
- package/dist/components/calcite-slider.js +67 -38
- package/dist/components/date-picker-month-header.js +27 -19
- package/dist/components/tab-nav.js +8 -5
- package/dist/components/tab-title.js +13 -12
- package/dist/components/tab.js +10 -12
- package/dist/components/tabs.js +0 -3
- package/dist/custom-elements/index.js +125 -89
- package/dist/esm/calcite-date-picker_4.entry.js +27 -19
- package/dist/esm/calcite-graph_2.entry.js +67 -38
- package/dist/esm/calcite-tab_4.entry.js +31 -32
- package/dist/esm-es5/calcite-date-picker_4.entry.js +1 -1
- package/dist/esm-es5/calcite-graph_2.entry.js +1 -1
- package/dist/esm-es5/calcite-tab_4.entry.js +1 -1
- package/dist/extras/docs-json.json +6 -3
- package/dist/types/components/date-picker-month-header/date-picker-month-header.d.ts +3 -1
- package/dist/types/components/slider/slider.d.ts +5 -2
- package/dist/types/components/tab/tab.d.ts +4 -5
- package/dist/types/components/tab-nav/tab-nav.d.ts +15 -19
- package/dist/types/components/tab-title/tab-title.d.ts +9 -18
- package/dist/types/components/tabs/tabs.d.ts +1 -4
- package/dist/types/components.d.ts +2 -2
- package/hydrate/index.js +125 -89
- package/package.json +2 -2
- package/dist/calcite/p-1aeca42a.system.entry.js +0 -5
- package/dist/calcite/p-3915705c.entry.js +0 -5
- package/dist/calcite/p-872e82a6.system.entry.js +0 -5
- package/dist/calcite/p-e22ab8fa.entry.js +0 -5
package/hydrate/index.js
CHANGED
|
@@ -17373,20 +17373,23 @@ class DatePickerMonthHeader {
|
|
|
17373
17373
|
* Increment year on UP/DOWN keys
|
|
17374
17374
|
*/
|
|
17375
17375
|
this.onYearKey = (e) => {
|
|
17376
|
-
const
|
|
17376
|
+
const localizedYear = e.target.value;
|
|
17377
17377
|
switch (e.key) {
|
|
17378
17378
|
case "ArrowDown":
|
|
17379
17379
|
e.preventDefault();
|
|
17380
|
-
this.setYear(
|
|
17380
|
+
this.setYear({ localizedYear, offset: -1 });
|
|
17381
17381
|
break;
|
|
17382
17382
|
case "ArrowUp":
|
|
17383
17383
|
e.preventDefault();
|
|
17384
|
-
this.setYear(
|
|
17384
|
+
this.setYear({ localizedYear, offset: 1 });
|
|
17385
17385
|
break;
|
|
17386
17386
|
}
|
|
17387
17387
|
};
|
|
17388
|
-
this.
|
|
17389
|
-
this.setYear(event.target.value);
|
|
17388
|
+
this.onYearChange = (event) => {
|
|
17389
|
+
this.setYear({ localizedYear: event.target.value });
|
|
17390
|
+
};
|
|
17391
|
+
this.onYearInput = (event) => {
|
|
17392
|
+
this.setYear({ localizedYear: event.target.value, commit: false });
|
|
17390
17393
|
};
|
|
17391
17394
|
this.prevMonthClick = (e) => {
|
|
17392
17395
|
this.handleArrowClick(e, this.prevMonthDate);
|
|
@@ -17442,7 +17445,7 @@ class DatePickerMonthHeader {
|
|
|
17442
17445
|
return (hAsync(Fragment, null, hAsync("a", { "aria-disabled": (this.prevMonthDate.getMonth() === activeMonth).toString(), "aria-label": this.intlPrevMonth, class: "chevron", href: "#", onClick: this.prevMonthClick, onKeyDown: this.prevMonthKeydown, role: "button", tabindex: this.prevMonthDate.getMonth() === activeMonth ? -1 : 0 }, hAsync("calcite-icon", { "flip-rtl": true, icon: "chevron-left", scale: iconScale })), hAsync("div", { class: { text: true, "text--reverse": reverse } }, hAsync(Heading, { class: "month", level: this.headingLevel }, localizedMonth), hAsync("span", { class: "year-wrap" }, hAsync("input", { "aria-label": this.intlYear, class: {
|
|
17443
17446
|
year: true,
|
|
17444
17447
|
"year--suffix": !!suffix
|
|
17445
|
-
}, inputmode: "numeric", maxlength: "4", minlength: "1", onInput: this.
|
|
17448
|
+
}, inputmode: "numeric", maxlength: "4", minlength: "1", onChange: this.onYearChange, onInput: this.onYearInput, onKeyDown: this.onYearKey, pattern: "\\d*", ref: (el) => (this.yearInput = el), type: "text", value: localizedYear }), suffix && (hAsync("span", { class: "suffix" }, hAsync("span", { "aria-hidden": "true", class: "suffix__invisible" }, localizedYear), " " + suffix)))), hAsync("a", { "aria-disabled": (this.nextMonthDate.getMonth() === activeMonth).toString(), "aria-label": this.intlNextMonth, class: "chevron", href: "#", onClick: this.nextMonthClick, onKeyDown: this.nextMonthKeydown, role: "button", tabindex: this.nextMonthDate.getMonth() === activeMonth ? -1 : 0 }, hAsync("calcite-icon", { "flip-rtl": true, icon: "chevron-right", scale: iconScale }))));
|
|
17446
17449
|
}
|
|
17447
17450
|
setNextPrevMonthDates() {
|
|
17448
17451
|
if (!this.activeDate) {
|
|
@@ -17451,27 +17454,32 @@ class DatePickerMonthHeader {
|
|
|
17451
17454
|
this.nextMonthDate = dateFromRange(nextMonth(this.activeDate), this.min, this.max);
|
|
17452
17455
|
this.prevMonthDate = dateFromRange(prevMonth(this.activeDate), this.min, this.max);
|
|
17453
17456
|
}
|
|
17454
|
-
|
|
17455
|
-
|
|
17456
|
-
* set to active if in range
|
|
17457
|
-
*/
|
|
17458
|
-
setYear(localizedYear, increment = 0) {
|
|
17459
|
-
const { min, max, activeDate, localeData, yearInput } = this;
|
|
17457
|
+
getInRangeDate({ localizedYear, offset = 0 }) {
|
|
17458
|
+
const { min, max, activeDate, localeData } = this;
|
|
17460
17459
|
const parsedYear = parseNumber(localizedYear, localeData);
|
|
17461
17460
|
const length = parsedYear.toString().length;
|
|
17462
|
-
const year = isNaN(parsedYear) ? false : parsedYear +
|
|
17461
|
+
const year = isNaN(parsedYear) ? false : parsedYear + offset;
|
|
17463
17462
|
const inRange = year && (!min || min.getFullYear() <= year) && (!max || max.getFullYear() >= year);
|
|
17464
|
-
// if you've supplied a year and it's in range
|
|
17463
|
+
// if you've supplied a year and it's in range
|
|
17465
17464
|
if (year && inRange && length === localizedYear.length) {
|
|
17466
17465
|
const nextDate = new Date(activeDate);
|
|
17467
17466
|
nextDate.setFullYear(year);
|
|
17468
|
-
|
|
17467
|
+
return dateFromRange(nextDate, min, max);
|
|
17468
|
+
}
|
|
17469
|
+
}
|
|
17470
|
+
/**
|
|
17471
|
+
* Parse localized year string from input,
|
|
17472
|
+
* set to active if in range
|
|
17473
|
+
*/
|
|
17474
|
+
setYear({ localizedYear, commit = true, offset = 0 }) {
|
|
17475
|
+
const { yearInput, activeDate, localeData } = this;
|
|
17476
|
+
const inRangeDate = this.getInRangeDate({ localizedYear, offset });
|
|
17477
|
+
// if you've supplied a year and it's in range, update active date
|
|
17478
|
+
if (inRangeDate) {
|
|
17469
17479
|
this.calciteDatePickerSelect.emit(inRangeDate);
|
|
17470
|
-
yearInput.value = localizeNumber(inRangeDate.getFullYear(), localeData);
|
|
17471
17480
|
}
|
|
17472
|
-
|
|
17473
|
-
|
|
17474
|
-
yearInput.value = localizeNumber(activeDate.getFullYear(), localeData);
|
|
17481
|
+
if (commit) {
|
|
17482
|
+
yearInput.value = localizeNumber((inRangeDate || activeDate).getFullYear(), localeData);
|
|
17475
17483
|
}
|
|
17476
17484
|
}
|
|
17477
17485
|
get el() { return getElement(this); }
|
|
@@ -25148,6 +25156,9 @@ class ShellPanel {
|
|
|
25148
25156
|
|
|
25149
25157
|
const sliderCss = "@charset \"UTF-8\";@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}/*!@:root*/.sc-calcite-slider:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}/*!@.calcite-animate*/.calcite-animate.sc-calcite-slider{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}/*!@.calcite-animate__in*/.calcite-animate__in.sc-calcite-slider{-webkit-animation-name:in;animation-name:in}/*!@.calcite-animate__in-down*/.calcite-animate__in-down.sc-calcite-slider{-webkit-animation-name:in-down;animation-name:in-down}/*!@.calcite-animate__in-up*/.calcite-animate__in-up.sc-calcite-slider{-webkit-animation-name:in-up;animation-name:in-up}/*!@.calcite-animate__in-scale*/.calcite-animate__in-scale.sc-calcite-slider{-webkit-animation-name:in-scale;animation-name:in-scale}/*!@:root*/.sc-calcite-slider:root{--calcite-popper-transition:var(--calcite-animation-timing)}/*!@:host([hidden])*/[hidden].sc-calcite-slider-h{display:none}/*!@.scale--s*/.scale--s.sc-calcite-slider{--calcite-slider-handle-size:10px;--calcite-slider-handle-extension-height:6.5px;--calcite-slider-container-font-size:var(--calcite-font-size--3)}/*!@.scale--s .handle__label, .scale--s .tick__label*/.scale--s.sc-calcite-slider .handle__label.sc-calcite-slider,.scale--s.sc-calcite-slider .tick__label.sc-calcite-slider{line-height:.75rem}/*!@.scale--m*/.scale--m.sc-calcite-slider{--calcite-slider-handle-size:14px;--calcite-slider-handle-extension-height:8px;--calcite-slider-container-font-size:var(--calcite-font-size--2)}/*!@.scale--m .handle__label, .scale--m .tick__label*/.scale--m.sc-calcite-slider .handle__label.sc-calcite-slider,.scale--m.sc-calcite-slider .tick__label.sc-calcite-slider{line-height:1rem}/*!@.scale--l*/.scale--l.sc-calcite-slider{--calcite-slider-handle-size:16px;--calcite-slider-handle-extension-height:10.5px;--calcite-slider-container-font-size:var(--calcite-font-size--1)}/*!@.scale--l .handle__label, .scale--l .tick__label*/.scale--l.sc-calcite-slider .handle__label.sc-calcite-slider,.scale--l.sc-calcite-slider .tick__label.sc-calcite-slider{line-height:1rem}/*!@.handle__label, .tick__label*/.handle__label.sc-calcite-slider,.tick__label.sc-calcite-slider{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2);font-size:var(--calcite-slider-container-font-size)}/*!@:host*/.sc-calcite-slider-h{display:block}/*!@.container*/.container.sc-calcite-slider{position:relative;display:block;padding:calc(var(--calcite-slider-handle-size) * 0.5);margin:calc(var(--calcite-slider-handle-size) * 0.5) 0;--calcite-slider-full-handle-height:calc(\n var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height)\n )}/*!@:host([disabled])*/[disabled].sc-calcite-slider-h{pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}/*!@:host([disabled]) .track__range,\n:host([disabled]) .tick--active*/[disabled].sc-calcite-slider-h .track__range.sc-calcite-slider,[disabled].sc-calcite-slider-h .tick--active.sc-calcite-slider{background-color:var(--calcite-ui-text-3)}/*!@:host([disabled]) ::slotted([calcite-hydrated][disabled]),\n:host([disabled]) [calcite-hydrated][disabled]*/.sc-calcite-slider-h[disabled] .sc-calcite-slider-s>[calcite-hydrated][disabled],[disabled].sc-calcite-slider-h [calcite-hydrated][disabled].sc-calcite-slider{opacity:1}/*!@.scale--s .thumb:not(.thumb--precise)*/.scale--s.sc-calcite-slider .thumb.sc-calcite-slider:not(.thumb--precise){--calcite-slider-thumb-y-offset:-6px}/*!@.scale--m .thumb:not(.thumb--precise)*/.scale--m.sc-calcite-slider .thumb.sc-calcite-slider:not(.thumb--precise){--calcite-slider-thumb-y-offset:-8px}/*!@.scale--l .thumb:not(.thumb--precise)*/.scale--l.sc-calcite-slider .thumb.sc-calcite-slider:not(.thumb--precise){--calcite-slider-thumb-y-offset:-9px}/*!@:host([precise]:not([has-histogram])) .container .thumb--value*/[precise].sc-calcite-slider-h:not([has-histogram]) .container.sc-calcite-slider .thumb--value.sc-calcite-slider{--calcite-slider-thumb-y-offset:calc(var(--calcite-slider-full-handle-height) * -1)}/*!@.thumb-container*/.thumb-container.sc-calcite-slider{position:relative;max-width:100%}/*!@.thumb*/.thumb.sc-calcite-slider{--calcite-slider-thumb-x-offset:calc(var(--calcite-slider-handle-size) * 0.5);position:absolute;margin:0px;display:-ms-flexbox;display:flex;cursor:pointer;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;border-style:none;background-color:transparent;padding:0px;font-family:inherit;outline:2px solid transparent;outline-offset:2px;-webkit-transform:translate(var(--calcite-slider-thumb-x-offset), var(--calcite-slider-thumb-y-offset));transform:translate(var(--calcite-slider-thumb-x-offset), var(--calcite-slider-thumb-y-offset))}/*!@.thumb .handle__label.static, .thumb .handle__label.transformed*/.thumb.sc-calcite-slider .handle__label.static.sc-calcite-slider,.thumb.sc-calcite-slider .handle__label.transformed.sc-calcite-slider{position:absolute;top:0px;bottom:0px;opacity:0}/*!@.thumb .handle__label.hyphen::after*/.thumb.sc-calcite-slider .handle__label.hyphen.sc-calcite-slider::after{content:\"—\";display:inline-block;width:1em}/*!@.thumb .handle__label.hyphen--wrap*/.thumb.sc-calcite-slider .handle__label.hyphen--wrap.sc-calcite-slider{display:-ms-flexbox;display:flex}/*!@.thumb .handle*/.thumb.sc-calcite-slider .handle.sc-calcite-slider{-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:9999px;background-color:var(--calcite-ui-foreground-1);outline-offset:0;outline-color:transparent;-webkit-transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;height:var(--calcite-slider-handle-size);width:var(--calcite-slider-handle-size);-webkit-box-shadow:0 0 0 2px var(--calcite-ui-text-3) inset;box-shadow:0 0 0 2px var(--calcite-ui-text-3) inset;-webkit-transition:border var(--calcite-internal-animation-timing-medium) ease, background-color var(--calcite-internal-animation-timing-medium) ease, -webkit-box-shadow var(--calcite-animation-timing) ease;transition:border var(--calcite-internal-animation-timing-medium) ease, background-color var(--calcite-internal-animation-timing-medium) ease, -webkit-box-shadow var(--calcite-animation-timing) ease;transition:border var(--calcite-internal-animation-timing-medium) ease, background-color var(--calcite-internal-animation-timing-medium) ease, box-shadow var(--calcite-animation-timing) ease;transition:border var(--calcite-internal-animation-timing-medium) ease, background-color var(--calcite-internal-animation-timing-medium) ease, box-shadow var(--calcite-animation-timing) ease, -webkit-box-shadow var(--calcite-animation-timing) ease}/*!@.thumb .handle-extension*/.thumb.sc-calcite-slider .handle-extension.sc-calcite-slider{width:0.125rem;height:var(--calcite-slider-handle-extension-height);background-color:var(--calcite-ui-text-3)}/*!@.thumb:hover .handle*/.thumb.sc-calcite-slider:hover .handle.sc-calcite-slider{-webkit-box-shadow:0 0 0 3px var(--calcite-ui-brand) inset;box-shadow:0 0 0 3px var(--calcite-ui-brand) inset}/*!@.thumb:hover .handle-extension*/.thumb.sc-calcite-slider:hover .handle-extension.sc-calcite-slider{background-color:var(--calcite-ui-brand)}/*!@.thumb:focus .handle*/.thumb.sc-calcite-slider:focus .handle.sc-calcite-slider{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}/*!@.thumb:focus .handle-extension*/.thumb.sc-calcite-slider:focus .handle-extension.sc-calcite-slider{background-color:var(--calcite-ui-brand)}/*!@.thumb.thumb--minValue*/.thumb.thumb--minValue.sc-calcite-slider{-webkit-transform:translate(calc(var(--calcite-slider-thumb-x-offset) * -1), var(--calcite-slider-thumb-y-offset));transform:translate(calc(var(--calcite-slider-thumb-x-offset) * -1), var(--calcite-slider-thumb-y-offset))}/*!@.thumb.thumb--precise*/.thumb.thumb--precise.sc-calcite-slider{--calcite-slider-thumb-y-offset:-2px}/*!@:host([label-handles]) .thumb*/[label-handles].sc-calcite-slider-h .thumb.sc-calcite-slider{--calcite-slider-thumb-x-offset:50%}/*!@:host([label-handles]):host(:not([has-histogram])) .scale--s .thumb:not(.thumb--precise)*/[label-handles].sc-calcite-slider-h(.sc-calcite-slider-h:not([has-histogram])) .scale--s.sc-calcite-slider .thumb.sc-calcite-slider:not(.thumb--precise){--calcite-slider-thumb-y-offset:-23px}/*!@:host([label-handles]):host(:not([has-histogram])) .scale--m .thumb:not(.thumb--precise)*/[label-handles].sc-calcite-slider-h(.sc-calcite-slider-h:not([has-histogram])) .scale--m.sc-calcite-slider .thumb.sc-calcite-slider:not(.thumb--precise){--calcite-slider-thumb-y-offset:-30px}/*!@:host([label-handles]):host(:not([has-histogram])) .scale--l .thumb:not(.thumb--precise)*/[label-handles].sc-calcite-slider-h(.sc-calcite-slider-h:not([has-histogram])) .scale--l.sc-calcite-slider .thumb.sc-calcite-slider:not(.thumb--precise){--calcite-slider-thumb-y-offset:-32px}/*!@:host([has-histogram][label-handles]) .handle__label,\n:host([label-handles]:not([has-histogram])) .thumb--minValue.thumb--precise .handle__label*/[has-histogram][label-handles].sc-calcite-slider-h .handle__label.sc-calcite-slider,[label-handles].sc-calcite-slider-h:not([has-histogram]) .thumb--minValue.thumb--precise.sc-calcite-slider .handle__label.sc-calcite-slider{margin-top:0.5em}/*!@:host(:not([has-histogram]):not([precise])) .handle__label,\n:host([label-handles]:not([has-histogram])) .thumb--value .handle__label*/.sc-calcite-slider-h:not([has-histogram]):not([precise]) .handle__label.sc-calcite-slider,[label-handles].sc-calcite-slider-h:not([has-histogram]) .thumb--value.sc-calcite-slider .handle__label.sc-calcite-slider{margin-bottom:0.5em}/*!@:host([label-handles][precise]):host(:not([has-histogram])) .scale--s .thumb--value*/[label-handles][precise].sc-calcite-slider-h(.sc-calcite-slider-h:not([has-histogram])) .scale--s.sc-calcite-slider .thumb--value.sc-calcite-slider{--calcite-slider-thumb-y-offset:-33px}/*!@:host([label-handles][precise]):host(:not([has-histogram])) .scale--m .thumb--value*/[label-handles][precise].sc-calcite-slider-h(.sc-calcite-slider-h:not([has-histogram])) .scale--m.sc-calcite-slider .thumb--value.sc-calcite-slider{--calcite-slider-thumb-y-offset:-44px}/*!@:host([label-handles][precise]):host(:not([has-histogram])) .scale--l .thumb--value*/[label-handles][precise].sc-calcite-slider-h(.sc-calcite-slider-h:not([has-histogram])) .scale--l.sc-calcite-slider .thumb--value.sc-calcite-slider{--calcite-slider-thumb-y-offset:-49px}/*!@.thumb:focus .handle, .thumb--active .handle*/.thumb.sc-calcite-slider:focus .handle.sc-calcite-slider,.thumb--active.sc-calcite-slider .handle.sc-calcite-slider{background-color:var(--calcite-ui-brand);-webkit-box-shadow:0 0 8px 0 rgba(0, 0, 0, 0.16);box-shadow:0 0 8px 0 rgba(0, 0, 0, 0.16)}/*!@.thumb:hover.thumb--precise:after, .thumb:focus.thumb--precise:after, .thumb--active.thumb--precise:after*/.thumb.sc-calcite-slider:hover.thumb--precise:after,.thumb.sc-calcite-slider:focus.thumb--precise:after,.thumb--active.thumb--precise.sc-calcite-slider:after{background-color:var(--calcite-ui-brand)}/*!@.track*/.track.sc-calcite-slider{position:relative;height:0.125rem;border-radius:0px;background-color:var(--calcite-ui-border-2);-webkit-transition:all var(--calcite-internal-animation-timing-medium) ease-in;transition:all var(--calcite-internal-animation-timing-medium) ease-in}/*!@.track__range*/.track__range.sc-calcite-slider{position:absolute;top:0px;height:0.125rem;background-color:var(--calcite-ui-brand)}/*!@.container--range .track__range:hover*/.container--range.sc-calcite-slider .track__range.sc-calcite-slider:hover{cursor:ew-resize}/*!@.container--range .track__range:after*/.container--range.sc-calcite-slider .track__range.sc-calcite-slider:after{position:absolute;width:100%;content:\"\";top:calc(var(--calcite-slider-full-handle-height) * 0.5 * -1);height:calc(var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height))}/*!@.tick*/.tick.sc-calcite-slider{position:absolute;height:0.25rem;width:0.125rem;border-width:1px;border-style:solid;background-color:var(--calcite-ui-border-input);border-color:var(--calcite-ui-foreground-1);top:-2px;pointer-events:none;-webkit-margin-start:calc(-1 * 0.125rem);margin-inline-start:calc(-1 * 0.125rem)}/*!@.tick--active*/.tick--active.sc-calcite-slider{background-color:var(--calcite-ui-brand)}/*!@.tick__label*/.tick__label.sc-calcite-slider{pointer-events:none;margin-top:0.875rem;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}/*!@.tick__label--min*/.tick__label--min.sc-calcite-slider{-webkit-transition:opacity var(--calcite-animation-timing);transition:opacity var(--calcite-animation-timing)}/*!@.tick__label--max*/.tick__label--max.sc-calcite-slider{-webkit-transition:opacity var(--calcite-internal-animation-timing-fast);transition:opacity var(--calcite-internal-animation-timing-fast)}/*!@:host([has-histogram][label-handles]) .tick__label--min, :host([has-histogram][label-handles]) .tick__label--max, :host([has-histogram][precise]) .tick__label--min, :host([has-histogram][precise]) .tick__label--max*/[has-histogram][label-handles].sc-calcite-slider-h .tick__label--min.sc-calcite-slider,[has-histogram][label-handles].sc-calcite-slider-h .tick__label--max.sc-calcite-slider,[has-histogram][precise].sc-calcite-slider-h .tick__label--min.sc-calcite-slider,[has-histogram][precise].sc-calcite-slider-h .tick__label--max.sc-calcite-slider{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-3)}/*!@.graph*/.graph.sc-calcite-slider{color:var(--calcite-ui-foreground-3);height:48px}/*!@:host([label-ticks][ticks]) .container*/[label-ticks][ticks].sc-calcite-slider-h .container.sc-calcite-slider{padding-bottom:calc(0.875rem + var(--calcite-slider-container-font-size))}/*!@:host([has-histogram]):host([precise][label-handles]) .container*/[has-histogram].sc-calcite-slider-h([precise][label-handles]).sc-calcite-slider-h .container.sc-calcite-slider{padding-bottom:calc(var(--calcite-slider-full-handle-height) + 1em)}/*!@:host([has-histogram]):host([label-handles]:not([precise])) .container*/[has-histogram].sc-calcite-slider-h([label-handles].sc-calcite-slider-h:not([precise])) .container.sc-calcite-slider{padding-bottom:calc(var(--calcite-slider-handle-size) * 0.5 + 1em)}/*!@:host([has-histogram]):host([precise]:not([label-handles])) .container*/[has-histogram].sc-calcite-slider-h([precise].sc-calcite-slider-h:not([label-handles])) .container.sc-calcite-slider{padding-bottom:var(--calcite-slider-full-handle-height)}/*!@:host(:not([has-histogram])):host([precise]:not([label-handles])) .container*/.sc-calcite-slider-h:not([has-histogram]).sc-calcite-slider-h([precise]:not([label-handles])) .container.sc-calcite-slider{padding-top:var(--calcite-slider-full-handle-height)}/*!@:host(:not([has-histogram])):host([precise]:not([label-handles])) .container--range*/.sc-calcite-slider-h:not([has-histogram]).sc-calcite-slider-h([precise]:not([label-handles])) .container--range.sc-calcite-slider{padding-bottom:var(--calcite-slider-full-handle-height)}/*!@:host(:not([has-histogram])):host([label-handles]:not([precise])) .container*/.sc-calcite-slider-h:not([has-histogram]).sc-calcite-slider-h([label-handles]:not([precise])) .container.sc-calcite-slider{padding-top:calc(var(--calcite-slider-full-handle-height) + 4px)}/*!@:host(:not([has-histogram])):host([label-handles][precise]) .container*/.sc-calcite-slider-h:not([has-histogram]).sc-calcite-slider-h([label-handles][precise]) .container.sc-calcite-slider{padding-top:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}/*!@:host(:not([has-histogram])):host([label-handles][precise]) .container--range*/.sc-calcite-slider-h:not([has-histogram]).sc-calcite-slider-h([label-handles][precise]) .container--range.sc-calcite-slider{padding-bottom:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}/*!@::slotted(input[slot=hidden-form-input])*/.sc-calcite-slider-s>input[slot=hidden-form-input]{bottom:0 !important;left:0 !important;margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;right:0 !important;top:0 !important;-webkit-transform:none !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}";
|
|
25150
25158
|
|
|
25159
|
+
function isRange(value) {
|
|
25160
|
+
return Array.isArray(value);
|
|
25161
|
+
}
|
|
25151
25162
|
class Slider {
|
|
25152
25163
|
constructor(hostRef) {
|
|
25153
25164
|
registerInstance(this, hostRef);
|
|
@@ -25188,13 +25199,12 @@ class Slider {
|
|
|
25188
25199
|
/** Interval to move on up/down keys */
|
|
25189
25200
|
this.step = 1;
|
|
25190
25201
|
/** Currently selected number (if single select) */
|
|
25191
|
-
this.value =
|
|
25202
|
+
this.value = 0;
|
|
25192
25203
|
/**
|
|
25193
25204
|
* Specify the scale of the slider, defaults to m
|
|
25194
25205
|
*/
|
|
25195
25206
|
this.scale = "m";
|
|
25196
25207
|
this.guid = `calcite-slider-${guid()}`;
|
|
25197
|
-
this.isRange = false;
|
|
25198
25208
|
this.activeProp = "value";
|
|
25199
25209
|
this.minMaxValueRange = null;
|
|
25200
25210
|
this.minValueDragRange = null;
|
|
@@ -25204,7 +25214,7 @@ class Slider {
|
|
|
25204
25214
|
event.preventDefault();
|
|
25205
25215
|
if (this.dragProp) {
|
|
25206
25216
|
const value = this.translate(event.clientX || event.pageX);
|
|
25207
|
-
if (this.
|
|
25217
|
+
if (isRange(this.value) && this.dragProp === "minMaxValue") {
|
|
25208
25218
|
if (this.minValueDragRange && this.maxValueDragRange && this.minMaxValueRange) {
|
|
25209
25219
|
const newMinValue = value - this.minValueDragRange;
|
|
25210
25220
|
const newMaxValue = value + this.maxValueDragRange;
|
|
@@ -25250,12 +25260,20 @@ class Slider {
|
|
|
25250
25260
|
histogramWatcher(newHistogram) {
|
|
25251
25261
|
this.hasHistogram = !!newHistogram;
|
|
25252
25262
|
}
|
|
25263
|
+
valueHandler() {
|
|
25264
|
+
this.setMinMaxFromValue();
|
|
25265
|
+
}
|
|
25266
|
+
minMaxValueHandler() {
|
|
25267
|
+
this.setValueFromMinMax();
|
|
25268
|
+
}
|
|
25253
25269
|
//--------------------------------------------------------------------------
|
|
25254
25270
|
//
|
|
25255
25271
|
// Lifecycle
|
|
25256
25272
|
//
|
|
25257
25273
|
//--------------------------------------------------------------------------
|
|
25258
25274
|
connectedCallback() {
|
|
25275
|
+
this.setMinMaxFromValue();
|
|
25276
|
+
this.setValueFromMinMax();
|
|
25259
25277
|
connectLabel(this);
|
|
25260
25278
|
connectForm(this);
|
|
25261
25279
|
}
|
|
@@ -25265,11 +25283,12 @@ class Slider {
|
|
|
25265
25283
|
this.removeDragListeners();
|
|
25266
25284
|
}
|
|
25267
25285
|
componentWillLoad() {
|
|
25268
|
-
this.isRange = !!(this.maxValue || this.maxValue === 0);
|
|
25269
25286
|
this.tickValues = this.generateTickValues();
|
|
25270
|
-
|
|
25287
|
+
if (!isRange(this.value)) {
|
|
25288
|
+
this.value = this.clamp(this.value);
|
|
25289
|
+
}
|
|
25271
25290
|
afterConnectDefaultValueSet(this, this.value);
|
|
25272
|
-
if (this.snap) {
|
|
25291
|
+
if (this.snap && !isRange(this.value)) {
|
|
25273
25292
|
this.value = this.getClosestStep(this.value);
|
|
25274
25293
|
}
|
|
25275
25294
|
if (this.histogram) {
|
|
@@ -25279,9 +25298,9 @@ class Slider {
|
|
|
25279
25298
|
componentDidRender() {
|
|
25280
25299
|
if (this.labelHandles) {
|
|
25281
25300
|
this.adjustHostObscuredHandleLabel("value");
|
|
25282
|
-
if (this.
|
|
25301
|
+
if (isRange(this.value)) {
|
|
25283
25302
|
this.adjustHostObscuredHandleLabel("minValue");
|
|
25284
|
-
if (!(this.precise &&
|
|
25303
|
+
if (!(this.precise && !this.hasHistogram)) {
|
|
25285
25304
|
this.hyphenateCollidingRangeHandleLabels();
|
|
25286
25305
|
}
|
|
25287
25306
|
}
|
|
@@ -25291,50 +25310,50 @@ class Slider {
|
|
|
25291
25310
|
}
|
|
25292
25311
|
render() {
|
|
25293
25312
|
const id = this.el.id || this.guid;
|
|
25313
|
+
const maxProp = isRange(this.value) ? "maxValue" : "value";
|
|
25314
|
+
const value = isRange(this.value) ? this.maxValue : this.value;
|
|
25294
25315
|
const min = this.minValue || this.min;
|
|
25295
|
-
const max = this.maxValue || this.value;
|
|
25296
|
-
const maxProp = this.isRange ? "maxValue" : "value";
|
|
25297
|
-
const value = this[maxProp];
|
|
25298
25316
|
const useMinValue = this.shouldUseMinValue();
|
|
25299
25317
|
const minInterval = this.getUnitInterval(useMinValue ? this.minValue : min) * 100;
|
|
25300
|
-
const maxInterval = this.getUnitInterval(
|
|
25318
|
+
const maxInterval = this.getUnitInterval(value) * 100;
|
|
25301
25319
|
const mirror = this.shouldMirror();
|
|
25302
25320
|
const leftThumbOffset = `${mirror ? 100 - minInterval : minInterval}%`;
|
|
25303
25321
|
const rightThumbOffset = `${mirror ? maxInterval : 100 - maxInterval}%`;
|
|
25304
|
-
const
|
|
25322
|
+
const valueIsRange = isRange(this.value);
|
|
25323
|
+
const handle = (hAsync("div", { "aria-disabled": this.disabled, "aria-label": valueIsRange ? this.maxLabel : this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": value, class: {
|
|
25305
25324
|
thumb: true,
|
|
25306
25325
|
"thumb--value": true,
|
|
25307
25326
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp
|
|
25308
25327
|
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = maxProp), onPointerDown: () => this.dragStart(maxProp), ref: (el) => (this.maxHandle = el), role: "slider", style: { right: rightThumbOffset }, tabIndex: 0 }, hAsync("div", { class: "handle" })));
|
|
25309
|
-
const labeledHandle = (hAsync("div", { "aria-disabled": this.disabled, "aria-label":
|
|
25328
|
+
const labeledHandle = (hAsync("div", { "aria-disabled": this.disabled, "aria-label": valueIsRange ? this.maxLabel : this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": value, class: {
|
|
25310
25329
|
thumb: true,
|
|
25311
25330
|
"thumb--value": true,
|
|
25312
25331
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp
|
|
25313
25332
|
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = maxProp), onPointerDown: () => this.dragStart(maxProp), ref: (el) => (this.maxHandle = el), role: "slider", style: { right: rightThumbOffset }, tabIndex: 0 }, hAsync("span", { "aria-hidden": "true", class: "handle__label handle__label--value" }, value ? value.toLocaleString() : value), hAsync("span", { "aria-hidden": "true", class: "handle__label handle__label--value static" }, value ? value.toLocaleString() : value), hAsync("span", { "aria-hidden": "true", class: "handle__label handle__label--value transformed" }, value ? value.toLocaleString() : value), hAsync("div", { class: "handle" })));
|
|
25314
|
-
const histogramLabeledHandle = (hAsync("div", { "aria-disabled": this.disabled, "aria-label":
|
|
25333
|
+
const histogramLabeledHandle = (hAsync("div", { "aria-disabled": this.disabled, "aria-label": valueIsRange ? this.maxLabel : this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": value, class: {
|
|
25315
25334
|
thumb: true,
|
|
25316
25335
|
"thumb--value": true,
|
|
25317
25336
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp
|
|
25318
25337
|
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = maxProp), onPointerDown: () => this.dragStart(maxProp), ref: (el) => (this.maxHandle = el), role: "slider", style: { right: rightThumbOffset }, tabIndex: 0 }, hAsync("div", { class: "handle" }), hAsync("span", { "aria-hidden": "true", class: "handle__label handle__label--value" }, value ? value.toLocaleString() : value), hAsync("span", { "aria-hidden": "true", class: "handle__label handle__label--value static" }, value ? value.toLocaleString() : value), hAsync("span", { "aria-hidden": "true", class: "handle__label handle__label--value transformed" }, value ? value.toLocaleString() : value)));
|
|
25319
|
-
const preciseHandle = (hAsync("div", { "aria-disabled": this.disabled, "aria-label":
|
|
25338
|
+
const preciseHandle = (hAsync("div", { "aria-disabled": this.disabled, "aria-label": valueIsRange ? this.maxLabel : this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": value, class: {
|
|
25320
25339
|
thumb: true,
|
|
25321
25340
|
"thumb--value": true,
|
|
25322
25341
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp,
|
|
25323
25342
|
"thumb--precise": true
|
|
25324
25343
|
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = maxProp), onPointerDown: () => this.dragStart(maxProp), ref: (el) => (this.maxHandle = el), role: "slider", style: { right: rightThumbOffset }, tabIndex: 0 }, hAsync("div", { class: "handle" }), hAsync("div", { class: "handle-extension" })));
|
|
25325
|
-
const histogramPreciseHandle = (hAsync("div", { "aria-disabled": this.disabled, "aria-label":
|
|
25344
|
+
const histogramPreciseHandle = (hAsync("div", { "aria-disabled": this.disabled, "aria-label": valueIsRange ? this.maxLabel : this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": value, class: {
|
|
25326
25345
|
thumb: true,
|
|
25327
25346
|
"thumb--value": true,
|
|
25328
25347
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp,
|
|
25329
25348
|
"thumb--precise": true
|
|
25330
25349
|
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = maxProp), onPointerDown: () => this.dragStart(maxProp), ref: (el) => (this.maxHandle = el), role: "slider", style: { right: rightThumbOffset }, tabIndex: 0 }, hAsync("div", { class: "handle-extension" }), hAsync("div", { class: "handle" })));
|
|
25331
|
-
const labeledPreciseHandle = (hAsync("div", { "aria-disabled": this.disabled, "aria-label":
|
|
25350
|
+
const labeledPreciseHandle = (hAsync("div", { "aria-disabled": this.disabled, "aria-label": valueIsRange ? this.maxLabel : this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": value, class: {
|
|
25332
25351
|
thumb: true,
|
|
25333
25352
|
"thumb--value": true,
|
|
25334
25353
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp,
|
|
25335
25354
|
"thumb--precise": true
|
|
25336
25355
|
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = maxProp), onPointerDown: () => this.dragStart(maxProp), ref: (el) => (this.maxHandle = el), role: "slider", style: { right: rightThumbOffset }, tabIndex: 0 }, hAsync("span", { "aria-hidden": "true", class: "handle__label handle__label--value" }, value ? value.toLocaleString() : value), hAsync("span", { "aria-hidden": "true", class: "handle__label handle__label--value static" }, value ? value.toLocaleString() : value), hAsync("span", { "aria-hidden": "true", class: "handle__label handle__label--value transformed" }, value ? value.toLocaleString() : value), hAsync("div", { class: "handle" }), hAsync("div", { class: "handle-extension" })));
|
|
25337
|
-
const histogramLabeledPreciseHandle = (hAsync("div", { "aria-disabled": this.disabled, "aria-label":
|
|
25356
|
+
const histogramLabeledPreciseHandle = (hAsync("div", { "aria-disabled": this.disabled, "aria-label": valueIsRange ? this.maxLabel : this.minLabel, "aria-orientation": "horizontal", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": value, class: {
|
|
25338
25357
|
thumb: true,
|
|
25339
25358
|
"thumb--value": true,
|
|
25340
25359
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp,
|
|
@@ -25369,14 +25388,14 @@ class Slider {
|
|
|
25369
25388
|
}, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = "minValue"), onPointerDown: () => this.dragStart("minValue"), ref: (el) => (this.minHandle = el), role: "slider", style: { left: leftThumbOffset }, tabIndex: 0 }, hAsync("div", { class: "handle-extension" }), hAsync("div", { class: "handle" }), hAsync("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue" }, this.minValue && this.minValue.toLocaleString()), hAsync("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue static" }, this.minValue && this.minValue.toLocaleString()), hAsync("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue transformed" }, this.minValue && this.minValue.toLocaleString())));
|
|
25370
25389
|
return (hAsync(Host, { id: id, onTouchStart: this.handleTouchStart }, hAsync("div", { class: {
|
|
25371
25390
|
["container"]: true,
|
|
25372
|
-
["container--range"]:
|
|
25391
|
+
["container--range"]: valueIsRange,
|
|
25373
25392
|
[`scale--${this.scale}`]: true
|
|
25374
25393
|
} }, this.renderGraph(), hAsync("div", { class: "track", ref: this.storeTrackRef }, hAsync("div", { class: "track__range", onPointerDown: () => this.dragStart("minMaxValue"), style: {
|
|
25375
25394
|
left: `${mirror ? 100 - maxInterval : minInterval}%`,
|
|
25376
25395
|
right: `${mirror ? minInterval : 100 - maxInterval}%`
|
|
25377
25396
|
} }), hAsync("div", { class: "ticks" }, this.tickValues.map((tick) => {
|
|
25378
25397
|
const tickOffset = `${this.getUnitInterval(tick) * 100}%`;
|
|
25379
|
-
let activeTicks = tick >= min && tick <=
|
|
25398
|
+
let activeTicks = tick >= min && tick <= value;
|
|
25380
25399
|
if (useMinValue) {
|
|
25381
25400
|
activeTicks = tick >= this.minValue && tick <= this.maxValue;
|
|
25382
25401
|
}
|
|
@@ -25387,23 +25406,24 @@ class Slider {
|
|
|
25387
25406
|
left: mirror ? "" : tickOffset,
|
|
25388
25407
|
right: mirror ? tickOffset : ""
|
|
25389
25408
|
} }, this.renderTickLabel(tick)));
|
|
25390
|
-
}))), hAsync("div", { class: "thumb-container" }, !this.precise && !this.labelHandles &&
|
|
25409
|
+
}))), hAsync("div", { class: "thumb-container" }, !this.precise && !this.labelHandles && valueIsRange && minHandle, !this.hasHistogram &&
|
|
25391
25410
|
!this.precise &&
|
|
25392
25411
|
this.labelHandles &&
|
|
25393
|
-
|
|
25394
|
-
minLabeledHandle, this.precise && !this.labelHandles &&
|
|
25412
|
+
valueIsRange &&
|
|
25413
|
+
minLabeledHandle, this.precise && !this.labelHandles && valueIsRange && minPreciseHandle, this.precise && this.labelHandles && valueIsRange && minLabeledPreciseHandle, this.hasHistogram &&
|
|
25395
25414
|
!this.precise &&
|
|
25396
25415
|
this.labelHandles &&
|
|
25397
|
-
|
|
25416
|
+
valueIsRange &&
|
|
25398
25417
|
minHistogramLabeledHandle, !this.precise && !this.labelHandles && handle, !this.hasHistogram && !this.precise && this.labelHandles && labeledHandle, !this.hasHistogram && this.precise && !this.labelHandles && preciseHandle, this.hasHistogram && this.precise && !this.labelHandles && histogramPreciseHandle, !this.hasHistogram && this.precise && this.labelHandles && labeledPreciseHandle, this.hasHistogram && !this.precise && this.labelHandles && histogramLabeledHandle, this.hasHistogram &&
|
|
25399
25418
|
this.precise &&
|
|
25400
25419
|
this.labelHandles &&
|
|
25401
25420
|
histogramLabeledPreciseHandle, hAsync(HiddenFormInputSlot, { component: this })))));
|
|
25402
25421
|
}
|
|
25403
25422
|
renderGraph() {
|
|
25404
|
-
return this.histogram ? (hAsync("calcite-graph", { class: "graph", colorStops: this.histogramStops, data: this.histogram, highlightMax: this.
|
|
25423
|
+
return this.histogram ? (hAsync("calcite-graph", { class: "graph", colorStops: this.histogramStops, data: this.histogram, highlightMax: isRange(this.value) ? this.maxValue : this.value, highlightMin: isRange(this.value) ? this.minValue : this.min, max: this.max, min: this.min })) : null;
|
|
25405
25424
|
}
|
|
25406
25425
|
renderTickLabel(tick) {
|
|
25426
|
+
const valueIsRange = isRange(this.value);
|
|
25407
25427
|
const isMinTickLabel = tick === this.min;
|
|
25408
25428
|
const isMaxTickLabel = tick === this.max;
|
|
25409
25429
|
const tickLabel = (hAsync("span", { class: {
|
|
@@ -25411,26 +25431,26 @@ class Slider {
|
|
|
25411
25431
|
"tick__label--min": isMinTickLabel,
|
|
25412
25432
|
"tick__label--max": isMaxTickLabel
|
|
25413
25433
|
} }, tick.toLocaleString()));
|
|
25414
|
-
if (this.labelTicks && !this.hasHistogram && !
|
|
25434
|
+
if (this.labelTicks && !this.hasHistogram && !valueIsRange) {
|
|
25415
25435
|
return tickLabel;
|
|
25416
25436
|
}
|
|
25417
25437
|
if (this.labelTicks &&
|
|
25418
25438
|
!this.hasHistogram &&
|
|
25419
|
-
|
|
25439
|
+
valueIsRange &&
|
|
25420
25440
|
!this.precise &&
|
|
25421
25441
|
!this.labelHandles) {
|
|
25422
25442
|
return tickLabel;
|
|
25423
25443
|
}
|
|
25424
25444
|
if (this.labelTicks &&
|
|
25425
25445
|
!this.hasHistogram &&
|
|
25426
|
-
|
|
25446
|
+
valueIsRange &&
|
|
25427
25447
|
!this.precise &&
|
|
25428
25448
|
this.labelHandles) {
|
|
25429
25449
|
return tickLabel;
|
|
25430
25450
|
}
|
|
25431
25451
|
if (this.labelTicks &&
|
|
25432
25452
|
!this.hasHistogram &&
|
|
25433
|
-
|
|
25453
|
+
valueIsRange &&
|
|
25434
25454
|
this.precise &&
|
|
25435
25455
|
(isMinTickLabel || isMaxTickLabel)) {
|
|
25436
25456
|
return tickLabel;
|
|
@@ -25514,7 +25534,7 @@ class Slider {
|
|
|
25514
25534
|
const x = event.clientX || event.pageX;
|
|
25515
25535
|
const position = this.translate(x);
|
|
25516
25536
|
let prop = "value";
|
|
25517
|
-
if (this.
|
|
25537
|
+
if (isRange(this.value)) {
|
|
25518
25538
|
const inRange = position >= this.minValue && position <= this.maxValue;
|
|
25519
25539
|
if (inRange && this.lastDragProp === "minMaxValue") {
|
|
25520
25540
|
prop = "minMaxValue";
|
|
@@ -25550,6 +25570,19 @@ class Slider {
|
|
|
25550
25570
|
// Private Methods
|
|
25551
25571
|
//
|
|
25552
25572
|
//--------------------------------------------------------------------------
|
|
25573
|
+
setValueFromMinMax() {
|
|
25574
|
+
const { minValue, maxValue } = this;
|
|
25575
|
+
if (typeof minValue === "number" && typeof maxValue === "number") {
|
|
25576
|
+
this.value = [minValue, maxValue];
|
|
25577
|
+
}
|
|
25578
|
+
}
|
|
25579
|
+
setMinMaxFromValue() {
|
|
25580
|
+
const { value } = this;
|
|
25581
|
+
if (isRange(value)) {
|
|
25582
|
+
this.minValue = value[0];
|
|
25583
|
+
this.maxValue = value[1];
|
|
25584
|
+
}
|
|
25585
|
+
}
|
|
25553
25586
|
onLabelClick() {
|
|
25554
25587
|
this.setFocus();
|
|
25555
25588
|
}
|
|
@@ -25557,7 +25590,7 @@ class Slider {
|
|
|
25557
25590
|
return this.mirrored && !this.hasHistogram;
|
|
25558
25591
|
}
|
|
25559
25592
|
shouldUseMinValue() {
|
|
25560
|
-
if (!this.
|
|
25593
|
+
if (!isRange(this.value)) {
|
|
25561
25594
|
return false;
|
|
25562
25595
|
}
|
|
25563
25596
|
return ((this.hasHistogram && this.maxValue === 0) || (!this.hasHistogram && this.minValue === 0));
|
|
@@ -25770,19 +25803,20 @@ class Slider {
|
|
|
25770
25803
|
* Hides bounding tick labels that are obscured by either handle.
|
|
25771
25804
|
*/
|
|
25772
25805
|
hideObscuredBoundingTickLabels() {
|
|
25773
|
-
|
|
25806
|
+
const valueIsRange = isRange(this.value);
|
|
25807
|
+
if (!this.hasHistogram && !valueIsRange && !this.labelHandles && !this.precise) {
|
|
25774
25808
|
return;
|
|
25775
25809
|
}
|
|
25776
|
-
if (!this.hasHistogram && !
|
|
25810
|
+
if (!this.hasHistogram && !valueIsRange && this.labelHandles && !this.precise) {
|
|
25777
25811
|
return;
|
|
25778
25812
|
}
|
|
25779
|
-
if (!this.hasHistogram && !
|
|
25813
|
+
if (!this.hasHistogram && !valueIsRange && !this.labelHandles && this.precise) {
|
|
25780
25814
|
return;
|
|
25781
25815
|
}
|
|
25782
|
-
if (!this.hasHistogram && !
|
|
25816
|
+
if (!this.hasHistogram && !valueIsRange && this.labelHandles && this.precise) {
|
|
25783
25817
|
return;
|
|
25784
25818
|
}
|
|
25785
|
-
if (!this.hasHistogram &&
|
|
25819
|
+
if (!this.hasHistogram && valueIsRange && !this.precise) {
|
|
25786
25820
|
return;
|
|
25787
25821
|
}
|
|
25788
25822
|
if (this.hasHistogram && !this.precise && !this.labelHandles) {
|
|
@@ -25859,7 +25893,10 @@ class Slider {
|
|
|
25859
25893
|
}
|
|
25860
25894
|
get el() { return getElement(this); }
|
|
25861
25895
|
static get watchers() { return {
|
|
25862
|
-
"histogram": ["histogramWatcher"]
|
|
25896
|
+
"histogram": ["histogramWatcher"],
|
|
25897
|
+
"value": ["valueHandler"],
|
|
25898
|
+
"minValue": ["minMaxValueHandler"],
|
|
25899
|
+
"maxValue": ["minMaxValueHandler"]
|
|
25863
25900
|
}; }
|
|
25864
25901
|
static get style() { return sliderCss; }
|
|
25865
25902
|
static get cmpMeta() { return {
|
|
@@ -29736,14 +29773,6 @@ class Tab {
|
|
|
29736
29773
|
this.active = false;
|
|
29737
29774
|
/** @internal Parent tabs component scale value */
|
|
29738
29775
|
this.scale = "m";
|
|
29739
|
-
//--------------------------------------------------------------------------
|
|
29740
|
-
//
|
|
29741
|
-
// Private State/Props
|
|
29742
|
-
//
|
|
29743
|
-
//--------------------------------------------------------------------------
|
|
29744
|
-
/**
|
|
29745
|
-
* @internal
|
|
29746
|
-
*/
|
|
29747
29776
|
this.guid = `calcite-tab-title-${guid()}`;
|
|
29748
29777
|
}
|
|
29749
29778
|
//--------------------------------------------------------------------------
|
|
@@ -29755,12 +29784,15 @@ class Tab {
|
|
|
29755
29784
|
const id = this.el.id || this.guid;
|
|
29756
29785
|
return (hAsync(Host, { "aria-expanded": this.active.toString(), "aria-labelledby": this.labeledBy, id: id, role: "tabpanel" }, hAsync("section", null, hAsync("slot", null))));
|
|
29757
29786
|
}
|
|
29787
|
+
connectedCallback() {
|
|
29788
|
+
this.parentTabsEl = this.el.closest("calcite-tabs");
|
|
29789
|
+
}
|
|
29758
29790
|
componentDidLoad() {
|
|
29759
29791
|
this.calciteTabRegister.emit();
|
|
29760
29792
|
}
|
|
29761
29793
|
componentWillRender() {
|
|
29762
29794
|
var _a;
|
|
29763
|
-
this.scale = (_a = this.
|
|
29795
|
+
this.scale = (_a = this.parentTabsEl) === null || _a === void 0 ? void 0 : _a.scale;
|
|
29764
29796
|
}
|
|
29765
29797
|
disconnectedCallback() {
|
|
29766
29798
|
var _a;
|
|
@@ -29775,10 +29807,13 @@ class Tab {
|
|
|
29775
29807
|
//
|
|
29776
29808
|
//--------------------------------------------------------------------------
|
|
29777
29809
|
tabChangeHandler(event) {
|
|
29810
|
+
const targetTabsEl = event
|
|
29811
|
+
.composedPath()
|
|
29812
|
+
.find((el) => el.tagName === "CALCITE-TABS");
|
|
29778
29813
|
// to allow `<calcite-tabs>` to be nested we need to make sure this
|
|
29779
|
-
// `calciteTabChange` event was actually fired from a
|
|
29780
|
-
//
|
|
29781
|
-
if (
|
|
29814
|
+
// `calciteTabChange` event was actually fired from a within the same
|
|
29815
|
+
// `<calcite-tabs>` that is the a parent of this tab.
|
|
29816
|
+
if (targetTabsEl !== this.parentTabsEl) {
|
|
29782
29817
|
return;
|
|
29783
29818
|
}
|
|
29784
29819
|
if (this.tab) {
|
|
@@ -29883,6 +29918,9 @@ class TabNav {
|
|
|
29883
29918
|
// Lifecycle
|
|
29884
29919
|
//
|
|
29885
29920
|
//--------------------------------------------------------------------------
|
|
29921
|
+
connectedCallback() {
|
|
29922
|
+
this.parentTabsEl = this.el.closest("calcite-tabs");
|
|
29923
|
+
}
|
|
29886
29924
|
componentWillLoad() {
|
|
29887
29925
|
const storageKey = `calcite-tab-nav-${this.storageId}`;
|
|
29888
29926
|
if (localStorage && this.storageId && localStorage.getItem(storageKey)) {
|
|
@@ -29894,11 +29932,11 @@ class TabNav {
|
|
|
29894
29932
|
}
|
|
29895
29933
|
}
|
|
29896
29934
|
componentWillRender() {
|
|
29897
|
-
|
|
29898
|
-
this.layout =
|
|
29899
|
-
this.position =
|
|
29900
|
-
this.scale =
|
|
29901
|
-
this.bordered =
|
|
29935
|
+
const { parentTabsEl } = this;
|
|
29936
|
+
this.layout = parentTabsEl === null || parentTabsEl === void 0 ? void 0 : parentTabsEl.layout;
|
|
29937
|
+
this.position = parentTabsEl === null || parentTabsEl === void 0 ? void 0 : parentTabsEl.position;
|
|
29938
|
+
this.scale = parentTabsEl === null || parentTabsEl === void 0 ? void 0 : parentTabsEl.scale;
|
|
29939
|
+
this.bordered = parentTabsEl === null || parentTabsEl === void 0 ? void 0 : parentTabsEl.bordered;
|
|
29902
29940
|
// fix issue with active tab-title not lining up with blue indicator
|
|
29903
29941
|
if (this.selectedTabEl) {
|
|
29904
29942
|
this.updateOffsetPosition();
|
|
@@ -30061,9 +30099,6 @@ class TabTitle {
|
|
|
30061
30099
|
this.mutationObserver = createObserver();
|
|
30062
30100
|
/** determine if there is slotted text for styling purposes */
|
|
30063
30101
|
this.hasText = false;
|
|
30064
|
-
/**
|
|
30065
|
-
* @internal
|
|
30066
|
-
*/
|
|
30067
30102
|
this.guid = `calcite-tab-title-${guid()}`;
|
|
30068
30103
|
}
|
|
30069
30104
|
activeTabChanged() {
|
|
@@ -30129,15 +30164,19 @@ class TabTitle {
|
|
|
30129
30164
|
//
|
|
30130
30165
|
//--------------------------------------------------------------------------
|
|
30131
30166
|
tabChangeHandler(event) {
|
|
30132
|
-
|
|
30133
|
-
|
|
30134
|
-
|
|
30135
|
-
|
|
30136
|
-
|
|
30137
|
-
|
|
30138
|
-
|
|
30139
|
-
|
|
30140
|
-
|
|
30167
|
+
const targetTabsEl = event
|
|
30168
|
+
.composedPath()
|
|
30169
|
+
.find((el) => el.tagName === "CALCITE-TABS");
|
|
30170
|
+
if (targetTabsEl !== this.parentTabsEl) {
|
|
30171
|
+
return;
|
|
30172
|
+
}
|
|
30173
|
+
if (this.tab) {
|
|
30174
|
+
this.active = this.tab === event.detail.tab;
|
|
30175
|
+
}
|
|
30176
|
+
else {
|
|
30177
|
+
this.getTabIndex().then((index) => {
|
|
30178
|
+
this.active = index === event.detail.tab;
|
|
30179
|
+
});
|
|
30141
30180
|
}
|
|
30142
30181
|
}
|
|
30143
30182
|
onClick() {
|
|
@@ -30281,14 +30320,12 @@ class Tabs {
|
|
|
30281
30320
|
//
|
|
30282
30321
|
//--------------------------------------------------------------------------
|
|
30283
30322
|
/**
|
|
30284
|
-
* @internal
|
|
30285
30323
|
*
|
|
30286
30324
|
* Stores an array of ids of `<calcite-tab-titles>`s to match up ARIA
|
|
30287
30325
|
* attributes.
|
|
30288
30326
|
*/
|
|
30289
30327
|
this.titles = [];
|
|
30290
30328
|
/**
|
|
30291
|
-
* @internal
|
|
30292
30329
|
*
|
|
30293
30330
|
* Stores an array of ids of `<calcite-tab>`s to match up ARIA attributes.
|
|
30294
30331
|
*/
|
|
@@ -30350,7 +30387,6 @@ class Tabs {
|
|
|
30350
30387
|
//
|
|
30351
30388
|
//--------------------------------------------------------------------------
|
|
30352
30389
|
/**
|
|
30353
|
-
* @internal
|
|
30354
30390
|
*
|
|
30355
30391
|
* Matches up elements from the internal `tabs` and `titles` to automatically
|
|
30356
30392
|
* update the ARIA attributes and link `<calcite-tab>` and
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esri/calcite-components",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.425",
|
|
4
4
|
"description": "Web Components for Esri's Calcite Design System.",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"eslint-plugin-prettier": "4.0.0",
|
|
116
116
|
"eslint-plugin-react": "7.29.4",
|
|
117
117
|
"eslint-plugin-unicorn": "41.0.1",
|
|
118
|
-
"gh-release": "6.0.
|
|
118
|
+
"gh-release": "6.0.3",
|
|
119
119
|
"git-semver-tags": "4.1.1",
|
|
120
120
|
"husky": "7.0.4",
|
|
121
121
|
"jest": "26.6.3",
|