@azure-net/kit 3.9.3 → 4.0.0-0
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/core/delivery/schema/rules/Rules.js +2 -31
- package/dist/core/index.d.ts +0 -1
- package/dist/core/index.js +0 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -5
- package/dist/core/constants/index.d.ts +0 -1
- package/dist/core/constants/index.js +0 -1
- package/dist/core/constants/masks.d.ts +0 -1466
- package/dist/core/constants/masks.js +0 -246
- package/dist/core/ui/eventModifiers/EventModifiers.d.ts +0 -17
- package/dist/core/ui/eventModifiers/EventModifiers.js +0 -31
- package/dist/core/ui/eventModifiers/index.d.ts +0 -1
- package/dist/core/ui/eventModifiers/index.js +0 -1
- package/dist/core/ui/index.d.ts +0 -4
- package/dist/core/ui/index.js +0 -4
- package/dist/core/ui/mask/Mask.d.ts +0 -13
- package/dist/core/ui/mask/Mask.js +0 -110
- package/dist/core/ui/mask/index.d.ts +0 -1
- package/dist/core/ui/mask/index.js +0 -1
- package/dist/core/ui/onClickOutside/OnClickOutside.d.ts +0 -3
- package/dist/core/ui/onClickOutside/OnClickOutside.js +0 -22
- package/dist/core/ui/onClickOutside/index.d.ts +0 -1
- package/dist/core/ui/onClickOutside/index.js +0 -1
- package/dist/core/ui/scrollTo/index.d.ts +0 -1
- package/dist/core/ui/scrollTo/index.js +0 -23
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { masks } from '../../../constants/masks.js';
|
|
2
1
|
/**
|
|
3
2
|
*
|
|
4
3
|
* @param validationMessages - BaseValidationMessages
|
|
@@ -180,7 +179,6 @@ export const createRules = (validationMessages) => {
|
|
|
180
179
|
* @returns ValidationRuleResult<T, D>
|
|
181
180
|
* @description Checks if the value is a phone number and if it is valid.
|
|
182
181
|
*/
|
|
183
|
-
const countryCodes = new Set(Object.values(masks).map((country) => country.cc)).add('8');
|
|
184
182
|
const phone = (params) => {
|
|
185
183
|
const { message } = { ...params, message: params?.message ?? validationMessages.phone };
|
|
186
184
|
return ({ val }) => {
|
|
@@ -197,40 +195,13 @@ export const createRules = (validationMessages) => {
|
|
|
197
195
|
return message();
|
|
198
196
|
}
|
|
199
197
|
let hasValidCountryCode = false;
|
|
200
|
-
if (cleanedVal.startsWith('
|
|
201
|
-
const sortedCodes = Array.from(countryCodes)
|
|
202
|
-
.filter((code) => code.startsWith('+'))
|
|
203
|
-
.sort((a, b) => b.length - a.length);
|
|
204
|
-
for (const code of sortedCodes) {
|
|
205
|
-
if (cleanedVal.startsWith(code)) {
|
|
206
|
-
const remainingDigits = cleanedVal.slice(code.length);
|
|
207
|
-
if (remainingDigits.length >= 4) {
|
|
208
|
-
hasValidCountryCode = true;
|
|
209
|
-
break;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
else if (cleanedVal.startsWith('8')) {
|
|
198
|
+
if (cleanedVal.startsWith('8')) {
|
|
215
199
|
if (cleanedVal.length === 11) {
|
|
216
200
|
hasValidCountryCode = true;
|
|
217
201
|
}
|
|
218
202
|
}
|
|
219
203
|
else if (/^\d+$/.test(cleanedVal)) {
|
|
220
|
-
|
|
221
|
-
.filter((code) => !code.startsWith('+') && code !== 'N/A')
|
|
222
|
-
.map((code) => code.replace('+', ''))
|
|
223
|
-
.sort((a, b) => b.length - a.length);
|
|
224
|
-
for (const code of codesWithoutPlus) {
|
|
225
|
-
if (cleanedVal.startsWith(code)) {
|
|
226
|
-
const remainingDigits = cleanedVal.slice(code.length);
|
|
227
|
-
if (remainingDigits.length >= 4) {
|
|
228
|
-
hasValidCountryCode = true;
|
|
229
|
-
break;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
if (!hasValidCountryCode && cleanedVal.length >= 7 && cleanedVal.length <= 10) {
|
|
204
|
+
if (!hasValidCountryCode && cleanedVal.length >= 6 && cleanedVal.length <= 16) {
|
|
234
205
|
hasValidCountryCode = true;
|
|
235
206
|
}
|
|
236
207
|
}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { event, stop, prevent, once, immediate, type EventHandler, onClickOutside, scrollTo, Mask, masked } from './ui/index.js';
|
|
2
1
|
export { createQuery, createAsyncSignal, createActiveForm, refreshAsyncSignal, refreshAllAsyncSignals, type AsyncSignalOptions, type AsyncSignalSvelte, type QueryController, type CreateQueryOptions, type AsyncSignalSource, type AsyncStatus } from './svelte/index.js';
|
|
3
2
|
export { createMiddlewareManager, type IMiddleware } from './shared/middleware/index.js';
|
|
4
3
|
export { ClassMirror } from './shared/classMirror/index.js';
|
package/dist/core/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { event, stop, prevent, once, immediate, onClickOutside, scrollTo, Mask, masked } from './ui/index.js';
|
|
2
1
|
export { createQuery, createAsyncSignal, createActiveForm, refreshAsyncSignal, refreshAllAsyncSignals } from './svelte/index.js';
|
|
3
2
|
export { createMiddlewareManager } from './shared/middleware/index.js';
|
|
4
3
|
export { ClassMirror } from './shared/classMirror/index.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './core/index.js';
|
|
2
|
-
export
|
|
2
|
+
export { __withEdgesUniversalLoad } from './edges/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './core/index.js';
|
|
2
|
-
export
|
|
2
|
+
export { __withEdgesUniversalLoad } from './edges/index.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure-net/kit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-0",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"!dist/**/*.test.*",
|
|
@@ -17,10 +17,6 @@
|
|
|
17
17
|
"types": "./dist/index.d.ts",
|
|
18
18
|
"svelte": "./dist/index.js"
|
|
19
19
|
},
|
|
20
|
-
"./constants": {
|
|
21
|
-
"types": "./dist/core/constants/index.d.ts",
|
|
22
|
-
"svelte": "./dist/core/constants/index.js"
|
|
23
|
-
},
|
|
24
20
|
"./infra": {
|
|
25
21
|
"types": "./dist/core/infra.d.ts",
|
|
26
22
|
"svelte": "./dist/core/infra.js"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './masks.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './masks.js';
|