@flux-ui/statistics 3.0.0-next.71 → 3.0.0-next.72

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.js CHANGED
@@ -6782,7 +6782,7 @@ function friendlyDateTime(dateTimeish) {
6782
6782
  else throw new InvalidArgumentError(`Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`);
6783
6783
  }
6784
6784
  //#endregion
6785
- //#region ../../node_modules/.bun/@basmilius+utils@3.35.0+f2ed1ec6a4c7f7fd/node_modules/@basmilius/utils/dist/index.mjs
6785
+ //#region ../../node_modules/.bun/@basmilius+utils@3.37.0+f2ed1ec6a4c7f7fd/node_modules/@basmilius/utils/dist/index.mjs
6786
6786
  function p$2(e, t = 0) {
6787
6787
  let n = typeof navigator < `u` ? navigator.language : `nl-NL`;
6788
6788
  return new Intl.NumberFormat(n, {
@@ -10740,7 +10740,7 @@ useMode(definition$2);
10740
10740
  useMode(definition$1);
10741
10741
  useMode(definition);
10742
10742
  //#endregion
10743
- //#region ../../node_modules/.bun/@basmilius+http-client@3.35.0+f97c77f67c914c00/node_modules/@basmilius/http-client/dist/index.mjs
10743
+ //#region ../../node_modules/.bun/@basmilius+http-client@3.37.0+f97c77f67c914c00/node_modules/@basmilius/http-client/dist/index.mjs
10744
10744
  function adapter_default(Parent) {
10745
10745
  return class extends Parent {
10746
10746
  constructor(...args) {
@@ -10748,6 +10748,11 @@ function adapter_default(Parent) {
10748
10748
  }
10749
10749
  };
10750
10750
  }
10751
+ function bound_default() {
10752
+ return (target, method) => {
10753
+ target[method] = target[method].bind(target);
10754
+ };
10755
+ }
10751
10756
  /**
10752
10757
  * Checks if the two given values are equal. When both values are a
10753
10758
  * dto, the check is done by firstly converthing them to JSON.
@@ -10771,7 +10776,7 @@ var TRIGGER = Symbol();
10771
10776
  * Checks if the given object is a dto.
10772
10777
  */
10773
10778
  function isDto_default(obj) {
10774
- return obj && typeof obj === "object" && !!obj[NAME];
10779
+ return typeof obj === "object" && obj !== null && NAME in obj;
10775
10780
  }
10776
10781
  /**
10777
10782
  * Asserts that the given object is a dto.
@@ -10826,6 +10831,9 @@ var markDtoClean = circularProtect_default(function(obj) {
10826
10831
  if (!obj[CHILDREN] || obj[CHILDREN].length === 0) return;
10827
10832
  obj[CHILDREN].filter(isDtoDirty_default).forEach(markDtoClean);
10828
10833
  });
10834
+ function isProxiedArray_default(value) {
10835
+ return Array.isArray(value) && PARENT in value;
10836
+ }
10829
10837
  /**
10830
10838
  * Marks the given dto dirty.
10831
10839
  */
@@ -10852,7 +10860,7 @@ function relateDtoTo_default(dto, parent, key) {
10852
10860
  */
10853
10861
  function relateValueTo_default(dto, key, value) {
10854
10862
  if (isDto_default(value)) relateDtoTo_default(value, dto, key);
10855
- else if (Array.isArray(value)) {
10863
+ else if (isProxiedArray_default(value)) {
10856
10864
  for (const item of value) {
10857
10865
  if (!isDto_default(item)) continue;
10858
10866
  relateDtoTo_default(item, dto, key);
@@ -10884,7 +10892,7 @@ function unrelateDtoFrom_default(dto, parent) {
10884
10892
  */
10885
10893
  function unrelateValueFrom_default(dto, value) {
10886
10894
  if (isDto_default(value)) unrelateDtoFrom_default(value, dto);
10887
- else if (Array.isArray(value)) {
10895
+ else if (isProxiedArray_default(value)) {
10888
10896
  for (const item of value) if (isDto_default(item)) unrelateDtoFrom_default(item, dto);
10889
10897
  value[PARENT] = void 0;
10890
10898
  value[PARENT_KEY] = void 0;
@@ -10928,7 +10936,7 @@ var arrayProxy_default = {
10928
10936
  }
10929
10937
  };
10930
10938
  /**
10931
- * Checks if the given key should be ignored by the proxy.
10939
+ * Checks if the proxy should ignore the given key.
10932
10940
  */
10933
10941
  function ignored(target, key) {
10934
10942
  return typeof key === "symbol" || typeof target[key] === "function" || key === "length";
@@ -10973,7 +10981,7 @@ var instanceProxy_default = {
10973
10981
  const oldValue = descriptor.get?.call(target) ?? void 0;
10974
10982
  if (areEqual_default(value, oldValue)) return true;
10975
10983
  unrelateValueFrom_default(target, oldValue);
10976
- if (Array.isArray(value) && !value[PROXY]) value = new Proxy(value, arrayProxy_default);
10984
+ if (Array.isArray(value) && !isProxiedArray_default(value)) value = new Proxy(value, arrayProxy_default);
10977
10985
  descriptor.set.call(target, value);
10978
10986
  relateValueTo_default(target, key, value);
10979
10987
  markDtoDirty(target, key);
@@ -11097,7 +11105,7 @@ function dto_default(clazz) {
11097
11105
  K(clazz.prototype, DESCRIPTORS, descriptors);
11098
11106
  K(clazz.prototype, NAME, clazz.name);
11099
11107
  K(clazz.prototype, PROPERTIES, properties);
11100
- K(clazz, Symbol.hasInstance, (instance) => typeof instance === "object" && instance?.[NAME] === clazz.name);
11108
+ K(clazz, Symbol.hasInstance, (instance) => typeof instance === "object" && instance !== null && NAME in instance && instance[NAME] === clazz.name);
11101
11109
  G$1(clazz, "clone", clone_default);
11102
11110
  G$1(clazz, "fill", fill_default);
11103
11111
  G$1(clazz, "toJSON", toJSON_default);
@@ -11118,6 +11126,12 @@ function __decorate(decorators, target, key, desc) {
11118
11126
  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;
11119
11127
  return c > 3 && r && Object.defineProperty(target, key, r), r;
11120
11128
  }
11129
+ var X = class {
11130
+ test() {
11131
+ return true;
11132
+ }
11133
+ };
11134
+ __decorate([bound_default()], X.prototype, "test", null);
11121
11135
  var BlobResponse = class BlobResponse {
11122
11136
  get blob() {
11123
11137
  return this.#blob;
@@ -11230,7 +11244,7 @@ var HttpAdapter = _HttpAdapter = class HttpAdapter {
11230
11244
  const defaultFilename = `download-${DateTime.now().toFormat("yyyy-MM-dd HH-mm-ss")}`;
11231
11245
  if (!header.startsWith("attachment")) return defaultFilename;
11232
11246
  const matches = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(header);
11233
- if ((matches?.length || 0) < 2) return defaultFilename;
11247
+ if (!matches || matches.length < 2) return defaultFilename;
11234
11248
  return matches[1].replaceAll("'", "").replaceAll("\"", "").replaceAll("/", "-").replaceAll(":", "-");
11235
11249
  }
11236
11250
  static parseRequestError(data, statusCode) {
@@ -11238,12 +11252,7 @@ var HttpAdapter = _HttpAdapter = class HttpAdapter {
11238
11252
  }
11239
11253
  static parseValidationError(data) {
11240
11254
  let errors;
11241
- if (data.errors) {
11242
- errors = {};
11243
- Object.entries(data.errors).forEach(([key, value]) => {
11244
- errors[key] = _HttpAdapter.parseValidationError(value);
11245
- });
11246
- }
11255
+ if (data.errors) errors = Object.fromEntries(Object.entries(data.errors).map(([key, value]) => [key, _HttpAdapter.parseValidationError(value)]));
11247
11256
  return new ValidationError_default(data.code, data.error, data.error_description, errors, data.params);
11248
11257
  }
11249
11258
  };