mn-angular-lib 0.0.77 → 0.0.79

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.
@@ -2007,7 +2007,21 @@ class MnDatetime {
2007
2007
  }
2008
2008
  // ========== ControlValueAccessor Implementation ==========
2009
2009
  writeValue(val) {
2010
- this.value = val != null ? String(val) : null;
2010
+ if (val != null) {
2011
+ let str = String(val);
2012
+ // Convert ISO 8601 strings (e.g. "2025-01-01T10:00:00.000Z") to datetime-local format
2013
+ if (str.includes('T') && (str.endsWith('Z') || /[+-]\d{2}:\d{2}$/.test(str))) {
2014
+ const date = new Date(str);
2015
+ if (!isNaN(date.getTime())) {
2016
+ const pad = (n) => n.toString().padStart(2, '0');
2017
+ str = `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(date.getMinutes())}`;
2018
+ }
2019
+ }
2020
+ this.value = str;
2021
+ }
2022
+ else {
2023
+ this.value = null;
2024
+ }
2011
2025
  }
2012
2026
  registerOnChange(fn) {
2013
2027
  this.onChange = fn;
@@ -4454,6 +4468,12 @@ class MnWizardBodyComponent {
4454
4468
  return;
4455
4469
  if (step.id === this.currentStepId)
4456
4470
  return;
4471
+ // Validate current step's form before allowing direct step navigation
4472
+ const formBody = this.getCurrentFormBody();
4473
+ if (formBody && formBody.form.invalid) {
4474
+ formBody.form.markAllAsTouched();
4475
+ return;
4476
+ }
4457
4477
  const previousStepId = this.currentStepId;
4458
4478
  this.currentStepId = step.id;
4459
4479
  if (!this.visitedStepIds.includes(this.currentStepId)) {
@@ -4615,6 +4635,36 @@ class MnWizardBodyComponent {
4615
4635
  });
4616
4636
  return aggregated;
4617
4637
  }
4638
+ /**
4639
+ * Maps a footer action's ActionStyle to mnButton data props.
4640
+ * @param action The footer action configuration.
4641
+ */
4642
+ getFooterActionButtonData(action) {
4643
+ switch (action.style) {
4644
+ case ActionStyle.DANGER:
4645
+ return { variant: 'outline', color: 'error' };
4646
+ case ActionStyle.PRIMARY:
4647
+ return { variant: 'fill', color: 'primary' };
4648
+ case ActionStyle.SECONDARY:
4649
+ return { variant: 'outline', color: 'secondary' };
4650
+ case ActionStyle.GHOST:
4651
+ return { variant: 'ghost', color: 'secondary' };
4652
+ default:
4653
+ return { variant: 'outline', color: 'secondary' };
4654
+ }
4655
+ }
4656
+ /**
4657
+ * Handles a custom footer action click.
4658
+ * @param action The footer action configuration.
4659
+ */
4660
+ async handleFooterAction(action) {
4661
+ if (action.handler) {
4662
+ await action.handler(this.modalRef);
4663
+ }
4664
+ if (action.closesModal) {
4665
+ this.modalRef.close((action.closeReason || ModalCloseReason.PROGRAMMATIC));
4666
+ }
4667
+ }
4618
4668
  async notifyStepChange(previousStepId, direction) {
4619
4669
  if (this.config.onStepChange) {
4620
4670
  await this.config.onStepChange.handle({