gd-bs 5.7.6 → 5.7.9

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.
@@ -49,19 +49,12 @@ var _CheckboxGroup = /** @class */ (function (_super) {
49
49
  }
50
50
  // Configure the card group
51
51
  _CheckboxGroup.prototype.configure = function (cbTemplate) {
52
- var colSize = this.props.colSize > 0 && this.props.colSize < 13 ? this.props.colSize : (this.props.label ? 10 : 12);
53
52
  var renderRow = typeof (this.props.renderRow) === "boolean" ? this.props.renderRow : true;
54
- // See if we are not rendering a row
55
- if (!renderRow) {
56
- // Remove the row class
57
- this.el.classList.remove("row");
58
- }
59
53
  // See if a label is defined
60
54
  var label = this.el.querySelector("legend");
61
55
  if (label) {
62
56
  if (this.props.label && this.props.hideLabel != true) {
63
57
  // Add the label
64
- renderRow ? label.classList.add("col-" + (12 - colSize)) : null;
65
58
  label.innerHTML = this.props.label;
66
59
  }
67
60
  else {
@@ -72,11 +65,7 @@ var _CheckboxGroup = /** @class */ (function (_super) {
72
65
  // Get the group and configure the size
73
66
  var group = this.el.querySelector("div");
74
67
  if (group) {
75
- if (renderRow) {
76
- // Set the class
77
- group.classList.add("col-" + colSize);
78
- }
79
- else {
68
+ if (!renderRow) {
80
69
  // Remove the group element
81
70
  this.el.removeChild(group);
82
71
  }
@@ -36,6 +36,9 @@ var CheckboxItem = /** @class */ (function () {
36
36
  // Default the title property for the checkbox
37
37
  this._elCheckbox.title = this.props.label || this._parent.title || "";
38
38
  }
39
+ // Set the column size
40
+ var colSize = this._parent.colSize > 0 && this._parent.colSize < 13 ? this._parent.colSize : 12;
41
+ this._el.classList.add("col-" + colSize);
39
42
  // See if the title property is defined
40
43
  if (this._parent.title) {
41
44
  // Set the title
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HTMLSwitch = exports.HTMLRadio = exports.HTMLCheckbox = exports.HTML = void 0;
4
4
  // Checkbox
5
- exports.HTML = "\n<div class=\"row\">\n <legend class=\"col-form-label\"></legend>\n <div></div>\n</div>".trim();
5
+ exports.HTML = "\n<div>\n <legend class=\"col-form-label\"></legend>\n <div class=\"row\"></div>\n</div>".trim();
6
6
  // Checkbox
7
7
  exports.HTMLCheckbox = "\n<div class=\"form-check\">\n <input type=\"checkbox\" class=\"form-check-input\" />\n <label class=\"form-check-label\"></label>\n</div>".trim();
8
8
  // Radio
@@ -111,6 +111,7 @@ var FormControl = /** @class */ (function () {
111
111
  isReadonly: this._props.isReadonly,
112
112
  items: cbProps.items,
113
113
  onChange: cbProps.onChange,
114
+ renderRow: cbProps.renderRow,
114
115
  title: this._props.title,
115
116
  type: checkboxGroup_1.CheckboxGroupTypes.Checkbox,
116
117
  value: this._props.value
@@ -217,6 +218,7 @@ var FormControl = /** @class */ (function () {
217
218
  items: cbMultiProps.items,
218
219
  multi: true,
219
220
  onChange: cbMultiProps.onChange,
221
+ renderRow: cbMultiProps.renderRow,
220
222
  title: this._props.title,
221
223
  type: checkboxGroup_1.CheckboxGroupTypes.Checkbox,
222
224
  value: this._props.value
@@ -263,6 +265,7 @@ var FormControl = /** @class */ (function () {
263
265
  items: this._props.items,
264
266
  multi: true,
265
267
  onChange: this._props.onChange,
268
+ renderRow: this._props.renderRow,
266
269
  title: this._props.title,
267
270
  type: checkboxGroup_1.CheckboxGroupTypes.Radio,
268
271
  value: this._props.value
@@ -280,6 +283,7 @@ var FormControl = /** @class */ (function () {
280
283
  items: this._props.items,
281
284
  multi: true,
282
285
  onChange: this._props.onChange,
286
+ renderRow: this._props.renderRow,
283
287
  title: this._props.title,
284
288
  type: checkboxGroup_1.CheckboxGroupTypes.Switch,
285
289
  value: this._props.value
@@ -311,6 +315,7 @@ var FormControl = /** @class */ (function () {
311
315
  isReadonly: this._props.isReadonly,
312
316
  items: this._props.items,
313
317
  onChange: this._props.onChange,
318
+ renderRow: this._props.renderRow,
314
319
  title: this._props.title,
315
320
  type: checkboxGroup_1.CheckboxGroupTypes.Radio,
316
321
  value: this._props.value
@@ -359,6 +364,7 @@ var FormControl = /** @class */ (function () {
359
364
  isReadonly: this._props.isReadonly,
360
365
  items: this._props.items,
361
366
  onChange: this._props.onChange,
367
+ renderRow: this._props.renderRow,
362
368
  title: this._props.title,
363
369
  type: checkboxGroup_1.CheckboxGroupTypes.Switch,
364
370
  value: this._props.value
@@ -15,11 +15,42 @@ var __extends = (this && this.__extends) || (function () {
15
15
  };
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.Offcanvas = exports.OffcanvasClassNames = exports.OffcanvasTypes = void 0;
18
+ exports.Offcanvas = exports.OffcanvasTypesClassNames = exports.OffcanvasTypes = exports.OffcanvasSizeClassNames = exports.OffcanvasSize = void 0;
19
19
  var classNames_1 = require("../classNames");
20
20
  var base_1 = require("../base");
21
21
  var common_1 = require("../common");
22
22
  var templates_1 = require("./templates");
23
+ /**
24
+ * Offcanvas Size
25
+ */
26
+ var OffcanvasSize;
27
+ (function (OffcanvasSize) {
28
+ OffcanvasSize[OffcanvasSize["Small1"] = 1] = "Small1";
29
+ OffcanvasSize[OffcanvasSize["Small2"] = 2] = "Small2";
30
+ OffcanvasSize[OffcanvasSize["Small3"] = 3] = "Small3";
31
+ OffcanvasSize[OffcanvasSize["Medium1"] = 4] = "Medium1";
32
+ OffcanvasSize[OffcanvasSize["Medium2"] = 5] = "Medium2";
33
+ OffcanvasSize[OffcanvasSize["Medium3"] = 6] = "Medium3";
34
+ OffcanvasSize[OffcanvasSize["Large1"] = 7] = "Large1";
35
+ OffcanvasSize[OffcanvasSize["Large2"] = 8] = "Large2";
36
+ OffcanvasSize[OffcanvasSize["Large3"] = 9] = "Large3";
37
+ OffcanvasSize[OffcanvasSize["Full"] = 10] = "Full";
38
+ })(OffcanvasSize = exports.OffcanvasSize || (exports.OffcanvasSize = {}));
39
+ /**
40
+ * Offcanvas Size Classes
41
+ */
42
+ exports.OffcanvasSizeClassNames = new classNames_1.ClassNames([
43
+ "offcanvas-size-sm1",
44
+ "offcanvas-size-sm2",
45
+ "offcanvas-size-sm3",
46
+ "offcanvas-size-md1",
47
+ "offcanvas-size-md2",
48
+ "offcanvas-size-md3",
49
+ "offcanvas-size-lg1",
50
+ "offcanvas-size-lg2",
51
+ "offcanvas-size-lg3",
52
+ "offcanvas-size-full"
53
+ ]);
23
54
  /**
24
55
  * Offcanvas Types
25
56
  */
@@ -28,14 +59,16 @@ var OffcanvasTypes;
28
59
  OffcanvasTypes[OffcanvasTypes["Bottom"] = 1] = "Bottom";
29
60
  OffcanvasTypes[OffcanvasTypes["End"] = 2] = "End";
30
61
  OffcanvasTypes[OffcanvasTypes["Start"] = 3] = "Start";
62
+ OffcanvasTypes[OffcanvasTypes["Top"] = 4] = "Top";
31
63
  })(OffcanvasTypes = exports.OffcanvasTypes || (exports.OffcanvasTypes = {}));
32
64
  /**
33
- * Offcanvas Classes
65
+ * Offcanvas Types Classes
34
66
  */
35
- exports.OffcanvasClassNames = new classNames_1.ClassNames([
67
+ exports.OffcanvasTypesClassNames = new classNames_1.ClassNames([
36
68
  "offcanvas-bottom",
37
69
  "offcanvas-end",
38
- "offcanvas-start"
70
+ "offcanvas-start",
71
+ "offcanvas-top"
39
72
  ]);
40
73
  /**
41
74
  * Offcanvas
@@ -61,7 +94,8 @@ var _Offcanvas = /** @class */ (function (_super) {
61
94
  _Offcanvas.prototype.configure = function () {
62
95
  // Set the attributes
63
96
  this.props.id ? this.el.id = this.props.id : null;
64
- // Set the type
97
+ // Set the size & type
98
+ this.setSize(this.props.size);
65
99
  this.setType(this.props.type);
66
100
  // Get the options
67
101
  var options = this.props.options || {
@@ -187,16 +221,30 @@ var _Offcanvas = /** @class */ (function (_super) {
187
221
  // Configure the event if we are setting the value
188
222
  this._autoClose ? this.configureAutoCloseEvent() : null;
189
223
  };
224
+ // Sets the offcanvas size
225
+ _Offcanvas.prototype.setSize = function (offcanvasSize) {
226
+ var _this = this;
227
+ // Parse the class names
228
+ exports.OffcanvasSizeClassNames.parse(function (className) {
229
+ // Remove the class names
230
+ _this.el.classList.remove(className);
231
+ });
232
+ // Set the class name
233
+ var className = exports.OffcanvasSizeClassNames.getByType(offcanvasSize);
234
+ if (className) {
235
+ this.el.classList.add(className);
236
+ }
237
+ };
190
238
  // Sets the offcanvas type
191
239
  _Offcanvas.prototype.setType = function (offcanvasType) {
192
240
  var _this = this;
193
241
  // Parse the class names
194
- exports.OffcanvasClassNames.parse(function (className) {
242
+ exports.OffcanvasTypesClassNames.parse(function (className) {
195
243
  // Remove the class names
196
244
  _this.el.classList.remove(className);
197
245
  });
198
246
  // Set the class name
199
- var className = exports.OffcanvasClassNames.getByType(offcanvasType) || exports.OffcanvasClassNames.getByType(OffcanvasTypes.End);
247
+ var className = exports.OffcanvasTypesClassNames.getByType(offcanvasType) || exports.OffcanvasTypesClassNames.getByType(OffcanvasTypes.End);
200
248
  this.el.classList.add(className);
201
249
  };
202
250
  // Shows the modal