@consta/uikit 4.3.0 → 4.4.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.
- package/__internal__/src/components/AutoCompleteCanary/AutoCompleteCanary.js +1 -1
- package/__internal__/src/components/AutoCompleteCanary/AutoCompleteCanary.js.map +1 -1
- package/__internal__/src/components/Collapse/Collapse.css +1 -1
- package/__internal__/src/components/Collapse/Collapse.js +1 -1
- package/__internal__/src/components/Collapse/Collapse.js.map +1 -1
- package/__internal__/src/components/Collapse/types.d.ts +1 -0
- package/__internal__/src/components/Collapse/types.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePicker.js +1 -1
- package/__internal__/src/components/DatePicker/DatePicker.js.map +1 -1
- package/__internal__/src/components/ProgressLine/ProgressLine.css +1 -1
- package/__internal__/src/components/ProgressLine/ProgressLine.js +1 -1
- package/__internal__/src/components/ProgressLine/ProgressLine.js.map +1 -1
- package/__internal__/src/components/ProgressLine/helpers.d.ts +9 -1
- package/__internal__/src/components/ProgressLine/helpers.js +1 -1
- package/__internal__/src/components/ProgressLine/helpers.js.map +1 -1
- package/__internal__/src/components/Table/Cell/TableCell.css +1 -1
- package/__internal__/src/components/Table/RowsCollapse/TableRowsCollapse.js +1 -1
- package/__internal__/src/components/Table/RowsCollapse/TableRowsCollapse.js.map +1 -1
- package/__internal__/src/components/Table/Table.d.ts +1 -0
- package/__internal__/src/components/Table/Table.js +1 -1
- package/__internal__/src/components/Table/Table.js.map +1 -1
- package/__internal__/src/components/Table/__mock__/data.mock.d.ts +19 -0
- package/__internal__/src/components/Table/__mock__/data.mock.js +1 -1
- package/__internal__/src/components/Table/__mock__/data.mock.js.map +1 -1
- package/__internal__/src/components/Table/helpers.d.ts +1 -0
- package/__internal__/src/components/Table/helpers.js +1 -1
- package/__internal__/src/components/Table/helpers.js.map +1 -1
- package/__internal__/src/hooks/useBreakpoints/getLastPoint.d.ts +1 -0
- package/__internal__/src/hooks/useBreakpoints/getLastPoint.js +2 -0
- package/__internal__/src/hooks/useBreakpoints/getLastPoint.js.map +1 -0
- package/__internal__/src/hooks/useBreakpoints/index.d.ts +1 -0
- package/__internal__/src/hooks/useBreakpoints/index.js +1 -1
- package/__internal__/src/hooks/useBreakpoints/index.js.map +1 -1
- package/__internal__/src/hooks/useBreakpoints/isEq.d.ts +2 -0
- package/__internal__/src/hooks/useBreakpoints/isEq.js +2 -0
- package/__internal__/src/hooks/useBreakpoints/isEq.js.map +1 -0
- package/__internal__/src/hooks/useBreakpoints/mapping.d.ts +2 -0
- package/__internal__/src/hooks/useBreakpoints/mapping.js +2 -0
- package/__internal__/src/hooks/useBreakpoints/mapping.js.map +1 -0
- package/__internal__/src/hooks/useBreakpoints/types.d.ts +2 -0
- package/__internal__/src/hooks/useBreakpoints/types.js +2 -0
- package/__internal__/src/hooks/useBreakpoints/types.js.map +1 -0
- package/__internal__/src/hooks/useBreakpoints/useBreakpoints.d.ts +2 -4
- package/__internal__/src/hooks/useBreakpoints/useBreakpoints.js +1 -1
- package/__internal__/src/hooks/useBreakpoints/useBreakpoints.js.map +1 -1
- package/__internal__/src/hooks/useComponentBreakpoints/index.d.ts +2 -0
- package/__internal__/src/hooks/useComponentBreakpoints/index.js +2 -0
- package/__internal__/src/hooks/useComponentBreakpoints/index.js.map +1 -0
- package/__internal__/src/hooks/useComponentBreakpoints/useComponentBreakpoints.d.ts +4 -0
- package/__internal__/src/hooks/useComponentBreakpoints/useComponentBreakpoints.js +2 -0
- package/__internal__/src/hooks/useComponentBreakpoints/useComponentBreakpoints.js.map +1 -0
- package/__internal__/src/utils/generateMask.d.ts +1 -0
- package/__internal__/src/utils/generateMask.js +2 -0
- package/__internal__/src/utils/generateMask.js.map +1 -0
- package/package.json +1 -1
- package/useComponentBreakpoints/index.d.ts +1 -0
- package/useComponentBreakpoints/index.js +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBreakpoints.js","names":["useLayoutEffect","useState","
|
|
1
|
+
{"version":3,"file":"useBreakpoints.js","names":["useLayoutEffect","useState","isEq","mapping","defaultPoints","defaultMap","useBreakpoints","map","pointsMap","window","innerWidth","points","setSetPoints","subscribe","newPoints","state","addEventListener","removeEventListener"],"sources":["../../../../../src/hooks/useBreakpoints/useBreakpoints.ts"],"sourcesContent":["import { useLayoutEffect, useState } from 'react';\n\nimport { isEq } from './isEq';\nimport { mapping } from './mapping';\nimport { Map, Returned } from './types';\n\nconst defaultPoints = [\n '5xs',\n '4xs',\n '3xs',\n '2xs',\n 'xs',\n 's',\n 'm',\n 'l',\n 'xl',\n '2xl',\n '3xl',\n '4xl',\n '5xl',\n] as const;\n\ntype DefaultPoints = typeof defaultPoints[number];\n\nconst defaultMap: Map<DefaultPoints> = {\n '5xs': 320,\n '4xs': 360,\n '3xs': 480,\n '2xs': 720,\n 'xs': 960,\n 's': 1020,\n 'm': 1200,\n 'l': 1400,\n 'xl': 1600,\n '2xl': 1800,\n '3xl': 2000,\n '4xl': 2200,\n '5xl': 2400,\n};\n\nexport const useBreakpoints = <POINTS extends string | number = DefaultPoints>(\n map?: Map<POINTS>,\n) => {\n const pointsMap = map || (defaultMap as Map<POINTS>);\n\n const [points, setSetPoints] = useState<Returned<POINTS>>(() =>\n mapping(window.innerWidth, pointsMap),\n );\n\n useLayoutEffect(() => {\n const subscribe = () => {\n const newPoints = mapping(window.innerWidth, pointsMap);\n\n setSetPoints((state) => (isEq(state, newPoints) ? state : newPoints));\n };\n\n window.addEventListener('resize', subscribe);\n\n return () => window.removeEventListener('resize', subscribe);\n }, []);\n\n return points;\n};\n"],"mappings":"iEAAA,OAASA,eAAT,CAA0BC,QAA1B,KAA0C,OAA1C,CAEA,OAASC,IAAT,cACA,OAASC,OAAT,iB,GAGMC,cAAa,CAAG,CACpB,KADoB,CAEpB,KAFoB,CAGpB,KAHoB,CAIpB,KAJoB,CAKpB,IALoB,CAMpB,GANoB,CAOpB,GAPoB,CAQpB,GARoB,CASpB,IAToB,CAUpB,KAVoB,CAWpB,KAXoB,CAYpB,KAZoB,CAapB,KAboB,C,CAkBhBC,UAA8B,CAAG,CACrC,MAAO,GAD8B,CAErC,MAAO,GAF8B,CAGrC,MAAO,GAH8B,CAIrC,MAAO,GAJ8B,CAKrC,GAAM,GAL+B,CAMrC,EAAK,IANgC,CAOrC,EAAK,IAPgC,CAQrC,EAAK,IARgC,CASrC,GAAM,IAT+B,CAUrC,MAAO,IAV8B,CAWrC,MAAO,GAX8B,CAYrC,MAAO,IAZ8B,CAarC,MAAO,IAb8B,C,CAgBvC,MAAO,IAAMC,eAAc,CAAG,SAC5BC,CAD4B,CAEzB,IACGC,EAAS,CAAGD,CAAG,EAAKF,UADvB,GAG4BJ,QAAQ,CAAmB,iBACxDE,QAAO,CAACM,MAAM,CAACC,UAAR,CAAoBF,CAApB,CADiD,CAAnB,CAHpC,uBAGIG,CAHJ,MAGYC,CAHZ,MAmBH,MAZAZ,gBAAe,CAAC,UAAM,CACpB,GAAMa,EAAS,CAAG,UAAM,CACtB,GAAMC,EAAS,CAAGX,OAAO,CAACM,MAAM,CAACC,UAAR,CAAoBF,CAApB,CAAzB,CAEAI,CAAY,CAAC,SAACG,CAAD,QAAYb,KAAI,CAACa,CAAD,CAAQD,CAAR,CAAJ,CAAyBC,CAAzB,CAAiCD,CAA7C,CAAD,CACb,CAJD,CAQA,MAFAL,OAAM,CAACO,gBAAP,CAAwB,QAAxB,CAAkCH,CAAlC,CAEA,CAAO,iBAAMJ,OAAM,CAACQ,mBAAP,CAA2B,QAA3B,CAAqCJ,CAArC,CAAN,CACR,CAVc,CAUZ,EAVY,CAYf,CAAOF,CACR,CAtBM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/hooks/useComponentBreakpoints/index.ts"],"sourcesContent":["export * from './useComponentBreakpoints';\nexport * from '##/hooks/useBreakpoints/getLastPoint';\n"],"mappings":"AAAA,uCACA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare type Map<POINTS extends string | number> = Record<POINTS, number>;
|
|
2
|
+
declare type Returned<POINTS extends string | number> = Record<POINTS, boolean>;
|
|
3
|
+
export declare const useComponentBreakpoints: <POINTS extends string | number>(ref: React.RefObject<HTMLElement | SVGGraphicsElement>, map: Map<POINTS>) => Returned<POINTS>;
|
|
4
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import{useLayoutEffect,useState}from"react";import{isEq}from"../useBreakpoints/isEq";import{mapping}from"../useBreakpoints/mapping";import{useMutableRef}from"../useMutableRef";var getWidth=function(a){var b;return(null===(b=a.current)||void 0===b?void 0:b.getBoundingClientRect().width)||0};export var useComponentBreakpoints=function(a,b){var c=useState(function(){return mapping(getWidth(a),b)}),d=_slicedToArray(c,2),e=d[0],f=d[1],g=useMutableRef(b);return useLayoutEffect(function(){var b=new ResizeObserver(function(){var b=mapping(getWidth(a),g.current);f(function(a){return isEq(a,b)?a:b})});return a.current&&b.observe(a.current),function(){b.disconnect()}},[a.current]),e};
|
|
2
|
+
//# sourceMappingURL=useComponentBreakpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useComponentBreakpoints.js","names":["useLayoutEffect","useState","isEq","mapping","useMutableRef","getWidth","ref","current","getBoundingClientRect","width","useComponentBreakpoints","map","points","setSetPoints","mapRef","resizeObserver","ResizeObserver","newPoints","state","observe","disconnect"],"sources":["../../../../../src/hooks/useComponentBreakpoints/useComponentBreakpoints.ts"],"sourcesContent":["import { useLayoutEffect, useState } from 'react';\n\nimport { isEq } from '##/hooks/useBreakpoints/isEq';\nimport { mapping } from '##/hooks/useBreakpoints/mapping';\nimport { useMutableRef } from '##/hooks/useMutableRef';\n\ntype Map<POINTS extends string | number> = Record<POINTS, number>;\ntype Returned<POINTS extends string | number> = Record<POINTS, boolean>;\n\nconst getWidth = (ref: React.RefObject<HTMLElement | SVGGraphicsElement>) =>\n ref.current?.getBoundingClientRect().width || 0;\n\nexport const useComponentBreakpoints = <POINTS extends string | number>(\n ref: React.RefObject<HTMLElement | SVGGraphicsElement>,\n map: Map<POINTS>,\n) => {\n const [points, setSetPoints] = useState<Returned<POINTS>>(() =>\n mapping(getWidth(ref), map),\n );\n\n const mapRef = useMutableRef(map);\n\n useLayoutEffect(() => {\n const resizeObserver = new ResizeObserver(() => {\n const newPoints = mapping(getWidth(ref), mapRef.current);\n setSetPoints((state) => (isEq(state, newPoints) ? state : newPoints));\n });\n\n ref.current && resizeObserver.observe(ref.current);\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [ref.current]);\n\n return points;\n};\n"],"mappings":"iEAAA,OAASA,eAAT,CAA0BC,QAA1B,KAA0C,OAA1C,CAEA,OAASC,IAAT,8BACA,OAASC,OAAT,iCACA,OAASC,aAAT,wBAKA,GAAMC,SAAQ,CAAG,SAACC,CAAD,cACf,WAAAA,CAAG,CAACC,OAAJ,uBAAaC,qBAAb,GAAqCC,KAArC,GAA8C,CAD/B,CAAjB,CAGA,MAAO,IAAMC,wBAAuB,CAAG,SACrCJ,CADqC,CAErCK,CAFqC,CAGlC,OAC4BV,QAAQ,CAAmB,iBACxDE,QAAO,CAACE,QAAQ,CAACC,CAAD,CAAT,CAAgBK,CAAhB,CADiD,CAAnB,CADpC,uBACIC,CADJ,MACYC,CADZ,MAKGC,CAAM,CAAGV,aAAa,CAACO,CAAD,CALzB,CAoBH,MAbAX,gBAAe,CAAC,UAAM,CACpB,GAAMe,EAAc,CAAG,GAAIC,eAAJ,CAAmB,UAAM,CAC9C,GAAMC,EAAS,CAAGd,OAAO,CAACE,QAAQ,CAACC,CAAD,CAAT,CAAgBQ,CAAM,CAACP,OAAvB,CAAzB,CACAM,CAAY,CAAC,SAACK,CAAD,QAAYhB,KAAI,CAACgB,CAAD,CAAQD,CAAR,CAAJ,CAAyBC,CAAzB,CAAiCD,CAA7C,CAAD,CACb,CAHsB,CAAvB,CAOA,MAFAX,EAAG,CAACC,OAAJ,EAAeQ,CAAc,CAACI,OAAf,CAAuBb,CAAG,CAACC,OAA3B,CAEf,CAAO,UAAM,CACXQ,CAAc,CAACK,UAAf,EACD,CACF,CAXc,CAWZ,CAACd,CAAG,CAACC,OAAL,CAXY,CAaf,CAAOK,CACR,CAxBM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generateSvgMask: (svg: string) => string;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var escapeRegExp=function(a){return a.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")},replaceAll=function(a,b,c){return a.replace(new RegExp(escapeRegExp(b),"g"),c)};export var generateSvgMask=function(a){var b=a.replace(/\s+/g," ");return b=replaceAll(b,"%","%25"),b=replaceAll(b,"> <","><"),b=replaceAll(b,"; }",";}"),b=replaceAll(b,"<","%3c"),b=replaceAll(b,">","%3e"),b=replaceAll(b,"\"","'"),b=replaceAll(b,"#","%23"),b=replaceAll(b,"{","%7b"),b=replaceAll(b,"}","%7d"),b=replaceAll(b,"|","%7c"),b=replaceAll(b,"^","%5e"),b=replaceAll(b,"`","%60"),b=replaceAll(b,"@","%40"),"url(\"data:image/svg+xml;charset=UTF-8,".concat(b,"\")")};
|
|
2
|
+
//# sourceMappingURL=generateMask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateMask.js","names":["escapeRegExp","str","replace","replaceAll","find","RegExp","generateSvgMask","svg","mask"],"sources":["../../../../src/utils/generateMask.ts"],"sourcesContent":["const escapeRegExp = (str: string) =>\n str.replace(/([.*+?^=!:${}()|\\[\\]\\/\\\\])/g, '\\\\$1');\n\nconst replaceAll = (str: string, find: string, replace: string) =>\n str.replace(new RegExp(escapeRegExp(find), 'g'), replace);\n\nexport const generateSvgMask = (svg: string) => {\n let mask = svg.replace(/\\s+/g, ' ');\n mask = replaceAll(mask, '%', '%25');\n mask = replaceAll(mask, '> <', '><');\n mask = replaceAll(mask, '; }', ';}');\n mask = replaceAll(mask, '<', '%3c');\n mask = replaceAll(mask, '>', '%3e');\n mask = replaceAll(mask, '\"', \"'\");\n mask = replaceAll(mask, '#', '%23');\n mask = replaceAll(mask, '{', '%7b');\n mask = replaceAll(mask, '}', '%7d');\n mask = replaceAll(mask, '|', '%7c');\n mask = replaceAll(mask, '^', '%5e');\n mask = replaceAll(mask, '`', '%60');\n mask = replaceAll(mask, '@', '%40');\n return `url(\"data:image/svg+xml;charset=UTF-8,${mask}\")`;\n};\n"],"mappings":"GAAMA,aAAY,CAAG,SAACC,CAAD,QACnBA,EAAG,CAACC,OAAJ,CAAY,6BAAZ,CAA2C,MAA3C,CADmB,C,CAGfC,UAAU,CAAG,SAACF,CAAD,CAAcG,CAAd,CAA4BF,CAA5B,QACjBD,EAAG,CAACC,OAAJ,CAAY,GAAIG,OAAJ,CAAWL,YAAY,CAACI,CAAD,CAAvB,CAA+B,GAA/B,CAAZ,CAAiDF,CAAjD,CADiB,C,CAGnB,MAAO,IAAMI,gBAAe,CAAG,SAACC,CAAD,CAAiB,CAC9C,GAAIC,EAAI,CAAGD,CAAG,CAACL,OAAJ,CAAY,MAAZ,CAAoB,GAApB,CAAX,CAcA,MAbAM,EAAI,CAAGL,UAAU,CAACK,CAAD,CAAO,GAAP,CAAY,KAAZ,CAajB,CAZAA,CAAI,CAAGL,UAAU,CAACK,CAAD,CAAO,KAAP,CAAc,IAAd,CAYjB,CAXAA,CAAI,CAAGL,UAAU,CAACK,CAAD,CAAO,KAAP,CAAc,IAAd,CAWjB,CAVAA,CAAI,CAAGL,UAAU,CAACK,CAAD,CAAO,GAAP,CAAY,KAAZ,CAUjB,CATAA,CAAI,CAAGL,UAAU,CAACK,CAAD,CAAO,GAAP,CAAY,KAAZ,CASjB,CARAA,CAAI,CAAGL,UAAU,CAACK,CAAD,CAAO,IAAP,CAAY,GAAZ,CAQjB,CAPAA,CAAI,CAAGL,UAAU,CAACK,CAAD,CAAO,GAAP,CAAY,KAAZ,CAOjB,CANAA,CAAI,CAAGL,UAAU,CAACK,CAAD,CAAO,GAAP,CAAY,KAAZ,CAMjB,CALAA,CAAI,CAAGL,UAAU,CAACK,CAAD,CAAO,GAAP,CAAY,KAAZ,CAKjB,CAJAA,CAAI,CAAGL,UAAU,CAACK,CAAD,CAAO,GAAP,CAAY,KAAZ,CAIjB,CAHAA,CAAI,CAAGL,UAAU,CAACK,CAAD,CAAO,GAAP,CAAY,KAAZ,CAGjB,CAFAA,CAAI,CAAGL,UAAU,CAACK,CAAD,CAAO,GAAP,CAAY,KAAZ,CAEjB,CADAA,CAAI,CAAGL,UAAU,CAACK,CAAD,CAAO,GAAP,CAAY,KAAZ,CACjB,kDAAgDA,CAAhD,OACD,CAhBM"}
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../__internal__/src/hooks/useComponentBreakpoints";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../__internal__/src/hooks/useComponentBreakpoints";
|