@univerjs/sheets-numfmt 0.10.12-nightly.202510221114 → 0.10.12-nightly.202510251119
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/lib/cjs/facade.js +1 -1
- package/lib/es/facade.js +27 -22
- package/lib/facade.js +27 -22
- package/lib/umd/facade.js +1 -1
- package/package.json +4 -4
package/lib/cjs/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const c=require("@univerjs/sheets-numfmt"),u=require("@univerjs/sheets/facade");class l extends u.FRange{setNumberFormat(o){const t=[],{startColumn:e,startRow:n,endColumn:r,endRow:i}=this._range;for(let m=n;m<=i;m++)for(let s=e;s<=r;s++)t.push({row:m,col:s,pattern:o});return this._commandService.syncExecuteCommand(c.SetNumfmtCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),values:t}),this}setNumberFormats(o){var m;const t=[],{startColumn:e,startRow:n,endColumn:r,endRow:i}=this._range;for(let s=n;s<=i;s++)for(let a=e;a<=r;a++){const h=(m=o[s-n])==null?void 0:m[a-e];t.push({row:s,col:a,pattern:h})}return this._commandService.syncExecuteCommand(c.SetNumfmtCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),values:t}),this}getNumberFormat(){var t,e;const o=this.getCellStyle();return(e=(t=o==null?void 0:o.numberFormat)==null?void 0:t.pattern)!=null?e:""}getNumberFormats(){return this.getCellStyles().map(t=>t.map(e=>{var n,r;return(r=(n=e==null?void 0:e.numberFormat)==null?void 0:n.pattern)!=null?r:""}))}}u.FRange.extend(l);class C extends u.FWorkbook{setNumfmtLocal(o){return this._injector.get(c.SheetsNumfmtCellContentController).setNumfmtLocal(o),this}}u.FWorkbook.extend(C);
|
package/lib/es/facade.js
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import { SetNumfmtCommand as
|
|
2
|
-
import { FRange as
|
|
3
|
-
class
|
|
4
|
-
setNumberFormat(
|
|
5
|
-
const t = [];
|
|
6
|
-
|
|
1
|
+
import { SetNumfmtCommand as i, SheetsNumfmtCellContentController as C } from "@univerjs/sheets-numfmt";
|
|
2
|
+
import { FRange as d, FWorkbook as h } from "@univerjs/sheets/facade";
|
|
3
|
+
class g extends d {
|
|
4
|
+
setNumberFormat(o) {
|
|
5
|
+
const t = [], { startColumn: e, startRow: s, endColumn: r, endRow: u } = this._range;
|
|
6
|
+
for (let m = s; m <= u; m++)
|
|
7
|
+
for (let n = e; n <= r; n++)
|
|
8
|
+
t.push({ row: m, col: n, pattern: o });
|
|
9
|
+
return this._commandService.syncExecuteCommand(i.id, {
|
|
7
10
|
unitId: this._workbook.getUnitId(),
|
|
8
11
|
subUnitId: this._worksheet.getSheetId(),
|
|
9
12
|
values: t
|
|
10
13
|
}), this;
|
|
11
14
|
}
|
|
12
|
-
setNumberFormats(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
setNumberFormats(o) {
|
|
16
|
+
var m;
|
|
17
|
+
const t = [], { startColumn: e, startRow: s, endColumn: r, endRow: u } = this._range;
|
|
18
|
+
for (let n = s; n <= u; n++)
|
|
19
|
+
for (let a = e; a <= r; a++) {
|
|
20
|
+
const c = (m = o[n - s]) == null ? void 0 : m[a - e];
|
|
21
|
+
t.push({ row: n, col: a, pattern: c });
|
|
22
|
+
}
|
|
23
|
+
return this._commandService.syncExecuteCommand(i.id, {
|
|
19
24
|
unitId: this._workbook.getUnitId(),
|
|
20
25
|
subUnitId: this._worksheet.getSheetId(),
|
|
21
26
|
values: t
|
|
@@ -23,20 +28,20 @@ class d extends a {
|
|
|
23
28
|
}
|
|
24
29
|
getNumberFormat() {
|
|
25
30
|
var t, e;
|
|
26
|
-
const
|
|
27
|
-
return (e = (t =
|
|
31
|
+
const o = this.getCellStyle();
|
|
32
|
+
return (e = (t = o == null ? void 0 : o.numberFormat) == null ? void 0 : t.pattern) != null ? e : "";
|
|
28
33
|
}
|
|
29
34
|
getNumberFormats() {
|
|
30
35
|
return this.getCellStyles().map((t) => t.map((e) => {
|
|
31
|
-
var
|
|
32
|
-
return (
|
|
36
|
+
var s, r;
|
|
37
|
+
return (r = (s = e == null ? void 0 : e.numberFormat) == null ? void 0 : s.pattern) != null ? r : "";
|
|
33
38
|
}));
|
|
34
39
|
}
|
|
35
40
|
}
|
|
36
|
-
|
|
37
|
-
class
|
|
38
|
-
setNumfmtLocal(
|
|
39
|
-
return this._injector.get(
|
|
41
|
+
d.extend(g);
|
|
42
|
+
class b extends h {
|
|
43
|
+
setNumfmtLocal(o) {
|
|
44
|
+
return this._injector.get(C).setNumfmtLocal(o), this;
|
|
40
45
|
}
|
|
41
46
|
}
|
|
42
|
-
|
|
47
|
+
h.extend(b);
|
package/lib/facade.js
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import { SetNumfmtCommand as
|
|
2
|
-
import { FRange as
|
|
3
|
-
class
|
|
4
|
-
setNumberFormat(
|
|
5
|
-
const t = [];
|
|
6
|
-
|
|
1
|
+
import { SetNumfmtCommand as i, SheetsNumfmtCellContentController as C } from "@univerjs/sheets-numfmt";
|
|
2
|
+
import { FRange as d, FWorkbook as h } from "@univerjs/sheets/facade";
|
|
3
|
+
class g extends d {
|
|
4
|
+
setNumberFormat(o) {
|
|
5
|
+
const t = [], { startColumn: e, startRow: s, endColumn: r, endRow: u } = this._range;
|
|
6
|
+
for (let m = s; m <= u; m++)
|
|
7
|
+
for (let n = e; n <= r; n++)
|
|
8
|
+
t.push({ row: m, col: n, pattern: o });
|
|
9
|
+
return this._commandService.syncExecuteCommand(i.id, {
|
|
7
10
|
unitId: this._workbook.getUnitId(),
|
|
8
11
|
subUnitId: this._worksheet.getSheetId(),
|
|
9
12
|
values: t
|
|
10
13
|
}), this;
|
|
11
14
|
}
|
|
12
|
-
setNumberFormats(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
setNumberFormats(o) {
|
|
16
|
+
var m;
|
|
17
|
+
const t = [], { startColumn: e, startRow: s, endColumn: r, endRow: u } = this._range;
|
|
18
|
+
for (let n = s; n <= u; n++)
|
|
19
|
+
for (let a = e; a <= r; a++) {
|
|
20
|
+
const c = (m = o[n - s]) == null ? void 0 : m[a - e];
|
|
21
|
+
t.push({ row: n, col: a, pattern: c });
|
|
22
|
+
}
|
|
23
|
+
return this._commandService.syncExecuteCommand(i.id, {
|
|
19
24
|
unitId: this._workbook.getUnitId(),
|
|
20
25
|
subUnitId: this._worksheet.getSheetId(),
|
|
21
26
|
values: t
|
|
@@ -23,20 +28,20 @@ class d extends a {
|
|
|
23
28
|
}
|
|
24
29
|
getNumberFormat() {
|
|
25
30
|
var t, e;
|
|
26
|
-
const
|
|
27
|
-
return (e = (t =
|
|
31
|
+
const o = this.getCellStyle();
|
|
32
|
+
return (e = (t = o == null ? void 0 : o.numberFormat) == null ? void 0 : t.pattern) != null ? e : "";
|
|
28
33
|
}
|
|
29
34
|
getNumberFormats() {
|
|
30
35
|
return this.getCellStyles().map((t) => t.map((e) => {
|
|
31
|
-
var
|
|
32
|
-
return (
|
|
36
|
+
var s, r;
|
|
37
|
+
return (r = (s = e == null ? void 0 : e.numberFormat) == null ? void 0 : s.pattern) != null ? r : "";
|
|
33
38
|
}));
|
|
34
39
|
}
|
|
35
40
|
}
|
|
36
|
-
|
|
37
|
-
class
|
|
38
|
-
setNumfmtLocal(
|
|
39
|
-
return this._injector.get(
|
|
41
|
+
d.extend(g);
|
|
42
|
+
class b extends h {
|
|
43
|
+
setNumfmtLocal(o) {
|
|
44
|
+
return this._injector.get(C).setNumfmtLocal(o), this;
|
|
40
45
|
}
|
|
41
46
|
}
|
|
42
|
-
|
|
47
|
+
h.extend(b);
|
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(s,o){typeof exports=="object"&&typeof module<"u"?o(require("@univerjs/sheets-numfmt"),require("@univerjs/sheets/facade")):typeof define=="function"&&define.amd?define(["@univerjs/sheets-numfmt","@univerjs/sheets/facade"],o):(s=typeof globalThis<"u"?globalThis:s||self,o(s.UniverSheetsNumfmt,s.UniverSheetsFacade))})(this,(function(s,o){"use strict";class
|
|
1
|
+
(function(s,o){typeof exports=="object"&&typeof module<"u"?o(require("@univerjs/sheets-numfmt"),require("@univerjs/sheets/facade")):typeof define=="function"&&define.amd?define(["@univerjs/sheets-numfmt","@univerjs/sheets/facade"],o):(s=typeof globalThis<"u"?globalThis:s||self,o(s.UniverSheetsNumfmt,s.UniverSheetsFacade))})(this,(function(s,o){"use strict";class h extends o.FRange{setNumberFormat(n){const e=[],{startColumn:t,startRow:m,endColumn:u,endRow:a}=this._range;for(let i=m;i<=a;i++)for(let r=t;r<=u;r++)e.push({row:i,col:r,pattern:n});return this._commandService.syncExecuteCommand(s.SetNumfmtCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),values:e}),this}setNumberFormats(n){var i;const e=[],{startColumn:t,startRow:m,endColumn:u,endRow:a}=this._range;for(let r=m;r<=a;r++)for(let d=t;d<=u;d++){const f=(i=n[r-m])==null?void 0:i[d-t];e.push({row:r,col:d,pattern:f})}return this._commandService.syncExecuteCommand(s.SetNumfmtCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),values:e}),this}getNumberFormat(){var e,t;const n=this.getCellStyle();return(t=(e=n==null?void 0:n.numberFormat)==null?void 0:e.pattern)!=null?t:""}getNumberFormats(){return this.getCellStyles().map(e=>e.map(t=>{var m,u;return(u=(m=t==null?void 0:t.numberFormat)==null?void 0:m.pattern)!=null?u:""}))}}o.FRange.extend(h);class c extends o.FWorkbook{setNumfmtLocal(n){return this._injector.get(s.SheetsNumfmtCellContentController).setNumfmtLocal(n),this}}o.FWorkbook.extend(c)}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/sheets-numfmt",
|
|
3
|
-
"version": "0.10.12-nightly.
|
|
3
|
+
"version": "0.10.12-nightly.202510251119",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "UniverSheet numfmt plugin",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"rxjs": ">=7.0.0"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@univerjs/core": "0.10.12-nightly.
|
|
62
|
-
"@univerjs/engine-formula": "0.10.12-nightly.
|
|
63
|
-
"@univerjs/sheets": "0.10.12-nightly.
|
|
61
|
+
"@univerjs/core": "0.10.12-nightly.202510251119",
|
|
62
|
+
"@univerjs/engine-formula": "0.10.12-nightly.202510251119",
|
|
63
|
+
"@univerjs/sheets": "0.10.12-nightly.202510251119"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"rxjs": "^7.8.2",
|