@mintplayer/ng-bootstrap 22.16.0 → 22.18.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 CHANGED
@@ -5,3 +5,18 @@ This library was generated with [Nx](https://nx.dev).
5
5
  ## Running unit tests
6
6
 
7
7
  Run `nx test mintplayer-ng-bootstrap` to execute the unit tests.
8
+
9
+ ## Styling and encapsulation
10
+
11
+ Most components keep a shadow root and take your content through native slots, so your stylesheets
12
+ reach that content normally.
13
+
14
+ ``bs-datatable`, `bs-treeview`, `bs-tree-select` and `bs-query-builder`` mount DOM you author (row / node templates, cell renderers,
15
+ editor factories) and therefore render in the **light DOM**, with their own CSS scoped at build time
16
+ onto a `data-mps` attribute — the same device Angular uses for `_ngcontent`. Your styles and
17
+ Bootstrap's utilities reach anything you render into them; in exchange, page CSS also reaches their
18
+ internals, exactly as emulated encapsulation behaves elsewhere. `::part()` and `::slotted()` no
19
+ longer address them.
20
+
21
+ See **Styling and encapsulation** in the [workspace README](../../README.md) for the full contract
22
+ and the migration table.
@@ -2,9 +2,16 @@ import * as i0 from '@angular/core';
2
2
  import { Pipe } from '@angular/core';
3
3
 
4
4
  class BsLinifyPipe {
5
+ /**
6
+ * Splits text into lines, normalizing CRLF first.
7
+ *
8
+ * The `/g` flag is load-bearing: without it only the FIRST CRLF was rewritten
9
+ * and every later line of Windows-authored text kept a trailing `\r`, which
10
+ * then rode along into whatever the consumer rendered or compared.
11
+ */
5
12
  transform(value, removeEmptyEntries = true) {
6
13
  const split = value
7
- .replace('\r\n', '\n')
14
+ .replace(/\r\n/g, '\n')
8
15
  .split('\n');
9
16
  return removeEmptyEntries
10
17
  ? split.filter((line) => line !== '')
@@ -1 +1 @@
1
- {"version":3,"file":"mintplayer-ng-bootstrap-linify.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/linify/src/linify.pipe.ts","../../../../libs/mintplayer-ng-bootstrap/linify/mintplayer-ng-bootstrap-linify.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'bsLinify',\n})\nexport class BsLinifyPipe implements PipeTransform {\n transform(value: string, removeEmptyEntries = true) {\n const split = value\n .replace('\\r\\n', '\\n')\n .split('\\n');\n\n return removeEmptyEntries\n ? split.filter((line) => line !== '')\n : split;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAKa,YAAY,CAAA;AACvB,IAAA,SAAS,CAAC,KAAa,EAAE,kBAAkB,GAAG,IAAI,EAAA;QAChD,MAAM,KAAK,GAAG;AACX,aAAA,OAAO,CAAC,MAAM,EAAE,IAAI;aACpB,KAAK,CAAC,IAAI,CAAC;AAEd,QAAA,OAAO;AACL,cAAE,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,KAAK,EAAE;cAClC,KAAK;IACX;8GATW,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAAZ,YAAY,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA,CAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBAHxB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,UAAU;AACjB,iBAAA;;;ACJD;;AAEG;;;;"}
1
+ {"version":3,"file":"mintplayer-ng-bootstrap-linify.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/linify/src/linify.pipe.ts","../../../../libs/mintplayer-ng-bootstrap/linify/mintplayer-ng-bootstrap-linify.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'bsLinify',\n})\nexport class BsLinifyPipe implements PipeTransform {\n /**\n * Splits text into lines, normalizing CRLF first.\n *\n * The `/g` flag is load-bearing: without it only the FIRST CRLF was rewritten\n * and every later line of Windows-authored text kept a trailing `\\r`, which\n * then rode along into whatever the consumer rendered or compared.\n */\n transform(value: string, removeEmptyEntries = true) {\n const split = value\n .replace(/\\r\\n/g, '\\n')\n .split('\\n');\n\n return removeEmptyEntries\n ? split.filter((line) => line !== '')\n : split;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAKa,YAAY,CAAA;AACvB;;;;;;AAMG;AACH,IAAA,SAAS,CAAC,KAAa,EAAE,kBAAkB,GAAG,IAAI,EAAA;QAChD,MAAM,KAAK,GAAG;AACX,aAAA,OAAO,CAAC,OAAO,EAAE,IAAI;aACrB,KAAK,CAAC,IAAI,CAAC;AAEd,QAAA,OAAO;AACL,cAAE,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,KAAK,EAAE;cAClC,KAAK;IACX;8GAhBW,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAAZ,YAAY,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA,CAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBAHxB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,UAAU;AACjB,iBAAA;;;ACJD;;AAEG;;;;"}
@@ -2,12 +2,22 @@ import * as i0 from '@angular/core';
2
2
  import { Pipe } from '@angular/core';
3
3
 
4
4
  class BsSlugifyPipe {
5
+ /**
6
+ * Turns a title into a URL slug.
7
+ *
8
+ * Latin text is still decomposed and stripped of diacritics, so `Crème` stays
9
+ * `creme` and existing slugs are unchanged. What changed is the character
10
+ * class: it keeps letters and numbers in ANY script (`\p{L}\p{N}`) instead of
11
+ * ASCII `\w`. The old class removed every character of a script with no Latin
12
+ * decomposition, so a non-Latin title slugified to the empty string — a route
13
+ * segment that cannot work rather than one that merely looks unfamiliar.
14
+ */
5
15
  transform(value) {
6
16
  return value.toString().toLowerCase()
7
17
  .replace(/\s+/g, '-') // Replace spaces with -
8
18
  .normalize("NFD").replace(/[\u0300-\u036f]/g, "") // Remove diacritics
9
- .replace(/[^\w\-]+/g, '') // Remove all non-word chars
10
- .replace(/\-\-+/g, '-') // Replace multiple - with single -
19
+ .replace(/[^\p{L}\p{N}_-]+/gu, '') // Remove all non-word chars
20
+ .replace(/-{2,}/g, '-') // Replace multiple - with single -
11
21
  .replace(/^-+/, '') // Trim - from start of text
12
22
  .replace(/-+$/, ''); // Trim - from end of text
13
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"mintplayer-ng-bootstrap-slugify.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/slugify/src/slugify.pipe.ts","../../../../libs/mintplayer-ng-bootstrap/slugify/mintplayer-ng-bootstrap-slugify.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'bsSlugify',\n pure: true,\n})\nexport class BsSlugifyPipe implements PipeTransform {\n transform(value: string) {\n return value.toString().toLowerCase()\n .replace(/\\s+/g, '-') // Replace spaces with -\n .normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\") // Remove diacritics\n .replace(/[^\\w\\-]+/g, '') // Remove all non-word chars\n .replace(/\\-\\-+/g, '-') // Replace multiple - with single -\n .replace(/^-+/, '') // Trim - from start of text\n .replace(/-+$/, ''); // Trim - from end of text\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAMa,aAAa,CAAA;AACxB,IAAA,SAAS,CAAC,KAAa,EAAA;AACrB,QAAA,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC,WAAW;AAChC,aAAA,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;aACpB,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;AAChD,aAAA,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;AACxB,aAAA,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;AACtB,aAAA,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;AAClB,aAAA,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACxB;8GATW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,WAAW;AACjB,oBAAA,IAAI,EAAE,IAAI;AACX,iBAAA;;;ACLD;;AAEG;;;;"}
1
+ {"version":3,"file":"mintplayer-ng-bootstrap-slugify.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/slugify/src/slugify.pipe.ts","../../../../libs/mintplayer-ng-bootstrap/slugify/mintplayer-ng-bootstrap-slugify.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'bsSlugify',\n pure: true,\n})\nexport class BsSlugifyPipe implements PipeTransform {\n /**\n * Turns a title into a URL slug.\n *\n * Latin text is still decomposed and stripped of diacritics, so `Crème` stays\n * `creme` and existing slugs are unchanged. What changed is the character\n * class: it keeps letters and numbers in ANY script (`\\p{L}\\p{N}`) instead of\n * ASCII `\\w`. The old class removed every character of a script with no Latin\n * decomposition, so a non-Latin title slugified to the empty string — a route\n * segment that cannot work rather than one that merely looks unfamiliar.\n */\n transform(value: string) {\n return value.toString().toLowerCase()\n .replace(/\\s+/g, '-') // Replace spaces with -\n .normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\") // Remove diacritics\n .replace(/[^\\p{L}\\p{N}_-]+/gu, '') // Remove all non-word chars\n .replace(/-{2,}/g, '-') // Replace multiple - with single -\n .replace(/^-+/, '') // Trim - from start of text\n .replace(/-+$/, ''); // Trim - from end of text\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAMa,aAAa,CAAA;AACxB;;;;;;;;;AASG;AACH,IAAA,SAAS,CAAC,KAAa,EAAA;AACrB,QAAA,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC,WAAW;AAChC,aAAA,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;aACpB,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;AAChD,aAAA,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC;AACjC,aAAA,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;AACtB,aAAA,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;AAClB,aAAA,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACxB;8GAnBW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,WAAW;AACjB,oBAAA,IAAI,EAAE,IAAI;AACX,iBAAA;;;ACLD;;AAEG;;;;"}
@@ -8,6 +8,11 @@ import { BsForwardAriaDirective } from '@mintplayer/ng-bootstrap/a11y';
8
8
  * The template's `$implicit` is the `TreeNode`; consumers can render arbitrary
9
9
  * Angular content (icons, badges, custom layout) per node.
10
10
  *
11
+ * `mp-treeview` is a light-tier component: the nodes this template produces stay
12
+ * in the document, so this component's own styles, the page's stylesheet and
13
+ * Bootstrap's utility classes all reach them. (Before the light-DOM conversion
14
+ * they were mounted into a shadow root, where none of that applied.)
15
+ *
11
16
  * Example:
12
17
  * ```html
13
18
  * <bs-treeview [items]="nodes()">
@@ -15,11 +20,16 @@ import { BsForwardAriaDirective } from '@mintplayer/ng-bootstrap/a11y';
15
20
  * <span [innerHTML]="iconFor(node)"></span>
16
21
  * <strong>{{ node.label }}</strong>
17
22
  * @if (node.meta?.['badge']) {
18
- * <span class="badge bg-secondary">{{ node.meta!['badge'] }}</span>
23
+ * <bs-badge [type]="colors.secondary">{{ node.meta!['badge'] }}</bs-badge>
19
24
  * }
20
25
  * </ng-container>
21
26
  * </bs-treeview>
22
27
  * ```
28
+ *
29
+ * `<bs-badge>` rather than `<span class="badge">`: the workspace's own
30
+ * `_bootstrap.scss` ships only a subset of Bootstrap's partials and `badge` is
31
+ * not among them, so a raw `.badge` class is unstyled on a stock setup. It
32
+ * works, of course, in an app that loads the full framework.
23
33
  */
24
34
  class BsTreeviewNodeTemplateDirective {
25
35
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"file":"mintplayer-ng-bootstrap-treeview.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/treeview/src/treeview-node-template/treeview-node-template.directive.ts","../../../../libs/mintplayer-ng-bootstrap/treeview/src/treeview/treeview.component.ts","../../../../libs/mintplayer-ng-bootstrap/treeview/src/treeview/treeview.component.html","../../../../libs/mintplayer-ng-bootstrap/treeview/mintplayer-ng-bootstrap-treeview.ts"],"sourcesContent":["import { Directive, inject, TemplateRef } from '@angular/core';\nimport type { TreeNode } from '@mintplayer/web-components/treeview';\n\n/**\n * Marks an `<ng-template>` as the per-node body renderer for `<bs-treeview>`.\n * The template's `$implicit` is the `TreeNode`; consumers can render arbitrary\n * Angular content (icons, badges, custom layout) per node.\n *\n * Example:\n * ```html\n * <bs-treeview [items]=\"nodes()\">\n * <ng-container *bsTreeviewNode=\"let node\">\n * <span [innerHTML]=\"iconFor(node)\"></span>\n * <strong>{{ node.label }}</strong>\n * @if (node.meta?.['badge']) {\n * <span class=\"badge bg-secondary\">{{ node.meta!['badge'] }}</span>\n * }\n * </ng-container>\n * </bs-treeview>\n * ```\n */\n@Directive({ selector: '[bsTreeviewNode]' })\nexport class BsTreeviewNodeTemplateDirective {\n readonly templateRef = inject<TemplateRef<{ $implicit: TreeNode }>>(TemplateRef);\n\n static ngTemplateContextGuard(\n _dir: BsTreeviewNodeTemplateDirective,\n ctx: unknown,\n ): ctx is { $implicit: TreeNode } {\n return true;\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n contentChild,\n CUSTOM_ELEMENTS_SCHEMA,\n DestroyRef,\n effect,\n ElementRef,\n EmbeddedViewRef,\n inject,\n input,\n model,\n output,\n ViewContainerRef,\n viewChild,\n} from '@angular/core';\nimport {\n MpTreeview,\n type IconResolver,\n type TreeNode,\n type TreeNodeCollapseEventDetail,\n type TreeNodeExpandEventDetail,\n type TreeNodeRenderer,\n type TreeNodeSelectEventDetail,\n type TreeviewSelectionMode,\n} from '@mintplayer/web-components/treeview';\n\n// Side-effect import: registers the `<mp-treeview>` custom element.\nimport '@mintplayer/web-components/treeview';\n\nimport { BsTreeviewNodeTemplateDirective } from '../treeview-node-template/treeview-node-template.directive';\nimport { BsForwardAriaDirective } from '@mintplayer/ng-bootstrap/a11y';\n\n@Component({\n selector: 'bs-treeview',\n templateUrl: './treeview.component.html',\n imports: [BsForwardAriaDirective],\n styleUrls: ['./treeview.component.scss'],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BsTreeviewComponent implements AfterViewInit {\n readonly items = input<TreeNode[]>([]);\n readonly expandedIds = model<string[]>([]);\n readonly selectedIds = model<string[]>([]);\n readonly selectionMode = input<TreeviewSelectionMode>('single');\n readonly hideBorders = input<boolean>(false);\n readonly iconResolver = input<IconResolver | undefined>(undefined);\n\n readonly nodeSelect = output<TreeNodeSelectEventDetail>();\n readonly nodeExpand = output<TreeNodeExpandEventDetail>();\n readonly nodeCollapse = output<TreeNodeCollapseEventDetail>();\n\n readonly treeviewRef = viewChild<ElementRef<MpTreeview>>('treeview');\n readonly nodeTemplate = contentChild(BsTreeviewNodeTemplateDirective);\n\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly destroyRef = inject(DestroyRef);\n private readonly viewCache = new Map<string, EmbeddedViewRef<{ $implicit: TreeNode }>>();\n\n constructor() {\n this.destroyRef.onDestroy(() => {\n for (const view of this.viewCache.values()) view.destroy();\n this.viewCache.clear();\n });\n\n effect(() => {\n const el = this.treeviewRef()?.nativeElement;\n if (!el) return;\n el.items = this.items();\n // Prune cached views for nodes that no longer exist.\n const liveIds = new Set<string>();\n const walk = (nodes: ReadonlyArray<TreeNode>) => {\n for (const n of nodes) {\n liveIds.add(n.id);\n if (n.children) walk(n.children);\n }\n };\n walk(this.items());\n for (const [id, view] of this.viewCache) {\n if (!liveIds.has(id)) {\n view.destroy();\n this.viewCache.delete(id);\n }\n }\n });\n\n effect(() => {\n const el = this.treeviewRef()?.nativeElement;\n if (!el) return;\n el.expandedIds = this.expandedIds();\n });\n\n effect(() => {\n const el = this.treeviewRef()?.nativeElement;\n if (!el) return;\n el.selectedIds = this.selectedIds();\n });\n\n effect(() => {\n const el = this.treeviewRef()?.nativeElement;\n if (!el) return;\n el.selectionMode = this.selectionMode();\n });\n\n effect(() => {\n const el = this.treeviewRef()?.nativeElement;\n if (!el) return;\n el.hideBorders = this.hideBorders();\n });\n\n effect(() => {\n const el = this.treeviewRef()?.nativeElement;\n if (!el) return;\n el.iconResolver = this.iconResolver();\n });\n\n // Wire nodeRenderer when a *bsTreeviewNode template is provided.\n effect(() => {\n const el = this.treeviewRef()?.nativeElement;\n if (!el) return;\n const tpl = this.nodeTemplate();\n if (!tpl) {\n el.nodeRenderer = undefined;\n // Destroy any stale views from a previous template.\n for (const view of this.viewCache.values()) view.destroy();\n this.viewCache.clear();\n return;\n }\n el.nodeRenderer = this.buildNodeRenderer(tpl);\n });\n }\n\n ngAfterViewInit(): void {\n // Effects above re-run as the view is created; nothing else needed.\n }\n\n private buildNodeRenderer(tpl: BsTreeviewNodeTemplateDirective): TreeNodeRenderer {\n return (node) => {\n let viewRef = this.viewCache.get(node.id);\n if (!viewRef) {\n viewRef = this.viewContainerRef.createEmbeddedView(tpl.templateRef, { $implicit: node });\n this.viewCache.set(node.id, viewRef);\n } else {\n viewRef.context.$implicit = node;\n }\n viewRef.detectChanges();\n const nodes = (viewRef.rootNodes as unknown[]).filter((n): n is Node => n instanceof Node);\n if (nodes.length === 0) return undefined;\n if (nodes.length === 1) return nodes[0];\n const fragment = document.createDocumentFragment();\n for (const n of nodes) fragment.appendChild(n);\n return fragment;\n };\n }\n\n onSelect(event: Event): void {\n const detail = (event as CustomEvent<TreeNodeSelectEventDetail>).detail;\n this.selectedIds.set([...detail.selectedIds]);\n this.nodeSelect.emit(detail);\n }\n\n onExpand(event: Event): void {\n const detail = (event as CustomEvent<TreeNodeExpandEventDetail>).detail;\n this.expandedIds.set([...detail.expandedIds]);\n this.nodeExpand.emit(detail);\n }\n\n onCollapse(event: Event): void {\n const detail = (event as CustomEvent<TreeNodeCollapseEventDetail>).detail;\n this.expandedIds.set([...detail.expandedIds]);\n this.nodeCollapse.emit(detail);\n }\n}\n","<mp-treeview bsForwardAria\n #treeview\n class=\"bs-treeview\"\n (tree-node-select)=\"onSelect($event)\"\n (tree-node-expand)=\"onExpand($event)\"\n (tree-node-collapse)=\"onCollapse($event)\"\n></mp-treeview>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAGA;;;;;;;;;;;;;;;;;AAiBG;MAEU,+BAA+B,CAAA;AAD5C,IAAA,WAAA,GAAA;AAEW,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAuC,WAAW,CAAC;AAQjF,IAAA;AANC,IAAA,OAAO,sBAAsB,CAC3B,IAAqC,EACrC,GAAY,EAAA;AAEZ,QAAA,OAAO,IAAI;IACb;8GARW,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,M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A,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,cAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,cAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,UAAU,6FAC9B,+BAA+B,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEvDtE;;AAEG;;;;"}
1
+ {"version":3,"file":"mintplayer-ng-bootstrap-treeview.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/treeview/src/treeview-node-template/treeview-node-template.directive.ts","../../../../libs/mintplayer-ng-bootstrap/treeview/src/treeview/treeview.component.ts","../../../../libs/mintplayer-ng-bootstrap/treeview/src/treeview/treeview.component.html","../../../../libs/mintplayer-ng-bootstrap/treeview/mintplayer-ng-bootstrap-treeview.ts"],"sourcesContent":["import { Directive, inject, TemplateRef } from '@angular/core';\nimport type { TreeNode } from '@mintplayer/web-components/treeview';\n\n/**\n * Marks an `<ng-template>` as the per-node body renderer for `<bs-treeview>`.\n * The template's `$implicit` is the `TreeNode`; consumers can render arbitrary\n * Angular content (icons, badges, custom layout) per node.\n *\n * `mp-treeview` is a light-tier component: the nodes this template produces stay\n * in the document, so this component's own styles, the page's stylesheet and\n * Bootstrap's utility classes all reach them. (Before the light-DOM conversion\n * they were mounted into a shadow root, where none of that applied.)\n *\n * Example:\n * ```html\n * <bs-treeview [items]=\"nodes()\">\n * <ng-container *bsTreeviewNode=\"let node\">\n * <span [innerHTML]=\"iconFor(node)\"></span>\n * <strong>{{ node.label }}</strong>\n * @if (node.meta?.['badge']) {\n * <bs-badge [type]=\"colors.secondary\">{{ node.meta!['badge'] }}</bs-badge>\n * }\n * </ng-container>\n * </bs-treeview>\n * ```\n *\n * `<bs-badge>` rather than `<span class=\"badge\">`: the workspace's own\n * `_bootstrap.scss` ships only a subset of Bootstrap's partials and `badge` is\n * not among them, so a raw `.badge` class is unstyled on a stock setup. It\n * works, of course, in an app that loads the full framework.\n */\n@Directive({ selector: '[bsTreeviewNode]' })\nexport class BsTreeviewNodeTemplateDirective {\n readonly templateRef = inject<TemplateRef<{ $implicit: TreeNode }>>(TemplateRef);\n\n static ngTemplateContextGuard(\n _dir: BsTreeviewNodeTemplateDirective,\n ctx: unknown,\n ): ctx is { $implicit: TreeNode } {\n return true;\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n contentChild,\n CUSTOM_ELEMENTS_SCHEMA,\n DestroyRef,\n effect,\n ElementRef,\n EmbeddedViewRef,\n inject,\n input,\n model,\n output,\n ViewContainerRef,\n viewChild,\n} from '@angular/core';\nimport {\n MpTreeview,\n type IconResolver,\n type TreeNode,\n type TreeNodeCollapseEventDetail,\n type TreeNodeExpandEventDetail,\n type TreeNodeRenderer,\n type TreeNodeSelectEventDetail,\n type TreeviewSelectionMode,\n} from '@mintplayer/web-components/treeview';\n\n// Side-effect import: registers the `<mp-treeview>` custom element.\nimport '@mintplayer/web-components/treeview';\n\nimport { BsTreeviewNodeTemplateDirective } from '../treeview-node-template/treeview-node-template.directive';\nimport { BsForwardAriaDirective } from '@mintplayer/ng-bootstrap/a11y';\n\n@Component({\n selector: 'bs-treeview',\n templateUrl: './treeview.component.html',\n imports: [BsForwardAriaDirective],\n styleUrls: ['./treeview.component.scss'],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BsTreeviewComponent implements AfterViewInit {\n readonly items = input<TreeNode[]>([]);\n readonly expandedIds = model<string[]>([]);\n readonly selectedIds = model<string[]>([]);\n readonly selectionMode = input<TreeviewSelectionMode>('single');\n readonly hideBorders = input<boolean>(false);\n readonly iconResolver = input<IconResolver | undefined>(undefined);\n\n readonly nodeSelect = output<TreeNodeSelectEventDetail>();\n readonly nodeExpand = output<TreeNodeExpandEventDetail>();\n readonly nodeCollapse = output<TreeNodeCollapseEventDetail>();\n\n readonly treeviewRef = viewChild<ElementRef<MpTreeview>>('treeview');\n readonly nodeTemplate = contentChild(BsTreeviewNodeTemplateDirective);\n\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly destroyRef = inject(DestroyRef);\n private readonly viewCache = new Map<string, EmbeddedViewRef<{ $implicit: TreeNode }>>();\n\n constructor() {\n this.destroyRef.onDestroy(() => {\n for (const view of this.viewCache.values()) view.destroy();\n this.viewCache.clear();\n });\n\n effect(() => {\n const el = this.treeviewRef()?.nativeElement;\n if (!el) return;\n el.items = this.items();\n // Prune cached views for nodes that no longer exist.\n const liveIds = new Set<string>();\n const walk = (nodes: ReadonlyArray<TreeNode>) => {\n for (const n of nodes) {\n liveIds.add(n.id);\n if (n.children) walk(n.children);\n }\n };\n walk(this.items());\n for (const [id, view] of this.viewCache) {\n if (!liveIds.has(id)) {\n view.destroy();\n this.viewCache.delete(id);\n }\n }\n });\n\n effect(() => {\n const el = this.treeviewRef()?.nativeElement;\n if (!el) return;\n el.expandedIds = this.expandedIds();\n });\n\n effect(() => {\n const el = this.treeviewRef()?.nativeElement;\n if (!el) return;\n el.selectedIds = this.selectedIds();\n });\n\n effect(() => {\n const el = this.treeviewRef()?.nativeElement;\n if (!el) return;\n el.selectionMode = this.selectionMode();\n });\n\n effect(() => {\n const el = this.treeviewRef()?.nativeElement;\n if (!el) return;\n el.hideBorders = this.hideBorders();\n });\n\n effect(() => {\n const el = this.treeviewRef()?.nativeElement;\n if (!el) return;\n el.iconResolver = this.iconResolver();\n });\n\n // Wire nodeRenderer when a *bsTreeviewNode template is provided.\n effect(() => {\n const el = this.treeviewRef()?.nativeElement;\n if (!el) return;\n const tpl = this.nodeTemplate();\n if (!tpl) {\n el.nodeRenderer = undefined;\n // Destroy any stale views from a previous template.\n for (const view of this.viewCache.values()) view.destroy();\n this.viewCache.clear();\n return;\n }\n el.nodeRenderer = this.buildNodeRenderer(tpl);\n });\n }\n\n ngAfterViewInit(): void {\n // Effects above re-run as the view is created; nothing else needed.\n }\n\n private buildNodeRenderer(tpl: BsTreeviewNodeTemplateDirective): TreeNodeRenderer {\n return (node) => {\n let viewRef = this.viewCache.get(node.id);\n if (!viewRef) {\n viewRef = this.viewContainerRef.createEmbeddedView(tpl.templateRef, { $implicit: node });\n this.viewCache.set(node.id, viewRef);\n } else {\n viewRef.context.$implicit = node;\n }\n viewRef.detectChanges();\n const nodes = (viewRef.rootNodes as unknown[]).filter((n): n is Node => n instanceof Node);\n if (nodes.length === 0) return undefined;\n if (nodes.length === 1) return nodes[0];\n const fragment = document.createDocumentFragment();\n for (const n of nodes) fragment.appendChild(n);\n return fragment;\n };\n }\n\n onSelect(event: Event): void {\n const detail = (event as CustomEvent<TreeNodeSelectEventDetail>).detail;\n this.selectedIds.set([...detail.selectedIds]);\n this.nodeSelect.emit(detail);\n }\n\n onExpand(event: Event): void {\n const detail = (event as CustomEvent<TreeNodeExpandEventDetail>).detail;\n this.expandedIds.set([...detail.expandedIds]);\n this.nodeExpand.emit(detail);\n }\n\n onCollapse(event: Event): void {\n const detail = (event as CustomEvent<TreeNodeCollapseEventDetail>).detail;\n this.expandedIds.set([...detail.expandedIds]);\n this.nodeCollapse.emit(detail);\n }\n}\n","<mp-treeview bsForwardAria\n #treeview\n class=\"bs-treeview\"\n (tree-node-select)=\"onSelect($event)\"\n (tree-node-expand)=\"onExpand($event)\"\n (tree-node-collapse)=\"onCollapse($event)\"\n></mp-treeview>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;MAEU,+BAA+B,CAAA;AAD5C,IAAA,WAAA,GAAA;AAEW,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAuC,WAAW,CAAC;AAQjF,IAAA;AANC,IAAA,OAAO,sBAAsB,CAC3B,IAAqC,EACrC,GAAY,EAAA;AAEZ,QAAA,OAAO,IAAI;IACb;8GARW,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAA/B,+BAA+B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAA/B,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAD3C,SAAS;mBAAC,EAAE,QAAQ,EAAE,kBAAkB,EAAE;;;MCW9B,mBAAmB,CAAA;AAmB9B,IAAA,WAAA,GAAA;QAlBS,IAAA,CAAA,KAAK,GAAG,KAAK,CAAa,EAAE;kFAAC;QAC7B,IAAA,CAAA,WAAW,GAAG,KAAK,CAAW,EAAE;wFAAC;QACjC,IAAA,CAAA,WAAW,GAAG,KAAK,CAAW,EAAE;wFAAC;QACjC,IAAA,CAAA,aAAa,GAAG,KAAK,CAAwB,QAAQ;0FAAC;QACtD,IAAA,CAAA,WAAW,GAAG,KAAK,CAAU,KAAK;wFAAC;QACnC,IAAA,CAAA,YAAY,GAAG,KAAK,CAA2B,SAAS;yFAAC;QAEzD,IAAA,CAAA,UAAU,GAAG,MAAM,EAA6B;QAChD,IAAA,CAAA,UAAU,GAAG,MAAM,EAA6B;QAChD,IAAA,CAAA,YAAY,GAAG,MAAM,EAA+B;QAEpD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3
3
 
4
4
  class BsWordCountPipe {
5
+ /**
6
+ * Counts words, where a word is any run of non-whitespace.
7
+ *
8
+ * Splits on `/\s+/` rather than collapsing whitespace and splitting on a
9
+ * literal space: the earlier version collapsed only runs of TWO or more
10
+ * whitespace characters, so a single newline or tab between two words was
11
+ * neither collapsed nor split on and the pair counted as one word — while two
12
+ * or more whitespace characters happened to work, which is what made it hard
13
+ * to notice.
14
+ */
5
15
  transform(value) {
6
- if ((value === null) || (value === '')) {
16
+ if (!value)
7
17
  return 0;
8
- }
9
- else {
10
- return value
11
- .replace(/(^\s+)|(\s+$)/gi, '')
12
- .replace(/\s{2,}/gi, ' ')
13
- .split(' ')
14
- .filter(w => w !== '')
15
- .length;
16
- }
18
+ return value
19
+ .split(/\s+/)
20
+ .filter((word) => word !== '')
21
+ .length;
17
22
  }
18
23
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsWordCountPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
19
24
  static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: BsWordCountPipe, isStandalone: true, name: "bsWordCount" }); }
@@ -1 +1 @@
1
- {"version":3,"file":"mintplayer-ng-bootstrap-word-count.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/word-count/src/word-count.pipe.ts","../../../../libs/mintplayer-ng-bootstrap/word-count/mintplayer-ng-bootstrap-word-count.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'bsWordCount',\n pure: true,\n})\nexport class BsWordCountPipe implements PipeTransform {\n transform(value: string) {\n if ((value === null) || (value === '')) {\n return 0;\n } else {\n return value\n .replace(/(^\\s+)|(\\s+$)/gi, '')\n .replace(/\\s{2,}/gi, ' ')\n .split(' ')\n .filter(w => w !== '')\n .length;\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAMa,eAAe,CAAA;AAC1B,IAAA,SAAS,CAAC,KAAa,EAAA;AACrB,QAAA,IAAI,CAAC,KAAK,KAAK,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC,EAAE;AACtC,YAAA,OAAO,CAAC;QACV;aAAO;AACL,YAAA,OAAO;AACJ,iBAAA,OAAO,CAAC,iBAAiB,EAAE,EAAE;AAC7B,iBAAA,OAAO,CAAC,UAAU,EAAE,GAAG;iBACvB,KAAK,CAAC,GAAG;iBACT,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE;AACpB,iBAAA,MAAM;QACX;IACF;8GAZW,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,aAAA,EAAA,CAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,aAAa;AACnB,oBAAA,IAAI,EAAE,IAAI;AACX,iBAAA;;;ACLD;;AAEG;;;;"}
1
+ {"version":3,"file":"mintplayer-ng-bootstrap-word-count.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/word-count/src/word-count.pipe.ts","../../../../libs/mintplayer-ng-bootstrap/word-count/mintplayer-ng-bootstrap-word-count.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'bsWordCount',\n pure: true,\n})\nexport class BsWordCountPipe implements PipeTransform {\n /**\n * Counts words, where a word is any run of non-whitespace.\n *\n * Splits on `/\\s+/` rather than collapsing whitespace and splitting on a\n * literal space: the earlier version collapsed only runs of TWO or more\n * whitespace characters, so a single newline or tab between two words was\n * neither collapsed nor split on and the pair counted as one word — while two\n * or more whitespace characters happened to work, which is what made it hard\n * to notice.\n */\n transform(value: string) {\n if (!value) return 0;\n return value\n .split(/\\s+/)\n .filter((word) => word !== '')\n .length;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAMa,eAAe,CAAA;AAC1B;;;;;;;;;AASG;AACH,IAAA,SAAS,CAAC,KAAa,EAAA;AACrB,QAAA,IAAI,CAAC,KAAK;AAAE,YAAA,OAAO,CAAC;AACpB,QAAA,OAAO;aACJ,KAAK,CAAC,KAAK;aACX,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,KAAK,EAAE;AAC5B,aAAA,MAAM;IACX;8GAjBW,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,aAAA,EAAA,CAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,aAAa;AACnB,oBAAA,IAAI,EAAE,IAAI;AACX,iBAAA;;;ACLD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mintplayer/ng-bootstrap",
3
3
  "private": false,
4
- "version": "22.16.0",
4
+ "version": "22.18.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -2,6 +2,13 @@ import * as i0 from '@angular/core';
2
2
  import { PipeTransform } from '@angular/core';
3
3
 
4
4
  declare class BsLinifyPipe implements PipeTransform {
5
+ /**
6
+ * Splits text into lines, normalizing CRLF first.
7
+ *
8
+ * The `/g` flag is load-bearing: without it only the FIRST CRLF was rewritten
9
+ * and every later line of Windows-authored text kept a trailing `\r`, which
10
+ * then rode along into whatever the consumer rendered or compared.
11
+ */
5
12
  transform(value: string, removeEmptyEntries?: boolean): string[];
6
13
  static ɵfac: i0.ɵɵFactoryDeclaration<BsLinifyPipe, never>;
7
14
  static ɵpipe: i0.ɵɵPipeDeclaration<BsLinifyPipe, "bsLinify", true>;
@@ -2,6 +2,16 @@ import * as i0 from '@angular/core';
2
2
  import { PipeTransform } from '@angular/core';
3
3
 
4
4
  declare class BsSlugifyPipe implements PipeTransform {
5
+ /**
6
+ * Turns a title into a URL slug.
7
+ *
8
+ * Latin text is still decomposed and stripped of diacritics, so `Crème` stays
9
+ * `creme` and existing slugs are unchanged. What changed is the character
10
+ * class: it keeps letters and numbers in ANY script (`\p{L}\p{N}`) instead of
11
+ * ASCII `\w`. The old class removed every character of a script with no Latin
12
+ * decomposition, so a non-Latin title slugified to the empty string — a route
13
+ * segment that cannot work rather than one that merely looks unfamiliar.
14
+ */
5
15
  transform(value: string): string;
6
16
  static ɵfac: i0.ɵɵFactoryDeclaration<BsSlugifyPipe, never>;
7
17
  static ɵpipe: i0.ɵɵPipeDeclaration<BsSlugifyPipe, "bsSlugify", true>;
@@ -8,6 +8,11 @@ export { IconResolver, TreeNode, TreeNodeCollapseEventDetail, TreeNodeExpandEven
8
8
  * The template's `$implicit` is the `TreeNode`; consumers can render arbitrary
9
9
  * Angular content (icons, badges, custom layout) per node.
10
10
  *
11
+ * `mp-treeview` is a light-tier component: the nodes this template produces stay
12
+ * in the document, so this component's own styles, the page's stylesheet and
13
+ * Bootstrap's utility classes all reach them. (Before the light-DOM conversion
14
+ * they were mounted into a shadow root, where none of that applied.)
15
+ *
11
16
  * Example:
12
17
  * ```html
13
18
  * <bs-treeview [items]="nodes()">
@@ -15,11 +20,16 @@ export { IconResolver, TreeNode, TreeNodeCollapseEventDetail, TreeNodeExpandEven
15
20
  * <span [innerHTML]="iconFor(node)"></span>
16
21
  * <strong>{{ node.label }}</strong>
17
22
  * @if (node.meta?.['badge']) {
18
- * <span class="badge bg-secondary">{{ node.meta!['badge'] }}</span>
23
+ * <bs-badge [type]="colors.secondary">{{ node.meta!['badge'] }}</bs-badge>
19
24
  * }
20
25
  * </ng-container>
21
26
  * </bs-treeview>
22
27
  * ```
28
+ *
29
+ * `<bs-badge>` rather than `<span class="badge">`: the workspace's own
30
+ * `_bootstrap.scss` ships only a subset of Bootstrap's partials and `badge` is
31
+ * not among them, so a raw `.badge` class is unstyled on a stock setup. It
32
+ * works, of course, in an app that loads the full framework.
23
33
  */
24
34
  declare class BsTreeviewNodeTemplateDirective {
25
35
  readonly templateRef: TemplateRef<{
@@ -2,6 +2,16 @@ import * as i0 from '@angular/core';
2
2
  import { PipeTransform } from '@angular/core';
3
3
 
4
4
  declare class BsWordCountPipe implements PipeTransform {
5
+ /**
6
+ * Counts words, where a word is any run of non-whitespace.
7
+ *
8
+ * Splits on `/\s+/` rather than collapsing whitespace and splitting on a
9
+ * literal space: the earlier version collapsed only runs of TWO or more
10
+ * whitespace characters, so a single newline or tab between two words was
11
+ * neither collapsed nor split on and the pair counted as one word — while two
12
+ * or more whitespace characters happened to work, which is what made it hard
13
+ * to notice.
14
+ */
5
15
  transform(value: string): number;
6
16
  static ɵfac: i0.ɵɵFactoryDeclaration<BsWordCountPipe, never>;
7
17
  static ɵpipe: i0.ɵɵPipeDeclaration<BsWordCountPipe, "bsWordCount", true>;