@kouji-ui/components 0.6.0 → 0.6.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kouji-ui/components",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Opinionated styled Angular components built on @kouji-ui/core directives. Themed at runtime via @kouji-ui/themes.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -6881,7 +6881,10 @@ interface KjRowClickEvent<TData> {
6881
6881
  * the toolbar's export menu.
6882
6882
  * @doc-file table.export.example.ts
6883
6883
  * @doc-example Empty and error [full]
6884
- * Project `[kjEmpty]` / `[kjError]` slots to override the defaults.
6884
+ * Override the defaults with `<ng-template kjEmptyTemplate>` /
6885
+ * `kjErrorTemplate` / `kjLoadingTemplate` (lazy — instantiated only while
6886
+ * that state is active). The older `[kjEmpty]` / `[kjError]` / `[kjLoading]`
6887
+ * projection slots still work and act as the fallback.
6885
6888
  * @doc-file table.empty-and-error.example.ts
6886
6889
  * @doc-example Keyboard [full]
6887
6890
  * Arrow / Home / End / Ctrl+Home/End / PageUp/Down / F2 / Enter / Esc /
@@ -6934,6 +6937,15 @@ declare class KjTableComponent<TData extends RowData = unknown> {
6934
6937
  readonly kjRowExpansionTpl: _angular_core.Signal<TemplateRef<unknown> | undefined>;
6935
6938
  /** Custom cell templates declared as `ng-template[kjCellTemplate]` content. */
6936
6939
  private readonly cellTemplates;
6940
+ private readonly emptyTemplate;
6941
+ private readonly loadingTemplate;
6942
+ private readonly errorTemplate;
6943
+ /** Empty-state template, or `null` to fall back to the `[kjEmpty]` slot. */
6944
+ protected readonly emptyTpl: _angular_core.Signal<TemplateRef<unknown> | null>;
6945
+ /** Loading template, or `null` to fall back to the `[kjLoading]` slot. */
6946
+ protected readonly loadingTpl: _angular_core.Signal<TemplateRef<unknown> | null>;
6947
+ /** Error template, or `null` to fall back to the `[kjError]` slot. */
6948
+ protected readonly errorTpl: _angular_core.Signal<TemplateRef<unknown> | null>;
6937
6949
  /** Resolve the registered template for a cell's column, if any. */
6938
6950
  protected cellTpl(cell: Cell<TData, unknown>): TemplateRef<unknown> | null;
6939
6951
  readonly cellEdit: _angular_core.OutputEmitterRef<KjCellEditEvent<TData>>;
@@ -7062,7 +7074,7 @@ declare class KjTableComponent<TData extends RowData = unknown> {
7062
7074
  /** Editor `(cancel)` from `KjCellEditorOutlet`: just close the editor. */
7063
7075
  protected onEditorCancel(): void;
7064
7076
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<KjTableComponent<any>, never>;
7065
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<KjTableComponent<any>, "kj-table", never, { "kjResource": { "alias": "kjResource"; "required": false; "isSignal": true; }; "kjDensity": { "alias": "kjDensity"; "required": false; "isSignal": true; }; "kjVariant": { "alias": "kjVariant"; "required": false; "isSignal": true; }; "kjLoading": { "alias": "kjLoading"; "required": false; "isSignal": true; }; "kjSelection": { "alias": "kjSelection"; "required": false; "isSignal": true; }; "kjSelectionMode": { "alias": "kjSelectionMode"; "required": false; "isSignal": true; }; "kjShowSelectionColumn": { "alias": "kjShowSelectionColumn"; "required": false; "isSignal": true; }; "kjStorageKey": { "alias": "kjStorageKey"; "required": false; "isSignal": true; }; "kjStorageAdapter": { "alias": "kjStorageAdapter"; "required": false; "isSignal": true; }; "kjVirtual": { "alias": "kjVirtual"; "required": false; "isSignal": true; }; "kjEstimatedRowSize": { "alias": "kjEstimatedRowSize"; "required": false; "isSignal": true; }; "kjEnableFilters": { "alias": "kjEnableFilters"; "required": false; "isSignal": true; }; "kjEnableResize": { "alias": "kjEnableResize"; "required": false; "isSignal": true; }; "kjEnableRowPinning": { "alias": "kjEnableRowPinning"; "required": false; "isSignal": true; }; "kjEditOnDoubleClick": { "alias": "kjEditOnDoubleClick"; "required": false; "isSignal": true; }; "kjPageSize": { "alias": "kjPageSize"; "required": false; "isSignal": true; }; }, { "kjSelection": "kjSelectionChange"; "cellEdit": "cellEdit"; "stateChange": "stateChange"; "rowClick": "rowClick"; "rowDoubleClick": "rowDoubleClick"; }, ["kjRowExpansionTpl", "cellTemplates"], ["kj-table-toolbar, [kjToolbar]", "[kjSidePanel]", "[kjEmpty]", "[kjError]", "[kjLoading]", "*"], true, [{ directive: typeof i1.KjTable; inputs: { "kjTable": "kjColumns"; "kjTableData": "kjData"; "kjGetRowId": "kjGetRowId"; }; outputs: {}; }]>;
7077
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<KjTableComponent<any>, "kj-table", never, { "kjResource": { "alias": "kjResource"; "required": false; "isSignal": true; }; "kjDensity": { "alias": "kjDensity"; "required": false; "isSignal": true; }; "kjVariant": { "alias": "kjVariant"; "required": false; "isSignal": true; }; "kjLoading": { "alias": "kjLoading"; "required": false; "isSignal": true; }; "kjSelection": { "alias": "kjSelection"; "required": false; "isSignal": true; }; "kjSelectionMode": { "alias": "kjSelectionMode"; "required": false; "isSignal": true; }; "kjShowSelectionColumn": { "alias": "kjShowSelectionColumn"; "required": false; "isSignal": true; }; "kjStorageKey": { "alias": "kjStorageKey"; "required": false; "isSignal": true; }; "kjStorageAdapter": { "alias": "kjStorageAdapter"; "required": false; "isSignal": true; }; "kjVirtual": { "alias": "kjVirtual"; "required": false; "isSignal": true; }; "kjEstimatedRowSize": { "alias": "kjEstimatedRowSize"; "required": false; "isSignal": true; }; "kjEnableFilters": { "alias": "kjEnableFilters"; "required": false; "isSignal": true; }; "kjEnableResize": { "alias": "kjEnableResize"; "required": false; "isSignal": true; }; "kjEnableRowPinning": { "alias": "kjEnableRowPinning"; "required": false; "isSignal": true; }; "kjEditOnDoubleClick": { "alias": "kjEditOnDoubleClick"; "required": false; "isSignal": true; }; "kjPageSize": { "alias": "kjPageSize"; "required": false; "isSignal": true; }; }, { "kjSelection": "kjSelectionChange"; "cellEdit": "cellEdit"; "stateChange": "stateChange"; "rowClick": "rowClick"; "rowDoubleClick": "rowDoubleClick"; }, ["kjRowExpansionTpl", "cellTemplates", "emptyTemplate", "loadingTemplate", "errorTemplate"], ["kj-table-toolbar, [kjToolbar]", "[kjSidePanel]", "[kjEmpty]", "[kjError]", "[kjLoading]", "*"], true, [{ directive: typeof i1.KjTable; inputs: { "kjTable": "kjColumns"; "kjTableData": "kjData"; "kjGetRowId": "kjGetRowId"; }; outputs: {}; }]>;
7066
7078
  }
7067
7079
 
7068
7080
  /** Density value emitted by the density toggle group. */
@@ -7832,6 +7844,84 @@ interface KjCellTemplateContext<TData> {
7832
7844
  cell: unknown;
7833
7845
  }
7834
7846
 
7847
+ /**
7848
+ * Registers the empty-state template for a `<kj-table>` — rendered when the
7849
+ * table resolves to zero rows and is neither loading nor errored.
7850
+ *
7851
+ * Prefer this over the `[kjEmpty]` content slot: the template is instantiated
7852
+ * only while the state is active, so avatars, buttons and injected services in
7853
+ * the empty state cost nothing on a populated table.
7854
+ *
7855
+ * ```html
7856
+ * <kj-table [kjData]="rows()" [kjColumns]="cols">
7857
+ * <ng-template kjEmptyTemplate>
7858
+ * <p>No users found.</p>
7859
+ * <kj-button kjSize="sm" (click)="add()">Add user</kj-button>
7860
+ * </ng-template>
7861
+ * </kj-table>
7862
+ * ```
7863
+ *
7864
+ * @doc-category Library/Data display
7865
+ * @doc
7866
+ * @doc-name table
7867
+ */
7868
+ declare class KjTableEmptyTemplate {
7869
+ /** @internal */
7870
+ readonly template: TemplateRef<any>;
7871
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<KjTableEmptyTemplate, never>;
7872
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<KjTableEmptyTemplate, "ng-template[kjEmptyTemplate]", never, {}, {}, never, never, true, never>;
7873
+ }
7874
+ /**
7875
+ * Registers the loading template for a `<kj-table>` — rendered while the
7876
+ * resource is in flight or `[kjLoading]` is set, replacing the built-in
7877
+ * "Loading…" text with a project-specific spinner or skeleton.
7878
+ *
7879
+ * On a *reload* (rows already on screen) the table shows its slim progress
7880
+ * stripe instead and this template stays hidden, so the stale rows remain
7881
+ * readable.
7882
+ *
7883
+ * ```html
7884
+ * <kj-table [kjResource]="res" [kjColumns]="cols">
7885
+ * <ng-template kjLoadingTemplate>
7886
+ * <my-spinner />
7887
+ * </ng-template>
7888
+ * </kj-table>
7889
+ * ```
7890
+ *
7891
+ * @doc-category Library/Data display
7892
+ * @doc
7893
+ * @doc-name table
7894
+ */
7895
+ declare class KjTableLoadingTemplate {
7896
+ /** @internal */
7897
+ readonly template: TemplateRef<any>;
7898
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<KjTableLoadingTemplate, never>;
7899
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<KjTableLoadingTemplate, "ng-template[kjLoadingTemplate]", never, {}, {}, never, never, true, never>;
7900
+ }
7901
+ /**
7902
+ * Registers the error template for a `<kj-table>` — rendered when the bound
7903
+ * `[kjResource]` rejects. Pair it with `reload()` for a retry affordance.
7904
+ *
7905
+ * ```html
7906
+ * <kj-table [kjResource]="res" [kjColumns]="cols">
7907
+ * <ng-template kjErrorTemplate>
7908
+ * <p>Failed to load.</p>
7909
+ * <kj-button kjSize="sm" (click)="res.reload()">Try again</kj-button>
7910
+ * </ng-template>
7911
+ * </kj-table>
7912
+ * ```
7913
+ *
7914
+ * @doc-category Library/Data display
7915
+ * @doc
7916
+ * @doc-name table
7917
+ */
7918
+ declare class KjTableErrorTemplate {
7919
+ /** @internal */
7920
+ readonly template: TemplateRef<any>;
7921
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<KjTableErrorTemplate, never>;
7922
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<KjTableErrorTemplate, "ng-template[kjErrorTemplate]", never, {}, {}, never, never, true, never>;
7923
+ }
7924
+
7835
7925
  /**
7836
7926
  * Styled wrapper around the headless `KjTabs` directive — root of the tabs
7837
7927
  * compound. Re-maps the `kjValue`/`kjOrientation`/`kjActivationMode` inputs to
@@ -9086,5 +9176,5 @@ declare class KjTreeSelectComponent {
9086
9176
 
9087
9177
  declare const KJ_COMPONENTS_VERSION = "0.0.1";
9088
9178
 
9089
- export { KJ_COMPONENTS_VERSION, KJ_EDITOR_CONTRACT, KJ_FILTER_CONTEXT, KjAccordionComponent, KjAccordionContentComponent, KjAccordionItemComponent, KjAccordionTriggerComponent, KjActionSheet, KjActionSheetComponent, KjActionSheetRef, KjActionSheetService, KjAlertActionsComponent, KjAlertComponent, KjAlertDescriptionComponent, KjAlertDismissComponent, KjAlertIconComponent, KjAlertTitleComponent, KjAvatarComponent, KjAvatarGroupComponent, KjBadgeComponent, KjBooleanEditor, KjBreadcrumbComponent, KjBreadcrumbCurrentComponent, KjBreadcrumbEllipsisComponent, KjBreadcrumbItemComponent, KjBreadcrumbLinkComponent, KjBreadcrumbListComponent, KjBreadcrumbSeparatorComponent, KjBulkAction, KjButtonComponent, KjButtonGroupComponent, KjCalendarComponent, KjCardComponent, KjCardContentComponent, KjCardCoverComponent, KjCardFooterComponent, KjCardHeaderComponent, KjCardSubtitleComponent, KjCardTitleComponent, KjCarouselAutoplayComponent, KjCarouselComponent, KjCarouselIndicatorsComponent, KjCarouselNextComponent, KjCarouselPauseComponent, KjCarouselPreviousComponent, KjCarouselSlideComponent, KjCarouselViewportComponent, KjCascadeOptionComponent, KjCascadeSelectComponent, KjCascadeSubPanelComponent, KjCellEditorOutlet, KjCellTemplateDirective, KjChartComponent, KjChatAvatarComponent, KjChatBubbleComponent, KjChatComponent, KjChatFooterComponent, KjChatHeaderComponent, KjChatLogComponent, KjChatMessage, KjChatThread, KjCheckboxComponent, KjColorPickerComponent, KjComboboxComponent, KjComboboxEmptyComponent, KjComboboxLoadingComponent, KjComboboxOptionComponent, KjCommandEmptyComponent, KjCommandGroupComponent, KjCommandInputComponent, KjCommandItemComponent, KjCommandPaletteComponent, KjCommandPaletteFooter, KjCommandPaletteItemTemplate, KjCommandSeparatorComponent, KjConfirmPopupActionComponent, KjConfirmPopupActionsComponent, KjConfirmPopupCancelComponent, KjConfirmPopupComponent, KjConfirmPopupContentComponent, KjConfirmPopupMessageComponent, KjConfirmPopupTriggerComponent, KjDateEditor, KjDateFilter, KjDatePickerComponent, KjDateRangePresetsComponent, KjDatetimePickerComponent, KjDialogComponent, KjDirectionToggle, KjDividerComponent, KjDrawerComponent, KjDropdownMenuComponent, KjEditorComponent, KjEmptyStateActionsComponent, KjEmptyStateComponent, KjEmptyStateDescriptionComponent, KjEmptyStateIconComponent, KjEmptyStateTitleComponent, KjFieldComponent, KjFieldErrorComponent, KjFieldGroupComponent, KjFieldHelpComponent, KjFieldLabelComponent, KjFileUploadComponent, KjFilterCellOutlet, KjFormActionsComponent, KjFormComponent, KjFormSummaryComponent, KjIconGalleryExample, KjIconUsageExample, KjInputComponent, KjInputGroupAddonComponent, KjInputGroupComponent, KjInputMaskComponent, KjInputMaskCreditCardExample, KjInputMaskCustomTokensExample, KjInputMaskDateExample, KjInputMaskExample, KjInputMaskUsageExample, KjInputMaskValidationExample, KjInputOtpComponent, KjKbdComponent, KjLinkComponent, KjListComponent, KjListItemComponent, KjMenubarComponent, KjMenubarItemComponent, KjNumberEditor, KjNumberFilter, KjNumberInputComponent, KjOptionComponent, KjOverlayBadgeComponent, KjOverlayBadgeContentComponent, KjPaginationComponent, KjPaginationDefaultComponent, KjPaginationEllipsisComponent, KjPaginationFirstComponent, KjPaginationInfoComponent, KjPaginationItemComponent, KjPaginationLastComponent, KjPaginationNextComponent, KjPaginationPreviousComponent, KjPasswordInputComponent, KjPopoverComponent, KjProgressBarComponent, KjPromptInput, KjRadioComponent, KjRadioGroupComponent, KjRichTextEditorComponent, KjSelectComponent, KjSelectEditor, KjSelectFilter, KjSheetComponent, KjSkeletonComponent, KjSkipLinkComponent, KjSliderComponent, KjSpeedDialActionComponent, KjSpeedDialActionsComponent, KjSpeedDialComponent, KjSpeedDialTriggerComponent, KjSpinnerComponent, KjStepComponent, KjStepContentComponent, KjStepLabelComponent, KjStepperComponent, KjStepperNextComponent, KjStepperPreviousComponent, KjStepperResetComponent, KjTabComponent, KjTabListComponent, KjTabPanelComponent, KjTableComponent, KjTablePaginationComponent, KjTableSidePanelComponent, KjTableSidePanelContent, KjTableStatusBarComponent, KjTableToolbarComponent, KjTableVirtual, KjTabsComponent, KjTagComponent, KjTagListComponent, KjTagRemoveComponent, KjTextEditor, KjTextFilter, KjTextareaComponent, KjTimePickerComponent, KjToastCloseComponent, KjToastComponent, KjToastViewportComponent, KjToastWrapperComponent, KjToggleComponent, KjTooltipComponent, KjTreeSelectComponent, KjTreeSelectNodeComponent, LUCIDE_ICON_NAMES, bold, bulletList, codeBlock, copyToClipboard, defaultFeatures, downloadString, exportCsv, exportJson, heading, history, image, inlineCode, italic, link, markdownShortcuts, orderedList, provideLucideIcons, quote, renderMarkdown, strike, toTsv, underline };
9179
+ export { KJ_COMPONENTS_VERSION, KJ_EDITOR_CONTRACT, KJ_FILTER_CONTEXT, KjAccordionComponent, KjAccordionContentComponent, KjAccordionItemComponent, KjAccordionTriggerComponent, KjActionSheet, KjActionSheetComponent, KjActionSheetRef, KjActionSheetService, KjAlertActionsComponent, KjAlertComponent, KjAlertDescriptionComponent, KjAlertDismissComponent, KjAlertIconComponent, KjAlertTitleComponent, KjAvatarComponent, KjAvatarGroupComponent, KjBadgeComponent, KjBooleanEditor, KjBreadcrumbComponent, KjBreadcrumbCurrentComponent, KjBreadcrumbEllipsisComponent, KjBreadcrumbItemComponent, KjBreadcrumbLinkComponent, KjBreadcrumbListComponent, KjBreadcrumbSeparatorComponent, KjBulkAction, KjButtonComponent, KjButtonGroupComponent, KjCalendarComponent, KjCardComponent, KjCardContentComponent, KjCardCoverComponent, KjCardFooterComponent, KjCardHeaderComponent, KjCardSubtitleComponent, KjCardTitleComponent, KjCarouselAutoplayComponent, KjCarouselComponent, KjCarouselIndicatorsComponent, KjCarouselNextComponent, KjCarouselPauseComponent, KjCarouselPreviousComponent, KjCarouselSlideComponent, KjCarouselViewportComponent, KjCascadeOptionComponent, KjCascadeSelectComponent, KjCascadeSubPanelComponent, KjCellEditorOutlet, KjCellTemplateDirective, KjChartComponent, KjChatAvatarComponent, KjChatBubbleComponent, KjChatComponent, KjChatFooterComponent, KjChatHeaderComponent, KjChatLogComponent, KjChatMessage, KjChatThread, KjCheckboxComponent, KjColorPickerComponent, KjComboboxComponent, KjComboboxEmptyComponent, KjComboboxLoadingComponent, KjComboboxOptionComponent, KjCommandEmptyComponent, KjCommandGroupComponent, KjCommandInputComponent, KjCommandItemComponent, KjCommandPaletteComponent, KjCommandPaletteFooter, KjCommandPaletteItemTemplate, KjCommandSeparatorComponent, KjConfirmPopupActionComponent, KjConfirmPopupActionsComponent, KjConfirmPopupCancelComponent, KjConfirmPopupComponent, KjConfirmPopupContentComponent, KjConfirmPopupMessageComponent, KjConfirmPopupTriggerComponent, KjDateEditor, KjDateFilter, KjDatePickerComponent, KjDateRangePresetsComponent, KjDatetimePickerComponent, KjDialogComponent, KjDirectionToggle, KjDividerComponent, KjDrawerComponent, KjDropdownMenuComponent, KjEditorComponent, KjEmptyStateActionsComponent, KjEmptyStateComponent, KjEmptyStateDescriptionComponent, KjEmptyStateIconComponent, KjEmptyStateTitleComponent, KjFieldComponent, KjFieldErrorComponent, KjFieldGroupComponent, KjFieldHelpComponent, KjFieldLabelComponent, KjFileUploadComponent, KjFilterCellOutlet, KjFormActionsComponent, KjFormComponent, KjFormSummaryComponent, KjIconGalleryExample, KjIconUsageExample, KjInputComponent, KjInputGroupAddonComponent, KjInputGroupComponent, KjInputMaskComponent, KjInputMaskCreditCardExample, KjInputMaskCustomTokensExample, KjInputMaskDateExample, KjInputMaskExample, KjInputMaskUsageExample, KjInputMaskValidationExample, KjInputOtpComponent, KjKbdComponent, KjLinkComponent, KjListComponent, KjListItemComponent, KjMenubarComponent, KjMenubarItemComponent, KjNumberEditor, KjNumberFilter, KjNumberInputComponent, KjOptionComponent, KjOverlayBadgeComponent, KjOverlayBadgeContentComponent, KjPaginationComponent, KjPaginationDefaultComponent, KjPaginationEllipsisComponent, KjPaginationFirstComponent, KjPaginationInfoComponent, KjPaginationItemComponent, KjPaginationLastComponent, KjPaginationNextComponent, KjPaginationPreviousComponent, KjPasswordInputComponent, KjPopoverComponent, KjProgressBarComponent, KjPromptInput, KjRadioComponent, KjRadioGroupComponent, KjRichTextEditorComponent, KjSelectComponent, KjSelectEditor, KjSelectFilter, KjSheetComponent, KjSkeletonComponent, KjSkipLinkComponent, KjSliderComponent, KjSpeedDialActionComponent, KjSpeedDialActionsComponent, KjSpeedDialComponent, KjSpeedDialTriggerComponent, KjSpinnerComponent, KjStepComponent, KjStepContentComponent, KjStepLabelComponent, KjStepperComponent, KjStepperNextComponent, KjStepperPreviousComponent, KjStepperResetComponent, KjTabComponent, KjTabListComponent, KjTabPanelComponent, KjTableComponent, KjTableEmptyTemplate, KjTableErrorTemplate, KjTableLoadingTemplate, KjTablePaginationComponent, KjTableSidePanelComponent, KjTableSidePanelContent, KjTableStatusBarComponent, KjTableToolbarComponent, KjTableVirtual, KjTabsComponent, KjTagComponent, KjTagListComponent, KjTagRemoveComponent, KjTextEditor, KjTextFilter, KjTextareaComponent, KjTimePickerComponent, KjToastCloseComponent, KjToastComponent, KjToastViewportComponent, KjToastWrapperComponent, KjToggleComponent, KjTooltipComponent, KjTreeSelectComponent, KjTreeSelectNodeComponent, LUCIDE_ICON_NAMES, bold, bulletList, codeBlock, copyToClipboard, defaultFeatures, downloadString, exportCsv, exportJson, heading, history, image, inlineCode, italic, link, markdownShortcuts, orderedList, provideLucideIcons, quote, renderMarkdown, strike, toTsv, underline };
9090
9180
  export type { ExportOptions, KjActionSheetAction, KjActionSheetOptions, KjActionSheetRole, KjCellEditEvent, KjCellTemplateContext, KjChatBubbleSize, KjChatBubbleVariant, KjEditorContract, KjEmptyStateLevel, KjEmptyStateLive, KjEmptyStateVariant, KjFilterContext, KjHeadingLevel, KjInputSize, KjInputType, KjInputVariant, KjMdBlock, KjNumberRange, KjRowClickEvent, KjSelectEditorOption, KjSelectFilterOption, KjSpeedDialPosition, KjTableDensity, KjTableExportFormat };