@xosue-utils/inputs 0.1.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/README.md +169 -0
- package/config/inputs-config.d.ts +18 -0
- package/config/media-adapters.d.ts +24 -0
- package/fesm2022/xosue-utils-inputs.mjs +11332 -0
- package/fesm2022/xosue-utils-inputs.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/boolean-entry/boolean-entry.component.d.ts +35 -0
- package/lib/color-picker/color-picker.component.d.ts +49 -0
- package/lib/color-picker/services/color-picker-modal/color-picker-modal.service.d.ts +23 -0
- package/lib/counter-entry/counter-entry.component.d.ts +37 -0
- package/lib/date-picker/date-picker.component.d.ts +85 -0
- package/lib/date-picker/date-picker.types.d.ts +6 -0
- package/lib/date-picker/services/date-picker-modal/date-picker-modal.service.d.ts +45 -0
- package/lib/datetime-picker/datetime-picker.component.d.ts +93 -0
- package/lib/datetime-picker/services/datetime-picker-modal/datetime-picker-modal.service.d.ts +51 -0
- package/lib/decimal-entry/decimal-entry.component.d.ts +31 -0
- package/lib/email-entry/email-entry.component.d.ts +29 -0
- package/lib/index.d.ts +84 -0
- package/lib/input-overlay-coordinator.service.d.ts +16 -0
- package/lib/integer-entry/integer-entry.component.d.ts +30 -0
- package/lib/media-entry/media-entry.component.d.ts +163 -0
- package/lib/month-picker/month-picker.component.d.ts +78 -0
- package/lib/month-picker/services/month-picker-modal/month-picker-modal.service.d.ts +38 -0
- package/lib/multichoice-entry/multichoice-entry.component.d.ts +28 -0
- package/lib/multiselect-combobox/multiselect-combobox.component.d.ts +100 -0
- package/lib/multiselect-combobox/services/multiselect-combobox-modal/multiselect-combobox-modal.service.d.ts +30 -0
- package/lib/only-select/only-select.component.d.ts +90 -0
- package/lib/only-select/only-select.types.d.ts +9 -0
- package/lib/only-select/services/only-select-modal/only-select-modal.service.d.ts +29 -0
- package/lib/onlychoice-entry/onlychoice-entry.component.d.ts +28 -0
- package/lib/otp-entry/otp-entry.component.d.ts +35 -0
- package/lib/password-entry/password-entry.component.d.ts +34 -0
- package/lib/phone-entry/phone-display.util.d.ts +19 -0
- package/lib/phone-entry/phone-entry.component.d.ts +80 -0
- package/lib/phone-entry/phone-entry.types.d.ts +6 -0
- package/lib/phone-entry/services/phone-entry-modal/phone-entry-modal.service.d.ts +24 -0
- package/lib/price-entry/price-entry.component.d.ts +42 -0
- package/lib/range-entry/range-entry.component.d.ts +74 -0
- package/lib/rating-entry/rating-entry.component.d.ts +25 -0
- package/lib/rich-text-entry/caludy-image.node.d.ts +36 -0
- package/lib/rich-text-entry/lexical-editor-theme.d.ts +3 -0
- package/lib/rich-text-entry/rich-text-entry.component.d.ts +92 -0
- package/lib/search-entry/search-entry.component.d.ts +65 -0
- package/lib/search-entry/search-entry.types.d.ts +8 -0
- package/lib/search-entry/services/search-entry-modal/search-entry-modal.service.d.ts +29 -0
- package/lib/signature-entry/signature-entry.component.d.ts +47 -0
- package/lib/slider-entry/slider-entry.component.d.ts +69 -0
- package/lib/switch-entry/switch-entry.component.d.ts +66 -0
- package/lib/tags-entry/tags-entry.component.d.ts +35 -0
- package/lib/text-area-entry/text-area-entry.component.d.ts +27 -0
- package/lib/text-entry/text-entry.component.d.ts +38 -0
- package/lib/time-picker/services/time-picker-modal/time-picker-modal.service.d.ts +30 -0
- package/lib/time-picker/time-picker.component.d.ts +70 -0
- package/lib/url-entry/url-entry.component.d.ts +29 -0
- package/package.json +55 -0
- package/public-api.d.ts +8 -0
- package/vendor/context-menu-service/context-menu-service.component.d.ts +37 -0
- package/vendor/context-menu-service/context-menu.service.d.ts +63 -0
- package/vendor/drag-scroll.directive.d.ts +10 -0
- package/vendor/field-help-tooltip/field-help-tooltip.component.d.ts +9 -0
- package/vendor/file-size.pipe.d.ts +7 -0
- package/vendor/lucide-icon/lucide-icon.component.d.ts +26 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { OnInit, OnDestroy, ElementRef } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class SliderEntryComponent implements ControlValueAccessor, OnInit, OnDestroy {
|
|
5
|
+
private cdr;
|
|
6
|
+
private elementRef;
|
|
7
|
+
private platformId;
|
|
8
|
+
trackRef: ElementRef<HTMLDivElement>;
|
|
9
|
+
label: string;
|
|
10
|
+
description: string;
|
|
11
|
+
opcional: boolean;
|
|
12
|
+
min: number;
|
|
13
|
+
max: number;
|
|
14
|
+
decimal: boolean;
|
|
15
|
+
step: number | null;
|
|
16
|
+
get hostDisabledClass(): boolean;
|
|
17
|
+
set disabled(value: boolean);
|
|
18
|
+
value: number;
|
|
19
|
+
isDisabled: boolean;
|
|
20
|
+
isDragging: boolean;
|
|
21
|
+
private documentMouseMoveHandler;
|
|
22
|
+
private documentMouseUpHandler;
|
|
23
|
+
private documentTouchMoveHandler;
|
|
24
|
+
private documentTouchEndHandler;
|
|
25
|
+
/**
|
|
26
|
+
* Normaliza un valor según el modo decimal.
|
|
27
|
+
* - Si decimal es true: redondea a 2 decimales (o formatea enteros con .00)
|
|
28
|
+
* - Si decimal es false: convierte a entero
|
|
29
|
+
* @param value - Valor a normalizar
|
|
30
|
+
* @returns Valor normalizado
|
|
31
|
+
*/
|
|
32
|
+
private normalizeValue;
|
|
33
|
+
private onChange;
|
|
34
|
+
private onTouched;
|
|
35
|
+
writeValue(value: number | null): void;
|
|
36
|
+
registerOnChange(fn: (val: number) => void): void;
|
|
37
|
+
registerOnTouched(fn: () => void): void;
|
|
38
|
+
setDisabledState(isDisabled: boolean): void;
|
|
39
|
+
onSliderInput(event: Event): void;
|
|
40
|
+
onSliderChange(): void;
|
|
41
|
+
onInputChange(event: Event): void;
|
|
42
|
+
onKeydown(event: KeyboardEvent): void;
|
|
43
|
+
ngOnInit(): void;
|
|
44
|
+
ngOnDestroy(): void;
|
|
45
|
+
onThumbMouseDown(event: MouseEvent): void;
|
|
46
|
+
onThumbTouchStart(event: TouchEvent): void;
|
|
47
|
+
onTrackClick(event: MouseEvent): void;
|
|
48
|
+
onTrackTouchStart(event: TouchEvent): void;
|
|
49
|
+
private handleDocumentMouseMove;
|
|
50
|
+
private handleDocumentMouseUp;
|
|
51
|
+
private handleDocumentTouchMove;
|
|
52
|
+
private handleDocumentTouchEnd;
|
|
53
|
+
private touchToMouseEvent;
|
|
54
|
+
private updateValueFromEvent;
|
|
55
|
+
private updateRangeInput;
|
|
56
|
+
/**
|
|
57
|
+
* Retorna el step según el modo decimal o el step personalizado.
|
|
58
|
+
* - Si step es null: 0.01 (decimal) o 1 (entero) según el modo
|
|
59
|
+
* - Si step está definido: usa ese valor
|
|
60
|
+
*/
|
|
61
|
+
get calculatedStep(): number;
|
|
62
|
+
get fillStyle(): {
|
|
63
|
+
[key: string]: string;
|
|
64
|
+
};
|
|
65
|
+
get thumbPosition(): number;
|
|
66
|
+
manualClick(event?: MouseEvent): void;
|
|
67
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SliderEntryComponent, never>;
|
|
68
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SliderEntryComponent, "slider-entry", never, { "label": { "alias": "label"; "required": false; }; "description": { "alias": "description"; "required": false; }; "opcional": { "alias": "opcional"; "required": false; }; "min": { "alias": "min"; "required": false; }; "max": { "alias": "max"; "required": false; }; "decimal": { "alias": "decimal"; "required": false; }; "step": { "alias": "step"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
|
|
69
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
type SwitchLabels = [string, string];
|
|
5
|
+
type SwitchEntryModelValue = boolean | string | null;
|
|
6
|
+
export declare class SwitchEntryComponent implements ControlValueAccessor, OnChanges, OnDestroy {
|
|
7
|
+
private cdr;
|
|
8
|
+
private hostRef;
|
|
9
|
+
private platformId;
|
|
10
|
+
label: string;
|
|
11
|
+
description: string;
|
|
12
|
+
opcional: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Si se brinda:
|
|
15
|
+
* - `values[0]` = equivalente a false/off (izquierda)
|
|
16
|
+
* - `values[1]` = equivalente a true/on (derecha)
|
|
17
|
+
*
|
|
18
|
+
* En ese caso el valor que emite el control es string (uno de esos 2).
|
|
19
|
+
* Si NO se brinda, el control funciona como boolean (true/false).
|
|
20
|
+
*/
|
|
21
|
+
values: SwitchLabels | null | undefined;
|
|
22
|
+
get hostDisabledClass(): boolean;
|
|
23
|
+
set disabled(v: boolean);
|
|
24
|
+
/** Estado interno (solo para UI). */
|
|
25
|
+
private boolValue;
|
|
26
|
+
/** Último valor del modelo (boolean o string según modo). */
|
|
27
|
+
private modelValue;
|
|
28
|
+
isDisabled: boolean;
|
|
29
|
+
private dragging;
|
|
30
|
+
private pointerId;
|
|
31
|
+
private startX;
|
|
32
|
+
private startLeft;
|
|
33
|
+
private currentLeft;
|
|
34
|
+
private moved;
|
|
35
|
+
private onChange;
|
|
36
|
+
private onTouched;
|
|
37
|
+
writeValue(v: SwitchEntryModelValue): void;
|
|
38
|
+
registerOnChange(fn: (v: SwitchEntryModelValue) => void): void;
|
|
39
|
+
registerOnTouched(fn: () => void): void;
|
|
40
|
+
setDisabledState(isDisabled: boolean): void;
|
|
41
|
+
get ariaChecked(): 'true' | 'false';
|
|
42
|
+
get isOn(): boolean;
|
|
43
|
+
get isDragging(): boolean;
|
|
44
|
+
get displayText(): string;
|
|
45
|
+
onTrackClick(e: MouseEvent): void;
|
|
46
|
+
onPointerDown(e: PointerEvent): void;
|
|
47
|
+
onPointerMove(e: PointerEvent): void;
|
|
48
|
+
onPointerUp(e: PointerEvent): void;
|
|
49
|
+
onPointerCancel(e: PointerEvent): void;
|
|
50
|
+
private toggleByClick;
|
|
51
|
+
private setValue;
|
|
52
|
+
private getTrackEl;
|
|
53
|
+
private getMaxLeft;
|
|
54
|
+
private getThumbLeftForValue;
|
|
55
|
+
get thumbLeftPx(): number;
|
|
56
|
+
/** Porcentaje (0–100%) usado para el relleno/gradiente del track. */
|
|
57
|
+
get trackFillWidth(): string;
|
|
58
|
+
private resetThumbToValue;
|
|
59
|
+
ngOnDestroy(): void;
|
|
60
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
61
|
+
private boolToModel;
|
|
62
|
+
private modelToBool;
|
|
63
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SwitchEntryComponent, never>;
|
|
64
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SwitchEntryComponent, "switch-entry", never, { "label": { "alias": "label"; "required": false; }; "description": { "alias": "description"; "required": false; }; "opcional": { "alias": "opcional"; "required": false; }; "values": { "alias": "values"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
|
|
65
|
+
}
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class TagsEntryComponent implements ControlValueAccessor {
|
|
5
|
+
private cdr;
|
|
6
|
+
private elementRef;
|
|
7
|
+
label: string;
|
|
8
|
+
description: string;
|
|
9
|
+
opcional: boolean;
|
|
10
|
+
placeholder: string;
|
|
11
|
+
get hostDisabledClass(): boolean;
|
|
12
|
+
set disabled(value: boolean);
|
|
13
|
+
tagInputRef: ElementRef<HTMLInputElement>;
|
|
14
|
+
tags: string[] | null;
|
|
15
|
+
inputValue: string;
|
|
16
|
+
isDisabled: boolean;
|
|
17
|
+
isFocus: boolean;
|
|
18
|
+
private onChange;
|
|
19
|
+
private onTouched;
|
|
20
|
+
writeValue(value: string[] | null): void;
|
|
21
|
+
registerOnChange(fn: (tags: string[] | null) => void): void;
|
|
22
|
+
registerOnTouched(fn: () => void): void;
|
|
23
|
+
setDisabledState(disabled: boolean): void;
|
|
24
|
+
private emitChange;
|
|
25
|
+
onFocus(event: FocusEvent): void;
|
|
26
|
+
onBlur(event: FocusEvent): void;
|
|
27
|
+
onInputKeydown(event: KeyboardEvent): void;
|
|
28
|
+
onPaste(event: ClipboardEvent): void;
|
|
29
|
+
addTag(tag: string): void;
|
|
30
|
+
removeTag(index: number): void;
|
|
31
|
+
clearAll(): void;
|
|
32
|
+
manualClick(event?: MouseEvent): void;
|
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TagsEntryComponent, never>;
|
|
34
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TagsEntryComponent, "tags-entry", never, { "label": { "alias": "label"; "required": false; }; "description": { "alias": "description"; "required": false; }; "opcional": { "alias": "opcional"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class TextAreaEntryComponent implements ControlValueAccessor {
|
|
4
|
+
private cdr;
|
|
5
|
+
private elementRef;
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
opcional: boolean;
|
|
9
|
+
placeholder: string;
|
|
10
|
+
get hostDisabledClass(): boolean;
|
|
11
|
+
set disabled(value: boolean);
|
|
12
|
+
isDisabled: boolean;
|
|
13
|
+
isFocus: boolean;
|
|
14
|
+
value: string;
|
|
15
|
+
private onChange;
|
|
16
|
+
private onTouched;
|
|
17
|
+
writeValue(value: string | null): void;
|
|
18
|
+
registerOnChange(fn: (value: string | null) => void): void;
|
|
19
|
+
registerOnTouched(fn: () => void): void;
|
|
20
|
+
setDisabledState(isDisabled: boolean): void;
|
|
21
|
+
onInput(event: Event): void;
|
|
22
|
+
onFocus(): void;
|
|
23
|
+
onBlur(): void;
|
|
24
|
+
manualClick(event?: MouseEvent): void;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TextAreaEntryComponent, never>;
|
|
26
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TextAreaEntryComponent, "text-area-entry", never, { "label": { "alias": "label"; "required": false; }; "description": { "alias": "description"; "required": false; }; "opcional": { "alias": "opcional"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class TextEntryComponent implements ControlValueAccessor, OnInit {
|
|
5
|
+
private cdr;
|
|
6
|
+
private elementRef;
|
|
7
|
+
label: string;
|
|
8
|
+
description: string;
|
|
9
|
+
opcional: boolean;
|
|
10
|
+
placeholder: string;
|
|
11
|
+
prefix: string | null;
|
|
12
|
+
suffix: string | null;
|
|
13
|
+
concatPrefix: boolean;
|
|
14
|
+
concatSuffix: boolean;
|
|
15
|
+
/** Texto de ayuda mostrado al pulsar el botón de información. */
|
|
16
|
+
fieldHelp: string;
|
|
17
|
+
get hostDisabledClass(): boolean;
|
|
18
|
+
set disabled(value: boolean);
|
|
19
|
+
isDisabled: boolean;
|
|
20
|
+
isFocus: boolean;
|
|
21
|
+
rawValue: string | null;
|
|
22
|
+
outputValue: string | null;
|
|
23
|
+
ngOnInit(): void;
|
|
24
|
+
private onChange;
|
|
25
|
+
onTouched: () => void;
|
|
26
|
+
writeValue(value: string | null): void;
|
|
27
|
+
registerOnChange(fn: (value: string | null) => void): void;
|
|
28
|
+
registerOnTouched(fn: () => void): void;
|
|
29
|
+
setDisabledState(isDisabled: boolean): void;
|
|
30
|
+
private buildOutputValue;
|
|
31
|
+
private emitValue;
|
|
32
|
+
onInput(event: Event): void;
|
|
33
|
+
onFocus(event: FocusEvent): void;
|
|
34
|
+
onBlur(event: FocusEvent): void;
|
|
35
|
+
manualClick(event?: MouseEvent): void;
|
|
36
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TextEntryComponent, never>;
|
|
37
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TextEntryComponent, "text-entry", never, { "label": { "alias": "label"; "required": false; }; "description": { "alias": "description"; "required": false; }; "opcional": { "alias": "opcional"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "prefix": { "alias": "prefix"; "required": false; }; "suffix": { "alias": "suffix"; "required": false; }; "concatPrefix": { "alias": "concatPrefix"; "required": false; }; "concatSuffix": { "alias": "concatSuffix"; "required": false; }; "fieldHelp": { "alias": "fieldHelp"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export interface TimePickerModalViewModel {
|
|
3
|
+
selectedValue: string | null;
|
|
4
|
+
selectedHour: number | null;
|
|
5
|
+
selectedMinute: number | null;
|
|
6
|
+
selectedDateExtended: string;
|
|
7
|
+
HOURS: readonly number[];
|
|
8
|
+
MINUTES: readonly number[];
|
|
9
|
+
}
|
|
10
|
+
export interface TimePickerModalHandlers {
|
|
11
|
+
toggleShowPicker: (e: Event) => void;
|
|
12
|
+
onSelectHour: (h: number, e: Event) => void;
|
|
13
|
+
onSelectMinute: (m: number, e: Event) => void;
|
|
14
|
+
onCancel: () => void;
|
|
15
|
+
onClear: () => void;
|
|
16
|
+
onAccept: () => void;
|
|
17
|
+
}
|
|
18
|
+
export interface TimePickerModalSession {
|
|
19
|
+
view: TimePickerModalViewModel;
|
|
20
|
+
handlers: TimePickerModalHandlers;
|
|
21
|
+
}
|
|
22
|
+
export declare class TimePickerModalService {
|
|
23
|
+
private readonly state;
|
|
24
|
+
readonly state$: import("rxjs").Observable<TimePickerModalSession>;
|
|
25
|
+
open(session: TimePickerModalSession): void;
|
|
26
|
+
patchView(patch: Partial<TimePickerModalViewModel>): void;
|
|
27
|
+
close(): void;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TimePickerModalService, never>;
|
|
29
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TimePickerModalService>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { EventEmitter, OnInit, OnDestroy } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class TimePickerComponent implements ControlValueAccessor, OnInit, OnDestroy {
|
|
5
|
+
private cdr;
|
|
6
|
+
private elementRef;
|
|
7
|
+
private timePickerModal;
|
|
8
|
+
private inputOverlayCoordinator;
|
|
9
|
+
private readonly overlayToken;
|
|
10
|
+
private static readonly modalRootSelector;
|
|
11
|
+
private get hostElement();
|
|
12
|
+
label: string;
|
|
13
|
+
opcional: boolean;
|
|
14
|
+
description: string;
|
|
15
|
+
placeholder: string;
|
|
16
|
+
format: string;
|
|
17
|
+
get hostDisabledClass(): boolean;
|
|
18
|
+
set disabled(value: boolean);
|
|
19
|
+
selectionChange: EventEmitter<string>;
|
|
20
|
+
private onChange;
|
|
21
|
+
private onTouched;
|
|
22
|
+
writeValue(value: string | null | undefined): void;
|
|
23
|
+
registerOnChange(fn: (value: string | null) => void): void;
|
|
24
|
+
registerOnTouched(fn: () => void): void;
|
|
25
|
+
setDisabledState(isDisabled: boolean): void;
|
|
26
|
+
selectedValue: string | null;
|
|
27
|
+
private previousSelectedValue;
|
|
28
|
+
selectedHour: number | null;
|
|
29
|
+
selectedMinute: number | null;
|
|
30
|
+
isDisabled: boolean;
|
|
31
|
+
isFocus: boolean;
|
|
32
|
+
showPicker: boolean;
|
|
33
|
+
ngOnInit(): void;
|
|
34
|
+
ngOnDestroy(): void;
|
|
35
|
+
private setFromDate;
|
|
36
|
+
/**
|
|
37
|
+
* @param notifyModel si es `true`, notifica al `FormControl` (acción de usuario).
|
|
38
|
+
* En `writeValue` del CVA debe ser `false`: el modelo ya viene del formulario.
|
|
39
|
+
*/
|
|
40
|
+
private clearSelection;
|
|
41
|
+
private updateSelectedValue;
|
|
42
|
+
onSelectHour(hour: number): void;
|
|
43
|
+
onSelectMinute(minute: number): void;
|
|
44
|
+
scrollToCurrentHours(): void;
|
|
45
|
+
scrollToCurrentMinutes(): void;
|
|
46
|
+
toggleShowPicker(e: Event): void;
|
|
47
|
+
private applyCancelState;
|
|
48
|
+
onCancel(): void;
|
|
49
|
+
onClear(): void;
|
|
50
|
+
onAccept(): void;
|
|
51
|
+
private buildModalView;
|
|
52
|
+
private syncModalView;
|
|
53
|
+
private openModalPortal;
|
|
54
|
+
private closeModalPortal;
|
|
55
|
+
private onOverlayDismissedByCoordinator;
|
|
56
|
+
private closePicker;
|
|
57
|
+
private buildHandlers;
|
|
58
|
+
focus(): void;
|
|
59
|
+
defocus(): void;
|
|
60
|
+
/**
|
|
61
|
+
* Simula un click en el input interno (si existe) para enfocarlo.
|
|
62
|
+
* @param event Evento del mouse (opcional).
|
|
63
|
+
*/
|
|
64
|
+
manualClick(event?: MouseEvent): void;
|
|
65
|
+
get selectedDateExtended(): string;
|
|
66
|
+
readonly HOURS: number[];
|
|
67
|
+
readonly MINUTES: number[];
|
|
68
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TimePickerComponent, never>;
|
|
69
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TimePickerComponent, "time-picker", never, { "label": { "alias": "label"; "required": false; }; "opcional": { "alias": "opcional"; "required": false; }; "description": { "alias": "description"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "format": { "alias": "format"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "selectionChange": "selectionChange"; }, never, never, true, never>;
|
|
70
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class UrlEntryComponent implements ControlValueAccessor {
|
|
4
|
+
private cdr;
|
|
5
|
+
private elementRef;
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
opcional: boolean;
|
|
9
|
+
placeholder: string;
|
|
10
|
+
get hostDisabledClass(): boolean;
|
|
11
|
+
set disabled(value: boolean);
|
|
12
|
+
isDisabled: boolean;
|
|
13
|
+
isFocus: boolean;
|
|
14
|
+
textValue: string;
|
|
15
|
+
error: boolean;
|
|
16
|
+
private onChange;
|
|
17
|
+
private onTouched;
|
|
18
|
+
writeValue(value: string | null): void;
|
|
19
|
+
registerOnChange(fn: (value: string | null) => void): void;
|
|
20
|
+
registerOnTouched(fn: () => void): void;
|
|
21
|
+
setDisabledState(isDisabled: boolean): void;
|
|
22
|
+
onFocus(): void;
|
|
23
|
+
onBlur(): void;
|
|
24
|
+
onInput(event: Event): void;
|
|
25
|
+
private isValidHttpsUrl;
|
|
26
|
+
manualClick(event?: MouseEvent): void;
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UrlEntryComponent, never>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UrlEntryComponent, "url-entry", never, { "label": { "alias": "label"; "required": false; }; "description": { "alias": "description"; "required": false; }; "opcional": { "alias": "opcional"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
|
|
29
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xosue-utils/inputs",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Angular standalone form inputs (text, select, date, media, rich-text, …) shared across Caludy / Orquesta / Mayoristas.",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"private": false,
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/YOUR_ORG/xosue-utils.git"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"angular",
|
|
14
|
+
"inputs",
|
|
15
|
+
"forms",
|
|
16
|
+
"xosue-utils"
|
|
17
|
+
],
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"@angular/common": "^19.0.0",
|
|
20
|
+
"@angular/core": "^19.0.0",
|
|
21
|
+
"@angular/forms": "^19.0.0",
|
|
22
|
+
"@angular/platform-browser": "^19.0.0",
|
|
23
|
+
"@angular/router": "^19.0.0",
|
|
24
|
+
"@lexical/history": "^0.42.0",
|
|
25
|
+
"@lexical/html": "^0.42.0",
|
|
26
|
+
"@lexical/link": "^0.42.0",
|
|
27
|
+
"@lexical/list": "^0.42.0",
|
|
28
|
+
"@lexical/rich-text": "^0.42.0",
|
|
29
|
+
"@lexical/selection": "^0.42.0",
|
|
30
|
+
"@lexical/table": "^0.42.0",
|
|
31
|
+
"@lexical/utils": "^0.42.0",
|
|
32
|
+
"@lucide/angular": "^0.500.0 || ^1.0.0",
|
|
33
|
+
"lexical": "^0.42.0",
|
|
34
|
+
"luxon": "^3.0.0",
|
|
35
|
+
"rxjs": "^7.8.0",
|
|
36
|
+
"sortablejs": "^1.15.0"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"tslib": "^2.6.0"
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
},
|
|
44
|
+
"module": "fesm2022/xosue-utils-inputs.mjs",
|
|
45
|
+
"typings": "index.d.ts",
|
|
46
|
+
"exports": {
|
|
47
|
+
"./package.json": {
|
|
48
|
+
"default": "./package.json"
|
|
49
|
+
},
|
|
50
|
+
".": {
|
|
51
|
+
"types": "./index.d.ts",
|
|
52
|
+
"default": "./fesm2022/xosue-utils-inputs.mjs"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
package/public-api.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './config/inputs-config';
|
|
2
|
+
export * from './lib/index';
|
|
3
|
+
export { LucideIconComponent } from './vendor/lucide-icon/lucide-icon.component';
|
|
4
|
+
export { FieldHelpTooltipComponent } from './vendor/field-help-tooltip/field-help-tooltip.component';
|
|
5
|
+
export { ContextMenuService, type ContextMenuOption, type ContextMenuInfo, } from './vendor/context-menu-service/context-menu.service';
|
|
6
|
+
export { ContextMenuServiceComponent } from './vendor/context-menu-service/context-menu-service.component';
|
|
7
|
+
export { DragScrollDirective } from './vendor/drag-scroll.directive';
|
|
8
|
+
export { FileSizePipe } from './vendor/file-size.pipe';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ElementRef, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { ContextMenuOption, ContextMenuRequest, ContextMenuService } from './context-menu.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class ContextMenuServiceComponent implements OnInit, OnDestroy {
|
|
5
|
+
private contextMenuService;
|
|
6
|
+
private platformId;
|
|
7
|
+
private static readonly VIEWPORT_EDGE_INSET;
|
|
8
|
+
private static readonly ANCHOR_OFFSET;
|
|
9
|
+
private readonly cdr;
|
|
10
|
+
panelRef?: ElementRef<HTMLElement>;
|
|
11
|
+
active: ContextMenuRequest | null;
|
|
12
|
+
position: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
};
|
|
16
|
+
panelVisible: boolean;
|
|
17
|
+
private anchor;
|
|
18
|
+
/** Timestamp hasta el cual ignoramos cierres (evita que el gesto de apertura cierre el menú). */
|
|
19
|
+
private ignoreOutsideUntil;
|
|
20
|
+
private sub?;
|
|
21
|
+
private closeSub?;
|
|
22
|
+
private readonly scrollListener;
|
|
23
|
+
private readonly outsidePointerListener;
|
|
24
|
+
private readonly outsideContextMenuListener;
|
|
25
|
+
constructor(contextMenuService: ContextMenuService, platformId: object);
|
|
26
|
+
ngOnInit(): void;
|
|
27
|
+
ngOnDestroy(): void;
|
|
28
|
+
onWindowResize(): void;
|
|
29
|
+
onEscape(event: KeyboardEvent): void;
|
|
30
|
+
selectOption(option: ContextMenuOption): void;
|
|
31
|
+
private handleOutsideEvent;
|
|
32
|
+
private dismissCurrent;
|
|
33
|
+
private clearMenu;
|
|
34
|
+
private applyClampedPosition;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ContextMenuServiceComponent, never>;
|
|
36
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ContextMenuServiceComponent, "context-menu-service", never, {}, {}, never, never, true, never>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export interface ContextMenuOption<T = unknown> {
|
|
3
|
+
icon: string;
|
|
4
|
+
name: string;
|
|
5
|
+
value: T;
|
|
6
|
+
/** Estilo destructivo (rojo). */
|
|
7
|
+
danger?: boolean;
|
|
8
|
+
/** Separador visual antes de esta opción. */
|
|
9
|
+
separatorBefore?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface ContextMenuInfo {
|
|
13
|
+
icon: string;
|
|
14
|
+
title: string;
|
|
15
|
+
info: string;
|
|
16
|
+
}
|
|
17
|
+
export type ContextMenuKind = 'menu' | 'info';
|
|
18
|
+
interface ContextMenuRequestBase {
|
|
19
|
+
id: number;
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
}
|
|
23
|
+
export interface ContextMenuMenuRequest extends ContextMenuRequestBase {
|
|
24
|
+
kind: 'menu';
|
|
25
|
+
title?: string;
|
|
26
|
+
options: ContextMenuOption[];
|
|
27
|
+
resolve: (value: ContextMenuOption | null) => void;
|
|
28
|
+
}
|
|
29
|
+
export interface ContextMenuInfoRequest extends ContextMenuRequestBase {
|
|
30
|
+
kind: 'info';
|
|
31
|
+
info: ContextMenuInfo;
|
|
32
|
+
resolve: () => void;
|
|
33
|
+
}
|
|
34
|
+
export type ContextMenuRequest = ContextMenuMenuRequest | ContextMenuInfoRequest;
|
|
35
|
+
export type ContextMenuOpenEvent = MouseEvent | {
|
|
36
|
+
clientX: number;
|
|
37
|
+
clientY: number;
|
|
38
|
+
};
|
|
39
|
+
export interface ContextMenuOpenOptions {
|
|
40
|
+
title?: string;
|
|
41
|
+
/** Si true (default), evita el menú nativo del navegador cuando el evento es MouseEvent. */
|
|
42
|
+
preventDefault?: boolean;
|
|
43
|
+
}
|
|
44
|
+
export declare class ContextMenuService {
|
|
45
|
+
private platformId;
|
|
46
|
+
private readonly requestSubject;
|
|
47
|
+
readonly request$: import("rxjs").Observable<ContextMenuRequest>;
|
|
48
|
+
private readonly closeSubject;
|
|
49
|
+
readonly close$: import("rxjs").Observable<void>;
|
|
50
|
+
private idCounter;
|
|
51
|
+
private readonly isBrowser;
|
|
52
|
+
constructor(platformId: object);
|
|
53
|
+
/** Menú contextual en el punto del clic. Solo uno activo a la vez. */
|
|
54
|
+
openMenu(event: ContextMenuOpenEvent, options: ContextMenuOption[], menuOptions?: ContextMenuOpenOptions): Promise<ContextMenuOption | null>;
|
|
55
|
+
/** Globo informativo en el punto del clic. */
|
|
56
|
+
openInfo(event: ContextMenuOpenEvent, info: ContextMenuInfo): Promise<void>;
|
|
57
|
+
/** Cierra el menú contextual activo desde código. */
|
|
58
|
+
close(): void;
|
|
59
|
+
private pointFromEvent;
|
|
60
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ContextMenuService, never>;
|
|
61
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ContextMenuService>;
|
|
62
|
+
}
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class DragScrollDirective implements AfterViewInit {
|
|
4
|
+
private el;
|
|
5
|
+
direction?: 'horizontal' | 'vertical';
|
|
6
|
+
constructor(el: ElementRef<HTMLElement>);
|
|
7
|
+
ngAfterViewInit(): void;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DragScrollDirective, never>;
|
|
9
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DragScrollDirective, "[dragScroll]", never, { "direction": { "alias": "dragScroll"; "required": false; }; }, {}, never, never, true, never>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class FieldHelpTooltipComponent {
|
|
3
|
+
private readonly contextMenuService;
|
|
4
|
+
text: string;
|
|
5
|
+
title: string;
|
|
6
|
+
showHelp(event: MouseEvent): void;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FieldHelpTooltipComponent, never>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FieldHelpTooltipComponent, "field-help-tooltip", never, { "text": { "alias": "text"; "required": true; }; "title": { "alias": "title"; "required": false; }; }, {}, never, never, true, never>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class FileSizePipe implements PipeTransform {
|
|
4
|
+
transform(bytes: number | null | undefined, decimals?: number): string;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FileSizePipe, never>;
|
|
6
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<FileSizePipe, "fileSize", true>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* Icono Lucide.
|
|
4
|
+
*
|
|
5
|
+
* HTML:
|
|
6
|
+
* <lucide-icon name="star"></lucide-icon>
|
|
7
|
+
* <lucide-icon name="heart" filled></lucide-icon> // relleno + trazo
|
|
8
|
+
*
|
|
9
|
+
* SASS — variables CSS (heredan del padre):
|
|
10
|
+
* --lucide-stroke: var(--primary)
|
|
11
|
+
* --lucide-fill: var(--accent)
|
|
12
|
+
* --lucide-stroke-width: 2
|
|
13
|
+
*/
|
|
14
|
+
export declare class LucideIconComponent {
|
|
15
|
+
readonly name: import("@angular/core").InputSignal<string>;
|
|
16
|
+
readonly size: import("@angular/core").InputSignal<string | number>;
|
|
17
|
+
readonly spin: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
18
|
+
/** Activa relleno (--lucide-fill); el trazo se conserva. */
|
|
19
|
+
readonly filled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
20
|
+
readonly dimStyle: import("@angular/core").Signal<{
|
|
21
|
+
width: string;
|
|
22
|
+
height: string;
|
|
23
|
+
}>;
|
|
24
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LucideIconComponent, never>;
|
|
25
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LucideIconComponent, "lucide-icon", never, { "name": { "alias": "name"; "required": true; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "spin": { "alias": "spin"; "required": false; "isSignal": true; }; "filled": { "alias": "filled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
26
|
+
}
|