jb-core 0.28.0 → 0.30.0

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.
Files changed (61) hide show
  1. package/configs/global.d.ts +10 -6
  2. package/configs/tsconfig-react.json +7 -10
  3. package/configs/tsconfig-web-component.json +8 -11
  4. package/dist/index.cjs.js +109 -1
  5. package/dist/index.cjs.js.br +0 -0
  6. package/dist/index.cjs.js.gz +0 -0
  7. package/dist/index.cjs.js.map +1 -1
  8. package/dist/index.d.ts +43 -5
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +119 -1
  11. package/dist/index.js.br +0 -0
  12. package/dist/index.js.gz +0 -0
  13. package/dist/index.js.map +1 -1
  14. package/dist/index.umd.js +113 -1
  15. package/dist/index.umd.js.br +0 -0
  16. package/dist/index.umd.js.gz +0 -0
  17. package/dist/index.umd.js.map +1 -1
  18. package/i18n/dist/index.cjs.js +57 -1
  19. package/i18n/dist/index.cjs.js.br +0 -0
  20. package/i18n/dist/index.cjs.js.gz +0 -0
  21. package/i18n/dist/index.cjs.js.map +1 -1
  22. package/i18n/dist/index.d.ts +39 -2
  23. package/i18n/dist/index.d.ts.map +1 -1
  24. package/i18n/dist/index.js +58 -1
  25. package/i18n/dist/index.js.br +0 -0
  26. package/i18n/dist/index.js.gz +0 -0
  27. package/i18n/dist/index.js.map +1 -1
  28. package/i18n/dist/index.umd.js +61 -1
  29. package/i18n/dist/index.umd.js.br +0 -0
  30. package/i18n/dist/index.umd.js.gz +0 -0
  31. package/i18n/dist/index.umd.js.map +1 -1
  32. package/i18n/tsconfig.json +1 -1
  33. package/index.js +2 -1
  34. package/package.json +26 -3
  35. package/react/dist/index.cjs.js +29 -1
  36. package/react/dist/index.cjs.js.map +1 -1
  37. package/react/dist/index.d.ts +25 -2
  38. package/react/dist/index.js +29 -1
  39. package/react/dist/index.js.map +1 -1
  40. package/react/dist/index.umd.js +32 -1
  41. package/react/dist/index.umd.js.map +1 -1
  42. package/react/lib/hooks/useLazyRef.ts +1 -3
  43. package/react/tsconfig.json +1 -1
  44. package/theme/dist/index.cjs.js +242 -1
  45. package/theme/dist/index.cjs.js.br +0 -0
  46. package/theme/dist/index.cjs.js.gz +0 -0
  47. package/theme/dist/index.cjs.js.map +1 -1
  48. package/theme/dist/index.d.ts +73 -4
  49. package/theme/dist/index.d.ts.map +1 -1
  50. package/theme/dist/index.js +244 -1
  51. package/theme/dist/index.js.br +0 -0
  52. package/theme/dist/index.js.gz +0 -0
  53. package/theme/dist/index.js.map +1 -1
  54. package/theme/dist/index.umd.js +246 -1
  55. package/theme/dist/index.umd.js.br +0 -0
  56. package/theme/dist/index.umd.js.gz +0 -0
  57. package/theme/dist/index.umd.js.map +1 -1
  58. package/theme/lib/sizes/index.ts +83 -43
  59. package/theme/stories/colors.mdx +1 -1
  60. package/theme/stories/sizes.mdx +16 -6
  61. package/theme/tsconfig.json +1 -1
@@ -5,15 +5,19 @@ declare module '*.scss' {
5
5
  const value: FileStringModules;
6
6
  export default value;
7
7
  }
8
- declare module '*.css' {
9
- const value: FileStringModules;
10
- export default value;
11
- }
12
- declare module '*.html' {
8
+ declare module '*.css' {
9
+ const value: FileStringModules;
10
+ export default value;
11
+ }
12
+ declare module '*.css?inline' {
13
+ const value: string;
14
+ export default value;
15
+ }
16
+ declare module '*.html' {
13
17
  const value: FileStringModules;
14
18
  export default value.default;
15
19
  }
16
20
  declare module '*.svg' {
17
21
  const value: string;
18
22
  export default value;
19
- }
23
+ }
@@ -13,17 +13,14 @@
13
13
  "noImplicitAny": false,
14
14
  "noLib": false,
15
15
  "declaration": true,
16
- "declarationDir": "./",
17
- "declarationMap": false,
18
- "jsx": "react",
19
- "typeRoots" : ["../node_modules/@types", "./global.d.ts"],
20
- },
21
- "include": [
22
- "global.d.ts",
23
- ],
24
- "exclude": [
16
+ "declarationDir": "./",
17
+ "declarationMap": false,
18
+ "jsx": "react",
19
+ "types": ["jb-core/configs/global"],
20
+ },
21
+ "exclude": [
25
22
  "node_modules",
26
23
  "**/*.spec.ts",
27
24
  ],
28
25
  "extends":"./tsconfig-base.json"
29
- }
26
+ }
@@ -7,18 +7,15 @@
7
7
  "preserveConstEnums": true,
8
8
  "moduleResolution": "bundler",
9
9
  "sourceMap": true,
10
- "allowJs": true,
11
- "target": "ES2020",
12
- "typeRoots" : ["../node_modules/@types", "./global.d.ts"],
13
- "declaration": true,
14
- "declarationMap": true,
15
- },
16
- "include": [
17
- "global.d.ts",
18
- ],
19
- "exclude": [
10
+ "allowJs": true,
11
+ "target": "ES2020",
12
+ "types": ["jb-core/configs/global"],
13
+ "declaration": true,
14
+ "declarationMap": true,
15
+ },
16
+ "exclude": [
20
17
  "node_modules",
21
18
  "**/*.spec.ts",
22
19
  ],
23
20
  "extends":"./tsconfig-base.json"
24
- }
21
+ }
package/dist/index.cjs.js CHANGED
@@ -1,2 +1,110 @@
1
- exports.createFocusEvent=function(e,t,o){const n={bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed,detail:t.detail,view:t.view,which:t.which,relatedTarget:t.relatedTarget,...o};return new FocusEvent(e,n)},exports.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)},exports.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)},exports.createMouseEvent=function(e,t,o){const n={bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed,detail:t.detail,view:t.view,which:t.which,altKey:t.altKey,button:t.button,buttons:t.buttons,clientX:t.clientX,clientY:t.clientY,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey,movementX:t.movementX,movementY:t.movementY,screenX:t.screenX,screenY:t.screenY,relatedTarget:t.relatedTarget,modifierAltGraph:t.getModifierState("AltGraph"),modifierCapsLock:t.getModifierState("CapsLock"),modifierFn:t.getModifierState("Fn"),modifierFnLock:t.getModifierState("FnLock"),modifierHyper:t.getModifierState("Hyper"),modifierNumLock:t.getModifierState("NumLock"),modifierScrollLock:t.getModifierState("ScrollLock"),modifierSuper:t.getModifierState("Super"),modifierSymbol:t.getModifierState("Symbol"),modifierSymbolLock:t.getModifierState("SymbolLock"),...o};return new MouseEvent(e,n)},exports.enToFaDigits=function(e){return"string"!=typeof e&&isNaN(e)?"":e.toString().replace(/[0-9]/g,function(e){return String.fromCharCode(e.charCodeAt(0)+1728)})},exports.faToEnDigits=function(e){return"string"!=typeof e?"":e.replace(/[۰-۹]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-1728)})},exports.injectCss=function(e,t=document){const o=new CSSStyleSheet;return o.replaceSync(e),t.adoptedStyleSheets.push(o),o},exports.isMobile=()=>/Mobi/i.test(window.navigator.userAgent),exports.listenAndSilentEvent=function(e,t,o,n={}){document.addEventListener(t,t=>{t.composedPath().includes(e)&&(t.stopPropagation(),t.stopImmediatePropagation(),o(t))},{capture:!0,...n})},exports.parseBooleanAttribute=function(e,t=!1){return null===e?t:""===e||"true"===e.toLowerCase()||"false"!==e.toLowerCase()&&Boolean(e)},exports.uniqueId=function(e=""){return crypto?.randomUUID?`${e}-${crypto.randomUUID()}`:`${e}-${Date.now()}-${Math.random().toString(36).slice(2)}`};
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ exports.createFocusEvent = function(e, t, o) {
3
+ const n = {
4
+ bubbles: t.bubbles,
5
+ cancelable: t.cancelable,
6
+ composed: t.composed,
7
+ detail: t.detail,
8
+ view: t.view,
9
+ which: t.which,
10
+ relatedTarget: t.relatedTarget,
11
+ ...o
12
+ };
13
+ return new FocusEvent(e, n);
14
+ }, exports.createInputEvent = function(e, t, o) {
15
+ const n = {
16
+ bubbles: t.bubbles,
17
+ cancelable: t.cancelable,
18
+ composed: t.composed,
19
+ detail: t.detail,
20
+ isComposing: t.isComposing,
21
+ view: t.view,
22
+ which: t.which,
23
+ data: t.data,
24
+ dataTransfer: t.dataTransfer,
25
+ inputType: t.inputType,
26
+ targetRanges: "function" == typeof t.getTargetRanges ? t.getTargetRanges() : [],
27
+ ...o
28
+ };
29
+ return new InputEvent(e, n);
30
+ }, exports.createKeyboardEvent = function(e, t, o) {
31
+ const n = {
32
+ altKey: t.altKey,
33
+ bubbles: t.bubbles,
34
+ cancelable: t.cancelable,
35
+ code: t.code,
36
+ composed: t.composed,
37
+ ctrlKey: t.ctrlKey,
38
+ detail: t.detail,
39
+ isComposing: t.isComposing,
40
+ key: t.key,
41
+ location: t.location,
42
+ metaKey: t.metaKey,
43
+ repeat: t.repeat,
44
+ shiftKey: t.shiftKey,
45
+ view: t.view,
46
+ charCode: t.charCode,
47
+ keyCode: t.keyCode,
48
+ which: t.which,
49
+ ...o
50
+ };
51
+ return new KeyboardEvent(e, n);
52
+ }, exports.createMouseEvent = function(e, t, o) {
53
+ const n = {
54
+ bubbles: t.bubbles,
55
+ cancelable: t.cancelable,
56
+ composed: t.composed,
57
+ detail: t.detail,
58
+ view: t.view,
59
+ which: t.which,
60
+ altKey: t.altKey,
61
+ button: t.button,
62
+ buttons: t.buttons,
63
+ clientX: t.clientX,
64
+ clientY: t.clientY,
65
+ ctrlKey: t.ctrlKey,
66
+ metaKey: t.metaKey,
67
+ shiftKey: t.shiftKey,
68
+ movementX: t.movementX,
69
+ movementY: t.movementY,
70
+ screenX: t.screenX,
71
+ screenY: t.screenY,
72
+ relatedTarget: t.relatedTarget,
73
+ modifierAltGraph: t.getModifierState("AltGraph"),
74
+ modifierCapsLock: t.getModifierState("CapsLock"),
75
+ modifierFn: t.getModifierState("Fn"),
76
+ modifierFnLock: t.getModifierState("FnLock"),
77
+ modifierHyper: t.getModifierState("Hyper"),
78
+ modifierNumLock: t.getModifierState("NumLock"),
79
+ modifierScrollLock: t.getModifierState("ScrollLock"),
80
+ modifierSuper: t.getModifierState("Super"),
81
+ modifierSymbol: t.getModifierState("Symbol"),
82
+ modifierSymbolLock: t.getModifierState("SymbolLock"),
83
+ ...o
84
+ };
85
+ return new MouseEvent(e, n);
86
+ }, exports.enToFaDigits = function(e) {
87
+ return "string" != typeof e && isNaN(e) ? "" : e.toString().replace(/[0-9]/g, function(e) {
88
+ return String.fromCharCode(e.charCodeAt(0) + 1728);
89
+ });
90
+ }, exports.faToEnDigits = function(e) {
91
+ return "string" != typeof e ? "" : e.replace(/[۰-۹]/g, function(e) {
92
+ return String.fromCharCode(e.charCodeAt(0) - 1728);
93
+ });
94
+ }, exports.injectCss = function(e, t = document) {
95
+ const o = new CSSStyleSheet();
96
+ return o.replaceSync(e), t.adoptedStyleSheets.push(o), o;
97
+ }, exports.isMobile = () => /Mobi/i.test(window.navigator.userAgent), exports.listenAndSilentEvent = function(e, t, o, n = {}) {
98
+ document.addEventListener(t, (t) => {
99
+ t.composedPath().includes(e) && (t.stopPropagation(), t.stopImmediatePropagation(), o(t));
100
+ }, {
101
+ capture: !0,
102
+ ...n
103
+ });
104
+ }, exports.parseBooleanAttribute = function(e, t = !1) {
105
+ return null === e ? t : "" === e || "true" === e.toLowerCase() || "false" !== e.toLowerCase() && Boolean(e);
106
+ }, exports.uniqueId = function(e = "") {
107
+ return crypto?.randomUUID ? `${e}-${crypto.randomUUID()}` : `${e}-${Date.now()}-${Math.random().toString(36).slice(2)}`;
108
+ };
109
+
2
110
  //# sourceMappingURL=index.cjs.js.map
Binary file
Binary file
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","names":[],"sources":["../../../../../../../../../../../Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/lib/events.ts","../../../../../../../../../../../Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/lib/device-detection.ts","../../../../../../../../../../../Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/lib/persian-tools.ts","../../../../../../../../../../../Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/lib/style-tools.ts","../../../../../../../../../../../Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/lib/utils.ts"],"sourcesContent":[],"mappings":"yBA0GA,SAAiC,EAAmB,EAAe,GACjE,MAAM,EAAgC,CACpC,QAAS,EAAE,QACX,WAAY,EAAE,WACd,SAAU,EAAE,SACZ,OAAQ,EAAE,OACV,KAAM,EAAE,KACR,MAAO,EAAE,MACT,cAAe,EAAE,iBACd,GAGL,OADc,IAAI,WAAW,EAAW,EAEzC,2BAvED,SAAiC,EAAmB,EAAe,GACjE,MAAM,EAAgC,CACpC,QAAS,EAAE,QACX,WAAY,EAAE,WACd,SAAU,EAAE,SACZ,OAAQ,EAAE,OACV,YAAa,EAAE,YACf,KAAM,EAAE,KACR,MAAO,EAAE,MACT,KAAM,EAAE,KACR,aAAc,EAAE,aAChB,UAAW,EAAE,UACb,aAA0C,mBAArB,EAAE,gBAAgC,EAAE,kBAAoB,MAC1E,GAGL,OADc,IAAI,WAAW,EAAW,EAEzC,8BA5CD,SAAoC,EAAmB,EAAkB,GACvE,MAAM,EAAmC,CACvC,OAAQ,EAAE,OACV,QAAS,EAAE,QACX,WAAY,EAAE,WACd,KAAM,EAAE,KACR,SAAU,EAAE,SACZ,QAAS,EAAE,QACX,OAAQ,EAAE,OACV,YAAa,EAAE,YACf,IAAK,EAAE,IACP,SAAU,EAAE,SACZ,QAAS,EAAE,QACX,OAAQ,EAAE,OACV,SAAU,EAAE,SACZ,KAAM,EAAE,KACR,SAAU,EAAE,SACZ,QAAS,EAAE,QACX,MAAO,EAAE,SACN,GAGL,OADc,IAAI,cAAc,EAAW,EAE5C,2BAsBD,SAAiC,EAAmB,EAAe,G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BACF,EAAQ,KAEV,CAAC,SAAQ,KAAQ,GACpB,gCIVD,SAAsC,EAAsB,GAAe,GACzE,OAAc,OAAV,EACK,EAEK,KAAV,GAAwC,SAAxB,EAAM,eAGE,UAAxB,EAAM,eAGH,QAAQ,EAChB,mBAlBD,SAAyB,EAAS,IAChC,OAAI,QAAQ,WAAY,GAAU,KAAU,OAAO,eACnD,GAAU,KAAU,KAAK,SAAS,KAAK,SAAS,SAAS,IAAI,MAAM,IACpE"}
1
+ {"version":3,"file":"index.cjs.js","names":[],"sources":["../lib/events.ts","../lib/device-detection.ts","../lib/persian-tools.ts","../lib/style-tools.ts","../lib/utils.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 * this function will stop event from propagate even in capturing phase and will call handler only if event target is the element\r\n */\r\nexport function listenAndSilentEvent<TEvent extends Event, TTarget>(element: TTarget, eventName: string, handler: (e:TEvent) => void, options: AddEventListenerOptions = {}) {\r\n document.addEventListener(eventName as keyof DocumentEventMap, (e: Event) => {\r\n if (e.composedPath().includes(element as unknown as EventTarget)) {\r\n e.stopPropagation();\r\n e.stopImmediatePropagation();\r\n handler(e as TEvent);\r\n }\r\n },{capture:true,...options});\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 InputEvent 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}\r\nexport function createMouseEvent(eventName: string, e: MouseEvent, initObj: MouseEventInit) {\r\n const initialObject: MouseEventInit = {\r\n bubbles: e.bubbles,\r\n cancelable: e.cancelable,\r\n composed: e.composed,\r\n detail: e.detail,\r\n view: e.view,\r\n which: e.which,\r\n altKey:e.altKey,\r\n button:e.button,\r\n buttons:e.buttons,\r\n clientX:e.clientX, \r\n clientY:e.clientY,\r\n ctrlKey:e.ctrlKey,\r\n metaKey:e.metaKey,\r\n shiftKey:e.shiftKey,\r\n movementX:e.movementX,\r\n movementY:e.movementY,\r\n screenX:e.screenX,\r\n screenY:e.screenY,\r\n relatedTarget:e.relatedTarget,\r\n modifierAltGraph:e.getModifierState(\"AltGraph\"),\r\n modifierCapsLock:e.getModifierState(\"CapsLock\"),\r\n modifierFn:e.getModifierState(\"Fn\"),\r\n modifierFnLock:e.getModifierState(\"FnLock\"),\r\n modifierHyper:e.getModifierState(\"Hyper\"),\r\n modifierNumLock:e.getModifierState(\"NumLock\"),\r\n modifierScrollLock:e.getModifierState(\"ScrollLock\"),\r\n modifierSuper:e.getModifierState(\"Super\"),\r\n modifierSymbol:e.getModifierState(\"Symbol\"),\r\n modifierSymbolLock:e.getModifierState(\"SymbolLock\"),\r\n ...initObj\r\n };\r\n const event = new MouseEvent(eventName, initialObject);\r\n return event;\r\n}\r\n\r\n/**\r\n * create a InputEvent based on `e` value and replace them with initObj\r\n */\r\nexport function createFocusEvent(eventName: string, e: FocusEvent, initObj: FocusEventInit) {\r\n const initialObject: FocusEventInit = {\r\n bubbles: e.bubbles,\r\n cancelable: e.cancelable,\r\n composed: e.composed,\r\n detail: e.detail,\r\n view: e.view,\r\n which: e.which,\r\n relatedTarget: e.relatedTarget,\r\n ...initObj\r\n };\r\n const event = new FocusEvent(eventName, initialObject);\r\n return event;\r\n}","export const isMobile = ()=>{\r\n return /Mobi/i.test(window.navigator.userAgent);\r\n};","function faToEnDigits(input:string | number):string{\r\n if (typeof input !== \"string\"){\r\n return '';\r\n }\r\n const regex = /[۰-۹]/g;\r\n const result = input.replace(regex, function (w) {\r\n return String.fromCharCode(w.charCodeAt(0) - 1728);\r\n }\r\n );\r\n return result;\r\n}\r\n\r\nfunction enToFaDigits(input:string | number):string{\r\n if (typeof input !== \"string\" && isNaN(input)){\r\n return '';\r\n }\r\n const regex = /[0-9]/g;\r\n const result = input.toString().replace(regex, function (w) {\r\n return String.fromCharCode(w.charCodeAt(0) + 1728);\r\n }\r\n );\r\n return result;\r\n}\r\nexport {enToFaDigits, faToEnDigits};","export function injectCss (css: string, mainDom: ShadowRoot|Document = document) {\r\n const stylesheet = new CSSStyleSheet();\r\n stylesheet.replaceSync(css);\r\n mainDom.adoptedStyleSheets.push(stylesheet);\r\n return stylesheet;\r\n}","export function uniqueId(prefix = '') {\n if (crypto?.randomUUID) return `${prefix}-${crypto.randomUUID()}`;\n return `${prefix}-${Date.now()}-${Math.random().toString(36).slice(2)}`;\n}\n/**\n * to convert string attribute value to boolean in web-component.\n */\nexport function parseBooleanAttribute(value: string | null, defaultValue = false): boolean {\n if (value === null) {\n return defaultValue;\n }\n if (value === \"\" || value.toLowerCase() === \"true\") {\n return true;\n }\n if (value.toLowerCase() === \"false\") {\n return false;\n }\n return Boolean(value);\n}\n"],"mappings":";2BA0GA,SAAiC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A;CACxK,SAAS,iBAAiB,IAAuC,MAAA;EAC3D,EAAE,aAAA,CAAA,CAAe,SAAS,CAAA,MAC5B,EAAE,gBAAA,GACF,EAAE,yBAAA,GACF,EAAQ,CAAA;CAAA,GAEV;EAAC,SAAA,CAAQ;EAAA,GAAQ;CAAA,CAAA;AACrB,GAAA,QAAA,wBIVA,SAAsC,GAAsB,IAAA,CAAe,GAAA;CACzE,OAAc,SAAV,IACK,IAEK,OAAV,KAAwC,WAAxB,EAAM,YAAA,KAGE,YAAxB,EAAM,YAAA,KAGH,QAAQ,CAAA;AACjB,GAAA,QAAA,WAlBA,SAAyB,IAAS,IAAA;CAChC,OAAI,QAAQ,aAAmB,GAAG,EAAA,GAAU,OAAO,WAAA,MAC5C,GAAG,EAAA,GAAU,KAAK,IAAA,EAAA,GAAS,KAAK,OAAA,CAAA,CAAS,SAAS,EAAA,CAAA,CAAI,MAAM,CAAA;AACrE"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,44 @@
1
- export * from "./events.js";
2
- export * from "./device-detection.js";
3
- export * from "./persian-tools.js";
4
- export * from "./style-tools.js";
5
- export * from './utils.js';
1
+ //#region modules/jb-core/lib/events.d.ts
2
+ /**
3
+ * add type to event target for easier access to target
4
+ */
5
+ type EventTypeWithTarget<TEvent, TTarget> = TEvent & {
6
+ target: TTarget;
7
+ };
8
+ /**
9
+ * this function will stop event from propagate even in capturing phase and will call handler only if event target is the element
10
+ */
11
+ declare function listenAndSilentEvent<TEvent extends Event, TTarget>(element: TTarget, eventName: string, handler: (e: TEvent) => void, options?: AddEventListenerOptions): void;
12
+ /**
13
+ * create a keyboardEvent based on `e` value and replace them with initObj
14
+ */
15
+ declare function createKeyboardEvent(eventName: string, e: KeyboardEvent, initObj: KeyboardEventInit): KeyboardEvent;
16
+ /**
17
+ * create a InputEvent based on `e` value and replace them with initObj
18
+ */
19
+ declare function createInputEvent(eventName: string, e: InputEvent, initObj: InputEventInit): InputEvent;
20
+ declare function createMouseEvent(eventName: string, e: MouseEvent, initObj: MouseEventInit): MouseEvent;
21
+ /**
22
+ * create a InputEvent based on `e` value and replace them with initObj
23
+ */
24
+ declare function createFocusEvent(eventName: string, e: FocusEvent, initObj: FocusEventInit): FocusEvent;
25
+ //#endregion
26
+ //#region modules/jb-core/lib/device-detection.d.ts
27
+ declare const isMobile: () => boolean;
28
+ //#endregion
29
+ //#region modules/jb-core/lib/persian-tools.d.ts
30
+ declare function faToEnDigits(input: string | number): string;
31
+ declare function enToFaDigits(input: string | number): string;
32
+ //#endregion
33
+ //#region modules/jb-core/lib/style-tools.d.ts
34
+ declare function injectCss(css: string, mainDom?: ShadowRoot | Document): CSSStyleSheet;
35
+ //#endregion
36
+ //#region modules/jb-core/lib/utils.d.ts
37
+ declare function uniqueId(prefix?: string): string;
38
+ /**
39
+ * to convert string attribute value to boolean in web-component.
40
+ */
41
+ declare function parseBooleanAttribute(value: string | null, defaultValue?: boolean): boolean;
42
+ //#endregion
43
+ export { EventTypeWithTarget, createFocusEvent, createInputEvent, createKeyboardEvent, createMouseEvent, enToFaDigits, faToEnDigits, injectCss, isMobile, listenAndSilentEvent, parseBooleanAttribute, uniqueId };
6
44
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../lib/events.ts","../lib/device-detection.ts","../lib/persian-tools.ts","../lib/style-tools.ts","../lib/utils.ts"],"mappings":";;AAGA;;KAAY,mBAAA,oBAAuC,MAAA;EACjD,MAAA,EAAQ,OAAO;AAAA;;;;iBAKD,oBAAA,gBAAoC,KAAA,WAAgB,OAAA,EAAS,OAAA,EAAS,SAAA,UAAmB,OAAA,GAAU,CAAA,EAAE,MAAA,WAAiB,OAAA,GAAS,uBAAA;;AAL9H;AAKjB;iBAYgB,mBAAA,CAAoB,SAAA,UAAmB,CAAA,EAAG,aAAA,EAAe,OAAA,EAAS,iBAAA,GAAiB,aAAA;;;;iBA2BnF,gBAAA,CAAiB,SAAA,UAAmB,CAAA,EAAG,UAAA,EAAY,OAAA,EAAS,cAAA,GAAc,UAAA;AAAA,iBAkB1E,gBAAA,CAAiB,SAAA,UAAmB,CAAA,EAAG,UAAA,EAAY,OAAA,EAAS,cAAA,GAAc,UAAA;;;;iBAwC1E,gBAAA,CAAiB,SAAA,UAAmB,CAAA,EAAG,UAAA,EAAY,OAAA,EAAS,cAAA,GAAc,UAAA;;;cC1G7E,QAAA;;;iBCAJ,YAAA,CAAa,KAAqB;AAAA,iBAYlC,YAAA,CAAa,KAAqB;;;iBCZ3B,SAAA,CAAW,GAAA,UAAa,OAAA,GAAS,UAAA,GAAW,QAAA,GAAmB,aAAA;;;iBCA/D,QAAA,CAAS,MAAW;AJGpC;;;AAAA,iBIIgB,qBAAA,CAAsB,KAAA,iBAAsB,YAAoB"}
package/dist/index.js CHANGED
@@ -1,2 +1,120 @@
1
- function e(e,t,o,n={}){document.addEventListener(t,t=>{t.composedPath().includes(e)&&(t.stopPropagation(),t.stopImmediatePropagation(),o(t))},{capture:!0,...n})}function t(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)}function o(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)}function n(e,t,o){const n={bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed,detail:t.detail,view:t.view,which:t.which,altKey:t.altKey,button:t.button,buttons:t.buttons,clientX:t.clientX,clientY:t.clientY,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey,movementX:t.movementX,movementY:t.movementY,screenX:t.screenX,screenY:t.screenY,relatedTarget:t.relatedTarget,modifierAltGraph:t.getModifierState("AltGraph"),modifierCapsLock:t.getModifierState("CapsLock"),modifierFn:t.getModifierState("Fn"),modifierFnLock:t.getModifierState("FnLock"),modifierHyper:t.getModifierState("Hyper"),modifierNumLock:t.getModifierState("NumLock"),modifierScrollLock:t.getModifierState("ScrollLock"),modifierSuper:t.getModifierState("Super"),modifierSymbol:t.getModifierState("Symbol"),modifierSymbolLock:t.getModifierState("SymbolLock"),...o};return new MouseEvent(e,n)}function i(e,t,o){const n={bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed,detail:t.detail,view:t.view,which:t.which,relatedTarget:t.relatedTarget,...o};return new FocusEvent(e,n)}const r=()=>/Mobi/i.test(window.navigator.userAgent);function a(e){if("string"!=typeof e)return"";return e.replace(/[۰-۹]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-1728)})}function c(e){if("string"!=typeof e&&isNaN(e))return"";return e.toString().replace(/[0-9]/g,function(e){return String.fromCharCode(e.charCodeAt(0)+1728)})}function l(e,t=document){const o=new CSSStyleSheet;return o.replaceSync(e),t.adoptedStyleSheets.push(o),o}function d(e=""){return crypto?.randomUUID?`${e}-${crypto.randomUUID()}`:`${e}-${Date.now()}-${Math.random().toString(36).slice(2)}`}function s(e,t=!1){return null===e?t:""===e||"true"===e.toLowerCase()||"false"!==e.toLowerCase()&&Boolean(e)}export{i as createFocusEvent,o as createInputEvent,t as createKeyboardEvent,n as createMouseEvent,c as enToFaDigits,a as faToEnDigits,l as injectCss,r as isMobile,e as listenAndSilentEvent,s as parseBooleanAttribute,d as uniqueId};
1
+ function e(e, t, o, n = {}) {
2
+ document.addEventListener(t, (t) => {
3
+ t.composedPath().includes(e) && (t.stopPropagation(), t.stopImmediatePropagation(), o(t));
4
+ }, {
5
+ capture: !0,
6
+ ...n
7
+ });
8
+ }
9
+ function t(e, t, o) {
10
+ const n = {
11
+ altKey: t.altKey,
12
+ bubbles: t.bubbles,
13
+ cancelable: t.cancelable,
14
+ code: t.code,
15
+ composed: t.composed,
16
+ ctrlKey: t.ctrlKey,
17
+ detail: t.detail,
18
+ isComposing: t.isComposing,
19
+ key: t.key,
20
+ location: t.location,
21
+ metaKey: t.metaKey,
22
+ repeat: t.repeat,
23
+ shiftKey: t.shiftKey,
24
+ view: t.view,
25
+ charCode: t.charCode,
26
+ keyCode: t.keyCode,
27
+ which: t.which,
28
+ ...o
29
+ };
30
+ return new KeyboardEvent(e, n);
31
+ }
32
+ function o(e, t, o) {
33
+ const n = {
34
+ bubbles: t.bubbles,
35
+ cancelable: t.cancelable,
36
+ composed: t.composed,
37
+ detail: t.detail,
38
+ isComposing: t.isComposing,
39
+ view: t.view,
40
+ which: t.which,
41
+ data: t.data,
42
+ dataTransfer: t.dataTransfer,
43
+ inputType: t.inputType,
44
+ targetRanges: "function" == typeof t.getTargetRanges ? t.getTargetRanges() : [],
45
+ ...o
46
+ };
47
+ return new InputEvent(e, n);
48
+ }
49
+ function n(e, t, o) {
50
+ const n = {
51
+ bubbles: t.bubbles,
52
+ cancelable: t.cancelable,
53
+ composed: t.composed,
54
+ detail: t.detail,
55
+ view: t.view,
56
+ which: t.which,
57
+ altKey: t.altKey,
58
+ button: t.button,
59
+ buttons: t.buttons,
60
+ clientX: t.clientX,
61
+ clientY: t.clientY,
62
+ ctrlKey: t.ctrlKey,
63
+ metaKey: t.metaKey,
64
+ shiftKey: t.shiftKey,
65
+ movementX: t.movementX,
66
+ movementY: t.movementY,
67
+ screenX: t.screenX,
68
+ screenY: t.screenY,
69
+ relatedTarget: t.relatedTarget,
70
+ modifierAltGraph: t.getModifierState("AltGraph"),
71
+ modifierCapsLock: t.getModifierState("CapsLock"),
72
+ modifierFn: t.getModifierState("Fn"),
73
+ modifierFnLock: t.getModifierState("FnLock"),
74
+ modifierHyper: t.getModifierState("Hyper"),
75
+ modifierNumLock: t.getModifierState("NumLock"),
76
+ modifierScrollLock: t.getModifierState("ScrollLock"),
77
+ modifierSuper: t.getModifierState("Super"),
78
+ modifierSymbol: t.getModifierState("Symbol"),
79
+ modifierSymbolLock: t.getModifierState("SymbolLock"),
80
+ ...o
81
+ };
82
+ return new MouseEvent(e, n);
83
+ }
84
+ function i(e, t, o) {
85
+ const n = {
86
+ bubbles: t.bubbles,
87
+ cancelable: t.cancelable,
88
+ composed: t.composed,
89
+ detail: t.detail,
90
+ view: t.view,
91
+ which: t.which,
92
+ relatedTarget: t.relatedTarget,
93
+ ...o
94
+ };
95
+ return new FocusEvent(e, n);
96
+ }
97
+ const r = () => /Mobi/i.test(window.navigator.userAgent);
98
+ function a(e) {
99
+ return "string" != typeof e ? "" : e.replace(/[۰-۹]/g, function(e) {
100
+ return String.fromCharCode(e.charCodeAt(0) - 1728);
101
+ });
102
+ }
103
+ function c(e) {
104
+ return "string" != typeof e && isNaN(e) ? "" : e.toString().replace(/[0-9]/g, function(e) {
105
+ return String.fromCharCode(e.charCodeAt(0) + 1728);
106
+ });
107
+ }
108
+ function l(e, t = document) {
109
+ const o = new CSSStyleSheet();
110
+ return o.replaceSync(e), t.adoptedStyleSheets.push(o), o;
111
+ }
112
+ function d(e = "") {
113
+ return crypto?.randomUUID ? `${e}-${crypto.randomUUID()}` : `${e}-${Date.now()}-${Math.random().toString(36).slice(2)}`;
114
+ }
115
+ function s(e, t = !1) {
116
+ return null === e ? t : "" === e || "true" === e.toLowerCase() || "false" !== e.toLowerCase() && Boolean(e);
117
+ }
118
+ export { i as createFocusEvent, o as createInputEvent, t as createKeyboardEvent, n as createMouseEvent, c as enToFaDigits, a as faToEnDigits, l as injectCss, r as isMobile, e as listenAndSilentEvent, s as parseBooleanAttribute, d as uniqueId };
119
+
2
120
  //# 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","names":[],"sources":["../../../../../../../../../../../Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/lib/events.ts","../../../../../../../../../../../Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/lib/device-detection.ts","../../../../../../../../../../../Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/lib/persian-tools.ts","../../../../../../../../../../../Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/lib/style-tools.ts","../../../../../../../../../../../Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/lib/utils.ts"],"sourcesContent":[],"mappings":"AASA,SAAgB,EAAoD,EAAkB,EAAmB,EAA6B,EAAmC,CAAE,GACzK,SAAS,iBAAiB,EAAuC,IAC3D,EAAE,eAAe,SAAS,KAC5B,EAAE,kBACF,EAAE,2BACF,EAAQ,KAEV,CAAC,SAAQ,KAAQ,GACpB,CAID,SAAgB,EAAoB,EAAmB,EAAkB,GACvE,MAAM,EAAmC,CACvC,OAAQ,EAAE,OACV,QAAS,EAAE,QACX,WAAY,EAAE,WACd,KAAM,EAAE,KACR,SAAU,EAAE,SACZ,QAAS,EAAE,QACX,OAAQ,EAAE,OACV,YAAa,EAAE,YACf,IAAK,EAAE,IACP,SAAU,EAAE,SACZ,QAAS,EAAE,QACX,OAAQ,EAAE,OACV,SAAU,EAAE,SACZ,KAAM,EAAE,KACR,SAAU,EAAE,SACZ,QAAS,EAAE,QACX,MAAO,EAAE,SACN,GAGL,OADc,IAAI,cAAc,EAAW,EAE5C,CAID,SAAgB,EAAiB,EAAmB,EAAe,GACjE,MAAM,EAAgC,CACpC,QAAS,EAAE,QACX,WAAY,EAAE,WACd,SAAU,EAAE,SACZ,OAAQ,EAAE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AAM,QADP,SACsB,SAAU,GAC5C,OAAO,OAAO,aAAa,EAAE,WAAW,GAAK,KAC9C,EAGF,CAED,SAAS,EAAa,GACpB,GAAqB,iBAAV,GAAsB,MAAM,GACrC,MAAO,GAOT,OAJe,EAAM,WAAW,QADlB,SACiC,SAAU,GACvD,OAAO,OAAO,aAAa,EAAE,WAAW,GAAK,KAC9C,EAGF,CCtBD,SAAgB,EAAW,EAAa,EAA+B,UACrE,MAAM,EAAa,IAAI,cAGvB,OAFA,EAAW,YAAY,GACvB,EAAQ,mBAAmB,KAAK,GACzB,CACR,CCLD,SAAgB,EAAS,EAAS,IAChC,OAAI,QAAQ,WAAY,GAAU,KAAU,OAAO,eACnD,GAAU,KAAU,KAAK,SAAS,KAAK,SAAS,SAAS,IAAI,MAAM,IACpE,CAID,SAAgB,EAAsB,EAAsB,GAAe,GACzE,OAAc,OAAV,EACK,EAEK,KAAV,GAAwC,SAAxB,EAAM,eAGE,UAAxB,EAAM,eAGH,QAAQ,EAChB"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../lib/events.ts","../lib/device-detection.ts","../lib/persian-tools.ts","../lib/style-tools.ts","../lib/utils.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 * this function will stop event from propagate even in capturing phase and will call handler only if event target is the element\r\n */\r\nexport function listenAndSilentEvent<TEvent extends Event, TTarget>(element: TTarget, eventName: string, handler: (e:TEvent) => void, options: AddEventListenerOptions = {}) {\r\n document.addEventListener(eventName as keyof DocumentEventMap, (e: Event) => {\r\n if (e.composedPath().includes(element as unknown as EventTarget)) {\r\n e.stopPropagation();\r\n e.stopImmediatePropagation();\r\n handler(e as TEvent);\r\n }\r\n },{capture:true,...options});\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 InputEvent 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}\r\nexport function createMouseEvent(eventName: string, e: MouseEvent, initObj: MouseEventInit) {\r\n const initialObject: MouseEventInit = {\r\n bubbles: e.bubbles,\r\n cancelable: e.cancelable,\r\n composed: e.composed,\r\n detail: e.detail,\r\n view: e.view,\r\n which: e.which,\r\n altKey:e.altKey,\r\n button:e.button,\r\n buttons:e.buttons,\r\n clientX:e.clientX, \r\n clientY:e.clientY,\r\n ctrlKey:e.ctrlKey,\r\n metaKey:e.metaKey,\r\n shiftKey:e.shiftKey,\r\n movementX:e.movementX,\r\n movementY:e.movementY,\r\n screenX:e.screenX,\r\n screenY:e.screenY,\r\n relatedTarget:e.relatedTarget,\r\n modifierAltGraph:e.getModifierState(\"AltGraph\"),\r\n modifierCapsLock:e.getModifierState(\"CapsLock\"),\r\n modifierFn:e.getModifierState(\"Fn\"),\r\n modifierFnLock:e.getModifierState(\"FnLock\"),\r\n modifierHyper:e.getModifierState(\"Hyper\"),\r\n modifierNumLock:e.getModifierState(\"NumLock\"),\r\n modifierScrollLock:e.getModifierState(\"ScrollLock\"),\r\n modifierSuper:e.getModifierState(\"Super\"),\r\n modifierSymbol:e.getModifierState(\"Symbol\"),\r\n modifierSymbolLock:e.getModifierState(\"SymbolLock\"),\r\n ...initObj\r\n };\r\n const event = new MouseEvent(eventName, initialObject);\r\n return event;\r\n}\r\n\r\n/**\r\n * create a InputEvent based on `e` value and replace them with initObj\r\n */\r\nexport function createFocusEvent(eventName: string, e: FocusEvent, initObj: FocusEventInit) {\r\n const initialObject: FocusEventInit = {\r\n bubbles: e.bubbles,\r\n cancelable: e.cancelable,\r\n composed: e.composed,\r\n detail: e.detail,\r\n view: e.view,\r\n which: e.which,\r\n relatedTarget: e.relatedTarget,\r\n ...initObj\r\n };\r\n const event = new FocusEvent(eventName, initialObject);\r\n return event;\r\n}","export const isMobile = ()=>{\r\n return /Mobi/i.test(window.navigator.userAgent);\r\n};","function faToEnDigits(input:string | number):string{\r\n if (typeof input !== \"string\"){\r\n return '';\r\n }\r\n const regex = /[۰-۹]/g;\r\n const result = input.replace(regex, function (w) {\r\n return String.fromCharCode(w.charCodeAt(0) - 1728);\r\n }\r\n );\r\n return result;\r\n}\r\n\r\nfunction enToFaDigits(input:string | number):string{\r\n if (typeof input !== \"string\" && isNaN(input)){\r\n return '';\r\n }\r\n const regex = /[0-9]/g;\r\n const result = input.toString().replace(regex, function (w) {\r\n return String.fromCharCode(w.charCodeAt(0) + 1728);\r\n }\r\n );\r\n return result;\r\n}\r\nexport {enToFaDigits, faToEnDigits};","export function injectCss (css: string, mainDom: ShadowRoot|Document = document) {\r\n const stylesheet = new CSSStyleSheet();\r\n stylesheet.replaceSync(css);\r\n mainDom.adoptedStyleSheets.push(stylesheet);\r\n return stylesheet;\r\n}","export function uniqueId(prefix = '') {\n if (crypto?.randomUUID) return `${prefix}-${crypto.randomUUID()}`;\n return `${prefix}-${Date.now()}-${Math.random().toString(36).slice(2)}`;\n}\n/**\n * to convert string attribute value to boolean in web-component.\n */\nexport function parseBooleanAttribute(value: string | null, defaultValue = false): boolean {\n if (value === null) {\n return defaultValue;\n }\n if (value === \"\" || value.toLowerCase() === \"true\") {\n return true;\n }\n if (value.toLowerCase() === \"false\") {\n return false;\n }\n return Boolean(value);\n}\n"],"mappings":"AASA,SAAgB,EAAoD,GAAkB,GAAmB,GAA6B,IAAmC,CAAC,GAAA;CACxK,SAAS,iBAAiB,IAAuC,MAAA;EAC3D,EAAE,aAAA,CAAA,CAAe,SAAS,CAAA,MAC5B,EAAE,gBAAA,GACF,EAAE,yBAAA,GACF,EAAQ,CAAA;CAAA,GAEV;EAAC,SAAA,CAAQ;EAAA,GAAQ;CAAA,CAAA;AACrB;AAIA,SAAgB,EAAoB,GAAmB,GAAkB,GAAA;CACvE,MAAM,IAAmC;EACvC,QAAQ,EAAE;EACV,SAAS,EAAE;EACX,YAAY,EAAE;EACd,MAAM,EAAE;EACR,UAAU,EAAE;EACZ,SAAS,EAAE;EACX,QAAQ,EAAE;EACV,aAAa,EAAE;EACf,KAAK,EAAE;EACP,UAAU,EAAE;EACZ,SAAS,EAAE;EACX,QAAQ,EAAE;EACV,UAAU,EAAE;EACZ,MAAM,EAAE;EACR,UAAU,EAAE;EACZ,SAAS,EAAE;EACX,OAAO,EAAE;EAAA,GACN;CAAA;CAGL,OAAO,IADW,cAAc,GAAW,CAAA;AAE7C;AAIA,SAAgB,EAAiB,GAAmB,GAAe,GAAA;CACjE,MAAM,IAAgC;EACpC,SAAS,EAAE;EACX,YAAY,EAAE;EACd,UAAU,EAAE;EACZ,QAAQ,EAAE;EACV,aAAa,EAAE;EACf,MAAM,EAAE;EACR,OAAO,EAAE;EACT,MAAM,EAAE;EACR,cAAc,EAAE;EAChB,WAAW,EAAE;EACb,cAA0C,cAAA,OAArB,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AV,IACF,KAGM,EAAM,QAAQ,UAAO,SAAU,GAAA;EAC5C,OAAO,OAAO,aAAa,EAAE,WAAW,CAAA,IAAK,IAAA;CAC/C,CAAA;AAGF;AAEA,SAAS,EAAa,GAAA;CACpB,OAAqB,YAAA,OAAV,KAAsB,MAAM,CAAA,IAC9B,KAGM,EAAM,SAAA,CAAA,CAAW,QAAQ,UAAO,SAAU,GAAA;EACvD,OAAO,OAAO,aAAa,EAAE,WAAW,CAAA,IAAK,IAAA;CAC/C,CAAA;AAGF;ACtBA,SAAgB,EAAW,GAAa,IAA+B,UAAA;CACrE,MAAM,IAAa,IAAI,cAAA;CAGvB,OAFA,EAAW,YAAY,CAAA,GACvB,EAAQ,mBAAmB,KAAK,CAAA,GACzB;AACT;ACLA,SAAgB,EAAS,IAAS,IAAA;CAChC,OAAI,QAAQ,aAAmB,GAAG,EAAA,GAAU,OAAO,WAAA,MAC5C,GAAG,EAAA,GAAU,KAAK,IAAA,EAAA,GAAS,KAAK,OAAA,CAAA,CAAS,SAAS,EAAA,CAAA,CAAI,MAAM,CAAA;AACrE;AAIA,SAAgB,EAAsB,GAAsB,IAAA,CAAe,GAAA;CACzE,OAAc,SAAV,IACK,IAEK,OAAV,KAAwC,WAAxB,EAAM,YAAA,KAGE,YAAxB,EAAM,YAAA,KAGH,QAAQ,CAAA;AACjB;AAAA,SAAA,KAAA,kBAAA,KAAA,kBAAA,KAAA,qBAAA,KAAA,kBAAA,KAAA,cAAA,KAAA,cAAA,KAAA,WAAA,KAAA,UAAA,KAAA,sBAAA,KAAA,uBAAA,KAAA"}
package/dist/index.umd.js CHANGED
@@ -1,2 +1,114 @@
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){e.createFocusEvent=function(e,t,o){const n={bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed,detail:t.detail,view:t.view,which:t.which,relatedTarget:t.relatedTarget,...o};return new FocusEvent(e,n)},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)},e.createMouseEvent=function(e,t,o){const n={bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed,detail:t.detail,view:t.view,which:t.which,altKey:t.altKey,button:t.button,buttons:t.buttons,clientX:t.clientX,clientY:t.clientY,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey,movementX:t.movementX,movementY:t.movementY,screenX:t.screenX,screenY:t.screenY,relatedTarget:t.relatedTarget,modifierAltGraph:t.getModifierState("AltGraph"),modifierCapsLock:t.getModifierState("CapsLock"),modifierFn:t.getModifierState("Fn"),modifierFnLock:t.getModifierState("FnLock"),modifierHyper:t.getModifierState("Hyper"),modifierNumLock:t.getModifierState("NumLock"),modifierScrollLock:t.getModifierState("ScrollLock"),modifierSuper:t.getModifierState("Super"),modifierSymbol:t.getModifierState("Symbol"),modifierSymbolLock:t.getModifierState("SymbolLock"),...o};return new MouseEvent(e,n)},e.enToFaDigits=function(e){return"string"!=typeof e&&isNaN(e)?"":e.toString().replace(/[0-9]/g,function(e){return String.fromCharCode(e.charCodeAt(0)+1728)})},e.faToEnDigits=function(e){return"string"!=typeof e?"":e.replace(/[۰-۹]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-1728)})},e.injectCss=function(e,t=document){const o=new CSSStyleSheet;return o.replaceSync(e),t.adoptedStyleSheets.push(o),o},e.isMobile=()=>/Mobi/i.test(window.navigator.userAgent),e.listenAndSilentEvent=function(e,t,o,n={}){document.addEventListener(t,t=>{t.composedPath().includes(e)&&(t.stopPropagation(),t.stopImmediatePropagation(),o(t))},{capture:!0,...n})},e.parseBooleanAttribute=function(e,t=!1){return null===e?t:""===e||"true"===e.toLowerCase()||"false"!==e.toLowerCase()&&Boolean(e)},e.uniqueId=function(e=""){return crypto?.randomUUID?`${e}-${crypto.randomUUID()}`:`${e}-${Date.now()}-${Math.random().toString(36).slice(2)}`}});
1
+ (function(e, t) {
2
+ "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 = {});
3
+ })(this, function(e) {
4
+ Object.defineProperty(e, Symbol.toStringTag, { value: "Module" });
5
+ e.createFocusEvent = function(e, t, o) {
6
+ const n = {
7
+ bubbles: t.bubbles,
8
+ cancelable: t.cancelable,
9
+ composed: t.composed,
10
+ detail: t.detail,
11
+ view: t.view,
12
+ which: t.which,
13
+ relatedTarget: t.relatedTarget,
14
+ ...o
15
+ };
16
+ return new FocusEvent(e, n);
17
+ }, e.createInputEvent = function(e, t, o) {
18
+ const n = {
19
+ bubbles: t.bubbles,
20
+ cancelable: t.cancelable,
21
+ composed: t.composed,
22
+ detail: t.detail,
23
+ isComposing: t.isComposing,
24
+ view: t.view,
25
+ which: t.which,
26
+ data: t.data,
27
+ dataTransfer: t.dataTransfer,
28
+ inputType: t.inputType,
29
+ targetRanges: "function" == typeof t.getTargetRanges ? t.getTargetRanges() : [],
30
+ ...o
31
+ };
32
+ return new InputEvent(e, n);
33
+ }, e.createKeyboardEvent = function(e, t, o) {
34
+ const n = {
35
+ altKey: t.altKey,
36
+ bubbles: t.bubbles,
37
+ cancelable: t.cancelable,
38
+ code: t.code,
39
+ composed: t.composed,
40
+ ctrlKey: t.ctrlKey,
41
+ detail: t.detail,
42
+ isComposing: t.isComposing,
43
+ key: t.key,
44
+ location: t.location,
45
+ metaKey: t.metaKey,
46
+ repeat: t.repeat,
47
+ shiftKey: t.shiftKey,
48
+ view: t.view,
49
+ charCode: t.charCode,
50
+ keyCode: t.keyCode,
51
+ which: t.which,
52
+ ...o
53
+ };
54
+ return new KeyboardEvent(e, n);
55
+ }, e.createMouseEvent = function(e, t, o) {
56
+ const n = {
57
+ bubbles: t.bubbles,
58
+ cancelable: t.cancelable,
59
+ composed: t.composed,
60
+ detail: t.detail,
61
+ view: t.view,
62
+ which: t.which,
63
+ altKey: t.altKey,
64
+ button: t.button,
65
+ buttons: t.buttons,
66
+ clientX: t.clientX,
67
+ clientY: t.clientY,
68
+ ctrlKey: t.ctrlKey,
69
+ metaKey: t.metaKey,
70
+ shiftKey: t.shiftKey,
71
+ movementX: t.movementX,
72
+ movementY: t.movementY,
73
+ screenX: t.screenX,
74
+ screenY: t.screenY,
75
+ relatedTarget: t.relatedTarget,
76
+ modifierAltGraph: t.getModifierState("AltGraph"),
77
+ modifierCapsLock: t.getModifierState("CapsLock"),
78
+ modifierFn: t.getModifierState("Fn"),
79
+ modifierFnLock: t.getModifierState("FnLock"),
80
+ modifierHyper: t.getModifierState("Hyper"),
81
+ modifierNumLock: t.getModifierState("NumLock"),
82
+ modifierScrollLock: t.getModifierState("ScrollLock"),
83
+ modifierSuper: t.getModifierState("Super"),
84
+ modifierSymbol: t.getModifierState("Symbol"),
85
+ modifierSymbolLock: t.getModifierState("SymbolLock"),
86
+ ...o
87
+ };
88
+ return new MouseEvent(e, n);
89
+ }, e.enToFaDigits = function(e) {
90
+ return "string" != typeof e && isNaN(e) ? "" : e.toString().replace(/[0-9]/g, function(e) {
91
+ return String.fromCharCode(e.charCodeAt(0) + 1728);
92
+ });
93
+ }, e.faToEnDigits = function(e) {
94
+ return "string" != typeof e ? "" : e.replace(/[۰-۹]/g, function(e) {
95
+ return String.fromCharCode(e.charCodeAt(0) - 1728);
96
+ });
97
+ }, e.injectCss = function(e, t = document) {
98
+ const o = new CSSStyleSheet();
99
+ return o.replaceSync(e), t.adoptedStyleSheets.push(o), o;
100
+ }, e.isMobile = () => /Mobi/i.test(window.navigator.userAgent), e.listenAndSilentEvent = function(e, t, o, n = {}) {
101
+ document.addEventListener(t, (t) => {
102
+ t.composedPath().includes(e) && (t.stopPropagation(), t.stopImmediatePropagation(), o(t));
103
+ }, {
104
+ capture: !0,
105
+ ...n
106
+ });
107
+ }, e.parseBooleanAttribute = function(e, t = !1) {
108
+ return null === e ? t : "" === e || "true" === e.toLowerCase() || "false" !== e.toLowerCase() && Boolean(e);
109
+ }, e.uniqueId = function(e = "") {
110
+ return crypto?.randomUUID ? `${e}-${crypto.randomUUID()}` : `${e}-${Date.now()}-${Math.random().toString(36).slice(2)}`;
111
+ };
112
+ });
113
+
2
114
  //# sourceMappingURL=index.umd.js.map
Binary file
Binary file