inviton-powerduck 0.0.176 → 0.0.178

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.
@@ -1,3 +1,4 @@
1
+ import { Tooltip } from 'bootstrap';
1
2
  import { Prop, toNative } from 'vue-facing-decorator';
2
3
  import TsxComponent, { Component } from '../../app/vuetsx';
3
4
  import { isNullOrEmpty } from '../../common/utils/is-null-or-empty';
@@ -12,6 +13,7 @@ export interface DropdownButtonItemArgs {
12
13
  clicked?: () => void;
13
14
  isSelected?: boolean;
14
15
  emptySpace?: boolean;
16
+ tooltip?: string;
15
17
  }
16
18
 
17
19
  export interface ImageObj {
@@ -31,12 +33,23 @@ class DropdownButtonItemComponent extends TsxComponent<DropdownButtonItemArgs> i
31
33
  @Prop() isSelected!: boolean;
32
34
  @Prop() clicked?: () => void;
33
35
  @Prop() emptySpace!: boolean;
36
+ @Prop() tooltip!: string;
37
+
38
+ mounted() {
39
+ if (!isNullOrEmpty(this.tooltip)) {
40
+ new Tooltip(this.$el);
41
+ }
42
+ }
34
43
 
35
44
  raiseClickEvent() {
36
45
  if (this.disabled == true) {
37
46
  return;
38
47
  }
39
48
 
49
+ if (!isNullOrEmpty(this.tooltip)) {
50
+ $('body > .tooltip').first().remove();
51
+ }
52
+
40
53
  if (this.clicked != null) {
41
54
  this.clicked();
42
55
  }
@@ -58,14 +71,13 @@ class DropdownButtonItemComponent extends TsxComponent<DropdownButtonItemArgs> i
58
71
  return null;
59
72
  }
60
73
 
61
- // <a href="javascript:" class="dropdown-item dropdown-selectable-section"><span>Tabulka</span><i class="fas fa-check"></i></a>
62
-
63
74
  render(h) {
64
75
  return (
65
76
  <a
66
77
  class={`dropdown-item${this.isSelected ? ' dropdown-selectable-section' : ''}${this.disabled == true ? ' disabled ' : ''}`}
67
78
  href={this.getHref()}
68
79
  target={this.getHrefTarget()}
80
+ title={this.tooltip}
69
81
  onClick={() => this.raiseClickEvent()}
70
82
  >
71
83
  {!isNullOrEmpty(this.icon) && (
@@ -1,3 +1,4 @@
1
+ import type { VNode } from 'vue';
1
2
  import type { ModalOnBeforeShownArgs, ModalOnShownArgs } from './modal-utils';
2
3
  import { Modal as BootstrapModal } from 'bootstrap';
3
4
  import { Prop, toNative } from 'vue-facing-decorator';
@@ -60,6 +61,7 @@ declare global {
60
61
  export class ModalConfig {
61
62
  static defaultPortalTarget = 'body';
62
63
  static defaultMobileMode = ModalMobileMode.BottomSheetModal;
64
+ static renderModalHeaderIcon: (icon: ModalHeaderIcon) => VNode = null;
63
65
  }
64
66
 
65
67
  @Component
@@ -281,6 +283,7 @@ class ModalComponent extends TsxComponent<ModalArgs> implements ModalArgs {
281
283
  </div>
282
284
 
283
285
  <LoadingIndicator visible={this.blocked} />
286
+
284
287
  <div class={`modal-header${this.icon == null ? '' : ' modal-has-headericon'}`}>
285
288
  {this.icon != null && <div class="modal-header-icon">{this.renderModalHeaderIcon()}</div>}
286
289
 
@@ -300,6 +303,10 @@ class ModalComponent extends TsxComponent<ModalArgs> implements ModalArgs {
300
303
  }
301
304
 
302
305
  renderModalHeaderIcon() {
306
+ if (ModalConfig.renderModalHeaderIcon != null) {
307
+ return ModalConfig.renderModalHeaderIcon(this.icon);
308
+ }
309
+
303
310
  if (this.icon == ModalHeaderIcon.Warning) {
304
311
  return <ModalIconWarning visible={true} />;
305
312
  } else if (this.icon == ModalHeaderIcon.Success) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "inviton-powerduck",
3
3
  "type": "module",
4
- "version": "0.0.176",
4
+ "version": "0.0.178",
5
5
  "files": [
6
6
  "app/",
7
7
  "common/",