@neatui/vue 3.1.0 → 4.0.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.
Files changed (52) hide show
  1. package/README.md +1 -10
  2. package/package.json +5 -2
  3. package/rollup.config.js +42 -2
  4. package/src/components/basic/IDraggable@b.vue +1 -1
  5. package/src/components/basic/IFollowView.vue +2 -2
  6. package/src/components/basic/LayerView/Layer.vue +193 -42
  7. package/src/components/display/Calendar.vue +6 -6
  8. package/src/components/display/CalendarReg.vue +6 -6
  9. package/src/components/display/PhotoEditor.vue +2 -2
  10. package/src/components/display/TreeView.vue +4 -3
  11. package/src/components/form/Cascader.vue +3 -3
  12. package/src/components/form/DatePicker.vue +2 -2
  13. package/src/components/form/{DateRangePicker@v3.vue → DateRangePicker.vue} +2 -1
  14. package/src/components/form/{DateRangeView@v3.vue → DateRangeView.vue} +11 -11
  15. package/src/components/form/DateView.vue +461 -82
  16. package/src/components/form/ImgUpload.vue +3 -3
  17. package/src/components/form/{MoreSelect@v3.vue → MoreSelect.vue} +1 -1
  18. package/src/components/form/MoreSelectList.vue +1 -1
  19. package/src/components/form/{MoreSelectPanel@v3.vue → MoreSelectPanel.vue} +1 -1
  20. package/src/components/form/MoreSelectPicker.vue +3 -3
  21. package/src/components/form/MoreSelectTags.vue +1 -1
  22. package/src/components/form/PageMoreSelect.vue +1 -1
  23. package/src/components/form/PageSelect.vue +1 -1
  24. package/src/components/form/SearchMoreSelect.vue +1 -1
  25. package/src/components/form/{SearchSelect@v3.vue → SearchSelect.vue} +1 -1
  26. package/src/components/form/{Select@v3.vue → Select.vue} +1 -1
  27. package/src/components/form/SelectList.vue +1 -1
  28. package/src/components/form/SelectPicker.vue +3 -3
  29. package/src/components/form/SelectTree/{SelectTree@v1.vue → SelectTree.vue} +1 -1
  30. package/src/components/form/Switch.vue +2 -1
  31. package/src/components/form/TimeView.vue +6 -6
  32. package/src/components/form/Upload.vue +22 -11
  33. package/src/components/form/index.ts +8 -8
  34. package/src/components/loader/FormLoader/FormLoader.vue +124 -103
  35. package/src/components/loader/LayerLoader/LayerLoader.vue +6 -7
  36. package/src/components/loader/LimitLoader/{LimitLoader@v3.vue → LimitLoader.vue} +4 -4
  37. package/src/components/loader/LimitLoader/index.ts +1 -1
  38. package/src/components/loader/TableLoader/TableLoader.vue +7 -7
  39. package/src/components/loader/TableLoader/TableRender.vue +0 -1
  40. package/src/components/loader/ViewLoader/{ViewLoader@v1.vue → ViewLoader.vue} +124 -103
  41. package/src/components/loader/ViewLoader/index.ts +1 -1
  42. package/src/components/tools/FormDraftsView.vue +4 -4
  43. package/src/components/tools/FormVerifyView.vue +2 -2
  44. package/src/components/tools/MoreTools.vue +5 -5
  45. package/src/components/tools/Pagination@a.vue +4 -4
  46. package/src/components/tools/Pagination@b.vue +4 -4
  47. package/tsconfig.json +1 -2
  48. package/src/components/form/DateView@v2.vue +0 -386
  49. package/src/components/form/DateView@v3.vue +0 -608
  50. package/src/components/tools/MoreTools@v2.vue +0 -74
  51. /package/src/components/form/{Input@v3.vue → Input.vue} +0 -0
  52. /package/src/components/form/{TextArea.vue → Textarea.vue} +0 -0
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  NeatUI Vue component package for Vue 3 and Nuxt projects.
4
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.
5
+ Nuxt users should use `@neatui/vue` directly.
6
6
 
7
7
  ## Installation
8
8
 
@@ -71,15 +71,6 @@ const data = reactive({
71
71
  </script>
72
72
  ```
73
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
74
  ## Documentation
84
75
 
85
76
  [http://neatui.fekit.cn](http://neatui.fekit.cn)
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@neatui/vue",
3
- "version": "3.1.0",
3
+ "version": "4.0.1",
4
4
  "description": "basic component ui",
5
5
  "main": "./src/index.ts",
6
6
  "license": "MIT",
7
7
  "author": "xiaojunbo",
8
8
  "peerDependencies": {
9
+ "pinia": "^3.0.3",
9
10
  "vue": "^3.2.0",
10
11
  "vue-router": "^4.0.0"
11
12
  },
@@ -15,9 +16,11 @@
15
16
  "devDependencies": {
16
17
  "@rollup/plugin-typescript": "^11.1.6",
17
18
  "@types/sortablejs": "^1.15.8",
19
+ "pinia": "^3.0.3",
18
20
  "postcss-scss": "^4.0.9",
19
21
  "rollup-plugin-scss": "^4.0.0",
20
22
  "rollup-plugin-terser": "^7.0.2",
23
+ "sass": "^1.80.7",
21
24
  "typescript": "^5.1.6",
22
25
  "vue": "^3.5.18",
23
26
  "vue-router": "^4.5.1"
@@ -31,7 +34,7 @@
31
34
  "@fekit/scrollto": "^3.0.3",
32
35
  "@fekit/toast": "^2.7.2",
33
36
  "@fekit/utils": "^6.0.0",
34
- "@neatui/css": "^3.15.0",
37
+ "@neatui/css": "^4.0.1",
35
38
  "@rollup/plugin-commonjs": "^26.0.1",
36
39
  "@rollup/plugin-node-resolve": "^15.2.3",
37
40
  "@vue/compiler-sfc": "^3.4.30",
package/rollup.config.js CHANGED
@@ -3,14 +3,40 @@ const commonjs = require('@rollup/plugin-commonjs');
3
3
  const vue = require('rollup-plugin-vue');
4
4
  const postcss = require('rollup-plugin-postcss');
5
5
  const typescript = require('@rollup/plugin-typescript');
6
+ const ts = require('typescript');
7
+ const path = require('path');
8
+ const { pathToFileURL } = require('url');
6
9
  const { terser } = require('rollup-plugin-terser');
7
10
  const scss = require('postcss-scss');
8
11
 
12
+ const vueTypeScript = () => ({
13
+ name: 'vue-typescript',
14
+ transform(code, id) {
15
+ if (!/\.vue\?.*type=script.*lang\.ts$/.test(id)) return null;
16
+
17
+ const result = ts.transpileModule(code, {
18
+ fileName: id,
19
+ compilerOptions: {
20
+ target: ts.ScriptTarget.ESNext,
21
+ module: ts.ModuleKind.ESNext,
22
+ sourceMap: true
23
+ }
24
+ });
25
+
26
+ return {
27
+ code: result.outputText,
28
+ map: result.sourceMapText ? JSON.parse(result.sourceMapText) : null
29
+ };
30
+ }
31
+ });
32
+
9
33
  module.exports = {
10
34
  input: 'src/components/loader/index.ts',
11
35
  output: {
12
36
  file: 'dist/bundle.js',
13
- format: 'es'
37
+ format: 'es',
38
+ inlineDynamicImports: true,
39
+ sourcemap: true
14
40
  },
15
41
  plugins: [
16
42
  resolve({
@@ -19,8 +45,22 @@ module.exports = {
19
45
  commonjs(),
20
46
  vue({
21
47
  css: false,
22
- compileTemplate: true
48
+ compileTemplate: true,
49
+ preprocessStyles: true,
50
+ preprocessOptions: {
51
+ scss: {
52
+ importers: [
53
+ {
54
+ findFileUrl(url) {
55
+ if (url !== '@neatui/css') return null;
56
+ return pathToFileURL(path.resolve(__dirname, '../css/neatui.scss'));
57
+ }
58
+ }
59
+ ]
60
+ }
61
+ }
23
62
  }),
63
+ vueTypeScript(),
24
64
  postcss({
25
65
  extensions: ['.css', '.scss'],
26
66
  extract: true,
@@ -4,7 +4,7 @@
4
4
  v-for="(item, idx) in list || []"
5
5
  :key="idx"
6
6
  style="user-select: none"
7
- class="drag-move-item b-solid bk-line b-xs n-sm"
7
+ class="drag-move-item b-solid b-line b-xs n-sm"
8
8
  :data-move-ing="state.__moveing"
9
9
  @mousedown="fMoveSta($event, list, idx)"
10
10
  @mousemove="fMoveIng($event, list, idx)"
@@ -18,11 +18,11 @@
18
18
  >
19
19
  <div ref="box" :ui-tips-box="state.pos" :class="tipBoxClass" :style="tipBoxStyle">
20
20
  <div ui-hide=">mob" class="mob-follow-tips w-full n-ss" ui-flex="row xm">
21
- <div class="w-sm"></div>
21
+ <div class="w-xs*s"></div>
22
22
  <div>
23
23
  <h5 class="bold">{{ title }}</h5>
24
24
  </div>
25
- <div class="w-sm" ui-flex="row rm">
25
+ <div class="w-xs*s" ui-flex="row rm">
26
26
  <button ui-btn="@a none s :square" @click="toggle">
27
27
  <i class="icon icon-close"></i>
28
28
  </button>
@@ -30,9 +30,195 @@
30
30
  return (window as any)._FEKIT_LAYER_TASKS;
31
31
  })();
32
32
 
33
- // 获取活跃的弹层
34
- const getActiveLayer = () => {
35
- return Object.values(_tasks).filter((task: any) => task.view > 0);
33
+ type InlineStyleSnapshot = {
34
+ hadProperty: boolean;
35
+ priority: string;
36
+ value: string;
37
+ };
38
+
39
+ type InlineStyleMutation = {
40
+ appliedPriority: string;
41
+ appliedValue: string;
42
+ element: HTMLElement;
43
+ property: string;
44
+ snapshot: InlineStyleSnapshot;
45
+ };
46
+
47
+ type ScrollLockSnapshot = {
48
+ body: HTMLElement;
49
+ bodyHadStyleAttribute: boolean;
50
+ mutations: Array<InlineStyleMutation>;
51
+ scrollX: number;
52
+ scrollY: number;
53
+ };
54
+
55
+ type ScrollLockState = {
56
+ owners: Set<object>;
57
+ snapshot?: ScrollLockSnapshot;
58
+ };
59
+
60
+ const SCROLL_LOCK_STATE = Symbol.for('@neatui/vue.Layer.scrollLock');
61
+
62
+ const getScrollLockState = (): ScrollLockState => {
63
+ if (!_tasks[SCROLL_LOCK_STATE]) {
64
+ Object.defineProperty(_tasks, SCROLL_LOCK_STATE, {
65
+ configurable: true,
66
+ value: {
67
+ owners: new Set<object>(),
68
+ },
69
+ });
70
+ }
71
+ return _tasks[SCROLL_LOCK_STATE];
72
+ };
73
+
74
+ const hasInlineProperty = (style: CSSStyleDeclaration, property: string) => {
75
+ for (let index = 0; index < style.length; index += 1) {
76
+ if (style.item(index) === property) return true;
77
+ }
78
+ return false;
79
+ };
80
+
81
+ const captureInlineProperty = (element: HTMLElement, property: string): InlineStyleSnapshot => ({
82
+ hadProperty: hasInlineProperty(element.style, property),
83
+ priority: element.style.getPropertyPriority(property),
84
+ value: element.style.getPropertyValue(property),
85
+ });
86
+
87
+ const matchesAppliedStyle = (mutation: InlineStyleMutation) => {
88
+ return (
89
+ mutation.element.style.getPropertyValue(mutation.property) === mutation.appliedValue &&
90
+ mutation.element.style.getPropertyPriority(mutation.property) === mutation.appliedPriority
91
+ );
92
+ };
93
+
94
+ const restoreInlineStyle = (mutation: InlineStyleMutation, force = false) => {
95
+ if (!force && !matchesAppliedStyle(mutation)) return;
96
+ if (mutation.snapshot.hadProperty) {
97
+ mutation.element.style.setProperty(mutation.property, mutation.snapshot.value, mutation.snapshot.priority);
98
+ } else {
99
+ mutation.element.style.removeProperty(mutation.property);
100
+ }
101
+ };
102
+
103
+ const removeEmptyStyleAttribute = (element: HTMLElement, previouslyPresent: boolean) => {
104
+ const inlineStyle = element.getAttribute('style');
105
+ if (!previouslyPresent && (element.style.length === 0 || inlineStyle === null || inlineStyle.trim() === '')) {
106
+ element.removeAttribute('style');
107
+ }
108
+ };
109
+
110
+ const applyLockedStyle = (
111
+ mutations: Array<InlineStyleMutation>,
112
+ element: HTMLElement,
113
+ property: string,
114
+ value: string,
115
+ ) => {
116
+ const appliedPriority = 'important';
117
+ if (element.style.getPropertyValue(property) === value && element.style.getPropertyPriority(property) === appliedPriority) {
118
+ return;
119
+ }
120
+ const mutation: InlineStyleMutation = {
121
+ appliedPriority,
122
+ appliedValue: value,
123
+ element,
124
+ property,
125
+ snapshot: captureInlineProperty(element, property),
126
+ };
127
+ mutations.push(mutation);
128
+ element.style.setProperty(property, value, appliedPriority);
129
+ // CSSOM 会规范化 -0px、颜色等值;恢复时以浏览器实际写入值判断所有权。
130
+ mutation.appliedValue = element.style.getPropertyValue(property);
131
+ mutation.appliedPriority = element.style.getPropertyPriority(property);
132
+ };
133
+
134
+ const restoreScrollPosition = (scrollX: number, scrollY: number) => {
135
+ const root = document.documentElement;
136
+ const rootHadStyleAttribute = root.hasAttribute('style');
137
+ const mutation: InlineStyleMutation = {
138
+ appliedPriority: 'important',
139
+ appliedValue: 'auto',
140
+ element: root,
141
+ property: 'scroll-behavior',
142
+ snapshot: captureInlineProperty(root, 'scroll-behavior'),
143
+ };
144
+
145
+ try {
146
+ root.style.setProperty(mutation.property, mutation.appliedValue, mutation.appliedPriority);
147
+ window.scrollTo(scrollX, scrollY);
148
+ } catch {
149
+ // 浏览器拒绝滚动时仍必须恢复临时写入的 html 样式。
150
+ } finally {
151
+ restoreInlineStyle(mutation);
152
+ removeEmptyStyleAttribute(root, rootHadStyleAttribute);
153
+ }
154
+ };
155
+
156
+ const acquireScrollLock = (owner: object) => {
157
+ if (!env.client || !document.body || !document.documentElement) return;
158
+ const lock = getScrollLockState();
159
+ if (lock.owners.has(owner)) return;
160
+ if (lock.owners.size > 0) {
161
+ lock.owners.add(owner);
162
+ return;
163
+ }
164
+
165
+ const body = document.body;
166
+ const root = document.documentElement;
167
+ const scrollbarWidth = root.clientWidth > 0 ? Math.max(0, window.innerWidth - root.clientWidth) : 0;
168
+ const computedPaddingRight = Number.parseFloat(window.getComputedStyle(body).paddingRight) || 0;
169
+ const snapshot: ScrollLockSnapshot = {
170
+ body,
171
+ bodyHadStyleAttribute: body.hasAttribute('style'),
172
+ mutations: [],
173
+ scrollX: window.scrollX || root.scrollLeft || body.scrollLeft || 0,
174
+ scrollY: window.scrollY || root.scrollTop || body.scrollTop || 0,
175
+ };
176
+
177
+ try {
178
+ // CSSOM 会把 overflow 简写展开成长属性;逐项持有才能无损恢复原先不同的 x/y 值和 priority。
179
+ applyLockedStyle(snapshot.mutations, body, 'overflow-x', 'hidden');
180
+ applyLockedStyle(snapshot.mutations, body, 'overflow-y', 'hidden');
181
+ applyLockedStyle(snapshot.mutations, body, 'position', 'fixed');
182
+ applyLockedStyle(snapshot.mutations, body, 'top', `-${snapshot.scrollY}px`);
183
+ applyLockedStyle(snapshot.mutations, body, 'left', `-${snapshot.scrollX}px`);
184
+ applyLockedStyle(snapshot.mutations, body, 'width', '100%');
185
+ if (scrollbarWidth > 0) {
186
+ applyLockedStyle(snapshot.mutations, body, 'padding-right', `${computedPaddingRight + scrollbarWidth}px`);
187
+ }
188
+ lock.snapshot = snapshot;
189
+ lock.owners.add(owner);
190
+ } catch {
191
+ for (const mutation of [...snapshot.mutations].reverse()) {
192
+ try {
193
+ restoreInlineStyle(mutation, true);
194
+ } catch {
195
+ // 单个 CSSOM 写入失败不能阻止其余属性回滚。
196
+ }
197
+ }
198
+ removeEmptyStyleAttribute(body, snapshot.bodyHadStyleAttribute);
199
+ lock.snapshot = undefined;
200
+ }
201
+ };
202
+
203
+ const releaseScrollLock = (owner: object) => {
204
+ if (!env.client) return;
205
+ const lock = getScrollLockState();
206
+ if (!lock.owners.delete(owner) || lock.owners.size > 0) return;
207
+ const snapshot = lock.snapshot;
208
+ lock.snapshot = undefined;
209
+ if (!snapshot) return;
210
+
211
+ for (const mutation of [...snapshot.mutations].reverse()) {
212
+ try {
213
+ restoreInlineStyle(mutation);
214
+ } catch {
215
+ // 继续恢复其余由 Layer 持有的属性。
216
+ }
217
+ }
218
+ removeEmptyStyleAttribute(snapshot.body, snapshot.bodyHadStyleAttribute);
219
+ restoreScrollPosition(snapshot.scrollX, snapshot.scrollY);
220
+ // 某些浏览器在 scrollTo 后会把已访问过的 CSSStyleDeclaration 重新序列化为空 style 属性。
221
+ removeEmptyStyleAttribute(snapshot.body, snapshot.bodyHadStyleAttribute);
36
222
  };
37
223
 
38
224
  // 类型定义
@@ -73,33 +259,8 @@
73
259
  const state = reactive({
74
260
  view: 0,
75
261
  params: {},
76
- top: 0,
77
- sw: 0,
78
262
  });
79
-
80
- function disableScroll() {
81
- if (!env.client) return;
82
- state.top = document.documentElement.scrollTop;
83
- const sw = window.innerWidth - document.documentElement.clientWidth;
84
- state.sw = sw;
85
- document.body.style.overflow = 'hidden';
86
- document.body.style.position = 'fixed';
87
- document.body.style.top = `-${state.top}px`;
88
- document.body.style.width = '100%';
89
- document.body.style.paddingRight = `${sw}px`;
90
- }
91
-
92
- function enableScroll() {
93
- if (!env.client) return;
94
- document.body.style.removeProperty('overflow');
95
- document.body.style.removeProperty('position');
96
- document.body.style.removeProperty('top');
97
- document.body.style.removeProperty('width');
98
- document.body.style.removeProperty('padding-right');
99
- if (state.top) {
100
- window.scrollTo(0, state.top);
101
- }
102
- }
263
+ const scrollLockOwner = {};
103
264
 
104
265
  watch(
105
266
  () => state.view,
@@ -107,19 +268,8 @@
107
268
  if (_tasks[props.id]) {
108
269
  _tasks[props.id].view = view;
109
270
  }
110
-
111
- const active = getActiveLayer() || [];
112
-
113
- if (view === 2) {
114
- if (active.length === 1) {
115
- disableScroll();
116
- }
117
- }
118
- if (view === 0) {
119
- if (!active.length) {
120
- enableScroll();
121
- }
122
- }
271
+ if (view > 0) acquireScrollLock(scrollLockOwner);
272
+ else releaseScrollLock(scrollLockOwner);
123
273
  },
124
274
  { deep: true, immediate: true },
125
275
  );
@@ -224,6 +374,7 @@
224
374
 
225
375
  // 卸载弹层
226
376
  onBeforeUnmount(() => {
377
+ releaseScrollLock(scrollLockOwner);
227
378
  delete _tasks[id];
228
379
  });
229
380
  </script>
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <div :class="`${frame ? 'b-solid bk-line b-xs r-sm' : ''}`" ui-flex="col xy">
3
- <div ui-calendar-head="" class="nx-sl ny-sm b-solid bk-line bb-xs">
2
+ <div :class="`${frame ? 'b-solid b-line b-xs r-sm' : ''}`" ui-flex="col xy">
3
+ <div ui-calendar-head="" class="nx-sl ny-sm b-solid b-line bb-xs">
4
4
  <div ui-flex="row lm"></div>
5
5
  <div ui-flex="row cm" class="nx-ss-sub">
6
6
  <p class="mx-ss-sub">
@@ -11,15 +11,15 @@
11
11
  </div>
12
12
  <div ui-flex="row rm"></div>
13
13
  </div>
14
- <div ui-flex="row am" class="fs-xs bold nx-sl nt-sm"><span>日</span><span>一</span><span>二</span><span>三</span><span>四</span><span>五</span><span>六</span></div>
14
+ <div ui-flex="row am" class="fs-ss bold nx-sl nt-sm"><span>日</span><span>一</span><span>二</span><span>三</span><span>四</span><span>五</span><span>六</span></div>
15
15
  <div>
16
16
  <ul ui-calendar-days="" ui-flex="row lm" class="flex-wrap nx-sm">
17
17
  <li class="ew7 n-sm ux-none" v-for="(item, idx) in curr.days" :key="idx">
18
18
  <div v-if="item.day" @click="change(item)" ui-cover="-xs">
19
19
  <div
20
20
  ui-flex="col cm"
21
- class="r-ss b-solid bk-none b-xs"
22
- :class="`${item.isToday ? 'bk-main-o-ls' : item.isLastMonth || item.isNextMonth ? 'co-note' : item.isHoliday ? 'co-risk' : ''} ${
21
+ class="r-ss b-solid b-none b-xs"
22
+ :class="`${item.isToday ? 'b-main-o-ls' : item.isLastMonth || item.isNextMonth ? 'co-note' : item.isHoliday ? 'co-risk' : ''} ${
23
23
  state.selected && state.selected === item.date ? 'active bg-main-o-ls co-fore' : 'hover-bg-weak'
24
24
  }`"
25
25
  >
@@ -54,7 +54,7 @@
54
54
  </div>
55
55
  </div>
56
56
  <div ui-flex="row cm" class="nx-ss-sub">
57
- <ul class="fs-xs n-sm-sub" ui-flex="row lm">
57
+ <ul class="fs-ss n-sm-sub" ui-flex="row lm">
58
58
  <li ui-btn="@a s none">年</li>
59
59
  <li ui-btn="@a s none">月</li>
60
60
  <li ui-btn="@a s none">日</li>
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <div :class="`${frame ? 'b-solid bk-line b-xs r-sm' : ''}`" ui-flex="col xy">
3
- <div ui-calendar-head="" class="nx-sl ny-sm b-solid bk-line bb-xs">
2
+ <div :class="`${frame ? 'b-solid b-line b-xs r-sm' : ''}`" ui-flex="col xy">
3
+ <div ui-calendar-head="" class="nx-sl ny-sm b-solid b-line bb-xs">
4
4
  <div ui-flex="row lm"></div>
5
5
  <div ui-flex="row cm" class="nx-ss-sub">
6
6
  <p class="mx-ss-sub">
@@ -11,15 +11,15 @@
11
11
  </div>
12
12
  <div ui-flex="row rm"></div>
13
13
  </div>
14
- <div ui-flex="row am" class="fs-xs bold nx-sl nt-sm"><span>日</span><span>一</span><span>二</span><span>三</span><span>四</span><span>五</span><span>六</span></div>
14
+ <div ui-flex="row am" class="fs-ss bold nx-sl nt-sm"><span>日</span><span>一</span><span>二</span><span>三</span><span>四</span><span>五</span><span>六</span></div>
15
15
  <div>
16
16
  <ul ui-calendar-days="" ui-flex="row lm" class="flex-wrap nx-sm">
17
17
  <li class="ew7 n-sm ux-none" v-for="(item, idx) in curr.days" :key="idx">
18
18
  <div v-if="item.day" @click="change(item)" ui-cover="-xs">
19
19
  <div
20
20
  ui-flex="col cm"
21
- class="r-ss b-solid bk-none b-xs"
22
- :class="`${item.isToday ? 'bk-main-o-ls' : item.isLastMonth || item.isNextMonth ? 'co-note' : item.isHoliday ? 'co-risk' : ''} ${
21
+ class="r-ss b-solid b-none b-xs"
22
+ :class="`${item.isToday ? 'b-main-o-ls' : item.isLastMonth || item.isNextMonth ? 'co-note' : item.isHoliday ? 'co-risk' : ''} ${
23
23
  state.selected && state.selected === item.date ? 'active bg-main-o-ls co-fore' : 'hover-bg-weak'
24
24
  }`"
25
25
  >
@@ -54,7 +54,7 @@
54
54
  </div>
55
55
  </div>
56
56
  <div ui-flex="row cm" class="nx-ss-sub">
57
- <ul class="fs-xs n-sm-sub" ui-flex="row lm">
57
+ <ul class="fs-ss n-sm-sub" ui-flex="row lm">
58
58
  <li ui-btn="@a s none">年</li>
59
59
  <li ui-btn="@a s none">月</li>
60
60
  <li ui-btn="@a s none">日</li>
@@ -12,8 +12,8 @@
12
12
  <div v-else class="photo-editor-viewer bg-weak my-mm" ui-flex="row cm">
13
13
  <input type="file" class="input pa" @change="change" />
14
14
  <div class="ac input-icon">
15
- <i class="icon icon-upload fs-ml"></i>
16
- <div class="fs-sl">请先上传图片</div>
15
+ <i class="icon icon-upload fs-ll"></i>
16
+ <div class="fs-ms">请先上传图片</div>
17
17
  </div>
18
18
  </div>
19
19
  <div ui-flex="row cm" class="mr-ls-sub">
@@ -10,7 +10,7 @@
10
10
  <div v-if="isObject(p)" v-bind="p.attrs" v-on="event(p, item)">
11
11
  <div v-html="isFunction(p.value) ? p.value(item) : p.value"></div>
12
12
  </div>
13
- <div v-else v-html="isFunction(p) ? item(item) : p"></div>
13
+ <div v-else v-html="isFunction(p) ? p(item) : p"></div>
14
14
  </template>
15
15
  <slot name="prefix" :data="item"></slot>
16
16
  </div>
@@ -23,7 +23,7 @@
23
23
  <div v-if="isObject(s)" v-bind="s.attrs" v-on="event(s, item)">
24
24
  <div v-html="isFunction(s.value) ? s.value(item) : s.value"></div>
25
25
  </div>
26
- <div v-else v-html="isFunction(s) ? item(item) : s"></div>
26
+ <div v-else v-html="isFunction(s) ? s(item) : s"></div>
27
27
  </template>
28
28
  </div>
29
29
  </div>
@@ -40,6 +40,7 @@
40
40
  :line="line"
41
41
  :level="level + 1"
42
42
  :root="false"
43
+ @click="(data: any) => emits('click', data)"
43
44
  @select="(data: any) => emits('select', data)"
44
45
  >
45
46
  <template #prefix="{ data = {} }: any = {}">
@@ -131,7 +132,7 @@
131
132
  _event[key] = (...args: any) => {
132
133
  // 如果有click事件则把默认事件与配置事件合并执行
133
134
  if (key === 'click') {
134
- console.log(107, data.child?.length);
135
+ emits('click', data);
135
136
  if (props.optional === 'end') {
136
137
  if (!data?.child?.length) {
137
138
  emits('update:modelValue', data.value);
@@ -12,7 +12,7 @@
12
12
  <template #tips v-if="!readonly && !disabled">
13
13
  <div v-if="state.flatOpts?.length && state.flatOpts[0]?.length > 0" ui-flex="row">
14
14
  <template v-for="(opt, optIndex) in state.flatOpts" :key="optIndex">
15
- <ul v-if="opt?.length" class="min-h-ms max-h-ls" :class="`nx-sm lh-ml ${optIndex === 0 ? '' : 'bl-xs bk-back b-solid'}`" ui-scroll=":y s">
15
+ <ul v-if="opt?.length" class="min-h-ms*s max-h-xl*s" :class="`nx-sm lh-ml ${optIndex === 0 ? '' : 'bl-xs b-back b-solid'}`" ui-scroll=":y s">
16
16
  <!-- 多选 -->
17
17
  <template v-if="multiple">
18
18
  <li v-for="(item, idx) of opt" :key="idx" class="ux-hover nx-sm r-ss nowrap" @click="multiSelect(item, optIndex)">
@@ -87,7 +87,7 @@
87
87
 
88
88
  <script lang="ts" setup>
89
89
  import { reactive, ref, watch, computed } from 'vue';
90
- import { Input } from '.';
90
+ import Input from './Input.vue';
91
91
  import IFollowView from '../basic/IFollowView.vue';
92
92
  import { deepcopy } from '@fekit/utils';
93
93
 
@@ -163,7 +163,7 @@
163
163
  const bindProps: any = computed(() => {
164
164
  const result: any = { ...props };
165
165
  delete result.modelValue;
166
- return bindProps;
166
+ return result;
167
167
  });
168
168
 
169
169
  const formName = new Date().getTime().toString();
@@ -18,8 +18,8 @@
18
18
  </template>
19
19
  <script setup lang="ts">
20
20
  import { reactive, watch, ref } from 'vue';
21
- import { Input } from '.';
22
- import { DateView } from '.';
21
+ import Input from './Input.vue';
22
+ import DateView from './DateView.vue';
23
23
  import { IFollowView } from '../basic';
24
24
  const ifollow: any = ref(null);
25
25
  // 方法
@@ -18,7 +18,8 @@
18
18
  </template>
19
19
  <script setup lang="ts">
20
20
  import { reactive, watch, ref } from 'vue';
21
- import { InputRange, DateRangeView } from '.';
21
+ import InputRange from './InputRange.vue';
22
+ import DateRangeView from './DateRangeView.vue';
22
23
  import { IFollowView } from '../basic';
23
24
  const ifollow: any = ref(null);
24
25
  // 方法
@@ -1,8 +1,8 @@
1
1
  <template>
2
- <div :class="`${frame ? 'b-solid bk-line b-xs r-sm' : ''}`" ui-flex="col xy" style="width: 41em">
2
+ <div :class="`${frame ? 'b-solid b-line b-xs r-sm' : ''}`" ui-flex="col xy" style="width: 41em">
3
3
  <div class="flex-block" ui-flex="row xy">
4
- <div class="w-ll flex-fixed" ui-flex="col xy">
5
- <div ui-date-head="" class="nx-sl mt-ss ny-sm b-solid bk-back" ui-flex="row xm">
4
+ <div class="w-ss*m flex-fixed" ui-flex="col xy">
5
+ <div ui-date-head="" class="nx-sl mt-ss ny-sm b-solid b-back" ui-flex="row xm">
6
6
  <div ui-flex="row lm" class="o-lm">
7
7
  <div ui-btn="@a s none :square" @click="prev(1, { y: -1 })">
8
8
  <Icon name="double-arrow-left" />
@@ -36,7 +36,7 @@
36
36
  </div>
37
37
  <div ui-date-body="">
38
38
  <div class="nb-sm">
39
- <ul ui-flex="row am" class="fs-xs nx-sm nt-sm">
39
+ <ul ui-flex="row am" class="fs-ss nx-sm nt-sm">
40
40
  <li class="flex-block ac"><span>日</span></li>
41
41
  <li class="flex-block ac"><span>一</span></li>
42
42
  <li class="flex-block ac"><span>二</span></li>
@@ -58,7 +58,7 @@
58
58
  >
59
59
  <div
60
60
  ui-flex="col cm"
61
- class="r-sm b-solid bk-none b-xs my-ss ux-scale"
61
+ class="r-sm b-solid b-none b-xs my-ss ux-scale"
62
62
  style="width: 1.8em; height: 1.8em"
63
63
  :class="`${item.isLastMonth || item.isNextMonth ? 'co-case' : item.holiday ? 'co-risk' : ''} ${
64
64
  item.selected ? 'active bg-main-o-lm co-fore' : 'hover-bg-weak'
@@ -75,8 +75,8 @@
75
75
  </div>
76
76
  </div>
77
77
  <div class="flex-block"></div>
78
- <div class="w-ll flex-fixed" ui-flex="col xy">
79
- <div ui-date-head="" class="nx-sl mt-ss ny-sm b-solid bk-back" ui-flex="row xm">
78
+ <div class="w-ss*m flex-fixed" ui-flex="col xy">
79
+ <div ui-date-head="" class="nx-sl mt-ss ny-sm b-solid b-back" ui-flex="row xm">
80
80
  <div ui-flex="row lm">
81
81
  <div v-if="idate(sta.panel).time < idate(end.panel).update({ y: -1 }).time" ui-btn="@a s none :square" @click="prev(2, { y: -1 })">
82
82
  <Icon name="double-arrow-left" />
@@ -110,7 +110,7 @@
110
110
  </div>
111
111
  <div ui-date-body="">
112
112
  <div class="nb-sm">
113
- <ul ui-flex="row am" class="fs-xs nx-sm nt-sm">
113
+ <ul ui-flex="row am" class="fs-ss nx-sm nt-sm">
114
114
  <li class="flex-block ac"><span>日</span></li>
115
115
  <li class="flex-block ac"><span>一</span></li>
116
116
  <li class="flex-block ac"><span>二</span></li>
@@ -132,7 +132,7 @@
132
132
  >
133
133
  <div
134
134
  ui-flex="col cm"
135
- class="r-sm b-solid bk-none b-xs my-ss ux-scale"
135
+ class="r-sm b-solid b-none b-xs my-ss ux-scale"
136
136
  style="width: 1.8em; height: 1.8em"
137
137
  :class="`${item.isLastMonth || item.isNextMonth ? 'co-case' : item.holiday ? 'co-risk' : ''} ${
138
138
  item.selected ? 'active bg-main-o-lm co-fore' : 'hover-bg-weak'
@@ -149,7 +149,7 @@
149
149
  </div>
150
150
  </div>
151
151
  </div>
152
- <div v-if="tools" ui-date-foot="" ui-flex="row xm" class="nx-sl ny-sl b-solid bk-line-o-ls bt-xs">
152
+ <div v-if="tools" ui-date-foot="" ui-flex="row xm" class="nx-sl ny-sl b-solid b-line-o-ls bt-xs">
153
153
  <div ui-flex="row lm" class="nl-ss">
154
154
  <p v-if="sta.value || end.value">
155
155
  <span class="nowrap">已选:</span>
@@ -157,7 +157,7 @@
157
157
  </p>
158
158
  <div v-else-if="com.shortcuts?.length" ui-flex="row lm">
159
159
  <span class="nowrap">推荐:</span>
160
- <div class="mr-sm-sub nx-sl-sub ny-ss-sub lh-ss nowrap fs-ss dib-sub" ui-scroll=":x y:hidden">
160
+ <div class="mr-sm-sub nx-sl-sub ny-ss-sub lh-ss nowrap fs-sm dib-sub" ui-scroll=":x y:hidden">
161
161
  <p v-for="(item, idx) in com.shortcuts" :key="idx" class="bg-main-o-xs co-main r-xl" ui-btn="@a xs none :round" @click="item?.func">{{ item?.text }}</p>
162
162
  <p class="bg-main-o-xs co-main r-xl" ui-btn="@a xs none :round"><Icon class="co-main" name="more" /></p>
163
163
  </div>