@haiilo/catalyst 6.4.1 → 6.4.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 (50) hide show
  1. package/dist/catalyst/catalyst.esm.js +1 -1
  2. package/dist/catalyst/catalyst.esm.js.map +1 -1
  3. package/dist/catalyst/index.esm.js +2 -2
  4. package/dist/catalyst/p-8929f28a.js +2 -0
  5. package/dist/catalyst/p-8929f28a.js.map +1 -0
  6. package/dist/catalyst/{p-d3a118b5.entry.js → p-c48f897d.entry.js} +2 -2
  7. package/dist/catalyst/p-c48f897d.entry.js.map +1 -0
  8. package/dist/catalyst/{p-12fa3edc.js → p-f0bcebed.js} +1 -1
  9. package/dist/catalyst/{p-12fa3edc.js.map → p-f0bcebed.js.map} +1 -1
  10. package/dist/cjs/cat-alert_26.cjs.entry.js +26 -5
  11. package/dist/cjs/cat-alert_26.cjs.entry.js.map +1 -1
  12. package/dist/cjs/catalyst.cjs.js +2 -2
  13. package/dist/cjs/catalyst.cjs.js.map +1 -1
  14. package/dist/cjs/{index-b4391019.js → index-6ec4ef6d.js} +1 -1
  15. package/dist/cjs/{index-b4391019.js.map → index-6ec4ef6d.js.map} +1 -1
  16. package/dist/cjs/index.cjs.js +1 -1
  17. package/dist/cjs/loader.cjs.js +1 -1
  18. package/dist/cjs/{of-d9fa1990.js → of-eda6baf8.js} +9 -2
  19. package/dist/cjs/of-eda6baf8.js.map +1 -0
  20. package/dist/collection/collection-manifest.json +1 -1
  21. package/dist/collection/components/cat-datepicker/cat-datepicker.config.js +21 -2
  22. package/dist/collection/components/cat-datepicker/cat-datepicker.config.js.map +1 -1
  23. package/dist/collection/components/cat-datepicker/cat-datepicker.js +3 -1
  24. package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -1
  25. package/dist/collection/components/cat-i18n/cat-i18n-registry.js +8 -1
  26. package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -1
  27. package/dist/components/cat-datepicker.js +3 -1
  28. package/dist/components/cat-datepicker.js.map +1 -1
  29. package/dist/components/cat-datepicker.locale.js +21 -2
  30. package/dist/components/cat-datepicker.locale.js.map +1 -1
  31. package/dist/components/cat-i18n-registry.js +8 -1
  32. package/dist/components/cat-i18n-registry.js.map +1 -1
  33. package/dist/esm/cat-alert_26.entry.js +26 -5
  34. package/dist/esm/cat-alert_26.entry.js.map +1 -1
  35. package/dist/esm/catalyst.js +3 -3
  36. package/dist/esm/catalyst.js.map +1 -1
  37. package/dist/esm/{index-2c703aa8.js → index-b424aa97.js} +1 -1
  38. package/dist/esm/{index-2c703aa8.js.map → index-b424aa97.js.map} +1 -1
  39. package/dist/esm/index.js +2 -2
  40. package/dist/esm/loader.js +2 -2
  41. package/dist/esm/{of-5472d434.js → of-246f9b35.js} +9 -2
  42. package/dist/esm/of-246f9b35.js.map +1 -0
  43. package/dist/types/components/cat-i18n/cat-i18n-registry.d.ts +1 -1
  44. package/dist/types/stencil-public-runtime.d.ts +6 -0
  45. package/package.json +9 -9
  46. package/dist/catalyst/p-d3a118b5.entry.js.map +0 -1
  47. package/dist/catalyst/p-dd8ae83e.js +0 -2
  48. package/dist/catalyst/p-dd8ae83e.js.map +0 -1
  49. package/dist/cjs/of-d9fa1990.js.map +0 -1
  50. package/dist/esm/of-5472d434.js.map +0 -1
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-b4391019.js');
6
- const of = require('./of-d9fa1990.js');
5
+ const index = require('./index-6ec4ef6d.js');
6
+ const of = require('./of-eda6baf8.js');
7
7
 
8
8
  const ObjectUnsubscribedError = of.createErrorClass((_super) => function ObjectUnsubscribedErrorImpl() {
9
9
  _super(this);
@@ -3999,6 +3999,7 @@ var weekSelect = of.createCommonjsModule(function (module, exports) {
3999
3999
  function getConfig(options, more = {}) {
4000
4000
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4001
4001
  const plugins = options.mode === 'week' ? [new weekSelect({})] : [];
4002
+ const format = dateFormat(options.mode);
4002
4003
  return {
4003
4004
  ...more,
4004
4005
  locale: options.locale,
@@ -4006,7 +4007,7 @@ function getConfig(options, more = {}) {
4006
4007
  altInput: true,
4007
4008
  prevArrow: '←',
4008
4009
  nextArrow: '→',
4009
- dateFormat: dateFormat(options.mode),
4010
+ dateFormat: format,
4010
4011
  altFormat: options.format,
4011
4012
  ariaDateFormat: options.format,
4012
4013
  mode: options.mode === 'daterange' ? 'range' : 'single',
@@ -4023,9 +4024,27 @@ function getConfig(options, more = {}) {
4023
4024
  flatpickr.calendarContainer.setAttribute(key, value);
4024
4025
  }
4025
4026
  },
4027
+ onClose: function (dates, _dateStr, instance) {
4028
+ if (options.mode === 'daterange' && dates.length < 2) {
4029
+ instance.clear();
4030
+ }
4031
+ },
4026
4032
  onChange: (dates, dateStr, flatpickr) => {
4027
4033
  let value = dateStr || undefined;
4028
- if (options.mode === 'week') {
4034
+ if (options.mode === 'daterange') {
4035
+ if (dates.length < 2) {
4036
+ return;
4037
+ }
4038
+ else {
4039
+ const start = dates[0];
4040
+ const end = dates[1];
4041
+ end.setHours(23);
4042
+ end.setMinutes(59);
4043
+ end.setSeconds(59);
4044
+ value = `${flatpickr.formatDate(start, format)} - ${flatpickr.formatDate(end, format)}`;
4045
+ }
4046
+ }
4047
+ else if (options.mode === 'week') {
4029
4048
  value = dates[0] ? flatpickr.config.getWeek(dates[0]).toString() : undefined;
4030
4049
  }
4031
4050
  options.applyChange(value);
@@ -4157,7 +4176,9 @@ const CatDatepickerFlat = class {
4157
4176
  onValueChanged(value) {
4158
4177
  if (value) {
4159
4178
  this.pickr?.setDate(value, false);
4160
- this.catChange.emit(value);
4179
+ if (this.mode !== 'daterange' || value.includes(' - ')) {
4180
+ this.catChange.emit(value);
4181
+ }
4161
4182
  }
4162
4183
  else {
4163
4184
  this.pickr?.clear(false);