@neatui/vue 2.7.3 → 2.7.4

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.7.3",
3
+ "version": "2.7.4",
4
4
  "description": "basic component ui",
5
5
  "main": "./src/index.ts",
6
6
  "license": "MIT",
@@ -20,15 +20,14 @@
20
20
  "typescript": "^5.1.6"
21
21
  },
22
22
  "dependencies": {
23
- "@fekit/floor": "^2.2.2",
24
- "@fekit/follow": "^1.4.0",
23
+ "@fekit/floor": "^3.0.1",
24
+ "@fekit/follow": "^1.7.0",
25
25
  "@fekit/itable": "^1.1.6",
26
26
  "@fekit/pullload": "^1.3.5",
27
27
  "@fekit/scale": "^2.0.1",
28
28
  "@fekit/scrollto": "^3.0.3",
29
29
  "@fekit/toast": "^2.7.2",
30
- "@fekit/url": "^2.0.1",
31
- "@fekit/utils": "^2.16.1",
30
+ "@fekit/utils": "^3.1.0",
32
31
  "@rollup/plugin-commonjs": "^26.0.1",
33
32
  "@rollup/plugin-node-resolve": "^15.2.3",
34
33
  "@vue/compiler-sfc": "^3.4.30",
@@ -10,10 +10,10 @@
10
10
  <template v-for="(col, idx) in state.table" :key="idx">
11
11
  <th v-if="!col.__close" :min-width="col.fixed" :col-fixed="col.fixed" :col-fixed-side="col.fixed || 'l'" :data-field="col.field">
12
12
  <slot :name="`thead-${col.field}`" :col="col" :idx="idx">
13
- <div v-bind="{ ...col.attrs, ...col.thead }">
13
+ <div v-bind="col.thead">
14
14
  <span class="nl-xs ux-none" v-if="col.order === 0 || col.order === 1 || col.order === 2" @click="fSetOrder(col)">
15
15
  <span>{{ col.label }}</span>
16
- <span ui-btn="@a none s" :ui-order="col.__order"></span>
16
+ <span ui-btn="@a none s :square" :ui-order="col.__order"></span>
17
17
  </span>
18
18
  <span class="nl-xs" v-else>{{ col.label }}</span>
19
19
  <!-- 设置 -->
@@ -152,7 +152,7 @@
152
152
  import { IFollowView, Icon } from '../../basic';
153
153
  import { itable } from '@fekit/itable';
154
154
  import TableColView from './TableColView.vue';
155
- import { isFunction, isObject, deepcopy } from '@fekit/utils';
155
+ import { isFunction, isObject, hasOwnProp, deepcopy } from '@fekit/utils';
156
156
  const route = useRoute();
157
157
  const router = useRouter();
158
158
  // 外部插槽
@@ -211,7 +211,7 @@
211
211
  limit: computed(() => {
212
212
  const _cache = JSON.parse(localStorage.getItem(`${state.name}_limit`) || '{}');
213
213
  return (props.limit || [])?.map((item: any) => {
214
- if (_cache[item.field] && Object.prototype.hasOwnProperty.call(_cache[item.field], '__close')) {
214
+ if (_cache[item.field] && hasOwnProp(_cache[item.field], '__close')) {
215
215
  item.__close = _cache[item.field]?.__close;
216
216
  } else {
217
217
  if (item.close === true || item.close === 1 || item.close === 'always') {
@@ -257,21 +257,18 @@
257
257
  state.table = deepcopy(props.table || [])
258
258
  ?.map((col: any, idx: number) => {
259
259
  // 表头属性处理
260
- if (!col.thead) {
261
- col.thead = {};
260
+ col.thead ??= {};
261
+ col.thead.class = (col.thead.class || '').split(/\s+/);
262
+ if (!col.thead.class.some((c: any) => c === 'wrap' || c === 'nowrap')) {
263
+ col.thead.class.push('nowrap');
262
264
  }
263
- // 表头默认样式
264
- const _thc = (col.thead.class || '').split(/\s+/);
265
- if (!_thc.includes('wrap') && !_thc.includes('nowrap')) {
266
- _thc.push('nowrap');
265
+ // 如果没有以 fs- 开头的类,就加 fs-xs
266
+ if (!col.thead.class.some((c: string) => /^fs-/.test(c))) {
267
+ col.thead.class.push('fs-xs');
267
268
  }
268
- if (!_thc.some((c: any) => c.startsWith('fs-'))) {
269
- _thc.unshift('fs-xs');
270
- }
271
- col.thead.class = _thc.join(' ').trim();
272
269
 
273
270
  // 缓存的显示信息
274
- if (_cache[col.field] && Object.prototype.hasOwnProperty.call(_cache[col.field], '__close')) {
271
+ if (_cache[col.field] && hasOwnProp(_cache[col.field], '__close')) {
275
272
  col.__close = _cache[col.field]?.__close;
276
273
  } else {
277
274
  if (col.close === true || col.close === 1 || col.close === 'always') {
@@ -279,12 +276,12 @@
279
276
  }
280
277
  }
281
278
  // 获取缓存的表格列顺序(注意不是数据记录的排序)
282
- if (_cache[col.field] && Object.prototype.hasOwnProperty.call(_cache[col.field], '_sort')) {
279
+ if (_cache[col.field] && hasOwnProp(_cache[col.field], '_sort')) {
283
280
  col._sort = _cache[col.field]?._sort;
284
281
  }
285
282
 
286
283
  // 获取本地存储的字段升降序(注意不是表格列的顺序)
287
- if (col.order === 0 || col.order === 1 || col.order === 2 || (_cache[col.field] && Object.prototype.hasOwnProperty.call(_cache[col.field], '__order'))) {
284
+ if (col.order === 0 || col.order === 1 || col.order === 2 || (_cache[col.field] && hasOwnProp(_cache[col.field], '__order'))) {
288
285
  col.__order = _cache[col.field]?.__order || col.order;
289
286
  }
290
287
 
@@ -316,10 +313,10 @@
316
313
  state._last = 0;
317
314
  state.table.forEach((col: any, idx: number) => {
318
315
  _table[col.field] = { _sort: idx };
319
- if (Object.prototype.hasOwnProperty.call(col, '__close')) {
316
+ if (hasOwnProp(col, '__close')) {
320
317
  _table[col.field].__close = col.__close ? 1 : 0;
321
318
  }
322
- if (Object.prototype.hasOwnProperty.call(col, '__order')) {
319
+ if (hasOwnProp(col, '__order')) {
323
320
  _table[col.field].__order = col.__order;
324
321
  }
325
322
  if (!col.__close) {