@nocobase/plugin-field-sort 1.5.0-alpha.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 (142) hide show
  1. package/LICENSE.txt +159 -0
  2. package/README.md +1 -0
  3. package/client.d.ts +2 -0
  4. package/client.js +1 -0
  5. package/dist/client/index.d.ts +15 -0
  6. package/dist/client/index.js +10 -0
  7. package/dist/client/locale.d.ts +10 -0
  8. package/dist/client/sort-interface.d.ts +131 -0
  9. package/dist/externalVersion.js +18 -0
  10. package/dist/index.d.ts +10 -0
  11. package/dist/index.js +48 -0
  12. package/dist/locale/en-US.json +1 -0
  13. package/dist/locale/zh-CN.json +1 -0
  14. package/dist/node_modules/@nocobase/lock-manager/LICENSE +661 -0
  15. package/dist/node_modules/@nocobase/lock-manager/lib/index.d.ts +10 -0
  16. package/dist/node_modules/@nocobase/lock-manager/lib/index.js +1 -0
  17. package/dist/node_modules/@nocobase/lock-manager/lib/lock-manager.d.ts +46 -0
  18. package/dist/node_modules/@nocobase/lock-manager/lib/lock-manager.js +171 -0
  19. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/client.js +12 -0
  20. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/assign.d.ts +17 -0
  21. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/assign.js +143 -0
  22. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/client.d.ts +30 -0
  23. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/client.js +88 -0
  24. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/collections-graph.d.ts +24 -0
  25. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/collections-graph.js +107 -0
  26. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/common.d.ts +14 -0
  27. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/common.js +87 -0
  28. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/date.d.ts +38 -0
  29. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/date.js +214 -0
  30. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/dayjs.d.ts +10 -0
  31. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/dayjs.js +72 -0
  32. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/forEach.d.ts +9 -0
  33. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/forEach.js +45 -0
  34. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/fs-exists.d.ts +9 -0
  35. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/fs-exists.js +46 -0
  36. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/getValuesByPath.d.ts +9 -0
  37. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/getValuesByPath.js +71 -0
  38. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/handlebars.d.ts +10 -0
  39. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/handlebars.js +73 -0
  40. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/i18n.d.ts +10 -0
  41. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/i18n.js +43 -0
  42. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/index.d.ts +38 -0
  43. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/index.js +105 -0
  44. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/isPortalInBody.d.ts +13 -0
  45. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/isPortalInBody.js +54 -0
  46. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/isValidFilter.d.ts +9 -0
  47. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/isValidFilter.js +63 -0
  48. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/json-templates.d.ts +9 -0
  49. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/json-templates.js +141 -0
  50. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/koa-multer.d.ts +15 -0
  51. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/koa-multer.js +92 -0
  52. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/log.d.ts +9 -0
  53. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/log.js +39 -0
  54. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/measure-execution-time.d.ts +9 -0
  55. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/measure-execution-time.js +44 -0
  56. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/merge.d.ts +9 -0
  57. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/merge.js +55 -0
  58. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/mixin/AsyncEmitter.d.ts +11 -0
  59. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/mixin/AsyncEmitter.js +80 -0
  60. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/mixin/index.d.ts +9 -0
  61. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/mixin/index.js +48 -0
  62. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/notification.d.ts +9 -0
  63. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/notification.js +43 -0
  64. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/number.d.ts +9 -0
  65. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/number.js +45 -0
  66. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/parse-date.d.ts +15 -0
  67. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/parse-date.js +262 -0
  68. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/parse-filter.d.ts +67 -0
  69. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/parse-filter.js +320 -0
  70. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/parseHTML.d.ts +15 -0
  71. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/parseHTML.js +42 -0
  72. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/perf-hooks.d.ts +14 -0
  73. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/perf-hooks.js +69 -0
  74. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/registry.d.ts +22 -0
  75. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/registry.js +69 -0
  76. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/requireModule.d.ts +12 -0
  77. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/requireModule.js +90 -0
  78. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/server.d.ts +19 -0
  79. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/server.js +50 -0
  80. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/toposort.d.ts +18 -0
  81. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/toposort.js +83 -0
  82. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/uid.d.ts +9 -0
  83. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/uid.js +44 -0
  84. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/url.d.ts +14 -0
  85. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/url.js +46 -0
  86. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/wrap-middleware.d.ts +1 -0
  87. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/wrap-middleware.js +63 -0
  88. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/package.json +20 -0
  89. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/plugin-symlink.d.ts +6 -0
  90. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/plugin-symlink.js +102 -0
  91. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/server.d.ts +2 -0
  92. package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/server.js +12 -0
  93. package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/.eslintrc.js +5 -0
  94. package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/.github/workflows/ci.yml +24 -0
  95. package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/.github/workflows/lint.yml +23 -0
  96. package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/bench/bench-multipart-fields-100mb-big.js +149 -0
  97. package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/bench/bench-multipart-fields-100mb-small.js +143 -0
  98. package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/bench/bench-multipart-files-100mb-big.js +154 -0
  99. package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/bench/bench-multipart-files-100mb-small.js +148 -0
  100. package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/bench/bench-urlencoded-fields-100pairs-small.js +101 -0
  101. package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/bench/bench-urlencoded-fields-900pairs-small-alt.js +84 -0
  102. package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/lib/index.js +57 -0
  103. package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/lib/types/multipart.js +653 -0
  104. package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/lib/types/urlencoded.js +350 -0
  105. package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/lib/utils.js +596 -0
  106. package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/package.json +22 -0
  107. package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/test/common.js +109 -0
  108. package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/test/test-types-multipart-charsets.js +94 -0
  109. package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/test/test-types-multipart-stream-pause.js +102 -0
  110. package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/test/test-types-multipart.js +1053 -0
  111. package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/test/test-types-urlencoded.js +488 -0
  112. package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/test/test.js +20 -0
  113. package/dist/node_modules/@nocobase/lock-manager/node_modules/multer/index.js +104 -0
  114. package/dist/node_modules/@nocobase/lock-manager/node_modules/multer/lib/counter.js +28 -0
  115. package/dist/node_modules/@nocobase/lock-manager/node_modules/multer/lib/file-appender.js +67 -0
  116. package/dist/node_modules/@nocobase/lock-manager/node_modules/multer/lib/make-middleware.js +173 -0
  117. package/dist/node_modules/@nocobase/lock-manager/node_modules/multer/lib/multer-error.js +24 -0
  118. package/dist/node_modules/@nocobase/lock-manager/node_modules/multer/lib/remove-uploaded-files.js +28 -0
  119. package/dist/node_modules/@nocobase/lock-manager/node_modules/multer/package.json +52 -0
  120. package/dist/node_modules/@nocobase/lock-manager/node_modules/multer/storage/disk.js +66 -0
  121. package/dist/node_modules/@nocobase/lock-manager/node_modules/multer/storage/memory.js +21 -0
  122. package/dist/node_modules/@nocobase/lock-manager/node_modules/streamsearch/.eslintrc.js +5 -0
  123. package/dist/node_modules/@nocobase/lock-manager/node_modules/streamsearch/.github/workflows/ci.yml +24 -0
  124. package/dist/node_modules/@nocobase/lock-manager/node_modules/streamsearch/.github/workflows/lint.yml +23 -0
  125. package/dist/node_modules/@nocobase/lock-manager/node_modules/streamsearch/lib/sbmh.js +267 -0
  126. package/dist/node_modules/@nocobase/lock-manager/node_modules/streamsearch/package.json +34 -0
  127. package/dist/node_modules/@nocobase/lock-manager/node_modules/streamsearch/test/test.js +70 -0
  128. package/dist/node_modules/@nocobase/lock-manager/package.json +1 -0
  129. package/dist/node_modules/@nocobase/lock-manager/src/__tests__/lock-manager.test.ts +169 -0
  130. package/dist/node_modules/@nocobase/lock-manager/src/index.ts +11 -0
  131. package/dist/node_modules/@nocobase/lock-manager/src/lock-manager.ts +169 -0
  132. package/dist/server/action.d.ts +26 -0
  133. package/dist/server/action.js +168 -0
  134. package/dist/server/index.d.ts +10 -0
  135. package/dist/server/index.js +48 -0
  136. package/dist/server/plugin.d.ts +19 -0
  137. package/dist/server/plugin.js +69 -0
  138. package/dist/server/sort-field.d.ts +24 -0
  139. package/dist/server/sort-field.js +197 -0
  140. package/package.json +16 -0
  141. package/server.d.ts +2 -0
  142. package/server.js +1 -0
@@ -0,0 +1,87 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
15
+ var __export = (target, all) => {
16
+ for (var name in all)
17
+ __defProp(target, name, { get: all[name], enumerable: true });
18
+ };
19
+ var __copyProps = (to, from, except, desc) => {
20
+ if (from && typeof from === "object" || typeof from === "function") {
21
+ for (let key of __getOwnPropNames(from))
22
+ if (!__hasOwnProp.call(to, key) && key !== except)
23
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
+ }
25
+ return to;
26
+ };
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var common_exports = {};
29
+ __export(common_exports, {
30
+ hasEmptyValue: () => hasEmptyValue,
31
+ isArray: () => isArray,
32
+ isEmpty: () => isEmpty,
33
+ isPlainObject: () => isPlainObject,
34
+ isString: () => isString,
35
+ nextTick: () => nextTick
36
+ });
37
+ module.exports = __toCommonJS(common_exports);
38
+ const isString = /* @__PURE__ */ __name((value) => {
39
+ return typeof value === "string";
40
+ }, "isString");
41
+ const isArray = /* @__PURE__ */ __name((value) => {
42
+ return Array.isArray(value);
43
+ }, "isArray");
44
+ const isEmpty = /* @__PURE__ */ __name((value) => {
45
+ if (isPlainObject(value)) {
46
+ return Object.keys(value).length === 0;
47
+ }
48
+ if (Array.isArray(value)) {
49
+ return value.length === 0;
50
+ }
51
+ return !value;
52
+ }, "isEmpty");
53
+ const isPlainObject = /* @__PURE__ */ __name((value) => {
54
+ if (Object.prototype.toString.call(value) !== "[object Object]") {
55
+ return false;
56
+ }
57
+ const prototype = Object.getPrototypeOf(value);
58
+ return prototype === null || prototype === Object.prototype;
59
+ }, "isPlainObject");
60
+ const hasEmptyValue = /* @__PURE__ */ __name((objOrArr) => {
61
+ let result = true;
62
+ for (const key in objOrArr) {
63
+ result = false;
64
+ if (isArray(objOrArr[key]) && objOrArr[key].length === 0) {
65
+ return true;
66
+ }
67
+ if (!objOrArr[key]) {
68
+ return true;
69
+ }
70
+ if (isPlainObject(objOrArr[key]) || isArray(objOrArr[key])) {
71
+ return hasEmptyValue(objOrArr[key]);
72
+ }
73
+ }
74
+ return result;
75
+ }, "hasEmptyValue");
76
+ const nextTick = /* @__PURE__ */ __name((fn) => {
77
+ setTimeout(fn);
78
+ }, "nextTick");
79
+ // Annotate the CommonJS export names for ESM import in node:
80
+ 0 && (module.exports = {
81
+ hasEmptyValue,
82
+ isArray,
83
+ isEmpty,
84
+ isPlainObject,
85
+ isString,
86
+ nextTick
87
+ });
@@ -0,0 +1,38 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { dayjs } from './dayjs';
10
+ export interface Str2momentOptions {
11
+ gmt?: boolean;
12
+ picker?: 'year' | 'month' | 'week' | 'quarter';
13
+ utcOffset?: number;
14
+ utc?: boolean;
15
+ }
16
+ export type Str2momentValue = string | string[] | dayjs.Dayjs | dayjs.Dayjs[];
17
+ export interface GetDefaultFormatProps {
18
+ format?: string;
19
+ dateFormat?: string;
20
+ timeFormat?: string;
21
+ picker?: 'year' | 'month' | 'week' | 'quarter';
22
+ showTime?: boolean;
23
+ }
24
+ export declare const getDefaultFormat: (props: GetDefaultFormatProps) => string;
25
+ export declare const toGmt: (value: dayjs.Dayjs) => string | dayjs.Dayjs;
26
+ export declare const toLocal: (value: dayjs.Dayjs) => string | any[] | dayjs.Dayjs;
27
+ export declare const str2moment: (value?: string | string[] | dayjs.Dayjs | dayjs.Dayjs[], options?: Str2momentOptions) => any;
28
+ export interface Moment2strOptions {
29
+ showTime?: boolean;
30
+ gmt?: boolean;
31
+ picker?: 'year' | 'month' | 'week' | 'quarter';
32
+ }
33
+ export declare const moment2str: (value?: dayjs.Dayjs, options?: Moment2strOptions) => string | any[] | dayjs.Dayjs;
34
+ /**
35
+ * from https://github.com/moment/moment/blob/dca02edaeceda3fcd52b20b51c130631a058a022/src/lib/units/offset.js#L55-L70
36
+ */
37
+ export declare function offsetFromString(string: string | number): number;
38
+ export declare const getPickerFormat: (picker: any) => "YYYY-MM" | "YYYY" | "YYYY[W]W" | "YYYY-MM-DD" | "YYYY[Q]Q";
@@ -0,0 +1,214 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __create = Object.create;
11
+ var __defProp = Object.defineProperty;
12
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
+ var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getProtoOf = Object.getPrototypeOf;
15
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
16
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
17
+ var __export = (target, all) => {
18
+ for (var name in all)
19
+ __defProp(target, name, { get: all[name], enumerable: true });
20
+ };
21
+ var __copyProps = (to, from, except, desc) => {
22
+ if (from && typeof from === "object" || typeof from === "function") {
23
+ for (let key of __getOwnPropNames(from))
24
+ if (!__hasOwnProp.call(to, key) && key !== except)
25
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
26
+ }
27
+ return to;
28
+ };
29
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
30
+ // If the importer is in node compatibility mode or this is not an ESM
31
+ // file that has been converted to a CommonJS file using a Babel-
32
+ // compatible transform (i.e. "__esModule" has not been set), then set
33
+ // "default" to the CommonJS "module.exports" for node compatibility.
34
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
35
+ mod
36
+ ));
37
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
38
+ var date_exports = {};
39
+ __export(date_exports, {
40
+ getDefaultFormat: () => getDefaultFormat,
41
+ getPickerFormat: () => getPickerFormat,
42
+ moment2str: () => moment2str,
43
+ offsetFromString: () => offsetFromString,
44
+ str2moment: () => str2moment,
45
+ toGmt: () => toGmt,
46
+ toLocal: () => toLocal
47
+ });
48
+ module.exports = __toCommonJS(date_exports);
49
+ var import_lodash = __toESM(require("lodash"));
50
+ var import_dayjs = require("./dayjs");
51
+ const getDefaultFormat = /* @__PURE__ */ __name((props) => {
52
+ if (props.format) {
53
+ return props.format;
54
+ }
55
+ if (props.dateFormat) {
56
+ if (props["showTime"]) {
57
+ return `${props.dateFormat} ${props.timeFormat || "HH:mm:ss"}`;
58
+ }
59
+ return props.dateFormat;
60
+ }
61
+ if (props["picker"] === "month") {
62
+ return "YYYY-MM";
63
+ } else if (props["picker"] === "quarter") {
64
+ return "YYYY-\\QQ";
65
+ } else if (props["picker"] === "year") {
66
+ return "YYYY";
67
+ } else if (props["picker"] === "week") {
68
+ return "YYYY[W]W";
69
+ }
70
+ return props["showTime"] ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
71
+ }, "getDefaultFormat");
72
+ const toGmt = /* @__PURE__ */ __name((value) => {
73
+ if (!value || !import_dayjs.dayjs.isDayjs(value)) {
74
+ return value;
75
+ }
76
+ return `${value.format("YYYY-MM-DD")}T${value.format("HH:mm:ss.SSS")}Z`;
77
+ }, "toGmt");
78
+ const toLocal = /* @__PURE__ */ __name((value) => {
79
+ if (!value) {
80
+ return value;
81
+ }
82
+ if (Array.isArray(value)) {
83
+ return value.map((val) => val.startOf("second").toISOString());
84
+ }
85
+ if (import_dayjs.dayjs.isDayjs(value)) {
86
+ return value.startOf("second").toISOString();
87
+ }
88
+ }, "toLocal");
89
+ const convertQuarterToFirstDay = /* @__PURE__ */ __name((quarterStr) => {
90
+ const year = parseInt(quarterStr.slice(0, 4));
91
+ const quarter = parseInt(quarterStr.slice(-1));
92
+ return (0, import_dayjs.dayjs)().quarter(quarter).year(year);
93
+ }, "convertQuarterToFirstDay");
94
+ const toMoment = /* @__PURE__ */ __name((val, options) => {
95
+ if (!val) {
96
+ return;
97
+ }
98
+ const offset = options.utcOffset !== void 0 ? options.utcOffset : -1 * (/* @__PURE__ */ new Date()).getTimezoneOffset();
99
+ const { gmt, picker, utc = true } = options;
100
+ if ((0, import_dayjs.dayjs)(val).isValid()) {
101
+ if (!utc) {
102
+ return (0, import_dayjs.dayjs)(val);
103
+ }
104
+ if (import_dayjs.dayjs.isDayjs(val)) {
105
+ return val.utcOffset(offsetFromString(offset));
106
+ }
107
+ if (gmt) {
108
+ return (0, import_dayjs.dayjs)(val).utcOffset(0);
109
+ }
110
+ return (0, import_dayjs.dayjs)(val).utcOffset(offsetFromString(offset));
111
+ } else {
112
+ return convertQuarterToFirstDay(val);
113
+ }
114
+ }, "toMoment");
115
+ const str2moment = /* @__PURE__ */ __name((value, options = {}) => {
116
+ return Array.isArray(value) ? value.map((val) => {
117
+ return toMoment(val, options);
118
+ }) : value ? toMoment(value, options) : value;
119
+ }, "str2moment");
120
+ const toStringByPicker = /* @__PURE__ */ __name((value, picker) => {
121
+ if (picker === "year") {
122
+ return value.format("YYYY") + "-01-01T00:00:00.000Z";
123
+ }
124
+ if (picker === "month") {
125
+ return value.format("YYYY-MM") + "-01T00:00:00.000Z";
126
+ }
127
+ if (picker === "quarter") {
128
+ return value.format("YYYY-MM") + "-01T00:00:00.000Z";
129
+ }
130
+ if (picker === "week") {
131
+ return value.format("YYYY-MM-DD") + "T00:00:00.000Z";
132
+ }
133
+ return value.format("YYYY-MM-DD") + "T00:00:00.000Z";
134
+ }, "toStringByPicker");
135
+ const toGmtByPicker = /* @__PURE__ */ __name((value, picker) => {
136
+ if (!value) {
137
+ return value;
138
+ }
139
+ if (Array.isArray(value)) {
140
+ return value.map((val) => toStringByPicker(val, picker));
141
+ }
142
+ if (import_dayjs.dayjs.isDayjs(value)) {
143
+ return toStringByPicker(value, picker);
144
+ }
145
+ }, "toGmtByPicker");
146
+ const moment2str = /* @__PURE__ */ __name((value, options = {}) => {
147
+ const { showTime, gmt, picker } = options;
148
+ if (!value) {
149
+ return value;
150
+ }
151
+ if (showTime) {
152
+ return gmt ? toGmt(value) : toLocal(value);
153
+ }
154
+ return toGmtByPicker(value, picker);
155
+ }, "moment2str");
156
+ function offsetFromString(string) {
157
+ if (!import_lodash.default.isString(string)) {
158
+ return string;
159
+ }
160
+ const chunkOffset = /([+-]|\d\d)/gi;
161
+ const matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, matchTimestamp = /[+-]?\d+(\.\d{1,3})?/;
162
+ let matches = (string || "").match(matchShortOffset);
163
+ if (matches === null) {
164
+ matches = (string || "").match(matchTimestamp);
165
+ }
166
+ if (matches === null) {
167
+ return null;
168
+ }
169
+ const chunk = matches[matches.length - 1] || [];
170
+ const parts = (chunk + "").match(chunkOffset) || ["-", 0, 0];
171
+ const minutes = +(Number(parts[1]) * 60) + toInt(parts[2]);
172
+ return minutes === 0 ? 0 : parts[0] === "+" ? minutes : -minutes;
173
+ }
174
+ __name(offsetFromString, "offsetFromString");
175
+ function toInt(argumentForCoercion) {
176
+ let coercedNumber = +argumentForCoercion, value = 0;
177
+ if (coercedNumber !== 0 && isFinite(coercedNumber)) {
178
+ value = absFloor(coercedNumber);
179
+ }
180
+ return value;
181
+ }
182
+ __name(toInt, "toInt");
183
+ function absFloor(number) {
184
+ if (number < 0) {
185
+ return Math.ceil(number) || 0;
186
+ } else {
187
+ return Math.floor(number);
188
+ }
189
+ }
190
+ __name(absFloor, "absFloor");
191
+ const getPickerFormat = /* @__PURE__ */ __name((picker) => {
192
+ switch (picker) {
193
+ case "week":
194
+ return "YYYY[W]W";
195
+ case "month":
196
+ return "YYYY-MM";
197
+ case "quarter":
198
+ return "YYYY[Q]Q";
199
+ case "year":
200
+ return "YYYY";
201
+ default:
202
+ return "YYYY-MM-DD";
203
+ }
204
+ }, "getPickerFormat");
205
+ // Annotate the CommonJS export names for ESM import in node:
206
+ 0 && (module.exports = {
207
+ getDefaultFormat,
208
+ getPickerFormat,
209
+ moment2str,
210
+ offsetFromString,
211
+ str2moment,
212
+ toGmt,
213
+ toLocal
214
+ });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import dayjs from 'dayjs';
10
+ export { dayjs };
@@ -0,0 +1,72 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __create = Object.create;
11
+ var __defProp = Object.defineProperty;
12
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
+ var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getProtoOf = Object.getPrototypeOf;
15
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
16
+ var __export = (target, all) => {
17
+ for (var name in all)
18
+ __defProp(target, name, { get: all[name], enumerable: true });
19
+ };
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from === "object" || typeof from === "function") {
22
+ for (let key of __getOwnPropNames(from))
23
+ if (!__hasOwnProp.call(to, key) && key !== except)
24
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
+ // If the importer is in node compatibility mode or this is not an ESM
30
+ // file that has been converted to a CommonJS file using a Babel-
31
+ // compatible transform (i.e. "__esModule" has not been set), then set
32
+ // "default" to the CommonJS "module.exports" for node compatibility.
33
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
+ mod
35
+ ));
36
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
+ var dayjs_exports = {};
38
+ __export(dayjs_exports, {
39
+ dayjs: () => import_dayjs.default
40
+ });
41
+ module.exports = __toCommonJS(dayjs_exports);
42
+ var import_dayjs = __toESM(require("dayjs"));
43
+ var import_advancedFormat = __toESM(require("dayjs/plugin/advancedFormat"));
44
+ var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat"));
45
+ var import_isBetween = __toESM(require("dayjs/plugin/isBetween"));
46
+ var import_isSameOrAfter = __toESM(require("dayjs/plugin/isSameOrAfter"));
47
+ var import_isSameOrBefore = __toESM(require("dayjs/plugin/isSameOrBefore"));
48
+ var import_isoWeek = __toESM(require("dayjs/plugin/isoWeek"));
49
+ var import_localeData = __toESM(require("dayjs/plugin/localeData"));
50
+ var import_quarterOfYear = __toESM(require("dayjs/plugin/quarterOfYear"));
51
+ var import_timezone = __toESM(require("dayjs/plugin/timezone"));
52
+ var import_utc = __toESM(require("dayjs/plugin/utc"));
53
+ var import_weekOfYear = __toESM(require("dayjs/plugin/weekOfYear"));
54
+ var import_weekYear = __toESM(require("dayjs/plugin/weekYear"));
55
+ var import_weekday = __toESM(require("dayjs/plugin/weekday"));
56
+ import_dayjs.default.extend(import_weekday.default);
57
+ import_dayjs.default.extend(import_localeData.default);
58
+ import_dayjs.default.extend(import_timezone.default);
59
+ import_dayjs.default.extend(import_utc.default);
60
+ import_dayjs.default.extend(import_quarterOfYear.default);
61
+ import_dayjs.default.extend(import_isoWeek.default);
62
+ import_dayjs.default.extend(import_isBetween.default);
63
+ import_dayjs.default.extend(import_isSameOrAfter.default);
64
+ import_dayjs.default.extend(import_isSameOrBefore.default);
65
+ import_dayjs.default.extend(import_weekOfYear.default);
66
+ import_dayjs.default.extend(import_weekYear.default);
67
+ import_dayjs.default.extend(import_customParseFormat.default);
68
+ import_dayjs.default.extend(import_advancedFormat.default);
69
+ // Annotate the CommonJS export names for ESM import in node:
70
+ 0 && (module.exports = {
71
+ dayjs
72
+ });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const forEach: (obj: any, callback: (value: any, key: string | number) => void) => void;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
15
+ var __export = (target, all) => {
16
+ for (var name in all)
17
+ __defProp(target, name, { get: all[name], enumerable: true });
18
+ };
19
+ var __copyProps = (to, from, except, desc) => {
20
+ if (from && typeof from === "object" || typeof from === "function") {
21
+ for (let key of __getOwnPropNames(from))
22
+ if (!__hasOwnProp.call(to, key) && key !== except)
23
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
+ }
25
+ return to;
26
+ };
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var forEach_exports = {};
29
+ __export(forEach_exports, {
30
+ forEach: () => forEach
31
+ });
32
+ module.exports = __toCommonJS(forEach_exports);
33
+ const forEach = /* @__PURE__ */ __name((obj, callback) => {
34
+ if (Array.isArray(obj)) {
35
+ obj.forEach(callback);
36
+ } else {
37
+ Object.keys(obj).forEach((key) => {
38
+ callback(obj[key], key);
39
+ });
40
+ }
41
+ }, "forEach");
42
+ // Annotate the CommonJS export names for ESM import in node:
43
+ 0 && (module.exports = {
44
+ forEach
45
+ });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare function fsExists(path: string): Promise<boolean>;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
15
+ var __export = (target, all) => {
16
+ for (var name in all)
17
+ __defProp(target, name, { get: all[name], enumerable: true });
18
+ };
19
+ var __copyProps = (to, from, except, desc) => {
20
+ if (from && typeof from === "object" || typeof from === "function") {
21
+ for (let key of __getOwnPropNames(from))
22
+ if (!__hasOwnProp.call(to, key) && key !== except)
23
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
+ }
25
+ return to;
26
+ };
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var fs_exists_exports = {};
29
+ __export(fs_exists_exports, {
30
+ fsExists: () => fsExists
31
+ });
32
+ module.exports = __toCommonJS(fs_exists_exports);
33
+ var import_promises = require("fs/promises");
34
+ async function fsExists(path) {
35
+ try {
36
+ await (0, import_promises.stat)(path);
37
+ return true;
38
+ } catch (error) {
39
+ return false;
40
+ }
41
+ }
42
+ __name(fsExists, "fsExists");
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ fsExists
46
+ });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const getValuesByPath: (obj: object, path: string, defaultValue?: any) => any;
@@ -0,0 +1,71 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
15
+ var __export = (target, all) => {
16
+ for (var name in all)
17
+ __defProp(target, name, { get: all[name], enumerable: true });
18
+ };
19
+ var __copyProps = (to, from, except, desc) => {
20
+ if (from && typeof from === "object" || typeof from === "function") {
21
+ for (let key of __getOwnPropNames(from))
22
+ if (!__hasOwnProp.call(to, key) && key !== except)
23
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
+ }
25
+ return to;
26
+ };
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var getValuesByPath_exports = {};
29
+ __export(getValuesByPath_exports, {
30
+ getValuesByPath: () => getValuesByPath
31
+ });
32
+ module.exports = __toCommonJS(getValuesByPath_exports);
33
+ const getValuesByPath = /* @__PURE__ */ __name((obj, path, defaultValue) => {
34
+ if (!obj) {
35
+ return defaultValue;
36
+ }
37
+ const keys = path.split(".");
38
+ let result = [];
39
+ let currentValue = obj;
40
+ let shouldReturnArray = false;
41
+ for (let i = 0; i < keys.length; i++) {
42
+ const key = keys[i];
43
+ if (Array.isArray(currentValue)) {
44
+ shouldReturnArray = true;
45
+ for (const element of currentValue) {
46
+ const value = getValuesByPath(element, keys.slice(i).join("."), defaultValue);
47
+ result = result.concat(value);
48
+ }
49
+ break;
50
+ }
51
+ if ((currentValue == null ? void 0 : currentValue[key]) === void 0) {
52
+ break;
53
+ }
54
+ currentValue = currentValue[key];
55
+ if (i === keys.length - 1) {
56
+ result.push(currentValue);
57
+ }
58
+ }
59
+ result = result.filter((item) => item !== void 0);
60
+ if (result.length === 0) {
61
+ return defaultValue;
62
+ }
63
+ if (shouldReturnArray) {
64
+ return result.filter((item) => item !== null);
65
+ }
66
+ return result[0];
67
+ }, "getValuesByPath");
68
+ // Annotate the CommonJS export names for ESM import in node:
69
+ 0 && (module.exports = {
70
+ getValuesByPath
71
+ });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import Handlebars from 'handlebars';
10
+ export { Handlebars };