@zag-js/pin-input 0.2.1 → 0.2.2
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/index.js +2 -3
- package/dist/index.mjs +2 -3
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -324,7 +324,7 @@ function getWindow(el) {
|
|
|
324
324
|
}
|
|
325
325
|
function getDescriptor(el, options) {
|
|
326
326
|
var _a;
|
|
327
|
-
const { type, property } = options;
|
|
327
|
+
const { type, property = "value" } = options;
|
|
328
328
|
const proto = getWindow(el)[type].prototype;
|
|
329
329
|
return (_a = Object.getOwnPropertyDescriptor(proto, property)) != null ? _a : {};
|
|
330
330
|
}
|
|
@@ -626,9 +626,8 @@ function isValidType(value, type) {
|
|
|
626
626
|
return !!((_a = REGEX[type]) == null ? void 0 : _a.test(value));
|
|
627
627
|
}
|
|
628
628
|
function assign(ctx, value) {
|
|
629
|
-
const valueArr = value.split("").filter(Boolean);
|
|
629
|
+
const valueArr = Array.isArray(value) ? value : value.split("").filter(Boolean);
|
|
630
630
|
const valueObj = Object.assign({}, ctx.value, valueArr);
|
|
631
|
-
console.log("valueObj :>> ", valueObj);
|
|
632
631
|
ctx.value = Object.values(valueObj);
|
|
633
632
|
}
|
|
634
633
|
function lastChar(value) {
|
package/dist/index.mjs
CHANGED
|
@@ -297,7 +297,7 @@ function getWindow(el) {
|
|
|
297
297
|
}
|
|
298
298
|
function getDescriptor(el, options) {
|
|
299
299
|
var _a;
|
|
300
|
-
const { type, property } = options;
|
|
300
|
+
const { type, property = "value" } = options;
|
|
301
301
|
const proto = getWindow(el)[type].prototype;
|
|
302
302
|
return (_a = Object.getOwnPropertyDescriptor(proto, property)) != null ? _a : {};
|
|
303
303
|
}
|
|
@@ -599,9 +599,8 @@ function isValidType(value, type) {
|
|
|
599
599
|
return !!((_a = REGEX[type]) == null ? void 0 : _a.test(value));
|
|
600
600
|
}
|
|
601
601
|
function assign(ctx, value) {
|
|
602
|
-
const valueArr = value.split("").filter(Boolean);
|
|
602
|
+
const valueArr = Array.isArray(value) ? value : value.split("").filter(Boolean);
|
|
603
603
|
const valueObj = Object.assign({}, ctx.value, valueArr);
|
|
604
|
-
console.log("valueObj :>> ", valueObj);
|
|
605
604
|
ctx.value = Object.values(valueObj);
|
|
606
605
|
}
|
|
607
606
|
function lastChar(value) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/pin-input",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Core logic for the pin-input widget implemented as a state machine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@zag-js/core": "0.2.
|
|
33
|
-
"@zag-js/types": "0.3.
|
|
32
|
+
"@zag-js/core": "0.2.2",
|
|
33
|
+
"@zag-js/types": "0.3.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@zag-js/dom-utils": "0.2.
|
|
37
|
-
"@zag-js/form-utils": "0.2.
|
|
38
|
-
"@zag-js/utils": "0.3.
|
|
36
|
+
"@zag-js/dom-utils": "0.2.1",
|
|
37
|
+
"@zag-js/form-utils": "0.2.1",
|
|
38
|
+
"@zag-js/utils": "0.3.1"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build-fast": "tsup src/index.ts --format=esm,cjs",
|