@esri/calcite-components 1.0.0-next.308 → 1.0.0-next.309

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.
Files changed (44) hide show
  1. package/dist/calcite/calcite.esm.js +1 -1
  2. package/dist/calcite/p-362cb320.entry.js +5 -0
  3. package/dist/calcite/p-688f06b9.entry.js +5 -0
  4. package/dist/calcite/p-8c02f97a.entry.js +5 -0
  5. package/dist/calcite/p-8e252799.system.js +1 -1
  6. package/dist/calcite/{p-243d95ab.system.entry.js → p-a5e8f022.system.entry.js} +2 -2
  7. package/dist/calcite/{p-047e1000.system.entry.js → p-b0e21c19.system.entry.js} +1 -1
  8. package/dist/calcite/p-ca6025ab.system.entry.js +5 -0
  9. package/dist/cjs/calcite-alert.cjs.entry.js +22 -5
  10. package/dist/cjs/calcite-input.cjs.entry.js +6 -5
  11. package/dist/cjs/calcite-shell_3.cjs.entry.js +156 -5
  12. package/dist/cjs/calcite.cjs.js +1 -1
  13. package/dist/cjs/loader.cjs.js +1 -1
  14. package/dist/collection/components/calcite-alert/calcite-alert.js +23 -4
  15. package/dist/collection/components/calcite-input/calcite-input.js +6 -5
  16. package/dist/collection/components/calcite-shell-panel/calcite-shell-panel.css +43 -0
  17. package/dist/collection/components/calcite-shell-panel/calcite-shell-panel.js +194 -5
  18. package/dist/collection/components/calcite-shell-panel/resources.js +5 -1
  19. package/dist/components/calcite-alert.js +22 -5
  20. package/dist/components/calcite-input2.js +6 -5
  21. package/dist/components/calcite-shell-panel.js +161 -7
  22. package/dist/custom-elements/index.js +277 -109
  23. package/dist/esm/calcite-alert.entry.js +22 -5
  24. package/dist/esm/calcite-input.entry.js +6 -5
  25. package/dist/esm/calcite-shell_3.entry.js +157 -6
  26. package/dist/esm/calcite.js +1 -1
  27. package/dist/esm/loader.js +1 -1
  28. package/dist/esm-es5/calcite-alert.entry.js +2 -2
  29. package/dist/esm-es5/calcite-input.entry.js +1 -1
  30. package/dist/esm-es5/calcite-shell_3.entry.js +1 -1
  31. package/dist/esm-es5/calcite.js +1 -1
  32. package/dist/esm-es5/loader.js +1 -1
  33. package/dist/extras/docs-json.json +40 -1
  34. package/dist/types/components/calcite-alert/calcite-alert.d.ts +3 -0
  35. package/dist/types/components/calcite-shell-panel/calcite-shell-panel.d.ts +31 -0
  36. package/dist/types/components/calcite-shell-panel/resources.d.ts +4 -0
  37. package/dist/types/components.d.ts +18 -0
  38. package/hydrate/index.js +281 -110
  39. package/package.json +1 -1
  40. package/readme.md +2 -2
  41. package/dist/calcite/p-5c0c29bc.entry.js +0 -5
  42. package/dist/calcite/p-5f817b79.entry.js +0 -5
  43. package/dist/calcite/p-75955cef.entry.js +0 -5
  44. package/dist/calcite/p-b1a96c72.system.entry.js +0 -5
@@ -63,8 +63,13 @@ let CalciteAlert$1 = class extends HTMLElement {
63
63
  this.queueLength = 0;
64
64
  /** is the alert queued */
65
65
  this.queued = false;
66
+ this.autoDismissTimeout = null;
67
+ this.trackTimer = new Date();
66
68
  /** close and emit the closed alert and the queue */
67
69
  this.closeAlert = () => {
70
+ if (this.autoDismissTimeout) {
71
+ this.autoDismissTimeout = null;
72
+ }
68
73
  this.queued = false;
69
74
  this.active = false;
70
75
  this.queue = this.queue.filter((e) => e !== this.el);
@@ -88,6 +93,12 @@ let CalciteAlert$1 = class extends HTMLElement {
88
93
  updateRequestedIcon() {
89
94
  this.requestedIcon = setRequestedIcon(StatusIcons, this.icon, this.color);
90
95
  }
96
+ updateDuration(newDuration, prevDuration) {
97
+ if (this.autoDismiss && prevDuration !== newDuration && this.autoDismissTimeout) {
98
+ window.clearTimeout(this.autoDismissTimeout);
99
+ this.autoDismissTimeout = window.setTimeout(() => this.closeAlert(), DURATIONS[this.autoDismissDuration] - (new Date().valueOf() - this.trackTimer.valueOf()));
100
+ }
101
+ }
91
102
  //--------------------------------------------------------------------------
92
103
  //
93
104
  // Lifecycle
@@ -104,20 +115,25 @@ let CalciteAlert$1 = class extends HTMLElement {
104
115
  componentDidLoad() {
105
116
  this.alertLinkEl = this.el.querySelectorAll("calcite-link")[0];
106
117
  }
118
+ disconnectedCallback() {
119
+ if (this.autoDismissTimeout) {
120
+ window.clearTimeout(this.autoDismissTimeout);
121
+ }
122
+ }
107
123
  render() {
108
124
  const dir = getElementDir(this.el);
109
125
  const closeButton = (h("button", { "aria-label": this.intlClose, class: "alert-close", onClick: this.closeAlert, ref: (el) => (this.closeButton = el), type: "button" }, h("calcite-icon", { icon: "x", scale: this.scale === "l" ? "m" : "s" })));
110
126
  const queueText = `+${this.queueLength > 2 ? this.queueLength - 1 : 1}`;
111
127
  const queueCount = (h("div", { class: `${this.queueLength > 1 ? "active " : ""}alert-queue-count` }, h("calcite-chip", { scale: this.scale, value: queueText }, queueText)));
112
128
  const { active, autoDismiss, label, queued, requestedIcon } = this;
113
- const progress = h("div", { class: "alert-dismiss-progress" });
129
+ const progressBar = h("div", { class: "alert-dismiss-progress" });
114
130
  const role = autoDismiss ? "alert" : "alertdialog";
115
131
  const hidden = !active;
116
132
  return (h(Host, { "aria-hidden": hidden.toString(), "aria-label": label, "calcite-hydrated-hidden": hidden, role: role }, h("div", { class: {
117
133
  container: true,
118
134
  queued,
119
135
  [CSS_UTILITY.rtl]: dir === "rtl"
120
- } }, requestedIcon ? (h("div", { class: "alert-icon" }, h("calcite-icon", { icon: requestedIcon, scale: this.scale === "l" ? "m" : "s" }))) : null, h("div", { class: "alert-content" }, h("slot", { name: SLOTS.title }), h("slot", { name: SLOTS.message }), h("slot", { name: SLOTS.link })), queueCount, !autoDismiss ? closeButton : null, active && !queued && autoDismiss ? progress : null)));
136
+ } }, requestedIcon ? (h("div", { class: "alert-icon" }, h("calcite-icon", { icon: requestedIcon, scale: this.scale === "l" ? "m" : "s" }))) : null, h("div", { class: "alert-content" }, h("slot", { name: SLOTS.title }), h("slot", { name: SLOTS.message }), h("slot", { name: SLOTS.link })), queueCount, !autoDismiss ? closeButton : null, active && !queued && autoDismiss ? progressBar : null)));
121
137
  }
122
138
  // when an alert is opened or closed, update queue and determine active alert
123
139
  alertSync(event) {
@@ -163,8 +179,8 @@ let CalciteAlert$1 = class extends HTMLElement {
163
179
  var _a;
164
180
  if (((_a = this.queue) === null || _a === void 0 ? void 0 : _a[0]) === this.el) {
165
181
  this.openAlert();
166
- clearTimeout(this.autoDismissTimeout);
167
- if (this.autoDismiss) {
182
+ if (this.autoDismiss && !this.autoDismissTimeout) {
183
+ this.trackTimer = new Date();
168
184
  this.autoDismissTimeout = window.setTimeout(() => this.closeAlert(), DURATIONS[this.autoDismissDuration]);
169
185
  }
170
186
  }
@@ -185,7 +201,8 @@ let CalciteAlert$1 = class extends HTMLElement {
185
201
  static get watchers() { return {
186
202
  "active": ["watchActive"],
187
203
  "icon": ["updateRequestedIcon"],
188
- "color": ["updateRequestedIcon"]
204
+ "color": ["updateRequestedIcon"],
205
+ "autoDismissDuration": ["updateDuration"]
189
206
  }; }
190
207
  static get style() { return calciteAlertCss; }
191
208
  };
@@ -233,12 +233,13 @@ let CalciteInput = class extends HTMLElement {
233
233
  const inputMin = this.minString ? parseFloat(this.minString) : null;
234
234
  const valueNudgeDelayInMs = 100;
235
235
  this.incrementOrDecrementNumberValue(direction, inputMax, inputMin, nativeEvent);
236
- let nudgeNumberValueIntervalCount = 0;
236
+ let firstValueNudge = true;
237
237
  this.nudgeNumberValueIntervalId = setInterval(() => {
238
- nudgeNumberValueIntervalCount !== 0
239
- ? this.incrementOrDecrementNumberValue(direction, inputMax, inputMin, nativeEvent)
240
- : null;
241
- nudgeNumberValueIntervalCount++;
238
+ if (firstValueNudge) {
239
+ firstValueNudge = false;
240
+ return;
241
+ }
242
+ this.incrementOrDecrementNumberValue(direction, inputMax, inputMin, nativeEvent);
242
243
  }, valueNudgeDelayInMs);
243
244
  };
244
245
  this.numberButtonMouseUpAndMouseOutHandler = () => {
@@ -2,22 +2,27 @@
2
2
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
4
4
  */
5
- import { HTMLElement, createEvent, h, proxyCustomElement } from '@stencil/core/internal/client';
5
+ import { HTMLElement, createEvent, h, forceUpdate, proxyCustomElement } from '@stencil/core/internal/client';
6
6
  import { b as getSlotted } from './dom.js';
7
+ import { c as clamp } from './math.js';
7
8
 
8
9
  const CSS = {
9
10
  container: "container",
10
11
  content: "content",
11
12
  contentHeader: "content__header",
12
13
  contentBody: "content__body",
13
- contentDetached: "content--detached"
14
+ contentDetached: "content--detached",
15
+ separator: "separator"
14
16
  };
15
17
  const SLOTS = {
16
18
  actionBar: "action-bar",
17
19
  header: "header"
18
20
  };
21
+ const TEXT = {
22
+ resize: "Resize"
23
+ };
19
24
 
20
- const calciteShellPanelCss = "@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:300ms}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:150ms ease-in-out}:host([hidden]){display:none}:host{display:-ms-flexbox;display:flex;-ms-flex-align:stretch;align-items:stretch;-ms-flex:0 1 auto;flex:0 1 auto;--calcite-shell-panel-detached-max-height:unset}.container{-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-align:stretch;align-items:stretch;background-color:transparent;-ms-flex:1 1 auto;flex:1 1 auto;pointer-events:none;color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}.container *{-webkit-box-sizing:border-box;box-sizing:border-box}::slotted(calcite-panel),::slotted(calcite-flow){-ms-flex:1 1 auto;flex:1 1 auto;height:100%;width:100%;max-height:unset;max-width:unset}::slotted(.calcite-match-height){display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;overflow:hidden}.content{-ms-flex-align:stretch;align-items:stretch;-ms-flex-item-align:stretch;align-self:stretch;background-color:var(--calcite-ui-background);display:-ms-flexbox;display:flex;padding:0;pointer-events:auto;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;width:var(--calcite-shell-panel-width);max-width:var(--calcite-shell-panel-max-width);min-width:var(--calcite-shell-panel-min-width);-webkit-transition:max-height 150ms ease-in-out, max-width 150ms ease-in-out;transition:max-height 150ms ease-in-out, max-width 150ms ease-in-out}.content__header{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:0 1 auto;flex:0 1 auto;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-align:stretch;align-items:stretch}.content__body{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-direction:column;flex-direction:column;overflow:hidden}:host([width-scale=s]) .content{--calcite-shell-panel-width:calc(var(--calcite-panel-width-multiplier) * 12vw);--calcite-shell-panel-max-width:calc(var(--calcite-panel-width-multiplier) * 300px);--calcite-shell-panel-min-width:calc(var(--calcite-panel-width-multiplier) * 150px)}:host([width-scale=m]) .content{--calcite-shell-panel-width:calc(var(--calcite-panel-width-multiplier) * 20vw);--calcite-shell-panel-max-width:calc(var(--calcite-panel-width-multiplier) * 420px);--calcite-shell-panel-min-width:calc(var(--calcite-panel-width-multiplier) * 240px)}:host([width-scale=l]) .content{--calcite-shell-panel-width:calc(var(--calcite-panel-width-multiplier) * 45vw);--calcite-shell-panel-max-width:calc(var(--calcite-panel-width-multiplier) * 680px);--calcite-shell-panel-min-width:calc(var(--calcite-panel-width-multiplier) * 340px)}:host([detached-height-scale=s]) .content--detached{--calcite-shell-panel-detached-max-height:40vh}:host([detached-height-scale=m]) .content--detached{--calcite-shell-panel-detached-max-height:60vh}:host([detached-height-scale=l]) .content--detached{--calcite-shell-panel-detached-max-height:80vh}.content--detached{border-radius:0.25rem;-webkit-box-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);box-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);height:auto;overflow:hidden;margin-top:0.5rem;margin-bottom:auto;margin-left:0.5rem;margin-right:0.5rem;max-height:var(--calcite-shell-panel-detached-max-height)}.content--detached ::slotted(calcite-panel),.content--detached ::slotted(calcite-flow){max-height:unset}:host([position=start]) .content--detached ::slotted(calcite-panel),:host([position=start]) .content--detached ::slotted(calcite-flow),:host([position=end]) .content--detached ::slotted(calcite-panel),:host([position=end]) .content--detached ::slotted(calcite-flow){border-style:none}.content[hidden]{display:none}slot[name=action-bar]::slotted(calcite-action-bar),.content ::slotted(calcite-flow),.content ::slotted(calcite-panel){border-width:1px;border-color:var(--calcite-ui-border-3);border-style:solid}:host([position=start]) slot[name=action-bar]::slotted(calcite-action-bar),:host([position=start]) .content ::slotted(calcite-flow),:host([position=start]) .content ::slotted(calcite-panel){-webkit-border-start:none;border-inline-start:none}:host([position=end]) slot[name=action-bar]::slotted(calcite-action-bar),:host([position=end]) .content ::slotted(calcite-flow),:host([position=end]) .content ::slotted(calcite-panel){-webkit-border-end:none;border-inline-end:none}";
25
+ const calciteShellPanelCss = "@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:300ms}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:150ms ease-in-out}:host([hidden]){display:none}:host{display:-ms-flexbox;display:flex;-ms-flex-align:stretch;align-items:stretch;-ms-flex:0 1 auto;flex:0 1 auto;--calcite-shell-panel-detached-max-height:unset}.container{-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-align:stretch;align-items:stretch;background-color:transparent;-ms-flex:1 1 auto;flex:1 1 auto;pointer-events:none;color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}.container *{-webkit-box-sizing:border-box;box-sizing:border-box}:host(:hover) .separator:not(:hover):not(:focus),:host(:focus-within) .separator:not(:hover):not(:focus){opacity:1;background-color:var(--calcite-ui-border-3)}.separator{position:absolute;background-color:transparent;bottom:0;display:-ms-flexbox;display:flex;height:100%;opacity:0;pointer-events:auto;top:0;-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:150ms;transition-duration:150ms;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s;width:0.125rem;z-index:10;cursor:col-resize;outline:none}.separator:hover{opacity:1;background-color:var(--calcite-ui-border-2)}.separator:focus{background-color:var(--calcite-ui-brand);opacity:1}:host([position=start]) .separator{inset-inline-end:-2px}:host([position=end]) .separator{inset-inline-start:-2px}::slotted(calcite-panel),::slotted(calcite-flow){-ms-flex:1 1 auto;flex:1 1 auto;height:100%;width:100%;max-height:unset;max-width:unset}::slotted(.calcite-match-height){display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;overflow:hidden}.content{-ms-flex-align:stretch;align-items:stretch;-ms-flex-item-align:stretch;align-self:stretch;background-color:var(--calcite-ui-background);display:-ms-flexbox;display:flex;padding:0;pointer-events:auto;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;width:var(--calcite-shell-panel-width);max-width:var(--calcite-shell-panel-max-width);min-width:var(--calcite-shell-panel-min-width);-webkit-transition:max-height 150ms ease-in-out, max-width 150ms ease-in-out;transition:max-height 150ms ease-in-out, max-width 150ms ease-in-out}.content__header{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:0 1 auto;flex:0 1 auto;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-align:stretch;align-items:stretch}.content__body{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-direction:column;flex-direction:column;overflow:hidden}:host([width-scale=s]) .content{--calcite-shell-panel-width:calc(var(--calcite-panel-width-multiplier) * 12vw);--calcite-shell-panel-max-width:calc(var(--calcite-panel-width-multiplier) * 300px);--calcite-shell-panel-min-width:calc(var(--calcite-panel-width-multiplier) * 150px)}:host([width-scale=m]) .content{--calcite-shell-panel-width:calc(var(--calcite-panel-width-multiplier) * 20vw);--calcite-shell-panel-max-width:calc(var(--calcite-panel-width-multiplier) * 420px);--calcite-shell-panel-min-width:calc(var(--calcite-panel-width-multiplier) * 240px)}:host([width-scale=l]) .content{--calcite-shell-panel-width:calc(var(--calcite-panel-width-multiplier) * 45vw);--calcite-shell-panel-max-width:calc(var(--calcite-panel-width-multiplier) * 680px);--calcite-shell-panel-min-width:calc(var(--calcite-panel-width-multiplier) * 340px)}:host([detached-height-scale=s]) .content--detached{--calcite-shell-panel-detached-max-height:40vh}:host([detached-height-scale=m]) .content--detached{--calcite-shell-panel-detached-max-height:60vh}:host([detached-height-scale=l]) .content--detached{--calcite-shell-panel-detached-max-height:80vh}.content--detached{border-radius:0.25rem;-webkit-box-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);box-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);height:auto;overflow:hidden;margin-top:0.5rem;margin-bottom:auto;margin-left:0.5rem;margin-right:0.5rem;max-height:var(--calcite-shell-panel-detached-max-height)}.content--detached ::slotted(calcite-panel),.content--detached ::slotted(calcite-flow){max-height:unset}:host([position=start]) .content--detached ::slotted(calcite-panel),:host([position=start]) .content--detached ::slotted(calcite-flow),:host([position=end]) .content--detached ::slotted(calcite-panel),:host([position=end]) .content--detached ::slotted(calcite-flow){border-style:none}.content[hidden]{display:none}slot[name=action-bar]::slotted(calcite-action-bar),.content ::slotted(calcite-flow),.content ::slotted(calcite-panel){border-width:1px;border-color:var(--calcite-ui-border-3);border-style:solid}:host([position=start]) slot[name=action-bar]::slotted(calcite-action-bar),:host([position=start]) .content ::slotted(calcite-flow),:host([position=start]) .content ::slotted(calcite-panel){-webkit-border-start:none;border-inline-start:none}:host([position=end]) slot[name=action-bar]::slotted(calcite-action-bar),:host([position=end]) .content ::slotted(calcite-flow),:host([position=end]) .content ::slotted(calcite-panel){-webkit-border-end:none;border-inline-end:none}";
21
26
 
22
27
  let CalciteShellPanel$1 = class extends HTMLElement {
23
28
  constructor() {
@@ -46,10 +51,121 @@ let CalciteShellPanel$1 = class extends HTMLElement {
46
51
  * This sets width of the content area.
47
52
  */
48
53
  this.widthScale = "m";
54
+ /**
55
+ * Accessible label for resize separator.
56
+ * @default "Resize"
57
+ */
58
+ this.intlResize = TEXT.resize;
59
+ /**
60
+ * This property makes the content area resizable if the calcite-shell-panel is not 'detached'.
61
+ */
62
+ this.resizable = false;
63
+ this.contentWidth = null;
64
+ this.initialContentWidth = null;
65
+ this.initialClientX = null;
66
+ this.contentWidthMax = null;
67
+ this.contentWidthMin = null;
68
+ this.step = 1;
69
+ this.stepMultiplier = 10;
70
+ this.storeContentEl = (contentEl) => {
71
+ this.contentEl = contentEl;
72
+ };
73
+ this.getKeyAdjustedWidth = (event) => {
74
+ const { key } = event;
75
+ const { step, stepMultiplier, contentWidthMin, contentWidthMax, initialContentWidth, position } = this;
76
+ const multipliedStep = step * stepMultiplier;
77
+ const MOVEMENT_KEYS = [
78
+ "ArrowUp",
79
+ "ArrowDown",
80
+ "ArrowLeft",
81
+ "ArrowRight",
82
+ "Home",
83
+ "End",
84
+ "PageUp",
85
+ "PageDown"
86
+ ];
87
+ if (MOVEMENT_KEYS.indexOf(key) > -1) {
88
+ event.preventDefault();
89
+ }
90
+ const increaseKeys = key === "ArrowUp" || (position === "end" ? key === "ArrowLeft" : key === "ArrowRight");
91
+ if (increaseKeys) {
92
+ const stepValue = event.shiftKey ? multipliedStep : step;
93
+ return initialContentWidth + stepValue;
94
+ }
95
+ const decreaseKeys = key === "ArrowDown" || (position === "end" ? key === "ArrowRight" : key === "ArrowLeft");
96
+ if (decreaseKeys) {
97
+ const stepValue = event.shiftKey ? multipliedStep : step;
98
+ return initialContentWidth - stepValue;
99
+ }
100
+ if (typeof contentWidthMin === "number" && key === "Home") {
101
+ return contentWidthMin;
102
+ }
103
+ if (typeof contentWidthMax === "number" && key === "End") {
104
+ return contentWidthMax;
105
+ }
106
+ if (key === "PageDown") {
107
+ return initialContentWidth - multipliedStep;
108
+ }
109
+ if (key === "PageUp") {
110
+ return initialContentWidth + multipliedStep;
111
+ }
112
+ return null;
113
+ };
114
+ this.separatorKeyDown = (event) => {
115
+ this.setInitialContentWidth();
116
+ const width = this.getKeyAdjustedWidth(event);
117
+ if (typeof width === "number") {
118
+ this.setContentWidth(width);
119
+ }
120
+ };
121
+ this.separatorPointerMove = (event) => {
122
+ event.preventDefault();
123
+ const { initialContentWidth, position, initialClientX } = this;
124
+ const offset = event.clientX - initialClientX;
125
+ this.setContentWidth(position === "end" ? initialContentWidth - offset : initialContentWidth + offset);
126
+ };
127
+ this.separatorPointerUp = (event) => {
128
+ event.preventDefault();
129
+ document.removeEventListener("pointerup", this.separatorPointerUp);
130
+ document.removeEventListener("pointermove", this.separatorPointerMove);
131
+ };
132
+ this.setInitialContentWidth = () => {
133
+ var _a;
134
+ this.initialContentWidth = (_a = this.contentEl) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().width;
135
+ };
136
+ this.separatorPointerDown = (event) => {
137
+ event.preventDefault();
138
+ const { separatorEl } = this;
139
+ separatorEl && document.activeElement !== separatorEl && separatorEl.focus();
140
+ this.setInitialContentWidth();
141
+ this.initialClientX = event.clientX;
142
+ document.addEventListener("pointerup", this.separatorPointerUp);
143
+ document.addEventListener("pointermove", this.separatorPointerMove);
144
+ };
145
+ this.connectSeparator = (separatorEl) => {
146
+ this.disconnectSeparator();
147
+ this.separatorEl = separatorEl;
148
+ separatorEl.addEventListener("pointerdown", this.separatorPointerDown);
149
+ };
150
+ this.disconnectSeparator = () => {
151
+ var _a;
152
+ (_a = this.separatorEl) === null || _a === void 0 ? void 0 : _a.removeEventListener("pointerdown", this.separatorPointerDown);
153
+ };
49
154
  }
50
155
  watchHandler() {
51
156
  this.calciteShellPanelToggle.emit();
52
157
  }
158
+ //--------------------------------------------------------------------------
159
+ //
160
+ // Lifecycle
161
+ //
162
+ //--------------------------------------------------------------------------
163
+ disconnectedCallback() {
164
+ this.disconnectSeparator();
165
+ }
166
+ componentDidLoad() {
167
+ this.updateAriaValues();
168
+ }
53
169
  // --------------------------------------------------------------------------
54
170
  //
55
171
  // Render Methods
@@ -61,15 +177,50 @@ let CalciteShellPanel$1 = class extends HTMLElement {
61
177
  return hasHeader ? (h("div", { class: CSS.contentHeader }, h("slot", { name: SLOTS.header }))) : null;
62
178
  }
63
179
  render() {
64
- const { collapsed, detached, position } = this;
65
- const contentNode = (h("div", { class: { [CSS.content]: true, [CSS.contentDetached]: detached }, hidden: collapsed }, this.renderHeader(), h("div", { class: CSS.contentBody }, h("slot", null))));
180
+ const { collapsed, detached, position, initialContentWidth, contentWidth, contentWidthMax, contentWidthMin, intlResize, resizable } = this;
181
+ const allowResizing = !detached && resizable;
182
+ const contentNode = (h("div", { class: { [CSS.content]: true, [CSS.contentDetached]: detached }, hidden: collapsed, ref: this.storeContentEl, style: allowResizing && contentWidth ? { width: `${contentWidth}px` } : null }, this.renderHeader(), h("div", { class: CSS.contentBody }, h("slot", null))));
183
+ const separatorNode = allowResizing ? (h("div", { "aria-label": intlResize, "aria-orientation": "horizontal", "aria-valuemax": contentWidthMax, "aria-valuemin": contentWidthMin, "aria-valuenow": contentWidth !== null && contentWidth !== void 0 ? contentWidth : initialContentWidth, class: CSS.separator, onKeyDown: this.separatorKeyDown, ref: this.connectSeparator, role: "separator", tabIndex: 0, "touch-action": "none" })) : null;
66
184
  const actionBarNode = h("slot", { name: SLOTS.actionBar });
67
- const mainNodes = [actionBarNode, contentNode];
185
+ const mainNodes = [actionBarNode, contentNode, separatorNode];
68
186
  if (position === "end") {
69
187
  mainNodes.reverse();
70
188
  }
71
189
  return h("div", { class: { [CSS.container]: true } }, mainNodes);
72
190
  }
191
+ // --------------------------------------------------------------------------
192
+ //
193
+ // private Methods
194
+ //
195
+ // --------------------------------------------------------------------------
196
+ setContentWidth(width) {
197
+ const { contentWidthMax, contentWidthMin } = this;
198
+ const roundedWidth = Math.round(width);
199
+ this.contentWidth =
200
+ typeof contentWidthMax === "number" && typeof contentWidthMin === "number"
201
+ ? clamp(roundedWidth, contentWidthMin, contentWidthMax)
202
+ : roundedWidth;
203
+ }
204
+ updateAriaValues() {
205
+ const { contentEl } = this;
206
+ const computedStyle = contentEl && getComputedStyle(contentEl);
207
+ if (!computedStyle) {
208
+ return;
209
+ }
210
+ const max = parseInt(computedStyle.getPropertyValue("max-width"), 10);
211
+ const min = parseInt(computedStyle.getPropertyValue("min-width"), 10);
212
+ const valueNow = parseInt(computedStyle.getPropertyValue("width"), 10);
213
+ if (typeof valueNow === "number" && !isNaN(valueNow)) {
214
+ this.initialContentWidth = valueNow;
215
+ }
216
+ if (typeof max === "number" && !isNaN(max)) {
217
+ this.contentWidthMax = max;
218
+ }
219
+ if (typeof min === "number" && !isNaN(min)) {
220
+ this.contentWidthMin = min;
221
+ }
222
+ forceUpdate(this);
223
+ }
73
224
  get el() { return this; }
74
225
  static get watchers() { return {
75
226
  "collapsed": ["watchHandler"]
@@ -81,7 +232,10 @@ CalciteShellPanel$1 = /*@__PURE__*/ proxyCustomElement(CalciteShellPanel$1, [1,
81
232
  "detached": [516],
82
233
  "detachedHeightScale": [513, "detached-height-scale"],
83
234
  "widthScale": [513, "width-scale"],
84
- "position": [513]
235
+ "position": [513],
236
+ "intlResize": [1, "intl-resize"],
237
+ "resizable": [516],
238
+ "contentWidth": [32]
85
239
  }]);
86
240
  function defineCustomElement$1() {
87
241
  if (typeof customElements === "undefined") {