@esri/solutions-components 0.2.6 → 0.2.7
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/cjs/deduct-calculator.cjs.entry.js +1 -1
- package/dist/cjs/pci-calculator.cjs.entry.js +1 -1
- package/dist/cjs/{pciUtils-6a806ba4.js → pciUtils-423cfc68.js} +25 -7
- package/dist/collection/demos/deduct-calculator.html +2 -5
- package/dist/collection/demos/new-public-notification.html +6 -4
- package/dist/collection/utils/pciUtils.js +25 -7
- package/dist/collection/utils/pciUtils.ts +30 -7
- package/dist/components/ExpandToggle.js +110 -0
- package/dist/components/Heading.js +22 -0
- package/dist/components/_commonjsHelpers.js +22 -0
- package/dist/components/action-bar.js +276 -0
- package/dist/components/action-group.js +149 -0
- package/dist/components/action-menu.js +356 -0
- package/dist/components/action.js +214 -0
- package/dist/components/add-record-modal.d.ts +11 -0
- package/dist/components/add-record-modal.js +171 -0
- package/dist/components/array.js +15 -0
- package/dist/components/block.js +272 -0
- package/dist/components/buffer-tools.d.ts +11 -0
- package/dist/components/buffer-tools.js +11 -0
- package/dist/components/buffer-tools2.js +262 -0
- package/dist/components/button.js +263 -0
- package/dist/components/calcite-accordion-item.js +244 -0
- package/dist/components/calcite-accordion.js +180 -0
- package/dist/components/calcite-action-bar.js +11 -0
- package/dist/components/calcite-action-group.js +11 -0
- package/dist/components/calcite-action-menu.js +11 -0
- package/dist/components/calcite-action-pad.js +197 -0
- package/dist/components/calcite-action.js +11 -0
- package/dist/components/calcite-alert.js +297 -0
- package/dist/components/calcite-avatar.js +182 -0
- package/dist/components/calcite-block-section.js +155 -0
- package/dist/components/calcite-block.js +11 -0
- package/dist/components/calcite-button.js +11 -0
- package/dist/components/calcite-card.js +187 -0
- package/dist/components/calcite-checkbox.js +11 -0
- package/dist/components/calcite-chip.js +11 -0
- package/dist/components/calcite-color-picker-hex-input.js +11 -0
- package/dist/components/calcite-color-picker-swatch.js +11 -0
- package/dist/components/calcite-color-picker.js +1036 -0
- package/dist/components/calcite-combobox-item-group.js +75 -0
- package/dist/components/calcite-combobox-item.js +11 -0
- package/dist/components/calcite-combobox.js +11 -0
- package/dist/components/calcite-date-picker-day.js +11 -0
- package/dist/components/calcite-date-picker-month-header.js +11 -0
- package/dist/components/calcite-date-picker-month.js +11 -0
- package/dist/components/calcite-date-picker.js +11 -0
- package/dist/components/calcite-dropdown-group.js +11 -0
- package/dist/components/calcite-dropdown-item.js +11 -0
- package/dist/components/calcite-dropdown.js +11 -0
- package/dist/components/calcite-fab.js +144 -0
- package/dist/components/calcite-filter.js +195 -0
- package/dist/components/calcite-flow-item.js +243 -0
- package/dist/components/calcite-flow.js +147 -0
- package/dist/components/calcite-graph.js +11 -0
- package/dist/components/calcite-handle.js +11 -0
- package/dist/components/calcite-icon.js +11 -0
- package/dist/components/calcite-inline-editable.js +294 -0
- package/dist/components/calcite-input-date-picker.js +713 -0
- package/dist/components/calcite-input-message.js +11 -0
- package/dist/components/calcite-input-number.js +637 -0
- package/dist/components/calcite-input-text.js +400 -0
- package/dist/components/calcite-input-time-picker.js +434 -0
- package/dist/components/calcite-input.js +11 -0
- package/dist/components/calcite-label.js +11 -0
- package/dist/components/calcite-link.js +11 -0
- package/dist/components/calcite-list-item-group.js +65 -0
- package/dist/components/calcite-list-item.js +11 -0
- package/dist/components/calcite-list.js +11 -0
- package/dist/components/calcite-loader.js +11 -0
- package/dist/components/calcite-modal.js +11 -0
- package/dist/components/calcite-notice.js +11 -0
- package/dist/components/calcite-option-group.js +64 -0
- package/dist/components/calcite-option.js +11 -0
- package/dist/components/calcite-pagination.js +258 -0
- package/dist/components/calcite-panel.js +11 -0
- package/dist/components/calcite-pick-list-group.js +74 -0
- package/dist/components/calcite-pick-list-item.js +11 -0
- package/dist/components/calcite-pick-list.js +11 -0
- package/dist/components/calcite-popover-manager.js +94 -0
- package/dist/components/calcite-popover.js +11 -0
- package/dist/components/calcite-progress.js +11 -0
- package/dist/components/calcite-radio-button-group.js +132 -0
- package/dist/components/calcite-radio-button.js +310 -0
- package/dist/components/calcite-radio-group-item.js +11 -0
- package/dist/components/calcite-radio-group.js +11 -0
- package/dist/components/calcite-rating.js +201 -0
- package/dist/components/calcite-scrim.js +11 -0
- package/dist/components/calcite-select.js +11 -0
- package/dist/components/calcite-shell-center-row.js +100 -0
- package/dist/components/calcite-shell-panel.js +11 -0
- package/dist/components/calcite-shell.js +11 -0
- package/dist/components/calcite-slider.js +11 -0
- package/dist/components/calcite-sortable-list.js +202 -0
- package/dist/components/calcite-split-button.js +11 -0
- package/dist/components/calcite-stepper-item.js +271 -0
- package/dist/components/calcite-stepper.js +256 -0
- package/dist/components/calcite-switch.js +11 -0
- package/dist/components/calcite-tab-nav.js +11 -0
- package/dist/components/calcite-tab-title.js +11 -0
- package/dist/components/calcite-tab.js +11 -0
- package/dist/components/calcite-tabs.js +11 -0
- package/dist/components/calcite-tile-select-group.js +65 -0
- package/dist/components/calcite-tile-select.js +266 -0
- package/dist/components/calcite-tile.js +11 -0
- package/dist/components/calcite-time-picker.js +11 -0
- package/dist/components/calcite-tip-group.js +41 -0
- package/dist/components/calcite-tip-manager.js +223 -0
- package/dist/components/calcite-tip.js +162 -0
- package/dist/components/calcite-tooltip-manager.js +57 -0
- package/dist/components/calcite-tooltip.js +11 -0
- package/dist/components/calcite-tree-item.js +11 -0
- package/dist/components/calcite-tree.js +11 -0
- package/dist/components/calcite-value-list-item.js +11 -0
- package/dist/components/calcite-value-list.js +11 -0
- package/dist/components/card-manager.d.ts +11 -0
- package/dist/components/card-manager.js +143 -0
- package/dist/components/check-list.d.ts +11 -0
- package/dist/components/check-list.js +11 -0
- package/dist/components/check-list2.js +131 -0
- package/dist/components/checkbox.js +165 -0
- package/dist/components/chip.js +170 -0
- package/dist/components/color-picker-hex-input.js +363 -0
- package/dist/components/color-picker-swatch.js +2034 -0
- package/dist/components/combobox-item.js +182 -0
- package/dist/components/combobox.js +912 -0
- package/dist/components/comment-card.d.ts +11 -0
- package/dist/components/comment-card.js +90 -0
- package/dist/components/conditionalSlot.js +50 -0
- package/dist/components/config-buffer-tools.d.ts +11 -0
- package/dist/components/config-buffer-tools.js +187 -0
- package/dist/components/config-draw-tools.d.ts +11 -0
- package/dist/components/config-draw-tools.js +121 -0
- package/dist/components/config-layer-picker.d.ts +11 -0
- package/dist/components/config-layer-picker.js +163 -0
- package/dist/components/config-pdf-download.d.ts +11 -0
- package/dist/components/config-pdf-download.js +154 -0
- package/dist/components/crowdsource-manager.d.ts +11 -0
- package/dist/components/crowdsource-manager.js +90 -0
- package/dist/components/crowdsource-reporter.d.ts +11 -0
- package/dist/components/crowdsource-reporter.js +90 -0
- package/dist/components/csvUtils.js +74 -0
- package/dist/components/date-picker-day.js +111 -0
- package/dist/components/date-picker-month-header.js +224 -0
- package/dist/components/date-picker-month.js +344 -0
- package/dist/components/date-picker.js +575 -0
- package/dist/components/date.js +180 -0
- package/dist/components/debounce.js +487 -0
- package/dist/components/deduct-calculator.d.ts +11 -0
- package/dist/components/deduct-calculator.js +11 -0
- package/dist/components/deduct-calculator2.js +1002 -0
- package/dist/components/dom.js +231 -0
- package/dist/components/dropdown-group.js +96 -0
- package/dist/components/dropdown-item.js +232 -0
- package/dist/components/dropdown.js +505 -0
- package/dist/components/edit-record-modal.d.ts +11 -0
- package/dist/components/edit-record-modal.js +11 -0
- package/dist/components/edit-record-modal2.js +161 -0
- package/dist/components/filter.js +763 -0
- package/dist/components/floating-ui.js +1768 -0
- package/dist/components/form.js +228 -0
- package/dist/components/graph.js +254 -0
- package/dist/components/guid.js +24 -0
- package/dist/components/handle.js +119 -0
- package/dist/components/icon.js +202 -0
- package/dist/components/index.d.ts +61 -0
- package/dist/components/index.js +196 -0
- package/dist/components/index2.js +199 -0
- package/dist/components/info-card.d.ts +11 -0
- package/dist/components/info-card.js +11 -0
- package/dist/components/info-card2.js +97 -0
- package/dist/components/input-message.js +101 -0
- package/dist/components/input.js +740 -0
- package/dist/components/interactive.js +51 -0
- package/dist/components/interfaces.js +19 -0
- package/dist/components/interfaces2.js +21 -0
- package/dist/components/interfaces3.js +80 -0
- package/dist/components/json-editor.d.ts +11 -0
- package/dist/components/json-editor.js +11 -0
- package/dist/components/json-editor2.js +441 -0
- package/dist/components/key.js +16 -0
- package/dist/components/label.js +106 -0
- package/dist/components/label2.js +131 -0
- package/dist/components/labelFormats.js +210 -0
- package/dist/components/layer-table.d.ts +11 -0
- package/dist/components/layer-table.js +453 -0
- package/dist/components/link.js +123 -0
- package/dist/components/list-item.d.ts +11 -0
- package/dist/components/list-item.js +90 -0
- package/dist/components/list-item2.js +149 -0
- package/dist/components/list.js +83 -0
- package/dist/components/loadModules.js +28 -0
- package/dist/components/loader.js +116 -0
- package/dist/components/locale.js +412 -0
- package/dist/components/locale2.js +413 -0
- package/dist/components/map-card.d.ts +11 -0
- package/dist/components/map-card.js +354 -0
- package/dist/components/map-draw-tools.d.ts +11 -0
- package/dist/components/map-draw-tools.js +11 -0
- package/dist/components/map-draw-tools2.js +228 -0
- package/dist/components/map-layer-picker.d.ts +11 -0
- package/dist/components/map-layer-picker.js +11 -0
- package/dist/components/map-layer-picker2.js +188 -0
- package/dist/components/map-search.d.ts +11 -0
- package/dist/components/map-search.js +155 -0
- package/dist/components/map-select-tools.d.ts +11 -0
- package/dist/components/map-select-tools.js +11 -0
- package/dist/components/map-select-tools2.js +588 -0
- package/dist/components/mapViewUtils.js +129 -0
- package/dist/components/math.js +24 -0
- package/dist/components/media-card.d.ts +11 -0
- package/dist/components/media-card.js +11 -0
- package/dist/components/media-card2.js +177 -0
- package/dist/components/modal.js +495 -0
- package/dist/components/nonChromiumPlatformUtils.js +503 -0
- package/dist/components/notice.js +192 -0
- package/dist/components/observers.js +56 -0
- package/dist/components/openCloseComponent.js +56 -0
- package/dist/components/option.js +109 -0
- package/dist/components/panel.js +459 -0
- package/dist/components/pci-calculator.d.ts +11 -0
- package/dist/components/pci-calculator.js +193 -0
- package/dist/components/pdf-download.d.ts +11 -0
- package/dist/components/pdf-download.js +11 -0
- package/dist/components/pdf-download2.js +189 -0
- package/dist/components/pick-list-item.js +255 -0
- package/dist/components/pick-list.js +170 -0
- package/dist/components/popover.js +500 -0
- package/dist/components/progress.js +60 -0
- package/dist/components/public-notification.d.ts +11 -0
- package/dist/components/public-notification.js +825 -0
- package/dist/components/publicNotificationStore.js +38 -0
- package/dist/components/queryUtils.js +187 -0
- package/dist/components/radio-group-item.js +101 -0
- package/dist/components/radio-group.js +235 -0
- package/dist/components/refine-selection-tools.d.ts +11 -0
- package/dist/components/refine-selection-tools.js +11 -0
- package/dist/components/refine-selection-tools2.js +492 -0
- package/dist/components/refine-selection.d.ts +11 -0
- package/dist/components/refine-selection.js +11 -0
- package/dist/components/refine-selection2.js +376 -0
- package/dist/components/resources.js +24 -0
- package/dist/components/resources2.js +21 -0
- package/dist/components/resources3.js +38 -0
- package/dist/components/scrim.js +83 -0
- package/dist/components/select.js +259 -0
- package/dist/components/shared-list-render.js +319 -0
- package/dist/components/shell-panel.js +281 -0
- package/dist/components/shell.js +121 -0
- package/dist/components/slider.js +896 -0
- package/dist/components/solution-configuration.d.ts +11 -0
- package/dist/components/solution-configuration.js +2233 -0
- package/dist/components/solution-contents.d.ts +11 -0
- package/dist/components/solution-contents.js +11 -0
- package/dist/components/solution-contents2.js +128 -0
- package/dist/components/solution-item-details.d.ts +11 -0
- package/dist/components/solution-item-details.js +11 -0
- package/dist/components/solution-item-details2.js +234 -0
- package/dist/components/solution-item-icon.d.ts +11 -0
- package/dist/components/solution-item-icon.js +11 -0
- package/dist/components/solution-item-icon2.js +342 -0
- package/dist/components/solution-item-sharing.d.ts +11 -0
- package/dist/components/solution-item-sharing.js +11 -0
- package/dist/components/solution-item-sharing2.js +167 -0
- package/dist/components/solution-item.d.ts +11 -0
- package/dist/components/solution-item.js +11 -0
- package/dist/components/solution-item2.js +315 -0
- package/dist/components/solution-organization-variables.d.ts +11 -0
- package/dist/components/solution-organization-variables.js +11 -0
- package/dist/components/solution-organization-variables2.js +132 -0
- package/dist/components/solution-resource-item.d.ts +11 -0
- package/dist/components/solution-resource-item.js +11 -0
- package/dist/components/solution-resource-item2.js +356 -0
- package/dist/components/solution-spatial-ref.d.ts +11 -0
- package/dist/components/solution-spatial-ref.js +11 -0
- package/dist/components/solution-spatial-ref2.js +21446 -0
- package/dist/components/solution-store.js +4092 -0
- package/dist/components/solution-template-data.d.ts +11 -0
- package/dist/components/solution-template-data.js +11 -0
- package/dist/components/solution-template-data2.js +233 -0
- package/dist/components/solution-variables.d.ts +11 -0
- package/dist/components/solution-variables.js +11 -0
- package/dist/components/solution-variables2.js +150 -0
- package/dist/components/sortable.esm.js +3026 -0
- package/dist/components/split-button.js +165 -0
- package/dist/components/store-manager.d.ts +11 -0
- package/dist/components/store-manager.js +83 -0
- package/dist/components/switch.js +139 -0
- package/dist/components/tab-nav.js +241 -0
- package/dist/components/tab-title.js +276 -0
- package/dist/components/tab.js +154 -0
- package/dist/components/tabs.js +188 -0
- package/dist/components/tile.js +129 -0
- package/dist/components/time-picker.js +943 -0
- package/dist/components/tooltip.js +399 -0
- package/dist/components/tree-item.js +294 -0
- package/dist/components/tree.js +327 -0
- package/dist/components/utils.js +119 -0
- package/dist/components/utils2.js +51 -0
- package/dist/components/value-list-item.js +204 -0
- package/dist/components/value-list.js +333 -0
- package/dist/esm/deduct-calculator.entry.js +1 -1
- package/dist/esm/pci-calculator.entry.js +1 -1
- package/dist/esm/{pciUtils-e3007a1c.js → pciUtils-ecda46e5.js} +25 -7
- package/dist/solutions-components/demos/deduct-calculator.html +2 -5
- package/dist/solutions-components/demos/new-public-notification.html +6 -4
- package/dist/solutions-components/{p-ff80ffbb.entry.js → p-0512635b.entry.js} +1 -1
- package/dist/solutions-components/{p-5ec407c2.entry.js → p-0c088725.entry.js} +1 -1
- package/dist/solutions-components/p-cc815aca.js +21 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/pciUtils.ts +30 -7
- package/dist/types/utils/pciUtils.d.ts +2 -1
- package/package.json +4 -3
- package/dist/solutions-components/p-647bbd18.js +0 -21
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 Esri
|
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { c as createStore } from './index2.js';
|
|
7
|
+
|
|
8
|
+
/** @license
|
|
9
|
+
* Copyright 2022 Esri
|
|
10
|
+
*
|
|
11
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License.
|
|
13
|
+
* You may obtain a copy of the License at
|
|
14
|
+
*
|
|
15
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
*
|
|
17
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
+
* See the License for the specific language governing permissions and
|
|
21
|
+
* limitations under the License.
|
|
22
|
+
*/
|
|
23
|
+
const { state, onChange } = createStore({
|
|
24
|
+
// List of layers added and managed by the component
|
|
25
|
+
managedLayers: [],
|
|
26
|
+
// Handle: https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Handles.html#Handle
|
|
27
|
+
highlightHandle: undefined
|
|
28
|
+
});
|
|
29
|
+
const managedLayersChangedEvent = new CustomEvent("managedLayersChanged", {
|
|
30
|
+
bubbles: true,
|
|
31
|
+
cancelable: false,
|
|
32
|
+
composed: true
|
|
33
|
+
});
|
|
34
|
+
onChange("managedLayers", () => {
|
|
35
|
+
dispatchEvent(managedLayersChangedEvent);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export { state as s };
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 Esri
|
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { c as EWorkflowType } from './interfaces3.js';
|
|
7
|
+
|
|
8
|
+
/** @license
|
|
9
|
+
* Copyright 2022 Esri
|
|
10
|
+
*
|
|
11
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License.
|
|
13
|
+
* You may obtain a copy of the License at
|
|
14
|
+
*
|
|
15
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
*
|
|
17
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
+
* See the License for the specific language governing permissions and
|
|
21
|
+
* limitations under the License.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Query the layer for all features
|
|
25
|
+
*
|
|
26
|
+
* @param start zero-based index indicating where to begin retrieving features
|
|
27
|
+
* @param layer the layer to retrieve features from
|
|
28
|
+
* @param graphics stores the features
|
|
29
|
+
*
|
|
30
|
+
* @returns Promise with the featureSet from the layer that match the provided ids
|
|
31
|
+
*/
|
|
32
|
+
async function queryAllFeatures(start, layer, graphics) {
|
|
33
|
+
const num = layer.capabilities.query.maxRecordCount;
|
|
34
|
+
const query = {
|
|
35
|
+
start,
|
|
36
|
+
num,
|
|
37
|
+
outFields: ["*"],
|
|
38
|
+
// TODO think through this more...does this make sense
|
|
39
|
+
// may be better to fetch when checkbox is clicked...
|
|
40
|
+
returnGeometry: true,
|
|
41
|
+
where: "1=1"
|
|
42
|
+
};
|
|
43
|
+
const result = await layer.queryFeatures(query);
|
|
44
|
+
graphics = graphics.concat(result.features);
|
|
45
|
+
return result.exceededTransferLimit ?
|
|
46
|
+
queryAllFeatures(start += num, layer, graphics) :
|
|
47
|
+
Promise.resolve(graphics);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Query the layer for OIDs based on any user drawn geometries or buffers
|
|
51
|
+
*
|
|
52
|
+
* @param geometries Array of geometries used for the selection of ids from the layer
|
|
53
|
+
* @param layer the layer to retrieve ids from
|
|
54
|
+
*
|
|
55
|
+
* @returns Promise with the OIDs of features from the layer that interset the provided geometries
|
|
56
|
+
*/
|
|
57
|
+
async function queryObjectIds(geometries, layer) {
|
|
58
|
+
let ids = [];
|
|
59
|
+
const queryDefs = geometries.map(g => _intersectQuery(g, layer));
|
|
60
|
+
const results = await Promise.all(queryDefs);
|
|
61
|
+
results.forEach(resultIds => {
|
|
62
|
+
ids = [
|
|
63
|
+
...ids,
|
|
64
|
+
...resultIds
|
|
65
|
+
];
|
|
66
|
+
});
|
|
67
|
+
return ids;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Query the layer for features that have the provided OIDs
|
|
71
|
+
*
|
|
72
|
+
* @param ids array of ObjectIDs to be used to query for features in a layer
|
|
73
|
+
* @param layer the layer to retrieve features from
|
|
74
|
+
*
|
|
75
|
+
* @returns Promise with the featureSet from the layer that match the provided ids
|
|
76
|
+
*/
|
|
77
|
+
async function queryFeaturesByID(ids, layer) {
|
|
78
|
+
const q = layer.createQuery();
|
|
79
|
+
q.outFields = ["*"];
|
|
80
|
+
q.objectIds = ids;
|
|
81
|
+
return layer.queryFeatures(q);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Query the layer for features that intersect the provided geometry
|
|
85
|
+
*
|
|
86
|
+
* @param start zero-based index indicating where to begin retrieving features
|
|
87
|
+
* @param layer the layer to retrieve features from
|
|
88
|
+
* @param geometry the geometry to apply to the spatial filter
|
|
89
|
+
* @param featuresCollection
|
|
90
|
+
*
|
|
91
|
+
* @returns Promise with the featureSet from the layer that match the provided ids
|
|
92
|
+
*/
|
|
93
|
+
async function queryFeaturesByGeometry(start, layer, geometry, featuresCollection) {
|
|
94
|
+
const num = layer.capabilities.query.maxRecordCount;
|
|
95
|
+
const query = {
|
|
96
|
+
start,
|
|
97
|
+
num,
|
|
98
|
+
outFields: ["*"],
|
|
99
|
+
returnGeometry: true,
|
|
100
|
+
geometry
|
|
101
|
+
};
|
|
102
|
+
const result = await layer.queryFeatures(query);
|
|
103
|
+
featuresCollection[layer.title] = featuresCollection[layer.title].concat(result.features);
|
|
104
|
+
return result.exceededTransferLimit ?
|
|
105
|
+
queryFeaturesByGeometry(start += num, layer, geometry, featuresCollection) :
|
|
106
|
+
Promise.resolve(featuresCollection);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Query the layer for the extent of features with the provided OIDs
|
|
110
|
+
*
|
|
111
|
+
* @param ids array of ObjectIDs to be used to query for features in a layer
|
|
112
|
+
* @param layer the layer to query
|
|
113
|
+
*
|
|
114
|
+
* @returns Promise with the Extent of all features that match the provided ids
|
|
115
|
+
*/
|
|
116
|
+
async function queryExtent(ids, layer) {
|
|
117
|
+
const query = layer.createQuery();
|
|
118
|
+
query.objectIds = ids;
|
|
119
|
+
return layer.queryExtent(query);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Union geometries based on geometry type
|
|
123
|
+
*
|
|
124
|
+
* @param geometries Array of geometries to union
|
|
125
|
+
* @param geometryEngine the geometry engine instance to perform the unions
|
|
126
|
+
*
|
|
127
|
+
* @returns Array of single unioned geometry for each geometry type
|
|
128
|
+
*/
|
|
129
|
+
function getQueryGeoms(geometries, geometryEngine) {
|
|
130
|
+
// sort and union by geom type so we have a single geom for each type to query with
|
|
131
|
+
return [
|
|
132
|
+
..._unionGeoms(geometries, "polygon", geometryEngine),
|
|
133
|
+
..._unionGeoms(geometries, "polyline", geometryEngine),
|
|
134
|
+
..._unionGeoms(geometries, "point", geometryEngine)
|
|
135
|
+
];
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Get the appropriate ObjectIds query for the provided selection set
|
|
139
|
+
*
|
|
140
|
+
* @param selectionSet the current selection set to fetch the query for
|
|
141
|
+
* @param geometryEngine the geometry engine instance to perform the union of the user drawn graphics or buffers
|
|
142
|
+
*
|
|
143
|
+
* @returns A promise that will resolve with ids that intersect the selection sets geometries
|
|
144
|
+
*/
|
|
145
|
+
function getSelectionSetQuery(selectionSet, geometryEngine) {
|
|
146
|
+
let q = Promise.resolve([]);
|
|
147
|
+
if (selectionSet.workflowType !== EWorkflowType.REFINE) {
|
|
148
|
+
if (!selectionSet.buffer) {
|
|
149
|
+
const queryGeoms = getQueryGeoms(selectionSet.geometries, geometryEngine);
|
|
150
|
+
q = queryObjectIds(queryGeoms, selectionSet.layerView.layer);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
// buffer is a single unioned geom
|
|
154
|
+
q = queryObjectIds([selectionSet.buffer], selectionSet.layerView.layer);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return q;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Union geometries based on geometry type
|
|
161
|
+
*
|
|
162
|
+
* @param geometries array of geometries to union
|
|
163
|
+
* @param type the current geometry type to union
|
|
164
|
+
* @param geometryEngine the geometry engine instance to perform the unions
|
|
165
|
+
*
|
|
166
|
+
* @returns Array of single unioned geometry for the provided geometry type
|
|
167
|
+
*/
|
|
168
|
+
function _unionGeoms(geometries, type, geometryEngine) {
|
|
169
|
+
const geoms = geometries.filter(g => g.type === type);
|
|
170
|
+
return geoms.length <= 1 ? geoms : [geometryEngine.union(geoms)];
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Query the layer for ObjectIds of features that intersect the provided geometry
|
|
174
|
+
*
|
|
175
|
+
* @param geometry Geometry used for the selection of ids from the select layer view
|
|
176
|
+
* @param layer the layer to query
|
|
177
|
+
*
|
|
178
|
+
* @returns Promise that will contain the selected ids
|
|
179
|
+
*/
|
|
180
|
+
async function _intersectQuery(geometry, layer) {
|
|
181
|
+
const q = layer.createQuery();
|
|
182
|
+
q.spatialRelationship = "intersects";
|
|
183
|
+
q.geometry = geometry;
|
|
184
|
+
return layer.queryObjectIds(q);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export { queryObjectIds as a, getQueryGeoms as b, queryFeaturesByGeometry as c, queryExtent as d, queryFeaturesByID as e, getSelectionSetQuery as g, queryAllFeatures as q };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 Esri
|
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
7
|
+
import { g as getElementProp, t as toAriaBoolean } from './dom.js';
|
|
8
|
+
import { d as defineCustomElement$1 } from './icon.js';
|
|
9
|
+
|
|
10
|
+
/*!
|
|
11
|
+
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
12
|
+
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
13
|
+
* v1.0.0-beta.97
|
|
14
|
+
*/
|
|
15
|
+
const SLOTS = {
|
|
16
|
+
input: "input"
|
|
17
|
+
};
|
|
18
|
+
const CSS = {
|
|
19
|
+
radioGroupItemIcon: "radio-group-item-icon"
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const radioGroupItemCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}: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{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:flex;cursor:pointer;align-self:stretch;font-weight:var(--calcite-font-weight-normal);transition:background-color var(--calcite-internal-animation-timing-fast) ease-in-out, border-color var(--calcite-animation-timing) ease-in-out}:host label{pointer-events:none;margin:0.125rem;box-sizing:border-box;display:flex;flex:1 1 0%;align-items:center;color:var(--calcite-ui-text-3);transition:background-color var(--calcite-internal-animation-timing-fast) ease-in-out, border-color var(--calcite-internal-animation-timing-fast) ease-in-out, color var(--calcite-internal-animation-timing-fast) ease-in-out}.label--horizontal{justify-content:center}:host{outline-color:transparent}:host(:focus){outline:2px solid var(--calcite-ui-brand);outline-offset:-1px}.label--scale-s{padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem;padding-block:0.125rem}.label--scale-m{padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem;padding-block:0.375rem}.label--scale-l{padding-inline:1rem;padding-block:0.625rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host(:hover) label{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}:host(:active) label{background-color:var(--calcite-ui-foreground-3)}:host([checked]) label{cursor:default;border-color:var(--calcite-ui-brand);background-color:var(--calcite-ui-brand);color:var(--calcite-ui-background)}:host([checked]) .label--outline{border-color:var(--calcite-ui-brand);background-color:var(--calcite-ui-foreground-1);box-shadow:inset 0 0 0 1px var(--calcite-ui-brand);color:var(--calcite-ui-brand)}::slotted(input){display:none}@media (forced-colors: active){:host([checked]) label{background-color:highlight}:host([checked]) .label--outline{outline:2px solid transparent;outline-offset:2px}:host([checked]) label:not([class~=label--outline]) .radio-group-item-icon{color:highlightText}}.radio-group-item-icon{position:relative;margin:0px;display:inline-flex;line-height:inherit}:host([icon-position=start]) .label--scale-s .radio-group-item-icon{-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}:host([icon-position=end]) .label--scale-s .radio-group-item-icon{-webkit-margin-end:unset;margin-inline-end:unset;-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}:host([icon-position=start]) .label--scale-m .radio-group-item-icon{-webkit-margin-end:0.75rem;margin-inline-end:0.75rem}:host([icon-position=end]) .label--scale-m .radio-group-item-icon{-webkit-margin-end:unset;margin-inline-end:unset;-webkit-margin-start:0.75rem;margin-inline-start:0.75rem}:host([icon-position=start]) .label--scale-l .radio-group-item-icon{-webkit-margin-end:1rem;margin-inline-end:1rem}:host([icon-position=end]) .label--scale-l .radio-group-item-icon{-webkit-margin-end:unset;margin-inline-end:unset;-webkit-margin-start:1rem;margin-inline-start:1rem}:host([icon-start]) .label--scale-s .radio-group-item-icon{-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}:host([icon-end]) .label--scale-s .radio-group-item-icon{-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}:host([icon-start]) .label--scale-m .radio-group-item-icon{-webkit-margin-end:0.75rem;margin-inline-end:0.75rem}:host([icon-end]) .label--scale-m .radio-group-item-icon{-webkit-margin-start:0.75rem;margin-inline-start:0.75rem}:host([icon-start]) .label--scale-l .radio-group-item-icon{-webkit-margin-end:1rem;margin-inline-end:1rem}:host([icon-end]) .label--scale-l .radio-group-item-icon{-webkit-margin-start:1rem;margin-inline-start:1rem}";
|
|
23
|
+
|
|
24
|
+
const RadioGroupItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
25
|
+
constructor() {
|
|
26
|
+
super();
|
|
27
|
+
this.__registerHost();
|
|
28
|
+
this.__attachShadow();
|
|
29
|
+
this.calciteInternalRadioGroupItemChange = createEvent(this, "calciteInternalRadioGroupItemChange", 6);
|
|
30
|
+
//--------------------------------------------------------------------------
|
|
31
|
+
//
|
|
32
|
+
// Properties
|
|
33
|
+
//
|
|
34
|
+
//--------------------------------------------------------------------------
|
|
35
|
+
/** When `true`, the component is checked. */
|
|
36
|
+
this.checked = false;
|
|
37
|
+
/** When `true`, the icon will be flipped when the element direction is right-to-left (`"rtl"`). */
|
|
38
|
+
this.iconFlipRtl = false;
|
|
39
|
+
/**
|
|
40
|
+
* Specifies the placement of the icon.
|
|
41
|
+
*
|
|
42
|
+
* @deprecated Use either `iconStart` or `iconEnd` but do not combine them with `icon` and `iconPosition`.
|
|
43
|
+
*/
|
|
44
|
+
this.iconPosition = "start";
|
|
45
|
+
}
|
|
46
|
+
handleCheckedChange() {
|
|
47
|
+
this.calciteInternalRadioGroupItemChange.emit();
|
|
48
|
+
}
|
|
49
|
+
render() {
|
|
50
|
+
const { checked, value } = this;
|
|
51
|
+
const scale = getElementProp(this.el, "scale", "m");
|
|
52
|
+
const appearance = getElementProp(this.el, "appearance", "solid");
|
|
53
|
+
const layout = getElementProp(this.el, "layout", "horizontal");
|
|
54
|
+
const iconStartEl = this.iconStart ? (h("calcite-icon", { class: CSS.radioGroupItemIcon, flipRtl: this.iconFlipRtl, icon: this.iconStart, key: "icon-start", scale: "s" })) : null;
|
|
55
|
+
const iconEndEl = this.iconEnd ? (h("calcite-icon", { class: CSS.radioGroupItemIcon, flipRtl: this.iconFlipRtl, icon: this.iconEnd, key: "icon-end", scale: "s" })) : null;
|
|
56
|
+
const iconEl = (h("calcite-icon", { class: CSS.radioGroupItemIcon, flipRtl: this.iconFlipRtl, icon: this.icon, key: "icon", scale: "s" }));
|
|
57
|
+
const iconAtStart = this.icon && this.iconPosition === "start" && !this.iconStart ? iconEl : null;
|
|
58
|
+
const iconAtEnd = this.icon && this.iconPosition === "end" && !this.iconEnd ? iconEl : null;
|
|
59
|
+
return (h(Host, { "aria-checked": toAriaBoolean(checked), "aria-label": value, role: "radio" }, h("label", { class: {
|
|
60
|
+
"label--scale-s": scale === "s",
|
|
61
|
+
"label--scale-m": scale === "m",
|
|
62
|
+
"label--scale-l": scale === "l",
|
|
63
|
+
"label--horizontal": layout === "horizontal",
|
|
64
|
+
"label--outline": appearance === "outline"
|
|
65
|
+
} }, iconAtStart, this.iconStart ? iconStartEl : null, h("slot", null, value), h("slot", { name: SLOTS.input }), iconAtEnd, this.iconEnd ? iconEndEl : null)));
|
|
66
|
+
}
|
|
67
|
+
get el() { return this; }
|
|
68
|
+
static get watchers() { return {
|
|
69
|
+
"checked": ["handleCheckedChange"]
|
|
70
|
+
}; }
|
|
71
|
+
static get style() { return radioGroupItemCss; }
|
|
72
|
+
}, [1, "calcite-radio-group-item", {
|
|
73
|
+
"checked": [1540],
|
|
74
|
+
"icon": [513],
|
|
75
|
+
"iconFlipRtl": [516, "icon-flip-rtl"],
|
|
76
|
+
"iconPosition": [513, "icon-position"],
|
|
77
|
+
"iconStart": [513, "icon-start"],
|
|
78
|
+
"iconEnd": [513, "icon-end"],
|
|
79
|
+
"value": [1032]
|
|
80
|
+
}]);
|
|
81
|
+
function defineCustomElement() {
|
|
82
|
+
if (typeof customElements === "undefined") {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const components = ["calcite-radio-group-item", "calcite-icon"];
|
|
86
|
+
components.forEach(tagName => { switch (tagName) {
|
|
87
|
+
case "calcite-radio-group-item":
|
|
88
|
+
if (!customElements.get(tagName)) {
|
|
89
|
+
customElements.define(tagName, RadioGroupItem);
|
|
90
|
+
}
|
|
91
|
+
break;
|
|
92
|
+
case "calcite-icon":
|
|
93
|
+
if (!customElements.get(tagName)) {
|
|
94
|
+
defineCustomElement$1();
|
|
95
|
+
}
|
|
96
|
+
break;
|
|
97
|
+
} });
|
|
98
|
+
}
|
|
99
|
+
defineCustomElement();
|
|
100
|
+
|
|
101
|
+
export { RadioGroupItem as R, defineCustomElement as d };
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 Esri
|
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host, Build } from '@stencil/core/internal/client';
|
|
7
|
+
import { c as getElementDir } from './dom.js';
|
|
8
|
+
import { c as connectLabel, d as disconnectLabel } from './label2.js';
|
|
9
|
+
import { a as afterConnectDefaultValueSet, c as connectForm, d as disconnectForm, H as HiddenFormInputSlot } from './form.js';
|
|
10
|
+
import { u as updateHostInteraction } from './interactive.js';
|
|
11
|
+
|
|
12
|
+
const radioGroupCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}: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{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{display:flex;background-color:var(--calcite-ui-foreground-1);inline-size:-moz-fit-content;inline-size:fit-content;outline:1px solid var(--calcite-ui-border-input);outline-offset:-1px}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([layout=vertical]){flex-direction:column;align-items:flex-start;align-self:flex-start}:host([width=full]){inline-size:100%;min-inline-size:-moz-fit-content;min-inline-size:fit-content}:host([width=full]) ::slotted(calcite-radio-group-item){flex:1 1 auto}:host([width=full][layout=vertical]) ::slotted(calcite-radio-group-item){justify-content:flex-start}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}";
|
|
13
|
+
|
|
14
|
+
const RadioGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
this.__registerHost();
|
|
18
|
+
this.__attachShadow();
|
|
19
|
+
this.calciteRadioGroupChange = createEvent(this, "calciteRadioGroupChange", 6);
|
|
20
|
+
//--------------------------------------------------------------------------
|
|
21
|
+
//
|
|
22
|
+
// Properties
|
|
23
|
+
//
|
|
24
|
+
//--------------------------------------------------------------------------
|
|
25
|
+
/** Specifies the appearance style of the component. */
|
|
26
|
+
this.appearance = "solid";
|
|
27
|
+
/** When `true`, interaction is prevented and the component is displayed with lower opacity. */
|
|
28
|
+
this.disabled = false;
|
|
29
|
+
/**
|
|
30
|
+
* When `true`, the component must have a value in order for the form to submit.
|
|
31
|
+
*
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
this.required = false;
|
|
35
|
+
/** Defines the layout of the component. */
|
|
36
|
+
this.layout = "horizontal";
|
|
37
|
+
/** Specifies the size of the component. */
|
|
38
|
+
this.scale = "m";
|
|
39
|
+
/** The component's `selectedItem` value. */
|
|
40
|
+
this.value = null;
|
|
41
|
+
/** Specifies the width of the component. */
|
|
42
|
+
this.width = "auto";
|
|
43
|
+
//--------------------------------------------------------------------------
|
|
44
|
+
//
|
|
45
|
+
// Event Listeners
|
|
46
|
+
//
|
|
47
|
+
//--------------------------------------------------------------------------
|
|
48
|
+
this.handleClick = (event) => {
|
|
49
|
+
if (event.target.localName === "calcite-radio-group-item") {
|
|
50
|
+
this.selectItem(event.target, true);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
valueHandler(value) {
|
|
55
|
+
const items = this.getItems();
|
|
56
|
+
items.forEach((item) => (item.checked = item.value === value));
|
|
57
|
+
}
|
|
58
|
+
handleSelectedItemChange(newItem, oldItem) {
|
|
59
|
+
this.value = newItem === null || newItem === void 0 ? void 0 : newItem.value;
|
|
60
|
+
if (newItem === oldItem) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const items = this.getItems();
|
|
64
|
+
const match = Array.from(items)
|
|
65
|
+
.filter((item) => item === newItem)
|
|
66
|
+
.pop();
|
|
67
|
+
if (match) {
|
|
68
|
+
this.selectItem(match);
|
|
69
|
+
}
|
|
70
|
+
else if (items[0]) {
|
|
71
|
+
items[0].tabIndex = 0;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//--------------------------------------------------------------------------
|
|
75
|
+
//
|
|
76
|
+
// Lifecycle
|
|
77
|
+
//
|
|
78
|
+
//--------------------------------------------------------------------------
|
|
79
|
+
componentWillLoad() {
|
|
80
|
+
const items = this.getItems();
|
|
81
|
+
const lastChecked = Array.from(items)
|
|
82
|
+
.filter((item) => item.checked)
|
|
83
|
+
.pop();
|
|
84
|
+
if (lastChecked) {
|
|
85
|
+
this.selectItem(lastChecked);
|
|
86
|
+
}
|
|
87
|
+
else if (items[0]) {
|
|
88
|
+
items[0].tabIndex = 0;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
componentDidLoad() {
|
|
92
|
+
afterConnectDefaultValueSet(this, this.value);
|
|
93
|
+
}
|
|
94
|
+
connectedCallback() {
|
|
95
|
+
connectLabel(this);
|
|
96
|
+
connectForm(this);
|
|
97
|
+
}
|
|
98
|
+
disconnectedCallback() {
|
|
99
|
+
disconnectLabel(this);
|
|
100
|
+
disconnectForm(this);
|
|
101
|
+
}
|
|
102
|
+
componentDidRender() {
|
|
103
|
+
updateHostInteraction(this);
|
|
104
|
+
}
|
|
105
|
+
render() {
|
|
106
|
+
return (h(Host, { onClick: this.handleClick, role: "radiogroup" }, h("slot", null), h(HiddenFormInputSlot, { component: this })));
|
|
107
|
+
}
|
|
108
|
+
handleSelected(event) {
|
|
109
|
+
event.preventDefault();
|
|
110
|
+
this.selectItem(event.target);
|
|
111
|
+
event.stopPropagation();
|
|
112
|
+
}
|
|
113
|
+
handleKeyDown(event) {
|
|
114
|
+
const keys = ["ArrowLeft", "ArrowUp", "ArrowRight", "ArrowDown", " "];
|
|
115
|
+
const { key } = event;
|
|
116
|
+
const { el, selectedItem } = this;
|
|
117
|
+
if (keys.indexOf(key) === -1) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
let adjustedKey = key;
|
|
121
|
+
if (getElementDir(el) === "rtl") {
|
|
122
|
+
if (key === "ArrowRight") {
|
|
123
|
+
adjustedKey = "ArrowLeft";
|
|
124
|
+
}
|
|
125
|
+
if (key === "ArrowLeft") {
|
|
126
|
+
adjustedKey = "ArrowRight";
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
const items = this.getItems();
|
|
130
|
+
let selectedIndex = -1;
|
|
131
|
+
items.forEach((item, index) => {
|
|
132
|
+
if (item === selectedItem) {
|
|
133
|
+
selectedIndex = index;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
switch (adjustedKey) {
|
|
137
|
+
case "ArrowLeft":
|
|
138
|
+
case "ArrowUp":
|
|
139
|
+
event.preventDefault();
|
|
140
|
+
const previous = selectedIndex < 1 ? items.item(items.length - 1) : items.item(selectedIndex - 1);
|
|
141
|
+
this.selectItem(previous, true);
|
|
142
|
+
return;
|
|
143
|
+
case "ArrowRight":
|
|
144
|
+
case "ArrowDown":
|
|
145
|
+
event.preventDefault();
|
|
146
|
+
const next = selectedIndex === -1 ? items.item(1) : items.item(selectedIndex + 1) || items.item(0);
|
|
147
|
+
this.selectItem(next, true);
|
|
148
|
+
return;
|
|
149
|
+
case " ":
|
|
150
|
+
event.preventDefault();
|
|
151
|
+
this.selectItem(event.target, true);
|
|
152
|
+
return;
|
|
153
|
+
default:
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
// --------------------------------------------------------------------------
|
|
158
|
+
//
|
|
159
|
+
// Methods
|
|
160
|
+
//
|
|
161
|
+
// --------------------------------------------------------------------------
|
|
162
|
+
/** Sets focus on the component. */
|
|
163
|
+
async setFocus() {
|
|
164
|
+
var _a;
|
|
165
|
+
(_a = (this.selectedItem || this.getItems()[0])) === null || _a === void 0 ? void 0 : _a.focus();
|
|
166
|
+
}
|
|
167
|
+
//--------------------------------------------------------------------------
|
|
168
|
+
//
|
|
169
|
+
// Private Methods
|
|
170
|
+
//
|
|
171
|
+
//--------------------------------------------------------------------------
|
|
172
|
+
onLabelClick() {
|
|
173
|
+
this.setFocus();
|
|
174
|
+
}
|
|
175
|
+
getItems() {
|
|
176
|
+
return this.el.querySelectorAll("calcite-radio-group-item");
|
|
177
|
+
}
|
|
178
|
+
selectItem(selected, emit = false) {
|
|
179
|
+
if (selected === this.selectedItem) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
const items = this.getItems();
|
|
183
|
+
let match = null;
|
|
184
|
+
items.forEach((item) => {
|
|
185
|
+
const matches = item.value === selected.value;
|
|
186
|
+
if ((matches && !item.checked) || (!matches && item.checked)) {
|
|
187
|
+
item.checked = matches;
|
|
188
|
+
}
|
|
189
|
+
item.tabIndex = matches ? 0 : -1;
|
|
190
|
+
if (matches) {
|
|
191
|
+
match = item;
|
|
192
|
+
if (emit) {
|
|
193
|
+
this.calciteRadioGroupChange.emit(match.value);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
this.selectedItem = match;
|
|
198
|
+
if (Build.isBrowser && match) {
|
|
199
|
+
match.focus();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
get el() { return this; }
|
|
203
|
+
static get watchers() { return {
|
|
204
|
+
"value": ["valueHandler"],
|
|
205
|
+
"selectedItem": ["handleSelectedItemChange"]
|
|
206
|
+
}; }
|
|
207
|
+
static get style() { return radioGroupCss; }
|
|
208
|
+
}, [1, "calcite-radio-group", {
|
|
209
|
+
"appearance": [513],
|
|
210
|
+
"disabled": [516],
|
|
211
|
+
"required": [516],
|
|
212
|
+
"layout": [513],
|
|
213
|
+
"name": [513],
|
|
214
|
+
"scale": [513],
|
|
215
|
+
"value": [1025],
|
|
216
|
+
"selectedItem": [1040],
|
|
217
|
+
"width": [513],
|
|
218
|
+
"setFocus": [64]
|
|
219
|
+
}, [[0, "calciteInternalRadioGroupItemChange", "handleSelected"], [0, "keydown", "handleKeyDown"]]]);
|
|
220
|
+
function defineCustomElement() {
|
|
221
|
+
if (typeof customElements === "undefined") {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
const components = ["calcite-radio-group"];
|
|
225
|
+
components.forEach(tagName => { switch (tagName) {
|
|
226
|
+
case "calcite-radio-group":
|
|
227
|
+
if (!customElements.get(tagName)) {
|
|
228
|
+
customElements.define(tagName, RadioGroup);
|
|
229
|
+
}
|
|
230
|
+
break;
|
|
231
|
+
} });
|
|
232
|
+
}
|
|
233
|
+
defineCustomElement();
|
|
234
|
+
|
|
235
|
+
export { RadioGroup as R, defineCustomElement as d };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface RefineSelectionTools extends Components.RefineSelectionTools, HTMLElement {}
|
|
4
|
+
export const RefineSelectionTools: {
|
|
5
|
+
prototype: RefineSelectionTools;
|
|
6
|
+
new (): RefineSelectionTools;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 Esri
|
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { R as RefineSelectionTools$1, d as defineCustomElement$1 } from './refine-selection-tools2.js';
|
|
7
|
+
|
|
8
|
+
const RefineSelectionTools = RefineSelectionTools$1;
|
|
9
|
+
const defineCustomElement = defineCustomElement$1;
|
|
10
|
+
|
|
11
|
+
export { RefineSelectionTools, defineCustomElement };
|