@mk-kit/ui 0.47.0 → 0.49.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 +16 -7
- package/fesm2022/mk-kit-ui-core.mjs +9 -380
- package/fesm2022/mk-kit-ui-core.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-data.mjs +6 -842
- package/fesm2022/mk-kit-ui-data.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-datetime.mjs +4 -247
- package/fesm2022/mk-kit-ui-datetime.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-locales-de.mjs +494 -0
- package/fesm2022/mk-kit-ui-locales-de.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-locales-es.mjs +494 -0
- package/fesm2022/mk-kit-ui-locales-es.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-locales-fr.mjs +495 -0
- package/fesm2022/mk-kit-ui-locales-fr.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-locales-uk.mjs +503 -0
- package/fesm2022/mk-kit-ui-locales-uk.mjs.map +1 -0
- package/package.json +18 -1
- package/types/mk-kit-ui-core.d.ts +7 -162
- package/types/mk-kit-ui-data.d.ts +6 -173
- package/types/mk-kit-ui-datetime.d.ts +5 -77
- package/types/mk-kit-ui-locales-de.d.ts +40 -0
- package/types/mk-kit-ui-locales-es.d.ts +40 -0
- package/types/mk-kit-ui-locales-fr.d.ts +41 -0
- package/types/mk-kit-ui-locales-uk.d.ts +42 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mk-kit/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.49.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"rxjs": "^7.8.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
+
"@mk-kit/core": "^0.1.0",
|
|
42
43
|
"@mk-kit/validators": "^0.1.0",
|
|
43
44
|
"tslib": "^2.3.0"
|
|
44
45
|
},
|
|
@@ -128,10 +129,26 @@
|
|
|
128
129
|
"types": "./types/mk-kit-ui-layout.d.ts",
|
|
129
130
|
"default": "./fesm2022/mk-kit-ui-layout.mjs"
|
|
130
131
|
},
|
|
132
|
+
"./locales/de": {
|
|
133
|
+
"types": "./types/mk-kit-ui-locales-de.d.ts",
|
|
134
|
+
"default": "./fesm2022/mk-kit-ui-locales-de.mjs"
|
|
135
|
+
},
|
|
136
|
+
"./locales/es": {
|
|
137
|
+
"types": "./types/mk-kit-ui-locales-es.d.ts",
|
|
138
|
+
"default": "./fesm2022/mk-kit-ui-locales-es.mjs"
|
|
139
|
+
},
|
|
140
|
+
"./locales/fr": {
|
|
141
|
+
"types": "./types/mk-kit-ui-locales-fr.d.ts",
|
|
142
|
+
"default": "./fesm2022/mk-kit-ui-locales-fr.mjs"
|
|
143
|
+
},
|
|
131
144
|
"./locales/pl": {
|
|
132
145
|
"types": "./types/mk-kit-ui-locales-pl.d.ts",
|
|
133
146
|
"default": "./fesm2022/mk-kit-ui-locales-pl.mjs"
|
|
134
147
|
},
|
|
148
|
+
"./locales/uk": {
|
|
149
|
+
"types": "./types/mk-kit-ui-locales-uk.d.ts",
|
|
150
|
+
"default": "./fesm2022/mk-kit-ui-locales-uk.mjs"
|
|
151
|
+
},
|
|
135
152
|
"./media": {
|
|
136
153
|
"types": "./types/mk-kit-ui-media.d.ts",
|
|
137
154
|
"default": "./fesm2022/mk-kit-ui-media.mjs"
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { InjectionToken, OnDestroy, Signal, ComponentRef, Injector, Type, AfterViewInit, ElementRef, Provider } from '@angular/core';
|
|
3
|
+
import { MkPlacement, MkDateNames } from '@mk-kit/core';
|
|
4
|
+
export { MK_QUERY_OPERATORS, MK_QUERY_TEXT_EN, MK_QUERY_UNARY, MkAnchoredPosition, MkAnchoredPositionOptions, MkCodeLanguage, MkDateNames, MkPlacement, MkQueryCombinator, MkQueryField, MkQueryFieldOption, MkQueryGroup, MkQueryNode, MkQueryOperator, MkQueryRule, MkQueryTextStrings, MkQueryValueType, mkComputeAnchoredPosition, mkCreateQueryGroup, mkCreateQueryRule, mkHighlight, mkHighlightJson, mkIsQueryGroup, mkQueryCompact, mkQueryIsEmpty, mkQueryOperatorLabel, mkQueryOperatorsFor, mkQueryRuleCount, mkQueryRuleIsComplete, mkQueryRuleMatches, mkQueryToPredicate, mkQueryToText, mkUniqueId } from '@mk-kit/core';
|
|
3
5
|
import { Observable } from 'rxjs';
|
|
4
6
|
import { ValidationErrors } from '@angular/forms';
|
|
5
7
|
|
|
6
8
|
/** Shared primitive types used across mk-kit components. */
|
|
7
9
|
/** Control size scale. Maps to `--mk-control-height-*` tokens. */
|
|
8
|
-
type MkSize
|
|
10
|
+
type MkSize = 'sm' | 'md' | 'lg';
|
|
9
11
|
/** Semantic color tone. Each maps to a `--mk-<tone>*` token family. */
|
|
10
12
|
type MkTone = 'primary' | 'neutral' | 'success' | 'warning' | 'danger' | 'info';
|
|
11
13
|
/** Visual treatment for tinted/interactive surfaces. */
|
|
@@ -14,8 +16,6 @@ type MkVariant = 'solid' | 'soft' | 'outline' | 'ghost' | 'link';
|
|
|
14
16
|
type MkThemePreference = 'light' | 'dark' | 'system';
|
|
15
17
|
/** Concrete resolved theme (never `system`). */
|
|
16
18
|
type MkResolvedTheme = 'light' | 'dark';
|
|
17
|
-
/** Common placement values for overlays (menus, tooltips, popovers). */
|
|
18
|
-
type MkPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Global control-density mode.
|
|
@@ -218,15 +218,6 @@ declare class MkFocusTrap {
|
|
|
218
218
|
private onKeydown;
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
/**
|
|
222
|
-
* Generates a stable, unique DOM id for wiring `aria-*` relationships
|
|
223
|
-
* (labels, descriptions, controls). Prefer this over `Math.random()` so
|
|
224
|
-
* ids are deterministic within a render and SSR-safe.
|
|
225
|
-
*
|
|
226
|
-
* @param prefix short semantic prefix, e.g. `mk-input`.
|
|
227
|
-
*/
|
|
228
|
-
declare function mkUniqueId(prefix?: string): string;
|
|
229
|
-
|
|
230
221
|
/** Injection token exposing the data passed to an overlay component. */
|
|
231
222
|
declare const MK_OVERLAY_DATA: InjectionToken<unknown>;
|
|
232
223
|
/**
|
|
@@ -386,42 +377,6 @@ declare class MkOverlayService implements OnDestroy {
|
|
|
386
377
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<MkOverlayService>;
|
|
387
378
|
}
|
|
388
379
|
|
|
389
|
-
/** Options controlling {@link mkComputeAnchoredPosition}. */
|
|
390
|
-
interface MkAnchoredPositionOptions {
|
|
391
|
-
placement: MkPlacement;
|
|
392
|
-
gap: number;
|
|
393
|
-
flip: boolean;
|
|
394
|
-
clamp: boolean;
|
|
395
|
-
/** Resolve `-start`/`-end` alignment against a right-to-left anchor. */
|
|
396
|
-
rtl?: boolean;
|
|
397
|
-
}
|
|
398
|
-
interface MkRectLike {
|
|
399
|
-
top: number;
|
|
400
|
-
left: number;
|
|
401
|
-
right: number;
|
|
402
|
-
bottom: number;
|
|
403
|
-
width: number;
|
|
404
|
-
height: number;
|
|
405
|
-
}
|
|
406
|
-
interface MkSize {
|
|
407
|
-
width: number;
|
|
408
|
-
height: number;
|
|
409
|
-
}
|
|
410
|
-
/** Resolved coordinates (viewport-relative, for `position: fixed`). */
|
|
411
|
-
interface MkAnchoredPosition {
|
|
412
|
-
top: number;
|
|
413
|
-
left: number;
|
|
414
|
-
/** The placement actually used after any flip. */
|
|
415
|
-
placement: MkPlacement;
|
|
416
|
-
}
|
|
417
|
-
/**
|
|
418
|
-
* Pure viewport-positioning maths shared by every anchored overlay
|
|
419
|
-
* ({@link MkAnchoredPanel} and the tooltip). Given the anchor rect, the panel
|
|
420
|
-
* size and the viewport size, returns the top/left for a `position: fixed`
|
|
421
|
-
* panel — flipping to the opposite side when it would overflow and clamping
|
|
422
|
-
* back inside the viewport.
|
|
423
|
-
*/
|
|
424
|
-
declare function mkComputeAnchoredPosition(anchor: MkRectLike, panel: MkSize, viewport: MkSize, opts: MkAnchoredPositionOptions): MkAnchoredPosition;
|
|
425
380
|
/**
|
|
426
381
|
* Anchored-overlay directive. Apply it to a floating panel element (a dropdown
|
|
427
382
|
* list, calendar, menu, …) that is rendered inside its component's own template
|
|
@@ -507,23 +462,7 @@ declare class MkAnchoredPanel implements AfterViewInit, OnDestroy {
|
|
|
507
462
|
|
|
508
463
|
/** Direction passed to the sort announcer. */
|
|
509
464
|
type MkSortAnnounceDirection = 'asc' | 'desc';
|
|
510
|
-
|
|
511
|
-
* Localised date-name tables consumed by the calendar, the date/month/week
|
|
512
|
-
* pickers and `formatDate`. All arrays are full-length (12 months, 7 weekdays
|
|
513
|
-
* starting with Sunday) — override the whole set for a locale.
|
|
514
|
-
*/
|
|
515
|
-
interface MkDateNames {
|
|
516
|
-
/** Full month names, January-first (12). */
|
|
517
|
-
months: readonly string[];
|
|
518
|
-
/** Abbreviated month names (12). */
|
|
519
|
-
monthsShort: readonly string[];
|
|
520
|
-
/** Full weekday names, Sunday-first (7). */
|
|
521
|
-
weekdays: readonly string[];
|
|
522
|
-
/** Abbreviated weekday names (7). */
|
|
523
|
-
weekdaysShort: readonly string[];
|
|
524
|
-
/** One/two-letter weekday names for calendar headers (7). */
|
|
525
|
-
weekdaysNarrow: readonly string[];
|
|
526
|
-
}
|
|
465
|
+
|
|
527
466
|
/** Strings used by the block editor's chrome. */
|
|
528
467
|
interface MkBlockEditorStrings {
|
|
529
468
|
addBlock: string;
|
|
@@ -1289,7 +1228,7 @@ declare abstract class MkFieldContext {
|
|
|
1289
1228
|
/** Id of the field's label element, for `aria-labelledby`. */
|
|
1290
1229
|
abstract readonly labelId: string;
|
|
1291
1230
|
/** The field's visual size, mirrored onto the nested control. */
|
|
1292
|
-
abstract readonly size: Signal<MkSize
|
|
1231
|
+
abstract readonly size: Signal<MkSize>;
|
|
1293
1232
|
/** Whether the field is required (explicitly or via the bound control). */
|
|
1294
1233
|
abstract readonly isRequired: Signal<boolean>;
|
|
1295
1234
|
/** Whether the field currently shows an error. */
|
|
@@ -1301,22 +1240,6 @@ declare abstract class MkFieldContext {
|
|
|
1301
1240
|
abstract readonly describedBy: Signal<string | null>;
|
|
1302
1241
|
}
|
|
1303
1242
|
|
|
1304
|
-
/**
|
|
1305
|
-
* Dependency-free syntax highlighting for {@link MkCodeEditor}. Each function
|
|
1306
|
-
* takes source text and returns an HTML string of `<span class="mk-tok-…">`
|
|
1307
|
-
* tokens. Input is HTML-escaped first, so the result is safe to render.
|
|
1308
|
-
*/
|
|
1309
|
-
/** Languages with built-in highlighting. Unknown values render plain text. */
|
|
1310
|
-
type MkCodeLanguage = 'json' | 'plaintext';
|
|
1311
|
-
/**
|
|
1312
|
-
* Highlight a JSON document. Recognises object keys, strings, numbers, the
|
|
1313
|
-
* `true`/`false`/`null` literals and structural punctuation. Invalid JSON is
|
|
1314
|
-
* still highlighted token-by-token (the editor validates separately).
|
|
1315
|
-
*/
|
|
1316
|
-
declare function mkHighlightJson(src: string): string;
|
|
1317
|
-
/** Highlight `src` for `language`, falling back to escaped plain text. */
|
|
1318
|
-
declare function mkHighlight(src: string, language: string): string;
|
|
1319
|
-
|
|
1320
1243
|
/**
|
|
1321
1244
|
* Handle returned by {@link mkValidatorChange}, wiring a component's
|
|
1322
1245
|
* `registerOnValidatorChange` callback to a set of reactive dependencies.
|
|
@@ -1440,83 +1363,5 @@ declare function mkSignalErrorMessage(errors: readonly MkSignalValidationError[]
|
|
|
1440
1363
|
*/
|
|
1441
1364
|
declare function mkInjectFieldTouched(): Signal<boolean>;
|
|
1442
1365
|
|
|
1443
|
-
|
|
1444
|
-
type
|
|
1445
|
-
/** A choice for `select` fields. */
|
|
1446
|
-
interface MkQueryFieldOption {
|
|
1447
|
-
label: string;
|
|
1448
|
-
value: unknown;
|
|
1449
|
-
}
|
|
1450
|
-
/** A field the user can filter on. */
|
|
1451
|
-
interface MkQueryField {
|
|
1452
|
-
/** Property key on the row objects / the API's filter name. */
|
|
1453
|
-
key: string;
|
|
1454
|
-
/** Label shown in the field picker. */
|
|
1455
|
-
label: string;
|
|
1456
|
-
/** Default `string`. */
|
|
1457
|
-
type?: MkQueryValueType;
|
|
1458
|
-
/** Choices for `select` fields. */
|
|
1459
|
-
options?: readonly MkQueryFieldOption[];
|
|
1460
|
-
/** Restrict / reorder the operators offered (default: all for the type). */
|
|
1461
|
-
operators?: readonly MkQueryOperator[];
|
|
1462
|
-
/** Placeholder of the value editor. */
|
|
1463
|
-
placeholder?: string;
|
|
1464
|
-
}
|
|
1465
|
-
/** Comparison operators. Which apply depends on the field type. */
|
|
1466
|
-
type MkQueryOperator = 'eq' | 'neq' | 'contains' | 'notContains' | 'startsWith' | 'endsWith' | 'gt' | 'gte' | 'lt' | 'lte' | 'between' | 'in' | 'notIn' | 'before' | 'after' | 'empty' | 'notEmpty';
|
|
1467
|
-
/** A leaf condition. `value` is `[from, to]` for `between`, an array for `in` / `notIn`, absent for `empty` / `notEmpty`. Dates are ISO strings. */
|
|
1468
|
-
interface MkQueryRule {
|
|
1469
|
-
id: string;
|
|
1470
|
-
field: string;
|
|
1471
|
-
operator: MkQueryOperator;
|
|
1472
|
-
value?: unknown;
|
|
1473
|
-
}
|
|
1474
|
-
type MkQueryCombinator = 'and' | 'or';
|
|
1475
|
-
/** A group of rules and nested groups joined by one combinator, optionally negated. */
|
|
1476
|
-
interface MkQueryGroup {
|
|
1477
|
-
id: string;
|
|
1478
|
-
combinator: MkQueryCombinator;
|
|
1479
|
-
/** Negate the whole group. */
|
|
1480
|
-
not?: boolean;
|
|
1481
|
-
rules: MkQueryNode[];
|
|
1482
|
-
}
|
|
1483
|
-
type MkQueryNode = MkQueryRule | MkQueryGroup;
|
|
1484
|
-
|
|
1485
|
-
/** Operators offered per field type, in menu order. */
|
|
1486
|
-
declare const MK_QUERY_OPERATORS: Readonly<Record<MkQueryValueType, readonly MkQueryOperator[]>>;
|
|
1487
|
-
/** Operators that take no value. */
|
|
1488
|
-
declare const MK_QUERY_UNARY: ReadonlySet<MkQueryOperator>;
|
|
1489
|
-
/** True for a group node (as opposed to a rule). */
|
|
1490
|
-
declare function mkIsQueryGroup(node: MkQueryNode): node is MkQueryGroup;
|
|
1491
|
-
/** A fresh empty group. */
|
|
1492
|
-
declare function mkCreateQueryGroup(init?: Partial<Omit<MkQueryGroup, 'id'>>): MkQueryGroup;
|
|
1493
|
-
/** A fresh rule on `field`, using its first operator. */
|
|
1494
|
-
declare function mkCreateQueryRule(field: MkQueryField): MkQueryRule;
|
|
1495
|
-
/** Operators a field offers (its own list, else the defaults for its type). */
|
|
1496
|
-
declare function mkQueryOperatorsFor(field: MkQueryField | undefined): readonly MkQueryOperator[];
|
|
1497
|
-
/** True when the tree holds no rule at all (empty groups only). */
|
|
1498
|
-
declare function mkQueryIsEmpty(group: MkQueryGroup): boolean;
|
|
1499
|
-
/** Number of rules in the tree. */
|
|
1500
|
-
declare function mkQueryRuleCount(group: MkQueryGroup): number;
|
|
1501
|
-
/** Drop empty groups and rules that still need a value, so the API gets only complete conditions. */
|
|
1502
|
-
declare function mkQueryCompact(group: MkQueryGroup): MkQueryGroup;
|
|
1503
|
-
/** A rule is complete when its operator needs no value or has one. */
|
|
1504
|
-
declare function mkQueryRuleIsComplete(rule: MkQueryRule): boolean;
|
|
1505
|
-
/** Evaluate one rule against a row. */
|
|
1506
|
-
declare function mkQueryRuleMatches(rule: MkQueryRule, row: Record<string, unknown>, field?: MkQueryField): boolean;
|
|
1507
|
-
/**
|
|
1508
|
-
* Compile a query into a row predicate for client-side filtering
|
|
1509
|
-
* (`rows.filter(mkQueryToPredicate(query, fields))`). Unfinished rules are
|
|
1510
|
-
* ignored, so a half-edited query never blanks the table.
|
|
1511
|
-
*/
|
|
1512
|
-
declare function mkQueryToPredicate<T extends object = Record<string, unknown>>(group: MkQueryGroup, fields?: readonly MkQueryField[]): (row: T) => boolean;
|
|
1513
|
-
/** Localised label of an operator. */
|
|
1514
|
-
declare function mkQueryOperatorLabel(op: MkQueryOperator, i18n?: MkI18nStrings): string;
|
|
1515
|
-
/**
|
|
1516
|
-
* Human-readable sentence for a query, e.g.
|
|
1517
|
-
* `(Name contains "ada" and Orders at least 10) or Status is any of Active, Invited`.
|
|
1518
|
-
*/
|
|
1519
|
-
declare function mkQueryToText(group: MkQueryGroup, fields?: readonly MkQueryField[], i18n?: MkI18nStrings): string;
|
|
1520
|
-
|
|
1521
|
-
export { MK_BREAKPOINTS, MK_DEFAULT_BREAKPOINTS, MK_DEFAULT_DATE_NAMES, MK_DEFAULT_I18N, MK_DEFAULT_VALIDATION, MK_I18N, MK_OVERLAY_DATA, MK_OVERLAY_ROOT, MK_QUERY_OPERATORS, MK_QUERY_UNARY, MkAnchoredPanel, MkBreakpointService, MkFieldContext, MkFocusTrap, MkLiveAnnouncer, MkOverlayRef, MkOverlayService, MkThemeService, mkBodyLevelAncestor, mkComputeAnchoredPosition, mkCreateQueryGroup, mkCreateQueryRule, mkFirstErrorMessage, mkGetFocusable, mkHighlight, mkHighlightJson, mkInjectFieldTouched, mkIsQueryGroup, mkIsResponsive, mkMergeI18n, mkQueryCompact, mkQueryIsEmpty, mkQueryOperatorLabel, mkQueryOperatorsFor, mkQueryRuleCount, mkQueryRuleIsComplete, mkQueryRuleMatches, mkQueryToPredicate, mkQueryToText, mkSignalErrorMessage, mkSignalErrorsToValidationErrors, mkUniqueId, mkValidatorChange, provideMkI18n };
|
|
1522
|
-
export type { MkAnchoredPosition, MkAnchoredPositionOptions, MkAriaLivePoliteness, MkBlockEditorStrings, MkBreakpoint, MkBreakpoints, MkCodeLanguage, MkContrastPreference, MkDateNames, MkDensity, MkErrorMessages, MkI18nOverrides, MkI18nStrings, MkOverlayConfig, MkOverlayRootFn, MkPlacement, MkQueryCombinator, MkQueryField, MkQueryFieldOption, MkQueryGroup, MkQueryNode, MkQueryOperator, MkQueryRule, MkQueryValueType, MkResolvedContrast, MkResolvedTheme, MkResponsive, MkSignalValidationError, MkSize$1 as MkSize, MkSortAnnounceDirection, MkThemePreference, MkTone, MkValidationStrings, MkValidatorChangeRef, MkVariant };
|
|
1366
|
+
export { MK_BREAKPOINTS, MK_DEFAULT_BREAKPOINTS, MK_DEFAULT_DATE_NAMES, MK_DEFAULT_I18N, MK_DEFAULT_VALIDATION, MK_I18N, MK_OVERLAY_DATA, MK_OVERLAY_ROOT, MkAnchoredPanel, MkBreakpointService, MkFieldContext, MkFocusTrap, MkLiveAnnouncer, MkOverlayRef, MkOverlayService, MkThemeService, mkBodyLevelAncestor, mkFirstErrorMessage, mkGetFocusable, mkInjectFieldTouched, mkIsResponsive, mkMergeI18n, mkSignalErrorMessage, mkSignalErrorsToValidationErrors, mkValidatorChange, provideMkI18n };
|
|
1367
|
+
export type { MkAriaLivePoliteness, MkBlockEditorStrings, MkBreakpoint, MkBreakpoints, MkContrastPreference, MkDensity, MkErrorMessages, MkI18nOverrides, MkI18nStrings, MkOverlayConfig, MkOverlayRootFn, MkResolvedContrast, MkResolvedTheme, MkResponsive, MkSignalValidationError, MkSize, MkSortAnnounceDirection, MkThemePreference, MkTone, MkValidationStrings, MkValidatorChangeRef, MkVariant };
|
|
@@ -3,7 +3,9 @@ import { TemplateRef, ElementRef } from '@angular/core';
|
|
|
3
3
|
import * as _mk_kit_ui_core from '@mk-kit/ui/core';
|
|
4
4
|
import { MkTone, MkSize, MkCodeLanguage } from '@mk-kit/ui/core';
|
|
5
5
|
import { ControlValueAccessor } from '@angular/forms';
|
|
6
|
-
import * as
|
|
6
|
+
import * as _mk_kit_core from '@mk-kit/core';
|
|
7
|
+
import { MkDiffRow } from '@mk-kit/core';
|
|
8
|
+
export { MkAnsiSpan, MkDiffOp, MkDiffOptions, MkDiffRow, MkDiffSegment, MkDiffStats, MkMarkdownAlign, MkMarkdownBlock, MkMarkdownInline, MkMarkdownList, MkMarkdownListItem, MkMarkdownParseOptions, MkMarkdownRenderOptions, mkComputeDiff, mkDiffStats, mkParseAnsi, mkParseMarkdown, mkRenderMarkdown, mkStripAnsi } from '@mk-kit/core';
|
|
7
9
|
import { MkDropEvent } from '@mk-kit/ui/dnd';
|
|
8
10
|
|
|
9
11
|
/** Surface treatment for a {@link MkCard}. */
|
|
@@ -2396,53 +2398,6 @@ declare class MkCarousel {
|
|
|
2396
2398
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkCarousel, "mk-carousel", never, { "index": { "alias": "index"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "loop": { "alias": "loop"; "required": false; "isSignal": true; }; "showDots": { "alias": "showDots"; "required": false; "isSignal": true; }; "showArrows": { "alias": "showArrows"; "required": false; "isSignal": true; }; "autoplay": { "alias": "autoplay"; "required": false; "isSignal": true; }; "interval": { "alias": "interval"; "required": false; "isSignal": true; }; "userPaused": { "alias": "userPaused"; "required": false; "isSignal": true; }; }, { "index": "indexChange"; "userPaused": "userPausedChange"; }, ["slides"], ["*"], true, never>;
|
|
2397
2399
|
}
|
|
2398
2400
|
|
|
2399
|
-
/**
|
|
2400
|
-
* Dependency-free text diff for {@link MkDiff} — an LCS line diff with optional
|
|
2401
|
-
* intra-line word highlighting. Pure and SSR-safe (no DOM). Suited to revision
|
|
2402
|
-
* comparison ("what changed between save N and N+1").
|
|
2403
|
-
*/
|
|
2404
|
-
/** The kind of change for a diff row/segment. */
|
|
2405
|
-
type MkDiffOp = 'equal' | 'insert' | 'delete';
|
|
2406
|
-
/** A word-level segment within a changed line. */
|
|
2407
|
-
interface MkDiffSegment {
|
|
2408
|
-
text: string;
|
|
2409
|
-
/** True when this word differs from the paired line. */
|
|
2410
|
-
changed: boolean;
|
|
2411
|
-
}
|
|
2412
|
-
/** One line of a computed diff. */
|
|
2413
|
-
interface MkDiffRow {
|
|
2414
|
-
op: MkDiffOp;
|
|
2415
|
-
text: string;
|
|
2416
|
-
/** 1-based line number in the "before" text (null for inserts). */
|
|
2417
|
-
beforeNo: number | null;
|
|
2418
|
-
/** 1-based line number in the "after" text (null for deletes). */
|
|
2419
|
-
afterNo: number | null;
|
|
2420
|
-
/** Word segments for changed lines (present when word highlighting runs). */
|
|
2421
|
-
segments?: MkDiffSegment[];
|
|
2422
|
-
}
|
|
2423
|
-
/** Summary counts for a diff. */
|
|
2424
|
-
interface MkDiffStats {
|
|
2425
|
-
added: number;
|
|
2426
|
-
removed: number;
|
|
2427
|
-
unchanged: number;
|
|
2428
|
-
}
|
|
2429
|
-
/** Options for {@link mkComputeDiff}. */
|
|
2430
|
-
interface MkDiffOptions {
|
|
2431
|
-
/** Highlight the specific words that changed within paired lines. */
|
|
2432
|
-
wordHighlight?: boolean;
|
|
2433
|
-
/** Treat trailing whitespace as insignificant when comparing lines. */
|
|
2434
|
-
ignoreTrailingWhitespace?: boolean;
|
|
2435
|
-
}
|
|
2436
|
-
/**
|
|
2437
|
-
* Compute a line diff between `before` and `after`. Returns one {@link MkDiffRow}
|
|
2438
|
-
* per line in document order, with `equal` / `insert` / `delete` ops and 1-based
|
|
2439
|
-
* before/after line numbers. With `wordHighlight` (default true) changed lines
|
|
2440
|
-
* also carry word-level `segments`.
|
|
2441
|
-
*/
|
|
2442
|
-
declare function mkComputeDiff(before: string, after: string, options?: MkDiffOptions): MkDiffRow[];
|
|
2443
|
-
/** Summary counts (added / removed / unchanged lines) for a diff. */
|
|
2444
|
-
declare function mkDiffStats(rows: MkDiffRow[]): MkDiffStats;
|
|
2445
|
-
|
|
2446
2401
|
/** How {@link MkDiff} lays out the comparison. */
|
|
2447
2402
|
type MkDiffMode = 'unified' | 'split';
|
|
2448
2403
|
interface SplitRow {
|
|
@@ -2479,7 +2434,7 @@ declare class MkDiff {
|
|
|
2479
2434
|
readonly beforeLabel: _angular_core.InputSignal<string>;
|
|
2480
2435
|
readonly afterLabel: _angular_core.InputSignal<string>;
|
|
2481
2436
|
protected readonly rows: _angular_core.Signal<MkDiffRow[]>;
|
|
2482
|
-
protected readonly stats: _angular_core.Signal<
|
|
2437
|
+
protected readonly stats: _angular_core.Signal<_mk_kit_core.MkDiffStats>;
|
|
2483
2438
|
/** Rows paired into two columns for the split view. */
|
|
2484
2439
|
protected readonly splitRows: _angular_core.Signal<SplitRow[]>;
|
|
2485
2440
|
protected marker(op: MkDiffRow['op']): string;
|
|
@@ -2728,39 +2683,6 @@ declare class MkJsonViewer {
|
|
|
2728
2683
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkJsonViewer, "mk-json-viewer", ["mkJsonViewer"], { "data": { "alias": "data"; "required": true; "isSignal": true; }; "expandDepth": { "alias": "expandDepth"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
2729
2684
|
}
|
|
2730
2685
|
|
|
2731
|
-
/**
|
|
2732
|
-
* Minimal ANSI SGR parser for {@link MkLogViewer}.
|
|
2733
|
-
*
|
|
2734
|
-
* Understands the SGR (`ESC[…m`) subset that matters for log output — reset
|
|
2735
|
-
* (0), bold (1), italic (3), underline (4), the 22/23/24 "off" codes, the 8
|
|
2736
|
-
* standard + 8 bright foreground colours (30–37 / 90–97, 39 reset) and the
|
|
2737
|
-
* matching backgrounds (40–47 / 100–107, 49 reset). Extended-colour
|
|
2738
|
-
* introducers (38/48;5;… and 38/48;2;r;g;b) are consumed so their arguments
|
|
2739
|
-
* are never misread as other codes, but map to "no colour" (the theme has no
|
|
2740
|
-
* 256-colour palette). Every other escape sequence — cursor movement, erase,
|
|
2741
|
-
* OSC titles, single-character escapes — is stripped rather than rendered as
|
|
2742
|
-
* garbage.
|
|
2743
|
-
*
|
|
2744
|
-
* Colours are emitted as CSS class names (`mk-ansi--fg-red`,
|
|
2745
|
-
* `mk-ansi--bg-bright-blue`, `mk-ansi--bold`, …) themed in
|
|
2746
|
-
* `log-viewer.scss`, not as raw terminal colours.
|
|
2747
|
-
*/
|
|
2748
|
-
/** One styled run of text within a parsed line. */
|
|
2749
|
-
interface MkAnsiSpan {
|
|
2750
|
-
/** The plain text of the run (escape sequences removed). */
|
|
2751
|
-
text: string;
|
|
2752
|
-
/** `mk-ansi--*` class names styling the run; empty for plain text. */
|
|
2753
|
-
classes: readonly string[];
|
|
2754
|
-
}
|
|
2755
|
-
/**
|
|
2756
|
-
* Parse one log line into styled spans. Pure — same input, same output.
|
|
2757
|
-
* Adjacent runs with identical styling are merged, so a plain line yields a
|
|
2758
|
-
* single span (or none when empty).
|
|
2759
|
-
*/
|
|
2760
|
-
declare function mkParseAnsi(line: string): MkAnsiSpan[];
|
|
2761
|
-
/** Remove every ANSI escape sequence from a line (for copy / search). */
|
|
2762
|
-
declare function mkStripAnsi(line: string): string;
|
|
2763
|
-
|
|
2764
2686
|
/** One render token of a log line: a styled run, optionally a search match. */
|
|
2765
2687
|
interface MkLogToken {
|
|
2766
2688
|
text: string;
|
|
@@ -2889,94 +2811,5 @@ declare class MkMarkdown {
|
|
|
2889
2811
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkMarkdown, "mk-markdown", never, { "source": { "alias": "source"; "required": false; "isSignal": true; }; "autolink": { "alias": "autolink"; "required": false; "isSignal": true; }; "linkTarget": { "alias": "linkTarget"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
2890
2812
|
}
|
|
2891
2813
|
|
|
2892
|
-
|
|
2893
|
-
type
|
|
2894
|
-
/** Inline (phrasing) node of the markdown AST. */
|
|
2895
|
-
type MkMarkdownInline = {
|
|
2896
|
-
kind: 'text';
|
|
2897
|
-
text: string;
|
|
2898
|
-
} | {
|
|
2899
|
-
kind: 'softbreak';
|
|
2900
|
-
} | {
|
|
2901
|
-
kind: 'break';
|
|
2902
|
-
} | {
|
|
2903
|
-
kind: 'code';
|
|
2904
|
-
code: string;
|
|
2905
|
-
} | {
|
|
2906
|
-
kind: 'strong';
|
|
2907
|
-
children: MkMarkdownInline[];
|
|
2908
|
-
} | {
|
|
2909
|
-
kind: 'em';
|
|
2910
|
-
children: MkMarkdownInline[];
|
|
2911
|
-
} | {
|
|
2912
|
-
kind: 'del';
|
|
2913
|
-
children: MkMarkdownInline[];
|
|
2914
|
-
} | {
|
|
2915
|
-
kind: 'link';
|
|
2916
|
-
href: string;
|
|
2917
|
-
children: MkMarkdownInline[];
|
|
2918
|
-
} | {
|
|
2919
|
-
kind: 'image';
|
|
2920
|
-
src: string;
|
|
2921
|
-
alt: string;
|
|
2922
|
-
};
|
|
2923
|
-
/** One `<li>`: tight inline content plus an optional nested list. */
|
|
2924
|
-
interface MkMarkdownListItem {
|
|
2925
|
-
children: MkMarkdownInline[];
|
|
2926
|
-
sublist: MkMarkdownList | null;
|
|
2927
|
-
}
|
|
2928
|
-
/** An ordered or unordered (tight) list block. */
|
|
2929
|
-
interface MkMarkdownList {
|
|
2930
|
-
kind: 'list';
|
|
2931
|
-
ordered: boolean;
|
|
2932
|
-
/** First ordinal of an ordered list (`3.` starts at 3). Always 1 for bullets. */
|
|
2933
|
-
start: number;
|
|
2934
|
-
items: MkMarkdownListItem[];
|
|
2935
|
-
}
|
|
2936
|
-
/** Block-level node of the markdown AST. */
|
|
2937
|
-
type MkMarkdownBlock = {
|
|
2938
|
-
kind: 'heading';
|
|
2939
|
-
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
2940
|
-
children: MkMarkdownInline[];
|
|
2941
|
-
} | {
|
|
2942
|
-
kind: 'paragraph';
|
|
2943
|
-
children: MkMarkdownInline[];
|
|
2944
|
-
} | {
|
|
2945
|
-
kind: 'code';
|
|
2946
|
-
language: string;
|
|
2947
|
-
code: string;
|
|
2948
|
-
} | {
|
|
2949
|
-
kind: 'blockquote';
|
|
2950
|
-
children: MkMarkdownBlock[];
|
|
2951
|
-
} | {
|
|
2952
|
-
kind: 'hr';
|
|
2953
|
-
} | MkMarkdownList | {
|
|
2954
|
-
kind: 'table';
|
|
2955
|
-
align: MkMarkdownAlign[];
|
|
2956
|
-
header: MkMarkdownInline[][];
|
|
2957
|
-
rows: MkMarkdownInline[][][];
|
|
2958
|
-
};
|
|
2959
|
-
interface MkMarkdownParseOptions {
|
|
2960
|
-
/** Turn bare `http(s)://…` URLs into links. Off by default. */
|
|
2961
|
-
autolink?: boolean;
|
|
2962
|
-
}
|
|
2963
|
-
interface MkMarkdownRenderOptions {
|
|
2964
|
-
/** `'_blank'` renders `target="_blank" rel="noopener noreferrer"` on links. */
|
|
2965
|
-
linkTarget?: '' | '_blank';
|
|
2966
|
-
}
|
|
2967
|
-
/**
|
|
2968
|
-
* Parse markdown source into a typed AST. Pure and dependency-free — safe to
|
|
2969
|
-
* run on a server. Unsafe link/image URLs are already dropped at this stage,
|
|
2970
|
-
* so the AST never carries a `javascript:` (or other non-allow-listed) URL.
|
|
2971
|
-
*/
|
|
2972
|
-
declare function mkParseMarkdown(src: string, options?: MkMarkdownParseOptions): MkMarkdownBlock[];
|
|
2973
|
-
/**
|
|
2974
|
-
* Render a parsed AST to an HTML string. The output contains only tags this
|
|
2975
|
-
* renderer generates (all source text is escaped), so it is safe to bind to
|
|
2976
|
-
* `[innerHTML]` — Angular's sanitizer keeps every element/attribute used here.
|
|
2977
|
-
* Fenced code is highlighted via `mkHighlight` for its known languages.
|
|
2978
|
-
*/
|
|
2979
|
-
declare function mkRenderMarkdown(blocks: MkMarkdownBlock[], options?: MkMarkdownRenderOptions): string;
|
|
2980
|
-
|
|
2981
|
-
export { MK_CHART_PALETTE_SIZE, MK_HEATMAP_MIN_CONTRAST, MkAvatar, MkAvatarGroup, MkBadge, MkBadgeOverlay, MkBarChart, MkCalendarHeatmap, MkCard, MkCardFooter, MkCardHeader, MkCardTitle, MkCarousel, MkCarouselSlide, MkCode, MkCountdown, MkDescItem, MkDescriptionList, MkDiff, MkDivider, MkDonutChart, MkEmptyState, MkFunnelChart, MkGauge, MkHeatmap, MkInlineEdit, MkJsonViewer, MkKanban, MkLineChart, MkList, MkListItem, MkLogViewer, MkMarkdown, MkOrgChart, MkOrgChartNodeDef, MkProfileActions, MkProfileCard, MkProfileMeta, MkProgressBar, MkProgressRing, MkQrCode, MkRadarChart, MkScatterChart, MkSkeleton, MkSkeletonPreset, MkSparkline, MkSpinner, MkStatCard, MkTag, MkTimeline, MkTimelineItem, MkTreemap, MkVirtualScroll, mkArcPath, mkAreaPath, mkBuildJsonTree, mkChartColor, mkComputeDiff, mkContrastRatio, mkDiffStats, mkEncodeQr, mkFormatCompact, mkHeatmapCellColors, mkLinePath, mkLinearScale, mkMixRgb, mkNiceTicks, mkOrgChartFromFlat, mkParseAnsi, mkParseMarkdown, mkParseRgb, mkRelativeLuminance, mkRenderMarkdown, mkSplitDuration, mkSquarify, mkStripAnsi };
|
|
2982
|
-
export type { MkAnsiSpan, MkAvatarShape, MkAvatarStatus, MkBadgeOverlayPosition, MkBadgeVariant, MkBarOrientation, MkCalendarHeatmapCell, MkCalendarHeatmapEntry, MkCardPadding, MkCardVariant, MkChartSeries, MkChartSlice, MkDescriptionLayout, MkDiffMode, MkDiffOp, MkDiffOptions, MkDiffRow, MkDiffSegment, MkDiffStats, MkDividerOrientation, MkDurationParts, MkFunnelSegment, MkHeatmapCellColors, MkHeatmapPalette, MkJsonNode, MkKanbanCard, MkKanbanCardMovedEvent, MkKanbanColumn, MkLogToken, MkMarkdownAlign, MkMarkdownBlock, MkMarkdownInline, MkMarkdownList, MkMarkdownListItem, MkMarkdownParseOptions, MkMarkdownRenderOptions, MkOrgChartFlatNode, MkOrgChartNode, MkOrgChartNodeContext, MkOrgChartOrientation, MkOrgChartTemplateData, MkOrgChartToggleEvent, MkPoint, MkProfileCardOrientation, MkQrEcc, MkRgb, MkScatterPoint, MkScatterSeries, MkSkeletonPresetKind, MkSkeletonShape, MkSparklineType, MkStatTrend, MkTagVariant, MkTreemapItem, MkTreemapRect };
|
|
2814
|
+
export { MK_CHART_PALETTE_SIZE, MK_HEATMAP_MIN_CONTRAST, MkAvatar, MkAvatarGroup, MkBadge, MkBadgeOverlay, MkBarChart, MkCalendarHeatmap, MkCard, MkCardFooter, MkCardHeader, MkCardTitle, MkCarousel, MkCarouselSlide, MkCode, MkCountdown, MkDescItem, MkDescriptionList, MkDiff, MkDivider, MkDonutChart, MkEmptyState, MkFunnelChart, MkGauge, MkHeatmap, MkInlineEdit, MkJsonViewer, MkKanban, MkLineChart, MkList, MkListItem, MkLogViewer, MkMarkdown, MkOrgChart, MkOrgChartNodeDef, MkProfileActions, MkProfileCard, MkProfileMeta, MkProgressBar, MkProgressRing, MkQrCode, MkRadarChart, MkScatterChart, MkSkeleton, MkSkeletonPreset, MkSparkline, MkSpinner, MkStatCard, MkTag, MkTimeline, MkTimelineItem, MkTreemap, MkVirtualScroll, mkArcPath, mkAreaPath, mkBuildJsonTree, mkChartColor, mkContrastRatio, mkEncodeQr, mkFormatCompact, mkHeatmapCellColors, mkLinePath, mkLinearScale, mkMixRgb, mkNiceTicks, mkOrgChartFromFlat, mkParseRgb, mkRelativeLuminance, mkSplitDuration, mkSquarify };
|
|
2815
|
+
export type { MkAvatarShape, MkAvatarStatus, MkBadgeOverlayPosition, MkBadgeVariant, MkBarOrientation, MkCalendarHeatmapCell, MkCalendarHeatmapEntry, MkCardPadding, MkCardVariant, MkChartSeries, MkChartSlice, MkDescriptionLayout, MkDiffMode, MkDividerOrientation, MkDurationParts, MkFunnelSegment, MkHeatmapCellColors, MkHeatmapPalette, MkJsonNode, MkKanbanCard, MkKanbanCardMovedEvent, MkKanbanColumn, MkLogToken, MkOrgChartFlatNode, MkOrgChartNode, MkOrgChartNodeContext, MkOrgChartOrientation, MkOrgChartTemplateData, MkOrgChartToggleEvent, MkPoint, MkProfileCardOrientation, MkQrEcc, MkRgb, MkScatterPoint, MkScatterSeries, MkSkeletonPresetKind, MkSkeletonShape, MkSparklineType, MkStatTrend, MkTagVariant, MkTreemapItem, MkTreemapRect };
|
|
@@ -1,82 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import { MkDateNames, MkSize } from '@mk-kit/ui/core';
|
|
1
|
+
export { MkWeekday, addDays, addMonths, buildMonthMatrix, clampDate, endOfMonth, endOfWeek, formatDate, formatISODate, getISOWeek, getMonthNames, getWeekdayFullName, getWeekdayNames, isAfter, isBefore, isSameDay, isSameMonth, parseISODate, startOfDay, startOfMonth, startOfWeek } from '@mk-kit/core';
|
|
3
2
|
import * as _angular_core from '@angular/core';
|
|
4
3
|
import { OnDestroy } from '@angular/core';
|
|
4
|
+
import * as _mk_kit_ui_core from '@mk-kit/ui/core';
|
|
5
|
+
import { MkSize } from '@mk-kit/ui/core';
|
|
5
6
|
import { ControlValueAccessor, Validator, AbstractControl, ValidationErrors } from '@angular/forms';
|
|
6
7
|
|
|
7
|
-
/**
|
|
8
|
-
* Dependency-free date helpers shared by the mk-kit DATE & TIME components.
|
|
9
|
-
* All functions are pure and operate on native `Date`. Name-producing helpers
|
|
10
|
-
* default to English but accept an optional {@link MkDateNames} table (from
|
|
11
|
-
* `MK_I18N`) for localisation. Dates are treated in the local time zone.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/** Day-of-week index 0 (Sunday) … 6 (Saturday). */
|
|
15
|
-
type MkWeekday = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
16
|
-
/** True when both dates fall on the same calendar day (local time). */
|
|
17
|
-
declare function isSameDay(a: Date, b: Date): boolean;
|
|
18
|
-
/** True when both dates fall in the same calendar month of the same year. */
|
|
19
|
-
declare function isSameMonth(a: Date, b: Date): boolean;
|
|
20
|
-
/** Midnight (00:00:00.000) on the first day of `date`'s month. */
|
|
21
|
-
declare function startOfMonth(date: Date): Date;
|
|
22
|
-
/** Midnight on the last day of `date`'s month. */
|
|
23
|
-
declare function endOfMonth(date: Date): Date;
|
|
24
|
-
/** A new date `count` months after `date` (negative to subtract). Clamps the
|
|
25
|
-
* day of month so e.g. Jan 31 + 1 month = Feb 28/29, not Mar 3. */
|
|
26
|
-
declare function addMonths(date: Date, count: number): Date;
|
|
27
|
-
/** A new date `count` days after `date` (negative to subtract). */
|
|
28
|
-
declare function addDays(date: Date, count: number): Date;
|
|
29
|
-
/** Midnight (00:00:00.000) on `date`'s calendar day. */
|
|
30
|
-
declare function startOfDay(date: Date): Date;
|
|
31
|
-
/**
|
|
32
|
-
* The first day of the week containing `date`, at midnight. `firstDayOfWeek`
|
|
33
|
-
* is the week's starting weekday (0 = Sunday … 6 = Saturday).
|
|
34
|
-
*/
|
|
35
|
-
declare function startOfWeek(date: Date, firstDayOfWeek?: number): Date;
|
|
36
|
-
/** The last day of the week containing `date`, at midnight. */
|
|
37
|
-
declare function endOfWeek(date: Date, firstDayOfWeek?: number): Date;
|
|
38
|
-
/**
|
|
39
|
-
* ISO-8601 week number (1–53) of `date`. Weeks start on Monday and week 1 is
|
|
40
|
-
* the week containing the first Thursday of the year.
|
|
41
|
-
*/
|
|
42
|
-
declare function getISOWeek(date: Date): number;
|
|
43
|
-
/** True when `a` is strictly before `b` (full timestamp comparison). */
|
|
44
|
-
declare function isBefore(a: Date, b: Date): boolean;
|
|
45
|
-
/** True when `a` is strictly after `b` (full timestamp comparison). */
|
|
46
|
-
declare function isAfter(a: Date, b: Date): boolean;
|
|
47
|
-
/** Clamp `date` into the inclusive `[min, max]` range (either bound optional). */
|
|
48
|
-
declare function clampDate(date: Date, min?: Date | null, max?: Date | null): Date;
|
|
49
|
-
/** Format `date` as an ISO calendar date `YYYY-MM-DD` (local time). */
|
|
50
|
-
declare function formatISODate(date: Date): string;
|
|
51
|
-
/** Parse a `YYYY-MM-DD` string into a local-time `Date`, or `null` if invalid. */
|
|
52
|
-
declare function parseISODate(value: string | null | undefined): Date | null;
|
|
53
|
-
/**
|
|
54
|
-
* Format `date` using a small pattern set. Supported tokens:
|
|
55
|
-
* `yyyy` (4-digit year), `MMMM` (full month), `MMM` (short month),
|
|
56
|
-
* `MM` (2-digit month), `dd` (2-digit day), `d` (day), `ddd` (short weekday),
|
|
57
|
-
* `HH` / `H` (24-hour, padded / bare), `hh` / `h` (12-hour, padded / bare),
|
|
58
|
-
* `mm` (2-digit minutes) and `a` (`AM` / `PM`). Longer tokens are matched
|
|
59
|
-
* first so `MMMM` wins over `MM`. Month/weekday names come from `names` when
|
|
60
|
-
* given, else English.
|
|
61
|
-
*/
|
|
62
|
-
declare function formatDate(date: Date, pattern: string, names?: MkDateNames): string;
|
|
63
|
-
/**
|
|
64
|
-
* Build a fixed 6×7 matrix of `Date` cells for `viewDate`'s month, including
|
|
65
|
-
* the leading days from the previous month and trailing days from the next so
|
|
66
|
-
* every row is full. `firstDayOfWeek` is 0 (Sunday) … 6 (Saturday).
|
|
67
|
-
*/
|
|
68
|
-
declare function buildMonthMatrix(viewDate: Date, firstDayOfWeek?: number): Date[][];
|
|
69
|
-
/** Full month names, index 0 = January (from `names`, else English). */
|
|
70
|
-
declare function getMonthNames(names?: MkDateNames): readonly string[];
|
|
71
|
-
/**
|
|
72
|
-
* Weekday header labels ordered to start at `firstDayOfWeek`.
|
|
73
|
-
* `format` selects `'short'` (e.g. `Mon`) or `'narrow'` (e.g. `M`).
|
|
74
|
-
* Labels come from `names` when given, else English.
|
|
75
|
-
*/
|
|
76
|
-
declare function getWeekdayNames(firstDayOfWeek?: number, format?: 'short' | 'narrow', names?: MkDateNames): string[];
|
|
77
|
-
/** Full weekday name for `date` (for screen-reader labels). */
|
|
78
|
-
declare function getWeekdayFullName(date: Date, names?: MkDateNames): string;
|
|
79
|
-
|
|
80
8
|
/** Weekday header descriptor (short label + full name for `abbr[title]`). */
|
|
81
9
|
interface MkWeekdayHeader$1 {
|
|
82
10
|
short: string;
|
|
@@ -1352,5 +1280,5 @@ declare class MkMiniDate implements ControlValueAccessor, Validator {
|
|
|
1352
1280
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkMiniDate, "mk-mini-date", ["mkMiniDate"], { "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "order": { "alias": "order"; "required": false; "isSignal": true; }; "yearMin": { "alias": "yearMin"; "required": false; "isSignal": true; }; "yearMax": { "alias": "yearMax"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
1353
1281
|
}
|
|
1354
1282
|
|
|
1355
|
-
export { MkCalendar, MkDatePicker, MkDateRangePicker, MkDateTimePicker, MkEventCalendar, MkMiniDate, MkMonthPicker, MkTimePicker, MkWeekPicker
|
|
1356
|
-
export type { MkCalendarEvent, MkCalendarEventEdit, MkCalendarView, MkDateRange, MkMiniDateOrder, MkMonthPickerMode, MkWeek
|
|
1283
|
+
export { MkCalendar, MkDatePicker, MkDateRangePicker, MkDateTimePicker, MkEventCalendar, MkMiniDate, MkMonthPicker, MkTimePicker, MkWeekPicker };
|
|
1284
|
+
export type { MkCalendarEvent, MkCalendarEventEdit, MkCalendarView, MkDateRange, MkMiniDateOrder, MkMonthPickerMode, MkWeek };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Provider } from '@angular/core';
|
|
2
|
+
import { MkBlockEditorStrings, MkDateNames, MkI18nStrings, MkValidationStrings, MkI18nOverrides } from '@mk-kit/ui/core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Picks the German plural form for a count — CLDR's `de` rules for integers:
|
|
6
|
+
* `one` for 1, `other` for everything else.
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* mkPluralDe(1, 'Ergebnis', 'Ergebnisse'); // 'Ergebnis'
|
|
10
|
+
* mkPluralDe(3, 'Ergebnis', 'Ergebnisse'); // 'Ergebnisse'
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
declare function mkPluralDe(count: number, one: string, other: string): string;
|
|
14
|
+
/** German month and weekday names (Sunday-first, as in `Intl`). */
|
|
15
|
+
declare const MK_DE_DATE_NAMES: MkDateNames;
|
|
16
|
+
/** German validation messages rendered by `mk-form-field`. */
|
|
17
|
+
declare const MK_DE_VALIDATION: MkValidationStrings;
|
|
18
|
+
/** German strings of the block editor's chrome. */
|
|
19
|
+
declare const MK_DE_BLOCK_EDITOR: MkBlockEditorStrings;
|
|
20
|
+
/**
|
|
21
|
+
* The complete German string map — every key of {@link MkI18nStrings},
|
|
22
|
+
* `locale: 'de-DE'` and `currency: 'EUR'` for the formatting pipes.
|
|
23
|
+
* Provide it whole with {@link provideMkI18nDe}, or pass it as the base of
|
|
24
|
+
* `provideMkI18n(overrides, MK_DE_I18N)`.
|
|
25
|
+
*/
|
|
26
|
+
declare const MK_DE_I18N: MkI18nStrings;
|
|
27
|
+
/**
|
|
28
|
+
* Provides the German strings — {@link MK_DE_I18N} with any `overrides`
|
|
29
|
+
* merged on top (deep for `dateNames`, `blockEditor` and `validation`, like
|
|
30
|
+
* `provideMkI18n`).
|
|
31
|
+
*
|
|
32
|
+
* ```ts
|
|
33
|
+
* bootstrapApplication(App, {
|
|
34
|
+
* providers: [provideMkI18nDe({ noData: 'Nichts zu sehen' })],
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
declare function provideMkI18nDe(overrides?: MkI18nOverrides): Provider;
|
|
39
|
+
|
|
40
|
+
export { MK_DE_BLOCK_EDITOR, MK_DE_DATE_NAMES, MK_DE_I18N, MK_DE_VALIDATION, mkPluralDe, provideMkI18nDe };
|