@94ai/nf-table 100.1.1 → 100.1.5

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.
@@ -1,25 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const vueDemi = require("vue-demi");
4
+ const commonUtils = require("@94ai/common-utils");
4
5
  const vue2RuntimeHelpers = require("@94ai/vue2-runtime-helpers");
5
6
  const elementUi = require("element-ui");
6
7
  const VueCookies = require("vue-cookies");
7
8
  const NfMessage = require("@94ai/nf-message");
8
- function deepClone(source) {
9
- if (!source && typeof source !== "object") {
10
- throw new Error("error arguments shallowClone");
11
- }
12
- const targetObj = source.constructor === Array ? [] : {};
13
- Object.keys(source).forEach((keys) => {
14
- if (source[keys] && typeof source[keys] === "object") {
15
- targetObj[keys] = source[keys].constructor === Array ? [] : {};
16
- targetObj[keys] = deepClone(source[keys]);
17
- } else {
18
- targetObj[keys] = source[keys];
19
- }
20
- });
21
- return targetObj;
22
- }
23
9
  const __sfc_main$2 = vueDemi.defineComponent({
24
10
  name: "NfColumnCheckDialog"
25
11
  });
@@ -167,7 +153,7 @@ __sfc_main$2.setup = (__props, __ctx) => {
167
153
  });
168
154
  const fields = vueDemi.computed(() => {
169
155
  const obj = {};
170
- deepClone(props.tableColumns).sort((a, b) => a.__index - b.__index < 0 ? -1 : a.__index - b.__index > 0 ? 1 : 0).map((item) => {
156
+ commonUtils.deepClone(props.tableColumns).sort((a, b) => a.__index - b.__index < 0 ? -1 : a.__index - b.__index > 0 ? 1 : 0).map((item) => {
171
157
  if (!item.type) {
172
158
  const key = item.category || "基础字段";
173
159
  if (!obj[key]) {
@@ -5319,7 +5305,7 @@ __sfc_main$1.setup = (__props, __ctx) => {
5319
5305
  const fixedColumn = vueDemi.ref([]);
5320
5306
  const unFixedColumn = vueDemi.ref([]);
5321
5307
  vueDemi.onBeforeMount(() => {
5322
- currentTable.value = deepClone(props.tableColumns.filter((item) => !item.destory)).sort((a, b) => a._index - b._index < 0 ? -1 : a._index - b._index > 0 ? 1 : 0);
5308
+ currentTable.value = commonUtils.deepClone(props.tableColumns.filter((item) => !item.destory)).sort((a, b) => a._index - b._index < 0 ? -1 : a._index - b._index > 0 ? 1 : 0);
5323
5309
  currentTable.value.map((i) => {
5324
5310
  if (!i.attr) {
5325
5311
  i.attr = {};
@@ -1,23 +1,9 @@
1
1
  import { defineComponent, getCurrentInstance, ref, computed, onMounted, onBeforeMount, watch, nextTick } from "vue-demi";
2
+ import { deepClone } from "@94ai/common-utils";
2
3
  import { normalizeComponent } from "@94ai/vue2-runtime-helpers";
3
4
  import { Loading } from "element-ui";
4
5
  import VueCookies from "vue-cookies";
5
6
  import NfMessage from "@94ai/nf-message";
6
- function deepClone(source) {
7
- if (!source && typeof source !== "object") {
8
- throw new Error("error arguments shallowClone");
9
- }
10
- const targetObj = source.constructor === Array ? [] : {};
11
- Object.keys(source).forEach((keys) => {
12
- if (source[keys] && typeof source[keys] === "object") {
13
- targetObj[keys] = source[keys].constructor === Array ? [] : {};
14
- targetObj[keys] = deepClone(source[keys]);
15
- } else {
16
- targetObj[keys] = source[keys];
17
- }
18
- });
19
- return targetObj;
20
- }
21
7
  const __sfc_main$2 = defineComponent({
22
8
  name: "NfColumnCheckDialog"
23
9
  });
@@ -53,7 +53,7 @@ import {
53
53
  onMounted,
54
54
  ref
55
55
  } from 'vue-demi'
56
- import { deepClone } from 'packages/nf-table/lib/utils'
56
+ import { deepClone } from '@94ai/common-utils'
57
57
 
58
58
  const props = withDefaults(defineProps<{
59
59
  storageKey?: string
@@ -140,7 +140,7 @@ import {
140
140
  PropType,
141
141
  onMounted
142
142
  } from 'vue-demi'
143
- import { deepClone } from './utils'
143
+ import { deepClone } from '@94ai/common-utils'
144
144
 
145
145
  const instance = getCurrentInstance()?.proxy
146
146
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@94ai/nf-table",
3
- "version": "100.1.1",
3
+ "version": "100.1.5",
4
4
  "description": "> TODO: description",
5
5
  "keywords": [],
6
6
  "author": "zoujiahe <zoujiahe@94ai.com>",
@@ -14,10 +14,11 @@
14
14
  "url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
15
15
  },
16
16
  "dependencies": {
17
- "@94ai/nf-drawer": "^100.1.1",
18
- "@94ai/nf-message": "^100.1.1",
19
- "@94ai/nf-search-form": "^100.1.1",
20
- "@94ai/nf-theme-chalk": "^100.1.1",
17
+ "@94ai/common-utils": "^100.1.5",
18
+ "@94ai/nf-drawer": "^100.1.5",
19
+ "@94ai/nf-message": "^100.1.5",
20
+ "@94ai/nf-search-form": "^100.1.5",
21
+ "@94ai/nf-theme-chalk": "^100.1.5",
21
22
  "vue-cookies": "^1.8.3",
22
23
  "vue-demi": "^0.14.5",
23
24
  "vuedraggable": "^2.24.3"
@@ -33,7 +34,7 @@
33
34
  "vue": "^2.0.0 || >=3.0.0"
34
35
  },
35
36
  "types": "lib/index.d.ts",
36
- "main": "lib/nf-table.cjs.js",
37
- "module": "lib/nf-table.esm-bundler.js",
38
- "gitHead": "b039d7cd2dc96d3caa84a60da9f0b5f68f9572e5"
37
+ "main": "lib/nf-table.cjs.cjs",
38
+ "module": "lib/nf-table.esm-bundler.mjs",
39
+ "gitHead": "5b811c0e9d5ed95519222e3a9b744331734feeaf"
39
40
  }
package/lib/utils.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare function deepClone(source: any): Record<string, any> | Record<string, any>[];
package/package/utils.ts DELETED
@@ -1,15 +0,0 @@
1
- export function deepClone(source) {
2
- if (!source && typeof source !== 'object') {
3
- throw new Error('error arguments shallowClone')
4
- }
5
- const targetObj: Record<string, any> | Record<string, any>[] = source.constructor === Array ? [] : {}
6
- Object.keys(source).forEach((keys) => {
7
- if (source[keys] && typeof source[keys] === 'object') {
8
- targetObj[keys] = source[keys].constructor === Array ? [] : {}
9
- targetObj[keys] = deepClone(source[keys])
10
- } else {
11
- targetObj[keys] = source[keys]
12
- }
13
- })
14
- return targetObj
15
- }