fo-vue-ui 0.0.0 → 0.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/dist/fo-vue-ui.js +11 -11
- package/dist/fo-vue-ui.umd.cjs +1 -1
- package/package.json +1 -1
- package/src/App.vue +8 -2
- package/src/components/index.ts +1 -0
- package/tsconfig.app.json +6 -6
- package/tsconfig.app.tsbuildinfo +1 -0
- package/tsconfig.node.json +3 -5
- package/tsconfig.node.tsbuildinfo +1 -0
- package/src/components/foIcon/foIcon.scss +0 -25
- package/src/components/foIcon/foIcon.vue +0 -182
- package/src/components/scrollWrap/scrollWrap.scss +0 -6
- package/src/components/scrollWrap/scrollWrap.vue +0 -17
package/dist/fo-vue-ui.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { createElementBlock as s, openBlock as a } from "vue";
|
|
2
|
-
const i = (e,
|
|
3
|
-
const
|
|
4
|
-
for (const [
|
|
5
|
-
|
|
6
|
-
return
|
|
2
|
+
const i = (e, o) => {
|
|
3
|
+
const c = e.__vccOpts || e;
|
|
4
|
+
for (const [n, t] of o)
|
|
5
|
+
c[n] = t;
|
|
6
|
+
return c;
|
|
7
7
|
}, p = { class: "ceshicomp" }, r = {
|
|
8
8
|
__name: "ceshicomp",
|
|
9
9
|
props: { name: "ceshicomp" },
|
|
10
10
|
setup(e) {
|
|
11
|
-
return (
|
|
11
|
+
return (o, c) => (a(), s("div", p, "123"));
|
|
12
12
|
}
|
|
13
|
-
}, _ = /* @__PURE__ */ i(r, [["__scopeId", "data-v-80063cdc"]]), m = [_],
|
|
14
|
-
m.forEach((
|
|
15
|
-
|
|
13
|
+
}, _ = /* @__PURE__ */ i(r, [["__scopeId", "data-v-80063cdc"]]), m = [_], l = (e) => {
|
|
14
|
+
m.forEach((o) => {
|
|
15
|
+
console.log("install component", o.name), o.name && e.component(o.name, o);
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
|
-
typeof window < "u" && "Vue" in window &&
|
|
18
|
+
typeof window < "u" && "Vue" in window && l(window.Vue);
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
l as default
|
|
21
21
|
};
|
package/dist/fo-vue-ui.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o(require("vue")):typeof define=="function"&&define.amd?define(["vue"],o):(e=typeof globalThis<"u"?globalThis:e||self,e["fo-vue-ui"]=o(e.Vue))})(this,(function(e){"use strict";const o=(c,n)=>{const t=c.__vccOpts||c;for(const[p,u]of n)t[p]=u;return t},i={class:"ceshicomp"},f=[o({__name:"ceshicomp",props:{name:"ceshicomp"},setup(c){return(n,t)=>(e.openBlock(),e.createElementBlock("div",i,"123"))}},[["__scopeId","data-v-80063cdc"]])],s=c=>{f.forEach(n=>{n.name&&c.component(n.name,n)})};return typeof window<"u"&&"Vue"in window&&s(window.Vue),s}));
|
|
1
|
+
(function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o(require("vue")):typeof define=="function"&&define.amd?define(["vue"],o):(e=typeof globalThis<"u"?globalThis:e||self,e["fo-vue-ui"]=o(e.Vue))})(this,(function(e){"use strict";const o=(c,n)=>{const t=c.__vccOpts||c;for(const[p,u]of n)t[p]=u;return t},i={class:"ceshicomp"},f=[o({__name:"ceshicomp",props:{name:"ceshicomp"},setup(c){return(n,t)=>(e.openBlock(),e.createElementBlock("div",i,"123"))}},[["__scopeId","data-v-80063cdc"]])],s=c=>{f.forEach(n=>{console.log("install component",n.name),n.name&&c.component(n.name,n)})};return typeof window<"u"&&"Vue"in window&&s(window.Vue),s}));
|
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
<template
|
|
2
|
-
<
|
|
1
|
+
<template>
|
|
2
|
+
<div class="app">
|
|
3
|
+
<ceshicomp></ceshicomp>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
<script setup lang="ts">
|
|
7
|
+
import ceshicomp from "./components/ceshicomp/ceshicomp.vue"
|
|
8
|
+
</script>
|
|
3
9
|
<style scoped></style>
|
package/src/components/index.ts
CHANGED
package/tsconfig.app.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
4
|
+
//"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
5
5
|
"types": ["vite/client"],
|
|
6
6
|
|
|
7
7
|
/* Linting */
|
|
8
8
|
"strict": true,
|
|
9
9
|
"noUnusedLocals": true,
|
|
10
10
|
"noUnusedParameters": true,
|
|
11
|
-
|
|
11
|
+
// 移除:无效的 erasableSyntaxOnly 字段
|
|
12
12
|
"noFallthroughCasesInSwitch": true,
|
|
13
|
-
|
|
14
|
-
"moduleResolution": "node",
|
|
15
|
-
"esModuleInterop": true,
|
|
16
|
-
"resolveJsonModule": true
|
|
13
|
+
// 移除:非 tsconfig 配置的 noUncheckedSideEffectImports 字段
|
|
14
|
+
"moduleResolution": "node",
|
|
15
|
+
"esModuleInterop": true,
|
|
16
|
+
"resolveJsonModule": true
|
|
17
17
|
},
|
|
18
18
|
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "src/**/*.d.ts"]
|
|
19
19
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["./src/main.ts","./src/vue.d.ts","./src/components/index.ts","./src/app.vue","./src/components/ceshicomp/ceshicomp.vue"],"version":"5.9.3"}
|
package/tsconfig.node.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
-
"target": "
|
|
3
|
+
//"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
+
"target": "es2020",
|
|
5
5
|
"lib": ["ES2023"],
|
|
6
6
|
"module": "ESNext",
|
|
7
7
|
"types": ["node"],
|
|
@@ -18,9 +18,7 @@
|
|
|
18
18
|
"strict": true,
|
|
19
19
|
"noUnusedLocals": true,
|
|
20
20
|
"noUnusedParameters": true,
|
|
21
|
-
"
|
|
22
|
-
"noFallthroughCasesInSwitch": true,
|
|
23
|
-
"noUncheckedSideEffectImports": true
|
|
21
|
+
"noFallthroughCasesInSwitch": true
|
|
24
22
|
},
|
|
25
23
|
"include": ["vite.config.ts"]
|
|
26
24
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["./vite.config.ts"],"version":"5.9.3"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
.iconPage {
|
|
2
|
-
opacity: 1;
|
|
3
|
-
color: inherit;
|
|
4
|
-
}
|
|
5
|
-
.deg0 {
|
|
6
|
-
transform: rotate(0deg);
|
|
7
|
-
}
|
|
8
|
-
.deg1 {
|
|
9
|
-
transform: rotate(60deg);
|
|
10
|
-
}
|
|
11
|
-
.deg2 {
|
|
12
|
-
transform: rotate(120deg);
|
|
13
|
-
}
|
|
14
|
-
.deg3 {
|
|
15
|
-
transform: rotate(180deg);
|
|
16
|
-
}
|
|
17
|
-
.deg4 {
|
|
18
|
-
transform: rotate(240deg);
|
|
19
|
-
}
|
|
20
|
-
.deg5 {
|
|
21
|
-
transform: rotate(300deg);
|
|
22
|
-
}
|
|
23
|
-
.disappear {
|
|
24
|
-
opacity: 0;
|
|
25
|
-
}
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="logo"
|
|
4
|
-
ref="iconRef"
|
|
5
|
-
:theme="theme"
|
|
6
|
-
:size="sizeValue"
|
|
7
|
-
:fill="fillValue"
|
|
8
|
-
class="iconPage"
|
|
9
|
-
:class="{
|
|
10
|
-
deg0: degDis === 0,
|
|
11
|
-
deg1: degDis === 1,
|
|
12
|
-
deg2: degDis === 2,
|
|
13
|
-
deg3: degDis === 3,
|
|
14
|
-
deg4: degDis === 4,
|
|
15
|
-
deg5: degDis === 5,
|
|
16
|
-
disappear: isDisappear
|
|
17
|
-
}"
|
|
18
|
-
/>
|
|
19
|
-
</template>
|
|
20
|
-
|
|
21
|
-
<script setup>
|
|
22
|
-
import { ref, watch, onMounted, onUnmounted, computed, nextTick } from 'vue'
|
|
23
|
-
defineOptions({
|
|
24
|
-
name: 'FoIcon'
|
|
25
|
-
})
|
|
26
|
-
const props = defineProps({
|
|
27
|
-
logo: { type: String, default: 'icon-emotion-happy' },
|
|
28
|
-
theme: { type: String, default: 'outline' },
|
|
29
|
-
size: { type: String, default: '' },
|
|
30
|
-
fill: { type: String, default: '' },
|
|
31
|
-
isShine: { type: Boolean, default: false },
|
|
32
|
-
isRotate: { type: Boolean, default: false }
|
|
33
|
-
})
|
|
34
|
-
onMounted(() => {
|
|
35
|
-
initStyleObserver()
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
onUnmounted(() => {
|
|
39
|
-
clearShineTimer()
|
|
40
|
-
clearRotateTimer()
|
|
41
|
-
destroyStyleObserver()
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
const iconRef = ref(null)
|
|
45
|
-
const styleUpdateFlag = ref(0)
|
|
46
|
-
let iconElement = null
|
|
47
|
-
let styleObserver = null
|
|
48
|
-
let parentObserver = null
|
|
49
|
-
const fillValue = computed(() => {
|
|
50
|
-
styleUpdateFlag.value
|
|
51
|
-
if (props.fill) {
|
|
52
|
-
return props.fill
|
|
53
|
-
} else {
|
|
54
|
-
if (iconElement) {
|
|
55
|
-
const domStyle = window.getComputedStyle(iconElement)
|
|
56
|
-
return domStyle.getPropertyValue('color')
|
|
57
|
-
} else {
|
|
58
|
-
return '#888'
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
})
|
|
62
|
-
const sizeValue = computed(() => {
|
|
63
|
-
styleUpdateFlag.value
|
|
64
|
-
if (props.size) {
|
|
65
|
-
return props.size
|
|
66
|
-
} else {
|
|
67
|
-
if (iconElement) {
|
|
68
|
-
const domStyle = window.getComputedStyle(iconElement)
|
|
69
|
-
return domStyle.getPropertyValue('font-size')
|
|
70
|
-
} else {
|
|
71
|
-
return '1rem'
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
})
|
|
75
|
-
async function initStyleObserver() {
|
|
76
|
-
await nextTick() // 等待 DOM 完全渲染
|
|
77
|
-
iconElement = iconRef.value?.$el || iconRef.value
|
|
78
|
-
iconElement = iconElement instanceof Element ? iconElement : null
|
|
79
|
-
|
|
80
|
-
if (iconElement) {
|
|
81
|
-
styleObserver = new MutationObserver(() => {
|
|
82
|
-
plusStyleUpdateFlag()
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
styleObserver.observe(iconElement, {
|
|
86
|
-
attributes: true,
|
|
87
|
-
attributeFilter: ['class', 'style'], // 只监听这两个属性
|
|
88
|
-
attributeOldValue: false
|
|
89
|
-
})
|
|
90
|
-
|
|
91
|
-
const parentElement = iconElement.parentElement
|
|
92
|
-
if (parentElement) {
|
|
93
|
-
const parentObserver = new MutationObserver(() => {
|
|
94
|
-
plusStyleUpdateFlag()
|
|
95
|
-
})
|
|
96
|
-
parentObserver.observe(parentElement, {
|
|
97
|
-
attributes: true,
|
|
98
|
-
attributeFilter: ['class', 'style']
|
|
99
|
-
})
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
plusStyleUpdateFlag()
|
|
103
|
-
}
|
|
104
|
-
function destroyStyleObserver() {
|
|
105
|
-
if (styleObserver) {
|
|
106
|
-
styleObserver.disconnect()
|
|
107
|
-
styleObserver = null
|
|
108
|
-
}
|
|
109
|
-
if (parentObserver) {
|
|
110
|
-
parentObserver.disconnect()
|
|
111
|
-
parentObserver = null
|
|
112
|
-
}
|
|
113
|
-
iconElement = null
|
|
114
|
-
}
|
|
115
|
-
function plusStyleUpdateFlag() {
|
|
116
|
-
styleUpdateFlag.value = styleUpdateFlag.value > 9999 ? 0 : ++styleUpdateFlag.value
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
let shineTimer = NaN
|
|
120
|
-
const isDisappear = ref(false)
|
|
121
|
-
|
|
122
|
-
watch(
|
|
123
|
-
() => {
|
|
124
|
-
return props.isShine
|
|
125
|
-
},
|
|
126
|
-
(newV) => {
|
|
127
|
-
if (newV) {
|
|
128
|
-
clearShineTimer()
|
|
129
|
-
setShineTimer()
|
|
130
|
-
} else {
|
|
131
|
-
clearShineTimer()
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
{ immediate: true }
|
|
135
|
-
)
|
|
136
|
-
|
|
137
|
-
function setShineTimer() {
|
|
138
|
-
shineTimer = setInterval(() => {
|
|
139
|
-
isDisappear.value = !isDisappear.value
|
|
140
|
-
}, 1000)
|
|
141
|
-
}
|
|
142
|
-
function clearShineTimer() {
|
|
143
|
-
clearInterval(shineTimer)
|
|
144
|
-
shineTimer = NaN
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
let rotateTimer = NaN
|
|
148
|
-
const degDis = ref(0)
|
|
149
|
-
|
|
150
|
-
watch(
|
|
151
|
-
() => {
|
|
152
|
-
return props.isRotate
|
|
153
|
-
},
|
|
154
|
-
(newV) => {
|
|
155
|
-
if (newV) {
|
|
156
|
-
clearRotateTimer()
|
|
157
|
-
setRotateTimer()
|
|
158
|
-
} else {
|
|
159
|
-
clearRotateTimer()
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
{ immediate: true }
|
|
163
|
-
)
|
|
164
|
-
|
|
165
|
-
function setRotateTimer() {
|
|
166
|
-
rotateTimer = setInterval(() => {
|
|
167
|
-
if (degDis.value >= 5) {
|
|
168
|
-
degDis.value = 0
|
|
169
|
-
} else {
|
|
170
|
-
degDis.value++
|
|
171
|
-
}
|
|
172
|
-
}, 1000)
|
|
173
|
-
}
|
|
174
|
-
function clearRotateTimer() {
|
|
175
|
-
clearInterval(rotateTimer)
|
|
176
|
-
rotateTimer = NaN
|
|
177
|
-
}
|
|
178
|
-
</script>
|
|
179
|
-
|
|
180
|
-
<style scoped lang="scss">
|
|
181
|
-
@import './foIcon.scss';
|
|
182
|
-
</style>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
name: "ScrollWrap",
|
|
4
|
-
}
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<template>
|
|
8
|
-
<div class="scrollWrap">
|
|
9
|
-
<slot></slot>
|
|
10
|
-
</div>
|
|
11
|
-
</template>
|
|
12
|
-
<script setup>
|
|
13
|
-
defineProps({ name: "ScrollWrap" })
|
|
14
|
-
</script>
|
|
15
|
-
<style scoped lang="scss">
|
|
16
|
-
@import "./scrollWrap.scss";
|
|
17
|
-
</style>
|