@neatui/vue 2.17.0 → 2.17.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neatui/vue",
3
- "version": "2.17.0",
3
+ "version": "2.17.2",
4
4
  "description": "basic component ui",
5
5
  "main": "./src/index.ts",
6
6
  "license": "MIT",
@@ -18,7 +18,17 @@
18
18
  <script lang="ts" setup>
19
19
  import { onBeforeUnmount, reactive, watch } from 'vue';
20
20
  import { isFunction } from '@fekit/utils';
21
- import { _tasks, getActiveLayer } from './index';
21
+
22
+ // 弹层队列
23
+ if (!(window as any)._FEKIT_LAYER_TASKS) {
24
+ (window as any)._FEKIT_LAYER_TASKS = {};
25
+ }
26
+ const _tasks: any = (window as any)._FEKIT_LAYER_TASKS;
27
+
28
+ // 获取活跃的弹层
29
+ const getActiveLayer = () => {
30
+ return Object.values(_tasks).filter((task: any) => task.view > 0);
31
+ };
22
32
 
23
33
  // 类型定义
24
34
  interface Props {
@@ -205,7 +215,6 @@
205
215
 
206
216
  // 卸载弹层
207
217
  onBeforeUnmount(() => {
208
- // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
209
218
  delete _tasks[id];
210
219
  });
211
220
  </script>
@@ -1,8 +1,5 @@
1
- export const _tasks: any = {};
2
- export const _state: any = {};
3
- export const getActiveLayer = () => {
4
- return Object.values(_tasks).filter((task: any) => task.view > 0);
5
- };
6
- export const LayerById = (id: any) => {
7
- return _tasks[id];
1
+ import Layer from './Layer.vue';
2
+ const LayerById = (id: any) => {
3
+ return (window as any)._FEKIT_LAYER_TASKS[id];
8
4
  };
5
+ export { Layer, LayerById };
@@ -1,5 +1,4 @@
1
- import { LayerById } from './LayerView/index';
2
- import Layer from './LayerView/Layer.vue';
1
+ import { Layer, LayerById } from './LayerView';
3
2
  import Icon from './Icon.vue';
4
3
  import IFollowView from './IFollowView.vue';
5
4
  import IPickerView from './IPickerView.vue';
@@ -189,12 +189,17 @@
189
189
  const processInput = (value: any) => {
190
190
  let processedArray: any[] = [];
191
191
 
192
+ // 处理 null 或 undefined,转换为空字符串
193
+ if (value === null || value === undefined) {
194
+ return [];
195
+ }
196
+
192
197
  if (typeof value === 'string') {
193
198
  state.originalType = 'string';
194
199
  processedArray = value.trim() ? (value.includes(',') ? value.split(',').map((s: string) => s.trim()) : [value]) : [];
195
200
  } else {
196
201
  state.originalType = 'array';
197
- processedArray = value || [];
202
+ processedArray = Array.isArray(value) ? value : [];
198
203
  }
199
204
 
200
205
  // 过滤掉在options中不存在的值
@@ -240,7 +245,7 @@
240
245
  };
241
246
  // 选中
242
247
  const select = (item: any) => {
243
- const s = [...state.processedValue];
248
+ const s = [...(state.processedValue || [])];
244
249
  // s?.indexOf(item) !== -1 ? s?.splice(s?.indexOf(item), 1) : s?.push(item);
245
250
  if (s?.indexOf(item) !== -1) {
246
251
  s?.splice(s?.indexOf(item), 1);
@@ -153,6 +153,7 @@
153
153
  v-bind="{ ...(col.model[1] || {}) }"
154
154
  ></Textarea>
155
155
  <Switch v-else-if="col.model[0] === 'Switch'" v-model="col._data[col.field]" :interacted="interacted" :rules="col.rules" v-bind="{ ...(col.model[1] || {}) }" />
156
+ <Checkbox v-else-if="col.model[0] === 'Checkbox'" v-model="col._data[col.field]" :interacted="interacted" :rules="col.rules" v-bind="{ ...(col.model[1] || {}) }" />
156
157
  <Tree v-else-if="col.model[0] === 'Tree'" v-model="col._data[col.field]" :interacted="interacted" :rules="col.rules" class="mt-sm" v-bind="{ ...(col.model[1] || {}) }" />
157
158
  <Cascader
158
159
  v-else-if="col.model[0] === 'Cascader'"
@@ -187,6 +188,7 @@
187
188
  import {
188
189
  Input,
189
190
  Switch,
191
+ Checkbox,
190
192
  Textarea,
191
193
  Select,
192
194
  SelectList,