@gct-paas/render 0.1.4-dev.9 → 0.1.5-dev.1

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 (110) hide show
  1. package/dist/index.min.css +2 -0
  2. package/dist/loader.esm.min.js +1 -0
  3. package/es/Event/Dependency/controller.d.ts +1 -1
  4. package/es/Event/Dependency/controller.mjs +81 -94
  5. package/es/Event/Dependency/displayRule.mjs +130 -68
  6. package/es/Event/Dependency/useDependency.mjs +117 -0
  7. package/es/Event/Dependency/useDependencyToShow.d.ts +1 -1
  8. package/es/Event/Dependency/useDependencyToShow.mjs +100 -96
  9. package/es/Event/baseEvent.d.ts +28 -32
  10. package/es/Event/baseEvent.mjs +383 -439
  11. package/es/Event/bizServiceRequest.d.ts +1 -1
  12. package/es/Event/bizServiceRequest.mjs +29 -41
  13. package/es/Event/eventType.d.ts +1 -1
  14. package/es/Event/eventType.mjs +1 -0
  15. package/es/Event/index.d.ts +6 -3
  16. package/es/Event/index.mjs +7 -0
  17. package/es/Event/utils/appRedis.mjs +39 -49
  18. package/es/Event/utils/globalLoading.d.ts +13 -0
  19. package/es/Event/utils/globalLoading.mjs +104 -0
  20. package/es/Event/utils/processRovedInfo.mjs +228 -294
  21. package/es/Event/utils/runGlobalByPage.d.ts +4 -1
  22. package/es/Event/utils/runGlobalByPage.mjs +297 -301
  23. package/es/Event/utils/verificationVar.mjs +32 -38
  24. package/es/_virtual/_plugin-vue_export-helper.mjs +8 -0
  25. package/es/_virtual/_rolldown/runtime.mjs +13 -0
  26. package/es/components/HandwritingPad.vue.d.ts +27 -0
  27. package/es/components/HandwritingPad.vue.mjs +7 -0
  28. package/es/components/HandwritingPad.vue_vue_type_script_setup_true_name_HandwritingPad_lang.mjs +109 -0
  29. package/es/components/HandwritingPad.vue_vue_type_style_index_0_scoped_d5b980b7_lang.css +9 -0
  30. package/es/components/index.d.ts +2 -0
  31. package/es/components/index.mjs +1 -0
  32. package/es/constant/data-format.d.ts +52 -0
  33. package/es/constant/data-format.mjs +66 -0
  34. package/es/constant/date-time.d.ts +99 -0
  35. package/es/constant/date-time.mjs +187 -0
  36. package/es/constant/index.d.ts +94 -0
  37. package/es/constant/index.mjs +100 -0
  38. package/es/controller/design-render/design-render.controller.d.ts +18 -0
  39. package/es/controller/design-render/design-render.controller.mjs +78 -0
  40. package/es/controller/design-render-base/design-render-base.controller.d.ts +9 -0
  41. package/es/controller/design-render-base/design-render-base.controller.mjs +12 -0
  42. package/es/controller/design-render-container/design-render-container.controller.d.ts +4 -0
  43. package/es/controller/design-render-container/design-render-container.controller.mjs +5 -0
  44. package/es/controller/design-render-item/design-render-item.controller.d.ts +4 -0
  45. package/es/controller/design-render-item/design-render-item.controller.mjs +5 -0
  46. package/es/controller/index.d.ts +4 -0
  47. package/es/controller/index.mjs +4 -0
  48. package/es/enums/index.mjs +17 -5
  49. package/es/hooks/index.d.ts +3 -0
  50. package/es/hooks/index.mjs +3 -0
  51. package/es/hooks/use-design-render-controller/use-design-render-controller.d.ts +11 -0
  52. package/es/hooks/use-design-render-controller/use-design-render-controller.mjs +32 -0
  53. package/es/hooks/useStorageRef.mjs +35 -31
  54. package/es/hooks/widgets/useFileAttrsHooks.d.ts +28 -0
  55. package/es/hooks/widgets/useFileAttrsHooks.mjs +37 -0
  56. package/es/index.d.ts +5 -0
  57. package/es/index.mjs +44 -21
  58. package/es/interface/controller/i-design-render-base.controller.d.ts +43 -0
  59. package/es/interface/controller/i-design-render-container.controller.d.ts +7 -0
  60. package/es/interface/controller/i-design-render-item.controller.d.ts +7 -0
  61. package/es/interface/controller/i-design-render.controller.d.ts +93 -0
  62. package/es/interface/index.d.ts +12 -0
  63. package/es/interface/provider/i-render-base-node.provider.d.ts +45 -0
  64. package/es/interface/provider/i-render-container-node.provider.d.ts +30 -0
  65. package/es/interface/provider/i-render-editor-node.provider.d.ts +29 -0
  66. package/es/interface/provider/i-render-item-node.provider.d.ts +30 -0
  67. package/es/interface/state/i-design-render-base.state.d.ts +19 -0
  68. package/es/interface/state/i-design-render-container.state.d.ts +11 -0
  69. package/es/interface/state/i-design-render-item.state.d.ts +11 -0
  70. package/es/interface/state/i-design-render.state.d.ts +18 -0
  71. package/es/loader.d.ts +1 -0
  72. package/es/register/index.d.ts +1 -0
  73. package/es/register/index.mjs +2 -0
  74. package/es/register/node/node.register.d.ts +92 -0
  75. package/es/register/node/node.register.mjs +116 -0
  76. package/es/register/render-register/render-register.mjs +63 -58
  77. package/es/state/design-render/design-render.state.d.ts +13 -0
  78. package/es/state/design-render/design-render.state.mjs +15 -0
  79. package/es/state/design-render-base/design-render-base.state.d.ts +4 -0
  80. package/es/state/design-render-base/design-render-base.state.mjs +6 -0
  81. package/es/state/design-render-container/design-render-container.state.d.ts +4 -0
  82. package/es/state/design-render-item/design-render-item.state.d.ts +4 -0
  83. package/es/state/index.d.ts +4 -0
  84. package/es/utils/cacheAdapter.mjs +62 -54
  85. package/es/utils/expression/index.d.ts +1 -1
  86. package/es/utils/expression/index.mjs +105 -122
  87. package/es/utils/expression/regularExpression/methods.mjs +426 -567
  88. package/es/utils/field-attrs/basicAttrs.mjs +56 -80
  89. package/es/utils/field-attrs/index.mjs +16 -13
  90. package/es/utils/get-ref-data.mjs +41 -59
  91. package/es/utils/getFieldSchema.mjs +66 -80
  92. package/es/utils/index.d.ts +6 -3
  93. package/es/utils/index.mjs +12 -0
  94. package/es/utils/model-transformer.mjs +74 -64
  95. package/es/utils/render-plugin-pkg-util/render-plugin-pkg-util.d.ts +43 -0
  96. package/es/utils/render-plugin-pkg-util/render-plugin-pkg-util.mjs +65 -0
  97. package/es/utils/search/index.d.ts +3 -0
  98. package/es/utils/search/index.mjs +3 -0
  99. package/es/utils/search/listhook.d.ts +17 -0
  100. package/es/utils/search/listhook.mjs +70 -0
  101. package/es/utils/search/search-default-value.d.ts +7 -0
  102. package/es/utils/search/search-default-value.mjs +244 -0
  103. package/es/utils/search/search-hooks.d.ts +6 -0
  104. package/es/utils/search/search-hooks.mjs +67 -0
  105. package/es/utils/useStyle.d.ts +2 -2
  106. package/es/utils/useStyle.mjs +20 -15
  107. package/package.json +21 -17
  108. package/dist/index.esm.min.mjs +0 -7758
  109. package/dist/index.min.cjs +0 -9
  110. package/dist/index.system.min.js +0 -9
@@ -1,729 +1,588 @@
1
- import { isEqual, isNull, isUndefined } from 'lodash-es';
2
- import dayjs from 'dayjs';
3
- import utc from 'dayjs/plugin/utc';
4
- import timezone from 'dayjs/plugin/timezone';
5
- import quarterOfYear from 'dayjs/plugin/quarterOfYear';
6
- import toArray from 'dayjs/plugin/toArray';
7
- import isoWeek from 'dayjs/plugin/isoWeek';
8
- import BigNumberJS from 'bignumber.js';
9
-
1
+ import { __exportAll } from "../../../_virtual/_rolldown/runtime.mjs";
2
+ import dayjs from "dayjs";
3
+ import { isEqual, isNull, isUndefined } from "lodash-es";
4
+ import utc from "dayjs/plugin/utc";
5
+ import timezone from "dayjs/plugin/timezone";
6
+ import quarterOfYear from "dayjs/plugin/quarterOfYear";
7
+ import toArray from "dayjs/plugin/toArray";
8
+ import isoWeek from "dayjs/plugin/isoWeek";
9
+ import BigNumberJS from "bignumber.js";
10
+ //#region src/utils/expression/regularExpression/methods.ts
11
+ var methods_exports = /* @__PURE__ */ __exportAll({
12
+ ABS: () => ABS,
13
+ ADD: () => ADD,
14
+ AND: () => AND,
15
+ AVERAGE: () => AVERAGE,
16
+ CONCAT: () => CONCAT,
17
+ COUNT: () => COUNT,
18
+ DATE2TIMESTAMP: () => DATE2TIMESTAMP,
19
+ DATEFORMAT: () => DATEFORMAT,
20
+ DAY: () => DAY,
21
+ DIVISION: () => DIVISION,
22
+ EQ: () => EQ,
23
+ FINDSTR: () => FINDSTR,
24
+ FIXED: () => FIXED,
25
+ GE: () => GE,
26
+ GET: () => GET,
27
+ GT: () => GT,
28
+ HEADPUSH: () => HEADPUSH,
29
+ HOUR: () => HOUR,
30
+ IF: () => IF,
31
+ ISDATERANGE: () => ISDATERANGE,
32
+ ISEMPTY: () => ISEMPTY,
33
+ ISNULL: () => ISNULL,
34
+ ISTIMERANGE: () => ISTIMERANGE,
35
+ ISUNDEFINED: () => ISUNDEFINED,
36
+ LARGE: () => LARGE,
37
+ LASTMONTHRANGE: () => LASTMONTHRANGE,
38
+ LASTQUARTER: () => LASTQUARTER,
39
+ LASTWEEKRANGE: () => LASTWEEKRANGE,
40
+ LASTYEARRANGE: () => LASTYEARRANGE,
41
+ LE: () => LE,
42
+ LEN: () => LEN,
43
+ LOWER: () => LOWER,
44
+ LT: () => LT,
45
+ LTRIM: () => LTRIM,
46
+ MAX: () => MAX,
47
+ MIN: () => MIN,
48
+ MINUTE: () => MINUTE,
49
+ MOD: () => MOD,
50
+ MONTH: () => MONTH,
51
+ MONTHRANGE: () => MONTHRANGE,
52
+ MULTIPLICATION: () => MULTIPLICATION,
53
+ NE: () => NE,
54
+ NOW: () => NOW,
55
+ OR: () => OR,
56
+ PARSENUMBER: () => PARSENUMBER,
57
+ POWER: () => POWER,
58
+ PUSH: () => PUSH,
59
+ PUT: () => PUT,
60
+ QUARTER: () => QUARTER,
61
+ REDUCE: () => REDUCE,
62
+ REPEAT: () => REPEAT,
63
+ REPLACE: () => REPLACE,
64
+ ROUND: () => ROUND,
65
+ ROUNDUP: () => ROUNDUP,
66
+ RTRIM: () => RTRIM,
67
+ SEARCHSTR: () => SEARCHSTR,
68
+ SEQMAP: () => SEQMAP,
69
+ SMALL: () => SMALL,
70
+ SPLIT: () => SPLIT,
71
+ SQRT: () => SQRT,
72
+ STDEV: () => STDEV,
73
+ SUBSTR: () => SUBSTR,
74
+ SUBSTRING: () => SUBSTRING,
75
+ SUM: () => SUM,
76
+ SUMSQ: () => SUMSQ,
77
+ TIMESTAMP2DATE: () => TIMESTAMP2DATE,
78
+ TODAY: () => TODAY,
79
+ TRIM: () => TRIM,
80
+ TUPLE: () => TUPLE,
81
+ UPPER: () => UPPER,
82
+ WEEKRANGE: () => WEEKRANGE,
83
+ YEAR: () => YEAR,
84
+ YEARRANGE: () => YEARRANGE
85
+ });
10
86
  dayjs.extend(utc);
11
87
  dayjs.extend(timezone);
12
88
  dayjs.extend(quarterOfYear);
13
89
  dayjs.extend(toArray);
14
90
  dayjs.extend(isoWeek);
15
91
  function IF(expr, v, l) {
16
- const fn = () => {
17
- return expr ? v : l;
18
- };
19
- const isIfFn = fn;
20
- return isIfFn();
92
+ const fn = () => {
93
+ return expr ? v : l;
94
+ };
95
+ return fn();
21
96
  }
22
97
  function ISEMPTY(v) {
23
- const func = () => v == null || v === "" || v === 0;
24
- const isEmptyFn = func;
25
- return isEmptyFn();
98
+ const func = () => v == null || v === "" || v === 0;
99
+ return func();
26
100
  }
27
101
  function ISNULL(v) {
28
- const func = () => isNull(v);
29
- const isNullFn = func;
30
- return isNullFn();
102
+ const func = () => isNull(v);
103
+ return func();
31
104
  }
32
105
  function ISUNDEFINED(v) {
33
- const func = () => isUndefined(v);
34
- const isUndefinedFn = func;
35
- return isUndefinedFn();
106
+ const func = () => isUndefined(v);
107
+ return func();
36
108
  }
37
109
  function AND(...e) {
38
- const func = () => {
39
- for (const i of e) {
40
- if (!i) return false;
41
- }
42
- return true;
43
- };
44
- const isAndFn = func;
45
- return isAndFn();
110
+ const func = () => {
111
+ for (const i of e) if (!i) return false;
112
+ return true;
113
+ };
114
+ return func();
46
115
  }
47
116
  function OR(...e) {
48
- const func = () => e.some((i) => i);
49
- const isOrFn = func;
50
- return isOrFn();
117
+ const func = () => e.some((i) => i);
118
+ return func();
51
119
  }
52
120
  function EQ(v, o) {
53
- const func = () => isEqual(v, o);
54
- const isEqFn = func;
55
- return isEqFn();
121
+ const func = () => isEqual(v, o);
122
+ return func();
56
123
  }
57
124
  function NE(v, o) {
58
- const func = () => v !== o;
59
- const isNotEqual = func;
60
- return isNotEqual();
125
+ const func = () => v !== o;
126
+ return func();
61
127
  }
62
128
  function LE(v, o) {
63
- const fn = () => {
64
- if (typeof v === "number" && typeof o === "number" || typeof v === "string" && typeof o === "string" || v instanceof Date && o instanceof Date) {
65
- if (v <= o) {
66
- return true;
67
- } else {
68
- return false;
69
- }
70
- } else {
71
- return false;
72
- }
73
- };
74
- const isLeFn = fn;
75
- return isLeFn();
129
+ const fn = () => {
130
+ if (typeof v === "number" && typeof o === "number" || typeof v === "string" && typeof o === "string" || v instanceof Date && o instanceof Date) if (v <= o) return true;
131
+ else return false;
132
+ else return false;
133
+ };
134
+ return fn();
76
135
  }
77
136
  function LT(v, o) {
78
- const fn = () => {
79
- if (typeof v === "number" && typeof o === "number" || typeof v === "string" && typeof o === "string" || v instanceof Date && o instanceof Date) {
80
- return v < o;
81
- } else {
82
- return false;
83
- }
84
- };
85
- const isLtFn = fn;
86
- return isLtFn();
137
+ const fn = () => {
138
+ if (typeof v === "number" && typeof o === "number" || typeof v === "string" && typeof o === "string" || v instanceof Date && o instanceof Date) return v < o;
139
+ else return false;
140
+ };
141
+ return fn();
87
142
  }
88
143
  function GE(v, o) {
89
- const fn = () => {
90
- if (typeof v === "number" && typeof o === "number" || typeof v === "string" && typeof o === "string" || v instanceof Date && o instanceof Date) {
91
- if (v >= o) {
92
- return true;
93
- } else {
94
- return false;
95
- }
96
- } else {
97
- return false;
98
- }
99
- };
100
- const isGeFn = fn;
101
- return isGeFn();
144
+ const fn = () => {
145
+ if (typeof v === "number" && typeof o === "number" || typeof v === "string" && typeof o === "string" || v instanceof Date && o instanceof Date) if (v >= o) return true;
146
+ else return false;
147
+ else return false;
148
+ };
149
+ return fn();
102
150
  }
103
151
  function GT(v, o) {
104
- const fn = () => {
105
- if (typeof v === "number" && typeof o === "number" || typeof v === "string" && typeof o === "string" || v instanceof Date && o instanceof Date) {
106
- if (v > o) {
107
- return true;
108
- } else {
109
- return false;
110
- }
111
- } else {
112
- return false;
113
- }
114
- };
115
- const isGtFn = fn;
116
- return isGtFn();
152
+ const fn = () => {
153
+ if (typeof v === "number" && typeof o === "number" || typeof v === "string" && typeof o === "string" || v instanceof Date && o instanceof Date) if (v > o) return true;
154
+ else return false;
155
+ else return false;
156
+ };
157
+ return fn();
117
158
  }
118
159
  function LEN(v) {
119
- const fn = () => v?.length || 0;
120
- const isLenFn = fn;
121
- return isLenFn();
160
+ const fn = () => v?.length || 0;
161
+ return fn();
122
162
  }
123
163
  function CONCAT(...args) {
124
- const fn = () => args.join("");
125
- const isConcatFn = fn;
126
- return isConcatFn();
164
+ const fn = () => args.join("");
165
+ return fn();
127
166
  }
128
167
  function SUBSTRING(v = "", s, e) {
129
- const fn = () => {
130
- const val = (s < 0 ? [...v].reverse().join("") : v).slice(
131
- Math.abs(s + Number(s < 0)),
132
- Math.abs(e) + Number(s >= 0)
133
- );
134
- return s < 0 ? [...val].reverse().join("") : val;
135
- };
136
- const isSubstringFn = fn;
137
- return isSubstringFn();
168
+ const fn = () => {
169
+ const val = (s < 0 ? [...v].reverse().join("") : v).slice(Math.abs(s + Number(s < 0)), Math.abs(e) + Number(s >= 0));
170
+ return s < 0 ? [...val].reverse().join("") : val;
171
+ };
172
+ return fn();
138
173
  }
139
174
  function SUBSTR(v = "", s, l) {
140
- const fn = () => {
141
- const val = (s < 0 ? [...v].reverse().join("") : v).slice(
142
- Math.abs(s + Number(s < 0)),
143
- Math.abs(s + Number(s < 0)) + Math.abs(l)
144
- );
145
- return s < 0 ? [...val].reverse().join("") : val;
146
- };
147
- const isSubstrFn = fn;
148
- return isSubstrFn();
175
+ const fn = () => {
176
+ const val = (s < 0 ? [...v].reverse().join("") : v).slice(Math.abs(s + Number(s < 0)), Math.abs(s + Number(s < 0)) + Math.abs(l));
177
+ return s < 0 ? [...val].reverse().join("") : val;
178
+ };
179
+ return fn();
149
180
  }
150
181
  function UPPER(v = "") {
151
- const fn = () => v.toUpperCase();
152
- const isUpperFn = fn;
153
- return isUpperFn();
182
+ const fn = () => v.toUpperCase();
183
+ return fn();
154
184
  }
155
185
  function LOWER(v = "") {
156
- const fn = () => v.toLowerCase();
157
- const isLowerFn = fn;
158
- return isLowerFn();
186
+ const fn = () => v.toLowerCase();
187
+ return fn();
159
188
  }
160
189
  function TRIM(v = "") {
161
- const fn = () => v.trim();
162
- const isTrimFn = fn;
163
- return isTrimFn();
190
+ const fn = () => v.trim();
191
+ return fn();
164
192
  }
165
193
  function LTRIM(v = "") {
166
- const fn = () => v.replace(/^\s\s*/, "");
167
- const isTrimFn = fn;
168
- return isTrimFn();
194
+ const fn = () => v.replace(/^\s\s*/, "");
195
+ return fn();
169
196
  }
170
197
  function RTRIM(v = "") {
171
- const fn = () => v.replace(/\s\s*$/, "");
172
- const isTrimFn = fn;
173
- return isTrimFn();
198
+ const fn = () => v.replace(/\s\s*$/, "");
199
+ return fn();
174
200
  }
175
201
  function REPEAT(v = "", c = "") {
176
- const fn = () => v.match(new RegExp(c, "g"))?.length || null;
177
- const isRepeatFn = fn;
178
- return isRepeatFn();
202
+ const fn = () => v.match(new RegExp(c, "g"))?.length || null;
203
+ return fn();
179
204
  }
180
205
  function REPLACE(v = "", o = "", t = "") {
181
- const fn = () => v.replace(new RegExp(o, "g"), t);
182
- const isReplaceFn = fn;
183
- return isReplaceFn();
206
+ const fn = () => v.replace(new RegExp(o, "g"), t);
207
+ return fn();
184
208
  }
185
209
  function FINDSTR(v = "", c = "") {
186
- const fn = () => v.includes(c);
187
- const isFindStrFn = fn;
188
- return isFindStrFn();
210
+ const fn = () => v.includes(c);
211
+ return fn();
189
212
  }
190
213
  function SEARCHSTR(v = "", c = "") {
191
- const fn = () => {
192
- const l = v.match(new RegExp(c, "g"))?.length;
193
- return l ? l : 0;
194
- };
195
- const isSearchstrFn = fn;
196
- return isSearchstrFn();
214
+ const fn = () => {
215
+ const l = v.match(new RegExp(c, "g"))?.length;
216
+ return l ? l : 0;
217
+ };
218
+ return fn();
197
219
  }
198
220
  function PARSENUMBER(v = "") {
199
- const fn = () => {
200
- const num = parseFloat(v);
201
- return isNaN(num) ? null : num;
202
- };
203
- const isParsenumberFn = fn;
204
- return isParsenumberFn();
221
+ const fn = () => {
222
+ const num = parseFloat(v);
223
+ return isNaN(num) ? null : num;
224
+ };
225
+ return fn();
205
226
  }
206
227
  function SPLIT(v = "", c = "") {
207
- const fn = () => v.split(c);
208
- const isSplitFn = fn;
209
- return isSplitFn();
228
+ const fn = () => v.split(c);
229
+ return fn();
210
230
  }
211
231
  function SUM(...args) {
212
- const v = args.flat().filter((i) => i !== "" && i !== null && i !== void 0);
213
- if (!v.length) return "";
214
- const fn = () => v.reduce(plus, 0);
215
- const isSumFn = fn;
216
- return isSumFn();
232
+ const v = args.flat().filter((i) => i !== "" && i !== null && i !== void 0);
233
+ if (!v.length) return "";
234
+ const fn = () => v.reduce(plus, 0);
235
+ return fn();
217
236
  }
218
237
  function ADD(...args) {
219
- const v = args.flat();
220
- const fn = () => v.reduce(plus, 0);
221
- const isSumFn = fn;
222
- return isSumFn();
238
+ const v = args.flat();
239
+ const fn = () => v.reduce(plus, 0);
240
+ return fn();
223
241
  }
224
242
  function REDUCE(v, ...args) {
225
- const fn = () => args.reduce(minus, v);
226
- const isReduceFN = fn;
227
- return isReduceFN();
243
+ const fn = () => args.reduce(minus, v);
244
+ return fn();
228
245
  }
229
246
  function MULTIPLICATION(val, ...args) {
230
- const v = args.flat().filter((i) => i !== "" && i !== null && i !== void 0);
231
- if (!v.length) return "";
232
- const fn = () => v.reduce(multipliedBy, val);
233
- const isMultiFn = fn;
234
- return isMultiFn();
247
+ const v = args.flat().filter((i) => i !== "" && i !== null && i !== void 0);
248
+ if (!v.length) return "";
249
+ const fn = () => v.reduce(multipliedBy, val);
250
+ return fn();
235
251
  }
236
252
  function DIVISION(v, ...args) {
237
- const fn = () => args.reduce(div, v);
238
- const isDivision = fn;
239
- return isDivision();
253
+ const fn = () => args.reduce(div, v);
254
+ return fn();
240
255
  }
241
256
  function FIXED(v, n) {
242
- const fn = () => {
243
- if (n < 0) {
244
- throw new Error("Decimal places should be non-negative.");
245
- }
246
- const arr = v.toString().split(".");
247
- const [integer, decimal = ""] = arr;
248
- if (n == 0) {
249
- return integer;
250
- }
251
- let decimalArr = decimal.split("");
252
- if (decimalArr.length > n) {
253
- decimalArr = decimalArr.slice(0, n);
254
- } else {
255
- const count = decimalArr.length;
256
- for (let i = 0; i < n - count; i++) {
257
- decimalArr.push("0");
258
- }
259
- }
260
- return `${integer}.${decimalArr.join("")}`;
261
- };
262
- const isFixedFn = fn;
263
- return isFixedFn();
257
+ const fn = () => {
258
+ if (n < 0) throw new Error("Decimal places should be non-negative.");
259
+ const [integer, decimal = ""] = v.toString().split(".");
260
+ if (n == 0) return integer;
261
+ let decimalArr = decimal.split("");
262
+ if (decimalArr.length > n) decimalArr = decimalArr.slice(0, n);
263
+ else {
264
+ const count = decimalArr.length;
265
+ for (let i = 0; i < n - count; i++) decimalArr.push("0");
266
+ }
267
+ return `${integer}.${decimalArr.join("")}`;
268
+ };
269
+ return fn();
264
270
  }
265
271
  function ROUND(v, n) {
266
- const fn = () => {
267
- if (v === null || v === "" || v === void 0) return "";
268
- if (n < 0) {
269
- throw new Error("Decimal places should be non-negative.");
270
- }
271
- const digits = Math.trunc(n);
272
- const numValue = Number(v);
273
- if (isNaN(numValue)) return "";
274
- const num = numValue > 0 ? (+(Math.round(Number(numValue + `e${digits}`)) + `e-${digits}`)).toFixed(digits) : -(+(Math.round(Number(-numValue + `e${digits}`)) + `e-${digits}`)).toFixed(digits);
275
- return parseFloat(num + "");
276
- };
277
- const isRoundFn = fn;
278
- return isRoundFn();
272
+ const fn = () => {
273
+ if (v === null || v === "" || v === void 0) return "";
274
+ if (n < 0) throw new Error("Decimal places should be non-negative.");
275
+ const digits = Math.trunc(n);
276
+ const numValue = Number(v);
277
+ if (isNaN(numValue)) return "";
278
+ const num = numValue > 0 ? (+(Math.round(Number(numValue + `e${digits}`)) + `e-${digits}`)).toFixed(digits) : -(+(Math.round(Number(-numValue + `e${digits}`)) + `e-${digits}`)).toFixed(digits);
279
+ return parseFloat(num + "");
280
+ };
281
+ return fn();
279
282
  }
280
283
  function ROUNDUP(v, n) {
281
- if (v === null || v === "" || v === void 0) return "";
282
- if (n < 0) {
283
- throw new Error("Decimal places should be non-negative.");
284
- }
285
- n = n ? parseInt(n + "") : 0;
286
- return new BigNumberJS(v).decimalPlaces(n, BigNumberJS.ROUND_UP).toNumber();
284
+ if (v === null || v === "" || v === void 0) return "";
285
+ if (n < 0) throw new Error("Decimal places should be non-negative.");
286
+ n = n ? parseInt(n + "") : 0;
287
+ return new BigNumberJS(v).decimalPlaces(n, BigNumberJS.ROUND_UP).toNumber();
287
288
  }
288
289
  function MAX(...args) {
289
- const v = args.flat().filter((i) => i !== "" && i !== null && i !== void 0);
290
- if (!v.length) return "";
291
- const fn = () => Math.max.apply(null, v);
292
- const isMaxFn = fn;
293
- return isMaxFn();
290
+ const v = args.flat().filter((i) => i !== "" && i !== null && i !== void 0);
291
+ if (!v.length) return "";
292
+ const fn = () => Math.max.apply(null, v);
293
+ return fn();
294
294
  }
295
295
  function LARGE(v, n) {
296
- const fn = () => {
297
- if (n < 1 || n > v.length) {
298
- throw new Error(
299
- "Invalid value of n. It should be between 1 and the array length."
300
- );
301
- }
302
- const s = v.sort((a, b) => b - a);
303
- return s[n - 1];
304
- };
305
- const isLargeFn = fn;
306
- return isLargeFn();
296
+ const fn = () => {
297
+ if (n < 1 || n > v.length) throw new Error("Invalid value of n. It should be between 1 and the array length.");
298
+ return v.sort((a, b) => b - a)[n - 1];
299
+ };
300
+ return fn();
307
301
  }
308
302
  function MIN(...args) {
309
- const v = args.flat().filter((i) => i !== "" && i !== null && i !== void 0);
310
- if (!v.length) return "";
311
- const fn = () => Math.min.apply(null, v);
312
- const isMinFn = fn;
313
- return isMinFn();
303
+ const v = args.flat().filter((i) => i !== "" && i !== null && i !== void 0);
304
+ if (!v.length) return "";
305
+ const fn = () => Math.min.apply(null, v);
306
+ return fn();
314
307
  }
315
308
  function SMALL(v, n) {
316
- const fn = () => {
317
- if (n < 1 || n > v.length) {
318
- throw new Error(
319
- "Invalid value of n. It should be between 1 and the array length."
320
- );
321
- }
322
- const s = v.sort((a, b) => a - b);
323
- return s[n - 1];
324
- };
325
- const isSmallFn = fn;
326
- return isSmallFn();
309
+ const fn = () => {
310
+ if (n < 1 || n > v.length) throw new Error("Invalid value of n. It should be between 1 and the array length.");
311
+ return v.sort((a, b) => a - b)[n - 1];
312
+ };
313
+ return fn();
327
314
  }
328
315
  function AVERAGE(...args) {
329
- const numbers = args.flat().filter((i) => i !== "" && i !== null && i !== void 0);
330
- const count = numbers.length;
331
- if (!count) return "";
332
- let sum = new BigNumberJS(0);
333
- for (const number of numbers) {
334
- sum = sum.plus(number);
335
- }
336
- return sum.dividedBy(count).toNumber();
316
+ const numbers = args.flat().filter((i) => i !== "" && i !== null && i !== void 0);
317
+ const count = numbers.length;
318
+ if (!count) return "";
319
+ let sum = new BigNumberJS(0);
320
+ for (const number of numbers) sum = sum.plus(number);
321
+ return sum.dividedBy(count).toNumber();
337
322
  }
338
323
  function ABS(v) {
339
- const fn = () => Math.abs.call(null, v);
340
- const isAbsFn = fn;
341
- return isAbsFn();
324
+ const fn = () => Math.abs.call(null, v);
325
+ return fn();
342
326
  }
343
327
  function MOD(v, n) {
344
- const fn = () => {
345
- if (v === 0) {
346
- throw new Error("The second value should not be zero.");
347
- }
348
- const result = new BigNumberJS(v).mod(n).toNumber();
349
- if (isNaN(result)) return "";
350
- return result;
351
- };
352
- const isModFn = fn;
353
- return isModFn();
328
+ const fn = () => {
329
+ if (v === 0) throw new Error("The second value should not be zero.");
330
+ const result = new BigNumberJS(v).mod(n).toNumber();
331
+ if (isNaN(result)) return "";
332
+ return result;
333
+ };
334
+ return fn();
354
335
  }
355
336
  function toSafeNumber(x) {
356
- if (typeof x === "number") {
357
- return Number.isFinite(x) ? x : null;
358
- }
359
- if (typeof x === "string") {
360
- const s = x.trim();
361
- if (s === "") return null;
362
- const n = Number(s);
363
- return Number.isFinite(n) ? n : null;
364
- }
365
- if (typeof x === "bigint") {
366
- const n = Number(x);
367
- return Number.isFinite(n) ? n : null;
368
- }
369
- return null;
337
+ if (typeof x === "number") return Number.isFinite(x) ? x : null;
338
+ if (typeof x === "string") {
339
+ const s = x.trim();
340
+ if (s === "") return null;
341
+ const n = Number(s);
342
+ return Number.isFinite(n) ? n : null;
343
+ }
344
+ if (typeof x === "bigint") {
345
+ const n = Number(x);
346
+ return Number.isFinite(n) ? n : null;
347
+ }
348
+ return null;
370
349
  }
371
350
  function POWER(v, n) {
372
- const fn = () => {
373
- const base = toSafeNumber(v);
374
- const exp = toSafeNumber(n);
375
- if (base === null || exp === null) return NaN;
376
- const MAX_EXP = 1e9;
377
- if (Math.abs(exp) > MAX_EXP) {
378
- return exp > 0 ? Infinity : 0;
379
- }
380
- const result = Math.pow(base, exp);
381
- return result;
382
- };
383
- const isProwerFn = fn;
384
- return isProwerFn();
351
+ const fn = () => {
352
+ const base = toSafeNumber(v);
353
+ const exp = toSafeNumber(n);
354
+ if (base === null || exp === null) return NaN;
355
+ if (Math.abs(exp) > 1e9) return exp > 0 ? Infinity : 0;
356
+ return Math.pow(base, exp);
357
+ };
358
+ return fn();
385
359
  }
386
360
  function SQRT(v) {
387
- const fn = () => {
388
- const n = toSafeNumber(v);
389
- if (n === null) return NaN;
390
- return Math.sqrt(n);
391
- };
392
- const isSqrt = fn;
393
- return isSqrt();
361
+ const fn = () => {
362
+ const n = toSafeNumber(v);
363
+ if (n === null) return NaN;
364
+ return Math.sqrt(n);
365
+ };
366
+ return fn();
394
367
  }
395
368
  function GET(v, p) {
396
- const fn = () => {
397
- if (Array.isArray(v)) {
398
- if (typeof p === "number") {
399
- return v[p];
400
- } else {
401
- throw new Error("For arrays, the second argument should be a number.");
402
- }
403
- } else if (typeof v === "object") {
404
- if (typeof p === "string") {
405
- return v[p];
406
- } else {
407
- throw new Error(
408
- "For objects, the second argument (b) should be a string."
409
- );
410
- }
411
- } else {
412
- throw new Error(
413
- "Unsupported data type. The first argument (a) should be an array or an object."
414
- );
415
- }
416
- };
417
- const isGetFn = fn;
418
- return isGetFn();
369
+ const fn = () => {
370
+ if (Array.isArray(v)) if (typeof p === "number") return v[p];
371
+ else throw new Error("For arrays, the second argument should be a number.");
372
+ else if (typeof v === "object") if (typeof p === "string") return v[p];
373
+ else throw new Error("For objects, the second argument (b) should be a string.");
374
+ else throw new Error("Unsupported data type. The first argument (a) should be an array or an object.");
375
+ };
376
+ return fn();
419
377
  }
420
378
  function PUT(a, b, c) {
421
- const fn = () => {
422
- if (Array.isArray(a)) {
423
- if (typeof b === "number" && b >= 0 && b < a.length) {
424
- a[b] = c;
425
- } else {
426
- throw new Error(
427
- "For arrays, the second argument (b) should be a number."
428
- );
429
- }
430
- } else if (typeof a === "object") {
431
- if (typeof b === "string" && a) {
432
- a[b] = c;
433
- } else {
434
- throw new Error(
435
- "For objects, the second argument (b) should be a string."
436
- );
437
- }
438
- } else {
439
- throw new Error(
440
- "Unsupported data type. The first argument (a) should be an array or an object."
441
- );
442
- }
443
- return a;
444
- };
445
- const isPutFn = fn;
446
- return isPutFn();
379
+ const fn = () => {
380
+ if (Array.isArray(a)) if (typeof b === "number" && b >= 0 && b < a.length) a[b] = c;
381
+ else throw new Error("For arrays, the second argument (b) should be a number.");
382
+ else if (typeof a === "object") if (typeof b === "string" && a) a[b] = c;
383
+ else throw new Error("For objects, the second argument (b) should be a string.");
384
+ else throw new Error("Unsupported data type. The first argument (a) should be an array or an object.");
385
+ return a;
386
+ };
387
+ return fn();
447
388
  }
448
389
  function PUSH(v, n) {
449
- const fn = () => {
450
- if (!n) {
451
- throw new Error(
452
- "For arrays, the second argument should not be null or undefined"
453
- );
454
- }
455
- v.push(n);
456
- return v;
457
- };
458
- const isPushFn = fn;
459
- return isPushFn();
390
+ const fn = () => {
391
+ if (!n) throw new Error("For arrays, the second argument should not be null or undefined");
392
+ v.push(n);
393
+ return v;
394
+ };
395
+ return fn();
460
396
  }
461
397
  function HEADPUSH(v, n) {
462
- const fn = () => {
463
- if (!n) {
464
- throw new Error(
465
- "For arrays, the second argument should not be null or undefined"
466
- );
467
- }
468
- v.unshift(n);
469
- return v;
470
- };
471
- const isHeadpushFn = fn;
472
- return isHeadpushFn();
398
+ const fn = () => {
399
+ if (!n) throw new Error("For arrays, the second argument should not be null or undefined");
400
+ v.unshift(n);
401
+ return v;
402
+ };
403
+ return fn();
473
404
  }
474
405
  function TIMESTAMP2DATE(v) {
475
- if (!v) return;
476
- const fn = () => {
477
- if (!v) {
478
- throw new Error("the frist argument should not be null");
479
- }
480
- const dateObj = new Date(v * 1e3);
481
- const year = dateObj.getFullYear();
482
- const month = String(dateObj.getMonth() + 1).padStart(2, "0");
483
- const day = String(dateObj.getDate()).padStart(2, "0");
484
- const hours = String(dateObj.getHours()).padStart(2, "0");
485
- const minutes = String(dateObj.getMinutes()).padStart(2, "0");
486
- const seconds = String(dateObj.getSeconds()).padStart(2, "0");
487
- return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
488
- };
489
- const isTimeStampFn = fn;
490
- return isTimeStampFn();
406
+ if (!v) return;
407
+ const fn = () => {
408
+ if (!v) throw new Error("the frist argument should not be null");
409
+ const dateObj = /* @__PURE__ */ new Date(v * 1e3);
410
+ return `${dateObj.getFullYear()}-${String(dateObj.getMonth() + 1).padStart(2, "0")}-${String(dateObj.getDate()).padStart(2, "0")} ${String(dateObj.getHours()).padStart(2, "0")}:${String(dateObj.getMinutes()).padStart(2, "0")}:${String(dateObj.getSeconds()).padStart(2, "0")}`;
411
+ };
412
+ return fn();
491
413
  }
492
414
  function DATE2TIMESTAMP(v) {
493
- if (!v) return;
494
- const fn = () => dayjs(v).unix();
495
- const isDateToTimestampFn = fn;
496
- return isDateToTimestampFn();
415
+ if (!v) return;
416
+ const fn = () => dayjs(v).unix();
417
+ return fn();
497
418
  }
498
419
  function DATEFORMAT(v, f) {
499
- if (!v) return;
500
- const fn = () => dayjs(v).format(f);
501
- const isDateFormatFn = fn;
502
- return isDateFormatFn();
420
+ if (!v) return;
421
+ const fn = () => dayjs(v).format(f);
422
+ return fn();
503
423
  }
504
424
  function NOW() {
505
- return dayjs().format("YYYY-MM-DD HH:MM:ss");
425
+ return dayjs().format("YYYY-MM-DD HH:MM:ss");
506
426
  }
507
427
  function TODAY() {
508
- return dayjs().format("YYYY-MM-DD");
428
+ return dayjs().format("YYYY-MM-DD");
509
429
  }
510
430
  function YEAR(v) {
511
- return dayjs(v).year();
431
+ return dayjs(v).year();
512
432
  }
513
433
  function MONTH(v) {
514
- const fn = () => {
515
- const m = dayjs(v).month();
516
- return m;
517
- };
518
- const isMonthFn = fn;
519
- return isMonthFn();
434
+ const fn = () => {
435
+ return dayjs(v).month();
436
+ };
437
+ return fn();
520
438
  }
521
439
  function DAY(v) {
522
- const fn = () => {
523
- const d = dayjs(v).day();
524
- return d;
525
- };
526
- const isDayFn = fn;
527
- return isDayFn();
440
+ const fn = () => {
441
+ return dayjs(v).day();
442
+ };
443
+ return fn();
528
444
  }
529
445
  function HOUR(v) {
530
- const fn = () => {
531
- const h = dayjs(v).hour();
532
- return h;
533
- };
534
- const isHourFn = fn;
535
- return isHourFn();
446
+ const fn = () => {
447
+ return dayjs(v).hour();
448
+ };
449
+ return fn();
536
450
  }
537
451
  function MINUTE(v) {
538
- const fn = () => {
539
- const m = dayjs(v).minute();
540
- return m;
541
- };
542
- const isMinuteFn = fn;
543
- return isMinuteFn();
452
+ const fn = () => {
453
+ return dayjs(v).minute();
454
+ };
455
+ return fn();
544
456
  }
545
457
  function WEEKRANGE() {
546
- const fn = () => {
547
- const startOfWeek = convertToCST(dayjs().startOf("week").toDate());
548
- const endOfWeek = convertToCST(dayjs().endOf("week").toDate());
549
- return [startOfWeek, endOfWeek];
550
- };
551
- const isWeekDayFn = fn;
552
- return isWeekDayFn();
458
+ const fn = () => {
459
+ return [convertToCST(dayjs().startOf("week").toDate()), convertToCST(dayjs().endOf("week").toDate())];
460
+ };
461
+ return fn();
553
462
  }
554
463
  function LASTWEEKRANGE() {
555
- const fn = () => {
556
- const startOfLastWeek = convertToCST(
557
- dayjs().subtract(1, "week").startOf("week").toDate()
558
- );
559
- const endOfLastWeek = convertToCST(
560
- dayjs().subtract(1, "week").endOf("week").toDate()
561
- );
562
- return [startOfLastWeek, endOfLastWeek];
563
- };
564
- const isLastWeekFn = fn;
565
- return isLastWeekFn();
464
+ const fn = () => {
465
+ return [convertToCST(dayjs().subtract(1, "week").startOf("week").toDate()), convertToCST(dayjs().subtract(1, "week").endOf("week").toDate())];
466
+ };
467
+ return fn();
566
468
  }
567
469
  function MONTHRANGE() {
568
- const fn = () => {
569
- const startOfLastMonth = convertToCST(dayjs().startOf("month").toDate());
570
- const endOfLastMonth = convertToCST(dayjs().endOf("month").toDate());
571
- return [startOfLastMonth, endOfLastMonth];
572
- };
573
- const isMonthRangeFn = fn;
574
- return isMonthRangeFn();
470
+ const fn = () => {
471
+ return [convertToCST(dayjs().startOf("month").toDate()), convertToCST(dayjs().endOf("month").toDate())];
472
+ };
473
+ return fn();
575
474
  }
576
475
  function LASTMONTHRANGE() {
577
- const fn = () => {
578
- const startOfLastMonth = convertToCST(
579
- dayjs().subtract(1, "month").startOf("month").toDate()
580
- );
581
- const endOfLastMonth = convertToCST(
582
- dayjs().subtract(1, "month").endOf("month").toDate()
583
- );
584
- return [startOfLastMonth, endOfLastMonth];
585
- };
586
- const isLastMonthRangeFn = fn;
587
- return isLastMonthRangeFn();
476
+ const fn = () => {
477
+ return [convertToCST(dayjs().subtract(1, "month").startOf("month").toDate()), convertToCST(dayjs().subtract(1, "month").endOf("month").toDate())];
478
+ };
479
+ return fn();
588
480
  }
589
481
  function YEARRANGE() {
590
- const fn = () => {
591
- const startOfYear = convertToCST(dayjs().startOf("year").toDate());
592
- const endOfYear = convertToCST(dayjs().endOf("year").toDate());
593
- return [startOfYear, endOfYear];
594
- };
595
- const isYearRange = fn;
596
- return isYearRange();
482
+ const fn = () => {
483
+ return [convertToCST(dayjs().startOf("year").toDate()), convertToCST(dayjs().endOf("year").toDate())];
484
+ };
485
+ return fn();
597
486
  }
598
487
  function LASTYEARRANGE() {
599
- const fn = () => {
600
- const startOfLastYear = convertToCST(
601
- dayjs().subtract(1, "year").startOf("year").toDate()
602
- );
603
- const endOfLastYear = convertToCST(
604
- dayjs().subtract(1, "year").endOf("year").toDate()
605
- );
606
- return [startOfLastYear, endOfLastYear];
607
- };
608
- const isLastYearRange = fn;
609
- return isLastYearRange();
488
+ const fn = () => {
489
+ return [convertToCST(dayjs().subtract(1, "year").startOf("year").toDate()), convertToCST(dayjs().subtract(1, "year").endOf("year").toDate())];
490
+ };
491
+ return fn();
610
492
  }
611
493
  function QUARTER() {
612
- const fn = () => {
613
- const currentQuarter = Math.floor((dayjs().month() + 3) / 3);
614
- const startOfCurrentQuarter = convertToCST(
615
- dayjs().quarter(currentQuarter).startOf("quarter").toDate()
616
- );
617
- const endOfCurrentQuarter = convertToCST(
618
- dayjs().quarter(currentQuarter).endOf("quarter").toDate()
619
- );
620
- return [startOfCurrentQuarter, endOfCurrentQuarter];
621
- };
622
- const isQuarterFn = fn;
623
- return isQuarterFn();
494
+ const fn = () => {
495
+ const currentQuarter = Math.floor((dayjs().month() + 3) / 3);
496
+ return [convertToCST(dayjs().quarter(currentQuarter).startOf("quarter").toDate()), convertToCST(dayjs().quarter(currentQuarter).endOf("quarter").toDate())];
497
+ };
498
+ return fn();
624
499
  }
625
500
  function LASTQUARTER() {
626
- const fn = () => {
627
- const currentQuarter = Math.floor((dayjs().month() + 3) / 3);
628
- const startOfLastQuarter = convertToCST(
629
- dayjs().quarter(currentQuarter - 1).startOf("quarter").toDate()
630
- );
631
- const endOfLastQuarter = convertToCST(
632
- dayjs().quarter(currentQuarter - 1).endOf("quarter").toDate()
633
- );
634
- return [startOfLastQuarter, endOfLastQuarter];
635
- };
636
- const isLastQuarter = fn;
637
- return isLastQuarter();
501
+ const fn = () => {
502
+ const currentQuarter = Math.floor((dayjs().month() + 3) / 3);
503
+ return [convertToCST(dayjs().quarter(currentQuarter - 1).startOf("quarter").toDate()), convertToCST(dayjs().quarter(currentQuarter - 1).endOf("quarter").toDate())];
504
+ };
505
+ return fn();
638
506
  }
639
507
  function ISDATERANGE(v, r) {
640
- const fn = () => {
641
- const [startDate, endDate] = r;
642
- return v >= startDate && v <= endDate;
643
- };
644
- const isDateRangFn = fn;
645
- return isDateRangFn();
508
+ const fn = () => {
509
+ const [startDate, endDate] = r;
510
+ return v >= startDate && v <= endDate;
511
+ };
512
+ return fn();
646
513
  }
647
514
  function ISTIMERANGE(v, r) {
648
- const fn = () => {
649
- const [startTime, endTime] = r;
650
- const dtTime = dayjs(v, "HH:mm");
651
- if (startTime > endTime) {
652
- const startTimeAfterMidnight = dayjs(startTime, "HH:mm");
653
- const endTimeBeforeMidnight = dayjs(endTime, "HH:mm").add(1, "day");
654
- return dtTime >= startTimeAfterMidnight || dtTime <= endTimeBeforeMidnight;
655
- } else {
656
- return dtTime >= dayjs(startTime, "HH:mm") && dtTime <= dayjs(endTime, "HH:mm");
657
- }
658
- };
659
- const isTimeRangFn = fn;
660
- return isTimeRangFn();
515
+ const fn = () => {
516
+ const [startTime, endTime] = r;
517
+ const dtTime = dayjs(v, "HH:mm");
518
+ if (startTime > endTime) {
519
+ const startTimeAfterMidnight = dayjs(startTime, "HH:mm");
520
+ const endTimeBeforeMidnight = dayjs(endTime, "HH:mm").add(1, "day");
521
+ return dtTime >= startTimeAfterMidnight || dtTime <= endTimeBeforeMidnight;
522
+ } else return dtTime >= dayjs(startTime, "HH:mm") && dtTime <= dayjs(endTime, "HH:mm");
523
+ };
524
+ return fn();
661
525
  }
662
526
  function convertToCST(isoDateString) {
663
- const cstFormattedDate = dayjs(isoDateString).tz("America/Chicago").format("YYYY-MM-DD HH:mm:ss.SSSSSSSSS ZZ");
664
- return cstFormattedDate;
527
+ return dayjs(isoDateString).tz("America/Chicago").format("YYYY-MM-DD HH:mm:ss.SSSSSSSSS ZZ");
665
528
  }
666
529
  function TUPLE(...args) {
667
- return [...args];
530
+ return [...args];
668
531
  }
669
532
  function SEQMAP(...args) {
670
- const len = (args.length - args.length % 2) / 2;
671
- const map = {};
672
- Array(len).forEach((i) => {
673
- const key = args[i * 2];
674
- const value = args[i * 2 + 1];
675
- map[key] = value;
676
- });
677
- return map;
533
+ const len = (args.length - args.length % 2) / 2;
534
+ const map = {};
535
+ Array(len).forEach((i) => {
536
+ const key = args[i * 2];
537
+ map[key] = args[i * 2 + 1];
538
+ });
539
+ return map;
678
540
  }
679
541
  function SUMSQ(...args) {
680
- args = args.flat().filter((i) => i !== "" && i !== null && i !== void 0);
681
- if (args.length === 0) return "";
682
- const squares = args.map((value) => {
683
- const square = multipliedBy(value, value);
684
- return square !== "" ? square : new BigNumberJS(0).toNumber();
685
- });
686
- return squares.reduce((sum, square) => {
687
- return plus(sum, square) || BigNumberJS(0).toNumber();
688
- }, new BigNumberJS(0).toNumber());
689
- }
542
+ args = args.flat().filter((i) => i !== "" && i !== null && i !== void 0);
543
+ if (args.length === 0) return "";
544
+ return args.map((value) => {
545
+ const square = multipliedBy(value, value);
546
+ return square !== "" ? square : new BigNumberJS(0).toNumber();
547
+ }).reduce((sum, square) => {
548
+ return plus(sum, square) || BigNumberJS(0).toNumber();
549
+ }, new BigNumberJS(0).toNumber());
550
+ }
551
+ /**数组计数 */
690
552
  function COUNT(v) {
691
- if (!Array.isArray(v)) {
692
- return "";
693
- }
694
- return v.length;
553
+ if (!Array.isArray(v)) return "";
554
+ return v.length;
695
555
  }
556
+ /**标准差函数 */
696
557
  function STDEV(...args) {
697
- const data = args.flat().map((v) => Number(v)).filter((v) => Number.isFinite(v));
698
- if (data.length < 2) {
699
- return "";
700
- }
701
- const mean = data.reduce((sum, val) => sum + val, 0) / data.length;
702
- const variance = data.reduce((sum, val) => {
703
- const diff = val - mean;
704
- return sum + diff * diff;
705
- }, 0) / (data.length - 1);
706
- return Math.sqrt(variance);
558
+ const data = args.flat().map((v) => Number(v)).filter((v) => Number.isFinite(v));
559
+ if (data.length < 2) return "";
560
+ const mean = data.reduce((sum, val) => sum + val, 0) / data.length;
561
+ const variance = data.reduce((sum, val) => {
562
+ const diff = val - mean;
563
+ return sum + diff * diff;
564
+ }, 0) / (data.length - 1);
565
+ return Math.sqrt(variance);
707
566
  }
708
567
  function plus(a, b) {
709
- const result = new BigNumberJS(a).plus(new BigNumberJS(b)).toNumber();
710
- if (isNaN(result)) return "";
711
- return result;
568
+ const result = new BigNumberJS(a).plus(new BigNumberJS(b)).toNumber();
569
+ if (isNaN(result)) return "";
570
+ return result;
712
571
  }
713
572
  function minus(a, b) {
714
- const result = new BigNumberJS(a).minus(new BigNumberJS(b)).toNumber();
715
- if (isNaN(result)) return "";
716
- return result;
573
+ const result = new BigNumberJS(a).minus(new BigNumberJS(b)).toNumber();
574
+ if (isNaN(result)) return "";
575
+ return result;
717
576
  }
718
577
  function multipliedBy(a, b) {
719
- const result = new BigNumberJS(a).multipliedBy(new BigNumberJS(b)).toNumber();
720
- if (isNaN(result)) return "";
721
- return result;
578
+ const result = new BigNumberJS(a).multipliedBy(new BigNumberJS(b)).toNumber();
579
+ if (isNaN(result)) return "";
580
+ return result;
722
581
  }
723
582
  function div(a, b) {
724
- const result = new BigNumberJS(a).div(new BigNumberJS(b)).toNumber();
725
- if (isNaN(result)) return "";
726
- return result;
583
+ const result = new BigNumberJS(a).div(new BigNumberJS(b)).toNumber();
584
+ if (isNaN(result)) return "";
585
+ return result;
727
586
  }
728
-
729
- export { ABS, ADD, AND, AVERAGE, CONCAT, COUNT, DATE2TIMESTAMP, DATEFORMAT, DAY, DIVISION, EQ, FINDSTR, FIXED, GE, GET, GT, HEADPUSH, HOUR, IF, ISDATERANGE, ISEMPTY, ISNULL, ISTIMERANGE, ISUNDEFINED, LARGE, LASTMONTHRANGE, LASTQUARTER, LASTWEEKRANGE, LASTYEARRANGE, LE, LEN, LOWER, LT, LTRIM, MAX, MIN, MINUTE, MOD, MONTH, MONTHRANGE, MULTIPLICATION, NE, NOW, OR, PARSENUMBER, POWER, PUSH, PUT, QUARTER, REDUCE, REPEAT, REPLACE, ROUND, ROUNDUP, RTRIM, SEARCHSTR, SEQMAP, SMALL, SPLIT, SQRT, STDEV, SUBSTR, SUBSTRING, SUM, SUMSQ, TIMESTAMP2DATE, TODAY, TRIM, TUPLE, UPPER, WEEKRANGE, YEAR, YEARRANGE };
587
+ //#endregion
588
+ export { methods_exports };