@starley/ion-directives 1.3.16 → 1.4.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.
- package/dist/block-input/block-copy-past.directive.js +2 -1
- package/dist/block-input/block-copy-past.directive.js.map +1 -1
- package/dist/directive.module.d.ts +2 -1
- package/dist/directive.module.js +8 -4
- package/dist/directive.module.js.map +1 -1
- package/dist/input-mask/input-mask.directive.js +1 -0
- package/dist/input-mask/input-mask.directive.js.map +1 -1
- package/dist/input-remove/input-remove.directive.js +1 -0
- package/dist/input-remove/input-remove.directive.js.map +1 -1
- package/dist/press-hold/press-hold.directive.js +2 -1
- package/dist/press-hold/press-hold.directive.js.map +1 -1
- package/dist/provider/connector-sqlite-pwa.provider.js +2 -2
- package/dist/provider/ion-utils-provider.d.ts +1 -1
- package/dist/tap/tap.directive.js +2 -1
- package/dist/tap/tap.directive.js.map +1 -1
- package/package.json +10 -9
|
@@ -22,7 +22,8 @@ export { BlockCopyPasteDirective };
|
|
|
22
22
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BlockCopyPasteDirective, [{
|
|
23
23
|
type: Directive,
|
|
24
24
|
args: [{
|
|
25
|
-
selector: '[appBlockCopyPaste]'
|
|
25
|
+
selector: '[appBlockCopyPaste]',
|
|
26
|
+
standalone: false
|
|
26
27
|
}]
|
|
27
28
|
}], function () { return []; }, { blockPaste: [{
|
|
28
29
|
type: HostListener,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-copy-past.directive.js","sourceRoot":"","sources":["../../src/block-input/block-copy-past.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;;AAExD;
|
|
1
|
+
{"version":3,"file":"block-copy-past.directive.js","sourceRoot":"","sources":["../../src/block-input/block-copy-past.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;;AAExD;IAKE;IAAgB,CAAC;IAEkB,4CAAU,GAA7C,UAA8C,CAAgB;QAC5D,CAAC,CAAC,cAAc,EAAE,CAAC;IACrB,CAAC;IAEiC,2CAAS,GAA3C,UAA4C,CAAgB;QAC1D,CAAC,CAAC,cAAc,EAAE,CAAC;IACrB,CAAC;IAEgC,0CAAQ,GAAzC,UAA0C,CAAgB;QACxD,CAAC,CAAC,cAAc,EAAE,CAAC;IACrB,CAAC;kIAbU,uBAAuB;8EAAvB,uBAAuB;YAAvB,kGAAA,sBAAkB,IAAK,mFAAvB,qBAAiB,IAAM,iFAAvB,oBAAgB,IAAO;;kCANpC;CAoBC,AAlBD,IAkBC;SAdY,uBAAuB;uFAAvB,uBAAuB;cAJnC,SAAS;eAAC;gBACT,QAAQ,EAAE,qBAAqB;gBAC/B,UAAU,EAAE,KAAK;aAClB;;kBAIE,YAAY;mBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;kBAIhC,YAAY;mBAAC,MAAM,EAAE,CAAC,QAAQ,CAAC;;kBAI/B,YAAY;mBAAC,KAAK,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import { Directive, HostListener } from '@angular/core';\n\n@Directive({\n selector: '[appBlockCopyPaste]',\n standalone: false\n})\nexport class BlockCopyPasteDirective {\n constructor() { }\n\n @HostListener('paste', ['$event']) blockPaste(e: KeyboardEvent) {\n e.preventDefault();\n }\n\n @HostListener('copy', ['$event']) blockCopy(e: KeyboardEvent) {\n e.preventDefault();\n }\n\n @HostListener('cut', ['$event']) blockCut(e: KeyboardEvent) {\n e.preventDefault();\n }\n}\n"]}
|
|
@@ -6,6 +6,7 @@ import * as i3 from "./input-mask/input-mask.directive";
|
|
|
6
6
|
import * as i4 from "./input-remove/input-remove.directive";
|
|
7
7
|
import * as i5 from "./block-input/block-copy-past.directive";
|
|
8
8
|
import * as i6 from "@angular/common";
|
|
9
|
+
import * as i7 from "@angular/forms";
|
|
9
10
|
/**
|
|
10
11
|
* Gerencia precionamento de enventos
|
|
11
12
|
* @author Starley Cazorla
|
|
@@ -13,6 +14,6 @@ import * as i6 from "@angular/common";
|
|
|
13
14
|
export declare class DirectivesModule {
|
|
14
15
|
static forRoot(): ModuleWithProviders<DirectivesModule>;
|
|
15
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<DirectivesModule, never>;
|
|
16
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DirectivesModule, [typeof i1.PressHoldDirective, typeof i2.TapDirective, typeof i3.IonInputMaskDirective, typeof i4.IonInputRemoveDirective, typeof i5.BlockCopyPasteDirective], [typeof i6.CommonModule], [typeof i1.PressHoldDirective, typeof i2.TapDirective, typeof i3.IonInputMaskDirective, typeof i4.IonInputRemoveDirective, typeof i5.BlockCopyPasteDirective]>;
|
|
17
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DirectivesModule, [typeof i1.PressHoldDirective, typeof i2.TapDirective, typeof i3.IonInputMaskDirective, typeof i4.IonInputRemoveDirective, typeof i5.BlockCopyPasteDirective], [typeof i6.CommonModule, typeof i7.FormsModule], [typeof i1.PressHoldDirective, typeof i2.TapDirective, typeof i3.IonInputMaskDirective, typeof i4.IonInputRemoveDirective, typeof i5.BlockCopyPasteDirective]>;
|
|
17
18
|
static ɵinj: i0.ɵɵInjectorDeclaration<DirectivesModule>;
|
|
18
19
|
}
|
package/dist/directive.module.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { CommonModule } from '@angular/common';
|
|
2
2
|
import { CUSTOM_ELEMENTS_SCHEMA, NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
|
|
3
|
+
import { FormsModule } from '@angular/forms';
|
|
4
|
+
import { BlockCopyPasteDirective } from './block-input/block-copy-past.directive';
|
|
3
5
|
import { IonInputMaskDirective } from './input-mask/input-mask.directive';
|
|
4
6
|
import { IonInputRemoveDirective } from './input-remove/input-remove.directive';
|
|
5
7
|
import { PressHoldDirective } from './press-hold/press-hold.directive';
|
|
6
8
|
import { TapDirective } from './tap/tap.directive';
|
|
7
|
-
import { BlockCopyPasteDirective } from './block-input/block-copy-past.directive';
|
|
8
9
|
import * as i0 from "@angular/core";
|
|
9
10
|
/**
|
|
10
11
|
* Gerencia precionamento de enventos
|
|
@@ -21,7 +22,8 @@ var DirectivesModule = /** @class */ (function () {
|
|
|
21
22
|
};
|
|
22
23
|
DirectivesModule.ɵfac = function DirectivesModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DirectivesModule)(); };
|
|
23
24
|
DirectivesModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: DirectivesModule });
|
|
24
|
-
DirectivesModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule
|
|
25
|
+
DirectivesModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule,
|
|
26
|
+
FormsModule] });
|
|
25
27
|
return DirectivesModule;
|
|
26
28
|
}());
|
|
27
29
|
export { DirectivesModule };
|
|
@@ -36,7 +38,8 @@ export { DirectivesModule };
|
|
|
36
38
|
BlockCopyPasteDirective
|
|
37
39
|
],
|
|
38
40
|
imports: [
|
|
39
|
-
CommonModule
|
|
41
|
+
CommonModule,
|
|
42
|
+
FormsModule
|
|
40
43
|
],
|
|
41
44
|
exports: [
|
|
42
45
|
PressHoldDirective,
|
|
@@ -52,7 +55,8 @@ export { DirectivesModule };
|
|
|
52
55
|
TapDirective,
|
|
53
56
|
IonInputMaskDirective,
|
|
54
57
|
IonInputRemoveDirective,
|
|
55
|
-
BlockCopyPasteDirective], imports: [CommonModule
|
|
58
|
+
BlockCopyPasteDirective], imports: [CommonModule,
|
|
59
|
+
FormsModule], exports: [PressHoldDirective,
|
|
56
60
|
TapDirective,
|
|
57
61
|
IonInputMaskDirective,
|
|
58
62
|
IonInputRemoveDirective,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directive.module.js","sourceRoot":"","sources":["../src/directive.module.ts"],"names":[],"mapp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C,sBAAsB,EAAE,gBAAgB,CAAC;aAEtD;;wFACY,gBAAgB,mBApBrB,kBAAkB;QAClB,YAAY;QACZ,qBAAqB;QACrB,uBAAuB;QACvB,uBAAuB,aAGvB,YAAY;QACZ,WAAW,aAGX,kBAAkB;QAClB,YAAY;QACZ,qBAAqB;QACrB,uBAAuB;QACvB,uBAAuB","sourcesContent":["import { CommonModule } from '@angular/common';\nimport { CUSTOM_ELEMENTS_SCHEMA, ModuleWithProviders, NgModule, NO_ERRORS_SCHEMA } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { BlockCopyPasteDirective } from './block-input/block-copy-past.directive';\nimport { IonInputMaskDirective } from './input-mask/input-mask.directive';\nimport { IonInputRemoveDirective } from './input-remove/input-remove.directive';\nimport { PressHoldDirective } from './press-hold/press-hold.directive';\nimport { TapDirective } from './tap/tap.directive';\n\n/**\n * Gerencia precionamento de enventos\n * @author Starley Cazorla\n */\n\n@NgModule({\n declarations: [\n PressHoldDirective,\n TapDirective,\n IonInputMaskDirective,\n IonInputRemoveDirective,\n BlockCopyPasteDirective\n ],\n imports: [\n CommonModule,\n FormsModule\n ],\n exports: [\n PressHoldDirective,\n TapDirective,\n IonInputMaskDirective,\n IonInputRemoveDirective,\n BlockCopyPasteDirective\n ],\n schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA]\n\n})\nexport class DirectivesModule {\n static forRoot(): ModuleWithProviders<DirectivesModule> {\n return {\n ngModule: DirectivesModule,\n providers: [],\n };\n }\n}\n"]}
|
|
@@ -86,6 +86,7 @@ export { IonInputMaskDirective };
|
|
|
86
86
|
type: Directive,
|
|
87
87
|
args: [{
|
|
88
88
|
selector: '[appMask]',
|
|
89
|
+
standalone: false,
|
|
89
90
|
providers: [NgModel]
|
|
90
91
|
}]
|
|
91
92
|
}], function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.NgModel }, { type: i0.ChangeDetectorRef }]; }, { pattern: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-mask.directive.js","sourceRoot":"","sources":["../../src/input-mask/input-mask.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,SAAS,EAAc,YAAY,EAAE,KAAK,EAAuC,MAAM,eAAe,CAAC;AACnI,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;;;AAEzC;;;;GAIG;AAEH;
|
|
1
|
+
{"version":3,"file":"input-mask.directive.js","sourceRoot":"","sources":["../../src/input-mask/input-mask.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,SAAS,EAAc,YAAY,EAAE,KAAK,EAAuC,MAAM,eAAe,CAAC;AACnI,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;;;AAEzC;;;;GAIG;AAEH;IAUI,+BAAoB,UAAsB,EAAU,QAAmB,EAAU,OAAgB,EAAU,KAAwB;QAA/G,eAAU,GAAV,UAAU,CAAY;QAAU,aAAQ,GAAR,QAAQ,CAAW;QAAU,YAAO,GAAP,OAAO,CAAS;QAAU,UAAK,GAAL,KAAK,CAAmB;QAF3H,aAAQ,GAAW,EAAE,CAAC;IAEyG,CAAC;IAExI,2CAAW,GAAX,UAAY,OAAsB;QAC9B,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC;YACxD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC;YAC/C,gEAAgE;YAChE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,wDAAwD;YAClH,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,sBAAsB;YACxC,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QAC/B,CAAC;IACL,CAAC;IAGD,uCAAO,GADP,UACQ,KAAa;QACjB,IAAI,CAAC,QAAQ,G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C,KAAK,GAAG,EAAE,CAAC;gBAClB,WAAW,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;YAC3C,CAAC;iBAAM,CAAC;gBACJ,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC1C,CAAC;YACD,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,2CAA2C;QAC1E,CAAC;QAED,OAAO,WAAW,CAAC;IACvB,CAAC;8HAzEQ,qBAAqB;4EAArB,qBAAqB;YAArB,gGAAA,gCAA4B,IAAP;iHAFnB,CAAC,OAAO,CAAC;gCAZxB;CAyFC,AAhFD,IAgFC;SA3EY,qBAAqB;uFAArB,qBAAqB;cALjC,SAAS;eAAC;gBACP,QAAQ,EAAE,WAAW;gBACrB,UAAU,EAAE,KAAK;gBACjB,SAAS,EAAE,CAAC,OAAO,CAAC;aACvB;;kBAGI,KAAK;mBAAC,SAAS;;kBAef,YAAY;mBAAC,OAAO,EAAE,CAAC,qBAAqB,CAAC","sourcesContent":["import { ChangeDetectorRef, Directive, ElementRef, HostListener, Input, OnChanges, Renderer2, SimpleChanges } from '@angular/core';\nimport { NgModel } from '@angular/forms';\n\n/**\n * Directive input mask\n * @author Starley Cazorla\n * @version 3.0.0\n */\n\n@Directive({\n selector: '[appMask]',\n standalone: false,\n providers: [NgModel]\n})\nexport class IonInputMaskDirective implements OnChanges {\n\n @Input('appMask') pattern: string;\n private rawValue: string = '';\n\n constructor(private elementRef: ElementRef, private renderer: Renderer2, private ngModel: NgModel, private cdRef: ChangeDetectorRef) { }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes['pattern'] && !changes['pattern'].firstChange) {\n this.pattern = changes['pattern'].currentValue;\n // Quando a máscara muda, limpe o valor e aplique a nova máscara\n this.rawValue = this.extractRawValue(this.ngModel.value); // Extraia o valor bruto antes de aplicar a nova máscara\n this.applyMask(); // Reaplique a máscara\n this.cdRef.detectChanges();\n }\n }\n\n @HostListener('input', ['$event.target.value'])\n onInput(value: string) {\n this.rawValue = this.extractRawValue(value); // Atualize o valor bruto com o novo valor de entrada\n this.applyMask(); // Reaplique a máscara\n }\n\n /**\n * Applys mask\n * @author Starley Cazorla\n */\n private applyMask() {\n if (!this.pattern) {\n return;\n }\n\n // Aplique a máscara ao valor bruto\n const maskedValue = this.maskValue(this.rawValue, this.pattern);\n Promise.resolve().then(() => {\n // Atualizar o input e o modelo de controle com o valor mascarado\n this.renderer.setProperty(this.elementRef.nativeElement, 'value', maskedValue);\n this.ngModel.control?.setValue(maskedValue, { emitEvent: false });\n });\n }\n\n private extractRawValue(value: string): string {\n return value.replace(/[^a-zA-Z0-9]/g, ''); // Remove todos os caracteres não são letras e digitos\n }\n\n /**\n * Masks value\n * @author Starley Cazorla\n * @param rawValue\n * @param mask\n * @returns value\n */\n private maskValue(rawValue: string, mask: string): string {\n\n // Se a máscara não tiver um padrão, não faca nada\n if (!mask || mask === undefined || mask === null || mask === '') {\n return rawValue;\n }\n\n let maskedValue = '';\n let rawValIndex = 0;\n let i = 0;\n\n while (rawValIndex < rawValue.length) {\n if (mask[i] === '*') {\n maskedValue += rawValue[rawValIndex++];\n } else {\n maskedValue += mask[i] ? mask[i] : '';\n }\n i = (i + 1) % mask.length; // Volta ao início da máscara se necessário\n }\n\n return maskedValue;\n }\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-remove.directive.js","sourceRoot":"","sources":["../../src/input-remove/input-remove.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;;;AAGvE;
|
|
1
|
+
{"version":3,"file":"input-remove.directive.js","sourceRoot":"","sources":["../../src/input-remove/input-remove.directive.ts"],"names":[],"mappings":"AAAA,OAAO,E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uFAAvB,uBAAuB;cAPnC,SAAS;eAAC;gBACP,QAAQ,EAAE,sBAAsB;gBAChC,UAAU,EAAE,KAAK;gBACjB,IAAI,EAAE;oBACF,YAAY,EAAE,oBAAoB;iBACrC;aACJ;;sBAIgB,QAAQ;;sBAAI,IAAI;;sBAAI,IAAI;;kBAFpC,KAAK;mBAAC,oBAAoB","sourcesContent":["import { Directive, Host, Input, Optional, Self } from '@angular/core';\nimport { NgModel } from \"@angular/forms\";\n\n@Directive({\n selector: '[appRemoveFromInput]',\n standalone: false,\n host: {\n '(ionInput)': 'onIonInput($event)'\n }\n})\nexport class IonInputRemoveDirective {\n @Input('appRemoveFromInput') pattern: string;\n\n constructor(@Optional() @Host() @Self() public model: NgModel) { }\n\n /**\n * Determines whether ion input on\n * @author Starley Cazorla\n * @param event\n */\n onIonInput(event: any) {\n const input = event.target as HTMLInputElement;\n let value = input.value;\n\n if (this.pattern) {\n value = value.normalize('NFD').replace(this.getPattern(this.pattern), '');\n input.value = value;\n\n if (this.model) {\n this.model.control.setValue(value, {\n emitEvent: true,\n emitModelToViewChange: true,\n emitViewToModelChange: true\n });\n }\n }\n }\n\n /**\n * Gets pattern\n * @author Starley Cazorla\n * @param typePatter\n * @returns pattern - letter - number - special - punctuation\n */\n getPattern(typePatter: string): RegExp {\n if (typePatter === 'letter') return /[a-zA-Z]+/g;\n if (typePatter === 'number') return /[0-9]/g;\n if (typePatter === 'special') return /[^a-zA-Z0-9\\s.,!?'\"():;]/g;\n if (typePatter === 'punctuation') return /[.,!?'\"():;_-]/g;\n return new RegExp(typePatter, 'g');\n }\n}\n"]}
|
|
@@ -63,7 +63,8 @@ export { PressHoldDirective };
|
|
|
63
63
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PressHoldDirective, [{
|
|
64
64
|
type: Directive,
|
|
65
65
|
args: [{
|
|
66
|
-
selector: '[appPressHold]'
|
|
66
|
+
selector: '[appPressHold]',
|
|
67
|
+
standalone: false
|
|
67
68
|
}]
|
|
68
69
|
}], function () { return [{ type: undefined, decorators: [{
|
|
69
70
|
type: Attribute,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"press-hold.directive.js","sourceRoot":"","sources":["../../src/press-hold/press-hold.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;;AAEjG;;;GAGG;AAEH;
|
|
1
|
+
{"version":3,"file":"press-hold.directive.js","sourceRoot":"","sources":["../../src/press-hold/press-hold.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;;AAEjG;;;GAGG;AAEH;IAkBI,4BAAuC,OAAqB;QAAhD,wBAAA,EAAA,aAAgD;QAZlD,UAAK,GAAG,IAAI,YAAY,EAAE,CAAC;QACrC,iBAAY,GAAG;YACX,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,GAAG;SAChB,CAAC;QACF,iBAAY,GAAQ,IAAI,CAAC;QACzB,eAAU,GAAY,KAAK,CAAC;QAC5B,YAAO,GAAG,CAAC,CAAC;QACZ,aAAQ,GAAG,CAAC,CAAC;QACb,eAAU,GAAQ,IAAI,CAAC;QAGnB,IAAI,CAAC,YAAY,CAAC,QAAQ,GAAG,OAAO,CAAC;IACzC,CAAC;IAED,qCAAQ,GAAR;QACI,IAAI,CAAC,YAAY,CAAC,OAAO,GAAG,IAAI,CAAC;IACrC,CAAC;IAID,oCAAO,GAFP,UAEQ,KAAqB;QACzB,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;YAC7B,OAAO;QACX,CAAC,CAAC,2CAA2C;QAC7C,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAEO,2CAAc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AAY;mBAAC,UAAU,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import { Attribute, Directive, EventEmitter, HostListener, OnInit, Output } from '@angular/core';\n\n/**\n * Gerencia pressHold\n * @author Starley Cazorla\n */\n\n@Directive({\n selector: '[appPressHold]',\n standalone: false\n})\nexport class PressHoldDirective implements OnInit {\n\n @Output() press = new EventEmitter();\n pressGesture = {\n name: 'press',\n enabled: false,\n interval: 450\n };\n pressTimeout: any = null;\n isPressing: boolean = false;\n lastTap = 0;\n tapCount = 0;\n tapTimeout: any = null;\n\n constructor(@Attribute('appPressHold') pattern: number = 450) {\n this.pressGesture.interval = pattern;\n }\n\n ngOnInit(): void {\n this.pressGesture.enabled = true;\n }\n\n @HostListener('touchstart', ['$event'])\n @HostListener('touchend', ['$event'])\n onPress(event: { type: any; }) {\n if (!this.pressGesture.enabled) {\n return;\n } // Press is not enabled, don't do anything.\n this.handlePressing(event.type);\n }\n\n private handlePressing(type: string) { // touchend or touchstart\n if (type == 'touchstart') {\n this.pressTimeout = setTimeout(() => {\n this.isPressing = true;\n }, this.pressGesture.interval); // Considered a press if it's longer than interval (default: 251).\n } else if (type == 'touchend') {\n clearTimeout(this.pressTimeout);\n if (this.isPressing) {\n this.press.emit('end');\n this.resetTaps(); // Just incase this gets passed as a tap event too.\n }\n // Clicks have a natural delay of 300ms, so we have to account for that, before resetting isPressing.\n // Otherwise a tap event is emitted.\n setTimeout(() => this.isPressing = false, 50);\n }\n }\n\n private resetTaps() {\n clearTimeout(this.tapTimeout); // clear the old timeout\n this.tapCount = 0;\n this.tapTimeout = null;\n this.lastTap = 0;\n }\n\n}\n"]}
|
|
@@ -8,8 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g =
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
13
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
14
|
function step(op) {
|
|
15
15
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -28,7 +28,7 @@ export declare class IonUtilsProvider {
|
|
|
28
28
|
* @param enumInput
|
|
29
29
|
* @returns
|
|
30
30
|
*/
|
|
31
|
-
returnEnumStringName(enumInput: any):
|
|
31
|
+
returnEnumStringName(enumInput: any): string[];
|
|
32
32
|
static ɵfac: i0.ɵɵFactoryDeclaration<IonUtilsProvider, never>;
|
|
33
33
|
static ɵprov: i0.ɵɵInjectableDeclaration<IonUtilsProvider>;
|
|
34
34
|
}
|
|
@@ -67,7 +67,8 @@ export { TapDirective };
|
|
|
67
67
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TapDirective, [{
|
|
68
68
|
type: Directive,
|
|
69
69
|
args: [{
|
|
70
|
-
selector: '[appTap]'
|
|
70
|
+
selector: '[appTap]',
|
|
71
|
+
standalone: false
|
|
71
72
|
}]
|
|
72
73
|
}], function () { return []; }, { tap: [{
|
|
73
74
|
type: Output
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tap.directive.js","sourceRoot":"","sources":["../../src/tap/tap.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;;AAEtF;;;GAGG;AAEH;
|
|
1
|
+
{"version":3,"file":"tap.directive.js","sourceRoot":"","sources":["../../src/tap/tap.directive.ts"],"names":[],"mappings":"AAAA,OA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,UAAU,GAAG,UAAU,CAAC,cAAM,OAAA,KAAI,CAAC,QAAQ,EAAE,EAAf,CAAe,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAClF,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC;IAChC,CAAC;IAEO,+BAAQ,GAAhB;QACI,IAAI,IAAI,CAAC,QAAQ,KAAK,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;YACjD,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QACpB,CAAC;aAAM,IAAI,IAAI,CAAC,QAAQ,KAAK,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;YAC9D,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QAC1B,CAAC;QACD,IAAI,CAAC,SAAS,EAAE,CAAC;IACrB,CAAC;IAEO,gCAAS,GAAjB;QACI,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,wBAAwB;QACvD,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QAClB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;IACrB,CAAC;4GAvDQ,YAAY;mEAAZ,YAAY;YAAZ,uFAAA,sBAAkB,IAAN;;uBAXzB;CAoEC,AA7DD,IA6DC;SAzDY,YAAY;uFAAZ,YAAY;cAJxB,SAAS;eAAC;gBACP,QAAQ,EAAE,UAAU;gBACpB,UAAU,EAAE,KAAK;aACpB;;kBAGI,MAAM;;kBACN,MAAM;;kBAsBN,YAAY;mBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import { Directive, EventEmitter, HostListener, OnInit, Output } from '@angular/core';\n\n/**\n * Gerencia tap e doubleTap\n * @author Starley Cazorla\n */\n\n@Directive({\n selector: '[appTap]',\n standalone: false\n})\nexport class TapDirective implements OnInit {\n\n @Output() tap = new EventEmitter();\n @Output() doubleTap = new EventEmitter();\n lastTap = 0;\n tapCount = 0;\n tapTimeout: any = null;\n tapGesture = {\n name: 'tap',\n enabled: false,\n interval: 250,\n };\n doubleTapGesture = {\n name: 'doubleTap',\n enabled: false,\n interval: 300,\n };\n\n constructor() { }\n\n ngOnInit(): void {\n this.tapGesture.enabled = true;\n this.doubleTapGesture.enabled = true;\n }\n\n @HostListener('click', ['$event'])\n handleTaps(e: { timeStamp: number; }) {\n const tapTimestamp = Math.floor(e.timeStamp);\n const isDoubleTap = this.lastTap + this.tapGesture.interval > tapTimestamp;\n if (!this.tapGesture.enabled && !this.doubleTapGesture.enabled) {\n return this.resetTaps();\n }\n this.tapCount++;\n if (isDoubleTap && this.doubleTapGesture.enabled) {\n this.emitTaps();\n } else if (!isDoubleTap) {\n this.tapTimeout = setTimeout(() => this.emitTaps(), this.tapGesture.interval);\n }\n this.lastTap = tapTimestamp;\n }\n\n private emitTaps() {\n if (this.tapCount === 1 && this.tapGesture.enabled) {\n this.tap.emit();\n } else if (this.tapCount === 2 && this.doubleTapGesture.enabled) {\n this.doubleTap.emit();\n }\n this.resetTaps();\n }\n\n private resetTaps() {\n clearTimeout(this.tapTimeout); // clear the old timeout\n this.tapCount = 0;\n this.tapTimeout = null;\n this.lastTap = 0;\n }\n\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starley/ion-directives",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"tag": "alpha",
|
|
4
5
|
"description": "Directivas internas para ionic",
|
|
5
6
|
"main": "./dist/index.js",
|
|
6
7
|
"typings": "./dist/index.d.ts",
|
|
@@ -37,15 +38,15 @@
|
|
|
37
38
|
},
|
|
38
39
|
"homepage": "https://github.com/StarleyDev/ion-directives#readme",
|
|
39
40
|
"devDependencies": {
|
|
40
|
-
"@angular/common": "^
|
|
41
|
-
"@angular/compiler": "^
|
|
42
|
-
"@angular/compiler-cli": "^
|
|
43
|
-
"@angular/core": "^
|
|
44
|
-
"@angular/forms": "^
|
|
45
|
-
"@types/node": "^
|
|
46
|
-
"nodemon": "^3.1.
|
|
41
|
+
"@angular/common": "^20.3.11",
|
|
42
|
+
"@angular/compiler": "^20.3.11",
|
|
43
|
+
"@angular/compiler-cli": "^20.3.11",
|
|
44
|
+
"@angular/core": "^20.3.11",
|
|
45
|
+
"@angular/forms": "^20.3.11",
|
|
46
|
+
"@types/node": "^24.10.1",
|
|
47
|
+
"nodemon": "^3.1.11",
|
|
47
48
|
"ts-node": "^10.9.2",
|
|
48
|
-
"typescript": "~5.
|
|
49
|
+
"typescript": "~5.8.3"
|
|
49
50
|
},
|
|
50
51
|
"dependencies": {
|
|
51
52
|
"codelyzer": "^6.0.2",
|