hijri-date-time-picker 1.0.3 → 1.0.32

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/package.json CHANGED
@@ -1,19 +1,8 @@
1
1
  {
2
2
  "name": "hijri-date-time-picker",
3
- "version": "1.0.3",
3
+ "version": "1.0.32",
4
4
  "description": "Angular standalone component for dual-mode Gregorian and Hijri date selection",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "files": [
8
- "dist",
9
- "README.md",
10
- "LICENSE"
11
- ],
12
- "scripts": {
13
- "build": "ng-packagr -p ng-package.json",
14
- "build:watch": "ng-packagr -p ng-package.json --watch",
15
- "test": "echo \"Error: no test specified\" && exit 1"
16
- },
5
+ "sideEffects": false,
17
6
  "keywords": [
18
7
  "angular",
19
8
  "hijri",
@@ -38,15 +27,18 @@
38
27
  },
39
28
  "dependencies": {
40
29
  "hijri-date": "^0.2.2",
41
- "remixicon": "^4.7.0"
30
+ "remixicon": "^4.7.0",
31
+ "tslib": "^2.3.0"
42
32
  },
43
- "devDependencies": {
44
- "@angular/common": "^17.0.0",
45
- "@angular/compiler": "^21.0.6",
46
- "@angular/compiler-cli": "^21.0.6",
47
- "@angular/core": "^17.0.0",
48
- "@angular/platform-browser": "^17.0.0",
49
- "ng-packagr": "^21.0.1",
50
- "typescript": "^5.0.0"
33
+ "module": "fesm2022/hijri-date-time-picker.mjs",
34
+ "typings": "types/hijri-date-time-picker.d.ts",
35
+ "exports": {
36
+ "./package.json": {
37
+ "default": "./package.json"
38
+ },
39
+ ".": {
40
+ "types": "./types/hijri-date-time-picker.d.ts",
41
+ "default": "./fesm2022/hijri-date-time-picker.mjs"
42
+ }
51
43
  }
52
- }
44
+ }
package/dist/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Hany
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/dist/README.md DELETED
@@ -1,188 +0,0 @@
1
- # Hijri Date Time Picker Component
2
-
3
- An Angular standalone component for dual-mode Gregorian and Hijri date selection with time support using the Umm Al-Qura calendar system.
4
-
5
- ## Features
6
-
7
- ✨ **Dual Calendar Support**: Switch between Gregorian and Hijri (Umm Al-Qura) calendars
8
- 🌍 **Localization**: Full support for English and Arabic languages
9
- ↔️ **RTL/LTR**: Automatic layout direction based on locale
10
- 📅 **Multiple Selection**: Single or multiple date selection modes
11
- 🕒 **DateTime Support**: Integrated time selection with modern styling
12
- 🎨 **Customizable Styling**: Comprehensive theming via CSS variables
13
- ✅ **Validation**: Future date validation with configurable limits
14
- 📱 **Responsive**: Mobile-friendly design
15
- ♿ **Accessible**: ARIA labels and keyboard navigation support
16
-
17
- ## Installation
18
-
19
- ```bash
20
- npm install hijri-date-time-picker hijri-date
21
- ```
22
- ```bash
23
- npm install remixicon --save
24
- ```
25
-
26
- ## Dependencies
27
-
28
- - `@angular/core` >= 15.0.0
29
- - `@angular/common` >= 15.0.0
30
- - `hijri-date` ^0.2.2
31
-
32
- ## Usage
33
-
34
- ### Basic Example
35
-
36
- ```typescript
37
- import { Component } from '@angular/core';
38
- import { HijriDatePickerComponent, SelectedDate } from 'hijri-date-time-picker';
39
-
40
- @Component({
41
- selector: 'app-root',
42
- standalone: true,
43
- imports: [HijriDatePickerComponent],
44
- template: `
45
- <hijri-date-picker
46
- [mode]="'greg'"
47
- [locale]="'en'"
48
- (dateSelected)="onDateSelected($event)">
49
- </hijri-date-picker>
50
- `
51
- })
52
- export class AppComponent {
53
- onDateSelected(date: SelectedDate) {
54
- console.log('Selected date:', date);
55
- }
56
- }
57
- ```
58
-
59
- ### DateTime Picker Example
60
-
61
- ```html
62
- <hijri-date-picker
63
- [enableTime]="true"
64
- [timeFormat]="'12'"
65
- [minuteStep]="15"
66
- [enableSeconds]="false"
67
- (dateSelected)="onDateTimeSelected($event)">
68
- </hijri-date-picker>
69
- ```
70
-
71
- ### Initial Date Binding
72
-
73
- ```html
74
- <!-- Single Date Selection -->
75
- <hijri-date-picker
76
- [initialSelectedDate]="myDate">
77
- </hijri-date-picker>
78
-
79
- <!-- Multiple Dates Selection -->
80
- <hijri-date-picker
81
- [multiple]="true"
82
- [initialSelectedDates]="myDates">
83
- </hijri-date-picker>
84
- ```
85
-
86
- ## API Reference
87
-
88
- ### Inputs
89
-
90
- #### Mode & Configuration
91
-
92
- | Input | Type | Default | Description |
93
- |-------|------|---------|-------------|
94
- | `canChangeMode` | `boolean` | `true` | Enable/disable mode toggle button |
95
- | `mode` | `'greg' \| 'hijri'` | `'greg'` | Initial calendar mode |
96
- | `dir` | `'ltr' \| 'rtl'` | `'ltr'` | Text direction |
97
- | `locale` | `'en' \| 'ar'` | `'en'` | Language locale |
98
-
99
- #### DateTime Configuration (NEW)
100
-
101
- | Input | Type | Default | Description |
102
- |-------|------|---------|-------------|
103
- | `enableTime` | `boolean` | `false` | Enable time selection UI |
104
- | `timeFormat` | `'12' \| '24'` | `'24'` | Time display format |
105
- | `minuteStep` | `number` | `1` | Increment step for minutes |
106
- | `enableSeconds` | `boolean` | `false` | Show seconds selection |
107
- | `defaultTime` | `{ hours, minutes, seconds? }` | `undefined` | Default time to show |
108
-
109
- #### Validation
110
-
111
- | Input | Type | Default | Description |
112
- |-------|------|---------|-------------|
113
- | `futureValidation` | `boolean` | `true` | Prevent selecting dates beyond limit |
114
- | `futureYearsLimit` | `number` | `10` | Maximum years in the future |
115
- | `isRequired` | `boolean` | `false` | Require date selection before submit |
116
- | `minDate` | `Date` | `undefined` | Minimum selectable date |
117
- | `maxDate` | `Date` | `undefined` | Maximum selectable date |
118
-
119
- #### Selection & Binding
120
-
121
- | Input | Type | Default | Description |
122
- |-------|------|---------|-------------|
123
- | `multiple` | `boolean` | `false` | Enable multiple date selection |
124
- | `showConfirmButton` | `boolean` | `false` | Show submit button |
125
- | `initialSelectedDate` | `Date` | `undefined` | Pre-select a single date |
126
- | `initialSelectedDates` | `Date[]` | `[]` | Pre-select multiple dates |
127
-
128
- #### Labels
129
-
130
- | Input | Type | Default | Description |
131
- |-------|------|---------|-------------|
132
- | `submitTextButton` | `string` | `'Submit'` | Submit button text |
133
- | `todaysDateText` | `string` | `'Today'` | Today button text |
134
- | `ummAlQuraDateText` | `string` | `'Umm Al-Qura Calendar'` | Calendar type label |
135
- | `yearSelectLabel` | `string` | `'Year'` | Year dropdown label |
136
- | `monthSelectLabel` | `string` | `'Month'` | Month dropdown label |
137
-
138
- ### Outputs
139
-
140
- | Output | Type | Description |
141
- |--------|------|-------------|
142
- | `dateSelected` | `EventEmitter<SelectedDate \| SelectedDate[]>` | Emits when date(s) selected |
143
- | `modeChanged` | `EventEmitter<'greg' \| 'hijri'>` | Emits when calendar mode changes |
144
-
145
- ### Types
146
-
147
- #### SelectedDate
148
-
149
- ```typescript
150
- interface SelectedDate {
151
- gregorian: Date;
152
- hijri: {
153
- year: number;
154
- month: number;
155
- day: number;
156
- };
157
- time?: {
158
- hours: number;
159
- minutes: number;
160
- seconds: number;
161
- };
162
- formatted: {
163
- gregorian: string;
164
- hijri: string;
165
- time?: string;
166
- };
167
- }
168
- ```
169
-
170
- ## Styling
171
-
172
- The component can be customized using the `styles` input or by overriding CSS variables:
173
-
174
- ```typescript
175
- const customStyles: DatePickerStyles = {
176
- primaryColor: '#4f46e5',
177
- secondaryColor: '#818cf8',
178
- borderRadius: '8px'
179
- };
180
- ```
181
-
182
- ## License
183
-
184
- MIT
185
-
186
- ## Credits
187
-
188
- Built with [Angular](https://angular.io/) and [hijri-date](https://www.npmjs.com/package/hijri-date).