@arcgis/common-components 6.0.0-next.3 → 6.0.0-next.30

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 (115) hide show
  1. package/dist/cdn/2S4SSY4K.js +2 -0
  2. package/dist/cdn/{YEFEVEP6.js → 3UAY23XT.js} +1 -1
  3. package/dist/cdn/{OTWADB4M.js → 3ZTHRAIZ.js} +1 -1
  4. package/dist/cdn/{TXQKK4DJ.js → 4D35RDOE.js} +1 -1
  5. package/dist/cdn/4IMLX5B4.js +4 -0
  6. package/dist/cdn/5GVJKVEV.js +2 -0
  7. package/dist/cdn/6LZNNXUL.js +2 -0
  8. package/dist/cdn/74TVQE6W.js +2 -0
  9. package/dist/cdn/7WN227WZ.js +8207 -0
  10. package/dist/cdn/ANK7TFWV.js +2 -0
  11. package/dist/cdn/{X6DNIKWY.js → BAALW3SQ.js} +1 -1
  12. package/dist/cdn/{LNXO5YIS.js → BDIGRQ2U.js} +1 -1
  13. package/dist/cdn/BMR5AH6W.js +2 -0
  14. package/dist/cdn/DAAON2UO.js +3 -0
  15. package/dist/cdn/{IECXEZNI.js → EOGA62GK.js} +1 -1
  16. package/dist/cdn/{OMROUY3L.js → FESNPMRM.js} +1 -1
  17. package/dist/cdn/FGG3L42U.js +2 -0
  18. package/dist/cdn/{OIGA7XBZ.js → FVFYAK24.js} +1 -1
  19. package/dist/cdn/GZVXOCN5.js +2 -0
  20. package/dist/cdn/{D4UHHQ35.js → IOAVVVNO.js} +1 -1
  21. package/dist/cdn/{B33S3YBM.js → IZD4AM2W.js} +1 -1
  22. package/dist/cdn/{MFGUTQRR.js → J4AV4EAC.js} +1 -1
  23. package/dist/cdn/JYWWX277.js +2 -0
  24. package/dist/cdn/KEQPWVA6.js +2 -0
  25. package/dist/cdn/{TO3YFXVJ.js → LLLQXE2U.js} +1 -1
  26. package/dist/cdn/{KDCSDIUQ.js → M7F7EBFY.js} +1 -1
  27. package/dist/cdn/NZDJ3HVF.js +2 -0
  28. package/dist/cdn/OUPGMHLD.js +2 -0
  29. package/dist/cdn/{JTQN5KMG.js → PIXY2HTI.js} +1 -1
  30. package/dist/cdn/{BZFAYVKR.js → PJGWH4LW.js} +1 -1
  31. package/dist/cdn/SRO2CZ77.js +2 -0
  32. package/dist/cdn/T57JKNGO.js +2 -0
  33. package/dist/cdn/{EB5MDEWF.js → TE77L77R.js} +1 -1
  34. package/dist/cdn/TWPYXZ2O.js +2 -0
  35. package/dist/cdn/{735FTIBP.js → U6OGOB7D.js} +1 -1
  36. package/dist/cdn/V5FMQXMU.js +2 -0
  37. package/dist/cdn/{HYFFUYAU.js → VNC7X43V.js} +1 -1
  38. package/dist/cdn/W2W34T5K.js +2 -0
  39. package/dist/cdn/W7CWMG2O.js +2 -0
  40. package/dist/cdn/XMMFL5H3.js +2 -0
  41. package/dist/cdn/XQ65BGER.js +2 -0
  42. package/dist/cdn/ZJMMAZFG.js +2 -0
  43. package/dist/cdn/ZLVMV6TP.js +2 -0
  44. package/dist/cdn/{34AP2EEB.js → ZMYTELNC.js} +1 -1
  45. package/dist/cdn/assets/layer-replace/t9n/messages.en.json +1 -0
  46. package/dist/cdn/index.js +1 -1
  47. package/dist/cdn/main.css +1 -1
  48. package/dist/chunks/sharedCacheDirective.js +74 -0
  49. package/dist/chunks/toolbar.js +3 -3
  50. package/dist/components/arcgis-ckeditor5/customElement.js +144 -147
  51. package/dist/components/arcgis-color-input/customElement.js +29 -29
  52. package/dist/components/arcgis-color-input/index.js +2 -1
  53. package/dist/components/arcgis-field-pick-list/customElement.js +8 -8
  54. package/dist/components/arcgis-field-pick-list/index.js +1 -1
  55. package/dist/components/arcgis-html-content/customElement.d.ts +42 -0
  56. package/dist/components/arcgis-html-content/customElement.js +71 -0
  57. package/dist/components/arcgis-html-content/index.d.ts +1 -0
  58. package/dist/components/arcgis-html-content/index.js +1 -0
  59. package/dist/components/arcgis-label-input/customElement.js +1 -1
  60. package/dist/components/arcgis-layer-replace/customElement.d.ts +437 -0
  61. package/dist/components/arcgis-layer-replace/customElement.js +376 -0
  62. package/dist/components/arcgis-layer-replace/index.d.ts +1 -0
  63. package/dist/components/arcgis-layer-replace/index.js +7 -0
  64. package/dist/components/arcgis-slider/customElement.js +543 -455
  65. package/dist/components/arcgis-slider-field/customElement.d.ts +43 -41
  66. package/dist/components/arcgis-slider-field/customElement.js +45 -39
  67. package/dist/components/arcgis-slider-histogram-range/customElement.d.ts +21 -19
  68. package/dist/components/arcgis-slider-histogram-range/customElement.js +28 -22
  69. package/dist/components/arcgis-ticks/customElement.js +8 -8
  70. package/dist/components/arcgis-toolbar/customElement.d.ts +6 -3
  71. package/dist/components/arcgis-toolbar/customElement.js +30 -29
  72. package/dist/components/arcgis-toolbar/types.d.ts +1 -0
  73. package/dist/components/arcgis-toolbar-group/customElement.js +7 -7
  74. package/dist/components/arcgis-toolbar-item/customElement.js +1 -1
  75. package/dist/components/arcgis-toolbar-stack/customElement.js +51 -116
  76. package/dist/components/arcgis-unique-values-list/customElement.js +11 -11
  77. package/dist/components/arcgis-unique-values-list/index.js +1 -1
  78. package/dist/components/arcgis-value-picker/customElement.js +14 -14
  79. package/dist/components/arcgis-value-picker-combobox/customElement.js +4 -4
  80. package/dist/components/arcgis-value-picker-label/customElement.js +5 -5
  81. package/dist/components/arcgis-value-picker-slider/customElement.js +17 -17
  82. package/dist/docs/api.json +1 -1
  83. package/dist/docs/docs.json +1 -1
  84. package/dist/docs/vscode.css-custom-data.json +1 -1
  85. package/dist/docs/vscode.html-custom-data.json +1 -1
  86. package/dist/docs/web-types.json +1 -1
  87. package/dist/index.d.ts +15 -0
  88. package/dist/index.js +8 -5
  89. package/dist/loader.js +6 -4
  90. package/dist/types/lumina.d.ts +13 -2
  91. package/dist/types/preact.d.ts +15 -2
  92. package/dist/types/react.d.ts +17 -2
  93. package/dist/types/stencil.d.ts +13 -2
  94. package/dist/utils/sharedCacheDirective.d.ts +68 -0
  95. package/package.json +6 -6
  96. package/dist/cdn/3AFEXHZ5.js +0 -2
  97. package/dist/cdn/5EA7SGHX.js +0 -2
  98. package/dist/cdn/5XRYXPOX.js +0 -2
  99. package/dist/cdn/ATLXGXTH.js +0 -2
  100. package/dist/cdn/BCN6LPOG.js +0 -4
  101. package/dist/cdn/CKGWDI7B.js +0 -2
  102. package/dist/cdn/DR2THZQU.js +0 -8208
  103. package/dist/cdn/EM4OQXFS.js +0 -2
  104. package/dist/cdn/GDRW3MIZ.js +0 -2
  105. package/dist/cdn/HJ3EJZFF.js +0 -2
  106. package/dist/cdn/LLATF73T.js +0 -2
  107. package/dist/cdn/M2J3GPM4.js +0 -2
  108. package/dist/cdn/M3SFEFPX.js +0 -2
  109. package/dist/cdn/QCUF7B3I.js +0 -2
  110. package/dist/cdn/S4XOD4YS.js +0 -2
  111. package/dist/cdn/UIBTY5FF.js +0 -2
  112. package/dist/cdn/XUPA27AW.js +0 -2
  113. package/dist/cdn/XX2ZCFWI.js +0 -2
  114. package/dist/cdn/ZCVP2N2O.js +0 -2
  115. package/dist/cdn/ZGYD3GAS.js +0 -2
@@ -1,23 +1,23 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import { c as C } from "../../chunks/runtime.js";
2
+ import { c as g } from "../../chunks/runtime.js";
3
3
  import { keyed as n } from "lit/directives/keyed.js";
4
- import { LitElement as u, createEvent as i } from "@arcgis/lumina";
5
- import { css as m, render as g, html as s, svg as f } from "lit";
6
- import { createRef as w, ref as a } from "lit/directives/ref.js";
7
- import { unsafeGetElementDirection as v } from "@arcgis/toolkit/dom";
8
- import { debounce as E } from "@arcgis/toolkit/function";
9
- import { u as k } from "../../chunks/useT9n.js";
10
- function $(l, e, o) {
11
- window.localStorage.setItem(l, JSON.stringify(e));
4
+ import { LitElement as m, createEvent as r, nothing as d, safeStyleMap as w } from "@arcgis/lumina";
5
+ import { css as f, render as v, html as s, svg as u } from "lit";
6
+ import { createRef as E, ref as a } from "lit/directives/ref.js";
7
+ import { unsafeGetElementDirection as k } from "@arcgis/toolkit/dom";
8
+ import { debounce as $ } from "@arcgis/toolkit/function";
9
+ import { u as y } from "../../chunks/useT9n.js";
10
+ function b(c, e, o) {
11
+ window.localStorage.setItem(c, JSON.stringify(e));
12
12
  }
13
- function y(l, e) {
14
- const o = window.localStorage.getItem(l);
13
+ function S(c, e) {
14
+ const o = window.localStorage.getItem(c);
15
15
  return o && e ? JSON.parse(o) : o;
16
16
  }
17
- const S = m`:host,arcgis-picker-input{display:block}.color-picker-container{display:flex;flex-direction:column}.color-picker{--calcite-color-border-1: transparent;overflow-x:hidden}.preview-swatch{width:100%;height:24px}.recent-colors-container{align-items:center;border:var(--calcite-border-width-sm) solid var(--calcite-color-border-input);display:flex;gap:var(--calcite-space-sm);height:32px;padding:0 var(--calcite-space-xs);transition:outline-offset .1s ease-in-out,outline-color .1s ease-in-out}.preview-recent-swatch{cursor:pointer}.recent-colors-container:focus,.preview-recent-swatch:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-brand);outline-offset:var(--calcite-border-width-md)}.empty-swatch{cursor:default}.end-action{display:flex}`;
18
- class I extends u {
17
+ const I = f`:host,arcgis-picker-input{display:block}.color-picker-container{display:flex;flex-direction:column}.color-picker{--calcite-color-border-1: transparent;overflow-x:hidden}.preview-swatch{width:100%;height:24px;container-type:inline-size}.preview-swatch-no-color{overflow:hidden;block-size:inherit;inline-size:inherit;rect{transition-property:all;transition-duration:var(--calcite-animation-timing);transition-timing-function:cubic-bezier(.4,0,.2,1)}rect{fill:var(--calcite-theme-color-surface-2, var(--calcite-color-surface-2))}line{stroke:var(--calcite-color-status-danger)}}.recent-colors-container{align-items:center;border:var(--calcite-border-width-sm) solid var(--calcite-color-border-input);display:flex;gap:var(--calcite-space-sm);height:32px;padding:0 var(--calcite-space-xs);transition:outline-offset .1s ease-in-out,outline-color .1s ease-in-out}.preview-recent-swatch{cursor:pointer}.recent-colors-container:focus,.preview-recent-swatch:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-brand);outline-offset:var(--calcite-border-width-md)}.empty-swatch{cursor:default}.end-action{display:flex}.swatch-group{line-height:16px}`;
18
+ class R extends m {
19
19
  constructor() {
20
- super(), this._messages = k(), this.actionEl = w(), this.open = !1, this.setRecentColorElement = (e) => (o) => {
20
+ super(), this._messages = y(), this.actionEl = E(), this.open = !1, this.setRecentColorElement = (e) => (o) => {
21
21
  switch (e) {
22
22
  case 1:
23
23
  this.recentColor1El = o;
@@ -28,13 +28,13 @@ class I extends u {
28
28
  default:
29
29
  this.recentColor3El = o;
30
30
  }
31
- }, this.recentColors = [], this.clearable = !1, this.compact = !1, this.disabled = !1, this.placement = "auto", this.storageId = "arcgis-color-input-storage-colors", this.hideRecentColors = !1, this.showTransparency = !1, this.arcgisChange = i(), this.arcgisColorInputChange = i(), this.arcgisColorInputPopoverClose = i(), this.arcgisColorInputPopoverOpen = i(), this.arcgisColorInputSwatchUpdate = i(), this.arcgisInternalStoredColor = i(), this.arcgisPickerClose = i(), this.arcgisPickerOpen = i(), this.arcgisSwatchUpdate = i(), this.listenOn(document, "arcgisInternalStoredColor", this.handleUpdateRecentColors), this.listenOn(document, "arcgisRecentColorsUpdate", this.handleStoreNewRecentColor);
31
+ }, this.recentColors = [], this.clearable = !1, this.compact = !1, this.disabled = !1, this.placement = "auto", this.storageId = "arcgis-color-input-storage-colors", this.hideRecentColors = !1, this.showTransparency = !1, this.arcgisChange = r(), this.arcgisColorInputChange = r(), this.arcgisColorInputPopoverClose = r(), this.arcgisColorInputPopoverOpen = r(), this.arcgisColorInputSwatchUpdate = r(), this.arcgisInternalStoredColor = r(), this.arcgisPickerClose = r(), this.arcgisPickerOpen = r(), this.arcgisSwatchUpdate = r(), this.listenOn(document, "arcgisInternalStoredColor", this.handleUpdateRecentColors), this.listenOn(document, "arcgisRecentColorsUpdate", this.handleStoreNewRecentColor);
32
32
  }
33
33
  static {
34
34
  this.properties = { recentColors: 16, clearable: 5, color: 1, compact: 5, disabled: 5, messageOverrides: 0, placement: 1, popoverProps: 0, storageId: 1, hideRecentColors: 5, showTransparency: 5 };
35
35
  }
36
36
  static {
37
- this.styles = S;
37
+ this.styles = I;
38
38
  }
39
39
  async close() {
40
40
  await this.inlineInputEl?.close({ focus: !1 });
@@ -71,7 +71,7 @@ class I extends u {
71
71
  }
72
72
  }
73
73
  setRecentColorsFromStorage() {
74
- const e = y(this.storageId, !0);
74
+ const e = S(this.storageId, !0);
75
75
  e && (this.recentColors = [...e]);
76
76
  }
77
77
  handleSwatchClickOrKeyUp(e) {
@@ -106,33 +106,33 @@ class I extends u {
106
106
  if (!e)
107
107
  return;
108
108
  e.length > 7 && (e = e.slice(0, 7));
109
- const t = [e, ...this.recentColors.filter((r) => r !== e)].slice(0, 3);
110
- $(this.storageId, t), this.recentColors = t, this.arcgisInternalStoredColor.emit();
109
+ const t = [e, ...this.recentColors.filter((i) => i !== e)].slice(0, 3);
110
+ b(this.storageId, t), this.recentColors = t, this.arcgisInternalStoredColor.emit();
111
111
  }
112
112
  handleClose(e) {
113
113
  e.stopPropagation(), this.storeRecentColorToStorage(this.colorPickerEl?.value), this.open = !1, this.arcgisPickerClose.emit(this.colorPickerEl?.value), this.arcgisColorInputPopoverClose.emit(this.colorPickerEl?.value);
114
114
  }
115
115
  addTooltip(e) {
116
- this.removeTooltip(), this.tooltipContainerEl = document.createElement("div"), g(s`<calcite-tooltip .placement=${e.placement ?? "auto"} .referenceElement=${e.referenceElement} overlay-positioning=fixed open>${e.innerHTML}</calcite-tooltip>`, this.tooltipContainerEl), document.body.append(this.tooltipContainerEl);
116
+ this.removeTooltip(), this.tooltipContainerEl = document.createElement("div"), v(s`<calcite-tooltip .placement=${e.placement ?? "auto"} .referenceElement=${e.referenceElement} overlay-positioning=fixed open>${e.innerHTML}</calcite-tooltip>`, this.tooltipContainerEl), document.body.append(this.tooltipContainerEl);
117
117
  }
118
118
  removeTooltip() {
119
119
  this.tooltipContainerEl?.parentNode && (this.tooltipContainerEl.remove(), this.tooltipContainerEl = void 0);
120
120
  }
121
121
  render() {
122
- const { compact: e, disabled: o, recentColors: t, _messages: r } = this, h = [t[0], t[1]], d = v(this.el) === "rtl";
123
- return e || h.push(t[2]), s`<arcgis-picker-input .disabled=${o} .intlDone=${r.commitColor} .heading=${r.selectColor} .label=${r.selectColor} @arcgisPopoverOpen=${this.handleOpen} @arcgisPopoverClose=${this.handleClose} .popoverProps=${this.popoverProps} ${a(this.setInlineInputRef)}><div class="color-picker-container" slot=content>${n(`color-picker${e ? "--compact" : ""}`, s`<calcite-color-picker .clearable=${this.clearable} class="color-picker" @calciteColorPickerInput=${E((c) => {
124
- c.stopPropagation(), this.updateColor(this.colorPickerEl.value, !1);
125
- }, 500)} .scale=${e ? "s" : "m"} .storageId=${this.storageId} .alphaChannel=${this.showTransparency} .value=${this.color} ${a(this.setColorPickerRef)}></calcite-color-picker>`)}</div><div slot=preview><calcite-color-picker-swatch class="preview-swatch" .color=${this.color} scale=s></calcite-color-picker-swatch></div>${!this.hideRecentColors && s`<div slot=content-end class="recent-colors-container" @keydown=${this.handleRecentColorsKeyDown} tabindex=-1>${h.map((c, p) => c ? n(c, s`<calcite-color-picker-swatch class="preview-recent-swatch" role=button scale=s tabindex=0 .active=${c === this.color} .color=${c} @click=${this.handleSwatchClickOrKeyUp} @keyup=${this.handleSwatchClickOrKeyUp} @focus=${this.handleUpdateActiveSwatch} ${a(this.setRecentColorElement(p + 1))}></calcite-color-picker-swatch>`) : this.renderEmptySwatch(`empty-swatch-${p}`))}</div>` || ""}${this.clearable && s`<div slot=content-end class="end-action"><calcite-action icon=circle-disallowed scale=s .label=${r.clearColor} .text=${r.clearColor ?? ""} @click=${this.handleClearColor} @mouseover=${() => this.addTooltip({
122
+ const { compact: e, disabled: o, recentColors: t, _messages: i } = this, h = [t[0], t[1]], C = k(this.el) === "rtl";
123
+ return e || h.push(t[2]), s`<arcgis-picker-input .disabled=${o} .intlDone=${i.commitColor} .heading=${i.selectColor} .label=${i.selectColor} @arcgisPopoverOpen=${this.handleOpen} @arcgisPopoverClose=${this.handleClose} .popoverProps=${this.popoverProps} ${a(this.setInlineInputRef)}><div class="color-picker-container" slot=content>${n(`color-picker${e ? "--compact" : ""}`, s`<calcite-color-picker .clearable=${this.clearable} class="color-picker" @calciteColorPickerInput=${$((l) => {
124
+ l.stopPropagation(), this.updateColor(this.colorPickerEl.value, !1);
125
+ }, 500)} .scale=${e ? "s" : "m"} .storageId=${this.storageId} .alphaChannel=${this.showTransparency} .value=${this.color} ${a(this.setColorPickerRef)}></calcite-color-picker>`)}</div>${this.color ? s`<div slot=preview style=${w({ backgroundColor: this.color })} class="preview-swatch" aria-label=${i.selectColor ?? "" ?? d}></div>` : s`<div slot=preview class="preview-swatch" aria-label=${i.selectColor ?? "" ?? d}><svg xmlns=http://www.w3.org/2000/svg class="preview-swatch-no-color">${u`<clipPath id=shape><rect height=100% width=100% rx=0 /></clipPath><rect clip-path="inset(0 round 0)" height=100% rx=0 stroke="rgba(0, 0, 0, 0.3)" stroke-width=2 width=100% /><line clip-path=url(#shape) stroke-width=3 x1=100% x2=0 y1=0 y2=100% />`}</svg></div>`}${!this.hideRecentColors && s`<div slot=content-end class="recent-colors-container" @keydown=${this.handleRecentColorsKeyDown} tabindex=-1><calcite-swatch-group selection-mode=single .label=${i.recentColors ?? ""} scale=s class="swatch-group">${h.map((l, p) => l ? n(l, s`<calcite-swatch class="preview-recent-swatch" role=button scale=s tabindex=0 .selected=${l === this.color} .color=${l} .label=${i.selectColor ?? ""} @click=${this.handleSwatchClickOrKeyUp} @keyup=${this.handleSwatchClickOrKeyUp} @focus=${this.handleUpdateActiveSwatch} ${a(this.setRecentColorElement(p + 1))}></calcite-swatch>`) : this.renderEmptySwatch(`empty-swatch-${p}`))}</calcite-swatch-group></div>` || ""}${this.clearable && s`<div slot=content-end class="end-action"><calcite-action icon=circle-disallowed scale=s .label=${i.clearColor} .text=${i.clearColor ?? ""} @click=${this.handleClearColor} @mouseover=${() => this.addTooltip({
126
126
  referenceElement: this.actionEl.value,
127
- placement: d ? "right-start" : "left-start",
128
- innerHTML: r.noColor ?? ""
127
+ placement: C ? "right-start" : "left-start",
128
+ innerHTML: i.noColor ?? ""
129
129
  })} @mouseout=${() => this.removeTooltip()} ${a(this.actionEl)}></calcite-action></div>` || ""}</arcgis-picker-input>`;
130
130
  }
131
131
  renderEmptySwatch(e) {
132
- return n(e, s`<svg class="empty-swatch" viewBox="0 0 20 20" xmlns=http://www.w3.org/2000/svg width=20>${f`<rect width=20 height=20 fill=#f8f8f8 stroke=#000 stroke-dasharray=2 />`}</svg>`);
132
+ return n(e, s`<svg class="empty-swatch" viewBox="0 0 20 20" xmlns=http://www.w3.org/2000/svg width=20>${u`<rect width=20 height=20 fill=#f8f8f8 stroke=#000 stroke-dasharray=2 />`}</svg>`);
133
133
  }
134
134
  }
135
- C("arcgis-color-input", I);
135
+ g("arcgis-color-input", R);
136
136
  export {
137
- I as ArcgisColorInput
137
+ R as ArcgisColorInput
138
138
  };
@@ -1,6 +1,7 @@
1
1
  import "@esri/calcite-components/components/calcite-tooltip";
2
2
  import "../arcgis-picker-input/index.js";
3
3
  import "@esri/calcite-components/components/calcite-color-picker";
4
- import "@esri/calcite-components/components/calcite-color-picker-swatch";
4
+ import "@esri/calcite-components/components/calcite-swatch-group";
5
+ import "@esri/calcite-components/components/calcite-swatch";
5
6
  import "@esri/calcite-components/components/calcite-action";
6
7
  export * from "./customElement.js";
@@ -37,10 +37,10 @@ function u(o) {
37
37
  function _(o) {
38
38
  return o.filter((e) => u(e.fields));
39
39
  }
40
- function D(o) {
40
+ function O(o) {
41
41
  return o.flatMap((e) => e.fields);
42
42
  }
43
- function O(o) {
43
+ function A(o) {
44
44
  return o.flatMap((e) => u(e.fields) ? [] : e.fields);
45
45
  }
46
46
  function f(o) {
@@ -48,7 +48,7 @@ function f(o) {
48
48
  (e) => u(e.fields) ? e.fields.flatMap((t) => t.subFieldInfos) : e.fields
49
49
  );
50
50
  }
51
- function A(o, e) {
51
+ function D(o, e) {
52
52
  return o.flatMap((t) => u(t.fields) ? t.fields.flatMap(
53
53
  (i) => i.subFieldInfos.filter((s) => g(s, e, !0))
54
54
  ) : t.fields.filter((i) => F(i, e)));
@@ -244,13 +244,13 @@ class H extends I {
244
244
  });
245
245
  }
246
246
  renderList() {
247
- const e = this.heading || (this.multiple ? this._messages.headerSelect : this._messages.header), t = O(this.allLists), i = _(this.allLists), s = f(this.allLists).length >= this.showFilterLength;
247
+ const e = this.heading || (this.multiple ? this._messages.headerSelect : this._messages.header), t = A(this.allLists), i = _(this.allLists), s = f(this.allLists).length >= this.showFilterLength;
248
248
  return t.length || i.length ? i.length ? this.renderSplitLists(t, i, s) : this.renderTopLevelOnlyFieldList(e, t, s) : n`<slot name=no-fields></slot>`;
249
249
  }
250
250
  renderSplitLists(e, t, i) {
251
- const s = f(this.allLists), l = D(this.allLists).some((a) => F(a, this.filterText));
251
+ const s = f(this.allLists), l = O(this.allLists).some((a) => F(a, this.filterText));
252
252
  return n`${i ? n`<div class="list-controls"><calcite-filter .items=${s} .filterProps=${["name", "alias", "description"]} .placeholder=${this.filterPlaceholderText ?? this._messages.filter} @calciteFilterChange=${(a) => {
253
- this.filterText = a.currentTarget.value, this.filterFields = this.filterText ? A(this.allLists, this.filterText).map((c) => c.name) : void 0;
253
+ this.filterText = a.currentTarget.value, this.filterFields = this.filterText ? D(this.allLists, this.filterText).map((c) => c.name) : void 0;
254
254
  }}></calcite-filter>${this.renderSortButton()}</div>` : null}<div class=${L(this.listOnly ? "" : "list-wrapper")} ${d(this.listWrapper)}>${this.shouldRenderSelectionButton(i) ? this.renderSelectionButton() : null}${this.renderSplitSubFieldLists(t)}${e.length ? this.renderSplitTopLevelFieldList(e, !0) : null}</div>${this.filterText && !l && this.filterNoResultsText?.length !== 0 ? n`<div class="no-match-text">${this.filterNoResultsText ?? this._messages.noMatches}</div>` : null}`;
255
255
  }
256
256
  renderSplitSubFieldLists(e) {
@@ -275,9 +275,9 @@ class H extends I {
275
275
  if (!(t.length >= this.showFilterLength && !this.hideSort))
276
276
  return "";
277
277
  const s = t.every((l) => !!l.type);
278
- return n`<calcite-dropdown slot=${e ?? m} placement=bottom-end overlay-positioning=fixed @calciteDropdownOpen=${() => {
278
+ return n`<calcite-action id=sort-action slot=${e ?? m} .text=${this._messages.sort ?? ""} title=${this._messages.sort ?? m}><calcite-icon scale=s icon=sort-descending flip-rtl></calcite-icon></calcite-action><calcite-dropdown placement=bottom-end overlay-positioning=fixed reference-element=sort-action @calciteDropdownOpen=${() => {
279
279
  this.observer?.disconnect(), this.popoverNode.value && this.observer?.observe(this.popoverNode.value, { attributes: !0 });
280
- }} @calciteDropdownClose=${() => this.observer?.disconnect()} ${d(this.dropdownNode)}><calcite-action slot=trigger .text=${this._messages.sort ?? ""} title=${this._messages.sort ?? m}><calcite-icon scale=s icon=sortDescending flip-rtl></calcite-icon></calcite-action><calcite-dropdown-group><calcite-dropdown-item .selected=${this.lastSortBy === "default"} @calciteDropdownItemSelect=${() => this.setSortBy("default")}>${this._messages.default}</calcite-dropdown-item><calcite-dropdown-item .selected=${this.lastSortBy === "display"} @calciteDropdownItemSelect=${() => this.setSortBy("display")}>${this._messages.displayName}</calcite-dropdown-item>${s && n`<calcite-dropdown-item .selected=${this.lastSortBy === "type"} @calciteDropdownItemSelect=${() => this.setSortBy("type")}>${this._messages.type}</calcite-dropdown-item>` || ""}<calcite-dropdown-item .selected=${this.lastSortBy === "field"} @calciteDropdownItemSelect=${() => this.setSortBy("field")}>${this._messages.fieldName}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`;
280
+ }} @calciteDropdownClose=${() => this.observer?.disconnect()} ${d(this.dropdownNode)}><calcite-dropdown-group><calcite-dropdown-item .selected=${this.lastSortBy === "default"} @calciteDropdownItemSelect=${() => this.setSortBy("default")}>${this._messages.default}</calcite-dropdown-item><calcite-dropdown-item .selected=${this.lastSortBy === "display"} @calciteDropdownItemSelect=${() => this.setSortBy("display")}>${this._messages.displayName}</calcite-dropdown-item>${s && n`<calcite-dropdown-item .selected=${this.lastSortBy === "type"} @calciteDropdownItemSelect=${() => this.setSortBy("type")}>${this._messages.type}</calcite-dropdown-item>` || ""}<calcite-dropdown-item .selected=${this.lastSortBy === "field"} @calciteDropdownItemSelect=${() => this.setSortBy("field")}>${this._messages.fieldName}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`;
281
281
  }
282
282
  renderSelectionButton() {
283
283
  return n`<div class="selection-button-div"><calcite-button appearance=transparent scale=s width=full @click=${() => {
@@ -7,8 +7,8 @@ import "@esri/calcite-components/components/calcite-flow";
7
7
  import "@esri/calcite-components/components/calcite-filter";
8
8
  import "@esri/calcite-components/components/calcite-list-item-group";
9
9
  import "@esri/calcite-components/components/calcite-list-item";
10
- import "@esri/calcite-components/components/calcite-dropdown";
11
10
  import "@esri/calcite-components/components/calcite-action";
11
+ import "@esri/calcite-components/components/calcite-dropdown";
12
12
  import "@esri/calcite-components/components/calcite-dropdown-group";
13
13
  import "@esri/calcite-components/components/calcite-dropdown-item";
14
14
  import "@esri/calcite-components/components/calcite-button";
@@ -0,0 +1,42 @@
1
+ /// <reference path="../../index.d.ts" />
2
+ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
3
+
4
+ /**
5
+ * Component to render html content. The content will be sanitized before rendering to prevent XSS attack.
6
+ * The default sanitizer will remove all tags not in the whitelist and also remove the content in script tag.
7
+ * The default sanitizer will allow certain classes for img and figure tags to support html content generated from CKEditor, but it can be customized by passing in sanitizerOptions.
8
+ * More info about the default whitelist of arcgis-html-sanitizer can be found at https://github.com/Esri/arcgis-html-sanitizer/blob/master/src/index.ts
9
+ *
10
+ * @internal
11
+ */
12
+ export abstract class ArcgisHtmlContent extends LitElement {
13
+ /**
14
+ * Html fragment to be rendered in the component. It will be sanitized before rendering.
15
+ * The default sanitizer will remove all tags not in the whitelist and also remove the content in script tag.
16
+ * The default sanitizer will allow certain classes for img and figure tags to support html content generated from CKEditor, but it can be customized by passing in sanitizerOptions.
17
+ *
18
+ * @default ""
19
+ */
20
+ accessor content: string;
21
+ /**
22
+ * The options to create the sanitizer. It can be used to customize the sanitizer behavior, for example, allowing some tags or attributes that are not in the default whitelist.
23
+ * For more details of the options, please refer to the XSS.IFilterXSSOptions documentation.
24
+ */
25
+ accessor sanitizerOptions: IFilterXSSOptions | undefined;
26
+ }
27
+
28
+ /** @internal */
29
+ export type IFilterXSSOptions = {
30
+ onTagAttr?: OnTagAttrHandler;
31
+ stripIgnoreTag?: boolean;
32
+ stripIgnoreTagBody?: string[] | boolean;
33
+ };
34
+
35
+ /**
36
+ * @param tag
37
+ * @param name
38
+ * @param value
39
+ * @param isWhiteAttr
40
+ * @internal
41
+ */
42
+ export type OnTagAttrHandler = (tag: string, name: string, value: string, isWhiteAttr: boolean) => string | void;
@@ -0,0 +1,71 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import { c as s } from "../../chunks/runtime.js";
3
+ import { LitElement as g } from "@arcgis/lumina";
4
+ import c from "@esri/arcgis-html-sanitizer";
5
+ import { unsafeHTML as d } from "lit/directives/unsafe-html.js";
6
+ import { css as m } from "lit";
7
+ const p = m`:host{--arcgis-internal-content-image-spacing: 1.5em;--arcgis-internal-content-inline-image-spacing: calc(var(--arcgis-internal-content-image-spacing) / 2);width:100%;*{overflow-wrap:anywhere}}ol,ul{margin:1.12em 0;padding-block:0;padding-inline-start:var(--calcite-spacing-10)}ol li,ul li{border:none;height:initial}h1,h2,h3,h4,h5,h6,p{margin:0}a{color:var(--calcite-color-text-link);text-decoration:none;&:hover{text-decoration:underline}}video,img{max-width:100%;height:auto}table .ck-table-resized{table-layout:fixed}.table table{overflow:hidden}.table td,.table th{position:relative}.table{margin:.9em auto;display:table}.table table{border-collapse:collapse;border-spacing:0;width:100%;height:100%;border:1px double hsl(0,0%,70%)}.table table td,.table table th{min-width:2em;padding:.4em;border:1px solid hsl(0,0%,75%)}.table th{font-weight:700;background:#0000000d}.table>figcaption{display:table-caption;caption-side:top;word-break:break-word;text-align:center;color:#333;background-color:#f7f7f7;padding:.6em;font-size:.75em;outline-offset:-1px}ol{list-style-type:decimal}ol ol{list-style-type:lower-latin}ol ol ol{list-style-type:lower-roman}ol ol ol ol{list-style-type:upper-latin}ol ol ol ol ol{list-style-type:upper-roman}ul{list-style-type:disc}ul ul{list-style-type:circle}ul ul ul,ul ul ul ul{list-style-type:square}.image{display:table;clear:both;text-align:center;margin:.9em auto;min-width:50px}.image img{display:block;margin:0 auto;max-width:100%;min-width:100%;height:auto}.image-inline{display:inline-flex;max-width:100%;align-items:flex-start}.image-inline picture{display:flex}.image-inline picture,.image-inline img{flex-grow:1;flex-shrink:1;max-width:100%}.image_resized{height:auto}.image_resized{max-width:100%;display:block;box-sizing:border-box}.image_resized img{width:100%}.image_resized>figcaption{display:block}.image>figcaption{display:table-caption;caption-side:bottom;word-break:break-word;color:#333;background-color:#f7f7f7;padding:.6em;font-size:.75em;outline-offset:-1px}.image-style-block-align-left,.image-style-block-align-right{max-width:calc(100% - var(--arcgis-user-content-image-style-spacing))}.image-style-align-left,.image-style-align-right{clear:none}.image-style-align-left{float:left;margin-right:var(--arcgis-user-content-image-style-spacing)}.image-style-align-center{margin-left:auto;margin-right:auto}.image-style-align-right{float:right;margin-left:var(--arcgis-user-content-image-style-spacing)}.image-style-block-align-right{margin-right:0;margin-left:auto}.image-style-block-align-left{margin-left:0;margin-right:auto}p+.image-style-align-left,p+.image-style-align-right{margin-top:0}.image-inline.image-style-align-left,.image-inline.image-style-align-right{margin-top:var(--arcgis-user-content-inline-image-style-spacing);margin-bottom:var(--arcgis-user-content-inline-image-style-spacing)}.image-inline.image-style-align-left{margin-right:var(--arcgis-user-content-inline-image-style-spacing)}.image-inline.image-style-align-right{margin-left:var(--arcgis-user-content-inline-image-style-spacing)}blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;margin-right:0;font-style:italic;border-left:solid 5px hsl(0,0%,80%)}[dir=rtl] blockquote{border-left:0;border-right:solid 5px hsl(0,0%,80%)}code{background-color:#c7c7c74d;padding:.15em;border-radius:2px}hr{margin:15px 0;height:4px;background:#dedede;border:0}pre{padding:1em;color:#353535;background:#c7c7c74d;border:1px solid hsl(0,0%,77%);border-radius:2px;text-align:left;direction:ltr;tab-size:4;white-space:pre-wrap;font-style:normal;min-width:200px}pre code{background:unset;padding:0;border-radius:0}`, h = /^(?:table|image|image-inline|image_resized|image-style(?:-block)?-align-(?:left|right)|image-style-align-center)$/u;
8
+ function n(a) {
9
+ return a.split(" ").every((t) => h.test(t));
10
+ }
11
+ function u(a) {
12
+ return a.startsWith("//");
13
+ }
14
+ class b extends g {
15
+ constructor() {
16
+ super(...arguments), this.sanitizer = this.#t(), this.content = "";
17
+ }
18
+ static {
19
+ this.properties = { sanitizer: 16, content: 1, sanitizerOptions: 0 };
20
+ }
21
+ static {
22
+ this.styles = p;
23
+ }
24
+ willUpdate(e) {
25
+ e.has("sanitizerOptions") && (this.sanitizer = this.#t());
26
+ }
27
+ #t() {
28
+ const e = {
29
+ allowedProtocols: [],
30
+ customOnTagAttr: this.sanitizerOptions?.onTagAttr
31
+ }, t = new c({
32
+ stripIgnoreTag: !0,
33
+ // remove all tags not in the whitelist, only keep plain text
34
+ stripIgnoreTagBody: ["script"],
35
+ // not only remove script tag, but also remove the content in it
36
+ whiteList: {},
37
+ ...this.sanitizerOptions ?? {},
38
+ onTagAttr: this.onTagAttr.bind(e)
39
+ }, !0);
40
+ return e.allowedProtocols = t.allowedProtocols ?? [], t;
41
+ }
42
+ onTagAttr(e, t, i, r) {
43
+ if (t.startsWith("on"))
44
+ return "";
45
+ const l = `${t}="${i}"`;
46
+ switch (i = i.trim().toLowerCase(), e) {
47
+ case "img":
48
+ return t === "class" && n(i) ? l : this.customOnTagAttr?.(e, t, i, r);
49
+ case "figure":
50
+ return t === "class" && n(i) ? l : this.customOnTagAttr?.(e, t, i, r);
51
+ case "video":
52
+ case "audio":
53
+ case "source":
54
+ case "iframe": {
55
+ if (i === "/" || i === "#" || i.startsWith("#"))
56
+ return t;
57
+ const o = i.substring(0, i.indexOf(":"));
58
+ return u(i) || this.allowedProtocols.includes(o) ? l : t;
59
+ }
60
+ default:
61
+ return this.customOnTagAttr?.(e, t, i, r);
62
+ }
63
+ }
64
+ render() {
65
+ return d(this.sanitizer.sanitize(this.content));
66
+ }
67
+ }
68
+ s("arcgis-html-content", b);
69
+ export {
70
+ b as ArcgisHtmlContent
71
+ };
@@ -0,0 +1 @@
1
+ export * from "./customElement.js";
@@ -0,0 +1 @@
1
+ export * from "./customElement.js";
@@ -5,7 +5,7 @@ import { LitElement as u, createEvent as c, safeClassMap as h } from "@arcgis/lu
5
5
  import { useWatchAttributes as d } from "@arcgis/lumina/controllers";
6
6
  import { createRef as s, ref as l } from "lit/directives/ref.js";
7
7
  import { css as p, html as a } from "lit";
8
- const m = p`:host{display:block}:host([hidden]){display:none}.content{display:flex;flex-direction:column}.readOnlyLabel{display:block;font-size:var(--calcite-font-size-sm);font-variant-numeric:tabular-nums;line-height:var(--calcite-font-line-height-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-inline:.5rem;padding-block:3px;border-color:var(--calcite-color-transparent);border-style:solid;border-width:var(--calcite-button-border-size, 1px);color:var(--calcite-color-text-1)}:host(:not([read-only])) .readOnlyLabel{position:absolute;opacity:0}:host([alignment="start"]){.content{align-items:start}.readOnlyLabel{text-align:start}}:host([alignment="end"]){.content{align-items:end}.readOnlyLabel{text-align:end}}:host([alignment="center"]){.content{align-items:center}.readOnlyLabel{text-align:center}}calcite-button{inline-size:100%;--calcite-offset-invert-focus: 1;--calcite-internal-animation-timing-fast: 0}calcite-input-number{inline-size:100%;--calcite-internal-animation-timing-fast: 0}`;
8
+ const m = p`:host{display:block}:host([hidden]){display:none}.content{display:flex;flex-direction:column}.readOnlyLabel{display:block;font-size:var(--calcite-font-size-sm);font-variant-numeric:tabular-nums;line-height:var(--calcite-font-line-height-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-inline:.5rem;padding-block:3px;border-color:var(--calcite-color-transparent);border-style:solid;border-width:var(--calcite-button-border-size, 1px);color:var(--calcite-color-text-1)}:host(:not([read-only])) .readOnlyLabel{position:absolute;opacity:0}:host([alignment="start"]){.content{align-items:start}.readOnlyLabel{text-align:start}}:host([alignment="end"]){.content{align-items:end}.readOnlyLabel{text-align:end}}:host([alignment="center"]){.content{align-items:center}.readOnlyLabel{text-align:center}}calcite-button{inline-size:100%;--calcite-offset-invert-focus: 1;--calcite-internal-animation-timing-fast: 0}calcite-button:hover{--calcite-button-background-color: var(--calcite-color-surface-4)}calcite-input-number{inline-size:100%;--calcite-internal-animation-timing-fast: 0}`;
9
9
  class f extends u {
10
10
  constructor() {
11
11
  super(), this._buttonRef = s(), this._inputRef = s(), this._labelRef = s(), this._formatOptions = {