@esri/calcite-components 1.0.0-next.421 → 1.0.0-next.424
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/calcite.js +1 -1
- package/dist/calcite/p-0ba91238.system.entry.js +5 -0
- 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 +5 -0
- package/dist/calcite/p-69d5736f.entry.js +5 -0
- package/dist/calcite/p-7fb5fec5.entry.js +5 -0
- package/dist/calcite/p-958600ba.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-input-date-picker.cjs.entry.js +10 -5
- package/dist/cjs/calcite-input-time-picker_2.cjs.entry.js +6 -1
- package/dist/cjs/calcite.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/date-picker-month-header/date-picker-month-header.js +27 -19
- package/dist/collection/components/input-date-picker/input-date-picker.css +5 -0
- package/dist/collection/components/input-date-picker/input-date-picker.js +35 -4
- package/dist/collection/components/input-time-picker/input-time-picker.js +32 -1
- package/dist/collection/components/slider/slider.js +76 -41
- package/dist/components/calcite-input-date-picker.js +12 -6
- package/dist/components/calcite-input-time-picker.js +7 -1
- package/dist/components/calcite-slider.js +67 -38
- package/dist/components/date-picker-month-header.js +27 -19
- package/dist/custom-elements/index.js +112 -65
- 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-input-date-picker.entry.js +11 -6
- package/dist/esm/calcite-input-time-picker_2.entry.js +6 -1
- package/dist/esm/calcite.js +2 -2
- package/dist/esm/loader.js +2 -2
- 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-input-date-picker.entry.js +1 -1
- package/dist/esm-es5/calcite-input-time-picker_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 +94 -4
- package/dist/types/components/date-picker-month-header/date-picker-month-header.d.ts +3 -1
- package/dist/types/components/input-date-picker/input-date-picker.d.ts +6 -1
- package/dist/types/components/input-time-picker/input-time-picker.d.ts +6 -0
- package/dist/types/components/slider/slider.d.ts +5 -2
- package/dist/types/components.d.ts +22 -2
- package/hydrate/index.js +115 -66
- package/package.json +14 -14
- package/readme.md +2 -2
- package/dist/calcite/p-872e82a6.system.entry.js +0 -5
- package/dist/calcite/p-a3527241.system.entry.js +0 -5
- package/dist/calcite/p-a38fe099.entry.js +0 -5
- package/dist/calcite/p-c4cb35ba.system.entry.js +0 -5
- package/dist/calcite/p-cb847074.entry.js +0 -5
- package/dist/calcite/p-e22ab8fa.entry.js +0 -5
- package/dist/calcite/p-fe9380a0.system.js +0 -5
package/hydrate/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8
8
|
|
|
9
9
|
/*!
|
|
10
|
-
Stencil Mock Doc v2.14.
|
|
10
|
+
Stencil Mock Doc v2.14.2 | MIT Licensed | https://stenciljs.com
|
|
11
11
|
*/
|
|
12
12
|
const CONTENT_REF_ID = 'r';
|
|
13
13
|
const ORG_LOCATION_ID = 'o';
|
|
@@ -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); }
|
|
@@ -19795,7 +19803,7 @@ class Input {
|
|
|
19795
19803
|
}; }
|
|
19796
19804
|
}
|
|
19797
19805
|
|
|
19798
|
-
const inputDatePickerCss = "@-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-input-date-picker: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-input-date-picker{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-input-date-picker{-webkit-animation-name:in;animation-name:in}/*!@.calcite-animate__in-down*/.calcite-animate__in-down.sc-calcite-input-date-picker{-webkit-animation-name:in-down;animation-name:in-down}/*!@.calcite-animate__in-up*/.calcite-animate__in-up.sc-calcite-input-date-picker{-webkit-animation-name:in-up;animation-name:in-up}/*!@.calcite-animate__in-scale*/.calcite-animate__in-scale.sc-calcite-input-date-picker{-webkit-animation-name:in-scale;animation-name:in-scale}/*!@:host*/.sc-calcite-input-date-picker-h{--calcite-icon-size:1rem;--calcite-spacing-eighth:0.125rem;--calcite-spacing-quarter:0.25rem;--calcite-spacing-half:0.5rem;--calcite-spacing-three-quarters:0.75rem;--calcite-spacing:1rem;--calcite-spacing-plus-quarter:1.25rem;--calcite-spacing-plus-half:1.5rem;--calcite-spacing-double:2rem;--calcite-menu-min-width:10rem;--calcite-header-min-height:3rem;--calcite-footer-min-height:3rem}/*!@:root*/.sc-calcite-input-date-picker:root{--calcite-popper-transition:var(--calcite-animation-timing)}/*!@:host([hidden])*/[hidden].sc-calcite-input-date-picker-h{display:none}/*!@:host*/.sc-calcite-input-date-picker-h{position:relative;display:inline-block;width:100%;overflow:visible;vertical-align:top;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}/*!@:host([disabled])*/[disabled].sc-calcite-input-date-picker-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]) ::slotted([calcite-hydrated][disabled]),\n:host([disabled]) [calcite-hydrated][disabled]*/.sc-calcite-input-date-picker-h[disabled] .sc-calcite-input-date-picker-s>[calcite-hydrated][disabled],[disabled].sc-calcite-input-date-picker-h [calcite-hydrated][disabled].sc-calcite-input-date-picker{opacity:1}/*!@.calendar-picker-wrapper*/.calendar-picker-wrapper.sc-calcite-input-date-picker{position:static;width:100%;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}/*!@.input-wrapper*/.input-wrapper.sc-calcite-input-date-picker{position:relative}/*!@:host([range]) .input-container*/[range].sc-calcite-input-date-picker-h .input-container.sc-calcite-input-date-picker{display:-ms-flexbox;display:flex}/*!@:host([range]) .input-wrapper*/[range].sc-calcite-input-date-picker-h .input-wrapper.sc-calcite-input-date-picker{-ms-flex:1 1 auto;flex:1 1 auto}/*!@:host([range]) .horizontal-arrow-container*/[range].sc-calcite-input-date-picker-h .horizontal-arrow-container.sc-calcite-input-date-picker{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-width:1px;border-left-width:0px;border-right-width:0px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-background);padding-top:0px;padding-bottom:0px;padding-left:0.25rem;padding-right:0.25rem}/*!@:host([range][layout=vertical]) .input-wrapper*/[range][layout=vertical].sc-calcite-input-date-picker-h .input-wrapper.sc-calcite-input-date-picker{width:100%}/*!@:host([range][layout=vertical]) .input-container*/[range][layout=vertical].sc-calcite-input-date-picker-h .input-container.sc-calcite-input-date-picker{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}/*!@:host([range][layout=vertical]) .calendar-picker-wrapper--end*/[range][layout=vertical].sc-calcite-input-date-picker-h .calendar-picker-wrapper--end.sc-calcite-input-date-picker{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}/*!@:host([range][layout=vertical]) .vertical-arrow-container*/[range][layout=vertical].sc-calcite-input-date-picker-h .vertical-arrow-container.sc-calcite-input-date-picker{top:1.5rem;position:absolute;left:0px;z-index:10;margin-left:1px;margin-right:1px;background-color:var(--calcite-ui-foreground-1);padding-left:0.625rem;padding-right:0.625rem}/*!@:host([scale=s][range]:not([layout=vertical])) .calendar-picker-wrapper*/[scale=s][range].sc-calcite-input-date-picker-h:not([layout=vertical]) .calendar-picker-wrapper.sc-calcite-input-date-picker{width:216px}/*!@:host([scale=m][range]:not([layout=vertical])) .calendar-picker-wrapper*/[scale=m][range].sc-calcite-input-date-picker-h:not([layout=vertical]) .calendar-picker-wrapper.sc-calcite-input-date-picker{width:286px}/*!@:host([scale=l][range]:not([layout=vertical])) .calendar-picker-wrapper*/[scale=l][range].sc-calcite-input-date-picker-h:not([layout=vertical]) .calendar-picker-wrapper.sc-calcite-input-date-picker{width:398px}/*!@.menu-container*/.menu-container.sc-calcite-input-date-picker{display:block;position:absolute;z-index:900;-webkit-transform:scale(0);transform:scale(0);visibility:hidden;pointer-events:none}/*!@.menu-container .calcite-popper-anim*/.menu-container.sc-calcite-input-date-picker .calcite-popper-anim.sc-calcite-input-date-picker{position:relative;z-index:1;-webkit-transition:var(--calcite-popper-transition);transition:var(--calcite-popper-transition);visibility:hidden;-webkit-transition-property:visibility, opacity, -webkit-transform;transition-property:visibility, opacity, -webkit-transform;transition-property:transform, visibility, opacity;transition-property:transform, visibility, opacity, -webkit-transform;opacity:0;-webkit-box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);border-radius:0.25rem}/*!@.menu-container[data-popper-placement^=bottom] .calcite-popper-anim*/.menu-container[data-popper-placement^=bottom].sc-calcite-input-date-picker .calcite-popper-anim.sc-calcite-input-date-picker{-webkit-transform:translateY(-5px);transform:translateY(-5px)}/*!@.menu-container[data-popper-placement^=top] .calcite-popper-anim*/.menu-container[data-popper-placement^=top].sc-calcite-input-date-picker .calcite-popper-anim.sc-calcite-input-date-picker{-webkit-transform:translateY(5px);transform:translateY(5px)}/*!@.menu-container[data-popper-placement^=left] .calcite-popper-anim*/.menu-container[data-popper-placement^=left].sc-calcite-input-date-picker .calcite-popper-anim.sc-calcite-input-date-picker{-webkit-transform:translateX(5px);transform:translateX(5px)}/*!@.menu-container[data-popper-placement^=right] .calcite-popper-anim*/.menu-container[data-popper-placement^=right].sc-calcite-input-date-picker .calcite-popper-anim.sc-calcite-input-date-picker{-webkit-transform:translateX(-5px);transform:translateX(-5px)}/*!@.menu-container[data-popper-placement] .calcite-popper-anim--active*/.menu-container[data-popper-placement].sc-calcite-input-date-picker .calcite-popper-anim--active.sc-calcite-input-date-picker{opacity:1;visibility:visible;-webkit-transform:translate(0);transform:translate(0)}/*!@.menu-container--active .menu-container .calcite-popper-anim*/.menu-container--active.sc-calcite-input-date-picker .menu-container.sc-calcite-input-date-picker .calcite-popper-anim.sc-calcite-input-date-picker{position:relative;z-index:1;-webkit-transition:var(--calcite-popper-transition);transition:var(--calcite-popper-transition);visibility:hidden;-webkit-transition-property:visibility, opacity, -webkit-transform;transition-property:visibility, opacity, -webkit-transform;transition-property:transform, visibility, opacity;transition-property:transform, visibility, opacity, -webkit-transform;opacity:0;-webkit-box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);border-radius:0.25rem}/*!@.menu-container--active .menu-container[data-popper-placement^=bottom] .calcite-popper-anim*/.menu-container--active.sc-calcite-input-date-picker .menu-container[data-popper-placement^=bottom].sc-calcite-input-date-picker .calcite-popper-anim.sc-calcite-input-date-picker{-webkit-transform:translateY(-5px);transform:translateY(-5px)}/*!@.menu-container--active .menu-container[data-popper-placement^=top] .calcite-popper-anim*/.menu-container--active.sc-calcite-input-date-picker .menu-container[data-popper-placement^=top].sc-calcite-input-date-picker .calcite-popper-anim.sc-calcite-input-date-picker{-webkit-transform:translateY(5px);transform:translateY(5px)}/*!@.menu-container--active .menu-container[data-popper-placement^=left] .calcite-popper-anim*/.menu-container--active.sc-calcite-input-date-picker .menu-container[data-popper-placement^=left].sc-calcite-input-date-picker .calcite-popper-anim.sc-calcite-input-date-picker{-webkit-transform:translateX(5px);transform:translateX(5px)}/*!@.menu-container--active .menu-container[data-popper-placement^=right] .calcite-popper-anim*/.menu-container--active.sc-calcite-input-date-picker .menu-container[data-popper-placement^=right].sc-calcite-input-date-picker .calcite-popper-anim.sc-calcite-input-date-picker{-webkit-transform:translateX(-5px);transform:translateX(-5px)}/*!@.menu-container--active .menu-container[data-popper-placement] .calcite-popper-anim--active*/.menu-container--active.sc-calcite-input-date-picker .menu-container[data-popper-placement].sc-calcite-input-date-picker .calcite-popper-anim--active.sc-calcite-input-date-picker{opacity:1;visibility:visible;-webkit-transform:translate(0);transform:translate(0)}/*!@.input .calcite-input__wrapper*/.input.sc-calcite-input-date-picker .calcite-input__wrapper.sc-calcite-input-date-picker{margin-top:0px}/*!@:host([range][layout=vertical][scale=m]) .vertical-arrow-container*/[range][layout=vertical][scale=m].sc-calcite-input-date-picker-h .vertical-arrow-container.sc-calcite-input-date-picker{top:1.5rem;padding-left:0.75rem}/*!@:host([range][layout=vertical][scale=m]) .vertical-arrow-container calcite-icon*/[range][layout=vertical][scale=m].sc-calcite-input-date-picker-h .vertical-arrow-container.sc-calcite-input-date-picker calcite-icon.sc-calcite-input-date-picker{height:0.75rem;width:0.75rem;min-width:0px}/*!@:host([range][layout=vertical][scale=l]) .vertical-arrow-container*/[range][layout=vertical][scale=l].sc-calcite-input-date-picker-h .vertical-arrow-container.sc-calcite-input-date-picker{top:2.25rem;padding-left:0.875rem;padding-right:0.875rem}/*!@:host([range][layout=vertical][active]) .vertical-arrow-container*/[range][layout=vertical][active].sc-calcite-input-date-picker-h .vertical-arrow-container.sc-calcite-input-date-picker{display:none}/*!@::slotted(input[slot=hidden-form-input])*/.sc-calcite-input-date-picker-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}";
|
|
19806
|
+
const inputDatePickerCss = "@-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-input-date-picker: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-input-date-picker{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-input-date-picker{-webkit-animation-name:in;animation-name:in}/*!@.calcite-animate__in-down*/.calcite-animate__in-down.sc-calcite-input-date-picker{-webkit-animation-name:in-down;animation-name:in-down}/*!@.calcite-animate__in-up*/.calcite-animate__in-up.sc-calcite-input-date-picker{-webkit-animation-name:in-up;animation-name:in-up}/*!@.calcite-animate__in-scale*/.calcite-animate__in-scale.sc-calcite-input-date-picker{-webkit-animation-name:in-scale;animation-name:in-scale}/*!@:host*/.sc-calcite-input-date-picker-h{--calcite-icon-size:1rem;--calcite-spacing-eighth:0.125rem;--calcite-spacing-quarter:0.25rem;--calcite-spacing-half:0.5rem;--calcite-spacing-three-quarters:0.75rem;--calcite-spacing:1rem;--calcite-spacing-plus-quarter:1.25rem;--calcite-spacing-plus-half:1.5rem;--calcite-spacing-double:2rem;--calcite-menu-min-width:10rem;--calcite-header-min-height:3rem;--calcite-footer-min-height:3rem}/*!@:root*/.sc-calcite-input-date-picker:root{--calcite-popper-transition:var(--calcite-animation-timing)}/*!@:host([hidden])*/[hidden].sc-calcite-input-date-picker-h{display:none}/*!@:host*/.sc-calcite-input-date-picker-h{position:relative;display:inline-block;width:100%;overflow:visible;vertical-align:top;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}/*!@:host([disabled])*/[disabled].sc-calcite-input-date-picker-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]) ::slotted([calcite-hydrated][disabled]),\n:host([disabled]) [calcite-hydrated][disabled]*/.sc-calcite-input-date-picker-h[disabled] .sc-calcite-input-date-picker-s>[calcite-hydrated][disabled],[disabled].sc-calcite-input-date-picker-h [calcite-hydrated][disabled].sc-calcite-input-date-picker{opacity:1}/*!@.calendar-picker-wrapper*/.calendar-picker-wrapper.sc-calcite-input-date-picker{position:static;width:100%;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}/*!@.input-wrapper*/.input-wrapper.sc-calcite-input-date-picker{position:relative}/*!@:host([range]) .input-container*/[range].sc-calcite-input-date-picker-h .input-container.sc-calcite-input-date-picker{display:-ms-flexbox;display:flex}/*!@:host([range]) .input-wrapper*/[range].sc-calcite-input-date-picker-h .input-wrapper.sc-calcite-input-date-picker{-ms-flex:1 1 auto;flex:1 1 auto}/*!@:host([range]) .horizontal-arrow-container*/[range].sc-calcite-input-date-picker-h .horizontal-arrow-container.sc-calcite-input-date-picker{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-width:1px;border-left-width:0px;border-right-width:0px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-background);padding-top:0px;padding-bottom:0px;padding-left:0.25rem;padding-right:0.25rem}/*!@:host([range][layout=vertical]) .input-wrapper*/[range][layout=vertical].sc-calcite-input-date-picker-h .input-wrapper.sc-calcite-input-date-picker{width:100%}/*!@:host([range][layout=vertical]) .input-container*/[range][layout=vertical].sc-calcite-input-date-picker-h .input-container.sc-calcite-input-date-picker{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}/*!@:host([range][layout=vertical]) .calendar-picker-wrapper--end*/[range][layout=vertical].sc-calcite-input-date-picker-h .calendar-picker-wrapper--end.sc-calcite-input-date-picker{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}/*!@:host([range][layout=vertical]) .vertical-arrow-container*/[range][layout=vertical].sc-calcite-input-date-picker-h .vertical-arrow-container.sc-calcite-input-date-picker{top:1.5rem;position:absolute;left:0px;z-index:10;margin-left:1px;margin-right:1px;background-color:var(--calcite-ui-foreground-1);padding-left:0.625rem;padding-right:0.625rem}/*!@:host([scale=s][range]:not([layout=vertical])) .calendar-picker-wrapper*/[scale=s][range].sc-calcite-input-date-picker-h:not([layout=vertical]) .calendar-picker-wrapper.sc-calcite-input-date-picker{width:216px}/*!@:host([scale=m][range]:not([layout=vertical])) .calendar-picker-wrapper*/[scale=m][range].sc-calcite-input-date-picker-h:not([layout=vertical]) .calendar-picker-wrapper.sc-calcite-input-date-picker{width:286px}/*!@:host([scale=l][range]:not([layout=vertical])) .calendar-picker-wrapper*/[scale=l][range].sc-calcite-input-date-picker-h:not([layout=vertical]) .calendar-picker-wrapper.sc-calcite-input-date-picker{width:398px}/*!@.menu-container*/.menu-container.sc-calcite-input-date-picker{display:block;position:absolute;z-index:900;-webkit-transform:scale(0);transform:scale(0);visibility:hidden;pointer-events:none}/*!@.menu-container .calcite-popper-anim*/.menu-container.sc-calcite-input-date-picker .calcite-popper-anim.sc-calcite-input-date-picker{position:relative;z-index:1;-webkit-transition:var(--calcite-popper-transition);transition:var(--calcite-popper-transition);visibility:hidden;-webkit-transition-property:visibility, opacity, -webkit-transform;transition-property:visibility, opacity, -webkit-transform;transition-property:transform, visibility, opacity;transition-property:transform, visibility, opacity, -webkit-transform;opacity:0;-webkit-box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);border-radius:0.25rem}/*!@.menu-container[data-popper-placement^=bottom] .calcite-popper-anim*/.menu-container[data-popper-placement^=bottom].sc-calcite-input-date-picker .calcite-popper-anim.sc-calcite-input-date-picker{-webkit-transform:translateY(-5px);transform:translateY(-5px)}/*!@.menu-container[data-popper-placement^=top] .calcite-popper-anim*/.menu-container[data-popper-placement^=top].sc-calcite-input-date-picker .calcite-popper-anim.sc-calcite-input-date-picker{-webkit-transform:translateY(5px);transform:translateY(5px)}/*!@.menu-container[data-popper-placement^=left] .calcite-popper-anim*/.menu-container[data-popper-placement^=left].sc-calcite-input-date-picker .calcite-popper-anim.sc-calcite-input-date-picker{-webkit-transform:translateX(5px);transform:translateX(5px)}/*!@.menu-container[data-popper-placement^=right] .calcite-popper-anim*/.menu-container[data-popper-placement^=right].sc-calcite-input-date-picker .calcite-popper-anim.sc-calcite-input-date-picker{-webkit-transform:translateX(-5px);transform:translateX(-5px)}/*!@.menu-container[data-popper-placement] .calcite-popper-anim--active*/.menu-container[data-popper-placement].sc-calcite-input-date-picker .calcite-popper-anim--active.sc-calcite-input-date-picker{opacity:1;visibility:visible;-webkit-transform:translate(0);transform:translate(0)}/*!@:host([active]) .menu-container*/[active].sc-calcite-input-date-picker-h .menu-container.sc-calcite-input-date-picker{pointer-events:initial;visibility:visible}/*!@.menu-container--active .menu-container .calcite-popper-anim*/.menu-container--active.sc-calcite-input-date-picker .menu-container.sc-calcite-input-date-picker .calcite-popper-anim.sc-calcite-input-date-picker{position:relative;z-index:1;-webkit-transition:var(--calcite-popper-transition);transition:var(--calcite-popper-transition);visibility:hidden;-webkit-transition-property:visibility, opacity, -webkit-transform;transition-property:visibility, opacity, -webkit-transform;transition-property:transform, visibility, opacity;transition-property:transform, visibility, opacity, -webkit-transform;opacity:0;-webkit-box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);border-radius:0.25rem}/*!@.menu-container--active .menu-container[data-popper-placement^=bottom] .calcite-popper-anim*/.menu-container--active.sc-calcite-input-date-picker .menu-container[data-popper-placement^=bottom].sc-calcite-input-date-picker .calcite-popper-anim.sc-calcite-input-date-picker{-webkit-transform:translateY(-5px);transform:translateY(-5px)}/*!@.menu-container--active .menu-container[data-popper-placement^=top] .calcite-popper-anim*/.menu-container--active.sc-calcite-input-date-picker .menu-container[data-popper-placement^=top].sc-calcite-input-date-picker .calcite-popper-anim.sc-calcite-input-date-picker{-webkit-transform:translateY(5px);transform:translateY(5px)}/*!@.menu-container--active .menu-container[data-popper-placement^=left] .calcite-popper-anim*/.menu-container--active.sc-calcite-input-date-picker .menu-container[data-popper-placement^=left].sc-calcite-input-date-picker .calcite-popper-anim.sc-calcite-input-date-picker{-webkit-transform:translateX(5px);transform:translateX(5px)}/*!@.menu-container--active .menu-container[data-popper-placement^=right] .calcite-popper-anim*/.menu-container--active.sc-calcite-input-date-picker .menu-container[data-popper-placement^=right].sc-calcite-input-date-picker .calcite-popper-anim.sc-calcite-input-date-picker{-webkit-transform:translateX(-5px);transform:translateX(-5px)}/*!@.menu-container--active .menu-container[data-popper-placement] .calcite-popper-anim--active*/.menu-container--active.sc-calcite-input-date-picker .menu-container[data-popper-placement].sc-calcite-input-date-picker .calcite-popper-anim--active.sc-calcite-input-date-picker{opacity:1;visibility:visible;-webkit-transform:translate(0);transform:translate(0)}/*!@.input .calcite-input__wrapper*/.input.sc-calcite-input-date-picker .calcite-input__wrapper.sc-calcite-input-date-picker{margin-top:0px}/*!@:host([range][layout=vertical][scale=m]) .vertical-arrow-container*/[range][layout=vertical][scale=m].sc-calcite-input-date-picker-h .vertical-arrow-container.sc-calcite-input-date-picker{top:1.5rem;padding-left:0.75rem}/*!@:host([range][layout=vertical][scale=m]) .vertical-arrow-container calcite-icon*/[range][layout=vertical][scale=m].sc-calcite-input-date-picker-h .vertical-arrow-container.sc-calcite-input-date-picker calcite-icon.sc-calcite-input-date-picker{height:0.75rem;width:0.75rem;min-width:0px}/*!@:host([range][layout=vertical][scale=l]) .vertical-arrow-container*/[range][layout=vertical][scale=l].sc-calcite-input-date-picker-h .vertical-arrow-container.sc-calcite-input-date-picker{top:2.25rem;padding-left:0.875rem;padding-right:0.875rem}/*!@:host([range][layout=vertical][active]) .vertical-arrow-container*/[range][layout=vertical][active].sc-calcite-input-date-picker-h .vertical-arrow-container.sc-calcite-input-date-picker{display:none}/*!@::slotted(input[slot=hidden-form-input])*/.sc-calcite-input-date-picker-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}";
|
|
19799
19807
|
|
|
19800
19808
|
class InputDatePicker {
|
|
19801
19809
|
constructor(hostRef) {
|
|
@@ -19832,6 +19840,11 @@ class InputDatePicker {
|
|
|
19832
19840
|
this.locale = document.documentElement.lang || "en";
|
|
19833
19841
|
/** specify the scale of the date picker */
|
|
19834
19842
|
this.scale = "m";
|
|
19843
|
+
/**
|
|
19844
|
+
* Determines where the date-picker component will be positioned relative to the input.
|
|
19845
|
+
* @default "bottom-leading"
|
|
19846
|
+
*/
|
|
19847
|
+
this.placement = defaultMenuPlacement;
|
|
19835
19848
|
/** Range mode activation */
|
|
19836
19849
|
this.range = false;
|
|
19837
19850
|
/**
|
|
@@ -19984,13 +19997,13 @@ class InputDatePicker {
|
|
|
19984
19997
|
}
|
|
19985
19998
|
/** Updates the position of the component. */
|
|
19986
19999
|
async reposition() {
|
|
19987
|
-
const { popper, menuEl } = this;
|
|
20000
|
+
const { placement, popper, menuEl } = this;
|
|
19988
20001
|
const modifiers = this.getModifiers();
|
|
19989
20002
|
popper
|
|
19990
20003
|
? await updatePopper({
|
|
19991
20004
|
el: menuEl,
|
|
19992
20005
|
modifiers,
|
|
19993
|
-
placement
|
|
20006
|
+
placement,
|
|
19994
20007
|
popper
|
|
19995
20008
|
})
|
|
19996
20009
|
: this.createPopper();
|
|
@@ -20094,7 +20107,7 @@ class InputDatePicker {
|
|
|
20094
20107
|
}
|
|
20095
20108
|
createPopper() {
|
|
20096
20109
|
this.destroyPopper();
|
|
20097
|
-
const { menuEl, referenceEl, overlayPositioning } = this;
|
|
20110
|
+
const { menuEl, placement, referenceEl, overlayPositioning } = this;
|
|
20098
20111
|
if (!menuEl || !referenceEl) {
|
|
20099
20112
|
return;
|
|
20100
20113
|
}
|
|
@@ -20103,7 +20116,7 @@ class InputDatePicker {
|
|
|
20103
20116
|
el: menuEl,
|
|
20104
20117
|
modifiers,
|
|
20105
20118
|
overlayPositioning,
|
|
20106
|
-
placement
|
|
20119
|
+
placement,
|
|
20107
20120
|
referenceEl
|
|
20108
20121
|
});
|
|
20109
20122
|
}
|
|
@@ -20277,6 +20290,7 @@ class InputDatePicker {
|
|
|
20277
20290
|
"intlYear": [1, "intl-year"],
|
|
20278
20291
|
"locale": [1],
|
|
20279
20292
|
"scale": [513],
|
|
20293
|
+
"placement": [513],
|
|
20280
20294
|
"range": [516],
|
|
20281
20295
|
"required": [516],
|
|
20282
20296
|
"start": [1025],
|
|
@@ -20291,7 +20305,7 @@ class InputDatePicker {
|
|
|
20291
20305
|
},
|
|
20292
20306
|
"$listeners$": [[0, "calciteDatePickerChange", "handleDateOrRangeChange"], [0, "calciteDatePickerRangeChange", "handleDateOrRangeChange"], [0, "calciteDaySelect", "calciteDaySelectHandler"]],
|
|
20293
20307
|
"$lazyBundleId$": "-",
|
|
20294
|
-
"$attrsToReflect$": [["disabled", "disabled"], ["active", "active"], ["scale", "scale"], ["range", "range"], ["required", "required"], ["layout", "layout"]]
|
|
20308
|
+
"$attrsToReflect$": [["disabled", "disabled"], ["active", "active"], ["scale", "scale"], ["placement", "placement"], ["range", "range"], ["required", "required"], ["layout", "layout"]]
|
|
20295
20309
|
}; }
|
|
20296
20310
|
}
|
|
20297
20311
|
|
|
@@ -20575,6 +20589,11 @@ class InputTimePicker {
|
|
|
20575
20589
|
this.required = false;
|
|
20576
20590
|
/** The scale (size) of the time input */
|
|
20577
20591
|
this.scale = "m";
|
|
20592
|
+
/**
|
|
20593
|
+
* Determines where the popover will be positioned relative to the input.
|
|
20594
|
+
* @see [PopperPlacement](https://github.com/Esri/calcite-components/blob/master/src/utils/popper.ts#L25)
|
|
20595
|
+
*/
|
|
20596
|
+
this.placement = "auto";
|
|
20578
20597
|
/** number (seconds) that specifies the granularity that the value must adhere to */
|
|
20579
20598
|
this.step = 60;
|
|
20580
20599
|
/** The selected time in UTC (always 24-hour format) */
|
|
@@ -20748,7 +20767,7 @@ class InputTimePicker {
|
|
|
20748
20767
|
// --------------------------------------------------------------------------
|
|
20749
20768
|
render() {
|
|
20750
20769
|
const popoverId = `${this.referenceElementId}-popover`;
|
|
20751
|
-
return (hAsync(Host, null, hAsync("div", { "aria-controls": popoverId, "aria-haspopup": "dialog", "aria-label": this.name, "aria-owns": popoverId, id: this.referenceElementId, role: "combobox" }, hAsync("calcite-input", { disabled: this.disabled, icon: "clock", label: getLabelText(this), onCalciteInputBlur: this.calciteInputBlurHandler, onCalciteInputFocus: this.calciteInputFocusHandler, onCalciteInputInput: this.calciteInputInputHandler, ref: this.setCalciteInputEl, scale: this.scale, step: this.step })), hAsync("calcite-popover", { id: popoverId, label: "Time Picker", open: this.active, referenceElement: this.referenceElementId }, hAsync("calcite-time-picker", { intlHour: this.intlHour, intlHourDown: this.intlHourDown, intlHourUp: this.intlHourUp, intlMeridiem: this.intlMeridiem, intlMeridiemDown: this.intlMeridiemDown, intlMeridiemUp: this.intlMeridiemUp, intlMinute: this.intlMinute, intlMinuteDown: this.intlMinuteDown, intlMinuteUp: this.intlMinuteUp, intlSecond: this.intlSecond, intlSecondDown: this.intlSecondDown, intlSecondUp: this.intlSecondUp, lang: this.locale, onCalciteTimePickerChange: this.timePickerChangeHandler, ref: this.setCalciteTimePickerEl, scale: this.scale, step: this.step, value: this.value })), hAsync(HiddenFormInputSlot, { component: this })));
|
|
20770
|
+
return (hAsync(Host, null, hAsync("div", { "aria-controls": popoverId, "aria-haspopup": "dialog", "aria-label": this.name, "aria-owns": popoverId, id: this.referenceElementId, role: "combobox" }, hAsync("calcite-input", { disabled: this.disabled, icon: "clock", label: getLabelText(this), onCalciteInputBlur: this.calciteInputBlurHandler, onCalciteInputFocus: this.calciteInputFocusHandler, onCalciteInputInput: this.calciteInputInputHandler, ref: this.setCalciteInputEl, scale: this.scale, step: this.step })), hAsync("calcite-popover", { id: popoverId, label: "Time Picker", open: this.active, placement: this.placement, referenceElement: this.referenceElementId }, hAsync("calcite-time-picker", { intlHour: this.intlHour, intlHourDown: this.intlHourDown, intlHourUp: this.intlHourUp, intlMeridiem: this.intlMeridiem, intlMeridiemDown: this.intlMeridiemDown, intlMeridiemUp: this.intlMeridiemUp, intlMinute: this.intlMinute, intlMinuteDown: this.intlMinuteDown, intlMinuteUp: this.intlMinuteUp, intlSecond: this.intlSecond, intlSecondDown: this.intlSecondDown, intlSecondUp: this.intlSecondUp, lang: this.locale, onCalciteTimePickerChange: this.timePickerChangeHandler, ref: this.setCalciteTimePickerEl, scale: this.scale, step: this.step, value: this.value })), hAsync(HiddenFormInputSlot, { component: this })));
|
|
20752
20771
|
}
|
|
20753
20772
|
get el() { return getElement(this); }
|
|
20754
20773
|
static get watchers() { return {
|
|
@@ -20780,6 +20799,7 @@ class InputTimePicker {
|
|
|
20780
20799
|
"name": [1],
|
|
20781
20800
|
"required": [516],
|
|
20782
20801
|
"scale": [513],
|
|
20802
|
+
"placement": [513],
|
|
20783
20803
|
"step": [2],
|
|
20784
20804
|
"value": [1025],
|
|
20785
20805
|
"localizedValue": [32],
|
|
@@ -20787,7 +20807,7 @@ class InputTimePicker {
|
|
|
20787
20807
|
},
|
|
20788
20808
|
"$listeners$": [[0, "click", "clickHandler"], [0, "keyup", "keyUpHandler"], [0, "calciteTimePickerBlur", "timePickerBlurHandler"], [0, "calciteTimePickerFocus", "timePickerFocusHandler"]],
|
|
20789
20809
|
"$lazyBundleId$": "-",
|
|
20790
|
-
"$attrsToReflect$": [["active", "active"], ["disabled", "disabled"], ["required", "required"], ["scale", "scale"]]
|
|
20810
|
+
"$attrsToReflect$": [["active", "active"], ["disabled", "disabled"], ["required", "required"], ["scale", "scale"], ["placement", "placement"]]
|
|
20791
20811
|
}; }
|
|
20792
20812
|
}
|
|
20793
20813
|
|
|
@@ -25136,6 +25156,9 @@ class ShellPanel {
|
|
|
25136
25156
|
|
|
25137
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}";
|
|
25138
25158
|
|
|
25159
|
+
function isRange(value) {
|
|
25160
|
+
return Array.isArray(value);
|
|
25161
|
+
}
|
|
25139
25162
|
class Slider {
|
|
25140
25163
|
constructor(hostRef) {
|
|
25141
25164
|
registerInstance(this, hostRef);
|
|
@@ -25176,13 +25199,12 @@ class Slider {
|
|
|
25176
25199
|
/** Interval to move on up/down keys */
|
|
25177
25200
|
this.step = 1;
|
|
25178
25201
|
/** Currently selected number (if single select) */
|
|
25179
|
-
this.value =
|
|
25202
|
+
this.value = 0;
|
|
25180
25203
|
/**
|
|
25181
25204
|
* Specify the scale of the slider, defaults to m
|
|
25182
25205
|
*/
|
|
25183
25206
|
this.scale = "m";
|
|
25184
25207
|
this.guid = `calcite-slider-${guid()}`;
|
|
25185
|
-
this.isRange = false;
|
|
25186
25208
|
this.activeProp = "value";
|
|
25187
25209
|
this.minMaxValueRange = null;
|
|
25188
25210
|
this.minValueDragRange = null;
|
|
@@ -25192,7 +25214,7 @@ class Slider {
|
|
|
25192
25214
|
event.preventDefault();
|
|
25193
25215
|
if (this.dragProp) {
|
|
25194
25216
|
const value = this.translate(event.clientX || event.pageX);
|
|
25195
|
-
if (this.
|
|
25217
|
+
if (isRange(this.value) && this.dragProp === "minMaxValue") {
|
|
25196
25218
|
if (this.minValueDragRange && this.maxValueDragRange && this.minMaxValueRange) {
|
|
25197
25219
|
const newMinValue = value - this.minValueDragRange;
|
|
25198
25220
|
const newMaxValue = value + this.maxValueDragRange;
|
|
@@ -25238,12 +25260,20 @@ class Slider {
|
|
|
25238
25260
|
histogramWatcher(newHistogram) {
|
|
25239
25261
|
this.hasHistogram = !!newHistogram;
|
|
25240
25262
|
}
|
|
25263
|
+
valueHandler() {
|
|
25264
|
+
this.setMinMaxFromValue();
|
|
25265
|
+
}
|
|
25266
|
+
minMaxValueHandler() {
|
|
25267
|
+
this.setValueFromMinMax();
|
|
25268
|
+
}
|
|
25241
25269
|
//--------------------------------------------------------------------------
|
|
25242
25270
|
//
|
|
25243
25271
|
// Lifecycle
|
|
25244
25272
|
//
|
|
25245
25273
|
//--------------------------------------------------------------------------
|
|
25246
25274
|
connectedCallback() {
|
|
25275
|
+
this.setMinMaxFromValue();
|
|
25276
|
+
this.setValueFromMinMax();
|
|
25247
25277
|
connectLabel(this);
|
|
25248
25278
|
connectForm(this);
|
|
25249
25279
|
}
|
|
@@ -25253,11 +25283,12 @@ class Slider {
|
|
|
25253
25283
|
this.removeDragListeners();
|
|
25254
25284
|
}
|
|
25255
25285
|
componentWillLoad() {
|
|
25256
|
-
this.isRange = !!(this.maxValue || this.maxValue === 0);
|
|
25257
25286
|
this.tickValues = this.generateTickValues();
|
|
25258
|
-
|
|
25287
|
+
if (!isRange(this.value)) {
|
|
25288
|
+
this.value = this.clamp(this.value);
|
|
25289
|
+
}
|
|
25259
25290
|
afterConnectDefaultValueSet(this, this.value);
|
|
25260
|
-
if (this.snap) {
|
|
25291
|
+
if (this.snap && !isRange(this.value)) {
|
|
25261
25292
|
this.value = this.getClosestStep(this.value);
|
|
25262
25293
|
}
|
|
25263
25294
|
if (this.histogram) {
|
|
@@ -25267,9 +25298,9 @@ class Slider {
|
|
|
25267
25298
|
componentDidRender() {
|
|
25268
25299
|
if (this.labelHandles) {
|
|
25269
25300
|
this.adjustHostObscuredHandleLabel("value");
|
|
25270
|
-
if (this.
|
|
25301
|
+
if (isRange(this.value)) {
|
|
25271
25302
|
this.adjustHostObscuredHandleLabel("minValue");
|
|
25272
|
-
if (!(this.precise &&
|
|
25303
|
+
if (!(this.precise && !this.hasHistogram)) {
|
|
25273
25304
|
this.hyphenateCollidingRangeHandleLabels();
|
|
25274
25305
|
}
|
|
25275
25306
|
}
|
|
@@ -25279,50 +25310,50 @@ class Slider {
|
|
|
25279
25310
|
}
|
|
25280
25311
|
render() {
|
|
25281
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;
|
|
25282
25315
|
const min = this.minValue || this.min;
|
|
25283
|
-
const max = this.maxValue || this.value;
|
|
25284
|
-
const maxProp = this.isRange ? "maxValue" : "value";
|
|
25285
|
-
const value = this[maxProp];
|
|
25286
25316
|
const useMinValue = this.shouldUseMinValue();
|
|
25287
25317
|
const minInterval = this.getUnitInterval(useMinValue ? this.minValue : min) * 100;
|
|
25288
|
-
const maxInterval = this.getUnitInterval(
|
|
25318
|
+
const maxInterval = this.getUnitInterval(value) * 100;
|
|
25289
25319
|
const mirror = this.shouldMirror();
|
|
25290
25320
|
const leftThumbOffset = `${mirror ? 100 - minInterval : minInterval}%`;
|
|
25291
25321
|
const rightThumbOffset = `${mirror ? maxInterval : 100 - maxInterval}%`;
|
|
25292
|
-
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: {
|
|
25293
25324
|
thumb: true,
|
|
25294
25325
|
"thumb--value": true,
|
|
25295
25326
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp
|
|
25296
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" })));
|
|
25297
|
-
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: {
|
|
25298
25329
|
thumb: true,
|
|
25299
25330
|
"thumb--value": true,
|
|
25300
25331
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp
|
|
25301
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" })));
|
|
25302
|
-
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: {
|
|
25303
25334
|
thumb: true,
|
|
25304
25335
|
"thumb--value": true,
|
|
25305
25336
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp
|
|
25306
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)));
|
|
25307
|
-
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: {
|
|
25308
25339
|
thumb: true,
|
|
25309
25340
|
"thumb--value": true,
|
|
25310
25341
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp,
|
|
25311
25342
|
"thumb--precise": true
|
|
25312
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" })));
|
|
25313
|
-
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: {
|
|
25314
25345
|
thumb: true,
|
|
25315
25346
|
"thumb--value": true,
|
|
25316
25347
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp,
|
|
25317
25348
|
"thumb--precise": true
|
|
25318
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" })));
|
|
25319
|
-
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: {
|
|
25320
25351
|
thumb: true,
|
|
25321
25352
|
"thumb--value": true,
|
|
25322
25353
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp,
|
|
25323
25354
|
"thumb--precise": true
|
|
25324
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" })));
|
|
25325
|
-
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: {
|
|
25326
25357
|
thumb: true,
|
|
25327
25358
|
"thumb--value": true,
|
|
25328
25359
|
"thumb--active": this.lastDragProp !== "minMaxValue" && this.dragProp === maxProp,
|
|
@@ -25357,14 +25388,14 @@ class Slider {
|
|
|
25357
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())));
|
|
25358
25389
|
return (hAsync(Host, { id: id, onTouchStart: this.handleTouchStart }, hAsync("div", { class: {
|
|
25359
25390
|
["container"]: true,
|
|
25360
|
-
["container--range"]:
|
|
25391
|
+
["container--range"]: valueIsRange,
|
|
25361
25392
|
[`scale--${this.scale}`]: true
|
|
25362
25393
|
} }, this.renderGraph(), hAsync("div", { class: "track", ref: this.storeTrackRef }, hAsync("div", { class: "track__range", onPointerDown: () => this.dragStart("minMaxValue"), style: {
|
|
25363
25394
|
left: `${mirror ? 100 - maxInterval : minInterval}%`,
|
|
25364
25395
|
right: `${mirror ? minInterval : 100 - maxInterval}%`
|
|
25365
25396
|
} }), hAsync("div", { class: "ticks" }, this.tickValues.map((tick) => {
|
|
25366
25397
|
const tickOffset = `${this.getUnitInterval(tick) * 100}%`;
|
|
25367
|
-
let activeTicks = tick >= min && tick <=
|
|
25398
|
+
let activeTicks = tick >= min && tick <= value;
|
|
25368
25399
|
if (useMinValue) {
|
|
25369
25400
|
activeTicks = tick >= this.minValue && tick <= this.maxValue;
|
|
25370
25401
|
}
|
|
@@ -25375,23 +25406,24 @@ class Slider {
|
|
|
25375
25406
|
left: mirror ? "" : tickOffset,
|
|
25376
25407
|
right: mirror ? tickOffset : ""
|
|
25377
25408
|
} }, this.renderTickLabel(tick)));
|
|
25378
|
-
}))), hAsync("div", { class: "thumb-container" }, !this.precise && !this.labelHandles &&
|
|
25409
|
+
}))), hAsync("div", { class: "thumb-container" }, !this.precise && !this.labelHandles && valueIsRange && minHandle, !this.hasHistogram &&
|
|
25379
25410
|
!this.precise &&
|
|
25380
25411
|
this.labelHandles &&
|
|
25381
|
-
|
|
25382
|
-
minLabeledHandle, this.precise && !this.labelHandles &&
|
|
25412
|
+
valueIsRange &&
|
|
25413
|
+
minLabeledHandle, this.precise && !this.labelHandles && valueIsRange && minPreciseHandle, this.precise && this.labelHandles && valueIsRange && minLabeledPreciseHandle, this.hasHistogram &&
|
|
25383
25414
|
!this.precise &&
|
|
25384
25415
|
this.labelHandles &&
|
|
25385
|
-
|
|
25416
|
+
valueIsRange &&
|
|
25386
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 &&
|
|
25387
25418
|
this.precise &&
|
|
25388
25419
|
this.labelHandles &&
|
|
25389
25420
|
histogramLabeledPreciseHandle, hAsync(HiddenFormInputSlot, { component: this })))));
|
|
25390
25421
|
}
|
|
25391
25422
|
renderGraph() {
|
|
25392
|
-
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;
|
|
25393
25424
|
}
|
|
25394
25425
|
renderTickLabel(tick) {
|
|
25426
|
+
const valueIsRange = isRange(this.value);
|
|
25395
25427
|
const isMinTickLabel = tick === this.min;
|
|
25396
25428
|
const isMaxTickLabel = tick === this.max;
|
|
25397
25429
|
const tickLabel = (hAsync("span", { class: {
|
|
@@ -25399,26 +25431,26 @@ class Slider {
|
|
|
25399
25431
|
"tick__label--min": isMinTickLabel,
|
|
25400
25432
|
"tick__label--max": isMaxTickLabel
|
|
25401
25433
|
} }, tick.toLocaleString()));
|
|
25402
|
-
if (this.labelTicks && !this.hasHistogram && !
|
|
25434
|
+
if (this.labelTicks && !this.hasHistogram && !valueIsRange) {
|
|
25403
25435
|
return tickLabel;
|
|
25404
25436
|
}
|
|
25405
25437
|
if (this.labelTicks &&
|
|
25406
25438
|
!this.hasHistogram &&
|
|
25407
|
-
|
|
25439
|
+
valueIsRange &&
|
|
25408
25440
|
!this.precise &&
|
|
25409
25441
|
!this.labelHandles) {
|
|
25410
25442
|
return tickLabel;
|
|
25411
25443
|
}
|
|
25412
25444
|
if (this.labelTicks &&
|
|
25413
25445
|
!this.hasHistogram &&
|
|
25414
|
-
|
|
25446
|
+
valueIsRange &&
|
|
25415
25447
|
!this.precise &&
|
|
25416
25448
|
this.labelHandles) {
|
|
25417
25449
|
return tickLabel;
|
|
25418
25450
|
}
|
|
25419
25451
|
if (this.labelTicks &&
|
|
25420
25452
|
!this.hasHistogram &&
|
|
25421
|
-
|
|
25453
|
+
valueIsRange &&
|
|
25422
25454
|
this.precise &&
|
|
25423
25455
|
(isMinTickLabel || isMaxTickLabel)) {
|
|
25424
25456
|
return tickLabel;
|
|
@@ -25502,7 +25534,7 @@ class Slider {
|
|
|
25502
25534
|
const x = event.clientX || event.pageX;
|
|
25503
25535
|
const position = this.translate(x);
|
|
25504
25536
|
let prop = "value";
|
|
25505
|
-
if (this.
|
|
25537
|
+
if (isRange(this.value)) {
|
|
25506
25538
|
const inRange = position >= this.minValue && position <= this.maxValue;
|
|
25507
25539
|
if (inRange && this.lastDragProp === "minMaxValue") {
|
|
25508
25540
|
prop = "minMaxValue";
|
|
@@ -25538,6 +25570,19 @@ class Slider {
|
|
|
25538
25570
|
// Private Methods
|
|
25539
25571
|
//
|
|
25540
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
|
+
}
|
|
25541
25586
|
onLabelClick() {
|
|
25542
25587
|
this.setFocus();
|
|
25543
25588
|
}
|
|
@@ -25545,7 +25590,7 @@ class Slider {
|
|
|
25545
25590
|
return this.mirrored && !this.hasHistogram;
|
|
25546
25591
|
}
|
|
25547
25592
|
shouldUseMinValue() {
|
|
25548
|
-
if (!this.
|
|
25593
|
+
if (!isRange(this.value)) {
|
|
25549
25594
|
return false;
|
|
25550
25595
|
}
|
|
25551
25596
|
return ((this.hasHistogram && this.maxValue === 0) || (!this.hasHistogram && this.minValue === 0));
|
|
@@ -25758,19 +25803,20 @@ class Slider {
|
|
|
25758
25803
|
* Hides bounding tick labels that are obscured by either handle.
|
|
25759
25804
|
*/
|
|
25760
25805
|
hideObscuredBoundingTickLabels() {
|
|
25761
|
-
|
|
25806
|
+
const valueIsRange = isRange(this.value);
|
|
25807
|
+
if (!this.hasHistogram && !valueIsRange && !this.labelHandles && !this.precise) {
|
|
25762
25808
|
return;
|
|
25763
25809
|
}
|
|
25764
|
-
if (!this.hasHistogram && !
|
|
25810
|
+
if (!this.hasHistogram && !valueIsRange && this.labelHandles && !this.precise) {
|
|
25765
25811
|
return;
|
|
25766
25812
|
}
|
|
25767
|
-
if (!this.hasHistogram && !
|
|
25813
|
+
if (!this.hasHistogram && !valueIsRange && !this.labelHandles && this.precise) {
|
|
25768
25814
|
return;
|
|
25769
25815
|
}
|
|
25770
|
-
if (!this.hasHistogram && !
|
|
25816
|
+
if (!this.hasHistogram && !valueIsRange && this.labelHandles && this.precise) {
|
|
25771
25817
|
return;
|
|
25772
25818
|
}
|
|
25773
|
-
if (!this.hasHistogram &&
|
|
25819
|
+
if (!this.hasHistogram && valueIsRange && !this.precise) {
|
|
25774
25820
|
return;
|
|
25775
25821
|
}
|
|
25776
25822
|
if (this.hasHistogram && !this.precise && !this.labelHandles) {
|
|
@@ -25847,7 +25893,10 @@ class Slider {
|
|
|
25847
25893
|
}
|
|
25848
25894
|
get el() { return getElement(this); }
|
|
25849
25895
|
static get watchers() { return {
|
|
25850
|
-
"histogram": ["histogramWatcher"]
|
|
25896
|
+
"histogram": ["histogramWatcher"],
|
|
25897
|
+
"value": ["valueHandler"],
|
|
25898
|
+
"minValue": ["minMaxValueHandler"],
|
|
25899
|
+
"maxValue": ["minMaxValueHandler"]
|
|
25851
25900
|
}; }
|
|
25852
25901
|
static get style() { return sliderCss; }
|
|
25853
25902
|
static get cmpMeta() { return {
|