@a3s-lab/office 0.35.0 → 0.36.0
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/README.md +27 -10
- package/dist/0~7048.js +497 -2
- package/dist/0~spreadsheet-editor.js +132 -14
- package/dist/0~work-office-diagnostics.js +1 -1
- package/dist/3266.js +189 -10
- package/dist/4121.js +257 -0
- package/dist/8715.js +299 -299
- package/dist/core.js +14 -4
- package/dist/internal/features/work/editors/spreadsheet-calculation-model.d.ts +1 -1
- package/dist/internal/features/work/editors/spreadsheet-calculation-projection.d.ts +5 -2
- package/dist/internal/features/work/editors/spreadsheet-table-calculated-columns.d.ts +42 -0
- package/dist/internal/features/work/work-types.d.ts +5 -0
- package/dist/internal/kernel/office-kernel-protocol.d.ts +1 -1
- package/dist/internal/kernel/office-kernel-spreadsheet-protocol.d.ts +18 -0
- package/dist/internal/kernel/office-kernel-spreadsheet-structured-reference.d.ts +48 -0
- package/dist/office-kernel.wasm +0 -0
- package/dist/office-kernel.worker.js +505 -2
- package/docs/latest/en/browser-editor-architecture.md +21 -8
- package/package.json +1 -1
package/dist/4121.js
CHANGED
|
@@ -2905,6 +2905,13 @@ const WORK_TEMPLATES = [
|
|
|
2905
2905
|
description: '下拉列表、输入提示与错误警告',
|
|
2906
2906
|
accent: '#13795b'
|
|
2907
2907
|
},
|
|
2908
|
+
{
|
|
2909
|
+
id: 'structured-references',
|
|
2910
|
+
kind: 'spreadsheet',
|
|
2911
|
+
name: '结构化引用',
|
|
2912
|
+
description: '表名、当前行公式与插入行自动填充',
|
|
2913
|
+
accent: '#0f7b61'
|
|
2914
|
+
},
|
|
2908
2915
|
{
|
|
2909
2916
|
id: 'blank-presentation',
|
|
2910
2917
|
kind: 'presentation',
|
|
@@ -2958,6 +2965,7 @@ function initialTitle(templateId, kind) {
|
|
|
2958
2965
|
'proofing-languages': '校对语言示例',
|
|
2959
2966
|
'quarterly-plan': '季度执行计划',
|
|
2960
2967
|
'data-validation': '数据验证示例',
|
|
2968
|
+
'structured-references': '结构化引用示例',
|
|
2961
2969
|
'strategy-deck': '业务策略汇报',
|
|
2962
2970
|
'animated-deck': '入场动画示例'
|
|
2963
2971
|
};
|
|
@@ -3257,6 +3265,10 @@ function contentForTemplate(templateId) {
|
|
|
3257
3265
|
type: 'spreadsheet',
|
|
3258
3266
|
sheets: dataValidationTemplateSheets()
|
|
3259
3267
|
};
|
|
3268
|
+
if ('structured-references' === templateId) return {
|
|
3269
|
+
type: 'spreadsheet',
|
|
3270
|
+
sheets: structuredReferenceTemplateSheets()
|
|
3271
|
+
};
|
|
3260
3272
|
if ('strategy-deck' === templateId) return strategyPresentation();
|
|
3261
3273
|
if ('animated-deck' === templateId) return animatedPresentation();
|
|
3262
3274
|
if ('blank-spreadsheet' === templateId) return {
|
|
@@ -3609,6 +3621,251 @@ function dataValidationTemplateSheets() {
|
|
|
3609
3621
|
}
|
|
3610
3622
|
];
|
|
3611
3623
|
}
|
|
3624
|
+
function structuredReferenceTemplateSheets() {
|
|
3625
|
+
const sales = emptyMatrix(16, 10);
|
|
3626
|
+
sales[0][0] = styledCell('Sales · 结构化引用', {
|
|
3627
|
+
bl: 1,
|
|
3628
|
+
fs: 16,
|
|
3629
|
+
fc: '#ffffff',
|
|
3630
|
+
bg: '#0f7b61'
|
|
3631
|
+
});
|
|
3632
|
+
sales[1][0] = styledCell('插入表格正文行会自动补齐 Revenue;已填写的手工值不会覆盖。', {
|
|
3633
|
+
fc: '#49645c',
|
|
3634
|
+
fs: 10
|
|
3635
|
+
});
|
|
3636
|
+
[
|
|
3637
|
+
'Item',
|
|
3638
|
+
'Units',
|
|
3639
|
+
'Unit price',
|
|
3640
|
+
'Revenue'
|
|
3641
|
+
].forEach((value, column)=>{
|
|
3642
|
+
sales[2][column] = headerCell(value);
|
|
3643
|
+
});
|
|
3644
|
+
const rows = [
|
|
3645
|
+
[
|
|
3646
|
+
'Landing page',
|
|
3647
|
+
12,
|
|
3648
|
+
48,
|
|
3649
|
+
'=[@Units]*[@[Unit price]]'
|
|
3650
|
+
],
|
|
3651
|
+
[
|
|
3652
|
+
'API integration',
|
|
3653
|
+
8,
|
|
3654
|
+
120,
|
|
3655
|
+
'=[@Units]*[@[Unit price]]'
|
|
3656
|
+
],
|
|
3657
|
+
[
|
|
3658
|
+
'QA review',
|
|
3659
|
+
16,
|
|
3660
|
+
36,
|
|
3661
|
+
'=[@Units]*[@[Unit price]]'
|
|
3662
|
+
],
|
|
3663
|
+
[
|
|
3664
|
+
'Release support',
|
|
3665
|
+
5,
|
|
3666
|
+
80,
|
|
3667
|
+
'=[@Units]*[@[Unit price]]'
|
|
3668
|
+
]
|
|
3669
|
+
];
|
|
3670
|
+
rows.forEach((row, rowIndex)=>{
|
|
3671
|
+
row.forEach((value, columnIndex)=>{
|
|
3672
|
+
sales[rowIndex + 3][columnIndex] = styledCell(value, {
|
|
3673
|
+
bg: rowIndex % 2 ? '#f3faf7' : '#ffffff',
|
|
3674
|
+
...columnIndex >= 1 ? {
|
|
3675
|
+
ct: {
|
|
3676
|
+
fa: 1 === columnIndex ? '0' : '#,##0.00',
|
|
3677
|
+
t: 'n'
|
|
3678
|
+
}
|
|
3679
|
+
} : {}
|
|
3680
|
+
});
|
|
3681
|
+
});
|
|
3682
|
+
});
|
|
3683
|
+
sales[7][0] = styledCell('Total', {
|
|
3684
|
+
bl: 1,
|
|
3685
|
+
fc: '#215446',
|
|
3686
|
+
bg: '#dff3ec'
|
|
3687
|
+
});
|
|
3688
|
+
sales[7][1] = styledCell('=SUM(Sales[Units])', {
|
|
3689
|
+
bl: 1,
|
|
3690
|
+
fc: '#215446',
|
|
3691
|
+
bg: '#dff3ec',
|
|
3692
|
+
ct: {
|
|
3693
|
+
fa: '0',
|
|
3694
|
+
t: 'n'
|
|
3695
|
+
}
|
|
3696
|
+
});
|
|
3697
|
+
sales[7][3] = styledCell('=SUM(Sales[Revenue])', {
|
|
3698
|
+
bl: 1,
|
|
3699
|
+
fc: '#215446',
|
|
3700
|
+
bg: '#dff3ec',
|
|
3701
|
+
ct: {
|
|
3702
|
+
fa: '#,##0.00',
|
|
3703
|
+
t: 'n'
|
|
3704
|
+
}
|
|
3705
|
+
});
|
|
3706
|
+
sales[9][0] = styledCell('Reference examples', {
|
|
3707
|
+
bl: 1,
|
|
3708
|
+
fc: '#215446'
|
|
3709
|
+
});
|
|
3710
|
+
sales[10][0] = styledCell('Headers count');
|
|
3711
|
+
sales[10][1] = styledCell('=COUNTA(Sales[#Headers])', {
|
|
3712
|
+
ct: {
|
|
3713
|
+
fa: '0',
|
|
3714
|
+
t: 'n'
|
|
3715
|
+
}
|
|
3716
|
+
});
|
|
3717
|
+
sales[11][0] = styledCell('Data revenue');
|
|
3718
|
+
sales[11][1] = styledCell('=SUM(Sales[Revenue])', {
|
|
3719
|
+
ct: {
|
|
3720
|
+
fa: '#,##0.00',
|
|
3721
|
+
t: 'n'
|
|
3722
|
+
}
|
|
3723
|
+
});
|
|
3724
|
+
sales[12][0] = styledCell('Units + prices');
|
|
3725
|
+
sales[12][1] = styledCell('=SUM(Sales[[Units]:[Unit price]])', {
|
|
3726
|
+
ct: {
|
|
3727
|
+
fa: '#,##0.00',
|
|
3728
|
+
t: 'n'
|
|
3729
|
+
}
|
|
3730
|
+
});
|
|
3731
|
+
sales[13][0] = styledCell('All table cells');
|
|
3732
|
+
sales[13][1] = styledCell('=COUNTA(Sales[#All])', {
|
|
3733
|
+
ct: {
|
|
3734
|
+
fa: '0',
|
|
3735
|
+
t: 'n'
|
|
3736
|
+
}
|
|
3737
|
+
});
|
|
3738
|
+
const table = {
|
|
3739
|
+
id: createWorkId('spreadsheet-table'),
|
|
3740
|
+
name: 'Sales',
|
|
3741
|
+
displayName: 'SalesData',
|
|
3742
|
+
range: {
|
|
3743
|
+
row: [
|
|
3744
|
+
2,
|
|
3745
|
+
7
|
|
3746
|
+
],
|
|
3747
|
+
column: [
|
|
3748
|
+
0,
|
|
3749
|
+
3
|
|
3750
|
+
]
|
|
3751
|
+
},
|
|
3752
|
+
columns: [
|
|
3753
|
+
{
|
|
3754
|
+
name: 'Item'
|
|
3755
|
+
},
|
|
3756
|
+
{
|
|
3757
|
+
name: 'Units'
|
|
3758
|
+
},
|
|
3759
|
+
{
|
|
3760
|
+
name: 'Unit price'
|
|
3761
|
+
},
|
|
3762
|
+
{
|
|
3763
|
+
name: 'Revenue',
|
|
3764
|
+
calculatedFormula: '=[@Units]*[@[Unit price]]'
|
|
3765
|
+
}
|
|
3766
|
+
],
|
|
3767
|
+
filters: [],
|
|
3768
|
+
headerRow: true,
|
|
3769
|
+
totalsRow: true,
|
|
3770
|
+
style: {
|
|
3771
|
+
family: 'medium',
|
|
3772
|
+
number: 4
|
|
3773
|
+
},
|
|
3774
|
+
showFirstColumn: false,
|
|
3775
|
+
showLastColumn: false,
|
|
3776
|
+
showRowStripes: true,
|
|
3777
|
+
showColumnStripes: false
|
|
3778
|
+
};
|
|
3779
|
+
const salesSheet = {
|
|
3780
|
+
id: createWorkId('sheet'),
|
|
3781
|
+
name: 'Sales',
|
|
3782
|
+
status: 1,
|
|
3783
|
+
order: 0,
|
|
3784
|
+
row: 16,
|
|
3785
|
+
column: 10,
|
|
3786
|
+
data: sales,
|
|
3787
|
+
tables: [
|
|
3788
|
+
table
|
|
3789
|
+
],
|
|
3790
|
+
config: {
|
|
3791
|
+
columnlen: {
|
|
3792
|
+
0: 172,
|
|
3793
|
+
1: 76,
|
|
3794
|
+
2: 102,
|
|
3795
|
+
3: 112
|
|
3796
|
+
},
|
|
3797
|
+
rowlen: {
|
|
3798
|
+
0: 32,
|
|
3799
|
+
1: 24,
|
|
3800
|
+
2: 28,
|
|
3801
|
+
7: 28
|
|
3802
|
+
},
|
|
3803
|
+
merge: {
|
|
3804
|
+
'0_0': {
|
|
3805
|
+
r: 0,
|
|
3806
|
+
c: 0,
|
|
3807
|
+
rs: 1,
|
|
3808
|
+
cs: 4
|
|
3809
|
+
}
|
|
3810
|
+
}
|
|
3811
|
+
}
|
|
3812
|
+
};
|
|
3813
|
+
const summary = emptyMatrix(10, 4);
|
|
3814
|
+
summary[0][0] = styledCell('Summary · qualified references', {
|
|
3815
|
+
bl: 1,
|
|
3816
|
+
fs: 16,
|
|
3817
|
+
fc: '#ffffff',
|
|
3818
|
+
bg: '#215446'
|
|
3819
|
+
});
|
|
3820
|
+
summary[2][0] = styledCell('Revenue from Sales table');
|
|
3821
|
+
summary[2][1] = styledCell('=SUM(Sales!Sales[Revenue])', {
|
|
3822
|
+
ct: {
|
|
3823
|
+
fa: '#,##0.00',
|
|
3824
|
+
t: 'n'
|
|
3825
|
+
}
|
|
3826
|
+
});
|
|
3827
|
+
summary[3][0] = styledCell('Headers from Sales table');
|
|
3828
|
+
summary[3][1] = styledCell('=COUNTA(Sales!Sales[#Headers])', {
|
|
3829
|
+
ct: {
|
|
3830
|
+
fa: '0',
|
|
3831
|
+
t: 'n'
|
|
3832
|
+
}
|
|
3833
|
+
});
|
|
3834
|
+
summary[5][0] = styledCell('Sales!Sales[...] demonstrates a worksheet-qualified table reference.', {
|
|
3835
|
+
fc: '#49645c',
|
|
3836
|
+
fs: 10
|
|
3837
|
+
});
|
|
3838
|
+
return [
|
|
3839
|
+
salesSheet,
|
|
3840
|
+
{
|
|
3841
|
+
id: createWorkId('sheet'),
|
|
3842
|
+
name: 'Summary',
|
|
3843
|
+
status: 0,
|
|
3844
|
+
order: 1,
|
|
3845
|
+
row: 10,
|
|
3846
|
+
column: 4,
|
|
3847
|
+
data: summary,
|
|
3848
|
+
config: {
|
|
3849
|
+
columnlen: {
|
|
3850
|
+
0: 240,
|
|
3851
|
+
1: 120
|
|
3852
|
+
},
|
|
3853
|
+
rowlen: {
|
|
3854
|
+
0: 32,
|
|
3855
|
+
5: 28
|
|
3856
|
+
},
|
|
3857
|
+
merge: {
|
|
3858
|
+
'0_0': {
|
|
3859
|
+
r: 0,
|
|
3860
|
+
c: 0,
|
|
3861
|
+
rs: 1,
|
|
3862
|
+
cs: 2
|
|
3863
|
+
}
|
|
3864
|
+
}
|
|
3865
|
+
}
|
|
3866
|
+
}
|
|
3867
|
+
];
|
|
3868
|
+
}
|
|
3612
3869
|
function dataValidationTemplateItem(overrides) {
|
|
3613
3870
|
return {
|
|
3614
3871
|
type: 'dropdown',
|