@powfix/core-js 0.28.2 → 0.30.0

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 (40) hide show
  1. package/dist/browser/utils/SortUtils.cjs +102 -0
  2. package/dist/browser/utils/SortUtils.d.ts +6 -0
  3. package/dist/browser/utils/SortUtils.js +102 -0
  4. package/dist/browser/utils/index.cjs +9 -0
  5. package/dist/browser/utils/index.d.ts +1 -0
  6. package/dist/browser/utils/index.js +1 -0
  7. package/dist/index.browser.cjs +0 -9
  8. package/dist/index.browser.d.ts +0 -1
  9. package/dist/index.browser.js +0 -1
  10. package/dist/index.node.cjs +0 -9
  11. package/dist/index.node.d.ts +0 -1
  12. package/dist/index.node.js +0 -1
  13. package/dist/node/utils/SortUtils.cjs +106 -0
  14. package/dist/node/utils/SortUtils.d.ts +6 -0
  15. package/dist/node/utils/SortUtils.js +106 -0
  16. package/dist/node/utils/index.cjs +9 -0
  17. package/dist/node/utils/index.d.ts +1 -0
  18. package/dist/node/utils/index.js +1 -0
  19. package/dist/shared/types/index.cjs +9 -0
  20. package/dist/shared/types/index.d.ts +1 -0
  21. package/dist/shared/types/index.js +1 -0
  22. package/dist/shared/types/sort/SortDirection.cjs +1 -0
  23. package/dist/shared/types/sort/SortDirection.d.ts +1 -0
  24. package/dist/shared/types/sort/SortDirection.js +0 -0
  25. package/dist/shared/types/sort/SortItem.cjs +1 -0
  26. package/dist/shared/types/sort/SortItem.d.ts +5 -0
  27. package/dist/shared/types/sort/SortItem.js +0 -0
  28. package/dist/shared/types/sort/index.cjs +19 -0
  29. package/dist/shared/types/sort/index.d.ts +2 -0
  30. package/dist/shared/types/sort/index.js +2 -0
  31. package/dist/shared/utils/NumberUtils.cjs +65 -0
  32. package/dist/shared/utils/NumberUtils.d.ts +1 -0
  33. package/dist/shared/utils/NumberUtils.js +65 -0
  34. package/dist/shared/utils/SortUtils.cjs +11 -0
  35. package/dist/shared/utils/SortUtils.d.ts +2 -0
  36. package/dist/shared/utils/SortUtils.js +11 -0
  37. package/dist/shared/utils/index.cjs +9 -0
  38. package/dist/shared/utils/index.d.ts +1 -0
  39. package/dist/shared/utils/index.js +1 -0
  40. package/package.json +2 -1
@@ -0,0 +1,102 @@
1
+ 'use strict';
2
+ function _assert_this_initialized(self) {
3
+ if (self === void 0) {
4
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
5
+ }
6
+ return self;
7
+ }
8
+ function _call_super(_this, derived, args) {
9
+ derived = _get_prototype_of(derived);
10
+ return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
11
+ }
12
+ function _class_call_check(instance, Constructor) {
13
+ if (!(instance instanceof Constructor)) {
14
+ throw new TypeError("Cannot call a class as a function");
15
+ }
16
+ }
17
+ function _defineProperties(target, props) {
18
+ for(var i = 0; i < props.length; i++){
19
+ var descriptor = props[i];
20
+ descriptor.enumerable = descriptor.enumerable || false;
21
+ descriptor.configurable = true;
22
+ if ("value" in descriptor) descriptor.writable = true;
23
+ Object.defineProperty(target, descriptor.key, descriptor);
24
+ }
25
+ }
26
+ function _create_class(Constructor, protoProps, staticProps) {
27
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
28
+ if (staticProps) _defineProperties(Constructor, staticProps);
29
+ return Constructor;
30
+ }
31
+ function _get_prototype_of(o) {
32
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
33
+ return o.__proto__ || Object.getPrototypeOf(o);
34
+ };
35
+ return _get_prototype_of(o);
36
+ }
37
+ function _inherits(subClass, superClass) {
38
+ if (typeof superClass !== "function" && superClass !== null) {
39
+ throw new TypeError("Super expression must either be null or a function");
40
+ }
41
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
42
+ constructor: {
43
+ value: subClass,
44
+ writable: true,
45
+ configurable: true
46
+ }
47
+ });
48
+ if (superClass) _set_prototype_of(subClass, superClass);
49
+ }
50
+ function _possible_constructor_return(self, call) {
51
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
52
+ return call;
53
+ }
54
+ return _assert_this_initialized(self);
55
+ }
56
+ function _set_prototype_of(o, p) {
57
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
58
+ o.__proto__ = p;
59
+ return o;
60
+ };
61
+ return _set_prototype_of(o, p);
62
+ }
63
+ function _type_of(obj) {
64
+ "@swc/helpers - typeof";
65
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
66
+ }
67
+ function _is_native_reflect_construct() {
68
+ try {
69
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
70
+ } catch (_) {}
71
+ return (_is_native_reflect_construct = function() {
72
+ return !!result;
73
+ })();
74
+ }
75
+ require('../../chunk-QHUNR4O5.cjs');
76
+ var shared = require('../../shared');
77
+ var SortUtils = /*#__PURE__*/ function(_shared_SortUtils) {
78
+ _inherits(SortUtils, _shared_SortUtils);
79
+ function SortUtils() {
80
+ _class_call_check(this, SortUtils);
81
+ return _call_super(this, SortUtils, arguments);
82
+ }
83
+ _create_class(SortUtils, null, [
84
+ {
85
+ key: "mapGridSortItem",
86
+ value: function mapGridSortItem(item) {
87
+ return {
88
+ field: item.field,
89
+ sort: item.direction
90
+ };
91
+ }
92
+ },
93
+ {
94
+ key: "mapGridSortModel",
95
+ value: function mapGridSortModel(items) {
96
+ return items.map(this.mapGridSortItem);
97
+ }
98
+ }
99
+ ]);
100
+ return SortUtils;
101
+ }(shared.SortUtils);
102
+ exports.SortUtils = SortUtils;
@@ -0,0 +1,6 @@
1
+ import { SortItem, SortUtils as BaseSortUtils } from "../../shared/index.js";
2
+ import type { GridSortModel } from "@mui/x-data-grid";
3
+ export declare class SortUtils extends BaseSortUtils {
4
+ static mapGridSortItem<TField extends string = string>(item: SortItem<TField>): GridSortModel[number];
5
+ static mapGridSortModel<TField extends string = string>(items: SortItem<TField>[]): GridSortModel;
6
+ }
@@ -0,0 +1,102 @@
1
+ function _assert_this_initialized(self) {
2
+ if (self === void 0) {
3
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4
+ }
5
+ return self;
6
+ }
7
+ function _call_super(_this, derived, args) {
8
+ derived = _get_prototype_of(derived);
9
+ return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
10
+ }
11
+ function _class_call_check(instance, Constructor) {
12
+ if (!(instance instanceof Constructor)) {
13
+ throw new TypeError("Cannot call a class as a function");
14
+ }
15
+ }
16
+ function _defineProperties(target, props) {
17
+ for(var i = 0; i < props.length; i++){
18
+ var descriptor = props[i];
19
+ descriptor.enumerable = descriptor.enumerable || false;
20
+ descriptor.configurable = true;
21
+ if ("value" in descriptor) descriptor.writable = true;
22
+ Object.defineProperty(target, descriptor.key, descriptor);
23
+ }
24
+ }
25
+ function _create_class(Constructor, protoProps, staticProps) {
26
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
27
+ if (staticProps) _defineProperties(Constructor, staticProps);
28
+ return Constructor;
29
+ }
30
+ function _get_prototype_of(o) {
31
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
32
+ return o.__proto__ || Object.getPrototypeOf(o);
33
+ };
34
+ return _get_prototype_of(o);
35
+ }
36
+ function _inherits(subClass, superClass) {
37
+ if (typeof superClass !== "function" && superClass !== null) {
38
+ throw new TypeError("Super expression must either be null or a function");
39
+ }
40
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
41
+ constructor: {
42
+ value: subClass,
43
+ writable: true,
44
+ configurable: true
45
+ }
46
+ });
47
+ if (superClass) _set_prototype_of(subClass, superClass);
48
+ }
49
+ function _possible_constructor_return(self, call) {
50
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
51
+ return call;
52
+ }
53
+ return _assert_this_initialized(self);
54
+ }
55
+ function _set_prototype_of(o, p) {
56
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
57
+ o.__proto__ = p;
58
+ return o;
59
+ };
60
+ return _set_prototype_of(o, p);
61
+ }
62
+ function _type_of(obj) {
63
+ "@swc/helpers - typeof";
64
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
65
+ }
66
+ function _is_native_reflect_construct() {
67
+ try {
68
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
69
+ } catch (_) {}
70
+ return (_is_native_reflect_construct = function() {
71
+ return !!result;
72
+ })();
73
+ }
74
+ import '../../chunk-S7EYY36U.js';
75
+ import { SortUtils as SortUtils$1 } from '../../shared/index.js';
76
+ var SortUtils = /*#__PURE__*/ function(SortUtils$1) {
77
+ "use strict";
78
+ _inherits(SortUtils, SortUtils$1);
79
+ function SortUtils() {
80
+ _class_call_check(this, SortUtils);
81
+ return _call_super(this, SortUtils, arguments);
82
+ }
83
+ _create_class(SortUtils, null, [
84
+ {
85
+ key: "mapGridSortItem",
86
+ value: function mapGridSortItem(item) {
87
+ return {
88
+ field: item.field,
89
+ sort: item.direction
90
+ };
91
+ }
92
+ },
93
+ {
94
+ key: "mapGridSortModel",
95
+ value: function mapGridSortModel(items) {
96
+ return items.map(this.mapGridSortItem);
97
+ }
98
+ }
99
+ ]);
100
+ return SortUtils;
101
+ }(SortUtils$1);
102
+ export { SortUtils };
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
  var SearchParamsUtils = require('./SearchParamsUtils');
3
+ var SortUtils = require('./SortUtils');
3
4
  Object.keys(SearchParamsUtils).forEach(function(k) {
4
5
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
5
6
  enumerable: true,
@@ -8,3 +9,11 @@ Object.keys(SearchParamsUtils).forEach(function(k) {
8
9
  }
9
10
  });
10
11
  });
12
+ Object.keys(SortUtils).forEach(function(k) {
13
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
14
+ enumerable: true,
15
+ get: function get() {
16
+ return SortUtils[k];
17
+ }
18
+ });
19
+ });
@@ -1 +1,2 @@
1
1
  export * from './SearchParamsUtils.js';
2
+ export * from "./SortUtils.js";
@@ -1 +1,2 @@
1
1
  export * from './SearchParamsUtils.js';
2
+ export * from './SortUtils.js';
@@ -1,14 +1,5 @@
1
1
  'use strict';
2
- var shared = require('./shared');
3
2
  var browser = require('./browser');
4
- Object.keys(shared).forEach(function(k) {
5
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
6
- enumerable: true,
7
- get: function get() {
8
- return shared[k];
9
- }
10
- });
11
- });
12
3
  Object.keys(browser).forEach(function(k) {
13
4
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
14
5
  enumerable: true,
@@ -1,2 +1 @@
1
- export * from './shared/index.js';
2
1
  export * from './browser/index.js';
@@ -1,2 +1 @@
1
- export * from './shared/index.js';
2
1
  export * from './browser/index.js';
@@ -1,14 +1,5 @@
1
1
  'use strict';
2
- var shared = require('./shared');
3
2
  var node = require('./node');
4
- Object.keys(shared).forEach(function(k) {
5
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
6
- enumerable: true,
7
- get: function get() {
8
- return shared[k];
9
- }
10
- });
11
- });
12
3
  Object.keys(node).forEach(function(k) {
13
4
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
14
5
  enumerable: true,
@@ -1,2 +1 @@
1
- export * from './shared/index.js';
2
1
  export * from './node/index.js';
@@ -1,2 +1 @@
1
- export * from './shared/index.js';
2
1
  export * from './node/index.js';
@@ -0,0 +1,106 @@
1
+ 'use strict';
2
+ function _assert_this_initialized(self) {
3
+ if (self === void 0) {
4
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
5
+ }
6
+ return self;
7
+ }
8
+ function _call_super(_this, derived, args) {
9
+ derived = _get_prototype_of(derived);
10
+ return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
11
+ }
12
+ function _class_call_check(instance, Constructor) {
13
+ if (!(instance instanceof Constructor)) {
14
+ throw new TypeError("Cannot call a class as a function");
15
+ }
16
+ }
17
+ function _defineProperties(target, props) {
18
+ for(var i = 0; i < props.length; i++){
19
+ var descriptor = props[i];
20
+ descriptor.enumerable = descriptor.enumerable || false;
21
+ descriptor.configurable = true;
22
+ if ("value" in descriptor) descriptor.writable = true;
23
+ Object.defineProperty(target, descriptor.key, descriptor);
24
+ }
25
+ }
26
+ function _create_class(Constructor, protoProps, staticProps) {
27
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
28
+ if (staticProps) _defineProperties(Constructor, staticProps);
29
+ return Constructor;
30
+ }
31
+ function _get_prototype_of(o) {
32
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
33
+ return o.__proto__ || Object.getPrototypeOf(o);
34
+ };
35
+ return _get_prototype_of(o);
36
+ }
37
+ function _inherits(subClass, superClass) {
38
+ if (typeof superClass !== "function" && superClass !== null) {
39
+ throw new TypeError("Super expression must either be null or a function");
40
+ }
41
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
42
+ constructor: {
43
+ value: subClass,
44
+ writable: true,
45
+ configurable: true
46
+ }
47
+ });
48
+ if (superClass) _set_prototype_of(subClass, superClass);
49
+ }
50
+ function _possible_constructor_return(self, call) {
51
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
52
+ return call;
53
+ }
54
+ return _assert_this_initialized(self);
55
+ }
56
+ function _set_prototype_of(o, p) {
57
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
58
+ o.__proto__ = p;
59
+ return o;
60
+ };
61
+ return _set_prototype_of(o, p);
62
+ }
63
+ function _type_of(obj) {
64
+ "@swc/helpers - typeof";
65
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
66
+ }
67
+ function _is_native_reflect_construct() {
68
+ try {
69
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
70
+ } catch (_) {}
71
+ return (_is_native_reflect_construct = function() {
72
+ return !!result;
73
+ })();
74
+ }
75
+ require('../../chunk-QHUNR4O5.cjs');
76
+ var shared = require('../../shared');
77
+ var SortUtils = /*#__PURE__*/ function(_shared_SortUtils) {
78
+ _inherits(SortUtils, _shared_SortUtils);
79
+ function SortUtils() {
80
+ _class_call_check(this, SortUtils);
81
+ return _call_super(this, SortUtils, arguments);
82
+ }
83
+ _create_class(SortUtils, null, [
84
+ {
85
+ key: "mapSequelizeOrderItem",
86
+ value: function mapSequelizeOrderItem(item) {
87
+ if (item.direction == null) {
88
+ return item.field;
89
+ } else {
90
+ return [
91
+ item.field,
92
+ item.direction
93
+ ];
94
+ }
95
+ }
96
+ },
97
+ {
98
+ key: "mapSequelizeOrder",
99
+ value: function mapSequelizeOrder(items) {
100
+ return items.map(this.mapSequelizeOrderItem);
101
+ }
102
+ }
103
+ ]);
104
+ return SortUtils;
105
+ }(shared.SortUtils);
106
+ exports.SortUtils = SortUtils;
@@ -0,0 +1,6 @@
1
+ import { SortItem, SortUtils as BaseSortUtils } from "../../shared/index.js";
2
+ import type { Order, OrderItem } from "sequelize";
3
+ export declare class SortUtils extends BaseSortUtils {
4
+ static mapSequelizeOrderItem<TField extends string = string>(item: SortItem<TField>): OrderItem;
5
+ static mapSequelizeOrder<TField extends string = string>(items: SortItem<TField>[]): Order;
6
+ }
@@ -0,0 +1,106 @@
1
+ function _assert_this_initialized(self) {
2
+ if (self === void 0) {
3
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4
+ }
5
+ return self;
6
+ }
7
+ function _call_super(_this, derived, args) {
8
+ derived = _get_prototype_of(derived);
9
+ return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
10
+ }
11
+ function _class_call_check(instance, Constructor) {
12
+ if (!(instance instanceof Constructor)) {
13
+ throw new TypeError("Cannot call a class as a function");
14
+ }
15
+ }
16
+ function _defineProperties(target, props) {
17
+ for(var i = 0; i < props.length; i++){
18
+ var descriptor = props[i];
19
+ descriptor.enumerable = descriptor.enumerable || false;
20
+ descriptor.configurable = true;
21
+ if ("value" in descriptor) descriptor.writable = true;
22
+ Object.defineProperty(target, descriptor.key, descriptor);
23
+ }
24
+ }
25
+ function _create_class(Constructor, protoProps, staticProps) {
26
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
27
+ if (staticProps) _defineProperties(Constructor, staticProps);
28
+ return Constructor;
29
+ }
30
+ function _get_prototype_of(o) {
31
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
32
+ return o.__proto__ || Object.getPrototypeOf(o);
33
+ };
34
+ return _get_prototype_of(o);
35
+ }
36
+ function _inherits(subClass, superClass) {
37
+ if (typeof superClass !== "function" && superClass !== null) {
38
+ throw new TypeError("Super expression must either be null or a function");
39
+ }
40
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
41
+ constructor: {
42
+ value: subClass,
43
+ writable: true,
44
+ configurable: true
45
+ }
46
+ });
47
+ if (superClass) _set_prototype_of(subClass, superClass);
48
+ }
49
+ function _possible_constructor_return(self, call) {
50
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
51
+ return call;
52
+ }
53
+ return _assert_this_initialized(self);
54
+ }
55
+ function _set_prototype_of(o, p) {
56
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
57
+ o.__proto__ = p;
58
+ return o;
59
+ };
60
+ return _set_prototype_of(o, p);
61
+ }
62
+ function _type_of(obj) {
63
+ "@swc/helpers - typeof";
64
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
65
+ }
66
+ function _is_native_reflect_construct() {
67
+ try {
68
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
69
+ } catch (_) {}
70
+ return (_is_native_reflect_construct = function() {
71
+ return !!result;
72
+ })();
73
+ }
74
+ import '../../chunk-S7EYY36U.js';
75
+ import { SortUtils as SortUtils$1 } from '../../shared/index.js';
76
+ var SortUtils = /*#__PURE__*/ function(SortUtils$1) {
77
+ "use strict";
78
+ _inherits(SortUtils, SortUtils$1);
79
+ function SortUtils() {
80
+ _class_call_check(this, SortUtils);
81
+ return _call_super(this, SortUtils, arguments);
82
+ }
83
+ _create_class(SortUtils, null, [
84
+ {
85
+ key: "mapSequelizeOrderItem",
86
+ value: function mapSequelizeOrderItem(item) {
87
+ if (item.direction == null) {
88
+ return item.field;
89
+ } else {
90
+ return [
91
+ item.field,
92
+ item.direction
93
+ ];
94
+ }
95
+ }
96
+ },
97
+ {
98
+ key: "mapSequelizeOrder",
99
+ value: function mapSequelizeOrder(items) {
100
+ return items.map(this.mapSequelizeOrderItem);
101
+ }
102
+ }
103
+ ]);
104
+ return SortUtils;
105
+ }(SortUtils$1);
106
+ export { SortUtils };
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
  var sequelizeUtils = require('./sequelize-utils');
3
3
  var HookUtils = require('./HookUtils');
4
+ var SortUtils = require('./SortUtils');
4
5
  Object.keys(sequelizeUtils).forEach(function(k) {
5
6
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
6
7
  enumerable: true,
@@ -17,3 +18,11 @@ Object.keys(HookUtils).forEach(function(k) {
17
18
  }
18
19
  });
19
20
  });
21
+ Object.keys(SortUtils).forEach(function(k) {
22
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
23
+ enumerable: true,
24
+ get: function get() {
25
+ return SortUtils[k];
26
+ }
27
+ });
28
+ });
@@ -1,2 +1,3 @@
1
1
  export * from './sequelize-utils/index.js';
2
2
  export * from './HookUtils.js';
3
+ export * from "./SortUtils.js";
@@ -1,2 +1,3 @@
1
1
  export * from './sequelize-utils/index.js';
2
2
  export * from './HookUtils.js';
3
+ export * from './SortUtils.js';
@@ -1 +1,10 @@
1
1
  'use strict';
2
+ var sort = require('./sort');
3
+ Object.keys(sort).forEach(function(k) {
4
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
5
+ enumerable: true,
6
+ get: function get() {
7
+ return sort[k];
8
+ }
9
+ });
10
+ });
@@ -1,3 +1,4 @@
1
+ export * from './sort/index.js';
1
2
  export type * from "./If.js";
2
3
  export type * from './IntRage.js';
3
4
  export type * from './PartialExcept.js';
@@ -0,0 +1 @@
1
+ export * from './sort/index.js';
@@ -0,0 +1 @@
1
+ 'use strict';
@@ -0,0 +1 @@
1
+ export type SortDirection = 'asc' | 'desc';
File without changes
@@ -0,0 +1 @@
1
+ 'use strict';
@@ -0,0 +1,5 @@
1
+ import type { SortDirection } from "./SortDirection.js";
2
+ export interface SortItem<TField extends string = string> {
3
+ field: TField;
4
+ direction?: SortDirection | null | undefined;
5
+ }
File without changes
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+ var SortDirection = require('./SortDirection');
3
+ var SortItem = require('./SortItem');
4
+ Object.keys(SortDirection).forEach(function(k) {
5
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
6
+ enumerable: true,
7
+ get: function get() {
8
+ return SortDirection[k];
9
+ }
10
+ });
11
+ });
12
+ Object.keys(SortItem).forEach(function(k) {
13
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
14
+ enumerable: true,
15
+ get: function get() {
16
+ return SortItem[k];
17
+ }
18
+ });
19
+ });
@@ -0,0 +1,2 @@
1
+ export * from "./SortDirection.js";
2
+ export * from "./SortItem.js";
@@ -0,0 +1,2 @@
1
+ export * from './SortDirection.js';
2
+ export * from './SortItem.js';
@@ -1,4 +1,12 @@
1
1
  'use strict';
2
+ function _array_like_to_array(arr, len) {
3
+ if (len == null || len > arr.length) len = arr.length;
4
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
5
+ return arr2;
6
+ }
7
+ function _array_with_holes(arr) {
8
+ if (Array.isArray(arr)) return arr;
9
+ }
2
10
  function _class_call_check(instance, Constructor) {
3
11
  if (!(instance instanceof Constructor)) {
4
12
  throw new TypeError("Cannot call a class as a function");
@@ -18,6 +26,48 @@ function _create_class(Constructor, protoProps, staticProps) {
18
26
  if (staticProps) _defineProperties(Constructor, staticProps);
19
27
  return Constructor;
20
28
  }
29
+ function _iterable_to_array_limit(arr, i) {
30
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
31
+ if (_i == null) return;
32
+ var _arr = [];
33
+ var _n = true;
34
+ var _d = false;
35
+ var _s, _e;
36
+ try {
37
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
38
+ _arr.push(_s.value);
39
+ if (i && _arr.length === i) break;
40
+ }
41
+ } catch (err) {
42
+ _d = true;
43
+ _e = err;
44
+ } finally{
45
+ try {
46
+ if (!_n && _i["return"] != null) _i["return"]();
47
+ } finally{
48
+ if (_d) throw _e;
49
+ }
50
+ }
51
+ return _arr;
52
+ }
53
+ function _non_iterable_rest() {
54
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
55
+ }
56
+ function _sliced_to_array(arr, i) {
57
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
58
+ }
59
+ function _type_of(obj) {
60
+ "@swc/helpers - typeof";
61
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
62
+ }
63
+ function _unsupported_iterable_to_array(o, minLen) {
64
+ if (!o) return;
65
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
66
+ var n = Object.prototype.toString.call(o).slice(8, -1);
67
+ if (n === "Object" && o.constructor) n = o.constructor.name;
68
+ if (n === "Map" || n === "Set") return Array.from(n);
69
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
70
+ }
21
71
  require('../../chunk-QHUNR4O5.cjs');
22
72
  var NumberUtils = /*#__PURE__*/ function() {
23
73
  function NumberUtils() {
@@ -31,6 +81,21 @@ var NumberUtils = /*#__PURE__*/ function() {
31
81
  return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, separator);
32
82
  }
33
83
  },
84
+ {
85
+ key: "formatThousands",
86
+ value: function formatThousands(value) {
87
+ var separator = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ",";
88
+ if (typeof value !== "number") {
89
+ throw new TypeError("formatThousands: value must be a number. got ".concat(typeof value === "undefined" ? "undefined" : _type_of(value)));
90
+ }
91
+ if (!Number.isFinite(value)) {
92
+ throw new RangeError("formatThousands: value must be a finite number. got ".concat(value));
93
+ }
94
+ var _String_split = _sliced_to_array(String(value).split("."), 2), intPart = _String_split[0], fracPart = _String_split[1];
95
+ var formattedInt = intPart.replace(/\B(?=(\d{3})+(?!\d))/g, separator);
96
+ return fracPart != null ? "".concat(formattedInt, ".").concat(fracPart) : formattedInt;
97
+ }
98
+ },
34
99
  {
35
100
  key: "formatBigNumber",
36
101
  value: function formatBigNumber(value) {
@@ -1,4 +1,5 @@
1
1
  export declare class NumberUtils {
2
2
  static formatWithThousandsSeparator(value: number, separator?: string): string;
3
+ static formatThousands(value: number, separator?: string): string;
3
4
  static formatBigNumber(value: number, precision?: number): string;
4
5
  }
@@ -1,3 +1,11 @@
1
+ function _array_like_to_array(arr, len) {
2
+ if (len == null || len > arr.length) len = arr.length;
3
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4
+ return arr2;
5
+ }
6
+ function _array_with_holes(arr) {
7
+ if (Array.isArray(arr)) return arr;
8
+ }
1
9
  function _class_call_check(instance, Constructor) {
2
10
  if (!(instance instanceof Constructor)) {
3
11
  throw new TypeError("Cannot call a class as a function");
@@ -17,6 +25,48 @@ function _create_class(Constructor, protoProps, staticProps) {
17
25
  if (staticProps) _defineProperties(Constructor, staticProps);
18
26
  return Constructor;
19
27
  }
28
+ function _iterable_to_array_limit(arr, i) {
29
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
30
+ if (_i == null) return;
31
+ var _arr = [];
32
+ var _n = true;
33
+ var _d = false;
34
+ var _s, _e;
35
+ try {
36
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
37
+ _arr.push(_s.value);
38
+ if (i && _arr.length === i) break;
39
+ }
40
+ } catch (err) {
41
+ _d = true;
42
+ _e = err;
43
+ } finally{
44
+ try {
45
+ if (!_n && _i["return"] != null) _i["return"]();
46
+ } finally{
47
+ if (_d) throw _e;
48
+ }
49
+ }
50
+ return _arr;
51
+ }
52
+ function _non_iterable_rest() {
53
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
54
+ }
55
+ function _sliced_to_array(arr, i) {
56
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
57
+ }
58
+ function _type_of(obj) {
59
+ "@swc/helpers - typeof";
60
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
61
+ }
62
+ function _unsupported_iterable_to_array(o, minLen) {
63
+ if (!o) return;
64
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
65
+ var n = Object.prototype.toString.call(o).slice(8, -1);
66
+ if (n === "Object" && o.constructor) n = o.constructor.name;
67
+ if (n === "Map" || n === "Set") return Array.from(n);
68
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
69
+ }
20
70
  import '../../chunk-S7EYY36U.js';
21
71
  var NumberUtils = /*#__PURE__*/ function() {
22
72
  "use strict";
@@ -31,6 +81,21 @@ var NumberUtils = /*#__PURE__*/ function() {
31
81
  return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, separator);
32
82
  }
33
83
  },
84
+ {
85
+ key: "formatThousands",
86
+ value: function formatThousands(value) {
87
+ var separator = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ",";
88
+ if (typeof value !== "number") {
89
+ throw new TypeError("formatThousands: value must be a number. got ".concat(typeof value === "undefined" ? "undefined" : _type_of(value)));
90
+ }
91
+ if (!Number.isFinite(value)) {
92
+ throw new RangeError("formatThousands: value must be a finite number. got ".concat(value));
93
+ }
94
+ var _String_split = _sliced_to_array(String(value).split("."), 2), intPart = _String_split[0], fracPart = _String_split[1];
95
+ var formattedInt = intPart.replace(/\B(?=(\d{3})+(?!\d))/g, separator);
96
+ return fracPart != null ? "".concat(formattedInt, ".").concat(fracPart) : formattedInt;
97
+ }
98
+ },
34
99
  {
35
100
  key: "formatBigNumber",
36
101
  value: function formatBigNumber(value) {
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+ function _class_call_check(instance, Constructor) {
3
+ if (!(instance instanceof Constructor)) {
4
+ throw new TypeError("Cannot call a class as a function");
5
+ }
6
+ }
7
+ require('../../chunk-QHUNR4O5.cjs');
8
+ var SortUtils = function SortUtils() {
9
+ _class_call_check(this, SortUtils);
10
+ };
11
+ exports.SortUtils = SortUtils;
@@ -0,0 +1,2 @@
1
+ export declare class SortUtils {
2
+ }
@@ -0,0 +1,11 @@
1
+ function _class_call_check(instance, Constructor) {
2
+ if (!(instance instanceof Constructor)) {
3
+ throw new TypeError("Cannot call a class as a function");
4
+ }
5
+ }
6
+ import '../../chunk-S7EYY36U.js';
7
+ var SortUtils = function SortUtils() {
8
+ "use strict";
9
+ _class_call_check(this, SortUtils);
10
+ };
11
+ export { SortUtils };
@@ -21,6 +21,7 @@ var RandomUtils = require('./RandomUtils');
21
21
  var Validator = require('./Validator');
22
22
  var JuminNumberUtils = require('./JuminNumberUtils');
23
23
  var Sequencer = require('./Sequencer');
24
+ var SortUtils = require('./SortUtils');
24
25
  var tryCatch = require('./try-catch');
25
26
  Object.keys(global).forEach(function(k) {
26
27
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
@@ -198,6 +199,14 @@ Object.keys(Sequencer).forEach(function(k) {
198
199
  }
199
200
  });
200
201
  });
202
+ Object.keys(SortUtils).forEach(function(k) {
203
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
204
+ enumerable: true,
205
+ get: function get() {
206
+ return SortUtils[k];
207
+ }
208
+ });
209
+ });
201
210
  Object.keys(tryCatch).forEach(function(k) {
202
211
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
203
212
  enumerable: true,
@@ -20,4 +20,5 @@ export * from './RandomUtils.js';
20
20
  export * from './Validator.js';
21
21
  export * from './JuminNumberUtils.js';
22
22
  export * from './Sequencer.js';
23
+ export * from './SortUtils.js';
23
24
  export * from './try-catch/index.js';
@@ -20,4 +20,5 @@ export * from './RandomUtils.js';
20
20
  export * from './Validator.js';
21
21
  export * from './JuminNumberUtils.js';
22
22
  export * from './Sequencer.js';
23
+ export * from './SortUtils.js';
23
24
  export * from './try-catch/index.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powfix/core-js",
3
- "version": "0.28.2",
3
+ "version": "0.30.0",
4
4
  "description": "core package",
5
5
  "author": "Kwon Kyung-Min <powfix@gmail.com>",
6
6
  "private": false,
@@ -62,6 +62,7 @@
62
62
  "uuid": "9.0.1"
63
63
  },
64
64
  "devDependencies": {
65
+ "@mui/x-data-grid": "^8.27.0",
65
66
  "@powfix/uuid": "^0.2.17",
66
67
  "@swc/core": "1.15.3",
67
68
  "@types/base-64": "1.0.2",