gd-bs 6.5.4 → 6.5.6

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.
@@ -74,6 +74,11 @@ var _Card = /** @class */ (function (_super) {
74
74
  _this.props.onClick(body.props);
75
75
  });
76
76
  }
77
+ // See if there is a render event
78
+ if (this.props.onRender) {
79
+ // Call the event
80
+ this.props.onRender(this.el, body.props);
81
+ }
77
82
  };
78
83
  // Configure the header
79
84
  _Card.prototype.configureHeader = function () {
@@ -37,12 +37,43 @@ var _CardGroup = /** @class */ (function (_super) {
37
37
  }
38
38
  // Configure the card group
39
39
  _CardGroup.prototype.configure = function (cardTemplate) {
40
- // Parse the cards
41
40
  var cards = this.props.cards || [];
41
+ var isGrid = false;
42
+ // See if we are rendering columns
43
+ if (typeof (this.props.colSize) === "number") {
44
+ // Update the flag
45
+ isGrid = true;
46
+ // Update the class name
47
+ this.el.classList.remove("card-group");
48
+ this.el.classList.add("row");
49
+ // Determine the column class to use
50
+ var colSize = this.props.colSize > 0 && this.props.colSize <= 12 ? this.props.colSize : 4;
51
+ this.el.classList.add("row-cols-" + colSize);
52
+ }
53
+ // Parse the cards
42
54
  for (var i = 0; i < cards.length; i++) {
43
- // Add the card
44
- this.el.appendChild((0, card_1.Card)(cards[i], cardTemplate).el);
55
+ // Create the card
56
+ var card = (0, card_1.Card)(cards[i], cardTemplate);
57
+ // See if we are using a grid
58
+ if (isGrid) {
59
+ // Create a column element
60
+ var elCol = document.createElement("div");
61
+ elCol.classList.add("col");
62
+ elCol.appendChild(card.el);
63
+ // Add the card
64
+ this.el.appendChild(elCol);
65
+ // Call the event
66
+ this.props.onColRender ? this.props.onColRender(elCol, cards[i]) : null;
67
+ }
68
+ else {
69
+ // Add the card
70
+ this.el.appendChild(card.el);
71
+ // Call the event
72
+ this.props.onCardRender ? this.props.onCardRender(card.el, cards[i]) : null;
73
+ }
45
74
  }
75
+ // Call the event
76
+ this.props.onRender ? this.props.onRender(this.el, this.props) : null;
46
77
  };
47
78
  return _CardGroup;
48
79
  }(base_1.Base));