@avenirs-esr/avenirs-dsav 0.1.230 → 0.1.232
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/components/interaction/radios/AvRadioButtonSet/AvRadioButtonSet.stub.d.ts +8 -0
- package/dist/src/components/interaction/radios/AvRadioButtonSet/AvRadioButtonSet.stub.cjs +1 -1
- package/dist/src/components/interaction/radios/AvRadioButtonSet/AvRadioButtonSet.stub.js +2 -1
- package/dist/src/utils/links/links.cjs +1 -1
- package/dist/src/utils/links/links.js +11 -6
- package/dist/utils/links/links.d.ts +11 -3
- package/package.json +1 -1
|
@@ -3,11 +3,19 @@ export declare const AvRadioButtonSetStub: import("vue").DefineComponent<import(
|
|
|
3
3
|
name: StringConstructor;
|
|
4
4
|
inline: BooleanConstructor;
|
|
5
5
|
small: BooleanConstructor;
|
|
6
|
+
errorMessage: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
required: false;
|
|
9
|
+
};
|
|
6
10
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
11
|
modelValue: StringConstructor;
|
|
8
12
|
name: StringConstructor;
|
|
9
13
|
inline: BooleanConstructor;
|
|
10
14
|
small: BooleanConstructor;
|
|
15
|
+
errorMessage: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
required: false;
|
|
18
|
+
};
|
|
11
19
|
}>> & Readonly<{
|
|
12
20
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
13
21
|
}>, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),e=t.defineComponent({name:"AvRadioButtonSet",props:{modelValue:String,name:String,inline:Boolean,small:Boolean},emits:["update:modelValue"],template:'<div class="av-radio-button-set-stub" data-testid="av-radio-button-set-stub"><slot /></div>'});exports.AvRadioButtonSetStub=e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),e=t.defineComponent({name:"AvRadioButtonSet",props:{modelValue:String,name:String,inline:Boolean,small:Boolean,errorMessage:{type:String,required:!1}},emits:["update:modelValue"],template:'<div class="av-radio-button-set-stub" data-testid="av-radio-button-set-stub"><slot /></div>'});exports.AvRadioButtonSetStub=e;
|
|
@@ -5,7 +5,8 @@ const o = t({
|
|
|
5
5
|
modelValue: String,
|
|
6
6
|
name: String,
|
|
7
7
|
inline: Boolean,
|
|
8
|
-
small: Boolean
|
|
8
|
+
small: Boolean,
|
|
9
|
+
errorMessage: { type: String, required: !1 }
|
|
9
10
|
},
|
|
10
11
|
emits: ["update:modelValue"],
|
|
11
12
|
template: '<div class="av-radio-button-set-stub" data-testid="av-radio-button-set-stub"><slot /></div>'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(e){if(!e||e.includes(" "))return!1;try{const r=new URL(e);if(!["http:","https:"].includes(r.protocol))return!1;const t=r.hostname.toLowerCase().split(".");if(t.length<2||t[0]==="www"&&t.length<3||t.includes(""))return!1;const s=t.at(-1)??"";return/^[a-z]{2,63}$/.test(s)}catch{return!1}}exports.isValidLink=n;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
if (!r)
|
|
1
|
+
function n(e) {
|
|
2
|
+
if (!e || e.includes(" "))
|
|
4
3
|
return !1;
|
|
5
4
|
try {
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
const r = new URL(e);
|
|
6
|
+
if (!["http:", "https:"].includes(r.protocol))
|
|
7
|
+
return !1;
|
|
8
|
+
const t = r.hostname.toLowerCase().split(".");
|
|
9
|
+
if (t.length < 2 || t[0] === "www" && t.length < 3 || t.includes(""))
|
|
10
|
+
return !1;
|
|
11
|
+
const s = t.at(-1) ?? "";
|
|
12
|
+
return /^[a-z]{2,63}$/.test(s);
|
|
8
13
|
} catch {
|
|
9
14
|
return !1;
|
|
10
15
|
}
|
|
11
16
|
}
|
|
12
17
|
export {
|
|
13
|
-
|
|
18
|
+
n as isValidLink
|
|
14
19
|
};
|
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Returns the link validation status.
|
|
3
|
-
*
|
|
3
|
+
* Only absolute HTTP/HTTPS URLs are accepted.
|
|
4
|
+
* The input must not contain spaces, the hostname must include at least one dot,
|
|
5
|
+
* and the final TLD must contain only letters with a length between 2 and 63.
|
|
6
|
+
* Hostnames starting with "www" must include at least 3 labels (e.g. www.example.com).
|
|
4
7
|
*
|
|
5
8
|
* @param {string} link - The URL string to validate.
|
|
6
9
|
* @returns {boolean} True if the link is valid, false otherwise.
|
|
7
10
|
*
|
|
8
11
|
* @example
|
|
9
12
|
* isValidLink('https://example.com') // returns true
|
|
13
|
+
* isValidLink('https://www.example.com') // returns true
|
|
14
|
+
* isValidLink('http://www.example') // returns false
|
|
10
15
|
* isValidLink('http://example.com/path') // returns true
|
|
11
16
|
* isValidLink('') // returns false
|
|
12
17
|
* isValidLink('hello world') // returns false
|
|
18
|
+
* isValidLink(' https://example.com ') // returns false
|
|
19
|
+
* isValidLink('https://example .com ') // returns false
|
|
13
20
|
* isValidLink('javascript:alert(1)') // returns false
|
|
21
|
+
* isValidLink('http://w.e') // returns false
|
|
14
22
|
* isValidLink('/my-page') // returns false (relative URL not allowed by default)
|
|
15
23
|
*
|
|
16
24
|
* @remarks
|
|
17
|
-
* The function uses the URL constructor for validation
|
|
18
|
-
*
|
|
25
|
+
* The function uses the URL constructor for validation and then applies additional
|
|
26
|
+
* hostname/TLD checks to reject incomplete or malformed domains.
|
|
19
27
|
*/
|
|
20
28
|
export declare function isValidLink(link?: string): boolean;
|