monkey-front-core 0.0.601 → 0.0.603

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.
@@ -1578,8 +1578,10 @@ function validateFullName(control) {
1578
1578
  if (!value)
1579
1579
  return null;
1580
1580
  const fullName = value.split(/\s+/);
1581
- const hasShortPart = fullName.some((part) => { return part.length < 2; });
1582
- if (fullName.length < 2 || hasShortPart) {
1581
+ const hasShortPart = fullName.filter((part) => {
1582
+ return part.length >= 2;
1583
+ }).length;
1584
+ if (hasShortPart < 2) {
1583
1585
  return { fullName: true };
1584
1586
  }
1585
1587
  return null;
@@ -4866,6 +4868,52 @@ class MonkeyEcxAlertsService {
4866
4868
  verticalPosition: 'top'
4867
4869
  });
4868
4870
  }
4871
+ showWithClose({ type = 'warning', title, message }) {
4872
+ const i18n = this.translateService.instant([
4873
+ `MECX-ALERTS.${type}`.toUpperCase(),
4874
+ 'MECX-ALERTS.BUTTONS'
4875
+ ]);
4876
+ this.snackbarService.show({
4877
+ title: i18n?.[`MECX-ALERTS.${type}`.toUpperCase()].TITLES?.[title],
4878
+ message: i18n?.[`MECX-ALERTS.${type}`.toUpperCase()].MESSAGES[message],
4879
+ type,
4880
+ keepOpen: true,
4881
+ horizontalPosition: 'center',
4882
+ verticalPosition: 'top',
4883
+ action: {
4884
+ cancel: {
4885
+ style: 'button',
4886
+ label: i18n?.['MECX-ALERTS.BUTTONS'].CLOSE,
4887
+ action: () => { }
4888
+ }
4889
+ }
4890
+ });
4891
+ }
4892
+ showWithActions({ type = 'warning', title, message, duration, keepOpen, action }) {
4893
+ const i18n = this.translateService.instant([
4894
+ `MECX-ALERTS.${type}`.toUpperCase(),
4895
+ 'MECX-ALERTS.BUTTONS'
4896
+ ]);
4897
+ action = {
4898
+ ...action,
4899
+ confirm: action.confirm
4900
+ ? { ...action.confirm, label: i18n?.['MECX-ALERTS.BUTTONS'][action.confirm.label] }
4901
+ : action.confirm,
4902
+ cancel: action.cancel
4903
+ ? { ...action.cancel, label: i18n?.['MECX-ALERTS.BUTTONS'][action.cancel.label] }
4904
+ : action.cancel
4905
+ };
4906
+ this.snackbarService.show({
4907
+ title: i18n?.[`MECX-ALERTS.${type}`.toUpperCase()].TITLES?.[title],
4908
+ message: i18n?.[`MECX-ALERTS.${type}`.toUpperCase()].MESSAGES[message],
4909
+ type,
4910
+ duration: duration || undefined,
4911
+ keepOpen: keepOpen || false,
4912
+ horizontalPosition: 'center',
4913
+ verticalPosition: 'top',
4914
+ action
4915
+ });
4916
+ }
4869
4917
  }
4870
4918
  MonkeyEcxAlertsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxAlertsService, deps: [{ token: i1.MonkeyStyleGuideSnackbarService }, { token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
4871
4919
  MonkeyEcxAlertsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxAlertsService, providedIn: 'root' });