@esri/solutions-components 0.2.2 → 0.2.4
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/assets/t9n/solution-config-modal/resources.json +22 -0
- package/dist/assets/t9n/solution-config-modal/resources_en.json +22 -0
- package/dist/cjs/calcite-action-menu_2.cjs.entry.js +18 -401
- package/dist/cjs/calcite-action-menu_2.cjs.entry.js.map +1 -1
- package/dist/cjs/calcite-action_2.cjs.entry.js +423 -71
- package/dist/cjs/calcite-action_2.cjs.entry.js.map +1 -1
- package/dist/cjs/calcite-loader.cjs.entry.js +97 -0
- package/dist/cjs/calcite-loader.cjs.entry.js.map +1 -0
- package/dist/cjs/{solution-configuration.cjs.entry.js → calcite-modal_2.cjs.entry.js} +451 -13
- package/dist/cjs/calcite-modal_2.cjs.entry.js.map +1 -0
- package/dist/cjs/{calcite-shell-panel_14.cjs.entry.js → calcite-panel_12.cjs.entry.js} +455 -709
- package/dist/cjs/calcite-panel_12.cjs.entry.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/solution-config-modal.cjs.entry.js +131 -0
- package/dist/cjs/solution-config-modal.cjs.entry.js.map +1 -0
- package/dist/cjs/{solution-contents_3.cjs.entry.js → solution-contents_7.cjs.entry.js} +664 -5
- package/dist/cjs/solution-contents_7.cjs.entry.js.map +1 -0
- package/dist/cjs/{solution-store-893499a5.js → solution-store-09b3fc53.js} +4 -6
- package/dist/cjs/solution-store-09b3fc53.js.map +1 -0
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/solution-config-modal/solution-config-modal.css +91 -0
- package/dist/collection/components/solution-config-modal/solution-config-modal.js +245 -0
- package/dist/collection/components/solution-config-modal/solution-config-modal.js.map +1 -0
- package/dist/collection/components/solution-configuration/solution-configuration.js +23 -17
- package/dist/collection/components/solution-configuration/solution-configuration.js.map +1 -1
- package/dist/collection/components/solution-item/solution-item.js +0 -2
- package/dist/collection/components/solution-item/solution-item.js.map +1 -1
- package/dist/collection/components/solution-item-details/solution-item-details.js +0 -13
- package/dist/collection/components/solution-item-details/solution-item-details.js.map +1 -1
- package/dist/collection/utils/solution-store.js +3 -5
- package/dist/collection/utils/solution-store.js.map +1 -1
- package/dist/collection/utils/solution-store.ts +3 -5
- package/dist/esm/buffer-tools_6.entry.js +2 -2
- package/dist/esm/calcite-action-bar_6.entry.js +2 -2
- package/dist/esm/calcite-action-menu_2.entry.js +20 -403
- package/dist/esm/calcite-action-menu_2.entry.js.map +1 -1
- package/dist/esm/calcite-action_2.entry.js +424 -72
- package/dist/esm/calcite-action_2.entry.js.map +1 -1
- package/dist/esm/calcite-combobox_3.entry.js +2 -2
- package/dist/esm/calcite-loader.entry.js +93 -0
- package/dist/esm/calcite-loader.entry.js.map +1 -0
- package/dist/esm/{solution-configuration.entry.js → calcite-modal_2.entry.js} +453 -16
- package/dist/esm/calcite-modal_2.entry.js.map +1 -0
- package/dist/esm/{calcite-shell-panel_14.entry.js → calcite-panel_12.entry.js} +454 -706
- package/dist/esm/calcite-panel_12.entry.js.map +1 -0
- package/dist/esm/config-layer-picker.entry.js +2 -2
- package/dist/esm/{interfaces-e2a2064d.js → interfaces-1bdfc3a8.js} +2 -2
- package/dist/esm/{interfaces-e2a2064d.js.map → interfaces-1bdfc3a8.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{mapViewUtils-09f1e7bd.js → mapViewUtils-809947c8.js} +2 -2
- package/dist/esm/{mapViewUtils-09f1e7bd.js.map → mapViewUtils-809947c8.js.map} +1 -1
- package/dist/esm/public-notification.entry.js +2 -2
- package/dist/esm/solution-config-modal.entry.js +127 -0
- package/dist/esm/solution-config-modal.entry.js.map +1 -0
- package/dist/esm/{solution-contents_3.entry.js → solution-contents_7.entry.js} +661 -6
- package/dist/esm/solution-contents_7.entry.js.map +1 -0
- package/dist/esm/{solution-store-0c58c852.js → solution-store-d8519c64.js} +5 -7
- package/dist/esm/solution-store-d8519c64.js.map +1 -0
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/{p-be1ed982.entry.js → p-11068040.entry.js} +3 -3
- package/dist/solutions-components/{p-be1ed982.entry.js.map → p-11068040.entry.js.map} +0 -0
- package/dist/solutions-components/{p-659edb14.js → p-2910dd9e.js} +5 -7
- package/dist/{cjs/solution-store-893499a5.js.map → solutions-components/p-2910dd9e.js.map} +1 -1
- package/dist/solutions-components/{p-291fd295.entry.js → p-30810b45.entry.js} +3 -3
- package/dist/solutions-components/{p-291fd295.entry.js.map → p-30810b45.entry.js.map} +0 -0
- package/dist/solutions-components/p-38ddadf2.entry.js +342 -0
- package/dist/solutions-components/p-38ddadf2.entry.js.map +1 -0
- package/dist/solutions-components/{p-77c75f3a.entry.js → p-5b20090f.entry.js} +661 -6
- package/dist/solutions-components/p-5b20090f.entry.js.map +1 -0
- package/dist/solutions-components/{p-9393631c.entry.js → p-9ef1328a.entry.js} +3 -3
- package/dist/solutions-components/{p-9393631c.entry.js.map → p-9ef1328a.entry.js.map} +0 -0
- package/dist/solutions-components/{p-984cb687.entry.js → p-a1786d11.entry.js} +454 -706
- package/dist/solutions-components/p-a1786d11.entry.js.map +1 -0
- package/dist/solutions-components/{p-fe0fdd8b.js → p-c20bd963.js} +2 -2
- package/dist/solutions-components/{p-fe0fdd8b.js.map → p-c20bd963.js.map} +1 -1
- package/dist/solutions-components/p-c5721b0f.entry.js +127 -0
- package/dist/solutions-components/p-c5721b0f.entry.js.map +1 -0
- package/dist/solutions-components/{p-24d75151.entry.js → p-c818e661.entry.js} +3 -3
- package/dist/solutions-components/{p-24d75151.entry.js.map → p-c818e661.entry.js.map} +0 -0
- package/dist/solutions-components/{p-90629c1d.entry.js → p-cf59eb16.entry.js} +453 -16
- package/dist/solutions-components/p-cf59eb16.entry.js.map +1 -0
- package/dist/solutions-components/p-e405ebe8.entry.js +93 -0
- package/dist/solutions-components/p-e405ebe8.entry.js.map +1 -0
- package/dist/solutions-components/{p-77e6b03c.entry.js → p-e6fb9cde.entry.js} +3 -3
- package/dist/solutions-components/{p-77e6b03c.entry.js.map → p-e6fb9cde.entry.js.map} +0 -0
- package/dist/solutions-components/{p-97c4a268.entry.js → p-ef6f9e24.entry.js} +113 -229
- package/dist/solutions-components/p-ef6f9e24.entry.js.map +1 -0
- package/dist/solutions-components/{p-6b9dc092.js → p-f04fdb9a.js} +2 -2
- package/dist/solutions-components/{p-6b9dc092.js.map → p-f04fdb9a.js.map} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/solution-store.ts +3 -5
- package/dist/solutions-components_commit.txt +8 -8
- package/dist/types/components/solution-config-modal/solution-config-modal.d.ts +69 -0
- package/dist/types/components/solution-configuration/solution-configuration.d.ts +4 -2
- package/dist/types/components/solution-item-details/solution-item-details.d.ts +0 -1
- package/dist/types/components.d.ts +43 -5
- package/dist/types/preact.d.ts +4 -0
- package/package.json +1 -1
- package/dist/cjs/calcite-modal.cjs.entry.js +0 -449
- package/dist/cjs/calcite-modal.cjs.entry.js.map +0 -1
- package/dist/cjs/calcite-panel_2.cjs.entry.js +0 -439
- package/dist/cjs/calcite-panel_2.cjs.entry.js.map +0 -1
- package/dist/cjs/calcite-scrim.cjs.entry.js +0 -64
- package/dist/cjs/calcite-scrim.cjs.entry.js.map +0 -1
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js.map +0 -1
- package/dist/cjs/solution-configuration.cjs.entry.js.map +0 -1
- package/dist/cjs/solution-contents_3.cjs.entry.js.map +0 -1
- package/dist/esm/calcite-modal.entry.js +0 -445
- package/dist/esm/calcite-modal.entry.js.map +0 -1
- package/dist/esm/calcite-panel_2.entry.js +0 -434
- package/dist/esm/calcite-panel_2.entry.js.map +0 -1
- package/dist/esm/calcite-scrim.entry.js +0 -60
- package/dist/esm/calcite-scrim.entry.js.map +0 -1
- package/dist/esm/calcite-shell-panel_14.entry.js.map +0 -1
- package/dist/esm/solution-configuration.entry.js.map +0 -1
- package/dist/esm/solution-contents_3.entry.js.map +0 -1
- package/dist/esm/solution-store-0c58c852.js.map +0 -1
- package/dist/solutions-components/p-0fda7d9e.entry.js +0 -434
- package/dist/solutions-components/p-0fda7d9e.entry.js.map +0 -1
- package/dist/solutions-components/p-2ff754ce.entry.js +0 -257
- package/dist/solutions-components/p-2ff754ce.entry.js.map +0 -1
- package/dist/solutions-components/p-30a6199a.entry.js +0 -445
- package/dist/solutions-components/p-30a6199a.entry.js.map +0 -1
- package/dist/solutions-components/p-659edb14.js.map +0 -1
- package/dist/solutions-components/p-77c75f3a.entry.js.map +0 -1
- package/dist/solutions-components/p-90629c1d.entry.js.map +0 -1
- package/dist/solutions-components/p-97c4a268.entry.js.map +0 -1
- package/dist/solutions-components/p-984cb687.entry.js.map +0 -1
- package/dist/solutions-components/p-f5268b4f.entry.js +0 -60
- package/dist/solutions-components/p-f5268b4f.entry.js.map +0 -1
|
@@ -3,26 +3,441 @@
|
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { r as registerInstance, c as createEvent, h,
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement, f as forceUpdate, H as Host } from './p-58c69df2.js';
|
|
7
|
+
import { S as SLOTS$4, C as CSS$3, I as ICONS$1, T as TEXT$1, H as HEADING_LEVEL } from './p-b359dc78.js';
|
|
8
|
+
import { b as getElementDir, t as toAriaBoolean, a as getSlotted, i as isPrimaryPointerButton, n as nodeListToArray, l as filterDirectChildren, g as getElementProp } from './p-32a67cb2.js';
|
|
9
|
+
import { H as Heading } from './p-eeb0321d.js';
|
|
10
|
+
import { S as SLOTS$5 } from './p-6e0da576.js';
|
|
11
|
+
import { u as updateHostInteraction } from './p-7daea1df.js';
|
|
12
|
+
import { c as createObserver } from './p-9a9955db.js';
|
|
9
13
|
import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './p-5cf33602.js';
|
|
14
|
+
import { c as clamp } from './p-63f6e8f1.js';
|
|
10
15
|
import { g as guid } from './p-a80b3880.js';
|
|
11
|
-
import { c as createObserver } from './p-9a9955db.js';
|
|
12
|
-
import { u as updateHostInteraction } from './p-7daea1df.js';
|
|
13
16
|
import { S as Sortable } from './p-77182c3a.js';
|
|
14
17
|
import { o as getItemIndex, m as mutationObserverCallback, d as deselectRemovedItems, a as deselectSiblingItems, s as selectSiblings, h as handleFilter, g as getItemData, k as keyDownHandler, p as moveItemIndex, i as initialize, b as initializeObserver, c as cleanUpObserver, j as calciteListFocusOutHandler, r as removeItem, e as calciteListItemChangeHandler, f as calciteInternalListItemValueChangeHandler, l as setUpItems, n as setFocus, L as List } from './p-13b37f05.js';
|
|
15
18
|
import { I as ICON_TYPES$1 } from './p-b978636e.js';
|
|
16
|
-
import { C as CSS$
|
|
19
|
+
import { C as CSS$4, S as SLOTS$6 } from './p-de5416e8.js';
|
|
17
20
|
import { g as getLocaleComponentStrings } from './p-20bdf42f.js';
|
|
18
|
-
import { s as state, E as EFileType } from './p-659edb14.js';
|
|
19
|
-
import { c as EUpdateType } from './p-6b9dc092.js';
|
|
20
21
|
import './p-729708a3.js';
|
|
21
22
|
import './p-e947d3b0.js';
|
|
22
23
|
import './p-ae1fd76b.js';
|
|
23
24
|
import './p-4e32bf8c.js';
|
|
24
25
|
import './p-3b010ce1.js';
|
|
25
|
-
|
|
26
|
+
|
|
27
|
+
const panelCss = "@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}}:host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}: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{position:relative;display:flex;inline-size:100%;flex:1 1 auto;overflow:hidden;--calcite-min-header-height:calc(var(--calcite-icon-size) * 3);--calcite-panel-max-height:unset;--calcite-panel-width:100%;--calcite-panel-min-width:unset;--calcite-panel-max-width:unset}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.header{margin:0px;display:flex;align-content:space-between;align-items:center;fill:var(--calcite-ui-text-2);color:var(--calcite-ui-text-2)}.heading{margin:0px;padding:0px;font-weight:var(--calcite-font-weight-medium)}.header .heading{flex:1 1 auto;padding:0.5rem}.container{margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;background-color:var(--calcite-ui-background);padding:0px;max-block-size:var(--calcite-panel-max-height);inline-size:var(--calcite-panel-width);max-inline-size:var(--calcite-panel-max-width);min-inline-size:var(--calcite-panel-min-width);transition:max-block-size var(--calcite-animation-timing), inline-size var(--calcite-animation-timing)}:host([height-scale=s]){--calcite-panel-max-height:40vh}:host([height-scale=m]){--calcite-panel-max-height:60vh}:host([height-scale=l]){--calcite-panel-max-height:80vh}:host([width-scale=s]){--calcite-panel-width:calc(var(--calcite-panel-width-multiplier) * 12vw);--calcite-panel-max-width:calc(var(--calcite-panel-width-multiplier) * 300px);--calcite-panel-min-width:calc(var(--calcite-panel-width-multiplier) * 150px)}:host([width-scale=m]){--calcite-panel-width:calc(var(--calcite-panel-width-multiplier) * 20vw);--calcite-panel-max-width:calc(var(--calcite-panel-width-multiplier) * 420px);--calcite-panel-min-width:calc(var(--calcite-panel-width-multiplier) * 240px)}:host([width-scale=l]){--calcite-panel-width:calc(var(--calcite-panel-width-multiplier) * 45vw);--calcite-panel-max-width:calc(var(--calcite-panel-width-multiplier) * 680px);--calcite-panel-min-width:calc(var(--calcite-panel-width-multiplier) * 340px)}.container[hidden]{display:none}.header{-webkit-border-after:1px solid;border-block-end:1px solid;position:sticky;inset-block-start:0px;z-index:400;inline-size:100%;align-items:stretch;justify-content:flex-start;background-color:var(--calcite-ui-foreground-1);border-block-end-color:var(--calcite-ui-border-3);flex:0 0 auto}.header-content{display:flex;flex-direction:column;overflow:hidden;padding-inline:0.75rem;padding-block:0.875rem;-webkit-margin-end:auto;margin-inline-end:auto}.header-content .heading,.header-content .description{display:block;overflow-wrap:break-word;padding:0px}.header-content .heading{margin-inline:0px;margin-block:0px 0.25rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;font-weight:var(--calcite-font-weight-medium)}.header-content .heading:only-child{-webkit-margin-after:0px;margin-block-end:0px}.header-content .description{font-size:var(--calcite-font-size--1);line-height:1rem;color:var(--calcite-ui-text-2)}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-ui-border-3);border-inline-end-width:1px}.header-actions{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:stretch}.header-actions--end{-webkit-margin-start:auto;margin-inline-start:auto}.content-wrapper{overflow:auto}.content-height{block-size:100%}.content-container{display:flex;flex:1 1 auto;flex-direction:column;flex-wrap:nowrap;align-items:stretch;background-color:var(--calcite-ui-background)}.footer{-webkit-border-before:1px solid;border-block-start:1px solid;position:sticky;inset-block-end:0px;display:flex;inline-size:100%;justify-content:space-evenly;background-color:var(--calcite-ui-foreground-1);border-block-start-color:var(--calcite-ui-border-3);flex:0 0 auto;min-block-size:3rem;padding:0.5rem}.fab-container{position:sticky;inset-block-end:0px;z-index:300;margin-block:0px;margin-inline:auto;display:block;padding:0.5rem;inset-inline:0;inline-size:-moz-fit-content;inline-size:fit-content}[hidden]{display:none}";
|
|
28
|
+
|
|
29
|
+
const Panel = class {
|
|
30
|
+
constructor(hostRef) {
|
|
31
|
+
registerInstance(this, hostRef);
|
|
32
|
+
this.calcitePanelClose = createEvent(this, "calcitePanelClose", 6);
|
|
33
|
+
this.calcitePanelDismiss = createEvent(this, "calcitePanelDismiss", 6);
|
|
34
|
+
this.calcitePanelDismissedChange = createEvent(this, "calcitePanelDismissedChange", 6);
|
|
35
|
+
this.calcitePanelScroll = createEvent(this, "calcitePanelScroll", 6);
|
|
36
|
+
this.calcitePanelBackClick = createEvent(this, "calcitePanelBackClick", 6);
|
|
37
|
+
// --------------------------------------------------------------------------
|
|
38
|
+
//
|
|
39
|
+
// Properties
|
|
40
|
+
//
|
|
41
|
+
// --------------------------------------------------------------------------
|
|
42
|
+
/**
|
|
43
|
+
* When `true`, hides the component.
|
|
44
|
+
*
|
|
45
|
+
* @deprecated use `closed` instead.
|
|
46
|
+
*/
|
|
47
|
+
this.dismissed = false;
|
|
48
|
+
/** When `true`, the component will be hidden. */
|
|
49
|
+
this.closed = false;
|
|
50
|
+
/**
|
|
51
|
+
* When `true`, interaction is prevented and the component is displayed with lower opacity.
|
|
52
|
+
*/
|
|
53
|
+
this.disabled = false;
|
|
54
|
+
/**
|
|
55
|
+
* When `true`, a close button is added to the component.
|
|
56
|
+
*
|
|
57
|
+
* @deprecated use `closable` instead
|
|
58
|
+
*/
|
|
59
|
+
this.dismissible = false;
|
|
60
|
+
/** When `true`, displays a close button in the trailing side of the header. */
|
|
61
|
+
this.closable = false;
|
|
62
|
+
/**
|
|
63
|
+
* When `true`, displays a back button in the header.
|
|
64
|
+
*
|
|
65
|
+
* @deprecated use `calcite-flow-item` instead.
|
|
66
|
+
*/
|
|
67
|
+
this.showBackButton = false;
|
|
68
|
+
/**
|
|
69
|
+
* When `true`, a busy indicator is displayed.
|
|
70
|
+
*/
|
|
71
|
+
this.loading = false;
|
|
72
|
+
/**
|
|
73
|
+
* When `true`, the action menu items in the `header-menu-actions` slot are open.
|
|
74
|
+
*/
|
|
75
|
+
this.menuOpen = false;
|
|
76
|
+
this.resizeObserver = createObserver("resize", () => this.resizeHandler());
|
|
77
|
+
this.hasStartActions = false;
|
|
78
|
+
this.hasEndActions = false;
|
|
79
|
+
this.hasMenuItems = false;
|
|
80
|
+
this.hasHeaderContent = false;
|
|
81
|
+
this.hasFooterContent = false;
|
|
82
|
+
this.hasFooterActions = false;
|
|
83
|
+
this.hasFab = false;
|
|
84
|
+
// --------------------------------------------------------------------------
|
|
85
|
+
//
|
|
86
|
+
// Private Methods
|
|
87
|
+
//
|
|
88
|
+
// --------------------------------------------------------------------------
|
|
89
|
+
this.resizeHandler = () => {
|
|
90
|
+
const { panelScrollEl } = this;
|
|
91
|
+
if (!panelScrollEl ||
|
|
92
|
+
typeof panelScrollEl.scrollHeight !== "number" ||
|
|
93
|
+
typeof panelScrollEl.offsetHeight !== "number") {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
panelScrollEl.tabIndex = panelScrollEl.scrollHeight > panelScrollEl.offsetHeight ? 0 : -1;
|
|
97
|
+
};
|
|
98
|
+
this.setContainerRef = (node) => {
|
|
99
|
+
this.containerEl = node;
|
|
100
|
+
};
|
|
101
|
+
this.setCloseRef = (node) => {
|
|
102
|
+
this.closeButtonEl = node;
|
|
103
|
+
};
|
|
104
|
+
this.setBackRef = (node) => {
|
|
105
|
+
this.backButtonEl = node;
|
|
106
|
+
};
|
|
107
|
+
this.panelKeyDownHandler = (event) => {
|
|
108
|
+
if (this.closable && event.key === "Escape" && !event.defaultPrevented) {
|
|
109
|
+
this.close();
|
|
110
|
+
event.preventDefault();
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
this.close = () => {
|
|
114
|
+
this.closed = true;
|
|
115
|
+
this.calcitePanelDismiss.emit();
|
|
116
|
+
this.calcitePanelClose.emit();
|
|
117
|
+
};
|
|
118
|
+
this.panelScrollHandler = () => {
|
|
119
|
+
this.calcitePanelScroll.emit();
|
|
120
|
+
};
|
|
121
|
+
this.backButtonClick = () => {
|
|
122
|
+
this.calcitePanelBackClick.emit();
|
|
123
|
+
};
|
|
124
|
+
this.handleHeaderActionsStartSlotChange = (event) => {
|
|
125
|
+
const elements = event.target.assignedElements({
|
|
126
|
+
flatten: true
|
|
127
|
+
});
|
|
128
|
+
this.hasStartActions = !!elements.length;
|
|
129
|
+
};
|
|
130
|
+
this.handleHeaderActionsEndSlotChange = (event) => {
|
|
131
|
+
const elements = event.target.assignedElements({
|
|
132
|
+
flatten: true
|
|
133
|
+
});
|
|
134
|
+
this.hasEndActions = !!elements.length;
|
|
135
|
+
};
|
|
136
|
+
this.handleHeaderMenuActionsSlotChange = (event) => {
|
|
137
|
+
const elements = event.target.assignedElements({
|
|
138
|
+
flatten: true
|
|
139
|
+
});
|
|
140
|
+
this.hasMenuItems = !!elements.length;
|
|
141
|
+
};
|
|
142
|
+
this.handleHeaderContentSlotChange = (event) => {
|
|
143
|
+
const elements = event.target.assignedElements({
|
|
144
|
+
flatten: true
|
|
145
|
+
});
|
|
146
|
+
this.hasHeaderContent = !!elements.length;
|
|
147
|
+
};
|
|
148
|
+
this.handleFooterSlotChange = (event) => {
|
|
149
|
+
const elements = event.target.assignedElements({
|
|
150
|
+
flatten: true
|
|
151
|
+
});
|
|
152
|
+
this.hasFooterContent = !!elements.length;
|
|
153
|
+
};
|
|
154
|
+
this.handleFooterActionsSlotChange = (event) => {
|
|
155
|
+
const elements = event.target.assignedElements({
|
|
156
|
+
flatten: true
|
|
157
|
+
});
|
|
158
|
+
this.hasFooterActions = !!elements.length;
|
|
159
|
+
};
|
|
160
|
+
this.handleFabSlotChange = (event) => {
|
|
161
|
+
const elements = event.target.assignedElements({
|
|
162
|
+
flatten: true
|
|
163
|
+
});
|
|
164
|
+
this.hasFab = !!elements.length;
|
|
165
|
+
};
|
|
166
|
+
this.setPanelScrollEl = (el) => {
|
|
167
|
+
var _a, _b;
|
|
168
|
+
this.panelScrollEl = el;
|
|
169
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
170
|
+
if (el) {
|
|
171
|
+
(_b = this.resizeObserver) === null || _b === void 0 ? void 0 : _b.observe(el);
|
|
172
|
+
this.resizeHandler();
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
dismissedHandler(value) {
|
|
177
|
+
this.closed = value;
|
|
178
|
+
this.calcitePanelDismissedChange.emit();
|
|
179
|
+
}
|
|
180
|
+
closedHandler(value) {
|
|
181
|
+
this.dismissed = value;
|
|
182
|
+
}
|
|
183
|
+
dismissibleHandler(value) {
|
|
184
|
+
this.closable = value;
|
|
185
|
+
}
|
|
186
|
+
closableHandler(value) {
|
|
187
|
+
this.dismissible = value;
|
|
188
|
+
}
|
|
189
|
+
//--------------------------------------------------------------------------
|
|
190
|
+
//
|
|
191
|
+
// Lifecycle
|
|
192
|
+
//
|
|
193
|
+
//--------------------------------------------------------------------------
|
|
194
|
+
componentDidRender() {
|
|
195
|
+
updateHostInteraction(this);
|
|
196
|
+
}
|
|
197
|
+
// --------------------------------------------------------------------------
|
|
198
|
+
//
|
|
199
|
+
// Lifecycle
|
|
200
|
+
//
|
|
201
|
+
// --------------------------------------------------------------------------
|
|
202
|
+
connectedCallback() {
|
|
203
|
+
const isClosed = this.dismissed || this.closed;
|
|
204
|
+
const isClosable = this.dismissible || this.closable;
|
|
205
|
+
if (isClosed) {
|
|
206
|
+
this.dismissedHandler(isClosed);
|
|
207
|
+
this.closedHandler(isClosed);
|
|
208
|
+
}
|
|
209
|
+
if (isClosable) {
|
|
210
|
+
this.dismissibleHandler(isClosable);
|
|
211
|
+
this.closableHandler(isClosable);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
disconnectedCallback() {
|
|
215
|
+
var _a;
|
|
216
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
217
|
+
}
|
|
218
|
+
// --------------------------------------------------------------------------
|
|
219
|
+
//
|
|
220
|
+
// Methods
|
|
221
|
+
//
|
|
222
|
+
// --------------------------------------------------------------------------
|
|
223
|
+
/**
|
|
224
|
+
* Sets focus on the component.
|
|
225
|
+
*
|
|
226
|
+
* @param focusId
|
|
227
|
+
*/
|
|
228
|
+
async setFocus(focusId) {
|
|
229
|
+
const { backButtonEl, closeButtonEl, containerEl } = this;
|
|
230
|
+
if (focusId === "back-button") {
|
|
231
|
+
backButtonEl === null || backButtonEl === void 0 ? void 0 : backButtonEl.setFocus();
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
if (focusId === "dismiss-button") {
|
|
235
|
+
closeButtonEl === null || closeButtonEl === void 0 ? void 0 : closeButtonEl.setFocus();
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
if (backButtonEl) {
|
|
239
|
+
backButtonEl.setFocus();
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
if (closeButtonEl) {
|
|
243
|
+
closeButtonEl.setFocus();
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
containerEl === null || containerEl === void 0 ? void 0 : containerEl.focus();
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Scrolls the component's content to a specified set of coordinates.
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* myCalciteFlowItem.scrollContentTo({
|
|
253
|
+
* left: 0, // Specifies the number of pixels along the X axis to scroll the window or element.
|
|
254
|
+
* top: 0, // Specifies the number of pixels along the Y axis to scroll the window or element
|
|
255
|
+
* behavior: "auto" // Specifies whether the scrolling should animate smoothly (smooth), or happen instantly in a single jump (auto, the default value).
|
|
256
|
+
* });
|
|
257
|
+
* @param options
|
|
258
|
+
*/
|
|
259
|
+
async scrollContentTo(options) {
|
|
260
|
+
var _a;
|
|
261
|
+
(_a = this.panelScrollEl) === null || _a === void 0 ? void 0 : _a.scrollTo(options);
|
|
262
|
+
}
|
|
263
|
+
// --------------------------------------------------------------------------
|
|
264
|
+
//
|
|
265
|
+
// Render Methods
|
|
266
|
+
//
|
|
267
|
+
// --------------------------------------------------------------------------
|
|
268
|
+
renderBackButton() {
|
|
269
|
+
const { el } = this;
|
|
270
|
+
const rtl = getElementDir(el) === "rtl";
|
|
271
|
+
const { showBackButton, intlBack, backButtonClick } = this;
|
|
272
|
+
const label = intlBack || TEXT$1.back;
|
|
273
|
+
const icon = rtl ? ICONS$1.backRight : ICONS$1.backLeft;
|
|
274
|
+
return showBackButton ? (h("calcite-action", { "aria-label": label, class: CSS$3.backButton, icon: icon, key: "back-button", onClick: backButtonClick, ref: this.setBackRef, scale: "s", slot: SLOTS$4.headerActionsStart, text: label })) : null;
|
|
275
|
+
}
|
|
276
|
+
renderHeaderContent() {
|
|
277
|
+
const { heading, headingLevel, summary, description, hasHeaderContent } = this;
|
|
278
|
+
const headingNode = heading ? (h(Heading, { class: CSS$3.heading, level: headingLevel || HEADING_LEVEL }, heading)) : null;
|
|
279
|
+
const descriptionNode = description || summary ? h("span", { class: CSS$3.description }, description || summary) : null;
|
|
280
|
+
return !hasHeaderContent && (headingNode || descriptionNode) ? (h("div", { class: CSS$3.headerContent, key: "header-content" }, headingNode, descriptionNode)) : null;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Allows user to override the entire header-content node.
|
|
284
|
+
*/
|
|
285
|
+
renderHeaderSlottedContent() {
|
|
286
|
+
return (h("div", { class: CSS$3.headerContent, hidden: !this.hasHeaderContent, key: "slotted-header-content" }, h("slot", { name: SLOTS$4.headerContent, onSlotchange: this.handleHeaderContentSlotChange })));
|
|
287
|
+
}
|
|
288
|
+
renderHeaderStartActions() {
|
|
289
|
+
const { hasStartActions } = this;
|
|
290
|
+
return (h("div", { class: { [CSS$3.headerActionsStart]: true, [CSS$3.headerActions]: true }, hidden: !hasStartActions, key: "header-actions-start" }, h("slot", { name: SLOTS$4.headerActionsStart, onSlotchange: this.handleHeaderActionsStartSlotChange })));
|
|
291
|
+
}
|
|
292
|
+
renderHeaderActionsEnd() {
|
|
293
|
+
const { close, hasEndActions, intlClose, closable } = this;
|
|
294
|
+
const text = intlClose || TEXT$1.close;
|
|
295
|
+
const closableNode = closable ? (h("calcite-action", { "aria-label": text, icon: ICONS$1.close, onClick: close, ref: this.setCloseRef, text: text })) : null;
|
|
296
|
+
const slotNode = (h("slot", { name: SLOTS$4.headerActionsEnd, onSlotchange: this.handleHeaderActionsEndSlotChange }));
|
|
297
|
+
const showContainer = hasEndActions || closableNode;
|
|
298
|
+
return (h("div", { class: { [CSS$3.headerActionsEnd]: true, [CSS$3.headerActions]: true }, hidden: !showContainer, key: "header-actions-end" }, slotNode, closableNode));
|
|
299
|
+
}
|
|
300
|
+
renderMenu() {
|
|
301
|
+
const { hasMenuItems, intlOptions, menuOpen } = this;
|
|
302
|
+
return (h("calcite-action-menu", { flipPlacements: ["top", "bottom"], hidden: !hasMenuItems, key: "menu", label: intlOptions || TEXT$1.options, open: menuOpen, placement: "bottom-end" }, h("calcite-action", { icon: ICONS$1.menu, slot: SLOTS$5.trigger, text: intlOptions || TEXT$1.options }), h("slot", { name: SLOTS$4.headerMenuActions, onSlotchange: this.handleHeaderMenuActionsSlotChange })));
|
|
303
|
+
}
|
|
304
|
+
renderHeaderNode() {
|
|
305
|
+
const { showBackButton, hasHeaderContent, hasStartActions, hasEndActions, closable, hasMenuItems } = this;
|
|
306
|
+
const headerContentNode = this.renderHeaderContent();
|
|
307
|
+
const showHeader = showBackButton ||
|
|
308
|
+
hasHeaderContent ||
|
|
309
|
+
headerContentNode ||
|
|
310
|
+
hasStartActions ||
|
|
311
|
+
hasEndActions ||
|
|
312
|
+
closable ||
|
|
313
|
+
hasMenuItems;
|
|
314
|
+
return (h("header", { class: CSS$3.header, hidden: !showHeader }, this.renderBackButton(), this.renderHeaderStartActions(), this.renderHeaderSlottedContent(), headerContentNode, this.renderHeaderActionsEnd(), this.renderMenu()));
|
|
315
|
+
}
|
|
316
|
+
renderFooterNode() {
|
|
317
|
+
const { hasFooterContent, hasFooterActions } = this;
|
|
318
|
+
const showFooter = hasFooterContent || hasFooterActions;
|
|
319
|
+
return (h("footer", { class: CSS$3.footer, hidden: !showFooter }, h("slot", { key: "footer-slot", name: SLOTS$4.footer, onSlotchange: this.handleFooterSlotChange }), h("slot", { key: "footer-actions-slot", name: SLOTS$4.footerActions, onSlotchange: this.handleFooterActionsSlotChange })));
|
|
320
|
+
}
|
|
321
|
+
renderContent() {
|
|
322
|
+
const { hasFab } = this;
|
|
323
|
+
const defaultSlotNode = h("slot", { key: "default-slot" });
|
|
324
|
+
const containerNode = hasFab ? (h("section", { class: CSS$3.contentContainer }, defaultSlotNode)) : (defaultSlotNode);
|
|
325
|
+
return (h("div", { class: {
|
|
326
|
+
[CSS$3.contentWrapper]: true,
|
|
327
|
+
[CSS$3.contentContainer]: !hasFab,
|
|
328
|
+
[CSS$3.contentHeight]: hasFab
|
|
329
|
+
}, onScroll: this.panelScrollHandler, ref: this.setPanelScrollEl }, containerNode, this.renderFab()));
|
|
330
|
+
}
|
|
331
|
+
renderFab() {
|
|
332
|
+
return (h("div", { class: CSS$3.fabContainer, hidden: !this.hasFab }, h("slot", { name: SLOTS$4.fab, onSlotchange: this.handleFabSlotChange })));
|
|
333
|
+
}
|
|
334
|
+
render() {
|
|
335
|
+
const { loading, panelKeyDownHandler, closed, closable } = this;
|
|
336
|
+
const panelNode = (h("article", { "aria-busy": toAriaBoolean(loading), class: CSS$3.container, hidden: closed, onKeyDown: panelKeyDownHandler, ref: this.setContainerRef, tabIndex: closable ? 0 : -1 }, this.renderHeaderNode(), this.renderContent(), this.renderFooterNode()));
|
|
337
|
+
return (h(Fragment, null, loading ? h("calcite-scrim", { loading: loading }) : null, panelNode));
|
|
338
|
+
}
|
|
339
|
+
get el() { return getElement(this); }
|
|
340
|
+
static get watchers() { return {
|
|
341
|
+
"dismissed": ["dismissedHandler"],
|
|
342
|
+
"closed": ["closedHandler"],
|
|
343
|
+
"dismissible": ["dismissibleHandler"],
|
|
344
|
+
"closable": ["closableHandler"]
|
|
345
|
+
}; }
|
|
346
|
+
};
|
|
347
|
+
Panel.style = panelCss;
|
|
348
|
+
|
|
349
|
+
/*!
|
|
350
|
+
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
351
|
+
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
352
|
+
* v1.0.0-beta.97
|
|
353
|
+
*/
|
|
354
|
+
const CSS$2 = {
|
|
355
|
+
main: "main",
|
|
356
|
+
mainReversed: "main--reversed",
|
|
357
|
+
content: "content",
|
|
358
|
+
contentBehind: "content--behind",
|
|
359
|
+
footer: "footer"
|
|
360
|
+
};
|
|
361
|
+
const SLOTS$3 = {
|
|
362
|
+
centerRow: "center-row",
|
|
363
|
+
primaryPanel: "primary-panel",
|
|
364
|
+
contextualPanel: "contextual-panel",
|
|
365
|
+
panelStart: "panel-start",
|
|
366
|
+
panelEnd: "panel-end",
|
|
367
|
+
header: "header",
|
|
368
|
+
footer: "footer"
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
const shellCss = "@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}}:host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{position:absolute;inset:0px;display:flex;block-size:100%;inline-size:100%;flex-direction:column;overflow:hidden;--calcite-shell-tip-spacing:26vw}.main{position:relative;display:flex;block-size:100%;inline-size:100%;flex:1 1 auto;flex-direction:row;justify-content:space-between;overflow:hidden}.main--reversed{flex-direction:row-reverse}.content{display:flex;block-size:100%;inline-size:100%;flex-direction:column;flex-wrap:nowrap;overflow:auto}.content ::slotted(calcite-shell-center-row),.content ::slotted(calcite-panel),.content ::slotted(calcite-flow){flex:1 1 auto;align-self:stretch;max-block-size:unset}.content--behind{position:absolute;inset:0px;border-width:0px;z-index:calc(1 - 1);display:initial}::slotted(calcite-shell-center-row){inline-size:unset}::slotted(.header .heading){font-size:var(--calcite-font-size--2);line-height:1.375;font-weight:var(--calcite-font-weight-normal)}slot[name=panel-end]::slotted(calcite-shell-panel){-webkit-margin-start:auto;margin-inline-start:auto}::slotted(calcite-shell-panel),::slotted(calcite-shell-center-row){position:relative;z-index:1}::slotted(calcite-panel),::slotted(calcite-flow){border-width:1px;border-inline-start-width:0px;border-inline-end-width:0px;border-style:solid;border-color:var(--calcite-ui-border-3)}slot[name=center-row]::slotted(calcite-shell-center-row:not([detached])){border-inline-start-width:1px;border-inline-end-width:1px;border-color:var(--calcite-ui-border-3)}::slotted(calcite-tip-manager){position:absolute;z-index:500;box-sizing:border-box}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}::slotted(calcite-tip-manager){animation:in-up var(--calcite-internal-animation-timing-slow) ease-in-out;border-radius:0.25rem;--tw-shadow:0 6px 20px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.08);--tw-shadow-colored:0 6px 20px -4px var(--tw-shadow-color), 0 4px 12px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);inset-block-end:0.5rem;inset-inline:var(--calcite-shell-tip-spacing)}";
|
|
372
|
+
|
|
373
|
+
const Shell = class {
|
|
374
|
+
constructor(hostRef) {
|
|
375
|
+
registerInstance(this, hostRef);
|
|
376
|
+
// --------------------------------------------------------------------------
|
|
377
|
+
//
|
|
378
|
+
// Properties
|
|
379
|
+
//
|
|
380
|
+
// --------------------------------------------------------------------------
|
|
381
|
+
/**
|
|
382
|
+
* Positions the center content behind any `calcite-shell-panel`s.
|
|
383
|
+
*/
|
|
384
|
+
this.contentBehind = false;
|
|
385
|
+
}
|
|
386
|
+
// --------------------------------------------------------------------------
|
|
387
|
+
//
|
|
388
|
+
// Lifecycle
|
|
389
|
+
//
|
|
390
|
+
// --------------------------------------------------------------------------
|
|
391
|
+
connectedCallback() {
|
|
392
|
+
connectConditionalSlotComponent(this);
|
|
393
|
+
}
|
|
394
|
+
disconnectedCallback() {
|
|
395
|
+
disconnectConditionalSlotComponent(this);
|
|
396
|
+
}
|
|
397
|
+
// --------------------------------------------------------------------------
|
|
398
|
+
//
|
|
399
|
+
// Render Methods
|
|
400
|
+
//
|
|
401
|
+
// --------------------------------------------------------------------------
|
|
402
|
+
renderHeader() {
|
|
403
|
+
const hasHeader = !!getSlotted(this.el, SLOTS$3.header);
|
|
404
|
+
return hasHeader ? h("slot", { key: "header", name: SLOTS$3.header }) : null;
|
|
405
|
+
}
|
|
406
|
+
renderContent() {
|
|
407
|
+
const defaultSlotNode = h("slot", { key: "default-slot" });
|
|
408
|
+
const centerRowSlotNode = h("slot", { key: "center-row-slot", name: SLOTS$3.centerRow });
|
|
409
|
+
const contentContainerKey = "content-container";
|
|
410
|
+
const content = !!this.contentBehind
|
|
411
|
+
? [
|
|
412
|
+
h("div", { class: {
|
|
413
|
+
[CSS$2.content]: true,
|
|
414
|
+
[CSS$2.contentBehind]: true
|
|
415
|
+
}, key: contentContainerKey }, defaultSlotNode),
|
|
416
|
+
centerRowSlotNode
|
|
417
|
+
]
|
|
418
|
+
: [
|
|
419
|
+
h("div", { class: CSS$2.content, key: contentContainerKey }, defaultSlotNode, centerRowSlotNode)
|
|
420
|
+
];
|
|
421
|
+
return content;
|
|
422
|
+
}
|
|
423
|
+
renderFooter() {
|
|
424
|
+
const hasFooter = !!getSlotted(this.el, SLOTS$3.footer);
|
|
425
|
+
return hasFooter ? (h("div", { class: CSS$2.footer, key: "footer" }, h("slot", { name: SLOTS$3.footer }))) : null;
|
|
426
|
+
}
|
|
427
|
+
renderMain() {
|
|
428
|
+
const primaryPanel = getSlotted(this.el, SLOTS$3.primaryPanel);
|
|
429
|
+
const mainClasses = {
|
|
430
|
+
[CSS$2.main]: true,
|
|
431
|
+
[CSS$2.mainReversed]: (primaryPanel === null || primaryPanel === void 0 ? void 0 : primaryPanel.position) === "end"
|
|
432
|
+
};
|
|
433
|
+
return (h("div", { class: mainClasses }, h("slot", { name: SLOTS$3.primaryPanel }), h("slot", { name: SLOTS$3.panelStart }), this.renderContent(), h("slot", { name: SLOTS$3.panelEnd }), h("slot", { name: SLOTS$3.contextualPanel })));
|
|
434
|
+
}
|
|
435
|
+
render() {
|
|
436
|
+
return (h(Fragment, null, this.renderHeader(), this.renderMain(), this.renderFooter()));
|
|
437
|
+
}
|
|
438
|
+
get el() { return getElement(this); }
|
|
439
|
+
};
|
|
440
|
+
Shell.style = shellCss;
|
|
26
441
|
|
|
27
442
|
/*!
|
|
28
443
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
@@ -1377,19 +1792,19 @@ const ValueListItem = class {
|
|
|
1377
1792
|
renderActionsEnd() {
|
|
1378
1793
|
const { el } = this;
|
|
1379
1794
|
const hasActionsEnd = getSlotted(el, SLOTS.actionsEnd);
|
|
1380
|
-
return hasActionsEnd ? (h("slot", { name: SLOTS.actionsEnd, slot: SLOTS$
|
|
1795
|
+
return hasActionsEnd ? (h("slot", { name: SLOTS.actionsEnd, slot: SLOTS$6.actionsEnd })) : null;
|
|
1381
1796
|
}
|
|
1382
1797
|
renderActionsStart() {
|
|
1383
1798
|
const { el } = this;
|
|
1384
1799
|
const hasActionsStart = getSlotted(el, SLOTS.actionsStart);
|
|
1385
|
-
return hasActionsStart ? (h("slot", { name: SLOTS.actionsStart, slot: SLOTS$
|
|
1800
|
+
return hasActionsStart ? (h("slot", { name: SLOTS.actionsStart, slot: SLOTS$6.actionsStart })) : null;
|
|
1386
1801
|
}
|
|
1387
1802
|
renderHandle() {
|
|
1388
1803
|
const { icon } = this;
|
|
1389
1804
|
if (icon === ICON_TYPES$1.grip) {
|
|
1390
1805
|
return (h("span", { class: {
|
|
1391
|
-
[CSS$
|
|
1392
|
-
[CSS$
|
|
1806
|
+
[CSS$4.handle]: true,
|
|
1807
|
+
[CSS$4.handleActivated]: this.handleActivated
|
|
1393
1808
|
}, "data-js-handle": true, onBlur: this.handleBlur, onKeyDown: this.handleKeyDown, role: "button", tabindex: "0" }, h("calcite-icon", { icon: ICONS.drag, scale: "s" })));
|
|
1394
1809
|
}
|
|
1395
1810
|
}
|
|
@@ -1790,27 +2205,18 @@ const JsonEditor = class {
|
|
|
1790
2205
|
};
|
|
1791
2206
|
JsonEditor.style = jsonEditorCss;
|
|
1792
2207
|
|
|
1793
|
-
const
|
|
2208
|
+
const solutionOrganizationVariablesCss = ":host{display:block;box-sizing:border-box;margin-left:0.75rem;margin-right:0.75rem;min-width:0;flex-grow:0;flex-shrink:1}:host-group-1-up>.block{flex-basis:calc(100% - 1.5rem);width:calc(100% - 1.5rem)}:host-group-2-up>.block{flex-basis:calc(50% - 1.5rem);width:calc(50% - 1.5rem)}:host-group-3-up>.block{flex-basis:calc(33.33333% - 1.5rem);width:calc(33.33333% - 1.5rem)}:host-group-4-up>.block{flex-basis:calc(25% - 1.5rem);width:calc(25% - 1.5rem)}:host-group-5-up>.block{flex-basis:calc(20% - 1.5rem);width:calc(20% - 1.5rem)}:host-group-6-up>.block{flex-basis:calc(16.66666% - 1.5rem);width:calc(16.66666% - 1.5rem)}:host-group-7-up>.block{flex-basis:calc(14.2857% - 1.5rem);width:calc(14.2857% - 1.5rem)}:host-group-8-up>.block{flex-basis:calc(12.5% - 1.5rem);width:calc(12.5% - 1.5rem)}.tablet-block-group-1-up>:host{flex-basis:calc(100% - 1.5rem);width:calc(100% - 1.5rem)}.tablet-block-group-2-up>:host{flex-basis:calc(50% - 1.5rem);width:calc(50% - 1.5rem)}.tablet-block-group-3-up>:host{flex-basis:calc(33.33333% - 1.5rem);width:calc(33.33333% - 1.5rem)}.tablet-block-group-4-up>:host{flex-basis:calc(25% - 1.5rem);width:calc(25% - 1.5rem)}.tablet-block-group-5-up>:host{flex-basis:calc(20% - 1.5rem);width:calc(20% - 1.5rem)}.tablet-block-group-6-up>:host{flex-basis:calc(16.66666% - 1.5rem);width:calc(16.66666% - 1.5rem)}.tablet-block-group-7-up>:host{flex-basis:calc(14.2857% - 1.5rem);width:calc(14.2857% - 1.5rem)}.tablet-block-group-8-up>:host{flex-basis:calc(12.5% - 1.5rem);width:calc(12.5% - 1.5rem)}.phone-block-group-1-up>:host{flex-basis:calc(100% - 1.5rem);width:calc(100% - 1.5rem)}.phone-block-group-2-up>:host{flex-basis:calc(50% - 1.5rem);width:calc(50% - 1.5rem)}.phone-block-group-3-up>:host{flex-basis:calc(33.33333% - 1.5rem);width:calc(33.33333% - 1.5rem)}.phone-block-group-4-up>:host{flex-basis:calc(25% - 1.5rem);width:calc(25% - 1.5rem)}.phone-block-group-5-up>:host{flex-basis:calc(20% - 1.5rem);width:calc(20% - 1.5rem)}.phone-block-group-6-up>:host{flex-basis:calc(16.66666% - 1.5rem);width:calc(16.66666% - 1.5rem)}.phone-block-group-7-up>:host{flex-basis:calc(14.2857% - 1.5rem);width:calc(14.2857% - 1.5rem)}.phone-block-group-8-up>:host{flex-basis:calc(12.5% - 1.5rem);width:calc(12.5% - 1.5rem)}.code-face :host{letter-spacing:0em;font-family:\"Consolas\", \"Andale Mono\", \"Lucida Console\", \"Monaco\", monospace;font-weight:400;font-style:normal}.code-face :host b,.code-face :host strong{font-weight:400}.code-italic :host{letter-spacing:0em;font-family:\"Consolas\", \"Andale Mono\", \"Lucida Console\", \"Monaco\", monospace;font-weight:400;font-style:italic}.code-italic :host b,.code-italic :host strong{font-weight:400}.container-border{overflow-y:auto}.org-var-header{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1rem}";
|
|
1794
2209
|
|
|
1795
|
-
const
|
|
2210
|
+
const SolutionOrganizationVariables = class {
|
|
1796
2211
|
constructor(hostRef) {
|
|
1797
2212
|
registerInstance(this, hostRef);
|
|
1798
|
-
this.
|
|
1799
|
-
this.
|
|
1800
|
-
|
|
1801
|
-
description: "",
|
|
1802
|
-
licenseInfo: "",
|
|
1803
|
-
snippet: "",
|
|
1804
|
-
tags: [],
|
|
1805
|
-
title: ""
|
|
1806
|
-
};
|
|
1807
|
-
this.itemEdit = undefined;
|
|
2213
|
+
this.organizationVariableSelected = createEvent(this, "organizationVariableSelected", 7);
|
|
2214
|
+
this.value = "";
|
|
2215
|
+
this._organizationVariables = [];
|
|
1808
2216
|
this._translations = undefined;
|
|
1809
|
-
this.thumbnail = undefined;
|
|
1810
|
-
this.thumbnailContainer = undefined;
|
|
1811
2217
|
}
|
|
1812
|
-
|
|
1813
|
-
|
|
2218
|
+
valueWatchHandler() {
|
|
2219
|
+
this._organizationVariables = JSON.parse(this.value);
|
|
1814
2220
|
}
|
|
1815
2221
|
//--------------------------------------------------------------------------
|
|
1816
2222
|
//
|
|
@@ -1823,74 +2229,14 @@ const SolutionItemDetails = class {
|
|
|
1823
2229
|
async componentWillLoad() {
|
|
1824
2230
|
return this._getTranslations();
|
|
1825
2231
|
}
|
|
1826
|
-
async componentWillRender() {
|
|
1827
|
-
console.log("update item details " + this.itemId); //???
|
|
1828
|
-
this.itemEdit = state.getItemInfo(this.itemId);
|
|
1829
|
-
if (this.itemEdit) {
|
|
1830
|
-
this.itemDetails = this.itemEdit.item;
|
|
1831
|
-
this.itemType = this.itemDetails.type;
|
|
1832
|
-
}
|
|
1833
|
-
return Promise.resolve();
|
|
1834
|
-
}
|
|
1835
2232
|
/**
|
|
1836
2233
|
* Renders the component.
|
|
1837
2234
|
*/
|
|
1838
2235
|
render() {
|
|
1839
|
-
|
|
1840
|
-
console.log(" title " + this.itemDetails.title); //???
|
|
1841
|
-
console.log(" snippet " + this.itemDetails.snippet); //???
|
|
1842
|
-
return (h(Host, null, h("div", { class: "parent-container" }, h("div", { class: "inputBottomSeparation" }, h("calcite-input", { id: "item-title", value: this.itemDetails.title })), h("div", { class: "inputBottomSeparation" }, h("input", { accept: ".jpg,.gif,.png,image/jpg,image/gif,image/png", class: "display-none", onChange: (event) => (this._updateThumbnail(event)), ref: (el) => (this.browseForThumbnail = el), type: "file" }), h("button", { class: "font-size--3 btn-link inline-block trailer-quarter", onClick: () => this._getThumbnail() }, h("svg", { class: "icon-inline icon-inline--on-left", height: "16", viewBox: "0 0 16 16", width: "16" }, h("path", { d: "M14.792 2.666l-1.414-1.413a.965.965 0 0 0-1.385-.03l-1.444 1.444-8.763 8.72L.03 15.481a.371.371 0 0 0 .488.488l4.096-1.756 8.763-8.72-.001-.001.002.002 1.443-1.444a.965.965 0 0 0-.03-1.385zM1.569 14.431l.554-1.293.74.739zm2.338-.924l-1.414-1.414 7.963-7.92 1.414 1.415zm8.67-8.626l-1.413-1.414 1.29-1.29a.306.306 0 0 1 .433 0l.981.98a.306.306 0 0 1 0 .433z" })), this._translations.editThumbnail), h("div", { class: "flex" }, h("div", { class: "img-container", ref: (el) => (this.thumbnailContainer = el) }, h("img", { class: "scale-down", height: "133", id: "item-thumbnail", ref: (el) => (this.thumbnail = el), width: "200" })), h("div", { class: "snippet-count-container" }, h("calcite-input", { id: "item-snippet", maxlength: 250, type: "textarea", value: this.itemDetails.snippet }), h("label", { class: "font-size--3", id: "item-snippet-count", ref: (el) => (this.itemSnippetCount = el) })))), h("calcite-label", null, this._translations.description, h("label", { id: "item-description-label" }, h("calcite-input", { id: "item-description", type: "textarea", value: this.itemDetails.description }))), h("calcite-label", null, this._translations.tags, h("label", { id: "item-tags-label" }, h("calcite-input", { id: "item-tags", value: (this.itemDetails.tags && Array.isArray(this.itemDetails.tags) ? this.itemDetails.tags : [this.itemDetails.tags]).join(",") }))), this.itemType !== "Group" ? h("calcite-label", null, this._translations.credits, h("label", { id: "item-credits-label" }, h("calcite-input", { id: "item-credits", value: this.itemDetails.accessInformation }))) : null, this.itemType !== "Group" ? h("calcite-label", null, h("label", { id: "item-terms-label" }, this._translations.termsOfUse, h("calcite-input", { id: "item-terms", type: "textarea", value: this.itemDetails.licenseInfo }))) : null)));
|
|
1843
|
-
}
|
|
1844
|
-
componentDidRender() {
|
|
1845
|
-
this._loadThumb();
|
|
1846
|
-
}
|
|
1847
|
-
//--------------------------------------------------------------------------
|
|
1848
|
-
//
|
|
1849
|
-
// Event Listeners
|
|
1850
|
-
//
|
|
1851
|
-
//--------------------------------------------------------------------------
|
|
1852
|
-
/**
|
|
1853
|
-
* Updates the component's value with changes to the input fields.
|
|
1854
|
-
*/
|
|
1855
|
-
inputReceivedHandler(event) {
|
|
1856
|
-
switch (event.target.id) {
|
|
1857
|
-
case "item-title":
|
|
1858
|
-
this.itemDetails.title = event.target.value;
|
|
1859
|
-
this._updateStore();
|
|
1860
|
-
break;
|
|
1861
|
-
case "item-snippet":
|
|
1862
|
-
if (event.target.value.length > 250) {
|
|
1863
|
-
event.target.value = event.target.value.substring(0, 250);
|
|
1864
|
-
}
|
|
1865
|
-
this.itemDetails.snippet = event.target.value;
|
|
1866
|
-
this._updateLengthLabel(this.itemDetails.snippet);
|
|
1867
|
-
this._updateStore();
|
|
1868
|
-
break;
|
|
1869
|
-
case "item-description":
|
|
1870
|
-
this.itemDetails.description = event.target.value;
|
|
1871
|
-
this._updateStore();
|
|
1872
|
-
break;
|
|
1873
|
-
case "item-tags":
|
|
1874
|
-
this.itemDetails.tags = event.target.value;
|
|
1875
|
-
this._updateStore();
|
|
1876
|
-
break;
|
|
1877
|
-
case "item-credits":
|
|
1878
|
-
this.itemDetails.accessInformation = event.target.value;
|
|
1879
|
-
this._updateStore();
|
|
1880
|
-
break;
|
|
1881
|
-
case "item-terms":
|
|
1882
|
-
this.itemDetails.licenseInfo = event.target.value;
|
|
1883
|
-
this._updateStore();
|
|
1884
|
-
break;
|
|
1885
|
-
}
|
|
2236
|
+
return (h(Host, null, h("div", null, h("h4", { class: "org-var-header" }, this._translations.orgVariables)), h("div", { class: "container-border" }, h("calcite-tree", { id: "variable-label" }, this._renderHierarchy(this._organizationVariables)))));
|
|
1886
2237
|
}
|
|
1887
2238
|
//--------------------------------------------------------------------------
|
|
1888
2239
|
//
|
|
1889
|
-
// Events
|
|
1890
|
-
//
|
|
1891
|
-
//--------------------------------------------------------------------------
|
|
1892
|
-
//--------------------------------------------------------------------------
|
|
1893
|
-
//
|
|
1894
2240
|
// Public Methods (async)
|
|
1895
2241
|
//
|
|
1896
2242
|
//--------------------------------------------------------------------------
|
|
@@ -1900,67 +2246,27 @@ const SolutionItemDetails = class {
|
|
|
1900
2246
|
//
|
|
1901
2247
|
//--------------------------------------------------------------------------
|
|
1902
2248
|
/**
|
|
1903
|
-
*
|
|
1904
|
-
*
|
|
1905
|
-
*/
|
|
1906
|
-
_getThumbnail() {
|
|
1907
|
-
this.browseForThumbnail.click();
|
|
1908
|
-
}
|
|
1909
|
-
/**
|
|
1910
|
-
* Load the templates thumbnail
|
|
1911
|
-
*
|
|
1912
|
-
*/
|
|
1913
|
-
_loadThumb() {
|
|
1914
|
-
var _a;
|
|
1915
|
-
if (this.thumbnail && ((_a = this.itemEdit) === null || _a === void 0 ? void 0 : _a.thumbnail)) {
|
|
1916
|
-
// Show the thumbnail
|
|
1917
|
-
this.thumbnail.src = URL.createObjectURL(this.itemEdit.thumbnail);
|
|
1918
|
-
this.thumbnailContainer.classList.remove("empty-box");
|
|
1919
|
-
this.thumbnail.classList.remove("display-none");
|
|
1920
|
-
}
|
|
1921
|
-
else {
|
|
1922
|
-
// Replace the thumbnail with an empty box
|
|
1923
|
-
this.thumbnailContainer.classList.add("empty-box");
|
|
1924
|
-
this.thumbnail.classList.add("display-none");
|
|
1925
|
-
}
|
|
1926
|
-
}
|
|
1927
|
-
/**
|
|
1928
|
-
* Updates the length label to reflect the current number of characters
|
|
1929
|
-
* relative to the max number of characters supported.
|
|
2249
|
+
* Renders the organization based variable items the user can insert at runtime
|
|
1930
2250
|
*
|
|
1931
|
-
* @param
|
|
1932
|
-
*/
|
|
1933
|
-
_updateLengthLabel(phrase) {
|
|
1934
|
-
this.itemSnippetCount.innerText =
|
|
1935
|
-
this._translations.snippetCountPattern.replace("{{n}}", phrase.length.toString());
|
|
1936
|
-
}
|
|
1937
|
-
/**
|
|
1938
|
-
* Add or remove the value from the store
|
|
2251
|
+
* @param objs a list of organization variables to render
|
|
1939
2252
|
*/
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
2253
|
+
_renderHierarchy(objs) {
|
|
2254
|
+
const hierarchy = objs.map(obj => {
|
|
2255
|
+
return (h("calcite-tree-item", { onClick: () => this._treeItemSelected(obj.id, obj.value) }, obj.title));
|
|
2256
|
+
});
|
|
2257
|
+
return hierarchy;
|
|
1944
2258
|
}
|
|
1945
2259
|
/**
|
|
1946
|
-
*
|
|
2260
|
+
* Publishes the `organizationVariableSelected` event containing `itemId`, the id of the selected variable and the value of the variable.
|
|
1947
2261
|
*
|
|
1948
|
-
* @param
|
|
1949
|
-
* @param
|
|
1950
|
-
* should be false on the initial load but true the rest of the time
|
|
2262
|
+
* @param itemId Item id as reported by click event
|
|
2263
|
+
* @param value Variable id as reported by click event
|
|
1951
2264
|
*/
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
this.thumbnail.src = URL.createObjectURL(files[0]);
|
|
1958
|
-
// Update info in store
|
|
1959
|
-
this.itemEdit = state.getItemInfo(this.itemId);
|
|
1960
|
-
this.itemEdit.thumbnail = files[0];
|
|
1961
|
-
state.replaceItemThumbnail(this.itemEdit);
|
|
1962
|
-
}
|
|
1963
|
-
}
|
|
2265
|
+
_treeItemSelected(itemId, value) {
|
|
2266
|
+
this.organizationVariableSelected.emit({
|
|
2267
|
+
itemId,
|
|
2268
|
+
value
|
|
2269
|
+
});
|
|
1964
2270
|
}
|
|
1965
2271
|
/**
|
|
1966
2272
|
* Fetches the component's translations
|
|
@@ -1973,569 +2279,11 @@ const SolutionItemDetails = class {
|
|
|
1973
2279
|
}
|
|
1974
2280
|
get el() { return getElement(this); }
|
|
1975
2281
|
static get watchers() { return {
|
|
1976
|
-
"
|
|
1977
|
-
}; }
|
|
1978
|
-
};
|
|
1979
|
-
SolutionItemDetails.style = solutionItemDetailsCss;
|
|
1980
|
-
|
|
1981
|
-
const solutionItemSharingCss = ":host{display:block;box-sizing:border-box;margin-left:0.75rem;margin-right:0.75rem;min-width:0;flex-grow:0;flex-shrink:1}:host-group-1-up>.block{flex-basis:calc(100% - 1.5rem);width:calc(100% - 1.5rem)}:host-group-2-up>.block{flex-basis:calc(50% - 1.5rem);width:calc(50% - 1.5rem)}:host-group-3-up>.block{flex-basis:calc(33.33333% - 1.5rem);width:calc(33.33333% - 1.5rem)}:host-group-4-up>.block{flex-basis:calc(25% - 1.5rem);width:calc(25% - 1.5rem)}:host-group-5-up>.block{flex-basis:calc(20% - 1.5rem);width:calc(20% - 1.5rem)}:host-group-6-up>.block{flex-basis:calc(16.66666% - 1.5rem);width:calc(16.66666% - 1.5rem)}:host-group-7-up>.block{flex-basis:calc(14.2857% - 1.5rem);width:calc(14.2857% - 1.5rem)}:host-group-8-up>.block{flex-basis:calc(12.5% - 1.5rem);width:calc(12.5% - 1.5rem)}.tablet-block-group-1-up>:host{flex-basis:calc(100% - 1.5rem);width:calc(100% - 1.5rem)}.tablet-block-group-2-up>:host{flex-basis:calc(50% - 1.5rem);width:calc(50% - 1.5rem)}.tablet-block-group-3-up>:host{flex-basis:calc(33.33333% - 1.5rem);width:calc(33.33333% - 1.5rem)}.tablet-block-group-4-up>:host{flex-basis:calc(25% - 1.5rem);width:calc(25% - 1.5rem)}.tablet-block-group-5-up>:host{flex-basis:calc(20% - 1.5rem);width:calc(20% - 1.5rem)}.tablet-block-group-6-up>:host{flex-basis:calc(16.66666% - 1.5rem);width:calc(16.66666% - 1.5rem)}.tablet-block-group-7-up>:host{flex-basis:calc(14.2857% - 1.5rem);width:calc(14.2857% - 1.5rem)}.tablet-block-group-8-up>:host{flex-basis:calc(12.5% - 1.5rem);width:calc(12.5% - 1.5rem)}.phone-block-group-1-up>:host{flex-basis:calc(100% - 1.5rem);width:calc(100% - 1.5rem)}.phone-block-group-2-up>:host{flex-basis:calc(50% - 1.5rem);width:calc(50% - 1.5rem)}.phone-block-group-3-up>:host{flex-basis:calc(33.33333% - 1.5rem);width:calc(33.33333% - 1.5rem)}.phone-block-group-4-up>:host{flex-basis:calc(25% - 1.5rem);width:calc(25% - 1.5rem)}.phone-block-group-5-up>:host{flex-basis:calc(20% - 1.5rem);width:calc(20% - 1.5rem)}.phone-block-group-6-up>:host{flex-basis:calc(16.66666% - 1.5rem);width:calc(16.66666% - 1.5rem)}.phone-block-group-7-up>:host{flex-basis:calc(14.2857% - 1.5rem);width:calc(14.2857% - 1.5rem)}.phone-block-group-8-up>:host{flex-basis:calc(12.5% - 1.5rem);width:calc(12.5% - 1.5rem)}.code-face :host{letter-spacing:0em;font-family:\"Consolas\", \"Andale Mono\", \"Lucida Console\", \"Monaco\", monospace;font-weight:400;font-style:normal}.code-face :host b,.code-face :host strong{font-weight:400}.code-italic :host{letter-spacing:0em;font-family:\"Consolas\", \"Andale Mono\", \"Lucida Console\", \"Monaco\", monospace;font-weight:400;font-style:italic}.code-italic :host b,.code-italic :host strong{font-weight:400}.container-border{padding:1rem}.icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";
|
|
1982
|
-
|
|
1983
|
-
const SolutionItemSharing = class {
|
|
1984
|
-
constructor(hostRef) {
|
|
1985
|
-
registerInstance(this, hostRef);
|
|
1986
|
-
this.groupId = "";
|
|
1987
|
-
this._translations = undefined;
|
|
1988
|
-
this.sharing = [];
|
|
1989
|
-
}
|
|
1990
|
-
itemIdWatchHandler() {
|
|
1991
|
-
const itemEdit = state.getItemInfo(this.groupId);
|
|
1992
|
-
this.sharing = itemEdit.groupDetails;
|
|
1993
|
-
}
|
|
1994
|
-
//--------------------------------------------------------------------------
|
|
1995
|
-
//
|
|
1996
|
-
// Lifecycle
|
|
1997
|
-
//
|
|
1998
|
-
//--------------------------------------------------------------------------
|
|
1999
|
-
/**
|
|
2000
|
-
* StencilJS: Called once just after the component is first connected to the DOM.
|
|
2001
|
-
*/
|
|
2002
|
-
async componentWillLoad() {
|
|
2003
|
-
return this._getTranslations();
|
|
2004
|
-
}
|
|
2005
|
-
/**
|
|
2006
|
-
* Renders the component.
|
|
2007
|
-
*/
|
|
2008
|
-
render() {
|
|
2009
|
-
return (h(Host, null, h("div", { class: "container-border" }, h("calcite-label", null, this._translations.groupInfo), this._renderItems(this.sharing))));
|
|
2010
|
-
}
|
|
2011
|
-
//--------------------------------------------------------------------------
|
|
2012
|
-
//
|
|
2013
|
-
// Event Listeners
|
|
2014
|
-
//
|
|
2015
|
-
//--------------------------------------------------------------------------
|
|
2016
|
-
//--------------------------------------------------------------------------
|
|
2017
|
-
//
|
|
2018
|
-
// Events
|
|
2019
|
-
//
|
|
2020
|
-
//--------------------------------------------------------------------------
|
|
2021
|
-
//--------------------------------------------------------------------------
|
|
2022
|
-
//
|
|
2023
|
-
// Public Methods (async)
|
|
2024
|
-
//
|
|
2025
|
-
//--------------------------------------------------------------------------
|
|
2026
|
-
async getShareInfo() {
|
|
2027
|
-
return this.sharing;
|
|
2028
|
-
}
|
|
2029
|
-
//--------------------------------------------------------------------------
|
|
2030
|
-
//
|
|
2031
|
-
// Private Methods
|
|
2032
|
-
//
|
|
2033
|
-
//--------------------------------------------------------------------------
|
|
2034
|
-
/**
|
|
2035
|
-
* Render share options based on the list of share details
|
|
2036
|
-
*
|
|
2037
|
-
* @param objs list of IItemShare objects that are used to expose and store share info for the solutions items
|
|
2038
|
-
*/
|
|
2039
|
-
_renderItems(objs) {
|
|
2040
|
-
return objs && objs.length > 0
|
|
2041
|
-
? objs.map(item => {
|
|
2042
|
-
return (h("calcite-label", { layout: "inline" }, h("calcite-switch", { id: item.id, name: "setting", onCalciteSwitchChange: (event) => this._updateItem(event), scale: "m", switched: item.shareItem, value: "enabled" }), h("solution-item-icon", { type: item.type, typeKeywords: item.typeKeywords }), h("span", { class: "icon-text", title: item.title }, item.title)));
|
|
2043
|
-
})
|
|
2044
|
-
: null;
|
|
2045
|
-
}
|
|
2046
|
-
/**
|
|
2047
|
-
* Update the items share prop based on the switch state
|
|
2048
|
-
*
|
|
2049
|
-
* @param event onCalciteSwitchChange event
|
|
2050
|
-
*/
|
|
2051
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
2052
|
-
_updateItem(event) {
|
|
2053
|
-
const id = event.target.id;
|
|
2054
|
-
this.sharing = this.sharing.map((itemShare) => {
|
|
2055
|
-
if (itemShare.id === id) {
|
|
2056
|
-
// update the item
|
|
2057
|
-
itemShare.shareItem = event.detail.switched;
|
|
2058
|
-
// update the item in the store
|
|
2059
|
-
const itemEdit = state.getItemInfo(id);
|
|
2060
|
-
if (itemShare.shareItem) {
|
|
2061
|
-
// Add the group to the item if it's not already there
|
|
2062
|
-
if (!itemEdit.groups) {
|
|
2063
|
-
itemEdit.groups = [this.groupId];
|
|
2064
|
-
}
|
|
2065
|
-
else if (itemEdit.groups.indexOf(this.groupId) < 0) {
|
|
2066
|
-
itemEdit.groups.push(this.groupId);
|
|
2067
|
-
}
|
|
2068
|
-
}
|
|
2069
|
-
else {
|
|
2070
|
-
// Remove the group from the item if it's there
|
|
2071
|
-
if (itemEdit.groups) {
|
|
2072
|
-
const i = itemEdit.groups.indexOf(this.groupId);
|
|
2073
|
-
if (i > -1) {
|
|
2074
|
-
itemEdit.groups.splice(i, 1);
|
|
2075
|
-
}
|
|
2076
|
-
}
|
|
2077
|
-
}
|
|
2078
|
-
state.setItemInfo(itemEdit);
|
|
2079
|
-
}
|
|
2080
|
-
return itemShare;
|
|
2081
|
-
});
|
|
2082
|
-
}
|
|
2083
|
-
/**
|
|
2084
|
-
* Fetches the component's translations
|
|
2085
|
-
*
|
|
2086
|
-
* @protected
|
|
2087
|
-
*/
|
|
2088
|
-
async _getTranslations() {
|
|
2089
|
-
const translations = await getLocaleComponentStrings(this.el);
|
|
2090
|
-
this._translations = translations[0];
|
|
2091
|
-
}
|
|
2092
|
-
get el() { return getElement(this); }
|
|
2093
|
-
static get watchers() { return {
|
|
2094
|
-
"groupId": ["itemIdWatchHandler"]
|
|
2095
|
-
}; }
|
|
2096
|
-
};
|
|
2097
|
-
SolutionItemSharing.style = solutionItemSharingCss;
|
|
2098
|
-
|
|
2099
|
-
const solutionOrganizationVariablesCss = ":host{display:block;box-sizing:border-box;margin-left:0.75rem;margin-right:0.75rem;min-width:0;flex-grow:0;flex-shrink:1}:host-group-1-up>.block{flex-basis:calc(100% - 1.5rem);width:calc(100% - 1.5rem)}:host-group-2-up>.block{flex-basis:calc(50% - 1.5rem);width:calc(50% - 1.5rem)}:host-group-3-up>.block{flex-basis:calc(33.33333% - 1.5rem);width:calc(33.33333% - 1.5rem)}:host-group-4-up>.block{flex-basis:calc(25% - 1.5rem);width:calc(25% - 1.5rem)}:host-group-5-up>.block{flex-basis:calc(20% - 1.5rem);width:calc(20% - 1.5rem)}:host-group-6-up>.block{flex-basis:calc(16.66666% - 1.5rem);width:calc(16.66666% - 1.5rem)}:host-group-7-up>.block{flex-basis:calc(14.2857% - 1.5rem);width:calc(14.2857% - 1.5rem)}:host-group-8-up>.block{flex-basis:calc(12.5% - 1.5rem);width:calc(12.5% - 1.5rem)}.tablet-block-group-1-up>:host{flex-basis:calc(100% - 1.5rem);width:calc(100% - 1.5rem)}.tablet-block-group-2-up>:host{flex-basis:calc(50% - 1.5rem);width:calc(50% - 1.5rem)}.tablet-block-group-3-up>:host{flex-basis:calc(33.33333% - 1.5rem);width:calc(33.33333% - 1.5rem)}.tablet-block-group-4-up>:host{flex-basis:calc(25% - 1.5rem);width:calc(25% - 1.5rem)}.tablet-block-group-5-up>:host{flex-basis:calc(20% - 1.5rem);width:calc(20% - 1.5rem)}.tablet-block-group-6-up>:host{flex-basis:calc(16.66666% - 1.5rem);width:calc(16.66666% - 1.5rem)}.tablet-block-group-7-up>:host{flex-basis:calc(14.2857% - 1.5rem);width:calc(14.2857% - 1.5rem)}.tablet-block-group-8-up>:host{flex-basis:calc(12.5% - 1.5rem);width:calc(12.5% - 1.5rem)}.phone-block-group-1-up>:host{flex-basis:calc(100% - 1.5rem);width:calc(100% - 1.5rem)}.phone-block-group-2-up>:host{flex-basis:calc(50% - 1.5rem);width:calc(50% - 1.5rem)}.phone-block-group-3-up>:host{flex-basis:calc(33.33333% - 1.5rem);width:calc(33.33333% - 1.5rem)}.phone-block-group-4-up>:host{flex-basis:calc(25% - 1.5rem);width:calc(25% - 1.5rem)}.phone-block-group-5-up>:host{flex-basis:calc(20% - 1.5rem);width:calc(20% - 1.5rem)}.phone-block-group-6-up>:host{flex-basis:calc(16.66666% - 1.5rem);width:calc(16.66666% - 1.5rem)}.phone-block-group-7-up>:host{flex-basis:calc(14.2857% - 1.5rem);width:calc(14.2857% - 1.5rem)}.phone-block-group-8-up>:host{flex-basis:calc(12.5% - 1.5rem);width:calc(12.5% - 1.5rem)}.code-face :host{letter-spacing:0em;font-family:\"Consolas\", \"Andale Mono\", \"Lucida Console\", \"Monaco\", monospace;font-weight:400;font-style:normal}.code-face :host b,.code-face :host strong{font-weight:400}.code-italic :host{letter-spacing:0em;font-family:\"Consolas\", \"Andale Mono\", \"Lucida Console\", \"Monaco\", monospace;font-weight:400;font-style:italic}.code-italic :host b,.code-italic :host strong{font-weight:400}.container-border{overflow-y:auto}.org-var-header{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1rem}";
|
|
2100
|
-
|
|
2101
|
-
const SolutionOrganizationVariables = class {
|
|
2102
|
-
constructor(hostRef) {
|
|
2103
|
-
registerInstance(this, hostRef);
|
|
2104
|
-
this.organizationVariableSelected = createEvent(this, "organizationVariableSelected", 7);
|
|
2105
|
-
this.value = "";
|
|
2106
|
-
this._organizationVariables = [];
|
|
2107
|
-
this._translations = undefined;
|
|
2108
|
-
}
|
|
2109
|
-
valueWatchHandler() {
|
|
2110
|
-
this._organizationVariables = JSON.parse(this.value);
|
|
2111
|
-
}
|
|
2112
|
-
//--------------------------------------------------------------------------
|
|
2113
|
-
//
|
|
2114
|
-
// Lifecycle
|
|
2115
|
-
//
|
|
2116
|
-
//--------------------------------------------------------------------------
|
|
2117
|
-
/**
|
|
2118
|
-
* StencilJS: Called once just after the component is first connected to the DOM.
|
|
2119
|
-
*/
|
|
2120
|
-
async componentWillLoad() {
|
|
2121
|
-
return this._getTranslations();
|
|
2122
|
-
}
|
|
2123
|
-
/**
|
|
2124
|
-
* Renders the component.
|
|
2125
|
-
*/
|
|
2126
|
-
render() {
|
|
2127
|
-
return (h(Host, null, h("div", null, h("h4", { class: "org-var-header" }, this._translations.orgVariables)), h("div", { class: "container-border" }, h("calcite-tree", { id: "variable-label" }, this._renderHierarchy(this._organizationVariables)))));
|
|
2128
|
-
}
|
|
2129
|
-
//--------------------------------------------------------------------------
|
|
2130
|
-
//
|
|
2131
|
-
// Public Methods (async)
|
|
2132
|
-
//
|
|
2133
|
-
//--------------------------------------------------------------------------
|
|
2134
|
-
//--------------------------------------------------------------------------
|
|
2135
|
-
//
|
|
2136
|
-
// Private Methods
|
|
2137
|
-
//
|
|
2138
|
-
//--------------------------------------------------------------------------
|
|
2139
|
-
/**
|
|
2140
|
-
* Renders the organization based variable items the user can insert at runtime
|
|
2141
|
-
*
|
|
2142
|
-
* @param objs a list of organization variables to render
|
|
2143
|
-
*/
|
|
2144
|
-
_renderHierarchy(objs) {
|
|
2145
|
-
const hierarchy = objs.map(obj => {
|
|
2146
|
-
return (h("calcite-tree-item", { onClick: () => this._treeItemSelected(obj.id, obj.value) }, obj.title));
|
|
2147
|
-
});
|
|
2148
|
-
return hierarchy;
|
|
2149
|
-
}
|
|
2150
|
-
/**
|
|
2151
|
-
* Publishes the `organizationVariableSelected` event containing `itemId`, the id of the selected variable and the value of the variable.
|
|
2152
|
-
*
|
|
2153
|
-
* @param itemId Item id as reported by click event
|
|
2154
|
-
* @param value Variable id as reported by click event
|
|
2155
|
-
*/
|
|
2156
|
-
_treeItemSelected(itemId, value) {
|
|
2157
|
-
this.organizationVariableSelected.emit({
|
|
2158
|
-
itemId,
|
|
2159
|
-
value
|
|
2160
|
-
});
|
|
2161
|
-
}
|
|
2162
|
-
/**
|
|
2163
|
-
* Fetches the component's translations
|
|
2164
|
-
*
|
|
2165
|
-
* @protected
|
|
2166
|
-
*/
|
|
2167
|
-
async _getTranslations() {
|
|
2168
|
-
const translations = await getLocaleComponentStrings(this.el);
|
|
2169
|
-
this._translations = translations[0];
|
|
2170
|
-
}
|
|
2171
|
-
get el() { return getElement(this); }
|
|
2172
|
-
static get watchers() { return {
|
|
2173
|
-
"value": ["valueWatchHandler"]
|
|
2282
|
+
"value": ["valueWatchHandler"]
|
|
2174
2283
|
}; }
|
|
2175
2284
|
};
|
|
2176
2285
|
SolutionOrganizationVariables.style = solutionOrganizationVariablesCss;
|
|
2177
2286
|
|
|
2178
|
-
const solutionResourceItemCss = ":host{display:block;box-sizing:border-box;margin-left:0.75rem;margin-right:0.75rem;min-width:0;flex-grow:0;flex-shrink:1}:host-group-1-up>.block{flex-basis:calc(100% - 1.5rem);width:calc(100% - 1.5rem)}:host-group-2-up>.block{flex-basis:calc(50% - 1.5rem);width:calc(50% - 1.5rem)}:host-group-3-up>.block{flex-basis:calc(33.33333% - 1.5rem);width:calc(33.33333% - 1.5rem)}:host-group-4-up>.block{flex-basis:calc(25% - 1.5rem);width:calc(25% - 1.5rem)}:host-group-5-up>.block{flex-basis:calc(20% - 1.5rem);width:calc(20% - 1.5rem)}:host-group-6-up>.block{flex-basis:calc(16.66666% - 1.5rem);width:calc(16.66666% - 1.5rem)}:host-group-7-up>.block{flex-basis:calc(14.2857% - 1.5rem);width:calc(14.2857% - 1.5rem)}:host-group-8-up>.block{flex-basis:calc(12.5% - 1.5rem);width:calc(12.5% - 1.5rem)}.tablet-block-group-1-up>:host{flex-basis:calc(100% - 1.5rem);width:calc(100% - 1.5rem)}.tablet-block-group-2-up>:host{flex-basis:calc(50% - 1.5rem);width:calc(50% - 1.5rem)}.tablet-block-group-3-up>:host{flex-basis:calc(33.33333% - 1.5rem);width:calc(33.33333% - 1.5rem)}.tablet-block-group-4-up>:host{flex-basis:calc(25% - 1.5rem);width:calc(25% - 1.5rem)}.tablet-block-group-5-up>:host{flex-basis:calc(20% - 1.5rem);width:calc(20% - 1.5rem)}.tablet-block-group-6-up>:host{flex-basis:calc(16.66666% - 1.5rem);width:calc(16.66666% - 1.5rem)}.tablet-block-group-7-up>:host{flex-basis:calc(14.2857% - 1.5rem);width:calc(14.2857% - 1.5rem)}.tablet-block-group-8-up>:host{flex-basis:calc(12.5% - 1.5rem);width:calc(12.5% - 1.5rem)}.phone-block-group-1-up>:host{flex-basis:calc(100% - 1.5rem);width:calc(100% - 1.5rem)}.phone-block-group-2-up>:host{flex-basis:calc(50% - 1.5rem);width:calc(50% - 1.5rem)}.phone-block-group-3-up>:host{flex-basis:calc(33.33333% - 1.5rem);width:calc(33.33333% - 1.5rem)}.phone-block-group-4-up>:host{flex-basis:calc(25% - 1.5rem);width:calc(25% - 1.5rem)}.phone-block-group-5-up>:host{flex-basis:calc(20% - 1.5rem);width:calc(20% - 1.5rem)}.phone-block-group-6-up>:host{flex-basis:calc(16.66666% - 1.5rem);width:calc(16.66666% - 1.5rem)}.phone-block-group-7-up>:host{flex-basis:calc(14.2857% - 1.5rem);width:calc(14.2857% - 1.5rem)}.phone-block-group-8-up>:host{flex-basis:calc(12.5% - 1.5rem);width:calc(12.5% - 1.5rem)}.code-face :host{letter-spacing:0em;font-family:\"Consolas\", \"Andale Mono\", \"Lucida Console\", \"Monaco\", monospace;font-weight:400;font-style:normal}.code-face :host b,.code-face :host strong{font-weight:400}.code-italic :host{letter-spacing:0em;font-family:\"Consolas\", \"Andale Mono\", \"Lucida Console\", \"Monaco\", monospace;font-weight:400;font-style:italic}.code-italic :host b,.code-italic :host strong{font-weight:400}.resource-item{padding:1rem}.resource-button{-webkit-margin-end:1rem;margin-inline-end:1rem}.resource-progress{padding-top:1rem}.resources-container{border:1px #808080 solid}.margin-bottom-1{margin-bottom:1rem}";
|
|
2179
|
-
|
|
2180
|
-
const SolutionResourceItem = class {
|
|
2181
|
-
constructor(hostRef) {
|
|
2182
|
-
registerInstance(this, hostRef);
|
|
2183
|
-
this._removedResources = {};
|
|
2184
|
-
this.authentication = undefined;
|
|
2185
|
-
this.itemId = "";
|
|
2186
|
-
this.resourceFilePaths = [];
|
|
2187
|
-
this.resources = [];
|
|
2188
|
-
this._translations = undefined;
|
|
2189
|
-
}
|
|
2190
|
-
itemIdWatchHandler() {
|
|
2191
|
-
const item = state.getItemInfo(this.itemId);
|
|
2192
|
-
this.resourceFilePaths = item.resourceFilePaths;
|
|
2193
|
-
this.resources = item.resources.map(
|
|
2194
|
-
// False linting error
|
|
2195
|
-
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
|
2196
|
-
(path) => path.substring(path.lastIndexOf("/") + 1));
|
|
2197
|
-
}
|
|
2198
|
-
//--------------------------------------------------------------------------
|
|
2199
|
-
//
|
|
2200
|
-
// Lifecycle
|
|
2201
|
-
//
|
|
2202
|
-
//--------------------------------------------------------------------------
|
|
2203
|
-
/**
|
|
2204
|
-
* StencilJS: Called once just after the component is first connected to the DOM.
|
|
2205
|
-
*/
|
|
2206
|
-
componentWillLoad() {
|
|
2207
|
-
return this._getTranslations();
|
|
2208
|
-
}
|
|
2209
|
-
/**
|
|
2210
|
-
* Renders the component.
|
|
2211
|
-
*/
|
|
2212
|
-
render() {
|
|
2213
|
-
const hasValidResources = this._hasValidResources();
|
|
2214
|
-
return (h(Host, null, h("div", { class: "resource-item" }, h("div", { class: "margin-bottom-1" }, h("calcite-button", { appearance: "solid", class: "resource-button", color: "blue", onClick: () => this._addNewResource() }, this._translations.addResource), h("calcite-button", { appearance: "solid", color: "blue", disabled: !hasValidResources, onClick: () => this._downloadAll() }, this._translations.downloadAll)), h("div", { class: "resources-container", style: { display: hasValidResources ? "inherit" : "none" } }, this._renderResourceList()))));
|
|
2215
|
-
}
|
|
2216
|
-
//--------------------------------------------------------------------------
|
|
2217
|
-
//
|
|
2218
|
-
// Event Listeners
|
|
2219
|
-
//
|
|
2220
|
-
//--------------------------------------------------------------------------
|
|
2221
|
-
//--------------------------------------------------------------------------
|
|
2222
|
-
//
|
|
2223
|
-
// Events
|
|
2224
|
-
//
|
|
2225
|
-
//--------------------------------------------------------------------------
|
|
2226
|
-
//--------------------------------------------------------------------------
|
|
2227
|
-
//
|
|
2228
|
-
// Public Methods (async)
|
|
2229
|
-
//
|
|
2230
|
-
//--------------------------------------------------------------------------
|
|
2231
|
-
//--------------------------------------------------------------------------
|
|
2232
|
-
//
|
|
2233
|
-
// Private Methods
|
|
2234
|
-
//
|
|
2235
|
-
//--------------------------------------------------------------------------
|
|
2236
|
-
/**
|
|
2237
|
-
* Render resources while avoiding thumbnail resoures that are managed by solution-item
|
|
2238
|
-
*
|
|
2239
|
-
*/
|
|
2240
|
-
_renderResourceList() {
|
|
2241
|
-
return (h("calcite-value-list", { multiple: true }, this.resourceFilePaths.reduce((prev, cur) => {
|
|
2242
|
-
if (cur.type !== EFileType.Thumbnail) {
|
|
2243
|
-
prev.push(this._renderResource(cur));
|
|
2244
|
-
}
|
|
2245
|
-
return prev;
|
|
2246
|
-
}, [])));
|
|
2247
|
-
}
|
|
2248
|
-
/**
|
|
2249
|
-
* Render the resource and supporting actions for download/update/delete/(reset..if deleted)
|
|
2250
|
-
*
|
|
2251
|
-
* @param resource the filename and url used to interact with the resource
|
|
2252
|
-
*/
|
|
2253
|
-
_renderResource(resource) {
|
|
2254
|
-
const resettable = resource.updateType === EUpdateType.Remove;
|
|
2255
|
-
const fullname = resource.folder ? resource.folder + "/" + resource.filename : resource.filename;
|
|
2256
|
-
return (h("calcite-value-list-item", { class: resettable ? "disabled" : "", label: fullname, nonInteractive: true, value: resource.url }, h("calcite-action-group", { "expand-disabled": "true", layout: "horizontal", slot: "actions-end" }, h("calcite-action", { disabled: resettable, icon: "download", label: this._translations.download, onClick: () => this._download(resource.url, resource.filename), scale: "m", text: this._translations.download, title: this._translations.download }), h("calcite-action", { disabled: resettable, icon: "upload-to", label: this._translations.update, onClick: () => this._upload(resource), scale: "m", text: this._translations.update, title: this._translations.update }), h("calcite-action", { disabled: resettable, icon: "trash", label: this._translations.delete, onClick: () => this._delete(resource), scale: "m", text: this._translations.delete, title: this._translations.delete }), resettable ? h("calcite-action", { icon: "reset", label: this._translations.reset, onClick: () => this._reset(resource.filename), scale: "m", text: this._translations.reset, title: this._translations.reset }) : h("div", { class: "display-none" }))));
|
|
2257
|
-
}
|
|
2258
|
-
/**
|
|
2259
|
-
* Adds the name to the deleted array so it will be skipped while rendering
|
|
2260
|
-
* but still exist if the user chooses to reset
|
|
2261
|
-
*
|
|
2262
|
-
* @param resource the resource to be updated
|
|
2263
|
-
*/
|
|
2264
|
-
_delete(resource) {
|
|
2265
|
-
resource.updateType = EUpdateType.Remove;
|
|
2266
|
-
this.resourceFilePaths = [...this.resourceFilePaths]; // to trigger refresh
|
|
2267
|
-
this._updateStore();
|
|
2268
|
-
}
|
|
2269
|
-
/**
|
|
2270
|
-
* Remove the name from the deleted array so it will again be rendered
|
|
2271
|
-
*
|
|
2272
|
-
* @param name the name to be added to the deleted array
|
|
2273
|
-
*/
|
|
2274
|
-
_reset(name) {
|
|
2275
|
-
// need to make sure I know if this reset is from the source or a new one
|
|
2276
|
-
// Because the item's `resources` array is not updated until (and if) the solution is saved,
|
|
2277
|
-
// we can use it for the reset info
|
|
2278
|
-
this.resources.some(resourceName => resourceName === name) ?
|
|
2279
|
-
// Undo removing an existing resource
|
|
2280
|
-
this.resourceFilePaths = this.resourceFilePaths.map(p => {
|
|
2281
|
-
if (p.filename === name) {
|
|
2282
|
-
p.updateType = EUpdateType.None;
|
|
2283
|
-
}
|
|
2284
|
-
return p;
|
|
2285
|
-
}) :
|
|
2286
|
-
// Undo cancelling the adding of a resource
|
|
2287
|
-
this.resourceFilePaths = this.resourceFilePaths.map(p => {
|
|
2288
|
-
if (p.filename === name) {
|
|
2289
|
-
p.updateType = EUpdateType.Add;
|
|
2290
|
-
}
|
|
2291
|
-
return p;
|
|
2292
|
-
});
|
|
2293
|
-
this._updateStore();
|
|
2294
|
-
}
|
|
2295
|
-
/**
|
|
2296
|
-
* Download all of the templates resources
|
|
2297
|
-
*
|
|
2298
|
-
*/
|
|
2299
|
-
_downloadAll() {
|
|
2300
|
-
this.resourceFilePaths.forEach((resource) => {
|
|
2301
|
-
this._download(resource.url, resource.filename);
|
|
2302
|
-
});
|
|
2303
|
-
}
|
|
2304
|
-
/**
|
|
2305
|
-
* Download the current resource
|
|
2306
|
-
*
|
|
2307
|
-
* @param url the resource url
|
|
2308
|
-
* @param name the resource name
|
|
2309
|
-
*/
|
|
2310
|
-
_download(url, name) {
|
|
2311
|
-
// files that have been added manually do not need to be requested from the item
|
|
2312
|
-
if (url.startsWith("blob")) {
|
|
2313
|
-
this.downloadFile(url, name);
|
|
2314
|
-
}
|
|
2315
|
-
else {
|
|
2316
|
-
const _url = `${url}?token=${this.authentication.token}`;
|
|
2317
|
-
void this.fetchAndDownload(_url, name);
|
|
2318
|
-
}
|
|
2319
|
-
}
|
|
2320
|
-
/**
|
|
2321
|
-
* Dynamically creates an anchor and downloads the file
|
|
2322
|
-
*
|
|
2323
|
-
* @param url the url of the resource
|
|
2324
|
-
* @param name the name of the resource
|
|
2325
|
-
*/
|
|
2326
|
-
downloadFile(url, name) {
|
|
2327
|
-
const link = document.createElement("a");
|
|
2328
|
-
link.href = url;
|
|
2329
|
-
link.download = name;
|
|
2330
|
-
link.target = "_blank";
|
|
2331
|
-
link.click();
|
|
2332
|
-
}
|
|
2333
|
-
/**
|
|
2334
|
-
* Check if the template resources have any non-thumbnail resources
|
|
2335
|
-
*
|
|
2336
|
-
* @returns true if we have data resources and false if only thumbnail
|
|
2337
|
-
*/
|
|
2338
|
-
_hasValidResources() {
|
|
2339
|
-
return this.resourceFilePaths.some(r => r.url.indexOf("_info_thumbnail") < 0);
|
|
2340
|
-
}
|
|
2341
|
-
/**
|
|
2342
|
-
* Fetches and downloads the resource from the solution
|
|
2343
|
-
*
|
|
2344
|
-
* @param url the url of the resource
|
|
2345
|
-
* @param name the name of the resource
|
|
2346
|
-
*/
|
|
2347
|
-
async fetchAndDownload(url, name) {
|
|
2348
|
-
const image = await fetch(url);
|
|
2349
|
-
const b = await image.blob();
|
|
2350
|
-
const bURL = URL.createObjectURL(b);
|
|
2351
|
-
this.downloadFile(bURL, name);
|
|
2352
|
-
}
|
|
2353
|
-
/**
|
|
2354
|
-
* Create an input element to support the uploading of the resource and upload the resource
|
|
2355
|
-
*
|
|
2356
|
-
* @param resource the resource to be updated
|
|
2357
|
-
*/
|
|
2358
|
-
_upload(resource) {
|
|
2359
|
-
const _input = document.createElement("input");
|
|
2360
|
-
_input.classList.add("display-none");
|
|
2361
|
-
_input.onchange = this._updateResource.bind(this, resource);
|
|
2362
|
-
_input.type = "file";
|
|
2363
|
-
_input.click();
|
|
2364
|
-
}
|
|
2365
|
-
/**
|
|
2366
|
-
* Create an input element to support the uploading of a resource and add the new resource
|
|
2367
|
-
*
|
|
2368
|
-
*/
|
|
2369
|
-
_addNewResource() {
|
|
2370
|
-
const _input = document.createElement("input");
|
|
2371
|
-
_input.classList.add("display-none");
|
|
2372
|
-
_input.onchange = this._add.bind(this);
|
|
2373
|
-
_input.type = "file";
|
|
2374
|
-
_input.click();
|
|
2375
|
-
}
|
|
2376
|
-
/**
|
|
2377
|
-
* Replace the resource file path when update action is used
|
|
2378
|
-
*
|
|
2379
|
-
* @param resourcePath the resource to be updated
|
|
2380
|
-
* @param event the input event that contains the file
|
|
2381
|
-
*/
|
|
2382
|
-
_updateResource(resourcePath, event) {
|
|
2383
|
-
const files = event.target.files;
|
|
2384
|
-
if (files && files[0]) {
|
|
2385
|
-
resourcePath.blob = files[0];
|
|
2386
|
-
resourcePath.updateType = EUpdateType.Update;
|
|
2387
|
-
this._updateStore();
|
|
2388
|
-
}
|
|
2389
|
-
}
|
|
2390
|
-
/**
|
|
2391
|
-
* Add the new resource to the resource file paths
|
|
2392
|
-
*
|
|
2393
|
-
* @param event the inputs event that contains the new file
|
|
2394
|
-
*/
|
|
2395
|
-
_add(event) {
|
|
2396
|
-
const files = event.target.files;
|
|
2397
|
-
if (files && files[0]) {
|
|
2398
|
-
const url = URL.createObjectURL(files[0]);
|
|
2399
|
-
const filename = files[0].name;
|
|
2400
|
-
// Add the item if it's not already in the resource file paths list
|
|
2401
|
-
if (!this.resourceFilePaths.some(r => r.filename === filename && r.url === url)) {
|
|
2402
|
-
this.resourceFilePaths = [
|
|
2403
|
-
...this.resourceFilePaths,
|
|
2404
|
-
{
|
|
2405
|
-
url,
|
|
2406
|
-
type: EFileType.Data,
|
|
2407
|
-
folder: undefined,
|
|
2408
|
-
filename,
|
|
2409
|
-
blob: files[0],
|
|
2410
|
-
updateType: EUpdateType.Add
|
|
2411
|
-
}
|
|
2412
|
-
];
|
|
2413
|
-
this._updateStore();
|
|
2414
|
-
}
|
|
2415
|
-
}
|
|
2416
|
-
}
|
|
2417
|
-
/**
|
|
2418
|
-
* Add or remove the value from the store
|
|
2419
|
-
*/
|
|
2420
|
-
_updateStore() {
|
|
2421
|
-
const item = state.getItemInfo(this.itemId);
|
|
2422
|
-
item.resourceFilePaths = this.resourceFilePaths;
|
|
2423
|
-
state.setItemInfo(item);
|
|
2424
|
-
}
|
|
2425
|
-
/**
|
|
2426
|
-
* Fetches the component's translations
|
|
2427
|
-
*
|
|
2428
|
-
* @protected
|
|
2429
|
-
*/
|
|
2430
|
-
async _getTranslations() {
|
|
2431
|
-
const translations = await getLocaleComponentStrings(this.el);
|
|
2432
|
-
this._translations = translations[0];
|
|
2433
|
-
}
|
|
2434
|
-
get el() { return getElement(this); }
|
|
2435
|
-
static get watchers() { return {
|
|
2436
|
-
"itemId": ["itemIdWatchHandler"]
|
|
2437
|
-
}; }
|
|
2438
|
-
};
|
|
2439
|
-
SolutionResourceItem.style = solutionResourceItemCss;
|
|
2440
|
-
|
|
2441
|
-
const solutionTemplateDataCss = ":host{display:flexbox}.solution-data-container{position:absolute;height:-moz-available;height:calc(100% - 48px);height:-webkit-fill-available;height:stretch;width:-moz-available;width:100%;width:-webkit-fill-available;width:stretch}.solution-data-child-container{display:flex;height:100%;width:100%;flex-direction:column;overflow-y:auto}.solution-data-editor-container{height:100%}.solution-data-child-container-collapsed{display:flex;height:100%;flex-direction:column;overflow:auto;width:50px}.inputBottomSeparation{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem}.json-editor{margin:1rem;width:auto;width:-webkit-fill-available -moz-available}.collapse-btn{padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:0px}.org-vars{padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:0px}.sol-vars{padding-top:0px;padding-bottom:0px;padding-left:1rem;padding-right:1rem;min-height:45%}.padding-1{padding:1rem}.light{background-color:#F4F4F4}";
|
|
2442
|
-
|
|
2443
|
-
const SolutionTemplateData = class {
|
|
2444
|
-
//--------------------------------------------------------------------------
|
|
2445
|
-
//
|
|
2446
|
-
// Lifecycle
|
|
2447
|
-
//
|
|
2448
|
-
//--------------------------------------------------------------------------
|
|
2449
|
-
constructor(hostRef) {
|
|
2450
|
-
registerInstance(this, hostRef);
|
|
2451
|
-
this._initializing = false;
|
|
2452
|
-
this.instanceid = "";
|
|
2453
|
-
this.itemId = "";
|
|
2454
|
-
this.organizationVariables = "";
|
|
2455
|
-
this.solutionVariables = "";
|
|
2456
|
-
this.varsOpen = true;
|
|
2457
|
-
this._translations = undefined;
|
|
2458
|
-
this.value = "";
|
|
2459
|
-
window.addEventListener("solutionEditorContentChanged", (evt) => {
|
|
2460
|
-
if (this.itemId) {
|
|
2461
|
-
const { id, contents } = evt.detail;
|
|
2462
|
-
const [itemId, instanceId] = id.split("|");
|
|
2463
|
-
if (itemId == this.itemId && instanceId === this.instanceid) {
|
|
2464
|
-
if (!this._initializing && contents.length > 0) {
|
|
2465
|
-
const itemEdit = state.getItemInfo(itemId);
|
|
2466
|
-
if (instanceId === "data") {
|
|
2467
|
-
itemEdit.data = JSON.parse(contents);
|
|
2468
|
-
}
|
|
2469
|
-
else {
|
|
2470
|
-
itemEdit.properties = JSON.parse(contents);
|
|
2471
|
-
}
|
|
2472
|
-
state.setItemInfo(itemEdit);
|
|
2473
|
-
}
|
|
2474
|
-
this._initializing = false;
|
|
2475
|
-
}
|
|
2476
|
-
}
|
|
2477
|
-
});
|
|
2478
|
-
}
|
|
2479
|
-
itemIdWatchHandler() {
|
|
2480
|
-
this._initializing = true;
|
|
2481
|
-
this.value = JSON.stringify(this.instanceid === "data"
|
|
2482
|
-
? state.getItemInfo(this.itemId).data
|
|
2483
|
-
: state.getItemInfo(this.itemId).properties, null, 2);
|
|
2484
|
-
}
|
|
2485
|
-
/**
|
|
2486
|
-
* StencilJS: Called once just after the component is first connected to the DOM.
|
|
2487
|
-
*/
|
|
2488
|
-
componentWillLoad() {
|
|
2489
|
-
return this._getTranslations();
|
|
2490
|
-
}
|
|
2491
|
-
/**
|
|
2492
|
-
* Renders the component.
|
|
2493
|
-
*/
|
|
2494
|
-
render() {
|
|
2495
|
-
return (h(Host, null, h("div", { class: "solution-data-container" }, h("calcite-shell", { class: "light var-container", dir: "ltr" }, h("calcite-panel", { class: "json-editor" }, h("div", { class: "solution-data-child-container calcite-match-height" }, h("json-editor", { class: "solution-data-editor-container", instanceid: this.itemId + "|" + this.instanceid, value: this.value }))), h("calcite-shell-panel", { "height-scale": "l", position: "end", slot: "contextual-panel", "width-scale": "xs" }, h("div", { class: this.varsOpen ? "solution-data-child-container" : "solution-data-child-container-collapsed" }, h("calcite-button", { appearance: "transparent", class: "collapse-btn", "icon-start": this.varsOpen ? "chevrons-right" : "chevrons-left", id: "collapse-vars", onClick: () => this._toggleVars(), scale: "s", title: this.varsOpen ? this._translations.collapse : this._translations.expand }), h("div", { class: this.varsOpen ? "org-vars" : "org-vars display-none", id: "orgVars" }, h("solution-organization-variables", { value: this.organizationVariables })), h("div", { class: this.varsOpen ? "sol-vars" : "sol-vars display-none", id: "solVars" }, h("solution-variables", { value: this.solutionVariables }))))))));
|
|
2496
|
-
}
|
|
2497
|
-
//--------------------------------------------------------------------------
|
|
2498
|
-
//
|
|
2499
|
-
// Event Listeners
|
|
2500
|
-
//
|
|
2501
|
-
//--------------------------------------------------------------------------
|
|
2502
|
-
//--------------------------------------------------------------------------
|
|
2503
|
-
//
|
|
2504
|
-
// Events
|
|
2505
|
-
//
|
|
2506
|
-
//--------------------------------------------------------------------------
|
|
2507
|
-
//--------------------------------------------------------------------------
|
|
2508
|
-
//
|
|
2509
|
-
// Public Methods (async)
|
|
2510
|
-
//
|
|
2511
|
-
//--------------------------------------------------------------------------
|
|
2512
|
-
//--------------------------------------------------------------------------
|
|
2513
|
-
//
|
|
2514
|
-
// Private Methods
|
|
2515
|
-
//
|
|
2516
|
-
//--------------------------------------------------------------------------
|
|
2517
|
-
/**
|
|
2518
|
-
* Toggle varsOpen prop to show/hide variable containers
|
|
2519
|
-
*/
|
|
2520
|
-
_toggleVars() {
|
|
2521
|
-
this.varsOpen = !this.varsOpen;
|
|
2522
|
-
}
|
|
2523
|
-
/**
|
|
2524
|
-
* Fetches the component's translations
|
|
2525
|
-
*
|
|
2526
|
-
* @protected
|
|
2527
|
-
*/
|
|
2528
|
-
async _getTranslations() {
|
|
2529
|
-
const translations = await getLocaleComponentStrings(this.el);
|
|
2530
|
-
this._translations = translations[0];
|
|
2531
|
-
}
|
|
2532
|
-
get el() { return getElement(this); }
|
|
2533
|
-
static get watchers() { return {
|
|
2534
|
-
"itemId": ["itemIdWatchHandler"]
|
|
2535
|
-
}; }
|
|
2536
|
-
};
|
|
2537
|
-
SolutionTemplateData.style = solutionTemplateDataCss;
|
|
2538
|
-
|
|
2539
2287
|
const solutionVariablesCss = ":host{display:block;box-sizing:border-box;margin-left:0.75rem;margin-right:0.75rem;min-width:0;flex-grow:0;flex-shrink:1}:host-group-1-up>.block{flex-basis:calc(100% - 1.5rem);width:calc(100% - 1.5rem)}:host-group-2-up>.block{flex-basis:calc(50% - 1.5rem);width:calc(50% - 1.5rem)}:host-group-3-up>.block{flex-basis:calc(33.33333% - 1.5rem);width:calc(33.33333% - 1.5rem)}:host-group-4-up>.block{flex-basis:calc(25% - 1.5rem);width:calc(25% - 1.5rem)}:host-group-5-up>.block{flex-basis:calc(20% - 1.5rem);width:calc(20% - 1.5rem)}:host-group-6-up>.block{flex-basis:calc(16.66666% - 1.5rem);width:calc(16.66666% - 1.5rem)}:host-group-7-up>.block{flex-basis:calc(14.2857% - 1.5rem);width:calc(14.2857% - 1.5rem)}:host-group-8-up>.block{flex-basis:calc(12.5% - 1.5rem);width:calc(12.5% - 1.5rem)}.tablet-block-group-1-up>:host{flex-basis:calc(100% - 1.5rem);width:calc(100% - 1.5rem)}.tablet-block-group-2-up>:host{flex-basis:calc(50% - 1.5rem);width:calc(50% - 1.5rem)}.tablet-block-group-3-up>:host{flex-basis:calc(33.33333% - 1.5rem);width:calc(33.33333% - 1.5rem)}.tablet-block-group-4-up>:host{flex-basis:calc(25% - 1.5rem);width:calc(25% - 1.5rem)}.tablet-block-group-5-up>:host{flex-basis:calc(20% - 1.5rem);width:calc(20% - 1.5rem)}.tablet-block-group-6-up>:host{flex-basis:calc(16.66666% - 1.5rem);width:calc(16.66666% - 1.5rem)}.tablet-block-group-7-up>:host{flex-basis:calc(14.2857% - 1.5rem);width:calc(14.2857% - 1.5rem)}.tablet-block-group-8-up>:host{flex-basis:calc(12.5% - 1.5rem);width:calc(12.5% - 1.5rem)}.phone-block-group-1-up>:host{flex-basis:calc(100% - 1.5rem);width:calc(100% - 1.5rem)}.phone-block-group-2-up>:host{flex-basis:calc(50% - 1.5rem);width:calc(50% - 1.5rem)}.phone-block-group-3-up>:host{flex-basis:calc(33.33333% - 1.5rem);width:calc(33.33333% - 1.5rem)}.phone-block-group-4-up>:host{flex-basis:calc(25% - 1.5rem);width:calc(25% - 1.5rem)}.phone-block-group-5-up>:host{flex-basis:calc(20% - 1.5rem);width:calc(20% - 1.5rem)}.phone-block-group-6-up>:host{flex-basis:calc(16.66666% - 1.5rem);width:calc(16.66666% - 1.5rem)}.phone-block-group-7-up>:host{flex-basis:calc(14.2857% - 1.5rem);width:calc(14.2857% - 1.5rem)}.phone-block-group-8-up>:host{flex-basis:calc(12.5% - 1.5rem);width:calc(12.5% - 1.5rem)}.code-face :host{letter-spacing:0em;font-family:\"Consolas\", \"Andale Mono\", \"Lucida Console\", \"Monaco\", monospace;font-weight:400;font-style:normal}.code-face :host b,.code-face :host strong{font-weight:400}.code-italic :host{letter-spacing:0em;font-family:\"Consolas\", \"Andale Mono\", \"Lucida Console\", \"Monaco\", monospace;font-weight:400;font-style:italic}.code-italic :host b,.code-italic :host strong{font-weight:400}.container-border{overflow-y:hidden}.org-var-header{margin-top:1rem;margin-bottom:1rem;margin-left:0px;margin-right:0px}.icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";
|
|
2540
2288
|
|
|
2541
2289
|
const SolutionVariables = class {
|
|
@@ -2627,6 +2375,6 @@ const SolutionVariables = class {
|
|
|
2627
2375
|
};
|
|
2628
2376
|
SolutionVariables.style = solutionVariablesCss;
|
|
2629
2377
|
|
|
2630
|
-
export { ShellPanel as calcite_shell_panel, Tab as calcite_tab, TabNav as calcite_tab_nav, TabTitle as calcite_tab_title, Tabs as calcite_tabs, ValueList as calcite_value_list, ValueListItem as calcite_value_list_item, JsonEditor as json_editor,
|
|
2378
|
+
export { Panel as calcite_panel, Shell as calcite_shell, ShellPanel as calcite_shell_panel, Tab as calcite_tab, TabNav as calcite_tab_nav, TabTitle as calcite_tab_title, Tabs as calcite_tabs, ValueList as calcite_value_list, ValueListItem as calcite_value_list_item, JsonEditor as json_editor, SolutionOrganizationVariables as solution_organization_variables, SolutionVariables as solution_variables };
|
|
2631
2379
|
|
|
2632
|
-
//# sourceMappingURL=p-
|
|
2380
|
+
//# sourceMappingURL=p-a1786d11.entry.js.map
|