oga-ui 0.0.1 → 0.0.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/README.md +36 -0
- package/index.css +1 -1
- package/index.es.ts +152 -0
- package/index.umd.ts +1 -0
- package/input/index.css +1 -1
- package/input/index.es.ts +121 -0
- package/input/index.umd.ts +1 -0
- package/package.json +4 -4
- package/index.mjs +0 -117
- package/index.umd.js +0 -1
- package/input/index.mjs +0 -86
- package/input/index.umd.js +0 -1
- /package/progress/{index.mjs → index.es.ts} +0 -0
- /package/progress/{index.umd.js → index.umd.ts} +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Guide
|
|
2
|
+
|
|
3
|
+
----
|
|
4
|
+
|
|
5
|
+
`OGA UI` is a frontend UI component library built on `Vue 3` and `Element Plus`.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm i oga-ui
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## How to use
|
|
15
|
+
|
|
16
|
+
in `main.ts`
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
import "oga-ui/index.css"
|
|
20
|
+
import ogaUI from 'oga-ui'
|
|
21
|
+
|
|
22
|
+
app.use(ogaUI)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## What's new
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
Input
|
|
30
|
+
DatePicker
|
|
31
|
+
TimePicker
|
|
32
|
+
InputNumber
|
|
33
|
+
Cascader
|
|
34
|
+
Select
|
|
35
|
+
```
|
|
36
|
+
|
package/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.demo-progress .el-progress--line[data-v-b7194e36]{width:350px;margin-bottom:15px}.el-input-material[data-v-
|
|
1
|
+
.demo-progress .el-progress--line[data-v-b7194e36]{width:350px;margin-bottom:15px}.el-input-material[data-v-6db49b3e]{clear:both;padding:.375rem 0;position:relative}.el-input-material .el-input.is-disabled .el-input__inner[data-v-6db49b3e]{background:0 0}.el-input-material .el-input-group__prepend[data-v-6db49b3e],.el-input-material .el-input-group__append[data-v-6db49b3e]{padding:0 15px!important}.el-input-material .el-select[data-v-6db49b3e],.el-input-material .el-cascader[data-v-6db49b3e]{width:100%}.el-input-material.borderless .el-input-number .el-input__inner[data-v-6db49b3e]{text-align:center}.el-input-material.borderless .el-input__inner[data-v-6db49b3e]{border-top:0;border-left:0;border-right:0;border-radius:0;padding-left:0;padding-right:0}.el-input-material.borderless [class*=el-][data-v-6db49b3e]{background-color:#0000;border-top:0;border-left:0;border-right:0;border-radius:0}.el-input-material.borderless .el-date-editor--date.el-input--prefix .el-input__inner[data-v-6db49b3e]{padding-left:1.875rem}.el-input-material-label[data-v-6db49b3e]{text-shadow:0 0 5px #fff,0 0 5px #fff,0 0 5px #fff,0 0 5px #fff,0 0 5px #fff,0 0 5px #fff,0 0 5px #fff,0 0 5px #fff,0 0 5px #fff,0 0 5px #fff,0 0 5px #fff;color:#c0c4cc;z-index:2;border-radius:5px;padding-left:2px;padding-right:2px;font-size:.75rem;line-height:.75rem;transition:all .2s;position:absolute;top:0;left:1rem;opacity:1!important}.el-input-material-label[data-v-6db49b3e]:not(.active){opacity:0}.el-input-material+.el-form-item__error[data-v-6db49b3e]{padding-top:0}.el-form-item:focus .el-input-material-label.active[data-v-6db49b3e]{color:#f56c6c}
|
|
2
2
|
/*$vite$:1*/
|
package/index.es.ts
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { createCommentVNode, createElementBlock, createSlots, createVNode, defineComponent, isRef, mergeProps, normalizeClass, onMounted, openBlock, ref, renderSlot, resolveComponent, toDisplayString, unref, useAttrs, useSlots, watch, withCtx } from "vue";
|
|
2
|
+
var _hoisted_1 = { class: "demo-progress" }, index_vue_vue_type_script_setup_true_lang_default$1 = /* @__PURE__ */ defineComponent({
|
|
3
|
+
__name: "index",
|
|
4
|
+
props: {
|
|
5
|
+
percentage: {
|
|
6
|
+
type: Number,
|
|
7
|
+
default: 0
|
|
8
|
+
},
|
|
9
|
+
animationTime: {
|
|
10
|
+
type: Number,
|
|
11
|
+
default: 3e3
|
|
12
|
+
},
|
|
13
|
+
isAnimation: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: !1
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
setup(e) {
|
|
19
|
+
let g = e, v = ref(0), y = (e) => e < 30 ? "#909399" : e < 70 ? "#e6a23c" : "#67c23a";
|
|
20
|
+
return onMounted(() => {
|
|
21
|
+
let e = Math.ceil(g.animationTime / g.percentage), h = setInterval(() => {
|
|
22
|
+
v.value += 1, (v.value >= g.percentage || v.value >= 100) && (v.value = g.percentage >= 100 ? 100 : g.percentage, clearInterval(h));
|
|
23
|
+
}, e);
|
|
24
|
+
}), (e, g) => {
|
|
25
|
+
let b = resolveComponent("el-progress");
|
|
26
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [createVNode(b, mergeProps({ percentage: v.value }, e.$attrs, { color: y }), null, 16, ["percentage"])]);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}), __plugin_vue_export_helper_default = (e, h) => {
|
|
30
|
+
let g = e.__vccOpts || e;
|
|
31
|
+
for (let [e, _] of h) g[e] = _;
|
|
32
|
+
return g;
|
|
33
|
+
}, src_default$1 = /* @__PURE__ */ __plugin_vue_export_helper_default(index_vue_vue_type_script_setup_true_lang_default$1, [["__scopeId", "data-v-b7194e36"]]), progress_default = { install(e) {
|
|
34
|
+
e.component("OgaProgress", src_default$1);
|
|
35
|
+
} }, utility_default = {
|
|
36
|
+
expression: {
|
|
37
|
+
Required: /[\S]/,
|
|
38
|
+
Email: /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/,
|
|
39
|
+
Int: /(-)?(\d+)$/,
|
|
40
|
+
IntPositive: /^\+?[0-9]\d*$/,
|
|
41
|
+
IntZeroPositive: /^\+?[1-9]\d*$/,
|
|
42
|
+
Float: /(-)?(\d+)(((\.)(\d)+))?/,
|
|
43
|
+
FloatPositive: /^([0-9]\d*(.\d+)*|0\.(?=\d*[1-9]\d*)\d+)$/,
|
|
44
|
+
FloatZeroPositive: /^([1-9]\d*(.\d+)*|0\.(?=\d*[1-9]\d*)\d+)$/,
|
|
45
|
+
Chinese: /[\u4e00-\u9fa5]/,
|
|
46
|
+
English: /[a-zA-Z]/,
|
|
47
|
+
Mobile: /^[1]([3-9])[0-9]{9}$/,
|
|
48
|
+
Password: /^[A-Za-z][A-Za-z0-9~!@#$%^&*]{5,19}$/,
|
|
49
|
+
IdentityCard: /[\d]{6}(19|20)*[\d]{2}((0[1-9])|(11|12))([012][\d]|(30|31))[\d]{3}[xX\d]*/,
|
|
50
|
+
EngAndNum: /[a-zA-Z0-9]*/,
|
|
51
|
+
EngNumUnderline: /[a-zA-Z0-9_]*/,
|
|
52
|
+
PhoneNumber: /(86)?(-)?(0\d{2,3})?(-)?(\d{7,8})(-)?(\d{1,5})?/,
|
|
53
|
+
PostalCode: /\d{6}/,
|
|
54
|
+
Account: /^[A-Za-z0-9@.]{8,19}$/,
|
|
55
|
+
URL: /^[0-9a-zA-Z_]{1,}$/,
|
|
56
|
+
Domain: /^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$/
|
|
57
|
+
},
|
|
58
|
+
getLanguage() {
|
|
59
|
+
let e = localStorage.getItem("foUILanguage");
|
|
60
|
+
return e ||= navigator.language, e != null && (e = "en|zh-CN".indexOf(e) > -1 ? e : "en"), localStorage.setItem("foUILanguage", e), e;
|
|
61
|
+
},
|
|
62
|
+
isEmpty(e) {
|
|
63
|
+
return !(e != null && /[\S]/.test(e));
|
|
64
|
+
},
|
|
65
|
+
isNotEmpty(e) {
|
|
66
|
+
return !this.isEmpty(e);
|
|
67
|
+
}
|
|
68
|
+
}, src_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
69
|
+
__name: "index",
|
|
70
|
+
props: {
|
|
71
|
+
modelValue: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: ""
|
|
74
|
+
},
|
|
75
|
+
placeholder: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: ""
|
|
78
|
+
},
|
|
79
|
+
size: {
|
|
80
|
+
type: String,
|
|
81
|
+
default: ""
|
|
82
|
+
},
|
|
83
|
+
description: {
|
|
84
|
+
type: String,
|
|
85
|
+
default: ""
|
|
86
|
+
},
|
|
87
|
+
borderless: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: !1
|
|
90
|
+
},
|
|
91
|
+
shrink: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
default: !0
|
|
94
|
+
},
|
|
95
|
+
errorTips: {
|
|
96
|
+
type: Boolean,
|
|
97
|
+
default: !0
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
setup(v) {
|
|
101
|
+
let w = "", T = ref(!1), E = v, D = useAttrs();
|
|
102
|
+
return D = {
|
|
103
|
+
...D,
|
|
104
|
+
...E
|
|
105
|
+
}, w = E.modelValue, T.value = utility_default.isEmpty(w), onMounted(() => {
|
|
106
|
+
T.value = utility_default.isEmpty(E.modelValue);
|
|
107
|
+
}), watch(() => E.modelValue, (e, h) => {
|
|
108
|
+
T.value = utility_default.isEmpty(e);
|
|
109
|
+
}), (x, S) => {
|
|
110
|
+
let C = resolveComponent("el-input");
|
|
111
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(["el-input-material", `${v.borderless ? "borderless" : ""}${v.errorTips ? "" : " no-tips"}`]) }, [v.borderless ? createCommentVNode("v-if", !0) : (openBlock(), createElementBlock("label", {
|
|
112
|
+
key: 0,
|
|
113
|
+
class: normalizeClass(["el-input-material-label", v.shrink || T.value ? "active" : ""])
|
|
114
|
+
}, toDisplayString(v.placeholder), 3)), createVNode(C, mergeProps(unref(D), {
|
|
115
|
+
modelValue: unref(w),
|
|
116
|
+
"onUpdate:modelValue": S[0] ||= (e) => isRef(w) ? w.value = e : w = e,
|
|
117
|
+
placeholder: v.shrink ? v.description || "" : v.placeholder
|
|
118
|
+
}), createSlots({ _: 2 }, [
|
|
119
|
+
useSlots().append ? {
|
|
120
|
+
name: "append",
|
|
121
|
+
fn: withCtx(() => [renderSlot(x.$slots, "append", {}, void 0, !0)]),
|
|
122
|
+
key: "0"
|
|
123
|
+
} : void 0,
|
|
124
|
+
useSlots().prepend ? {
|
|
125
|
+
name: "prepend",
|
|
126
|
+
fn: withCtx(() => [renderSlot(x.$slots, "prepend", {}, void 0, !0)]),
|
|
127
|
+
key: "1"
|
|
128
|
+
} : void 0,
|
|
129
|
+
useSlots().default ? {
|
|
130
|
+
name: "prepend",
|
|
131
|
+
fn: withCtx(() => [renderSlot(x.$slots, "default", {}, void 0, !0)]),
|
|
132
|
+
key: "2"
|
|
133
|
+
} : void 0,
|
|
134
|
+
useSlots().suffix ? {
|
|
135
|
+
name: "suffix",
|
|
136
|
+
fn: withCtx(() => [renderSlot(x.$slots, "suffix", {}, void 0, !0)]),
|
|
137
|
+
key: "3"
|
|
138
|
+
} : void 0,
|
|
139
|
+
useSlots().suffix ? {
|
|
140
|
+
name: "suffix",
|
|
141
|
+
fn: withCtx(() => [renderSlot(x.$slots, "suffix", {}, void 0, !0)]),
|
|
142
|
+
key: "4"
|
|
143
|
+
} : void 0
|
|
144
|
+
]), 1040, ["modelValue", "placeholder"])], 2);
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
}), [["__scopeId", "data-v-6db49b3e"]]), components = [progress_default, { install(e) {
|
|
148
|
+
e.component("OgaInput", src_default);
|
|
149
|
+
} }], packages_default = { install(e) {
|
|
150
|
+
components.map((h) => e.use(h));
|
|
151
|
+
} };
|
|
152
|
+
export { packages_default as default };
|
package/index.umd.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t(require(`vue`)):typeof define==`function`&&define.amd?define([`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,e.index=t(e.Vue))})(this,function(e){var t={class:`demo-progress`},n=(0,e.defineComponent)({__name:`index`,props:{percentage:{type:Number,default:0},animationTime:{type:Number,default:3e3},isAnimation:{type:Boolean,default:!1}},setup(n){let r=n,i=(0,e.ref)(0),a=e=>e<30?`#909399`:e<70?`#e6a23c`:`#67c23a`;return(0,e.onMounted)(()=>{let e=Math.ceil(r.animationTime/r.percentage),t=setInterval(()=>{i.value+=1,(i.value>=r.percentage||i.value>=100)&&(i.value=r.percentage>=100?100:r.percentage,clearInterval(t))},e)}),(n,r)=>{let o=(0,e.resolveComponent)(`el-progress`);return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,t,[(0,e.createVNode)(o,(0,e.mergeProps)({percentage:i.value},n.$attrs,{color:a}),null,16,[`percentage`])])}}}),r=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},i=r(n,[[`__scopeId`,`data-v-b7194e36`]]),a={install(e){e.component(`OgaProgress`,i)}},o={expression:{Required:/[\S]/,Email:/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/,Int:/(-)?(\d+)$/,IntPositive:/^\+?[0-9]\d*$/,IntZeroPositive:/^\+?[1-9]\d*$/,Float:/(-)?(\d+)(((\.)(\d)+))?/,FloatPositive:/^([0-9]\d*(.\d+)*|0\.(?=\d*[1-9]\d*)\d+)$/,FloatZeroPositive:/^([1-9]\d*(.\d+)*|0\.(?=\d*[1-9]\d*)\d+)$/,Chinese:/[\u4e00-\u9fa5]/,English:/[a-zA-Z]/,Mobile:/^[1]([3-9])[0-9]{9}$/,Password:/^[A-Za-z][A-Za-z0-9~!@#$%^&*]{5,19}$/,IdentityCard:/[\d]{6}(19|20)*[\d]{2}((0[1-9])|(11|12))([012][\d]|(30|31))[\d]{3}[xX\d]*/,EngAndNum:/[a-zA-Z0-9]*/,EngNumUnderline:/[a-zA-Z0-9_]*/,PhoneNumber:/(86)?(-)?(0\d{2,3})?(-)?(\d{7,8})(-)?(\d{1,5})?/,PostalCode:/\d{6}/,Account:/^[A-Za-z0-9@.]{8,19}$/,URL:/^[0-9a-zA-Z_]{1,}$/,Domain:/^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$/},getLanguage(){let e=localStorage.getItem(`foUILanguage`);return e||=navigator.language,e!=null&&(e=`en|zh-CN`.indexOf(e)>-1?e:`en`),localStorage.setItem(`foUILanguage`,e),e},isEmpty(e){return!(e!=null&&/[\S]/.test(e))},isNotEmpty(e){return!this.isEmpty(e)}},s=r((0,e.defineComponent)({__name:`index`,props:{modelValue:{type:String,default:``},placeholder:{type:String,default:``},size:{type:String,default:``},description:{type:String,default:``},borderless:{type:Boolean,default:!1},shrink:{type:Boolean,default:!0},errorTips:{type:Boolean,default:!0}},setup(t){let n=``,r=(0,e.ref)(!1),i=t,a=(0,e.useAttrs)();return a={...a,...i},n=i.modelValue,r.value=o.isEmpty(n),(0,e.onMounted)(()=>{r.value=o.isEmpty(i.modelValue)}),(0,e.watch)(()=>i.modelValue,(e,t)=>{r.value=o.isEmpty(e)}),(i,o)=>{let s=(0,e.resolveComponent)(`el-input`);return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:(0,e.normalizeClass)([`el-input-material`,`${t.borderless?`borderless`:``}${t.errorTips?``:` no-tips`}`])},[t.borderless?(0,e.createCommentVNode)(`v-if`,!0):((0,e.openBlock)(),(0,e.createElementBlock)(`label`,{key:0,class:(0,e.normalizeClass)([`el-input-material-label`,t.shrink||r.value?`active`:``])},(0,e.toDisplayString)(t.placeholder),3)),(0,e.createVNode)(s,(0,e.mergeProps)((0,e.unref)(a),{modelValue:(0,e.unref)(n),"onUpdate:modelValue":o[0]||=t=>(0,e.isRef)(n)?n.value=t:n=t,placeholder:t.shrink?t.description||``:t.placeholder}),(0,e.createSlots)({_:2},[(0,e.useSlots)().append?{name:`append`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(i.$slots,`append`,{},void 0,!0)]),key:`0`}:void 0,(0,e.useSlots)().prepend?{name:`prepend`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(i.$slots,`prepend`,{},void 0,!0)]),key:`1`}:void 0,(0,e.useSlots)().default?{name:`prepend`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(i.$slots,`default`,{},void 0,!0)]),key:`2`}:void 0,(0,e.useSlots)().suffix?{name:`suffix`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(i.$slots,`suffix`,{},void 0,!0)]),key:`3`}:void 0,(0,e.useSlots)().suffix?{name:`suffix`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(i.$slots,`suffix`,{},void 0,!0)]),key:`4`}:void 0]),1040,[`modelValue`,`placeholder`])],2)}}}),[[`__scopeId`,`data-v-6db49b3e`]]),c=[a,{install(e){e.component(`OgaInput`,s)}}];return{install(e){c.map(t=>e.use(t))}}});
|
package/input/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.el-input-material[data-v-
|
|
1
|
+
.el-input-material[data-v-6db49b3e]{clear:both;padding:.375rem 0;position:relative}.el-input-material .el-input.is-disabled .el-input__inner[data-v-6db49b3e]{background:0 0}.el-input-material .el-input-group__prepend[data-v-6db49b3e],.el-input-material .el-input-group__append[data-v-6db49b3e]{padding:0 15px!important}.el-input-material .el-select[data-v-6db49b3e],.el-input-material .el-cascader[data-v-6db49b3e]{width:100%}.el-input-material.borderless .el-input-number .el-input__inner[data-v-6db49b3e]{text-align:center}.el-input-material.borderless .el-input__inner[data-v-6db49b3e]{border-top:0;border-left:0;border-right:0;border-radius:0;padding-left:0;padding-right:0}.el-input-material.borderless [class*=el-][data-v-6db49b3e]{background-color:#0000;border-top:0;border-left:0;border-right:0;border-radius:0}.el-input-material.borderless .el-date-editor--date.el-input--prefix .el-input__inner[data-v-6db49b3e]{padding-left:1.875rem}.el-input-material-label[data-v-6db49b3e]{text-shadow:0 0 5px #fff,0 0 5px #fff,0 0 5px #fff,0 0 5px #fff,0 0 5px #fff,0 0 5px #fff,0 0 5px #fff,0 0 5px #fff,0 0 5px #fff,0 0 5px #fff,0 0 5px #fff;color:#c0c4cc;z-index:2;border-radius:5px;padding-left:2px;padding-right:2px;font-size:.75rem;line-height:.75rem;transition:all .2s;position:absolute;top:0;left:1rem;opacity:1!important}.el-input-material-label[data-v-6db49b3e]:not(.active){opacity:0}.el-input-material+.el-form-item__error[data-v-6db49b3e]{padding-top:0}.el-form-item:focus .el-input-material-label.active[data-v-6db49b3e]{color:#f56c6c}
|
|
2
2
|
/*$vite$:1*/
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { createCommentVNode, createElementBlock, createSlots, createVNode, defineComponent, isRef, mergeProps, normalizeClass, onMounted, openBlock, ref, renderSlot, resolveComponent, toDisplayString, unref, useAttrs, useSlots, watch, withCtx } from "vue";
|
|
2
|
+
var utility_default = {
|
|
3
|
+
expression: {
|
|
4
|
+
Required: /[\S]/,
|
|
5
|
+
Email: /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/,
|
|
6
|
+
Int: /(-)?(\d+)$/,
|
|
7
|
+
IntPositive: /^\+?[0-9]\d*$/,
|
|
8
|
+
IntZeroPositive: /^\+?[1-9]\d*$/,
|
|
9
|
+
Float: /(-)?(\d+)(((\.)(\d)+))?/,
|
|
10
|
+
FloatPositive: /^([0-9]\d*(.\d+)*|0\.(?=\d*[1-9]\d*)\d+)$/,
|
|
11
|
+
FloatZeroPositive: /^([1-9]\d*(.\d+)*|0\.(?=\d*[1-9]\d*)\d+)$/,
|
|
12
|
+
Chinese: /[\u4e00-\u9fa5]/,
|
|
13
|
+
English: /[a-zA-Z]/,
|
|
14
|
+
Mobile: /^[1]([3-9])[0-9]{9}$/,
|
|
15
|
+
Password: /^[A-Za-z][A-Za-z0-9~!@#$%^&*]{5,19}$/,
|
|
16
|
+
IdentityCard: /[\d]{6}(19|20)*[\d]{2}((0[1-9])|(11|12))([012][\d]|(30|31))[\d]{3}[xX\d]*/,
|
|
17
|
+
EngAndNum: /[a-zA-Z0-9]*/,
|
|
18
|
+
EngNumUnderline: /[a-zA-Z0-9_]*/,
|
|
19
|
+
PhoneNumber: /(86)?(-)?(0\d{2,3})?(-)?(\d{7,8})(-)?(\d{1,5})?/,
|
|
20
|
+
PostalCode: /\d{6}/,
|
|
21
|
+
Account: /^[A-Za-z0-9@.]{8,19}$/,
|
|
22
|
+
URL: /^[0-9a-zA-Z_]{1,}$/,
|
|
23
|
+
Domain: /^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$/
|
|
24
|
+
},
|
|
25
|
+
getLanguage() {
|
|
26
|
+
let e = localStorage.getItem("foUILanguage");
|
|
27
|
+
return e ||= navigator.language, e != null && (e = "en|zh-CN".indexOf(e) > -1 ? e : "en"), localStorage.setItem("foUILanguage", e), e;
|
|
28
|
+
},
|
|
29
|
+
isEmpty(e) {
|
|
30
|
+
return !(e != null && /[\S]/.test(e));
|
|
31
|
+
},
|
|
32
|
+
isNotEmpty(e) {
|
|
33
|
+
return !this.isEmpty(e);
|
|
34
|
+
}
|
|
35
|
+
}, src_default = /* @__PURE__ */ ((e, p) => {
|
|
36
|
+
let m = e.__vccOpts || e;
|
|
37
|
+
for (let [e, h] of p) m[e] = h;
|
|
38
|
+
return m;
|
|
39
|
+
})(/* @__PURE__ */ defineComponent({
|
|
40
|
+
__name: "index",
|
|
41
|
+
props: {
|
|
42
|
+
modelValue: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: ""
|
|
45
|
+
},
|
|
46
|
+
placeholder: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: ""
|
|
49
|
+
},
|
|
50
|
+
size: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: ""
|
|
53
|
+
},
|
|
54
|
+
description: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: ""
|
|
57
|
+
},
|
|
58
|
+
borderless: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: !1
|
|
61
|
+
},
|
|
62
|
+
shrink: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: !0
|
|
65
|
+
},
|
|
66
|
+
errorTips: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: !0
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
setup(g) {
|
|
72
|
+
let b = "", x = ref(!1), S = g, C = useAttrs();
|
|
73
|
+
return C = {
|
|
74
|
+
...C,
|
|
75
|
+
...S
|
|
76
|
+
}, b = S.modelValue, x.value = utility_default.isEmpty(b), onMounted(() => {
|
|
77
|
+
x.value = utility_default.isEmpty(S.modelValue);
|
|
78
|
+
}), watch(() => S.modelValue, (e, p) => {
|
|
79
|
+
x.value = utility_default.isEmpty(e);
|
|
80
|
+
}), (_, v) => {
|
|
81
|
+
let y = resolveComponent("el-input");
|
|
82
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(["el-input-material", `${g.borderless ? "borderless" : ""}${g.errorTips ? "" : " no-tips"}`]) }, [g.borderless ? createCommentVNode("v-if", !0) : (openBlock(), createElementBlock("label", {
|
|
83
|
+
key: 0,
|
|
84
|
+
class: normalizeClass(["el-input-material-label", g.shrink || x.value ? "active" : ""])
|
|
85
|
+
}, toDisplayString(g.placeholder), 3)), createVNode(y, mergeProps(unref(C), {
|
|
86
|
+
modelValue: unref(b),
|
|
87
|
+
"onUpdate:modelValue": v[0] ||= (e) => isRef(b) ? b.value = e : b = e,
|
|
88
|
+
placeholder: g.shrink ? g.description || "" : g.placeholder
|
|
89
|
+
}), createSlots({ _: 2 }, [
|
|
90
|
+
useSlots().append ? {
|
|
91
|
+
name: "append",
|
|
92
|
+
fn: withCtx(() => [renderSlot(_.$slots, "append", {}, void 0, !0)]),
|
|
93
|
+
key: "0"
|
|
94
|
+
} : void 0,
|
|
95
|
+
useSlots().prepend ? {
|
|
96
|
+
name: "prepend",
|
|
97
|
+
fn: withCtx(() => [renderSlot(_.$slots, "prepend", {}, void 0, !0)]),
|
|
98
|
+
key: "1"
|
|
99
|
+
} : void 0,
|
|
100
|
+
useSlots().default ? {
|
|
101
|
+
name: "prepend",
|
|
102
|
+
fn: withCtx(() => [renderSlot(_.$slots, "default", {}, void 0, !0)]),
|
|
103
|
+
key: "2"
|
|
104
|
+
} : void 0,
|
|
105
|
+
useSlots().suffix ? {
|
|
106
|
+
name: "suffix",
|
|
107
|
+
fn: withCtx(() => [renderSlot(_.$slots, "suffix", {}, void 0, !0)]),
|
|
108
|
+
key: "3"
|
|
109
|
+
} : void 0,
|
|
110
|
+
useSlots().suffix ? {
|
|
111
|
+
name: "suffix",
|
|
112
|
+
fn: withCtx(() => [renderSlot(_.$slots, "suffix", {}, void 0, !0)]),
|
|
113
|
+
key: "4"
|
|
114
|
+
} : void 0
|
|
115
|
+
]), 1040, ["modelValue", "placeholder"])], 2);
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
}), [["__scopeId", "data-v-6db49b3e"]]), input_default = { install(e) {
|
|
119
|
+
e.component("OgaInput", src_default);
|
|
120
|
+
} };
|
|
121
|
+
export { input_default as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t(require(`vue`)):typeof define==`function`&&define.amd?define([`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,e.index=t(e.Vue))})(this,function(e){var t={expression:{Required:/[\S]/,Email:/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/,Int:/(-)?(\d+)$/,IntPositive:/^\+?[0-9]\d*$/,IntZeroPositive:/^\+?[1-9]\d*$/,Float:/(-)?(\d+)(((\.)(\d)+))?/,FloatPositive:/^([0-9]\d*(.\d+)*|0\.(?=\d*[1-9]\d*)\d+)$/,FloatZeroPositive:/^([1-9]\d*(.\d+)*|0\.(?=\d*[1-9]\d*)\d+)$/,Chinese:/[\u4e00-\u9fa5]/,English:/[a-zA-Z]/,Mobile:/^[1]([3-9])[0-9]{9}$/,Password:/^[A-Za-z][A-Za-z0-9~!@#$%^&*]{5,19}$/,IdentityCard:/[\d]{6}(19|20)*[\d]{2}((0[1-9])|(11|12))([012][\d]|(30|31))[\d]{3}[xX\d]*/,EngAndNum:/[a-zA-Z0-9]*/,EngNumUnderline:/[a-zA-Z0-9_]*/,PhoneNumber:/(86)?(-)?(0\d{2,3})?(-)?(\d{7,8})(-)?(\d{1,5})?/,PostalCode:/\d{6}/,Account:/^[A-Za-z0-9@.]{8,19}$/,URL:/^[0-9a-zA-Z_]{1,}$/,Domain:/^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$/},getLanguage(){let e=localStorage.getItem(`foUILanguage`);return e||=navigator.language,e!=null&&(e=`en|zh-CN`.indexOf(e)>-1?e:`en`),localStorage.setItem(`foUILanguage`,e),e},isEmpty(e){return!(e!=null&&/[\S]/.test(e))},isNotEmpty(e){return!this.isEmpty(e)}},n=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})((0,e.defineComponent)({__name:`index`,props:{modelValue:{type:String,default:``},placeholder:{type:String,default:``},size:{type:String,default:``},description:{type:String,default:``},borderless:{type:Boolean,default:!1},shrink:{type:Boolean,default:!0},errorTips:{type:Boolean,default:!0}},setup(n){let r=``,i=(0,e.ref)(!1),a=n,o=(0,e.useAttrs)();return o={...o,...a},r=a.modelValue,i.value=t.isEmpty(r),(0,e.onMounted)(()=>{i.value=t.isEmpty(a.modelValue)}),(0,e.watch)(()=>a.modelValue,(e,n)=>{i.value=t.isEmpty(e)}),(t,a)=>{let s=(0,e.resolveComponent)(`el-input`);return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:(0,e.normalizeClass)([`el-input-material`,`${n.borderless?`borderless`:``}${n.errorTips?``:` no-tips`}`])},[n.borderless?(0,e.createCommentVNode)(`v-if`,!0):((0,e.openBlock)(),(0,e.createElementBlock)(`label`,{key:0,class:(0,e.normalizeClass)([`el-input-material-label`,n.shrink||i.value?`active`:``])},(0,e.toDisplayString)(n.placeholder),3)),(0,e.createVNode)(s,(0,e.mergeProps)((0,e.unref)(o),{modelValue:(0,e.unref)(r),"onUpdate:modelValue":a[0]||=t=>(0,e.isRef)(r)?r.value=t:r=t,placeholder:n.shrink?n.description||``:n.placeholder}),(0,e.createSlots)({_:2},[(0,e.useSlots)().append?{name:`append`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(t.$slots,`append`,{},void 0,!0)]),key:`0`}:void 0,(0,e.useSlots)().prepend?{name:`prepend`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(t.$slots,`prepend`,{},void 0,!0)]),key:`1`}:void 0,(0,e.useSlots)().default?{name:`prepend`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(t.$slots,`default`,{},void 0,!0)]),key:`2`}:void 0,(0,e.useSlots)().suffix?{name:`suffix`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(t.$slots,`suffix`,{},void 0,!0)]),key:`3`}:void 0,(0,e.useSlots)().suffix?{name:`suffix`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(t.$slots,`suffix`,{},void 0,!0)]),key:`4`}:void 0]),1040,[`modelValue`,`placeholder`])],2)}}}),[[`__scopeId`,`data-v-6db49b3e`]]);return{install(e){e.component(`OgaInput`,n)}}});
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oga-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "A Component Library for Vue3",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Joe",
|
|
7
7
|
"email": "joe.bob.xie@gmail.com"
|
|
8
8
|
},
|
|
9
9
|
"license": "MIT",
|
|
10
|
-
"main": "index.umd.
|
|
11
|
-
"module": "index.
|
|
12
|
-
"style": "
|
|
10
|
+
"main": "index.umd.ts",
|
|
11
|
+
"module": "index.es.ts",
|
|
12
|
+
"style": "index.css"
|
|
13
13
|
}
|
package/index.mjs
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { createCommentVNode, createElementBlock, createSlots, createVNode, defineComponent, isRef, mergeProps, normalizeClass, onMounted, openBlock, ref, renderSlot, resolveComponent, toDisplayString, unref, useAttrs, useSlots, withCtx } from "vue";
|
|
2
|
-
var _hoisted_1 = { class: "demo-progress" }, index_vue_vue_type_script_setup_true_lang_default$1 = /* @__PURE__ */ defineComponent({
|
|
3
|
-
__name: "index",
|
|
4
|
-
props: {
|
|
5
|
-
percentage: {
|
|
6
|
-
type: Number,
|
|
7
|
-
default: 0
|
|
8
|
-
},
|
|
9
|
-
animationTime: {
|
|
10
|
-
type: Number,
|
|
11
|
-
default: 3e3
|
|
12
|
-
},
|
|
13
|
-
isAnimation: {
|
|
14
|
-
type: Boolean,
|
|
15
|
-
default: !1
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
setup(e) {
|
|
19
|
-
let m = e, g = ref(0), _ = (e) => e < 30 ? "#909399" : e < 70 ? "#e6a23c" : "#67c23a";
|
|
20
|
-
return onMounted(() => {
|
|
21
|
-
let e = Math.ceil(m.animationTime / m.percentage), p = setInterval(() => {
|
|
22
|
-
g.value += 1, (g.value >= m.percentage || g.value >= 100) && (g.value = m.percentage >= 100 ? 100 : m.percentage, clearInterval(p));
|
|
23
|
-
}, e);
|
|
24
|
-
}), (e, m) => {
|
|
25
|
-
let v = resolveComponent("el-progress");
|
|
26
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [createVNode(v, mergeProps({ percentage: g.value }, e.$attrs, { color: _ }), null, 16, ["percentage"])]);
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}), __plugin_vue_export_helper_default = (e, p) => {
|
|
30
|
-
let m = e.__vccOpts || e;
|
|
31
|
-
for (let [e, h] of p) m[e] = h;
|
|
32
|
-
return m;
|
|
33
|
-
}, src_default$1 = /* @__PURE__ */ __plugin_vue_export_helper_default(index_vue_vue_type_script_setup_true_lang_default$1, [["__scopeId", "data-v-b7194e36"]]), progress_default = { install(e) {
|
|
34
|
-
e.component("OgaProgress", src_default$1);
|
|
35
|
-
} }, src_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
36
|
-
__name: "index",
|
|
37
|
-
props: {
|
|
38
|
-
modelValue: {
|
|
39
|
-
type: [String, Number],
|
|
40
|
-
default: ""
|
|
41
|
-
},
|
|
42
|
-
placeholder: {
|
|
43
|
-
type: String,
|
|
44
|
-
default: ""
|
|
45
|
-
},
|
|
46
|
-
size: {
|
|
47
|
-
type: String,
|
|
48
|
-
default: ""
|
|
49
|
-
},
|
|
50
|
-
description: {
|
|
51
|
-
type: String,
|
|
52
|
-
default: ""
|
|
53
|
-
},
|
|
54
|
-
borderless: {
|
|
55
|
-
type: Boolean,
|
|
56
|
-
default: !1
|
|
57
|
-
},
|
|
58
|
-
shrink: {
|
|
59
|
-
type: Boolean,
|
|
60
|
-
default: !0
|
|
61
|
-
},
|
|
62
|
-
errorTips: {
|
|
63
|
-
type: Boolean,
|
|
64
|
-
default: !0
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
setup(g) {
|
|
68
|
-
let S = "", C = ref(!1), w = g, T = useAttrs();
|
|
69
|
-
return T = {
|
|
70
|
-
...T,
|
|
71
|
-
...w
|
|
72
|
-
}, onMounted(() => {
|
|
73
|
-
S = w.modelValue;
|
|
74
|
-
}), (y, b) => {
|
|
75
|
-
let x = resolveComponent("el-input");
|
|
76
|
-
return openBlock(), createElementBlock("div", { class: normalizeClass(["el-input-material", `${g.borderless ? "borderless" : ""}${g.errorTips ? "" : " no-tips"}`]) }, [g.borderless ? createCommentVNode("v-if", !0) : (openBlock(), createElementBlock("label", {
|
|
77
|
-
key: 0,
|
|
78
|
-
class: normalizeClass(["el-input-material-label", g.shrink || C.value ? "active" : ""])
|
|
79
|
-
}, toDisplayString(g.placeholder), 3)), createVNode(x, mergeProps(unref(T), {
|
|
80
|
-
modelValue: unref(S),
|
|
81
|
-
"onUpdate:modelValue": b[0] ||= (e) => isRef(S) ? S.value = e : S = e,
|
|
82
|
-
placeholder: g.shrink ? g.description || "" : g.placeholder
|
|
83
|
-
}), createSlots({ _: 2 }, [
|
|
84
|
-
useSlots().append ? {
|
|
85
|
-
name: "append",
|
|
86
|
-
fn: withCtx(() => [renderSlot(y.$slots, "append", {}, void 0, !0)]),
|
|
87
|
-
key: "0"
|
|
88
|
-
} : void 0,
|
|
89
|
-
useSlots().prepend ? {
|
|
90
|
-
name: "prepend",
|
|
91
|
-
fn: withCtx(() => [renderSlot(y.$slots, "prepend", {}, void 0, !0)]),
|
|
92
|
-
key: "1"
|
|
93
|
-
} : void 0,
|
|
94
|
-
useSlots().default ? {
|
|
95
|
-
name: "prepend",
|
|
96
|
-
fn: withCtx(() => [renderSlot(y.$slots, "default", {}, void 0, !0)]),
|
|
97
|
-
key: "2"
|
|
98
|
-
} : void 0,
|
|
99
|
-
useSlots().suffix ? {
|
|
100
|
-
name: "suffix",
|
|
101
|
-
fn: withCtx(() => [renderSlot(y.$slots, "suffix", {}, void 0, !0)]),
|
|
102
|
-
key: "3"
|
|
103
|
-
} : void 0,
|
|
104
|
-
useSlots().suffix ? {
|
|
105
|
-
name: "suffix",
|
|
106
|
-
fn: withCtx(() => [renderSlot(y.$slots, "suffix", {}, void 0, !0)]),
|
|
107
|
-
key: "4"
|
|
108
|
-
} : void 0
|
|
109
|
-
]), 1040, ["modelValue", "placeholder"])], 2);
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
}), [["__scopeId", "data-v-852d15a2"]]), components = [progress_default, { install(e) {
|
|
113
|
-
e.component("OgaInput", src_default);
|
|
114
|
-
} }], packages_default = { install(e) {
|
|
115
|
-
components.map((p) => e.use(p));
|
|
116
|
-
} };
|
|
117
|
-
export { packages_default as default };
|
package/index.umd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t(require(`vue`)):typeof define==`function`&&define.amd?define([`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,e.index=t(e.Vue))})(this,function(e){var t={class:`demo-progress`},n=(0,e.defineComponent)({__name:`index`,props:{percentage:{type:Number,default:0},animationTime:{type:Number,default:3e3},isAnimation:{type:Boolean,default:!1}},setup(n){let r=n,i=(0,e.ref)(0),a=e=>e<30?`#909399`:e<70?`#e6a23c`:`#67c23a`;return(0,e.onMounted)(()=>{let e=Math.ceil(r.animationTime/r.percentage),t=setInterval(()=>{i.value+=1,(i.value>=r.percentage||i.value>=100)&&(i.value=r.percentage>=100?100:r.percentage,clearInterval(t))},e)}),(n,r)=>{let o=(0,e.resolveComponent)(`el-progress`);return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,t,[(0,e.createVNode)(o,(0,e.mergeProps)({percentage:i.value},n.$attrs,{color:a}),null,16,[`percentage`])])}}}),r=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},i=r(n,[[`__scopeId`,`data-v-b7194e36`]]),a={install(e){e.component(`OgaProgress`,i)}},o=r((0,e.defineComponent)({__name:`index`,props:{modelValue:{type:[String,Number],default:``},placeholder:{type:String,default:``},size:{type:String,default:``},description:{type:String,default:``},borderless:{type:Boolean,default:!1},shrink:{type:Boolean,default:!0},errorTips:{type:Boolean,default:!0}},setup(t){let n=``,r=(0,e.ref)(!1),i=t,a=(0,e.useAttrs)();return a={...a,...i},(0,e.onMounted)(()=>{n=i.modelValue}),(i,o)=>{let s=(0,e.resolveComponent)(`el-input`);return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:(0,e.normalizeClass)([`el-input-material`,`${t.borderless?`borderless`:``}${t.errorTips?``:` no-tips`}`])},[t.borderless?(0,e.createCommentVNode)(`v-if`,!0):((0,e.openBlock)(),(0,e.createElementBlock)(`label`,{key:0,class:(0,e.normalizeClass)([`el-input-material-label`,t.shrink||r.value?`active`:``])},(0,e.toDisplayString)(t.placeholder),3)),(0,e.createVNode)(s,(0,e.mergeProps)((0,e.unref)(a),{modelValue:(0,e.unref)(n),"onUpdate:modelValue":o[0]||=t=>(0,e.isRef)(n)?n.value=t:n=t,placeholder:t.shrink?t.description||``:t.placeholder}),(0,e.createSlots)({_:2},[(0,e.useSlots)().append?{name:`append`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(i.$slots,`append`,{},void 0,!0)]),key:`0`}:void 0,(0,e.useSlots)().prepend?{name:`prepend`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(i.$slots,`prepend`,{},void 0,!0)]),key:`1`}:void 0,(0,e.useSlots)().default?{name:`prepend`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(i.$slots,`default`,{},void 0,!0)]),key:`2`}:void 0,(0,e.useSlots)().suffix?{name:`suffix`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(i.$slots,`suffix`,{},void 0,!0)]),key:`3`}:void 0,(0,e.useSlots)().suffix?{name:`suffix`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(i.$slots,`suffix`,{},void 0,!0)]),key:`4`}:void 0]),1040,[`modelValue`,`placeholder`])],2)}}}),[[`__scopeId`,`data-v-852d15a2`]]),s=[a,{install(e){e.component(`OgaInput`,o)}}];return{install(e){s.map(t=>e.use(t))}}});
|
package/input/index.mjs
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { createCommentVNode, createElementBlock, createSlots, createVNode, defineComponent, isRef, mergeProps, normalizeClass, onMounted, openBlock, ref, renderSlot, resolveComponent, toDisplayString, unref, useAttrs, useSlots, withCtx } from "vue";
|
|
2
|
-
var src_default = /* @__PURE__ */ ((e, d) => {
|
|
3
|
-
let f = e.__vccOpts || e;
|
|
4
|
-
for (let [e, p] of d) f[e] = p;
|
|
5
|
-
return f;
|
|
6
|
-
})(/* @__PURE__ */ defineComponent({
|
|
7
|
-
__name: "index",
|
|
8
|
-
props: {
|
|
9
|
-
modelValue: {
|
|
10
|
-
type: [String, Number],
|
|
11
|
-
default: ""
|
|
12
|
-
},
|
|
13
|
-
placeholder: {
|
|
14
|
-
type: String,
|
|
15
|
-
default: ""
|
|
16
|
-
},
|
|
17
|
-
size: {
|
|
18
|
-
type: String,
|
|
19
|
-
default: ""
|
|
20
|
-
},
|
|
21
|
-
description: {
|
|
22
|
-
type: String,
|
|
23
|
-
default: ""
|
|
24
|
-
},
|
|
25
|
-
borderless: {
|
|
26
|
-
type: Boolean,
|
|
27
|
-
default: !1
|
|
28
|
-
},
|
|
29
|
-
shrink: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
default: !0
|
|
32
|
-
},
|
|
33
|
-
errorTips: {
|
|
34
|
-
type: Boolean,
|
|
35
|
-
default: !0
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
setup(m) {
|
|
39
|
-
let v = "", y = ref(!1), b = m, x = useAttrs();
|
|
40
|
-
return x = {
|
|
41
|
-
...x,
|
|
42
|
-
...b
|
|
43
|
-
}, onMounted(() => {
|
|
44
|
-
v = b.modelValue;
|
|
45
|
-
}), (h, g) => {
|
|
46
|
-
let _ = resolveComponent("el-input");
|
|
47
|
-
return openBlock(), createElementBlock("div", { class: normalizeClass(["el-input-material", `${m.borderless ? "borderless" : ""}${m.errorTips ? "" : " no-tips"}`]) }, [m.borderless ? createCommentVNode("v-if", !0) : (openBlock(), createElementBlock("label", {
|
|
48
|
-
key: 0,
|
|
49
|
-
class: normalizeClass(["el-input-material-label", m.shrink || y.value ? "active" : ""])
|
|
50
|
-
}, toDisplayString(m.placeholder), 3)), createVNode(_, mergeProps(unref(x), {
|
|
51
|
-
modelValue: unref(v),
|
|
52
|
-
"onUpdate:modelValue": g[0] ||= (e) => isRef(v) ? v.value = e : v = e,
|
|
53
|
-
placeholder: m.shrink ? m.description || "" : m.placeholder
|
|
54
|
-
}), createSlots({ _: 2 }, [
|
|
55
|
-
useSlots().append ? {
|
|
56
|
-
name: "append",
|
|
57
|
-
fn: withCtx(() => [renderSlot(h.$slots, "append", {}, void 0, !0)]),
|
|
58
|
-
key: "0"
|
|
59
|
-
} : void 0,
|
|
60
|
-
useSlots().prepend ? {
|
|
61
|
-
name: "prepend",
|
|
62
|
-
fn: withCtx(() => [renderSlot(h.$slots, "prepend", {}, void 0, !0)]),
|
|
63
|
-
key: "1"
|
|
64
|
-
} : void 0,
|
|
65
|
-
useSlots().default ? {
|
|
66
|
-
name: "prepend",
|
|
67
|
-
fn: withCtx(() => [renderSlot(h.$slots, "default", {}, void 0, !0)]),
|
|
68
|
-
key: "2"
|
|
69
|
-
} : void 0,
|
|
70
|
-
useSlots().suffix ? {
|
|
71
|
-
name: "suffix",
|
|
72
|
-
fn: withCtx(() => [renderSlot(h.$slots, "suffix", {}, void 0, !0)]),
|
|
73
|
-
key: "3"
|
|
74
|
-
} : void 0,
|
|
75
|
-
useSlots().suffix ? {
|
|
76
|
-
name: "suffix",
|
|
77
|
-
fn: withCtx(() => [renderSlot(h.$slots, "suffix", {}, void 0, !0)]),
|
|
78
|
-
key: "4"
|
|
79
|
-
} : void 0
|
|
80
|
-
]), 1040, ["modelValue", "placeholder"])], 2);
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
}), [["__scopeId", "data-v-852d15a2"]]), input_default = { install(e) {
|
|
84
|
-
e.component("OgaInput", src_default);
|
|
85
|
-
} };
|
|
86
|
-
export { input_default as default };
|
package/input/index.umd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t(require(`vue`)):typeof define==`function`&&define.amd?define([`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,e.index=t(e.Vue))})(this,function(e){var t=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})((0,e.defineComponent)({__name:`index`,props:{modelValue:{type:[String,Number],default:``},placeholder:{type:String,default:``},size:{type:String,default:``},description:{type:String,default:``},borderless:{type:Boolean,default:!1},shrink:{type:Boolean,default:!0},errorTips:{type:Boolean,default:!0}},setup(t){let n=``,r=(0,e.ref)(!1),i=t,a=(0,e.useAttrs)();return a={...a,...i},(0,e.onMounted)(()=>{n=i.modelValue}),(i,o)=>{let s=(0,e.resolveComponent)(`el-input`);return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:(0,e.normalizeClass)([`el-input-material`,`${t.borderless?`borderless`:``}${t.errorTips?``:` no-tips`}`])},[t.borderless?(0,e.createCommentVNode)(`v-if`,!0):((0,e.openBlock)(),(0,e.createElementBlock)(`label`,{key:0,class:(0,e.normalizeClass)([`el-input-material-label`,t.shrink||r.value?`active`:``])},(0,e.toDisplayString)(t.placeholder),3)),(0,e.createVNode)(s,(0,e.mergeProps)((0,e.unref)(a),{modelValue:(0,e.unref)(n),"onUpdate:modelValue":o[0]||=t=>(0,e.isRef)(n)?n.value=t:n=t,placeholder:t.shrink?t.description||``:t.placeholder}),(0,e.createSlots)({_:2},[(0,e.useSlots)().append?{name:`append`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(i.$slots,`append`,{},void 0,!0)]),key:`0`}:void 0,(0,e.useSlots)().prepend?{name:`prepend`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(i.$slots,`prepend`,{},void 0,!0)]),key:`1`}:void 0,(0,e.useSlots)().default?{name:`prepend`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(i.$slots,`default`,{},void 0,!0)]),key:`2`}:void 0,(0,e.useSlots)().suffix?{name:`suffix`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(i.$slots,`suffix`,{},void 0,!0)]),key:`3`}:void 0,(0,e.useSlots)().suffix?{name:`suffix`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(i.$slots,`suffix`,{},void 0,!0)]),key:`4`}:void 0]),1040,[`modelValue`,`placeholder`])],2)}}}),[[`__scopeId`,`data-v-852d15a2`]]);return{install(e){e.component(`OgaInput`,t)}}});
|
|
File without changes
|
|
File without changes
|