@ishibashi0112/spreadsheet-grid-core 0.39.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/LICENSE +21 -0
- package/dist/controllers/autoHeightMeasurer.cjs +1 -0
- package/dist/controllers/autoHeightMeasurer.d.ts +30 -0
- package/dist/controllers/autoHeightMeasurer.js +74 -0
- package/dist/controllers/clipboardController.cjs +2 -0
- package/dist/controllers/clipboardController.d.ts +31 -0
- package/dist/controllers/clipboardController.js +88 -0
- package/dist/controllers/columnAutosizeRunner.cjs +1 -0
- package/dist/controllers/columnAutosizeRunner.d.ts +31 -0
- package/dist/controllers/columnAutosizeRunner.js +61 -0
- package/dist/controllers/columnHeaderDragController.cjs +1 -0
- package/dist/controllers/columnHeaderDragController.d.ts +44 -0
- package/dist/controllers/columnHeaderDragController.js +256 -0
- package/dist/controllers/columnMenuController.cjs +1 -0
- package/dist/controllers/columnMenuController.d.ts +49 -0
- package/dist/controllers/columnMenuController.js +110 -0
- package/dist/controllers/contextMenuController.cjs +1 -0
- package/dist/controllers/contextMenuController.d.ts +30 -0
- package/dist/controllers/contextMenuController.js +65 -0
- package/dist/controllers/debouncedValueStore.cjs +1 -0
- package/dist/controllers/debouncedValueStore.d.ts +11 -0
- package/dist/controllers/debouncedValueStore.js +22 -0
- package/dist/controllers/editController.cjs +1 -0
- package/dist/controllers/editController.d.ts +27 -0
- package/dist/controllers/editController.js +76 -0
- package/dist/controllers/filterPopoverController.cjs +1 -0
- package/dist/controllers/filterPopoverController.d.ts +53 -0
- package/dist/controllers/filterPopoverController.js +146 -0
- package/dist/controllers/globalFilteredOrder.cjs +1 -0
- package/dist/controllers/globalFilteredOrder.d.ts +38 -0
- package/dist/controllers/globalFilteredOrder.js +78 -0
- package/dist/controllers/historyController.cjs +1 -0
- package/dist/controllers/historyController.d.ts +28 -0
- package/dist/controllers/historyController.js +52 -0
- package/dist/controllers/keyboardController.cjs +1 -0
- package/dist/controllers/keyboardController.d.ts +36 -0
- package/dist/controllers/keyboardController.js +111 -0
- package/dist/controllers/panelHeaderDragController.cjs +1 -0
- package/dist/controllers/panelHeaderDragController.d.ts +21 -0
- package/dist/controllers/panelHeaderDragController.js +32 -0
- package/dist/controllers/pointerInteractionsController.cjs +1 -0
- package/dist/controllers/pointerInteractionsController.d.ts +74 -0
- package/dist/controllers/pointerInteractionsController.js +262 -0
- package/dist/controllers/popoverSupport.cjs +1 -0
- package/dist/controllers/popoverSupport.d.ts +18 -0
- package/dist/controllers/popoverSupport.js +25 -0
- package/dist/controllers/rowDragController.cjs +1 -0
- package/dist/controllers/rowDragController.d.ts +40 -0
- package/dist/controllers/rowDragController.js +192 -0
- package/dist/controllers/scrollSyncController.cjs +1 -0
- package/dist/controllers/scrollSyncController.d.ts +17 -0
- package/dist/controllers/scrollSyncController.js +51 -0
- package/dist/controllers/selectOptionsCollector.cjs +1 -0
- package/dist/controllers/selectOptionsCollector.d.ts +31 -0
- package/dist/controllers/selectOptionsCollector.js +88 -0
- package/dist/controllers/serverSideRowModel.cjs +1 -0
- package/dist/controllers/serverSideRowModel.d.ts +36 -0
- package/dist/controllers/serverSideRowModel.js +153 -0
- package/dist/controllers/systemColorSchemeStore.cjs +1 -0
- package/dist/controllers/systemColorSchemeStore.d.ts +5 -0
- package/dist/controllers/systemColorSchemeStore.js +18 -0
- package/dist/controllers/toolPanelController.cjs +1 -0
- package/dist/controllers/toolPanelController.d.ts +36 -0
- package/dist/controllers/toolPanelController.js +112 -0
- package/dist/controllers/tooltipController.cjs +1 -0
- package/dist/controllers/tooltipController.d.ts +6 -0
- package/dist/controllers/tooltipController.js +75 -0
- package/dist/controllers/viewportSyncController.cjs +1 -0
- package/dist/controllers/viewportSyncController.d.ts +30 -0
- package/dist/controllers/viewportSyncController.js +40 -0
- package/dist/engine/columnCommands.cjs +1 -0
- package/dist/engine/columnCommands.d.ts +56 -0
- package/dist/engine/columnCommands.js +199 -0
- package/dist/engine/columnLayout.cjs +1 -0
- package/dist/engine/columnLayout.d.ts +43 -0
- package/dist/engine/columnLayout.js +91 -0
- package/dist/engine/createGridEngine.cjs +1 -0
- package/dist/engine/createGridEngine.d.ts +46 -0
- package/dist/engine/createGridEngine.js +52 -0
- package/dist/engine/filterPopoverCommands.cjs +1 -0
- package/dist/engine/filterPopoverCommands.d.ts +56 -0
- package/dist/engine/filterPopoverCommands.js +303 -0
- package/dist/engine/gridApi.cjs +1 -0
- package/dist/engine/gridApi.d.ts +61 -0
- package/dist/engine/gridApi.js +389 -0
- package/dist/engine/memo.cjs +1 -0
- package/dist/engine/memo.d.ts +2 -0
- package/dist/engine/memo.js +18 -0
- package/dist/engine/notifiers.cjs +1 -0
- package/dist/engine/notifiers.d.ts +35 -0
- package/dist/engine/notifiers.js +34 -0
- package/dist/engine/rowPipeline.cjs +1 -0
- package/dist/engine/rowPipeline.d.ts +50 -0
- package/dist/engine/rowPipeline.js +84 -0
- package/dist/engine/rowSelectionCommands.cjs +1 -0
- package/dist/engine/rowSelectionCommands.d.ts +21 -0
- package/dist/engine/rowSelectionCommands.js +57 -0
- package/dist/engine/verticalLayout.cjs +1 -0
- package/dist/engine/verticalLayout.d.ts +52 -0
- package/dist/engine/verticalLayout.js +60 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +5 -0
- package/dist/logic/aggregation.cjs +1 -0
- package/dist/logic/aggregation.d.ts +13 -0
- package/dist/logic/aggregation.js +28 -0
- package/dist/logic/autoScrollGeometry.cjs +1 -0
- package/dist/logic/autoScrollGeometry.d.ts +27 -0
- package/dist/logic/autoScrollGeometry.js +19 -0
- package/dist/logic/autoSizeOnData.cjs +1 -0
- package/dist/logic/autoSizeOnData.d.ts +10 -0
- package/dist/logic/autoSizeOnData.js +19 -0
- package/dist/logic/cellOverflowTooltip.cjs +1 -0
- package/dist/logic/cellOverflowTooltip.d.ts +5 -0
- package/dist/logic/cellOverflowTooltip.js +4 -0
- package/dist/logic/checkboxEditor.cjs +1 -0
- package/dist/logic/checkboxEditor.d.ts +12 -0
- package/dist/logic/checkboxEditor.js +17 -0
- package/dist/logic/chunkedLoop.cjs +1 -0
- package/dist/logic/chunkedLoop.d.ts +8 -0
- package/dist/logic/chunkedLoop.js +18 -0
- package/dist/logic/clearCells.cjs +1 -0
- package/dist/logic/clearCells.d.ts +31 -0
- package/dist/logic/clearCells.js +91 -0
- package/dist/logic/columnAutosize.cjs +1 -0
- package/dist/logic/columnAutosize.d.ts +18 -0
- package/dist/logic/columnAutosize.js +150 -0
- package/dist/logic/columnFlex.cjs +1 -0
- package/dist/logic/columnFlex.d.ts +4 -0
- package/dist/logic/columnFlex.js +60 -0
- package/dist/logic/columnReset.cjs +1 -0
- package/dist/logic/columnReset.d.ts +7 -0
- package/dist/logic/columnReset.js +25 -0
- package/dist/logic/contextMenuTarget.cjs +1 -0
- package/dist/logic/contextMenuTarget.d.ts +4 -0
- package/dist/logic/contextMenuTarget.js +18 -0
- package/dist/logic/cx.cjs +1 -0
- package/dist/logic/cx.d.ts +1 -0
- package/dist/logic/cx.js +6 -0
- package/dist/logic/dateFilterCondition.cjs +1 -0
- package/dist/logic/dateFilterCondition.d.ts +26 -0
- package/dist/logic/dateFilterCondition.js +110 -0
- package/dist/logic/dateFilterPresets.cjs +1 -0
- package/dist/logic/dateFilterPresets.d.ts +13 -0
- package/dist/logic/dateFilterPresets.js +30 -0
- package/dist/logic/dateFilterTree.cjs +1 -0
- package/dist/logic/dateFilterTree.d.ts +17 -0
- package/dist/logic/dateFilterTree.js +75 -0
- package/dist/logic/datePickerCalendar.cjs +1 -0
- package/dist/logic/datePickerCalendar.d.ts +12 -0
- package/dist/logic/datePickerCalendar.js +41 -0
- package/dist/logic/detailRow.cjs +1 -0
- package/dist/logic/detailRow.d.ts +38 -0
- package/dist/logic/detailRow.js +78 -0
- package/dist/logic/domGuards.cjs +1 -0
- package/dist/logic/domGuards.d.ts +7 -0
- package/dist/logic/domGuards.js +4 -0
- package/dist/logic/editorValues.cjs +1 -0
- package/dist/logic/editorValues.d.ts +5 -0
- package/dist/logic/editorValues.js +32 -0
- package/dist/logic/exportCsv.cjs +3 -0
- package/dist/logic/exportCsv.d.ts +12 -0
- package/dist/logic/exportCsv.js +19 -0
- package/dist/logic/exportData.cjs +1 -0
- package/dist/logic/exportData.d.ts +9 -0
- package/dist/logic/exportData.js +24 -0
- package/dist/logic/exportScope.cjs +1 -0
- package/dist/logic/exportScope.d.ts +3 -0
- package/dist/logic/exportScope.js +4 -0
- package/dist/logic/filterPopoverLayout.cjs +1 -0
- package/dist/logic/filterPopoverLayout.d.ts +17 -0
- package/dist/logic/filterPopoverLayout.js +13 -0
- package/dist/logic/filterPopoverOutsideClick.cjs +1 -0
- package/dist/logic/filterPopoverOutsideClick.d.ts +2 -0
- package/dist/logic/filterPopoverOutsideClick.js +4 -0
- package/dist/logic/filterSummary.cjs +1 -0
- package/dist/logic/filterSummary.d.ts +3 -0
- package/dist/logic/filterSummary.js +22 -0
- package/dist/logic/filtering.cjs +1 -0
- package/dist/logic/filtering.d.ts +33 -0
- package/dist/logic/filtering.js +313 -0
- package/dist/logic/geometry.cjs +1 -0
- package/dist/logic/geometry.d.ts +72 -0
- package/dist/logic/geometry.js +161 -0
- package/dist/logic/gridState.cjs +1 -0
- package/dist/logic/gridState.d.ts +13 -0
- package/dist/logic/gridState.js +165 -0
- package/dist/logic/grouping.cjs +1 -0
- package/dist/logic/grouping.d.ts +34 -0
- package/dist/logic/grouping.js +93 -0
- package/dist/logic/history.cjs +1 -0
- package/dist/logic/history.d.ts +16 -0
- package/dist/logic/history.js +34 -0
- package/dist/logic/inferFilterType.cjs +1 -0
- package/dist/logic/inferFilterType.d.ts +19 -0
- package/dist/logic/inferFilterType.js +54 -0
- package/dist/logic/numberFilterCondition.cjs +1 -0
- package/dist/logic/numberFilterCondition.d.ts +21 -0
- package/dist/logic/numberFilterCondition.js +130 -0
- package/dist/logic/panelDragGeometry.cjs +1 -0
- package/dist/logic/panelDragGeometry.d.ts +13 -0
- package/dist/logic/panelDragGeometry.js +10 -0
- package/dist/logic/rowHeightStore.cjs +1 -0
- package/dist/logic/rowHeightStore.d.ts +13 -0
- package/dist/logic/rowHeightStore.js +41 -0
- package/dist/logic/rowReorder.cjs +1 -0
- package/dist/logic/rowReorder.d.ts +18 -0
- package/dist/logic/rowReorder.js +22 -0
- package/dist/logic/rowSelection.cjs +1 -0
- package/dist/logic/rowSelection.d.ts +16 -0
- package/dist/logic/rowSelection.js +49 -0
- package/dist/logic/scrollHint.cjs +1 -0
- package/dist/logic/scrollHint.d.ts +41 -0
- package/dist/logic/scrollHint.js +66 -0
- package/dist/logic/scrollTargets.cjs +1 -0
- package/dist/logic/scrollTargets.d.ts +22 -0
- package/dist/logic/scrollTargets.js +24 -0
- package/dist/logic/selectEditorState.cjs +1 -0
- package/dist/logic/selectEditorState.d.ts +28 -0
- package/dist/logic/selectEditorState.js +31 -0
- package/dist/logic/selectOptions.cjs +1 -0
- package/dist/logic/selectOptions.d.ts +9 -0
- package/dist/logic/selectOptions.js +23 -0
- package/dist/logic/serverSideBlocks.cjs +1 -0
- package/dist/logic/serverSideBlocks.d.ts +2 -0
- package/dist/logic/serverSideBlocks.js +14 -0
- package/dist/logic/serverSideCache.cjs +1 -0
- package/dist/logic/serverSideCache.d.ts +14 -0
- package/dist/logic/serverSideCache.js +42 -0
- package/dist/logic/serverSideEdits.cjs +1 -0
- package/dist/logic/serverSideEdits.d.ts +16 -0
- package/dist/logic/serverSideEdits.js +47 -0
- package/dist/logic/serverSideQuery.cjs +1 -0
- package/dist/logic/serverSideQuery.d.ts +7 -0
- package/dist/logic/serverSideQuery.js +21 -0
- package/dist/logic/setFilterSearch.cjs +1 -0
- package/dist/logic/setFilterSearch.d.ts +14 -0
- package/dist/logic/setFilterSearch.js +14 -0
- package/dist/logic/setFilterSelection.cjs +1 -0
- package/dist/logic/setFilterSelection.d.ts +5 -0
- package/dist/logic/setFilterSelection.js +4 -0
- package/dist/logic/slotDom.cjs +1 -0
- package/dist/logic/slotDom.d.ts +8 -0
- package/dist/logic/slotDom.js +22 -0
- package/dist/logic/slotProps.cjs +1 -0
- package/dist/logic/slotProps.d.ts +18 -0
- package/dist/logic/slotProps.js +63 -0
- package/dist/logic/sorting.cjs +1 -0
- package/dist/logic/sorting.d.ts +11 -0
- package/dist/logic/sorting.js +96 -0
- package/dist/logic/textFilterCondition.cjs +1 -0
- package/dist/logic/textFilterCondition.d.ts +18 -0
- package/dist/logic/textFilterCondition.js +55 -0
- package/dist/logic/theme.cjs +1 -0
- package/dist/logic/theme.d.ts +3 -0
- package/dist/logic/theme.js +4 -0
- package/dist/logic/tooltipGeometry.cjs +1 -0
- package/dist/logic/tooltipGeometry.d.ts +19 -0
- package/dist/logic/tooltipGeometry.js +16 -0
- package/dist/logic/validation.cjs +1 -0
- package/dist/logic/validation.d.ts +14 -0
- package/dist/logic/validation.js +47 -0
- package/dist/logic/valueFormatters.cjs +1 -0
- package/dist/logic/valueFormatters.d.ts +9 -0
- package/dist/logic/valueFormatters.js +17 -0
- package/dist/logic/valueStore.cjs +1 -0
- package/dist/logic/valueStore.d.ts +6 -0
- package/dist/logic/valueStore.js +18 -0
- package/dist/logic/verticalGeometry.cjs +1 -0
- package/dist/logic/verticalGeometry.d.ts +58 -0
- package/dist/logic/verticalGeometry.js +90 -0
- package/dist/model/gridActions.cjs +1 -0
- package/dist/model/gridActions.d.ts +125 -0
- package/dist/model/gridActions.js +114 -0
- package/dist/model/gridReducer.cjs +1 -0
- package/dist/model/gridReducer.d.ts +4 -0
- package/dist/model/gridReducer.js +247 -0
- package/dist/model/gridSelectors.cjs +1 -0
- package/dist/model/gridSelectors.d.ts +40 -0
- package/dist/model/gridSelectors.js +68 -0
- package/dist/model/gridStore.cjs +1 -0
- package/dist/model/gridStore.d.ts +24 -0
- package/dist/model/gridStore.js +38 -0
- package/dist/model/gridTypes.core.cjs +1 -0
- package/dist/model/gridTypes.core.d.ts +797 -0
- package/dist/model/gridTypes.core.js +0 -0
- package/dist/model/gridTypes.unbound.cjs +1 -0
- package/dist/model/gridTypes.unbound.d.ts +31 -0
- package/dist/model/gridTypes.unbound.js +0 -0
- package/dist/testing/index.cjs +1 -0
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/index.js +51 -0
- package/dist/utils/clipboard.cjs +7 -0
- package/dist/utils/clipboard.d.ts +29 -0
- package/dist/utils/clipboard.js +110 -0
- package/dist/utils/excelColumnName.cjs +1 -0
- package/dist/utils/excelColumnName.d.ts +1 -0
- package/dist/utils/excelColumnName.js +9 -0
- package/dist/utils/permissions.cjs +1 -0
- package/dist/utils/permissions.d.ts +4 -0
- package/dist/utils/permissions.js +7 -0
- package/dist/utils/scheduler.cjs +1 -0
- package/dist/utils/scheduler.d.ts +1 -0
- package/dist/utils/scheduler.js +13 -0
- package/package.json +58 -0
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type * as Core from './gridTypes.core';
|
|
2
|
+
export type * from './gridTypes.core';
|
|
3
|
+
export type UnboundGridTypes = {
|
|
4
|
+
node: any;
|
|
5
|
+
style: any;
|
|
6
|
+
};
|
|
7
|
+
export type CellRenderContext<T> = Core.CellRenderContext<T, UnboundGridTypes>;
|
|
8
|
+
export type DetailRowOptions<T> = Core.DetailRowOptions<T, UnboundGridTypes>;
|
|
9
|
+
export type CellStyleContext<T> = Core.CellStyleContext<T, UnboundGridTypes>;
|
|
10
|
+
export type HeaderRenderContext<T> = Core.HeaderRenderContext<T, UnboundGridTypes>;
|
|
11
|
+
export type CellValueFormatterParams<T> = Core.CellValueFormatterParams<T, UnboundGridTypes>;
|
|
12
|
+
export type CellValueFormatter<T> = Core.CellValueFormatter<T, UnboundGridTypes>;
|
|
13
|
+
export type GridColumnEditor<T> = Core.GridColumnEditor<T, UnboundGridTypes>;
|
|
14
|
+
export type CellEditorContext<T> = Core.CellEditorContext<T, UnboundGridTypes>;
|
|
15
|
+
export type CellValidationContext<T> = Core.CellValidationContext<T, UnboundGridTypes>;
|
|
16
|
+
export type GridAggFuncParams<T> = Core.GridAggFuncParams<T, UnboundGridTypes>;
|
|
17
|
+
export type GridAggFunc<T> = Core.GridAggFunc<T, UnboundGridTypes>;
|
|
18
|
+
export type GridColumn<T> = Core.GridColumn<T, UnboundGridTypes>;
|
|
19
|
+
export type SpreadsheetGridSlotContext<T> = Core.SpreadsheetGridSlotContext<T, UnboundGridTypes>;
|
|
20
|
+
export type GridContextMenuTarget<T> = Core.GridContextMenuTarget<T, UnboundGridTypes>;
|
|
21
|
+
export type GridContextMenuParams<T> = Core.GridContextMenuParams<T, UnboundGridTypes>;
|
|
22
|
+
export type ScrollHintOptions<T = unknown> = Core.ScrollHintOptions<T, UnboundGridTypes>;
|
|
23
|
+
export type GridContextMenuActionItem = Core.GridContextMenuActionItem<UnboundGridTypes>;
|
|
24
|
+
export type GridContextMenuLabelItem = Core.GridContextMenuLabelItem<UnboundGridTypes>;
|
|
25
|
+
export type GridContextMenuCustomItem = Core.GridContextMenuCustomItem<UnboundGridTypes>;
|
|
26
|
+
export type GridContextMenuItem = Core.GridContextMenuItem<UnboundGridTypes>;
|
|
27
|
+
export type GridSlotProps = Core.GridSlotProps<UnboundGridTypes>;
|
|
28
|
+
export type GridResolvedSlot = Core.GridResolvedSlot<UnboundGridTypes>;
|
|
29
|
+
export type GridResolvedSlots = Core.GridResolvedSlots<UnboundGridTypes>;
|
|
30
|
+
export type GridClassNames = Core.GridClassNames<UnboundGridTypes>;
|
|
31
|
+
export type SpreadsheetGridProps<T> = Core.SpreadsheetGridProps<T, UnboundGridTypes>;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e={}){let t=e.width??1200,n=e.height??600,r=Element.prototype,i=HTMLElement.prototype,a=Object.getOwnPropertyDescriptor(i,`clientHeight`),o=Object.getOwnPropertyDescriptor(i,`clientWidth`),s=r.getBoundingClientRect,c=globalThis.ResizeObserver,l=r.scrollTo;Object.defineProperty(i,"clientHeight",{configurable:!0,get:()=>n}),Object.defineProperty(i,"clientWidth",{configurable:!0,get:()=>t}),r.getBoundingClientRect=()=>({x:0,y:0,top:0,left:0,bottom:n,right:t,width:t,height:n,toJSON:()=>({})});class u{callback;constructor(e){this.callback=e}observe(e){let r={inlineSize:t,blockSize:n};this.callback([{target:e,contentRect:{width:t,height:n,top:0,left:0},borderBoxSize:[r],contentBoxSize:[r]}],this)}unobserve(){}disconnect(){}}return globalThis.ResizeObserver=u,r.scrollTo||=()=>{},()=>{a?Object.defineProperty(i,"clientHeight",a):delete i.clientHeight,o?Object.defineProperty(i,"clientWidth",o):delete i.clientWidth,r.getBoundingClientRect=s,globalThis.ResizeObserver=c,r.scrollTo=l}}exports.installJsdomLayoutStubs=e;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
//#region src/testing/index.ts
|
|
2
|
+
function e(e = {}) {
|
|
3
|
+
let t = e.width ?? 1200, n = e.height ?? 600, r = Element.prototype, i = HTMLElement.prototype, a = Object.getOwnPropertyDescriptor(i, "clientHeight"), o = Object.getOwnPropertyDescriptor(i, "clientWidth"), s = r.getBoundingClientRect, c = globalThis.ResizeObserver, l = r.scrollTo;
|
|
4
|
+
Object.defineProperty(i, "clientHeight", {
|
|
5
|
+
configurable: !0,
|
|
6
|
+
get: () => n
|
|
7
|
+
}), Object.defineProperty(i, "clientWidth", {
|
|
8
|
+
configurable: !0,
|
|
9
|
+
get: () => t
|
|
10
|
+
}), r.getBoundingClientRect = () => ({
|
|
11
|
+
x: 0,
|
|
12
|
+
y: 0,
|
|
13
|
+
top: 0,
|
|
14
|
+
left: 0,
|
|
15
|
+
bottom: n,
|
|
16
|
+
right: t,
|
|
17
|
+
width: t,
|
|
18
|
+
height: n,
|
|
19
|
+
toJSON: () => ({})
|
|
20
|
+
});
|
|
21
|
+
class u {
|
|
22
|
+
callback;
|
|
23
|
+
constructor(e) {
|
|
24
|
+
this.callback = e;
|
|
25
|
+
}
|
|
26
|
+
observe(e) {
|
|
27
|
+
let r = {
|
|
28
|
+
inlineSize: t,
|
|
29
|
+
blockSize: n
|
|
30
|
+
};
|
|
31
|
+
this.callback([{
|
|
32
|
+
target: e,
|
|
33
|
+
contentRect: {
|
|
34
|
+
width: t,
|
|
35
|
+
height: n,
|
|
36
|
+
top: 0,
|
|
37
|
+
left: 0
|
|
38
|
+
},
|
|
39
|
+
borderBoxSize: [r],
|
|
40
|
+
contentBoxSize: [r]
|
|
41
|
+
}], this);
|
|
42
|
+
}
|
|
43
|
+
unobserve() {}
|
|
44
|
+
disconnect() {}
|
|
45
|
+
}
|
|
46
|
+
return globalThis.ResizeObserver = u, r.scrollTo ||= () => {}, () => {
|
|
47
|
+
a ? Object.defineProperty(i, "clientHeight", a) : delete i.clientHeight, o ? Object.defineProperty(i, "clientWidth", o) : delete i.clientWidth, r.getBoundingClientRect = s, globalThis.ResizeObserver = c, r.scrollTo = l;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
export { e as installJsdomLayoutStubs };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./permissions.cjs"),t=require("../model/gridSelectors.cjs"),n=require("../logic/editorValues.cjs"),r=require("../logic/validation.cjs");var i=e=>{let t=e.replace(/\r\n/g,`
|
|
2
|
+
`).replace(/\r/g,`
|
|
3
|
+
`);return t?t.split(`
|
|
4
|
+
`).filter(e=>e.length>0).map(e=>e.split(` `)):[]},a=(n,r,i,a,o)=>{if(!a)return``;let s=[];if(a.type===`cell`){let r=t.normalizeCellRange(a.range);for(let t=r.start.row;t<=r.end.row;t+=1){let a=n(t);if(!a||o&&!o(a,t))continue;let c=[];for(let t=r.start.col;t<=r.end.col;t+=1){let n=i[t];if(!n)continue;let r=e.getCellValue(a,n),o=n.formatClipboardValue?n.formatClipboardValue(r,a):String(r??``);c.push(o)}s.push(c.join(` `))}return s.join(`
|
|
5
|
+
`)}if(a.type===`row`){let r=t.normalizeRowRange(a.startRow,a.endRow);for(let t=r.startRow;t<=r.endRow;t+=1){let r=n(t);if(!r||o&&!o(r,t))continue;let a=i.map(t=>{let n=e.getCellValue(r,t);return t.formatClipboardValue?t.formatClipboardValue(n,r):String(n??``)});s.push(a.join(` `))}return s.join(`
|
|
6
|
+
`)}let c=t.normalizeColumnRange(a.startCol,a.endCol);for(let t=0;t<r;t+=1){let r=n(t);if(!r||o&&!o(r,t))continue;let a=[];for(let t=c.startCol;t<=c.endCol;t+=1){let n=i[t];if(!n)continue;let o=e.getCellValue(r,n),s=n.formatClipboardValue?n.formatClipboardValue(o,r):String(o??``);a.push(s)}s.push(a.join(` `))}return s.join(`
|
|
7
|
+
`)},o=(t,i,a,o,s,c,l)=>{if(o.length===0)return t;let u=[...t];for(let t=0;t<o.length;t+=1){let d=i(s+t);if(d===void 0)continue;let f=u[d];if(!f)continue;let p=f,m=!1;for(let i=0;i<o[t].length;i+=1){let s=c+i,u=a[s];if(!u||!l(d,s,f,u))continue;let h=o[t][i],g=n.resolveCellParser(u)(h,f);r.decideCellWrite(u,f,g).action!==`reject`&&(p=e.setCellValue(p,u,g),m=!0)}m&&(u[d]=p)}return u},s=(e,t,i,a,o,s)=>{let c=[];for(let l=0;l<i.length;l+=1){let u=a+l,d=e(u);if(d)for(let e=0;e<i[l].length;e+=1){let a=o+e,f=t[a];if(!f||!s(u,a,d,f))continue;let p=n.resolveCellParser(f)(i[l][e],d);r.decideCellWrite(f,d,p).action!==`reject`&&c.push({viewIndex:u,column:f,value:p})}}return c},c=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},l=async e=>{if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}return c(e)?!0:(console.warn(`[SpreadsheetGrid] クリップボードへのコピーに失敗しました(navigator.clipboard が利用できず、execCommand フォールバックも失敗)。`),!1)};exports.applyClipboardMatrixToRows=o,exports.buildClipboardCellEdits=s,exports.copyTextViaExecCommand=c,exports.parseClipboardText=i,exports.serializeSelectionToTsv=a,exports.writeTextToClipboard=l;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { GridColumn } from '../model/gridTypes.unbound';
|
|
2
|
+
import type { ServerSideCellEditInput } from '../logic/serverSideEdits';
|
|
3
|
+
export type ClipboardMatrix = string[][];
|
|
4
|
+
export declare const parseClipboardText: (text: string) => ClipboardMatrix;
|
|
5
|
+
export declare const serializeSelectionToTsv: <T>(getRow: (viewIndex: number) => T, viewRowCount: number, columns: GridColumn<T>[], selection: {
|
|
6
|
+
type: "cell";
|
|
7
|
+
range: {
|
|
8
|
+
start: {
|
|
9
|
+
row: number;
|
|
10
|
+
col: number;
|
|
11
|
+
};
|
|
12
|
+
end: {
|
|
13
|
+
row: number;
|
|
14
|
+
col: number;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
} | {
|
|
18
|
+
type: "row";
|
|
19
|
+
startRow: number;
|
|
20
|
+
endRow: number;
|
|
21
|
+
} | {
|
|
22
|
+
type: "col";
|
|
23
|
+
startCol: number;
|
|
24
|
+
endCol: number;
|
|
25
|
+
} | null, isRowIncluded?: (row: T, viewRowIndex: number) => boolean) => string;
|
|
26
|
+
export declare const applyClipboardMatrixToRows: <T extends object>(rows: T[], resolveSourceIndex: (viewIndex: number) => number | undefined, columns: GridColumn<T>[], matrix: ClipboardMatrix, startRowIndex: number, startColIndex: number, canWriteCell: (originalRowIndex: number, colIndex: number, row: T, column: GridColumn<T>) => boolean) => T[];
|
|
27
|
+
export declare const buildClipboardCellEdits: <T extends object>(getRow: (viewIndex: number) => T | undefined, columns: GridColumn<T>[], matrix: ClipboardMatrix, startRowIndex: number, startColIndex: number, canWriteCell: (viewIndex: number, colIndex: number, row: T, column: GridColumn<T>) => boolean) => ServerSideCellEditInput<T>[];
|
|
28
|
+
export declare const copyTextViaExecCommand: (text: string) => boolean;
|
|
29
|
+
export declare const writeTextToClipboard: (text: string) => Promise<boolean>;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { getCellValue as e, setCellValue as t } from "./permissions.js";
|
|
2
|
+
import { normalizeCellRange as n, normalizeColumnRange as r, normalizeRowRange as i } from "../model/gridSelectors.js";
|
|
3
|
+
import { resolveCellParser as a } from "../logic/editorValues.js";
|
|
4
|
+
import { decideCellWrite as o } from "../logic/validation.js";
|
|
5
|
+
//#region src/utils/clipboard.ts
|
|
6
|
+
var s = (e) => {
|
|
7
|
+
let t = e.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
8
|
+
return t ? t.split("\n").filter((e) => e.length > 0).map((e) => e.split(" ")) : [];
|
|
9
|
+
}, c = (t, a, o, s, c) => {
|
|
10
|
+
if (!s) return "";
|
|
11
|
+
let l = [];
|
|
12
|
+
if (s.type === "cell") {
|
|
13
|
+
let r = n(s.range);
|
|
14
|
+
for (let n = r.start.row; n <= r.end.row; n += 1) {
|
|
15
|
+
let i = t(n);
|
|
16
|
+
if (!i || c && !c(i, n)) continue;
|
|
17
|
+
let a = [];
|
|
18
|
+
for (let t = r.start.col; t <= r.end.col; t += 1) {
|
|
19
|
+
let n = o[t];
|
|
20
|
+
if (!n) continue;
|
|
21
|
+
let r = e(i, n), s = n.formatClipboardValue ? n.formatClipboardValue(r, i) : String(r ?? "");
|
|
22
|
+
a.push(s);
|
|
23
|
+
}
|
|
24
|
+
l.push(a.join(" "));
|
|
25
|
+
}
|
|
26
|
+
return l.join("\n");
|
|
27
|
+
}
|
|
28
|
+
if (s.type === "row") {
|
|
29
|
+
let n = i(s.startRow, s.endRow);
|
|
30
|
+
for (let r = n.startRow; r <= n.endRow; r += 1) {
|
|
31
|
+
let n = t(r);
|
|
32
|
+
if (!n || c && !c(n, r)) continue;
|
|
33
|
+
let i = o.map((t) => {
|
|
34
|
+
let r = e(n, t);
|
|
35
|
+
return t.formatClipboardValue ? t.formatClipboardValue(r, n) : String(r ?? "");
|
|
36
|
+
});
|
|
37
|
+
l.push(i.join(" "));
|
|
38
|
+
}
|
|
39
|
+
return l.join("\n");
|
|
40
|
+
}
|
|
41
|
+
let u = r(s.startCol, s.endCol);
|
|
42
|
+
for (let n = 0; n < a; n += 1) {
|
|
43
|
+
let r = t(n);
|
|
44
|
+
if (!r || c && !c(r, n)) continue;
|
|
45
|
+
let i = [];
|
|
46
|
+
for (let t = u.startCol; t <= u.endCol; t += 1) {
|
|
47
|
+
let n = o[t];
|
|
48
|
+
if (!n) continue;
|
|
49
|
+
let a = e(r, n), s = n.formatClipboardValue ? n.formatClipboardValue(a, r) : String(a ?? "");
|
|
50
|
+
i.push(s);
|
|
51
|
+
}
|
|
52
|
+
l.push(i.join(" "));
|
|
53
|
+
}
|
|
54
|
+
return l.join("\n");
|
|
55
|
+
}, l = (e, n, r, i, s, c, l) => {
|
|
56
|
+
if (i.length === 0) return e;
|
|
57
|
+
let u = [...e];
|
|
58
|
+
for (let e = 0; e < i.length; e += 1) {
|
|
59
|
+
let d = n(s + e);
|
|
60
|
+
if (d === void 0) continue;
|
|
61
|
+
let f = u[d];
|
|
62
|
+
if (!f) continue;
|
|
63
|
+
let p = f, m = !1;
|
|
64
|
+
for (let n = 0; n < i[e].length; n += 1) {
|
|
65
|
+
let s = c + n, u = r[s];
|
|
66
|
+
if (!u || !l(d, s, f, u)) continue;
|
|
67
|
+
let h = i[e][n], g = a(u)(h, f);
|
|
68
|
+
o(u, f, g).action !== "reject" && (p = t(p, u, g), m = !0);
|
|
69
|
+
}
|
|
70
|
+
m && (u[d] = p);
|
|
71
|
+
}
|
|
72
|
+
return u;
|
|
73
|
+
}, u = (e, t, n, r, i, s) => {
|
|
74
|
+
let c = [];
|
|
75
|
+
for (let l = 0; l < n.length; l += 1) {
|
|
76
|
+
let u = r + l, d = e(u);
|
|
77
|
+
if (d) for (let e = 0; e < n[l].length; e += 1) {
|
|
78
|
+
let r = i + e, f = t[r];
|
|
79
|
+
if (!f || !s(u, r, d, f)) continue;
|
|
80
|
+
let p = a(f)(n[l][e], d);
|
|
81
|
+
o(f, d, p).action !== "reject" && c.push({
|
|
82
|
+
viewIndex: u,
|
|
83
|
+
column: f,
|
|
84
|
+
value: p
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return c;
|
|
89
|
+
}, d = (e) => {
|
|
90
|
+
let { body: t, activeElement: n } = document;
|
|
91
|
+
if (!t) return !1;
|
|
92
|
+
let r = document.createElement("textarea");
|
|
93
|
+
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);
|
|
94
|
+
let i;
|
|
95
|
+
try {
|
|
96
|
+
r.select(), i = document.execCommand("copy");
|
|
97
|
+
} catch {
|
|
98
|
+
i = !1;
|
|
99
|
+
} finally {
|
|
100
|
+
t.removeChild(r), n instanceof HTMLElement && n.focus();
|
|
101
|
+
}
|
|
102
|
+
return i;
|
|
103
|
+
}, f = async (e) => {
|
|
104
|
+
if (navigator.clipboard?.writeText) try {
|
|
105
|
+
return await navigator.clipboard.writeText(e), !0;
|
|
106
|
+
} catch {}
|
|
107
|
+
return d(e) ? !0 : (console.warn("[SpreadsheetGrid] クリップボードへのコピーに失敗しました(navigator.clipboard が利用できず、execCommand フォールバックも失敗)。"), !1);
|
|
108
|
+
};
|
|
109
|
+
//#endregion
|
|
110
|
+
export { l as applyClipboardMatrixToRows, u as buildClipboardCellEdits, d as copyTextViaExecCommand, s as parseClipboardText, c as serializeSelectionToTsv, f as writeTextToClipboard };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=e=>{if(e<0)return``;let t=e,n=``;for(;t>=0;)n=String.fromCharCode(t%26+65)+n,t=Math.floor(t/26)-1;return n};exports.toExcelColumnName=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const toExcelColumnName: (columnIndex: number) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=(e,t,n,r,i)=>e.readOnly||i.readOnly||i.editable===!1?!1:e.canEditCell?e.canEditCell(t,n,r,i):!0,t=(e,t)=>t.getValue?t.getValue(e):e[t.key],n=(e,t,n)=>t.setValue?t.setValue(e,n):{...e,[t.key]:n};exports.getCellValue=t,exports.isCellEditable=e,exports.setCellValue=n;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { GridColumn, SpreadsheetGridProps } from '../model/gridTypes.unbound';
|
|
2
|
+
export declare const isCellEditable: <T>(props: Pick<SpreadsheetGridProps<T>, "readOnly" | "canEditCell">, rowIndex: number, colIndex: number, row: T, column: GridColumn<T>) => boolean;
|
|
3
|
+
export declare const getCellValue: <T>(row: T, column: GridColumn<T>) => unknown;
|
|
4
|
+
export declare const setCellValue: <T>(row: T, column: GridColumn<T>, value: unknown) => T;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/utils/permissions.ts
|
|
2
|
+
var e = (e, t, n, r, i) => e.readOnly || i.readOnly || i.editable === !1 ? !1 : e.canEditCell ? e.canEditCell(t, n, r, i) : !0, t = (e, t) => t.getValue ? t.getValue(e) : e[t.key], n = (e, t, n) => t.setValue ? t.setValue(e, n) : {
|
|
3
|
+
...e,
|
|
4
|
+
[t.key]: n
|
|
5
|
+
};
|
|
6
|
+
//#endregion
|
|
7
|
+
export { t as getCellValue, e as isCellEditable, n as setCellValue };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=()=>new Promise(e=>{if(typeof MessageChannel>`u`){setTimeout(e,0);return}let t=new MessageChannel;t.port1.onmessage=()=>{t.port1.close(),e()},t.port2.postMessage(null)});exports.yieldToMain=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const yieldToMain: () => Promise<void>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/utils/scheduler.ts
|
|
2
|
+
var e = () => new Promise((e) => {
|
|
3
|
+
if (typeof MessageChannel > "u") {
|
|
4
|
+
setTimeout(e, 0);
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
let t = new MessageChannel();
|
|
8
|
+
t.port1.onmessage = () => {
|
|
9
|
+
t.port1.close(), e();
|
|
10
|
+
}, t.port2.postMessage(null);
|
|
11
|
+
});
|
|
12
|
+
//#endregion
|
|
13
|
+
export { e as yieldToMain };
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ishibashi0112/spreadsheet-grid-core",
|
|
3
|
+
"version": "0.39.0",
|
|
4
|
+
"description": "SpreadsheetGrid のフレームワーク非依存コア(状態 / 派生値計算 / コマンド / DOM コントローラ)。React 版 @ishibashi0112/spreadsheet-grid と将来の Solid 版が共有します。",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"grid",
|
|
7
|
+
"datagrid",
|
|
8
|
+
"spreadsheet",
|
|
9
|
+
"virtualized",
|
|
10
|
+
"typescript",
|
|
11
|
+
"framework-agnostic"
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"author": "Yuki Sakakibara",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/ishibashi0112/datasheet-grid.git",
|
|
18
|
+
"directory": "packages/core"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://github.com/ishibashi0112/datasheet-grid#readme",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/ishibashi0112/datasheet-grid/issues"
|
|
23
|
+
},
|
|
24
|
+
"type": "module",
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"import": "./dist/index.js",
|
|
33
|
+
"require": "./dist/index.cjs"
|
|
34
|
+
},
|
|
35
|
+
"./testing": {
|
|
36
|
+
"types": "./dist/testing/index.d.ts",
|
|
37
|
+
"import": "./dist/testing/index.js",
|
|
38
|
+
"require": "./dist/testing/index.cjs"
|
|
39
|
+
},
|
|
40
|
+
"./*": {
|
|
41
|
+
"types": "./dist/*.d.ts",
|
|
42
|
+
"import": "./dist/*.js",
|
|
43
|
+
"require": "./dist/*.cjs"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=18"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build:lib": "vp build --config vite.lib.config.ts && tsc -p tsconfig.lib.json"
|
|
54
|
+
},
|
|
55
|
+
"main": "./dist/index.cjs",
|
|
56
|
+
"module": "./dist/index.js",
|
|
57
|
+
"types": "./dist/index.d.ts"
|
|
58
|
+
}
|