@c8y/ngx-components 1023.80.0 → 1023.81.2
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.
- package/datapoint-explorer/view/index.d.ts +1 -0
- package/datapoint-explorer/view/index.d.ts.map +1 -1
- package/echart/index.d.ts +2 -1
- package/echart/index.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +10 -2
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart.mjs +26 -14
- package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-global-context.mjs +23 -3
- package/fesm2022/c8y-ngx-components-global-context.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-static-assets-data.mjs +9 -5
- package/fesm2022/c8y-ngx-components-static-assets-data.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-asset-table.mjs +17 -10
- package/fesm2022/c8y-ngx-components-widgets-implementations-asset-table.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +11 -3
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-list.mjs +47 -8
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +83 -63
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/global-context/index.d.ts +17 -2
- package/global-context/index.d.ts.map +1 -1
- package/index.d.ts +33 -29
- package/index.d.ts.map +1 -1
- package/locales/de.po +3 -0
- package/locales/es.po +3 -0
- package/locales/fr.po +3 -0
- package/locales/ja_JP.po +3 -0
- package/locales/ko.po +3 -0
- package/locales/nl.po +3 -0
- package/locales/pl.po +3 -0
- package/locales/pt_BR.po +3 -0
- package/locales/zh_CN.po +3 -0
- package/locales/zh_TW.po +3 -0
- package/package.json +1 -1
- package/static-assets/data/index.d.ts.map +1 -1
- package/widgets/implementations/asset-table/index.d.ts.map +1 -1
- package/widgets/implementations/datapoints-graph/index.d.ts +1 -0
- package/widgets/implementations/datapoints-graph/index.d.ts.map +1 -1
- package/widgets/implementations/datapoints-list/index.d.ts +5 -0
- package/widgets/implementations/datapoints-list/index.d.ts.map +1 -1
|
@@ -1560,20 +1560,23 @@ class WidgetConfigMigrationService {
|
|
|
1560
1560
|
* // }
|
|
1561
1561
|
* ```
|
|
1562
1562
|
*/
|
|
1563
|
-
migrateWidgetConfig(config) {
|
|
1563
|
+
migrateWidgetConfig(config, options) {
|
|
1564
1564
|
// Guard: Handle invalid config
|
|
1565
1565
|
if (!config) {
|
|
1566
1566
|
return config;
|
|
1567
1567
|
}
|
|
1568
1568
|
// Cast to unknown first, then to our working type
|
|
1569
|
-
const
|
|
1569
|
+
const rawConfig = config;
|
|
1570
|
+
const configObj = options?.legacyTimeContextDefaults && this.hasNoTimeContextFields(rawConfig)
|
|
1571
|
+
? { ...rawConfig, ...options.legacyTimeContextDefaults }
|
|
1572
|
+
: rawConfig;
|
|
1570
1573
|
// Check if already has valid new format (minimal check)
|
|
1571
1574
|
const hasValidDisplayMode = typeof configObj.displayMode === 'string' && this.isValidDisplayMode(configObj.displayMode);
|
|
1572
1575
|
const hasValidRefreshOption = typeof configObj.refreshOption === 'string' &&
|
|
1573
1576
|
this.isValidRefreshOption(configObj.refreshOption);
|
|
1574
1577
|
// If has basic valid format and no legacy fields needing migration, return as is
|
|
1575
1578
|
if (hasValidDisplayMode && hasValidRefreshOption && !this.hasLegacyFields(configObj)) {
|
|
1576
|
-
return
|
|
1579
|
+
return configObj;
|
|
1577
1580
|
}
|
|
1578
1581
|
// Extract settings from all levels (including nested) for migration decisions
|
|
1579
1582
|
const settingsForMigration = this.extractGlobalContextSettings(configObj);
|
|
@@ -1583,6 +1586,23 @@ class WidgetConfigMigrationService {
|
|
|
1583
1586
|
this.applyGlobalContextProperties(flatConfig, settingsForMigration);
|
|
1584
1587
|
return flatConfig;
|
|
1585
1588
|
}
|
|
1589
|
+
/**
|
|
1590
|
+
* True when a config carries neither the new `dateTimeContext` nor any legacy time
|
|
1591
|
+
* field (`dateFrom`, `dateTo`, `dateFilter`, `date`, `interval`). Use to decide
|
|
1592
|
+
* whether widget-specific legacy defaults should be applied.
|
|
1593
|
+
*/
|
|
1594
|
+
hasNoTimeContextFields(config) {
|
|
1595
|
+
if (!config) {
|
|
1596
|
+
return false;
|
|
1597
|
+
}
|
|
1598
|
+
const raw = config;
|
|
1599
|
+
return (!raw['dateTimeContext'] &&
|
|
1600
|
+
!raw['dateFrom'] &&
|
|
1601
|
+
!raw['dateTo'] &&
|
|
1602
|
+
!raw['dateFilter'] &&
|
|
1603
|
+
!raw['date'] &&
|
|
1604
|
+
!raw['interval']);
|
|
1605
|
+
}
|
|
1586
1606
|
/**
|
|
1587
1607
|
* Creates a flattened configuration by excluding nested configuration objects.
|
|
1588
1608
|
*
|