@hitachivantara/uikit-react-lab 3.54.0 → 3.56.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/dist/Controls/Controls.d.ts +2 -10
- package/dist/Controls/RightControl/RightControl.d.ts +1 -1
- package/dist/StepNavigation/DefaultNavigation/DefaultNavigation.d.ts +3 -1
- package/dist/StepNavigation/DefaultNavigation/DefaultNavigation.js +2 -7
- package/dist/StepNavigation/DefaultNavigation/DefaultNavigation.js.map +1 -1
- package/dist/StepNavigation/DefaultNavigation/Step/Step.d.ts +7 -2
- package/dist/StepNavigation/DefaultNavigation/Step/Step.js +11 -4
- package/dist/StepNavigation/DefaultNavigation/Step/Step.js.map +1 -1
- package/dist/StepNavigation/DefaultNavigation/utils.js +3 -2
- package/dist/StepNavigation/DefaultNavigation/utils.js.map +1 -1
- package/dist/StepNavigation/SimpleNavigation/Dot/Dot.d.ts +1 -1
- package/dist/StepNavigation/SimpleNavigation/Dot/Dot.js +13 -9
- package/dist/StepNavigation/SimpleNavigation/Dot/Dot.js.map +1 -1
- package/dist/StepNavigation/SimpleNavigation/SimpleNavigation.d.ts +3 -1
- package/dist/StepNavigation/SimpleNavigation/SimpleNavigation.js +2 -9
- package/dist/StepNavigation/SimpleNavigation/SimpleNavigation.js.map +1 -1
- package/dist/StepNavigation/SimpleNavigation/utils.js +10 -8
- package/dist/StepNavigation/SimpleNavigation/utils.js.map +1 -1
- package/dist/StepNavigation/StepNavigation.d.ts +6 -5
- package/dist/StepNavigation/StepNavigation.js +21 -9
- package/dist/StepNavigation/StepNavigation.js.map +1 -1
- package/dist/Table/TableBody/TableBody.d.ts +4 -0
- package/dist/legacy/Controls/Controls.d.ts +2 -10
- package/dist/legacy/Controls/RightControl/RightControl.d.ts +1 -1
- package/dist/legacy/StepNavigation/DefaultNavigation/DefaultNavigation.d.ts +3 -1
- package/dist/legacy/StepNavigation/DefaultNavigation/DefaultNavigation.js +3 -8
- package/dist/legacy/StepNavigation/DefaultNavigation/DefaultNavigation.js.map +1 -1
- package/dist/legacy/StepNavigation/DefaultNavigation/Step/Step.d.ts +7 -2
- package/dist/legacy/StepNavigation/DefaultNavigation/Step/Step.js +11 -4
- package/dist/legacy/StepNavigation/DefaultNavigation/Step/Step.js.map +1 -1
- package/dist/legacy/StepNavigation/DefaultNavigation/utils.js +3 -2
- package/dist/legacy/StepNavigation/DefaultNavigation/utils.js.map +1 -1
- package/dist/legacy/StepNavigation/SimpleNavigation/Dot/Dot.d.ts +1 -1
- package/dist/legacy/StepNavigation/SimpleNavigation/Dot/Dot.js +15 -11
- package/dist/legacy/StepNavigation/SimpleNavigation/Dot/Dot.js.map +1 -1
- package/dist/legacy/StepNavigation/SimpleNavigation/SimpleNavigation.d.ts +3 -1
- package/dist/legacy/StepNavigation/SimpleNavigation/SimpleNavigation.js +3 -9
- package/dist/legacy/StepNavigation/SimpleNavigation/SimpleNavigation.js.map +1 -1
- package/dist/legacy/StepNavigation/SimpleNavigation/utils.js +9 -5
- package/dist/legacy/StepNavigation/SimpleNavigation/utils.js.map +1 -1
- package/dist/legacy/StepNavigation/StepNavigation.d.ts +6 -5
- package/dist/legacy/StepNavigation/StepNavigation.js +21 -9
- package/dist/legacy/StepNavigation/StepNavigation.js.map +1 -1
- package/dist/legacy/Table/TableBody/TableBody.d.ts +4 -0
- package/dist/modern/Controls/Controls.d.ts +2 -10
- package/dist/modern/Controls/RightControl/RightControl.d.ts +1 -1
- package/dist/modern/StepNavigation/DefaultNavigation/DefaultNavigation.d.ts +3 -1
- package/dist/modern/StepNavigation/DefaultNavigation/DefaultNavigation.js +3 -6
- package/dist/modern/StepNavigation/DefaultNavigation/DefaultNavigation.js.map +1 -1
- package/dist/modern/StepNavigation/DefaultNavigation/Step/Step.d.ts +7 -2
- package/dist/modern/StepNavigation/DefaultNavigation/Step/Step.js +11 -4
- package/dist/modern/StepNavigation/DefaultNavigation/Step/Step.js.map +1 -1
- package/dist/modern/StepNavigation/DefaultNavigation/utils.js +3 -2
- package/dist/modern/StepNavigation/DefaultNavigation/utils.js.map +1 -1
- package/dist/modern/StepNavigation/SimpleNavigation/Dot/Dot.d.ts +1 -1
- package/dist/modern/StepNavigation/SimpleNavigation/Dot/Dot.js +15 -9
- package/dist/modern/StepNavigation/SimpleNavigation/Dot/Dot.js.map +1 -1
- package/dist/modern/StepNavigation/SimpleNavigation/SimpleNavigation.d.ts +3 -1
- package/dist/modern/StepNavigation/SimpleNavigation/SimpleNavigation.js +3 -7
- package/dist/modern/StepNavigation/SimpleNavigation/SimpleNavigation.js.map +1 -1
- package/dist/modern/StepNavigation/SimpleNavigation/utils.js +7 -5
- package/dist/modern/StepNavigation/SimpleNavigation/utils.js.map +1 -1
- package/dist/modern/StepNavigation/StepNavigation.d.ts +6 -5
- package/dist/modern/StepNavigation/StepNavigation.js +21 -9
- package/dist/modern/StepNavigation/StepNavigation.js.map +1 -1
- package/dist/modern/Table/TableBody/TableBody.d.ts +4 -0
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["getColor","state","theme","Pending","hv","palette","semantic","sema3","Failed","sema4","Completed","sema1","Current","accent","acce1","Disabled","atmosphere","atmo5","EXTRA_SMALL","container","avatar","SMALL","MEDIUM","LARGE","EXTRA_LARGE","stepSizes","XS","SM","MD","LG","XL"],"sources":["../../../../src/StepNavigation/DefaultNavigation/utils.js"],"sourcesContent":["const getColor = (state, theme) =>\n ({\n Pending: theme?.hv?.palette?.semantic?.sema3 ?? \"sema3\",\n Failed: theme?.hv?.palette?.semantic?.sema4 ?? \"sema4\",\n Completed: theme?.hv?.palette?.semantic?.sema1 ?? \"sema1\",\n Current: theme?.hv?.palette?.accent?.acce1 ?? \"acce1\",\n Disabled: theme?.hv?.palette?.atmosphere?.atmo5 ?? \"atmo5\",\n }[state]);\n\nconst EXTRA_SMALL = { container: 32, avatar: 24 };\nconst SMALL = { container: 40, avatar: 32 };\nconst MEDIUM = { container: 48, avatar: 40 };\nconst LARGE = { container: 60, avatar: 52 };\nconst EXTRA_LARGE = { container: 96, avatar: 88 };\n\nconst stepSizes = {\n XS: EXTRA_SMALL,\n SM: SMALL,\n MD: MEDIUM,\n LG: LARGE,\n XL: EXTRA_LARGE,\n};\n\nexport { getColor, stepSizes };\n"],"mappings":"AAAA,MAAMA,QAAQ,GAAG,CAACC,KAAD,EAAQC,KAAR;EAAA;;EAAA,OACd;IACCC,OAAO,2BAAED,KAAF,aAAEA,KAAF,oCAAEA,KAAK,CAAEE,EAAT,mEAAE,UAAWC,OAAb,gFAAE,kBAAoBC,QAAtB,2DAAE,uBAA8BC,KAAhC,yEAAyC,OADjD;IAECC,MAAM,4BAAEN,KAAF,aAAEA,KAAF,qCAAEA,KAAK,CAAEE,EAAT,qEAAE,WAAWC,OAAb,gFAAE,mBAAoBC,QAAtB,0DAAE,sBAA8BG,KAAhC,2EAAyC,OAFhD;IAGCC,SAAS,4BAAER,KAAF,aAAEA,KAAF,qCAAEA,KAAK,CAAEE,EAAT,qEAAE,WAAWC,OAAb,gFAAE,mBAAoBC,QAAtB,0DAAE,sBAA8BK,KAAhC,2EAAyC,OAHnD;IAICC,OAAO,2BAAEV,KAAF,aAAEA,KAAF,qCAAEA,KAAK,CAAEE,EAAT,qEAAE,WAAWC,OAAb,gFAAE,mBAAoBQ,MAAtB,0DAAE,sBAA4BC,KAA9B,yEAAuC,OAJ/C;IAKCC,QAAQ,2BAAEb,KAAF,aAAEA,KAAF,qCAAEA,KAAK,CAAEE,EAAT,qEAAE,WAAWC,OAAb,gFAAE,mBAAoBW,UAAtB,0DAAE,sBAAgCC,KAAlC,yEAA2C;
|
|
1
|
+
{"version":3,"file":"utils.js","names":["getColor","state","theme","Pending","hv","palette","semantic","sema3","Failed","sema4","Completed","sema1","Current","accent","acce1","Disabled","atmosphere","atmo5","Enabled","EXTRA_SMALL","container","avatar","SMALL","MEDIUM","LARGE","EXTRA_LARGE","stepSizes","XS","SM","MD","LG","XL"],"sources":["../../../../src/StepNavigation/DefaultNavigation/utils.js"],"sourcesContent":["const getColor = (state, theme) =>\n ({\n Pending: theme?.hv?.palette?.semantic?.sema3 ?? \"sema3\",\n Failed: theme?.hv?.palette?.semantic?.sema4 ?? \"sema4\",\n Completed: theme?.hv?.palette?.semantic?.sema1 ?? \"sema1\",\n Current: theme?.hv?.palette?.accent?.acce1 ?? \"acce1\",\n Disabled: theme?.hv?.palette?.atmosphere?.atmo5 ?? \"atmo5\",\n Enabled: theme?.hv?.palette?.accent?.acce1 ?? \"acce1\",\n }[state]);\n\nconst EXTRA_SMALL = { container: 32, avatar: 24 };\nconst SMALL = { container: 40, avatar: 32 };\nconst MEDIUM = { container: 48, avatar: 40 };\nconst LARGE = { container: 60, avatar: 52 };\nconst EXTRA_LARGE = { container: 96, avatar: 88 };\n\nconst stepSizes = {\n XS: EXTRA_SMALL,\n SM: SMALL,\n MD: MEDIUM,\n LG: LARGE,\n XL: EXTRA_LARGE,\n};\n\nexport { getColor, stepSizes };\n"],"mappings":"AAAA,MAAMA,QAAQ,GAAG,CAACC,KAAD,EAAQC,KAAR;EAAA;;EAAA,OACd;IACCC,OAAO,2BAAED,KAAF,aAAEA,KAAF,oCAAEA,KAAK,CAAEE,EAAT,mEAAE,UAAWC,OAAb,gFAAE,kBAAoBC,QAAtB,2DAAE,uBAA8BC,KAAhC,yEAAyC,OADjD;IAECC,MAAM,4BAAEN,KAAF,aAAEA,KAAF,qCAAEA,KAAK,CAAEE,EAAT,qEAAE,WAAWC,OAAb,gFAAE,mBAAoBC,QAAtB,0DAAE,sBAA8BG,KAAhC,2EAAyC,OAFhD;IAGCC,SAAS,4BAAER,KAAF,aAAEA,KAAF,qCAAEA,KAAK,CAAEE,EAAT,qEAAE,WAAWC,OAAb,gFAAE,mBAAoBC,QAAtB,0DAAE,sBAA8BK,KAAhC,2EAAyC,OAHnD;IAICC,OAAO,2BAAEV,KAAF,aAAEA,KAAF,qCAAEA,KAAK,CAAEE,EAAT,qEAAE,WAAWC,OAAb,gFAAE,mBAAoBQ,MAAtB,0DAAE,sBAA4BC,KAA9B,yEAAuC,OAJ/C;IAKCC,QAAQ,2BAAEb,KAAF,aAAEA,KAAF,qCAAEA,KAAK,CAAEE,EAAT,qEAAE,WAAWC,OAAb,gFAAE,mBAAoBW,UAAtB,0DAAE,sBAAgCC,KAAlC,yEAA2C,OALpD;IAMCC,OAAO,4BAAEhB,KAAF,aAAEA,KAAF,qCAAEA,KAAK,CAAEE,EAAT,qEAAE,WAAWC,OAAb,gFAAE,mBAAoBQ,MAAtB,0DAAE,sBAA4BC,KAA9B,2EAAuC;EAN/C,EAOCb,KAPD,CADc;AAAA,CAAjB;;AAUA,MAAMkB,WAAW,GAAG;EAAEC,SAAS,EAAE,EAAb;EAAiBC,MAAM,EAAE;AAAzB,CAApB;AACA,MAAMC,KAAK,GAAG;EAAEF,SAAS,EAAE,EAAb;EAAiBC,MAAM,EAAE;AAAzB,CAAd;AACA,MAAME,MAAM,GAAG;EAAEH,SAAS,EAAE,EAAb;EAAiBC,MAAM,EAAE;AAAzB,CAAf;AACA,MAAMG,KAAK,GAAG;EAAEJ,SAAS,EAAE,EAAb;EAAiBC,MAAM,EAAE;AAAzB,CAAd;AACA,MAAMI,WAAW,GAAG;EAAEL,SAAS,EAAE,EAAb;EAAiBC,MAAM,EAAE;AAAzB,CAApB;AAEA,MAAMK,SAAS,GAAG;EAChBC,EAAE,EAAER,WADY;EAEhBS,EAAE,EAAEN,KAFY;EAGhBO,EAAE,EAAEN,MAHY;EAIhBO,EAAE,EAAEN,KAJY;EAKhBO,EAAE,EAAEN;AALY,CAAlB;AAQA,SAASzB,QAAT,EAAmB0B,SAAnB"}
|
|
@@ -5,6 +5,6 @@ import { HvStepProps } from "../../DefaultNavigation/Step";
|
|
|
5
5
|
export type HvDotClassKey = "root";
|
|
6
6
|
|
|
7
7
|
export type HvDotProps = StandardProps<React.HTMLAttributes<HTMLDivElement>, HvDotClassKey> &
|
|
8
|
-
Pick<HvStepProps, "size" | "title" | "state" | "onClick">;
|
|
8
|
+
Pick<HvStepProps, "size" | "title" | "state" | "onClick" | "disabled">;
|
|
9
9
|
|
|
10
10
|
export default function HvDot(props: HvDotProps): JSX.Element | null;
|
|
@@ -5,12 +5,12 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
|
|
8
|
-
import React, {
|
|
8
|
+
import React, { useMemo } from "react";
|
|
9
9
|
import PropTypes from "prop-types";
|
|
10
10
|
import clsx from "clsx";
|
|
11
11
|
import { HvButton } from "@hitachivantara/uikit-react-core";
|
|
12
12
|
import { makeStyles, withStyles } from "@material-ui/core";
|
|
13
|
-
import {
|
|
13
|
+
import { getColor, dotSizes } from "../utils";
|
|
14
14
|
import styles from "./styles";
|
|
15
15
|
/**
|
|
16
16
|
* Step element of "Simple" Step Navigation root component
|
|
@@ -22,12 +22,12 @@ const HvDot = ({
|
|
|
22
22
|
state,
|
|
23
23
|
title,
|
|
24
24
|
size,
|
|
25
|
-
onClick
|
|
25
|
+
onClick,
|
|
26
|
+
disabled
|
|
26
27
|
}) => {
|
|
27
28
|
const dotSize = dotSizes[size] * (state === "Current" ? 1.5 : 1);
|
|
28
|
-
const getBackgroundColor = useCallback(theme => state === "Disabled" ? disabledColor(theme) : defaultColor(theme), [state]);
|
|
29
29
|
const customClasses = useMemo(() => makeStyles(theme => {
|
|
30
|
-
const backgroundColor =
|
|
30
|
+
const backgroundColor = getColor(state, theme);
|
|
31
31
|
return {
|
|
32
32
|
ghostDisabled: {},
|
|
33
33
|
active: {},
|
|
@@ -46,13 +46,13 @@ const HvDot = ({
|
|
|
46
46
|
})
|
|
47
47
|
})
|
|
48
48
|
};
|
|
49
|
-
}), [dotSize,
|
|
49
|
+
}), [dotSize, state])();
|
|
50
50
|
return /*#__PURE__*/React.createElement(HvButton, {
|
|
51
|
-
className: clsx(classes.root, customClasses.ghost,
|
|
51
|
+
className: clsx(classes.root, customClasses.ghost, (disabled !== null && disabled !== void 0 ? disabled : "Current Disabled".includes(state)) && customClasses.ghostDisabled, className, state === "Current" && customClasses.active),
|
|
52
52
|
"aria-label": `step-${title}`,
|
|
53
53
|
icon: true,
|
|
54
54
|
overrideIconColors: false,
|
|
55
|
-
disabled: ["Current", "Disabled"].includes(state),
|
|
55
|
+
disabled: disabled !== null && disabled !== void 0 ? disabled : ["Current", "Disabled"].includes(state),
|
|
56
56
|
onClick: onClick
|
|
57
57
|
}, []);
|
|
58
58
|
};
|
|
@@ -106,7 +106,13 @@ process.env.NODE_ENV !== "production" ? HvDot.propTypes = {
|
|
|
106
106
|
/**
|
|
107
107
|
* Event onClick of the step.
|
|
108
108
|
*/
|
|
109
|
-
onClick: PropTypes.func
|
|
109
|
+
onClick: PropTypes.func,
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Define if a step is disabled/enabled.
|
|
113
|
+
* If this property is not defined and the step is on state "Disabled", the step component will be disabled
|
|
114
|
+
*/
|
|
115
|
+
disabled: PropTypes.bool
|
|
110
116
|
} : void 0;
|
|
111
117
|
export default withStyles(styles, {
|
|
112
118
|
name: "HvDot"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dot.js","names":["React","
|
|
1
|
+
{"version":3,"file":"Dot.js","names":["React","useMemo","PropTypes","clsx","HvButton","makeStyles","withStyles","getColor","dotSizes","styles","HvDot","classes","className","state","title","size","onClick","disabled","dotSize","customClasses","theme","backgroundColor","ghostDisabled","active","ghost","width","height","root","includes","propTypes","string","shape","isRequired","oneOf","func","bool","name"],"sources":["../../../../../src/StepNavigation/SimpleNavigation/Dot/Dot.js"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\n\nimport { HvButton } from \"@hitachivantara/uikit-react-core\";\nimport { makeStyles, withStyles } from \"@material-ui/core\";\n\nimport { getColor, dotSizes } from \"../utils\";\nimport styles from \"./styles\";\n\n/**\n * Step element of \"Simple\" Step Navigation root component\n */\nconst HvDot = ({ classes, className, state, title, size, onClick, disabled }) => {\n const dotSize = dotSizes[size] * (state === \"Current\" ? 1.5 : 1);\n const customClasses = useMemo(\n () =>\n makeStyles((theme) => {\n const backgroundColor = getColor(state, theme);\n return {\n ghostDisabled: {},\n active: {},\n ghost: {\n ...styles.ghost,\n width: dotSize,\n height: dotSize,\n backgroundColor,\n \"&:hover\": {\n backgroundColor,\n },\n \"&$ghostDisabled\": {\n ...styles.ghost[\"&$ghostDisabled\"],\n backgroundColor,\n },\n \"&$ghostDisabled&:hover\": {\n ...styles.ghost[\"&$ghostDisabled&:hover\"],\n backgroundColor,\n },\n },\n };\n }),\n [dotSize, state]\n )();\n return (\n <HvButton\n className={clsx(\n classes.root,\n customClasses.ghost,\n {\n [customClasses.active]: state === \"Current\",\n [customClasses.ghostDisabled]: disabled ?? [\"Current\", \"Disabled\"].includes(state),\n },\n className\n )}\n aria-label={`step-${title}`}\n icon\n overrideIconColors={false}\n disabled={disabled ?? [\"Current\", \"Disabled\"].includes(state)}\n onClick={onClick}\n >\n {[]}\n </HvButton>\n );\n};\n\nHvDot.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the active class.\n */\n active: PropTypes.string,\n /**\n * Styles applied to the ghost class.\n */\n ghost: PropTypes.string,\n /**\n * Styles applied to the ghostDisabled class.\n */\n ghostDisabled: PropTypes.string,\n }).isRequired,\n /**\n * State of the step. Values = {\"Pending\", \"Failed\", \"Completed\", \"Current\", \"Disabled\"}\n */\n state: PropTypes.oneOf([\"Pending\", \"Failed\", \"Completed\", \"Current\", \"Disabled\"]).isRequired,\n /**\n * Title of the step.\n */\n title: PropTypes.string.isRequired,\n /**\n * Sets one of the standard sizes of the steps\n */\n size: PropTypes.oneOf([\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"]).isRequired,\n /**\n * Event onClick of the step.\n */\n onClick: PropTypes.func,\n /**\n * Define if a step is disabled/enabled.\n * If this property is not defined and the step is on state \"Disabled\", the step component will be disabled\n */\n disabled: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvDot\" })(HvDot);\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,IAAgBC,OAAhB,QAA+B,OAA/B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AAEA,SAASC,QAAT,QAAyB,kCAAzB;AACA,SAASC,UAAT,EAAqBC,UAArB,QAAuC,mBAAvC;AAEA,SAASC,QAAT,EAAmBC,QAAnB,QAAmC,UAAnC;AACA,OAAOC,MAAP,MAAmB,UAAnB;AAEA;AACA;AACA;;AACA,MAAMC,KAAK,GAAG,CAAC;EAAEC,OAAF;EAAWC,SAAX;EAAsBC,KAAtB;EAA6BC,KAA7B;EAAoCC,IAApC;EAA0CC,OAA1C;EAAmDC;AAAnD,CAAD,KAAmE;EAC/E,MAAMC,OAAO,GAAGV,QAAQ,CAACO,IAAD,CAAR,IAAkBF,KAAK,KAAK,SAAV,GAAsB,GAAtB,GAA4B,CAA9C,CAAhB;EACA,MAAMM,aAAa,GAAGlB,OAAO,CAC3B,MACEI,UAAU,CAAEe,KAAD,IAAW;IACpB,MAAMC,eAAe,GAAGd,QAAQ,CAACM,KAAD,EAAQO,KAAR,CAAhC;IACA,OAAO;MACLE,aAAa,EAAE,EADV;MAELC,MAAM,EAAE,EAFH;MAGLC,KAAK,kCACAf,MAAM,CAACe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IACIR,aAAa,EAAEpB,SAAS,CAAC4B;EAhBF,CAAhB,EAiBNE,UAzBa;;EA0BhB;AACF;AACA;EACEnB,KAAK,EAAEX,SAAS,CAAC+B,KAAV,CAAgB,CAAC,SAAD,EAAY,QAAZ,EAAsB,WAAtB,EAAmC,SAAnC,EAA8C,UAA9C,CAAhB,EAA2ED,UA7BlE;;EA8BhB;AACF;AACA;EACElB,KAAK,EAAEZ,SAAS,CAAC4B,MAAV,CAAiBE,UAjCR;;EAkChB;AACF;AACA;EACEjB,IAAI,EAAEb,SAAS,CAAC+B,KAAV,CAAgB,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,EAAyB,IAAzB,CAAhB,EAAgDD,UArCtC;;EAsChB;AACF;AACA;EACEhB,OAAO,EAAEd,SAAS,CAACgC,IAzCH;;EA0ChB;AACF;AACA;AACA;EACEjB,QAAQ,EAAEf,SAAS,CAACiC;AA9CJ,CAAlB;AAiDA,eAAe7B,UAAU,CAACG,MAAD,EAAS;EAAE2B,IAAI,EAAE;AAAR,CAAT,CAAV,CAAsC1B,KAAtC,CAAf"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { StandardProps } from "@material-ui/core";
|
|
3
3
|
|
|
4
|
+
import { HvTheme } from "@hitachivantara/uikit-react-core";
|
|
5
|
+
|
|
4
6
|
import { HvStepNavigationProps } from "../StepNavigation";
|
|
5
7
|
import { HvDotProps } from "./Dot";
|
|
6
8
|
|
|
@@ -12,7 +14,7 @@ export type ComponentChildProps = {
|
|
|
12
14
|
separatorValues: {
|
|
13
15
|
minWidth: number;
|
|
14
16
|
maxWidth: number;
|
|
15
|
-
getColor: (state: HvDotProps["state"]) => any;
|
|
17
|
+
getColor: (state: HvDotProps["state"], theme: HvTheme) => any;
|
|
16
18
|
height: number;
|
|
17
19
|
};
|
|
18
20
|
stepValues: {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
const _excluded = ["numSteps", "stepSize", "getTitles", "getDynamicValues", "children"];
|
|
3
|
-
import "core-js/modules/es.array.includes.js";
|
|
4
3
|
import React from "react";
|
|
5
4
|
import PropTypes from "prop-types";
|
|
6
|
-
import {
|
|
5
|
+
import { withStyles } from "@material-ui/core";
|
|
7
6
|
import HvDot from "./Dot";
|
|
8
|
-
import {
|
|
7
|
+
import { getColor, dotSizes } from "./utils";
|
|
9
8
|
import styles from "./styles";
|
|
10
9
|
/**
|
|
11
10
|
* Simple Navigation
|
|
@@ -21,8 +20,7 @@ const HvSimpleNavigation = _ref => {
|
|
|
21
20
|
} = _ref,
|
|
22
21
|
other = _objectWithoutProperties(_ref, _excluded);
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
// step values
|
|
26
24
|
const dotSize = dotSizes[stepSize];
|
|
27
25
|
const StepComponent = HvDot; //
|
|
28
26
|
|
|
@@ -33,8 +31,6 @@ const HvSimpleNavigation = _ref => {
|
|
|
33
31
|
separatorWidth
|
|
34
32
|
} = getDynamicValues(stepsWidth); // separator values
|
|
35
33
|
|
|
36
|
-
const getColor = state => ["Current", "Disabled"].includes(state) ? disabledColor(theme) : defaultColor(theme);
|
|
37
|
-
|
|
38
34
|
const maxWidth = Math.max(titleWidth - dotSize, separatorWidth);
|
|
39
35
|
const minWidth = Math.max(titleWidth - dotSize * 1.25, separatorWidth); //
|
|
40
36
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleNavigation.js","names":["React","PropTypes","
|
|
1
|
+
{"version":3,"file":"SimpleNavigation.js","names":["React","PropTypes","withStyles","HvDot","getColor","dotSizes","styles","HvSimpleNavigation","numSteps","stepSize","getTitles","getDynamicValues","children","other","dotSize","StepComponent","stepsWidth","width","titleWidth","separatorWidth","maxWidth","Math","max","minWidth","Steps","titles","rawTitle","number","title","navWidth","separatorValues","height","stepValues","minSize","maxSize","propTypes","className","string","classes","shape","root","isRequired","oneOf","func","elementType","name"],"sources":["../../../../src/StepNavigation/SimpleNavigation/SimpleNavigation.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport { withStyles } from \"@material-ui/core\";\n\nimport HvDot from \"./Dot\";\nimport { getColor, dotSizes } from \"./utils\";\nimport styles from \"./styles\";\n\n/**\n * Simple Navigation\n */\nconst HvSimpleNavigation = ({\n numSteps,\n stepSize,\n getTitles,\n getDynamicValues,\n children,\n ...other\n}) => {\n // step values\n const dotSize = dotSizes[stepSize];\n const StepComponent = HvDot;\n //\n\n const stepsWidth = (numSteps + 0.5) * dotSize;\n const { width, titleWidth, separatorWidth } = getDynamicValues(stepsWidth);\n\n // separator values\n const maxWidth = Math.max(titleWidth - dotSize, separatorWidth);\n const minWidth = Math.max(titleWidth - dotSize * 1.25, separatorWidth);\n //\n\n const Steps = children;\n\n const titles = getTitles(({ rawTitle, number }) => ({\n title: `${number}. ${rawTitle}`,\n titleWidth,\n }));\n\n return (\n <div {...other}>\n {titles}\n <Steps\n {...{\n stepsWidth,\n navWidth: width,\n separatorValues: {\n minWidth,\n maxWidth,\n getColor,\n height: 2,\n },\n stepValues: {\n minSize: dotSize,\n maxSize: 1.5 * dotSize,\n StepComponent,\n },\n }}\n />\n </div>\n );\n};\n\nHvSimpleNavigation.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n }).isRequired,\n /**\n * Number of steps to show on the component.\n */\n numSteps: PropTypes.number.isRequired,\n /**\n * Sets one of the standard sizes of the steps\n */\n stepSize: PropTypes.oneOf([\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"]).isRequired,\n /**\n * Returns dynamic width values of the component (width, titleWidth, separatorWidth).\n */\n getDynamicValues: PropTypes.func.isRequired,\n /**\n * Returns a JSX.element of the titles container.\n */\n getTitles: PropTypes.func.isRequired,\n /**\n * Component to render Step Navigation with props = {separatorValues, stepValues, stepsWidth}\n */\n children: PropTypes.elementType.isRequired,\n};\n\nexport default withStyles(styles, { name: \"HvSimpleNavigation\" })(HvSimpleNavigation);\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAASC,UAAT,QAA2B,mBAA3B;AAEA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAASC,QAAT,EAAmBC,QAAnB,QAAmC,SAAnC;AACA,OAAOC,MAAP,MAAmB,UAAnB;AAEA;AACA;AACA;;AACA,MAAMC,kBAAkB,GAAG,QAOrB;EAAA,IAPsB;IAC1BC,QAD0B;IAE1BC,QAF0B;IAG1BC,SAH0B;IAI1BC,gBAJ0B;IAK1BC;EAL0B,CAOtB;EAAA,IADDC,KACC;;EACJ;EACA,MAAMC,OAAO,GAAGT,QAAQ,CAACI,QAAD,CAAxB;EACA,MAAMM,aAAa,GAAGZ,KAAtB,CAHI,CAIJ;;EAEA,MAAMa,UAAU,GAAG,CAACR,QAAQ,GAAG,GAAZ,IAAmBM,OAAtC;EACA,MAAM;IAAEG,KAAF;IAASC,UAAT;IAAqBC;EAArB,IAAwCR,gBAAgB,CAACK,UAAD,CAA9D,CAPI,CASJ;;EACA,MAAMI,QAAQ,GAAGC,IAAI,CAACC,GAAL,CAASJ,UAAU,GAAGJ,OAAtB,EAA+BK,cAA/B,CAAjB;EACA,MAAMI,QAAQ,GAAGF,IAAI,CAACC,GAAL,CAASJ,UAAU,GAAGJ,OAAO,GAAG,IAAhC,EAAsCK,cAAtC,CAAjB,CAXI,CAYJ;;EAEA,MAAMK,KAAK,GAAGZ,QAAd;EAEA,MAAMa,MAAM,GAAGf,SAAS,CAAC,CAAC;IAAEgB,QAAF;IAAYC;EAAZ,CAAD,MAA2B;IAClDC,KAAK,EAAG,GAAED,MAAO,KAAID,QAAS,EADoB;IAElDR;EAFkD,CAA3B,CAAD,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|
10
|
-
var _theme$hv, _theme$hv$palette, _theme$hv$palette$
|
|
10
|
+
var _theme$hv$palette$acc, _theme$hv, _theme$hv$palette, _theme$hv$palette$acc2;
|
|
11
11
|
|
|
12
|
-
return theme === null || theme === void 0 ? void 0 : (_theme$hv = theme.hv) === null || _theme$hv === void 0 ? void 0 : (_theme$hv$palette = _theme$hv.palette) === null || _theme$hv$palette === void 0 ? void 0 : (_theme$hv$palette$
|
|
12
|
+
return (_theme$hv$palette$acc = theme === null || theme === void 0 ? void 0 : (_theme$hv = theme.hv) === null || _theme$hv === void 0 ? void 0 : (_theme$hv$palette = _theme$hv.palette) === null || _theme$hv$palette === void 0 ? void 0 : (_theme$hv$palette$acc2 = _theme$hv$palette.accent) === null || _theme$hv$palette$acc2 === void 0 ? void 0 : _theme$hv$palette$acc2.acce1) !== null && _theme$hv$palette$acc !== void 0 ? _theme$hv$palette$acc : "acce1";
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
const disabledColor = theme => {
|
|
16
|
-
var _theme$hv2, _theme$hv2$palette, _theme$hv2$palette$at;
|
|
16
|
+
var _theme$hv$palette$atm, _theme$hv2, _theme$hv2$palette, _theme$hv2$palette$at;
|
|
17
17
|
|
|
18
|
-
return theme === null || theme === void 0 ? void 0 : (_theme$hv2 = theme.hv) === null || _theme$hv2 === void 0 ? void 0 : (_theme$hv2$palette = _theme$hv2.palette) === null || _theme$hv2$palette === void 0 ? void 0 : (_theme$hv2$palette$at = _theme$hv2$palette.atmosphere) === null || _theme$hv2$palette$at === void 0 ? void 0 : _theme$hv2$palette$at.atmo5;
|
|
18
|
+
return (_theme$hv$palette$atm = theme === null || theme === void 0 ? void 0 : (_theme$hv2 = theme.hv) === null || _theme$hv2 === void 0 ? void 0 : (_theme$hv2$palette = _theme$hv2.palette) === null || _theme$hv2$palette === void 0 ? void 0 : (_theme$hv2$palette$at = _theme$hv2$palette.atmosphere) === null || _theme$hv2$palette$at === void 0 ? void 0 : _theme$hv2$palette$at.atmo5) !== null && _theme$hv$palette$atm !== void 0 ? _theme$hv$palette$atm : "atmo5";
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
const getColor = (state, theme) => state === "Disabled" ? disabledColor(theme) : defaultColor(theme);
|
|
22
|
+
|
|
23
|
+
export { dotSizes, getColor };
|
|
22
24
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["dotSizes","XS","SM","MD","LG","XL","defaultColor","theme","hv","palette","accent","acce1","disabledColor","atmosphere","atmo5"],"sources":["../../../../src/StepNavigation/SimpleNavigation/utils.js"],"sourcesContent":["const dotSizes = {\n XS: 8,\n SM: 10,\n MD: 12,\n LG: 14,\n XL: 16,\n};\n\nconst defaultColor = (theme) => theme?.hv?.palette?.accent?.acce1;\nconst disabledColor = (theme) => theme?.hv?.palette?.atmosphere?.atmo5;\n\nexport { dotSizes,
|
|
1
|
+
{"version":3,"file":"utils.js","names":["dotSizes","XS","SM","MD","LG","XL","defaultColor","theme","hv","palette","accent","acce1","disabledColor","atmosphere","atmo5","getColor","state"],"sources":["../../../../src/StepNavigation/SimpleNavigation/utils.js"],"sourcesContent":["const dotSizes = {\n XS: 8,\n SM: 10,\n MD: 12,\n LG: 14,\n XL: 16,\n};\n\nconst defaultColor = (theme) => theme?.hv?.palette?.accent?.acce1 ?? \"acce1\";\nconst disabledColor = (theme) => theme?.hv?.palette?.atmosphere?.atmo5 ?? \"atmo5\";\n\nconst getColor = (state, theme) =>\n state === \"Disabled\" ? disabledColor(theme) : defaultColor(theme);\n\nexport { dotSizes, getColor };\n"],"mappings":"AAAA,MAAMA,QAAQ,GAAG;EACfC,EAAE,EAAE,CADW;EAEfC,EAAE,EAAE,EAFW;EAGfC,EAAE,EAAE,EAHW;EAIfC,EAAE,EAAE,EAJW;EAKfC,EAAE,EAAE;AALW,CAAjB;;AAQA,MAAMC,YAAY,GAAIC,KAAD;EAAA;;EAAA,gCAAWA,KAAX,aAAWA,KAAX,oCAAWA,KAAK,CAAEC,EAAlB,mEAAW,UAAWC,OAAtB,gFAAW,kBAAoBC,MAA/B,2DAAW,uBAA4BC,KAAvC,yEAAgD,OAAhD;AAAA,CAArB;;AACA,MAAMC,aAAa,GAAIL,KAAD;EAAA;;EAAA,gCAAWA,KAAX,aAAWA,KAAX,qCAAWA,KAAK,CAAEC,EAAlB,qEAAW,WAAWC,OAAtB,gFAAW,mBAAoBI,UAA/B,0DAAW,sBAAgCC,KAA3C,yEAAoD,OAApD;AAAA,CAAtB;;AAEA,MAAMC,QAAQ,GAAG,CAACC,KAAD,EAAQT,KAAR,KACfS,KAAK,KAAK,UAAV,GAAuBJ,aAAa,CAACL,KAAD,CAApC,GAA8CD,YAAY,CAACC,KAAD,CAD5D;;AAGA,SAASP,QAAT,EAAmBe,QAAnB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { StandardProps } from "@material-ui/core";
|
|
3
|
+
import { Breakpoint } from "@material-ui/core/styles/createBreakpoints";
|
|
3
4
|
import { HvStepProps } from "./DefaultNavigation/Step/Step";
|
|
4
5
|
|
|
5
6
|
export type HvStepNavigationClassKey = "root";
|
|
@@ -15,7 +16,7 @@ export type HvStepNavigationProps = StandardProps<
|
|
|
15
16
|
/**
|
|
16
17
|
* Steps to show on the component.
|
|
17
18
|
*/
|
|
18
|
-
steps: Array<Pick<HvStepProps, "state" | "title" | "onClick" | "className">> & {
|
|
19
|
+
steps: Array<Pick<HvStepProps, "state" | "title" | "onClick" | "className" | "disabled">> & {
|
|
19
20
|
/**
|
|
20
21
|
* Class names to override styles on the separator component after the step.
|
|
21
22
|
*/
|
|
@@ -26,15 +27,15 @@ export type HvStepNavigationProps = StandardProps<
|
|
|
26
27
|
titleClassName: string;
|
|
27
28
|
};
|
|
28
29
|
/**
|
|
29
|
-
* Sets one of the standard sizes of the steps
|
|
30
|
+
* Sets one of the standard sizes of the steps.
|
|
30
31
|
*/
|
|
31
32
|
stepSize?: "XS" | "SM" | "MD" | "LG" | "XL";
|
|
32
33
|
/**
|
|
33
|
-
* Width of the component element.
|
|
34
|
+
* Width of the component element on each breakpoint screen resolution.
|
|
34
35
|
*/
|
|
35
|
-
width?: number;
|
|
36
|
+
width?: { [breakpoint in Breakpoint]?: number };
|
|
36
37
|
/**
|
|
37
|
-
* Defines either show a title or only a tooltip on each step component
|
|
38
|
+
* Defines either show a title or only a tooltip on each step component.
|
|
38
39
|
*/
|
|
39
40
|
showTitles?: boolean;
|
|
40
41
|
};
|
|
@@ -38,8 +38,8 @@ import styles from "./styles";
|
|
|
38
38
|
* correspondent to the current media breakpoint;
|
|
39
39
|
* * Choose either you want to <b>showTitles</b> near to each step component or a tootlip on hover;
|
|
40
40
|
* * Define a <b>width</b> of the component. If you don't define any value and the step component has no title
|
|
41
|
-
* displayed above, the width of the separator element
|
|
42
|
-
*
|
|
41
|
+
* displayed above, the width of the separator element will be 100px.
|
|
42
|
+
* If the step component has titles, each one will have 215px of width by default.
|
|
43
43
|
*/
|
|
44
44
|
|
|
45
45
|
const HvStepNavigation = _ref => {
|
|
@@ -142,7 +142,7 @@ const HvStepNavigation = _ref => {
|
|
|
142
142
|
}, stepProps))))));
|
|
143
143
|
|
|
144
144
|
if (index < steps.length - 1) {
|
|
145
|
-
const separatorElement = styledSeparatorElement(title, separatorClassName, height, [steps[index + 1].state, state].includes("Current") ? minWidth : maxWidth, getColor(state));
|
|
145
|
+
const separatorElement = styledSeparatorElement(title, separatorClassName, height, [steps[index + 1].state, state].includes("Current") ? minWidth : maxWidth, getColor(steps[index + 1].state === "Disabled" ? "Disabled" : state, theme));
|
|
146
146
|
return [...acc, stepElement, separatorElement];
|
|
147
147
|
}
|
|
148
148
|
|
|
@@ -154,9 +154,9 @@ const HvStepNavigation = _ref => {
|
|
|
154
154
|
};
|
|
155
155
|
|
|
156
156
|
const getDynamicValues = stepsWidth => {
|
|
157
|
-
var _theme$breakpoints$va, _theme$breakpoints$va2;
|
|
157
|
+
var _width$breakpoint, _theme$breakpoints$va, _theme$breakpoints$va2;
|
|
158
158
|
|
|
159
|
-
const maxWidth = width !== null &&
|
|
159
|
+
const maxWidth = (_width$breakpoint = width === null || width === void 0 ? void 0 : width[breakpoint]) !== null && _width$breakpoint !== void 0 ? _width$breakpoint : Math.max(Number(hasTitles) * (TITLE_WIDTH + TITLE_MARGIN) * steps.length - TITLE_MARGIN, SEPARATOR_WIDTH * (steps.length - 1) + stepsWidth);
|
|
160
160
|
const next = theme.breakpoints.keys.find((_, index, self) => index - 1 >= 0 ? self[index - 1] === breakpoint : false);
|
|
161
161
|
const navWidth = Math.min(maxWidth, (_theme$breakpoints$va = (_theme$breakpoints$va2 = theme.breakpoints.values) === null || _theme$breakpoints$va2 === void 0 ? void 0 : _theme$breakpoints$va2[next]) !== null && _theme$breakpoints$va !== void 0 ? _theme$breakpoints$va : maxWidth);
|
|
162
162
|
const titleWidth = Number(hasTitles) * Math.ceil((navWidth + TITLE_MARGIN) / steps.length);
|
|
@@ -298,9 +298,15 @@ process.env.NODE_ENV !== "production" ? HvStepNavigation.propTypes = {
|
|
|
298
298
|
title: PropTypes.string.isRequired,
|
|
299
299
|
|
|
300
300
|
/**
|
|
301
|
-
* State of the step. Values = {"Pending", "Failed", "Completed", "Current", "Disabled"}.
|
|
301
|
+
* State of the step. Values = {"Pending", "Failed", "Completed", "Current", "Disabled", "Enabled"}.
|
|
302
302
|
*/
|
|
303
|
-
state: PropTypes.oneOf(["Pending", "Failed", "Completed", "Current", "Disabled"]).isRequired
|
|
303
|
+
state: PropTypes.oneOf(["Pending", "Failed", "Completed", "Current", "Disabled", "Enabled"]).isRequired,
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Define if a step is disabled/enabled.
|
|
307
|
+
* If this property is not defined and the step is on state "Disabled", the step component will be disabled
|
|
308
|
+
*/
|
|
309
|
+
disabled: PropTypes.bool
|
|
304
310
|
})).isRequired,
|
|
305
311
|
|
|
306
312
|
/**
|
|
@@ -309,9 +315,15 @@ process.env.NODE_ENV !== "production" ? HvStepNavigation.propTypes = {
|
|
|
309
315
|
stepSize: PropTypes.oneOf(["XS", "SM", "MD", "LG", "XL"]),
|
|
310
316
|
|
|
311
317
|
/**
|
|
312
|
-
* Width of the component.
|
|
318
|
+
* Width of the component element on each breakpoint screen resolution.
|
|
313
319
|
*/
|
|
314
|
-
width: PropTypes.
|
|
320
|
+
width: PropTypes.shape({
|
|
321
|
+
xs: PropTypes.number,
|
|
322
|
+
sm: PropTypes.number,
|
|
323
|
+
md: PropTypes.number,
|
|
324
|
+
lg: PropTypes.number,
|
|
325
|
+
xl: PropTypes.number
|
|
326
|
+
}),
|
|
315
327
|
|
|
316
328
|
/**
|
|
317
329
|
* Defines either show a title or only a tooltip on each step component
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepNavigation.js","names":["React","PropTypes","clsx","withStyles","Typography","styled","useTheme","HvTooltip","HvTypography","useWidth","HvDefaultNavigation","HvSimpleNavigation","SEPARATOR_WIDTH","TITLE_MARGIN","TITLE_WIDTH","styles","HvStepNavigation","className","classes","width","steps","stepSize","showTitles","type","others","theme","breakpoint","stepSizeKey","includes","hasTitles","styledLi","containerSize","height","styledDiv","styledSeparatorElement","title","separatorClassName","separatorHeight","separatorWidth","backgroundColor","Separator","separatorElement","separator","drawItems","separatorValues","minWidth","maxWidth","getColor","stepValues","minSize","maxSize","StepComponent","items","reduce","acc","index","state","props","StepContainer","Step","Math","max","stepProps","size","number","stepElement","li","length","ol","getDynamicValues","stepsWidth","Number","next","breakpoints","keys","find","_","self","navWidth","min","values","titleWidth","ceil","styledTitle","titleClassName","variant","stepTitle","textAlign","marginRight","getTitles","getTitleProps","titles","map","rawTitle","Title","StepNavigation","Default","Simple","numSteps","root","itemsProps","margin","propTypes","string","shape","isRequired","oneOf","arrayOf","bool","name"],"sources":["../../../src/StepNavigation/StepNavigation.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\n\nimport { withStyles, Typography, styled, useTheme } from \"@material-ui/core\";\nimport { HvTooltip, HvTypography, useWidth } from \"@hitachivantara/uikit-react-core\";\n\nimport HvDefaultNavigation from \"./DefaultNavigation\";\nimport HvSimpleNavigation from \"./SimpleNavigation\";\nimport { SEPARATOR_WIDTH, TITLE_MARGIN, TITLE_WIDTH } from \"./utils\";\nimport styles from \"./styles\";\n\n/**\n * Navigation page with steps.\n *\n * You need to define the <b>steps<b/> displayed on the component so that itself can be drawn on the UI.\n * On each step, you need to define a <b>state</b> - 'Pending', 'Failed', 'Completed', 'Current', 'Disabled' -\n * and a <b>title</b> to be shown as a tooltip or a text above of the step. You can also:\n * * Define a <b>className</b> on each step element;\n * * Define a <b>separatorClassName</b> to specify a className for the separator element. The default height\n * values of the separator element are 2px/3px on 'Simple'/'Default' layouts respectively;\n * * Define a <b>titleClassName</b> to specify a className for the title above each step element.\n *\n * For the root element, you can:\n * * Define a <b>className</b>;\n * * Choose a <b>type</b> of layout: 'Simple' or 'Default';\n * * Choose the <b>stepSize</b> of the step component: \"XS\", \"SM\", \"MD\", \"LG\", \"XL\". The default size will be\n * correspondent to the current media breakpoint;\n * * Choose either you want to <b>showTitles</b> near to each step component or a tootlip on hover;\n * * Define a <b>width</b> of the component. If you don't define any value and the step component has no title\n * displayed above, the width of the separator element;\n * will be 100px. If the step component has titles, each one will have 215px of width by default.\n */\nconst HvStepNavigation = ({\n className,\n classes,\n width,\n steps,\n stepSize,\n showTitles,\n type = \"Default\",\n ...others\n}) => {\n const theme = useTheme();\n // current breakpoint 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n const breakpoint = useWidth();\n // step configurations\n const stepSizeKey = stepSize ?? ([\"xs\", \"sm\"].includes(breakpoint) ? \"SM\" : \"MD\");\n const hasTitles = showTitles ?? ![\"xs\", \"sm\"].includes(breakpoint);\n\n const styledLi = (containerSize) =>\n styled(\"li\")({\n width: containerSize,\n height: containerSize,\n });\n\n const styledDiv = (containerSize) =>\n styled(\"div\")({\n width: containerSize,\n height: containerSize,\n });\n\n const styledSeparatorElement = (\n title,\n separatorClassName,\n separatorHeight,\n separatorWidth,\n backgroundColor\n ) => {\n const Separator = withStyles({\n separatorElement: {\n height: separatorHeight,\n width: separatorWidth,\n backgroundColor,\n },\n })(({ classes: { separatorElement } }) => (\n <div\n aria-label={`separator-${title}`}\n className={clsx(separatorElement, separatorClassName)}\n />\n ));\n return (\n <li aria-hidden key={`separator-${title}`} className={classes.separator}>\n <Separator />\n </li>\n );\n };\n\n const drawItems = ({\n separatorValues: { minWidth, maxWidth, getColor, height },\n stepValues: { minSize, maxSize, StepComponent },\n }) => {\n const items = steps.reduce((acc, { state, title, separatorClassName, ...props }, index) => {\n const containerSize = state === \"Current\" ? maxSize : minSize;\n const StepContainer = styledLi(containerSize);\n const Step = styledDiv(Math.max(containerSize, 30), Math.max(containerSize, 30));\n const stepProps = {\n ...{\n size: stepSizeKey,\n state,\n title,\n number: index + 1,\n ...props,\n },\n };\n const stepElement = (\n <StepContainer key={`step-${title}`} className={classes.li}>\n {hasTitles ? (\n <StepComponent aria-label={`step-${title}`} {...stepProps} />\n ) : (\n <HvTooltip\n placement=\"bottom\"\n title={<HvTypography>{`${index + 1}. ${title}`}</HvTypography>}\n >\n <div aria-label={`step-container-${title}`}>\n <Step className={classes.li}>\n <StepComponent aria-label={`step-${title}`} {...stepProps} />\n </Step>\n </div>\n </HvTooltip>\n )}\n </StepContainer>\n );\n if (index < steps.length - 1) {\n const separatorElement = styledSeparatorElement(\n title,\n separatorClassName,\n height,\n [steps[index + 1].state, state].includes(\"Current\") ? minWidth : maxWidth,\n getColor(state)\n );\n return [...acc, stepElement, separatorElement];\n }\n return [...acc, stepElement];\n }, []);\n\n return <ol className={classes.ol}>{items}</ol>;\n };\n\n const getDynamicValues = (stepsWidth) => {\n const maxWidth =\n width ??\n Math.max(\n Number(hasTitles) * (TITLE_WIDTH + TITLE_MARGIN) * steps.length - TITLE_MARGIN,\n SEPARATOR_WIDTH * (steps.length - 1) + stepsWidth\n );\n const next = theme.breakpoints.keys.find((_, index, self) =>\n index - 1 >= 0 ? self[index - 1] === breakpoint : false\n );\n const navWidth = Math.min(maxWidth, theme.breakpoints.values?.[next] ?? maxWidth);\n const titleWidth = Number(hasTitles) * Math.ceil((navWidth + TITLE_MARGIN) / steps.length);\n const separatorWidth =\n Number(!hasTitles) * Math.ceil((navWidth - stepsWidth) / (steps.length - 1));\n return { width: navWidth, titleWidth, separatorWidth };\n };\n\n const styledTitle = (titleClassName, variant, title, titleWidth) =>\n withStyles({\n stepTitle: {\n textAlign: \"center\",\n width: titleWidth - TITLE_MARGIN,\n marginRight: TITLE_MARGIN,\n },\n })(({ classes: { stepTitle } }) =>\n title ? (\n <HvTypography variant={variant} className={clsx(stepTitle, titleClassName)}>\n {title}\n </HvTypography>\n ) : null\n );\n\n const getTitles = (getTitleProps) =>\n hasTitles ? (\n <div className={classes.titles}>\n {steps.map(({ title: rawTitle, state, titleClassName }, index) => {\n const {\n variant = \"highlightText\",\n title = rawTitle,\n titleWidth = 0,\n } = getTitleProps({\n state,\n rawTitle,\n number: index + 1,\n });\n const Title = styledTitle(titleClassName, variant, title, titleWidth);\n return <Title key={`step-title-${rawTitle}`} />;\n })}\n </div>\n ) : null;\n\n const StepNavigation = {\n Default: HvDefaultNavigation,\n Simple: HvSimpleNavigation,\n }[type];\n\n return (\n <StepNavigation\n {...{\n stepSize: stepSizeKey,\n numSteps: steps.length,\n getTitles,\n getDynamicValues,\n className: clsx(className, classes.root),\n ...others,\n }}\n >\n {({ stepsWidth, navWidth, ...itemsProps }) => (\n <Typography\n component=\"nav\"\n style={{\n width: `${navWidth}px`,\n margin: 0,\n }}\n >\n {drawItems(itemsProps)}\n </Typography>\n )}\n </StepNavigation>\n );\n};\n\nHvStepNavigation.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the li element.\n */\n li: PropTypes.string,\n /**\n * Styles applied to the ol element.\n */\n ol: PropTypes.string,\n /**\n * Styles applied to the separator element.\n */\n separator: PropTypes.string,\n /**\n * Styles applied to the titles container element.\n */\n titles: PropTypes.string,\n }).isRequired,\n /**\n * Type of step navigation. Values = {\"Simple\", \"Default\"}.\n */\n type: PropTypes.oneOf([\"Simple\", \"Default\"]),\n /**\n * Steps to show on the component.\n */\n steps: PropTypes.arrayOf(\n PropTypes.shape({\n /**\n * Class names to override styles on the step component.\n */\n className: PropTypes.string,\n /**\n * Class names to override styles on the separator component after the step.\n */\n separatorClassName: PropTypes.string,\n /**\n * Class names to override styles on the title component above the step.\n */\n titleClassName: PropTypes.string,\n /**\n * Title of the step.\n */\n title: PropTypes.string.isRequired,\n /**\n * State of the step. Values = {\"Pending\", \"Failed\", \"Completed\", \"Current\", \"Disabled\"}.\n */\n state: PropTypes.oneOf([\"Pending\", \"Failed\", \"Completed\", \"Current\", \"Disabled\"]).isRequired,\n })\n ).isRequired,\n /**\n * Sets one of the standard sizes of the steps. Values = {\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"}\n */\n stepSize: PropTypes.oneOf([\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"]),\n /**\n * Width of the component.\n */\n width: PropTypes.number,\n /**\n * Defines either show a title or only a tooltip on each step component\n */\n showTitles: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvStepNavigation\" })(HvStepNavigation);\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AAEA,SAASC,UAAT,EAAqBC,UAArB,EAAiCC,MAAjC,EAAyCC,QAAzC,QAAyD,mBAAzD;AACA,SAASC,SAAT,EAAoBC,YAApB,EAAkCC,QAAlC,QAAkD,kCAAlD;AAEA,OAAOC,mBAAP,MAAgC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UAhBV;;IAiBd;AACN;AACA;IACMjD,KAAK,EAAEvD,SAAS,CAACyG,KAAV,CAAgB,CAAC,SAAD,EAAY,QAAZ,EAAsB,WAAtB,EAAmC,SAAnC,EAA8C,UAA9C,CAAhB,EAA2ED;EApBpE,CAAhB,CADK,EAuBLA,UA5DyB;;EA6D3B;AACF;AACA;EACEpF,QAAQ,EAAEpB,SAAS,CAACyG,KAAV,CAAgB,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,EAAyB,IAAzB,CAAhB,CAhEiB;;EAiE3B;AACF;AACA;EACEvF,KAAK,EAAElB,SAAS,CAAC+D,MApEU;;EAqE3B;AACF;AACA;EACE1C,UAAU,EAAErB,SAAS,CAAC2G;AAxEK,CAA7B;AA2EA,eAAezG,UAAU,CAACY,MAAD,EAAS;EAAE8F,IAAI,EAAE;AAAR,CAAT,CAAV,CAAiD7F,gBAAjD,CAAf"}
|
|
1
|
+
{"version":3,"file":"StepNavigation.js","names":["React","PropTypes","clsx","withStyles","Typography","styled","useTheme","HvTooltip","HvTypography","useWidth","HvDefaultNavigation","HvSimpleNavigation","SEPARATOR_WIDTH","TITLE_MARGIN","TITLE_WIDTH","styles","HvStepNavigation","className","classes","width","steps","stepSize","showTitles","type","others","theme","breakpoint","stepSizeKey","includes","hasTitles","styledLi","containerSize","height","styledDiv","styledSeparatorElement","title","separatorClassName","separatorHeight","separatorWidth","backgroundColor","Separator","separatorElement","separator","drawItems","separatorValues","minWidth","maxWidth","getColor","stepValues","minSize","maxSize","StepComponent","items","reduce","acc","index","state","props","StepContainer","Step","Math","max","stepProps","size","number","stepElement","li","length","ol","getDynamicValues","stepsWidth","Number","next","breakpoints","keys","find","_","self","navWidth","min","values","titleWidth","ceil","styledTitle","titleClassName","variant","stepTitle","textAlign","marginRight","getTitles","getTitleProps","titles","map","rawTitle","Title","StepNavigation","Default","Simple","numSteps","root","itemsProps","margin","propTypes","string","shape","isRequired","oneOf","arrayOf","disabled","bool","xs","sm","md","lg","xl","name"],"sources":["../../../src/StepNavigation/StepNavigation.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\n\nimport { withStyles, Typography, styled, useTheme } from \"@material-ui/core\";\nimport { HvTooltip, HvTypography, useWidth } from \"@hitachivantara/uikit-react-core\";\n\nimport HvDefaultNavigation from \"./DefaultNavigation\";\nimport HvSimpleNavigation from \"./SimpleNavigation\";\nimport { SEPARATOR_WIDTH, TITLE_MARGIN, TITLE_WIDTH } from \"./utils\";\nimport styles from \"./styles\";\n\n/**\n * Navigation page with steps.\n *\n * You need to define the <b>steps<b/> displayed on the component so that itself can be drawn on the UI.\n * On each step, you need to define a <b>state</b> - 'Pending', 'Failed', 'Completed', 'Current', 'Disabled' -\n * and a <b>title</b> to be shown as a tooltip or a text above of the step. You can also:\n * * Define a <b>className</b> on each step element;\n * * Define a <b>separatorClassName</b> to specify a className for the separator element. The default height\n * values of the separator element are 2px/3px on 'Simple'/'Default' layouts respectively;\n * * Define a <b>titleClassName</b> to specify a className for the title above each step element.\n *\n * For the root element, you can:\n * * Define a <b>className</b>;\n * * Choose a <b>type</b> of layout: 'Simple' or 'Default';\n * * Choose the <b>stepSize</b> of the step component: \"XS\", \"SM\", \"MD\", \"LG\", \"XL\". The default size will be\n * correspondent to the current media breakpoint;\n * * Choose either you want to <b>showTitles</b> near to each step component or a tootlip on hover;\n * * Define a <b>width</b> of the component. If you don't define any value and the step component has no title\n * displayed above, the width of the separator element will be 100px.\n * If the step component has titles, each one will have 215px of width by default.\n */\nconst HvStepNavigation = ({\n className,\n classes,\n width,\n steps,\n stepSize,\n showTitles,\n type = \"Default\",\n ...others\n}) => {\n const theme = useTheme();\n // current breakpoint 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n const breakpoint = useWidth();\n // step configurations\n const stepSizeKey = stepSize ?? ([\"xs\", \"sm\"].includes(breakpoint) ? \"SM\" : \"MD\");\n const hasTitles = showTitles ?? ![\"xs\", \"sm\"].includes(breakpoint);\n\n const styledLi = (containerSize) =>\n styled(\"li\")({\n width: containerSize,\n height: containerSize,\n });\n\n const styledDiv = (containerSize) =>\n styled(\"div\")({\n width: containerSize,\n height: containerSize,\n });\n\n const styledSeparatorElement = (\n title,\n separatorClassName,\n separatorHeight,\n separatorWidth,\n backgroundColor\n ) => {\n const Separator = withStyles({\n separatorElement: {\n height: separatorHeight,\n width: separatorWidth,\n backgroundColor,\n },\n })(({ classes: { separatorElement } }) => (\n <div\n aria-label={`separator-${title}`}\n className={clsx(separatorElement, separatorClassName)}\n />\n ));\n return (\n <li aria-hidden key={`separator-${title}`} className={classes.separator}>\n <Separator />\n </li>\n );\n };\n\n const drawItems = ({\n separatorValues: { minWidth, maxWidth, getColor, height },\n stepValues: { minSize, maxSize, StepComponent },\n }) => {\n const items = steps.reduce((acc, { state, title, separatorClassName, ...props }, index) => {\n const containerSize = state === \"Current\" ? maxSize : minSize;\n const StepContainer = styledLi(containerSize);\n const Step = styledDiv(Math.max(containerSize, 30), Math.max(containerSize, 30));\n const stepProps = {\n ...{\n size: stepSizeKey,\n state,\n title,\n number: index + 1,\n ...props,\n },\n };\n const stepElement = (\n <StepContainer key={`step-${title}`} className={classes.li}>\n {hasTitles ? (\n <StepComponent aria-label={`step-${title}`} {...stepProps} />\n ) : (\n <HvTooltip\n placement=\"bottom\"\n title={<HvTypography>{`${index + 1}. ${title}`}</HvTypography>}\n >\n <div aria-label={`step-container-${title}`}>\n <Step className={classes.li}>\n <StepComponent aria-label={`step-${title}`} {...stepProps} />\n </Step>\n </div>\n </HvTooltip>\n )}\n </StepContainer>\n );\n if (index < steps.length - 1) {\n const separatorElement = styledSeparatorElement(\n title,\n separatorClassName,\n height,\n [steps[index + 1].state, state].includes(\"Current\") ? minWidth : maxWidth,\n getColor(steps[index + 1].state === \"Disabled\" ? \"Disabled\" : state, theme)\n );\n return [...acc, stepElement, separatorElement];\n }\n return [...acc, stepElement];\n }, []);\n\n return <ol className={classes.ol}>{items}</ol>;\n };\n\n const getDynamicValues = (stepsWidth) => {\n const maxWidth =\n width?.[breakpoint] ??\n Math.max(\n Number(hasTitles) * (TITLE_WIDTH + TITLE_MARGIN) * steps.length - TITLE_MARGIN,\n SEPARATOR_WIDTH * (steps.length - 1) + stepsWidth\n );\n const next = theme.breakpoints.keys.find((_, index, self) =>\n index - 1 >= 0 ? self[index - 1] === breakpoint : false\n );\n const navWidth = Math.min(maxWidth, theme.breakpoints.values?.[next] ?? maxWidth);\n const titleWidth = Number(hasTitles) * Math.ceil((navWidth + TITLE_MARGIN) / steps.length);\n const separatorWidth =\n Number(!hasTitles) * Math.ceil((navWidth - stepsWidth) / (steps.length - 1));\n return { width: navWidth, titleWidth, separatorWidth };\n };\n\n const styledTitle = (titleClassName, variant, title, titleWidth) =>\n withStyles({\n stepTitle: {\n textAlign: \"center\",\n width: titleWidth - TITLE_MARGIN,\n marginRight: TITLE_MARGIN,\n },\n })(({ classes: { stepTitle } }) =>\n title ? (\n <HvTypography variant={variant} className={clsx(stepTitle, titleClassName)}>\n {title}\n </HvTypography>\n ) : null\n );\n\n const getTitles = (getTitleProps) =>\n hasTitles ? (\n <div className={classes.titles}>\n {steps.map(({ title: rawTitle, state, titleClassName }, index) => {\n const {\n variant = \"highlightText\",\n title = rawTitle,\n titleWidth = 0,\n } = getTitleProps({\n state,\n rawTitle,\n number: index + 1,\n });\n const Title = styledTitle(titleClassName, variant, title, titleWidth);\n return <Title key={`step-title-${rawTitle}`} />;\n })}\n </div>\n ) : null;\n\n const StepNavigation = {\n Default: HvDefaultNavigation,\n Simple: HvSimpleNavigation,\n }[type];\n\n return (\n <StepNavigation\n {...{\n stepSize: stepSizeKey,\n numSteps: steps.length,\n getTitles,\n getDynamicValues,\n className: clsx(className, classes.root),\n ...others,\n }}\n >\n {({ stepsWidth, navWidth, ...itemsProps }) => (\n <Typography\n component=\"nav\"\n style={{\n width: `${navWidth}px`,\n margin: 0,\n }}\n >\n {drawItems(itemsProps)}\n </Typography>\n )}\n </StepNavigation>\n );\n};\n\nHvStepNavigation.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the li element.\n */\n li: PropTypes.string,\n /**\n * Styles applied to the ol element.\n */\n ol: PropTypes.string,\n /**\n * Styles applied to the separator element.\n */\n separator: PropTypes.string,\n /**\n * Styles applied to the titles container element.\n */\n titles: PropTypes.string,\n }).isRequired,\n /**\n * Type of step navigation. Values = {\"Simple\", \"Default\"}.\n */\n type: PropTypes.oneOf([\"Simple\", \"Default\"]),\n /**\n * Steps to show on the component.\n */\n steps: PropTypes.arrayOf(\n PropTypes.shape({\n /**\n * Class names to override styles on the step component.\n */\n className: PropTypes.string,\n /**\n * Class names to override styles on the separator component after the step.\n */\n separatorClassName: PropTypes.string,\n /**\n * Class names to override styles on the title component above the step.\n */\n titleClassName: PropTypes.string,\n /**\n * Title of the step.\n */\n title: PropTypes.string.isRequired,\n /**\n * State of the step. Values = {\"Pending\", \"Failed\", \"Completed\", \"Current\", \"Disabled\", \"Enabled\"}.\n */\n state: PropTypes.oneOf([\"Pending\", \"Failed\", \"Completed\", \"Current\", \"Disabled\", \"Enabled\"])\n .isRequired,\n /**\n * Define if a step is disabled/enabled.\n * If this property is not defined and the step is on state \"Disabled\", the step component will be disabled\n */\n disabled: PropTypes.bool,\n })\n ).isRequired,\n /**\n * Sets one of the standard sizes of the steps. Values = {\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"}\n */\n stepSize: PropTypes.oneOf([\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"]),\n /**\n * Width of the component element on each breakpoint screen resolution.\n */\n width: PropTypes.shape({\n xs: PropTypes.number,\n sm: PropTypes.number,\n md: PropTypes.number,\n lg: PropTypes.number,\n xl: PropTypes.number,\n }),\n /**\n * Defines either show a title or only a tooltip on each step component\n */\n showTitles: PropTypes.bool,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,EAAErB,SAAS,CAAC4G;AApFK,CAA7B;AAuFA,eAAe1G,UAAU,CAACY,MAAD,EAAS;EAAEoG,IAAI,EAAE;AAAR,CAAT,CAAV,CAAiDnG,gBAAjD,CAAf"}
|
|
@@ -9,6 +9,10 @@ export interface HvTableBodyProps
|
|
|
9
9
|
* Defaults to `thead`.
|
|
10
10
|
*/
|
|
11
11
|
component?: React.ElementType<React.HTMLAttributes<HTMLElement>>;
|
|
12
|
+
/**
|
|
13
|
+
* Sets whether or not there should be arrow navigation between the table rows
|
|
14
|
+
*/
|
|
15
|
+
withNavigation: boolean;
|
|
12
16
|
}
|
|
13
17
|
|
|
14
18
|
export default function HvTableBody(props: HvTableBodyProps): JSX.Element | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hitachivantara/uikit-react-lab",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.56.0",
|
|
4
4
|
"description": "A collection of contributed React components for the Hitachi Vantara's Design System.",
|
|
5
5
|
"homepage": "https://github.com/lumada-design/hv-uikit-react",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"react-dom": "^16.13.1 || ^17.0.2"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@hitachivantara/uikit-react-core": "^3.74.
|
|
44
|
+
"@hitachivantara/uikit-react-core": "^3.74.2",
|
|
45
45
|
"@hitachivantara/uikit-react-icons": "^3.9.6",
|
|
46
46
|
"@types/react-table": "^7.7.12",
|
|
47
47
|
"clsx": "^1.2.1",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "edf63455ce815c26d805bf1d9bc118bdadb5e7fa"
|
|
66
66
|
}
|