|
|
|
@ -37,17 +37,19 @@ import { AbstractControl, UntypedFormGroup } from '@angular/forms'; |
|
|
|
import { Observable } from 'rxjs'; |
|
|
|
import { Dashboard } from '@shared/models/dashboard.models'; |
|
|
|
import { IAliasController } from '@core/api/widget-api.models'; |
|
|
|
import { isNotEmptyStr, mergeDeepIgnoreArray } from '@core/utils'; |
|
|
|
import { isNotEmptyStr, mergeDeep, mergeDeepIgnoreArray } from '@core/utils'; |
|
|
|
import { WidgetConfigComponentData } from '@home/models/widget-component.models'; |
|
|
|
import { ComponentStyle, Font, TimewindowStyle } from '@shared/models/widget-settings.models'; |
|
|
|
import { NULL_UUID } from '@shared/models/id/has-uuid'; |
|
|
|
import { EntityInfoData, HasTenantId, HasVersion } from '@shared/models/entity.models'; |
|
|
|
import { DataKeysCallbacks, DataKeySettingsFunction } from '@home/components/widget/lib/settings/common/key/data-keys.component.models'; |
|
|
|
import { |
|
|
|
DataKeysCallbacks, |
|
|
|
DataKeySettingsFunction |
|
|
|
} from '@home/components/widget/lib/settings/common/key/data-keys.component.models'; |
|
|
|
import { WidgetConfigCallbacks } from '@home/components/widget/config/widget-config.component.models'; |
|
|
|
import { TbFunction } from '@shared/models/js-function.models'; |
|
|
|
import { FormProperty, jsonFormSchemaToFormProperties } from '@shared/models/dynamic-form.models'; |
|
|
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; |
|
|
|
import { Device } from '@shared/models/device.models'; |
|
|
|
|
|
|
|
export enum widgetType { |
|
|
|
timeseries = 'timeseries', |
|
|
|
@ -1000,9 +1002,9 @@ export abstract class WidgetSettingsComponent extends PageComponent implements |
|
|
|
|
|
|
|
set settings(value: WidgetSettings) { |
|
|
|
if (!value) { |
|
|
|
this.settingsValue = this.defaultSettings(); |
|
|
|
this.settingsValue = mergeDeep({}, this.defaultSettings()); |
|
|
|
} else { |
|
|
|
this.settingsValue = mergeDeepIgnoreArray(this.defaultSettings(), value); |
|
|
|
this.settingsValue = mergeDeepIgnoreArray({}, this.defaultSettings(), value); |
|
|
|
} |
|
|
|
if (!this.settingsSet) { |
|
|
|
this.settingsSet = true; |
|
|
|
|