@flux-ui/application 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
@@ -2,7 +2,7 @@ import { Fragment, TransitionGroup, computed, createBlock, createCommentVNode, c
2
2
  import { FluxFadeTransition, FluxFlyout, FluxIcon, FluxMenu, FluxMenuItem, FluxPane, FluxRouteTransition, FluxSecondaryButton, FluxSpacer, FluxTabBar, useBreakpoints } from "@flux-ui/components";
3
3
  import { DateTime } from "luxon";
4
4
  import { RouterView, matchedRouteKey, useRoute, viewDepthKey } from "vue-router";
5
- //#region ../../node_modules/.bun/@basmilius+utils@3.35.0+f2ed1ec6a4c7f7fd/node_modules/@basmilius/utils/dist/index.mjs
5
+ //#region ../../node_modules/.bun/@basmilius+utils@3.37.0+f2ed1ec6a4c7f7fd/node_modules/@basmilius/utils/dist/index.mjs
6
6
  function x(e) {
7
7
  let t = {};
8
8
  do {
@@ -3100,7 +3100,7 @@ useMode(definition$2);
3100
3100
  useMode(definition$1);
3101
3101
  useMode(definition);
3102
3102
  //#endregion
3103
- //#region ../../node_modules/.bun/@basmilius+http-client@3.35.0+f97c77f67c914c00/node_modules/@basmilius/http-client/dist/index.mjs
3103
+ //#region ../../node_modules/.bun/@basmilius+http-client@3.37.0+f97c77f67c914c00/node_modules/@basmilius/http-client/dist/index.mjs
3104
3104
  function adapter_default(Parent) {
3105
3105
  return class extends Parent {
3106
3106
  constructor(...args) {
@@ -3108,6 +3108,11 @@ function adapter_default(Parent) {
3108
3108
  }
3109
3109
  };
3110
3110
  }
3111
+ function bound_default() {
3112
+ return (target, method) => {
3113
+ target[method] = target[method].bind(target);
3114
+ };
3115
+ }
3111
3116
  /**
3112
3117
  * Checks if the two given values are equal. When both values are a
3113
3118
  * dto, the check is done by firstly converthing them to JSON.
@@ -3131,7 +3136,7 @@ var TRIGGER = Symbol();
3131
3136
  * Checks if the given object is a dto.
3132
3137
  */
3133
3138
  function isDto_default(obj) {
3134
- return obj && typeof obj === "object" && !!obj[NAME];
3139
+ return typeof obj === "object" && obj !== null && NAME in obj;
3135
3140
  }
3136
3141
  /**
3137
3142
  * Asserts that the given object is a dto.
@@ -3186,6 +3191,9 @@ var markDtoClean = circularProtect_default(function(obj) {
3186
3191
  if (!obj[CHILDREN] || obj[CHILDREN].length === 0) return;
3187
3192
  obj[CHILDREN].filter(isDtoDirty_default).forEach(markDtoClean);
3188
3193
  });
3194
+ function isProxiedArray_default(value) {
3195
+ return Array.isArray(value) && PARENT in value;
3196
+ }
3189
3197
  /**
3190
3198
  * Marks the given dto dirty.
3191
3199
  */
@@ -3212,7 +3220,7 @@ function relateDtoTo_default(dto, parent, key) {
3212
3220
  */
3213
3221
  function relateValueTo_default(dto, key, value) {
3214
3222
  if (isDto_default(value)) relateDtoTo_default(value, dto, key);
3215
- else if (Array.isArray(value)) {
3223
+ else if (isProxiedArray_default(value)) {
3216
3224
  for (const item of value) {
3217
3225
  if (!isDto_default(item)) continue;
3218
3226
  relateDtoTo_default(item, dto, key);
@@ -3244,7 +3252,7 @@ function unrelateDtoFrom_default(dto, parent) {
3244
3252
  */
3245
3253
  function unrelateValueFrom_default(dto, value) {
3246
3254
  if (isDto_default(value)) unrelateDtoFrom_default(value, dto);
3247
- else if (Array.isArray(value)) {
3255
+ else if (isProxiedArray_default(value)) {
3248
3256
  for (const item of value) if (isDto_default(item)) unrelateDtoFrom_default(item, dto);
3249
3257
  value[PARENT] = void 0;
3250
3258
  value[PARENT_KEY] = void 0;
@@ -3288,7 +3296,7 @@ var arrayProxy_default = {
3288
3296
  }
3289
3297
  };
3290
3298
  /**
3291
- * Checks if the given key should be ignored by the proxy.
3299
+ * Checks if the proxy should ignore the given key.
3292
3300
  */
3293
3301
  function ignored(target, key) {
3294
3302
  return typeof key === "symbol" || typeof target[key] === "function" || key === "length";
@@ -3333,7 +3341,7 @@ var instanceProxy_default = {
3333
3341
  const oldValue = descriptor.get?.call(target) ?? void 0;
3334
3342
  if (areEqual_default(value, oldValue)) return true;
3335
3343
  unrelateValueFrom_default(target, oldValue);
3336
- if (Array.isArray(value) && !value[PROXY]) value = new Proxy(value, arrayProxy_default);
3344
+ if (Array.isArray(value) && !isProxiedArray_default(value)) value = new Proxy(value, arrayProxy_default);
3337
3345
  descriptor.set.call(target, value);
3338
3346
  relateValueTo_default(target, key, value);
3339
3347
  markDtoDirty(target, key);
@@ -3457,7 +3465,7 @@ function dto_default(clazz) {
3457
3465
  K(clazz.prototype, DESCRIPTORS, descriptors);
3458
3466
  K(clazz.prototype, NAME, clazz.name);
3459
3467
  K(clazz.prototype, PROPERTIES, properties);
3460
- K(clazz, Symbol.hasInstance, (instance) => typeof instance === "object" && instance?.[NAME] === clazz.name);
3468
+ K(clazz, Symbol.hasInstance, (instance) => typeof instance === "object" && instance !== null && NAME in instance && instance[NAME] === clazz.name);
3461
3469
  G(clazz, "clone", clone_default);
3462
3470
  G(clazz, "fill", fill_default);
3463
3471
  G(clazz, "toJSON", toJSON_default);
@@ -3478,6 +3486,12 @@ function __decorate(decorators, target, key, desc) {
3478
3486
  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;
3479
3487
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3480
3488
  }
3489
+ var X = class {
3490
+ test() {
3491
+ return true;
3492
+ }
3493
+ };
3494
+ __decorate([bound_default()], X.prototype, "test", null);
3481
3495
  var BlobResponse = class BlobResponse {
3482
3496
  get blob() {
3483
3497
  return this.#blob;
@@ -3590,7 +3604,7 @@ var HttpAdapter = _HttpAdapter = class HttpAdapter {
3590
3604
  const defaultFilename = `download-${DateTime.now().toFormat("yyyy-MM-dd HH-mm-ss")}`;
3591
3605
  if (!header.startsWith("attachment")) return defaultFilename;
3592
3606
  const matches = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(header);
3593
- if ((matches?.length || 0) < 2) return defaultFilename;
3607
+ if (!matches || matches.length < 2) return defaultFilename;
3594
3608
  return matches[1].replaceAll("'", "").replaceAll("\"", "").replaceAll("/", "-").replaceAll(":", "-");
3595
3609
  }
3596
3610
  static parseRequestError(data, statusCode) {
@@ -3598,12 +3612,7 @@ var HttpAdapter = _HttpAdapter = class HttpAdapter {
3598
3612
  }
3599
3613
  static parseValidationError(data) {
3600
3614
  let errors;
3601
- if (data.errors) {
3602
- errors = {};
3603
- Object.entries(data.errors).forEach(([key, value]) => {
3604
- errors[key] = _HttpAdapter.parseValidationError(value);
3605
- });
3606
- }
3615
+ if (data.errors) errors = Object.fromEntries(Object.entries(data.errors).map(([key, value]) => [key, _HttpAdapter.parseValidationError(value)]));
3607
3616
  return new ValidationError_default(data.code, data.error, data.error_description, errors, data.params);
3608
3617
  }
3609
3618
  };