@ishibashi0112/spreadsheet-grid-core 0.63.0 → 0.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/controllers/editController.cjs +1 -1
  2. package/dist/controllers/editController.d.ts +2 -0
  3. package/dist/controllers/editController.js +2 -2
  4. package/dist/controllers/saveStatusController.cjs +1 -1
  5. package/dist/controllers/saveStatusController.d.ts +1 -1
  6. package/dist/controllers/saveStatusController.js +23 -22
  7. package/dist/engine/createGridEngine.cjs +3 -1
  8. package/dist/engine/createGridEngine.js +9 -1
  9. package/dist/engine/exportCommands.cjs +2 -1
  10. package/dist/engine/exportCommands.js +3 -2
  11. package/dist/engine/gridApi.cjs +6 -1
  12. package/dist/engine/gridApi.d.ts +2 -0
  13. package/dist/engine/gridApi.js +38 -35
  14. package/dist/index.cjs +1 -1
  15. package/dist/index.d.ts +6 -0
  16. package/dist/index.js +13 -7
  17. package/dist/locales/en.cjs +1 -0
  18. package/dist/locales/en.d.ts +10 -0
  19. package/dist/locales/en.js +380 -0
  20. package/dist/logic/dateFilterCondition.cjs +1 -1
  21. package/dist/logic/dateFilterCondition.d.ts +5 -4
  22. package/dist/logic/dateFilterCondition.js +34 -30
  23. package/dist/logic/dateFilterPresets.cjs +1 -1
  24. package/dist/logic/dateFilterPresets.d.ts +5 -3
  25. package/dist/logic/dateFilterPresets.js +16 -12
  26. package/dist/logic/dateFilterTree.cjs +1 -1
  27. package/dist/logic/dateFilterTree.d.ts +2 -1
  28. package/dist/logic/dateFilterTree.js +38 -37
  29. package/dist/logic/datePickerCalendar.cjs +1 -1
  30. package/dist/logic/datePickerCalendar.d.ts +0 -3
  31. package/dist/logic/datePickerCalendar.js +4 -25
  32. package/dist/logic/exportScope.cjs +1 -1
  33. package/dist/logic/exportScope.js +3 -2
  34. package/dist/logic/featureWarnings.cjs +1 -1
  35. package/dist/logic/featureWarnings.d.ts +1 -1
  36. package/dist/logic/featureWarnings.js +8 -8
  37. package/dist/logic/filterSummary.cjs +1 -1
  38. package/dist/logic/filterSummary.d.ts +3 -1
  39. package/dist/logic/filterSummary.js +30 -25
  40. package/dist/logic/gridAsk.cjs +3 -3
  41. package/dist/logic/gridAsk.d.ts +6 -3
  42. package/dist/logic/gridAsk.js +301 -300
  43. package/dist/logic/gridAskLocaleText.cjs +1 -0
  44. package/dist/logic/gridAskLocaleText.d.ts +206 -0
  45. package/dist/logic/gridAskLocaleText.js +102 -0
  46. package/dist/logic/gridState.d.ts +2 -2
  47. package/dist/logic/groupExport.cjs +1 -1
  48. package/dist/logic/groupExport.d.ts +4 -2
  49. package/dist/logic/groupExport.js +29 -27
  50. package/dist/logic/localeText.cjs +1 -1
  51. package/dist/logic/localeText.d.ts +91 -3
  52. package/dist/logic/localeText.js +59 -21
  53. package/dist/logic/localeTextFeatures.cjs +1 -0
  54. package/dist/logic/localeTextFeatures.d.ts +82 -0
  55. package/dist/logic/localeTextFeatures.js +77 -0
  56. package/dist/logic/localeTextFilters.cjs +1 -0
  57. package/dist/logic/localeTextFilters.d.ts +31 -0
  58. package/dist/logic/localeTextFilters.js +32 -0
  59. package/dist/logic/localeTextPopups.cjs +1 -0
  60. package/dist/logic/localeTextPopups.d.ts +106 -0
  61. package/dist/logic/localeTextPopups.js +130 -0
  62. package/dist/logic/numberFilterCondition.cjs +1 -1
  63. package/dist/logic/numberFilterCondition.d.ts +3 -2
  64. package/dist/logic/numberFilterCondition.js +44 -40
  65. package/dist/logic/rowReorder.cjs +1 -1
  66. package/dist/logic/rowReorder.d.ts +0 -2
  67. package/dist/logic/rowReorder.js +2 -2
  68. package/dist/logic/scrollHint.cjs +1 -1
  69. package/dist/logic/scrollHint.d.ts +10 -3
  70. package/dist/logic/scrollHint.js +16 -11
  71. package/dist/logic/selectionAggregates.cjs +1 -1
  72. package/dist/logic/selectionAggregates.js +2 -2
  73. package/dist/logic/textFilterCondition.cjs +1 -1
  74. package/dist/logic/textFilterCondition.d.ts +3 -2
  75. package/dist/logic/textFilterCondition.js +22 -21
  76. package/dist/logic/totalRow.cjs +1 -1
  77. package/dist/logic/totalRow.d.ts +3 -2
  78. package/dist/logic/totalRow.js +33 -30
  79. package/dist/logic/validation.cjs +1 -1
  80. package/dist/logic/validation.d.ts +7 -5
  81. package/dist/logic/validation.js +33 -28
  82. package/dist/logic/valueFormatters.d.ts +3 -3
  83. package/dist/model/gridTypes.core.d.ts +643 -43
  84. package/dist/utils/clipboard.cjs +2 -1
  85. package/dist/utils/clipboard.js +1 -1
  86. package/dist/utils/deprecation.cjs +1 -0
  87. package/dist/utils/deprecation.d.ts +49 -0
  88. package/dist/utils/deprecation.js +39 -0
  89. package/dist/utils/permissions.cjs +2 -1
  90. package/dist/utils/permissions.js +2 -1
  91. package/package.json +1 -1
@@ -1,55 +1,60 @@
1
1
  import { getCellValue as e } from "../utils/permissions.js";
2
2
  import { parseNumberText as t } from "./editorValues.js";
3
+ import { formatLocaleText as n } from "./localeTextFilters.js";
4
+ import { DEFAULT_GRID_LOCALE_TEXT as r } from "./localeText.js";
3
5
  //#region src/logic/validation.ts
4
- var n = "入力値が不正です", r = (e) => e === !0 ? {
6
+ var i = r.invalidValue, a = (e, t = i) => e === !0 ? {
5
7
  valid: !0,
6
8
  message: ""
7
9
  } : e === !1 ? {
8
10
  valid: !1,
9
- message: n
11
+ message: t
10
12
  } : typeof e == "string" ? {
11
13
  valid: !1,
12
- message: e || "入力値が不正です"
14
+ message: e || t
13
15
  } : {
14
16
  valid: !1,
15
- message: e.message || "入力値が不正です"
16
- }, i = ({ editor: e }) => e?.type === "number" && (e.min != null || e.max != null || e.integer) ? e : void 0, a = (e, n) => {
17
- let r = i(e);
18
- if (!r || n == null || typeof n == "string" && !n.trim()) return null;
19
- let { min: a, max: o } = r, s = typeof n == "string" ? t(n) ?? NaN : typeof n == "number" ? n : NaN, c = Number.isFinite(s) ? r.integer && !Number.isInteger(s) ? "整数" : a != null && s < a || o != null && s > o ? o == null ? `${a} 以上` : a == null ? `${o} 以下` : `${a}〜${o} ` : "" : "数値";
20
- return c ? `${c}で入力してください` : null;
21
- }, o = (e) => !!(e.validate || i(e)), s = (e, t, n) => {
17
+ message: e.message || t
18
+ }, o = ({ editor: e }) => e?.type === "number" && (e.min != null || e.max != null || e.integer) ? e : void 0, s = (e, r, i) => {
19
+ let a = o(e);
20
+ if (!a || r == null || typeof r == "string" && !r.trim()) return null;
21
+ let { min: s, max: c } = a, l = typeof r == "string" ? t(r) ?? NaN : typeof r == "number" ? r : NaN;
22
+ return Number.isFinite(l) ? a.integer && !Number.isInteger(l) ? i.enterInteger : s != null && l < s || c != null && l > c ? c == null ? n(i.enterMin, { min: s }) : s == null ? n(i.enterMax, { max: c }) : n(i.enterRange, {
23
+ min: s,
24
+ max: c
25
+ }) : null : i.enterNumber;
26
+ }, c = (e) => !!(e.validate || o(e)), l = (e, t, n, i = r) => {
22
27
  if (e.validate) {
23
- let i = r(e.validate({
28
+ let r = a(e.validate({
24
29
  value: n,
25
30
  row: t,
26
31
  column: e
27
- }));
28
- if (!i.valid) return i.message;
32
+ }), i.invalidValue);
33
+ if (!r.valid) return r.message;
29
34
  }
30
- return a(e, n);
31
- }, c = (e, t, n) => {
35
+ return s(e, n, i);
36
+ }, u = (e, t, n, r) => {
32
37
  if ((e.validationMode ?? "mark") !== "reject") return { action: "write" };
33
- let r = s(e, t, n);
34
- return r === null ? { action: "write" } : {
38
+ let i = l(e, t, n, r);
39
+ return i === null ? { action: "write" } : {
35
40
  action: "reject",
36
- message: r
41
+ message: i
37
42
  };
38
- }, l = (t, n, r, i) => {
39
- let a = n.filter(o);
40
- if (a.length === 0) return [];
41
- let c = [];
43
+ }, d = (t, n, r, i, a) => {
44
+ let o = n.filter(c);
45
+ if (o.length === 0) return [];
46
+ let s = [];
42
47
  return t.forEach((t, n) => {
43
- if (!i?.(t, n)) for (let i of a) {
44
- let a = s(i, t, e(t, i));
45
- a !== null && c.push({
48
+ if (!i?.(t, n)) for (let i of o) {
49
+ let o = l(i, t, e(t, i), a);
50
+ o !== null && s.push({
46
51
  rowKey: r(t, n) ?? n,
47
52
  sourceRowIndex: n,
48
53
  columnKey: i.key,
49
- message: a
54
+ message: o
50
55
  });
51
56
  }
52
- }), c;
57
+ }), s;
53
58
  };
54
59
  //#endregion
55
- export { n as DEFAULT_INVALID_MESSAGE, c as decideCellWrite, s as getInvalidMessage, o as hasCellValidation, r as normalizeValidationResult, l as scanInvalidCells };
60
+ export { i as DEFAULT_INVALID_MESSAGE, u as decideCellWrite, l as getInvalidMessage, c as hasCellValidation, a as normalizeValidationResult, d as scanInvalidCells };
@@ -1,4 +1,4 @@
1
- import type { CellValueFormatter, CellValueFormatterParams } from '../model/gridTypes.unbound.js';
1
+ import type { CellValueFormatterParams, GridFrameworkTypes } from '../model/gridTypes.core.js';
2
2
  export type NumberFormatterOptions = {
3
3
  locale?: string;
4
4
  useGrouping?: boolean;
@@ -6,5 +6,5 @@ export type NumberFormatterOptions = {
6
6
  maximumFractionDigits?: number;
7
7
  emptyText?: string;
8
8
  };
9
- export declare function numberFormatter(options?: NumberFormatterOptions): <T>(params: CellValueFormatterParams<T>) => string;
10
- export declare function numberFormatter<T>(options?: NumberFormatterOptions): CellValueFormatter<T>;
9
+ export declare function numberFormatter(options?: NumberFormatterOptions): <T, F extends GridFrameworkTypes = GridFrameworkTypes>(params: CellValueFormatterParams<T, F>) => string;
10
+ export declare function numberFormatter<T>(options?: NumberFormatterOptions): <F extends GridFrameworkTypes = GridFrameworkTypes>(params: CellValueFormatterParams<T, F>) => string;