@softheon/armature 15.16.2 → 15.18.0

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.
@@ -3582,6 +3582,91 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
3582
3582
  args: ["input", ["$event.type", "$event.target.value"]]
3583
3583
  }] } });
3584
3584
 
3585
+ /**
3586
+ * The letters and special characters directive
3587
+ */
3588
+ class LettersCharactersDirective {
3589
+ /**
3590
+ * Constructs the directive
3591
+ * @param el The element
3592
+ */
3593
+ constructor(el) {
3594
+ this.el = el;
3595
+ }
3596
+ /**
3597
+ * Only allows letter and special character inputs
3598
+ * @param event Key Event
3599
+ */
3600
+ onKeyDown(event) {
3601
+ const e = event;
3602
+ if (this.sofArLettersAndSpecialCharacters) {
3603
+ if ([46, 8, 9, 27, 13, 110, 190].indexOf(e.keyCode) !== -1 ||
3604
+ // Allow: Ctrl+A
3605
+ (e.keyCode === 65 && e.ctrlKey) ||
3606
+ // Allow: Ctrl+C
3607
+ (e.keyCode === 67 && e.ctrlKey) ||
3608
+ // Allow: Ctrl+X
3609
+ (e.keyCode === 88 && e.ctrlKey) ||
3610
+ // Allow: spaces
3611
+ (e.keyCode === 32) ||
3612
+ // Allow: - (minus sign) on numpad or alphabet keyboard key
3613
+ (e.keyCode === 109 || e.keyCode === 189) ||
3614
+ // Allow: apostrophes
3615
+ (e.keyCode === 48) ||
3616
+ // Allow: home, end, left, right
3617
+ (e.keyCode >= 35 && e.keyCode <= 39)) {
3618
+ // let it happen, don't do anything
3619
+ return;
3620
+ }
3621
+ // Ensure that it is a letter and stop the keypress if its not a letter
3622
+ if (e.keyCode < 65 || e.keyCode > 90) {
3623
+ e.preventDefault();
3624
+ }
3625
+ }
3626
+ }
3627
+ /**
3628
+ * Allow user to copy and paste letters except special characters
3629
+ * @param event the event
3630
+ */
3631
+ allowPaste(event) {
3632
+ event.preventDefault();
3633
+ let pasteData = event.clipboardData.getData('text/plain');
3634
+ pasteData = pasteData.replace(/[0-9~`!@#$%^&*(){}\[\];:"<>,.?\/\\|_+=]*/g, '');
3635
+ const inputElement = event.target;
3636
+ const start = inputElement.selectionStart;
3637
+ const end = inputElement.selectionEnd;
3638
+ const originalValue = inputElement.value;
3639
+ const newValue = [
3640
+ originalValue.slice(0, start),
3641
+ pasteData,
3642
+ originalValue.slice(end)
3643
+ ].join('');
3644
+ inputElement.value = newValue;
3645
+ inputElement.selectionStart = inputElement.selectionEnd = start + pasteData.length;
3646
+ const evt = new Event('input', {
3647
+ bubbles: true,
3648
+ cancelable: true
3649
+ });
3650
+ inputElement.dispatchEvent(evt);
3651
+ }
3652
+ }
3653
+ LettersCharactersDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: LettersCharactersDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
3654
+ LettersCharactersDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.7", type: LettersCharactersDirective, selector: "[sofArLettersAndSpecialCharacters]", inputs: { sofArLettersAndSpecialCharacters: "sofArLettersAndSpecialCharacters" }, host: { listeners: { "keydown": "onKeyDown($event)", "paste": "allowPaste($event)" } }, ngImport: i0 });
3655
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: LettersCharactersDirective, decorators: [{
3656
+ type: Directive,
3657
+ args: [{
3658
+ selector: '[sofArLettersAndSpecialCharacters]'
3659
+ }]
3660
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { sofArLettersAndSpecialCharacters: [{
3661
+ type: Input
3662
+ }], onKeyDown: [{
3663
+ type: HostListener,
3664
+ args: ['keydown', ['$event']]
3665
+ }], allowPaste: [{
3666
+ type: HostListener,
3667
+ args: ['paste', ['$event']]
3668
+ }] } });
3669
+
3585
3670
  /**
3586
3671
  * The letters only directive
3587
3672
  */
@@ -3872,8 +3957,9 @@ const components$4 = [
3872
3957
  ];
3873
3958
  /** The directives */
3874
3959
  const directives = [
3875
- NumbersOnlyDirective,
3960
+ LettersCharactersDirective,
3876
3961
  LettersOnlyDirective,
3962
+ NumbersOnlyDirective,
3877
3963
  AlphaNumericDirective,
3878
3964
  InputTrimDirective
3879
3965
  ];
@@ -3891,16 +3977,18 @@ const materialModules$4 = [
3891
3977
  class FormsModule {
3892
3978
  }
3893
3979
  FormsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3894
- FormsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: FormsModule, declarations: [SofAddressComponent, NumbersOnlyDirective,
3980
+ FormsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: FormsModule, declarations: [SofAddressComponent, LettersCharactersDirective,
3895
3981
  LettersOnlyDirective,
3982
+ NumbersOnlyDirective,
3896
3983
  AlphaNumericDirective,
3897
3984
  InputTrimDirective, PhoneFormatPipe], imports: [CommonModule,
3898
3985
  FlexLayoutModule,
3899
3986
  ReactiveFormsModule, MatInputModule,
3900
3987
  MatFormFieldModule,
3901
3988
  MatSelectModule,
3902
- MatSnackBarModule], exports: [SofAddressComponent, NumbersOnlyDirective,
3989
+ MatSnackBarModule], exports: [SofAddressComponent, LettersCharactersDirective,
3903
3990
  LettersOnlyDirective,
3991
+ NumbersOnlyDirective,
3904
3992
  AlphaNumericDirective,
3905
3993
  InputTrimDirective, PhoneFormatPipe] });
3906
3994
  FormsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormsModule, providers: [
@@ -7160,5 +7248,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
7160
7248
  * Generated bundle index. Do not edit.
7161
7249
  */
7162
7250
 
7163
- export { ALERT_BANNER_CONFIG, AbstractSamlEntryService, AbstractSamlService, AbstractStartupService, AccessTokenClaims, AlertBannerComponent, AlertBannerModule, AlertBannerService, AlertService, AlphaNumericDirective, AppTemplateComponent, ApplicationUserModel, ArRoleNavService, ArmError, ArmatureFooterComponent, ArmatureFooterModule, ArmatureHeaderComponent, ArmatureHeaderModule, ArmatureModule, ArmatureNavigationComponent, ArmatureResizePanelsModule, Attribute, AuthorizationService, BannerService, BannerType, BaseComponentModule, BaseConfigService, CacheExpirationType, ComponentSavePrintComponent, ComponentSavePrintService, Configuration, ConfirmAddressData, CoverageDetail, CssOverride, CssOverrideDirective, CustomAuthConfigService, DISABLE_ACCESS_FOR_NO_PAGES_ROLE, DISTRIBUTED_CACHE_BASE_PATH, DataStoreConfig, DecodedAccessToken, DefaultConfigService, DialogResult, DistributedCacheModule, ErrorCommonComponent, ErrorCommonConfig, ErrorModule, FAQ, FAQConfig, FaqComponent, FaqModule, FooterConfig, FormsModule, HYBRID_SAML_OAUTH_CONFIG, HeaderAuthSettings, HybridSamlOAuthConfig, HybridSamlOauthService, InputTrimDirective, LettersOnlyDirective, MobileHeaderMenuComponent, ModalData, NavigationModule, NumbersOnlyDirective, Oauth2RoleService, OauthModule, PhoneFormatPipe, PolicyPerson, RBAC_CONFIG, RbacActionDirective, RbacConfig, RbacModule, RedirectSamlComponent, RedirectSamlRequest, RedirectSessionConfigs, ResizePanelsComponent, RoleAccess, RoleNavService, RoutePath, RumConfig, RumModule, RumService, SESSION_CONFIG, SOF_BLANK_LANGUAGE_OVERRIDE, SOF_DATE_PIPE_FORMATS, SamlModule, SamlService, ServerCacheService, SessionConfig, SessionService, SharedErrorService, SiteMapComponent, SiteMapDirection, SofAddressComponent, SofAlertComponent, SofArComponentSavePrintModule, SofBadgeComponent, SofBannerComponent, SofBlankPipe, SofButtonToggleGroupComponent, SofConfirmAddressComponent, SofDatePipe, SofImageCheckboxComponent, SofModalComponent, SofPipeModule, SofProgressBarComponent, SofRadioCardComponent, SofSimpleAlertComponent, SofSsnPipe, SofStarRatingComponent, SoftheonErrorHandlerService, SsoGatewayEntryService, SsoGatewayModel, States, ThemeModule, ThemeService, TypedSession, USER_ENTITY_SERVICE_CONFIG, UserEntityService, UserEntityServiceConfig, ValidationKeys, WINDOW, httpVerb, initializerFactory, keyPathPrefix, languageStorageKey, newGuid, pascalToCamel, preSignInRouteStorageKey, sessionBasePathFactory };
7251
+ export { ALERT_BANNER_CONFIG, AbstractSamlEntryService, AbstractSamlService, AbstractStartupService, AccessTokenClaims, AlertBannerComponent, AlertBannerModule, AlertBannerService, AlertService, AlphaNumericDirective, AppTemplateComponent, ApplicationUserModel, ArRoleNavService, ArmError, ArmatureFooterComponent, ArmatureFooterModule, ArmatureHeaderComponent, ArmatureHeaderModule, ArmatureModule, ArmatureNavigationComponent, ArmatureResizePanelsModule, Attribute, AuthorizationService, BannerService, BannerType, BaseComponentModule, BaseConfigService, CacheExpirationType, ComponentSavePrintComponent, ComponentSavePrintService, Configuration, ConfirmAddressData, CoverageDetail, CssOverride, CssOverrideDirective, CustomAuthConfigService, DISABLE_ACCESS_FOR_NO_PAGES_ROLE, DISTRIBUTED_CACHE_BASE_PATH, DataStoreConfig, DecodedAccessToken, DefaultConfigService, DialogResult, DistributedCacheModule, ErrorCommonComponent, ErrorCommonConfig, ErrorModule, FAQ, FAQConfig, FaqComponent, FaqModule, FooterConfig, FormsModule, HYBRID_SAML_OAUTH_CONFIG, HeaderAuthSettings, HybridSamlOAuthConfig, HybridSamlOauthService, InputTrimDirective, LettersCharactersDirective, LettersOnlyDirective, MobileHeaderMenuComponent, ModalData, NavigationModule, NumbersOnlyDirective, Oauth2RoleService, OauthModule, PhoneFormatPipe, PolicyPerson, RBAC_CONFIG, RbacActionDirective, RbacConfig, RbacModule, RedirectSamlComponent, RedirectSamlRequest, RedirectSessionConfigs, ResizePanelsComponent, RoleAccess, RoleNavService, RoutePath, RumConfig, RumModule, RumService, SESSION_CONFIG, SOF_BLANK_LANGUAGE_OVERRIDE, SOF_DATE_PIPE_FORMATS, SamlModule, SamlService, ServerCacheService, SessionConfig, SessionService, SharedErrorService, SiteMapComponent, SiteMapDirection, SofAddressComponent, SofAlertComponent, SofArComponentSavePrintModule, SofBadgeComponent, SofBannerComponent, SofBlankPipe, SofButtonToggleGroupComponent, SofConfirmAddressComponent, SofDatePipe, SofImageCheckboxComponent, SofModalComponent, SofPipeModule, SofProgressBarComponent, SofRadioCardComponent, SofSimpleAlertComponent, SofSsnPipe, SofStarRatingComponent, SoftheonErrorHandlerService, SsoGatewayEntryService, SsoGatewayModel, States, ThemeModule, ThemeService, TypedSession, USER_ENTITY_SERVICE_CONFIG, UserEntityService, UserEntityServiceConfig, ValidationKeys, WINDOW, httpVerb, initializerFactory, keyPathPrefix, languageStorageKey, newGuid, pascalToCamel, preSignInRouteStorageKey, sessionBasePathFactory };
7164
7252
  //# sourceMappingURL=softheon-armature.mjs.map