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/cjs/index.js +2 -2
- package/lib/cjs/index.js.map +3 -3
- package/lib/esm/index.mjs +21 -2
- package/lib/esm/index.mjs.map +2 -2
- package/lib/src/label.ts +25 -1
- package/lib/src/version.ts +1 -1
- package/lib/types/label.d.ts +9 -0
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
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
|
|
package/lib/src/version.ts
CHANGED
package/lib/types/label.d.ts
CHANGED
package/lib/types/version.d.ts
CHANGED