@huyooo/ui 0.1.1

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 ADDED
@@ -0,0 +1,5 @@
1
+ # Vue 3 + TypeScript + Vite
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).
@@ -0,0 +1,27 @@
1
+ declare const _default: import('vue').DefineComponent<{
2
+ loading: {
3
+ type: BooleanConstructor;
4
+ default: () => boolean;
5
+ };
6
+ finished: {
7
+ type: BooleanConstructor;
8
+ default: () => boolean;
9
+ };
10
+ }, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
11
+ infinite: (...args: any[]) => void;
12
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
13
+ loading: {
14
+ type: BooleanConstructor;
15
+ default: () => boolean;
16
+ };
17
+ finished: {
18
+ type: BooleanConstructor;
19
+ default: () => boolean;
20
+ };
21
+ }>> & {
22
+ onInfinite?: ((...args: any[]) => any) | undefined;
23
+ }, {
24
+ loading: boolean;
25
+ finished: boolean;
26
+ }, {}>;
27
+ export default _default;
@@ -0,0 +1,38 @@
1
+ declare const _default: import('vue').DefineComponent<{
2
+ prefix: {
3
+ type: StringConstructor;
4
+ required: false;
5
+ default: string;
6
+ };
7
+ name: {
8
+ type: StringConstructor;
9
+ required: true;
10
+ default: () => string;
11
+ };
12
+ color: {
13
+ type: StringConstructor;
14
+ required: false;
15
+ default: string;
16
+ };
17
+ }, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
18
+ prefix: {
19
+ type: StringConstructor;
20
+ required: false;
21
+ default: string;
22
+ };
23
+ name: {
24
+ type: StringConstructor;
25
+ required: true;
26
+ default: () => string;
27
+ };
28
+ color: {
29
+ type: StringConstructor;
30
+ required: false;
31
+ default: string;
32
+ };
33
+ }>>, {
34
+ prefix: string;
35
+ name: string;
36
+ color: string;
37
+ }, {}>;
38
+ export default _default;
package/dist/index.js ADDED
@@ -0,0 +1,153 @@
1
+ import { defineComponent as b, computed as _, openBlock as a, createElementBlock as l, createElementVNode as M, getCurrentScope as O, onScopeDispose as E, unref as w, ref as m, watch as N, getCurrentInstance as V, onMounted as W, createVNode as q, createCommentVNode as d } from "vue";
2
+ import { Spin as A } from "@arco-design/web-vue";
3
+ const D = { class: "SvgIcon" }, G = ["href", "fill"], L = /* @__PURE__ */ b({
4
+ __name: "SvgIcon",
5
+ props: {
6
+ prefix: {
7
+ type: String,
8
+ required: !1,
9
+ default: "icon"
10
+ },
11
+ name: {
12
+ type: String,
13
+ required: !0,
14
+ default: () => ""
15
+ },
16
+ color: {
17
+ type: String,
18
+ required: !1,
19
+ default: "#333"
20
+ }
21
+ },
22
+ setup(e) {
23
+ const n = e, t = _(() => `#${n.prefix ?? "icon"}-${n.name}`);
24
+ return (r, o) => (a(), l("svg", D, [
25
+ M("use", {
26
+ href: t.value,
27
+ fill: n.color
28
+ }, null, 8, G)
29
+ ]));
30
+ }
31
+ }), k = (e, n) => {
32
+ const t = e.__vccOpts || e;
33
+ for (const [r, o] of n)
34
+ t[r] = o;
35
+ return t;
36
+ }, Y = /* @__PURE__ */ k(L, [["__scopeId", "data-v-003a51d4"]]);
37
+ function T(e) {
38
+ return O() ? (E(e), !0) : !1;
39
+ }
40
+ function x(e) {
41
+ return typeof e == "function" ? e() : w(e);
42
+ }
43
+ const j = typeof window < "u" && typeof document < "u";
44
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
45
+ const z = (e) => e != null, p = () => {
46
+ }, F = j ? window : void 0;
47
+ function v(e) {
48
+ var n;
49
+ const t = x(e);
50
+ return (n = t == null ? void 0 : t.$el) != null ? n : t;
51
+ }
52
+ function H() {
53
+ const e = m(!1), n = V();
54
+ return n && W(() => {
55
+ e.value = !0;
56
+ }, n), e;
57
+ }
58
+ function J(e) {
59
+ const n = H();
60
+ return _(() => (n.value, !!e()));
61
+ }
62
+ function K(e, n, t = {}) {
63
+ const {
64
+ root: r,
65
+ rootMargin: o = "0px",
66
+ threshold: c = 0,
67
+ window: f = F,
68
+ immediate: g = !0
69
+ } = t, h = J(() => f && "IntersectionObserver" in f), $ = _(() => {
70
+ const i = x(e);
71
+ return (Array.isArray(i) ? i : [i]).map(v).filter(z);
72
+ });
73
+ let u = p;
74
+ const s = m(g), B = h.value ? N(
75
+ () => [$.value, v(r), s.value],
76
+ ([i, C]) => {
77
+ if (u(), !s.value || !i.length)
78
+ return;
79
+ const S = new IntersectionObserver(
80
+ n,
81
+ {
82
+ root: v(C),
83
+ rootMargin: o,
84
+ threshold: c
85
+ }
86
+ );
87
+ i.forEach((I) => I && S.observe(I)), u = () => {
88
+ S.disconnect(), u = p;
89
+ };
90
+ },
91
+ { immediate: g, flush: "post" }
92
+ ) : p, y = () => {
93
+ u(), B(), s.value = !1;
94
+ };
95
+ return T(y), {
96
+ isSupported: h,
97
+ isActive: s,
98
+ pause() {
99
+ u(), s.value = !1;
100
+ },
101
+ resume() {
102
+ s.value = !0;
103
+ },
104
+ stop: y
105
+ };
106
+ }
107
+ const P = {
108
+ key: 0,
109
+ class: "loading"
110
+ }, Q = {
111
+ key: 1,
112
+ class: "none"
113
+ }, R = /* @__PURE__ */ b({
114
+ __name: "InfiniteLoading",
115
+ props: {
116
+ loading: {
117
+ type: Boolean,
118
+ default: () => !1
119
+ },
120
+ finished: {
121
+ type: Boolean,
122
+ default: () => !1
123
+ }
124
+ },
125
+ emits: ["infinite"],
126
+ setup(e, { emit: n }) {
127
+ const t = e, r = n, o = m(null);
128
+ return K(
129
+ o,
130
+ ([{ isIntersecting: c }]) => {
131
+ c && !t.loading && !t.finished && (console.log(c, "isIntersecting"), r("infinite"));
132
+ },
133
+ {
134
+ threshold: 0
135
+ }
136
+ ), (c, f) => (a(), l("div", {
137
+ class: "infinite-loading",
138
+ ref_key: "container",
139
+ ref: o
140
+ }, [
141
+ e.loading ? (a(), l("div", P, [
142
+ q(w(A), { tip: "数据加载中..." })
143
+ ])) : d("", !0),
144
+ e.finished ? (a(), l("div", Q, [
145
+ d("", !0)
146
+ ])) : d("", !0)
147
+ ], 512));
148
+ }
149
+ }), Z = /* @__PURE__ */ k(R, [["__scopeId", "data-v-ffa0deb7"]]);
150
+ export {
151
+ Z as InfiniteLoading,
152
+ Y as SvgIcon
153
+ };
@@ -0,0 +1 @@
1
+ (function(i,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@arco-design/web-vue")):typeof define=="function"&&define.amd?define(["exports","vue","@arco-design/web-vue"],e):(i=typeof globalThis<"u"?globalThis:i||self,e(i.ui={},i.Vue,i.webVue))})(this,function(i,e,k){"use strict";const I={class:"SvgIcon"},w=["href","fill"],B=e.defineComponent({__name:"SvgIcon",props:{prefix:{type:String,required:!1,default:"icon"},name:{type:String,required:!0,default:()=>""},color:{type:String,required:!1,default:"#333"}},setup(n){const t=n,o=e.computed(()=>`#${t.prefix??"icon"}-${t.name}`);return(s,r)=>(e.openBlock(),e.createElementBlock("svg",I,[e.createElementVNode("use",{href:o.value,fill:t.color},null,8,w)]))}}),m=(n,t)=>{const o=n.__vccOpts||n;for(const[s,r]of t)o[s]=r;return o},v=m(B,[["__scopeId","data-v-003a51d4"]]);function C(n){return e.getCurrentScope()?(e.onScopeDispose(n),!0):!1}function _(n){return typeof n=="function"?n():e.unref(n)}const V=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const x=n=>n!=null,d=()=>{},E=V?window:void 0;function u(n){var t;const o=_(n);return(t=o==null?void 0:o.$el)!=null?t:o}function M(){const n=e.ref(!1),t=e.getCurrentInstance();return t&&e.onMounted(()=>{n.value=!0},t),n}function N(n){const t=M();return e.computed(()=>(t.value,!!n()))}function O(n,t,o={}){const{root:s,rootMargin:r="0px",threshold:l=0,window:p=E,immediate:g=!0}=o,h=N(()=>p&&"IntersectionObserver"in p),W=e.computed(()=>{const a=_(n);return(Array.isArray(a)?a:[a]).map(u).filter(x)});let f=d;const c=e.ref(g),A=h.value?e.watch(()=>[W.value,u(s),c.value],([a,L])=>{if(f(),!c.value||!a.length)return;const S=new IntersectionObserver(t,{root:u(L),rootMargin:r,threshold:l});a.forEach(b=>b&&S.observe(b)),f=()=>{S.disconnect(),f=d}},{immediate:g,flush:"post"}):d,y=()=>{f(),A(),c.value=!1};return C(y),{isSupported:h,isActive:c,pause(){f(),c.value=!1},resume(){c.value=!0},stop:y}}const $={key:0,class:"loading"},q={key:1,class:"none"},T=m(e.defineComponent({__name:"InfiniteLoading",props:{loading:{type:Boolean,default:()=>!1},finished:{type:Boolean,default:()=>!1}},emits:["infinite"],setup(n,{emit:t}){const o=n,s=t,r=e.ref(null);return O(r,([{isIntersecting:l}])=>{l&&!o.loading&&!o.finished&&(console.log(l,"isIntersecting"),s("infinite"))},{threshold:0}),(l,p)=>(e.openBlock(),e.createElementBlock("div",{class:"infinite-loading",ref_key:"container",ref:r},[n.loading?(e.openBlock(),e.createElementBlock("div",$,[e.createVNode(e.unref(k.Spin),{tip:"数据加载中..."})])):e.createCommentVNode("",!0),n.finished?(e.openBlock(),e.createElementBlock("div",q,[e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-ffa0deb7"]]);i.InfiniteLoading=T,i.SvgIcon=v,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
package/dist/main.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { default as SvgIcon } from './components/SvgIcon.vue';
2
+ import { default as InfiniteLoading } from './components/InfiniteLoading.vue';
3
+ export { SvgIcon, InfiniteLoading };
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ .SvgIcon[data-v-003a51d4]{width:1em;height:1em}.infinite-loading .loading[data-v-ffa0deb7]{display:flex;align-items:center;justify-content:center}.infinite-loading .loading .text[data-v-ffa0deb7]{color:#999;font-size:16px}.infinite-loading .none[data-v-ffa0deb7]{display:flex;align-items:center;justify-content:center}.infinite-loading .none .text[data-v-ffa0deb7]{color:#999;font-size:14px}
package/dist/vite.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@huyooo/ui",
3
+ "private": false,
4
+ "version": "0.1.1",
5
+ "type": "module",
6
+ "main": "dist/index.umd.js",
7
+ "module": "dist/index.js",
8
+ "types": "dist/main.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "scripts": {
13
+ "dev": "vite",
14
+ "build": "vue-tsc -b && vite build",
15
+ "preview": "vite preview",
16
+ "pub": "npm version patch --force && npm publish --access public"
17
+ },
18
+ "dependencies": {
19
+ "@arco-design/web-vue": "^2.56.3",
20
+ "@iconify/vue": "^4.1.2",
21
+ "@vueuse/core": "^11.3.0",
22
+ "vue": "^3.4.37"
23
+ },
24
+ "devDependencies": {
25
+ "@types/node": "^22.5.1",
26
+ "@vitejs/plugin-vue": "^5.1.2",
27
+ "less": "^4.2.0",
28
+ "typescript": "^5.5.3",
29
+ "vite": "^5.4.1",
30
+ "vite-plugin-dts": "^4.0.3",
31
+ "vue-tsc": "^2.0.29"
32
+ },
33
+ "peerDependencies": {
34
+ "@arco-design/web-vue": "^2.56.3"
35
+ },
36
+ "gitHead": "ea991d56ec67ecdebabc5b1e91ff2ae990152b1e"
37
+ }