@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
package/fesm2022/mk-kit-ui.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mk-kit-ui.mjs","sources":["../../../projects/mk-kit/src/public-api.ts","../../../projects/mk-kit/src/mk-kit-ui.ts"],"sourcesContent":["/*\n * Public API Surface of @mk-kit/ui.\n *\n * The library ships Material-style secondary entry points — import from the\n * group entries (`@mk-kit/ui/forms`, `@mk-kit/ui/table`, …) so a code-split\n * app only carries the groups each chunk uses. This root entry re-exports\n * everything for convenience; importing it eagerly pulls all groups into the\n * importing chunk.\n */\nexport * from '@mk-kit/ui/core';\nexport * from '@mk-kit/ui/icon';\nexport * from '@mk-kit/ui/chip';\nexport * from '@mk-kit/ui/checkbox';\nexport * from '@mk-kit/ui/button';\nexport * from '@mk-kit/ui/directives';\nexport * from '@mk-kit/ui/dnd';\nexport * from '@mk-kit/ui/navigation';\nexport * from '@mk-kit/ui/forms';\nexport * from '@mk-kit/ui/datetime';\nexport * from '@mk-kit/ui/table';\nexport * from '@mk-kit/ui/data';\nexport * from '@mk-kit/ui/feedback';\nexport * from '@mk-kit/ui/rich-text';\nexport * from '@mk-kit/ui/block-editor';\nexport * from '@mk-kit/ui/context-menu';\nexport * from '@mk-kit/ui/layout';\nexport * from '@mk-kit/ui/chat';\nexport * from '@mk-kit/ui/query-builder';\nexport * from '@mk-kit/ui/dynamic-form';\nexport * from '@mk-kit/ui/media';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mk-kit-ui.mjs","sources":["../../../projects/mk-kit/src/public-api.ts","../../../projects/mk-kit/src/mk-kit-ui.ts"],"sourcesContent":["/*\n * Public API Surface of @mk-kit/ui.\n *\n * The library ships Material-style secondary entry points — import from the\n * group entries (`@mk-kit/ui/forms`, `@mk-kit/ui/table`, …) so a code-split\n * app only carries the groups each chunk uses. This root entry re-exports\n * everything for convenience; importing it eagerly pulls all groups into the\n * importing chunk.\n */\nexport * from '@mk-kit/ui/core';\nexport * from '@mk-kit/ui/icon';\nexport * from '@mk-kit/ui/icon/extended';\nexport * from '@mk-kit/ui/chip';\nexport * from '@mk-kit/ui/checkbox';\nexport * from '@mk-kit/ui/button';\nexport * from '@mk-kit/ui/directives';\nexport * from '@mk-kit/ui/dnd';\nexport * from '@mk-kit/ui/navigation';\nexport * from '@mk-kit/ui/forms';\nexport * from '@mk-kit/ui/datetime';\nexport * from '@mk-kit/ui/table';\nexport * from '@mk-kit/ui/data';\nexport * from '@mk-kit/ui/feedback';\nexport * from '@mk-kit/ui/rich-text';\nexport * from '@mk-kit/ui/block-editor';\nexport * from '@mk-kit/ui/context-menu';\nexport * from '@mk-kit/ui/layout';\nexport * from '@mk-kit/ui/chat';\nexport * from '@mk-kit/ui/query-builder';\nexport * from '@mk-kit/ui/dynamic-form';\nexport * from '@mk-kit/ui/media';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;AAQG;;ACRH;;AAEG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mk-kit/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -115,6 +115,10 @@
|
|
|
115
115
|
"types": "./types/mk-kit-ui-icon.d.ts",
|
|
116
116
|
"default": "./fesm2022/mk-kit-ui-icon.mjs"
|
|
117
117
|
},
|
|
118
|
+
"./icon/extended": {
|
|
119
|
+
"types": "./types/mk-kit-ui-icon-extended.d.ts",
|
|
120
|
+
"default": "./fesm2022/mk-kit-ui-icon-extended.mjs"
|
|
121
|
+
},
|
|
118
122
|
"./layout": {
|
|
119
123
|
"types": "./types/mk-kit-ui-layout.d.ts",
|
|
120
124
|
"default": "./fesm2022/mk-kit-ui-layout.mjs"
|
|
@@ -310,7 +310,10 @@ function renderReport(files, options) {
|
|
|
310
310
|
lines.push('## Files', '');
|
|
311
311
|
lines.push(...(changed.length ? changed.map((f) => `- \`${f.path}\` — ${f.findings.map((x) => `${x.rule}×${x.count}`).join(', ')}`) : ['- (none)']), '');
|
|
312
312
|
lines.push('## Next', '');
|
|
313
|
-
lines.push('1. Run `ng build` and fix the remaining template errors — most are the `<!-- mk-kit -->` notes above.', '2. Replace `MessageService.add(...)` calls with `MkToastService` and `ConfirmationService.confirm(...)` with `await MkDialogService.confirm(...)`.', '3. Icons: `pi pi-*` classes → `<mk-icon name="…" />` (see https://mk-kit.dev/components/icon).'
|
|
313
|
+
lines.push('1. Run `ng build` and fix the remaining template errors — most are the `<!-- mk-kit -->` notes above.', '2. Replace `MessageService.add(...)` calls with `MkToastService` and `ConfirmationService.confirm(...)` with `await MkDialogService.confirm(...)`.', '3. Icons: `pi pi-*` classes → `<mk-icon name="…" />` (see https://mk-kit.dev/components/icon). ' +
|
|
314
|
+
'Most PrimeIcons names live in the opt-in extended set — add `provideMkExtendedIcons()` ' +
|
|
315
|
+
"(from '@mk-kit/ui/icon/extended', ≈13 KiB) or a themed subset via `provideMkIcons()` to your providers; " +
|
|
316
|
+
'only the default set ships otherwise.', `4. Theme: \`--mk-*\` tokens replace the PrimeNG preset — https://mk-kit.dev/theming.`, '');
|
|
314
317
|
return lines.join('\n');
|
|
315
318
|
}
|
|
316
319
|
function group(list, withDocs = false) {
|
|
@@ -8,6 +8,9 @@ exports.ngAdd = ngAdd;
|
|
|
8
8
|
* in angular.json (physical path — exports maps don't apply there).
|
|
9
9
|
* - Optionally (`--i18n`) inserts a `provideMkI18n({})` override block into
|
|
10
10
|
* the application config via the CLI's standalone-app AST helpers.
|
|
11
|
+
* - Optionally (`--extended-icons`) inserts `provideMkExtendedIcons()` so the
|
|
12
|
+
* Lucide-derived icon set (≈13 KiB brotli, opt-in) is available to
|
|
13
|
+
* `<mk-icon name="…">`.
|
|
11
14
|
* - Prints a short getting-started note.
|
|
12
15
|
*/
|
|
13
16
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
@@ -28,7 +31,8 @@ function ngAdd(options) {
|
|
|
28
31
|
return (0, schematics_1.chain)([
|
|
29
32
|
addThemeStyles(projectName),
|
|
30
33
|
options.i18n ? addI18nProvider(projectName) : (0, schematics_1.noop)(),
|
|
31
|
-
|
|
34
|
+
options.extendedIcons ? addExtendedIconsProvider(projectName) : (0, schematics_1.noop)(),
|
|
35
|
+
logGettingStarted(options),
|
|
32
36
|
]);
|
|
33
37
|
};
|
|
34
38
|
}
|
|
@@ -101,12 +105,36 @@ function addI18nProvider(projectName) {
|
|
|
101
105
|
}
|
|
102
106
|
};
|
|
103
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Inserts `provideMkExtendedIcons()` into the application config so the
|
|
110
|
+
* opt-in Lucide-derived icon set resolves. Same graceful fallback as the i18n
|
|
111
|
+
* rule when the app is not a standard standalone app.
|
|
112
|
+
*/
|
|
113
|
+
function addExtendedIconsProvider(projectName) {
|
|
114
|
+
return async (tree, context) => {
|
|
115
|
+
const rule = (0, utility_1.addRootProvider)(projectName, ({ code, external }) => code `${external('provideMkExtendedIcons', '@mk-kit/ui/icon/extended')}()`);
|
|
116
|
+
try {
|
|
117
|
+
return await (0, rxjs_1.lastValueFrom)((0, schematics_1.callRule)(rule, tree, context));
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
context.logger.warn('Could not set up provideMkExtendedIcons automatically (the application config does not ' +
|
|
121
|
+
'match the standard standalone shape). To use the extended icon set, add it manually:');
|
|
122
|
+
context.logger.warn(` import { provideMkExtendedIcons } from '@mk-kit/ui/icon/extended';`);
|
|
123
|
+
context.logger.warn(' providers: [provideMkExtendedIcons()]');
|
|
124
|
+
return tree;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
}
|
|
104
128
|
/** Prints a short getting-started message at the end of a successful run. */
|
|
105
|
-
function logGettingStarted() {
|
|
129
|
+
function logGettingStarted(options) {
|
|
106
130
|
return (_tree, context) => {
|
|
107
131
|
context.logger.info('');
|
|
108
132
|
context.logger.info('@mk-kit/ui has been set up.');
|
|
109
133
|
context.logger.info(` - Theme stylesheet wired into angular.json (${THEME_STYLE_PATH}).`);
|
|
134
|
+
context.logger.info(options.extendedIcons
|
|
135
|
+
? ' - Extended icon set registered (provideMkExtendedIcons()).'
|
|
136
|
+
: ' - Only the default icon set is registered; for the 300+ extended (Lucide) names re-run with ' +
|
|
137
|
+
"--extended-icons or add provideMkExtendedIcons() from '@mk-kit/ui/icon/extended'.");
|
|
110
138
|
context.logger.info(" - Scaffold a dashboard layout with MkAppShell: import { MkAppShell } from '@mk-kit/ui/navigation';");
|
|
111
139
|
context.logger.info(` - Docs and examples: ${DOCS_URL}`);
|
|
112
140
|
};
|
|
@@ -16,6 +16,12 @@
|
|
|
16
16
|
"default": false,
|
|
17
17
|
"description": "Insert a provideMkI18n({}) override block into the application config so built-in strings can be localised.",
|
|
18
18
|
"x-prompt": "Set up a provideMkI18n override block?"
|
|
19
|
+
},
|
|
20
|
+
"extendedIcons": {
|
|
21
|
+
"type": "boolean",
|
|
22
|
+
"default": false,
|
|
23
|
+
"description": "Insert provideMkExtendedIcons() into the application config so the 300+ Lucide-derived icon names resolve (about 13 KiB brotli; only the default set ships otherwise).",
|
|
24
|
+
"x-prompt": "Register the extended (Lucide-derived) icon set? Adds provideMkExtendedIcons(), about 13 KiB."
|
|
19
25
|
}
|
|
20
26
|
},
|
|
21
27
|
"required": []
|
|
@@ -192,6 +192,8 @@ declare class MkBlockEditor implements ControlValueAccessor {
|
|
|
192
192
|
readonly htmlChange: _angular_core.OutputEmitterRef<string>;
|
|
193
193
|
protected readonly cvaDisabled: _angular_core.WritableSignal<boolean>;
|
|
194
194
|
/** Invalid visual, forced by the `invalid` input. */
|
|
195
|
+
/** Signal Forms: gates `invalid` until the bound field is touched or dirty. */
|
|
196
|
+
private readonly fieldTouched;
|
|
195
197
|
protected readonly isInvalid: _angular_core.Signal<boolean>;
|
|
196
198
|
private onChange;
|
|
197
199
|
private onTouched;
|
|
@@ -19,6 +19,8 @@ import { MkSize, MkTone } from '@mk-kit/ui/core';
|
|
|
19
19
|
*/
|
|
20
20
|
declare class MkCheckbox implements ControlValueAccessor, Validator {
|
|
21
21
|
private readonly field;
|
|
22
|
+
/** Signal Forms: gates `invalid` until the bound field is touched or dirty. */
|
|
23
|
+
private readonly fieldTouched;
|
|
22
24
|
/** Two-way checked state. */
|
|
23
25
|
readonly checked: _angular_core.ModelSignal<boolean>;
|
|
24
26
|
/** Two-way indeterminate ("mixed") state; cleared when the user toggles. */
|
|
@@ -980,6 +980,12 @@ interface MkI18nStrings {
|
|
|
980
980
|
logCopyAll: string;
|
|
981
981
|
/** Log viewer: soft-wrap toolbar toggle. */
|
|
982
982
|
logWrapLines: string;
|
|
983
|
+
/** Org chart: default accessible label of the tree. */
|
|
984
|
+
orgChartLabel: string;
|
|
985
|
+
/** Org chart: aria-label of a collapsed node's toggle (`{label}` = node label). */
|
|
986
|
+
orgChartExpand: string;
|
|
987
|
+
/** Org chart: aria-label of an expanded node's toggle (`{label}` = node label). */
|
|
988
|
+
orgChartCollapse: string;
|
|
983
989
|
/** Chat: accessible name of the message log. */
|
|
984
990
|
chatLabel: string;
|
|
985
991
|
/** Chat: accessible name of the composer textarea. */
|
|
@@ -1315,6 +1321,70 @@ type MkErrorMessages = Readonly<Record<string, string | ((err: any) => string)>>
|
|
|
1315
1321
|
*/
|
|
1316
1322
|
declare function mkFirstErrorMessage(errors: ValidationErrors | null | undefined, strings: MkValidationStrings, overrides?: MkErrorMessages): string | null;
|
|
1317
1323
|
|
|
1324
|
+
/**
|
|
1325
|
+
* The shape of a Signal Forms validation error as `mk-kit` reads it — the
|
|
1326
|
+
* `{ kind, message? }` contract of `ValidationError` from
|
|
1327
|
+
* `@angular/forms/signals`, plus whatever payload the error class carries
|
|
1328
|
+
* (`min`, `maxLength`, `pattern`, …). Declared structurally so `@mk-kit/ui/core`
|
|
1329
|
+
* stays free of a runtime dependency on the signals entry point.
|
|
1330
|
+
*/
|
|
1331
|
+
interface MkSignalValidationError {
|
|
1332
|
+
/** Identifies the kind of error (`'required'`, `'minLength'`, …). */
|
|
1333
|
+
readonly kind: string;
|
|
1334
|
+
/** Human-readable message, when the schema supplied one. */
|
|
1335
|
+
readonly message?: string;
|
|
1336
|
+
}
|
|
1337
|
+
/**
|
|
1338
|
+
* Converts Signal Forms errors to the reactive-forms `ValidationErrors` shape
|
|
1339
|
+
* the `validation` i18n table is keyed by, so both form systems render the
|
|
1340
|
+
* same messages. The built-in kinds map to Angular's classic keys and payloads
|
|
1341
|
+
* (`minLength` → `minlength: { requiredLength }`, `minDate` → `mkMinDate`,
|
|
1342
|
+
* …); any other kind is kept as-is with its payload spread into the value.
|
|
1343
|
+
*
|
|
1344
|
+
* @returns The error map in the order the errors were reported, or `null`
|
|
1345
|
+
* when the list is empty.
|
|
1346
|
+
*/
|
|
1347
|
+
declare function mkSignalErrorsToValidationErrors(errors: readonly MkSignalValidationError[] | null | undefined): ValidationErrors | null;
|
|
1348
|
+
/**
|
|
1349
|
+
* Resolves the message for the first Signal Forms error on a field, the way
|
|
1350
|
+
* `mkFirstErrorMessage` does for reactive forms.
|
|
1351
|
+
*
|
|
1352
|
+
* Lookup order: the field's `overrides` for that kind, then the `message` the
|
|
1353
|
+
* schema attached to the error (`required(p.email, { message: '…' })`), then
|
|
1354
|
+
* the i18n `validation` table, then the generic fallback.
|
|
1355
|
+
*
|
|
1356
|
+
* @returns The message, or `null` when there are no errors.
|
|
1357
|
+
*/
|
|
1358
|
+
declare function mkSignalErrorMessage(errors: readonly MkSignalValidationError[] | null | undefined, strings: MkValidationStrings, overrides?: MkErrorMessages): string | null;
|
|
1359
|
+
|
|
1360
|
+
/**
|
|
1361
|
+
* Touched-gate for a control's `invalid` input under Signal Forms.
|
|
1362
|
+
*
|
|
1363
|
+
* When a control is bound with the `[formField]` directive, Angular writes the
|
|
1364
|
+
* field's `invalid()` state straight into the control's `invalid` input — from
|
|
1365
|
+
* the first render, before the user has reached the field. mk-kit controls
|
|
1366
|
+
* pass that input through this gate so the invalid visual (and `aria-invalid`)
|
|
1367
|
+
* only shows once the field is touched or dirty, matching how `mk-form-field`
|
|
1368
|
+
* reveals its message and how `submit()` (which marks every field touched)
|
|
1369
|
+
* surfaces the remaining problems.
|
|
1370
|
+
*
|
|
1371
|
+
* Returns a signal that is always `true` for a control that is not bound with
|
|
1372
|
+
* `[formField]`, so a standalone `[invalid]="true"` keeps working as before.
|
|
1373
|
+
* Call it in a field initializer (an injection context):
|
|
1374
|
+
*
|
|
1375
|
+
* ```ts
|
|
1376
|
+
* private readonly fieldTouched = mkInjectFieldTouched();
|
|
1377
|
+
* protected readonly isInvalid = computed(
|
|
1378
|
+
* () => (this.invalid() && this.fieldTouched()) || (this.field?.hasError() ?? false),
|
|
1379
|
+
* );
|
|
1380
|
+
* ```
|
|
1381
|
+
*
|
|
1382
|
+
* The binding is looked up lazily, on first read: the `FormField` directive
|
|
1383
|
+
* itself injects the element's `NG_VALUE_ACCESSOR` (the control) while it is
|
|
1384
|
+
* created, so resolving it from the control's constructor would be circular.
|
|
1385
|
+
*/
|
|
1386
|
+
declare function mkInjectFieldTouched(): Signal<boolean>;
|
|
1387
|
+
|
|
1318
1388
|
/** Value kind of a filterable field; decides the editor and the operators offered. */
|
|
1319
1389
|
type MkQueryValueType = 'string' | 'number' | 'boolean' | 'date' | 'select';
|
|
1320
1390
|
/** A choice for `select` fields. */
|
|
@@ -1393,5 +1463,5 @@ declare function mkQueryOperatorLabel(op: MkQueryOperator, i18n?: MkI18nStrings)
|
|
|
1393
1463
|
*/
|
|
1394
1464
|
declare function mkQueryToText(group: MkQueryGroup, fields?: readonly MkQueryField[], i18n?: MkI18nStrings): string;
|
|
1395
1465
|
|
|
1396
|
-
export { MK_BREAKPOINTS, MK_DEFAULT_BREAKPOINTS, MK_DEFAULT_DATE_NAMES, MK_DEFAULT_I18N, MK_DEFAULT_VALIDATION, MK_I18N, MK_OVERLAY_DATA, MK_QUERY_OPERATORS, MK_QUERY_UNARY, MkAnchoredPanel, MkBreakpointService, MkFieldContext, MkFocusTrap, MkLiveAnnouncer, MkOverlayRef, MkOverlayService, MkThemeService, mkComputeAnchoredPosition, mkCreateQueryGroup, mkCreateQueryRule, mkFirstErrorMessage, mkGetFocusable, mkHighlight, mkHighlightJson, mkIsQueryGroup, mkIsResponsive, mkQueryCompact, mkQueryIsEmpty, mkQueryOperatorLabel, mkQueryOperatorsFor, mkQueryRuleCount, mkQueryRuleIsComplete, mkQueryRuleMatches, mkQueryToPredicate, mkQueryToText, mkUniqueId, mkValidatorChange, provideMkI18n };
|
|
1397
|
-
export type { MkAnchoredPosition, MkAnchoredPositionOptions, MkAriaLivePoliteness, MkBlockEditorStrings, MkBreakpoint, MkBreakpoints, MkCodeLanguage, MkContrastPreference, MkDateNames, MkDensity, MkErrorMessages, MkI18nStrings, MkOverlayConfig, MkPlacement, MkQueryCombinator, MkQueryField, MkQueryFieldOption, MkQueryGroup, MkQueryNode, MkQueryOperator, MkQueryRule, MkQueryValueType, MkResolvedContrast, MkResolvedTheme, MkResponsive, MkSize$1 as MkSize, MkSortAnnounceDirection, MkThemePreference, MkTone, MkValidationStrings, MkValidatorChangeRef, MkVariant };
|
|
1466
|
+
export { MK_BREAKPOINTS, MK_DEFAULT_BREAKPOINTS, MK_DEFAULT_DATE_NAMES, MK_DEFAULT_I18N, MK_DEFAULT_VALIDATION, MK_I18N, MK_OVERLAY_DATA, MK_QUERY_OPERATORS, MK_QUERY_UNARY, MkAnchoredPanel, MkBreakpointService, MkFieldContext, MkFocusTrap, MkLiveAnnouncer, MkOverlayRef, MkOverlayService, MkThemeService, mkComputeAnchoredPosition, mkCreateQueryGroup, mkCreateQueryRule, mkFirstErrorMessage, mkGetFocusable, mkHighlight, mkHighlightJson, mkInjectFieldTouched, mkIsQueryGroup, mkIsResponsive, mkQueryCompact, mkQueryIsEmpty, mkQueryOperatorLabel, mkQueryOperatorsFor, mkQueryRuleCount, mkQueryRuleIsComplete, mkQueryRuleMatches, mkQueryToPredicate, mkQueryToText, mkSignalErrorMessage, mkSignalErrorsToValidationErrors, mkUniqueId, mkValidatorChange, provideMkI18n };
|
|
1467
|
+
export type { MkAnchoredPosition, MkAnchoredPositionOptions, MkAriaLivePoliteness, MkBlockEditorStrings, MkBreakpoint, MkBreakpoints, MkCodeLanguage, MkContrastPreference, MkDateNames, MkDensity, MkErrorMessages, MkI18nStrings, MkOverlayConfig, MkPlacement, MkQueryCombinator, MkQueryField, MkQueryFieldOption, MkQueryGroup, MkQueryNode, MkQueryOperator, MkQueryRule, MkQueryValueType, MkResolvedContrast, MkResolvedTheme, MkResponsive, MkSignalValidationError, MkSize$1 as MkSize, MkSortAnnounceDirection, MkThemePreference, MkTone, MkValidationStrings, MkValidatorChangeRef, MkVariant };
|
|
@@ -385,6 +385,205 @@ declare class MkTimelineItem {
|
|
|
385
385
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkTimelineItem, "mk-timeline-item", never, { "tone": { "alias": "tone"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "time": { "alias": "time"; "required": false; "isSignal": true; }; "heading": { "alias": "heading"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
386
386
|
}
|
|
387
387
|
|
|
388
|
+
/** A node in an {@link MkOrgChart} tree. `children` makes it a parent. */
|
|
389
|
+
interface MkOrgChartNode<T = unknown> {
|
|
390
|
+
/** Unique id — drives selection (`[(selected)]`) and expansion (`[(expanded)]`). */
|
|
391
|
+
id: string;
|
|
392
|
+
/** Primary text of the default card (and the initials fallback). */
|
|
393
|
+
label?: string;
|
|
394
|
+
/**
|
|
395
|
+
* Arbitrary payload handed to the node template. The default card reads
|
|
396
|
+
* `data.title` (sub-label) and `data.avatar` (image URL) when present.
|
|
397
|
+
*/
|
|
398
|
+
data?: T;
|
|
399
|
+
/** Direct reports; a non-empty array makes the node collapsible. */
|
|
400
|
+
children?: MkOrgChartNode<T>[];
|
|
401
|
+
/** Initial expansion (default `true`). Only consulted when `[(expanded)]` is not bound. */
|
|
402
|
+
expanded?: boolean;
|
|
403
|
+
}
|
|
404
|
+
/** One row of a flat list accepted by {@link mkOrgChartFromFlat}. */
|
|
405
|
+
interface MkOrgChartFlatNode<T = unknown> {
|
|
406
|
+
id: string;
|
|
407
|
+
label?: string;
|
|
408
|
+
data?: T;
|
|
409
|
+
/** Id of the parent row; `null` / `undefined` / unknown id = root. */
|
|
410
|
+
parentId?: string | null;
|
|
411
|
+
expanded?: boolean;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Build the nested `nodes` input from a flat `parentId` list (the shape most
|
|
415
|
+
* HR / directory APIs return). Row order is preserved among siblings; rows
|
|
416
|
+
* whose `parentId` does not match any row become roots.
|
|
417
|
+
*
|
|
418
|
+
* ```ts
|
|
419
|
+
* const nodes = mkOrgChartFromFlat([
|
|
420
|
+
* { id: 'ceo', label: 'Ada' },
|
|
421
|
+
* { id: 'cto', label: 'Grace', parentId: 'ceo' },
|
|
422
|
+
* ]);
|
|
423
|
+
* ```
|
|
424
|
+
*/
|
|
425
|
+
declare function mkOrgChartFromFlat<T = unknown>(list: readonly MkOrgChartFlatNode<T>[]): MkOrgChartNode<T>[];
|
|
426
|
+
/**
|
|
427
|
+
* `data` type seen by a node template: `T` when it could be inferred (the
|
|
428
|
+
* template binds `[mkOrgChartNodeDef]="nodes"`), otherwise `any` so an
|
|
429
|
+
* untyped `<ng-template mkOrgChartNodeDef>` can still read `node.data?.title`.
|
|
430
|
+
*/
|
|
431
|
+
type MkOrgChartTemplateData<T> = keyof T extends never ? any : T;
|
|
432
|
+
/** Template context of `ng-template[mkOrgChartNodeDef]`. */
|
|
433
|
+
interface MkOrgChartNodeContext<T = unknown> {
|
|
434
|
+
/** The node (also available as `let-node`). */
|
|
435
|
+
$implicit: MkOrgChartNode<MkOrgChartTemplateData<T>>;
|
|
436
|
+
node: MkOrgChartNode<MkOrgChartTemplateData<T>>;
|
|
437
|
+
/** 1-based depth (roots are 1). */
|
|
438
|
+
depth: number;
|
|
439
|
+
/** Whether the node's children are currently shown. */
|
|
440
|
+
expanded: boolean;
|
|
441
|
+
/** Whether the node is the selected one. */
|
|
442
|
+
selected: boolean;
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Custom node card for `mk-org-chart`:
|
|
446
|
+
*
|
|
447
|
+
* ```html
|
|
448
|
+
* <mk-org-chart [nodes]="nodes">
|
|
449
|
+
* <ng-template mkOrgChartNodeDef let-node let-selected="selected">
|
|
450
|
+
* <strong>{{ node.label }}</strong> — {{ node.data?.title }}
|
|
451
|
+
* </ng-template>
|
|
452
|
+
* </mk-org-chart>
|
|
453
|
+
* ```
|
|
454
|
+
*
|
|
455
|
+
* Bind the same array you pass to `nodes` to get a typed `node.data` in the
|
|
456
|
+
* template: `<ng-template [mkOrgChartNodeDef]="nodes" let-node>`.
|
|
457
|
+
*/
|
|
458
|
+
declare class MkOrgChartNodeDef<T = unknown> {
|
|
459
|
+
/**
|
|
460
|
+
* Type-inference hook only (the value is not used at runtime): bind the
|
|
461
|
+
* `nodes` array so `let-node` is typed as `MkOrgChartNode<T>`.
|
|
462
|
+
*/
|
|
463
|
+
readonly mkOrgChartNodeDef: _angular_core.InputSignal<"" | readonly MkOrgChartNode<T>[] | undefined>;
|
|
464
|
+
readonly template: TemplateRef<any>;
|
|
465
|
+
static ngTemplateContextGuard<T>(_dir: MkOrgChartNodeDef<T>, ctx: unknown): ctx is MkOrgChartNodeContext<T>;
|
|
466
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkOrgChartNodeDef<any>, never>;
|
|
467
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MkOrgChartNodeDef<any>, "ng-template[mkOrgChartNodeDef]", never, { "mkOrgChartNodeDef": { "alias": "mkOrgChartNodeDef"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
468
|
+
}
|
|
469
|
+
/** Chart direction: `top` = root at the top, `left` = root at the inline start. */
|
|
470
|
+
type MkOrgChartOrientation = 'top' | 'left';
|
|
471
|
+
/** Payload of `(nodeToggle)`. */
|
|
472
|
+
interface MkOrgChartToggleEvent<T = unknown> {
|
|
473
|
+
node: MkOrgChartNode<T>;
|
|
474
|
+
expanded: boolean;
|
|
475
|
+
}
|
|
476
|
+
/** One visible node after flattening (pre-order, i.e. DOM order). */
|
|
477
|
+
interface MkOrgChartRow {
|
|
478
|
+
node: MkOrgChartNode;
|
|
479
|
+
depth: number;
|
|
480
|
+
parentId: string | null;
|
|
481
|
+
/** Ids of the sibling set this row belongs to (in order). */
|
|
482
|
+
siblings: readonly string[];
|
|
483
|
+
hasChildren: boolean;
|
|
484
|
+
expanded: boolean;
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Organisation chart — a reporting-line hierarchy drawn with plain nested
|
|
488
|
+
* lists and CSS connectors (no canvas, prints and themes like everything
|
|
489
|
+
* else). Feed it a tree (`nodes`) or convert a flat `parentId` list with
|
|
490
|
+
* {@link mkOrgChartFromFlat}. Nodes render as a default card (avatar /
|
|
491
|
+
* initials, label, `data.title`) or through an `mkOrgChartNodeDef` template.
|
|
492
|
+
*
|
|
493
|
+
* Follows the ARIA tree pattern (`role="tree"` / `treeitem` / `group`, one
|
|
494
|
+
* roving tab stop). Keyboard (top-down; the axes swap for `orientation="left"`
|
|
495
|
+
* and in RTL): Down = first child (expands a collapsed node first), Up =
|
|
496
|
+
* parent, Left/Right = previous/next sibling, Home/End = first/last visible
|
|
497
|
+
* node, Enter/Space = select (or toggle when not selectable), `*` = expand
|
|
498
|
+
* all siblings, `+`/`-` = expand/collapse.
|
|
499
|
+
*
|
|
500
|
+
* ```html
|
|
501
|
+
* <mk-org-chart
|
|
502
|
+
* [nodes]="company"
|
|
503
|
+
* selectable
|
|
504
|
+
* [(selected)]="personId"
|
|
505
|
+
* collapsible
|
|
506
|
+
* (nodeClick)="open($event)"
|
|
507
|
+
* />
|
|
508
|
+
* ```
|
|
509
|
+
*/
|
|
510
|
+
declare class MkOrgChart<T = unknown> {
|
|
511
|
+
private readonly host;
|
|
512
|
+
private readonly document;
|
|
513
|
+
/** Localised strings (override globally via `provideMkI18n`). */
|
|
514
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
515
|
+
/** The hierarchy to render (roots first). */
|
|
516
|
+
readonly nodes: _angular_core.InputSignal<readonly MkOrgChartNode<T>[]>;
|
|
517
|
+
/** Root at the top (children below) or at the inline start (children to the side). */
|
|
518
|
+
readonly orientation: _angular_core.InputSignal<MkOrgChartOrientation>;
|
|
519
|
+
/** Allow choosing a node (adds selection styling + `aria-selected`). */
|
|
520
|
+
readonly selectable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
521
|
+
/** Show a toggle on every parent so branches can be hidden. */
|
|
522
|
+
readonly collapsible: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
523
|
+
/** Scale factor applied to the whole chart (clamped to 0.5–2). */
|
|
524
|
+
readonly zoom: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
525
|
+
/** Accessible name for the tree. */
|
|
526
|
+
readonly ariaLabel: _angular_core.InputSignal<string>;
|
|
527
|
+
/** Two-way selected node id (`null` = nothing selected). */
|
|
528
|
+
readonly selected: _angular_core.ModelSignal<string | null>;
|
|
529
|
+
/**
|
|
530
|
+
* Two-way ids of the expanded parents. Leave unbound to let the chart
|
|
531
|
+
* manage expansion itself (seeded from each node's `expanded` flag).
|
|
532
|
+
*/
|
|
533
|
+
readonly expanded: _angular_core.ModelSignal<readonly string[] | undefined>;
|
|
534
|
+
/** Emits the node whose card was clicked or activated with Enter/Space. */
|
|
535
|
+
readonly nodeClick: _angular_core.OutputEmitterRef<MkOrgChartNode<T>>;
|
|
536
|
+
/** Emits whenever a node is expanded or collapsed. */
|
|
537
|
+
readonly nodeToggle: _angular_core.OutputEmitterRef<MkOrgChartToggleEvent<T>>;
|
|
538
|
+
protected readonly nodeDef: _angular_core.Signal<MkOrgChartNodeDef<T> | undefined>;
|
|
539
|
+
protected readonly zoomLevel: _angular_core.Signal<number>;
|
|
540
|
+
/**
|
|
541
|
+
* Expanded parent ids. Controlled by `expanded` when bound; otherwise kept
|
|
542
|
+
* locally — a node's `expanded` flag only seeds ids not present in the
|
|
543
|
+
* previous `nodes` value, so re-emitting the array never reverts branches
|
|
544
|
+
* the user has since toggled.
|
|
545
|
+
*/
|
|
546
|
+
private readonly expandedIds;
|
|
547
|
+
/** Id of the node holding the roving tab stop. */
|
|
548
|
+
private readonly activeId;
|
|
549
|
+
/** Visible nodes in DOM (pre-order) order. */
|
|
550
|
+
protected readonly rows: _angular_core.Signal<MkOrgChartRow[]>;
|
|
551
|
+
private readonly rowById;
|
|
552
|
+
/** The single id with `tabindex="0"` (falls back to the first visible node). */
|
|
553
|
+
private readonly tabStopId;
|
|
554
|
+
protected isExpanded(node: MkOrgChartNode<T>): boolean;
|
|
555
|
+
protected isSelected(node: MkOrgChartNode<T>): boolean;
|
|
556
|
+
protected tabIndexFor(node: MkOrgChartNode<T>): number;
|
|
557
|
+
protected toggleLabel(node: MkOrgChartNode<T>): string;
|
|
558
|
+
protected context(node: MkOrgChartNode<T>, depth: number): MkOrgChartNodeContext<T>;
|
|
559
|
+
/** `data.title` / `data.avatar` of the default card, read defensively. */
|
|
560
|
+
protected field(node: MkOrgChartNode<T>, key: 'title' | 'avatar'): string | undefined;
|
|
561
|
+
/** Expand or collapse a parent (no-op for leaves / non-collapsible charts). */
|
|
562
|
+
toggle(node: MkOrgChartNode<T>): void;
|
|
563
|
+
/** Expand or collapse a parent explicitly. */
|
|
564
|
+
setExpanded(node: MkOrgChartNode<T>, expanded: boolean): void;
|
|
565
|
+
/** Select a node by reference (no-op unless `selectable`). */
|
|
566
|
+
select(node: MkOrgChartNode<T>): void;
|
|
567
|
+
private activate;
|
|
568
|
+
protected onCardClick(event: Event, node: MkOrgChartNode<T>): void;
|
|
569
|
+
protected onToggleClick(event: Event, node: MkOrgChartNode<T>): void;
|
|
570
|
+
/** Keeps the roving tab stop on whichever item last received focus. */
|
|
571
|
+
protected onFocusIn(event: Event): void;
|
|
572
|
+
protected onKeydown(event: Event): void;
|
|
573
|
+
/**
|
|
574
|
+
* Map an arrow key to a tree direction. Top-down: Down = into, Up = parent,
|
|
575
|
+
* Left/Right = siblings (mirrored in RTL). Left-to-right: Right = into,
|
|
576
|
+
* Left = parent (mirrored in RTL), Up/Down = siblings.
|
|
577
|
+
*/
|
|
578
|
+
private intentOf;
|
|
579
|
+
private siblingsOf;
|
|
580
|
+
private isRtl;
|
|
581
|
+
private itemIdOf;
|
|
582
|
+
private focusItem;
|
|
583
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkOrgChart<any>, never>;
|
|
584
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkOrgChart<any>, "mk-org-chart", ["mkOrgChart"], { "nodes": { "alias": "nodes"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "zoom": { "alias": "zoom"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; }, { "selected": "selectedChange"; "expanded": "expandedChange"; "nodeClick": "nodeClick"; "nodeToggle": "nodeToggle"; }, ["nodeDef"], never, true, never>;
|
|
585
|
+
}
|
|
586
|
+
|
|
388
587
|
/** Direction of a {@link MkStatCard} delta. */
|
|
389
588
|
type MkStatTrend = 'up' | 'down' | 'neutral';
|
|
390
589
|
/**
|
|
@@ -1819,6 +2018,8 @@ declare class MkSkeletonPreset {
|
|
|
1819
2018
|
declare class MkInlineEdit implements ControlValueAccessor {
|
|
1820
2019
|
private readonly injector;
|
|
1821
2020
|
private readonly field;
|
|
2021
|
+
/** Signal Forms: gates `invalid` until the bound field is touched or dirty. */
|
|
2022
|
+
private readonly fieldTouched;
|
|
1822
2023
|
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
1823
2024
|
private readonly displayRef;
|
|
1824
2025
|
private readonly inputRef;
|
|
@@ -2777,5 +2978,5 @@ declare function mkParseMarkdown(src: string, options?: MkMarkdownParseOptions):
|
|
|
2777
2978
|
*/
|
|
2778
2979
|
declare function mkRenderMarkdown(blocks: MkMarkdownBlock[], options?: MkMarkdownRenderOptions): string;
|
|
2779
2980
|
|
|
2780
|
-
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, 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, mkParseAnsi, mkParseMarkdown, mkParseRgb, mkRelativeLuminance, mkRenderMarkdown, mkSplitDuration, mkSquarify, mkStripAnsi };
|
|
2781
|
-
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, MkPoint, MkProfileCardOrientation, MkQrEcc, MkRgb, MkScatterPoint, MkScatterSeries, MkSkeletonPresetKind, MkSkeletonShape, MkSparklineType, MkStatTrend, MkTagVariant, MkTreemapItem, MkTreemapRect };
|
|
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 };
|