fds-vue-core 7.2.4 → 7.2.6

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.
@@ -7,14 +7,14 @@ type __VLS_PublicProps = {
7
7
  declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
8
8
  blur: (ev: FocusEvent) => any;
9
9
  valid: (value: boolean | null) => any;
10
- "update:modelValue": (value: string) => any;
10
+ "update:modelValue": (...args: unknown[]) => any;
11
11
  noCountryResults: (value: boolean) => any;
12
12
  "update:country": (...args: unknown[]) => any;
13
13
  "update:e164": (phoneNumber: string) => any;
14
14
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
15
15
  onBlur?: ((ev: FocusEvent) => any) | undefined;
16
16
  onValid?: ((value: boolean | null) => any) | undefined;
17
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
17
+ "onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
18
18
  onNoCountryResults?: ((value: boolean) => any) | undefined;
19
19
  "onUpdate:country"?: ((...args: unknown[]) => any) | undefined;
20
20
  "onUpdate:e164"?: ((phoneNumber: string) => any) | undefined;
@@ -31,10 +31,12 @@ export interface FdsPhonenumberProps extends FdsPhonenumberInputPassthroughProps
31
31
  onValid?: ((value: boolean | null) => void) | Array<(value: boolean | null) => void>;
32
32
  onNoCountryResults?: ((value: boolean) => void) | Array<(value: boolean) => void>;
33
33
  onBlur?: ((event: FocusEvent) => void) | Array<(event: FocusEvent) => void>;
34
+ 'onUpdate:modelValue'?: ((value: string) => void) | Array<(value: string) => void>;
34
35
  'onUpdate:e164'?: ((value: string) => void) | Array<(value: string) => void>;
35
36
  'onUpdate:country'?: ((value: string) => void) | Array<(value: string) => void>;
36
37
  }
37
38
  export interface FdsPhonenumberEmits {
39
+ 'update:modelValue': [value: string];
38
40
  'update:country': [country: string];
39
41
  'update:e164': [phoneNumber: string];
40
42
  valid: [value: boolean | null];
@@ -2041,29 +2041,29 @@ function isSpecCompliantForm(thing) {
2041
2041
  return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
2042
2042
  }
2043
2043
  const toJSONObject = (obj) => {
2044
- const stack = new Array(10);
2045
- const visit = (source, i) => {
2044
+ const visited = /* @__PURE__ */ new WeakSet();
2045
+ const visit = (source) => {
2046
2046
  if (isObject$2(source)) {
2047
- if (stack.indexOf(source) >= 0) {
2047
+ if (visited.has(source)) {
2048
2048
  return;
2049
2049
  }
2050
2050
  if (isBuffer(source)) {
2051
2051
  return source;
2052
2052
  }
2053
2053
  if (!("toJSON" in source)) {
2054
- stack[i] = source;
2054
+ visited.add(source);
2055
2055
  const target = isArray(source) ? [] : {};
2056
2056
  forEach(source, (value, key) => {
2057
- const reducedValue = visit(value, i + 1);
2057
+ const reducedValue = visit(value);
2058
2058
  !isUndefined(reducedValue) && (target[key] = reducedValue);
2059
2059
  });
2060
- stack[i] = void 0;
2060
+ visited.delete(source);
2061
2061
  return target;
2062
2062
  }
2063
2063
  }
2064
2064
  return source;
2065
2065
  };
2066
- return visit(obj, 0);
2066
+ return visit(obj);
2067
2067
  };
2068
2068
  const isAsyncFn = kindOfTest("AsyncFunction");
2069
2069
  const isThenable = (thing) => thing && (isObject$2(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
@@ -2194,8 +2194,6 @@ const parseHeaders = (rawHeaders) => {
2194
2194
  });
2195
2195
  return parsed;
2196
2196
  };
2197
- const $internals = /* @__PURE__ */ Symbol("internals");
2198
- const INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
2199
2197
  function trimSPorHTAB(str) {
2200
2198
  let start = 0;
2201
2199
  let end = str.length;
@@ -2215,12 +2213,27 @@ function trimSPorHTAB(str) {
2215
2213
  }
2216
2214
  return start === 0 && end === str.length ? str : str.slice(start, end);
2217
2215
  }
2216
+ const INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+", "g");
2217
+ const INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+", "g");
2218
+ function sanitizeValue(value, invalidChars) {
2219
+ if (utils$1.isArray(value)) {
2220
+ return value.map((item) => sanitizeValue(item, invalidChars));
2221
+ }
2222
+ return trimSPorHTAB(String(value).replace(invalidChars, ""));
2223
+ }
2224
+ const sanitizeHeaderValue = (value) => sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS);
2225
+ const sanitizeByteStringHeaderValue = (value) => sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS);
2226
+ function toByteStringHeaderObject(headers) {
2227
+ const byteStringHeaders = /* @__PURE__ */ Object.create(null);
2228
+ utils$1.forEach(headers.toJSON(), (value, header) => {
2229
+ byteStringHeaders[header] = sanitizeByteStringHeaderValue(value);
2230
+ });
2231
+ return byteStringHeaders;
2232
+ }
2233
+ const $internals = /* @__PURE__ */ Symbol("internals");
2218
2234
  function normalizeHeader(header) {
2219
2235
  return header && String(header).trim().toLowerCase();
2220
2236
  }
2221
- function sanitizeHeaderValue(str) {
2222
- return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ""));
2223
- }
2224
2237
  function normalizeValue(value) {
2225
2238
  if (value === false || value == null) {
2226
2239
  return value;
@@ -2908,7 +2921,7 @@ function formDataToJSON(formData) {
2908
2921
  }
2909
2922
  return !isNumericKey;
2910
2923
  }
2911
- if (!target[name] || !utils$1.isObject(target[name])) {
2924
+ if (!utils$1.hasOwnProp(target, name) || !utils$1.isObject(target[name])) {
2912
2925
  target[name] = [];
2913
2926
  }
2914
2927
  const result2 = buildPath(path, value, target[name], index);
@@ -3157,6 +3170,9 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
3157
3170
  let bytesNotified = 0;
3158
3171
  const _speedometer = speedometer(50, 250);
3159
3172
  return throttle((e) => {
3173
+ if (!e || typeof e.loaded !== "number") {
3174
+ return;
3175
+ }
3160
3176
  const rawLoaded = e.loaded;
3161
3177
  const total = e.lengthComputable ? e.total : void 0;
3162
3178
  const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
@@ -3511,7 +3527,7 @@ const xhrAdapter = isXHRAdapterSupported && function(config) {
3511
3527
  };
3512
3528
  requestData === void 0 && requestHeaders.setContentType(null);
3513
3529
  if ("setRequestHeader" in request) {
3514
- utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
3530
+ utils$1.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
3515
3531
  request.setRequestHeader(key, val);
3516
3532
  });
3517
3533
  }
@@ -3560,39 +3576,41 @@ const xhrAdapter = isXHRAdapterSupported && function(config) {
3560
3576
  });
3561
3577
  };
3562
3578
  const composeSignals = (signals, timeout) => {
3563
- const { length } = signals = signals ? signals.filter(Boolean) : [];
3564
- if (timeout || length) {
3565
- let controller = new AbortController();
3566
- let aborted;
3567
- const onabort = function(reason) {
3568
- if (!aborted) {
3569
- aborted = true;
3570
- unsubscribe();
3571
- const err = reason instanceof Error ? reason : this.reason;
3572
- controller.abort(
3573
- err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err)
3574
- );
3575
- }
3576
- };
3577
- let timer = timeout && setTimeout(() => {
3578
- timer = null;
3579
- onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
3580
- }, timeout);
3581
- const unsubscribe = () => {
3582
- if (signals) {
3583
- timer && clearTimeout(timer);
3584
- timer = null;
3585
- signals.forEach((signal2) => {
3586
- signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
3587
- });
3588
- signals = null;
3589
- }
3590
- };
3591
- signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
3592
- const { signal } = controller;
3593
- signal.unsubscribe = () => utils$1.asap(unsubscribe);
3594
- return signal;
3579
+ signals = signals ? signals.filter(Boolean) : [];
3580
+ if (!timeout && !signals.length) {
3581
+ return;
3595
3582
  }
3583
+ const controller = new AbortController();
3584
+ let aborted = false;
3585
+ const onabort = function(reason) {
3586
+ if (!aborted) {
3587
+ aborted = true;
3588
+ unsubscribe();
3589
+ const err = reason instanceof Error ? reason : this.reason;
3590
+ controller.abort(
3591
+ err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err)
3592
+ );
3593
+ }
3594
+ };
3595
+ let timer = timeout && setTimeout(() => {
3596
+ timer = null;
3597
+ onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
3598
+ }, timeout);
3599
+ const unsubscribe = () => {
3600
+ if (!signals) {
3601
+ return;
3602
+ }
3603
+ timer && clearTimeout(timer);
3604
+ timer = null;
3605
+ signals.forEach((signal2) => {
3606
+ signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
3607
+ });
3608
+ signals = null;
3609
+ };
3610
+ signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
3611
+ const { signal } = controller;
3612
+ signal.unsubscribe = () => utils$1.asap(unsubscribe);
3613
+ return signal;
3596
3614
  };
3597
3615
  const streamChunk = function* (chunk, chunkSize) {
3598
3616
  let len = chunk.byteLength;
@@ -3743,7 +3761,7 @@ function estimateDataURLDecodedBytes(url) {
3743
3761
  }
3744
3762
  return bytes;
3745
3763
  }
3746
- const VERSION$1 = "1.16.0";
3764
+ const VERSION$1 = "1.16.1";
3747
3765
  const DEFAULT_CHUNK_SIZE = 64 * 1024;
3748
3766
  const { isFunction } = utils$1;
3749
3767
  const test = (fn, ...args) => {
@@ -3754,7 +3772,7 @@ const test = (fn, ...args) => {
3754
3772
  }
3755
3773
  };
3756
3774
  const factory = (env) => {
3757
- const globalObject = utils$1.global ?? globalThis;
3775
+ const globalObject = utils$1.global !== void 0 && utils$1.global !== null ? utils$1.global : globalThis;
3758
3776
  const { ReadableStream: ReadableStream2, TextEncoder } = globalObject;
3759
3777
  env = utils$1.merge.call(
3760
3778
  {
@@ -3924,7 +3942,7 @@ const factory = (env) => {
3924
3942
  ...fetchOptions,
3925
3943
  signal: composedSignal,
3926
3944
  method: method.toUpperCase(),
3927
- headers: headers.normalize().toJSON(),
3945
+ headers: toByteStringHeaderObject(headers.normalize()),
3928
3946
  body: data,
3929
3947
  duplex: "half",
3930
3948
  credentials: isCredentialsSupported ? withCredentials : void 0
@@ -8909,7 +8927,7 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
8909
8927
  });
8910
8928
  const _hoisted_1$l = ["for", "id"];
8911
8929
  const _hoisted_2$h = { class: "relative" };
8912
- const _hoisted_3$e = ["type", "required", "value", "disabled", "tabindex", "aria-invalid", "aria-label", "aria-labelledby", "aria-describedby", "autocomplete", "pattern", "searchIcon"];
8930
+ const _hoisted_3$e = ["type", "required", "value", "disabled", "tabindex", "aria-invalid", "aria-label", "aria-labelledby", "aria-describedby", "autocomplete", "placeholder", "pattern", "searchIcon"];
8913
8931
  const _hoisted_4$d = {
8914
8932
  key: 0,
8915
8933
  class: "text-red-700 font-bold mt-1"
@@ -9224,6 +9242,7 @@ const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
9224
9242
  "aria-labelledby": ariaLabelledBy.value,
9225
9243
  "aria-describedby": ariaDescribedBy.value,
9226
9244
  autocomplete: props.autocomplete,
9245
+ placeholder: props.placeholder,
9227
9246
  pattern: props.pattern,
9228
9247
  searchIcon: props.searchIcon
9229
9248
  }, inputAttrs.value, {
@@ -18353,8 +18372,7 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
18353
18372
  "pointer-events-none transition-transform duration-200 ease-in-out",
18354
18373
  {
18355
18374
  "fill-gray-500": props.disabled,
18356
- "fill-red-600": isInvalid.value && !props.disabled,
18357
- "fill-blue-500": !props.disabled && !isInvalid.value,
18375
+ "fill-blue-500": !props.disabled && !isInvalid.value || isInvalid.value,
18358
18376
  "rotate-180": dropdownOpen.value && !props.disabled
18359
18377
  }
18360
18378
  ]);
@@ -18746,6 +18764,7 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
18746
18764
  onValid: {},
18747
18765
  onNoCountryResults: {},
18748
18766
  onBlur: {},
18767
+ "onUpdate:modelValue": {},
18749
18768
  "onUpdate:e164": {},
18750
18769
  "onUpdate:country": {},
18751
18770
  id: { default: void 0 },
@@ -18764,7 +18783,7 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
18764
18783
  "country": { default: "SE" },
18765
18784
  "countryModifiers": {}
18766
18785
  }),
18767
- emits: /* @__PURE__ */ vue.mergeModels(["update:country", "update:e164", "valid", "noCountryResults", "blur"], ["update:modelValue", "update:country"]),
18786
+ emits: /* @__PURE__ */ vue.mergeModels(["update:modelValue", "update:country", "update:e164", "valid", "noCountryResults", "blur"], ["update:modelValue", "update:country"]),
18768
18787
  setup(__props, { emit: __emit }) {
18769
18788
  const [nationalNumber, modelModifiers] = vue.useModel(__props, "modelValue");
18770
18789
  const country = vue.useModel(__props, "country");