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,82 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { F as FieldBase, V as VIEW_PROVIDER, a as ValidationMessage, b as FieldViewer } from './iss-ctrl-iss-ctrl-DvnkwSMG.mjs';
|
|
6
|
+
import { TextareaControl } from 'iss-ctrl/textarea';
|
|
7
|
+
import { TextareaViewer } from './iss-ctrl-textarea.viewer-CpmLauik.mjs';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* `<iss-field-textarea>` — multi line free text.
|
|
11
|
+
*
|
|
12
|
+
* Rendered by the outlet for fields of type `textarea`. In `edit` mode it renders
|
|
13
|
+
* {@link TextareaControl} plus the validation message; in `view` mode the matching viewer.
|
|
14
|
+
*
|
|
15
|
+
* ### Supported `config` keys
|
|
16
|
+
* | Key | Type | Description |
|
|
17
|
+
* | --- | --- | --- |
|
|
18
|
+
* | `minLength` | `number` | Minimum number of characters. |
|
|
19
|
+
* | `maxLength` | `number` | Maximum number of characters. |
|
|
20
|
+
* | `readonly` | `boolean` | Shows the value but blocks interaction. |
|
|
21
|
+
*
|
|
22
|
+
* ### Other field members used
|
|
23
|
+
* `label()`
|
|
24
|
+
*
|
|
25
|
+
* Every field also honours `visible`, `mode`, `validation`, `asyncValidation` and
|
|
26
|
+
* `events` — see {@link IssField} for the full model and {@link FieldConfig} for all keys.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```json
|
|
30
|
+
* { "name": "notes", "type": "textarea", "label": "Notes", "config": { "maxLength": 500 } }
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
class TextareaField extends FieldBase {
|
|
34
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TextareaField, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
35
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: TextareaField, isStandalone: true, selector: "iss-field-textarea", usesInheritance: true, ngImport: i0, template: `
|
|
36
|
+
@if (field.visible()) {
|
|
37
|
+
@if (field.mode() === "edit") {
|
|
38
|
+
<iss-ctrl-textarea [formControlName]="field.name" [minLength]="field.config.minLength() ?? null" [maxLength]="field.config.maxLength() ?? null" [readonly]="field.config.readonly() ?? false">
|
|
39
|
+
<label>{{ field.label() }}</label>
|
|
40
|
+
</iss-ctrl-textarea>
|
|
41
|
+
<iss-validation-message-viewer [errors]="ctrl.errors" [showMessage]="!ctrl.untouched"/>
|
|
42
|
+
} @else {
|
|
43
|
+
<iss-field-viewer>
|
|
44
|
+
<label>{{ field.label() }}</label>
|
|
45
|
+
<iss-viewer-textarea [field]="field"/>
|
|
46
|
+
</iss-field-viewer>
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: TextareaControl, selector: "iss-ctrl-textarea" }, { kind: "component", type: ValidationMessage, selector: "iss-validation-message-viewer", inputs: ["errors", "showMessage"] }, { kind: "component", type: TextareaViewer, selector: "iss-viewer-textarea" }, { kind: "component", type: FieldViewer, selector: "iss-field-viewer" }], viewProviders: [VIEW_PROVIDER] });
|
|
50
|
+
}
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TextareaField, decorators: [{
|
|
52
|
+
type: Component,
|
|
53
|
+
args: [{
|
|
54
|
+
selector: "iss-field-textarea",
|
|
55
|
+
viewProviders: [VIEW_PROVIDER],
|
|
56
|
+
imports: [
|
|
57
|
+
ReactiveFormsModule,
|
|
58
|
+
TextareaControl,
|
|
59
|
+
ValidationMessage,
|
|
60
|
+
TextareaViewer,
|
|
61
|
+
FieldViewer
|
|
62
|
+
],
|
|
63
|
+
template: `
|
|
64
|
+
@if (field.visible()) {
|
|
65
|
+
@if (field.mode() === "edit") {
|
|
66
|
+
<iss-ctrl-textarea [formControlName]="field.name" [minLength]="field.config.minLength() ?? null" [maxLength]="field.config.maxLength() ?? null" [readonly]="field.config.readonly() ?? false">
|
|
67
|
+
<label>{{ field.label() }}</label>
|
|
68
|
+
</iss-ctrl-textarea>
|
|
69
|
+
<iss-validation-message-viewer [errors]="ctrl.errors" [showMessage]="!ctrl.untouched"/>
|
|
70
|
+
} @else {
|
|
71
|
+
<iss-field-viewer>
|
|
72
|
+
<label>{{ field.label() }}</label>
|
|
73
|
+
<iss-viewer-textarea [field]="field"/>
|
|
74
|
+
</iss-field-viewer>
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
`
|
|
78
|
+
}]
|
|
79
|
+
}] });
|
|
80
|
+
|
|
81
|
+
export { TextareaField };
|
|
82
|
+
//# sourceMappingURL=iss-ctrl-textarea.field-CmHPDpk-.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iss-ctrl-textarea.field-CmHPDpk-.mjs","sources":["../../../projects/iss/src/components/controls/textarea/textarea.field.ts"],"sourcesContent":["import { Component } from \"@angular/core\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\nimport { VIEW_PROVIDER } from \"../../../shared/constants/view-provider.const\";\nimport { FieldViewer } from \"../../shared/field-viewer\";\nimport { ValidationMessage } from \"../../shared/validation-message\";\nimport { FieldBase } from \"../base/field-base\";\nimport { TextareaControl } from \"iss-ctrl/textarea\";\nimport { TextareaViewer } from \"./textarea.viewer\";\n\n/**\n * `<iss-field-textarea>` — multi line free text.\n *\n * Rendered by the outlet for fields of type `textarea`. In `edit` mode it renders\n * {@link TextareaControl} plus the validation message; in `view` mode the matching viewer.\n *\n * ### Supported `config` keys\n * | Key | Type | Description |\n * | --- | --- | --- |\n * | `minLength` | `number` | Minimum number of characters. |\n * | `maxLength` | `number` | Maximum number of characters. |\n * | `readonly` | `boolean` | Shows the value but blocks interaction. |\n *\n * ### Other field members used\n * `label()`\n *\n * Every field also honours `visible`, `mode`, `validation`, `asyncValidation` and\n * `events` — see {@link IssField} for the full model and {@link FieldConfig} for all keys.\n *\n * @example\n * ```json\n * { \"name\": \"notes\", \"type\": \"textarea\", \"label\": \"Notes\", \"config\": { \"maxLength\": 500 } }\n * ```\n */\n@Component({\n selector: \"iss-field-textarea\",\n viewProviders: [VIEW_PROVIDER],\n imports: [\n ReactiveFormsModule,\n TextareaControl,\n ValidationMessage,\n TextareaViewer,\n FieldViewer\n ],\n template: `\n @if (field.visible()) {\n @if (field.mode() === \"edit\") {\n <iss-ctrl-textarea [formControlName]=\"field.name\" [minLength]=\"field.config.minLength() ?? null\" [maxLength]=\"field.config.maxLength() ?? null\" [readonly]=\"field.config.readonly() ?? false\">\n <label>{{ field.label() }}</label>\n </iss-ctrl-textarea>\n <iss-validation-message-viewer [errors]=\"ctrl.errors\" [showMessage]=\"!ctrl.untouched\"/>\n } @else {\n <iss-field-viewer>\n <label>{{ field.label() }}</label>\n <iss-viewer-textarea [field]=\"field\"/>\n </iss-field-viewer>\n }\n }\n `\n})\nexport class TextareaField extends FieldBase {}\n"],"names":[],"mappings":";;;;;;;;AASA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AA2BG,MAAO,aAAc,SAAQ,SAAS,CAAA;uGAA/B,aAAa,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAb,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAhBd;;;;;;;;;;;;;;AAcT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EApBC,mBAAmB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,2CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,CAAA,iBAAA,EAAA,UAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACnB,eAAe,EAAA,QAAA,EAAA,mBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACf,iBAAiB,EAAA,QAAA,EAAA,+BAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,aAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACjB,cAAc,EAAA,QAAA,EAAA,qBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACd,WAAW,EAAA,QAAA,EAAA,kBAAA,EAAA,CAAA,EAAA,aAAA,EANE,CAAC,aAAa,CAAC,EAAA,CAAA;;2FAwBnB,aAAa,EAAA,UAAA,EAAA,CAAA;kBA1BzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;oBAC9B,aAAa,EAAE,CAAC,aAAa,CAAC;AAC9B,oBAAA,OAAO,EAAE;wBACP,mBAAmB;wBACnB,eAAe;wBACf,iBAAiB;wBACjB,cAAc;wBACd;AACD,qBAAA;AACD,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;AAcT,EAAA;AACF,iBAAA;;;;;"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { effect, CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
|
|
5
|
+
import * as i2 from '@angular/material/form-field';
|
|
6
|
+
import { MatFormField, MatFormFieldModule } from '@angular/material/form-field';
|
|
7
|
+
import { MatInput } from '@angular/material/input';
|
|
8
|
+
import { ControlBase, Hints } from 'iss-ctrl/base';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* `<iss-ctrl-textarea>` — multi line free text.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```html
|
|
15
|
+
* <iss-ctrl-textarea formControlName="notes" [maxLength]="500" placeholder="Add a note">
|
|
16
|
+
* <label>Notes</label>
|
|
17
|
+
* </iss-ctrl-textarea>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* ### Own inputs
|
|
21
|
+
* None — the control is configured entirely through the inherited properties.
|
|
22
|
+
*
|
|
23
|
+
* ### Inherited from {@link ControlBase}
|
|
24
|
+
* `formControlName` · `readonly` · `className` · `(onChange)` · `placeholder` · `minLength` · `maxLength` · `hints`
|
|
25
|
+
*
|
|
26
|
+
* Projects `<label>` into the floating label; omit it to render the control without one.
|
|
27
|
+
*/
|
|
28
|
+
class TextareaControl extends ControlBase {
|
|
29
|
+
#disabledEffect = effect(() => {
|
|
30
|
+
if (this.disabled()) {
|
|
31
|
+
this.ctrl.disable();
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.ctrl.enable();
|
|
35
|
+
}
|
|
36
|
+
}, ...(ngDevMode ? [{ debugName: "#disabledEffect" }] : /* istanbul ignore next */ []));
|
|
37
|
+
ngOnDestroy() {
|
|
38
|
+
this.#disabledEffect.destroy();
|
|
39
|
+
}
|
|
40
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TextareaControl, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
41
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: TextareaControl, isStandalone: true, selector: "iss-ctrl-textarea", providers: [
|
|
42
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: TextareaControl, multi: true },
|
|
43
|
+
{ provide: NG_VALIDATORS, useExisting: TextareaControl, multi: true }
|
|
44
|
+
], usesInheritance: true, ngImport: i0, template: `
|
|
45
|
+
<mat-form-field floatLabel="auto" class="custom-textarea">
|
|
46
|
+
<!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->
|
|
47
|
+
<mat-label class="fs-16 fc-dark-gray">
|
|
48
|
+
<ng-content select="label"></ng-content>
|
|
49
|
+
</mat-label>
|
|
50
|
+
<textarea
|
|
51
|
+
matInput
|
|
52
|
+
[errorStateMatcher]="errorStateMatcher"
|
|
53
|
+
[placeholder]="placeholder()"
|
|
54
|
+
[formControl]="ctrl"
|
|
55
|
+
[attr.maxlength]="maxLength()"
|
|
56
|
+
[attr.minlength]="minLength()"
|
|
57
|
+
[readonly]="readonly()"
|
|
58
|
+
(input)="emitValue()"
|
|
59
|
+
(focusout)="markAsTouched()"
|
|
60
|
+
>
|
|
61
|
+
</textarea>
|
|
62
|
+
<iss-ctrl-hints [hints]="hints()" [touched]="touched()"/>
|
|
63
|
+
</mat-form-field>
|
|
64
|
+
`, isInline: true, dependencies: [{ kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: Hints, selector: "iss-ctrl-hints", inputs: ["hints", "touched"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }] });
|
|
65
|
+
}
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TextareaControl, decorators: [{
|
|
67
|
+
type: Component,
|
|
68
|
+
args: [{
|
|
69
|
+
selector: "iss-ctrl-textarea",
|
|
70
|
+
imports: [
|
|
71
|
+
MatFormField,
|
|
72
|
+
MatInput,
|
|
73
|
+
Hints,
|
|
74
|
+
FormsModule,
|
|
75
|
+
ReactiveFormsModule,
|
|
76
|
+
MatFormFieldModule,
|
|
77
|
+
],
|
|
78
|
+
providers: [
|
|
79
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: TextareaControl, multi: true },
|
|
80
|
+
{ provide: NG_VALIDATORS, useExisting: TextareaControl, multi: true }
|
|
81
|
+
],
|
|
82
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
83
|
+
template: `
|
|
84
|
+
<mat-form-field floatLabel="auto" class="custom-textarea">
|
|
85
|
+
<!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->
|
|
86
|
+
<mat-label class="fs-16 fc-dark-gray">
|
|
87
|
+
<ng-content select="label"></ng-content>
|
|
88
|
+
</mat-label>
|
|
89
|
+
<textarea
|
|
90
|
+
matInput
|
|
91
|
+
[errorStateMatcher]="errorStateMatcher"
|
|
92
|
+
[placeholder]="placeholder()"
|
|
93
|
+
[formControl]="ctrl"
|
|
94
|
+
[attr.maxlength]="maxLength()"
|
|
95
|
+
[attr.minlength]="minLength()"
|
|
96
|
+
[readonly]="readonly()"
|
|
97
|
+
(input)="emitValue()"
|
|
98
|
+
(focusout)="markAsTouched()"
|
|
99
|
+
>
|
|
100
|
+
</textarea>
|
|
101
|
+
<iss-ctrl-hints [hints]="hints()" [touched]="touched()"/>
|
|
102
|
+
</mat-form-field>
|
|
103
|
+
`
|
|
104
|
+
}]
|
|
105
|
+
}] });
|
|
106
|
+
|
|
107
|
+
// The textarea control. Its field and viewer stay in the primary entry point and reach it
|
|
108
|
+
// from there, so the control ships only to an app that renders it or imports it directly.
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Generated bundle index. Do not edit.
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
export { TextareaControl };
|
|
115
|
+
//# sourceMappingURL=iss-ctrl-textarea.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iss-ctrl-textarea.mjs","sources":["../../../projects/iss/textarea/src/textarea.control.ts","../../../projects/iss/textarea/src/public-api.ts","../../../projects/iss/textarea/src/iss-ctrl-textarea.ts"],"sourcesContent":["import { Component, CUSTOM_ELEMENTS_SCHEMA, effect, EffectRef, OnDestroy } from \"@angular/core\";\nimport { FormsModule, NG_VALIDATORS, NG_VALUE_ACCESSOR, ReactiveFormsModule } from \"@angular/forms\";\nimport { MatFormField, MatFormFieldModule } from \"@angular/material/form-field\";\nimport { MatInput } from \"@angular/material/input\";\nimport { Hints } from \"iss-ctrl/base\";\nimport { ControlBase } from \"iss-ctrl/base\";\n\n/**\n * `<iss-ctrl-textarea>` — multi line free text.\n *\n * @example\n * ```html\n * <iss-ctrl-textarea formControlName=\"notes\" [maxLength]=\"500\" placeholder=\"Add a note\">\n * <label>Notes</label>\n * </iss-ctrl-textarea>\n * ```\n *\n * ### Own inputs\n * None — the control is configured entirely through the inherited properties.\n *\n * ### Inherited from {@link ControlBase}\n * `formControlName` · `readonly` · `className` · `(onChange)` · `placeholder` · `minLength` · `maxLength` · `hints`\n *\n * Projects `<label>` into the floating label; omit it to render the control without one.\n */\n@Component({\n selector: \"iss-ctrl-textarea\",\n imports: [\n MatFormField,\n MatInput,\n Hints,\n FormsModule,\n ReactiveFormsModule,\n MatFormFieldModule,\n ],\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: TextareaControl, multi: true },\n { provide: NG_VALIDATORS, useExisting: TextareaControl, multi: true }\n ],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `\n <mat-form-field floatLabel=\"auto\" class=\"custom-textarea\">\n <!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->\n <mat-label class=\"fs-16 fc-dark-gray\">\n <ng-content select=\"label\"></ng-content>\n </mat-label>\n <textarea\n matInput\n [errorStateMatcher]=\"errorStateMatcher\"\n [placeholder]=\"placeholder()\"\n [formControl]=\"ctrl\"\n [attr.maxlength]=\"maxLength()\"\n [attr.minlength]=\"minLength()\"\n [readonly]=\"readonly()\"\n (input)=\"emitValue()\"\n (focusout)=\"markAsTouched()\"\n >\n </textarea>\n <iss-ctrl-hints [hints]=\"hints()\" [touched]=\"touched()\"/>\n </mat-form-field>\n `\n})\nexport class TextareaControl extends ControlBase implements OnDestroy {\n #disabledEffect: EffectRef = effect(() => {\n if (this.disabled()) {\n this.ctrl.disable();\n } else {\n this.ctrl.enable();\n }\n });\n\n ngOnDestroy() {\n this.#disabledEffect.destroy();\n }\n}\n","// The textarea control. Its field and viewer stay in the primary entry point and reach it\n// from there, so the control ships only to an app that renders it or imports it directly.\n\nexport * from \"./textarea.control\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAOA;;;;;;;;;;;;;;;;;AAiBG;AAsCG,MAAO,eAAgB,SAAQ,WAAW,CAAA;AAC9C,IAAA,eAAe,GAAc,MAAM,CAAC,MAAK;AACvC,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE,EAAE;AACnB,YAAA,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;QACrB;aAAO;AACL,YAAA,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;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AAoBT,EAAA;AACF,iBAAA;;;AC7DD;AACA;;ACDA;;AAEG;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component } from '@angular/core';
|
|
3
|
+
import { ViewerBase } from 'iss-ctrl/base';
|
|
4
|
+
|
|
5
|
+
class TextareaViewer extends ViewerBase {
|
|
6
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TextareaViewer, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
7
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: TextareaViewer, isStandalone: true, selector: "iss-viewer-textarea", usesInheritance: true, ngImport: i0, template: `
|
|
8
|
+
{{ field().ctrlValue() }}
|
|
9
|
+
`, isInline: true });
|
|
10
|
+
}
|
|
11
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TextareaViewer, decorators: [{
|
|
12
|
+
type: Component,
|
|
13
|
+
args: [{
|
|
14
|
+
selector: "iss-viewer-textarea",
|
|
15
|
+
template: `
|
|
16
|
+
{{ field().ctrlValue() }}
|
|
17
|
+
`,
|
|
18
|
+
}]
|
|
19
|
+
}] });
|
|
20
|
+
|
|
21
|
+
export { TextareaViewer };
|
|
22
|
+
//# sourceMappingURL=iss-ctrl-textarea.viewer-CpmLauik.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iss-ctrl-textarea.viewer-CpmLauik.mjs","sources":["../../../projects/iss/src/components/controls/textarea/textarea.viewer.ts"],"sourcesContent":["import { Component } from \"@angular/core\";\nimport { ViewerBase } from \"iss-ctrl/base\";\n\n@Component({\n selector: \"iss-viewer-textarea\",\n template: `\n {{ field().ctrlValue() }}\n `,\n})\nexport class TextareaViewer extends ViewerBase {\n}\n"],"names":[],"mappings":";;;;AASM,MAAO,cAAe,SAAQ,UAAU,CAAA;uGAAjC,cAAc,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAd,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAJf;;AAET,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEU,cAAc,EAAA,UAAA,EAAA,CAAA;kBAN1B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE;;AAET,EAAA,CAAA;AACF,iBAAA;;;;;"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { F as FieldBase, V as VIEW_PROVIDER, b as FieldViewer } from './iss-ctrl-iss-ctrl-DvnkwSMG.mjs';
|
|
6
|
+
import { TimePickerControl } from 'iss-ctrl/time-picker';
|
|
7
|
+
import { TimePickerViewer } from './iss-ctrl-time-picker.viewer-CJeFLrdI.mjs';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* `<iss-field-time-picker>` — a time of day, picked from a generated list.
|
|
11
|
+
*
|
|
12
|
+
* Rendered by the outlet for fields of type `time`. In `edit` mode it renders
|
|
13
|
+
* {@link TimePickerControl} plus the validation message; in `view` mode the matching viewer.
|
|
14
|
+
*
|
|
15
|
+
* ### Supported `config` keys
|
|
16
|
+
* | Key | Type | Description |
|
|
17
|
+
* | --- | --- | --- |
|
|
18
|
+
* | `readonly` | `boolean` | Shows the value but blocks interaction. |
|
|
19
|
+
*
|
|
20
|
+
* ### Other field members used
|
|
21
|
+
* `label()`
|
|
22
|
+
*
|
|
23
|
+
* Every field also honours `visible`, `mode`, `validation`, `asyncValidation` and
|
|
24
|
+
* `events` — see {@link IssField} for the full model and {@link FieldConfig} for all keys.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```json
|
|
28
|
+
* { "name": "startsAt", "type": "time", "label": "Starts at" }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
class TimePickerField extends FieldBase {
|
|
32
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TimePickerField, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
33
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: TimePickerField, isStandalone: true, selector: "iss-field-time-picker", usesInheritance: true, ngImport: i0, template: `
|
|
34
|
+
@if (field.visible()) {
|
|
35
|
+
@if (field.mode() === "edit") {
|
|
36
|
+
<iss-ctrl-time-picker [formControlName]="field.name" [readonly]="field.config.readonly() ?? false">
|
|
37
|
+
<label>{{ field.label() }}</label>
|
|
38
|
+
</iss-ctrl-time-picker>
|
|
39
|
+
} @else {
|
|
40
|
+
<iss-field-viewer>
|
|
41
|
+
<label>{{ field.label() }}</label>
|
|
42
|
+
<iss-viewer-time-picker [field]="field"/>
|
|
43
|
+
</iss-field-viewer>
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: TimePickerControl, selector: "iss-ctrl-time-picker", inputs: ["interval", "minTime", "maxTime"] }, { kind: "component", type: TimePickerViewer, selector: "iss-viewer-time-picker" }, { kind: "component", type: FieldViewer, selector: "iss-field-viewer" }], viewProviders: [VIEW_PROVIDER] });
|
|
47
|
+
}
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TimePickerField, decorators: [{
|
|
49
|
+
type: Component,
|
|
50
|
+
args: [{
|
|
51
|
+
selector: "iss-field-time-picker",
|
|
52
|
+
viewProviders: [VIEW_PROVIDER],
|
|
53
|
+
imports: [
|
|
54
|
+
ReactiveFormsModule,
|
|
55
|
+
TimePickerControl,
|
|
56
|
+
TimePickerViewer,
|
|
57
|
+
FieldViewer
|
|
58
|
+
],
|
|
59
|
+
template: `
|
|
60
|
+
@if (field.visible()) {
|
|
61
|
+
@if (field.mode() === "edit") {
|
|
62
|
+
<iss-ctrl-time-picker [formControlName]="field.name" [readonly]="field.config.readonly() ?? false">
|
|
63
|
+
<label>{{ field.label() }}</label>
|
|
64
|
+
</iss-ctrl-time-picker>
|
|
65
|
+
} @else {
|
|
66
|
+
<iss-field-viewer>
|
|
67
|
+
<label>{{ field.label() }}</label>
|
|
68
|
+
<iss-viewer-time-picker [field]="field"/>
|
|
69
|
+
</iss-field-viewer>
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
`
|
|
73
|
+
}]
|
|
74
|
+
}] });
|
|
75
|
+
|
|
76
|
+
export { TimePickerField };
|
|
77
|
+
//# sourceMappingURL=iss-ctrl-time-picker.field-Cb0I5Ut1.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iss-ctrl-time-picker.field-Cb0I5Ut1.mjs","sources":["../../../projects/iss/src/components/controls/time-picker/time-picker.field.ts"],"sourcesContent":["import { Component } from \"@angular/core\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\nimport { VIEW_PROVIDER } from \"../../../shared/constants/view-provider.const\";\nimport { FieldViewer } from \"../../shared/field-viewer\";\nimport { FieldBase } from \"../base/field-base\";\nimport { TimePickerControl } from \"iss-ctrl/time-picker\";\nimport { TimePickerViewer } from \"./time-picker.viewer\";\n\n/**\n * `<iss-field-time-picker>` — a time of day, picked from a generated list.\n *\n * Rendered by the outlet for fields of type `time`. In `edit` mode it renders\n * {@link TimePickerControl} plus the validation message; in `view` mode the matching viewer.\n *\n * ### Supported `config` keys\n * | Key | Type | Description |\n * | --- | --- | --- |\n * | `readonly` | `boolean` | Shows the value but blocks interaction. |\n *\n * ### Other field members used\n * `label()`\n *\n * Every field also honours `visible`, `mode`, `validation`, `asyncValidation` and\n * `events` — see {@link IssField} for the full model and {@link FieldConfig} for all keys.\n *\n * @example\n * ```json\n * { \"name\": \"startsAt\", \"type\": \"time\", \"label\": \"Starts at\" }\n * ```\n */\n@Component({\n selector: \"iss-field-time-picker\",\n viewProviders: [VIEW_PROVIDER],\n imports: [\n ReactiveFormsModule,\n TimePickerControl,\n TimePickerViewer,\n FieldViewer\n ],\n template: `\n @if (field.visible()) {\n @if (field.mode() === \"edit\") {\n <iss-ctrl-time-picker [formControlName]=\"field.name\" [readonly]=\"field.config.readonly() ?? false\">\n <label>{{ field.label() }}</label>\n </iss-ctrl-time-picker>\n } @else {\n <iss-field-viewer>\n <label>{{ field.label() }}</label>\n <iss-viewer-time-picker [field]=\"field\"/>\n </iss-field-viewer>\n }\n }\n `\n})\nexport class TimePickerField extends FieldBase {}\n"],"names":[],"mappings":";;;;;;;;AAQA;;;;;;;;;;;;;;;;;;;;;AAqBG;AAyBG,MAAO,eAAgB,SAAQ,SAAS,CAAA;uGAAjC,eAAe,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAf,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAe,EAAA,YAAA,EAAA,IAAA,E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, Component } from '@angular/core';
|
|
3
|
+
import * as i4 from '@angular/forms';
|
|
4
|
+
import { ReactiveFormsModule, NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
|
|
5
|
+
import { provideNativeDateAdapter } from '@angular/material/core';
|
|
6
|
+
import * as i1 from '@angular/material/form-field';
|
|
7
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
8
|
+
import { MatIcon } from '@angular/material/icon';
|
|
9
|
+
import * as i2 from '@angular/material/input';
|
|
10
|
+
import { MatInputModule } from '@angular/material/input';
|
|
11
|
+
import * as i3 from '@angular/material/timepicker';
|
|
12
|
+
import { MatTimepickerModule } from '@angular/material/timepicker';
|
|
13
|
+
import { format } from 'date-fns';
|
|
14
|
+
import { ControlBase } from 'iss-ctrl/base';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* `<iss-ctrl-time-picker>` — time of day, picked from a list generated at a fixed interval.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```html
|
|
21
|
+
* <iss-ctrl-time-picker formControlName="startsAt" interval="15min" minTime="08:00" maxTime="17:00">
|
|
22
|
+
* <label>Starts at</label>
|
|
23
|
+
* </iss-ctrl-time-picker>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* ### Own inputs
|
|
27
|
+
* | Property | Type | Default | Description |
|
|
28
|
+
* | --- | --- | --- | --- |
|
|
29
|
+
* | `interval` | `string` | `"30min"` | Step between the offered times. |
|
|
30
|
+
* | `minTime` | `string \| null` | `null` | Earliest offered time, `HH:mm`. |
|
|
31
|
+
* | `maxTime` | `string \| null` | `null` | Latest offered time, `HH:mm`. |
|
|
32
|
+
*
|
|
33
|
+
* ### Inherited from {@link ControlBase}
|
|
34
|
+
* `formControlName` · `readonly` · `className` · `(onChange)`
|
|
35
|
+
*
|
|
36
|
+
* Projects `<label>` into the floating label; omit it to render the control without one.
|
|
37
|
+
*/
|
|
38
|
+
class TimePickerControl extends ControlBase {
|
|
39
|
+
/**
|
|
40
|
+
* Step between the offered times, for example `"15min"` or `"30min"`.
|
|
41
|
+
*/
|
|
42
|
+
interval = input("30min", ...(ngDevMode ? [{ debugName: "interval" }] : /* istanbul ignore next */ []));
|
|
43
|
+
/**
|
|
44
|
+
* Earliest offered time of day, as `HH:mm`.
|
|
45
|
+
*/
|
|
46
|
+
minTime = input(null, ...(ngDevMode ? [{ debugName: "minTime" }] : /* istanbul ignore next */ []));
|
|
47
|
+
/**
|
|
48
|
+
* Latest offered time of day, as `HH:mm`.
|
|
49
|
+
*/
|
|
50
|
+
maxTime = input(null, ...(ngDevMode ? [{ debugName: "maxTime" }] : /* istanbul ignore next */ []));
|
|
51
|
+
emit(evt) {
|
|
52
|
+
if (this.readonly()) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
this.propagateValue(this.#stringifyTime(evt.value));
|
|
56
|
+
this.emitOnChangeEvent(this.#stringifyTime(evt.value));
|
|
57
|
+
}
|
|
58
|
+
clear(event) {
|
|
59
|
+
if (this.readonly()) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
event.stopImmediatePropagation();
|
|
63
|
+
this.ctrl.setValue(null);
|
|
64
|
+
this.propagateValue(null);
|
|
65
|
+
this.emitOnChangeEvent(null);
|
|
66
|
+
}
|
|
67
|
+
writeValue(value) {
|
|
68
|
+
if (!value) {
|
|
69
|
+
this.ctrl.setValue(null, { emitEvent: false });
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const parts = String(value).split(":");
|
|
73
|
+
const d = new Date();
|
|
74
|
+
d.setHours(Number(parts[0]));
|
|
75
|
+
d.setMinutes(Number(parts[1]));
|
|
76
|
+
d.setSeconds(Number(parts[2] ?? "00"));
|
|
77
|
+
this.ctrl.setValue(d, { emitEvent: false });
|
|
78
|
+
}
|
|
79
|
+
#stringifyTime(value) {
|
|
80
|
+
let formatedTime;
|
|
81
|
+
try {
|
|
82
|
+
formatedTime = format(new Date(value), "HH:mm:ss");
|
|
83
|
+
}
|
|
84
|
+
catch (e) {
|
|
85
|
+
formatedTime = value;
|
|
86
|
+
}
|
|
87
|
+
if (value instanceof Date && !Number.isNaN(value.getTime())) {
|
|
88
|
+
return formatedTime;
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TimePickerControl, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
93
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: TimePickerControl, isStandalone: true, selector: "iss-ctrl-time-picker", inputs: { interval: { classPropertyName: "interval", publicName: "interval", isSignal: true, isRequired: false, transformFunction: null }, minTime: { classPropertyName: "minTime", publicName: "minTime", isSignal: true, isRequired: false, transformFunction: null }, maxTime: { classPropertyName: "maxTime", publicName: "maxTime", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
94
|
+
provideNativeDateAdapter(),
|
|
95
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: TimePickerControl, multi: true },
|
|
96
|
+
{ provide: NG_VALIDATORS, useExisting: TimePickerControl, multi: true },
|
|
97
|
+
], usesInheritance: true, ngImport: i0, template: `
|
|
98
|
+
<mat-form-field floatLabel="auto" class="">
|
|
99
|
+
<!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->
|
|
100
|
+
<mat-label class="fs-16 fc-dark-gray">
|
|
101
|
+
<ng-content select="label"></ng-content>
|
|
102
|
+
</mat-label>
|
|
103
|
+
<input
|
|
104
|
+
matInput
|
|
105
|
+
[errorStateMatcher]="errorStateMatcher"
|
|
106
|
+
[formControl]="ctrl"
|
|
107
|
+
[matTimepicker]="picker"
|
|
108
|
+
[matTimepickerMin]="minTime()"
|
|
109
|
+
[matTimepickerMax]="maxTime()"
|
|
110
|
+
[readonly]="readonly()"
|
|
111
|
+
readonly
|
|
112
|
+
/>
|
|
113
|
+
@if (ctrl.getRawValue()) {
|
|
114
|
+
<mat-icon matSuffix style="cursor: pointer" (click)="clear($event)">close</mat-icon>
|
|
115
|
+
}
|
|
116
|
+
<mat-timepicker-toggle matIconSuffix [for]="picker" [disabled]="readonly()"/>
|
|
117
|
+
<mat-timepicker (selected)="emit($event)" [interval]="interval()" #picker/>
|
|
118
|
+
|
|
119
|
+
</mat-form-field>
|
|
120
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatTimepickerModule }, { kind: "component", type: i3.MatTimepicker, selector: "mat-timepicker", inputs: ["interval", "options", "disableRipple", "aria-label", "aria-labelledby", "panelClass"], outputs: ["selected", "opened", "closed"], exportAs: ["matTimepicker"] }, { kind: "directive", type: i3.MatTimepickerInput, selector: "input[matTimepicker]", inputs: ["value", "matTimepicker", "matTimepickerMin", "matTimepickerMax", "matTimepickerOpenOnClick", "disabled"], outputs: ["valueChange"], exportAs: ["matTimepickerInput"] }, { kind: "component", type: i3.MatTimepickerToggle, selector: "mat-timepicker-toggle", inputs: ["for", "aria-label", "aria-labelledby", "disabled", "tabIndex", "disableRipple"], exportAs: ["matTimepickerToggle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
121
|
+
}
|
|
122
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TimePickerControl, decorators: [{
|
|
123
|
+
type: Component,
|
|
124
|
+
args: [{
|
|
125
|
+
selector: "iss-ctrl-time-picker",
|
|
126
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
127
|
+
imports: [
|
|
128
|
+
MatFormFieldModule, MatInputModule, MatTimepickerModule, ReactiveFormsModule, MatIcon,
|
|
129
|
+
],
|
|
130
|
+
providers: [
|
|
131
|
+
provideNativeDateAdapter(),
|
|
132
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: TimePickerControl, multi: true },
|
|
133
|
+
{ provide: NG_VALIDATORS, useExisting: TimePickerControl, multi: true },
|
|
134
|
+
],
|
|
135
|
+
template: `
|
|
136
|
+
<mat-form-field floatLabel="auto" class="">
|
|
137
|
+
<!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->
|
|
138
|
+
<mat-label class="fs-16 fc-dark-gray">
|
|
139
|
+
<ng-content select="label"></ng-content>
|
|
140
|
+
</mat-label>
|
|
141
|
+
<input
|
|
142
|
+
matInput
|
|
143
|
+
[errorStateMatcher]="errorStateMatcher"
|
|
144
|
+
[formControl]="ctrl"
|
|
145
|
+
[matTimepicker]="picker"
|
|
146
|
+
[matTimepickerMin]="minTime()"
|
|
147
|
+
[matTimepickerMax]="maxTime()"
|
|
148
|
+
[readonly]="readonly()"
|
|
149
|
+
readonly
|
|
150
|
+
/>
|
|
151
|
+
@if (ctrl.getRawValue()) {
|
|
152
|
+
<mat-icon matSuffix style="cursor: pointer" (click)="clear($event)">close</mat-icon>
|
|
153
|
+
}
|
|
154
|
+
<mat-timepicker-toggle matIconSuffix [for]="picker" [disabled]="readonly()"/>
|
|
155
|
+
<mat-timepicker (selected)="emit($event)" [interval]="interval()" #picker/>
|
|
156
|
+
|
|
157
|
+
</mat-form-field>
|
|
158
|
+
`,
|
|
159
|
+
}]
|
|
160
|
+
}], propDecorators: { interval: [{ type: i0.Input, args: [{ isSignal: true, alias: "interval", required: false }] }], minTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "minTime", required: false }] }], maxTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxTime", required: false }] }] } });
|
|
161
|
+
|
|
162
|
+
// The time-picker control. Its field and viewer stay in the primary entry point and reach it
|
|
163
|
+
// from there, so the control ships only to an app that renders it or imports it directly.
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Generated bundle index. Do not edit.
|
|
167
|
+
*/
|
|
168
|
+
|
|
169
|
+
export { TimePickerControl };
|
|
170
|
+
//# sourceMappingURL=iss-ctrl-time-picker.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iss-ctrl-time-picker.mjs","sources":["../../../projects/iss/time-picker/src/time-picker.control.ts","../../../projects/iss/time-picker/src/public-api.ts","../../../projects/iss/time-picker/src/iss-ctrl-time-picker.ts"],"sourcesContent":["import { Component, CUSTOM_ELEMENTS_SCHEMA, input, InputSignal } from \"@angular/core\";\nimport { NG_VALIDATORS, NG_VALUE_ACCESSOR, ReactiveFormsModule } from \"@angular/forms\";\nimport { provideNativeDateAdapter } from \"@angular/material/core\";\nimport { MatFormFieldModule } from \"@angular/material/form-field\";\nimport { MatIcon } from \"@angular/material/icon\";\nimport { MatInputModule } from \"@angular/material/input\";\nimport { MatTimepickerModule } from \"@angular/material/timepicker\";\nimport { format } from \"date-fns\";\nimport { ControlBase } from \"iss-ctrl/base\";\n\n/**\n * `<iss-ctrl-time-picker>` — time of day, picked from a list generated at a fixed interval.\n *\n * @example\n * ```html\n * <iss-ctrl-time-picker formControlName=\"startsAt\" interval=\"15min\" minTime=\"08:00\" maxTime=\"17:00\">\n * <label>Starts at</label>\n * </iss-ctrl-time-picker>\n * ```\n *\n * ### Own inputs\n * | Property | Type | Default | Description |\n * | --- | --- | --- | --- |\n * | `interval` | `string` | `\"30min\"` | Step between the offered times. |\n * | `minTime` | `string \\| null` | `null` | Earliest offered time, `HH:mm`. |\n * | `maxTime` | `string \\| null` | `null` | Latest offered time, `HH:mm`. |\n *\n * ### Inherited from {@link ControlBase}\n * `formControlName` · `readonly` · `className` · `(onChange)`\n *\n * Projects `<label>` into the floating label; omit it to render the control without one.\n */\n@Component({\n selector: \"iss-ctrl-time-picker\",\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n imports: [\n MatFormFieldModule, MatInputModule, MatTimepickerModule, ReactiveFormsModule, MatIcon,\n ],\n providers: [\n provideNativeDateAdapter(),\n { provide: NG_VALUE_ACCESSOR, useExisting: TimePickerControl, multi: true },\n { provide: NG_VALIDATORS, useExisting: TimePickerControl, multi: true },\n ],\n template: `\n <mat-form-field floatLabel=\"auto\" class=\"\">\n <!-- Always rendered: upgrade.scss shows the floating label only while the projected <label> carries text, so an omitted or empty one collapses on its own. -->\n <mat-label class=\"fs-16 fc-dark-gray\">\n <ng-content select=\"label\"></ng-content>\n </mat-label>\n <input\n matInput\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"ctrl\"\n [matTimepicker]=\"picker\"\n [matTimepickerMin]=\"minTime()\"\n [matTimepickerMax]=\"maxTime()\"\n [readonly]=\"readonly()\"\n readonly\n />\n @if (ctrl.getRawValue()) {\n <mat-icon matSuffix style=\"cursor: pointer\" (click)=\"clear($event)\">close</mat-icon>\n }\n <mat-timepicker-toggle matIconSuffix [for]=\"picker\" [disabled]=\"readonly()\"/>\n <mat-timepicker (selected)=\"emit($event)\" [interval]=\"interval()\" #picker/>\n\n </mat-form-field>\n `,\n})\nexport class TimePickerControl extends ControlBase {\n /**\n * Step between the offered times, for example `\"15min\"` or `\"30min\"`.\n */\n interval: InputSignal<string> = input(\"30min\");\n /**\n * Earliest offered time of day, as `HH:mm`.\n */\n minTime: InputSignal<string | null> = input<string | null>(null);\n /**\n * Latest offered time of day, as `HH:mm`.\n */\n maxTime: InputSignal<string | null> = input<string | null>(null);\n\n emit(evt: any) {\n if (this.readonly()) {\n return;\n }\n this.propagateValue(this.#stringifyTime(evt.value));\n this.emitOnChangeEvent(this.#stringifyTime(evt.value));\n }\n\n clear(event: MouseEvent) {\n if (this.readonly()) {\n return;\n }\n event.stopImmediatePropagation();\n this.ctrl.setValue(null);\n\n this.propagateValue(null);\n this.emitOnChangeEvent(null);\n }\n\n override writeValue(value: any) {\n if (!value) {\n this.ctrl.setValue(null, { emitEvent: false });\n return;\n }\n\n const parts: string[] = String(value).split(\":\");\n const d = new Date();\n d.setHours(Number(parts[0]));\n d.setMinutes(Number(parts[1]));\n d.setSeconds(Number(parts[2] ?? \"00\"));\n this.ctrl.setValue(d, { emitEvent: false });\n }\n\n #stringifyTime(value: any) {\n let formatedTime;\n try {\n formatedTime = format(new Date(value), \"HH:mm:ss\");\n } catch (e) {\n formatedTime = value;\n }\n\n if (value instanceof Date && !Number.isNaN(value.getTime())) {\n return formatedTime;\n }\n\n return null;\n }\n}\n","// The time-picker control. Its field and viewer stay in the primary entry point and reach it\n// from there, so the control ships only to an app that renders it or imports it directly.\n\nexport * from \"./time-picker.control\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAUA;;;;;;;;;;;;;;;;;;;;;AAqBG;AAqCG,MAAO,iBAAkB,SAAQ,WAAW,CAAA;AAChD;;AAEG;A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;;;;;;;;;;;;;;;AAuBT,EAAA,CAAA;AACF,iBAAA;;;ACnED;AACA;;ACDA;;AAEG;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component } from '@angular/core';
|
|
3
|
+
import { ViewerBase } from 'iss-ctrl/base';
|
|
4
|
+
|
|
5
|
+
class TimePickerViewer extends ViewerBase {
|
|
6
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TimePickerViewer, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
7
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: TimePickerViewer, isStandalone: true, selector: "iss-viewer-time-picker", usesInheritance: true, ngImport: i0, template: `
|
|
8
|
+
{{ field().ctrlValue() }}
|
|
9
|
+
`, isInline: true });
|
|
10
|
+
}
|
|
11
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TimePickerViewer, decorators: [{
|
|
12
|
+
type: Component,
|
|
13
|
+
args: [{
|
|
14
|
+
selector: "iss-viewer-time-picker",
|
|
15
|
+
template: `
|
|
16
|
+
{{ field().ctrlValue() }}
|
|
17
|
+
`,
|
|
18
|
+
}]
|
|
19
|
+
}] });
|
|
20
|
+
|
|
21
|
+
export { TimePickerViewer };
|
|
22
|
+
//# sourceMappingURL=iss-ctrl-time-picker.viewer-CJeFLrdI.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iss-ctrl-time-picker.viewer-CJeFLrdI.mjs","sources":["../../../projects/iss/src/components/controls/time-picker/time-picker.viewer.ts"],"sourcesContent":["import { Component } from \"@angular/core\";\nimport { ViewerBase } from \"iss-ctrl/base\";\n\n@Component({\n selector: \"iss-viewer-time-picker\",\n template: `\n {{ field().ctrlValue() }}\n `,\n})\nexport class TimePickerViewer extends ViewerBase {}\n"],"names":[],"mappings":";;;;AASM,MAAO,gBAAiB,SAAQ,UAAU,CAAA;uGAAnC,gBAAgB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAhB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAJjB;;AAET,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEU,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAN5B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,wBAAwB;AAClC,oBAAA,QAAQ,EAAE;;AAET,EAAA,CAAA;AACF,iBAAA;;;;;"}
|