@frame-kit/ui-ng 0.0.1
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/COMPONENTS.md +683 -0
- package/DEVELOPMENT_GUIDE.md +1102 -0
- package/LICENSE +21 -0
- package/README.md +69 -0
- package/THEMING.md +130 -0
- package/core/headline/README.md +121 -0
- package/core/icon/README.md +173 -0
- package/core/image/README.md +210 -0
- package/core/link/README.md +297 -0
- package/core/separator/README.md +145 -0
- package/core/text/README.md +240 -0
- package/directives/infinite-scroll/README.md +102 -0
- package/directives/spotlight/README.md +154 -0
- package/directives/tooltip/README.md +147 -0
- package/docs/endpoint-link/README.md +142 -0
- package/docs/method-badge/README.md +154 -0
- package/fesm2022/frame-kit-ui-ng-core-headline.mjs +122 -0
- package/fesm2022/frame-kit-ui-ng-core-headline.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-core-icon.mjs +189 -0
- package/fesm2022/frame-kit-ui-ng-core-icon.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-core-image.mjs +123 -0
- package/fesm2022/frame-kit-ui-ng-core-image.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-core-link.mjs +369 -0
- package/fesm2022/frame-kit-ui-ng-core-link.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-core-separator.mjs +59 -0
- package/fesm2022/frame-kit-ui-ng-core-separator.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-core-text.mjs +204 -0
- package/fesm2022/frame-kit-ui-ng-core-text.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-directives-infinite-scroll.mjs +74 -0
- package/fesm2022/frame-kit-ui-ng-directives-infinite-scroll.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-directives-spotlight.mjs +76 -0
- package/fesm2022/frame-kit-ui-ng-directives-spotlight.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-directives-tooltip.mjs +425 -0
- package/fesm2022/frame-kit-ui-ng-directives-tooltip.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-docs-endpoint-link.mjs +63 -0
- package/fesm2022/frame-kit-ui-ng-docs-endpoint-link.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-docs-method-badge.mjs +43 -0
- package/fesm2022/frame-kit-ui-ng-docs-method-badge.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-forms.mjs +3632 -0
- package/fesm2022/frame-kit-ui-ng-forms.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-layouts-app-shell.mjs +239 -0
- package/fesm2022/frame-kit-ui-ng-layouts-app-shell.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-layouts-content-split.mjs +132 -0
- package/fesm2022/frame-kit-ui-ng-layouts-content-split.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-services-overlay-orchestrator.mjs +133 -0
- package/fesm2022/frame-kit-ui-ng-services-overlay-orchestrator.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-services-spotlight.mjs +60 -0
- package/fesm2022/frame-kit-ui-ng-services-spotlight.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-services-toast.mjs +166 -0
- package/fesm2022/frame-kit-ui-ng-services-toast.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-accordion.mjs +214 -0
- package/fesm2022/frame-kit-ui-ng-ui-accordion.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-alert.mjs +82 -0
- package/fesm2022/frame-kit-ui-ng-ui-alert.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-avatar-stack.mjs +76 -0
- package/fesm2022/frame-kit-ui-ng-ui-avatar-stack.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-avatar.mjs +81 -0
- package/fesm2022/frame-kit-ui-ng-ui-avatar.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-badge.mjs +81 -0
- package/fesm2022/frame-kit-ui-ng-ui-badge.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-breadcrumb.mjs +68 -0
- package/fesm2022/frame-kit-ui-ng-ui-breadcrumb.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-button.mjs +108 -0
- package/fesm2022/frame-kit-ui-ng-ui-button.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-callout.mjs +58 -0
- package/fesm2022/frame-kit-ui-ng-ui-callout.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-card.mjs +70 -0
- package/fesm2022/frame-kit-ui-ng-ui-card.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-copyable-field.mjs +113 -0
- package/fesm2022/frame-kit-ui-ng-ui-copyable-field.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-data-table.mjs +1288 -0
- package/fesm2022/frame-kit-ui-ng-ui-data-table.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-dialog.mjs +456 -0
- package/fesm2022/frame-kit-ui-ng-ui-dialog.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-drawer.mjs +398 -0
- package/fesm2022/frame-kit-ui-ng-ui-drawer.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-dropdown-menu.mjs +398 -0
- package/fesm2022/frame-kit-ui-ng-ui-dropdown-menu.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-editable-field.mjs +125 -0
- package/fesm2022/frame-kit-ui-ng-ui-editable-field.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-icon-badge.mjs +113 -0
- package/fesm2022/frame-kit-ui-ng-ui-icon-badge.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-icon-list.mjs +111 -0
- package/fesm2022/frame-kit-ui-ng-ui-icon-list.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-inline-edit.mjs +103 -0
- package/fesm2022/frame-kit-ui-ng-ui-inline-edit.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-list-editor.mjs +135 -0
- package/fesm2022/frame-kit-ui-ng-ui-list-editor.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-loader.mjs +81 -0
- package/fesm2022/frame-kit-ui-ng-ui-loader.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-menu-item.mjs +79 -0
- package/fesm2022/frame-kit-ui-ng-ui-menu-item.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-nav-brand.mjs +40 -0
- package/fesm2022/frame-kit-ui-ng-ui-nav-brand.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-nav-group.mjs +110 -0
- package/fesm2022/frame-kit-ui-ng-ui-nav-group.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-nav-separator.mjs +91 -0
- package/fesm2022/frame-kit-ui-ng-ui-nav-separator.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-node-tree-breadcrumb.mjs +86 -0
- package/fesm2022/frame-kit-ui-ng-ui-node-tree-breadcrumb.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-node-tree.mjs +443 -0
- package/fesm2022/frame-kit-ui-ng-ui-node-tree.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-note.mjs +56 -0
- package/fesm2022/frame-kit-ui-ng-ui-note.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-numbered-list.mjs +105 -0
- package/fesm2022/frame-kit-ui-ng-ui-numbered-list.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-pagination.mjs +110 -0
- package/fesm2022/frame-kit-ui-ng-ui-pagination.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-progress-bar.mjs +129 -0
- package/fesm2022/frame-kit-ui-ng-ui-progress-bar.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-sidenav-link.mjs +42 -0
- package/fesm2022/frame-kit-ui-ng-ui-sidenav-link.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-tabs.mjs +894 -0
- package/fesm2022/frame-kit-ui-ng-ui-tabs.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-timeline.mjs +81 -0
- package/fesm2022/frame-kit-ui-ng-ui-timeline.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-toast.mjs +179 -0
- package/fesm2022/frame-kit-ui-ng-ui-toast.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-user-menu.mjs +143 -0
- package/fesm2022/frame-kit-ui-ng-ui-user-menu.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-wizard-dialog.mjs +191 -0
- package/fesm2022/frame-kit-ui-ng-ui-wizard-dialog.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng.mjs +58 -0
- package/fesm2022/frame-kit-ui-ng.mjs.map +1 -0
- package/layouts/app-shell/README.md +357 -0
- package/layouts/content-split/README.md +180 -0
- package/package.json +253 -0
- package/services/overlay-orchestrator/README.md +184 -0
- package/services/spotlight/README.md +61 -0
- package/services/toast/README.md +118 -0
- package/types/frame-kit-ui-ng-core-headline.d.ts +38 -0
- package/types/frame-kit-ui-ng-core-icon.d.ts +74 -0
- package/types/frame-kit-ui-ng-core-image.d.ts +93 -0
- package/types/frame-kit-ui-ng-core-link.d.ts +251 -0
- package/types/frame-kit-ui-ng-core-separator.d.ts +28 -0
- package/types/frame-kit-ui-ng-core-text.d.ts +186 -0
- package/types/frame-kit-ui-ng-directives-infinite-scroll.d.ts +42 -0
- package/types/frame-kit-ui-ng-directives-spotlight.d.ts +51 -0
- package/types/frame-kit-ui-ng-directives-tooltip.d.ts +70 -0
- package/types/frame-kit-ui-ng-docs-endpoint-link.d.ts +43 -0
- package/types/frame-kit-ui-ng-docs-method-badge.d.ts +30 -0
- package/types/frame-kit-ui-ng-forms.d.ts +1674 -0
- package/types/frame-kit-ui-ng-layouts-app-shell.d.ts +75 -0
- package/types/frame-kit-ui-ng-layouts-content-split.d.ts +43 -0
- package/types/frame-kit-ui-ng-services-overlay-orchestrator.d.ts +96 -0
- package/types/frame-kit-ui-ng-services-spotlight.d.ts +32 -0
- package/types/frame-kit-ui-ng-services-toast.d.ts +100 -0
- package/types/frame-kit-ui-ng-ui-accordion.d.ts +86 -0
- package/types/frame-kit-ui-ng-ui-alert.d.ts +34 -0
- package/types/frame-kit-ui-ng-ui-avatar-stack.d.ts +38 -0
- package/types/frame-kit-ui-ng-ui-avatar.d.ts +36 -0
- package/types/frame-kit-ui-ng-ui-badge.d.ts +33 -0
- package/types/frame-kit-ui-ng-ui-breadcrumb.d.ts +45 -0
- package/types/frame-kit-ui-ng-ui-button.d.ts +48 -0
- package/types/frame-kit-ui-ng-ui-callout.d.ts +26 -0
- package/types/frame-kit-ui-ng-ui-card.d.ts +30 -0
- package/types/frame-kit-ui-ng-ui-copyable-field.d.ts +62 -0
- package/types/frame-kit-ui-ng-ui-data-table.d.ts +482 -0
- package/types/frame-kit-ui-ng-ui-dialog.d.ts +166 -0
- package/types/frame-kit-ui-ng-ui-drawer.d.ts +130 -0
- package/types/frame-kit-ui-ng-ui-dropdown-menu.d.ts +77 -0
- package/types/frame-kit-ui-ng-ui-editable-field.d.ts +65 -0
- package/types/frame-kit-ui-ng-ui-icon-badge.d.ts +45 -0
- package/types/frame-kit-ui-ng-ui-icon-list.d.ts +67 -0
- package/types/frame-kit-ui-ng-ui-inline-edit.d.ts +44 -0
- package/types/frame-kit-ui-ng-ui-list-editor.d.ts +56 -0
- package/types/frame-kit-ui-ng-ui-loader.d.ts +32 -0
- package/types/frame-kit-ui-ng-ui-menu-item.d.ts +27 -0
- package/types/frame-kit-ui-ng-ui-nav-brand.d.ts +25 -0
- package/types/frame-kit-ui-ng-ui-nav-group.d.ts +60 -0
- package/types/frame-kit-ui-ng-ui-nav-separator.d.ts +33 -0
- package/types/frame-kit-ui-ng-ui-node-tree-breadcrumb.d.ts +35 -0
- package/types/frame-kit-ui-ng-ui-node-tree.d.ts +135 -0
- package/types/frame-kit-ui-ng-ui-note.d.ts +22 -0
- package/types/frame-kit-ui-ng-ui-numbered-list.d.ts +52 -0
- package/types/frame-kit-ui-ng-ui-pagination.d.ts +49 -0
- package/types/frame-kit-ui-ng-ui-progress-bar.d.ts +50 -0
- package/types/frame-kit-ui-ng-ui-sidenav-link.d.ts +24 -0
- package/types/frame-kit-ui-ng-ui-tabs.d.ts +266 -0
- package/types/frame-kit-ui-ng-ui-timeline.d.ts +42 -0
- package/types/frame-kit-ui-ng-ui-toast.d.ts +56 -0
- package/types/frame-kit-ui-ng-ui-user-menu.d.ts +87 -0
- package/types/frame-kit-ui-ng-ui-wizard-dialog.d.ts +116 -0
- package/types/frame-kit-ui-ng.d.ts +53 -0
- package/ui/accordion/README.md +261 -0
- package/ui/alert/README.md +211 -0
- package/ui/avatar/README.md +167 -0
- package/ui/avatar-stack/README.md +164 -0
- package/ui/badge/README.md +162 -0
- package/ui/breadcrumb/README.md +240 -0
- package/ui/button/README.md +184 -0
- package/ui/callout/README.md +159 -0
- package/ui/card/README.md +174 -0
- package/ui/copyable-field/README.md +235 -0
- package/ui/data-table/README.md +408 -0
- package/ui/dialog/README.md +222 -0
- package/ui/drawer/README.md +274 -0
- package/ui/dropdown-menu/README.md +336 -0
- package/ui/editable-field/README.md +171 -0
- package/ui/icon-badge/README.md +131 -0
- package/ui/icon-list/README.md +205 -0
- package/ui/inline-edit/README.md +135 -0
- package/ui/list-editor/README.md +162 -0
- package/ui/loader/README.md +160 -0
- package/ui/menu-item/README.md +204 -0
- package/ui/nav-brand/README.md +111 -0
- package/ui/nav-group/README.md +145 -0
- package/ui/nav-separator/README.md +44 -0
- package/ui/node-tree/README.md +278 -0
- package/ui/node-tree-breadcrumb/README.md +164 -0
- package/ui/note/README.md +146 -0
- package/ui/numbered-list/README.md +187 -0
- package/ui/pagination/README.md +174 -0
- package/ui/progress-bar/README.md +223 -0
- package/ui/sidenav-link/README.md +214 -0
- package/ui/tabs/README.md +204 -0
- package/ui/timeline/README.md +285 -0
- package/ui/toast/README.md +243 -0
- package/ui/user-menu/README.md +260 -0
- package/ui/wizard-dialog/README.md +283 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, computed, HostBinding, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
class NoteComponent {
|
|
5
|
+
// ===== INPUTS =====
|
|
6
|
+
/** Semantic variant driving the color of the note text. */
|
|
7
|
+
variant = input('info', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
8
|
+
/** When true, renders the note text in italic style. */
|
|
9
|
+
italic = input(false, ...(ngDevMode ? [{ debugName: "italic" }] : /* istanbul ignore next */ []));
|
|
10
|
+
// ===== BASE PROPS =====
|
|
11
|
+
className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
12
|
+
id = input(null, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
13
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
14
|
+
// ===== COMPUTED =====
|
|
15
|
+
classes = computed(() => {
|
|
16
|
+
return [
|
|
17
|
+
'fk-note',
|
|
18
|
+
`fk-note--${this.variant()}`,
|
|
19
|
+
this.italic() ? 'fk-note--italic' : '',
|
|
20
|
+
this.className(),
|
|
21
|
+
]
|
|
22
|
+
.filter(Boolean)
|
|
23
|
+
.join(' ');
|
|
24
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
25
|
+
get hostClass() {
|
|
26
|
+
return this.classes();
|
|
27
|
+
}
|
|
28
|
+
get hostId() {
|
|
29
|
+
return this.id();
|
|
30
|
+
}
|
|
31
|
+
get hostAriaLabel() {
|
|
32
|
+
return this.ariaLabel();
|
|
33
|
+
}
|
|
34
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NoteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
35
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.9", type: NoteComponent, isStandalone: true, selector: "fk-note", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, italic: { classPropertyName: "italic", publicName: "italic", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClass", "attr.id": "this.hostId", "attr.aria-label": "this.hostAriaLabel" } }, ngImport: i0, template: "<ng-content />\n", styles: [":host{display:block;padding-block:var(--fk-note-padding-block, var(--fk-rhythm-2, .5rem));padding-inline-start:var(--fk-note-padding-inline-start, var(--fk-rhythm-4, 1rem));border-inline-start:var(--fk-note-border-width, 3px) solid var(--fk-note-info-accent, var(--fk-color-primary, #0a84ff));color:var(--fk-note-color, var(--fk-color-text, #1f2d3d));font-size:var(--fk-note-font-size, var(--fk-typography-body-font-size, .875rem));line-height:var(--fk-note-line-height, var(--fk-typography-body-line-height, 1.5))}:host.fk-note--info{border-inline-start-color:var(--fk-note-info-accent, var(--fk-color-primary, #0a84ff))}:host.fk-note--success{border-inline-start-color:var(--fk-note-success-accent, var(--fk-color-success, #10b981))}:host.fk-note--warning{border-inline-start-color:var(--fk-note-warning-accent, var(--fk-color-warning, #f59e0b))}:host.fk-note--danger{border-inline-start-color:var(--fk-note-danger-accent, var(--fk-color-danger, #e02424))}:host.fk-note--italic{font-style:italic}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
36
|
+
}
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NoteComponent, decorators: [{
|
|
38
|
+
type: Component,
|
|
39
|
+
args: [{ selector: 'fk-note', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content />\n", styles: [":host{display:block;padding-block:var(--fk-note-padding-block, var(--fk-rhythm-2, .5rem));padding-inline-start:var(--fk-note-padding-inline-start, var(--fk-rhythm-4, 1rem));border-inline-start:var(--fk-note-border-width, 3px) solid var(--fk-note-info-accent, var(--fk-color-primary, #0a84ff));color:var(--fk-note-color, var(--fk-color-text, #1f2d3d));font-size:var(--fk-note-font-size, var(--fk-typography-body-font-size, .875rem));line-height:var(--fk-note-line-height, var(--fk-typography-body-line-height, 1.5))}:host.fk-note--info{border-inline-start-color:var(--fk-note-info-accent, var(--fk-color-primary, #0a84ff))}:host.fk-note--success{border-inline-start-color:var(--fk-note-success-accent, var(--fk-color-success, #10b981))}:host.fk-note--warning{border-inline-start-color:var(--fk-note-warning-accent, var(--fk-color-warning, #f59e0b))}:host.fk-note--danger{border-inline-start-color:var(--fk-note-danger-accent, var(--fk-color-danger, #e02424))}:host.fk-note--italic{font-style:italic}\n"] }]
|
|
40
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], italic: [{ type: i0.Input, args: [{ isSignal: true, alias: "italic", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], hostClass: [{
|
|
41
|
+
type: HostBinding,
|
|
42
|
+
args: ['class']
|
|
43
|
+
}], hostId: [{
|
|
44
|
+
type: HostBinding,
|
|
45
|
+
args: ['attr.id']
|
|
46
|
+
}], hostAriaLabel: [{
|
|
47
|
+
type: HostBinding,
|
|
48
|
+
args: ['attr.aria-label']
|
|
49
|
+
}] } });
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Generated bundle index. Do not edit.
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
export { NoteComponent };
|
|
56
|
+
//# sourceMappingURL=frame-kit-ui-ng-ui-note.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame-kit-ui-ng-ui-note.mjs","sources":["../../../../packages/ui-ng/ui/note/note.component.ts","../../../../packages/ui-ng/ui/note/note.component.html","../../../../packages/ui-ng/ui/note/frame-kit-ui-ng-ui-note.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n HostBinding,\n input,\n} from '@angular/core';\n\nimport type { NoteVariant } from './note.types';\n\n@Component({\n selector: 'fk-note',\n standalone: true,\n imports: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './note.component.html',\n styleUrl: './note.component.scss',\n})\nexport class NoteComponent {\n // ===== INPUTS =====\n /** Semantic variant driving the color of the note text. */\n readonly variant = input<NoteVariant>('info');\n /** When true, renders the note text in italic style. */\n readonly italic = input<boolean>(false);\n\n // ===== BASE PROPS =====\n readonly className = input<string>('');\n readonly id = input<string | null>(null);\n readonly ariaLabel = input<string | null>(null);\n\n // ===== COMPUTED =====\n readonly classes = computed(() => {\n return [\n 'fk-note',\n `fk-note--${this.variant()}`,\n this.italic() ? 'fk-note--italic' : '',\n this.className(),\n ]\n .filter(Boolean)\n .join(' ');\n });\n\n @HostBinding('class')\n get hostClass() {\n return this.classes();\n }\n\n @HostBinding('attr.id')\n get hostId() {\n return this.id();\n }\n\n @HostBinding('attr.aria-label')\n get hostAriaLabel() {\n return this.ariaLabel();\n }\n}\n","<ng-content />\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAkBa,aAAa,CAAA;;;AAGf,IAAA,OAAO,GAAG,KAAK,CAAc,MAAM,8EAAC;;AAEpC,IAAA,MAAM,GAAG,KAAK,CAAU,KAAK,6EAAC;;AAG9B,IAAA,SAAS,GAAG,KAAK,CAAS,EAAE,gFAAC;A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WAAW;uBAAC,OAAO;;sBAKnB,WAAW;uBAAC,SAAS;;sBAKrB,WAAW;uBAAC,iBAAiB;;;AEpDhC;;AAEG;;;;"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, input, computed, HostBinding, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
const NUMBERED_LIST_PARENT = new InjectionToken('NUMBERED_LIST_PARENT');
|
|
5
|
+
|
|
6
|
+
class NumberedListItemComponent {
|
|
7
|
+
// When rendered inside an `fk-numbered-list`, we look up the parent
|
|
8
|
+
// via its `NUMBERED_LIST_PARENT` token and treat its inputs as
|
|
9
|
+
// defaults for items that don't override them. Outside a list, the
|
|
10
|
+
// item stands alone with its own defaults. The token indirection
|
|
11
|
+
// breaks the circular ES-module import that a direct
|
|
12
|
+
// `NumberedListComponent` type reference would create.
|
|
13
|
+
parent = inject(NUMBERED_LIST_PARENT, { optional: true });
|
|
14
|
+
// ===== INPUTS =====
|
|
15
|
+
/** Size for this item; falls back to the parent numbered-list's `size` when null. */
|
|
16
|
+
size = input(null, ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
17
|
+
// ===== BASE PROPS =====
|
|
18
|
+
className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
19
|
+
id = input(null, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
20
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
21
|
+
// ===== COMPUTED =====
|
|
22
|
+
resolvedSize = computed(() => this.size() ?? this.parent?.size() ?? 'md', ...(ngDevMode ? [{ debugName: "resolvedSize" }] : /* istanbul ignore next */ []));
|
|
23
|
+
classes = computed(() => {
|
|
24
|
+
return [
|
|
25
|
+
'fk-numbered-list-item',
|
|
26
|
+
`fk-numbered-list-item--${this.resolvedSize()}`,
|
|
27
|
+
this.className(),
|
|
28
|
+
]
|
|
29
|
+
.filter(Boolean)
|
|
30
|
+
.join(' ');
|
|
31
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
32
|
+
get hostClass() {
|
|
33
|
+
return this.classes();
|
|
34
|
+
}
|
|
35
|
+
// Only carry `role="listitem"` when we're actually inside a list
|
|
36
|
+
// container. Outside a list the item is presentational and should
|
|
37
|
+
// not advertise list semantics — screen readers would otherwise
|
|
38
|
+
// announce an orphan listitem.
|
|
39
|
+
get hostRole() {
|
|
40
|
+
return this.parent ? 'listitem' : null;
|
|
41
|
+
}
|
|
42
|
+
get hostId() {
|
|
43
|
+
return this.id();
|
|
44
|
+
}
|
|
45
|
+
get hostAriaLabel() {
|
|
46
|
+
return this.ariaLabel();
|
|
47
|
+
}
|
|
48
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NumberedListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
49
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.9", type: NumberedListItemComponent, isStandalone: true, selector: "fk-numbered-list-item", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClass", "attr.role": "this.hostRole", "attr.id": "this.hostId", "attr.aria-label": "this.hostAriaLabel" } }, ngImport: i0, template: "<span class=\"fk-numbered-list-item__badge\" aria-hidden=\"true\"></span>\n<span class=\"fk-numbered-list-item__label\">\n <ng-content />\n</span>\n", styles: [":host{display:flex;align-items:flex-start;gap:var(--fk-numbered-list-item-gap, var(--fk-rhythm-3, .75rem));color:var(--fk-numbered-list-item-color, var(--fk-color-text, #1f2d3d));line-height:var(--fk-numbered-list-item-line-height, var(--fk-typography-body-line-height, 1.5));counter-increment:fk-numbered-list-counter}.fk-numbered-list-item__badge{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:var(--fk-numbered-list-badge-size, 1.5rem);height:var(--fk-numbered-list-badge-size, 1.5rem);border-radius:var(--fk-numbered-list-badge-radius, 50%);background:var(--fk-numbered-list-badge-bg, var(--fk-color-primary-light, #eaf4ff));color:var(--fk-numbered-list-badge-color, var(--fk-color-primary, #0a84ff));font-size:var(--fk-numbered-list-badge-font-size, .75rem);font-weight:var(--fk-numbered-list-badge-font-weight, var(--fk-font-weight-semibold, 600))}.fk-numbered-list-item__badge:before{content:counter(fk-numbered-list-counter)}.fk-numbered-list-item__label{min-width:0}:host.fk-numbered-list-item--sm{font-size:var(--fk-numbered-list-item-sm-font-size, var(--fk-typography-small-font-size, .8125rem))}:host.fk-numbered-list-item--md{font-size:var(--fk-numbered-list-item-md-font-size, var(--fk-typography-body-font-size, .9375rem))}:host.fk-numbered-list-item--lg{font-size:var(--fk-numbered-list-item-lg-font-size, var(--fk-typography-lead-font-size, 1rem))}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
50
|
+
}
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NumberedListItemComponent, decorators: [{
|
|
52
|
+
type: Component,
|
|
53
|
+
args: [{ selector: 'fk-numbered-list-item', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<span class=\"fk-numbered-list-item__badge\" aria-hidden=\"true\"></span>\n<span class=\"fk-numbered-list-item__label\">\n <ng-content />\n</span>\n", styles: [":host{display:flex;align-items:flex-start;gap:var(--fk-numbered-list-item-gap, var(--fk-rhythm-3, .75rem));color:var(--fk-numbered-list-item-color, var(--fk-color-text, #1f2d3d));line-height:var(--fk-numbered-list-item-line-height, var(--fk-typography-body-line-height, 1.5));counter-increment:fk-numbered-list-counter}.fk-numbered-list-item__badge{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:var(--fk-numbered-list-badge-size, 1.5rem);height:var(--fk-numbered-list-badge-size, 1.5rem);border-radius:var(--fk-numbered-list-badge-radius, 50%);background:var(--fk-numbered-list-badge-bg, var(--fk-color-primary-light, #eaf4ff));color:var(--fk-numbered-list-badge-color, var(--fk-color-primary, #0a84ff));font-size:var(--fk-numbered-list-badge-font-size, .75rem);font-weight:var(--fk-numbered-list-badge-font-weight, var(--fk-font-weight-semibold, 600))}.fk-numbered-list-item__badge:before{content:counter(fk-numbered-list-counter)}.fk-numbered-list-item__label{min-width:0}:host.fk-numbered-list-item--sm{font-size:var(--fk-numbered-list-item-sm-font-size, var(--fk-typography-small-font-size, .8125rem))}:host.fk-numbered-list-item--md{font-size:var(--fk-numbered-list-item-md-font-size, var(--fk-typography-body-font-size, .9375rem))}:host.fk-numbered-list-item--lg{font-size:var(--fk-numbered-list-item-lg-font-size, var(--fk-typography-lead-font-size, 1rem))}\n"] }]
|
|
54
|
+
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], hostClass: [{
|
|
55
|
+
type: HostBinding,
|
|
56
|
+
args: ['class']
|
|
57
|
+
}], hostRole: [{
|
|
58
|
+
type: HostBinding,
|
|
59
|
+
args: ['attr.role']
|
|
60
|
+
}], hostId: [{
|
|
61
|
+
type: HostBinding,
|
|
62
|
+
args: ['attr.id']
|
|
63
|
+
}], hostAriaLabel: [{
|
|
64
|
+
type: HostBinding,
|
|
65
|
+
args: ['attr.aria-label']
|
|
66
|
+
}] } });
|
|
67
|
+
|
|
68
|
+
class NumberedListComponent {
|
|
69
|
+
// ===== INPUTS =====
|
|
70
|
+
/** Optional array of items to render declaratively; when null, projected `fk-numbered-list-item` elements are used. */
|
|
71
|
+
items = input(null, ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
72
|
+
/** Size applied to every item in the list. */
|
|
73
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
74
|
+
// ===== BASE PROPS =====
|
|
75
|
+
className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
76
|
+
id = input(null, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
77
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
78
|
+
// ===== COMPUTED =====
|
|
79
|
+
classes = computed(() => {
|
|
80
|
+
return ['fk-numbered-list', this.className()].filter(Boolean).join(' ');
|
|
81
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
82
|
+
get hostClass() {
|
|
83
|
+
return this.classes();
|
|
84
|
+
}
|
|
85
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NumberedListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
86
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: NumberedListComponent, isStandalone: true, selector: "fk-numbered-list", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClass" } }, providers: [
|
|
87
|
+
{ provide: NUMBERED_LIST_PARENT, useExisting: NumberedListComponent },
|
|
88
|
+
], ngImport: i0, template: "<div\n class=\"fk-numbered-list__list\"\n role=\"list\"\n [id]=\"id() ?? undefined\"\n [attr.aria-label]=\"ariaLabel()\"\n>\n @if (items(); as rows) {\n @for (row of rows; track $index) {\n <fk-numbered-list-item>\n {{ row.label }}\n </fk-numbered-list-item>\n }\n } @else {\n <ng-content />\n }\n</div>\n", styles: [":host{display:block;margin-top:var(--fk-numbered-list-margin-top, var(--fk-rhythm-4, 1rem))}.fk-numbered-list__list{counter-reset:fk-numbered-list-counter;display:flex;flex-direction:column;gap:var(--fk-numbered-list-row-gap, var(--fk-rhythm-3, .75rem))}\n"], dependencies: [{ kind: "component", type: NumberedListItemComponent, selector: "fk-numbered-list-item", inputs: ["size", "className", "id", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
89
|
+
}
|
|
90
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NumberedListComponent, decorators: [{
|
|
91
|
+
type: Component,
|
|
92
|
+
args: [{ selector: 'fk-numbered-list', standalone: true, imports: [NumberedListItemComponent], providers: [
|
|
93
|
+
{ provide: NUMBERED_LIST_PARENT, useExisting: NumberedListComponent },
|
|
94
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"fk-numbered-list__list\"\n role=\"list\"\n [id]=\"id() ?? undefined\"\n [attr.aria-label]=\"ariaLabel()\"\n>\n @if (items(); as rows) {\n @for (row of rows; track $index) {\n <fk-numbered-list-item>\n {{ row.label }}\n </fk-numbered-list-item>\n }\n } @else {\n <ng-content />\n }\n</div>\n", styles: [":host{display:block;margin-top:var(--fk-numbered-list-margin-top, var(--fk-rhythm-4, 1rem))}.fk-numbered-list__list{counter-reset:fk-numbered-list-counter;display:flex;flex-direction:column;gap:var(--fk-numbered-list-row-gap, var(--fk-rhythm-3, .75rem))}\n"] }]
|
|
95
|
+
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], hostClass: [{
|
|
96
|
+
type: HostBinding,
|
|
97
|
+
args: ['class']
|
|
98
|
+
}] } });
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Generated bundle index. Do not edit.
|
|
102
|
+
*/
|
|
103
|
+
|
|
104
|
+
export { NumberedListComponent, NumberedListItemComponent };
|
|
105
|
+
//# sourceMappingURL=frame-kit-ui-ng-ui-numbered-list.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame-kit-ui-ng-ui-numbered-list.mjs","sources":["../../../../packages/ui-ng/ui/numbered-list/numbered-list.token.ts","../../../../packages/ui-ng/ui/numbered-list/numbered-list-item.component.ts","../../../../packages/ui-ng/ui/numbered-list/numbered-list-item.component.html","../../../../packages/ui-ng/ui/numbered-list/numbered-list.component.ts","../../../../packages/ui-ng/ui/numbered-list/numbered-list.component.html","../../../../packages/ui-ng/ui/numbered-list/frame-kit-ui-ng-ui-numbered-list.ts"],"sourcesContent":["import { InjectionToken, type Signal } from '@angular/core';\n\nimport type { NumberedListSize } from './numbered-list.types';\n\n/**\n * Parent contract exposed by `fk-numbered-list` to `fk-numbered-list-item`\n * children. Lives in its own file so the two components can reference it\n * without the circular ES-module import that a direct\n * `NumberedListComponent` type import would create (item -> list -> item).\n */\nexport interface NumberedListParent {\n readonly size: Signal<NumberedListSize>;\n}\n\nexport const NUMBERED_LIST_PARENT = new InjectionToken<NumberedListParent>(\n 'NUMBERED_LIST_PARENT',\n);\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n HostBinding,\n inject,\n input,\n} from '@angular/core';\n\nimport { NUMBERED_LIST_PARENT } from './numbered-list.token';\nimport type { NumberedListSize } from './numbered-list.types';\n\n@Component({\n selector: 'fk-numbered-list-item',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './numbered-list-item.component.html',\n styleUrl: './numbered-list-item.component.scss',\n})\nexport class NumberedListItemComponent {\n // When rendered inside an `fk-numbered-list`, we look up the parent\n // via its `NUMBERED_LIST_PARENT` token and treat its inputs as\n // defaults for items that don't override them. Outside a list, the\n // item stands alone with its own defaults. The token indirection\n // breaks the circular ES-module import that a direct\n // `NumberedListComponent` type reference would create.\n private readonly parent = inject(NUMBERED_LIST_PARENT, { optional: true });\n\n // ===== INPUTS =====\n /** Size for this item; falls back to the parent numbered-list's `size` when null. */\n readonly size = input<NumberedListSize | null>(null);\n\n // ===== BASE PROPS =====\n readonly className = input<string>('');\n readonly id = input<string | null>(null);\n readonly ariaLabel = input<string | null>(null);\n\n // ===== COMPUTED =====\n protected readonly resolvedSize = computed<NumberedListSize>(\n () => this.size() ?? this.parent?.size() ?? 'md',\n );\n\n readonly classes = computed(() => {\n return [\n 'fk-numbered-list-item',\n `fk-numbered-list-item--${this.resolvedSize()}`,\n this.className(),\n ]\n .filter(Boolean)\n .join(' ');\n });\n\n @HostBinding('class')\n get hostClass() {\n return this.classes();\n }\n\n // Only carry `role=\"listitem\"` when we're actually inside a list\n // container. Outside a list the item is presentational and should\n // not advertise list semantics — screen readers would otherwise\n // announce an orphan listitem.\n @HostBinding('attr.role')\n get hostRole(): string | null {\n return this.parent ? 'listitem' : null;\n }\n\n @HostBinding('attr.id')\n get hostId(): string | null {\n return this.id();\n }\n\n @HostBinding('attr.aria-label')\n get hostAriaLabel(): string | null {\n return this.ariaLabel();\n }\n}\n","<span class=\"fk-numbered-list-item__badge\" aria-hidden=\"true\"></span>\n<span class=\"fk-numbered-list-item__label\">\n <ng-content />\n</span>\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n HostBinding,\n input,\n} from '@angular/core';\n\nimport {\n NUMBERED_LIST_PARENT,\n type NumberedListParent,\n} from './numbered-list.token';\nimport type { NumberedListItem, NumberedListSize } from './numbered-list.types';\nimport { NumberedListItemComponent } from './numbered-list-item.component';\n\n@Component({\n selector: 'fk-numbered-list',\n standalone: true,\n imports: [NumberedListItemComponent],\n providers: [\n { provide: NUMBERED_LIST_PARENT, useExisting: NumberedListComponent },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './numbered-list.component.html',\n styleUrl: './numbered-list.component.scss',\n})\nexport class NumberedListComponent implements NumberedListParent {\n // ===== INPUTS =====\n /** Optional array of items to render declaratively; when null, projected `fk-numbered-list-item` elements are used. */\n readonly items = input<readonly NumberedListItem[] | null>(null);\n /** Size applied to every item in the list. */\n readonly size = input<NumberedListSize>('md');\n\n // ===== BASE PROPS =====\n readonly className = input<string>('');\n readonly id = input<string | null>(null);\n readonly ariaLabel = input<string | null>(null);\n\n // ===== COMPUTED =====\n readonly classes = computed(() => {\n return ['fk-numbered-list', this.className()].filter(Boolean).join(' ');\n });\n\n @HostBinding('class')\n get hostClass() {\n return this.classes();\n }\n}\n","<div\n class=\"fk-numbered-list__list\"\n role=\"list\"\n [id]=\"id() ?? undefined\"\n [attr.aria-label]=\"ariaLabel()\"\n>\n @if (items(); as rows) {\n @for (row of rows; track $index) {\n <fk-numbered-list-item>\n {{ row.label }}\n </fk-numbered-list-item>\n }\n } @else {\n <ng-content />\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAcO,MAAM,oBAAoB,GAAG,IAAI,cAAc,CACpD,sBAAsB,CACvB;;MCGY,yBAAyB,CAAA;;;;;;;IAOnB,MAAM,GAAG,MAAM,CAAC,oBAAoB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;;AAIjE,IAAA,IAAI,GAAG,KAAK,CAA0B,IAAI,2EAAC;;AAG3C,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EACP,CAAC,yBAAyB,CAAC,EAAA,SAAA,EACzB;AACT,wBAAA,EAAE,OAAO,EAAE,oBAAoB,EAAE,WAAW,uBAAuB,EAAE;qBACtE,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,oVAAA,EAAA,MAAA,EAAA,CAAA,kQAAA,CAAA,EAAA;;sBAqB9C,WAAW;uBAAC,OAAO;;;AE3CtB;;AAEG;;;;"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, output, computed, HostBinding, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { IconComponent } from '@frame-kit/ui-ng/core/icon';
|
|
4
|
+
|
|
5
|
+
let nextPaginationId = 0;
|
|
6
|
+
class PaginationComponent {
|
|
7
|
+
// ===== INPUTS =====
|
|
8
|
+
/** Current 1-based page number. */
|
|
9
|
+
page = input.required(...(ngDevMode ? [{ debugName: "page" }] : /* istanbul ignore next */ []));
|
|
10
|
+
/** Number of items shown per page (the page size). */
|
|
11
|
+
take = input.required(...(ngDevMode ? [{ debugName: "take" }] : /* istanbul ignore next */ []));
|
|
12
|
+
/** Total count of items across all pages used to compute `pageCount`. */
|
|
13
|
+
itemCount = input.required(...(ngDevMode ? [{ debugName: "itemCount" }] : /* istanbul ignore next */ []));
|
|
14
|
+
/** Available page-size values shown in the per-page selector. */
|
|
15
|
+
pageSizeOptions = input([10, 20, 50, 100], ...(ngDevMode ? [{ debugName: "pageSizeOptions" }] : /* istanbul ignore next */ []));
|
|
16
|
+
/** When true, renders first-page and last-page navigation buttons. */
|
|
17
|
+
showFirstLast = input(false, ...(ngDevMode ? [{ debugName: "showFirstLast" }] : /* istanbul ignore next */ []));
|
|
18
|
+
// ===== BASE PROPS =====
|
|
19
|
+
className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
20
|
+
id = input(null, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
21
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
22
|
+
// ===== OUTPUTS =====
|
|
23
|
+
/** Fires when the user navigates to a new page or changes the page size, emitting the new page and take. */
|
|
24
|
+
pageChange = output();
|
|
25
|
+
// ===== INTERNAL =====
|
|
26
|
+
selectId = `fk-pagination-take-${nextPaginationId++}`;
|
|
27
|
+
// ===== COMPUTED =====
|
|
28
|
+
/** Always >= 1. Empty datasets show "1 / 1" rather than "1 / 0". */
|
|
29
|
+
pageCount = computed(() => {
|
|
30
|
+
const count = this.itemCount();
|
|
31
|
+
const size = this.take();
|
|
32
|
+
return Math.ceil(count / size) || 1;
|
|
33
|
+
}, ...(ngDevMode ? [{ debugName: "pageCount" }] : /* istanbul ignore next */ []));
|
|
34
|
+
hasPreviousPage = computed(() => this.page() > 1, ...(ngDevMode ? [{ debugName: "hasPreviousPage" }] : /* istanbul ignore next */ []));
|
|
35
|
+
hasNextPage = computed(() => this.page() < this.pageCount(), ...(ngDevMode ? [{ debugName: "hasNextPage" }] : /* istanbul ignore next */ []));
|
|
36
|
+
rangeStart = computed(() => {
|
|
37
|
+
const count = this.itemCount();
|
|
38
|
+
if (count === 0) {
|
|
39
|
+
return 0;
|
|
40
|
+
}
|
|
41
|
+
return (this.page() - 1) * this.take() + 1;
|
|
42
|
+
}, ...(ngDevMode ? [{ debugName: "rangeStart" }] : /* istanbul ignore next */ []));
|
|
43
|
+
rangeEnd = computed(() => {
|
|
44
|
+
return Math.min(this.page() * this.take(), this.itemCount());
|
|
45
|
+
}, ...(ngDevMode ? [{ debugName: "rangeEnd" }] : /* istanbul ignore next */ []));
|
|
46
|
+
classes = computed(() => {
|
|
47
|
+
return ['fk-pagination', this.className()].filter(Boolean).join(' ');
|
|
48
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
49
|
+
get hostClass() {
|
|
50
|
+
return this.classes();
|
|
51
|
+
}
|
|
52
|
+
get hostId() {
|
|
53
|
+
return this.id();
|
|
54
|
+
}
|
|
55
|
+
get hostAriaLabel() {
|
|
56
|
+
return this.ariaLabel();
|
|
57
|
+
}
|
|
58
|
+
// ===== ACTIONS =====
|
|
59
|
+
/** Navigates to the first page if the current page is not already the first. */
|
|
60
|
+
goToFirst() {
|
|
61
|
+
if (this.hasPreviousPage()) {
|
|
62
|
+
this.pageChange.emit({ page: 1, take: this.take() });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/** Navigates to the previous page if one exists. */
|
|
66
|
+
goToPrevious() {
|
|
67
|
+
if (this.hasPreviousPage()) {
|
|
68
|
+
this.pageChange.emit({ page: this.page() - 1, take: this.take() });
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/** Navigates to the next page if one exists. */
|
|
72
|
+
goToNext() {
|
|
73
|
+
if (this.hasNextPage()) {
|
|
74
|
+
this.pageChange.emit({ page: this.page() + 1, take: this.take() });
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/** Navigates to the last page if the current page is not already the last. */
|
|
78
|
+
goToLast() {
|
|
79
|
+
if (this.hasNextPage()) {
|
|
80
|
+
this.pageChange.emit({ page: this.pageCount(), take: this.take() });
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
onPageSizeChange(event) {
|
|
84
|
+
const select = event.target;
|
|
85
|
+
const newTake = Number(select.value);
|
|
86
|
+
this.pageChange.emit({ page: 1, take: newTake });
|
|
87
|
+
}
|
|
88
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
89
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: PaginationComponent, isStandalone: true, selector: "fk-pagination", inputs: { page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: true, transformFunction: null }, take: { classPropertyName: "take", publicName: "take", isSignal: true, isRequired: true, transformFunction: null }, itemCount: { classPropertyName: "itemCount", publicName: "itemCount", isSignal: true, isRequired: true, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showFirstLast: { classPropertyName: "showFirstLast", publicName: "showFirstLast", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageChange: "pageChange" }, host: { properties: { "class": "this.hostClass", "attr.id": "this.hostId", "attr.aria-label": "this.hostAriaLabel" } }, ngImport: i0, template: "<div class=\"fk-pagination__summary\">\n {{ rangeStart() }} \u2013 {{ rangeEnd() }} of {{ itemCount() }}\n</div>\n\n<div class=\"fk-pagination__controls\">\n <div class=\"fk-pagination__page-size\">\n <label class=\"fk-pagination__page-size-label\" [attr.for]=\"selectId\">\n Rows per page:\n </label>\n\n <select\n class=\"fk-pagination__page-size-select\"\n [id]=\"selectId\"\n [value]=\"take()\"\n (change)=\"onPageSizeChange($event)\"\n >\n @for (option of pageSizeOptions(); track option) {\n <option [value]=\"option\" [selected]=\"option === take()\">\n {{ option }}\n </option>\n }\n </select>\n </div>\n\n <div class=\"fk-pagination__nav\" role=\"navigation\" aria-label=\"Pagination\">\n @if (showFirstLast()) {\n <button\n class=\"fk-pagination__btn\"\n type=\"button\"\n [disabled]=\"!hasPreviousPage()\"\n aria-label=\"First page\"\n (click)=\"goToFirst()\"\n >\n <fk-icon name=\"circleHalfArrowLeftFill\" size=\"sm\" />\n </button>\n }\n\n <button\n class=\"fk-pagination__btn\"\n type=\"button\"\n [disabled]=\"!hasPreviousPage()\"\n aria-label=\"Previous page\"\n (click)=\"goToPrevious()\"\n >\n <svg\n class=\"fk-pagination__arrow\"\n viewBox=\"0 0 10 10\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M6.5 2L3.5 5L6.5 8\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n\n <span class=\"fk-pagination__page-info\">\n {{ page() }} / {{ pageCount() }}\n </span>\n\n <button\n class=\"fk-pagination__btn\"\n type=\"button\"\n [disabled]=\"!hasNextPage()\"\n aria-label=\"Next page\"\n (click)=\"goToNext()\"\n >\n <svg\n class=\"fk-pagination__arrow\"\n viewBox=\"0 0 10 10\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M3.5 2L6.5 5L3.5 8\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n\n @if (showFirstLast()) {\n <button\n class=\"fk-pagination__btn\"\n type=\"button\"\n [disabled]=\"!hasNextPage()\"\n aria-label=\"Last page\"\n (click)=\"goToLast()\"\n >\n <fk-icon name=\"circleHalfArrowRightFill\" size=\"sm\" />\n </button>\n }\n </div>\n</div>\n", styles: [":host{display:flex;align-items:center;justify-content:space-between;gap:var(--fk-pagination-gap, var(--fk-rhythm-4, 1rem));padding:var(--fk-pagination-padding, var(--fk-rhythm-3, .75rem)) var(--fk-pagination-padding-inline, var(--fk-rhythm-4, 1rem));font-family:var(--fk-pagination-font-family, var(--fk-font-family-base, \"Inter\", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial));font-size:var(--fk-pagination-font-size, var(--fk-typography-small-font-size, .8125rem));color:var(--fk-pagination-color, var(--fk-color-muted, #8a98a8));border-top:var(--fk-pagination-border-width, 0) solid var(--fk-pagination-border-color, var(--fk-color-border, #d9e2ee))}.fk-pagination__summary{white-space:nowrap}.fk-pagination__controls{display:flex;align-items:center;gap:var(--fk-pagination-controls-gap, var(--fk-rhythm-4, 1rem))}.fk-pagination__page-size{display:flex;align-items:center;gap:var(--fk-rhythm-2, .5rem)}.fk-pagination__page-size-label{white-space:nowrap;color:var(--fk-pagination-label-color, var(--fk-color-muted, #8a98a8))}.fk-pagination__page-size-select{padding:var(--fk-pagination-select-padding-block, var(--fk-rhythm-1, .25rem)) var(--fk-pagination-select-padding-right, 1.25rem) var(--fk-pagination-select-padding-block, var(--fk-rhythm-1, .25rem)) var(--fk-pagination-select-padding-left, var(--fk-rhythm-2, .5rem));font-size:inherit;font-family:inherit;color:var(--fk-pagination-select-color, var(--fk-color-text, #1f2d3d));background:var(--fk-pagination-select-bg, var(--fk-color-surface, #ffffff)) url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='currentColor' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\") no-repeat right var(--fk-pagination-select-chevron-offset, .375rem) center;appearance:none;border:1px solid var(--fk-pagination-select-border-color, var(--fk-color-border, #d9e2ee));border-radius:var(--fk-pagination-select-border-radius, var(--fk-radius-md, .375rem));cursor:pointer}.fk-pagination__page-size-select:focus{outline:none;border-color:var(--fk-pagination-select-focus-border-color, var(--fk-color-primary, #0a84ff));box-shadow:var(--fk-pagination-select-focus-ring, var(--fk-focus-ring, 0 0 0 3px rgba(10, 132, 255, .18)))}.fk-pagination__nav{display:flex;align-items:center;gap:var(--fk-pagination-nav-gap, var(--fk-rhythm-1, .25rem))}.fk-pagination__page-info{min-width:var(--fk-pagination-page-info-min-width, 3rem);text-align:center;white-space:nowrap;color:var(--fk-pagination-page-info-color, var(--fk-color-text, #1f2d3d))}.fk-pagination__btn{display:inline-flex;align-items:center;justify-content:center;width:var(--fk-pagination-btn-size, 2rem);height:var(--fk-pagination-btn-size, 2rem);padding:0;color:var(--fk-pagination-btn-color, var(--fk-color-text, #1f2d3d));background:var(--fk-pagination-btn-bg, none);border:1px solid var(--fk-pagination-btn-border-color, var(--fk-color-border, #d9e2ee));border-radius:var(--fk-pagination-btn-border-radius, var(--fk-radius-md, .375rem));cursor:pointer;transition:background-color .15s ease,border-color .15s ease}.fk-pagination__btn:hover:not(:disabled){background-color:var(--fk-pagination-btn-bg-hover, var(--fk-color-surface-hover, #f5f7fa));border-color:var(--fk-pagination-btn-border-color-hover, var(--fk-color-muted, #8a98a8))}.fk-pagination__btn:disabled{opacity:var(--fk-pagination-btn-disabled-opacity, var(--fk-input-disabled-opacity, .4));cursor:not-allowed}.fk-pagination__btn:focus-visible{outline:none;border-color:var(--fk-pagination-btn-focus-border-color, var(--fk-color-primary, #0a84ff));box-shadow:var(--fk-pagination-btn-focus-ring, var(--fk-focus-ring, 0 0 0 3px rgba(10, 132, 255, .18)))}.fk-pagination__arrow{width:var(--fk-pagination-arrow-size, .625rem);height:var(--fk-pagination-arrow-size, .625rem)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "fk-icon", inputs: ["name", "size", "color", "className", "id", "ariaLabel", "ariaHidden"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
90
|
+
}
|
|
91
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PaginationComponent, decorators: [{
|
|
92
|
+
type: Component,
|
|
93
|
+
args: [{ selector: 'fk-pagination', standalone: true, imports: [IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"fk-pagination__summary\">\n {{ rangeStart() }} \u2013 {{ rangeEnd() }} of {{ itemCount() }}\n</div>\n\n<div class=\"fk-pagination__controls\">\n <div class=\"fk-pagination__page-size\">\n <label class=\"fk-pagination__page-size-label\" [attr.for]=\"selectId\">\n Rows per page:\n </label>\n\n <select\n class=\"fk-pagination__page-size-select\"\n [id]=\"selectId\"\n [value]=\"take()\"\n (change)=\"onPageSizeChange($event)\"\n >\n @for (option of pageSizeOptions(); track option) {\n <option [value]=\"option\" [selected]=\"option === take()\">\n {{ option }}\n </option>\n }\n </select>\n </div>\n\n <div class=\"fk-pagination__nav\" role=\"navigation\" aria-label=\"Pagination\">\n @if (showFirstLast()) {\n <button\n class=\"fk-pagination__btn\"\n type=\"button\"\n [disabled]=\"!hasPreviousPage()\"\n aria-label=\"First page\"\n (click)=\"goToFirst()\"\n >\n <fk-icon name=\"circleHalfArrowLeftFill\" size=\"sm\" />\n </button>\n }\n\n <button\n class=\"fk-pagination__btn\"\n type=\"button\"\n [disabled]=\"!hasPreviousPage()\"\n aria-label=\"Previous page\"\n (click)=\"goToPrevious()\"\n >\n <svg\n class=\"fk-pagination__arrow\"\n viewBox=\"0 0 10 10\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M6.5 2L3.5 5L6.5 8\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n\n <span class=\"fk-pagination__page-info\">\n {{ page() }} / {{ pageCount() }}\n </span>\n\n <button\n class=\"fk-pagination__btn\"\n type=\"button\"\n [disabled]=\"!hasNextPage()\"\n aria-label=\"Next page\"\n (click)=\"goToNext()\"\n >\n <svg\n class=\"fk-pagination__arrow\"\n viewBox=\"0 0 10 10\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M3.5 2L6.5 5L3.5 8\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n\n @if (showFirstLast()) {\n <button\n class=\"fk-pagination__btn\"\n type=\"button\"\n [disabled]=\"!hasNextPage()\"\n aria-label=\"Last page\"\n (click)=\"goToLast()\"\n >\n <fk-icon name=\"circleHalfArrowRightFill\" size=\"sm\" />\n </button>\n }\n </div>\n</div>\n", styles: [":host{display:flex;align-items:center;justify-content:space-between;gap:var(--fk-pagination-gap, var(--fk-rhythm-4, 1rem));padding:var(--fk-pagination-padding, var(--fk-rhythm-3, .75rem)) var(--fk-pagination-padding-inline, var(--fk-rhythm-4, 1rem));font-family:var(--fk-pagination-font-family, var(--fk-font-family-base, \"Inter\", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial));font-size:var(--fk-pagination-font-size, var(--fk-typography-small-font-size, .8125rem));color:var(--fk-pagination-color, var(--fk-color-muted, #8a98a8));border-top:var(--fk-pagination-border-width, 0) solid var(--fk-pagination-border-color, var(--fk-color-border, #d9e2ee))}.fk-pagination__summary{white-space:nowrap}.fk-pagination__controls{display:flex;align-items:center;gap:var(--fk-pagination-controls-gap, var(--fk-rhythm-4, 1rem))}.fk-pagination__page-size{display:flex;align-items:center;gap:var(--fk-rhythm-2, .5rem)}.fk-pagination__page-size-label{white-space:nowrap;color:var(--fk-pagination-label-color, var(--fk-color-muted, #8a98a8))}.fk-pagination__page-size-select{padding:var(--fk-pagination-select-padding-block, var(--fk-rhythm-1, .25rem)) var(--fk-pagination-select-padding-right, 1.25rem) var(--fk-pagination-select-padding-block, var(--fk-rhythm-1, .25rem)) var(--fk-pagination-select-padding-left, var(--fk-rhythm-2, .5rem));font-size:inherit;font-family:inherit;color:var(--fk-pagination-select-color, var(--fk-color-text, #1f2d3d));background:var(--fk-pagination-select-bg, var(--fk-color-surface, #ffffff)) url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='currentColor' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\") no-repeat right var(--fk-pagination-select-chevron-offset, .375rem) center;appearance:none;border:1px solid var(--fk-pagination-select-border-color, var(--fk-color-border, #d9e2ee));border-radius:var(--fk-pagination-select-border-radius, var(--fk-radius-md, .375rem));cursor:pointer}.fk-pagination__page-size-select:focus{outline:none;border-color:var(--fk-pagination-select-focus-border-color, var(--fk-color-primary, #0a84ff));box-shadow:var(--fk-pagination-select-focus-ring, var(--fk-focus-ring, 0 0 0 3px rgba(10, 132, 255, .18)))}.fk-pagination__nav{display:flex;align-items:center;gap:var(--fk-pagination-nav-gap, var(--fk-rhythm-1, .25rem))}.fk-pagination__page-info{min-width:var(--fk-pagination-page-info-min-width, 3rem);text-align:center;white-space:nowrap;color:var(--fk-pagination-page-info-color, var(--fk-color-text, #1f2d3d))}.fk-pagination__btn{display:inline-flex;align-items:center;justify-content:center;width:var(--fk-pagination-btn-size, 2rem);height:var(--fk-pagination-btn-size, 2rem);padding:0;color:var(--fk-pagination-btn-color, var(--fk-color-text, #1f2d3d));background:var(--fk-pagination-btn-bg, none);border:1px solid var(--fk-pagination-btn-border-color, var(--fk-color-border, #d9e2ee));border-radius:var(--fk-pagination-btn-border-radius, var(--fk-radius-md, .375rem));cursor:pointer;transition:background-color .15s ease,border-color .15s ease}.fk-pagination__btn:hover:not(:disabled){background-color:var(--fk-pagination-btn-bg-hover, var(--fk-color-surface-hover, #f5f7fa));border-color:var(--fk-pagination-btn-border-color-hover, var(--fk-color-muted, #8a98a8))}.fk-pagination__btn:disabled{opacity:var(--fk-pagination-btn-disabled-opacity, var(--fk-input-disabled-opacity, .4));cursor:not-allowed}.fk-pagination__btn:focus-visible{outline:none;border-color:var(--fk-pagination-btn-focus-border-color, var(--fk-color-primary, #0a84ff));box-shadow:var(--fk-pagination-btn-focus-ring, var(--fk-focus-ring, 0 0 0 3px rgba(10, 132, 255, .18)))}.fk-pagination__arrow{width:var(--fk-pagination-arrow-size, .625rem);height:var(--fk-pagination-arrow-size, .625rem)}\n"] }]
|
|
94
|
+
}], propDecorators: { page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: true }] }], take: [{ type: i0.Input, args: [{ isSignal: true, alias: "take", required: true }] }], itemCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemCount", required: true }] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], showFirstLast: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFirstLast", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }], hostClass: [{
|
|
95
|
+
type: HostBinding,
|
|
96
|
+
args: ['class']
|
|
97
|
+
}], hostId: [{
|
|
98
|
+
type: HostBinding,
|
|
99
|
+
args: ['attr.id']
|
|
100
|
+
}], hostAriaLabel: [{
|
|
101
|
+
type: HostBinding,
|
|
102
|
+
args: ['attr.aria-label']
|
|
103
|
+
}] } });
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Generated bundle index. Do not edit.
|
|
107
|
+
*/
|
|
108
|
+
|
|
109
|
+
export { PaginationComponent };
|
|
110
|
+
//# sourceMappingURL=frame-kit-ui-ng-ui-pagination.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame-kit-ui-ng-ui-pagination.mjs","sources":["../../../../packages/ui-ng/ui/pagination/pagination.component.ts","../../../../packages/ui-ng/ui/pagination/pagination.component.html","../../../../packages/ui-ng/ui/pagination/frame-kit-ui-ng-ui-pagination.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n HostBinding,\n input,\n output,\n} from '@angular/core';\n\nimport { IconComponent } from '@frame-kit/ui-ng/core/icon';\nimport type { PageChangeEvent } from './pagination.types';\n\nlet nextPaginationId = 0;\n\n@Component({\n selector: 'fk-pagination',\n standalone: true,\n imports: [IconComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './pagination.component.html',\n styleUrl: './pagination.component.scss',\n})\nexport class PaginationComponent {\n // ===== INPUTS =====\n /** Current 1-based page number. */\n readonly page = input.required<number>();\n /** Number of items shown per page (the page size). */\n readonly take = input.required<number>();\n /** Total count of items across all pages used to compute `pageCount`. */\n readonly itemCount = input.required<number>();\n /** Available page-size values shown in the per-page selector. */\n readonly pageSizeOptions = input<number[]>([10, 20, 50, 100]);\n /** When true, renders first-page and last-page navigation buttons. */\n readonly showFirstLast = input<boolean>(false);\n\n // ===== BASE PROPS =====\n readonly className = input<string>('');\n readonly id = input<string | null>(null);\n readonly ariaLabel = input<string | null>(null);\n\n // ===== OUTPUTS =====\n /** Fires when the user navigates to a new page or changes the page size, emitting the new page and take. */\n readonly pageChange = output<PageChangeEvent>();\n\n // ===== INTERNAL =====\n readonly selectId = `fk-pagination-take-${nextPaginationId++}`;\n\n // ===== COMPUTED =====\n /** Always >= 1. Empty datasets show \"1 / 1\" rather than \"1 / 0\". */\n readonly pageCount = computed(() => {\n const count = this.itemCount();\n const size = this.take();\n\n return Math.ceil(count / size) || 1;\n });\n\n readonly hasPreviousPage = computed(() => this.page() > 1);\n\n readonly hasNextPage = computed(() => this.page() < this.pageCount());\n\n readonly rangeStart = computed(() => {\n const count = this.itemCount();\n\n if (count === 0) {\n return 0;\n }\n\n return (this.page() - 1) * this.take() + 1;\n });\n\n readonly rangeEnd = computed(() => {\n return Math.min(this.page() * this.take(), this.itemCount());\n });\n\n readonly classes = computed(() => {\n return ['fk-pagination', this.className()].filter(Boolean).join(' ');\n });\n\n @HostBinding('class')\n get hostClass() {\n return this.classes();\n }\n\n @HostBinding('attr.id')\n get hostId() {\n return this.id();\n }\n\n @HostBinding('attr.aria-label')\n get hostAriaLabel() {\n return this.ariaLabel();\n }\n\n // ===== ACTIONS =====\n\n /** Navigates to the first page if the current page is not already the first. */\n goToFirst(): void {\n if (this.hasPreviousPage()) {\n this.pageChange.emit({ page: 1, take: this.take() });\n }\n }\n\n /** Navigates to the previous page if one exists. */\n goToPrevious(): void {\n if (this.hasPreviousPage()) {\n this.pageChange.emit({ page: this.page() - 1, take: this.take() });\n }\n }\n\n /** Navigates to the next page if one exists. */\n goToNext(): void {\n if (this.hasNextPage()) {\n this.pageChange.emit({ page: this.page() + 1, take: this.take() });\n }\n }\n\n /** Navigates to the last page if the current page is not already the last. */\n goToLast(): void {\n if (this.hasNextPage()) {\n this.pageChange.emit({ page: this.pageCount(), take: this.take() });\n }\n }\n\n onPageSizeChange(event: Event): void {\n const select = event.target as HTMLSelectElement;\n const newTake = Number(select.value);\n\n this.pageChange.emit({ page: 1, take: newTake });\n }\n}\n","<div class=\"fk-pagination__summary\">\n {{ rangeStart() }} – {{ rangeEnd() }} of {{ itemCount() }}\n</div>\n\n<div class=\"fk-pagination__controls\">\n <div class=\"fk-pagination__page-size\">\n <label class=\"fk-pagination__page-size-label\" [attr.for]=\"selectId\">\n Rows per page:\n </label>\n\n <select\n class=\"fk-pagination__page-size-select\"\n [id]=\"selectId\"\n [value]=\"take()\"\n (change)=\"onPageSizeChange($event)\"\n >\n @for (option of pageSizeOptions(); track option) {\n <option [value]=\"option\" [selected]=\"option === take()\">\n {{ option }}\n </option>\n }\n </select>\n </div>\n\n <div class=\"fk-pagination__nav\" role=\"navigation\" aria-label=\"Pagination\">\n @if (showFirstLast()) {\n <button\n class=\"fk-pagination__btn\"\n type=\"button\"\n [disabled]=\"!hasPreviousPage()\"\n aria-label=\"First page\"\n (click)=\"goToFirst()\"\n >\n <fk-icon name=\"circleHalfArrowLeftFill\" size=\"sm\" />\n </button>\n }\n\n <button\n class=\"fk-pagination__btn\"\n type=\"button\"\n [disabled]=\"!hasPreviousPage()\"\n aria-label=\"Previous page\"\n (click)=\"goToPrevious()\"\n >\n <svg\n class=\"fk-pagination__arrow\"\n viewBox=\"0 0 10 10\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M6.5 2L3.5 5L6.5 8\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n\n <span class=\"fk-pagination__page-info\">\n {{ page() }} / {{ pageCount() }}\n </span>\n\n <button\n class=\"fk-pagination__btn\"\n type=\"button\"\n [disabled]=\"!hasNextPage()\"\n aria-label=\"Next page\"\n (click)=\"goToNext()\"\n >\n <svg\n class=\"fk-pagination__arrow\"\n viewBox=\"0 0 10 10\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M3.5 2L6.5 5L3.5 8\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n\n @if (showFirstLast()) {\n <button\n class=\"fk-pagination__btn\"\n type=\"button\"\n [disabled]=\"!hasNextPage()\"\n aria-label=\"Last page\"\n (click)=\"goToLast()\"\n >\n <fk-icon name=\"circleHalfArrowRightFill\" size=\"sm\" />\n </button>\n }\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAYA,IAAI,gBAAgB,GAAG,CAAC;MAUX,mBAAmB,CAAA;;;AAGrB,IAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,0EAAU;;AAE/B,IAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,0EAAU;;AAE/B,IAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,+EAAU;;AAEpC,IAAA,eAAe,GAAG,KAAK,CAAW,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,sFAAC;;AAEpD,IAAA,aAAa,GAAG,KAAK,CAAU,KAAK,oFAAC;;AAGrC,IAAA,SAAS,GAAG,KAAK,CAAS,EAAE,gFAAC;AAC7B,IAAA,EAAE,GAAG,KAAK,CAAgB,IAAI,yEAAC;AAC/B,IAAA,SAAS,GAAG,KAAK,CAAgB,IAAI,gFAAC;;;IAItC,UAAU,GAAG,MAAM,EAAmB;;AAGtC,IAAA,QAAQ,GAA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ed, HostBinding, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
+
|
|
5
|
+
class ProgressBarComponent {
|
|
6
|
+
// ===== INPUTS =====
|
|
7
|
+
/** Current progress value; clamped between 0 and `max`. */
|
|
8
|
+
value = input(0, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
9
|
+
/** Maximum value representing 100% completion. */
|
|
10
|
+
max = input(100, ...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
11
|
+
/** Whether the bar shows a determinate fill or an indeterminate animation. */
|
|
12
|
+
mode = input('determinate', ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
13
|
+
/** Size preset controlling the bar height. */
|
|
14
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
15
|
+
/** Color variant applied to the progress fill. */
|
|
16
|
+
variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
17
|
+
/** Custom fill color as a CSS value, overriding the variant token. */
|
|
18
|
+
color = input(null, ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
19
|
+
/** Custom track (background) color as a CSS value. */
|
|
20
|
+
trackColor = input(null, ...(ngDevMode ? [{ debugName: "trackColor" }] : /* istanbul ignore next */ []));
|
|
21
|
+
/** Custom height of the bar as a CSS size value, overriding the size preset. */
|
|
22
|
+
height = input(null, ...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
|
|
23
|
+
/** When true, renders a text label showing the current percentage. */
|
|
24
|
+
showValue = input(false, ...(ngDevMode ? [{ debugName: "showValue" }] : /* istanbul ignore next */ []));
|
|
25
|
+
/** When true, applies an animated striped pattern to the fill. */
|
|
26
|
+
striped = input(false, ...(ngDevMode ? [{ debugName: "striped" }] : /* istanbul ignore next */ []));
|
|
27
|
+
// ===== BASE PROPS =====
|
|
28
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
29
|
+
ariaDescribedBy = input(null, ...(ngDevMode ? [{ debugName: "ariaDescribedBy" }] : /* istanbul ignore next */ []));
|
|
30
|
+
id = input(null, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
31
|
+
className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
32
|
+
// ===== COMPUTED =====
|
|
33
|
+
clampedValue = computed(() => {
|
|
34
|
+
return Math.max(0, Math.min(this.value(), this.max()));
|
|
35
|
+
}, ...(ngDevMode ? [{ debugName: "clampedValue" }] : /* istanbul ignore next */ []));
|
|
36
|
+
percentage = computed(() => {
|
|
37
|
+
const m = this.max();
|
|
38
|
+
if (m <= 0) {
|
|
39
|
+
return 0;
|
|
40
|
+
}
|
|
41
|
+
return (this.clampedValue() / m) * 100;
|
|
42
|
+
}, ...(ngDevMode ? [{ debugName: "percentage" }] : /* istanbul ignore next */ []));
|
|
43
|
+
valueText = computed(() => {
|
|
44
|
+
if (this.mode() === 'indeterminate') {
|
|
45
|
+
return 'Loading...';
|
|
46
|
+
}
|
|
47
|
+
return `${Math.round(this.percentage())}%`;
|
|
48
|
+
}, ...(ngDevMode ? [{ debugName: "valueText" }] : /* istanbul ignore next */ []));
|
|
49
|
+
classes = computed(() => {
|
|
50
|
+
return [
|
|
51
|
+
'fk-progress-bar',
|
|
52
|
+
`fk-progress-bar--${this.size()}`,
|
|
53
|
+
`fk-progress-bar--${this.variant()}`,
|
|
54
|
+
`fk-progress-bar--${this.mode()}`,
|
|
55
|
+
this.striped() ? 'fk-progress-bar--striped' : '',
|
|
56
|
+
this.className(),
|
|
57
|
+
]
|
|
58
|
+
.filter(Boolean)
|
|
59
|
+
.join(' ');
|
|
60
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
61
|
+
// ===== HOST BINDINGS =====
|
|
62
|
+
get hostClass() {
|
|
63
|
+
return this.classes();
|
|
64
|
+
}
|
|
65
|
+
get hostRole() {
|
|
66
|
+
return 'progressbar';
|
|
67
|
+
}
|
|
68
|
+
get hostAriaValueMin() {
|
|
69
|
+
return this.mode() === 'indeterminate' ? null : 0;
|
|
70
|
+
}
|
|
71
|
+
get hostAriaValueMax() {
|
|
72
|
+
return this.mode() === 'indeterminate' ? null : this.max();
|
|
73
|
+
}
|
|
74
|
+
get hostAriaValueNow() {
|
|
75
|
+
return this.mode() === 'indeterminate' ? null : this.clampedValue();
|
|
76
|
+
}
|
|
77
|
+
get hostAriaValueText() {
|
|
78
|
+
return this.valueText();
|
|
79
|
+
}
|
|
80
|
+
get hostAriaLabel() {
|
|
81
|
+
return this.ariaLabel();
|
|
82
|
+
}
|
|
83
|
+
get hostAriaDescribedBy() {
|
|
84
|
+
return this.ariaDescribedBy();
|
|
85
|
+
}
|
|
86
|
+
get hostId() {
|
|
87
|
+
return this.id();
|
|
88
|
+
}
|
|
89
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
90
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: ProgressBarComponent, isStandalone: true, selector: "fk-progress-bar", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, trackColor: { classPropertyName: "trackColor", publicName: "trackColor", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, showValue: { classPropertyName: "showValue", publicName: "showValue", isSignal: true, isRequired: false, transformFunction: null }, striped: { classPropertyName: "striped", publicName: "striped", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClass", "attr.role": "this.hostRole", "attr.aria-valuemin": "this.hostAriaValueMin", "attr.aria-valuemax": "this.hostAriaValueMax", "attr.aria-valuenow": "this.hostAriaValueNow", "attr.aria-valuetext": "this.hostAriaValueText", "attr.aria-label": "this.hostAriaLabel", "attr.aria-describedby": "this.hostAriaDescribedBy", "attr.id": "this.hostId" } }, ngImport: i0, template: "<div\n class=\"fk-progress-bar__track\"\n [style.background-color]=\"trackColor()\"\n [style.height]=\"height()\"\n>\n <div\n class=\"fk-progress-bar__fill\"\n [style.width.%]=\"mode() === 'determinate' ? percentage() : null\"\n [style.background-color]=\"color()\"\n ></div>\n</div>\n\n@if (showValue() && mode() === 'determinate') {\n <span class=\"fk-progress-bar__label\">\n {{ percentage() | number: '1.0-0' }}%\n </span>\n}\n", styles: [":host{display:flex;align-items:center;gap:var(--fk-progress-bar-label-gap, var(--fk-rhythm-2, .5rem));width:100%}.fk-progress-bar__track{flex:1;border-radius:var(--fk-progress-bar-radius, var(--fk-radius-full, 9999px));overflow:hidden;background:var(--fk-progress-bar-bg, var(--fk-color-surface-muted, #f1f5f9))}.fk-progress-bar__fill{height:100%;border-radius:inherit;transition:width var(--fk-progress-bar-transition, .3s ease)}.fk-progress-bar__label{font-size:var(--fk-progress-bar-label-size, var(--fk-typography-caption-font-size, .75rem));font-weight:var(--fk-progress-bar-label-weight, var(--fk-font-weight-medium, 500));color:var(--fk-progress-bar-label-color, var(--fk-color-text, #1f2d3d));white-space:nowrap;flex-shrink:0}:host.fk-progress-bar--sm .fk-progress-bar__track{height:var(--fk-progress-bar-height-sm, var(--fk-rhythm-1, .25rem))}:host.fk-progress-bar--md .fk-progress-bar__track{height:var(--fk-progress-bar-height-md, var(--fk-rhythm-2, .5rem))}:host.fk-progress-bar--lg .fk-progress-bar__track{height:var(--fk-progress-bar-height-lg, var(--fk-rhythm-3, .75rem))}:host.fk-progress-bar--default .fk-progress-bar__fill{background-color:var(--fk-progress-bar-fill, var(--fk-color-primary, #0a84ff))}:host.fk-progress-bar--success .fk-progress-bar__fill{background-color:var(--fk-progress-bar-fill-success, var(--fk-color-success, #10b981))}:host.fk-progress-bar--warning .fk-progress-bar__fill{background-color:var(--fk-progress-bar-fill-warning, var(--fk-color-warning, #f59e0b))}:host.fk-progress-bar--danger .fk-progress-bar__fill{background-color:var(--fk-progress-bar-fill-danger, var(--fk-color-danger, #e02424))}:host.fk-progress-bar--indeterminate .fk-progress-bar__fill{width:40%!important;animation:fk-progress-bar-indeterminate var(--fk-progress-bar-animation-duration, 1.5s) cubic-bezier(.65,.815,.735,.395) infinite}@keyframes fk-progress-bar-indeterminate{0%{transform:translate(-100%)}to{transform:translate(350%)}}:host.fk-progress-bar--striped .fk-progress-bar__fill{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem;animation:fk-progress-bar-stripe 1s linear infinite}@keyframes fk-progress-bar-stripe{0%{background-position:1rem 0}to{background-position:0 0}}@media(prefers-reduced-motion:reduce){:host.fk-progress-bar--indeterminate .fk-progress-bar__fill,:host.fk-progress-bar--striped .fk-progress-bar__fill{animation:none}}\n"], dependencies: [{ kind: "pipe", type: DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
91
|
+
}
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ProgressBarComponent, decorators: [{
|
|
93
|
+
type: Component,
|
|
94
|
+
args: [{ selector: 'fk-progress-bar', standalone: true, imports: [DecimalPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"fk-progress-bar__track\"\n [style.background-color]=\"trackColor()\"\n [style.height]=\"height()\"\n>\n <div\n class=\"fk-progress-bar__fill\"\n [style.width.%]=\"mode() === 'determinate' ? percentage() : null\"\n [style.background-color]=\"color()\"\n ></div>\n</div>\n\n@if (showValue() && mode() === 'determinate') {\n <span class=\"fk-progress-bar__label\">\n {{ percentage() | number: '1.0-0' }}%\n </span>\n}\n", styles: [":host{display:flex;align-items:center;gap:var(--fk-progress-bar-label-gap, var(--fk-rhythm-2, .5rem));width:100%}.fk-progress-bar__track{flex:1;border-radius:var(--fk-progress-bar-radius, var(--fk-radius-full, 9999px));overflow:hidden;background:var(--fk-progress-bar-bg, var(--fk-color-surface-muted, #f1f5f9))}.fk-progress-bar__fill{height:100%;border-radius:inherit;transition:width var(--fk-progress-bar-transition, .3s ease)}.fk-progress-bar__label{font-size:var(--fk-progress-bar-label-size, var(--fk-typography-caption-font-size, .75rem));font-weight:var(--fk-progress-bar-label-weight, var(--fk-font-weight-medium, 500));color:var(--fk-progress-bar-label-color, var(--fk-color-text, #1f2d3d));white-space:nowrap;flex-shrink:0}:host.fk-progress-bar--sm .fk-progress-bar__track{height:var(--fk-progress-bar-height-sm, var(--fk-rhythm-1, .25rem))}:host.fk-progress-bar--md .fk-progress-bar__track{height:var(--fk-progress-bar-height-md, var(--fk-rhythm-2, .5rem))}:host.fk-progress-bar--lg .fk-progress-bar__track{height:var(--fk-progress-bar-height-lg, var(--fk-rhythm-3, .75rem))}:host.fk-progress-bar--default .fk-progress-bar__fill{background-color:var(--fk-progress-bar-fill, var(--fk-color-primary, #0a84ff))}:host.fk-progress-bar--success .fk-progress-bar__fill{background-color:var(--fk-progress-bar-fill-success, var(--fk-color-success, #10b981))}:host.fk-progress-bar--warning .fk-progress-bar__fill{background-color:var(--fk-progress-bar-fill-warning, var(--fk-color-warning, #f59e0b))}:host.fk-progress-bar--danger .fk-progress-bar__fill{background-color:var(--fk-progress-bar-fill-danger, var(--fk-color-danger, #e02424))}:host.fk-progress-bar--indeterminate .fk-progress-bar__fill{width:40%!important;animation:fk-progress-bar-indeterminate var(--fk-progress-bar-animation-duration, 1.5s) cubic-bezier(.65,.815,.735,.395) infinite}@keyframes fk-progress-bar-indeterminate{0%{transform:translate(-100%)}to{transform:translate(350%)}}:host.fk-progress-bar--striped .fk-progress-bar__fill{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem;animation:fk-progress-bar-stripe 1s linear infinite}@keyframes fk-progress-bar-stripe{0%{background-position:1rem 0}to{background-position:0 0}}@media(prefers-reduced-motion:reduce){:host.fk-progress-bar--indeterminate .fk-progress-bar__fill,:host.fk-progress-bar--striped .fk-progress-bar__fill{animation:none}}\n"] }]
|
|
95
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], trackColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackColor", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], showValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValue", required: false }] }], striped: [{ type: i0.Input, args: [{ isSignal: true, alias: "striped", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedBy", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], hostClass: [{
|
|
96
|
+
type: HostBinding,
|
|
97
|
+
args: ['class']
|
|
98
|
+
}], hostRole: [{
|
|
99
|
+
type: HostBinding,
|
|
100
|
+
args: ['attr.role']
|
|
101
|
+
}], hostAriaValueMin: [{
|
|
102
|
+
type: HostBinding,
|
|
103
|
+
args: ['attr.aria-valuemin']
|
|
104
|
+
}], hostAriaValueMax: [{
|
|
105
|
+
type: HostBinding,
|
|
106
|
+
args: ['attr.aria-valuemax']
|
|
107
|
+
}], hostAriaValueNow: [{
|
|
108
|
+
type: HostBinding,
|
|
109
|
+
args: ['attr.aria-valuenow']
|
|
110
|
+
}], hostAriaValueText: [{
|
|
111
|
+
type: HostBinding,
|
|
112
|
+
args: ['attr.aria-valuetext']
|
|
113
|
+
}], hostAriaLabel: [{
|
|
114
|
+
type: HostBinding,
|
|
115
|
+
args: ['attr.aria-label']
|
|
116
|
+
}], hostAriaDescribedBy: [{
|
|
117
|
+
type: HostBinding,
|
|
118
|
+
args: ['attr.aria-describedby']
|
|
119
|
+
}], hostId: [{
|
|
120
|
+
type: HostBinding,
|
|
121
|
+
args: ['attr.id']
|
|
122
|
+
}] } });
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Generated bundle index. Do not edit.
|
|
126
|
+
*/
|
|
127
|
+
|
|
128
|
+
export { ProgressBarComponent };
|
|
129
|
+
//# sourceMappingURL=frame-kit-ui-ng-ui-progress-bar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame-kit-ui-ng-ui-progress-bar.mjs","sources":["../../../../packages/ui-ng/ui/progress-bar/progress-bar.component.ts","../../../../packages/ui-ng/ui/progress-bar/progress-bar.component.html","../../../../packages/ui-ng/ui/progress-bar/frame-kit-ui-ng-ui-progress-bar.ts"],"sourcesContent":["import { DecimalPipe } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n HostBinding,\n input,\n} from '@angular/core';\n\nimport type {\n ProgressBarMode,\n ProgressBarSize,\n ProgressBarVariant,\n} from './progress-bar.types';\n\n@Component({\n selector: 'fk-progress-bar',\n standalone: true,\n imports: [DecimalPipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n styleUrl: './progress-bar.component.scss',\n templateUrl: './progress-bar.component.html',\n})\nexport class ProgressBarComponent {\n // ===== INPUTS =====\n /** Current progress value; clamped between 0 and `max`. */\n readonly value = input<number>(0);\n /** Maximum value representing 100% completion. */\n readonly max = input<number>(100);\n /** Whether the bar shows a determinate fill or an indeterminate animation. */\n readonly mode = input<ProgressBarMode>('determinate');\n /** Size preset controlling the bar height. */\n readonly size = input<ProgressBarSize>('md');\n /** Color variant applied to the progress fill. */\n readonly variant = input<ProgressBarVariant>('default');\n /** Custom fill color as a CSS value, overriding the variant token. */\n readonly color = input<string | null>(null);\n /** Custom track (background) color as a CSS value. */\n readonly trackColor = input<string | null>(null);\n /** Custom height of the bar as a CSS size value, overriding the size preset. */\n readonly height = input<string | null>(null);\n /** When true, renders a text label showing the current percentage. */\n readonly showValue = input<boolean>(false);\n /** When true, applies an animated striped pattern to the fill. */\n readonly striped = input<boolean>(false);\n\n // ===== BASE PROPS =====\n readonly ariaLabel = input<string | null>(null);\n readonly ariaDescribedBy = input<string | null>(null);\n readonly id = input<string | null>(null);\n readonly className = input<string>('');\n\n // ===== COMPUTED =====\n readonly clampedValue = computed(() => {\n return Math.max(0, Math.min(this.value(), this.max()));\n });\n\n readonly percentage = computed(() => {\n const m = this.max();\n\n if (m <= 0) {\n return 0;\n }\n\n return (this.clampedValue() / m) * 100;\n });\n\n readonly valueText = computed(() => {\n if (this.mode() === 'indeterminate') {\n return 'Loading...';\n }\n\n return `${Math.round(this.percentage())}%`;\n });\n\n readonly classes = computed(() => {\n return [\n 'fk-progress-bar',\n `fk-progress-bar--${this.size()}`,\n `fk-progress-bar--${this.variant()}`,\n `fk-progress-bar--${this.mode()}`,\n this.striped() ? 'fk-progress-bar--striped' : '',\n this.className(),\n ]\n .filter(Boolean)\n .join(' ');\n });\n\n // ===== HOST BINDINGS =====\n @HostBinding('class')\n get hostClass() {\n return this.classes();\n }\n\n @HostBinding('attr.role')\n get hostRole() {\n return 'progressbar';\n }\n\n @HostBinding('attr.aria-valuemin')\n get hostAriaValueMin() {\n return this.mode() === 'indeterminate' ? null : 0;\n }\n\n @HostBinding('attr.aria-valuemax')\n get hostAriaValueMax() {\n return this.mode() === 'indeterminate' ? null : this.max();\n }\n\n @HostBinding('attr.aria-valuenow')\n get hostAriaValueNow() {\n return this.mode() === 'indeterminate' ? null : this.clampedValue();\n }\n\n @HostBinding('attr.aria-valuetext')\n get hostAriaValueText() {\n return this.valueText();\n }\n\n @HostBinding('attr.aria-label')\n get hostAriaLabel() {\n return this.ariaLabel();\n }\n\n @HostBinding('attr.aria-describedby')\n get hostAriaDescribedBy() {\n return this.ariaDescribedBy();\n }\n\n @HostBinding('attr.id')\n get hostId() {\n return this.id();\n }\n}\n","<div\n class=\"fk-progress-bar__track\"\n [style.background-color]=\"trackColor()\"\n [style.height]=\"height()\"\n>\n <div\n class=\"fk-progress-bar__fill\"\n [style.width.%]=\"mode() === 'determinate' ? percentage() : null\"\n [style.background-color]=\"color()\"\n ></div>\n</div>\n\n@if (showValue() && mode() === 'determinate') {\n <span class=\"fk-progress-bar__label\">\n {{ percentage() | number: '1.0-0' }}%\n </span>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAuBa,oBAAoB,CAAA;;;AAGtB,IAAA,KAAK,GAAG,KAAK,CAAS,CAAC,4EAAC;;AAExB,IAAA,GAAG,GAAG,KAAK,CAA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