fds-vue-core 6.2.1 → 6.2.4

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/LICENSE CHANGED
@@ -16,6 +16,4 @@ criminal penalties.
16
16
 
17
17
  The Software is provided "AS IS", without warranty of any kind, express or
18
18
  implied, including but not limited to the warranties of merchantability,
19
- fitness for a particular purpose and noninfringement.
20
-
21
-
19
+ fitness for a particular purpose and noninfringement.
package/README.md CHANGED
@@ -8,29 +8,6 @@ FDS Vue Core is a Vue 3 component library that provides design tokens, icons, an
8
8
  pnpm add fds-vue-core
9
9
  ```
10
10
 
11
- ## Peer Dependencies
12
-
13
- Make sure you have the required peer dependencies installed:
14
-
15
- ```bash
16
- pnpm add vue@^3.5.0
17
- ```
18
-
19
- ## Postinstall Script
20
-
21
- To automatically sync VS Code settings when installing or updating `fds-vue-core`, add this to your `package.json`:
22
-
23
- ```json
24
- {
25
- "scripts": {
26
- "sync:vscode:settings": "node node_modules/fds-vue-core/scripts/sync-vscode-settings.mjs || true",
27
- "postinstall": "pnpm run sync:vscode:settings"
28
- }
29
- }
30
- ```
31
-
32
- This will automatically sync VS Code settings after every `pnpm install`. The `|| true` ensures the install doesn't fail if the script encounters any issues.
33
-
34
11
  ## Setup
35
12
 
36
13
  ### Tailwind CSS Configuration
package/components.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  // - Re-export all public types (including the default plugin) from the source index
3
3
  // - Declare global components for Volar/TS in consuming repos
4
4
  export * from './src/index'
5
+
5
6
  export { default } from './src/index'
6
7
 
7
8
  import type { DefineComponent } from 'vue'
@@ -1592,9 +1592,14 @@ function getGlobal() {
1592
1592
  const G = getGlobal();
1593
1593
  const FormDataCtor = typeof G.FormData !== "undefined" ? G.FormData : void 0;
1594
1594
  const isFormData = (thing) => {
1595
- let kind;
1596
- return thing && (FormDataCtor && thing instanceof FormDataCtor || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
1597
- kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]"));
1595
+ if (!thing) return false;
1596
+ if (FormDataCtor && thing instanceof FormDataCtor) return true;
1597
+ const proto = getPrototypeOf(thing);
1598
+ if (!proto || proto === Object.prototype) return false;
1599
+ if (!isFunction$1(thing.append)) return false;
1600
+ const kind = kindOf(thing);
1601
+ return kind === "formdata" || // detect form-data instance
1602
+ kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]";
1598
1603
  };
1599
1604
  const isURLSearchParams = kindOfTest("URLSearchParams");
1600
1605
  const [isReadableStream, isRequest, isResponse, isHeaders] = [
@@ -2021,6 +2026,7 @@ AxiosError$1.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
2021
2026
  AxiosError$1.ERR_CANCELED = "ERR_CANCELED";
2022
2027
  AxiosError$1.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
2023
2028
  AxiosError$1.ERR_INVALID_URL = "ERR_INVALID_URL";
2029
+ AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
2024
2030
  const httpAdapter = null;
2025
2031
  function isVisitable(thing) {
2026
2032
  return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
@@ -2063,6 +2069,7 @@ function toFormData$1(obj, formData, options) {
2063
2069
  const dots = options.dots;
2064
2070
  const indexes = options.indexes;
2065
2071
  const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
2072
+ const maxDepth = options.maxDepth === void 0 ? 100 : options.maxDepth;
2066
2073
  const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
2067
2074
  if (!utils$1.isFunction(visitor)) {
2068
2075
  throw new TypeError("visitor must be a function");
@@ -2117,8 +2124,14 @@ function toFormData$1(obj, formData, options) {
2117
2124
  convertValue,
2118
2125
  isVisitable
2119
2126
  });
2120
- function build(value, path) {
2127
+ function build(value, path, depth = 0) {
2121
2128
  if (utils$1.isUndefined(value)) return;
2129
+ if (depth > maxDepth) {
2130
+ throw new AxiosError$1(
2131
+ "Object is too deeply nested (" + depth + " levels). Max depth: " + maxDepth,
2132
+ AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED
2133
+ );
2134
+ }
2122
2135
  if (stack.indexOf(value) !== -1) {
2123
2136
  throw Error("Circular reference detected in " + path.join("."));
2124
2137
  }
@@ -2126,7 +2139,7 @@ function toFormData$1(obj, formData, options) {
2126
2139
  utils$1.forEach(value, function each(el, key) {
2127
2140
  const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
2128
2141
  if (result === true) {
2129
- build(el, path ? path.concat(key) : [key]);
2142
+ build(el, path ? path.concat(key) : [key], depth + 1);
2130
2143
  }
2131
2144
  });
2132
2145
  stack.pop();
@@ -2144,10 +2157,9 @@ function encode$1(str) {
2144
2157
  "(": "%28",
2145
2158
  ")": "%29",
2146
2159
  "~": "%7E",
2147
- "%20": "+",
2148
- "%00": "\0"
2160
+ "%20": "+"
2149
2161
  };
2150
- return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match2) {
2162
+ return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match2) {
2151
2163
  return charMap[match2];
2152
2164
  });
2153
2165
  }
@@ -2332,7 +2344,7 @@ function formDataToJSON(formData) {
2332
2344
  name = !name && utils$1.isArray(target) ? target.length : name;
2333
2345
  if (isLast) {
2334
2346
  if (utils$1.hasOwnProp(target, name)) {
2335
- target[name] = [target[name], value];
2347
+ target[name] = utils$1.isArray(target[name]) ? target[name].concat(value) : [target[name], value];
2336
2348
  } else {
2337
2349
  target[name] = value;
2338
2350
  }
@@ -2356,6 +2368,7 @@ function formDataToJSON(formData) {
2356
2368
  }
2357
2369
  return null;
2358
2370
  }
2371
+ const own = (obj, key) => obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : void 0;
2359
2372
  function stringifySafely(rawValue, parser, encoder) {
2360
2373
  if (utils$1.isString(rawValue)) {
2361
2374
  try {
@@ -2396,15 +2409,17 @@ const defaults = {
2396
2409
  }
2397
2410
  let isFileList2;
2398
2411
  if (isObjectPayload) {
2412
+ const formSerializer = own(this, "formSerializer");
2399
2413
  if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
2400
- return toURLEncodedForm(data, this.formSerializer).toString();
2414
+ return toURLEncodedForm(data, formSerializer).toString();
2401
2415
  }
2402
2416
  if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
2403
- const _FormData = this.env && this.env.FormData;
2417
+ const env = own(this, "env");
2418
+ const _FormData = env && env.FormData;
2404
2419
  return toFormData$1(
2405
2420
  isFileList2 ? { "files[]": data } : data,
2406
2421
  _FormData && new _FormData(),
2407
- this.formSerializer
2422
+ formSerializer
2408
2423
  );
2409
2424
  }
2410
2425
  }
@@ -2417,21 +2432,22 @@ const defaults = {
2417
2432
  ],
2418
2433
  transformResponse: [
2419
2434
  function transformResponse(data) {
2420
- const transitional2 = this.transitional || defaults.transitional;
2435
+ const transitional2 = own(this, "transitional") || defaults.transitional;
2421
2436
  const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
2422
- const JSONRequested = this.responseType === "json";
2437
+ const responseType = own(this, "responseType");
2438
+ const JSONRequested = responseType === "json";
2423
2439
  if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
2424
2440
  return data;
2425
2441
  }
2426
- if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
2442
+ if (data && utils$1.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) {
2427
2443
  const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
2428
2444
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
2429
2445
  try {
2430
- return JSON.parse(data, this.parseReviver);
2446
+ return JSON.parse(data, own(this, "parseReviver"));
2431
2447
  } catch (e) {
2432
2448
  if (strictJSONParsing) {
2433
2449
  if (e.name === "SyntaxError") {
2434
- throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
2450
+ throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, own(this, "response"));
2435
2451
  }
2436
2452
  throw e;
2437
2453
  }
@@ -2510,38 +2526,37 @@ const parseHeaders = (rawHeaders) => {
2510
2526
  return parsed;
2511
2527
  };
2512
2528
  const $internals = /* @__PURE__ */ Symbol("internals");
2513
- const isValidHeaderValue = (value) => !/[\r\n]/.test(value);
2514
- function assertValidHeaderValue(value, header) {
2515
- if (value === false || value == null) {
2516
- return;
2517
- }
2518
- if (utils$1.isArray(value)) {
2519
- value.forEach((v) => assertValidHeaderValue(v, header));
2520
- return;
2529
+ const INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
2530
+ function trimSPorHTAB(str) {
2531
+ let start = 0;
2532
+ let end = str.length;
2533
+ while (start < end) {
2534
+ const code = str.charCodeAt(start);
2535
+ if (code !== 9 && code !== 32) {
2536
+ break;
2537
+ }
2538
+ start += 1;
2521
2539
  }
2522
- if (!isValidHeaderValue(String(value))) {
2523
- throw new Error(`Invalid character in header content ["${header}"]`);
2540
+ while (end > start) {
2541
+ const code = str.charCodeAt(end - 1);
2542
+ if (code !== 9 && code !== 32) {
2543
+ break;
2544
+ }
2545
+ end -= 1;
2524
2546
  }
2547
+ return start === 0 && end === str.length ? str : str.slice(start, end);
2525
2548
  }
2526
2549
  function normalizeHeader(header) {
2527
2550
  return header && String(header).trim().toLowerCase();
2528
2551
  }
2529
- function stripTrailingCRLF(str) {
2530
- let end = str.length;
2531
- while (end > 0) {
2532
- const charCode = str.charCodeAt(end - 1);
2533
- if (charCode !== 10 && charCode !== 13) {
2534
- break;
2535
- }
2536
- end -= 1;
2537
- }
2538
- return end === str.length ? str : str.slice(0, end);
2552
+ function sanitizeHeaderValue(str) {
2553
+ return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ""));
2539
2554
  }
2540
2555
  function normalizeValue(value) {
2541
2556
  if (value === false || value == null) {
2542
2557
  return value;
2543
2558
  }
2544
- return utils$1.isArray(value) ? value.map(normalizeValue) : stripTrailingCRLF(String(value));
2559
+ return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
2545
2560
  }
2546
2561
  function parseTokens(str) {
2547
2562
  const tokens = /* @__PURE__ */ Object.create(null);
@@ -2597,7 +2612,6 @@ let AxiosHeaders$1 = class AxiosHeaders {
2597
2612
  }
2598
2613
  const key = utils$1.findKey(self2, lHeader);
2599
2614
  if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
2600
- assertValidHeaderValue(_value, _header);
2601
2615
  self2[key || _header] = normalizeValue(_value);
2602
2616
  }
2603
2617
  }
@@ -2886,19 +2900,19 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
2886
2900
  let bytesNotified = 0;
2887
2901
  const _speedometer = speedometer(50, 250);
2888
2902
  return throttle((e) => {
2889
- const loaded = e.loaded;
2903
+ const rawLoaded = e.loaded;
2890
2904
  const total = e.lengthComputable ? e.total : void 0;
2891
- const progressBytes = loaded - bytesNotified;
2905
+ const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
2906
+ const progressBytes = Math.max(0, loaded - bytesNotified);
2892
2907
  const rate = _speedometer(progressBytes);
2893
- const inRange = loaded <= total;
2894
- bytesNotified = loaded;
2908
+ bytesNotified = Math.max(bytesNotified, loaded);
2895
2909
  const data = {
2896
2910
  loaded,
2897
2911
  total,
2898
2912
  progress: total ? loaded / total : void 0,
2899
2913
  bytes: progressBytes,
2900
2914
  rate: rate ? rate : void 0,
2901
- estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
2915
+ estimated: rate && total ? (total - loaded) / rate : void 0,
2902
2916
  event: e,
2903
2917
  lengthComputable: total != null,
2904
2918
  [isDownloadStream ? "download" : "upload"]: true
@@ -2980,7 +2994,7 @@ function combineURLs(baseURL, relativeURL) {
2980
2994
  }
2981
2995
  function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
2982
2996
  let isRelativeUrl = !isAbsoluteURL(requestedURL);
2983
- if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
2997
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
2984
2998
  return combineURLs(baseURL, requestedURL);
2985
2999
  }
2986
3000
  return requestedURL;
@@ -3019,9 +3033,9 @@ function mergeConfig$1(config1, config2) {
3019
3033
  }
3020
3034
  }
3021
3035
  function mergeDirectKeys(a, b, prop) {
3022
- if (prop in config2) {
3036
+ if (utils$1.hasOwnProp(config2, prop)) {
3023
3037
  return getMergedValue(a, b);
3024
- } else if (prop in config1) {
3038
+ } else if (utils$1.hasOwnProp(config1, prop)) {
3025
3039
  return getMergedValue(void 0, a);
3026
3040
  }
3027
3041
  }
@@ -3059,7 +3073,9 @@ function mergeConfig$1(config1, config2) {
3059
3073
  utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
3060
3074
  if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return;
3061
3075
  const merge2 = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
3062
- const configValue = merge2(config1[prop], config2[prop], prop);
3076
+ const a = utils$1.hasOwnProp(config1, prop) ? config1[prop] : void 0;
3077
+ const b = utils$1.hasOwnProp(config2, prop) ? config2[prop] : void 0;
3078
+ const configValue = merge2(a, b, prop);
3063
3079
  utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
3064
3080
  });
3065
3081
  return config;
@@ -3095,8 +3111,11 @@ const resolveConfig = (config) => {
3095
3111
  }
3096
3112
  }
3097
3113
  if (platform.hasStandardBrowserEnv) {
3098
- withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
3099
- if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
3114
+ if (utils$1.isFunction(withXSRFToken)) {
3115
+ withXSRFToken = withXSRFToken(newConfig);
3116
+ }
3117
+ const shouldSendXSRF = withXSRFToken === true || withXSRFToken == null && isURLSameOrigin(newConfig.url);
3118
+ if (shouldSendXSRF) {
3100
3119
  const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
3101
3120
  if (xsrfValue) {
3102
3121
  headers.set(xsrfHeaderName, xsrfValue);
@@ -3391,16 +3410,18 @@ const factory = (env) => {
3391
3410
  const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
3392
3411
  const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
3393
3412
  let duplexAccessed = false;
3394
- const body = new ReadableStream$1();
3395
- const hasContentType = new Request(platform.origin, {
3396
- body,
3413
+ const request = new Request(platform.origin, {
3414
+ body: new ReadableStream$1(),
3397
3415
  method: "POST",
3398
3416
  get duplex() {
3399
3417
  duplexAccessed = true;
3400
3418
  return "half";
3401
3419
  }
3402
- }).headers.has("Content-Type");
3403
- body.cancel();
3420
+ });
3421
+ const hasContentType = request.headers.has("Content-Type");
3422
+ if (request.body != null) {
3423
+ request.body.cancel();
3424
+ }
3404
3425
  return duplexAccessed && !hasContentType;
3405
3426
  });
3406
3427
  const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body));
@@ -3499,6 +3520,12 @@ const factory = (env) => {
3499
3520
  withCredentials = withCredentials ? "include" : "omit";
3500
3521
  }
3501
3522
  const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
3523
+ if (utils$1.isFormData(data)) {
3524
+ const contentType = headers.getContentType();
3525
+ if (contentType && /^multipart\/form-data/i.test(contentType) && !/boundary=/i.test(contentType)) {
3526
+ headers.delete("content-type");
3527
+ }
3528
+ }
3502
3529
  const resolvedOptions = {
3503
3530
  ...fetchOptions,
3504
3531
  signal: composedSignal,
@@ -3682,7 +3709,7 @@ function dispatchRequest(config) {
3682
3709
  }
3683
3710
  );
3684
3711
  }
3685
- const VERSION$1 = "1.15.0";
3712
+ const VERSION$1 = "1.15.1";
3686
3713
  const validators$1 = {};
3687
3714
  ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
3688
3715
  validators$1[type] = function validator2(thing) {
@@ -14994,7 +15021,7 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
14994
15021
  const props = __props;
14995
15022
  const emit = __emit;
14996
15023
  const classes = vue.computed(() => [
14997
- "box-border flex h-[64px] w-[calc(100%/7.5)] shrink-0 flex-col items-center justify-center border-transparent px-1 py-1 transition-colors cursor-pointer",
15024
+ "box-border flex h-[64px] w-full max-w-[100px] flex-1 basis-0 flex-col items-center justify-center border-2 border-transparent px-1 py-1 transition-colors cursor-pointer",
14998
15025
  props.disabled ? "" : "hover:border-2 hover:border-blue-500 border-solid",
14999
15026
  props.disabled ? "" : "active:bg-blue_t-100 border-transparent",
15000
15027
  props.disabled ? "" : "focus:outline-none",
@@ -15011,7 +15038,7 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
15011
15038
  ]);
15012
15039
  const onClick = () => {
15013
15040
  if (props.disabled) return;
15014
- emit("select-date", props.date);
15041
+ emit("select-date", props.selected ? null : props.date);
15015
15042
  };
15016
15043
  const weekdayLabel = vue.computed(() => {
15017
15044
  const value = format(props.date, "EEE", { locale: sv });
@@ -15110,7 +15137,8 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
15110
15137
  weekLabel: { default: "vecka" },
15111
15138
  onDecrementWeek: {},
15112
15139
  onIncrementWeek: {},
15113
- onSelectDate: {}
15140
+ onSelectDate: {},
15141
+ onChangeDateRange: {}
15114
15142
  },
15115
15143
  emits: ["change-date-range", "select-date", "decrement-week", "increment-week"],
15116
15144
  setup(__props, { emit: __emit }) {
@@ -16085,7 +16113,8 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
16085
16113
  heading: { default: void 0 },
16086
16114
  align: { default: "left" },
16087
16115
  icon: { default: void 0 },
16088
- dataTestid: { default: void 0 }
16116
+ dataTestid: { default: void 0 },
16117
+ isSortActive: { type: Boolean, default: false }
16089
16118
  },
16090
16119
  emits: ["sort"],
16091
16120
  setup(__props, { emit: __emit }) {
@@ -16097,6 +16126,10 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
16097
16126
  props.align === "right" && "text-right justify-end",
16098
16127
  iconName.value && "text-blue-600! hover:bg-blue_t-200 cursor-pointer focus-visible:outline-dashed focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-blue-500 active:bg-blue_t-300"
16099
16128
  ]);
16129
+ const iconClasses = vue.computed(() => [
16130
+ "fill-blue-500 ml-1 transition-opacity",
16131
+ iconName.value && !props.isSortActive && "opacity-20"
16132
+ ]);
16100
16133
  const iconName = vue.computed(() => props.icon);
16101
16134
  const emit = __emit;
16102
16135
  const handleSort = (ev) => {
@@ -16126,8 +16159,8 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
16126
16159
  vue.createVNode(_sfc_main$J, {
16127
16160
  name: iconName.value,
16128
16161
  size: "24px",
16129
- class: "fill-blue-500 ml-1"
16130
- }, null, 8, ["name"])
16162
+ class: vue.normalizeClass(iconClasses.value)
16163
+ }, null, 8, ["name", "class"])
16131
16164
  ], 42, _hoisted_1$1)) : (vue.openBlock(), vue.createElementBlock("div", {
16132
16165
  key: 1,
16133
16166
  class: vue.normalizeClass(headerClasses.value)