gd-bs 6.8.7 → 6.8.8

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.
@@ -44,15 +44,19 @@ class _Tooltip extends Base<ITooltipProps> {
44
44
 
45
45
  // Configure the collapse
46
46
  this.configure();
47
-
48
- // Configure the parent
49
- this.configureParent();
50
47
  }
51
48
 
52
49
  // Configure the tooltip
53
50
  private configure() {
54
- // See if the target element was not defined
55
- if (this.props.target == null) {
51
+ // See if the target element was defined
52
+ if (this.props.target) {
53
+ // Update the element
54
+ this.el = this.props.target
55
+
56
+ // Configure the options
57
+ this.configureOptions();
58
+ }
59
+ else {
56
60
  // See if the dropdown property exists
57
61
  if (this.props.ddlProps) {
58
62
  // Set the default properties
@@ -81,10 +85,13 @@ class _Tooltip extends Base<ITooltipProps> {
81
85
  // Update the element
82
86
  this.el = this._btn.el;
83
87
  }
84
- }
85
88
 
86
- // Configure the options
87
- this.configureOptions();
89
+ // Configure the options
90
+ this.configureOptions();
91
+
92
+ // Configure the parent
93
+ this.configureParent();
94
+ }
88
95
  }
89
96
 
90
97
  // Configure the options
@@ -139,68 +146,68 @@ class _Tooltip extends Base<ITooltipProps> {
139
146
  default:
140
147
  // Set the default theme
141
148
  theme = "secondary";
142
-
143
- // See if a button/dropdown exists
144
- let objType = this.props.btnProps && this.props.btnProps.type > 0 ? this.props.btnProps.type : null;
145
- objType = this.props.ddlProps && this.props.ddlProps.type > 0 ? this.props.ddlProps.type : objType;
146
- if (objType > 0) {
147
- // Match the theme to the button/dropdown type
148
- switch (objType) {
149
- // Danger
150
- case ButtonTypes.Danger:
151
- case ButtonTypes.OutlineDanger:
152
- theme = "danger";
153
- break;
154
- // Dark
155
- case ButtonTypes.Dark:
156
- case ButtonTypes.OutlineDark:
157
- theme = "dark";
158
- break;
159
- // Info
160
- case ButtonTypes.Info:
161
- case ButtonTypes.OutlineInfo:
162
- theme = "info";
163
- break;
164
- // Light
165
- case ButtonTypes.Light:
166
- case ButtonTypes.OutlineLight:
167
- theme = "light";
168
- break;
169
- // Link
170
- case ButtonTypes.Link:
171
- case ButtonTypes.OutlineLink:
172
- theme = "light-border";
173
- break;
174
- // Primary
175
- case ButtonTypes.Primary:
176
- case ButtonTypes.OutlinePrimary:
177
- theme = "primary";
178
- break;
179
- // Secondary
180
- case ButtonTypes.Secondary:
181
- case ButtonTypes.OutlineSecondary:
182
- theme = "secondary";
183
- break;
184
- // Success
185
- case ButtonTypes.Success:
186
- case ButtonTypes.OutlineSuccess:
187
- theme = "success";
188
- break;
189
- // Warning
190
- case ButtonTypes.Warning:
191
- case ButtonTypes.OutlineWarning:
192
- theme = "warning";
193
- break;
194
- }
195
- }
196
149
  break;
197
150
  }
198
151
 
152
+ // See if a button/dropdown exists
153
+ let objType = this.props.btnProps && this.props.btnProps.type > 0 ? this.props.btnProps.type : null;
154
+ objType = this.props.ddlProps && this.props.ddlProps.type > 0 ? this.props.ddlProps.type : objType;
155
+ if (objType > 0) {
156
+ // Match the theme to the button/dropdown type
157
+ switch (objType) {
158
+ // Danger
159
+ case ButtonTypes.Danger:
160
+ case ButtonTypes.OutlineDanger:
161
+ theme = "danger";
162
+ break;
163
+ // Dark
164
+ case ButtonTypes.Dark:
165
+ case ButtonTypes.OutlineDark:
166
+ theme = "dark";
167
+ break;
168
+ // Info
169
+ case ButtonTypes.Info:
170
+ case ButtonTypes.OutlineInfo:
171
+ theme = "info";
172
+ break;
173
+ // Light
174
+ case ButtonTypes.Light:
175
+ case ButtonTypes.OutlineLight:
176
+ theme = "light";
177
+ break;
178
+ // Link
179
+ case ButtonTypes.Link:
180
+ case ButtonTypes.OutlineLink:
181
+ theme = "light-border";
182
+ break;
183
+ // Primary
184
+ case ButtonTypes.Primary:
185
+ case ButtonTypes.OutlinePrimary:
186
+ theme = "primary";
187
+ break;
188
+ // Secondary
189
+ case ButtonTypes.Secondary:
190
+ case ButtonTypes.OutlineSecondary:
191
+ theme = "secondary";
192
+ break;
193
+ // Success
194
+ case ButtonTypes.Success:
195
+ case ButtonTypes.OutlineSuccess:
196
+ theme = "success";
197
+ break;
198
+ // Warning
199
+ case ButtonTypes.Warning:
200
+ case ButtonTypes.OutlineWarning:
201
+ theme = "warning";
202
+ break;
203
+ }
204
+ }
205
+
199
206
  // Set the tooltip content element
200
207
  if (typeof (this.props.content) === "string") {
201
208
  this._elContent = document.createElement("div") as HTMLElement;
202
209
  this._elContent.innerHTML = this.props.content;
203
- } else if(this.props.content) {
210
+ } else if (this.props.content) {
204
211
  this._elContent = this.props.content as any;
205
212
  } else {
206
213
  this._elContent = document.createElement("div");
@@ -209,30 +216,6 @@ class _Tooltip extends Base<ITooltipProps> {
209
216
  // Set the padding
210
217
  this._elContent.classList.add("p-2");
211
218
 
212
- // Set the on create event
213
- /*
214
- options["onCreate"] = (tippyObj) => {
215
- // Get the content element
216
- let elContent = tippyObj.popper.querySelector(".tippy-content") as HTMLElement;
217
- if (elContent) {
218
- // Set the class
219
- elContent.classList.add("bs");
220
-
221
- // Get the custom class name(s)
222
- let custom = (this.props.className || "").trim().split(" ");
223
- for (let i = 0; i < custom.length; i++) {
224
- let className = custom[i];
225
-
226
- // Add the custom class name
227
- className ? elContent.classList.add(custom[i]) : null;
228
- }
229
- }
230
-
231
- // Call the custom event if it's defined
232
- this.props.options && this.props.options.onCreate ? this.props.options.onCreate(tippyObj) : null;
233
- }
234
- */
235
-
236
219
  // Create the floating ui
237
220
  this._floatingUI = FloatingUI({
238
221
  className: "floating-tooltip",