@mui/x-date-pickers 8.10.0 → 8.10.2

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.
@@ -130,6 +130,9 @@ const NUMBER_SYMBOL_MAP = {
130
130
  * SOFTWARE.
131
131
  */
132
132
  export class AdapterMomentHijri extends AdapterMoment {
133
+ lib = 'moment-hijri';
134
+ isTimezoneCompatible = false;
135
+ formatTokenMap = (() => formatTokenMap)();
133
136
  constructor({
134
137
  formats,
135
138
  instance
@@ -138,85 +141,83 @@ export class AdapterMomentHijri extends AdapterMoment {
138
141
  locale: 'ar-SA',
139
142
  instance
140
143
  });
141
- this.lib = 'moment-hijri';
142
- this.moment = void 0;
143
- this.isTimezoneCompatible = false;
144
- this.formatTokenMap = formatTokenMap;
145
- this.date = value => {
146
- if (value === null) {
147
- return null;
148
- }
149
- return this.moment(value).locale('ar-SA');
150
- };
151
- /* v8 ignore next 3 */
152
- this.getTimezone = () => {
153
- return 'default';
154
- };
155
- /* v8 ignore next 3 */
156
- this.setTimezone = value => {
157
- return value;
158
- };
159
- this.parse = (value, format) => {
160
- if (value === '') {
161
- return null;
162
- }
163
- return this.moment(value, format, true).locale('ar-SA');
164
- };
165
- this.formatNumber = numberToFormat => {
166
- return numberToFormat.replace(/\d/g, match => NUMBER_SYMBOL_MAP[match]).replace(/,/g, '،');
167
- };
168
- this.startOfYear = value => {
169
- return value.clone().startOf('iYear');
170
- };
171
- this.startOfMonth = value => {
172
- return value.clone().startOf('iMonth');
173
- };
174
- this.endOfYear = value => {
175
- return value.clone().endOf('iYear');
176
- };
177
- this.endOfMonth = value => {
178
- return value.clone().endOf('iMonth');
179
- };
180
- this.addYears = (value, amount) => {
181
- return amount < 0 ? value.clone().subtract(Math.abs(amount), 'iYear') : value.clone().add(amount, 'iYear');
182
- };
183
- this.addMonths = (value, amount) => {
184
- return amount < 0 ? value.clone().subtract(Math.abs(amount), 'iMonth') : value.clone().add(amount, 'iMonth');
185
- };
186
- this.getYear = value => {
187
- return value.iYear();
188
- };
189
- this.getMonth = value => {
190
- return value.iMonth();
191
- };
192
- this.getDate = value => {
193
- return value.iDate();
194
- };
195
- this.setYear = (value, year) => {
196
- return value.clone().iYear(year);
197
- };
198
- this.setMonth = (value, month) => {
199
- return value.clone().iMonth(month);
200
- };
201
- this.setDate = (value, date) => {
202
- return value.clone().iDate(date);
203
- };
204
- this.getWeekNumber = value => {
205
- return value.iWeek();
206
- };
207
- this.getYearRange = ([start, end]) => {
208
- // moment-hijri only supports dates between 1356-01-01 H and 1499-12-29 H
209
- // We need to throw if outside min/max bounds, otherwise the while loop below will be infinite.
210
- if (start.isBefore('1937-03-14')) {
211
- throw new Error('min date must be on or after 1356-01-01 H (1937-03-14)');
212
- }
213
- if (end.isAfter('2076-11-26')) {
214
- throw new Error('max date must be on or before 1499-12-29 H (2076-11-26)');
215
- }
216
- return super.getYearRange([start, end]);
217
- };
218
144
  this.moment = instance || defaultHMoment;
219
145
  this.locale = 'ar-SA';
220
146
  this.formats = _extends({}, defaultFormats, formats);
221
147
  }
148
+ date = value => {
149
+ if (value === null) {
150
+ return null;
151
+ }
152
+ return this.moment(value).locale('ar-SA');
153
+ };
154
+
155
+ /* v8 ignore next 3 */
156
+ getTimezone = () => {
157
+ return 'default';
158
+ };
159
+
160
+ /* v8 ignore next 3 */
161
+ setTimezone = value => {
162
+ return value;
163
+ };
164
+ parse = (value, format) => {
165
+ if (value === '') {
166
+ return null;
167
+ }
168
+ return this.moment(value, format, true).locale('ar-SA');
169
+ };
170
+ formatNumber = numberToFormat => {
171
+ return numberToFormat.replace(/\d/g, match => NUMBER_SYMBOL_MAP[match]).replace(/,/g, '،');
172
+ };
173
+ startOfYear = value => {
174
+ return value.clone().startOf('iYear');
175
+ };
176
+ startOfMonth = value => {
177
+ return value.clone().startOf('iMonth');
178
+ };
179
+ endOfYear = value => {
180
+ return value.clone().endOf('iYear');
181
+ };
182
+ endOfMonth = value => {
183
+ return value.clone().endOf('iMonth');
184
+ };
185
+ addYears = (value, amount) => {
186
+ return amount < 0 ? value.clone().subtract(Math.abs(amount), 'iYear') : value.clone().add(amount, 'iYear');
187
+ };
188
+ addMonths = (value, amount) => {
189
+ return amount < 0 ? value.clone().subtract(Math.abs(amount), 'iMonth') : value.clone().add(amount, 'iMonth');
190
+ };
191
+ getYear = value => {
192
+ return value.iYear();
193
+ };
194
+ getMonth = value => {
195
+ return value.iMonth();
196
+ };
197
+ getDate = value => {
198
+ return value.iDate();
199
+ };
200
+ setYear = (value, year) => {
201
+ return value.clone().iYear(year);
202
+ };
203
+ setMonth = (value, month) => {
204
+ return value.clone().iMonth(month);
205
+ };
206
+ setDate = (value, date) => {
207
+ return value.clone().iDate(date);
208
+ };
209
+ getWeekNumber = value => {
210
+ return value.iWeek();
211
+ };
212
+ getYearRange = ([start, end]) => {
213
+ // moment-hijri only supports dates between 1356-01-01 H and 1499-12-29 H
214
+ // We need to throw if outside min/max bounds, otherwise the while loop below will be infinite.
215
+ if (start.isBefore('1937-03-14')) {
216
+ throw new Error('min date must be on or after 1356-01-01 H (1937-03-14)');
217
+ }
218
+ if (end.isAfter('2076-11-26')) {
219
+ throw new Error('max date must be on or before 1499-12-29 H (2076-11-26)');
220
+ }
221
+ return super.getYearRange([start, end]);
222
+ };
222
223
  }
@@ -128,6 +128,9 @@ const NUMBER_SYMBOL_MAP = {
128
128
  * SOFTWARE.
129
129
  */
130
130
  export class AdapterMomentJalaali extends AdapterMoment {
131
+ isTimezoneCompatible = false;
132
+ lib = 'moment-jalaali';
133
+ formatTokenMap = (() => formatTokenMap)();
131
134
  constructor({
132
135
  formats,
133
136
  instance
@@ -136,87 +139,83 @@ export class AdapterMomentJalaali extends AdapterMoment {
136
139
  locale: 'fa',
137
140
  instance
138
141
  });
139
- this.isTimezoneCompatible = false;
140
- this.lib = 'moment-jalaali';
141
- this.moment = void 0;
142
- this.formatTokenMap = formatTokenMap;
143
- this.date = value => {
144
- if (value === null) {
145
- return null;
146
- }
147
- return this.moment(value).locale('fa');
148
- };
149
- this.getTimezone = () => {
150
- return 'default';
151
- };
152
- this.setTimezone = value => {
153
- return value;
154
- };
155
- this.parse = (value, format) => {
156
- if (value === '') {
157
- return null;
158
- }
159
- return this.moment(value, format, true).locale('fa');
160
- };
161
- this.formatNumber = numberToFormat => {
162
- return numberToFormat.replace(/\d/g, match => NUMBER_SYMBOL_MAP[match]).replace(/,/g, '،');
163
- };
164
- this.isSameYear = (value, comparing) => {
165
- return value.jYear() === comparing.jYear();
166
- };
167
- this.isSameMonth = (value, comparing) => {
168
- return value.jYear() === comparing.jYear() && value.jMonth() === comparing.jMonth();
169
- };
170
- this.isAfterYear = (value, comparing) => {
171
- return value.jYear() > comparing.jYear();
172
- };
173
- this.isBeforeYear = (value, comparing) => {
174
- return value.jYear() < comparing.jYear();
175
- };
176
- this.startOfYear = value => {
177
- return value.clone().startOf('jYear');
178
- };
179
- this.startOfMonth = value => {
180
- return value.clone().startOf('jMonth');
181
- };
182
- this.endOfYear = value => {
183
- return value.clone().endOf('jYear');
184
- };
185
- this.endOfMonth = value => {
186
- return value.clone().endOf('jMonth');
187
- };
188
- this.addYears = (value, amount) => {
189
- return amount < 0 ? value.clone().subtract(Math.abs(amount), 'jYear') : value.clone().add(amount, 'jYear');
190
- };
191
- this.addMonths = (value, amount) => {
192
- return amount < 0 ? value.clone().subtract(Math.abs(amount), 'jMonth') : value.clone().add(amount, 'jMonth');
193
- };
194
- this.getYear = value => {
195
- return value.jYear();
196
- };
197
- this.getMonth = value => {
198
- return value.jMonth();
199
- };
200
- this.getDate = value => {
201
- return value.jDate();
202
- };
203
- this.getDaysInMonth = value => {
204
- return this.moment.jDaysInMonth(value.jYear(), value.jMonth());
205
- };
206
- this.setYear = (value, year) => {
207
- return value.clone().jYear(year);
208
- };
209
- this.setMonth = (value, month) => {
210
- return value.clone().jMonth(month);
211
- };
212
- this.setDate = (value, date) => {
213
- return value.clone().jDate(date);
214
- };
215
- this.getWeekNumber = value => {
216
- return value.jWeek();
217
- };
218
142
  this.moment = instance || defaultJMoment;
219
143
  this.locale = 'fa';
220
144
  this.formats = _extends({}, defaultFormats, formats);
221
145
  }
146
+ date = value => {
147
+ if (value === null) {
148
+ return null;
149
+ }
150
+ return this.moment(value).locale('fa');
151
+ };
152
+ getTimezone = () => {
153
+ return 'default';
154
+ };
155
+ setTimezone = value => {
156
+ return value;
157
+ };
158
+ parse = (value, format) => {
159
+ if (value === '') {
160
+ return null;
161
+ }
162
+ return this.moment(value, format, true).locale('fa');
163
+ };
164
+ formatNumber = numberToFormat => {
165
+ return numberToFormat.replace(/\d/g, match => NUMBER_SYMBOL_MAP[match]).replace(/,/g, '،');
166
+ };
167
+ isSameYear = (value, comparing) => {
168
+ return value.jYear() === comparing.jYear();
169
+ };
170
+ isSameMonth = (value, comparing) => {
171
+ return value.jYear() === comparing.jYear() && value.jMonth() === comparing.jMonth();
172
+ };
173
+ isAfterYear = (value, comparing) => {
174
+ return value.jYear() > comparing.jYear();
175
+ };
176
+ isBeforeYear = (value, comparing) => {
177
+ return value.jYear() < comparing.jYear();
178
+ };
179
+ startOfYear = value => {
180
+ return value.clone().startOf('jYear');
181
+ };
182
+ startOfMonth = value => {
183
+ return value.clone().startOf('jMonth');
184
+ };
185
+ endOfYear = value => {
186
+ return value.clone().endOf('jYear');
187
+ };
188
+ endOfMonth = value => {
189
+ return value.clone().endOf('jMonth');
190
+ };
191
+ addYears = (value, amount) => {
192
+ return amount < 0 ? value.clone().subtract(Math.abs(amount), 'jYear') : value.clone().add(amount, 'jYear');
193
+ };
194
+ addMonths = (value, amount) => {
195
+ return amount < 0 ? value.clone().subtract(Math.abs(amount), 'jMonth') : value.clone().add(amount, 'jMonth');
196
+ };
197
+ getYear = value => {
198
+ return value.jYear();
199
+ };
200
+ getMonth = value => {
201
+ return value.jMonth();
202
+ };
203
+ getDate = value => {
204
+ return value.jDate();
205
+ };
206
+ getDaysInMonth = value => {
207
+ return this.moment.jDaysInMonth(value.jYear(), value.jMonth());
208
+ };
209
+ setYear = (value, year) => {
210
+ return value.clone().jYear(year);
211
+ };
212
+ setMonth = (value, month) => {
213
+ return value.clone().jMonth(month);
214
+ };
215
+ setDate = (value, date) => {
216
+ return value.clone().jDate(date);
217
+ };
218
+ getWeekNumber = value => {
219
+ return value.jWeek();
220
+ };
222
221
  }
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v8.10.0
2
+ * @mui/x-date-pickers v8.10.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v8.10.0
2
+ * @mui/x-date-pickers v8.10.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-date-pickers",
3
- "version": "8.10.0",
3
+ "version": "8.10.2",
4
4
  "author": "MUI Team",
5
5
  "description": "The community edition of the MUI X Date and Time Picker components.",
6
6
  "main": "./index.js",
@@ -35,12 +35,12 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@babel/runtime": "^7.28.2",
38
- "@mui/utils": "^7.2.0",
38
+ "@mui/utils": "^7.3.1",
39
39
  "@types/react-transition-group": "^4.4.12",
40
40
  "clsx": "^2.1.1",
41
41
  "prop-types": "^15.8.1",
42
42
  "react-transition-group": "^4.4.5",
43
- "@mui/x-internals": "8.10.0"
43
+ "@mui/x-internals": "8.10.2"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@emotion/react": "^11.9.0",
@@ -89,7 +89,8 @@
89
89
  "engines": {
90
90
  "node": ">=14.0.0"
91
91
  },
92
- "private": false,
92
+ "type": "commonjs",
93
+ "types": "./index.d.ts",
93
94
  "exports": {
94
95
  "./package.json": "./package.json",
95
96
  ".": {
@@ -112,8 +113,6 @@
112
113
  "default": "./esm/*/index.js"
113
114
  }
114
115
  },
115
- "./esm": null,
116
- "./modern": null
117
- },
118
- "types": "./index.d.ts"
116
+ "./esm": null
117
+ }
119
118
  }