@acorex/components 7.4.6 → 7.4.7
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/esm2022/button/lib/button.component.mjs +2 -2
- package/esm2022/color-palette/lib/color-palette-input.component.mjs +1 -1
- package/esm2022/data-pager/lib/data-pager-input-selector.component.mjs +1 -1
- package/esm2022/number-box/lib/number-box.component.mjs +15 -8
- package/esm2022/otp/lib/otp.component.mjs +8 -7
- package/esm2022/password-box/lib/password-box.component.mjs +25 -19
- package/esm2022/popup/lib/popup.component.mjs +7 -6
- package/esm2022/popup/lib/popup.service.mjs +5 -3
- package/esm2022/tabs/lib/tabs.component.mjs +2 -2
- package/fesm2022/acorex-components-button.mjs +2 -2
- package/fesm2022/acorex-components-button.mjs.map +1 -1
- package/fesm2022/acorex-components-color-palette.mjs +1 -1
- package/fesm2022/acorex-components-color-palette.mjs.map +1 -1
- package/fesm2022/acorex-components-data-pager.mjs +1 -1
- package/fesm2022/acorex-components-data-pager.mjs.map +1 -1
- package/fesm2022/acorex-components-number-box.mjs +14 -7
- package/fesm2022/acorex-components-number-box.mjs.map +1 -1
- package/fesm2022/acorex-components-otp.mjs +7 -6
- package/fesm2022/acorex-components-otp.mjs.map +1 -1
- package/fesm2022/acorex-components-password-box.mjs +24 -18
- package/fesm2022/acorex-components-password-box.mjs.map +1 -1
- package/fesm2022/acorex-components-popup.mjs +8 -5
- package/fesm2022/acorex-components-popup.mjs.map +1 -1
- package/fesm2022/acorex-components-tabs.mjs +2 -2
- package/fesm2022/acorex-components-tabs.mjs.map +1 -1
- package/mixin/lib/base-components.class.d.ts +2 -2
- package/mixin/lib/base-menu-mixin.class.d.ts +5 -5
- package/mixin/lib/button-mixin.class.d.ts +2 -2
- package/mixin/lib/clickable-mixin.class.d.ts +2 -2
- package/mixin/lib/color-look-mixing.class.d.ts +2 -2
- package/mixin/lib/datalist-component.class.d.ts +10 -10
- package/mixin/lib/dropdown-mixin.class.d.ts +2 -2
- package/mixin/lib/interactive-mixin.class.d.ts +4 -4
- package/mixin/lib/mixin.class.d.ts +61 -61
- package/mixin/lib/page-component.class.d.ts +2 -2
- package/mixin/lib/selection-component.class.d.ts +2 -2
- package/mixin/lib/sizable-mixin.class.d.ts +2 -2
- package/mixin/lib/textbox-mixin.class.d.ts +2 -2
- package/mixin/lib/value-mixin.class.d.ts +8 -8
- package/number-box/lib/number-box.component.d.ts +12 -5
- package/otp/lib/otp.component.d.ts +9 -3
- package/package.json +1 -1
- package/password-box/lib/password-box.component.d.ts +10 -3
- package/popup/lib/popup.service.d.ts +1 -1
@@ -1,12 +1,13 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { forwardRef, Component, ChangeDetectionStrategy, ViewEncapsulation, ViewChild, Input, NgModule } from '@angular/core';
|
2
|
+
import { forwardRef, Component, ChangeDetectionStrategy, ViewEncapsulation, ViewChild, Input, HostBinding, NgModule } from '@angular/core';
|
3
3
|
import * as i3 from 'angular-imask';
|
4
4
|
import { IMaskDirective, IMaskModule } from 'angular-imask';
|
5
5
|
import { createMask } from 'imask';
|
6
|
-
import { MXInputBaseValueComponent, AXComponent, AXFocusableComponent, AXClearableComponent } from '@acorex/components/common';
|
6
|
+
import { MXInputBaseValueComponent, MXAppearanceComponent, AXComponent, AXFocusableComponent, AXClearableComponent } from '@acorex/components/common';
|
7
7
|
import * as i2 from '@angular/forms';
|
8
8
|
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
9
9
|
import { toNumber } from 'lodash-es';
|
10
|
+
import { classes } from 'polytype';
|
10
11
|
import * as i1 from '@angular/common';
|
11
12
|
import { CommonModule } from '@angular/common';
|
12
13
|
import { AXButtonModule } from '@acorex/components/button';
|
@@ -17,7 +18,7 @@ import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
17
18
|
*
|
18
19
|
* @category Components
|
19
20
|
*/
|
20
|
-
class AXNumberBoxComponent extends MXInputBaseValueComponent {
|
21
|
+
class AXNumberBoxComponent extends classes((MXInputBaseValueComponent), MXAppearanceComponent) {
|
21
22
|
constructor() {
|
22
23
|
super(...arguments);
|
23
24
|
this._padDecimalZeros = false;
|
@@ -100,7 +101,7 @@ class AXNumberBoxComponent extends MXInputBaseValueComponent {
|
|
100
101
|
ngAfterViewInit() {
|
101
102
|
this._updateMask();
|
102
103
|
}
|
103
|
-
internalOptionChanged(
|
104
|
+
internalOptionChanged() {
|
104
105
|
this._updateMask();
|
105
106
|
}
|
106
107
|
internalSetValue(value) {
|
@@ -205,8 +206,11 @@ class AXNumberBoxComponent extends MXInputBaseValueComponent {
|
|
205
206
|
}
|
206
207
|
this.commitValue(this.value - toNumber(this.decimalStep == 'auto' ? 1 / Math.pow(10, this.decimals) : this.decimalStep), u);
|
207
208
|
}
|
209
|
+
get __hostClass() {
|
210
|
+
return `ax-editor-container ax-appearance-${this.appearance}`;
|
211
|
+
}
|
208
212
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.9", ngImport: i0, type: AXNumberBoxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
209
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.9", type: AXNumberBoxComponent, selector: "ax-number-box", inputs: { disabled: "disabled", readonly: "readonly", tabIndex: "tabIndex", placeholder: "placeholder", value: "value", state: "state", name: "name", id: "id", thousandsSeparator: "thousandsSeparator", padDecimalZeros: "padDecimalZeros", step: "step", decimals: "decimals", decimalStep: "decimalStep", showSpinButtons: "showSpinButtons", minValue: "minValue", maxValue: "maxValue" }, outputs: { valueChange: "valueChange", stateChange: "stateChange", onValueChanged: "onValueChanged", onBlur: "onBlur", onFocus: "onFocus", readonlyChange: "readonlyChange", disabledChange: "disabledChange" }, host: {
|
213
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.9", type: AXNumberBoxComponent, selector: "ax-number-box", inputs: { disabled: "disabled", readonly: "readonly", tabIndex: "tabIndex", placeholder: "placeholder", value: "value", state: "state", name: "name", id: "id", appearance: "appearance", thousandsSeparator: "thousandsSeparator", padDecimalZeros: "padDecimalZeros", step: "step", decimals: "decimals", decimalStep: "decimalStep", showSpinButtons: "showSpinButtons", minValue: "minValue", maxValue: "maxValue" }, outputs: { valueChange: "valueChange", stateChange: "stateChange", onValueChanged: "onValueChanged", onBlur: "onBlur", onFocus: "onFocus", readonlyChange: "readonlyChange", disabledChange: "disabledChange" }, host: { properties: { "class": "this.__hostClass" } }, providers: [
|
210
214
|
{ provide: AXComponent, useExisting: AXNumberBoxComponent },
|
211
215
|
{ provide: AXFocusableComponent, useExisting: AXNumberBoxComponent },
|
212
216
|
{ provide: AXClearableComponent, useExisting: AXNumberBoxComponent },
|
@@ -219,7 +223,7 @@ class AXNumberBoxComponent extends MXInputBaseValueComponent {
|
|
219
223
|
}
|
220
224
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.9", ngImport: i0, type: AXNumberBoxComponent, decorators: [{
|
221
225
|
type: Component,
|
222
|
-
args: [{ selector: 'ax-number-box', inputs: ['disabled', 'readonly', 'tabIndex', 'placeholder', 'value', 'state', 'name', 'id'], outputs: [
|
226
|
+
args: [{ selector: 'ax-number-box', inputs: ['disabled', 'readonly', 'tabIndex', 'placeholder', 'value', 'state', 'name', 'id', 'appearance'], outputs: [
|
223
227
|
'valueChange',
|
224
228
|
'stateChange',
|
225
229
|
'onValueChanged',
|
@@ -227,7 +231,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.9", ngImpor
|
|
227
231
|
'onFocus',
|
228
232
|
'readonlyChange',
|
229
233
|
'disabledChange',
|
230
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None,
|
234
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
|
231
235
|
{ provide: AXComponent, useExisting: AXNumberBoxComponent },
|
232
236
|
{ provide: AXFocusableComponent, useExisting: AXNumberBoxComponent },
|
233
237
|
{ provide: AXClearableComponent, useExisting: AXNumberBoxComponent },
|
@@ -259,6 +263,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.9", ngImpor
|
|
259
263
|
}], _maskDirective: [{
|
260
264
|
type: ViewChild,
|
261
265
|
args: [IMaskDirective]
|
266
|
+
}], __hostClass: [{
|
267
|
+
type: HostBinding,
|
268
|
+
args: ['class']
|
262
269
|
}] } });
|
263
270
|
|
264
271
|
const COMPONENT = [AXNumberBoxComponent];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-components-number-box.mjs","sources":["../../../../libs/components/number-box/src/lib/number-box.component.ts","../../../../libs/components/number-box/src/lib/number-box.component.html","../../../../libs/components/number-box/src/lib/number-box.module.ts","../../../../libs/components/number-box/src/acorex-components-number-box.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Input,\n ViewChild,\n ViewEncapsulation,\n forwardRef,\n} from '@angular/core';\nimport { IMaskDirective } from 'angular-imask';\nimport { MaskedNumber, createMask } from 'imask';\n\nimport {\n AXClearableComponent,\n AXComponent,\n AXFocusableComponent,\n MXComponentOptionChanged,\n MXInputBaseValueComponent,\n} from '@acorex/components/common';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { toNumber } from 'lodash-es';\n\n/**\n * The NumberBox is a component which detects user interaction and triggers a corresponding event\n *\n * @category Components\n */\n@Component({\n selector: 'ax-number-box',\n templateUrl: './number-box.component.html',\n styleUrls: ['./number-box.component.scss'],\n inputs: ['disabled', 'readonly', 'tabIndex', 'placeholder', 'value', 'state', 'name', 'id'],\n outputs: [\n 'valueChange',\n 'stateChange',\n 'onValueChanged',\n 'onBlur',\n 'onFocus',\n 'readonlyChange',\n 'disabledChange',\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: { class: 'ax-editor-container' },\n providers: [\n { provide: AXComponent, useExisting: AXNumberBoxComponent },\n { provide: AXFocusableComponent, useExisting: AXNumberBoxComponent },\n { provide: AXClearableComponent, useExisting: AXNumberBoxComponent },\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AXNumberBoxComponent),\n multi: true,\n },\n ],\n})\nexport class AXNumberBoxComponent extends MXInputBaseValueComponent<number> {\n @ViewChild('input') input: ElementRef<HTMLInputElement>;\n\n private _thousandsSeparator: string;\n /**\n * A character value that specifies the separator character.\n */\n @Input()\n public get thousandsSeparator(): string {\n return this._thousandsSeparator;\n }\n public set thousandsSeparator(v: string) {\n this.setOption({\n name: 'thousandsSeparator',\n value: v ?? '',\n });\n }\n\n private _padDecimalZeros: boolean = false;\n /**\n * A character value that specifies the separator character.\n */\n @Input()\n public get padDecimalZeros(): boolean {\n return this._padDecimalZeros;\n }\n public set padDecimalZeros(v: boolean) {\n this.setOption({\n name: 'padDecimalZeros',\n value: v,\n });\n }\n\n /**\n * Specifies the value that is used to increment or decrement the **Integer** part of number\n */\n @Input()\n step: number = 1;\n\n private _decimals: number = 0;\n /**\n * Specifies the number of decimals that the user can enter\n */\n @Input()\n public get decimals(): number {\n return this._decimals;\n }\n public set decimals(v: number) {\n this.setOption({\n name: 'decimals',\n value: v ?? 0,\n });\n }\n\n /**\n * Specifies the value that is used to increment or decrement the **Deciaml** part of number\n */\n @Input()\n decimalStep: number | 'auto' = 'auto';\n\n /**\n * Specifies whether the Up and Down spin buttons will be rendered or not\n */\n @Input()\n showSpinButtons: boolean = true;\n\n private _minValue: number = Number.MIN_SAFE_INTEGER;\n /**\n * Specifies the smallest value that is valid\n */\n @Input()\n public get minValue(): number {\n return this._minValue;\n }\n public set minValue(v: number) {\n this.setOption({\n name: 'minValue',\n value: v != null ? Number(v) : Number.MIN_SAFE_INTEGER,\n });\n }\n\n private _maxValue: number = Number.MAX_SAFE_INTEGER;\n /**\n * Specifies the greatest value that is valid\n */\n @Input()\n public get maxValue(): number {\n return this._maxValue;\n }\n public set maxValue(v: number) {\n this.setOption({\n name: 'maxValue',\n value: v != null ? Number(v) : Number.MAX_SAFE_INTEGER,\n });\n }\n\n /**\n * @ignore\n */\n _maskObj: MaskedNumber;\n\n @ViewChild(IMaskDirective)\n private _maskDirective: IMaskDirective<MaskedNumber>;\n\n override ngAfterViewInit(): void {\n this._updateMask();\n }\n\n override internalOptionChanged(option: MXComponentOptionChanged): void {\n this._updateMask();\n }\n\n override internalSetValue(value: any): number {\n // || (value == 0 && !this._maskObj.value)\n if (value == null) {\n return this.defaultValue;\n }\n const v = toNumber(value);\n if (v < this.minValue) return this.minValue;\n if (v > this.maxValue) return this.maxValue;\n return v;\n }\n\n private _updateMask() {\n if (!this._maskObj) {\n this._maskObj = createMask({\n mask: Number,\n min: this.minValue,\n max: this.maxValue,\n thousandsSeparator: this.thousandsSeparator || '',\n scale: this.decimals,\n radix: '.',\n padFractionalZeros: this.decimals > 0 && this.padDecimalZeros,\n });\n\n this._maskObj.format = (v: number, m) => {\n return !isNaN(v)\n ? v.toLocaleString('en-US', {\n useGrouping: false,\n maximumFractionDigits: 20,\n })\n : '';\n };\n } else {\n this._maskObj.updateOptions({\n min: this.minValue,\n max: this.maxValue,\n thousandsSeparator: this.thousandsSeparator || '',\n scale: this.decimals,\n radix: '.',\n padFractionalZeros: this.decimals > 0 && this.padDecimalZeros,\n });\n }\n this._maskDirective?.maskRef?.updateValue();\n this._maskDirective?.maskRef?.updateControl();\n }\n\n _handleModelChange(value: number) {\n this.commitValue(value, true);\n }\n\n _handleOnKeydownEvent(e: KeyboardEvent) {\n if (this.disabled || this.readonly) return;\n const ignore = () => {\n e.preventDefault();\n e.stopPropagation();\n };\n const input = e.target as HTMLInputElement;\n const valStr = input.value;\n const decimalPointIndex = valStr.indexOf('.');\n const _cursorPos = input.selectionStart!;\n\n if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n if (decimalPointIndex > 0 && _cursorPos > decimalPointIndex && this.decimals > 0) {\n e.key === 'ArrowDown' ? this.decimalStepDown(true) : this.decimalStepUp(true);\n } else {\n e.key === 'ArrowDown' ? this.stepDown(true) : this.stepUp(true);\n }\n ignore();\n setTimeout(() => {\n input.setSelectionRange(_cursorPos, _cursorPos);\n }, 5);\n }\n super.emitOnKeydownEvent(e);\n }\n\n _handleUpDownClick(v: -1 | 1) {\n if (this.disabled || this.readonly) return;\n v == 1 ? this.stepUp(true) : this.stepDown(true);\n }\n\n stepUp(u: boolean = false) {\n if (!this.value) {\n this.commitValue(Math.max(this.minValue, 0), u);\n }\n this.commitValue(this.value + toNumber(this.step), u);\n }\n\n stepDown(u: boolean = false) {\n if (!this.value) {\n this.commitValue(Math.max(this.minValue, 0), u);\n }\n this.commitValue(this.value - toNumber(this.step), u);\n }\n\n decimalStepUp(u: boolean = false) {\n if (!this.value) {\n this.commitValue(Math.max(this.minValue, 0), u);\n }\n this.commitValue(\n this.value + toNumber(this.decimalStep == 'auto' ? 1 / Math.pow(10, this.decimals) : this.decimalStep),\n u,\n );\n }\n\n decimalStepDown(u: boolean = false) {\n if (!this.value) {\n this.commitValue(Math.max(this.minValue, 0), u);\n }\n this.commitValue(\n this.value - toNumber(this.decimalStep == 'auto' ? 1 / Math.pow(10, this.decimals) : this.decimalStep),\n u,\n );\n }\n}\n","<ng-content select=\"ax-prefix\"> </ng-content>\n<input\n #input\n class=\"ax-input\"\n type=\"text\"\n [id]=\"id\"\n [name]=\"name\"\n [attr.placeholder]=\"placeholder\"\n [attr.autocomplete]=\"'off'\"\n [imask]=\"_maskObj\"\n [unmask]=\"'typed'\"\n [attr.min]=\"minValue\"\n [attr.max]=\"maxValue\"\n [class.ax-state-disabled]=\"disabled\"\n [class.ax-state-readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [tabindex]=\"tabIndex\"\n [ngModel]=\"value\"\n (ngModelChange)=\"_handleModelChange($event)\"\n (keydown)=\"_handleOnKeydownEvent($event)\"\n (keyup)=\"emitOnKeyupEvent($event)\"\n (keypress)=\"emitOnKeypressEvent($event)\"\n (focus)=\"emitOnFocusEvent($event)\"\n (blur)=\"emitOnBlurEvent($event)\"\n/>\n<ng-content select=\"ax-clear-button\"></ng-content>\n<div class=\"ax-number-box-control\" *ngIf=\"showSpinButtons\">\n <button\n type=\"button\"\n class=\"ax-general-button ax-button-icon ax-number-box-increment\"\n [class.ax-state-disabled]=\"disabled\"\n (click)=\"_handleUpDownClick(1)\"\n tabindex=\"-1\"\n [disabled]=\"disabled\"\n >\n <span class=\"ax-icon ax-icon-arrow-up\"></span>\n </button>\n <button\n type=\"button\"\n class=\"ax-general-button ax-button-icon ax-number-box-decrement\"\n [class.ax-state-disabled]=\"disabled\"\n (click)=\"_handleUpDownClick(-1)\"\n [disabled]=\"disabled\"\n >\n <span class=\"ax-icon ax-icon-arrow-down\" tabindex=\"-1\"></span>\n </button>\n</div>\n<ng-content select=\"ax-suffix\"> </ng-content>\n<ng-content select=\"ax-validation-rule\"> </ng-content>\n","import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport {IMaskModule} from 'angular-imask';\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXNumberBoxComponent } from './number-box.component';\n\nconst COMPONENT = [AXNumberBoxComponent];\nconst MODULES = [\n CommonModule,\n FormsModule,\n AXButtonModule,\n AXDecoratorModule,\n IMaskModule\n];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXNumberBoxModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAsBA;;;;AAIG;AA6BG,MAAO,oBAAqB,SAAQ,yBAAiC,CAAA;AA5B3E,IAAA,WAAA,GAAA;;QA8CU,IAAgB,CAAA,gBAAA,GAAY,KAAK,CAAC;AAe1C;;AAEG;QAEH,IAAI,CAAA,IAA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UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAJb,OAAO,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAIX,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAN7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;AACvB,oBAAA,SAAS,EAAE,EAAE;AAChB,iBAAA,CAAA;;;ACtBD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"acorex-components-number-box.mjs","sources":["../../../../libs/components/number-box/src/lib/number-box.component.ts","../../../../libs/components/number-box/src/lib/number-box.component.html","../../../../libs/components/number-box/src/lib/number-box.module.ts","../../../../libs/components/number-box/src/acorex-components-number-box.ts"],"sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Input,\n ViewChild,\n ViewEncapsulation,\n forwardRef,\n} from '@angular/core';\nimport { IMaskDirective } from 'angular-imask';\nimport { MaskedNumber, createMask } from 'imask';\n\nimport {\n AXClearableComponent,\n AXComponent,\n AXFocusableComponent,\n MXAppearanceComponent,\n MXInputBaseValueComponent,\n} from '@acorex/components/common';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { toNumber } from 'lodash-es';\nimport { classes } from 'polytype';\n\n/**\n * The NumberBox is a component which detects user interaction and triggers a corresponding event\n *\n * @category Components\n */\n@Component({\n selector: 'ax-number-box',\n templateUrl: './number-box.component.html',\n styleUrls: ['./number-box.component.scss'],\n inputs: ['disabled', 'readonly', 'tabIndex', 'placeholder', 'value', 'state', 'name', 'id', 'appearance'],\n outputs: [\n 'valueChange',\n 'stateChange',\n 'onValueChanged',\n 'onBlur',\n 'onFocus',\n 'readonlyChange',\n 'disabledChange',\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n\n providers: [\n { provide: AXComponent, useExisting: AXNumberBoxComponent },\n { provide: AXFocusableComponent, useExisting: AXNumberBoxComponent },\n { provide: AXClearableComponent, useExisting: AXNumberBoxComponent },\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AXNumberBoxComponent),\n multi: true,\n },\n ],\n})\nexport class AXNumberBoxComponent\n extends classes(MXInputBaseValueComponent<number>, MXAppearanceComponent)\n implements AfterViewInit\n{\n @ViewChild('input') input: ElementRef<HTMLInputElement>;\n\n private _thousandsSeparator: string;\n /**\n * A character value that specifies the separator character.\n */\n @Input()\n public get thousandsSeparator(): string {\n return this._thousandsSeparator;\n }\n public set thousandsSeparator(v: string) {\n this.setOption({\n name: 'thousandsSeparator',\n value: v ?? '',\n });\n }\n\n private _padDecimalZeros = false;\n /**\n * A character value that specifies the separator character.\n */\n @Input()\n public get padDecimalZeros(): boolean {\n return this._padDecimalZeros;\n }\n public set padDecimalZeros(v: boolean) {\n this.setOption({\n name: 'padDecimalZeros',\n value: v,\n });\n }\n\n /**\n * Specifies the value that is used to increment or decrement the **Integer** part of number\n */\n @Input()\n step = 1;\n\n private _decimals = 0;\n /**\n * Specifies the number of decimals that the user can enter\n */\n @Input()\n public get decimals(): number {\n return this._decimals;\n }\n public set decimals(v: number) {\n this.setOption({\n name: 'decimals',\n value: v ?? 0,\n });\n }\n\n /**\n * Specifies the value that is used to increment or decrement the **Deciaml** part of number\n */\n @Input()\n decimalStep: number | 'auto' = 'auto';\n\n /**\n * Specifies whether the Up and Down spin buttons will be rendered or not\n */\n @Input()\n showSpinButtons = true;\n\n private _minValue: number = Number.MIN_SAFE_INTEGER;\n /**\n * Specifies the smallest value that is valid\n */\n @Input()\n public get minValue(): number {\n return this._minValue;\n }\n public set minValue(v: number) {\n this.setOption({\n name: 'minValue',\n value: v != null ? Number(v) : Number.MIN_SAFE_INTEGER,\n });\n }\n\n private _maxValue: number = Number.MAX_SAFE_INTEGER;\n /**\n * Specifies the greatest value that is valid\n */\n @Input()\n public get maxValue(): number {\n return this._maxValue;\n }\n public set maxValue(v: number) {\n this.setOption({\n name: 'maxValue',\n value: v != null ? Number(v) : Number.MAX_SAFE_INTEGER,\n });\n }\n\n /**\n * @ignore\n */\n _maskObj: MaskedNumber;\n\n @ViewChild(IMaskDirective)\n private _maskDirective: IMaskDirective<MaskedNumber>;\n\n override ngAfterViewInit(): void {\n this._updateMask();\n }\n\n override internalOptionChanged(): void {\n this._updateMask();\n }\n\n override internalSetValue(value: any): number {\n // || (value == 0 && !this._maskObj.value)\n if (value == null) {\n return this.defaultValue;\n }\n const v = toNumber(value);\n if (v < this.minValue) return this.minValue;\n if (v > this.maxValue) return this.maxValue;\n return v;\n }\n\n private _updateMask() {\n if (!this._maskObj) {\n this._maskObj = createMask({\n mask: Number,\n min: this.minValue,\n max: this.maxValue,\n thousandsSeparator: this.thousandsSeparator || '',\n scale: this.decimals,\n radix: '.',\n padFractionalZeros: this.decimals > 0 && this.padDecimalZeros,\n });\n\n this._maskObj.format = (v: number, m) => {\n return !isNaN(v)\n ? v.toLocaleString('en-US', {\n useGrouping: false,\n maximumFractionDigits: 20,\n })\n : '';\n };\n } else {\n this._maskObj.updateOptions({\n min: this.minValue,\n max: this.maxValue,\n thousandsSeparator: this.thousandsSeparator || '',\n scale: this.decimals,\n radix: '.',\n padFractionalZeros: this.decimals > 0 && this.padDecimalZeros,\n });\n }\n this._maskDirective?.maskRef?.updateValue();\n this._maskDirective?.maskRef?.updateControl();\n }\n\n _handleModelChange(value: number) {\n this.commitValue(value, true);\n }\n\n _handleOnKeydownEvent(e: KeyboardEvent) {\n if (this.disabled || this.readonly) return;\n const ignore = () => {\n e.preventDefault();\n e.stopPropagation();\n };\n const input = e.target as HTMLInputElement;\n const valStr = input.value;\n const decimalPointIndex = valStr.indexOf('.');\n const _cursorPos = input.selectionStart!;\n\n if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n if (decimalPointIndex > 0 && _cursorPos > decimalPointIndex && this.decimals > 0) {\n e.key === 'ArrowDown' ? this.decimalStepDown(true) : this.decimalStepUp(true);\n } else {\n e.key === 'ArrowDown' ? this.stepDown(true) : this.stepUp(true);\n }\n ignore();\n setTimeout(() => {\n input.setSelectionRange(_cursorPos, _cursorPos);\n }, 5);\n }\n super.emitOnKeydownEvent(e);\n }\n\n _handleUpDownClick(v: -1 | 1) {\n if (this.disabled || this.readonly) return;\n v == 1 ? this.stepUp(true) : this.stepDown(true);\n }\n\n stepUp(u = false) {\n if (!this.value) {\n this.commitValue(Math.max(this.minValue, 0), u);\n }\n this.commitValue(this.value + toNumber(this.step), u);\n }\n\n stepDown(u = false) {\n if (!this.value) {\n this.commitValue(Math.max(this.minValue, 0), u);\n }\n this.commitValue(this.value - toNumber(this.step), u);\n }\n\n decimalStepUp(u = false) {\n if (!this.value) {\n this.commitValue(Math.max(this.minValue, 0), u);\n }\n this.commitValue(\n this.value + toNumber(this.decimalStep == 'auto' ? 1 / Math.pow(10, this.decimals) : this.decimalStep),\n u,\n );\n }\n\n decimalStepDown(u = false) {\n if (!this.value) {\n this.commitValue(Math.max(this.minValue, 0), u);\n }\n this.commitValue(\n this.value - toNumber(this.decimalStep == 'auto' ? 1 / Math.pow(10, this.decimals) : this.decimalStep),\n u,\n );\n }\n\n @HostBinding('class')\n get __hostClass(): string {\n return `ax-editor-container ax-appearance-${this.appearance}`;\n }\n}\n","<ng-content select=\"ax-prefix\"> </ng-content>\n<input\n #input\n class=\"ax-input\"\n type=\"text\"\n [id]=\"id\"\n [name]=\"name\"\n [attr.placeholder]=\"placeholder\"\n [attr.autocomplete]=\"'off'\"\n [imask]=\"_maskObj\"\n [unmask]=\"'typed'\"\n [attr.min]=\"minValue\"\n [attr.max]=\"maxValue\"\n [class.ax-state-disabled]=\"disabled\"\n [class.ax-state-readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [tabindex]=\"tabIndex\"\n [ngModel]=\"value\"\n (ngModelChange)=\"_handleModelChange($event)\"\n (keydown)=\"_handleOnKeydownEvent($event)\"\n (keyup)=\"emitOnKeyupEvent($event)\"\n (keypress)=\"emitOnKeypressEvent($event)\"\n (focus)=\"emitOnFocusEvent($event)\"\n (blur)=\"emitOnBlurEvent($event)\"\n/>\n<ng-content select=\"ax-clear-button\"></ng-content>\n<div class=\"ax-number-box-control\" *ngIf=\"showSpinButtons\">\n <button\n type=\"button\"\n class=\"ax-general-button ax-button-icon ax-number-box-increment\"\n [class.ax-state-disabled]=\"disabled\"\n (click)=\"_handleUpDownClick(1)\"\n tabindex=\"-1\"\n [disabled]=\"disabled\"\n >\n <span class=\"ax-icon ax-icon-arrow-up\"></span>\n </button>\n <button\n type=\"button\"\n class=\"ax-general-button ax-button-icon ax-number-box-decrement\"\n [class.ax-state-disabled]=\"disabled\"\n (click)=\"_handleUpDownClick(-1)\"\n [disabled]=\"disabled\"\n >\n <span class=\"ax-icon ax-icon-arrow-down\" tabindex=\"-1\"></span>\n </button>\n</div>\n<ng-content select=\"ax-suffix\"> </ng-content>\n<ng-content select=\"ax-validation-rule\"> </ng-content>\n","import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport {IMaskModule} from 'angular-imask';\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXNumberBoxComponent } from './number-box.component';\n\nconst COMPONENT = [AXNumberBoxComponent];\nconst MODULES = [\n CommonModule,\n FormsModule,\n AXButtonModule,\n AXDecoratorModule,\n IMaskModule\n];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXNumberBoxModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAyBA;;;;AAIG;AA6BG,MAAO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AA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;+GAAjB,iBAAiB,EAAA,YAAA,EAAA,CAfX,oBAAoB,CAAA,EAAA,OAAA,EAAA,CAEnC,YAAY;YACZ,WAAW;YACX,cAAc;YACd,iBAAiB;AACjB,YAAA,WAAW,aANI,oBAAoB,CAAA,EAAA,CAAA,CAAA,EAAA;AAe1B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAJb,OAAO,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAIX,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAN7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;AACvB,oBAAA,SAAS,EAAE,EAAE;AAChB,iBAAA,CAAA;;;ACtBD;;AAEG;;;;"}
|
@@ -1,13 +1,14 @@
|
|
1
|
-
import { AXEvent, MXValueComponent } from '@acorex/components/common';
|
1
|
+
import { AXEvent, MXValueComponent, MXAppearanceComponent } from '@acorex/components/common';
|
2
2
|
import * as i0 from '@angular/core';
|
3
3
|
import { EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Output, Input, NgModule } from '@angular/core';
|
4
|
+
import { classes } from 'polytype';
|
4
5
|
import * as i1 from '@angular/common';
|
5
6
|
import { CommonModule } from '@angular/common';
|
6
7
|
|
7
8
|
class AXOtpCompletedEvent extends AXEvent {
|
8
9
|
}
|
9
10
|
|
10
|
-
class AXOtpComponent extends MXValueComponent {
|
11
|
+
class AXOtpComponent extends classes((MXValueComponent), MXAppearanceComponent) {
|
11
12
|
constructor() {
|
12
13
|
super(...arguments);
|
13
14
|
this.lenghtChange = new EventEmitter();
|
@@ -20,11 +21,11 @@ class AXOtpComponent extends MXValueComponent {
|
|
20
21
|
}
|
21
22
|
set length(v) {
|
22
23
|
this.setOption({
|
23
|
-
name:
|
24
|
+
name: 'length',
|
24
25
|
afterCallback: () => {
|
25
26
|
this._render();
|
26
27
|
},
|
27
|
-
value: v
|
28
|
+
value: v,
|
28
29
|
});
|
29
30
|
}
|
30
31
|
ngOnInit() {
|
@@ -114,11 +115,11 @@ class AXOtpComponent extends MXValueComponent {
|
|
114
115
|
inputs[i].select();
|
115
116
|
}
|
116
117
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.9", ngImport: i0, type: AXOtpComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
117
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.9", type: AXOtpComponent, selector: "ax-otp", inputs: { state: "state", disabled: "disabled", readonly: "readonly", length: "length" }, outputs: { stateChange: "stateChange", disabledChange: "disabledChange", lenghtChange: "lenghtChange", onCompleted: "onCompleted" }, usesInheritance: true, ngImport: i0, template: "<div
|
118
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.9", type: AXOtpComponent, selector: "ax-otp", inputs: { state: "state", disabled: "disabled", readonly: "readonly", appearance: "appearance", length: "length" }, outputs: { stateChange: "stateChange", disabledChange: "disabledChange", lenghtChange: "lenghtChange", onCompleted: "onCompleted" }, usesInheritance: true, ngImport: i0, template: "<div\n class=\"ax-otp-input-container ax-editor-container ax-appearance-{{ appearance }}\"\n [ngStyle]=\"{ 'grid-template-columns': 'repeat(' + inputs.length + ', minmax(0, 1fr))' }\"\n (paste)=\"_handleOnPaste($event)\"\n>\n <ng-container *ngFor=\"let input of inputs; let i = index\">\n <input\n class=\"ax-input\"\n type=\"number\"\n [class.ax-state-disabled]=\"disabled\"\n [class.ax-state-success]=\"state === 'success'\"\n [class.ax-state-error]=\"state === 'error'\"\n maxlength=\"1\"\n [value]=\"_numbers[i]\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n (click)=\"_handleOnClick($event, i)\"\n (input)=\"_handleOnInput($event, i)\"\n (keydown)=\"_handleOnKeyDown($event, i)\"\n disabled=\"disabled\"\n />\n </ng-container>\n</div>\n<ng-template #name></ng-template>\n", styles: [".ax-otp-input-container{display:grid;gap:.5rem}.ax-otp-input-container.ax-editor-container{border:none;height:auto;outline-color:transparent;overflow:initial;background-color:transparent}.ax-otp-input-container.ax-editor-container:focus-within,.ax-otp-input-container.ax-editor-container:focus{border:none!important;box-shadow:none!important}.ax-otp-input-container.ax-editor-container.ax-appearance-solid .ax-input,.ax-otp-input-container.ax-editor-container.ax-appearance-outline .ax-input{background-color:rgba(var(--ax-color-input-surface));border:1px solid;border-color:rgba(var(--ax-color-border-default));border-radius:var(--ax-rounded-border-default)}.ax-otp-input-container.ax-editor-container.ax-appearance-solid .ax-input:focus-within,.ax-otp-input-container.ax-editor-container.ax-appearance-outline .ax-input:focus-within{border-color:rgba(var(--ax-color-primary-500));box-shadow:0 0 0 1px rgba(var(--ax-color-primary-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-solid .ax-input.ax-state-error,.ax-otp-input-container.ax-editor-container.ax-appearance-outline .ax-input.ax-state-error{border-color:rgba(var(--ax-color-danger-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-solid .ax-input.ax-state-error:focus-within,.ax-otp-input-container.ax-editor-container.ax-appearance-outline .ax-input.ax-state-error:focus-within{box-shadow:0 0 0 1px rgba(var(--ax-color-danger-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-solid .ax-input.ax-state-error .ax-input::placeholder,.ax-otp-input-container.ax-editor-container.ax-appearance-outline .ax-input.ax-state-error .ax-input::placeholder{color:rgba(var(--ax-color-danger-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-solid .ax-input.ax-state-success,.ax-otp-input-container.ax-editor-container.ax-appearance-outline .ax-input.ax-state-success{outline-color:rgba(var(--ax-color-success-500));border-color:rgba(var(--ax-color-success-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-solid .ax-input.ax-state-success:focus-within,.ax-otp-input-container.ax-editor-container.ax-appearance-outline .ax-input.ax-state-success:focus-within{box-shadow:0 0 0 1px rgba(var(--ax-color-success-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-solid .ax-input.ax-state-success .ax-input::placeholder,.ax-otp-input-container.ax-editor-container.ax-appearance-outline .ax-input.ax-state-success .ax-input::placeholder{color:rgba(var(--ax-color-success-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-flat .ax-input{border-bottom:1px solid;border-color:rgba(var(--ax-color-border-default))}.ax-otp-input-container.ax-editor-container.ax-appearance-flat .ax-input:focus-within{border-color:rgba(var(--ax-color-primary-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-flat .ax-input.ax-state-error{border-color:rgba(var(--ax-color-danger-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-flat .ax-input.ax-state-error .ax-input::placeholder{color:rgba(var(--ax-color-danger-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-flat .ax-input.ax-state-success{outline-color:rgba(var(--ax-color-success-500));border-color:rgba(var(--ax-color-success-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-flat .ax-input.ax-state-success .ax-input::placeholder{color:rgba(var(--ax-color-success-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-outline .ax-input{background-color:transparent!important}.ax-otp-input-container.ax-editor-container.ax-appearance-fill .ax-input{background-color:rgba(var(--ax-color-input-surface-fill));border-radius:var(--ax-rounded-border-default)}.ax-otp-input-container.ax-editor-container.ax-appearance-fill .ax-input:focus-within{box-shadow:0 0 0 2px rgba(var(--ax-color-primary-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-fill .ax-input.ax-state-error{background-color:rgba(var(--ax-color-danger-50))}.ax-otp-input-container.ax-editor-container.ax-appearance-fill .ax-input.ax-state-error:focus-within{box-shadow:0 0 0 2px rgba(var(--ax-color-danger-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-fill .ax-input.ax-state-error .ax-input::placeholder{color:rgba(var(--ax-color-danger-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-fill .ax-input.ax-state-success{background-color:rgba(var(--ax-color-success-50))}.ax-otp-input-container.ax-editor-container.ax-appearance-fill .ax-input.ax-state-success:focus-within{box-shadow:0 0 0 2px rgba(var(--ax-color-success-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-fill .ax-input.ax-state-success .ax-input::placeholder{color:rgba(var(--ax-color-success-500))}.ax-otp-input-container.ax-editor-container .ax-input{text-align:center;font-size:200%;overflow:hidden;aspect-ratio:1}.ax-otp-input-container.ax-editor-container .ax-input:read-only{opacity:.8;cursor:text}.ax-otp-input-container.ax-editor-container .ax-input:disabled{opacity:.5;cursor:not-allowed}@media (max-width: 599px){.ax-otp-input-container.ax-editor-container .ax-input{font-size:100%}}.ax-otp-input-container.ax-editor-container .ax-input[type=number]{-moz-appearance:textfield}.ax-otp-input-container.ax-editor-container .ax-input[type=number]::-webkit-inner-spin-button,.ax-otp-input-container.ax-editor-container .ax-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
118
119
|
}
|
119
120
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.9", ngImport: i0, type: AXOtpComponent, decorators: [{
|
120
121
|
type: Component,
|
121
|
-
args: [{ selector: 'ax-otp', inputs: ['state', 'disabled', 'readonly'], outputs: ['stateChange', 'disabledChange'], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div
|
122
|
+
args: [{ selector: 'ax-otp', inputs: ['state', 'disabled', 'readonly', 'appearance'], outputs: ['stateChange', 'disabledChange'], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\n class=\"ax-otp-input-container ax-editor-container ax-appearance-{{ appearance }}\"\n [ngStyle]=\"{ 'grid-template-columns': 'repeat(' + inputs.length + ', minmax(0, 1fr))' }\"\n (paste)=\"_handleOnPaste($event)\"\n>\n <ng-container *ngFor=\"let input of inputs; let i = index\">\n <input\n class=\"ax-input\"\n type=\"number\"\n [class.ax-state-disabled]=\"disabled\"\n [class.ax-state-success]=\"state === 'success'\"\n [class.ax-state-error]=\"state === 'error'\"\n maxlength=\"1\"\n [value]=\"_numbers[i]\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n (click)=\"_handleOnClick($event, i)\"\n (input)=\"_handleOnInput($event, i)\"\n (keydown)=\"_handleOnKeyDown($event, i)\"\n disabled=\"disabled\"\n />\n </ng-container>\n</div>\n<ng-template #name></ng-template>\n", styles: [".ax-otp-input-container{display:grid;gap:.5rem}.ax-otp-input-container.ax-editor-container{border:none;height:auto;outline-color:transparent;overflow:initial;background-color:transparent}.ax-otp-input-container.ax-editor-container:focus-within,.ax-otp-input-container.ax-editor-container:focus{border:none!important;box-shadow:none!important}.ax-otp-input-container.ax-editor-container.ax-appearance-solid .ax-input,.ax-otp-input-container.ax-editor-container.ax-appearance-outline .ax-input{background-color:rgba(var(--ax-color-input-surface));border:1px solid;border-color:rgba(var(--ax-color-border-default));border-radius:var(--ax-rounded-border-default)}.ax-otp-input-container.ax-editor-container.ax-appearance-solid .ax-input:focus-within,.ax-otp-input-container.ax-editor-container.ax-appearance-outline .ax-input:focus-within{border-color:rgba(var(--ax-color-primary-500));box-shadow:0 0 0 1px rgba(var(--ax-color-primary-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-solid .ax-input.ax-state-error,.ax-otp-input-container.ax-editor-container.ax-appearance-outline .ax-input.ax-state-error{border-color:rgba(var(--ax-color-danger-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-solid .ax-input.ax-state-error:focus-within,.ax-otp-input-container.ax-editor-container.ax-appearance-outline .ax-input.ax-state-error:focus-within{box-shadow:0 0 0 1px rgba(var(--ax-color-danger-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-solid .ax-input.ax-state-error .ax-input::placeholder,.ax-otp-input-container.ax-editor-container.ax-appearance-outline .ax-input.ax-state-error .ax-input::placeholder{color:rgba(var(--ax-color-danger-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-solid .ax-input.ax-state-success,.ax-otp-input-container.ax-editor-container.ax-appearance-outline .ax-input.ax-state-success{outline-color:rgba(var(--ax-color-success-500));border-color:rgba(var(--ax-color-success-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-solid .ax-input.ax-state-success:focus-within,.ax-otp-input-container.ax-editor-container.ax-appearance-outline .ax-input.ax-state-success:focus-within{box-shadow:0 0 0 1px rgba(var(--ax-color-success-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-solid .ax-input.ax-state-success .ax-input::placeholder,.ax-otp-input-container.ax-editor-container.ax-appearance-outline .ax-input.ax-state-success .ax-input::placeholder{color:rgba(var(--ax-color-success-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-flat .ax-input{border-bottom:1px solid;border-color:rgba(var(--ax-color-border-default))}.ax-otp-input-container.ax-editor-container.ax-appearance-flat .ax-input:focus-within{border-color:rgba(var(--ax-color-primary-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-flat .ax-input.ax-state-error{border-color:rgba(var(--ax-color-danger-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-flat .ax-input.ax-state-error .ax-input::placeholder{color:rgba(var(--ax-color-danger-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-flat .ax-input.ax-state-success{outline-color:rgba(var(--ax-color-success-500));border-color:rgba(var(--ax-color-success-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-flat .ax-input.ax-state-success .ax-input::placeholder{color:rgba(var(--ax-color-success-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-outline .ax-input{background-color:transparent!important}.ax-otp-input-container.ax-editor-container.ax-appearance-fill .ax-input{background-color:rgba(var(--ax-color-input-surface-fill));border-radius:var(--ax-rounded-border-default)}.ax-otp-input-container.ax-editor-container.ax-appearance-fill .ax-input:focus-within{box-shadow:0 0 0 2px rgba(var(--ax-color-primary-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-fill .ax-input.ax-state-error{background-color:rgba(var(--ax-color-danger-50))}.ax-otp-input-container.ax-editor-container.ax-appearance-fill .ax-input.ax-state-error:focus-within{box-shadow:0 0 0 2px rgba(var(--ax-color-danger-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-fill .ax-input.ax-state-error .ax-input::placeholder{color:rgba(var(--ax-color-danger-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-fill .ax-input.ax-state-success{background-color:rgba(var(--ax-color-success-50))}.ax-otp-input-container.ax-editor-container.ax-appearance-fill .ax-input.ax-state-success:focus-within{box-shadow:0 0 0 2px rgba(var(--ax-color-success-500))}.ax-otp-input-container.ax-editor-container.ax-appearance-fill .ax-input.ax-state-success .ax-input::placeholder{color:rgba(var(--ax-color-success-500))}.ax-otp-input-container.ax-editor-container .ax-input{text-align:center;font-size:200%;overflow:hidden;aspect-ratio:1}.ax-otp-input-container.ax-editor-container .ax-input:read-only{opacity:.8;cursor:text}.ax-otp-input-container.ax-editor-container .ax-input:disabled{opacity:.5;cursor:not-allowed}@media (max-width: 599px){.ax-otp-input-container.ax-editor-container .ax-input{font-size:100%}}.ax-otp-input-container.ax-editor-container .ax-input[type=number]{-moz-appearance:textfield}.ax-otp-input-container.ax-editor-container .ax-input[type=number]::-webkit-inner-spin-button,.ax-otp-input-container.ax-editor-container .ax-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}\n"] }]
|
122
123
|
}], propDecorators: { lenghtChange: [{
|
123
124
|
type: Output
|
124
125
|
}], length: [{
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-components-otp.mjs","sources":["../../../../libs/components/otp/src/lib/otp.class.ts","../../../../libs/components/otp/src/lib/otp.component.ts","../../../../libs/components/otp/src/lib/otp.component.html","../../../../libs/components/otp/src/lib/otp.module.ts","../../../../libs/components/otp/src/acorex-components-otp.ts"],"sourcesContent":["import { AXEvent } from '@acorex/components/common';\n\nexport class AXOtpCompletedEvent extends AXEvent {\n value: string;\n}\n","import { MXValueComponent } from '@acorex/components/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport { AXOtpCompletedEvent } from './otp.class';\n\n@Component({\n selector: 'ax-otp',\n templateUrl: './otp.component.html',\n styleUrls: ['./otp.component.scss'],\n inputs: ['state', 'disabled', 'readonly'],\n outputs: ['stateChange', 'disabledChange'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class AXOtpComponent extends MXValueComponent<string> implements OnInit, AfterViewInit {\n @Output()\n lenghtChange: EventEmitter<number> = new EventEmitter();\n\n private _length: number;\n\n @Input()\n public get length(): number {\n return this._length;\n }\n public set length(v: number) {\n this.setOption({\n name: \"length\",\n afterCallback: () => {\n this._render();\n },\n value: v\n })\n }\n\n inputs: number[] = [];\n\n @Output() onCompleted: EventEmitter<AXOtpCompletedEvent> = new EventEmitter<AXOtpCompletedEvent>();\n\n protected _numbers: number[] = [];\n\n override ngOnInit(): void {\n super.ngOnInit();\n this._render();\n }\n\n private _render() {\n this.inputs = Array(this.length)\n .fill(1)\n .map((x, i) => i);\n }\n\n clear() {\n this._numbers = [];\n this.setState('clear');\n }\n\n override ngAfterViewInit(): void {\n this.getHostElement().querySelector<HTMLInputElement>('.ax-input').focus();\n }\n\n protected _handleOnInput(event: any, i: number) {\n const inputs = this.getHostElement().querySelectorAll<HTMLInputElement>('.ax-input');\n const numberRegex = /^\\d+$/;\n if (!numberRegex.test(event.target.value)) {\n event.target.value = '';\n return;\n }\n if (event.target.value.length > 1) {\n const currentValue = event.target.value;\n event.target.value = '';\n event.target.value = currentValue.slice(-1);\n }\n if (inputs[i + 1]) {\n inputs[i + 1].select();\n }\n this._numbers[i] = event.target.value;\n if (this._numbers.filter((c) => c).length === this.length) {\n this.setState('success');\n this.onCompleted.emit({\n component: AXOtpComponent,\n value: this._numbers.join(''),\n });\n }\n }\n\n protected _handleOnKeyDown(event: KeyboardEvent, i: number) {\n const inputs = this.getHostElement().querySelectorAll<HTMLInputElement>('.ax-input');\n switch (event.key) {\n case 'Backspace':\n inputs[i].value = '';\n if (inputs[i - 1]) {\n inputs[i - 1].select();\n event.preventDefault();\n }\n this._numbers[i] = NaN;\n break;\n case 'ArrowRight':\n if (inputs[i + 1]) {\n inputs[i + 1].select();\n }\n break;\n\n case 'ArrowLeft':\n if (inputs[i - 1]) {\n inputs[i - 1].select();\n }\n break;\n case 'Home':\n inputs[0].focus();\n break;\n case 'End':\n inputs[this.length - 1].select();\n break;\n case 'ArrowUp':\n case 'ArrowDown':\n event.preventDefault();\n break;\n }\n }\n protected _handleOnPaste(event: any) {\n const data = event.clipboardData.getData('text');\n const inputs = this.getHostElement().querySelectorAll<HTMLInputElement>('.ax-input');\n inputs[inputs.length - 1].focus();\n this._numbers = [];\n for (let i = 0; i < data.length; i++) {\n this._numbers[i] = data[i];\n }\n }\n\n protected _handleOnClick(event: any, i) {\n const inputs = this.getHostElement().querySelectorAll<HTMLInputElement>('.ax-input');\n inputs[i].select();\n }\n}\n","<div class=\"ax-otp-input-container ax-editor-container\"\n [ngStyle]=\"{ 'grid-template-columns': 'repeat(' + inputs.length + ', minmax(0, 1fr))' }\"\n (paste)=\"_handleOnPaste($event)\">\n <ng-container *ngFor=\"let input of inputs; let i = index\">\n <input class=\"ax-input\" type=\"number\" [class.ax-state-disabled]=\"disabled\" maxlength=\"1\" [value]=\"_numbers[i]\"\n [disabled]=\"disabled\" [readonly]=\"readonly\" (click)=\"_handleOnClick($event, i)\"\n (input)=\"_handleOnInput($event, i)\" (keydown)=\"_handleOnKeyDown($event, i)\" disabled=\"disabled\" />\n </ng-container>\n</div>\n<ng-template #name></ng-template>","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { AXOtpComponent } from './otp.component';\n\nconst COMPONENT = [AXOtpComponent];\nconst MODULES = [CommonModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXOtpModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAEM,MAAO,mBAAoB,SAAQ,OAAO,CAAA;AAE/C;;ACkBK,MAAO,cAAe,SAAQ,gBAAwB,CAAA;AAT5D,IAAA,WAAA,GAAA;;AAWE,QAAA,IAAA,CAAA,YAAY,GAAyB,IAAI,YAAY,EAAE,CAAC;QAkBxD,IAAM,CAAA,MAAA,GAAa,EAAE,CAAC;AAEZ,QAAA,IAAA,CAAA,WAAW,GAAsC,IAAI,YAAY,EAAuB,CAAC;QAEzF,IAAQ,CAAA,QAAA,GAAa,EAAE,CAAC;AA+FnC,KAAA;AAjHC,IAAA,IACW,MAAM,GAAA;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;KACrB;IACD,IAAW,MAAM,CAAC,CAAS,EAAA;QACzB,IAAI,CAAC,SAAS,CAAC;AACb,YAAA,IAAI,EAAE,QAAQ;YACd,aAAa,EAAE,MAAK;gBAClB,IAAI,CAAC,OAAO,EAAE,CAAC;aAChB;AACD,YAAA,KAAK,EAAE,CAAC;AACT,SAAA,CAAC,CAAA;KACH;IAQQ,QAAQ,GAAA;QACf,KAAK,CAAC,QAAQ,EAAE,CAAC;QACjB,IAAI,CAAC,OAAO,EAAE,CAAC;KAChB;IAEO,OAAO,GAAA;QACb,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC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AA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,EATL,YAAA,EAAA,CAAA,cAAc,CAChB,EAAA,OAAA,EAAA,CAAA,YAAY,aADV,cAAc,CAAA,EAAA,CAAA,CAAA,EAAA;AASpB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,YAJT,OAAO,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAIT,WAAW,EAAA,UAAA,EAAA,CAAA;kBANvB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;AACvB,oBAAA,SAAS,EAAE,EAAE;AACd,iBAAA,CAAA;;;ACZD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"acorex-components-otp.mjs","sources":["../../../../libs/components/otp/src/lib/otp.class.ts","../../../../libs/components/otp/src/lib/otp.component.ts","../../../../libs/components/otp/src/lib/otp.component.html","../../../../libs/components/otp/src/lib/otp.module.ts","../../../../libs/components/otp/src/acorex-components-otp.ts"],"sourcesContent":["import { AXEvent } from '@acorex/components/common';\n\nexport class AXOtpCompletedEvent extends AXEvent {\n value: string;\n}\n","import { MXAppearanceComponent, MXValueComponent } from '@acorex/components/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport { classes } from 'polytype';\nimport { AXOtpCompletedEvent } from './otp.class';\n\n@Component({\n selector: 'ax-otp',\n templateUrl: './otp.component.html',\n styleUrls: ['./otp.component.scss'],\n inputs: ['state', 'disabled', 'readonly', 'appearance'],\n outputs: ['stateChange', 'disabledChange'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class AXOtpComponent\n extends classes(MXValueComponent<string>, MXAppearanceComponent)\n implements OnInit, AfterViewInit\n{\n @Output()\n lenghtChange: EventEmitter<number> = new EventEmitter();\n\n private _length: number;\n\n @Input()\n public get length(): number {\n return this._length;\n }\n public set length(v: number) {\n this.setOption({\n name: 'length',\n afterCallback: () => {\n this._render();\n },\n value: v,\n });\n }\n\n inputs: number[] = [];\n\n @Output() onCompleted: EventEmitter<AXOtpCompletedEvent> = new EventEmitter<AXOtpCompletedEvent>();\n\n protected _numbers: number[] = [];\n\n override ngOnInit(): void {\n super.ngOnInit();\n this._render();\n }\n\n private _render() {\n this.inputs = Array(this.length)\n .fill(1)\n .map((x, i) => i);\n }\n\n clear() {\n this._numbers = [];\n this.setState('clear');\n }\n\n override ngAfterViewInit(): void {\n this.getHostElement().querySelector<HTMLInputElement>('.ax-input').focus();\n }\n\n protected _handleOnInput(event: any, i: number) {\n const inputs = this.getHostElement().querySelectorAll<HTMLInputElement>('.ax-input');\n const numberRegex = /^\\d+$/;\n if (!numberRegex.test(event.target.value)) {\n event.target.value = '';\n return;\n }\n if (event.target.value.length > 1) {\n const currentValue = event.target.value;\n event.target.value = '';\n event.target.value = currentValue.slice(-1);\n }\n if (inputs[i + 1]) {\n inputs[i + 1].select();\n }\n this._numbers[i] = event.target.value;\n if (this._numbers.filter((c) => c).length === this.length) {\n this.setState('success');\n this.onCompleted.emit({\n component: AXOtpComponent,\n value: this._numbers.join(''),\n });\n }\n }\n\n protected _handleOnKeyDown(event: KeyboardEvent, i: number) {\n const inputs = this.getHostElement().querySelectorAll<HTMLInputElement>('.ax-input');\n switch (event.key) {\n case 'Backspace':\n inputs[i].value = '';\n if (inputs[i - 1]) {\n inputs[i - 1].select();\n event.preventDefault();\n }\n this._numbers[i] = NaN;\n break;\n case 'ArrowRight':\n if (inputs[i + 1]) {\n inputs[i + 1].select();\n }\n break;\n\n case 'ArrowLeft':\n if (inputs[i - 1]) {\n inputs[i - 1].select();\n }\n break;\n case 'Home':\n inputs[0].focus();\n break;\n case 'End':\n inputs[this.length - 1].select();\n break;\n case 'ArrowUp':\n case 'ArrowDown':\n event.preventDefault();\n break;\n }\n }\n protected _handleOnPaste(event: any) {\n const data = event.clipboardData.getData('text');\n const inputs = this.getHostElement().querySelectorAll<HTMLInputElement>('.ax-input');\n inputs[inputs.length - 1].focus();\n this._numbers = [];\n for (let i = 0; i < data.length; i++) {\n this._numbers[i] = data[i];\n }\n }\n\n protected _handleOnClick(event: any, i) {\n const inputs = this.getHostElement().querySelectorAll<HTMLInputElement>('.ax-input');\n inputs[i].select();\n }\n}\n","<div\n class=\"ax-otp-input-container ax-editor-container ax-appearance-{{ appearance }}\"\n [ngStyle]=\"{ 'grid-template-columns': 'repeat(' + inputs.length + ', minmax(0, 1fr))' }\"\n (paste)=\"_handleOnPaste($event)\"\n>\n <ng-container *ngFor=\"let input of inputs; let i = index\">\n <input\n class=\"ax-input\"\n type=\"number\"\n [class.ax-state-disabled]=\"disabled\"\n [class.ax-state-success]=\"state === 'success'\"\n [class.ax-state-error]=\"state === 'error'\"\n maxlength=\"1\"\n [value]=\"_numbers[i]\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n (click)=\"_handleOnClick($event, i)\"\n (input)=\"_handleOnInput($event, i)\"\n (keydown)=\"_handleOnKeyDown($event, i)\"\n disabled=\"disabled\"\n />\n </ng-container>\n</div>\n<ng-template #name></ng-template>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { AXOtpComponent } from './otp.component';\n\nconst COMPONENT = [AXOtpComponent];\nconst MODULES = [CommonModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...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AAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,YAJT,OAAO,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAIT,WAAW,EAAA,UAAA,EAAA,CAAA;kBANvB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;AACvB,oBAAA,SAAS,EAAE,EAAE;AACd,iBAAA,CAAA;;;ACZD;;AAEG;;;;"}
|
@@ -1,8 +1,9 @@
|
|
1
|
+
import { MXInputBaseValueComponent, MXAppearanceComponent, AXComponent, AXFocusableComponent, AXClearableComponent } from '@acorex/components/common';
|
1
2
|
import * as i0 from '@angular/core';
|
2
|
-
import { forwardRef, Component, ViewEncapsulation, ChangeDetectionStrategy, ViewChild, Input, NgModule } from '@angular/core';
|
3
|
-
import { MXInputBaseValueComponent, AXComponent, AXFocusableComponent, AXClearableComponent } from '@acorex/components/common';
|
3
|
+
import { forwardRef, Component, ViewEncapsulation, ChangeDetectionStrategy, ViewChild, Input, HostBinding, NgModule } from '@angular/core';
|
4
4
|
import * as i2 from '@angular/forms';
|
5
5
|
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
6
|
+
import { classes } from 'polytype';
|
6
7
|
import * as i1 from '@angular/common';
|
7
8
|
import { CommonModule } from '@angular/common';
|
8
9
|
import { AXButtonModule } from '@acorex/components/button';
|
@@ -13,7 +14,7 @@ import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
13
14
|
*
|
14
15
|
* @category Components
|
15
16
|
*/
|
16
|
-
class AXPasswordBoxComponent extends MXInputBaseValueComponent {
|
17
|
+
class AXPasswordBoxComponent extends classes((MXInputBaseValueComponent), MXAppearanceComponent) {
|
17
18
|
constructor() {
|
18
19
|
super(...arguments);
|
19
20
|
this._type = 'password';
|
@@ -37,38 +38,40 @@ class AXPasswordBoxComponent extends MXInputBaseValueComponent {
|
|
37
38
|
this._icon = 'ax-icon-visibility';
|
38
39
|
}
|
39
40
|
}
|
41
|
+
get __hostClass() {
|
42
|
+
return `ax-editor-container ax-appearance-${this.appearance}`;
|
43
|
+
}
|
40
44
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.9", ngImport: i0, type: AXPasswordBoxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
41
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.9", type: AXPasswordBoxComponent, selector: "ax-password-box", inputs: { disabled: "disabled", readonly: "readonly", tabIndex: "tabIndex", placeholder: "placeholder", value: "value", state: "state", name: "name", id: "id", autoComplete: "autoComplete", showToggleButton: "showToggleButton" }, outputs: { valueChange: "valueChange", stateChange: "stateChange", onValueChanged: "onValueChanged", onBlur: "onBlur", onFocus: "onFocus", readonlyChange: "readonlyChange", disabledChange: "disabledChange" }, host: {
|
45
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.9", type: AXPasswordBoxComponent, selector: "ax-password-box", inputs: { disabled: "disabled", readonly: "readonly", tabIndex: "tabIndex", placeholder: "placeholder", value: "value", state: "state", name: "name", id: "id", appearance: "appearance", autoComplete: "autoComplete", showToggleButton: "showToggleButton" }, outputs: { valueChange: "valueChange", stateChange: "stateChange", onValueChanged: "onValueChanged", onBlur: "onBlur", onFocus: "onFocus", readonlyChange: "readonlyChange", disabledChange: "disabledChange" }, host: { properties: { "class": "this.__hostClass" } }, providers: [
|
42
46
|
{ provide: AXComponent, useExisting: AXPasswordBoxComponent },
|
43
47
|
{ provide: AXFocusableComponent, useExisting: AXPasswordBoxComponent },
|
44
48
|
{ provide: AXClearableComponent, useExisting: AXPasswordBoxComponent },
|
45
49
|
{
|
46
50
|
provide: NG_VALUE_ACCESSOR,
|
47
51
|
useExisting: forwardRef(() => AXPasswordBoxComponent),
|
48
|
-
multi: true
|
49
|
-
}
|
52
|
+
multi: true,
|
53
|
+
},
|
50
54
|
], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ng-content select=\"ax-prefix\">\n</ng-content>\n<input #input class=\"ax-input\" [name]=\"name\" [type]=\"_type\" [id]=\"id\" [attr.placeholder]=\"placeholder\"\n [class.ax-state-disabled]=\"disabled\" [class.ax-state-readonly]=\"readonly\" [disabled]=\"disabled\"\n [readonly]=\"readonly\" [tabindex]=\"tabIndex\" [ngModel]=\"value\" [attr.autocomplete]=\"autoComplete\"\n (ngModelChange)=\"_handleModelChange($event)\" (keydown)=\"emitOnKeydownEvent($event)\"\n (keyup)=\"emitOnKeyupEvent($event)\" (keypress)=\"emitOnKeypressEvent($event)\" (focus)=\"emitOnFocusEvent($event)\"\n (blur)=\"emitOnBlurEvent($event)\">\n<ng-content select=\"ax-clear-button\"></ng-content>\n<button type=\"button\" class=\"ax-general-button ax-button-icon\" (click)=\"toggleType()\" [tabIndex]=\"-1\"\n *ngIf=\"showToggleButton\">\n <span class=\"ax-icon {{_icon}}\"></span>\n</button>\n<ng-content select=\"ax-suffix\">\n</ng-content>\n<ng-content select=\"ax-validation-rule\">\n</ng-content>", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
51
55
|
}
|
52
56
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.9", ngImport: i0, type: AXPasswordBoxComponent, decorators: [{
|
53
57
|
type: Component,
|
54
|
-
args: [{ selector: 'ax-password-box', inputs: [
|
55
|
-
'
|
56
|
-
'
|
57
|
-
'
|
58
|
-
'
|
59
|
-
'
|
60
|
-
'
|
61
|
-
'
|
62
|
-
|
63
|
-
], outputs: ['valueChange', 'stateChange', 'onValueChanged', 'onBlur', 'onFocus', 'readonlyChange', 'disabledChange'], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'ax-editor-container' }, providers: [
|
58
|
+
args: [{ selector: 'ax-password-box', inputs: ['disabled', 'readonly', 'tabIndex', 'placeholder', 'value', 'state', 'name', 'id', 'appearance'], outputs: [
|
59
|
+
'valueChange',
|
60
|
+
'stateChange',
|
61
|
+
'onValueChanged',
|
62
|
+
'onBlur',
|
63
|
+
'onFocus',
|
64
|
+
'readonlyChange',
|
65
|
+
'disabledChange',
|
66
|
+
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
64
67
|
{ provide: AXComponent, useExisting: AXPasswordBoxComponent },
|
65
68
|
{ provide: AXFocusableComponent, useExisting: AXPasswordBoxComponent },
|
66
69
|
{ provide: AXClearableComponent, useExisting: AXPasswordBoxComponent },
|
67
70
|
{
|
68
71
|
provide: NG_VALUE_ACCESSOR,
|
69
72
|
useExisting: forwardRef(() => AXPasswordBoxComponent),
|
70
|
-
multi: true
|
71
|
-
}
|
73
|
+
multi: true,
|
74
|
+
},
|
72
75
|
], template: "<ng-content select=\"ax-prefix\">\n</ng-content>\n<input #input class=\"ax-input\" [name]=\"name\" [type]=\"_type\" [id]=\"id\" [attr.placeholder]=\"placeholder\"\n [class.ax-state-disabled]=\"disabled\" [class.ax-state-readonly]=\"readonly\" [disabled]=\"disabled\"\n [readonly]=\"readonly\" [tabindex]=\"tabIndex\" [ngModel]=\"value\" [attr.autocomplete]=\"autoComplete\"\n (ngModelChange)=\"_handleModelChange($event)\" (keydown)=\"emitOnKeydownEvent($event)\"\n (keyup)=\"emitOnKeyupEvent($event)\" (keypress)=\"emitOnKeypressEvent($event)\" (focus)=\"emitOnFocusEvent($event)\"\n (blur)=\"emitOnBlurEvent($event)\">\n<ng-content select=\"ax-clear-button\"></ng-content>\n<button type=\"button\" class=\"ax-general-button ax-button-icon\" (click)=\"toggleType()\" [tabIndex]=\"-1\"\n *ngIf=\"showToggleButton\">\n <span class=\"ax-icon {{_icon}}\"></span>\n</button>\n<ng-content select=\"ax-suffix\">\n</ng-content>\n<ng-content select=\"ax-validation-rule\">\n</ng-content>" }]
|
73
76
|
}], propDecorators: { input: [{
|
74
77
|
type: ViewChild,
|
@@ -77,6 +80,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.9", ngImpor
|
|
77
80
|
type: Input
|
78
81
|
}], showToggleButton: [{
|
79
82
|
type: Input
|
83
|
+
}], __hostClass: [{
|
84
|
+
type: HostBinding,
|
85
|
+
args: ['class']
|
80
86
|
}] } });
|
81
87
|
|
82
88
|
const COMPONENT = [AXPasswordBoxComponent];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-components-password-box.mjs","sources":["../../../../libs/components/password-box/src/lib/password-box.component.ts","../../../../libs/components/password-box/src/lib/password-box.component.html","../../../../libs/components/password-box/src/lib/password-box.module.ts","../../../../libs/components/password-box/src/acorex-components-password-box.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Input,\n ViewChild,\n ViewEncapsulation,\n forwardRef,\n} from '@angular/core';\nimport {
|
1
|
+
{"version":3,"file":"acorex-components-password-box.mjs","sources":["../../../../libs/components/password-box/src/lib/password-box.component.ts","../../../../libs/components/password-box/src/lib/password-box.component.html","../../../../libs/components/password-box/src/lib/password-box.module.ts","../../../../libs/components/password-box/src/acorex-components-password-box.ts"],"sourcesContent":["import {\n AXClearableComponent,\n AXComponent,\n AXFocusableComponent,\n MXAppearanceComponent,\n MXInputBaseValueComponent,\n} from '@acorex/components/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Input,\n ViewChild,\n ViewEncapsulation,\n forwardRef,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { classes } from 'polytype';\n\n/**\n * The Textbox is a component which detects user interaction and triggers a corresponding event\n *\n * @category Components\n */\n@Component({\n selector: 'ax-password-box',\n templateUrl: 'password-box.component.html',\n inputs: ['disabled', 'readonly', 'tabIndex', 'placeholder', 'value', 'state', 'name', 'id', 'appearance'],\n outputs: [\n 'valueChange',\n 'stateChange',\n 'onValueChanged',\n 'onBlur',\n 'onFocus',\n 'readonlyChange',\n 'disabledChange',\n ],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n\n providers: [\n { provide: AXComponent, useExisting: AXPasswordBoxComponent },\n { provide: AXFocusableComponent, useExisting: AXPasswordBoxComponent },\n { provide: AXClearableComponent, useExisting: AXPasswordBoxComponent },\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AXPasswordBoxComponent),\n multi: true,\n },\n ],\n})\nexport class AXPasswordBoxComponent extends classes(\n MXInputBaseValueComponent<string>,\n MXAppearanceComponent,\n) {\n @ViewChild('input') input: ElementRef<HTMLInputElement>;\n\n protected _type: 'password' | 'text' = 'password';\n protected _icon: 'ax-icon-visibility' | 'ax-icon-visibility-off' = 'ax-icon-visibility';\n\n @Input()\n autoComplete: 'current-password' | 'new-password' | 'one-time-code' | 'off' = 'one-time-code';\n\n /**\n * A flag for showing or hiding password button.\n */\n @Input()\n showToggleButton: boolean = true;\n\n _handleModelChange(value: string) {\n this.commitValue(value, true);\n }\n\n toggleType() {\n if (this._type === 'password') {\n this._type = 'text';\n this._icon = 'ax-icon-visibility-off';\n } else {\n this._type = 'password';\n this._icon = 'ax-icon-visibility';\n }\n }\n\n @HostBinding('class')\n get __hostClass(): string {\n return `ax-editor-container ax-appearance-${this.appearance}`;\n }\n}\n","<ng-content select=\"ax-prefix\">\n</ng-content>\n<input #input class=\"ax-input\" [name]=\"name\" [type]=\"_type\" [id]=\"id\" [attr.placeholder]=\"placeholder\"\n [class.ax-state-disabled]=\"disabled\" [class.ax-state-readonly]=\"readonly\" [disabled]=\"disabled\"\n [readonly]=\"readonly\" [tabindex]=\"tabIndex\" [ngModel]=\"value\" [attr.autocomplete]=\"autoComplete\"\n (ngModelChange)=\"_handleModelChange($event)\" (keydown)=\"emitOnKeydownEvent($event)\"\n (keyup)=\"emitOnKeyupEvent($event)\" (keypress)=\"emitOnKeypressEvent($event)\" (focus)=\"emitOnFocusEvent($event)\"\n (blur)=\"emitOnBlurEvent($event)\">\n<ng-content select=\"ax-clear-button\"></ng-content>\n<button type=\"button\" class=\"ax-general-button ax-button-icon\" (click)=\"toggleType()\" [tabIndex]=\"-1\"\n *ngIf=\"showToggleButton\">\n <span class=\"ax-icon {{_icon}}\"></span>\n</button>\n<ng-content select=\"ax-suffix\">\n</ng-content>\n<ng-content select=\"ax-validation-rule\">\n</ng-content>","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { AXPasswordBoxComponent } from './password-box.component';\nimport { FormsModule } from '@angular/forms';\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\n\nconst COMPONENT = [AXPasswordBoxComponent];\nconst MODULES = [\n CommonModule,\n FormsModule,\n AXButtonModule,\n AXDecoratorModule,\n];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXPasswordBoxModule { }\n","/**\n * Generated bundle index. Do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O,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;AACvB,oBAAA,SAAS,EAAE,EAAE;AAChB,iBAAA,CAAA;;;ACpBD;;AAEG;;;;"}
|
@@ -37,6 +37,7 @@ class AXPopupComponent extends MXBaseComponent {
|
|
37
37
|
}
|
38
38
|
ngOnInit() {
|
39
39
|
super.ngOnInit();
|
40
|
+
debugger;
|
40
41
|
if (this._platform.is('Mobile')) {
|
41
42
|
this.data.draggable = false;
|
42
43
|
}
|
@@ -60,7 +61,7 @@ class AXPopupComponent extends MXBaseComponent {
|
|
60
61
|
ref = ref;
|
61
62
|
if (ref.instance) {
|
62
63
|
this._componentRef = ref.instance;
|
63
|
-
Object.assign(this._componentRef, this.data);
|
64
|
+
Object.assign(this._componentRef, this.data.data);
|
64
65
|
Object.assign(this._componentRef, { _isPopup: true });
|
65
66
|
if (ref.instance.onClosed) {
|
66
67
|
ref.instance.onClosed.subscribe((e) => {
|
@@ -108,13 +109,13 @@ class AXPopupComponent extends MXBaseComponent {
|
|
108
109
|
this.dialogRef.close({
|
109
110
|
component: this._componentRef,
|
110
111
|
htmlElement: this.getHostElement(),
|
111
|
-
data: data
|
112
|
+
data: data,
|
112
113
|
});
|
113
114
|
};
|
114
115
|
if (typeof this._componentRef.onClosing === 'function') {
|
115
116
|
const ee = {
|
116
117
|
cancel: false,
|
117
|
-
data
|
118
|
+
data,
|
118
119
|
};
|
119
120
|
const closingResult = this._componentRef.onClosing(ee);
|
120
121
|
if (closingResult instanceof Promise) {
|
@@ -169,6 +170,7 @@ class AXPopupService {
|
|
169
170
|
draggable: true,
|
170
171
|
hasBackdrop: true,
|
171
172
|
closeOnBackdropClick: false,
|
173
|
+
data: {},
|
172
174
|
};
|
173
175
|
if (typeof arg2 === 'string') {
|
174
176
|
config.title = arg2;
|
@@ -186,12 +188,13 @@ class AXPopupService {
|
|
186
188
|
backdropClass: config.backdropClass,
|
187
189
|
disableClose: config.closeOnBackdropClick ? false : true,
|
188
190
|
});
|
191
|
+
debugger;
|
189
192
|
const promise = new AXComponentClosedPromise((resolve) => {
|
190
|
-
dialogRef.closed.subscribe(d => {
|
193
|
+
dialogRef.closed.subscribe((d) => {
|
191
194
|
if (resolve) {
|
192
195
|
resolve({
|
193
196
|
sender: d.component,
|
194
|
-
data: d.data
|
197
|
+
data: d.data,
|
195
198
|
});
|
196
199
|
}
|
197
200
|
});
|