@odoo/o-spreadsheet 17.1.2 → 17.1.4
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/o-spreadsheet.cjs.js +274 -168
- package/dist/o-spreadsheet.d.ts +42 -20
- package/dist/o-spreadsheet.esm.js +274 -168
- package/dist/o-spreadsheet.iife.js +274 -168
- package/dist/o-spreadsheet.iife.min.js +289 -296
- package/dist/o_spreadsheet.xml +15 -33
- package/package.json +1 -1
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -33,8 +33,8 @@ interface EnrichedToken extends Token {
|
|
|
33
33
|
|
|
34
34
|
type TokenType = "OPERATOR" | "NUMBER" | "STRING" | "SYMBOL" | "SPACE" | "DEBUGGER" | "ARG_SEPARATOR" | "LEFT_PAREN" | "RIGHT_PAREN" | "REFERENCE" | "INVALID_REFERENCE" | "UNKNOWN";
|
|
35
35
|
interface Token {
|
|
36
|
-
type: TokenType;
|
|
37
|
-
value: string;
|
|
36
|
+
readonly type: TokenType;
|
|
37
|
+
readonly value: string;
|
|
38
38
|
}
|
|
39
39
|
declare function tokenize(str: string, locale?: Locale): Token[];
|
|
40
40
|
|
|
@@ -1179,7 +1179,7 @@ interface ModelConfig {
|
|
|
1179
1179
|
readonly custom: Readonly<{
|
|
1180
1180
|
[key: string]: any;
|
|
1181
1181
|
}>;
|
|
1182
|
-
readonly defaultCurrencyFormat
|
|
1182
|
+
readonly defaultCurrencyFormat?: Format;
|
|
1183
1183
|
/**
|
|
1184
1184
|
* External dependencies required to enable some features
|
|
1185
1185
|
* such as uploading images.
|
|
@@ -1430,6 +1430,7 @@ interface UIPluginConfig {
|
|
|
1430
1430
|
readonly uiActions: UIActions;
|
|
1431
1431
|
readonly custom: ModelConfig["custom"];
|
|
1432
1432
|
readonly session: Session;
|
|
1433
|
+
readonly defaultCurrencyFormat?: Format;
|
|
1433
1434
|
}
|
|
1434
1435
|
interface UIPluginConstructor {
|
|
1435
1436
|
new (config: UIPluginConfig): UIPlugin;
|
|
@@ -3006,6 +3007,12 @@ interface ClipboardInterface {
|
|
|
3006
3007
|
readText(): Promise<ClipboardReadResult>;
|
|
3007
3008
|
}
|
|
3008
3009
|
|
|
3010
|
+
declare class FocusableElement {
|
|
3011
|
+
private focusableElement;
|
|
3012
|
+
setFocusableElement(element: HTMLElement): void;
|
|
3013
|
+
focus(): void;
|
|
3014
|
+
}
|
|
3015
|
+
|
|
3009
3016
|
type NotificationType = "danger" | "info" | "success" | "warning";
|
|
3010
3017
|
interface InformationNotification {
|
|
3011
3018
|
text: string;
|
|
@@ -3027,6 +3034,7 @@ interface SpreadsheetChildEnv extends SpreadsheetEnv {
|
|
|
3027
3034
|
startCellEdition: (content?: string) => void;
|
|
3028
3035
|
loadCurrencies?: () => Promise<Currency[]>;
|
|
3029
3036
|
loadLocales: () => Promise<Locale[]>;
|
|
3037
|
+
focusableElement: FocusableElement;
|
|
3030
3038
|
}
|
|
3031
3039
|
|
|
3032
3040
|
declare class RangeAdapter implements CommandHandler<CoreCommand> {
|
|
@@ -3070,8 +3078,12 @@ declare class RangeAdapter implements CommandHandler<CoreCommand> {
|
|
|
3070
3078
|
*
|
|
3071
3079
|
* @param range the range (received from getRangeFromXC or getRangeFromZone)
|
|
3072
3080
|
* @param forSheetId the id of the sheet where the range string is supposed to be used.
|
|
3081
|
+
* @param options
|
|
3082
|
+
* @param options.useFixedReference if true, the range will be returned with fixed row and column
|
|
3073
3083
|
*/
|
|
3074
|
-
getRangeString(range: Range, forSheetId: UID
|
|
3084
|
+
getRangeString(range: Range, forSheetId: UID, options?: {
|
|
3085
|
+
useFixedReference: boolean;
|
|
3086
|
+
}): string;
|
|
3075
3087
|
getRangeDataFromXc(sheetId: UID, xc: string): RangeData;
|
|
3076
3088
|
getRangeDataFromZone(sheetId: UID, zone: Zone | UnboundedZone): RangeData;
|
|
3077
3089
|
getRangeFromZone(sheetId: UID, zone: Zone | UnboundedZone): Range;
|
|
@@ -7804,11 +7816,12 @@ interface AutocompleteValue {
|
|
|
7804
7816
|
}
|
|
7805
7817
|
interface ComposerProps {
|
|
7806
7818
|
focus: ComposerFocusType;
|
|
7807
|
-
onComposerContentFocused: (selection: ComposerSelection) => void;
|
|
7808
7819
|
inputStyle?: string;
|
|
7809
7820
|
rect?: Rect;
|
|
7810
7821
|
delimitation?: DOMDimension;
|
|
7811
|
-
|
|
7822
|
+
onComposerContentFocused: () => void;
|
|
7823
|
+
onComposerCellFocused?: (content: String) => void;
|
|
7824
|
+
isDefaultFocus?: boolean;
|
|
7812
7825
|
}
|
|
7813
7826
|
interface ComposerState$1 {
|
|
7814
7827
|
positionStart: number;
|
|
@@ -7833,7 +7846,6 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
|
|
|
7833
7846
|
focus: {
|
|
7834
7847
|
validate: (value: string) => boolean;
|
|
7835
7848
|
};
|
|
7836
|
-
onComposerContentFocused: FunctionConstructor;
|
|
7837
7849
|
inputStyle: {
|
|
7838
7850
|
type: StringConstructor;
|
|
7839
7851
|
optional: boolean;
|
|
@@ -7846,10 +7858,15 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
|
|
|
7846
7858
|
type: ObjectConstructor;
|
|
7847
7859
|
optional: boolean;
|
|
7848
7860
|
};
|
|
7849
|
-
|
|
7861
|
+
onComposerCellFocused: {
|
|
7850
7862
|
type: FunctionConstructor;
|
|
7851
7863
|
optional: boolean;
|
|
7852
7864
|
};
|
|
7865
|
+
onComposerContentFocused: FunctionConstructor;
|
|
7866
|
+
isDefaultFocus: {
|
|
7867
|
+
type: BooleanConstructor;
|
|
7868
|
+
optional: boolean;
|
|
7869
|
+
};
|
|
7853
7870
|
};
|
|
7854
7871
|
static components: {
|
|
7855
7872
|
TextValueProvider: typeof TextValueProvider;
|
|
@@ -7857,6 +7874,7 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
|
|
|
7857
7874
|
};
|
|
7858
7875
|
static defaultProps: {
|
|
7859
7876
|
inputStyle: string;
|
|
7877
|
+
isDefaultFocus: boolean;
|
|
7860
7878
|
};
|
|
7861
7879
|
composerRef: {
|
|
7862
7880
|
el: HTMLElement | null;
|
|
@@ -7879,7 +7897,6 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
|
|
|
7879
7897
|
private processArrowKeys;
|
|
7880
7898
|
private handleArrowKeysForAutocomplete;
|
|
7881
7899
|
private processTabKey;
|
|
7882
|
-
processSpaceKey(ev: KeyboardEvent): void;
|
|
7883
7900
|
private processEnterKey;
|
|
7884
7901
|
private processNewLineEvent;
|
|
7885
7902
|
private processEscapeKey;
|
|
@@ -7888,6 +7905,7 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
|
|
|
7888
7905
|
onCompositionStart(): void;
|
|
7889
7906
|
onCompositionEnd(): void;
|
|
7890
7907
|
onKeydown(ev: KeyboardEvent): void;
|
|
7908
|
+
onPaste(ev: ClipboardEvent): void;
|
|
7891
7909
|
onInput(ev: InputEvent): void;
|
|
7892
7910
|
onKeyup(ev: KeyboardEvent): void;
|
|
7893
7911
|
showFunctionAutocomplete(searchTerm: string): void;
|
|
@@ -8096,7 +8114,7 @@ declare class Spreadsheet extends Component<SpreadsheetProps, SpreadsheetChildEn
|
|
|
8096
8114
|
focusGrid(): void;
|
|
8097
8115
|
onKeydown(ev: KeyboardEvent): void;
|
|
8098
8116
|
onTopBarComposerFocused(selection: ComposerSelection): void;
|
|
8099
|
-
onGridComposerContentFocused(): void;
|
|
8117
|
+
onGridComposerContentFocused(selection: ComposerSelection): void;
|
|
8100
8118
|
onGridComposerCellFocused(content?: string, selection?: ComposerSelection): void;
|
|
8101
8119
|
/**
|
|
8102
8120
|
* Start the edition or update the content if it's already started.
|
|
@@ -8110,8 +8128,8 @@ declare class Spreadsheet extends Component<SpreadsheetProps, SpreadsheetChildEn
|
|
|
8110
8128
|
|
|
8111
8129
|
interface Props$5 {
|
|
8112
8130
|
focus: ComposerFocusType;
|
|
8113
|
-
|
|
8114
|
-
|
|
8131
|
+
onComposerContentFocused: () => void;
|
|
8132
|
+
onComposerCellFocused: () => void;
|
|
8115
8133
|
gridDims: DOMDimension;
|
|
8116
8134
|
}
|
|
8117
8135
|
/**
|
|
@@ -8124,24 +8142,30 @@ declare class GridComposer extends Component<Props$5, SpreadsheetChildEnv> {
|
|
|
8124
8142
|
focus: {
|
|
8125
8143
|
validate: (value: string) => boolean;
|
|
8126
8144
|
};
|
|
8127
|
-
|
|
8145
|
+
onComposerCellFocused: FunctionConstructor;
|
|
8128
8146
|
onComposerContentFocused: FunctionConstructor;
|
|
8129
8147
|
gridDims: ObjectConstructor;
|
|
8130
8148
|
};
|
|
8131
8149
|
static components: {
|
|
8132
8150
|
Composer: typeof Composer;
|
|
8133
8151
|
};
|
|
8134
|
-
private gridComposerRef;
|
|
8135
|
-
private zone;
|
|
8136
8152
|
private rect;
|
|
8153
|
+
private isEditing;
|
|
8137
8154
|
private isCellReferenceVisible;
|
|
8138
|
-
|
|
8155
|
+
get defaultRect(): {
|
|
8156
|
+
x: number;
|
|
8157
|
+
y: number;
|
|
8158
|
+
width: number;
|
|
8159
|
+
height: number;
|
|
8160
|
+
};
|
|
8139
8161
|
setup(): void;
|
|
8140
8162
|
get shouldDisplayCellReference(): boolean;
|
|
8141
8163
|
get cellReference(): string;
|
|
8142
8164
|
get cellReferenceStyle(): string;
|
|
8165
|
+
get composerProps(): ComposerProps;
|
|
8143
8166
|
get containerStyle(): string;
|
|
8144
|
-
|
|
8167
|
+
private updateComponentPosition;
|
|
8168
|
+
private updateCellReferenceVisibility;
|
|
8145
8169
|
}
|
|
8146
8170
|
|
|
8147
8171
|
interface ResizerState {
|
|
@@ -8377,7 +8401,6 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
|
|
|
8377
8401
|
readonly HEADER_WIDTH = 48;
|
|
8378
8402
|
private menuState;
|
|
8379
8403
|
private gridRef;
|
|
8380
|
-
private hiddenInput;
|
|
8381
8404
|
onMouseWheel: (ev: WheelEvent) => void;
|
|
8382
8405
|
canvasPosition: DOMCoordinates;
|
|
8383
8406
|
hoveredCell: Partial<Position$1>;
|
|
@@ -8389,7 +8412,7 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
|
|
|
8389
8412
|
get gridOverlayDimensions(): string;
|
|
8390
8413
|
onClosePopover(): void;
|
|
8391
8414
|
private keyDownMapping;
|
|
8392
|
-
|
|
8415
|
+
focusDefaultElement(): void;
|
|
8393
8416
|
get gridEl(): HTMLElement;
|
|
8394
8417
|
getAutofillPosition(): {
|
|
8395
8418
|
left: number;
|
|
@@ -8409,7 +8432,6 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
|
|
|
8409
8432
|
closeOpenedPopover(): void;
|
|
8410
8433
|
processArrows(ev: KeyboardEvent): void;
|
|
8411
8434
|
onKeydown(ev: KeyboardEvent): void;
|
|
8412
|
-
onInput(ev: InputEvent): void;
|
|
8413
8435
|
onInputContextMenu(ev: MouseEvent): void;
|
|
8414
8436
|
onCellRightClicked(col: HeaderIndex, row: HeaderIndex, { x, y }: DOMCoordinates): void;
|
|
8415
8437
|
toggleContextMenu(type: ContextMenuType, x: Pixel, y: Pixel): void;
|