@masterteam/components 0.0.170 → 0.0.172
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/assets/common.css +1 -1
- package/assets/i18n/ar.json +282 -278
- package/assets/i18n/en.json +282 -257
- package/fesm2022/masterteam-components-dynamic-drawer.mjs +21 -0
- package/fesm2022/masterteam-components-dynamic-drawer.mjs.map +1 -1
- package/fesm2022/masterteam-components-entities.mjs +115 -7
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-location-field.mjs +315 -0
- package/fesm2022/masterteam-components-location-field.mjs.map +1 -0
- package/fesm2022/masterteam-components-multi-select-field.mjs +2 -2
- package/fesm2022/masterteam-components-multi-select-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-radio-cards-field.mjs +7 -4
- package/fesm2022/masterteam-components-radio-cards-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-select-field.mjs +2 -2
- package/fesm2022/masterteam-components-select-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-sidebar.mjs +2 -2
- package/fesm2022/masterteam-components-sidebar.mjs.map +1 -1
- package/fesm2022/masterteam-components-table.mjs +30 -8
- package/fesm2022/masterteam-components-table.mjs.map +1 -1
- package/fesm2022/masterteam-components-tabs.mjs +31 -3
- package/fesm2022/masterteam-components-tabs.mjs.map +1 -1
- package/fesm2022/masterteam-components-tree.mjs +13 -0
- package/fesm2022/masterteam-components-tree.mjs.map +1 -1
- package/fesm2022/masterteam-components-upload-field.mjs +86 -5
- package/fesm2022/masterteam-components-upload-field.mjs.map +1 -1
- package/fesm2022/masterteam-components.mjs +12 -1
- package/fesm2022/masterteam-components.mjs.map +1 -1
- package/package.json +5 -1
- package/types/masterteam-components-dynamic-drawer.d.ts +3 -0
- package/types/masterteam-components-entities.d.ts +32 -5
- package/types/masterteam-components-location-field.d.ts +95 -0
- package/types/masterteam-components-radio-cards-field.d.ts +2 -1
- package/types/masterteam-components-tabs.d.ts +3 -0
- package/types/masterteam-components-tree.d.ts +4 -0
- package/types/masterteam-components-upload-field.d.ts +13 -0
- package/types/masterteam-components.d.ts +13 -3
|
@@ -31,8 +31,10 @@ class Tabs {
|
|
|
31
31
|
destroyRef = inject(DestroyRef);
|
|
32
32
|
tabsContainer = viewChild('tabsContainer', ...(ngDevMode ? [{ debugName: "tabsContainer" }] : /* istanbul ignore next */ []));
|
|
33
33
|
measureRow = viewChild('measureRow', ...(ngDevMode ? [{ debugName: "measureRow" }] : /* istanbul ignore next */ []));
|
|
34
|
+
morePopover = viewChild(Popover, ...(ngDevMode ? [{ debugName: "morePopover" }] : /* istanbul ignore next */ []));
|
|
34
35
|
resizeObserver;
|
|
35
36
|
measureHandle = 0;
|
|
37
|
+
alignHandle = 0;
|
|
36
38
|
visibleCount = signal(Number.MAX_SAFE_INTEGER, ...(ngDevMode ? [{ debugName: "visibleCount" }] : /* istanbul ignore next */ []));
|
|
37
39
|
visibleOptions = computed(() => this.options().slice(0, this.visibleCount()), ...(ngDevMode ? [{ debugName: "visibleOptions" }] : /* istanbul ignore next */ []));
|
|
38
40
|
overflowOptions = computed(() => this.options().slice(this.visibleCount()), ...(ngDevMode ? [{ debugName: "overflowOptions" }] : /* istanbul ignore next */ []));
|
|
@@ -77,6 +79,9 @@ class Tabs {
|
|
|
77
79
|
if (this.measureHandle) {
|
|
78
80
|
cancelAnimationFrame(this.measureHandle);
|
|
79
81
|
}
|
|
82
|
+
if (this.alignHandle) {
|
|
83
|
+
cancelAnimationFrame(this.alignHandle);
|
|
84
|
+
}
|
|
80
85
|
});
|
|
81
86
|
}
|
|
82
87
|
setupResizeObserver() {
|
|
@@ -146,6 +151,29 @@ class Tabs {
|
|
|
146
151
|
}
|
|
147
152
|
onOverflowSearch(value) {
|
|
148
153
|
this.searchTerm.set(value ?? '');
|
|
154
|
+
// Filtering shrinks/grows the popover content, but PrimeNG only positions
|
|
155
|
+
// the popover on show. Re-align after the filtered list re-renders so a
|
|
156
|
+
// popover opened above the trigger stays attached instead of overlapping.
|
|
157
|
+
this.scheduleOverflowAlign();
|
|
158
|
+
}
|
|
159
|
+
scheduleOverflowAlign() {
|
|
160
|
+
if (this.alignHandle) {
|
|
161
|
+
cancelAnimationFrame(this.alignHandle);
|
|
162
|
+
}
|
|
163
|
+
this.alignHandle = requestAnimationFrame(() => {
|
|
164
|
+
this.alignHandle = 0;
|
|
165
|
+
const popover = this.morePopover();
|
|
166
|
+
if (!popover?.overlayVisible)
|
|
167
|
+
return;
|
|
168
|
+
// Clear the stale flip marker so align() recomputes the arrow direction
|
|
169
|
+
// for the new height instead of keeping the previous "above" state.
|
|
170
|
+
const container = popover.container;
|
|
171
|
+
if (container) {
|
|
172
|
+
container.removeAttribute('data-p-popover-flipped');
|
|
173
|
+
container.classList.remove('p-popover-flipped');
|
|
174
|
+
}
|
|
175
|
+
popover.align();
|
|
176
|
+
});
|
|
149
177
|
}
|
|
150
178
|
onOverflowPopoverHide() {
|
|
151
179
|
this.searchTerm.set('');
|
|
@@ -202,7 +230,7 @@ class Tabs {
|
|
|
202
230
|
return this.resolveValue(option) ?? index;
|
|
203
231
|
}
|
|
204
232
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Tabs, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
205
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: Tabs, isStandalone: true, selector: "mt-tabs", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, moreLabel: { classPropertyName: "moreLabel", publicName: "moreLabel", isSignal: true, isRequired: false, transformFunction: null }, defaultIcon: { classPropertyName: "defaultIcon", publicName: "defaultIcon", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, searchThreshold: { classPropertyName: "searchThreshold", publicName: "searchThreshold", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { active: "activeChange", onChange: "onChange" }, host: { properties: { "class.w-full": "fluid()" }, classAttribute: "grid min-w-0 gap-1" }, viewQueries: [{ propertyName: "tabsContainer", first: true, predicate: ["tabsContainer"], descendants: true, isSignal: true }, { propertyName: "measureRow", first: true, predicate: ["measureRow"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (mode() === \"vertical\") {\r\n <div\r\n class=\"flex min-h-0 flex-col gap-1 rounded-2xl border border-surface-200 bg-white p-2\"\r\n role=\"tablist\"\r\n aria-orientation=\"vertical\"\r\n >\r\n @for (option of options(); track trackOption(option, $index)) {\r\n <button\r\n type=\"button\"\r\n role=\"tab\"\r\n class=\"group relative flex w-full items-center gap-3 overflow-hidden rounded-lg px-3 py-2.5 text-left text-sm transition-colors duration-150 outline-none focus-visible:ring-2 focus-visible:ring-primary/20\"\r\n [attr.aria-selected]=\"isActiveOption(option)\"\r\n [attr.tabindex]=\"isActiveOption(option) ? 0 : -1\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n [class.bg-primary-50]=\"isActiveOption(option)\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.text-primary-700]=\"isActiveOption(option)\"\r\n [class.text-surface-500]=\"!isActiveOption(option)\"\r\n [class.hover:bg-surface-50]=\"!isActiveOption(option)\"\r\n [class.cursor-not-allowed]=\"disabled() || isOptionDisabled(option)\"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option)\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon\r\n [icon]=\"icon\"\r\n class=\"relative z-10 text-base\"\r\n [class.text-primary]=\"isActiveOption(option)\"\r\n [class.text-surface-400]=\"!isActiveOption(option)\"\r\n />\r\n }\r\n\r\n <span class=\"relative z-10 min-w-0 flex-1 truncate\">\r\n {{ resolveLabel(option) }}\r\n </span>\r\n\r\n @if (hasBadge(option)) {\r\n <span\r\n class=\"relative z-10 ms-auto inline-flex min-w-5 items-center justify-center rounded-full px-2 py-0.5 text-[11px] font-bold leading-none\"\r\n [class.bg-primary]=\"isActiveOption(option)\"\r\n [class.text-white]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-600]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n} @else if (mode() === \"underline\") {\r\n <div\r\n #tabsContainer\r\n class=\"relative flex w-full min-w-0 max-w-full items-center gap-0.5 overflow-x-clip\"\r\n role=\"tablist\"\r\n aria-orientation=\"horizontal\"\r\n >\r\n <!-- Invisible measurement ghost row: always renders every option at natural width -->\r\n <div\r\n #measureRow\r\n aria-hidden=\"true\"\r\n class=\"pointer-events-none invisible absolute top-0 left-0 flex flex-nowrap gap-0.5 -z-10\"\r\n >\r\n @for (option of options(); track trackOption(option, $index)) {\r\n <span\r\n class=\"inline-flex items-center gap-1.5 border-b-2 border-transparent px-3.5 py-2.5 text-sm font-semibold whitespace-nowrap\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon [icon]=\"icon\" class=\"text-base\" />\r\n }\r\n <span>{{ resolveLabel(option) }}</span>\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n\r\n <!-- Visible tabs row -->\r\n <div\r\n class=\"flex min-w-0 flex-1 items-center gap-0.5 overflow-x-clip border-b border-surface-200\"\r\n >\r\n @for (option of visibleOptions(); track trackOption(option, $index)) {\r\n <button\r\n type=\"button\"\r\n role=\"tab\"\r\n class=\"-mb-px inline-flex shrink-0 items-center gap-1.5 border-b-2 px-3.5 py-2.5 text-sm whitespace-nowrap transition-colors duration-150 outline-none focus-visible:ring-2 focus-visible:ring-primary/20\"\r\n [attr.aria-selected]=\"isActiveOption(option)\"\r\n [attr.tabindex]=\"isActiveOption(option) ? 0 : -1\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n [class.border-primary]=\"isActiveOption(option)\"\r\n [class.text-primary]=\"isActiveOption(option)\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.border-transparent]=\"!isActiveOption(option)\"\r\n [class.text-surface-700]=\"!isActiveOption(option)\"\r\n [class.font-medium]=\"!isActiveOption(option)\"\r\n [class.hover:text-primary-600]=\"\r\n !isActiveOption(option) && !(disabled() || isOptionDisabled(option))\r\n \"\r\n [class.cursor-pointer]=\"!(disabled() || isOptionDisabled(option))\"\r\n [class.cursor-not-allowed]=\"disabled() || isOptionDisabled(option)\"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option)\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon [icon]=\"icon\" class=\"text-base\" />\r\n }\r\n\r\n <span class=\"truncate\">{{ resolveLabel(option) }}</span>\r\n\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n [class.bg-primary-50]=\"isActiveOption(option)\"\r\n [class.text-primary-700]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-500]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (hasOverflow()) {\r\n <div\r\n class=\"flex shrink-0 items-center -mb-px border-b border-surface-200 pb-1\"\r\n >\r\n <mt-button\r\n icon=\"arrow.chevron-down\"\r\n [label]=\"moreLabel()\"\r\n size=\"small\"\r\n severity=\"primary\"\r\n [text]=\"true\"\r\n [rounded]=\"true\"\r\n (onClick)=\"morePopover.toggle($event)\"\r\n />\r\n <p-popover\r\n #morePopover\r\n appendTo=\"body\"\r\n (onHide)=\"onOverflowPopoverHide()\"\r\n >\r\n <div class=\"flex min-w-56 flex-col\">\r\n @if (showOverflowSearch()) {\r\n <div class=\"border-b border-surface-200 p-2\">\r\n <p-iconfield iconPosition=\"left\">\r\n <p-inputicon>\r\n <mt-icon icon=\"general.search-md\" />\r\n </p-inputicon>\r\n <input\r\n pInputText\r\n type=\"text\"\r\n [value]=\"searchTerm()\"\r\n (input)=\"onOverflowSearch($any($event.target).value)\"\r\n [placeholder]=\"'components.tabs.search' | transloco\"\r\n class=\"w-full\"\r\n />\r\n </p-iconfield>\r\n </div>\r\n }\r\n <div\r\n class=\"flex max-h-80 flex-col divide-y divide-surface-100 overflow-y-auto\"\r\n >\r\n @for (\r\n option of filteredOverflowOptions();\r\n track trackOption(option, $index)\r\n ) {\r\n <button\r\n type=\"button\"\r\n class=\"flex w-full cursor-pointer items-center justify-start gap-2 px-2 py-1 text-start text-sm transition-colors [&_.p-avatar]:h-7 [&_.p-avatar]:w-7 [&_.p-avatar]:text-sm\"\r\n [class.bg-primary-50]=\"isActiveOption(option)\"\r\n [class.text-primary]=\"isActiveOption(option)\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.text-surface-700]=\"!isActiveOption(option)\"\r\n [class.hover:bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.cursor-not-allowed]=\"\r\n disabled() || isOptionDisabled(option)\r\n \"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option); morePopover.hide()\"\r\n >\r\n <mt-avatar\r\n [icon]=\"resolveIconOrDefault(option)\"\r\n size=\"normal\"\r\n shape=\"circle\"\r\n styleClass=\"!bg-surface-100 !text-surface-600\"\r\n />\r\n <span class=\"flex-1 truncate text-start\">\r\n {{ resolveLabel(option) }}\r\n </span>\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n [class.bg-primary-100]=\"isActiveOption(option)\"\r\n [class.text-primary-700]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-500]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n } @empty {\r\n <div class=\"px-3 py-4 text-center text-sm text-surface-500\">\r\n {{ \"components.tabs.no-results\" | transloco }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </p-popover>\r\n </div>\r\n }\r\n </div>\r\n} @else {\r\n <p-selectbutton\r\n [options]=\"options()\"\r\n [(ngModel)]=\"active\"\r\n (ngModelChange)=\"onTabChange($event)\"\r\n [optionLabel]=\"optionLabel()\"\r\n [optionValue]=\"optionValue()\"\r\n styleClass=\"my-tabs-button\"\r\n [size]=\"size()\"\r\n [fluid]=\"fluid()\"\r\n [disabled]=\"disabled()\"\r\n unselectable\r\n />\r\n}\r\n", styles: [":host{min-width:0}\n"], dependencies: [{ kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: SelectButton, selector: "p-selectButton, p-selectbutton, p-select-button", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "unselectable", "tabindex", "multiple", "allowEmpty", "styleClass", "ariaLabelledBy", "dataKey", "autofocus", "size", "fluid"], outputs: ["onOptionClick", "onChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "component", type: Avatar, selector: "mt-avatar", inputs: ["label", "icon", "image", "styleClass", "size", "shape", "badge", "badgeSize", "badgeSeverity"], outputs: ["onImageError"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i2.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: IconFieldModule }, { kind: "component", type: i3.IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["hostName", "iconPosition", "styleClass"] }, { kind: "ngmodule", type: InputIconModule }, { kind: "component", type: i4.InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["hostName", "styleClass"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }] });
|
|
233
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: Tabs, isStandalone: true, selector: "mt-tabs", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, moreLabel: { classPropertyName: "moreLabel", publicName: "moreLabel", isSignal: true, isRequired: false, transformFunction: null }, defaultIcon: { classPropertyName: "defaultIcon", publicName: "defaultIcon", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, searchThreshold: { classPropertyName: "searchThreshold", publicName: "searchThreshold", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { active: "activeChange", onChange: "onChange" }, host: { properties: { "class.w-full": "fluid()" }, classAttribute: "grid min-w-0 gap-1" }, viewQueries: [{ propertyName: "tabsContainer", first: true, predicate: ["tabsContainer"], descendants: true, isSignal: true }, { propertyName: "measureRow", first: true, predicate: ["measureRow"], descendants: true, isSignal: true }, { propertyName: "morePopover", first: true, predicate: Popover, descendants: true, isSignal: true }], ngImport: i0, template: "@if (mode() === \"vertical\") {\r\n <div\r\n class=\"flex min-h-0 flex-col gap-1 rounded-2xl border border-surface-200 bg-white p-2\"\r\n role=\"tablist\"\r\n aria-orientation=\"vertical\"\r\n >\r\n @for (option of options(); track trackOption(option, $index)) {\r\n <button\r\n type=\"button\"\r\n role=\"tab\"\r\n class=\"group relative flex w-full items-center gap-3 overflow-hidden rounded-lg px-3 py-2.5 text-left text-sm transition-colors duration-150 outline-none focus-visible:ring-2 focus-visible:ring-primary/20\"\r\n [attr.aria-selected]=\"isActiveOption(option)\"\r\n [attr.tabindex]=\"isActiveOption(option) ? 0 : -1\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n [class.bg-primary-50]=\"isActiveOption(option)\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.text-primary-700]=\"isActiveOption(option)\"\r\n [class.text-surface-500]=\"!isActiveOption(option)\"\r\n [class.hover:bg-surface-50]=\"!isActiveOption(option)\"\r\n [class.cursor-pointer]=\"!(disabled() || isOptionDisabled(option))\"\r\n [class.cursor-not-allowed]=\"disabled() || isOptionDisabled(option)\"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option)\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon\r\n [icon]=\"icon\"\r\n class=\"relative z-10 text-base\"\r\n [class.text-primary]=\"isActiveOption(option)\"\r\n [class.text-surface-400]=\"!isActiveOption(option)\"\r\n />\r\n }\r\n\r\n <span class=\"relative z-10 min-w-0 flex-1 truncate\">\r\n {{ resolveLabel(option) }}\r\n </span>\r\n\r\n @if (hasBadge(option)) {\r\n <span\r\n class=\"relative z-10 ms-auto inline-flex min-w-5 items-center justify-center rounded-full px-2 py-0.5 text-[11px] font-bold leading-none\"\r\n [class.bg-primary]=\"isActiveOption(option)\"\r\n [class.text-white]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-600]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n} @else if (mode() === \"underline\") {\r\n <div\r\n #tabsContainer\r\n class=\"relative flex w-full min-w-0 max-w-full items-center gap-0.5 overflow-x-clip\"\r\n role=\"tablist\"\r\n aria-orientation=\"horizontal\"\r\n >\r\n <!-- Invisible measurement ghost row: always renders every option at natural width -->\r\n <div\r\n #measureRow\r\n aria-hidden=\"true\"\r\n class=\"pointer-events-none invisible absolute top-0 left-0 flex flex-nowrap gap-0.5 -z-10\"\r\n >\r\n @for (option of options(); track trackOption(option, $index)) {\r\n <span\r\n class=\"inline-flex items-center gap-1.5 border-b-2 border-transparent px-3.5 py-2.5 text-sm font-semibold whitespace-nowrap\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon [icon]=\"icon\" class=\"text-base\" />\r\n }\r\n <span>{{ resolveLabel(option) }}</span>\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n\r\n <!-- Visible tabs row -->\r\n <div\r\n class=\"flex min-w-0 flex-1 items-center gap-0.5 overflow-x-clip border-b border-surface-200\"\r\n >\r\n @for (option of visibleOptions(); track trackOption(option, $index)) {\r\n <button\r\n type=\"button\"\r\n role=\"tab\"\r\n class=\"-mb-px inline-flex shrink-0 items-center gap-1.5 border-b-2 px-3.5 py-2.5 text-sm whitespace-nowrap transition-colors duration-150 outline-none focus-visible:ring-2 focus-visible:ring-primary/20\"\r\n [attr.aria-selected]=\"isActiveOption(option)\"\r\n [attr.tabindex]=\"isActiveOption(option) ? 0 : -1\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n [class.border-primary]=\"isActiveOption(option)\"\r\n [class.text-primary]=\"isActiveOption(option)\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.border-transparent]=\"!isActiveOption(option)\"\r\n [class.text-surface-700]=\"!isActiveOption(option)\"\r\n [class.font-medium]=\"!isActiveOption(option)\"\r\n [class.hover:text-primary-600]=\"\r\n !isActiveOption(option) && !(disabled() || isOptionDisabled(option))\r\n \"\r\n [class.cursor-pointer]=\"!(disabled() || isOptionDisabled(option))\"\r\n [class.cursor-not-allowed]=\"disabled() || isOptionDisabled(option)\"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option)\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon [icon]=\"icon\" class=\"text-base\" />\r\n }\r\n\r\n <span class=\"truncate\">{{ resolveLabel(option) }}</span>\r\n\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n [class.bg-primary-50]=\"isActiveOption(option)\"\r\n [class.text-primary-700]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-500]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (hasOverflow()) {\r\n <div\r\n class=\"flex shrink-0 items-center -mb-px border-b border-surface-200 pb-1\"\r\n >\r\n <mt-button\r\n icon=\"arrow.chevron-down\"\r\n [label]=\"moreLabel()\"\r\n size=\"small\"\r\n severity=\"primary\"\r\n [text]=\"true\"\r\n [rounded]=\"true\"\r\n (onClick)=\"morePopover.toggle($event)\"\r\n />\r\n <p-popover\r\n #morePopover\r\n appendTo=\"body\"\r\n (onHide)=\"onOverflowPopoverHide()\"\r\n >\r\n <div class=\"flex min-w-56 flex-col\">\r\n @if (showOverflowSearch()) {\r\n <div class=\"border-b border-surface-200 p-2\">\r\n <p-iconfield iconPosition=\"left\">\r\n <p-inputicon>\r\n <mt-icon icon=\"general.search-md\" />\r\n </p-inputicon>\r\n <input\r\n pInputText\r\n type=\"text\"\r\n [value]=\"searchTerm()\"\r\n (input)=\"onOverflowSearch($any($event.target).value)\"\r\n [placeholder]=\"'components.tabs.search' | transloco\"\r\n class=\"w-full\"\r\n />\r\n </p-iconfield>\r\n </div>\r\n }\r\n <div\r\n class=\"flex max-h-80 flex-col divide-y divide-surface-100 overflow-y-auto\"\r\n >\r\n @for (\r\n option of filteredOverflowOptions();\r\n track trackOption(option, $index)\r\n ) {\r\n <button\r\n type=\"button\"\r\n class=\"flex w-full cursor-pointer items-center justify-start gap-2 px-2 py-1 text-start text-sm transition-colors [&_.p-avatar]:h-7 [&_.p-avatar]:w-7 [&_.p-avatar]:text-sm\"\r\n [class.bg-primary-50]=\"isActiveOption(option)\"\r\n [class.text-primary]=\"isActiveOption(option)\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.text-surface-700]=\"!isActiveOption(option)\"\r\n [class.hover:bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.cursor-not-allowed]=\"\r\n disabled() || isOptionDisabled(option)\r\n \"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option); morePopover.hide()\"\r\n >\r\n <mt-avatar\r\n [icon]=\"resolveIconOrDefault(option)\"\r\n size=\"normal\"\r\n shape=\"circle\"\r\n styleClass=\"!bg-surface-100 !text-surface-600\"\r\n />\r\n <span class=\"flex-1 truncate text-start\">\r\n {{ resolveLabel(option) }}\r\n </span>\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n [class.bg-primary-100]=\"isActiveOption(option)\"\r\n [class.text-primary-700]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-500]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n } @empty {\r\n <div class=\"px-3 py-4 text-center text-sm text-surface-500\">\r\n {{ \"components.tabs.no-results\" | transloco }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </p-popover>\r\n </div>\r\n }\r\n </div>\r\n} @else {\r\n <p-selectbutton\r\n [options]=\"options()\"\r\n [(ngModel)]=\"active\"\r\n (ngModelChange)=\"onTabChange($event)\"\r\n [optionLabel]=\"optionLabel()\"\r\n [optionValue]=\"optionValue()\"\r\n styleClass=\"my-tabs-button\"\r\n [size]=\"size()\"\r\n [fluid]=\"fluid()\"\r\n [disabled]=\"disabled()\"\r\n unselectable\r\n />\r\n}\r\n", styles: [":host{min-width:0}\n"], dependencies: [{ kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: SelectButton, selector: "p-selectButton, p-selectbutton, p-select-button", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "unselectable", "tabindex", "multiple", "allowEmpty", "styleClass", "ariaLabelledBy", "dataKey", "autofocus", "size", "fluid"], outputs: ["onOptionClick", "onChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "component", type: Avatar, selector: "mt-avatar", inputs: ["label", "icon", "image", "styleClass", "size", "shape", "badge", "badgeSize", "badgeSeverity"], outputs: ["onImageError"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i2.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: IconFieldModule }, { kind: "component", type: i3.IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["hostName", "iconPosition", "styleClass"] }, { kind: "ngmodule", type: InputIconModule }, { kind: "component", type: i4.InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["hostName", "styleClass"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }] });
|
|
206
234
|
}
|
|
207
235
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Tabs, decorators: [{
|
|
208
236
|
type: Component,
|
|
@@ -220,8 +248,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
220
248
|
], host: {
|
|
221
249
|
class: 'grid min-w-0 gap-1',
|
|
222
250
|
'[class.w-full]': 'fluid()',
|
|
223
|
-
}, template: "@if (mode() === \"vertical\") {\r\n <div\r\n class=\"flex min-h-0 flex-col gap-1 rounded-2xl border border-surface-200 bg-white p-2\"\r\n role=\"tablist\"\r\n aria-orientation=\"vertical\"\r\n >\r\n @for (option of options(); track trackOption(option, $index)) {\r\n <button\r\n type=\"button\"\r\n role=\"tab\"\r\n class=\"group relative flex w-full items-center gap-3 overflow-hidden rounded-lg px-3 py-2.5 text-left text-sm transition-colors duration-150 outline-none focus-visible:ring-2 focus-visible:ring-primary/20\"\r\n [attr.aria-selected]=\"isActiveOption(option)\"\r\n [attr.tabindex]=\"isActiveOption(option) ? 0 : -1\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n [class.bg-primary-50]=\"isActiveOption(option)\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.text-primary-700]=\"isActiveOption(option)\"\r\n [class.text-surface-500]=\"!isActiveOption(option)\"\r\n [class.hover:bg-surface-50]=\"!isActiveOption(option)\"\r\n [class.cursor-not-allowed]=\"disabled() || isOptionDisabled(option)\"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option)\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon\r\n [icon]=\"icon\"\r\n class=\"relative z-10 text-base\"\r\n [class.text-primary]=\"isActiveOption(option)\"\r\n [class.text-surface-400]=\"!isActiveOption(option)\"\r\n />\r\n }\r\n\r\n <span class=\"relative z-10 min-w-0 flex-1 truncate\">\r\n {{ resolveLabel(option) }}\r\n </span>\r\n\r\n @if (hasBadge(option)) {\r\n <span\r\n class=\"relative z-10 ms-auto inline-flex min-w-5 items-center justify-center rounded-full px-2 py-0.5 text-[11px] font-bold leading-none\"\r\n [class.bg-primary]=\"isActiveOption(option)\"\r\n [class.text-white]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-600]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n} @else if (mode() === \"underline\") {\r\n <div\r\n #tabsContainer\r\n class=\"relative flex w-full min-w-0 max-w-full items-center gap-0.5 overflow-x-clip\"\r\n role=\"tablist\"\r\n aria-orientation=\"horizontal\"\r\n >\r\n <!-- Invisible measurement ghost row: always renders every option at natural width -->\r\n <div\r\n #measureRow\r\n aria-hidden=\"true\"\r\n class=\"pointer-events-none invisible absolute top-0 left-0 flex flex-nowrap gap-0.5 -z-10\"\r\n >\r\n @for (option of options(); track trackOption(option, $index)) {\r\n <span\r\n class=\"inline-flex items-center gap-1.5 border-b-2 border-transparent px-3.5 py-2.5 text-sm font-semibold whitespace-nowrap\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon [icon]=\"icon\" class=\"text-base\" />\r\n }\r\n <span>{{ resolveLabel(option) }}</span>\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n\r\n <!-- Visible tabs row -->\r\n <div\r\n class=\"flex min-w-0 flex-1 items-center gap-0.5 overflow-x-clip border-b border-surface-200\"\r\n >\r\n @for (option of visibleOptions(); track trackOption(option, $index)) {\r\n <button\r\n type=\"button\"\r\n role=\"tab\"\r\n class=\"-mb-px inline-flex shrink-0 items-center gap-1.5 border-b-2 px-3.5 py-2.5 text-sm whitespace-nowrap transition-colors duration-150 outline-none focus-visible:ring-2 focus-visible:ring-primary/20\"\r\n [attr.aria-selected]=\"isActiveOption(option)\"\r\n [attr.tabindex]=\"isActiveOption(option) ? 0 : -1\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n [class.border-primary]=\"isActiveOption(option)\"\r\n [class.text-primary]=\"isActiveOption(option)\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.border-transparent]=\"!isActiveOption(option)\"\r\n [class.text-surface-700]=\"!isActiveOption(option)\"\r\n [class.font-medium]=\"!isActiveOption(option)\"\r\n [class.hover:text-primary-600]=\"\r\n !isActiveOption(option) && !(disabled() || isOptionDisabled(option))\r\n \"\r\n [class.cursor-pointer]=\"!(disabled() || isOptionDisabled(option))\"\r\n [class.cursor-not-allowed]=\"disabled() || isOptionDisabled(option)\"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option)\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon [icon]=\"icon\" class=\"text-base\" />\r\n }\r\n\r\n <span class=\"truncate\">{{ resolveLabel(option) }}</span>\r\n\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n [class.bg-primary-50]=\"isActiveOption(option)\"\r\n [class.text-primary-700]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-500]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (hasOverflow()) {\r\n <div\r\n class=\"flex shrink-0 items-center -mb-px border-b border-surface-200 pb-1\"\r\n >\r\n <mt-button\r\n icon=\"arrow.chevron-down\"\r\n [label]=\"moreLabel()\"\r\n size=\"small\"\r\n severity=\"primary\"\r\n [text]=\"true\"\r\n [rounded]=\"true\"\r\n (onClick)=\"morePopover.toggle($event)\"\r\n />\r\n <p-popover\r\n #morePopover\r\n appendTo=\"body\"\r\n (onHide)=\"onOverflowPopoverHide()\"\r\n >\r\n <div class=\"flex min-w-56 flex-col\">\r\n @if (showOverflowSearch()) {\r\n <div class=\"border-b border-surface-200 p-2\">\r\n <p-iconfield iconPosition=\"left\">\r\n <p-inputicon>\r\n <mt-icon icon=\"general.search-md\" />\r\n </p-inputicon>\r\n <input\r\n pInputText\r\n type=\"text\"\r\n [value]=\"searchTerm()\"\r\n (input)=\"onOverflowSearch($any($event.target).value)\"\r\n [placeholder]=\"'components.tabs.search' | transloco\"\r\n class=\"w-full\"\r\n />\r\n </p-iconfield>\r\n </div>\r\n }\r\n <div\r\n class=\"flex max-h-80 flex-col divide-y divide-surface-100 overflow-y-auto\"\r\n >\r\n @for (\r\n option of filteredOverflowOptions();\r\n track trackOption(option, $index)\r\n ) {\r\n <button\r\n type=\"button\"\r\n class=\"flex w-full cursor-pointer items-center justify-start gap-2 px-2 py-1 text-start text-sm transition-colors [&_.p-avatar]:h-7 [&_.p-avatar]:w-7 [&_.p-avatar]:text-sm\"\r\n [class.bg-primary-50]=\"isActiveOption(option)\"\r\n [class.text-primary]=\"isActiveOption(option)\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.text-surface-700]=\"!isActiveOption(option)\"\r\n [class.hover:bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.cursor-not-allowed]=\"\r\n disabled() || isOptionDisabled(option)\r\n \"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option); morePopover.hide()\"\r\n >\r\n <mt-avatar\r\n [icon]=\"resolveIconOrDefault(option)\"\r\n size=\"normal\"\r\n shape=\"circle\"\r\n styleClass=\"!bg-surface-100 !text-surface-600\"\r\n />\r\n <span class=\"flex-1 truncate text-start\">\r\n {{ resolveLabel(option) }}\r\n </span>\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n [class.bg-primary-100]=\"isActiveOption(option)\"\r\n [class.text-primary-700]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-500]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n } @empty {\r\n <div class=\"px-3 py-4 text-center text-sm text-surface-500\">\r\n {{ \"components.tabs.no-results\" | transloco }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </p-popover>\r\n </div>\r\n }\r\n </div>\r\n} @else {\r\n <p-selectbutton\r\n [options]=\"options()\"\r\n [(ngModel)]=\"active\"\r\n (ngModelChange)=\"onTabChange($event)\"\r\n [optionLabel]=\"optionLabel()\"\r\n [optionValue]=\"optionValue()\"\r\n styleClass=\"my-tabs-button\"\r\n [size]=\"size()\"\r\n [fluid]=\"fluid()\"\r\n [disabled]=\"disabled()\"\r\n unselectable\r\n />\r\n}\r\n", styles: [":host{min-width:0}\n"] }]
|
|
224
|
-
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: false }] }, { type: i0.Output, args: ["activeChange"] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], moreLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "moreLabel", required: false }] }], defaultIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultIcon", required: false }] }], onChange: [{ type: i0.Output, args: ["onChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], tabsContainer: [{ type: i0.ViewChild, args: ['tabsContainer', { isSignal: true }] }], measureRow: [{ type: i0.ViewChild, args: ['measureRow', { isSignal: true }] }], searchThreshold: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchThreshold", required: false }] }] } });
|
|
251
|
+
}, template: "@if (mode() === \"vertical\") {\r\n <div\r\n class=\"flex min-h-0 flex-col gap-1 rounded-2xl border border-surface-200 bg-white p-2\"\r\n role=\"tablist\"\r\n aria-orientation=\"vertical\"\r\n >\r\n @for (option of options(); track trackOption(option, $index)) {\r\n <button\r\n type=\"button\"\r\n role=\"tab\"\r\n class=\"group relative flex w-full items-center gap-3 overflow-hidden rounded-lg px-3 py-2.5 text-left text-sm transition-colors duration-150 outline-none focus-visible:ring-2 focus-visible:ring-primary/20\"\r\n [attr.aria-selected]=\"isActiveOption(option)\"\r\n [attr.tabindex]=\"isActiveOption(option) ? 0 : -1\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n [class.bg-primary-50]=\"isActiveOption(option)\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.text-primary-700]=\"isActiveOption(option)\"\r\n [class.text-surface-500]=\"!isActiveOption(option)\"\r\n [class.hover:bg-surface-50]=\"!isActiveOption(option)\"\r\n [class.cursor-pointer]=\"!(disabled() || isOptionDisabled(option))\"\r\n [class.cursor-not-allowed]=\"disabled() || isOptionDisabled(option)\"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option)\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon\r\n [icon]=\"icon\"\r\n class=\"relative z-10 text-base\"\r\n [class.text-primary]=\"isActiveOption(option)\"\r\n [class.text-surface-400]=\"!isActiveOption(option)\"\r\n />\r\n }\r\n\r\n <span class=\"relative z-10 min-w-0 flex-1 truncate\">\r\n {{ resolveLabel(option) }}\r\n </span>\r\n\r\n @if (hasBadge(option)) {\r\n <span\r\n class=\"relative z-10 ms-auto inline-flex min-w-5 items-center justify-center rounded-full px-2 py-0.5 text-[11px] font-bold leading-none\"\r\n [class.bg-primary]=\"isActiveOption(option)\"\r\n [class.text-white]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-600]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n} @else if (mode() === \"underline\") {\r\n <div\r\n #tabsContainer\r\n class=\"relative flex w-full min-w-0 max-w-full items-center gap-0.5 overflow-x-clip\"\r\n role=\"tablist\"\r\n aria-orientation=\"horizontal\"\r\n >\r\n <!-- Invisible measurement ghost row: always renders every option at natural width -->\r\n <div\r\n #measureRow\r\n aria-hidden=\"true\"\r\n class=\"pointer-events-none invisible absolute top-0 left-0 flex flex-nowrap gap-0.5 -z-10\"\r\n >\r\n @for (option of options(); track trackOption(option, $index)) {\r\n <span\r\n class=\"inline-flex items-center gap-1.5 border-b-2 border-transparent px-3.5 py-2.5 text-sm font-semibold whitespace-nowrap\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon [icon]=\"icon\" class=\"text-base\" />\r\n }\r\n <span>{{ resolveLabel(option) }}</span>\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n\r\n <!-- Visible tabs row -->\r\n <div\r\n class=\"flex min-w-0 flex-1 items-center gap-0.5 overflow-x-clip border-b border-surface-200\"\r\n >\r\n @for (option of visibleOptions(); track trackOption(option, $index)) {\r\n <button\r\n type=\"button\"\r\n role=\"tab\"\r\n class=\"-mb-px inline-flex shrink-0 items-center gap-1.5 border-b-2 px-3.5 py-2.5 text-sm whitespace-nowrap transition-colors duration-150 outline-none focus-visible:ring-2 focus-visible:ring-primary/20\"\r\n [attr.aria-selected]=\"isActiveOption(option)\"\r\n [attr.tabindex]=\"isActiveOption(option) ? 0 : -1\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n [class.border-primary]=\"isActiveOption(option)\"\r\n [class.text-primary]=\"isActiveOption(option)\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.border-transparent]=\"!isActiveOption(option)\"\r\n [class.text-surface-700]=\"!isActiveOption(option)\"\r\n [class.font-medium]=\"!isActiveOption(option)\"\r\n [class.hover:text-primary-600]=\"\r\n !isActiveOption(option) && !(disabled() || isOptionDisabled(option))\r\n \"\r\n [class.cursor-pointer]=\"!(disabled() || isOptionDisabled(option))\"\r\n [class.cursor-not-allowed]=\"disabled() || isOptionDisabled(option)\"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option)\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon [icon]=\"icon\" class=\"text-base\" />\r\n }\r\n\r\n <span class=\"truncate\">{{ resolveLabel(option) }}</span>\r\n\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n [class.bg-primary-50]=\"isActiveOption(option)\"\r\n [class.text-primary-700]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-500]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (hasOverflow()) {\r\n <div\r\n class=\"flex shrink-0 items-center -mb-px border-b border-surface-200 pb-1\"\r\n >\r\n <mt-button\r\n icon=\"arrow.chevron-down\"\r\n [label]=\"moreLabel()\"\r\n size=\"small\"\r\n severity=\"primary\"\r\n [text]=\"true\"\r\n [rounded]=\"true\"\r\n (onClick)=\"morePopover.toggle($event)\"\r\n />\r\n <p-popover\r\n #morePopover\r\n appendTo=\"body\"\r\n (onHide)=\"onOverflowPopoverHide()\"\r\n >\r\n <div class=\"flex min-w-56 flex-col\">\r\n @if (showOverflowSearch()) {\r\n <div class=\"border-b border-surface-200 p-2\">\r\n <p-iconfield iconPosition=\"left\">\r\n <p-inputicon>\r\n <mt-icon icon=\"general.search-md\" />\r\n </p-inputicon>\r\n <input\r\n pInputText\r\n type=\"text\"\r\n [value]=\"searchTerm()\"\r\n (input)=\"onOverflowSearch($any($event.target).value)\"\r\n [placeholder]=\"'components.tabs.search' | transloco\"\r\n class=\"w-full\"\r\n />\r\n </p-iconfield>\r\n </div>\r\n }\r\n <div\r\n class=\"flex max-h-80 flex-col divide-y divide-surface-100 overflow-y-auto\"\r\n >\r\n @for (\r\n option of filteredOverflowOptions();\r\n track trackOption(option, $index)\r\n ) {\r\n <button\r\n type=\"button\"\r\n class=\"flex w-full cursor-pointer items-center justify-start gap-2 px-2 py-1 text-start text-sm transition-colors [&_.p-avatar]:h-7 [&_.p-avatar]:w-7 [&_.p-avatar]:text-sm\"\r\n [class.bg-primary-50]=\"isActiveOption(option)\"\r\n [class.text-primary]=\"isActiveOption(option)\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.text-surface-700]=\"!isActiveOption(option)\"\r\n [class.hover:bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.cursor-not-allowed]=\"\r\n disabled() || isOptionDisabled(option)\r\n \"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option); morePopover.hide()\"\r\n >\r\n <mt-avatar\r\n [icon]=\"resolveIconOrDefault(option)\"\r\n size=\"normal\"\r\n shape=\"circle\"\r\n styleClass=\"!bg-surface-100 !text-surface-600\"\r\n />\r\n <span class=\"flex-1 truncate text-start\">\r\n {{ resolveLabel(option) }}\r\n </span>\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n [class.bg-primary-100]=\"isActiveOption(option)\"\r\n [class.text-primary-700]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-500]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n } @empty {\r\n <div class=\"px-3 py-4 text-center text-sm text-surface-500\">\r\n {{ \"components.tabs.no-results\" | transloco }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </p-popover>\r\n </div>\r\n }\r\n </div>\r\n} @else {\r\n <p-selectbutton\r\n [options]=\"options()\"\r\n [(ngModel)]=\"active\"\r\n (ngModelChange)=\"onTabChange($event)\"\r\n [optionLabel]=\"optionLabel()\"\r\n [optionValue]=\"optionValue()\"\r\n styleClass=\"my-tabs-button\"\r\n [size]=\"size()\"\r\n [fluid]=\"fluid()\"\r\n [disabled]=\"disabled()\"\r\n unselectable\r\n />\r\n}\r\n", styles: [":host{min-width:0}\n"] }]
|
|
252
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: false }] }, { type: i0.Output, args: ["activeChange"] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], moreLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "moreLabel", required: false }] }], defaultIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultIcon", required: false }] }], onChange: [{ type: i0.Output, args: ["onChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], tabsContainer: [{ type: i0.ViewChild, args: ['tabsContainer', { isSignal: true }] }], measureRow: [{ type: i0.ViewChild, args: ['measureRow', { isSignal: true }] }], morePopover: [{ type: i0.ViewChild, args: [i0.forwardRef(() => Popover), { isSignal: true }] }], searchThreshold: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchThreshold", required: false }] }] } });
|
|
225
253
|
|
|
226
254
|
/**
|
|
227
255
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masterteam-components-tabs.mjs","sources":["../../../../packages/masterteam/components/tabs/tabs.ts","../../../../packages/masterteam/components/tabs/tabs.html","../../../../packages/masterteam/components/tabs/masterteam-components-tabs.ts"],"sourcesContent":["import {\r\n afterNextRender,\r\n booleanAttribute,\r\n Component,\r\n computed,\r\n DestroyRef,\r\n effect,\r\n ElementRef,\r\n inject,\r\n input,\r\n model,\r\n output,\r\n signal,\r\n viewChild,\r\n} from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { TranslocoPipe, TranslocoService } from '@jsverse/transloco';\r\nimport { MTIcon, Icon } from '@masterteam/icons';\r\nimport { SelectButton } from 'primeng/selectbutton';\r\nimport { Popover } from 'primeng/popover';\r\nimport { InputTextModule } from 'primeng/inputtext';\r\nimport { IconFieldModule } from 'primeng/iconfield';\r\nimport { InputIconModule } from 'primeng/inputicon';\r\nimport { Button } from '@masterteam/components/button';\r\nimport { Avatar } from '@masterteam/components/avatar';\r\n\r\nexport interface OptionItem {\r\n label?: string;\r\n value?: any;\r\n icon?: MTIcon | null;\r\n badge?: number | string | null;\r\n disabled?: boolean;\r\n [key: string]: unknown;\r\n}\r\n\r\n@Component({\r\n selector: 'mt-tabs',\r\n standalone: true,\r\n imports: [\r\n Icon,\r\n SelectButton,\r\n FormsModule,\r\n Button,\r\n Popover,\r\n Avatar,\r\n InputTextModule,\r\n IconFieldModule,\r\n InputIconModule,\r\n TranslocoPipe,\r\n ],\r\n templateUrl: './tabs.html',\r\n styleUrls: ['./tabs.scss'],\r\n host: {\r\n class: 'grid min-w-0 gap-1',\r\n '[class.w-full]': 'fluid()',\r\n },\r\n})\r\nexport class Tabs {\r\n private readonly transloco = inject(TranslocoService);\r\n options = input<OptionItem[]>([]);\r\n optionLabel = input<string>('label');\r\n optionValue = input<string>('value');\r\n active = model<any>(null);\r\n readonly mode = input<'horizontal' | 'vertical' | 'underline'>('horizontal');\r\n readonly moreLabel = input<string>(\r\n this.transloco.translate('components.tabs.more'),\r\n );\r\n readonly defaultIcon = input<MTIcon>('layout.align-left-02');\r\n\r\n onChange = output<any>();\r\n\r\n readonly size = input<'small' | 'large' | undefined>();\r\n readonly fluid = input<boolean, unknown>(false, {\r\n transform: booleanAttribute,\r\n });\r\n disabled = input<boolean, unknown>(false, {\r\n transform: booleanAttribute,\r\n });\r\n\r\n private readonly destroyRef = inject(DestroyRef);\r\n private readonly tabsContainer =\r\n viewChild<ElementRef<HTMLElement>>('tabsContainer');\r\n private readonly measureRow =\r\n viewChild<ElementRef<HTMLElement>>('measureRow');\r\n private resizeObserver?: ResizeObserver;\r\n private measureHandle = 0;\r\n\r\n readonly visibleCount = signal<number>(Number.MAX_SAFE_INTEGER);\r\n readonly visibleOptions = computed(() =>\r\n this.options().slice(0, this.visibleCount()),\r\n );\r\n readonly overflowOptions = computed(() =>\r\n this.options().slice(this.visibleCount()),\r\n );\r\n readonly hasOverflow = computed(() => this.overflowOptions().length > 0);\r\n readonly isActiveInOverflow = computed(() =>\r\n this.overflowOptions().some((option) => this.isActiveOption(option)),\r\n );\r\n\r\n readonly searchThreshold = input<number>(8);\r\n readonly searchTerm = signal<string>('');\r\n readonly showOverflowSearch = computed(\r\n () => this.overflowOptions().length >= this.searchThreshold(),\r\n );\r\n readonly filteredOverflowOptions = computed(() => {\r\n const term = this.searchTerm().trim().toLowerCase();\r\n if (!term) return this.overflowOptions();\r\n return this.overflowOptions().filter((option) =>\r\n this.resolveLabel(option).toLowerCase().includes(term),\r\n );\r\n });\r\n\r\n constructor() {\r\n effect(() => {\r\n const options = this.options();\r\n const active = this.active();\r\n if (!options.length) {\r\n return;\r\n }\r\n\r\n const hasActiveOption = options.some((option) =>\r\n Object.is(this.resolveValue(option), active),\r\n );\r\n if (!hasActiveOption) {\r\n this.active.set(this.resolveValue(options[0]));\r\n }\r\n });\r\n\r\n afterNextRender(() => {\r\n if (this.mode() !== 'underline') return;\r\n this.setupResizeObserver();\r\n this.scheduleMeasure();\r\n });\r\n\r\n effect(() => {\r\n // Re-measure when options or mode change.\r\n this.options();\r\n if (this.mode() !== 'underline') return;\r\n this.scheduleMeasure();\r\n });\r\n\r\n this.destroyRef.onDestroy(() => {\r\n this.resizeObserver?.disconnect();\r\n if (this.measureHandle) {\r\n cancelAnimationFrame(this.measureHandle);\r\n }\r\n });\r\n }\r\n\r\n private setupResizeObserver(): void {\r\n const container = this.tabsContainer()?.nativeElement;\r\n if (!container || typeof ResizeObserver === 'undefined') return;\r\n\r\n this.resizeObserver = new ResizeObserver(() => this.scheduleMeasure());\r\n this.resizeObserver.observe(container);\r\n }\r\n\r\n private scheduleMeasure(): void {\r\n if (this.measureHandle) {\r\n cancelAnimationFrame(this.measureHandle);\r\n }\r\n this.measureHandle = requestAnimationFrame(() => {\r\n this.measureHandle = 0;\r\n this.measureAndUpdate();\r\n });\r\n }\r\n\r\n private measureAndUpdate(): void {\r\n const container = this.tabsContainer()?.nativeElement;\r\n const measureRow = this.measureRow()?.nativeElement;\r\n if (!container || !measureRow) return;\r\n\r\n const optionsCount = this.options().length;\r\n if (optionsCount === 0) {\r\n this.visibleCount.set(0);\r\n return;\r\n }\r\n\r\n if (container.clientWidth === 0) return;\r\n\r\n // Inner width excludes the container's horizontal padding so we compare\r\n // against the actual space available to the flex tabs row.\r\n const style = getComputedStyle(container);\r\n const paddingX =\r\n (parseFloat(style.paddingLeft) || 0) +\r\n (parseFloat(style.paddingRight) || 0);\r\n const innerWidth = container.clientWidth - paddingX;\r\n if (innerWidth <= 0) return;\r\n\r\n const tabWidths = Array.from(measureRow.children).map(\r\n (el) => (el as HTMLElement).getBoundingClientRect().width,\r\n );\r\n\r\n if (tabWidths.length === 0) return;\r\n\r\n // Approximate gap-0.5 between tabs (2px).\r\n const gap = 2;\r\n const totalWidth =\r\n tabWidths.reduce((sum, width) => sum + width, 0) +\r\n Math.max(0, tabWidths.length - 1) * gap;\r\n\r\n // Everything fits — no more button needed.\r\n if (totalWidth <= innerWidth) {\r\n this.visibleCount.set(tabWidths.length);\r\n return;\r\n }\r\n\r\n // Reserve space for the More button (icon + label ~ 88px).\r\n const moreButtonReserve = 96;\r\n const available = innerWidth - moreButtonReserve;\r\n\r\n let cumulative = 0;\r\n let visibleCount = 0;\r\n for (let i = 0; i < tabWidths.length; i++) {\r\n const next = cumulative + tabWidths[i] + (i > 0 ? gap : 0);\r\n if (next > available) break;\r\n cumulative = next;\r\n visibleCount++;\r\n }\r\n\r\n this.visibleCount.set(Math.max(1, visibleCount));\r\n }\r\n\r\n onTabChange(value: any) {\r\n this.onChange.emit(value);\r\n }\r\n\r\n onOverflowSearch(value: string): void {\r\n this.searchTerm.set(value ?? '');\r\n }\r\n\r\n onOverflowPopoverHide(): void {\r\n this.searchTerm.set('');\r\n }\r\n\r\n onOptionSelect(option: OptionItem): void {\r\n if (this.disabled() || this.isOptionDisabled(option)) {\r\n return;\r\n }\r\n\r\n const value = this.resolveValue(option);\r\n this.active.set(value);\r\n this.onTabChange(value);\r\n }\r\n\r\n resolveLabel(option: OptionItem): string {\r\n const labelKey = this.optionLabel();\r\n const label =\r\n option && typeof option === 'object'\r\n ? (option as Record<string, unknown>)[labelKey]\r\n : option;\r\n\r\n return typeof label === 'string' ? label : String(label ?? '');\r\n }\r\n\r\n resolveValue(option: OptionItem): unknown {\r\n const valueKey = this.optionValue();\r\n if (option && typeof option === 'object' && valueKey in option) {\r\n return (option as Record<string, unknown>)[valueKey];\r\n }\r\n\r\n return option;\r\n }\r\n\r\n resolveIcon(option: OptionItem): MTIcon | null {\r\n return typeof option?.icon === 'string' ? option.icon : null;\r\n }\r\n\r\n resolveIconOrDefault(option: OptionItem): MTIcon {\r\n return this.resolveIcon(option) ?? this.defaultIcon();\r\n }\r\n\r\n resolveBadge(option: OptionItem): number | string | null {\r\n return option?.badge ?? null;\r\n }\r\n\r\n hasBadge(option: OptionItem): boolean {\r\n return option?.badge !== null && option?.badge !== undefined;\r\n }\r\n\r\n hasCountBadge(option: OptionItem): boolean {\r\n const badge = option?.badge;\r\n if (badge === null || badge === undefined || badge === '') {\r\n return false;\r\n }\r\n const numeric = typeof badge === 'number' ? badge : Number(badge);\r\n return Number.isNaN(numeric) ? true : numeric > 0;\r\n }\r\n\r\n isActiveOption(option: OptionItem): boolean {\r\n return Object.is(this.active(), this.resolveValue(option));\r\n }\r\n\r\n isOptionDisabled(option: OptionItem): boolean {\r\n return !!option?.disabled;\r\n }\r\n\r\n trackOption(option: OptionItem, index: number): unknown {\r\n return this.resolveValue(option) ?? index;\r\n }\r\n}\r\n","@if (mode() === \"vertical\") {\r\n <div\r\n class=\"flex min-h-0 flex-col gap-1 rounded-2xl border border-surface-200 bg-white p-2\"\r\n role=\"tablist\"\r\n aria-orientation=\"vertical\"\r\n >\r\n @for (option of options(); track trackOption(option, $index)) {\r\n <button\r\n type=\"button\"\r\n role=\"tab\"\r\n class=\"group relative flex w-full items-center gap-3 overflow-hidden rounded-lg px-3 py-2.5 text-left text-sm transition-colors duration-150 outline-none focus-visible:ring-2 focus-visible:ring-primary/20\"\r\n [attr.aria-selected]=\"isActiveOption(option)\"\r\n [attr.tabindex]=\"isActiveOption(option) ? 0 : -1\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n [class.bg-primary-50]=\"isActiveOption(option)\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.text-primary-700]=\"isActiveOption(option)\"\r\n [class.text-surface-500]=\"!isActiveOption(option)\"\r\n [class.hover:bg-surface-50]=\"!isActiveOption(option)\"\r\n [class.cursor-not-allowed]=\"disabled() || isOptionDisabled(option)\"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option)\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon\r\n [icon]=\"icon\"\r\n class=\"relative z-10 text-base\"\r\n [class.text-primary]=\"isActiveOption(option)\"\r\n [class.text-surface-400]=\"!isActiveOption(option)\"\r\n />\r\n }\r\n\r\n <span class=\"relative z-10 min-w-0 flex-1 truncate\">\r\n {{ resolveLabel(option) }}\r\n </span>\r\n\r\n @if (hasBadge(option)) {\r\n <span\r\n class=\"relative z-10 ms-auto inline-flex min-w-5 items-center justify-center rounded-full px-2 py-0.5 text-[11px] font-bold leading-none\"\r\n [class.bg-primary]=\"isActiveOption(option)\"\r\n [class.text-white]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-600]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n} @else if (mode() === \"underline\") {\r\n <div\r\n #tabsContainer\r\n class=\"relative flex w-full min-w-0 max-w-full items-center gap-0.5 overflow-x-clip\"\r\n role=\"tablist\"\r\n aria-orientation=\"horizontal\"\r\n >\r\n <!-- Invisible measurement ghost row: always renders every option at natural width -->\r\n <div\r\n #measureRow\r\n aria-hidden=\"true\"\r\n class=\"pointer-events-none invisible absolute top-0 left-0 flex flex-nowrap gap-0.5 -z-10\"\r\n >\r\n @for (option of options(); track trackOption(option, $index)) {\r\n <span\r\n class=\"inline-flex items-center gap-1.5 border-b-2 border-transparent px-3.5 py-2.5 text-sm font-semibold whitespace-nowrap\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon [icon]=\"icon\" class=\"text-base\" />\r\n }\r\n <span>{{ resolveLabel(option) }}</span>\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n\r\n <!-- Visible tabs row -->\r\n <div\r\n class=\"flex min-w-0 flex-1 items-center gap-0.5 overflow-x-clip border-b border-surface-200\"\r\n >\r\n @for (option of visibleOptions(); track trackOption(option, $index)) {\r\n <button\r\n type=\"button\"\r\n role=\"tab\"\r\n class=\"-mb-px inline-flex shrink-0 items-center gap-1.5 border-b-2 px-3.5 py-2.5 text-sm whitespace-nowrap transition-colors duration-150 outline-none focus-visible:ring-2 focus-visible:ring-primary/20\"\r\n [attr.aria-selected]=\"isActiveOption(option)\"\r\n [attr.tabindex]=\"isActiveOption(option) ? 0 : -1\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n [class.border-primary]=\"isActiveOption(option)\"\r\n [class.text-primary]=\"isActiveOption(option)\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.border-transparent]=\"!isActiveOption(option)\"\r\n [class.text-surface-700]=\"!isActiveOption(option)\"\r\n [class.font-medium]=\"!isActiveOption(option)\"\r\n [class.hover:text-primary-600]=\"\r\n !isActiveOption(option) && !(disabled() || isOptionDisabled(option))\r\n \"\r\n [class.cursor-pointer]=\"!(disabled() || isOptionDisabled(option))\"\r\n [class.cursor-not-allowed]=\"disabled() || isOptionDisabled(option)\"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option)\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon [icon]=\"icon\" class=\"text-base\" />\r\n }\r\n\r\n <span class=\"truncate\">{{ resolveLabel(option) }}</span>\r\n\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n [class.bg-primary-50]=\"isActiveOption(option)\"\r\n [class.text-primary-700]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-500]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (hasOverflow()) {\r\n <div\r\n class=\"flex shrink-0 items-center -mb-px border-b border-surface-200 pb-1\"\r\n >\r\n <mt-button\r\n icon=\"arrow.chevron-down\"\r\n [label]=\"moreLabel()\"\r\n size=\"small\"\r\n severity=\"primary\"\r\n [text]=\"true\"\r\n [rounded]=\"true\"\r\n (onClick)=\"morePopover.toggle($event)\"\r\n />\r\n <p-popover\r\n #morePopover\r\n appendTo=\"body\"\r\n (onHide)=\"onOverflowPopoverHide()\"\r\n >\r\n <div class=\"flex min-w-56 flex-col\">\r\n @if (showOverflowSearch()) {\r\n <div class=\"border-b border-surface-200 p-2\">\r\n <p-iconfield iconPosition=\"left\">\r\n <p-inputicon>\r\n <mt-icon icon=\"general.search-md\" />\r\n </p-inputicon>\r\n <input\r\n pInputText\r\n type=\"text\"\r\n [value]=\"searchTerm()\"\r\n (input)=\"onOverflowSearch($any($event.target).value)\"\r\n [placeholder]=\"'components.tabs.search' | transloco\"\r\n class=\"w-full\"\r\n />\r\n </p-iconfield>\r\n </div>\r\n }\r\n <div\r\n class=\"flex max-h-80 flex-col divide-y divide-surface-100 overflow-y-auto\"\r\n >\r\n @for (\r\n option of filteredOverflowOptions();\r\n track trackOption(option, $index)\r\n ) {\r\n <button\r\n type=\"button\"\r\n class=\"flex w-full cursor-pointer items-center justify-start gap-2 px-2 py-1 text-start text-sm transition-colors [&_.p-avatar]:h-7 [&_.p-avatar]:w-7 [&_.p-avatar]:text-sm\"\r\n [class.bg-primary-50]=\"isActiveOption(option)\"\r\n [class.text-primary]=\"isActiveOption(option)\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.text-surface-700]=\"!isActiveOption(option)\"\r\n [class.hover:bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.cursor-not-allowed]=\"\r\n disabled() || isOptionDisabled(option)\r\n \"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option); morePopover.hide()\"\r\n >\r\n <mt-avatar\r\n [icon]=\"resolveIconOrDefault(option)\"\r\n size=\"normal\"\r\n shape=\"circle\"\r\n styleClass=\"!bg-surface-100 !text-surface-600\"\r\n />\r\n <span class=\"flex-1 truncate text-start\">\r\n {{ resolveLabel(option) }}\r\n </span>\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n [class.bg-primary-100]=\"isActiveOption(option)\"\r\n [class.text-primary-700]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-500]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n } @empty {\r\n <div class=\"px-3 py-4 text-center text-sm text-surface-500\">\r\n {{ \"components.tabs.no-results\" | transloco }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </p-popover>\r\n </div>\r\n }\r\n </div>\r\n} @else {\r\n <p-selectbutton\r\n [options]=\"options()\"\r\n [(ngModel)]=\"active\"\r\n (ngModelChange)=\"onTabChange($event)\"\r\n [optionLabel]=\"optionLabel()\"\r\n [optionValue]=\"optionValue()\"\r\n styleClass=\"my-tabs-button\"\r\n [size]=\"size()\"\r\n [fluid]=\"fluid()\"\r\n [disabled]=\"disabled()\"\r\n unselectable\r\n />\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"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A,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,OAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,eAAe,oEAEf,YAAY,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEnFnD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"masterteam-components-tabs.mjs","sources":["../../../../packages/masterteam/components/tabs/tabs.ts","../../../../packages/masterteam/components/tabs/tabs.html","../../../../packages/masterteam/components/tabs/masterteam-components-tabs.ts"],"sourcesContent":["import {\r\n afterNextRender,\r\n booleanAttribute,\r\n Component,\r\n computed,\r\n DestroyRef,\r\n effect,\r\n ElementRef,\r\n inject,\r\n input,\r\n model,\r\n output,\r\n signal,\r\n viewChild,\r\n} from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { TranslocoPipe, TranslocoService } from '@jsverse/transloco';\r\nimport { MTIcon, Icon } from '@masterteam/icons';\r\nimport { SelectButton } from 'primeng/selectbutton';\r\nimport { Popover } from 'primeng/popover';\r\nimport { InputTextModule } from 'primeng/inputtext';\r\nimport { IconFieldModule } from 'primeng/iconfield';\r\nimport { InputIconModule } from 'primeng/inputicon';\r\nimport { Button } from '@masterteam/components/button';\r\nimport { Avatar } from '@masterteam/components/avatar';\r\n\r\nexport interface OptionItem {\r\n label?: string;\r\n value?: any;\r\n icon?: MTIcon | null;\r\n badge?: number | string | null;\r\n disabled?: boolean;\r\n [key: string]: unknown;\r\n}\r\n\r\n@Component({\r\n selector: 'mt-tabs',\r\n standalone: true,\r\n imports: [\r\n Icon,\r\n SelectButton,\r\n FormsModule,\r\n Button,\r\n Popover,\r\n Avatar,\r\n InputTextModule,\r\n IconFieldModule,\r\n InputIconModule,\r\n TranslocoPipe,\r\n ],\r\n templateUrl: './tabs.html',\r\n styleUrls: ['./tabs.scss'],\r\n host: {\r\n class: 'grid min-w-0 gap-1',\r\n '[class.w-full]': 'fluid()',\r\n },\r\n})\r\nexport class Tabs {\r\n private readonly transloco = inject(TranslocoService);\r\n options = input<OptionItem[]>([]);\r\n optionLabel = input<string>('label');\r\n optionValue = input<string>('value');\r\n active = model<any>(null);\r\n readonly mode = input<'horizontal' | 'vertical' | 'underline'>('horizontal');\r\n readonly moreLabel = input<string>(\r\n this.transloco.translate('components.tabs.more'),\r\n );\r\n readonly defaultIcon = input<MTIcon>('layout.align-left-02');\r\n\r\n onChange = output<any>();\r\n\r\n readonly size = input<'small' | 'large' | undefined>();\r\n readonly fluid = input<boolean, unknown>(false, {\r\n transform: booleanAttribute,\r\n });\r\n disabled = input<boolean, unknown>(false, {\r\n transform: booleanAttribute,\r\n });\r\n\r\n private readonly destroyRef = inject(DestroyRef);\r\n private readonly tabsContainer =\r\n viewChild<ElementRef<HTMLElement>>('tabsContainer');\r\n private readonly measureRow =\r\n viewChild<ElementRef<HTMLElement>>('measureRow');\r\n private readonly morePopover = viewChild(Popover);\r\n private resizeObserver?: ResizeObserver;\r\n private measureHandle = 0;\r\n private alignHandle = 0;\r\n\r\n readonly visibleCount = signal<number>(Number.MAX_SAFE_INTEGER);\r\n readonly visibleOptions = computed(() =>\r\n this.options().slice(0, this.visibleCount()),\r\n );\r\n readonly overflowOptions = computed(() =>\r\n this.options().slice(this.visibleCount()),\r\n );\r\n readonly hasOverflow = computed(() => this.overflowOptions().length > 0);\r\n readonly isActiveInOverflow = computed(() =>\r\n this.overflowOptions().some((option) => this.isActiveOption(option)),\r\n );\r\n\r\n readonly searchThreshold = input<number>(8);\r\n readonly searchTerm = signal<string>('');\r\n readonly showOverflowSearch = computed(\r\n () => this.overflowOptions().length >= this.searchThreshold(),\r\n );\r\n readonly filteredOverflowOptions = computed(() => {\r\n const term = this.searchTerm().trim().toLowerCase();\r\n if (!term) return this.overflowOptions();\r\n return this.overflowOptions().filter((option) =>\r\n this.resolveLabel(option).toLowerCase().includes(term),\r\n );\r\n });\r\n\r\n constructor() {\r\n effect(() => {\r\n const options = this.options();\r\n const active = this.active();\r\n if (!options.length) {\r\n return;\r\n }\r\n\r\n const hasActiveOption = options.some((option) =>\r\n Object.is(this.resolveValue(option), active),\r\n );\r\n if (!hasActiveOption) {\r\n this.active.set(this.resolveValue(options[0]));\r\n }\r\n });\r\n\r\n afterNextRender(() => {\r\n if (this.mode() !== 'underline') return;\r\n this.setupResizeObserver();\r\n this.scheduleMeasure();\r\n });\r\n\r\n effect(() => {\r\n // Re-measure when options or mode change.\r\n this.options();\r\n if (this.mode() !== 'underline') return;\r\n this.scheduleMeasure();\r\n });\r\n\r\n this.destroyRef.onDestroy(() => {\r\n this.resizeObserver?.disconnect();\r\n if (this.measureHandle) {\r\n cancelAnimationFrame(this.measureHandle);\r\n }\r\n if (this.alignHandle) {\r\n cancelAnimationFrame(this.alignHandle);\r\n }\r\n });\r\n }\r\n\r\n private setupResizeObserver(): void {\r\n const container = this.tabsContainer()?.nativeElement;\r\n if (!container || typeof ResizeObserver === 'undefined') return;\r\n\r\n this.resizeObserver = new ResizeObserver(() => this.scheduleMeasure());\r\n this.resizeObserver.observe(container);\r\n }\r\n\r\n private scheduleMeasure(): void {\r\n if (this.measureHandle) {\r\n cancelAnimationFrame(this.measureHandle);\r\n }\r\n this.measureHandle = requestAnimationFrame(() => {\r\n this.measureHandle = 0;\r\n this.measureAndUpdate();\r\n });\r\n }\r\n\r\n private measureAndUpdate(): void {\r\n const container = this.tabsContainer()?.nativeElement;\r\n const measureRow = this.measureRow()?.nativeElement;\r\n if (!container || !measureRow) return;\r\n\r\n const optionsCount = this.options().length;\r\n if (optionsCount === 0) {\r\n this.visibleCount.set(0);\r\n return;\r\n }\r\n\r\n if (container.clientWidth === 0) return;\r\n\r\n // Inner width excludes the container's horizontal padding so we compare\r\n // against the actual space available to the flex tabs row.\r\n const style = getComputedStyle(container);\r\n const paddingX =\r\n (parseFloat(style.paddingLeft) || 0) +\r\n (parseFloat(style.paddingRight) || 0);\r\n const innerWidth = container.clientWidth - paddingX;\r\n if (innerWidth <= 0) return;\r\n\r\n const tabWidths = Array.from(measureRow.children).map(\r\n (el) => (el as HTMLElement).getBoundingClientRect().width,\r\n );\r\n\r\n if (tabWidths.length === 0) return;\r\n\r\n // Approximate gap-0.5 between tabs (2px).\r\n const gap = 2;\r\n const totalWidth =\r\n tabWidths.reduce((sum, width) => sum + width, 0) +\r\n Math.max(0, tabWidths.length - 1) * gap;\r\n\r\n // Everything fits — no more button needed.\r\n if (totalWidth <= innerWidth) {\r\n this.visibleCount.set(tabWidths.length);\r\n return;\r\n }\r\n\r\n // Reserve space for the More button (icon + label ~ 88px).\r\n const moreButtonReserve = 96;\r\n const available = innerWidth - moreButtonReserve;\r\n\r\n let cumulative = 0;\r\n let visibleCount = 0;\r\n for (let i = 0; i < tabWidths.length; i++) {\r\n const next = cumulative + tabWidths[i] + (i > 0 ? gap : 0);\r\n if (next > available) break;\r\n cumulative = next;\r\n visibleCount++;\r\n }\r\n\r\n this.visibleCount.set(Math.max(1, visibleCount));\r\n }\r\n\r\n onTabChange(value: any) {\r\n this.onChange.emit(value);\r\n }\r\n\r\n onOverflowSearch(value: string): void {\r\n this.searchTerm.set(value ?? '');\r\n // Filtering shrinks/grows the popover content, but PrimeNG only positions\r\n // the popover on show. Re-align after the filtered list re-renders so a\r\n // popover opened above the trigger stays attached instead of overlapping.\r\n this.scheduleOverflowAlign();\r\n }\r\n\r\n private scheduleOverflowAlign(): void {\r\n if (this.alignHandle) {\r\n cancelAnimationFrame(this.alignHandle);\r\n }\r\n this.alignHandle = requestAnimationFrame(() => {\r\n this.alignHandle = 0;\r\n const popover = this.morePopover();\r\n if (!popover?.overlayVisible) return;\r\n\r\n // Clear the stale flip marker so align() recomputes the arrow direction\r\n // for the new height instead of keeping the previous \"above\" state.\r\n const container = popover.container;\r\n if (container) {\r\n container.removeAttribute('data-p-popover-flipped');\r\n container.classList.remove('p-popover-flipped');\r\n }\r\n popover.align();\r\n });\r\n }\r\n\r\n onOverflowPopoverHide(): void {\r\n this.searchTerm.set('');\r\n }\r\n\r\n onOptionSelect(option: OptionItem): void {\r\n if (this.disabled() || this.isOptionDisabled(option)) {\r\n return;\r\n }\r\n\r\n const value = this.resolveValue(option);\r\n this.active.set(value);\r\n this.onTabChange(value);\r\n }\r\n\r\n resolveLabel(option: OptionItem): string {\r\n const labelKey = this.optionLabel();\r\n const label =\r\n option && typeof option === 'object'\r\n ? (option as Record<string, unknown>)[labelKey]\r\n : option;\r\n\r\n return typeof label === 'string' ? label : String(label ?? '');\r\n }\r\n\r\n resolveValue(option: OptionItem): unknown {\r\n const valueKey = this.optionValue();\r\n if (option && typeof option === 'object' && valueKey in option) {\r\n return (option as Record<string, unknown>)[valueKey];\r\n }\r\n\r\n return option;\r\n }\r\n\r\n resolveIcon(option: OptionItem): MTIcon | null {\r\n return typeof option?.icon === 'string' ? option.icon : null;\r\n }\r\n\r\n resolveIconOrDefault(option: OptionItem): MTIcon {\r\n return this.resolveIcon(option) ?? this.defaultIcon();\r\n }\r\n\r\n resolveBadge(option: OptionItem): number | string | null {\r\n return option?.badge ?? null;\r\n }\r\n\r\n hasBadge(option: OptionItem): boolean {\r\n return option?.badge !== null && option?.badge !== undefined;\r\n }\r\n\r\n hasCountBadge(option: OptionItem): boolean {\r\n const badge = option?.badge;\r\n if (badge === null || badge === undefined || badge === '') {\r\n return false;\r\n }\r\n const numeric = typeof badge === 'number' ? badge : Number(badge);\r\n return Number.isNaN(numeric) ? true : numeric > 0;\r\n }\r\n\r\n isActiveOption(option: OptionItem): boolean {\r\n return Object.is(this.active(), this.resolveValue(option));\r\n }\r\n\r\n isOptionDisabled(option: OptionItem): boolean {\r\n return !!option?.disabled;\r\n }\r\n\r\n trackOption(option: OptionItem, index: number): unknown {\r\n return this.resolveValue(option) ?? index;\r\n }\r\n}\r\n","@if (mode() === \"vertical\") {\r\n <div\r\n class=\"flex min-h-0 flex-col gap-1 rounded-2xl border border-surface-200 bg-white p-2\"\r\n role=\"tablist\"\r\n aria-orientation=\"vertical\"\r\n >\r\n @for (option of options(); track trackOption(option, $index)) {\r\n <button\r\n type=\"button\"\r\n role=\"tab\"\r\n class=\"group relative flex w-full items-center gap-3 overflow-hidden rounded-lg px-3 py-2.5 text-left text-sm transition-colors duration-150 outline-none focus-visible:ring-2 focus-visible:ring-primary/20\"\r\n [attr.aria-selected]=\"isActiveOption(option)\"\r\n [attr.tabindex]=\"isActiveOption(option) ? 0 : -1\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n [class.bg-primary-50]=\"isActiveOption(option)\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.text-primary-700]=\"isActiveOption(option)\"\r\n [class.text-surface-500]=\"!isActiveOption(option)\"\r\n [class.hover:bg-surface-50]=\"!isActiveOption(option)\"\r\n [class.cursor-pointer]=\"!(disabled() || isOptionDisabled(option))\"\r\n [class.cursor-not-allowed]=\"disabled() || isOptionDisabled(option)\"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option)\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon\r\n [icon]=\"icon\"\r\n class=\"relative z-10 text-base\"\r\n [class.text-primary]=\"isActiveOption(option)\"\r\n [class.text-surface-400]=\"!isActiveOption(option)\"\r\n />\r\n }\r\n\r\n <span class=\"relative z-10 min-w-0 flex-1 truncate\">\r\n {{ resolveLabel(option) }}\r\n </span>\r\n\r\n @if (hasBadge(option)) {\r\n <span\r\n class=\"relative z-10 ms-auto inline-flex min-w-5 items-center justify-center rounded-full px-2 py-0.5 text-[11px] font-bold leading-none\"\r\n [class.bg-primary]=\"isActiveOption(option)\"\r\n [class.text-white]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-600]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n} @else if (mode() === \"underline\") {\r\n <div\r\n #tabsContainer\r\n class=\"relative flex w-full min-w-0 max-w-full items-center gap-0.5 overflow-x-clip\"\r\n role=\"tablist\"\r\n aria-orientation=\"horizontal\"\r\n >\r\n <!-- Invisible measurement ghost row: always renders every option at natural width -->\r\n <div\r\n #measureRow\r\n aria-hidden=\"true\"\r\n class=\"pointer-events-none invisible absolute top-0 left-0 flex flex-nowrap gap-0.5 -z-10\"\r\n >\r\n @for (option of options(); track trackOption(option, $index)) {\r\n <span\r\n class=\"inline-flex items-center gap-1.5 border-b-2 border-transparent px-3.5 py-2.5 text-sm font-semibold whitespace-nowrap\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon [icon]=\"icon\" class=\"text-base\" />\r\n }\r\n <span>{{ resolveLabel(option) }}</span>\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n\r\n <!-- Visible tabs row -->\r\n <div\r\n class=\"flex min-w-0 flex-1 items-center gap-0.5 overflow-x-clip border-b border-surface-200\"\r\n >\r\n @for (option of visibleOptions(); track trackOption(option, $index)) {\r\n <button\r\n type=\"button\"\r\n role=\"tab\"\r\n class=\"-mb-px inline-flex shrink-0 items-center gap-1.5 border-b-2 px-3.5 py-2.5 text-sm whitespace-nowrap transition-colors duration-150 outline-none focus-visible:ring-2 focus-visible:ring-primary/20\"\r\n [attr.aria-selected]=\"isActiveOption(option)\"\r\n [attr.tabindex]=\"isActiveOption(option) ? 0 : -1\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n [class.border-primary]=\"isActiveOption(option)\"\r\n [class.text-primary]=\"isActiveOption(option)\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.border-transparent]=\"!isActiveOption(option)\"\r\n [class.text-surface-700]=\"!isActiveOption(option)\"\r\n [class.font-medium]=\"!isActiveOption(option)\"\r\n [class.hover:text-primary-600]=\"\r\n !isActiveOption(option) && !(disabled() || isOptionDisabled(option))\r\n \"\r\n [class.cursor-pointer]=\"!(disabled() || isOptionDisabled(option))\"\r\n [class.cursor-not-allowed]=\"disabled() || isOptionDisabled(option)\"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option)\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon [icon]=\"icon\" class=\"text-base\" />\r\n }\r\n\r\n <span class=\"truncate\">{{ resolveLabel(option) }}</span>\r\n\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n [class.bg-primary-50]=\"isActiveOption(option)\"\r\n [class.text-primary-700]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-500]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (hasOverflow()) {\r\n <div\r\n class=\"flex shrink-0 items-center -mb-px border-b border-surface-200 pb-1\"\r\n >\r\n <mt-button\r\n icon=\"arrow.chevron-down\"\r\n [label]=\"moreLabel()\"\r\n size=\"small\"\r\n severity=\"primary\"\r\n [text]=\"true\"\r\n [rounded]=\"true\"\r\n (onClick)=\"morePopover.toggle($event)\"\r\n />\r\n <p-popover\r\n #morePopover\r\n appendTo=\"body\"\r\n (onHide)=\"onOverflowPopoverHide()\"\r\n >\r\n <div class=\"flex min-w-56 flex-col\">\r\n @if (showOverflowSearch()) {\r\n <div class=\"border-b border-surface-200 p-2\">\r\n <p-iconfield iconPosition=\"left\">\r\n <p-inputicon>\r\n <mt-icon icon=\"general.search-md\" />\r\n </p-inputicon>\r\n <input\r\n pInputText\r\n type=\"text\"\r\n [value]=\"searchTerm()\"\r\n (input)=\"onOverflowSearch($any($event.target).value)\"\r\n [placeholder]=\"'components.tabs.search' | transloco\"\r\n class=\"w-full\"\r\n />\r\n </p-iconfield>\r\n </div>\r\n }\r\n <div\r\n class=\"flex max-h-80 flex-col divide-y divide-surface-100 overflow-y-auto\"\r\n >\r\n @for (\r\n option of filteredOverflowOptions();\r\n track trackOption(option, $index)\r\n ) {\r\n <button\r\n type=\"button\"\r\n class=\"flex w-full cursor-pointer items-center justify-start gap-2 px-2 py-1 text-start text-sm transition-colors [&_.p-avatar]:h-7 [&_.p-avatar]:w-7 [&_.p-avatar]:text-sm\"\r\n [class.bg-primary-50]=\"isActiveOption(option)\"\r\n [class.text-primary]=\"isActiveOption(option)\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.text-surface-700]=\"!isActiveOption(option)\"\r\n [class.hover:bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.cursor-not-allowed]=\"\r\n disabled() || isOptionDisabled(option)\r\n \"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option); morePopover.hide()\"\r\n >\r\n <mt-avatar\r\n [icon]=\"resolveIconOrDefault(option)\"\r\n size=\"normal\"\r\n shape=\"circle\"\r\n styleClass=\"!bg-surface-100 !text-surface-600\"\r\n />\r\n <span class=\"flex-1 truncate text-start\">\r\n {{ resolveLabel(option) }}\r\n </span>\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n [class.bg-primary-100]=\"isActiveOption(option)\"\r\n [class.text-primary-700]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-500]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n } @empty {\r\n <div class=\"px-3 py-4 text-center text-sm text-surface-500\">\r\n {{ \"components.tabs.no-results\" | transloco }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </p-popover>\r\n </div>\r\n }\r\n </div>\r\n} @else {\r\n <p-selectbutton\r\n [options]=\"options()\"\r\n [(ngModel)]=\"active\"\r\n (ngModelChange)=\"onTabChange($event)\"\r\n [optionLabel]=\"optionLabel()\"\r\n [optionValue]=\"optionValue()\"\r\n styleClass=\"my-tabs-button\"\r\n [size]=\"size()\"\r\n [fluid]=\"fluid()\"\r\n [disabled]=\"disabled()\"\r\n unselectable\r\n />\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAyDa,IAAI,CAAA;AACE,IAAA,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACrD,IAAA,OAAO,GAAG,KAAK,CAAe,EAAE,8EAAC;AACjC,IAAA,WAAW,GAAG,KAAK,CAAS,OAAO,kFAAC;AACpC,IAAA,WAAW,GAAG,KAAK,CAAS,OAAO,kFAAC;AACpC,IAAA,MAAM,GAAG,KAAK,CAAM,IAAI,6EAAC;AAChB,IAAA,IAAI,GAAG,KAAK,CAA0C,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
|
};
|
|
213
213
|
updateNodeCheckedState(this.treeValue());
|
|
214
214
|
}
|
|
215
|
+
/**
|
|
216
|
+
* Clears the tree's search/filter input and resets the filtered nodes.
|
|
217
|
+
*/
|
|
218
|
+
resetFilter() {
|
|
219
|
+
const tree = this.primeTree();
|
|
220
|
+
if (!tree)
|
|
221
|
+
return;
|
|
222
|
+
tree.resetFilter();
|
|
223
|
+
// PrimeNG's resetFilter() does not re-serialize the nodes, so the
|
|
224
|
+
// (virtual-scrolled) list keeps showing the previously filtered set.
|
|
225
|
+
// Refresh the serialized value so the full tree is rendered again.
|
|
226
|
+
tree.updateSerializedValue();
|
|
227
|
+
}
|
|
215
228
|
resolveActionLoading(action, node) {
|
|
216
229
|
if (typeof action.loading === 'function') {
|
|
217
230
|
return action.loading(node);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masterteam-components-tree.mjs","sources":["../../../../packages/masterteam/components/tree/tree.ts","../../../../packages/masterteam/components/tree/tree.html","../../../../packages/masterteam/components/tree/masterteam-components-tree.ts"],"sourcesContent":["import { ToggleField } from '@masterteam/components/toggle-field';\r\nimport { Avatar } from '@masterteam/components/avatar';\r\nimport { Button } from '@masterteam/components/button';\r\nimport {\r\n Component,\r\n input,\r\n output,\r\n viewChild,\r\n effect,\r\n inject,\r\n computed,\r\n model,\r\n Signal,\r\n signal,\r\n} from '@angular/core';\r\nimport { Tree as PrimeTree, TreeModule } from 'primeng/tree';\r\nimport { MenuItem, TreeNode } from 'primeng/api';\r\nimport { Icon } from '@masterteam/icons';\r\nimport { MTIcon } from '@masterteam/icons';\r\nimport { CommonModule } from '@angular/common';\r\nimport { Directionality } from '@angular/cdk/bidi';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { ContextMenuModule } from 'primeng/contextmenu';\r\nimport { TranslocoModule } from '@jsverse/transloco';\r\nimport {\r\n TreeAction,\r\n TreeContextMenuAction,\r\n TreeActionEvent,\r\n} from './tree-types';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\n\r\n@Component({\r\n selector: 'mt-tree',\r\n standalone: true,\r\n imports: [\r\n TreeModule,\r\n Icon,\r\n CommonModule,\r\n Avatar,\r\n Button,\r\n FormsModule,\r\n ToggleField,\r\n ContextMenuModule,\r\n TranslocoModule,\r\n ],\r\n templateUrl: './tree.html',\r\n styleUrls: ['./tree.scss'],\r\n})\r\nexport class Tree {\r\n transloco = inject(TranslocoService);\r\n\r\n dir = inject(Directionality, { optional: true });\r\n\r\n readonly primeTree = viewChild<PrimeTree>('primeTree');\r\n\r\n readonly value = input.required<TreeNode[]>();\r\n readonly selection = model<TreeNode | TreeNode[] | null>();\r\n readonly selectionMode = input<'single' | 'multiple' | 'checkbox'>();\r\n readonly nodeIcon = input<MTIcon | undefined>();\r\n readonly propagateSelectionUp = input<boolean>(false);\r\n readonly propagateSelectionDown = input<boolean>(false);\r\n readonly checkAllChildren = input<boolean>(false);\r\n readonly loading = input<boolean>(false);\r\n readonly emptyMessage = input<string>(\r\n this.transloco.translate('components.tree.no-data-found'),\r\n );\r\n readonly checkAllLabel = input<string>(\r\n this.transloco.translate('components.tree.check-all'),\r\n );\r\n readonly filterPlaceholder = input<string>(\r\n this.transloco.translate('components.tree.search'),\r\n );\r\n readonly dataKey = input<'key'>('key');\r\n readonly filter = input<boolean>(false);\r\n readonly filterMode = input<'lenient' | 'strict'>('lenient');\r\n readonly virtualScroll = input<boolean>(false);\r\n readonly virtualScrollItemSize = input<number>(46);\r\n readonly scrollHeight = input<string | undefined>();\r\n\r\n readonly styleClass = input<string>('');\r\n readonly style = input<Record<string, string>>();\r\n readonly pInputs = input<Partial<PrimeTree>>();\r\n readonly nodeActions = input<TreeAction[]>([]);\r\n readonly nodeContextmenuActions = input<TreeContextMenuAction[]>([]);\r\n\r\n // Context menu state\r\n readonly contextMenuSelection = model<TreeNode | null>(null);\r\n readonly contextMenuItems = computed<MenuItem[]>(() => {\r\n const actions = this.nodeContextmenuActions();\r\n return actions.map((action) => ({\r\n label: action.label,\r\n icon: action.icon,\r\n command: () => {\r\n const node = this.contextMenuSelection();\r\n if (node) {\r\n action.action(node);\r\n }\r\n },\r\n }));\r\n });\r\n\r\n readonly action = output<TreeActionEvent>();\r\n CheckAllValue = signal<boolean>(false);\r\n // Computed tree value with \"Check All\" nodes added recursively to all parents\r\n readonly treeValue: Signal<TreeNode[]> = computed(() => {\r\n const nodes = this.value();\r\n const shouldAddCheckAll =\r\n this.checkAllChildren() && this.selectionMode() === 'checkbox';\r\n\r\n if (!shouldAddCheckAll) {\r\n return nodes;\r\n }\r\n\r\n // Recursively add \"Check All\" child to any parent node\r\n const addCheckAllRecursive = (node: TreeNode): TreeNode => {\r\n if (node.children && node.children.length > 0) {\r\n const checkAllNode: TreeNode = {\r\n key: `${node.key}-check-all`,\r\n label: this.checkAllLabel(),\r\n icon: 'general.check-square-broken',\r\n data: node,\r\n };\r\n\r\n return {\r\n ...node,\r\n children: [checkAllNode, ...node.children.map(addCheckAllRecursive)],\r\n };\r\n }\r\n return node;\r\n };\r\n\r\n // Transform all nodes\r\n const transformedNodes = nodes.map(addCheckAllRecursive);\r\n\r\n // Add \"Check All\" for entire tree at the beginning\r\n const treeCheckAllNode: TreeNode = {\r\n key: 'tree-check-all',\r\n label: this.checkAllLabel(),\r\n icon: 'general.check-square-broken',\r\n data: { isTreeRoot: true, children: transformedNodes },\r\n };\r\n\r\n return [treeCheckAllNode, ...transformedNodes];\r\n });\r\n\r\n constructor() {\r\n // Apply pInputs to the PrimeNG tree instance\r\n effect(() => {\r\n const tree = this.primeTree();\r\n const inputs = this.pInputs();\r\n if (tree && inputs) {\r\n Object.assign(tree, inputs);\r\n }\r\n });\r\n\r\n // Sync checked state when selection changes (including initial value)\r\n effect(() => {\r\n const value = this.treeValue();\r\n // Only run if we have nodes and selection\r\n if (value.length > 0 && this.selectionMode() === 'checkbox') {\r\n this.handleCheckedNodes();\r\n }\r\n });\r\n }\r\n private isProcessingBatchSelection = signal<boolean>(false);\r\n\r\n onSelectionChange(event: TreeNode | TreeNode[] | null) {\r\n // Skip emitting if we're in the middle of batch processing\r\n if (this.isProcessingBatchSelection()) {\r\n return;\r\n }\r\n this.handleCheckedNodes();\r\n this.action.emit({ action: 'selectionChange', data: event });\r\n }\r\n\r\n onNodeSelect(event: { node: TreeNode }) {\r\n this.action.emit({ action: 'nodeSelect', data: event });\r\n }\r\n\r\n onNodeUnselect(event: { node: TreeNode }) {\r\n this.action.emit({ action: 'nodeUnselect', data: event });\r\n }\r\n\r\n onNodeExpand(event: { node: TreeNode }) {\r\n this.action.emit({ action: 'nodeExpand', data: event });\r\n }\r\n\r\n onNodeCollapse(event: { node: TreeNode }) {\r\n this.action.emit({ action: 'nodeCollapse', data: event });\r\n }\r\n\r\n onContextMenuSelect(event: TreeNode) {\r\n this.contextMenuSelection.set(event);\r\n }\r\n getCheckAllValue(event: any) {\r\n this.CheckAllValue.set(event);\r\n }\r\n toggleNodeExpanded(node: TreeNode, event: MouseEvent): void {\r\n event.stopPropagation();\r\n node.expanded = !node.expanded;\r\n const tree = this.primeTree();\r\n if (tree && this.virtualScroll()) {\r\n tree.updateSerializedValue();\r\n }\r\n this.action.emit({\r\n action: node.expanded ? 'nodeExpand' : 'nodeCollapse',\r\n data: { node },\r\n });\r\n }\r\n\r\n toggleNodeSelection(node: TreeNode, event: MouseEvent): void {\r\n event.stopPropagation();\r\n if (node.selectable === false) {\r\n return;\r\n }\r\n\r\n const tree = this.primeTree();\r\n if (this.selectionMode() === 'checkbox' && tree) {\r\n if (node.key?.includes('check-all') && node.data) {\r\n const checkValue = this.CheckAllValue() ?? true;\r\n // Handle parent-level \"Check All\" - only check immediate children\r\n const parentNode = node.data;\r\n\r\n // Start batch processing to prevent multiple selection change events\r\n this.isProcessingBatchSelection.set(true);\r\n\r\n parentNode?.children?.forEach((child: TreeNode) => {\r\n if (!child.key?.includes('check-all')) {\r\n const isSelected = tree.isSelected(child);\r\n // Only toggle if the current state doesn't match desired state\r\n if ((checkValue && !isSelected) || (!checkValue && isSelected)) {\r\n tree.onNodeClick(event, child);\r\n }\r\n }\r\n });\r\n\r\n // End batch processing and emit single selection change event\r\n this.isProcessingBatchSelection.set(false);\r\n this.handleCheckedNodes();\r\n this.action.emit({\r\n action: 'selectionChange',\r\n data: this.selection(),\r\n });\r\n } else {\r\n tree.onNodeClick(event, node);\r\n }\r\n }\r\n }\r\n\r\n handleCheckedNodes() {\r\n const tree = this.primeTree();\r\n if (!tree) return;\r\n\r\n // Build a Set of selected keys for O(1) lookup instead of repeated isSelected() calls\r\n const selection = this.selection();\r\n const selectedKeys = new Set<string>();\r\n if (Array.isArray(selection)) {\r\n for (const node of selection) {\r\n if (node.key) selectedKeys.add(node.key);\r\n }\r\n }\r\n\r\n const updateNodeCheckedState = (nodes: TreeNode[]) => {\r\n for (const node of nodes) {\r\n if ((node as any).key?.includes('check-all')) {\r\n (node as any).checked = nodes.every(\r\n (n: any) => n.key?.includes('check-all') || selectedKeys.has(n.key),\r\n );\r\n } else {\r\n (node as any).checked = selectedKeys.has((node as any).key);\r\n }\r\n if (node.children) {\r\n updateNodeCheckedState(node.children);\r\n }\r\n }\r\n };\r\n updateNodeCheckedState(this.treeValue());\r\n }\r\n\r\n resolveActionLoading(action: TreeAction, node: any): boolean | undefined {\r\n if (typeof action.loading === 'function') {\r\n return action.loading(node);\r\n }\r\n return action.loading;\r\n }\r\n\r\n nodeAction(action: TreeAction, node: any): void {\r\n action.action(node);\r\n }\r\n}\r\n","<p-tree\r\n #primeTree\r\n [value]=\"treeValue()\"\r\n [(selection)]=\"selection\"\r\n [selectionMode]=\"selectionMode()\"\r\n [propagateSelectionUp]=\"propagateSelectionUp()\"\r\n [propagateSelectionDown]=\"propagateSelectionDown()\"\r\n [loading]=\"loading()\"\r\n [emptyMessage]=\"emptyMessage()\"\r\n [filter]=\"filter()\"\r\n [virtualScroll]=\"virtualScroll()\"\r\n [virtualScrollItemSize]=\"virtualScrollItemSize()\"\r\n [scrollHeight]=\"scrollHeight()\"\r\n [filterMode]=\"filterMode()\"\r\n [filterPlaceholder]=\"filterPlaceholder()\"\r\n [styleClass]=\"'mt-tree ' + styleClass()\"\r\n [style]=\"style()\"\r\n [contextMenu]=\"contextMenuItems().length ? cm : null\"\r\n [(contextMenuSelection)]=\"contextMenuSelection\"\r\n contextMenuSelectionMode=\"separate\"\r\n (selectionChange)=\"onSelectionChange($event)\"\r\n (onNodeSelect)=\"onNodeSelect($event)\"\r\n (onNodeUnselect)=\"onNodeUnselect($event)\"\r\n (onNodeExpand)=\"onNodeExpand($event)\"\r\n (onNodeCollapse)=\"onNodeCollapse($event)\"\r\n (onNodeContextMenuSelect)=\"onContextMenuSelect($event.node)\"\r\n>\r\n <ng-template let-node pTemplate=\"default\">\r\n <div\r\n (click)=\"selectionMode() === 'checkbox' ? $event.stopPropagation() : null\"\r\n class=\"mt-tree-node border-1 border-gray-300 cursor-default rounded-lg flex items-center hover:bg-surface-100 justify-between\"\r\n [class]=\"node?.key.includes('check-all') ? 'bg-surface-100 ' : ''\"\r\n >\r\n <div\r\n class=\"px-3 flex items-center justify-between flex-1\"\r\n [class.cursor-pointer]=\"\r\n selectionMode() === 'single' || selectionMode() === 'multiple'\r\n \"\r\n >\r\n <div class=\"flex items-center\">\r\n @if (node.children && node.children.length > 0) {\r\n <div class=\"py-3\" (click)=\"toggleNodeExpanded(node, $event)\">\r\n <mt-icon\r\n class=\"text-2xl cursor-pointer\"\r\n [icon]=\"\r\n node.expanded\r\n ? 'arrow.chevron-down'\r\n : dir?.value === 'rtl'\r\n ? 'arrow.chevron-left'\r\n : 'arrow.chevron-right'\r\n \"\r\n />\r\n </div>\r\n }\r\n @if (node.icon || nodeIcon()) {\r\n <mt-avatar\r\n class=\"ms-2\"\r\n [icon]=\"node.icon || nodeIcon()\"\r\n shape=\"square\"\r\n size=\"small\"\r\n style=\"\r\n --p-avatar-background: var(--p-primary-50);\r\n --p-avatar-color: var(--p-primary-color);\r\n \"\r\n [style]=\"\r\n node?.key.includes('check-all')\r\n ? ' --p-avatar-background: var(--p-primary-color); --p-avatar-color: white'\r\n : ''\r\n \"\r\n >\r\n </mt-avatar>\r\n }\r\n <div class=\"text-md mx-3 py-4\">{{ node.label }}</div>\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n @if (nodeActions().length > 0) {\r\n <div class=\"flex items-center\">\r\n @for (action of nodeActions(); track action.icon) {\r\n @let hidden = action.hidden?.(node);\r\n @if (!hidden) {\r\n <mt-button\r\n [variant]=\"action.variant\"\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.severity\"\r\n [size]=\"action.size\"\r\n [label]=\"action.label\"\r\n [tooltip]=\"action.tooltip\"\r\n [loading]=\"resolveActionLoading(action, node)\"\r\n (click)=\"nodeAction(action, node)\"\r\n >\r\n </mt-button>\r\n }\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n @if (selectionMode() === \"checkbox\") {\r\n <div\r\n class=\"me-3\"\r\n [class.cursor-pointer]=\"node.selectable !== false\"\r\n (click)=\"toggleNodeSelection(node, $event)\"\r\n >\r\n <mt-toggle-field\r\n (ngModelChange)=\"getCheckAllValue($event)\"\r\n [ngModel]=\"node.checked\"\r\n [disabled]=\"node.selectable === false\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n </ng-template>\r\n</p-tree>\r\n\r\n<p-contextMenu #cm [model]=\"contextMenuItems()\" appendTo=\"body\">\r\n <ng-template pTemplate=\"item\" let-item>\r\n <div class=\"p-menu-item-content\" (click)=\"item.command()\">\r\n <a class=\"p-menu-item-link flex items-center gap-2\">\r\n @if (item.icon) {\r\n <mt-icon [icon]=\"item.icon\" class=\"text-lg\" />\r\n }\r\n <span class=\"p-menu-item-label\">{{ item.label }}</span>\r\n </a>\r\n </div>\r\n </ng-template>\r\n</p-contextMenu>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAgDa,IAAI,CAAA;AACf,IAAA,SAAS,GAAG,MAAM,CAAC,gBAAgB,CA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terteam/components/tree/tree.html","../../../../packages/masterteam/components/tree/masterteam-components-tree.ts"],"sourcesContent":["import { ToggleField } from '@masterteam/components/toggle-field';\r\nimport { Avatar } from '@masterteam/components/avatar';\r\nimport { Button } from '@masterteam/components/button';\r\nimport {\r\n Component,\r\n input,\r\n output,\r\n viewChild,\r\n effect,\r\n inject,\r\n computed,\r\n model,\r\n Signal,\r\n signal,\r\n} from '@angular/core';\r\nimport { Tree as PrimeTree, TreeModule } from 'primeng/tree';\r\nimport { MenuItem, TreeNode } from 'primeng/api';\r\nimport { Icon } from '@masterteam/icons';\r\nimport { MTIcon } from '@masterteam/icons';\r\nimport { CommonModule } from '@angular/common';\r\nimport { Directionality } from '@angular/cdk/bidi';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { ContextMenuModule } from 'primeng/contextmenu';\r\nimport { TranslocoModule } from '@jsverse/transloco';\r\nimport {\r\n TreeAction,\r\n TreeContextMenuAction,\r\n TreeActionEvent,\r\n} from './tree-types';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\n\r\n@Component({\r\n selector: 'mt-tree',\r\n standalone: true,\r\n imports: [\r\n TreeModule,\r\n Icon,\r\n CommonModule,\r\n Avatar,\r\n Button,\r\n FormsModule,\r\n ToggleField,\r\n ContextMenuModule,\r\n TranslocoModule,\r\n ],\r\n templateUrl: './tree.html',\r\n styleUrls: ['./tree.scss'],\r\n})\r\nexport class Tree {\r\n transloco = inject(TranslocoService);\r\n\r\n dir = inject(Directionality, { optional: true });\r\n\r\n readonly primeTree = viewChild<PrimeTree>('primeTree');\r\n\r\n readonly value = input.required<TreeNode[]>();\r\n readonly selection = model<TreeNode | TreeNode[] | null>();\r\n readonly selectionMode = input<'single' | 'multiple' | 'checkbox'>();\r\n readonly nodeIcon = input<MTIcon | undefined>();\r\n readonly propagateSelectionUp = input<boolean>(false);\r\n readonly propagateSelectionDown = input<boolean>(false);\r\n readonly checkAllChildren = input<boolean>(false);\r\n readonly loading = input<boolean>(false);\r\n readonly emptyMessage = input<string>(\r\n this.transloco.translate('components.tree.no-data-found'),\r\n );\r\n readonly checkAllLabel = input<string>(\r\n this.transloco.translate('components.tree.check-all'),\r\n );\r\n readonly filterPlaceholder = input<string>(\r\n this.transloco.translate('components.tree.search'),\r\n );\r\n readonly dataKey = input<'key'>('key');\r\n readonly filter = input<boolean>(false);\r\n readonly filterMode = input<'lenient' | 'strict'>('lenient');\r\n readonly virtualScroll = input<boolean>(false);\r\n readonly virtualScrollItemSize = input<number>(46);\r\n readonly scrollHeight = input<string | undefined>();\r\n\r\n readonly styleClass = input<string>('');\r\n readonly style = input<Record<string, string>>();\r\n readonly pInputs = input<Partial<PrimeTree>>();\r\n readonly nodeActions = input<TreeAction[]>([]);\r\n readonly nodeContextmenuActions = input<TreeContextMenuAction[]>([]);\r\n\r\n // Context menu state\r\n readonly contextMenuSelection = model<TreeNode | null>(null);\r\n readonly contextMenuItems = computed<MenuItem[]>(() => {\r\n const actions = this.nodeContextmenuActions();\r\n return actions.map((action) => ({\r\n label: action.label,\r\n icon: action.icon,\r\n command: () => {\r\n const node = this.contextMenuSelection();\r\n if (node) {\r\n action.action(node);\r\n }\r\n },\r\n }));\r\n });\r\n\r\n readonly action = output<TreeActionEvent>();\r\n CheckAllValue = signal<boolean>(false);\r\n // Computed tree value with \"Check All\" nodes added recursively to all parents\r\n readonly treeValue: Signal<TreeNode[]> = computed(() => {\r\n const nodes = this.value();\r\n const shouldAddCheckAll =\r\n this.checkAllChildren() && this.selectionMode() === 'checkbox';\r\n\r\n if (!shouldAddCheckAll) {\r\n return nodes;\r\n }\r\n\r\n // Recursively add \"Check All\" child to any parent node\r\n const addCheckAllRecursive = (node: TreeNode): TreeNode => {\r\n if (node.children && node.children.length > 0) {\r\n const checkAllNode: TreeNode = {\r\n key: `${node.key}-check-all`,\r\n label: this.checkAllLabel(),\r\n icon: 'general.check-square-broken',\r\n data: node,\r\n };\r\n\r\n return {\r\n ...node,\r\n children: [checkAllNode, ...node.children.map(addCheckAllRecursive)],\r\n };\r\n }\r\n return node;\r\n };\r\n\r\n // Transform all nodes\r\n const transformedNodes = nodes.map(addCheckAllRecursive);\r\n\r\n // Add \"Check All\" for entire tree at the beginning\r\n const treeCheckAllNode: TreeNode = {\r\n key: 'tree-check-all',\r\n label: this.checkAllLabel(),\r\n icon: 'general.check-square-broken',\r\n data: { isTreeRoot: true, children: transformedNodes },\r\n };\r\n\r\n return [treeCheckAllNode, ...transformedNodes];\r\n });\r\n\r\n constructor() {\r\n // Apply pInputs to the PrimeNG tree instance\r\n effect(() => {\r\n const tree = this.primeTree();\r\n const inputs = this.pInputs();\r\n if (tree && inputs) {\r\n Object.assign(tree, inputs);\r\n }\r\n });\r\n\r\n // Sync checked state when selection changes (including initial value)\r\n effect(() => {\r\n const value = this.treeValue();\r\n // Only run if we have nodes and selection\r\n if (value.length > 0 && this.selectionMode() === 'checkbox') {\r\n this.handleCheckedNodes();\r\n }\r\n });\r\n }\r\n private isProcessingBatchSelection = signal<boolean>(false);\r\n\r\n onSelectionChange(event: TreeNode | TreeNode[] | null) {\r\n // Skip emitting if we're in the middle of batch processing\r\n if (this.isProcessingBatchSelection()) {\r\n return;\r\n }\r\n this.handleCheckedNodes();\r\n this.action.emit({ action: 'selectionChange', data: event });\r\n }\r\n\r\n onNodeSelect(event: { node: TreeNode }) {\r\n this.action.emit({ action: 'nodeSelect', data: event });\r\n }\r\n\r\n onNodeUnselect(event: { node: TreeNode }) {\r\n this.action.emit({ action: 'nodeUnselect', data: event });\r\n }\r\n\r\n onNodeExpand(event: { node: TreeNode }) {\r\n this.action.emit({ action: 'nodeExpand', data: event });\r\n }\r\n\r\n onNodeCollapse(event: { node: TreeNode }) {\r\n this.action.emit({ action: 'nodeCollapse', data: event });\r\n }\r\n\r\n onContextMenuSelect(event: TreeNode) {\r\n this.contextMenuSelection.set(event);\r\n }\r\n getCheckAllValue(event: any) {\r\n this.CheckAllValue.set(event);\r\n }\r\n toggleNodeExpanded(node: TreeNode, event: MouseEvent): void {\r\n event.stopPropagation();\r\n node.expanded = !node.expanded;\r\n const tree = this.primeTree();\r\n if (tree && this.virtualScroll()) {\r\n tree.updateSerializedValue();\r\n }\r\n this.action.emit({\r\n action: node.expanded ? 'nodeExpand' : 'nodeCollapse',\r\n data: { node },\r\n });\r\n }\r\n\r\n toggleNodeSelection(node: TreeNode, event: MouseEvent): void {\r\n event.stopPropagation();\r\n if (node.selectable === false) {\r\n return;\r\n }\r\n\r\n const tree = this.primeTree();\r\n if (this.selectionMode() === 'checkbox' && tree) {\r\n if (node.key?.includes('check-all') && node.data) {\r\n const checkValue = this.CheckAllValue() ?? true;\r\n // Handle parent-level \"Check All\" - only check immediate children\r\n const parentNode = node.data;\r\n\r\n // Start batch processing to prevent multiple selection change events\r\n this.isProcessingBatchSelection.set(true);\r\n\r\n parentNode?.children?.forEach((child: TreeNode) => {\r\n if (!child.key?.includes('check-all')) {\r\n const isSelected = tree.isSelected(child);\r\n // Only toggle if the current state doesn't match desired state\r\n if ((checkValue && !isSelected) || (!checkValue && isSelected)) {\r\n tree.onNodeClick(event, child);\r\n }\r\n }\r\n });\r\n\r\n // End batch processing and emit single selection change event\r\n this.isProcessingBatchSelection.set(false);\r\n this.handleCheckedNodes();\r\n this.action.emit({\r\n action: 'selectionChange',\r\n data: this.selection(),\r\n });\r\n } else {\r\n tree.onNodeClick(event, node);\r\n }\r\n }\r\n }\r\n\r\n handleCheckedNodes() {\r\n const tree = this.primeTree();\r\n if (!tree) return;\r\n\r\n // Build a Set of selected keys for O(1) lookup instead of repeated isSelected() calls\r\n const selection = this.selection();\r\n const selectedKeys = new Set<string>();\r\n if (Array.isArray(selection)) {\r\n for (const node of selection) {\r\n if (node.key) selectedKeys.add(node.key);\r\n }\r\n }\r\n\r\n const updateNodeCheckedState = (nodes: TreeNode[]) => {\r\n for (const node of nodes) {\r\n if ((node as any).key?.includes('check-all')) {\r\n (node as any).checked = nodes.every(\r\n (n: any) => n.key?.includes('check-all') || selectedKeys.has(n.key),\r\n );\r\n } else {\r\n (node as any).checked = selectedKeys.has((node as any).key);\r\n }\r\n if (node.children) {\r\n updateNodeCheckedState(node.children);\r\n }\r\n }\r\n };\r\n updateNodeCheckedState(this.treeValue());\r\n }\r\n\r\n /**\r\n * Clears the tree's search/filter input and resets the filtered nodes.\r\n */\r\n resetFilter(): void {\r\n const tree = this.primeTree();\r\n if (!tree) return;\r\n tree.resetFilter();\r\n // PrimeNG's resetFilter() does not re-serialize the nodes, so the\r\n // (virtual-scrolled) list keeps showing the previously filtered set.\r\n // Refresh the serialized value so the full tree is rendered again.\r\n tree.updateSerializedValue();\r\n }\r\n\r\n resolveActionLoading(action: TreeAction, node: any): boolean | undefined {\r\n if (typeof action.loading === 'function') {\r\n return action.loading(node);\r\n }\r\n return action.loading;\r\n }\r\n\r\n nodeAction(action: TreeAction, node: any): void {\r\n action.action(node);\r\n }\r\n}\r\n","<p-tree\r\n #primeTree\r\n [value]=\"treeValue()\"\r\n [(selection)]=\"selection\"\r\n [selectionMode]=\"selectionMode()\"\r\n [propagateSelectionUp]=\"propagateSelectionUp()\"\r\n [propagateSelectionDown]=\"propagateSelectionDown()\"\r\n [loading]=\"loading()\"\r\n [emptyMessage]=\"emptyMessage()\"\r\n [filter]=\"filter()\"\r\n [virtualScroll]=\"virtualScroll()\"\r\n [virtualScrollItemSize]=\"virtualScrollItemSize()\"\r\n [scrollHeight]=\"scrollHeight()\"\r\n [filterMode]=\"filterMode()\"\r\n [filterPlaceholder]=\"filterPlaceholder()\"\r\n [styleClass]=\"'mt-tree ' + styleClass()\"\r\n [style]=\"style()\"\r\n [contextMenu]=\"contextMenuItems().length ? cm : null\"\r\n [(contextMenuSelection)]=\"contextMenuSelection\"\r\n contextMenuSelectionMode=\"separate\"\r\n (selectionChange)=\"onSelectionChange($event)\"\r\n (onNodeSelect)=\"onNodeSelect($event)\"\r\n (onNodeUnselect)=\"onNodeUnselect($event)\"\r\n (onNodeExpand)=\"onNodeExpand($event)\"\r\n (onNodeCollapse)=\"onNodeCollapse($event)\"\r\n (onNodeContextMenuSelect)=\"onContextMenuSelect($event.node)\"\r\n>\r\n <ng-template let-node pTemplate=\"default\">\r\n <div\r\n (click)=\"selectionMode() === 'checkbox' ? $event.stopPropagation() : null\"\r\n class=\"mt-tree-node border-1 border-gray-300 cursor-default rounded-lg flex items-center hover:bg-surface-100 justify-between\"\r\n [class]=\"node?.key.includes('check-all') ? 'bg-surface-100 ' : ''\"\r\n >\r\n <div\r\n class=\"px-3 flex items-center justify-between flex-1\"\r\n [class.cursor-pointer]=\"\r\n selectionMode() === 'single' || selectionMode() === 'multiple'\r\n \"\r\n >\r\n <div class=\"flex items-center\">\r\n @if (node.children && node.children.length > 0) {\r\n <div class=\"py-3\" (click)=\"toggleNodeExpanded(node, $event)\">\r\n <mt-icon\r\n class=\"text-2xl cursor-pointer\"\r\n [icon]=\"\r\n node.expanded\r\n ? 'arrow.chevron-down'\r\n : dir?.value === 'rtl'\r\n ? 'arrow.chevron-left'\r\n : 'arrow.chevron-right'\r\n \"\r\n />\r\n </div>\r\n }\r\n @if (node.icon || nodeIcon()) {\r\n <mt-avatar\r\n class=\"ms-2\"\r\n [icon]=\"node.icon || nodeIcon()\"\r\n shape=\"square\"\r\n size=\"small\"\r\n style=\"\r\n --p-avatar-background: var(--p-primary-50);\r\n --p-avatar-color: var(--p-primary-color);\r\n \"\r\n [style]=\"\r\n node?.key.includes('check-all')\r\n ? ' --p-avatar-background: var(--p-primary-color); --p-avatar-color: white'\r\n : ''\r\n \"\r\n >\r\n </mt-avatar>\r\n }\r\n <div class=\"text-md mx-3 py-4\">{{ node.label }}</div>\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n @if (nodeActions().length > 0) {\r\n <div class=\"flex items-center\">\r\n @for (action of nodeActions(); track action.icon) {\r\n @let hidden = action.hidden?.(node);\r\n @if (!hidden) {\r\n <mt-button\r\n [variant]=\"action.variant\"\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.severity\"\r\n [size]=\"action.size\"\r\n [label]=\"action.label\"\r\n [tooltip]=\"action.tooltip\"\r\n [loading]=\"resolveActionLoading(action, node)\"\r\n (click)=\"nodeAction(action, node)\"\r\n >\r\n </mt-button>\r\n }\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n @if (selectionMode() === \"checkbox\") {\r\n <div\r\n class=\"me-3\"\r\n [class.cursor-pointer]=\"node.selectable !== false\"\r\n (click)=\"toggleNodeSelection(node, $event)\"\r\n >\r\n <mt-toggle-field\r\n (ngModelChange)=\"getCheckAllValue($event)\"\r\n [ngModel]=\"node.checked\"\r\n [disabled]=\"node.selectable === false\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n </ng-template>\r\n</p-tree>\r\n\r\n<p-contextMenu #cm [model]=\"contextMenuItems()\" appendTo=\"body\">\r\n <ng-template pTemplate=\"item\" let-item>\r\n <div class=\"p-menu-item-content\" (click)=\"item.command()\">\r\n <a class=\"p-menu-item-link flex items-center gap-2\">\r\n @if (item.icon) {\r\n <mt-icon [icon]=\"item.icon\" class=\"text-lg\" />\r\n }\r\n <span class=\"p-menu-item-label\">{{ item.label }}</span>\r\n </a>\r\n </div>\r\n </ng-template>\r\n</p-contextMenu>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAgDa,IAAI,CAAA;AACf,IAAA,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC;IAEpC,GAAG,GAAG,MAAM,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAEvC,IAAA,SAAS,GAAG,SAAS,CAAY,WAAW,gFAAC;AAE7C,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,2EAAc;IACpC,SAAS,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAgC;IACjD,aAAa,GAAG,KAAK,CAAA,IAAA,S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