@pega/cosmos-react-core 9.0.0-build.7.4 → 9.0.0-build.8.0
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/lib/components/ListToolbar/ListToolbar.types.d.ts +5 -1
- package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
- package/lib/components/Location/CurrentLocationButton.d.ts.map +1 -1
- package/lib/components/Location/CurrentLocationButton.js +4 -2
- package/lib/components/Location/CurrentLocationButton.js.map +1 -1
- package/lib/components/Location/GoogleMapsAPI.d.ts +43 -0
- package/lib/components/Location/GoogleMapsAPI.d.ts.map +1 -0
- package/lib/components/Location/GoogleMapsAPI.js +244 -0
- package/lib/components/Location/GoogleMapsAPI.js.map +1 -0
- package/lib/components/Location/Location.types.d.ts +3 -2
- package/lib/components/Location/Location.types.d.ts.map +1 -1
- package/lib/components/Location/Location.types.js.map +1 -1
- package/lib/components/Location/LocationAPI.types.d.ts +23 -0
- package/lib/components/Location/LocationAPI.types.d.ts.map +1 -0
- package/lib/components/Location/LocationAPI.types.js +2 -0
- package/lib/components/Location/LocationAPI.types.js.map +1 -0
- package/lib/components/Location/LocationDisplay.d.ts.map +1 -1
- package/lib/components/Location/LocationDisplay.js +5 -3
- package/lib/components/Location/LocationDisplay.js.map +1 -1
- package/lib/components/Location/LocationInput.d.ts.map +1 -1
- package/lib/components/Location/LocationInput.js +23 -20
- package/lib/components/Location/LocationInput.js.map +1 -1
- package/lib/components/Location/LocationView.d.ts.map +1 -1
- package/lib/components/Location/LocationView.js +8 -5
- package/lib/components/Location/LocationView.js.map +1 -1
- package/lib/components/Location/index.d.ts +2 -1
- package/lib/components/Location/index.d.ts.map +1 -1
- package/lib/components/Location/index.js +2 -1
- package/lib/components/Location/index.js.map +1 -1
- package/lib/components/Location/utils.d.ts +3 -19
- package/lib/components/Location/utils.d.ts.map +1 -1
- package/lib/components/Location/utils.js +7 -161
- package/lib/components/Location/utils.js.map +1 -1
- package/lib/styles/GlobalStyle.d.ts.map +1 -1
- package/lib/styles/GlobalStyle.js +3 -0
- package/lib/styles/GlobalStyle.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/Location/utils.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,2BAA2B,EAC3B,0BAA0B,EAC1B,kBAAkB,EAClB,qBAAqB,EACrB,yBAAyB,EACzB,YAAY,EACZ,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAG1B,MAAM,iBAAiB,GAAG;IACxB,QAAQ;IACR,mBAAmB;IACnB,gCAAgC;IAChC,KAAK;IACL,qBAAqB;IACrB,QAAQ;IACR,2CAA2C;IAC3C,YAAY;IACZ,OAAO;IACP,oBAAoB;IACpB,6CAA6C;IAC7C,KAAK;IACL,sBAAsB;IACtB,SAAS;CACV,CAAC;AAEF,MAAM,uBAAuB,GAAG,IAAI,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AAE1F,MAAM,aAAa,GAAG;IACpB,QAAQ;IACR,mBAAmB;IACnB,wBAAwB;IACxB,KAAK;IACL,mBAAmB;IACnB,iCAAiC;IACjC,KAAK;IACL,qBAAqB;IACrB,QAAQ;IACR,2CAA2C;IAC3C,YAAY;IACZ,OAAO;IACP,oBAAoB;IACpB,qCAAqC;IACrC,KAAK;IACL,oBAAoB;IACpB,iCAAiC;IACjC,KAAK;IACL,sBAAsB;IACtB,SAAS;CACV,CAAC;AAEF,MAAM,mBAAmB,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,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serve=\"true\" />\n\nimport { Loader } from '@googlemaps/js-api-loader';\n\nimport {\n CoordsCannotBeParsedError,\n GeocoderFailedError,\n GeolocationUnsupportedError,\n GoogleMapsAPINotFoundError,\n IsNotAnObjectError,\n LocationNotFoundError,\n ProviderNotSupportedError,\n QUERY_FIELDS,\n QUERY_TYPES\n} from './Location.types';\nimport type { Bias, LatLng, MapsProvider, ProviderOpts, Location } from './Location.types';\n\nconst DegreeRegexChunks = [\n /^[-+]?/,\n // latitude degrees\n /([0-9]|[1-8][0-9]|90)(\\.\\d+)?°/,\n /\\s?/,\n // latitude direction\n /(N|S)?/,\n // sepeartor between latitude and longitude\n /(,|,\\s|\\s)/,\n /[-+]?/,\n // longitude degrees\n /([0-9]|[1-9][0-9]|1[0-7][0-9]|180)(\\.\\d+)?°/,\n /\\s?/,\n // longitude direction\n /(W|E)?$/\n];\n\nconst DegreeRegularExpression = new RegExp(DegreeRegexChunks.map(c => c.source).join(''));\n\nconst DMRegexChunks = [\n /^[-+]?/,\n // latitude degrees\n /([0-9]|[1-8][0-9]|90)°/,\n /\\s?/,\n // latitude minutes\n /([0-9]|[0-5][0-9])(\\.\\d+)?('|’)/,\n /\\s?/,\n // latitude direction\n /(N|S)?/,\n // sepeartor between latitude and longitude\n /(,|,\\s|\\s)/,\n /[-+]?/,\n // longitude degrees\n /([0-9]|[1-9][0-9]|1[0-7][0-9]|180)°/,\n /\\s?/,\n // longitude minutes\n /([0-9]|[0-5][0-9])(\\.\\d+)?('|’)/,\n /\\s?/,\n // longitude direction\n /(W|E)?$/\n];\n\nconst DMRegularExpression = new RegExp(DMRegexChunks.map(c => c.source).join(''));\nconst DMSRegexChunks = [\n /^[-+]?/,\n // latitude degrees\n /([0-9]|[1-8][0-9]|90)°/,\n /\\s?/,\n // latitude minutes\n /([0-9]|[0-5][0-9])('|’)/,\n /\\s?/,\n // latitude seconds\n /([0-9]|[0-5][0-9])(\\.\\d+)?(\"|″)/,\n /\\s?/,\n // latitude direction\n /(N|S)?/,\n // sepeartor between latitude and longitude\n /(,|,\\s|\\s)/,\n /[-+]?/,\n // longitude degrees\n /([0-9]|[1-9][0-9]|1[0-7][0-9]|180)°/,\n /\\s?/,\n // longitude minutes\n /([0-9]|[0-5][0-9])('|’)/,\n /\\s?/,\n // longitude seconds\n /([0-9]|[0-5][0-9])(\\.\\d+)?(\"|″)/,\n /\\s?/,\n // longitude direction\n /(W|E)?$/\n];\n\nconst DMSRegularExpression = new RegExp(DMSRegexChunks.map(c => c.source).join(''));\n\nconst decimalRegexChunks = [\n /^[-+]?/,\n /([0-9]|[1-8][0-9]|90)/,\n /(\\.\\d+)?/,\n /(,|\\s|,\\s)/,\n /[-+]?/,\n /([0-9]|[1-9][0-9]|1[0-7][0-9]|180)/,\n /(\\.\\d+)?$/\n];\n\nconst decimalFormatCoordinatesRegularExpression = new RegExp(\n decimalRegexChunks.map(c => c.source).join('')\n);\n\nconst providers: {\n [key: string]: MapsProvider;\n} = {\n google: {\n name: 'Google',\n loadedPromise: null,\n loadedApiKey: '',\n loadAPI(opts) {\n const loader = new Loader({\n version: 'quarterly',\n apiKey: opts.apiKey ?? '',\n region: opts.region,\n language: opts.language,\n libraries: ['places', 'marker']\n });\n\n return loader.load().then(\n () => {},\n () => {\n throw new Error(GoogleMapsAPINotFoundError);\n }\n );\n }\n },\n undefined: {\n name: 'undefined',\n loadedPromise: null,\n loadedApiKey: '',\n loadAPI: data => Promise.reject(new Error(`${ProviderNotSupportedError}: ${data.name}`))\n }\n};\n\nexport async function loadMapsAPI(name: string = '', opts?: ProviderOpts): Promise<void> {\n if (typeof opts !== 'object' || !opts) {\n throw new Error(IsNotAnObjectError);\n }\n\n const provider = providers[name] ?? providers.undefined;\n\n if (!provider.loadedPromise) {\n provider.loadedPromise = provider\n .loadAPI(opts)\n .then(() => {\n provider.loadedApiKey = opts?.apiKey ?? '';\n })\n .catch(() => {\n provider.loadedPromise = null;\n });\n }\n return provider.loadedPromise;\n}\n\n/**\n * Identifies coordinates in degree format\n * eg. 45.78°N 9.11°E\n */\nexport function isValueDegreeFormatCoordinate(value: string): boolean {\n return DegreeRegularExpression.test(value);\n}\n\n/**\n * Identifies coordinates in degree, minute format\n * eg. 45°45.4’N 9°23’E\n */\nexport function isValueDMCoordinate(value: string): boolean {\n return DMRegularExpression.test(value);\n}\n\n/**\n * Identifies coordinates in degree, minute, second format\n * eg. 45°45’32.4″N 9°23’39.9″E\n */\nexport function isValueDMSCoordinate(value: string): boolean {\n return DMSRegularExpression.test(value);\n}\n\n/**\n * Identifies coordinates in decimal format\n * eg. 14.678, -38.765\n */\nexport function isValueACoordinate(value: string): boolean {\n return (\n decimalFormatCoordinatesRegularExpression.test(value) ||\n isValueDMSCoordinate(value) ||\n isValueDMCoordinate(value) ||\n isValueDegreeFormatCoordinate(value)\n );\n}\n\ninterface DMSParts {\n degrees: number;\n minutes?: number;\n seconds?: number;\n}\n\n/**\n * Converts DMS (degree, minute, second) format latitude/longitude into decimal format.\n */\nfunction convertDMSToDD({ degrees, minutes, seconds }: DMSParts, direction?: string): number {\n let dd = degrees;\n if (minutes) {\n if (degrees > 0) dd += minutes / 60;\n if (degrees < 0) dd -= minutes / 60;\n }\n if (seconds) {\n if (degrees > 0) dd += seconds / (60 * 60);\n if (degrees < 0) dd -= seconds / (60 * 60);\n }\n\n if (degrees > 0 && (direction === 'S' || direction === 'W')) {\n dd *= -1;\n }\n\n return dd;\n}\n\n/**\n * Parses DMS (degree, minute, second) format string into decimal format coordinates.\n */\nexport function parseDMS(input: string): number[] {\n if (isValueDMSCoordinate(input)) {\n const parts = input.split(/'|’|\"\\s?|″\\s?|°|,?\\s|,\\s?/);\n\n const lat = convertDMSToDD(\n {\n degrees: Number(parts[0]),\n minutes: Number(parts[1]),\n seconds: Number(parts[2])\n },\n parts[3]\n );\n const lng = convertDMSToDD(\n {\n degrees: Number(parts[4]),\n minutes: Number(parts[5]),\n seconds: Number(parts[6])\n },\n parts[7]\n );\n return [lat, lng];\n }\n if (isValueDMCoordinate(input)) {\n const parts = input.split(/'\\s?|’\\s?|°|,?\\s|,\\s?/);\n\n const lat = convertDMSToDD({ degrees: Number(parts[0]), minutes: Number(parts[1]) }, parts[2]);\n const lng = convertDMSToDD({ degrees: Number(parts[3]), minutes: Number(parts[4]) }, parts[5]);\n return [lat, lng];\n }\n\n const parts = input.split(/°\\s?|,?\\s|,\\s?/);\n\n const lat = convertDMSToDD({ degrees: Number(parts[0]) }, parts[1]);\n const lng = convertDMSToDD({ degrees: Number(parts[2]) }, parts[3]);\n return [lat, lng];\n}\n\nexport async function getNavigatorPosition(): Promise<LatLng> {\n if (!navigator.geolocation) throw new Error(GeolocationUnsupportedError);\n\n return new Promise((resolve, reject) => {\n navigator.geolocation.getCurrentPosition(\n currentLocation => {\n resolve({\n latitude: currentLocation.coords.latitude,\n longitude: currentLocation.coords.longitude\n });\n },\n error => reject(new Error(error.message))\n );\n });\n}\n\nexport function toGoogleLatLng(coords: LatLng): google.maps.LatLng {\n return new google.maps.LatLng(coords.latitude, coords.longitude);\n}\n\n/** Returns an array of place prediction objects ('place' can be an establishment, geographic location, or prominent point of interest)\n * and session token (valid for multiple queries, followed by one place selection).\n */\nexport async function getPlacePredictions(\n location: string,\n bias: Bias = {}\n): Promise<{\n placePredictions: google.maps.places.AutocompletePrediction[];\n token: google.maps.places.AutocompleteSessionToken;\n}> {\n const autocompleteService = new google.maps.places.AutocompleteService();\n const optionalParams: Partial<google.maps.places.AutocompletionRequest> = {};\n if (bias?.location) {\n if (bias?.location.center === 'current') {\n await getNavigatorPosition()\n .then(coords => {\n optionalParams.location = toGoogleLatLng(coords);\n optionalParams.radius = bias.location!.radius;\n })\n // no-op user didn't allow location\n .catch(() => {});\n } else {\n optionalParams.location = toGoogleLatLng(bias.location.center);\n optionalParams.radius = bias.location.radius;\n }\n }\n\n if (bias?.bounds) {\n const [sw, ne] = bias.bounds;\n optionalParams.bounds = new google.maps.LatLngBounds(toGoogleLatLng(sw), toGoogleLatLng(ne));\n }\n return new Promise((resolve, reject) => {\n const token = new google.maps.places.AutocompleteSessionToken();\n autocompleteService.getPlacePredictions(\n {\n input: location,\n types: QUERY_TYPES,\n sessionToken: token,\n ...optionalParams\n },\n (placePredictions, status) => {\n if (status === google.maps.places.PlacesServiceStatus.OK) {\n resolve({ placePredictions: placePredictions ?? [], token });\n } else {\n reject(new Error(LocationNotFoundError));\n }\n }\n );\n });\n}\n\nexport async function getPlace(\n location: string,\n mapElement: HTMLDivElement = document.createElement('div')\n): Promise<LatLng> {\n const placesService = new google.maps.places.PlacesService(mapElement);\n const { placePredictions, token } = await getPlacePredictions(location);\n return new Promise((resolve, reject) => {\n placesService.getDetails(\n {\n placeId: placePredictions[0]?.place_id,\n fields: QUERY_FIELDS,\n sessionToken: token\n },\n (place, pStatus) => {\n if (pStatus === google.maps.places.PlacesServiceStatus.OK) {\n resolve({\n latitude: place?.geometry?.location?.lat() ?? NaN,\n longitude: place?.geometry?.location?.lng() ?? NaN\n });\n } else {\n reject(new Error(LocationNotFoundError));\n }\n }\n );\n });\n}\n\nexport async function getPlaceById(\n placeId: string,\n sessionToken: google.maps.places.AutocompleteSessionToken = new google.maps.places.AutocompleteSessionToken(),\n mapElement: HTMLDivElement = document.createElement('div')\n): Promise<Location> {\n const placesService = new google.maps.places.PlacesService(mapElement);\n return new Promise((resolve, reject) => {\n placesService.getDetails({ placeId, fields: QUERY_FIELDS, sessionToken }, (place, pStatus) => {\n if (pStatus === google.maps.places.PlacesServiceStatus.OK) {\n resolve({\n name: place?.name,\n address: place?.formatted_address,\n latitude: place?.geometry?.location?.lat(),\n longitude: place?.geometry?.location?.lng()\n });\n } else {\n reject(new Error(LocationNotFoundError));\n }\n });\n });\n}\n\n/** Returns coordinations for given input: either coords, address or current position. */\nexport async function getCoords(\n coords: string | 'current' | LatLng,\n mapElement?: HTMLDivElement\n): Promise<LatLng> {\n if (coords === '' || coords === undefined) throw new Error();\n if (coords === 'current') return getNavigatorPosition();\n\n let location: LatLng;\n if (typeof coords === 'string') {\n let latLng: number[] = [];\n if (\n isValueDMSCoordinate(coords) ||\n isValueDMCoordinate(coords) ||\n isValueDegreeFormatCoordinate(coords)\n ) {\n latLng = parseDMS(coords);\n } else {\n let splitter;\n if (coords.includes(', ')) {\n splitter = ', ';\n } else if (coords.includes(',')) {\n splitter = ',';\n } else if (coords.includes(' ')) {\n splitter = ' ';\n } else {\n splitter = ', ';\n }\n\n latLng = coords.split(splitter).map(Number);\n }\n\n const [lat, lng] = latLng;\n if (Number.isNaN(lat) || Number.isNaN(lng) || lat === undefined || lng === undefined)\n return getPlace(coords, mapElement);\n location = { latitude: lat, longitude: lng };\n } else {\n location = coords;\n }\n\n if (Number.isFinite(location.latitude) && Number.isFinite(location.longitude)) return location;\n\n throw new Error(CoordsCannotBeParsedError);\n}\n\nexport async function getAddress(coords: LatLng): Promise<{\n name: string;\n address?: string;\n latitude: number;\n longitude: number;\n}> {\n const location = {\n lat: coords.latitude,\n lng: coords.longitude\n };\n const geocoder = new google.maps.Geocoder();\n return new Promise((resolve, reject) => {\n geocoder.geocode(\n { location },\n (results: google.maps.GeocoderResult[] | null, status: google.maps.GeocoderStatus) => {\n if (status === 'OK') {\n const [result] = results ?? [];\n if (result) {\n resolve({\n name: result.formatted_address,\n address: result.formatted_address,\n ...(result.geometry && {\n latitude: result.geometry.location.lat(),\n longitude: result.geometry.location.lng()\n })\n });\n } else {\n resolve({\n name: `${coords.latitude}, ${coords.longitude}`,\n latitude: coords.latitude,\n longitude: coords.longitude\n });\n }\n } else {\n reject(new Error(`${GeocoderFailedError}: ${status}`));\n }\n }\n );\n });\n}\n\nexport const isLatLngObject = (obj: unknown): obj is google.maps.LatLng => {\n return (\n !!obj &&\n typeof obj === 'object' &&\n 'lat' in obj &&\n typeof obj.lat === 'function' &&\n 'lng' in obj &&\n typeof obj.lng === 'function'\n );\n};\n\nexport const getGoogleMapsDirHref = (\n destination: string,\n waypoints: string[],\n travelMode: string = 'driving'\n) => {\n const url = new URL('https://www.google.com/maps/dir/?api=1');\n\n url.searchParams.append('destination', destination);\n url.searchParams.append('waypoints', waypoints.join('|'));\n url.searchParams.append('travelmode', travelMode);\n\n return url.href;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/Location/utils.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,MAAM,iBAAiB,GAAG;IACxB,QAAQ;IACR,mBAAmB;IACnB,gCAAgC;IAChC,KAAK;IACL,qBAAqB;IACrB,QAAQ;IACR,2CAA2C;IAC3C,YAAY;IACZ,OAAO;IACP,oBAAoB;IACpB,6CAA6C;IAC7C,KAAK;IACL,sBAAsB;IACtB,SAAS;CACV,CAAC;AAEF,MAAM,uBAAuB,GAAG,IAAI,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AAE1F,MAAM,aAAa,GAAG;IACpB,QAAQ;IACR,mBAAmB;IACnB,wBAAwB;IACxB,KAAK;IACL,mBAAmB;IACnB,iCAAiC;IACjC,KAAK;IACL,qBAAqB;IACrB,QAAQ;IACR,2CAA2C;IAC3C,YAAY;IACZ,OAAO;IACP,oBAAoB;IACpB,qCAAqC;IACrC,KAAK;IACL,oBAAoB;IACpB,iCAAiC;IACjC,KAAK;IACL,sBAAsB;IACtB,SAAS;CACV,CAAC;AAEF,MAAM,mBAAmB,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AAClF,MA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C,SAAS,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAY,EAA6B,EAAE;IACxE,OAAO,CACL,CAAC,CAAC,GAAG;QACL,OAAO,GAAG,KAAK,QAAQ;QACvB,KAAK,IAAI,GAAG;QACZ,OAAO,GAAG,CAAC,GAAG,KAAK,UAAU;QAC7B,KAAK,IAAI,GAAG;QACZ,OAAO,GAAG,CAAC,GAAG,KAAK,UAAU,CAC9B,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,WAAmB,EACnB,SAAmB,EACnB,aAAqB,SAAS,EAC9B,EAAE;IACF,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,wCAAwC,CAAC,CAAC;IAE9D,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IACpD,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1D,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IAElD,OAAO,GAAG,CAAC,IAAI,CAAC;AAClB,CAAC,CAAC","sourcesContent":["/// <reference types=\"google.maps\" preserve=\"true\" />\n\nimport { Loader } from '@googlemaps/js-api-loader';\n\nimport {\n GeolocationUnsupportedError,\n GoogleMapsAPINotFoundError,\n IsNotAnObjectError,\n ProviderNotSupportedError\n} from './Location.types';\nimport type { LatLng, MapsProvider, ProviderOpts } from './Location.types';\nimport type { LocationAPI } from './LocationAPI.types';\nimport GoogleMapsAPI from './GoogleMapsAPI';\n\nconst DegreeRegexChunks = [\n /^[-+]?/,\n // latitude degrees\n /([0-9]|[1-8][0-9]|90)(\\.\\d+)?°/,\n /\\s?/,\n // latitude direction\n /(N|S)?/,\n // sepeartor between latitude and longitude\n /(,|,\\s|\\s)/,\n /[-+]?/,\n // longitude degrees\n /([0-9]|[1-9][0-9]|1[0-7][0-9]|180)(\\.\\d+)?°/,\n /\\s?/,\n // longitude direction\n /(W|E)?$/\n];\n\nconst DegreeRegularExpression = new RegExp(DegreeRegexChunks.map(c => c.source).join(''));\n\nconst DMRegexChunks = [\n /^[-+]?/,\n // latitude degrees\n /([0-9]|[1-8][0-9]|90)°/,\n /\\s?/,\n // latitude minutes\n /([0-9]|[0-5][0-9])(\\.\\d+)?('|’)/,\n /\\s?/,\n // latitude direction\n /(N|S)?/,\n // sepeartor between latitude and longitude\n /(,|,\\s|\\s)/,\n /[-+]?/,\n // longitude degrees\n /([0-9]|[1-9][0-9]|1[0-7][0-9]|180)°/,\n /\\s?/,\n // longitude minutes\n /([0-9]|[0-5][0-9])(\\.\\d+)?('|’)/,\n /\\s?/,\n // longitude direction\n /(W|E)?$/\n];\n\nconst DMRegularExpression = new RegExp(DMRegexChunks.map(c => c.source).join(''));\nconst DMSRegexChunks = [\n /^[-+]?/,\n // latitude degrees\n /([0-9]|[1-8][0-9]|90)°/,\n /\\s?/,\n // latitude minutes\n /([0-9]|[0-5][0-9])('|’)/,\n /\\s?/,\n // latitude seconds\n /([0-9]|[0-5][0-9])(\\.\\d+)?(\"|″)/,\n /\\s?/,\n // latitude direction\n /(N|S)?/,\n // sepeartor between latitude and longitude\n /(,|,\\s|\\s)/,\n /[-+]?/,\n // longitude degrees\n /([0-9]|[1-9][0-9]|1[0-7][0-9]|180)°/,\n /\\s?/,\n // longitude minutes\n /([0-9]|[0-5][0-9])('|’)/,\n /\\s?/,\n // longitude seconds\n /([0-9]|[0-5][0-9])(\\.\\d+)?(\"|″)/,\n /\\s?/,\n // longitude direction\n /(W|E)?$/\n];\n\nconst DMSRegularExpression = new RegExp(DMSRegexChunks.map(c => c.source).join(''));\n\nconst decimalRegexChunks = [\n /^[-+]?/,\n /([0-9]|[1-8][0-9]|90)/,\n /(\\.\\d+)?/,\n /(,|\\s|,\\s)/,\n /[-+]?/,\n /([0-9]|[1-9][0-9]|1[0-7][0-9]|180)/,\n /(\\.\\d+)?$/\n];\n\nconst decimalFormatCoordinatesRegularExpression = new RegExp(\n decimalRegexChunks.map(c => c.source).join('')\n);\n\nconst providers: {\n [key: string]: MapsProvider;\n} = {\n google: {\n name: 'Google',\n loadedPromise: null,\n loadedApiKey: '',\n loadAPI(opts) {\n const loader = new Loader({\n version: 'quarterly',\n apiKey: opts.apiKey ?? '',\n region: opts.region,\n language: opts.language,\n libraries: ['places', 'marker']\n });\n\n return loader.load().then(\n () => new GoogleMapsAPI(),\n () => {\n throw new Error(GoogleMapsAPINotFoundError);\n }\n );\n }\n },\n undefined: {\n name: 'undefined',\n loadedPromise: null,\n loadedApiKey: '',\n loadAPI: data => Promise.reject(new Error(`${ProviderNotSupportedError}: ${data.name}`))\n }\n};\n\nexport async function loadMapsAPI(name: string = '', opts?: ProviderOpts): Promise<LocationAPI> {\n if (typeof opts !== 'object' || !opts) {\n throw new Error(IsNotAnObjectError);\n }\n\n const provider = providers[name] ?? providers.undefined;\n\n if (!provider.loadedPromise) {\n provider.loadedPromise = provider\n .loadAPI(opts)\n .then(ApiObj => {\n provider.loadedApiKey = opts?.apiKey ?? '';\n return ApiObj;\n })\n .catch(err => {\n provider.loadedPromise = null;\n throw new Error(err);\n });\n }\n return provider.loadedPromise;\n}\n\n/**\n * Identifies coordinates in degree format\n * eg. 45.78°N 9.11°E\n */\nexport function isValueDegreeFormatCoordinate(value: string): boolean {\n return DegreeRegularExpression.test(value);\n}\n\n/**\n * Identifies coordinates in degree, minute format\n * eg. 45°45.4’N 9°23’E\n */\nexport function isValueDMCoordinate(value: string): boolean {\n return DMRegularExpression.test(value);\n}\n\n/**\n * Identifies coordinates in degree, minute, second format\n * eg. 45°45’32.4″N 9°23’39.9″E\n */\nexport function isValueDMSCoordinate(value: string): boolean {\n return DMSRegularExpression.test(value);\n}\n\n/**\n * Identifies coordinates in decimal format\n * eg. 14.678, -38.765\n */\nexport function isValueACoordinate(value: string): boolean {\n return (\n decimalFormatCoordinatesRegularExpression.test(value) ||\n isValueDMSCoordinate(value) ||\n isValueDMCoordinate(value) ||\n isValueDegreeFormatCoordinate(value)\n );\n}\n\ninterface DMSParts {\n degrees: number;\n minutes?: number;\n seconds?: number;\n}\n\n/**\n * Converts DMS (degree, minute, second) format latitude/longitude into decimal format.\n */\nfunction convertDMSToDD({ degrees, minutes, seconds }: DMSParts, direction?: string): number {\n let dd = degrees;\n if (minutes) {\n if (degrees > 0) dd += minutes / 60;\n if (degrees < 0) dd -= minutes / 60;\n }\n if (seconds) {\n if (degrees > 0) dd += seconds / (60 * 60);\n if (degrees < 0) dd -= seconds / (60 * 60);\n }\n\n if (degrees > 0 && (direction === 'S' || direction === 'W')) {\n dd *= -1;\n }\n\n return dd;\n}\n\n/**\n * Parses DMS (degree, minute, second) format string into decimal format coordinates.\n */\nexport function parseDMS(input: string): number[] {\n if (isValueDMSCoordinate(input)) {\n const parts = input.split(/'|’|\"\\s?|″\\s?|°|,?\\s|,\\s?/);\n\n const lat = convertDMSToDD(\n {\n degrees: Number(parts[0]),\n minutes: Number(parts[1]),\n seconds: Number(parts[2])\n },\n parts[3]\n );\n const lng = convertDMSToDD(\n {\n degrees: Number(parts[4]),\n minutes: Number(parts[5]),\n seconds: Number(parts[6])\n },\n parts[7]\n );\n return [lat, lng];\n }\n if (isValueDMCoordinate(input)) {\n const parts = input.split(/'\\s?|’\\s?|°|,?\\s|,\\s?/);\n\n const lat = convertDMSToDD({ degrees: Number(parts[0]), minutes: Number(parts[1]) }, parts[2]);\n const lng = convertDMSToDD({ degrees: Number(parts[3]), minutes: Number(parts[4]) }, parts[5]);\n return [lat, lng];\n }\n\n const parts = input.split(/°\\s?|,?\\s|,\\s?/);\n\n const lat = convertDMSToDD({ degrees: Number(parts[0]) }, parts[1]);\n const lng = convertDMSToDD({ degrees: Number(parts[2]) }, parts[3]);\n return [lat, lng];\n}\n\nexport async function getNavigatorPosition(): Promise<LatLng> {\n if (!navigator.geolocation) throw new Error(GeolocationUnsupportedError);\n\n return new Promise((resolve, reject) => {\n navigator.geolocation.getCurrentPosition(\n currentLocation => {\n resolve({\n latitude: currentLocation.coords.latitude,\n longitude: currentLocation.coords.longitude\n });\n },\n error => reject(new Error(error.message))\n );\n });\n}\n\nexport function toGoogleLatLng(coords: LatLng): google.maps.LatLng {\n return new google.maps.LatLng(coords.latitude, coords.longitude);\n}\n\nexport const isLatLngObject = (obj: unknown): obj is google.maps.LatLng => {\n return (\n !!obj &&\n typeof obj === 'object' &&\n 'lat' in obj &&\n typeof obj.lat === 'function' &&\n 'lng' in obj &&\n typeof obj.lng === 'function'\n );\n};\n\nexport const getGoogleMapsDirHref = (\n destination: string,\n waypoints: string[],\n travelMode: string = 'driving'\n) => {\n const url = new URL('https://www.google.com/maps/dir/?api=1');\n\n url.searchParams.append('destination', destination);\n url.searchParams.append('waypoints', waypoints.join('|'));\n url.searchParams.append('travelmode', travelMode);\n\n return url.href;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalStyle.d.ts","sourceRoot":"","sources":["../../src/styles/GlobalStyle.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKtD,eAAO,MAAM,mBAAmB,wDAQ/B,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,mDAEpC,YAAY,WAgBd,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,iVAepC,YAAY,
|
|
1
|
+
{"version":3,"file":"GlobalStyle.d.ts","sourceRoot":"","sources":["../../src/styles/GlobalStyle.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKtD,eAAO,MAAM,mBAAmB,wDAQ/B,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,mDAEpC,YAAY,WAgBd,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,iVAepC,YAAY,WAuBd,CAAC;;AAEF,wBAwDG"}
|
|
@@ -42,6 +42,9 @@ export const createGlobalBodyStyles = ({ base: { 'font-size': baseFontSize, 'fon
|
|
|
42
42
|
line-height: ${lineHeight};
|
|
43
43
|
font-stretch: ${baseFontStretch};
|
|
44
44
|
letter-spacing: ${baseLetterSpacing};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
body {
|
|
45
48
|
background: ${background};
|
|
46
49
|
background-color: ${primaryBackground};
|
|
47
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalStyle.js","sourceRoot":"","sources":["../../src/styles/GlobalStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAG3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAG5C,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAA;;;;;;;;CAQrC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,IAAI,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EAChC,EAAE,EAAE;IACjB,OAAO,GAAG,CAAA;;;;;;wBAMY,KAAK;oBACT,OAAO,CAAC,OAAO;;;sBAGb,OAAO,CAAC,MAAM;;sBAEd,YAAY,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;;GAErF,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACb,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,IAAI,EAAE,EACJ,WAAW,EAAE,YAAY,EACzB,YAAY,EAAE,aAAa,EAC3B,cAAc,EAAE,eAAe,EAC/B,gBAAgB,EAAE,iBAAiB,EACnC,aAAa,EAAE,UAAU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AAC,KAAK,CAAC;;;;;;;;;;;;GAYhC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { mix, getLuminance } from 'polished';\nimport { createGlobalStyle, css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\n\nimport { calculateFontSize } from './utils';\nimport type { FontSize } from './utils';\n\nexport const globalSpacingStyles = css`\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n }\n`;\n\nexport const createGlobalRootStyles = ({\n base: { scale, 'hit-area': hitArea, palette }\n}: DefaultTheme) => {\n return css`\n :root,\n :host {\n height: 100%;\n -webkit-text-size-adjust: 100%;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n font-size: calc(${scale} * 1rem);\n --hit-area: ${hitArea.compact};\n\n @media (pointer: coarse) {\n --hit-area: ${hitArea.finger};\n }\n color-scheme: ${getLuminance(palette['foreground-color']) > 0.5 ? 'dark' : 'light'};\n }\n `.join('');\n};\n\nexport const createGlobalBodyStyles = ({\n base: {\n 'font-size': baseFontSize,\n 'font-scale': baseFontScale,\n 'font-stretch': baseFontStretch,\n 'letter-spacing': baseLetterSpacing,\n 'font-family': fontFamily,\n palette: {\n 'foreground-color': foregroundColor,\n 'app-background': background,\n 'primary-background': primaryBackground\n },\n 'line-height': lineHeight\n },\n components: { text }\n}: DefaultTheme) => {\n // Can't call a hook here\n const fontSize = calculateFontSize(baseFontSize, baseFontScale);\n\n return css`\n body,\n :host {\n min-height: 100%;\n margin: 0;\n padding: 0;\n font-size: ${fontSize[text.primary['font-size'] as FontSize]};\n font-family: ${fontFamily};\n color: ${foregroundColor};\n line-height: ${lineHeight};\n font-stretch: ${baseFontStretch};\n letter-spacing: ${baseLetterSpacing};\n }\n\n body {\n background: ${background};\n background-color: ${primaryBackground};\n }\n `.join('');\n};\n\nexport default createGlobalStyle(({ theme }) => {\n const {\n base: {\n 'custom-scrollbar': customScrollbar,\n palette: { 'foreground-color': foreground },\n shadow: { focus },\n transparency: { 'transparent-3': transparent }\n },\n components: {\n 'form-control': { 'background-color': backgroundColor }\n }\n } = theme;\n return css`\n ${globalSpacingStyles}\n\n body {\n overscroll-behavior: none;\n }\n\n h1:focus-visible,\n h2:focus-visible,\n h3:focus-visible,\n h4:focus-visible,\n h5:focus-visible,\n h6:focus-visible {\n outline: transparent;\n box-shadow: ${focus};\n }\n\n ::placeholder {\n color: ${mix(transparent, foreground, backgroundColor)};\n opacity: unset;\n }\n\n ${customScrollbar &&\n css`\n * {\n scrollbar-width: thin;\n }\n `}\n\n ${createGlobalRootStyles(theme)}\n\n ${createGlobalBodyStyles(theme)}\n\n input,\n button,\n select,\n optgroup,\n textarea {\n margin: 0;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n }\n `;\n});\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-core",
|
|
3
|
-
"version": "9.0.0-build.
|
|
3
|
+
"version": "9.0.0-build.8.0",
|
|
4
4
|
"description": "Cosmos is a visual design system and UI component collection. Its goal is to empower application developers in their pursuit to create engaging and rewarding user experiences.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Pegasystems",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@types/dompurify": "^3.0.5",
|
|
28
28
|
"@types/emoji-mart": "^3.0.14",
|
|
29
29
|
"@types/emoji-regex": "^8.0.0",
|
|
30
|
-
"@types/google.maps": "^3.
|
|
30
|
+
"@types/google.maps": "^3.58.1",
|
|
31
31
|
"@types/qrcode": "^1.5.0",
|
|
32
32
|
"@types/react": "^17.0.62 || ^18.3.3",
|
|
33
33
|
"@types/react-dom": "^17.0.20 || ^18.3.0",
|