iss-ctrl 0.0.16 → 0.0.17

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.
Files changed (25) hide show
  1. package/fesm2022/{iss-ctrl-iss-ctrl-CUlx5aua.mjs → iss-ctrl-iss-ctrl-BHW3shB0.mjs} +42 -20
  2. package/fesm2022/iss-ctrl-iss-ctrl-BHW3shB0.mjs.map +1 -0
  3. package/fesm2022/{iss-ctrl-load-event-B2HY44Lg.mjs → iss-ctrl-load-event-BBKfb4GM.mjs} +3 -3
  4. package/fesm2022/{iss-ctrl-load-event-B2HY44Lg.mjs.map → iss-ctrl-load-event-BBKfb4GM.mjs.map} +1 -1
  5. package/fesm2022/{iss-ctrl-load-options-event-Bvfi4PZq.mjs → iss-ctrl-load-options-event-jsZAQloX.mjs} +3 -3
  6. package/fesm2022/{iss-ctrl-load-options-event-Bvfi4PZq.mjs.map → iss-ctrl-load-options-event-jsZAQloX.mjs.map} +1 -1
  7. package/fesm2022/{iss-ctrl-load-value-event-Bq6nRj3K.mjs → iss-ctrl-load-value-event-ClkNTtds.mjs} +3 -3
  8. package/fesm2022/{iss-ctrl-load-value-event-Bq6nRj3K.mjs.map → iss-ctrl-load-value-event-ClkNTtds.mjs.map} +1 -1
  9. package/fesm2022/{iss-ctrl-note.field-DpXXdNd0.mjs → iss-ctrl-note.field-Co2Og2eO.mjs} +2 -2
  10. package/fesm2022/{iss-ctrl-note.field-DpXXdNd0.mjs.map → iss-ctrl-note.field-Co2Og2eO.mjs.map} +1 -1
  11. package/fesm2022/{iss-ctrl-replace-api-keys-Dbdwgl4g.mjs → iss-ctrl-replace-api-keys-Bx7wo5zl.mjs} +2 -2
  12. package/fesm2022/{iss-ctrl-replace-api-keys-Dbdwgl4g.mjs.map → iss-ctrl-replace-api-keys-Bx7wo5zl.mjs.map} +1 -1
  13. package/fesm2022/{iss-ctrl-set-value-event-CXVuywEr.mjs → iss-ctrl-set-value-event-D38jsLlO.mjs} +2 -2
  14. package/fesm2022/{iss-ctrl-set-value-event-CXVuywEr.mjs.map → iss-ctrl-set-value-event-D38jsLlO.mjs.map} +1 -1
  15. package/fesm2022/{iss-ctrl-table.field-C5SDeghW.mjs → iss-ctrl-table.field-BcuL_fSr.mjs} +2 -2
  16. package/fesm2022/{iss-ctrl-table.field-C5SDeghW.mjs.map → iss-ctrl-table.field-BcuL_fSr.mjs.map} +1 -1
  17. package/fesm2022/{iss-ctrl-trigger-based-on-json-value-Ck642ldN.mjs → iss-ctrl-trigger-based-on-json-value-B6M5dYnm.mjs} +2 -2
  18. package/fesm2022/{iss-ctrl-trigger-based-on-json-value-Ck642ldN.mjs.map → iss-ctrl-trigger-based-on-json-value-B6M5dYnm.mjs.map} +1 -1
  19. package/fesm2022/{iss-ctrl-user-picker.field-69Tqgu2G.mjs → iss-ctrl-user-picker.field-BCd6g9jz.mjs} +2 -2
  20. package/fesm2022/{iss-ctrl-user-picker.field-69Tqgu2G.mjs.map → iss-ctrl-user-picker.field-BCd6g9jz.mjs.map} +1 -1
  21. package/fesm2022/iss-ctrl.mjs +1 -1
  22. package/package.json +1 -1
  23. package/types/iss-ctrl.d.ts +11 -0
  24. package/upgrade.scss +108 -75
  25. package/fesm2022/iss-ctrl-iss-ctrl-CUlx5aua.mjs.map +0 -1
@@ -123,6 +123,15 @@ declare class ControlBase implements ControlValueAccessor, Validator {
123
123
  setDisabledState(isDisabled: boolean): void;
124
124
  writeValue(value: string | FormData | Date | null): void;
125
125
  markAsTouched(): void;
126
+ /**
127
+ * Whether the control currently holds no value.
128
+ *
129
+ * Reflected on the host as `iss-ctrl-empty`, which is what `upgrade.scss` uses to keep the
130
+ * resting outline of an empty field: Material's own `mat-form-field-hide-placeholder` drops
131
+ * off the moment the field is focused, so the border would change colour on focus alone.
132
+ * Override it in a control whose value does not live on {@link ControlBase.ctrl}.
133
+ */
134
+ protected isEmpty(): boolean;
126
135
  validate(control: AbstractControl): ValidationErrors | null;
127
136
  protected onTouch: () => void;
128
137
  protected onPropagateValue: (_: any) => void;
@@ -201,6 +210,7 @@ declare class ChipsControl extends ControlBase {
201
210
  */
202
211
  readonly keywords: WritableSignal<string[]>;
203
212
  writeValue(value: string | null): void;
213
+ protected isEmpty(): boolean;
204
214
  remove(keyword: string): void;
205
215
  add(event: MatChipInputEvent): void;
206
216
  static ɵfac: i0.ɵɵFactoryDeclaration<ChipsControl, never>;
@@ -352,6 +362,7 @@ declare class DateRangePickerControl extends ControlBase implements OnInit, OnDe
352
362
  */
353
363
  isHijri(): boolean;
354
364
  ngOnInit(): void;
365
+ protected isEmpty(): boolean;
355
366
  setDisabledState(isDisabled: boolean): void;
356
367
  clear(event: MouseEvent): void;
357
368
  writeValue(value: string | FormData | null): void;
package/upgrade.scss CHANGED
@@ -1,75 +1,108 @@
1
- html {
2
- // --mat-form-field-container-height: 50px !important;
3
- }
4
-
5
- //mat-mdc-form-field mat-mdc-form-field-type-mat-input mat-form-field-appearance-fill mat-form-field-hide-placeholder mat-primary ng-untouched ng-pristine ng-valid mat-form-field-animations-enabled
6
- //mat-mdc-form-field mat-mdc-form-field-type-mat-input mat-form-field-appearance-fill mat-form-field-hide-placeholder mat-primary ng-untouched ng-pristine ng-valid mat-form-field-animations-enabled
7
- //mat-mdc-form-field mat-mdc-form-field-type-mat-input mat-mdc-form-field-has-icon-suffix mat-form-field-appearance-fill mat-primary ng-untouched ng-pristine ng-valid mat-form-field-animations-enabled
8
- // mat-mdc-form-field mat-mdc-form-field-type-mat-input mat-form-field-appearance-fill mat-primary mat-form-field-animations-enabled ng-dirty ng-invalid mat-form-field-invalid ng-touched
9
- mat-form-field {
10
- --input-height: 55px;
11
- --input-radius: 8px;
12
-
13
- &.mat-mdc-form-field {
14
- .mdc-text-field--invalid.mat-mdc-text-field-wrapper {
15
- border: 1px solid var(--red) !important;
16
- }
17
-
18
- &.mat-form-field-animations-enabled .mat-mdc-form-field-infix {
19
- // padding-top: 10px !important;
20
- }
21
- }
22
-
23
- span[mattextsuffix],
24
- span[matsuffix] {
25
- // margin-bottom: 6px;
26
- // display: block;
27
- }
28
- }
29
-
30
- mat-error {
31
- --mat-form-field-error-text-color: var(--red);
32
- font-size: 12px !important;
33
- }
34
-
35
- .custom-textarea {
36
- --input-height: 100px;
37
- }
38
-
39
- .mat-mdc-standard-chip {
40
- --mat-chip-container-shape-radius: 8px;
41
- --mat-chip-elevated-container-color: var(--white);
42
- }
43
-
44
- .search-container mat-form-field {
45
- --input-height: 30px;
46
-
47
- }
48
-
49
- // The basic-ui form-field reset hides .mdc-floating-label for every mat-form-field, so the label
50
- // space is opt-in: only a control that projects a <label> carrying actual text turns it back on,
51
- // together with the padding that space needs. An omitted label leaves <mat-label> without a
52
- // <label> child, and one that interpolates to "" leaves that child :empty — neither matches, so
53
- // both collapse with no runtime check, and a label that arrives later simply shows up.
54
- mat-form-field.mat-mdc-form-field:has(mat-label > label:not(:empty)) {
55
- .mdc-floating-label {
56
- display: block !important;
57
- }
58
-
59
- .mat-mdc-form-field-infix {
60
- padding-top: 10px !important;
61
- }
62
- }
63
-
64
-
65
- mat-form-field.mat-mdc-form-field
66
- .mat-mdc-input-element::placeholder {
67
-
68
- --placeholder-fc: transparent !important;
69
- }
70
-
71
-
72
- mat-form-field.mat-mdc-form-field.mat-focused
73
- .mat-mdc-input-element::placeholder {
74
- --placeholder-fc: var(--dark-gray) !important;
75
- }
1
+ html {
2
+ // --mat-form-field-container-height: 50px !important;
3
+ }
4
+
5
+ //mat-mdc-form-field mat-mdc-form-field-type-mat-input mat-form-field-appearance-fill mat-form-field-hide-placeholder mat-primary ng-untouched ng-pristine ng-valid mat-form-field-animations-enabled
6
+ //mat-mdc-form-field mat-mdc-form-field-type-mat-input mat-form-field-appearance-fill mat-form-field-hide-placeholder mat-primary ng-untouched ng-pristine ng-valid mat-form-field-animations-enabled
7
+ //mat-mdc-form-field mat-mdc-form-field-type-mat-input mat-mdc-form-field-has-icon-suffix mat-form-field-appearance-fill mat-primary ng-untouched ng-pristine ng-valid mat-form-field-animations-enabled
8
+ // mat-mdc-form-field mat-mdc-form-field-type-mat-input mat-form-field-appearance-fill mat-primary mat-form-field-animations-enabled ng-dirty ng-invalid mat-form-field-invalid ng-touched
9
+ mat-form-field {
10
+ --input-height: 55px;
11
+ --input-radius: 8px;
12
+
13
+ &.mat-mdc-form-field {
14
+ .mdc-text-field--invalid.mat-mdc-text-field-wrapper {
15
+ border: 1px solid var(--red) !important;
16
+ }
17
+
18
+ &.mat-form-field-animations-enabled .mat-mdc-form-field-infix {
19
+ // padding-top: 10px !important;
20
+ }
21
+ }
22
+
23
+ span[mattextsuffix],
24
+ span[matsuffix] {
25
+ // margin-bottom: 6px;
26
+ // display: block;
27
+ }
28
+ }
29
+
30
+ mat-error {
31
+ --mat-form-field-error-text-color: var(--red);
32
+ font-size: 12px !important;
33
+ }
34
+
35
+ .custom-textarea {
36
+ --input-height: 100px;
37
+ }
38
+
39
+ .mat-mdc-standard-chip {
40
+ --mat-chip-container-shape-radius: 8px;
41
+ --mat-chip-elevated-container-color: var(--white);
42
+ }
43
+
44
+ .search-container mat-form-field {
45
+ --input-height: 30px;
46
+
47
+ }
48
+
49
+ // The basic-ui form-field reset hides .mdc-floating-label for every mat-form-field, so the label
50
+ // space is opt-in: only a control that projects a <label> carrying actual text turns it back on,
51
+ // together with the padding that space needs. An omitted label leaves <mat-label> without a
52
+ // <label> child, and one that interpolates to "" leaves that child :empty — neither matches, so
53
+ // both collapse with no runtime check, and a label that arrives later simply shows up.
54
+ mat-form-field.mat-mdc-form-field:has(mat-label > label:not(:empty)) {
55
+ .mdc-floating-label {
56
+ display: block !important;
57
+ }
58
+
59
+ .mat-mdc-form-field-infix {
60
+ padding-top: 10px !important;
61
+ }
62
+ }
63
+
64
+
65
+ mat-form-field.mat-mdc-form-field
66
+ .mat-mdc-input-element::placeholder {
67
+
68
+ --placeholder-fc: transparent !important;
69
+ }
70
+
71
+
72
+ mat-form-field.mat-mdc-form-field.mat-focused
73
+ .mat-mdc-input-element::placeholder {
74
+ --placeholder-fc: var(--dark-gray) !important;
75
+ }
76
+
77
+
78
+ // Outline states. Focus is not a state: while the user is in a field the outline keeps the
79
+ // colour it had before the caret arrived, so the only thing the outline reports is validity.
80
+ //
81
+ // --input-border-idle snapshots the field's resting border on the mat-form-field element, which
82
+ // is also where per-instance overrides such as .filter-input redefine it — so a field with a
83
+ // custom resting border keeps that one while focused instead of falling back to the default.
84
+ mat-form-field {
85
+ --input-border-idle: var(--input-border-active, 1px solid var(--black));
86
+ }
87
+
88
+ mat-form-field.mat-mdc-form-field .mdc-text-field--focused {
89
+ --input-border-active: var(--input-border-idle);
90
+ }
91
+
92
+ // An empty field rests on the plain border, and stays there while the caret is in it. The base
93
+ // stylesheet keys that off Material's mat-form-field-hide-placeholder, which Material drops as
94
+ // soon as the field is focused — so the emptiness comes from the control itself instead, through
95
+ // the iss-ctrl-empty host class that ControlBase.isEmpty() reflects.
96
+ .iss-ctrl-empty > mat-form-field.mat-mdc-form-field .mdc-text-field {
97
+ --input-border-active: var(--input-border);
98
+ }
99
+
100
+ // Red belongs to a field the user has actually left in a bad state. Angular puts ng-touched and
101
+ // ng-invalid on the control host (iss-ctrl-*) — the same condition <iss-validation-message-viewer>
102
+ // uses — and that is the only reliable signal here: the mat control is bound to the control's
103
+ // internal FormControl, which carries no validators, so Material's own --invalid state stays off
104
+ // for everything but the errors it raises itself (a datepicker parse/min/max failure, say).
105
+ // The child combinator keeps an invalid *form* ancestor from painting every field inside it red.
106
+ .ng-touched.ng-invalid > mat-form-field.mat-mdc-form-field .mdc-text-field {
107
+ --input-border-active: var(--input-border-invalid);
108
+ }