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,179 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { signal, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { ViewerBase } from 'iss-ctrl/base';
|
|
4
|
+
import { PLATE_LETTERS } from 'iss-ctrl/plate';
|
|
5
|
+
|
|
6
|
+
class PlateViewer extends ViewerBase {
|
|
7
|
+
numbersAr = signal(Array(4).fill(""), ...(ngDevMode ? [{ debugName: "numbersAr" }] : /* istanbul ignore next */ []));
|
|
8
|
+
numbersEn = signal(Array(4).fill(""), ...(ngDevMode ? [{ debugName: "numbersEn" }] : /* istanbul ignore next */ []));
|
|
9
|
+
lettersAr = signal(Array(3).fill(""), ...(ngDevMode ? [{ debugName: "lettersAr" }] : /* istanbul ignore next */ []));
|
|
10
|
+
lettersEn = signal(Array(3).fill(""), ...(ngDevMode ? [{ debugName: "lettersEn" }] : /* istanbul ignore next */ []));
|
|
11
|
+
effectRef = effect(() => {
|
|
12
|
+
const val = this.field().value;
|
|
13
|
+
if (val) {
|
|
14
|
+
const parts = val.split("-");
|
|
15
|
+
const letters = parts[0]?.split("") || [];
|
|
16
|
+
const numbers = parts[1]?.split("") || [];
|
|
17
|
+
// Initialize letters
|
|
18
|
+
const lAr = [];
|
|
19
|
+
const lEn = [];
|
|
20
|
+
for (let i = 0; i < 3; i++) {
|
|
21
|
+
const char = letters[i] || "";
|
|
22
|
+
if (char) {
|
|
23
|
+
const plateLetter = PLATE_LETTERS.find(l => l.value === char || l.label.en === char || l.label.ar === char);
|
|
24
|
+
if (plateLetter) {
|
|
25
|
+
lAr.push(plateLetter.label.ar);
|
|
26
|
+
lEn.push(plateLetter.label.en);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
lAr.push("");
|
|
30
|
+
lEn.push("");
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
lAr.push("");
|
|
35
|
+
lEn.push("");
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
this.lettersAr.set(lAr);
|
|
39
|
+
this.lettersEn.set(lEn);
|
|
40
|
+
// Initialize numbers
|
|
41
|
+
const nAr = [];
|
|
42
|
+
const nEn = [];
|
|
43
|
+
for (let i = 0; i < 4; i++) {
|
|
44
|
+
const char = numbers[i] || "";
|
|
45
|
+
if (char) {
|
|
46
|
+
nAr.push(this.convertDigit(char, "ar"));
|
|
47
|
+
nEn.push(this.convertDigit(char, "en"));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
nAr.push("");
|
|
51
|
+
nEn.push("");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
this.numbersAr.set(nAr);
|
|
55
|
+
this.numbersEn.set(nEn);
|
|
56
|
+
}
|
|
57
|
+
}, ...(ngDevMode ? [{ debugName: "effectRef" }] : /* istanbul ignore next */ []));
|
|
58
|
+
convertDigit(digit, toLang) {
|
|
59
|
+
const arDigits = ["٠", "١", "٢", "٣", "٤", "٥", "٦", "٧", "٨", "٩"];
|
|
60
|
+
const enDigits = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
61
|
+
if (toLang === "ar") {
|
|
62
|
+
const index = enDigits.indexOf(digit);
|
|
63
|
+
return index !== -1 ? arDigits[index] : digit;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
const index = arDigits.indexOf(digit);
|
|
67
|
+
return index !== -1 ? enDigits[index] : digit;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PlateViewer, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
71
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: PlateViewer, isStandalone: true, selector: "iss-viewer-plate", usesInheritance: true, ngImport: i0, template: `
|
|
72
|
+
<div class="plate-container">
|
|
73
|
+
<div class="section numbers-section">
|
|
74
|
+
<div class="digit-row">
|
|
75
|
+
@for (numAr of numbersAr(); track numAr) {
|
|
76
|
+
<span>{{ numAr }}</span>
|
|
77
|
+
}
|
|
78
|
+
</div>
|
|
79
|
+
<div class="digit-row">
|
|
80
|
+
@for (numEn of numbersEn(); track numEn) {
|
|
81
|
+
<span>{{ numEn }}</span>
|
|
82
|
+
}
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
<div class="section emblem-section">
|
|
87
|
+
<svg class="emblem-svg" viewBox="0 0 17 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
88
|
+
<path
|
|
89
|
+
fill-rule="evenodd"
|
|
90
|
+
clip-rule="evenodd"
|
|
91
|
+
d="M10.8072 16.8744C11.4633 16.178 11.3244 15.3914 10.7996 15.3825C10.9872 15.9606 10.5562 16.3344 10.3922 16.5266C9.97894 16.1712 9.55086 15.7761 9.10778 15.3694C11.2695 13.5812 13.6354 11.995 16.7263 11.9452C13.3983 10.7499 10.7417 12.7815 8.4925 14.8084C6.24308 12.7815 3.58672 10.7499 0.257812 11.9452C3.34944 11.995 5.71507 13.581 7.87722 15.3694C7.43329 15.7761 7.00564 16.1712 6.59172 16.5266C6.42902 16.3344 5.99777 15.9606 6.18435 15.3825C5.65992 15.3914 5.52089 16.178 6.17758 16.8744C5.91495 17.0931 5.48962 17.4631 5.15113 17.5518C4.89082 17.6199 4.68185 17.4846 4.63473 17.2026C4.53542 16.6069 3.61271 16.6959 3.72554 17.5372C3.82907 18.3044 4.76066 18.6391 5.55892 18.2837C5.87565 18.1424 6.3107 17.7413 6.66778 17.45C6.83111 17.641 7.26215 18.0145 7.07494 18.5935C7.59979 18.5838 7.7384 17.798 7.08234 17.1005C7.54845 16.7028 8.01625 16.2927 8.4925 15.887C8.96833 16.2925 9.43634 16.7028 9.90288 17.1005C9.24639 17.798 9.385 18.5838 9.91006 18.5935C9.72285 18.0145 10.1539 17.6414 10.3168 17.45C10.6745 17.7413 11.1091 18.1424 11.4263 18.2837C12.2246 18.6391 13.1555 18.3044 13.259 17.5372C13.3719 16.6959 12.4496 16.6069 12.3494 17.2026C12.3023 17.4846 12.094 17.6196 11.8332 17.5518C11.4948 17.4631 11.0696 17.0931 10.8072 16.8744ZM6.72504 5.72093C6.22365 7.04637 6.19597 8.53894 6.9169 10.1805C6.80195 8.47576 7.17594 7.06771 7.8713 6.0066L8.01815 7.46832H7.84679L8.01815 9.17958H7.84679L8.01815 10.8904H7.84679L8.01794 12.5991L7.53366 13.0819H8.4925H9.45156L8.96685 12.5991L9.13842 10.8904H8.96685L9.13842 9.17958H8.96685L9.13842 7.46832H8.96685L9.11391 6.0066C9.80906 7.06771 10.1833 8.47682 10.0683 10.1805C10.7886 8.53894 10.7616 7.047 10.2602 5.72093C11.1115 6.72478 11.7701 7.89851 12.0661 9.36572C12.3733 7.50466 11.848 5.98568 10.8852 4.8071C11.8174 5.47943 12.6184 6.33157 13.1785 7.48396C13.048 5.72072 12.1559 4.57742 10.927 3.75824C11.989 4.1054 12.8561 4.68645 13.6343 5.71798C13.1139 3.8884 11.9801 3.15564 10.575 2.74362C11.5332 2.67368 12.4386 2.78165 13.3347 3.33988C12.3621 2.02839 11.0565 1.81055 9.73257 1.95634C10.2893 1.67279 10.9158 1.53101 11.5888 1.63137C10.8302 1.07187 9.81836 1.01651 8.95227 1.48812L8.4925 0.328125L8.0321 1.48749C7.1658 1.01651 6.15476 1.07166 5.39623 1.63137C6.06877 1.53122 6.69483 1.67279 7.25179 1.95634C5.92826 1.81055 4.62311 2.0286 3.6499 3.33988C4.54662 2.78165 5.45137 2.67368 6.41001 2.74362C5.00534 3.15564 3.87112 3.8884 3.35113 5.71798C4.12868 4.68666 4.99625 4.1054 6.05842 3.75824C4.8287 4.57721 3.93704 5.72072 3.80625 7.48396C4.36618 6.33157 5.16782 5.47943 6.09962 4.8071C5.13676 5.98568 4.61149 7.50466 4.91871 9.36572C5.21494 7.89851 5.87354 6.72478 6.72504 5.72093Z"
|
|
92
|
+
fill="#1D252D"
|
|
93
|
+
/>
|
|
94
|
+
</svg>
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<div class="section letters-section">
|
|
98
|
+
<div class="arabic-row" dir="rtl">
|
|
99
|
+
@for (lAr of lettersAr(); track lAr) {
|
|
100
|
+
<span>{{ lAr }}</span>
|
|
101
|
+
}
|
|
102
|
+
</div>
|
|
103
|
+
<div class="english-row" dir="rtl">
|
|
104
|
+
@for (lEn of lettersEn(); track lEn) {
|
|
105
|
+
<span>{{ lEn }}</span>
|
|
106
|
+
}
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<div class="ksa-strip">
|
|
111
|
+
<svg class="mini-emblem" viewBox="0 0 17 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
112
|
+
<path
|
|
113
|
+
fill-rule="evenodd" clip-rule="evenodd"
|
|
114
|
+
d="M10.8072 16.8744C11.4633 16.178 11.3244 15.3914 10.7996 15.3825C10.9872 15.9606 10.5562 16.3344 10.3922 16.5266C9.97894 16.1712 9.55086 15.7761 9.10778 15.3694C11.2695 13.5812 13.6354 11.995 16.7263 11.9452C13.3983 10.7499 10.7417 12.7815 8.4925 14.8084C6.24308 12.7815 3.58672 10.7499 0.257812 11.9452C3.34944 11.995 5.71507 13.581 7.87722 15.3694C7.43329 15.7761 7.00564 16.1712 6.59172 16.5266C6.42902 16.3344 5.99777 15.9606 6.18435 15.3825C5.65992 15.3914 5.52089 16.178 6.17758 16.8744C5.91495 17.0931 5.48962 17.4631 5.15113 17.5518C4.89082 17.6199 4.68185 17.4846 4.63473 17.2026C4.53542 16.6069 3.61271 16.6959 3.72554 17.5372C3.82907 18.3044 4.76066 18.6391 5.55892 18.2837C5.87565 18.1424 6.3107 17.7413 6.66778 17.45C6.83111 17.641 7.26215 18.0145 7.07494 18.5935C7.59979 18.5838 7.7384 17.798 7.08234 17.1005C7.54845 16.7028 8.01625 16.2927 8.4925 15.887C8.96833 16.2925 9.43634 16.7028 9.90288 17.1005C9.24639 17.798 9.385 18.5838 9.91006 18.5935C9.72285 18.0145 10.1539 17.6414 10.3168 17.45C10.6745 17.7413 11.1091 18.1424 11.4263 18.2837C12.2246 18.6391 13.1555 18.3044 13.259 17.5372C13.3719 16.6959 12.4496 16.6069 12.3494 17.2026C12.3023 17.4846 12.094 17.6196 11.8332 17.5518C11.4948 17.4631 11.0696 17.0931 10.8072 16.8744ZM6.72504 5.72093C6.22365 7.04637 6.19597 8.53894 6.9169 10.1805C6.80195 8.47576 7.17594 7.06771 7.8713 6.0066L8.01815 7.46832H7.84679L8.01815 9.17958H7.84679L8.01815 10.8904H7.84679L8.01794 12.5991L7.53366 13.0819H8.4925H9.45156L8.96685 12.5991L9.13842 10.8904H8.96685L9.13842 9.17958H8.96685L9.13842 7.46832H8.96685L9.11391 6.0066C9.80906 7.06771 10.1833 8.47682 10.0683 10.1805C10.7886 8.53894 10.7616 7.047 10.2602 5.72093C11.1115 6.72478 11.7701 7.89851 12.0661 9.36572C12.3733 7.50466 11.848 5.98568 10.8852 4.8071C11.8174 5.47943 12.6184 6.33157 13.1785 7.48396C13.048 5.72072 12.1559 4.57742 10.927 3.75824C11.989 4.1054 12.8561 4.68645 13.6343 5.71798C13.1139 3.8884 11.9801 3.15564 10.575 2.74362C11.5332 2.67368 12.4386 2.78165 13.3347 3.33988C12.3621 2.02839 11.0565 1.81055 9.73257 1.95634C10.2893 1.67279 10.9158 1.53101 11.5888 1.63137C10.8302 1.07187 9.81836 1.01651 8.95227 1.48812L8.4925 0.328125L8.0321 1.48749C7.1658 1.01651 6.15476 1.07166 5.39623 1.63137C6.06877 1.53122 6.69483 1.67279 7.25179 1.95634C5.92826 1.81055 4.62311 2.0286 3.6499 3.33988C4.54662 2.78165 5.45137 2.67368 6.41001 2.74362C5.00534 3.15564 3.87112 3.8884 3.35113 5.71798C4.12868 4.68666 4.99625 4.1054 6.05842 3.75824C4.8287 4.57721 3.93704 5.72072 3.80625 7.48396C4.36618 6.33157 5.16782 5.47943 6.09962 4.8071C5.13676 5.98568 4.61149 7.50466 4.91871 9.36572C5.21494 7.89851 5.87354 6.72478 6.72504 5.72093Z"
|
|
115
|
+
fill="#1D252D"
|
|
116
|
+
/>
|
|
117
|
+
</svg>
|
|
118
|
+
<span class="ksa-text">KSA</span>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
`, isInline: true, styles: [".plate-container{width:600px;height:130px;border:4px solid #1D252D;border-radius:10px;background:#fff;display:flex;box-shadow:0 4px 10px #0003;overflow:hidden;position:relative}.section{display:flex;flex-direction:column;justify-content:center;align-items:center}.numbers-section{flex:2;padding:0 10px}.digit-row{display:flex;justify-content:space-between;width:80%;font-size:38px;line-height:1;color:#1d252d;margin:2px 0}.emblem-section{flex:1.2;padding:10px}.emblem-svg{width:100%;height:100%;max-height:90px}.letters-section{flex:1.8;border-right:2px solid #1D252D;padding:0 10px}.arabic-row{font-family:Noto Sans Arabic,sans-serif;font-size:32px;display:flex;justify-content:space-around;width:100%;margin-bottom:5px;color:#1d252d}.english-row{font-size:38px;display:flex;justify-content:space-around;width:100%;color:#1d252d}.ksa-strip{width:50px;display:flex;flex-direction:column;justify-content:space-between;align-items:center;padding:10px 0;background-color:#fff}.mini-emblem{width:25px;height:auto}.ksa-text{writing-mode:vertical-rl;text-orientation:upright;font-weight:900;font-size:16px;letter-spacing:2px;color:#1d252d;margin-top:auto;margin-bottom:5px}.plate-input{background:transparent;border:none;text-align:center;font-family:inherit;font-size:inherit;font-weight:700;color:#1d252d;width:100%;padding:0;margin:0;outline:none}.plate-input:focus{border-bottom:2px solid #1D252D}.digit-row,.arabic-row,.english-row{display:flex;justify-content:space-between;width:100%}.number-input,.letter-input{flex:1}.plate-input::placeholder{color:#ccc;opacity:1}.input-wrapper{position:relative;display:flex;flex-direction:column;align-items:center;flex:1}.error-tooltip{position:absolute;bottom:-15px;font-size:10px;color:red;white-space:nowrap}.plate-input.invalid{color:red}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
122
|
+
}
|
|
123
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PlateViewer, decorators: [{
|
|
124
|
+
type: Component,
|
|
125
|
+
args: [{ selector: "iss-viewer-plate", imports: [], template: `
|
|
126
|
+
<div class="plate-container">
|
|
127
|
+
<div class="section numbers-section">
|
|
128
|
+
<div class="digit-row">
|
|
129
|
+
@for (numAr of numbersAr(); track numAr) {
|
|
130
|
+
<span>{{ numAr }}</span>
|
|
131
|
+
}
|
|
132
|
+
</div>
|
|
133
|
+
<div class="digit-row">
|
|
134
|
+
@for (numEn of numbersEn(); track numEn) {
|
|
135
|
+
<span>{{ numEn }}</span>
|
|
136
|
+
}
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
<div class="section emblem-section">
|
|
141
|
+
<svg class="emblem-svg" viewBox="0 0 17 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
142
|
+
<path
|
|
143
|
+
fill-rule="evenodd"
|
|
144
|
+
clip-rule="evenodd"
|
|
145
|
+
d="M10.8072 16.8744C11.4633 16.178 11.3244 15.3914 10.7996 15.3825C10.9872 15.9606 10.5562 16.3344 10.3922 16.5266C9.97894 16.1712 9.55086 15.7761 9.10778 15.3694C11.2695 13.5812 13.6354 11.995 16.7263 11.9452C13.3983 10.7499 10.7417 12.7815 8.4925 14.8084C6.24308 12.7815 3.58672 10.7499 0.257812 11.9452C3.34944 11.995 5.71507 13.581 7.87722 15.3694C7.43329 15.7761 7.00564 16.1712 6.59172 16.5266C6.42902 16.3344 5.99777 15.9606 6.18435 15.3825C5.65992 15.3914 5.52089 16.178 6.17758 16.8744C5.91495 17.0931 5.48962 17.4631 5.15113 17.5518C4.89082 17.6199 4.68185 17.4846 4.63473 17.2026C4.53542 16.6069 3.61271 16.6959 3.72554 17.5372C3.82907 18.3044 4.76066 18.6391 5.55892 18.2837C5.87565 18.1424 6.3107 17.7413 6.66778 17.45C6.83111 17.641 7.26215 18.0145 7.07494 18.5935C7.59979 18.5838 7.7384 17.798 7.08234 17.1005C7.54845 16.7028 8.01625 16.2927 8.4925 15.887C8.96833 16.2925 9.43634 16.7028 9.90288 17.1005C9.24639 17.798 9.385 18.5838 9.91006 18.5935C9.72285 18.0145 10.1539 17.6414 10.3168 17.45C10.6745 17.7413 11.1091 18.1424 11.4263 18.2837C12.2246 18.6391 13.1555 18.3044 13.259 17.5372C13.3719 16.6959 12.4496 16.6069 12.3494 17.2026C12.3023 17.4846 12.094 17.6196 11.8332 17.5518C11.4948 17.4631 11.0696 17.0931 10.8072 16.8744ZM6.72504 5.72093C6.22365 7.04637 6.19597 8.53894 6.9169 10.1805C6.80195 8.47576 7.17594 7.06771 7.8713 6.0066L8.01815 7.46832H7.84679L8.01815 9.17958H7.84679L8.01815 10.8904H7.84679L8.01794 12.5991L7.53366 13.0819H8.4925H9.45156L8.96685 12.5991L9.13842 10.8904H8.96685L9.13842 9.17958H8.96685L9.13842 7.46832H8.96685L9.11391 6.0066C9.80906 7.06771 10.1833 8.47682 10.0683 10.1805C10.7886 8.53894 10.7616 7.047 10.2602 5.72093C11.1115 6.72478 11.7701 7.89851 12.0661 9.36572C12.3733 7.50466 11.848 5.98568 10.8852 4.8071C11.8174 5.47943 12.6184 6.33157 13.1785 7.48396C13.048 5.72072 12.1559 4.57742 10.927 3.75824C11.989 4.1054 12.8561 4.68645 13.6343 5.71798C13.1139 3.8884 11.9801 3.15564 10.575 2.74362C11.5332 2.67368 12.4386 2.78165 13.3347 3.33988C12.3621 2.02839 11.0565 1.81055 9.73257 1.95634C10.2893 1.67279 10.9158 1.53101 11.5888 1.63137C10.8302 1.07187 9.81836 1.01651 8.95227 1.48812L8.4925 0.328125L8.0321 1.48749C7.1658 1.01651 6.15476 1.07166 5.39623 1.63137C6.06877 1.53122 6.69483 1.67279 7.25179 1.95634C5.92826 1.81055 4.62311 2.0286 3.6499 3.33988C4.54662 2.78165 5.45137 2.67368 6.41001 2.74362C5.00534 3.15564 3.87112 3.8884 3.35113 5.71798C4.12868 4.68666 4.99625 4.1054 6.05842 3.75824C4.8287 4.57721 3.93704 5.72072 3.80625 7.48396C4.36618 6.33157 5.16782 5.47943 6.09962 4.8071C5.13676 5.98568 4.61149 7.50466 4.91871 9.36572C5.21494 7.89851 5.87354 6.72478 6.72504 5.72093Z"
|
|
146
|
+
fill="#1D252D"
|
|
147
|
+
/>
|
|
148
|
+
</svg>
|
|
149
|
+
</div>
|
|
150
|
+
|
|
151
|
+
<div class="section letters-section">
|
|
152
|
+
<div class="arabic-row" dir="rtl">
|
|
153
|
+
@for (lAr of lettersAr(); track lAr) {
|
|
154
|
+
<span>{{ lAr }}</span>
|
|
155
|
+
}
|
|
156
|
+
</div>
|
|
157
|
+
<div class="english-row" dir="rtl">
|
|
158
|
+
@for (lEn of lettersEn(); track lEn) {
|
|
159
|
+
<span>{{ lEn }}</span>
|
|
160
|
+
}
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<div class="ksa-strip">
|
|
165
|
+
<svg class="mini-emblem" viewBox="0 0 17 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
166
|
+
<path
|
|
167
|
+
fill-rule="evenodd" clip-rule="evenodd"
|
|
168
|
+
d="M10.8072 16.8744C11.4633 16.178 11.3244 15.3914 10.7996 15.3825C10.9872 15.9606 10.5562 16.3344 10.3922 16.5266C9.97894 16.1712 9.55086 15.7761 9.10778 15.3694C11.2695 13.5812 13.6354 11.995 16.7263 11.9452C13.3983 10.7499 10.7417 12.7815 8.4925 14.8084C6.24308 12.7815 3.58672 10.7499 0.257812 11.9452C3.34944 11.995 5.71507 13.581 7.87722 15.3694C7.43329 15.7761 7.00564 16.1712 6.59172 16.5266C6.42902 16.3344 5.99777 15.9606 6.18435 15.3825C5.65992 15.3914 5.52089 16.178 6.17758 16.8744C5.91495 17.0931 5.48962 17.4631 5.15113 17.5518C4.89082 17.6199 4.68185 17.4846 4.63473 17.2026C4.53542 16.6069 3.61271 16.6959 3.72554 17.5372C3.82907 18.3044 4.76066 18.6391 5.55892 18.2837C5.87565 18.1424 6.3107 17.7413 6.66778 17.45C6.83111 17.641 7.26215 18.0145 7.07494 18.5935C7.59979 18.5838 7.7384 17.798 7.08234 17.1005C7.54845 16.7028 8.01625 16.2927 8.4925 15.887C8.96833 16.2925 9.43634 16.7028 9.90288 17.1005C9.24639 17.798 9.385 18.5838 9.91006 18.5935C9.72285 18.0145 10.1539 17.6414 10.3168 17.45C10.6745 17.7413 11.1091 18.1424 11.4263 18.2837C12.2246 18.6391 13.1555 18.3044 13.259 17.5372C13.3719 16.6959 12.4496 16.6069 12.3494 17.2026C12.3023 17.4846 12.094 17.6196 11.8332 17.5518C11.4948 17.4631 11.0696 17.0931 10.8072 16.8744ZM6.72504 5.72093C6.22365 7.04637 6.19597 8.53894 6.9169 10.1805C6.80195 8.47576 7.17594 7.06771 7.8713 6.0066L8.01815 7.46832H7.84679L8.01815 9.17958H7.84679L8.01815 10.8904H7.84679L8.01794 12.5991L7.53366 13.0819H8.4925H9.45156L8.96685 12.5991L9.13842 10.8904H8.96685L9.13842 9.17958H8.96685L9.13842 7.46832H8.96685L9.11391 6.0066C9.80906 7.06771 10.1833 8.47682 10.0683 10.1805C10.7886 8.53894 10.7616 7.047 10.2602 5.72093C11.1115 6.72478 11.7701 7.89851 12.0661 9.36572C12.3733 7.50466 11.848 5.98568 10.8852 4.8071C11.8174 5.47943 12.6184 6.33157 13.1785 7.48396C13.048 5.72072 12.1559 4.57742 10.927 3.75824C11.989 4.1054 12.8561 4.68645 13.6343 5.71798C13.1139 3.8884 11.9801 3.15564 10.575 2.74362C11.5332 2.67368 12.4386 2.78165 13.3347 3.33988C12.3621 2.02839 11.0565 1.81055 9.73257 1.95634C10.2893 1.67279 10.9158 1.53101 11.5888 1.63137C10.8302 1.07187 9.81836 1.01651 8.95227 1.48812L8.4925 0.328125L8.0321 1.48749C7.1658 1.01651 6.15476 1.07166 5.39623 1.63137C6.06877 1.53122 6.69483 1.67279 7.25179 1.95634C5.92826 1.81055 4.62311 2.0286 3.6499 3.33988C4.54662 2.78165 5.45137 2.67368 6.41001 2.74362C5.00534 3.15564 3.87112 3.8884 3.35113 5.71798C4.12868 4.68666 4.99625 4.1054 6.05842 3.75824C4.8287 4.57721 3.93704 5.72072 3.80625 7.48396C4.36618 6.33157 5.16782 5.47943 6.09962 4.8071C5.13676 5.98568 4.61149 7.50466 4.91871 9.36572C5.21494 7.89851 5.87354 6.72478 6.72504 5.72093Z"
|
|
169
|
+
fill="#1D252D"
|
|
170
|
+
/>
|
|
171
|
+
</svg>
|
|
172
|
+
<span class="ksa-text">KSA</span>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".plate-container{width:600px;height:130px;border:4px solid #1D252D;border-radius:10px;background:#fff;display:flex;box-shadow:0 4px 10px #0003;overflow:hidden;position:relative}.section{display:flex;flex-direction:column;justify-content:center;align-items:center}.numbers-section{flex:2;padding:0 10px}.digit-row{display:flex;justify-content:space-between;width:80%;font-size:38px;line-height:1;color:#1d252d;margin:2px 0}.emblem-section{flex:1.2;padding:10px}.emblem-svg{width:100%;height:100%;max-height:90px}.letters-section{flex:1.8;border-right:2px solid #1D252D;padding:0 10px}.arabic-row{font-family:Noto Sans Arabic,sans-serif;font-size:32px;display:flex;justify-content:space-around;width:100%;margin-bottom:5px;color:#1d252d}.english-row{font-size:38px;display:flex;justify-content:space-around;width:100%;color:#1d252d}.ksa-strip{width:50px;display:flex;flex-direction:column;justify-content:space-between;align-items:center;padding:10px 0;background-color:#fff}.mini-emblem{width:25px;height:auto}.ksa-text{writing-mode:vertical-rl;text-orientation:upright;font-weight:900;font-size:16px;letter-spacing:2px;color:#1d252d;margin-top:auto;margin-bottom:5px}.plate-input{background:transparent;border:none;text-align:center;font-family:inherit;font-size:inherit;font-weight:700;color:#1d252d;width:100%;padding:0;margin:0;outline:none}.plate-input:focus{border-bottom:2px solid #1D252D}.digit-row,.arabic-row,.english-row{display:flex;justify-content:space-between;width:100%}.number-input,.letter-input{flex:1}.plate-input::placeholder{color:#ccc;opacity:1}.input-wrapper{position:relative;display:flex;flex-direction:column;align-items:center;flex:1}.error-tooltip{position:absolute;bottom:-15px;font-size:10px;color:red;white-space:nowrap}.plate-input.invalid{color:red}\n"] }]
|
|
176
|
+
}] });
|
|
177
|
+
|
|
178
|
+
export { PlateViewer };
|
|
179
|
+
//# sourceMappingURL=iss-ctrl-plate.viewer-B8PUBLH8.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iss-ctrl-plate.viewer-B8PUBLH8.mjs","sources":["../../../projects/iss/src/components/controls/plate/plate.viewer.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, effect, signal } from \"@angular/core\";\nimport { ViewerBase } from \"iss-ctrl/base\";\nimport { PLATE_LETTERS } from \"iss-ctrl/plate\";\n\n@Component({\n selector: \"iss-viewer-plate\",\n imports: [],\n template: `\n <div class=\"plate-container\">\n <div class=\"section numbers-section\">\n <div class=\"digit-row\">\n @for (numAr of numbersAr(); track numAr) {\n <span>{{ numAr }}</span>\n }\n </div>\n <div class=\"digit-row\">\n @for (numEn of numbersEn(); track numEn) {\n <span>{{ numEn }}</span>\n }\n </div>\n </div>\n\n <div class=\"section emblem-section\">\n <svg class=\"emblem-svg\" viewBox=\"0 0 17 19\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M10.8072 16.8744C11.4633 16.178 11.3244 15.3914 10.7996 15.3825C10.9872 15.9606 10.5562 16.3344 10.3922 16.5266C9.97894 16.1712 9.55086 15.7761 9.10778 15.3694C11.2695 13.5812 13.6354 11.995 16.7263 11.9452C13.3983 10.7499 10.7417 12.7815 8.4925 14.8084C6.24308 12.7815 3.58672 10.7499 0.257812 11.9452C3.34944 11.995 5.71507 13.581 7.87722 15.3694C7.43329 15.7761 7.00564 16.1712 6.59172 16.5266C6.42902 16.3344 5.99777 15.9606 6.18435 15.3825C5.65992 15.3914 5.52089 16.178 6.17758 16.8744C5.91495 17.0931 5.48962 17.4631 5.15113 17.5518C4.89082 17.6199 4.68185 17.4846 4.63473 17.2026C4.53542 16.6069 3.61271 16.6959 3.72554 17.5372C3.82907 18.3044 4.76066 18.6391 5.55892 18.2837C5.87565 18.1424 6.3107 17.7413 6.66778 17.45C6.83111 17.641 7.26215 18.0145 7.07494 18.5935C7.59979 18.5838 7.7384 17.798 7.08234 17.1005C7.54845 16.7028 8.01625 16.2927 8.4925 15.887C8.96833 16.2925 9.43634 16.7028 9.90288 17.1005C9.24639 17.798 9.385 18.5838 9.91006 18.5935C9.72285 18.0145 10.1539 17.6414 10.3168 17.45C10.6745 17.7413 11.1091 18.1424 11.4263 18.2837C12.2246 18.6391 13.1555 18.3044 13.259 17.5372C13.3719 16.6959 12.4496 16.6069 12.3494 17.2026C12.3023 17.4846 12.094 17.6196 11.8332 17.5518C11.4948 17.4631 11.0696 17.0931 10.8072 16.8744ZM6.72504 5.72093C6.22365 7.04637 6.19597 8.53894 6.9169 10.1805C6.80195 8.47576 7.17594 7.06771 7.8713 6.0066L8.01815 7.46832H7.84679L8.01815 9.17958H7.84679L8.01815 10.8904H7.84679L8.01794 12.5991L7.53366 13.0819H8.4925H9.45156L8.96685 12.5991L9.13842 10.8904H8.96685L9.13842 9.17958H8.96685L9.13842 7.46832H8.96685L9.11391 6.0066C9.80906 7.06771 10.1833 8.47682 10.0683 10.1805C10.7886 8.53894 10.7616 7.047 10.2602 5.72093C11.1115 6.72478 11.7701 7.89851 12.0661 9.36572C12.3733 7.50466 11.848 5.98568 10.8852 4.8071C11.8174 5.47943 12.6184 6.33157 13.1785 7.48396C13.048 5.72072 12.1559 4.57742 10.927 3.75824C11.989 4.1054 12.8561 4.68645 13.6343 5.71798C13.1139 3.8884 11.9801 3.15564 10.575 2.74362C11.5332 2.67368 12.4386 2.78165 13.3347 3.33988C12.3621 2.02839 11.0565 1.81055 9.73257 1.95634C10.2893 1.67279 10.9158 1.53101 11.5888 1.63137C10.8302 1.07187 9.81836 1.01651 8.95227 1.48812L8.4925 0.328125L8.0321 1.48749C7.1658 1.01651 6.15476 1.07166 5.39623 1.63137C6.06877 1.53122 6.69483 1.67279 7.25179 1.95634C5.92826 1.81055 4.62311 2.0286 3.6499 3.33988C4.54662 2.78165 5.45137 2.67368 6.41001 2.74362C5.00534 3.15564 3.87112 3.8884 3.35113 5.71798C4.12868 4.68666 4.99625 4.1054 6.05842 3.75824C4.8287 4.57721 3.93704 5.72072 3.80625 7.48396C4.36618 6.33157 5.16782 5.47943 6.09962 4.8071C5.13676 5.98568 4.61149 7.50466 4.91871 9.36572C5.21494 7.89851 5.87354 6.72478 6.72504 5.72093Z\"\n fill=\"#1D252D\"\n />\n </svg>\n </div>\n\n <div class=\"section letters-section\">\n <div class=\"arabic-row\" dir=\"rtl\">\n @for (lAr of lettersAr(); track lAr) {\n <span>{{ lAr }}</span>\n }\n </div>\n <div class=\"english-row\" dir=\"rtl\">\n @for (lEn of lettersEn(); track lEn) {\n <span>{{ lEn }}</span>\n }\n </div>\n </div>\n\n <div class=\"ksa-strip\">\n <svg class=\"mini-emblem\" viewBox=\"0 0 17 19\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M10.8072 16.8744C11.4633 16.178 11.3244 15.3914 10.7996 15.3825C10.9872 15.9606 10.5562 16.3344 10.3922 16.5266C9.97894 16.1712 9.55086 15.7761 9.10778 15.3694C11.2695 13.5812 13.6354 11.995 16.7263 11.9452C13.3983 10.7499 10.7417 12.7815 8.4925 14.8084C6.24308 12.7815 3.58672 10.7499 0.257812 11.9452C3.34944 11.995 5.71507 13.581 7.87722 15.3694C7.43329 15.7761 7.00564 16.1712 6.59172 16.5266C6.42902 16.3344 5.99777 15.9606 6.18435 15.3825C5.65992 15.3914 5.52089 16.178 6.17758 16.8744C5.91495 17.0931 5.48962 17.4631 5.15113 17.5518C4.89082 17.6199 4.68185 17.4846 4.63473 17.2026C4.53542 16.6069 3.61271 16.6959 3.72554 17.5372C3.82907 18.3044 4.76066 18.6391 5.55892 18.2837C5.87565 18.1424 6.3107 17.7413 6.66778 17.45C6.83111 17.641 7.26215 18.0145 7.07494 18.5935C7.59979 18.5838 7.7384 17.798 7.08234 17.1005C7.54845 16.7028 8.01625 16.2927 8.4925 15.887C8.96833 16.2925 9.43634 16.7028 9.90288 17.1005C9.24639 17.798 9.385 18.5838 9.91006 18.5935C9.72285 18.0145 10.1539 17.6414 10.3168 17.45C10.6745 17.7413 11.1091 18.1424 11.4263 18.2837C12.2246 18.6391 13.1555 18.3044 13.259 17.5372C13.3719 16.6959 12.4496 16.6069 12.3494 17.2026C12.3023 17.4846 12.094 17.6196 11.8332 17.5518C11.4948 17.4631 11.0696 17.0931 10.8072 16.8744ZM6.72504 5.72093C6.22365 7.04637 6.19597 8.53894 6.9169 10.1805C6.80195 8.47576 7.17594 7.06771 7.8713 6.0066L8.01815 7.46832H7.84679L8.01815 9.17958H7.84679L8.01815 10.8904H7.84679L8.01794 12.5991L7.53366 13.0819H8.4925H9.45156L8.96685 12.5991L9.13842 10.8904H8.96685L9.13842 9.17958H8.96685L9.13842 7.46832H8.96685L9.11391 6.0066C9.80906 7.06771 10.1833 8.47682 10.0683 10.1805C10.7886 8.53894 10.7616 7.047 10.2602 5.72093C11.1115 6.72478 11.7701 7.89851 12.0661 9.36572C12.3733 7.50466 11.848 5.98568 10.8852 4.8071C11.8174 5.47943 12.6184 6.33157 13.1785 7.48396C13.048 5.72072 12.1559 4.57742 10.927 3.75824C11.989 4.1054 12.8561 4.68645 13.6343 5.71798C13.1139 3.8884 11.9801 3.15564 10.575 2.74362C11.5332 2.67368 12.4386 2.78165 13.3347 3.33988C12.3621 2.02839 11.0565 1.81055 9.73257 1.95634C10.2893 1.67279 10.9158 1.53101 11.5888 1.63137C10.8302 1.07187 9.81836 1.01651 8.95227 1.48812L8.4925 0.328125L8.0321 1.48749C7.1658 1.01651 6.15476 1.07166 5.39623 1.63137C6.06877 1.53122 6.69483 1.67279 7.25179 1.95634C5.92826 1.81055 4.62311 2.0286 3.6499 3.33988C4.54662 2.78165 5.45137 2.67368 6.41001 2.74362C5.00534 3.15564 3.87112 3.8884 3.35113 5.71798C4.12868 4.68666 4.99625 4.1054 6.05842 3.75824C4.8287 4.57721 3.93704 5.72072 3.80625 7.48396C4.36618 6.33157 5.16782 5.47943 6.09962 4.8071C5.13676 5.98568 4.61149 7.50466 4.91871 9.36572C5.21494 7.89851 5.87354 6.72478 6.72504 5.72093Z\"\n fill=\"#1D252D\"\n />\n </svg>\n <span class=\"ksa-text\">KSA</span>\n </div>\n </div>\n `,\n styles: `\n .plate-container {\n width: 600px;\n height: 130px;\n border: 4px solid #1D252D;\n border-radius: 10px;\n background: white;\n display: flex;\n box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);\n overflow: hidden;\n position: relative;\n }\n\n /* General Section Styling */\n .section {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n }\n\n /* Left Section: Numbers/Asterisks */\n .numbers-section {\n flex: 2;\n padding: 0 10px;\n }\n\n .digit-row {\n display: flex;\n justify-content: space-between;\n width: 80%;\n font-size: 38px;\n line-height: 1;\n color: #1D252D;\n margin: 2px 0;\n }\n\n /* Middle Section: Emblem */\n .emblem-section {\n flex: 1.2;\n padding: 10px;\n }\n\n .emblem-svg {\n width: 100%;\n height: 100%;\n max-height: 90px;\n }\n\n /* Right Section: Letters */\n .letters-section {\n flex: 1.8;\n border-right: 2px solid #1D252D;\n padding: 0 10px;\n }\n\n .arabic-row {\n font-family: 'Noto Sans Arabic', sans-serif;\n font-size: 32px;\n display: flex;\n justify-content: space-around;\n width: 100%;\n margin-bottom: 5px;\n color: #1D252D;\n }\n\n .english-row {\n font-size: 38px;\n display: flex;\n justify-content: space-around;\n width: 100%;\n color: #1D252D;\n }\n\n /* Far Right: KSA Strip */\n .ksa-strip {\n width: 50px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n padding: 10px 0;\n background-color: #fff; /* or specific reflective white */\n }\n\n .mini-emblem {\n width: 25px;\n height: auto;\n }\n\n .ksa-text {\n writing-mode: vertical-rl;\n text-orientation: upright;\n font-weight: 900;\n font-size: 16px;\n letter-spacing: 2px;\n color: #1D252D;\n margin-top: auto;\n margin-bottom: 5px;\n }\n\n .plate-input {\n background: transparent;\n border: none;\n text-align: center;\n font-family: inherit;\n font-size: inherit;\n font-weight: bold;\n color: #1D252D;\n width: 100%; /* Fill the flex/grid item */\n padding: 0;\n margin: 0;\n outline: none; /* Remove blue outline on focus */\n }\n\n /* Optional: Add a subtle underline or color change when user clicks the input */\n .plate-input:focus {\n border-bottom: 2px solid #1D252D;\n }\n\n /* Adjusting the container flex settings to ensure inputs fit */\n .digit-row, .arabic-row, .english-row {\n display: flex;\n justify-content: space-between;\n width: 100%;\n }\n\n /* Specific sizing for numbers to ensure they match plate proportions */\n .number-input {\n /* Adjust width based on your container size, roughly 20-25% */\n flex: 1;\n }\n\n /* Specific sizing for letters */\n .letter-input {\n flex: 1;\n }\n\n /* Placeholder styling to look like a ghost plate */\n .plate-input::placeholder {\n color: #ccc;\n opacity: 1;\n }\n\n .input-wrapper {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n flex: 1;\n }\n\n .error-tooltip {\n position: absolute;\n bottom: -15px;\n font-size: 10px;\n color: red;\n white-space: nowrap;\n }\n\n .plate-input.invalid {\n color: red;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class PlateViewer extends ViewerBase {\n numbersAr = signal<string[]>(Array(4).fill(\"\"));\n numbersEn = signal<string[]>(Array(4).fill(\"\"));\n lettersAr = signal<string[]>(Array(3).fill(\"\"));\n lettersEn = signal<string[]>(Array(3).fill(\"\"));\n effectRef = effect(() => {\n const val = this.field().value;\n if (val) {\n const parts = val.split(\"-\");\n const letters = parts[0]?.split(\"\") || [];\n const numbers = parts[1]?.split(\"\") || [];\n\n // Initialize letters\n const lAr: string[] = [];\n const lEn: string[] = [];\n for (let i = 0; i < 3; i++) {\n const char = letters[i] || \"\";\n if (char) {\n const plateLetter = PLATE_LETTERS.find(l => l.value === char || l.label.en === char || l.label.ar === char);\n if (plateLetter) {\n lAr.push(plateLetter.label.ar);\n lEn.push(plateLetter.label.en);\n } else {\n lAr.push(\"\");\n lEn.push(\"\");\n }\n } else {\n lAr.push(\"\");\n lEn.push(\"\");\n }\n }\n this.lettersAr.set(lAr);\n this.lettersEn.set(lEn);\n\n // Initialize numbers\n const nAr: string[] = [];\n const nEn: string[] = [];\n for (let i = 0; i < 4; i++) {\n const char = numbers[i] || \"\";\n if (char) {\n nAr.push(this.convertDigit(char, \"ar\"));\n nEn.push(this.convertDigit(char, \"en\"));\n } else {\n nAr.push(\"\");\n nEn.push(\"\");\n }\n }\n this.numbersAr.set(nAr);\n this.numbersEn.set(nEn);\n }\n });\n\n private convertDigit(digit: string, toLang: \"ar\" | \"en\"): string {\n const arDigits = [\"٠\", \"١\", \"٢\", \"٣\", \"٤\", \"٥\", \"٦\", \"٧\", \"٨\", \"٩\"];\n const enDigits = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"];\n\n if (toLang === \"ar\") {\n const index = enDigits.indexOf(digit);\n return index !== -1 ? arDigits[index] : digit;\n } else {\n const index = arDigits.indexOf(digit);\n return index !== -1 ? enDigits[index] : digit;\n }\n }\n}\n"],"names":[],"mappings":";;;;;AAgOM,MAAO,WAAY,SAAQ,UAAU,CAAA;AACzC,IAAA,SAAS,GAAG,MAAM,CAAW,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,gFAAC;AAC/C,IAAA,SAAS,GAAG,MAAM,CAAW,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,gFAAC;AAC/C,IAAA,SAAS,GAAG,MAAM,CAAW,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,gFAAC;AAC/C,IAAA,SAAS,GAAG,MAAM,CAAW,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,gFAAC;AAC/C,IAAA,SAAS,GAAG,MAAM,CAAC,MAAK;QACtB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK;QAC9B,IAAI,GAAG,EAAE;YACP,MAAM,KAA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G,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC;AACrC,YAAA,OAAO,KAAK,KAAK,CAAC,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK;QAC/C;IACF;uGA/DW,WAAW,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAX,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,WAAW,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAzNZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,0vDAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAuKU,WAAW,EAAA,UAAA,EAAA,CAAA;kBA5NvB,SAAS;+BACE,kBAAkB,EAAA,OAAA,EACnB,EAAE,EAAA,QAAA,EACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDT,EAAA,eAAA,EAqKgB,uBAAuB,CAAC,MAAM,EAAA,MAAA,EAAA,CAAA,0vDAAA,CAAA,EAAA;;;;;"}
|
|
@@ -0,0 +1,96 @@
|
|
|
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 { MatLabel } from '@angular/material/form-field';
|
|
6
|
+
import { F as FieldBase, V as VIEW_PROVIDER, a as ValidationMessage, b as FieldViewer } from './iss-ctrl-iss-ctrl-DvnkwSMG.mjs';
|
|
7
|
+
import { RadioControl } from 'iss-ctrl/radio';
|
|
8
|
+
import { RadioViewer } from './iss-ctrl-radio.viewer-EiDliZro.mjs';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* `<iss-field-radio>` — one choice out of a fixed set of options.
|
|
12
|
+
*
|
|
13
|
+
* Rendered by the outlet for fields of type `radio`. In `edit` mode it renders
|
|
14
|
+
* {@link RadioControl} plus the validation message; in `view` mode the matching viewer.
|
|
15
|
+
*
|
|
16
|
+
* ### Supported `config` keys
|
|
17
|
+
* | Key | Type | Description |
|
|
18
|
+
* | --- | --- | --- |
|
|
19
|
+
* | `hideLabel` | `boolean` | Hides the field label. |
|
|
20
|
+
* | `readonly` | `boolean` | Shows the value but blocks interaction. |
|
|
21
|
+
*
|
|
22
|
+
* ### Other field members used
|
|
23
|
+
* `label()` · `options()`
|
|
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": "gender", "type": "radio", "label": "Gender", "options": [{ "value": "m", "label": "Male" }] }
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
class RadioField extends FieldBase {
|
|
34
|
+
onChange($event) {
|
|
35
|
+
this.field.ctrlJsonValue.set($event);
|
|
36
|
+
}
|
|
37
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RadioField, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
38
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: RadioField, isStandalone: true, selector: "iss-field-radio", usesInheritance: true, ngImport: i0, template: `
|
|
39
|
+
@if (field.visible()) {
|
|
40
|
+
<div style="display: flex; flex-direction: column">
|
|
41
|
+
@if (field.mode() === "edit") {
|
|
42
|
+
@if (!field.config.hideLabel()) {
|
|
43
|
+
<mat-label>{{ field.label() }}</mat-label>
|
|
44
|
+
}
|
|
45
|
+
<iss-ctrl-radio [formControlName]="field.name" [options]="field.options()" [readonly]="field.config.readonly() ?? false" (onChange)="onChange($event)"/>
|
|
46
|
+
<iss-validation-message-viewer [errors]="ctrl.errors" [showMessage]="!ctrl.untouched"/>
|
|
47
|
+
} @else {
|
|
48
|
+
<iss-field-viewer>
|
|
49
|
+
@if (!field.config.hideLabel()) {
|
|
50
|
+
<label>{{ field.label() }}</label>
|
|
51
|
+
}
|
|
52
|
+
<iss-viewer-radio [field]="field"/>
|
|
53
|
+
</iss-field-viewer>
|
|
54
|
+
}
|
|
55
|
+
</div>
|
|
56
|
+
}
|
|
57
|
+
`, 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: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: RadioControl, selector: "iss-ctrl-radio", inputs: ["options"] }, { kind: "component", type: ValidationMessage, selector: "iss-validation-message-viewer", inputs: ["errors", "showMessage"] }, { kind: "component", type: RadioViewer, selector: "iss-viewer-radio" }, { kind: "component", type: FieldViewer, selector: "iss-field-viewer" }], viewProviders: [VIEW_PROVIDER] });
|
|
58
|
+
}
|
|
59
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RadioField, decorators: [{
|
|
60
|
+
type: Component,
|
|
61
|
+
args: [{
|
|
62
|
+
selector: "iss-field-radio",
|
|
63
|
+
viewProviders: [VIEW_PROVIDER],
|
|
64
|
+
imports: [
|
|
65
|
+
ReactiveFormsModule,
|
|
66
|
+
MatLabel,
|
|
67
|
+
RadioControl,
|
|
68
|
+
ValidationMessage,
|
|
69
|
+
RadioViewer,
|
|
70
|
+
FieldViewer
|
|
71
|
+
],
|
|
72
|
+
template: `
|
|
73
|
+
@if (field.visible()) {
|
|
74
|
+
<div style="display: flex; flex-direction: column">
|
|
75
|
+
@if (field.mode() === "edit") {
|
|
76
|
+
@if (!field.config.hideLabel()) {
|
|
77
|
+
<mat-label>{{ field.label() }}</mat-label>
|
|
78
|
+
}
|
|
79
|
+
<iss-ctrl-radio [formControlName]="field.name" [options]="field.options()" [readonly]="field.config.readonly() ?? false" (onChange)="onChange($event)"/>
|
|
80
|
+
<iss-validation-message-viewer [errors]="ctrl.errors" [showMessage]="!ctrl.untouched"/>
|
|
81
|
+
} @else {
|
|
82
|
+
<iss-field-viewer>
|
|
83
|
+
@if (!field.config.hideLabel()) {
|
|
84
|
+
<label>{{ field.label() }}</label>
|
|
85
|
+
}
|
|
86
|
+
<iss-viewer-radio [field]="field"/>
|
|
87
|
+
</iss-field-viewer>
|
|
88
|
+
}
|
|
89
|
+
</div>
|
|
90
|
+
}
|
|
91
|
+
`
|
|
92
|
+
}]
|
|
93
|
+
}] });
|
|
94
|
+
|
|
95
|
+
export { RadioField };
|
|
96
|
+
//# sourceMappingURL=iss-ctrl-radio.field-B_JjPIlb.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iss-ctrl-radio.field-B_JjPIlb.mjs","sources":["../../../projects/iss/src/components/controls/radio/radio.field.ts"],"sourcesContent":["import { Component } from \"@angular/core\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\nimport { MatLabel } from \"@angular/material/form-field\";\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 { RadioControl } from \"iss-ctrl/radio\";\nimport { RadioViewer } from \"./radio.viewer\";\n\n/**\n * `<iss-field-radio>` — one choice out of a fixed set of options.\n *\n * Rendered by the outlet for fields of type `radio`. In `edit` mode it renders\n * {@link RadioControl} plus the validation message; in `view` mode the matching viewer.\n *\n * ### Supported `config` keys\n * | Key | Type | Description |\n * | --- | --- | --- |\n * | `hideLabel` | `boolean` | Hides the field label. |\n * | `readonly` | `boolean` | Shows the value but blocks interaction. |\n *\n * ### Other field members used\n * `label()` · `options()`\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\": \"gender\", \"type\": \"radio\", \"label\": \"Gender\", \"options\": [{ \"value\": \"m\", \"label\": \"Male\" }] }\n * ```\n */\n@Component({\n selector: \"iss-field-radio\",\n viewProviders: [VIEW_PROVIDER],\n imports: [\n ReactiveFormsModule,\n MatLabel,\n RadioControl,\n ValidationMessage,\n RadioViewer,\n FieldViewer\n ],\n template: `\n @if (field.visible()) {\n <div style=\"display: flex; flex-direction: column\">\n @if (field.mode() === \"edit\") {\n @if (!field.config.hideLabel()) {\n <mat-label>{{ field.label() }}</mat-label>\n }\n <iss-ctrl-radio [formControlName]=\"field.name\" [options]=\"field.options()\" [readonly]=\"field.config.readonly() ?? false\" (onChange)=\"onChange($event)\"/>\n <iss-validation-message-viewer [errors]=\"ctrl.errors\" [showMessage]=\"!ctrl.untouched\"/>\n } @else {\n <iss-field-viewer>\n @if (!field.config.hideLabel()) {\n <label>{{ field.label() }}</label>\n }\n <iss-viewer-radio [field]=\"field\"/>\n </iss-field-viewer>\n }\n </div>\n }\n `\n})\nexport class RadioField extends FieldBase {\n onChange($event: any) {\n this.field.ctrlJsonValue.set($event);\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AAUA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AAiCG,MAAO,UAAW,SAAQ,SAAS,CAAA;AACvC,IAAA,QAAQ,CAAC,MAAW,EAAA;QAClB,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC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EAAA,WAAA,EAAA,IAAA,EACX,WAAW,EAAA,QAAA,EAAA,kBAAA,EAAA,CAAA,EAAA,aAAA,EAPE,CAAC,aAAa,CAAC,EAAA,CAAA;;2FA8BnB,UAAU,EAAA,UAAA,EAAA,CAAA;kBAhCtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;oBAC3B,aAAa,EAAE,CAAC,aAAa,CAAC;AAC9B,oBAAA,OAAO,EAAE;wBACP,mBAAmB;wBACnB,QAAQ;wBACR,YAAY;wBACZ,iBAAiB;wBACjB,WAAW;wBACX;AACD,qBAAA;AACD,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;AAmBT,EAAA;AACF,iBAAA;;;;;"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, Component } from '@angular/core';
|
|
3
|
+
import { ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
+
import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle';
|
|
5
|
+
import { ControlBase } from 'iss-ctrl/base';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* `<iss-ctrl-radio>` — one choice out of a fixed set of options.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```html
|
|
12
|
+
* <iss-ctrl-radio formControlName="gender" [options]="genders"/>
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* ### Own inputs
|
|
16
|
+
* | Property | Type | Default | Description |
|
|
17
|
+
* | --- | --- | --- | --- |
|
|
18
|
+
* | `options` | `Option[]` | **required** | The selectable choices. |
|
|
19
|
+
*
|
|
20
|
+
* ### Inherited from {@link ControlBase}
|
|
21
|
+
* `formControlName` · `readonly` · `className` · `(onChange)`
|
|
22
|
+
*
|
|
23
|
+
* Does not project a label — the field label is rendered by the wrapping `iss-field-*`.
|
|
24
|
+
*/
|
|
25
|
+
class RadioControl extends ControlBase {
|
|
26
|
+
/**
|
|
27
|
+
* Selectable choices, each a `{ value, label }` pair. Required.
|
|
28
|
+
*/
|
|
29
|
+
options = input.required(...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
30
|
+
writeValue(value) {
|
|
31
|
+
if (!value) {
|
|
32
|
+
this.ctrl.setValue(null, { emitEvent: false });
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
// single selection mode, only the first value of a comma separated list is honoured
|
|
36
|
+
const values = value.split(",").map((val) => val.trim());
|
|
37
|
+
this.ctrl.setValue(values[0], { emitEvent: false });
|
|
38
|
+
}
|
|
39
|
+
onRadioChange(value) {
|
|
40
|
+
if (this.readonly()) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this.markAsTouched();
|
|
44
|
+
this.ctrl.setValue(value, { emitEvent: false });
|
|
45
|
+
const selectedOption = this.options().find((option) => option.value === value);
|
|
46
|
+
// the form keeps the raw value, while (onChange) consumers get the resolved option
|
|
47
|
+
this.propagateValue(value);
|
|
48
|
+
this.emitOnChangeEvent(selectedOption ? [selectedOption] : null);
|
|
49
|
+
}
|
|
50
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RadioControl, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
51
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: RadioControl, isStandalone: true, selector: "iss-ctrl-radio", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null } }, providers: [
|
|
52
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: RadioControl, multi: true }
|
|
53
|
+
], usesInheritance: true, ngImport: i0, template: `
|
|
54
|
+
<mat-button-toggle-group [hideSingleSelectionIndicator]="true" [disabled]="disabled() || readonly()">
|
|
55
|
+
@for (option of options(); track option.value) {
|
|
56
|
+
<mat-button-toggle
|
|
57
|
+
[value]="option.value"
|
|
58
|
+
[checked]="ctrl.value === option.value"
|
|
59
|
+
(change)="onRadioChange(option.value)"
|
|
60
|
+
>{{ option.label }}
|
|
61
|
+
</mat-button-toggle>
|
|
62
|
+
}
|
|
63
|
+
</mat-button-toggle-group>
|
|
64
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled", "disabledInteractive"], outputs: ["change"], exportAs: ["matButtonToggle"] }] });
|
|
65
|
+
}
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RadioControl, decorators: [{
|
|
67
|
+
type: Component,
|
|
68
|
+
args: [{
|
|
69
|
+
selector: "iss-ctrl-radio",
|
|
70
|
+
imports: [
|
|
71
|
+
ReactiveFormsModule,
|
|
72
|
+
MatButtonToggleGroup,
|
|
73
|
+
MatButtonToggle,
|
|
74
|
+
],
|
|
75
|
+
providers: [
|
|
76
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: RadioControl, multi: true }
|
|
77
|
+
],
|
|
78
|
+
template: `
|
|
79
|
+
<mat-button-toggle-group [hideSingleSelectionIndicator]="true" [disabled]="disabled() || readonly()">
|
|
80
|
+
@for (option of options(); track option.value) {
|
|
81
|
+
<mat-button-toggle
|
|
82
|
+
[value]="option.value"
|
|
83
|
+
[checked]="ctrl.value === option.value"
|
|
84
|
+
(change)="onRadioChange(option.value)"
|
|
85
|
+
>{{ option.label }}
|
|
86
|
+
</mat-button-toggle>
|
|
87
|
+
}
|
|
88
|
+
</mat-button-toggle-group>
|
|
89
|
+
`,
|
|
90
|
+
}]
|
|
91
|
+
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }] } });
|
|
92
|
+
|
|
93
|
+
// The radio control. Its field and viewer stay in the primary entry point and reach it
|
|
94
|
+
// from there, so the control ships only to an app that renders it or imports it directly.
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Generated bundle index. Do not edit.
|
|
98
|
+
*/
|
|
99
|
+
|
|
100
|
+
export { RadioControl };
|
|
101
|
+
//# sourceMappingURL=iss-ctrl-radio.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iss-ctrl-radio.mjs","sources":["../../../projects/iss/radio/src/radio.control.ts","../../../projects/iss/radio/src/public-api.ts","../../../projects/iss/radio/src/iss-ctrl-radio.ts"],"sourcesContent":["import { Component, input, InputSignal } from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR, ReactiveFormsModule } from \"@angular/forms\";\nimport { MatButtonToggle, MatButtonToggleGroup } from \"@angular/material/button-toggle\";\nimport { Option } from \"iss-ctrl/base\";\nimport { ControlBase } from \"iss-ctrl/base\";\n\n/**\n * `<iss-ctrl-radio>` — one choice out of a fixed set of options.\n *\n * @example\n * ```html\n * <iss-ctrl-radio formControlName=\"gender\" [options]=\"genders\"/>\n * ```\n *\n * ### Own inputs\n * | Property | Type | Default | Description |\n * | --- | --- | --- | --- |\n * | `options` | `Option[]` | **required** | The selectable choices. |\n *\n * ### Inherited from {@link ControlBase}\n * `formControlName` · `readonly` · `className` · `(onChange)`\n *\n * Does not project a label — the field label is rendered by the wrapping `iss-field-*`.\n */\n@Component({\n selector: \"iss-ctrl-radio\",\n imports: [\n ReactiveFormsModule,\n MatButtonToggleGroup,\n MatButtonToggle,\n ],\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: RadioControl, multi: true }\n ],\n template: `\n <mat-button-toggle-group [hideSingleSelectionIndicator]=\"true\" [disabled]=\"disabled() || readonly()\">\n @for (option of options(); track option.value) {\n <mat-button-toggle\n [value]=\"option.value\"\n [checked]=\"ctrl.value === option.value\"\n (change)=\"onRadioChange(option.value)\"\n >{{ option.label }}\n </mat-button-toggle>\n }\n </mat-button-toggle-group>\n `,\n})\nexport class RadioControl extends ControlBase {\n /**\n * Selectable choices, each a `{ value, label }` pair. Required.\n */\n options: InputSignal<Option[]> = input.required();\n\n override writeValue(value: string | null) {\n if (!value) {\n this.ctrl.setValue(null, { emitEvent: false });\n return;\n }\n\n // single selection mode, only the first value of a comma separated list is honoured\n const values: string[] = value.split(\",\").map((val: string) => val.trim());\n this.ctrl.setValue(values[0], { emitEvent: false });\n }\n\n onRadioChange(value: string) {\n if (this.readonly()) {\n return;\n }\n this.markAsTouched();\n this.ctrl.setValue(value, { emitEvent: false });\n const selectedOption: Option | undefined = this.options().find((option: Option) => option.value === value);\n // the form keeps the raw value, while (onChange) consumers get the resolved option\n this.propagateValue(value);\n this.emitOnChangeEvent(selectedOption ? [selectedOption] : null);\n }\n}\n","// The radio 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 \"./radio.control\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAMA;;;;;;;;;;;;;;;;;AAiBG;AAwBG,MAAO,YAAa,SAAQ,WAAW,CAAA;AAC3C;;AAEG;AACH,IAAA,OAAO,GAA0B,KAAK,CAAC,QAAQ,6EAAE;AAExC,IAAA,UAAU,CAAC,KAAoB,EAAA;QACtC,IAAI,CAAC,KAAK,EAAE;AACV,YAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;YAC9C;QACF;;QAGA,MAAM,MAAM,GAAa,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAW,KAAK,GAAG,CAAC,IAAI,E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|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component } from '@angular/core';
|
|
3
|
+
import { ViewerBase } from 'iss-ctrl/base';
|
|
4
|
+
|
|
5
|
+
class RadioViewer extends ViewerBase {
|
|
6
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RadioViewer, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
7
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: RadioViewer, isStandalone: true, selector: "iss-viewer-radio", usesInheritance: true, ngImport: i0, template: `
|
|
8
|
+
<p>
|
|
9
|
+
@for (item of field().ctrlJsonValue(); track item?.value) {
|
|
10
|
+
<span>{{ item.label }}</span>
|
|
11
|
+
}
|
|
12
|
+
</p>
|
|
13
|
+
`, isInline: true });
|
|
14
|
+
}
|
|
15
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RadioViewer, decorators: [{
|
|
16
|
+
type: Component,
|
|
17
|
+
args: [{
|
|
18
|
+
selector: "iss-viewer-radio",
|
|
19
|
+
template: `
|
|
20
|
+
<p>
|
|
21
|
+
@for (item of field().ctrlJsonValue(); track item?.value) {
|
|
22
|
+
<span>{{ item.label }}</span>
|
|
23
|
+
}
|
|
24
|
+
</p>
|
|
25
|
+
`,
|
|
26
|
+
}]
|
|
27
|
+
}] });
|
|
28
|
+
|
|
29
|
+
export { RadioViewer };
|
|
30
|
+
//# sourceMappingURL=iss-ctrl-radio.viewer-EiDliZro.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iss-ctrl-radio.viewer-EiDliZro.mjs","sources":["../../../projects/iss/src/components/controls/radio/radio.viewer.ts"],"sourcesContent":["import { Component } from \"@angular/core\";\nimport { ViewerBase } from \"iss-ctrl/base\";\n\n@Component({\n selector: \"iss-viewer-radio\",\n template: `\n <p>\n @for (item of field().ctrlJsonValue(); track item?.value) {\n <span>{{ item.label }}</span>\n }\n </p>\n `,\n})\nexport class RadioViewer extends ViewerBase {}\n"],"names":[],"mappings":";;;;AAaM,MAAO,WAAY,SAAQ,UAAU,CAAA;uGAA9B,WAAW,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAX,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,WAAW,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EARZ;;;;;;AAMT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEU,WAAW,EAAA,UAAA,EAAA,CAAA;kBAVvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,QAAQ,EAAE;;;;;;AAMT,EAAA,CAAA;AACF,iBAAA;;;;;"}
|
package/fesm2022/{iss-ctrl-replace-api-keys-C0XYQW4i.mjs → iss-ctrl-replace-api-keys-DLnagkOr.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable } from '@angular/core';
|
|
3
|
-
import { P as PLACEHOLDER_REGEX, g as getPropertyByPath, r as replacePlaceholders } from './iss-ctrl-iss-ctrl-
|
|
3
|
+
import { P as PLACEHOLDER_REGEX, g as getPropertyByPath, r as replacePlaceholders } from './iss-ctrl-iss-ctrl-DvnkwSMG.mjs';
|
|
4
4
|
|
|
5
5
|
class ReplaceApiKeys {
|
|
6
6
|
// todo replace {key} with tracked field value [will be deprecated]
|
|
@@ -54,4 +54,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
54
54
|
}] });
|
|
55
55
|
|
|
56
56
|
export { ReplaceApiKeys };
|
|
57
|
-
//# sourceMappingURL=iss-ctrl-replace-api-keys-
|
|
57
|
+
//# sourceMappingURL=iss-ctrl-replace-api-keys-DLnagkOr.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iss-ctrl-replace-api-keys-
|
|
1
|
+
{"version":3,"file":"iss-ctrl-replace-api-keys-DLnagkOr.mjs","sources":["../../../projects/iss/src/events/load/replace-api-keys.ts"],"sourcesContent":["import { Injectable } from \"@angular/core\";\r\nimport { PLACEHOLDER_REGEX } from \"../../shared/constants/placeholder-regex.const\";\r\nimport { EventArgument, EventConfigFn } from \"../../shared/interfaces/event-strategy\";\r\nimport { getPropertyByPath } from \"../../shared/utilities/get-property-by-path.util\";\r\nimport { replacePlaceholders } from \"../../shared/utilities/replace-placeholder.util\";\r\n\r\n@Injectable({providedIn: \"root\"})\r\nexport class ReplaceApiKeys implements EventConfigFn {\r\n // todo replace {key} with tracked field value [will be deprecated]\r\n execute(args: EventArgument): string {\r\n // console.log(\"Replace API keys - Default Implementation\");\r\n const api = args.field.api();\r\n const matches = api.match(PLACEHOLDER_REGEX);\r\n if (matches) {\r\n const replacements: any = {};\r\n matches.forEach((match) => {\r\n const replacement = match.replace(\"{\", \"\").replace(\"}\", \"\");\r\n\r\n if (replacement.includes(\".\")) {\r\n const path = this.getPath(replacement);\r\n\r\n if (replacement.includes(args.change.trackedField.name)) {\r\n replacements[replacement] = getPropertyByPath(args.change.trackedField, path);\r\n }\r\n\r\n if (replacement.includes(\"loggedInUser\")) {\r\n const loggedInUserProfileStr = localStorage.getItem(\"profile\");\r\n if (loggedInUserProfileStr) {\r\n const loggedInUserProfile = JSON.parse(loggedInUserProfileStr);\r\n replacements[replacement] = getPropertyByPath(loggedInUserProfile, path);\r\n } else {\r\n throw new Error(\"User profile not found in localStorage. Make sure that localStorage has profile key with user profile.\");\r\n }\r\n }\r\n\r\n if (replacement.includes(\"requestDto\")) {\r\n // todo replace {fromRequestDto}\r\n // todo from where to get requestDto?\r\n }\r\n } else {\r\n replacements[replacement] = args.form.get(replacement)?.getRawValue();\r\n }\r\n });\r\n return replacePlaceholders(api, replacements);\r\n }\r\n\r\n return api;\r\n }\r\n\r\n getPath(replacement: string): string {\r\n const arr = replacement.split(\".\");\r\n arr.shift();\r\n return arr.join(\".\");\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;MAOa,cAAc,CAAA;;AAEzB,IAAA,OAAO,CAAC,IAAmB,EAAA;;QAEzB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;QAC5B,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC;QAC5C,IAAI,OAAO,EAAE;YACX,MAAM,YAAY,GAAQ,EAAE;AAC5B,YAAA,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;AACxB,gBAAA,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;AAE3D,gBAAA,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;oBAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;AAEtC,oBAAA,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE;AACvD,wBAAA,YAAY,CAAC,WAAW,CAAC,GAAG,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC;oBAC/E;AAEA,oBAAA,IAAI,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE;wBACxC,MAAM,sBAAsB,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC;wBAC9D,IAAI,sBAAsB,EAAE;4BAC1B,MAAM,mBAAmB,GAAG,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC;4BAC9D,YAAY,CAAC,WAAW,CAAC,GAAG,iBAAiB,CAAC,mBAAmB,EAAE,IAAI,CAAC;wBAC1E;6BAAO;AACL,4BAAA,MAAM,IAAI,KAAK,CAAC,wGAAwG,CAAC;wBAC3H;oBACF;AAEA,oBAAA,IAAI,WAAW,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE;;;oBAGxC;gBACF;qBAAO;AACL,oBAAA,YAAY,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,WAAW,EAAE;gBACvE;AACF,YAAA,CAAC,CAAC;AACF,YAAA,OAAO,mBAAmB,CAAC,GAAG,EAAE,YAAY,CAAC;QAC/C;AAEA,QAAA,OAAO,GAAG;IACZ;AAEA,IAAA,OAAO,CAAC,WAAmB,EAAA;QACzB,MAAM,GAAG,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC;QAClC,GAAG,CAAC,KAAK,EAAE;AACX,QAAA,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC;IACtB;uGA9CW,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAd,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cADF,MAAM,EAAA,CAAA;;2FAClB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;;;;"}
|
|
@@ -0,0 +1,87 @@
|
|
|
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 { SelectControl } from 'iss-ctrl/select';
|
|
7
|
+
import { SelectViewer } from './iss-ctrl-select.viewer-Dv9M-lG-.mjs';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* `<iss-field-select>` — single or multiple selection from a dropdown.
|
|
11
|
+
*
|
|
12
|
+
* Rendered by the outlet for fields of type `dropdown_list`. In `edit` mode it renders
|
|
13
|
+
* {@link SelectControl} plus the validation message; in `view` mode the matching viewer.
|
|
14
|
+
*
|
|
15
|
+
* ### Supported `config` keys
|
|
16
|
+
* | Key | Type | Description |
|
|
17
|
+
* | --- | --- | --- |
|
|
18
|
+
* | `multiple` | `boolean` | Allows selecting more than one option. |
|
|
19
|
+
* | `readonly` | `boolean` | Shows the value but blocks interaction. |
|
|
20
|
+
*
|
|
21
|
+
* ### Other field members used
|
|
22
|
+
* `label()` · `options()` · `ctrlJsonValue()`
|
|
23
|
+
*
|
|
24
|
+
* Every field also honours `visible`, `mode`, `validation`, `asyncValidation` and
|
|
25
|
+
* `events` — see {@link IssField} for the full model and {@link FieldConfig} for all keys.
|
|
26
|
+
*
|
|
27
|
+
* The raw form value holds the selected option values; the resolved options are written
|
|
28
|
+
* back to `field.ctrlJsonValue`.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```json
|
|
32
|
+
* { "name": "city", "type": "dropdown_list", "label": "City", "options": [{ "value": "1", "label": "Riyadh" }] }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
class SelectField extends FieldBase {
|
|
36
|
+
onChange($event) {
|
|
37
|
+
this.field.ctrlJsonValue.set($event);
|
|
38
|
+
}
|
|
39
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: SelectField, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
40
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: SelectField, isStandalone: true, selector: "iss-field-select", usesInheritance: true, ngImport: i0, template: `
|
|
41
|
+
@if (field.visible()) {
|
|
42
|
+
@if (field.mode() === "edit") {
|
|
43
|
+
<iss-ctrl-select [formControlName]="field.name" [options]="field.options()" [multiple]="field.config.multiple()" [readonly]="field.config.readonly() ?? false" (onChange)="onChange($event)">
|
|
44
|
+
<label>{{ field.label() }}</label>
|
|
45
|
+
</iss-ctrl-select>
|
|
46
|
+
<iss-validation-message-viewer [errors]="ctrl.errors" [showMessage]="!ctrl.untouched"/>
|
|
47
|
+
} @else {
|
|
48
|
+
<iss-field-viewer>
|
|
49
|
+
<label>{{ field.label() }}</label>
|
|
50
|
+
<iss-viewer-select [field]="field"/>
|
|
51
|
+
</iss-field-viewer>
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`, 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: SelectControl, selector: "iss-ctrl-select", inputs: ["options", "height", "loading"], outputs: ["onQueryChange"] }, { kind: "component", type: ValidationMessage, selector: "iss-validation-message-viewer", inputs: ["errors", "showMessage"] }, { kind: "component", type: SelectViewer, selector: "iss-viewer-select" }, { kind: "component", type: FieldViewer, selector: "iss-field-viewer" }], viewProviders: [VIEW_PROVIDER] });
|
|
55
|
+
}
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: SelectField, decorators: [{
|
|
57
|
+
type: Component,
|
|
58
|
+
args: [{
|
|
59
|
+
selector: "iss-field-select",
|
|
60
|
+
viewProviders: [VIEW_PROVIDER],
|
|
61
|
+
imports: [
|
|
62
|
+
ReactiveFormsModule,
|
|
63
|
+
SelectControl,
|
|
64
|
+
ValidationMessage,
|
|
65
|
+
SelectViewer,
|
|
66
|
+
FieldViewer
|
|
67
|
+
],
|
|
68
|
+
template: `
|
|
69
|
+
@if (field.visible()) {
|
|
70
|
+
@if (field.mode() === "edit") {
|
|
71
|
+
<iss-ctrl-select [formControlName]="field.name" [options]="field.options()" [multiple]="field.config.multiple()" [readonly]="field.config.readonly() ?? false" (onChange)="onChange($event)">
|
|
72
|
+
<label>{{ field.label() }}</label>
|
|
73
|
+
</iss-ctrl-select>
|
|
74
|
+
<iss-validation-message-viewer [errors]="ctrl.errors" [showMessage]="!ctrl.untouched"/>
|
|
75
|
+
} @else {
|
|
76
|
+
<iss-field-viewer>
|
|
77
|
+
<label>{{ field.label() }}</label>
|
|
78
|
+
<iss-viewer-select [field]="field"/>
|
|
79
|
+
</iss-field-viewer>
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
`
|
|
83
|
+
}]
|
|
84
|
+
}] });
|
|
85
|
+
|
|
86
|
+
export { SelectField };
|
|
87
|
+
//# sourceMappingURL=iss-ctrl-select.field-DoU4G_8t.mjs.map
|