@arcgis/map-components 5.2.0-next.8 → 5.2.0-next.9
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/cdn/{WA7JHFV4.js → 2LRS7XSQ.js} +1 -1
- package/dist/cdn/462X4ZCG.js +2 -0
- package/dist/cdn/{Y27ZQGV5.js → CW7J5L5W.js} +1 -1
- package/dist/cdn/D2JUQOOB.js +2 -0
- package/dist/cdn/{YABPKPDP.js → GX45UPO4.js} +1 -1
- package/dist/cdn/{JQVWY2TG.js → HXDS4O7D.js} +1 -1
- package/dist/cdn/HXHMU23F.js +2 -0
- package/dist/cdn/{XKPUIYHL.js → JAANZHBL.js} +1 -1
- package/dist/cdn/K5NKFHWA.js +2 -0
- package/dist/cdn/{GRF2FJN5.js → OO3T24WP.js} +1 -1
- package/dist/cdn/{P3TXSVMD.js → QZB3WXJH.js} +2 -2
- package/dist/cdn/ROQ6HC6T.js +2 -0
- package/dist/cdn/{QM2RBDFO.js → TQYGI7O4.js} +1 -1
- package/dist/cdn/U5FGCB62.js +2 -0
- package/dist/cdn/{FZNGDLO6.js → U6FG3DCW.js} +1 -1
- package/dist/cdn/{FT2LXOKH.js → UADZMW3G.js} +1 -1
- package/dist/cdn/{2THVOG4Y.js → WA7IUOYU.js} +1 -1
- package/dist/cdn/{CUMFJ3AY.js → XMYIWNY6.js} +1 -1
- package/dist/cdn/XUDFNAMR.js +2 -0
- package/dist/cdn/assets/feature-templates/t9n/messages.en.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-feature-templates/customElement.d.ts +10 -8
- package/dist/components/arcgis-feature-templates/customElement.js +198 -247
- package/dist/components/arcgis-layer-list-next/layer-list-item/customElement.js +18 -15
- package/dist/components/arcgis-measurement-content/customElement.js +5 -5
- package/dist/components/arcgis-paste/PasteViewModel.d.ts +2 -2
- package/dist/components/arcgis-template-image/customElement.d.ts +2 -2
- package/dist/components/arcgis-template-image/customElement.js +25 -22
- package/dist/components/arcgis-template-image/index.js +1 -0
- package/dist/components/arcgis-weather/customElement.js +108 -102
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +5 -5
- package/dist/cdn/5T3MHTWU.js +0 -2
- package/dist/cdn/6N233F4I.js +0 -2
- package/dist/cdn/ABPHGXQN.js +0 -2
- package/dist/cdn/L34RL7Y3.js +0 -2
- package/dist/cdn/QY5F7WAO.js +0 -2
- package/dist/cdn/RJM52R4G.js +0 -2
- package/dist/cdn/UZWPHO3G.js +0 -2
- package/dist/components/arcgis-feature-templates/TemplateItem.d.ts +0 -33
- /package/dist/cdn/{Q5PJLESJ.js → 2IJFHZMD.js} +0 -0
- /package/dist/cdn/{TIRTPJYQ.js → 2KJOV5HK.js} +0 -0
- /package/dist/cdn/{2LKEXUGD.js → 2SUHVYCI.js} +0 -0
- /package/dist/cdn/{27HHZNMM.js → 2YXRZJMN.js} +0 -0
- /package/dist/cdn/{XPS7ZSFJ.js → 3JMCA4ZR.js} +0 -0
- /package/dist/cdn/{HQPBHWPK.js → 4GKDVLBA.js} +0 -0
- /package/dist/cdn/{AK2M26FE.js → 4XU4I5VY.js} +0 -0
- /package/dist/cdn/{KIZ3ARHJ.js → 5DCYVSSO.js} +0 -0
- /package/dist/cdn/{SOOQCCHH.js → 5UPND3OG.js} +0 -0
- /package/dist/cdn/{O2CLPWU5.js → 6CGHMQTL.js} +0 -0
- /package/dist/cdn/{Y3B5PQ5E.js → 6DVVJ6UQ.js} +0 -0
- /package/dist/cdn/{XVY5OKH2.js → AQB6HLVS.js} +0 -0
- /package/dist/cdn/{IA3NCWIB.js → B4A4RH4L.js} +0 -0
- /package/dist/cdn/{VHB2BYFO.js → B5D6OPEJ.js} +0 -0
- /package/dist/cdn/{HUYCG6D3.js → C3LA23CB.js} +0 -0
- /package/dist/cdn/{NYHNV75B.js → C436KPG7.js} +0 -0
- /package/dist/cdn/{YJPDBYVX.js → CGISH4NH.js} +0 -0
- /package/dist/cdn/{AT6DOX43.js → DF5Q25A7.js} +0 -0
- /package/dist/cdn/{ZX5J6SMV.js → DIZDIIUN.js} +0 -0
- /package/dist/cdn/{3YVA4NJL.js → DJ3VJDLN.js} +0 -0
- /package/dist/cdn/{GLRISNYR.js → DVZKG2WC.js} +0 -0
- /package/dist/cdn/{PMWIRBWT.js → EFUEICKE.js} +0 -0
- /package/dist/cdn/{WFJH7WES.js → ELJCC3WK.js} +0 -0
- /package/dist/cdn/{FYDZH6BL.js → EPLP4YMK.js} +0 -0
- /package/dist/cdn/{QI5WIEJM.js → F7DW6VHH.js} +0 -0
- /package/dist/cdn/{CDAV4NEB.js → FBXUEXNZ.js} +0 -0
- /package/dist/cdn/{KEGLDP4A.js → FZYHVESP.js} +0 -0
- /package/dist/cdn/{HH3DMGSF.js → HAADLXJX.js} +0 -0
- /package/dist/cdn/{744JVRBH.js → HQZQCK6J.js} +0 -0
- /package/dist/cdn/{A4S3GECZ.js → L3L24SIA.js} +0 -0
- /package/dist/cdn/{3JU2AHMP.js → LM6ZA4HA.js} +0 -0
- /package/dist/cdn/{CTMF7NFP.js → LXZ2GZTN.js} +0 -0
- /package/dist/cdn/{6FT2R5PB.js → O263Z4SH.js} +0 -0
- /package/dist/cdn/{2G4VQVBD.js → O4PQUMJR.js} +0 -0
- /package/dist/cdn/{ADD3R54T.js → PU6QKY7I.js} +0 -0
- /package/dist/cdn/{UUUPIG6P.js → TW24OEJB.js} +0 -0
- /package/dist/cdn/{IBGSVDSQ.js → UJA6BLTS.js} +0 -0
- /package/dist/cdn/{24HADOKV.js → UUCYWMS2.js} +0 -0
- /package/dist/cdn/{FUTB3TZA.js → VKIVTDAN.js} +0 -0
- /package/dist/cdn/{BRANLHXP.js → WBNMJ4VE.js} +0 -0
- /package/dist/cdn/{APMRTXPD.js → WGGJPXPR.js} +0 -0
- /package/dist/cdn/{MLV3GXE7.js → YJMFI5UV.js} +0 -0
- /package/dist/cdn/{SWYSBYOY.js → YLLLSHFK.js} +0 -0
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
4
|
-
import { ref as
|
|
5
|
-
import { useDirection as
|
|
6
|
-
import { classes as
|
|
7
|
-
import { LitElement as
|
|
8
|
-
import { u as
|
|
9
|
-
import { m as
|
|
10
|
-
import { H as
|
|
2
|
+
import { c as O } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as W, html as d } from "lit";
|
|
4
|
+
import { ref as F } from "lit/directives/ref.js";
|
|
5
|
+
import { useDirection as B, usePropertyChange as R } from "@arcgis/lumina/controllers";
|
|
6
|
+
import { classes as L } from "@arcgis/toolkit/dom";
|
|
7
|
+
import { LitElement as E, createEvent as H, nothing as _, safeClassMap as f, safeStyleMap as P } from "@arcgis/lumina";
|
|
8
|
+
import { u as V } from "../../chunks/useT9n.js";
|
|
9
|
+
import { m as D } from "../../chunks/useViewModel.js";
|
|
10
|
+
import { H as j } from "../../chunks/heading.js";
|
|
11
11
|
import { g as z } from "../../chunks/globalCss.js";
|
|
12
|
-
import
|
|
13
|
-
import { property as
|
|
14
|
-
import { watch as
|
|
15
|
-
import
|
|
12
|
+
import I from "@arcgis/core/core/Accessor.js";
|
|
13
|
+
import { property as u, subclass as K } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
14
|
+
import { watch as q } from "@arcgis/core/core/reactiveUtils.js";
|
|
15
|
+
import S from "@arcgis/core/views/3d/environment/CloudyWeather.js";
|
|
16
16
|
import $ from "@arcgis/core/views/3d/environment/FoggyWeather.js";
|
|
17
17
|
import k from "@arcgis/core/views/3d/environment/RainyWeather.js";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
const
|
|
21
|
-
var
|
|
22
|
-
for (var r =
|
|
23
|
-
(a = o[n]) && (r = (
|
|
24
|
-
return
|
|
18
|
+
import A from "@arcgis/core/views/3d/environment/SnowyWeather.js";
|
|
19
|
+
import T from "@arcgis/core/views/3d/environment/SunnyWeather.js";
|
|
20
|
+
const N = W`.esri-widget__heading{color:var(--calcite-color-text-2);margin:0 0 .5rem;font-weight:var(--calcite-font-weight-semibold)}h1.esri-widget__heading{font-size:var(--calcite-font-size-xl)}h2.esri-widget__heading{font-size:var(--calcite-font-size-md)}h3.esri-widget__heading,h4.esri-widget__heading,h5.esri-widget__heading,h6.esri-widget__heading{font-size:var(--calcite-font-size)}.esri-widget{box-sizing:border-box;color:var(--calcite-color-text-2);background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);line-height:var(--calcite-font-line-height-relative-tight)}.esri-widget *,.esri-widget :before,.esri-widget :after{box-sizing:inherit}.esri-widget.esri-widget--disabled>*{opacity:.4;pointer-events:none}.esri-widget.esri-widget--compact{--esri-widget-padding-y: 0;--esri-widget-padding-x: 0}.esri-widget__anchor{color:var(--calcite-color-text-2)}.esri-widget__anchor:hover{color:var(--calcite-color-text-3)}.esri-widget__anchor:hover,.esri-widget__anchor:focus{text-decoration:underline}.esri-widget__anchor--disabled{opacity:.4;pointer-events:none}.esri-widget__header{background-color:var(--calcite-color-foreground-1);flex:1 0 100%;justify-content:space-between;align-items:center;width:100%;min-height:48px;padding:12px 0 12px 15px;display:flex}.esri-widget__heading{word-break:break-word}.esri-widget__header .esri-widget__heading{width:calc(100% - 48px);text-align:initial;color:var(--calcite-color-text-1);align-items:center;margin:0;padding:0;display:flex}.esri-widget__header-button{appearance:none;cursor:pointer;color:var(--calcite-color-text-2);background-color:var(--calcite-color-foreground-1);border:none;flex:0 0 48px;justify-content:center;align-self:stretch;align-items:center;width:48px;padding:0;display:flex}.esri-widget__footer{background-color:var(--calcite-color-foreground-1);justify-content:center;align-items:center;width:100%;min-height:48px;display:flex}.esri-widget__footer-pagination{color:var(--calcite-color-text-2);justify-content:space-between;align-items:center;display:flex}.esri-widget__footer-pagination-previous-button,.esri-widget__footer-pagination-next-button{cursor:pointer;background-color:var(--calcite-color-foreground-1);border:0;margin:0 7px;padding:12px 15px;transition:background-color .125s ease-in-out}.esri-widget__footer-pagination-previous-button:hover,.esri-widget__footer-pagination-previous-button:focus,.esri-widget__footer-pagination-next-button:hover,.esri-widget__footer-pagination-next-button:focus{color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1)}.esri-menu{visibility:hidden;z-index:1;background-clip:padding;background-color:var(--calcite-color-foreground-1);background-clip:padding-box;width:100%;max-height:0;margin:2px 0 0;padding:0;font-size:var(--calcite-font-size);line-height:var(--calcite-spacing-xl);position:absolute;top:100%;left:0;overflow:hidden;box-shadow:0 1px 2px #0000004d}.esri-menu .esri-menu__header{color:var(--calcite-color-text-inverse);background-color:var(--calcite-color-inverse);padding:6px 12px}.esri-menu__list{margin:0;padding:0;list-style:none}.esri-menu__list-item{cursor:pointer;border-top:1px solid #adadad4d;border-left:3px solid #0000;padding:.8em 1em}.esri-menu__list-item [class^=esri-icon-],.esri-menu__list-item [class*=" esri-icon-"]{padding-right:2.8px}.esri-menu__list-item:first-child{border-top:none}.esri-menu__list-item--focus,.esri-menu__list-item:hover,.esri-menu__list-item:focus{background-color:var(--calcite-color-foreground-1)}.esri-menu__list-item:active{background-color:var(--calcite-color-foreground-current)}.esri-menu__list-item--active,.esri-menu__list-item--active:hover,.esri-menu__list-item--active:focus{background-color:var(--calcite-color-foreground-1);border-left-color:var(--calcite-color-brand)}.esri-widget__table{border-collapse:collapse;color:var(--calcite-color-text-1);border:none;width:100%;line-height:var(--calcite-font-line-height-relative-tight)}.esri-widget__table tr:nth-child(odd){background-color:var(--calcite-color-transparent)}.esri-widget__table tr:nth-child(2n){background-color:var(--calcite-color-transparent-press)}.esri-widget__table tr a{color:var(--calcite-color-text-2)}.esri-widget__table tr a:hover,.esri-widget__table tr a:focus{color:var(--calcite-color-text-1)}.esri-widget__table tr td,.esri-widget__table tr th{vertical-align:top;word-break:break-word;padding:.5em .7em;font-size:var(--calcite-font-size-sm);font-weight:var(--calcite-font-weight-regular)}.esri-widget__table tr th{text-align:left;border-right:3px solid #0000000d;width:50%}.esri-widget__table tr td{width:50%}.esri-input{color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1);border:1px solid #959595;font-size:var(--calcite-font-size)}.esri-input::-ms-clear{display:none}.esri-input::placeholder{opacity:1;color:var(--calcite-color-text-2)}.esri-input:placeholder-shown{text-overflow:ellipsis}.esri-input[type=text],.esri-input[type=password],.esri-input[type=number]{height:32px;padding:0 .5em}calcite-combobox.esri-input{border:none}.esri-widget__content--empty{text-align:center;color:var(--calcite-color-border-input);flex-flow:column wrap;align-items:center;padding:18px 22px;display:flex}.esri-widget__content--empty h1.esri-widget__heading,.esri-widget__content--empty h2.esri-widget__heading,.esri-widget__content--empty h3.esri-widget__heading,.esri-widget__content--empty h4.esri-widget__heading,.esri-widget__content--empty h5.esri-widget__heading{font-weight:var(--calcite-font-weight-regular)}.esri-widget__content-illustration--empty{width:128px;padding:1rem 0}.esri-widget__content-icon--empty{width:32px;padding:.5rem 0}.esri-select{appearance:none;cursor:pointer;color:var(--calcite-color-text-2);background:var(--calcite-color-foreground-1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-8 -8 32 32' width='32' height='32'%3E%3Cpath d='M8 11.207l-4-4V5.793l4 4 4-4v1.414z' fill='%23adadad' fillrule='nonzero'/%3E%3C/svg%3E") 100% no-repeat;border:1px solid #959595;border-radius:0;width:100%;height:32px;margin:0;padding:0 .5em;font-family:inherit;font-size:.85em;display:block}.esri-select[disabled]{cursor:auto}.esri-select::-ms-expand{display:none}.esri-disabled a,.esri-disabled [role=menu],.esri-disabled [role=checkbox],.esri-disabled [class^=esri-icon-],.esri-disabled [class*=" esri-icon-"]{color:var(--calcite-color-text-3)}.keynav-mode .esri-widget:focus,.keynav-mode .esri-widget :focus{z-index:1;outline-offset:2px;outline:2px solid #adadad}.esri-widget__loader-animation{border:.15em solid #adadad4d;border-top-color:var(--calcite-color-border-input);border-radius:100%;width:1em;height:1em;font-size:var(--calcite-font-size-md);animation:1.25s linear infinite esri-rotate;display:block;transform:translateZ(0)}:dir(rtl) .esri-widget__table th{text-align:right;border-left:3px solid #0000000d;border-right:none}:dir(rtl) .esri-select{background-position:0}:dir(rtl) .esri-menu__list-item{border-left:none;border-right:3px solid #0000}:dir(rtl) .esri-menu__list-item [class^=esri-icon-],:dir(rtl) .esri-menu__list-item [class*=" esri-icon-"]{padding-left:2px;padding-right:0}:dir(rtl) .esri-menu__list-item--active{border-right-color:var(--calcite-color-brand)}.esri-icon-font-fallback-text{clip:rect(0 0 0 0);width:1px;height:1px;position:absolute;overflow:hidden}.esri-rotating{animation:1.25s linear infinite esri-rotate;transform:translateZ(0)}.esri-clearfix:before,.esri-clearfix:after{content:" ";display:table}.esri-clearfix:after{clear:both}.esri-interactive{cursor:pointer}.esri-hidden{display:none!important}.esri-invisible{visibility:hidden!important}.esri-offscreen{position:absolute;top:-999em;left:-999em}.esri-match-height{flex-direction:column;flex:auto;display:flex;overflow:hidden}:host{width:300px;min-width:180px}.root{position:relative;padding:var(--arcgis-internal-padding);container-type:inline-size;width:100%}.content{display:flex;flex-direction:column;gap:var(--calcite-spacing-lg)}.content.error{visibility:hidden;height:0;overflow:hidden;pointer-events:none}.weather-type-selector{--button-gap: var(--calcite-spacing-sm);--button-size-min: 24px;--button-size-s-max: 32px;--button-size-m-max: 64px;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;width:100%;min-block-size:var(--button-row-min-height, 0);margin-inline:auto;gap:var(--button-gap);>calcite-button{display:block;position:relative;flex-shrink:0;flex-grow:0;aspect-ratio:1 / 1;height:fit-content;--total-gap: calc((var(--weather-type-count) - 1) * var(--button-gap));--basis: clamp( var(--button-size-min), calc((100% - var(--total-gap)) / var(--weather-type-count)), var(--button-size-m-max) );flex-basis:round(down,var(--basis),1px)}}@container (max-width: 280px){.weather-type-selector{--button-gap: var(--calcite-spacing-xs)}}@container (max-width: 220px){.weather-type-selector{--button-gap: var(--calcite-spacing-xxs)}}.options{display:flex;flex-direction:column;gap:var(--calcite-spacing-md);calcite-label{--calcite-label-margin-bottom: 0}&.hidden{display:none}}.warning-title{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}`;
|
|
21
|
+
var G = Object.defineProperty, Z = Object.getOwnPropertyDescriptor, g = (o, e, t, i) => {
|
|
22
|
+
for (var r = i > 1 ? void 0 : i ? Z(e, t) : e, n = o.length - 1, a; n >= 0; n--)
|
|
23
|
+
(a = o[n]) && (r = (i ? a(e, t, r) : a(r)) || r);
|
|
24
|
+
return i && r && G(e, t, r), r;
|
|
25
25
|
};
|
|
26
|
-
const
|
|
27
|
-
sunny:
|
|
28
|
-
cloudy:
|
|
26
|
+
const U = {
|
|
27
|
+
sunny: T,
|
|
28
|
+
cloudy: S,
|
|
29
29
|
rainy: k,
|
|
30
|
-
snowy:
|
|
30
|
+
snowy: A,
|
|
31
31
|
foggy: $
|
|
32
|
-
},
|
|
33
|
-
let l = class extends
|
|
32
|
+
}, p = Object.keys(U);
|
|
33
|
+
let l = class extends I {
|
|
34
34
|
//#region Lifecycle
|
|
35
35
|
constructor(o) {
|
|
36
36
|
super(o), this._settingWeather = !1, this._weatherByType = {
|
|
37
|
-
sunny: new
|
|
38
|
-
cloudy: new
|
|
37
|
+
sunny: new T(),
|
|
38
|
+
cloudy: new S(),
|
|
39
39
|
rainy: new k(),
|
|
40
|
-
snowy: new
|
|
40
|
+
snowy: new A(),
|
|
41
41
|
foggy: new $()
|
|
42
42
|
};
|
|
43
43
|
}
|
|
@@ -45,7 +45,7 @@ let l = class extends j {
|
|
|
45
45
|
this.addHandles([
|
|
46
46
|
// When the weather is changed directly in the environment (not in the VM),
|
|
47
47
|
// we need to update the corresponding weather instance in the view model.
|
|
48
|
-
|
|
48
|
+
q(
|
|
49
49
|
() => this.current,
|
|
50
50
|
(o) => {
|
|
51
51
|
this._settingWeather || o == null || (this._weatherByType = {
|
|
@@ -93,75 +93,80 @@ let l = class extends j {
|
|
|
93
93
|
}
|
|
94
94
|
//#endregion
|
|
95
95
|
};
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
g([
|
|
97
|
+
u()
|
|
98
98
|
], l.prototype, "view", 2);
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
g([
|
|
100
|
+
u()
|
|
101
101
|
], l.prototype, "state", 1);
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
g([
|
|
103
|
+
u()
|
|
104
104
|
], l.prototype, "disabled", 1);
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
g([
|
|
106
|
+
u()
|
|
107
107
|
], l.prototype, "weatherByType", 1);
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
g([
|
|
109
|
+
u()
|
|
110
110
|
], l.prototype, "error", 1);
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
g([
|
|
112
|
+
u()
|
|
113
113
|
], l.prototype, "current", 1);
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
g([
|
|
115
|
+
u()
|
|
116
116
|
], l.prototype, "_weatherByType", 2);
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
g([
|
|
118
|
+
u()
|
|
119
119
|
], l.prototype, "_environment", 1);
|
|
120
|
-
l =
|
|
121
|
-
|
|
120
|
+
l = g([
|
|
121
|
+
K("components.weather.WeatherViewModel")
|
|
122
122
|
], l);
|
|
123
|
-
function
|
|
123
|
+
function m({ label: o, ariaLabel: e, value: t, disabled: i, onChange: r }) {
|
|
124
124
|
const n = (s) => {
|
|
125
|
-
const
|
|
126
|
-
r?.(
|
|
125
|
+
const h = s.currentTarget.value;
|
|
126
|
+
r?.(h ?? 0);
|
|
127
127
|
};
|
|
128
|
-
return
|
|
128
|
+
return d`<calcite-label .scale=${"m"}><calcite-slider .disabled=${i} .ariaLabel=${e} .labelText=${o} .value=${t} min=0 max=1 step=0.01 .scale=${"m"} @calciteSliderChange=${n} @calciteSliderInput=${n}></calcite-slider></calcite-label>`;
|
|
129
129
|
}
|
|
130
|
-
const
|
|
130
|
+
const J = D(l), Q = {
|
|
131
131
|
sunny: "brightness",
|
|
132
132
|
cloudy: "partly-cloudy",
|
|
133
133
|
rainy: "rain",
|
|
134
134
|
snowy: "snow",
|
|
135
135
|
foggy: "fog"
|
|
136
|
-
};
|
|
137
|
-
class
|
|
136
|
+
}, X = 16, M = typeof navigator < "u" && navigator.userAgent.includes("Safari") && !navigator.userAgent.includes("Chrome") && !navigator.userAgent.includes("Chromium") && !navigator.userAgent.includes("Android") && !navigator.userAgent.includes("CriOS") && !navigator.userAgent.includes("FxiOS") && !navigator.userAgent.includes("Edg");
|
|
137
|
+
class Y extends E {
|
|
138
138
|
constructor() {
|
|
139
|
-
super(...arguments), this.viewModel =
|
|
140
|
-
for (const
|
|
141
|
-
|
|
142
|
-
}), this._buttonScale = "m", this.view = this.viewModel.view, this.autoDestroyDisabled = !1, this.headingLevel = 4, this.hideHeader = !1, this.icon = "partly-cloudy", this.label = this.messages.componentLabel, this.state = this.viewModel.state, this.arcgisPropertyChange =
|
|
139
|
+
super(...arguments), this.viewModel = J(this), this.messages = V(), this.direction = B(), this._resizeAnimationFrame = void 0, this._weatherTypeSelector = void 0, this._resizeObserver = new ResizeObserver((e) => {
|
|
140
|
+
for (const t of e)
|
|
141
|
+
t.target instanceof HTMLElement && this._updateButtonScale(t.target, t.contentRect.width);
|
|
142
|
+
}), this._buttonScale = "m", this._buttonRowMinHeight = void 0, this.view = this.viewModel.view, this.autoDestroyDisabled = !1, this.headingLevel = 4, this.hideHeader = !1, this.icon = "partly-cloudy", this.label = this.messages.componentLabel, this.state = this.viewModel.state, this.arcgisPropertyChange = R()("state"), this.arcgisReady = H();
|
|
143
143
|
}
|
|
144
144
|
static {
|
|
145
|
-
this.properties = { _buttonScale: 16, view: 0, autoDestroyDisabled: 5, headingLevel: 9, hideHeader: 5, icon: 1, label: 1, messageOverrides: 0, referenceElement: 1, state: 32 };
|
|
145
|
+
this.properties = { _buttonScale: 16, _buttonRowMinHeight: 16, view: 0, autoDestroyDisabled: 5, headingLevel: 9, hideHeader: 5, icon: 1, label: 1, messageOverrides: 0, referenceElement: 1, state: 32 };
|
|
146
146
|
}
|
|
147
147
|
static {
|
|
148
|
-
this.styles =
|
|
148
|
+
this.styles = N;
|
|
149
149
|
}
|
|
150
150
|
async destroy() {
|
|
151
151
|
this._cleanupResizeObserver(), await this.manager.destroy();
|
|
152
152
|
}
|
|
153
153
|
_cleanupResizeObserver() {
|
|
154
|
-
this._resizeObserver.disconnect(), this._weatherTypeSelector = void 0, this._resizeAnimationFrame && (cancelAnimationFrame(this._resizeAnimationFrame), this._resizeAnimationFrame = void 0);
|
|
154
|
+
this._resizeObserver.disconnect(), this._weatherTypeSelector = void 0, this._buttonRowMinHeight = void 0, this._resizeAnimationFrame && (cancelAnimationFrame(this._resizeAnimationFrame), this._resizeAnimationFrame = void 0);
|
|
155
155
|
}
|
|
156
156
|
_makeWeatherTypeSelectorRef() {
|
|
157
157
|
return (e) => {
|
|
158
158
|
e !== this._weatherTypeSelector && (this._weatherTypeSelector && this._resizeObserver.unobserve(this._weatherTypeSelector), this._weatherTypeSelector = e, e && (this._resizeObserver.observe(e), this._updateButtonScale(e, e.clientWidth)));
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
|
-
_updateButtonScale(e,
|
|
161
|
+
_updateButtonScale(e, t) {
|
|
162
162
|
this._resizeAnimationFrame && cancelAnimationFrame(this._resizeAnimationFrame), this._resizeAnimationFrame = requestAnimationFrame(() => {
|
|
163
|
-
const
|
|
164
|
-
|
|
163
|
+
const i = getComputedStyle(e), r = Number.parseFloat(i.getPropertyValue("--button-gap")), n = Number.parseFloat(i.getPropertyValue("--button-size-min")), a = Number.parseFloat(i.getPropertyValue("--button-size-s-max")), s = Number.parseFloat(i.getPropertyValue("--button-size-m-max")), h = (p.length - 1) * r, v = Math.max(n, Math.min((t - h) / p.length, s)), b = Math.floor(v);
|
|
164
|
+
if (M) {
|
|
165
|
+
const { _buttonRowMinHeight: c } = this, w = c === void 0 ? void 0 : c * p.length + h, y = w !== void 0 && c !== void 0 && c >= b && w <= t + X;
|
|
166
|
+
this._buttonRowMinHeight = y ? c : b;
|
|
167
|
+
} else
|
|
168
|
+
this._buttonRowMinHeight = void 0;
|
|
169
|
+
this._buttonScale = v < a ? "s" : v < s ? "m" : "l", this._resizeAnimationFrame = void 0;
|
|
165
170
|
});
|
|
166
171
|
}
|
|
167
172
|
_getWarningMessage() {
|
|
@@ -186,37 +191,38 @@ class J extends L {
|
|
|
186
191
|
}
|
|
187
192
|
}
|
|
188
193
|
render() {
|
|
189
|
-
return
|
|
194
|
+
return d`<div aria-label=${this.messages.componentLabelAccessible ?? _} class=${f({
|
|
190
195
|
root: !0,
|
|
191
196
|
[z.widget]: !0,
|
|
192
197
|
[z.widgetDisabled]: this.viewModel.disabled
|
|
193
198
|
})} role=region>${this._renderContent()}</div>`;
|
|
194
199
|
}
|
|
195
200
|
_renderContent() {
|
|
196
|
-
const { headingLevel: e, messages:
|
|
197
|
-
return
|
|
198
|
-
"--weather-type-count": String(
|
|
199
|
-
|
|
201
|
+
const { headingLevel: e, messages: t, viewModel: i } = this, r = this._getWarningMessage(), n = i.current, a = i.state === "error";
|
|
202
|
+
return d`${this.hideHeader ? void 0 : j({ level: e, children: t.componentLabel })}${a ? d`<div>${this._getErrorMessage()}</div>` : void 0}<div class=${f(L({ content: !0, error: a }))}><div .ariaLabel=${t.weatherType} class="weather-type-selector" role=radiogroup style=${P({
|
|
203
|
+
"--weather-type-count": String(p.length),
|
|
204
|
+
"--button-row-min-height": M ? `${this._buttonRowMinHeight ?? 0}px` : void 0
|
|
205
|
+
})} ${F(this._makeWeatherTypeSelectorRef())}>${p.map(this._renderWeatherTypeButton, this)}</div>${Object.values(i.weatherByType).map((s) => d`<div class=${f({
|
|
200
206
|
options: !0,
|
|
201
207
|
hidden: s.type !== n?.type
|
|
202
208
|
})}>${this._renderOptions(s)}</div>`)}${r ? this._renderWarning(r) : void 0}</div>`;
|
|
203
209
|
}
|
|
204
210
|
_renderWeatherTypeButton(e) {
|
|
205
|
-
const
|
|
206
|
-
return
|
|
211
|
+
const t = this.messages[e]?.label ?? "", { disabled: i } = this.viewModel, r = !i && this.viewModel.current.type === e;
|
|
212
|
+
return d`<calcite-button role=radio .label=${t} .name=${t} .appearance=${r ? "solid" : "outline"} .ariaChecked=${r ? "true" : "false"} tabindex=${(r ? void 0 : -1) ?? _} .disabled=${i} .iconStart=${Q[e]} .kind=${r ? "brand" : "neutral"} width=full .scale=${this._buttonScale} @keydown=${(n) => {
|
|
207
213
|
const a = n.key;
|
|
208
|
-
let s = ["ArrowRight", "ArrowDown"],
|
|
214
|
+
let s = ["ArrowRight", "ArrowDown"], h = ["ArrowLeft", "ArrowUp"];
|
|
209
215
|
if (this.direction === "rtl") {
|
|
210
|
-
const
|
|
211
|
-
s =
|
|
216
|
+
const c = s;
|
|
217
|
+
s = h, h = c;
|
|
212
218
|
}
|
|
213
|
-
const
|
|
214
|
-
if (
|
|
219
|
+
const v = s.includes(a), b = h.includes(a);
|
|
220
|
+
if (v || b) {
|
|
215
221
|
n.preventDefault();
|
|
216
|
-
const
|
|
217
|
-
this.viewModel.setWeatherByType(
|
|
218
|
-
const
|
|
219
|
-
|
|
222
|
+
const c = p.indexOf(e), w = p.length, x = (c + (b ? -1 : 1) + w) % w;
|
|
223
|
+
this.viewModel.setWeatherByType(p[x]);
|
|
224
|
+
const C = n.currentTarget.parentElement?.parentElement;
|
|
225
|
+
C && Array.from(C.querySelectorAll("calcite-button") ?? [])[x]?.setFocus();
|
|
220
226
|
}
|
|
221
227
|
}} @click=${(n) => {
|
|
222
228
|
if (r)
|
|
@@ -226,7 +232,7 @@ class J extends L {
|
|
|
226
232
|
requestAnimationFrame(() => {
|
|
227
233
|
this.viewModel.current.type === e && a.setFocus();
|
|
228
234
|
});
|
|
229
|
-
}} title=${
|
|
235
|
+
}} title=${t ?? _}></calcite-button>`;
|
|
230
236
|
}
|
|
231
237
|
_renderOptions(e) {
|
|
232
238
|
switch (e.type) {
|
|
@@ -243,46 +249,46 @@ class J extends L {
|
|
|
243
249
|
}
|
|
244
250
|
}
|
|
245
251
|
_renderSunnyOptions(e) {
|
|
246
|
-
const
|
|
247
|
-
return
|
|
248
|
-
e.cloudCover =
|
|
252
|
+
const t = this.messages.sunny;
|
|
253
|
+
return m({ disabled: this.viewModel.disabled, ariaLabel: t?.cloudCoverAria, label: t?.cloudCover, value: e.cloudCover, onChange: (i) => {
|
|
254
|
+
e.cloudCover = i;
|
|
249
255
|
} });
|
|
250
256
|
}
|
|
251
257
|
_renderCloudyOptions(e) {
|
|
252
|
-
const
|
|
253
|
-
return
|
|
254
|
-
e.cloudCover =
|
|
258
|
+
const t = this.messages.cloudy;
|
|
259
|
+
return m({ disabled: this.viewModel.disabled, ariaLabel: t?.cloudCoverAria, label: t?.cloudCover, value: e.cloudCover, onChange: (i) => {
|
|
260
|
+
e.cloudCover = i;
|
|
255
261
|
} });
|
|
256
262
|
}
|
|
257
263
|
_renderRainyOptions(e) {
|
|
258
|
-
const { disabled:
|
|
259
|
-
return
|
|
264
|
+
const { disabled: t } = this.viewModel, i = this.messages.rainy;
|
|
265
|
+
return d`${m({ disabled: t, ariaLabel: i?.cloudCoverAria, label: i?.cloudCover, value: e.cloudCover, onChange: (r) => {
|
|
260
266
|
e.cloudCover = r;
|
|
261
|
-
} })}${
|
|
267
|
+
} })}${m({ disabled: t, ariaLabel: i?.precipitationAria, label: i?.precipitation, value: e.precipitation, onChange: (r) => {
|
|
262
268
|
e.precipitation = r;
|
|
263
269
|
} })}`;
|
|
264
270
|
}
|
|
265
271
|
_renderSnowyOptions(e) {
|
|
266
|
-
const { disabled:
|
|
267
|
-
return
|
|
272
|
+
const { disabled: t } = this.viewModel, i = this.messages.snowy;
|
|
273
|
+
return d`${m({ disabled: t, ariaLabel: i?.cloudCoverAria, label: i?.cloudCover, value: e.cloudCover, onChange: (r) => {
|
|
268
274
|
e.cloudCover = r;
|
|
269
|
-
} })}${
|
|
275
|
+
} })}${m({ disabled: t, ariaLabel: i?.precipitationAria, label: i?.precipitation, value: e.precipitation, onChange: (r) => {
|
|
270
276
|
e.precipitation = r;
|
|
271
|
-
} })}<calcite-label layout=inline title=${
|
|
277
|
+
} })}<calcite-label layout=inline title=${i?.snowCoverTooltip ?? _}><calcite-checkbox .checked=${e.snowCover === "enabled"} .disabled=${t} @calciteCheckboxChange=${(r) => {
|
|
272
278
|
this.viewModel.setSnowCoverEnabled(r.currentTarget.checked);
|
|
273
|
-
}}></calcite-checkbox>${
|
|
279
|
+
}}></calcite-checkbox>${i?.snowCover}</calcite-label>`;
|
|
274
280
|
}
|
|
275
281
|
_renderFoggyOptions(e) {
|
|
276
|
-
const
|
|
277
|
-
return
|
|
278
|
-
e.fogStrength =
|
|
282
|
+
const t = this.messages.foggy;
|
|
283
|
+
return m({ disabled: this.viewModel.disabled, ariaLabel: t?.fogStrengthAria, label: t?.fogStrength, value: e.fogStrength, onChange: (i) => {
|
|
284
|
+
e.fogStrength = i;
|
|
279
285
|
} });
|
|
280
286
|
}
|
|
281
287
|
_renderWarning(e) {
|
|
282
|
-
return
|
|
288
|
+
return d`<calcite-notice aria-live=polite open icon=exclamation-mark-triangle-f kind=warning><div slot=title class="warning-title">${this.messages.warningTitle}</div><div slot=message>${e}</div></calcite-notice>`;
|
|
283
289
|
}
|
|
284
290
|
}
|
|
285
|
-
|
|
291
|
+
O("arcgis-weather", Y);
|
|
286
292
|
export {
|
|
287
|
-
|
|
293
|
+
Y as ArcgisWeather
|
|
288
294
|
};
|