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