@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.
- package/dist/controllers/editController.cjs +1 -1
- package/dist/controllers/editController.d.ts +2 -0
- package/dist/controllers/editController.js +2 -2
- package/dist/controllers/saveStatusController.cjs +1 -1
- package/dist/controllers/saveStatusController.d.ts +1 -1
- package/dist/controllers/saveStatusController.js +23 -22
- package/dist/engine/createGridEngine.cjs +3 -1
- package/dist/engine/createGridEngine.js +9 -1
- package/dist/engine/exportCommands.cjs +2 -1
- package/dist/engine/exportCommands.js +3 -2
- package/dist/engine/gridApi.cjs +6 -1
- package/dist/engine/gridApi.d.ts +2 -0
- package/dist/engine/gridApi.js +38 -35
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +13 -7
- package/dist/locales/en.cjs +1 -0
- package/dist/locales/en.d.ts +10 -0
- package/dist/locales/en.js +380 -0
- package/dist/logic/dateFilterCondition.cjs +1 -1
- package/dist/logic/dateFilterCondition.d.ts +5 -4
- package/dist/logic/dateFilterCondition.js +34 -30
- package/dist/logic/dateFilterPresets.cjs +1 -1
- package/dist/logic/dateFilterPresets.d.ts +5 -3
- package/dist/logic/dateFilterPresets.js +16 -12
- package/dist/logic/dateFilterTree.cjs +1 -1
- package/dist/logic/dateFilterTree.d.ts +2 -1
- package/dist/logic/dateFilterTree.js +38 -37
- package/dist/logic/datePickerCalendar.cjs +1 -1
- package/dist/logic/datePickerCalendar.d.ts +0 -3
- package/dist/logic/datePickerCalendar.js +4 -25
- package/dist/logic/exportScope.cjs +1 -1
- package/dist/logic/exportScope.js +3 -2
- package/dist/logic/featureWarnings.cjs +1 -1
- package/dist/logic/featureWarnings.d.ts +1 -1
- package/dist/logic/featureWarnings.js +8 -8
- package/dist/logic/filterSummary.cjs +1 -1
- package/dist/logic/filterSummary.d.ts +3 -1
- package/dist/logic/filterSummary.js +30 -25
- package/dist/logic/gridAsk.cjs +3 -3
- package/dist/logic/gridAsk.d.ts +6 -3
- package/dist/logic/gridAsk.js +301 -300
- package/dist/logic/gridAskLocaleText.cjs +1 -0
- package/dist/logic/gridAskLocaleText.d.ts +206 -0
- package/dist/logic/gridAskLocaleText.js +102 -0
- package/dist/logic/gridState.d.ts +2 -2
- package/dist/logic/groupExport.cjs +1 -1
- package/dist/logic/groupExport.d.ts +4 -2
- package/dist/logic/groupExport.js +29 -27
- package/dist/logic/localeText.cjs +1 -1
- package/dist/logic/localeText.d.ts +91 -3
- package/dist/logic/localeText.js +59 -21
- package/dist/logic/localeTextFeatures.cjs +1 -0
- package/dist/logic/localeTextFeatures.d.ts +82 -0
- package/dist/logic/localeTextFeatures.js +77 -0
- package/dist/logic/localeTextFilters.cjs +1 -0
- package/dist/logic/localeTextFilters.d.ts +31 -0
- package/dist/logic/localeTextFilters.js +32 -0
- package/dist/logic/localeTextPopups.cjs +1 -0
- package/dist/logic/localeTextPopups.d.ts +106 -0
- package/dist/logic/localeTextPopups.js +130 -0
- package/dist/logic/numberFilterCondition.cjs +1 -1
- package/dist/logic/numberFilterCondition.d.ts +3 -2
- package/dist/logic/numberFilterCondition.js +44 -40
- package/dist/logic/rowReorder.cjs +1 -1
- package/dist/logic/rowReorder.d.ts +0 -2
- package/dist/logic/rowReorder.js +2 -2
- package/dist/logic/scrollHint.cjs +1 -1
- package/dist/logic/scrollHint.d.ts +10 -3
- package/dist/logic/scrollHint.js +16 -11
- package/dist/logic/selectionAggregates.cjs +1 -1
- package/dist/logic/selectionAggregates.js +2 -2
- package/dist/logic/textFilterCondition.cjs +1 -1
- package/dist/logic/textFilterCondition.d.ts +3 -2
- package/dist/logic/textFilterCondition.js +22 -21
- package/dist/logic/totalRow.cjs +1 -1
- package/dist/logic/totalRow.d.ts +3 -2
- package/dist/logic/totalRow.js +33 -30
- package/dist/logic/validation.cjs +1 -1
- package/dist/logic/validation.d.ts +7 -5
- package/dist/logic/validation.js +33 -28
- package/dist/logic/valueFormatters.d.ts +3 -3
- package/dist/model/gridTypes.core.d.ts +643 -43
- package/dist/utils/clipboard.cjs +2 -1
- package/dist/utils/clipboard.js +1 -1
- package/dist/utils/deprecation.cjs +1 -0
- package/dist/utils/deprecation.d.ts +49 -0
- package/dist/utils/deprecation.js +39 -0
- package/dist/utils/permissions.cjs +2 -1
- package/dist/utils/permissions.js +2 -1
- package/package.json +1 -1
package/dist/utils/clipboard.cjs
CHANGED
|
@@ -5,4 +5,5 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
5
5
|
`)||(r.push(i),n.push(r)),n},o=e=>/[\t\n\r"]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e,s=e=>e.map(o).join(` `),c=e=>e!==void 0&&!t.isSyntheticColumnKey(e.key),l=(e,t,n)=>{let r=[];for(let i=t;r.length<n;i+=1){let t=e[i];(t===void 0||c(t))&&r.push(i)}return r},u=(t,n)=>{let r=e.getCellValue(t,n);return n.formatClipboardValue?n.formatClipboardValue(r,t):String(r??``)},d=e=>e.filter(c),f=(e,t,r,i,a)=>{if(!i)return``;let o=[];if(i.type===`cell`){let t=n.normalizeCellRange(i.range),l=r.slice(t.start.col,t.end.col+1).filter(c);if(l.length===0)return``;for(let n=t.start.row;n<=t.end.row;n+=1){let t=e(n);t&&(a&&!a(t,n)||o.push(s(l.map(e=>u(t,e)))))}return o.join(`
|
|
6
6
|
`)}if(i.type===`row`){let t=n.normalizeRowRange(i.startRow,i.endRow),l=r.filter(c);if(l.length===0)return``;for(let n=t.startRow;n<=t.endRow;n+=1){let t=e(n);t&&(a&&!a(t,n)||o.push(s(l.map(e=>u(t,e)))))}return o.join(`
|
|
7
7
|
`)}let l=n.normalizeColumnRange(i.startCol,i.endCol),d=r.slice(l.startCol,l.endCol+1).filter(c);if(d.length===0)return``;for(let n=0;n<t;n+=1){let t=e(n);t&&(a&&!a(t,n)||o.push(s(d.map(e=>u(t,e)))))}return o.join(`
|
|
8
|
-
`)},p=(t,n,a,o,s,c,u)=>{if(o.length===0)return t;let d=[...t],f=l(a,c,o.reduce((e,t)=>Math.max(e,t.length),0));for(let t=0;t<o.length;t+=1){let c=s+t,l=n(c);if(l===void 0)continue;let p=d[l];if(!p)continue;let m=p,h=!1;for(let n=0;n<o[t].length;n+=1){let s=f[n],d=a[s];if(!d||!u(l,s,p,d,c))continue;let g=o[t][n],_=r.resolveCellParser(d)(g,p);i.decideCellWrite(d,p,_).action!==`reject`&&(m=e.setCellValue(m,d,_),h=!0)}h&&(d[l]=m)}return d},m=(e,t,n,a,o,s)=>{let c=[],u=l(t,o,n.reduce((e,t)=>Math.max(e,t.length),0));for(let o=0;o<n.length;o+=1){let l=a+o,d=e(l);if(d)for(let e=0;e<n[o].length;e+=1){let a=u[e],f=t[a];if(!f||!s(l,a,d,f))continue;let p=r.resolveCellParser(f)(n[o][e],d);i.decideCellWrite(f,d,p).action!==`reject`&&c.push({viewIndex:l,column:f,value:p})}}return c},h=e=>{let{body:t,activeElement:n}=document;if(!t)return!1;let r=document.createElement(`textarea`);r.value=e,r.setAttribute(`readonly`,``),r.style.position=`fixed`,r.style.top=`0`,r.style.left=`-9999px`,r.style.opacity=`0`,t.appendChild(r);let i;try{r.select(),i=document.execCommand(`copy`)}catch{i=!1}finally{t.removeChild(r),n instanceof HTMLElement&&n.focus()}return i},g=async e=>{if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}return h(e)?!0:(console.warn(`[SpreadsheetGrid] クリップボードへのコピーに失敗しました(navigator.clipboard が利用できず、execCommand フォールバックも失敗)
|
|
8
|
+
`)},p=(t,n,a,o,s,c,u)=>{if(o.length===0)return t;let d=[...t],f=l(a,c,o.reduce((e,t)=>Math.max(e,t.length),0));for(let t=0;t<o.length;t+=1){let c=s+t,l=n(c);if(l===void 0)continue;let p=d[l];if(!p)continue;let m=p,h=!1;for(let n=0;n<o[t].length;n+=1){let s=f[n],d=a[s];if(!d||!u(l,s,p,d,c))continue;let g=o[t][n],_=r.resolveCellParser(d)(g,p);i.decideCellWrite(d,p,_).action!==`reject`&&(m=e.setCellValue(m,d,_),h=!0)}h&&(d[l]=m)}return d},m=(e,t,n,a,o,s)=>{let c=[],u=l(t,o,n.reduce((e,t)=>Math.max(e,t.length),0));for(let o=0;o<n.length;o+=1){let l=a+o,d=e(l);if(d)for(let e=0;e<n[o].length;e+=1){let a=u[e],f=t[a];if(!f||!s(l,a,d,f))continue;let p=r.resolveCellParser(f)(n[o][e],d);i.decideCellWrite(f,d,p).action!==`reject`&&c.push({viewIndex:l,column:f,value:p})}}return c},h=e=>{let{body:t,activeElement:n}=document;if(!t)return!1;let r=document.createElement(`textarea`);r.value=e,r.setAttribute(`readonly`,``),r.style.position=`fixed`,r.style.top=`0`,r.style.left=`-9999px`,r.style.opacity=`0`,t.appendChild(r);let i;try{r.select(),i=document.execCommand(`copy`)}catch{i=!1}finally{t.removeChild(r),n instanceof HTMLElement&&n.focus()}return i},g=async e=>{if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}return h(e)?!0:(console.warn(`[SpreadsheetGrid] クリップボードへのコピーに失敗しました(navigator.clipboard が利用できず、execCommand フォールバックも失敗)。
|
|
9
|
+
[SpreadsheetGrid] Failed to copy to the clipboard (navigator.clipboard is unavailable and the execCommand fallback failed).`),!1)};exports.applyClipboardMatrixToRows=p,exports.buildClipboardCellEdits=m,exports.copyTextViaExecCommand=h,exports.escapeTsvField=o,exports.filterClipboardColumns=d,exports.formatClipboardCell=u,exports.joinTsvRow=s,exports.parseClipboardText=a,exports.resolvePasteColumnIndexes=l,exports.serializeSelectionToTsv=f,exports.writeTextToClipboard=g;
|
package/dist/utils/clipboard.js
CHANGED
|
@@ -132,7 +132,7 @@ var c = (e) => {
|
|
|
132
132
|
if (navigator.clipboard?.writeText) try {
|
|
133
133
|
return await navigator.clipboard.writeText(e), !0;
|
|
134
134
|
} catch {}
|
|
135
|
-
return v(e) ? !0 : (console.warn("[SpreadsheetGrid] クリップボードへのコピーに失敗しました(navigator.clipboard が利用できず、execCommand フォールバックも失敗)
|
|
135
|
+
return v(e) ? !0 : (console.warn("[SpreadsheetGrid] クリップボードへのコピーに失敗しました(navigator.clipboard が利用できず、execCommand フォールバックも失敗)。\n[SpreadsheetGrid] Failed to copy to the clipboard (navigator.clipboard is unavailable and the execCommand fallback failed)."), !1);
|
|
136
136
|
};
|
|
137
137
|
//#endregion
|
|
138
138
|
export { g as applyClipboardMatrixToRows, _ as buildClipboardCellEdits, v as copyTextViaExecCommand, l as escapeTsvField, m as filterClipboardColumns, p as formatClipboardCell, u as joinTsvRow, c as parseClipboardText, f as resolvePasteColumnIndexes, h as serializeSelectionToTsv, y as writeTextToClipboard };
|
|
@@ -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 };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=(e,t)=>!e.readOnly&&!t.readOnly&&t.editable!==!1,t=(t,n,r,i,a,o)=>e(t,a)?t.canEditCell?t.canEditCell(n,r,i,a,o??{sourceRowIndex:n,rowKey:n}):!0:!1,n=(e,t)=>({sourceRowIndex:e.getSourceIndex(t)??t,rowKey:e.getRowKey(t)??t}),r=(t,r,i,a,o,s)=>e(t,s)?t.canEditCell?t.canEditCell(i,a,o,s,n(r,i)):!0:!1,i=(e,t)=>t.getValue?t.getValue(e):e[t.key],a=new Set,o=(e,t)=>{process.env.NODE_ENV!==`production`&&(a.has(t)||typeof e!=`object`||!e||Object.hasOwn(e,t)||(a.add(t),console.warn(`[spreadsheet-grid] 列 \`${t}\` は getValue だけで setValue が無いため、書き込んだ値は行に新しいプロパティ \`${t}\` として足され、表示(getValue)は変わりません。編集させないなら \`editable: false\`、書き戻すなら \`setValue\`
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=(e,t)=>!e.readOnly&&!t.readOnly&&t.editable!==!1,t=(t,n,r,i,a,o)=>e(t,a)?t.canEditCell?t.canEditCell(n,r,i,a,o??{sourceRowIndex:n,rowKey:n}):!0:!1,n=(e,t)=>({sourceRowIndex:e.getSourceIndex(t)??t,rowKey:e.getRowKey(t)??t}),r=(t,r,i,a,o,s)=>e(t,s)?t.canEditCell?t.canEditCell(i,a,o,s,n(r,i)):!0:!1,i=(e,t)=>t.getValue?t.getValue(e):e[t.key],a=new Set,o=(e,t)=>{process.env.NODE_ENV!==`production`&&(a.has(t)||typeof e!=`object`||!e||Object.hasOwn(e,t)||(a.add(t),console.warn(`[spreadsheet-grid] 列 \`${t}\` は getValue だけで setValue が無いため、書き込んだ値は行に新しいプロパティ \`${t}\` として足され、表示(getValue)は変わりません。編集させないなら \`editable: false\`、書き戻すなら \`setValue\` を渡してください。
|
|
2
|
+
[spreadsheet-grid] Column \`${t}\` has getValue but no setValue, so a written value is added to the row as a new property \`${t}\` and the display (getValue) does not change. Pass \`editable: false\` to prevent editing, or \`setValue\` to write the value back.`)))},s=(e,t,n)=>t.setValue?t.setValue(e,n):(t.getValue&&o(e,t.key),{...e,[t.key]:n});exports.getCellValue=i,exports.isCellEditable=t,exports.isViewCellEditable=r,exports.resolveCanEditCellContext=n,exports.setCellValue=s;
|
|
@@ -6,7 +6,8 @@ var e = (e, t) => !e.readOnly && !t.readOnly && t.editable !== !1, t = (t, n, r,
|
|
|
6
6
|
sourceRowIndex: e.getSourceIndex(t) ?? t,
|
|
7
7
|
rowKey: e.getRowKey(t) ?? t
|
|
8
8
|
}), r = (t, r, i, a, o, s) => e(t, s) ? t.canEditCell ? t.canEditCell(i, a, o, s, n(r, i)) : !0 : !1, i = (e, t) => t.getValue ? t.getValue(e) : e[t.key], a = /* @__PURE__ */ new Set(), o = (e, t) => {
|
|
9
|
-
process.env.NODE_ENV !== "production" && (a.has(t) || typeof e != "object" || !e || Object.hasOwn(e, t) || (a.add(t), console.warn(`[spreadsheet-grid] 列 \`${t}\` は getValue だけで setValue が無いため、書き込んだ値は行に新しいプロパティ \`${t}\` として足され、表示(getValue)は変わりません。編集させないなら \`editable: false\`、書き戻すなら \`setValue\`
|
|
9
|
+
process.env.NODE_ENV !== "production" && (a.has(t) || typeof e != "object" || !e || Object.hasOwn(e, t) || (a.add(t), console.warn(`[spreadsheet-grid] 列 \`${t}\` は getValue だけで setValue が無いため、書き込んだ値は行に新しいプロパティ \`${t}\` として足され、表示(getValue)は変わりません。編集させないなら \`editable: false\`、書き戻すなら \`setValue\` を渡してください。
|
|
10
|
+
[spreadsheet-grid] Column \`${t}\` has getValue but no setValue, so a written value is added to the row as a new property \`${t}\` and the display (getValue) does not change. Pass \`editable: false\` to prevent editing, or \`setValue\` to write the value back.`)));
|
|
10
11
|
}, s = (e, t, n) => t.setValue ? t.setValue(e, n) : (t.getValue && o(e, t.key), {
|
|
11
12
|
...e,
|
|
12
13
|
[t.key]: n
|
package/package.json
CHANGED