@nokecy/qc-ui 0.1.13 → 0.1.15

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,4 +1,4 @@
1
1
  import AgGridPlus from "./ag-gridPlus";
2
2
  import { AgGridColumn } from "./interface";
3
- export * from "./utils";
4
3
  export { AgGridPlus, AgGridColumn };
4
+ export { dateValueFormatter, dateTimeValueFormatter, convertFilterModel, convertSortModel, flattenTreeDeep, toTree, flatten } from "./utils";
@@ -3,10 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- var _exportNames = {
7
- AgGridPlus: true,
8
- AgGridColumn: true
9
- };
10
6
  Object.defineProperty(exports, "AgGridColumn", {
11
7
  enumerable: true,
12
8
  get: function get() {
@@ -19,6 +15,48 @@ Object.defineProperty(exports, "AgGridPlus", {
19
15
  return _agGridPlus.default;
20
16
  }
21
17
  });
18
+ Object.defineProperty(exports, "convertFilterModel", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _utils.convertFilterModel;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "convertSortModel", {
25
+ enumerable: true,
26
+ get: function get() {
27
+ return _utils.convertSortModel;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "dateTimeValueFormatter", {
31
+ enumerable: true,
32
+ get: function get() {
33
+ return _utils.dateTimeValueFormatter;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "dateValueFormatter", {
37
+ enumerable: true,
38
+ get: function get() {
39
+ return _utils.dateValueFormatter;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "flatten", {
43
+ enumerable: true,
44
+ get: function get() {
45
+ return _utils.flatten;
46
+ }
47
+ });
48
+ Object.defineProperty(exports, "flattenTreeDeep", {
49
+ enumerable: true,
50
+ get: function get() {
51
+ return _utils.flattenTreeDeep;
52
+ }
53
+ });
54
+ Object.defineProperty(exports, "toTree", {
55
+ enumerable: true,
56
+ get: function get() {
57
+ return _utils.toTree;
58
+ }
59
+ });
22
60
 
23
61
  var _agGridPlus = _interopRequireDefault(require("./ag-gridPlus"));
24
62
 
@@ -26,16 +64,4 @@ var _interface = require("./interface");
26
64
 
27
65
  var _utils = require("./utils");
28
66
 
29
- Object.keys(_utils).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
32
- if (key in exports && exports[key] === _utils[key]) return;
33
- Object.defineProperty(exports, key, {
34
- enumerable: true,
35
- get: function get() {
36
- return _utils[key];
37
- }
38
- });
39
- });
40
-
41
67
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.toTree = exports.flattenTreeDeep = exports.flatten = exports.dateValueFormatter = exports.dateTimeValueFormatter = exports.convertSortModel = exports.convertFilterModel = void 0;
7
7
 
8
- var _flattenDeep2 = _interopRequireDefault(require("lodash/flattenDeep"));
9
-
10
8
  var _dayjs = _interopRequireDefault(require("dayjs"));
11
9
 
12
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -112,11 +110,12 @@ var dateTimeValueFormatter = function dateTimeValueFormatter(params) {
112
110
  exports.dateTimeValueFormatter = dateTimeValueFormatter;
113
111
 
114
112
  var flatten = function flatten(arr, parentPropName, parentref) {
115
- return arr ? arr.reduce(function (result, item) {
113
+ var data = arr ? arr.reduce(function (result, item) {
116
114
  return [].concat(_toConsumableArray(result), [_objectSpread(_objectSpread({}, item), {}, {
117
- hierarchya: parentref ? [].concat(_toConsumableArray(parentref), [item[parentPropName]]) : [item[parentPropName]]
118
- })], _toConsumableArray(flatten(item.children, parentref ? [].concat(_toConsumableArray(parentref), [item[parentPropName]]) : [item[parentPropName]])));
115
+ hierarchy: parentref ? [].concat(_toConsumableArray(parentref), [item[parentPropName]]) : [item[parentPropName]]
116
+ })], _toConsumableArray(flatten(item.children, parentPropName, parentref ? [].concat(_toConsumableArray(parentref), [item[parentPropName]]) : [item[parentPropName]])));
119
117
  }, []) : [];
118
+ return data;
120
119
  };
121
120
 
122
121
  exports.flatten = flatten;
@@ -151,15 +150,22 @@ exports.toTree = toTree;
151
150
  var flattenTreeDeep = function flattenTreeDeep(treeData) {
152
151
  var childrenName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'childrens';
153
152
 
154
- var getTail = function getTail(item) {
155
- return item[childrenName] && item[childrenName].length > 0 ? item[childrenName].map(function (m) {
156
- return getTail(m);
157
- }) : [item];
153
+ var flattenData = function flattenData(treeData, res) {
154
+ var childrenName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'childrens';
155
+ treeData.forEach(function (item) {
156
+ res.push(item);
157
+
158
+ if (item[childrenName] && item[childrenName].length !== 0) {
159
+ flattenData(item[childrenName], res);
160
+ }
161
+
162
+ delete item[childrenName];
163
+ });
164
+ return res;
158
165
  };
159
166
 
160
- return (0, _flattenDeep2.default)(treeData.map(function (m) {
161
- return getTail(m);
162
- }));
167
+ var res = [];
168
+ return res;
163
169
  };
164
170
 
165
171
  exports.flattenTreeDeep = flattenTreeDeep;
@@ -1,4 +1,4 @@
1
1
  import AgGridPlus from "./ag-gridPlus";
2
2
  import { AgGridColumn } from "./interface";
3
- export * from "./utils";
4
3
  export { AgGridPlus, AgGridColumn };
4
+ export { dateValueFormatter, dateTimeValueFormatter, convertFilterModel, convertSortModel, flattenTreeDeep, toTree, flatten } from "./utils";
@@ -1,4 +1,4 @@
1
1
  import AgGridPlus from "./ag-gridPlus";
2
2
  import { AgGridColumn } from "./interface";
3
- export * from "./utils";
4
- export { AgGridPlus, AgGridColumn };
3
+ export { AgGridPlus, AgGridColumn };
4
+ export { dateValueFormatter, dateTimeValueFormatter, convertFilterModel, convertSortModel, flattenTreeDeep, toTree, flatten } from "./utils";
@@ -1,5 +1,3 @@
1
- import _flattenDeep from "lodash/flattenDeep";
2
-
3
1
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
2
 
5
3
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -95,11 +93,12 @@ var dateTimeValueFormatter = function dateTimeValueFormatter(params) {
95
93
 
96
94
 
97
95
  var flatten = function flatten(arr, parentPropName, parentref) {
98
- return arr ? arr.reduce(function (result, item) {
96
+ var data = arr ? arr.reduce(function (result, item) {
99
97
  return [].concat(_toConsumableArray(result), [_objectSpread(_objectSpread({}, item), {}, {
100
- hierarchya: parentref ? [].concat(_toConsumableArray(parentref), [item[parentPropName]]) : [item[parentPropName]]
101
- })], _toConsumableArray(flatten(item.children, parentref ? [].concat(_toConsumableArray(parentref), [item[parentPropName]]) : [item[parentPropName]])));
98
+ hierarchy: parentref ? [].concat(_toConsumableArray(parentref), [item[parentPropName]]) : [item[parentPropName]]
99
+ })], _toConsumableArray(flatten(item.children, parentPropName, parentref ? [].concat(_toConsumableArray(parentref), [item[parentPropName]]) : [item[parentPropName]])));
102
100
  }, []) : [];
101
+ return data;
103
102
  };
104
103
 
105
104
  var toTree = function toTree(data) {
@@ -130,15 +129,22 @@ var toTree = function toTree(data) {
130
129
  var flattenTreeDeep = function flattenTreeDeep(treeData) {
131
130
  var childrenName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'childrens';
132
131
 
133
- var getTail = function getTail(item) {
134
- return item[childrenName] && item[childrenName].length > 0 ? item[childrenName].map(function (m) {
135
- return getTail(m);
136
- }) : [item];
132
+ var flattenData = function flattenData(treeData, res) {
133
+ var childrenName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'childrens';
134
+ treeData.forEach(function (item) {
135
+ res.push(item);
136
+
137
+ if (item[childrenName] && item[childrenName].length !== 0) {
138
+ flattenData(item[childrenName], res);
139
+ }
140
+
141
+ delete item[childrenName];
142
+ });
143
+ return res;
137
144
  };
138
145
 
139
- return _flattenDeep(treeData.map(function (m) {
140
- return getTail(m);
141
- }));
146
+ var res = [];
147
+ return res;
142
148
  };
143
149
 
144
150
  export { dateValueFormatter, dateTimeValueFormatter, convertFilterModel, convertSortModel, flattenTreeDeep, toTree, flatten };