@arcgis/charts-components 5.2.0-next.149 → 5.2.0-next.150

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.
@@ -1,74 +1,81 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { c as k } from "../../chunks/runtime.js";
2
+ import { c as x } from "../../chunks/runtime.js";
3
3
  import { keyed as P } from "lit/directives/keyed.js";
4
4
  import { repeat as T } from "lit/directives/repeat.js";
5
5
  import { u as L } from "../../chunks/useT9n.js";
6
- import { css as M, html as a } from "lit";
7
- import { LitElement as N, createEvent as O, renderElement as C, safeStyleMap as h, safeClassMap as r } from "@arcgis/lumina";
6
+ import { css as N, html as a } from "lit";
7
+ import { LitElement as M, createEvent as O, renderElement as C, safeStyleMap as h, safeClassMap as r } from "@arcgis/lumina";
8
8
  import { a as _ } from "../../chunks/chart-ui-utils.js";
9
- import { aG as m, x as E, C as v } from "../../chunks/index.js";
10
- import { r as f } from "../../chunks/popover-ui-utils.js";
11
- import { c as n, d as S } from "../../chunks/chart-object-literals.js";
9
+ import { aG as g, x as E, C as v } from "../../chunks/index.js";
10
+ import { r as S } from "../../chunks/popover-ui-utils.js";
11
+ import { c as n, d as f } from "../../chunks/chart-object-literals.js";
12
12
  const w = {
13
13
  stackedType: "stacked-type"
14
- }, o = {
14
+ }, l = {
15
15
  topSection: "top-section",
16
16
  sectionLabel: "section-label",
17
17
  list: "list",
18
18
  disabledInfo: "disabled-info",
19
19
  disabledStackingOption: "disabled-stacking-option"
20
- }, D = M`.hide{visibility:hidden}.am5-html-container{z-index:101!important}.am5-layer-1000{z-index:1000!important}.am5-layer-30{z-index:100!important}.show{display:block}.notifyPanel{flex:0 1 auto}.disable-interactions{pointer-events:none}.dim-text{color:var(--arcgis-charts-dim-text)}:host{display:flex;flex-direction:column;width:var(--arcgis-charts-config-calcite-block-default-width);margin:var(--arcgis-charts-config-calcite-block-default-margin)}.top-section{margin-top:var(--arcgis-charts-config-margin-minor)}.section-label{display:flex;margin-bottom:var(--arcgis-charts-config-margin-major);margin-left:var(--arcgis-charts-config-margin-minor);margin-right:var(--arcgis-charts-config-margin-minor);justify-content:space-between;align-items:center;font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size-0)}.list{margin-left:var(--arcgis-charts-config-margin-minor);margin-right:var(--arcgis-charts-config-margin-minor);margin-bottom:var(--arcgis-charts-config-margin-major)}.disabled-info{margin:auto 1rem;pointer-events:auto}.disabled-info:active{margin:auto 1rem;pointer-events:none}.disabled-stacking-option{pointer-events:none;opacity:var(--calcite-opacity-disabled)}`;
21
- class z extends N {
20
+ }, D = N`.hide{visibility:hidden}.am5-html-container{z-index:101!important}.am5-layer-1000{z-index:1000!important}.am5-layer-30{z-index:100!important}.show{display:block}.notifyPanel{flex:0 1 auto}.disable-interactions{pointer-events:none}.dim-text{color:var(--arcgis-charts-dim-text)}:host{display:flex;flex-direction:column;width:var(--arcgis-charts-config-calcite-block-default-width);margin:var(--arcgis-charts-config-calcite-block-default-margin)}.top-section{margin-top:var(--arcgis-charts-config-margin-minor)}.section-label{display:flex;margin-bottom:var(--arcgis-charts-config-margin-major);margin-left:var(--arcgis-charts-config-margin-minor);margin-right:var(--arcgis-charts-config-margin-minor);justify-content:space-between;align-items:center;font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size-0)}.list{margin-left:var(--arcgis-charts-config-margin-minor);margin-right:var(--arcgis-charts-config-margin-minor);margin-bottom:var(--arcgis-charts-config-margin-major)}.disabled-info{margin:auto 1rem;pointer-events:auto}.disabled-info:active{margin:auto 1rem;pointer-events:none}.disabled-stacking-option{pointer-events:none;opacity:var(--calcite-opacity-disabled)}`;
21
+ class z extends M {
22
22
  constructor() {
23
23
  super(...arguments), this._messages = L(), this.open = !1, this.seriesNameChange = (e) => {
24
24
  if (e.detail !== null && e.detail !== void 0) {
25
25
  const t = e.detail.name;
26
26
  if (this.isNullCategorySelected) {
27
- const s = this.model.nullCategory;
28
- if (s) {
29
- const i = { ...s, text: t };
30
- this.model.nullCategory = i;
27
+ const i = this.model.nullCategory;
28
+ if (i) {
29
+ const s = { ...i, text: t };
30
+ this.model.nullCategory = s;
31
31
  }
32
- } else
33
- this.model.setSeriesName(t, this.selectedSeriesIndex ?? -1);
32
+ } else {
33
+ const i = this.selectedSeriesIndex;
34
+ i !== void 0 && i >= 0 && this.model.setSeriesName(t, i);
35
+ }
34
36
  }
35
37
  }, this.seriesColorChange = (e) => {
36
38
  if (e.detail !== null && e.detail !== void 0) {
37
39
  const { color: t } = e.detail;
38
40
  if (t !== void 0) {
39
41
  if (this.isNullCategorySelected) {
40
- const s = this.model.nullCategory, i = m(s), l = s !== void 0 && i !== void 0 ? {
41
- ...s,
42
+ const i = this.model.nullCategory, s = g(i), o = i !== void 0 && s !== void 0 ? {
43
+ ...i,
42
44
  fillSymbol: {
43
- ...i,
45
+ ...s,
44
46
  color: t,
45
- outline: i.outline && { ...i.outline, color: t }
47
+ outline: s.outline && { ...s.outline, color: t }
46
48
  }
47
49
  } : void 0;
48
- this.model.nullCategory = l;
49
- } else
50
- this.model.setSeriesColor(t, this.selectedSeriesIndex ?? -1);
50
+ this.model.nullCategory = o;
51
+ } else {
52
+ const i = this.selectedSeriesIndex;
53
+ i !== void 0 && i >= 0 && this.model.setSeriesColor(t, i);
54
+ }
51
55
  this.model.colorMatch = !1;
52
56
  }
53
57
  }
54
58
  }, this.seriesPopoverClose = (e) => {
55
59
  const { selectedSeriesIndex: t } = e.detail;
56
- this.selectedSeriesIndex === t && (this.seriesPopover = f(this.seriesPopover), this.selectedSeriesIndex = void 0);
60
+ this.selectedSeriesIndex === t && (this.seriesPopover = S(this.seriesPopover), this.selectedSeriesId = void 0);
57
61
  }, this.onModelConfigChange = () => {
58
- this.requestUpdate();
62
+ this.selectedSeriesId !== void 0 && !this.isNullCategorySelected && this.selectedSeriesIndex === -1 ? (this.removeSeriesPopover(), this.selectedSeriesId = void 0) : this.seriesPopover && (this.seriesPopover.selectedSeriesIndex = this.selectedSeriesIndex), this.requestUpdate();
59
63
  }, this.seriesOrderResetCounter = 0, this.activeColorMatch = !1, this.popoverPlacement = "leading", this.arcgisChartsConfigDataChangeError = O();
60
64
  }
61
65
  static {
62
- this.properties = { seriesOrderResetCounter: 16, selectedSeriesIndex: 16, messageOverrides: 0, model: 0, activeColorMatch: 5, popoverPlacement: 1 };
66
+ this.properties = { seriesOrderResetCounter: 16, selectedSeriesId: 16, messageOverrides: 0, model: 0, activeColorMatch: 5, popoverPlacement: 1 };
63
67
  }
64
68
  static {
65
69
  this.styles = D;
66
70
  }
71
+ get selectedSeriesIndex() {
72
+ return this.selectedSeriesId === void 0 ? void 0 : this.model.getSeriesIndex(this.selectedSeriesId);
73
+ }
67
74
  load() {
68
75
  this.modelChange(this.model), this.onModelConfigChange();
69
76
  }
70
77
  willUpdate(e) {
71
- e.has("model") && this.modelChange(this.model, e.get("model")), e.has("selectedSeriesIndex") && this.selectedSeriesIndexChange();
78
+ e.has("model") && this.modelChange(this.model, e.get("model")), e.has("selectedSeriesId") && this.selectedSeriesChange();
72
79
  }
73
80
  disconnectedCallback() {
74
81
  super.disconnectedCallback(), this.removeSeriesPopover(), this.model.removeEventListener("arcgisChartsModelConfigChange", this.onModelConfigChange);
@@ -77,37 +84,37 @@ class z extends N {
77
84
  t?.removeEventListener("arcgisChartsModelConfigChange", this.onModelConfigChange), e?.addEventListener("arcgisChartsModelConfigChange", this.onModelConfigChange);
78
85
  }
79
86
  removeSeriesPopover() {
80
- this.seriesPopover !== null && this.seriesPopover !== void 0 && (this.seriesPopover.open = !1, this.seriesPopover = f(this.seriesPopover));
87
+ this.seriesPopover !== null && this.seriesPopover !== void 0 && (this.seriesPopover.open = !1, this.seriesPopover = S(this.seriesPopover));
81
88
  }
82
- selectedSeriesIndexChange() {
89
+ selectedSeriesChange() {
83
90
  this.selectedSeriesIndex !== void 0 && (this.seriesPopover = C(a`<arcgis-charts-config-bar-chart-series-popover .referenceElement=${this.el} .selectedName=${this.selectedSeriesIndex != null ? this.model.getSeriesName(this.selectedSeriesIndex) : void 0} .selectedColor=${this.selectedSeriesIndex != null ? this.model.getSeriesColor(this.selectedSeriesIndex) : void 0} .placement=${this.popoverPlacement} .selectedSeriesIndex=${this.selectedSeriesIndex != null ? this.selectedSeriesIndex : void 0} .nullCategory=${this.isNullCategorySelected ? this.model.nullCategory : void 0} .open=${this.open} @arcgisChartsConfigSeriesPopoverNameChange=${this.seriesNameChange} @arcgisChartsConfigSeriesPopoverColorChange=${this.seriesColorChange} @arcgisChartsConfigPopoverClose=${this.seriesPopoverClose}></arcgis-charts-config-bar-chart-series-popover>`), this.seriesPopover && !document.body.contains(this.seriesPopover) && document.body.appendChild(this.seriesPopover));
84
91
  }
85
92
  buildSeriesListItems() {
86
- const e = this.model.seriesLength ?? 0, t = Array.from({ length: e }, (i, l) => l);
87
- return T(t, (i) => this.model.getSeriesId(i), (i) => {
88
- const l = this.model.getSeriesId(i), c = this.model.getSeriesColor(i), d = this.model.getSeriesName(i), b = this.model.chartSubType === E.BarAndLineFromFields ? this._messages.series : l;
93
+ const e = this.model.seriesLength ?? 0, t = Array.from({ length: e }, (s, o) => o);
94
+ return T(t, (s) => this.model.getSeriesId(s), (s) => {
95
+ const o = this.model.getSeriesId(s), c = this.model.getSeriesColor(s), d = this.model.getSeriesName(s), b = this.model.chartSubType === E.BarAndLineFromFields ? this._messages.series : o;
89
96
  let p = "#CCCCCC", u = "minus-square";
90
97
  if ((e > 1 || !this.activeColorMatch) && c !== void 0) {
91
98
  u = "square-f";
92
- const [y, $, I, x] = [...c];
93
- p = `rgba(${y},${$},${I},${x / 255})`;
99
+ const [y, $, I, k] = [...c];
100
+ p = `rgba(${y},${$},${I},${k / 255})`;
94
101
  }
95
- return a`<calcite-list-item .label=${d ?? l ?? ""} .description=${b} .value=${l} .selected=${this.selectedSeriesIndex === i} @click=${this.openSeriesPopOver}><calcite-icon .icon=${u} style=${h({ color: p })} slot=content-end></calcite-icon></calcite-list-item>`;
102
+ return a`<calcite-list-item .label=${d ?? o ?? ""} .description=${b} .value=${o} .selected=${this.selectedSeriesId === o} @click=${this.openSeriesPopOver}><calcite-icon .icon=${u} style=${h({ color: p })} slot=content-end></calcite-icon></calcite-list-item>`;
96
103
  });
97
104
  }
98
105
  buildSeriesList() {
99
- return P(this.seriesOrderResetCounter, a`<calcite-list label class=${r(o.list)} drag-enabled selection-mode=single selection-appearance=border @calciteListOrderChange=${this.onCalciteListOrderChange}>${this.buildSeriesListItems()}</calcite-list>`);
106
+ return P(this.seriesOrderResetCounter, a`<calcite-list label class=${r(l.list)} drag-enabled selection-mode=single selection-appearance=border @calciteListOrderChange=${this.onCalciteListOrderChange}>${this.buildSeriesListItems()}</calcite-list>`);
100
107
  }
101
108
  buildNullCategoryUI() {
102
- const e = this.model.nullCategory, t = this._messages.nullCategory, s = m(e)?.color ?? m(v.nullCategory)?.color ?? v.grayColor, [i, l, c, d] = [...s], g = `rgba(${i},${l},${c},${d / 255})`;
103
- return a`<calcite-list label class=${r(o.list)} selection-mode=none><calcite-list-item .label=${t} .value=${t} .selected=${this.selectedSeriesIndex === null} @click=${this.openSeriesPopOver}><calcite-icon icon=square-f style=${h({ color: g })} slot=content-end></calcite-icon></calcite-list-item></calcite-list>`;
109
+ const e = this.model.nullCategory, t = this._messages.nullCategory, i = g(e)?.color ?? g(v.nullCategory)?.color ?? v.grayColor, [s, o, c, d] = [...i], m = `rgba(${s},${o},${c},${d / 255})`;
110
+ return a`<calcite-list label class=${r(l.list)} selection-mode=none><calcite-list-item .label=${t} .value=${t} .selected=${this.selectedSeriesId !== void 0 && this.isNullCategorySelected} @click=${this.openSeriesPopOver}><calcite-icon icon=square-f style=${h({ color: m })} slot=content-end></calcite-icon></calcite-list-item></calcite-list>`;
104
111
  }
105
112
  buildMultipleBarTypeList() {
106
113
  const e = this.shouldDisableStacking();
107
- return e && this.model.stackedType !== n.Side && (this.model.stackedType = n.Side), a`<calcite-list label id=${w.stackedType} class=${r(o.list)} selection-mode=single-persist selection-appearance=border @click=${this.onMultipleBarSelect}><calcite-list-item .label=${this._messages.sideBySide} .value=${n.Side} .selected=${this.model.stackedType === void 0 || this.model.stackedType === n.Side}><calcite-icon scale=l icon=graph-bar-side-by-side slot=content-start></calcite-icon></calcite-list-item><calcite-list-item class=${r(e ? o.disabledStackingOption : "")} .label=${this._messages.stacked} .value=${n.Stacked} .selected=${this.model.stackedType === n.Stacked}><calcite-icon scale=l icon=graph-bar-stacked slot=content-start></calcite-icon>${e && a`<calcite-icon class=${r(o.disabledInfo)} slot=content-end icon=information scale=s flip-rtl @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip}></calcite-icon>` || ""}</calcite-list-item><calcite-list-item class=${r(e ? o.disabledStackingOption : "")} .label=${this._messages.stacked100} .value=${n.Stacked100} .selected=${this.model.stackedType === n.Stacked100}><calcite-icon scale=l icon=graph-bar100-stacked slot=content-start></calcite-icon>${e && a`<calcite-icon class=${r(o.disabledInfo)} slot=content-end icon=information scale=s flip-rtl @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip}></calcite-icon>` || ""}</calcite-list-item></calcite-list>`;
114
+ return e && this.model.stackedType !== n.Side && (this.model.stackedType = n.Side), a`<calcite-list label id=${w.stackedType} class=${r(l.list)} selection-mode=single-persist selection-appearance=border @click=${this.onMultipleBarSelect}><calcite-list-item .label=${this._messages.sideBySide} .value=${n.Side} .selected=${this.model.stackedType === void 0 || this.model.stackedType === n.Side}><calcite-icon scale=l icon=graph-bar-side-by-side slot=content-start></calcite-icon></calcite-list-item><calcite-list-item class=${r(e ? l.disabledStackingOption : "")} .label=${this._messages.stacked} .value=${n.Stacked} .selected=${this.model.stackedType === n.Stacked}><calcite-icon scale=l icon=graph-bar-stacked slot=content-start></calcite-icon>${e && a`<calcite-icon class=${r(l.disabledInfo)} slot=content-end icon=information scale=s flip-rtl @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip}></calcite-icon>` || ""}</calcite-list-item><calcite-list-item class=${r(e ? l.disabledStackingOption : "")} .label=${this._messages.stacked100} .value=${n.Stacked100} .selected=${this.model.stackedType === n.Stacked100}><calcite-icon scale=l icon=graph-bar100-stacked slot=content-start></calcite-icon>${e && a`<calcite-icon class=${r(l.disabledInfo)} slot=content-end icon=information scale=s flip-rtl @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip}></calcite-icon>` || ""}</calcite-list-item></calcite-list>`;
108
115
  }
109
116
  resetSeriesOriginal() {
110
- this.selectedSeriesIndex = void 0, this.model.resetSeriesStyling(), this.seriesOrderResetCounter += 1;
117
+ this.selectedSeriesId = void 0, this.model.resetSeriesStyling(), this.seriesOrderResetCounter += 1;
111
118
  }
112
119
  onMultipleBarSelect(e) {
113
120
  if (!this.shouldDisableStacking()) {
@@ -117,30 +124,30 @@ class z extends N {
117
124
  }
118
125
  onCalciteListOrderChange(e) {
119
126
  if (e.detail !== null && e.detail !== void 0) {
120
- const { newIndex: t, oldIndex: s } = e.detail;
121
- this.model.moveSeries(s ?? 0, t ?? s ?? 0), this.seriesOrderResetCounter += 1;
127
+ const { newIndex: t, oldIndex: i } = e.detail;
128
+ this.model.moveSeries(i ?? 0, t ?? i ?? 0), this.seriesOrderResetCounter += 1;
122
129
  }
123
130
  }
124
131
  openSeriesPopOver(e) {
125
132
  e.stopImmediatePropagation(), this.removeSeriesPopover();
126
- const t = e.target, s = t.localName === "calcite-list-item" ? t : t.parentNode, i = this.model.getSeriesIndex(s.value);
127
- this.open = this.selectedSeriesIndex !== i, this.selectedSeriesIndex = this.selectedSeriesIndex !== i ? i : void 0, this.isNullCategorySelected = s.value === this._messages.nullCategory;
133
+ const t = e.target, i = t.localName === "calcite-list-item" ? t : t.parentNode;
134
+ this.isNullCategorySelected = i.value === this._messages.nullCategory, this.open = this.selectedSeriesId !== i.value, this.selectedSeriesId = this.open ? i.value : void 0;
128
135
  }
129
136
  createTooltip(e) {
130
- const t = e.target, s = (this.model.aggregationType === S.NoAggregation ? this._messages.noAggStackingDisabled : this._messages.singleStackingDisabled) ?? "";
131
- this.tooltip = C(a`<calcite-tooltip style=${h({ opacity: 1, zIndex: "var(--calcite-floating-ui-z-index)" })} .referenceElement=${t} open placement=top>${s}</calcite-tooltip>`), document.body.appendChild(this.tooltip);
137
+ const t = e.target, i = (this.model.aggregationType === f.NoAggregation ? this._messages.noAggStackingDisabled : this._messages.singleStackingDisabled) ?? "";
138
+ this.tooltip = C(a`<calcite-tooltip style=${h({ opacity: 1, zIndex: "var(--calcite-floating-ui-z-index)" })} .referenceElement=${t} open placement=top>${i}</calcite-tooltip>`), document.body.appendChild(this.tooltip);
132
139
  }
133
140
  destroyTooltip() {
134
141
  _(this.tooltip);
135
142
  }
136
143
  shouldDisableStacking() {
137
- return (this.model.seriesLength ?? 0) <= 1 || this.model.aggregationType === S.NoAggregation;
144
+ return (this.model.seriesLength ?? 0) <= 1 || this.model.aggregationType === f.NoAggregation;
138
145
  }
139
146
  render() {
140
- return a`<div class=${`${o.sectionLabel} ${o.topSection}`}>${this._messages.displayMultiSeries}</div>${this.buildMultipleBarTypeList()}<div class=${r(o.sectionLabel)}>${this._messages.series}<calcite-button @click=${this.resetSeriesOriginal} .disabled=${!this.model.resetAvailable()} appearance=transparent icon-end=reset>${this._messages.reset}</calcite-button></div>${this.buildSeriesList()}${this.model.nullCategory !== void 0 && this.model.fetchNULLValues ? this.buildNullCategoryUI() : null}`;
147
+ return a`<div class=${`${l.sectionLabel} ${l.topSection}`}>${this._messages.displayMultiSeries}</div>${this.buildMultipleBarTypeList()}<div class=${r(l.sectionLabel)}>${this._messages.series}<calcite-button @click=${this.resetSeriesOriginal} .disabled=${!this.model.resetAvailable()} appearance=transparent icon-end=reset>${this._messages.reset}</calcite-button></div>${this.buildSeriesList()}${this.model.nullCategory !== void 0 && this.model.fetchNULLValues ? this.buildNullCategoryUI() : null}`;
141
148
  }
142
149
  }
143
- k("arcgis-charts-config-bar-chart-series", z);
150
+ x("arcgis-charts-config-bar-chart-series", z);
144
151
  export {
145
152
  z as ArcgisChartsConfigBarChartSeries
146
153
  };
@@ -1,10 +1,10 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { c as I } from "../../chunks/runtime.js";
2
+ import { c as b } from "../../chunks/runtime.js";
3
3
  import { css as P, html as n } from "lit";
4
4
  import { keyed as y } from "lit/directives/keyed.js";
5
5
  import { repeat as M } from "lit/directives/repeat.js";
6
- import { u as B } from "../../chunks/useT9n.js";
7
- import { LitElement as O, renderElement as d, safeStyleMap as h, safeClassMap as a } from "@arcgis/lumina";
6
+ import { u as O } from "../../chunks/useT9n.js";
7
+ import { LitElement as B, renderElement as d, safeStyleMap as h, safeClassMap as a } from "@arcgis/lumina";
8
8
  import { a as w } from "../../chunks/chart-ui-utils.js";
9
9
  import { x as S } from "../../chunks/index.js";
10
10
  import { r as f } from "../../chunks/popover-ui-utils.js";
@@ -15,73 +15,82 @@ const l = {
15
15
  list: "list",
16
16
  infoIcon: "info-icon"
17
17
  }, T = P`.hide{visibility:hidden}.am5-html-container{z-index:101!important}.am5-layer-1000{z-index:1000!important}.am5-layer-30{z-index:100!important}.show{display:block}.notifyPanel{flex:0 1 auto}.disable-interactions{pointer-events:none}.dim-text{color:var(--arcgis-charts-dim-text)}:host{display:flex;flex-direction:column;width:var(--arcgis-charts-config-calcite-block-default-width);margin:var(--arcgis-charts-config-calcite-block-default-margin)}.top-section{margin-top:var(--arcgis-charts-config-margin-minor)}.section-label{display:flex;margin-bottom:var(--arcgis-charts-config-margin-major);margin-left:var(--arcgis-charts-config-margin-minor);margin-right:var(--arcgis-charts-config-margin-minor);justify-content:space-between;align-items:center;font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size-0)}.list{margin-left:var(--arcgis-charts-config-margin-minor);margin-right:var(--arcgis-charts-config-margin-minor);margin-bottom:var(--arcgis-charts-config-margin-major)}.info-icon{margin:auto 1rem;pointer-events:auto}`;
18
- class N extends O {
18
+ class N extends B {
19
19
  constructor() {
20
- super(...arguments), this._messages = B(), this.resetSeriesOriginal = () => {
21
- this.configSeriesOpen = !1, this.selectedSeriesIndex = void 0, this.model.resetSeriesStyling(), this.seriesOrderResetCounter += 1;
20
+ super(...arguments), this._messages = O(), this.resetSeriesOriginal = () => {
21
+ this.configSeriesOpen = !1, this.selectedSeriesId = void 0, this.model.resetSeriesStyling(), this.seriesOrderResetCounter += 1;
22
22
  }, this.onMultipleSeriesSelect = (e) => {
23
23
  if (!this.shouldDisableMeanLinesOption()) {
24
- const i = e.target, t = i.value ?? i.parentElement.value ?? "";
25
- this.model.showMeanLines = t === m.MeanLines;
24
+ const i = e.target, s = i.value ?? i.parentElement.value ?? "";
25
+ this.model.showMeanLines = s === m.MeanLines;
26
26
  }
27
27
  }, this.seriesNameChange = (e) => {
28
28
  if (e.detail !== null || e.detail !== void 0) {
29
- const i = e.detail?.name;
30
- this.model.setSeriesName(i, this.selectedSeriesIndex ?? -1);
29
+ const i = e.detail?.name, s = this.selectedSeriesIndex;
30
+ s !== void 0 && s >= 0 && this.model.setSeriesName(i, s);
31
31
  }
32
32
  }, this.seriesColorChange = (e) => {
33
33
  if (e.detail !== null && e.detail !== void 0) {
34
34
  const { color: i } = e.detail;
35
- i !== void 0 && (this.meanLinesBoxColorIsSelected ? this.model.meanLinesBoxColor = i : (this.model.colorMatch = !1, this.model.setSeriesColor(i, this.selectedSeriesIndex ?? -1)));
35
+ if (i !== void 0)
36
+ if (this.meanLinesBoxColorIsSelected)
37
+ this.model.meanLinesBoxColor = i;
38
+ else {
39
+ const s = this.selectedSeriesIndex;
40
+ s !== void 0 && s >= 0 && (this.model.colorMatch = !1, this.model.setSeriesColor(i, s));
41
+ }
36
42
  }
37
43
  }, this.seriesLineStyleChange = (e) => {
38
44
  if (e.detail !== null && e.detail !== void 0) {
39
- const { style: i } = e.detail;
40
- i !== void 0 && this.model.setSeriesLineStyle(i, this.selectedSeriesIndex ?? -1);
45
+ const { style: i } = e.detail, s = this.selectedSeriesIndex;
46
+ i !== void 0 && s !== void 0 && s >= 0 && this.model.setSeriesLineStyle(i, s);
41
47
  }
42
48
  }, this.seriesLineWidthChange = (e) => {
43
49
  if (e.detail !== null && e.detail !== void 0) {
44
- const { width: i } = e.detail;
45
- i !== void 0 && this.model.setSeriesLineWidth(i, this.selectedSeriesIndex ?? -1);
50
+ const { width: i } = e.detail, s = this.selectedSeriesIndex;
51
+ i !== void 0 && s !== void 0 && s >= 0 && this.model.setSeriesLineWidth(i, s);
46
52
  }
47
53
  }, this.onCalciteListOrderChange = (e) => {
48
54
  const i = this.model.boxPlotSeriesIndexWhenMeanLinesShown;
49
55
  if (e.detail !== null && e.detail !== void 0) {
50
- const { newIndex: t, oldIndex: r } = e.detail;
51
- let s = r, o = t;
52
- i !== -1 && (s = r >= i ? r + 1 : r, o = t >= i ? t + 1 : t), this.model.moveSeries(s, o), this.seriesOrderResetCounter += 1;
56
+ const { newIndex: s, oldIndex: r } = e.detail;
57
+ let t = r, o = s;
58
+ i !== -1 && (t = r >= i ? r + 1 : r, o = s >= i ? s + 1 : s), this.model.moveSeries(t, o), this.seriesOrderResetCounter += 1;
53
59
  }
54
60
  }, this.seriesPopoverClose = () => {
55
- this.selectedSeriesIndex = void 0, this.meanLinesBoxColorIsSelected = !1, this.configSeriesOpen = !1, this.seriesPopover = f(this.seriesPopover);
61
+ this.selectedSeriesId = void 0, this.meanLinesBoxColorIsSelected = !1, this.configSeriesOpen = !1, this.seriesPopover = f(this.seriesPopover);
56
62
  }, this.openSeriesPopOver = (e) => {
57
63
  e.stopImmediatePropagation(), this.removeSeriesPopover();
58
- const i = e.target, t = i.localName === "calcite-list-item" ? i : i.parentNode, r = !this.configSeriesOpen, s = this.model.getSeriesIndex(t.value);
59
- if (s !== void 0 && s !== -1)
60
- this.configSeriesOpen = this.selectedSeriesIndex === s ? r : !0, this.configSeriesOpen ? this.selectedSeriesIndex = s : this.selectedSeriesIndex = void 0, this.meanLinesBoxColorIsSelected = !1;
61
- else if (t.value === "box-plot-color") {
64
+ const i = e.target, s = i.localName === "calcite-list-item" ? i : i.parentNode, r = !this.configSeriesOpen, t = this.model.getSeriesIndex(s.value);
65
+ if (t !== void 0 && t !== -1)
66
+ this.configSeriesOpen = this.selectedSeriesIndex === t ? r : !0, this.configSeriesOpen ? this.selectedSeriesId = s.value : this.selectedSeriesId = void 0, this.meanLinesBoxColorIsSelected = !1;
67
+ else if (s.value === "box-plot-color") {
62
68
  const o = !this.meanLinesBoxColorIsSelected;
63
- this.configSeriesOpen = o, this.meanLinesBoxColorIsSelected = o, this.selectedSeriesIndex = void 0;
69
+ this.configSeriesOpen = o, this.meanLinesBoxColorIsSelected = o, this.selectedSeriesId = void 0;
64
70
  }
65
71
  }, this.createTooltip = (e, i) => {
66
- const t = e.target;
67
- this.tooltip = d(n`<calcite-tooltip style=${h({ opacity: 1, zIndex: "var(--calcite-floating-ui-z-index)" })} .referenceElement=${t} open placement=top>${i ?? ""}</calcite-tooltip>`), document.body.appendChild(this.tooltip);
72
+ const s = e.target;
73
+ this.tooltip = d(n`<calcite-tooltip style=${h({ opacity: 1, zIndex: "var(--calcite-floating-ui-z-index)" })} .referenceElement=${s} open placement=top>${i ?? ""}</calcite-tooltip>`), document.body.appendChild(this.tooltip);
68
74
  }, this.destroyTooltip = () => {
69
75
  w(this.tooltip);
70
76
  }, this.onModelConfigChange = () => {
71
- this.requestUpdate();
77
+ this.selectedSeriesId !== void 0 && this.selectedSeriesIndex === -1 ? this.seriesPopoverClose() : this.seriesPopover && (this.seriesPopover.selectedSeriesIndex = this.selectedSeriesIndex), this.requestUpdate();
72
78
  }, this.meanLinesBoxColorIsSelected = !1, this.seriesOrderResetCounter = 0, this.configSeriesOpen = !1, this.activeColorMatch = !1, this.popoverPlacement = "leading";
73
79
  }
74
80
  static {
75
- this.properties = { selectedSeriesIndex: 16, meanLinesBoxColorIsSelected: 16, seriesOrderResetCounter: 16, messageOverrides: 0, model: 0, configSeriesOpen: 5, activeColorMatch: 5, popoverPlacement: 1 };
81
+ this.properties = { selectedSeriesId: 16, meanLinesBoxColorIsSelected: 16, seriesOrderResetCounter: 16, messageOverrides: 0, model: 0, configSeriesOpen: 5, activeColorMatch: 5, popoverPlacement: 1 };
76
82
  }
77
83
  static {
78
84
  this.styles = T;
79
85
  }
86
+ get selectedSeriesIndex() {
87
+ return this.selectedSeriesId === void 0 ? void 0 : this.model.getSeriesIndex(this.selectedSeriesId);
88
+ }
80
89
  load() {
81
90
  this.modelChange(this.model), this.onModelConfigChange();
82
91
  }
83
92
  willUpdate(e) {
84
- e.has("model") && this.modelChange(this.model, e.get("model")), e.has("selectedSeriesIndex") && this.selectedSeriesIndexChange(), e.has("meanLinesBoxColorIsSelected") && this.meanLinesBoxColorIsSelectedChange();
93
+ e.has("model") && this.modelChange(this.model, e.get("model")), (e.has("selectedSeriesId") || e.has("meanLinesBoxColorIsSelected")) && this.selectedSeriesChange();
85
94
  }
86
95
  disconnectedCallback() {
87
96
  super.disconnectedCallback(), this.removeSeriesPopover(), this.model.removeEventListener("arcgisChartsModelConfigChange", this.onModelConfigChange);
@@ -89,26 +98,23 @@ class N extends O {
89
98
  modelChange(e, i) {
90
99
  i?.removeEventListener("arcgisChartsModelConfigChange", this.onModelConfigChange), e.addEventListener("arcgisChartsModelConfigChange", this.onModelConfigChange);
91
100
  }
92
- selectedSeriesIndexChange() {
93
- this.selectedSeriesIndex !== void 0 && this.configSeriesOpen ? this.setupSeriesPopover() : this.removeSeriesPopover();
94
- }
95
- meanLinesBoxColorIsSelectedChange() {
96
- this.meanLinesBoxColorIsSelected && this.configSeriesOpen ? this.setupSeriesPopover() : this.removeSeriesPopover();
101
+ selectedSeriesChange() {
102
+ (this.selectedSeriesIndex !== void 0 || this.meanLinesBoxColorIsSelected) && this.configSeriesOpen ? this.setupSeriesPopover() : this.removeSeriesPopover();
97
103
  }
98
104
  removeSeriesPopover() {
99
105
  this.seriesPopover !== null && this.seriesPopover !== void 0 && (this.seriesPopover.open = !1, this.seriesPopover = f(this.seriesPopover));
100
106
  }
101
107
  buildSeriesListItems() {
102
- const e = this.model.seriesLength, i = this.model.boxPlotSeriesIndexWhenMeanLinesShown, t = Array.from({ length: e }, (s, o) => o);
103
- return M(t, (s) => this.model.getSeriesId(s), (s) => {
104
- const o = this.model.getSeriesId(s), c = this.model.getSeriesColor(s), v = this.model.getSeriesName(s), g = this.model.chartSubType, u = g === S.BoxPlotC1MonoField || g === S.BoxPlotC2MultiFields ? this._messages.series : o;
108
+ const e = this.model.seriesLength, i = this.model.boxPlotSeriesIndexWhenMeanLinesShown, s = Array.from({ length: e }, (t, o) => o);
109
+ return M(s, (t) => this.model.getSeriesId(t), (t) => {
110
+ const o = this.model.getSeriesId(t), c = this.model.getSeriesColor(t), v = this.model.getSeriesName(t), g = this.model.chartSubType, u = g === S.BoxPlotC1MonoField || g === S.BoxPlotC2MultiFields ? this._messages.series : o;
105
111
  let p = "#CCCCCC", C = "minus-square";
106
112
  if ((e > 1 || !this.activeColorMatch) && c !== void 0) {
107
113
  C = this.model.showMeanLines === !0 ? "line-solid" : "square-f";
108
- const [x, $, L, b] = [...c];
109
- p = `rgba(${x},${$},${L},${b / 255})`;
114
+ const [x, $, I, L] = [...c];
115
+ p = `rgba(${x},${$},${I},${L / 255})`;
110
116
  }
111
- return i !== s ? n`<calcite-list-item .label=${v ?? o ?? ""} .description=${u} .value=${o} .selected=${this.selectedSeriesIndex === s} @click=${this.openSeriesPopOver}><calcite-icon slot=content-end .icon=${C} style=${h({ color: p })}></calcite-icon></calcite-list-item>` : null;
117
+ return i !== t ? n`<calcite-list-item .label=${v ?? o ?? ""} .description=${u} .value=${o} .selected=${this.selectedSeriesId === o} @click=${this.openSeriesPopOver}><calcite-icon slot=content-end .icon=${C} style=${h({ color: p })}></calcite-icon></calcite-list-item>` : null;
112
118
  });
113
119
  }
114
120
  buildSeriesList() {
@@ -122,11 +128,11 @@ class N extends O {
122
128
  }
123
129
  renderMeanLinesBoxColorItem() {
124
130
  let e = "#CCCCCC", i = "minus-square";
125
- const t = this.model.meanLinesBoxColor;
126
- if (t !== void 0) {
131
+ const s = this.model.meanLinesBoxColor;
132
+ if (s !== void 0) {
127
133
  i = "square-f";
128
- const [r, s, o, c] = [...t];
129
- e = `rgba(${r},${s},${o},${c / 255})`;
134
+ const [r, t, o, c] = [...s];
135
+ e = `rgba(${r},${t},${o},${c / 255})`;
130
136
  }
131
137
  return n`<calcite-list label class=${a(l.list)}><calcite-list-item value=box-plot-color .label=${this._messages.boxPlotColor} .selected=${this.meanLinesBoxColorIsSelected} @click=${this.openSeriesPopOver}><calcite-icon slot=content-end .icon=${i} style=${h({ color: e })}></calcite-icon></calcite-list-item></calcite-list>`;
132
138
  }
@@ -142,7 +148,7 @@ class N extends O {
142
148
  return n`${this.renderMultipleSeriesOption()}<div class=${a(l.sectionLabel)}>${this._messages.series}<calcite-button @click=${this.resetSeriesOriginal} .disabled=${!this.model.resetAvailable()} appearance=transparent icon-end=reset>${this._messages.reset}</calcite-button></div>${this.buildSeriesList()}`;
143
149
  }
144
150
  }
145
- I("arcgis-charts-config-box-plot-series", N);
151
+ b("arcgis-charts-config-box-plot-series", N);
146
152
  export {
147
153
  N as ArcgisChartsConfigBoxPlotSeries
148
154
  };
@@ -1,54 +1,59 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
2
  import { c as f } from "../../chunks/runtime.js";
3
3
  import { keyed as u } from "lit/directives/keyed.js";
4
- import { LitElement as I, renderElement as $, safeStyleMap as x } from "@arcgis/lumina";
4
+ import { LitElement as I, renderElement as P, safeStyleMap as $ } from "@arcgis/lumina";
5
5
  import { css as L, html as o } from "lit";
6
- import { repeat as P } from "lit/directives/repeat.js";
6
+ import { repeat as x } from "lit/directives/repeat.js";
7
7
  import { u as y } from "../../chunks/useT9n.js";
8
8
  import { j as b } from "../../chunks/chart-ui-utils.js";
9
9
  import { x as M } from "../../chunks/index.js";
10
- import { r as d } from "../../chunks/popover-ui-utils.js";
10
+ import { r as a } from "../../chunks/popover-ui-utils.js";
11
11
  const O = L`:host{display:flex;flex-direction:column;width:var(--arcgis-charts-config-calcite-block-default-width);margin:var(--arcgis-charts-config-calcite-block-default-margin)}`;
12
12
  class k extends I {
13
13
  constructor() {
14
14
  super(...arguments), this._messages = y(), this.seriesPopover = null, this.open = !1, this.seriesNameChange = (e) => {
15
15
  if (e.detail !== null || e.detail !== void 0) {
16
- const s = e.detail?.name;
17
- this.model.setSeriesName(s, this.selectedSeriesIndex ?? -1);
16
+ const s = e.detail?.name, i = this.selectedSeriesIndex;
17
+ i !== void 0 && i >= 0 && this.model.setSeriesName(s, i);
18
18
  }
19
19
  }, this.seriesColorChange = (e) => {
20
20
  if (e.detail !== null && e.detail !== void 0) {
21
21
  const { color: s } = e.detail;
22
- this.model.colorMatch = !1, s !== void 0 && (this.model.setSeriesColor(s, this.selectedSeriesIndex ?? -1), this.model.setSeriesMarkerColor(s, this.selectedSeriesIndex ?? -1));
22
+ this.model.colorMatch = !1;
23
+ const i = this.selectedSeriesIndex;
24
+ s !== void 0 && i !== void 0 && i >= 0 && (this.model.setSeriesColor(s, i), this.model.setSeriesMarkerColor(s, i));
23
25
  }
24
26
  }, this.seriesLineStyleChange = (e) => {
25
27
  if (e.detail !== null && e.detail !== void 0) {
26
- const { lineStyle: s } = e.detail;
27
- s !== void 0 && this.model.setSeriesLineStyle(s, this.selectedSeriesIndex ?? -1);
28
+ const { lineStyle: s } = e.detail, i = this.selectedSeriesIndex;
29
+ s !== void 0 && i !== void 0 && i >= 0 && this.model.setSeriesLineStyle(s, i);
28
30
  }
29
31
  }, this.seriesLineWidthChange = (e) => {
30
32
  if (e.detail !== null && e.detail !== void 0) {
31
- const { lineWidth: s } = e.detail;
32
- s !== void 0 && (this.model.setSeriesLineWidth(s, this.selectedSeriesIndex ?? -1), this.model.setSeriesMarkerSize(s * 2, this.selectedSeriesIndex ?? -1));
33
+ const { lineWidth: s } = e.detail, i = this.selectedSeriesIndex;
34
+ s !== void 0 && i !== void 0 && i >= 0 && (this.model.setSeriesLineWidth(s, i), this.model.setSeriesMarkerSize(s * 2, i));
33
35
  }
34
36
  }, this.seriesPopoverClose = (e) => {
35
37
  const { selectedSeriesIndex: s } = e.detail;
36
- this.selectedSeriesIndex === s && (this.seriesPopover = d(this.seriesPopover), this.selectedSeriesIndex = void 0);
38
+ this.selectedSeriesIndex === s && (this.seriesPopover = a(this.seriesPopover), this.selectedSeriesId = void 0);
37
39
  }, this.onModelConfigChange = () => {
38
- this.requestUpdate();
40
+ this.selectedSeriesId !== void 0 && this.selectedSeriesIndex === -1 ? (this.removeSeriesPopover(), this.selectedSeriesId = void 0) : this.seriesPopover && (this.seriesPopover.selectedSeriesIndex = this.selectedSeriesIndex), this.requestUpdate();
39
41
  }, this.seriesOrderResetCounter = 0, this.activeColorMatch = !1, this.popoverPlacement = "leading";
40
42
  }
41
43
  static {
42
- this.properties = { selectedSeriesIndex: 16, seriesOrderResetCounter: 16, messageOverrides: 0, model: 0, activeColorMatch: 5, popoverPlacement: 1 };
44
+ this.properties = { selectedSeriesId: 16, seriesOrderResetCounter: 16, messageOverrides: 0, model: 0, activeColorMatch: 5, popoverPlacement: 1 };
43
45
  }
44
46
  static {
45
47
  this.styles = O;
46
48
  }
49
+ get selectedSeriesIndex() {
50
+ return this.selectedSeriesId === void 0 ? void 0 : this.model.getSeriesIndex(this.selectedSeriesId);
51
+ }
47
52
  load() {
48
53
  this.modelChange(this.model), this.onModelConfigChange();
49
54
  }
50
55
  willUpdate(e) {
51
- e.has("model") && this.modelChange(this.model, e.get("model")), e.has("selectedSeriesIndex") && this.selectedSeriesIndexChange();
56
+ e.has("model") && this.modelChange(this.model, e.get("model")), e.has("selectedSeriesId") && this.selectedSeriesChange();
52
57
  }
53
58
  disconnectedCallback() {
54
59
  super.disconnectedCallback(), this.removeSeriesPopover(), this.model.removeEventListener("arcgisChartsModelConfigChange", this.onModelConfigChange);
@@ -56,41 +61,41 @@ class k extends I {
56
61
  modelChange(e, s) {
57
62
  s?.removeEventListener("arcgisChartsModelConfigChange", this.onModelConfigChange), e?.addEventListener("arcgisChartsModelConfigChange", this.onModelConfigChange);
58
63
  }
59
- selectedSeriesIndexChange() {
60
- this.selectedSeriesIndex !== void 0 && (this.seriesPopover = $(o`<arcgis-charts-config-line-chart-series-popover .referenceElement=${this.el} .selectedName=${this.model.getSeriesName(this.selectedSeriesIndex)} .selectedColor=${this.model.getSeriesColor(this.selectedSeriesIndex)} .selectedLineStyle=${this.model.getSeriesLineStyle(this.selectedSeriesIndex)} .selectedLineWidth=${this.model.getSeriesLineWidth(this.selectedSeriesIndex)} .placement=${this.popoverPlacement} .open=${this.open} .selectedSeriesIndex=${this.selectedSeriesIndex} @arcgisChartsConfigSeriesPopoverNameChange=${this.seriesNameChange} @arcgisChartsConfigSeriesPopoverColorChange=${this.seriesColorChange} @arcgisChartsConfigSeriesPopoverLineStyleChange=${this.seriesLineStyleChange} @arcgisChartsConfigSeriesPopoverLineWidthChange=${this.seriesLineWidthChange} @arcgisChartsConfigPopoverClose=${this.seriesPopoverClose}></arcgis-charts-config-line-chart-series-popover>`), this.seriesPopover && !document.body.contains(this.seriesPopover) && document.body.appendChild(this.seriesPopover));
64
+ selectedSeriesChange() {
65
+ this.selectedSeriesIndex !== void 0 && (this.seriesPopover = P(o`<arcgis-charts-config-line-chart-series-popover .referenceElement=${this.el} .selectedName=${this.model.getSeriesName(this.selectedSeriesIndex)} .selectedColor=${this.model.getSeriesColor(this.selectedSeriesIndex)} .selectedLineStyle=${this.model.getSeriesLineStyle(this.selectedSeriesIndex)} .selectedLineWidth=${this.model.getSeriesLineWidth(this.selectedSeriesIndex)} .placement=${this.popoverPlacement} .open=${this.open} .selectedSeriesIndex=${this.selectedSeriesIndex} @arcgisChartsConfigSeriesPopoverNameChange=${this.seriesNameChange} @arcgisChartsConfigSeriesPopoverColorChange=${this.seriesColorChange} @arcgisChartsConfigSeriesPopoverLineStyleChange=${this.seriesLineStyleChange} @arcgisChartsConfigSeriesPopoverLineWidthChange=${this.seriesLineWidthChange} @arcgisChartsConfigPopoverClose=${this.seriesPopoverClose}></arcgis-charts-config-line-chart-series-popover>`), this.seriesPopover && !document.body.contains(this.seriesPopover) && document.body.appendChild(this.seriesPopover));
61
66
  }
62
67
  removeSeriesPopover() {
63
- this.seriesPopover !== void 0 && this.seriesPopover !== null && (this.seriesPopover.open = !1, this.seriesPopover = d(this.seriesPopover));
68
+ this.seriesPopover !== void 0 && this.seriesPopover !== null && (this.seriesPopover.open = !1, this.seriesPopover = a(this.seriesPopover));
64
69
  }
65
70
  buildSeriesListItems() {
66
- const e = this.model.seriesLength, s = Array.from({ length: e }, (i, r) => r);
67
- return P(s, (i) => this.model.getSeriesId(i), (i) => {
68
- const r = this.model.getSeriesId(i), l = this.model.getSeriesColor(i), h = this.model.getSeriesName(i), c = this.model.chartSubType === M.BarAndLineFromFields ? this._messages.series : r, m = this.model.getSeriesLineStyle(i), g = b(m);
69
- let n = "#CCCCCC", a = "minus-circle";
71
+ const e = this.model.seriesLength, s = Array.from({ length: e }, (t, r) => r);
72
+ return x(s, (t) => this.model.getSeriesId(t), (t) => {
73
+ const r = this.model.getSeriesId(t), l = this.model.getSeriesColor(t), h = this.model.getSeriesName(t), c = this.model.chartSubType === M.BarAndLineFromFields ? this._messages.series : r, m = this.model.getSeriesLineStyle(t), g = b(m);
74
+ let n = "#CCCCCC", d = "minus-circle";
70
75
  if ((e > 1 || !this.activeColorMatch) && l !== void 0) {
71
- a = `line-${g}`;
72
- const [C, p, S, v] = [...l];
73
- n = `rgba(${C},${p},${S},${v / 255})`;
76
+ d = `line-${g}`;
77
+ const [p, C, S, v] = [...l];
78
+ n = `rgba(${p},${C},${S},${v / 255})`;
74
79
  }
75
- return o`<calcite-list-item .label=${h ?? r ?? ""} .description=${c} .value=${r} .selected=${this.selectedSeriesIndex === i} @click=${this.openSeriesPopOver}><calcite-icon slot=content-end .icon=${a} style=${x({ color: n })}></calcite-icon></calcite-list-item>`;
80
+ return o`<calcite-list-item .label=${h ?? r ?? ""} .description=${c} .value=${r} .selected=${this.selectedSeriesId === r} @click=${this.openSeriesPopOver}><calcite-icon slot=content-end .icon=${d} style=${$({ color: n })}></calcite-icon></calcite-list-item>`;
76
81
  });
77
82
  }
78
83
  buildSeriesList() {
79
84
  return u(this.seriesOrderResetCounter, o`<calcite-list label drag-enabled selection-mode=single selection-appearance=border @calciteListOrderChange=${this.onCalciteListOrderChange}>${this.buildSeriesListItems()}</calcite-list>`);
80
85
  }
81
86
  resetSeriesOriginal() {
82
- this.selectedSeriesIndex = void 0, this.model.resetSeriesStyling(), this.seriesOrderResetCounter += 1;
87
+ this.selectedSeriesId = void 0, this.model.resetSeriesStyling(), this.seriesOrderResetCounter += 1;
83
88
  }
84
89
  onCalciteListOrderChange(e) {
85
90
  if (e.detail !== null && e.detail !== void 0) {
86
- const { newIndex: s, oldIndex: t } = e.detail;
87
- this.model.moveSeries(t ?? 0, s ?? t ?? 0), this.seriesOrderResetCounter += 1;
91
+ const { newIndex: s, oldIndex: i } = e.detail;
92
+ this.model.moveSeries(i ?? 0, s ?? i ?? 0), this.seriesOrderResetCounter += 1;
88
93
  }
89
94
  }
90
95
  openSeriesPopOver(e) {
91
96
  e.stopImmediatePropagation(), this.removeSeriesPopover();
92
- const s = e.target, t = s.localName === "calcite-list-item" ? s : s.parentNode, i = this.model.getSeriesIndex(t.value);
93
- this.open = this.selectedSeriesIndex !== i, this.selectedSeriesIndex = this.selectedSeriesIndex !== i ? i : void 0;
97
+ const s = e.target, i = s.localName === "calcite-list-item" ? s : s.parentNode;
98
+ this.open = this.selectedSeriesId !== i.value, this.selectedSeriesId = this.open ? i.value : void 0;
94
99
  }
95
100
  render() {
96
101
  return o`<calcite-panel .heading=${this._messages.series}><calcite-button slot=header-actions-end @click=${this.resetSeriesOriginal} .disabled=${!this.model.resetAvailable()} appearance=transparent scale=s icon-end=reset>${this._messages.reset}</calcite-button>${this.buildSeriesList()}</calcite-panel>`;
@@ -15,8 +15,8 @@ const h = {
15
15
  viewChartComponent: "view-chart-component",
16
16
  header: "header",
17
17
  dropdownPopup: "dropdown-popup"
18
- }, L = f`.view-chart-component{width:var(--arcgis-charts-config-panel-width);height:var(--arcgis-charts-config-panel-height)}.add-chart-container{display:flex;justify-content:center;padding:2rem 0;background-color:var(--calcite-color-background)}.header{margin-left:1rem}.dropdown-popup{position:relative}`;
19
- class P extends u {
18
+ }, P = f`.view-chart-component{width:var(--arcgis-charts-config-panel-width);height:var(--arcgis-charts-config-panel-height)}.add-chart-container{display:flex;justify-content:center;padding:2rem 0;background-color:var(--calcite-color-background)}.header{margin-left:1rem}.dropdown-popup{position:relative}`;
19
+ class L extends u {
20
20
  constructor() {
21
21
  super(...arguments), this._messages = g(), this.chartRenamePopover = null, this.popoverClose = () => {
22
22
  const e = this.modelList?.find((t) => t.chartId === this.selectedChartId);
@@ -43,7 +43,7 @@ class P extends u {
43
43
  this.properties = { isChartRenamePopoverOpen: 16, chartTitle: 16, selectedActionChartId: 16, chartsOrderReorderCounter: 16, messageOverrides: 0, selectedChartId: 1, layer: 0, modelList: 0, noGroup: 5, disableEditing: 5 };
44
44
  }
45
45
  static {
46
- this.styles = L;
46
+ this.styles = P;
47
47
  }
48
48
  willUpdate(e) {
49
49
  e.has("modelList") && this.modelListChange(this.modelList, e.get("modelList"));
@@ -98,7 +98,7 @@ class P extends u {
98
98
  buildChartList() {
99
99
  const e = this.modelList ? $(this.modelList, (t) => t.chartId, (t, i) => {
100
100
  const a = t.chartId, o = t.titleText, l = w(t.config), d = this.buildChartTooltip(t);
101
- return s`<calcite-list-item .label=${o ?? a ?? this._messages.chartTitle} title=${d ?? m} .selected=${this.selectedChartId === (a?.toString() ?? i.toString())} .value=${a ?? i.toString()} @click=${this.onChartSelect}><calcite-icon slot=content-start .icon=${l} title=${d ?? m}></calcite-icon>${this.disableEditing ? null : s`<calcite-dropdown slot=actions-end overlay-positioning=fixed placement=bottom-end .open=${this.selectedActionChartId === a} @calciteDropdownClose=${() => this.chartActionClosed(a ?? "")} @calciteDropdownOpen=${() => this.chartActionOpened(a ?? "")} @click=${this.onChartActionClick} class=${c(h.dropdownPopup)}><calcite-action scale=l .text=${this._messages.chartActions ?? ""} slot=trigger .active=${a === this.selectedActionChartId}><calcite-icon icon=ellipsis></calcite-icon></calcite-action><calcite-dropdown-group selection-mode=none><calcite-dropdown-item accesskey=edit @calciteDropdownItemSelect=${this.chartEditSelect}>${this._messages.edit}</calcite-dropdown-item><calcite-dropdown-item accesskey=rename @calciteDropdownItemSelect=${this.chartRenameSelect}>${this._messages.rename}</calcite-dropdown-item><calcite-dropdown-item accesskey=delete @calciteDropdownItemSelect=${this.chartDeleteSelect}>${this._messages.delete}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`}</calcite-list-item>`;
101
+ return s`<calcite-list-item .label=${o ?? a ?? this._messages.chartTitle} title=${d ?? m} .selected=${this.selectedChartId === (a?.toString() ?? i.toString())} .value=${a ?? i.toString()} @click=${this.onChartSelect}><calcite-icon slot=content-start .icon=${l} title=${d ?? m}></calcite-icon>${this.disableEditing ? null : s`<calcite-dropdown slot=actions-end overlay-positioning=fixed placement=bottom-end .open=${this.selectedActionChartId === a} @calciteDropdownClose=${() => this.chartActionClosed(a ?? "")} @calciteDropdownOpen=${() => this.chartActionOpened(a ?? "")} @click=${this.onChartActionClick} class=${c(h.dropdownPopup)}><calcite-action scale=l .text=${this._messages.chartActions ?? ""} slot=trigger .active=${a === this.selectedActionChartId} .disabled=${this.isChartRenamePopoverOpen}><calcite-icon icon=ellipsis></calcite-icon></calcite-action><calcite-dropdown-group selection-mode=none><calcite-dropdown-item accesskey=edit @calciteDropdownItemSelect=${this.chartEditSelect}>${this._messages.edit}</calcite-dropdown-item><calcite-dropdown-item accesskey=rename @calciteDropdownItemSelect=${this.chartRenameSelect}>${this._messages.rename}</calcite-dropdown-item><calcite-dropdown-item accesskey=delete @calciteDropdownItemSelect=${this.chartDeleteSelect}>${this._messages.delete}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`}</calcite-list-item>`;
102
102
  }) : null;
103
103
  return this.layer ? s`<div>${this.noGroup ? null : s`<p class=${c(h.header)}>${this.layer.title ?? this.layer.id.toString()}</p>`}${C(this.chartsOrderReorderCounter, s`<calcite-list label .dragEnabled=${!this.disableEditing} selection-mode=single selection-appearance=border @calciteListOrderChange=${this.onCalciteListOrderChange}>${e}${this.disableEditing ? null : s`<div class=${c(h.addChartContainer)}><calcite-fab slot=fab appearance=outline-fill kind=neutral text-enabled .text=${this._messages.addChart} .label=${this._messages.addChart} @click=${this.onAddChartClick} scale=s></calcite-fab></div>`}</calcite-list>`)}</div>` : null;
104
104
  }
@@ -139,7 +139,7 @@ class P extends u {
139
139
  return s`<div class=${c(h.viewChartComponent)}>${this.buildChartList()}</div>`;
140
140
  }
141
141
  }
142
- p("arcgis-charts-config-view-charts", P);
142
+ p("arcgis-charts-config-view-charts", L);
143
143
  export {
144
- P as ArcgisChartsConfigViewCharts
144
+ L as ArcgisChartsConfigViewCharts
145
145
  };