@onsvisual/svelte-components 0.0.28 → 0.0.29
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.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} CardEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} CardSlots */
|
|
4
4
|
export default class Card extends SvelteComponentTyped<{
|
|
5
|
-
id?:
|
|
5
|
+
id?: string;
|
|
6
6
|
title?: any;
|
|
7
7
|
href?: any;
|
|
8
8
|
hideTitle?: boolean;
|
|
@@ -23,7 +23,7 @@ export type CardSlots = typeof __propDef.slots;
|
|
|
23
23
|
import { SvelteComponentTyped } from "svelte";
|
|
24
24
|
declare const __propDef: {
|
|
25
25
|
props: {
|
|
26
|
-
id?:
|
|
26
|
+
id?: string;
|
|
27
27
|
title?: any;
|
|
28
28
|
href?: any;
|
|
29
29
|
hideTitle?: boolean;
|
package/dist/js/utils.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const randomString = () => {
|
|
2
|
+
return Math.random().toString(16).slice(2, 8);
|
|
3
|
+
};
|
|
4
4
|
|
|
5
|
-
export const slugify = (str, suffix =
|
|
6
|
-
str
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
export const slugify = (str, suffix = false) =>
|
|
6
|
+
typeof str === "string"
|
|
7
|
+
? str
|
|
8
|
+
.toString()
|
|
9
|
+
.normalize("NFD")
|
|
10
|
+
.replace(/[\u0300-\u036f]/g, "")
|
|
11
|
+
.toLowerCase()
|
|
12
|
+
.trim()
|
|
13
|
+
.replace(/\s+/g, "-")
|
|
14
|
+
.replace(/[^\w-]+/g, "")
|
|
15
|
+
.replace(/--+/g, "-")
|
|
16
|
+
.concat(suffix ? `-${randomString()}` : "")
|
|
17
|
+
: randomString();
|
|
16
18
|
|
|
17
19
|
export const validDate = (str) => {
|
|
18
20
|
if (!str) return false;
|