react-icalendar-link
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -7,2 +7,3 @@ /** | ||
interface Props { | ||
className: string; | ||
href: string; | ||
@@ -20,5 +21,5 @@ event: ICalEvent; | ||
constructor(props: any); | ||
handleClick: (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void; | ||
handleClick: (e: React.MouseEvent<HTMLAnchorElement>) => void; | ||
render(): JSX.Element; | ||
} | ||
export {}; |
@@ -43,14 +43,2 @@ import * as React from 'react'; | ||
function __rest(s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
} | ||
function pad(num) { | ||
@@ -77,21 +65,24 @@ if (num < 10) { | ||
var body = []; | ||
body.push("URL:" + (event.url || document.URL)); | ||
if (!event || !event.startTime || !event.title) | ||
throw Error("Both startTime and title fields are mandatory"); | ||
body.push("DTSTART:" + formatDate(event.startTime)); | ||
body.push("SUMMARY:" + event.title); | ||
event.attendees && event.attendees.forEach(function (attendee) { | ||
var regExp = /^([^<]+)\s*<(.+)>/; | ||
var matches = attendee.match(regExp); | ||
if (matches) { | ||
var name_1 = matches[1]; | ||
var email = matches[2]; | ||
body.push([ | ||
'ATTENDEE', | ||
"CN=" + name_1, | ||
'CUTYPE=INDIVIDUAL', | ||
'PARTSTAT=NEEDS-ACTION', | ||
'ROLE=REQ-PARTICIPANT', | ||
"RSVP=TRUE:mailto:" + email | ||
].join(';')); | ||
} | ||
}); | ||
event.url && body.push("URL:" + event.url); | ||
event.attendees && | ||
event.attendees.forEach(function (attendee) { | ||
var regExp = /^([^<]+)\s*<(.+)>/; | ||
var matches = attendee.match(regExp); | ||
if (matches) { | ||
var name_1 = matches[1]; | ||
var email = matches[2]; | ||
body.push([ | ||
"ATTENDEE", | ||
"CN=" + name_1, | ||
"CUTYPE=INDIVIDUAL", | ||
"PARTSTAT=NEEDS-ACTION", | ||
"ROLE=REQ-PARTICIPANT", | ||
"RSVP=TRUE:mailto:" + email | ||
].join(";")); | ||
} | ||
}); | ||
event.endTime && body.push("DTEND:" + formatDate(event.endTime)); | ||
@@ -170,4 +161,4 @@ event.description && body.push("DESCRIPTION:" + event.description); | ||
ICalLink.prototype.render = function () { | ||
var _a = this.props, children = _a.children, otherProps = __rest(_a, ["children"]); | ||
return (React.createElement("a", __assign({ onClick: this.handleClick }, otherProps), children)); | ||
var _a = this.props, children = _a.children, href = _a.href, className = _a.className; | ||
return (React.createElement("a", __assign({ onClick: this.handleClick }, { href: href, className: className }), children)); | ||
}; | ||
@@ -185,3 +176,3 @@ // FIXME - iOS Chrome doesn't support adding to iCal at the moment. | ||
export default ICalLink; | ||
export { ICalLink as default }; | ||
//# sourceMappingURL=index.es.js.map |
@@ -16,5 +16,3 @@ 'use strict'; | ||
enumerable: true, | ||
get: function () { | ||
return e[k]; | ||
} | ||
get: function () { return e[k]; } | ||
}); | ||
@@ -24,3 +22,3 @@ } | ||
} | ||
n['default'] = e; | ||
n["default"] = e; | ||
return Object.freeze(n); | ||
@@ -71,14 +69,2 @@ } | ||
function __rest(s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
} | ||
function pad(num) { | ||
@@ -105,21 +91,24 @@ if (num < 10) { | ||
var body = []; | ||
body.push("URL:" + (event.url || document.URL)); | ||
if (!event || !event.startTime || !event.title) | ||
throw Error("Both startTime and title fields are mandatory"); | ||
body.push("DTSTART:" + formatDate(event.startTime)); | ||
body.push("SUMMARY:" + event.title); | ||
event.attendees && event.attendees.forEach(function (attendee) { | ||
var regExp = /^([^<]+)\s*<(.+)>/; | ||
var matches = attendee.match(regExp); | ||
if (matches) { | ||
var name_1 = matches[1]; | ||
var email = matches[2]; | ||
body.push([ | ||
'ATTENDEE', | ||
"CN=" + name_1, | ||
'CUTYPE=INDIVIDUAL', | ||
'PARTSTAT=NEEDS-ACTION', | ||
'ROLE=REQ-PARTICIPANT', | ||
"RSVP=TRUE:mailto:" + email | ||
].join(';')); | ||
} | ||
}); | ||
event.url && body.push("URL:" + event.url); | ||
event.attendees && | ||
event.attendees.forEach(function (attendee) { | ||
var regExp = /^([^<]+)\s*<(.+)>/; | ||
var matches = attendee.match(regExp); | ||
if (matches) { | ||
var name_1 = matches[1]; | ||
var email = matches[2]; | ||
body.push([ | ||
"ATTENDEE", | ||
"CN=" + name_1, | ||
"CUTYPE=INDIVIDUAL", | ||
"PARTSTAT=NEEDS-ACTION", | ||
"ROLE=REQ-PARTICIPANT", | ||
"RSVP=TRUE:mailto:" + email | ||
].join(";")); | ||
} | ||
}); | ||
event.endTime && body.push("DTEND:" + formatDate(event.endTime)); | ||
@@ -198,4 +187,4 @@ event.description && body.push("DESCRIPTION:" + event.description); | ||
ICalLink.prototype.render = function () { | ||
var _a = this.props, children = _a.children, otherProps = __rest(_a, ["children"]); | ||
return (React__namespace.createElement("a", __assign({ onClick: this.handleClick }, otherProps), children)); | ||
var _a = this.props, children = _a.children, href = _a.href, className = _a.className; | ||
return (React__namespace.createElement("a", __assign({ onClick: this.handleClick }, { href: href, className: className }), children)); | ||
}; | ||
@@ -213,3 +202,3 @@ // FIXME - iOS Chrome doesn't support adding to iCal at the moment. | ||
exports.default = ICalLink; | ||
exports["default"] = ICalLink; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "react-icalendar-link", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Ability to create link for downloading ics file", | ||
@@ -16,12 +16,14 @@ "author": "josephj", | ||
"scripts": { | ||
"test": "cross-env CI=1 react-scripts-ts test --env=jsdom", | ||
"test:watch": "react-scripts-ts test --env=jsdom", | ||
"build": "rollup -c", | ||
"test": "jest", | ||
"test:watch": "jest --watch", | ||
"build": "yarn test && rollup -c", | ||
"start": "rollup -c -w", | ||
"prepare": "npm run build", | ||
"predeploy": "cd example && npm install && npm run build", | ||
"prepare": "yarn build", | ||
"predeploy": "cd example && yarn && yarn build", | ||
"deploy": "gh-pages -d example/build", | ||
"lint": "tslint 'src/**/*.{ts,tsx}'" | ||
}, | ||
"dependencies": {}, | ||
"dependencies": { | ||
"@jest/globals": "^27.0.1" | ||
}, | ||
"peerDependencies": { | ||
@@ -33,3 +35,3 @@ "prop-types": "^15.5.4", | ||
"devDependencies": { | ||
"@types/jest": "^26.0.23", | ||
"@types/jest": "^27.0.2", | ||
"@types/react": "^17.0.5", | ||
@@ -39,5 +41,6 @@ "@types/react-dom": "^17.0.3", | ||
"babel-runtime": "^6.26.0", | ||
"cross-env": "^5.1.4", | ||
"gh-pages": "^1.2.0", | ||
"prettier": "^1.14.3", | ||
"cross-env": "^7.0.3", | ||
"gh-pages": "^3.2.3", | ||
"jest": "^27.0.1", | ||
"prettier": "^2.4.1", | ||
"react": "^17.0.2", | ||
@@ -53,7 +56,8 @@ "react-dom": "^17.0.2", | ||
"rollup-plugin-url": "^3.0.1", | ||
"tslint": "^5.11.0", | ||
"ts-jest": "^27.0.1", | ||
"tslint": "^6.1.3", | ||
"tslint-config-prettier": "^1.15.0", | ||
"tslint-config-standard": "^8.0.1", | ||
"tslint-react": "^3.6.0", | ||
"typescript": "^2.8.3" | ||
"tslint-config-standard": "^9.0.0", | ||
"tslint-react": "^5.0.0", | ||
"typescript": "^4.3.2" | ||
}, | ||
@@ -60,0 +64,0 @@ "files": [ |
@@ -26,3 +26,7 @@ # react-icalendar-link | ||
endTime: "2018-10-07T12:00:00+10:00", | ||
location: "10 Carlotta St, Artarmon NSW 2064, Australia"; | ||
location: "10 Carlotta St, Artarmon NSW 2064, Australia", | ||
attendees: [ | ||
"Hello World <hello@world.com>", | ||
"Hey <hey@test.com>", | ||
] | ||
} | ||
@@ -29,0 +33,0 @@ return ( |
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
74
60947
4
25
389
+ Added@jest/globals@^27.0.1
+ Added@babel/code-frame@7.24.7(transitive)
+ Added@babel/helper-validator-identifier@7.24.7(transitive)
+ Added@babel/highlight@7.24.7(transitive)
+ Added@jest/environment@27.5.1(transitive)
+ Added@jest/fake-timers@27.5.1(transitive)
+ Added@jest/globals@27.5.1(transitive)
+ Added@jest/types@27.5.1(transitive)
+ Added@sinonjs/commons@1.8.6(transitive)
+ Added@sinonjs/fake-timers@8.1.0(transitive)
+ Added@types/istanbul-lib-coverage@2.0.6(transitive)
+ Added@types/istanbul-lib-report@3.0.3(transitive)
+ Added@types/istanbul-reports@3.0.4(transitive)
+ Added@types/node@22.5.5(transitive)
+ Added@types/stack-utils@2.0.3(transitive)
+ Added@types/yargs@16.0.9(transitive)
+ Added@types/yargs-parser@21.0.3(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedansi-styles@3.2.14.3.05.2.0(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedchalk@2.4.24.1.2(transitive)
+ Addedci-info@3.9.0(transitive)
+ Addedcolor-convert@1.9.32.0.1(transitive)
+ Addedcolor-name@1.1.31.1.4(transitive)
+ Addeddiff-sequences@27.5.1(transitive)
+ Addedescape-string-regexp@1.0.52.0.0(transitive)
+ Addedexpect@27.5.1(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhas-flag@3.0.04.0.0(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedjest-diff@27.5.1(transitive)
+ Addedjest-get-type@27.5.1(transitive)
+ Addedjest-matcher-utils@27.5.1(transitive)
+ Addedjest-message-util@27.5.1(transitive)
+ Addedjest-mock@27.5.1(transitive)
+ Addedjest-util@27.5.1(transitive)
+ Addedmicromatch@4.0.8(transitive)
+ Addedpicocolors@1.1.0(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedpretty-format@27.5.1(transitive)
+ Addedreact-is@17.0.2(transitive)
+ Addedslash@3.0.0(transitive)
+ Addedstack-utils@2.0.6(transitive)
+ Addedsupports-color@5.5.07.2.0(transitive)
+ Addedto-regex-range@5.0.1(transitive)
+ Addedtype-detect@4.0.8(transitive)
+ Addedundici-types@6.19.8(transitive)