@esri/solutions-components 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- 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,505 @@
|
|
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 { t as toAriaBoolean, i as isPrimaryPointerButton, f as focusElement } from './dom.js';
|
8
|
+
import { d as defaultMenuPlacement, f as filterComputedPlacements, c as connectFloatingUI, u as updateAfterClose, a as disconnectFloatingUI, F as FloatingCSS, r as reposition } from './floating-ui.js';
|
9
|
+
import { c as createObserver } from './observers.js';
|
10
|
+
import { u as updateHostInteraction } from './interactive.js';
|
11
|
+
import { c as connectOpenCloseComponent, d as disconnectOpenCloseComponent } from './openCloseComponent.js';
|
12
|
+
import { g as guid } from './guid.js';
|
13
|
+
import { i as isActivationKey } from './key.js';
|
14
|
+
|
15
|
+
/*!
|
16
|
+
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
17
|
+
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
18
|
+
* v1.0.0-beta.97
|
19
|
+
*/
|
20
|
+
const SLOTS = {
|
21
|
+
dropdownTrigger: "dropdown-trigger"
|
22
|
+
};
|
23
|
+
|
24
|
+
const dropdownCss = "@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:inline-flex;flex:0 1 auto}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host .calcite-dropdown-wrapper{display:block;position:absolute;z-index:900;visibility:hidden;pointer-events:none;inline-size:0;block-size:0;overflow:hidden}.calcite-dropdown-wrapper .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);visibility:hidden;transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:1;border-radius:0.25rem}.calcite-dropdown-wrapper[data-placement^=bottom] .calcite-floating-ui-anim{transform:translateY(-5px)}.calcite-dropdown-wrapper[data-placement^=top] .calcite-floating-ui-anim{transform:translateY(5px)}.calcite-dropdown-wrapper[data-placement^=left] .calcite-floating-ui-anim{transform:translateX(5px)}.calcite-dropdown-wrapper[data-placement^=right] .calcite-floating-ui-anim{transform:translateX(-5px)}.calcite-dropdown-wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:1;visibility:visible;transform:translate(0)}:host([open]) .calcite-dropdown-wrapper{pointer-events:initial;visibility:visible;inline-size:unset;block-size:unset;overflow:unset}:host .calcite-dropdown-content{max-block-size:45vh;inline-size:auto;overflow-y:auto;overflow-x:hidden;background-color:var(--calcite-ui-foreground-1);inline-size:var(--calcite-dropdown-width)}.calcite-dropdown-trigger-container{position:relative;display:flex;flex:1 1 auto}@media (forced-colors: active){:host([open]) .calcite-dropdown-wrapper{border:1px solid canvasText}}:host([width=s]){--calcite-dropdown-width:12rem}:host([width=m]){--calcite-dropdown-width:14rem}:host([width=l]){--calcite-dropdown-width:16rem}";
|
25
|
+
|
26
|
+
const Dropdown = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
27
|
+
constructor() {
|
28
|
+
super();
|
29
|
+
this.__registerHost();
|
30
|
+
this.__attachShadow();
|
31
|
+
this.calciteDropdownSelect = createEvent(this, "calciteDropdownSelect", 6);
|
32
|
+
this.calciteDropdownBeforeClose = createEvent(this, "calciteDropdownBeforeClose", 6);
|
33
|
+
this.calciteDropdownClose = createEvent(this, "calciteDropdownClose", 6);
|
34
|
+
this.calciteDropdownBeforeOpen = createEvent(this, "calciteDropdownBeforeOpen", 6);
|
35
|
+
this.calciteDropdownOpen = createEvent(this, "calciteDropdownOpen", 6);
|
36
|
+
//--------------------------------------------------------------------------
|
37
|
+
//
|
38
|
+
// Public Properties
|
39
|
+
//
|
40
|
+
//--------------------------------------------------------------------------
|
41
|
+
/**
|
42
|
+
* Opens or closes the dropdown
|
43
|
+
*
|
44
|
+
* @deprecated use open instead.
|
45
|
+
*/
|
46
|
+
this.active = false;
|
47
|
+
/** When true, opens the dropdown */
|
48
|
+
this.open = false;
|
49
|
+
/**
|
50
|
+
allow the dropdown to remain open after a selection is made
|
51
|
+
if the selection-mode of the selected item's containing group is "none", the dropdown will always close
|
52
|
+
*/
|
53
|
+
this.disableCloseOnSelect = false;
|
54
|
+
/** is the dropdown disabled */
|
55
|
+
this.disabled = false;
|
56
|
+
/**
|
57
|
+
specify the maximum number of calcite-dropdown-items to display before showing the scroller, must be greater than 0 -
|
58
|
+
this value does not include groupTitles passed to calcite-dropdown-group
|
59
|
+
*/
|
60
|
+
this.maxItems = 0;
|
61
|
+
/**
|
62
|
+
* Determines the type of positioning to use for the overlaid content.
|
63
|
+
*
|
64
|
+
* Using `"absolute"` will work for most cases. The component will be positioned inside of overflowing parent containers and will affect the container's layout.
|
65
|
+
*
|
66
|
+
* `"fixed"` should be used to escape an overflowing parent container, or when the reference element's `position` CSS property is `"fixed"`.
|
67
|
+
*
|
68
|
+
*/
|
69
|
+
this.overlayPositioning = "absolute";
|
70
|
+
/**
|
71
|
+
* Determines where the dropdown will be positioned relative to the button.
|
72
|
+
*
|
73
|
+
* @default "bottom-start"
|
74
|
+
*/
|
75
|
+
this.placement = defaultMenuPlacement;
|
76
|
+
/** specify the scale of dropdown, defaults to m */
|
77
|
+
this.scale = "m";
|
78
|
+
/**
|
79
|
+
* **read-only** The currently selected items
|
80
|
+
*
|
81
|
+
* @readonly
|
82
|
+
*/
|
83
|
+
this.selectedItems = [];
|
84
|
+
/** specify whether the dropdown is opened by hover or click of a trigger element */
|
85
|
+
this.type = "click";
|
86
|
+
this.items = [];
|
87
|
+
this.groups = [];
|
88
|
+
this.mutationObserver = createObserver("mutation", () => this.updateItems());
|
89
|
+
this.resizeObserver = createObserver("resize", (entries) => this.resizeObserverCallback(entries));
|
90
|
+
this.openTransitionProp = "visibility";
|
91
|
+
this.guid = `calcite-dropdown-${guid()}`;
|
92
|
+
this.defaultAssignedElements = [];
|
93
|
+
//--------------------------------------------------------------------------
|
94
|
+
//
|
95
|
+
// Private Methods
|
96
|
+
//
|
97
|
+
//--------------------------------------------------------------------------
|
98
|
+
this.slotChangeHandler = (event) => {
|
99
|
+
this.defaultAssignedElements = event.target.assignedElements({
|
100
|
+
flatten: true
|
101
|
+
});
|
102
|
+
this.updateItems();
|
103
|
+
};
|
104
|
+
this.setFilteredPlacements = () => {
|
105
|
+
const { el, flipPlacements } = this;
|
106
|
+
this.filteredFlipPlacements = flipPlacements
|
107
|
+
? filterComputedPlacements(flipPlacements, el)
|
108
|
+
: null;
|
109
|
+
};
|
110
|
+
this.updateTriggers = (event) => {
|
111
|
+
this.triggers = event.target.assignedElements({
|
112
|
+
flatten: true
|
113
|
+
});
|
114
|
+
this.reposition(true);
|
115
|
+
};
|
116
|
+
this.updateItems = () => {
|
117
|
+
this.items = this.groups
|
118
|
+
.map((group) => Array.from(group === null || group === void 0 ? void 0 : group.querySelectorAll("calcite-dropdown-item")))
|
119
|
+
.reduce((previousValue, currentValue) => [...previousValue, ...currentValue], []);
|
120
|
+
this.updateSelectedItems();
|
121
|
+
this.reposition(true);
|
122
|
+
};
|
123
|
+
this.updateGroups = (event) => {
|
124
|
+
const groups = event.target
|
125
|
+
.assignedElements({ flatten: true })
|
126
|
+
.filter((el) => el === null || el === void 0 ? void 0 : el.matches("calcite-dropdown-group"));
|
127
|
+
this.groups = groups;
|
128
|
+
this.updateItems();
|
129
|
+
};
|
130
|
+
this.resizeObserverCallback = (entries) => {
|
131
|
+
entries.forEach((entry) => {
|
132
|
+
const { target } = entry;
|
133
|
+
if (target === this.referenceEl) {
|
134
|
+
this.setDropdownWidth();
|
135
|
+
}
|
136
|
+
else if (target === this.scrollerEl) {
|
137
|
+
this.setMaxScrollerHeight();
|
138
|
+
}
|
139
|
+
});
|
140
|
+
};
|
141
|
+
this.setDropdownWidth = () => {
|
142
|
+
const { referenceEl, scrollerEl } = this;
|
143
|
+
const referenceElWidth = referenceEl === null || referenceEl === void 0 ? void 0 : referenceEl.clientWidth;
|
144
|
+
if (!referenceElWidth || !scrollerEl) {
|
145
|
+
return;
|
146
|
+
}
|
147
|
+
scrollerEl.style.minWidth = `${referenceElWidth}px`;
|
148
|
+
};
|
149
|
+
this.setMaxScrollerHeight = () => {
|
150
|
+
const { scrollerEl } = this;
|
151
|
+
if (!scrollerEl) {
|
152
|
+
return;
|
153
|
+
}
|
154
|
+
this.reposition(true);
|
155
|
+
const maxScrollerHeight = this.getMaxScrollerHeight();
|
156
|
+
scrollerEl.style.maxHeight = maxScrollerHeight > 0 ? `${maxScrollerHeight}px` : "";
|
157
|
+
this.reposition(true);
|
158
|
+
};
|
159
|
+
this.setScrollerAndTransitionEl = (el) => {
|
160
|
+
this.resizeObserver.observe(el);
|
161
|
+
this.scrollerEl = el;
|
162
|
+
this.transitionEl = el;
|
163
|
+
connectOpenCloseComponent(this);
|
164
|
+
};
|
165
|
+
this.setReferenceEl = (el) => {
|
166
|
+
this.referenceEl = el;
|
167
|
+
connectFloatingUI(this, this.referenceEl, this.floatingEl);
|
168
|
+
this.resizeObserver.observe(el);
|
169
|
+
};
|
170
|
+
this.setFloatingEl = (el) => {
|
171
|
+
this.floatingEl = el;
|
172
|
+
connectFloatingUI(this, this.referenceEl, this.floatingEl);
|
173
|
+
};
|
174
|
+
this.keyDownHandler = (event) => {
|
175
|
+
const target = event.target;
|
176
|
+
if (target !== this.referenceEl) {
|
177
|
+
return;
|
178
|
+
}
|
179
|
+
const { defaultPrevented, key } = event;
|
180
|
+
if (defaultPrevented) {
|
181
|
+
return;
|
182
|
+
}
|
183
|
+
if (this.open) {
|
184
|
+
if (key === "Escape") {
|
185
|
+
this.closeCalciteDropdown();
|
186
|
+
event.preventDefault();
|
187
|
+
return;
|
188
|
+
}
|
189
|
+
else if (event.shiftKey && key === "Tab") {
|
190
|
+
this.closeCalciteDropdown();
|
191
|
+
event.preventDefault();
|
192
|
+
return;
|
193
|
+
}
|
194
|
+
}
|
195
|
+
if (isActivationKey(key)) {
|
196
|
+
this.openCalciteDropdown();
|
197
|
+
event.preventDefault();
|
198
|
+
}
|
199
|
+
else if (key === "Escape") {
|
200
|
+
this.closeCalciteDropdown();
|
201
|
+
event.preventDefault();
|
202
|
+
}
|
203
|
+
};
|
204
|
+
this.focusOnFirstActiveOrFirstItem = () => {
|
205
|
+
this.getFocusableElement(this.items.find((item) => item.selected) || this.items[0]);
|
206
|
+
};
|
207
|
+
this.toggleOpenEnd = () => {
|
208
|
+
this.focusOnFirstActiveOrFirstItem();
|
209
|
+
this.el.removeEventListener("calciteDropdownOpen", this.toggleOpenEnd);
|
210
|
+
};
|
211
|
+
this.openCalciteDropdown = () => {
|
212
|
+
this.open = !this.open;
|
213
|
+
if (this.open) {
|
214
|
+
this.el.addEventListener("calciteDropdownOpen", this.toggleOpenEnd);
|
215
|
+
}
|
216
|
+
};
|
217
|
+
}
|
218
|
+
activeHandler(value) {
|
219
|
+
this.open = value;
|
220
|
+
}
|
221
|
+
openHandler(value) {
|
222
|
+
if (!this.disabled) {
|
223
|
+
if (value) {
|
224
|
+
this.reposition(true);
|
225
|
+
}
|
226
|
+
else {
|
227
|
+
updateAfterClose(this.floatingEl);
|
228
|
+
}
|
229
|
+
this.active = value;
|
230
|
+
return;
|
231
|
+
}
|
232
|
+
if (!value) {
|
233
|
+
updateAfterClose(this.floatingEl);
|
234
|
+
}
|
235
|
+
this.open = false;
|
236
|
+
}
|
237
|
+
handleDisabledChange(value) {
|
238
|
+
if (!value) {
|
239
|
+
this.open = false;
|
240
|
+
}
|
241
|
+
}
|
242
|
+
flipPlacementsHandler() {
|
243
|
+
this.setFilteredPlacements();
|
244
|
+
this.reposition(true);
|
245
|
+
}
|
246
|
+
maxItemsHandler() {
|
247
|
+
this.setMaxScrollerHeight();
|
248
|
+
}
|
249
|
+
overlayPositioningHandler() {
|
250
|
+
this.reposition(true);
|
251
|
+
}
|
252
|
+
placementHandler() {
|
253
|
+
this.reposition(true);
|
254
|
+
}
|
255
|
+
//--------------------------------------------------------------------------
|
256
|
+
//
|
257
|
+
// Lifecycle
|
258
|
+
//
|
259
|
+
//--------------------------------------------------------------------------
|
260
|
+
connectedCallback() {
|
261
|
+
var _a;
|
262
|
+
(_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.observe(this.el, { childList: true, subtree: true });
|
263
|
+
this.setFilteredPlacements();
|
264
|
+
this.reposition(true);
|
265
|
+
if (this.open) {
|
266
|
+
this.openHandler(this.open);
|
267
|
+
}
|
268
|
+
if (this.active) {
|
269
|
+
this.activeHandler(this.active);
|
270
|
+
}
|
271
|
+
connectOpenCloseComponent(this);
|
272
|
+
}
|
273
|
+
componentDidLoad() {
|
274
|
+
this.reposition(true);
|
275
|
+
}
|
276
|
+
componentDidRender() {
|
277
|
+
updateHostInteraction(this);
|
278
|
+
}
|
279
|
+
disconnectedCallback() {
|
280
|
+
var _a, _b;
|
281
|
+
(_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
282
|
+
disconnectFloatingUI(this, this.referenceEl, this.floatingEl);
|
283
|
+
(_b = this.resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
284
|
+
disconnectOpenCloseComponent(this);
|
285
|
+
}
|
286
|
+
render() {
|
287
|
+
const { open, guid } = this;
|
288
|
+
return (h(Host, null, h("div", { class: "calcite-dropdown-trigger-container", id: `${guid}-menubutton`, onClick: this.openCalciteDropdown, onKeyDown: this.keyDownHandler, ref: this.setReferenceEl }, h("slot", { "aria-controls": `${guid}-menu`, "aria-expanded": toAriaBoolean(open), "aria-haspopup": "menu", name: SLOTS.dropdownTrigger, onSlotchange: this.updateTriggers })), h("div", { "aria-hidden": toAriaBoolean(!open), class: "calcite-dropdown-wrapper", ref: this.setFloatingEl }, h("div", { "aria-labelledby": `${guid}-menubutton`, class: {
|
289
|
+
["calcite-dropdown-content"]: true,
|
290
|
+
[FloatingCSS.animation]: true,
|
291
|
+
[FloatingCSS.animationActive]: open
|
292
|
+
}, id: `${guid}-menu`, ref: this.setScrollerAndTransitionEl, role: "menu" }, h("slot", { onSlotchange: this.updateGroups })))));
|
293
|
+
}
|
294
|
+
//--------------------------------------------------------------------------
|
295
|
+
//
|
296
|
+
// Public Methods
|
297
|
+
//
|
298
|
+
//--------------------------------------------------------------------------
|
299
|
+
/**
|
300
|
+
* Updates the position of the component.
|
301
|
+
*
|
302
|
+
* @param delayed
|
303
|
+
*/
|
304
|
+
async reposition(delayed = false) {
|
305
|
+
const { floatingEl, referenceEl, placement, overlayPositioning, filteredFlipPlacements } = this;
|
306
|
+
return reposition(this, {
|
307
|
+
floatingEl,
|
308
|
+
referenceEl,
|
309
|
+
overlayPositioning,
|
310
|
+
placement,
|
311
|
+
flipPlacements: filteredFlipPlacements,
|
312
|
+
type: "menu"
|
313
|
+
}, delayed);
|
314
|
+
}
|
315
|
+
closeCalciteDropdownOnClick(event) {
|
316
|
+
if (!isPrimaryPointerButton(event) || !this.open || event.composedPath().includes(this.el)) {
|
317
|
+
return;
|
318
|
+
}
|
319
|
+
this.closeCalciteDropdown(false);
|
320
|
+
}
|
321
|
+
closeCalciteDropdownOnEvent(event) {
|
322
|
+
this.closeCalciteDropdown();
|
323
|
+
event.stopPropagation();
|
324
|
+
}
|
325
|
+
closeCalciteDropdownOnOpenEvent(event) {
|
326
|
+
if (event.composedPath().includes(this.el)) {
|
327
|
+
return;
|
328
|
+
}
|
329
|
+
this.open = false;
|
330
|
+
}
|
331
|
+
mouseEnterHandler() {
|
332
|
+
if (this.type === "hover") {
|
333
|
+
this.openCalciteDropdown();
|
334
|
+
}
|
335
|
+
}
|
336
|
+
mouseLeaveHandler() {
|
337
|
+
if (this.type === "hover") {
|
338
|
+
this.closeCalciteDropdown();
|
339
|
+
}
|
340
|
+
}
|
341
|
+
calciteInternalDropdownItemKeyEvent(event) {
|
342
|
+
const { keyboardEvent } = event.detail;
|
343
|
+
// handle edge
|
344
|
+
const target = keyboardEvent.target;
|
345
|
+
const itemToFocus = target.nodeName !== "A" ? target : target.parentNode;
|
346
|
+
const isFirstItem = this.itemIndex(itemToFocus) === 0;
|
347
|
+
const isLastItem = this.itemIndex(itemToFocus) === this.items.length - 1;
|
348
|
+
switch (keyboardEvent.key) {
|
349
|
+
case "Tab":
|
350
|
+
if (isLastItem && !keyboardEvent.shiftKey) {
|
351
|
+
this.closeCalciteDropdown();
|
352
|
+
}
|
353
|
+
else if (isFirstItem && keyboardEvent.shiftKey) {
|
354
|
+
this.closeCalciteDropdown();
|
355
|
+
}
|
356
|
+
else if (keyboardEvent.shiftKey) {
|
357
|
+
this.focusPrevItem(itemToFocus);
|
358
|
+
}
|
359
|
+
else {
|
360
|
+
this.focusNextItem(itemToFocus);
|
361
|
+
}
|
362
|
+
break;
|
363
|
+
case "ArrowDown":
|
364
|
+
this.focusNextItem(itemToFocus);
|
365
|
+
break;
|
366
|
+
case "ArrowUp":
|
367
|
+
this.focusPrevItem(itemToFocus);
|
368
|
+
break;
|
369
|
+
case "Home":
|
370
|
+
this.focusFirstItem();
|
371
|
+
break;
|
372
|
+
case "End":
|
373
|
+
this.focusLastItem();
|
374
|
+
break;
|
375
|
+
}
|
376
|
+
event.stopPropagation();
|
377
|
+
}
|
378
|
+
handleItemSelect(event) {
|
379
|
+
this.updateSelectedItems();
|
380
|
+
event.stopPropagation();
|
381
|
+
this.calciteDropdownSelect.emit({
|
382
|
+
item: event.detail.requestedDropdownItem
|
383
|
+
});
|
384
|
+
if (!this.disableCloseOnSelect ||
|
385
|
+
event.detail.requestedDropdownGroup.selectionMode === "none") {
|
386
|
+
this.closeCalciteDropdown();
|
387
|
+
}
|
388
|
+
event.stopPropagation();
|
389
|
+
}
|
390
|
+
onBeforeOpen() {
|
391
|
+
this.calciteDropdownBeforeOpen.emit();
|
392
|
+
}
|
393
|
+
onOpen() {
|
394
|
+
this.calciteDropdownOpen.emit();
|
395
|
+
}
|
396
|
+
onBeforeClose() {
|
397
|
+
this.calciteDropdownBeforeClose.emit();
|
398
|
+
}
|
399
|
+
onClose() {
|
400
|
+
this.calciteDropdownClose.emit();
|
401
|
+
}
|
402
|
+
updateSelectedItems() {
|
403
|
+
this.selectedItems = this.items.filter((item) => item.selected);
|
404
|
+
}
|
405
|
+
getMaxScrollerHeight() {
|
406
|
+
const { maxItems, items } = this;
|
407
|
+
let itemsToProcess = 0;
|
408
|
+
let maxScrollerHeight = 0;
|
409
|
+
let groupHeaderHeight;
|
410
|
+
this.groups.forEach((group) => {
|
411
|
+
if (maxItems > 0 && itemsToProcess < maxItems) {
|
412
|
+
Array.from(group.children).forEach((item, index) => {
|
413
|
+
if (index === 0) {
|
414
|
+
if (isNaN(groupHeaderHeight)) {
|
415
|
+
groupHeaderHeight = item.offsetTop;
|
416
|
+
}
|
417
|
+
maxScrollerHeight += groupHeaderHeight;
|
418
|
+
}
|
419
|
+
if (itemsToProcess < maxItems) {
|
420
|
+
maxScrollerHeight += item.offsetHeight;
|
421
|
+
itemsToProcess += 1;
|
422
|
+
}
|
423
|
+
});
|
424
|
+
}
|
425
|
+
});
|
426
|
+
return items.length > maxItems ? maxScrollerHeight : 0;
|
427
|
+
}
|
428
|
+
closeCalciteDropdown(focusTrigger = true) {
|
429
|
+
this.open = false;
|
430
|
+
if (focusTrigger) {
|
431
|
+
focusElement(this.triggers[0]);
|
432
|
+
}
|
433
|
+
}
|
434
|
+
focusFirstItem() {
|
435
|
+
const firstItem = this.items[0];
|
436
|
+
this.getFocusableElement(firstItem);
|
437
|
+
}
|
438
|
+
focusLastItem() {
|
439
|
+
const lastItem = this.items[this.items.length - 1];
|
440
|
+
this.getFocusableElement(lastItem);
|
441
|
+
}
|
442
|
+
focusNextItem(el) {
|
443
|
+
const index = this.itemIndex(el);
|
444
|
+
const nextItem = this.items[index + 1] || this.items[0];
|
445
|
+
this.getFocusableElement(nextItem);
|
446
|
+
}
|
447
|
+
focusPrevItem(el) {
|
448
|
+
const index = this.itemIndex(el);
|
449
|
+
const prevItem = this.items[index - 1] || this.items[this.items.length - 1];
|
450
|
+
this.getFocusableElement(prevItem);
|
451
|
+
}
|
452
|
+
itemIndex(el) {
|
453
|
+
return this.items.indexOf(el);
|
454
|
+
}
|
455
|
+
getFocusableElement(item) {
|
456
|
+
if (!item) {
|
457
|
+
return;
|
458
|
+
}
|
459
|
+
const target = item.attributes.isLink
|
460
|
+
? item.shadowRoot.querySelector("a")
|
461
|
+
: item;
|
462
|
+
focusElement(target);
|
463
|
+
}
|
464
|
+
get el() { return this; }
|
465
|
+
static get watchers() { return {
|
466
|
+
"active": ["activeHandler"],
|
467
|
+
"open": ["openHandler"],
|
468
|
+
"disabled": ["handleDisabledChange"],
|
469
|
+
"flipPlacements": ["flipPlacementsHandler"],
|
470
|
+
"maxItems": ["maxItemsHandler"],
|
471
|
+
"overlayPositioning": ["overlayPositioningHandler"],
|
472
|
+
"placement": ["placementHandler"]
|
473
|
+
}; }
|
474
|
+
static get style() { return dropdownCss; }
|
475
|
+
}, [1, "calcite-dropdown", {
|
476
|
+
"active": [1540],
|
477
|
+
"open": [1540],
|
478
|
+
"disableCloseOnSelect": [516, "disable-close-on-select"],
|
479
|
+
"disabled": [516],
|
480
|
+
"flipPlacements": [16],
|
481
|
+
"maxItems": [514, "max-items"],
|
482
|
+
"overlayPositioning": [513, "overlay-positioning"],
|
483
|
+
"placement": [513],
|
484
|
+
"scale": [513],
|
485
|
+
"selectedItems": [1040],
|
486
|
+
"type": [513],
|
487
|
+
"width": [513],
|
488
|
+
"reposition": [64]
|
489
|
+
}, [[9, "pointerdown", "closeCalciteDropdownOnClick"], [0, "calciteInternalDropdownCloseRequest", "closeCalciteDropdownOnEvent"], [8, "calciteDropdownOpen", "closeCalciteDropdownOnOpenEvent"], [1, "pointerenter", "mouseEnterHandler"], [1, "pointerleave", "mouseLeaveHandler"], [0, "calciteInternalDropdownItemKeyEvent", "calciteInternalDropdownItemKeyEvent"], [0, "calciteInternalDropdownItemSelect", "handleItemSelect"]]]);
|
490
|
+
function defineCustomElement() {
|
491
|
+
if (typeof customElements === "undefined") {
|
492
|
+
return;
|
493
|
+
}
|
494
|
+
const components = ["calcite-dropdown"];
|
495
|
+
components.forEach(tagName => { switch (tagName) {
|
496
|
+
case "calcite-dropdown":
|
497
|
+
if (!customElements.get(tagName)) {
|
498
|
+
customElements.define(tagName, Dropdown);
|
499
|
+
}
|
500
|
+
break;
|
501
|
+
} });
|
502
|
+
}
|
503
|
+
defineCustomElement();
|
504
|
+
|
505
|
+
export { Dropdown as D, defineCustomElement as d };
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
2
|
+
|
3
|
+
interface EditRecordModal extends Components.EditRecordModal, HTMLElement {}
|
4
|
+
export const EditRecordModal: {
|
5
|
+
prototype: EditRecordModal;
|
6
|
+
new (): EditRecordModal;
|
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 { E as EditRecordModal$1, d as defineCustomElement$1 } from './edit-record-modal2.js';
|
7
|
+
|
8
|
+
const EditRecordModal = EditRecordModal$1;
|
9
|
+
const defineCustomElement = defineCustomElement$1;
|
10
|
+
|
11
|
+
export { EditRecordModal, defineCustomElement };
|
@@ -0,0 +1,161 @@
|
|
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, h, Host } from '@stencil/core/internal/client';
|
7
|
+
import { g as getLocaleComponentStrings } from './locale.js';
|
8
|
+
import { d as defineCustomElement$8 } from './button.js';
|
9
|
+
import { d as defineCustomElement$7 } from './icon.js';
|
10
|
+
import { d as defineCustomElement$6 } from './input.js';
|
11
|
+
import { d as defineCustomElement$5 } from './label.js';
|
12
|
+
import { d as defineCustomElement$4 } from './loader.js';
|
13
|
+
import { d as defineCustomElement$3 } from './modal.js';
|
14
|
+
import { d as defineCustomElement$2 } from './progress.js';
|
15
|
+
import { d as defineCustomElement$1 } from './scrim.js';
|
16
|
+
|
17
|
+
const editRecordModalCss = ":host{display:block}.padding-bottom-1{padding-bottom:1rem}.font-bold{font-weight:var(--calcite-font-weight-bold)}.font-500{font-weight:var(--calcite-font-weight-medium)}.font-italic{font-style:italic}";
|
18
|
+
|
19
|
+
const EditRecordModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
20
|
+
constructor() {
|
21
|
+
super();
|
22
|
+
this.__registerHost();
|
23
|
+
this.__attachShadow();
|
24
|
+
this.open = false;
|
25
|
+
this._translations = undefined;
|
26
|
+
}
|
27
|
+
//--------------------------------------------------------------------------
|
28
|
+
//
|
29
|
+
// Properties (protected)
|
30
|
+
//
|
31
|
+
//--------------------------------------------------------------------------
|
32
|
+
//--------------------------------------------------------------------------
|
33
|
+
//
|
34
|
+
// Watch handlers
|
35
|
+
//
|
36
|
+
//--------------------------------------------------------------------------
|
37
|
+
//--------------------------------------------------------------------------
|
38
|
+
//
|
39
|
+
// Methods (public)
|
40
|
+
//
|
41
|
+
//--------------------------------------------------------------------------
|
42
|
+
//--------------------------------------------------------------------------
|
43
|
+
//
|
44
|
+
// Events (public)
|
45
|
+
//
|
46
|
+
//--------------------------------------------------------------------------
|
47
|
+
//--------------------------------------------------------------------------
|
48
|
+
//
|
49
|
+
// Functions (lifecycle)
|
50
|
+
//
|
51
|
+
//--------------------------------------------------------------------------
|
52
|
+
/**
|
53
|
+
* StencilJS: Called once just after the component is first connected to the DOM.
|
54
|
+
*
|
55
|
+
* @returns Promise when complete
|
56
|
+
*/
|
57
|
+
async componentWillLoad() {
|
58
|
+
await this._getTranslations();
|
59
|
+
}
|
60
|
+
/**
|
61
|
+
* Renders the component.
|
62
|
+
*/
|
63
|
+
render() {
|
64
|
+
return (h(Host, null, h("div", null, h("calcite-modal", { open: this.open, width: "s" }, h("div", { class: "font-500", slot: "header" }, this._translations.editMultiple), h("div", { slot: "content" }, h("calcite-label", { class: "font-italic" }, this._translations.infoMessage), this._getFieldInputs()), h("calcite-button", { appearance: "outline", onClick: () => this._cancel(), slot: "secondary", width: "full" }, this._translations.cancel), h("calcite-button", { appearance: "solid", onClick: () => this._save(), slot: "primary", width: "full" }, this._translations.save)))));
|
65
|
+
}
|
66
|
+
//--------------------------------------------------------------------------
|
67
|
+
//
|
68
|
+
// Functions (protected)
|
69
|
+
//
|
70
|
+
//--------------------------------------------------------------------------
|
71
|
+
_getFieldInputs() {
|
72
|
+
// TODO don't follow what these are so just hard-coding for now
|
73
|
+
const labels = [
|
74
|
+
this._translations.label,
|
75
|
+
this._translations.label,
|
76
|
+
this._translations.label,
|
77
|
+
this._translations.label,
|
78
|
+
this._translations.label
|
79
|
+
];
|
80
|
+
return labels.map(label => {
|
81
|
+
return (h("div", { class: "padding-bottom-1" }, h("calcite-label", { class: "font-bold" }, label, h("calcite-input", { placeholder: this._translations.textField, type: "text" }))));
|
82
|
+
});
|
83
|
+
}
|
84
|
+
_cancel() {
|
85
|
+
this.open = false;
|
86
|
+
}
|
87
|
+
_save() {
|
88
|
+
this.open = false;
|
89
|
+
}
|
90
|
+
/**
|
91
|
+
* Fetches the component's translations
|
92
|
+
*
|
93
|
+
* @returns Promise when complete
|
94
|
+
* @protected
|
95
|
+
*/
|
96
|
+
async _getTranslations() {
|
97
|
+
const messages = await getLocaleComponentStrings(this.el);
|
98
|
+
this._translations = messages[0];
|
99
|
+
}
|
100
|
+
get el() { return this; }
|
101
|
+
static get style() { return editRecordModalCss; }
|
102
|
+
}, [1, "edit-record-modal", {
|
103
|
+
"open": [1028],
|
104
|
+
"_translations": [32]
|
105
|
+
}]);
|
106
|
+
function defineCustomElement() {
|
107
|
+
if (typeof customElements === "undefined") {
|
108
|
+
return;
|
109
|
+
}
|
110
|
+
const components = ["edit-record-modal", "calcite-button", "calcite-icon", "calcite-input", "calcite-label", "calcite-loader", "calcite-modal", "calcite-progress", "calcite-scrim"];
|
111
|
+
components.forEach(tagName => { switch (tagName) {
|
112
|
+
case "edit-record-modal":
|
113
|
+
if (!customElements.get(tagName)) {
|
114
|
+
customElements.define(tagName, EditRecordModal);
|
115
|
+
}
|
116
|
+
break;
|
117
|
+
case "calcite-button":
|
118
|
+
if (!customElements.get(tagName)) {
|
119
|
+
defineCustomElement$8();
|
120
|
+
}
|
121
|
+
break;
|
122
|
+
case "calcite-icon":
|
123
|
+
if (!customElements.get(tagName)) {
|
124
|
+
defineCustomElement$7();
|
125
|
+
}
|
126
|
+
break;
|
127
|
+
case "calcite-input":
|
128
|
+
if (!customElements.get(tagName)) {
|
129
|
+
defineCustomElement$6();
|
130
|
+
}
|
131
|
+
break;
|
132
|
+
case "calcite-label":
|
133
|
+
if (!customElements.get(tagName)) {
|
134
|
+
defineCustomElement$5();
|
135
|
+
}
|
136
|
+
break;
|
137
|
+
case "calcite-loader":
|
138
|
+
if (!customElements.get(tagName)) {
|
139
|
+
defineCustomElement$4();
|
140
|
+
}
|
141
|
+
break;
|
142
|
+
case "calcite-modal":
|
143
|
+
if (!customElements.get(tagName)) {
|
144
|
+
defineCustomElement$3();
|
145
|
+
}
|
146
|
+
break;
|
147
|
+
case "calcite-progress":
|
148
|
+
if (!customElements.get(tagName)) {
|
149
|
+
defineCustomElement$2();
|
150
|
+
}
|
151
|
+
break;
|
152
|
+
case "calcite-scrim":
|
153
|
+
if (!customElements.get(tagName)) {
|
154
|
+
defineCustomElement$1();
|
155
|
+
}
|
156
|
+
break;
|
157
|
+
} });
|
158
|
+
}
|
159
|
+
defineCustomElement();
|
160
|
+
|
161
|
+
export { EditRecordModal as E, defineCustomElement as d };
|