gd-bs 5.3.9 → 5.4.2

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/src/bs.scss CHANGED
@@ -218,8 +218,13 @@
218
218
  background-color: #0078d4;
219
219
  border-color: #0078d4;
220
220
  }
221
+ /* Color match form elements */
222
+ .form-control {
223
+ border-color: #6c757d;
224
+ }
221
225
  /* Color match disabled form elements */
222
226
  .form-control:disabled, .form-control[readonly] {
227
+ border-color: #eaeaea;
223
228
  color: #a6a6a6;
224
229
  }
225
230
  /* Bootstrap Icon: Custom - caret-up-fill + caret-down-fill */
@@ -59,6 +59,9 @@ class _Carousel extends Base<ICarouselProps> implements ICarousel {
59
59
  this.nextWhenVisible(options.slide);
60
60
  }
61
61
  }
62
+
63
+ // Call the event if it exists
64
+ this.props.onRendered ? this.props.onRendered(this.el, this.props) : null;
62
65
  }
63
66
 
64
67
  // Configures the events
@@ -73,12 +76,12 @@ class _Carousel extends Base<ICarouselProps> implements ICarousel {
73
76
  // Add a keydown event
74
77
  el.addEventListener("keydown", (ev) => {
75
78
  // See if the left arrow was pressed
76
- if (ev.keyCode == 37) {
79
+ if (ev.code == "37") {
77
80
  // Move to the previous slide
78
81
  this.previous();
79
82
  }
80
83
  // Else, see if the right arrow was pressed
81
- else if (ev.keyCode == 39) {
84
+ else if (ev.code == "39") {
82
85
  // Move tot he next slide
83
86
  this.next();
84
87
  }
@@ -220,6 +223,9 @@ class _Carousel extends Base<ICarouselProps> implements ICarousel {
220
223
 
221
224
  // Create the item element
222
225
  slides.appendChild(slide.el);
226
+
227
+ // Call the event
228
+ this.props.onSlideRendered ? this.props.onSlideRendered(slide.el, items[i]) : null;
223
229
  }
224
230
  }
225
231
  }
@@ -48,6 +48,9 @@ export class CarouselItem {
48
48
  // Append the content
49
49
  appendContent(this._el, this._props.content);
50
50
  }
51
+
52
+ // Call the event if it exists
53
+ this._props.onRendered ? this._props.onRendered(this._el, this._props) : null;
51
54
  }
52
55
 
53
56
  /**
@@ -124,6 +124,7 @@ export interface ICarouselItem<T = Element> {
124
124
  imageAlt?: string;
125
125
  imageUrl?: string;
126
126
  isActive?: boolean;
127
+ onRendered?: (el?: HTMLElement, props?: ICarouselItem) => void;
127
128
  }
128
129
 
129
130
  /**
@@ -147,5 +148,7 @@ export interface ICarouselProps<T = Element> extends IBaseProps<ICarousel> {
147
148
  id?: string;
148
149
  isDark?: boolean;
149
150
  items?: Array<ICarouselItem<T>>;
151
+ onRendered?: (el?: HTMLElement, props?: ICarouselProps) => void;
152
+ onSlideRendered?: (el?: HTMLElement, props?: ICarouselItem) => void;
150
153
  options?: ICarouselOptions;
151
154
  }
@@ -195,7 +195,7 @@ class _Modal extends Base<IModalProps> implements IModal {
195
195
  // Add a click event
196
196
  (this.el as HTMLElement).addEventListener("keydown", ev => {
197
197
  // See if the escape key was clicked and the modal is visible
198
- if (ev.keyCode === 27 && this.isVisible) {
198
+ if (ev.code === "27" && this.isVisible) {
199
199
  // Toggle the modal
200
200
  this.toggle();
201
201
  }
@@ -95,7 +95,7 @@ class _Navbar extends Base<INavbarProps> implements INavbar {
95
95
  // Set a keydown event to catch the "Enter" key being pressed
96
96
  searchbox.addEventListener("keydown", ev => {
97
97
  // See if the "Enter" key was pressed
98
- if (ev.keyCode == 13) {
98
+ if (ev.code == "13") {
99
99
  // Disable the postback
100
100
  ev.preventDefault();
101
101
 
@@ -144,7 +144,7 @@ class _Offcanvas extends Base<IOffcanvasProps> implements IOffcanvas {
144
144
  // Add a click event
145
145
  (this.el as HTMLElement).addEventListener("keydown", ev => {
146
146
  // See if the escape key was clicked and the modal is visible
147
- if (ev.keyCode === 27 && this.isVisible) {
147
+ if (ev.code === "27" && this.isVisible) {
148
148
  // Toggle the modal
149
149
  this.toggle();
150
150
  }