intelica-library-ui 0.1.78 → 0.1.80

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.
@@ -156,6 +156,19 @@ const domain = window.location.hostname.split(".").slice(-2).join(".");
156
156
  const secure = !domain.includes("localhost");
157
157
  const CookieAttributesGeneral = { domain: domain, path: "/", secure: secure };
158
158
 
159
+ const Color = {
160
+ mastercard: '#ff7f00',
161
+ visa: '#17375E',
162
+ amex: '#348AD5',
163
+ orange: '#ff7f00',
164
+ blue: '#17375E',
165
+ gray: '#D3D3D3',
166
+ gray3: '#a6a5a1',
167
+ };
168
+ const getColor = (name) => {
169
+ return Color[name];
170
+ };
171
+
159
172
  class FeatureFlagService {
160
173
  _http = inject(HttpClient);
161
174
  _configService = inject(ConfigService);
@@ -3097,30 +3110,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
3097
3110
  }] });
3098
3111
 
3099
3112
  class EchartService {
3100
- getDefaultSeriesColors() {
3113
+ _sharedService = inject(SharedService);
3114
+ /// Chart Generals
3115
+ getDefultAxisConfiguration(type, data, showAxis = true, showSplitLine = false) {
3101
3116
  return {
3102
- mastercard: "#ff7f00",
3103
- visa: "#17375E",
3104
- amex: "#348AD5",
3105
- orange: "#ff7f00",
3106
- blue: "#17375E",
3107
- gray: "#D3D3D3",
3108
- gray3: "#a6a5a1",
3109
- };
3110
- }
3111
- getTooltipCssText() {
3112
- return `border-color: ${this.getDefaultSeriesColors()["blue"]};`;
3113
- }
3114
- getTooltipFormatter(htmlContent) {
3115
- return `
3116
- <div>
3117
- ${htmlContent}
3118
- </div>
3119
- `;
3120
- }
3121
- getDefultAxisConfiguration(type, show = true, data) {
3122
- let axis = {
3123
- show: show,
3117
+ show: showAxis,
3124
3118
  type: type,
3125
3119
  data: data,
3126
3120
  axisTick: {
@@ -3128,31 +3122,148 @@ class EchartService {
3128
3122
  },
3129
3123
  axisLine: {
3130
3124
  show: false,
3125
+ lineStyle: { color: getColor('gray'), type: 'dashed' },
3131
3126
  },
3132
3127
  splitLine: {
3133
- show: false,
3128
+ show: showSplitLine,
3129
+ lineStyle: {
3130
+ color: Color.gray,
3131
+ type: 'dashed',
3132
+ width: 1,
3133
+ },
3134
3134
  },
3135
3135
  axisLabel: {
3136
- color: this.getDefaultSeriesColors()["blue"],
3137
- fontSize: 12,
3136
+ show: showAxis,
3137
+ color: Color.gray3,
3138
+ fontSize: 14,
3139
+ padding: 10,
3138
3140
  },
3139
3141
  };
3140
- return axis;
3142
+ }
3143
+ getCategoryAxisConfiguration(data) {
3144
+ return this.getDefultAxisConfiguration('category', data, true);
3145
+ }
3146
+ getValueAxisConfiguration(showAxis = false, format = false, showAxisLines = false) {
3147
+ let axisConfiguration = this.getDefultAxisConfiguration('value', undefined, showAxis, showAxisLines);
3148
+ if (format) {
3149
+ axisConfiguration.axisLabel.formatter = (value) => this._sharedService.FormatNumberWithSuffix(value);
3150
+ }
3151
+ return axisConfiguration;
3152
+ }
3153
+ getTooltipFormatter(color, title, body) {
3154
+ return `
3155
+ <div style="font-size: 12px; color: ${color}; border-radius: 6px; min-width: 120px; text-align: center;">
3156
+ <b style=" font-size: 13px;">${title} </b><br>
3157
+ <hr style="border: 1px solid ${color}; margin: 4px 0;">
3158
+ ${body}
3159
+ </div>
3160
+ `;
3161
+ }
3162
+ getGridConfiguration() {
3163
+ return {
3164
+ left: '10%',
3165
+ right: '10%',
3166
+ bottom: '10%',
3167
+ containLabel: true,
3168
+ };
3169
+ }
3170
+ getLegendConfiguration() {
3171
+ return {
3172
+ orient: 'horizontal', // 'horizontal | vertical'
3173
+ icon: 'circle',
3174
+ bottom: 5,
3175
+ align: 'auto',
3176
+ itemGap: 20,
3177
+ textStyle: { color: Color.blue, fontSize: 14 },
3178
+ };
3179
+ }
3180
+ /// Charts Configuration
3181
+ getBarChartOptions(categories, series, labelConfig, tooltipConfig) {
3182
+ return {
3183
+ xAxis: this.getCategoryAxisConfiguration(categories),
3184
+ yAxis: this.getValueAxisConfiguration(),
3185
+ series: [
3186
+ ...series.map((item) => ({
3187
+ type: 'bar',
3188
+ name: item.name,
3189
+ itemStyle: { color: item.color },
3190
+ data: item.value,
3191
+ barWidth: '25%',
3192
+ barGap: '0%',
3193
+ label: {
3194
+ show: true,
3195
+ position: 'top',
3196
+ color: Color.blue,
3197
+ fontSize: 12,
3198
+ formatter: labelConfig,
3199
+ },
3200
+ })),
3201
+ ],
3202
+ tooltip: {
3203
+ trigger: 'item',
3204
+ backgroundColor: '#FFFFFF',
3205
+ borderWidth: 2,
3206
+ textStyle: { fontSize: 12 },
3207
+ formatter: tooltipConfig,
3208
+ },
3209
+ grid: this.getGridConfiguration(),
3210
+ legend: this.getLegendConfiguration(),
3211
+ };
3212
+ }
3213
+ getBarChartStackOptions(categories, series, labelConfig, tooltipConfig) {
3214
+ let barBase = this.getBarChartOptions(categories, series, labelConfig, tooltipConfig);
3215
+ barBase.series.forEach((serie, index) => {
3216
+ serie.barWidth = '50%';
3217
+ serie.barGap = '0%';
3218
+ serie.barCategoryGap = '10%';
3219
+ serie.stack = 'total';
3220
+ if (index < series.length - 1) {
3221
+ serie.label = undefined;
3222
+ }
3223
+ });
3224
+ return barBase;
3225
+ }
3226
+ getBarChartHorizontalOptions(categories, series, labelConfig, tooltipConfig) {
3227
+ let barBase = this.getBarChartOptions(categories, series, labelConfig, tooltipConfig);
3228
+ barBase.xAxis = this.getValueAxisConfiguration();
3229
+ barBase.yAxis = this.getCategoryAxisConfiguration(categories);
3230
+ barBase.series.forEach((serie) => {
3231
+ if (serie.label) {
3232
+ serie.label.position = 'right';
3233
+ }
3234
+ });
3235
+ return barBase;
3236
+ }
3237
+ getBarChartHorizontalStackOptions(categories, series, labelConfig, tooltipConfig) {
3238
+ let barBase = this.getBarChartHorizontalOptions(categories, series, labelConfig, tooltipConfig);
3239
+ barBase.series.forEach((serie, index) => {
3240
+ serie.barWidth = '50%';
3241
+ serie.barGap = '0%';
3242
+ serie.barCategoryGap = '10%';
3243
+ serie.stack = 'total';
3244
+ if (serie.label) {
3245
+ serie.label.position = 'right';
3246
+ }
3247
+ if (index < series.length - 1) {
3248
+ serie.label = undefined;
3249
+ }
3250
+ });
3251
+ return barBase;
3141
3252
  }
3142
3253
  getRateDoughnutPie(data) {
3143
- const rateData = data.find(d => d.name.toLowerCase() !== "placeholder");
3254
+ const rateData = data.find((d) => d.name.toLowerCase() !== 'placeholder');
3144
3255
  return {
3145
3256
  tooltip: {
3146
- trigger: "none",
3257
+ trigger: 'none',
3147
3258
  },
3148
3259
  series: [
3149
3260
  {
3150
- name: "RateDoughnutPie",
3151
- type: "pie",
3261
+ name: 'RateDoughnutPie',
3262
+ type: 'pie',
3152
3263
  tooltip: {
3153
- trigger: "none",
3264
+ trigger: 'none',
3154
3265
  },
3155
- radius: ["70%", "60%"],
3266
+ radius: ['70%', '60%'],
3156
3267
  data: data,
3157
3268
  startAngle: 0,
3158
3269
  selectedMode: false,
@@ -3163,20 +3274,20 @@ class EchartService {
3163
3274
  return `${rateData.name}`;
3164
3275
  },
3165
3276
  color: rateData.itemStyle.color,
3166
- fontSize: "40",
3167
- position: "center",
3277
+ fontSize: '40',
3278
+ position: 'center',
3168
3279
  },
3169
3280
  },
3170
3281
  ],
3171
3282
  };
3172
3283
  }
3173
3284
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: EchartService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3174
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: EchartService, providedIn: "root" });
3285
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: EchartService, providedIn: 'root' });
3175
3286
  }
3176
3287
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: EchartService, decorators: [{
3177
3288
  type: Injectable,
3178
3289
  args: [{
3179
- providedIn: "root",
3290
+ providedIn: 'root',
3180
3291
  }]
3181
3292
  }] });
3182
3293
 
@@ -5603,5 +5714,5 @@ const IntelicaTheme = definePreset(Aura, {
5603
5714
  * Generated bundle index. Do not edit.
5604
5715
  */
5605
5716
 
5606
- export { ActionDirective, ActionsMenuComponent, ButtonSplitComponent, ColumnComponent, ColumnGroupComponent, CompareByField, ConfigService, CookieAttributesGeneral, DynamicInputValidation, EchartComponent, EchartService, EmailInputValidation, ErrorInterceptor, FeatureFlagService, GlobalFeatureFlagService, GlobalTermService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaTheme, ItemSplitDirective, LanguageService, ModalDialogComponent, OrderConstants, PaginatorComponent, Patterns, PopoverComponent, ProfileService, RecordPerPageComponent, RefreshTokenInterceptor, RowResumenComponent, SearchComponent, SharedService, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TemplateMenuComponent, TermGuard, TermPipe, TermService, decryptData, encryptData };
5717
+ export { ActionDirective, ActionsMenuComponent, ButtonSplitComponent, Color, ColumnComponent, ColumnGroupComponent, CompareByField, ConfigService, CookieAttributesGeneral, DynamicInputValidation, EchartComponent, EchartService, EmailInputValidation, ErrorInterceptor, FeatureFlagService, GlobalFeatureFlagService, GlobalTermService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaTheme, ItemSplitDirective, LanguageService, ModalDialogComponent, OrderConstants, PaginatorComponent, Patterns, PopoverComponent, ProfileService, RecordPerPageComponent, RefreshTokenInterceptor, RowResumenComponent, SearchComponent, SharedService, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TemplateMenuComponent, TermGuard, TermPipe, TermService, decryptData, encryptData, getColor };
5607
5718
  //# sourceMappingURL=intelica-library-ui.mjs.map