@kirbydesign/designsystem 5.0.2 → 5.0.6
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/bundles/kirbydesign-designsystem-testing-base.umd.js +86 -37
- package/bundles/kirbydesign-designsystem-testing-base.umd.js.map +1 -1
- package/bundles/kirbydesign-designsystem-testing-base.umd.min.js +1 -1
- package/bundles/kirbydesign-designsystem-testing-base.umd.min.js.map +1 -1
- package/bundles/kirbydesign-designsystem.umd.js +586 -46
- package/bundles/kirbydesign-designsystem.umd.js.map +1 -1
- package/bundles/kirbydesign-designsystem.umd.min.js +1 -1
- package/bundles/kirbydesign-designsystem.umd.min.js.map +1 -1
- package/esm2015/kirbydesign-designsystem.js +15 -13
- package/esm2015/kirbydesign-designsystem.metadata.json +1 -1
- package/esm2015/lib/components/chart/chart-js/chart-js.service.js +137 -19
- package/esm2015/lib/components/chart/chart-js/chart-js.service.metadata.json +1 -1
- package/esm2015/lib/components/chart/chart-js/chartjs-plugin-marker/chartjs-plugin-marker.js +203 -0
- package/esm2015/lib/components/chart/chart-js/chartjs-plugin-marker/chartjs-plugin-marker.metadata.json +1 -0
- package/esm2015/lib/components/chart/chart-js/configured-chart-js.js +5 -3
- package/esm2015/lib/components/chart/chart-js/configured-chart-js.metadata.json +1 -1
- package/esm2015/lib/components/chart/chart.component.js +3 -1
- package/esm2015/lib/components/chart/chart.component.metadata.json +1 -1
- package/esm2015/lib/components/chart/chart.types.js +1 -1
- package/esm2015/lib/components/chart/chart.types.metadata.json +1 -1
- package/esm2015/lib/components/chart/configs/global-defaults.config.js +7 -1
- package/esm2015/lib/components/chart/configs/type.config.js +118 -1
- package/esm2015/lib/components/chart/configs/type.config.metadata.json +1 -1
- package/esm2015/lib/components/index.js +4 -1
- package/esm2015/lib/components/index.metadata.json +1 -1
- package/esm2015/lib/components/item/label/label.component.js +1 -1
- package/esm2015/lib/components/item/label/label.component.metadata.json +1 -1
- package/esm2015/lib/components/item-sliding/index.js +3 -0
- package/esm2015/lib/components/item-sliding/index.metadata.json +1 -0
- package/esm2015/lib/components/item-sliding/item-sliding.component.js +27 -0
- package/esm2015/lib/components/item-sliding/item-sliding.component.metadata.json +1 -0
- package/esm2015/lib/components/item-sliding/item-sliding.types.js +2 -0
- package/esm2015/lib/components/item-sliding/item-sliding.types.metadata.json +1 -0
- package/esm2015/lib/components/list/list-experimental/list-experimental.component.js +13 -2
- package/esm2015/lib/components/list/list-experimental/list-experimental.component.metadata.json +1 -1
- package/esm2015/lib/components/list/list-item/list-item.component.js +1 -1
- package/esm2015/lib/components/list/list-item/list-item.component.metadata.json +1 -1
- package/esm2015/lib/components/list/list-swipe-action.type.js +1 -1
- package/esm2015/lib/components/list/list-swipe-action.type.metadata.json +1 -1
- package/esm2015/lib/components/list/list.component.js +1 -1
- package/esm2015/lib/components/list/list.component.metadata.json +1 -1
- package/esm2015/lib/components/section-header/section-header.component.js +11 -0
- package/esm2015/lib/components/section-header/section-header.component.metadata.json +1 -0
- package/esm2015/lib/helpers/deep-copy.js +11 -2
- package/esm2015/lib/helpers/deep-copy.metadata.json +1 -1
- package/esm2015/lib/helpers/element-has-ancestor.js +24 -0
- package/esm2015/lib/helpers/element-has-ancestor.metadata.json +1 -0
- package/esm2015/lib/helpers/index.js +2 -1
- package/esm2015/lib/helpers/index.metadata.json +1 -1
- package/esm2015/lib/kirby.module.js +5 -1
- package/esm2015/lib/kirby.module.metadata.json +1 -1
- package/esm2015/testing-base/kirbydesign-designsystem-testing-base.js +32 -30
- package/esm2015/testing-base/kirbydesign-designsystem-testing-base.metadata.json +1 -1
- package/esm2015/testing-base/lib/components/mock.chart.component.js +2 -1
- package/esm2015/testing-base/lib/components/mock.chart.component.metadata.json +1 -1
- package/esm2015/testing-base/lib/components/mock.item-sliding.component.js +23 -0
- package/esm2015/testing-base/lib/components/mock.item-sliding.component.metadata.json +1 -0
- package/esm2015/testing-base/lib/components/mock.section-header.component.js +19 -0
- package/esm2015/testing-base/lib/components/mock.section-header.component.metadata.json +1 -0
- package/esm2015/testing-base/lib/mock-components.js +5 -1
- package/esm2015/testing-base/lib/mock-components.metadata.json +1 -1
- package/fesm2015/kirbydesign-designsystem-testing-base.js +43 -2
- package/fesm2015/kirbydesign-designsystem-testing-base.js.map +1 -1
- package/fesm2015/kirbydesign-designsystem.js +551 -29
- package/fesm2015/kirbydesign-designsystem.js.map +1 -1
- package/kirbydesign-designsystem.d.ts +14 -12
- package/kirbydesign-designsystem.metadata.json +1 -1
- package/lib/components/chart/chart-js/chart-js.service.d.ts +17 -1
- package/lib/components/chart/chart-js/chartjs-plugin-marker/chartjs-plugin-marker.d.ts +14 -0
- package/lib/components/chart/chart.component.d.ts +2 -1
- package/lib/components/chart/chart.types.d.ts +9 -1
- package/lib/components/chart/configs/global-defaults.config.d.ts +6 -0
- package/lib/components/index.d.ts +3 -0
- package/lib/components/item-sliding/index.d.ts +2 -0
- package/lib/components/item-sliding/item-sliding.component.d.ts +7 -0
- package/lib/components/item-sliding/item-sliding.types.d.ts +10 -0
- package/lib/components/list/list-experimental/list-experimental.component.d.ts +3 -0
- package/lib/components/list/list-swipe-action.type.d.ts +8 -9
- package/lib/components/section-header/section-header.component.d.ts +2 -0
- package/lib/helpers/deep-copy.d.ts +9 -1
- package/lib/helpers/element-has-ancestor.d.ts +1 -0
- package/lib/helpers/index.d.ts +1 -0
- package/package.json +6 -3
- package/scss/_global-styles.scss +4 -0
- package/testing-base/kirbydesign-designsystem-testing-base.d.ts +31 -29
- package/testing-base/kirbydesign-designsystem-testing-base.metadata.json +1 -1
- package/testing-base/lib/components/mock.chart.component.d.ts +2 -1
- package/testing-base/lib/components/mock.item-sliding.component.d.ts +5 -0
- package/testing-base/lib/components/mock.section-header.component.d.ts +2 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@kirbydesign/core'), require('@angular/core'), require('@ionic/angular'), require('@angular/router'), require('rxjs'), require('rxjs/operators'), require('@angular/common'), require('highcharts'), require('chart.js'), require('chartjs-plugin-annotation'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@kirbydesign/designsystem', ['exports', '@kirbydesign/core', '@angular/core', '@ionic/angular', '@angular/router', 'rxjs', 'rxjs/operators', '@angular/common', 'highcharts', 'chart.js', 'chartjs-plugin-annotation', 'highcharts/highstock', 'highcharts/modules/annotations', 'date-fns
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.kirbydesign = global.kirbydesign || {}, global.kirbydesign.designsystem = {}), global.core, global.ng.core, global.ionic, global.ng.router, global.rxjs, global.rxjs.operators, global.ng.common, global.highcharts, global.chart_js, global.annotationPlugin, global['highcharts/highstock'], global.highcharts, global['date-fns
|
|
5
|
-
}(this, (function (exports, core, i0, i1, i1$1, rxjs, operators, common, Highcharts, chart_js, annotationPlugin, Highcharts$1, AnnotationsModule,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@kirbydesign/core'), require('@angular/core'), require('@ionic/angular'), require('@angular/router'), require('rxjs'), require('rxjs/operators'), require('@angular/common'), require('highcharts'), require('date-fns'), require('ts-deepcopy'), require('chart.js'), require('chartjs-plugin-annotation'), require('chartjs-plugin-datalabels'), require('chart.js/helpers'), require('highcharts/highstock'), require('highcharts/modules/annotations'), require('date-fns-tz'), require('date-fns/locale'), require('@angular/forms'), require('inputmask/lib/extensions/inputmask.date.extensions'), require('inputmask/lib/inputmask'), require('inputmask/lib/extensions/inputmask.numeric.extensions'), require('@angular/animations'), require('@kirbydesign/core/loader')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@kirbydesign/designsystem', ['exports', '@kirbydesign/core', '@angular/core', '@ionic/angular', '@angular/router', 'rxjs', 'rxjs/operators', '@angular/common', 'highcharts', 'date-fns', 'ts-deepcopy', 'chart.js', 'chartjs-plugin-annotation', 'chartjs-plugin-datalabels', 'chart.js/helpers', 'highcharts/highstock', 'highcharts/modules/annotations', 'date-fns-tz', 'date-fns/locale', '@angular/forms', 'inputmask/lib/extensions/inputmask.date.extensions', 'inputmask/lib/inputmask', 'inputmask/lib/extensions/inputmask.numeric.extensions', '@angular/animations', '@kirbydesign/core/loader'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.kirbydesign = global.kirbydesign || {}, global.kirbydesign.designsystem = {}), global.core, global.ng.core, global.ionic, global.ng.router, global.rxjs, global.rxjs.operators, global.ng.common, global.highcharts, global['date-fns'], global._deepCopy, global.chart_js, global.annotationPlugin, global.ChartDataLabels, global.helpers, global['highcharts/highstock'], global.highcharts, global['date-fns-tz'], global.locale, global.ng.forms, null, global.inputmask, null, global.ng.animations, global.loader));
|
|
5
|
+
}(this, (function (exports, core, i0, i1, i1$1, rxjs, operators, common, Highcharts, dateFns, _deepCopy, chart_js, annotationPlugin, ChartDataLabels, helpers, Highcharts$1, AnnotationsModule, dateFnsTz, locale, forms, inputmask_date_extensions, Inputmask, inputmask_numeric_extensions, animations, loader) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -27,7 +27,9 @@
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
var Highcharts__namespace = /*#__PURE__*/_interopNamespace(Highcharts);
|
|
30
|
+
var _deepCopy__default = /*#__PURE__*/_interopDefaultLegacy(_deepCopy);
|
|
30
31
|
var annotationPlugin__default = /*#__PURE__*/_interopDefaultLegacy(annotationPlugin);
|
|
32
|
+
var ChartDataLabels__default = /*#__PURE__*/_interopDefaultLegacy(ChartDataLabels);
|
|
31
33
|
var Highcharts__namespace$1 = /*#__PURE__*/_interopNamespace(Highcharts$1);
|
|
32
34
|
var AnnotationsModule__default = /*#__PURE__*/_interopDefaultLegacy(AnnotationsModule);
|
|
33
35
|
var Inputmask__default = /*#__PURE__*/_interopDefaultLegacy(Inputmask);
|
|
@@ -3845,10 +3847,42 @@
|
|
|
3845
3847
|
cssClass: [{ type: i0.Input }]
|
|
3846
3848
|
};
|
|
3847
3849
|
|
|
3850
|
+
/**
|
|
3851
|
+
* Do a deep copy of object that supports the composite data type Function
|
|
3852
|
+
*
|
|
3853
|
+
* @see https://stackoverflow.com/questions/122102/what-is-the-most-efficient-way-to-deep-clone-an-object-in-javascript#answer-122704
|
|
3854
|
+
*
|
|
3855
|
+
* @param obj
|
|
3856
|
+
* @returns obj
|
|
3857
|
+
*/
|
|
3848
3858
|
function deepCopy(obj) {
|
|
3849
|
-
return
|
|
3859
|
+
return _deepCopy__default['default'](obj);
|
|
3850
3860
|
}
|
|
3851
3861
|
|
|
3862
|
+
/*
|
|
3863
|
+
Utility function to check if a given element
|
|
3864
|
+
has an ancestor with a specific node name.
|
|
3865
|
+
|
|
3866
|
+
Can be given a 'stopNodeName' to limit the search
|
|
3867
|
+
as to not climb all the way up through the DOM tree.
|
|
3868
|
+
|
|
3869
|
+
Returns true when element has the ancestorNodeName
|
|
3870
|
+
or an ancestor has the ancestorNodeName.
|
|
3871
|
+
|
|
3872
|
+
Returns false otherwise.
|
|
3873
|
+
*/
|
|
3874
|
+
var elementHasAncestor = function (element, ancestorNodeName, stopNodeName) {
|
|
3875
|
+
switch (element === null || element === void 0 ? void 0 : element.nodeName) {
|
|
3876
|
+
case undefined:
|
|
3877
|
+
case stopNodeName === null || stopNodeName === void 0 ? void 0 : stopNodeName.toUpperCase():
|
|
3878
|
+
return false;
|
|
3879
|
+
case ancestorNodeName.toUpperCase():
|
|
3880
|
+
return true;
|
|
3881
|
+
default:
|
|
3882
|
+
return elementHasAncestor(element.parentElement, ancestorNodeName, stopNodeName);
|
|
3883
|
+
}
|
|
3884
|
+
};
|
|
3885
|
+
|
|
3852
3886
|
// re-export helpers from core, to preserve backwards compatability
|
|
3853
3887
|
|
|
3854
3888
|
var getThemeColorHexString = core.ColorHelper.getThemeColorHexString;
|
|
@@ -3898,6 +3932,13 @@
|
|
|
3898
3932
|
|
|
3899
3933
|
var fontSize$2 = core.DesignTokenHelper.fontSize;
|
|
3900
3934
|
var getThemeColorHexString$1 = core.ColorHelper.getThemeColorHexString, getThemeColorRgbString = core.ColorHelper.getThemeColorRgbString;
|
|
3935
|
+
/**
|
|
3936
|
+
* A filter to read a chartpoint from a Chart.js point context (used for chartdata points). Context is provided by Chart.js.
|
|
3937
|
+
*/
|
|
3938
|
+
var getChartPointFromContext = function (context) {
|
|
3939
|
+
return context.dataset.data[context.dataIndex];
|
|
3940
|
+
};
|
|
3941
|
+
var ɵ0$6 = getChartPointFromContext;
|
|
3901
3942
|
var CHART_TYPES_CONFIG = {
|
|
3902
3943
|
bar: {
|
|
3903
3944
|
type: 'bar',
|
|
@@ -3992,6 +4033,115 @@
|
|
|
3992
4033
|
},
|
|
3993
4034
|
},
|
|
3994
4035
|
},
|
|
4036
|
+
stock: {
|
|
4037
|
+
type: 'line',
|
|
4038
|
+
options: {
|
|
4039
|
+
responsive: true,
|
|
4040
|
+
animation: {
|
|
4041
|
+
duration: 0,
|
|
4042
|
+
},
|
|
4043
|
+
layout: {
|
|
4044
|
+
padding: {
|
|
4045
|
+
left: 20,
|
|
4046
|
+
right: 20,
|
|
4047
|
+
top: 30,
|
|
4048
|
+
bottom: 0,
|
|
4049
|
+
},
|
|
4050
|
+
},
|
|
4051
|
+
backgroundColor: getThemeColorRgbString('semi-light', 0.5),
|
|
4052
|
+
scales: {
|
|
4053
|
+
x: {
|
|
4054
|
+
grid: {
|
|
4055
|
+
lineWidth: 0,
|
|
4056
|
+
},
|
|
4057
|
+
ticks: {
|
|
4058
|
+
maxRotation: 0,
|
|
4059
|
+
autoSkipPadding: 120,
|
|
4060
|
+
font: {
|
|
4061
|
+
size: parseInt(fontSize$2('xs')),
|
|
4062
|
+
},
|
|
4063
|
+
},
|
|
4064
|
+
},
|
|
4065
|
+
y: {
|
|
4066
|
+
position: 'right',
|
|
4067
|
+
display: true,
|
|
4068
|
+
grid: {
|
|
4069
|
+
drawBorder: false,
|
|
4070
|
+
},
|
|
4071
|
+
ticks: {
|
|
4072
|
+
display: true,
|
|
4073
|
+
font: {
|
|
4074
|
+
size: parseInt(fontSize$2('xs')),
|
|
4075
|
+
},
|
|
4076
|
+
},
|
|
4077
|
+
},
|
|
4078
|
+
},
|
|
4079
|
+
elements: {
|
|
4080
|
+
line: {
|
|
4081
|
+
tension: 0,
|
|
4082
|
+
borderWidth: 2,
|
|
4083
|
+
},
|
|
4084
|
+
point: {
|
|
4085
|
+
hitRadius: 20,
|
|
4086
|
+
radius: 0,
|
|
4087
|
+
hoverRadius: 0,
|
|
4088
|
+
hoverBorderWidth: 0,
|
|
4089
|
+
},
|
|
4090
|
+
},
|
|
4091
|
+
normalized: true,
|
|
4092
|
+
plugins: {
|
|
4093
|
+
tooltip: {
|
|
4094
|
+
padding: 10,
|
|
4095
|
+
enabled: true,
|
|
4096
|
+
mode: 'index',
|
|
4097
|
+
intersect: false,
|
|
4098
|
+
backgroundColor: getThemeColorHexString$1('semi-light'),
|
|
4099
|
+
titleColor: getThemeColorHexString$1('semi-light-contrast'),
|
|
4100
|
+
bodyColor: getThemeColorHexString$1('semi-light-contrast'),
|
|
4101
|
+
caretSize: 0,
|
|
4102
|
+
bodySpacing: 5,
|
|
4103
|
+
titleSpacing: 5,
|
|
4104
|
+
borderColor: 'transparent',
|
|
4105
|
+
callbacks: {
|
|
4106
|
+
labelColor: function (tooltipItem) {
|
|
4107
|
+
return {
|
|
4108
|
+
backgroundColor: tooltipItem.dataset.borderColor,
|
|
4109
|
+
};
|
|
4110
|
+
},
|
|
4111
|
+
},
|
|
4112
|
+
},
|
|
4113
|
+
// A failed attempt to get local typings working.
|
|
4114
|
+
// The chartjs-plugin-marker is rewritten to not
|
|
4115
|
+
// having to rely on own plugin settings, but using
|
|
4116
|
+
// x-axis type time instead.
|
|
4117
|
+
// @todo candidate for refactor once solved.
|
|
4118
|
+
// marker: {
|
|
4119
|
+
// line: {
|
|
4120
|
+
// color: getThemeColorHexString('black-base'),
|
|
4121
|
+
// }
|
|
4122
|
+
// },
|
|
4123
|
+
datalabels: {
|
|
4124
|
+
backgroundColor: function (context) { return context.dataset.borderColor; },
|
|
4125
|
+
color: getThemeColorHexString$1('white'),
|
|
4126
|
+
borderRadius: 3,
|
|
4127
|
+
font: {
|
|
4128
|
+
lineHeight: 1,
|
|
4129
|
+
size: parseInt(fontSize$2('xs')),
|
|
4130
|
+
},
|
|
4131
|
+
padding: {
|
|
4132
|
+
top: 6,
|
|
4133
|
+
left: 5,
|
|
4134
|
+
right: 5,
|
|
4135
|
+
bottom: 5,
|
|
4136
|
+
},
|
|
4137
|
+
offset: 5,
|
|
4138
|
+
align: function (context) { var _a; return (_a = getChartPointFromContext(context)) === null || _a === void 0 ? void 0 : _a.datalabel.position; },
|
|
4139
|
+
display: function (context) { var _a; return !!((_a = getChartPointFromContext(context)) === null || _a === void 0 ? void 0 : _a.datalabel); },
|
|
4140
|
+
formatter: function (value) { return value.datalabel.value; },
|
|
4141
|
+
},
|
|
4142
|
+
},
|
|
4143
|
+
},
|
|
4144
|
+
},
|
|
3995
4145
|
};
|
|
3996
4146
|
|
|
3997
4147
|
var ChartConfigService = /** @class */ (function () {
|
|
@@ -4020,6 +4170,205 @@
|
|
|
4020
4170
|
{ type: i0.Injectable }
|
|
4021
4171
|
];
|
|
4022
4172
|
|
|
4173
|
+
// The marker pluin was heavily inspired by https://chartjs-plugin-crosshair.netlify.app
|
|
4174
|
+
var defaultOptions = {
|
|
4175
|
+
line: {
|
|
4176
|
+
color: 'black',
|
|
4177
|
+
width: 1,
|
|
4178
|
+
dashPattern: [],
|
|
4179
|
+
},
|
|
4180
|
+
snap: {
|
|
4181
|
+
enabled: false,
|
|
4182
|
+
},
|
|
4183
|
+
};
|
|
4184
|
+
var hasMarkerConfiguration = function (chart) {
|
|
4185
|
+
var _a, _b, _c;
|
|
4186
|
+
// using another plugins options is not ideal, so the issue with marker plugin
|
|
4187
|
+
// should be resolved. As of right now the only chart that uses
|
|
4188
|
+
// tooltip is stock charts.
|
|
4189
|
+
return chart.config.options.scales.x && ((_c = (_b = (_a = chart.config.options) === null || _a === void 0 ? void 0 : _a.plugins) === null || _b === void 0 ? void 0 : _b.tooltip) === null || _c === void 0 ? void 0 : _c.enabled);
|
|
4190
|
+
// @todo when resolving the typings issue with the markerplugin,
|
|
4191
|
+
// this is a better conditional.
|
|
4192
|
+
// return chart.config.options.scales.x && chart.config.options.plugins.marker
|
|
4193
|
+
};
|
|
4194
|
+
var ɵ0$7 = hasMarkerConfiguration;
|
|
4195
|
+
var MarkerPlugin = {
|
|
4196
|
+
id: 'marker',
|
|
4197
|
+
afterInit: function (chart) {
|
|
4198
|
+
if (!hasMarkerConfiguration(chart)) {
|
|
4199
|
+
return;
|
|
4200
|
+
}
|
|
4201
|
+
var xScaleType = chart.config.options.scales.x.type;
|
|
4202
|
+
if (xScaleType !== 'linear' &&
|
|
4203
|
+
xScaleType !== 'time' &&
|
|
4204
|
+
xScaleType !== 'category' &&
|
|
4205
|
+
xScaleType !== 'logarithmic') {
|
|
4206
|
+
return;
|
|
4207
|
+
}
|
|
4208
|
+
if (chart.options.plugins.marker === undefined) {
|
|
4209
|
+
chart.options.plugins.marker = defaultOptions;
|
|
4210
|
+
}
|
|
4211
|
+
chart.marker = {
|
|
4212
|
+
enabled: false,
|
|
4213
|
+
suppressUpdate: false,
|
|
4214
|
+
x: null,
|
|
4215
|
+
originalData: [],
|
|
4216
|
+
originalXRange: {},
|
|
4217
|
+
dragStarted: false,
|
|
4218
|
+
dragStartX: null,
|
|
4219
|
+
dragEndX: null,
|
|
4220
|
+
suppressTooltips: false,
|
|
4221
|
+
ignoreNextEvents: 0,
|
|
4222
|
+
};
|
|
4223
|
+
},
|
|
4224
|
+
getOption: function (chart, category, name) {
|
|
4225
|
+
return helpers.valueOrDefault(chart.options.plugins.marker[category]
|
|
4226
|
+
? chart.options.plugins.marker[category][name]
|
|
4227
|
+
: undefined, defaultOptions[category][name]);
|
|
4228
|
+
},
|
|
4229
|
+
getXScale: function (chart) {
|
|
4230
|
+
return chart.data.datasets.length ? chart.scales[chart.getDatasetMeta(0).xAxisID] : null;
|
|
4231
|
+
},
|
|
4232
|
+
getYScale: function (chart) {
|
|
4233
|
+
return chart.scales[chart.getDatasetMeta(0).yAxisID];
|
|
4234
|
+
},
|
|
4235
|
+
afterEvent: function (chart, event) {
|
|
4236
|
+
if (!hasMarkerConfiguration(chart)) {
|
|
4237
|
+
return;
|
|
4238
|
+
}
|
|
4239
|
+
if (chart.config.options.scales.x.length == 0) {
|
|
4240
|
+
return;
|
|
4241
|
+
}
|
|
4242
|
+
var e = event.event;
|
|
4243
|
+
var xScaleType = chart.config.options.scales.x.type;
|
|
4244
|
+
if (xScaleType !== 'linear' &&
|
|
4245
|
+
xScaleType !== 'time' &&
|
|
4246
|
+
xScaleType !== 'category' &&
|
|
4247
|
+
xScaleType !== 'logarithmic') {
|
|
4248
|
+
return;
|
|
4249
|
+
}
|
|
4250
|
+
var xScale = this.getXScale(chart);
|
|
4251
|
+
if (!xScale) {
|
|
4252
|
+
return;
|
|
4253
|
+
}
|
|
4254
|
+
if (chart.marker.ignoreNextEvents > 0) {
|
|
4255
|
+
chart.marker.ignoreNextEvents -= 1;
|
|
4256
|
+
return;
|
|
4257
|
+
}
|
|
4258
|
+
// fix for Safari
|
|
4259
|
+
var buttons = e.native.buttons === undefined ? e.native.which : e.native.buttons;
|
|
4260
|
+
if (e.native.type === 'mouseup') {
|
|
4261
|
+
buttons = 0;
|
|
4262
|
+
}
|
|
4263
|
+
chart.marker.enabled =
|
|
4264
|
+
e.type !== 'mouseout' &&
|
|
4265
|
+
e.x > xScale.getPixelForValue(xScale.min) &&
|
|
4266
|
+
e.x < xScale.getPixelForValue(xScale.max);
|
|
4267
|
+
if (!chart.marker.enabled && !chart.marker.suppressUpdate) {
|
|
4268
|
+
if (e.x > xScale.getPixelForValue(xScale.max)) {
|
|
4269
|
+
// suppress future updates to prevent endless redrawing of chart
|
|
4270
|
+
chart.marker.suppressUpdate = true;
|
|
4271
|
+
chart.update('none');
|
|
4272
|
+
}
|
|
4273
|
+
chart.marker.dragStarted = false; // cancel zoom in progress
|
|
4274
|
+
return false;
|
|
4275
|
+
}
|
|
4276
|
+
chart.marker.suppressUpdate = false;
|
|
4277
|
+
chart.marker.x = e.x;
|
|
4278
|
+
chart.draw();
|
|
4279
|
+
},
|
|
4280
|
+
doDraw: function (chart) {
|
|
4281
|
+
if (!hasMarkerConfiguration(chart)) {
|
|
4282
|
+
return;
|
|
4283
|
+
}
|
|
4284
|
+
if (!chart.marker.enabled) {
|
|
4285
|
+
return;
|
|
4286
|
+
}
|
|
4287
|
+
this.drawTraceLine(chart);
|
|
4288
|
+
this.interpolateValues(chart);
|
|
4289
|
+
this.drawTracePoints(chart);
|
|
4290
|
+
return true;
|
|
4291
|
+
},
|
|
4292
|
+
beforeDraw: function (chart) {
|
|
4293
|
+
return this.doDraw(chart);
|
|
4294
|
+
},
|
|
4295
|
+
// Logic moved to beforeDraw in order
|
|
4296
|
+
// for the vertical line to be drawn
|
|
4297
|
+
// under tooltip and datalabels.
|
|
4298
|
+
// afterDraw: function(chart) {
|
|
4299
|
+
// return this.doDraw(chart);
|
|
4300
|
+
// },
|
|
4301
|
+
drawTraceLine: function (chart) {
|
|
4302
|
+
if (!hasMarkerConfiguration(chart)) {
|
|
4303
|
+
return;
|
|
4304
|
+
}
|
|
4305
|
+
var yScale = this.getYScale(chart);
|
|
4306
|
+
var lineWidth = this.getOption(chart, 'line', 'width');
|
|
4307
|
+
var color = this.getOption(chart, 'line', 'color');
|
|
4308
|
+
var dashPattern = this.getOption(chart, 'line', 'dashPattern');
|
|
4309
|
+
var snapEnabled = this.getOption(chart, 'snap', 'enabled');
|
|
4310
|
+
var lineX = chart.marker.x;
|
|
4311
|
+
if (snapEnabled && chart._active.length) {
|
|
4312
|
+
lineX = chart._active[0].element.x;
|
|
4313
|
+
}
|
|
4314
|
+
chart.ctx.beginPath();
|
|
4315
|
+
chart.ctx.setLineDash(dashPattern);
|
|
4316
|
+
chart.ctx.moveTo(lineX, yScale.getPixelForValue(yScale.max));
|
|
4317
|
+
chart.ctx.lineWidth = lineWidth;
|
|
4318
|
+
chart.ctx.strokeStyle = color;
|
|
4319
|
+
chart.ctx.lineTo(lineX, yScale.getPixelForValue(yScale.min));
|
|
4320
|
+
chart.ctx.stroke();
|
|
4321
|
+
chart.ctx.setLineDash([]);
|
|
4322
|
+
},
|
|
4323
|
+
drawTracePoints: function (chart) {
|
|
4324
|
+
if (!hasMarkerConfiguration(chart)) {
|
|
4325
|
+
return;
|
|
4326
|
+
}
|
|
4327
|
+
for (var chartIndex = 0; chartIndex < chart.data.datasets.length; chartIndex++) {
|
|
4328
|
+
var dataset = chart.data.datasets[chartIndex];
|
|
4329
|
+
var meta = chart.getDatasetMeta(chartIndex);
|
|
4330
|
+
var yScale = chart.scales[meta.yAxisID];
|
|
4331
|
+
if (meta.hidden || !dataset.interpolate) {
|
|
4332
|
+
continue;
|
|
4333
|
+
}
|
|
4334
|
+
chart.ctx.beginPath();
|
|
4335
|
+
chart.ctx.arc(chart.marker.x, yScale.getPixelForValue(dataset.interpolatedValue), 3, 0, 2 * Math.PI, false);
|
|
4336
|
+
chart.ctx.fillStyle = 'white';
|
|
4337
|
+
chart.ctx.lineWidth = 2;
|
|
4338
|
+
chart.ctx.strokeStyle = dataset.borderColor;
|
|
4339
|
+
chart.ctx.fill();
|
|
4340
|
+
chart.ctx.stroke();
|
|
4341
|
+
}
|
|
4342
|
+
},
|
|
4343
|
+
interpolateValues: function (chart) {
|
|
4344
|
+
for (var chartIndex = 0; chartIndex < chart.data.datasets.length; chartIndex++) {
|
|
4345
|
+
var dataset = chart.data.datasets[chartIndex];
|
|
4346
|
+
var meta = chart.getDatasetMeta(chartIndex);
|
|
4347
|
+
var xScale = chart.scales[meta.xAxisID];
|
|
4348
|
+
var xValue = xScale.getValueForPixel(chart.marker.x);
|
|
4349
|
+
if (meta.hidden || !dataset.interpolate) {
|
|
4350
|
+
continue;
|
|
4351
|
+
}
|
|
4352
|
+
var data = dataset.data;
|
|
4353
|
+
var index = data.findIndex(function (o) {
|
|
4354
|
+
return o.x >= xValue;
|
|
4355
|
+
});
|
|
4356
|
+
var prev = data[index - 1];
|
|
4357
|
+
var next = data[index];
|
|
4358
|
+
if (chart.data.datasets[chartIndex].steppedLine && prev) {
|
|
4359
|
+
dataset.interpolatedValue = prev.y;
|
|
4360
|
+
}
|
|
4361
|
+
else if (prev && next) {
|
|
4362
|
+
var slope = (next.y - prev.y) / (next.x - prev.x);
|
|
4363
|
+
dataset.interpolatedValue = prev.y + (xValue - prev.x) * slope;
|
|
4364
|
+
}
|
|
4365
|
+
else {
|
|
4366
|
+
dataset.interpolatedValue = NaN;
|
|
4367
|
+
}
|
|
4368
|
+
}
|
|
4369
|
+
},
|
|
4370
|
+
};
|
|
4371
|
+
|
|
4023
4372
|
var getThemeColorHexString$2 = core.ColorHelper.getThemeColorHexString;
|
|
4024
4373
|
var hoverBackgroundColor = getThemeColorHexString$2('primary');
|
|
4025
4374
|
var backgroundColor = getThemeColorHexString$2('secondary');
|
|
@@ -4079,13 +4428,19 @@
|
|
|
4079
4428
|
legend: {
|
|
4080
4429
|
display: false,
|
|
4081
4430
|
},
|
|
4431
|
+
datalabels: {
|
|
4432
|
+
display: false,
|
|
4433
|
+
},
|
|
4434
|
+
tooltip: {
|
|
4435
|
+
enabled: false,
|
|
4436
|
+
},
|
|
4082
4437
|
},
|
|
4083
4438
|
};
|
|
4084
4439
|
|
|
4085
4440
|
var CHART_SCALES = [chart_js.CategoryScale, chart_js.LinearScale];
|
|
4086
4441
|
var CHART_ELEMENTS = [chart_js.BarElement, chart_js.LineElement, chart_js.PointElement];
|
|
4087
4442
|
var CHART_CONTROLLERS = [chart_js.BarController, chart_js.LineController];
|
|
4088
|
-
var CHART_PLUGINS = [annotationPlugin__default['default'], chart_js.Filler];
|
|
4443
|
+
var CHART_PLUGINS = [annotationPlugin__default['default'], chart_js.Filler, ChartDataLabels__default['default'], chart_js.Tooltip, MarkerPlugin];
|
|
4089
4444
|
/* Order matters; defaults must be merged after register as
|
|
4090
4445
|
register modifies the Chart.defaults objects */
|
|
4091
4446
|
chart_js.Chart.register.apply(chart_js.Chart, __spread([chart_js.Legend], CHART_SCALES, CHART_ELEMENTS, CHART_CONTROLLERS, CHART_PLUGINS));
|
|
@@ -4097,14 +4452,23 @@
|
|
|
4097
4452
|
chart_js.Chart.defaults[key] = mergedDefaults[key];
|
|
4098
4453
|
});
|
|
4099
4454
|
|
|
4455
|
+
var CHART_LOCALE_DEFAULT = 'en-US';
|
|
4100
4456
|
var ChartJSService = /** @class */ (function () {
|
|
4101
4457
|
function ChartJSService(chartConfigService) {
|
|
4102
4458
|
this.chartConfigService = chartConfigService;
|
|
4103
4459
|
}
|
|
4104
4460
|
ChartJSService.prototype.renderChart = function (args) {
|
|
4105
|
-
var targetElement = args.targetElement, type = args.type, data = args.data, dataLabels = args.dataLabels, customOptions = args.customOptions, annotations = args.annotations, highlightedElements = args.highlightedElements;
|
|
4106
|
-
|
|
4107
|
-
|
|
4461
|
+
var targetElement = args.targetElement, type = args.type, data = args.data, dataLabels = args.dataLabels, customOptions = args.customOptions, annotations = args.annotations, dataLabelOptions = args.dataLabelOptions, highlightedElements = args.highlightedElements;
|
|
4462
|
+
this.dataLabelOptions = dataLabelOptions || null;
|
|
4463
|
+
this.highlightedElements = highlightedElements || null;
|
|
4464
|
+
this.chartType = type;
|
|
4465
|
+
this.locale = (dataLabelOptions === null || dataLabelOptions === void 0 ? void 0 : dataLabelOptions.locale) || CHART_LOCALE_DEFAULT;
|
|
4466
|
+
var datasets = this.createDatasets(data);
|
|
4467
|
+
var options = this.createOptionsObject({
|
|
4468
|
+
customOptions: customOptions,
|
|
4469
|
+
annotations: annotations,
|
|
4470
|
+
dataLabelOptions: dataLabelOptions,
|
|
4471
|
+
});
|
|
4108
4472
|
var config = this.createConfigurationObject(type, datasets, options, dataLabels);
|
|
4109
4473
|
this.initializeNewChart(targetElement.nativeElement, config);
|
|
4110
4474
|
};
|
|
@@ -4128,15 +4492,20 @@
|
|
|
4128
4492
|
this.nonDestructivelyUpdateType(type, customOptions);
|
|
4129
4493
|
}
|
|
4130
4494
|
};
|
|
4495
|
+
ChartJSService.prototype.setDataLabelOptions = function (dataLabelOptions) {
|
|
4496
|
+
this.dataLabelOptions = dataLabelOptions;
|
|
4497
|
+
};
|
|
4131
4498
|
ChartJSService.prototype.updateOptions = function (customOptions, type) {
|
|
4132
4499
|
var annotations = this.getExistingChartAnnotations();
|
|
4133
|
-
this.
|
|
4500
|
+
this.chartType = type;
|
|
4501
|
+
this.chart.options = this.createOptionsObject({ customOptions: customOptions, annotations: annotations });
|
|
4134
4502
|
};
|
|
4135
4503
|
ChartJSService.prototype.updateAnnotations = function (annotations) {
|
|
4136
4504
|
var annotationsWithDefaults = this.applyDefaultsToAnnotations(annotations);
|
|
4137
4505
|
this.chart.options.plugins.annotation.annotations = annotationsWithDefaults;
|
|
4138
4506
|
};
|
|
4139
4507
|
ChartJSService.prototype.updateHighlightedElements = function (highlightedElements) {
|
|
4508
|
+
this.highlightedElements = highlightedElements;
|
|
4140
4509
|
var oldDatasets = this.chart.data.datasets;
|
|
4141
4510
|
// Clear old datasets of highlighted elements
|
|
4142
4511
|
oldDatasets.map(function (dataset) {
|
|
@@ -4145,7 +4514,7 @@
|
|
|
4145
4514
|
delete dataset.kirbyOptions.highlightedElements;
|
|
4146
4515
|
}
|
|
4147
4516
|
});
|
|
4148
|
-
this.chart.data.datasets = this.createDatasets(oldDatasets
|
|
4517
|
+
this.chart.data.datasets = this.createDatasets(oldDatasets);
|
|
4149
4518
|
};
|
|
4150
4519
|
ChartJSService.prototype.getExistingChartAnnotations = function () {
|
|
4151
4520
|
var _a, _b;
|
|
@@ -4164,7 +4533,8 @@
|
|
|
4164
4533
|
var datasets = this.chart.data.datasets;
|
|
4165
4534
|
var dataLabels = this.chart.data.labels;
|
|
4166
4535
|
var annotations = this.getExistingChartAnnotations();
|
|
4167
|
-
|
|
4536
|
+
this.chartType = type;
|
|
4537
|
+
var options = this.createOptionsObject({ customOptions: customOptions, annotations: annotations });
|
|
4168
4538
|
var config = this.createConfigurationObject(type, datasets, options, dataLabels);
|
|
4169
4539
|
var canvasElement = this.chart.canvas;
|
|
4170
4540
|
this.chart.destroy();
|
|
@@ -4172,8 +4542,8 @@
|
|
|
4172
4542
|
};
|
|
4173
4543
|
ChartJSService.prototype.nonDestructivelyUpdateType = function (chartType, customOptions) {
|
|
4174
4544
|
var annotations = this.getExistingChartAnnotations();
|
|
4545
|
+
this.chartType = chartType;
|
|
4175
4546
|
var options = this.createOptionsObject({
|
|
4176
|
-
type: chartType,
|
|
4177
4547
|
customOptions: customOptions,
|
|
4178
4548
|
annotations: annotations,
|
|
4179
4549
|
});
|
|
@@ -4206,8 +4576,8 @@
|
|
|
4206
4576
|
};
|
|
4207
4577
|
ChartJSService.prototype.applyInteractionFunctionsExtensions = function (options) {
|
|
4208
4578
|
var interactionFunctionsExtensions = this.chartConfigService.getInteractionFunctionsExtensions();
|
|
4209
|
-
Object.entries(interactionFunctionsExtensions).forEach(function (
|
|
4210
|
-
var
|
|
4579
|
+
Object.entries(interactionFunctionsExtensions).forEach(function (_d) {
|
|
4580
|
+
var _e = __read(_d, 2), key = _e[0], _ = _e[1];
|
|
4211
4581
|
var callback = options[key];
|
|
4212
4582
|
options[key] = function (e, a, c) {
|
|
4213
4583
|
interactionFunctionsExtensions[key](e, a, c, callback);
|
|
@@ -4215,21 +4585,74 @@
|
|
|
4215
4585
|
});
|
|
4216
4586
|
return options;
|
|
4217
4587
|
};
|
|
4588
|
+
ChartJSService.prototype.createStockOptionsObject = function (dataLabelOptions) {
|
|
4589
|
+
var _this = this;
|
|
4590
|
+
return {
|
|
4591
|
+
locale: this.locale,
|
|
4592
|
+
plugins: {
|
|
4593
|
+
tooltip: {
|
|
4594
|
+
callbacks: {
|
|
4595
|
+
title: function (tooltipItems) {
|
|
4596
|
+
var _a, _b;
|
|
4597
|
+
var date = dateFns.toDate((_b = (_a = tooltipItems[0]) === null || _a === void 0 ? void 0 : _a.raw) === null || _b === void 0 ? void 0 : _b.x);
|
|
4598
|
+
if (date.valueOf()) {
|
|
4599
|
+
return date.toLocaleTimeString(_this.locale, {
|
|
4600
|
+
day: 'numeric',
|
|
4601
|
+
month: 'short',
|
|
4602
|
+
hour: '2-digit',
|
|
4603
|
+
minute: '2-digit',
|
|
4604
|
+
});
|
|
4605
|
+
}
|
|
4606
|
+
},
|
|
4607
|
+
label: function (context) {
|
|
4608
|
+
// It's not possible to add spacing between color legend and text so we
|
|
4609
|
+
// prefix with a space.
|
|
4610
|
+
return ' ' + context.formattedValue + (dataLabelOptions.valueSuffix || '');
|
|
4611
|
+
},
|
|
4612
|
+
},
|
|
4613
|
+
},
|
|
4614
|
+
},
|
|
4615
|
+
scales: {
|
|
4616
|
+
y: {
|
|
4617
|
+
ticks: {
|
|
4618
|
+
callback: function (value) {
|
|
4619
|
+
return value + (dataLabelOptions.valueSuffix || '');
|
|
4620
|
+
},
|
|
4621
|
+
},
|
|
4622
|
+
},
|
|
4623
|
+
},
|
|
4624
|
+
};
|
|
4625
|
+
};
|
|
4218
4626
|
ChartJSService.prototype.createOptionsObject = function (args) {
|
|
4219
|
-
var
|
|
4220
|
-
var typeConfig = this.chartConfigService.getTypeConfig(
|
|
4627
|
+
var customOptions = args.customOptions, annotations = args.annotations, chartDataLabelOptions = args.dataLabelOptions;
|
|
4628
|
+
var typeConfig = this.chartConfigService.getTypeConfig(this.chartType);
|
|
4221
4629
|
var typeConfigOptions = typeConfig === null || typeConfig === void 0 ? void 0 : typeConfig.options;
|
|
4222
4630
|
var annotationPluginOptions = annotations
|
|
4223
4631
|
? this.createAnnotationPluginOptionsObject(annotations)
|
|
4224
4632
|
: {};
|
|
4225
|
-
var
|
|
4633
|
+
var stockOptions = this.chartType === 'stock' ? this.createStockOptionsObject(chartDataLabelOptions) : {};
|
|
4634
|
+
var options = mergeDeepAll(stockOptions, typeConfigOptions, customOptions, annotationPluginOptions);
|
|
4226
4635
|
return this.applyInteractionFunctionsExtensions(options);
|
|
4227
4636
|
};
|
|
4637
|
+
ChartJSService.prototype.getDefaultStockLabels = function (datasets, locale) {
|
|
4638
|
+
var largestDataset = datasets.reduce(function (previousDataset, currentDataset) { return previousDataset.data.length > currentDataset.data.length ? previousDataset : currentDataset; });
|
|
4639
|
+
return largestDataset.data.map(function (point) { return dateFns.toDate(point.x).toLocaleDateString(locale, {
|
|
4640
|
+
month: 'short',
|
|
4641
|
+
day: 'numeric',
|
|
4642
|
+
}); });
|
|
4643
|
+
};
|
|
4228
4644
|
ChartJSService.prototype.createConfigurationObject = function (type, datasets, options, dataLabels) {
|
|
4229
|
-
/* chartJS requires labels; if none is provided create an empty string array
|
|
4230
|
-
to make it optional for consumer */
|
|
4231
|
-
var labels = !dataLabels ? this.createBlankLabels(datasets) : dataLabels;
|
|
4232
4645
|
var typeConfig = this.chartConfigService.getTypeConfig(type);
|
|
4646
|
+
// chartJS requires labels; if none is provided create an empty string array
|
|
4647
|
+
// to make it optional for consumer.
|
|
4648
|
+
// However the stock chart, should have autogenerated labels if no
|
|
4649
|
+
// custom labels are supplied.
|
|
4650
|
+
var isStockType = type === 'stock';
|
|
4651
|
+
var labels = !dataLabels
|
|
4652
|
+
? isStockType
|
|
4653
|
+
? this.getDefaultStockLabels(datasets, this.locale)
|
|
4654
|
+
: this.createBlankLabels(datasets)
|
|
4655
|
+
: dataLabels;
|
|
4233
4656
|
return mergeDeepAll(typeConfig, {
|
|
4234
4657
|
data: {
|
|
4235
4658
|
labels: labels,
|
|
@@ -4239,8 +4662,8 @@
|
|
|
4239
4662
|
});
|
|
4240
4663
|
};
|
|
4241
4664
|
ChartJSService.prototype.addHighlightedElementsToDatasets = function (highlightedElements, datasets) {
|
|
4242
|
-
highlightedElements.forEach(function (
|
|
4243
|
-
var
|
|
4665
|
+
highlightedElements.forEach(function (_d) {
|
|
4666
|
+
var _e = __read(_d, 2), datasetIndex = _e[0], dataIndex = _e[1];
|
|
4244
4667
|
var _a;
|
|
4245
4668
|
var dataset = datasets[datasetIndex];
|
|
4246
4669
|
if (!dataset)
|
|
@@ -4253,12 +4676,63 @@
|
|
|
4253
4676
|
}
|
|
4254
4677
|
});
|
|
4255
4678
|
};
|
|
4256
|
-
ChartJSService.prototype.createDatasets = function (data
|
|
4679
|
+
ChartJSService.prototype.createDatasets = function (data) {
|
|
4680
|
+
var _a, _b, _c;
|
|
4681
|
+
// We need to modify the datasets in order to add datalabels.
|
|
4682
|
+
if (((_a = this.dataLabelOptions) === null || _a === void 0 ? void 0 : _a.showCurrent) || ((_b = this.dataLabelOptions) === null || _b === void 0 ? void 0 : _b.showMax) || ((_c = this.dataLabelOptions) === null || _c === void 0 ? void 0 : _c.showMin)) {
|
|
4683
|
+
data = this.addDataLabelsData(data);
|
|
4684
|
+
}
|
|
4257
4685
|
var datasets = isNumberArray(data) ? [{ data: data }] : data;
|
|
4258
|
-
if (highlightedElements)
|
|
4259
|
-
this.addHighlightedElementsToDatasets(highlightedElements, datasets);
|
|
4686
|
+
if (this.highlightedElements)
|
|
4687
|
+
this.addHighlightedElementsToDatasets(this.highlightedElements, datasets);
|
|
4260
4688
|
return datasets;
|
|
4261
4689
|
};
|
|
4690
|
+
/**
|
|
4691
|
+
* Decorate ChartDataset with properties to allow for datalabels.
|
|
4692
|
+
*
|
|
4693
|
+
* @param data
|
|
4694
|
+
* @returns ChartDataset[]
|
|
4695
|
+
*/
|
|
4696
|
+
ChartJSService.prototype.addDataLabelsData = function (data) {
|
|
4697
|
+
var _this = this;
|
|
4698
|
+
if (isNumberArray(data)) {
|
|
4699
|
+
throw Error("Currently it's impossible to add dataLabels to non ScatterDataPoint datasets");
|
|
4700
|
+
}
|
|
4701
|
+
var decorateDataPoint = function (set, axis, direction, position) {
|
|
4702
|
+
var _d = _this.locateValueIndexInDataset(set, axis, direction), value = _d.value, pointer = _d.pointer;
|
|
4703
|
+
set.data[pointer] = Object.assign(Object.assign({}, set.data[pointer]), { datalabel: {
|
|
4704
|
+
value: value + (_this.dataLabelOptions.valueSuffix || ''),
|
|
4705
|
+
position: position,
|
|
4706
|
+
} });
|
|
4707
|
+
};
|
|
4708
|
+
data.map(function (set) {
|
|
4709
|
+
if (_this.dataLabelOptions.showMin) {
|
|
4710
|
+
decorateDataPoint(set, 'y', 'low', 'bottom');
|
|
4711
|
+
}
|
|
4712
|
+
if (_this.dataLabelOptions.showMax) {
|
|
4713
|
+
decorateDataPoint(set, 'y', 'high', 'top');
|
|
4714
|
+
}
|
|
4715
|
+
if (_this.dataLabelOptions.showCurrent) {
|
|
4716
|
+
decorateDataPoint(set, 'x', 'high', 'right');
|
|
4717
|
+
}
|
|
4718
|
+
});
|
|
4719
|
+
return data;
|
|
4720
|
+
};
|
|
4721
|
+
ChartJSService.prototype.locateValueIndexInDataset = function (dataset, axis, direction) {
|
|
4722
|
+
var pointer;
|
|
4723
|
+
var value;
|
|
4724
|
+
dataset.data.forEach(function (datapoint, index) {
|
|
4725
|
+
if (direction == 'low' && (!value || datapoint[axis] < value)) {
|
|
4726
|
+
value = datapoint['y'];
|
|
4727
|
+
pointer = index;
|
|
4728
|
+
}
|
|
4729
|
+
if (direction == 'high' && (!value || datapoint[axis] > value)) {
|
|
4730
|
+
value = datapoint['y'];
|
|
4731
|
+
pointer = index;
|
|
4732
|
+
}
|
|
4733
|
+
});
|
|
4734
|
+
return { value: value, pointer: pointer };
|
|
4735
|
+
};
|
|
4262
4736
|
return ChartJSService;
|
|
4263
4737
|
}());
|
|
4264
4738
|
ChartJSService.decorators = [
|
|
@@ -4340,6 +4814,7 @@
|
|
|
4340
4814
|
dataLabels: this.dataLabels,
|
|
4341
4815
|
customOptions: this.customOptions,
|
|
4342
4816
|
annotations: this.annotations,
|
|
4817
|
+
dataLabelOptions: this.dataLabelOptions,
|
|
4343
4818
|
highlightedElements: this.highlightedElements,
|
|
4344
4819
|
});
|
|
4345
4820
|
};
|
|
@@ -4383,6 +4858,7 @@
|
|
|
4383
4858
|
data: [{ type: i0.Input }],
|
|
4384
4859
|
dataLabels: [{ type: i0.Input }],
|
|
4385
4860
|
customOptions: [{ type: i0.Input }],
|
|
4861
|
+
dataLabelOptions: [{ type: i0.Input }],
|
|
4386
4862
|
annotations: [{ type: i0.Input }],
|
|
4387
4863
|
highlightedElements: [{ type: i0.Input }],
|
|
4388
4864
|
_height: [{ type: i0.HostBinding, args: ['style.--kirby-chart-height',] }],
|
|
@@ -4391,7 +4867,7 @@
|
|
|
4391
4867
|
};
|
|
4392
4868
|
|
|
4393
4869
|
var stockChartDeprecatedOptions = function (locale, height) {
|
|
4394
|
-
var options = defaultOptions(locale);
|
|
4870
|
+
var options = defaultOptions$1(locale);
|
|
4395
4871
|
var transparentColor = 'rgba(255,255,255,0)';
|
|
4396
4872
|
options.chart.backgroundColor = transparentColor;
|
|
4397
4873
|
options.chart.height = height;
|
|
@@ -4487,7 +4963,7 @@
|
|
|
4487
4963
|
},
|
|
4488
4964
|
};
|
|
4489
4965
|
};
|
|
4490
|
-
var defaultOptions = function (locale) {
|
|
4966
|
+
var defaultOptions$1 = function (locale) {
|
|
4491
4967
|
return {
|
|
4492
4968
|
chart: {
|
|
4493
4969
|
zoomType: 'x',
|
|
@@ -4569,7 +5045,7 @@
|
|
|
4569
5045
|
],
|
|
4570
5046
|
};
|
|
4571
5047
|
};
|
|
4572
|
-
var ɵ0$
|
|
5048
|
+
var ɵ0$8 = defaultOptions$1;
|
|
4573
5049
|
|
|
4574
5050
|
// @ts-ignore
|
|
4575
5051
|
AnnotationsModule__default['default'](Highcharts__namespace$1);
|
|
@@ -5189,6 +5665,41 @@
|
|
|
5189
5665
|
_hasYearNavigator: [{ type: i0.HostBinding, args: ['class.has-year-navigator',] }]
|
|
5190
5666
|
};
|
|
5191
5667
|
|
|
5668
|
+
var ItemSlidingComponent = /** @class */ (function () {
|
|
5669
|
+
function ItemSlidingComponent() {
|
|
5670
|
+
this._side = 'start';
|
|
5671
|
+
}
|
|
5672
|
+
Object.defineProperty(ItemSlidingComponent.prototype, "side", {
|
|
5673
|
+
set: function (value) {
|
|
5674
|
+
this._side = value === 'left' ? 'start' : 'end';
|
|
5675
|
+
},
|
|
5676
|
+
enumerable: false,
|
|
5677
|
+
configurable: true
|
|
5678
|
+
});
|
|
5679
|
+
Object.defineProperty(ItemSlidingComponent.prototype, "_hasSwipeActions", {
|
|
5680
|
+
get: function () {
|
|
5681
|
+
var _a;
|
|
5682
|
+
// Using '>' instead of '!==';
|
|
5683
|
+
// will only return true when swipeActions is an array
|
|
5684
|
+
return ((_a = this.swipeActions) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
5685
|
+
},
|
|
5686
|
+
enumerable: false,
|
|
5687
|
+
configurable: true
|
|
5688
|
+
});
|
|
5689
|
+
return ItemSlidingComponent;
|
|
5690
|
+
}());
|
|
5691
|
+
ItemSlidingComponent.decorators = [
|
|
5692
|
+
{ type: i0.Component, args: [{
|
|
5693
|
+
selector: 'kirby-item-sliding',
|
|
5694
|
+
template: "<ion-item-sliding>\n <ng-content></ng-content>\n\n <ion-item-options *ngIf=\"_hasSwipeActions\" [side]=\"_side\">\n <ng-container *ngFor=\"let swipeAction of swipeActions\">\n <ion-item-option\n *ngIf=\"!swipeAction.isDisabled\"\n [ngClass]=\"swipeAction.type\"\n (click)=\"swipeAction.onSelected()\"\n >\n <kirby-icon\n *ngIf=\"swipeAction.icon !== undefined\"\n [name]=\"swipeAction.icon\"\n slot=\"top\"\n ></kirby-icon>\n <ion-label>{{ swipeAction.title }}</ion-label>\n </ion-item-option>\n </ng-container>\n </ion-item-options>\n</ion-item-sliding>\n",
|
|
5695
|
+
styles: ["ion-item-option.primary{background-color:var(--kirby-primary);color:var(--kirby-primary-contrast)}ion-item-option.secondary{background-color:var(--kirby-secondary);color:var(--kirby-secondary-contrast)}ion-item-option.tertiary{background-color:var(--kirby-tertiary);color:var(--kirby-tertiary-contrast)}ion-item-option.success{background-color:var(--kirby-success);color:var(--kirby-success-contrast)}ion-item-option.warning{background-color:var(--kirby-warning);color:var(--kirby-warning-contrast)}ion-item-option.danger{background-color:var(--kirby-danger);color:var(--kirby-danger-contrast)}ion-item-option.light{background-color:var(--kirby-light);color:var(--kirby-light-contrast)}ion-item-option.medium{background-color:var(--kirby-medium);color:var(--kirby-medium-contrast)}ion-item-option.dark{background-color:var(--kirby-dark);color:var(--kirby-dark-contrast)}ion-item-option{min-width:92px}"]
|
|
5696
|
+
},] }
|
|
5697
|
+
];
|
|
5698
|
+
ItemSlidingComponent.propDecorators = {
|
|
5699
|
+
swipeActions: [{ type: i0.Input }],
|
|
5700
|
+
side: [{ type: i0.Input }]
|
|
5701
|
+
};
|
|
5702
|
+
|
|
5192
5703
|
var UniqueIdGenerator = /** @class */ (function () {
|
|
5193
5704
|
function UniqueIdGenerator(scope) {
|
|
5194
5705
|
this.scope = scope;
|
|
@@ -7181,7 +7692,7 @@
|
|
|
7181
7692
|
{ type: i0.Component, args: [{
|
|
7182
7693
|
selector: 'kirby-label',
|
|
7183
7694
|
template: "<ion-label>\n <ng-content></ng-content>\n</ion-label>\n",
|
|
7184
|
-
styles: [":host.horizontal ion-label{display:flex;flex-direction:row;justify-content:space-between;align-items:center}:host.horizontal ion-label ::ng-deep>:not(:first-child){margin-left:12px}:host-context(kirby-item) ion-label ::ng-deep>data,:host-context(kirby-item) ion-label ::ng-deep>h1,:host-context(kirby-item) ion-label ::ng-deep>h2,:host-context(kirby-item) ion-label ::ng-deep>h3,:host-context(kirby-item) ion-label ::ng-deep>h4,:host-context(kirby-item) ion-label ::ng-deep>h5,:host-context(kirby-item) ion-label ::ng-deep>h6,:host-context(kirby-item) ion-label ::ng-deep>p{font-size:16px;line-height:24px;color:var(--kirby-text-color-black);display:block;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:400}:host-context(kirby-item) ion-label ::ng-deep>data.kirby-text-bold,:host-context(kirby-item) ion-label ::ng-deep>h1.kirby-text-bold,:host-context(kirby-item) ion-label ::ng-deep>h2.kirby-text-bold,:host-context(kirby-item) ion-label ::ng-deep>h3.kirby-text-bold,:host-context(kirby-item) ion-label ::ng-deep>h4.kirby-text-bold,:host-context(kirby-item) ion-label ::ng-deep>h5.kirby-text-bold,:host-context(kirby-item) ion-label ::ng-deep>h6.kirby-text-bold,:host-context(kirby-item) ion-label ::ng-deep>p.kirby-text-bold{font-weight:700}:host-context(kirby-item) ion-label ::ng-deep>p{font-size:14px}:host-context(kirby-item) ion-label ::ng-deep>[detail],:host-context(kirby-item) ion-label ::ng-deep>[subtitle]{font-size:12px;line-height:16px}:host-context(kirby-item) ion-label ::ng-deep>[subtitle]:not(:last-child){margin-bottom:4px}:host-context(kirby-item) ion-label ::ng-deep>[detail]{color:var(--kirby-text-color-semi-dark)}:host([slot=end]) ion-label ::ng-deep>[detail],:host([slot=end]) ion-label ::ng-deep>data{margin-inline-start:16px}:host-context(kirby-item.selected) ion-label ::ng-deep>data:not([detail]),:host-context(kirby-item.selected) ion-label ::ng-deep>h1,:host-context(kirby-item.selected) ion-label ::ng-deep>h2,:host-context(kirby-item.selected) ion-label ::ng-deep>h3,:host-context(kirby-item.selected) ion-label ::ng-deep>h4,:host-context(kirby-item.selected) ion-label ::ng-deep>h5,:host-context(kirby-item.selected) ion-label ::ng-deep>h6,:host-context(kirby-item.selected) ion-label ::ng-deep>p:not([detail]){font-weight:700}"]
|
|
7695
|
+
styles: [":host.horizontal ion-label{display:flex;flex-direction:row;justify-content:space-between;align-items:center}:host.horizontal ion-label ::ng-deep>:not(:first-child){margin-left:12px}:host-context(kirby-item) ion-label ::ng-deep>data,:host-context(kirby-item) ion-label ::ng-deep>h1,:host-context(kirby-item) ion-label ::ng-deep>h2,:host-context(kirby-item) ion-label ::ng-deep>h3,:host-context(kirby-item) ion-label ::ng-deep>h4,:host-context(kirby-item) ion-label ::ng-deep>h5,:host-context(kirby-item) ion-label ::ng-deep>h6,:host-context(kirby-item) ion-label ::ng-deep>p{font-size:16px;line-height:24px;color:var(--kirby-text-color-black);display:block;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:400}:host-context(kirby-item) ion-label ::ng-deep>data.kirby-text-bold,:host-context(kirby-item) ion-label ::ng-deep>h1.kirby-text-bold,:host-context(kirby-item) ion-label ::ng-deep>h2.kirby-text-bold,:host-context(kirby-item) ion-label ::ng-deep>h3.kirby-text-bold,:host-context(kirby-item) ion-label ::ng-deep>h4.kirby-text-bold,:host-context(kirby-item) ion-label ::ng-deep>h5.kirby-text-bold,:host-context(kirby-item) ion-label ::ng-deep>h6.kirby-text-bold,:host-context(kirby-item) ion-label ::ng-deep>p.kirby-text-bold{font-weight:700}:host-context(kirby-item) ion-label ::ng-deep>p{font-size:14px}:host-context(kirby-item) ion-label ::ng-deep>[detail],:host-context(kirby-item) ion-label ::ng-deep>[subtitle]{font-size:12px;line-height:16px}:host-context(kirby-item) ion-label ::ng-deep>[subtitle]:not(:last-child){margin-bottom:4px}:host-context(kirby-item) ion-label ::ng-deep>[detail]{color:var(--kirby-text-color-semi-dark)}:host-context(kirby-section-header) ion-label{--padding-end:16px;--padding-start:16px}:host-context(kirby-section-header) ion-label ::ng-deep>[heading]{font-weight:700;font-size:18px;line-height:24px;color:var(--kirby-section-header-color);margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host-context(kirby-section-header) ion-label ::ng-deep>[detail],:host-context(kirby-section-header) ion-label ::ng-deep>[label]{font-weight:300;font-size:14px;line-height:20px;color:var(--kirby-section-header-color);margin:4px 0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host([slot=end]) ion-label ::ng-deep>[detail],:host([slot=end]) ion-label ::ng-deep>data{margin-inline-start:16px}:host-context(kirby-item.selected) ion-label ::ng-deep>data:not([detail]),:host-context(kirby-item.selected) ion-label ::ng-deep>h1,:host-context(kirby-item.selected) ion-label ::ng-deep>h2,:host-context(kirby-item.selected) ion-label ::ng-deep>h3,:host-context(kirby-item.selected) ion-label ::ng-deep>h4,:host-context(kirby-item.selected) ion-label ::ng-deep>h5,:host-context(kirby-item.selected) ion-label ::ng-deep>h6,:host-context(kirby-item.selected) ion-label ::ng-deep>p:not([detail]){font-weight:700}"]
|
|
7185
7696
|
},] }
|
|
7186
7697
|
];
|
|
7187
7698
|
LabelComponent.propDecorators = {
|
|
@@ -7625,7 +8136,7 @@
|
|
|
7625
8136
|
selector: 'kirby-list',
|
|
7626
8137
|
template: "<ion-list\n #list\n kirbyInfiniteScroll\n (scrollEnd)=\"_onLoadOnDemand()\"\n [disabled]=\"!isLoadOnDemandEnabled\"\n class=\"list\"\n [class.has-header]=\"headerTemplate\"\n [class.has-footer]=\"footerTemplate\"\n [class.has-divider]=\"showDivider\"\n>\n <ion-list-header *ngIf=\"headerTemplate\">\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n </ion-list-header>\n\n <ng-container\n *ngTemplateOutlet=\"\n _isSectionsEnabled ? groupedListTemplate : itemsTemplate;\n context: { $implicit: items }\n \"\n ></ng-container>\n\n <div *ngIf=\"footerTemplate\" class=\"footer\">\n <ng-container *ngTemplateOutlet=\"footerTemplate\"></ng-container>\n </div>\n</ion-list>\n\n<p *ngIf=\"!isLoadOnDemandEnabled && noMoreItemsText\" class=\"no-more-items\">\n {{ noMoreItemsText }}\n</p>\n<div *ngIf=\"_isLoading\" class=\"loading\">\n <kirby-spinner></kirby-spinner>\n</div>\n\n<ng-template #groupedListTemplate>\n <ion-item-group *ngFor=\"let section of _groupedItems; trackBy: sectionTrackBy\">\n <ion-item-divider>\n <ng-container\n *ngTemplateOutlet=\"sectionHeaderTemplate; context: { $implicit: section.name }\"\n ></ng-container>\n </ion-item-divider>\n\n <div class=\"list-items\">\n <ng-container\n *ngTemplateOutlet=\"itemsTemplate; context: { $implicit: section.items }\"\n ></ng-container>\n </div>\n </ion-item-group>\n</ng-template>\n\n<ng-template #itemsTemplate let-items>\n <kirby-list-item\n *ngFor=\"let item of items; let i = index; trackBy: trackBy || defaultTrackBy\"\n [item]=\"item\"\n [itemTemplate]=\"itemTemplate\"\n [swipeActions]=\"swipeActions\"\n [boundaryClass]=\"_getBoundaryClass(i, items)\"\n [isSelectable]=\"_isSelectable\"\n [getItemColor]=\"getItemColor\"\n [isSelected]=\"_isSelectable && item === _selectedItem\"\n (itemSelect)=\"onItemSelect($event)\"\n (swipeActionSelect)=\"onSwipeActionSelect($event)\"\n [class.is-single]=\"items.length === 1\"\n >\n </kirby-list-item>\n</ng-template>\n",
|
|
7627
8138
|
providers: [ListHelper, GroupByPipe],
|
|
7628
|
-
styles: [":host{display:block}.list{box-shadow:0 5px 10px -10px rgba(28,28,28,.3),0 0 5px 0 rgba(28,28,28,.08);background:transparent;contain:inherit;padding:0}ion-list-header{background-color:var(--kirby-white);border-bottom:1px solid var(--kirby-background-color);padding:0;text-transform:inherit;letter-spacing:inherit;font-weight:inherit;font-size:inherit;min-height:0;overflow:inherit}ion-item{--background:var(--kirby-white);--background-activated:var(--kirby-white-shade);--background-hover:var(--kirby-background-color);--background-focused:var(--kirby-background-color);--inner-border-width:0;--ion-safe-area-right:0;--min-height:56px;--padding-bottom:8px;--padding-end:16px;--padding-start:16px;--padding-top:8px;display:flex;font-size:14px;min-height:56px;overflow:visible;width:100%}ion-item-divider{font-weight:inherit}ion-item-sliding.item-sliding-active-slide{-webkit-backface-visibility:hidden;backface-visibility:hidden;transform:translateZ(0)}ion-item-sliding.light{--kirby-item-background:var(--kirby-light);--kirby-item-background-activated:var(--kirby-light-shade);--kirby-item-background-focused:var(--kirby-light-shade);--kirby-item-background-hover:var(--kirby-light-tint)}ion-item-sliding.light ion-item{--background:var(--kirby-light);--color:var(--kirby-light-contrast);--background-activated:var(--kirby-light-shade);--background-focused:var(--kirby-light-shade);--background-hover:var(--kirby-light-tint)}ion-item-group{margin-bottom:24px}ion-item-group:last-of-type{margin-bottom:0}ion-item-divider{--inner-padding-end:0;--color:unset;background-color:transparent;border-color:transparent;min-height:0;padding:0 16px 8px}.footer{background-color:var(--kirby-white);border-top:1px solid var(--kirby-background-color);display:flex;align-items:center;justify-content:space-between;width:100%}.loading,.no-more-items{width:100%;padding:24px 0;text-align:center}.swipe-action{display:flex;color:var(--kirby-black);background-color:transparent}.swipe-action
|
|
8139
|
+
styles: ["ion-item-option.primary{background-color:var(--kirby-primary);color:var(--kirby-primary-contrast)}ion-item-option.secondary{background-color:var(--kirby-secondary);color:var(--kirby-secondary-contrast)}ion-item-option.tertiary{background-color:var(--kirby-tertiary);color:var(--kirby-tertiary-contrast)}ion-item-option.success{background-color:var(--kirby-success);color:var(--kirby-success-contrast)}ion-item-option.warning{background-color:var(--kirby-warning);color:var(--kirby-warning-contrast)}ion-item-option.danger{background-color:var(--kirby-danger);color:var(--kirby-danger-contrast)}ion-item-option.light{background-color:var(--kirby-light);color:var(--kirby-light-contrast)}ion-item-option.medium{background-color:var(--kirby-medium);color:var(--kirby-medium-contrast)}ion-item-option.dark{background-color:var(--kirby-dark);color:var(--kirby-dark-contrast)}:host{display:block}.list{box-shadow:0 5px 10px -10px rgba(28,28,28,.3),0 0 5px 0 rgba(28,28,28,.08);background:transparent;contain:inherit;padding:0}ion-list-header{background-color:var(--kirby-white);border-bottom:1px solid var(--kirby-background-color);padding:0;text-transform:inherit;letter-spacing:inherit;font-weight:inherit;font-size:inherit;min-height:0;overflow:inherit}ion-item{--background:var(--kirby-white);--background-activated:var(--kirby-white-shade);--background-hover:var(--kirby-background-color);--background-focused:var(--kirby-background-color);--inner-border-width:0;--ion-safe-area-right:0;--min-height:56px;--padding-bottom:8px;--padding-end:16px;--padding-start:16px;--padding-top:8px;display:flex;font-size:14px;min-height:56px;overflow:visible;width:100%}ion-item-divider{font-weight:inherit}ion-item-sliding.item-sliding-active-slide{-webkit-backface-visibility:hidden;backface-visibility:hidden;transform:translateZ(0)}ion-item-sliding.light{--kirby-item-background:var(--kirby-light);--kirby-item-background-activated:var(--kirby-light-shade);--kirby-item-background-focused:var(--kirby-light-shade);--kirby-item-background-hover:var(--kirby-light-tint)}ion-item-sliding.light ion-item{--background:var(--kirby-light);--color:var(--kirby-light-contrast);--background-activated:var(--kirby-light-shade);--background-focused:var(--kirby-light-shade);--background-hover:var(--kirby-light-tint)}ion-item-group{margin-bottom:24px}ion-item-group:last-of-type{margin-bottom:0}ion-item-divider{--inner-padding-end:0;--color:unset;background-color:transparent;border-color:transparent;min-height:0;padding:0 16px 8px}.footer{background-color:var(--kirby-white);border-top:1px solid var(--kirby-background-color);display:flex;align-items:center;justify-content:space-between;width:100%}.loading,.no-more-items{width:100%;padding:24px 0;text-align:center}.swipe-action{display:flex;color:var(--kirby-black);background-color:transparent}.swipe-action ion-item-option{height:100%;display:inline-block;text-align:center}.swipe-action .item-content{display:inline-grid;min-width:70px;flex-direction:column}.swipe-action .item-content ion-label{--background:unset;--color:unset}ion-item-options[side=end]{border-bottom-width:0}:host-context(.has-sections) .list{box-shadow:none}:host-context(.has-sections) .list-items{box-shadow:0 5px 10px -10px rgba(28,28,28,.3),0 0 5px 0 rgba(28,28,28,.08);border-radius:16px}:host-context(.has-sections) .footer{background-color:transparent;border-top:none}:host-context(.has-sections) ion-list-header{background-color:transparent;border-bottom:none}:host-context(.shape-rounded) .list,:host-context(.shape-rounded) .list-items{border-radius:16px}:host-context(.shape-rounded) ion-item-sliding.first,:host-context(.shape-rounded) ion-item.first,:host-context(.shape-rounded) ion-list-header{border-top-left-radius:16px;border-top-right-radius:16px;-webkit-mask-image:-webkit-radial-gradient(#fff,#000)}:host-context(.shape-rounded):not(.has-sections) .has-header ion-item,:host-context(.shape-rounded):not(.has-sections) .has-header ion-item-sliding,:host-context(.shape-rounded) ion-item-sliding>ion-item{border-top-left-radius:0;border-top-right-radius:0}:host-context(.shape-rounded) .footer,:host-context(.shape-rounded) ion-item-sliding.last,:host-context(.shape-rounded) ion-item.last{border-bottom-left-radius:16px;border-bottom-right-radius:16px;-webkit-mask-image:-webkit-radial-gradient(#fff,#000)}:host-context(.shape-rounded):not(.has-sections) .has-footer ion-item,:host-context(.shape-rounded):not(.has-sections) .has-footer ion-item-sliding,:host-context(.shape-rounded) ion-item-sliding>ion-item{border-bottom-left-radius:0;border-bottom-right-radius:0}:host-context(.shape-none) .list,:host-context(.shape-none) .list-items{box-shadow:none;border-radius:unset}:host-context(.shape-none) .list ion-item,:host-context(.shape-none) .list ion-item-sliding{--padding-start:0;--padding-end:0;--padding-top:0;--padding-bottom:0;--inner-padding-start:0;--inner-padding-end:0;--inner-padding-top:0;--inner-padding-bottom:0;--background:none;--background-activated:none;--background-hover:none;--background-focused:none;overflow:visible}:host-context(.item-spacing) .list kirby-list-item{margin-bottom:16px}:host-context(.item-spacing) .list kirby-list-item:last-child,:host-context(.item-spacing) .list kirby-list-item>ion-item{margin-bottom:0}"]
|
|
7629
8140
|
},] }
|
|
7630
8141
|
];
|
|
7631
8142
|
/** @nocollapse */
|
|
@@ -7792,7 +8303,7 @@
|
|
|
7792
8303
|
{ type: i0.Component, args: [{
|
|
7793
8304
|
selector: 'kirby-list-item',
|
|
7794
8305
|
template: "<ion-item-sliding\n [class.selected]=\"isSelected\"\n [kirbyListItemColor]=\"getItemColor\"\n [item]=\"item\"\n [disabled]=\"_isSwipingEnabled ? null : true\"\n keyHandler\n [ngClass]=\"boundaryClass\"\n (click)=\"_onItemSelect(item)\"\n>\n <ng-container\n *ngTemplateOutlet=\"swipeActionsTemplate; context: { $implicit: item }\"\n ></ng-container>\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n</ion-item-sliding>\n\n<ng-template #swipeActionsTemplate let-item>\n <ion-item-options *ngIf=\"_hasSwipeActions(item)\" [side]=\"_getSwipeActionEnd(item)\">\n <div class=\"swipe-action\">\n <ng-container *ngFor=\"let swipeAction of _getSwipeActions(item)\">\n <ion-item-option\n [ngClass]=\"_getSwipeActionType(swipeAction, item)\"\n (click)=\"_onSwipeActionSelect(swipeAction, item, $event)\"\n >\n <div class=\"item-content\">\n <kirby-icon\n *ngIf=\"_getSwipeActionIcon(swipeAction, item)\"\n size=\"sm\"\n [name]=\"_getSwipeActionIcon(swipeAction, item)\"\n >\n </kirby-icon>\n <ion-label>\n {{ _getSwipeActionTitle(swipeAction, item) }}\n </ion-label>\n </div>\n </ion-item-option>\n </ng-container>\n </div>\n </ion-item-options>\n</ng-template>\n",
|
|
7795
|
-
styles: [":host{display:block}.list{box-shadow:0 5px 10px -10px rgba(28,28,28,.3),0 0 5px 0 rgba(28,28,28,.08);background:transparent;contain:inherit;padding:0}ion-list-header{background-color:var(--kirby-white);border-bottom:1px solid var(--kirby-background-color);padding:0;text-transform:inherit;letter-spacing:inherit;font-weight:inherit;font-size:inherit;min-height:0;overflow:inherit}ion-item{--background:var(--kirby-white);--background-activated:var(--kirby-white-shade);--background-hover:var(--kirby-background-color);--background-focused:var(--kirby-background-color);--inner-border-width:0;--ion-safe-area-right:0;--min-height:56px;--padding-bottom:8px;--padding-end:16px;--padding-start:16px;--padding-top:8px;display:flex;font-size:14px;min-height:56px;overflow:visible;width:100%}ion-item-divider{font-weight:inherit}ion-item-sliding.item-sliding-active-slide{-webkit-backface-visibility:hidden;backface-visibility:hidden;transform:translateZ(0)}ion-item-sliding.light{--kirby-item-background:var(--kirby-light);--kirby-item-background-activated:var(--kirby-light-shade);--kirby-item-background-focused:var(--kirby-light-shade);--kirby-item-background-hover:var(--kirby-light-tint)}ion-item-sliding.light ion-item{--background:var(--kirby-light);--color:var(--kirby-light-contrast);--background-activated:var(--kirby-light-shade);--background-focused:var(--kirby-light-shade);--background-hover:var(--kirby-light-tint)}ion-item-group{margin-bottom:24px}ion-item-group:last-of-type{margin-bottom:0}ion-item-divider{--inner-padding-end:0;--color:unset;background-color:transparent;border-color:transparent;min-height:0;padding:0 16px 8px}.footer{background-color:var(--kirby-white);border-top:1px solid var(--kirby-background-color);display:flex;align-items:center;justify-content:space-between;width:100%}.loading,.no-more-items{width:100%;padding:24px 0;text-align:center}.swipe-action{display:flex;color:var(--kirby-black);background-color:transparent}.swipe-action
|
|
8306
|
+
styles: ["ion-item-option.primary{background-color:var(--kirby-primary);color:var(--kirby-primary-contrast)}ion-item-option.secondary{background-color:var(--kirby-secondary);color:var(--kirby-secondary-contrast)}ion-item-option.tertiary{background-color:var(--kirby-tertiary);color:var(--kirby-tertiary-contrast)}ion-item-option.success{background-color:var(--kirby-success);color:var(--kirby-success-contrast)}ion-item-option.warning{background-color:var(--kirby-warning);color:var(--kirby-warning-contrast)}ion-item-option.danger{background-color:var(--kirby-danger);color:var(--kirby-danger-contrast)}ion-item-option.light{background-color:var(--kirby-light);color:var(--kirby-light-contrast)}ion-item-option.medium{background-color:var(--kirby-medium);color:var(--kirby-medium-contrast)}ion-item-option.dark{background-color:var(--kirby-dark);color:var(--kirby-dark-contrast)}:host{display:block}.list{box-shadow:0 5px 10px -10px rgba(28,28,28,.3),0 0 5px 0 rgba(28,28,28,.08);background:transparent;contain:inherit;padding:0}ion-list-header{background-color:var(--kirby-white);border-bottom:1px solid var(--kirby-background-color);padding:0;text-transform:inherit;letter-spacing:inherit;font-weight:inherit;font-size:inherit;min-height:0;overflow:inherit}ion-item{--background:var(--kirby-white);--background-activated:var(--kirby-white-shade);--background-hover:var(--kirby-background-color);--background-focused:var(--kirby-background-color);--inner-border-width:0;--ion-safe-area-right:0;--min-height:56px;--padding-bottom:8px;--padding-end:16px;--padding-start:16px;--padding-top:8px;display:flex;font-size:14px;min-height:56px;overflow:visible;width:100%}ion-item-divider{font-weight:inherit}ion-item-sliding.item-sliding-active-slide{-webkit-backface-visibility:hidden;backface-visibility:hidden;transform:translateZ(0)}ion-item-sliding.light{--kirby-item-background:var(--kirby-light);--kirby-item-background-activated:var(--kirby-light-shade);--kirby-item-background-focused:var(--kirby-light-shade);--kirby-item-background-hover:var(--kirby-light-tint)}ion-item-sliding.light ion-item{--background:var(--kirby-light);--color:var(--kirby-light-contrast);--background-activated:var(--kirby-light-shade);--background-focused:var(--kirby-light-shade);--background-hover:var(--kirby-light-tint)}ion-item-group{margin-bottom:24px}ion-item-group:last-of-type{margin-bottom:0}ion-item-divider{--inner-padding-end:0;--color:unset;background-color:transparent;border-color:transparent;min-height:0;padding:0 16px 8px}.footer{background-color:var(--kirby-white);border-top:1px solid var(--kirby-background-color);display:flex;align-items:center;justify-content:space-between;width:100%}.loading,.no-more-items{width:100%;padding:24px 0;text-align:center}.swipe-action{display:flex;color:var(--kirby-black);background-color:transparent}.swipe-action ion-item-option{height:100%;display:inline-block;text-align:center}.swipe-action .item-content{display:inline-grid;min-width:70px;flex-direction:column}.swipe-action .item-content ion-label{--background:unset;--color:unset}ion-item-options[side=end]{border-bottom-width:0}:host-context(.has-sections) .list{box-shadow:none}:host-context(.has-sections) .list-items{box-shadow:0 5px 10px -10px rgba(28,28,28,.3),0 0 5px 0 rgba(28,28,28,.08);border-radius:16px}:host-context(.has-sections) .footer{background-color:transparent;border-top:none}:host-context(.has-sections) ion-list-header{background-color:transparent;border-bottom:none}:host-context(.shape-rounded) .list,:host-context(.shape-rounded) .list-items{border-radius:16px}:host-context(.shape-rounded) ion-item-sliding.first,:host-context(.shape-rounded) ion-item.first,:host-context(.shape-rounded) ion-list-header{border-top-left-radius:16px;border-top-right-radius:16px;-webkit-mask-image:-webkit-radial-gradient(#fff,#000)}:host-context(.shape-rounded):not(.has-sections) .has-header ion-item,:host-context(.shape-rounded):not(.has-sections) .has-header ion-item-sliding,:host-context(.shape-rounded) ion-item-sliding>ion-item{border-top-left-radius:0;border-top-right-radius:0}:host-context(.shape-rounded) .footer,:host-context(.shape-rounded) ion-item-sliding.last,:host-context(.shape-rounded) ion-item.last{border-bottom-left-radius:16px;border-bottom-right-radius:16px;-webkit-mask-image:-webkit-radial-gradient(#fff,#000)}:host-context(.shape-rounded):not(.has-sections) .has-footer ion-item,:host-context(.shape-rounded):not(.has-sections) .has-footer ion-item-sliding,:host-context(.shape-rounded) ion-item-sliding>ion-item{border-bottom-left-radius:0;border-bottom-right-radius:0}:host-context(.shape-none) .list,:host-context(.shape-none) .list-items{box-shadow:none;border-radius:unset}:host-context(.shape-none) .list ion-item,:host-context(.shape-none) .list ion-item-sliding{--padding-start:0;--padding-end:0;--padding-top:0;--padding-bottom:0;--inner-padding-start:0;--inner-padding-end:0;--inner-padding-top:0;--inner-padding-bottom:0;--background:none;--background-activated:none;--background-hover:none;--background-focused:none;overflow:visible}:host-context(.item-spacing) .list kirby-list-item{margin-bottom:16px}:host-context(.item-spacing) .list kirby-list-item:last-child,:host-context(.item-spacing) .list kirby-list-item>ion-item{margin-bottom:0}", ":host{overflow:hidden}:host-context(.has-divider) ion-item-sliding:not(.last){border-bottom:1px solid var(--kirby-background-color)}"]
|
|
7796
8307
|
},] }
|
|
7797
8308
|
];
|
|
7798
8309
|
/** @nocollapse */
|
|
@@ -7841,6 +8352,11 @@
|
|
|
7841
8352
|
var ListExperimentalComponent = /** @class */ (function () {
|
|
7842
8353
|
function ListExperimentalComponent() {
|
|
7843
8354
|
}
|
|
8355
|
+
ListExperimentalComponent.prototype.closeAllSlidingItems = function (e) {
|
|
8356
|
+
if (elementHasAncestor(e.target, 'ion-item-option', 'ion-list')) {
|
|
8357
|
+
this.list.closeSlidingItems();
|
|
8358
|
+
}
|
|
8359
|
+
};
|
|
7844
8360
|
return ListExperimentalComponent;
|
|
7845
8361
|
}());
|
|
7846
8362
|
ListExperimentalComponent.decorators = [
|
|
@@ -7849,6 +8365,10 @@
|
|
|
7849
8365
|
template: "<ion-list>\n <ng-content></ng-content>\n</ion-list>\n"
|
|
7850
8366
|
},] }
|
|
7851
8367
|
];
|
|
8368
|
+
ListExperimentalComponent.propDecorators = {
|
|
8369
|
+
list: [{ type: i0.ViewChild, args: [i1.IonList, { static: true },] }],
|
|
8370
|
+
closeAllSlidingItems: [{ type: i0.HostListener, args: ['click', ['$event'],] }]
|
|
8371
|
+
};
|
|
7852
8372
|
|
|
7853
8373
|
var ReorderEvent = /** @class */ (function () {
|
|
7854
8374
|
function ReorderEvent(ev, parentItem) {
|
|
@@ -8622,6 +9142,19 @@
|
|
|
8622
9142
|
},] }
|
|
8623
9143
|
];
|
|
8624
9144
|
|
|
9145
|
+
var SectionHeaderComponent = /** @class */ (function () {
|
|
9146
|
+
function SectionHeaderComponent() {
|
|
9147
|
+
}
|
|
9148
|
+
return SectionHeaderComponent;
|
|
9149
|
+
}());
|
|
9150
|
+
SectionHeaderComponent.decorators = [
|
|
9151
|
+
{ type: i0.Component, args: [{
|
|
9152
|
+
selector: 'kirby-section-header',
|
|
9153
|
+
template: "<ion-item-divider>\n <ng-content></ng-content>\n</ion-item-divider>\n",
|
|
9154
|
+
styles: [":host{--kirby-section-header-color:var(--kirby-text-color-black)}:host ion-item-divider{--inner-padding-end:0;--background:transparent;--padding-end:16px;--padding-start:16px;font-weight:inherit;min-height:0}:host ion-item-divider ::ng-deep>[heading]{font-weight:700;font-size:18px;line-height:24px;color:var(--kirby-section-header-color);margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host ion-item-divider ::ng-deep>[detail],:host ion-item-divider ::ng-deep>[label]{font-weight:300;font-size:14px;line-height:20px;color:var(--kirby-section-header-color);margin:4px 0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]
|
|
9155
|
+
},] }
|
|
9156
|
+
];
|
|
9157
|
+
|
|
8625
9158
|
(function (SegmentedControlMode) {
|
|
8626
9159
|
SegmentedControlMode["chip"] = "chip";
|
|
8627
9160
|
SegmentedControlMode["compactChip"] = "compactChip";
|
|
@@ -9832,11 +10365,13 @@
|
|
|
9832
10365
|
SlideDirective,
|
|
9833
10366
|
AccordionDirective,
|
|
9834
10367
|
AccordionItemComponent,
|
|
10368
|
+
ItemSlidingComponent,
|
|
9835
10369
|
RadioComponent,
|
|
9836
10370
|
RadioGroupComponent,
|
|
9837
10371
|
RangeComponent,
|
|
9838
10372
|
ElementAsButtonDirective,
|
|
9839
10373
|
ItemGroupComponent,
|
|
10374
|
+
SectionHeaderComponent,
|
|
9840
10375
|
];
|
|
9841
10376
|
var declarations$1 = __spread(exportedDeclarations$1, [
|
|
9842
10377
|
KeyHandlerDirective,
|
|
@@ -10021,6 +10556,7 @@
|
|
|
10021
10556
|
exports.ItemComponent = ItemComponent;
|
|
10022
10557
|
exports.ItemGroupComponent = ItemGroupComponent;
|
|
10023
10558
|
exports.ItemModule = ItemModule;
|
|
10559
|
+
exports.ItemSlidingComponent = ItemSlidingComponent;
|
|
10024
10560
|
exports.KeyHandlerDirective = KeyHandlerDirective;
|
|
10025
10561
|
exports.KirbyModule = KirbyModule;
|
|
10026
10562
|
exports.LabelComponent = LabelComponent;
|
|
@@ -10065,6 +10601,7 @@
|
|
|
10065
10601
|
exports.RouterOutletComponent = RouterOutletComponent;
|
|
10066
10602
|
exports.RouterOutletModule = RouterOutletModule;
|
|
10067
10603
|
exports.ScssHelper = ScssHelper;
|
|
10604
|
+
exports.SectionHeaderComponent = SectionHeaderComponent;
|
|
10068
10605
|
exports.SegmentedControlComponent = SegmentedControlComponent;
|
|
10069
10606
|
exports.SlideButtonComponent = SlideButtonComponent;
|
|
10070
10607
|
exports.SlideDirective = SlideDirective;
|
|
@@ -10082,10 +10619,11 @@
|
|
|
10082
10619
|
exports.ToggleComponent = ToggleComponent;
|
|
10083
10620
|
exports.annotations = annotations;
|
|
10084
10621
|
exports.defaultIcons = defaultIcons;
|
|
10622
|
+
exports.elementHasAncestor = elementHasAncestor;
|
|
10085
10623
|
exports.isNumberArray = isNumberArray;
|
|
10086
10624
|
exports.selectedTabClickEvent = selectedTabClickEvent;
|
|
10087
10625
|
exports.stockChartDeprecatedOptions = stockChartDeprecatedOptions;
|
|
10088
|
-
exports.ɵ0 = ɵ0$
|
|
10626
|
+
exports.ɵ0 = ɵ0$8;
|
|
10089
10627
|
exports.ɵa = ProxyCmp;
|
|
10090
10628
|
exports.ɵb = AppModule;
|
|
10091
10629
|
exports.ɵba = ModalWrapperComponent;
|
|
@@ -10183,20 +10721,22 @@
|
|
|
10183
10721
|
exports.ɵem = SlidesComponent;
|
|
10184
10722
|
exports.ɵen = AccordionDirective;
|
|
10185
10723
|
exports.ɵeo = AccordionItemComponent;
|
|
10186
|
-
exports.ɵep =
|
|
10187
|
-
exports.ɵeq =
|
|
10188
|
-
exports.ɵer =
|
|
10189
|
-
exports.ɵes =
|
|
10190
|
-
exports.ɵet =
|
|
10191
|
-
exports.ɵeu =
|
|
10192
|
-
exports.ɵev =
|
|
10193
|
-
exports.ɵew =
|
|
10194
|
-
exports.ɵex =
|
|
10195
|
-
exports.ɵey =
|
|
10196
|
-
exports.ɵez =
|
|
10724
|
+
exports.ɵep = ItemSlidingComponent;
|
|
10725
|
+
exports.ɵeq = RangeComponent;
|
|
10726
|
+
exports.ɵer = ElementAsButtonDirective;
|
|
10727
|
+
exports.ɵes = ItemGroupComponent;
|
|
10728
|
+
exports.ɵet = SectionHeaderComponent;
|
|
10729
|
+
exports.ɵeu = KeyHandlerDirective;
|
|
10730
|
+
exports.ɵev = FormFieldMessageComponent;
|
|
10731
|
+
exports.ɵew = AlertComponent;
|
|
10732
|
+
exports.ɵex = ModalCompactWrapperComponent;
|
|
10733
|
+
exports.ɵey = ProgressCircleRingComponent;
|
|
10734
|
+
exports.ɵez = ToastHelper;
|
|
10197
10735
|
exports.ɵf = ModalHelper;
|
|
10198
|
-
exports.ɵfa =
|
|
10199
|
-
exports.ɵfb =
|
|
10736
|
+
exports.ɵfa = ToastController;
|
|
10737
|
+
exports.ɵfb = LoadingOverlayService;
|
|
10738
|
+
exports.ɵfc = appInitialize;
|
|
10739
|
+
exports.ɵfd = customElementsInitializer;
|
|
10200
10740
|
exports.ɵg = ModalAnimationBuilderService;
|
|
10201
10741
|
exports.ɵh = PlatformService;
|
|
10202
10742
|
exports.ɵi = WindowRef;
|