@corva/ui 0.56.0-2 → 0.56.0-4
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/README.md +25 -15
- package/cjs-bundle/components/Chart/components/ChartWrapper.js +1 -1
- package/cjs-bundle/components/Chart/effects/useChartModifier.js +1 -1
- package/cjs-bundle/components/StatusBadge/components/DQAlertsTooltip.js +1 -1
- package/cjs-bundle/components/StatusBadge/index.js +1 -1
- package/components/Chart/components/ChartWrapper.d.ts +7 -1
- package/components/Chart/components/ChartWrapper.d.ts.map +1 -1
- package/components/Chart/components/ChartWrapper.js +1 -1
- package/components/Chart/effects/useChartModifier.d.ts +2 -1
- package/components/Chart/effects/useChartModifier.d.ts.map +1 -1
- package/components/Chart/effects/useChartModifier.js +1 -1
- package/components/StatusBadge/components/DQAlertsTooltip.d.ts.map +1 -1
- package/components/StatusBadge/components/DQAlertsTooltip.js +1 -1
- package/components/StatusBadge/index.js +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -19,32 +19,42 @@ components - please also update it's `stories.js` file when it's necessary
|
|
|
19
19
|
|
|
20
20
|
- `yarn storybook` will launch local storybook server which is convenient to use for components testing when you work on public components. That's a playground for building public components.
|
|
21
21
|
- `yarn start` will open ExampleApp.js in your browser. That's a playground for building non-public components (such components will be moved from @corva/ui soon)
|
|
22
|
-
- To link this repo with your app, you should:
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
1. Run `yarn build` or `yarn build-watch` in @corva/ui repo (only first time)
|
|
26
|
-
2. Run `npm link dist` in @corva/ui repo root (only first time)
|
|
27
|
-
3. Run `npm link @corva/ui` in your app folder
|
|
23
|
+
## Link local `@corva/ui` to your app
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
1. Run `npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"`
|
|
31
|
-
2. Run `yarn build` or `yarn build-watch` in @corva/ui repo (only first time)
|
|
32
|
-
3. Run `npm link dist` in @corva/ui repo root (only first time)
|
|
33
|
-
4. Run `npm link @corva/ui` in your app folder
|
|
25
|
+
### Pre-requisite
|
|
34
26
|
|
|
35
|
-
|
|
36
|
-
If you want to debug a change in @corva/ui dependencies, you should use `yarn add file:../corva-ui/dist`, this will install new dependencies.
|
|
27
|
+
* Make sure you are using `@corva/ui` with latest updates from `development` branch
|
|
37
28
|
|
|
29
|
+
* If your app is using `getWebpackConfig` from `@corva/ui` instead of `@corva/dc-platform-shared`, migrate it according to [this guide](https://www.notion.so/corva/Migration-to-corva-dc-platform-shared-721cc822e23c4c43a7630b73fdeec3d9)
|
|
38
30
|
|
|
39
|
-
###
|
|
40
|
-
|
|
31
|
+
### Steps to link your local DC app**
|
|
32
|
+
|
|
33
|
+
1. Run `yarn build-dev` or `yarn build-watch` in @corva/ui repo
|
|
34
|
+
<br/>***Note:** `yarn build` will not work for linking*
|
|
35
|
+
|
|
36
|
+
2. `cd ./dist` and run `yarn link` in @corva/ui dist folder (only first time)
|
|
37
|
+
|
|
38
|
+
3. Run `yarn link @corva/ui` in your local DC app root folder
|
|
39
|
+
|
|
40
|
+
4. Run `yarn start` in your local DC app root folder
|
|
41
|
+
|
|
42
|
+
***Note:** npm link will not install @corva/ui dependencies in your node modules folder.*
|
|
43
|
+
If you want to debug a change in @corva/ui dependencies, you should use `yarn add file:../corva-ui/dist`, this will install new dependencies.
|
|
44
|
+
|
|
45
|
+
### Troubleshooting
|
|
46
|
+
|
|
47
|
+
#### Failed to compile.<br />`Module not found: Can't resolve '@corva/ui' in ...`
|
|
48
|
+
Most likely you need to [migrate to `@corva/dc-platform-shared`](https://www.notion.so/corva/Migration-to-corva-dc-platform-shared-721cc822e23c4c43a7630b73fdeec3d9) for cjs webpack config usage
|
|
49
|
+
|
|
50
|
+
#### Error.<br/>`Invalid hook call. Hooks can only be called inside of the body of a function component...`
|
|
41
51
|
|
|
42
52
|
In that case, your bundler might “see” two Reacts — one in application folder and one in your library folder. Assuming myapp and mylib are sibling folders, one possible fix is to run npm link ../myapp/node_modules/react from mylib. This should make the library use the application’s React copy.
|
|
43
53
|
|
|
44
54
|
|
|
45
55
|
Or change the webpack configuration in config-overrides.js in your app. (Don't commit the changes of this file)
|
|
46
56
|
```
|
|
47
|
-
|
|
57
|
+
{
|
|
48
58
|
resolve: {
|
|
49
59
|
alias: {
|
|
50
60
|
react: path.resolve('./node_modules/react')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/slicedToArray"),t=require("@material-ui/core"),o=require("lodash"),n=require("react"),i=require("../ChartWrapperContext.js"),a=require("../constants.js"),l=require("../effects/useZoom.js"),c=require("../effects/useChartModifier.js"),u=require("./AxisOverlay.js"),s=require("react/jsx-runtime");function
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/slicedToArray"),t=require("@material-ui/core"),o=require("lodash"),n=require("react"),i=require("../ChartWrapperContext.js"),a=require("../constants.js"),l=require("../effects/useZoom.js"),c=require("../effects/useChartModifier.js"),u=require("./AxisOverlay.js"),s=require("react/jsx-runtime");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=h(e),f=h(r);function m(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function v(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?m(Object(t),!0).forEach((function(r){d.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):m(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var C=t.makeStyles({container:{width:"100%",height:"100%",position:"relative"}}),b=function(e){var r,t,h,d,m,b,p,g=e.children,j=e.chartRef,y=e.isAxesCoordinatesShown,O=e.onCustomizeScaleClick,S=e.onZoomChangeCallback,Z=C(),E=n.useState({}),q=f.default(E,2),x=q[0],P=q[1],w=l.useZoom({chart:null===(r=j.current)||void 0===r?void 0:r.chart}),k=w.zoomStatus,z=w.zoomConfig,A=w.handleZoomEvent,H=w.handleResetZoom,M=w.isZoomEnabled,D=w.handleIsZoomEnabledChange,I=w.debouncedChartSelection;n.useEffect((function(){var e,r,t;o.isEmpty(null===(e=j.current)||void 0===e?void 0:e.chart)||P({marginBottom:null===(r=j.current)||void 0===r||null===(t=r.chart)||void 0===t?void 0:t.marginBottom})}),[]);var R=(null===(t=j.current)||void 0===t||null===(h=t.chart)||void 0===h||null===(d=h.plotBox)||void 0===d?void 0:d.height)<=a.MIN_CHART_HEIGHT;c.useChartModifier({chart:null===(m=j.current)||void 0===m?void 0:m.chart,isZoomEnabled:M,isMinHeightChart:R,onZoomChangeCallback:S,handleChartSelection:I,isAxesCoordinatesShown:y});var B={chart:null===(b=j.current)||void 0===b?void 0:b.chart,zoomConfig:z,chartStyles:x,zoomStatus:k,isZoomEnabled:M,setChartStyles:P,handleResetZoom:H,handleZoomEvent:A,isMinHeightChart:R,handleChartSelection:I,handleChangeChartStyles:function(e){P((function(r){return v(v({},r),e)}))},handleIsZoomEnabledChange:D};return s.jsx("div",{className:Z.container,children:s.jsxs(i.Provider,{value:B,children:[g,O&&(null===(p=j.current)||void 0===p?void 0:p.chart.axes.map((function(e){return s.jsx(u,v({onCustomizeScaleClick:O},e),e.coll)})))]})})};b.defaultProps={onZoomChangeCallback:function(){}},module.exports=b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("@material-ui/core"),e=require("lodash"),s=require("react"),a=require("../formations.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("@material-ui/core"),e=require("lodash"),s=require("react"),a=require("../formations.js"),o=r.makeStyles({axisGrab:{cursor:"grab"},axisCrosshair:{cursor:"crosshair"}});exports.useChartModifier=function(r){var t=r.chart,i=r.isZoomEnabled,n=r.isMinHeightChart,c=r.handleChartSelection,l=r.onZoomChangeCallback,u=r.isAxesCoordinatesShown,h=o();s.useEffect((function(){if(!e.isEmpty(t)){var r={zIndex:1,color:"#ffffff",dashStyle:"dash"};t.plotBackground.element.style.cursor=i?"crosshair":"grab",t.update({chart:{plotBackgroundColor:"transparent",zoomType:n||!i?"none":t.userOptions.chart.zoomType,panning:{enabled:!0,type:t.userOptions.chart.panning.type}},xAxis:{crosshair:u?r:null,className:i?h.axisCrosshair:h.axisGrab,events:{afterSetExtremes:function(r){var e;"zoom"!==r.trigger&&"navigator"!==r.trigger||c(),null!==(e=t.xAxis[0].userOptions.plotLines)&&void 0!==e&&e.length&&a.updateAxisStyles({chart:t}),l(r)}}},yAxis:{crosshair:u?r:null,className:i?h.axisCrosshair:h.axisGrab,events:{afterSetExtremes:function(r){"zoom"!==r.trigger&&"navigator"!==r.trigger||c(),l(r)}}},plotOptions:{series:{cursor:n||!i?"grab":"crosshair"}}})}}),[i,c,u])};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),a=require("moment"),r=require("lodash"),i=require("@material-ui/core"),s=require("../../Tooltip/Tooltip.js");require("../../Tooltip/ScrollableTooltip.js");var n=require("../constants.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(a),p=i.makeStyles((function(e){return{errorIcon:{width:20,height:18},title:{maxWidth:198,padding:"0 0 8px",fontSize:16,lineHeight:"22px",color:e.palette.primary.text1},alertTime:{fontSize:14,color:e.palette.primary.text6,"& span":{color:e.palette.primary.text1}},alertMessage:{width:"100%",height:40,margin:0,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box","-webkit-line-clamp":2,"-webkit-box-orient":"vertical",whiteSpace:"pre-wrap",fontSize:14,lineHeight:"20px",color:e.palette.primary.text1},alertMessageFull:{marginBottom:8,fontSize:14,lineHeight:"20px",color:e.palette.primary.text1,whiteSpace:"pre-wrap"},alertInfo:{display:"flex",alignItems:"center",flexWrap:"wrap",marginBottom:8,fontSize:14,textTransform:"capitalize","& span":{color:e.palette.primary.text6,marginRight:8},"& .error":{color:e.palette.error.main},"& .warning":{color:"#ffa500"}},resolvedInfo:{display:"flex",alignItems:"center",marginBottom:8,color:e.palette.primary.text6,fontSize:14},infoIcon:{color:e.palette.info.main,marginRight:8,fontSize:16},popover:{marginLeft:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),a=require("moment"),r=require("lodash"),i=require("@material-ui/core"),s=require("../../Tooltip/Tooltip.js");require("../../Tooltip/ScrollableTooltip.js");var n=require("../constants.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(a),p=i.makeStyles((function(e){return{errorIcon:{width:20,height:18},title:{maxWidth:198,padding:"0 0 8px",fontSize:16,lineHeight:"22px",color:e.palette.primary.text1},alertTime:{fontSize:14,color:e.palette.primary.text6,"& span":{color:e.palette.primary.text1}},alertMessage:{width:"100%",height:40,margin:0,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box","-webkit-line-clamp":2,"-webkit-box-orient":"vertical",whiteSpace:"pre-wrap",fontSize:14,lineHeight:"20px",color:e.palette.primary.text1},alertMessageFull:{marginBottom:8,fontSize:14,lineHeight:"20px",color:e.palette.primary.text1,whiteSpace:"pre-wrap"},alertInfo:{display:"flex",alignItems:"center",flexWrap:"wrap",marginBottom:8,fontSize:14,textTransform:"capitalize","& span":{color:e.palette.primary.text6,marginRight:8},"& .error":{color:e.palette.error.main},"& .warning":{color:"#ffa500"}},resolvedInfo:{display:"flex",alignItems:"center",marginBottom:8,color:e.palette.primary.text6,fontSize:14},infoIcon:{color:e.palette.info.main,marginRight:8,fontSize:16},popover:{marginLeft:8,width:270,minHeight:122,padding:12,display:"flex",flexDirection:"column",justifyContent:"space-between",backgroundColor:e.palette.background.b9,border:"1px solid ".concat(e.palette.primary.text9),boxShadow:"0px 3px 10px rgba(0, 0, 0, 0.4)",borderRadius:4,"& .MuiTooltip-tooltip":{backgroundColor:e.palette.background.b9,fontWeight:400,lineHeight:"20px",margin:0,padding:0}},message:{whiteSpace:"pre-wrap"},note:{marginBottom:4}}})),c=function(e){return o.default.unix(e).format("DD MMM HH:mm (Z)")},d=function(a){var i=a.children,s=p(),n=r.template(i)({timestampFormatter:c}).split("**").map((function(e,a){return a%2==1?t.jsx("b",{children:e}):e}));return t.jsx("span",e.__assign({className:s.message},{children:n}))};exports.DQAlertsTooltip=function(a){var r,i,l,c=a.alert,m=a.anchorEl,x=a.alertIcon,g=a.children,h=a.isTooltipVisible,u=p(),f=Math.max(c.statusUpdatedAt,c.lastCheckedAt),_=(void 0===l&&(l="MM/DD/YYYY HH:mm a"),(i=f)?o.default.unix(i).format(l):null);return t.jsx(s.Tooltip,{interactive:!0,children:g,PopperProps:{anchorEl:m,className:u.popover},placement:"right",title:h?t.jsxs(t.Fragment,{children:[t.jsx("div",e.__assign({className:u.title},{children:c.name})),t.jsxs("span",e.__assign({className:u.alertInfo},{children:[t.jsx("span",{children:"Category:"})," ",c.category]})),t.jsxs("span",e.__assign({className:u.alertInfo},{children:[t.jsx("span",{children:"Status:"})," ",c.status]})),t.jsxs("span",e.__assign({className:u.alertInfo},{children:[t.jsx("span",{children:"Error Type:"}),t.jsx("div",e.__assign({className:u.errorIcon},{children:x})),t.jsx("span",e.__assign({className:c.state===n.ALERT_STATES.issue?n.BADGE_ICON_STATUSES.warning:n.BADGE_ICON_STATUSES.error},{children:c.state}))]})),t.jsxs("span",e.__assign({className:u.alertInfo},{children:[t.jsx("span",{children:"Score Deduction:"}),t.jsx("span",e.__assign({className:n.BADGE_ICON_STATUSES.warning},{children:"6%"}))]})),t.jsxs("div",e.__assign({className:u.alertMessageFull},{children:[c.isThrottled&&t.jsx("b",{children:"[Throttled]: "}),t.jsx(d,{children:c.message})]})),t.jsxs("span",e.__assign({className:u.alertInfo},{children:[t.jsx("span",e.__assign({className:u.note},{children:"Note:"}))," ",(null===(r=c.note)||void 0===r?void 0:r.length)?c.note:"—"]})),t.jsxs("span",e.__assign({className:u.alertTime},{children:["Updated at: ",t.jsx("span",{children:_})]}))]}):""})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),a=require("react"),n=require("moment"),s=require("classnames"),r=require("@material-ui/core"),o=require("../Tooltip/Tooltip.js");require("../Tooltip/ScrollableTooltip.js");var i=require("./constants.js"),c=require("./components/DQStatusIcon.js"),p=require("./components/DQUnvalidatedContent.js"),l=require("./components/DQSuccessContent.js"),d=require("./components/ReportIssueModal.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=u(n),x=u(s),_=r.makeStyles((function(e){return{statusBadgeWrapper:{backgroundColor:e.palette.background.b4,display:"flex",height:30},statusBadgeContent:{display:"flex",padding:function(e){var t=e.isSuccessTypeIcon,a=e.isErrorTypeIcon;return"12px 0 2px ".concat(t||a?6:2,"px")},whiteSpace:"nowrap",width:"calc(100% - 140px)"},text:{fontSize:"10px",lineHeight:"12px",alignSelf:"center"},timestamp:{color:e.palette.primary.text6,marginLeft:function(e){return e.isIconExist&&4}},warningMessage:{color:e.palette.primary.text1,marginLeft:4,textOverflow:"ellipsis",overflow:"hidden",fontSize:"12px"},badgeIconWarning:{marginLeft:8},popper:{"& .MuiTooltip-tooltip":{maxWidth:455,padding:4,fontSize:12,boxShadow:"0px 0px 4px 2px rgb(0 0 0 / 12%)",fontWeight:400,lineHeight:"16px",letterSpacing:"0.4px",backgroundColor:e.palette.background.b9}},DQIconWrapper:{display:"flex",alignItems:"center",alignSelf:"center",justifyContent:"center",height:24,width:24,borderRadius:12,"&:hover":{backgroundColor:function(e){var t=e.isErrorTypeIcon,a=e.isSuccessTypeIcon;return t?"rgba(244, 67, 54, 0.1)":a?"rgba(117, 219, 41, 0.2)":"transparent"}}}}}));exports.StatusBadge=function(n){var s,u=n.assetsData,m=void 0===u?[]:u,S=n.appWidth,f=n.iconType,I=n.className,T=n.lastTimestamp,h=n.warningData,j=a.useState(!1),b=j[0],y=j[1],v=null==h?void 0:h.message,D=f==i.BADGE_ICON_STATUSES.error,N=f==i.BADGE_ICON_STATUSES.success,C=S<i.MAX_MOBILE_WIDTH,E=_({isIconExist:!!f,isSuccessTypeIcon:N,isErrorTypeIcon:D});return D&&(s=t.jsx(p.DQUnvalidatedContent,{assetsData:m})),N&&(s=t.jsx(l.DQSuccessContent,{onClick:function(){return y(!0)}})),t.jsxs("div",e.__assign({"data-testid":"Status_badge",className:x.default(E.statusBadgeWrapper,I)},{children:[t.jsxs("div",e.__assign({className:E.statusBadgeContent},{children:[f&&t.jsx(o.Tooltip,e.__assign({interactive:D||N,PopperProps:D&&{className:E.popper},placement:"top",title:s},{children:t.jsx("div",e.__assign({className:E.DQIconWrapper,"data-testid":"".concat("Status_badge","__DQ_icon_").concat(f)},{children:t.jsx(c.DQStatusIcon,{color:f,iconType:f})}))})),t.jsxs(r.Typography,e.__assign({className:x.default(E.text,E.timestamp),variant:"body1"},{children:["Last Update: ",g.default.unix(T).format("M/D/YYYY h:mm a")]})),h&&t.jsxs(t.Fragment,{children:[t.jsx(o.Tooltip,e.__assign({placement:"top",title:v?"".concat(i.WARNING,". ").concat(v):i.WARNING},{children:t.jsx("div",e.__assign({"data-testid":"".concat("Status_badge","__DQ_icon_warning")},{children:t.jsx(c.DQStatusIcon,{className:E.badgeIconWarning,color:i.BADGE_ICON_STATUSES.warning,iconType:i.BADGE_ICON_STATUSES.warning})}))})),!C&&t.jsx(r.Typography,e.__assign({className:x.default(E.text,E.warningMessage),variant:"body1"},{children:v?"".concat(i.WARNING,". ").concat(v):i.WARNING}))]})]})),N&&t.jsx(d.ReportIssueModal,{open:b,onClose:function(){return y(!1)}})]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),a=require("react"),n=require("moment"),s=require("classnames"),r=require("@material-ui/core"),o=require("../Tooltip/Tooltip.js");require("../Tooltip/ScrollableTooltip.js");var i=require("./constants.js"),c=require("./components/DQStatusIcon.js"),p=require("./components/DQUnvalidatedContent.js"),l=require("./components/DQSuccessContent.js"),d=require("./components/ReportIssueModal.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=u(n),x=u(s),_=r.makeStyles((function(e){return{statusBadgeWrapper:{backgroundColor:e.palette.background.b4,display:"flex",height:30},statusBadgeContent:{display:"flex",padding:function(e){var t=e.isSuccessTypeIcon,a=e.isErrorTypeIcon;return"12px 0 2px ".concat(t||a?6:2,"px")},whiteSpace:"nowrap",width:"calc(100% - 140px)"},text:{fontSize:"10px",lineHeight:"12px",alignSelf:"center"},timestamp:{color:e.palette.primary.text6,marginLeft:function(e){return e.isIconExist&&4}},warningMessage:{color:e.palette.primary.text1,marginLeft:4,textOverflow:"ellipsis",overflow:"hidden",fontSize:"12px"},badgeIconWarning:{marginLeft:8},popper:{"& .MuiTooltip-tooltip":{maxWidth:455,padding:4,fontSize:12,boxShadow:"0px 0px 4px 2px rgb(0 0 0 / 12%)",fontWeight:400,lineHeight:"16px",letterSpacing:"0.4px",backgroundColor:e.palette.background.b9}},DQIconWrapper:{display:"flex",alignItems:"center",alignSelf:"center",justifyContent:"center",height:24,width:24,borderRadius:12,"&:hover":{backgroundColor:function(e){var t=e.isErrorTypeIcon,a=e.isSuccessTypeIcon;return t?"rgba(244, 67, 54, 0.1)":a?"rgba(117, 219, 41, 0.2)":"transparent"}}}}}));exports.StatusBadge=function(n){var s,u=n.assetsData,m=void 0===u?[]:u,S=n.appWidth,f=n.iconType,I=n.className,T=n.lastTimestamp,h=n.warningData,j=a.useState(!1),b=j[0],y=j[1],v=null==h?void 0:h.message,D=f==i.BADGE_ICON_STATUSES.error,N=f==i.BADGE_ICON_STATUSES.success,C=S<i.MAX_MOBILE_WIDTH,E=_({isIconExist:!!f,isSuccessTypeIcon:N,isErrorTypeIcon:D});return D&&(s=t.jsx(p.DQUnvalidatedContent,{assetsData:m})),N&&(s=t.jsx(l.DQSuccessContent,{onClick:function(){return y(!0)}})),t.jsxs("div",e.__assign({"data-testid":"Status_badge",className:x.default(E.statusBadgeWrapper,I)},{children:[t.jsxs("div",e.__assign({className:E.statusBadgeContent},{children:[f&&t.jsx(o.Tooltip,e.__assign({interactive:D||N,PopperProps:D&&{className:E.popper},placement:"top-start",title:s},{children:t.jsx("div",e.__assign({className:E.DQIconWrapper,"data-testid":"".concat("Status_badge","__DQ_icon_").concat(f)},{children:t.jsx(c.DQStatusIcon,{color:f,iconType:f})}))})),t.jsxs(r.Typography,e.__assign({className:x.default(E.text,E.timestamp),variant:"body1"},{children:["Last Update: ",g.default.unix(T).format("M/D/YYYY h:mm a")]})),h&&t.jsxs(t.Fragment,{children:[t.jsx(o.Tooltip,e.__assign({placement:"top",title:v?"".concat(i.WARNING,". ").concat(v):i.WARNING},{children:t.jsx("div",e.__assign({"data-testid":"".concat("Status_badge","__DQ_icon_warning")},{children:t.jsx(c.DQStatusIcon,{className:E.badgeIconWarning,color:i.BADGE_ICON_STATUSES.warning,iconType:i.BADGE_ICON_STATUSES.warning})}))})),!C&&t.jsx(r.Typography,e.__assign({className:x.default(E.text,E.warningMessage),variant:"body1"},{children:v?"".concat(i.WARNING,". ").concat(v):i.WARNING}))]})]})),N&&t.jsx(d.ReportIssueModal,{open:b,onClose:function(){return y(!1)}})]}))};
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
export default ChartWrapper;
|
|
2
|
-
declare function ChartWrapper({ children, chartRef, isAxesCoordinatesShown, onCustomizeScaleClick }: {
|
|
2
|
+
declare function ChartWrapper({ children, chartRef, isAxesCoordinatesShown, onCustomizeScaleClick, onZoomChangeCallback, }: {
|
|
3
3
|
children: any;
|
|
4
4
|
chartRef: any;
|
|
5
5
|
isAxesCoordinatesShown: any;
|
|
6
6
|
onCustomizeScaleClick: any;
|
|
7
|
+
onZoomChangeCallback: any;
|
|
7
8
|
}): JSX.Element;
|
|
9
|
+
declare namespace ChartWrapper {
|
|
10
|
+
namespace defaultProps {
|
|
11
|
+
function onZoomChangeCallback(): void;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
8
14
|
//# sourceMappingURL=ChartWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/components/ChartWrapper.js"],"names":[],"mappings":";AAgBA
|
|
1
|
+
{"version":3,"file":"ChartWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/components/ChartWrapper.js"],"names":[],"mappings":";AAgBA;;;;;;gBAqEC;;;QAGuB,sCAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import o from"@babel/runtime/helpers/slicedToArray";import{makeStyles as r}from"@material-ui/core";import{isEmpty as t}from"lodash";import{useState as n,useEffect as i}from"react";import a from"../ChartWrapperContext.js";import{MIN_CHART_HEIGHT as l}from"../constants.js";import{useZoom as c}from"../effects/useZoom.js";import{useChartModifier as s}from"../effects/useChartModifier.js";import h from"./AxisOverlay.js";import{jsx as m,jsxs as u}from"react/jsx-runtime";function d(e,o){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);o&&(t=t.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),r.push.apply(r,t)}return r}function f(o){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?d(Object(t),!0).forEach((function(r){e(o,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach((function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(t,e))}))}return o}var p=r({container:{width:"100%",height:"100%",position:"relative"}}),v=function(e){var r,d,v,b,C,g,O,j=e.children,y=e.chartRef,S=e.isAxesCoordinatesShown,Z=e.onCustomizeScaleClick,P=e.onZoomChangeCallback,w=p(),E=n({}),x=o(E,2),k=x[0],z=x[1],A=c({chart:null===(r=y.current)||void 0===r?void 0:r.chart}),D=A.zoomStatus,B=A.zoomConfig,M=A.handleZoomEvent,R=A.handleResetZoom,H=A.isZoomEnabled,I=A.handleIsZoomEnabledChange,N=A.debouncedChartSelection;i((function(){var e,o,r;t(null===(e=y.current)||void 0===e?void 0:e.chart)||z({marginBottom:null===(o=y.current)||void 0===o||null===(r=o.chart)||void 0===r?void 0:r.marginBottom})}),[]);var T=(null===(d=y.current)||void 0===d||null===(v=d.chart)||void 0===v||null===(b=v.plotBox)||void 0===b?void 0:b.height)<=l;s({chart:null===(C=y.current)||void 0===C?void 0:C.chart,isZoomEnabled:H,isMinHeightChart:T,onZoomChangeCallback:P,handleChartSelection:N,isAxesCoordinatesShown:S});var W={chart:null===(g=y.current)||void 0===g?void 0:g.chart,zoomConfig:B,chartStyles:k,zoomStatus:D,isZoomEnabled:H,setChartStyles:z,handleResetZoom:R,handleZoomEvent:M,isMinHeightChart:T,handleChartSelection:N,handleChangeChartStyles:function(e){z((function(o){return f(f({},o),e)}))},handleIsZoomEnabledChange:I};return m("div",{className:w.container,children:u(a.Provider,{value:W,children:[j,Z&&(null===(O=y.current)||void 0===O?void 0:O.chart.axes.map((function(e){return m(h,f({onCustomizeScaleClick:Z},e),e.coll)})))]})})};v.defaultProps={onZoomChangeCallback:function(){}};export{v as default};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export function useChartModifier({ chart, isZoomEnabled, isMinHeightChart, handleChartSelection, isAxesCoordinatesShown, }: {
|
|
1
|
+
export function useChartModifier({ chart, isZoomEnabled, isMinHeightChart, handleChartSelection, onZoomChangeCallback, isAxesCoordinatesShown, }: {
|
|
2
2
|
chart: any;
|
|
3
3
|
isZoomEnabled: any;
|
|
4
4
|
isMinHeightChart: any;
|
|
5
5
|
handleChartSelection: any;
|
|
6
|
+
onZoomChangeCallback: any;
|
|
6
7
|
isAxesCoordinatesShown: any;
|
|
7
8
|
}): void;
|
|
8
9
|
//# sourceMappingURL=useChartModifier.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChartModifier.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/effects/useChartModifier.js"],"names":[],"mappings":"AAcO
|
|
1
|
+
{"version":3,"file":"useChartModifier.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/effects/useChartModifier.js"],"names":[],"mappings":"AAcO;;;;;;;SAkEN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeStyles as r}from"@material-ui/core";import{isEmpty as o}from"lodash";import{useEffect as a}from"react";import{updateAxisStyles as s}from"../formations.js";var
|
|
1
|
+
import{makeStyles as r}from"@material-ui/core";import{isEmpty as o}from"lodash";import{useEffect as a}from"react";import{updateAxisStyles as s}from"../formations.js";var t=r({axisGrab:{cursor:"grab"},axisCrosshair:{cursor:"crosshair"}}),e=function(r){var e=r.chart,i=r.isZoomEnabled,n=r.isMinHeightChart,c=r.handleChartSelection,l=r.onZoomChangeCallback,h=r.isAxesCoordinatesShown,m=t();a((function(){if(!o(e)){var r={zIndex:1,color:"#ffffff",dashStyle:"dash"};e.plotBackground.element.style.cursor=i?"crosshair":"grab",e.update({chart:{plotBackgroundColor:"transparent",zoomType:n||!i?"none":e.userOptions.chart.zoomType,panning:{enabled:!0,type:e.userOptions.chart.panning.type}},xAxis:{crosshair:h?r:null,className:i?m.axisCrosshair:m.axisGrab,events:{afterSetExtremes:function(r){var o;"zoom"!==r.trigger&&"navigator"!==r.trigger||c(),null!==(o=e.xAxis[0].userOptions.plotLines)&&void 0!==o&&o.length&&s({chart:e}),l(r)}}},yAxis:{crosshair:h?r:null,className:i?m.axisCrosshair:m.axisGrab,events:{afterSetExtremes:function(r){"zoom"!==r.trigger&&"navigator"!==r.trigger||c(),l(r)}}},plotOptions:{series:{cursor:n||!i?"grab":"crosshair"}}})}}),[i,c,h])};export{e as useChartModifier};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DQAlertsTooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/StatusBadge/components/DQAlertsTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAMrC,OAAO,EAAE,KAAK,EAAqC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"DQAlertsTooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/StatusBadge/components/DQAlertsTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAMrC,OAAO,EAAE,KAAK,EAAqC,MAAM,cAAc,CAAC;AA6HxE,aAAK,0BAA0B,GAAG;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACjC,SAAS,EAAE,YAAY,CAAC;IACxB,QAAQ,EAAE,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACjC,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,eAAe,+DAAgE,0BAA0B,KAAG,WA6CxH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from'./../../../ext-esm/tslib/tslib.es6.js';import{jsx as t,jsxs as r,Fragment as a}from"react/jsx-runtime";import i from"moment";import{template as o}from"lodash";import{makeStyles as n}from"@material-ui/core";import{Tooltip as l}from"../../Tooltip/Tooltip.js";import"../../Tooltip/ScrollableTooltip.js";import{ALERT_STATES as s,BADGE_ICON_STATUSES as p}from"../constants.js";var c=n((function(e){return{errorIcon:{width:20,height:18},title:{maxWidth:198,padding:"0 0 8px",fontSize:16,lineHeight:"22px",color:e.palette.primary.text1},alertTime:{fontSize:14,color:e.palette.primary.text6,"& span":{color:e.palette.primary.text1}},alertMessage:{width:"100%",height:40,margin:0,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box","-webkit-line-clamp":2,"-webkit-box-orient":"vertical",whiteSpace:"pre-wrap",fontSize:14,lineHeight:"20px",color:e.palette.primary.text1},alertMessageFull:{marginBottom:8,fontSize:14,lineHeight:"20px",color:e.palette.primary.text1,whiteSpace:"pre-wrap"},alertInfo:{display:"flex",alignItems:"center",flexWrap:"wrap",marginBottom:8,fontSize:14,textTransform:"capitalize","& span":{color:e.palette.primary.text6,marginRight:8},"& .error":{color:e.palette.error.main},"& .warning":{color:"#ffa500"}},resolvedInfo:{display:"flex",alignItems:"center",marginBottom:8,color:e.palette.primary.text6,fontSize:14},infoIcon:{color:e.palette.info.main,marginRight:8,fontSize:16},popover:{marginLeft:
|
|
1
|
+
import{__assign as e}from'./../../../ext-esm/tslib/tslib.es6.js';import{jsx as t,jsxs as r,Fragment as a}from"react/jsx-runtime";import i from"moment";import{template as o}from"lodash";import{makeStyles as n}from"@material-ui/core";import{Tooltip as l}from"../../Tooltip/Tooltip.js";import"../../Tooltip/ScrollableTooltip.js";import{ALERT_STATES as s,BADGE_ICON_STATUSES as p}from"../constants.js";var c=n((function(e){return{errorIcon:{width:20,height:18},title:{maxWidth:198,padding:"0 0 8px",fontSize:16,lineHeight:"22px",color:e.palette.primary.text1},alertTime:{fontSize:14,color:e.palette.primary.text6,"& span":{color:e.palette.primary.text1}},alertMessage:{width:"100%",height:40,margin:0,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box","-webkit-line-clamp":2,"-webkit-box-orient":"vertical",whiteSpace:"pre-wrap",fontSize:14,lineHeight:"20px",color:e.palette.primary.text1},alertMessageFull:{marginBottom:8,fontSize:14,lineHeight:"20px",color:e.palette.primary.text1,whiteSpace:"pre-wrap"},alertInfo:{display:"flex",alignItems:"center",flexWrap:"wrap",marginBottom:8,fontSize:14,textTransform:"capitalize","& span":{color:e.palette.primary.text6,marginRight:8},"& .error":{color:e.palette.error.main},"& .warning":{color:"#ffa500"}},resolvedInfo:{display:"flex",alignItems:"center",marginBottom:8,color:e.palette.primary.text6,fontSize:14},infoIcon:{color:e.palette.info.main,marginRight:8,fontSize:16},popover:{marginLeft:8,width:270,minHeight:122,padding:12,display:"flex",flexDirection:"column",justifyContent:"space-between",backgroundColor:e.palette.background.b9,border:"1px solid ".concat(e.palette.primary.text9),boxShadow:"0px 3px 10px rgba(0, 0, 0, 0.4)",borderRadius:4,"& .MuiTooltip-tooltip":{backgroundColor:e.palette.background.b9,fontWeight:400,lineHeight:"20px",margin:0,padding:0}},message:{whiteSpace:"pre-wrap"},note:{marginBottom:4}}})),m=function(e){return i.unix(e).format("DD MMM HH:mm (Z)")},d=function(r){var a=r.children,i=c(),n=o(a)({timestampFormatter:m}).split("**").map((function(e,r){return r%2==1?t("b",{children:e}):e}));return t("span",e({className:i.message},{children:n}))},h=function(o){var n,m,h,f=o.alert,g=o.anchorEl,x=o.alertIcon,u=o.children,b=o.isTooltipVisible,w=c(),v=Math.max(f.statusUpdatedAt,f.lastCheckedAt),y=(void 0===h&&(h="MM/DD/YYYY HH:mm a"),(m=v)?i.unix(m).format(h):null);return t(l,{interactive:!0,children:u,PopperProps:{anchorEl:g,className:w.popover},placement:"right",title:b?r(a,{children:[t("div",e({className:w.title},{children:f.name})),r("span",e({className:w.alertInfo},{children:[t("span",{children:"Category:"})," ",f.category]})),r("span",e({className:w.alertInfo},{children:[t("span",{children:"Status:"})," ",f.status]})),r("span",e({className:w.alertInfo},{children:[t("span",{children:"Error Type:"}),t("div",e({className:w.errorIcon},{children:x})),t("span",e({className:f.state===s.issue?p.warning:p.error},{children:f.state}))]})),r("span",e({className:w.alertInfo},{children:[t("span",{children:"Score Deduction:"}),t("span",e({className:p.warning},{children:"6%"}))]})),r("div",e({className:w.alertMessageFull},{children:[f.isThrottled&&t("b",{children:"[Throttled]: "}),t(d,{children:f.message})]})),r("span",e({className:w.alertInfo},{children:[t("span",e({className:w.note},{children:"Note:"}))," ",(null===(n=f.note)||void 0===n?void 0:n.length)?f.note:"—"]})),r("span",e({className:w.alertTime},{children:["Updated at: ",t("span",{children:y})]}))]}):""})};export{h as DQAlertsTooltip};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as e,jsxs as o,Fragment as
|
|
1
|
+
import{__assign as t}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as e,jsxs as o,Fragment as a}from"react/jsx-runtime";import{useState as n}from"react";import r from"moment";import i from"classnames";import{makeStyles as s,Typography as c}from"@material-ui/core";import{Tooltip as p}from"../Tooltip/Tooltip.js";import"../Tooltip/ScrollableTooltip.js";import{WARNING as l,BADGE_ICON_STATUSES as m,MAX_MOBILE_WIDTH as d}from"./constants.js";import{DQStatusIcon as g}from"./components/DQStatusIcon.js";import{DQUnvalidatedContent as u}from"./components/DQUnvalidatedContent.js";import{DQSuccessContent as f}from"./components/DQSuccessContent.js";import{ReportIssueModal as x}from"./components/ReportIssueModal.js";var h=s((function(t){return{statusBadgeWrapper:{backgroundColor:t.palette.background.b4,display:"flex",height:30},statusBadgeContent:{display:"flex",padding:function(t){var e=t.isSuccessTypeIcon,o=t.isErrorTypeIcon;return"12px 0 2px ".concat(e||o?6:2,"px")},whiteSpace:"nowrap",width:"calc(100% - 140px)"},text:{fontSize:"10px",lineHeight:"12px",alignSelf:"center"},timestamp:{color:t.palette.primary.text6,marginLeft:function(t){return t.isIconExist&&4}},warningMessage:{color:t.palette.primary.text1,marginLeft:4,textOverflow:"ellipsis",overflow:"hidden",fontSize:"12px"},badgeIconWarning:{marginLeft:8},popper:{"& .MuiTooltip-tooltip":{maxWidth:455,padding:4,fontSize:12,boxShadow:"0px 0px 4px 2px rgb(0 0 0 / 12%)",fontWeight:400,lineHeight:"16px",letterSpacing:"0.4px",backgroundColor:t.palette.background.b9}},DQIconWrapper:{display:"flex",alignItems:"center",alignSelf:"center",justifyContent:"center",height:24,width:24,borderRadius:12,"&:hover":{backgroundColor:function(t){var e=t.isErrorTypeIcon,o=t.isSuccessTypeIcon;return e?"rgba(244, 67, 54, 0.1)":o?"rgba(117, 219, 41, 0.2)":"transparent"}}}}})),b=function(s){var b,v=s.assetsData,y=void 0===v?[]:v,S=s.appWidth,I=s.iconType,T=s.className,w=s.lastTimestamp,_=s.warningData,D=n(!1),j=D[0],C=D[1],W=null==_?void 0:_.message,N=I==m.error,Q=I==m.success,k=S<d,E=h({isIconExist:!!I,isSuccessTypeIcon:Q,isErrorTypeIcon:N});return N&&(b=e(u,{assetsData:y})),Q&&(b=e(f,{onClick:function(){return C(!0)}})),o("div",t({"data-testid":"Status_badge",className:i(E.statusBadgeWrapper,T)},{children:[o("div",t({className:E.statusBadgeContent},{children:[I&&e(p,t({interactive:N||Q,PopperProps:N&&{className:E.popper},placement:"top-start",title:b},{children:e("div",t({className:E.DQIconWrapper,"data-testid":"".concat("Status_badge","__DQ_icon_").concat(I)},{children:e(g,{color:I,iconType:I})}))})),o(c,t({className:i(E.text,E.timestamp),variant:"body1"},{children:["Last Update: ",r.unix(w).format("M/D/YYYY h:mm a")]})),_&&o(a,{children:[e(p,t({placement:"top",title:W?"".concat(l,". ").concat(W):l},{children:e("div",t({"data-testid":"".concat("Status_badge","__DQ_icon_warning")},{children:e(g,{className:E.badgeIconWarning,color:m.warning,iconType:m.warning})}))})),!k&&e(c,t({className:i(E.text,E.warningMessage),variant:"body1"},{children:W?"".concat(l,". ").concat(W):l}))]})]})),Q&&e(x,{open:j,onClose:function(){return C(!1)}})]}))};export{b as StatusBadge};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corva/ui",
|
|
3
|
-
"version": "0.56.0-
|
|
3
|
+
"version": "0.56.0-4",
|
|
4
4
|
"description": "Shared components/utils for Corva ui projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"corva-ui"
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"module": "./index.js",
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "yarn generate-css-themes && ./scripts/build.sh production",
|
|
13
|
+
"build-dev": "yarn generate-css-themes && ./scripts/build.sh development",
|
|
13
14
|
"build-watch": "yarn generate-css-themes && ./scripts/build.sh development -w",
|
|
14
15
|
"get-changelog": "conventional-changelog -r 2 -p angular",
|
|
15
16
|
"lint": "eslint --cache ./src/",
|