cnhis-design-vue 3.1.11 → 3.1.12-beta.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.
Files changed (190) hide show
  1. package/es/node_modules/date-fns/esm/_lib/defaultOptions/index.js +6 -0
  2. package/es/node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js +17 -0
  3. package/es/node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js +27 -0
  4. package/es/node_modules/date-fns/esm/_lib/getUTCWeek/index.js +17 -0
  5. package/es/node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js +38 -0
  6. package/es/node_modules/date-fns/esm/_lib/setUTCDay/index.js +27 -0
  7. package/es/node_modules/date-fns/esm/_lib/setUTCISODay/index.js +23 -0
  8. package/es/node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js +15 -0
  9. package/es/node_modules/date-fns/esm/_lib/setUTCWeek/index.js +15 -0
  10. package/es/node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js +15 -0
  11. package/es/node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js +15 -0
  12. package/es/node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js +25 -0
  13. package/es/node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js +21 -0
  14. package/es/node_modules/date-fns/esm/_lib/toInteger/index.js +15 -0
  15. package/es/node_modules/date-fns/esm/compareAsc/index.js +0 -4
  16. package/es/node_modules/date-fns/esm/constants/index.js +40 -0
  17. package/es/node_modules/date-fns/esm/differenceInCalendarDays/index.js +0 -4
  18. package/es/node_modules/date-fns/esm/differenceInCalendarMonths/index.js +1 -5
  19. package/es/node_modules/date-fns/esm/differenceInDays/index.js +0 -4
  20. package/es/node_modules/date-fns/esm/differenceInMonths/index.js +0 -4
  21. package/es/node_modules/date-fns/esm/endOfDay/index.js +0 -4
  22. package/es/node_modules/date-fns/esm/endOfMonth/index.js +0 -4
  23. package/es/node_modules/date-fns/esm/isLastDayOfMonth/index.js +1 -5
  24. package/es/node_modules/date-fns/esm/parse/_lib/Parser.js +32 -0
  25. package/es/node_modules/date-fns/esm/parse/_lib/Setter.js +37 -0
  26. package/es/node_modules/date-fns/esm/parse/_lib/constants.js +48 -0
  27. package/es/node_modules/date-fns/esm/parse/_lib/parsers/AMPMMidnightParser.js +55 -0
  28. package/es/node_modules/date-fns/esm/parse/_lib/parsers/AMPMParser.js +55 -0
  29. package/es/node_modules/date-fns/esm/parse/_lib/parsers/DateParser.js +55 -0
  30. package/es/node_modules/date-fns/esm/parse/_lib/parsers/DayOfYearParser.js +52 -0
  31. package/es/node_modules/date-fns/esm/parse/_lib/parsers/DayParser.js +80 -0
  32. package/es/node_modules/date-fns/esm/parse/_lib/parsers/DayPeriodParser.js +56 -0
  33. package/es/node_modules/date-fns/esm/parse/_lib/parsers/EraParser.js +53 -0
  34. package/es/node_modules/date-fns/esm/parse/_lib/parsers/ExtendedYearParser.js +30 -0
  35. package/es/node_modules/date-fns/esm/parse/_lib/parsers/FractionOfSecondParser.js +29 -0
  36. package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour0To11Parser.js +48 -0
  37. package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour0to23Parser.js +41 -0
  38. package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour1To24Parser.js +42 -0
  39. package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour1to12Parser.js +50 -0
  40. package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISODayParser.js +99 -0
  41. package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneParser.js +46 -0
  42. package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneWithZParser.js +46 -0
  43. package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekParser.js +43 -0
  44. package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekYearParser.js +33 -0
  45. package/es/node_modules/date-fns/esm/parse/_lib/parsers/LocalDayParser.js +96 -0
  46. package/es/node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekParser.js +43 -0
  47. package/es/node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekYearParser.js +61 -0
  48. package/es/node_modules/date-fns/esm/parse/_lib/parsers/MinuteParser.js +41 -0
  49. package/es/node_modules/date-fns/esm/parse/_lib/parsers/MonthParser.js +80 -0
  50. package/es/node_modules/date-fns/esm/parse/_lib/parsers/QuarterParser.js +73 -0
  51. package/es/node_modules/date-fns/esm/parse/_lib/parsers/SecondParser.js +41 -0
  52. package/es/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneLocalDayParser.js +96 -0
  53. package/es/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneMonthParser.js +80 -0
  54. package/es/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneQuarterParser.js +73 -0
  55. package/es/node_modules/date-fns/esm/parse/_lib/parsers/TimestampMillisecondsParser.js +26 -0
  56. package/es/node_modules/date-fns/esm/parse/_lib/parsers/TimestampSecondsParser.js +26 -0
  57. package/es/node_modules/date-fns/esm/parse/_lib/parsers/YearParser.js +66 -0
  58. package/es/node_modules/date-fns/esm/parse/_lib/parsers/index.js +109 -0
  59. package/es/node_modules/date-fns/esm/parse/_lib/utils.js +133 -0
  60. package/es/node_modules/date-fns/esm/startOfDay/index.js +0 -4
  61. package/es/node_modules/date-fns/esm/toDate/index.js +1 -1
  62. package/es/packages/big-table/index.d.ts +32 -10
  63. package/es/packages/big-table/src/BigTable.vue.d.ts +35 -31
  64. package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +35 -11
  65. package/es/packages/big-table/src/bigTableEmits.js +2 -1
  66. package/es/packages/big-table/src/bigTableState.d.ts +2 -6
  67. package/es/packages/big-table/src/bigTableState.js +9 -1
  68. package/es/packages/big-table/src/components/edit-form/edit-separate.js +4 -0
  69. package/es/packages/big-table/src/components/edit-form/edit-separate.vue.d.ts +1247 -0
  70. package/es/packages/big-table/src/components/edit-form/edit-separate.vue_vue_type_script_setup_true_lang.js +69 -0
  71. package/es/packages/big-table/src/components/separate.js +4 -0
  72. package/es/packages/big-table/src/components/separate.vue.d.ts +43 -0
  73. package/es/packages/big-table/src/components/separate.vue_vue_type_script_setup_true_lang.js +24 -0
  74. package/es/packages/big-table/src/constants/index.d.ts +3 -0
  75. package/es/packages/big-table/src/constants/index.js +3 -0
  76. package/es/packages/big-table/src/hooks/useEdit.d.ts +1243 -0
  77. package/es/packages/big-table/src/hooks/useEdit.js +25 -7
  78. package/es/packages/big-table/src/hooks/useSeparateRow.d.ts +30 -0
  79. package/es/packages/big-table/src/hooks/useSeparateRow.js +157 -0
  80. package/es/packages/big-table/src/utils.d.ts +1 -0
  81. package/es/packages/big-table/src/utils.js +5 -7
  82. package/es/packages/big-table/style/index.css +1 -1
  83. package/es/packages/bpmn-workflow/index.d.ts +1 -1
  84. package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/BpmnRenderer.d.ts +52 -52
  85. package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/BpmnRenderer.js +1 -8
  86. package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomPalette.js +1 -11
  87. package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomRenderer.js +1 -9
  88. package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/index.js +1 -8
  89. package/es/packages/bpmn-workflow/src/custom/customTranslate/zh.d.ts +176 -176
  90. package/es/packages/bpmn-workflow/style/index.css +1 -1
  91. package/es/packages/button-print/src/utils/print.es.min.js +1467 -1015
  92. package/es/packages/chunk-upload/src/chunk-upload-new.vue.d.ts +2 -9
  93. package/es/packages/chunk-upload/src/chunk-upload-new.vue_vue_type_script_setup_true_lang.js +1 -1
  94. package/es/packages/chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.d.ts +2 -9
  95. package/es/packages/chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue_vue_type_script_setup_true_lang.js +1 -10
  96. package/es/packages/drag-layout/src/DragFormRightItem.vue_vue_type_script_setup_true_lang.js +6 -6
  97. package/es/packages/drag-layout/src/DragLayout.vue.d.ts +2 -2
  98. package/es/packages/drag-layout/src/DragLayout.vue_vue_type_script_setup_true_lang.js +1 -1
  99. package/es/packages/drag-layout/style/index.css +4 -4
  100. package/es/packages/editor/src/Editor.js +1 -1
  101. package/es/packages/field-set/index.d.ts +2 -2
  102. package/es/packages/field-set/src/FieldSet.vue.d.ts +2 -2
  103. package/es/packages/field-set/src/NewFieldSet.vue.d.ts +1 -1
  104. package/es/packages/field-set/src/OldFieldSet.vue.d.ts +1 -1
  105. package/es/packages/form-render/index.d.ts +64 -56
  106. package/es/packages/form-render/index.js +1 -1
  107. package/es/packages/form-render/src/FormRender.vue.d.ts +64 -56
  108. package/es/packages/form-render/src/FormRender.vue_vue_type_script_setup_true_lang.js +18 -29
  109. package/es/packages/form-render/src/components/renderer/cascader.js +2 -0
  110. package/es/packages/form-render/src/components/renderer/checkbox.d.ts +1 -1
  111. package/es/packages/form-render/src/components/renderer/combination.d.ts +8 -118
  112. package/es/packages/form-render/src/components/renderer/combination.js +6 -12
  113. package/es/packages/form-render/src/components/renderer/linebar.js +2 -2
  114. package/es/packages/form-render/src/components/renderer/radio.d.ts +3 -1
  115. package/es/packages/form-render/src/components/renderer/radio.js +5 -4
  116. package/es/packages/form-render/src/components/renderer/select.js +3 -3
  117. package/es/packages/form-render/src/constants/index.d.ts +1 -0
  118. package/es/packages/form-render/src/constants/index.js +3 -2
  119. package/es/packages/form-render/src/hooks/index.d.ts +1 -1
  120. package/es/packages/form-render/src/hooks/index.js +1 -1
  121. package/es/packages/form-render/src/hooks/useAnchor.d.ts +1 -2
  122. package/es/packages/form-render/src/hooks/useAnchor.js +14 -10
  123. package/es/packages/form-render/src/hooks/useAsyncQueue.js +2 -2
  124. package/es/packages/form-render/src/hooks/useBusinessBinding.js +3 -1
  125. package/es/packages/form-render/src/hooks/useChangeContext.js +3 -1
  126. package/es/packages/form-render/src/hooks/useCommonLog.js +1 -1
  127. package/es/packages/form-render/src/hooks/{useFieldList2Schema.d.ts → useFieldListAdaptor.d.ts} +2 -2
  128. package/es/packages/form-render/src/hooks/{useFieldList2Schema.js → useFieldListAdaptor.js} +12 -8
  129. package/es/packages/form-render/src/hooks/useFieldVisitor.d.ts +1 -1
  130. package/es/packages/form-render/src/hooks/useFormContext.d.ts +1 -0
  131. package/es/packages/form-render/src/hooks/useFormContext.js +12 -3
  132. package/es/packages/form-render/src/hooks/useFormItemDeps.d.ts +2 -1
  133. package/es/packages/form-render/src/hooks/useFormRequest.d.ts +2 -1
  134. package/es/packages/form-render/src/hooks/useFormValidator.js +1 -7
  135. package/es/packages/form-render/src/hooks/useInitialData.js +1 -1
  136. package/es/packages/form-render/src/types/fieldItem.d.ts +2 -2
  137. package/es/packages/form-render/src/types/index.d.ts +1 -1
  138. package/es/packages/form-render/src/utils/index.d.ts +1 -0
  139. package/es/packages/form-render/src/utils/index.js +8 -1
  140. package/es/packages/form-table/index.d.ts +27 -27
  141. package/es/packages/form-table/src/FormTable.vue.d.ts +27 -27
  142. package/es/packages/form-table/src/components/index.d.ts +26 -26
  143. package/es/packages/form-table/src/components/table-age.vue.d.ts +2 -2
  144. package/es/packages/form-table/src/components/table-date-picker.vue.d.ts +2 -2
  145. package/es/packages/form-table/src/components/table-digital.vue.d.ts +2 -2
  146. package/es/packages/form-table/src/components/table-input-password.vue.d.ts +2 -2
  147. package/es/packages/form-table/src/components/table-input.vue.d.ts +2 -2
  148. package/es/packages/form-table/src/components/table-month-picker.vue.d.ts +2 -2
  149. package/es/packages/form-table/src/components/table-search-more.vue.d.ts +2 -2
  150. package/es/packages/form-table/src/components/table-search.vue.d.ts +2 -2
  151. package/es/packages/form-table/src/components/table-search.vue_vue_type_script_setup_true_lang.js +1 -1
  152. package/es/packages/form-table/src/components/table-select-multiple.vue.d.ts +2 -2
  153. package/es/packages/form-table/src/components/table-select.vue.d.ts +2 -2
  154. package/es/packages/form-table/src/components/table-textarea.vue.d.ts +2 -2
  155. package/es/packages/form-table/src/components/table-time-picker.vue.d.ts +2 -2
  156. package/es/packages/form-table/src/components/table-tree-select.vue.d.ts +2 -2
  157. package/es/packages/form-table/src/components/table-tree-select.vue_vue_type_script_setup_true_lang.js +9 -7
  158. package/es/packages/form-table/src/configs/index.js +1 -8
  159. package/es/packages/form-table/src/hooks/useBoundDate.js +4 -1
  160. package/es/packages/form-table/src/hooks/useFormCommon.js +6 -1
  161. package/es/packages/form-table/src/hooks/useFormEvent.d.ts +1 -1
  162. package/es/packages/form-table/src/hooks/useFormEvent.js +1 -5
  163. package/es/packages/form-table/src/hooks/useSearch.js +29 -92
  164. package/es/packages/index.css +16 -16
  165. package/es/packages/index.js +1 -1
  166. package/es/packages/info-header/src/InfoHeader.vue_vue_type_script_setup_true_lang.js +4 -1
  167. package/es/packages/info-header/style/index.css +8 -8
  168. package/es/packages/scale-view/index.d.ts +1 -1
  169. package/es/packages/scale-view/src/ScaleView.vue.d.ts +1 -1
  170. package/es/packages/scale-view/src/ScaleView.vue_vue_type_script_setup_true_lang.js +11 -9
  171. package/es/packages/scale-view/src/components/EvaluateCountdown.vue_vue_type_script_setup_true_lang.js +1 -8
  172. package/es/packages/scale-view/src/components/EvaluatePage.vue_vue_type_script_setup_true_lang.js +1 -1
  173. package/es/packages/scale-view/src/components/formitem/address.d.ts +3988 -3988
  174. package/es/packages/scale-view/src/components/formitem/r-upload.js +1 -1
  175. package/es/packages/scale-view/src/components/formitem/text-over-tooltip/TextOverTooltip.vue.d.ts +1 -1
  176. package/es/packages/scale-view/src/hooks/scaleview-computed.js +7 -12
  177. package/es/packages/scale-view/src/hooks/scaleview-init.js +1 -6
  178. package/es/packages/scale-view/src/hooks/scaleview-state.js +1 -8
  179. package/es/packages/scale-view/src/hooks/scaleview-submit.js +2 -5
  180. package/es/packages/scale-view/src/hooks/scaleview-validate.js +6 -1
  181. package/es/packages/scale-view/src/hooks/use-component.js +50 -50
  182. package/es/packages/scale-view/src/utils/judge-types.js +1 -6
  183. package/es/packages/select-label/src/LabelFormContent.vue.d.ts +3 -0
  184. package/es/packages/select-label/src/SelectLabel.vue_vue_type_script_setup_true_lang.js +1 -1
  185. package/es/packages/time-line/style/index.css +2 -2
  186. package/es/src/components/player-vod/video-modal.js +1 -1
  187. package/es/src/core/create.js +1 -1
  188. package/es/src/utils/anime.js +1 -1
  189. package/package.json +153 -131
  190. package/.versionrc.json +0 -32
@@ -0,0 +1,99 @@
1
+ import { Parser } from '../Parser.js';
2
+ import { mapValue, parseNDigits } from '../utils.js';
3
+ import setUTCISODay from '../../../_lib/setUTCISODay/index.js';
4
+
5
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+
7
+ class ISODayParser extends Parser {
8
+ constructor() {
9
+ super(...arguments);
10
+
11
+ _defineProperty(this, "priority", 90);
12
+
13
+ _defineProperty(this, "incompatibleTokens", ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']);
14
+ }
15
+
16
+ parse(dateString, token, match) {
17
+ var valueCallback = function (value) {
18
+ if (value === 0) {
19
+ return 7;
20
+ }
21
+
22
+ return value;
23
+ };
24
+
25
+ switch (token) {
26
+ // 2
27
+ case 'i':
28
+ case 'ii':
29
+ // 02
30
+ return parseNDigits(token.length, dateString);
31
+ // 2nd
32
+
33
+ case 'io':
34
+ return match.ordinalNumber(dateString, {
35
+ unit: 'day'
36
+ });
37
+ // Tue
38
+
39
+ case 'iii':
40
+ return mapValue(match.day(dateString, {
41
+ width: 'abbreviated',
42
+ context: 'formatting'
43
+ }) || match.day(dateString, {
44
+ width: 'short',
45
+ context: 'formatting'
46
+ }) || match.day(dateString, {
47
+ width: 'narrow',
48
+ context: 'formatting'
49
+ }), valueCallback);
50
+ // T
51
+
52
+ case 'iiiii':
53
+ return mapValue(match.day(dateString, {
54
+ width: 'narrow',
55
+ context: 'formatting'
56
+ }), valueCallback);
57
+ // Tu
58
+
59
+ case 'iiiiii':
60
+ return mapValue(match.day(dateString, {
61
+ width: 'short',
62
+ context: 'formatting'
63
+ }) || match.day(dateString, {
64
+ width: 'narrow',
65
+ context: 'formatting'
66
+ }), valueCallback);
67
+ // Tuesday
68
+
69
+ case 'iiii':
70
+ default:
71
+ return mapValue(match.day(dateString, {
72
+ width: 'wide',
73
+ context: 'formatting'
74
+ }) || match.day(dateString, {
75
+ width: 'abbreviated',
76
+ context: 'formatting'
77
+ }) || match.day(dateString, {
78
+ width: 'short',
79
+ context: 'formatting'
80
+ }) || match.day(dateString, {
81
+ width: 'narrow',
82
+ context: 'formatting'
83
+ }), valueCallback);
84
+ }
85
+ }
86
+
87
+ validate(_date, value) {
88
+ return value >= 1 && value <= 7;
89
+ }
90
+
91
+ set(date, _flags, value) {
92
+ date = setUTCISODay(date, value);
93
+ date.setUTCHours(0, 0, 0, 0);
94
+ return date;
95
+ }
96
+
97
+ }
98
+
99
+ export { ISODayParser };
@@ -0,0 +1,46 @@
1
+ import { Parser } from '../Parser.js';
2
+ import { timezonePatterns } from '../constants.js';
3
+ import { parseTimezonePattern } from '../utils.js';
4
+
5
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+
7
+ class ISOTimezoneParser extends Parser {
8
+ constructor() {
9
+ super(...arguments);
10
+
11
+ _defineProperty(this, "priority", 10);
12
+
13
+ _defineProperty(this, "incompatibleTokens", ['t', 'T', 'X']);
14
+ }
15
+
16
+ parse(dateString, token) {
17
+ switch (token) {
18
+ case 'x':
19
+ return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);
20
+
21
+ case 'xx':
22
+ return parseTimezonePattern(timezonePatterns.basic, dateString);
23
+
24
+ case 'xxxx':
25
+ return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);
26
+
27
+ case 'xxxxx':
28
+ return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);
29
+
30
+ case 'xxx':
31
+ default:
32
+ return parseTimezonePattern(timezonePatterns.extended, dateString);
33
+ }
34
+ }
35
+
36
+ set(date, flags, value) {
37
+ if (flags.timestampIsSet) {
38
+ return date;
39
+ }
40
+
41
+ return new Date(date.getTime() - value);
42
+ }
43
+
44
+ }
45
+
46
+ export { ISOTimezoneParser };
@@ -0,0 +1,46 @@
1
+ import { Parser } from '../Parser.js';
2
+ import { timezonePatterns } from '../constants.js';
3
+ import { parseTimezonePattern } from '../utils.js';
4
+
5
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+
7
+ class ISOTimezoneWithZParser extends Parser {
8
+ constructor() {
9
+ super(...arguments);
10
+
11
+ _defineProperty(this, "priority", 10);
12
+
13
+ _defineProperty(this, "incompatibleTokens", ['t', 'T', 'x']);
14
+ }
15
+
16
+ parse(dateString, token) {
17
+ switch (token) {
18
+ case 'X':
19
+ return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);
20
+
21
+ case 'XX':
22
+ return parseTimezonePattern(timezonePatterns.basic, dateString);
23
+
24
+ case 'XXXX':
25
+ return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);
26
+
27
+ case 'XXXXX':
28
+ return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);
29
+
30
+ case 'XXX':
31
+ default:
32
+ return parseTimezonePattern(timezonePatterns.extended, dateString);
33
+ }
34
+ }
35
+
36
+ set(date, flags, value) {
37
+ if (flags.timestampIsSet) {
38
+ return date;
39
+ }
40
+
41
+ return new Date(date.getTime() - value);
42
+ }
43
+
44
+ }
45
+
46
+ export { ISOTimezoneWithZParser };
@@ -0,0 +1,43 @@
1
+ import { Parser } from '../Parser.js';
2
+ import { numericPatterns } from '../constants.js';
3
+ import { parseNDigits, parseNumericPattern } from '../utils.js';
4
+ import setUTCISOWeek from '../../../_lib/setUTCISOWeek/index.js';
5
+ import startOfUTCISOWeek from '../../../_lib/startOfUTCISOWeek/index.js';
6
+
7
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
+
9
+ class ISOWeekParser extends Parser {
10
+ constructor() {
11
+ super(...arguments);
12
+
13
+ _defineProperty(this, "priority", 100);
14
+
15
+ _defineProperty(this, "incompatibleTokens", ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']);
16
+ }
17
+
18
+ parse(dateString, token, match) {
19
+ switch (token) {
20
+ case 'I':
21
+ return parseNumericPattern(numericPatterns.week, dateString);
22
+
23
+ case 'Io':
24
+ return match.ordinalNumber(dateString, {
25
+ unit: 'week'
26
+ });
27
+
28
+ default:
29
+ return parseNDigits(token.length, dateString);
30
+ }
31
+ }
32
+
33
+ validate(_date, value) {
34
+ return value >= 1 && value <= 53;
35
+ }
36
+
37
+ set(date, _flags, value) {
38
+ return startOfUTCISOWeek(setUTCISOWeek(date, value));
39
+ }
40
+
41
+ }
42
+
43
+ export { ISOWeekParser };
@@ -0,0 +1,33 @@
1
+ import { Parser } from '../Parser.js';
2
+ import { parseNDigitsSigned } from '../utils.js';
3
+ import startOfUTCISOWeek from '../../../_lib/startOfUTCISOWeek/index.js';
4
+
5
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+
7
+ class ISOWeekYearParser extends Parser {
8
+ constructor() {
9
+ super(...arguments);
10
+
11
+ _defineProperty(this, "priority", 130);
12
+
13
+ _defineProperty(this, "incompatibleTokens", ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']);
14
+ }
15
+
16
+ parse(dateString, token) {
17
+ if (token === 'R') {
18
+ return parseNDigitsSigned(4, dateString);
19
+ }
20
+
21
+ return parseNDigitsSigned(token.length, dateString);
22
+ }
23
+
24
+ set(_date, _flags, value) {
25
+ var firstWeekOfYear = new Date(0);
26
+ firstWeekOfYear.setUTCFullYear(value, 0, 4);
27
+ firstWeekOfYear.setUTCHours(0, 0, 0, 0);
28
+ return startOfUTCISOWeek(firstWeekOfYear);
29
+ }
30
+
31
+ }
32
+
33
+ export { ISOWeekYearParser };
@@ -0,0 +1,96 @@
1
+ import { Parser } from '../Parser.js';
2
+ import { mapValue, parseNDigits } from '../utils.js';
3
+ import setUTCDay from '../../../_lib/setUTCDay/index.js';
4
+
5
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+
7
+ class LocalDayParser extends Parser {
8
+ constructor() {
9
+ super(...arguments);
10
+
11
+ _defineProperty(this, "priority", 90);
12
+
13
+ _defineProperty(this, "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']);
14
+ }
15
+
16
+ parse(dateString, token, match, options) {
17
+ var valueCallback = function (value) {
18
+ var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
19
+ return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
20
+ };
21
+
22
+ switch (token) {
23
+ // 3
24
+ case 'e':
25
+ case 'ee':
26
+ // 03
27
+ return mapValue(parseNDigits(token.length, dateString), valueCallback);
28
+ // 3rd
29
+
30
+ case 'eo':
31
+ return mapValue(match.ordinalNumber(dateString, {
32
+ unit: 'day'
33
+ }), valueCallback);
34
+ // Tue
35
+
36
+ case 'eee':
37
+ return match.day(dateString, {
38
+ width: 'abbreviated',
39
+ context: 'formatting'
40
+ }) || match.day(dateString, {
41
+ width: 'short',
42
+ context: 'formatting'
43
+ }) || match.day(dateString, {
44
+ width: 'narrow',
45
+ context: 'formatting'
46
+ });
47
+ // T
48
+
49
+ case 'eeeee':
50
+ return match.day(dateString, {
51
+ width: 'narrow',
52
+ context: 'formatting'
53
+ });
54
+ // Tu
55
+
56
+ case 'eeeeee':
57
+ return match.day(dateString, {
58
+ width: 'short',
59
+ context: 'formatting'
60
+ }) || match.day(dateString, {
61
+ width: 'narrow',
62
+ context: 'formatting'
63
+ });
64
+ // Tuesday
65
+
66
+ case 'eeee':
67
+ default:
68
+ return match.day(dateString, {
69
+ width: 'wide',
70
+ context: 'formatting'
71
+ }) || match.day(dateString, {
72
+ width: 'abbreviated',
73
+ context: 'formatting'
74
+ }) || match.day(dateString, {
75
+ width: 'short',
76
+ context: 'formatting'
77
+ }) || match.day(dateString, {
78
+ width: 'narrow',
79
+ context: 'formatting'
80
+ });
81
+ }
82
+ }
83
+
84
+ validate(_date, value) {
85
+ return value >= 0 && value <= 6;
86
+ }
87
+
88
+ set(date, _flags, value, options) {
89
+ date = setUTCDay(date, value, options);
90
+ date.setUTCHours(0, 0, 0, 0);
91
+ return date;
92
+ }
93
+
94
+ }
95
+
96
+ export { LocalDayParser };
@@ -0,0 +1,43 @@
1
+ import { Parser } from '../Parser.js';
2
+ import { numericPatterns } from '../constants.js';
3
+ import { parseNDigits, parseNumericPattern } from '../utils.js';
4
+ import setUTCWeek from '../../../_lib/setUTCWeek/index.js';
5
+ import startOfUTCWeek from '../../../_lib/startOfUTCWeek/index.js';
6
+
7
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
+
9
+ class LocalWeekParser extends Parser {
10
+ constructor() {
11
+ super(...arguments);
12
+
13
+ _defineProperty(this, "priority", 100);
14
+
15
+ _defineProperty(this, "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']);
16
+ }
17
+
18
+ parse(dateString, token, match) {
19
+ switch (token) {
20
+ case 'w':
21
+ return parseNumericPattern(numericPatterns.week, dateString);
22
+
23
+ case 'wo':
24
+ return match.ordinalNumber(dateString, {
25
+ unit: 'week'
26
+ });
27
+
28
+ default:
29
+ return parseNDigits(token.length, dateString);
30
+ }
31
+ }
32
+
33
+ validate(_date, value) {
34
+ return value >= 1 && value <= 53;
35
+ }
36
+
37
+ set(date, _flags, value, options) {
38
+ return startOfUTCWeek(setUTCWeek(date, value, options), options);
39
+ }
40
+
41
+ }
42
+
43
+ export { LocalWeekParser };
@@ -0,0 +1,61 @@
1
+ import { Parser } from '../Parser.js';
2
+ import { mapValue, parseNDigits, normalizeTwoDigitYear } from '../utils.js';
3
+ import getUTCWeekYear from '../../../_lib/getUTCWeekYear/index.js';
4
+ import startOfUTCWeek from '../../../_lib/startOfUTCWeek/index.js';
5
+
6
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
+ // Local week-numbering year
8
+ class LocalWeekYearParser extends Parser {
9
+ constructor() {
10
+ super(...arguments);
11
+
12
+ _defineProperty(this, "priority", 130);
13
+
14
+ _defineProperty(this, "incompatibleTokens", ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']);
15
+ }
16
+
17
+ parse(dateString, token, match) {
18
+ var valueCallback = function (year) {
19
+ return {
20
+ year: year,
21
+ isTwoDigitYear: token === 'YY'
22
+ };
23
+ };
24
+
25
+ switch (token) {
26
+ case 'Y':
27
+ return mapValue(parseNDigits(4, dateString), valueCallback);
28
+
29
+ case 'Yo':
30
+ return mapValue(match.ordinalNumber(dateString, {
31
+ unit: 'year'
32
+ }), valueCallback);
33
+
34
+ default:
35
+ return mapValue(parseNDigits(token.length, dateString), valueCallback);
36
+ }
37
+ }
38
+
39
+ validate(_date, value) {
40
+ return value.isTwoDigitYear || value.year > 0;
41
+ }
42
+
43
+ set(date, flags, value, options) {
44
+ var currentYear = getUTCWeekYear(date, options);
45
+
46
+ if (value.isTwoDigitYear) {
47
+ var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
48
+ date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);
49
+ date.setUTCHours(0, 0, 0, 0);
50
+ return startOfUTCWeek(date, options);
51
+ }
52
+
53
+ var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;
54
+ date.setUTCFullYear(year, 0, options.firstWeekContainsDate);
55
+ date.setUTCHours(0, 0, 0, 0);
56
+ return startOfUTCWeek(date, options);
57
+ }
58
+
59
+ }
60
+
61
+ export { LocalWeekYearParser };
@@ -0,0 +1,41 @@
1
+ import { Parser } from '../Parser.js';
2
+ import { numericPatterns } from '../constants.js';
3
+ import { parseNDigits, parseNumericPattern } from '../utils.js';
4
+
5
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ class MinuteParser extends Parser {
7
+ constructor() {
8
+ super(...arguments);
9
+
10
+ _defineProperty(this, "priority", 60);
11
+
12
+ _defineProperty(this, "incompatibleTokens", ['t', 'T']);
13
+ }
14
+
15
+ parse(dateString, token, match) {
16
+ switch (token) {
17
+ case 'm':
18
+ return parseNumericPattern(numericPatterns.minute, dateString);
19
+
20
+ case 'mo':
21
+ return match.ordinalNumber(dateString, {
22
+ unit: 'minute'
23
+ });
24
+
25
+ default:
26
+ return parseNDigits(token.length, dateString);
27
+ }
28
+ }
29
+
30
+ validate(_date, value) {
31
+ return value >= 0 && value <= 59;
32
+ }
33
+
34
+ set(date, _flags, value) {
35
+ date.setUTCMinutes(value, 0, 0);
36
+ return date;
37
+ }
38
+
39
+ }
40
+
41
+ export { MinuteParser };
@@ -0,0 +1,80 @@
1
+ import { mapValue, parseNDigits, parseNumericPattern } from '../utils.js';
2
+ import { Parser } from '../Parser.js';
3
+ import { numericPatterns } from '../constants.js';
4
+
5
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ class MonthParser extends Parser {
7
+ constructor() {
8
+ super(...arguments);
9
+
10
+ _defineProperty(this, "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']);
11
+
12
+ _defineProperty(this, "priority", 110);
13
+ }
14
+
15
+ parse(dateString, token, match) {
16
+ var valueCallback = function (value) {
17
+ return value - 1;
18
+ };
19
+
20
+ switch (token) {
21
+ // 1, 2, ..., 12
22
+ case 'M':
23
+ return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback);
24
+ // 01, 02, ..., 12
25
+
26
+ case 'MM':
27
+ return mapValue(parseNDigits(2, dateString), valueCallback);
28
+ // 1st, 2nd, ..., 12th
29
+
30
+ case 'Mo':
31
+ return mapValue(match.ordinalNumber(dateString, {
32
+ unit: 'month'
33
+ }), valueCallback);
34
+ // Jan, Feb, ..., Dec
35
+
36
+ case 'MMM':
37
+ return match.month(dateString, {
38
+ width: 'abbreviated',
39
+ context: 'formatting'
40
+ }) || match.month(dateString, {
41
+ width: 'narrow',
42
+ context: 'formatting'
43
+ });
44
+ // J, F, ..., D
45
+
46
+ case 'MMMMM':
47
+ return match.month(dateString, {
48
+ width: 'narrow',
49
+ context: 'formatting'
50
+ });
51
+ // January, February, ..., December
52
+
53
+ case 'MMMM':
54
+ default:
55
+ return match.month(dateString, {
56
+ width: 'wide',
57
+ context: 'formatting'
58
+ }) || match.month(dateString, {
59
+ width: 'abbreviated',
60
+ context: 'formatting'
61
+ }) || match.month(dateString, {
62
+ width: 'narrow',
63
+ context: 'formatting'
64
+ });
65
+ }
66
+ }
67
+
68
+ validate(_date, value) {
69
+ return value >= 0 && value <= 11;
70
+ }
71
+
72
+ set(date, _flags, value) {
73
+ date.setUTCMonth(value, 1);
74
+ date.setUTCHours(0, 0, 0, 0);
75
+ return date;
76
+ }
77
+
78
+ }
79
+
80
+ export { MonthParser };
@@ -0,0 +1,73 @@
1
+ import { Parser } from '../Parser.js';
2
+ import { parseNDigits } from '../utils.js';
3
+
4
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ class QuarterParser extends Parser {
6
+ constructor() {
7
+ super(...arguments);
8
+
9
+ _defineProperty(this, "priority", 120);
10
+
11
+ _defineProperty(this, "incompatibleTokens", ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']);
12
+ }
13
+
14
+ parse(dateString, token, match) {
15
+ switch (token) {
16
+ // 1, 2, 3, 4
17
+ case 'Q':
18
+ case 'QQ':
19
+ // 01, 02, 03, 04
20
+ return parseNDigits(token.length, dateString);
21
+ // 1st, 2nd, 3rd, 4th
22
+
23
+ case 'Qo':
24
+ return match.ordinalNumber(dateString, {
25
+ unit: 'quarter'
26
+ });
27
+ // Q1, Q2, Q3, Q4
28
+
29
+ case 'QQQ':
30
+ return match.quarter(dateString, {
31
+ width: 'abbreviated',
32
+ context: 'formatting'
33
+ }) || match.quarter(dateString, {
34
+ width: 'narrow',
35
+ context: 'formatting'
36
+ });
37
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
38
+
39
+ case 'QQQQQ':
40
+ return match.quarter(dateString, {
41
+ width: 'narrow',
42
+ context: 'formatting'
43
+ });
44
+ // 1st quarter, 2nd quarter, ...
45
+
46
+ case 'QQQQ':
47
+ default:
48
+ return match.quarter(dateString, {
49
+ width: 'wide',
50
+ context: 'formatting'
51
+ }) || match.quarter(dateString, {
52
+ width: 'abbreviated',
53
+ context: 'formatting'
54
+ }) || match.quarter(dateString, {
55
+ width: 'narrow',
56
+ context: 'formatting'
57
+ });
58
+ }
59
+ }
60
+
61
+ validate(_date, value) {
62
+ return value >= 1 && value <= 4;
63
+ }
64
+
65
+ set(date, _flags, value) {
66
+ date.setUTCMonth((value - 1) * 3, 1);
67
+ date.setUTCHours(0, 0, 0, 0);
68
+ return date;
69
+ }
70
+
71
+ }
72
+
73
+ export { QuarterParser };