x4js 2.0.25 → 2.0.28
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/x4.css +1 -1
- package/lib/cjs/x4.js +2 -2
- package/lib/esm/x4.css +1 -1
- package/lib/esm/x4.mjs +2 -2
- package/lib/styles/x4.css +1 -1
- package/lib/types/x4js.d.ts +29 -4
- package/package.json +1 -1
- package/src/components/components.ts +1 -0
- package/src/components/gauge/gauge.module.scss +40 -0
- package/src/components/gauge/gauge.ts +153 -0
- package/src/components/gridview/gridview.ts +2 -2
- package/src/components/input/input.ts +9 -2
- package/src/components/keyboard/keyboard.module.scss +4 -2
- package/src/components/keyboard/keyboard.ts +10 -8
- package/src/components/listbox/listbox.ts +2 -3
- package/src/components/propgrid/propgrid.ts +12 -2
- package/src/components/spreadsheet/spreadsheet.module.scss +308 -0
- package/src/components/spreadsheet/spreadsheet.ts +1176 -0
- package/src/core/core_svg.ts +39 -4
package/src/core/core_svg.ts
CHANGED
|
@@ -149,11 +149,17 @@ class SvgItem {
|
|
|
149
149
|
*/
|
|
150
150
|
|
|
151
151
|
getAttr( name: string ) : string {
|
|
152
|
-
|
|
152
|
+
const a = this._dom.getAttribute( name ) || '';
|
|
153
|
+
return a;
|
|
153
154
|
}
|
|
154
155
|
|
|
155
156
|
getNumAttr( name: string ) {
|
|
156
|
-
|
|
157
|
+
const a = this._dom.getAttribute( name )
|
|
158
|
+
if( a=='' ) {
|
|
159
|
+
return 0;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return parseInt( a );
|
|
157
163
|
}
|
|
158
164
|
|
|
159
165
|
/**
|
|
@@ -164,7 +170,12 @@ class SvgItem {
|
|
|
164
170
|
*/
|
|
165
171
|
|
|
166
172
|
setAttr( name: string, value: string ) : this {
|
|
167
|
-
|
|
173
|
+
if( value===null || value===undefined ) {
|
|
174
|
+
this._dom.removeAttribute( name );
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
this._dom.setAttribute( name, value );
|
|
178
|
+
}
|
|
168
179
|
return this;
|
|
169
180
|
}
|
|
170
181
|
|
|
@@ -238,12 +249,18 @@ class SvgItem {
|
|
|
238
249
|
return this;
|
|
239
250
|
}
|
|
240
251
|
|
|
252
|
+
|
|
241
253
|
/**
|
|
242
254
|
*
|
|
243
255
|
*/
|
|
244
256
|
|
|
245
257
|
transform( tr: string ): this {
|
|
246
|
-
|
|
258
|
+
this.setAttr( "transform", tr );
|
|
259
|
+
return this;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
add_transformation( tr: string ): this {
|
|
263
|
+
const t = this.getAttr( "transform" );
|
|
247
264
|
this.setAttr( "transform", t+' '+tr );
|
|
248
265
|
return this;
|
|
249
266
|
}
|
|
@@ -262,16 +279,32 @@ class SvgItem {
|
|
|
262
279
|
return this;
|
|
263
280
|
}
|
|
264
281
|
|
|
282
|
+
add_rotation( deg: number, cx: number, cy: number ): this {
|
|
283
|
+
this.add_transformation( `rotate( ${deg} ${cx} ${cy} )` );
|
|
284
|
+
return this;
|
|
285
|
+
}
|
|
286
|
+
|
|
265
287
|
translate( dx: number, dy: number ): this {
|
|
266
288
|
this.transform( `translate( ${dx} ${dy} )` );
|
|
267
289
|
return this;
|
|
268
290
|
}
|
|
269
291
|
|
|
292
|
+
add_translation( dx: number, dy: number ): this {
|
|
293
|
+
this.add_transformation( `translate( ${dx} ${dy} )` );
|
|
294
|
+
return this;
|
|
295
|
+
}
|
|
296
|
+
|
|
270
297
|
scale( x: number ): this {
|
|
271
298
|
this.transform( `scale( ${x} )` );
|
|
272
299
|
return this;
|
|
273
300
|
}
|
|
274
301
|
|
|
302
|
+
add_scale( x: number ): this {
|
|
303
|
+
this.add_transformation( `scale( ${x} )` );
|
|
304
|
+
return this;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
|
|
275
308
|
/**
|
|
276
309
|
*
|
|
277
310
|
*/
|
|
@@ -574,6 +607,8 @@ export class SvgGroup extends SvgItem {
|
|
|
574
607
|
icon.setAttr( 'y', num(y)+'' );
|
|
575
608
|
icon.setAttr( 'width', num(w)+'' );
|
|
576
609
|
icon.setAttr( 'height', num(h)+'' );
|
|
610
|
+
icon.setStyle( 'width', num(w)+'px' );
|
|
611
|
+
icon.setStyle( 'height', num(h)+'px' );
|
|
577
612
|
return this.append( icon );
|
|
578
613
|
}
|
|
579
614
|
|