@umbraco-cms/backoffice 16.4.1 → 16.5.0

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 (25) hide show
  1. package/dist-cms/assets/lang/en.js +5 -1
  2. package/dist-cms/packages/block/block-grid/components/block-grid-entries/block-grid-entries.element.d.ts +1 -0
  3. package/dist-cms/packages/block/block-grid/components/block-grid-entries/block-grid-entries.element.js +6 -0
  4. package/dist-cms/packages/block/block-list/property-editors/block-list-editor/property-editor-ui-block-list.element.js +2 -5
  5. package/dist-cms/packages/content/content/workspace/content-detail-workspace-base.js +5 -2
  6. package/dist-cms/packages/core/components/multiple-text-string-input/input-multiple-text-string.element.js +2 -0
  7. package/dist-cms/packages/core/icon-registry/icon-picker-modal/icon-picker-modal.element.d.ts +2 -0
  8. package/dist-cms/packages/core/icon-registry/icon-picker-modal/icon-picker-modal.element.js +21 -17
  9. package/dist-cms/packages/core/icon-registry/icon-picker-modal/icon-picker-modal.token.d.ts +1 -0
  10. package/dist-cms/packages/documents/documents/components/input-document/input-document.element.js +1 -1
  11. package/dist-cms/packages/media/media/components/input-rich-media/input-rich-media.element.js +4 -0
  12. package/dist-cms/packages/media/media/components/input-upload-field/file-upload-preview.element.js +1 -1
  13. package/dist-cms/packages/media/media/components/input-upload-field/preview/input-upload-field-svg.element.js +3 -0
  14. package/dist-cms/packages/media/media/dropzone/dropzone-media.element.js +18 -4
  15. package/dist-cms/packages/media/media/modals/image-cropper-editor/image-cropper-editor-modal.element.d.ts +1 -0
  16. package/dist-cms/packages/media/media/modals/image-cropper-editor/image-cropper-editor-modal.element.js +1 -0
  17. package/dist-cms/packages/performance-profiling/dashboard-performance-profiling.element.d.ts +4 -3
  18. package/dist-cms/packages/performance-profiling/dashboard-performance-profiling.element.js +63 -17
  19. package/dist-cms/packages/property-editors/icon-picker/manifests.js +6 -0
  20. package/dist-cms/packages/property-editors/icon-picker/property-editor-ui-icon-picker.element.d.ts +1 -0
  21. package/dist-cms/packages/property-editors/icon-picker/property-editor-ui-icon-picker.element.js +6 -1
  22. package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
  23. package/dist-cms/umbraco-package.json +1 -1
  24. package/dist-cms/vscode-html-custom-data.json +4 -4
  25. package/package.json +1 -1
@@ -2355,11 +2355,15 @@ export default {
2355
2355
  },
2356
2356
  profiling: {
2357
2357
  performanceProfiling: 'Performance profiling',
2358
- performanceProfilingDescription: "<p>Umbraco currently runs in debug mode. This means you can use the built-in performance profiler to assess the performance when rendering pages.</p><p>If you want to activate the profiler for a specific page rendering, simply add <strong>umbDebug=true</strong> to the querystring when requesting the page.</p><p>If you want the profiler to be activated by default for all page renderings, you can use the toggle below. It will set a cookie in your browser, which then activates the profiler automatically. In other words, the profiler will only be active by default in <em>your</em> browser - not everyone else's.</p>",
2358
+ performanceProfilingDescription: "<p>Umbraco currently runs in debug mode. This means you can use the built-in performance profiler to assess the performance when rendering pages.</p><p>If you want to activate the profiler for a specific page rendering, simply add <strong>umbDebug=true</strong> to the querystring when requesting the page.</p><p>If you want the profiler to be activated by default for all page renderings, you can use the toggle below. It will set a cookie in your browser, which then activates the profiler automatically. In other words, the profiler will only be active by default in <em>your</em> browser - not everyone else's.</p><p><strong>Note:</strong> This will only work if the Backoffice is currently located on the same URL as the front-end website.</p>",
2359
2359
  activateByDefault: 'Activate the profiler by default',
2360
2360
  reminder: 'Friendly reminder',
2361
2361
  reminderDescription: '<p>You should never let a production site run in debug mode. Debug mode is turned off by setting <strong>Umbraco:CMS:Hosting:Debug</strong> to <strong>false</strong> in appsettings.json, appsettings.{Environment}.json or via an environment variable.</p>',
2362
2362
  profilerEnabledDescription: "<p>Umbraco currently does not run in debug mode, so you can't use the built-in profiler. This is how it should be for a production site.</p><p>Debug mode is turned on by setting <strong>Umbraco:CMS:Hosting:Debug</strong> to <strong>true</strong> in appsettings.json, appsettings.{Environment}.json or via an environment variable.</p>",
2363
+ errorEnablingProfilerTitle: 'Error enabling profiler',
2364
+ errorEnablingProfilerDescription: 'It was not possible to enable the profiler. Check that you are accessing the Backoffice on the same URL as the front-end website, and try again. If the problem persists, please check the log for more details.',
2365
+ errorDisablingProfilerTitle: 'Error disabling profiler',
2366
+ errorDisablingProfilerDescription: 'It was not possible to disable the profiler. Try again, and if the problem persists, please check the log for more details.',
2363
2367
  },
2364
2368
  settingsDashboardVideos: {
2365
2369
  trainingHeadline: 'Hours of Umbraco training videos are only a click away',
@@ -16,6 +16,7 @@ export declare class UmbBlockGridEntriesElement extends UmbBlockGridEntriesEleme
16
16
  private _styleElement?;
17
17
  private _layoutEntries;
18
18
  private _isReadOnly;
19
+ private _limitMax?;
19
20
  constructor();
20
21
  render(): import("lit-html").TemplateResult<1>;
21
22
  static styles: import("lit").CSSResult[];
@@ -195,6 +195,7 @@ let UmbBlockGridEntriesElement = class UmbBlockGridEntriesElement extends UmbFor
195
195
  new UmbFormControlValidator(this, this /*, this.#dataPath*/);
196
196
  }
197
197
  async #setupRangeValidation(rangeLimit) {
198
+ this._limitMax = rangeLimit?.max;
198
199
  if (this.#rangeUnderflowValidator) {
199
200
  this.removeValidator(this.#rangeUnderflowValidator);
200
201
  this.#rangeUnderflowValidator = undefined;
@@ -266,6 +267,8 @@ let UmbBlockGridEntriesElement = class UmbBlockGridEntriesElement extends UmbFor
266
267
  `;
267
268
  }
268
269
  #renderCreateButtonGroup() {
270
+ if (this._limitMax === 1 && this._layoutEntries.length > 0)
271
+ return nothing;
269
272
  if (this._areaKey === null || this._layoutEntries.length === 0) {
270
273
  return html ` <uui-button-group id="createButton">
271
274
  ${this.#renderCreateButton()} ${this.#renderPasteButton()}
@@ -396,6 +399,9 @@ __decorate([
396
399
  __decorate([
397
400
  state()
398
401
  ], UmbBlockGridEntriesElement.prototype, "_isReadOnly", void 0);
402
+ __decorate([
403
+ state()
404
+ ], UmbBlockGridEntriesElement.prototype, "_limitMax", void 0);
399
405
  UmbBlockGridEntriesElement = __decorate([
400
406
  customElement('umb-block-grid-entries')
401
407
  ], UmbBlockGridEntriesElement);
@@ -262,12 +262,9 @@ let UmbPropertyEditorUIBlockListElement = class UmbPropertyEditorUIBlockListElem
262
262
  `;
263
263
  }
264
264
  #renderCreateButtonGroup() {
265
- if (this.readonly && this._layouts.length > 0) {
265
+ if (this._layouts.length > 0 && (this._limitMax === 1 || this.readonly))
266
266
  return nothing;
267
- }
268
- else {
269
- return html `<uui-button-group>${this.#renderCreateButton()}${this.#renderPasteButton()}</uui-button-group>`;
270
- }
267
+ return html `<uui-button-group>${this.#renderCreateButton()}${this.#renderPasteButton()}</uui-button-group>`;
271
268
  }
272
269
  #renderInlineCreateButton(index) {
273
270
  if (this.readonly)
@@ -261,6 +261,8 @@ export class UmbContentDetailWorkspaceContextBase extends UmbEntityDetailWorkspa
261
261
  const segments = this.structure.variesBySegment ? [] : undefined;
262
262
  const repo = new UmbDataTypeDetailRepository(this);
263
263
  const propertyTypes = await this.structure.getContentTypeProperties();
264
+ const contentTypeVariesByCulture = this.structure.getVariesByCulture();
265
+ const contentTypeVariesBySegment = this.structure.getVariesBySegment();
264
266
  const valueDefinitions = await Promise.all(propertyTypes.map(async (property) => {
265
267
  // TODO: Implement caching for data-type requests. [NL]
266
268
  const dataType = (await repo.requestByUnique(property.dataType.unique)).data;
@@ -277,8 +279,9 @@ export class UmbContentDetailWorkspaceContextBase extends UmbEntityDetailWorkspa
277
279
  propertyEditorSchemaAlias: dataType.editorAlias,
278
280
  config: dataType.values,
279
281
  typeArgs: {
280
- variesByCulture: property.variesByCulture,
281
- variesBySegment: property.variesBySegment,
282
+ // Only vary if the content type varies:
283
+ variesByCulture: contentTypeVariesByCulture ? property.variesByCulture : false,
284
+ variesBySegment: contentTypeVariesBySegment ? property.variesBySegment : false,
282
285
  },
283
286
  };
284
287
  }));
@@ -168,6 +168,8 @@ let UmbInputMultipleTextStringElement = class UmbInputMultipleTextStringElement
168
168
  #renderAddButton() {
169
169
  if (this.disabled || this.readonly)
170
170
  return nothing;
171
+ if (this.max === 1 && this._items.length > 0)
172
+ return nothing;
171
173
  return html `
172
174
  <uui-button
173
175
  color="default"
@@ -1,4 +1,5 @@
1
1
  import type { UmbIconPickerModalData, UmbIconPickerModalValue } from './icon-picker-modal.token.js';
2
+ import { nothing } from '../../../../external/lit/index.js';
2
3
  import { UmbModalBaseElement } from '../../modal/index.js';
3
4
  export declare class UmbIconPickerModalElement extends UmbModalBaseElement<UmbIconPickerModalData, UmbIconPickerModalValue> {
4
5
  #private;
@@ -9,6 +10,7 @@ export declare class UmbIconPickerModalElement extends UmbModalBaseElement<UmbIc
9
10
  constructor();
10
11
  render(): import("lit-html").TemplateResult<1>;
11
12
  renderSearch(): import("lit-html").TemplateResult<1>;
13
+ renderColors(): typeof nothing | import("lit-html").TemplateResult<1>;
12
14
  renderIcons(): unknown;
13
15
  static styles: import("lit").CSSResult[];
14
16
  }
@@ -61,23 +61,7 @@ let UmbIconPickerModalElement = class UmbIconPickerModalElement extends UmbModal
61
61
  <umb-body-layout headline=${this.localize.term('defaultdialogs_selectIcon')}>
62
62
  <div id="container">
63
63
  ${this.renderSearch()}
64
- <hr />
65
- <uui-color-swatches
66
- value=${ifDefined(this.value.color)}
67
- label=${this.localize.term('defaultdialogs_colorSwitcher')}
68
- @change=${this.#onColorChange}>
69
- ${
70
- // TODO: Missing localization for the color aliases. [NL]
71
- this._colorList.map((color) => html `
72
- <uui-color-swatch
73
- label=${color.alias}
74
- title=${color.alias}
75
- value=${color.alias}
76
- style="--uui-swatch-color: var(${color.varName})">
77
- </uui-color-swatch>
78
- `)}
79
- </uui-color-swatches>
80
- <hr />
64
+ ${this.renderColors()}
81
65
  <uui-scroll-container id="icons">
82
66
  ${this.data?.showEmptyOption && !this._isSearching
83
67
  ? html `
@@ -121,8 +105,28 @@ let UmbIconPickerModalElement = class UmbIconPickerModalElement extends UmbModal
121
105
  ${umbFocus()}>
122
106
  <uui-icon name="search" slot="prepend" id="search_icon"></uui-icon>
123
107
  </uui-input>
108
+ <hr />
124
109
  `;
125
110
  }
111
+ renderColors() {
112
+ return this.data?.hideColors === true
113
+ ? nothing
114
+ : html `<uui-color-swatches
115
+ value=${ifDefined(this.value.color)}
116
+ label=${this.localize.term('defaultdialogs_colorSwitcher')}
117
+ @change=${this.#onColorChange}>
118
+ ${this._colorList.map((color) => html `
119
+ <uui-color-swatch
120
+ label=${color.alias}
121
+ title=${color.alias}
122
+ value=${color.alias}
123
+ style="--uui-swatch-color: var(${color.varName})">
124
+ </uui-color-swatch>
125
+ `)}
126
+ </uui-color-swatches>
127
+ <hr />
128
+ `;
129
+ }
126
130
  renderIcons() {
127
131
  return this._iconsFiltered
128
132
  ? repeat(this._iconsFiltered, (icon) => icon.name, (icon) => html `
@@ -2,6 +2,7 @@ import { UmbModalToken } from '../../modal/index.js';
2
2
  export interface UmbIconPickerModalData {
3
3
  placeholder?: string;
4
4
  showEmptyOption?: boolean;
5
+ hideColors?: boolean;
5
6
  }
6
7
  export interface UmbIconPickerModalValue {
7
8
  color: string | undefined;
@@ -150,7 +150,7 @@ let UmbInputDocumentElement = class UmbInputDocumentElement extends UmbFormContr
150
150
  return html `${this.#renderItems()} ${this.#renderAddButton()}`;
151
151
  }
152
152
  #renderAddButton() {
153
- if (this.selection.length >= this.max)
153
+ if (this.selection.length > 0 && this.max === 1)
154
154
  return nothing;
155
155
  if (this.readonly && this.selection.length > 0) {
156
156
  return nothing;
@@ -299,6 +299,8 @@ let UmbInputRichMediaElement = class UmbInputRichMediaElement extends UmbFormCon
299
299
  #renderAddButton() {
300
300
  if (this.readonly)
301
301
  return nothing;
302
+ if (this.max === 1 && this._cards.length > 0)
303
+ return nothing;
302
304
  return html `
303
305
  <uui-button
304
306
  id="btn-add"
@@ -355,6 +357,8 @@ let UmbInputRichMediaElement = class UmbInputRichMediaElement extends UmbFormCon
355
357
  css `
356
358
  :host {
357
359
  position: relative;
360
+ display: block;
361
+ width: 100%;
358
362
  }
359
363
  .container {
360
364
  display: grid;
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { getMimeTypeFromExtension } from '../../components/index.js';
7
+ import { getMimeTypeFromExtension } from './utils.js';
8
8
  import { css, customElement, html, nothing, property, state } from '../../../../../external/lit/index.js';
9
9
  import { stringOrStringArrayContains } from '../../../../core/utils/index.js';
10
10
  import { UmbLitElement } from '../../../../core/lit-element/index.js';
@@ -20,9 +20,12 @@ let UmbInputUploadFieldSvgElement = class UmbInputUploadFieldSvgElement extends
20
20
  static { this.styles = [
21
21
  css `
22
22
  :host {
23
+ height: 100%;
23
24
  min-height: 240px;
24
25
  max-height: 400px;
26
+
25
27
  width: fit-content;
28
+ min-width: 240px;
26
29
  max-width: 100%;
27
30
  }
28
31
 
@@ -24,14 +24,17 @@ let UmbDropzoneMediaElement = class UmbDropzoneMediaElement extends UmbInputDrop
24
24
  getItems() {
25
25
  return this._progressItems;
26
26
  }
27
+ #dragCounter;
27
28
  constructor() {
28
29
  super();
29
30
  this.parentUnique = null;
31
+ this.#dragCounter = 0;
30
32
  this._manager = new UmbMediaDropzoneManager(this);
31
33
  this.progressItems = () => this._manager.progressItems;
32
34
  this.progress = () => this._manager.progress;
33
35
  document.addEventListener('dragenter', this.#handleDragEnter.bind(this));
34
36
  document.addEventListener('dragleave', this.#handleDragLeave.bind(this));
37
+ document.addEventListener('dragover', this.#handleDragOver.bind(this));
35
38
  document.addEventListener('drop', this.#handleDrop.bind(this));
36
39
  // TODO: Revisit this. I am not sure why it is needed to call these methods here when they are already called in the constructor of the parent class.
37
40
  // If we do not call them here, the observer will use the wrong instance of the dropzone manager (UmbDropZoneManager instead of UmbMediaDropzoneManager).
@@ -51,6 +54,7 @@ let UmbDropzoneMediaElement = class UmbDropzoneMediaElement extends UmbInputDrop
51
54
  super.disconnectedCallback();
52
55
  document.removeEventListener('dragenter', this.#handleDragEnter.bind(this));
53
56
  document.removeEventListener('dragleave', this.#handleDragLeave.bind(this));
57
+ document.removeEventListener('dragover', this.#handleDragOver.bind(this));
54
58
  document.removeEventListener('drop', this.#handleDrop.bind(this));
55
59
  }
56
60
  async onUpload(event) {
@@ -64,21 +68,31 @@ let UmbDropzoneMediaElement = class UmbDropzoneMediaElement extends UmbInputDrop
64
68
  #handleDragEnter(e) {
65
69
  if (this.disabled)
66
70
  return;
67
- // Avoid collision with UmbSorterController
68
- const types = e.dataTransfer?.types;
69
- if (!types?.length || !types?.includes('Files'))
71
+ // Normalize types for Safari
72
+ const types = Array.from(e.dataTransfer?.types || []).map((t) => t.toLowerCase());
73
+ if (!types.includes('files'))
70
74
  return;
75
+ this.#dragCounter++;
71
76
  this.toggleAttribute('dragging', true);
77
+ e.preventDefault();
78
+ }
79
+ #handleDragOver(e) {
80
+ e.preventDefault();
72
81
  }
73
82
  #handleDragLeave() {
74
83
  if (this.disabled)
75
84
  return;
76
- this.toggleAttribute('dragging', false);
85
+ this.#dragCounter--;
86
+ if (this.#dragCounter <= 0) {
87
+ this.toggleAttribute('dragging', false);
88
+ this.#dragCounter = 0;
89
+ }
77
90
  }
78
91
  #handleDrop(event) {
79
92
  event.preventDefault();
80
93
  if (this.disabled)
81
94
  return;
95
+ this.#dragCounter = 0;
82
96
  this.toggleAttribute('dragging', false);
83
97
  }
84
98
  static { this.styles = [
@@ -1,5 +1,6 @@
1
1
  import type { UmbImageCropperEditorModalData, UmbImageCropperEditorModalValue } from './image-cropper-editor-modal.token.js';
2
2
  import { UmbModalBaseElement } from '../../../../core/modal/index.js';
3
+ import '../../components/input-upload-field/file-upload-preview.element.js';
3
4
  export declare class UmbImageCropperEditorModalElement extends UmbModalBaseElement<UmbImageCropperEditorModalData<any>, UmbImageCropperEditorModalValue> {
4
5
  #private;
5
6
  private _imageCropperValue?;
@@ -12,6 +12,7 @@ import { UmbTemporaryFileConfigRepository } from '../../../../core/temporary-fil
12
12
  import { UmbTextStyles } from '../../../../core/style/index.js';
13
13
  import { UMB_MODAL_MANAGER_CONTEXT, UmbModalBaseElement } from '../../../../core/modal/index.js';
14
14
  import { UMB_WORKSPACE_MODAL } from '../../../../core/workspace/index.js';
15
+ import '../../components/input-upload-field/file-upload-preview.element.js';
15
16
  let UmbImageCropperEditorModalElement = class UmbImageCropperEditorModalElement extends UmbModalBaseElement {
16
17
  #urlRepository;
17
18
  #config;
@@ -3,10 +3,11 @@ export declare class UmbDashboardPerformanceProfilingElement extends UmbLitEleme
3
3
  #private;
4
4
  private _profilingStatus;
5
5
  private _isDebugMode;
6
+ private _isLoading;
6
7
  private _toggle;
7
- firstUpdated(): void;
8
- private _getProfilingStatus;
9
- private _changeProfilingStatus;
8
+ private _notificationContext;
9
+ constructor();
10
+ firstUpdated(): Promise<void>;
10
11
  render(): import("lit-html").TemplateResult<1>;
11
12
  static styles: import("lit").CSSResult[];
12
13
  }
@@ -5,56 +5,99 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { UmbTextStyles } from '../core/style/index.js';
8
- import { css, html, customElement, state, query, unsafeHTML } from '../../external/lit/index.js';
8
+ import { css, html, customElement, state, query, when } from '../../external/lit/index.js';
9
9
  import { UmbLitElement } from '../core/lit-element/index.js';
10
10
  import { ProfilingService } from '../core/backend-api/index.js';
11
11
  import { tryExecute } from '../core/resources/index.js';
12
+ import { UMB_NOTIFICATION_CONTEXT } from '../core/notification/index.js';
12
13
  let UmbDashboardPerformanceProfilingElement = class UmbDashboardPerformanceProfilingElement extends UmbLitElement {
13
14
  constructor() {
14
- super(...arguments);
15
+ super();
15
16
  this._profilingStatus = true;
16
17
  // TODO: Get this from the management api configuration when available
17
18
  this._isDebugMode = true;
19
+ this._isLoading = true;
20
+ this.consumeContext(UMB_NOTIFICATION_CONTEXT, (notificationContext) => {
21
+ this._notificationContext = notificationContext;
22
+ });
18
23
  }
19
24
  #setToggle(value) {
20
25
  this._toggle.checked = value;
21
26
  this._profilingStatus = value;
27
+ this._isLoading = false;
22
28
  }
23
- firstUpdated() {
24
- this._getProfilingStatus();
29
+ async firstUpdated() {
30
+ const status = await this.#getProfilingStatus();
31
+ this.#setToggle(status);
25
32
  }
26
- async _getProfilingStatus() {
33
+ async #getProfilingStatus() {
27
34
  const { data } = await tryExecute(this, ProfilingService.getProfilingStatus());
28
- if (!data)
35
+ return data?.enabled ?? false;
36
+ }
37
+ async #disableProfilingStatus() {
38
+ this._isLoading = true;
39
+ const { error } = await tryExecute(this, ProfilingService.putProfilingStatus({ body: { enabled: false } }));
40
+ if (error) {
41
+ this.#setToggle(true);
29
42
  return;
30
- this._profilingStatus = data.enabled ?? false;
43
+ }
44
+ // Test that it was actually disabled
45
+ const status = await this.#getProfilingStatus();
46
+ if (status) {
47
+ this.#setToggle(true);
48
+ this._notificationContext?.peek('warning', {
49
+ data: {
50
+ headline: this.localize.term('profiling_errorDisablingProfilerTitle'),
51
+ message: this.localize.term('profiling_errorDisablingProfilerDescription'),
52
+ },
53
+ });
54
+ return;
55
+ }
56
+ this.#setToggle(false);
31
57
  }
32
- async _changeProfilingStatus() {
33
- const { error } = await tryExecute(this, ProfilingService.putProfilingStatus({ body: { enabled: !this._profilingStatus } }));
58
+ async #enableProfilingStatus() {
59
+ this._isLoading = true;
60
+ const { error } = await tryExecute(this, ProfilingService.putProfilingStatus({ body: { enabled: true } }));
34
61
  if (error) {
35
- this.#setToggle(this._profilingStatus);
62
+ this.#setToggle(false);
63
+ return;
36
64
  }
37
- else {
38
- this.#setToggle(!this._profilingStatus);
65
+ // Test that it was actually enabled
66
+ const status = await this.#getProfilingStatus();
67
+ if (!status) {
68
+ this.#setToggle(false);
69
+ this._notificationContext?.peek('warning', {
70
+ data: {
71
+ headline: this.localize.term('profiling_errorEnablingProfilerTitle'),
72
+ message: this.localize.term('profiling_errorEnablingProfilerDescription'),
73
+ },
74
+ });
75
+ return;
39
76
  }
77
+ this.#setToggle(true);
40
78
  }
41
79
  #renderProfilingStatus() {
42
80
  return this._isDebugMode
43
81
  ? html `
44
- ${unsafeHTML(this.localize.term('profiling_performanceProfilingDescription'))}
82
+ <umb-localize key="profiling_performanceProfilingDescription"></umb-localize>
45
83
 
46
84
  <uui-toggle
47
85
  id="toggle"
48
86
  label=${this.localize.term('profiling_activateByDefault')}
49
87
  label-position="left"
50
88
  ?checked="${this._profilingStatus}"
51
- @change="${this._changeProfilingStatus}"></uui-toggle>
89
+ ?disabled="${this._isLoading}"
90
+ @change="${() => this._profilingStatus ? this.#disableProfilingStatus() : this.#enableProfilingStatus()}"></uui-toggle>
91
+
92
+ ${when(this._isLoading, () => html `<uui-loader-circle></uui-loader-circle>`)}
52
93
 
53
- <h4>${this.localize.term('profiling_reminder')}</h4>
94
+ <h4>
95
+ <umb-localize key="profiling_reminder"></umb-localize>
96
+ </h4>
54
97
 
55
- ${unsafeHTML(this.localize.term('profiling_reminderDescription'))}
98
+ <umb-localize key="profiling_reminderDescription"></umb-localize>
56
99
  `
57
- : html ` ${unsafeHTML(this.localize.term('profiling_profilerEnabledDescription'))} `;
100
+ : html `<umb-localize key="profiling_profilerEnabledDescription"></umb-localize>`;
58
101
  }
59
102
  render() {
60
103
  return html `
@@ -93,6 +136,9 @@ __decorate([
93
136
  __decorate([
94
137
  state()
95
138
  ], UmbDashboardPerformanceProfilingElement.prototype, "_isDebugMode", void 0);
139
+ __decorate([
140
+ state()
141
+ ], UmbDashboardPerformanceProfilingElement.prototype, "_isLoading", void 0);
96
142
  __decorate([
97
143
  query('#toggle')
98
144
  ], UmbDashboardPerformanceProfilingElement.prototype, "_toggle", void 0);
@@ -16,6 +16,12 @@ export const manifests = [
16
16
  description: 'Icon name to show when no icon is selected',
17
17
  propertyEditorUiAlias: 'Umb.PropertyEditorUi.IconPicker',
18
18
  },
19
+ {
20
+ alias: 'hideColors',
21
+ label: 'Hide colors',
22
+ description: 'Hide color swatches from modal',
23
+ propertyEditorUiAlias: 'Umb.PropertyEditorUi.Toggle',
24
+ },
19
25
  ],
20
26
  },
21
27
  },
@@ -12,6 +12,7 @@ export declare class UmbPropertyEditorUIIconPickerElement extends UmbPropertyEdi
12
12
  private _icon;
13
13
  private _color;
14
14
  private _placeholderIcon;
15
+ private _hideColors;
15
16
  set config(config: UmbPropertyEditorConfigCollection | undefined);
16
17
  private _openModal;
17
18
  render(): import("lit-html").TemplateResult<1>;
@@ -21,6 +21,7 @@ let UmbPropertyEditorUIIconPickerElement = class UmbPropertyEditorUIIconPickerEl
21
21
  this._icon = '';
22
22
  this._color = '';
23
23
  this._placeholderIcon = '';
24
+ this._hideColors = false;
24
25
  }
25
26
  firstUpdated() {
26
27
  this.addValidator('valueMissing', () => 'Icon is required', () => this.mandatory && !this._icon);
@@ -46,6 +47,7 @@ let UmbPropertyEditorUIIconPickerElement = class UmbPropertyEditorUIIconPickerEl
46
47
  return;
47
48
  const placeholder = config.getValueByAlias('placeholder');
48
49
  this._placeholderIcon = typeof placeholder === 'string' ? placeholder : '';
50
+ this._hideColors = config.getValueByAlias('hideColors');
49
51
  }
50
52
  async _openModal() {
51
53
  const data = await umbOpenModal(this, UMB_ICON_PICKER_MODAL, {
@@ -53,7 +55,7 @@ let UmbPropertyEditorUIIconPickerElement = class UmbPropertyEditorUIIconPickerEl
53
55
  icon: this._icon,
54
56
  color: this._color,
55
57
  },
56
- data: { placeholder: this._placeholderIcon, showEmptyOption: !this.mandatory },
58
+ data: { placeholder: this._placeholderIcon, showEmptyOption: !this.mandatory, hideColors: this._hideColors },
57
59
  }).catch(() => undefined);
58
60
  if (!data)
59
61
  return;
@@ -102,6 +104,9 @@ __decorate([
102
104
  __decorate([
103
105
  state()
104
106
  ], UmbPropertyEditorUIIconPickerElement.prototype, "_placeholderIcon", void 0);
107
+ __decorate([
108
+ state()
109
+ ], UmbPropertyEditorUIIconPickerElement.prototype, "_hideColors", void 0);
105
110
  UmbPropertyEditorUIIconPickerElement = __decorate([
106
111
  customElement('umb-property-editor-ui-icon-picker')
107
112
  ], UmbPropertyEditorUIIconPickerElement);