@zeedhi/teknisa-components-common 1.94.1 → 1.95.1

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.
@@ -436,6 +436,9 @@ class Image extends ComponentRender {
436
436
  this.maxWidth = this.getInitValue('maxWidth', props.maxWidth, this.maxWidth);
437
437
  this.createAccessors();
438
438
  }
439
+ load(event, element) {
440
+ this.callEvent('load', { event, element, component: this });
441
+ }
439
442
  }
440
443
 
441
444
  /**
@@ -440,6 +440,9 @@
440
440
  this.maxWidth = this.getInitValue('maxWidth', props.maxWidth, this.maxWidth);
441
441
  this.createAccessors();
442
442
  }
443
+ load(event, element) {
444
+ this.callEvent('load', { event, element, component: this });
445
+ }
443
446
  }
444
447
 
445
448
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeedhi/teknisa-components-common",
3
- "version": "1.94.1",
3
+ "version": "1.95.1",
4
4
  "description": "Teknisa Components Common",
5
5
  "author": "Zeedhi <zeedhi@teknisa.com>",
6
6
  "license": "ISC",
@@ -32,5 +32,5 @@
32
32
  "peerDependencies": {
33
33
  "@zeedhi/core": "*"
34
34
  },
35
- "gitHead": "238b7c03f53cd4008cbf07c6c49ad793284565d6"
35
+ "gitHead": "8cc8fee40dc2deabd88eaace030f0a344fc28c64"
36
36
  }
@@ -43,4 +43,25 @@ describe('Image', () => {
43
43
  expect(instance.fillHeight).toBeTruthy();
44
44
  });
45
45
  });
46
+
47
+ describe('load event', () => {
48
+ it('should call load event', () => {
49
+ const load = jest.fn();
50
+ const instance = new Image({
51
+ name: 'image',
52
+ component: 'TekImage',
53
+ events: {
54
+ load,
55
+ },
56
+ });
57
+
58
+ const event = {} as Event;
59
+ const element = {} as HTMLElement;
60
+ instance.load(event, element);
61
+
62
+ expect(load).toHaveBeenCalledWith({
63
+ event, element, component: instance,
64
+ });
65
+ });
66
+ });
46
67
  });
@@ -51,4 +51,5 @@ export declare class Image extends ComponentRender implements IImage {
51
51
  * @param props Image Link props
52
52
  */
53
53
  constructor(props: IImage);
54
+ load(event?: Event, element?: HTMLElement): void;
54
55
  }