@shival99/z-ui 1.3.26 → 1.3.27

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.
@@ -61,7 +61,7 @@ class ZTableActionsComponent {
61
61
  states[action.key] = {
62
62
  visible: !isHidden,
63
63
  disabled: isDisabled,
64
- tooltip: action.tooltip ?? '',
64
+ tooltipState: this._getTooltipState(action.tooltip),
65
65
  };
66
66
  }
67
67
  return states;
@@ -81,6 +81,22 @@ class ZTableActionsComponent {
81
81
  };
82
82
  });
83
83
  }, ...(ngDevMode ? [{ debugName: "dropdownItems" }] : []));
84
+ _getTooltipState(tooltip) {
85
+ if (!tooltip) {
86
+ return { content: '', alwaysShow: false };
87
+ }
88
+ if (typeof tooltip === 'string') {
89
+ return { content: tooltip, alwaysShow: true };
90
+ }
91
+ return {
92
+ content: tooltip.content ?? '',
93
+ alwaysShow: tooltip.alwaysShow ?? true,
94
+ position: tooltip.position,
95
+ arrow: tooltip.arrow,
96
+ offset: tooltip.offset,
97
+ maxWidth: tooltip.maxWidth,
98
+ };
99
+ }
84
100
  _onActionClick(action, event) {
85
101
  event.stopPropagation();
86
102
  const states = this.actionStates();
@@ -117,7 +133,11 @@ class ZTableActionsComponent {
117
133
  [zSize]="action.size ?? 'sm'"
118
134
  [zDisabled]="actionStates()[action.key]?.disabled ?? false"
119
135
  [class]="action.class ?? ''"
120
- [zContent]="actionStates()[action.key]?.tooltip ?? ''"
136
+ [zContent]="actionStates()[action.key]?.tooltipState?.content ?? ''"
137
+ [zAlwaysShow]="actionStates()[action.key]?.tooltipState?.alwaysShow ?? false"
138
+ [zArrow]="actionStates()[action.key]?.tooltipState?.arrow ?? true"
139
+ [zOffset]="actionStates()[action.key]?.tooltipState?.offset ?? 8"
140
+ [zMaxWidth]="actionStates()[action.key]?.tooltipState?.maxWidth ?? '250px'"
121
141
  (click)="_onActionClick(action, $event)"
122
142
  >
123
143
  @if (action.icon && action.label) {
@@ -169,7 +189,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
169
189
  [zSize]="action.size ?? 'sm'"
170
190
  [zDisabled]="actionStates()[action.key]?.disabled ?? false"
171
191
  [class]="action.class ?? ''"
172
- [zContent]="actionStates()[action.key]?.tooltip ?? ''"
192
+ [zContent]="actionStates()[action.key]?.tooltipState?.content ?? ''"
193
+ [zAlwaysShow]="actionStates()[action.key]?.tooltipState?.alwaysShow ?? false"
194
+ [zArrow]="actionStates()[action.key]?.tooltipState?.arrow ?? true"
195
+ [zOffset]="actionStates()[action.key]?.tooltipState?.offset ?? 8"
196
+ [zMaxWidth]="actionStates()[action.key]?.tooltipState?.maxWidth ?? '250px'"
173
197
  (click)="_onActionClick(action, $event)"
174
198
  >
175
199
  @if (action.icon && action.label) {