gs-calendar 0.0.1
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/LICENSE +21 -0
- package/README.md +59 -0
- package/dist/App.d.ts +3 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/Calendar.d.ts +4 -0
- package/dist/Calendar.d.ts.map +1 -0
- package/dist/components/DaysComponent.d.ts +15 -0
- package/dist/components/DaysComponent.d.ts.map +1 -0
- package/dist/components/NavigationComponent.d.ts +14 -0
- package/dist/components/NavigationComponent.d.ts.map +1 -0
- package/dist/components/WeekComponent.d.ts +8 -0
- package/dist/components/WeekComponent.d.ts.map +1 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/interfaces/index.d.ts +3 -0
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/interfaces/type.d.ts +21 -0
- package/dist/interfaces/type.d.ts.map +1 -0
- package/dist/interfaces/utils.interface.d.ts +10 -0
- package/dist/interfaces/utils.interface.d.ts.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/react-ad-bs-calendar.es.js +4050 -0
- package/dist/react-ad-bs-calendar.umd.js +36 -0
- package/dist/style.css +1 -0
- package/dist/types.d.ts +3 -0
- package/dist/utils/bs.constants.d.ts +2 -0
- package/dist/utils/bs.constants.d.ts.map +1 -0
- package/dist/utils/constants.d.ts +8 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/fnUtils.d.ts +22 -0
- package/dist/utils/fnUtils.d.ts.map +1 -0
- package/dist/utils/getIconHandler.d.ts +4 -0
- package/dist/utils/getIconHandler.d.ts.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/vite.svg +1 -0
- package/package.json +71 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Araj Chalise
|
|
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,59 @@
|
|
|
1
|
+
# react-ad-bs-calendar
|
|
2
|
+
|
|
3
|
+
#### Installation
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install react-ad-bs-calendar
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
Here's an example of basic usage:
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import Calendar from 'react-ad-bs-calendar';
|
|
15
|
+
|
|
16
|
+
function MyApp() {
|
|
17
|
+
return (
|
|
18
|
+
<div>
|
|
19
|
+
<Calendar />
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Custom styling
|
|
26
|
+
|
|
27
|
+
If you want to use default react-ad-bs-calendar styling to build upon it, you can import react-ad-bs-calendar's styles by using:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import 'react-ad-bs-calendar/dist/style.css';
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### User guide
|
|
34
|
+
##### Calendar
|
|
35
|
+
|
|
36
|
+
Displays a calendar in AD and BS.
|
|
37
|
+
|
|
38
|
+
##### Props
|
|
39
|
+
|
|
40
|
+
| Prop | Default Value | Description | Example Value |
|
|
41
|
+
|-------------------|--------------------|---------------------------------------------------------------|-------------------|
|
|
42
|
+
| mode | ModeTypeEnum.AD | Calendar mode (AD or BS) | ModeTypeEnum.AD |
|
|
43
|
+
| language | LanguageTypeEnum.ENGLISH | Calendar language (English or Nepali) | LanguageTypeEnum.ENGLISH |
|
|
44
|
+
| value | "" | Initial selected date in "YYYY-MM-DD" format | "2024-01-17" |
|
|
45
|
+
| onClickDate | (value, date_ad) => {} | Callback function on date click | - |
|
|
46
|
+
| onChangeYear | (date_ad) => {} | Callback function on year change | - |
|
|
47
|
+
| onChangeMonth | (date_ad) => {} | Callback function on month change | - |
|
|
48
|
+
| maxDate | "" | Maximum allowed date in "YYYY-MM-DD" format | "2050-12-31" |
|
|
49
|
+
| minDate | "" | Minimum allowed date in "YYYY-MM-DD" format | "2000-01-01" |
|
|
50
|
+
| weekends | [0, 6] | Array of weekend days (0 = Sunday, 1 = Monday, ..., 6 = Saturday) | [0, 6] |
|
|
51
|
+
| tileContent | (date_ad) => React.ReactNode | Custom content for a date tile | (date_ad) => <div>{date_ad}</div> |
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### License
|
|
55
|
+
|
|
56
|
+
The MIT License.
|
|
57
|
+
|
|
58
|
+
### Author
|
|
59
|
+
[Araj Chalise](https://github.com/arajchalise)
|
package/dist/App.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAIA,iBAAS,GAAG,4CA2FX;AAED,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CalendarPropsType } from "./types";
|
|
2
|
+
declare function Calendar({ maxDate, minDate, onClickDate, onChangeMonth, onChangeYear, language, value, mode, weekends, tileContent, }: CalendarPropsType): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default Calendar;
|
|
4
|
+
//# sourceMappingURL=Calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../src/Calendar.tsx"],"names":[],"mappings":"AAMA,OAAO,aAAa,CAAC;AASrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,iBAAS,QAAQ,CAAC,EAChB,OAAO,EACP,OAAO,EACP,WAAW,EACX,aAAa,EACb,YAAY,EACZ,QAAmC,EACnC,KAAK,EACL,IAAsB,EACtB,QAAQ,EACR,WAAW,GACZ,EAAE,iBAAiB,2CA8HnB;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DateInterface, LanguageTypeEnum, ModeTypeEnum } from "../interfaces";
|
|
2
|
+
type propsType = {
|
|
3
|
+
defaultDate: DateInterface;
|
|
4
|
+
selectedDate?: DateInterface;
|
|
5
|
+
mode?: ModeTypeEnum;
|
|
6
|
+
maxDate?: string;
|
|
7
|
+
minDate?: string;
|
|
8
|
+
language?: LanguageTypeEnum;
|
|
9
|
+
weekends?: number[];
|
|
10
|
+
onClickDate?(value: DateInterface, date_ad: string): any;
|
|
11
|
+
renderDay?(date_ad: string): any;
|
|
12
|
+
};
|
|
13
|
+
declare function DaysComponent({ defaultDate, renderDay, weekends, mode, language, onClickDate, selectedDate, maxDate, minDate, }: propsType): import("react/jsx-runtime").JSX.Element[];
|
|
14
|
+
export default DaysComponent;
|
|
15
|
+
//# sourceMappingURL=DaysComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DaysComponent.d.ts","sourceRoot":"","sources":["../../src/components/DaysComponent.tsx"],"names":[],"mappings":"AAEA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAQ9E,KAAK,SAAS,GAAG;IACf,WAAW,EAAE,aAAa,CAAC;IAC3B,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,CAAC,CAAC,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,OAAE;IACpD,SAAS,CAAC,CAAC,OAAO,EAAE,MAAM,OAAE;CAC7B,CAAC;AACF,iBAAS,aAAa,CAAC,EACrB,WAAW,EACX,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,OAAO,EACP,OAAO,GACR,EAAE,SAAS,6CAmEX;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ChangeDateTypeEnum, DateInterface, LanguageTypeEnum, ModeTypeEnum } from "../interfaces";
|
|
2
|
+
type propsType = {
|
|
3
|
+
selectedDate: DateInterface;
|
|
4
|
+
mode?: ModeTypeEnum;
|
|
5
|
+
language?: LanguageTypeEnum;
|
|
6
|
+
changeDateHandler?(type: ChangeDateTypeEnum, mode: ModeTypeEnum, date?: {
|
|
7
|
+
year?: number;
|
|
8
|
+
month?: number;
|
|
9
|
+
day?: number;
|
|
10
|
+
}): any;
|
|
11
|
+
};
|
|
12
|
+
declare function NavigationComponent({ selectedDate, changeDateHandler, mode, language, }: propsType): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default NavigationComponent;
|
|
14
|
+
//# sourceMappingURL=NavigationComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationComponent.d.ts","sourceRoot":"","sources":["../../src/components/NavigationComponent.tsx"],"names":[],"mappings":"AAUA,OAAO,EACL,kBAAkB,EAClB,aAAa,EAEb,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC;AAGvB,OAAO,cAAc,CAAC;AAEtB,KAAK,SAAS,GAAG;IACf,YAAY,EAAE,aAAa,CAAC;IAC5B,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,iBAAiB,CAAC,CAChB,IAAI,EAAE,kBAAkB,EACxB,IAAI,EAAE,YAAY,EAClB,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,OACD;CACH,CAAC;AACF,iBAAS,mBAAmB,CAAC,EAC3B,YAAY,EACZ,iBAAiB,EACjB,IAAI,EACJ,QAAmC,GACpC,EAAE,SAAS,2CAuGX;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LanguageTypeEnum } from "../interfaces";
|
|
2
|
+
type propsType = {
|
|
3
|
+
language?: LanguageTypeEnum;
|
|
4
|
+
weekends?: number[];
|
|
5
|
+
};
|
|
6
|
+
declare function WeekComponent({ language, weekends }: propsType): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default WeekComponent;
|
|
8
|
+
//# sourceMappingURL=WeekComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WeekComponent.d.ts","sourceRoot":"","sources":["../../src/components/WeekComponent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,cAAc,CAAC;AAEtB,KAAK,SAAS,GAAG;IACf,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AACF,iBAAS,aAAa,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,SAAS,2CAkBvD;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,mBAAmB,EAAE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,aAAa,CAAC;AAErB,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.tsx"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare enum IconTypeEnum {
|
|
2
|
+
LEFT = "LEFT",
|
|
3
|
+
RIGHT = "RIGHT"
|
|
4
|
+
}
|
|
5
|
+
export declare enum ChangeDateTypeEnum {
|
|
6
|
+
"NEXT_MONTH" = "NEXT_MONTH",
|
|
7
|
+
"PRE_MONTH" = "PRE_MONTH",
|
|
8
|
+
"SET_YEAR" = "SET_YEAR",
|
|
9
|
+
"SET_MONTH" = "SET_MONTH",
|
|
10
|
+
"SET_DAY" = "SET_DAY",
|
|
11
|
+
"TODAY" = "TODAY"
|
|
12
|
+
}
|
|
13
|
+
export declare enum ModeTypeEnum {
|
|
14
|
+
"AD" = "AD",
|
|
15
|
+
"BS" = "bs"
|
|
16
|
+
}
|
|
17
|
+
export declare enum LanguageTypeEnum {
|
|
18
|
+
"ENGLISH" = "en",
|
|
19
|
+
"NEPALI" = "np"
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/interfaces/type.tsx"],"names":[],"mappings":"AAAA,oBAAY,YAAY;IACtB,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AACD,oBAAY,kBAAkB;IAC5B,YAAY,eAAe;IAC3B,WAAW,cAAc;IACzB,UAAU,aAAa;IACvB,WAAW,cAAc;IACzB,SAAS,YAAY;IACrB,OAAO,UAAU;CAClB;AACD,oBAAY,YAAY;IACtB,IAAI,OAAO;IACX,IAAI,OAAO;CACZ;AACD,oBAAY,gBAAgB;IAC1B,SAAS,OAAO;IAChB,QAAQ,OAAO;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/utils.interface.tsx"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;CACzB"}
|
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.tsx"],"names":[],"mappings":""}
|