@indielayer/ui 1.5.2 → 1.6.1

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 (210) hide show
  1. package/README.md +1 -1
  2. package/docs/components/common/DocumentPage.vue +0 -30
  3. package/docs/components/menu/DocsMenu.vue +2 -0
  4. package/docs/pages/component/datepicker/index.vue +35 -0
  5. package/docs/pages/component/datepicker/usage.vue +22 -0
  6. package/docs/pages/component/form/usage.vue +13 -0
  7. package/docs/pages/component/menu/usage.vue +7 -3
  8. package/docs/pages/component/qrCode/index.vue +25 -0
  9. package/docs/pages/component/qrCode/usage.vue +20 -0
  10. package/docs/pages/component/slider/usage.vue +8 -10
  11. package/docs/pages/index.vue +9 -19
  12. package/lib/components/button/Button.vue.d.ts +3 -3
  13. package/lib/components/button/Button.vue.js +2 -2
  14. package/lib/components/button/Button.vue2.js +10 -10
  15. package/lib/components/carousel/Carousel.vue.d.ts +8 -2
  16. package/lib/components/carousel/Carousel.vue.js +51 -48
  17. package/lib/components/checkbox/theme/Checkbox.base.theme.js +1 -1
  18. package/lib/components/datepicker/Datepicker.vue.d.ts +1886 -0
  19. package/lib/components/datepicker/Datepicker.vue.js +328 -0
  20. package/lib/components/datepicker/Datepicker.vue2.js +4 -0
  21. package/lib/components/datepicker/Datepicker.vue3.js +5 -0
  22. package/lib/components/datepicker/__tests__/Datepicker.spec.d.ts +1 -0
  23. package/lib/components/datepicker/index.d.ts +2 -0
  24. package/lib/components/datepicker/theme/Datepicker.base.theme.d.ts +3 -0
  25. package/lib/components/datepicker/theme/Datepicker.base.theme.js +64 -0
  26. package/lib/components/datepicker/theme/Datepicker.carbon.theme.d.ts +3 -0
  27. package/lib/components/datepicker/theme/Datepicker.carbon.theme.js +5 -0
  28. package/lib/components/drawer/Drawer.vue.js +1 -1
  29. package/lib/components/drawer/theme/Drawer.base.theme.js +1 -1
  30. package/lib/components/formGroup/FormGroup.vue.js +42 -36
  31. package/lib/components/index.d.ts +2 -0
  32. package/lib/components/index.js +99 -94
  33. package/lib/components/menu/Menu.vue.d.ts +4 -0
  34. package/lib/components/menu/Menu.vue.js +40 -34
  35. package/lib/components/menu/MenuItem.vue.d.ts +4 -0
  36. package/lib/components/menu/MenuItem.vue.js +1 -1
  37. package/lib/components/menu/MenuItem.vue2.js +43 -39
  38. package/lib/components/menu/theme/MenuItem.base.theme.js +1 -1
  39. package/lib/components/qrCode/QrCode.vue.d.ts +68 -0
  40. package/lib/components/qrCode/QrCode.vue.js +93 -0
  41. package/lib/components/qrCode/QrCode.vue2.js +4 -0
  42. package/lib/components/qrCode/__tests__/QrCode.spec.d.ts +1 -0
  43. package/lib/components/qrCode/index.d.ts +2 -0
  44. package/lib/components/qrCode/qrcodegen.d.ts +94 -0
  45. package/lib/components/qrCode/qrcodegen.js +571 -0
  46. package/lib/components/qrCode/theme/QrCode.base.theme.d.ts +3 -0
  47. package/lib/components/qrCode/theme/QrCode.base.theme.js +8 -0
  48. package/lib/components/qrCode/theme/QrCode.carbon.theme.d.ts +3 -0
  49. package/lib/components/qrCode/theme/QrCode.carbon.theme.js +5 -0
  50. package/lib/components/slider/Slider.vue.d.ts +31 -31
  51. package/lib/components/slider/Slider.vue.js +5 -146
  52. package/lib/components/slider/Slider.vue2.js +101 -2
  53. package/lib/components/slider/Slider.vue3.js +4 -0
  54. package/lib/components/slider/theme/Slider.base.theme.js +14 -10
  55. package/lib/components/slider/theme/Slider.carbon.theme.js +3 -14
  56. package/lib/index.js +117 -113
  57. package/lib/index.umd.js +38 -3
  58. package/lib/node_modules/.pnpm/@vuepic_vue-datepicker@8.0.0_vue@3.3.9/node_modules/@vuepic/vue-datepicker/dist/main.css.js +4 -0
  59. package/lib/node_modules/.pnpm/@vuepic_vue-datepicker@8.0.0_vue@3.3.9/node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.js +5011 -0
  60. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/_lib/addLeadingZeros.js +7 -0
  61. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/_lib/defaultOptions.js +7 -0
  62. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/_lib/format/formatters.js +518 -0
  63. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/_lib/format/lightFormatters.js +59 -0
  64. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/_lib/format/longFormatters.js +52 -0
  65. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +18 -0
  66. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/_lib/protectedTokens.js +21 -0
  67. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/add.js +20 -0
  68. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/addDays.js +10 -0
  69. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/addMonths.js +21 -0
  70. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/addQuarters.js +9 -0
  71. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/addYears.js +8 -0
  72. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/constants.js +8 -0
  73. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/constructFrom.js +7 -0
  74. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/differenceInCalendarDays.js +11 -0
  75. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/eachDayOfInterval.js +19 -0
  76. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/eachQuarterOfInterval.js +20 -0
  77. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/endOfQuarter.js +9 -0
  78. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/endOfWeek.js +11 -0
  79. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/endOfYear.js +9 -0
  80. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/format.js +60 -0
  81. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getDay.js +8 -0
  82. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getDayOfYear.js +11 -0
  83. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getDaysInMonth.js +10 -0
  84. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getDefaultOptions.js +8 -0
  85. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getHours.js +8 -0
  86. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getISODay.js +9 -0
  87. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getISOWeek.js +12 -0
  88. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getISOWeekYear.js +15 -0
  89. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getMinutes.js +8 -0
  90. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getMonth.js +8 -0
  91. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getQuarter.js +9 -0
  92. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getSeconds.js +8 -0
  93. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getWeek.js +12 -0
  94. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getWeekYear.js +17 -0
  95. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getYear.js +8 -0
  96. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/isAfter.js +9 -0
  97. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/isBefore.js +9 -0
  98. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/isDate.js +7 -0
  99. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/isEqual.js +9 -0
  100. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/isSameQuarter.js +9 -0
  101. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/isValid.js +12 -0
  102. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +9 -0
  103. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +18 -0
  104. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/locale/_lib/buildMatchFn.js +31 -0
  105. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +17 -0
  106. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +70 -0
  107. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/locale/en-US/_lib/formatLong.js +33 -0
  108. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +11 -0
  109. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/locale/en-US/_lib/localize.js +155 -0
  110. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/locale/en-US/_lib/match.js +110 -0
  111. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/locale/en-US.js +21 -0
  112. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/Parser.js +22 -0
  113. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/Setter.js +40 -0
  114. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/constants.js +49 -0
  115. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js +49 -0
  116. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/AMPMParser.js +49 -0
  117. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/DateParser.js +61 -0
  118. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js +51 -0
  119. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/DayParser.js +45 -0
  120. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js +49 -0
  121. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/EraParser.js +30 -0
  122. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js +21 -0
  123. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js +22 -0
  124. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js +32 -0
  125. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js +32 -0
  126. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js +33 -0
  127. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js +33 -0
  128. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/ISODayParser.js +99 -0
  129. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js +48 -0
  130. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js +48 -0
  131. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js +49 -0
  132. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js +40 -0
  133. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js +74 -0
  134. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js +48 -0
  135. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js +69 -0
  136. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/MinuteParser.js +32 -0
  137. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/MonthParser.js +71 -0
  138. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/QuarterParser.js +70 -0
  139. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/SecondParser.js +32 -0
  140. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js +74 -0
  141. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js +71 -0
  142. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js +70 -0
  143. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js +22 -0
  144. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js +22 -0
  145. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/YearParser.js +49 -0
  146. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers.js +67 -0
  147. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/utils.js +103 -0
  148. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse.js +90 -0
  149. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parseISO.js +128 -0
  150. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/set.js +11 -0
  151. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/setDay.js +12 -0
  152. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/setHours.js +9 -0
  153. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/setISODay.js +11 -0
  154. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/setISOWeek.js +10 -0
  155. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/setMilliseconds.js +9 -0
  156. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/setMinutes.js +9 -0
  157. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/setMonth.js +13 -0
  158. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/setSeconds.js +9 -0
  159. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/setWeek.js +10 -0
  160. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/setYear.js +10 -0
  161. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/startOfDay.js +9 -0
  162. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/startOfISOWeek.js +8 -0
  163. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/startOfISOWeekYear.js +11 -0
  164. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/startOfQuarter.js +9 -0
  165. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/startOfWeek.js +11 -0
  166. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/startOfWeekYear.js +13 -0
  167. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/startOfYear.js +10 -0
  168. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/sub.js +19 -0
  169. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/subDays.js +8 -0
  170. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/subMonths.js +8 -0
  171. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/subYears.js +8 -0
  172. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/toDate.js +8 -0
  173. package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/transpose.js +18 -0
  174. package/lib/theme.d.ts +3 -1
  175. package/lib/themes/base/components.d.ts +2 -0
  176. package/lib/themes/base/components.js +82 -78
  177. package/lib/themes/carbon/components.d.ts +2 -0
  178. package/lib/themes/carbon/components.js +82 -78
  179. package/lib/version.d.ts +1 -1
  180. package/lib/version.js +1 -1
  181. package/package.json +2 -1
  182. package/src/components/button/Button.vue +1 -1
  183. package/src/components/carousel/Carousel.vue +8 -3
  184. package/src/components/checkbox/theme/Checkbox.base.theme.ts +1 -1
  185. package/src/components/datepicker/Datepicker.vue +414 -0
  186. package/src/components/datepicker/__tests__/Datepicker.spec.ts +11 -0
  187. package/src/components/datepicker/index.ts +2 -0
  188. package/src/components/datepicker/theme/Datepicker.base.theme.ts +71 -0
  189. package/src/components/datepicker/theme/Datepicker.carbon.theme.ts +7 -0
  190. package/src/components/drawer/Drawer.vue +1 -1
  191. package/src/components/drawer/theme/Drawer.base.theme.ts +1 -1
  192. package/src/components/formGroup/FormGroup.vue +5 -0
  193. package/src/components/index.ts +2 -0
  194. package/src/components/menu/Menu.vue +6 -0
  195. package/src/components/menu/MenuItem.vue +2 -1
  196. package/src/components/menu/theme/MenuItem.base.theme.ts +1 -1
  197. package/src/components/qrCode/QrCode.vue +120 -0
  198. package/src/components/qrCode/__tests__/QrCode.spec.ts +14 -0
  199. package/src/components/qrCode/index.ts +2 -0
  200. package/src/components/qrCode/qrcodegen.ts +991 -0
  201. package/src/components/qrCode/theme/QrCode.base.theme.ts +9 -0
  202. package/src/components/qrCode/theme/QrCode.carbon.theme.ts +7 -0
  203. package/src/components/slider/Slider.vue +63 -137
  204. package/src/components/slider/theme/Slider.base.theme.ts +10 -5
  205. package/src/components/slider/theme/Slider.carbon.theme.ts +2 -16
  206. package/src/theme.ts +4 -0
  207. package/src/themes/base/components.ts +2 -0
  208. package/src/themes/carbon/components.ts +2 -0
  209. package/src/version.ts +1 -1
  210. package/volar.d.ts +2 -0
@@ -0,0 +1,7 @@
1
+ function r(t, n) {
2
+ const o = t < 0 ? "-" : "", a = Math.abs(t).toString().padStart(n, "0");
3
+ return o + a;
4
+ }
5
+ export {
6
+ r as addLeadingZeros
7
+ };
@@ -0,0 +1,7 @@
1
+ let t = {};
2
+ function e() {
3
+ return t;
4
+ }
5
+ export {
6
+ e as getDefaultOptions
7
+ };
@@ -0,0 +1,518 @@
1
+ import { getDayOfYear as m } from "../../getDayOfYear.js";
2
+ import { getISOWeek as g } from "../../getISOWeek.js";
3
+ import { getISOWeekYear as w } from "../../getISOWeekYear.js";
4
+ import { getWeek as b } from "../../getWeek.js";
5
+ import { getWeekYear as x } from "../../getWeekYear.js";
6
+ import { addLeadingZeros as i } from "../addLeadingZeros.js";
7
+ import { lightFormatters as u } from "./lightFormatters.js";
8
+ const s = {
9
+ am: "am",
10
+ pm: "pm",
11
+ midnight: "midnight",
12
+ noon: "noon",
13
+ morning: "morning",
14
+ afternoon: "afternoon",
15
+ evening: "evening",
16
+ night: "night"
17
+ }, L = {
18
+ // Era
19
+ G: function(n, r, e) {
20
+ const t = n.getFullYear() > 0 ? 1 : 0;
21
+ switch (r) {
22
+ case "G":
23
+ case "GG":
24
+ case "GGG":
25
+ return e.era(t, { width: "abbreviated" });
26
+ case "GGGGG":
27
+ return e.era(t, { width: "narrow" });
28
+ case "GGGG":
29
+ default:
30
+ return e.era(t, { width: "wide" });
31
+ }
32
+ },
33
+ // Year
34
+ y: function(n, r, e) {
35
+ if (r === "yo") {
36
+ const t = n.getFullYear(), a = t > 0 ? t : 1 - t;
37
+ return e.ordinalNumber(a, { unit: "year" });
38
+ }
39
+ return u.y(n, r);
40
+ },
41
+ // Local week-numbering year
42
+ Y: function(n, r, e, t) {
43
+ const a = x(n, t), o = a > 0 ? a : 1 - a;
44
+ if (r === "YY") {
45
+ const h = o % 100;
46
+ return i(h, 2);
47
+ }
48
+ return r === "Yo" ? e.ordinalNumber(o, { unit: "year" }) : i(o, r.length);
49
+ },
50
+ // ISO week-numbering year
51
+ R: function(n, r) {
52
+ const e = w(n);
53
+ return i(e, r.length);
54
+ },
55
+ // Extended year. This is a single number designating the year of this calendar system.
56
+ // The main difference between `y` and `u` localizers are B.C. years:
57
+ // | Year | `y` | `u` |
58
+ // |------|-----|-----|
59
+ // | AC 1 | 1 | 1 |
60
+ // | BC 1 | 1 | 0 |
61
+ // | BC 2 | 2 | -1 |
62
+ // Also `yy` always returns the last two digits of a year,
63
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
64
+ u: function(n, r) {
65
+ const e = n.getFullYear();
66
+ return i(e, r.length);
67
+ },
68
+ // Quarter
69
+ Q: function(n, r, e) {
70
+ const t = Math.ceil((n.getMonth() + 1) / 3);
71
+ switch (r) {
72
+ case "Q":
73
+ return String(t);
74
+ case "QQ":
75
+ return i(t, 2);
76
+ case "Qo":
77
+ return e.ordinalNumber(t, { unit: "quarter" });
78
+ case "QQQ":
79
+ return e.quarter(t, {
80
+ width: "abbreviated",
81
+ context: "formatting"
82
+ });
83
+ case "QQQQQ":
84
+ return e.quarter(t, {
85
+ width: "narrow",
86
+ context: "formatting"
87
+ });
88
+ case "QQQQ":
89
+ default:
90
+ return e.quarter(t, {
91
+ width: "wide",
92
+ context: "formatting"
93
+ });
94
+ }
95
+ },
96
+ // Stand-alone quarter
97
+ q: function(n, r, e) {
98
+ const t = Math.ceil((n.getMonth() + 1) / 3);
99
+ switch (r) {
100
+ case "q":
101
+ return String(t);
102
+ case "qq":
103
+ return i(t, 2);
104
+ case "qo":
105
+ return e.ordinalNumber(t, { unit: "quarter" });
106
+ case "qqq":
107
+ return e.quarter(t, {
108
+ width: "abbreviated",
109
+ context: "standalone"
110
+ });
111
+ case "qqqqq":
112
+ return e.quarter(t, {
113
+ width: "narrow",
114
+ context: "standalone"
115
+ });
116
+ case "qqqq":
117
+ default:
118
+ return e.quarter(t, {
119
+ width: "wide",
120
+ context: "standalone"
121
+ });
122
+ }
123
+ },
124
+ // Month
125
+ M: function(n, r, e) {
126
+ const t = n.getMonth();
127
+ switch (r) {
128
+ case "M":
129
+ case "MM":
130
+ return u.M(n, r);
131
+ case "Mo":
132
+ return e.ordinalNumber(t + 1, { unit: "month" });
133
+ case "MMM":
134
+ return e.month(t, {
135
+ width: "abbreviated",
136
+ context: "formatting"
137
+ });
138
+ case "MMMMM":
139
+ return e.month(t, {
140
+ width: "narrow",
141
+ context: "formatting"
142
+ });
143
+ case "MMMM":
144
+ default:
145
+ return e.month(t, { width: "wide", context: "formatting" });
146
+ }
147
+ },
148
+ // Stand-alone month
149
+ L: function(n, r, e) {
150
+ const t = n.getMonth();
151
+ switch (r) {
152
+ case "L":
153
+ return String(t + 1);
154
+ case "LL":
155
+ return i(t + 1, 2);
156
+ case "Lo":
157
+ return e.ordinalNumber(t + 1, { unit: "month" });
158
+ case "LLL":
159
+ return e.month(t, {
160
+ width: "abbreviated",
161
+ context: "standalone"
162
+ });
163
+ case "LLLLL":
164
+ return e.month(t, {
165
+ width: "narrow",
166
+ context: "standalone"
167
+ });
168
+ case "LLLL":
169
+ default:
170
+ return e.month(t, { width: "wide", context: "standalone" });
171
+ }
172
+ },
173
+ // Local week of year
174
+ w: function(n, r, e, t) {
175
+ const a = b(n, t);
176
+ return r === "wo" ? e.ordinalNumber(a, { unit: "week" }) : i(a, r.length);
177
+ },
178
+ // ISO week of year
179
+ I: function(n, r, e) {
180
+ const t = g(n);
181
+ return r === "Io" ? e.ordinalNumber(t, { unit: "week" }) : i(t, r.length);
182
+ },
183
+ // Day of the month
184
+ d: function(n, r, e) {
185
+ return r === "do" ? e.ordinalNumber(n.getDate(), { unit: "date" }) : u.d(n, r);
186
+ },
187
+ // Day of year
188
+ D: function(n, r, e) {
189
+ const t = m(n);
190
+ return r === "Do" ? e.ordinalNumber(t, { unit: "dayOfYear" }) : i(t, r.length);
191
+ },
192
+ // Day of week
193
+ E: function(n, r, e) {
194
+ const t = n.getDay();
195
+ switch (r) {
196
+ case "E":
197
+ case "EE":
198
+ case "EEE":
199
+ return e.day(t, {
200
+ width: "abbreviated",
201
+ context: "formatting"
202
+ });
203
+ case "EEEEE":
204
+ return e.day(t, {
205
+ width: "narrow",
206
+ context: "formatting"
207
+ });
208
+ case "EEEEEE":
209
+ return e.day(t, {
210
+ width: "short",
211
+ context: "formatting"
212
+ });
213
+ case "EEEE":
214
+ default:
215
+ return e.day(t, {
216
+ width: "wide",
217
+ context: "formatting"
218
+ });
219
+ }
220
+ },
221
+ // Local day of week
222
+ e: function(n, r, e, t) {
223
+ const a = n.getDay(), o = (a - t.weekStartsOn + 8) % 7 || 7;
224
+ switch (r) {
225
+ case "e":
226
+ return String(o);
227
+ case "ee":
228
+ return i(o, 2);
229
+ case "eo":
230
+ return e.ordinalNumber(o, { unit: "day" });
231
+ case "eee":
232
+ return e.day(a, {
233
+ width: "abbreviated",
234
+ context: "formatting"
235
+ });
236
+ case "eeeee":
237
+ return e.day(a, {
238
+ width: "narrow",
239
+ context: "formatting"
240
+ });
241
+ case "eeeeee":
242
+ return e.day(a, {
243
+ width: "short",
244
+ context: "formatting"
245
+ });
246
+ case "eeee":
247
+ default:
248
+ return e.day(a, {
249
+ width: "wide",
250
+ context: "formatting"
251
+ });
252
+ }
253
+ },
254
+ // Stand-alone local day of week
255
+ c: function(n, r, e, t) {
256
+ const a = n.getDay(), o = (a - t.weekStartsOn + 8) % 7 || 7;
257
+ switch (r) {
258
+ case "c":
259
+ return String(o);
260
+ case "cc":
261
+ return i(o, r.length);
262
+ case "co":
263
+ return e.ordinalNumber(o, { unit: "day" });
264
+ case "ccc":
265
+ return e.day(a, {
266
+ width: "abbreviated",
267
+ context: "standalone"
268
+ });
269
+ case "ccccc":
270
+ return e.day(a, {
271
+ width: "narrow",
272
+ context: "standalone"
273
+ });
274
+ case "cccccc":
275
+ return e.day(a, {
276
+ width: "short",
277
+ context: "standalone"
278
+ });
279
+ case "cccc":
280
+ default:
281
+ return e.day(a, {
282
+ width: "wide",
283
+ context: "standalone"
284
+ });
285
+ }
286
+ },
287
+ // ISO day of week
288
+ i: function(n, r, e) {
289
+ const t = n.getDay(), a = t === 0 ? 7 : t;
290
+ switch (r) {
291
+ case "i":
292
+ return String(a);
293
+ case "ii":
294
+ return i(a, r.length);
295
+ case "io":
296
+ return e.ordinalNumber(a, { unit: "day" });
297
+ case "iii":
298
+ return e.day(t, {
299
+ width: "abbreviated",
300
+ context: "formatting"
301
+ });
302
+ case "iiiii":
303
+ return e.day(t, {
304
+ width: "narrow",
305
+ context: "formatting"
306
+ });
307
+ case "iiiiii":
308
+ return e.day(t, {
309
+ width: "short",
310
+ context: "formatting"
311
+ });
312
+ case "iiii":
313
+ default:
314
+ return e.day(t, {
315
+ width: "wide",
316
+ context: "formatting"
317
+ });
318
+ }
319
+ },
320
+ // AM or PM
321
+ a: function(n, r, e) {
322
+ const a = n.getHours() / 12 >= 1 ? "pm" : "am";
323
+ switch (r) {
324
+ case "a":
325
+ case "aa":
326
+ return e.dayPeriod(a, {
327
+ width: "abbreviated",
328
+ context: "formatting"
329
+ });
330
+ case "aaa":
331
+ return e.dayPeriod(a, {
332
+ width: "abbreviated",
333
+ context: "formatting"
334
+ }).toLowerCase();
335
+ case "aaaaa":
336
+ return e.dayPeriod(a, {
337
+ width: "narrow",
338
+ context: "formatting"
339
+ });
340
+ case "aaaa":
341
+ default:
342
+ return e.dayPeriod(a, {
343
+ width: "wide",
344
+ context: "formatting"
345
+ });
346
+ }
347
+ },
348
+ // AM, PM, midnight, noon
349
+ b: function(n, r, e) {
350
+ const t = n.getHours();
351
+ let a;
352
+ switch (t === 12 ? a = s.noon : t === 0 ? a = s.midnight : a = t / 12 >= 1 ? "pm" : "am", r) {
353
+ case "b":
354
+ case "bb":
355
+ return e.dayPeriod(a, {
356
+ width: "abbreviated",
357
+ context: "formatting"
358
+ });
359
+ case "bbb":
360
+ return e.dayPeriod(a, {
361
+ width: "abbreviated",
362
+ context: "formatting"
363
+ }).toLowerCase();
364
+ case "bbbbb":
365
+ return e.dayPeriod(a, {
366
+ width: "narrow",
367
+ context: "formatting"
368
+ });
369
+ case "bbbb":
370
+ default:
371
+ return e.dayPeriod(a, {
372
+ width: "wide",
373
+ context: "formatting"
374
+ });
375
+ }
376
+ },
377
+ // in the morning, in the afternoon, in the evening, at night
378
+ B: function(n, r, e) {
379
+ const t = n.getHours();
380
+ let a;
381
+ switch (t >= 17 ? a = s.evening : t >= 12 ? a = s.afternoon : t >= 4 ? a = s.morning : a = s.night, r) {
382
+ case "B":
383
+ case "BB":
384
+ case "BBB":
385
+ return e.dayPeriod(a, {
386
+ width: "abbreviated",
387
+ context: "formatting"
388
+ });
389
+ case "BBBBB":
390
+ return e.dayPeriod(a, {
391
+ width: "narrow",
392
+ context: "formatting"
393
+ });
394
+ case "BBBB":
395
+ default:
396
+ return e.dayPeriod(a, {
397
+ width: "wide",
398
+ context: "formatting"
399
+ });
400
+ }
401
+ },
402
+ // Hour [1-12]
403
+ h: function(n, r, e) {
404
+ if (r === "ho") {
405
+ let t = n.getHours() % 12;
406
+ return t === 0 && (t = 12), e.ordinalNumber(t, { unit: "hour" });
407
+ }
408
+ return u.h(n, r);
409
+ },
410
+ // Hour [0-23]
411
+ H: function(n, r, e) {
412
+ return r === "Ho" ? e.ordinalNumber(n.getHours(), { unit: "hour" }) : u.H(n, r);
413
+ },
414
+ // Hour [0-11]
415
+ K: function(n, r, e) {
416
+ const t = n.getHours() % 12;
417
+ return r === "Ko" ? e.ordinalNumber(t, { unit: "hour" }) : i(t, r.length);
418
+ },
419
+ // Hour [1-24]
420
+ k: function(n, r, e) {
421
+ let t = n.getHours();
422
+ return t === 0 && (t = 24), r === "ko" ? e.ordinalNumber(t, { unit: "hour" }) : i(t, r.length);
423
+ },
424
+ // Minute
425
+ m: function(n, r, e) {
426
+ return r === "mo" ? e.ordinalNumber(n.getMinutes(), { unit: "minute" }) : u.m(n, r);
427
+ },
428
+ // Second
429
+ s: function(n, r, e) {
430
+ return r === "so" ? e.ordinalNumber(n.getSeconds(), { unit: "second" }) : u.s(n, r);
431
+ },
432
+ // Fraction of second
433
+ S: function(n, r) {
434
+ return u.S(n, r);
435
+ },
436
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
437
+ X: function(n, r, e) {
438
+ const t = n.getTimezoneOffset();
439
+ if (t === 0)
440
+ return "Z";
441
+ switch (r) {
442
+ case "X":
443
+ return f(t);
444
+ case "XXXX":
445
+ case "XX":
446
+ return c(t);
447
+ case "XXXXX":
448
+ case "XXX":
449
+ default:
450
+ return c(t, ":");
451
+ }
452
+ },
453
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
454
+ x: function(n, r, e) {
455
+ const t = n.getTimezoneOffset();
456
+ switch (r) {
457
+ case "x":
458
+ return f(t);
459
+ case "xxxx":
460
+ case "xx":
461
+ return c(t);
462
+ case "xxxxx":
463
+ case "xxx":
464
+ default:
465
+ return c(t, ":");
466
+ }
467
+ },
468
+ // Timezone (GMT)
469
+ O: function(n, r, e) {
470
+ const t = n.getTimezoneOffset();
471
+ switch (r) {
472
+ case "O":
473
+ case "OO":
474
+ case "OOO":
475
+ return "GMT" + d(t, ":");
476
+ case "OOOO":
477
+ default:
478
+ return "GMT" + c(t, ":");
479
+ }
480
+ },
481
+ // Timezone (specific non-location)
482
+ z: function(n, r, e) {
483
+ const t = n.getTimezoneOffset();
484
+ switch (r) {
485
+ case "z":
486
+ case "zz":
487
+ case "zzz":
488
+ return "GMT" + d(t, ":");
489
+ case "zzzz":
490
+ default:
491
+ return "GMT" + c(t, ":");
492
+ }
493
+ },
494
+ // Seconds timestamp
495
+ t: function(n, r, e) {
496
+ const t = Math.trunc(n.getTime() / 1e3);
497
+ return i(t, r.length);
498
+ },
499
+ // Milliseconds timestamp
500
+ T: function(n, r, e) {
501
+ const t = n.getTime();
502
+ return i(t, r.length);
503
+ }
504
+ };
505
+ function d(n, r = "") {
506
+ const e = n > 0 ? "-" : "+", t = Math.abs(n), a = Math.trunc(t / 60), o = t % 60;
507
+ return o === 0 ? e + String(a) : e + String(a) + r + i(o, 2);
508
+ }
509
+ function f(n, r) {
510
+ return n % 60 === 0 ? (n > 0 ? "-" : "+") + i(Math.abs(n) / 60, 2) : c(n, r);
511
+ }
512
+ function c(n, r = "") {
513
+ const e = n > 0 ? "-" : "+", t = Math.abs(n), a = i(Math.trunc(t / 60), 2), o = i(t % 60, 2);
514
+ return e + a + r + o;
515
+ }
516
+ export {
517
+ L as formatters
518
+ };
@@ -0,0 +1,59 @@
1
+ import { addLeadingZeros as n } from "../addLeadingZeros.js";
2
+ const g = {
3
+ // Year
4
+ y(e, t) {
5
+ const r = e.getFullYear(), a = r > 0 ? r : 1 - r;
6
+ return n(t === "yy" ? a % 100 : a, t.length);
7
+ },
8
+ // Month
9
+ M(e, t) {
10
+ const r = e.getMonth();
11
+ return t === "M" ? String(r + 1) : n(r + 1, 2);
12
+ },
13
+ // Day of the month
14
+ d(e, t) {
15
+ return n(e.getDate(), t.length);
16
+ },
17
+ // AM or PM
18
+ a(e, t) {
19
+ const r = e.getHours() / 12 >= 1 ? "pm" : "am";
20
+ switch (t) {
21
+ case "a":
22
+ case "aa":
23
+ return r.toUpperCase();
24
+ case "aaa":
25
+ return r;
26
+ case "aaaaa":
27
+ return r[0];
28
+ case "aaaa":
29
+ default:
30
+ return r === "am" ? "a.m." : "p.m.";
31
+ }
32
+ },
33
+ // Hour [1-12]
34
+ h(e, t) {
35
+ return n(e.getHours() % 12 || 12, t.length);
36
+ },
37
+ // Hour [0-23]
38
+ H(e, t) {
39
+ return n(e.getHours(), t.length);
40
+ },
41
+ // Minute
42
+ m(e, t) {
43
+ return n(e.getMinutes(), t.length);
44
+ },
45
+ // Second
46
+ s(e, t) {
47
+ return n(e.getSeconds(), t.length);
48
+ },
49
+ // Fraction of second
50
+ S(e, t) {
51
+ const r = t.length, a = e.getMilliseconds(), s = Math.trunc(
52
+ a * Math.pow(10, r - 3)
53
+ );
54
+ return n(s, t.length);
55
+ }
56
+ };
57
+ export {
58
+ g as lightFormatters
59
+ };
@@ -0,0 +1,52 @@
1
+ const s = (t, e) => {
2
+ switch (t) {
3
+ case "P":
4
+ return e.date({ width: "short" });
5
+ case "PP":
6
+ return e.date({ width: "medium" });
7
+ case "PPP":
8
+ return e.date({ width: "long" });
9
+ case "PPPP":
10
+ default:
11
+ return e.date({ width: "full" });
12
+ }
13
+ }, c = (t, e) => {
14
+ switch (t) {
15
+ case "p":
16
+ return e.time({ width: "short" });
17
+ case "pp":
18
+ return e.time({ width: "medium" });
19
+ case "ppp":
20
+ return e.time({ width: "long" });
21
+ case "pppp":
22
+ default:
23
+ return e.time({ width: "full" });
24
+ }
25
+ }, P = (t, e) => {
26
+ const d = t.match(/(P+)(p+)?/) || [], a = d[1], r = d[2];
27
+ if (!r)
28
+ return s(t, e);
29
+ let i;
30
+ switch (a) {
31
+ case "P":
32
+ i = e.dateTime({ width: "short" });
33
+ break;
34
+ case "PP":
35
+ i = e.dateTime({ width: "medium" });
36
+ break;
37
+ case "PPP":
38
+ i = e.dateTime({ width: "long" });
39
+ break;
40
+ case "PPPP":
41
+ default:
42
+ i = e.dateTime({ width: "full" });
43
+ break;
44
+ }
45
+ return i.replace("{{date}}", s(a, e)).replace("{{time}}", c(r, e));
46
+ }, h = {
47
+ p: c,
48
+ P
49
+ };
50
+ export {
51
+ h as longFormatters
52
+ };
@@ -0,0 +1,18 @@
1
+ import { toDate as o } from "../toDate.js";
2
+ function l(t) {
3
+ const e = o(t), n = new Date(
4
+ Date.UTC(
5
+ e.getFullYear(),
6
+ e.getMonth(),
7
+ e.getDate(),
8
+ e.getHours(),
9
+ e.getMinutes(),
10
+ e.getSeconds(),
11
+ e.getMilliseconds()
12
+ )
13
+ );
14
+ return n.setUTCFullYear(e.getFullYear()), +t - +n;
15
+ }
16
+ export {
17
+ l as getTimezoneOffsetInMilliseconds
18
+ };
@@ -0,0 +1,21 @@
1
+ const r = /^D+$/, s = /^Y+$/, a = ["D", "DD", "YY", "YYYY"];
2
+ function i(e) {
3
+ return r.test(e);
4
+ }
5
+ function f(e) {
6
+ return s.test(e);
7
+ }
8
+ function d(e, o, n) {
9
+ const t = c(e, o, n);
10
+ if (console.warn(t), a.includes(e))
11
+ throw new RangeError(t);
12
+ }
13
+ function c(e, o, n) {
14
+ const t = e[0] === "Y" ? "years" : "days of the month";
15
+ return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${o}\`) for formatting ${t} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
16
+ }
17
+ export {
18
+ i as isProtectedDayOfYearToken,
19
+ f as isProtectedWeekYearToken,
20
+ d as warnOrThrowProtectedError
21
+ };
@@ -0,0 +1,20 @@
1
+ import { addDays as p } from "./addDays.js";
2
+ import { addMonths as D } from "./addMonths.js";
3
+ import { constructFrom as T } from "./constructFrom.js";
4
+ import { toDate as y } from "./toDate.js";
5
+ function w(o, r) {
6
+ const {
7
+ years: t = 0,
8
+ months: s = 0,
9
+ weeks: n = 0,
10
+ days: d = 0,
11
+ hours: c = 0,
12
+ minutes: m = 0,
13
+ seconds: i = 0
14
+ } = r, e = y(o), a = s || t ? D(e, s + t * 12) : e, f = d || n ? p(a, d + n * 7) : a, u = m + c * 60, h = (i + u * 60) * 1e3;
15
+ return T(o, f.getTime() + h);
16
+ }
17
+ export {
18
+ w as add,
19
+ w as default
20
+ };