@sdcorejs/angular 20.1.2 → 20.1.4

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.
Files changed (177) hide show
  1. package/README.md +127 -807
  2. package/components/audit-diff/index.d.ts +74 -0
  3. package/components/badge/index.d.ts +1 -1
  4. package/components/breadcrumb/index.d.ts +53 -0
  5. package/components/data-state/index.d.ts +44 -0
  6. package/components/document-builder/index.d.ts +5 -5
  7. package/components/form-generic/index.d.ts +89 -103
  8. package/components/import-excel/index.d.ts +4 -14
  9. package/components/index.d.ts +4 -0
  10. package/components/job-progress/index.d.ts +38 -0
  11. package/components/mini-editor/index.d.ts +9 -9
  12. package/components/modal/index.d.ts +7 -1
  13. package/components/preview/index.d.ts +181 -28
  14. package/components/side-drawer/index.d.ts +7 -1
  15. package/components/tab/index.d.ts +9 -2
  16. package/components/table/index.d.ts +8 -7
  17. package/components/tree/index.d.ts +24 -2
  18. package/components/upload-file/index.d.ts +5 -4
  19. package/directives/index.d.ts +10 -8
  20. package/fesm2022/sdcorejs-angular-components-anchor.mjs +14 -14
  21. package/fesm2022/sdcorejs-angular-components-anchor.mjs.map +1 -1
  22. package/fesm2022/sdcorejs-angular-components-audit-diff.mjs +332 -0
  23. package/fesm2022/sdcorejs-angular-components-audit-diff.mjs.map +1 -0
  24. package/fesm2022/sdcorejs-angular-components-badge.mjs +1 -0
  25. package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
  26. package/fesm2022/sdcorejs-angular-components-breadcrumb.mjs +121 -0
  27. package/fesm2022/sdcorejs-angular-components-breadcrumb.mjs.map +1 -0
  28. package/fesm2022/sdcorejs-angular-components-data-state.mjs +68 -0
  29. package/fesm2022/sdcorejs-angular-components-data-state.mjs.map +1 -0
  30. package/fesm2022/sdcorejs-angular-components-document-builder.mjs +18 -23
  31. package/fesm2022/sdcorejs-angular-components-document-builder.mjs.map +1 -1
  32. package/fesm2022/sdcorejs-angular-components-editor.mjs +6 -4
  33. package/fesm2022/sdcorejs-angular-components-editor.mjs.map +1 -1
  34. package/fesm2022/sdcorejs-angular-components-form-generic.mjs +633 -886
  35. package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
  36. package/fesm2022/sdcorejs-angular-components-import-excel.mjs +26 -41
  37. package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
  38. package/fesm2022/sdcorejs-angular-components-job-progress.mjs +97 -0
  39. package/fesm2022/sdcorejs-angular-components-job-progress.mjs.map +1 -0
  40. package/fesm2022/sdcorejs-angular-components-mini-editor.mjs +10 -20
  41. package/fesm2022/sdcorejs-angular-components-mini-editor.mjs.map +1 -1
  42. package/fesm2022/sdcorejs-angular-components-modal.mjs +61 -4
  43. package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
  44. package/fesm2022/sdcorejs-angular-components-preview.mjs +1438 -218
  45. package/fesm2022/sdcorejs-angular-components-preview.mjs.map +1 -1
  46. package/fesm2022/sdcorejs-angular-components-query-bar.mjs +9 -17
  47. package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
  48. package/fesm2022/sdcorejs-angular-components-query-builder.mjs +1 -1
  49. package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
  50. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +39 -2
  51. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
  52. package/fesm2022/sdcorejs-angular-components-tab-router.mjs +76 -52
  53. package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
  54. package/fesm2022/sdcorejs-angular-components-tab.mjs +48 -4
  55. package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
  56. package/fesm2022/sdcorejs-angular-components-table.mjs +123 -89
  57. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  58. package/fesm2022/sdcorejs-angular-components-tree.mjs +188 -18
  59. package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -1
  60. package/fesm2022/sdcorejs-angular-components-upload-file.mjs +17 -23
  61. package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
  62. package/fesm2022/sdcorejs-angular-components.mjs +4 -0
  63. package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
  64. package/fesm2022/sdcorejs-angular-directives.mjs +29 -41
  65. package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
  66. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +9 -8
  67. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
  68. package/fesm2022/sdcorejs-angular-forms-checkbox.mjs +20 -83
  69. package/fesm2022/sdcorejs-angular-forms-checkbox.mjs.map +1 -1
  70. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +8 -4
  71. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
  72. package/fesm2022/sdcorejs-angular-forms-chip.mjs +8 -4
  73. package/fesm2022/sdcorejs-angular-forms-chip.mjs.map +1 -1
  74. package/fesm2022/sdcorejs-angular-forms-date-range.mjs +18 -14
  75. package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
  76. package/fesm2022/sdcorejs-angular-forms-date.mjs +48 -70
  77. package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
  78. package/fesm2022/sdcorejs-angular-forms-datetime.mjs +62 -528
  79. package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
  80. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs +384 -0
  81. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs.map +1 -0
  82. package/fesm2022/sdcorejs-angular-forms-input-color.mjs +5 -3
  83. package/fesm2022/sdcorejs-angular-forms-input-color.mjs.map +1 -1
  84. package/fesm2022/sdcorejs-angular-forms-input-number.mjs +16 -11
  85. package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
  86. package/fesm2022/sdcorejs-angular-forms-input.mjs +297 -59
  87. package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
  88. package/fesm2022/sdcorejs-angular-forms-models.mjs +155 -2
  89. package/fesm2022/sdcorejs-angular-forms-models.mjs.map +1 -1
  90. package/fesm2022/sdcorejs-angular-forms-radio.mjs +44 -78
  91. package/fesm2022/sdcorejs-angular-forms-radio.mjs.map +1 -1
  92. package/fesm2022/sdcorejs-angular-forms-select.mjs +8 -21
  93. package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
  94. package/fesm2022/sdcorejs-angular-forms-switch.mjs +19 -76
  95. package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
  96. package/fesm2022/sdcorejs-angular-forms-textarea.mjs +8 -6
  97. package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
  98. package/fesm2022/sdcorejs-angular-forms-time-range.mjs +280 -0
  99. package/fesm2022/sdcorejs-angular-forms-time-range.mjs.map +1 -0
  100. package/fesm2022/sdcorejs-angular-forms-time.mjs +310 -0
  101. package/fesm2022/sdcorejs-angular-forms-time.mjs.map +1 -0
  102. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs +210 -0
  103. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs.map +1 -0
  104. package/fesm2022/sdcorejs-angular-forms.mjs +73 -4
  105. package/fesm2022/sdcorejs-angular-forms.mjs.map +1 -1
  106. package/fesm2022/sdcorejs-angular-i18n.mjs +355 -10
  107. package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
  108. package/fesm2022/sdcorejs-angular-interceptors.mjs +12 -17
  109. package/fesm2022/sdcorejs-angular-interceptors.mjs.map +1 -1
  110. package/fesm2022/sdcorejs-angular-modules-icon.mjs.map +1 -1
  111. package/fesm2022/sdcorejs-angular-modules-layout.mjs +861 -80
  112. package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
  113. package/fesm2022/sdcorejs-angular-modules.mjs +0 -1
  114. package/fesm2022/sdcorejs-angular-modules.mjs.map +1 -1
  115. package/fesm2022/sdcorejs-angular-pipes.mjs +5 -7
  116. package/fesm2022/sdcorejs-angular-pipes.mjs.map +1 -1
  117. package/fesm2022/sdcorejs-angular-services-api.mjs +407 -137
  118. package/fesm2022/sdcorejs-angular-services-api.mjs.map +1 -1
  119. package/fesm2022/sdcorejs-angular-services-cache.mjs +515 -105
  120. package/fesm2022/sdcorejs-angular-services-cache.mjs.map +1 -1
  121. package/fesm2022/sdcorejs-angular-services-confirm.mjs +5 -7
  122. package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
  123. package/fesm2022/sdcorejs-angular-services-docx.mjs +7 -10
  124. package/fesm2022/sdcorejs-angular-services-docx.mjs.map +1 -1
  125. package/fesm2022/sdcorejs-angular-services-loading.mjs +340 -66
  126. package/fesm2022/sdcorejs-angular-services-loading.mjs.map +1 -1
  127. package/fesm2022/sdcorejs-angular-services-notify.mjs +7 -10
  128. package/fesm2022/sdcorejs-angular-services-notify.mjs.map +1 -1
  129. package/fesm2022/sdcorejs-angular-services-persistence.mjs +899 -0
  130. package/fesm2022/sdcorejs-angular-services-persistence.mjs.map +1 -0
  131. package/fesm2022/sdcorejs-angular-services-storage.mjs +324 -122
  132. package/fesm2022/sdcorejs-angular-services-storage.mjs.map +1 -1
  133. package/fesm2022/sdcorejs-angular-services-task.mjs +389 -0
  134. package/fesm2022/sdcorejs-angular-services-task.mjs.map +1 -0
  135. package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs +255 -0
  136. package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs.map +1 -0
  137. package/fesm2022/sdcorejs-angular-services-viewport.mjs +76 -0
  138. package/fesm2022/sdcorejs-angular-services-viewport.mjs.map +1 -0
  139. package/fesm2022/sdcorejs-angular-services.mjs +4 -0
  140. package/fesm2022/sdcorejs-angular-services.mjs.map +1 -1
  141. package/forms/autocomplete/index.d.ts +3 -4
  142. package/forms/checkbox/index.d.ts +4 -8
  143. package/forms/date/index.d.ts +3 -3
  144. package/forms/date-range/index.d.ts +6 -7
  145. package/forms/datetime/index.d.ts +3 -3
  146. package/forms/entity-picker/index.d.ts +128 -0
  147. package/forms/index.d.ts +15 -5
  148. package/forms/input/index.d.ts +76 -11
  149. package/forms/input-color/index.d.ts +3 -1
  150. package/forms/input-number/index.d.ts +4 -2
  151. package/forms/models/index.d.ts +86 -3
  152. package/forms/radio/index.d.ts +12 -8
  153. package/forms/switch/index.d.ts +4 -7
  154. package/forms/time/index.d.ts +117 -0
  155. package/forms/time-range/index.d.ts +98 -0
  156. package/forms/tree-select/index.d.ts +76 -0
  157. package/i18n/index.d.ts +68 -2
  158. package/interceptors/index.d.ts +5 -6
  159. package/modules/icon/index.d.ts +2 -3
  160. package/modules/index.d.ts +0 -1
  161. package/modules/layout/index.d.ts +288 -15
  162. package/package.json +50 -5
  163. package/pipes/index.d.ts +2 -2
  164. package/services/api/index.d.ts +68 -24
  165. package/services/cache/index.d.ts +52 -16
  166. package/services/confirm/index.d.ts +3 -2
  167. package/services/docx/index.d.ts +2 -3
  168. package/services/index.d.ts +4 -0
  169. package/services/loading/index.d.ts +16 -8
  170. package/services/persistence/index.d.ts +159 -0
  171. package/services/storage/index.d.ts +26 -8
  172. package/services/task/index.d.ts +104 -0
  173. package/services/unsaved-changes/index.d.ts +83 -0
  174. package/services/viewport/index.d.ts +42 -0
  175. package/fesm2022/sdcorejs-angular-modules-authom.mjs +0 -360
  176. package/fesm2022/sdcorejs-angular-modules-authom.mjs.map +0 -1
  177. package/modules/authom/index.d.ts +0 -70
@@ -0,0 +1,121 @@
1
+ import { NgTemplateOutlet } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, signal, input, output, contentChild, TemplateRef, computed, effect, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
+ import { Router, NavigationEnd, PRIMARY_OUTLET } from '@angular/router';
6
+ import { normalizeAsync } from '@sdcorejs/utils/models';
7
+ import { SdIcon } from '@sdcorejs/angular/modules/icon';
8
+ import { filter, combineLatest, defer, map, catchError, of } from 'rxjs';
9
+
10
+ class SdBreadcrumb {
11
+ #router = inject(Router, { optional: true });
12
+ #routeVersion = signal(0, ...(ngDevMode ? [{ debugName: "#routeVersion" }] : []));
13
+ #resolvedItems = signal([], ...(ngDevMode ? [{ debugName: "#resolvedItems" }] : []));
14
+ items = input(undefined, ...(ngDevMode ? [{ debugName: "items" }] : []));
15
+ maxItems = input(5, ...(ngDevMode ? [{ debugName: "maxItems", transform: normalizeMaxItems }] : [{ transform: normalizeMaxItems }]));
16
+ ariaLabel = input('Breadcrumb', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
17
+ separator = input('chevron_right', ...(ngDevMode ? [{ debugName: "separator" }] : []));
18
+ sdItemActivate = output();
19
+ itemTemplate = contentChild(TemplateRef, ...(ngDevMode ? [{ debugName: "itemTemplate" }] : []));
20
+ visibleEntries = computed(() => {
21
+ const entries = this.#resolvedItems().map(item => ({ kind: 'item', item }));
22
+ const maxItems = this.maxItems();
23
+ if (entries.length <= maxItems)
24
+ return entries;
25
+ const tailCount = maxItems - 2;
26
+ return [entries[0], { kind: 'ellipsis' }, ...entries.slice(-tailCount)];
27
+ }, ...(ngDevMode ? [{ debugName: "visibleEntries" }] : []));
28
+ constructor() {
29
+ this.#router?.events
30
+ .pipe(filter((event) => event instanceof NavigationEnd), takeUntilDestroyed())
31
+ .subscribe(() => this.#routeVersion.update(version => version + 1));
32
+ effect(onCleanup => {
33
+ const providedItems = this.items();
34
+ if (providedItems == null)
35
+ this.#routeVersion();
36
+ const sourceItems = providedItems ?? this.#createRouteItems();
37
+ if (sourceItems.length === 0) {
38
+ this.#resolvedItems.set([]);
39
+ return;
40
+ }
41
+ const subscription = combineLatest(sourceItems.map(item => defer(() => normalizeAsync(resolveLabelSource(item.label, item.route))).pipe(map(label => ({
42
+ ...item,
43
+ label: String(label ?? '').trim(),
44
+ source: item,
45
+ })), catchError(() => of({ ...item, label: '', source: item }))))).subscribe(items => this.#resolvedItems.set(items.filter(item => item.label)));
46
+ onCleanup(() => subscription.unsubscribe());
47
+ });
48
+ }
49
+ activate(item, event) {
50
+ if (item.disabled) {
51
+ event.preventDefault();
52
+ return;
53
+ }
54
+ this.sdItemActivate.emit(item.source);
55
+ if (!item.url || !this.#router || isModifiedMouseEvent(event))
56
+ return;
57
+ event.preventDefault();
58
+ if (typeof item.url === 'string') {
59
+ void this.#router.navigateByUrl(item.url);
60
+ }
61
+ else {
62
+ void this.#router.navigate(item.url);
63
+ }
64
+ }
65
+ href(item) {
66
+ return typeof item.url === 'string' ? item.url : null;
67
+ }
68
+ templateContext(item) {
69
+ return { $implicit: item, item };
70
+ }
71
+ #createRouteItems() {
72
+ const root = this.#router?.routerState.snapshot.root;
73
+ if (!root)
74
+ return [];
75
+ const items = [];
76
+ const segments = [];
77
+ let route = root;
78
+ while (route) {
79
+ if (route.outlet === PRIMARY_OUTLET) {
80
+ segments.push(...route.url.map(segment => segment.path).filter(Boolean));
81
+ const value = route.data['breadcrumb'];
82
+ if (value !== undefined && value !== null) {
83
+ const config = isRouteConfig(value) ? value : { label: value };
84
+ items.push({
85
+ ...config,
86
+ url: config.url ?? `/${segments.join('/')}`,
87
+ route,
88
+ });
89
+ }
90
+ }
91
+ route = route.children?.find(child => child.outlet === PRIMARY_OUTLET) ?? route.firstChild;
92
+ }
93
+ return items;
94
+ }
95
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdBreadcrumb, deps: [], target: i0.ɵɵFactoryTarget.Component });
96
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdBreadcrumb, isStandalone: true, selector: "sd-breadcrumb", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, maxItems: { classPropertyName: "maxItems", publicName: "maxItems", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sdItemActivate: "sdItemActivate" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: "<nav class=\"sd-breadcrumb\" [attr.aria-label]=\"ariaLabel()\">\n <ol class=\"sd-breadcrumb__list\">\n @for (entry of visibleEntries(); track entry.kind === 'item' ? entry.item : $index; let last = $last) {\n <li class=\"sd-breadcrumb__entry\">\n @if (entry.kind === 'ellipsis') {\n <span class=\"sd-breadcrumb__ellipsis\" aria-hidden=\"true\">\u2026</span>\n } @else {\n @let item = entry.item;\n @let template = itemTemplate();\n @if (!last && !item.disabled && href(item) !== null) {\n <a class=\"sd-breadcrumb__item\" [attr.href]=\"href(item)\" (click)=\"activate(item, $event)\">\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"templateContext(item)\"></ng-container>\n } @else {\n @if (item.icon) {\n <sd-icon class=\"sd-breadcrumb__icon\" aria-hidden=\"true\" [name]=\"item.icon\" [fontSet]=\"item.fontSet\"></sd-icon>\n }\n <span>{{ item.label }}</span>\n }\n </a>\n } @else if (!last && !item.disabled && (item.url || item.clickable)) {\n <button type=\"button\" class=\"sd-breadcrumb__item\" (click)=\"activate(item, $event)\">\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"templateContext(item)\"></ng-container>\n } @else {\n @if (item.icon) {\n <sd-icon class=\"sd-breadcrumb__icon\" aria-hidden=\"true\" [name]=\"item.icon\" [fontSet]=\"item.fontSet\"></sd-icon>\n }\n <span>{{ item.label }}</span>\n }\n </button>\n } @else {\n <span\n class=\"sd-breadcrumb__item\"\n [class.sd-breadcrumb__item--disabled]=\"item.disabled\"\n [attr.aria-disabled]=\"item.disabled ? 'true' : null\"\n [attr.aria-current]=\"last ? 'page' : null\">\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"templateContext(item)\"></ng-container>\n } @else {\n @if (item.icon) {\n <sd-icon class=\"sd-breadcrumb__icon\" aria-hidden=\"true\" [name]=\"item.icon\" [fontSet]=\"item.fontSet\"></sd-icon>\n }\n <span>{{ item.label }}</span>\n }\n </span>\n }\n }\n\n @if (!last) {\n <sd-icon class=\"sd-breadcrumb__separator\" aria-hidden=\"true\" [name]=\"separator()\"></sd-icon>\n }\n </li>\n }\n </ol>\n</nav>\n", styles: [":host{display:block;min-width:0}.sd-breadcrumb__list{display:flex;align-items:center;gap:4px;min-width:0;margin:0;padding:0;list-style:none}.sd-breadcrumb__entry{display:inline-flex;align-items:center;min-width:0}.sd-breadcrumb__item{display:inline-flex;align-items:center;gap:4px;min-width:0;max-width:240px;padding:4px;border:0;border-radius:4px;background:transparent;color:var(--sd-text-secondary, #667085);font:inherit;text-decoration:none;cursor:pointer}.sd-breadcrumb__item span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-breadcrumb__item:focus-visible{outline:2px solid var(--sd-info, #1677ff);outline-offset:2px}.sd-breadcrumb__item[aria-current=page],.sd-breadcrumb__item--disabled{color:var(--sd-text, #2f3136);cursor:default}.sd-breadcrumb__item--disabled{opacity:.55}.sd-breadcrumb__ellipsis{padding:4px;color:var(--sd-text-secondary, #667085)}.sd-breadcrumb__separator{margin-inline:2px;color:var(--sd-text-disabled, #98a2b3)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
97
+ }
98
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdBreadcrumb, decorators: [{
99
+ type: Component,
100
+ args: [{ selector: 'sd-breadcrumb', standalone: true, imports: [NgTemplateOutlet, SdIcon], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nav class=\"sd-breadcrumb\" [attr.aria-label]=\"ariaLabel()\">\n <ol class=\"sd-breadcrumb__list\">\n @for (entry of visibleEntries(); track entry.kind === 'item' ? entry.item : $index; let last = $last) {\n <li class=\"sd-breadcrumb__entry\">\n @if (entry.kind === 'ellipsis') {\n <span class=\"sd-breadcrumb__ellipsis\" aria-hidden=\"true\">\u2026</span>\n } @else {\n @let item = entry.item;\n @let template = itemTemplate();\n @if (!last && !item.disabled && href(item) !== null) {\n <a class=\"sd-breadcrumb__item\" [attr.href]=\"href(item)\" (click)=\"activate(item, $event)\">\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"templateContext(item)\"></ng-container>\n } @else {\n @if (item.icon) {\n <sd-icon class=\"sd-breadcrumb__icon\" aria-hidden=\"true\" [name]=\"item.icon\" [fontSet]=\"item.fontSet\"></sd-icon>\n }\n <span>{{ item.label }}</span>\n }\n </a>\n } @else if (!last && !item.disabled && (item.url || item.clickable)) {\n <button type=\"button\" class=\"sd-breadcrumb__item\" (click)=\"activate(item, $event)\">\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"templateContext(item)\"></ng-container>\n } @else {\n @if (item.icon) {\n <sd-icon class=\"sd-breadcrumb__icon\" aria-hidden=\"true\" [name]=\"item.icon\" [fontSet]=\"item.fontSet\"></sd-icon>\n }\n <span>{{ item.label }}</span>\n }\n </button>\n } @else {\n <span\n class=\"sd-breadcrumb__item\"\n [class.sd-breadcrumb__item--disabled]=\"item.disabled\"\n [attr.aria-disabled]=\"item.disabled ? 'true' : null\"\n [attr.aria-current]=\"last ? 'page' : null\">\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"templateContext(item)\"></ng-container>\n } @else {\n @if (item.icon) {\n <sd-icon class=\"sd-breadcrumb__icon\" aria-hidden=\"true\" [name]=\"item.icon\" [fontSet]=\"item.fontSet\"></sd-icon>\n }\n <span>{{ item.label }}</span>\n }\n </span>\n }\n }\n\n @if (!last) {\n <sd-icon class=\"sd-breadcrumb__separator\" aria-hidden=\"true\" [name]=\"separator()\"></sd-icon>\n }\n </li>\n }\n </ol>\n</nav>\n", styles: [":host{display:block;min-width:0}.sd-breadcrumb__list{display:flex;align-items:center;gap:4px;min-width:0;margin:0;padding:0;list-style:none}.sd-breadcrumb__entry{display:inline-flex;align-items:center;min-width:0}.sd-breadcrumb__item{display:inline-flex;align-items:center;gap:4px;min-width:0;max-width:240px;padding:4px;border:0;border-radius:4px;background:transparent;color:var(--sd-text-secondary, #667085);font:inherit;text-decoration:none;cursor:pointer}.sd-breadcrumb__item span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-breadcrumb__item:focus-visible{outline:2px solid var(--sd-info, #1677ff);outline-offset:2px}.sd-breadcrumb__item[aria-current=page],.sd-breadcrumb__item--disabled{color:var(--sd-text, #2f3136);cursor:default}.sd-breadcrumb__item--disabled{opacity:.55}.sd-breadcrumb__ellipsis{padding:4px;color:var(--sd-text-secondary, #667085)}.sd-breadcrumb__separator{margin-inline:2px;color:var(--sd-text-disabled, #98a2b3)}\n"] }]
101
+ }], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], maxItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxItems", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], separator: [{ type: i0.Input, args: [{ isSignal: true, alias: "separator", required: false }] }], sdItemActivate: [{ type: i0.Output, args: ["sdItemActivate"] }], itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }] } });
102
+ function resolveLabelSource(label, route) {
103
+ return typeof label === 'function' ? label(route) : label;
104
+ }
105
+ function isRouteConfig(value) {
106
+ return typeof value === 'object' && value !== null && 'label' in value;
107
+ }
108
+ function normalizeMaxItems(value) {
109
+ const parsed = Number(value);
110
+ return Number.isFinite(parsed) ? Math.max(3, Math.floor(parsed)) : 5;
111
+ }
112
+ function isModifiedMouseEvent(event) {
113
+ return event instanceof MouseEvent && (event.button !== 0 || event.ctrlKey || event.metaKey || event.shiftKey || event.altKey);
114
+ }
115
+
116
+ /**
117
+ * Generated bundle index. Do not edit.
118
+ */
119
+
120
+ export { SdBreadcrumb };
121
+ //# sourceMappingURL=sdcorejs-angular-components-breadcrumb.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdcorejs-angular-components-breadcrumb.mjs","sources":["../../../projects/sdcorejs-angular/components/breadcrumb/src/breadcrumb.component.ts","../../../projects/sdcorejs-angular/components/breadcrumb/src/breadcrumb.component.html","../../../projects/sdcorejs-angular/components/breadcrumb/sdcorejs-angular-components-breadcrumb.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n computed,\n contentChild,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ActivatedRouteSnapshot, NavigationEnd, PRIMARY_OUTLET, Router } from '@angular/router';\nimport { MaybeAsync, normalizeAsync } from '@sdcorejs/utils/models';\nimport { SdIcon, SdIconSet } from '@sdcorejs/angular/modules/icon';\nimport { catchError, combineLatest, defer, filter, map, of } from 'rxjs';\n\nexport type SdBreadcrumbLabel =\n | MaybeAsync<string | null | undefined>\n | ((route?: ActivatedRouteSnapshot) => MaybeAsync<string | null | undefined>);\n\nexport interface SdBreadcrumbItem {\n readonly label: SdBreadcrumbLabel;\n readonly url?: string | unknown[];\n readonly icon?: string;\n readonly fontSet?: SdIconSet;\n readonly disabled?: boolean;\n readonly clickable?: boolean;\n}\n\nexport interface SdBreadcrumbRouteConfig extends Omit<SdBreadcrumbItem, 'url'> {\n readonly url?: string | unknown[];\n}\n\nexport interface SdBreadcrumbResolvedItem extends Omit<SdBreadcrumbItem, 'label'> {\n readonly label: string;\n readonly source: SdBreadcrumbItem;\n}\n\nexport interface SdBreadcrumbItemTemplateContext {\n readonly $implicit: SdBreadcrumbResolvedItem;\n readonly item: SdBreadcrumbResolvedItem;\n}\n\ninterface SdBreadcrumbItemEntry {\n readonly kind: 'item';\n readonly item: SdBreadcrumbResolvedItem;\n}\n\ninterface SdBreadcrumbEllipsisEntry {\n readonly kind: 'ellipsis';\n}\n\ntype SdBreadcrumbEntry = SdBreadcrumbItemEntry | SdBreadcrumbEllipsisEntry;\n\ninterface SdBreadcrumbSourceItem extends SdBreadcrumbItem {\n readonly route?: ActivatedRouteSnapshot;\n}\n\n@Component({\n selector: 'sd-breadcrumb',\n standalone: true,\n imports: [NgTemplateOutlet, SdIcon],\n templateUrl: './breadcrumb.component.html',\n styleUrl: './breadcrumb.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SdBreadcrumb {\n readonly #router = inject(Router, { optional: true });\n readonly #routeVersion = signal(0);\n readonly #resolvedItems = signal<SdBreadcrumbResolvedItem[]>([]);\n\n readonly items = input<readonly SdBreadcrumbItem[] | null | undefined>(undefined);\n readonly maxItems = input(5, { transform: normalizeMaxItems });\n readonly ariaLabel = input('Breadcrumb');\n readonly separator = input('chevron_right');\n readonly sdItemActivate = output<SdBreadcrumbItem>();\n\n protected readonly itemTemplate = contentChild<TemplateRef<SdBreadcrumbItemTemplateContext>>(TemplateRef);\n protected readonly visibleEntries = computed<readonly SdBreadcrumbEntry[]>(() => {\n const entries = this.#resolvedItems().map(item => ({ kind: 'item' as const, item }));\n const maxItems = this.maxItems();\n if (entries.length <= maxItems) return entries;\n\n const tailCount = maxItems - 2;\n return [entries[0]!, { kind: 'ellipsis' as const }, ...entries.slice(-tailCount)];\n });\n\n constructor() {\n this.#router?.events\n .pipe(\n filter((event): event is NavigationEnd => event instanceof NavigationEnd),\n takeUntilDestroyed()\n )\n .subscribe(() => this.#routeVersion.update(version => version + 1));\n\n effect(onCleanup => {\n const providedItems = this.items();\n if (providedItems == null) this.#routeVersion();\n const sourceItems: readonly SdBreadcrumbSourceItem[] = providedItems ?? this.#createRouteItems();\n if (sourceItems.length === 0) {\n this.#resolvedItems.set([]);\n return;\n }\n\n const subscription = combineLatest(\n sourceItems.map(item =>\n defer(() => normalizeAsync(resolveLabelSource(item.label, item.route))).pipe(\n map(label => ({\n ...item,\n label: String(label ?? '').trim(),\n source: item,\n })),\n catchError(() => of({ ...item, label: '', source: item }))\n )\n )\n ).subscribe(items => this.#resolvedItems.set(items.filter(item => item.label)));\n onCleanup(() => subscription.unsubscribe());\n });\n }\n\n protected activate(item: SdBreadcrumbResolvedItem, event: Event): void {\n if (item.disabled) {\n event.preventDefault();\n return;\n }\n this.sdItemActivate.emit(item.source);\n\n if (!item.url || !this.#router || isModifiedMouseEvent(event)) return;\n event.preventDefault();\n if (typeof item.url === 'string') {\n void this.#router.navigateByUrl(item.url);\n } else {\n void this.#router.navigate(item.url);\n }\n }\n\n protected href(item: SdBreadcrumbResolvedItem): string | null {\n return typeof item.url === 'string' ? item.url : null;\n }\n\n protected templateContext(item: SdBreadcrumbResolvedItem): SdBreadcrumbItemTemplateContext {\n return { $implicit: item, item };\n }\n\n #createRouteItems(): SdBreadcrumbSourceItem[] {\n const root = this.#router?.routerState.snapshot.root;\n if (!root) return [];\n\n const items: SdBreadcrumbSourceItem[] = [];\n const segments: string[] = [];\n let route: ActivatedRouteSnapshot | null = root;\n\n while (route) {\n if (route.outlet === PRIMARY_OUTLET) {\n segments.push(...route.url.map(segment => segment.path).filter(Boolean));\n const value = route.data['breadcrumb'] as SdBreadcrumbLabel | SdBreadcrumbRouteConfig | undefined;\n if (value !== undefined && value !== null) {\n const config = isRouteConfig(value) ? value : { label: value };\n items.push({\n ...config,\n url: config.url ?? `/${segments.join('/')}`,\n route,\n });\n }\n }\n route = route.children?.find(child => child.outlet === PRIMARY_OUTLET) ?? route.firstChild;\n }\n\n return items;\n }\n}\n\nfunction resolveLabelSource(label: SdBreadcrumbLabel, route?: ActivatedRouteSnapshot): MaybeAsync<string | null | undefined> {\n return typeof label === 'function' ? label(route) : label;\n}\n\nfunction isRouteConfig(value: SdBreadcrumbLabel | SdBreadcrumbRouteConfig): value is SdBreadcrumbRouteConfig {\n return typeof value === 'object' && value !== null && 'label' in value;\n}\n\nfunction normalizeMaxItems(value: number | string | null | undefined): number {\n const parsed = Number(value);\n return Number.isFinite(parsed) ? Math.max(3, Math.floor(parsed)) : 5;\n}\n\nfunction isModifiedMouseEvent(event: Event): boolean {\n return event instanceof MouseEvent && (event.button !== 0 || event.ctrlKey || event.metaKey || event.shiftKey || event.altKey);\n}\n","<nav class=\"sd-breadcrumb\" [attr.aria-label]=\"ariaLabel()\">\n <ol class=\"sd-breadcrumb__list\">\n @for (entry of visibleEntries(); track entry.kind === 'item' ? entry.item : $index; let last = $last) {\n <li class=\"sd-breadcrumb__entry\">\n @if (entry.kind === 'ellipsis') {\n <span class=\"sd-breadcrumb__ellipsis\" aria-hidden=\"true\">…</span>\n } @else {\n @let item = entry.item;\n @let template = itemTemplate();\n @if (!last && !item.disabled && href(item) !== null) {\n <a class=\"sd-breadcrumb__item\" [attr.href]=\"href(item)\" (click)=\"activate(item, $event)\">\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"templateContext(item)\"></ng-container>\n } @else {\n @if (item.icon) {\n <sd-icon class=\"sd-breadcrumb__icon\" aria-hidden=\"true\" [name]=\"item.icon\" [fontSet]=\"item.fontSet\"></sd-icon>\n }\n <span>{{ item.label }}</span>\n }\n </a>\n } @else if (!last && !item.disabled && (item.url || item.clickable)) {\n <button type=\"button\" class=\"sd-breadcrumb__item\" (click)=\"activate(item, $event)\">\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"templateContext(item)\"></ng-container>\n } @else {\n @if (item.icon) {\n <sd-icon class=\"sd-breadcrumb__icon\" aria-hidden=\"true\" [name]=\"item.icon\" [fontSet]=\"item.fontSet\"></sd-icon>\n }\n <span>{{ item.label }}</span>\n }\n </button>\n } @else {\n <span\n class=\"sd-breadcrumb__item\"\n [class.sd-breadcrumb__item--disabled]=\"item.disabled\"\n [attr.aria-disabled]=\"item.disabled ? 'true' : null\"\n [attr.aria-current]=\"last ? 'page' : null\">\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"templateContext(item)\"></ng-container>\n } @else {\n @if (item.icon) {\n <sd-icon class=\"sd-breadcrumb__icon\" aria-hidden=\"true\" [name]=\"item.icon\" [fontSet]=\"item.fontSet\"></sd-icon>\n }\n <span>{{ item.label }}</span>\n }\n </span>\n }\n }\n\n @if (!last) {\n <sd-icon class=\"sd-breadcrumb__separator\" aria-hidden=\"true\" [name]=\"separator()\"></sd-icon>\n }\n </li>\n }\n </ol>\n</nav>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAqEa,YAAY,CAAA;IACd,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC5C,IAAA,aAAa,GAAG,MAAM,CAAC,CAAC,yDAAC;AACzB,IAAA,cAAc,GAAG,MAAM,CAA6B,EAAE,0DAAC;AAEvD,IAAA,KAAK,GAAG,KAAK,CAAiD,SAAS,iDAAC;AACxE,IAAA,QAAQ,GAAG,KAAK,CAAC,CAAC,4CAAI,SAAS,EAAE,iBAAiB,EAAA,CAAA,GAAA,CAA9B,EAAE,SAAS,EAAE,iBAAiB,EAAE,GAAC;AACrD,IAAA,SAAS,GAAG,KAAK,CAAC,YAAY,qDAAC;AAC/B,IAAA,SAAS,GAAG,KAAK,CAAC,eAAe,qDAAC;IAClC,cAAc,GAAG,MAAM,EAAoB;AAEjC,IAAA,YAAY,GAAG,YAAY,CAA+C,WAAW,wDAAC;AACtF,IAAA,cAAc,GAAG,QAAQ,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aAAa,CAAC,KAAkD,EAAA;AACvE,IAAA,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK;AACxE;AAEA,SAAS,iBAAiB,CAAC,KAAyC,EAAA;AAClE,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC;IAC5B,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC;AACtE;AAEA,SAAS,oBAAoB,CAAC,KAAY,EAAA;IACxC,OAAO,KAAK,YAAY,UAAU,KAAK,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,MAAM,CAAC;AAChI;;AE9LA;;AAEG;;;;"}
@@ -0,0 +1,68 @@
1
+ import { NgTemplateOutlet } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, TemplateRef, Directive, input, booleanAttribute, output, contentChild, computed, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import { TranslatePipe } from '@sdcorejs/angular/i18n';
5
+ import { SdIcon } from '@sdcorejs/angular/modules/icon';
6
+
7
+ class SdDataStateTemplateDirective {
8
+ template = inject(TemplateRef);
9
+ static ngTemplateContextGuard(_directive, _context) {
10
+ return true;
11
+ }
12
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDataStateTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
13
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.25", type: SdDataStateTemplateDirective, isStandalone: true, selector: "ng-template[sdDataStateTemplate]", ngImport: i0 });
14
+ }
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDataStateTemplateDirective, decorators: [{
16
+ type: Directive,
17
+ args: [{
18
+ selector: 'ng-template[sdDataStateTemplate]',
19
+ standalone: true,
20
+ }]
21
+ }] });
22
+ const DEFAULT_ICON = {
23
+ loading: 'progress_activity',
24
+ empty: 'inbox',
25
+ error: 'error_outline',
26
+ forbidden: 'lock',
27
+ success: null,
28
+ };
29
+ class SdDataState {
30
+ state = input('success', ...(ngDevMode ? [{ debugName: "state" }] : []));
31
+ title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
32
+ message = input(...(ngDevMode ? [undefined, { debugName: "message" }] : []));
33
+ icon = input(...(ngDevMode ? [undefined, { debugName: "icon" }] : []));
34
+ fontSet = input(...(ngDevMode ? [undefined, { debugName: "fontSet" }] : []));
35
+ retryable = input(false, ...(ngDevMode ? [{ debugName: "retryable", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
36
+ retryLabel = input(...(ngDevMode ? [undefined, { debugName: "retryLabel" }] : []));
37
+ actionLabel = input(...(ngDevMode ? [undefined, { debugName: "actionLabel" }] : []));
38
+ compact = input(false, ...(ngDevMode ? [{ debugName: "compact", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
39
+ fullPage = input(false, ...(ngDevMode ? [{ debugName: "fullPage", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
40
+ sdRetry = output();
41
+ sdAction = output();
42
+ customTemplate = contentChild(SdDataStateTemplateDirective, ...(ngDevMode ? [{ debugName: "customTemplate" }] : []));
43
+ effectiveIcon = computed(() => this.icon() ?? DEFAULT_ICON[this.state()], ...(ngDevMode ? [{ debugName: "effectiveIcon" }] : []));
44
+ titleKey = computed(() => `core.component.data-state.${this.state()}.title`, ...(ngDevMode ? [{ debugName: "titleKey" }] : []));
45
+ messageKey = computed(() => `core.component.data-state.${this.state()}.message`, ...(ngDevMode ? [{ debugName: "messageKey" }] : []));
46
+ role = computed(() => this.state() === 'error' || this.state() === 'forbidden' ? 'alert' : 'status', ...(ngDevMode ? [{ debugName: "role" }] : []));
47
+ retry = () => this.sdRetry.emit();
48
+ action = () => this.sdAction.emit();
49
+ templateContext = computed(() => ({
50
+ $implicit: this.state(),
51
+ state: this.state(),
52
+ retry: this.retry,
53
+ action: this.action,
54
+ }), ...(ngDevMode ? [{ debugName: "templateContext" }] : []));
55
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDataState, deps: [], target: i0.ɵɵFactoryTarget.Component });
56
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdDataState, isStandalone: true, selector: "sd-data-state", inputs: { state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, fontSet: { classPropertyName: "fontSet", publicName: "fontSet", isSignal: true, isRequired: false, transformFunction: null }, retryable: { classPropertyName: "retryable", publicName: "retryable", isSignal: true, isRequired: false, transformFunction: null }, retryLabel: { classPropertyName: "retryLabel", publicName: "retryLabel", isSignal: true, isRequired: false, transformFunction: null }, actionLabel: { classPropertyName: "actionLabel", publicName: "actionLabel", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, fullPage: { classPropertyName: "fullPage", publicName: "fullPage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sdRetry: "sdRetry", sdAction: "sdAction" }, queries: [{ propertyName: "customTemplate", first: true, predicate: SdDataStateTemplateDirective, descendants: true, isSignal: true }], ngImport: i0, template: "@let currentState = state();\n@let template = customTemplate();\n\n@if (currentState === 'success') {\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template.template\" [ngTemplateOutletContext]=\"templateContext()\"></ng-container>\n } @else {\n <ng-content></ng-content>\n }\n} @else if (template) {\n <ng-container [ngTemplateOutlet]=\"template.template\" [ngTemplateOutletContext]=\"templateContext()\"></ng-container>\n} @else {\n <section\n class=\"sd-data-state\"\n [class.sd-data-state--compact]=\"compact()\"\n [class.sd-data-state--full-page]=\"fullPage()\"\n [attr.data-state]=\"currentState\"\n [attr.role]=\"role()\"\n [attr.aria-busy]=\"currentState === 'loading' ? 'true' : null\"\n [attr.aria-live]=\"role() === 'alert' ? 'assertive' : 'polite'\">\n @if (effectiveIcon(); as currentIcon) {\n <sd-icon class=\"sd-data-state__icon\" aria-hidden=\"true\" [name]=\"currentIcon\" [fontSet]=\"fontSet()\"></sd-icon>\n }\n\n <div class=\"sd-data-state__title\">{{ title() ?? (titleKey() | translate) }}</div>\n <div class=\"sd-data-state__message\">{{ message() ?? (messageKey() | translate) }}</div>\n\n @if (retryable() || actionLabel()) {\n <div class=\"sd-data-state__actions\">\n @if (retryable()) {\n <button type=\"button\" data-state-retry (click)=\"retry()\">\n {{ retryLabel() || ('core.component.data-state.retry' | translate) }}\n </button>\n }\n @if (actionLabel(); as label) {\n <button type=\"button\" data-state-action (click)=\"action()\">{{ label }}</button>\n }\n </div>\n }\n </section>\n}\n", styles: [":host{display:contents}.sd-data-state{box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;width:100%;min-height:240px;padding:32px;text-align:center;color:var(--sd-text, #2f3136)}.sd-data-state--compact{min-height:120px;padding:16px}.sd-data-state--full-page{min-height:100dvh}.sd-data-state__icon{width:48px;height:48px;color:var(--sd-text-secondary, #667085)}[data-state=loading] .sd-data-state__icon{animation:sd-data-state-spin 1s linear infinite}[data-state=error] .sd-data-state__icon,[data-state=forbidden] .sd-data-state__icon{color:var(--sd-error, #d92d20)}.sd-data-state__title{font-size:18px;font-weight:600;line-height:24px}.sd-data-state__message{max-width:520px;color:var(--sd-text-secondary, #667085);font-size:14px;line-height:20px}.sd-data-state__actions{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:8px}.sd-data-state__actions button{min-height:36px;padding:8px 14px;border:1px solid var(--sd-border, #d0d5dd);border-radius:6px;background:#fff;color:var(--sd-text, #2f3136);font:inherit;cursor:pointer}.sd-data-state__actions button:focus-visible{outline:2px solid var(--sd-info, #1677ff);outline-offset:2px}@keyframes sd-data-state-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){[data-state=loading] .sd-data-state__icon{animation:none}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
57
+ }
58
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDataState, decorators: [{
59
+ type: Component,
60
+ args: [{ selector: 'sd-data-state', standalone: true, imports: [NgTemplateOutlet, TranslatePipe, SdIcon], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let currentState = state();\n@let template = customTemplate();\n\n@if (currentState === 'success') {\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template.template\" [ngTemplateOutletContext]=\"templateContext()\"></ng-container>\n } @else {\n <ng-content></ng-content>\n }\n} @else if (template) {\n <ng-container [ngTemplateOutlet]=\"template.template\" [ngTemplateOutletContext]=\"templateContext()\"></ng-container>\n} @else {\n <section\n class=\"sd-data-state\"\n [class.sd-data-state--compact]=\"compact()\"\n [class.sd-data-state--full-page]=\"fullPage()\"\n [attr.data-state]=\"currentState\"\n [attr.role]=\"role()\"\n [attr.aria-busy]=\"currentState === 'loading' ? 'true' : null\"\n [attr.aria-live]=\"role() === 'alert' ? 'assertive' : 'polite'\">\n @if (effectiveIcon(); as currentIcon) {\n <sd-icon class=\"sd-data-state__icon\" aria-hidden=\"true\" [name]=\"currentIcon\" [fontSet]=\"fontSet()\"></sd-icon>\n }\n\n <div class=\"sd-data-state__title\">{{ title() ?? (titleKey() | translate) }}</div>\n <div class=\"sd-data-state__message\">{{ message() ?? (messageKey() | translate) }}</div>\n\n @if (retryable() || actionLabel()) {\n <div class=\"sd-data-state__actions\">\n @if (retryable()) {\n <button type=\"button\" data-state-retry (click)=\"retry()\">\n {{ retryLabel() || ('core.component.data-state.retry' | translate) }}\n </button>\n }\n @if (actionLabel(); as label) {\n <button type=\"button\" data-state-action (click)=\"action()\">{{ label }}</button>\n }\n </div>\n }\n </section>\n}\n", styles: [":host{display:contents}.sd-data-state{box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;width:100%;min-height:240px;padding:32px;text-align:center;color:var(--sd-text, #2f3136)}.sd-data-state--compact{min-height:120px;padding:16px}.sd-data-state--full-page{min-height:100dvh}.sd-data-state__icon{width:48px;height:48px;color:var(--sd-text-secondary, #667085)}[data-state=loading] .sd-data-state__icon{animation:sd-data-state-spin 1s linear infinite}[data-state=error] .sd-data-state__icon,[data-state=forbidden] .sd-data-state__icon{color:var(--sd-error, #d92d20)}.sd-data-state__title{font-size:18px;font-weight:600;line-height:24px}.sd-data-state__message{max-width:520px;color:var(--sd-text-secondary, #667085);font-size:14px;line-height:20px}.sd-data-state__actions{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:8px}.sd-data-state__actions button{min-height:36px;padding:8px 14px;border:1px solid var(--sd-border, #d0d5dd);border-radius:6px;background:#fff;color:var(--sd-text, #2f3136);font:inherit;cursor:pointer}.sd-data-state__actions button:focus-visible{outline:2px solid var(--sd-info, #1677ff);outline-offset:2px}@keyframes sd-data-state-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){[data-state=loading] .sd-data-state__icon{animation:none}}\n"] }]
61
+ }], propDecorators: { state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], fontSet: [{ type: i0.Input, args: [{ isSignal: true, alias: "fontSet", required: false }] }], retryable: [{ type: i0.Input, args: [{ isSignal: true, alias: "retryable", required: false }] }], retryLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "retryLabel", required: false }] }], actionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionLabel", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], fullPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullPage", required: false }] }], sdRetry: [{ type: i0.Output, args: ["sdRetry"] }], sdAction: [{ type: i0.Output, args: ["sdAction"] }], customTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdDataStateTemplateDirective), { isSignal: true }] }] } });
62
+
63
+ /**
64
+ * Generated bundle index. Do not edit.
65
+ */
66
+
67
+ export { SdDataState, SdDataStateTemplateDirective };
68
+ //# sourceMappingURL=sdcorejs-angular-components-data-state.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdcorejs-angular-components-data-state.mjs","sources":["../../../projects/sdcorejs-angular/components/data-state/src/data-state.component.ts","../../../projects/sdcorejs-angular/components/data-state/src/data-state.component.html","../../../projects/sdcorejs-angular/components/data-state/sdcorejs-angular-components-data-state.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n Directive,\n TemplateRef,\n booleanAttribute,\n computed,\n contentChild,\n inject,\n input,\n output,\n} from '@angular/core';\nimport { TranslatePipe } from '@sdcorejs/angular/i18n';\nimport { SdIcon, SdIconSet } from '@sdcorejs/angular/modules/icon';\n\nexport type SdDataStateKind = 'loading' | 'empty' | 'error' | 'forbidden' | 'success';\n\nexport interface SdDataStateTemplateContext {\n readonly $implicit: SdDataStateKind;\n readonly state: SdDataStateKind;\n readonly retry: () => void;\n readonly action: () => void;\n}\n\n@Directive({\n selector: 'ng-template[sdDataStateTemplate]',\n standalone: true,\n})\nexport class SdDataStateTemplateDirective {\n readonly template = inject<TemplateRef<SdDataStateTemplateContext>>(TemplateRef);\n\n static ngTemplateContextGuard(_directive: SdDataStateTemplateDirective, _context: unknown): _context is SdDataStateTemplateContext {\n return true;\n }\n}\n\nconst DEFAULT_ICON: Readonly<Record<SdDataStateKind, string | null>> = {\n loading: 'progress_activity',\n empty: 'inbox',\n error: 'error_outline',\n forbidden: 'lock',\n success: null,\n};\n\n@Component({\n selector: 'sd-data-state',\n standalone: true,\n imports: [NgTemplateOutlet, TranslatePipe, SdIcon],\n templateUrl: './data-state.component.html',\n styleUrl: './data-state.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SdDataState {\n readonly state = input<SdDataStateKind>('success');\n readonly title = input<string | null | undefined>();\n readonly message = input<string | null | undefined>();\n readonly icon = input<string | null | undefined>();\n readonly fontSet = input<SdIconSet | undefined>();\n readonly retryable = input(false, { transform: booleanAttribute });\n readonly retryLabel = input<string | null | undefined>();\n readonly actionLabel = input<string | null | undefined>();\n readonly compact = input(false, { transform: booleanAttribute });\n readonly fullPage = input(false, { transform: booleanAttribute });\n readonly sdRetry = output<void>();\n readonly sdAction = output<void>();\n\n protected readonly customTemplate = contentChild(SdDataStateTemplateDirective);\n protected readonly effectiveIcon = computed(() => this.icon() ?? DEFAULT_ICON[this.state()]);\n protected readonly titleKey = computed(() => `core.component.data-state.${this.state()}.title`);\n protected readonly messageKey = computed(() => `core.component.data-state.${this.state()}.message`);\n protected readonly role = computed<'alert' | 'status'>(() =>\n this.state() === 'error' || this.state() === 'forbidden' ? 'alert' : 'status'\n );\n\n protected readonly retry = (): void => this.sdRetry.emit();\n protected readonly action = (): void => this.sdAction.emit();\n protected readonly templateContext = computed<SdDataStateTemplateContext>(() => ({\n $implicit: this.state(),\n state: this.state(),\n retry: this.retry,\n action: this.action,\n }));\n}\n","@let currentState = state();\n@let template = customTemplate();\n\n@if (currentState === 'success') {\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template.template\" [ngTemplateOutletContext]=\"templateContext()\"></ng-container>\n } @else {\n <ng-content></ng-content>\n }\n} @else if (template) {\n <ng-container [ngTemplateOutlet]=\"template.template\" [ngTemplateOutletContext]=\"templateContext()\"></ng-container>\n} @else {\n <section\n class=\"sd-data-state\"\n [class.sd-data-state--compact]=\"compact()\"\n [class.sd-data-state--full-page]=\"fullPage()\"\n [attr.data-state]=\"currentState\"\n [attr.role]=\"role()\"\n [attr.aria-busy]=\"currentState === 'loading' ? 'true' : null\"\n [attr.aria-live]=\"role() === 'alert' ? 'assertive' : 'polite'\">\n @if (effectiveIcon(); as currentIcon) {\n <sd-icon class=\"sd-data-state__icon\" aria-hidden=\"true\" [name]=\"currentIcon\" [fontSet]=\"fontSet()\"></sd-icon>\n }\n\n <div class=\"sd-data-state__title\">{{ title() ?? (titleKey() | translate) }}</div>\n <div class=\"sd-data-state__message\">{{ message() ?? (messageKey() | translate) }}</div>\n\n @if (retryable() || actionLabel()) {\n <div class=\"sd-data-state__actions\">\n @if (retryable()) {\n <button type=\"button\" data-state-retry (click)=\"retry()\">\n {{ retryLabel() || ('core.component.data-state.retry' | translate) }}\n </button>\n }\n @if (actionLabel(); as label) {\n <button type=\"button\" data-state-action (click)=\"action()\">{{ label }}</button>\n }\n </div>\n }\n </section>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MA6Ba,4BAA4B,CAAA;AAC9B,IAAA,QAAQ,GAAG,MAAM,CAA0C,WAAW,CAAC;AAEhF,IAAA,OAAO,sBAAsB,CAAC,UAAwC,EAAE,QAAiB,EAAA;AACvF,QAAA,OAAO,IAAI;IACb;wGALW,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EA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A,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,OAAA,EAAA,KAAA,EAAA,SAAA,EAAA,MAAA,EAAA,aAAA,EAAA,qBAAA,EAAA,WAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAArB,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAK9B,WAAW,EAAA,UAAA,EAAA,CAAA;kBARvB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAAA,UAAA,EACb,IAAI,EAAA,OAAA,EACP,CAAC,gBAAgB,EAAE,aAAa,EAAE,MAAM,CAAC,EAAA,eAAA,EAGjC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,+nDAAA,EAAA,MAAA,EAAA,CAAA,q1CAAA,CAAA,EAAA;6nCAgBE,4BAA4B,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEnE/E;;AAEG;;;;"}
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, EventEmitter, Output, Input, Component } from '@angular/core';
2
+ import { inject, output, Input, Component, input } from '@angular/core';
3
3
  import { CommonModule } from '@angular/common';
4
4
  import * as i1 from '@ckeditor/ckeditor5-angular';
5
5
  import { CKEditorModule } from '@ckeditor/ckeditor5-angular';
@@ -66,7 +66,7 @@ class SdHeaderFooterBuilder {
66
66
  this.#model = value;
67
67
  }
68
68
  }
69
- modelChange = new EventEmitter();
69
+ modelChange = output();
70
70
  #editorI18n = {
71
71
  t: (key, params) => this.#i18n.t(key, params),
72
72
  };
@@ -116,7 +116,7 @@ class SdHeaderFooterBuilder {
116
116
  this.#editor.setData(this.#model || '');
117
117
  this.#editor.model.document.on('change:data', () => {
118
118
  this.#model = this.#editor.getData();
119
- this.modelChange.next(this.#model);
119
+ this.modelChange.emit(this.#model);
120
120
  });
121
121
  }
122
122
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdHeaderFooterBuilder, deps: [], target: i0.ɵɵFactoryTarget.Component });
@@ -135,9 +135,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
135
135
  `, styles: [":host ::ng-deep .header-footer-editor-wrapper .ck-editor__editable_inline{min-height:100px;max-height:200px;padding:10px 20px;border:1px solid #ddd}:host ::ng-deep .page-number-marker,:host ::ng-deep .total-page-marker{font-size:11px;color:#555;cursor:default;-webkit-user-select:none;user-select:none}\n"] }]
136
136
  }], propDecorators: { model: [{
137
137
  type: Input
138
- }], modelChange: [{
139
- type: Output
140
- }] } });
138
+ }], modelChange: [{ type: i0.Output, args: ["modelChange"] }] } });
141
139
 
142
140
  /**
143
141
  * Cấu hình màu cho Document Builder
@@ -4408,13 +4406,13 @@ function normalize(content) {
4408
4406
 
4409
4407
  class SdDocumentBuilder {
4410
4408
  #i18n = inject(I18nService);
4411
- option;
4409
+ option = input.required(...(ngDevMode ? [{ debugName: "option" }] : []));
4412
4410
  disabled = false;
4413
4411
  set _disabled(val) {
4414
4412
  this.disabled = val === '' || !!val;
4415
4413
  this.#updateState();
4416
4414
  }
4417
- contentChange = new EventEmitter(); // Emit HTML content
4415
+ contentChange = output(); // Emit HTML content
4418
4416
  Editor = ClassicEditor;
4419
4417
  #editor;
4420
4418
  #id = '55b0afb0-288d-423c-98b3-5f9db286e16d';
@@ -4432,7 +4430,7 @@ class SdDocumentBuilder {
4432
4430
  };
4433
4431
  // Config
4434
4432
  config = {
4435
- getOption: () => this.option,
4433
+ getOption: () => this.option(),
4436
4434
  _i18n: this.#editorI18n,
4437
4435
  licenseKey: 'GPL', // Hoặc key thương mại nếu có
4438
4436
  plugins: [
@@ -4599,11 +4597,12 @@ class SdDocumentBuilder {
4599
4597
  const orientationPlugin = editor.plugins.get('PageOrientation');
4600
4598
  if (orientationPlugin && typeof orientationPlugin.onOrientationChange === 'function') {
4601
4599
  orientationPlugin.onOrientationChange(orientation => {
4602
- this.option.onOrientation?.(orientation);
4600
+ this.option().onOrientation?.(orientation);
4603
4601
  });
4604
4602
  // Set initial orientation if provided
4605
- if (this.option.orientation) {
4606
- orientationPlugin.setOrientation(this.option.orientation);
4603
+ const option = this.option();
4604
+ if (option.orientation) {
4605
+ orientationPlugin.setOrientation(option.orientation);
4607
4606
  }
4608
4607
  }
4609
4608
  }
@@ -4612,7 +4611,7 @@ class SdDocumentBuilder {
4612
4611
  }
4613
4612
  // Lắng nghe selection
4614
4613
  editor.model.document.selection.on('change', $event => {
4615
- this.option.onSelection?.(this.#editor.model.document.selection, $event);
4614
+ this.option().onSelection?.(this.#editor.model.document.selection, $event);
4616
4615
  });
4617
4616
  // Lắng nghe sự kiện thay đổi nội dung
4618
4617
  editor.model.document.on('change:data', () => {
@@ -4649,8 +4648,9 @@ class SdDocumentBuilder {
4649
4648
  return;
4650
4649
  try {
4651
4650
  const ckCommentPlugin = this.#editor.plugins.get('CkComment');
4652
- if (ckCommentPlugin && this.option.comment) {
4653
- ckCommentPlugin.setConfig(this.option.comment);
4651
+ const option = this.option();
4652
+ if (ckCommentPlugin && option.comment) {
4653
+ ckCommentPlugin.setConfig(option.comment);
4654
4654
  }
4655
4655
  }
4656
4656
  catch (error) {
@@ -5020,20 +5020,15 @@ class SdDocumentBuilder {
5020
5020
  });
5021
5021
  };
5022
5022
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDocumentBuilder, deps: [], target: i0.ɵɵFactoryTarget.Component });
5023
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.25", type: SdDocumentBuilder, isStandalone: true, selector: "sd-document-builder", inputs: { option: "option", _disabled: ["disabled", "_disabled"] }, outputs: { contentChange: "contentChange" }, ngImport: i0, template: "<sd-ckeditor-styles />\n<div class=\"builder-container\">\n <ckeditor class=\"w-full\" [editor]=\"Editor\" [config]=\"config\" (ready)=\"onReady($event)\" [disabled]=\"disabled\"> </ckeditor>\n</div>\n", styles: ["@charset \"UTF-8\";.builder-container{height:100%;overflow-y:auto;width:100%;display:flex;flex-direction:column;align-items:center}:host{display:inline-block}:host ::ng-deep .ck-editor{display:flex;flex-direction:column;align-items:center;width:100%;--ck-content-font-family: \"Times New Roman\", serif !important;--ck-content-font-size: 13pt;--ck-content-line-height: 1.15}:host ::ng-deep .ck-editor__top,:host ::ng-deep .ck-editor__main{border:none!important;box-shadow:none!important}:host ::ng-deep .ck-editor__top{position:sticky;top:0;z-index:100;width:100%;min-width:600px;margin-bottom:10px}:host ::ng-deep .ck-editor__top .ck-sticky-panel__content{border:none!important}:host ::ng-deep .ck-editor__top .ck-toolbar{background:#fff!important;box-shadow:none!important;border-radius:8px;padding:8px!important}:host ::ng-deep .ck-editor__top .ck-toolbar .ck-toolbar__items{display:flex;justify-content:center;flex-wrap:wrap;align-items:center}:host ::ng-deep .ck-content{background-color:#fff;width:210mm;min-height:1123px;padding:20mm!important;box-sizing:border-box!important;box-shadow:0 10px 15px -3px #0000001a}:host ::ng-deep .ck-content h1,:host ::ng-deep .ck-content h2,:host ::ng-deep .ck-content h3,:host ::ng-deep .ck-content h4,:host ::ng-deep .ck-content h5,:host ::ng-deep .ck-content h6{font-weight:400;font-size:inherit;line-height:inherit;margin-bottom:4px}:host ::ng-deep .ck-content.landscape{width:297mm}:host ::ng-deep .ck-content>*{max-width:100%!important;box-sizing:border-box!important}:host ::ng-deep .ck-content p{margin-bottom:4px;text-indent:0}:host ::ng-deep .ck-content ul,:host ::ng-deep .ck-content ol{padding-left:20px!important;margin-left:0!important;margin-bottom:4px}:host ::ng-deep .ck-content li{margin-bottom:0}:host ::ng-deep .ck-content table{margin-bottom:4px}\n", ":host ::ng-deep .ck-heading-highlight{background-color:#fef08a}\n", "@charset \"UTF-8\";::ng-deep .ck-clipboard-drop-target-line{display:none!important}:host ::ng-deep .variable-widget{display:inline-block;-webkit-user-select:none;user-select:none}:host ::ng-deep .variable-widget:not([data-binding=true]):not([data-binding=html]){background-color:var(--sd-primary-light, #d7e3ff);color:var(--sd-primary, #005cbb);border:1px solid color-mix(in srgb,var(--sd-primary, #005cbb) 34%,var(--sd-border, #c4c6d0))!important;border-radius:4px;padding:2px 6px;font-size:0;margin:0 2px;vertical-align:middle;font-weight:600;cursor:default}:host ::ng-deep .variable-widget:not([data-binding=true]):not([data-binding=html]):before{content:attr(data-display);font-size:10px;font-family:Segoe UI,Tahoma,Geneva,Verdana,sans-serif}:host ::ng-deep .variable-widget:not([data-binding=true]):not([data-binding=html]):hover{background-color:color-mix(in srgb,var(--sd-primary-light, #d7e3ff) 78%,var(--sd-primary, #005cbb));box-shadow:0 1px 2px #0000001a}:host ::ng-deep .variable-widget:not([data-binding=true]):not([data-binding=html]).ck-widget_selected{outline:2px solid var(--sd-primary, #005cbb);background-color:color-mix(in srgb,var(--sd-primary-light, #d7e3ff) 78%,var(--sd-primary, #005cbb))}:host ::ng-deep .variable-widget[data-binding=true]{background-color:color-mix(in srgb,var(--sd-success-light, #d8f0d3) 62%,transparent);color:var(--sd-success, #2e7d32);border-bottom:2px solid var(--sd-success, #2e7d32)!important;border-radius:0;padding:0 1px;font-size:inherit;cursor:default}:host ::ng-deep .variable-widget[data-binding=true]:before{content:none}:host ::ng-deep .variable-widget[data-binding=true]:hover{background-color:color-mix(in srgb,var(--sd-success-light, #d8f0d3) 82%,transparent)}:host ::ng-deep .variable-widget[data-binding=true].ck-widget_selected{outline:2px solid var(--sd-success, #2e7d32);background-color:color-mix(in srgb,var(--sd-success-light, #d8f0d3) 90%,transparent)}:host ::ng-deep .variable-widget[data-binding=html]{display:block;background-color:transparent;border:1px dashed var(--sd-success, #2e7d32)!important;border-radius:4px;padding:4px;-webkit-user-select:text;user-select:text;pointer-events:none}:host ::ng-deep .variable-widget[data-binding=html]:before{content:none}:host ::ng-deep .variable-widget[data-binding=html]:hover{background-color:color-mix(in srgb,var(--sd-success-light, #d8f0d3) 42%,transparent)}:host ::ng-deep .variable-widget[data-binding=html].ck-widget_selected{outline:2px solid var(--sd-success, #2e7d32);background-color:color-mix(in srgb,var(--sd-success-light, #d8f0d3) 52%,transparent)}:host ::ng-deep .variable-widget[data-binding=html] .variable-html-content{display:block}:host ::ng-deep .ck.ck-content .ck-widget,:host ::ng-deep .ck.ck-content .ck-widget:hover,:host ::ng-deep .ck.ck-content .ck-widget:focus,:host ::ng-deep .ck.ck-content .ck-widget.ck-widget_selected,:host ::ng-deep .ck.ck-content .ck-widget.ck-widget_selected:hover{outline:none!important;box-shadow:none!important}\n", ":host ::ng-deep .highlight-range{background-color:#ffeb3b80;border-bottom:2px solid #fbc02d;transition:background-color .2s;cursor:pointer}\n", ":host ::ng-deep .ck-comment-marker{background-color:var(--comment-bg, rgba(59, 130, 246, .3));border-bottom:2px solid rgb(59,130,246);cursor:pointer;transition:all .2s ease}:host ::ng-deep .ck-comment-marker:hover{opacity:.8}:host ::ng-deep .ck-comment-marker.ck-comment-pending{background-color:var(--comment-pending-bg, rgba(245, 158, 11, .4));border-bottom-color:#f59e0b}:host ::ng-deep .ck-comment-marker.ck-comment-normal{background-color:var(--comment-bg, rgba(59, 130, 246, .2));border-bottom-color:#3b82f6}:host ::ng-deep .ck-comment-marker.ck-comment-selected{background-color:var(--comment-selected-bg, 59, 130, 246, .5);border-bottom-color:#3b82f6}:host ::ng-deep .ck-comment-marker.ck-comment-modified{background-color:var(--comment-modified-bg, rgba(249, 115, 22, .3));border-bottom-color:#f97316}:host ::ng-deep .ck-comment-marker.ck-comment-broken{background-color:var(--comment-broken-bg, rgba(239, 68, 68, .3));border-bottom-color:#ef4444;text-decoration:line-through;text-decoration-color:#ef4444}:host ::ng-deep .ck-balloon-panel .ck-button.ck-on:hover,:host ::ng-deep .ck-balloon-panel .ck-button.ck-off:hover{background:var(--ck-color-button-default-hover-background)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: CKEditorModule }, { kind: "component", type: i1.CKEditorComponent, selector: "ckeditor", inputs: ["editor", "config", "data", "tagName", "watchdog", "editorWatchdogConfig", "disableWatchdog", "disableTwoWayDataBinding", "disabled"], outputs: ["ready", "change", "blur", "focus", "error"] }, { kind: "component", type: SdCKEditorStyles, selector: "sd-ckeditor-styles" }] });
5023
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.25", type: SdDocumentBuilder, isStandalone: true, selector: "sd-document-builder", inputs: { option: { classPropertyName: "option", publicName: "option", isSignal: true, isRequired: true, transformFunction: null }, _disabled: { classPropertyName: "_disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { contentChange: "contentChange" }, ngImport: i0, template: "<sd-ckeditor-styles />\n<div class=\"builder-container\">\n <ckeditor class=\"w-full\" [editor]=\"Editor\" [config]=\"config\" (ready)=\"onReady($event)\" [disabled]=\"disabled\"> </ckeditor>\n</div>\n", styles: ["@charset \"UTF-8\";.builder-container{height:100%;overflow-y:auto;width:100%;display:flex;flex-direction:column;align-items:center}:host{display:inline-block}:host ::ng-deep .ck-editor{display:flex;flex-direction:column;align-items:center;width:100%;--ck-content-font-family: \"Times New Roman\", serif !important;--ck-content-font-size: 13pt;--ck-content-line-height: 1.15}:host ::ng-deep .ck-editor__top,:host ::ng-deep .ck-editor__main{border:none!important;box-shadow:none!important}:host ::ng-deep .ck-editor__top{position:sticky;top:0;z-index:100;width:100%;min-width:600px;margin-bottom:10px}:host ::ng-deep .ck-editor__top .ck-sticky-panel__content{border:none!important}:host ::ng-deep .ck-editor__top .ck-toolbar{background:#fff!important;box-shadow:none!important;border-radius:8px;padding:8px!important}:host ::ng-deep .ck-editor__top .ck-toolbar .ck-toolbar__items{display:flex;justify-content:center;flex-wrap:wrap;align-items:center}:host ::ng-deep .ck-content{background-color:#fff;width:210mm;min-height:1123px;padding:20mm!important;box-sizing:border-box!important;box-shadow:0 10px 15px -3px #0000001a}:host ::ng-deep .ck-content h1,:host ::ng-deep .ck-content h2,:host ::ng-deep .ck-content h3,:host ::ng-deep .ck-content h4,:host ::ng-deep .ck-content h5,:host ::ng-deep .ck-content h6{font-weight:400;font-size:inherit;line-height:inherit;margin-bottom:4px}:host ::ng-deep .ck-content.landscape{width:297mm}:host ::ng-deep .ck-content>*{max-width:100%!important;box-sizing:border-box!important}:host ::ng-deep .ck-content p{margin-bottom:4px;text-indent:0}:host ::ng-deep .ck-content ul,:host ::ng-deep .ck-content ol{padding-left:20px!important;margin-left:0!important;margin-bottom:4px}:host ::ng-deep .ck-content li{margin-bottom:0}:host ::ng-deep .ck-content table{margin-bottom:4px}\n", ":host ::ng-deep .ck-heading-highlight{background-color:#fef08a}\n", "@charset \"UTF-8\";::ng-deep .ck-clipboard-drop-target-line{display:none!important}:host ::ng-deep .variable-widget{display:inline-block;-webkit-user-select:none;user-select:none}:host ::ng-deep .variable-widget:not([data-binding=true]):not([data-binding=html]){background-color:var(--sd-primary-light, #d7e3ff);color:var(--sd-primary, #005cbb);border:1px solid color-mix(in srgb,var(--sd-primary, #005cbb) 34%,var(--sd-border, #c4c6d0))!important;border-radius:4px;padding:2px 6px;font-size:0;margin:0 2px;vertical-align:middle;font-weight:600;cursor:default}:host ::ng-deep .variable-widget:not([data-binding=true]):not([data-binding=html]):before{content:attr(data-display);font-size:10px;font-family:Segoe UI,Tahoma,Geneva,Verdana,sans-serif}:host ::ng-deep .variable-widget:not([data-binding=true]):not([data-binding=html]):hover{background-color:color-mix(in srgb,var(--sd-primary-light, #d7e3ff) 78%,var(--sd-primary, #005cbb));box-shadow:0 1px 2px #0000001a}:host ::ng-deep .variable-widget:not([data-binding=true]):not([data-binding=html]).ck-widget_selected{outline:2px solid var(--sd-primary, #005cbb);background-color:color-mix(in srgb,var(--sd-primary-light, #d7e3ff) 78%,var(--sd-primary, #005cbb))}:host ::ng-deep .variable-widget[data-binding=true]{background-color:color-mix(in srgb,var(--sd-success-light, #d8f0d3) 62%,transparent);color:var(--sd-success, #2e7d32);border-bottom:2px solid var(--sd-success, #2e7d32)!important;border-radius:0;padding:0 1px;font-size:inherit;cursor:default}:host ::ng-deep .variable-widget[data-binding=true]:before{content:none}:host ::ng-deep .variable-widget[data-binding=true]:hover{background-color:color-mix(in srgb,var(--sd-success-light, #d8f0d3) 82%,transparent)}:host ::ng-deep .variable-widget[data-binding=true].ck-widget_selected{outline:2px solid var(--sd-success, #2e7d32);background-color:color-mix(in srgb,var(--sd-success-light, #d8f0d3) 90%,transparent)}:host ::ng-deep .variable-widget[data-binding=html]{display:block;background-color:transparent;border:1px dashed var(--sd-success, #2e7d32)!important;border-radius:4px;padding:4px;-webkit-user-select:text;user-select:text;pointer-events:none}:host ::ng-deep .variable-widget[data-binding=html]:before{content:none}:host ::ng-deep .variable-widget[data-binding=html]:hover{background-color:color-mix(in srgb,var(--sd-success-light, #d8f0d3) 42%,transparent)}:host ::ng-deep .variable-widget[data-binding=html].ck-widget_selected{outline:2px solid var(--sd-success, #2e7d32);background-color:color-mix(in srgb,var(--sd-success-light, #d8f0d3) 52%,transparent)}:host ::ng-deep .variable-widget[data-binding=html] .variable-html-content{display:block}:host ::ng-deep .ck.ck-content .ck-widget,:host ::ng-deep .ck.ck-content .ck-widget:hover,:host ::ng-deep .ck.ck-content .ck-widget:focus,:host ::ng-deep .ck.ck-content .ck-widget.ck-widget_selected,:host ::ng-deep .ck.ck-content .ck-widget.ck-widget_selected:hover{outline:none!important;box-shadow:none!important}\n", ":host ::ng-deep .highlight-range{background-color:#ffeb3b80;border-bottom:2px solid #fbc02d;transition:background-color .2s;cursor:pointer}\n", ":host ::ng-deep .ck-comment-marker{background-color:var(--comment-bg, rgba(59, 130, 246, .3));border-bottom:2px solid rgb(59,130,246);cursor:pointer;transition:all .2s ease}:host ::ng-deep .ck-comment-marker:hover{opacity:.8}:host ::ng-deep .ck-comment-marker.ck-comment-pending{background-color:var(--comment-pending-bg, rgba(245, 158, 11, .4));border-bottom-color:#f59e0b}:host ::ng-deep .ck-comment-marker.ck-comment-normal{background-color:var(--comment-bg, rgba(59, 130, 246, .2));border-bottom-color:#3b82f6}:host ::ng-deep .ck-comment-marker.ck-comment-selected{background-color:var(--comment-selected-bg, 59, 130, 246, .5);border-bottom-color:#3b82f6}:host ::ng-deep .ck-comment-marker.ck-comment-modified{background-color:var(--comment-modified-bg, rgba(249, 115, 22, .3));border-bottom-color:#f97316}:host ::ng-deep .ck-comment-marker.ck-comment-broken{background-color:var(--comment-broken-bg, rgba(239, 68, 68, .3));border-bottom-color:#ef4444;text-decoration:line-through;text-decoration-color:#ef4444}:host ::ng-deep .ck-balloon-panel .ck-button.ck-on:hover,:host ::ng-deep .ck-balloon-panel .ck-button.ck-off:hover{background:var(--ck-color-button-default-hover-background)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: CKEditorModule }, { kind: "component", type: i1.CKEditorComponent, selector: "ckeditor", inputs: ["editor", "config", "data", "tagName", "watchdog", "editorWatchdogConfig", "disableWatchdog", "disableTwoWayDataBinding", "disabled"], outputs: ["ready", "change", "blur", "focus", "error"] }, { kind: "component", type: SdCKEditorStyles, selector: "sd-ckeditor-styles" }] });
5024
5024
  }
5025
5025
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDocumentBuilder, decorators: [{
5026
5026
  type: Component,
5027
5027
  args: [{ selector: 'sd-document-builder', standalone: true, imports: [CommonModule, CKEditorModule, SdCKEditorStyles], template: "<sd-ckeditor-styles />\n<div class=\"builder-container\">\n <ckeditor class=\"w-full\" [editor]=\"Editor\" [config]=\"config\" (ready)=\"onReady($event)\" [disabled]=\"disabled\"> </ckeditor>\n</div>\n", styles: ["@charset \"UTF-8\";.builder-container{height:100%;overflow-y:auto;width:100%;display:flex;flex-direction:column;align-items:center}:host{display:inline-block}:host ::ng-deep .ck-editor{display:flex;flex-direction:column;align-items:center;width:100%;--ck-content-font-family: \"Times New Roman\", serif !important;--ck-content-font-size: 13pt;--ck-content-line-height: 1.15}:host ::ng-deep .ck-editor__top,:host ::ng-deep .ck-editor__main{border:none!important;box-shadow:none!important}:host ::ng-deep .ck-editor__top{position:sticky;top:0;z-index:100;width:100%;min-width:600px;margin-bottom:10px}:host ::ng-deep .ck-editor__top .ck-sticky-panel__content{border:none!important}:host ::ng-deep .ck-editor__top .ck-toolbar{background:#fff!important;box-shadow:none!important;border-radius:8px;padding:8px!important}:host ::ng-deep .ck-editor__top .ck-toolbar .ck-toolbar__items{display:flex;justify-content:center;flex-wrap:wrap;align-items:center}:host ::ng-deep .ck-content{background-color:#fff;width:210mm;min-height:1123px;padding:20mm!important;box-sizing:border-box!important;box-shadow:0 10px 15px -3px #0000001a}:host ::ng-deep .ck-content h1,:host ::ng-deep .ck-content h2,:host ::ng-deep .ck-content h3,:host ::ng-deep .ck-content h4,:host ::ng-deep .ck-content h5,:host ::ng-deep .ck-content h6{font-weight:400;font-size:inherit;line-height:inherit;margin-bottom:4px}:host ::ng-deep .ck-content.landscape{width:297mm}:host ::ng-deep .ck-content>*{max-width:100%!important;box-sizing:border-box!important}:host ::ng-deep .ck-content p{margin-bottom:4px;text-indent:0}:host ::ng-deep .ck-content ul,:host ::ng-deep .ck-content ol{padding-left:20px!important;margin-left:0!important;margin-bottom:4px}:host ::ng-deep .ck-content li{margin-bottom:0}:host ::ng-deep .ck-content table{margin-bottom:4px}\n", ":host ::ng-deep .ck-heading-highlight{background-color:#fef08a}\n", "@charset \"UTF-8\";::ng-deep .ck-clipboard-drop-target-line{display:none!important}:host ::ng-deep .variable-widget{display:inline-block;-webkit-user-select:none;user-select:none}:host ::ng-deep .variable-widget:not([data-binding=true]):not([data-binding=html]){background-color:var(--sd-primary-light, #d7e3ff);color:var(--sd-primary, #005cbb);border:1px solid color-mix(in srgb,var(--sd-primary, #005cbb) 34%,var(--sd-border, #c4c6d0))!important;border-radius:4px;padding:2px 6px;font-size:0;margin:0 2px;vertical-align:middle;font-weight:600;cursor:default}:host ::ng-deep .variable-widget:not([data-binding=true]):not([data-binding=html]):before{content:attr(data-display);font-size:10px;font-family:Segoe UI,Tahoma,Geneva,Verdana,sans-serif}:host ::ng-deep .variable-widget:not([data-binding=true]):not([data-binding=html]):hover{background-color:color-mix(in srgb,var(--sd-primary-light, #d7e3ff) 78%,var(--sd-primary, #005cbb));box-shadow:0 1px 2px #0000001a}:host ::ng-deep .variable-widget:not([data-binding=true]):not([data-binding=html]).ck-widget_selected{outline:2px solid var(--sd-primary, #005cbb);background-color:color-mix(in srgb,var(--sd-primary-light, #d7e3ff) 78%,var(--sd-primary, #005cbb))}:host ::ng-deep .variable-widget[data-binding=true]{background-color:color-mix(in srgb,var(--sd-success-light, #d8f0d3) 62%,transparent);color:var(--sd-success, #2e7d32);border-bottom:2px solid var(--sd-success, #2e7d32)!important;border-radius:0;padding:0 1px;font-size:inherit;cursor:default}:host ::ng-deep .variable-widget[data-binding=true]:before{content:none}:host ::ng-deep .variable-widget[data-binding=true]:hover{background-color:color-mix(in srgb,var(--sd-success-light, #d8f0d3) 82%,transparent)}:host ::ng-deep .variable-widget[data-binding=true].ck-widget_selected{outline:2px solid var(--sd-success, #2e7d32);background-color:color-mix(in srgb,var(--sd-success-light, #d8f0d3) 90%,transparent)}:host ::ng-deep .variable-widget[data-binding=html]{display:block;background-color:transparent;border:1px dashed var(--sd-success, #2e7d32)!important;border-radius:4px;padding:4px;-webkit-user-select:text;user-select:text;pointer-events:none}:host ::ng-deep .variable-widget[data-binding=html]:before{content:none}:host ::ng-deep .variable-widget[data-binding=html]:hover{background-color:color-mix(in srgb,var(--sd-success-light, #d8f0d3) 42%,transparent)}:host ::ng-deep .variable-widget[data-binding=html].ck-widget_selected{outline:2px solid var(--sd-success, #2e7d32);background-color:color-mix(in srgb,var(--sd-success-light, #d8f0d3) 52%,transparent)}:host ::ng-deep .variable-widget[data-binding=html] .variable-html-content{display:block}:host ::ng-deep .ck.ck-content .ck-widget,:host ::ng-deep .ck.ck-content .ck-widget:hover,:host ::ng-deep .ck.ck-content .ck-widget:focus,:host ::ng-deep .ck.ck-content .ck-widget.ck-widget_selected,:host ::ng-deep .ck.ck-content .ck-widget.ck-widget_selected:hover{outline:none!important;box-shadow:none!important}\n", ":host ::ng-deep .highlight-range{background-color:#ffeb3b80;border-bottom:2px solid #fbc02d;transition:background-color .2s;cursor:pointer}\n", ":host ::ng-deep .ck-comment-marker{background-color:var(--comment-bg, rgba(59, 130, 246, .3));border-bottom:2px solid rgb(59,130,246);cursor:pointer;transition:all .2s ease}:host ::ng-deep .ck-comment-marker:hover{opacity:.8}:host ::ng-deep .ck-comment-marker.ck-comment-pending{background-color:var(--comment-pending-bg, rgba(245, 158, 11, .4));border-bottom-color:#f59e0b}:host ::ng-deep .ck-comment-marker.ck-comment-normal{background-color:var(--comment-bg, rgba(59, 130, 246, .2));border-bottom-color:#3b82f6}:host ::ng-deep .ck-comment-marker.ck-comment-selected{background-color:var(--comment-selected-bg, 59, 130, 246, .5);border-bottom-color:#3b82f6}:host ::ng-deep .ck-comment-marker.ck-comment-modified{background-color:var(--comment-modified-bg, rgba(249, 115, 22, .3));border-bottom-color:#f97316}:host ::ng-deep .ck-comment-marker.ck-comment-broken{background-color:var(--comment-broken-bg, rgba(239, 68, 68, .3));border-bottom-color:#ef4444;text-decoration:line-through;text-decoration-color:#ef4444}:host ::ng-deep .ck-balloon-panel .ck-button.ck-on:hover,:host ::ng-deep .ck-balloon-panel .ck-button.ck-off:hover{background:var(--ck-color-button-default-hover-background)}\n"] }]
5028
- }], propDecorators: { option: [{
5029
- type: Input,
5030
- args: [{ required: true }]
5031
- }], _disabled: [{
5028
+ }], propDecorators: { option: [{ type: i0.Input, args: [{ isSignal: true, alias: "option", required: true }] }], _disabled: [{
5032
5029
  type: Input,
5033
5030
  args: ['disabled']
5034
- }], contentChange: [{
5035
- type: Output
5036
- }] } });
5031
+ }], contentChange: [{ type: i0.Output, args: ["contentChange"] }] } });
5037
5032
 
5038
5033
  /**
5039
5034
  * Generated bundle index. Do not edit.