@zambon-dev/ui 1.6.1 → 1.7.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/CHANGELOG.md +11 -1
- package/fesm2022/zambon-dev-ui-framework.mjs +5 -1
- package/fesm2022/zambon-dev-ui-framework.mjs.map +1 -1
- package/fesm2022/zambon-dev-ui-library.mjs +192 -11
- package/fesm2022/zambon-dev-ui-library.mjs.map +1 -1
- package/i18n/framework/en.json +4 -0
- package/i18n/framework/pt.json +4 -0
- package/package.json +1 -1
- package/types/zambon-dev-ui-library.d.ts +132 -0
|
@@ -891,6 +891,131 @@ var RouterFormatter = class {
|
|
|
891
891
|
return parentRoute + path;
|
|
892
892
|
}
|
|
893
893
|
};
|
|
894
|
+
const DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
|
|
895
|
+
const TIME_ZONE_MARKER = /(?:Z|[+-]\d{2}:?\d{2})$/i;
|
|
896
|
+
function getGridColumnAlign(column) {
|
|
897
|
+
if (column.align) return column.align;
|
|
898
|
+
switch (column.type) {
|
|
899
|
+
case "number":
|
|
900
|
+
case "currency":
|
|
901
|
+
case "percent": return "end";
|
|
902
|
+
case "boolean": return "center";
|
|
903
|
+
default: return "start";
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
function isNumericGridColumn(column) {
|
|
907
|
+
return column.type === "number" || column.type === "currency" || column.type === "percent";
|
|
908
|
+
}
|
|
909
|
+
function formatGridCellValue(value, column, locale, defaults = {}) {
|
|
910
|
+
if (value === null || value === void 0 || value === "") return text("");
|
|
911
|
+
try {
|
|
912
|
+
switch (column.type) {
|
|
913
|
+
case "number": return formatNumber(value, column, locale);
|
|
914
|
+
case "currency": return formatCurrency(value, column, locale);
|
|
915
|
+
case "percent": return formatPercent(value, column, locale);
|
|
916
|
+
case "date":
|
|
917
|
+
case "datetime": return formatDate$1(value, column, locale);
|
|
918
|
+
case "boolean": return formatBoolean(value, column, defaults);
|
|
919
|
+
case "enum":
|
|
920
|
+
case "badge": return formatEnum(value, column);
|
|
921
|
+
default: return text(String(value));
|
|
922
|
+
}
|
|
923
|
+
} catch {
|
|
924
|
+
return text(String(value));
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
function text(value) {
|
|
928
|
+
return {
|
|
929
|
+
kind: "text",
|
|
930
|
+
text: value,
|
|
931
|
+
translate: false
|
|
932
|
+
};
|
|
933
|
+
}
|
|
934
|
+
function toNumber(value) {
|
|
935
|
+
if (typeof value === "number") return Number.isFinite(value) ? value : null;
|
|
936
|
+
if (typeof value === "string" && value.trim() !== "") {
|
|
937
|
+
const parsed = Number(value);
|
|
938
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
939
|
+
}
|
|
940
|
+
return null;
|
|
941
|
+
}
|
|
942
|
+
function fractionDigits(column, defaultMin) {
|
|
943
|
+
const digits = {};
|
|
944
|
+
if (column.decimals !== void 0) {
|
|
945
|
+
digits.minimumFractionDigits = column.minDecimals ?? defaultMin(column.decimals);
|
|
946
|
+
digits.maximumFractionDigits = Math.max(column.decimals, digits.minimumFractionDigits);
|
|
947
|
+
} else if (column.minDecimals !== void 0) digits.minimumFractionDigits = column.minDecimals;
|
|
948
|
+
return digits;
|
|
949
|
+
}
|
|
950
|
+
function formatNumber(value, column, locale) {
|
|
951
|
+
const number = toNumber(value);
|
|
952
|
+
if (number === null) return text(String(value));
|
|
953
|
+
return text(formatLocaleNumber(number, locale, {
|
|
954
|
+
minFractionDigits: column.minDecimals ?? 0,
|
|
955
|
+
maxFractionDigits: column.decimals ?? 2
|
|
956
|
+
}));
|
|
957
|
+
}
|
|
958
|
+
function formatCurrency(value, column, locale) {
|
|
959
|
+
const number = toNumber(value);
|
|
960
|
+
if (number === null) return text(String(value));
|
|
961
|
+
if (!column.currency) return text(formatLocaleNumber(number, locale, {
|
|
962
|
+
minFractionDigits: 2,
|
|
963
|
+
maxFractionDigits: 2
|
|
964
|
+
}));
|
|
965
|
+
return text(new Intl.NumberFormat(locale, {
|
|
966
|
+
style: "currency",
|
|
967
|
+
currency: column.currency,
|
|
968
|
+
...fractionDigits(column, (decimals) => decimals)
|
|
969
|
+
}).format(number));
|
|
970
|
+
}
|
|
971
|
+
function formatPercent(value, column, locale) {
|
|
972
|
+
const number = toNumber(value);
|
|
973
|
+
if (number === null) return text(String(value));
|
|
974
|
+
return text(new Intl.NumberFormat(locale, {
|
|
975
|
+
style: "percent",
|
|
976
|
+
...fractionDigits(column, () => 0)
|
|
977
|
+
}).format(number));
|
|
978
|
+
}
|
|
979
|
+
function parseCellDate(value, utc) {
|
|
980
|
+
if (!utc || typeof value !== "string") return parseIsoValue(value);
|
|
981
|
+
const trimmed = value.trim();
|
|
982
|
+
const parsed = parseIsoValue(trimmed);
|
|
983
|
+
if (!parsed || DATE_ONLY.test(trimmed) || TIME_ZONE_MARKER.test(trimmed)) return parsed;
|
|
984
|
+
return /* @__PURE__ */ new Date(parsed.getTime() - parsed.getTimezoneOffset() * 6e4);
|
|
985
|
+
}
|
|
986
|
+
function formatDate$1(value, column, locale) {
|
|
987
|
+
const date = parseCellDate(value, column.utc ?? false);
|
|
988
|
+
if (!date) return text(String(value));
|
|
989
|
+
const dateText = formatDateText(date, locale);
|
|
990
|
+
return text(column.type === "datetime" ? `${dateText} ${formatTimeText(date, locale)}` : dateText);
|
|
991
|
+
}
|
|
992
|
+
function formatBoolean(value, column, defaults) {
|
|
993
|
+
let checked;
|
|
994
|
+
if (value === true || typeof value === "string" && value.toLowerCase() === "true") checked = true;
|
|
995
|
+
else if (value === false || typeof value === "string" && value.toLowerCase() === "false") checked = false;
|
|
996
|
+
else return text(String(value));
|
|
997
|
+
const hiddenText = (checked ? column.trueText ?? defaults.trueText : column.falseText ?? defaults.falseText) ?? "";
|
|
998
|
+
return {
|
|
999
|
+
kind: "boolean",
|
|
1000
|
+
text: hiddenText,
|
|
1001
|
+
translate: hiddenText !== "",
|
|
1002
|
+
checked
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
function formatEnum(value, column) {
|
|
1006
|
+
const key = String(value);
|
|
1007
|
+
const translationKey = column.enumValues && Object.prototype.hasOwnProperty.call(column.enumValues, key) ? column.enumValues[key] : void 0;
|
|
1008
|
+
const display = translationKey !== void 0 ? {
|
|
1009
|
+
kind: "text",
|
|
1010
|
+
text: translationKey,
|
|
1011
|
+
translate: true
|
|
1012
|
+
} : text(key);
|
|
1013
|
+
if (column.type === "badge") {
|
|
1014
|
+
display.kind = "badge";
|
|
1015
|
+
display.intent = column.badgeIntents?.[key] ?? "neutral";
|
|
1016
|
+
}
|
|
1017
|
+
return display;
|
|
1018
|
+
}
|
|
894
1019
|
var CatalogService = class CatalogService {
|
|
895
1020
|
http = inject(HttpClient);
|
|
896
1021
|
search(endpoint, maxResults, criteria, filters = null) {
|
|
@@ -4796,6 +4921,7 @@ var DataGridRowComponent = class DataGridRowComponent extends BaseComponent {
|
|
|
4796
4921
|
selected = signal(false, ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
|
|
4797
4922
|
_rowData;
|
|
4798
4923
|
elementRef = inject(ElementRef);
|
|
4924
|
+
localeService = inject(LocaleService);
|
|
4799
4925
|
get rowData() {
|
|
4800
4926
|
return this._rowData;
|
|
4801
4927
|
}
|
|
@@ -4835,6 +4961,19 @@ var DataGridRowComponent = class DataGridRowComponent extends BaseComponent {
|
|
|
4835
4961
|
if (this.selected()) this.dataGridDataset.selectRow(this.rowKey);
|
|
4836
4962
|
else this.dataGridDataset.deselectRow(this.rowKey);
|
|
4837
4963
|
}
|
|
4964
|
+
alignOf(column) {
|
|
4965
|
+
return getGridColumnAlign(column);
|
|
4966
|
+
}
|
|
4967
|
+
formatCell(column) {
|
|
4968
|
+
const configs = this.dataGridDataset.configs;
|
|
4969
|
+
return formatGridCellValue(this.getValue(column.field), column, this.localeService.locale(), {
|
|
4970
|
+
trueText: configs.booleanTrueText ?? "Yes",
|
|
4971
|
+
falseText: configs.booleanFalseText ?? "No"
|
|
4972
|
+
});
|
|
4973
|
+
}
|
|
4974
|
+
isNumeric(column) {
|
|
4975
|
+
return isNumericGridColumn(column);
|
|
4976
|
+
}
|
|
4838
4977
|
getValue(field) {
|
|
4839
4978
|
return field.split(".").reduce((value, field) => value?.[field], this.rowData);
|
|
4840
4979
|
}
|
|
@@ -4896,9 +5035,19 @@ var DataGridRowComponent = class DataGridRowComponent extends BaseComponent {
|
|
|
4896
5035
|
},
|
|
4897
5036
|
usesInheritance: true,
|
|
4898
5037
|
ngImport: i0,
|
|
4899
|
-
template: "<!-- A <label> rather than a clickable <div>: clicking anywhere in the cell still\nreaches the checkbox, natively. The click handler is a mouse-only convenience;\nthe keyboard path is the nested checkbox, which is focusable and toggles with\nSpace on its own. -->\n@if (dataGridDataset.configs.multiSelect) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <label class=\"cell selection\" (click)=\"onToggleSelection()\" (onResize)=\"onResizeSelection($event)\">\n <!-- Null, not false: an attribute binding writes disabled=\"false\" for false, and any value at\n all disables a control, so every checkbox rendered disabled and faded. -->\n <input class=\"form-input\" type=\"checkbox\" [attr.disabled]=\"disabled ? true : null\" [(ngModel)]=\"selected\" />\n </label>\n}\n@for (column of columns; track column; let i = $index) {\n <div
|
|
4900
|
-
styles: [":host{grid-column:1 / -1;display:grid;grid-template-columns:subgrid}.cell{position:relative;align-content:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell.disabled{pointer-events:none;cursor:default;overflow:hidden;text-overflow:ellipsis;opacity:.6}.cell input{vertical-align:super}.cell.selection{display:flex;align-items:center}.spacer{position:absolute;inset:0;z-index:-1;height:0px}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
|
|
5038
|
+
template: "<!-- A <label> rather than a clickable <div>: clicking anywhere in the cell still\nreaches the checkbox, natively. The click handler is a mouse-only convenience;\nthe keyboard path is the nested checkbox, which is focusable and toggles with\nSpace on its own. -->\n@if (dataGridDataset.configs.multiSelect) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <label class=\"cell selection\" (click)=\"onToggleSelection()\" (onResize)=\"onResizeSelection($event)\">\n <!-- Null, not false: an attribute binding writes disabled=\"false\" for false, and any value at\n all disables a control, so every checkbox rendered disabled and faded. -->\n <input class=\"form-input\" type=\"checkbox\" [attr.disabled]=\"disabled ? true : null\" [(ngModel)]=\"selected\" />\n </label>\n}\n@for (column of columns; track column; let i = $index) {\n <div\n #cell\n class=\"cell\"\n [class.align-center]=\"alignOf(column) === 'center'\"\n [class.align-end]=\"alignOf(column) === 'end'\"\n [class.disabled]=\"disabled\"\n [class.numeric]=\"isNumeric(column)\"\n [ngClass]=\"column.customClass\"\n >\n @if (isFirstRow) {\n <div class=\"spacer\" (onResize)=\"onResize(i, $event)\"></div>\n }\n <ng-container\n *ngTemplateOutlet=\"\n column.template ? column.template : simpleTemplate;\n context: { rowData: rowData, column: column }\n \"\n >\n </ng-container>\n </div>\n}\n\n<!-- A column without a template. The column's type decides the formatting; with no type the\nvalue shows as it is. The translate pipe sits only in the branches that hold a translation key, so a\nplain cell renders as it always did. -->\n<ng-template #simpleTemplate let-column=\"column\">\n @let cell = formatCell(column);\n @switch (cell.kind) {\n @case ('boolean') {\n @if (cell.checked) {\n <i class=\"fa-solid fa-check\" aria-hidden=\"true\"></i>\n }\n @if (cell.translate) {\n <span class=\"visually-hidden\">{{ cell.text | translate }}</span>\n }\n }\n @case ('badge') {\n <lib-badge [intent]=\"cell.intent ?? 'neutral'\">\n @if (cell.translate) {\n {{ cell.text | translate }}\n } @else {\n {{ cell.text }}\n }\n </lib-badge>\n }\n @default {\n @if (cell.translate) {\n <span>{{ cell.text | translate }}</span>\n } @else {\n <span>{{ cell.text }}</span>\n }\n }\n }\n</ng-template>\n",
|
|
5039
|
+
styles: [":host{grid-column:1 / -1;display:grid;grid-template-columns:subgrid}.cell{position:relative;align-content:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell.disabled{pointer-events:none;cursor:default;overflow:hidden;text-overflow:ellipsis;opacity:.6}.cell input{vertical-align:super}.cell.selection{display:flex;align-items:center}.cell.align-center{text-align:center}.cell.align-end{text-align:end}.cell.numeric{font-variant-numeric:tabular-nums}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border-width:0}.spacer{position:absolute;inset:0;z-index:-1;height:0px}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
|
|
4901
5040
|
dependencies: [
|
|
5041
|
+
{
|
|
5042
|
+
kind: "component",
|
|
5043
|
+
type: BadgeComponent,
|
|
5044
|
+
selector: "lib-badge",
|
|
5045
|
+
inputs: [
|
|
5046
|
+
"intent",
|
|
5047
|
+
"icon",
|
|
5048
|
+
"dot"
|
|
5049
|
+
]
|
|
5050
|
+
},
|
|
4902
5051
|
{
|
|
4903
5052
|
kind: "ngmodule",
|
|
4904
5053
|
type: FormsModule
|
|
@@ -4952,6 +5101,11 @@ var DataGridRowComponent = class DataGridRowComponent extends BaseComponent {
|
|
|
4952
5101
|
selector: "[onResize]",
|
|
4953
5102
|
inputs: ["resizeBoxModel"],
|
|
4954
5103
|
outputs: ["onResize"]
|
|
5104
|
+
},
|
|
5105
|
+
{
|
|
5106
|
+
kind: "pipe",
|
|
5107
|
+
type: TranslatePipe,
|
|
5108
|
+
name: "translate"
|
|
4955
5109
|
}
|
|
4956
5110
|
],
|
|
4957
5111
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
@@ -4973,13 +5127,15 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4973
5127
|
},
|
|
4974
5128
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4975
5129
|
imports: [
|
|
5130
|
+
BadgeComponent,
|
|
4976
5131
|
FormsModule,
|
|
4977
5132
|
NgClass,
|
|
4978
5133
|
NgTemplateOutlet,
|
|
4979
|
-
NgxResizeObserverModule
|
|
5134
|
+
NgxResizeObserverModule,
|
|
5135
|
+
TranslatePipe
|
|
4980
5136
|
],
|
|
4981
|
-
template: "<!-- A <label> rather than a clickable <div>: clicking anywhere in the cell still\nreaches the checkbox, natively. The click handler is a mouse-only convenience;\nthe keyboard path is the nested checkbox, which is focusable and toggles with\nSpace on its own. -->\n@if (dataGridDataset.configs.multiSelect) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <label class=\"cell selection\" (click)=\"onToggleSelection()\" (onResize)=\"onResizeSelection($event)\">\n <!-- Null, not false: an attribute binding writes disabled=\"false\" for false, and any value at\n all disables a control, so every checkbox rendered disabled and faded. -->\n <input class=\"form-input\" type=\"checkbox\" [attr.disabled]=\"disabled ? true : null\" [(ngModel)]=\"selected\" />\n </label>\n}\n@for (column of columns; track column; let i = $index) {\n <div
|
|
4982
|
-
styles: [":host{grid-column:1 / -1;display:grid;grid-template-columns:subgrid}.cell{position:relative;align-content:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell.disabled{pointer-events:none;cursor:default;overflow:hidden;text-overflow:ellipsis;opacity:.6}.cell input{vertical-align:super}.cell.selection{display:flex;align-items:center}.spacer{position:absolute;inset:0;z-index:-1;height:0px}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
|
|
5137
|
+
template: "<!-- A <label> rather than a clickable <div>: clicking anywhere in the cell still\nreaches the checkbox, natively. The click handler is a mouse-only convenience;\nthe keyboard path is the nested checkbox, which is focusable and toggles with\nSpace on its own. -->\n@if (dataGridDataset.configs.multiSelect) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <label class=\"cell selection\" (click)=\"onToggleSelection()\" (onResize)=\"onResizeSelection($event)\">\n <!-- Null, not false: an attribute binding writes disabled=\"false\" for false, and any value at\n all disables a control, so every checkbox rendered disabled and faded. -->\n <input class=\"form-input\" type=\"checkbox\" [attr.disabled]=\"disabled ? true : null\" [(ngModel)]=\"selected\" />\n </label>\n}\n@for (column of columns; track column; let i = $index) {\n <div\n #cell\n class=\"cell\"\n [class.align-center]=\"alignOf(column) === 'center'\"\n [class.align-end]=\"alignOf(column) === 'end'\"\n [class.disabled]=\"disabled\"\n [class.numeric]=\"isNumeric(column)\"\n [ngClass]=\"column.customClass\"\n >\n @if (isFirstRow) {\n <div class=\"spacer\" (onResize)=\"onResize(i, $event)\"></div>\n }\n <ng-container\n *ngTemplateOutlet=\"\n column.template ? column.template : simpleTemplate;\n context: { rowData: rowData, column: column }\n \"\n >\n </ng-container>\n </div>\n}\n\n<!-- A column without a template. The column's type decides the formatting; with no type the\nvalue shows as it is. The translate pipe sits only in the branches that hold a translation key, so a\nplain cell renders as it always did. -->\n<ng-template #simpleTemplate let-column=\"column\">\n @let cell = formatCell(column);\n @switch (cell.kind) {\n @case ('boolean') {\n @if (cell.checked) {\n <i class=\"fa-solid fa-check\" aria-hidden=\"true\"></i>\n }\n @if (cell.translate) {\n <span class=\"visually-hidden\">{{ cell.text | translate }}</span>\n }\n }\n @case ('badge') {\n <lib-badge [intent]=\"cell.intent ?? 'neutral'\">\n @if (cell.translate) {\n {{ cell.text | translate }}\n } @else {\n {{ cell.text }}\n }\n </lib-badge>\n }\n @default {\n @if (cell.translate) {\n <span>{{ cell.text | translate }}</span>\n } @else {\n <span>{{ cell.text }}</span>\n }\n }\n }\n</ng-template>\n",
|
|
5138
|
+
styles: [":host{grid-column:1 / -1;display:grid;grid-template-columns:subgrid}.cell{position:relative;align-content:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell.disabled{pointer-events:none;cursor:default;overflow:hidden;text-overflow:ellipsis;opacity:.6}.cell input{vertical-align:super}.cell.selection{display:flex;align-items:center}.cell.align-center{text-align:center}.cell.align-end{text-align:end}.cell.numeric{font-variant-numeric:tabular-nums}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border-width:0}.spacer{position:absolute;inset:0;z-index:-1;height:0px}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
|
|
4983
5139
|
}]
|
|
4984
5140
|
}],
|
|
4985
5141
|
ctorParameters: () => [],
|
|
@@ -5002,6 +5158,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5002
5158
|
}]
|
|
5003
5159
|
}
|
|
5004
5160
|
});
|
|
5161
|
+
const DEFAULT_TOTAL_ROWS_TEXT = "{{ count }} records";
|
|
5162
|
+
const DEFAULT_TOTAL_ROW_TEXT = "{{ count }} record";
|
|
5005
5163
|
var DataGridComponent = class DataGridComponent extends BaseComponent {
|
|
5006
5164
|
bodyElement = viewChild("body", ...ngDevMode ? [{ debugName: "bodyElement" }] : /* istanbul ignore next */ []);
|
|
5007
5165
|
viewport = viewChild(CdkVirtualScrollViewport, ...ngDevMode ? [{ debugName: "viewport" }] : /* istanbul ignore next */ []);
|
|
@@ -5018,6 +5176,7 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
|
|
|
5018
5176
|
gridRoute = "";
|
|
5019
5177
|
isGridCurrentUrl = false;
|
|
5020
5178
|
lastPosition = 0;
|
|
5179
|
+
localeService = inject(LocaleService);
|
|
5021
5180
|
ngZone = inject(NgZone);
|
|
5022
5181
|
router = inject(Router);
|
|
5023
5182
|
selectionColRealSize;
|
|
@@ -5064,6 +5223,17 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
|
|
|
5064
5223
|
get selectionColWidth() {
|
|
5065
5224
|
return this.selectionColRealSize ? `${this.selectionColRealSize}px` : this.configs.multiSelectSize ?? "min-content";
|
|
5066
5225
|
}
|
|
5226
|
+
get shouldShowTotalRows() {
|
|
5227
|
+
const totalRows = this.dataGridDataset.totalRows;
|
|
5228
|
+
return (this.configs.showTotalRows ?? false) && typeof totalRows === "number";
|
|
5229
|
+
}
|
|
5230
|
+
get formattedTotalRows() {
|
|
5231
|
+
return formatLocaleNumber(this.dataGridDataset.totalRows ?? 0, this.localeService.locale(), { maxFractionDigits: 0 });
|
|
5232
|
+
}
|
|
5233
|
+
get totalRowsText() {
|
|
5234
|
+
if (this.dataGridDataset.totalRows === 1) return this.configs.totalRowText ?? DEFAULT_TOTAL_ROW_TEXT;
|
|
5235
|
+
return this.configs.totalRowsText ?? DEFAULT_TOTAL_ROWS_TEXT;
|
|
5236
|
+
}
|
|
5067
5237
|
get shouldDisplayMessageWhenEmpty() {
|
|
5068
5238
|
return this.dataGridDataset?.configs?.showMessageOnEmpty ?? true;
|
|
5069
5239
|
}
|
|
@@ -5142,6 +5312,12 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
|
|
|
5142
5312
|
onSelectionResized(newSize) {
|
|
5143
5313
|
if (this.selectionColRealSize != newSize) this.selectionColRealSize = newSize;
|
|
5144
5314
|
}
|
|
5315
|
+
alignOf(column) {
|
|
5316
|
+
return getGridColumnAlign(column);
|
|
5317
|
+
}
|
|
5318
|
+
fillCount(text) {
|
|
5319
|
+
return text.replace(/\{\{\s*count\s*\}\}/g, this.formattedTotalRows);
|
|
5320
|
+
}
|
|
5145
5321
|
isFirstVisibleRow(rowIndex) {
|
|
5146
5322
|
const renderedRange = this.viewport()?.getRenderedRange();
|
|
5147
5323
|
if (renderedRange) return rowIndex === renderedRange.start;
|
|
@@ -5210,8 +5386,8 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
|
|
|
5210
5386
|
}],
|
|
5211
5387
|
usesInheritance: true,
|
|
5212
5388
|
ngImport: i0,
|
|
5213
|
-
template: "@if (showButtons()) {\n <div class=\"buttons\">\n <ng-content select=\"[buttons]\"></ng-content>\n </div>\n}\n\n<div class=\"header\" [class.hide]=\"isHideColumns\" [style.padding-right.px]=\"headerRightMargin()\">\n <!-- Translated by however far the body is scrolled sideways. The rows scroll inside the CDK\n viewport and the header sits outside it, so without this the headings simply stay put\n while the cells move away from them. -->\n <div class=\"header-row\" [style.transform]=\"headerScrollLeft() ? 'translateX(-' + headerScrollLeft() + 'px)' : null\">\n @if (isShowMultiSelect) {\n <div\n class=\"header-cell selection\"\n [ngStyle]=\"{\n width: selectionColWidth ? selectionColWidth : null,\n }\"\n >\n \n </div>\n }\n\n <!-- A measured zero is a width, not the absence of one: it is a 1fr column that collapsed,\n and its heading has to collapse too.\n\n Such a heading is removed rather than merely made zero wide, because a flex item still\n takes a gap on each side while the body grid allows the collapsed track only one, and\n that spare gap pushed every heading to its right out by 16px. -->\n @for (column of columns; track column) {\n <div\n class=\"header-cell\"\n [ngStyle]=\"{\n display: column.realSize === 0 ? 'none' : null,\n 'width.px': column.realSize ?? null,\n }\"\n >\n <span>{{ column.headerName | translate }}</span>\n </div>\n }\n </div>\n</div>\n\n<div #body class=\"body\" [style.min-height.px]=\"bodyMinHeight\">\n <cdk-virtual-scroll-viewport [itemSize]=\"configs.rowHeight\" [style.grid-template-columns]=\"gridColumns\">\n <lib-data-grid-row\n #row\n *cdkVirtualFor=\"let row of dataGridDataset.loadedRows; index as i; trackBy: trackByFn\"\n [disabled]=\"disabled()\"\n [isFirstRow]=\"isFirstVisibleRow(i)\"\n [rowData]=\"row\"\n [rowIndex]=\"i\"\n [style.height.px]=\"configs.rowHeight\"\n (selectionResized)=\"onSelectionResized($event)\"\n >\n </lib-data-grid-row>\n\n @if (loading()) {\n <div class=\"loading\" [style.height.px]=\"configs.rowHeight\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n <span>\n {{ dataGridDataset.configs.loadingDisplayText ?? '' | translate }}\n </span>\n </div>\n }\n @if (!loading() && !hasBeenLoaded && !hasFailed() && lazyLoadRows()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenLazyLoad | translate }}\n </span>\n </div>\n }\n <!-- A failed load shows its message even when no load has succeeded yet: the first one failing\n used to leave the grid blank. -->\n @if (!loading() && (hasFailed() || (hasBeenLoaded && !hasLoadedRows))) {\n @if (!hasFailed() && !hasLoadedRows && hasMessageToDisplayWhenEmpty && shouldDisplayMessageWhenEmpty) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenEmpty | translate }}\n </span>\n </div>\n }\n @if (hasFailed()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n <i class=\"fas fa-exclamation-triangle mr-2 text-yellow-600\"></i>{{ messageToDisplayWhenFailed | translate }}\n </span>\n </div>\n }\n }\n </cdk-virtual-scroll-viewport>\n</div>\n",
|
|
5214
|
-
styles: ["@charset \"UTF-8\";@layer properties;:host{display:flex;flex-direction:column;overflow:hidden;-webkit-user-select:none;user-select:none}:host:not(.no-borders){background-color:var(--color-surface-solid)}:host:not(.no-borders):not(.hide-borders){border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);border-radius:var(--surface-radius, .5rem)}:host.no-borders .header .header-row{padding-block:calc(var(--spacing, .25rem) * 1.5)}:host.no-borders .body lib-data-grid-row{padding-block:var(--spacing, .25rem)}.header-row,lib-data-grid-row,.loading,.message{gap:calc(var(--spacing, .25rem) * 4);padding-inline:calc(var(--spacing, .25rem) * 4)}.header{overflow:hidden;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;--tw-font-weight: var(--font-weight-bold, 700);font-weight:var(--font-weight-bold, 700);background-color:color-mix(in srgb,oklch(21% .034 264.665) 14%,transparent);border-color:var(--color-line)}@supports (color: color-mix(in lab,red,red)){.header{background-color:color-mix(in srgb,var(--color-content-primary) 14%,transparent)}}.header.hide{display:none}.header .header-row{display:flex;flex-direction:row;padding-block:calc(var(--spacing, .25rem) * 3)}.header .header-cell{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header .header-cell:not(.selection){flex:none}.body{position:relative;flex-grow:1}.body cdk-virtual-scroll-viewport{position:absolute;inset:0}.body cdk-virtual-scroll-viewport ::ng-deep .cdk-virtual-scroll-content-wrapper{display:grid;grid-template-columns:inherit}.body lib-data-grid-row{margin-top:-1px;cursor:pointer;border-block-style:var(--tw-border-style);border-block-width:1px;padding-block:calc(var(--spacing, .25rem) * 2);border-color:var(--color-line)}.body lib-data-grid-row.striped{background-color:var(--state-hover)}.body lib-data-grid-row:hover{background-color:var(--state-selected)}.body lib-data-grid-row.focused{z-index:1;border-color:var(--color-line-strong)}.body lib-data-grid-row.selected{position:relative;z-index:10;background-color:var(--state-selected);border-color:var(--color-line-selected)}.body lib-data-grid-row.selected:hover{background-color:var(--state-selected)}.body .loading,.body .message{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);white-space:nowrap;height:calc(var(--spacing, .25rem) * 10);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-line);grid-column:1 / -1}.body .loading span,.body .message span{overflow:hidden;text-overflow:ellipsis}.body .loading svg{height:calc(var(--spacing, .25rem) * 6);min-height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 6);min-width:calc(var(--spacing, .25rem) * 6);animation:var(--animate-spin, spin 1s linear infinite);transition-property:opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration, var(--default-transition-duration, .15s));transition-duration:var(--duration-short);transition-timing-function:var(--ease-standard)}.buttons{display:flex;border-top-style:var(--tw-border-style);border-top-width:1px;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;padding:var(--spacing, .25rem);border-color:var(--color-line)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@keyframes spin{to{transform:rotate(360deg)}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
|
|
5389
|
+
template: "@if (showButtons()) {\n <div class=\"buttons\">\n <ng-content select=\"[buttons]\"></ng-content>\n </div>\n}\n\n<div class=\"header\" [class.hide]=\"isHideColumns\" [style.padding-right.px]=\"headerRightMargin()\">\n <!-- Translated by however far the body is scrolled sideways. The rows scroll inside the CDK\n viewport and the header sits outside it, so without this the headings simply stay put\n while the cells move away from them. -->\n <div class=\"header-row\" [style.transform]=\"headerScrollLeft() ? 'translateX(-' + headerScrollLeft() + 'px)' : null\">\n @if (isShowMultiSelect) {\n <div\n class=\"header-cell selection\"\n [ngStyle]=\"{\n width: selectionColWidth ? selectionColWidth : null,\n }\"\n >\n \n </div>\n }\n\n <!-- A measured zero is a width, not the absence of one: it is a 1fr column that collapsed,\n and its heading has to collapse too.\n\n Such a heading is removed rather than merely made zero wide, because a flex item still\n takes a gap on each side while the body grid allows the collapsed track only one, and\n that spare gap pushed every heading to its right out by 16px. -->\n @for (column of columns; track column) {\n <div\n class=\"header-cell\"\n [class.align-center]=\"alignOf(column) === 'center'\"\n [class.align-end]=\"alignOf(column) === 'end'\"\n [ngStyle]=\"{\n display: column.realSize === 0 ? 'none' : null,\n 'width.px': column.realSize ?? null,\n }\"\n >\n <span>{{ column.headerName | translate }}</span>\n </div>\n }\n </div>\n</div>\n\n<div #body class=\"body\" [style.min-height.px]=\"bodyMinHeight\">\n <cdk-virtual-scroll-viewport [itemSize]=\"configs.rowHeight\" [style.grid-template-columns]=\"gridColumns\">\n <lib-data-grid-row\n #row\n *cdkVirtualFor=\"let row of dataGridDataset.loadedRows; index as i; trackBy: trackByFn\"\n [disabled]=\"disabled()\"\n [isFirstRow]=\"isFirstVisibleRow(i)\"\n [rowData]=\"row\"\n [rowIndex]=\"i\"\n [style.height.px]=\"configs.rowHeight\"\n (selectionResized)=\"onSelectionResized($event)\"\n >\n </lib-data-grid-row>\n\n @if (loading()) {\n <div class=\"loading\" [style.height.px]=\"configs.rowHeight\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n <span>\n {{ dataGridDataset.configs.loadingDisplayText ?? '' | translate }}\n </span>\n </div>\n }\n @if (!loading() && !hasBeenLoaded && !hasFailed() && lazyLoadRows()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenLazyLoad | translate }}\n </span>\n </div>\n }\n <!-- A failed load shows its message even when no load has succeeded yet: the first one failing\n used to leave the grid blank. -->\n @if (!loading() && (hasFailed() || (hasBeenLoaded && !hasLoadedRows))) {\n @if (!hasFailed() && !hasLoadedRows && hasMessageToDisplayWhenEmpty && shouldDisplayMessageWhenEmpty) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenEmpty | translate }}\n </span>\n </div>\n }\n @if (hasFailed()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n <i class=\"fas fa-exclamation-triangle mr-2 text-yellow-600\"></i>{{ messageToDisplayWhenFailed | translate }}\n </span>\n </div>\n }\n }\n </cdk-virtual-scroll-viewport>\n</div>\n\n@if (shouldShowTotalRows) {\n <div class=\"footer\">\n {{ fillCount(totalRowsText | translate: { count: formattedTotalRows }) }}\n </div>\n}\n",
|
|
5390
|
+
styles: ["@charset \"UTF-8\";@layer properties;:host{display:flex;flex-direction:column;overflow:hidden;-webkit-user-select:none;user-select:none}:host:not(.no-borders){background-color:var(--color-surface-solid)}:host:not(.no-borders):not(.hide-borders){border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);border-radius:var(--surface-radius, .5rem)}:host.no-borders .header .header-row{padding-block:calc(var(--spacing, .25rem) * 1.5)}:host.no-borders .body lib-data-grid-row{padding-block:var(--spacing, .25rem)}.header-row,lib-data-grid-row,.loading,.message{gap:calc(var(--spacing, .25rem) * 4);padding-inline:calc(var(--spacing, .25rem) * 4)}.header{overflow:hidden;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;--tw-font-weight: var(--font-weight-bold, 700);font-weight:var(--font-weight-bold, 700);background-color:color-mix(in srgb,oklch(21% .034 264.665) 14%,transparent);border-color:var(--color-line)}@supports (color: color-mix(in lab,red,red)){.header{background-color:color-mix(in srgb,var(--color-content-primary) 14%,transparent)}}.header.hide{display:none}.header .header-row{display:flex;flex-direction:row;padding-block:calc(var(--spacing, .25rem) * 3)}.header .header-cell{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header .header-cell:not(.selection){flex:none}.header .header-cell.align-center{text-align:center}.header .header-cell.align-end{text-align:end}.footer{overflow:hidden;border-top-style:var(--tw-border-style);border-top-width:1px;padding-inline:calc(var(--spacing, .25rem) * 4);padding-block:calc(var(--spacing, .25rem) * 1.5);text-overflow:ellipsis;white-space:nowrap;border-color:var(--color-line);color:var(--color-content-secondary);font-size:var(--text-caption);font-variant-numeric:tabular-nums}.body{position:relative;flex-grow:1}.body cdk-virtual-scroll-viewport{position:absolute;inset:0}.body cdk-virtual-scroll-viewport ::ng-deep .cdk-virtual-scroll-content-wrapper{display:grid;grid-template-columns:inherit}.body lib-data-grid-row{margin-top:-1px;cursor:pointer;border-block-style:var(--tw-border-style);border-block-width:1px;padding-block:calc(var(--spacing, .25rem) * 2);border-color:var(--color-line)}.body lib-data-grid-row.striped{background-color:var(--state-hover)}.body lib-data-grid-row:hover{background-color:var(--state-selected)}.body lib-data-grid-row.focused{z-index:1;border-color:var(--color-line-strong)}.body lib-data-grid-row.selected{position:relative;z-index:10;background-color:var(--state-selected);border-color:var(--color-line-selected)}.body lib-data-grid-row.selected:hover{background-color:var(--state-selected)}.body .loading,.body .message{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);white-space:nowrap;height:calc(var(--spacing, .25rem) * 10);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-line);grid-column:1 / -1}.body .loading span,.body .message span{overflow:hidden;text-overflow:ellipsis}.body .loading svg{height:calc(var(--spacing, .25rem) * 6);min-height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 6);min-width:calc(var(--spacing, .25rem) * 6);animation:var(--animate-spin, spin 1s linear infinite);transition-property:opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration, var(--default-transition-duration, .15s));transition-duration:var(--duration-short);transition-timing-function:var(--ease-standard)}.buttons{display:flex;border-top-style:var(--tw-border-style);border-top-width:1px;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;padding:var(--spacing, .25rem);border-color:var(--color-line)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@keyframes spin{to{transform:rotate(360deg)}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
|
|
5215
5391
|
dependencies: [
|
|
5216
5392
|
{
|
|
5217
5393
|
kind: "component",
|
|
@@ -5290,8 +5466,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5290
5466
|
ScrollingModule,
|
|
5291
5467
|
TranslatePipe
|
|
5292
5468
|
],
|
|
5293
|
-
template: "@if (showButtons()) {\n <div class=\"buttons\">\n <ng-content select=\"[buttons]\"></ng-content>\n </div>\n}\n\n<div class=\"header\" [class.hide]=\"isHideColumns\" [style.padding-right.px]=\"headerRightMargin()\">\n <!-- Translated by however far the body is scrolled sideways. The rows scroll inside the CDK\n viewport and the header sits outside it, so without this the headings simply stay put\n while the cells move away from them. -->\n <div class=\"header-row\" [style.transform]=\"headerScrollLeft() ? 'translateX(-' + headerScrollLeft() + 'px)' : null\">\n @if (isShowMultiSelect) {\n <div\n class=\"header-cell selection\"\n [ngStyle]=\"{\n width: selectionColWidth ? selectionColWidth : null,\n }\"\n >\n \n </div>\n }\n\n <!-- A measured zero is a width, not the absence of one: it is a 1fr column that collapsed,\n and its heading has to collapse too.\n\n Such a heading is removed rather than merely made zero wide, because a flex item still\n takes a gap on each side while the body grid allows the collapsed track only one, and\n that spare gap pushed every heading to its right out by 16px. -->\n @for (column of columns; track column) {\n <div\n class=\"header-cell\"\n [ngStyle]=\"{\n display: column.realSize === 0 ? 'none' : null,\n 'width.px': column.realSize ?? null,\n }\"\n >\n <span>{{ column.headerName | translate }}</span>\n </div>\n }\n </div>\n</div>\n\n<div #body class=\"body\" [style.min-height.px]=\"bodyMinHeight\">\n <cdk-virtual-scroll-viewport [itemSize]=\"configs.rowHeight\" [style.grid-template-columns]=\"gridColumns\">\n <lib-data-grid-row\n #row\n *cdkVirtualFor=\"let row of dataGridDataset.loadedRows; index as i; trackBy: trackByFn\"\n [disabled]=\"disabled()\"\n [isFirstRow]=\"isFirstVisibleRow(i)\"\n [rowData]=\"row\"\n [rowIndex]=\"i\"\n [style.height.px]=\"configs.rowHeight\"\n (selectionResized)=\"onSelectionResized($event)\"\n >\n </lib-data-grid-row>\n\n @if (loading()) {\n <div class=\"loading\" [style.height.px]=\"configs.rowHeight\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n <span>\n {{ dataGridDataset.configs.loadingDisplayText ?? '' | translate }}\n </span>\n </div>\n }\n @if (!loading() && !hasBeenLoaded && !hasFailed() && lazyLoadRows()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenLazyLoad | translate }}\n </span>\n </div>\n }\n <!-- A failed load shows its message even when no load has succeeded yet: the first one failing\n used to leave the grid blank. -->\n @if (!loading() && (hasFailed() || (hasBeenLoaded && !hasLoadedRows))) {\n @if (!hasFailed() && !hasLoadedRows && hasMessageToDisplayWhenEmpty && shouldDisplayMessageWhenEmpty) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenEmpty | translate }}\n </span>\n </div>\n }\n @if (hasFailed()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n <i class=\"fas fa-exclamation-triangle mr-2 text-yellow-600\"></i>{{ messageToDisplayWhenFailed | translate }}\n </span>\n </div>\n }\n }\n </cdk-virtual-scroll-viewport>\n</div>\n",
|
|
5294
|
-
styles: ["@charset \"UTF-8\";@layer properties;:host{display:flex;flex-direction:column;overflow:hidden;-webkit-user-select:none;user-select:none}:host:not(.no-borders){background-color:var(--color-surface-solid)}:host:not(.no-borders):not(.hide-borders){border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);border-radius:var(--surface-radius, .5rem)}:host.no-borders .header .header-row{padding-block:calc(var(--spacing, .25rem) * 1.5)}:host.no-borders .body lib-data-grid-row{padding-block:var(--spacing, .25rem)}.header-row,lib-data-grid-row,.loading,.message{gap:calc(var(--spacing, .25rem) * 4);padding-inline:calc(var(--spacing, .25rem) * 4)}.header{overflow:hidden;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;--tw-font-weight: var(--font-weight-bold, 700);font-weight:var(--font-weight-bold, 700);background-color:color-mix(in srgb,oklch(21% .034 264.665) 14%,transparent);border-color:var(--color-line)}@supports (color: color-mix(in lab,red,red)){.header{background-color:color-mix(in srgb,var(--color-content-primary) 14%,transparent)}}.header.hide{display:none}.header .header-row{display:flex;flex-direction:row;padding-block:calc(var(--spacing, .25rem) * 3)}.header .header-cell{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header .header-cell:not(.selection){flex:none}.body{position:relative;flex-grow:1}.body cdk-virtual-scroll-viewport{position:absolute;inset:0}.body cdk-virtual-scroll-viewport ::ng-deep .cdk-virtual-scroll-content-wrapper{display:grid;grid-template-columns:inherit}.body lib-data-grid-row{margin-top:-1px;cursor:pointer;border-block-style:var(--tw-border-style);border-block-width:1px;padding-block:calc(var(--spacing, .25rem) * 2);border-color:var(--color-line)}.body lib-data-grid-row.striped{background-color:var(--state-hover)}.body lib-data-grid-row:hover{background-color:var(--state-selected)}.body lib-data-grid-row.focused{z-index:1;border-color:var(--color-line-strong)}.body lib-data-grid-row.selected{position:relative;z-index:10;background-color:var(--state-selected);border-color:var(--color-line-selected)}.body lib-data-grid-row.selected:hover{background-color:var(--state-selected)}.body .loading,.body .message{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);white-space:nowrap;height:calc(var(--spacing, .25rem) * 10);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-line);grid-column:1 / -1}.body .loading span,.body .message span{overflow:hidden;text-overflow:ellipsis}.body .loading svg{height:calc(var(--spacing, .25rem) * 6);min-height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 6);min-width:calc(var(--spacing, .25rem) * 6);animation:var(--animate-spin, spin 1s linear infinite);transition-property:opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration, var(--default-transition-duration, .15s));transition-duration:var(--duration-short);transition-timing-function:var(--ease-standard)}.buttons{display:flex;border-top-style:var(--tw-border-style);border-top-width:1px;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;padding:var(--spacing, .25rem);border-color:var(--color-line)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@keyframes spin{to{transform:rotate(360deg)}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
|
|
5469
|
+
template: "@if (showButtons()) {\n <div class=\"buttons\">\n <ng-content select=\"[buttons]\"></ng-content>\n </div>\n}\n\n<div class=\"header\" [class.hide]=\"isHideColumns\" [style.padding-right.px]=\"headerRightMargin()\">\n <!-- Translated by however far the body is scrolled sideways. The rows scroll inside the CDK\n viewport and the header sits outside it, so without this the headings simply stay put\n while the cells move away from them. -->\n <div class=\"header-row\" [style.transform]=\"headerScrollLeft() ? 'translateX(-' + headerScrollLeft() + 'px)' : null\">\n @if (isShowMultiSelect) {\n <div\n class=\"header-cell selection\"\n [ngStyle]=\"{\n width: selectionColWidth ? selectionColWidth : null,\n }\"\n >\n \n </div>\n }\n\n <!-- A measured zero is a width, not the absence of one: it is a 1fr column that collapsed,\n and its heading has to collapse too.\n\n Such a heading is removed rather than merely made zero wide, because a flex item still\n takes a gap on each side while the body grid allows the collapsed track only one, and\n that spare gap pushed every heading to its right out by 16px. -->\n @for (column of columns; track column) {\n <div\n class=\"header-cell\"\n [class.align-center]=\"alignOf(column) === 'center'\"\n [class.align-end]=\"alignOf(column) === 'end'\"\n [ngStyle]=\"{\n display: column.realSize === 0 ? 'none' : null,\n 'width.px': column.realSize ?? null,\n }\"\n >\n <span>{{ column.headerName | translate }}</span>\n </div>\n }\n </div>\n</div>\n\n<div #body class=\"body\" [style.min-height.px]=\"bodyMinHeight\">\n <cdk-virtual-scroll-viewport [itemSize]=\"configs.rowHeight\" [style.grid-template-columns]=\"gridColumns\">\n <lib-data-grid-row\n #row\n *cdkVirtualFor=\"let row of dataGridDataset.loadedRows; index as i; trackBy: trackByFn\"\n [disabled]=\"disabled()\"\n [isFirstRow]=\"isFirstVisibleRow(i)\"\n [rowData]=\"row\"\n [rowIndex]=\"i\"\n [style.height.px]=\"configs.rowHeight\"\n (selectionResized)=\"onSelectionResized($event)\"\n >\n </lib-data-grid-row>\n\n @if (loading()) {\n <div class=\"loading\" [style.height.px]=\"configs.rowHeight\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n <span>\n {{ dataGridDataset.configs.loadingDisplayText ?? '' | translate }}\n </span>\n </div>\n }\n @if (!loading() && !hasBeenLoaded && !hasFailed() && lazyLoadRows()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenLazyLoad | translate }}\n </span>\n </div>\n }\n <!-- A failed load shows its message even when no load has succeeded yet: the first one failing\n used to leave the grid blank. -->\n @if (!loading() && (hasFailed() || (hasBeenLoaded && !hasLoadedRows))) {\n @if (!hasFailed() && !hasLoadedRows && hasMessageToDisplayWhenEmpty && shouldDisplayMessageWhenEmpty) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenEmpty | translate }}\n </span>\n </div>\n }\n @if (hasFailed()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n <i class=\"fas fa-exclamation-triangle mr-2 text-yellow-600\"></i>{{ messageToDisplayWhenFailed | translate }}\n </span>\n </div>\n }\n }\n </cdk-virtual-scroll-viewport>\n</div>\n\n@if (shouldShowTotalRows) {\n <div class=\"footer\">\n {{ fillCount(totalRowsText | translate: { count: formattedTotalRows }) }}\n </div>\n}\n",
|
|
5470
|
+
styles: ["@charset \"UTF-8\";@layer properties;:host{display:flex;flex-direction:column;overflow:hidden;-webkit-user-select:none;user-select:none}:host:not(.no-borders){background-color:var(--color-surface-solid)}:host:not(.no-borders):not(.hide-borders){border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);border-radius:var(--surface-radius, .5rem)}:host.no-borders .header .header-row{padding-block:calc(var(--spacing, .25rem) * 1.5)}:host.no-borders .body lib-data-grid-row{padding-block:var(--spacing, .25rem)}.header-row,lib-data-grid-row,.loading,.message{gap:calc(var(--spacing, .25rem) * 4);padding-inline:calc(var(--spacing, .25rem) * 4)}.header{overflow:hidden;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;--tw-font-weight: var(--font-weight-bold, 700);font-weight:var(--font-weight-bold, 700);background-color:color-mix(in srgb,oklch(21% .034 264.665) 14%,transparent);border-color:var(--color-line)}@supports (color: color-mix(in lab,red,red)){.header{background-color:color-mix(in srgb,var(--color-content-primary) 14%,transparent)}}.header.hide{display:none}.header .header-row{display:flex;flex-direction:row;padding-block:calc(var(--spacing, .25rem) * 3)}.header .header-cell{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header .header-cell:not(.selection){flex:none}.header .header-cell.align-center{text-align:center}.header .header-cell.align-end{text-align:end}.footer{overflow:hidden;border-top-style:var(--tw-border-style);border-top-width:1px;padding-inline:calc(var(--spacing, .25rem) * 4);padding-block:calc(var(--spacing, .25rem) * 1.5);text-overflow:ellipsis;white-space:nowrap;border-color:var(--color-line);color:var(--color-content-secondary);font-size:var(--text-caption);font-variant-numeric:tabular-nums}.body{position:relative;flex-grow:1}.body cdk-virtual-scroll-viewport{position:absolute;inset:0}.body cdk-virtual-scroll-viewport ::ng-deep .cdk-virtual-scroll-content-wrapper{display:grid;grid-template-columns:inherit}.body lib-data-grid-row{margin-top:-1px;cursor:pointer;border-block-style:var(--tw-border-style);border-block-width:1px;padding-block:calc(var(--spacing, .25rem) * 2);border-color:var(--color-line)}.body lib-data-grid-row.striped{background-color:var(--state-hover)}.body lib-data-grid-row:hover{background-color:var(--state-selected)}.body lib-data-grid-row.focused{z-index:1;border-color:var(--color-line-strong)}.body lib-data-grid-row.selected{position:relative;z-index:10;background-color:var(--state-selected);border-color:var(--color-line-selected)}.body lib-data-grid-row.selected:hover{background-color:var(--state-selected)}.body .loading,.body .message{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);white-space:nowrap;height:calc(var(--spacing, .25rem) * 10);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-line);grid-column:1 / -1}.body .loading span,.body .message span{overflow:hidden;text-overflow:ellipsis}.body .loading svg{height:calc(var(--spacing, .25rem) * 6);min-height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 6);min-width:calc(var(--spacing, .25rem) * 6);animation:var(--animate-spin, spin 1s linear infinite);transition-property:opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration, var(--default-transition-duration, .15s));transition-duration:var(--duration-short);transition-timing-function:var(--ease-standard)}.buttons{display:flex;border-top-style:var(--tw-border-style);border-top-width:1px;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;padding:var(--spacing, .25rem);border-color:var(--color-line)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@keyframes spin{to{transform:rotate(360deg)}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
|
|
5295
5471
|
}]
|
|
5296
5472
|
}],
|
|
5297
5473
|
ctorParameters: () => [],
|
|
@@ -8139,7 +8315,12 @@ var DataGridConfigsProvider = class DataGridConfigsProvider extends GridConfigsP
|
|
|
8139
8315
|
this._configs = {
|
|
8140
8316
|
...this._configs,
|
|
8141
8317
|
multiSelect: false,
|
|
8142
|
-
multiSelectSize: "min-content"
|
|
8318
|
+
multiSelectSize: "min-content",
|
|
8319
|
+
showTotalRows: false,
|
|
8320
|
+
totalRowsText: "{{ count }} records",
|
|
8321
|
+
totalRowText: "{{ count }} record",
|
|
8322
|
+
booleanTrueText: "Yes",
|
|
8323
|
+
booleanFalseText: "No"
|
|
8143
8324
|
};
|
|
8144
8325
|
}
|
|
8145
8326
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
@@ -8227,6 +8408,6 @@ var DateValidators = class {
|
|
|
8227
8408
|
};
|
|
8228
8409
|
}
|
|
8229
8410
|
};
|
|
8230
|
-
export { BadgeComponent, BaseComponent, BaseDataset, ButtonComponent, CalendarComponent, CatalogSelectComponent, CatalogService, DataGridComponent, DataGridConfigsProvider, DataGridDataset, DataGridRowComponent, DataProviderService, DateHelpers, DateInputComponent, DateValidators, DisplayControls, EnumTranslatePipe, FormGroupComponent, FormGroupService, FormInputComponent, FormInputGroupComponent, FormService, GridConfigsProvider, GridDataset, GroupAccordionComponent, GroupContainerComponent, GroupScrollSpyComponent, GuidHelper, LibraryModule, LocaleService, ModalComponent, MultiEditorComponent, MultiEditorDataset, MultiSelectComponent, MultiSelectResultDataset, MultiSelectResultGridComponent, NumberInputComponent, ReplaceManyPipe, ReplacePipe, RibbonButtonComponent, RibbonComponent, RibbonGroupChild, RibbonGroupComponent, RouterFormatter, SIDEBAR_CONFIGS, ScrollSpyDirective, SidebarComponent, SidebarConfigs, SidebarMenu, SidebarMenuOpenMode, SidebarService, SkeletonComponent, TooltipDirective, formatDateText, formatLocaleNumber, formatTimeText, getDatePattern, getFirstDayOfWeek, getNumberSeparators, isValidLocale, parseDateText, parseDigitsInfo, parseIsoValue, parseLocaleNumber, parseTimeText, toIsoDate, toIsoDateTime, toSidebarMenuOpenMode, uses12HourClock };
|
|
8411
|
+
export { BadgeComponent, BaseComponent, BaseDataset, ButtonComponent, CalendarComponent, CatalogSelectComponent, CatalogService, DataGridComponent, DataGridConfigsProvider, DataGridDataset, DataGridRowComponent, DataProviderService, DateHelpers, DateInputComponent, DateValidators, DisplayControls, EnumTranslatePipe, FormGroupComponent, FormGroupService, FormInputComponent, FormInputGroupComponent, FormService, GridConfigsProvider, GridDataset, GroupAccordionComponent, GroupContainerComponent, GroupScrollSpyComponent, GuidHelper, LibraryModule, LocaleService, ModalComponent, MultiEditorComponent, MultiEditorDataset, MultiSelectComponent, MultiSelectResultDataset, MultiSelectResultGridComponent, NumberInputComponent, ReplaceManyPipe, ReplacePipe, RibbonButtonComponent, RibbonComponent, RibbonGroupChild, RibbonGroupComponent, RouterFormatter, SIDEBAR_CONFIGS, ScrollSpyDirective, SidebarComponent, SidebarConfigs, SidebarMenu, SidebarMenuOpenMode, SidebarService, SkeletonComponent, TooltipDirective, formatDateText, formatGridCellValue, formatLocaleNumber, formatTimeText, getDatePattern, getFirstDayOfWeek, getGridColumnAlign, getNumberSeparators, isNumericGridColumn, isValidLocale, parseDateText, parseDigitsInfo, parseIsoValue, parseLocaleNumber, parseTimeText, toIsoDate, toIsoDateTime, toSidebarMenuOpenMode, uses12HourClock };
|
|
8231
8412
|
|
|
8232
8413
|
//# sourceMappingURL=zambon-dev-ui-library.mjs.map
|