@akcelik/strct 5.21.0 → 5.23.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/fesm2022/akcelik-strct.mjs +308 -65
- package/fesm2022/akcelik-strct.mjs.map +1 -1
- package/package.json +1 -1
- package/types/akcelik-strct.d.ts +67 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akcelik/strct",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.23.0",
|
|
4
4
|
"description": "UIStruct — a standalone Angular component library with a tokenised, multi-palette theme system, built for datacenter / infrastructure management UIs.",
|
|
5
5
|
"author": "Serkan Akcelik <serkan.akcelik@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
package/types/akcelik-strct.d.ts
CHANGED
|
@@ -1579,6 +1579,25 @@ interface StrctTreeNodeData {
|
|
|
1579
1579
|
/** Initial expanded state. */
|
|
1580
1580
|
expanded?: boolean;
|
|
1581
1581
|
children?: StrctTreeNodeData[];
|
|
1582
|
+
/**
|
|
1583
|
+
* A quiet trailing word on the row — what `[strctTreeTrailing]` is for a
|
|
1584
|
+
* projected node: "VM" on a virtual machine's own folder.
|
|
1585
|
+
*/
|
|
1586
|
+
meta?: string;
|
|
1587
|
+
/** A trailing tag instead of (or beside) `meta`. */
|
|
1588
|
+
tag?: {
|
|
1589
|
+
label: string;
|
|
1590
|
+
status?: StrctBadgeStatus;
|
|
1591
|
+
};
|
|
1592
|
+
/**
|
|
1593
|
+
* "It has children, they have not been read yet": the chevron and
|
|
1594
|
+
* `aria-expanded` appear before `children` arrives, and expanding emits
|
|
1595
|
+
* `(nodeToggled)` as usual. A node that turns out to be empty loses its
|
|
1596
|
+
* chevron when `children` arrives as `[]`.
|
|
1597
|
+
*/
|
|
1598
|
+
hasChildren?: boolean;
|
|
1599
|
+
/** Its children are being read: a quiet row under it, and `aria-busy`. */
|
|
1600
|
+
loading?: boolean;
|
|
1582
1601
|
/** Arbitrary payload returned with (nodeActivated). */
|
|
1583
1602
|
data?: unknown;
|
|
1584
1603
|
}
|
|
@@ -1680,6 +1699,8 @@ declare class StrctTreeNode {
|
|
|
1680
1699
|
rowEl(): HTMLElement | null;
|
|
1681
1700
|
/** Roving tabindex: inside a tree only the active row is tabbable. */
|
|
1682
1701
|
protected readonly rowTabindex: _angular_core.Signal<0 | -1>;
|
|
1702
|
+
/** Wording of the "children are being read" row (from the owning tree). */
|
|
1703
|
+
protected readonly loadingLabel: _angular_core.Signal<string>;
|
|
1683
1704
|
/** Accessible label of the chevron toggle (factory from the owning tree). */
|
|
1684
1705
|
protected readonly chevronAriaLabel: _angular_core.Signal<string>;
|
|
1685
1706
|
protected onRowFocus(): void;
|
|
@@ -1732,6 +1753,8 @@ declare class StrctTree {
|
|
|
1732
1753
|
readonly dragExpandDelay: _angular_core.InputSignal<number>;
|
|
1733
1754
|
/** Emitted for an accepted drop only. */
|
|
1734
1755
|
readonly nodeDrop: _angular_core.OutputEmitterRef<StrctTreeDropEvent>;
|
|
1756
|
+
/** Wording of the row shown under a node whose children are being read (`node.loading`). */
|
|
1757
|
+
readonly loadingLabel: _angular_core.InputSignal<string>;
|
|
1735
1758
|
/** Accessible label of each node's chevron toggle; receives the expanded state and the node label. */
|
|
1736
1759
|
readonly chevronAriaLabel: _angular_core.InputSignal<(expanded: boolean, label: string) => string>;
|
|
1737
1760
|
/** Emitted when any data-driven node is clicked. */
|
|
@@ -1829,7 +1852,7 @@ declare class StrctTree {
|
|
|
1829
1852
|
/** Toggle a node's expansion, updating state and emitting outputs. */
|
|
1830
1853
|
toggleNode(node: StrctTreeNodeData): void;
|
|
1831
1854
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctTree, never>;
|
|
1832
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctTree, "strct-tree", never, { "nodes": { "alias": "nodes"; "required": false; "isSignal": true; }; "density": { "alias": "density"; "required": false; "isSignal": true; }; "framed": { "alias": "framed"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "nodeMenu": { "alias": "nodeMenu"; "required": false; "isSignal": true; }; "canDrag": { "alias": "canDrag"; "required": false; "isSignal": true; }; "canDrop": { "alias": "canDrop"; "required": false; "isSignal": true; }; "dragExpandDelay": { "alias": "dragExpandDelay"; "required": false; "isSignal": true; }; "chevronAriaLabel": { "alias": "chevronAriaLabel"; "required": false; "isSignal": true; }; "expandedIds": { "alias": "expandedIds"; "required": false; "isSignal": true; }; }, { "nodeDrop": "nodeDrop"; "nodeActivated": "nodeActivated"; "nodeMenuSelect": "nodeMenuSelect"; "expandedIds": "expandedIdsChange"; "expandedChange": "expandedChange"; "nodeToggled": "nodeToggled"; }, ["projectedNodes"], ["*"], true, never>;
|
|
1855
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctTree, "strct-tree", never, { "nodes": { "alias": "nodes"; "required": false; "isSignal": true; }; "density": { "alias": "density"; "required": false; "isSignal": true; }; "framed": { "alias": "framed"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "nodeMenu": { "alias": "nodeMenu"; "required": false; "isSignal": true; }; "canDrag": { "alias": "canDrag"; "required": false; "isSignal": true; }; "canDrop": { "alias": "canDrop"; "required": false; "isSignal": true; }; "dragExpandDelay": { "alias": "dragExpandDelay"; "required": false; "isSignal": true; }; "loadingLabel": { "alias": "loadingLabel"; "required": false; "isSignal": true; }; "chevronAriaLabel": { "alias": "chevronAriaLabel"; "required": false; "isSignal": true; }; "expandedIds": { "alias": "expandedIds"; "required": false; "isSignal": true; }; }, { "nodeDrop": "nodeDrop"; "nodeActivated": "nodeActivated"; "nodeMenuSelect": "nodeMenuSelect"; "expandedIds": "expandedIdsChange"; "expandedChange": "expandedChange"; "nodeToggled": "nodeToggled"; }, ["projectedNodes"], ["*"], true, never>;
|
|
1833
1856
|
}
|
|
1834
1857
|
|
|
1835
1858
|
/** Fixed modal width presets: sm 480 · md 640 · lg 860 · xl 1080 (px). */
|
|
@@ -2711,6 +2734,11 @@ declare class StrctSearchbox implements ControlValueAccessor {
|
|
|
2711
2734
|
protected onTouched: () => void;
|
|
2712
2735
|
protected onInput(event: Event): void;
|
|
2713
2736
|
/** Clear the text (Escape / the × button). */
|
|
2737
|
+
/**
|
|
2738
|
+
* An Escape that clears a value is used: a modal around this box takes an
|
|
2739
|
+
* unhandled Escape as "close me", and the same keystroke did both.
|
|
2740
|
+
*/
|
|
2741
|
+
protected onEscape(event: Event): void;
|
|
2714
2742
|
clear(): void;
|
|
2715
2743
|
/** Focus the input programmatically (e.g. from a global shortcut). */
|
|
2716
2744
|
focus(): void;
|
|
@@ -8415,6 +8443,13 @@ declare const STRCT_MD_LIMITS: {
|
|
|
8415
8443
|
readonly depth: 8;
|
|
8416
8444
|
/** Inline delimiter runs considered per text span. */
|
|
8417
8445
|
readonly delimiters: 2000;
|
|
8446
|
+
/**
|
|
8447
|
+
* How far a closing delimiter or bracket is looked for. Without it every
|
|
8448
|
+
* unmatched opener scanned to the end of the document, once each: a 64 KiB
|
|
8449
|
+
* line of "*a " took 1.6 s to read, and a streamed reply is read again on
|
|
8450
|
+
* every token.
|
|
8451
|
+
*/
|
|
8452
|
+
readonly scan: 4096;
|
|
8418
8453
|
};
|
|
8419
8454
|
type StrctMdAlign = 'start' | 'center' | 'end' | null;
|
|
8420
8455
|
type StrctMdInline = {
|
|
@@ -8496,6 +8531,7 @@ type StrctMdTokenizer = (text: string) => StrctMdToken[];
|
|
|
8496
8531
|
declare function strctParseMarkdown(source: string, options?: {
|
|
8497
8532
|
streaming?: boolean;
|
|
8498
8533
|
tokenize?: StrctMdTokenizer;
|
|
8534
|
+
breaks?: boolean;
|
|
8499
8535
|
}): StrctMdBlock[];
|
|
8500
8536
|
/**
|
|
8501
8537
|
* Inline reading. Code spans win over everything (their content is literal),
|
|
@@ -8503,13 +8539,16 @@ declare function strctParseMarkdown(source: string, options?: {
|
|
|
8503
8539
|
*/
|
|
8504
8540
|
declare function parseInlines(source: string, options?: {
|
|
8505
8541
|
tokenize?: StrctMdTokenizer;
|
|
8542
|
+
breaks?: boolean;
|
|
8506
8543
|
}): StrctMdInline[];
|
|
8507
8544
|
/**
|
|
8508
8545
|
* What a link may do. Anything that is not plainly safe stays the text the
|
|
8509
8546
|
* model wrote: `javascript:`, `data:`, a protocol-relative `//host`, or
|
|
8510
8547
|
* anything this does not recognise.
|
|
8511
8548
|
*/
|
|
8512
|
-
declare function strctClassifyHref(href: string
|
|
8549
|
+
declare function strctClassifyHref(href: string, options?: {
|
|
8550
|
+
mailto?: boolean;
|
|
8551
|
+
}): 'external' | 'internal' | null;
|
|
8513
8552
|
|
|
8514
8553
|
/**
|
|
8515
8554
|
* A template for a span the consumer claimed through `tokens`, keyed by the
|
|
@@ -8569,9 +8608,25 @@ declare class StrctMarkdown {
|
|
|
8569
8608
|
readonly linkPolicy: _angular_core.InputSignal<((href: string) => "external" | "internal" | null) | null>;
|
|
8570
8609
|
/** Claim runs of plain text — an inventory id becomes an object chip. */
|
|
8571
8610
|
readonly tokens: _angular_core.InputSignal<StrctMdTokenizer | null>;
|
|
8611
|
+
/**
|
|
8612
|
+
* A single newline is a line break, the way a comment box reads: a model
|
|
8613
|
+
* writing "Host: X\nCPU: 40 %" means two lines. Off by default, which is
|
|
8614
|
+
* CommonMark.
|
|
8615
|
+
*/
|
|
8616
|
+
readonly breaks: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
8617
|
+
/** What a screen reader hears after an external link (localisable). */
|
|
8618
|
+
readonly newTabLabel: _angular_core.InputSignal<string>;
|
|
8619
|
+
/**
|
|
8620
|
+
* The token templates of the view that nested this one. A list item or a
|
|
8621
|
+
* quote is drawn by a nested view, which has no projected content of its
|
|
8622
|
+
* own — without this its claimed runs fall back to plain text.
|
|
8623
|
+
*/
|
|
8624
|
+
readonly inheritedTokens: _angular_core.InputSignal<readonly StrctMarkdownToken[]>;
|
|
8572
8625
|
/** An in-app link was followed; the consumer routes it. */
|
|
8573
8626
|
readonly navigate: _angular_core.OutputEmitterRef<string>;
|
|
8574
|
-
private readonly
|
|
8627
|
+
private readonly ownTokenDefs;
|
|
8628
|
+
/** This view's own templates, plus the ones handed down to it. */
|
|
8629
|
+
protected readonly allTokenDefs: _angular_core.Signal<readonly StrctMarkdownToken[]>;
|
|
8575
8630
|
protected readonly blocks: _angular_core.Signal<StrctMdBlock[]>;
|
|
8576
8631
|
protected level(level: number): number;
|
|
8577
8632
|
protected hrefKind(href: string): 'external' | 'internal' | null;
|
|
@@ -8580,7 +8635,7 @@ declare class StrctMarkdown {
|
|
|
8580
8635
|
protected caretOn(index: number): boolean;
|
|
8581
8636
|
protected onInternal(event: Event, href: string): void;
|
|
8582
8637
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctMarkdown, never>;
|
|
8583
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctMarkdown, "strct-markdown", never, { "source": { "alias": "source"; "required": false; "isSignal": true; }; "tree": { "alias": "tree"; "required": false; "isSignal": true; }; "streaming": { "alias": "streaming"; "required": false; "isSignal": true; }; "headingOffset": { "alias": "headingOffset"; "required": false; "isSignal": true; }; "linkPolicy": { "alias": "linkPolicy"; "required": false; "isSignal": true; }; "tokens": { "alias": "tokens"; "required": false; "isSignal": true; }; }, { "navigate": "navigate"; }, ["
|
|
8638
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctMarkdown, "strct-markdown", never, { "source": { "alias": "source"; "required": false; "isSignal": true; }; "tree": { "alias": "tree"; "required": false; "isSignal": true; }; "streaming": { "alias": "streaming"; "required": false; "isSignal": true; }; "headingOffset": { "alias": "headingOffset"; "required": false; "isSignal": true; }; "linkPolicy": { "alias": "linkPolicy"; "required": false; "isSignal": true; }; "tokens": { "alias": "tokens"; "required": false; "isSignal": true; }; "breaks": { "alias": "breaks"; "required": false; "isSignal": true; }; "newTabLabel": { "alias": "newTabLabel"; "required": false; "isSignal": true; }; "inheritedTokens": { "alias": "inheritedTokens"; "required": false; "isSignal": true; }; }, { "navigate": "navigate"; }, ["ownTokenDefs"], never, true, never>;
|
|
8584
8639
|
}
|
|
8585
8640
|
|
|
8586
8641
|
/** One product (or platform) a person may switch to. */
|
|
@@ -8603,8 +8658,15 @@ interface StrctProductItem {
|
|
|
8603
8658
|
description?: string;
|
|
8604
8659
|
/** The dot beside that line. */
|
|
8605
8660
|
status?: StrctStatus;
|
|
8606
|
-
/** The product's own colour (a token or value): the
|
|
8661
|
+
/** The product's own colour (a token or value): the row's icon takes it. */
|
|
8607
8662
|
tone?: string;
|
|
8663
|
+
/**
|
|
8664
|
+
* The chip's own shade. The chip sits on `--hdr`, which is dark in every
|
|
8665
|
+
* scheme, and the menu rows on `--bg-1`: one colour measured 2.45–2.93 : 1
|
|
8666
|
+
* on one of the two, under the 3 : 1 a graphical object owes. Falls back to
|
|
8667
|
+
* `tone`.
|
|
8668
|
+
*/
|
|
8669
|
+
headerTone?: string;
|
|
8608
8670
|
/** Render the row as a real router link (middle-click, a new tab). */
|
|
8609
8671
|
routerLink?: string | unknown[];
|
|
8610
8672
|
/** Render the row as a plain link. */
|