@odoo/o-spreadsheet 14.0.1 → 14.0.3
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 +17880 -0
- package/dist/o-spreadsheet.d.ts +4119 -0
- package/dist/o-spreadsheet.esm.js +17845 -0
- package/dist/o-spreadsheet.iife.js +17882 -0
- package/dist/o-spreadsheet.iife.min.js +1446 -0
- package/package.json +32 -9
- package/readme.md +10 -0
- package/.eslintrc.json +0 -20
- package/.husky/post-checkout +0 -9
- package/.husky/pre-commit +0 -39
- package/.prettierignore +0 -1
- package/astToFormula.patch +0 -0
- package/demo/data.js +0 -255
- package/demo/index.html +0 -9
- package/demo/libs/Chart.bundle.js +0 -20755
- package/demo/main.js +0 -101
- package/doc/readme.md +0 -46
- package/rollup.config.js +0 -23
- package/src/base_plugin.ts +0 -102
- package/src/components/autofill.ts +0 -146
- package/src/components/bottom_bar.ts +0 -199
- package/src/components/color_picker.ts +0 -150
- package/src/components/composer/autocomplete_dropdown.ts +0 -135
- package/src/components/composer/composer.ts +0 -487
- package/src/components/composer/content_editable_helper.ts +0 -146
- package/src/components/figures/chart.ts +0 -70
- package/src/components/figures/container.ts +0 -268
- package/src/components/figures/text_figure.ts +0 -36
- package/src/components/grid.ts +0 -635
- package/src/components/helpers/dom_helpers.ts +0 -7
- package/src/components/helpers/drag_and_drop.ts +0 -17
- package/src/components/icons.ts +0 -36
- package/src/components/index.ts +0 -1
- package/src/components/menu.ts +0 -288
- package/src/components/overlay.ts +0 -457
- package/src/components/scrollbar.ts +0 -22
- package/src/components/selection_input.ts +0 -168
- package/src/components/side_panel/cell_is_rule_editor.ts +0 -169
- package/src/components/side_panel/chart_panel.ts +0 -104
- package/src/components/side_panel/color_scale_rule_editor.ts +0 -145
- package/src/components/side_panel/conditional_formatting.ts +0 -396
- package/src/components/side_panel/side_panel.ts +0 -127
- package/src/components/side_panel/translations_terms.ts +0 -45
- package/src/components/spreadsheet.ts +0 -198
- package/src/components/top_bar.ts +0 -535
- package/src/constants.ts +0 -26
- package/src/data.ts +0 -149
- package/src/fonts.ts +0 -41
- package/src/formulas/compiler.ts +0 -258
- package/src/formulas/composer_tokenizer.ts +0 -70
- package/src/formulas/index.ts +0 -15
- package/src/formulas/normalize.ts +0 -52
- package/src/formulas/parser.ts +0 -280
- package/src/formulas/range_tokenizer.ts +0 -97
- package/src/formulas/tokenizer.ts +0 -242
- package/src/functions/arguments.ts +0 -114
- package/src/functions/dates.ts +0 -302
- package/src/functions/helpers.ts +0 -592
- package/src/functions/index.ts +0 -52
- package/src/functions/module_database.ts +0 -282
- package/src/functions/module_date.ts +0 -743
- package/src/functions/module_info.ts +0 -69
- package/src/functions/module_logical.ts +0 -208
- package/src/functions/module_lookup.ts +0 -185
- package/src/functions/module_math.ts +0 -1252
- package/src/functions/module_operators.ts +0 -291
- package/src/functions/module_statistical.ts +0 -882
- package/src/functions/module_text.ts +0 -370
- package/src/helpers/color.ts +0 -30
- package/src/helpers/coordinates.ts +0 -71
- package/src/helpers/grid_manipulation.ts +0 -68
- package/src/helpers/index.ts +0 -7
- package/src/helpers/misc.ts +0 -76
- package/src/helpers/numbers.ts +0 -117
- package/src/helpers/uuid.ts +0 -19
- package/src/helpers/zones.ts +0 -263
- package/src/history.ts +0 -186
- package/src/index.ts +0 -84
- package/src/model.ts +0 -261
- package/src/plugins/autofill.ts +0 -412
- package/src/plugins/chart.ts +0 -404
- package/src/plugins/clipboard.ts +0 -461
- package/src/plugins/conditional_format.ts +0 -445
- package/src/plugins/core.ts +0 -1502
- package/src/plugins/edition.ts +0 -157
- package/src/plugins/evaluation.ts +0 -428
- package/src/plugins/figures.ts +0 -123
- package/src/plugins/formatting.ts +0 -630
- package/src/plugins/highlight.ts +0 -187
- package/src/plugins/index.ts +0 -32
- package/src/plugins/merge.ts +0 -524
- package/src/plugins/renderer.ts +0 -571
- package/src/plugins/selection.ts +0 -562
- package/src/plugins/selection_inputs.ts +0 -326
- package/src/registries/autofill_modifiers.ts +0 -76
- package/src/registries/autofill_rules.ts +0 -98
- package/src/registries/figure_registry.ts +0 -30
- package/src/registries/index.ts +0 -7
- package/src/registries/menu_items_registry.ts +0 -110
- package/src/registries/menus/cell_menu_registry.ts +0 -79
- package/src/registries/menus/col_menu_registry.ts +0 -63
- package/src/registries/menus/index.ts +0 -6
- package/src/registries/menus/menu_items_actions.ts +0 -425
- package/src/registries/menus/row_menu_registry.ts +0 -63
- package/src/registries/menus/sheet_menu_registry.ts +0 -75
- package/src/registries/menus/topbar_menu_registry.ts +0 -204
- package/src/registries/side_panel_registry.ts +0 -26
- package/src/registries/topbar_component_registry.ts +0 -12
- package/src/registry.ts +0 -51
- package/src/translation.ts +0 -44
- package/src/types/autofill.ts +0 -48
- package/src/types/chart.ts +0 -26
- package/src/types/commands.ts +0 -716
- package/src/types/conditional_formatting.ts +0 -124
- package/src/types/env.ts +0 -13
- package/src/types/functions.ts +0 -35
- package/src/types/getters.ts +0 -103
- package/src/types/index.ts +0 -20
- package/src/types/misc.ts +0 -143
- package/src/types/rendering.ts +0 -41
- package/src/types/workbook_data.ts +0 -62
- package/tests/__mocks__/uuid.ts +0 -7
- package/tests/canvas.mock.ts +0 -34
- package/tests/components/__mocks__/content_editable_helper.ts +0 -79
- package/tests/components/__mocks__/scrollbar.ts +0 -18
- package/tests/components/__snapshots__/autocomplete_dropdown_test.ts.snap +0 -29
- package/tests/components/__snapshots__/bottom_bar_test.ts.snap +0 -75
- package/tests/components/__snapshots__/context_menu_test.ts.snap +0 -88
- package/tests/components/__snapshots__/grid_test.ts.snap +0 -60
- package/tests/components/__snapshots__/spreadsheet_test.ts.snap +0 -455
- package/tests/components/__snapshots__/top_bar_test.ts.snap +0 -705
- package/tests/components/autocomplete_dropdown_test.ts +0 -315
- package/tests/components/autofill_test.ts +0 -167
- package/tests/components/bottom_bar_test.ts +0 -262
- package/tests/components/chart_side_panel_test.ts +0 -123
- package/tests/components/composer_test.ts +0 -400
- package/tests/components/context_menu_test.ts +0 -825
- package/tests/components/grid_manipulation_test.ts +0 -163
- package/tests/components/grid_test.ts +0 -581
- package/tests/components/overlay_test.ts +0 -541
- package/tests/components/selection_input_test.ts +0 -259
- package/tests/components/side_panel_test.ts +0 -148
- package/tests/components/spreadsheet_test.ts +0 -194
- package/tests/components/top_bar_test.ts +0 -427
- package/tests/data_test.ts +0 -175
- package/tests/dom_helper.ts +0 -42
- package/tests/formulas/__snapshots__/compiler_test.ts.snap +0 -302
- package/tests/formulas/compiler_test.ts +0 -266
- package/tests/formulas/composer_tokenizer_test.ts +0 -137
- package/tests/formulas/expressions_test.ts +0 -57
- package/tests/formulas/formulas_test.ts +0 -80
- package/tests/formulas/normalize_test.ts +0 -82
- package/tests/formulas/parser_test.ts +0 -224
- package/tests/formulas/range_tokenizer_test.ts +0 -187
- package/tests/formulas/tokenizer_test.ts +0 -164
- package/tests/functions/arguments_test.ts +0 -141
- package/tests/functions/dates_test.ts +0 -1081
- package/tests/functions/functions_test.ts +0 -53
- package/tests/functions/helper_test.ts +0 -98
- package/tests/functions/module_database_test.ts +0 -311
- package/tests/functions/module_date_test.ts +0 -941
- package/tests/functions/module_info_test.ts +0 -139
- package/tests/functions/module_logical_test.ts +0 -369
- package/tests/functions/module_lookup_test.ts +0 -541
- package/tests/functions/module_math_test.ts +0 -2482
- package/tests/functions/module_operators_test.ts +0 -955
- package/tests/functions/module_statistical_test.ts +0 -2014
- package/tests/functions/module_text_test.ts +0 -667
- package/tests/helpers/coordinates_test.ts +0 -25
- package/tests/helpers/misc_test.ts +0 -95
- package/tests/helpers/numbers_test.ts +0 -196
- package/tests/helpers/zones_test.ts +0 -97
- package/tests/helpers.ts +0 -384
- package/tests/menu_items_registry_test.ts +0 -540
- package/tests/model/plugins/__snapshots__/chart_test.ts.snap +0 -90
- package/tests/model/plugins/chart_test.ts +0 -562
- package/tests/model_test.ts +0 -82
- package/tests/plugins/__snapshots__/conditional_formatting_test.ts.snap +0 -131
- package/tests/plugins/__snapshots__/renderer_test.ts.snap +0 -371
- package/tests/plugins/autofill_test.ts +0 -457
- package/tests/plugins/borders_test.ts +0 -295
- package/tests/plugins/clipboard_test.ts +0 -1180
- package/tests/plugins/conditional_formatting_test.ts +0 -1253
- package/tests/plugins/core_test.ts +0 -614
- package/tests/plugins/edition_test.ts +0 -100
- package/tests/plugins/evaluation_async_test.ts +0 -332
- package/tests/plugins/evaluation_dates_test.ts +0 -79
- package/tests/plugins/evaluation_test.ts +0 -901
- package/tests/plugins/figures_test.ts +0 -327
- package/tests/plugins/formatting_test.ts +0 -391
- package/tests/plugins/grid_manipulation_test.ts +0 -1366
- package/tests/plugins/highlight_test.ts +0 -413
- package/tests/plugins/history_test.ts +0 -142
- package/tests/plugins/import_export_test.ts +0 -276
- package/tests/plugins/merges_test.ts +0 -490
- package/tests/plugins/navigation_test.ts +0 -181
- package/tests/plugins/plugins/evaluation_test.ts +0 -111
- package/tests/plugins/renderer_test.ts +0 -598
- package/tests/plugins/resizing_test.ts +0 -152
- package/tests/plugins/selection_input_test.ts +0 -409
- package/tests/plugins/selection_test.ts +0 -442
- package/tests/plugins/sheets_test.ts +0 -643
- package/tests/plugins/style_test.ts +0 -90
- package/tsconfig.json +0 -22
package/package.json
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odoo/o-spreadsheet",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.3",
|
|
4
4
|
"description": "A spreadsheet component",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "dist/o-spreadsheet.cjs.js",
|
|
6
|
+
"browser": "dist/o-spreadsheet.iife.js",
|
|
7
|
+
"module": "dist/o-spreadsheet.es.js",
|
|
8
|
+
"types": "dist/o-spreadsheet.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/*.js",
|
|
11
|
+
"dist/*.d.ts"
|
|
12
|
+
],
|
|
6
13
|
"scripts": {
|
|
7
|
-
"serve": "live-server --open=demo",
|
|
8
|
-
"dev": "npm-run-all
|
|
9
|
-
"build:js": "tsc --module es6 --
|
|
10
|
-
"build:
|
|
11
|
-
"
|
|
14
|
+
"serve-static": "live-server --open=demo --watch=build/o_spreadsheet.js,demo",
|
|
15
|
+
"dev": "npm-run-all --print-label build --parallel serve-static watch:*",
|
|
16
|
+
"build:js": "tsc --module es6 --incremental",
|
|
17
|
+
"build:bundle": "rollup -c -m --configDev",
|
|
18
|
+
"watch:ts": "npm run build:js -- --watch",
|
|
19
|
+
"watch:bundle": "npm run build:bundle -- --watch",
|
|
12
20
|
"build": "npm run build:js && npm run build:bundle",
|
|
13
21
|
"test": "jest",
|
|
14
22
|
"test:watch": "jest --watch",
|
|
15
23
|
"prettier": "prettier {src/*.ts,src/**/*.ts,tests/*.ts,tests/**/*.ts,doc/*.md,demo/*.js} --write",
|
|
16
24
|
"check-formatting": "prettier {src/*.ts,src/**/*.ts,tests/*.ts,tests/**/*.ts,doc/*.md,demo/*.js} --check",
|
|
17
|
-
"dist": "
|
|
25
|
+
"dist": "tsc --module es6 --declaration --declarationDir dist/types && rollup -c",
|
|
18
26
|
"prepare": "husky install"
|
|
19
27
|
},
|
|
20
28
|
"browserslist": [
|
|
@@ -23,10 +31,19 @@
|
|
|
23
31
|
"keywords": [
|
|
24
32
|
"owl",
|
|
25
33
|
"spreadsheet",
|
|
34
|
+
"o-spreadsheet",
|
|
26
35
|
"odoo"
|
|
27
36
|
],
|
|
28
|
-
"author": "
|
|
37
|
+
"author": "Odoo",
|
|
29
38
|
"license": "LGPL-3.0-or-later",
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/odoo/o-spreadsheet.git"
|
|
42
|
+
},
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/odoo/o-spreadsheet/issues"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://github.com/odoo/o-spreadsheet#readme",
|
|
30
47
|
"devDependencies": {
|
|
31
48
|
"@types/chart.js": "^2.9.24",
|
|
32
49
|
"@types/jest": "^27.0.1",
|
|
@@ -43,6 +60,9 @@
|
|
|
43
60
|
"npm-run-all": "^4.1.5",
|
|
44
61
|
"prettier": "2.3.1",
|
|
45
62
|
"rollup": "^2.38.5",
|
|
63
|
+
"rollup-plugin-dts": "^4.2.0",
|
|
64
|
+
"@rollup/plugin-terser": "^0.2.0",
|
|
65
|
+
"rollup-plugin-typescript2": "^0.34.1",
|
|
46
66
|
"ts-jest": "^27.0.5",
|
|
47
67
|
"typescript": "^4.4.3"
|
|
48
68
|
},
|
|
@@ -74,5 +94,8 @@
|
|
|
74
94
|
},
|
|
75
95
|
"lint-staged": {
|
|
76
96
|
"{src/*.ts,src/**/*.ts,tests/*.ts,tests/**/*.ts,doc/*.md,demo/*.js}": "prettier --write"
|
|
97
|
+
},
|
|
98
|
+
"publishConfig": {
|
|
99
|
+
"tag": "14-0"
|
|
77
100
|
}
|
|
78
101
|
}
|
package/readme.md
CHANGED
|
@@ -37,3 +37,13 @@ Most of the code is contained in the following four modules:
|
|
|
37
37
|
## Documentation
|
|
38
38
|
|
|
39
39
|
See [documentation](doc/readme.md).
|
|
40
|
+
|
|
41
|
+
## Workflow
|
|
42
|
+
|
|
43
|
+
The repository relies on Github Workflows to automate the creation of releases
|
|
44
|
+
as well as publishing the package on NPM.
|
|
45
|
+
|
|
46
|
+
# test the workflow
|
|
47
|
+
The workflow can be run locally with the help of https://github.com/nektos/act
|
|
48
|
+
Bear in mind that it is not a full sandbox, you can run actual commands (like
|
|
49
|
+
npm publish). Make sure you adapt said commands to dry runs.
|
package/.eslintrc.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"browser": true,
|
|
4
|
-
"es6": true,
|
|
5
|
-
"jest": true
|
|
6
|
-
},
|
|
7
|
-
"extends": "eslint:recommended",
|
|
8
|
-
"globals": {
|
|
9
|
-
"owl": "readonly",
|
|
10
|
-
"o_spreadsheet": "readonly"
|
|
11
|
-
},
|
|
12
|
-
"parser": "babel-eslint",
|
|
13
|
-
"parserOptions": {
|
|
14
|
-
"ecmaVersion": 2018,
|
|
15
|
-
"sourceType": "module"
|
|
16
|
-
},
|
|
17
|
-
"rules": {
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
}
|
package/.husky/post-checkout
DELETED
package/.husky/pre-commit
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
|
|
3
|
-
# Husky Env Variables :
|
|
4
|
-
# HUSKY_PRE_COMMIT : if set to 0, disable pre-commit hook
|
|
5
|
-
# HUSKY_INPUT_ENV: if set to 0, disable the possibility of user input for the hook
|
|
6
|
-
|
|
7
|
-
npx="npx"
|
|
8
|
-
|
|
9
|
-
# For Windows
|
|
10
|
-
if [ "$OSTYPE" = "msys" ]; then
|
|
11
|
-
export PATH="/usr/bin:/usr/local/bin:$PATH"
|
|
12
|
-
npx="npx.cmd"
|
|
13
|
-
fi
|
|
14
|
-
. "$(dirname "$0")/_/husky.sh"
|
|
15
|
-
|
|
16
|
-
if [ "$HUSKY_PRE_COMMIT" != 0 ]; then
|
|
17
|
-
$npx lint-staged
|
|
18
|
-
|
|
19
|
-
consoleregexp='console\.|debugger'
|
|
20
|
-
if test $(git diff --cached | grep -nE $consoleregexp | wc -l) != 0
|
|
21
|
-
then
|
|
22
|
-
if [ "$HUSKY_INPUT_ENV" != 0 ] && [ "$OSTYPE" != "msys" ]; then
|
|
23
|
-
# activate user inputs
|
|
24
|
-
exec < /dev/tty
|
|
25
|
-
exec git diff --cached --color | grep -nE $consoleregexp -A 2 -B 2
|
|
26
|
-
read -p "There are some occurrences of forbidden patterns at your modification. Are you sure want to continue? (y/n)" yn
|
|
27
|
-
echo $yn | grep ^[Yy]$
|
|
28
|
-
if [ $? -eq 0 ]
|
|
29
|
-
then
|
|
30
|
-
exit 0; #THE USER WANTS TO CONTINUE
|
|
31
|
-
else
|
|
32
|
-
exit 1; # THE USER DONT WANT TO CONTINUE SO ROLLBACK
|
|
33
|
-
fi
|
|
34
|
-
else
|
|
35
|
-
echo -e "\033[1;31mWARNING: Some occurences of forbidden patterns were detected \033[0m"
|
|
36
|
-
exec git diff --cached --color | grep -nE $consoleregexp -A 2 -B 2
|
|
37
|
-
fi
|
|
38
|
-
fi
|
|
39
|
-
fi
|
package/.prettierignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.husky/
|
package/astToFormula.patch
DELETED
|
File without changes
|
package/demo/data.js
DELETED
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* We export here two datasets, useful to test and play with o-spreadsheet:
|
|
3
|
-
*
|
|
4
|
-
* - a demo dataset (demoData)
|
|
5
|
-
* . a perf focused dataset (created by function makeLargeDataset)
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export const demoData = {
|
|
9
|
-
version: 5,
|
|
10
|
-
sheets: [
|
|
11
|
-
{
|
|
12
|
-
id: "Sheet1",
|
|
13
|
-
name: "Sheet1",
|
|
14
|
-
colNumber: 26,
|
|
15
|
-
rowNumber: 120,
|
|
16
|
-
cols: { 1: {}, 3: {} },
|
|
17
|
-
rows: {},
|
|
18
|
-
cells: {
|
|
19
|
-
A21: { content: "Sheet2 => B2:" },
|
|
20
|
-
B2: { content: "Owl is awesome", style: 1 },
|
|
21
|
-
B4: { content: "Numbers", style: 4 },
|
|
22
|
-
B21: { content: "=Sheet2!B2", style: 7 },
|
|
23
|
-
C1: { content: "CF =42" },
|
|
24
|
-
C4: { content: "12.4" },
|
|
25
|
-
C5: { content: "42" },
|
|
26
|
-
C7: { content: "3" },
|
|
27
|
-
B9: { content: "Formulas", style: 5 },
|
|
28
|
-
C9: { content: "= SUM ( C4 : C5 )" },
|
|
29
|
-
C10: { content: "=SUM(C4:C7)" },
|
|
30
|
-
D10: { content: "note that C7 is empty" },
|
|
31
|
-
C11: { content: "=-(3 + C7 *SUM(C4:C7))" },
|
|
32
|
-
C12: { content: "=SUM(C9:C11)" },
|
|
33
|
-
D12: { content: "this is a sum of sums" },
|
|
34
|
-
B14: { content: "Errors", style: 6 },
|
|
35
|
-
C14: { content: "=C14" },
|
|
36
|
-
C15: { content: "=(+" },
|
|
37
|
-
C16: { content: "=C15" },
|
|
38
|
-
F2: { content: "italic blablah", style: 2 },
|
|
39
|
-
F3: { content: "strikethrough", style: 3 },
|
|
40
|
-
H2: { content: "merged content" },
|
|
41
|
-
C20: { content: "left", border: 1 },
|
|
42
|
-
E20: { content: "top", border: 2 },
|
|
43
|
-
G20: { content: "all", border: 3 },
|
|
44
|
-
B17: { content: "=WAIT(1000)" },
|
|
45
|
-
G13: { content: "=A1+A2+A3+A4+A5+A6+A7+A8+A9+A10+A11+A12+A13+A14+A15+A16+A17+A18" },
|
|
46
|
-
C23: { content: "0.43", format: "0.00%" },
|
|
47
|
-
C24: { content: "10", format: "#,##0.00" },
|
|
48
|
-
C25: { content: "10.123", format: "#,##0.00" },
|
|
49
|
-
G1: { content: "CF color scale:" },
|
|
50
|
-
G2: { content: "5" },
|
|
51
|
-
G3: { content: "8" },
|
|
52
|
-
G4: { content: "9" },
|
|
53
|
-
G5: { content: "15" },
|
|
54
|
-
G6: { content: "22" },
|
|
55
|
-
G8: { content: "30" },
|
|
56
|
-
B26: { content: "first dataset" },
|
|
57
|
-
C26: { content: "second dataset" },
|
|
58
|
-
B27: { content: "12" },
|
|
59
|
-
B28: { content: "=floor(RAND()*50)" },
|
|
60
|
-
B29: { content: "=floor(RAND()*50)" },
|
|
61
|
-
B30: { content: "=floor(RAND()*50)" },
|
|
62
|
-
B31: { content: "=floor(RAND()*50)" },
|
|
63
|
-
B32: { content: "=floor(RAND()*50)" },
|
|
64
|
-
B33: { content: "=floor(RAND()*50)" },
|
|
65
|
-
B34: { content: "19" },
|
|
66
|
-
B35: { content: "=floor(RAND()*50)" },
|
|
67
|
-
C27: { content: "=floor(RAND()*50)" },
|
|
68
|
-
C28: { content: "=floor(RAND()*50)" },
|
|
69
|
-
C29: { content: "=floor(RAND()*50)" },
|
|
70
|
-
C30: { content: "=floor(RAND()*50)" },
|
|
71
|
-
C31: { content: "=floor(RAND()*50)" },
|
|
72
|
-
C32: { content: "=floor(RAND()*50)" },
|
|
73
|
-
C33: { content: "=floor(RAND()*50)" },
|
|
74
|
-
C34: { content: "=floor(RAND()*50)" },
|
|
75
|
-
C35: { content: "=floor(RAND()*50)" },
|
|
76
|
-
A27: { content: "Emily Anderson (Emmy)" },
|
|
77
|
-
A28: { content: "Sophie Allen (Saffi)" },
|
|
78
|
-
A29: { content: "Chloe Adams" },
|
|
79
|
-
A30: { content: "Megan Alexander (Meg)" },
|
|
80
|
-
A31: { content: "Lucy Arnold (Lulu)" },
|
|
81
|
-
A32: { content: "Hannah Alvarez" },
|
|
82
|
-
A33: { content: "Jessica Alcock (Jess)" },
|
|
83
|
-
A34: { content: "Charlotte Anaya" },
|
|
84
|
-
A35: { content: "Lauren Anthony" },
|
|
85
|
-
K3: { border: 5 },
|
|
86
|
-
K4: { border: 4 },
|
|
87
|
-
K5: { border: 4 },
|
|
88
|
-
K6: { border: 4 },
|
|
89
|
-
K7: { border: 4 },
|
|
90
|
-
K8: { border: 6 },
|
|
91
|
-
},
|
|
92
|
-
merges: ["H2:I5", "K3:K8"],
|
|
93
|
-
conditionalFormats: [
|
|
94
|
-
{
|
|
95
|
-
id: "1",
|
|
96
|
-
ranges: ["C1:C100"],
|
|
97
|
-
rule: {
|
|
98
|
-
values: ["42"],
|
|
99
|
-
operator: "Equal",
|
|
100
|
-
type: "CellIsRule",
|
|
101
|
-
style: { fillColor: "orange" },
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
id: "2",
|
|
106
|
-
ranges: ["G1:G100"],
|
|
107
|
-
rule: {
|
|
108
|
-
type: "ColorScaleRule",
|
|
109
|
-
minimum: { type: "value", color: 0xffffff },
|
|
110
|
-
maximum: { type: "value", color: 0xff0000 },
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
],
|
|
114
|
-
figures: [
|
|
115
|
-
{
|
|
116
|
-
id: "1",
|
|
117
|
-
tag: "chart",
|
|
118
|
-
width: 400,
|
|
119
|
-
height: 300,
|
|
120
|
-
x: 800,
|
|
121
|
-
y: 230,
|
|
122
|
-
data: {
|
|
123
|
-
sheetId: "Sheet1",
|
|
124
|
-
type: "line",
|
|
125
|
-
title: "demo chart",
|
|
126
|
-
labelRange: "A27:A35",
|
|
127
|
-
dataSets: [
|
|
128
|
-
{ labelCell: "B26", dataRange: "B27:B35" },
|
|
129
|
-
{ labelCell: "C26", dataRange: "C27:C35" },
|
|
130
|
-
],
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
],
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
name: "Sheet2",
|
|
137
|
-
cells: {
|
|
138
|
-
B2: { content: "42" },
|
|
139
|
-
},
|
|
140
|
-
figures: [
|
|
141
|
-
{
|
|
142
|
-
id: "someId",
|
|
143
|
-
tag: "text",
|
|
144
|
-
width: 300,
|
|
145
|
-
height: 200,
|
|
146
|
-
x: 300,
|
|
147
|
-
y: 100,
|
|
148
|
-
data: "blablabla",
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
id: "someId2",
|
|
152
|
-
tag: "text",
|
|
153
|
-
width: 210,
|
|
154
|
-
height: 180,
|
|
155
|
-
x: 900,
|
|
156
|
-
y: 200,
|
|
157
|
-
data: "yip yip",
|
|
158
|
-
},
|
|
159
|
-
],
|
|
160
|
-
},
|
|
161
|
-
],
|
|
162
|
-
styles: {
|
|
163
|
-
1: { bold: true, textColor: "#3A3791", fontSize: 12 },
|
|
164
|
-
2: { italic: true },
|
|
165
|
-
3: { strikethrough: true },
|
|
166
|
-
4: { fillColor: "#e3efd9" },
|
|
167
|
-
5: { fillColor: "#c5e0b3" },
|
|
168
|
-
6: { fillColor: "#a7d08c" },
|
|
169
|
-
7: { align: "left" },
|
|
170
|
-
},
|
|
171
|
-
borders: {
|
|
172
|
-
1: { left: ["thin", "#000"] },
|
|
173
|
-
2: { top: ["thin", "#000"] },
|
|
174
|
-
3: {
|
|
175
|
-
top: ["thin", "#000"],
|
|
176
|
-
left: ["thin", "#000"],
|
|
177
|
-
bottom: ["thin", "#000"],
|
|
178
|
-
right: ["thin", "#000"],
|
|
179
|
-
},
|
|
180
|
-
4: { right: ["thin", "#000"], left: ["thin", "#000"] },
|
|
181
|
-
5: {
|
|
182
|
-
left: ["thin", "#000"],
|
|
183
|
-
right: ["thin", "#000"],
|
|
184
|
-
top: ["thin", "#000"],
|
|
185
|
-
},
|
|
186
|
-
6: {
|
|
187
|
-
left: ["thin", "#000"],
|
|
188
|
-
right: ["thin", "#000"],
|
|
189
|
-
bottom: ["thin", "#000"],
|
|
190
|
-
},
|
|
191
|
-
},
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
// Performance dataset
|
|
195
|
-
function _getColumnLetter(number) {
|
|
196
|
-
return number !== -1
|
|
197
|
-
? _getColumnLetter(Math.floor(number / 26) - 1) + String.fromCharCode(65 + (number % 26))
|
|
198
|
-
: "";
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
function computeCells(cols, rows) {
|
|
202
|
-
const cells = {};
|
|
203
|
-
for (let letter = 0; letter <= cols; letter++) {
|
|
204
|
-
const x = _getColumnLetter(letter);
|
|
205
|
-
if (letter === 0) {
|
|
206
|
-
cells[x + 3] = { content: letter.toString() };
|
|
207
|
-
} else {
|
|
208
|
-
const prev = _getColumnLetter(letter - 1);
|
|
209
|
-
cells[x + 3] = {
|
|
210
|
-
content: `=2*${prev}${rows}`,
|
|
211
|
-
formula: { text: "=2*|0|", dependencies: [`${prev}${rows}`] },
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
for (let index = 4; index <= rows; index++) {
|
|
215
|
-
cells[x + index] = {
|
|
216
|
-
content: `=${x}${index - 1}+1`,
|
|
217
|
-
formula: { text: "=|0|+1", dependencies: [`${x}${index - 1}`] },
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
const letter = _getColumnLetter(cols);
|
|
222
|
-
const nextLetter = _getColumnLetter(cols + 1);
|
|
223
|
-
for (let i = 3; i <= rows; i++) {
|
|
224
|
-
cells[nextLetter + i] = {
|
|
225
|
-
content: `=SUM(A${i}:${letter}${i})`,
|
|
226
|
-
formula: { text: "=SUM(|0|)", dependencies: [`A${i}:${letter}${i}`] },
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
return cells;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export function makeLargeDataset(cols, rows) {
|
|
233
|
-
return {
|
|
234
|
-
version: 1,
|
|
235
|
-
sheets: [
|
|
236
|
-
{
|
|
237
|
-
name: "Sheet1",
|
|
238
|
-
colNumber: 45,
|
|
239
|
-
rowNumber: 1000000,
|
|
240
|
-
cols: { 1: {}, 3: {} },
|
|
241
|
-
rows: {},
|
|
242
|
-
cells: computeCells(cols, rows),
|
|
243
|
-
},
|
|
244
|
-
],
|
|
245
|
-
styles: {
|
|
246
|
-
1: { bold: true, textColor: "#3A3791", fontSize: 12 },
|
|
247
|
-
2: { italic: true },
|
|
248
|
-
3: { strikethrough: true },
|
|
249
|
-
4: { fillColor: "#e3efd9" },
|
|
250
|
-
5: { fillColor: "#c5e0b3" },
|
|
251
|
-
6: { fillColor: "#a7d08c" },
|
|
252
|
-
},
|
|
253
|
-
borders: {},
|
|
254
|
-
};
|
|
255
|
-
}
|
package/demo/index.html
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<html>
|
|
2
|
-
<body>
|
|
3
|
-
<script src="../node_modules/@odoo/owl/dist/owl.iife.js"></script>
|
|
4
|
-
<script src="libs/Chart.bundle.js"></script>
|
|
5
|
-
<script src="../dist/o_spreadsheet.js"></script>
|
|
6
|
-
<script src="main.js" type="module"></script>
|
|
7
|
-
<title>o_spreadsheet</title>
|
|
8
|
-
</body>
|
|
9
|
-
</html>
|