@vchasno/ui-kit 0.4.36 → 0.4.37
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/CHANGELOG.md
CHANGED
|
@@ -7,11 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.4.37] - 2025-01-15
|
|
11
|
+
|
|
12
|
+
## Fixed
|
|
13
|
+
|
|
14
|
+
- Fix Breadcrumbs className prop
|
|
15
|
+
|
|
10
16
|
## [0.4.36] - 2025-01-06
|
|
11
17
|
|
|
12
18
|
## Added
|
|
13
19
|
|
|
14
|
-
- Add Breadcrumbs
|
|
20
|
+
- Add Breadcrumbs
|
|
15
21
|
|
|
16
22
|
## [0.4.35] - 2024-12-31
|
|
17
23
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import r from"../Menu/Menu.js";import
|
|
1
|
+
import e from"react";import r from"classnames";import t from"../Menu/Menu.js";import n from"@mui/material/Breadcrumbs";function o(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function a(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}var c=function(c){var i,l,u,s=c.maxItems,f=function(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(c,["maxItems"]),m=e.Children.toArray(c.children),b=s&&m.length>s,p=[],y=[];b&&(s>1?(p=m.slice(-(s-1)),y=m.slice(1,-p.length)):1===s&&(y=m.slice(1)));var O=c.menuButton||"...";return /*#__PURE__*/e.createElement(n,(i=a({},f),l=l={classes:a({separator:"vchasno-ui-breadcrumbs-separator"},f.classes),className:r("vchasno-ui-breadcrumbs",f.className)},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):(function(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(l)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(l,e))}),i),!b&&c.children,b&&[m[0],y.length>0&&/*#__PURE__*/e.createElement(t,{menuButton:/*#__PURE__*/e.createElement(t.Button,null,O)},y.map(function(r,n){return /*#__PURE__*/e.createElement(t.Item,{key:n},r)}))].concat(function(e){if(Array.isArray(e))return o(e)}(u=p)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(u)||function(e,r){if(e){if("string"==typeof e)return o(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return o(e,void 0)}}(u)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()))};export{c as default};
|
|
2
2
|
//# sourceMappingURL=Breadcrumbs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.js","sources":["../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import React, { ReactChild, ReactFragment, ReactPortal } from 'react';\n\nimport Menu from '../Menu';\nimport MaterialBreadcrumbs, {\n BreadcrumbsProps as MaterialBreadcrumbsProps,\n} from '@mui/material/Breadcrumbs';\n\nimport './Breadcrumbs.global.css';\n\nexport interface BreadcrumbsProps extends MaterialBreadcrumbsProps {\n menuButton?: React.ReactNode;\n}\n\n// TODO remove logic with maxItems, when Material-UI will update to v6\n// https://mui.com/material-ui/react-breadcrumbs/#condensed-with-menu\nconst Breadcrumbs: React.FC<BreadcrumbsProps> = (props) => {\n const { maxItems, ...rest } = props;\n\n const childrenArray = React.Children.toArray(props.children);\n const isShowWithMenu = maxItems && childrenArray.length > maxItems;\n\n let childrenToShow: (ReactChild | ReactFragment | ReactPortal)[] = [];\n let menuChildren: (ReactChild | ReactFragment | ReactPortal)[] = [];\n\n if (isShowWithMenu) {\n if (maxItems > 1) {\n childrenToShow = childrenArray.slice(-(maxItems - 1));\n menuChildren = childrenArray.slice(1, -childrenToShow.length);\n } else if (maxItems === 1) {\n menuChildren = childrenArray.slice(1);\n }\n }\n\n const menuButton = props.menuButton || '...';\n\n return (\n <MaterialBreadcrumbs\n {...rest}\n classes={{ separator: 'vchasno-ui-breadcrumbs-separator', ...rest.classes }}\n className
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.js","sources":["../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import React, { ReactChild, ReactFragment, ReactPortal } from 'react';\n\nimport cn from 'classnames';\n\nimport Menu from '../Menu';\nimport MaterialBreadcrumbs, {\n BreadcrumbsProps as MaterialBreadcrumbsProps,\n} from '@mui/material/Breadcrumbs';\n\nimport './Breadcrumbs.global.css';\n\nexport interface BreadcrumbsProps extends MaterialBreadcrumbsProps {\n menuButton?: React.ReactNode;\n}\n\n// TODO remove logic with maxItems, when Material-UI will update to v6\n// https://mui.com/material-ui/react-breadcrumbs/#condensed-with-menu\nconst Breadcrumbs: React.FC<BreadcrumbsProps> = (props) => {\n const { maxItems, ...rest } = props;\n\n const childrenArray = React.Children.toArray(props.children);\n const isShowWithMenu = maxItems && childrenArray.length > maxItems;\n\n let childrenToShow: (ReactChild | ReactFragment | ReactPortal)[] = [];\n let menuChildren: (ReactChild | ReactFragment | ReactPortal)[] = [];\n\n if (isShowWithMenu) {\n if (maxItems > 1) {\n childrenToShow = childrenArray.slice(-(maxItems - 1));\n menuChildren = childrenArray.slice(1, -childrenToShow.length);\n } else if (maxItems === 1) {\n menuChildren = childrenArray.slice(1);\n }\n }\n\n const menuButton = props.menuButton || '...';\n\n return (\n <MaterialBreadcrumbs\n {...rest}\n classes={{ separator: 'vchasno-ui-breadcrumbs-separator', ...rest.classes }}\n className={cn('vchasno-ui-breadcrumbs', rest.className)}\n >\n {!isShowWithMenu && props.children}\n {isShowWithMenu && [\n childrenArray[0],\n menuChildren.length > 0 && (\n <Menu menuButton={<Menu.Button>{menuButton}</Menu.Button>}>\n {menuChildren.map((child, index) => (\n <Menu.Item key={index}>{child}</Menu.Item>\n ))}\n </Menu>\n ),\n ...childrenToShow,\n ]}\n </MaterialBreadcrumbs>\n );\n};\n\nexport default Breadcrumbs;\n"],"names":["Breadcrumbs","props","maxItems","rest","childrenArray","React","Children","toArray","children","isShowWithMenu","length","childrenToShow","menuChildren","slice","menuButton","MaterialBreadcrumbs","classes","_object_spread","separator","className","cn","Menu","createElement","Button","map","child","index","Item","key","concat"],"mappings":"+nBAiBA,IAAMA,EAA0C,SAACC,CAAAA,EAC7C,UAAMC,EAAwBD,EAAtBC,QAAAA,CAAaC,EAASF,sXAAAA,EAAAA,CAAtBC,aAEFE,EAAgBC,EAAMC,QAAQ,CAACC,OAAO,CAACN,EAAMO,QAAQ,EACrDC,EAAiBP,GAAYE,EAAcM,MAAM,CAAGR,EAEtDS,EAA+D,EAAE,CACjEC,EAA6D,EAAE,CAE/DH,IACIP,EAAW,GACXS,EAAiBP,EAAcS,KAAK,CAAC,CAAEX,CAAAA,EAAW,CAAA,GAClDU,EAAeR,EAAcS,KAAK,CAAC,EAAG,CAACF,EAAeD,MAAM,GACxC,IAAbR,GACPU,CAAAA,EAAeR,EAAcS,KAAK,CAAC,EAAA,GAI3C,IAAMC,EAAab,EAAMa,UAAU,EAAI,MAEvC,OACI,WAAA,EAAAT,gBAACU,KACOZ,EAAAA,CAAAA,EAAAA,OAAAA,CACJa,QAASC,EAAA,CAAEC,UAAW,kCAAuCf,EAAAA,EAAKa,OAAO,EACzEG,UAAWC,EAAG,yBAA0BjB,EAAKgB,SAAS,CAErD,8UAAA,CAACV,GAAkBR,EAAMO,QAAQ,CACjCC,GAAkB,CACfL,CAAa,CAAC,EAAE,CAChBQ,EAAaF,MAAM,CAAG,GAClB,WAAA,EAAAL,EAACgB,aAAAA,CAAAA,EAAAA,CAAKP,WAAY,WAAA,EAAAT,EAAAiB,aAAA,CAACD,EAAKE,MAAM,CAAET,KAAAA,IAC3BF,EAAaY,GAAG,CAAC,SAACC,CAAOC,CAAAA,CAAAA,EACtB,OAAA,WAAA,EAAArB,EAAAiB,aAAA,CAACD,EAAKM,IAAI,CAAA,CAACC,IAAKF,CAAQD,EAAAA,MAKvC,CAVkBI,sDASZlB,mlBAInB"}
|