@wework/floormap-utils
Advanced tools
Comparing version 3.0.1 to 3.1.0
@@ -6,2 +6,8 @@ # Change Log | ||
# [3.1.0](https://github.com/WeConnect/floormap-monorepo/compare/v3.0.1...v3.1.0) (2022-02-14) | ||
### Features | ||
- ✅ LBE-4340 edit unlinked inventory ([#850](https://github.com/WeConnect/floormap-monorepo/issues/850)) ([12e9e96](https://github.com/WeConnect/floormap-monorepo/commit/12e9e96f3858e43ffacc98dcf1f14b524d828860)) | ||
## [3.0.1](https://github.com/WeConnect/floormap-monorepo/compare/v3.0.0...v3.0.1) (2022-02-11) | ||
@@ -8,0 +14,0 @@ |
@@ -245,6 +245,9 @@ 'use strict'; | ||
return !!((_space$inventoryData2 = space.inventoryData) !== null && _space$inventoryData2 !== void 0 && (_space$inventoryData3 = _space$inventoryData2.relationships) !== null && _space$inventoryData3 !== void 0 && _space$inventoryData3.some(function (rel) { | ||
return !!(space !== null && space !== void 0 && (_space$inventoryData2 = space.inventoryData) !== null && _space$inventoryData2 !== void 0 && (_space$inventoryData3 = _space$inventoryData2.relationships) !== null && _space$inventoryData3 !== void 0 && _space$inventoryData3.some(function (rel) { | ||
return (rel === null || rel === void 0 ? void 0 : rel.product_type) && bookableInventories.has(rel === null || rel === void 0 ? void 0 : rel.product_type); | ||
})) || bookableInventories.has(space === null || space === void 0 ? void 0 : space.subType); | ||
}; | ||
var newIsBookable = function newIsBookable(inventory) { | ||
return bookableInventories.has(inventory === null || inventory === void 0 ? void 0 : inventory.product_type); | ||
}; | ||
var getSpaceProgramType = function getSpaceProgramType(space) { | ||
@@ -280,3 +283,4 @@ if (['MEET', 'WE', 'OPERATE'].includes(space === null || space === void 0 ? void 0 : space.programType)) { | ||
exports.isNotLinked = isNotLinked; | ||
exports.newIsBookable = newIsBookable; | ||
exports.parseUTCDate = parseUTCDate; | ||
//# sourceMappingURL=floormap-utils.cjs.development.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("date-fns-tz/zonedTimeToUtc")),n=e(require("lodash/find")),i=/HOT DESK/i,o=["DEDICATED DESK","DEDICATED DESKS","SHARED OFFICE DESK","SHARED OFFICE DESKS"],r=function(e,t){return t.some((function(t){return t===e}))};function a(e){return r(e,["DEDICATED DESK","DEDICATED DESKS","SHARED OFFICE DESK","SHARED OFFICE DESKS"])}var s=new Set(["BOOKABLE_PRIVATE_OFFICE","COMMON_SPACE","CONFERENCE_ROOM","DAILY_DESK","SHAREABLE_WORKSPACE","LOUNGE","COMMUNITY BAR","SCREENING ROOM","PRIVATE_ACCESS_AREA"]),c=function(e){var t,n;return!(null===(t=e.inventoryData)||void 0===t||null===(n=t.relationships)||void 0===n||!n.some((function(e){return(null==e?void 0:e.product_type)&&s.has(null==e?void 0:e.product_type)})))||s.has(null==e?void 0:e.subType)};exports.CheckIsChair=function(e){return r(e,["SEAT","SEATS","CHAIR","CHAIRS"])},exports.CheckIsDedicatedDesk=a,exports.CheckIsHotDesk=function(e){return r(e,["HOT DESK","HOT DESKS","PRIVATE HOT DESK AREA","PRIVATE HOT DESKS AREA","HOT DESK AREA","HOT DESKS AREA"])},exports.CheckIsTable=function(e){return r(e,["DESK","DESKS","TABLE","TABLES"])},exports.applyInstancing=function(e,t){var n=new Map;!function t(){for(var i=0;i<e.length;i++){var o=e[i];if(o.instancingId){var r=n.get(o.instancingId);r||(r=[]),r.push(o),n.set(o.instancingId,r),e.splice(i,1),t()}}}(),n.forEach((function(e,n,i){!function(e,t,n){if(0!==e.length){var i=e[0];if(n.createInstancedMesh({id:t,mesh:{points:i.points,extrude:i.extrude,opacity:i.style?i.style.opacity:1}}),e.forEach((function(e){n.addToInstancedMesh({id:e.id,instancingId:t,style:{color:e.style.color},position:e.position,rotation:e.rotation,interactable:e.interactable,visible:e.visible})})),n.drawInstancedMesh({id:t}),i.style.outline&&i.style.outline.color){var o=t+"_OUTLINE";n.createInstancedMesh({id:o,mesh:{style:{outline:{color:i.style.outline.color,only:!0}},points:i.points,extrude:i.extrude,zOrder:i.zOrder}}),e.forEach((function(e){n.addToInstancedMesh({id:e.id+"_outline",instancingId:o,style:{color:e.style.color},position:e.position,rotation:e.rotation,visible:e.visible})})),n.drawInstancedMesh({id:o})}}}(e,n,t)}))},exports.getCenter=function(e){for(var t=Infinity,n=Infinity,i=-Infinity,o=-Infinity,r=0;r<e.length;r++)t=Math.min(t,e[r].x),n=Math.min(n,e[r].y),i=Math.max(i,e[r].x),o=Math.max(o,e[r].y);return{x:(i+t)/2,y:(o+n)/2}},exports.getSize=function(e){for(var t=Infinity,n=Infinity,i=-Infinity,o=-Infinity,r=0;r<e.length;r++)t=Math.min(t,e[r].x),n=Math.min(n,e[r].y),i=Math.max(i,e[r].x),o=Math.max(o,e[r].y);return{width:i-t,height:o-n}},exports.getSpaceProgramType=function(e){return["MEET","WE","OPERATE"].includes(null==e?void 0:e.programType)&&c(e)?"MEET":null==e?void 0:e.programType},exports.hasOverflowTag=function(e){return void 0===e&&(e=[]),!!n(e,{name:"Overflow"})},exports.isBookable=c,exports.isDedicatedDeskRoom=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=""),"7c2c9f70-97c5-410b-b3a4-4fe9d1db88f8"===t||o.includes(e.toUpperCase())},exports.isHotDeskArea=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=""),"b866ac5b-a1ce-45e0-a274-2137d4a547a1"===t||Boolean(i.exec(e))},exports.isNotLinked=function(e){var t,n=null===(t=e.inventoryData)||void 0===t?void 0:t.relationships,i=!(n&&n.length>0),o=!e.reservable,r=["MEET","WORK"].includes(e.programType)||c(e);return i&&o&&r&&!a(e.subType.toUpperCase())},exports.parseUTCDate=function(e){return t(e,"utc")}; | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("date-fns-tz/zonedTimeToUtc")),n=e(require("lodash/find")),i=/HOT DESK/i,o=["DEDICATED DESK","DEDICATED DESKS","SHARED OFFICE DESK","SHARED OFFICE DESKS"],r=function(e,t){return t.some((function(t){return t===e}))};function a(e){return r(e,["DEDICATED DESK","DEDICATED DESKS","SHARED OFFICE DESK","SHARED OFFICE DESKS"])}var s=new Set(["BOOKABLE_PRIVATE_OFFICE","COMMON_SPACE","CONFERENCE_ROOM","DAILY_DESK","SHAREABLE_WORKSPACE","LOUNGE","COMMUNITY BAR","SCREENING ROOM","PRIVATE_ACCESS_AREA"]),u=function(e){var t,n;return!(null==e||null===(t=e.inventoryData)||void 0===t||null===(n=t.relationships)||void 0===n||!n.some((function(e){return(null==e?void 0:e.product_type)&&s.has(null==e?void 0:e.product_type)})))||s.has(null==e?void 0:e.subType)};exports.CheckIsChair=function(e){return r(e,["SEAT","SEATS","CHAIR","CHAIRS"])},exports.CheckIsDedicatedDesk=a,exports.CheckIsHotDesk=function(e){return r(e,["HOT DESK","HOT DESKS","PRIVATE HOT DESK AREA","PRIVATE HOT DESKS AREA","HOT DESK AREA","HOT DESKS AREA"])},exports.CheckIsTable=function(e){return r(e,["DESK","DESKS","TABLE","TABLES"])},exports.applyInstancing=function(e,t){var n=new Map;!function t(){for(var i=0;i<e.length;i++){var o=e[i];if(o.instancingId){var r=n.get(o.instancingId);r||(r=[]),r.push(o),n.set(o.instancingId,r),e.splice(i,1),t()}}}(),n.forEach((function(e,n,i){!function(e,t,n){if(0!==e.length){var i=e[0];if(n.createInstancedMesh({id:t,mesh:{points:i.points,extrude:i.extrude,opacity:i.style?i.style.opacity:1}}),e.forEach((function(e){n.addToInstancedMesh({id:e.id,instancingId:t,style:{color:e.style.color},position:e.position,rotation:e.rotation,interactable:e.interactable,visible:e.visible})})),n.drawInstancedMesh({id:t}),i.style.outline&&i.style.outline.color){var o=t+"_OUTLINE";n.createInstancedMesh({id:o,mesh:{style:{outline:{color:i.style.outline.color,only:!0}},points:i.points,extrude:i.extrude,zOrder:i.zOrder}}),e.forEach((function(e){n.addToInstancedMesh({id:e.id+"_outline",instancingId:o,style:{color:e.style.color},position:e.position,rotation:e.rotation,visible:e.visible})})),n.drawInstancedMesh({id:o})}}}(e,n,t)}))},exports.getCenter=function(e){for(var t=Infinity,n=Infinity,i=-Infinity,o=-Infinity,r=0;r<e.length;r++)t=Math.min(t,e[r].x),n=Math.min(n,e[r].y),i=Math.max(i,e[r].x),o=Math.max(o,e[r].y);return{x:(i+t)/2,y:(o+n)/2}},exports.getSize=function(e){for(var t=Infinity,n=Infinity,i=-Infinity,o=-Infinity,r=0;r<e.length;r++)t=Math.min(t,e[r].x),n=Math.min(n,e[r].y),i=Math.max(i,e[r].x),o=Math.max(o,e[r].y);return{width:i-t,height:o-n}},exports.getSpaceProgramType=function(e){return["MEET","WE","OPERATE"].includes(null==e?void 0:e.programType)&&u(e)?"MEET":null==e?void 0:e.programType},exports.hasOverflowTag=function(e){return void 0===e&&(e=[]),!!n(e,{name:"Overflow"})},exports.isBookable=u,exports.isDedicatedDeskRoom=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=""),"7c2c9f70-97c5-410b-b3a4-4fe9d1db88f8"===t||o.includes(e.toUpperCase())},exports.isHotDeskArea=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=""),"b866ac5b-a1ce-45e0-a274-2137d4a547a1"===t||Boolean(i.exec(e))},exports.isNotLinked=function(e){var t,n=null===(t=e.inventoryData)||void 0===t?void 0:t.relationships,i=!(n&&n.length>0),o=!e.reservable,r=["MEET","WORK"].includes(e.programType)||u(e);return i&&o&&r&&!a(e.subType.toUpperCase())},exports.newIsBookable=function(e){return s.has(null==e?void 0:e.product_type)},exports.parseUTCDate=function(e){return t(e,"utc")}; | ||
//# sourceMappingURL=floormap-utils.cjs.production.min.js.map |
@@ -239,6 +239,9 @@ import zonedTimeToUtc from 'date-fns-tz/zonedTimeToUtc'; | ||
return !!((_space$inventoryData2 = space.inventoryData) !== null && _space$inventoryData2 !== void 0 && (_space$inventoryData3 = _space$inventoryData2.relationships) !== null && _space$inventoryData3 !== void 0 && _space$inventoryData3.some(function (rel) { | ||
return !!(space !== null && space !== void 0 && (_space$inventoryData2 = space.inventoryData) !== null && _space$inventoryData2 !== void 0 && (_space$inventoryData3 = _space$inventoryData2.relationships) !== null && _space$inventoryData3 !== void 0 && _space$inventoryData3.some(function (rel) { | ||
return (rel === null || rel === void 0 ? void 0 : rel.product_type) && bookableInventories.has(rel === null || rel === void 0 ? void 0 : rel.product_type); | ||
})) || bookableInventories.has(space === null || space === void 0 ? void 0 : space.subType); | ||
}; | ||
var newIsBookable = function newIsBookable(inventory) { | ||
return bookableInventories.has(inventory === null || inventory === void 0 ? void 0 : inventory.product_type); | ||
}; | ||
var getSpaceProgramType = function getSpaceProgramType(space) { | ||
@@ -261,3 +264,3 @@ if (['MEET', 'WE', 'OPERATE'].includes(space === null || space === void 0 ? void 0 : space.programType)) { | ||
export { CheckIsChair, CheckIsDedicatedDesk, CheckIsHotDesk, CheckIsTable, applyInstancing, getCenter, getSize, getSpaceProgramType, hasOverflowTag, isBookable, isDedicatedDeskRoom, isHotDeskArea, isNotLinked, parseUTCDate }; | ||
export { CheckIsChair, CheckIsDedicatedDesk, CheckIsHotDesk, CheckIsTable, applyInstancing, getCenter, getSize, getSpaceProgramType, hasOverflowTag, isBookable, isDedicatedDeskRoom, isHotDeskArea, isNotLinked, newIsBookable, parseUTCDate }; | ||
//# sourceMappingURL=floormap-utils.esm.js.map |
export { getCenter, getSize } from './spatial-service'; | ||
export { applyInstancing } from './instancing'; | ||
export { parseUTCDate } from './date-utils'; | ||
export { isDedicatedDeskRoom, isHotDeskArea, isNotLinked, isBookable, CheckIsHotDesk, CheckIsDedicatedDesk, CheckIsTable, CheckIsChair, getSpaceProgramType, hasOverflowTag, } from './space-utils'; | ||
export { isDedicatedDeskRoom, isHotDeskArea, isNotLinked, isBookable, newIsBookable, CheckIsHotDesk, CheckIsDedicatedDesk, CheckIsTable, CheckIsChair, getSpaceProgramType, hasOverflowTag, } from './space-utils'; |
@@ -43,6 +43,10 @@ export declare const isHotDeskArea: (type?: string, roomTypeUUID?: string) => boolean; | ||
} | ||
interface InventoryProps { | ||
product_type: string; | ||
} | ||
export declare const isNotLinked: (space: Space) => boolean; | ||
export declare const isBookable: (space: Space) => boolean; | ||
export declare const newIsBookable: (inventory: InventoryProps) => boolean; | ||
export declare const getSpaceProgramType: (space: Space) => string; | ||
export declare const hasOverflowTag: (tags?: TagsProps[]) => boolean; | ||
export {}; |
{ | ||
"name": "@wework/floormap-utils", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"main": "dist/index.js", | ||
@@ -27,3 +27,3 @@ "module": "dist/floormap-utils.esm.js", | ||
}, | ||
"gitHead": "b2c39909f2e93c92857501754ada6183d41282c1" | ||
"gitHead": "8fd51e9845ce0d00e623f26aedae404b2df111c4" | ||
} |
Sorry, the diff of this file is not supported yet
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
82909
577