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,6 @@
1
+ var defaultOptions = {};
2
+ function getDefaultOptions() {
3
+ return defaultOptions;
4
+ }
5
+
6
+ export { getDefaultOptions };
@@ -0,0 +1,17 @@
1
+ import toDate from '../../toDate/index.js';
2
+ import startOfUTCISOWeek from '../startOfUTCISOWeek/index.js';
3
+ import startOfUTCISOWeekYear from '../startOfUTCISOWeekYear/index.js';
4
+ import requiredArgs from '../requiredArgs/index.js';
5
+
6
+ var MILLISECONDS_IN_WEEK = 604800000;
7
+ function getUTCISOWeek(dirtyDate) {
8
+ requiredArgs(1, arguments);
9
+ var date = toDate(dirtyDate);
10
+ var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
11
+ // because the number of milliseconds in a week is not constant
12
+ // (e.g. it's different in the week of the daylight saving time clock shift)
13
+
14
+ return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
15
+ }
16
+
17
+ export { getUTCISOWeek as default };
@@ -0,0 +1,27 @@
1
+ import toDate from '../../toDate/index.js';
2
+ import requiredArgs from '../requiredArgs/index.js';
3
+ import startOfUTCISOWeek from '../startOfUTCISOWeek/index.js';
4
+
5
+ function getUTCISOWeekYear(dirtyDate) {
6
+ requiredArgs(1, arguments);
7
+ var date = toDate(dirtyDate);
8
+ var year = date.getUTCFullYear();
9
+ var fourthOfJanuaryOfNextYear = new Date(0);
10
+ fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
11
+ fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
12
+ var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
13
+ var fourthOfJanuaryOfThisYear = new Date(0);
14
+ fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
15
+ fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
16
+ var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
17
+
18
+ if (date.getTime() >= startOfNextYear.getTime()) {
19
+ return year + 1;
20
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
21
+ return year;
22
+ } else {
23
+ return year - 1;
24
+ }
25
+ }
26
+
27
+ export { getUTCISOWeekYear as default };
@@ -0,0 +1,17 @@
1
+ import toDate from '../../toDate/index.js';
2
+ import startOfUTCWeek from '../startOfUTCWeek/index.js';
3
+ import startOfUTCWeekYear from '../startOfUTCWeekYear/index.js';
4
+ import requiredArgs from '../requiredArgs/index.js';
5
+
6
+ var MILLISECONDS_IN_WEEK = 604800000;
7
+ function getUTCWeek(dirtyDate, options) {
8
+ requiredArgs(1, arguments);
9
+ var date = toDate(dirtyDate);
10
+ var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer
11
+ // because the number of milliseconds in a week is not constant
12
+ // (e.g. it's different in the week of the daylight saving time clock shift)
13
+
14
+ return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
15
+ }
16
+
17
+ export { getUTCWeek as default };
@@ -0,0 +1,38 @@
1
+ import toDate from '../../toDate/index.js';
2
+ import requiredArgs from '../requiredArgs/index.js';
3
+ import startOfUTCWeek from '../startOfUTCWeek/index.js';
4
+ import toInteger from '../toInteger/index.js';
5
+ import { getDefaultOptions } from '../defaultOptions/index.js';
6
+
7
+ function getUTCWeekYear(dirtyDate, options) {
8
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
9
+
10
+ requiredArgs(1, arguments);
11
+ var date = toDate(dirtyDate);
12
+ var year = date.getUTCFullYear();
13
+ var defaultOptions = getDefaultOptions();
14
+ var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : 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.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== 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.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
15
+
16
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
17
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
18
+ }
19
+
20
+ var firstWeekOfNextYear = new Date(0);
21
+ firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
22
+ firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
23
+ var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
24
+ var firstWeekOfThisYear = new Date(0);
25
+ firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
26
+ firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
27
+ var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
28
+
29
+ if (date.getTime() >= startOfNextYear.getTime()) {
30
+ return year + 1;
31
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
32
+ return year;
33
+ } else {
34
+ return year - 1;
35
+ }
36
+ }
37
+
38
+ export { getUTCWeekYear as default };
@@ -0,0 +1,27 @@
1
+ import toDate from '../../toDate/index.js';
2
+ import requiredArgs from '../requiredArgs/index.js';
3
+ import toInteger from '../toInteger/index.js';
4
+ import { getDefaultOptions } from '../defaultOptions/index.js';
5
+
6
+ function setUTCDay(dirtyDate, dirtyDay, options) {
7
+ var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
8
+
9
+ requiredArgs(2, arguments);
10
+ var defaultOptions = getDefaultOptions();
11
+ 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); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
12
+
13
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
14
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
15
+ }
16
+
17
+ var date = toDate(dirtyDate);
18
+ var day = toInteger(dirtyDay);
19
+ var currentDay = date.getUTCDay();
20
+ var remainder = day % 7;
21
+ var dayIndex = (remainder + 7) % 7;
22
+ var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
23
+ date.setUTCDate(date.getUTCDate() + diff);
24
+ return date;
25
+ }
26
+
27
+ export { setUTCDay as default };
@@ -0,0 +1,23 @@
1
+ import toDate from '../../toDate/index.js';
2
+ import requiredArgs from '../requiredArgs/index.js';
3
+ import toInteger from '../toInteger/index.js';
4
+
5
+ function setUTCISODay(dirtyDate, dirtyDay) {
6
+ requiredArgs(2, arguments);
7
+ var day = toInteger(dirtyDay);
8
+
9
+ if (day % 7 === 0) {
10
+ day = day - 7;
11
+ }
12
+
13
+ var weekStartsOn = 1;
14
+ var date = toDate(dirtyDate);
15
+ var currentDay = date.getUTCDay();
16
+ var remainder = day % 7;
17
+ var dayIndex = (remainder + 7) % 7;
18
+ var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
19
+ date.setUTCDate(date.getUTCDate() + diff);
20
+ return date;
21
+ }
22
+
23
+ export { setUTCISODay as default };
@@ -0,0 +1,15 @@
1
+ import toInteger from '../toInteger/index.js';
2
+ import toDate from '../../toDate/index.js';
3
+ import getUTCISOWeek from '../getUTCISOWeek/index.js';
4
+ import requiredArgs from '../requiredArgs/index.js';
5
+
6
+ function setUTCISOWeek(dirtyDate, dirtyISOWeek) {
7
+ requiredArgs(2, arguments);
8
+ var date = toDate(dirtyDate);
9
+ var isoWeek = toInteger(dirtyISOWeek);
10
+ var diff = getUTCISOWeek(date) - isoWeek;
11
+ date.setUTCDate(date.getUTCDate() - diff * 7);
12
+ return date;
13
+ }
14
+
15
+ export { setUTCISOWeek as default };
@@ -0,0 +1,15 @@
1
+ import toInteger from '../toInteger/index.js';
2
+ import toDate from '../../toDate/index.js';
3
+ import getUTCWeek from '../getUTCWeek/index.js';
4
+ import requiredArgs from '../requiredArgs/index.js';
5
+
6
+ function setUTCWeek(dirtyDate, dirtyWeek, options) {
7
+ requiredArgs(2, arguments);
8
+ var date = toDate(dirtyDate);
9
+ var week = toInteger(dirtyWeek);
10
+ var diff = getUTCWeek(date, options) - week;
11
+ date.setUTCDate(date.getUTCDate() - diff * 7);
12
+ return date;
13
+ }
14
+
15
+ export { setUTCWeek as default };
@@ -0,0 +1,15 @@
1
+ import toDate from '../../toDate/index.js';
2
+ import requiredArgs from '../requiredArgs/index.js';
3
+
4
+ function startOfUTCISOWeek(dirtyDate) {
5
+ requiredArgs(1, arguments);
6
+ var weekStartsOn = 1;
7
+ var date = toDate(dirtyDate);
8
+ var day = date.getUTCDay();
9
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
10
+ date.setUTCDate(date.getUTCDate() - diff);
11
+ date.setUTCHours(0, 0, 0, 0);
12
+ return date;
13
+ }
14
+
15
+ export { startOfUTCISOWeek as default };
@@ -0,0 +1,15 @@
1
+ import getUTCISOWeekYear from '../getUTCISOWeekYear/index.js';
2
+ import startOfUTCISOWeek from '../startOfUTCISOWeek/index.js';
3
+ import requiredArgs from '../requiredArgs/index.js';
4
+
5
+ function startOfUTCISOWeekYear(dirtyDate) {
6
+ requiredArgs(1, arguments);
7
+ var year = getUTCISOWeekYear(dirtyDate);
8
+ var fourthOfJanuary = new Date(0);
9
+ fourthOfJanuary.setUTCFullYear(year, 0, 4);
10
+ fourthOfJanuary.setUTCHours(0, 0, 0, 0);
11
+ var date = startOfUTCISOWeek(fourthOfJanuary);
12
+ return date;
13
+ }
14
+
15
+ export { startOfUTCISOWeekYear as default };
@@ -0,0 +1,25 @@
1
+ import toDate from '../../toDate/index.js';
2
+ import requiredArgs from '../requiredArgs/index.js';
3
+ import toInteger from '../toInteger/index.js';
4
+ import { getDefaultOptions } from '../defaultOptions/index.js';
5
+
6
+ function startOfUTCWeek(dirtyDate, options) {
7
+ var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
8
+
9
+ requiredArgs(1, arguments);
10
+ var defaultOptions = getDefaultOptions();
11
+ 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); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
12
+
13
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
14
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
15
+ }
16
+
17
+ var date = toDate(dirtyDate);
18
+ var day = date.getUTCDay();
19
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
20
+ date.setUTCDate(date.getUTCDate() - diff);
21
+ date.setUTCHours(0, 0, 0, 0);
22
+ return date;
23
+ }
24
+
25
+ export { startOfUTCWeek as default };
@@ -0,0 +1,21 @@
1
+ import getUTCWeekYear from '../getUTCWeekYear/index.js';
2
+ import requiredArgs from '../requiredArgs/index.js';
3
+ import startOfUTCWeek from '../startOfUTCWeek/index.js';
4
+ import toInteger from '../toInteger/index.js';
5
+ import { getDefaultOptions } from '../defaultOptions/index.js';
6
+
7
+ function startOfUTCWeekYear(dirtyDate, options) {
8
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
9
+
10
+ requiredArgs(1, arguments);
11
+ var defaultOptions = getDefaultOptions();
12
+ var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : 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.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== 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.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
13
+ var year = getUTCWeekYear(dirtyDate, options);
14
+ var firstWeek = new Date(0);
15
+ firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
16
+ firstWeek.setUTCHours(0, 0, 0, 0);
17
+ var date = startOfUTCWeek(firstWeek, options);
18
+ return date;
19
+ }
20
+
21
+ export { startOfUTCWeekYear as default };
@@ -0,0 +1,15 @@
1
+ function toInteger(dirtyNumber) {
2
+ if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
3
+ return NaN;
4
+ }
5
+
6
+ var number = Number(dirtyNumber);
7
+
8
+ if (isNaN(number)) {
9
+ return number;
10
+ }
11
+
12
+ return number < 0 ? Math.ceil(number) : Math.floor(number);
13
+ }
14
+
15
+ export { toInteger as default };
@@ -10,10 +10,6 @@ import requiredArgs from '../_lib/requiredArgs/index.js';
10
10
  * Compare the two dates and return 1 if the first date is after the second,
11
11
  * -1 if the first date is before the second or 0 if dates are equal.
12
12
  *
13
- * ### v2.0.0 breaking changes:
14
- *
15
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
16
- *
17
13
  * @param {Date|Number} dateLeft - the first date to compare
18
14
  * @param {Date|Number} dateRight - the second date to compare
19
15
  * @returns {Number} the result of the comparison
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Days in 1 week.
3
+ *
4
+ * @name daysInWeek
5
+ * @constant
6
+ * @type {number}
7
+ * @default
8
+ */
9
+ /**
10
+ * Milliseconds in 1 minute
11
+ *
12
+ * @name millisecondsInMinute
13
+ * @constant
14
+ * @type {number}
15
+ * @default
16
+ */
17
+
18
+ var millisecondsInMinute = 60000;
19
+ /**
20
+ * Milliseconds in 1 hour
21
+ *
22
+ * @name millisecondsInHour
23
+ * @constant
24
+ * @type {number}
25
+ * @default
26
+ */
27
+
28
+ var millisecondsInHour = 3600000;
29
+ /**
30
+ * Milliseconds in 1 second
31
+ *
32
+ * @name millisecondsInSecond
33
+ * @constant
34
+ * @type {number}
35
+ * @default
36
+ */
37
+
38
+ var millisecondsInSecond = 1000;
39
+
40
+ export { millisecondsInHour, millisecondsInMinute, millisecondsInSecond };
@@ -12,10 +12,6 @@ var MILLISECONDS_IN_DAY = 86400000;
12
12
  * Get the number of calendar days between the given dates. This means that the times are removed
13
13
  * from the dates and then the difference in days is calculated.
14
14
  *
15
- * ### v2.0.0 breaking changes:
16
- *
17
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
18
- *
19
15
  * @param {Date|Number} dateLeft - the later date
20
16
  * @param {Date|Number} dateRight - the earlier date
21
17
  * @returns {Number} the number of calendar days
@@ -9,10 +9,6 @@ import requiredArgs from '../_lib/requiredArgs/index.js';
9
9
  * @description
10
10
  * Get the number of calendar months between the given dates.
11
11
  *
12
- * ### v2.0.0 breaking changes:
13
- *
14
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
15
- *
16
12
  * @param {Date|Number} dateLeft - the later date
17
13
  * @param {Date|Number} dateRight - the earlier date
18
14
  * @returns {Number} the number of calendar months
@@ -20,7 +16,7 @@ import requiredArgs from '../_lib/requiredArgs/index.js';
20
16
  *
21
17
  * @example
22
18
  * // How many calendar months are between 31 January 2014 and 1 September 2014?
23
- * var result = differenceInCalendarMonths(
19
+ * const result = differenceInCalendarMonths(
24
20
  * new Date(2014, 8, 1),
25
21
  * new Date(2014, 0, 31)
26
22
  * )
@@ -34,10 +34,6 @@ function compareLocalAsc(dateLeft, dateRight) {
34
34
  * `Math.floor(differenceInHours(dateLeft, dateRight)/24)|0`.
35
35
  *
36
36
  *
37
- * ### v2.0.0 breaking changes:
38
- *
39
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
40
- *
41
37
  * @param {Date|Number} dateLeft - the later date
42
38
  * @param {Date|Number} dateRight - the earlier date
43
39
  * @returns {Number} the number of full days according to the local timezone
@@ -12,10 +12,6 @@ import isLastDayOfMonth from '../isLastDayOfMonth/index.js';
12
12
  * @description
13
13
  * Get the number of full months between the given dates using trunc as a default rounding method.
14
14
  *
15
- * ### v2.0.0 breaking changes:
16
- *
17
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
18
- *
19
15
  * @param {Date|Number} dateLeft - the later date
20
16
  * @param {Date|Number} dateRight - the earlier date
21
17
  * @returns {Number} the number of full months
@@ -10,10 +10,6 @@ import requiredArgs from '../_lib/requiredArgs/index.js';
10
10
  * Return the end of a day for the given date.
11
11
  * The result will be in the local timezone.
12
12
  *
13
- * ### v2.0.0 breaking changes:
14
- *
15
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
16
- *
17
13
  * @param {Date|Number} date - the original date
18
14
  * @returns {Date} the end of a day
19
15
  * @throws {TypeError} 1 argument required
@@ -10,10 +10,6 @@ import requiredArgs from '../_lib/requiredArgs/index.js';
10
10
  * Return the end of a month for the given date.
11
11
  * The result will be in the local timezone.
12
12
  *
13
- * ### v2.0.0 breaking changes:
14
- *
15
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
16
- *
17
13
  * @param {Date|Number} date - the original date
18
14
  * @returns {Date} the end of a month
19
15
  * @throws {TypeError} 1 argument required
@@ -11,17 +11,13 @@ import requiredArgs from '../_lib/requiredArgs/index.js';
11
11
  * @description
12
12
  * Is the given date the last day of a month?
13
13
  *
14
- * ### v2.0.0 breaking changes:
15
- *
16
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
17
- *
18
14
  * @param {Date|Number} date - the date to check
19
15
  * @returns {Boolean} the date is the last day of a month
20
16
  * @throws {TypeError} 1 argument required
21
17
  *
22
18
  * @example
23
19
  * // Is 28 February 2014 the last day of a month?
24
- * var result = isLastDayOfMonth(new Date(2014, 1, 28))
20
+ * const result = isLastDayOfMonth(new Date(2014, 1, 28))
25
21
  * //=> true
26
22
  */
27
23
 
@@ -0,0 +1,32 @@
1
+ import { ValueSetter } from './Setter.js';
2
+
3
+ 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; }
4
+ class Parser {
5
+ constructor() {
6
+ _defineProperty(this, "incompatibleTokens", void 0);
7
+
8
+ _defineProperty(this, "priority", void 0);
9
+
10
+ _defineProperty(this, "subPriority", void 0);
11
+ }
12
+
13
+ run(dateString, token, match, options) {
14
+ var result = this.parse(dateString, token, match, options);
15
+
16
+ if (!result) {
17
+ return null;
18
+ }
19
+
20
+ return {
21
+ setter: new ValueSetter(result.value, this.validate, this.set, this.priority, this.subPriority),
22
+ rest: result.rest
23
+ };
24
+ }
25
+
26
+ validate(_utcDate, _value, _options) {
27
+ return true;
28
+ }
29
+
30
+ }
31
+
32
+ export { Parser };
@@ -0,0 +1,37 @@
1
+ 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; }
2
+ class Setter {
3
+ constructor() {
4
+ _defineProperty(this, "priority", void 0);
5
+
6
+ _defineProperty(this, "subPriority", 0);
7
+ }
8
+
9
+ validate(_utcDate, _options) {
10
+ return true;
11
+ }
12
+
13
+ }
14
+ class ValueSetter extends Setter {
15
+ constructor(value, validateValue, setValue, priority, subPriority) {
16
+ super();
17
+ this.value = value;
18
+ this.validateValue = validateValue;
19
+ this.setValue = setValue;
20
+ this.priority = priority;
21
+
22
+ if (subPriority) {
23
+ this.subPriority = subPriority;
24
+ }
25
+ }
26
+
27
+ validate(utcDate, options) {
28
+ return this.validateValue(utcDate, this.value, options);
29
+ }
30
+
31
+ set(utcDate, flags, options) {
32
+ return this.setValue(utcDate, flags, this.value, options);
33
+ }
34
+
35
+ }
36
+
37
+ export { Setter, ValueSetter };
@@ -0,0 +1,48 @@
1
+ var numericPatterns = {
2
+ month: /^(1[0-2]|0?\d)/,
3
+ // 0 to 12
4
+ date: /^(3[0-1]|[0-2]?\d)/,
5
+ // 0 to 31
6
+ dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
7
+ // 0 to 366
8
+ week: /^(5[0-3]|[0-4]?\d)/,
9
+ // 0 to 53
10
+ hour23h: /^(2[0-3]|[0-1]?\d)/,
11
+ // 0 to 23
12
+ hour24h: /^(2[0-4]|[0-1]?\d)/,
13
+ // 0 to 24
14
+ hour11h: /^(1[0-1]|0?\d)/,
15
+ // 0 to 11
16
+ hour12h: /^(1[0-2]|0?\d)/,
17
+ // 0 to 12
18
+ minute: /^[0-5]?\d/,
19
+ // 0 to 59
20
+ second: /^[0-5]?\d/,
21
+ // 0 to 59
22
+ singleDigit: /^\d/,
23
+ // 0 to 9
24
+ twoDigits: /^\d{1,2}/,
25
+ // 0 to 99
26
+ threeDigits: /^\d{1,3}/,
27
+ // 0 to 999
28
+ fourDigits: /^\d{1,4}/,
29
+ // 0 to 9999
30
+ anyDigitsSigned: /^-?\d+/,
31
+ singleDigitSigned: /^-?\d/,
32
+ // 0 to 9, -0 to -9
33
+ twoDigitsSigned: /^-?\d{1,2}/,
34
+ // 0 to 99, -0 to -99
35
+ threeDigitsSigned: /^-?\d{1,3}/,
36
+ // 0 to 999, -0 to -999
37
+ fourDigitsSigned: /^-?\d{1,4}/ // 0 to 9999, -0 to -9999
38
+
39
+ };
40
+ var timezonePatterns = {
41
+ basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
42
+ basic: /^([+-])(\d{2})(\d{2})|Z/,
43
+ basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
44
+ extended: /^([+-])(\d{2}):(\d{2})|Z/,
45
+ extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
46
+ };
47
+
48
+ export { numericPatterns, timezonePatterns };
@@ -0,0 +1,55 @@
1
+ import { Parser } from '../Parser.js';
2
+ import { dayPeriodEnumToHours } 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 AMPMMidnightParser extends Parser {
6
+ constructor() {
7
+ super(...arguments);
8
+
9
+ _defineProperty(this, "priority", 80);
10
+
11
+ _defineProperty(this, "incompatibleTokens", ['a', 'B', 'H', 'k', 't', 'T']);
12
+ }
13
+
14
+ parse(dateString, token, match) {
15
+ switch (token) {
16
+ case 'b':
17
+ case 'bb':
18
+ case 'bbb':
19
+ return match.dayPeriod(dateString, {
20
+ width: 'abbreviated',
21
+ context: 'formatting'
22
+ }) || match.dayPeriod(dateString, {
23
+ width: 'narrow',
24
+ context: 'formatting'
25
+ });
26
+
27
+ case 'bbbbb':
28
+ return match.dayPeriod(dateString, {
29
+ width: 'narrow',
30
+ context: 'formatting'
31
+ });
32
+
33
+ case 'bbbb':
34
+ default:
35
+ return match.dayPeriod(dateString, {
36
+ width: 'wide',
37
+ context: 'formatting'
38
+ }) || match.dayPeriod(dateString, {
39
+ width: 'abbreviated',
40
+ context: 'formatting'
41
+ }) || match.dayPeriod(dateString, {
42
+ width: 'narrow',
43
+ context: 'formatting'
44
+ });
45
+ }
46
+ }
47
+
48
+ set(date, _flags, value) {
49
+ date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
50
+ return date;
51
+ }
52
+
53
+ }
54
+
55
+ export { AMPMMidnightParser };