@arcgis/map-components 5.1.0-next.137 → 5.1.0-next.138

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.
@@ -18,7 +18,7 @@ import type { PasteCommand, PasteApplyError, PasteCommandApplyParameters } from
18
18
  import type { CustomPasteCommand } from "./commands/PasteCustomCommand.js";
19
19
 
20
20
  /** @internal */
21
- export interface PasteViewModelProperties extends Partial<Pick<PasteViewModel, "_activeFlowPage" | "activeCommand" | "activeFlowPage" | "alwaysShowFeatureForm" | "applying" | "bauActiveFeatureIndex" | "bauApplySet" | "bauFeatures" | "bauFormUpdating" | "bauFormValid" | "bauHasTooManyComplexFeatures" | "bauHasTooManyFeatures" | "bauHighlight" | "bauIndividualHighlight" | "bauInvalidFeatures" | "bauOriginalGraphics" | "beforeClipboard" | "beforeForm" | "clipboardGraphicsLayer" | "clipboardMover" | "closeOnApply" | "currentPasteOperation" | "customPasteCommands" | "formViewModelMap" | "hideErrorNotice" | "hideFooter" | "hideFooterCancelButton" | "hideHeaderCloseButton" | "hideTooltips" | "hideViewClipboard" | "highlightGroup" | "lastPasteError" | "layerPermissionsCheck" | "maximumFeatureCount" | "maximumFeatureCountWithComplexForms" | "pasteTemplate" | "pasteWithAttributes" | "pasteWithMultipleFeaturesEnabled" | "pasteWithMultipleLayersEnabled" | "selectedClipboardItemIndex" | "selectedFeature" | "showClipboardItems" | "supportedCommands" | "view">> {}
21
+ export interface PasteViewModelProperties extends Partial<Pick<PasteViewModel, "_activeFlowPage" | "activeCommand" | "activeFlowPage" | "alwaysShowFeatureForm" | "applying" | "bauActiveFeatureIndex" | "bauApplySet" | "bauFeatures" | "bauFormUpdating" | "bauFormValid" | "bauHasTooManyComplexFeatures" | "bauHasTooManyFeatures" | "bauHighlight" | "bauIndividualHighlight" | "bauInvalidFeatures" | "bauOriginalGraphics" | "beforeClipboard" | "beforeForm" | "clipboardGraphicsLayer" | "clipboardMover" | "closeOnApply" | "currentPasteOperation" | "customPasteCommands" | "disableTemplatesMode" | "formViewModelMap" | "hideErrorNotice" | "hideFooter" | "hideFooterCancelButton" | "hideHeaderCloseButton" | "hideTooltips" | "hideViewClipboard" | "highlightGroup" | "lastPasteError" | "layerPermissionsCheck" | "maximumFeatureCount" | "maximumFeatureCountWithComplexForms" | "pasteTemplate" | "pasteWithAttributes" | "pasteWithMultipleFeaturesEnabled" | "pasteWithMultipleLayersEnabled" | "selectedClipboardItemIndex" | "selectedFeature" | "showClipboardItems" | "supportedCommands" | "view">> {}
22
22
 
23
23
  /**
24
24
  * The types of flow page that maybe being shown in the component
@@ -86,6 +86,8 @@ export default class PasteViewModel extends Accessor {
86
86
  /** @default "" */
87
87
  accessor currentPasteOperation: "" | "paste-as" | "paste-merge";
88
88
  accessor customPasteCommands: Collection<CustomPasteCommand>;
89
+ /** @default "never" */
90
+ accessor disableTemplatesMode: "never" | "scale" | "visible";
89
91
  accessor formViewModelMap: Map<FeatureLayer | SubtypeSublayer, BatchAttributeFormViewModel>;
90
92
  get hasClipboardItemMatchingTemplate(): boolean;
91
93
  get hasPasteCommandsPage(): boolean;
@@ -176,6 +176,12 @@ export abstract class ArcgisPaste extends LitElement {
176
176
  * @default false
177
177
  */
178
178
  accessor closeOnApply: boolean;
179
+ /**
180
+ * Decide if templates should be disabled when the layer is not visible, or not visible at the current scale.
181
+ *
182
+ * @default "never"
183
+ */
184
+ accessor disableTemplatesMode: "scale" | "never" | "visible";
179
185
  /**
180
186
  * Determines if the component should show error notices
181
187
  *
@@ -973,7 +973,7 @@ function te(e) {
973
973
  let n = class extends U {
974
974
  //#region Lifecycle
975
975
  constructor(e) {
976
- super(e), this.customPasteCommands = new j(), this.bauInvalidFeatures = [], this.bauFormValid = !0, this.bauFormUpdating = !1, this.bauActiveFeatureIndex = -1, this.bauHasTooManyFeatures = !1, this.bauHasTooManyComplexFeatures = !1, this.bauOriginalGraphics = [], this.formViewModelMap = /* @__PURE__ */ new Map(), this.supportedCommands = ["paste-append", "paste-as", "paste-subtract", "paste", "paste-merge"], this.pasteWithMultipleLayersEnabled = !1, this.pasteWithMultipleFeaturesEnabled = !1, this.alwaysShowFeatureForm = !1, this.selectedClipboardItemIndex = -1, this.pasteWithAttributes = !0, this.closeOnApply = !1, this.currentPasteOperation = "", this._activeFlowPage = "commands-page", this.showClipboardItems = !1, this.hideTooltips = !1, this.hideFooter = !1, this.hideFooterCancelButton = !1, this.hideHeaderCloseButton = !1, this.hideViewClipboard = !1, this.hideErrorNotice = !1, this.highlightGroup = "temporary", this._hoverHighlightHandle = null, this.maximumFeatureCount = 200, this.maximumFeatureCountWithComplexForms = 50, this.layerPermissionsCheck = {
976
+ super(e), this.customPasteCommands = new j(), this.bauInvalidFeatures = [], this.bauFormValid = !0, this.bauFormUpdating = !1, this.bauActiveFeatureIndex = -1, this.bauHasTooManyFeatures = !1, this.bauHasTooManyComplexFeatures = !1, this.bauOriginalGraphics = [], this.formViewModelMap = /* @__PURE__ */ new Map(), this.supportedCommands = ["paste-append", "paste-as", "paste-subtract", "paste", "paste-merge"], this.pasteWithMultipleLayersEnabled = !1, this.pasteWithMultipleFeaturesEnabled = !1, this.alwaysShowFeatureForm = !1, this.selectedClipboardItemIndex = -1, this.pasteWithAttributes = !0, this.closeOnApply = !1, this.currentPasteOperation = "", this.disableTemplatesMode = "never", this._activeFlowPage = "commands-page", this.showClipboardItems = !1, this.hideTooltips = !1, this.hideFooter = !1, this.hideFooterCancelButton = !1, this.hideHeaderCloseButton = !1, this.hideViewClipboard = !1, this.hideErrorNotice = !1, this.highlightGroup = "temporary", this._hoverHighlightHandle = null, this.maximumFeatureCount = 200, this.maximumFeatureCountWithComplexForms = 50, this.layerPermissionsCheck = {
977
977
  canCreate: (t) => t ? !!t.effectiveCapabilities?.operations.supportsAdd : !1,
978
978
  canUpdate: (t) => {
979
979
  if (!t)
@@ -1374,6 +1374,9 @@ c([
1374
1374
  c([
1375
1375
  r()
1376
1376
  ], n.prototype, "currentPasteOperation", 2);
1377
+ c([
1378
+ r()
1379
+ ], n.prototype, "disableTemplatesMode", 2);
1377
1380
  c([
1378
1381
  r()
1379
1382
  ], n.prototype, "activeFlowPage", 1);
@@ -1541,10 +1544,10 @@ M = S([
1541
1544
  const at = ve(n);
1542
1545
  class st extends he {
1543
1546
  constructor() {
1544
- super(), this._featureFormElement = V(), this._floatingChoiceContainer = V(), this._bauForm = V(), this._templateGallery = V(), this._messages = ge(), this.viewModel = at(this), this.hasPasteCommandsPage = this.viewModel.hasPasteCommandsPage, this.activeCommand = this.viewModel.activeCommand, this.availableCommands = this.viewModel.availableCommands, this._showFloatingChoice = !1, this.activeFlowPage = this.viewModel.activeFlowPage, this.autoDestroyDisabled = !1, this.view = this.viewModel.view, this.selectedFeature = this.viewModel.selectedFeature, this.closed = !1, this.highlightGroup = this.viewModel.highlightGroup, this.pasteWithMultipleLayersEnabled = this.viewModel.pasteWithMultipleLayersEnabled, this.pasteWithMultipleFeaturesEnabled = this.viewModel.pasteWithMultipleFeaturesEnabled, this.alwaysShowFeatureForm = this.viewModel.alwaysShowFeatureForm, this.closeOnApply = this.viewModel.closeOnApply, this.hideErrorNotice = this.viewModel.hideErrorNotice, this.hideFooterCancelButton = this.viewModel.hideFooterCancelButton, this.hideFooter = this.viewModel.hideFooter, this.hideHeaderCloseButton = this.viewModel.hideHeaderCloseButton, this.hideTooltips = this.viewModel.hideTooltips, this.hideViewClipboard = this.viewModel.hideViewClipboard, this.maximumFeatureCount = this.viewModel.maximumFeatureCount, this.maximumFeatureCountWithComplexForms = this.viewModel.maximumFeatureCountWithComplexForms, this.layerPermissionsCheck = this.viewModel.layerPermissionsCheck, this.pasteCommandsState = this.viewModel.pasteCommandsState, this.arcgisApplyPasteCommand = T(), this.arcgisApplyPasteError = T(), this.arcgisBeforeClipboardMove = T(), this.arcgisClipboardMoveStateChanged = T(), this.arcgisClose = T(), this.arcgisPropertyChange = xe()("pasteCommandsState", "activeFlowPage"), this.arcgisReady = T(), this.listenOn(window, "click", this._handleClickAway), this.listenOn(window, "keydown", this._handleKeyDown);
1547
+ super(), this._featureFormElement = V(), this._floatingChoiceContainer = V(), this._bauForm = V(), this._templateGallery = V(), this._messages = ge(), this.viewModel = at(this), this.hasPasteCommandsPage = this.viewModel.hasPasteCommandsPage, this.activeCommand = this.viewModel.activeCommand, this.availableCommands = this.viewModel.availableCommands, this._showFloatingChoice = !1, this.activeFlowPage = this.viewModel.activeFlowPage, this.autoDestroyDisabled = !1, this.view = this.viewModel.view, this.selectedFeature = this.viewModel.selectedFeature, this.closed = !1, this.highlightGroup = this.viewModel.highlightGroup, this.pasteWithMultipleLayersEnabled = this.viewModel.pasteWithMultipleLayersEnabled, this.pasteWithMultipleFeaturesEnabled = this.viewModel.pasteWithMultipleFeaturesEnabled, this.alwaysShowFeatureForm = this.viewModel.alwaysShowFeatureForm, this.closeOnApply = this.viewModel.closeOnApply, this.hideErrorNotice = this.viewModel.hideErrorNotice, this.hideFooterCancelButton = this.viewModel.hideFooterCancelButton, this.hideFooter = this.viewModel.hideFooter, this.hideHeaderCloseButton = this.viewModel.hideHeaderCloseButton, this.hideTooltips = this.viewModel.hideTooltips, this.hideViewClipboard = this.viewModel.hideViewClipboard, this.maximumFeatureCount = this.viewModel.maximumFeatureCount, this.maximumFeatureCountWithComplexForms = this.viewModel.maximumFeatureCountWithComplexForms, this.layerPermissionsCheck = this.viewModel.layerPermissionsCheck, this.pasteCommandsState = this.viewModel.pasteCommandsState, this.disableTemplatesMode = this.viewModel.disableTemplatesMode, this.arcgisApplyPasteCommand = T(), this.arcgisApplyPasteError = T(), this.arcgisBeforeClipboardMove = T(), this.arcgisClipboardMoveStateChanged = T(), this.arcgisClose = T(), this.arcgisPropertyChange = xe()("pasteCommandsState", "activeFlowPage"), this.arcgisReady = T(), this.listenOn(window, "click", this._handleClickAway), this.listenOn(window, "keydown", this._handleKeyDown);
1545
1548
  }
1546
1549
  static {
1547
- this.properties = { hasPasteCommandsPage: 16, activeCommand: 16, availableCommands: 16, _showFloatingChoice: 16, activeFlowPage: 32, autoDestroyDisabled: 5, referenceElement: 1, view: 0, selectedFeature: 0, closed: 7, highlightGroup: 1, supportedCommands: 1, pasteWithMultipleLayersEnabled: 5, pasteWithMultipleFeaturesEnabled: 5, alwaysShowFeatureForm: 5, beforeApply: 0, clipboard: 32, closeOnApply: 5, hideErrorNotice: 5, hideFooterCancelButton: 5, hideFooter: 5, hideHeaderCloseButton: 5, hideTooltips: 5, hideViewClipboard: 5, maximumFeatureCount: 9, maximumFeatureCountWithComplexForms: 9, layerPermissionsCheck: 0, pasteCommandsState: 0 };
1550
+ this.properties = { hasPasteCommandsPage: 16, activeCommand: 16, availableCommands: 16, _showFloatingChoice: 16, activeFlowPage: 32, autoDestroyDisabled: 5, referenceElement: 1, view: 0, selectedFeature: 0, closed: 7, highlightGroup: 1, supportedCommands: 1, pasteWithMultipleLayersEnabled: 5, pasteWithMultipleFeaturesEnabled: 5, alwaysShowFeatureForm: 5, beforeApply: 0, clipboard: 32, closeOnApply: 5, hideErrorNotice: 5, hideFooterCancelButton: 5, hideFooter: 5, hideHeaderCloseButton: 5, hideTooltips: 5, hideViewClipboard: 5, maximumFeatureCount: 9, maximumFeatureCountWithComplexForms: 9, layerPermissionsCheck: 0, pasteCommandsState: 0, disableTemplatesMode: 1 };
1548
1551
  }
1549
1552
  static {
1550
1553
  this.styles = $e;
@@ -1694,9 +1697,9 @@ class st extends he {
1694
1697
  t.selectedTemplateId !== this.viewModel.pasteTemplate.id && (t.selectedTemplateId = this.viewModel.pasteTemplate.id);
1695
1698
  return;
1696
1699
  }
1697
- if (t.effectiveTemplates.length === 0)
1700
+ if (t.effectiveTemplates?.length === 0)
1698
1701
  return;
1699
- const i = t.effectiveTemplates[0].templates[0];
1702
+ const i = t.effectiveTemplates?.[0].templates[0];
1700
1703
  i && (this.viewModel.pasteTemplate = i, t.selectedTemplateId = i.id);
1701
1704
  });
1702
1705
  }
@@ -1764,7 +1767,7 @@ class st extends he {
1764
1767
  this.viewModel.activeFlowPage = "merge-page";
1765
1768
  }} title=${this._messages.seeMergeOptions ?? ue}>${this._messages.seeMergeOptions}</calcite-link>` : null}</calcite-notice></div>` : null}${this.viewModel.clipboardAndTemplateSupportAttributes && this.viewModel.pasteTemplate ? this._renderAttributeCheckbox(!this.viewModel.clipboardAndTemplateSupportAttributes) : null}${this.viewModel.clipboardAndTemplateSupportAttributes ? null : this._renderAttributeCheckbox(!1)}</div><calcite-list .hidden=${this.viewModel.activeCommand !== "paste-merge"} .label=${this._messages.pasteCommandChoices ?? ""} selection-mode=none selection-appearance=border><calcite-list-item .label=${this._messages.mergeOptionsTitle} .description=${this._messages.mergeOptionsDesc} .disabled=${this.viewModel.updating} @click=${() => {
1766
1769
  this.viewModel.activeFlowPage = "merge-page";
1767
- }}><calcite-icon slot=content-start icon=configure></calcite-icon><calcite-icon slot=content-end icon=chevron-right></calcite-icon></calcite-list-item></calcite-list><div>${this.viewModel.workingLayers.length > 0 ? d`<arcgis-feature-templates .applicationDisabledFunction=${(i) => !!(i.template && ie(i.template) && i.template.type !== "feature")} class="paste-feature-templates" .layers=${this.viewModel.workingLayers} @arcgisTemplatesChanged=${() => {
1770
+ }}><calcite-icon slot=content-start icon=configure></calcite-icon><calcite-icon slot=content-end icon=chevron-right></calcite-icon></calcite-list-item></calcite-list><div>${this.viewModel.workingLayers.length > 0 ? d`<arcgis-feature-templates .disableTemplatesMode=${this.disableTemplatesMode} .applicationDisabledFunction=${(i) => !!(i.template && ie(i.template) && i.template.type !== "feature")} class="paste-feature-templates" .layers=${this.viewModel.workingLayers} @arcgisTemplatesChanged=${() => {
1768
1771
  this._checkAndUpdateInitialPasteTemplate();
1769
1772
  }} @arcgisSelectTemplate=${(i) => {
1770
1773
  this.viewModel.pasteTemplate = i.detail.template;