iss-ctrl 0.0.21 → 0.0.22
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 +33 -0
- package/fesm2022/iss-ctrl-attachment.viewer-DVUL39xd.mjs +110 -0
- package/fesm2022/iss-ctrl-attachment.viewer-DVUL39xd.mjs.map +1 -0
- package/fesm2022/iss-ctrl-base.mjs +663 -0
- package/fesm2022/iss-ctrl-base.mjs.map +1 -0
- package/fesm2022/iss-ctrl-checkbox.field-Dj5EGLUr.mjs +92 -0
- package/fesm2022/iss-ctrl-checkbox.field-Dj5EGLUr.mjs.map +1 -0
- package/fesm2022/iss-ctrl-checkbox.mjs +143 -0
- package/fesm2022/iss-ctrl-checkbox.mjs.map +1 -0
- package/fesm2022/iss-ctrl-checkbox.viewer-C3SEUszR.mjs +31 -0
- package/fesm2022/iss-ctrl-checkbox.viewer-C3SEUszR.mjs.map +1 -0
- package/fesm2022/iss-ctrl-chips.field-BLLAjBbP.mjs +76 -0
- package/fesm2022/iss-ctrl-chips.field-BLLAjBbP.mjs.map +1 -0
- package/fesm2022/iss-ctrl-chips.mjs +168 -0
- package/fesm2022/iss-ctrl-chips.mjs.map +1 -0
- package/fesm2022/iss-ctrl-chips.viewer-BcKT2hcq.mjs +38 -0
- package/fesm2022/iss-ctrl-chips.viewer-BcKT2hcq.mjs.map +1 -0
- package/fesm2022/iss-ctrl-date-picker.field-BSpXukpO.mjs +98 -0
- package/fesm2022/iss-ctrl-date-picker.field-BSpXukpO.mjs.map +1 -0
- package/fesm2022/iss-ctrl-date-picker.mjs +200 -0
- package/fesm2022/iss-ctrl-date-picker.mjs.map +1 -0
- package/fesm2022/iss-ctrl-date-picker.viewer-Dsmsf91t.mjs +40 -0
- package/fesm2022/iss-ctrl-date-picker.viewer-Dsmsf91t.mjs.map +1 -0
- package/fesm2022/iss-ctrl-date-range-picker.field-CjNHU1RW.mjs +97 -0
- package/fesm2022/iss-ctrl-date-range-picker.field-CjNHU1RW.mjs.map +1 -0
- package/fesm2022/iss-ctrl-date-range-picker.mjs +307 -0
- package/fesm2022/iss-ctrl-date-range-picker.mjs.map +1 -0
- package/fesm2022/iss-ctrl-date-range-picker.viewer-tmTQGPFh.mjs +41 -0
- package/fesm2022/iss-ctrl-date-range-picker.viewer-tmTQGPFh.mjs.map +1 -0
- package/fesm2022/iss-ctrl-datetime-picker.field-DGMY9PaU.mjs +98 -0
- package/fesm2022/iss-ctrl-datetime-picker.field-DGMY9PaU.mjs.map +1 -0
- package/fesm2022/iss-ctrl-datetime-picker.mjs +226 -0
- package/fesm2022/iss-ctrl-datetime-picker.mjs.map +1 -0
- package/fesm2022/iss-ctrl-datetime-picker.viewer-BeUyEBKo.mjs +42 -0
- package/fesm2022/iss-ctrl-datetime-picker.viewer-BeUyEBKo.mjs.map +1 -0
- package/fesm2022/iss-ctrl-file-picker.field-CbepZaX6.mjs +210 -0
- package/fesm2022/iss-ctrl-file-picker.field-CbepZaX6.mjs.map +1 -0
- package/fesm2022/iss-ctrl-file-picker.mjs +272 -0
- package/fesm2022/iss-ctrl-file-picker.mjs.map +1 -0
- package/fesm2022/iss-ctrl-input.field-Ctlf3OCN.mjs +104 -0
- package/fesm2022/iss-ctrl-input.field-Ctlf3OCN.mjs.map +1 -0
- package/fesm2022/iss-ctrl-input.mjs +204 -0
- package/fesm2022/iss-ctrl-input.mjs.map +1 -0
- package/fesm2022/iss-ctrl-input.viewer-BOZnW0_e.mjs +22 -0
- package/fesm2022/iss-ctrl-input.viewer-BOZnW0_e.mjs.map +1 -0
- package/fesm2022/iss-ctrl-iss-ctrl-DvnkwSMG.mjs +1789 -0
- package/fesm2022/iss-ctrl-iss-ctrl-DvnkwSMG.mjs.map +1 -0
- package/fesm2022/{iss-ctrl-load-event-bOt6IlIo.mjs → iss-ctrl-load-event-CuZ7pMjk.mjs} +4 -3
- package/fesm2022/iss-ctrl-load-event-CuZ7pMjk.mjs.map +1 -0
- package/fesm2022/{iss-ctrl-load-options-event-CxyAyNMe.mjs → iss-ctrl-load-options-event-B10rhdqh.mjs} +3 -3
- package/fesm2022/{iss-ctrl-load-options-event-CxyAyNMe.mjs.map → iss-ctrl-load-options-event-B10rhdqh.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-load-value-event-DJKJ5S3h.mjs → iss-ctrl-load-value-event-C-aRgKLx.mjs} +3 -3
- package/fesm2022/{iss-ctrl-load-value-event-DJKJ5S3h.mjs.map → iss-ctrl-load-value-event-C-aRgKLx.mjs.map} +1 -1
- package/fesm2022/iss-ctrl-mobile.field-DXVYT3q-.mjs +77 -0
- package/fesm2022/iss-ctrl-mobile.field-DXVYT3q-.mjs.map +1 -0
- package/fesm2022/iss-ctrl-mobile.mjs +2465 -0
- package/fesm2022/iss-ctrl-mobile.mjs.map +1 -0
- package/fesm2022/iss-ctrl-mobile.viewer-DQgxAcR-.mjs +22 -0
- package/fesm2022/iss-ctrl-mobile.viewer-DQgxAcR-.mjs.map +1 -0
- package/fesm2022/{iss-ctrl-note.field-B_Lbp28X.mjs → iss-ctrl-note.field-C8X9-mgD.mjs} +2 -2
- package/fesm2022/{iss-ctrl-note.field-B_Lbp28X.mjs.map → iss-ctrl-note.field-C8X9-mgD.mjs.map} +1 -1
- package/fesm2022/iss-ctrl-plate.field-aI81tAOV.mjs +92 -0
- package/fesm2022/iss-ctrl-plate.field-aI81tAOV.mjs.map +1 -0
- package/fesm2022/iss-ctrl-plate.mjs +491 -0
- package/fesm2022/iss-ctrl-plate.mjs.map +1 -0
- package/fesm2022/iss-ctrl-plate.viewer-B8PUBLH8.mjs +179 -0
- package/fesm2022/iss-ctrl-plate.viewer-B8PUBLH8.mjs.map +1 -0
- package/fesm2022/iss-ctrl-radio.field-B_JjPIlb.mjs +96 -0
- package/fesm2022/iss-ctrl-radio.field-B_JjPIlb.mjs.map +1 -0
- package/fesm2022/iss-ctrl-radio.mjs +101 -0
- package/fesm2022/iss-ctrl-radio.mjs.map +1 -0
- package/fesm2022/iss-ctrl-radio.viewer-EiDliZro.mjs +30 -0
- package/fesm2022/iss-ctrl-radio.viewer-EiDliZro.mjs.map +1 -0
- package/fesm2022/{iss-ctrl-replace-api-keys-C0XYQW4i.mjs → iss-ctrl-replace-api-keys-DLnagkOr.mjs} +2 -2
- package/fesm2022/{iss-ctrl-replace-api-keys-C0XYQW4i.mjs.map → iss-ctrl-replace-api-keys-DLnagkOr.mjs.map} +1 -1
- package/fesm2022/iss-ctrl-select.field-DoU4G_8t.mjs +87 -0
- package/fesm2022/iss-ctrl-select.field-DoU4G_8t.mjs.map +1 -0
- package/fesm2022/iss-ctrl-select.mjs +387 -0
- package/fesm2022/iss-ctrl-select.mjs.map +1 -0
- package/fesm2022/iss-ctrl-select.viewer-Dv9M-lG-.mjs +30 -0
- package/fesm2022/iss-ctrl-select.viewer-Dv9M-lG-.mjs.map +1 -0
- package/fesm2022/{iss-ctrl-set-value-event-CgXhi0Bv.mjs → iss-ctrl-set-value-event-Dhw0Vj5J.mjs} +2 -2
- package/fesm2022/{iss-ctrl-set-value-event-CgXhi0Bv.mjs.map → iss-ctrl-set-value-event-Dhw0Vj5J.mjs.map} +1 -1
- package/fesm2022/iss-ctrl-slide-toggle.field-TVVbAr6p.mjs +85 -0
- package/fesm2022/iss-ctrl-slide-toggle.field-TVVbAr6p.mjs.map +1 -0
- package/fesm2022/iss-ctrl-slide-toggle.mjs +72 -0
- package/fesm2022/iss-ctrl-slide-toggle.mjs.map +1 -0
- package/fesm2022/iss-ctrl-slide-toggle.viewer-hsIHwDj3.mjs +34 -0
- package/fesm2022/iss-ctrl-slide-toggle.viewer-hsIHwDj3.mjs.map +1 -0
- package/fesm2022/{iss-ctrl-table.field-B5FxF6hn.mjs → iss-ctrl-table.field-E0r9w0os.mjs} +142 -140
- package/fesm2022/iss-ctrl-table.field-E0r9w0os.mjs.map +1 -0
- package/fesm2022/iss-ctrl-textarea.field-CmHPDpk-.mjs +82 -0
- package/fesm2022/iss-ctrl-textarea.field-CmHPDpk-.mjs.map +1 -0
- package/fesm2022/iss-ctrl-textarea.mjs +115 -0
- package/fesm2022/iss-ctrl-textarea.mjs.map +1 -0
- package/fesm2022/iss-ctrl-textarea.viewer-CpmLauik.mjs +22 -0
- package/fesm2022/iss-ctrl-textarea.viewer-CpmLauik.mjs.map +1 -0
- package/fesm2022/iss-ctrl-time-picker.field-Cb0I5Ut1.mjs +77 -0
- package/fesm2022/iss-ctrl-time-picker.field-Cb0I5Ut1.mjs.map +1 -0
- package/fesm2022/iss-ctrl-time-picker.mjs +170 -0
- package/fesm2022/iss-ctrl-time-picker.mjs.map +1 -0
- package/fesm2022/iss-ctrl-time-picker.viewer-CJeFLrdI.mjs +22 -0
- package/fesm2022/iss-ctrl-time-picker.viewer-CJeFLrdI.mjs.map +1 -0
- package/fesm2022/iss-ctrl-toggle-button.field-Bj8WrkB-.mjs +105 -0
- package/fesm2022/iss-ctrl-toggle-button.field-Bj8WrkB-.mjs.map +1 -0
- package/fesm2022/iss-ctrl-toggle-button.mjs +156 -0
- package/fesm2022/iss-ctrl-toggle-button.mjs.map +1 -0
- package/fesm2022/iss-ctrl-toggle-button.viewer-CC-8_Dy4.mjs +30 -0
- package/fesm2022/iss-ctrl-toggle-button.viewer-CC-8_Dy4.mjs.map +1 -0
- package/fesm2022/iss-ctrl-tokens.mjs +25 -0
- package/fesm2022/iss-ctrl-tokens.mjs.map +1 -0
- package/fesm2022/{iss-ctrl-trigger-based-on-json-value-2v1kLVHZ.mjs → iss-ctrl-trigger-based-on-json-value-D9rTXVD1.mjs} +2 -2
- package/fesm2022/{iss-ctrl-trigger-based-on-json-value-2v1kLVHZ.mjs.map → iss-ctrl-trigger-based-on-json-value-D9rTXVD1.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-user-picker.field-BH63sZ-X.mjs → iss-ctrl-user-picker.field-BIzB5ZX6.mjs} +151 -150
- package/fesm2022/iss-ctrl-user-picker.field-BIzB5ZX6.mjs.map +1 -0
- package/fesm2022/iss-ctrl.mjs +3 -1
- package/fesm2022/iss-ctrl.mjs.map +1 -1
- package/package.json +69 -1
- package/types/iss-ctrl-base.d.ts +306 -0
- package/types/iss-ctrl-checkbox.d.ts +45 -0
- package/types/iss-ctrl-chips.d.ts +41 -0
- package/types/iss-ctrl-date-picker.d.ts +75 -0
- package/types/iss-ctrl-date-range-picker.d.ts +95 -0
- package/types/iss-ctrl-datetime-picker.d.ts +77 -0
- package/types/iss-ctrl-file-picker.d.ts +95 -0
- package/types/iss-ctrl-input.d.ts +76 -0
- package/types/iss-ctrl-mobile.d.ts +91 -0
- package/types/iss-ctrl-plate.d.ts +54 -0
- package/types/iss-ctrl-radio.d.ts +34 -0
- package/types/iss-ctrl-select.d.ts +75 -0
- package/types/iss-ctrl-slide-toggle.d.ts +26 -0
- package/types/iss-ctrl-textarea.d.ts +30 -0
- package/types/iss-ctrl-time-picker.d.ts +48 -0
- package/types/iss-ctrl-toggle-button.d.ts +41 -0
- package/types/iss-ctrl-tokens.d.ts +21 -0
- package/types/iss-ctrl.d.ts +120 -1810
- package/fesm2022/iss-ctrl-iss-ctrl-BKu6a5HF.mjs +0 -9683
- package/fesm2022/iss-ctrl-iss-ctrl-BKu6a5HF.mjs.map +0 -1
- package/fesm2022/iss-ctrl-load-event-bOt6IlIo.mjs.map +0 -1
- package/fesm2022/iss-ctrl-table.field-B5FxF6hn.mjs.map +0 -1
- package/fesm2022/iss-ctrl-user-picker.field-BH63sZ-X.mjs.map +0 -1
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InputSignal, WritableSignal, OutputEmitterRef, Provider, PipeTransform } from '@angular/core';
|
|
3
|
+
import { ControlValueAccessor, Validator, FormControl, AbstractControl, ValidationErrors, NgControl } from '@angular/forms';
|
|
4
|
+
import { ErrorStateMatcher, MatDateFormats, NativeDateAdapter } from '@angular/material/core';
|
|
5
|
+
|
|
6
|
+
type HintAlignment = "start" | "end";
|
|
7
|
+
interface Hint {
|
|
8
|
+
key: string;
|
|
9
|
+
label: string;
|
|
10
|
+
valid: boolean | undefined;
|
|
11
|
+
align: HintAlignment;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Base class for every `iss-ctrl-*` control.
|
|
16
|
+
*
|
|
17
|
+
* Controls are the presentational layer: they know nothing about {@link IssField} and are
|
|
18
|
+
* driven purely by bindings, so they can be used standalone inside any reactive form.
|
|
19
|
+
* Every control below inherits the properties declared here and adds its own on top.
|
|
20
|
+
*
|
|
21
|
+
* ### Inherited inputs
|
|
22
|
+
* | Property | Type | Default | Description |
|
|
23
|
+
* | --- | --- | --- | --- |
|
|
24
|
+
* | `formControlName` | `string` | `""` | Name of the control in the surrounding `FormGroup`. |
|
|
25
|
+
* | `placeholder` | `string` | `""` | Placeholder text shown while the field is empty. |
|
|
26
|
+
* | `readonly` | `boolean` | `false` | Renders the value but blocks every interaction. |
|
|
27
|
+
* | `multiple` | `boolean \| undefined` | `false` | Allows more than one value, where the control supports it. |
|
|
28
|
+
* | `min` | `number \| string \| null` | `null` | Lower bound (number or date/time string). |
|
|
29
|
+
* | `max` | `number \| string \| null` | `null` | Upper bound (number or date/time string). |
|
|
30
|
+
* | `minLength` | `number \| null` | `null` | Minimum number of characters. |
|
|
31
|
+
* | `maxLength` | `number \| null` | `null` | Maximum number of characters. |
|
|
32
|
+
* | `hints` | `Hint[]` | `[]` | Helper messages rendered under the field. |
|
|
33
|
+
* | `className` | `string \| null` | `null` | Extra CSS classes for the host. |
|
|
34
|
+
*
|
|
35
|
+
* ### Inherited outputs
|
|
36
|
+
* | Event | Payload | Description |
|
|
37
|
+
* | --- | --- | --- |
|
|
38
|
+
* | `(onChange)` | `any` | Fires after every committed value change. |
|
|
39
|
+
*
|
|
40
|
+
* ### Not inputs
|
|
41
|
+
* `disabled` and `touched` are signals owned by the control. Disable a control through the
|
|
42
|
+
* forms API (`ctrl.disable()` or a `disabled` field config), never with a template binding.
|
|
43
|
+
*
|
|
44
|
+
* ### Content projection
|
|
45
|
+
* Controls that render a `mat-form-field` project `<label>` into the floating label.
|
|
46
|
+
* `upgrade.scss` reveals that space only while the projected `<label>` carries text, so an
|
|
47
|
+
* omitted label — or one that interpolates to an empty string — collapses it. No label markup
|
|
48
|
+
* is removed at runtime, so a label that arrives later simply shows up.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```html
|
|
52
|
+
* <iss-ctrl-input formControlName="email" [readonly]="false" (onChange)="save($event)">
|
|
53
|
+
* <label>Email</label>
|
|
54
|
+
* </iss-ctrl-input>
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
declare class ControlBase implements ControlValueAccessor, Validator {
|
|
58
|
+
#private;
|
|
59
|
+
/**
|
|
60
|
+
* Name of this control inside the surrounding `FormGroup`.
|
|
61
|
+
*/
|
|
62
|
+
formControlName: InputSignal<string>;
|
|
63
|
+
/**
|
|
64
|
+
* Lower bound forwarded to the underlying input — a number, or a date/time string.
|
|
65
|
+
*/
|
|
66
|
+
min: InputSignal<number | string | null>;
|
|
67
|
+
/**
|
|
68
|
+
* Upper bound forwarded to the underlying input — a number, or a date/time string.
|
|
69
|
+
*/
|
|
70
|
+
max: InputSignal<number | string | null>;
|
|
71
|
+
/**
|
|
72
|
+
* Minimum number of characters accepted by the underlying input.
|
|
73
|
+
*/
|
|
74
|
+
minLength: InputSignal<number | null>;
|
|
75
|
+
/**
|
|
76
|
+
* Maximum number of characters accepted by the underlying input.
|
|
77
|
+
*/
|
|
78
|
+
maxLength: InputSignal<number | null>;
|
|
79
|
+
/**
|
|
80
|
+
* Disabled state. **Not an input** — it is set by the forms API through
|
|
81
|
+
* {@link ControlBase.setDisabledState}. Disable via `ctrl.disable()` or the field config.
|
|
82
|
+
*/
|
|
83
|
+
disabled: WritableSignal<boolean>;
|
|
84
|
+
/**
|
|
85
|
+
* Renders the current value but blocks every user interaction.
|
|
86
|
+
*/
|
|
87
|
+
readonly: InputSignal<boolean>;
|
|
88
|
+
/**
|
|
89
|
+
* Allows selecting/entering more than one value, on controls that support it.
|
|
90
|
+
*/
|
|
91
|
+
multiple: InputSignal<boolean | undefined>;
|
|
92
|
+
/**
|
|
93
|
+
* Placeholder text shown while the control has no value.
|
|
94
|
+
*/
|
|
95
|
+
placeholder: InputSignal<string>;
|
|
96
|
+
/**
|
|
97
|
+
* Helper messages rendered beneath the field. See {@link Hint}.
|
|
98
|
+
*/
|
|
99
|
+
hints: InputSignal<Hint[]>;
|
|
100
|
+
/**
|
|
101
|
+
* Extra CSS class names applied to the control host.
|
|
102
|
+
*/
|
|
103
|
+
className: InputSignal<string | null>;
|
|
104
|
+
/**
|
|
105
|
+
* Whether the user has interacted with the control. Owned by the control, not an input.
|
|
106
|
+
*/
|
|
107
|
+
touched: WritableSignal<boolean>;
|
|
108
|
+
/**
|
|
109
|
+
* Emits the committed value after every change.
|
|
110
|
+
*/
|
|
111
|
+
onChange: OutputEmitterRef<any>;
|
|
112
|
+
protected ctrl: FormControl;
|
|
113
|
+
/**
|
|
114
|
+
* Error state for the inner `mat-form-field`, derived from the **host** control.
|
|
115
|
+
*
|
|
116
|
+
* Material reads `errorState` off the `NgControl` bound to its own `matInput` — here that is
|
|
117
|
+
* {@link ControlBase.ctrl}, which carries no validators and is therefore always valid. Every
|
|
118
|
+
* error a consumer cares about (the field config's validators plus the control's own
|
|
119
|
+
* {@link ControlBase.validate}) lives on the host control instead, so without this matcher an
|
|
120
|
+
* invalid `iss-ctrl-*` would keep rendering the valid outline. Bind it on the `matInput` as
|
|
121
|
+
* `[errorStateMatcher]="errorStateMatcher"`.
|
|
122
|
+
*/
|
|
123
|
+
protected errorStateMatcher: ErrorStateMatcher;
|
|
124
|
+
registerOnChange(fn: () => void): void;
|
|
125
|
+
registerOnTouched(fn: () => void): void;
|
|
126
|
+
setDisabledState(isDisabled: boolean): void;
|
|
127
|
+
writeValue(value: string | FormData | Date | null): void;
|
|
128
|
+
markAsTouched(): void;
|
|
129
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
130
|
+
/**
|
|
131
|
+
* The `NgControl` this component is bound to from the outside (`formControlName`,
|
|
132
|
+
* `[formControl]` or `[ngModel]`), or `null` when it is used without one.
|
|
133
|
+
*/
|
|
134
|
+
protected hostControl(): NgControl | null;
|
|
135
|
+
/**
|
|
136
|
+
* Whether the control currently holds no value.
|
|
137
|
+
*
|
|
138
|
+
* Reflected on the host as `iss-ctrl-empty`, which is what `upgrade.scss` uses to keep the
|
|
139
|
+
* resting outline of an empty field: Material's own `mat-form-field-hide-placeholder` drops
|
|
140
|
+
* off the moment the field is focused, so the border would change colour on focus alone.
|
|
141
|
+
* Override it in a control whose value does not live on {@link ControlBase.ctrl}.
|
|
142
|
+
*/
|
|
143
|
+
protected isEmpty(): boolean;
|
|
144
|
+
protected onTouch: () => void;
|
|
145
|
+
protected onPropagateValue: (_: any) => void;
|
|
146
|
+
protected emitValue(value?: any): void;
|
|
147
|
+
protected propagateValue(value?: any): void;
|
|
148
|
+
protected emitOnChangeEvent($event?: any): void;
|
|
149
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ControlBase, never>;
|
|
150
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ControlBase, "ng-component", never, { "formControlName": { "alias": "formControlName"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "minLength": { "alias": "minLength"; "required": false; "isSignal": true; }; "maxLength": { "alias": "maxLength"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "hints": { "alias": "hints"; "required": false; "isSignal": true; }; "className": { "alias": "className"; "required": false; "isSignal": true; }; }, { "onChange": "onChange"; }, never, never, true, never>;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
declare const DATE_FORMAT_ADAPTER: MatDateFormats;
|
|
154
|
+
declare const DATETIME_FORMAT = "dd/MM/yyyy hh:mm a";
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Umm al-Qura Hijri calendar helpers.
|
|
158
|
+
*
|
|
159
|
+
* Every function here works on a plain `Date`: a `Date` is an instant, and the Hijri
|
|
160
|
+
* calendar is only another way of naming that instant. Nothing stores Hijri numbers on the
|
|
161
|
+
* date itself, so a value converted to Hijri for display or emission is still the same day.
|
|
162
|
+
*
|
|
163
|
+
* The conversion is done by `Intl` with the `islamic-umalqura` calendar, which is the
|
|
164
|
+
* calendar used officially in Saudi Arabia.
|
|
165
|
+
*/
|
|
166
|
+
/** Locale used by the calendar UI when the Hijri calendar is on. */
|
|
167
|
+
declare const HIJRI_LOCALE = "ar-SA-u-ca-islamic-umalqura";
|
|
168
|
+
declare const HIJRI_MONTH_NAMES: {
|
|
169
|
+
ar: string[];
|
|
170
|
+
en: string[];
|
|
171
|
+
enShort: string[];
|
|
172
|
+
};
|
|
173
|
+
interface HijriParts {
|
|
174
|
+
/** Hijri year, for example `1447`. */
|
|
175
|
+
year: number;
|
|
176
|
+
/** Hijri month, **zero based** like `Date.getMonth()` — `0` is Muharram. */
|
|
177
|
+
month: number;
|
|
178
|
+
/** Hijri day of month, starting at `1`. */
|
|
179
|
+
day: number;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Reads the Hijri year, month and day a `Date` falls on.
|
|
183
|
+
*/
|
|
184
|
+
declare function getHijriParts(date: Date): HijriParts;
|
|
185
|
+
/**
|
|
186
|
+
* The Gregorian `Date` of the first day of the Hijri month `date` falls in, at midday.
|
|
187
|
+
*
|
|
188
|
+
* Midday, not midnight, so a daylight-saving shift can never push the result into the
|
|
189
|
+
* previous day while the month is being walked.
|
|
190
|
+
*/
|
|
191
|
+
declare function startOfHijriMonth(date: Date): Date;
|
|
192
|
+
/**
|
|
193
|
+
* Number of days in the Hijri month `date` falls in — 29 or 30, decided by Umm al-Qura.
|
|
194
|
+
*/
|
|
195
|
+
declare function getHijriDaysInMonth(date: Date): number;
|
|
196
|
+
/**
|
|
197
|
+
* Builds the `Date` for a Hijri year/month/day. The month is zero based, and a day past the
|
|
198
|
+
* end of the month is clamped to the last day of that month.
|
|
199
|
+
*/
|
|
200
|
+
declare function createHijriDate(year: number, month: number, day: number): Date;
|
|
201
|
+
/**
|
|
202
|
+
* Formats a date as a Hijri `yyyy-MM-dd` string — the shape the form emits when
|
|
203
|
+
* `emitHijri` is on.
|
|
204
|
+
*/
|
|
205
|
+
declare function formatHijriDate(date: Date): string;
|
|
206
|
+
/**
|
|
207
|
+
* Reads a Hijri date back into a `Date`, accepting both the emitted `yyyy-MM-dd` shape and
|
|
208
|
+
* the `dd/MM/yyyy` shape shown in the input. Returns `null` for anything else.
|
|
209
|
+
*/
|
|
210
|
+
declare function parseHijriDate(value: string | null | undefined): Date | null;
|
|
211
|
+
/**
|
|
212
|
+
* Renders a stored form value as a Hijri `dd/MM/yyyy` string for the read-only viewers, or
|
|
213
|
+
* returns `null` when the field is not on the Hijri calendar and the value should be shown
|
|
214
|
+
* as an ordinary Gregorian date.
|
|
215
|
+
*
|
|
216
|
+
* The two Hijri modes store different things, so they are read differently: with `emitHijri`
|
|
217
|
+
* the value already carries Hijri numbers and only its notation changes, while with
|
|
218
|
+
* `hijriCalendar` alone the value is Gregorian and has to be converted.
|
|
219
|
+
*/
|
|
220
|
+
declare function toHijriDisplay(value: string | null | undefined, options: {
|
|
221
|
+
hijriCalendar?: boolean;
|
|
222
|
+
emitHijri?: boolean;
|
|
223
|
+
withTime?: boolean;
|
|
224
|
+
}): string | null;
|
|
225
|
+
|
|
226
|
+
declare class Hints {
|
|
227
|
+
hints: InputSignal<Hint[]>;
|
|
228
|
+
touched: InputSignal<boolean>;
|
|
229
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Hints, never>;
|
|
230
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Hints, "iss-ctrl-hints", never, { "hints": { "alias": "hints"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* The single date adapter behind every `iss-ctrl-*` picker.
|
|
235
|
+
*
|
|
236
|
+
* It behaves as a plain Gregorian adapter — `dd/MM/yyyy` in and out — until its locale is
|
|
237
|
+
* switched to {@link HIJRI_LOCALE}, at which point the whole calendar grid becomes Umm
|
|
238
|
+
* al-Qura Hijri: the month lengths, the year and month labels and the day numbers all come
|
|
239
|
+
* from the Hijri calendar.
|
|
240
|
+
*
|
|
241
|
+
* The value never changes shape. The adapter always works on a `Date`, so a Hijri calendar
|
|
242
|
+
* still hands the control an ordinary `Date`, and it stays the control's decision whether to
|
|
243
|
+
* emit that as a Gregorian or a Hijri string.
|
|
244
|
+
*
|
|
245
|
+
* Switch modes through {@link setHijri}, never by assigning `locale` — `setLocale` is what
|
|
246
|
+
* tells an open calendar to re-render.
|
|
247
|
+
*/
|
|
248
|
+
declare class IssDateAdapter extends NativeDateAdapter {
|
|
249
|
+
#private;
|
|
250
|
+
/** The Gregorian locale to fall back to when the Hijri calendar is turned off. */
|
|
251
|
+
gregorianLocale: string;
|
|
252
|
+
/** Whether the adapter is currently presenting the Hijri calendar. */
|
|
253
|
+
get isHijri(): boolean;
|
|
254
|
+
/**
|
|
255
|
+
* Turns the Hijri calendar on or off. Goes through `setLocale` so that a calendar that is
|
|
256
|
+
* already open redraws itself.
|
|
257
|
+
*/
|
|
258
|
+
setHijri(hijri: boolean): void;
|
|
259
|
+
getYear(date: Date): number;
|
|
260
|
+
getMonth(date: Date): number;
|
|
261
|
+
getDate(date: Date): number;
|
|
262
|
+
getMonthNames(style: "long" | "short" | "narrow"): string[];
|
|
263
|
+
getDateNames(): string[];
|
|
264
|
+
getDayOfWeekNames(style: "long" | "short" | "narrow"): string[];
|
|
265
|
+
getYearName(date: Date): string;
|
|
266
|
+
getFirstDayOfWeek(): number;
|
|
267
|
+
getNumDaysInMonth(date: Date): number;
|
|
268
|
+
createDate(year: number, month: number, date: number): Date;
|
|
269
|
+
addCalendarYears(date: Date, years: number): Date;
|
|
270
|
+
addCalendarMonths(date: Date, months: number): Date;
|
|
271
|
+
addCalendarDays(date: Date, days: number): Date;
|
|
272
|
+
parse(value: any, parseFormat?: any): Date | null;
|
|
273
|
+
format(date: Date, displayFormat: string): string;
|
|
274
|
+
deserialize(value: any): Date | null;
|
|
275
|
+
toIso8601(date: Date): string;
|
|
276
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<IssDateAdapter, never>;
|
|
277
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<IssDateAdapter>;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Providers every date-based control needs: the {@link IssDateAdapter} itself, the Gregorian
|
|
281
|
+
* locale it falls back to, and the `dd/MM/yyyy` formats both of its calendars are rendered in.
|
|
282
|
+
*
|
|
283
|
+
* Declared per component, so each picker owns its adapter instance and one field switching to
|
|
284
|
+
* the Hijri calendar leaves every other field on the form alone.
|
|
285
|
+
*/
|
|
286
|
+
declare function provideIssDateAdapter(): Provider[];
|
|
287
|
+
|
|
288
|
+
interface Option {
|
|
289
|
+
value: string;
|
|
290
|
+
label: string;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
declare class SelectStatusPipe implements PipeTransform {
|
|
294
|
+
transform(option: Option, ...args: unknown[]): boolean;
|
|
295
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SelectStatusPipe, never>;
|
|
296
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<SelectStatusPipe, "selectStatus", true>;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
declare class ViewerBase {
|
|
300
|
+
field: InputSignal<any>;
|
|
301
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ViewerBase, never>;
|
|
302
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ViewerBase, "ng-component", never, { "field": { "alias": "field"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export { ControlBase, DATETIME_FORMAT, DATE_FORMAT_ADAPTER, HIJRI_LOCALE, HIJRI_MONTH_NAMES, Hints, IssDateAdapter, SelectStatusPipe, ViewerBase, createHijriDate, formatHijriDate, getHijriDaysInMonth, getHijriParts, parseHijriDate, provideIssDateAdapter, startOfHijriMonth, toHijriDisplay };
|
|
306
|
+
export type { HijriParts, Hint, HintAlignment, Option };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InputSignal, WritableSignal } from '@angular/core';
|
|
3
|
+
import { ControlBase, Option } from 'iss-ctrl/base';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* `<iss-ctrl-checkbox>` — a list of checkboxes over a fixed set of options.
|
|
7
|
+
*
|
|
8
|
+
* The form value is the comma separated list of selected option values, while `(onChange)`
|
|
9
|
+
* emits the resolved `Option[]` (or `null` when nothing is selected).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```html
|
|
13
|
+
* <iss-ctrl-checkbox formControlName="days" [options]="days" (onChange)="pick($event)"/>
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* ### Own inputs
|
|
17
|
+
* | Property | Type | Default | Description |
|
|
18
|
+
* | --- | --- | --- | --- |
|
|
19
|
+
* | `options` | `Option[]` | **required** | The selectable choices. |
|
|
20
|
+
*
|
|
21
|
+
* ### Inherited from {@link ControlBase}
|
|
22
|
+
* `formControlName` · `readonly` · `className` · `(onChange)`
|
|
23
|
+
*
|
|
24
|
+
* Does not project a label — the field label is rendered by the wrapping `iss-field-*`.
|
|
25
|
+
*/
|
|
26
|
+
declare class CheckboxControl extends ControlBase {
|
|
27
|
+
#private;
|
|
28
|
+
/**
|
|
29
|
+
* Selectable choices, each a `{ value, label }` pair. Required.
|
|
30
|
+
*/
|
|
31
|
+
options: InputSignal<Option[]>;
|
|
32
|
+
/**
|
|
33
|
+
* Currently checked options, keyed by value. Internal state, not an input.
|
|
34
|
+
*/
|
|
35
|
+
selectedOptions: WritableSignal<Map<string, Option>>;
|
|
36
|
+
writeValue(value: string | null): void;
|
|
37
|
+
addToSelectedOptionsMap(option: Map<string, Option>): void;
|
|
38
|
+
onCheckboxChange(checked: boolean, value: string): void;
|
|
39
|
+
stringifySelectedOptions(): string | null;
|
|
40
|
+
getEmissionValue(options: any): void;
|
|
41
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxControl, never>;
|
|
42
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxControl, "iss-ctrl-checkbox", never, { "options": { "alias": "options"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { CheckboxControl };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { WritableSignal } from '@angular/core';
|
|
3
|
+
import { MatChipInputEvent } from '@angular/material/chips';
|
|
4
|
+
import { ControlBase } from 'iss-ctrl/base';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* `<iss-ctrl-chips>` — free text entered as removable chips.
|
|
8
|
+
*
|
|
9
|
+
* Each `Enter` turns the typed text into a chip. The form value is the comma separated list
|
|
10
|
+
* of chip labels.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```html
|
|
14
|
+
* <iss-ctrl-chips formControlName="tags" placeholder="Add a tag">
|
|
15
|
+
* <label>Tags</label>
|
|
16
|
+
* </iss-ctrl-chips>
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* ### Own inputs
|
|
20
|
+
* None — the control is configured entirely through the inherited properties.
|
|
21
|
+
*
|
|
22
|
+
* ### Inherited from {@link ControlBase}
|
|
23
|
+
* `formControlName` · `readonly` · `className` · `(onChange)` · `placeholder`
|
|
24
|
+
*
|
|
25
|
+
* Projects `<label>` into the floating label; omit it to render the control without one.
|
|
26
|
+
*/
|
|
27
|
+
declare class ChipsControl extends ControlBase {
|
|
28
|
+
#private;
|
|
29
|
+
/**
|
|
30
|
+
* The chips currently rendered. Internal state, not an input.
|
|
31
|
+
*/
|
|
32
|
+
readonly keywords: WritableSignal<string[]>;
|
|
33
|
+
writeValue(value: string | null): void;
|
|
34
|
+
remove(keyword: string): void;
|
|
35
|
+
add(event: MatChipInputEvent): void;
|
|
36
|
+
protected isEmpty(): boolean;
|
|
37
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChipsControl, never>;
|
|
38
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ChipsControl, "iss-ctrl-chips", never, {}, {}, never, ["label"], true, never>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { ChipsControl };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InputSignal } from '@angular/core';
|
|
3
|
+
import { Validator } from '@angular/forms';
|
|
4
|
+
import { MatDatepickerInputEvent } from '@angular/material/datepicker';
|
|
5
|
+
import { ControlBase } from 'iss-ctrl/base';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* `<iss-ctrl-date-picker>` — single date selection through a Material calendar.
|
|
9
|
+
*
|
|
10
|
+
* The input itself is read-only; clicking it opens the calendar. The emitted value is a
|
|
11
|
+
* `yyyy-MM-dd` string, and a clear button appears once a date is picked.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```html
|
|
15
|
+
* <iss-ctrl-date-picker formControlName="startsOn" [minDate]="today" [disabledDays]="[5, 6]">
|
|
16
|
+
* <label>Start date</label>
|
|
17
|
+
* </iss-ctrl-date-picker>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* ### Own inputs
|
|
21
|
+
* | Property | Type | Default | Description |
|
|
22
|
+
* | --- | --- | --- | --- |
|
|
23
|
+
* | `minDate` | `Date \| null` | `null` | Earliest selectable date. |
|
|
24
|
+
* | `maxDate` | `Date \| null` | `null` | Latest selectable date. |
|
|
25
|
+
* | `disabledDays` | `number[]` | `[]` | Week days to block, `0` = Sunday … `6` = Saturday. |
|
|
26
|
+
* | `hijriCalendar` | `boolean` | `false` | Shows an Umm al-Qura Hijri calendar; the value stays Gregorian. |
|
|
27
|
+
* | `emitHijri` | `boolean` | `false` | Emits the Hijri date instead of the Gregorian one. Implies `hijriCalendar`. |
|
|
28
|
+
*
|
|
29
|
+
* ### Hijri dates
|
|
30
|
+
* `hijriCalendar` only changes what the user sees: the calendar is Hijri, the input reads
|
|
31
|
+
* `dd/MM/yyyy` in Hijri, and a day shown as `16/03/1447` is still emitted as `2025-09-08`.
|
|
32
|
+
* Turn on `emitHijri` as well when the form value itself has to be the Hijri date. `minDate` and
|
|
33
|
+
* `maxDate` stay Gregorian in both cases — they are bounds on a day, not on a notation.
|
|
34
|
+
*
|
|
35
|
+
* ### Inherited from {@link ControlBase}
|
|
36
|
+
* `formControlName` · `readonly` · `className` · `(onChange)`
|
|
37
|
+
*
|
|
38
|
+
* Projects `<label>` into the floating label; omit it to render the control without one.
|
|
39
|
+
*/
|
|
40
|
+
declare class DatePickerControl extends ControlBase implements Validator {
|
|
41
|
+
#private;
|
|
42
|
+
/**
|
|
43
|
+
* Week days that cannot be selected — `0` is Sunday through `6` for Saturday.
|
|
44
|
+
*/
|
|
45
|
+
disabledDays: InputSignal<number[]>;
|
|
46
|
+
/**
|
|
47
|
+
* Earliest selectable date.
|
|
48
|
+
*/
|
|
49
|
+
minDate: InputSignal<Date | null>;
|
|
50
|
+
/**
|
|
51
|
+
* Latest selectable date.
|
|
52
|
+
*/
|
|
53
|
+
maxDate: InputSignal<Date | null>;
|
|
54
|
+
/**
|
|
55
|
+
* Renders the calendar as an Umm al-Qura Hijri calendar, leaving the emitted value Gregorian.
|
|
56
|
+
*/
|
|
57
|
+
hijriCalendar: InputSignal<boolean>;
|
|
58
|
+
/**
|
|
59
|
+
* Emits the picked date as a Hijri `yyyy-MM-dd` string. Implies {@link hijriCalendar}.
|
|
60
|
+
*/
|
|
61
|
+
emitHijri: InputSignal<boolean>;
|
|
62
|
+
/**
|
|
63
|
+
* Whether this picker is currently showing the Hijri calendar.
|
|
64
|
+
*/
|
|
65
|
+
isHijri(): boolean;
|
|
66
|
+
writeValue(value: string | Date | null): void;
|
|
67
|
+
clear(event: MouseEvent): void;
|
|
68
|
+
protected calendarDaysFilter: (d: Date | null) => boolean;
|
|
69
|
+
protected emit($event: MatDatepickerInputEvent<any>): void;
|
|
70
|
+
protected openPicker(picker: any): void;
|
|
71
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DatePickerControl, never>;
|
|
72
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DatePickerControl, "iss-ctrl-date-picker", never, { "disabledDays": { "alias": "disabledDays"; "required": false; "isSignal": true; }; "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; "hijriCalendar": { "alias": "hijriCalendar"; "required": false; "isSignal": true; }; "emitHijri": { "alias": "emitHijri"; "required": false; "isSignal": true; }; }, {}, never, ["label"], true, never>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export { DatePickerControl };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { OnInit, OnDestroy, InputSignal, OutputEmitterRef } from '@angular/core';
|
|
3
|
+
import { FormGroup } from '@angular/forms';
|
|
4
|
+
import { ControlBase } from 'iss-ctrl/base';
|
|
5
|
+
|
|
6
|
+
interface DateRangeEmission {
|
|
7
|
+
duration: number;
|
|
8
|
+
start: string;
|
|
9
|
+
end: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* `<iss-ctrl-date-range-picker>` — a start/end date range in one field.
|
|
14
|
+
*
|
|
15
|
+
* A half-filled range is not a value: clearing either endpoint clears the form value and
|
|
16
|
+
* emits `null`. The form value is a `yyyy-MM-dd` string pair; `(onDateRangeObjectChange)`
|
|
17
|
+
* emits the same range as a {@link DateRangeEmission} object.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```html
|
|
21
|
+
* <iss-ctrl-date-range-picker formControlName="period" (onDateRangeObjectChange)="apply($event)">
|
|
22
|
+
* <label>Period</label>
|
|
23
|
+
* </iss-ctrl-date-range-picker>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* ### Own inputs
|
|
27
|
+
* | Property | Type | Default | Description |
|
|
28
|
+
* | --- | --- | --- | --- |
|
|
29
|
+
* | `minDate` | `Date \| null` | `null` | Earliest selectable date. |
|
|
30
|
+
* | `maxDate` | `Date \| null` | `null` | Latest selectable date. |
|
|
31
|
+
* | `disabledDays` | `number[]` | `[]` | Week days to block, `0` = Sunday … `6` = Saturday. |
|
|
32
|
+
* | `hijriCalendar` | `boolean` | `false` | Shows an Umm al-Qura Hijri calendar; the value stays Gregorian. |
|
|
33
|
+
* | `emitHijri` | `boolean` | `false` | Emits both endpoints as Hijri dates. Implies `hijriCalendar`. |
|
|
34
|
+
*
|
|
35
|
+
* ### Hijri dates
|
|
36
|
+
* `hijriCalendar` only changes what the user sees; the emitted range stays Gregorian until
|
|
37
|
+
* `emitHijri` is on as well, at which point both endpoints carry Hijri dates. `duration` is
|
|
38
|
+
* a count of days either way, and `minDate`/`maxDate` stay Gregorian.
|
|
39
|
+
*
|
|
40
|
+
* ### Inherited from {@link ControlBase}
|
|
41
|
+
* `formControlName` · `readonly` · `className` · `(onChange)`
|
|
42
|
+
*
|
|
43
|
+
* ### Outputs
|
|
44
|
+
* - `(onDateRangeObjectChange)` — `DateRangeEmission | null`, the range as an object.
|
|
45
|
+
*
|
|
46
|
+
* Projects `<label>` into the floating label; omit it to render the control without one.
|
|
47
|
+
*/
|
|
48
|
+
declare class DateRangePickerControl extends ControlBase implements OnInit, OnDestroy {
|
|
49
|
+
#private;
|
|
50
|
+
/**
|
|
51
|
+
* Week days that cannot be selected — `0` is Sunday through `6` for Saturday.
|
|
52
|
+
*/
|
|
53
|
+
disabledDays: InputSignal<number[]>;
|
|
54
|
+
/**
|
|
55
|
+
* Earliest selectable date.
|
|
56
|
+
*/
|
|
57
|
+
minDate: InputSignal<Date | null>;
|
|
58
|
+
/**
|
|
59
|
+
* Latest selectable date.
|
|
60
|
+
*/
|
|
61
|
+
maxDate: InputSignal<Date | null>;
|
|
62
|
+
/**
|
|
63
|
+
* Renders the calendar as an Umm al-Qura Hijri calendar, leaving the emitted range Gregorian.
|
|
64
|
+
*/
|
|
65
|
+
hijriCalendar: InputSignal<boolean>;
|
|
66
|
+
/**
|
|
67
|
+
* Emits both endpoints as Hijri dates. Implies {@link hijriCalendar}.
|
|
68
|
+
*/
|
|
69
|
+
emitHijri: InputSignal<boolean>;
|
|
70
|
+
/**
|
|
71
|
+
* Emits the selected range as an object, or `null` while the range is incomplete.
|
|
72
|
+
*/
|
|
73
|
+
onDateRangeObjectChange: OutputEmitterRef<DateRangeEmission | null>;
|
|
74
|
+
/**
|
|
75
|
+
* The `start`/`end` form group backing the range input. Internal state.
|
|
76
|
+
*/
|
|
77
|
+
readonly range: FormGroup;
|
|
78
|
+
/**
|
|
79
|
+
* Whether this picker is currently showing the Hijri calendar.
|
|
80
|
+
*/
|
|
81
|
+
isHijri(): boolean;
|
|
82
|
+
ngOnInit(): void;
|
|
83
|
+
setDisabledState(isDisabled: boolean): void;
|
|
84
|
+
clear(event: MouseEvent): void;
|
|
85
|
+
writeValue(value: string | FormData | null): void;
|
|
86
|
+
ngOnDestroy(): void;
|
|
87
|
+
protected isEmpty(): boolean;
|
|
88
|
+
protected openPicker(picker: any): void;
|
|
89
|
+
protected calendarDaysFilter: (d: Date | null) => boolean;
|
|
90
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DateRangePickerControl, never>;
|
|
91
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DateRangePickerControl, "iss-ctrl-date-range-picker", never, { "disabledDays": { "alias": "disabledDays"; "required": false; "isSignal": true; }; "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; "hijriCalendar": { "alias": "hijriCalendar"; "required": false; "isSignal": true; }; "emitHijri": { "alias": "emitHijri"; "required": false; "isSignal": true; }; }, { "onDateRangeObjectChange": "onDateRangeObjectChange"; }, never, ["label"], true, never>;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export { DateRangePickerControl };
|
|
95
|
+
export type { DateRangeEmission };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InputSignal } from '@angular/core';
|
|
3
|
+
import { FormGroup } from '@angular/forms';
|
|
4
|
+
import { ControlBase } from 'iss-ctrl/base';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* `<iss-ctrl-datetime-picker>` — a date and a time in a single field.
|
|
8
|
+
*
|
|
9
|
+
* Combines the calendar of the date picker with the time list of the time picker; both parts
|
|
10
|
+
* must be set before a value is emitted.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```html
|
|
14
|
+
* <iss-ctrl-datetime-picker formControlName="scheduledAt" [minDate]="today" minTime="08:00" maxTime="17:00">
|
|
15
|
+
* <label>Scheduled at</label>
|
|
16
|
+
* </iss-ctrl-datetime-picker>
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* ### Own inputs
|
|
20
|
+
* | Property | Type | Default | Description |
|
|
21
|
+
* | --- | --- | --- | --- |
|
|
22
|
+
* | `minDate` | `Date \| null` | `null` | Earliest selectable date. |
|
|
23
|
+
* | `maxDate` | `Date \| null` | `null` | Latest selectable date. |
|
|
24
|
+
* | `minTime` | `string \| null` | `null` | Earliest selectable time, `HH:mm`. |
|
|
25
|
+
* | `maxTime` | `string \| null` | `null` | Latest selectable time, `HH:mm`. |
|
|
26
|
+
* | `disabledDays` | `number[]` | `[]` | Week days to block, `0` = Sunday … `6` = Saturday. |
|
|
27
|
+
* | `hijriCalendar` | `boolean` | `false` | Shows an Umm al-Qura Hijri calendar; the value stays Gregorian. |
|
|
28
|
+
* | `emitHijri` | `boolean` | `false` | Emits the date half as a Hijri date. Implies `hijriCalendar`. |
|
|
29
|
+
*
|
|
30
|
+
* ### Hijri dates
|
|
31
|
+
* Both flags are handed straight to the inner date picker; the time half is untouched, so a
|
|
32
|
+
* Hijri value reads `1447-03-15T09:30:00`.
|
|
33
|
+
*
|
|
34
|
+
* ### Inherited from {@link ControlBase}
|
|
35
|
+
* `formControlName` · `readonly` · `className` · `(onChange)`
|
|
36
|
+
*
|
|
37
|
+
* Projects `<label>` into the floating label; omit it to render the control without one.
|
|
38
|
+
*/
|
|
39
|
+
declare class DatetimePickerControl extends ControlBase {
|
|
40
|
+
#private;
|
|
41
|
+
datetimeForm: FormGroup;
|
|
42
|
+
/**
|
|
43
|
+
* Week days that cannot be selected — `0` is Sunday through `6` for Saturday.
|
|
44
|
+
*/
|
|
45
|
+
disabledDays: InputSignal<number[]>;
|
|
46
|
+
/**
|
|
47
|
+
* Earliest selectable date.
|
|
48
|
+
*/
|
|
49
|
+
minDate: InputSignal<Date | null>;
|
|
50
|
+
/**
|
|
51
|
+
* Latest selectable date.
|
|
52
|
+
*/
|
|
53
|
+
maxDate: InputSignal<Date | null>;
|
|
54
|
+
/**
|
|
55
|
+
* Earliest selectable time of day, as `HH:mm`.
|
|
56
|
+
*/
|
|
57
|
+
minTime: InputSignal<string | null>;
|
|
58
|
+
/**
|
|
59
|
+
* Latest selectable time of day, as `HH:mm`.
|
|
60
|
+
*/
|
|
61
|
+
maxTime: InputSignal<string | null>;
|
|
62
|
+
/**
|
|
63
|
+
* Renders the calendar as an Umm al-Qura Hijri calendar, leaving the emitted date Gregorian.
|
|
64
|
+
*/
|
|
65
|
+
hijriCalendar: InputSignal<boolean>;
|
|
66
|
+
/**
|
|
67
|
+
* Emits the date half of the value as a Hijri date. Implies {@link hijriCalendar}.
|
|
68
|
+
*/
|
|
69
|
+
emitHijri: InputSignal<boolean>;
|
|
70
|
+
setDisabledState(isDisabled: boolean): void;
|
|
71
|
+
emit(): void;
|
|
72
|
+
writeValue(value: string | Date | null): void;
|
|
73
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DatetimePickerControl, never>;
|
|
74
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DatetimePickerControl, "iss-ctrl-datetime-picker", never, { "disabledDays": { "alias": "disabledDays"; "required": false; "isSignal": true; }; "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; "minTime": { "alias": "minTime"; "required": false; "isSignal": true; }; "maxTime": { "alias": "maxTime"; "required": false; "isSignal": true; }; "hijriCalendar": { "alias": "hijriCalendar"; "required": false; "isSignal": true; }; "emitHijri": { "alias": "emitHijri"; "required": false; "isSignal": true; }; }, {}, never, ["label"], true, never>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export { DatetimePickerControl };
|