jpf 5.0.68 → 5.0.69

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.
@@ -5,6 +5,7 @@ exports.createFileSelector = createFileSelector;
5
5
  const element_1 = require("../../../framework/element");
6
6
  const Button_1 = require("../../html/Button/Button");
7
7
  const Input_1 = require("../../html/Input/Input");
8
+ const event_1 = require("../../../framework/event");
8
9
  class FileSelectorElement extends element_1.Element {
9
10
  constructor(properties) {
10
11
  super({
@@ -22,16 +23,12 @@ class FileSelectorElement extends element_1.Element {
22
23
  const fileInput = (0, Input_1.createInput)(inputProperties).render();
23
24
  this.htmlElement.appendChild(fileInput);
24
25
  if (properties.button) {
25
- const button = (0, Button_1.createButton)((0, element_1.extendProperties)(properties.button, {
26
- eventListeners: {
27
- click: {
28
- listener: () => {
29
- const mouseEvent = new MouseEvent("click");
30
- fileInput.dispatchEvent(mouseEvent);
31
- }
32
- }
33
- }
34
- })).render();
26
+ properties.button.eventListeners = properties.button.eventListeners || [];
27
+ properties.button.eventListeners.push((0, event_1.createClickEvent)(() => {
28
+ const mouseEvent = new MouseEvent("click");
29
+ fileInput.dispatchEvent(mouseEvent);
30
+ }));
31
+ const button = (0, Button_1.createButton)(properties.button).render();
35
32
  this.htmlElement.appendChild(button);
36
33
  }
37
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"FileSelector.js","sourceRoot":"","sources":["../../../../src/controls/custom/FileSelector/FileSelector.ts"],"names":[],"mappings":";;;AA0DA,gDAEC;AA5DD,wDAAsI;AACtI,qDAA0E;AAC1E,kDAAuE;AAOvE,MAAa,mBAAoB,SAAQ,iBAAgC;IACrE,YAAY,UAAmC;QAC3C,KAAK,CACD;YACI,OAAO,EAAE,KAAK;YACd,UAAU,EAAE,IAAA,0BAAgB,EACxB,UAAU,EACV,EAAE,EACF;gBACI,WAAW,EAAE,cAAc;aAC9B,CACJ;SACJ,CACJ,CAAC;IACN,CAAC;IAES,KAAK;QACX,KAAK,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BAAkB,CAAC,UAAmC;IAClE,OAAO,IAAI,mBAAmB,CAAC,UAAU,CAAC,CAAC;AAC/C,CAAC;AAED,MAAa,sBAAuB,SAAQ,2BAAiB;IACzD,YAAY,UAAmC;QAC3C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACzC,CAAC;IACD,MAAM,CAAqB;IAC3B,SAAS,CAA6B;CACzC;AAPD,wDAOC;AAED,IAAA,gCAAsB,EAClB,sBAAsB,EACtB,mBAAmB,CACtB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jpf",
3
- "version": "5.0.68",
3
+ "version": "5.0.69",
4
4
  "description": "Javascript Presentation Foundation base classes and interfaces",
5
5
  "keywords": [
6
6
  "mvvm",
@@ -1,13 +1,14 @@
1
- import { Element, addElementToDictionary ,ElementProperties, IElementProperties, extendProperties } from "../../../framework/element";
2
- import { IButtonProperties, createButton} from "../../html/Button/Button";
1
+ import { Element, addElementToDictionary, ElementProperties, IElementProperties, extendProperties } from "../../../framework/element";
2
+ import { IButtonProperties, createButton } from "../../html/Button/Button";
3
3
  import { createInput, IInputProperties } from "../../html/Input/Input";
4
+ import { createClickEvent } from "../../../framework/event";
4
5
 
5
6
  export interface IFileSelectorProperties extends IElementProperties {
6
7
  button?: IButtonProperties;
7
8
  inputFile: IInputProperties<FileList>;
8
9
  }
9
10
 
10
- export class FileSelectorElement extends Element<IFileSelectorProperties> {
11
+ export class FileSelectorElement extends Element<IFileSelectorProperties> {
11
12
  constructor(properties: IFileSelectorProperties) {
12
13
  super(
13
14
  {
@@ -35,21 +36,14 @@ export class FileSelectorElement extends Element<IFileSelectorProperties> {
35
36
  this.htmlElement.appendChild(fileInput);
36
37
 
37
38
  if (properties.button) {
38
- const button = createButton(
39
- extendProperties(
40
- properties.button,
41
- {
42
- eventListeners: {
43
- click: {
44
- listener: () => {
45
- const mouseEvent = new MouseEvent("click");
46
- fileInput.dispatchEvent(mouseEvent);
47
- }
48
- }
49
- }
50
- }
51
- )
52
- ).render();
39
+ properties.button.eventListeners = properties.button.eventListeners || [];
40
+ properties.button.eventListeners.push(
41
+ createClickEvent(() => {
42
+ const mouseEvent = new MouseEvent("click");
43
+ fileInput.dispatchEvent(mouseEvent);
44
+ })
45
+ );
46
+ const button = createButton(properties.button).render();
53
47
 
54
48
  this.htmlElement.appendChild(button);
55
49
  }