@gridsheet/preact-core 3.0.0-rc.0 → 3.0.0-rc.10
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 +190 -0
- package/dist/hooks-DPIr6WaL.mjs +1434 -0
- package/dist/hooks-DPIr6WaL.mjs.map +1 -0
- package/dist/index.d.ts +3 -31
- package/dist/index.js +3413 -11188
- package/dist/index.js.map +1 -1
- package/dist/react-core/src/components/ColumnMenuFilterSection.d.ts +5 -0
- package/dist/react-core/src/components/ColumnMenuLabelSection.d.ts +5 -0
- package/dist/react-core/src/components/ColumnMenuSortSection.d.ts +5 -0
- package/dist/react-core/src/components/ContextMenu.d.ts +2 -0
- package/dist/react-core/src/components/EditorOptions.d.ts +11 -0
- package/dist/react-core/src/components/FunctionGuide.d.ts +19 -0
- package/dist/react-core/src/components/GridSheet.d.ts +7 -0
- package/dist/react-core/src/components/MenuItem.d.ts +18 -0
- package/dist/{components → react-core/src/components}/PluginBase.d.ts +2 -2
- package/dist/react-core/src/components/StoreObserver.d.ts +14 -0
- package/dist/react-core/src/components/useAutocomplete.d.ts +23 -0
- package/dist/react-core/src/index.d.ts +17 -0
- package/dist/react-core/src/lib/clipboard.d.ts +18 -0
- package/dist/{components → react-core/src/lib}/hooks.d.ts +2 -0
- package/dist/react-core/src/lib/menu.d.ts +99 -0
- package/dist/react-core/src/lib/style.d.ts +12 -0
- package/dist/react-core/src/policy/checkbox.d.ts +3 -0
- package/dist/react-core/src/spellbook.d.ts +6 -0
- package/dist/{store → react-core/src/store}/actions.d.ts +15 -3
- package/dist/react-core/src/store/applyers.d.ts +40 -0
- package/dist/react-core/src/store/helpers.d.ts +33 -0
- package/dist/react-core/src/types.d.ts +101 -0
- package/dist/spellbook.d.ts +2 -0
- package/dist/spellbook.js +10 -0
- package/dist/spellbook.js.map +1 -0
- package/package.json +26 -10
- package/dist/components/ContextMenu.d.ts +0 -20
- package/dist/components/GridSheet.d.ts +0 -5
- package/dist/components/StoreObserver.d.ts +0 -11
- package/dist/constants.d.ts +0 -30
- package/dist/formula/evaluator.d.ts +0 -136
- package/dist/formula/functions/__async.d.ts +0 -59
- package/dist/formula/functions/__base.d.ts +0 -31
- package/dist/formula/functions/__utils.d.ts +0 -19
- package/dist/formula/functions/abs.d.ts +0 -12
- package/dist/formula/functions/acos.d.ts +0 -12
- package/dist/formula/functions/add.d.ts +0 -13
- package/dist/formula/functions/and.d.ts +0 -19
- package/dist/formula/functions/asin.d.ts +0 -12
- package/dist/formula/functions/atan.d.ts +0 -12
- package/dist/formula/functions/atan2.d.ts +0 -12
- package/dist/formula/functions/average.d.ts +0 -19
- package/dist/formula/functions/col.d.ts +0 -13
- package/dist/formula/functions/concat.d.ts +0 -12
- package/dist/formula/functions/concatenate.d.ts +0 -19
- package/dist/formula/functions/cos.d.ts +0 -12
- package/dist/formula/functions/count.d.ts +0 -19
- package/dist/formula/functions/counta.d.ts +0 -19
- package/dist/formula/functions/countif.d.ts +0 -13
- package/dist/formula/functions/divide.d.ts +0 -12
- package/dist/formula/functions/eq.d.ts +0 -12
- package/dist/formula/functions/exp.d.ts +0 -12
- package/dist/formula/functions/gt.d.ts +0 -12
- package/dist/formula/functions/gte.d.ts +0 -12
- package/dist/formula/functions/hlookup.d.ts +0 -18
- package/dist/formula/functions/if.d.ts +0 -17
- package/dist/formula/functions/iferror.d.ts +0 -20
- package/dist/formula/functions/index.d.ts +0 -18
- package/dist/formula/functions/len.d.ts +0 -12
- package/dist/formula/functions/lenb.d.ts +0 -12
- package/dist/formula/functions/ln.d.ts +0 -12
- package/dist/formula/functions/log.d.ts +0 -12
- package/dist/formula/functions/log10.d.ts +0 -12
- package/dist/formula/functions/lt.d.ts +0 -12
- package/dist/formula/functions/lte.d.ts +0 -12
- package/dist/formula/functions/match.d.ts +0 -18
- package/dist/formula/functions/match.test.d.ts +0 -2
- package/dist/formula/functions/max.d.ts +0 -19
- package/dist/formula/functions/min.d.ts +0 -19
- package/dist/formula/functions/minus.d.ts +0 -13
- package/dist/formula/functions/mod.d.ts +0 -12
- package/dist/formula/functions/multiply.d.ts +0 -12
- package/dist/formula/functions/ne.d.ts +0 -12
- package/dist/formula/functions/not.d.ts +0 -12
- package/dist/formula/functions/now.d.ts +0 -9
- package/dist/formula/functions/or.d.ts +0 -19
- package/dist/formula/functions/pi.d.ts +0 -9
- package/dist/formula/functions/power.d.ts +0 -12
- package/dist/formula/functions/product.d.ts +0 -19
- package/dist/formula/functions/radians.d.ts +0 -12
- package/dist/formula/functions/rand.d.ts +0 -9
- package/dist/formula/functions/round.d.ts +0 -17
- package/dist/formula/functions/rounddown.d.ts +0 -17
- package/dist/formula/functions/roundup.d.ts +0 -17
- package/dist/formula/functions/row.d.ts +0 -13
- package/dist/formula/functions/sin.d.ts +0 -12
- package/dist/formula/functions/sqrt.d.ts +0 -12
- package/dist/formula/functions/sum.d.ts +0 -19
- package/dist/formula/functions/sumif.d.ts +0 -18
- package/dist/formula/functions/tan.d.ts +0 -12
- package/dist/formula/functions/uminus.d.ts +0 -12
- package/dist/formula/functions/vlookup.d.ts +0 -18
- package/dist/formula/mapping.d.ts +0 -3
- package/dist/formula/solver.d.ts +0 -26
- package/dist/lib/autofill.d.ts +0 -17
- package/dist/lib/cell.d.ts +0 -3
- package/dist/lib/clipboard.d.ts +0 -3
- package/dist/lib/coords.d.ts +0 -10
- package/dist/lib/date.d.ts +0 -2
- package/dist/lib/filter.d.ts +0 -7
- package/dist/lib/hub.d.ts +0 -132
- package/dist/lib/input.d.ts +0 -15
- package/dist/lib/operation.d.ts +0 -34
- package/dist/lib/palette.d.ts +0 -2
- package/dist/lib/reference.d.ts +0 -13
- package/dist/lib/sheet.d.ts +0 -3
- package/dist/lib/spatial.d.ts +0 -92
- package/dist/lib/table.d.ts +0 -458
- package/dist/lib/time.d.ts +0 -25
- package/dist/lib/virtualization.d.ts +0 -22
- package/dist/parsers/core.d.ts +0 -38
- package/dist/policy/core.d.ts +0 -47
- package/dist/renderers/checkbox.d.ts +0 -5
- package/dist/renderers/core.d.ts +0 -66
- package/dist/renderers/thousand_separator.d.ts +0 -3
- package/dist/store/dispatchers.d.ts +0 -34
- package/dist/store/helpers.d.ts +0 -31
- package/dist/styles/embedder.d.ts +0 -2
- package/dist/styles/minified.d.ts +0 -3
- package/dist/styles/utils.d.ts +0 -52
- package/dist/types.d.ts +0 -355
- package/dist/utils.d.ts +0 -2
- /package/dist/{components → react-core/src/components}/Cell.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/CellStateOverlay.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/ColumnMenu.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/Editor.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/Emitter.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/Fixed.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/FormulaBar.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/HeaderCellLeft.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/HeaderCellTop.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/Resizer.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/RowMenu.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/ScrollHandle.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/SearchBar.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/Tabular.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/svg/AddIcon.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/svg/Base.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/svg/CloseIcon.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/svg/SearchIcon.d.ts +0 -0
- /package/dist/{lib → react-core/src/lib}/events.d.ts +0 -0
- /package/dist/{lib → react-core/src/lib}/paste.d.ts +0 -0
- /package/dist/{store → react-core/src/store}/index.d.ts +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface EditorOptionsProps {
|
|
3
|
+
filteredOptions: any[];
|
|
4
|
+
top: number;
|
|
5
|
+
left: number;
|
|
6
|
+
selected: number;
|
|
7
|
+
onOptionMouseDown: (e: React.MouseEvent<HTMLLIElement>, i: number) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const EditorOptions: React.FC<EditorOptionsProps>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=EditorOptions.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FunctionHelp, AutocompleteOption } from '../../../core/src';
|
|
3
|
+
type OptionWithGuide = AutocompleteOption & {
|
|
4
|
+
isFunction?: boolean;
|
|
5
|
+
example?: string;
|
|
6
|
+
category?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
defs?: any[];
|
|
9
|
+
};
|
|
10
|
+
export interface FunctionGuideProps {
|
|
11
|
+
option?: OptionWithGuide;
|
|
12
|
+
activeFunctionGuide?: FunctionHelp;
|
|
13
|
+
activeArgIndex?: number;
|
|
14
|
+
top?: number;
|
|
15
|
+
left?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare const FunctionGuide: React.FC<FunctionGuideProps>;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=FunctionGuide.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SheetHandle, StoreHandle, Props } from '../types';
|
|
2
|
+
export declare const createSheetRef: () => import('react').RefObject<SheetHandle | null>;
|
|
3
|
+
export declare const useSheetRef: () => import('react').MutableRefObject<SheetHandle | null>;
|
|
4
|
+
export declare const createStoreRef: () => import('react').RefObject<StoreHandle | null>;
|
|
5
|
+
export declare const useStoreRef: () => import('react').MutableRefObject<StoreHandle | null>;
|
|
6
|
+
export declare function GridSheet({ initialCells, sheetName, sheetRef: initialSheetRef, storeRef: initialStoreRef, options, className, style, book: initialBook, }: Props): JSX.Element;
|
|
7
|
+
//# sourceMappingURL=GridSheet.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
type MenuItemProps = {
|
|
3
|
+
label: string;
|
|
4
|
+
shortcuts?: string[];
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* undefined → no check column
|
|
8
|
+
* true/false → displayed as a toggle row with a checkmark
|
|
9
|
+
*/
|
|
10
|
+
checked?: boolean;
|
|
11
|
+
testId?: string;
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const MenuItem: FC<MenuItemProps>;
|
|
16
|
+
export declare const MenuDivider: FC;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=MenuItem.d.ts.map
|
|
@@ -4,9 +4,9 @@ import { Dispatcher } from '../store';
|
|
|
4
4
|
export type PluginContextType = {
|
|
5
5
|
provided: boolean;
|
|
6
6
|
store?: StoreType;
|
|
7
|
-
|
|
7
|
+
apply?: Dispatcher;
|
|
8
8
|
setStore: (store: StoreType) => void;
|
|
9
|
-
|
|
9
|
+
setApply: (apply: Dispatcher) => void;
|
|
10
10
|
};
|
|
11
11
|
export declare const PluginContext: import('react').Context<PluginContextType>;
|
|
12
12
|
export declare function useInitialPluginContext(): PluginContextType;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC, MutableRefObject } from 'react';
|
|
2
|
+
import { OptionsType, SheetHandle, StoreHandle } from '../types';
|
|
3
|
+
type StoreObserverProps = OptionsType & {
|
|
4
|
+
sheetName?: string;
|
|
5
|
+
sheetRef?: MutableRefObject<SheetHandle | null>;
|
|
6
|
+
storeRef?: MutableRefObject<StoreHandle | null>;
|
|
7
|
+
};
|
|
8
|
+
export declare const createSheetRef: () => import('react').RefObject<SheetHandle | null>;
|
|
9
|
+
export declare const useSheetRef: () => MutableRefObject<SheetHandle | null>;
|
|
10
|
+
export declare const createStoreRef: () => import('react').RefObject<StoreHandle | null>;
|
|
11
|
+
export declare const useStoreRef: () => MutableRefObject<StoreHandle | null>;
|
|
12
|
+
export declare const StoreObserver: FC<StoreObserverProps>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=StoreObserver.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FunctionHelp, FunctionMapping, AutocompleteOption } from '../../../core/src';
|
|
2
|
+
type UseAutocompleteProps = {
|
|
3
|
+
inputting: string;
|
|
4
|
+
selectionStart: number;
|
|
5
|
+
optionsAll: AutocompleteOption[];
|
|
6
|
+
functions?: FunctionMapping;
|
|
7
|
+
};
|
|
8
|
+
export declare const useAutocomplete: ({ inputting, selectionStart, optionsAll, functions }: UseAutocompleteProps) => {
|
|
9
|
+
filteredOptions: any[];
|
|
10
|
+
selected: number;
|
|
11
|
+
setSelected: import('react').Dispatch<import('react').SetStateAction<number>>;
|
|
12
|
+
replaceWithOption: (option: any) => {
|
|
13
|
+
value: string;
|
|
14
|
+
selectionStart: any;
|
|
15
|
+
};
|
|
16
|
+
handleArrowUp: (e: React.KeyboardEvent<HTMLTextAreaElement>) => boolean;
|
|
17
|
+
handleArrowDown: (e: React.KeyboardEvent<HTMLTextAreaElement>) => boolean;
|
|
18
|
+
isFormula: boolean;
|
|
19
|
+
activeFunctionHelp: FunctionHelp | null;
|
|
20
|
+
activeArgIndex: number;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=useAutocomplete.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { oa2aa, aa2oa, buildInitialCells, buildInitialCellsFromOrigin, zoneToArea, areaToZone, areaToRange, matrixShape, addressesToAreas, addressesToCols, addressesToRows, Time, x2c, c2x, y2r, r2y, p2a, a2p, rh, ch, Registry, createBook, createRegistry, Sheet, toValueMatrix, toValueObject, toValueRows, toValueCols, toCellMatrix, toCellObject, toCellRows, toCellCols, BaseFunction, BaseFunctionAsync, Lexer, FormulaParser, RefEntity, ValueEntity, RangeEntity, FormulaError, ensureString, ensureNumber, ensureBoolean, ensureDate, check, eachMatrix, createBooleanMask, conditionArg, stripMatrix, Policy, ThousandSeparatorPolicyMixin, operations, DEFAULT_HISTORY_LIMIT, Pending, Spilling, } from '../../core/src';
|
|
2
|
+
export type { CSSPropertiesLike, RefLike, MatrixType, CellType, System, Address, AsyncCache, FilterCondition, FilterConditionMethod, FilterConfig, FeedbackType, WriterType, CellsByAddressType, CellsByIdType, SystemsByIdType, ModeType, HeadersType, HistoryType, HistorySortRowsType, PointType, AreaType, ZoneType, EditorEvent, CursorStateType, BookType, BookProps, RegistryProps, TransmitProps, UserSheet, SheetLimits, ToValueMatrixProps, ToValueObjectProps, ToValueRowsProps, ToValueColsProps, ToCellMatrixProps, ToCellObjectProps, ToCellRowsProps, ToCellColsProps, FunctionProps, FunctionArgumentDefinition, FunctionCategory, FunctionMapping, EnsureNumberOptions, EnsureBooleanOptions, PolicyType, AutocompleteOption, PolicyMixinType, RenderProps, SerializeProps, SelectProps, SelectFallbackProps, SerializeForClipboardProps, } from '../../core/src';
|
|
3
|
+
export { GridSheet, createSheetRef, useSheetRef, createStoreRef, useStoreRef } from './components/GridSheet';
|
|
4
|
+
export { updateSheet } from './store/actions';
|
|
5
|
+
export { PluginBase, useInitialPluginContext, usePluginContext } from './components/PluginBase';
|
|
6
|
+
export { MenuItem, MenuDivider } from './components/MenuItem';
|
|
7
|
+
export { useBook } from './lib/hooks';
|
|
8
|
+
export type { Dispatcher } from './store';
|
|
9
|
+
export { CheckboxPolicyMixin } from './policy/checkbox';
|
|
10
|
+
export type { Props, StoreType, SheetHandle, StoreHandle, OptionsType } from './types';
|
|
11
|
+
export { userActions } from './store/actions';
|
|
12
|
+
export { clip, sheet2csv } from './lib/clipboard';
|
|
13
|
+
export { applyers } from './store/applyers';
|
|
14
|
+
export { makeBorder } from './lib/style';
|
|
15
|
+
export type { MenuContext, MenuItemBase, MenuComponentItem, ContextMenuItemDescriptor, RowMenuItemDescriptor, ColMenuItemDescriptor, MenuDividerItem, ContextMenuSectionProps, RowMenuSectionProps, ColMenuSectionProps, } from './lib/menu';
|
|
16
|
+
export { defaultContextMenuDescriptors, defaultRowMenuDescriptors, defaultColMenuDescriptors, registerMenuComponent, } from './lib/menu';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StoreType, AreaType, PointType } from '../types';
|
|
2
|
+
import { UserSheet } from '../../../core/src';
|
|
3
|
+
export declare const clip: (store: StoreType) => AreaType;
|
|
4
|
+
export type SheetCSVProps = {
|
|
5
|
+
getter?: (sheet: UserSheet, point: PointType) => string;
|
|
6
|
+
filteredRowsIncluded?: boolean;
|
|
7
|
+
trailingEmptyRowsOmitted?: boolean;
|
|
8
|
+
separator?: string;
|
|
9
|
+
newline?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const sheet2csv: (sheet: UserSheet, { getter, filteredRowsIncluded, trailingEmptyRowsOmitted, separator, newline, }?: SheetCSVProps) => string;
|
|
12
|
+
export type SheetHTMLProps = {
|
|
13
|
+
getter?: (sheet: UserSheet, point: PointType) => string;
|
|
14
|
+
filteredRowsIncluded?: boolean;
|
|
15
|
+
trailingEmptyRowsOmitted?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare const sheet2html: (sheet: UserSheet, { getter, filteredRowsIncluded, trailingEmptyRowsOmitted, }?: SheetHTMLProps) => string;
|
|
18
|
+
//# sourceMappingURL=clipboard.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BookType, RegistryProps } from '../../../core/src';
|
|
1
2
|
export declare const useBrowser: () => {
|
|
2
3
|
window: Window & typeof globalThis;
|
|
3
4
|
document: Document;
|
|
@@ -7,4 +8,5 @@ export declare const useBrowser: () => {
|
|
|
7
8
|
};
|
|
8
9
|
export declare const useDebounce: <T>(value: T, delay?: number) => T;
|
|
9
10
|
export declare const useDebounceCallback: (callback: (...args: any[]) => void, delay?: number) => (...args: any[]) => void;
|
|
11
|
+
export declare const useBook: (props?: RegistryProps) => BookType;
|
|
10
12
|
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { PointType, ZoneType, FilterConfig, StoreType } from '../types';
|
|
2
|
+
import { UserSheet } from '../../../core/src';
|
|
3
|
+
import { Dispatcher } from '../store';
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
export type MenuContext = {
|
|
6
|
+
/** Current sheet instance */
|
|
7
|
+
sheet: UserSheet;
|
|
8
|
+
/** Currently focused cell */
|
|
9
|
+
choosing: PointType;
|
|
10
|
+
/** Currently selected zone */
|
|
11
|
+
selectingZone: ZoneType;
|
|
12
|
+
/** True when the left (row) header is being selected */
|
|
13
|
+
leftHeaderSelecting: boolean;
|
|
14
|
+
/** True when the top (column) header is being selected */
|
|
15
|
+
topHeaderSelecting: boolean;
|
|
16
|
+
cut(): Promise<void>;
|
|
17
|
+
copy(): Promise<void>;
|
|
18
|
+
paste(onlyValue?: boolean): Promise<void>;
|
|
19
|
+
undo(): void;
|
|
20
|
+
redo(): void;
|
|
21
|
+
insertRowsAbove(y: number, numRows: number): void;
|
|
22
|
+
insertRowsBelow(y: number, numRows: number): void;
|
|
23
|
+
removeRows(y: number, numRows: number): void;
|
|
24
|
+
insertColsLeft(x: number, numCols: number): void;
|
|
25
|
+
insertColsRight(x: number, numCols: number): void;
|
|
26
|
+
removeCols(x: number, numCols: number): void;
|
|
27
|
+
sortRows(x: number, direction: 'asc' | 'desc'): Promise<void>;
|
|
28
|
+
filterRows(x: number, filter?: FilterConfig): Promise<void>;
|
|
29
|
+
clearFilter(x?: number): void;
|
|
30
|
+
toggleSortFixed(y: number): void;
|
|
31
|
+
toggleFilterFixed(y: number): void;
|
|
32
|
+
search(): void;
|
|
33
|
+
updateColLabel(x: number, label: string | undefined): void;
|
|
34
|
+
/** Close the currently open menu */
|
|
35
|
+
close(): void;
|
|
36
|
+
};
|
|
37
|
+
export type MenuDividerItem = {
|
|
38
|
+
type: 'divider';
|
|
39
|
+
visible?: (ctx: MenuContext) => boolean;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Base structure shared by all menu item descriptors.
|
|
43
|
+
* `Args` is the tuple of coordinate arguments passed after `ctx`:
|
|
44
|
+
* - `[]` → ContextMenu (no coordinate)
|
|
45
|
+
* - `[y: number]` → RowMenu
|
|
46
|
+
* - `[x: number]` → ColMenu
|
|
47
|
+
*/
|
|
48
|
+
export type MenuItemBase<Args extends unknown[] = []> = {
|
|
49
|
+
type?: 'item';
|
|
50
|
+
id?: string;
|
|
51
|
+
label: string | ((ctx: MenuContext, ...args: Args) => string);
|
|
52
|
+
shortcuts?: string[] | ((ctx: MenuContext, ...args: Args) => string[]);
|
|
53
|
+
visible?: (ctx: MenuContext, ...args: Args) => boolean;
|
|
54
|
+
disabled?: (ctx: MenuContext, ...args: Args) => boolean;
|
|
55
|
+
/** Render a checkmark prefix when defined. */
|
|
56
|
+
checked?: (ctx: MenuContext, ...args: Args) => boolean;
|
|
57
|
+
onClick: (ctx: MenuContext, ...args: Args) => void | Promise<void>;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* A menu entry that renders a registered React component.
|
|
61
|
+
* Use `registerMenuComponent(id, Component)` to associate an id with a component,
|
|
62
|
+
* then reference it here as `{ type: 'component', componentId: id }`.
|
|
63
|
+
*/
|
|
64
|
+
export type MenuComponentItem<Args extends unknown[] = []> = {
|
|
65
|
+
type: 'component';
|
|
66
|
+
componentId: string;
|
|
67
|
+
visible?: (ctx: MenuContext, ...args: Args) => boolean;
|
|
68
|
+
};
|
|
69
|
+
export type ContextMenuItemDescriptor = MenuDividerItem | MenuItemBase | MenuComponentItem;
|
|
70
|
+
export type RowMenuItemDescriptor = MenuDividerItem | MenuItemBase<[y: number]> | MenuComponentItem<[y: number]>;
|
|
71
|
+
export type ColMenuItemDescriptor = MenuDividerItem | MenuItemBase<[x: number]> | MenuComponentItem<[x: number]>;
|
|
72
|
+
export declare const defaultContextMenuDescriptors: ContextMenuItemDescriptor[];
|
|
73
|
+
export declare const defaultRowMenuDescriptors: RowMenuItemDescriptor[];
|
|
74
|
+
export declare const defaultColMenuDescriptors: ColMenuItemDescriptor[];
|
|
75
|
+
export declare function buildMenuContext(store: StoreType, dispatch: Dispatcher, close: () => void): MenuContext;
|
|
76
|
+
export type ContextMenuSectionProps = {
|
|
77
|
+
close: () => void;
|
|
78
|
+
};
|
|
79
|
+
export type RowMenuSectionProps = {
|
|
80
|
+
y: number;
|
|
81
|
+
close: () => void;
|
|
82
|
+
};
|
|
83
|
+
export type ColMenuSectionProps = {
|
|
84
|
+
x: number;
|
|
85
|
+
close: () => void;
|
|
86
|
+
/** Signal waiting state to parent menu. Pass null to clear. */
|
|
87
|
+
onWaiting?: (message: string | null, cancel?: () => void) => void;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Register a React component under a string id so it can be referenced in menu
|
|
91
|
+
* descriptors via `{ type: 'component', componentId: '...' }`.
|
|
92
|
+
*
|
|
93
|
+
* Built-in ids: `'col-filter'`, `'col-sort'`, `'col-label'`.
|
|
94
|
+
* You can override any built-in by registering your own component with the same id.
|
|
95
|
+
*/
|
|
96
|
+
export declare function registerMenuComponent(id: string, component: FC<any>): void;
|
|
97
|
+
/** Look up a previously registered component by id. */
|
|
98
|
+
export declare function getMenuComponent(id: string): FC<any> | undefined;
|
|
99
|
+
//# sourceMappingURL=menu.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
type BorderStyleValue = string;
|
|
3
|
+
interface BorderOptions {
|
|
4
|
+
all?: BorderStyleValue;
|
|
5
|
+
top?: BorderStyleValue;
|
|
6
|
+
right?: BorderStyleValue;
|
|
7
|
+
bottom?: BorderStyleValue;
|
|
8
|
+
left?: BorderStyleValue;
|
|
9
|
+
}
|
|
10
|
+
export declare function makeBorder(options: BorderOptions): CSSProperties;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=style.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RegistryProps } from '../../core/src';
|
|
2
|
+
/** useBook with all extended functions pre-loaded. User-supplied additionalFunctions are merged on top. */
|
|
3
|
+
export declare const useSpellbook: ({ additionalFunctions, ...rest }?: RegistryProps) => import('../../core/src').BookType;
|
|
4
|
+
/** createBook with all extended functions pre-loaded. User-supplied additionalFunctions are merged on top. */
|
|
5
|
+
export declare const createSpellbook: ({ additionalFunctions, ...rest }?: RegistryProps) => import('../../core/src').BookType;
|
|
6
|
+
//# sourceMappingURL=spellbook.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StoreType, RectType, ZoneType, PointType, RangeType, PositionType, RawCellType, OperatorType, FilterConfig } from '../types';
|
|
2
|
-
import {
|
|
2
|
+
import { Sheet } from '../../../core/src';
|
|
3
3
|
type StoreWithCallback = StoreType & {
|
|
4
4
|
callback?: (store: StoreType) => void;
|
|
5
5
|
};
|
|
@@ -28,6 +28,14 @@ export declare const setSearchCaseSensitive: (payload: boolean) => {
|
|
|
28
28
|
type: number;
|
|
29
29
|
value: boolean;
|
|
30
30
|
};
|
|
31
|
+
export declare const setSearchRegex: (payload: boolean) => {
|
|
32
|
+
type: number;
|
|
33
|
+
value: boolean;
|
|
34
|
+
};
|
|
35
|
+
export declare const setSearchRange: (payload: ZoneType | undefined) => {
|
|
36
|
+
type: number;
|
|
37
|
+
value: ZoneType | undefined;
|
|
38
|
+
};
|
|
31
39
|
export declare const setEditingAddress: (payload: string) => {
|
|
32
40
|
type: number;
|
|
33
41
|
value: string;
|
|
@@ -56,9 +64,9 @@ export declare const setEntering: (payload: boolean) => {
|
|
|
56
64
|
type: number;
|
|
57
65
|
value: boolean;
|
|
58
66
|
};
|
|
59
|
-
export declare const
|
|
67
|
+
export declare const updateSheet: (payload: Sheet) => {
|
|
60
68
|
type: number;
|
|
61
|
-
value:
|
|
69
|
+
value: Sheet;
|
|
62
70
|
};
|
|
63
71
|
export declare const setEditorRect: (payload: RectType) => {
|
|
64
72
|
type: number;
|
|
@@ -310,6 +318,10 @@ export declare const setRowMenu: (payload: {
|
|
|
310
318
|
};
|
|
311
319
|
} | null;
|
|
312
320
|
};
|
|
321
|
+
export declare const setEditorHovering: (payload: boolean) => {
|
|
322
|
+
type: number;
|
|
323
|
+
value: boolean;
|
|
324
|
+
};
|
|
313
325
|
export declare const setStore: (payload: Partial<StoreType>) => {
|
|
314
326
|
type: number;
|
|
315
327
|
value: Partial<StoreType>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { StoreDispatchType, FilterConfig } from '../types';
|
|
2
|
+
export declare const copier: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
3
|
+
export declare const cutter: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
4
|
+
export declare const paster: ({ store, dispatch }: StoreDispatchType, onlyValue?: boolean) => Promise<void>;
|
|
5
|
+
export declare const undoer: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
6
|
+
export declare const redoer: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
7
|
+
export declare const rowsInserterAbove: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
8
|
+
export declare const rowsInserterBelow: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
9
|
+
export declare const colsInserterLeft: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
10
|
+
export declare const colsInserterRight: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
11
|
+
export declare const rowsRemover: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
12
|
+
export declare const colsRemover: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
13
|
+
export declare const rowsSorterAsc: ({ store, dispatch }: StoreDispatchType, x: number) => Promise<void>;
|
|
14
|
+
export declare const rowsSorterDesc: ({ store, dispatch }: StoreDispatchType, x: number) => Promise<void>;
|
|
15
|
+
export declare const rowsFilterer: ({ store, dispatch }: StoreDispatchType, x: number, filter: FilterConfig) => Promise<void>;
|
|
16
|
+
export declare const rowsFilterClearer: ({ store, dispatch }: StoreDispatchType, x?: number) => Promise<void>;
|
|
17
|
+
export declare const rowSortFixedToggler: ({ store, dispatch }: StoreDispatchType, y: number) => void;
|
|
18
|
+
export declare const rowFilterFixedToggler: ({ store, dispatch }: StoreDispatchType, y: number) => void;
|
|
19
|
+
export declare const searcher: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
20
|
+
export declare const applyers: {
|
|
21
|
+
copy: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
22
|
+
cut: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
23
|
+
paste: ({ store, dispatch }: StoreDispatchType, onlyValue?: boolean) => Promise<void>;
|
|
24
|
+
undo: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
25
|
+
redo: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
26
|
+
insertRowsAbove: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
27
|
+
insertRowsBelow: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
28
|
+
insertColsLeft: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
29
|
+
insertColsRight: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
30
|
+
removeRows: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
31
|
+
removeCols: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
32
|
+
sortRowsAsc: ({ store, dispatch }: StoreDispatchType, x: number) => Promise<void>;
|
|
33
|
+
sortRowsDesc: ({ store, dispatch }: StoreDispatchType, x: number) => Promise<void>;
|
|
34
|
+
filterRows: ({ store, dispatch }: StoreDispatchType, x: number, filter: FilterConfig) => Promise<void>;
|
|
35
|
+
clearFilter: ({ store, dispatch }: StoreDispatchType, x?: number) => Promise<void>;
|
|
36
|
+
toggleSortFixed: ({ store, dispatch }: StoreDispatchType, y: number) => void;
|
|
37
|
+
toggleFilterFixed: ({ store, dispatch }: StoreDispatchType, y: number) => void;
|
|
38
|
+
search: ({ store, dispatch }: StoreDispatchType) => Promise<void>;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=applyers.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Sheet } from '../../../core/src';
|
|
2
|
+
import { PointType, StorePatchType, StoreType } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Strip redundant fields from a StorePatchType before recording in history.
|
|
5
|
+
* - selectingZone with endY === -1 && endX === -1 is a no-selection sentinel and need not be stored.
|
|
6
|
+
*/
|
|
7
|
+
export declare const compactReflection: (reflection: StorePatchType) => StorePatchType;
|
|
8
|
+
export declare const restrictPoints: (store: StoreType, sheet: Sheet) => {
|
|
9
|
+
choosing: PointType;
|
|
10
|
+
selectingZone: {
|
|
11
|
+
startY: number;
|
|
12
|
+
startX: number;
|
|
13
|
+
endY: number;
|
|
14
|
+
endX: number;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare const flashSheet: (el: HTMLElement | null) => void;
|
|
18
|
+
export declare const flashWithCallback: (store: StoreType, sheet: Sheet, callback: ((s: StoreType) => void) | undefined) => StoreType & {
|
|
19
|
+
callback?: (store: StoreType) => void;
|
|
20
|
+
};
|
|
21
|
+
export declare const initSearchStatement: (sheet: Sheet, store: StoreType) => {
|
|
22
|
+
matchingCells: never[];
|
|
23
|
+
searchQuery?: undefined;
|
|
24
|
+
matchingCellIndex?: undefined;
|
|
25
|
+
choosing?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
matchingCells: string[];
|
|
28
|
+
searchQuery: string;
|
|
29
|
+
matchingCellIndex: number;
|
|
30
|
+
choosing: PointType;
|
|
31
|
+
};
|
|
32
|
+
export declare const isXSheetFocused: (store: StoreType) => boolean;
|
|
33
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { RefObject, CSSProperties, KeyboardEvent } from 'react';
|
|
2
|
+
import { Sheet, UserSheet, BookType, PolicyType, ModeType, PointType, ZoneType, RectType, PositionType, CellsByAddressType, SheetLimits } from '../../core/src';
|
|
3
|
+
import { ContextMenuItemDescriptor, RowMenuItemDescriptor, ColMenuItemDescriptor } from './lib/menu';
|
|
4
|
+
export type { CSSPropertiesLike, RefLike, Resolution, Y, X, Height, Width, ShapeType, RectType, MatrixType, CursorStateType, FeedbackType, ModeType, HeadersType, AsyncCache, System, FilterConditionMethod, FilterCondition, FilterConfig, CellType, RawCellType, CellPatchType, CellFilter, CellsByAddressType, CellsByIdType, SystemsByIdType, RangeType, PointType, ExtraPointType, PositionType, ZoneType, AreaType, WriterType, Id, Ids, IdMatrix, Address, MatricesByAddress, StorePatchType, HistoryUpdateType, MoveRelation, MoveRelations, HistoryMoveType, HistoryInsertRowsType, HistoryRemoveRowsType, HistoryInsertColsType, HistoryRemoveColsType, HistorySortRowsType, HistoryType, Virtualization, OperatorType, OperationType, Dispatcher, StoreDispatchType, ContextsBySheetId, SheetIdsByName, RefPaletteType, } from '../../core/src';
|
|
5
|
+
export type Policies = {
|
|
6
|
+
[s: string]: PolicyType;
|
|
7
|
+
};
|
|
8
|
+
export type OptionsType = {
|
|
9
|
+
sheetHeight?: number;
|
|
10
|
+
sheetWidth?: number;
|
|
11
|
+
sheetResize?: CSSProperties['resize'];
|
|
12
|
+
editingOnEnter?: boolean;
|
|
13
|
+
showFormulaBar?: boolean;
|
|
14
|
+
limits?: SheetLimits;
|
|
15
|
+
mode?: ModeType;
|
|
16
|
+
contextMenu?: ContextMenuItemDescriptor[];
|
|
17
|
+
rowMenu?: RowMenuItemDescriptor[];
|
|
18
|
+
colMenu?: ColMenuItemDescriptor[];
|
|
19
|
+
};
|
|
20
|
+
export type StoreType = {
|
|
21
|
+
sheetId: number;
|
|
22
|
+
sheetReactive: RefObject<Sheet>;
|
|
23
|
+
rootRef: RefObject<HTMLDivElement>;
|
|
24
|
+
flashRef: RefObject<HTMLDivElement>;
|
|
25
|
+
mainRef: RefObject<HTMLDivElement>;
|
|
26
|
+
editorRef: RefObject<HTMLTextAreaElement>;
|
|
27
|
+
largeEditorRef: RefObject<HTMLTextAreaElement>;
|
|
28
|
+
tabularRef: RefObject<HTMLDivElement>;
|
|
29
|
+
searchInputRef: RefObject<HTMLTextAreaElement>;
|
|
30
|
+
entering: boolean;
|
|
31
|
+
choosing: PointType;
|
|
32
|
+
inputting: string;
|
|
33
|
+
selectingZone: ZoneType;
|
|
34
|
+
autofillDraggingTo: PointType | null;
|
|
35
|
+
leftHeaderSelecting: boolean;
|
|
36
|
+
topHeaderSelecting: boolean;
|
|
37
|
+
editingAddress: string;
|
|
38
|
+
editorRect: RectType;
|
|
39
|
+
dragging: boolean;
|
|
40
|
+
sheetHeight: number;
|
|
41
|
+
sheetWidth: number;
|
|
42
|
+
mode: ModeType;
|
|
43
|
+
searchQuery?: string;
|
|
44
|
+
searchCaseSensitive: boolean;
|
|
45
|
+
searchRegex: boolean;
|
|
46
|
+
searchRange?: ZoneType;
|
|
47
|
+
matchingCells: string[];
|
|
48
|
+
matchingCellIndex: number;
|
|
49
|
+
editingOnEnter: boolean;
|
|
50
|
+
contextMenuPosition: PositionType;
|
|
51
|
+
contextMenu: ContextMenuItemDescriptor[];
|
|
52
|
+
rowMenu: RowMenuItemDescriptor[];
|
|
53
|
+
colMenu: ColMenuItemDescriptor[];
|
|
54
|
+
resizingPositionY: [number, number, number];
|
|
55
|
+
resizingPositionX: [number, number, number];
|
|
56
|
+
columnMenuState: {
|
|
57
|
+
x: number;
|
|
58
|
+
position: PositionType;
|
|
59
|
+
} | null;
|
|
60
|
+
rowMenuState: {
|
|
61
|
+
y: number;
|
|
62
|
+
position: PositionType;
|
|
63
|
+
} | null;
|
|
64
|
+
editorHovering: boolean;
|
|
65
|
+
};
|
|
66
|
+
export type Manager<T> = {
|
|
67
|
+
instance: T;
|
|
68
|
+
sync: T extends StoreType ? React.Dispatch<{
|
|
69
|
+
type: number;
|
|
70
|
+
value: any;
|
|
71
|
+
}> : (instance: T) => void;
|
|
72
|
+
};
|
|
73
|
+
export type SheetHandle = {
|
|
74
|
+
sheet: UserSheet;
|
|
75
|
+
apply: (sheet: UserSheet) => void;
|
|
76
|
+
};
|
|
77
|
+
export type StoreHandle = {
|
|
78
|
+
store: StoreType;
|
|
79
|
+
apply: (store: StoreType) => void;
|
|
80
|
+
dispatch: React.Dispatch<{
|
|
81
|
+
type: number;
|
|
82
|
+
value: any;
|
|
83
|
+
}>;
|
|
84
|
+
};
|
|
85
|
+
export type Props = {
|
|
86
|
+
initialCells: CellsByAddressType;
|
|
87
|
+
sheetName?: string;
|
|
88
|
+
book?: BookType;
|
|
89
|
+
sheetRef?: RefObject<SheetHandle | null>;
|
|
90
|
+
storeRef?: RefObject<StoreHandle | null>;
|
|
91
|
+
options?: OptionsType;
|
|
92
|
+
className?: string;
|
|
93
|
+
style?: CSSProperties;
|
|
94
|
+
};
|
|
95
|
+
export type EditorEvent = KeyboardEvent<HTMLTextAreaElement>;
|
|
96
|
+
export type EditorEventWithNativeEvent = EditorEvent & {
|
|
97
|
+
nativeEvent: KeyboardEvent & {
|
|
98
|
+
isComposing: boolean;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { allFunctions } from "@gridsheet/functions";
|
|
2
|
+
import { createBook } from "@gridsheet/core";
|
|
3
|
+
import { U as useBook } from "./hooks-DPIr6WaL.mjs";
|
|
4
|
+
const useSpellbook = ({ additionalFunctions, ...rest } = {}) => useBook({ ...rest, additionalFunctions: { ...allFunctions, ...additionalFunctions } });
|
|
5
|
+
const createSpellbook = ({ additionalFunctions, ...rest } = {}) => createBook({ ...rest, additionalFunctions: { ...allFunctions, ...additionalFunctions } });
|
|
6
|
+
export {
|
|
7
|
+
createSpellbook,
|
|
8
|
+
useSpellbook
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=spellbook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spellbook.js","sources":["../../react-core/src/spellbook.ts"],"sourcesContent":["import { allFunctions } from '@gridsheet/functions';\nimport type { RegistryProps } from '@gridsheet/core';\nimport { createBook } from '@gridsheet/core';\nimport { useBook } from './lib/hooks';\n\n/** useBook with all extended functions pre-loaded. User-supplied additionalFunctions are merged on top. */\nexport const useSpellbook = ({ additionalFunctions, ...rest }: RegistryProps = {}) =>\n useBook({ ...rest, additionalFunctions: { ...allFunctions, ...additionalFunctions } });\n\n/** createBook with all extended functions pre-loaded. User-supplied additionalFunctions are merged on top. */\nexport const createSpellbook = ({ additionalFunctions, ...rest }: RegistryProps = {}) =>\n createBook({ ...rest, additionalFunctions: { ...allFunctions, ...additionalFunctions } });\n"],"names":[],"mappings":";;;AAMa,MAAA,eAAe,CAAC,EAAE,qBAAqB,GAAG,KAAK,IAAmB,CAAA,MAC7E,QAAQ,EAAE,GAAG,MAAM,qBAAqB,EAAE,GAAG,cAAc,GAAG,oBAAA,EAAuB,CAAA;AAG1E,MAAA,kBAAkB,CAAC,EAAE,qBAAqB,GAAG,KAAK,IAAmB,CAAA,MAChF,WAAW,EAAE,GAAG,MAAM,qBAAqB,EAAE,GAAG,cAAc,GAAG,oBAAA,EAAuB,CAAA;"}
|
package/package.json
CHANGED
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridsheet/preact-core",
|
|
3
|
-
"version": "3.0.0-rc.
|
|
3
|
+
"version": "3.0.0-rc.10",
|
|
4
4
|
"description": "Spreadsheet component for Preact",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"dev": "vite example",
|
|
10
|
-
"copy-types": "rsync -avm --include='*/' --include='*.d.ts' --exclude='*' ../react-core/dist/ ./dist/",
|
|
11
|
-
"append-preact": "echo '\nexport { h, render } from \"preact\";' >> dist/index.d.ts && cat exports.ts >> dist/index.d.ts",
|
|
12
|
-
"build": "rm -rf ./dist || true && vite build --mode development && pnpm copy-types && pnpm append-preact"
|
|
13
|
-
},
|
|
14
8
|
"repository": {
|
|
15
9
|
"type": "git",
|
|
16
10
|
"url": "git+https://github.com/walkframe/gridsheet.git"
|
|
17
11
|
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@gridsheet/core": "3.0.0-rc.10"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./spellbook": {
|
|
22
|
+
"types": "./dist/spellbook.d.ts",
|
|
23
|
+
"import": "./dist/spellbook.js",
|
|
24
|
+
"default": "./dist/spellbook.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
18
27
|
"peerDependencies": {
|
|
19
28
|
"dayjs": "^1.11.13",
|
|
20
29
|
"preact": "^10.26.6"
|
|
@@ -26,7 +35,8 @@
|
|
|
26
35
|
"typescript": "^5.8.2",
|
|
27
36
|
"vite": "^6.2.2",
|
|
28
37
|
"vite-plugin-dts": "^4.5.3",
|
|
29
|
-
"@preact/preset-vite": "^2.10.1"
|
|
38
|
+
"@preact/preset-vite": "^2.10.1",
|
|
39
|
+
"@gridsheet/functions": "3.0.0-rc.10"
|
|
30
40
|
},
|
|
31
41
|
"bugs": {
|
|
32
42
|
"url": "https://github.com/walkframe/gridsheet/issues"
|
|
@@ -36,5 +46,11 @@
|
|
|
36
46
|
"dist"
|
|
37
47
|
],
|
|
38
48
|
"author": "righ",
|
|
39
|
-
"license": "Apache-2.0"
|
|
40
|
-
|
|
49
|
+
"license": "Apache-2.0",
|
|
50
|
+
"scripts": {
|
|
51
|
+
"dev": "vite example",
|
|
52
|
+
"copy-types": "rsync -avm --include='*/' --include='*.d.ts' --exclude='*' ../react-core/dist/ ./dist/",
|
|
53
|
+
"append-preact": "echo '\nexport { h, render } from \"preact\";' >> dist/index.d.ts && cat exports.ts >> dist/index.d.ts",
|
|
54
|
+
"build": "rm -rf ./dist || true && vite build --mode development && pnpm copy-types && pnpm append-preact"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { ContextMenuProps } from '../types';
|
|
3
|
-
export declare const ContextMenu: () => JSX.Element | null;
|
|
4
|
-
export declare const DividerItem: (props: ContextMenuProps) => JSX.Element;
|
|
5
|
-
export declare const CutItem: (props: ContextMenuProps) => JSX.Element;
|
|
6
|
-
export declare const CopyItem: (props: ContextMenuProps) => JSX.Element;
|
|
7
|
-
export declare const PasteItem: (props: ContextMenuProps) => JSX.Element;
|
|
8
|
-
export declare const PasteOnlyValueItem: (props: ContextMenuProps) => JSX.Element;
|
|
9
|
-
export declare const RowsColsOperationDividerItem: (props: ContextMenuProps) => JSX.Element | null;
|
|
10
|
-
export declare const InsertRowsAboveItem: (props: ContextMenuProps) => JSX.Element | null;
|
|
11
|
-
export declare const InsertRowsBelowItem: (props: ContextMenuProps) => JSX.Element | null;
|
|
12
|
-
export declare const InsertColsLeftItem: (props: ContextMenuProps) => JSX.Element | null;
|
|
13
|
-
export declare const InsertColsRightItem: (props: ContextMenuProps) => JSX.Element | null;
|
|
14
|
-
export declare const RemoveRowsItem: (props: ContextMenuProps) => JSX.Element | null;
|
|
15
|
-
export declare const RemoveColsItem: (props: ContextMenuProps) => JSX.Element | null;
|
|
16
|
-
export declare const HistoryDeviderItem: (props: ContextMenuProps) => JSX.Element | null;
|
|
17
|
-
export declare const UndoItem: (props: ContextMenuProps) => JSX.Element | null;
|
|
18
|
-
export declare const RedoItem: (props: ContextMenuProps) => JSX.Element | null;
|
|
19
|
-
export declare const defaultContextMenuItems: FC<ContextMenuProps>[];
|
|
20
|
-
//# sourceMappingURL=ContextMenu.d.ts.map
|