jb-core 0.0.2 → 0.0.3

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/dist/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";exports.UNDER_CONSTRUCTION="";
1
+ "use strict";exports.createInputEvent=function(e,t,a){const o={bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed,detail:t.detail,isComposing:t.isComposing,view:t.view,which:t.which,data:t.data,dataTransfer:t.dataTransfer,inputType:t.inputType,targetRanges:"function"==typeof t.getTargetRanges()?t.getTargetRanges():[],...a};return new InputEvent(e,o)},exports.createKeyboardEvent=function(e,t,a){const o={altKey:t.altKey,bubbles:t.bubbles,cancelable:t.cancelable,code:t.code,composed:t.composed,ctrlKey:t.ctrlKey,detail:t.detail,isComposing:t.isComposing,key:t.key,location:t.location,metaKey:t.metaKey,repeat:t.repeat,shiftKey:t.shiftKey,view:t.view,charCode:t.charCode,keyCode:t.keyCode,which:t.which,...a};return new KeyboardEvent(e,o)};
2
2
  //# sourceMappingURL=index.cjs.js.map
Binary file
Binary file
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../lib/index.ts"],"sourcesContent":["export const UNDER_CONSTRUCTION = \"\";"],"names":[],"mappings":"wCAAkC"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../lib/events.ts"],"sourcesContent":["/**\r\n * add type to event target for easier access to target\r\n */\r\nexport type EventTypeWithTarget<TEvent,TTarget> = TEvent & {\r\n target: TTarget;\r\n};\r\n/**\r\n * create a keyboardEvent based on e value and replace them with initObj\r\n */\r\nexport function createKeyboardEvent(eventName:string,e:KeyboardEvent,initObj:KeyboardEventInit){\r\n const initialObject: KeyboardEventInit = {\r\n altKey:e.altKey,\r\n bubbles:e.bubbles,\r\n cancelable:e.cancelable,\r\n code:e.code,\r\n composed:e.composed,\r\n ctrlKey:e.ctrlKey,\r\n detail:e.detail,\r\n isComposing:e.isComposing,\r\n key:e.key,\r\n location:e.location,\r\n metaKey:e.metaKey,\r\n repeat:e.repeat,\r\n shiftKey:e.shiftKey,\r\n view:e.view,\r\n charCode:e.charCode,\r\n keyCode:e.keyCode,\r\n which:e.which,\r\n ...initObj \r\n };\r\n const event = new KeyboardEvent(eventName, initialObject);\r\n return event;\r\n}\r\n/**\r\n * create a keyboardEvent based on e value and replace them with initObj\r\n */\r\nexport function createInputEvent(eventName:string,e:InputEvent,initObj:InputEventInit){\r\n const initialObject: InputEventInit = {\r\n bubbles:e.bubbles,\r\n cancelable:e.cancelable,\r\n composed:e.composed,\r\n detail:e.detail,\r\n isComposing:e.isComposing,\r\n view:e.view,\r\n which:e.which,\r\n data:e.data,\r\n dataTransfer:e.dataTransfer,\r\n inputType:e.inputType,\r\n targetRanges: typeof e.getTargetRanges() == \"function\"?e.getTargetRanges():[],\r\n ...initObj \r\n };\r\n const event = new InputEvent(eventName, initialObject);\r\n return event;\r\n}"],"names":["eventName","e","initObj","initialObject","bubbles","cancelable","composed","detail","isComposing","view","which","data","dataTransfer","inputType","targetRanges","getTargetRanges","InputEvent","altKey","code","ctrlKey","key","location","metaKey","repeat","shiftKey","charCode","keyCode","KeyboardEvent"],"mappings":"+CAoCiCA,EAAiBC,EAAaC,GAC7D,MAAMC,EAAgC,CACpCC,QAAQH,EAAEG,QACVC,WAAWJ,EAAEI,WACbC,SAASL,EAAEK,SACXC,OAAON,EAAEM,OACTC,YAAYP,EAAEO,YACdC,KAAKR,EAAEQ,KACPC,MAAMT,EAAES,MACRC,KAAKV,EAAEU,KACPC,aAAaX,EAAEW,aACfC,UAAUZ,EAAEY,UACZC,aAA4C,mBAAvBb,EAAEc,kBAAgCd,EAAEc,kBAAkB,MACxEb,GAGL,OADc,IAAIc,WAAWhB,EAAWG,EAE1C,uCA5CoCH,EAAiBC,EAAgBC,GACnE,MAAMC,EAAmC,CACvCc,OAAOhB,EAAEgB,OACTb,QAAQH,EAAEG,QACVC,WAAWJ,EAAEI,WACba,KAAKjB,EAAEiB,KACPZ,SAASL,EAAEK,SACXa,QAAQlB,EAAEkB,QACVZ,OAAON,EAAEM,OACTC,YAAYP,EAAEO,YACdY,IAAInB,EAAEmB,IACNC,SAASpB,EAAEoB,SACXC,QAAQrB,EAAEqB,QACVC,OAAOtB,EAAEsB,OACTC,SAASvB,EAAEuB,SACXf,KAAKR,EAAEQ,KACPgB,SAASxB,EAAEwB,SACXC,QAAQzB,EAAEyB,QACVhB,MAAMT,EAAES,SACLR,GAGL,OADc,IAAIyB,cAAc3B,EAAWG,EAE7C"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- const o="";export{o as UNDER_CONSTRUCTION};
1
+ function e(e,t,a){const o={altKey:t.altKey,bubbles:t.bubbles,cancelable:t.cancelable,code:t.code,composed:t.composed,ctrlKey:t.ctrlKey,detail:t.detail,isComposing:t.isComposing,key:t.key,location:t.location,metaKey:t.metaKey,repeat:t.repeat,shiftKey:t.shiftKey,view:t.view,charCode:t.charCode,keyCode:t.keyCode,which:t.which,...a};return new KeyboardEvent(e,o)}function t(e,t,a){const o={bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed,detail:t.detail,isComposing:t.isComposing,view:t.view,which:t.which,data:t.data,dataTransfer:t.dataTransfer,inputType:t.inputType,targetRanges:"function"==typeof t.getTargetRanges()?t.getTargetRanges():[],...a};return new InputEvent(e,o)}export{t as createInputEvent,e as createKeyboardEvent};
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.br CHANGED
Binary file
package/dist/index.js.gz CHANGED
Binary file
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../lib/index.ts"],"sourcesContent":["export const UNDER_CONSTRUCTION = \"\";"],"names":["UNDER_CONSTRUCTION"],"mappings":"AAAO,MAAMA,EAAqB"}
1
+ {"version":3,"file":"index.js","sources":["../lib/events.ts"],"sourcesContent":["/**\r\n * add type to event target for easier access to target\r\n */\r\nexport type EventTypeWithTarget<TEvent,TTarget> = TEvent & {\r\n target: TTarget;\r\n};\r\n/**\r\n * create a keyboardEvent based on e value and replace them with initObj\r\n */\r\nexport function createKeyboardEvent(eventName:string,e:KeyboardEvent,initObj:KeyboardEventInit){\r\n const initialObject: KeyboardEventInit = {\r\n altKey:e.altKey,\r\n bubbles:e.bubbles,\r\n cancelable:e.cancelable,\r\n code:e.code,\r\n composed:e.composed,\r\n ctrlKey:e.ctrlKey,\r\n detail:e.detail,\r\n isComposing:e.isComposing,\r\n key:e.key,\r\n location:e.location,\r\n metaKey:e.metaKey,\r\n repeat:e.repeat,\r\n shiftKey:e.shiftKey,\r\n view:e.view,\r\n charCode:e.charCode,\r\n keyCode:e.keyCode,\r\n which:e.which,\r\n ...initObj \r\n };\r\n const event = new KeyboardEvent(eventName, initialObject);\r\n return event;\r\n}\r\n/**\r\n * create a keyboardEvent based on e value and replace them with initObj\r\n */\r\nexport function createInputEvent(eventName:string,e:InputEvent,initObj:InputEventInit){\r\n const initialObject: InputEventInit = {\r\n bubbles:e.bubbles,\r\n cancelable:e.cancelable,\r\n composed:e.composed,\r\n detail:e.detail,\r\n isComposing:e.isComposing,\r\n view:e.view,\r\n which:e.which,\r\n data:e.data,\r\n dataTransfer:e.dataTransfer,\r\n inputType:e.inputType,\r\n targetRanges: typeof e.getTargetRanges() == \"function\"?e.getTargetRanges():[],\r\n ...initObj \r\n };\r\n const event = new InputEvent(eventName, initialObject);\r\n return event;\r\n}"],"names":["createKeyboardEvent","eventName","e","initObj","initialObject","altKey","bubbles","cancelable","code","composed","ctrlKey","detail","isComposing","key","location","metaKey","repeat","shiftKey","view","charCode","keyCode","which","KeyboardEvent","createInputEvent","data","dataTransfer","inputType","targetRanges","getTargetRanges","InputEvent"],"mappings":"SASgBA,EAAoBC,EAAiBC,EAAgBC,GACnE,MAAMC,EAAmC,CACvCC,OAAOH,EAAEG,OACTC,QAAQJ,EAAEI,QACVC,WAAWL,EAAEK,WACbC,KAAKN,EAAEM,KACPC,SAASP,EAAEO,SACXC,QAAQR,EAAEQ,QACVC,OAAOT,EAAES,OACTC,YAAYV,EAAEU,YACdC,IAAIX,EAAEW,IACNC,SAASZ,EAAEY,SACXC,QAAQb,EAAEa,QACVC,OAAOd,EAAEc,OACTC,SAASf,EAAEe,SACXC,KAAKhB,EAAEgB,KACPC,SAASjB,EAAEiB,SACXC,QAAQlB,EAAEkB,QACVC,MAAMnB,EAAEmB,SACLlB,GAGL,OADc,IAAImB,cAAcrB,EAAWG,EAE7C,UAIgBmB,EAAiBtB,EAAiBC,EAAaC,GAC7D,MAAMC,EAAgC,CACpCE,QAAQJ,EAAEI,QACVC,WAAWL,EAAEK,WACbE,SAASP,EAAEO,SACXE,OAAOT,EAAES,OACTC,YAAYV,EAAEU,YACdM,KAAKhB,EAAEgB,KACPG,MAAMnB,EAAEmB,MACRG,KAAKtB,EAAEsB,KACPC,aAAavB,EAAEuB,aACfC,UAAUxB,EAAEwB,UACZC,aAA4C,mBAAvBzB,EAAE0B,kBAAgC1B,EAAE0B,kBAAkB,MACxEzB,GAGL,OADc,IAAI0B,WAAW5B,EAAWG,EAE1C"}
package/dist/index.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):o((e="undefined"!=typeof globalThis?globalThis:e||self).JBCore={})}(this,(function(e){"use strict";e.UNDER_CONSTRUCTION=""}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).JBCore={})}(this,(function(e){"use strict";e.createInputEvent=function(e,t,o){const n={bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed,detail:t.detail,isComposing:t.isComposing,view:t.view,which:t.which,data:t.data,dataTransfer:t.dataTransfer,inputType:t.inputType,targetRanges:"function"==typeof t.getTargetRanges()?t.getTargetRanges():[],...o};return new InputEvent(e,n)},e.createKeyboardEvent=function(e,t,o){const n={altKey:t.altKey,bubbles:t.bubbles,cancelable:t.cancelable,code:t.code,composed:t.composed,ctrlKey:t.ctrlKey,detail:t.detail,isComposing:t.isComposing,key:t.key,location:t.location,metaKey:t.metaKey,repeat:t.repeat,shiftKey:t.shiftKey,view:t.view,charCode:t.charCode,keyCode:t.keyCode,which:t.which,...o};return new KeyboardEvent(e,n)}}));
2
2
  //# sourceMappingURL=index.umd.js.map
Binary file
Binary file
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","sources":["../lib/index.ts"],"sourcesContent":["export const UNDER_CONSTRUCTION = \"\";"],"names":[],"mappings":"mQAAkC"}
1
+ {"version":3,"file":"index.umd.js","sources":["../lib/events.ts"],"sourcesContent":["/**\r\n * add type to event target for easier access to target\r\n */\r\nexport type EventTypeWithTarget<TEvent,TTarget> = TEvent & {\r\n target: TTarget;\r\n};\r\n/**\r\n * create a keyboardEvent based on e value and replace them with initObj\r\n */\r\nexport function createKeyboardEvent(eventName:string,e:KeyboardEvent,initObj:KeyboardEventInit){\r\n const initialObject: KeyboardEventInit = {\r\n altKey:e.altKey,\r\n bubbles:e.bubbles,\r\n cancelable:e.cancelable,\r\n code:e.code,\r\n composed:e.composed,\r\n ctrlKey:e.ctrlKey,\r\n detail:e.detail,\r\n isComposing:e.isComposing,\r\n key:e.key,\r\n location:e.location,\r\n metaKey:e.metaKey,\r\n repeat:e.repeat,\r\n shiftKey:e.shiftKey,\r\n view:e.view,\r\n charCode:e.charCode,\r\n keyCode:e.keyCode,\r\n which:e.which,\r\n ...initObj \r\n };\r\n const event = new KeyboardEvent(eventName, initialObject);\r\n return event;\r\n}\r\n/**\r\n * create a keyboardEvent based on e value and replace them with initObj\r\n */\r\nexport function createInputEvent(eventName:string,e:InputEvent,initObj:InputEventInit){\r\n const initialObject: InputEventInit = {\r\n bubbles:e.bubbles,\r\n cancelable:e.cancelable,\r\n composed:e.composed,\r\n detail:e.detail,\r\n isComposing:e.isComposing,\r\n view:e.view,\r\n which:e.which,\r\n data:e.data,\r\n dataTransfer:e.dataTransfer,\r\n inputType:e.inputType,\r\n targetRanges: typeof e.getTargetRanges() == \"function\"?e.getTargetRanges():[],\r\n ...initObj \r\n };\r\n const event = new InputEvent(eventName, initialObject);\r\n return event;\r\n}"],"names":["eventName","e","initObj","initialObject","bubbles","cancelable","composed","detail","isComposing","view","which","data","dataTransfer","inputType","targetRanges","getTargetRanges","InputEvent","altKey","code","ctrlKey","key","location","metaKey","repeat","shiftKey","charCode","keyCode","KeyboardEvent"],"mappings":"0QAoCiCA,EAAiBC,EAAaC,GAC7D,MAAMC,EAAgC,CACpCC,QAAQH,EAAEG,QACVC,WAAWJ,EAAEI,WACbC,SAASL,EAAEK,SACXC,OAAON,EAAEM,OACTC,YAAYP,EAAEO,YACdC,KAAKR,EAAEQ,KACPC,MAAMT,EAAES,MACRC,KAAKV,EAAEU,KACPC,aAAaX,EAAEW,aACfC,UAAUZ,EAAEY,UACZC,aAA4C,mBAAvBb,EAAEc,kBAAgCd,EAAEc,kBAAkB,MACxEb,GAGL,OADc,IAAIc,WAAWhB,EAAWG,EAE1C,iCA5CoCH,EAAiBC,EAAgBC,GACnE,MAAMC,EAAmC,CACvCc,OAAOhB,EAAEgB,OACTb,QAAQH,EAAEG,QACVC,WAAWJ,EAAEI,WACba,KAAKjB,EAAEiB,KACPZ,SAASL,EAAEK,SACXa,QAAQlB,EAAEkB,QACVZ,OAAON,EAAEM,OACTC,YAAYP,EAAEO,YACdY,IAAInB,EAAEmB,IACNC,SAASpB,EAAEoB,SACXC,QAAQrB,EAAEqB,QACVC,OAAOtB,EAAEsB,OACTC,SAASvB,EAAEuB,SACXf,KAAKR,EAAEQ,KACPgB,SAASxB,EAAEwB,SACXC,QAAQzB,EAAEyB,QACVhB,MAAMT,EAAES,SACLR,GAGL,OADc,IAAIyB,cAAc3B,EAAWG,EAE7C"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * add type to event target for easier access to target
3
+ */
4
+ export type EventTypeWithTarget<TEvent, TTarget> = TEvent & {
5
+ target: TTarget;
6
+ };
7
+ /**
8
+ * create a keyboardEvent based on e value and replace them with initObj
9
+ */
10
+ export declare function createKeyboardEvent(eventName: string, e: KeyboardEvent, initObj: KeyboardEventInit): KeyboardEvent;
11
+ /**
12
+ * create a keyboardEvent based on e value and replace them with initObj
13
+ */
14
+ export declare function createInputEvent(eventName: string, e: InputEvent, initObj: InputEventInit): InputEvent;
@@ -0,0 +1 @@
1
+ export * from "./events.js";
package/lib/events.ts ADDED
@@ -0,0 +1,54 @@
1
+ /**
2
+ * add type to event target for easier access to target
3
+ */
4
+ export type EventTypeWithTarget<TEvent,TTarget> = TEvent & {
5
+ target: TTarget;
6
+ };
7
+ /**
8
+ * create a keyboardEvent based on e value and replace them with initObj
9
+ */
10
+ export function createKeyboardEvent(eventName:string,e:KeyboardEvent,initObj:KeyboardEventInit){
11
+ const initialObject: KeyboardEventInit = {
12
+ altKey:e.altKey,
13
+ bubbles:e.bubbles,
14
+ cancelable:e.cancelable,
15
+ code:e.code,
16
+ composed:e.composed,
17
+ ctrlKey:e.ctrlKey,
18
+ detail:e.detail,
19
+ isComposing:e.isComposing,
20
+ key:e.key,
21
+ location:e.location,
22
+ metaKey:e.metaKey,
23
+ repeat:e.repeat,
24
+ shiftKey:e.shiftKey,
25
+ view:e.view,
26
+ charCode:e.charCode,
27
+ keyCode:e.keyCode,
28
+ which:e.which,
29
+ ...initObj
30
+ };
31
+ const event = new KeyboardEvent(eventName, initialObject);
32
+ return event;
33
+ }
34
+ /**
35
+ * create a keyboardEvent based on e value and replace them with initObj
36
+ */
37
+ export function createInputEvent(eventName:string,e:InputEvent,initObj:InputEventInit){
38
+ const initialObject: InputEventInit = {
39
+ bubbles:e.bubbles,
40
+ cancelable:e.cancelable,
41
+ composed:e.composed,
42
+ detail:e.detail,
43
+ isComposing:e.isComposing,
44
+ view:e.view,
45
+ which:e.which,
46
+ data:e.data,
47
+ dataTransfer:e.dataTransfer,
48
+ inputType:e.inputType,
49
+ targetRanges: typeof e.getTargetRanges() == "function"?e.getTargetRanges():[],
50
+ ...initObj
51
+ };
52
+ const event = new InputEvent(eventName, initialObject);
53
+ return event;
54
+ }
package/lib/index.ts CHANGED
@@ -1 +1 @@
1
- export const UNDER_CONSTRUCTION = "";
1
+ export * from "./events.js";
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "react component",
14
14
  "event"
15
15
  ],
16
- "version": "0.0.2",
16
+ "version": "0.0.3",
17
17
  "bugs": "https://github.com/javadbat/jb-core/issues",
18
18
  "license": "MIT",
19
19
  "files": [
@@ -25,7 +25,7 @@
25
25
  "react/dist/"
26
26
  ],
27
27
  "main": "index.js",
28
- "types": "./dist/modules/jb-core/lib/index.d.ts",
28
+ "types": "./dist/web-component/jb-core/lib/index.d.ts",
29
29
  "repository": {
30
30
  "type": "git",
31
31
  "url": "git@github.com:javadbat/jb-core.git"
@@ -7,13 +7,9 @@
7
7
  "email": "javadbat@gmail.com"
8
8
  },
9
9
  "keywords": [
10
- "jb",
11
- "jb-core",
12
- "web-component tools",
13
- "react component",
14
- "event"
10
+ "jb"
15
11
  ],
16
- "version": "0.0.1",
12
+ "version": "1.0.0",
17
13
  "bugs": "https://github.com/javadbat/jb-core/issues",
18
14
  "license": "MIT",
19
15
  "files": [
@@ -23,12 +19,9 @@
23
19
  "dist/"
24
20
  ],
25
21
  "main": "index.js",
26
- "types": "./dist/modules/jb-core/react/lib/index.d.ts",
22
+ "types": "./dist/web-component/jb-core/react/lib/index.d.ts",
27
23
  "repository": {
28
24
  "type": "git",
29
25
  "url": "git@github.com:javadbat/jb-core.git"
30
- },
31
- "dependencies": {
32
- "jb-core":">=0.0.1"
33
26
  }
34
27
  }
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "baseUrl": ".",
4
+ },
5
+ "include": [
6
+ "lib/**/*.ts",
7
+ "lib/**/*.tsx",
8
+ ],
9
+ "exclude": [
10
+ "node_modules",
11
+ "**/*.spec.ts",
12
+ "dist",
13
+ ],
14
+ "extends":"../../tsconfig-react.json"
15
+ }
@@ -1 +0,0 @@
1
- export declare const UNDER_CONSTRUCTION = "";
@@ -1 +0,0 @@
1
- export declare const UNDER_CONSTRUCTION = "";