@ipa-community/element-plus 0.0.2 → 0.0.4

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.
Files changed (37) hide show
  1. package/README.md +6 -4
  2. package/components.d.ts +2 -1
  3. package/eslint.config.js +7 -1
  4. package/lib/ElAuthCode-BtEs4aSF.js +84 -0
  5. package/lib/ElAuthCode-CjW7VQCs.cjs +1 -0
  6. package/lib/{index-DD0ylEu2.js → ElTablePlus-BFmsdH61.js} +1759 -1759
  7. package/lib/ElTablePlus-DGAKgtzB.cjs +13 -0
  8. package/lib/HelloWorld-DUGHI-ql.js +872 -0
  9. package/lib/HelloWorld-DkE5myvU.cjs +1 -0
  10. package/lib/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
  11. package/lib/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  12. package/lib/assets/ElAuthCode.css +1 -0
  13. package/lib/{index.css → assets/ElTablePlus.css} +1 -1
  14. package/lib/assets/HelloWorld.css +1 -0
  15. package/lib/assets/base.css +1 -0
  16. package/lib/assets/index.css +1 -0
  17. package/lib/base-BKS5Bata.cjs +8 -0
  18. package/lib/base-D3FwvTBU.js +1648 -0
  19. package/lib/components/index.d.ts +64 -9
  20. package/lib/components/input/ElAuthCode.vue.d.ts +53 -0
  21. package/lib/components/{ElTablePlus/index.vue.d.ts → table/ElTablePlus.vue.d.ts} +3 -3
  22. package/lib/components/{ElTablePlus → table}/types.d.ts +1 -1
  23. package/lib/{index-CUQIwkb8.cjs → index-B9aGVsah.cjs} +1 -1
  24. package/lib/index-C3NSW_8F.cjs +6 -0
  25. package/lib/index-Dkgs1rld.js +3784 -0
  26. package/lib/{index-Dqu6455K.js → index-DlT5uboQ.js} +1 -1
  27. package/lib/index.cjs +1 -1
  28. package/lib/index.es.js +11 -10
  29. package/lib/index.umd.js +14 -42
  30. package/lib/{table-pPX_scdG.cjs → table-DnNkGrLR.cjs} +1 -1
  31. package/lib/{table-Dw-Nh_fr.js → table-T2Jkjf7q.js} +1 -1
  32. package/package.json +1 -1
  33. package/lib/index-B64Elx8V.cjs +0 -41
  34. package/lib/index-CMrOepdZ.js +0 -11923
  35. package/lib/index-DpfpHOHg.cjs +0 -13
  36. package/lib/index2.css +0 -1
  37. package/lib/types/page.d.ts +0 -25
package/README.md CHANGED
@@ -1,8 +1,6 @@
1
- # vite7 + vitest + i18n + prettier + eslint + unplugin... + husky
1
+ # @ipa-community/element-plus
2
2
 
3
- This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4
-
5
- Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).
3
+ based on [vue-component-library](https://github.com/ipa-community/vue-component-library)
6
4
 
7
5
  1. [unplugin-vue-component](https://github.com/unplugin/unplugin-vue-components#readme)
8
6
  2. [unplugin-auto-import](https://github.com/unplugin/unplugin-auto-import)
@@ -85,3 +83,7 @@ or test release
85
83
  ```bash
86
84
  bun run release --dry-run
87
85
  ```
86
+
87
+ ## TODO
88
+
89
+ - [ ] decrease package size
package/components.d.ts CHANGED
@@ -11,6 +11,7 @@ export {}
11
11
  /* prettier-ignore */
12
12
  declare module 'vue' {
13
13
  export interface GlobalComponents {
14
+ ElAuthCode: typeof import('./src/components/input/ElAuthCode.vue')['default']
14
15
  ElAutoResizer: typeof import('element-plus/es')['ElAutoResizer']
15
16
  ElButton: typeof import('element-plus/es')['ElButton']
16
17
  ElEmpty: typeof import('element-plus/es')['ElEmpty']
@@ -18,7 +19,7 @@ declare module 'vue' {
18
19
  ElPagination: typeof import('element-plus/es')['ElPagination']
19
20
  ElTable: typeof import('element-plus/es')['ElTable']
20
21
  ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
21
- ElTablePlus: typeof import('./src/components/ElTablePlus/index.vue')['default']
22
+ ElTablePlus: typeof import('./src/components/table/ElTablePlus.vue')['default']
22
23
  ElTableV2: typeof import('element-plus/es')['ElTableV2']
23
24
  ElTooltip: typeof import('element-plus/es')['ElTooltip']
24
25
  HelloWorld: typeof import('./src/components/HelloWorld.vue')['default']
package/eslint.config.js CHANGED
@@ -28,8 +28,14 @@ export default [
28
28
  { ignores: ["dist", ".eslintrc-auto-import.cjs", "lib"] },
29
29
  {
30
30
  rules: {
31
- "vue/multi-word-component-names": "warn",
31
+ "vue/multi-word-component-names": "error",
32
32
  "@typescript-eslint/no-explicit-any": "warn",
33
33
  },
34
34
  },
35
+ {
36
+ files: ["src/pages/**/*.vue"],
37
+ rules: {
38
+ "vue/multi-word-component-names": "off",
39
+ },
40
+ },
35
41
  ];
@@ -0,0 +1,84 @@
1
+ import { defineComponent as b, mergeModels as m, useModel as I, ref as i, watch as k, computed as w, createElementBlock as f, openBlock as r, Fragment as A, renderList as B, createBlock as E, unref as F, normalizeStyle as S, withKeys as $ } from "vue";
2
+ import { ElInput as C } from "element-plus";
3
+ import { _ as K } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const M = { class: "code-input-group" }, j = /* @__PURE__ */ b({
5
+ __name: "ElAuthCode",
6
+ props: /* @__PURE__ */ m({
7
+ // 验证码长度(默认6位)
8
+ length: {
9
+ type: Number,
10
+ default: 6
11
+ },
12
+ // 是否禁用
13
+ disabled: {
14
+ type: Boolean,
15
+ default: !1
16
+ },
17
+ itemStyle: {
18
+ type: Object,
19
+ default: () => ({
20
+ width: "40px"
21
+ })
22
+ }
23
+ }, {
24
+ modelValue: {
25
+ type: String,
26
+ required: !0
27
+ },
28
+ modelModifiers: {}
29
+ }),
30
+ emits: /* @__PURE__ */ m(["complete", "update:modelValue"], ["update:modelValue"]),
31
+ setup(a, { expose: p, emit: h }) {
32
+ const l = a, v = I(a, "modelValue"), c = h, t = i(Array(l.length).fill(""));
33
+ k(
34
+ v,
35
+ (e) => {
36
+ t.value = [
37
+ ...(e ?? "").split(""),
38
+ ...Array(l.length).fill("")
39
+ ], t.value.length != l.length && (t.value = t.value.slice(0, l.length));
40
+ },
41
+ {
42
+ immediate: !0
43
+ }
44
+ );
45
+ const u = i([]), y = w(() => l.disabled), g = (e) => {
46
+ const d = t.value[e];
47
+ if (!/^\d?$/.test(d)) {
48
+ t.value[e] = "";
49
+ return;
50
+ }
51
+ d && e < l.length - 1 && u.value[e + 1]?.focus();
52
+ const n = t.value.join("");
53
+ n.length === l.length && c("complete", n), c("update:modelValue", n);
54
+ }, V = (e) => {
55
+ t.value[e] === "" && e > 0 && u.value[e - 1]?.focus();
56
+ }, _ = (e) => {
57
+ u.value[e]?.select();
58
+ };
59
+ return p({ reset: () => {
60
+ t.value = Array(l.length).fill(""), u.value[0]?.focus();
61
+ } }), (e, d) => (r(), f("div", M, [
62
+ (r(!0), f(A, null, B(a.length, (n, o) => (r(), E(F(C), {
63
+ key: o,
64
+ ref_for: !0,
65
+ ref_key: "codeInputRefs",
66
+ ref: u,
67
+ modelValue: t.value[o],
68
+ "onUpdate:modelValue": (s) => t.value[o] = s,
69
+ class: "code-input-item",
70
+ size: "small",
71
+ maxlength: "1",
72
+ onInput: (s) => g(o),
73
+ onKeydown: $((s) => V(o), ["delete"]),
74
+ onFocus: (s) => _(o),
75
+ disabled: y.value,
76
+ type: "tel",
77
+ style: S(a.itemStyle)
78
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "onInput", "onKeydown", "onFocus", "disabled", "style"]))), 128))
79
+ ]));
80
+ }
81
+ }), U = /* @__PURE__ */ K(j, [["__scopeId", "data-v-a341dfde"]]);
82
+ export {
83
+ U as default
84
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),y=require("element-plus"),V=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),_={class:"code-input-group"},b=e.defineComponent({__name:"ElAuthCode",props:e.mergeModels({length:{type:Number,default:6},disabled:{type:Boolean,default:!1},itemStyle:{type:Object,default:()=>({width:"40px"})}},{modelValue:{type:String,required:!0},modelModifiers:{}}),emits:e.mergeModels(["complete","update:modelValue"],["update:modelValue"]),setup(a,{expose:i,emit:m}){const o=a,p=e.useModel(a,"modelValue"),d=m,l=e.ref(Array(o.length).fill(""));e.watch(p,t=>{l.value=[...(t??"").split(""),...Array(o.length).fill("")],l.value.length!=o.length&&(l.value=l.value.slice(0,o.length))},{immediate:!0});const n=e.ref([]),f=e.computed(()=>o.disabled),v=t=>{const r=l.value[t];if(!/^\d?$/.test(r)){l.value[t]="";return}r&&t<o.length-1&&n.value[t+1]?.focus();const s=l.value.join("");s.length===o.length&&d("complete",s),d("update:modelValue",s)},h=t=>{l.value[t]===""&&t>0&&n.value[t-1]?.focus()},g=t=>{n.value[t]?.select()};return i({reset:()=>{l.value=Array(o.length).fill(""),n.value[0]?.focus()}}),(t,r)=>(e.openBlock(),e.createElementBlock("div",_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.length,(s,u)=>(e.openBlock(),e.createBlock(e.unref(y.ElInput),{key:u,ref_for:!0,ref_key:"codeInputRefs",ref:n,modelValue:l.value[u],"onUpdate:modelValue":c=>l.value[u]=c,class:"code-input-item",size:"small",maxlength:"1",onInput:c=>v(u),onKeydown:e.withKeys(c=>h(u),["delete"]),onFocus:c=>g(u),disabled:f.value,type:"tel",style:e.normalizeStyle(a.itemStyle)},null,8,["modelValue","onUpdate:modelValue","onInput","onKeydown","onFocus","disabled","style"]))),128))]))}}),k=V._export_sfc(b,[["__scopeId","data-v-a341dfde"]]);exports.default=k;