@codedazur/react-date-picker
Advanced tools
| > @codedazur/react-date-picker@0.0.2 audit | ||
| > npm audit --omit dev | ||
| > @codedazur/react-date-picker@0.0.3 audit | ||
| > npm audit --omit dev --audit-level high | ||
| found 0 vulnerabilities |
+15
-15
| > @codedazur/react-date-picker@0.0.2 build | ||
| > @codedazur/react-date-picker@0.0.3 build | ||
| > tsup index.ts --format esm,cjs --dts | ||
| CLI Building entry: index.ts | ||
| CLI Using tsconfig: tsconfig.json | ||
| CLI tsup v8.1.0 | ||
| CLI Target: es6 | ||
| ESM Build start | ||
| CJS Build start | ||
| ESM dist/index.mjs 13.98 KB | ||
| ESM ⚡️ Build success in 99ms | ||
| CJS dist/index.js 16.03 KB | ||
| CJS ⚡️ Build success in 105ms | ||
| DTS Build start | ||
| DTS ⚡️ Build success in 7866ms | ||
| DTS dist/index.d.mts 5.23 KB | ||
| DTS dist/index.d.ts 5.23 KB | ||
| [34mCLI[39m Building entry: index.ts | ||
| [34mCLI[39m Using tsconfig: tsconfig.json | ||
| [34mCLI[39m tsup v8.5.0 | ||
| [34mCLI[39m Target: es2020 | ||
| [34mESM[39m Build start | ||
| [34mCJS[39m Build start | ||
| [32mCJS[39m [1mdist/index.js [22m[32m14.42 KB[39m | ||
| [32mCJS[39m ⚡️ Build success in 133ms | ||
| [32mESM[39m [1mdist/index.mjs [22m[32m12.31 KB[39m | ||
| [32mESM[39m ⚡️ Build success in 135ms | ||
| [34mDTS[39m Build start | ||
| [32mDTS[39m ⚡️ Build success in 8744ms | ||
| [32mDTS[39m [1mdist/index.d.mts [22m[32m5.23 KB[39m | ||
| [32mDTS[39m [1mdist/index.d.ts [22m[32m5.23 KB[39m |
+11
-11
| > @codedazur/react-date-picker@0.0.2 lint | ||
| > @codedazur/react-date-picker@0.0.3 lint | ||
| > TIMING=1 eslint "**/*.ts*" | ||
@@ -8,11 +8,11 @@ | ||
| :---------------------------------|----------:|--------: | ||
| react/display-name | 124.360 | 22.6% | ||
| @typescript-eslint/no-unused-vars | 110.125 | 20.0% | ||
| react/no-direct-mutation-state | 52.978 | 9.6% | ||
| react-hooks/exhaustive-deps | 50.460 | 9.2% | ||
| @next/next/no-html-link-for-pages | 44.837 | 8.2% | ||
| no-fallthrough | 39.485 | 7.2% | ||
| react/no-unescaped-entities | 22.263 | 4.0% | ||
| prefer-const | 20.470 | 3.7% | ||
| react/require-render-return | 18.359 | 3.3% | ||
| no-empty-pattern | 15.166 | 2.8% | ||
| turbo/no-undeclared-env-vars | 192.180 | 23.0% | ||
| @typescript-eslint/no-unused-vars | 153.555 | 18.4% | ||
| react/display-name | 138.966 | 16.7% | ||
| react/no-direct-mutation-state | 67.625 | 8.1% | ||
| @next/next/no-html-link-for-pages | 49.962 | 6.0% | ||
| react-hooks/exhaustive-deps | 30.167 | 3.6% | ||
| no-fallthrough | 20.218 | 2.4% | ||
| react-hooks/rules-of-hooks | 18.138 | 2.2% | ||
| use-isnan | 14.656 | 1.8% | ||
| @typescript-eslint/no-namespace | 14.183 | 1.7% |
| > @codedazur/react-date-picker@0.0.2 test | ||
| > @codedazur/react-date-picker@0.0.3 test | ||
| > vitest run --passWithNoTests | ||
| [7m[1m[36m RUN [39m[22m[27m [36mv1.6.0[39m [90m/home/runner/work/toolkit/toolkit/packages/react-date-picker[39m | ||
| [1m[46m RUN [49m[22m [36mv3.2.3 [39m[90m/home/runner/work/toolkit/toolkit/packages/react-date-picker[39m | ||
| No test files found, exiting with code 0 | ||
| [2minclude: [22m[33m**/*.{test,spec}.?(c|m)[jt]s?(x)[39m | ||
| [2mexclude: [22m[33m**/node_modules/**[2m, [22m**/dist/**[2m, [22m**/cypress/**[2m, [22m**/.{idea,git,cache,output,temp}/**[2m, [22m**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*[39m | ||
| [2mwatch exclude: [22m[33m**/node_modules/**[2m, [22m**/dist/**[39m | ||
| No test files found, exiting with code 0 | ||
+9
-0
| # @codedazur/react-date-picker | ||
| ## 0.0.3 | ||
| ### Patch Changes | ||
| - [`b24894a`](https://github.com/codedazur/toolkit/commit/b24894a2de01e596669c2b5aca51bc0b28533106) Thanks [@thijsdaniels](https://github.com/thijsdaniels)! - Mark the package as side-effect-free for tree shaking. | ||
| - Updated dependencies [[`b24894a`](https://github.com/codedazur/toolkit/commit/b24894a2de01e596669c2b5aca51bc0b28533106)]: | ||
| - @codedazur/essentials@1.12.1 | ||
| ## 0.0.2 | ||
@@ -4,0 +13,0 @@ |
+18
-55
| "use strict"; | ||
| var __defProp = Object.defineProperty; | ||
| var __defProps = Object.defineProperties; | ||
| var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
| var __getOwnPropDescs = Object.getOwnPropertyDescriptors; | ||
| var __getOwnPropNames = Object.getOwnPropertyNames; | ||
| var __getOwnPropSymbols = Object.getOwnPropertySymbols; | ||
| var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
| var __propIsEnum = Object.prototype.propertyIsEnumerable; | ||
| var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | ||
| var __spreadValues = (a, b) => { | ||
| for (var prop in b || (b = {})) | ||
| if (__hasOwnProp.call(b, prop)) | ||
| __defNormalProp(a, prop, b[prop]); | ||
| if (__getOwnPropSymbols) | ||
| for (var prop of __getOwnPropSymbols(b)) { | ||
| if (__propIsEnum.call(b, prop)) | ||
| __defNormalProp(a, prop, b[prop]); | ||
| } | ||
| return a; | ||
| }; | ||
| var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); | ||
| var __objRest = (source, exclude) => { | ||
| var target = {}; | ||
| for (var prop in source) | ||
| if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) | ||
| target[prop] = source[prop]; | ||
| if (source != null && __getOwnPropSymbols) | ||
| for (var prop of __getOwnPropSymbols(source)) { | ||
| if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) | ||
| target[prop] = source[prop]; | ||
| } | ||
| return target; | ||
| }; | ||
| var __export = (target, all) => { | ||
@@ -50,8 +21,8 @@ for (var name in all) | ||
| // index.ts | ||
| var react_date_picker_exports = {}; | ||
| __export(react_date_picker_exports, { | ||
| var index_exports = {}; | ||
| __export(index_exports, { | ||
| useDatePicker: () => useDatePicker, | ||
| useSingleDatePicker: () => useSingleDatePicker | ||
| }); | ||
| module.exports = __toCommonJS(react_date_picker_exports); | ||
| module.exports = __toCommonJS(index_exports); | ||
@@ -217,12 +188,8 @@ // hooks/useDatePicker.ts | ||
| } = {}) => { | ||
| var _a; | ||
| const [dates, setDates] = (0, import_react.useState)( | ||
| new Array(count).fill(null).map((_, index) => { | ||
| var _a2; | ||
| return (_a2 = initialDates == null ? void 0 : initialDates[index]) != null ? _a2 : null; | ||
| }) | ||
| new Array(count).fill(null).map((_, index) => initialDates?.[index] ?? null) | ||
| ); | ||
| const [cursor, setCursor] = (0, import_react.useState)(initialCursor); | ||
| const [month, setMonth] = (0, import_react.useState)( | ||
| (0, import_date_fns6.startOfMonth)((_a = initialMonth != null ? initialMonth : initialDates == null ? void 0 : initialDates[0]) != null ? _a : /* @__PURE__ */ new Date()) | ||
| (0, import_date_fns6.startOfMonth)(initialMonth ?? initialDates?.[0] ?? /* @__PURE__ */ new Date()) | ||
| ); | ||
@@ -233,6 +200,3 @@ const [focusedDate, setFocusedDate] = (0, import_react.useState)(null); | ||
| setDates( | ||
| (dates2) => new Array(count).fill(null).map((_, index) => { | ||
| var _a2; | ||
| return (_a2 = dates2 == null ? void 0 : dates2[index]) != null ? _a2 : null; | ||
| }) | ||
| (dates2) => new Array(count).fill(null).map((_, index) => dates2?.[index] ?? null) | ||
| ); | ||
@@ -474,11 +438,8 @@ }, [count]); | ||
| var import_essentials2 = require("@codedazur/essentials"); | ||
| var useSingleDatePicker = (_a = {}) => { | ||
| var _b = _a, { | ||
| initialDate, | ||
| isDateDisabled | ||
| } = _b, props = __objRest(_b, [ | ||
| "initialDate", | ||
| "isDateDisabled" | ||
| ]); | ||
| const _a2 = useDatePicker(__spreadValues({ | ||
| var useSingleDatePicker = ({ | ||
| initialDate, | ||
| isDateDisabled, | ||
| ...props | ||
| } = {}) => { | ||
| const { dates, setDate, ...results } = useDatePicker({ | ||
| count: 1, | ||
@@ -488,5 +449,7 @@ initialDates: initialDate ? [initialDate] : void 0, | ||
| maxDuration: 1, | ||
| isDateDisabled: isDateDisabled ? (date, cursor, dates2) => isDateDisabled(date, dates2[0]) : void 0 | ||
| }, props)), { dates, setDate } = _a2, results = __objRest(_a2, ["dates", "setDate"]); | ||
| return __spreadProps(__spreadValues({}, (0, import_essentials2.omit)(results, ["cursor", "setCursor", "isFirstDate", "isLastDate"])), { | ||
| isDateDisabled: isDateDisabled ? (date, _, dates2) => isDateDisabled(date, dates2[0]) : void 0, | ||
| ...props | ||
| }); | ||
| return { | ||
| ...(0, import_essentials2.omit)(results, ["cursor", "setCursor", "isFirstDate", "isLastDate"]), | ||
| date: dates[0], | ||
@@ -496,3 +459,3 @@ setDate: (date) => { | ||
| } | ||
| }); | ||
| }; | ||
| }; | ||
@@ -499,0 +462,0 @@ // Annotate the CommonJS export names for ESM import in node: |
+15
-55
@@ -1,33 +0,1 @@ | ||
| var __defProp = Object.defineProperty; | ||
| var __defProps = Object.defineProperties; | ||
| var __getOwnPropDescs = Object.getOwnPropertyDescriptors; | ||
| var __getOwnPropSymbols = Object.getOwnPropertySymbols; | ||
| var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
| var __propIsEnum = Object.prototype.propertyIsEnumerable; | ||
| var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | ||
| var __spreadValues = (a, b) => { | ||
| for (var prop in b || (b = {})) | ||
| if (__hasOwnProp.call(b, prop)) | ||
| __defNormalProp(a, prop, b[prop]); | ||
| if (__getOwnPropSymbols) | ||
| for (var prop of __getOwnPropSymbols(b)) { | ||
| if (__propIsEnum.call(b, prop)) | ||
| __defNormalProp(a, prop, b[prop]); | ||
| } | ||
| return a; | ||
| }; | ||
| var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); | ||
| var __objRest = (source, exclude) => { | ||
| var target = {}; | ||
| for (var prop in source) | ||
| if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) | ||
| target[prop] = source[prop]; | ||
| if (source != null && __getOwnPropSymbols) | ||
| for (var prop of __getOwnPropSymbols(source)) { | ||
| if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) | ||
| target[prop] = source[prop]; | ||
| } | ||
| return target; | ||
| }; | ||
| // hooks/useDatePicker.ts | ||
@@ -218,12 +186,8 @@ import { clamp } from "@codedazur/essentials"; | ||
| } = {}) => { | ||
| var _a; | ||
| const [dates, setDates] = useState( | ||
| new Array(count).fill(null).map((_, index) => { | ||
| var _a2; | ||
| return (_a2 = initialDates == null ? void 0 : initialDates[index]) != null ? _a2 : null; | ||
| }) | ||
| new Array(count).fill(null).map((_, index) => initialDates?.[index] ?? null) | ||
| ); | ||
| const [cursor, setCursor] = useState(initialCursor); | ||
| const [month, setMonth] = useState( | ||
| startOfMonth3((_a = initialMonth != null ? initialMonth : initialDates == null ? void 0 : initialDates[0]) != null ? _a : /* @__PURE__ */ new Date()) | ||
| startOfMonth3(initialMonth ?? initialDates?.[0] ?? /* @__PURE__ */ new Date()) | ||
| ); | ||
@@ -234,6 +198,3 @@ const [focusedDate, setFocusedDate] = useState(null); | ||
| setDates( | ||
| (dates2) => new Array(count).fill(null).map((_, index) => { | ||
| var _a2; | ||
| return (_a2 = dates2 == null ? void 0 : dates2[index]) != null ? _a2 : null; | ||
| }) | ||
| (dates2) => new Array(count).fill(null).map((_, index) => dates2?.[index] ?? null) | ||
| ); | ||
@@ -475,11 +436,8 @@ }, [count]); | ||
| import { omit } from "@codedazur/essentials"; | ||
| var useSingleDatePicker = (_a = {}) => { | ||
| var _b = _a, { | ||
| initialDate, | ||
| isDateDisabled | ||
| } = _b, props = __objRest(_b, [ | ||
| "initialDate", | ||
| "isDateDisabled" | ||
| ]); | ||
| const _a2 = useDatePicker(__spreadValues({ | ||
| var useSingleDatePicker = ({ | ||
| initialDate, | ||
| isDateDisabled, | ||
| ...props | ||
| } = {}) => { | ||
| const { dates, setDate, ...results } = useDatePicker({ | ||
| count: 1, | ||
@@ -489,5 +447,7 @@ initialDates: initialDate ? [initialDate] : void 0, | ||
| maxDuration: 1, | ||
| isDateDisabled: isDateDisabled ? (date, cursor, dates2) => isDateDisabled(date, dates2[0]) : void 0 | ||
| }, props)), { dates, setDate } = _a2, results = __objRest(_a2, ["dates", "setDate"]); | ||
| return __spreadProps(__spreadValues({}, omit(results, ["cursor", "setCursor", "isFirstDate", "isLastDate"])), { | ||
| isDateDisabled: isDateDisabled ? (date, _, dates2) => isDateDisabled(date, dates2[0]) : void 0, | ||
| ...props | ||
| }); | ||
| return { | ||
| ...omit(results, ["cursor", "setCursor", "isFirstDate", "isLastDate"]), | ||
| date: dates[0], | ||
@@ -497,3 +457,3 @@ setDate: (date) => { | ||
| } | ||
| }); | ||
| }; | ||
| }; | ||
@@ -500,0 +460,0 @@ export { |
@@ -44,3 +44,3 @@ import { omit } from "@codedazur/essentials"; | ||
| isDateDisabled: isDateDisabled | ||
| ? (date, cursor, dates) => isDateDisabled(date, dates[0]) | ||
| ? (date, _, dates) => isDateDisabled(date, dates[0]) | ||
| : undefined, | ||
@@ -47,0 +47,0 @@ ...props, |
+5
-4
| { | ||
| "name": "@codedazur/react-date-picker", | ||
| "version": "0.0.2", | ||
| "version": "0.0.3", | ||
| "main": ".dist/index.js", | ||
@@ -17,6 +17,7 @@ "module": "./dist/index.mjs", | ||
| "license": "MIT", | ||
| "sideEffects": false, | ||
| "scripts": { | ||
| "develop": "tsup index.ts --format esm,cjs --dts --watch --external react", | ||
| "build": "tsup index.ts --format esm,cjs --dts", | ||
| "audit": "npm audit --omit dev", | ||
| "audit": "npm audit --omit dev --audit-level high", | ||
| "lint": "TIMING=1 eslint \"**/*.ts*\"", | ||
@@ -31,7 +32,7 @@ "types": "tsc --noEmit", | ||
| "dependencies": { | ||
| "@codedazur/essentials": "^1.9.1", | ||
| "@codedazur/essentials": "^1.12.1", | ||
| "date-fns": "^2.30.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@testing-library/dom": "10.2.0", | ||
| "@testing-library/dom": "10.4.0", | ||
| "@testing-library/react": "alpha", | ||
@@ -38,0 +39,0 @@ "@types/react-dom": "^18.3.0", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
-100%63622
-4.17%1754
-4.15%