Update CheckBox element and test file according to sdt-properties correction

This commit is contained in:
Juan D
2023-06-22 15:21:45 -04:00
parent d1f75e3a42
commit b8f83fd6ad
2 changed files with 24 additions and 5 deletions

View File

@ -13,6 +13,13 @@ describe("CheckBox", () => {
"w:sdt": [ "w:sdt": [
{ {
"w:sdtPr": [ "w:sdtPr": [
{
"w:alias": {
_attr: {
"w:val": "Checkbox",
},
},
},
{ {
"w14:checkbox": [ "w14:checkbox": [
{ {
@ -84,6 +91,13 @@ describe("CheckBox", () => {
"w:sdt": [ "w:sdt": [
{ {
"w:sdtPr": [ "w:sdtPr": [
{
"w:alias": {
_attr: {
"w:val": "Checkbox",
},
},
},
{ {
"w14:checkbox": [ "w14:checkbox": [
{ {
@ -152,6 +166,13 @@ describe("CheckBox", () => {
"w:sdt": [ "w:sdt": [
{ {
"w:sdtPr": [ "w:sdtPr": [
{
"w:alias": {
_attr: {
"w:val": "Checkbox",
},
},
},
{ {
"w14:checkbox": [ "w14:checkbox": [
{ {

View File

@ -12,11 +12,9 @@ export class CheckBox extends XmlComponent {
public constructor(options?: ICheckboxSymbolOptions) { public constructor(options?: ICheckboxSymbolOptions) {
super("w:sdt"); super("w:sdt");
this.root.push( const properties = new StructuredDocumentTagProperties("Checkbox");
new StructuredDocumentTagProperties(undefined, { properties.addChildElement(new CheckBoxUtil(options));
children: [new CheckBoxUtil(options)], this.root.push(properties);
}),
);
const content = new StructuredDocumentTagContent(); const content = new StructuredDocumentTagContent();
const checkedFont: string | undefined = options?.checkedState?.font; const checkedFont: string | undefined = options?.checkedState?.font;