@mk-kit/ui 0.41.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 +4 -4
- 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 +218 -1
- package/fesm2022/mk-kit-ui-core.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-data.mjs +801 -16
- package/fesm2022/mk-kit-ui-data.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-datetime.mjs +90 -52
- package/fesm2022/mk-kit-ui-datetime.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-directives.mjs +395 -2
- package/fesm2022/mk-kit-ui-directives.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-dnd.mjs +183 -29
- package/fesm2022/mk-kit-ui-dnd.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 +331 -81
- 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 +36 -8
- 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/styles/mk-kit.css +604 -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 +119 -2
- package/types/mk-kit-ui-data.d.ts +359 -3
- package/types/mk-kit-ui-datetime.d.ts +41 -19
- package/types/mk-kit-ui-directives.d.ts +234 -3
- package/types/mk-kit-ui-dnd.d.ts +96 -14
- package/types/mk-kit-ui-dynamic-form.d.ts +44 -1
- package/types/mk-kit-ui-forms.d.ts +160 -20
- 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 +38 -21
- 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,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { Signal, TemplateRef } from '@angular/core';
|
|
2
|
+
import { Signal, TemplateRef, PipeTransform } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Emits when a pointer press lands outside the host element — the building block
|
|
@@ -803,5 +803,236 @@ declare class MkCanDisable {
|
|
|
803
803
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MkCanDisable, "[mkCanDisable]", never, { "permission": { "alias": "mkCanDisable"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
804
804
|
}
|
|
805
805
|
|
|
806
|
-
|
|
807
|
-
|
|
806
|
+
/**
|
|
807
|
+
* Options accepted by {@link MkCurrencyPipe}. They map onto
|
|
808
|
+
* `Intl.NumberFormat` currency options; `locale` overrides the i18n /
|
|
809
|
+
* runtime locale for this call only.
|
|
810
|
+
*/
|
|
811
|
+
interface MkCurrencyOptions {
|
|
812
|
+
/** BCP 47 locale for this call; defaults to `provideMkI18n({ locale })`, then the runtime locale. */
|
|
813
|
+
locale?: string;
|
|
814
|
+
/** How the currency is shown. Default `'symbol'` (`€`, `$`, `zł`). */
|
|
815
|
+
display?: 'symbol' | 'narrowSymbol' | 'code' | 'name';
|
|
816
|
+
/** Fraction digits; both default to the currency's own (2 for EUR, 0 for JPY). */
|
|
817
|
+
minimumFractionDigits?: number;
|
|
818
|
+
maximumFractionDigits?: number;
|
|
819
|
+
/** Sign display, e.g. `'always'` for `+€10.00` or `'exceptZero'`. */
|
|
820
|
+
signDisplay?: 'auto' | 'never' | 'always' | 'exceptZero';
|
|
821
|
+
/** Compact notation for dashboards (`$1.2M`). Default `'standard'`. */
|
|
822
|
+
notation?: 'standard' | 'compact';
|
|
823
|
+
/** Thousands grouping; default `true`. */
|
|
824
|
+
useGrouping?: boolean;
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* `mkCurrency` — format a number as money with `Intl.NumberFormat`, honouring
|
|
828
|
+
* the locale and default currency from `provideMkI18n({ locale, currency })`.
|
|
829
|
+
* No Angular locale data is needed. Pure: `null`, `undefined`, `''` and
|
|
830
|
+
* non-numeric input render as `''`.
|
|
831
|
+
*
|
|
832
|
+
* ```html
|
|
833
|
+
* {{ 1234.5 | mkCurrency }} <!-- $1,234.50 (i18n currency, default USD) -->
|
|
834
|
+
* {{ 1234.5 | mkCurrency:'EUR' }} <!-- €1,234.50 -->
|
|
835
|
+
* {{ 1234.5 | mkCurrency:'PLN':{ locale: 'pl-PL' } }} <!-- 1234,50 zł -->
|
|
836
|
+
* {{ 1234567 | mkCurrency:'USD':{ notation: 'compact' } }} <!-- $1.2M -->
|
|
837
|
+
* {{ total() | mkCurrency:'GBP':{ signDisplay: 'always' } }} <!-- signals work as-is -->
|
|
838
|
+
* ```
|
|
839
|
+
*/
|
|
840
|
+
declare class MkCurrencyPipe implements PipeTransform {
|
|
841
|
+
private readonly i18n;
|
|
842
|
+
/**
|
|
843
|
+
* @param value Amount in major units (`12.5` → `$12.50`).
|
|
844
|
+
* @param currency ISO 4217 code; defaults to `provideMkI18n({ currency })`, then `'USD'`.
|
|
845
|
+
* @param options Locale and `Intl.NumberFormat` currency options.
|
|
846
|
+
*/
|
|
847
|
+
transform(value: number | string | null | undefined, currency?: string | null, options?: MkCurrencyOptions): string;
|
|
848
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkCurrencyPipe, never>;
|
|
849
|
+
static ɵpipe: _angular_core.ɵɵPipeDeclaration<MkCurrencyPipe, "mkCurrency", true>;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
/** Options accepted by {@link MkRelativeTimePipe}. */
|
|
853
|
+
interface MkRelativeTimeOptions {
|
|
854
|
+
/** BCP 47 locale for this call; defaults to `provideMkI18n({ locale })`, then the runtime locale. */
|
|
855
|
+
locale?: string;
|
|
856
|
+
/**
|
|
857
|
+
* `'auto'` (default) uses phrases like "yesterday" / "now" where the locale
|
|
858
|
+
* has them; `'always'` sticks to "1 day ago" / "in 0 seconds".
|
|
859
|
+
*/
|
|
860
|
+
numeric?: 'always' | 'auto';
|
|
861
|
+
/** Length of the unit word: `'long'` (default, "minutes"), `'short'` ("min."), `'narrow'` ("m"). */
|
|
862
|
+
style?: 'long' | 'short' | 'narrow';
|
|
863
|
+
/**
|
|
864
|
+
* Largest unit to use. Default `'year'`; e.g. `'day'` keeps "45 days ago"
|
|
865
|
+
* instead of "1 month ago".
|
|
866
|
+
*/
|
|
867
|
+
maxUnit?: Intl.RelativeTimeFormatUnit;
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* `mkRelativeTime` — "3 minutes ago" / "in 2 days" / "yesterday" from a
|
|
871
|
+
* `Date`, timestamp or ISO string, via `Intl.RelativeTimeFormat` in the
|
|
872
|
+
* `provideMkI18n` locale (no Angular locale data). Pure: `null`, `undefined`
|
|
873
|
+
* and unparsable input render as `''`.
|
|
874
|
+
*
|
|
875
|
+
* The pipe picks the largest unit whose magnitude is at least 1 (seconds →
|
|
876
|
+
* minutes → hours → days → weeks → months → years) and rounds. Pass `now`
|
|
877
|
+
* for deterministic output in tests, or bind a ticking signal to keep a
|
|
878
|
+
* list live — a pure pipe only re-runs when an argument changes:
|
|
879
|
+
*
|
|
880
|
+
* ```html
|
|
881
|
+
* {{ comment.createdAt | mkRelativeTime }} <!-- 3 minutes ago -->
|
|
882
|
+
* {{ due | mkRelativeTime:now() }} <!-- in 2 days (now() ticks) -->
|
|
883
|
+
* {{ due | mkRelativeTime:null:{ style: 'short' } }} <!-- in 2 days -->
|
|
884
|
+
* {{ ts | mkRelativeTime:null:{ locale: 'pl', numeric: 'always' } }} <!-- 3 minuty temu -->
|
|
885
|
+
* ```
|
|
886
|
+
*/
|
|
887
|
+
declare class MkRelativeTimePipe implements PipeTransform {
|
|
888
|
+
private readonly i18n;
|
|
889
|
+
/**
|
|
890
|
+
* @param value The instant to describe.
|
|
891
|
+
* @param now Reference instant; defaults to `Date.now()` at call time.
|
|
892
|
+
* @param options Locale, numeric mode, style and unit cap.
|
|
893
|
+
*/
|
|
894
|
+
transform(value: Date | number | string | null | undefined, now?: Date | number | string | null, options?: MkRelativeTimeOptions): string;
|
|
895
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkRelativeTimePipe, never>;
|
|
896
|
+
static ɵpipe: _angular_core.ɵɵPipeDeclaration<MkRelativeTimePipe, "mkRelativeTime", true>;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
/** Options accepted by {@link MkFileSizePipe}. */
|
|
900
|
+
interface MkFileSizeOptions {
|
|
901
|
+
/** BCP 47 locale for the number part (decimal separator); defaults to the i18n / runtime locale. */
|
|
902
|
+
locale?: string;
|
|
903
|
+
/**
|
|
904
|
+
* `'decimal'` (default) divides by 1000 and labels `kB MB GB …` (what
|
|
905
|
+
* operating systems and file dialogs show); `'binary'` divides by 1024
|
|
906
|
+
* and labels `KiB MiB GiB …`.
|
|
907
|
+
*/
|
|
908
|
+
base?: 'decimal' | 'binary';
|
|
909
|
+
/** Maximum fraction digits. Default `1`; bytes never get fractions. */
|
|
910
|
+
digits?: number;
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* `mkFileSize` — bytes → a human-readable size such as `1.2 MB`, with the
|
|
914
|
+
* number formatted by `Intl.NumberFormat` in the `provideMkI18n` locale.
|
|
915
|
+
* Pure: `null`, `undefined`, `''` and non-numeric input render as `''`.
|
|
916
|
+
*
|
|
917
|
+
* ```html
|
|
918
|
+
* {{ 1_234_567 | mkFileSize }} <!-- 1.2 MB -->
|
|
919
|
+
* {{ 1_234_567 | mkFileSize:{ base: 'binary' } }} <!-- 1.2 MiB -->
|
|
920
|
+
* {{ 1_234_567 | mkFileSize:{ digits: 2, locale: 'de' } }} <!-- 1,23 MB -->
|
|
921
|
+
* {{ 512 | mkFileSize }} <!-- 512 B -->
|
|
922
|
+
* ```
|
|
923
|
+
*/
|
|
924
|
+
declare class MkFileSizePipe implements PipeTransform {
|
|
925
|
+
private readonly i18n;
|
|
926
|
+
transform(value: number | string | null | undefined, options?: MkFileSizeOptions): string;
|
|
927
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkFileSizePipe, never>;
|
|
928
|
+
static ɵpipe: _angular_core.ɵɵPipeDeclaration<MkFileSizePipe, "mkFileSize", true>;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* `mkInitials` — "Ada Lovelace" → "AL", the same rule `mk-avatar` uses for
|
|
933
|
+
* its fallback: first letter of the first and last word, upper-cased. A
|
|
934
|
+
* single word yields its first `max` letters ("Ada" → "AD"); more than two
|
|
935
|
+
* words with `max` > 2 take one letter per word from the start ("Jean
|
|
936
|
+
* Luc Picard" with `max: 3` → "JLP"). Leading/trailing/duplicate whitespace
|
|
937
|
+
* is ignored, and grapheme-aware slicing keeps emoji and accents intact.
|
|
938
|
+
* Pure: `null`, `undefined` and blank input render as `''`.
|
|
939
|
+
*
|
|
940
|
+
* ```html
|
|
941
|
+
* {{ user.name | mkInitials }} <!-- Grace Hopper → GH -->
|
|
942
|
+
* {{ user.name | mkInitials:1 }} <!-- Grace Hopper → G -->
|
|
943
|
+
* {{ 'Jean Luc Picard' | mkInitials:3 }} <!-- JLP -->
|
|
944
|
+
* ```
|
|
945
|
+
*/
|
|
946
|
+
declare class MkInitialsPipe implements PipeTransform {
|
|
947
|
+
/**
|
|
948
|
+
* @param value Full name.
|
|
949
|
+
* @param max Maximum number of letters; default `2`, minimum `1`.
|
|
950
|
+
*/
|
|
951
|
+
transform(value: string | null | undefined, max?: number): string;
|
|
952
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkInitialsPipe, never>;
|
|
953
|
+
static ɵpipe: _angular_core.ɵɵPipeDeclaration<MkInitialsPipe, "mkInitials", true>;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
/** Options accepted by {@link MkTruncatePipe}. */
|
|
957
|
+
interface MkTruncateOptions {
|
|
958
|
+
/** Suffix appended when text is cut. Default `'…'` (a single ellipsis character). */
|
|
959
|
+
ellipsis?: string;
|
|
960
|
+
/**
|
|
961
|
+
* Cut at the last whitespace before the limit instead of mid-word
|
|
962
|
+
* (falls back to a hard cut when the first word alone is longer).
|
|
963
|
+
* Default `false`.
|
|
964
|
+
*/
|
|
965
|
+
wordBoundary?: boolean;
|
|
966
|
+
}
|
|
967
|
+
/**
|
|
968
|
+
* `mkTruncate` — shorten text to `length` characters and append an ellipsis.
|
|
969
|
+
* The ellipsis counts toward the limit, so the output never exceeds
|
|
970
|
+
* `length` characters; counting is grapheme-aware (emoji and accented
|
|
971
|
+
* letters are one character). Text that already fits is returned as-is.
|
|
972
|
+
* Pure: `null` and `undefined` render as `''`.
|
|
973
|
+
*
|
|
974
|
+
* ```html
|
|
975
|
+
* {{ post.body | mkTruncate:80 }} <!-- hard cut at 80 -->
|
|
976
|
+
* {{ post.body | mkTruncate:80:{ wordBoundary: true } }} <!-- cut at the last space -->
|
|
977
|
+
* {{ hash | mkTruncate:12:{ ellipsis: '...' } }}
|
|
978
|
+
* ```
|
|
979
|
+
*/
|
|
980
|
+
declare class MkTruncatePipe implements PipeTransform {
|
|
981
|
+
/**
|
|
982
|
+
* @param value Text to shorten.
|
|
983
|
+
* @param length Maximum characters in the output, ellipsis included. Default `50`.
|
|
984
|
+
* @param options Ellipsis string and word-boundary mode.
|
|
985
|
+
*/
|
|
986
|
+
transform(value: string | null | undefined, length?: number, options?: MkTruncateOptions): string;
|
|
987
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkTruncatePipe, never>;
|
|
988
|
+
static ɵpipe: _angular_core.ɵɵPipeDeclaration<MkTruncatePipe, "mkTruncate", true>;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
/**
|
|
992
|
+
* Per-category word forms for {@link MkPluralizePipe}, keyed by the CLDR
|
|
993
|
+
* plural categories `Intl.PluralRules` returns. `other` is required; the
|
|
994
|
+
* pipe falls back to it for any category you leave out.
|
|
995
|
+
*
|
|
996
|
+
* ```ts
|
|
997
|
+
* const files: MkPluralForms = { one: 'plik', few: 'pliki', many: 'plików', other: 'pliku' };
|
|
998
|
+
* ```
|
|
999
|
+
*/
|
|
1000
|
+
type MkPluralForms = {
|
|
1001
|
+
other: string;
|
|
1002
|
+
} & Partial<Record<Intl.LDMLPluralRule, string>>;
|
|
1003
|
+
/** Options accepted by {@link MkPluralizePipe}. */
|
|
1004
|
+
interface MkPluralizeOptions {
|
|
1005
|
+
/** BCP 47 locale for the plural rules and number; defaults to the i18n / runtime locale. */
|
|
1006
|
+
locale?: string;
|
|
1007
|
+
/** Prefix the formatted count (`"3 items"`); `false` gives just the word. Default `true`. */
|
|
1008
|
+
withCount?: boolean;
|
|
1009
|
+
}
|
|
1010
|
+
/**
|
|
1011
|
+
* `mkPluralize` — pick the right word for a count using the locale's plural
|
|
1012
|
+
* rules (`Intl.PluralRules`), optionally prefixed with the formatted count.
|
|
1013
|
+
* The English shorthand takes a singular and an optional plural (default
|
|
1014
|
+
* `singular + 's'`); other languages pass a {@link MkPluralForms} map.
|
|
1015
|
+
* Pure: `null`, `undefined`, `''` and non-numeric counts render as `''`.
|
|
1016
|
+
*
|
|
1017
|
+
* ```html
|
|
1018
|
+
* {{ count | mkPluralize:'item' }} <!-- 1 item / 3 items -->
|
|
1019
|
+
* {{ count | mkPluralize:'entry':'entries' }} <!-- 1 entry / 2 entries -->
|
|
1020
|
+
* {{ count | mkPluralize:'file':null:{ withCount: false } }} <!-- files -->
|
|
1021
|
+
* {{ n | mkPluralize:{ one: 'plik', few: 'pliki', many: 'plików', other: 'pliku' }:null:{ locale: 'pl' } }}
|
|
1022
|
+
* ```
|
|
1023
|
+
*/
|
|
1024
|
+
declare class MkPluralizePipe implements PipeTransform {
|
|
1025
|
+
private readonly i18n;
|
|
1026
|
+
/**
|
|
1027
|
+
* @param value The count.
|
|
1028
|
+
* @param singular Singular word, or a full {@link MkPluralForms} map.
|
|
1029
|
+
* @param plural Plural word for the shorthand form; default `singular + 's'`. Ignored with a map.
|
|
1030
|
+
* @param options Locale and whether to prefix the count.
|
|
1031
|
+
*/
|
|
1032
|
+
transform(value: number | string | null | undefined, singular: string | MkPluralForms, plural?: string | null, options?: MkPluralizeOptions): string;
|
|
1033
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkPluralizePipe, never>;
|
|
1034
|
+
static ɵpipe: _angular_core.ɵɵPipeDeclaration<MkPluralizePipe, "mkPluralize", true>;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
export { MK_FIELD_PRESETS, MkAutofocus, MkAutosize, MkCan, MkCanDisable, MkCannot, MkClickOutside, MkCopyToClipboard, MkCurrencyPipe, MkField, MkFileSizePipe, MkHistoryService, MkHistoryStack, MkHotkey, MkHotkeysService, MkInfiniteScroll, MkInitialsPipe, MkIntersect, MkMask, MkPermissionPolicy, MkPluralizePipe, MkRelativeTimePipe, MkRipple, MkScrollspy, MkTruncatePipe, mkApplyMask, mkMaskCaret, mkMatchesHotkey, mkParseHotkey, mkPermissionGranted, registerHistoryHotkeys };
|
|
1038
|
+
export type { MkCurrencyOptions, MkFieldKind, MkFieldPreset, MkFileSizeOptions, MkHistoryEntry, MkHotkeyOptions, MkMaskResult, MkParsedHotkey, MkPluralForms, MkPluralizeOptions, MkRelativeTimeOptions, MkTruncateOptions };
|
package/types/mk-kit-ui-dnd.d.ts
CHANGED
|
@@ -11,29 +11,64 @@ import { TemplateRef } from '@angular/core';
|
|
|
11
11
|
* Its look (grab cursor, muted colour, `touch-action: none`) ships as the
|
|
12
12
|
* global `.mk-drag-handle` class in the theme stylesheet.
|
|
13
13
|
*
|
|
14
|
+
* **Decorative grip** — a non-focusable element (`<span>`, `<mk-icon>`): the
|
|
15
|
+
* item itself stays the keyboard target (`role="button"`, focusable), so the
|
|
16
|
+
* grip should be `aria-hidden`:
|
|
17
|
+
*
|
|
14
18
|
* ```html
|
|
15
19
|
* <div mkDrag [mkDragData]="row">
|
|
16
20
|
* <span mkDragHandle aria-hidden="true">⠿</span>
|
|
17
21
|
* {{ row.name }}
|
|
18
22
|
* </div>
|
|
19
23
|
* ```
|
|
24
|
+
*
|
|
25
|
+
* **Focusable grip** — a `<button>` (or any element with `tabindex`): the
|
|
26
|
+
* handle becomes the keyboard target instead. The item is then a plain
|
|
27
|
+
* container (no role, not focusable), so rows may hold inputs, links and
|
|
28
|
+
* other buttons without nesting interactive controls, and `<li>` items keep
|
|
29
|
+
* valid list semantics. Give it an accessible name:
|
|
30
|
+
*
|
|
31
|
+
* ```html
|
|
32
|
+
* <li mkDrag [mkDragData]="row">
|
|
33
|
+
* <button type="button" mkDragHandle [attr.aria-label]="'Reorder ' + row.name">⠿</button>
|
|
34
|
+
* <input mkInput [(ngModel)]="row.name" />
|
|
35
|
+
* </li>
|
|
36
|
+
* ```
|
|
20
37
|
*/
|
|
21
38
|
declare class MkDragHandle {
|
|
22
39
|
/** The handle's host element. */
|
|
23
40
|
readonly element: HTMLElement;
|
|
41
|
+
/**
|
|
42
|
+
* Whether the handle can take keyboard focus itself — a native control
|
|
43
|
+
* (`<button>`, …), a link with `href`, or any element with a `tabindex`.
|
|
44
|
+
* A focusable handle carries the keyboard drag for its `[mkDrag]`.
|
|
45
|
+
*/
|
|
46
|
+
isFocusable(): boolean;
|
|
24
47
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkDragHandle, never>;
|
|
25
48
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MkDragHandle, "[mkDragHandle]", ["mkDragHandle"], {}, {}, never, never, true, never>;
|
|
26
49
|
}
|
|
27
50
|
|
|
28
51
|
/**
|
|
29
52
|
* Makes an item inside a `[mkDropList]` draggable — by pointer (mouse / touch /
|
|
30
|
-
* pen) **and** by keyboard (WCAG 2.1.1).
|
|
31
|
-
*
|
|
32
|
-
*
|
|
53
|
+
* pen) **and** by keyboard (WCAG 2.1.1). Every move is announced via
|
|
54
|
+
* {@link MkLiveAnnouncer}. Which element carries the keyboard interaction
|
|
55
|
+
* depends on the handle:
|
|
56
|
+
*
|
|
57
|
+
* - **No handle, or a decorative one** (`<span mkDragHandle aria-hidden>`):
|
|
58
|
+
* the item itself is focusable and exposes `aria-roledescription="Draggable
|
|
59
|
+
* item"` with `role="button"` — or `role="option"` when it is an `<li>` of a
|
|
60
|
+
* `<ul mkDropList>`, which then becomes a labelled `listbox` (an `<li>` may
|
|
61
|
+
* not take the `button` role).
|
|
62
|
+
* - **A focusable handle** (`<button mkDragHandle aria-label="…">`, or any
|
|
63
|
+
* handle with `tabindex`): the handle is the keyboard target and receives
|
|
64
|
+
* the `aria-roledescription` / `aria-pressed` / `aria-grabbed` state; the
|
|
65
|
+
* item stays a plain container with no role and no `tabindex`, so it can hold
|
|
66
|
+
* inputs, links and buttons of its own (no nested interactive controls) and
|
|
67
|
+
* `<li>` items keep their list semantics.
|
|
33
68
|
*
|
|
34
|
-
* Keyboard: focus
|
|
35
|
-
* keys to move it (crossing into connected lists at the ends /
|
|
36
|
-
* perpendicular axis), **Space/Enter** to drop, **Escape** to cancel.
|
|
69
|
+
* Keyboard: focus the item (or its handle) and press **Space/Enter** to pick
|
|
70
|
+
* it up, **Arrow** keys to move it (crossing into connected lists at the ends /
|
|
71
|
+
* across the perpendicular axis), **Space/Enter** to drop, **Escape** to cancel.
|
|
37
72
|
*
|
|
38
73
|
* Touch: a swipe scrolls the page as usual — the drag only arms after a
|
|
39
74
|
* long-press ({@link mkDragTouchDelay}, default 300 ms). While armed the item
|
|
@@ -46,9 +81,9 @@ declare class MkDragHandle {
|
|
|
46
81
|
* synchronously on release so drops land exactly where the pointer ended.
|
|
47
82
|
*
|
|
48
83
|
* ```html
|
|
49
|
-
* <
|
|
84
|
+
* <div mkDrag [mkDragData]="row" [mkDragDisabled]="row.locked">
|
|
50
85
|
* <span mkDragHandle aria-hidden="true">⠿</span> {{ row.title }}
|
|
51
|
-
* </
|
|
86
|
+
* </div>
|
|
52
87
|
* ```
|
|
53
88
|
*
|
|
54
89
|
* @typeParam T item data type.
|
|
@@ -82,6 +117,20 @@ declare class MkDrag<T = unknown> {
|
|
|
82
117
|
* inner handle would start the outer drag and inner dnd would never work.
|
|
83
118
|
*/
|
|
84
119
|
protected readonly ownHandles: _angular_core.Signal<MkDragHandle[]>;
|
|
120
|
+
/**
|
|
121
|
+
* The handle that carries the keyboard drag — the first of this item's
|
|
122
|
+
* handles that is focusable on its own (a `<button mkDragHandle>`, say).
|
|
123
|
+
* `null` when the item itself is the keyboard target.
|
|
124
|
+
*/
|
|
125
|
+
readonly keyboardHandle: _angular_core.Signal<MkDragHandle | null>;
|
|
126
|
+
/**
|
|
127
|
+
* The role the item itself exposes: `null` when a focusable handle carries
|
|
128
|
+
* the interaction; `option` inside a list that resolved to a `listbox`
|
|
129
|
+
* (`<ul mkDropList>` / `<li mkDrag>`); `button` otherwise.
|
|
130
|
+
*/
|
|
131
|
+
protected readonly itemRole: _angular_core.Signal<"button" | "option" | null>;
|
|
132
|
+
/** The element keyboard events act on: the focusable handle, else the item. */
|
|
133
|
+
private keyboardTarget;
|
|
85
134
|
/** True while a pointer drag is in progress. */
|
|
86
135
|
protected readonly dragging: _angular_core.WritableSignal<boolean>;
|
|
87
136
|
/** True while the item is "picked up" for keyboard movement. */
|
|
@@ -105,6 +154,8 @@ declare class MkDrag<T = unknown> {
|
|
|
105
154
|
private originLeft;
|
|
106
155
|
private originTop;
|
|
107
156
|
private preview;
|
|
157
|
+
constructor();
|
|
158
|
+
private toggleAttr;
|
|
108
159
|
private readonly moveHandler;
|
|
109
160
|
private readonly upHandler;
|
|
110
161
|
private readonly cancelHandler;
|
|
@@ -168,7 +219,7 @@ declare class MkDrag<T = unknown> {
|
|
|
168
219
|
private finishPointer;
|
|
169
220
|
private commitPointer;
|
|
170
221
|
protected onKeyDown(event: Event): void;
|
|
171
|
-
protected
|
|
222
|
+
protected onFocusOut(event: Event): void;
|
|
172
223
|
private pickUp;
|
|
173
224
|
private stepPrimary;
|
|
174
225
|
private stepList;
|
|
@@ -228,14 +279,29 @@ declare class MkDrag<T = unknown> {
|
|
|
228
279
|
* The array bound to `mkDropListData` is **not** mutated for you — handle
|
|
229
280
|
* `mkDropListDropped` and call {@link mkMoveItemInArray} / {@link mkTransferArrayItem}.
|
|
230
281
|
*
|
|
282
|
+
* Semantics follow the host element and its items, so the tree is always
|
|
283
|
+
* valid ARIA:
|
|
284
|
+
*
|
|
285
|
+
* - any host other than `<ul>`/`<ol>` is a `role="group"` (named by
|
|
286
|
+
* `mkDropListLabel`) of `role="button"` items;
|
|
287
|
+
* - a `<ul>`/`<ol>` whose `<li mkDrag>` items all carry a *focusable*
|
|
288
|
+
* `[mkDragHandle]` stays a plain list — the handles are the controls;
|
|
289
|
+
* - a `<ul>`/`<ol>` whose items are themselves the keyboard targets becomes a
|
|
290
|
+
* `listbox` of `option`s (an `<li>` may not be a `button`); give it a
|
|
291
|
+
* `mkDropListLabel`, listboxes need a name.
|
|
292
|
+
*
|
|
293
|
+
* A `role` you set in the template is kept, and `aria-orientation` is only
|
|
294
|
+
* exposed on roles that allow it (`listbox`, `toolbar`, `tree`, …) — the
|
|
295
|
+
* keyboard model handles both axes regardless.
|
|
296
|
+
*
|
|
231
297
|
* ```html
|
|
232
|
-
* <
|
|
233
|
-
*
|
|
234
|
-
*
|
|
298
|
+
* <div mkDropList [mkDropListData]="todo()" mkDropListLabel="To do"
|
|
299
|
+
* mkDropListId="todo" [mkDropListConnectedTo]="['done']"
|
|
300
|
+
* (mkDropListDropped)="drop($event)">
|
|
235
301
|
* @for (t of todo(); track t.id) {
|
|
236
|
-
* <
|
|
302
|
+
* <div mkDrag [mkDragData]="t">{{ t.title }}</div>
|
|
237
303
|
* }
|
|
238
|
-
* </
|
|
304
|
+
* </div>
|
|
239
305
|
* ```
|
|
240
306
|
*
|
|
241
307
|
* @typeParam T item data type.
|
|
@@ -268,6 +334,22 @@ declare class MkDropList<T = unknown> {
|
|
|
268
334
|
private readonly autoId;
|
|
269
335
|
/** Announceable name: the label when set, otherwise the resolved id. */
|
|
270
336
|
readonly label: _angular_core.Signal<string>;
|
|
337
|
+
/** A `role` written in the template — always kept. */
|
|
338
|
+
private readonly explicitRole;
|
|
339
|
+
private readonly isNativeList;
|
|
340
|
+
/**
|
|
341
|
+
* The role the host exposes. One set in the template wins. A `<ul>`/`<ol>`
|
|
342
|
+
* keeps its implicit `list` role (`null` — nothing is written) while every
|
|
343
|
+
* item hands the keyboard drag to a focusable handle, and becomes a
|
|
344
|
+
* `listbox` (its items `option`s) otherwise. Any other element is a `group`.
|
|
345
|
+
*/
|
|
346
|
+
readonly role: _angular_core.Signal<string | null>;
|
|
347
|
+
/** Whether `aria-orientation` is valid on the effective role. */
|
|
348
|
+
protected readonly orientationAllowed: _angular_core.Signal<boolean>;
|
|
349
|
+
/** A static `aria-label` written in the template, kept when no label input is set. */
|
|
350
|
+
private readonly staticAriaLabel;
|
|
351
|
+
/** Accessible name of the list: `mkDropListLabel`, else the template's own. */
|
|
352
|
+
protected readonly ariaLabel: _angular_core.Signal<string | null>;
|
|
271
353
|
/** Connected-list ids, normalised to a plain array. */
|
|
272
354
|
readonly connectedTo: _angular_core.Signal<readonly string[]>;
|
|
273
355
|
/** The `mkDrag` items projected into this list, in DOM order. */
|