Skip to content
This repository was archived by the owner on Feb 15, 2024. It is now read-only.

Commit ee002a5

Browse files
committed
fix(ui): add tooltip for text and icon objects
1 parent faa4bfe commit ee002a5

22 files changed

+10873
-10670
lines changed

dist/amd/aurelia-openui5-bridge.d.ts

Lines changed: 485 additions & 481 deletions
Large diffs are not rendered by default.

dist/amd/icon/icon.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ define(['exports', 'aurelia-templating', 'aurelia-dependency-injection', '../com
7373
throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.');
7474
}
7575

76-
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _dec19, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _descriptor16;
76+
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _dec19, _dec20, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _descriptor16, _descriptor17;
7777

78-
var Ui5Icon = exports.Ui5Icon = (_dec = (0, _aureliaTemplating.customElement)('ui5-icon'), _dec2 = (0, _aureliaDependencyInjection.inject)(Element), _dec3 = (0, _aureliaTemplating.bindable)(), _dec4 = (0, _aureliaTemplating.bindable)(), _dec5 = (0, _aureliaTemplating.bindable)(), _dec6 = (0, _aureliaTemplating.bindable)(), _dec7 = (0, _aureliaTemplating.bindable)(), _dec8 = (0, _aureliaTemplating.bindable)(), _dec9 = (0, _aureliaTemplating.bindable)(), _dec10 = (0, _aureliaTemplating.bindable)(), _dec11 = (0, _aureliaTemplating.bindable)(), _dec12 = (0, _aureliaTemplating.bindable)(), _dec13 = (0, _aureliaTemplating.bindable)(), _dec14 = (0, _aureliaTemplating.bindable)(), _dec15 = (0, _aureliaTemplating.bindable)(), _dec16 = (0, _aureliaTemplating.bindable)(), _dec17 = (0, _aureliaTemplating.bindable)(), _dec18 = (0, _aureliaTemplating.bindable)(), _dec19 = (0, _aureliaFramework.computedFrom)('_icon'), _dec(_class = _dec2(_class = (_class2 = function () {
78+
var Ui5Icon = exports.Ui5Icon = (_dec = (0, _aureliaTemplating.customElement)('ui5-icon'), _dec2 = (0, _aureliaDependencyInjection.inject)(Element), _dec3 = (0, _aureliaTemplating.bindable)(), _dec4 = (0, _aureliaTemplating.bindable)(), _dec5 = (0, _aureliaTemplating.bindable)(), _dec6 = (0, _aureliaTemplating.bindable)(), _dec7 = (0, _aureliaTemplating.bindable)(), _dec8 = (0, _aureliaTemplating.bindable)(), _dec9 = (0, _aureliaTemplating.bindable)(), _dec10 = (0, _aureliaTemplating.bindable)(), _dec11 = (0, _aureliaTemplating.bindable)(), _dec12 = (0, _aureliaTemplating.bindable)(), _dec13 = (0, _aureliaTemplating.bindable)(), _dec14 = (0, _aureliaTemplating.bindable)(), _dec15 = (0, _aureliaTemplating.bindable)(), _dec16 = (0, _aureliaTemplating.bindable)(), _dec17 = (0, _aureliaTemplating.bindable)(), _dec18 = (0, _aureliaTemplating.bindable)(), _dec19 = (0, _aureliaTemplating.bindable)(), _dec20 = (0, _aureliaFramework.computedFrom)('_icon'), _dec(_class = _dec2(_class = (_class2 = function () {
7979
Ui5Icon.prototype.defaultFunc = function defaultFunc() {};
8080

8181
function Ui5Icon(element) {
@@ -115,6 +115,8 @@ define(['exports', 'aurelia-templating', 'aurelia-dependency-injection', '../com
115115

116116
_initDefineProp(this, 'press', _descriptor16, this);
117117

118+
_initDefineProp(this, 'tooltip', _descriptor17, this);
119+
118120
this.element = element;
119121
}
120122

@@ -133,7 +135,8 @@ define(['exports', 'aurelia-templating', 'aurelia-dependency-injection', '../com
133135
useIconTooltip: (0, _attributes.getBooleanFromAttributeValue)(this.useIconTooltip),
134136
alt: this.alt,
135137
noTabStop: (0, _attributes.getBooleanFromAttributeValue)(this.noTabStop),
136-
press: this.press
138+
press: this.press,
139+
tooltip: this.tooltip
137140
};
138141
if (this.ui5Id) this._icon = new sap.ui.core.Icon(this.ui5Id, props);else this._icon = new sap.ui.core.Icon(props);
139142
$(this.element).closest("[ui5-container]")[0].au.controller.viewModel.addChild(this._icon, this.element);
@@ -223,6 +226,12 @@ define(['exports', 'aurelia-templating', 'aurelia-dependency-injection', '../com
223226
}
224227
};
225228

229+
Ui5Icon.prototype.tooltipChanged = function tooltipChanged(newValue) {
230+
if (this._icon !== null) {
231+
this._icon.setTooltip(newValue);
232+
}
233+
};
234+
226235
_createClass(Ui5Icon, [{
227236
key: 'UIElement',
228237
get: function get() {
@@ -311,5 +320,10 @@ define(['exports', 'aurelia-templating', 'aurelia-dependency-injection', '../com
311320
initializer: function initializer() {
312321
return this.defaultFunc;
313322
}
314-
}), _applyDecoratedDescriptor(_class2.prototype, 'UIElement', [_dec19], Object.getOwnPropertyDescriptor(_class2.prototype, 'UIElement'), _class2.prototype)), _class2)) || _class) || _class);
323+
}), _descriptor17 = _applyDecoratedDescriptor(_class2.prototype, 'tooltip', [_dec19], {
324+
enumerable: true,
325+
initializer: function initializer() {
326+
return null;
327+
}
328+
}), _applyDecoratedDescriptor(_class2.prototype, 'UIElement', [_dec20], Object.getOwnPropertyDescriptor(_class2.prototype, 'UIElement'), _class2.prototype)), _class2)) || _class) || _class);
315329
});

dist/amd/text/text.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ define(['exports', 'aurelia-templating', 'aurelia-dependency-injection', '../com
7373
throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.');
7474
}
7575

76-
var _dec, _dec2, _dec3, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5;
76+
var _dec, _dec2, _dec3, _dec4, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6;
7777

78-
var Ui5Text = exports.Ui5Text = (_dec = (0, _aureliaTemplating.customElement)('ui5-text'), _dec2 = (0, _aureliaDependencyInjection.inject)(Element), _dec3 = (0, _aureliaFramework.computedFrom)('_text'), _dec(_class = _dec2(_class = (_class2 = function () {
78+
var Ui5Text = exports.Ui5Text = (_dec = (0, _aureliaTemplating.customElement)('ui5-text'), _dec2 = (0, _aureliaDependencyInjection.inject)(Element), _dec3 = (0, _aureliaTemplating.bindable)(), _dec4 = (0, _aureliaFramework.computedFrom)('_text'), _dec(_class = _dec2(_class = (_class2 = function () {
7979
function Ui5Text(element) {
8080
_classCallCheck(this, Ui5Text);
8181

@@ -93,6 +93,8 @@ define(['exports', 'aurelia-templating', 'aurelia-dependency-injection', '../com
9393

9494
_initDefineProp(this, 'maxLines', _descriptor5, this);
9595

96+
_initDefineProp(this, 'tooltip', _descriptor6, this);
97+
9698
this.element = element;
9799
}
98100

@@ -101,7 +103,8 @@ define(['exports', 'aurelia-templating', 'aurelia-dependency-injection', '../com
101103
text: this.text != null ? this.text : this.element.innerText.trim(),
102104
wrapping: (0, _attributes.getBooleanFromAttributeValue)(this.wrapping),
103105
textAlign: this.textAlign,
104-
maxLines: this.maxLines
106+
maxLines: this.maxLines,
107+
tooltip: this.tooltip
105108
};
106109
if (this.ui5Id) this._text = new sap.m.Text(this.ui5Id, props);else this._text = new sap.m.Text(props);
107110
this._parent = $(this.element).closest("[ui5-container]")[0].au.controller.viewModel;
@@ -120,6 +123,12 @@ define(['exports', 'aurelia-templating', 'aurelia-dependency-injection', '../com
120123
}
121124
};
122125

126+
Ui5Text.prototype.tooltipChanged = function tooltipChanged(newValue) {
127+
if (this._text !== null) {
128+
this._text.setTooltip(newValue);
129+
}
130+
};
131+
123132
_createClass(Ui5Text, [{
124133
key: 'UIElement',
125134
get: function get() {
@@ -153,5 +162,10 @@ define(['exports', 'aurelia-templating', 'aurelia-dependency-injection', '../com
153162
initializer: function initializer() {
154163
return null;
155164
}
156-
}), _applyDecoratedDescriptor(_class2.prototype, 'UIElement', [_dec3], Object.getOwnPropertyDescriptor(_class2.prototype, 'UIElement'), _class2.prototype)), _class2)) || _class) || _class);
165+
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, 'tooltip', [_dec3], {
166+
enumerable: true,
167+
initializer: function initializer() {
168+
return null;
169+
}
170+
}), _applyDecoratedDescriptor(_class2.prototype, 'UIElement', [_dec4], Object.getOwnPropertyDescriptor(_class2.prototype, 'UIElement'), _class2.prototype)), _class2)) || _class) || _class);
157171
});

0 commit comments

Comments
 (0)