@chayns-components/core 5.0.0-beta.1095 → 5.0.0-beta.1096
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.
|
@@ -39,9 +39,8 @@ const getElementClickEvent = element => {
|
|
|
39
39
|
let hasClickHandler = false;
|
|
40
40
|
const checkForClickHandler = el => {
|
|
41
41
|
if (! /*#__PURE__*/(0, _react.isValidElement)(el)) return;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if ('displayName' in el.type && el.type.displayName === 'Checkbox') {
|
|
42
|
+
console.debug('el', el);
|
|
43
|
+
if (typeof el.type !== 'string' && 'displayName' in el.type && el.type.displayName === 'Checkbox') {
|
|
45
44
|
hasClickHandler = true;
|
|
46
45
|
return;
|
|
47
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.js","names":["_react","require","getAccordionHeadHeight","isWrapped","title","width","hasSearch","element","document","createElement","style","fontSize","opacity","pointerEvents","whiteSpace","innerHTML","body","appendChild","closedHeight","Math","max","clientHeight","fontWeight","openHeight","removeChild","closed","open","exports","getElementClickEvent","hasClickHandler","checkForClickHandler","el","isValidElement","type","displayName","props","onClick","onPointerDown","onMouseDown","onTouchStart","children","Children","forEach"],"sources":["../../../src/utils/accordion.ts"],"sourcesContent":["import { Children, isValidElement, ReactNode } from 'react';\nimport type { AccordionHeadProps } from '../components/accordion/accordion-head/AccordionHead';\n\ntype GetAccordionHeadHeightOptions = Pick<AccordionHeadProps, 'isWrapped' | 'title'> & {\n width: number;\n hasSearch: boolean;\n};\n\ninterface GetAccordionHeadHeightResult {\n closed: number;\n open: number;\n}\n\nexport const getAccordionHeadHeight = ({\n isWrapped,\n title,\n width,\n hasSearch,\n}: GetAccordionHeadHeightOptions): GetAccordionHeadHeightResult => {\n const element = document.createElement('div');\n\n element.style.fontSize = '1rem';\n element.style.opacity = '0';\n element.style.pointerEvents = 'none';\n element.style.whiteSpace = 'nowrap';\n element.style.width = `${width}px`;\n\n element.innerHTML = title;\n\n document.body.appendChild(element);\n\n const closedHeight = Math.max(element.clientHeight + 8, isWrapped ? 40 : 33);\n\n if (isWrapped) {\n element.style.fontWeight = 'bold';\n element.style.whiteSpace = 'nowrap';\n } else {\n element.style.fontSize = '1.3rem';\n element.style.whiteSpace = hasSearch ? 'nowrap' : 'normal';\n }\n\n const openHeight = Math.max(element.clientHeight + 8, isWrapped ? 40 : 33);\n\n document.body.removeChild(element);\n\n return { closed: closedHeight, open: openHeight };\n};\n\nexport const getElementClickEvent = (element: ReactNode) => {\n let hasClickHandler = false;\n\n const checkForClickHandler = (el: ReactNode) => {\n if (!isValidElement(el)) return;\n\n
|
|
1
|
+
{"version":3,"file":"accordion.js","names":["_react","require","getAccordionHeadHeight","isWrapped","title","width","hasSearch","element","document","createElement","style","fontSize","opacity","pointerEvents","whiteSpace","innerHTML","body","appendChild","closedHeight","Math","max","clientHeight","fontWeight","openHeight","removeChild","closed","open","exports","getElementClickEvent","hasClickHandler","checkForClickHandler","el","isValidElement","console","debug","type","displayName","props","onClick","onPointerDown","onMouseDown","onTouchStart","children","Children","forEach"],"sources":["../../../src/utils/accordion.ts"],"sourcesContent":["import { Children, isValidElement, ReactNode } from 'react';\nimport type { AccordionHeadProps } from '../components/accordion/accordion-head/AccordionHead';\n\ntype GetAccordionHeadHeightOptions = Pick<AccordionHeadProps, 'isWrapped' | 'title'> & {\n width: number;\n hasSearch: boolean;\n};\n\ninterface GetAccordionHeadHeightResult {\n closed: number;\n open: number;\n}\n\nexport const getAccordionHeadHeight = ({\n isWrapped,\n title,\n width,\n hasSearch,\n}: GetAccordionHeadHeightOptions): GetAccordionHeadHeightResult => {\n const element = document.createElement('div');\n\n element.style.fontSize = '1rem';\n element.style.opacity = '0';\n element.style.pointerEvents = 'none';\n element.style.whiteSpace = 'nowrap';\n element.style.width = `${width}px`;\n\n element.innerHTML = title;\n\n document.body.appendChild(element);\n\n const closedHeight = Math.max(element.clientHeight + 8, isWrapped ? 40 : 33);\n\n if (isWrapped) {\n element.style.fontWeight = 'bold';\n element.style.whiteSpace = 'nowrap';\n } else {\n element.style.fontSize = '1.3rem';\n element.style.whiteSpace = hasSearch ? 'nowrap' : 'normal';\n }\n\n const openHeight = Math.max(element.clientHeight + 8, isWrapped ? 40 : 33);\n\n document.body.removeChild(element);\n\n return { closed: closedHeight, open: openHeight };\n};\n\nexport const getElementClickEvent = (element: ReactNode) => {\n let hasClickHandler = false;\n\n const checkForClickHandler = (el: ReactNode) => {\n if (!isValidElement(el)) return;\n\n console.debug('el', el);\n\n if (\n typeof el.type !== 'string' &&\n 'displayName' in el.type &&\n el.type.displayName === 'Checkbox'\n ) {\n hasClickHandler = true;\n\n return;\n }\n\n if (\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n el.props.onClick ||\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n el.props.onPointerDown ||\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n el.props.onMouseDown ||\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n el.props.onTouchStart\n ) {\n hasClickHandler = true;\n\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (el.props.children) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-unsafe-member-access\n Children.forEach(el.props.children, checkForClickHandler);\n }\n };\n\n checkForClickHandler(element);\n\n return hasClickHandler;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAaO,MAAMC,sBAAsB,GAAGA,CAAC;EACnCC,SAAS;EACTC,KAAK;EACLC,KAAK;EACLC;AAC2B,CAAC,KAAmC;EAC/D,MAAMC,OAAO,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAE7CF,OAAO,CAACG,KAAK,CAACC,QAAQ,GAAG,MAAM;EAC/BJ,OAAO,CAACG,KAAK,CAACE,OAAO,GAAG,GAAG;EAC3BL,OAAO,CAACG,KAAK,CAAC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Q,IAC3B,aAAa,IAAIJ,EAAE,CAACI,IAAI,IACxBJ,EAAE,CAACI,IAAI,CAACC,WAAW,KAAK,UAAU,EACpC;MACEP,eAAe,GAAG,IAAI;MAEtB;IACJ;IAEA;IACI;IACAE,EAAE,CAACM,KAAK,CAACC,OAAO;IAChB;IACAP,EAAE,CAACM,KAAK,CAACE,aAAa;IACtB;IACAR,EAAE,CAACM,KAAK,CAACG,WAAW;IACpB;IACAT,EAAE,CAACM,KAAK,CAACI,YAAY,EACvB;MACEZ,eAAe,GAAG,IAAI;MAEtB;IACJ;;IAEA;IACA,IAAIE,EAAE,CAACM,KAAK,CAACK,QAAQ,EAAE;MACnB;MACAC,eAAQ,CAACC,OAAO,CAACb,EAAE,CAACM,KAAK,CAACK,QAAQ,EAAEZ,oBAAoB,CAAC;IAC7D;EACJ,CAAC;EAEDA,oBAAoB,CAACvB,OAAO,CAAC;EAE7B,OAAOsB,eAAe;AAC1B,CAAC;AAACF,OAAA,CAAAC,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -33,9 +33,8 @@ export const getElementClickEvent = element => {
|
|
|
33
33
|
let hasClickHandler = false;
|
|
34
34
|
const checkForClickHandler = el => {
|
|
35
35
|
if (! /*#__PURE__*/isValidElement(el)) return;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if ('displayName' in el.type && el.type.displayName === 'Checkbox') {
|
|
36
|
+
console.debug('el', el);
|
|
37
|
+
if (typeof el.type !== 'string' && 'displayName' in el.type && el.type.displayName === 'Checkbox') {
|
|
39
38
|
hasClickHandler = true;
|
|
40
39
|
return;
|
|
41
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.js","names":["Children","isValidElement","getAccordionHeadHeight","_ref","isWrapped","title","width","hasSearch","element","document","createElement","style","fontSize","opacity","pointerEvents","whiteSpace","innerHTML","body","appendChild","closedHeight","Math","max","clientHeight","fontWeight","openHeight","removeChild","closed","open","getElementClickEvent","hasClickHandler","checkForClickHandler","el","type","displayName","props","onClick","onPointerDown","onMouseDown","onTouchStart","children","forEach"],"sources":["../../../src/utils/accordion.ts"],"sourcesContent":["import { Children, isValidElement, ReactNode } from 'react';\nimport type { AccordionHeadProps } from '../components/accordion/accordion-head/AccordionHead';\n\ntype GetAccordionHeadHeightOptions = Pick<AccordionHeadProps, 'isWrapped' | 'title'> & {\n width: number;\n hasSearch: boolean;\n};\n\ninterface GetAccordionHeadHeightResult {\n closed: number;\n open: number;\n}\n\nexport const getAccordionHeadHeight = ({\n isWrapped,\n title,\n width,\n hasSearch,\n}: GetAccordionHeadHeightOptions): GetAccordionHeadHeightResult => {\n const element = document.createElement('div');\n\n element.style.fontSize = '1rem';\n element.style.opacity = '0';\n element.style.pointerEvents = 'none';\n element.style.whiteSpace = 'nowrap';\n element.style.width = `${width}px`;\n\n element.innerHTML = title;\n\n document.body.appendChild(element);\n\n const closedHeight = Math.max(element.clientHeight + 8, isWrapped ? 40 : 33);\n\n if (isWrapped) {\n element.style.fontWeight = 'bold';\n element.style.whiteSpace = 'nowrap';\n } else {\n element.style.fontSize = '1.3rem';\n element.style.whiteSpace = hasSearch ? 'nowrap' : 'normal';\n }\n\n const openHeight = Math.max(element.clientHeight + 8, isWrapped ? 40 : 33);\n\n document.body.removeChild(element);\n\n return { closed: closedHeight, open: openHeight };\n};\n\nexport const getElementClickEvent = (element: ReactNode) => {\n let hasClickHandler = false;\n\n const checkForClickHandler = (el: ReactNode) => {\n if (!isValidElement(el)) return;\n\n
|
|
1
|
+
{"version":3,"file":"accordion.js","names":["Children","isValidElement","getAccordionHeadHeight","_ref","isWrapped","title","width","hasSearch","element","document","createElement","style","fontSize","opacity","pointerEvents","whiteSpace","innerHTML","body","appendChild","closedHeight","Math","max","clientHeight","fontWeight","openHeight","removeChild","closed","open","getElementClickEvent","hasClickHandler","checkForClickHandler","el","console","debug","type","displayName","props","onClick","onPointerDown","onMouseDown","onTouchStart","children","forEach"],"sources":["../../../src/utils/accordion.ts"],"sourcesContent":["import { Children, isValidElement, ReactNode } from 'react';\nimport type { AccordionHeadProps } from '../components/accordion/accordion-head/AccordionHead';\n\ntype GetAccordionHeadHeightOptions = Pick<AccordionHeadProps, 'isWrapped' | 'title'> & {\n width: number;\n hasSearch: boolean;\n};\n\ninterface GetAccordionHeadHeightResult {\n closed: number;\n open: number;\n}\n\nexport const getAccordionHeadHeight = ({\n isWrapped,\n title,\n width,\n hasSearch,\n}: GetAccordionHeadHeightOptions): GetAccordionHeadHeightResult => {\n const element = document.createElement('div');\n\n element.style.fontSize = '1rem';\n element.style.opacity = '0';\n element.style.pointerEvents = 'none';\n element.style.whiteSpace = 'nowrap';\n element.style.width = `${width}px`;\n\n element.innerHTML = title;\n\n document.body.appendChild(element);\n\n const closedHeight = Math.max(element.clientHeight + 8, isWrapped ? 40 : 33);\n\n if (isWrapped) {\n element.style.fontWeight = 'bold';\n element.style.whiteSpace = 'nowrap';\n } else {\n element.style.fontSize = '1.3rem';\n element.style.whiteSpace = hasSearch ? 'nowrap' : 'normal';\n }\n\n const openHeight = Math.max(element.clientHeight + 8, isWrapped ? 40 : 33);\n\n document.body.removeChild(element);\n\n return { closed: closedHeight, open: openHeight };\n};\n\nexport const getElementClickEvent = (element: ReactNode) => {\n let hasClickHandler = false;\n\n const checkForClickHandler = (el: ReactNode) => {\n if (!isValidElement(el)) return;\n\n console.debug('el', el);\n\n if (\n typeof el.type !== 'string' &&\n 'displayName' in el.type &&\n el.type.displayName === 'Checkbox'\n ) {\n hasClickHandler = true;\n\n return;\n }\n\n if (\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n el.props.onClick ||\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n el.props.onPointerDown ||\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n el.props.onMouseDown ||\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n el.props.onTouchStart\n ) {\n hasClickHandler = true;\n\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (el.props.children) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-unsafe-member-access\n Children.forEach(el.props.children, checkForClickHandler);\n }\n };\n\n checkForClickHandler(element);\n\n return hasClickHandler;\n};\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,cAAc,QAAmB,OAAO;AAa3D,OAAO,MAAMC,sBAAsB,GAAGC,IAAA,IAK6B;EAAA,IAL5B;IACnCC,SAAS;IACTC,KAAK;IACLC,KAAK;IACLC;EAC2B,CAAC,GAAAJ,IAAA;EAC5B,MAAMK,OAAO,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAE7CF,OAAO,CAACG,KAAK,CAACC,QAAQ,GAAG,MAAM;EAC/BJ,OAAO,CAACG,KAAK,CAACE,OAAO,GAAG,GAAG;EAC3BL,OAAO,CAACG,KAAK,CAACG,aAAa,GAAG,MAAM;EACpCN,OAAO,CAACG,KAAK,CAACI,UAAU,GAAG,QAAQ;EACnCP,OAAO,CAACG,KAAK,CAACL,KAAK,GAAG,GAAGA,KAAK,IAAI;EAElCE,OAAO,CAACQ,SAAS,GAAGX,KAAK;EAEzBI,QAAQ,CAACQ,IAAI,CAACC,WAAW,CAACV,OAAO,CAAC;EAElC,MAAMW,YAAY,GAAGC,IAAI,CAACC,GAAG,CAACb,OAAO,CAACc,YAAY,GAAG,CAAC,EAAElB,SAAS,GAAG,EAAE,GAAG,EAAE,CAAC;EAE5E,IAAIA,SAAS,EAAE;IACXI,OAAO,CAACG,KAAK,CAACY,UAAU,GAAG,MAAM;IACjCf,OAAO,CAACG,KAAK,CAACI,UAAU,GAAG,QAAQ;EACvC,CAAC,MAAM;IACHP,OAAO,CAACG,KAAK,CAACC,QAAQ,GAAG,QAAQ;IACjCJ,OAAO,CAACG,KAAK,CAACI,UAAU,GAAGR,SAAS,GAAG,QAAQ,GAAG,QAAQ;EAC9D;EAEA,MAAMiB,UAAU,GAAGJ,IAAI,CAACC,GAAG,CA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
"version": "5.0.0-beta.1096",
|
|
4
4
|
"description": "A set of beautiful React components for developing your own applications with chayns.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"browserslist": [
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "f5ec3a370e2c7facc832e26b7140b27e6d11b713"
|
|
90
90
|
}
|