@flux-ui/statistics 3.0.0-next.73 → 3.0.0-next.74

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.
@@ -14,8 +14,8 @@ export { default as FluxStatisticsDonutChart } from './FluxStatisticsDonutChart.
14
14
  export { default as FluxStatisticsEmpty } from './FluxStatisticsEmpty.vue';
15
15
  export { default as FluxStatisticsGrid } from './FluxStatisticsGrid.vue';
16
16
  export { default as FluxStatisticsHeatmapChart } from './FluxStatisticsHeatmapChart.vue';
17
- export { default as FluxStatisticsLineChart } from './FluxStatisticsLineChart.vue';
18
17
  export { default as FluxStatisticsKpi } from './FluxStatisticsKpi.vue';
18
+ export { default as FluxStatisticsLineChart } from './FluxStatisticsLineChart.vue';
19
19
  export { default as FluxStatisticsLegend } from './FluxStatisticsLegend.vue';
20
20
  export { default as FluxStatisticsLegendItem } from './FluxStatisticsLegendItem.vue';
21
21
  export { default as FluxStatisticsLegendScope } from './FluxStatisticsLegendScope.vue';
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import { FluxIcon, FluxPane, FluxToolbar, FluxTooltip, iconRegistry } from "@flu
4
4
  import { merge } from "lodash-es";
5
5
  import { init } from "echarts/core";
6
6
  //#region ../internals/dist/data/index.js
7
- var oe = `#ef4444`, _e$1 = `#f97316`, Oe = `#f59e0b`, ze = `#eab308`, Xe = `#84cc16`, st = `#22c55e`, vt = `#10b981`, kt = `#14b8a6`, Bt = `#06b6d4`, Zt = `#0ea5e9`, an = `#dbeafe`, sn = `#93c5fd`, ln = `#3b82f6`, dn = `#1d4ed8`, bn = `#6366f1`, jn = `#8b5cf6`, Hn = `#a855f7`, $n = `#d946ef`, ur = `#ec4899`, gr = `#fff1f2`;
7
+ var oe = `#ef4444`, _e$1 = `#f97316`, Oe = `#f59e0b`, ze = `#eab308`, Xe = `#84cc16`, st = `#22c55e`, vt = `#10b981`, kt = `#14b8a6`, Bt = `#06b6d4`, Zt = `#0ea5e9`, an = `#dbeafe`, sn = `#93c5fd`, ln = `#3b82f6`, dn = `#1d4ed8`, bn = `#6366f1`, jn = `#8b5cf6`, Hn = `#a855f7`, $n = `#d946ef`, ur = `#ec4899`, xr = `#f43f5e`;
8
8
  //#endregion
9
9
  //#region src/composable/useChartBaseSetup.ts
10
10
  function useChartBaseSetup() {
@@ -6808,7 +6808,7 @@ function friendlyDateTime(dateTimeish) {
6808
6808
  else throw new InvalidArgumentError(`Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`);
6809
6809
  }
6810
6810
  //#endregion
6811
- //#region ../../node_modules/.bun/@basmilius+utils@3.37.0+f2ed1ec6a4c7f7fd/node_modules/@basmilius/utils/dist/index.mjs
6811
+ //#region ../../node_modules/.bun/@basmilius+utils@3.40.0+f2ed1ec6a4c7f7fd/node_modules/@basmilius/utils/dist/index.mjs
6812
6812
  function p$2(e, t = 0) {
6813
6813
  let n = typeof navigator < `u` ? navigator.language : `nl-NL`;
6814
6814
  return new Intl.NumberFormat(n, {
@@ -10767,7 +10767,7 @@ useMode(definition$2);
10767
10767
  useMode(definition$1);
10768
10768
  useMode(definition);
10769
10769
  //#endregion
10770
- //#region ../../node_modules/.bun/@basmilius+http-client@3.37.0+f97c77f67c914c00/node_modules/@basmilius/http-client/dist/index.mjs
10770
+ //#region ../../node_modules/.bun/@basmilius+http-client@3.40.0+24cbb59c6ffe9d25/node_modules/@basmilius/http-client/dist/index.mjs
10771
10771
  function adapter_default(Parent) {
10772
10772
  return class extends Parent {
10773
10773
  constructor(...args) {
@@ -10775,11 +10775,6 @@ function adapter_default(Parent) {
10775
10775
  }
10776
10776
  };
10777
10777
  }
10778
- function bound_default() {
10779
- return (target, method) => {
10780
- target[method] = target[method].bind(target);
10781
- };
10782
- }
10783
10778
  /**
10784
10779
  * Checks if the two given values are equal. When both values are a
10785
10780
  * dto, the check is done by firstly converthing them to JSON.
@@ -10803,7 +10798,7 @@ var TRIGGER = Symbol();
10803
10798
  * Checks if the given object is a dto.
10804
10799
  */
10805
10800
  function isDto_default(obj) {
10806
- return typeof obj === "object" && obj !== null && NAME in obj;
10801
+ return obj && typeof obj === "object" && !!obj[NAME];
10807
10802
  }
10808
10803
  /**
10809
10804
  * Asserts that the given object is a dto.
@@ -10858,9 +10853,6 @@ var markDtoClean = circularProtect_default(function(obj) {
10858
10853
  if (!obj[CHILDREN] || obj[CHILDREN].length === 0) return;
10859
10854
  obj[CHILDREN].filter(isDtoDirty_default).forEach(markDtoClean);
10860
10855
  });
10861
- function isProxiedArray_default(value) {
10862
- return Array.isArray(value) && PARENT in value;
10863
- }
10864
10856
  /**
10865
10857
  * Marks the given dto dirty.
10866
10858
  */
@@ -10887,7 +10879,7 @@ function relateDtoTo_default(dto, parent, key) {
10887
10879
  */
10888
10880
  function relateValueTo_default(dto, key, value) {
10889
10881
  if (isDto_default(value)) relateDtoTo_default(value, dto, key);
10890
- else if (isProxiedArray_default(value)) {
10882
+ else if (Array.isArray(value)) {
10891
10883
  for (const item of value) {
10892
10884
  if (!isDto_default(item)) continue;
10893
10885
  relateDtoTo_default(item, dto, key);
@@ -10919,7 +10911,7 @@ function unrelateDtoFrom_default(dto, parent) {
10919
10911
  */
10920
10912
  function unrelateValueFrom_default(dto, value) {
10921
10913
  if (isDto_default(value)) unrelateDtoFrom_default(value, dto);
10922
- else if (isProxiedArray_default(value)) {
10914
+ else if (Array.isArray(value)) {
10923
10915
  for (const item of value) if (isDto_default(item)) unrelateDtoFrom_default(item, dto);
10924
10916
  value[PARENT] = void 0;
10925
10917
  value[PARENT_KEY] = void 0;
@@ -10963,7 +10955,7 @@ var arrayProxy_default = {
10963
10955
  }
10964
10956
  };
10965
10957
  /**
10966
- * Checks if the proxy should ignore the given key.
10958
+ * Checks if the given key should be ignored by the proxy.
10967
10959
  */
10968
10960
  function ignored(target, key) {
10969
10961
  return typeof key === "symbol" || typeof target[key] === "function" || key === "length";
@@ -11008,7 +11000,7 @@ var instanceProxy_default = {
11008
11000
  const oldValue = descriptor.get?.call(target) ?? void 0;
11009
11001
  if (areEqual_default(value, oldValue)) return true;
11010
11002
  unrelateValueFrom_default(target, oldValue);
11011
- if (Array.isArray(value) && !isProxiedArray_default(value)) value = new Proxy(value, arrayProxy_default);
11003
+ if (Array.isArray(value) && !value[PROXY]) value = new Proxy(value, arrayProxy_default);
11012
11004
  descriptor.set.call(target, value);
11013
11005
  relateValueTo_default(target, key, value);
11014
11006
  markDtoDirty(target, key);
@@ -11132,7 +11124,7 @@ function dto_default(clazz) {
11132
11124
  K(clazz.prototype, DESCRIPTORS, descriptors);
11133
11125
  K(clazz.prototype, NAME, clazz.name);
11134
11126
  K(clazz.prototype, PROPERTIES, properties);
11135
- K(clazz, Symbol.hasInstance, (instance) => typeof instance === "object" && instance !== null && NAME in instance && instance[NAME] === clazz.name);
11127
+ K(clazz, Symbol.hasInstance, (instance) => typeof instance === "object" && instance?.[NAME] === clazz.name);
11136
11128
  G$1(clazz, "clone", clone_default);
11137
11129
  G$1(clazz, "fill", fill_default);
11138
11130
  G$1(clazz, "toJSON", toJSON_default);
@@ -11153,12 +11145,6 @@ function __decorate(decorators, target, key, desc) {
11153
11145
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
11154
11146
  return c > 3 && r && Object.defineProperty(target, key, r), r;
11155
11147
  }
11156
- var X = class {
11157
- test() {
11158
- return true;
11159
- }
11160
- };
11161
- __decorate([bound_default()], X.prototype, "test", null);
11162
11148
  var BlobResponse = class BlobResponse {
11163
11149
  get blob() {
11164
11150
  return this.#blob;
@@ -11271,7 +11257,7 @@ var HttpAdapter = _HttpAdapter = class HttpAdapter {
11271
11257
  const defaultFilename = `download-${DateTime.now().toFormat("yyyy-MM-dd HH-mm-ss")}`;
11272
11258
  if (!header.startsWith("attachment")) return defaultFilename;
11273
11259
  const matches = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(header);
11274
- if (!matches || matches.length < 2) return defaultFilename;
11260
+ if ((matches?.length || 0) < 2) return defaultFilename;
11275
11261
  return matches[1].replaceAll("'", "").replaceAll("\"", "").replaceAll("/", "-").replaceAll(":", "-");
11276
11262
  }
11277
11263
  static parseRequestError(data, statusCode) {
@@ -11279,7 +11265,12 @@ var HttpAdapter = _HttpAdapter = class HttpAdapter {
11279
11265
  }
11280
11266
  static parseValidationError(data) {
11281
11267
  let errors;
11282
- if (data.errors) errors = Object.fromEntries(Object.entries(data.errors).map(([key, value]) => [key, _HttpAdapter.parseValidationError(value)]));
11268
+ if (data.errors) {
11269
+ errors = {};
11270
+ Object.entries(data.errors).forEach(([key, value]) => {
11271
+ errors[key] = _HttpAdapter.parseValidationError(value);
11272
+ });
11273
+ }
11283
11274
  return new ValidationError_default(data.code, data.error, data.error_description, errors, data.params);
11284
11275
  }
11285
11276
  };
@@ -12042,6 +12033,51 @@ var FluxStatisticsHeatmapChart_default = /* @__PURE__ */ defineComponent({
12042
12033
  };
12043
12034
  }
12044
12035
  });
12036
+ var Kpi_module_default = {
12037
+ statisticsKpiBottom: `statistics-kpi-bottom`,
12038
+ statisticsChange: `statistics-change`,
12039
+ statisticsKpiFooter: `statistics-kpi-footer`,
12040
+ statisticsKpiValue: `statistics-kpi-value`
12041
+ };
12042
+ //#endregion
12043
+ //#region src/component/FluxStatisticsKpi.vue
12044
+ var FluxStatisticsKpi_default = /* @__PURE__ */ defineComponent({
12045
+ __name: "FluxStatisticsKpi",
12046
+ props: {
12047
+ footer: {},
12048
+ change: {},
12049
+ icon: {},
12050
+ title: {},
12051
+ value: {}
12052
+ },
12053
+ setup(__props) {
12054
+ return (_ctx, _cache) => {
12055
+ return openBlock(), createBlock(FluxStatisticsBase_default, {
12056
+ "is-small": "",
12057
+ icon: __props.icon,
12058
+ title: __props.title
12059
+ }, {
12060
+ default: withCtx(() => [createElementVNode("div", { class: normalizeClass(unref(Kpi_module_default).statisticsKpiValue) }, toDisplayString(__props.value), 3), __props.change || __props.footer ? (openBlock(), createElementBlock("div", {
12061
+ key: 0,
12062
+ class: normalizeClass(unref(Kpi_module_default).statisticsKpiBottom)
12063
+ }, [__props.change ? (openBlock(), createBlock(FluxStatisticsChange_default, {
12064
+ key: 0,
12065
+ color: __props.change.color,
12066
+ icon: __props.change.icon,
12067
+ value: __props.change.value
12068
+ }, null, 8, [
12069
+ "color",
12070
+ "icon",
12071
+ "value"
12072
+ ])) : createCommentVNode("", true), __props.footer ? (openBlock(), createElementBlock("span", {
12073
+ key: 1,
12074
+ class: normalizeClass(unref(Kpi_module_default).statisticsKpiFooter)
12075
+ }, toDisplayString(__props.footer), 3)) : createCommentVNode("", true)], 2)) : createCommentVNode("", true)]),
12076
+ _: 1
12077
+ }, 8, ["icon", "title"]);
12078
+ };
12079
+ }
12080
+ });
12045
12081
  //#endregion
12046
12082
  //#region src/component/FluxStatisticsLineChart.vue
12047
12083
  var FluxStatisticsLineChart_default = /* @__PURE__ */ defineComponent({
@@ -12091,51 +12127,6 @@ var FluxStatisticsLineChart_default = /* @__PURE__ */ defineComponent({
12091
12127
  };
12092
12128
  }
12093
12129
  });
12094
- var Kpi_module_default = {
12095
- statisticsKpiBottom: `statistics-kpi-bottom`,
12096
- statisticsChange: `statistics-change`,
12097
- statisticsKpiFooter: `statistics-kpi-footer`,
12098
- statisticsKpiValue: `statistics-kpi-value`
12099
- };
12100
- //#endregion
12101
- //#region src/component/FluxStatisticsKpi.vue
12102
- var FluxStatisticsKpi_default = /* @__PURE__ */ defineComponent({
12103
- __name: "FluxStatisticsKpi",
12104
- props: {
12105
- footer: {},
12106
- change: {},
12107
- icon: {},
12108
- title: {},
12109
- value: {}
12110
- },
12111
- setup(__props) {
12112
- return (_ctx, _cache) => {
12113
- return openBlock(), createBlock(FluxStatisticsBase_default, {
12114
- "is-small": "",
12115
- icon: __props.icon,
12116
- title: __props.title
12117
- }, {
12118
- default: withCtx(() => [createElementVNode("div", { class: normalizeClass(unref(Kpi_module_default).statisticsKpiValue) }, toDisplayString(__props.value), 3), __props.change || __props.footer ? (openBlock(), createElementBlock("div", {
12119
- key: 0,
12120
- class: normalizeClass(unref(Kpi_module_default).statisticsKpiBottom)
12121
- }, [__props.change ? (openBlock(), createBlock(FluxStatisticsChange_default, {
12122
- key: 0,
12123
- color: __props.change.color,
12124
- icon: __props.change.icon,
12125
- value: __props.change.value
12126
- }, null, 8, [
12127
- "color",
12128
- "icon",
12129
- "value"
12130
- ])) : createCommentVNode("", true), __props.footer ? (openBlock(), createElementBlock("span", {
12131
- key: 1,
12132
- class: normalizeClass(unref(Kpi_module_default).statisticsKpiFooter)
12133
- }, toDisplayString(__props.footer), 3)) : createCommentVNode("", true)], 2)) : createCommentVNode("", true)]),
12134
- _: 1
12135
- }, 8, ["icon", "title"]);
12136
- };
12137
- }
12138
- });
12139
12130
  var Legend_module_default = {
12140
12131
  statisticsLegend: `statistics-legend`,
12141
12132
  statisticsChartPaneBody: `statistics-chart-pane-body`,
@@ -12772,7 +12763,7 @@ var CHART_COLORFUL_COLORS = [
12772
12763
  Hn,
12773
12764
  $n,
12774
12765
  ur,
12775
- gr
12766
+ xr
12776
12767
  ];
12777
12768
  //#endregion
12778
12769
  export { CHART_COLORFUL_COLORS, CHART_COLORS, FluxStatisticsAreaChart_default as FluxStatisticsAreaChart, FluxStatisticsBarChart_default as FluxStatisticsBarChart, FluxStatisticsBase_default as FluxStatisticsBase, FluxStatisticsBoxPlotChart_default as FluxStatisticsBoxPlotChart, FluxStatisticsBubbleChart_default as FluxStatisticsBubbleChart, FluxStatisticsCandlestickChart_default as FluxStatisticsCandlestickChart, FluxStatisticsChange_default as FluxStatisticsChange, FluxStatisticsChart_default as FluxStatisticsChart, FluxStatisticsChartLegendInjectionKey, FluxStatisticsChartPane_default as FluxStatisticsChartPane, FluxStatisticsComparison_default as FluxStatisticsComparison, FluxStatisticsDetailsTable_default as FluxStatisticsDetailsTable, FluxStatisticsDetailsTableRow_default as FluxStatisticsDetailsTableRow, FluxStatisticsDonutChart_default as FluxStatisticsDonutChart, FluxStatisticsEmpty_default as FluxStatisticsEmpty, FluxStatisticsGrid_default as FluxStatisticsGrid, FluxStatisticsHeatmapChart_default as FluxStatisticsHeatmapChart, FluxStatisticsKpi_default as FluxStatisticsKpi, FluxStatisticsLegend_default as FluxStatisticsLegend, FluxStatisticsLegendItem_default as FluxStatisticsLegendItem, FluxStatisticsLegendScope_default as FluxStatisticsLegendScope, FluxStatisticsLineChart_default as FluxStatisticsLineChart, FluxStatisticsMeter_default as FluxStatisticsMeter, FluxStatisticsMetric_default as FluxStatisticsMetric, FluxStatisticsMixedChart_default as FluxStatisticsMixedChart, FluxStatisticsPercentageBar_default as FluxStatisticsPercentageBar, FluxStatisticsPieChart_default as FluxStatisticsPieChart, FluxStatisticsPolarAreaChart_default as FluxStatisticsPolarAreaChart, FluxStatisticsRadarChart_default as FluxStatisticsRadarChart, FluxStatisticsRadialBar_default as FluxStatisticsRadialBar, FluxStatisticsScatterChart_default as FluxStatisticsScatterChart, FluxStatisticsSparkline_default as FluxStatisticsSparkline, FluxStatisticsTreemapChart_default as FluxStatisticsTreemapChart, createChartLegendContext, useChartBaseSetup, useChartHoverSync, useChartSeriesSetup, useChartSlicesSetup, useECharts };