@a-drowned-fish/rox-v 1.0.0 → 1.0.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/README.md +255 -27
- package/dist/es/_virtual/_plugin-vue_export-helper.js +8 -0
- package/dist/es/_virtual/_rolldown/runtime.js +11 -0
- package/dist/es/components.js +10 -0
- package/dist/es/index.js +11 -0
- package/dist/es/input-otp/index.js +7 -0
- package/dist/es/input-otp/input-otp.js +7 -0
- package/dist/es/input-otp/input-otp.vue_vue_type_script_setup_true_lang.js +89 -0
- package/dist/es/input-otp/style.css +1 -0
- package/dist/es/popup/index.js +7 -0
- package/dist/es/popup/popup.js +7 -0
- package/dist/es/popup/popup.vue_vue_type_script_setup_true_lang.js +51 -0
- package/dist/es/popup/style.css +1 -0
- package/dist/index.js +1 -75
- package/dist/lib/_virtual/_plugin-vue_export-helper.js +1 -0
- package/dist/lib/_virtual/_rolldown/runtime.js +1 -0
- package/dist/lib/components.js +1 -0
- package/dist/lib/index.js +1 -0
- package/dist/lib/input-otp/index.js +1 -0
- package/dist/lib/input-otp/input-otp.js +1 -0
- package/dist/lib/input-otp/input-otp.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/lib/input-otp/style.css +1 -0
- package/dist/lib/popup/index.js +1 -0
- package/dist/lib/popup/popup.js +1 -0
- package/dist/lib/popup/popup.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/lib/popup/style.css +1 -0
- package/dist/style.css +2 -1
- package/dist/types/components/components.d.ts +4 -0
- package/dist/types/components/index.d.ts +7 -0
- package/dist/types/components/input-otp/index.d.ts +5 -0
- package/{es → dist/types/components}/input-otp/input-otp.vue.d.ts +5 -10
- package/dist/types/components/input-otp/style.css.d.ts +1 -0
- package/dist/types/components/input-otp/types.d.ts +8 -0
- package/dist/types/components/popup/index.d.ts +5 -0
- package/dist/types/components/popup/popup.vue.d.ts +33 -0
- package/dist/types/components/popup/style.css.d.ts +1 -0
- package/dist/types/components/popup/types.d.ts +8 -0
- package/dist/types/components/style.css.d.ts +1 -0
- package/package.json +48 -57
- package/dist/index.iife.js +0 -1
- package/dist/index.umd.cjs +0 -1
- package/es/components.d.ts +0 -1
- package/es/components.js +0 -69
- package/es/index.d.ts +0 -9
- package/es/index.js +0 -75
- package/es/input-otp/index.css +0 -28
- package/es/input-otp/index.d.ts +0 -3
- package/es/input-otp/index.js +0 -89
- package/lib/components.d.ts +0 -1
- package/lib/components.js +0 -1
- package/lib/index.d.ts +0 -9
- package/lib/index.js +0 -1
- package/lib/input-otp/index.css +0 -28
- package/lib/input-otp/index.d.ts +0 -3
- package/lib/input-otp/index.js +0 -89
- package/lib/input-otp/input-otp.vue.d.ts +0 -23
- package/resolver/resolver.cjs +0 -25
- package/resolver/resolver.d.ts +0 -13
- package/resolver/resolver.js +0 -25
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.fade-enter-from[data-v-00d0e4c1],.fade-leave-to[data-v-00d0e4c1]{opacity:0}.popup-container[data-v-00d0e4c1]{z-index:50;transition:opacity var(--duration) ease-in-out;will-change:opacity;position:fixed;inset:0}.popup-content[data-v-00d0e4c1]{transition:transform var(--duration) ease-in-out;will-change:transform;position:absolute}.popup-container-top .popup-content[data-v-00d0e4c1]{top:0;left:0;right:0}.fade-enter-from.popup-container-top .popup-content[data-v-00d0e4c1],.fade-leave-to.popup-container-top .popup-content[data-v-00d0e4c1]{transform:translateY(-100%)}.popup-container-bottom .popup-content[data-v-00d0e4c1]{bottom:0;left:0;right:0}.fade-enter-from.popup-container-bottom .popup-content[data-v-00d0e4c1],.fade-leave-to.popup-container-bottom .popup-content[data-v-00d0e4c1]{transform:translateY(100%)}.popup-container-left .popup-content[data-v-00d0e4c1]{top:0;bottom:0;left:0}.fade-enter-from.popup-container-left .popup-content[data-v-00d0e4c1],.fade-leave-to.popup-container-left .popup-content[data-v-00d0e4c1]{transform:translate(-100%)}.popup-container-right .popup-content[data-v-00d0e4c1]{top:0;bottom:0;right:0}.fade-enter-from.popup-container-right .popup-content[data-v-00d0e4c1],.fade-leave-to.popup-container-right .popup-content[data-v-00d0e4c1]{transform:translate(100%)}
|
package/dist/style.css
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
.otp-wrapper[data-v-
|
|
1
|
+
.otp-wrapper[data-v-0e246228]{cursor:pointer;width:max-content;position:relative}.otp-box[data-v-0e246228]{display:flex}.otp-item[data-v-0e246228]{border-bottom:1px solid #00000029;justify-content:center;align-items:center;width:60px;height:60px;transition:all .2s;display:flex}.otp-item.active[data-v-0e246228]{border-bottom:1px solid #000}.fade-enter-from[data-v-00d0e4c1],.fade-leave-to[data-v-00d0e4c1]{opacity:0}.popup-container[data-v-00d0e4c1]{z-index:50;transition:opacity var(--duration) ease-in-out;will-change:opacity;position:fixed;inset:0}.popup-content[data-v-00d0e4c1]{transition:transform var(--duration) ease-in-out;will-change:transform;position:absolute}.popup-container-top .popup-content[data-v-00d0e4c1]{top:0;left:0;right:0}.fade-enter-from.popup-container-top .popup-content[data-v-00d0e4c1],.fade-leave-to.popup-container-top .popup-content[data-v-00d0e4c1]{transform:translateY(-100%)}.popup-container-bottom .popup-content[data-v-00d0e4c1]{bottom:0;left:0;right:0}.fade-enter-from.popup-container-bottom .popup-content[data-v-00d0e4c1],.fade-leave-to.popup-container-bottom .popup-content[data-v-00d0e4c1]{transform:translateY(100%)}.popup-container-left .popup-content[data-v-00d0e4c1]{top:0;bottom:0;left:0}.fade-enter-from.popup-container-left .popup-content[data-v-00d0e4c1],.fade-leave-to.popup-container-left .popup-content[data-v-00d0e4c1]{transform:translate(-100%)}.popup-container-right .popup-content[data-v-00d0e4c1]{top:0;bottom:0;right:0}.fade-enter-from.popup-container-right .popup-content[data-v-00d0e4c1],.fade-leave-to.popup-container-right .popup-content[data-v-00d0e4c1]{transform:translate(100%)}
|
|
2
|
+
/*$vite$:1*/
|
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
length?: number;
|
|
4
|
-
itemClass?: string;
|
|
5
|
-
activeItemClass?: string;
|
|
6
|
-
gap?: string;
|
|
7
|
-
}
|
|
8
|
-
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
1
|
+
import { RoxInputOtpProps } from './types';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<RoxInputOtpProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
9
3
|
"update:modelValue": (value: string) => any;
|
|
10
4
|
complete: (value: string) => any;
|
|
11
|
-
}, string, import('vue').PublicProps, Readonly<
|
|
5
|
+
}, string, import('vue').PublicProps, Readonly<RoxInputOtpProps> & Readonly<{
|
|
12
6
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
13
7
|
onComplete?: ((value: string) => any) | undefined;
|
|
14
8
|
}>, {
|
|
15
|
-
modelValue: string;
|
|
16
9
|
length: number;
|
|
10
|
+
modelValue: string;
|
|
17
11
|
itemClass: string;
|
|
18
12
|
activeItemClass: string;
|
|
19
13
|
gap: string;
|
|
14
|
+
hasFilledItemClass: string;
|
|
20
15
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
21
16
|
inputRef: HTMLInputElement;
|
|
22
17
|
}, HTMLDivElement>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { RoxPopupProps } from './types';
|
|
2
|
+
declare const model: import('vue').ModelRef<boolean, string, boolean, boolean>;
|
|
3
|
+
type __VLS_Props = RoxPopupProps;
|
|
4
|
+
type __VLS_PublicProps = {
|
|
5
|
+
modelValue?: typeof model['value'];
|
|
6
|
+
} & __VLS_Props;
|
|
7
|
+
declare function __VLS_template(): {
|
|
8
|
+
attrs: Partial<{}>;
|
|
9
|
+
slots: {
|
|
10
|
+
default?(_: {}): any;
|
|
11
|
+
};
|
|
12
|
+
refs: {};
|
|
13
|
+
rootEl: any;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
16
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
17
|
+
"update:modelValue": (value: boolean) => any;
|
|
18
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
19
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
20
|
+
}>, {
|
|
21
|
+
position: "top" | "bottom" | "left" | "right";
|
|
22
|
+
to: string | import('vue').RendererElement | null;
|
|
23
|
+
bg: string;
|
|
24
|
+
duration: number;
|
|
25
|
+
maskClosable: boolean;
|
|
26
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,77 +1,68 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a-drowned-fish/rox-v",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "lib/index.js",
|
|
6
|
-
"module": "es/index.js",
|
|
7
|
-
"types": "
|
|
8
|
-
"browser": "dist/index.iife.js",
|
|
9
|
-
"unpkg": "dist/index.iife.js",
|
|
10
|
-
"jsdelivr": "dist/index.iife.js",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "vue ui library",
|
|
5
|
+
"main": "dist/lib/index.js",
|
|
6
|
+
"module": "dist/es/index.js",
|
|
7
|
+
"types": "dist/types/components/index.d.ts",
|
|
11
8
|
"files": [
|
|
12
|
-
"dist"
|
|
13
|
-
"es",
|
|
14
|
-
"lib",
|
|
15
|
-
"resolver"
|
|
9
|
+
"dist"
|
|
16
10
|
],
|
|
17
11
|
"exports": {
|
|
18
12
|
".": {
|
|
19
|
-
"import": "./es/index.js",
|
|
20
|
-
"require": "./lib/index.js",
|
|
21
|
-
"types": "./
|
|
13
|
+
"import": "./dist/es/index.js",
|
|
14
|
+
"require": "./dist/lib/index.js",
|
|
15
|
+
"types": "./dist/types/components/index.d.ts"
|
|
22
16
|
},
|
|
23
|
-
"./
|
|
24
|
-
"import": "./es/
|
|
25
|
-
"
|
|
26
|
-
"types": "./es/components.d.ts"
|
|
17
|
+
"./es": {
|
|
18
|
+
"import": "./dist/es/index.js",
|
|
19
|
+
"types": "./dist/types/components/index.d.ts"
|
|
27
20
|
},
|
|
28
|
-
"./
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"types": "./resolver/resolver.d.ts"
|
|
21
|
+
"./lib": {
|
|
22
|
+
"require": "./dist/lib/index.js",
|
|
23
|
+
"types": "./dist/types/components/index.d.ts"
|
|
32
24
|
},
|
|
33
|
-
"./
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
25
|
+
"./es/*": {
|
|
26
|
+
"import": "./dist/es/*.js",
|
|
27
|
+
"types": [
|
|
28
|
+
"./dist/types/*.d.ts",
|
|
29
|
+
"./dist/types/components/index.d.ts"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"./lib/*": {
|
|
33
|
+
"require": "./dist/lib/*.js",
|
|
34
|
+
"types": "./dist/types/components/index.d.ts"
|
|
35
|
+
},
|
|
36
|
+
"./lib/*.js": {
|
|
37
|
+
"require": "./dist/lib/*.js",
|
|
38
|
+
"types": "./dist/types/components/index.d.ts"
|
|
39
|
+
},
|
|
40
|
+
"./*": "./*"
|
|
45
41
|
},
|
|
46
42
|
"keywords": [
|
|
47
|
-
"vue",
|
|
48
|
-
"
|
|
49
|
-
"component-library",
|
|
50
|
-
"auto-import",
|
|
51
|
-
"unplugin-vue-components"
|
|
43
|
+
"vue-ui",
|
|
44
|
+
"otp"
|
|
52
45
|
],
|
|
53
|
-
"author": "",
|
|
46
|
+
"author": "yangsuzhou",
|
|
54
47
|
"license": "MIT",
|
|
55
|
-
"peerDependencies": {
|
|
56
|
-
"vue": "^3.0.0"
|
|
57
|
-
},
|
|
58
48
|
"peerDependenciesMeta": {
|
|
59
49
|
"unplugin-vue-components": {
|
|
60
50
|
"optional": true
|
|
61
51
|
}
|
|
62
52
|
},
|
|
63
|
-
"
|
|
64
|
-
"vue": "^3.
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"vue": "^3.5.0"
|
|
55
|
+
},
|
|
56
|
+
"sideEffects": [
|
|
57
|
+
"dist/*",
|
|
58
|
+
"*.css",
|
|
59
|
+
"*.css.ts"
|
|
60
|
+
],
|
|
61
|
+
"publishConfig": {
|
|
62
|
+
"access": "public"
|
|
65
63
|
},
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"rimraf": "^6.1.3",
|
|
70
|
-
"tsx": "^4.21.0",
|
|
71
|
-
"typescript": "^6.0.3",
|
|
72
|
-
"unplugin-vue-components": "^28.8.0",
|
|
73
|
-
"vite": "^5.4.21",
|
|
74
|
-
"vite-plugin-dts": "^4.5.4",
|
|
75
|
-
"vue-tsc": "^3.2.6"
|
|
64
|
+
"scripts": {
|
|
65
|
+
"build:es": "vite build --config vite.build.config.ts",
|
|
66
|
+
"build:lib": "vite build --config vite.umd.config.ts"
|
|
76
67
|
}
|
|
77
|
-
}
|
|
68
|
+
}
|
package/dist/index.iife.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var RoxV=function(c,e){"use strict";const f=["maxlength"],p=((o,r)=>{const l=o.__vccOpts||o;for(const[s,i]of r)l[s]=i;return l})(e.defineComponent({__name:"input-otp",props:{modelValue:{default:""},length:{default:6},itemClass:{default:""},activeItemClass:{default:""},gap:{default:"10px"}},emits:["update:modelValue","complete"],setup(o,{emit:r}){const l=o,s=r,i=e.ref(null),a=e.ref(l.modelValue);e.watch(()=>l.modelValue,n=>{n!==a.value&&(a.value=n)});function _(n){let t=n.target.value;t=t.replace(/\D/g,""),t=t.slice(0,l.length),a.value=t,s("update:modelValue",t),t.length===l.length&&s("complete",t)}function h(){var n;(n=i.value)==null||n.focus()}function m(n){return n===a.value.length}return(n,t)=>(e.openBlock(),e.createElementBlock("div",{class:"otp-wrapper",onClick:h},[e.withDirectives(e.createElementVNode("input",{inputmode:"numeric",autocomplete:"one-time-code",ref_key:"inputRef",ref:i,"onUpdate:modelValue":t[0]||(t[0]=d=>a.value=d),maxlength:o.length,onInput:_,class:"otp-input"},null,40,f),[[e.vModelText,a.value]]),e.createElementVNode("div",{class:"otp-box",style:e.normalizeStyle({gap:l.gap})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.length,(d,u)=>(e.openBlock(),e.createElementBlock("div",{key:u,class:e.normalizeClass(["otp-item",[{active:m(u),[l.activeItemClass]:m(u)},l.itemClass]])},e.toDisplayString(a.value[u]||""),3))),128))],4)]))}}),[["__scopeId","data-v-14ecb7bd"]]),g={version:"1.0.0",install:o=>{o.component("RInputOtp",p)}};return c.InputOtp=p,c.default=g,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),c}({},Vue);
|
package/dist/index.umd.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o.RoxV={},o.Vue))})(this,function(o,e){"use strict";const f=["maxlength"],r=((a,p)=>{const n=a.__vccOpts||a;for(const[s,c]of p)n[s]=c;return n})(e.defineComponent({__name:"input-otp",props:{modelValue:{default:""},length:{default:6},itemClass:{default:""},activeItemClass:{default:""},gap:{default:"10px"}},emits:["update:modelValue","complete"],setup(a,{emit:p}){const n=a,s=p,c=e.ref(null),i=e.ref(n.modelValue);e.watch(()=>n.modelValue,l=>{l!==i.value&&(i.value=l)});function _(l){let t=l.target.value;t=t.replace(/\D/g,""),t=t.slice(0,n.length),i.value=t,s("update:modelValue",t),t.length===n.length&&s("complete",t)}function h(){var l;(l=c.value)==null||l.focus()}function d(l){return l===i.value.length}return(l,t)=>(e.openBlock(),e.createElementBlock("div",{class:"otp-wrapper",onClick:h},[e.withDirectives(e.createElementVNode("input",{inputmode:"numeric",autocomplete:"one-time-code",ref_key:"inputRef",ref:c,"onUpdate:modelValue":t[0]||(t[0]=m=>i.value=m),maxlength:a.length,onInput:_,class:"otp-input"},null,40,f),[[e.vModelText,i.value]]),e.createElementVNode("div",{class:"otp-box",style:e.normalizeStyle({gap:n.gap})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.length,(m,u)=>(e.openBlock(),e.createElementBlock("div",{key:u,class:e.normalizeClass(["otp-item",[{active:d(u),[n.activeItemClass]:d(u)},n.itemClass]])},e.toDisplayString(i.value[u]||""),3))),128))],4)]))}}),[["__scopeId","data-v-14ecb7bd"]]),g={version:"1.0.0",install:a=>{a.component("RInputOtp",r)}};o.InputOtp=r,o.default=g,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/es/components.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { InputOtp } from './components/input-otp';
|
package/es/components.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { defineComponent as h, ref as d, watch as _, openBlock as i, createElementBlock as p, withDirectives as V, createElementVNode as f, vModelText as C, normalizeStyle as I, Fragment as k, renderList as y, normalizeClass as x, toDisplayString as b } from "vue";
|
|
2
|
-
const w = ["maxlength"], D = /* @__PURE__ */ h({
|
|
3
|
-
__name: "input-otp",
|
|
4
|
-
props: {
|
|
5
|
-
modelValue: { default: "" },
|
|
6
|
-
length: { default: 6 },
|
|
7
|
-
itemClass: { default: "" },
|
|
8
|
-
activeItemClass: { default: "" },
|
|
9
|
-
gap: { default: "10px" }
|
|
10
|
-
},
|
|
11
|
-
emits: ["update:modelValue", "complete"],
|
|
12
|
-
setup(a, { emit: c }) {
|
|
13
|
-
const t = a, o = c, u = d(null), n = d(t.modelValue);
|
|
14
|
-
_(
|
|
15
|
-
() => t.modelValue,
|
|
16
|
-
(l) => {
|
|
17
|
-
l !== n.value && (n.value = l);
|
|
18
|
-
}
|
|
19
|
-
);
|
|
20
|
-
function v(l) {
|
|
21
|
-
let e = l.target.value;
|
|
22
|
-
e = e.replace(/\D/g, ""), e = e.slice(0, t.length), n.value = e, o("update:modelValue", e), e.length === t.length && o("complete", e);
|
|
23
|
-
}
|
|
24
|
-
function g() {
|
|
25
|
-
var l;
|
|
26
|
-
(l = u.value) == null || l.focus();
|
|
27
|
-
}
|
|
28
|
-
function r(l) {
|
|
29
|
-
return l === n.value.length;
|
|
30
|
-
}
|
|
31
|
-
return (l, e) => (i(), p("div", {
|
|
32
|
-
class: "otp-wrapper",
|
|
33
|
-
onClick: g
|
|
34
|
-
}, [
|
|
35
|
-
V(f("input", {
|
|
36
|
-
inputmode: "numeric",
|
|
37
|
-
autocomplete: "one-time-code",
|
|
38
|
-
ref_key: "inputRef",
|
|
39
|
-
ref: u,
|
|
40
|
-
"onUpdate:modelValue": e[0] || (e[0] = (m) => n.value = m),
|
|
41
|
-
maxlength: a.length,
|
|
42
|
-
onInput: v,
|
|
43
|
-
class: "otp-input"
|
|
44
|
-
}, null, 40, w), [
|
|
45
|
-
[C, n.value]
|
|
46
|
-
]),
|
|
47
|
-
f("div", {
|
|
48
|
-
class: "otp-box",
|
|
49
|
-
style: I({ gap: t.gap })
|
|
50
|
-
}, [
|
|
51
|
-
(i(!0), p(k, null, y(a.length, (m, s) => (i(), p("div", {
|
|
52
|
-
key: s,
|
|
53
|
-
class: x(["otp-item", [
|
|
54
|
-
{ active: r(s), [t.activeItemClass]: r(s) },
|
|
55
|
-
t.itemClass
|
|
56
|
-
]])
|
|
57
|
-
}, b(n.value[s] || ""), 3))), 128))
|
|
58
|
-
], 4)
|
|
59
|
-
]));
|
|
60
|
-
}
|
|
61
|
-
}), z = (a, c) => {
|
|
62
|
-
const t = a.__vccOpts || a;
|
|
63
|
-
for (const [o, u] of c)
|
|
64
|
-
t[o] = u;
|
|
65
|
-
return t;
|
|
66
|
-
}, E = /* @__PURE__ */ z(D, [["__scopeId", "data-v-14ecb7bd"]]);
|
|
67
|
-
export {
|
|
68
|
-
E as InputOtp
|
|
69
|
-
};
|
package/es/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { App } from 'vue';
|
|
2
|
-
import { default as InputOtp } from './components/input-otp/input-otp.vue';
|
|
3
|
-
export * from './components';
|
|
4
|
-
export { InputOtp };
|
|
5
|
-
declare const _default: {
|
|
6
|
-
version: string;
|
|
7
|
-
install: (app: App) => void;
|
|
8
|
-
};
|
|
9
|
-
export default _default;
|
package/es/index.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { defineComponent as h, ref as d, watch as _, openBlock as i, createElementBlock as p, withDirectives as I, createElementVNode as f, vModelText as V, normalizeStyle as C, Fragment as k, renderList as x, normalizeClass as y, toDisplayString as b } from "vue";
|
|
2
|
-
const w = ["maxlength"], D = /* @__PURE__ */ h({
|
|
3
|
-
__name: "input-otp",
|
|
4
|
-
props: {
|
|
5
|
-
modelValue: { default: "" },
|
|
6
|
-
length: { default: 6 },
|
|
7
|
-
itemClass: { default: "" },
|
|
8
|
-
activeItemClass: { default: "" },
|
|
9
|
-
gap: { default: "10px" }
|
|
10
|
-
},
|
|
11
|
-
emits: ["update:modelValue", "complete"],
|
|
12
|
-
setup(n, { emit: c }) {
|
|
13
|
-
const t = n, o = c, u = d(null), a = d(t.modelValue);
|
|
14
|
-
_(
|
|
15
|
-
() => t.modelValue,
|
|
16
|
-
(l) => {
|
|
17
|
-
l !== a.value && (a.value = l);
|
|
18
|
-
}
|
|
19
|
-
);
|
|
20
|
-
function v(l) {
|
|
21
|
-
let e = l.target.value;
|
|
22
|
-
e = e.replace(/\D/g, ""), e = e.slice(0, t.length), a.value = e, o("update:modelValue", e), e.length === t.length && o("complete", e);
|
|
23
|
-
}
|
|
24
|
-
function g() {
|
|
25
|
-
var l;
|
|
26
|
-
(l = u.value) == null || l.focus();
|
|
27
|
-
}
|
|
28
|
-
function r(l) {
|
|
29
|
-
return l === a.value.length;
|
|
30
|
-
}
|
|
31
|
-
return (l, e) => (i(), p("div", {
|
|
32
|
-
class: "otp-wrapper",
|
|
33
|
-
onClick: g
|
|
34
|
-
}, [
|
|
35
|
-
I(f("input", {
|
|
36
|
-
inputmode: "numeric",
|
|
37
|
-
autocomplete: "one-time-code",
|
|
38
|
-
ref_key: "inputRef",
|
|
39
|
-
ref: u,
|
|
40
|
-
"onUpdate:modelValue": e[0] || (e[0] = (m) => a.value = m),
|
|
41
|
-
maxlength: n.length,
|
|
42
|
-
onInput: v,
|
|
43
|
-
class: "otp-input"
|
|
44
|
-
}, null, 40, w), [
|
|
45
|
-
[V, a.value]
|
|
46
|
-
]),
|
|
47
|
-
f("div", {
|
|
48
|
-
class: "otp-box",
|
|
49
|
-
style: C({ gap: t.gap })
|
|
50
|
-
}, [
|
|
51
|
-
(i(!0), p(k, null, x(n.length, (m, s) => (i(), p("div", {
|
|
52
|
-
key: s,
|
|
53
|
-
class: y(["otp-item", [
|
|
54
|
-
{ active: r(s), [t.activeItemClass]: r(s) },
|
|
55
|
-
t.itemClass
|
|
56
|
-
]])
|
|
57
|
-
}, b(a.value[s] || ""), 3))), 128))
|
|
58
|
-
], 4)
|
|
59
|
-
]));
|
|
60
|
-
}
|
|
61
|
-
}), O = (n, c) => {
|
|
62
|
-
const t = n.__vccOpts || n;
|
|
63
|
-
for (const [o, u] of c)
|
|
64
|
-
t[o] = u;
|
|
65
|
-
return t;
|
|
66
|
-
}, R = /* @__PURE__ */ O(D, [["__scopeId", "data-v-14ecb7bd"]]), z = "1.0.0", B = (n) => {
|
|
67
|
-
n.component("RInputOtp", R);
|
|
68
|
-
}, S = {
|
|
69
|
-
version: z,
|
|
70
|
-
install: B
|
|
71
|
-
};
|
|
72
|
-
export {
|
|
73
|
-
R as InputOtp,
|
|
74
|
-
S as default
|
|
75
|
-
};
|
package/es/input-otp/index.css
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
.otp-wrapper[data-v-14ecb7bd] {
|
|
3
|
-
position: relative;
|
|
4
|
-
width: max-content;
|
|
5
|
-
cursor: pointer;
|
|
6
|
-
}
|
|
7
|
-
.otp-input[data-v-14ecb7bd] {
|
|
8
|
-
position: absolute;
|
|
9
|
-
opacity: 0;
|
|
10
|
-
pointer-events: none;
|
|
11
|
-
}
|
|
12
|
-
.otp-box[data-v-14ecb7bd] {
|
|
13
|
-
display: flex;
|
|
14
|
-
}
|
|
15
|
-
.otp-item[data-v-14ecb7bd] {
|
|
16
|
-
width: 40px;
|
|
17
|
-
height: 50px;
|
|
18
|
-
border: 1px solid #ccc;
|
|
19
|
-
border-radius: 8px;
|
|
20
|
-
text-align: center;
|
|
21
|
-
line-height: 50px;
|
|
22
|
-
font-size: 20px;
|
|
23
|
-
transition: all 0.2s;
|
|
24
|
-
}
|
|
25
|
-
.otp-item.active[data-v-14ecb7bd] {
|
|
26
|
-
border-color: #409eff;
|
|
27
|
-
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
|
|
28
|
-
}
|
package/es/input-otp/index.d.ts
DELETED
package/es/input-otp/index.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, watch, openBlock, createElementBlock, withDirectives, createElementVNode, vModelText, normalizeStyle, Fragment, renderList, normalizeClass, toDisplayString } from "vue";
|
|
2
|
-
const _hoisted_1 = ["maxlength"];
|
|
3
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
|
-
__name: "input-otp",
|
|
5
|
-
props: {
|
|
6
|
-
modelValue: { default: "" },
|
|
7
|
-
length: { default: 6 },
|
|
8
|
-
itemClass: { default: "" },
|
|
9
|
-
activeItemClass: { default: "" },
|
|
10
|
-
gap: { default: "10px" }
|
|
11
|
-
},
|
|
12
|
-
emits: ["update:modelValue", "complete"],
|
|
13
|
-
setup(__props, { emit: __emit }) {
|
|
14
|
-
const props = __props;
|
|
15
|
-
const emit = __emit;
|
|
16
|
-
const inputRef = ref(null);
|
|
17
|
-
const innerValue = ref(props.modelValue);
|
|
18
|
-
watch(
|
|
19
|
-
() => props.modelValue,
|
|
20
|
-
(val) => {
|
|
21
|
-
if (val !== innerValue.value) {
|
|
22
|
-
innerValue.value = val;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
function handleInput(e) {
|
|
27
|
-
let value = e.target.value;
|
|
28
|
-
value = value.replace(/\D/g, "");
|
|
29
|
-
value = value.slice(0, props.length);
|
|
30
|
-
innerValue.value = value;
|
|
31
|
-
emit("update:modelValue", value);
|
|
32
|
-
if (value.length === props.length) {
|
|
33
|
-
emit("complete", value);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
function focusInput() {
|
|
37
|
-
var _a;
|
|
38
|
-
(_a = inputRef.value) == null ? void 0 : _a.focus();
|
|
39
|
-
}
|
|
40
|
-
function isActive(index) {
|
|
41
|
-
return index === innerValue.value.length;
|
|
42
|
-
}
|
|
43
|
-
return (_ctx, _cache) => {
|
|
44
|
-
return openBlock(), createElementBlock("div", {
|
|
45
|
-
class: "otp-wrapper",
|
|
46
|
-
onClick: focusInput
|
|
47
|
-
}, [
|
|
48
|
-
withDirectives(createElementVNode("input", {
|
|
49
|
-
inputmode: "numeric",
|
|
50
|
-
autocomplete: "one-time-code",
|
|
51
|
-
ref_key: "inputRef",
|
|
52
|
-
ref: inputRef,
|
|
53
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => innerValue.value = $event),
|
|
54
|
-
maxlength: __props.length,
|
|
55
|
-
onInput: handleInput,
|
|
56
|
-
class: "otp-input"
|
|
57
|
-
}, null, 40, _hoisted_1), [
|
|
58
|
-
[vModelText, innerValue.value]
|
|
59
|
-
]),
|
|
60
|
-
createElementVNode("div", {
|
|
61
|
-
class: "otp-box",
|
|
62
|
-
style: normalizeStyle({ gap: props.gap })
|
|
63
|
-
}, [
|
|
64
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.length, (_, index) => {
|
|
65
|
-
return openBlock(), createElementBlock("div", {
|
|
66
|
-
key: index,
|
|
67
|
-
class: normalizeClass(["otp-item", [
|
|
68
|
-
{ active: isActive(index), [props.activeItemClass]: isActive(index) },
|
|
69
|
-
props.itemClass
|
|
70
|
-
]])
|
|
71
|
-
}, toDisplayString(innerValue.value[index] || ""), 3);
|
|
72
|
-
}), 128))
|
|
73
|
-
], 4)
|
|
74
|
-
]);
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
const _export_sfc = (sfc, props) => {
|
|
79
|
-
const target = sfc.__vccOpts || sfc;
|
|
80
|
-
for (const [key, val] of props) {
|
|
81
|
-
target[key] = val;
|
|
82
|
-
}
|
|
83
|
-
return target;
|
|
84
|
-
};
|
|
85
|
-
const InputOtp = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-14ecb7bd"]]);
|
|
86
|
-
export {
|
|
87
|
-
InputOtp,
|
|
88
|
-
InputOtp as default
|
|
89
|
-
};
|
package/lib/components.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { InputOtp } from './components/input-otp';
|
package/lib/components.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),f=["maxlength"],v=e.defineComponent({__name:"input-otp",props:{modelValue:{default:""},length:{default:6},itemClass:{default:""},activeItemClass:{default:""},gap:{default:"10px"}},emits:["update:modelValue","complete"],setup(a,{emit:i}){const l=a,u=i,c=e.ref(null),o=e.ref(l.modelValue);e.watch(()=>l.modelValue,n=>{n!==o.value&&(o.value=n)});function m(n){let t=n.target.value;t=t.replace(/\D/g,""),t=t.slice(0,l.length),o.value=t,u("update:modelValue",t),t.length===l.length&&u("complete",t)}function d(){var n;(n=c.value)==null||n.focus()}function r(n){return n===o.value.length}return(n,t)=>(e.openBlock(),e.createElementBlock("div",{class:"otp-wrapper",onClick:d},[e.withDirectives(e.createElementVNode("input",{inputmode:"numeric",autocomplete:"one-time-code",ref_key:"inputRef",ref:c,"onUpdate:modelValue":t[0]||(t[0]=p=>o.value=p),maxlength:a.length,onInput:m,class:"otp-input"},null,40,f),[[e.vModelText,o.value]]),e.createElementVNode("div",{class:"otp-box",style:e.normalizeStyle({gap:l.gap})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.length,(p,s)=>(e.openBlock(),e.createElementBlock("div",{key:s,class:e.normalizeClass(["otp-item",[{active:r(s),[l.activeItemClass]:r(s)},l.itemClass]])},e.toDisplayString(o.value[s]||""),3))),128))],4)]))}}),g=(a,i)=>{const l=a.__vccOpts||a;for(const[u,c]of i)l[u]=c;return l},h=g(v,[["__scopeId","data-v-14ecb7bd"]]);exports.InputOtp=h;
|
package/lib/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { App } from 'vue';
|
|
2
|
-
import { default as InputOtp } from './components/input-otp/input-otp.vue';
|
|
3
|
-
export * from './components';
|
|
4
|
-
export { InputOtp };
|
|
5
|
-
declare const _default: {
|
|
6
|
-
version: string;
|
|
7
|
-
install: (app: App) => void;
|
|
8
|
-
};
|
|
9
|
-
export default _default;
|
package/lib/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=["maxlength"],g=e.defineComponent({__name:"input-otp",props:{modelValue:{default:""},length:{default:6},itemClass:{default:""},activeItemClass:{default:""},gap:{default:"10px"}},emits:["update:modelValue","complete"],setup(o,{emit:i}){const l=o,u=i,c=e.ref(null),a=e.ref(l.modelValue);e.watch(()=>l.modelValue,n=>{n!==a.value&&(a.value=n)});function d(n){let t=n.target.value;t=t.replace(/\D/g,""),t=t.slice(0,l.length),a.value=t,u("update:modelValue",t),t.length===l.length&&u("complete",t)}function v(){var n;(n=c.value)==null||n.focus()}function p(n){return n===a.value.length}return(n,t)=>(e.openBlock(),e.createElementBlock("div",{class:"otp-wrapper",onClick:v},[e.withDirectives(e.createElementVNode("input",{inputmode:"numeric",autocomplete:"one-time-code",ref_key:"inputRef",ref:c,"onUpdate:modelValue":t[0]||(t[0]=r=>a.value=r),maxlength:o.length,onInput:d,class:"otp-input"},null,40,f),[[e.vModelText,a.value]]),e.createElementVNode("div",{class:"otp-box",style:e.normalizeStyle({gap:l.gap})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.length,(r,s)=>(e.openBlock(),e.createElementBlock("div",{key:s,class:e.normalizeClass(["otp-item",[{active:p(s),[l.activeItemClass]:p(s)},l.itemClass]])},e.toDisplayString(a.value[s]||""),3))),128))],4)]))}}),h=(o,i)=>{const l=o.__vccOpts||o;for(const[u,c]of i)l[u]=c;return l},m=h(g,[["__scopeId","data-v-14ecb7bd"]]),_="1.0.0",k=o=>{o.component("RInputOtp",m)},I={version:_,install:k};exports.InputOtp=m;exports.default=I;
|
package/lib/input-otp/index.css
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
.otp-wrapper[data-v-14ecb7bd] {
|
|
3
|
-
position: relative;
|
|
4
|
-
width: max-content;
|
|
5
|
-
cursor: pointer;
|
|
6
|
-
}
|
|
7
|
-
.otp-input[data-v-14ecb7bd] {
|
|
8
|
-
position: absolute;
|
|
9
|
-
opacity: 0;
|
|
10
|
-
pointer-events: none;
|
|
11
|
-
}
|
|
12
|
-
.otp-box[data-v-14ecb7bd] {
|
|
13
|
-
display: flex;
|
|
14
|
-
}
|
|
15
|
-
.otp-item[data-v-14ecb7bd] {
|
|
16
|
-
width: 40px;
|
|
17
|
-
height: 50px;
|
|
18
|
-
border: 1px solid #ccc;
|
|
19
|
-
border-radius: 8px;
|
|
20
|
-
text-align: center;
|
|
21
|
-
line-height: 50px;
|
|
22
|
-
font-size: 20px;
|
|
23
|
-
transition: all 0.2s;
|
|
24
|
-
}
|
|
25
|
-
.otp-item.active[data-v-14ecb7bd] {
|
|
26
|
-
border-color: #409eff;
|
|
27
|
-
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
|
|
28
|
-
}
|
package/lib/input-otp/index.d.ts
DELETED