@techexp/webitem 0.7.1 → 0.7.2

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.
@@ -1,6 +1,6 @@
1
1
  // webitem.js Library to simplify creating HTML5 Custom Elements
2
2
  // https://github.com/ahabra/webitem
3
- // Copyright 2021 (C) Abdul Habra. Version 0.7.1.
3
+ // Copyright 2021 (C) Abdul Habra. Version 0.7.2.
4
4
  // Apache License Version 2.0
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  // webitem.js Library to simplify creating HTML5 Custom Elements
2
2
  // https://github.com/ahabra/webitem
3
- // Copyright 2021 (C) Abdul Habra. Version 0.7.1.
3
+ // Copyright 2021 (C) Abdul Habra. Version 0.7.2.
4
4
  // Apache License Version 2.0
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  // webitem.js Library to simplify creating HTML5 Custom Elements
2
2
  // https://github.com/ahabra/webitem
3
- // Copyright 2021 (C) Abdul Habra. Version 0.7.1.
3
+ // Copyright 2021 (C) Abdul Habra. Version 0.7.2.
4
4
  // Apache License Version 2.0
5
5
 
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@techexp/webitem",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "Library to simplify creating Web Components/Custom Elements",
5
5
  "author": "Abdul Habra",
6
6
  "license": "Apache",
@@ -37,11 +37,11 @@
37
37
  "esbuild": "^0.27.2",
38
38
  "eslint": "^9.39.2",
39
39
  "fs-extra": "^11.3.3",
40
- "npm-check-updates": "^19.3.1",
40
+ "npm-check-updates": "^19.3.2",
41
41
  "serve": "^14.2.5"
42
42
  },
43
43
  "dependencies": {
44
- "@techexp/data-bind": "^0.9.5",
45
- "@techexp/jshelper": "^0.7.2"
44
+ "@techexp/data-bind": "^0.9.6",
45
+ "@techexp/jshelper": "^0.7.3"
46
46
  }
47
47
  }
@@ -214,7 +214,7 @@ describe('webitem.defineElement()', () => {
214
214
  expect(el.wi.actions.foo()).to.equal(42)
215
215
  })
216
216
 
217
- it('added action has its [this] equal to the webelement instance', ()=> {
217
+ it('added action has its [this] equal to the webItem instance', ()=> {
218
218
  const nameWithDash = 'wi-t14'
219
219
  const html = `<h3>${nameWithDash} - addAction - THIS</h3>`
220
220
  webitem.defineElement({nameWithDash, html})
@@ -227,6 +227,19 @@ describe('webitem.defineElement()', () => {
227
227
  expect(el.wi.actions.foo()).to.equal(el)
228
228
  })
229
229
 
230
+ it('passes element parameters to action', ()=> {
231
+ const nameWithDash = 'wi-t14-1'
232
+ const html = `<h3>${nameWithDash} - addAction - argument</h3>`
233
+ webitem.defineElement({nameWithDash, html})
234
+ const el = createAndAddElement(nameWithDash)
235
+
236
+ el.wi.addAction('add', function(a, b, c) {
237
+ return a + b + c
238
+ })
239
+
240
+ expect(el.wi.actions.add(1, 2, 3)).to.equal(6)
241
+ })
242
+
230
243
  })
231
244
 
232
245
  describe('addEventListener', ()=> {