@odoo/o-spreadsheet 15.2.9 → 15.2.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/dist/o-spreadsheet.cjs.js +42 -4
- package/dist/o-spreadsheet.d.ts +2 -0
- package/dist/o-spreadsheet.esm.js +42 -4
- package/dist/o-spreadsheet.iife.js +42 -4
- package/dist/o-spreadsheet.iife.min.js +361 -361
- package/package.json +1 -1
|
@@ -2965,6 +2965,36 @@ function lazy(fn) {
|
|
|
2965
2965
|
};
|
|
2966
2966
|
lazyValue.map = (callback) => lazy(() => callback(lazyValue()));
|
|
2967
2967
|
return lazyValue;
|
|
2968
|
+
}
|
|
2969
|
+
/**
|
|
2970
|
+
* Compares two objects.
|
|
2971
|
+
*/
|
|
2972
|
+
function deepEquals(o1, o2) {
|
|
2973
|
+
if (o1 === o2)
|
|
2974
|
+
return true;
|
|
2975
|
+
if ((o1 && !o2) || (o2 && !o1))
|
|
2976
|
+
return false;
|
|
2977
|
+
if (typeof o1 !== typeof o2)
|
|
2978
|
+
return false;
|
|
2979
|
+
if (typeof o1 !== "object")
|
|
2980
|
+
return o1 === o2;
|
|
2981
|
+
// Objects can have different keys if the values are undefined
|
|
2982
|
+
const keys = new Set();
|
|
2983
|
+
Object.keys(o1).forEach((key) => keys.add(key));
|
|
2984
|
+
Object.keys(o2).forEach((key) => keys.add(key));
|
|
2985
|
+
for (let key of keys) {
|
|
2986
|
+
if (typeof o1[key] !== typeof o1[key])
|
|
2987
|
+
return false;
|
|
2988
|
+
if (typeof o1[key] === "object") {
|
|
2989
|
+
if (!deepEquals(o1[key], o2[key]))
|
|
2990
|
+
return false;
|
|
2991
|
+
}
|
|
2992
|
+
else {
|
|
2993
|
+
if (o1[key] !== o2[key])
|
|
2994
|
+
return false;
|
|
2995
|
+
}
|
|
2996
|
+
}
|
|
2997
|
+
return true;
|
|
2968
2998
|
}
|
|
2969
2999
|
|
|
2970
3000
|
function createDefaultCols(colNumber) {
|
|
@@ -19201,6 +19231,7 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
19201
19231
|
// stores the computed styles in the format of computedStyles.sheetName[col][row] = Style
|
|
19202
19232
|
this.computedStyles = {};
|
|
19203
19233
|
this.computedIcons = {};
|
|
19234
|
+
this.uuidGenerator = new UuidGenerator();
|
|
19204
19235
|
/**
|
|
19205
19236
|
* Execute the predicate to know if a conditional formatting rule should be applied to a cell
|
|
19206
19237
|
*/
|
|
@@ -19554,13 +19585,20 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
19554
19585
|
this.adaptRules(origin.sheetId, cf, [xc], toRemoveRange);
|
|
19555
19586
|
}
|
|
19556
19587
|
else {
|
|
19557
|
-
this.adaptRules(target.sheetId, cf, [xc], []);
|
|
19558
19588
|
this.adaptRules(origin.sheetId, cf, [], toRemoveRange);
|
|
19589
|
+
const cfToCopyTo = this.getCFToCopyTo(target.sheetId, cf);
|
|
19590
|
+
this.adaptRules(target.sheetId, cfToCopyTo, [xc], []);
|
|
19559
19591
|
}
|
|
19560
19592
|
}
|
|
19561
19593
|
}
|
|
19562
19594
|
}
|
|
19563
19595
|
}
|
|
19596
|
+
getCFToCopyTo(targetSheetId, originCF) {
|
|
19597
|
+
const cfInTarget = this.getters
|
|
19598
|
+
.getConditionalFormats(targetSheetId)
|
|
19599
|
+
.find((cf) => cf.stopIfTrue === originCF.stopIfTrue && deepEquals(cf.rule, originCF.rule));
|
|
19600
|
+
return cfInTarget ? cfInTarget : { ...originCF, id: this.uuidGenerator.uuidv4(), ranges: [] };
|
|
19601
|
+
}
|
|
19564
19602
|
}
|
|
19565
19603
|
EvaluationConditionalFormatPlugin.getters = ["getConditionalStyle", "getConditionalIcon"];
|
|
19566
19604
|
EvaluationConditionalFormatPlugin.modes = ["normal"];
|
|
@@ -31340,6 +31378,6 @@ exports.registries = registries;
|
|
|
31340
31378
|
exports.setTranslationMethod = setTranslationMethod;
|
|
31341
31379
|
|
|
31342
31380
|
|
|
31343
|
-
__info__.version = '15.2.
|
|
31344
|
-
__info__.date = '2023-
|
|
31345
|
-
__info__.hash = '
|
|
31381
|
+
__info__.version = '15.2.10';
|
|
31382
|
+
__info__.date = '2023-09-21T15:55:12.568Z';
|
|
31383
|
+
__info__.hash = '85387c4';
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -2988,6 +2988,7 @@ declare class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
2988
2988
|
private isStale;
|
|
2989
2989
|
private computedStyles;
|
|
2990
2990
|
private computedIcons;
|
|
2991
|
+
private uuidGenerator;
|
|
2991
2992
|
handle(cmd: Command): void;
|
|
2992
2993
|
finalize(): void;
|
|
2993
2994
|
/**
|
|
@@ -3022,6 +3023,7 @@ declare class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
3022
3023
|
*/
|
|
3023
3024
|
private adaptRules;
|
|
3024
3025
|
private pasteCf;
|
|
3026
|
+
private getCFToCopyTo;
|
|
3025
3027
|
}
|
|
3026
3028
|
|
|
3027
3029
|
/**
|
|
@@ -2942,6 +2942,36 @@ function lazy(fn) {
|
|
|
2942
2942
|
};
|
|
2943
2943
|
lazyValue.map = (callback) => lazy(() => callback(lazyValue()));
|
|
2944
2944
|
return lazyValue;
|
|
2945
|
+
}
|
|
2946
|
+
/**
|
|
2947
|
+
* Compares two objects.
|
|
2948
|
+
*/
|
|
2949
|
+
function deepEquals(o1, o2) {
|
|
2950
|
+
if (o1 === o2)
|
|
2951
|
+
return true;
|
|
2952
|
+
if ((o1 && !o2) || (o2 && !o1))
|
|
2953
|
+
return false;
|
|
2954
|
+
if (typeof o1 !== typeof o2)
|
|
2955
|
+
return false;
|
|
2956
|
+
if (typeof o1 !== "object")
|
|
2957
|
+
return o1 === o2;
|
|
2958
|
+
// Objects can have different keys if the values are undefined
|
|
2959
|
+
const keys = new Set();
|
|
2960
|
+
Object.keys(o1).forEach((key) => keys.add(key));
|
|
2961
|
+
Object.keys(o2).forEach((key) => keys.add(key));
|
|
2962
|
+
for (let key of keys) {
|
|
2963
|
+
if (typeof o1[key] !== typeof o1[key])
|
|
2964
|
+
return false;
|
|
2965
|
+
if (typeof o1[key] === "object") {
|
|
2966
|
+
if (!deepEquals(o1[key], o2[key]))
|
|
2967
|
+
return false;
|
|
2968
|
+
}
|
|
2969
|
+
else {
|
|
2970
|
+
if (o1[key] !== o2[key])
|
|
2971
|
+
return false;
|
|
2972
|
+
}
|
|
2973
|
+
}
|
|
2974
|
+
return true;
|
|
2945
2975
|
}
|
|
2946
2976
|
|
|
2947
2977
|
function createDefaultCols(colNumber) {
|
|
@@ -19178,6 +19208,7 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
19178
19208
|
// stores the computed styles in the format of computedStyles.sheetName[col][row] = Style
|
|
19179
19209
|
this.computedStyles = {};
|
|
19180
19210
|
this.computedIcons = {};
|
|
19211
|
+
this.uuidGenerator = new UuidGenerator();
|
|
19181
19212
|
/**
|
|
19182
19213
|
* Execute the predicate to know if a conditional formatting rule should be applied to a cell
|
|
19183
19214
|
*/
|
|
@@ -19531,13 +19562,20 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
19531
19562
|
this.adaptRules(origin.sheetId, cf, [xc], toRemoveRange);
|
|
19532
19563
|
}
|
|
19533
19564
|
else {
|
|
19534
|
-
this.adaptRules(target.sheetId, cf, [xc], []);
|
|
19535
19565
|
this.adaptRules(origin.sheetId, cf, [], toRemoveRange);
|
|
19566
|
+
const cfToCopyTo = this.getCFToCopyTo(target.sheetId, cf);
|
|
19567
|
+
this.adaptRules(target.sheetId, cfToCopyTo, [xc], []);
|
|
19536
19568
|
}
|
|
19537
19569
|
}
|
|
19538
19570
|
}
|
|
19539
19571
|
}
|
|
19540
19572
|
}
|
|
19573
|
+
getCFToCopyTo(targetSheetId, originCF) {
|
|
19574
|
+
const cfInTarget = this.getters
|
|
19575
|
+
.getConditionalFormats(targetSheetId)
|
|
19576
|
+
.find((cf) => cf.stopIfTrue === originCF.stopIfTrue && deepEquals(cf.rule, originCF.rule));
|
|
19577
|
+
return cfInTarget ? cfInTarget : { ...originCF, id: this.uuidGenerator.uuidv4(), ranges: [] };
|
|
19578
|
+
}
|
|
19541
19579
|
}
|
|
19542
19580
|
EvaluationConditionalFormatPlugin.getters = ["getConditionalStyle", "getConditionalIcon"];
|
|
19543
19581
|
EvaluationConditionalFormatPlugin.modes = ["normal"];
|
|
@@ -31294,6 +31332,6 @@ const helpers = {
|
|
|
31294
31332
|
export { CommandResult, CorePlugin, DATETIME_FORMAT, DataSource, DispatchResult, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, DEBUG as __DEBUG__, __info__, astToFormula, cellTypes, compile, convertAstNodes, coreTypes, functionCache, helpers, invalidateEvaluationCommands, parse, readonlyAllowedCommands, registries, setTranslationMethod };
|
|
31295
31333
|
|
|
31296
31334
|
|
|
31297
|
-
__info__.version = '15.2.
|
|
31298
|
-
__info__.date = '2023-
|
|
31299
|
-
__info__.hash = '
|
|
31335
|
+
__info__.version = '15.2.10';
|
|
31336
|
+
__info__.date = '2023-09-21T15:55:12.568Z';
|
|
31337
|
+
__info__.hash = '85387c4';
|
|
@@ -2962,6 +2962,36 @@
|
|
|
2962
2962
|
};
|
|
2963
2963
|
lazyValue.map = (callback) => lazy(() => callback(lazyValue()));
|
|
2964
2964
|
return lazyValue;
|
|
2965
|
+
}
|
|
2966
|
+
/**
|
|
2967
|
+
* Compares two objects.
|
|
2968
|
+
*/
|
|
2969
|
+
function deepEquals(o1, o2) {
|
|
2970
|
+
if (o1 === o2)
|
|
2971
|
+
return true;
|
|
2972
|
+
if ((o1 && !o2) || (o2 && !o1))
|
|
2973
|
+
return false;
|
|
2974
|
+
if (typeof o1 !== typeof o2)
|
|
2975
|
+
return false;
|
|
2976
|
+
if (typeof o1 !== "object")
|
|
2977
|
+
return o1 === o2;
|
|
2978
|
+
// Objects can have different keys if the values are undefined
|
|
2979
|
+
const keys = new Set();
|
|
2980
|
+
Object.keys(o1).forEach((key) => keys.add(key));
|
|
2981
|
+
Object.keys(o2).forEach((key) => keys.add(key));
|
|
2982
|
+
for (let key of keys) {
|
|
2983
|
+
if (typeof o1[key] !== typeof o1[key])
|
|
2984
|
+
return false;
|
|
2985
|
+
if (typeof o1[key] === "object") {
|
|
2986
|
+
if (!deepEquals(o1[key], o2[key]))
|
|
2987
|
+
return false;
|
|
2988
|
+
}
|
|
2989
|
+
else {
|
|
2990
|
+
if (o1[key] !== o2[key])
|
|
2991
|
+
return false;
|
|
2992
|
+
}
|
|
2993
|
+
}
|
|
2994
|
+
return true;
|
|
2965
2995
|
}
|
|
2966
2996
|
|
|
2967
2997
|
function createDefaultCols(colNumber) {
|
|
@@ -19198,6 +19228,7 @@
|
|
|
19198
19228
|
// stores the computed styles in the format of computedStyles.sheetName[col][row] = Style
|
|
19199
19229
|
this.computedStyles = {};
|
|
19200
19230
|
this.computedIcons = {};
|
|
19231
|
+
this.uuidGenerator = new UuidGenerator();
|
|
19201
19232
|
/**
|
|
19202
19233
|
* Execute the predicate to know if a conditional formatting rule should be applied to a cell
|
|
19203
19234
|
*/
|
|
@@ -19551,13 +19582,20 @@
|
|
|
19551
19582
|
this.adaptRules(origin.sheetId, cf, [xc], toRemoveRange);
|
|
19552
19583
|
}
|
|
19553
19584
|
else {
|
|
19554
|
-
this.adaptRules(target.sheetId, cf, [xc], []);
|
|
19555
19585
|
this.adaptRules(origin.sheetId, cf, [], toRemoveRange);
|
|
19586
|
+
const cfToCopyTo = this.getCFToCopyTo(target.sheetId, cf);
|
|
19587
|
+
this.adaptRules(target.sheetId, cfToCopyTo, [xc], []);
|
|
19556
19588
|
}
|
|
19557
19589
|
}
|
|
19558
19590
|
}
|
|
19559
19591
|
}
|
|
19560
19592
|
}
|
|
19593
|
+
getCFToCopyTo(targetSheetId, originCF) {
|
|
19594
|
+
const cfInTarget = this.getters
|
|
19595
|
+
.getConditionalFormats(targetSheetId)
|
|
19596
|
+
.find((cf) => cf.stopIfTrue === originCF.stopIfTrue && deepEquals(cf.rule, originCF.rule));
|
|
19597
|
+
return cfInTarget ? cfInTarget : { ...originCF, id: this.uuidGenerator.uuidv4(), ranges: [] };
|
|
19598
|
+
}
|
|
19561
19599
|
}
|
|
19562
19600
|
EvaluationConditionalFormatPlugin.getters = ["getConditionalStyle", "getConditionalIcon"];
|
|
19563
19601
|
EvaluationConditionalFormatPlugin.modes = ["normal"];
|
|
@@ -31339,9 +31377,9 @@
|
|
|
31339
31377
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
31340
31378
|
|
|
31341
31379
|
|
|
31342
|
-
__info__.version = '15.2.
|
|
31343
|
-
__info__.date = '2023-
|
|
31344
|
-
__info__.hash = '
|
|
31380
|
+
__info__.version = '15.2.10';
|
|
31381
|
+
__info__.date = '2023-09-21T15:55:12.568Z';
|
|
31382
|
+
__info__.hash = '85387c4';
|
|
31345
31383
|
|
|
31346
31384
|
|
|
31347
31385
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|