daliry-mobile-date-picker 1.0.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/.editorconfig +10 -0
- package/.gitattributes +4 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/workspace.xml +813 -0
- package/.yarnrc.yml +1 -0
- package/README.md +26 -0
- package/build.js +15 -0
- package/dist/MobileDatePicker.d.ts +17 -0
- package/dist/index.css +54 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +5282 -0
- package/package.json +30 -0
- package/src/MobileDatePicker.tsx +123 -0
- package/src/index.tsx +12 -0
- package/src/mobileDatePicker.css +59 -0
- package/tsconfig.json +18 -0
package/.yarnrc.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nodeLinker: "node-modules"
|
package/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# 📅 Mobile Date Picker
|
|
2
|
+
|
|
3
|
+
A mobile-first, customizable **Jalali (Shamsi) + Gregorian** date picker for React.
|
|
4
|
+
Easily select and receive dates in both Persian and Gregorian formats — with detailed breakdowns.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## ✨ Features
|
|
9
|
+
|
|
10
|
+
- 📆 **Dual calendar**: Jalali (Shamsi) + Gregorian
|
|
11
|
+
- 🎯 Designed for **mobile usage**
|
|
12
|
+
- ⚙️ Simple API with a reusable React component
|
|
13
|
+
- 📤 Returns multiple formats for selected date:
|
|
14
|
+
- Jalali year/month/day
|
|
15
|
+
- Formatted Jalali string
|
|
16
|
+
- Formatted Gregorian string
|
|
17
|
+
- Moment.js-compatible UTC string
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 📦 Installation
|
|
22
|
+
|
|
23
|
+
Install using npm or yarn:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install mobile-date-picker
|
package/build.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const esbuild = require("esbuild");
|
|
2
|
+
|
|
3
|
+
esbuild
|
|
4
|
+
.build({
|
|
5
|
+
entryPoints: ["src/MobileDatePicker.tsx"],
|
|
6
|
+
outfile: "dist/index.js",
|
|
7
|
+
bundle: true,
|
|
8
|
+
minify: false,
|
|
9
|
+
sourcemap: false,
|
|
10
|
+
format: "esm", // یا "cjs" برای CommonJS
|
|
11
|
+
target: ["esnext"],
|
|
12
|
+
// REMOVE this line
|
|
13
|
+
external: ["react", "react-dom"], // این خط را حذف کن
|
|
14
|
+
})
|
|
15
|
+
.catch(() => process.exit(1));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Moment } from "moment-jalaali";
|
|
2
|
+
import "./mobileDatePicker.css";
|
|
3
|
+
export interface IDate {
|
|
4
|
+
jYear: number;
|
|
5
|
+
jMonth: number;
|
|
6
|
+
jDay: number;
|
|
7
|
+
jDate: string;
|
|
8
|
+
date: string;
|
|
9
|
+
gDate: string;
|
|
10
|
+
moment: Moment;
|
|
11
|
+
}
|
|
12
|
+
interface IMobileDatePicker {
|
|
13
|
+
onDateChange: (date: IDate) => void;
|
|
14
|
+
isBirthdate?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const MobileDatePicker: ({ onDateChange, isBirthdate }: IMobileDatePicker) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default MobileDatePicker;
|
package/dist/index.css
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/* src/mobileDatePicker.css */
|
|
2
|
+
.datepicker-container {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
align-items: center;
|
|
6
|
+
gap: 16px;
|
|
7
|
+
width: 100%;
|
|
8
|
+
}
|
|
9
|
+
.scroll-lists {
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
background-color: #f5f5f5;
|
|
13
|
+
border-radius: 12px;
|
|
14
|
+
height: 152px;
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
.scroll-list {
|
|
18
|
+
width: 110px;
|
|
19
|
+
height: 152px;
|
|
20
|
+
overflow-y: auto;
|
|
21
|
+
scroll-snap-type: y mandatory;
|
|
22
|
+
scrollbar-width: none;
|
|
23
|
+
-ms-overflow-style: none;
|
|
24
|
+
}
|
|
25
|
+
.scroll-list::-webkit-scrollbar {
|
|
26
|
+
display: none;
|
|
27
|
+
}
|
|
28
|
+
.scroll-item {
|
|
29
|
+
height: 45px;
|
|
30
|
+
line-height: 45px;
|
|
31
|
+
text-align: center;
|
|
32
|
+
scroll-snap-align: center;
|
|
33
|
+
color: #bbb;
|
|
34
|
+
font-size: 16px;
|
|
35
|
+
opacity: 0.5;
|
|
36
|
+
filter: blur(4px);
|
|
37
|
+
font-weight: normal;
|
|
38
|
+
}
|
|
39
|
+
.scroll-item.selected {
|
|
40
|
+
color: #333;
|
|
41
|
+
font-size: 20px;
|
|
42
|
+
font-weight: bold;
|
|
43
|
+
opacity: 1;
|
|
44
|
+
filter: none;
|
|
45
|
+
}
|
|
46
|
+
.apply-button {
|
|
47
|
+
padding: 10px 20px;
|
|
48
|
+
background-color: #1976d2;
|
|
49
|
+
color: white;
|
|
50
|
+
border: none;
|
|
51
|
+
border-radius: 8px;
|
|
52
|
+
font-size: 16px;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
}
|
package/dist/index.d.ts
ADDED