gd-bs 5.4.1 → 5.4.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/.github/workflows/build.yml +4 -1
- package/build/bs.js +1 -1
- package/build/components/carousel/index.js +6 -2
- package/build/components/carousel/item.js +2 -0
- package/build/components/dropdown/item.js +3 -2
- package/build/components/modal/index.js +1 -1
- package/build/components/navbar/index.js +1 -1
- package/build/components/offcanvas/index.js +1 -1
- package/dist/gd-bs-icons.js +184 -184
- package/dist/gd-bs-icons.min.js +1 -1
- package/dist/gd-bs.d.ts +3 -0
- package/dist/gd-bs.js +179 -179
- package/dist/gd-bs.min.js +1 -1
- package/package.json +6 -6
- package/pnpm-lock.yaml +462 -1619
- package/src/bs.scss +38 -6
- package/src/components/carousel/index.ts +8 -2
- package/src/components/carousel/item.ts +3 -0
- package/src/components/carousel/types.d.ts +3 -0
- package/src/components/dropdown/item.ts +3 -2
- package/src/components/modal/index.ts +1 -1
- package/src/components/navbar/index.ts +1 -1
- package/src/components/offcanvas/index.ts +1 -1
|
@@ -65,6 +65,8 @@ var _Carousel = /** @class */ (function (_super) {
|
|
|
65
65
|
this.nextWhenVisible(options.slide);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
+
// Call the event if it exists
|
|
69
|
+
this.props.onRendered ? this.props.onRendered(this.el, this.props) : null;
|
|
68
70
|
};
|
|
69
71
|
// Configures the events
|
|
70
72
|
_Carousel.prototype.configureEvents = function () {
|
|
@@ -78,12 +80,12 @@ var _Carousel = /** @class */ (function (_super) {
|
|
|
78
80
|
// Add a keydown event
|
|
79
81
|
el.addEventListener("keydown", function (ev) {
|
|
80
82
|
// See if the left arrow was pressed
|
|
81
|
-
if (ev.
|
|
83
|
+
if (ev.code == "37") {
|
|
82
84
|
// Move to the previous slide
|
|
83
85
|
_this.previous();
|
|
84
86
|
}
|
|
85
87
|
// Else, see if the right arrow was pressed
|
|
86
|
-
else if (ev.
|
|
88
|
+
else if (ev.code == "39") {
|
|
87
89
|
// Move tot he next slide
|
|
88
90
|
_this.next();
|
|
89
91
|
}
|
|
@@ -213,6 +215,8 @@ var _Carousel = /** @class */ (function (_super) {
|
|
|
213
215
|
this._slides.push(slide);
|
|
214
216
|
// Create the item element
|
|
215
217
|
slides.appendChild(slide.el);
|
|
218
|
+
// Call the event
|
|
219
|
+
this.props.onSlideRendered ? this.props.onSlideRendered(slide.el, items[i]) : null;
|
|
216
220
|
}
|
|
217
221
|
}
|
|
218
222
|
};
|
|
@@ -43,6 +43,8 @@ var CarouselItem = /** @class */ (function () {
|
|
|
43
43
|
// Append the content
|
|
44
44
|
common_1.appendContent(this._el, this._props.content);
|
|
45
45
|
}
|
|
46
|
+
// Call the event if it exists
|
|
47
|
+
this._props.onRendered ? this._props.onRendered(this._el, this._props) : null;
|
|
46
48
|
};
|
|
47
49
|
Object.defineProperty(CarouselItem.prototype, "el", {
|
|
48
50
|
/**
|
|
@@ -115,8 +115,9 @@ var DropdownItem = /** @class */ (function () {
|
|
|
115
115
|
this._el.addEventListener("click", function (ev) {
|
|
116
116
|
// Prevent the page from moving to the top
|
|
117
117
|
ev.preventDefault();
|
|
118
|
-
// See if we are selecting items
|
|
119
|
-
|
|
118
|
+
// See if we are automatically selecting items
|
|
119
|
+
var autoSelect = typeof (_this._parent.autoSelect) === "boolean" ? _this._parent.autoSelect : true;
|
|
120
|
+
if (autoSelect) {
|
|
120
121
|
// Toggle the item
|
|
121
122
|
_this.toggle();
|
|
122
123
|
}
|
|
@@ -199,7 +199,7 @@ var _Modal = /** @class */ (function (_super) {
|
|
|
199
199
|
// Add a click event
|
|
200
200
|
this.el.addEventListener("keydown", function (ev) {
|
|
201
201
|
// See if the escape key was clicked and the modal is visible
|
|
202
|
-
if (ev.
|
|
202
|
+
if (ev.code === "27" && _this.isVisible) {
|
|
203
203
|
// Toggle the modal
|
|
204
204
|
_this.toggle();
|
|
205
205
|
}
|
|
@@ -98,7 +98,7 @@ var _Navbar = /** @class */ (function (_super) {
|
|
|
98
98
|
// Set a keydown event to catch the "Enter" key being pressed
|
|
99
99
|
searchbox.addEventListener("keydown", function (ev) {
|
|
100
100
|
// See if the "Enter" key was pressed
|
|
101
|
-
if (ev.
|
|
101
|
+
if (ev.code == "13") {
|
|
102
102
|
// Disable the postback
|
|
103
103
|
ev.preventDefault();
|
|
104
104
|
// See if there is a search event
|
|
@@ -157,7 +157,7 @@ var _Offcanvas = /** @class */ (function (_super) {
|
|
|
157
157
|
// Add a click event
|
|
158
158
|
this.el.addEventListener("keydown", function (ev) {
|
|
159
159
|
// See if the escape key was clicked and the modal is visible
|
|
160
|
-
if (ev.
|
|
160
|
+
if (ev.code === "27" && _this.isVisible) {
|
|
161
161
|
// Toggle the modal
|
|
162
162
|
_this.toggle();
|
|
163
163
|
}
|