gd-bs 6.5.2 → 6.5.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gd-bs",
3
- "version": "6.5.2",
3
+ "version": "6.5.4",
4
4
  "description": "Bootstrap JavaScript, TypeScript and Web Components library.",
5
5
  "main": "build/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -37,7 +37,7 @@ export class CardBody {
37
37
  // Update the title
38
38
  let elTitle = this._el.querySelector(".card-title") as HTMLElement;
39
39
  if (this._props.title || this._props.onRenderTitle) {
40
- // Append the content
40
+ // Append the title
41
41
  appendContent(elTitle, this._props.title);
42
42
 
43
43
  // Call the render event
@@ -50,25 +50,34 @@ export class CardBody {
50
50
  // Update the sub-title
51
51
  let subTitle = this._el.querySelector(".card-subtitle");
52
52
  if (this._props.subTitle) {
53
- // Set the title
53
+ // Set the sub-title
54
54
  subTitle.innerHTML = this._props.subTitle;
55
55
  } else {
56
- // Remove the title
56
+ // Remove the sub-title
57
57
  this._el.removeChild(subTitle);
58
58
  }
59
59
 
60
60
  // Update the text
61
61
  let text = this._el.querySelector(".card-text");
62
62
  if (this._props.text) {
63
- // Set the title
63
+ // Set the text
64
64
  text.innerHTML = this._props.text;
65
- } else {
66
- // Remove the title
65
+ }
66
+ // Else, see if there is content
67
+ else if (this._props.content && typeof (this._props.content) === "string") {
68
+ // Set the text
69
+ text.innerHTML = this._props.content;
70
+ }
71
+ else {
72
+ // Remove the text
67
73
  this._el.removeChild(text);
68
74
  }
69
75
 
70
- // Append the content
71
- appendContent(this._el, this._props.content);
76
+ // See if the content is an element
77
+ if (this._props.content && typeof (this._props.content) !== "string") {
78
+ // Append the content
79
+ appendContent(this._el, this._props.content);
80
+ }
72
81
 
73
82
  // Render the actions
74
83
  this.renderActions();
@@ -182,6 +182,8 @@ class _Pagination extends Base<IPaginationProps> implements IPagination {
182
182
 
183
183
  // Create the previous link
184
184
  let item = this.createItem("Previous", itemTemplate);
185
+ item.classList.add("disabled");
186
+ item.classList.add("previous");
185
187
  list.appendChild(item);
186
188
 
187
189
  // Loop for the number of pages to create
@@ -196,6 +198,8 @@ class _Pagination extends Base<IPaginationProps> implements IPagination {
196
198
 
197
199
  // Create the next link
198
200
  item = this.createItem("Next", itemTemplate);
201
+ pages > 1 ? null : item.classList.add("disabled");
202
+ item.classList.add("next");
199
203
  list.appendChild(item);
200
204
  }
201
205
  }