fo-vue-ui 0.0.0

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.
@@ -0,0 +1,3 @@
1
+ {
2
+ "recommendations": ["Vue.volar"]
3
+ }
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 @@
1
+ .ceshicomp[data-v-80063cdc]{width:100px;height:100px;background:red}
@@ -0,0 +1,21 @@
1
+ import { createElementBlock as s, openBlock as a } from "vue";
2
+ const i = (e, c) => {
3
+ const o = e.__vccOpts || e;
4
+ for (const [t, n] of c)
5
+ o[t] = n;
6
+ return o;
7
+ }, p = { class: "ceshicomp" }, r = {
8
+ __name: "ceshicomp",
9
+ props: { name: "ceshicomp" },
10
+ setup(e) {
11
+ return (c, o) => (a(), s("div", p, "123"));
12
+ }
13
+ }, _ = /* @__PURE__ */ i(r, [["__scopeId", "data-v-80063cdc"]]), m = [_], d = (e) => {
14
+ m.forEach((c) => {
15
+ c.name && e.component(c.name, c);
16
+ });
17
+ };
18
+ typeof window < "u" && "Vue" in window && d(window.Vue);
19
+ export {
20
+ d as default
21
+ };
@@ -0,0 +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}));
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/index.html ADDED
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>fo-vue-ui</title>
8
+ </head>
9
+ <body>
10
+ <div id="app"></div>
11
+ <script type="module" src="/src/main.ts"></script>
12
+ </body>
13
+ </html>
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "fo-vue-ui",
3
+ "private": false,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "main": "dist/fo-vue-ui.umd.cjs",
7
+ "scripts": {
8
+ "dev": "vite",
9
+ "build": "vue-tsc -b && vite build",
10
+ "preview": "vite preview"
11
+ },
12
+ "dependencies": {
13
+ "vue": "^3.5.24"
14
+ },
15
+ "devDependencies": {
16
+ "@types/node": "^24.10.1",
17
+ "@vitejs/plugin-vue": "^6.0.1",
18
+ "@vue/tsconfig": "^0.8.1",
19
+ "sass": "^1.77.8",
20
+ "typescript": "~5.9.3",
21
+ "vite": "^7.2.4",
22
+ "vue-tsc": "^3.1.4"
23
+ }
24
+ }
@@ -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/src/App.vue ADDED
@@ -0,0 +1,3 @@
1
+ <template></template>
2
+ <script setup lang="ts"></script>
3
+ <style scoped></style>
@@ -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="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
@@ -0,0 +1,5 @@
1
+ .ceshicomp {
2
+ width: 100px;
3
+ height: 100px;
4
+ background: red;
5
+ }
@@ -0,0 +1,17 @@
1
+ <!-- <script>
2
+ export default {
3
+ name: "ceshicomp",
4
+ }
5
+ </script> -->
6
+
7
+ <template>
8
+ <div class="ceshicomp">123</div>
9
+ </template>
10
+
11
+ <script setup>
12
+ defineProps({ name: "ceshicomp" })
13
+ </script>
14
+
15
+ <style scoped lang="scss">
16
+ @import "./ceshicomp.scss";
17
+ </style>
@@ -0,0 +1,25 @@
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
+ }
@@ -0,0 +1,182 @@
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>
@@ -0,0 +1,18 @@
1
+ import ceshicomp from "./ceshicomp/ceshicomp.vue"
2
+ import type { App } from "vue"
3
+
4
+ const components = [ceshicomp]
5
+
6
+ const install = (app: App) => {
7
+ components.forEach((component) => {
8
+ if (component.name) {
9
+ app.component(component.name, component)
10
+ }
11
+ })
12
+ }
13
+
14
+ if (typeof window !== "undefined" && "Vue" in window) {
15
+ install(window.Vue as App)
16
+ }
17
+
18
+ export default install
@@ -0,0 +1,6 @@
1
+ .scrollWrap{
2
+ width:100%;
3
+ height: 100%;
4
+ padding-right: 10px;
5
+ @include scrollLine;
6
+ }
@@ -0,0 +1,17 @@
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>
package/src/main.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { createApp } from 'vue'
2
+ import './style.css'
3
+ import App from './App.vue'
4
+
5
+ createApp(App).mount('#app')
package/src/style.css ADDED
@@ -0,0 +1,3 @@
1
+ body {
2
+ font-size: 10px;
3
+ }
package/src/vue.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ declare module "*.vue" {
2
+ import type { DefineComponent } from "vue"
3
+ // 泛型参数依次为:props类型、emit类型、组件实例类型、slots类型等,unknown表示不做严格限制
4
+ const component: DefineComponent<{}, {}, unknown>
5
+ export default component
6
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "extends": "@vue/tsconfig/tsconfig.dom.json",
3
+ "compilerOptions": {
4
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5
+ "types": ["vite/client"],
6
+
7
+ /* Linting */
8
+ "strict": true,
9
+ "noUnusedLocals": true,
10
+ "noUnusedParameters": true,
11
+ "erasableSyntaxOnly": true,
12
+ "noFallthroughCasesInSwitch": true,
13
+ "noUncheckedSideEffectImports": true,
14
+ "moduleResolution": "node", // 采用Node.js模块解析规则,适配.vue模块导入
15
+ "esModuleInterop": true, // 兼容CommonJS模块,避免导入.vue文件时出现模块格式冲突
16
+ "resolveJsonModule": true // 支持导入json文件,同时辅助完善模块解析链
17
+ },
18
+ "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "src/**/*.d.ts"]
19
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ { "path": "./tsconfig.app.json" },
5
+ { "path": "./tsconfig.node.json" }
6
+ ]
7
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
+ "target": "ES2023",
5
+ "lib": ["ES2023"],
6
+ "module": "ESNext",
7
+ "types": ["node"],
8
+ "skipLibCheck": true,
9
+
10
+ /* Bundler mode */
11
+ "moduleResolution": "bundler",
12
+ "allowImportingTsExtensions": true,
13
+ "verbatimModuleSyntax": true,
14
+ "moduleDetection": "force",
15
+ "noEmit": true,
16
+
17
+ /* Linting */
18
+ "strict": true,
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true,
21
+ "erasableSyntaxOnly": true,
22
+ "noFallthroughCasesInSwitch": true,
23
+ "noUncheckedSideEffectImports": true
24
+ },
25
+ "include": ["vite.config.ts"]
26
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,22 @@
1
+ import { defineConfig } from "vite"
2
+ import vue from "@vitejs/plugin-vue"
3
+
4
+ // https://vite.dev/config/
5
+ export default defineConfig({
6
+ plugins: [vue()],
7
+ build: {
8
+ lib: {
9
+ entry: "src/components/index.ts",
10
+ name: "fo-vue-ui", // 库名
11
+ fileName: "fo-vue-ui", // 输出文件名,打包后dist文件夹中生成的文件
12
+ },
13
+ rollupOptions: {
14
+ external: ["vue"], // 排除依赖包
15
+ output: {
16
+ globals: {
17
+ vue: "Vue",
18
+ },
19
+ },
20
+ },
21
+ },
22
+ })