@paperless/core 2.15.1 → 2.15.3

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 (89) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/build/{p-f2fbd6fa.js → p-3dd76a64.js} +1 -1
  3. package/dist/build/p-481a8ecd.entry.js +2 -0
  4. package/dist/build/p-481a8ecd.entry.js.map +1 -0
  5. package/dist/build/p-6aa5fec2.entry.js +2 -0
  6. package/dist/build/p-6aa5fec2.entry.js.map +1 -0
  7. package/dist/build/p-BYMwCs48.js +2 -0
  8. package/dist/build/p-BYMwCs48.js.map +1 -0
  9. package/dist/build/p-ab66da44.entry.js +2 -0
  10. package/dist/build/p-ab66da44.entry.js.map +1 -0
  11. package/dist/build/p-calendar.entry.esm.js.map +1 -1
  12. package/dist/build/p-datepicker.entry.esm.js.map +1 -1
  13. package/dist/build/p-table-column.entry.esm.js.map +1 -1
  14. package/dist/build/paperless.esm.js +1 -1
  15. package/dist/cjs/{index-Dt9qqH1T.js → index-BrXouTWt.js} +142 -2
  16. package/dist/cjs/index-BrXouTWt.js.map +1 -0
  17. package/dist/cjs/loader.cjs.js +1 -1
  18. package/dist/cjs/p-calendar.cjs.entry.js +32 -165
  19. package/dist/cjs/p-calendar.cjs.entry.js.map +1 -1
  20. package/dist/cjs/p-calendar.entry.cjs.js.map +1 -1
  21. package/dist/cjs/p-datepicker.cjs.entry.js +23 -14
  22. package/dist/cjs/p-datepicker.cjs.entry.js.map +1 -1
  23. package/dist/cjs/p-datepicker.entry.cjs.js.map +1 -1
  24. package/dist/cjs/p-table-column.cjs.entry.js +4 -0
  25. package/dist/cjs/p-table-column.cjs.entry.js.map +1 -1
  26. package/dist/cjs/p-table-column.entry.cjs.js.map +1 -1
  27. package/dist/cjs/paperless.cjs.js +1 -1
  28. package/dist/collection/components/helpers/table/column/table-column.component.js +24 -0
  29. package/dist/collection/components/helpers/table/column/table-column.component.js.map +1 -1
  30. package/dist/collection/components/molecules/calendar/calendar.component.js +17 -14
  31. package/dist/collection/components/molecules/calendar/calendar.component.js.map +1 -1
  32. package/dist/collection/components/molecules/datepicker/datepicker.component.js +31 -17
  33. package/dist/collection/components/molecules/datepicker/datepicker.component.js.map +1 -1
  34. package/dist/components/{p-DyYAbzNn.js → p-CLnjjZGE.js} +16 -13
  35. package/dist/components/p-CLnjjZGE.js.map +1 -0
  36. package/dist/components/p-calendar.js +1 -1
  37. package/dist/components/p-datepicker.js +23 -14
  38. package/dist/components/p-datepicker.js.map +1 -1
  39. package/dist/components/p-table-column.js +5 -0
  40. package/dist/components/p-table-column.js.map +1 -1
  41. package/dist/esm/{index-EKSDxqjG.js → index-BYMwCs48.js} +139 -3
  42. package/dist/esm/index-BYMwCs48.js.map +1 -0
  43. package/dist/esm/loader.js +1 -1
  44. package/dist/esm/p-calendar.entry.js +14 -147
  45. package/dist/esm/p-calendar.entry.js.map +1 -1
  46. package/dist/esm/p-datepicker.entry.js +23 -14
  47. package/dist/esm/p-datepicker.entry.js.map +1 -1
  48. package/dist/esm/p-table-column.entry.js +4 -0
  49. package/dist/esm/p-table-column.entry.js.map +1 -1
  50. package/dist/esm/paperless.js +1 -1
  51. package/dist/index.html +1 -1
  52. package/dist/paperless/p-481a8ecd.entry.js +2 -0
  53. package/dist/paperless/p-481a8ecd.entry.js.map +1 -0
  54. package/dist/paperless/p-6aa5fec2.entry.js +2 -0
  55. package/dist/paperless/p-6aa5fec2.entry.js.map +1 -0
  56. package/dist/paperless/p-BYMwCs48.js +2 -0
  57. package/dist/paperless/p-BYMwCs48.js.map +1 -0
  58. package/dist/paperless/p-ab66da44.entry.js +2 -0
  59. package/dist/paperless/p-ab66da44.entry.js.map +1 -0
  60. package/dist/paperless/p-calendar.entry.esm.js.map +1 -1
  61. package/dist/paperless/p-datepicker.entry.esm.js.map +1 -1
  62. package/dist/paperless/p-table-column.entry.esm.js.map +1 -1
  63. package/dist/paperless/paperless.esm.js +1 -1
  64. package/dist/sw.js +1 -1
  65. package/dist/sw.js.map +1 -1
  66. package/dist/types/components/helpers/table/column/table-column.component.d.ts +4 -0
  67. package/dist/types/components/molecules/calendar/calendar.component.d.ts +2 -2
  68. package/dist/types/components/molecules/datepicker/datepicker.component.d.ts +5 -4
  69. package/dist/types/components.d.ts +16 -8
  70. package/package.json +1 -1
  71. package/dist/build/p-967f355d.entry.js +0 -2
  72. package/dist/build/p-967f355d.entry.js.map +0 -1
  73. package/dist/build/p-EKSDxqjG.js +0 -2
  74. package/dist/build/p-EKSDxqjG.js.map +0 -1
  75. package/dist/build/p-c8c51618.entry.js +0 -2
  76. package/dist/build/p-c8c51618.entry.js.map +0 -1
  77. package/dist/build/p-e55045a4.entry.js +0 -2
  78. package/dist/build/p-e55045a4.entry.js.map +0 -1
  79. package/dist/cjs/index-Dt9qqH1T.js.map +0 -1
  80. package/dist/components/p-DyYAbzNn.js.map +0 -1
  81. package/dist/esm/index-EKSDxqjG.js.map +0 -1
  82. package/dist/paperless/p-967f355d.entry.js +0 -2
  83. package/dist/paperless/p-967f355d.entry.js.map +0 -1
  84. package/dist/paperless/p-EKSDxqjG.js +0 -2
  85. package/dist/paperless/p-EKSDxqjG.js.map +0 -1
  86. package/dist/paperless/p-c8c51618.entry.js +0 -2
  87. package/dist/paperless/p-c8c51618.entry.js.map +0 -1
  88. package/dist/paperless/p-e55045a4.entry.js +0 -2
  89. package/dist/paperless/p-e55045a4.entry.js.map +0 -1
@@ -34,6 +34,10 @@ const TableColumn = /*@__PURE__*/ proxyCustomElement(class TableColumn extends H
34
34
  * The alignment of the column
35
35
  */
36
36
  align = 'start';
37
+ /**
38
+ * Wether the column should be sticky (Only works on angular variant of table)
39
+ */
40
+ sticky = false;
37
41
  /**
38
42
  * Parsed sizes based on the complete set of columns
39
43
  */
@@ -60,6 +64,7 @@ const TableColumn = /*@__PURE__*/ proxyCustomElement(class TableColumn extends H
60
64
  "useSlot": [1540, "use-slot"],
61
65
  "hasCheckbox": [1540, "has-checkbox"],
62
66
  "align": [1537],
67
+ "sticky": [1540],
63
68
  "parsedSizes": [1040, "parsed-sizes"],
64
69
  "sizes": [1032]
65
70
  }]);
@@ -1 +1 @@
1
- {"file":"p-table-column.js","mappings":";;MAMa,WAAW,iBAAAA,kBAAA,CAAA,MAAA,WAAA,SAAAC,CAAA,CAAA;;;;;;AACvB;;AAEG;AACqC,IAAA,IAAI;AAE5C;;AAEG;IACqC,OAAO,GAG9B,SAAS;AAE1B;;AAEG;AACqC,IAAA,IAAI;AAE5C;;AAEG;IACqC,IAAI,GAAY,KAAK;AAE7D;;AAEG;IACqC,OAAO,GAAY,KAAK;AAEhE;;AAEG;IACqC,WAAW,GAAY,KAAK;AAEpE;;AAEG;IACqC,KAAK,GAC5C,OAAO;AAER;;AAEG;AACqC,IAAA,WAAW;AAInD;;AAEG;IACsB,KAAK,GAKR,MAAM;AAE5B;;AAEG;AAEH,IAAA,sBAAsB;IAEtB,kBAAkB,GAAA;AACjB,QAAA,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC;;IAGvC,MAAM,GAAA;QACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/helpers/table/column/table-column.component.tsx"],"sourcesContent":["import { Component, Event, EventEmitter, Prop } from '@stencil/core';\nimport { TableColumnSizes } from '../../../../types/table';\n\n@Component({\n\ttag: 'p-table-column',\n})\nexport class TableColumn {\n\t/**\n\t * The path of the value of the item you want to display\n\t */\n\t@Prop({ reflect: true, mutable: true }) path: string;\n\n\t/**\n\t * The variant of the column\n\t */\n\t@Prop({ reflect: true, mutable: true }) variant:\n\t\t| 'subject'\n\t\t| 'default'\n\t\t| 'highlight' = 'default';\n\n\t/**\n\t * The name of the column\n\t */\n\t@Prop({ reflect: true, mutable: true }) name: string;\n\n\t/**\n\t * Wether the column should be flex\n\t */\n\t@Prop({ reflect: true, mutable: true }) flex: boolean = false;\n\n\t/**\n\t * Wether the column should use the slot\n\t */\n\t@Prop({ reflect: true, mutable: true }) useSlot: boolean = false;\n\n\t/**\n\t * Wether the column should have a checkbox\n\t */\n\t@Prop({ reflect: true, mutable: true }) hasCheckbox: boolean = false;\n\n\t/**\n\t * The alignment of the column\n\t */\n\t@Prop({ reflect: true, mutable: true }) align: 'start' | 'center' | 'end' =\n\t\t'start';\n\n\t/**\n\t * Parsed sizes based on the complete set of columns\n\t */\n\t@Prop({ reflect: true, mutable: true }) parsedSizes:\n\t\t| TableColumnSizes\n\t\t| undefined;\n\n\t/**\n\t * The sizes of the column\n\t */\n\t@Prop({ mutable: true }) sizes:\n\t\t| 'auto'\n\t\t| 'hidden'\n\t\t| 'full'\n\t\t| number\n\t\t| TableColumnSizes = 'auto';\n\n\t/**\n\t * Event to let the table know it has to re render\n\t */\n\t@Event({ bubbles: true, composed: true })\n\ttableDefinitionChanged: EventEmitter<boolean>;\n\n\tcomponentDidUpdate() {\n\t\tthis.tableDefinitionChanged.emit(true);\n\t}\n\n\trender() {\n\t\treturn;\n\t}\n}\n"],"version":3}
1
+ {"file":"p-table-column.js","mappings":";;MAMa,WAAW,iBAAAA,kBAAA,CAAA,MAAA,WAAA,SAAAC,CAAA,CAAA;;;;;;AACvB;;AAEG;AACqC,IAAA,IAAI;AAE5C;;AAEG;IACqC,OAAO,GAG9B,SAAS;AAE1B;;AAEG;AACqC,IAAA,IAAI;AAE5C;;AAEG;IACqC,IAAI,GAAY,KAAK;AAE7D;;AAEG;IACqC,OAAO,GAAY,KAAK;AAEhE;;AAEG;IACqC,WAAW,GAAY,KAAK;AAEpE;;AAEG;IACqC,KAAK,GAC5C,OAAO;AAER;;AAEG;IACqC,MAAM,GAAY,KAAK;AAE/D;;AAEG;AACqC,IAAA,WAAW;AAInD;;AAEG;IACsB,KAAK,GAKR,MAAM;AAE5B;;AAEG;AAEH,IAAA,sBAAsB;IAEtB,kBAAkB,GAAA;AACjB,QAAA,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC;;IAGvC,MAAM,GAAA;QACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/helpers/table/column/table-column.component.tsx"],"sourcesContent":["import { Component, Event, EventEmitter, Prop } from '@stencil/core';\nimport { TableColumnSizes } from '../../../../types/table';\n\n@Component({\n\ttag: 'p-table-column',\n})\nexport class TableColumn {\n\t/**\n\t * The path of the value of the item you want to display\n\t */\n\t@Prop({ reflect: true, mutable: true }) path: string;\n\n\t/**\n\t * The variant of the column\n\t */\n\t@Prop({ reflect: true, mutable: true }) variant:\n\t\t| 'subject'\n\t\t| 'default'\n\t\t| 'highlight' = 'default';\n\n\t/**\n\t * The name of the column\n\t */\n\t@Prop({ reflect: true, mutable: true }) name: string;\n\n\t/**\n\t * Wether the column should be flex\n\t */\n\t@Prop({ reflect: true, mutable: true }) flex: boolean = false;\n\n\t/**\n\t * Wether the column should use the slot\n\t */\n\t@Prop({ reflect: true, mutable: true }) useSlot: boolean = false;\n\n\t/**\n\t * Wether the column should have a checkbox\n\t */\n\t@Prop({ reflect: true, mutable: true }) hasCheckbox: boolean = false;\n\n\t/**\n\t * The alignment of the column\n\t */\n\t@Prop({ reflect: true, mutable: true }) align: 'start' | 'center' | 'end' =\n\t\t'start';\n\n\t/**\n\t * Wether the column should be sticky (Only works on angular variant of table)\n\t */\n\t@Prop({ reflect: true, mutable: true }) sticky: boolean = false;\n\n\t/**\n\t * Parsed sizes based on the complete set of columns\n\t */\n\t@Prop({ reflect: true, mutable: true }) parsedSizes:\n\t\t| TableColumnSizes\n\t\t| undefined;\n\n\t/**\n\t * The sizes of the column\n\t */\n\t@Prop({ mutable: true }) sizes:\n\t\t| 'auto'\n\t\t| 'hidden'\n\t\t| 'full'\n\t\t| number\n\t\t| TableColumnSizes = 'auto';\n\n\t/**\n\t * Event to let the table know it has to re render\n\t */\n\t@Event({ bubbles: true, composed: true })\n\ttableDefinitionChanged: EventEmitter<boolean>;\n\n\tcomponentDidUpdate() {\n\t\tthis.tableDefinitionChanged.emit(true);\n\t}\n\n\trender() {\n\t\treturn;\n\t}\n}\n"],"version":3}
@@ -76,6 +76,65 @@ function toDate(argument) {
76
76
  }
77
77
  }
78
78
 
79
+ /**
80
+ * @name addMonths
81
+ * @category Month Helpers
82
+ * @summary Add the specified number of months to the given date.
83
+ *
84
+ * @description
85
+ * Add the specified number of months to the given date.
86
+ *
87
+ * @param {Date|Number} date - the date to be changed
88
+ * @param {Number} amount - the amount of months to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
89
+ * @returns {Date} the new date with the months added
90
+ * @throws {TypeError} 2 arguments required
91
+ *
92
+ * @example
93
+ * // Add 5 months to 1 September 2014:
94
+ * const result = addMonths(new Date(2014, 8, 1), 5)
95
+ * //=> Sun Feb 01 2015 00:00:00
96
+ */
97
+ function addMonths(dirtyDate, dirtyAmount) {
98
+ requiredArgs(2, arguments);
99
+ var date = toDate(dirtyDate);
100
+ var amount = toInteger(dirtyAmount);
101
+ if (isNaN(amount)) {
102
+ return new Date(NaN);
103
+ }
104
+ if (!amount) {
105
+ // If 0 months, no-op to avoid changing times in the hour before end of DST
106
+ return date;
107
+ }
108
+ var dayOfMonth = date.getDate();
109
+
110
+ // The JS Date object supports date math by accepting out-of-bounds values for
111
+ // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
112
+ // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
113
+ // want except that dates will wrap around the end of a month, meaning that
114
+ // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
115
+ // we'll default to the end of the desired month by adding 1 to the desired
116
+ // month and using a date of 0 to back up one day to the end of the desired
117
+ // month.
118
+ var endOfDesiredMonth = new Date(date.getTime());
119
+ endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);
120
+ var daysInMonth = endOfDesiredMonth.getDate();
121
+ if (dayOfMonth >= daysInMonth) {
122
+ // If we're already at the end of the month, then this is the correct date
123
+ // and we're done.
124
+ return endOfDesiredMonth;
125
+ } else {
126
+ // Otherwise, we now know that setting the original day-of-month value won't
127
+ // cause an overflow, so set the desired day-of-month. Note that we can't
128
+ // just set the date of `endOfDesiredMonth` because that object may have had
129
+ // its time changed in the unusual case where where a DST transition was on
130
+ // the last day of the month and its local time was in the hour skipped or
131
+ // repeated next to a DST transition. So we use `date` instead which is
132
+ // guaranteed to still have the original time.
133
+ date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);
134
+ return date;
135
+ }
136
+ }
137
+
79
138
  /**
80
139
  * @name isWeekend
81
140
  * @category Weekday Helpers
@@ -172,6 +231,30 @@ function startOfDay(dirtyDate) {
172
231
  return date;
173
232
  }
174
233
 
234
+ /**
235
+ * @name addYears
236
+ * @category Year Helpers
237
+ * @summary Add the specified number of years to the given date.
238
+ *
239
+ * @description
240
+ * Add the specified number of years to the given date.
241
+ *
242
+ * @param {Date|Number} date - the date to be changed
243
+ * @param {Number} amount - the amount of years to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
244
+ * @returns {Date} the new date with the years added
245
+ * @throws {TypeError} 2 arguments required
246
+ *
247
+ * @example
248
+ * // Add 5 years to 1 September 2014:
249
+ * const result = addYears(new Date(2014, 8, 1), 5)
250
+ * //=> Sun Sep 01 2019 00:00:00
251
+ */
252
+ function addYears(dirtyDate, dirtyAmount) {
253
+ requiredArgs(2, arguments);
254
+ var amount = toInteger(dirtyAmount);
255
+ return addMonths(dirtyDate, amount * 12);
256
+ }
257
+
175
258
  /**
176
259
  * @name isSameDay
177
260
  * @category Day Helpers
@@ -2293,6 +2376,28 @@ function cleanEscapedString(input) {
2293
2376
  return matched[1].replace(doubleQuoteRegExp, "'");
2294
2377
  }
2295
2378
 
2379
+ /**
2380
+ * @name getYear
2381
+ * @category Year Helpers
2382
+ * @summary Get the year of the given date.
2383
+ *
2384
+ * @description
2385
+ * Get the year of the given date.
2386
+ *
2387
+ * @param {Date|Number} date - the given date
2388
+ * @returns {Number} the year
2389
+ * @throws {TypeError} 1 argument required
2390
+ *
2391
+ * @example
2392
+ * // Which year is 2 July 2014?
2393
+ * const result = getYear(new Date(2014, 6, 2))
2394
+ * //=> 2014
2395
+ */
2396
+ function getYear(dirtyDate) {
2397
+ requiredArgs(1, arguments);
2398
+ return toDate(dirtyDate).getFullYear();
2399
+ }
2400
+
2296
2401
  /**
2297
2402
  * @name isAfter
2298
2403
  * @category Common Helpers
@@ -2343,6 +2448,37 @@ function isBefore(dirtyDate, dirtyDateToCompare) {
2343
2448
  return date.getTime() < dateToCompare.getTime();
2344
2449
  }
2345
2450
 
2451
+ /**
2452
+ * @name setYear
2453
+ * @category Year Helpers
2454
+ * @summary Set the year to the given date.
2455
+ *
2456
+ * @description
2457
+ * Set the year to the given date.
2458
+ *
2459
+ * @param {Date|Number} date - the date to be changed
2460
+ * @param {Number} year - the year of the new date
2461
+ * @returns {Date} the new date with the year set
2462
+ * @throws {TypeError} 2 arguments required
2463
+ *
2464
+ * @example
2465
+ * // Set year 2013 to 1 September 2014:
2466
+ * const result = setYear(new Date(2014, 8, 1), 2013)
2467
+ * //=> Sun Sep 01 2013 00:00:00
2468
+ */
2469
+ function setYear(dirtyDate, dirtyYear) {
2470
+ requiredArgs(2, arguments);
2471
+ var date = toDate(dirtyDate);
2472
+ var year = toInteger(dirtyYear);
2473
+
2474
+ // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
2475
+ if (isNaN(date.getTime())) {
2476
+ return new Date(NaN);
2477
+ }
2478
+ date.setFullYear(year);
2479
+ return date;
2480
+ }
2481
+
2346
2482
  var formatDistanceLocale = {
2347
2483
  lessThanXSeconds: {
2348
2484
  one: 'minder dan een seconde',
@@ -2676,7 +2812,7 @@ var locale = {
2676
2812
  }
2677
2813
  };
2678
2814
 
2679
- export { _typeof as _, startOfUTCISOWeek as a, getUTCWeek as b, toInteger as c, getUTCISOWeek as d, getDefaultOptions as e, longFormatters as f, getUTCWeekYear as g, subMilliseconds as h, getTimezoneOffsetInMilliseconds as i, isProtectedWeekYearToken as j, throwProtectedError as k, locale$1 as l, isProtectedDayOfYearToken as m, isValid as n, isBefore as o, isAfter as p, format as q, requiredArgs as r, startOfUTCWeek as s, toDate as t, locale as u, startOfDay as v, startOfMonth as w, isSameDay as x, isWeekend as y };
2680
- //# sourceMappingURL=index-EKSDxqjG.js.map
2815
+ export { getYear as A, setYear as B, addMonths as C, _typeof as _, startOfUTCISOWeek as a, getUTCWeek as b, toInteger as c, getUTCISOWeek as d, getDefaultOptions as e, longFormatters as f, getUTCWeekYear as g, subMilliseconds as h, getTimezoneOffsetInMilliseconds as i, isProtectedWeekYearToken as j, throwProtectedError as k, locale$1 as l, isProtectedDayOfYearToken as m, isValid as n, isBefore as o, isAfter as p, format as q, requiredArgs as r, startOfUTCWeek as s, toDate as t, locale as u, startOfDay as v, startOfMonth as w, isSameDay as x, isWeekend as y, addYears as z };
2816
+ //# sourceMappingURL=index-BYMwCs48.js.map
2681
2817
 
2682
- //# sourceMappingURL=index-EKSDxqjG.js.map
2818
+ //# sourceMappingURL=index-BYMwCs48.js.map