dp-widgets-framework 1.3.0 → 1.3.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/dist/index.esm.js CHANGED
@@ -15038,9 +15038,8 @@ const Line = /* #__PURE__ */ createTypedChart('line', LineController);
15038
15038
  const Bar = /* #__PURE__ */ createTypedChart('bar', BarController);
15039
15039
  const Pie = /* #__PURE__ */ createTypedChart('pie', PieController);
15040
15040
 
15041
- Chart$1.register(CategoryScale, LinearScale, BarElement, plugin_title, plugin_tooltip, plugin_legend);
15041
+ Chart$1.register(CategoryScale, LinearScale, BarElement, plugin_title, plugin_tooltip, plugin_legend, ChartDataLabels);
15042
15042
  function BarChart({ orientation, title, data, options, className, units, content }) {
15043
- var _a;
15044
15043
  const formatValue = (value) => {
15045
15044
  const numValue = typeof value === 'string' ? parseFloat(value) : value;
15046
15045
  if (units === '$' && !isNaN(numValue)) {
@@ -15070,8 +15069,11 @@ function BarChart({ orientation, title, data, options, className, units, content
15070
15069
  position: "bottom"
15071
15070
  },
15072
15071
  datalabels: {
15073
- display: (_a = content === null || content === void 0 ? void 0 : content.showLabels) !== null && _a !== void 0 ? _a : false,
15072
+ display: (context) => { var _a; return context.dataset.data[context.dataIndex] !== null && ((_a = content === null || content === void 0 ? void 0 : content.showLabels) !== null && _a !== void 0 ? _a : false); },
15074
15073
  color: "white",
15074
+ anchor: "center",
15075
+ align: "center",
15076
+ offset: 0,
15075
15077
  font: { size: 12 },
15076
15078
  formatter: (value) => value,
15077
15079
  },
@@ -15114,12 +15116,11 @@ function BarChart({ orientation, title, data, options, className, units, content
15114
15116
  },
15115
15117
  },
15116
15118
  };
15117
- return (jsxRuntimeExports.jsx(Bar, { data: data, options: options !== null && options !== void 0 ? options : defaultOptions, plugins: [ChartDataLabels] }));
15119
+ return (jsxRuntimeExports.jsx(Bar, { data: data, options: options !== null && options !== void 0 ? options : defaultOptions }));
15118
15120
  }
15119
15121
 
15120
- Chart$1.register(CategoryScale, LinearScale, BarElement, plugin_title, plugin_tooltip, plugin_legend);
15122
+ Chart$1.register(CategoryScale, LinearScale, BarElement, plugin_title, plugin_tooltip, plugin_legend, ChartDataLabels);
15121
15123
  function SeriesChart({ orientation, title, data, options, className, units, content }) {
15122
- var _a;
15123
15124
  const formatValue = (value) => {
15124
15125
  const numValue = typeof value === 'string' ? parseFloat(value) : value;
15125
15126
  if (units === '$' && !isNaN(numValue)) {
@@ -15149,8 +15150,11 @@ function SeriesChart({ orientation, title, data, options, className, units, cont
15149
15150
  position: "bottom"
15150
15151
  },
15151
15152
  datalabels: {
15152
- display: (_a = content === null || content === void 0 ? void 0 : content.showLabels) !== null && _a !== void 0 ? _a : false,
15153
+ display: (context) => { var _a; return context.dataset.data[context.dataIndex] !== null && ((_a = content === null || content === void 0 ? void 0 : content.showLabels) !== null && _a !== void 0 ? _a : false); },
15153
15154
  color: "white",
15155
+ anchor: "center",
15156
+ align: "center",
15157
+ offset: 0,
15154
15158
  font: { size: 12 },
15155
15159
  formatter: (value) => value,
15156
15160
  },
@@ -15189,12 +15193,11 @@ function SeriesChart({ orientation, title, data, options, className, units, cont
15189
15193
  },
15190
15194
  },
15191
15195
  };
15192
- return (jsxRuntimeExports.jsx(Bar, { data: data, options: options !== null && options !== void 0 ? options : defaultOptions, plugins: [ChartDataLabels] }));
15196
+ return (jsxRuntimeExports.jsx(Bar, { data: data, options: options !== null && options !== void 0 ? options : defaultOptions }));
15193
15197
  }
15194
15198
 
15195
- Chart$1.register(CategoryScale, LinearScale, PointElement, LineElement, plugin_title, plugin_tooltip, plugin_legend);
15199
+ Chart$1.register(CategoryScale, LinearScale, PointElement, LineElement, plugin_title, plugin_tooltip, plugin_legend, ChartDataLabels);
15196
15200
  function SeriesLineChart({ orientation, title, data, options, className, units, content }) {
15197
- var _a;
15198
15201
  const formatValue = (value) => {
15199
15202
  const numValue = typeof value === 'string' ? parseFloat(value) : value;
15200
15203
  if (units === '$' && !isNaN(numValue)) {
@@ -15223,7 +15226,7 @@ function SeriesLineChart({ orientation, title, data, options, className, units,
15223
15226
  position: "bottom"
15224
15227
  },
15225
15228
  datalabels: {
15226
- display: (_a = content === null || content === void 0 ? void 0 : content.showLabels) !== null && _a !== void 0 ? _a : false,
15229
+ display: (context) => { var _a; return context.dataset.data[context.dataIndex] !== null && ((_a = content === null || content === void 0 ? void 0 : content.showLabels) !== null && _a !== void 0 ? _a : false); },
15227
15230
  color: "#0F172A",
15228
15231
  font: { size: 12 },
15229
15232
  offset: 6,
@@ -15275,12 +15278,11 @@ function SeriesLineChart({ orientation, title, data, options, className, units,
15275
15278
  },
15276
15279
  },
15277
15280
  };
15278
- return (jsxRuntimeExports.jsx(Line, { data: data, options: options !== null && options !== void 0 ? options : defaultOptions, plugins: [ChartDataLabels] }));
15281
+ return (jsxRuntimeExports.jsx(Line, { data: data, options: options !== null && options !== void 0 ? options : defaultOptions }));
15279
15282
  }
15280
15283
 
15281
- Chart$1.register(ArcElement, plugin_tooltip, plugin_legend);
15284
+ Chart$1.register(ArcElement, plugin_tooltip, plugin_legend, ChartDataLabels);
15282
15285
  const PieChart = (props) => {
15283
- var _a;
15284
15286
  const { data, title, options, units, content } = props;
15285
15287
  const formatValue = (value) => {
15286
15288
  const numValue = typeof value === 'string' ? parseFloat(value) : value;
@@ -15301,10 +15303,10 @@ const PieChart = (props) => {
15301
15303
  position: "bottom",
15302
15304
  },
15303
15305
  datalabels: {
15304
- display: (_a = content === null || content === void 0 ? void 0 : content.showLabels) !== null && _a !== void 0 ? _a : false,
15306
+ display: (context) => { var _a; return context.dataset.data[context.dataIndex] !== null && ((_a = content === null || content === void 0 ? void 0 : content.showLabels) !== null && _a !== void 0 ? _a : false); },
15305
15307
  color: "white",
15306
15308
  font: { size: 12 },
15307
- formatter: (value) => value,
15309
+ formatter: (value) => formatValue(value),
15308
15310
  },
15309
15311
  title: {
15310
15312
  display: true,
@@ -15333,12 +15335,11 @@ const PieChart = (props) => {
15333
15335
  },
15334
15336
  },
15335
15337
  };
15336
- return jsxRuntimeExports.jsx(Pie, { data: data, options: options !== null && options !== void 0 ? options : defaultOptions, plugins: [ChartDataLabels] });
15338
+ return jsxRuntimeExports.jsx(Pie, { data: data, options: options !== null && options !== void 0 ? options : defaultOptions });
15337
15339
  };
15338
15340
 
15339
- Chart$1.register(CategoryScale, LinearScale, PointElement, LineElement, plugin_title, plugin_tooltip, plugin_legend);
15341
+ Chart$1.register(CategoryScale, LinearScale, PointElement, LineElement, plugin_title, plugin_tooltip, plugin_legend, ChartDataLabels);
15340
15342
  function LineChart({ title, data, options, className, units, content }) {
15341
- var _a;
15342
15343
  const formatValue = (value) => {
15343
15344
  const numValue = typeof value === 'string' ? parseFloat(value) : value;
15344
15345
  if (units === '$' && !isNaN(numValue)) {
@@ -15367,7 +15368,7 @@ function LineChart({ title, data, options, className, units, content }) {
15367
15368
  position: "bottom"
15368
15369
  },
15369
15370
  datalabels: {
15370
- display: (_a = content === null || content === void 0 ? void 0 : content.showLabels) !== null && _a !== void 0 ? _a : false,
15371
+ display: (context) => { var _a; return context.dataset.data[context.dataIndex] !== null && ((_a = content === null || content === void 0 ? void 0 : content.showLabels) !== null && _a !== void 0 ? _a : false); },
15371
15372
  color: "#0F172A",
15372
15373
  font: { size: 12 },
15373
15374
  offset: 6,
@@ -15411,7 +15412,7 @@ function LineChart({ title, data, options, className, units, content }) {
15411
15412
  },
15412
15413
  },
15413
15414
  };
15414
- return (jsxRuntimeExports.jsx(Line, { data: data, options: options !== null && options !== void 0 ? options : defaultOptions, plugins: [ChartDataLabels] }));
15415
+ return (jsxRuntimeExports.jsx(Line, { data: data, options: options !== null && options !== void 0 ? options : defaultOptions }));
15415
15416
  }
15416
15417
 
15417
15418
  function DataGrid({ title, data, className }) {
package/dist/index.js CHANGED
@@ -15065,9 +15065,8 @@ const Line = /* #__PURE__ */ createTypedChart('line', LineController);
15065
15065
  const Bar = /* #__PURE__ */ createTypedChart('bar', BarController);
15066
15066
  const Pie = /* #__PURE__ */ createTypedChart('pie', PieController);
15067
15067
 
15068
- Chart$1.register(CategoryScale, LinearScale, BarElement, plugin_title, plugin_tooltip, plugin_legend);
15068
+ Chart$1.register(CategoryScale, LinearScale, BarElement, plugin_title, plugin_tooltip, plugin_legend, ChartDataLabels);
15069
15069
  function BarChart({ orientation, title, data, options, className, units, content }) {
15070
- var _a;
15071
15070
  const formatValue = (value) => {
15072
15071
  const numValue = typeof value === 'string' ? parseFloat(value) : value;
15073
15072
  if (units === '$' && !isNaN(numValue)) {
@@ -15097,8 +15096,11 @@ function BarChart({ orientation, title, data, options, className, units, content
15097
15096
  position: "bottom"
15098
15097
  },
15099
15098
  datalabels: {
15100
- display: (_a = content === null || content === void 0 ? void 0 : content.showLabels) !== null && _a !== void 0 ? _a : false,
15099
+ display: (context) => { var _a; return context.dataset.data[context.dataIndex] !== null && ((_a = content === null || content === void 0 ? void 0 : content.showLabels) !== null && _a !== void 0 ? _a : false); },
15101
15100
  color: "white",
15101
+ anchor: "center",
15102
+ align: "center",
15103
+ offset: 0,
15102
15104
  font: { size: 12 },
15103
15105
  formatter: (value) => value,
15104
15106
  },
@@ -15141,12 +15143,11 @@ function BarChart({ orientation, title, data, options, className, units, content
15141
15143
  },
15142
15144
  },
15143
15145
  };
15144
- return (jsxRuntimeExports.jsx(Bar, { data: data, options: options !== null && options !== void 0 ? options : defaultOptions, plugins: [ChartDataLabels] }));
15146
+ return (jsxRuntimeExports.jsx(Bar, { data: data, options: options !== null && options !== void 0 ? options : defaultOptions }));
15145
15147
  }
15146
15148
 
15147
- Chart$1.register(CategoryScale, LinearScale, BarElement, plugin_title, plugin_tooltip, plugin_legend);
15149
+ Chart$1.register(CategoryScale, LinearScale, BarElement, plugin_title, plugin_tooltip, plugin_legend, ChartDataLabels);
15148
15150
  function SeriesChart({ orientation, title, data, options, className, units, content }) {
15149
- var _a;
15150
15151
  const formatValue = (value) => {
15151
15152
  const numValue = typeof value === 'string' ? parseFloat(value) : value;
15152
15153
  if (units === '$' && !isNaN(numValue)) {
@@ -15176,8 +15177,11 @@ function SeriesChart({ orientation, title, data, options, className, units, cont
15176
15177
  position: "bottom"
15177
15178
  },
15178
15179
  datalabels: {
15179
- display: (_a = content === null || content === void 0 ? void 0 : content.showLabels) !== null && _a !== void 0 ? _a : false,
15180
+ display: (context) => { var _a; return context.dataset.data[context.dataIndex] !== null && ((_a = content === null || content === void 0 ? void 0 : content.showLabels) !== null && _a !== void 0 ? _a : false); },
15180
15181
  color: "white",
15182
+ anchor: "center",
15183
+ align: "center",
15184
+ offset: 0,
15181
15185
  font: { size: 12 },
15182
15186
  formatter: (value) => value,
15183
15187
  },
@@ -15216,12 +15220,11 @@ function SeriesChart({ orientation, title, data, options, className, units, cont
15216
15220
  },
15217
15221
  },
15218
15222
  };
15219
- return (jsxRuntimeExports.jsx(Bar, { data: data, options: options !== null && options !== void 0 ? options : defaultOptions, plugins: [ChartDataLabels] }));
15223
+ return (jsxRuntimeExports.jsx(Bar, { data: data, options: options !== null && options !== void 0 ? options : defaultOptions }));
15220
15224
  }
15221
15225
 
15222
- Chart$1.register(CategoryScale, LinearScale, PointElement, LineElement, plugin_title, plugin_tooltip, plugin_legend);
15226
+ Chart$1.register(CategoryScale, LinearScale, PointElement, LineElement, plugin_title, plugin_tooltip, plugin_legend, ChartDataLabels);
15223
15227
  function SeriesLineChart({ orientation, title, data, options, className, units, content }) {
15224
- var _a;
15225
15228
  const formatValue = (value) => {
15226
15229
  const numValue = typeof value === 'string' ? parseFloat(value) : value;
15227
15230
  if (units === '$' && !isNaN(numValue)) {
@@ -15250,7 +15253,7 @@ function SeriesLineChart({ orientation, title, data, options, className, units,
15250
15253
  position: "bottom"
15251
15254
  },
15252
15255
  datalabels: {
15253
- display: (_a = content === null || content === void 0 ? void 0 : content.showLabels) !== null && _a !== void 0 ? _a : false,
15256
+ display: (context) => { var _a; return context.dataset.data[context.dataIndex] !== null && ((_a = content === null || content === void 0 ? void 0 : content.showLabels) !== null && _a !== void 0 ? _a : false); },
15254
15257
  color: "#0F172A",
15255
15258
  font: { size: 12 },
15256
15259
  offset: 6,
@@ -15302,12 +15305,11 @@ function SeriesLineChart({ orientation, title, data, options, className, units,
15302
15305
  },
15303
15306
  },
15304
15307
  };
15305
- return (jsxRuntimeExports.jsx(Line, { data: data, options: options !== null && options !== void 0 ? options : defaultOptions, plugins: [ChartDataLabels] }));
15308
+ return (jsxRuntimeExports.jsx(Line, { data: data, options: options !== null && options !== void 0 ? options : defaultOptions }));
15306
15309
  }
15307
15310
 
15308
- Chart$1.register(ArcElement, plugin_tooltip, plugin_legend);
15311
+ Chart$1.register(ArcElement, plugin_tooltip, plugin_legend, ChartDataLabels);
15309
15312
  const PieChart = (props) => {
15310
- var _a;
15311
15313
  const { data, title, options, units, content } = props;
15312
15314
  const formatValue = (value) => {
15313
15315
  const numValue = typeof value === 'string' ? parseFloat(value) : value;
@@ -15328,10 +15330,10 @@ const PieChart = (props) => {
15328
15330
  position: "bottom",
15329
15331
  },
15330
15332
  datalabels: {
15331
- display: (_a = content === null || content === void 0 ? void 0 : content.showLabels) !== null && _a !== void 0 ? _a : false,
15333
+ display: (context) => { var _a; return context.dataset.data[context.dataIndex] !== null && ((_a = content === null || content === void 0 ? void 0 : content.showLabels) !== null && _a !== void 0 ? _a : false); },
15332
15334
  color: "white",
15333
15335
  font: { size: 12 },
15334
- formatter: (value) => value,
15336
+ formatter: (value) => formatValue(value),
15335
15337
  },
15336
15338
  title: {
15337
15339
  display: true,
@@ -15360,12 +15362,11 @@ const PieChart = (props) => {
15360
15362
  },
15361
15363
  },
15362
15364
  };
15363
- return jsxRuntimeExports.jsx(Pie, { data: data, options: options !== null && options !== void 0 ? options : defaultOptions, plugins: [ChartDataLabels] });
15365
+ return jsxRuntimeExports.jsx(Pie, { data: data, options: options !== null && options !== void 0 ? options : defaultOptions });
15364
15366
  };
15365
15367
 
15366
- Chart$1.register(CategoryScale, LinearScale, PointElement, LineElement, plugin_title, plugin_tooltip, plugin_legend);
15368
+ Chart$1.register(CategoryScale, LinearScale, PointElement, LineElement, plugin_title, plugin_tooltip, plugin_legend, ChartDataLabels);
15367
15369
  function LineChart({ title, data, options, className, units, content }) {
15368
- var _a;
15369
15370
  const formatValue = (value) => {
15370
15371
  const numValue = typeof value === 'string' ? parseFloat(value) : value;
15371
15372
  if (units === '$' && !isNaN(numValue)) {
@@ -15394,7 +15395,7 @@ function LineChart({ title, data, options, className, units, content }) {
15394
15395
  position: "bottom"
15395
15396
  },
15396
15397
  datalabels: {
15397
- display: (_a = content === null || content === void 0 ? void 0 : content.showLabels) !== null && _a !== void 0 ? _a : false,
15398
+ display: (context) => { var _a; return context.dataset.data[context.dataIndex] !== null && ((_a = content === null || content === void 0 ? void 0 : content.showLabels) !== null && _a !== void 0 ? _a : false); },
15398
15399
  color: "#0F172A",
15399
15400
  font: { size: 12 },
15400
15401
  offset: 6,
@@ -15438,7 +15439,7 @@ function LineChart({ title, data, options, className, units, content }) {
15438
15439
  },
15439
15440
  },
15440
15441
  };
15441
- return (jsxRuntimeExports.jsx(Line, { data: data, options: options !== null && options !== void 0 ? options : defaultOptions, plugins: [ChartDataLabels] }));
15442
+ return (jsxRuntimeExports.jsx(Line, { data: data, options: options !== null && options !== void 0 ? options : defaultOptions }));
15442
15443
  }
15443
15444
 
15444
15445
  function DataGrid({ title, data, className }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dp-widgets-framework",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org"