@arcgis/map-components 5.2.0-next.24 → 5.2.0-next.25
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/32XG4IQO.js +2 -0
- package/dist/cdn/5P3LF4QU.js +2 -0
- package/dist/cdn/7TE4BSW7.js +2 -0
- package/dist/cdn/{23VXN3VB.js → AASOO75T.js} +1 -1
- package/dist/cdn/B56MNMJP.js +2 -0
- package/dist/cdn/BXDVZQ2A.js +3 -0
- package/dist/cdn/DKG4Q4BC.js +2 -0
- package/dist/cdn/FWRUNJU5.js +2 -0
- package/dist/cdn/HUBIN764.js +2 -0
- package/dist/cdn/W67QMPVV.js +2 -0
- package/dist/cdn/XDKYOMSQ.js +2 -0
- package/dist/cdn/{6HLRQHTF.js → YKNC7IPO.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/keyboard-utils.js +15 -0
- package/dist/components/arcgis-basemap-gallery/customElement.js +33 -32
- package/dist/components/arcgis-editor/customElement.js +18 -6
- package/dist/components/arcgis-feature-media/customElement.js +45 -44
- package/dist/components/arcgis-features/customElement.js +26 -25
- package/dist/components/arcgis-features-next/customElement.js +22 -21
- package/dist/components/arcgis-floor-filter/customElement.js +3 -3
- package/dist/components/arcgis-navigation-toggle/customElement.js +45 -26
- package/dist/components/arcgis-navigation-toggle/index.js +1 -0
- package/dist/components/arcgis-paste/PasteViewModel.d.ts +3 -1
- package/dist/components/arcgis-paste/customElement.d.ts +6 -0
- package/dist/components/arcgis-paste/customElement.js +9 -6
- package/dist/components/arcgis-popup/customElement.d.ts +2 -3
- package/dist/components/arcgis-popup/customElement.js +27 -27
- package/dist/components/arcgis-sketch/customElement.d.ts +16 -1
- package/dist/components/arcgis-sketch/customElement.js +25 -19
- package/dist/components/arcgis-weather/customElement.js +105 -110
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +3 -3
- package/dist/types/lumina.d.ts +2 -1
- package/dist/types/preact.d.ts +2 -1
- package/dist/types/react.d.ts +2 -1
- package/dist/types/stencil.d.ts +2 -1
- package/package.json +4 -4
- package/dist/cdn/6LACZH6O.js +0 -2
- package/dist/cdn/GQF32YL2.js +0 -2
- package/dist/cdn/HTCDJDRI.js +0 -2
- package/dist/cdn/I6IJUCE6.js +0 -2
- package/dist/cdn/IHDXJ4C3.js +0 -2
- package/dist/cdn/IJZYN6XT.js +0 -2
- package/dist/cdn/IYEZB6EU.js +0 -2
- package/dist/cdn/PKBVONJW.js +0 -3
- package/dist/cdn/VRWFDVP6.js +0 -2
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { c as o } from "../../chunks/runtime.js";
|
|
3
|
-
import { dismissFloatingElements as l, setCustomTools as n, setGroupAllowCollapse as r } from "@arcgis/core/applications/ExperienceBuilder/sketchUtils.js";
|
|
4
|
-
import { usePropertyChange as
|
|
5
|
-
import { reEmitEvent as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { LitElement as
|
|
9
|
-
import { m as
|
|
10
|
-
import { css as
|
|
11
|
-
import { watch as
|
|
12
|
-
const
|
|
13
|
-
class
|
|
3
|
+
import { dismissFloatingElements as l, setCustomTools as n, setGroupAllowCollapse as r, setContextualToolLocation as a, setGroupCollapsePriorities as c } from "@arcgis/core/applications/ExperienceBuilder/sketchUtils.js";
|
|
4
|
+
import { usePropertyChange as p } from "@arcgis/lumina/controllers";
|
|
5
|
+
import { reEmitEvent as i } from "@arcgis/lumina/controllers/accessor";
|
|
6
|
+
import d from "@arcgis/core/layers/GraphicsLayer.js";
|
|
7
|
+
import h from "@arcgis/core/widgets/Sketch.js";
|
|
8
|
+
import { LitElement as g, createEvent as m } from "@arcgis/lumina";
|
|
9
|
+
import { m as b } from "../../chunks/useWidget.js";
|
|
10
|
+
import { css as u } from "lit";
|
|
11
|
+
import { watch as w } from "@arcgis/core/core/reactiveUtils.js";
|
|
12
|
+
const v = u`calcite-block>.esri-grid-controls{background:0 0;padding:0}.esri-grid-controls{-webkit-user-select:none;user-select:none;padding:var(--arcgis-internal-padding);flex-flow:column wrap;display:flex;calcite-label.esri-labeled-switch__label{margin-block-end:var(--calcite-spacing-sm, .5rem)}}.esri-grid-controls__switch--bordered{border-width:0 0 var(--calcite-spacing-px) 0;border-style:solid;border-color:var(--calcite-color-border-1)}.esri-grid-controls__container{gap:var(--calcite-spacing-sm);flex-direction:column;flex:auto;display:flex}.esri-grid-controls__tilegroup{column-gap:var(--calcite-spacing-sm);align-items:start;display:flex;flex-wrap:wrap}.esri-grid-controls__tile__content{row-gap:var(--calcite-spacing-md);padding:var(--calcite-spacing-md);color:var(--calcite-color-text-2);flex-direction:column;align-items:center;display:flex}.esri-grid-controls__tile__content calcite-label{margin-bottom:calc(0px - var(--calcite-label-margin-bottom, .75rem));font-weight:var(--calcite-font-weight-medium)}.esri-grid-controls__tile{position:relative}.esri-grid-controls__tile:focus-within{outline:2px solid var(--calcite-color-brand);outline-offset:2px}.esri-grid-controls__tile--disabled{opacity:var(--calcite-opacity-disabled)}.esri-grid-controls__tile input[type=radio]{appearance:none;opacity:.001;border:var(--calcite-spacing-px) solid transparent;cursor:pointer;position:absolute;inset:0}.esri-grid-controls__tile input[type=radio]:checked+.esri-grid-controls__tile__content{border:var(--calcite-spacing-px) solid var(--calcite-color-brand)}.esri-grid-controls__tile input[type=radio]+.esri-grid-controls__tile__content{border:var(--calcite-spacing-px) solid transparent}.esri-grid-controls__numeric-inputs__container{gap:var(--calcite-spacing-sm);grid-auto-columns:1fr;grid-auto-flow:column;display:grid}.esri-grid-controls__inline-icon{margin-left:var(--calcite-spacing-xs);vertical-align:top;color:var(--calcite-color-status-warning)}:host{--response-toolbar-vert-width: 0;--response-toolbar-vert-height: 100%;--response-toolbar-horiz-width: 100%;--response-toolbar-horiz-height: 0}.esri-responsive-toolbar__ruler{opacity:0;pointer-events:none;position:absolute}.esri-responsive-toolbar__ruler--bar{visibility:hidden;height:0;display:block;position:absolute;top:0;left:0;right:0}.esri-responsive-toolbar__ruler--bar--vertical,.esri-responsive-toolbar__ruler--pad--vertical{width:var(--response-toolbar-vert-width);height:var(--response-toolbar-vert-height)}.esri-responsive-toolbar__ruler--pad--horizontal{width:var(--response-toolbar-horiz-width);height:var(--response-toolbar-horiz-height)}.esri-responsive-toolbar__bar>div{display:contents}.esri-responsive-toolbar__bar--horizontal{min-width:100%}.esri-responsive-toolbar__bar--vertical{min-height:100%}.esri-responsive-toolbar__pad{width:min-content;display:contents}.esri-responsive-toolbar__pad>div{display:contents}.esri-responsive-toolbar__ruler--pad--vertical{width:0;height:min(100vh - 120px,100cqh - 120px)}.esri-responsive-toolbar__ruler--pad--horizontal{width:min(100vw - 60px,100cqw - 60px);height:0}.esri-split-button--split-part--vertical--s{--calcite-size-sm: 16px;max-height:16px}.esri-split-button--split-part--vertical--m{--calcite-size-md: 24px;max-height:24px}.esri-split-button--split-part--vertical--l{--calcite-size-l: 40px;max-height:40px}.esri-split-button--split-part--horizontal--s,.esri-split-button--split-part--horizontal--m{max-width:16px}.esri-split-button--split-part--horizontal--l{max-width:24px}.esri-snapping-controls__toggle-block{min-width:100%;margin:0}.esri-snapping-controls__layer-list-block{border-bottom:none;min-width:225px}.esri-snapping-controls__layer-list-block[open]{margin-block:0}.esri-snapping-controls__layer-list{overflow:auto}.esri-snapping-controls__layer-list__filter{margin-bottom:10px}.esri-snapping-controls__layer-list__button{margin-bottom:6px}.esri-snapping-controls__layer-list__item calcite-accordion-item calcite-icon,.esri-snapping-controls__layer-list__item calcite-action calcite-icon{margin-inline-start:0}.esri-snapping-controls__layer-list__item calcite-icon{color:var(--calcite-color-brand);margin-inline-start:var(--calcite-list-item-spacing-indent, 1em)}.esri-snapping-controls{flex-flow:column wrap;display:flex}.esri-snapping-controls__container{flex-direction:column;flex:auto;display:flex}.esri-snapping-controls__container :only-child{border-block-end:none}.esri-snapping-controls__panel{width:320px}.esri-snapping-controls__item{border:1px solid #adadad4d;cursor:pointer;background-color:var(--calcite-color-foreground-2);border-color:var(--calcite-color-border-1);border-radius:2px;justify-content:space-between;margin:3px 0;padding:3px;transition:border-color .125s ease-in-out;display:flex;box-shadow:0 1px #adadad4d}.esri-snapping-controls__item-action-icon{flex:0 0 16px;width:16px;height:16px;margin-top:.1em;font-size:var(--calcite-font-size-md);display:inline-block}.esri-snapping-controls__action-toggle{opacity:1;cursor:pointer;border:1px solid var(--calcite-color-border-1);flex-flow:row-reverse;justify-content:space-between;align-items:flex-start;width:100%;margin:0;padding:6px 15px;font-size:var(--calcite-font-size-sm);transition:opacity .25s ease-in-out .25s,background-color .25s ease-in-out;display:flex}.esri-snapping-controls__action-toggle .esri-snapping-controls__item-action-title{margin-left:0}.esri-snapping-controls__action-toggle .esri-snapping-controls__item-action-icon{background-color:var(--calcite-color-foreground-1);border-radius:16px;flex:0 0 28px;width:16px;height:16px;padding:0;transition:background-color .125s ease-in-out;position:relative;overflow:hidden;box-shadow:0 0 0 1px #adadad}.esri-snapping-controls__action-toggle .esri-snapping-controls__item-action-icon:before{content:"";background-color:var(--calcite-color-foreground-2);border-radius:100%;width:12px;height:12px;margin:2px;transition:background-color .125s ease-in-out,left .125s ease-in-out;display:block;position:absolute;top:0;left:0;box-shadow:0 0 0 1px #242424}.esri-snapping-controls__action-toggle--on .esri-snapping-controls__item-action-icon{background-color:var(--calcite-color-foreground-1);box-shadow:0 0 0 1px #adadad}.esri-snapping-controls__action-toggle--on .esri-snapping-controls__item-action-icon:before{background-color:var(--calcite-color-foreground-3);left:12px}.esri-snapping-controls__nested-container{flex-direction:column;gap:6px;display:flex}.esri-snapping-controls__nested-container:not(:empty){padding-top:6px;padding-inline-start:1em}.esri-labeled-switch__label{--calcite-label-margin-bottom: 0}.esri-labeled-switch__label-content{text-wrap:balance;flex:1;align-items:center;gap:7px;display:flex}.esri-labeled-switch__label-content>div{flex-grow:1}.esri-labeled-switch__icon{margin-top:-1px}.esri-labeled-switch__icon_info{color:var(--calcite-color-status-info)}.esri-labeled-switch__icon_warning{color:var(--calcite-color-status-warning)}.esri-labeled-switch__tooltip{text-wrap:wrap}:host{display:flex;max-width:100%;justify-content:flex-end;pointer-events:none;--sketch-pad-flex-flow: wrap;--sketch-view-height-offset: 63px ;--sketch-view-margin-offset: 30px;--sketch-popover-header-offset: 49px}:host([scale="s"]){--sketch-view-height-offset: 47px ;--sketch-view-margin-offset: 30px;--sketch-popover-header-offset: 33px}:host([scale="l"]){--sketch-view-height-offset: 79px ;--sketch-view-margin-offset: 30px;--sketch-popover-header-offset: 65px}div:has(>.esri-sketch){display:contents}.esri-sketch{-webkit-user-select:none;user-select:none;pointer-events:none;display:flex}.esri-sketch-pad{gap:var(--arcgis-internal-sketch-gap, var(--calcite-spacing-sm));flex-flow:var(--sketch-pad-flex-flow);justify-content:var(--arcgis-internal-sketch-justify-content, flex-start)}.esri-sketch-pad:dir(rtl){flex-flow:row-reverse wrap}.esri-sketch-pad.esri-sketch--vertical{flex-flow:var(--sketch-pad-flex-flow, column wrap);justify-content:flex-start;--sketch-view-height-offset: 30px;--sketch-view-margin-offset: 15px}.esri-sketch-pad.esri-sketch--vertical:dir(rtl){flex-flow:var(--sketch-pad-flex-flow, column wrap-reverse)}.esri-sketch-pad.esri-sketch--vertical .esri-selection-toolbar__container{flex-direction:column}.esri-sketch>*{pointer-events:initial;display:flex}.esri-sketch-bar{flex-direction:column;gap:0;margin:0;flex-basis:100%}.esri-sketch-bar.esri-sketch--vertical{flex-flow:row}.esri-sketch__popover-wrapper{inline-size:max-content;min-inline-size:300px;max-height:calc(100cqh - (var(--sketch-view-height-offset, 90px)) - var(--sketch-view-margin-offset, 15px) - var(--sketch-popover-header-offset, 1000px));-webkit-user-select:none;user-select:none;max-inline-size:400px;overflow-y:auto}.esri-sketch__popover-wrapper .esri-sketch-tooltip-controls:not(:only-child) calcite-block{border-block-end-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.esri-sketch__selection-count-chip--horizontal{margin-block:var(--calcite-spacing-xxs);margin-inline:var(--calcite-spacing-xs);align-self:center}.esri-sketch__selection-count-chip--vertical{margin-block:calc(var(--calcite-spacing-md) * var(--sketch-chip-margin-scale-factor, 1));scale:var(--sketch-chip-rescale, 1);align-self:center;margin-inline:0}.esri-sketch__selection-count-chip--vertical--s{--sketch-chip-rescale: .8;--sketch-chip-margin-scale-factor: .5}.esri-sketch--vertical{max-height:min(100vh - 120px,100cqh - 120px)}.esri-expand__popover-content .esri-sketch{gap:0}.esri-sketch-tooltip-controls{flex-flow:column wrap;min-width:100%;display:flex}.esri-sketch-tooltip-controls__block{border-block-end:none;margin:0}.esri-sketch-tooltip-controls__block-content{flex-direction:column;gap:6px;display:flex}.esri-sketch-tooltip-controls__radio-button-label-wrapper{align-items:center;gap:2px;display:flex}.esri-sketch-tooltip-controls calcite-label:last-child{--calcite-label-margin-bottom: 0}`, _ = b(h);
|
|
13
|
+
class f extends g {
|
|
14
14
|
constructor() {
|
|
15
|
-
super(), this._visualScale = "m", this.widget =
|
|
15
|
+
super(), this._visualScale = "m", this.widget = _(this), this.viewModel = this.widget.viewModel, this._defaultGraphicsLayer = null, this.view = this.widget.view, this.activeTool = this.widget.activeTool, this.autoDestroyDisabled = !1, this.availableCreateTools = this.widget.availableCreateTools, this.createGraphic = this.widget.createGraphic, this.creationMode = this.widget.creationMode, this.defaultCreateOptions = this.widget.defaultCreateOptions, this.defaultGraphicsLayerDisabled = !1, this.defaultUpdateOptions = this.widget.defaultUpdateOptions, this.hideCreateToolsCircle = this.widget.visibleElements.createTools.circle, this.hideCreateToolsMultipoint = this.widget.visibleElements.createTools.multipoint, this.hideCreateToolsPoint = this.widget.visibleElements.createTools.point, this.hideCreateToolsPolygon = this.widget.visibleElements.createTools.polygon, this.hideCreateToolsPolyline = this.widget.visibleElements.createTools.polyline, this.hideCreateToolsRectangle = this.widget.visibleElements.createTools.rectangle, this.hideDuplicateButton = this.widget.visibleElements.duplicateButton, this.hideDeleteButton = this.widget.visibleElements.deleteButton, this.hideSelectionCountLabel = this.widget.visibleElements.selectionCountLabel, this.hideLabelsToggle = this.widget.visibleElements.labelsToggle, this.hideSelectionToolsLassoSelection = this.widget.visibleElements.selectionTools["lasso-selection"], this.hideSelectionToolsRectangleSelection = this.widget.visibleElements.selectionTools["rectangle-selection"], this.hideSettingsMenu = this.widget.visibleElements.settingsMenu, this.hideSnappingControls = this.widget.visibleElements.snappingControls, this.hideSnappingControlsElementsEnabledToggle = this.widget.visibleElements.snappingControlsElements.enabledToggle, this.hideSnappingControlsElementsFeatureEnabledToggle = this.widget.visibleElements.snappingControlsElements.featureEnabledToggle, this.hideSnappingControlsElementsLayerList = this.widget.visibleElements.snappingControlsElements.layerList, this.hideSnappingControlsElementsSelfEnabledToggle = this.widget.visibleElements.snappingControlsElements.selfEnabledToggle, this.hideSnappingControlsElementsGridEnabledToggle = this.widget.visibleElements.snappingControlsElements.gridEnabledToggle, this.hideSnappingControlsElementsGridControls = this.widget.visibleElements.snappingControlsElements.gridControls, this.hideSnappingControlsElementsGridControlsElementsColorSelection = this.widget.visibleElements.snappingControlsElements.gridControlsElements.colorSelection, this.hideSnappingControlsElementsGridControlsElementsDynamicScaleToggle = this.widget.visibleElements.snappingControlsElements.gridControlsElements.dynamicScaleToggle, this.hideSnappingControlsElementsGridControlsElementsLineIntervalInput = this.widget.visibleElements.snappingControlsElements.gridControlsElements.lineIntervalInput, this.hideSnappingControlsElementsGridControlsElementsNumericInputs = this.widget.visibleElements.snappingControlsElements.gridControlsElements.numericInputs, this.hideSnappingControlsElementsGridControlsElementsOutOfScaleWarning = this.widget.visibleElements.snappingControlsElements.gridControlsElements.outOfScaleWarning, this.hideSnappingControlsElementsGridControlsElementsPlacementButtons = this.widget.visibleElements.snappingControlsElements.gridControlsElements.placementButtons, this.hideSnappingControlsElementsGridControlsElementsRotateWithMapToggle = this.widget.visibleElements.snappingControlsElements.gridControlsElements.rotateWithMapToggle, this.hideTooltipsToggle = this.widget.visibleElements.tooltipsToggle, this.hideUndoRedoMenu = this.widget.visibleElements.undoRedoMenu, this.icon = this.widget.icon, this.label = this.widget.label, this.labelOptions = this.widget.labelOptions, this.layer = this.widget.layer, this.layout = this.widget.layout, this.pointSymbol = this.viewModel.pointSymbol, this.polygonSymbol = this.viewModel.polygonSymbol, this.polylineSymbol = this.viewModel.polylineSymbol, this.showSnappingControlsElementsHeader = this.widget.visibleElements.snappingControlsElements.header, this.showCreateToolsFreehandPolygon = this.widget.visibleElements.createTools.freehandPolygon, this.showCreateToolsFreehandPolyline = this.widget.visibleElements.createTools.freehandPolyline, this.showCreateToolsText = this.widget.visibleElements.createTools.text, this.snappingOptions = this.widget.snappingOptions, this.state = this.widget.state, this.textSymbol = this.viewModel.textSymbol, this.toolbarKind = this.widget.toolbarKind, this.tooltipOptions = this.widget.tooltipOptions, this.useLegacyCreateTools = this.viewModel.useLegacyCreateTools, this.updateOnGraphicClickDisabled = this.viewModel.updateOnGraphicClick, this.updateGraphics = this.widget.updateGraphics, this.arcgisCreate = i(() => this.widget, "create"), this.arcgisDelete = i(() => this.widget, "delete"), this.arcgisPropertyChange = p()("state"), this.arcgisReady = m(), this.arcgisRedo = i(() => this.widget, "redo"), this.arcgisUndo = i(() => this.widget, "undo"), this.arcgisUpdate = i(() => this.widget, "update"), this.arcgisDuplicate = i(() => this.widget, "duplicate"), this.listen("arcgisReady", this._arcgisReadyHandler);
|
|
16
16
|
}
|
|
17
17
|
static {
|
|
18
18
|
this.properties = { view: 0, activeTool: 35, autoDestroyDisabled: 5, availableCreateTools: 0, createGraphic: 32, creationMode: 1, defaultCreateOptions: 0, defaultGraphicsLayerDisabled: 5, defaultUpdateOptions: 0, hideCreateToolsCircle: 5, hideCreateToolsMultipoint: 5, hideCreateToolsPoint: 5, hideCreateToolsPolygon: 5, hideCreateToolsPolyline: 5, hideCreateToolsRectangle: 5, hideDuplicateButton: 5, hideDeleteButton: 5, hideSelectionCountLabel: 5, hideLabelsToggle: 5, hideSelectionToolsLassoSelection: 5, hideSelectionToolsRectangleSelection: 5, hideSettingsMenu: 5, hideSnappingControls: 5, hideSnappingControlsElementsEnabledToggle: 5, hideSnappingControlsElementsFeatureEnabledToggle: 5, hideSnappingControlsElementsLayerList: 5, hideSnappingControlsElementsSelfEnabledToggle: 5, hideSnappingControlsElementsGridEnabledToggle: 5, hideSnappingControlsElementsGridControls: 5, hideSnappingControlsElementsGridControlsElementsColorSelection: 5, hideSnappingControlsElementsGridControlsElementsDynamicScaleToggle: 5, hideSnappingControlsElementsGridControlsElementsLineIntervalInput: 5, hideSnappingControlsElementsGridControlsElementsNumericInputs: 5, hideSnappingControlsElementsGridControlsElementsOutOfScaleWarning: 5, hideSnappingControlsElementsGridControlsElementsPlacementButtons: 5, hideSnappingControlsElementsGridControlsElementsRotateWithMapToggle: 5, hideTooltipsToggle: 5, hideUndoRedoMenu: 5, icon: 1, label: 1, labelOptions: 0, layer: 0, layout: 1, pointSymbol: 0, polygonSymbol: 0, polylineSymbol: 0, referenceElement: 1, scale: 1, visualScale: 1, showSnappingControlsElementsHeader: 5, showCreateToolsFreehandPolygon: 5, showCreateToolsFreehandPolyline: 5, showCreateToolsText: 5, snappingOptions: 0, state: 32, textSymbol: 0, toolbarKind: 1, tooltipOptions: 0, useLegacyCreateTools: 5, updateOnGraphicClickDisabled: 5, updateGraphics: 32 };
|
|
19
19
|
}
|
|
20
20
|
static {
|
|
21
|
-
this.styles =
|
|
21
|
+
this.styles = v;
|
|
22
22
|
}
|
|
23
23
|
get scale() {
|
|
24
24
|
return this._visualScale;
|
|
@@ -62,6 +62,12 @@ class v extends d {
|
|
|
62
62
|
async setGroupAllowCollapseOptions(e) {
|
|
63
63
|
r(this.widget, e);
|
|
64
64
|
}
|
|
65
|
+
async setContextualToolLocation(e) {
|
|
66
|
+
a(this.widget, e);
|
|
67
|
+
}
|
|
68
|
+
async setGroupCollapsePriorities(e) {
|
|
69
|
+
c(this.widget, e);
|
|
70
|
+
}
|
|
65
71
|
async triggerUpdate(e, t) {
|
|
66
72
|
this.widget?.update(e, t);
|
|
67
73
|
}
|
|
@@ -69,7 +75,7 @@ class v extends d {
|
|
|
69
75
|
this.widget?.undo();
|
|
70
76
|
}
|
|
71
77
|
_arcgisReadyHandler() {
|
|
72
|
-
this.defaultGraphicsLayerDisabled || (this._defaultGraphicsLayer = new
|
|
78
|
+
this.defaultGraphicsLayerDisabled || (this._defaultGraphicsLayer = new d({ title: "Sketch Layer" }), this.widget.availableCreateTools = [
|
|
73
79
|
"point",
|
|
74
80
|
"polyline",
|
|
75
81
|
"freehandPolyline",
|
|
@@ -77,15 +83,15 @@ class v extends d {
|
|
|
77
83
|
"freehandPolygon",
|
|
78
84
|
"rectangle",
|
|
79
85
|
"circle"
|
|
80
|
-
], this.widget.layer = this._defaultGraphicsLayer, this.el.view?.map?.add(this.widget.layer), this.manager.onLifecycle(() =>
|
|
81
|
-
const
|
|
82
|
-
!
|
|
86
|
+
], this.widget.layer = this._defaultGraphicsLayer, this.el.view?.map?.add(this.widget.layer), this.manager.onLifecycle(() => w(() => this.el.view?.map, (e, t) => {
|
|
87
|
+
const s = this._defaultGraphicsLayer;
|
|
88
|
+
!s || this.widget.layer !== s || (t?.allLayers.includes(s) && t.remove(s), e?.add(s));
|
|
83
89
|
})), this.manager.onDestroy(() => {
|
|
84
90
|
this._defaultGraphicsLayer && this.el.view?.map?.allLayers.includes(this._defaultGraphicsLayer) && this.el.view?.map?.remove(this._defaultGraphicsLayer), this._defaultGraphicsLayer?.destroy(), this._defaultGraphicsLayer = null;
|
|
85
91
|
}));
|
|
86
92
|
}
|
|
87
93
|
}
|
|
88
|
-
o("arcgis-sketch",
|
|
94
|
+
o("arcgis-sketch", f);
|
|
89
95
|
export {
|
|
90
|
-
|
|
96
|
+
f as ArcgisSketch
|
|
91
97
|
};
|
|
@@ -1,51 +1,52 @@
|
|
|
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
|
|
11
|
-
import { g as
|
|
12
|
-
import
|
|
13
|
-
import { property as
|
|
14
|
-
import { watch as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
import { c as A } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as T, html as c } from "lit";
|
|
4
|
+
import { ref as O } from "lit/directives/ref.js";
|
|
5
|
+
import { useDirection as W, usePropertyChange as F } from "@arcgis/lumina/controllers";
|
|
6
|
+
import { classes as B } from "@arcgis/toolkit/dom";
|
|
7
|
+
import { LitElement as R, createEvent as E, nothing as f, safeClassMap as y, safeStyleMap as L } from "@arcgis/lumina";
|
|
8
|
+
import { u as H } from "../../chunks/useT9n.js";
|
|
9
|
+
import { m as P } from "../../chunks/useViewModel.js";
|
|
10
|
+
import { H as V } from "../../chunks/heading.js";
|
|
11
|
+
import { g as x } from "../../chunks/globalCss.js";
|
|
12
|
+
import j from "@arcgis/core/core/Accessor.js";
|
|
13
|
+
import { property as h, subclass as D } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
14
|
+
import { watch as I } from "@arcgis/core/core/reactiveUtils.js";
|
|
15
|
+
import z from "@arcgis/core/views/3d/environment/CloudyWeather.js";
|
|
16
|
+
import M from "@arcgis/core/views/3d/environment/FoggyWeather.js";
|
|
17
|
+
import S from "@arcgis/core/views/3d/environment/RainyWeather.js";
|
|
18
|
+
import $ from "@arcgis/core/views/3d/environment/SnowyWeather.js";
|
|
19
|
+
import k from "@arcgis/core/views/3d/environment/SunnyWeather.js";
|
|
20
|
+
import { b as K, a as N } from "../../chunks/keyboard-utils.js";
|
|
21
|
+
const q = T`.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}`;
|
|
22
|
+
var G = Object.defineProperty, Z = Object.getOwnPropertyDescriptor, d = (o, e, t, i) => {
|
|
22
23
|
for (var r = i > 1 ? void 0 : i ? Z(e, t) : e, n = o.length - 1, a; n >= 0; n--)
|
|
23
24
|
(a = o[n]) && (r = (i ? a(e, t, r) : a(r)) || r);
|
|
24
25
|
return i && r && G(e, t, r), r;
|
|
25
26
|
};
|
|
26
|
-
const
|
|
27
|
-
sunny:
|
|
28
|
-
cloudy:
|
|
29
|
-
rainy:
|
|
30
|
-
snowy:
|
|
31
|
-
foggy:
|
|
32
|
-
},
|
|
33
|
-
let
|
|
27
|
+
const J = {
|
|
28
|
+
sunny: k,
|
|
29
|
+
cloudy: z,
|
|
30
|
+
rainy: S,
|
|
31
|
+
snowy: $,
|
|
32
|
+
foggy: M
|
|
33
|
+
}, g = Object.keys(J);
|
|
34
|
+
let s = class extends j {
|
|
34
35
|
//#region Lifecycle
|
|
35
36
|
constructor(o) {
|
|
36
37
|
super(o), this._settingWeather = !1, this._weatherByType = {
|
|
37
|
-
sunny: new
|
|
38
|
-
cloudy: new
|
|
39
|
-
rainy: new
|
|
40
|
-
snowy: new
|
|
41
|
-
foggy: new
|
|
38
|
+
sunny: new k(),
|
|
39
|
+
cloudy: new z(),
|
|
40
|
+
rainy: new S(),
|
|
41
|
+
snowy: new $(),
|
|
42
|
+
foggy: new M()
|
|
42
43
|
};
|
|
43
44
|
}
|
|
44
45
|
initialize() {
|
|
45
46
|
this.addHandles([
|
|
46
47
|
// When the weather is changed directly in the environment (not in the VM),
|
|
47
48
|
// we need to update the corresponding weather instance in the view model.
|
|
48
|
-
|
|
49
|
+
I(
|
|
49
50
|
() => this.current,
|
|
50
51
|
(o) => {
|
|
51
52
|
this._settingWeather || o == null || (this._weatherByType = {
|
|
@@ -93,59 +94,59 @@ let l = class extends I {
|
|
|
93
94
|
}
|
|
94
95
|
//#endregion
|
|
95
96
|
};
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
],
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
],
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
],
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
],
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
],
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
],
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
],
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
],
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
],
|
|
123
|
-
function
|
|
124
|
-
const n = (
|
|
125
|
-
const
|
|
126
|
-
r?.(
|
|
97
|
+
d([
|
|
98
|
+
h()
|
|
99
|
+
], s.prototype, "view", 2);
|
|
100
|
+
d([
|
|
101
|
+
h()
|
|
102
|
+
], s.prototype, "state", 1);
|
|
103
|
+
d([
|
|
104
|
+
h()
|
|
105
|
+
], s.prototype, "disabled", 1);
|
|
106
|
+
d([
|
|
107
|
+
h()
|
|
108
|
+
], s.prototype, "weatherByType", 1);
|
|
109
|
+
d([
|
|
110
|
+
h()
|
|
111
|
+
], s.prototype, "error", 1);
|
|
112
|
+
d([
|
|
113
|
+
h()
|
|
114
|
+
], s.prototype, "current", 1);
|
|
115
|
+
d([
|
|
116
|
+
h()
|
|
117
|
+
], s.prototype, "_weatherByType", 2);
|
|
118
|
+
d([
|
|
119
|
+
h()
|
|
120
|
+
], s.prototype, "_environment", 1);
|
|
121
|
+
s = d([
|
|
122
|
+
D("components.weather.WeatherViewModel")
|
|
123
|
+
], s);
|
|
124
|
+
function u({ label: o, ariaLabel: e, value: t, disabled: i, onChange: r }) {
|
|
125
|
+
const n = (l) => {
|
|
126
|
+
const p = l.currentTarget.value;
|
|
127
|
+
r?.(p ?? 0);
|
|
127
128
|
};
|
|
128
|
-
return
|
|
129
|
+
return c`<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
130
|
}
|
|
130
|
-
const
|
|
131
|
+
const Q = P(s), U = {
|
|
131
132
|
sunny: "brightness",
|
|
132
133
|
cloudy: "partly-cloudy",
|
|
133
134
|
rainy: "rain",
|
|
134
135
|
snowy: "snow",
|
|
135
136
|
foggy: "fog"
|
|
136
|
-
}, X = 16,
|
|
137
|
-
class Y extends
|
|
137
|
+
}, X = 16, C = 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");
|
|
138
|
+
class Y extends R {
|
|
138
139
|
constructor() {
|
|
139
|
-
super(...arguments), this.viewModel =
|
|
140
|
+
super(...arguments), this.viewModel = Q(this), this.messages = H(), this._direction = W(), this._resizeAnimationFrame = void 0, this._weatherTypeSelector = void 0, this._resizeObserver = new ResizeObserver((e) => {
|
|
140
141
|
for (const t of e)
|
|
141
142
|
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 =
|
|
143
|
+
}), 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 = F()("state"), this.arcgisReady = E();
|
|
143
144
|
}
|
|
144
145
|
static {
|
|
145
146
|
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
147
|
}
|
|
147
148
|
static {
|
|
148
|
-
this.styles =
|
|
149
|
+
this.styles = q;
|
|
149
150
|
}
|
|
150
151
|
async destroy() {
|
|
151
152
|
this._cleanupResizeObserver(), await this.manager.destroy();
|
|
@@ -160,13 +161,13 @@ class Y extends E {
|
|
|
160
161
|
}
|
|
161
162
|
_updateButtonScale(e, t) {
|
|
162
163
|
this._resizeAnimationFrame && cancelAnimationFrame(this._resizeAnimationFrame), this._resizeAnimationFrame = requestAnimationFrame(() => {
|
|
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")),
|
|
164
|
-
if (
|
|
165
|
-
const { _buttonRowMinHeight:
|
|
166
|
-
this._buttonRowMinHeight =
|
|
164
|
+
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")), l = Number.parseFloat(i.getPropertyValue("--button-size-m-max")), p = (g.length - 1) * r, v = Math.max(n, Math.min((t - p) / g.length, l)), b = Math.floor(v);
|
|
165
|
+
if (C) {
|
|
166
|
+
const { _buttonRowMinHeight: m } = this, w = m === void 0 ? void 0 : m * g.length + p, _ = w !== void 0 && m !== void 0 && m >= b && w <= t + X;
|
|
167
|
+
this._buttonRowMinHeight = _ ? m : b;
|
|
167
168
|
} else
|
|
168
169
|
this._buttonRowMinHeight = void 0;
|
|
169
|
-
this._buttonScale = v < a ? "s" : v <
|
|
170
|
+
this._buttonScale = v < a ? "s" : v < l ? "m" : "l", this._resizeAnimationFrame = void 0;
|
|
170
171
|
});
|
|
171
172
|
}
|
|
172
173
|
_getWarningMessage() {
|
|
@@ -191,38 +192,32 @@ class Y extends E {
|
|
|
191
192
|
}
|
|
192
193
|
}
|
|
193
194
|
render() {
|
|
194
|
-
return
|
|
195
|
+
return c`<div aria-label=${this.messages.componentLabelAccessible ?? f} class=${y({
|
|
195
196
|
root: !0,
|
|
196
|
-
[
|
|
197
|
-
[
|
|
197
|
+
[x.widget]: !0,
|
|
198
|
+
[x.widgetDisabled]: this.viewModel.disabled
|
|
198
199
|
})} role=region>${this._renderContent()}</div>`;
|
|
199
200
|
}
|
|
200
201
|
_renderContent() {
|
|
201
202
|
const { headingLevel: e, messages: t, viewModel: i } = this, r = this._getWarningMessage(), n = i.current, a = i.state === "error";
|
|
202
|
-
return
|
|
203
|
-
"--weather-type-count": String(
|
|
204
|
-
"--button-row-min-height":
|
|
205
|
-
})} ${
|
|
203
|
+
return c`${this.hideHeader ? void 0 : V({ level: e, children: t.componentLabel })}${a ? c`<div>${this._getErrorMessage()}</div>` : void 0}<div class=${y(B({ content: !0, error: a }))}><div .ariaLabel=${t.weatherType} class="weather-type-selector" role=radiogroup style=${L({
|
|
204
|
+
"--weather-type-count": String(g.length),
|
|
205
|
+
"--button-row-min-height": C ? `${this._buttonRowMinHeight ?? 0}px` : void 0
|
|
206
|
+
})} ${O(this._makeWeatherTypeSelectorRef())}>${g.map(this._renderWeatherTypeButton, this)}</div>${Object.values(i.weatherByType).map((l) => c`<div class=${y({
|
|
206
207
|
options: !0,
|
|
207
|
-
hidden:
|
|
208
|
-
})}>${this._renderOptions(
|
|
208
|
+
hidden: l.type !== n?.type
|
|
209
|
+
})}>${this._renderOptions(l)}</div>`)}${r ? this._renderWarning(r) : void 0}</div>`;
|
|
209
210
|
}
|
|
210
211
|
_renderWeatherTypeButton(e) {
|
|
211
212
|
const t = this.messages[e]?.label ?? "", { disabled: i } = this.viewModel, r = !i && this.viewModel.current.type === e;
|
|
212
|
-
return
|
|
213
|
-
const a = n.key;
|
|
214
|
-
|
|
215
|
-
if (this.direction === "rtl") {
|
|
216
|
-
const c = s;
|
|
217
|
-
s = h, h = c;
|
|
218
|
-
}
|
|
219
|
-
const v = s.includes(a), b = h.includes(a);
|
|
220
|
-
if (v || b) {
|
|
213
|
+
return c`<calcite-button role=radio .label=${t} .name=${t} .appearance=${r ? "solid" : "outline"} .ariaChecked=${r ? "true" : "false"} tabindex=${(r ? void 0 : -1) ?? f} .disabled=${i} .iconStart=${U[e]} .kind=${r ? "brand" : "neutral"} width=full .scale=${this._buttonScale} @keydown=${(n) => {
|
|
214
|
+
const a = n.key, l = K(a, this._direction), p = N(a, this._direction);
|
|
215
|
+
if (l || p) {
|
|
221
216
|
n.preventDefault();
|
|
222
|
-
const
|
|
223
|
-
this.viewModel.setWeatherByType(
|
|
224
|
-
const
|
|
225
|
-
|
|
217
|
+
const v = g.indexOf(e), b = g.length, w = (v + (p ? -1 : 1) + b) % b;
|
|
218
|
+
this.viewModel.setWeatherByType(g[w]);
|
|
219
|
+
const _ = n.currentTarget.parentElement?.parentElement;
|
|
220
|
+
_ && Array.from(_.querySelectorAll("calcite-button") ?? [])[w]?.setFocus();
|
|
226
221
|
}
|
|
227
222
|
}} @click=${(n) => {
|
|
228
223
|
if (r)
|
|
@@ -232,7 +227,7 @@ class Y extends E {
|
|
|
232
227
|
requestAnimationFrame(() => {
|
|
233
228
|
this.viewModel.current.type === e && a.setFocus();
|
|
234
229
|
});
|
|
235
|
-
}} title=${t ??
|
|
230
|
+
}} title=${t ?? f}></calcite-button>`;
|
|
236
231
|
}
|
|
237
232
|
_renderOptions(e) {
|
|
238
233
|
switch (e.type) {
|
|
@@ -250,45 +245,45 @@ class Y extends E {
|
|
|
250
245
|
}
|
|
251
246
|
_renderSunnyOptions(e) {
|
|
252
247
|
const t = this.messages.sunny;
|
|
253
|
-
return
|
|
248
|
+
return u({ disabled: this.viewModel.disabled, ariaLabel: t?.cloudCoverAria, label: t?.cloudCover, value: e.cloudCover, onChange: (i) => {
|
|
254
249
|
e.cloudCover = i;
|
|
255
250
|
} });
|
|
256
251
|
}
|
|
257
252
|
_renderCloudyOptions(e) {
|
|
258
253
|
const t = this.messages.cloudy;
|
|
259
|
-
return
|
|
254
|
+
return u({ disabled: this.viewModel.disabled, ariaLabel: t?.cloudCoverAria, label: t?.cloudCover, value: e.cloudCover, onChange: (i) => {
|
|
260
255
|
e.cloudCover = i;
|
|
261
256
|
} });
|
|
262
257
|
}
|
|
263
258
|
_renderRainyOptions(e) {
|
|
264
259
|
const { disabled: t } = this.viewModel, i = this.messages.rainy;
|
|
265
|
-
return
|
|
260
|
+
return c`${u({ disabled: t, ariaLabel: i?.cloudCoverAria, label: i?.cloudCover, value: e.cloudCover, onChange: (r) => {
|
|
266
261
|
e.cloudCover = r;
|
|
267
|
-
} })}${
|
|
262
|
+
} })}${u({ disabled: t, ariaLabel: i?.precipitationAria, label: i?.precipitation, value: e.precipitation, onChange: (r) => {
|
|
268
263
|
e.precipitation = r;
|
|
269
264
|
} })}`;
|
|
270
265
|
}
|
|
271
266
|
_renderSnowyOptions(e) {
|
|
272
267
|
const { disabled: t } = this.viewModel, i = this.messages.snowy;
|
|
273
|
-
return
|
|
268
|
+
return c`${u({ disabled: t, ariaLabel: i?.cloudCoverAria, label: i?.cloudCover, value: e.cloudCover, onChange: (r) => {
|
|
274
269
|
e.cloudCover = r;
|
|
275
|
-
} })}${
|
|
270
|
+
} })}${u({ disabled: t, ariaLabel: i?.precipitationAria, label: i?.precipitation, value: e.precipitation, onChange: (r) => {
|
|
276
271
|
e.precipitation = r;
|
|
277
|
-
} })}<calcite-label layout=inline title=${i?.snowCoverTooltip ??
|
|
272
|
+
} })}<calcite-label layout=inline title=${i?.snowCoverTooltip ?? f}><calcite-checkbox .checked=${e.snowCover === "enabled"} .disabled=${t} @calciteCheckboxChange=${(r) => {
|
|
278
273
|
this.viewModel.setSnowCoverEnabled(r.currentTarget.checked);
|
|
279
274
|
}}></calcite-checkbox>${i?.snowCover}</calcite-label>`;
|
|
280
275
|
}
|
|
281
276
|
_renderFoggyOptions(e) {
|
|
282
277
|
const t = this.messages.foggy;
|
|
283
|
-
return
|
|
278
|
+
return u({ disabled: this.viewModel.disabled, ariaLabel: t?.fogStrengthAria, label: t?.fogStrength, value: e.fogStrength, onChange: (i) => {
|
|
284
279
|
e.fogStrength = i;
|
|
285
280
|
} });
|
|
286
281
|
}
|
|
287
282
|
_renderWarning(e) {
|
|
288
|
-
return
|
|
283
|
+
return c`<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>`;
|
|
289
284
|
}
|
|
290
285
|
}
|
|
291
|
-
|
|
286
|
+
A("arcgis-weather", Y);
|
|
292
287
|
export {
|
|
293
288
|
Y as ArcgisWeather
|
|
294
289
|
};
|