@neatui/vue 2.17.3 → 3.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.
Files changed (29) hide show
  1. package/.prettierrc +12 -0
  2. package/README.md +82 -0
  3. package/package.json +7 -4
  4. package/src/components/basic/IFollowView.vue +47 -34
  5. package/src/components/basic/IPickerView.vue +16 -8
  6. package/src/components/basic/IRouterView.vue +133 -74
  7. package/src/components/basic/IScrollView.vue +110 -93
  8. package/src/components/basic/LayerView/Layer.vue +33 -24
  9. package/src/components/basic/LayerView/index.ts +3 -1
  10. package/src/components/form/DateView@v3.vue +2 -1
  11. package/src/components/form/Input@v3.vue +9 -6
  12. package/src/components/form/{Textarea.vue → TextArea.vue} +3 -3
  13. package/src/components/loader/FormLoader/FormLoader.vue +29 -4
  14. package/src/components/loader/LayerLoader/LayerLoader.vue +2 -1
  15. package/src/components/loader/LimitLoader/LimitLoader@v3.vue +3 -3
  16. package/src/components/loader/TableLoader/TableLoader.vue +3 -3
  17. package/src/components/loader/index.ts +1 -1
  18. package/src/components/tools/FormDraftsView.vue +15 -11
  19. package/src/components/tools/FormVerifyView.vue +4 -3
  20. package/src/components/tools/MoreTools.vue +4 -3
  21. package/src/components/tools/Pagination@a.vue +74 -38
  22. package/src/components/tools/Pagination@b.vue +2 -1
  23. package/src/store/frame.ts +18 -10
  24. package/src/utils/theme.ts +3 -0
  25. package/src/components/basic/follow.ts +0 -133
  26. package/src/components/loader/FormLoader/FormLoader@v2.vue +0 -422
  27. package/src/components/loader/FormLoader/NodeLoader.vue +0 -85
  28. package/src/components/loader/FormLoader@v1/FormLoader.vue +0 -506
  29. package/src/components/loader/FormLoader@v1/FormRender.vue +0 -302
package/.prettierrc ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/prettierrc",
3
+ "semi": true,
4
+ "arrowParens": "always",
5
+ "trailingComma": "all",
6
+ "singleQuote": true,
7
+ "printWidth": 180,
8
+ "tabWidth": 2,
9
+ "bracketSameLine": false,
10
+ "vueIndentScriptAndStyle": true,
11
+ "htmlWhitespaceSensitivity": "ignore"
12
+ }
package/README.md CHANGED
@@ -1,3 +1,85 @@
1
1
  # @neatui/vue
2
2
 
3
+ NeatUI Vue component package for Vue 3 and Nuxt projects.
4
+
5
+ `@neatui/vue` is the maintained component package. `@neatui/nuxt` has stopped maintenance as of 2026-05-26; Nuxt users should use `@neatui/vue` directly.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @neatui/css @neatui/vue
11
+ ```
12
+
13
+ ## Vue Usage
14
+
15
+ Import the style package once in your app entry:
16
+
17
+ ```ts
18
+ import '@neatui/css';
19
+ ```
20
+
21
+ Import components from `@neatui/vue`:
22
+
23
+ ```vue
24
+ <template>
25
+ <Input v-model="value" placeholder="Enter text" />
26
+ </template>
27
+
28
+ <script setup lang="ts">
29
+ import { ref } from 'vue';
30
+ import { Input } from '@neatui/vue';
31
+
32
+ const value = ref('');
33
+ </script>
34
+ ```
35
+
36
+ ## Nuxt Usage
37
+
38
+ Import the style package from a Nuxt app stylesheet:
39
+
40
+ ```scss
41
+ /* app/assets/css/main.scss */
42
+ @use '@neatui/css' as *;
43
+ ```
44
+
45
+ Register the stylesheet in `nuxt.config.ts`:
46
+
47
+ ```ts
48
+ export default defineNuxtConfig({
49
+ css: ['@/assets/css/main.scss'],
50
+ });
51
+ ```
52
+
53
+ Use explicit component imports:
54
+
55
+ ```vue
56
+ <template>
57
+ <FormLoader :form="form" :data="data" />
58
+ </template>
59
+
60
+ <script setup lang="ts">
61
+ import { reactive } from 'vue';
62
+ import { FormLoader } from '@neatui/vue';
63
+
64
+ const form = [
65
+ { label: 'Name', field: 'name' },
66
+ ];
67
+
68
+ const data = reactive({
69
+ name: '',
70
+ });
71
+ </script>
72
+ ```
73
+
74
+ ## Migration From @neatui/nuxt
75
+
76
+ ```diff
77
+ - import { Input, FormLoader, Pagination } from '@neatui/nuxt';
78
+ + import { Input, FormLoader, Pagination } from '@neatui/vue';
79
+ ```
80
+
81
+ `@neatui/nuxt` should be removed from new Nuxt projects.
82
+
83
+ ## Documentation
84
+
3
85
  [http://neatui.fekit.cn](http://neatui.fekit.cn)
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@neatui/vue",
3
- "version": "2.17.3",
3
+ "version": "3.0.0",
4
4
  "description": "basic component ui",
5
5
  "main": "./src/index.ts",
6
6
  "license": "MIT",
7
7
  "author": "xiaojunbo",
8
8
  "peerDependencies": {
9
- "vue": "^3.2.0"
9
+ "vue": "^3.2.0",
10
+ "vue-router": "^4.0.0"
10
11
  },
11
12
  "scripts": {
12
13
  "build": "rollup -c rollup.config.js"
@@ -17,7 +18,9 @@
17
18
  "postcss-scss": "^4.0.9",
18
19
  "rollup-plugin-scss": "^4.0.0",
19
20
  "rollup-plugin-terser": "^7.0.2",
20
- "typescript": "^5.1.6"
21
+ "typescript": "^5.1.6",
22
+ "vue": "^3.5.18",
23
+ "vue-router": "^4.5.1"
21
24
  },
22
25
  "dependencies": {
23
26
  "@fekit/floor": "^3.0.1",
@@ -27,7 +30,7 @@
27
30
  "@fekit/scale": "^2.0.1",
28
31
  "@fekit/scrollto": "^3.0.3",
29
32
  "@fekit/toast": "^2.7.2",
30
- "@fekit/utils": "^4.3.1",
33
+ "@fekit/utils": "^6.0.0",
31
34
  "@neatui/css": "^3.15.0",
32
35
  "@rollup/plugin-commonjs": "^26.0.1",
33
36
  "@rollup/plugin-node-resolve": "^15.2.3",
@@ -1,35 +1,39 @@
1
1
  <template>
2
2
  <div ref="dom" :class="btnClass" :style="btnStyle" @click="toggle" @mouseover="hovershow" @mouseout="hoverhide">
3
3
  <slot>
4
- <button ui-btn="@a s case :border"><i class="icon icon-dropdown"></i></button>
4
+ <button ui-btn="@a s case :border">
5
+ <i class="icon icon-dropdown"></i>
6
+ </button>
5
7
  </slot>
6
- </div>
7
- <Teleport v-if="$slots.tips" to="#ifollow">
8
- <div
9
- ref="tip"
10
- :class="`${tipClass}${mobile ? ' fekit-follow-mobile' : ''}`"
11
- :style="`position: fixed; pointer-events: none; ${tipStyle}`"
12
- ui-tips="@a"
13
- :ui-tips-view="state.show ? 1 : 0"
14
- @mouseover="hovershow"
15
- @mouseout="hoverhide"
16
- @click="clickhide"
17
- >
18
- <div ref="box" :ui-tips-box="state.pos" :class="tipBoxClass" :style="tipBoxStyle">
19
- <div ui-hide=">mob" class="mob-follow-tips w-full n-ss" ui-flex="row xm">
20
- <div class="w-sm"></div>
21
- <div>
22
- <h5 class="bold">{{ title }}</h5>
23
- </div>
24
- <div class="w-sm" ui-flex="row rm">
25
- <button ui-btn="@a none s :square" @click="toggle"><i class="icon icon-close"></i></button>
8
+ <Teleport v-if="teleportReady && $slots.tips" to="#ifollow">
9
+ <div
10
+ ref="tip"
11
+ :class="`${tipClass}${mobile ? ' fekit-follow-mobile' : ''}`"
12
+ :style="`position: fixed; pointer-events: none; ${tipStyle}`"
13
+ ui-tips="@a"
14
+ :ui-tips-view="state.show ? 1 : 0"
15
+ @mouseover="hovershow"
16
+ @mouseout="hoverhide"
17
+ @click="clickhide"
18
+ >
19
+ <div ref="box" :ui-tips-box="state.pos" :class="tipBoxClass" :style="tipBoxStyle">
20
+ <div ui-hide=">mob" class="mob-follow-tips w-full n-ss" ui-flex="row xm">
21
+ <div class="w-sm"></div>
22
+ <div>
23
+ <h5 class="bold">{{ title }}</h5>
24
+ </div>
25
+ <div class="w-sm" ui-flex="row rm">
26
+ <button ui-btn="@a none s :square" @click="toggle">
27
+ <i class="icon icon-close"></i>
28
+ </button>
29
+ </div>
26
30
  </div>
31
+ <slot name="tips"></slot>
32
+ <div v-if="arrow" ui-tips-arrow="" v-bind="arrow"></div>
27
33
  </div>
28
- <slot name="tips"></slot>
29
- <div v-if="arrow" ui-tips-arrow="" v-bind="arrow"></div>
30
34
  </div>
31
- </div>
32
- </Teleport>
35
+ </Teleport>
36
+ </div>
33
37
  </template>
34
38
  <script setup lang="ts">
35
39
  import { reactive, ref, onMounted, onUnmounted, watch } from 'vue';
@@ -37,13 +41,6 @@
37
41
 
38
42
  const emits = defineEmits(['update:modelValue', 'onhide', 'onshow']);
39
43
 
40
- const area: any = document.querySelector('#ifollow');
41
- if (!area) {
42
- const el = document.createElement('div');
43
- el.id = 'ifollow';
44
- document.body.appendChild(el);
45
- }
46
-
47
44
  // 类型
48
45
  interface Props {
49
46
  modelValue?: string | number;
@@ -81,6 +78,7 @@
81
78
  const dom: any = ref(null);
82
79
  const tip: any = ref(null);
83
80
  const box: any = ref(null);
81
+ const teleportReady = ref(false);
84
82
  const state = reactive({
85
83
  view: 0,
86
84
  show: 0,
@@ -171,11 +169,26 @@
171
169
  }
172
170
  };
173
171
 
172
+ const ensureTeleportTarget = () => {
173
+ let area = document.querySelector('#ifollow');
174
+ if (!area) {
175
+ area = document.createElement('div');
176
+ area.id = 'ifollow';
177
+ document.body.appendChild(area);
178
+ }
179
+ teleportReady.value = true;
180
+ };
181
+
174
182
  onMounted(() => {
183
+ ensureTeleportTarget();
175
184
  document.addEventListener('click', cancel, true);
176
185
  // 添加触摸事件监听器以防止页面滚动
177
- document.addEventListener('touchstart', preventTouchScroll, { passive: false });
178
- document.addEventListener('touchmove', preventTouchScroll, { passive: false });
186
+ document.addEventListener('touchstart', preventTouchScroll, {
187
+ passive: false,
188
+ });
189
+ document.addEventListener('touchmove', preventTouchScroll, {
190
+ passive: false,
191
+ });
179
192
  // 判断是否为移动端
180
193
  state.isMobile = window.innerWidth < 800;
181
194
  });
@@ -2,7 +2,7 @@
2
2
  <div ref="dom" :class="btnClass" :style="btnStyle" class="fekit-picker-button" data-aaa="111" @click="toggle">
3
3
  <slot></slot>
4
4
  </div>
5
- <Teleport to="#fekit">
5
+ <Teleport v-if="teleportReady" to="#fekit">
6
6
  <div v-if="state.view" :view="state.view" am-view="am" class="fekit-picker">
7
7
  <div :ui-flex="`col cb`" class="fekit-picker-wrap" @animationend="anim" @click="_sys_hide">
8
8
  <div class="picker bg-fore picker-virtual-key">
@@ -14,6 +14,7 @@
14
14
  </template>
15
15
  <script lang="ts" setup>
16
16
  import { reactive, ref, onMounted } from 'vue';
17
+ import { env } from '@fekit/utils';
17
18
 
18
19
  // 回调合集
19
20
  const on: any = {
@@ -23,13 +24,19 @@
23
24
  none() {}
24
25
  };
25
26
 
26
- const area: any = document.querySelector('#fekit');
27
- if (!area) {
28
- const el = document.createElement('div');
29
- el.id = 'fekit';
30
- el.style.position = 'absolute';
31
- document.body.appendChild(el);
32
- }
27
+ const teleportReady = ref(false);
28
+
29
+ const ensureTeleportTarget = () => {
30
+ if (!env.client) return;
31
+ const area: any = document.querySelector('#fekit');
32
+ if (!area) {
33
+ const el = document.createElement('div');
34
+ el.id = 'fekit';
35
+ el.style.position = 'absolute';
36
+ document.body.appendChild(el);
37
+ }
38
+ teleportReady.value = true;
39
+ };
33
40
  const emits = defineEmits(['update:modelValue', 'show', 'hide']);
34
41
  const props = defineProps({
35
42
  btnClass: { type: String, default: 'dib' },
@@ -91,6 +98,7 @@
91
98
  };
92
99
 
93
100
  onMounted(() => {
101
+ ensureTeleportTarget();
94
102
  document.addEventListener('click', cancel, true);
95
103
  });
96
104