x4js 1.5.34 → 1.5.36

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/lib/src/label.ts CHANGED
@@ -80,7 +80,7 @@ export class Label extends Component<LabelProps>
80
80
  this.addClass( '@hlayout' );
81
81
 
82
82
  this.setContent( [
83
- new Icon( { icon: props.icon } ),
83
+ new Icon( { id: 'l_icon', icon: props.icon } ),
84
84
  new Component( { content: text, ref: 'text' } )
85
85
  ] );
86
86
  }
@@ -124,5 +124,29 @@ export class Label extends Component<LabelProps>
124
124
  public get text( ) : string | HtmlString {
125
125
  return this.m_props.text;
126
126
  }
127
+
128
+ /**
129
+ * change the displayed icon
130
+ * @param icon - new icon
131
+ */
132
+
133
+ public set icon( icon: IconID ) {
134
+ let ico = this.itemWithRef<Icon>('l_icon');
135
+ if (ico) {
136
+ ico.icon = icon;
137
+ }
138
+ else {
139
+ this.update( 0 );
140
+ }
141
+ }
142
+
143
+ /**
144
+ *
145
+ */
146
+
147
+ public get icon( ) : IconID {
148
+ let ico = this.itemWithRef<Icon>('l_icon');
149
+ return ico?.icon;
150
+ }
127
151
  }
128
152
 
@@ -27,4 +27,4 @@
27
27
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
28
  **/
29
29
 
30
- export const x4js_version = "1.5.34";
30
+ export const x4js_version = "1.5.36";
@@ -55,4 +55,13 @@ export declare class Label extends Component<LabelProps> {
55
55
  *
56
56
  */
57
57
  get text(): string | HtmlString;
58
+ /**
59
+ * change the displayed icon
60
+ * @param icon - new icon
61
+ */
62
+ set icon(icon: IconID);
63
+ /**
64
+ *
65
+ */
66
+ get icon(): IconID;
58
67
  }
@@ -26,4 +26,4 @@
26
26
  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27
27
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
28
  **/
29
- export declare const x4js_version = "1.5.34";
29
+ export declare const x4js_version = "1.5.36";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x4js",
3
- "version": "1.5.34",
3
+ "version": "1.5.36",
4
4
  "description": "X4js core files",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",