zaman-backoffice 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/.babelrc.json +7 -0
- package/CONTRIBUTING.md +12 -0
- package/LICENSE +21 -0
- package/README.md +129 -0
- package/package.json +80 -0
package/.babelrc.json
ADDED
package/CONTRIBUTING.md
ADDED
package/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2019 Reza Khosroshahi
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
# Zaman
|
2
|
+
|
3
|
+
Zaman is a lightweight React component for creating a Jalali/Georgian datepicker. There is also a range datepicker and timepicker in Zaman. The module can also be customized to match the appearance of your designs.
|
4
|
+
|
5
|
+
#### Design
|
6
|
+
|
7
|
+
I appreciate [Ali Samandar](https://dribbble.com/eanlami)'s design of this library. Give him your support.
|
8
|
+
|
9
|
+
check out the [codesandbox link.](https://codesandbox.io/s/new-version-date-picker-6eeepf)
|
10
|
+
## Install
|
11
|
+
|
12
|
+
with npm
|
13
|
+
|
14
|
+
`$ npm i zaman`
|
15
|
+
|
16
|
+
with yarn
|
17
|
+
|
18
|
+
`$ yarn add zaman`
|
19
|
+
|
20
|
+
## Props
|
21
|
+
### Date Picker and Calendar
|
22
|
+
|
23
|
+
| props | type | default |
|
24
|
+
|----------------------|------------------------------------------------------------|-----------|
|
25
|
+
| defaultValue | timestamp | Date | Dayjs | undefined |
|
26
|
+
| weekend | number[] | undefined |
|
27
|
+
| round | string one of thin | x1 | x2 | x3 | x4 | thin |
|
28
|
+
| accentColor | string | #0D59F2 |
|
29
|
+
| locale | string one of fa | en | fa |
|
30
|
+
| direction | string one of rtl | ltr | rtl |
|
31
|
+
| onChange | function | undefined |
|
32
|
+
| range | boolean | false |
|
33
|
+
| from | timestamp | Date | Dayjs | undefined |
|
34
|
+
| to | timestamp | Date | Dayjs | undefined |
|
35
|
+
| show | boolean | false |
|
36
|
+
| inputClass | string | null |
|
37
|
+
| inputAttributes | object of InputHTMLAttributes | null |
|
38
|
+
| className | string | null |
|
39
|
+
| customShowDateFormat | string ex: YYYY MMMM DD or DD/MM etc. | undefined |
|
40
|
+
| position | right | left | center | right |
|
41
|
+
|
42
|
+
|
43
|
+
### Calendar Provider
|
44
|
+
|
45
|
+
| props | type | default |
|
46
|
+
|-------------|------------------------------------------------------------|---------|
|
47
|
+
| round | string one of thin | x1 | x2 | x3 | x4 | thin |
|
48
|
+
| accentColor | string | #0D59F2 |
|
49
|
+
| locale | string one of fa | en | fa |
|
50
|
+
| direction | string one of rtl | ltr | rtl |
|
51
|
+
| children | ReactNode | null |
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
### Time Picker
|
56
|
+
|
57
|
+
| props | type | default |
|
58
|
+
|-----------------|------------------------------------------------------------|---------|
|
59
|
+
| defaultValue | timestamp | Date | Dayjs | Date |
|
60
|
+
| round | string one of thin | x1 | x2 | x3 | x4 | thin |
|
61
|
+
| accentColor | string | #0D59F2 |
|
62
|
+
| locale | string one of fa | en | fa |
|
63
|
+
| clockTime | number one of 12 | 24 | 24 |
|
64
|
+
| inputClass | string | null |
|
65
|
+
| inputAttributes | object of InputHTMLAttributes | null |
|
66
|
+
|
67
|
+
## Usages
|
68
|
+
### Date picker
|
69
|
+
|
70
|
+
``` jsx
|
71
|
+
import { DatePicker } from "zaman";
|
72
|
+
|
73
|
+
function App() {
|
74
|
+
return (
|
75
|
+
<DatePicker onChange={(e) => console.log(e.value)} />
|
76
|
+
)
|
77
|
+
}
|
78
|
+
```
|
79
|
+
|
80
|
+
### Range date picker
|
81
|
+
|
82
|
+
``` jsx
|
83
|
+
import { DatePicker } from "zaman";
|
84
|
+
|
85
|
+
function App() {
|
86
|
+
return (
|
87
|
+
<DatePicker onChange={(e) => console.log(e.from, e.to)} range />
|
88
|
+
)
|
89
|
+
}
|
90
|
+
```
|
91
|
+
|
92
|
+
### Calendar
|
93
|
+
|
94
|
+
``` jsx
|
95
|
+
import { Calendar, CalendarProvider } from "zaman";
|
96
|
+
|
97
|
+
function App() {
|
98
|
+
const [calendarValue, setCalendarValue] = useState(new Date())
|
99
|
+
|
100
|
+
return (
|
101
|
+
<CalendarProvider>
|
102
|
+
<Calendar
|
103
|
+
defaultValue={calendarValue}
|
104
|
+
onChange={(e) => setCalendarValue(new Date(e.value))}
|
105
|
+
/>
|
106
|
+
</CalendarProvider>
|
107
|
+
)
|
108
|
+
}
|
109
|
+
```
|
110
|
+
|
111
|
+
|
112
|
+
### Time picker
|
113
|
+
|
114
|
+
``` jsx
|
115
|
+
import { TimePicker } from "zaman";
|
116
|
+
|
117
|
+
function App() {
|
118
|
+
return (
|
119
|
+
<TimePicker
|
120
|
+
onChange={(e) => console.log(e.hour, e.minute, e.timeConvention)}
|
121
|
+
/>
|
122
|
+
)
|
123
|
+
}
|
124
|
+
```
|
125
|
+
|
126
|
+
## License
|
127
|
+
|
128
|
+
|
129
|
+
[MIT License](https://github.com/rzkhosroshahi/zaman/blob/main/LICENSE)
|
package/package.json
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
{
|
2
|
+
"name": "zaman-backoffice",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "thanks to the zaman team. just needed to add the ability to have a controlled input value",
|
5
|
+
"main": "dist/index.js",
|
6
|
+
"scripts": {
|
7
|
+
"cypress:open": "cypress open",
|
8
|
+
"test:e2e": "cypress run --browser=chrome --component",
|
9
|
+
"test": "NODE_ENV=test jest",
|
10
|
+
"test:watch": "NODE_ENV=test jest --watchAll",
|
11
|
+
"test:update": "NODE_ENV=test jest -- -u",
|
12
|
+
"build": "rm -rf dist && rollup -c --bundleConfigAsCjs",
|
13
|
+
"dev": "vite",
|
14
|
+
"watch": "rollup -c rollup.config.js -w",
|
15
|
+
"lint:fix": "eslint --fix src",
|
16
|
+
"format": "prettier src --write",
|
17
|
+
"prepare": "husky install"
|
18
|
+
},
|
19
|
+
|
20
|
+
"keywords": [
|
21
|
+
"datepicker",
|
22
|
+
"farsi",
|
23
|
+
"jalali",
|
24
|
+
"shamsi"
|
25
|
+
],
|
26
|
+
"author": "ali zakerinia",
|
27
|
+
"license": "MIT",
|
28
|
+
|
29
|
+
"devDependencies": {
|
30
|
+
"@babel/core": "^7.21.0",
|
31
|
+
"@babel/preset-env": "^7.20.2",
|
32
|
+
"@babel/preset-react": "^7.18.6",
|
33
|
+
"@babel/preset-typescript": "^7.21.0",
|
34
|
+
"@commitlint/cli": "^17.6.1",
|
35
|
+
"@commitlint/config-conventional": "^17.6.1",
|
36
|
+
"@rollup/plugin-babel": "^6.0.3",
|
37
|
+
"@rollup/plugin-commonjs": "^24.0.1",
|
38
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
39
|
+
"@rollup/plugin-terser": "^0.4.0",
|
40
|
+
"@rollup/plugin-typescript": "^11.0.0",
|
41
|
+
"@testing-library/cypress": "^9.0.0",
|
42
|
+
"@testing-library/react": "^14.0.0",
|
43
|
+
"@types/cypress": "^1.1.3",
|
44
|
+
"@types/jest": "^29.4.0",
|
45
|
+
"@types/lodash.debounce": "^4.0.7",
|
46
|
+
"@types/node": "^18.13.0",
|
47
|
+
"@types/react": "^18.0.28",
|
48
|
+
"@types/react-dom": "^18.0.10",
|
49
|
+
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
50
|
+
"@typescript-eslint/parser": "^5.51.0",
|
51
|
+
"@vitejs/plugin-react": "^3.1.0",
|
52
|
+
"babel-jest": "^29.4.3",
|
53
|
+
"cypress": "^12.10.0",
|
54
|
+
"eslint": "^8.0.1",
|
55
|
+
"eslint-config-prettier": "^9.0.0",
|
56
|
+
"eslint-config-standard-with-typescript": "^34.0.0",
|
57
|
+
"eslint-plugin-import": "^2.25.2",
|
58
|
+
"eslint-plugin-n": "^15.0.0",
|
59
|
+
"eslint-plugin-prettier": "^5.0.1",
|
60
|
+
"eslint-plugin-promise": "^6.0.0",
|
61
|
+
"eslint-plugin-react": "^7.32.2",
|
62
|
+
"husky": "^8.0.3",
|
63
|
+
"jest": "^29.4.3",
|
64
|
+
"jest-environment-jsdom": "^29.4.3",
|
65
|
+
"prettier": "^3.1.1",
|
66
|
+
"react": "^18.2.0",
|
67
|
+
"react-dom": "^18.2.0",
|
68
|
+
"rollup": "^3.15.0",
|
69
|
+
"rollup-plugin-esbuild": "^5.0.0",
|
70
|
+
"ts-jest": "^29.0.5",
|
71
|
+
"ts-node": "^10.9.1",
|
72
|
+
"typescript": "*",
|
73
|
+
"vite": "^4.1.0"
|
74
|
+
},
|
75
|
+
"dependencies": {
|
76
|
+
"@emotion/react": "^11.10.5",
|
77
|
+
"@emotion/styled": "^11.10.5",
|
78
|
+
"dayjs": "^1.11.7"
|
79
|
+
}
|
80
|
+
}
|