@stonecrop/aform 0.3.7 → 0.3.8
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/aform.js +100 -97
- package/dist/aform.js.map +1 -1
- package/dist/aform.umd.cjs +1 -1
- package/dist/aform.umd.cjs.map +1 -1
- package/dist/directives/mask.js +3 -3
- package/package.json +5 -5
- package/src/directives/mask.ts +3 -3
package/dist/directives/mask.js
CHANGED
|
@@ -37,13 +37,13 @@ function getMask(binding) {
|
|
|
37
37
|
if (maskFn) {
|
|
38
38
|
// TODO: (state) replace with state management;
|
|
39
39
|
// pass the entire form/table data to the function
|
|
40
|
-
const locale = binding.instance['locale'];
|
|
40
|
+
const locale = binding.instance?.['locale'];
|
|
41
41
|
mask = maskFn(locale);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
45
|
// TODO: (state) handle using state management
|
|
46
|
-
const schema = binding.instance['schema'];
|
|
46
|
+
const schema = binding.instance?.['schema'];
|
|
47
47
|
const fieldType = schema?.fieldtype?.toLowerCase();
|
|
48
48
|
if (fieldType && NAMED_MASKS[fieldType]) {
|
|
49
49
|
mask = NAMED_MASKS[fieldType];
|
|
@@ -110,7 +110,7 @@ export function useStringMask(el, binding) {
|
|
|
110
110
|
// TODO: (state) this is very opinionated;
|
|
111
111
|
// most likely fixed with state management;
|
|
112
112
|
// a better way could be to emit back to instance;
|
|
113
|
-
if (binding.instance['maskFilled']) {
|
|
113
|
+
if (binding.instance?.['maskFilled']) {
|
|
114
114
|
binding.instance['maskFilled'] = !replacement.includes(maskToken);
|
|
115
115
|
}
|
|
116
116
|
el.value = replacement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stonecrop/aform",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@vueuse/core": "^12.0.0",
|
|
35
35
|
"vue": "^3.5.11",
|
|
36
|
-
"@stonecrop/themes": "0.3.
|
|
37
|
-
"@stonecrop/utilities": "0.3.
|
|
36
|
+
"@stonecrop/themes": "0.3.8",
|
|
37
|
+
"@stonecrop/utilities": "0.3.8"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@microsoft/api-documenter": "^7.26.2",
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
"vite": "^5.4.5",
|
|
56
56
|
"vitest": "^2.1.1",
|
|
57
57
|
"vue-router": "^4.4.0",
|
|
58
|
-
"@stonecrop/atable": "0.3.
|
|
58
|
+
"@stonecrop/atable": "0.3.8",
|
|
59
59
|
"stonecrop-rig": "0.2.22"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"@stonecrop/atable": "0.3.
|
|
62
|
+
"@stonecrop/atable": "0.3.8"
|
|
63
63
|
},
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
package/src/directives/mask.ts
CHANGED
|
@@ -43,12 +43,12 @@ function getMask(binding: DirectiveBinding<string>) {
|
|
|
43
43
|
if (maskFn) {
|
|
44
44
|
// TODO: (state) replace with state management;
|
|
45
45
|
// pass the entire form/table data to the function
|
|
46
|
-
const locale = binding.instance['locale']
|
|
46
|
+
const locale = binding.instance?.['locale']
|
|
47
47
|
mask = maskFn(locale)
|
|
48
48
|
}
|
|
49
49
|
} else {
|
|
50
50
|
// TODO: (state) handle using state management
|
|
51
|
-
const schema = binding.instance['schema'] as FormSchema
|
|
51
|
+
const schema = binding.instance?.['schema'] as FormSchema
|
|
52
52
|
const fieldType: string | undefined = schema?.fieldtype?.toLowerCase()
|
|
53
53
|
if (fieldType && NAMED_MASKS[fieldType]) {
|
|
54
54
|
mask = NAMED_MASKS[fieldType]
|
|
@@ -127,7 +127,7 @@ export function useStringMask(el: HTMLInputElement, binding: DirectiveBinding<st
|
|
|
127
127
|
// most likely fixed with state management;
|
|
128
128
|
// a better way could be to emit back to instance;
|
|
129
129
|
|
|
130
|
-
if (binding.instance['maskFilled']) {
|
|
130
|
+
if (binding.instance?.['maskFilled']) {
|
|
131
131
|
binding.instance['maskFilled'] = !replacement.includes(maskToken)
|
|
132
132
|
}
|
|
133
133
|
|