@corva/ui 0.36.0-6 → 0.36.0-7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.36.0-6",
3
+ "version": "0.36.0-7",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"
@@ -22,7 +22,7 @@
22
22
  "generate-css-themes": "node ./scripts/generateCssThemesVariables.mjs",
23
23
  "build-storybook": "IS_STORYBOOK_BUILD=true build-storybook -c storybook --no-dll",
24
24
  "storybook": "IS_STORYBOOK_BUILD=true start-storybook -p 6006 -c storybook --no-dll",
25
- "check-duplications": "jscpd src"
25
+ "check-duplications": "echo \"👀 Checking code duplications\" && jscpd src --silent"
26
26
  },
27
27
  "config": {
28
28
  "commitizen": {
@@ -30,7 +30,8 @@
30
30
  }
31
31
  },
32
32
  "pre-commit": [
33
- "lint-staged"
33
+ "lint-staged",
34
+ "check-duplications"
34
35
  ],
35
36
  "lint-staged": {
36
37
  "*.js": [
@@ -1 +1 @@
1
- import t from"@babel/runtime/helpers/toConsumableArray";var r="SMALL",n="MEDIUM",e="LARGE",o="XLARGE",i=37.7952755906,a=18.8976377953,s=function(t){var r=t.width,n=t.height;return{pixelWidth:Math.round(18.8976377953*r),pixelHeight:Math.round(18.8976377953*n),realWidth:Math.round(2*r*18.8976377953),realHeight:Math.round(2*n*18.8976377953)}},u={NORMAL:{type:"NORMAL",columns:{min:1,max:7},rows:{min:1,max:1e3},slots:1,height:17.5,width:20.8},WIDE:{type:"WIDE",columns:{min:8,max:12},rows:{min:1,max:25},slots:2,height:17.5,width:41.8},HALFSCREEN:{type:"HALFSCREEN",columns:{min:8,max:12},rows:{min:26,max:40},slots:4,height:26.5,width:41.8},FULLSCREEN:{type:"FULLSCREEN",columns:{min:8,max:12},rows:{min:41,max:1e3},slots:6,height:53.3,width:41.8}};function c(t){return t.concat().sort((function(t,r){var n=t.coordinates.y,e=r.coordinates.y;if(n<e)return-1;if(n>e)return 1;if(n===e){var o=t.coordinates.x,i=r.coordinates.x;if(o<i)return-1;if(o>i)return 1}return 0}))}function m(t){var r=t.coordinates,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"dashboard";if("singleApp"===n)return u.FULLSCREEN;var e=r.w,o=r.h;return Object.values(u).find((function(t){return e>=t.columns.min&&e<=t.columns.max&&o>=t.rows.min&&o<=t.rows.max}))}function h(r,n){var e,o=[],i=[o],a=0;return r.reduce((function(i,s,c){e=!1;var h=m(s,n),l=h.slots,d=h.type;if(d!==u.FULLSCREEN.type){var f=r[c+1];if(f){var p=m(f,n);if(a%2==0&&1===l&&p.slots%2==0){var E=u.WIDE;l=E.slots,d=E.type}}else if(c%2==0){var v=u.WIDE;l=v.slots,d=v.type}}a+=l;var L={app:s,slots:l,reportAppSize:h},x=i.map((function(r){if(e)return r;var n=6-r.reduce((function(t,r){return t+r.slots}),0);return n>=l&&(e=!0),n>=l?[].concat(t(r),[L]):r}));return e?x:[].concat(t(x),[[].concat(o,[L])])}),i)}function l(t){var i=t.w,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a?o:i>=5?e:i>=3?n:r}export{a as PDF_REPORT_PIXEL_RATIO,i as PIXELS_IN_CM,m as getAppType,s as getPDFAppPixelSize,l as getPDFAppSize,h as getPages,c as sortPDFDashboardApps};
1
+ import t from"@babel/runtime/helpers/toConsumableArray";var r="SMALL",n="MEDIUM",o="LARGE",e="XLARGE",i=37.7952755906,a=18.8976377953,u=function(t){var r=t.width,n=t.height;return{pixelWidth:Math.round(18.8976377953*r),pixelHeight:Math.round(18.8976377953*n),realWidth:Math.round(2*r*18.8976377953),realHeight:Math.round(2*n*18.8976377953)}},s={NORMAL:{type:"NORMAL",columns:{min:1,max:7},rows:{min:1,max:1e3},slots:1,height:17.5,width:20.8},WIDE:{type:"WIDE",columns:{min:8,max:12},rows:{min:1,max:25},slots:2,height:17.5,width:41.8},HALFSCREEN:{type:"HALFSCREEN",columns:{min:8,max:12},rows:{min:26,max:40},slots:4,height:26.5,width:41.8},FULLSCREEN:{type:"FULLSCREEN",columns:{min:8,max:12},rows:{min:41,max:1e3},slots:6,height:53.3,width:41.8}};function l(t){return t.concat().sort((function(t,r){var n=t.coordinates.y,o=r.coordinates.y;if(n<o)return-1;if(n>o)return 1;if(n===o){var e=t.coordinates.x,i=r.coordinates.x;if(e<i)return-1;if(e>i)return 1}return 0}))}function c(t){var r=t.coordinates,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"dashboard";if("singleApp"===n)return s.FULLSCREEN;var o=r.w,e=r.h;return Object.values(s).find((function(t){return o>=t.columns.min&&o<=t.columns.max&&e>=t.rows.min&&e<=t.rows.max}))}function m(r,n){var o,e=[],i=[e],a=0;return r.reduce((function(i,u,l){o=!1;var m=c(u,(null==u?void 0:u.layout)||n),h=m.slots,d=m.type;if(d!==s.FULLSCREEN.type){var f=r[l+1];if(f){var p=c(f,(null==f?void 0:f.layout)||n);if(a%2==0&&1===h&&p.slots%2==0){var v=s.WIDE;h=v.slots,d=v.type}}else if(l%2==0){var E=s.WIDE;h=E.slots,d=E.type}}a+=h;var L={app:u,slots:h,reportAppSize:m},x=i.map((function(r){if(o)return r;var n=6-r.reduce((function(t,r){return t+r.slots}),0);return n>=h&&(o=!0),n>=h?[].concat(t(r),[L]):r}));return o?x:[].concat(t(x),[[].concat(e,[L])])}),i)}function h(t){var i=t.w,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a?e:i>=5?o:i>=3?n:r}export{a as PDF_REPORT_PIXEL_RATIO,i as PIXELS_IN_CM,c as getAppType,u as getPDFAppPixelSize,h as getPDFAppSize,m as getPages,l as sortPDFDashboardApps};