@uiw/react-heat-map
Advanced tools
Comparing version 2.2.1 to 2.2.2
@@ -10,3 +10,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
root["@uiw/react-heat-map"] = factory(root["React"]); | ||
})(self, (__WEBPACK_EXTERNAL_MODULE__787__) => { | ||
})(self, (__WEBPACK_EXTERNAL_MODULE__442__) => { | ||
return /******/ (() => { // webpackBootstrap | ||
@@ -16,3 +16,3 @@ /******/ "use strict"; | ||
/***/ 426: | ||
/***/ 192: | ||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | ||
@@ -30,3 +30,3 @@ | ||
*/ | ||
var f=__webpack_require__(787),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0}; | ||
var f=__webpack_require__(442),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0}; | ||
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}__webpack_unused_export__=l;exports.jsx=q;exports.jsxs=q; | ||
@@ -37,3 +37,3 @@ | ||
/***/ 246: | ||
/***/ 540: | ||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | ||
@@ -44,3 +44,3 @@ | ||
if (true) { | ||
module.exports = __webpack_require__(426); | ||
module.exports = __webpack_require__(192); | ||
} else {} | ||
@@ -51,6 +51,6 @@ | ||
/***/ 787: | ||
/***/ 442: | ||
/***/ ((module) => { | ||
module.exports = __WEBPACK_EXTERNAL_MODULE__787__; | ||
module.exports = __WEBPACK_EXTERNAL_MODULE__442__; | ||
@@ -150,11 +150,11 @@ /***/ }) | ||
function _toPrimitive(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") return res; | ||
function toPrimitive(t, r) { | ||
if ("object" != _typeof(t) || !t) return t; | ||
var e = t[Symbol.toPrimitive]; | ||
if (void 0 !== e) { | ||
var i = e.call(t, r || "default"); | ||
if ("object" != _typeof(i)) return i; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
return ("string" === r ? String : Number)(t); | ||
} | ||
@@ -164,5 +164,5 @@ ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
function toPropertyKey(t) { | ||
var i = toPrimitive(t, "string"); | ||
return "symbol" == _typeof(i) ? i : String(i); | ||
} | ||
@@ -172,3 +172,3 @@ ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/defineProperty.js | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
key = toPropertyKey(key); | ||
if (key in obj) { | ||
@@ -240,3 +240,3 @@ Object.defineProperty(obj, key, { | ||
// EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"} | ||
var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__(787); | ||
var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__(442); | ||
var external_root_React_commonjs2_react_commonjs_react_amd_react_default = /*#__PURE__*/__webpack_require__.n(external_root_React_commonjs2_react_commonjs_react_amd_react_); | ||
@@ -325,3 +325,3 @@ ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js | ||
// EXTERNAL MODULE: ../node_modules/react/jsx-runtime.js | ||
var jsx_runtime = __webpack_require__(246); | ||
var jsx_runtime = __webpack_require__(540); | ||
;// CONCATENATED MODULE: ./src/LabelsWeek.tsx | ||
@@ -337,5 +337,5 @@ var textStyle={textAnchor:'middle',fontSize:'inherit',fill:'currentColor'};var LabelsWeek=function LabelsWeek(_ref){var _ref$weekLabels=_ref.weekLabels,weekLabels=_ref$weekLabels===void 0?[]:_ref$weekLabels,_ref$rectSize=_ref.rectSize,rectSize=_ref$rectSize===void 0?0:_ref$rectSize,_ref$topPad=_ref.topPad,topPad=_ref$topPad===void 0?0:_ref$topPad,_ref$space=_ref.space,space=_ref$space===void 0?0:_ref$space;return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return/*#__PURE__*/(0,jsx_runtime.jsx)(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment,{children:_toConsumableArray(Array(7)).map(function(_,idx){if(weekLabels&&weekLabels[idx]){return/*#__PURE__*/(0,jsx_runtime.jsx)("text",{className:"w-heatmap-week",x:15,y:topPad,dy:(idx+1)*(rectSize+space)-5,style:textStyle,children:weekLabels[idx]},idx);}return null;})});},[rectSize,space,topPad,weekLabels]);}; | ||
var Legend_excluded=["panelColors","leftPad","topPad","rectY","space","rectSize","legendCellSize","legendRender"];function Legend(_ref){var panelColors=_ref.panelColors,_ref$leftPad=_ref.leftPad,leftPad=_ref$leftPad===void 0?0:_ref$leftPad,_ref$topPad=_ref.topPad,topPad=_ref$topPad===void 0?0:_ref$topPad,_ref$rectY=_ref.rectY,rectY=_ref$rectY===void 0?15:_ref$rectY,_ref$space=_ref.space,space=_ref$space===void 0?0:_ref$space,_ref$rectSize=_ref.rectSize,rectSize=_ref$rectSize===void 0?0:_ref$rectSize,_ref$legendCellSize=_ref.legendCellSize,legendCellSize=_ref$legendCellSize===void 0?0:_ref$legendCellSize,legendRender=_ref.legendRender,props=_objectWithoutProperties(_ref,Legend_excluded);var size=legendCellSize||rectSize;return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return/*#__PURE__*/(0,jsx_runtime.jsx)(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment,{children:Object.keys(panelColors||{}).map(function(num,key){var rectProps=_objectSpread2(_objectSpread2({},props),{},{key:key,x:(size+1)*key+leftPad,y:rectY,// y: topPad + rectSize * 8 + 6, | ||
fill:panelColors[Number(num)],width:size,height:size});if(legendRender)return legendRender(rectProps);return/*#__PURE__*/(0,jsx_runtime.jsx)(Rect,_objectSpread2({},rectProps));})});},[panelColors,props,size,rectY,leftPad,rectSize,legendRender]);} | ||
fill:panelColors[Number(num)],width:size,height:size});if(legendRender)return legendRender(rectProps);return/*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement)(Rect,_objectSpread2(_objectSpread2({},rectProps),{},{key:key}));})});},[panelColors,props,size,rectY,leftPad,rectSize,legendRender]);} | ||
;// CONCATENATED MODULE: ./src/Day.tsx | ||
var Day=function Day(props){var transform=props.transform,_props$gridNum=props.gridNum,gridNum=_props$gridNum===void 0?0:_props$gridNum,_props$startY=props.startY,startY=_props$startY===void 0?0:_props$startY,_props$panelColors=props.panelColors,panelColors=_props$panelColors===void 0?{}:_props$panelColors,initStartDate=props.initStartDate,_props$space=props.space,space=_props$space===void 0?2:_props$space,_props$value=props.value,value=_props$value===void 0?[]:_props$value,_props$rectSize=props.rectSize,rectSize=_props$rectSize===void 0?11:_props$rectSize,endDate=props.endDate,rectProps=props.rectProps,rectRender=props.rectRender;var data=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return formatData(value);},[value]);var nums=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return numberSort(Object.keys(panelColors).map(function(item){return parseInt(item,10);}));},[panelColors]);return/*#__PURE__*/(0,jsx_runtime.jsx)("g",{transform:transform,children:gridNum>0&&_toConsumableArray(Array(gridNum)).map(function(_,idx){return/*#__PURE__*/(0,jsx_runtime.jsx)("g",{"data-column":idx,children:_toConsumableArray(Array(7)).map(function(_,cidx){var currentDate=new Date(initStartDate.getTime()+oneDayTime*(idx*7+cidx));var date=getDateToString(currentDate);var dataProps=_objectSpread2(_objectSpread2({},data[date]),{},{date:date,row:cidx,column:idx,index:idx*7+cidx});var dayProps=_objectSpread2(_objectSpread2({},rectProps),{},{key:cidx,fill:'var(--rhm-rect, #EBEDF0)',width:rectSize,height:rectSize,x:idx*(rectSize+space),y:(rectSize+space)*cidx,render:rectRender,value:dataProps});if(endDate instanceof Date&¤tDate.getTime()>endDate.getTime()){return null;}if(date&&data[date]&&panelColors&&Object.keys(panelColors).length>0){dayProps.fill=existColor(data[date].count||0,nums,panelColors);}else if(panelColors&&panelColors[0]){dayProps.fill=panelColors[0];}return/*#__PURE__*/(0,jsx_runtime.jsx)(Rect,_objectSpread2(_objectSpread2({},dayProps),{},{value:dataProps,"data-date":date,"data-index":dataProps.index,"data-row":dataProps.row,"data-column":dataProps.column}));})},idx);})});}; | ||
var Day=function Day(props){var transform=props.transform,_props$gridNum=props.gridNum,gridNum=_props$gridNum===void 0?0:_props$gridNum,_props$startY=props.startY,startY=_props$startY===void 0?0:_props$startY,_props$panelColors=props.panelColors,panelColors=_props$panelColors===void 0?{}:_props$panelColors,initStartDate=props.initStartDate,_props$space=props.space,space=_props$space===void 0?2:_props$space,_props$value=props.value,value=_props$value===void 0?[]:_props$value,_props$rectSize=props.rectSize,rectSize=_props$rectSize===void 0?11:_props$rectSize,endDate=props.endDate,rectProps=props.rectProps,rectRender=props.rectRender;var data=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return formatData(value);},[value]);var nums=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return numberSort(Object.keys(panelColors).map(function(item){return parseInt(item,10);}));},[panelColors]);return/*#__PURE__*/(0,jsx_runtime.jsx)("g",{transform:transform,children:gridNum>0&&_toConsumableArray(Array(gridNum)).map(function(_,idx){return/*#__PURE__*/(0,jsx_runtime.jsx)("g",{"data-column":idx,children:_toConsumableArray(Array(7)).map(function(_,cidx){var currentDate=new Date(initStartDate.getTime()+oneDayTime*(idx*7+cidx));var date=getDateToString(currentDate);var dataProps=_objectSpread2(_objectSpread2({},data[date]),{},{date:date,row:cidx,column:idx,index:idx*7+cidx});var dayProps=_objectSpread2(_objectSpread2({},rectProps),{},{fill:'var(--rhm-rect, #EBEDF0)',width:rectSize,height:rectSize,x:idx*(rectSize+space),y:(rectSize+space)*cidx,render:rectRender,value:dataProps});if(endDate instanceof Date&¤tDate.getTime()>endDate.getTime()){return null;}if(date&&data[date]&&panelColors&&Object.keys(panelColors).length>0){dayProps.fill=existColor(data[date].count||0,nums,panelColors);}else if(panelColors&&panelColors[0]){dayProps.fill=panelColors[0];}return/*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement)(Rect,_objectSpread2(_objectSpread2({},dayProps),{},{key:cidx,value:dataProps,"data-date":date,"data-index":dataProps.index,"data-row":dataProps.row,"data-column":dataProps.column}));})},idx);})});}; | ||
;// CONCATENATED MODULE: ./src/SVG.tsx | ||
@@ -342,0 +342,0 @@ var SVG_excluded=["rectSize","legendCellSize","space","monthPlacement","startDate","endDate","rectProps","rectRender","legendRender","value","weekLabels","monthLabels","panelColors","style"];function SVG(props){var _ref=props||{},_ref$rectSize=_ref.rectSize,rectSize=_ref$rectSize===void 0?11:_ref$rectSize,_ref$legendCellSize=_ref.legendCellSize,legendCellSize=_ref$legendCellSize===void 0?11:_ref$legendCellSize,_ref$space=_ref.space,space=_ref$space===void 0?2:_ref$space,_ref$monthPlacement=_ref.monthPlacement,monthPlacement=_ref$monthPlacement===void 0?'top':_ref$monthPlacement,_ref$startDate=_ref.startDate,startDate=_ref$startDate===void 0?new Date():_ref$startDate,endDate=_ref.endDate,rectProps=_ref.rectProps,rectRender=_ref.rectRender,legendRender=_ref.legendRender,_ref$value=_ref.value,value=_ref$value===void 0?[]:_ref$value,_ref$weekLabels=_ref.weekLabels,weekLabels=_ref$weekLabels===void 0?['Sun','Mon','Tue','Wed','Thu','Fri','Sat']:_ref$weekLabels,_ref$monthLabels=_ref.monthLabels,monthLabels=_ref$monthLabels===void 0?['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']:_ref$monthLabels,_ref$panelColors=_ref.panelColors,panelColors=_ref$panelColors===void 0?{0:'var(--rhm-rect, #EBEDF0)',8:'#7BC96F',4:'#C6E48B',12:'#239A3B',32:'#196127'}:_ref$panelColors,style=_ref.style,other=_objectWithoutProperties(_ref,SVG_excluded);var _useState=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),_useState2=_slicedToArray(_useState,2),gridNum=_useState2[0],setGridNum=_useState2[1];var _useState3=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(!!weekLabels?28:5),_useState4=_slicedToArray(_useState3,2),leftPad=_useState4[0],setLeftPad=_useState4[1];var defaultTopPad=monthPlacement==='top'?20:5;var _useState5=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(!!monthLabels?defaultTopPad:5),_useState6=_slicedToArray(_useState5,2),topPad=_useState6[0],setTopPad=_useState6[1];var svgRef=/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function(){return setLeftPad(!!weekLabels?28:5);},[weekLabels]);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function(){if(svgRef.current){var width=svgRef.current.clientWidth-leftPad||0;setGridNum(Math.floor(width/(rectSize+space))||0);}},[rectSize,svgRef,space,leftPad]);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function(){setTopPad(!!monthLabels?defaultTopPad:5);},[monthLabels]);var initStartDate=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){if(isValidDate(startDate)){return!startDate.getDay()?startDate:new Date(startDate.getTime()-startDate.getDay()*oneDayTime);}else{var newDate=new Date();return new Date(newDate.getTime()-newDate.getDay()*oneDayTime);}},[startDate]);var styl={color:'var(--rhm-text-color, #24292e)',userSelect:'none',display:'block',fontSize:10};var monthRectY=monthPlacement==='top'?15:15*7+space;var legendTopPad=monthPlacement==='top'?topPad+rectSize*8+6:(!!monthLabels?topPad+rectSize+space:topPad)+rectSize*8+6;return/*#__PURE__*/(0,jsx_runtime.jsxs)("svg",_objectSpread2(_objectSpread2({ref:svgRef,style:_objectSpread2(_objectSpread2({},styl),style)},other),{},{children:[legendCellSize!==0&&/*#__PURE__*/(0,jsx_runtime.jsx)(Legend,{legendRender:legendRender,panelColors:panelColors,rectSize:rectSize,rectY:legendTopPad,legendCellSize:legendCellSize,leftPad:leftPad,topPad:topPad,space:space}),/*#__PURE__*/(0,jsx_runtime.jsx)(LabelsWeek,{weekLabels:weekLabels,rectSize:rectSize,space:space,topPad:topPad}),/*#__PURE__*/(0,jsx_runtime.jsx)(LabelsMonth,{monthLabels:monthLabels,rectSize:rectSize,space:space,leftPad:leftPad,colNum:gridNum,rectY:monthRectY,startDate:initStartDate}),/*#__PURE__*/(0,jsx_runtime.jsx)(Day,{transform:"translate(".concat(leftPad,", ").concat(topPad,")"),gridNum:gridNum,initStartDate:initStartDate,endDate:endDate,rectProps:rectProps,rectSize:rectSize,rectRender:rectRender,panelColors:panelColors,value:value,space:space})]}));} |
/*! For license information please see heat-map.min.js.LICENSE.txt */ | ||
!function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("react")):"function"===typeof define&&define.amd?define(["react"],t):"object"===typeof exports?exports["@uiw/react-heat-map"]=t(require("react")):e["@uiw/react-heat-map"]=t(e.React)}(self,(e=>(()=>{"use strict";var t={426:(e,t,r)=>{var n=r(787),o=Symbol.for("react.element"),a=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,r){var n,a={},u=null,f=null;for(n in void 0!==r&&(u=""+r),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(f=t.ref),t)i.call(t,n)&&!c.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===a[n]&&(a[n]=t[n]);return{$$typeof:o,type:e,key:u,ref:f,props:a,_owner:l.current}}t.jsx=u,t.jsxs=u},246:(e,t,r)=>{e.exports=r(426)},787:t=>{t.exports=e}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t){var r=function(t,r){if("object"!==e(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,r||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"===e(r)?r:String(r)}function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?r(Object(o),!0).forEach((function(r){var n,a,i;n=e,a=r,i=o[r],(a=t(a))in n?Object.defineProperty(n,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[a]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function i(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}n.r(o),n.d(o,{default:()=>k});var l=n(787),c=n.n(l);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function f(e,t){if(e){if("string"===typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return l}}(e,t)||f(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var p=n(246),y={textAnchor:"middle",fontSize:"inherit",fill:"currentColor"},m=function(e){var t=e.weekLabels,r=void 0===t?[]:t,n=e.rectSize,o=void 0===n?0:n,a=e.topPad,i=void 0===a?0:a,c=e.space,u=void 0===c?0:c;return(0,l.useMemo)((function(){return(0,p.jsx)(l.Fragment,{children:d(Array(7)).map((function(e,t){return r&&r[t]?(0,p.jsx)("text",{className:"w-heatmap-week",x:15,y:i,dy:(t+1)*(o+u)-5,style:y,children:r[t]},t):null}))})}),[o,u,i,r])},v=864e5;function b(e){return e instanceof Date&&!isNaN(e.getTime())}function g(e){return"".concat(e.getFullYear(),"/").concat(e.getMonth()+1,"/").concat(e.getDate())}var h=function(e){var t=e.monthLabels,r=void 0===t?[]:t,n=e.rectSize,o=void 0===n?0:n,a=e.space,i=void 0===a?0:a,c=e.leftPad,u=void 0===c?0:c,f=e.colNum,s=void 0===f?0:f,m=e.rectY,b=void 0===m?15:m,g=e.startDate,h=(0,l.useMemo)((function(){return!1===r||s<1?[]:d(Array(7*s)).map((function(e,t){if(t/7%1===0){var n=new Date(g.getTime()+t*v),o=n.getMonth();return{col:t/7,index:t,month:o,day:n.getDate(),monthStr:r[o],date:n}}return null})).filter(Boolean).filter((function(e,t,r){return r[t-1]&&r[t-1].month!==e.month}))}),[s,r,g]);return(0,p.jsx)(l.Fragment,{children:d(h).map((function(e,t){return(0,p.jsx)("text",{"data-size":o,x:u+i+i,y:b,dx:e.col*(o+i),textAnchor:"start",style:y,children:e.monthStr},t)}))})},S=["style","value","render","key"],j=function(e){var t=e.style,r=e.value,n=e.render,o=(e.key,a(a({},i(e,S)),{},{style:a({display:"block",cursor:"pointer"},t)}));if(n&&"function"===typeof n){var l=n(a({},o),r);if(l&&c().isValidElement(l))return l}return(0,p.jsx)("rect",a({},o))},x=["panelColors","leftPad","topPad","rectY","space","rectSize","legendCellSize","legendRender"];function O(e){var t=e.panelColors,r=e.leftPad,n=void 0===r?0:r,o=(e.topPad,e.rectY),c=void 0===o?15:o,u=(e.space,e.rectSize),f=void 0===u?0:u,s=e.legendCellSize,d=void 0===s?0:s,y=e.legendRender,m=i(e,x),v=d||f;return(0,l.useMemo)((function(){return(0,p.jsx)(l.Fragment,{children:Object.keys(t||{}).map((function(e,r){var o=a(a({},m),{},{key:r,x:(v+1)*r+n,y:c,fill:t[Number(e)],width:v,height:v});return y?y(o):(0,p.jsx)(j,a({},o))}))})}),[t,m,v,c,n,f,y])}var w=function(e){var t=e.transform,r=e.gridNum,n=void 0===r?0:r,o=(e.startY,e.panelColors),i=void 0===o?{}:o,c=e.initStartDate,u=e.space,f=void 0===u?2:u,s=e.value,y=void 0===s?[]:s,m=e.rectSize,h=void 0===m?11:m,S=e.endDate,x=e.rectProps,O=e.rectRender,w=(0,l.useMemo)((function(){return function(){var e={};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(t){t.date&&b(new Date(t.date))&&(t.date=g(new Date(t.date)),e[t.date]=t)})),e}(y)}),[y]),P=(0,l.useMemo)((function(){return function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).sort((function(e,t){return e<t?-1:e>t?1:0}))}(Object.keys(i).map((function(e){return parseInt(e,10)})))}),[i]);return(0,p.jsx)("g",{transform:t,children:n>0&&d(Array(n)).map((function(e,t){return(0,p.jsx)("g",{"data-column":t,children:d(Array(7)).map((function(e,r){var n=new Date(c.getTime()+v*(7*t+r)),o=g(n),l=a(a({},w[o]),{},{date:o,row:r,column:t,index:7*t+r}),u=a(a({},x),{},{key:r,fill:"var(--rhm-rect, #EBEDF0)",width:h,height:h,x:t*(h+f),y:(h+f)*r,render:O,value:l});return S instanceof Date&&n.getTime()>S.getTime()?null:(o&&w[o]&&i&&Object.keys(i).length>0?u.fill=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n="",o=0;o<t.length;o+=1){if(t[o]>e){n=r[t[o]];break}n=r[t[o]]}return n}(w[o].count||0,P,i):i&&i[0]&&(u.fill=i[0]),(0,p.jsx)(j,a(a({},u),{},{value:l,"data-date":o,"data-index":l.index,"data-row":l.row,"data-column":l.column})))}))},t)}))})},P=["rectSize","legendCellSize","space","monthPlacement","startDate","endDate","rectProps","rectRender","legendRender","value","weekLabels","monthLabels","panelColors","style"];function D(e){var t=e||{},r=t.rectSize,n=void 0===r?11:r,o=t.legendCellSize,u=void 0===o?11:o,f=t.space,d=void 0===f?2:f,y=t.monthPlacement,g=void 0===y?"top":y,S=t.startDate,j=void 0===S?new Date:S,x=t.endDate,D=t.rectProps,E=t.rectRender,k=t.legendRender,C=t.value,_=void 0===C?[]:C,z=t.weekLabels,A=void 0===z?["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]:z,T=t.monthLabels,M=void 0===T?["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]:T,N=t.panelColors,R=void 0===N?{0:"var(--rhm-rect, #EBEDF0)",8:"#7BC96F",4:"#C6E48B",12:"#239A3B",32:"#196127"}:N,L=t.style,F=i(t,P),I=s((0,l.useState)(0),2),B=I[0],Y=I[1],J=s((0,l.useState)(A?28:5),2),U=J[0],W=J[1],$="top"===g?20:5,q=s((0,l.useState)(M?$:5),2),V=q[0],G=q[1],H=c().createRef();(0,l.useEffect)((function(){return W(A?28:5)}),[A]),(0,l.useEffect)((function(){if(H.current){var e=H.current.clientWidth-U||0;Y(Math.floor(e/(n+d))||0)}}),[n,H,d,U]),(0,l.useEffect)((function(){G(M?$:5)}),[M]);var K=(0,l.useMemo)((function(){if(b(j))return j.getDay()?new Date(j.getTime()-j.getDay()*v):j;var e=new Date;return new Date(e.getTime()-e.getDay()*v)}),[j]),Q="top"===g?15:105+d,X="top"===g?V+8*n+6:(M?V+n+d:V)+8*n+6;return(0,p.jsxs)("svg",a(a({ref:H,style:a(a({},{color:"var(--rhm-text-color, #24292e)",userSelect:"none",display:"block",fontSize:10}),L)},F),{},{children:[0!==u&&(0,p.jsx)(O,{legendRender:k,panelColors:R,rectSize:n,rectY:X,legendCellSize:u,leftPad:U,topPad:V,space:d}),(0,p.jsx)(m,{weekLabels:A,rectSize:n,space:d,topPad:V}),(0,p.jsx)(h,{monthLabels:M,rectSize:n,space:d,leftPad:U,colNum:B,rectY:Q,startDate:K}),(0,p.jsx)(w,{transform:"translate(".concat(U,", ").concat(V,")"),gridNum:B,initStartDate:K,endDate:x,rectProps:D,rectSize:n,rectRender:E,panelColors:R,value:_,space:d})]}))}var E=["prefixCls","className"];function k(e){var t=e.prefixCls,r=void 0===t?"w-heatmap":t,n=e.className,o=i(e,E),l=[n,r].filter(Boolean).join(" ");return(0,p.jsx)(D,a({className:l},o))}})(),o})())); | ||
!function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("react")):"function"===typeof define&&define.amd?define(["react"],t):"object"===typeof exports?exports["@uiw/react-heat-map"]=t(require("react")):e["@uiw/react-heat-map"]=t(e.React)}(self,(e=>(()=>{"use strict";var t={192:(e,t,r)=>{var n=r(442),o=Symbol.for("react.element"),a=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,r){var n,a={},u=null,f=null;for(n in void 0!==r&&(u=""+r),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(f=t.ref),t)i.call(t,n)&&!c.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===a[n]&&(a[n]=t[n]);return{$$typeof:o,type:e,key:u,ref:f,props:a,_owner:l.current}}t.jsx=u,t.jsxs=u},540:(e,t,r)=>{e.exports=r(192)},442:t=>{t.exports=e}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t){var r=function(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,r||"default");if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==e(r)?r:String(r)}function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?r(Object(o),!0).forEach((function(r){var n,a,i;n=e,a=r,i=o[r],(a=t(a))in n?Object.defineProperty(n,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[a]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function i(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}n.r(o),n.d(o,{default:()=>k});var l=n(442),c=n.n(l);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function f(e,t){if(e){if("string"===typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return l}}(e,t)||f(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var p=n(540),y={textAnchor:"middle",fontSize:"inherit",fill:"currentColor"},m=function(e){var t=e.weekLabels,r=void 0===t?[]:t,n=e.rectSize,o=void 0===n?0:n,a=e.topPad,i=void 0===a?0:a,c=e.space,u=void 0===c?0:c;return(0,l.useMemo)((function(){return(0,p.jsx)(l.Fragment,{children:d(Array(7)).map((function(e,t){return r&&r[t]?(0,p.jsx)("text",{className:"w-heatmap-week",x:15,y:i,dy:(t+1)*(o+u)-5,style:y,children:r[t]},t):null}))})}),[o,u,i,r])},v=864e5;function b(e){return e instanceof Date&&!isNaN(e.getTime())}function g(e){return"".concat(e.getFullYear(),"/").concat(e.getMonth()+1,"/").concat(e.getDate())}var h=function(e){var t=e.monthLabels,r=void 0===t?[]:t,n=e.rectSize,o=void 0===n?0:n,a=e.space,i=void 0===a?0:a,c=e.leftPad,u=void 0===c?0:c,f=e.colNum,s=void 0===f?0:f,m=e.rectY,b=void 0===m?15:m,g=e.startDate,h=(0,l.useMemo)((function(){return!1===r||s<1?[]:d(Array(7*s)).map((function(e,t){if(t/7%1===0){var n=new Date(g.getTime()+t*v),o=n.getMonth();return{col:t/7,index:t,month:o,day:n.getDate(),monthStr:r[o],date:n}}return null})).filter(Boolean).filter((function(e,t,r){return r[t-1]&&r[t-1].month!==e.month}))}),[s,r,g]);return(0,p.jsx)(l.Fragment,{children:d(h).map((function(e,t){return(0,p.jsx)("text",{"data-size":o,x:u+i+i,y:b,dx:e.col*(o+i),textAnchor:"start",style:y,children:e.monthStr},t)}))})},S=["style","value","render","key"],j=function(e){var t=e.style,r=e.value,n=e.render,o=(e.key,a(a({},i(e,S)),{},{style:a({display:"block",cursor:"pointer"},t)}));if(n&&"function"===typeof n){var l=n(a({},o),r);if(l&&c().isValidElement(l))return l}return(0,p.jsx)("rect",a({},o))},O=["panelColors","leftPad","topPad","rectY","space","rectSize","legendCellSize","legendRender"];function x(e){var t=e.panelColors,r=e.leftPad,n=void 0===r?0:r,o=(e.topPad,e.rectY),c=void 0===o?15:o,u=(e.space,e.rectSize),f=void 0===u?0:u,s=e.legendCellSize,d=void 0===s?0:s,y=e.legendRender,m=i(e,O),v=d||f;return(0,l.useMemo)((function(){return(0,p.jsx)(l.Fragment,{children:Object.keys(t||{}).map((function(e,r){var o=a(a({},m),{},{key:r,x:(v+1)*r+n,y:c,fill:t[Number(e)],width:v,height:v});return y?y(o):(0,l.createElement)(j,a(a({},o),{},{key:r}))}))})}),[t,m,v,c,n,f,y])}var w=function(e){var t=e.transform,r=e.gridNum,n=void 0===r?0:r,o=(e.startY,e.panelColors),i=void 0===o?{}:o,c=e.initStartDate,u=e.space,f=void 0===u?2:u,s=e.value,y=void 0===s?[]:s,m=e.rectSize,h=void 0===m?11:m,S=e.endDate,O=e.rectProps,x=e.rectRender,w=(0,l.useMemo)((function(){return function(){var e={};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(t){t.date&&b(new Date(t.date))&&(t.date=g(new Date(t.date)),e[t.date]=t)})),e}(y)}),[y]),P=(0,l.useMemo)((function(){return function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).sort((function(e,t){return e<t?-1:e>t?1:0}))}(Object.keys(i).map((function(e){return parseInt(e,10)})))}),[i]);return(0,p.jsx)("g",{transform:t,children:n>0&&d(Array(n)).map((function(e,t){return(0,p.jsx)("g",{"data-column":t,children:d(Array(7)).map((function(e,r){var n=new Date(c.getTime()+v*(7*t+r)),o=g(n),u=a(a({},w[o]),{},{date:o,row:r,column:t,index:7*t+r}),s=a(a({},O),{},{fill:"var(--rhm-rect, #EBEDF0)",width:h,height:h,x:t*(h+f),y:(h+f)*r,render:x,value:u});return S instanceof Date&&n.getTime()>S.getTime()?null:(o&&w[o]&&i&&Object.keys(i).length>0?s.fill=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n="",o=0;o<t.length;o+=1){if(t[o]>e){n=r[t[o]];break}n=r[t[o]]}return n}(w[o].count||0,P,i):i&&i[0]&&(s.fill=i[0]),(0,l.createElement)(j,a(a({},s),{},{key:r,value:u,"data-date":o,"data-index":u.index,"data-row":u.row,"data-column":u.column})))}))},t)}))})},P=["rectSize","legendCellSize","space","monthPlacement","startDate","endDate","rectProps","rectRender","legendRender","value","weekLabels","monthLabels","panelColors","style"];function D(e){var t=e||{},r=t.rectSize,n=void 0===r?11:r,o=t.legendCellSize,u=void 0===o?11:o,f=t.space,d=void 0===f?2:f,y=t.monthPlacement,g=void 0===y?"top":y,S=t.startDate,j=void 0===S?new Date:S,O=t.endDate,D=t.rectProps,E=t.rectRender,k=t.legendRender,C=t.value,_=void 0===C?[]:C,z=t.weekLabels,A=void 0===z?["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]:z,T=t.monthLabels,M=void 0===T?["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]:T,N=t.panelColors,R=void 0===N?{0:"var(--rhm-rect, #EBEDF0)",8:"#7BC96F",4:"#C6E48B",12:"#239A3B",32:"#196127"}:N,L=t.style,F=i(t,P),I=s((0,l.useState)(0),2),B=I[0],Y=I[1],J=s((0,l.useState)(A?28:5),2),U=J[0],W=J[1],$="top"===g?20:5,q=s((0,l.useState)(M?$:5),2),V=q[0],G=q[1],H=c().createRef();(0,l.useEffect)((function(){return W(A?28:5)}),[A]),(0,l.useEffect)((function(){if(H.current){var e=H.current.clientWidth-U||0;Y(Math.floor(e/(n+d))||0)}}),[n,H,d,U]),(0,l.useEffect)((function(){G(M?$:5)}),[M]);var K=(0,l.useMemo)((function(){if(b(j))return j.getDay()?new Date(j.getTime()-j.getDay()*v):j;var e=new Date;return new Date(e.getTime()-e.getDay()*v)}),[j]),Q="top"===g?15:105+d,X="top"===g?V+8*n+6:(M?V+n+d:V)+8*n+6;return(0,p.jsxs)("svg",a(a({ref:H,style:a(a({},{color:"var(--rhm-text-color, #24292e)",userSelect:"none",display:"block",fontSize:10}),L)},F),{},{children:[0!==u&&(0,p.jsx)(x,{legendRender:k,panelColors:R,rectSize:n,rectY:X,legendCellSize:u,leftPad:U,topPad:V,space:d}),(0,p.jsx)(m,{weekLabels:A,rectSize:n,space:d,topPad:V}),(0,p.jsx)(h,{monthLabels:M,rectSize:n,space:d,leftPad:U,colNum:B,rectY:Q,startDate:K}),(0,p.jsx)(w,{transform:"translate(".concat(U,", ").concat(V,")"),gridNum:B,initStartDate:K,endDate:O,rectProps:D,rectSize:n,rectRender:E,panelColors:R,value:_,space:d})]}))}var E=["prefixCls","className"];function k(e){var t=e.prefixCls,r=void 0===t?"w-heatmap":t,n=e.className,o=i(e,E),l=[n,r].filter(Boolean).join(" ");return(0,p.jsx)(D,a({className:l},o))}})(),o})())); |
@@ -5,2 +5,3 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
import { formatData, getDateToString, existColor, numberSort, oneDayTime } from './utils'; | ||
import { createElement as _createElement } from "react"; | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
@@ -38,3 +39,2 @@ export var Day = props => { | ||
var dayProps = _extends({}, rectProps, { | ||
key: cidx, | ||
fill: 'var(--rhm-rect, #EBEDF0)', | ||
@@ -56,3 +56,4 @@ width: rectSize, | ||
} | ||
return /*#__PURE__*/_jsx(Rect, _extends({}, dayProps, { | ||
return /*#__PURE__*/_createElement(Rect, _extends({}, dayProps, { | ||
key: cidx, | ||
value: dataProps, | ||
@@ -59,0 +60,0 @@ "data-date": date, |
@@ -6,2 +6,3 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
import { Rect } from './Rect'; | ||
import { createElement as _createElement } from "react"; | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
@@ -33,5 +34,7 @@ export default function Legend(_ref) { | ||
if (legendRender) return legendRender(rectProps); | ||
return /*#__PURE__*/_jsx(Rect, _extends({}, rectProps)); | ||
return /*#__PURE__*/_createElement(Rect, _extends({}, rectProps, { | ||
key: key | ||
})); | ||
}) | ||
}), [panelColors, props, size, rectY, leftPad, rectSize, legendRender]); | ||
} |
@@ -55,3 +55,2 @@ "use strict"; | ||
var dayProps = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, rectProps), {}, { | ||
key: cidx, | ||
fill: 'var(--rhm-rect, #EBEDF0)', | ||
@@ -73,3 +72,4 @@ width: rectSize, | ||
} | ||
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Rect.Rect, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, dayProps), {}, { | ||
return /*#__PURE__*/(0, _react.createElement)(_Rect.Rect, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, dayProps), {}, { | ||
key: cidx, | ||
value: dataProps, | ||
@@ -76,0 +76,0 @@ "data-date": date, |
@@ -45,3 +45,5 @@ "use strict"; | ||
if (legendRender) return legendRender(rectProps); | ||
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Rect.Rect, (0, _objectSpread2["default"])({}, rectProps)); | ||
return /*#__PURE__*/(0, _react.createElement)(_Rect.Rect, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, rectProps), {}, { | ||
key: key | ||
})); | ||
}) | ||
@@ -48,0 +50,0 @@ }); |
{ | ||
"name": "@uiw/react-heat-map", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "React component create calendar heatmap to visualize time series data, a la github contribution graph.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://uiwjs.github.io/react-heat-map/", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
103414
1871