@itcase/ui 1.0.11 → 1.0.13

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.
Files changed (34) hide show
  1. package/dist/components/Avatar.js +4 -2
  2. package/dist/components/DatePicker.js +1091 -342
  3. package/dist/components/Empty.js +95 -0
  4. package/dist/components/FormField.js +1 -2
  5. package/dist/components/Grid.js +8 -14
  6. package/dist/components/Label.js +0 -5
  7. package/dist/components/Modal.js +228 -10
  8. package/dist/components/Search.js +3 -4
  9. package/dist/components/Segmented.js +5 -1
  10. package/dist/components/Select.js +2 -3
  11. package/dist/components/Swiper.js +4208 -188
  12. package/dist/components/Switch.js +3 -2
  13. package/dist/components/Textarea.js +5 -1
  14. package/dist/components/Tile.js +0 -3
  15. package/dist/css/components/Choice/Choice.css +6 -0
  16. package/dist/css/components/DatePicker/DatePicker.css +30 -4
  17. package/dist/css/components/Empty/Empty.css +13 -0
  18. package/dist/css/components/Input/Input.css +12 -4
  19. package/dist/css/components/Segmented/Segmented.css +16 -0
  20. package/dist/css/components/Swiper/Swiper.css +128 -83
  21. package/dist/{defineProperty-72768a50.js → defineProperty-f9e5e1f3.js} +14 -5
  22. package/dist/hooks/styleAttributes.js +5 -1
  23. package/package.json +27 -27
  24. package/dist/Modal-375ef8c3.js +0 -234
  25. package/dist/components/DateRangePicker.js +0 -218
  26. package/dist/components/Emoji.js +0 -124
  27. package/dist/components/Profile.js +0 -105
  28. package/dist/css/components/DateRangePicker/DateRangePicker.css +0 -1021
  29. package/dist/css/components/Emoji/Emoji.css +0 -104
  30. package/dist/css/components/Emoji/css/__icon/emoji__icon-shape.css +0 -12
  31. package/dist/css/components/Emoji/css/__icon/emoji__icon.css +0 -5
  32. package/dist/css/components/Profile/Profile.css +0 -19
  33. package/dist/index-738f53f6.js +0 -787
  34. package/dist/typeof-6dd323c6.js +0 -13
@@ -1,787 +0,0 @@
1
- 'use strict';
2
-
3
- var _typeof = require('./typeof-6dd323c6.js');
4
-
5
- function requiredArgs(required, args) {
6
- if (args.length < required) {
7
- throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
8
- }
9
- }
10
-
11
- /**
12
- * @name toDate
13
- * @category Common Helpers
14
- * @summary Convert the given argument to an instance of Date.
15
- *
16
- * @description
17
- * Convert the given argument to an instance of Date.
18
- *
19
- * If the argument is an instance of Date, the function returns its clone.
20
- *
21
- * If the argument is a number, it is treated as a timestamp.
22
- *
23
- * If the argument is none of the above, the function returns Invalid Date.
24
- *
25
- * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
26
- *
27
- * @param {Date|Number} argument - the value to convert
28
- * @returns {Date} the parsed date in the local time zone
29
- * @throws {TypeError} 1 argument required
30
- *
31
- * @example
32
- * // Clone the date:
33
- * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
34
- * //=> Tue Feb 11 2014 11:30:30
35
- *
36
- * @example
37
- * // Convert the timestamp to date:
38
- * const result = toDate(1392098430000)
39
- * //=> Tue Feb 11 2014 11:30:30
40
- */
41
- function toDate(argument) {
42
- requiredArgs(1, arguments);
43
- var argStr = Object.prototype.toString.call(argument);
44
-
45
- // Clone the date
46
- if (argument instanceof Date || _typeof._typeof(argument) === 'object' && argStr === '[object Date]') {
47
- // Prevent the date to lose the milliseconds when passed to new Date() in IE10
48
- return new Date(argument.getTime());
49
- } else if (typeof argument === 'number' || argStr === '[object Number]') {
50
- return new Date(argument);
51
- } else {
52
- if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
53
- // eslint-disable-next-line no-console
54
- console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
55
- // eslint-disable-next-line no-console
56
- console.warn(new Error().stack);
57
- }
58
- return new Date(NaN);
59
- }
60
- }
61
-
62
- function toInteger(dirtyNumber) {
63
- if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
64
- return NaN;
65
- }
66
- var number = Number(dirtyNumber);
67
- if (isNaN(number)) {
68
- return number;
69
- }
70
- return number < 0 ? Math.ceil(number) : Math.floor(number);
71
- }
72
-
73
- var defaultOptions = {};
74
- function getDefaultOptions() {
75
- return defaultOptions;
76
- }
77
-
78
- function startOfUTCWeek(dirtyDate, options) {
79
- var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
80
- requiredArgs(1, arguments);
81
- var defaultOptions = getDefaultOptions();
82
- var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
83
-
84
- // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
85
- if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
86
- throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
87
- }
88
- var date = toDate(dirtyDate);
89
- var day = date.getUTCDay();
90
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
91
- date.setUTCDate(date.getUTCDate() - diff);
92
- date.setUTCHours(0, 0, 0, 0);
93
- return date;
94
- }
95
-
96
- function buildFormatLongFn(args) {
97
- return function () {
98
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
99
- // TODO: Remove String()
100
- var width = options.width ? String(options.width) : args.defaultWidth;
101
- var format = args.formats[width] || args.formats[args.defaultWidth];
102
- return format;
103
- };
104
- }
105
-
106
- function buildLocalizeFn(args) {
107
- return function (dirtyIndex, options) {
108
- var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
109
- var valuesArray;
110
- if (context === 'formatting' && args.formattingValues) {
111
- var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
112
- var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
113
- valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
114
- } else {
115
- var _defaultWidth = args.defaultWidth;
116
- var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
117
- valuesArray = args.values[_width] || args.values[_defaultWidth];
118
- }
119
- var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
120
- // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
121
- return valuesArray[index];
122
- };
123
- }
124
-
125
- function buildMatchFn(args) {
126
- return function (string) {
127
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
128
- var width = options.width;
129
- var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
130
- var matchResult = string.match(matchPattern);
131
- if (!matchResult) {
132
- return null;
133
- }
134
- var matchedString = matchResult[0];
135
- var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
136
- var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
137
- return pattern.test(matchedString);
138
- }) : findKey(parsePatterns, function (pattern) {
139
- return pattern.test(matchedString);
140
- });
141
- var value;
142
- value = args.valueCallback ? args.valueCallback(key) : key;
143
- value = options.valueCallback ? options.valueCallback(value) : value;
144
- var rest = string.slice(matchedString.length);
145
- return {
146
- value: value,
147
- rest: rest
148
- };
149
- };
150
- }
151
- function findKey(object, predicate) {
152
- for (var key in object) {
153
- if (object.hasOwnProperty(key) && predicate(object[key])) {
154
- return key;
155
- }
156
- }
157
- return undefined;
158
- }
159
- function findIndex(array, predicate) {
160
- for (var key = 0; key < array.length; key++) {
161
- if (predicate(array[key])) {
162
- return key;
163
- }
164
- }
165
- return undefined;
166
- }
167
-
168
- function buildMatchPatternFn(args) {
169
- return function (string) {
170
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
171
- var matchResult = string.match(args.matchPattern);
172
- if (!matchResult) return null;
173
- var matchedString = matchResult[0];
174
- var parseResult = string.match(args.parsePattern);
175
- if (!parseResult) return null;
176
- var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
177
- value = options.valueCallback ? options.valueCallback(value) : value;
178
- var rest = string.slice(matchedString.length);
179
- return {
180
- value: value,
181
- rest: rest
182
- };
183
- };
184
- }
185
-
186
- function declension(scheme, count) {
187
- // scheme for count=1 exists
188
- if (scheme.one !== undefined && count === 1) {
189
- return scheme.one;
190
- }
191
- var rem10 = count % 10;
192
- var rem100 = count % 100;
193
-
194
- // 1, 21, 31, ...
195
- if (rem10 === 1 && rem100 !== 11) {
196
- return scheme.singularNominative.replace('{{count}}', String(count));
197
-
198
- // 2, 3, 4, 22, 23, 24, 32 ...
199
- } else if (rem10 >= 2 && rem10 <= 4 && (rem100 < 10 || rem100 > 20)) {
200
- return scheme.singularGenitive.replace('{{count}}', String(count));
201
-
202
- // 5, 6, 7, 8, 9, 10, 11, ...
203
- } else {
204
- return scheme.pluralGenitive.replace('{{count}}', String(count));
205
- }
206
- }
207
- function buildLocalizeTokenFn(scheme) {
208
- return function (count, options) {
209
- if (options !== null && options !== void 0 && options.addSuffix) {
210
- if (options.comparison && options.comparison > 0) {
211
- if (scheme.future) {
212
- return declension(scheme.future, count);
213
- } else {
214
- return 'через ' + declension(scheme.regular, count);
215
- }
216
- } else {
217
- if (scheme.past) {
218
- return declension(scheme.past, count);
219
- } else {
220
- return declension(scheme.regular, count) + ' назад';
221
- }
222
- }
223
- } else {
224
- return declension(scheme.regular, count);
225
- }
226
- };
227
- }
228
- var formatDistanceLocale = {
229
- lessThanXSeconds: buildLocalizeTokenFn({
230
- regular: {
231
- one: 'меньше секунды',
232
- singularNominative: 'меньше {{count}} секунды',
233
- singularGenitive: 'меньше {{count}} секунд',
234
- pluralGenitive: 'меньше {{count}} секунд'
235
- },
236
- future: {
237
- one: 'меньше, чем через секунду',
238
- singularNominative: 'меньше, чем через {{count}} секунду',
239
- singularGenitive: 'меньше, чем через {{count}} секунды',
240
- pluralGenitive: 'меньше, чем через {{count}} секунд'
241
- }
242
- }),
243
- xSeconds: buildLocalizeTokenFn({
244
- regular: {
245
- singularNominative: '{{count}} секунда',
246
- singularGenitive: '{{count}} секунды',
247
- pluralGenitive: '{{count}} секунд'
248
- },
249
- past: {
250
- singularNominative: '{{count}} секунду назад',
251
- singularGenitive: '{{count}} секунды назад',
252
- pluralGenitive: '{{count}} секунд назад'
253
- },
254
- future: {
255
- singularNominative: 'через {{count}} секунду',
256
- singularGenitive: 'через {{count}} секунды',
257
- pluralGenitive: 'через {{count}} секунд'
258
- }
259
- }),
260
- halfAMinute: function halfAMinute(_count, options) {
261
- if (options !== null && options !== void 0 && options.addSuffix) {
262
- if (options.comparison && options.comparison > 0) {
263
- return 'через полминуты';
264
- } else {
265
- return 'полминуты назад';
266
- }
267
- }
268
- return 'полминуты';
269
- },
270
- lessThanXMinutes: buildLocalizeTokenFn({
271
- regular: {
272
- one: 'меньше минуты',
273
- singularNominative: 'меньше {{count}} минуты',
274
- singularGenitive: 'меньше {{count}} минут',
275
- pluralGenitive: 'меньше {{count}} минут'
276
- },
277
- future: {
278
- one: 'меньше, чем через минуту',
279
- singularNominative: 'меньше, чем через {{count}} минуту',
280
- singularGenitive: 'меньше, чем через {{count}} минуты',
281
- pluralGenitive: 'меньше, чем через {{count}} минут'
282
- }
283
- }),
284
- xMinutes: buildLocalizeTokenFn({
285
- regular: {
286
- singularNominative: '{{count}} минута',
287
- singularGenitive: '{{count}} минуты',
288
- pluralGenitive: '{{count}} минут'
289
- },
290
- past: {
291
- singularNominative: '{{count}} минуту назад',
292
- singularGenitive: '{{count}} минуты назад',
293
- pluralGenitive: '{{count}} минут назад'
294
- },
295
- future: {
296
- singularNominative: 'через {{count}} минуту',
297
- singularGenitive: 'через {{count}} минуты',
298
- pluralGenitive: 'через {{count}} минут'
299
- }
300
- }),
301
- aboutXHours: buildLocalizeTokenFn({
302
- regular: {
303
- singularNominative: 'около {{count}} часа',
304
- singularGenitive: 'около {{count}} часов',
305
- pluralGenitive: 'около {{count}} часов'
306
- },
307
- future: {
308
- singularNominative: 'приблизительно через {{count}} час',
309
- singularGenitive: 'приблизительно через {{count}} часа',
310
- pluralGenitive: 'приблизительно через {{count}} часов'
311
- }
312
- }),
313
- xHours: buildLocalizeTokenFn({
314
- regular: {
315
- singularNominative: '{{count}} час',
316
- singularGenitive: '{{count}} часа',
317
- pluralGenitive: '{{count}} часов'
318
- }
319
- }),
320
- xDays: buildLocalizeTokenFn({
321
- regular: {
322
- singularNominative: '{{count}} день',
323
- singularGenitive: '{{count}} дня',
324
- pluralGenitive: '{{count}} дней'
325
- }
326
- }),
327
- aboutXWeeks: buildLocalizeTokenFn({
328
- regular: {
329
- singularNominative: 'около {{count}} недели',
330
- singularGenitive: 'около {{count}} недель',
331
- pluralGenitive: 'около {{count}} недель'
332
- },
333
- future: {
334
- singularNominative: 'приблизительно через {{count}} неделю',
335
- singularGenitive: 'приблизительно через {{count}} недели',
336
- pluralGenitive: 'приблизительно через {{count}} недель'
337
- }
338
- }),
339
- xWeeks: buildLocalizeTokenFn({
340
- regular: {
341
- singularNominative: '{{count}} неделя',
342
- singularGenitive: '{{count}} недели',
343
- pluralGenitive: '{{count}} недель'
344
- }
345
- }),
346
- aboutXMonths: buildLocalizeTokenFn({
347
- regular: {
348
- singularNominative: 'около {{count}} месяца',
349
- singularGenitive: 'около {{count}} месяцев',
350
- pluralGenitive: 'около {{count}} месяцев'
351
- },
352
- future: {
353
- singularNominative: 'приблизительно через {{count}} месяц',
354
- singularGenitive: 'приблизительно через {{count}} месяца',
355
- pluralGenitive: 'приблизительно через {{count}} месяцев'
356
- }
357
- }),
358
- xMonths: buildLocalizeTokenFn({
359
- regular: {
360
- singularNominative: '{{count}} месяц',
361
- singularGenitive: '{{count}} месяца',
362
- pluralGenitive: '{{count}} месяцев'
363
- }
364
- }),
365
- aboutXYears: buildLocalizeTokenFn({
366
- regular: {
367
- singularNominative: 'около {{count}} года',
368
- singularGenitive: 'около {{count}} лет',
369
- pluralGenitive: 'около {{count}} лет'
370
- },
371
- future: {
372
- singularNominative: 'приблизительно через {{count}} год',
373
- singularGenitive: 'приблизительно через {{count}} года',
374
- pluralGenitive: 'приблизительно через {{count}} лет'
375
- }
376
- }),
377
- xYears: buildLocalizeTokenFn({
378
- regular: {
379
- singularNominative: '{{count}} год',
380
- singularGenitive: '{{count}} года',
381
- pluralGenitive: '{{count}} лет'
382
- }
383
- }),
384
- overXYears: buildLocalizeTokenFn({
385
- regular: {
386
- singularNominative: 'больше {{count}} года',
387
- singularGenitive: 'больше {{count}} лет',
388
- pluralGenitive: 'больше {{count}} лет'
389
- },
390
- future: {
391
- singularNominative: 'больше, чем через {{count}} год',
392
- singularGenitive: 'больше, чем через {{count}} года',
393
- pluralGenitive: 'больше, чем через {{count}} лет'
394
- }
395
- }),
396
- almostXYears: buildLocalizeTokenFn({
397
- regular: {
398
- singularNominative: 'почти {{count}} год',
399
- singularGenitive: 'почти {{count}} года',
400
- pluralGenitive: 'почти {{count}} лет'
401
- },
402
- future: {
403
- singularNominative: 'почти через {{count}} год',
404
- singularGenitive: 'почти через {{count}} года',
405
- pluralGenitive: 'почти через {{count}} лет'
406
- }
407
- })
408
- };
409
- var formatDistance = function formatDistance(token, count, options) {
410
- return formatDistanceLocale[token](count, options);
411
- };
412
- var formatDistance$1 = formatDistance;
413
-
414
- var dateFormats = {
415
- full: "EEEE, d MMMM y 'г.'",
416
- long: "d MMMM y 'г.'",
417
- medium: "d MMM y 'г.'",
418
- short: 'dd.MM.y'
419
- };
420
- var timeFormats = {
421
- full: 'H:mm:ss zzzz',
422
- long: 'H:mm:ss z',
423
- medium: 'H:mm:ss',
424
- short: 'H:mm'
425
- };
426
- var dateTimeFormats = {
427
- any: '{{date}}, {{time}}'
428
- };
429
- var formatLong = {
430
- date: buildFormatLongFn({
431
- formats: dateFormats,
432
- defaultWidth: 'full'
433
- }),
434
- time: buildFormatLongFn({
435
- formats: timeFormats,
436
- defaultWidth: 'full'
437
- }),
438
- dateTime: buildFormatLongFn({
439
- formats: dateTimeFormats,
440
- defaultWidth: 'any'
441
- })
442
- };
443
- var formatLong$1 = formatLong;
444
-
445
- function isSameUTCWeek(dirtyDateLeft, dirtyDateRight, options) {
446
- requiredArgs(2, arguments);
447
- var dateLeftStartOfWeek = startOfUTCWeek(dirtyDateLeft, options);
448
- var dateRightStartOfWeek = startOfUTCWeek(dirtyDateRight, options);
449
- return dateLeftStartOfWeek.getTime() === dateRightStartOfWeek.getTime();
450
- }
451
-
452
- var accusativeWeekdays = ['воскресенье', 'понедельник', 'вторник', 'среду', 'четверг', 'пятницу', 'субботу'];
453
- function _lastWeek(day) {
454
- var weekday = accusativeWeekdays[day];
455
- switch (day) {
456
- case 0:
457
- return "'в прошлое " + weekday + " в' p";
458
- case 1:
459
- case 2:
460
- case 4:
461
- return "'в прошлый " + weekday + " в' p";
462
- case 3:
463
- case 5:
464
- case 6:
465
- return "'в прошлую " + weekday + " в' p";
466
- }
467
- }
468
- function thisWeek(day) {
469
- var weekday = accusativeWeekdays[day];
470
- if (day === 2 /* Tue */) {
471
- return "'во " + weekday + " в' p";
472
- } else {
473
- return "'в " + weekday + " в' p";
474
- }
475
- }
476
- function _nextWeek(day) {
477
- var weekday = accusativeWeekdays[day];
478
- switch (day) {
479
- case 0:
480
- return "'в следующее " + weekday + " в' p";
481
- case 1:
482
- case 2:
483
- case 4:
484
- return "'в следующий " + weekday + " в' p";
485
- case 3:
486
- case 5:
487
- case 6:
488
- return "'в следующую " + weekday + " в' p";
489
- }
490
- }
491
- var formatRelativeLocale = {
492
- lastWeek: function lastWeek(date, baseDate, options) {
493
- var day = date.getUTCDay();
494
- if (isSameUTCWeek(date, baseDate, options)) {
495
- return thisWeek(day);
496
- } else {
497
- return _lastWeek(day);
498
- }
499
- },
500
- yesterday: "'вчера в' p",
501
- today: "'сегодня в' p",
502
- tomorrow: "'завтра в' p",
503
- nextWeek: function nextWeek(date, baseDate, options) {
504
- var day = date.getUTCDay();
505
- if (isSameUTCWeek(date, baseDate, options)) {
506
- return thisWeek(day);
507
- } else {
508
- return _nextWeek(day);
509
- }
510
- },
511
- other: 'P'
512
- };
513
- var formatRelative = function formatRelative(token, date, baseDate, options) {
514
- var format = formatRelativeLocale[token];
515
- if (typeof format === 'function') {
516
- return format(date, baseDate, options);
517
- }
518
- return format;
519
- };
520
- var formatRelative$1 = formatRelative;
521
-
522
- var eraValues = {
523
- narrow: ['до н.э.', 'н.э.'],
524
- abbreviated: ['до н. э.', 'н. э.'],
525
- wide: ['до нашей эры', 'нашей эры']
526
- };
527
- var quarterValues = {
528
- narrow: ['1', '2', '3', '4'],
529
- abbreviated: ['1-й кв.', '2-й кв.', '3-й кв.', '4-й кв.'],
530
- wide: ['1-й квартал', '2-й квартал', '3-й квартал', '4-й квартал']
531
- };
532
- var monthValues = {
533
- narrow: ['Я', 'Ф', 'М', 'А', 'М', 'И', 'И', 'А', 'С', 'О', 'Н', 'Д'],
534
- abbreviated: ['янв.', 'фев.', 'март', 'апр.', 'май', 'июнь', 'июль', 'авг.', 'сент.', 'окт.', 'нояб.', 'дек.'],
535
- wide: ['январь', 'февраль', 'март', 'апрель', 'май', 'июнь', 'июль', 'август', 'сентябрь', 'октябрь', 'ноябрь', 'декабрь']
536
- };
537
- var formattingMonthValues = {
538
- narrow: ['Я', 'Ф', 'М', 'А', 'М', 'И', 'И', 'А', 'С', 'О', 'Н', 'Д'],
539
- abbreviated: ['янв.', 'фев.', 'мар.', 'апр.', 'мая', 'июн.', 'июл.', 'авг.', 'сент.', 'окт.', 'нояб.', 'дек.'],
540
- wide: ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря']
541
- };
542
- var dayValues = {
543
- narrow: ['В', 'П', 'В', 'С', 'Ч', 'П', 'С'],
544
- short: ['вс', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'],
545
- abbreviated: ['вск', 'пнд', 'втр', 'срд', 'чтв', 'птн', 'суб'],
546
- wide: ['воскресенье', 'понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота']
547
- };
548
- var dayPeriodValues = {
549
- narrow: {
550
- am: 'ДП',
551
- pm: 'ПП',
552
- midnight: 'полн.',
553
- noon: 'полд.',
554
- morning: 'утро',
555
- afternoon: 'день',
556
- evening: 'веч.',
557
- night: 'ночь'
558
- },
559
- abbreviated: {
560
- am: 'ДП',
561
- pm: 'ПП',
562
- midnight: 'полн.',
563
- noon: 'полд.',
564
- morning: 'утро',
565
- afternoon: 'день',
566
- evening: 'веч.',
567
- night: 'ночь'
568
- },
569
- wide: {
570
- am: 'ДП',
571
- pm: 'ПП',
572
- midnight: 'полночь',
573
- noon: 'полдень',
574
- morning: 'утро',
575
- afternoon: 'день',
576
- evening: 'вечер',
577
- night: 'ночь'
578
- }
579
- };
580
- var formattingDayPeriodValues = {
581
- narrow: {
582
- am: 'ДП',
583
- pm: 'ПП',
584
- midnight: 'полн.',
585
- noon: 'полд.',
586
- morning: 'утра',
587
- afternoon: 'дня',
588
- evening: 'веч.',
589
- night: 'ночи'
590
- },
591
- abbreviated: {
592
- am: 'ДП',
593
- pm: 'ПП',
594
- midnight: 'полн.',
595
- noon: 'полд.',
596
- morning: 'утра',
597
- afternoon: 'дня',
598
- evening: 'веч.',
599
- night: 'ночи'
600
- },
601
- wide: {
602
- am: 'ДП',
603
- pm: 'ПП',
604
- midnight: 'полночь',
605
- noon: 'полдень',
606
- morning: 'утра',
607
- afternoon: 'дня',
608
- evening: 'вечера',
609
- night: 'ночи'
610
- }
611
- };
612
- var ordinalNumber = function ordinalNumber(dirtyNumber, options) {
613
- var number = Number(dirtyNumber);
614
- var unit = options === null || options === void 0 ? void 0 : options.unit;
615
- var suffix;
616
- if (unit === 'date') {
617
- suffix = '-е';
618
- } else if (unit === 'week' || unit === 'minute' || unit === 'second') {
619
- suffix = '-я';
620
- } else {
621
- suffix = '-й';
622
- }
623
- return number + suffix;
624
- };
625
- var localize = {
626
- ordinalNumber: ordinalNumber,
627
- era: buildLocalizeFn({
628
- values: eraValues,
629
- defaultWidth: 'wide'
630
- }),
631
- quarter: buildLocalizeFn({
632
- values: quarterValues,
633
- defaultWidth: 'wide',
634
- argumentCallback: function argumentCallback(quarter) {
635
- return quarter - 1;
636
- }
637
- }),
638
- month: buildLocalizeFn({
639
- values: monthValues,
640
- defaultWidth: 'wide',
641
- formattingValues: formattingMonthValues,
642
- defaultFormattingWidth: 'wide'
643
- }),
644
- day: buildLocalizeFn({
645
- values: dayValues,
646
- defaultWidth: 'wide'
647
- }),
648
- dayPeriod: buildLocalizeFn({
649
- values: dayPeriodValues,
650
- defaultWidth: 'any',
651
- formattingValues: formattingDayPeriodValues,
652
- defaultFormattingWidth: 'wide'
653
- })
654
- };
655
- var localize$1 = localize;
656
-
657
- var matchOrdinalNumberPattern = /^(\d+)(-?(е|я|й|ое|ье|ая|ья|ый|ой|ий|ый))?/i;
658
- var parseOrdinalNumberPattern = /\d+/i;
659
- var matchEraPatterns = {
660
- narrow: /^((до )?н\.?\s?э\.?)/i,
661
- abbreviated: /^((до )?н\.?\s?э\.?)/i,
662
- wide: /^(до нашей эры|нашей эры|наша эра)/i
663
- };
664
- var parseEraPatterns = {
665
- any: [/^д/i, /^н/i]
666
- };
667
- var matchQuarterPatterns = {
668
- narrow: /^[1234]/i,
669
- abbreviated: /^[1234](-?[ыои]?й?)? кв.?/i,
670
- wide: /^[1234](-?[ыои]?й?)? квартал/i
671
- };
672
- var parseQuarterPatterns = {
673
- any: [/1/i, /2/i, /3/i, /4/i]
674
- };
675
- var matchMonthPatterns = {
676
- narrow: /^[яфмаисонд]/i,
677
- abbreviated: /^(янв|фев|март?|апр|ма[йя]|июн[ья]?|июл[ья]?|авг|сент?|окт|нояб?|дек)\.?/i,
678
- wide: /^(январ[ья]|феврал[ья]|марта?|апрел[ья]|ма[йя]|июн[ья]|июл[ья]|августа?|сентябр[ья]|октябр[ья]|октябр[ья]|ноябр[ья]|декабр[ья])/i
679
- };
680
- var parseMonthPatterns = {
681
- narrow: [/^я/i, /^ф/i, /^м/i, /^а/i, /^м/i, /^и/i, /^и/i, /^а/i, /^с/i, /^о/i, /^н/i, /^я/i],
682
- any: [/^я/i, /^ф/i, /^мар/i, /^ап/i, /^ма[йя]/i, /^июн/i, /^июл/i, /^ав/i, /^с/i, /^о/i, /^н/i, /^д/i]
683
- };
684
- var matchDayPatterns = {
685
- narrow: /^[впсч]/i,
686
- short: /^(вс|во|пн|по|вт|ср|чт|че|пт|пя|сб|су)\.?/i,
687
- abbreviated: /^(вск|вос|пнд|пон|втр|вто|срд|сре|чтв|чет|птн|пят|суб).?/i,
688
- wide: /^(воскресень[ея]|понедельника?|вторника?|сред[аы]|четверга?|пятниц[аы]|суббот[аы])/i
689
- };
690
- var parseDayPatterns = {
691
- narrow: [/^в/i, /^п/i, /^в/i, /^с/i, /^ч/i, /^п/i, /^с/i],
692
- any: [/^в[ос]/i, /^п[он]/i, /^в/i, /^ср/i, /^ч/i, /^п[ят]/i, /^с[уб]/i]
693
- };
694
- var matchDayPeriodPatterns = {
695
- narrow: /^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,
696
- abbreviated: /^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,
697
- wide: /^([дп]п|полночь|полдень|утр[оа]|день|дня|вечера?|ноч[ьи])/i
698
- };
699
- var parseDayPeriodPatterns = {
700
- any: {
701
- am: /^дп/i,
702
- pm: /^пп/i,
703
- midnight: /^полн/i,
704
- noon: /^полд/i,
705
- morning: /^у/i,
706
- afternoon: /^д[ен]/i,
707
- evening: /^в/i,
708
- night: /^н/i
709
- }
710
- };
711
- var match = {
712
- ordinalNumber: buildMatchPatternFn({
713
- matchPattern: matchOrdinalNumberPattern,
714
- parsePattern: parseOrdinalNumberPattern,
715
- valueCallback: function valueCallback(value) {
716
- return parseInt(value, 10);
717
- }
718
- }),
719
- era: buildMatchFn({
720
- matchPatterns: matchEraPatterns,
721
- defaultMatchWidth: 'wide',
722
- parsePatterns: parseEraPatterns,
723
- defaultParseWidth: 'any'
724
- }),
725
- quarter: buildMatchFn({
726
- matchPatterns: matchQuarterPatterns,
727
- defaultMatchWidth: 'wide',
728
- parsePatterns: parseQuarterPatterns,
729
- defaultParseWidth: 'any',
730
- valueCallback: function valueCallback(index) {
731
- return index + 1;
732
- }
733
- }),
734
- month: buildMatchFn({
735
- matchPatterns: matchMonthPatterns,
736
- defaultMatchWidth: 'wide',
737
- parsePatterns: parseMonthPatterns,
738
- defaultParseWidth: 'any'
739
- }),
740
- day: buildMatchFn({
741
- matchPatterns: matchDayPatterns,
742
- defaultMatchWidth: 'wide',
743
- parsePatterns: parseDayPatterns,
744
- defaultParseWidth: 'any'
745
- }),
746
- dayPeriod: buildMatchFn({
747
- matchPatterns: matchDayPeriodPatterns,
748
- defaultMatchWidth: 'wide',
749
- parsePatterns: parseDayPeriodPatterns,
750
- defaultParseWidth: 'any'
751
- })
752
- };
753
- var match$1 = match;
754
-
755
- /**
756
- * @type {Locale}
757
- * @category Locales
758
- * @summary Russian locale.
759
- * @language Russian
760
- * @iso-639-2 rus
761
- * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
762
- * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
763
- */
764
- var locale = {
765
- code: 'ru',
766
- formatDistance: formatDistance$1,
767
- formatLong: formatLong$1,
768
- formatRelative: formatRelative$1,
769
- localize: localize$1,
770
- match: match$1,
771
- options: {
772
- weekStartsOn: 1 /* Monday */,
773
- firstWeekContainsDate: 1
774
- }
775
- };
776
- var ru = locale;
777
-
778
- exports.buildFormatLongFn = buildFormatLongFn;
779
- exports.buildLocalizeFn = buildLocalizeFn;
780
- exports.buildMatchFn = buildMatchFn;
781
- exports.buildMatchPatternFn = buildMatchPatternFn;
782
- exports.getDefaultOptions = getDefaultOptions;
783
- exports.requiredArgs = requiredArgs;
784
- exports.ru = ru;
785
- exports.startOfUTCWeek = startOfUTCWeek;
786
- exports.toDate = toDate;
787
- exports.toInteger = toInteger;