@erxes/ui 4.0.0-v2.10 → 4.0.0-v2.12

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 (42) hide show
  1. package/CATALOG.md +10 -3
  2. package/dist/components/combobox.js +4 -1
  3. package/dist/components/dialog.d.ts +5 -2
  4. package/dist/components/dialog.js +19 -10
  5. package/dist/components/field-control.d.ts +16 -0
  6. package/dist/components/field-control.js +19 -0
  7. package/dist/components/form-layout.d.ts +19 -0
  8. package/dist/components/form-layout.js +56 -0
  9. package/dist/components/form.d.ts +9 -2
  10. package/dist/components/form.js +17 -7
  11. package/dist/components/input.js +7 -2
  12. package/dist/components/multiselect.js +4 -1
  13. package/dist/components/popover.js +17 -13
  14. package/dist/components/select.js +16 -11
  15. package/dist/components/sheet.d.ts +5 -2
  16. package/dist/components/sheet.js +18 -9
  17. package/dist/components/textarea.js +4 -1
  18. package/dist/hooks/use-focus-first-field.d.ts +8 -0
  19. package/dist/hooks/use-focus-first-field.js +15 -0
  20. package/dist/hooks/use-page-hotkey.d.ts +2 -0
  21. package/dist/hooks/use-page-hotkey.js +4 -2
  22. package/dist/index.d.ts +4 -2
  23. package/dist/index.js +4 -2
  24. package/dist/lib/render-in-dom.d.ts +6 -0
  25. package/dist/lib/render-in-dom.js +26 -0
  26. package/dist/modules/list/ListFilter.d.ts +7 -1
  27. package/dist/modules/list/ListFilter.js +8 -2
  28. package/dist/modules/list/ViewBar.d.ts +36 -4
  29. package/dist/modules/list/ViewBar.js +33 -9
  30. package/dist/modules/record-field/components/TextField.js +1 -4
  31. package/dist/modules/record-panel/PanelForm.d.ts +12 -4
  32. package/dist/modules/record-panel/PanelForm.js +85 -12
  33. package/dist/node_modules/.pnpm/vitest@5.1.0_@opentelemetry_api@1.10.0_@types_node@26.6.6_@vitest_browser-preview@5.1.0_d78d0f63d2a6b1c4a51a56547b330411/node_modules/vitest/dist/chunks/display.BlTmubjj.js +181 -0
  34. package/dist/node_modules/.pnpm/vitest@5.1.0_@opentelemetry_api@1.10.0_@types_node@26.6.6_@vitest_browser-preview@5.1.0_d78d0f63d2a6b1c4a51a56547b330411/node_modules/vitest/dist/chunks/index.D0heQG4v.js +987 -0
  35. package/dist/node_modules/.pnpm/vitest@5.1.0_@opentelemetry_api@1.10.0_@types_node@26.6.6_@vitest_browser-preview@5.1.0_d78d0f63d2a6b1c4a51a56547b330411/node_modules/vitest/dist/chunks/pathe.M-eThtNZ.zq3TM4NT.js +176 -0
  36. package/dist/node_modules/.pnpm/vitest@5.1.0_@opentelemetry_api@1.10.0_@types_node@26.6.6_@vitest_browser-preview@5.1.0_d78d0f63d2a6b1c4a51a56547b330411/node_modules/vitest/dist/chunks/run.CjdgFZiW.js +1509 -0
  37. package/dist/node_modules/.pnpm/vitest@5.1.0_@opentelemetry_api@1.10.0_@types_node@26.6.6_@vitest_browser-preview@5.1.0_d78d0f63d2a6b1c4a51a56547b330411/node_modules/vitest/dist/chunks/source-map.DakdQc29.js +687 -0
  38. package/dist/node_modules/.pnpm/vitest@5.1.0_@opentelemetry_api@1.10.0_@types_node@26.6.6_@vitest_browser-preview@5.1.0_d78d0f63d2a6b1c4a51a56547b330411/node_modules/vitest/dist/chunks/tinyrainbow.Do8I1XRG.js +85 -0
  39. package/dist/node_modules/.pnpm/vitest@5.1.0_@opentelemetry_api@1.10.0_@types_node@26.6.6_@vitest_browser-preview@5.1.0_d78d0f63d2a6b1c4a51a56547b330411/node_modules/vitest/dist/task-utils.js +6 -0
  40. package/dist/types/UIConfig.d.ts +5 -5
  41. package/exports.txt +7 -0
  42. package/package.json +4 -1
@@ -0,0 +1,181 @@
1
+ import { c as createDOMElementFilter, f as format$1, p as plugins } from "./index.D0heQG4v.js";
2
+ // ../../node_modules/.pnpm/vitest@5.1.0_@opentelemetry+api@1.10.0_@types+node@26.6.6_@vitest+browser-preview@5.1.0_d78d0f63d2a6b1c4a51a56547b330411/node_modules/vitest/dist/chunks/display.BlTmubjj.js
3
+ const { AsymmetricMatcher, DOMCollection, DOMElement, Immutable, ReactElement, ReactTestComponent } = plugins;
4
+ const PLUGINS = [
5
+ ReactTestComponent,
6
+ ReactElement,
7
+ DOMElement,
8
+ DOMCollection,
9
+ Immutable,
10
+ AsymmetricMatcher
11
+ ];
12
+ function stringify(object, maxDepth = 10, { maxLength, filterNode, ...options } = {}) {
13
+ const MAX_LENGTH = maxLength ?? 1e4;
14
+ let result;
15
+ const filterFn = typeof filterNode === "string" ? createNodeFilterFromSelector(filterNode) : filterNode;
16
+ const plugins = filterFn ? [
17
+ ReactTestComponent,
18
+ ReactElement,
19
+ createDOMElementFilter(filterFn),
20
+ DOMCollection,
21
+ Immutable,
22
+ AsymmetricMatcher
23
+ ] : PLUGINS;
24
+ try {
25
+ result = format$1(object, {
26
+ maxDepth,
27
+ escapeString: false,
28
+ plugins,
29
+ ...options
30
+ });
31
+ } catch {
32
+ result = format$1(object, {
33
+ callToJSON: false,
34
+ maxDepth,
35
+ escapeString: false,
36
+ plugins,
37
+ ...options
38
+ });
39
+ }
40
+ return result.length >= MAX_LENGTH && maxDepth > 1 ? stringify(object, Math.floor(Math.min(maxDepth, Number.MAX_SAFE_INTEGER) / 2), {
41
+ maxLength,
42
+ filterNode,
43
+ ...options
44
+ }) : result;
45
+ }
46
+ function createNodeFilterFromSelector(selector) {
47
+ const ELEMENT_NODE = 1;
48
+ const COMMENT_NODE = 8;
49
+ return (node) => {
50
+ if (node.nodeType === COMMENT_NODE) return false;
51
+ if (node.nodeType === ELEMENT_NODE && node.matches) try {
52
+ return !node.matches(selector);
53
+ } catch {
54
+ return true;
55
+ }
56
+ return true;
57
+ };
58
+ }
59
+ const formatRegExp = /%[sdjifoOc%]/g;
60
+ function format(args, options = {}) {
61
+ const formatArg = (item) => inspect(item, options);
62
+ if (typeof args[0] !== "string") {
63
+ const objects = [];
64
+ for (let i = 0; i < args.length; i++) objects.push(formatArg(args[i]));
65
+ return objects.join(" ");
66
+ }
67
+ const len = args.length;
68
+ let i = 1;
69
+ const template = args[0];
70
+ let str = String(template).replace(formatRegExp, (x) => {
71
+ if (x === "%%") return "%";
72
+ if (i >= len) return x;
73
+ switch (x) {
74
+ case "%s": {
75
+ const value = args[i++];
76
+ if (typeof value === "bigint") return `${value.toString()}n`;
77
+ if (typeof value === "number" && value === 0 && 1 / value < 0) return "-0";
78
+ if (typeof value === "object" && value !== null) {
79
+ if (typeof value.toString === "function" && value.toString !== Object.prototype.toString) return value.toString();
80
+ return formatArg(value);
81
+ }
82
+ return String(value);
83
+ }
84
+ case "%d": {
85
+ const value = args[i++];
86
+ if (typeof value === "bigint") return `${value.toString()}n`;
87
+ if (typeof value === "symbol") return "NaN";
88
+ return Number(value).toString();
89
+ }
90
+ case "%i": {
91
+ const value = args[i++];
92
+ if (typeof value === "bigint") return `${value.toString()}n`;
93
+ return Number.parseInt(String(value)).toString();
94
+ }
95
+ case "%f": return Number.parseFloat(String(args[i++])).toString();
96
+ case "%o":
97
+ case "%O": return formatArg(args[i++]);
98
+ case "%c":
99
+ i++;
100
+ return "";
101
+ case "%j": try {
102
+ return JSON.stringify(args[i++]);
103
+ } catch (err) {
104
+ const m = err.message;
105
+ if (m.includes("circular structure") || m.includes("cyclic structures") || m.includes("cyclic object")) return "[Circular]";
106
+ throw err;
107
+ }
108
+ default: return x;
109
+ }
110
+ });
111
+ for (let x = args[i]; i < len; x = args[++i]) if (x === null || typeof x !== "object") str += ` ${typeof x === "symbol" ? x.toString() : x}`;
112
+ else str += ` ${formatArg(x)}`;
113
+ return str;
114
+ }
115
+ function inspect(obj, options) {
116
+ const { truncate, multiline, ...stringifyOptions } = options ?? {};
117
+ const prettyFormatOptions = {
118
+ singleQuote: true,
119
+ quoteKeys: false,
120
+ min: true,
121
+ spacingInner: " ",
122
+ spacingOuter: " ",
123
+ printBasicPrototype: false,
124
+ compareKeys: null,
125
+ ...multiline ? {
126
+ min: false,
127
+ spacingInner: void 0,
128
+ spacingOuter: void 0
129
+ } : {}
130
+ };
131
+ const threshold = truncate ?? 0;
132
+ const formatted = stringify(obj, void 0, {
133
+ ...prettyFormatOptions,
134
+ ...stringifyOptions,
135
+ maxLength: threshold || void 0
136
+ });
137
+ if (threshold === 0 || formatted.length <= threshold) return formatted;
138
+ const type = Object.prototype.toString.call(obj);
139
+ if (typeof obj === "string") {
140
+ let end = threshold - 1;
141
+ if (end > 0 && isHighSurrogate(formatted[end - 1])) end = end - 1;
142
+ return `'${formatted.slice(1, end)}…'`;
143
+ }
144
+ if (type === "[object Array]" || type === "[object Object]" || type === "[object Set]" || type === "[object Map]") return stringifyByMaxWidth(obj, threshold, {
145
+ ...prettyFormatOptions,
146
+ ...stringifyOptions,
147
+ maxDepth: 1
148
+ });
149
+ return stringify(obj, void 0, {
150
+ ...prettyFormatOptions,
151
+ ...stringifyOptions,
152
+ maxDepth: 0
153
+ });
154
+ }
155
+ function truncateString(string, maxLength) {
156
+ if (string.length <= maxLength) return string;
157
+ let end = maxLength - 1;
158
+ if (isHighSurrogate(string[end - 1])) end = end - 1;
159
+ return `${string.slice(0, end)}…`;
160
+ }
161
+ function stringifyByMaxWidth(object, threshold, options) {
162
+ function evaluate(x) {
163
+ return stringify(object, void 0, {
164
+ ...options,
165
+ maxWidth: x
166
+ });
167
+ }
168
+ return evaluate(binarySearch(0, threshold, (x) => evaluate(x).length <= threshold));
169
+ }
170
+ function binarySearch(x0, x1, f) {
171
+ while (x0 + 1 < x1) {
172
+ const x = Math.floor((x0 + x1) / 2);
173
+ if (f(x)) x0 = x;
174
+ else x1 = x;
175
+ }
176
+ return x0;
177
+ }
178
+ function isHighSurrogate(char) {
179
+ return char >= "\ud800" && char <= "\udbff";
180
+ }
181
+ export { formatRegExp as a, format as f, inspect as i, stringify as s, truncateString as t };