@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.
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=e=>e===`all`?`view`:e===`visible`?`rendered`:e;exports.normalizeExportScope=e;
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 e = (e) => e === "all" ? "view" : e === "visible" ? "rendered" : e;
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 { e as normalizeExportScope };
5
+ export { t as normalizeExportScope };
@@ -1,4 +1,5 @@
1
- import type { GridColumn, GridState } from '../model/gridTypes.unbound.js';
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 GridColumn<T>[];
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?: GridColumn<unknown>["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 { 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;
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ishibashi0112/spreadsheet-grid-core",
3
- "version": "0.64.0",
3
+ "version": "0.65.0",
4
4
  "description": "SpreadsheetGrid のフレームワーク非依存コア(状態 / 派生値計算 / コマンド / DOM コントローラ)。React 版 @ishibashi0112/spreadsheet-grid と将来の Solid 版が共有します。",
5
5
  "keywords": [
6
6
  "grid",