@corva/ui 0.76.0-rc.2 → 0.76.0-rc.3

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("lodash"),r=require("../convert.js"),n=require("./goalsConfig.js");exports.convertGoalValue=function(t,o,i){if(void 0===i&&(i="TO_SHOW"),!n.GoalsConfig[o])return t;var u=n.GoalsConfig[o],a=u.unitType,s=u.unit,l=u.convertToShow,f=u.convertToSave;if(!s&&!l&&!f)return t;if("TO_SHOW"===i){if(""===t)return t;var g=l?l(t):r.convertValue(+t,a,s,null,16),c=e.round(g,2);return String(c)}return"TO_SAVE"===i?t?String(f?f(t):r.convertValue(+t,a,r.getUnitPreference(a),s,16)):"":void 0},exports.getGoalsConfig=function(){return n.GoalsConfig},exports.getGoalsUnitDisplay=function(e){if(!n.GoalsConfig[e])return"";var t=n.GoalsConfig[e],o=t.unit,i=t.unitType,u=t.formatUnitDisplay;return i||u?u?u(r.getUnitPreference(i)):"percent"===i?o:r.getUnitDisplay(i):""};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../ext-esm/tslib/tslib.es6.js'),t=require("lodash"),n=require("../convert.js"),r=require("./goalsConfig.js");exports.convertGoalValue=function(e,i,o){if(void 0===o&&(o="TO_SHOW"),!r.GoalsConfig[i])return e;var s=r.GoalsConfig[i],a=s.unitType,l=s.unit,g=s.convertToShow,u=s.convertToSave;if(!l&&!g&&!u)return e;if("TO_SHOW"===o){if(""===e)return e;var _=g?g(e):n.convertValue(+e,a,l,null,16),f=t.round(_,2);return String(f)}return"TO_SAVE"===o?e?String(u?u(e):n.convertValue(+e,a,n.getUnitPreference(a),l,16)):"":void 0},exports.getGoalsConfig=function(){return e.__assign(e.__assign({},r.GoalsConfig),{cost_per_ft:e.__assign(e.__assign({},r.GoalsConfig.cost_per_ft),{label:"Cost/".concat(n.getUnitDescription(n.getUnitPreference("length")).singular)}),cost_per_lat_ft:e.__assign(e.__assign({},r.GoalsConfig.cost_per_lat_ft),{label:"Lateral Cost/".concat(n.getUnitDescription(n.getUnitPreference("length")).singular)})})},exports.getGoalsUnitDisplay=function(e){if(!r.GoalsConfig[e])return"";var t=r.GoalsConfig[e],i=t.unit,o=t.unitType,s=t.formatUnitDisplay;return o||s?s?s(n.getUnitPreference(o)):"percent"===o?i:n.getUnitDisplay(o):""};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.76.0-rc.2",
3
+ "version": "0.76.0-rc.3",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils/goalsConfig/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAe,MAAM,eAAe,CAAC;AAExD,aAAK,aAAa,GAAG,SAAS,GAAG,SAAS,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,mBAAmB,YAAa,MAAM,WAYlD,CAAC;AAEF,eAAO,MAAM,gBAAgB,cAChB,MAAM,WACR,MAAM,kBACA,aAAa,WA6B7B,CAAC;AAEF,eAAO,MAAM,cAAc,QAAO,OAAO,MAAM,EAAE,UAAU,CAAgB,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils/goalsConfig/utils.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAe,MAAM,eAAe,CAAC;AAExD,aAAK,aAAa,GAAG,SAAS,GAAG,SAAS,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,mBAAmB,YAAa,MAAM,WAYlD,CAAC;AAEF,eAAO,MAAM,gBAAgB,cAChB,MAAM,WACR,MAAM,kBACA,aAAa,WA6B7B,CAAC;AAEF,eAAO,MAAM,cAAc,QAAO,OAAO,MAAM,EAAE,UAAU,CAY1D,CAAC"}
@@ -1 +1 @@
1
- import{round as r}from"lodash";import{getUnitPreference as n,getUnitDisplay as t,convertValue as i}from"../convert.js";import{GoalsConfig as o}from"./goalsConfig.js";var e=function(r){if(!o[r])return"";var i=o[r],e=i.unit,u=i.unitType,f=i.formatUnitDisplay;return u||f?f?f(n(u)):"percent"===u?e:t(u):""},u=function(t,e,u){if(void 0===u&&(u="TO_SHOW"),!o[e])return t;var f=o[e],v=f.unitType,a=f.unit,p=f.convertToShow,c=f.convertToSave;if(!a&&!p&&!c)return t;if("TO_SHOW"===u){if(""===t)return t;var m=p?p(t):i(+t,v,a,null,16),S=r(m,2);return String(S)}return"TO_SAVE"===u?t?String(c?c(t):i(+t,v,n(v),a,16)):"":void 0},f=function(){return o};export{u as convertGoalValue,f as getGoalsConfig,e as getGoalsUnitDisplay};
1
+ import{__assign as t}from'./../../ext-esm/tslib/tslib.es6.js';import{round as r}from"lodash";import{getUnitPreference as n,getUnitDisplay as o,convertValue as e,getUnitDescription as i}from"../convert.js";import{GoalsConfig as a}from"./goalsConfig.js";var l=function(t){if(!a[t])return"";var r=a[t],e=r.unit,i=r.unitType,l=r.formatUnitDisplay;return i||l?l?l(n(i)):"percent"===i?e:o(i):""},u=function(t,o,i){if(void 0===i&&(i="TO_SHOW"),!a[o])return t;var l=a[o],u=l.unitType,f=l.unit,s=l.convertToShow,c=l.convertToSave;if(!f&&!s&&!c)return t;if("TO_SHOW"===i){if(""===t)return t;var _=s?s(t):e(+t,u,f,null,16),p=r(_,2);return String(p)}return"TO_SAVE"===i?t?String(c?c(t):e(+t,u,n(u),f,16)):"":void 0},f=function(){return t(t({},a),{cost_per_ft:t(t({},a.cost_per_ft),{label:"Cost/".concat(i(n("length")).singular)}),cost_per_lat_ft:t(t({},a.cost_per_lat_ft),{label:"Lateral Cost/".concat(i(n("length")).singular)})})};export{u as convertGoalValue,f as getGoalsConfig,l as getGoalsUnitDisplay};