@mk-kit/ui 0.42.0 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/THIRD_PARTY_NOTICES.md +4 -2
- package/fesm2022/mk-kit-ui-block-editor.mjs +4 -2
- package/fesm2022/mk-kit-ui-block-editor.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-checkbox.mjs +4 -2
- package/fesm2022/mk-kit-ui-checkbox.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-core.mjs +131 -1
- package/fesm2022/mk-kit-ui-core.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-data.mjs +437 -7
- package/fesm2022/mk-kit-ui-data.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-datetime.mjs +88 -50
- package/fesm2022/mk-kit-ui-datetime.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-dynamic-form.mjs +149 -2
- package/fesm2022/mk-kit-ui-dynamic-form.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-feedback.mjs +1 -1
- package/fesm2022/mk-kit-ui-feedback.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-forms.mjs +325 -77
- package/fesm2022/mk-kit-ui-forms.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-icon-extended.mjs +425 -0
- package/fesm2022/mk-kit-ui-icon-extended.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-icon.mjs +296 -459
- package/fesm2022/mk-kit-ui-icon.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-query-builder.mjs +1 -1
- package/fesm2022/mk-kit-ui-query-builder.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-rich-text.mjs +4 -2
- package/fesm2022/mk-kit-ui-rich-text.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-table.mjs +10 -2
- package/fesm2022/mk-kit-ui-table.mjs.map +1 -1
- package/fesm2022/mk-kit-ui.mjs +1 -0
- package/fesm2022/mk-kit-ui.mjs.map +1 -1
- package/package.json +5 -1
- package/schematics/migrate-primeng/transform.js +4 -1
- package/schematics/ng-add/index.js +30 -2
- package/schematics/ng-add/schema.json +6 -0
- package/types/mk-kit-ui-block-editor.d.ts +2 -0
- package/types/mk-kit-ui-checkbox.d.ts +2 -0
- package/types/mk-kit-ui-core.d.ts +72 -2
- package/types/mk-kit-ui-data.d.ts +203 -2
- package/types/mk-kit-ui-datetime.d.ts +41 -19
- package/types/mk-kit-ui-dynamic-form.d.ts +44 -1
- package/types/mk-kit-ui-forms.d.ts +154 -16
- package/types/mk-kit-ui-icon-extended.d.ts +83 -0
- package/types/mk-kit-ui-icon.d.ts +100 -17
- package/types/mk-kit-ui-rich-text.d.ts +2 -0
- package/types/mk-kit-ui-table.d.ts +0 -17
- package/types/mk-kit-ui.d.ts +1 -0
|
@@ -111,9 +111,9 @@ declare class MkCalendar implements ControlValueAccessor, Validator {
|
|
|
111
111
|
/** Two-way selected date (single-date mode). */
|
|
112
112
|
readonly value: _angular_core.ModelSignal<Date | null>;
|
|
113
113
|
/** Earliest selectable date (inclusive, day granularity). */
|
|
114
|
-
readonly min: _angular_core.
|
|
114
|
+
readonly min: _angular_core.InputSignalWithTransform<Date | null, Date | null | undefined>;
|
|
115
115
|
/** Latest selectable date (inclusive, day granularity). */
|
|
116
|
-
readonly max: _angular_core.
|
|
116
|
+
readonly max: _angular_core.InputSignalWithTransform<Date | null, Date | null | undefined>;
|
|
117
117
|
/** First column of the week: 0 = Sunday … 6 = Saturday. */
|
|
118
118
|
readonly firstDayOfWeek: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
119
119
|
/** Disable the whole calendar. */
|
|
@@ -158,6 +158,8 @@ declare class MkCalendar implements ControlValueAccessor, Validator {
|
|
|
158
158
|
protected readonly hoveredDate: _angular_core.WritableSignal<Date | null>;
|
|
159
159
|
/** Disabled by the `disabled` input or by the bound form control. */
|
|
160
160
|
protected readonly isControlDisabled: _angular_core.Signal<boolean>;
|
|
161
|
+
/** Signal Forms: gates `invalid` until the bound field is touched or dirty. */
|
|
162
|
+
private readonly fieldTouched;
|
|
161
163
|
protected readonly isInvalid: _angular_core.Signal<boolean>;
|
|
162
164
|
/** First day of the visible month. */
|
|
163
165
|
protected readonly viewMonth: _angular_core.Signal<Date>;
|
|
@@ -235,6 +237,8 @@ declare class MkCalendar implements ControlValueAccessor, Validator {
|
|
|
235
237
|
declare class MkDatePicker implements ControlValueAccessor, Validator {
|
|
236
238
|
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
237
239
|
private readonly field;
|
|
240
|
+
/** Signal Forms: gates `invalid` until the bound field is touched or dirty. */
|
|
241
|
+
private readonly fieldTouched;
|
|
238
242
|
private readonly host;
|
|
239
243
|
private readonly injector;
|
|
240
244
|
private readonly inputRef;
|
|
@@ -246,9 +250,9 @@ declare class MkDatePicker implements ControlValueAccessor, Validator {
|
|
|
246
250
|
/** Accessible name when the picker is used without an `mk-form-field` label. */
|
|
247
251
|
readonly ariaLabel: _angular_core.InputSignal<string>;
|
|
248
252
|
protected readonly ariaLabelAttr: _angular_core.Signal<string | null>;
|
|
249
|
-
readonly min: _angular_core.
|
|
253
|
+
readonly min: _angular_core.InputSignalWithTransform<Date | null, Date | null | undefined>;
|
|
250
254
|
/** Latest selectable date (inclusive). */
|
|
251
|
-
readonly max: _angular_core.
|
|
255
|
+
readonly max: _angular_core.InputSignalWithTransform<Date | null, Date | null | undefined>;
|
|
252
256
|
/** Predicate marking individual days as disabled (threaded to the calendar). */
|
|
253
257
|
readonly disabledDate: _angular_core.InputSignal<((d: Date) => boolean) | null>;
|
|
254
258
|
/** Placeholder shown when empty. */
|
|
@@ -261,6 +265,8 @@ declare class MkDatePicker implements ControlValueAccessor, Validator {
|
|
|
261
265
|
readonly clearable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
262
266
|
/** Force invalid styling + `aria-invalid`. */
|
|
263
267
|
readonly invalid: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
268
|
+
/** Mark required (adds `aria-required`). Set by Signal Forms' `[formField]` from the schema. */
|
|
269
|
+
readonly required: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
264
270
|
/** First column of the calendar week (0 = Sunday). */
|
|
265
271
|
readonly firstDayOfWeek: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
266
272
|
/** Control size. Ignored when nested in an `mk-form-field`. */
|
|
@@ -314,7 +320,7 @@ declare class MkDatePicker implements ControlValueAccessor, Validator {
|
|
|
314
320
|
validate(control: AbstractControl): ValidationErrors | null;
|
|
315
321
|
registerOnValidatorChange(fn: () => void): void;
|
|
316
322
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkDatePicker, never>;
|
|
317
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkDatePicker, "mk-date-picker", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "disabledDate": { "alias": "disabledDate"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "displayFormat": { "alias": "displayFormat"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "firstDayOfWeek": { "alias": "firstDayOfWeek"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
323
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkDatePicker, "mk-date-picker", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "disabledDate": { "alias": "disabledDate"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "displayFormat": { "alias": "displayFormat"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "firstDayOfWeek": { "alias": "firstDayOfWeek"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
318
324
|
}
|
|
319
325
|
|
|
320
326
|
/** A selectable time option. */
|
|
@@ -354,6 +360,8 @@ interface MkTimeOption$1 {
|
|
|
354
360
|
declare class MkTimePicker implements ControlValueAccessor, Validator {
|
|
355
361
|
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
356
362
|
private readonly field;
|
|
363
|
+
/** Signal Forms: gates `invalid` until the bound field is touched or dirty. */
|
|
364
|
+
private readonly fieldTouched;
|
|
357
365
|
private readonly host;
|
|
358
366
|
private readonly injector;
|
|
359
367
|
private readonly inputRef;
|
|
@@ -371,9 +379,9 @@ declare class MkTimePicker implements ControlValueAccessor, Validator {
|
|
|
371
379
|
protected readonly ariaLabelAttr: _angular_core.Signal<string | null>;
|
|
372
380
|
readonly valueFormat: _angular_core.InputSignal<"string" | "date">;
|
|
373
381
|
/** Earliest selectable time `HH:mm` (inclusive). */
|
|
374
|
-
readonly min: _angular_core.
|
|
382
|
+
readonly min: _angular_core.InputSignalWithTransform<string | null, string | null | undefined>;
|
|
375
383
|
/** Latest selectable time `HH:mm` (inclusive). */
|
|
376
|
-
readonly max: _angular_core.
|
|
384
|
+
readonly max: _angular_core.InputSignalWithTransform<string | null, string | null | undefined>;
|
|
377
385
|
/** Interval between generated options, in minutes. */
|
|
378
386
|
readonly step: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
379
387
|
/** Display 12-hour time with AM/PM (the model stays 24h). */
|
|
@@ -386,6 +394,8 @@ declare class MkTimePicker implements ControlValueAccessor, Validator {
|
|
|
386
394
|
readonly clearable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
387
395
|
/** Force invalid styling + `aria-invalid`. */
|
|
388
396
|
readonly invalid: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
397
|
+
/** Mark required (adds `aria-required`). Set by Signal Forms' `[formField]` from the schema. */
|
|
398
|
+
readonly required: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
389
399
|
/** Control size. Ignored when nested in an `mk-form-field`. */
|
|
390
400
|
readonly size: _angular_core.InputSignal<MkSize>;
|
|
391
401
|
protected readonly open: _angular_core.WritableSignal<boolean>;
|
|
@@ -459,7 +469,7 @@ declare class MkTimePicker implements ControlValueAccessor, Validator {
|
|
|
459
469
|
validate(control: AbstractControl): ValidationErrors | null;
|
|
460
470
|
registerOnValidatorChange(fn: () => void): void;
|
|
461
471
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkTimePicker, never>;
|
|
462
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkTimePicker, "mk-time-picker", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "valueFormat": { "alias": "valueFormat"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "hour12": { "alias": "hour12"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
472
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkTimePicker, "mk-time-picker", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "valueFormat": { "alias": "valueFormat"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "hour12": { "alias": "hour12"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
463
473
|
}
|
|
464
474
|
|
|
465
475
|
/** A selectable time-of-day option in the panel's list. */
|
|
@@ -499,6 +509,8 @@ interface MkTimeOption {
|
|
|
499
509
|
declare class MkDateTimePicker implements ControlValueAccessor, Validator {
|
|
500
510
|
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
501
511
|
private readonly field;
|
|
512
|
+
/** Signal Forms: gates `invalid` until the bound field is touched or dirty. */
|
|
513
|
+
private readonly fieldTouched;
|
|
502
514
|
private readonly host;
|
|
503
515
|
private readonly injector;
|
|
504
516
|
private readonly inputRef;
|
|
@@ -508,9 +520,9 @@ declare class MkDateTimePicker implements ControlValueAccessor, Validator {
|
|
|
508
520
|
/** Two-way selected date-time (local; seconds and ms are zero). */
|
|
509
521
|
readonly value: _angular_core.ModelSignal<Date | null>;
|
|
510
522
|
/** Earliest selectable instant (inclusive, minute precision). */
|
|
511
|
-
readonly min: _angular_core.
|
|
523
|
+
readonly min: _angular_core.InputSignalWithTransform<Date | null, Date | null | undefined>;
|
|
512
524
|
/** Latest selectable instant (inclusive, minute precision). */
|
|
513
|
-
readonly max: _angular_core.
|
|
525
|
+
readonly max: _angular_core.InputSignalWithTransform<Date | null, Date | null | undefined>;
|
|
514
526
|
/** Predicate marking individual days as disabled (threaded to the calendar). */
|
|
515
527
|
readonly disabledDate: _angular_core.InputSignal<((d: Date) => boolean) | null>;
|
|
516
528
|
/** Placeholder shown when empty. */
|
|
@@ -530,6 +542,8 @@ declare class MkDateTimePicker implements ControlValueAccessor, Validator {
|
|
|
530
542
|
readonly clearable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
531
543
|
/** Force invalid styling + `aria-invalid`. */
|
|
532
544
|
readonly invalid: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
545
|
+
/** Mark required (adds `aria-required`). Set by Signal Forms' `[formField]` from the schema. */
|
|
546
|
+
readonly required: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
533
547
|
/** First column of the calendar week (0 = Sunday). */
|
|
534
548
|
readonly firstDayOfWeek: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
535
549
|
/** Control size. Ignored when nested in an `mk-form-field`. */
|
|
@@ -614,7 +628,7 @@ declare class MkDateTimePicker implements ControlValueAccessor, Validator {
|
|
|
614
628
|
validate(control: AbstractControl): ValidationErrors | null;
|
|
615
629
|
registerOnValidatorChange(fn: () => void): void;
|
|
616
630
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkDateTimePicker, never>;
|
|
617
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkDateTimePicker, "mk-datetime-picker", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "disabledDate": { "alias": "disabledDate"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "displayFormat": { "alias": "displayFormat"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "hour12": { "alias": "hour12"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "firstDayOfWeek": { "alias": "firstDayOfWeek"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
631
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkDateTimePicker, "mk-datetime-picker", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "disabledDate": { "alias": "disabledDate"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "displayFormat": { "alias": "displayFormat"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "hour12": { "alias": "hour12"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "firstDayOfWeek": { "alias": "firstDayOfWeek"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
618
632
|
}
|
|
619
633
|
|
|
620
634
|
/** A selected date range. Either endpoint may be `null` while incomplete. */
|
|
@@ -636,6 +650,8 @@ interface MkDateRange {
|
|
|
636
650
|
declare class MkDateRangePicker implements ControlValueAccessor, Validator {
|
|
637
651
|
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
638
652
|
private readonly field;
|
|
653
|
+
/** Signal Forms: gates `invalid` until the bound field is touched or dirty. */
|
|
654
|
+
private readonly fieldTouched;
|
|
639
655
|
private readonly host;
|
|
640
656
|
private readonly injector;
|
|
641
657
|
private readonly triggerRef;
|
|
@@ -644,9 +660,9 @@ declare class MkDateRangePicker implements ControlValueAccessor, Validator {
|
|
|
644
660
|
/** Two-way selected range. */
|
|
645
661
|
readonly value: _angular_core.ModelSignal<MkDateRange>;
|
|
646
662
|
/** Earliest selectable date (inclusive). */
|
|
647
|
-
readonly min: _angular_core.
|
|
663
|
+
readonly min: _angular_core.InputSignalWithTransform<Date | null, Date | null | undefined>;
|
|
648
664
|
/** Latest selectable date (inclusive). */
|
|
649
|
-
readonly max: _angular_core.
|
|
665
|
+
readonly max: _angular_core.InputSignalWithTransform<Date | null, Date | null | undefined>;
|
|
650
666
|
/** Predicate marking individual days as disabled. */
|
|
651
667
|
readonly disabledDate: _angular_core.InputSignal<((d: Date) => boolean) | null>;
|
|
652
668
|
/** Placeholder shown when no range is selected. */
|
|
@@ -744,6 +760,8 @@ interface Cell {
|
|
|
744
760
|
declare class MkMonthPicker implements ControlValueAccessor, Validator {
|
|
745
761
|
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
746
762
|
private readonly field;
|
|
763
|
+
/** Signal Forms: gates `invalid` until the bound field is touched or dirty. */
|
|
764
|
+
private readonly fieldTouched;
|
|
747
765
|
private readonly host;
|
|
748
766
|
private readonly injector;
|
|
749
767
|
private readonly triggerRef;
|
|
@@ -754,9 +772,9 @@ declare class MkMonthPicker implements ControlValueAccessor, Validator {
|
|
|
754
772
|
/** Pick a month or a whole year. */
|
|
755
773
|
readonly mode: _angular_core.InputSignal<MkMonthPickerMode>;
|
|
756
774
|
/** Earliest selectable date. */
|
|
757
|
-
readonly min: _angular_core.
|
|
775
|
+
readonly min: _angular_core.InputSignalWithTransform<Date | null, Date | null | undefined>;
|
|
758
776
|
/** Latest selectable date. */
|
|
759
|
-
readonly max: _angular_core.
|
|
777
|
+
readonly max: _angular_core.InputSignalWithTransform<Date | null, Date | null | undefined>;
|
|
760
778
|
/** Placeholder shown when empty. */
|
|
761
779
|
readonly placeholder: _angular_core.InputSignal<string>;
|
|
762
780
|
/** Display pattern (defaults to `MMM yyyy` / `yyyy`). */
|
|
@@ -840,6 +858,8 @@ interface MkWeek {
|
|
|
840
858
|
declare class MkWeekPicker implements ControlValueAccessor, Validator {
|
|
841
859
|
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
842
860
|
private readonly field;
|
|
861
|
+
/** Signal Forms: gates `invalid` until the bound field is touched or dirty. */
|
|
862
|
+
private readonly fieldTouched;
|
|
843
863
|
private readonly host;
|
|
844
864
|
private readonly injector;
|
|
845
865
|
private readonly triggerRef;
|
|
@@ -847,9 +867,9 @@ declare class MkWeekPicker implements ControlValueAccessor, Validator {
|
|
|
847
867
|
/** Two-way selected week. */
|
|
848
868
|
readonly value: _angular_core.ModelSignal<MkWeek | null>;
|
|
849
869
|
/** Earliest selectable date (inclusive). */
|
|
850
|
-
readonly min: _angular_core.
|
|
870
|
+
readonly min: _angular_core.InputSignalWithTransform<Date | null, Date | null | undefined>;
|
|
851
871
|
/** Latest selectable date (inclusive). */
|
|
852
|
-
readonly max: _angular_core.
|
|
872
|
+
readonly max: _angular_core.InputSignalWithTransform<Date | null, Date | null | undefined>;
|
|
853
873
|
/** First column of the calendar week (0 = Sunday). Also anchors the week. */
|
|
854
874
|
readonly firstDayOfWeek: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
855
875
|
/** Placeholder shown when empty. */
|
|
@@ -1251,12 +1271,14 @@ interface MkDatePart {
|
|
|
1251
1271
|
*/
|
|
1252
1272
|
declare class MkMiniDate implements ControlValueAccessor, Validator {
|
|
1253
1273
|
private readonly field;
|
|
1274
|
+
/** Signal Forms: gates `invalid` until the bound field is touched or dirty. */
|
|
1275
|
+
private readonly fieldTouched;
|
|
1254
1276
|
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
1255
1277
|
private readonly segEls;
|
|
1256
1278
|
/** Minimum selectable date (inclusive). */
|
|
1257
|
-
readonly min: _angular_core.
|
|
1279
|
+
readonly min: _angular_core.InputSignalWithTransform<Date | null, Date | null | undefined>;
|
|
1258
1280
|
/** Maximum selectable date (inclusive). */
|
|
1259
|
-
readonly max: _angular_core.
|
|
1281
|
+
readonly max: _angular_core.InputSignalWithTransform<Date | null, Date | null | undefined>;
|
|
1260
1282
|
/** Two-way value — a real `Date`, or `null` while incomplete. */
|
|
1261
1283
|
readonly value: _angular_core.ModelSignal<Date | null>;
|
|
1262
1284
|
/** Disable the control. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ValidatorFn, AbstractControl, FormGroup, FormControl, FormArray } from '@angular/forms';
|
|
2
|
+
import { Schema } from '@angular/forms/signals';
|
|
2
3
|
import * as _mk_kit_ui_core from '@mk-kit/ui/core';
|
|
3
4
|
import * as _angular_core from '@angular/core';
|
|
4
5
|
import { TemplateRef } from '@angular/core';
|
|
@@ -154,6 +155,48 @@ declare function mkDynamicFlatten(fields: readonly MkDynamicField[], prefix?: st
|
|
|
154
155
|
/** Column span a field takes in a grid of `columns`. */
|
|
155
156
|
declare function mkDynamicSpan(field: MkDynamicField, columns: number): number;
|
|
156
157
|
|
|
158
|
+
/**
|
|
159
|
+
* Converts an `mk-dynamic-form` schema into a Signal Forms `Schema`, so the
|
|
160
|
+
* same JSON definition can drive `form()` from `@angular/forms/signals`:
|
|
161
|
+
*
|
|
162
|
+
* ```ts
|
|
163
|
+
* const definition: MkDynamicSchema = { fields: [ … ] };
|
|
164
|
+
* const model = signal(mkDynamicDefaults(definition.fields));
|
|
165
|
+
* const f = form(model, mkDynamicFormToSignalSchema(definition));
|
|
166
|
+
* ```
|
|
167
|
+
*
|
|
168
|
+
* What maps:
|
|
169
|
+
* - `required` → `required()` (for `checkbox` / `switch` this means "must be
|
|
170
|
+
* on", as Signal Forms treats `false` as empty — the `requiredTrue`
|
|
171
|
+
* behaviour of the renderer);
|
|
172
|
+
* - `validators.min` / `max` / `minLength` / `maxLength` / `pattern` / `email`
|
|
173
|
+
* (and `type: 'email'`) → the matching built-in rules, so the field's
|
|
174
|
+
* `min()` / `maxLength()` / `pattern()` state is set as well;
|
|
175
|
+
* - `validators.custom` → `validate()` running each `ValidatorFn` against a
|
|
176
|
+
* throw-away `FormControl` holding the field's value; the reactive error
|
|
177
|
+
* keys become error `kind`s with their payload attached, so
|
|
178
|
+
* `mk-form-field` renders them through the same i18n table;
|
|
179
|
+
* - `disabled: true` and `disabledWhen` → `disabled()`, `showWhen` →
|
|
180
|
+
* `hidden()` — the condition is evaluated against the form value exactly as
|
|
181
|
+
* the renderer does it (dotted paths, `and` / `or` / `not`, and inside an
|
|
182
|
+
* array item the item's own value with the root under `$root` and the
|
|
183
|
+
* position under `$index`);
|
|
184
|
+
* - `group` → the nested fields under the group's key, `array` → `applyEach`
|
|
185
|
+
* over the items plus `minItems` / `maxItems` errors from `min` / `max`.
|
|
186
|
+
*
|
|
187
|
+
* What differs from the renderer: a hidden Signal Forms field is skipped for
|
|
188
|
+
* validation and touched / dirty state but **keeps its value in the model**
|
|
189
|
+
* (the model is your data — nothing is stripped), so remove hidden controls
|
|
190
|
+
* from the template with `@if (!f.company().hidden())` and drop the value
|
|
191
|
+
* yourself before saving if it must not be sent. Layout properties (`span`,
|
|
192
|
+
* `columns`), `options`, `props` and `section` entries have no schema
|
|
193
|
+
* equivalent and are ignored.
|
|
194
|
+
*
|
|
195
|
+
* @param definition The dynamic-form schema, or just its `fields`.
|
|
196
|
+
* @template TModel The model type the schema binds to (defaults to a loose record).
|
|
197
|
+
*/
|
|
198
|
+
declare function mkDynamicFormToSignalSchema<TModel extends object = Record<string, unknown>>(definition: MkDynamicSchema | readonly MkDynamicField[]): Schema<TModel>;
|
|
199
|
+
|
|
157
200
|
/** Context handed to a custom field template. */
|
|
158
201
|
interface MkDynamicFieldContext {
|
|
159
202
|
$implicit: MkDynamicFieldBase;
|
|
@@ -301,5 +344,5 @@ declare class MkDynamicForm {
|
|
|
301
344
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkDynamicForm, "mk-dynamic-form", never, { "schema": { "alias": "schema"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "formSubmit": "formSubmit"; "invalidSubmit": "invalidSubmit"; }, ["defs"], ["*"], true, never>;
|
|
302
345
|
}
|
|
303
346
|
|
|
304
|
-
export { MkDynamicFieldDef, MkDynamicFields, MkDynamicForm, mkDynamicCondition, mkDynamicControl, mkDynamicDefaults, mkDynamicEmptyValue, mkDynamicFlatten, mkDynamicForm, mkDynamicGroup, mkDynamicSpan, mkDynamicValidators, mkIsArray, mkIsGroup, mkIsSection, mkIsValueField };
|
|
347
|
+
export { MkDynamicFieldDef, MkDynamicFields, MkDynamicForm, mkDynamicCondition, mkDynamicControl, mkDynamicDefaults, mkDynamicEmptyValue, mkDynamicFlatten, mkDynamicForm, mkDynamicFormToSignalSchema, mkDynamicGroup, mkDynamicSpan, mkDynamicValidators, mkIsArray, mkIsGroup, mkIsSection, mkIsValueField };
|
|
305
348
|
export type { MkDynamicArray, MkDynamicCondition, MkDynamicField, MkDynamicFieldBase, MkDynamicFieldContext, MkDynamicFieldType, MkDynamicGroup, MkDynamicGroup as MkDynamicGroupField, MkDynamicOption, MkDynamicSchema, MkDynamicSection, MkDynamicValidators };
|