@ishibashi0112/spreadsheet-grid-core 0.64.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.
- package/dist/logic/exportScope.cjs +1 -1
- package/dist/logic/exportScope.js +3 -2
- package/dist/logic/gridAsk.d.ts +3 -2
- package/dist/logic/gridState.d.ts +2 -2
- package/dist/logic/valueFormatters.d.ts +3 -3
- package/dist/utils/deprecation.cjs +1 -0
- package/dist/utils/deprecation.d.ts +49 -0
- package/dist/utils/deprecation.js +39 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../utils/deprecation.cjs");var t=t=>t===`all`?(process.env.NODE_ENV!==`production`&&e.warnDeprecated(`exportScopeAll`),`view`):t===`visible`?(process.env.NODE_ENV!==`production`&&e.warnDeprecated(`exportScopeVisible`),`rendered`):t;exports.normalizeExportScope=t;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { warnDeprecated as e } from "../utils/deprecation.js";
|
|
1
2
|
//#region src/logic/exportScope.ts
|
|
2
|
-
var
|
|
3
|
+
var t = (t) => t === "all" ? (process.env.NODE_ENV !== "production" && e("exportScopeAll"), "view") : t === "visible" ? (process.env.NODE_ENV !== "production" && e("exportScopeVisible"), "rendered") : t;
|
|
3
4
|
//#endregion
|
|
4
|
-
export {
|
|
5
|
+
export { t as normalizeExportScope };
|
package/dist/logic/gridAsk.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GridState } from '../model/gridTypes.unbound.js';
|
|
2
|
+
import type { GridColumn as PublicGridColumn } from '../model/gridTypes.core.js';
|
|
2
3
|
import { type GridAskLocaleText, type GridAskOp } from './gridAskLocaleText.js';
|
|
3
4
|
export type { GridAskOp };
|
|
4
5
|
export type GridAskFilter = {
|
|
@@ -28,7 +29,7 @@ export type GridAskRequest = {
|
|
|
28
29
|
text: string;
|
|
29
30
|
};
|
|
30
31
|
export type GridAskOptions<T> = {
|
|
31
|
-
columns: readonly
|
|
32
|
+
columns: readonly PublicGridColumn<T, any>[];
|
|
32
33
|
columnHints?: Readonly<Record<string, string | false>>;
|
|
33
34
|
allowFilter?: boolean;
|
|
34
35
|
allowSort?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ColumnFilterValue, GridColumn, GridColumnState, GridFilterState, GridSortState, GridState } from '../model/gridTypes.unbound.js';
|
|
1
|
+
import type { ColumnFilterValue, GridColumn, GridColumnPinned, GridColumnState, GridFilterState, GridSortState, GridState } from '../model/gridTypes.unbound.js';
|
|
2
2
|
export declare const GRID_STATE_VERSION = 2;
|
|
3
3
|
export declare const cloneColumnFilterValue: (value: ColumnFilterValue) => ColumnFilterValue;
|
|
4
4
|
export declare const cloneColumnFilters: (columnFilters: Record<string, ColumnFilterValue>) => Record<string, ColumnFilterValue>;
|
|
@@ -23,7 +23,7 @@ export declare const applyColumnState: <T>(currentColumns: GridColumn<T>[], save
|
|
|
23
23
|
export declare const restoreColumnsFromState: <C extends {
|
|
24
24
|
key: string;
|
|
25
25
|
visible?: boolean;
|
|
26
|
-
pinned?:
|
|
26
|
+
pinned?: GridColumnPinned;
|
|
27
27
|
}>(columns: readonly C[], state: unknown) => C[];
|
|
28
28
|
export declare const isSameColumnFilterValue: (a: ColumnFilterValue, b: ColumnFilterValue) => boolean;
|
|
29
29
|
export declare const isSameFilterState: (a: GridFilterState, b: GridFilterState) => boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
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):
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e={exportScopeAll:{name:"`'all'`",since:`0.9.0`,removeIn:`1.0.0`,jsdoc:`DeprecatedCsvExportScope`,what:{ja:"エクスポートの scope `'all'`",en:"The export scope `'all'`"},instead:{ja:"`'view'` を使ってください(挙動は同じです)。",en:"Use `'view'` instead (same behavior)."}},exportScopeVisible:{name:"`'visible'`",since:`0.9.0`,removeIn:`1.0.0`,jsdoc:`DeprecatedCsvExportScope`,what:{ja:"エクスポートの scope `'visible'`",en:"The export scope `'visible'`"},instead:{ja:"`'rendered'` を使ってください(挙動は同じです。フィルターで見えている行全体なら `'view'`)。",en:"Use `'rendered'` instead (same behavior; for all rows that pass the filters, use `'view'`)."}}},t=new Set,n=e=>`[spreadsheet-grid] 非推奨: ${e.what.ja} は ${e.removeIn} で消します。${e.instead.ja}\n[spreadsheet-grid] Deprecated: ${e.what.en} will be removed in ${e.removeIn}. ${e.instead.en}`,r=(e,r)=>{process.env.NODE_ENV===`production`||t.has(e)||(t.add(e),console.warn(n(r)))},i=t=>{r(t,e[t])},a=()=>{t.clear()};exports.DEPRECATIONS=e,exports.formatDeprecationWarning=n,exports.resetDeprecationWarningsForTest=a,exports.warnDeprecated=i,exports.warnDeprecation=r;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export type Deprecation = {
|
|
2
|
+
name: string;
|
|
3
|
+
since: string;
|
|
4
|
+
removeIn: string;
|
|
5
|
+
jsdoc: string;
|
|
6
|
+
what: {
|
|
7
|
+
ja: string;
|
|
8
|
+
en: string;
|
|
9
|
+
};
|
|
10
|
+
instead: {
|
|
11
|
+
ja: string;
|
|
12
|
+
en: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare const DEPRECATIONS: {
|
|
16
|
+
exportScopeAll: {
|
|
17
|
+
name: string;
|
|
18
|
+
since: string;
|
|
19
|
+
removeIn: string;
|
|
20
|
+
jsdoc: string;
|
|
21
|
+
what: {
|
|
22
|
+
ja: string;
|
|
23
|
+
en: string;
|
|
24
|
+
};
|
|
25
|
+
instead: {
|
|
26
|
+
ja: string;
|
|
27
|
+
en: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
exportScopeVisible: {
|
|
31
|
+
name: string;
|
|
32
|
+
since: string;
|
|
33
|
+
removeIn: string;
|
|
34
|
+
jsdoc: string;
|
|
35
|
+
what: {
|
|
36
|
+
ja: string;
|
|
37
|
+
en: string;
|
|
38
|
+
};
|
|
39
|
+
instead: {
|
|
40
|
+
ja: string;
|
|
41
|
+
en: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export type DeprecationId = keyof typeof DEPRECATIONS;
|
|
46
|
+
export declare const formatDeprecationWarning: (entry: Deprecation) => string;
|
|
47
|
+
export declare const warnDeprecation: (key: string, entry: Deprecation) => void;
|
|
48
|
+
export declare const warnDeprecated: (id: DeprecationId) => void;
|
|
49
|
+
export declare const resetDeprecationWarningsForTest: () => void;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//#region src/utils/deprecation.ts
|
|
2
|
+
var e = {
|
|
3
|
+
exportScopeAll: {
|
|
4
|
+
name: "`'all'`",
|
|
5
|
+
since: "0.9.0",
|
|
6
|
+
removeIn: "1.0.0",
|
|
7
|
+
jsdoc: "DeprecatedCsvExportScope",
|
|
8
|
+
what: {
|
|
9
|
+
ja: "エクスポートの scope `'all'`",
|
|
10
|
+
en: "The export scope `'all'`"
|
|
11
|
+
},
|
|
12
|
+
instead: {
|
|
13
|
+
ja: "`'view'` を使ってください(挙動は同じです)。",
|
|
14
|
+
en: "Use `'view'` instead (same behavior)."
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
exportScopeVisible: {
|
|
18
|
+
name: "`'visible'`",
|
|
19
|
+
since: "0.9.0",
|
|
20
|
+
removeIn: "1.0.0",
|
|
21
|
+
jsdoc: "DeprecatedCsvExportScope",
|
|
22
|
+
what: {
|
|
23
|
+
ja: "エクスポートの scope `'visible'`",
|
|
24
|
+
en: "The export scope `'visible'`"
|
|
25
|
+
},
|
|
26
|
+
instead: {
|
|
27
|
+
ja: "`'rendered'` を使ってください(挙動は同じです。フィルターで見えている行全体なら `'view'`)。",
|
|
28
|
+
en: "Use `'rendered'` instead (same behavior; for all rows that pass the filters, use `'view'`)."
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}, t = /* @__PURE__ */ new Set(), n = (e) => `[spreadsheet-grid] 非推奨: ${e.what.ja} は ${e.removeIn} で消します。${e.instead.ja}\n[spreadsheet-grid] Deprecated: ${e.what.en} will be removed in ${e.removeIn}. ${e.instead.en}`, r = (e, r) => {
|
|
32
|
+
process.env.NODE_ENV === "production" || t.has(e) || (t.add(e), console.warn(n(r)));
|
|
33
|
+
}, i = (t) => {
|
|
34
|
+
r(t, e[t]);
|
|
35
|
+
}, a = () => {
|
|
36
|
+
t.clear();
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { e as DEPRECATIONS, n as formatDeprecationWarning, a as resetDeprecationWarningsForTest, i as warnDeprecated, r as warnDeprecation };
|
package/package.json
CHANGED