@odoo/o-spreadsheet 17.4.22 → 17.4.23
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 +154 -104
- package/dist/o-spreadsheet.d.ts +15 -0
- package/dist/o-spreadsheet.esm.js +154 -104
- package/dist/o-spreadsheet.iife.js +154 -104
- package/dist/o-spreadsheet.iife.min.js +345 -345
- package/dist/o_spreadsheet.xml +3 -3
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 17.4.
|
|
6
|
-
* @date 2025-02-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.4.23
|
|
6
|
+
* @date 2025-02-14T08:37:12.219Z
|
|
7
|
+
* @hash 8339907
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -5499,6 +5499,37 @@
|
|
|
5499
5499
|
setIsFastStrategy(isFast) {
|
|
5500
5500
|
this.isFastIdStrategy = isFast;
|
|
5501
5501
|
}
|
|
5502
|
+
/**
|
|
5503
|
+
* Generates a custom UUID using a simple 36^12 method (8-character alphanumeric string with lowercase letters)
|
|
5504
|
+
* This has a higher chance of collision than a UUIDv4, but not only faster to generate than an UUIDV4,
|
|
5505
|
+
* it also has a smaller size, which is preferable to alleviate the overall data size.
|
|
5506
|
+
*
|
|
5507
|
+
* This method is preferable when generating uuids for the core data (sheetId, figureId, etc)
|
|
5508
|
+
* as they will appear several times in the revisions and local history.
|
|
5509
|
+
*
|
|
5510
|
+
*/
|
|
5511
|
+
smallUuid() {
|
|
5512
|
+
if (this.isFastIdStrategy) {
|
|
5513
|
+
this.fastIdStart++;
|
|
5514
|
+
return String(this.fastIdStart);
|
|
5515
|
+
//@ts-ignore
|
|
5516
|
+
}
|
|
5517
|
+
else if (window.crypto && window.crypto.getRandomValues) {
|
|
5518
|
+
//@ts-ignore
|
|
5519
|
+
return ([1e7] + -1e3).replace(/[018]/g, (c) => (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16));
|
|
5520
|
+
}
|
|
5521
|
+
else {
|
|
5522
|
+
// mainly for jest and other browsers that do not have the crypto functionality
|
|
5523
|
+
return "xxxxxxxx-xxxx".replace(/[xy]/g, function (c) {
|
|
5524
|
+
var r = (Math.random() * 16) | 0, v = c == "x" ? r : (r & 0x3) | 0x8;
|
|
5525
|
+
return v.toString(16);
|
|
5526
|
+
});
|
|
5527
|
+
}
|
|
5528
|
+
}
|
|
5529
|
+
/**
|
|
5530
|
+
* Generates an UUIDV4, has astronomically low chance of collision, but is larger in size than the smallUuid.
|
|
5531
|
+
* This method should be used when you need to avoid collisions at all costs, like the id of a revision.
|
|
5532
|
+
*/
|
|
5502
5533
|
uuidv4() {
|
|
5503
5534
|
if (this.isFastIdStrategy) {
|
|
5504
5535
|
this.fastIdStart++;
|
|
@@ -5512,7 +5543,7 @@
|
|
|
5512
5543
|
else {
|
|
5513
5544
|
// mainly for jest and other browsers that do not have the crypto functionality
|
|
5514
5545
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
|
|
5515
|
-
var r = (Math.random() * 16) | 0, v = c
|
|
5546
|
+
var r = (Math.random() * 16) | 0, v = c == "x" ? r : (r & 0x3) | 0x8;
|
|
5516
5547
|
return v.toString(16);
|
|
5517
5548
|
});
|
|
5518
5549
|
}
|
|
@@ -6899,7 +6930,7 @@
|
|
|
6899
6930
|
};
|
|
6900
6931
|
}
|
|
6901
6932
|
getPasteTarget(sheetId, target, content, options) {
|
|
6902
|
-
const newId = new UuidGenerator().
|
|
6933
|
+
const newId = new UuidGenerator().smallUuid();
|
|
6903
6934
|
return { zones: [], figureId: newId, sheetId };
|
|
6904
6935
|
}
|
|
6905
6936
|
paste(target, clippedContent, options) {
|
|
@@ -7041,7 +7072,9 @@
|
|
|
7041
7072
|
const cfInTarget = this.getters
|
|
7042
7073
|
.getConditionalFormats(targetSheetId)
|
|
7043
7074
|
.find((cf) => cf.stopIfTrue === originCF.stopIfTrue && deepEquals(cf.rule, originCF.rule));
|
|
7044
|
-
return cfInTarget
|
|
7075
|
+
return cfInTarget
|
|
7076
|
+
? cfInTarget
|
|
7077
|
+
: { ...originCF, id: this.uuidGenerator.smallUuid(), ranges: [] };
|
|
7045
7078
|
}
|
|
7046
7079
|
}
|
|
7047
7080
|
|
|
@@ -7126,7 +7159,7 @@
|
|
|
7126
7159
|
originRule.isBlocking === rule.isBlocking);
|
|
7127
7160
|
return ruleInTargetSheet
|
|
7128
7161
|
? ruleInTargetSheet
|
|
7129
|
-
: { ...originRule, id: newId ? this.uuidGenerator.
|
|
7162
|
+
: { ...originRule, id: newId ? this.uuidGenerator.smallUuid() : originRule.id, ranges: [] };
|
|
7130
7163
|
}
|
|
7131
7164
|
/**
|
|
7132
7165
|
* Add or remove XCs to a given data validation rule.
|
|
@@ -7167,7 +7200,7 @@
|
|
|
7167
7200
|
};
|
|
7168
7201
|
}
|
|
7169
7202
|
getPasteTarget(sheetId, target, content, options) {
|
|
7170
|
-
const newId = new UuidGenerator().
|
|
7203
|
+
const newId = new UuidGenerator().smallUuid();
|
|
7171
7204
|
return { sheetId, zones: [], figureId: newId };
|
|
7172
7205
|
}
|
|
7173
7206
|
paste(target, clippedContent, options) {
|
|
@@ -13036,6 +13069,25 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
13036
13069
|
isExported: true,
|
|
13037
13070
|
};
|
|
13038
13071
|
// -----------------------------------------------------------------------------
|
|
13072
|
+
// LOG
|
|
13073
|
+
// -----------------------------------------------------------------------------
|
|
13074
|
+
const LOG = {
|
|
13075
|
+
description: _t("The logarithm of a number, for a given base."),
|
|
13076
|
+
args: [
|
|
13077
|
+
arg("value (number)", _t("The value for which to calculate the logarithm.")),
|
|
13078
|
+
arg("base (number, default=10)", _t("The base of the logarithm.")),
|
|
13079
|
+
],
|
|
13080
|
+
compute: function (value, base = { value: 10 }) {
|
|
13081
|
+
const _value = toNumber(value, this.locale);
|
|
13082
|
+
const _base = toNumber(base, this.locale);
|
|
13083
|
+
assert(() => _value > 0, _t("The value (%s) must be strictly positive.", _value.toString()));
|
|
13084
|
+
assert(() => _base > 0, _t("The base (%s) must be strictly positive.", _base.toString()));
|
|
13085
|
+
assert(() => _base !== 1, _t("The base must be different from 1."));
|
|
13086
|
+
return Math.log10(_value) / Math.log10(_base);
|
|
13087
|
+
},
|
|
13088
|
+
isExported: true,
|
|
13089
|
+
};
|
|
13090
|
+
// -----------------------------------------------------------------------------
|
|
13039
13091
|
// MOD
|
|
13040
13092
|
// -----------------------------------------------------------------------------
|
|
13041
13093
|
function mod(dividend, divisor) {
|
|
@@ -13549,6 +13601,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
13549
13601
|
ISODD: ISODD,
|
|
13550
13602
|
ISO_CEILING: ISO_CEILING,
|
|
13551
13603
|
LN: LN,
|
|
13604
|
+
LOG: LOG,
|
|
13552
13605
|
MOD: MOD,
|
|
13553
13606
|
MUNIT: MUNIT,
|
|
13554
13607
|
ODD: ODD,
|
|
@@ -16257,7 +16310,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
16257
16310
|
}
|
|
16258
16311
|
}
|
|
16259
16312
|
},
|
|
16260
|
-
isExported:
|
|
16313
|
+
isExported: false,
|
|
16261
16314
|
};
|
|
16262
16315
|
// -----------------------------------------------------------------------------
|
|
16263
16316
|
// UNIQUE
|
|
@@ -23523,17 +23576,15 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
23523
23576
|
plugins: [],
|
|
23524
23577
|
};
|
|
23525
23578
|
}
|
|
23526
|
-
function getChartLabelFormat(getters, range) {
|
|
23579
|
+
function getChartLabelFormat(getters, range, shouldRemoveFirstLabel) {
|
|
23527
23580
|
if (!range)
|
|
23528
23581
|
return undefined;
|
|
23529
|
-
const { sheetId, zone
|
|
23530
|
-
|
|
23531
|
-
|
|
23532
|
-
|
|
23533
|
-
return format;
|
|
23534
|
-
}
|
|
23582
|
+
const { sheetId, zone } = range;
|
|
23583
|
+
const formats = positions(zone).map((position) => getters.getEvaluatedCell({ sheetId, ...position }).format);
|
|
23584
|
+
if (shouldRemoveFirstLabel) {
|
|
23585
|
+
formats.shift();
|
|
23535
23586
|
}
|
|
23536
|
-
return undefined;
|
|
23587
|
+
return formats.find((format) => format !== undefined);
|
|
23537
23588
|
}
|
|
23538
23589
|
function getChartLabelValues(getters, dataSets, labelRange) {
|
|
23539
23590
|
let labels = { values: [], formattedValues: [] };
|
|
@@ -23871,9 +23922,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
23871
23922
|
const labelValues = getChartLabelValues(getters, chart.dataSets, chart.labelRange);
|
|
23872
23923
|
let labels = labelValues.formattedValues;
|
|
23873
23924
|
let dataSetsValues = getChartDatasetValues(getters, chart.dataSets);
|
|
23874
|
-
if (chart.dataSetsHaveTitle
|
|
23875
|
-
dataSetsValues[0] &&
|
|
23876
|
-
labels.length > dataSetsValues[0].data.length) {
|
|
23925
|
+
if (shouldRemoveFirstLabel(chart.labelRange, chart.dataSets[0], chart.dataSetsHaveTitle)) {
|
|
23877
23926
|
labels.shift();
|
|
23878
23927
|
}
|
|
23879
23928
|
({ labels, dataSetsValues } = filterEmptyDataPoints(labels, dataSetsValues));
|
|
@@ -24050,8 +24099,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
24050
24099
|
}
|
|
24051
24100
|
return { labels: newLabels, dataSetsValues: newDatasets };
|
|
24052
24101
|
}
|
|
24053
|
-
function canChartParseLabels(
|
|
24054
|
-
return canBeDateChart(
|
|
24102
|
+
function canChartParseLabels(chart, getters) {
|
|
24103
|
+
return canBeDateChart(chart, getters) || canBeLinearChart(chart, getters);
|
|
24055
24104
|
}
|
|
24056
24105
|
function getChartAxisType(chart, getters) {
|
|
24057
24106
|
if (isDateChart(chart, getters) && isLuxonTimeAdapterInstalled()) {
|
|
@@ -24063,23 +24112,26 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
24063
24112
|
return "category";
|
|
24064
24113
|
}
|
|
24065
24114
|
function isDateChart(chart, getters) {
|
|
24066
|
-
return !chart.labelsAsText && canBeDateChart(chart
|
|
24115
|
+
return !chart.labelsAsText && canBeDateChart(chart, getters);
|
|
24067
24116
|
}
|
|
24068
24117
|
function isLinearChart(chart, getters) {
|
|
24069
|
-
return !chart.labelsAsText && canBeLinearChart(chart
|
|
24118
|
+
return !chart.labelsAsText && canBeLinearChart(chart, getters);
|
|
24070
24119
|
}
|
|
24071
|
-
function canBeDateChart(
|
|
24072
|
-
if (!labelRange || !canBeLinearChart(
|
|
24120
|
+
function canBeDateChart(chart, getters) {
|
|
24121
|
+
if (!chart.labelRange || !canBeLinearChart(chart, getters)) {
|
|
24073
24122
|
return false;
|
|
24074
24123
|
}
|
|
24075
|
-
const labelFormat = getChartLabelFormat(getters, labelRange);
|
|
24124
|
+
const labelFormat = getChartLabelFormat(getters, chart.labelRange, shouldRemoveFirstLabel(chart.labelRange, chart.dataSets[0], chart.dataSetsHaveTitle));
|
|
24076
24125
|
return Boolean(labelFormat && timeFormatLuxonCompatible.test(labelFormat));
|
|
24077
24126
|
}
|
|
24078
|
-
function canBeLinearChart(
|
|
24079
|
-
if (!labelRange) {
|
|
24127
|
+
function canBeLinearChart(chart, getters) {
|
|
24128
|
+
if (!chart.labelRange) {
|
|
24080
24129
|
return false;
|
|
24081
24130
|
}
|
|
24082
|
-
const labels = getters.getRangeValues(labelRange);
|
|
24131
|
+
const labels = getters.getRangeValues(chart.labelRange);
|
|
24132
|
+
if (shouldRemoveFirstLabel(chart.labelRange, chart.dataSets[0], chart.dataSetsHaveTitle)) {
|
|
24133
|
+
labels.shift();
|
|
24134
|
+
}
|
|
24083
24135
|
if (labels.some((label) => isNaN(Number(label)) && label)) {
|
|
24084
24136
|
return false;
|
|
24085
24137
|
}
|
|
@@ -24182,9 +24234,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
24182
24234
|
const labelValues = getChartLabelValues(getters, chart.dataSets, chart.labelRange);
|
|
24183
24235
|
let labels = axisType === "linear" ? labelValues.values : labelValues.formattedValues;
|
|
24184
24236
|
let dataSetsValues = getChartDatasetValues(getters, chart.dataSets);
|
|
24185
|
-
|
|
24186
|
-
|
|
24187
|
-
labels.length > dataSetsValues[0].data.length) {
|
|
24237
|
+
const removeFirstLabel = shouldRemoveFirstLabel(chart.labelRange, chart.dataSets[0], chart.dataSetsHaveTitle);
|
|
24238
|
+
if (removeFirstLabel) {
|
|
24188
24239
|
labels.shift();
|
|
24189
24240
|
}
|
|
24190
24241
|
({ labels, dataSetsValues } = filterEmptyDataPoints(labels, dataSetsValues));
|
|
@@ -24199,7 +24250,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
24199
24250
|
const dataSetFormat = getChartDatasetFormat(getters, chart.dataSets);
|
|
24200
24251
|
const options = { format: dataSetFormat, locale, truncateLabels };
|
|
24201
24252
|
const config = getLineOrScatterConfiguration(chart, labels, options);
|
|
24202
|
-
const labelFormat = getChartLabelFormat(getters, chart.labelRange);
|
|
24253
|
+
const labelFormat = getChartLabelFormat(getters, chart.labelRange, removeFirstLabel);
|
|
24203
24254
|
if (axisType === "time") {
|
|
24204
24255
|
const axis = {
|
|
24205
24256
|
type: "time",
|
|
@@ -24413,9 +24464,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
24413
24464
|
const labelValues = getChartLabelValues(getters, chart.dataSets, chart.labelRange);
|
|
24414
24465
|
let labels = labelValues.formattedValues;
|
|
24415
24466
|
let dataSetsValues = getChartDatasetValues(getters, chart.dataSets);
|
|
24416
|
-
if (chart.dataSetsHaveTitle
|
|
24417
|
-
dataSetsValues[0] &&
|
|
24418
|
-
labels.length > dataSetsValues[0].data.length) {
|
|
24467
|
+
if (shouldRemoveFirstLabel(chart.labelRange, chart.dataSets[0], chart.dataSetsHaveTitle)) {
|
|
24419
24468
|
labels.shift();
|
|
24420
24469
|
}
|
|
24421
24470
|
({ labels, dataSetsValues } = filterEmptyDataPoints(labels, dataSetsValues));
|
|
@@ -25068,9 +25117,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25068
25117
|
const labelValues = getChartLabelValues(getters, chart.dataSets, chart.labelRange);
|
|
25069
25118
|
let labels = labelValues.formattedValues;
|
|
25070
25119
|
let dataSetsValues = getChartDatasetValues(getters, chart.dataSets);
|
|
25071
|
-
if (chart.dataSetsHaveTitle
|
|
25072
|
-
dataSetsValues[0] &&
|
|
25073
|
-
labels.length > dataSetsValues[0].data.length) {
|
|
25120
|
+
if (shouldRemoveFirstLabel(chart.labelRange, chart.dataSets[0], chart.dataSetsHaveTitle)) {
|
|
25074
25121
|
labels.shift();
|
|
25075
25122
|
}
|
|
25076
25123
|
({ labels, dataSetsValues } = filterEmptyDataPoints(labels, dataSetsValues));
|
|
@@ -25618,9 +25665,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25618
25665
|
const labelValues = getChartLabelValues(getters, chart.dataSets, chart.labelRange);
|
|
25619
25666
|
let labels = labelValues.formattedValues;
|
|
25620
25667
|
let dataSetsValues = getChartDatasetValues(getters, chart.dataSets);
|
|
25621
|
-
if (chart.dataSetsHaveTitle
|
|
25622
|
-
dataSetsValues[0] &&
|
|
25623
|
-
labels.length > dataSetsValues[0].data.length) {
|
|
25668
|
+
if (shouldRemoveFirstLabel(chart.labelRange, chart.dataSets[0], chart.dataSetsHaveTitle)) {
|
|
25624
25669
|
labels.shift();
|
|
25625
25670
|
}
|
|
25626
25671
|
({ labels, dataSetsValues } = filterEmptyDataPoints(labels, dataSetsValues));
|
|
@@ -27138,7 +27183,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
27138
27183
|
const deleteSheet = {
|
|
27139
27184
|
name: _t("Delete"),
|
|
27140
27185
|
isVisible: (env) => {
|
|
27141
|
-
return env.model.getters.
|
|
27186
|
+
return env.model.getters.getVisibleSheetIds().length > 1;
|
|
27142
27187
|
},
|
|
27143
27188
|
execute: (env) => env.askConfirmation(_t("Are you sure you want to delete this sheet?"), () => {
|
|
27144
27189
|
env.model.dispatch("DELETE_SHEET", { sheetId: env.model.getters.getActiveSheetId() });
|
|
@@ -27148,7 +27193,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
27148
27193
|
name: _t("Duplicate"),
|
|
27149
27194
|
execute: (env) => {
|
|
27150
27195
|
const sheetIdFrom = env.model.getters.getActiveSheetId();
|
|
27151
|
-
const sheetIdTo = env.model.uuidGenerator.
|
|
27196
|
+
const sheetIdTo = env.model.uuidGenerator.smallUuid();
|
|
27152
27197
|
env.model.dispatch("DUPLICATE_SHEET", {
|
|
27153
27198
|
sheetId: sheetIdFrom,
|
|
27154
27199
|
sheetIdTo,
|
|
@@ -27763,20 +27808,21 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
27763
27808
|
}
|
|
27764
27809
|
// Only display legend for several datasets.
|
|
27765
27810
|
const newLegendPos = dataSetZone.right === dataSetZone.left ? "none" : "top";
|
|
27766
|
-
const
|
|
27767
|
-
|
|
27768
|
-
|
|
27769
|
-
|
|
27770
|
-
|
|
27771
|
-
|
|
27772
|
-
|
|
27773
|
-
|
|
27774
|
-
|
|
27775
|
-
|
|
27776
|
-
|
|
27777
|
-
|
|
27778
|
-
|
|
27779
|
-
|
|
27811
|
+
const lineChartDefinition = {
|
|
27812
|
+
title: {},
|
|
27813
|
+
dataSets,
|
|
27814
|
+
labelsAsText: false,
|
|
27815
|
+
stacked: false,
|
|
27816
|
+
aggregated: false,
|
|
27817
|
+
cumulative: false,
|
|
27818
|
+
labelRange: labelRangeXc,
|
|
27819
|
+
type: "line",
|
|
27820
|
+
dataSetsHaveTitle,
|
|
27821
|
+
legendPosition: newLegendPos,
|
|
27822
|
+
};
|
|
27823
|
+
const chart = new LineChart(lineChartDefinition, sheetId, getters);
|
|
27824
|
+
if (canChartParseLabels(chart, getters)) {
|
|
27825
|
+
return lineChartDefinition;
|
|
27780
27826
|
}
|
|
27781
27827
|
const _dataSets = createDataSets(getters, dataSets, sheetId, dataSetsHaveTitle);
|
|
27782
27828
|
if (singleColumn &&
|
|
@@ -28470,7 +28516,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28470
28516
|
//------------------------------------------------------------------------------
|
|
28471
28517
|
const CREATE_CHART = (env) => {
|
|
28472
28518
|
const getters = env.model.getters;
|
|
28473
|
-
const id = env.model.uuidGenerator.
|
|
28519
|
+
const id = env.model.uuidGenerator.smallUuid();
|
|
28474
28520
|
const sheetId = getters.getActiveSheetId();
|
|
28475
28521
|
if (getZoneArea(env.model.getters.getSelectedZone()) === 1) {
|
|
28476
28522
|
env.model.selection.selectTableAroundSelection();
|
|
@@ -28493,8 +28539,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28493
28539
|
// Pivots
|
|
28494
28540
|
//------------------------------------------------------------------------------
|
|
28495
28541
|
const CREATE_PIVOT = (env) => {
|
|
28496
|
-
const pivotId = env.model.uuidGenerator.
|
|
28497
|
-
const newSheetId = env.model.uuidGenerator.
|
|
28542
|
+
const pivotId = env.model.uuidGenerator.smallUuid();
|
|
28543
|
+
const newSheetId = env.model.uuidGenerator.smallUuid();
|
|
28498
28544
|
const result = env.model.dispatch("INSERT_NEW_PIVOT", { pivotId, newSheetId });
|
|
28499
28545
|
if (result.isSuccessful) {
|
|
28500
28546
|
env.openSidePanel("PivotSidePanel", { pivotId });
|
|
@@ -28553,7 +28599,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28553
28599
|
const CREATE_IMAGE = async (env) => {
|
|
28554
28600
|
if (env.imageProvider) {
|
|
28555
28601
|
const sheetId = env.model.getters.getActiveSheetId();
|
|
28556
|
-
const figureId = env.model.uuidGenerator.
|
|
28602
|
+
const figureId = env.model.uuidGenerator.smallUuid();
|
|
28557
28603
|
const image = await requestImage(env);
|
|
28558
28604
|
if (!image) {
|
|
28559
28605
|
throw new Error("No image provider was given to the environment");
|
|
@@ -29106,7 +29152,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
29106
29152
|
ranges,
|
|
29107
29153
|
sheetId,
|
|
29108
29154
|
rule: {
|
|
29109
|
-
id: env.model.uuidGenerator.
|
|
29155
|
+
id: env.model.uuidGenerator.smallUuid(),
|
|
29110
29156
|
criterion: {
|
|
29111
29157
|
type: "isBoolean",
|
|
29112
29158
|
values: [],
|
|
@@ -29122,7 +29168,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
29122
29168
|
const zones = env.model.getters.getSelectedZones();
|
|
29123
29169
|
const sheetId = env.model.getters.getActiveSheetId();
|
|
29124
29170
|
const ranges = zones.map((zone) => env.model.getters.getRangeDataFromZone(sheetId, zone));
|
|
29125
|
-
const ruleID = env.model.uuidGenerator.
|
|
29171
|
+
const ruleID = env.model.uuidGenerator.smallUuid();
|
|
29126
29172
|
env.model.dispatch("ADD_DATA_VALIDATION_RULE", {
|
|
29127
29173
|
ranges,
|
|
29128
29174
|
sheetId,
|
|
@@ -29153,7 +29199,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
29153
29199
|
execute: (env) => {
|
|
29154
29200
|
const activeSheetId = env.model.getters.getActiveSheetId();
|
|
29155
29201
|
const position = env.model.getters.getSheetIds().indexOf(activeSheetId) + 1;
|
|
29156
|
-
const sheetId = env.model.uuidGenerator.
|
|
29202
|
+
const sheetId = env.model.uuidGenerator.smallUuid();
|
|
29157
29203
|
env.model.dispatch("CREATE_SHEET", { sheetId, position });
|
|
29158
29204
|
env.model.dispatch("ACTIVATE_SHEET", { sheetIdFrom: activeSheetId, sheetIdTo: sheetId });
|
|
29159
29205
|
},
|
|
@@ -32852,7 +32898,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
32852
32898
|
get canTreatLabelsAsText() {
|
|
32853
32899
|
const chart = this.env.model.getters.getChart(this.props.figureId);
|
|
32854
32900
|
if (chart && chart instanceof LineChart) {
|
|
32855
|
-
return canChartParseLabels(chart
|
|
32901
|
+
return canChartParseLabels(chart, this.env.model.getters);
|
|
32856
32902
|
}
|
|
32857
32903
|
return false;
|
|
32858
32904
|
}
|
|
@@ -32924,7 +32970,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
32924
32970
|
get canTreatLabelsAsText() {
|
|
32925
32971
|
const chart = this.env.model.getters.getChart(this.props.figureId);
|
|
32926
32972
|
if (chart && chart instanceof ScatterChart) {
|
|
32927
|
-
return canChartParseLabels(chart
|
|
32973
|
+
return canChartParseLabels(chart, this.env.model.getters);
|
|
32928
32974
|
}
|
|
32929
32975
|
return false;
|
|
32930
32976
|
}
|
|
@@ -34223,7 +34269,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
34223
34269
|
state;
|
|
34224
34270
|
setup() {
|
|
34225
34271
|
const cf = this.props.editedCf || {
|
|
34226
|
-
id: this.env.model.uuidGenerator.
|
|
34272
|
+
id: this.env.model.uuidGenerator.smallUuid(),
|
|
34227
34273
|
ranges: this.env.model.getters
|
|
34228
34274
|
.getSelectedZones()
|
|
34229
34275
|
.map((zone) => this.env.model.getters.zoneToXC(this.env.model.getters.getActiveSheetId(), zone)),
|
|
@@ -35195,7 +35241,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
35195
35241
|
.getSelectedZones()
|
|
35196
35242
|
.map((zone) => zoneToXc(this.env.model.getters.getUnboundedZone(sheetId, zone)));
|
|
35197
35243
|
return {
|
|
35198
|
-
id: this.env.model.uuidGenerator.
|
|
35244
|
+
id: this.env.model.uuidGenerator.smallUuid(),
|
|
35199
35245
|
criterion: { type: "textContains", values: [""] },
|
|
35200
35246
|
ranges,
|
|
35201
35247
|
};
|
|
@@ -36314,8 +36360,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
36314
36360
|
return this.env.model.getters.getPivotDisplayName(this.props.pivotId);
|
|
36315
36361
|
}
|
|
36316
36362
|
duplicatePivot() {
|
|
36317
|
-
const newPivotId = this.env.model.uuidGenerator.
|
|
36318
|
-
const newSheetId = this.env.model.uuidGenerator.
|
|
36363
|
+
const newPivotId = this.env.model.uuidGenerator.smallUuid();
|
|
36364
|
+
const newSheetId = this.env.model.uuidGenerator.smallUuid();
|
|
36319
36365
|
const result = this.env.model.dispatch("DUPLICATE_PIVOT_IN_NEW_SHEET", {
|
|
36320
36366
|
pivotId: this.props.pivotId,
|
|
36321
36367
|
newPivotId,
|
|
@@ -38644,7 +38690,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
38644
38690
|
this.state.selectedTemplateName = templateName;
|
|
38645
38691
|
}
|
|
38646
38692
|
onConfirm() {
|
|
38647
|
-
const tableStyleId = this.props.styleId || this.env.model.uuidGenerator.
|
|
38693
|
+
const tableStyleId = this.props.styleId || this.env.model.uuidGenerator.smallUuid();
|
|
38648
38694
|
this.env.model.dispatch("CREATE_TABLE_STYLE", {
|
|
38649
38695
|
tableStyleId,
|
|
38650
38696
|
tableStyleName: this.state.styleName,
|
|
@@ -50925,7 +50971,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
50925
50971
|
case "RENAME_SHEET":
|
|
50926
50972
|
return this.isRenameAllowed(cmd);
|
|
50927
50973
|
case "DELETE_SHEET":
|
|
50928
|
-
return this.
|
|
50974
|
+
return this.getVisibleSheetIds().length > 1
|
|
50929
50975
|
? "Success" /* CommandResult.Success */
|
|
50930
50976
|
: "NotEnoughSheets" /* CommandResult.NotEnoughSheets */;
|
|
50931
50977
|
case "ADD_COLUMNS_ROWS":
|
|
@@ -51782,7 +51828,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
51782
51828
|
const union = this.getters.getRangesUnion(ranges);
|
|
51783
51829
|
const mergesInTarget = this.getters.getMergesInZone(cmd.sheetId, union.zone);
|
|
51784
51830
|
this.dispatch("REMOVE_MERGE", { sheetId: cmd.sheetId, target: mergesInTarget });
|
|
51785
|
-
const id = this.uuidGenerator.
|
|
51831
|
+
const id = this.uuidGenerator.smallUuid();
|
|
51786
51832
|
const config = cmd.config || DEFAULT_TABLE_CONFIG;
|
|
51787
51833
|
const newTable = cmd.tableType === "dynamic"
|
|
51788
51834
|
? this.createDynamicTable(id, union, config)
|
|
@@ -51935,7 +51981,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
51935
51981
|
filters = [];
|
|
51936
51982
|
for (const i of range(zone.left, zone.right + 1)) {
|
|
51937
51983
|
const filterZone = { ...zone, left: i, right: i };
|
|
51938
|
-
const uid = this.uuidGenerator.
|
|
51984
|
+
const uid = this.uuidGenerator.smallUuid();
|
|
51939
51985
|
filters.push(this.createFilterFromZone(uid, tableRange.sheetId, filterZone, config));
|
|
51940
51986
|
}
|
|
51941
51987
|
}
|
|
@@ -52000,7 +52046,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
52000
52046
|
? table.filters.find((f) => f.col === i)
|
|
52001
52047
|
: undefined;
|
|
52002
52048
|
const filterZone = { ...tableZone, left: i, right: i };
|
|
52003
|
-
const filterId = oldFilter?.id || this.uuidGenerator.
|
|
52049
|
+
const filterId = oldFilter?.id || this.uuidGenerator.smallUuid();
|
|
52004
52050
|
filters.push(this.createFilterFromZone(filterId, tableRange.sheetId, filterZone, config));
|
|
52005
52051
|
}
|
|
52006
52052
|
}
|
|
@@ -52101,7 +52147,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
52101
52147
|
if (filters.length < zoneToDimension(tableZone).numberOfCols) {
|
|
52102
52148
|
for (let col = tableZone.left; col <= tableZone.right; col++) {
|
|
52103
52149
|
if (!filters.find((filter) => filter.col === col)) {
|
|
52104
|
-
const uid = this.uuidGenerator.
|
|
52150
|
+
const uid = this.uuidGenerator.smallUuid();
|
|
52105
52151
|
const filterZone = { ...tableZone, left: col, right: col };
|
|
52106
52152
|
filters.push(this.createFilterFromZone(uid, sheetId, filterZone, table.config));
|
|
52107
52153
|
}
|
|
@@ -59050,23 +59096,23 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
59050
59096
|
function repeatCreateChartCommand(getters, cmd) {
|
|
59051
59097
|
return {
|
|
59052
59098
|
...repeatSheetDependantCommand(getters, cmd),
|
|
59053
|
-
id: uuidGenerator.
|
|
59099
|
+
id: uuidGenerator.smallUuid(),
|
|
59054
59100
|
};
|
|
59055
59101
|
}
|
|
59056
59102
|
function repeatCreateImageCommand(getters, cmd) {
|
|
59057
59103
|
return {
|
|
59058
59104
|
...repeatSheetDependantCommand(getters, cmd),
|
|
59059
|
-
figureId: uuidGenerator.
|
|
59105
|
+
figureId: uuidGenerator.smallUuid(),
|
|
59060
59106
|
};
|
|
59061
59107
|
}
|
|
59062
59108
|
function repeatCreateFigureCommand(getters, cmd) {
|
|
59063
59109
|
const newCmd = repeatSheetDependantCommand(getters, cmd);
|
|
59064
|
-
newCmd.figure.id = uuidGenerator.
|
|
59110
|
+
newCmd.figure.id = uuidGenerator.smallUuid();
|
|
59065
59111
|
return newCmd;
|
|
59066
59112
|
}
|
|
59067
59113
|
function repeatCreateSheetCommand(getters, cmd) {
|
|
59068
59114
|
const newCmd = deepCopy(cmd);
|
|
59069
|
-
newCmd.sheetId = uuidGenerator.
|
|
59115
|
+
newCmd.sheetId = uuidGenerator.smallUuid();
|
|
59070
59116
|
const sheetName = cmd.name || getters.getSheet(getters.getActiveSheetId()).name;
|
|
59071
59117
|
// Extract the prefix of the sheet name (everything before the number at the end of the name)
|
|
59072
59118
|
const namePrefix = sheetName.match(/(.+?)\d*$/)?.[1] || sheetName;
|
|
@@ -60536,23 +60582,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60536
60582
|
gridSelection: deepCopy(gridSelection),
|
|
60537
60583
|
};
|
|
60538
60584
|
}
|
|
60539
|
-
|
|
60540
|
-
const currentSheetIds = this.getters.getVisibleSheetIds();
|
|
60541
|
-
this.activeSheet = this.getters.getSheet(currentSheetIds[0]);
|
|
60542
|
-
if (this.activeSheet.id in this.sheetsData) {
|
|
60543
|
-
const { anchor } = this.clipSelection(this.activeSheet.id, this.sheetsData[this.activeSheet.id].gridSelection);
|
|
60544
|
-
this.selectCell(anchor.cell.col, anchor.cell.row);
|
|
60545
|
-
}
|
|
60546
|
-
else {
|
|
60547
|
-
this.selectCell(0, 0);
|
|
60548
|
-
}
|
|
60549
|
-
const { col, row } = this.gridSelection.anchor.cell;
|
|
60550
|
-
this.moveClient({
|
|
60551
|
-
sheetId: this.getters.getActiveSheetId(),
|
|
60552
|
-
col,
|
|
60553
|
-
row,
|
|
60554
|
-
});
|
|
60555
|
-
}
|
|
60585
|
+
this.fallbackToVisibleSheet();
|
|
60556
60586
|
const sheetId = this.getters.getActiveSheetId();
|
|
60557
60587
|
this.gridSelection.zones = this.gridSelection.zones.map((z) => this.getters.expandZone(sheetId, z));
|
|
60558
60588
|
this.gridSelection.anchor.zone = this.getters.expandZone(sheetId, this.gridSelection.anchor.zone);
|
|
@@ -60562,6 +60592,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60562
60592
|
}
|
|
60563
60593
|
}
|
|
60564
60594
|
finalize() {
|
|
60595
|
+
this.fallbackToVisibleSheet();
|
|
60565
60596
|
/** Any change to the selection has to be reflected in the selection processor. */
|
|
60566
60597
|
this.selection.resetDefaultAnchor(this, deepCopy(this.gridSelection.anchor));
|
|
60567
60598
|
}
|
|
@@ -60865,6 +60896,25 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60865
60896
|
}
|
|
60866
60897
|
return "Success" /* CommandResult.Success */;
|
|
60867
60898
|
}
|
|
60899
|
+
fallbackToVisibleSheet() {
|
|
60900
|
+
if (!this.getters.tryGetSheet(this.getters.getActiveSheetId())) {
|
|
60901
|
+
const currentSheetIds = this.getters.getVisibleSheetIds();
|
|
60902
|
+
this.activeSheet = this.getters.getSheet(currentSheetIds[0]);
|
|
60903
|
+
if (this.activeSheet.id in this.sheetsData) {
|
|
60904
|
+
const { anchor } = this.clipSelection(this.activeSheet.id, this.sheetsData[this.activeSheet.id].gridSelection);
|
|
60905
|
+
this.selectCell(anchor.cell.col, anchor.cell.row);
|
|
60906
|
+
}
|
|
60907
|
+
else {
|
|
60908
|
+
this.selectCell(0, 0);
|
|
60909
|
+
}
|
|
60910
|
+
const { col, row } = this.gridSelection.anchor.cell;
|
|
60911
|
+
this.moveClient({
|
|
60912
|
+
sheetId: this.getters.getActiveSheetId(),
|
|
60913
|
+
col,
|
|
60914
|
+
row,
|
|
60915
|
+
});
|
|
60916
|
+
}
|
|
60917
|
+
}
|
|
60868
60918
|
//-------------------------------------------
|
|
60869
60919
|
// Helpers for extensions
|
|
60870
60920
|
// ------------------------------------------
|
|
@@ -62844,7 +62894,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62844
62894
|
clickAddSheet(ev) {
|
|
62845
62895
|
const activeSheetId = this.env.model.getters.getActiveSheetId();
|
|
62846
62896
|
const position = this.env.model.getters.getSheetIds().findIndex((sheetId) => sheetId === activeSheetId) + 1;
|
|
62847
|
-
const sheetId = this.env.model.uuidGenerator.
|
|
62897
|
+
const sheetId = this.env.model.uuidGenerator.smallUuid();
|
|
62848
62898
|
const name = this.env.model.getters.getNextSheetName(_t("Sheet"));
|
|
62849
62899
|
this.env.model.dispatch("CREATE_SHEET", { sheetId, position, name });
|
|
62850
62900
|
this.env.model.dispatch("ACTIVATE_SHEET", { sheetIdFrom: activeSheetId, sheetIdTo: sheetId });
|
|
@@ -68402,7 +68452,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
68402
68452
|
}
|
|
68403
68453
|
setupConfig(config) {
|
|
68404
68454
|
const client = config.client || {
|
|
68405
|
-
id: this.uuidGenerator.
|
|
68455
|
+
id: this.uuidGenerator.smallUuid(),
|
|
68406
68456
|
name: _t("Anonymous").toString(),
|
|
68407
68457
|
};
|
|
68408
68458
|
const transportService = config.transportService || new LocalTransportService();
|
|
@@ -68921,9 +68971,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
68921
68971
|
exports.tokenize = tokenize;
|
|
68922
68972
|
|
|
68923
68973
|
|
|
68924
|
-
__info__.version = "17.4.
|
|
68925
|
-
__info__.date = "2025-02-
|
|
68926
|
-
__info__.hash = "
|
|
68974
|
+
__info__.version = "17.4.23";
|
|
68975
|
+
__info__.date = "2025-02-14T08:37:12.219Z";
|
|
68976
|
+
__info__.hash = "8339907";
|
|
68927
68977
|
|
|
68928
68978
|
|
|
68929
68979
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|