maz-ui 4.0.0-beta.24 → 4.0.0-beta.26

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.
@@ -0,0 +1,19 @@
1
+ import { c as capitalize } from "./capitalize.BF6CDS_4.js";
2
+ function camelCase(str) {
3
+ return str.replaceAll(/-(\w)/g, (_, c) => c ? c.toUpperCase() : "");
4
+ }
5
+ function pascalCase(str) {
6
+ if (str === str.toUpperCase()) {
7
+ if (str.includes("-"))
8
+ return str.toLowerCase().split("-").map(capitalize).join("");
9
+ if (str.includes("_"))
10
+ return str.toLowerCase().split("_").map(capitalize).join("");
11
+ if (str.includes(" "))
12
+ return str.toLowerCase().split(" ").map(capitalize).join("");
13
+ }
14
+ return str.includes("-") ? str.toLowerCase().split("-").map(capitalize).join("") : str.includes("_") ? str.toLowerCase().split("_").map(capitalize).join("") : str.includes(" ") ? str.toLowerCase().split(" ").map(capitalize).join("") : capitalize(camelCase(str));
15
+ }
16
+ export {
17
+ camelCase as c,
18
+ pascalCase as p
19
+ };
@@ -1,4 +1,11 @@
1
+ import { p as pascalCase, c as camelCase } from "./pascalCase.GdDKKQ-O.js";
1
2
  import { computed, toValue } from "vue";
3
+ function kebabCase(str) {
4
+ return str.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase().replace(/-+/g, "-").replace(/(^-)|(-$)/g, "");
5
+ }
6
+ function snakeCase(str) {
7
+ return str.replace(/([a-z])([A-Z])/g, "$1_$2").replace(/([A-Z])([A-Z][a-z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase().replace(/_+/g, "_").replace(/(^_)|(_$)/g, "");
8
+ }
2
9
  const defaultOptions = {
3
10
  removeAccents: !0,
4
11
  caseSensitive: !1,
@@ -7,8 +14,27 @@ const defaultOptions = {
7
14
  trim: !0,
8
15
  normalizeSpaces: !0,
9
16
  removeNumbers: !1,
17
+ case: void 0,
10
18
  customNormalizationForms: ["NFC", "NFKD"]
11
19
  };
20
+ function applyCaseTransform(str, caseFormat) {
21
+ switch (caseFormat) {
22
+ case "kebab-case":
23
+ return kebabCase(str);
24
+ case "camelCase":
25
+ return camelCase(str);
26
+ case "PascalCase":
27
+ return pascalCase(str);
28
+ case "snake_case":
29
+ return snakeCase(str);
30
+ case "lowercase":
31
+ return str.toLowerCase();
32
+ case "UPPERCASE":
33
+ return str.toUpperCase();
34
+ default:
35
+ return str;
36
+ }
37
+ }
12
38
  function normalizeString(input, options) {
13
39
  const finalOptions = { ...defaultOptions, ...options }, accentsMap = {
14
40
  À: "A",
@@ -60,7 +86,7 @@ function normalizeString(input, options) {
60
86
  ó: "o"
61
87
  };
62
88
  let result = input.toString();
63
- if (finalOptions.trim && (result = result.trim()), finalOptions.normalizeSpaces && (result = result.replaceAll(/\s+/g, " ")), finalOptions.replaceSpaces && (result = result.replaceAll(" ", "-")), finalOptions.removeNumbers && (result = result.replaceAll(/\d/g, "")), finalOptions.removeAccents && (result = result.replaceAll(/[ÀÁÂÃÄÅÇÈÉÊËÎÏÑÔÕÖØÙÚÛÜàáâãäåçèéêëíîïñóôõöøùúûüÿ]/g, (char) => accentsMap[char] || char), result = result.replaceAll(/[\u0300-\u036F]/g, "")), finalOptions.caseSensitive === !1 && (result = result.toLowerCase()), finalOptions.removeSpecialCharacters && (result = result.replaceAll(/[^\dA-Z-]/gi, "")), finalOptions.trim && (result = result.trim()), finalOptions.customNormalizationForms)
89
+ if (finalOptions.trim && (result = result.trim()), finalOptions.normalizeSpaces && (result = result.replaceAll(/\s+/g, " ")), finalOptions.replaceSpaces && (result = result.replaceAll(" ", "-")), finalOptions.removeNumbers && (result = result.replaceAll(/\d/g, "")), finalOptions.removeAccents && (result = result.replaceAll(/[ÀÁÂÃÄÅÇÈÉÊËÎÏÑÔÕÖØÙÚÛÜàáâãäåçèéêëíîïñóôõöøùúûüÿ]/g, (char) => accentsMap[char] || char), result = result.replaceAll(/[\u0300-\u036F]/g, "")), finalOptions.case ? result = applyCaseTransform(result, finalOptions.case) : finalOptions.caseSensitive === !1 && (result = result.toLowerCase()), finalOptions.removeSpecialCharacters && (result = result.replaceAll(/[^\dA-Z-]/gi, "")), finalOptions.trim && (result = result.trim()), finalOptions.customNormalizationForms)
64
90
  for (const form of finalOptions.customNormalizationForms)
65
91
  result = result.normalize(form);
66
92
  return result;
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, defineAsyncComponent, ref, watch, computed, createElementBlock, openBlock, createElementVNode, createVNode, unref, createCommentVNode, createBlock, renderSlot, createTextVNode, toDisplayString, mergeProps, withCtx, Fragment, renderList } from "vue";
2
2
  import { MazMagnifyingGlass, MazNoSymbol } from "@maz-ui/icons";
3
3
  import { u as useTranslations } from "../chunks/useTranslations.D5aoYwD7.js";
4
- import { n as normalizeString, u as useStringMatching } from "../chunks/useStringMatching.Ba1yCuA4.js";
4
+ import { n as normalizeString, u as useStringMatching } from "../chunks/useStringMatching.BBezu-6J.js";
5
5
  import { useInstanceUniqId } from "../composables/useInstanceUniqId.js";
6
6
  import MazCardSpotlight from "./MazCardSpotlight.js";
7
7
  import MazCheckbox from "./MazCheckbox.js";
@@ -2,7 +2,7 @@ import { defineComponent, mergeModels, defineAsyncComponent, useTemplateRef, com
2
2
  import { MazMagnifyingGlass, MazNoSymbol, MazChevronDown } from "@maz-ui/icons";
3
3
  import { u as useTranslations } from "../chunks/useTranslations.D5aoYwD7.js";
4
4
  import { i as isClient } from "../chunks/isClient.WI4oSt66.js";
5
- import { u as useStringMatching, n as normalizeString } from "../chunks/useStringMatching.Ba1yCuA4.js";
5
+ import { u as useStringMatching, n as normalizeString } from "../chunks/useStringMatching.BBezu-6J.js";
6
6
  import { useInstanceUniqId } from "../composables/useInstanceUniqId.js";
7
7
  import MazInput from "./MazInput.js";
8
8
  import MazPopover from "./MazPopover.js";
@@ -11,7 +11,7 @@ import { useInjectStrict } from "./useInjectStrict.js";
11
11
  import { useInstanceUniqId } from "./useInstanceUniqId.js";
12
12
  import { useMountComponent } from "./useMountComponent.js";
13
13
  import { useReadingTime } from "./useReadingTime.js";
14
- import { u } from "../chunks/useStringMatching.Ba1yCuA4.js";
14
+ import { u } from "../chunks/useStringMatching.BBezu-6J.js";
15
15
  import { useSwipe } from "./useSwipe.js";
16
16
  import { useTimer } from "./useTimer.js";
17
17
  import { useToast } from "./useToast.js";
@@ -1,4 +1,4 @@
1
- import { u } from "../chunks/useStringMatching.Ba1yCuA4.js";
1
+ import { u } from "../chunks/useStringMatching.BBezu-6J.js";
2
2
  import "vue";
3
3
  export {
4
4
  u as useStringMatching
@@ -1,10 +1,4 @@
1
- import { c as capitalize } from "../chunks/capitalize.BF6CDS_4.js";
2
- function camelCase(str) {
3
- return str.replaceAll(/-(\w)/g, (_, c) => c ? c.toUpperCase() : "");
4
- }
5
- function pascalCase(str) {
6
- return capitalize(camelCase(str));
7
- }
1
+ import { p as pascalCase } from "../chunks/pascalCase.GdDKKQ-O.js";
8
2
  const a = [
9
3
  "MazAcademicCap",
10
4
  "MazAdjustmentsHorizontal",
@@ -47,7 +47,9 @@ const composablesMap = {
47
47
  ScriptLoader: !0,
48
48
  Swipe: !0,
49
49
  UserVisibility: !0,
50
- TextareaAutogrow: !0
50
+ TextareaAutogrow: !0,
51
+ kebabCase: !0,
52
+ snakeCase: !0
51
53
  };
52
54
  function MazModulesResolver(options) {
53
55
  return (name) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "maz-ui",
3
3
  "type": "module",
4
- "version": "4.0.0-beta.24",
4
+ "version": "4.0.0-beta.26",
5
5
  "description": "A standalone components library for Vue.Js 3 & Nuxt.Js 3",
6
6
  "author": "Louis Mazel <me@loicmazuel.com>",
7
7
  "license": "MIT",
@@ -184,11 +184,11 @@
184
184
  },
185
185
  "dependencies": {
186
186
  "@floating-ui/vue": "^1.1.8",
187
- "@maz-ui/cli": "4.0.0-beta.24",
188
- "@maz-ui/icons": "4.0.0-beta.24",
189
- "@maz-ui/themes": "4.0.0-beta.24",
190
- "@maz-ui/translations": "4.0.0-beta.24",
191
- "@maz-ui/utils": "4.0.0-beta.24",
187
+ "@maz-ui/cli": "4.0.0-beta.26",
188
+ "@maz-ui/icons": "4.0.0-beta.26",
189
+ "@maz-ui/themes": "4.0.0-beta.25",
190
+ "@maz-ui/translations": "4.0.0-beta.25",
191
+ "@maz-ui/utils": "4.0.0-beta.25",
192
192
  "chart.js": "^4.5.0",
193
193
  "dayjs": "^1.11.13",
194
194
  "libphonenumber-js": "^1.12.10",
@@ -196,8 +196,8 @@
196
196
  "vue-chartjs": "^5.3.2"
197
197
  },
198
198
  "devDependencies": {
199
- "@maz-ui/eslint-config": "4.0.0-beta.22",
200
- "@maz-ui/node": "4.0.0-beta.24",
199
+ "@maz-ui/eslint-config": "4.0.0-beta.25",
200
+ "@maz-ui/node": "4.0.0-beta.26",
201
201
  "@vitejs/plugin-vue": "^6.0.1",
202
202
  "@vitest/coverage-v8": "^3.2.4",
203
203
  "@vue/compiler-sfc": "^3.5.18",
@@ -207,14 +207,14 @@
207
207
  "glob": "^11.0.3",
208
208
  "jsdom": "^26.1.0",
209
209
  "lightningcss": "^1.30.1",
210
- "nuxt": "^4.0.2",
210
+ "nuxt": "^4.0.3",
211
211
  "postcss": "^8.5.6",
212
212
  "postcss-html": "^1.8.0",
213
213
  "postcss-import": "^16.1.1",
214
214
  "postcss-nested": "^7.0.2",
215
215
  "postcss-replace": "^2.0.1",
216
216
  "postcss-url": "^10.1.3",
217
- "sass": "^1.89.1",
217
+ "sass": "^1.90.0",
218
218
  "stylelint": "^16.23.0",
219
219
  "stylelint-config-recommended-vue": "^1.6.1",
220
220
  "stylelint-config-standard": "^39.0.0",
@@ -222,8 +222,8 @@
222
222
  "stylelint-config-tailwindcss": "^1.0.0",
223
223
  "stylelint-scss": "^6.12.0",
224
224
  "tailwindcss": "^3.4.16",
225
- "typescript": "~5.8.3",
226
- "unplugin-auto-import": "^19.3.0",
225
+ "typescript": "~5.9.2",
226
+ "unplugin-auto-import": "^20.0.0",
227
227
  "unplugin-vue-components": "^28.8.0",
228
228
  "vite": "^7.0.6",
229
229
  "vite-plugin-dts": "^4.5.4",
@@ -232,11 +232,11 @@
232
232
  "vitest": "^3.2.4",
233
233
  "vue": "^3.5.18",
234
234
  "vue-router": "^4.5.1",
235
- "vue-tsc": "^3.0.4"
235
+ "vue-tsc": "^3.0.5"
236
236
  },
237
237
  "lint-staged": {
238
238
  "*.{js,ts,vue,mjs,mts,cjs,md,yml,json}": "cross-env NODE_ENV=production eslint --fix",
239
239
  "*.{vue,css,scss,postcss,pcss}": "stylelint --fix --allow-empty-input"
240
240
  },
241
- "gitHead": "9ea5ccdfb15f18c4e102ef5d2cfba29bd304d38e"
241
+ "gitHead": "bfbe28abf5a3c3aae95b64833c681ff6cbe5bd42"
242
242
  }