@haiilo/catalyst 6.2.2 → 6.2.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 (81) hide show
  1. package/dist/catalyst/catalyst.css +6 -5
  2. package/dist/catalyst/catalyst.esm.js +1 -1
  3. package/dist/catalyst/catalyst.esm.js.map +1 -1
  4. package/dist/catalyst/p-0c98e803.entry.js +10 -0
  5. package/dist/catalyst/p-0c98e803.entry.js.map +1 -0
  6. package/dist/catalyst/scss/_mixins.scss +2 -1
  7. package/dist/catalyst/scss/_variables.scss +1 -8
  8. package/dist/catalyst/scss/core/_nav.scss +2 -3
  9. package/dist/catalyst/scss/utils/_layout.scss +7 -3
  10. package/dist/catalyst/scss/utils/_z-index.mixins.scss +7 -0
  11. package/dist/catalyst/scss/vendor/_flatpickr.scss +1 -1
  12. package/dist/cjs/cat-alert_25.cjs.entry.js +86 -69
  13. package/dist/cjs/cat-alert_25.cjs.entry.js.map +1 -1
  14. package/dist/cjs/catalyst.cjs.js +1 -1
  15. package/dist/cjs/loader.cjs.js +1 -1
  16. package/dist/collection/components/cat-button/cat-button.css +21 -5
  17. package/dist/collection/components/cat-button/cat-button.js +18 -2
  18. package/dist/collection/components/cat-button/cat-button.js.map +1 -1
  19. package/dist/collection/components/cat-button/cat-button.spec.js +3 -1
  20. package/dist/collection/components/cat-button/cat-button.spec.js.map +1 -1
  21. package/dist/collection/components/cat-datepicker/cat-datepicker.js +57 -37
  22. package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -1
  23. package/dist/collection/components/cat-dropdown/cat-dropdown.css +34 -11
  24. package/dist/collection/components/cat-form-group/cat-form-group.js +6 -6
  25. package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
  26. package/dist/collection/components/cat-input/cat-input.css +5 -0
  27. package/dist/collection/components/cat-input/cat-input.js +3 -3
  28. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  29. package/dist/collection/components/cat-select/cat-select.css +1 -1
  30. package/dist/collection/components/cat-select/cat-select.js +9 -9
  31. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  32. package/dist/collection/components/cat-tab/cat-tab.js +16 -0
  33. package/dist/collection/components/cat-tab/cat-tab.js.map +1 -1
  34. package/dist/collection/components/cat-tabs/cat-tabs.css +24 -2
  35. package/dist/collection/components/cat-tabs/cat-tabs.js +3 -3
  36. package/dist/collection/components/cat-tabs/cat-tabs.js.map +1 -1
  37. package/dist/collection/components/cat-textarea/cat-textarea.js +3 -3
  38. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
  39. package/dist/collection/components/cat-tooltip/cat-tooltip.css +1 -1
  40. package/dist/collection/scss/_mixins.scss +2 -1
  41. package/dist/collection/scss/_variables.scss +1 -8
  42. package/dist/collection/scss/core/_nav.scss +2 -3
  43. package/dist/collection/scss/utils/_layout.scss +7 -3
  44. package/dist/collection/scss/utils/_z-index.mixins.scss +7 -0
  45. package/dist/collection/scss/vendor/_flatpickr.scss +1 -1
  46. package/dist/components/cat-button2.js +5 -3
  47. package/dist/components/cat-button2.js.map +1 -1
  48. package/dist/components/cat-datepicker.js +52 -37
  49. package/dist/components/cat-datepicker.js.map +1 -1
  50. package/dist/components/cat-dropdown2.js +1 -1
  51. package/dist/components/cat-dropdown2.js.map +1 -1
  52. package/dist/components/cat-form-group.js +6 -6
  53. package/dist/components/cat-form-group.js.map +1 -1
  54. package/dist/components/cat-input2.js +4 -4
  55. package/dist/components/cat-input2.js.map +1 -1
  56. package/dist/components/cat-select2.js +10 -10
  57. package/dist/components/cat-select2.js.map +1 -1
  58. package/dist/components/cat-tab.js +3 -1
  59. package/dist/components/cat-tab.js.map +1 -1
  60. package/dist/components/cat-tabs.js +4 -4
  61. package/dist/components/cat-tabs.js.map +1 -1
  62. package/dist/components/cat-textarea.js +3 -3
  63. package/dist/components/cat-textarea.js.map +1 -1
  64. package/dist/components/cat-tooltip.js +1 -1
  65. package/dist/components/cat-tooltip.js.map +1 -1
  66. package/dist/esm/cat-alert_25.entry.js +86 -69
  67. package/dist/esm/cat-alert_25.entry.js.map +1 -1
  68. package/dist/esm/catalyst.js +1 -1
  69. package/dist/esm/loader.js +1 -1
  70. package/dist/types/components/cat-button/cat-button.d.ts +6 -0
  71. package/dist/types/components/cat-datepicker/cat-datepicker.d.ts +3 -0
  72. package/dist/types/components/cat-form-group/cat-form-group.d.ts +2 -2
  73. package/dist/types/components/cat-input/cat-input.d.ts +1 -1
  74. package/dist/types/components/cat-select/cat-select.d.ts +4 -4
  75. package/dist/types/components/cat-tab/cat-tab.d.ts +6 -0
  76. package/dist/types/components/cat-tabs/cat-tabs.d.ts +1 -1
  77. package/dist/types/components/cat-textarea/cat-textarea.d.ts +1 -1
  78. package/dist/types/components.d.ts +16 -0
  79. package/package.json +2 -2
  80. package/dist/catalyst/p-cd1f4492.entry.js +0 -10
  81. package/dist/catalyst/p-cd1f4492.entry.js.map +0 -1
@@ -2765,39 +2765,22 @@ const CatDatepickerFlat = /*@__PURE__*/ proxyCustomElement(class CatDatepickerFl
2765
2765
  get input() {
2766
2766
  return this._input?.shadowRoot?.querySelector('input') ?? undefined;
2767
2767
  }
2768
+ onValueChanged(value) {
2769
+ if (value) {
2770
+ this.pickr?.setDate(value, false);
2771
+ this.catChange.emit(value);
2772
+ }
2773
+ else {
2774
+ this.pickr?.clear(false);
2775
+ this.catChange.emit(undefined);
2776
+ }
2777
+ }
2778
+ onDisabledChaned(value) {
2779
+ this.pickr?.set('clickOpens', !value);
2780
+ }
2768
2781
  componentDidLoad() {
2769
- const input = this.input;
2770
- if (input) {
2771
- const locale = getLocale(catI18nRegistry.getLocale());
2772
- const format = getFormat(catI18nRegistry.getLocale(), this.mode);
2773
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2774
- const plugins = this.mode === 'week' ? [new weekSelect({})] : [];
2775
- this.pickr = flatpickr(input, {
2776
- locale,
2777
- plugins,
2778
- altInput: true,
2779
- prevArrow: '←',
2780
- nextArrow: '→',
2781
- dateFormat: this.dateFormat,
2782
- altFormat: format,
2783
- ariaDateFormat: format,
2784
- mode: this.mode === 'daterange' ? 'range' : 'single',
2785
- minDate: this.min,
2786
- maxDate: this.max,
2787
- enableTime: this.mode === 'time' || this.mode === 'datetime',
2788
- noCalendar: this.mode === 'time',
2789
- weekNumbers: true,
2790
- minuteIncrement: this.step,
2791
- onChange: (dates, dateStr, flatpickr) => {
2792
- if (this.mode === 'week') {
2793
- this.value = dates[0] ? flatpickr.config.getWeek(dates[0]).toString() : undefined;
2794
- }
2795
- else {
2796
- this.value = dateStr;
2797
- }
2798
- this.catChange.emit(this.value);
2799
- }
2800
- });
2782
+ if (this.input) {
2783
+ this.pickr = this.initDatepicker(this.input);
2801
2784
  }
2802
2785
  }
2803
2786
  /**
@@ -2820,11 +2803,7 @@ const CatDatepickerFlat = /*@__PURE__*/ proxyCustomElement(class CatDatepickerFl
2820
2803
  render() {
2821
2804
  return (h("cat-input", { ref: el => (this._input = el), requiredMarker: this.requiredMarker, horizontal: this.horizontal, autoComplete: this.autoComplete, clearable: this.clearable, disabled: this.disabled, hint: this.hint, icon: this.icon, iconRight: this.iconRight, identifier: this.identifier, label: this.label, labelHidden: this.labelHidden, name: this.name, placeholder: this.placeholder, textPrefix: this.textPrefix, textSuffix: this.textSuffix, readonly: this.readonly, required: this.required, value: this.value, errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, onCatChange: e => {
2822
2805
  e.stopPropagation();
2823
- this.pickr?.setDate(e.detail);
2824
- if (this.value !== (e.detail || undefined)) {
2825
- this.value = e.detail || undefined;
2826
- this.catChange.emit(this.value);
2827
- }
2806
+ this.value = e.detail || undefined;
2828
2807
  }, onCatFocus: e => {
2829
2808
  e.stopPropagation();
2830
2809
  this.catFocus.emit(e.detail);
@@ -2833,6 +2812,38 @@ const CatDatepickerFlat = /*@__PURE__*/ proxyCustomElement(class CatDatepickerFl
2833
2812
  this.catBlur.emit(e.detail);
2834
2813
  } }));
2835
2814
  }
2815
+ initDatepicker(input) {
2816
+ const locale = getLocale(catI18nRegistry.getLocale());
2817
+ const format = getFormat(catI18nRegistry.getLocale(), this.mode);
2818
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2819
+ const plugins = this.mode === 'week' ? [new weekSelect({})] : [];
2820
+ return flatpickr(input, {
2821
+ locale,
2822
+ plugins,
2823
+ altInput: true,
2824
+ prevArrow: '←',
2825
+ nextArrow: '→',
2826
+ dateFormat: this.dateFormat,
2827
+ altFormat: format,
2828
+ ariaDateFormat: format,
2829
+ mode: this.mode === 'daterange' ? 'range' : 'single',
2830
+ minDate: this.min,
2831
+ maxDate: this.max,
2832
+ enableTime: this.mode === 'time' || this.mode === 'datetime',
2833
+ noCalendar: this.mode === 'time',
2834
+ weekNumbers: true,
2835
+ minuteIncrement: this.step,
2836
+ clickOpens: !this.disabled,
2837
+ onChange: (dates, dateStr, flatpickr) => {
2838
+ if (this.mode === 'week') {
2839
+ this.value = dates[0] ? flatpickr.config.getWeek(dates[0]).toString() : undefined;
2840
+ }
2841
+ else {
2842
+ this.value = dateStr || undefined;
2843
+ }
2844
+ }
2845
+ });
2846
+ }
2836
2847
  get dateFormat() {
2837
2848
  if (this.mode === 'week') {
2838
2849
  return 'W';
@@ -2844,6 +2855,10 @@ const CatDatepickerFlat = /*@__PURE__*/ proxyCustomElement(class CatDatepickerFl
2844
2855
  return 'Z';
2845
2856
  }
2846
2857
  }
2858
+ static get watchers() { return {
2859
+ "value": ["onValueChanged"],
2860
+ "disabled": ["onDisabledChaned"]
2861
+ }; }
2847
2862
  static get style() { return catDatepickerCss; }
2848
2863
  }, [1, "cat-datepicker", {
2849
2864
  "requiredMarker": [1, "required-marker"],