@nova-design-system/nova-angular-18 3.18.0 → 3.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nova-components/esm2022/lib/components/nv-datatable-cell.directive.mjs +1 -1
- package/dist/nova-components/esm2022/lib/components/nv-datatable.component.mjs +55 -14
- package/dist/nova-components/esm2022/lib/stencil-generated/components.mjs +9 -9
- package/dist/nova-components/fesm2022/nova-components.mjs +60 -20
- package/dist/nova-components/fesm2022/nova-components.mjs.map +1 -1
- package/dist/nova-components/lib/components/nv-datatable-cell.directive.d.ts +7 -7
- package/dist/nova-components/lib/components/nv-datatable.component.d.ts +107 -59
- package/dist/nova-components/lib/stencil-generated/components.d.ts +13 -4
- package/package.json +1 -1
|
@@ -562,15 +562,15 @@ let NvFielddropdown = class NvFielddropdown {
|
|
|
562
562
|
this.z = z;
|
|
563
563
|
c.detach();
|
|
564
564
|
this.el = r.nativeElement;
|
|
565
|
-
proxyOutputs(this, this.el, ['valueChanged', 'dropdownItemSelected']);
|
|
565
|
+
proxyOutputs(this, this.el, ['valueChanged', 'filterTextChanged', 'openChanged', 'dropdownItemSelected']);
|
|
566
566
|
}
|
|
567
567
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NvFielddropdown, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
568
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: NvFielddropdown, selector: "nv-fielddropdown", inputs: { autocomplete: "autocomplete", autofocus: "autofocus", debounceDelay: "debounceDelay", description: "description", disabled: "disabled", emptyResult: "emptyResult", error: "error", errorDescription: "errorDescription", filterable: "filterable", fluid: "fluid", inputId: "inputId", label: "label", maxHeight: "maxHeight", name: "name",
|
|
568
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: NvFielddropdown, selector: "nv-fielddropdown", inputs: { autocomplete: "autocomplete", autofocus: "autofocus", controlledFilter: "controlledFilter", debounceDelay: "debounceDelay", description: "description", disabled: "disabled", emptyResult: "emptyResult", error: "error", errorDescription: "errorDescription", filterable: "filterable", fluid: "fluid", inputId: "inputId", label: "label", maxHeight: "maxHeight", name: "name", openOnSelect: "openOnSelect", options: "options", placeholder: "placeholder", readonly: "readonly", required: "required", value: "value" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
569
569
|
};
|
|
570
570
|
NvFielddropdown = __decorate([
|
|
571
571
|
ProxyCmp({
|
|
572
|
-
inputs: ['autocomplete', 'autofocus', 'debounceDelay', 'description', 'disabled', 'emptyResult', 'error', 'errorDescription', 'filterable', 'fluid', 'inputId', 'label', 'maxHeight', 'name', '
|
|
573
|
-
methods: ['
|
|
572
|
+
inputs: ['autocomplete', 'autofocus', 'controlledFilter', 'debounceDelay', 'description', 'disabled', 'emptyResult', 'error', 'errorDescription', 'filterable', 'fluid', 'inputId', 'label', 'maxHeight', 'name', 'openOnSelect', 'options', 'placeholder', 'readonly', 'required', 'value'],
|
|
573
|
+
methods: ['clearFilter', 'toggleDropdown']
|
|
574
574
|
})
|
|
575
575
|
], NvFielddropdown);
|
|
576
576
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NvFielddropdown, decorators: [{
|
|
@@ -580,7 +580,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
580
580
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
581
581
|
template: '<ng-content></ng-content>',
|
|
582
582
|
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
|
583
|
-
inputs: ['autocomplete', 'autofocus', 'debounceDelay', 'description', 'disabled', 'emptyResult', 'error', 'errorDescription', 'filterable', 'fluid', 'inputId', 'label', 'maxHeight', 'name', '
|
|
583
|
+
inputs: ['autocomplete', 'autofocus', 'controlledFilter', 'debounceDelay', 'description', 'disabled', 'emptyResult', 'error', 'errorDescription', 'filterable', 'fluid', 'inputId', 'label', 'maxHeight', 'name', 'openOnSelect', 'options', 'placeholder', 'readonly', 'required', 'value'],
|
|
584
584
|
standalone: false
|
|
585
585
|
}]
|
|
586
586
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }] });
|
|
@@ -592,11 +592,11 @@ let NvFielddropdownitem = class NvFielddropdownitem {
|
|
|
592
592
|
proxyOutputs(this, this.el, ['dropdownItemSelected']);
|
|
593
593
|
}
|
|
594
594
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NvFielddropdownitem, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
595
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: NvFielddropdownitem, selector: "nv-fielddropdownitem", inputs: { disabled: "disabled", label: "label", selected: "selected", value: "value" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
595
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: NvFielddropdownitem, selector: "nv-fielddropdownitem", inputs: { detached: "detached", disabled: "disabled", label: "label", selected: "selected", value: "value" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
596
596
|
};
|
|
597
597
|
NvFielddropdownitem = __decorate([
|
|
598
598
|
ProxyCmp({
|
|
599
|
-
inputs: ['disabled', 'label', 'selected', 'value']
|
|
599
|
+
inputs: ['detached', 'disabled', 'label', 'selected', 'value']
|
|
600
600
|
})
|
|
601
601
|
], NvFielddropdownitem);
|
|
602
602
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NvFielddropdownitem, decorators: [{
|
|
@@ -606,7 +606,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
606
606
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
607
607
|
template: '<ng-content></ng-content>',
|
|
608
608
|
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
|
609
|
-
inputs: ['disabled', 'label', 'selected', 'value'],
|
|
609
|
+
inputs: ['detached', 'disabled', 'label', 'selected', 'value'],
|
|
610
610
|
standalone: false
|
|
611
611
|
}]
|
|
612
612
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }] });
|
|
@@ -2094,7 +2094,8 @@ function createAngularTable(options) {
|
|
|
2094
2094
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
2095
2095
|
/* eslint-disable jsdoc/require-returns */
|
|
2096
2096
|
/**
|
|
2097
|
-
*
|
|
2097
|
+
* A powerful, flexible datatable component built on TanStack Table.
|
|
2098
|
+
* Supports custom cell rendering, column configuration, pagination, and full TypeScript typing.
|
|
2098
2099
|
*/
|
|
2099
2100
|
class NvDatatable {
|
|
2100
2101
|
/** Public getter for table instance. */
|
|
@@ -2136,27 +2137,41 @@ class NvDatatable {
|
|
|
2136
2137
|
const templateMap = this.cellTemplateMap();
|
|
2137
2138
|
return this.columns()
|
|
2138
2139
|
.filter((col) => !col.hidden)
|
|
2139
|
-
.map((col) =>
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
size: col.width,
|
|
2143
|
-
enableResizing: col.resizable ?? true,
|
|
2144
|
-
cell: (context) => {
|
|
2140
|
+
.map((col) => {
|
|
2141
|
+
// Shared cell renderer
|
|
2142
|
+
const cellRenderer = (context) => {
|
|
2145
2143
|
const fieldName = String(col.field);
|
|
2146
2144
|
const cellTemplate = templateMap.get(fieldName);
|
|
2147
2145
|
// Priority: template > renderCell > default
|
|
2148
2146
|
if (cellTemplate) {
|
|
2149
|
-
// Return TemplateRef directly -
|
|
2147
|
+
// Return TemplateRef directly - getValue() returns formatted value
|
|
2150
2148
|
return cellTemplate;
|
|
2151
2149
|
}
|
|
2152
2150
|
// Fall back to renderCell if provided
|
|
2153
2151
|
if (col.renderCell) {
|
|
2154
2152
|
return col.renderCell(context);
|
|
2155
2153
|
}
|
|
2156
|
-
// Default: just return the value
|
|
2154
|
+
// Default: just return the value (formatted if valueFormatter was used)
|
|
2157
2155
|
return context.getValue();
|
|
2158
|
-
}
|
|
2159
|
-
|
|
2156
|
+
};
|
|
2157
|
+
return {
|
|
2158
|
+
accessorKey: col.field,
|
|
2159
|
+
accessorFn: col.valueFormatter
|
|
2160
|
+
? (row) => {
|
|
2161
|
+
const rawValue = row[col.field];
|
|
2162
|
+
return col.valueFormatter({
|
|
2163
|
+
value: rawValue,
|
|
2164
|
+
row,
|
|
2165
|
+
field: col.field,
|
|
2166
|
+
});
|
|
2167
|
+
}
|
|
2168
|
+
: undefined,
|
|
2169
|
+
header: col.headerName || String(col.field),
|
|
2170
|
+
size: col.width,
|
|
2171
|
+
enableResizing: col.resizable ?? true,
|
|
2172
|
+
cell: cellRenderer,
|
|
2173
|
+
};
|
|
2174
|
+
});
|
|
2160
2175
|
});
|
|
2161
2176
|
/** TanStack table instance with Signals */
|
|
2162
2177
|
this.tableInstance = createAngularTable(() => {
|
|
@@ -2468,6 +2483,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
2468
2483
|
type: ContentChildren,
|
|
2469
2484
|
args: [NvDatatableCellDirective]
|
|
2470
2485
|
}] } });
|
|
2486
|
+
/********************************* UTILS **************************************/
|
|
2487
|
+
/**
|
|
2488
|
+
* Creates a strongly-typed column factory for a given row type.
|
|
2489
|
+
*
|
|
2490
|
+
* @template Row The row data type (e.g., `Product`)
|
|
2491
|
+
*
|
|
2492
|
+
* @returns {function} A function that accepts a column definition and infers:
|
|
2493
|
+
* - `K` as the field key (`keyof Row`)
|
|
2494
|
+
* - `F` as the return type of `valueFormatter` (defaults to `Row[K]`)
|
|
2495
|
+
*
|
|
2496
|
+
* @example
|
|
2497
|
+
* ```ts
|
|
2498
|
+
* // Define your row type
|
|
2499
|
+
* interface Product {
|
|
2500
|
+
* name: string;
|
|
2501
|
+
* price: number;
|
|
2502
|
+
* }
|
|
2503
|
+
*
|
|
2504
|
+
* const col = makeColumn<Product>();
|
|
2505
|
+
*/
|
|
2506
|
+
function makeColumn() {
|
|
2507
|
+
return function define(col) {
|
|
2508
|
+
return col;
|
|
2509
|
+
};
|
|
2510
|
+
}
|
|
2471
2511
|
|
|
2472
2512
|
class ValueAccessor {
|
|
2473
2513
|
constructor(el) {
|
|
@@ -3695,5 +3735,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
3695
3735
|
* Generated bundle index. Do not edit.
|
|
3696
3736
|
*/
|
|
3697
3737
|
|
|
3698
|
-
export { NotificationService, NotificationServiceComponent, NovaComponentsModule, NovaComponentsValueAccessorModule, NvAccordion, NvAccordionItem, NvAccordionValueAccessor, NvAlert, NvAlertValueAccessor, NvAvatar, NvBadge, NvBreadcrumb, NvBreadcrumbs, NvButton, NvButtongroup, NvCalendar, NvCalendarValueAccessor, NvCol, NvDatagrid, NvDatagridValueAccessor, NvDatagridcolumn, NvDatatable, NvDatatableCellDirective, NvDialog, NvDialogValueAccessor, NvDialogfooter, NvDialogheader, NvFieldcheckbox, NvFieldcheckboxValueAccessor, NvFielddate, NvFielddateValueAccessor, NvFielddaterange, NvFielddaterangeValueAccessor, NvFielddropdown, NvFielddropdownValueAccessor, NvFielddropdownitem, NvFielddropdownitemcheck, NvFieldmultiselect, NvFieldmultiselectValueAccessor, NvFieldnumber, NvFieldnumberValueAccessor, NvFieldpassword, NvFieldpasswordValueAccessor, NvFieldradio, NvFieldradioValueAccessor, NvFieldselect, NvFieldselectValueAccessor, NvFieldslider, NvFieldsliderValueAccessor, NvFieldtext, NvFieldtextValueAccessor, NvFieldtextarea, NvFieldtextareaValueAccessor, NvFieldtime, NvFieldtimeValueAccessor, NvIcon, NvIconbutton, NvLoader, NvMenu, NvMenuitem, NvNotification, NvNotificationValueAccessor, NvNotificationcontainer, NvPopover, NvPopoverValueAccessor, NvRow, NvSplit, NvSplitValueAccessor, NvStack, NvTable, NvToggle, NvToggleValueAccessor, NvTogglebutton, NvTogglebuttongroup, NvTogglebuttongroupValueAccessor, NvTooltip, VALUE_ACCESSORS, flexRenderComponent as nvDatatableRenderComponent, provideNovaComponents };
|
|
3738
|
+
export { NotificationService, NotificationServiceComponent, NovaComponentsModule, NovaComponentsValueAccessorModule, NvAccordion, NvAccordionItem, NvAccordionValueAccessor, NvAlert, NvAlertValueAccessor, NvAvatar, NvBadge, NvBreadcrumb, NvBreadcrumbs, NvButton, NvButtongroup, NvCalendar, NvCalendarValueAccessor, NvCol, NvDatagrid, NvDatagridValueAccessor, NvDatagridcolumn, NvDatatable, NvDatatableCellDirective, NvDialog, NvDialogValueAccessor, NvDialogfooter, NvDialogheader, NvFieldcheckbox, NvFieldcheckboxValueAccessor, NvFielddate, NvFielddateValueAccessor, NvFielddaterange, NvFielddaterangeValueAccessor, NvFielddropdown, NvFielddropdownValueAccessor, NvFielddropdownitem, NvFielddropdownitemcheck, NvFieldmultiselect, NvFieldmultiselectValueAccessor, NvFieldnumber, NvFieldnumberValueAccessor, NvFieldpassword, NvFieldpasswordValueAccessor, NvFieldradio, NvFieldradioValueAccessor, NvFieldselect, NvFieldselectValueAccessor, NvFieldslider, NvFieldsliderValueAccessor, NvFieldtext, NvFieldtextValueAccessor, NvFieldtextarea, NvFieldtextareaValueAccessor, NvFieldtime, NvFieldtimeValueAccessor, NvIcon, NvIconbutton, NvLoader, NvMenu, NvMenuitem, NvNotification, NvNotificationValueAccessor, NvNotificationcontainer, NvPopover, NvPopoverValueAccessor, NvRow, NvSplit, NvSplitValueAccessor, NvStack, NvTable, NvToggle, NvToggleValueAccessor, NvTogglebutton, NvTogglebuttongroup, NvTogglebuttongroupValueAccessor, NvTooltip, VALUE_ACCESSORS, makeColumn, flexRenderComponent as nvDatatableRenderComponent, provideNovaComponents };
|
|
3699
3739
|
//# sourceMappingURL=nova-components.mjs.map
|