@masterteam/components 0.0.106 → 0.0.108
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/.codex-tmp-pack/extract/package/README.md +63 -0
- package/.codex-tmp-pack/extract/package/assets/cairo.css +70 -0
- package/.codex-tmp-pack/extract/package/assets/common.css +2 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Cairo-Black.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Cairo-Bold.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Cairo-ExtraBold.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Cairo-ExtraLight.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Cairo-Light.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Cairo-Medium.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Cairo-Regular.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Cairo-SemiBold.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Cairo-VariableFont_slnt,wght.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Inter-Black.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Inter-BlackItalic.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Inter-Bold.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Inter-BoldItalic.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Inter-ExtraBold.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Inter-ExtraBoldItalic.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Inter-ExtraLight.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Inter-ExtraLightItalic.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Inter-Italic.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Inter-Light.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Inter-LightItalic.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Inter-Medium.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Inter-MediumItalic.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Inter-Regular.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Inter-SemiBold.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Inter-SemiBoldItalic.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Inter-Thin.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/Inter-ThinItalic.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/InterDisplay-Black.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/InterDisplay-BlackItalic.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/InterDisplay-Bold.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/InterDisplay-BoldItalic.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/InterDisplay-ExtraBold.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/InterDisplay-ExtraBoldItalic.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/InterDisplay-ExtraLight.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/InterDisplay-ExtraLightItalic.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/InterDisplay-Italic.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/InterDisplay-Light.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/InterDisplay-LightItalic.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/InterDisplay-Medium.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/InterDisplay-MediumItalic.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/InterDisplay-Regular.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/InterDisplay-SemiBold.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/InterDisplay-SemiBoldItalic.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/InterDisplay-Thin.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/InterDisplay-ThinItalic.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/InterVariable-Italic.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/fonts/InterVariable.woff2 +0 -0
- package/.codex-tmp-pack/extract/package/assets/i18n/ar.json +44 -0
- package/.codex-tmp-pack/extract/package/assets/i18n/en.json +44 -0
- package/.codex-tmp-pack/extract/package/assets/inter.css +418 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-avatar-text.mjs +46 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-avatar-text.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-avatar.mjs +45 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-avatar.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-breadcrumb.mjs +27 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-breadcrumb.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-business-fields.mjs +222 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-business-fields.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-button-group.mjs +20 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-button-group.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-button.mjs +52 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-button.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-card.mjs +28 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-card.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-checkbox-field.mjs +88 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-checkbox-field.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-chip.mjs +35 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-chip.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-client-page-menu.mjs +92 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-client-page-menu.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-client-page.mjs +93 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-client-page.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-color-picker-field.mjs +94 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-color-picker-field.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-confirmation.mjs +93 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-confirmation.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-date-field.mjs +94 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-date-field.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-dialog.mjs +33 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-dialog.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-drawer.mjs +69 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-drawer.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-dynamic-drawer.mjs +321 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-dynamic-drawer.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-editor-field.mjs +96 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-editor-field.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-entities.mjs +572 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-entities.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-field-validation.mjs +103 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-field-validation.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-formula.mjs +3102 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-formula.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-icon-field.mjs +63 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-icon-field.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-list.mjs +31 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-list.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-menu.mjs +136 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-menu.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-modal.mjs +50 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-modal.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-module-summary-card.mjs +32 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-module-summary-card.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-multi-select-field.mjs +197 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-multi-select-field.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-number-field.mjs +95 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-number-field.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-page-header.mjs +42 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-page-header.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-page.mjs +35 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-page.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-paginator.mjs +44 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-paginator.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-pick-list-field.mjs +204 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-pick-list-field.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-progress.mjs +41 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-progress.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-property-filter-builder.mjs +383 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-property-filter-builder.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-radio-button-field.mjs +85 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-radio-button-field.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-radio-cards-field.mjs +68 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-radio-cards-field.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-radio-cards.mjs +74 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-radio-cards.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-select-field.mjs +258 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-select-field.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-sidebar.mjs +36 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-sidebar.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-slider-field.mjs +104 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-slider-field.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-statistic-card.mjs +21 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-statistic-card.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-table.mjs +583 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-table.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-tabs.mjs +44 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-tabs.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-text-field.mjs +159 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-text-field.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-textarea-field.mjs +92 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-textarea-field.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-toast.mjs +75 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-toast.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-toggle-field.mjs +104 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-toggle-field.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-tooltip.mjs +45 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-tooltip.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-topbar.mjs +28 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-topbar.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-tree.mjs +219 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-tree.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-upload-field.mjs +480 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-upload-field.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-user-search-field.mjs +153 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-user-search-field.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components.mjs +1338 -0
- package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components.mjs.map +1 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-avatar-text.d.ts +23 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-avatar.d.ts +21 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-breadcrumb.d.ts +18 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-business-fields.d.ts +114 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-button-group.d.ts +8 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-button.d.ts +36 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-card.d.ts +14 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-checkbox-field.d.ts +34 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-chip.d.ts +19 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-client-page-menu.d.ts +35 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-client-page.d.ts +42 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-color-picker-field.d.ts +35 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-confirmation.d.ts +41 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-date-field.d.ts +41 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-dialog.d.ts +12 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-drawer.d.ts +30 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-dynamic-drawer.d.ts +93 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-editor-field.d.ts +34 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-entities.d.ts +326 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-field-validation.d.ts +13 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-formula.d.ts +651 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-icon-field.d.ts +27 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-list.d.ts +18 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-menu.d.ts +55 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-modal.d.ts +18 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-module-summary-card.d.ts +17 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-multi-select-field.d.ts +74 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-number-field.d.ts +42 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-page-header.d.ts +30 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-page.d.ts +26 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-paginator.d.ts +20 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-pick-list-field.d.ts +60 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-progress.d.ts +20 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-property-filter-builder.d.ts +90 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-radio-button-field.d.ts +41 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-radio-cards-field.d.ts +30 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-radio-cards.d.ts +33 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-select-field.d.ts +84 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-sidebar.d.ts +28 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-slider-field.d.ts +45 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-statistic-card.d.ts +17 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-table.d.ts +207 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-tabs.d.ts +23 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-text-field.d.ts +44 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-textarea-field.d.ts +38 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-toast.d.ts +26 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-toggle-field.d.ts +41 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-tooltip.d.ts +9 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-topbar.d.ts +17 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-tree.d.ts +98 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-upload-field.d.ts +77 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components-user-search-field.d.ts +61 -0
- package/.codex-tmp-pack/extract/package/types/masterteam-components.d.ts +780 -0
- package/.codex-tmp-pack/masterteam-components-0.0.108.tgz +0 -0
- package/assets/common.css +1 -1
- package/fesm2022/masterteam-components-entities.mjs +2 -2
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-number-field.mjs +4 -3
- package/fesm2022/masterteam-components-number-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-slider-field.mjs +12 -5
- package/fesm2022/masterteam-components-slider-field.mjs.map +1 -1
- package/fesm2022/masterteam-components.mjs +2 -0
- package/fesm2022/masterteam-components.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-number-field.d.ts +2 -1
- package/types/masterteam-components-slider-field.d.ts +1 -0
- package/types/masterteam-components.d.ts +2 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, output, Component } from '@angular/core';
|
|
3
|
+
import { Icon } from '@masterteam/icons';
|
|
4
|
+
import * as i1 from 'primeng/chip';
|
|
5
|
+
import { ChipModule } from 'primeng/chip';
|
|
6
|
+
|
|
7
|
+
class Chip {
|
|
8
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
9
|
+
icon = input(...(ngDevMode ? [undefined, { debugName: "icon" }] : []));
|
|
10
|
+
image = input('', ...(ngDevMode ? [{ debugName: "image" }] : []));
|
|
11
|
+
removable = input(false, { ...(ngDevMode ? { debugName: "removable" } : {}), transform: booleanAttribute });
|
|
12
|
+
removeIcon = input('general.x-circle', ...(ngDevMode ? [{ debugName: "removeIcon" }] : []));
|
|
13
|
+
styleClass = input('', ...(ngDevMode ? [{ debugName: "styleClass" }] : []));
|
|
14
|
+
onRemove = output();
|
|
15
|
+
onImageError = output();
|
|
16
|
+
onChipRemove(event) {
|
|
17
|
+
this.onRemove.emit(event);
|
|
18
|
+
}
|
|
19
|
+
onChipImageError(event) {
|
|
20
|
+
this.onImageError.emit(event);
|
|
21
|
+
}
|
|
22
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: Chip, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
23
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: Chip, isStandalone: true, selector: "mt-chip", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, image: { classPropertyName: "image", publicName: "image", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null }, removeIcon: { classPropertyName: "removeIcon", publicName: "removeIcon", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onRemove: "onRemove", onImageError: "onImageError" }, ngImport: i0, template: "<p-chip\r\n [label]=\"label()\"\r\n [image]=\"image()\"\r\n [removable]=\"removable()\"\r\n [removeIcon]=\"removeIcon()\"\r\n [class]=\"styleClass()\"\r\n (onRemove)=\"onChipRemove($event)\"\r\n (onImageError)=\"onChipImageError($event)\"\r\n>\r\n <ng-template #removeicon>\r\n <mt-icon class=\"align-super!\" [icon]=\"removeIcon()\" />\r\n </ng-template>\r\n @if (icon()) {\r\n <mt-icon #iconTemplate class=\"align-super!\" [icon]=\"icon()\" />\r\n }\r\n</p-chip>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ChipModule }, { kind: "component", type: i1.Chip, selector: "p-chip", inputs: ["label", "icon", "image", "alt", "styleClass", "disabled", "removable", "removeIcon", "chipProps"], outputs: ["onRemove", "onImageError"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }] });
|
|
24
|
+
}
|
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: Chip, decorators: [{
|
|
26
|
+
type: Component,
|
|
27
|
+
args: [{ selector: 'mt-chip', standalone: true, imports: [ChipModule, Icon], template: "<p-chip\r\n [label]=\"label()\"\r\n [image]=\"image()\"\r\n [removable]=\"removable()\"\r\n [removeIcon]=\"removeIcon()\"\r\n [class]=\"styleClass()\"\r\n (onRemove)=\"onChipRemove($event)\"\r\n (onImageError)=\"onChipImageError($event)\"\r\n>\r\n <ng-template #removeicon>\r\n <mt-icon class=\"align-super!\" [icon]=\"removeIcon()\" />\r\n </ng-template>\r\n @if (icon()) {\r\n <mt-icon #iconTemplate class=\"align-super!\" [icon]=\"icon()\" />\r\n }\r\n</p-chip>\r\n" }]
|
|
28
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], image: [{ type: i0.Input, args: [{ isSignal: true, alias: "image", required: false }] }], removable: [{ type: i0.Input, args: [{ isSignal: true, alias: "removable", required: false }] }], removeIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeIcon", required: false }] }], styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], onRemove: [{ type: i0.Output, args: ["onRemove"] }], onImageError: [{ type: i0.Output, args: ["onImageError"] }] } });
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Generated bundle index. Do not edit.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
export { Chip };
|
|
35
|
+
//# sourceMappingURL=masterteam-components-chip.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"masterteam-components-chip.mjs","sources":["../../../../packages/masterteam/components/chip/chip.ts","../../../../packages/masterteam/components/chip/chip.html","../../../../packages/masterteam/components/chip/masterteam-components-chip.ts"],"sourcesContent":["import { Component, output, input, booleanAttribute } from '@angular/core';\r\nimport { Icon, MTIcon } from '@masterteam/icons';\r\nimport { ChipModule } from 'primeng/chip';\r\n\r\n@Component({\r\n selector: 'mt-chip',\r\n standalone: true,\r\n imports: [ChipModule, Icon],\r\n templateUrl: './chip.html',\r\n styleUrls: ['./chip.scss'],\r\n})\r\nexport class Chip {\r\n readonly label = input<string>('');\r\n readonly icon = input<MTIcon>();\r\n readonly image = input<string>('');\r\n readonly removable = input<boolean, unknown>(false, {\r\n transform: booleanAttribute,\r\n });\r\n readonly removeIcon = input<MTIcon>('general.x-circle');\r\n readonly styleClass = input<string>('');\r\n\r\n onRemove = output<MouseEvent>();\r\n onImageError = output<Event>();\r\n\r\n onChipRemove(event: MouseEvent): void {\r\n this.onRemove.emit(event);\r\n }\r\n\r\n onChipImageError(event: Event): void {\r\n this.onImageError.emit(event);\r\n }\r\n}\r\n","<p-chip\r\n [label]=\"label()\"\r\n [image]=\"image()\"\r\n [removable]=\"removable()\"\r\n [removeIcon]=\"removeIcon()\"\r\n [class]=\"styleClass()\"\r\n (onRemove)=\"onChipRemove($event)\"\r\n (onImageError)=\"onChipImageError($event)\"\r\n>\r\n <ng-template #removeicon>\r\n <mt-icon class=\"align-super!\" [icon]=\"removeIcon()\" />\r\n </ng-template>\r\n @if (icon()) {\r\n <mt-icon #iconTemplate class=\"align-super!\" [icon]=\"icon()\" />\r\n }\r\n</p-chip>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAWa,IAAI,CAAA;AACN,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,iDAAC;IACzB,IAAI,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;AACtB,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,iDAAC;IACzB,SAAS,GAAG,KAAK,CAAmB,KAAK,sDAChD,SAAS,EAAE,gBAAgB,EAAA,CAC3B;AACO,IAAA,UAAU,GAAG,KAAK,CAAS,kBAAkB,sDAAC;AAC9C,IAAA,UAAU,GAAG,KAAK,CAAS,EAAE,sDAAC;IAEvC,QAAQ,GAAG,MAAM,EAAc;IAC/B,YAAY,GAAG,MAAM,EAAS;AAE9B,IAAA,YAAY,CAAC,KAAiB,EAAA;AAC5B,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;IAC3B;AAEA,IAAA,gBAAgB,CAAC,KAAY,EAAA;AAC3B,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;IAC/B;uGAnBW,IAAI,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAJ,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,IAAI,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA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YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,SAAS,cACP,IAAI,EAAA,OAAA,EACP,CAAC,UAAU,EAAE,IAAI,CAAC,EAAA,QAAA,EAAA,ueAAA,EAAA;;;AEP7B;;AAEG;;;;"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, output, viewChild, viewChildren, effect, Component } from '@angular/core';
|
|
3
|
+
import { Avatar } from '@masterteam/components/avatar';
|
|
4
|
+
import { Skeleton } from 'primeng/skeleton';
|
|
5
|
+
|
|
6
|
+
class ClientPageMenu {
|
|
7
|
+
syncFrameId = null;
|
|
8
|
+
/** List of menu items to display */
|
|
9
|
+
menuItems = input([], ...(ngDevMode ? [{ debugName: "menuItems" }] : []));
|
|
10
|
+
/** Whether menu items are loading */
|
|
11
|
+
loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
12
|
+
/** Currently selected menu item */
|
|
13
|
+
selectedItem = input(null, ...(ngDevMode ? [{ debugName: "selectedItem" }] : []));
|
|
14
|
+
/** Emitted when a menu item is clicked */
|
|
15
|
+
menuItemClick = output();
|
|
16
|
+
menuContainer = viewChild('menuContainer', ...(ngDevMode ? [{ debugName: "menuContainer" }] : []));
|
|
17
|
+
menuItemElements = viewChildren('menuItem', ...(ngDevMode ? [{ debugName: "menuItemElements" }] : []));
|
|
18
|
+
constructor() {
|
|
19
|
+
effect(() => {
|
|
20
|
+
const selectedKey = this.selectedItem()?.key;
|
|
21
|
+
const itemCount = this.menuItems().length;
|
|
22
|
+
const itemElements = this.menuItemElements();
|
|
23
|
+
void selectedKey;
|
|
24
|
+
void itemCount;
|
|
25
|
+
void itemElements;
|
|
26
|
+
this.queueSelectedItemSync();
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
selectItem(item) {
|
|
30
|
+
this.menuItemClick.emit(item);
|
|
31
|
+
}
|
|
32
|
+
ngOnDestroy() {
|
|
33
|
+
if (this.syncFrameId !== null) {
|
|
34
|
+
cancelAnimationFrame(this.syncFrameId);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
getAvatarStyle(color) {
|
|
38
|
+
if (color.startsWith('#')) {
|
|
39
|
+
return {
|
|
40
|
+
'--p-avatar-background': color + '1a',
|
|
41
|
+
'--p-avatar-color': color,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
'--p-avatar-background': `var(--p-${color}-100)`,
|
|
46
|
+
'--p-avatar-color': `var(--p-${color}-700)`,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
queueSelectedItemSync() {
|
|
50
|
+
if (this.syncFrameId !== null) {
|
|
51
|
+
cancelAnimationFrame(this.syncFrameId);
|
|
52
|
+
}
|
|
53
|
+
this.syncFrameId = requestAnimationFrame(() => {
|
|
54
|
+
this.syncFrameId = null;
|
|
55
|
+
this.syncSelectedItemIntoView();
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
syncSelectedItemIntoView() {
|
|
59
|
+
const selectedItem = this.selectedItem();
|
|
60
|
+
const container = this.menuContainer()?.nativeElement;
|
|
61
|
+
if (!selectedItem || !container)
|
|
62
|
+
return;
|
|
63
|
+
const selectedElement = this.menuItemElements().find((item) => item.nativeElement.dataset['key'] === selectedItem.key)?.nativeElement;
|
|
64
|
+
if (!selectedElement)
|
|
65
|
+
return;
|
|
66
|
+
const containerRect = container.getBoundingClientRect();
|
|
67
|
+
const itemRect = selectedElement.getBoundingClientRect();
|
|
68
|
+
const topLimit = containerRect.top + 12;
|
|
69
|
+
const bottomLimit = containerRect.bottom - 56;
|
|
70
|
+
if (itemRect.top < topLimit || itemRect.bottom > bottomLimit) {
|
|
71
|
+
selectedElement.scrollIntoView({
|
|
72
|
+
block: 'nearest',
|
|
73
|
+
inline: 'nearest',
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ClientPageMenu, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
78
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: ClientPageMenu, isStandalone: true, selector: "mt-client-page-menu", inputs: { menuItems: { classPropertyName: "menuItems", publicName: "menuItems", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, selectedItem: { classPropertyName: "selectedItem", publicName: "selectedItem", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { menuItemClick: "menuItemClick" }, host: { classAttribute: "flex min-h-0 flex-1 overflow-hidden" }, viewQueries: [{ propertyName: "menuContainer", first: true, predicate: ["menuContainer"], descendants: true, isSignal: true }, { propertyName: "menuItemElements", predicate: ["menuItem"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Menu Items -->\r\n<div\r\n #menuContainer\r\n class=\"flex min-h-0 flex-1 flex-col overflow-x-hidden overflow-y-auto py-1 pb-16\"\r\n>\r\n @if (loading()) {\r\n <!-- Skeleton Loading -->\r\n @for (i of [1, 2, 3, 4]; track i) {\r\n <div class=\"px-3 py-2 w-full\">\r\n <div\r\n class=\"flex items-center gap-3 py-2 px-3 rounded-lg\"\r\n style=\"--p-skeleton-background: var(--p-surface-300)\"\r\n >\r\n <p-skeleton shape=\"square\" size=\"2.5rem\" borderRadius=\"8px\" />\r\n <div class=\"flex-1 flex flex-col gap-1\">\r\n <p-skeleton width=\"70%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"40%\" height=\"0.75rem\" />\r\n </div>\r\n <p-skeleton shape=\"circle\" size=\"1.5rem\" />\r\n </div>\r\n </div>\r\n }\r\n } @else if (menuItems().length === 0) {\r\n <!-- Empty State -->\r\n <div\r\n class=\"flex flex-col items-center justify-center py-10 px-4 text-center\"\r\n >\r\n <div class=\"text-surface-400 text-3xl mb-3\">\r\n <i class=\"pi pi-inbox\"></i>\r\n </div>\r\n <p class=\"text-sm text-surface-500 font-medium\">No data found</p>\r\n </div>\r\n } @else {\r\n @for (item of menuItems(); track item.key) {\r\n <div\r\n #menuItem\r\n [attr.data-key]=\"item.key\"\r\n class=\"px-3 py-2 w-full text-start transition-colors cursor-pointer\"\r\n (click)=\"selectItem(item)\"\r\n >\r\n <div\r\n class=\"flex items-center gap-3 py-2 px-3 transition-colors rounded-lg\"\r\n [class]=\"\r\n selectedItem()?.key === item.key\r\n ? 'bg-surface-300'\r\n : 'hover:bg-surface-100'\r\n \"\r\n >\r\n <mt-avatar\r\n [style]=\"getAvatarStyle(item.color)\"\r\n [icon]=\"item.icon\"\r\n shape=\"square\"\r\n size=\"normal\"\r\n />\r\n <span\r\n class=\"flex-1 text-sm font-medium\"\r\n [class]=\"\r\n selectedItem()?.key === item.key\r\n ? 'text-primary-700'\r\n : 'text-surface-700'\r\n \"\r\n >\r\n {{ item.title }}\r\n </span>\r\n <span\r\n class=\"text-xs font-medium rounded-full px-2 py-0.5\"\r\n [class]=\"\r\n selectedItem()?.key === item.key\r\n ? 'bg-primary-100 text-primary-700'\r\n : 'bg-surface-200 text-surface-600'\r\n \"\r\n >\r\n {{ item.count }}\r\n </span>\r\n </div>\r\n </div>\r\n }\r\n }\r\n</div>\r\n", dependencies: [{ kind: "component", type: Avatar, selector: "mt-avatar", inputs: ["label", "icon", "image", "styleClass", "size", "shape", "badge", "badgeSize", "badgeSeverity"], outputs: ["onImageError"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }] });
|
|
79
|
+
}
|
|
80
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ClientPageMenu, decorators: [{
|
|
81
|
+
type: Component,
|
|
82
|
+
args: [{ selector: 'mt-client-page-menu', standalone: true, imports: [Avatar, Skeleton], host: {
|
|
83
|
+
class: 'flex min-h-0 flex-1 overflow-hidden',
|
|
84
|
+
}, template: "<!-- Menu Items -->\r\n<div\r\n #menuContainer\r\n class=\"flex min-h-0 flex-1 flex-col overflow-x-hidden overflow-y-auto py-1 pb-16\"\r\n>\r\n @if (loading()) {\r\n <!-- Skeleton Loading -->\r\n @for (i of [1, 2, 3, 4]; track i) {\r\n <div class=\"px-3 py-2 w-full\">\r\n <div\r\n class=\"flex items-center gap-3 py-2 px-3 rounded-lg\"\r\n style=\"--p-skeleton-background: var(--p-surface-300)\"\r\n >\r\n <p-skeleton shape=\"square\" size=\"2.5rem\" borderRadius=\"8px\" />\r\n <div class=\"flex-1 flex flex-col gap-1\">\r\n <p-skeleton width=\"70%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"40%\" height=\"0.75rem\" />\r\n </div>\r\n <p-skeleton shape=\"circle\" size=\"1.5rem\" />\r\n </div>\r\n </div>\r\n }\r\n } @else if (menuItems().length === 0) {\r\n <!-- Empty State -->\r\n <div\r\n class=\"flex flex-col items-center justify-center py-10 px-4 text-center\"\r\n >\r\n <div class=\"text-surface-400 text-3xl mb-3\">\r\n <i class=\"pi pi-inbox\"></i>\r\n </div>\r\n <p class=\"text-sm text-surface-500 font-medium\">No data found</p>\r\n </div>\r\n } @else {\r\n @for (item of menuItems(); track item.key) {\r\n <div\r\n #menuItem\r\n [attr.data-key]=\"item.key\"\r\n class=\"px-3 py-2 w-full text-start transition-colors cursor-pointer\"\r\n (click)=\"selectItem(item)\"\r\n >\r\n <div\r\n class=\"flex items-center gap-3 py-2 px-3 transition-colors rounded-lg\"\r\n [class]=\"\r\n selectedItem()?.key === item.key\r\n ? 'bg-surface-300'\r\n : 'hover:bg-surface-100'\r\n \"\r\n >\r\n <mt-avatar\r\n [style]=\"getAvatarStyle(item.color)\"\r\n [icon]=\"item.icon\"\r\n shape=\"square\"\r\n size=\"normal\"\r\n />\r\n <span\r\n class=\"flex-1 text-sm font-medium\"\r\n [class]=\"\r\n selectedItem()?.key === item.key\r\n ? 'text-primary-700'\r\n : 'text-surface-700'\r\n \"\r\n >\r\n {{ item.title }}\r\n </span>\r\n <span\r\n class=\"text-xs font-medium rounded-full px-2 py-0.5\"\r\n [class]=\"\r\n selectedItem()?.key === item.key\r\n ? 'bg-primary-100 text-primary-700'\r\n : 'bg-surface-200 text-surface-600'\r\n \"\r\n >\r\n {{ item.count }}\r\n </span>\r\n </div>\r\n </div>\r\n }\r\n }\r\n</div>\r\n" }]
|
|
85
|
+
}], ctorParameters: () => [], propDecorators: { menuItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuItems", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], selectedItem: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedItem", required: false }] }], menuItemClick: [{ type: i0.Output, args: ["menuItemClick"] }], menuContainer: [{ type: i0.ViewChild, args: ['menuContainer', { isSignal: true }] }], menuItemElements: [{ type: i0.ViewChildren, args: ['menuItem', { isSignal: true }] }] } });
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Generated bundle index. Do not edit.
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
export { ClientPageMenu };
|
|
92
|
+
//# sourceMappingURL=masterteam-components-client-page-menu.mjs.map
|
package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-client-page-menu.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"masterteam-components-client-page-menu.mjs","sources":["../../../../packages/masterteam/components/client-page-menu/client-page-menu.ts","../../../../packages/masterteam/components/client-page-menu/client-page-menu.html","../../../../packages/masterteam/components/client-page-menu/masterteam-components-client-page-menu.ts"],"sourcesContent":["import {\r\n Component,\r\n effect,\r\n ElementRef,\r\n input,\r\n OnDestroy,\r\n output,\r\n viewChild,\r\n viewChildren,\r\n} from '@angular/core';\r\nimport { Avatar } from '@masterteam/components/avatar';\r\nimport { Skeleton } from 'primeng/skeleton';\r\n\r\nexport interface ClientPageMenuItem {\r\n icon: string;\r\n title: string;\r\n subtitle?: string;\r\n color: string;\r\n count: number;\r\n key: string;\r\n}\r\n\r\n@Component({\r\n selector: 'mt-client-page-menu',\r\n standalone: true,\r\n imports: [Avatar, Skeleton],\r\n templateUrl: './client-page-menu.html',\r\n host: {\r\n class: 'flex min-h-0 flex-1 overflow-hidden',\r\n },\r\n})\r\nexport class ClientPageMenu implements OnDestroy {\r\n private syncFrameId: number | null = null;\r\n\r\n /** List of menu items to display */\r\n readonly menuItems = input<ClientPageMenuItem[]>([]);\r\n\r\n /** Whether menu items are loading */\r\n readonly loading = input<boolean>(false);\r\n\r\n /** Currently selected menu item */\r\n readonly selectedItem = input<ClientPageMenuItem | null>(null);\r\n\r\n /** Emitted when a menu item is clicked */\r\n readonly menuItemClick = output<ClientPageMenuItem>();\r\n\r\n readonly menuContainer = viewChild<ElementRef<HTMLElement>>('menuContainer');\r\n readonly menuItemElements = viewChildren<ElementRef<HTMLElement>>('menuItem');\r\n\r\n constructor() {\r\n effect(() => {\r\n const selectedKey = this.selectedItem()?.key;\r\n const itemCount = this.menuItems().length;\r\n const itemElements = this.menuItemElements();\r\n void selectedKey;\r\n void itemCount;\r\n void itemElements;\r\n this.queueSelectedItemSync();\r\n });\r\n }\r\n\r\n selectItem(item: ClientPageMenuItem): void {\r\n this.menuItemClick.emit(item);\r\n }\r\n\r\n ngOnDestroy(): void {\r\n if (this.syncFrameId !== null) {\r\n cancelAnimationFrame(this.syncFrameId);\r\n }\r\n }\r\n\r\n getAvatarStyle(color: string): Record<string, string> {\r\n if (color.startsWith('#')) {\r\n return {\r\n '--p-avatar-background': color + '1a',\r\n '--p-avatar-color': color,\r\n };\r\n }\r\n return {\r\n '--p-avatar-background': `var(--p-${color}-100)`,\r\n '--p-avatar-color': `var(--p-${color}-700)`,\r\n };\r\n }\r\n\r\n private queueSelectedItemSync(): void {\r\n if (this.syncFrameId !== null) {\r\n cancelAnimationFrame(this.syncFrameId);\r\n }\r\n\r\n this.syncFrameId = requestAnimationFrame(() => {\r\n this.syncFrameId = null;\r\n this.syncSelectedItemIntoView();\r\n });\r\n }\r\n\r\n private syncSelectedItemIntoView(): void {\r\n const selectedItem = this.selectedItem();\r\n const container = this.menuContainer()?.nativeElement;\r\n if (!selectedItem || !container) return;\r\n\r\n const selectedElement = this.menuItemElements().find(\r\n (item) => item.nativeElement.dataset['key'] === selectedItem.key,\r\n )?.nativeElement;\r\n if (!selectedElement) return;\r\n\r\n const containerRect = container.getBoundingClientRect();\r\n const itemRect = selectedElement.getBoundingClientRect();\r\n const topLimit = containerRect.top + 12;\r\n const bottomLimit = containerRect.bottom - 56;\r\n\r\n if (itemRect.top < topLimit || itemRect.bottom > bottomLimit) {\r\n selectedElement.scrollIntoView({\r\n block: 'nearest',\r\n inline: 'nearest',\r\n });\r\n }\r\n }\r\n}\r\n","<!-- Menu Items -->\r\n<div\r\n #menuContainer\r\n class=\"flex min-h-0 flex-1 flex-col overflow-x-hidden overflow-y-auto py-1 pb-16\"\r\n>\r\n @if (loading()) {\r\n <!-- Skeleton Loading -->\r\n @for (i of [1, 2, 3, 4]; track i) {\r\n <div class=\"px-3 py-2 w-full\">\r\n <div\r\n class=\"flex items-center gap-3 py-2 px-3 rounded-lg\"\r\n style=\"--p-skeleton-background: var(--p-surface-300)\"\r\n >\r\n <p-skeleton shape=\"square\" size=\"2.5rem\" borderRadius=\"8px\" />\r\n <div class=\"flex-1 flex flex-col gap-1\">\r\n <p-skeleton width=\"70%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"40%\" height=\"0.75rem\" />\r\n </div>\r\n <p-skeleton shape=\"circle\" size=\"1.5rem\" />\r\n </div>\r\n </div>\r\n }\r\n } @else if (menuItems().length === 0) {\r\n <!-- Empty State -->\r\n <div\r\n class=\"flex flex-col items-center justify-center py-10 px-4 text-center\"\r\n >\r\n <div class=\"text-surface-400 text-3xl mb-3\">\r\n <i class=\"pi pi-inbox\"></i>\r\n </div>\r\n <p class=\"text-sm text-surface-500 font-medium\">No data found</p>\r\n </div>\r\n } @else {\r\n @for (item of menuItems(); track item.key) {\r\n <div\r\n #menuItem\r\n [attr.data-key]=\"item.key\"\r\n class=\"px-3 py-2 w-full text-start transition-colors cursor-pointer\"\r\n (click)=\"selectItem(item)\"\r\n >\r\n <div\r\n class=\"flex items-center gap-3 py-2 px-3 transition-colors rounded-lg\"\r\n [class]=\"\r\n selectedItem()?.key === item.key\r\n ? 'bg-surface-300'\r\n : 'hover:bg-surface-100'\r\n \"\r\n >\r\n <mt-avatar\r\n [style]=\"getAvatarStyle(item.color)\"\r\n [icon]=\"item.icon\"\r\n shape=\"square\"\r\n size=\"normal\"\r\n />\r\n <span\r\n class=\"flex-1 text-sm font-medium\"\r\n [class]=\"\r\n selectedItem()?.key === item.key\r\n ? 'text-primary-700'\r\n : 'text-surface-700'\r\n \"\r\n >\r\n {{ item.title }}\r\n </span>\r\n <span\r\n class=\"text-xs font-medium rounded-full px-2 py-0.5\"\r\n [class]=\"\r\n selectedItem()?.key === item.key\r\n ? 'bg-primary-100 text-primary-700'\r\n : 'bg-surface-200 text-surface-600'\r\n \"\r\n >\r\n {{ item.count }}\r\n </span>\r\n </div>\r\n </div>\r\n }\r\n }\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MA+Ba,cAAc,CAAA;IACjB,WAAW,GAAkB,IAAI;;AAGhC,IAAA,SAAS,GAAG,KAAK,CAAuB,EAAE,qDAAC;;AAG3C,IAAA,OAAO,GAAG,KAAK,CAAU,KAAK,mDAAC;;AAG/B,IAAA,YAAY,GAAG,KAAK,CAA4B,IAAI,wDAAC;;IAGrD,aAAa,GAAG,MAAM,EAAsB;AAE5C,IAAA,aAAa,GAAG,SAAS,CAA0B,eAAe,yDAAC;AACnE,IAAA,gBAAgB,GAAG,YAAY,CAA0B,UAAU,4DAAC;AAE7E,IAAA,WAAA,GAAA;QACE,MAAM,CAAC,MAAK;YACV,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,EAAE,EAAE,GAAG;YAC5C,M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AA,EAAA,cAAA,EAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,WAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,SAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,cAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,eAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,eAAe,6EACT,UAAU,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE/C9E;;AAEG;;;;"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, model, contentChild, output, linkedSignal, computed, effect, signal, Component } from '@angular/core';
|
|
3
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
4
|
+
import { Avatar } from '@masterteam/components/avatar';
|
|
5
|
+
import { Card } from '@masterteam/components/card';
|
|
6
|
+
import { ClientPageMenu } from '@masterteam/components/client-page-menu';
|
|
7
|
+
import { Icon } from '@masterteam/icons';
|
|
8
|
+
|
|
9
|
+
class ClientPage {
|
|
10
|
+
/** Icon for the left sidebar header */
|
|
11
|
+
menuIcon = input(...(ngDevMode ? [undefined, { debugName: "menuIcon" }] : []));
|
|
12
|
+
/** Title for the left sidebar header */
|
|
13
|
+
menuTitle = input(...(ngDevMode ? [undefined, { debugName: "menuTitle" }] : []));
|
|
14
|
+
/** List of menu items for the left sidebar */
|
|
15
|
+
menuItems = input([], ...(ngDevMode ? [{ debugName: "menuItems" }] : []));
|
|
16
|
+
/** Whether menu items are loading */
|
|
17
|
+
menuItemsLoading = input(false, ...(ngDevMode ? [{ debugName: "menuItemsLoading" }] : []));
|
|
18
|
+
/** Key of the active menu item (defaults to first item) */
|
|
19
|
+
activeItem = input(...(ngDevMode ? [undefined, { debugName: "activeItem" }] : []));
|
|
20
|
+
/** Whether the sidebar menu is collapsed (two-way bindable) */
|
|
21
|
+
collapsed = model(false, ...(ngDevMode ? [{ debugName: "collapsed" }] : []));
|
|
22
|
+
/** Template projected into the left sidebar header end */
|
|
23
|
+
headerEnd = contentChild('headerClientPageEnd', ...(ngDevMode ? [{ debugName: "headerEnd" }] : []));
|
|
24
|
+
/** Emitted when a menu item is clicked */
|
|
25
|
+
menuItemClick = output();
|
|
26
|
+
/** Tracks activeItem input, overridable by user clicks */
|
|
27
|
+
selectedKey = linkedSignal(() => this.activeItem(), ...(ngDevMode ? [{ debugName: "selectedKey" }] : []));
|
|
28
|
+
/** Currently selected menu item */
|
|
29
|
+
selectedItem = computed(() => {
|
|
30
|
+
const key = this.selectedKey();
|
|
31
|
+
const items = this.menuItems();
|
|
32
|
+
if (key) {
|
|
33
|
+
return items.find((item) => item.key === key) ?? items[0] ?? null;
|
|
34
|
+
}
|
|
35
|
+
return items[0] ?? null;
|
|
36
|
+
}, ...(ngDevMode ? [{ debugName: "selectedItem" }] : []));
|
|
37
|
+
/** Whether the initial default selection has been emitted */
|
|
38
|
+
initialEmitted = false;
|
|
39
|
+
constructor() {
|
|
40
|
+
effect(() => {
|
|
41
|
+
const item = this.selectedItem();
|
|
42
|
+
if (item && !this.initialEmitted) {
|
|
43
|
+
this.initialEmitted = true;
|
|
44
|
+
this.menuItemClick.emit(item);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/** Whether the divider/toggle area is being hovered */
|
|
49
|
+
dividerHovered = signal(false, ...(ngDevMode ? [{ debugName: "dividerHovered" }] : []));
|
|
50
|
+
/** Sidebar width reacts to collapsed + hover */
|
|
51
|
+
sidebarWidth = computed(() => {
|
|
52
|
+
if (this.collapsed()) {
|
|
53
|
+
return this.dividerHovered() ? '12px' : '9px';
|
|
54
|
+
}
|
|
55
|
+
return this.dividerHovered() ? '15.8%' : '16%';
|
|
56
|
+
}, ...(ngDevMode ? [{ debugName: "sidebarWidth" }] : []));
|
|
57
|
+
/** Icon for the collapse toggle button */
|
|
58
|
+
toggleIcon = computed(() => this.collapsed() ? 'arrow.chevron-right' : 'arrow.chevron-left', ...(ngDevMode ? [{ debugName: "toggleIcon" }] : []));
|
|
59
|
+
toggleCollapsed() {
|
|
60
|
+
this.collapsed.update((v) => !v);
|
|
61
|
+
}
|
|
62
|
+
selectItem(item) {
|
|
63
|
+
this.selectedKey.set(item.key);
|
|
64
|
+
this.menuItemClick.emit(item);
|
|
65
|
+
}
|
|
66
|
+
getAvatarStyle(color) {
|
|
67
|
+
if (color.startsWith('#')) {
|
|
68
|
+
return {
|
|
69
|
+
'--p-avatar-background': color + '1a',
|
|
70
|
+
'--p-avatar-color': color,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
'--p-avatar-background': `var(--p-${color}-100)`,
|
|
75
|
+
'--p-avatar-color': `var(--p-${color}-700)`,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ClientPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
79
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: ClientPage, isStandalone: true, selector: "mt-client-page", inputs: { menuIcon: { classPropertyName: "menuIcon", publicName: "menuIcon", isSignal: true, isRequired: false, transformFunction: null }, menuTitle: { classPropertyName: "menuTitle", publicName: "menuTitle", isSignal: true, isRequired: false, transformFunction: null }, menuItems: { classPropertyName: "menuItems", publicName: "menuItems", isSignal: true, isRequired: false, transformFunction: null }, menuItemsLoading: { classPropertyName: "menuItemsLoading", publicName: "menuItemsLoading", isSignal: true, isRequired: false, transformFunction: null }, activeItem: { classPropertyName: "activeItem", publicName: "activeItem", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { collapsed: "collapsedChange", menuItemClick: "menuItemClick" }, host: { classAttribute: "block h-full" }, queries: [{ propertyName: "headerEnd", first: true, predicate: ["headerClientPageEnd"], descendants: true, isSignal: true }], ngImport: i0, template: "<mt-card class=\"bg-gray-200 w-full h-full\">\r\n <ng-template #headless>\r\n <div class=\"flex h-full min-h-0\">\r\n <!-- Left Sidebar -->\r\n <div\r\n class=\"flex min-h-0 flex-col overflow-hidden transition-all duration-300 ease-in-out\"\r\n [style.width]=\"sidebarWidth()\"\r\n >\r\n <!-- Sidebar Header -->\r\n <div\r\n class=\"flex shrink-0 items-center justify-between overflow-hidden border-b border-gray-300 px-5 py-4 whitespace-nowrap\"\r\n >\r\n <div class=\"flex gap-2 items-center\">\r\n @if (menuIcon()) {\r\n <div class=\"text-lg shrink-0\">\r\n <mt-icon [icon]=\"menuIcon()!\" />\r\n </div>\r\n }\r\n @if (menuTitle()) {\r\n <div class=\"font-semibold\">{{ menuTitle() }}</div>\r\n }\r\n </div>\r\n </div>\r\n @if (!collapsed()) {\r\n <!-- Menu Items -->\r\n <mt-client-page-menu\r\n [menuItems]=\"menuItems()\"\r\n [selectedItem]=\"selectedItem()\"\r\n [loading]=\"menuItemsLoading()\"\r\n (menuItemClick)=\"selectItem($event)\"\r\n />\r\n }\r\n </div>\r\n\r\n <!-- Vertical Divider with Toggle Button -->\r\n <div\r\n class=\"relative flex-shrink-0 w-px\"\r\n (mouseenter)=\"dividerHovered.set(true)\"\r\n (mouseleave)=\"dividerHovered.set(false)\"\r\n >\r\n <!-- Toggle Button at bottom of divider -->\r\n <button\r\n type=\"button\"\r\n (click)=\"toggleCollapsed()\"\r\n class=\"absolute bottom-6 -translate-x-1/2 left-1/2 z-10 flex items-center justify-center w-6 h-6 rounded-full bg-white border border-gray-300 shadow-sm hover:shadow-md hover:scale-125 hover:bg-gray-50 active:scale-95 active:bg-gray-100 transition-all duration-200 ease-in-out cursor-pointer group\"\r\n [attr.aria-label]=\"\r\n collapsed() ? 'Expand sidebar' : 'Collapse sidebar'\r\n \"\r\n >\r\n <mt-icon\r\n [icon]=\"toggleIcon()\"\r\n class=\"text-gray-500 group-hover:text-primary-600 text-xs transition-all duration-200 group-hover:animate-pulse\"\r\n />\r\n </button>\r\n </div>\r\n\r\n <!-- Right Content Panel -->\r\n <div class=\"flex min-h-0 min-w-0 flex-1 flex-col\">\r\n <mt-card class=\"h-full min-h-0\">\r\n <ng-template #headless>\r\n <!-- Content Header -->\r\n <div\r\n class=\"flex shrink-0 items-center justify-between border-b border-surface px-5 py-4\"\r\n >\r\n <div class=\"flex gap-2 items-center\">\r\n @if (selectedItem(); as selected) {\r\n <mt-avatar\r\n [style]=\"getAvatarStyle(selected.color)\"\r\n [icon]=\"selected.icon\"\r\n shape=\"square\"\r\n size=\"large\"\r\n />\r\n <div>\r\n <div class=\"text-md font-semibold\">\r\n {{ selected.title }}\r\n </div>\r\n @if (selected.subtitle) {\r\n <div class=\"text-sm text-gray-500 font-semibold\">\r\n {{ selected.subtitle }}\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n @if (headerEnd(); as template) {\r\n <div class=\"flex gap-2\">\r\n <ng-container [ngTemplateOutlet]=\"template\" />\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Content Body -->\r\n <div class=\"flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto p-5\">\r\n <ng-content />\r\n </div>\r\n </ng-template>\r\n </mt-card>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</mt-card>\r\n", dependencies: [{ kind: "component", type: Avatar, selector: "mt-avatar", inputs: ["label", "icon", "image", "styleClass", "size", "shape", "badge", "badgeSize", "badgeSeverity"], outputs: ["onImageError"] }, { kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "component", type: ClientPageMenu, selector: "mt-client-page-menu", inputs: ["menuItems", "loading", "selectedItem"], outputs: ["menuItemClick"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
80
|
+
}
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ClientPage, decorators: [{
|
|
82
|
+
type: Component,
|
|
83
|
+
args: [{ selector: 'mt-client-page', standalone: true, imports: [Avatar, Card, ClientPageMenu, Icon, NgTemplateOutlet], host: {
|
|
84
|
+
class: 'block h-full',
|
|
85
|
+
}, template: "<mt-card class=\"bg-gray-200 w-full h-full\">\r\n <ng-template #headless>\r\n <div class=\"flex h-full min-h-0\">\r\n <!-- Left Sidebar -->\r\n <div\r\n class=\"flex min-h-0 flex-col overflow-hidden transition-all duration-300 ease-in-out\"\r\n [style.width]=\"sidebarWidth()\"\r\n >\r\n <!-- Sidebar Header -->\r\n <div\r\n class=\"flex shrink-0 items-center justify-between overflow-hidden border-b border-gray-300 px-5 py-4 whitespace-nowrap\"\r\n >\r\n <div class=\"flex gap-2 items-center\">\r\n @if (menuIcon()) {\r\n <div class=\"text-lg shrink-0\">\r\n <mt-icon [icon]=\"menuIcon()!\" />\r\n </div>\r\n }\r\n @if (menuTitle()) {\r\n <div class=\"font-semibold\">{{ menuTitle() }}</div>\r\n }\r\n </div>\r\n </div>\r\n @if (!collapsed()) {\r\n <!-- Menu Items -->\r\n <mt-client-page-menu\r\n [menuItems]=\"menuItems()\"\r\n [selectedItem]=\"selectedItem()\"\r\n [loading]=\"menuItemsLoading()\"\r\n (menuItemClick)=\"selectItem($event)\"\r\n />\r\n }\r\n </div>\r\n\r\n <!-- Vertical Divider with Toggle Button -->\r\n <div\r\n class=\"relative flex-shrink-0 w-px\"\r\n (mouseenter)=\"dividerHovered.set(true)\"\r\n (mouseleave)=\"dividerHovered.set(false)\"\r\n >\r\n <!-- Toggle Button at bottom of divider -->\r\n <button\r\n type=\"button\"\r\n (click)=\"toggleCollapsed()\"\r\n class=\"absolute bottom-6 -translate-x-1/2 left-1/2 z-10 flex items-center justify-center w-6 h-6 rounded-full bg-white border border-gray-300 shadow-sm hover:shadow-md hover:scale-125 hover:bg-gray-50 active:scale-95 active:bg-gray-100 transition-all duration-200 ease-in-out cursor-pointer group\"\r\n [attr.aria-label]=\"\r\n collapsed() ? 'Expand sidebar' : 'Collapse sidebar'\r\n \"\r\n >\r\n <mt-icon\r\n [icon]=\"toggleIcon()\"\r\n class=\"text-gray-500 group-hover:text-primary-600 text-xs transition-all duration-200 group-hover:animate-pulse\"\r\n />\r\n </button>\r\n </div>\r\n\r\n <!-- Right Content Panel -->\r\n <div class=\"flex min-h-0 min-w-0 flex-1 flex-col\">\r\n <mt-card class=\"h-full min-h-0\">\r\n <ng-template #headless>\r\n <!-- Content Header -->\r\n <div\r\n class=\"flex shrink-0 items-center justify-between border-b border-surface px-5 py-4\"\r\n >\r\n <div class=\"flex gap-2 items-center\">\r\n @if (selectedItem(); as selected) {\r\n <mt-avatar\r\n [style]=\"getAvatarStyle(selected.color)\"\r\n [icon]=\"selected.icon\"\r\n shape=\"square\"\r\n size=\"large\"\r\n />\r\n <div>\r\n <div class=\"text-md font-semibold\">\r\n {{ selected.title }}\r\n </div>\r\n @if (selected.subtitle) {\r\n <div class=\"text-sm text-gray-500 font-semibold\">\r\n {{ selected.subtitle }}\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n @if (headerEnd(); as template) {\r\n <div class=\"flex gap-2\">\r\n <ng-container [ngTemplateOutlet]=\"template\" />\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Content Body -->\r\n <div class=\"flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto p-5\">\r\n <ng-content />\r\n </div>\r\n </ng-template>\r\n </mt-card>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</mt-card>\r\n" }]
|
|
86
|
+
}], ctorParameters: () => [], propDecorators: { menuIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuIcon", required: false }] }], menuTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuTitle", required: false }] }], menuItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuItems", required: false }] }], menuItemsLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuItemsLoading", required: false }] }], activeItem: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeItem", required: false }] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }, { type: i0.Output, args: ["collapsedChange"] }], headerEnd: [{ type: i0.ContentChild, args: ['headerClientPageEnd', { isSignal: true }] }], menuItemClick: [{ type: i0.Output, args: ["menuItemClick"] }] } });
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Generated bundle index. Do not edit.
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
export { ClientPage };
|
|
93
|
+
//# sourceMappingURL=masterteam-components-client-page.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"masterteam-components-client-page.mjs","sources":["../../../../packages/masterteam/components/client-page/client-page.ts","../../../../packages/masterteam/components/client-page/client-page.html","../../../../packages/masterteam/components/client-page/masterteam-components-client-page.ts"],"sourcesContent":["import {\r\n Component,\r\n contentChild,\r\n computed,\r\n effect,\r\n input,\r\n linkedSignal,\r\n model,\r\n output,\r\n signal,\r\n TemplateRef,\r\n} from '@angular/core';\r\nimport { NgTemplateOutlet } from '@angular/common';\r\nimport { Avatar } from '@masterteam/components/avatar';\r\nimport { Card } from '@masterteam/components/card';\r\nimport {\r\n ClientPageMenu,\r\n ClientPageMenuItem,\r\n} from '@masterteam/components/client-page-menu';\r\nimport { Icon } from '@masterteam/icons';\r\n\r\n@Component({\r\n selector: 'mt-client-page',\r\n standalone: true,\r\n imports: [Avatar, Card, ClientPageMenu, Icon, NgTemplateOutlet],\r\n templateUrl: './client-page.html',\r\n host: {\r\n class: 'block h-full',\r\n },\r\n})\r\nexport class ClientPage {\r\n /** Icon for the left sidebar header */\r\n readonly menuIcon = input<string>();\r\n\r\n /** Title for the left sidebar header */\r\n readonly menuTitle = input<string>();\r\n\r\n /** List of menu items for the left sidebar */\r\n readonly menuItems = input<ClientPageMenuItem[]>([]);\r\n\r\n /** Whether menu items are loading */\r\n readonly menuItemsLoading = input<boolean>(false);\r\n\r\n /** Key of the active menu item (defaults to first item) */\r\n readonly activeItem = input<string>();\r\n\r\n /** Whether the sidebar menu is collapsed (two-way bindable) */\r\n readonly collapsed = model<boolean>(false);\r\n\r\n /** Template projected into the left sidebar header end */\r\n readonly headerEnd = contentChild<TemplateRef<any>>('headerClientPageEnd');\r\n\r\n /** Emitted when a menu item is clicked */\r\n readonly menuItemClick = output<ClientPageMenuItem>();\r\n\r\n /** Tracks activeItem input, overridable by user clicks */\r\n private readonly selectedKey = linkedSignal(() => this.activeItem());\r\n\r\n /** Currently selected menu item */\r\n readonly selectedItem = computed(() => {\r\n const key = this.selectedKey();\r\n const items = this.menuItems();\r\n if (key) {\r\n return items.find((item) => item.key === key) ?? items[0] ?? null;\r\n }\r\n return items[0] ?? null;\r\n });\r\n\r\n /** Whether the initial default selection has been emitted */\r\n private initialEmitted = false;\r\n\r\n constructor() {\r\n effect(() => {\r\n const item = this.selectedItem();\r\n if (item && !this.initialEmitted) {\r\n this.initialEmitted = true;\r\n this.menuItemClick.emit(item);\r\n }\r\n });\r\n }\r\n\r\n /** Whether the divider/toggle area is being hovered */\r\n readonly dividerHovered = signal(false);\r\n\r\n /** Sidebar width reacts to collapsed + hover */\r\n readonly sidebarWidth = computed(() => {\r\n if (this.collapsed()) {\r\n return this.dividerHovered() ? '12px' : '9px';\r\n }\r\n return this.dividerHovered() ? '15.8%' : '16%';\r\n });\r\n\r\n /** Icon for the collapse toggle button */\r\n readonly toggleIcon = computed(() =>\r\n this.collapsed() ? 'arrow.chevron-right' : 'arrow.chevron-left',\r\n );\r\n\r\n toggleCollapsed(): void {\r\n this.collapsed.update((v) => !v);\r\n }\r\n\r\n selectItem(item: ClientPageMenuItem): void {\r\n this.selectedKey.set(item.key);\r\n this.menuItemClick.emit(item);\r\n }\r\n\r\n getAvatarStyle(color: string): Record<string, string> {\r\n if (color.startsWith('#')) {\r\n return {\r\n '--p-avatar-background': color + '1a',\r\n '--p-avatar-color': color,\r\n };\r\n }\r\n return {\r\n '--p-avatar-background': `var(--p-${color}-100)`,\r\n '--p-avatar-color': `var(--p-${color}-700)`,\r\n };\r\n }\r\n}\r\n","<mt-card class=\"bg-gray-200 w-full h-full\">\r\n <ng-template #headless>\r\n <div class=\"flex h-full min-h-0\">\r\n <!-- Left Sidebar -->\r\n <div\r\n class=\"flex min-h-0 flex-col overflow-hidden transition-all duration-300 ease-in-out\"\r\n [style.width]=\"sidebarWidth()\"\r\n >\r\n <!-- Sidebar Header -->\r\n <div\r\n class=\"flex shrink-0 items-center justify-between overflow-hidden border-b border-gray-300 px-5 py-4 whitespace-nowrap\"\r\n >\r\n <div class=\"flex gap-2 items-center\">\r\n @if (menuIcon()) {\r\n <div class=\"text-lg shrink-0\">\r\n <mt-icon [icon]=\"menuIcon()!\" />\r\n </div>\r\n }\r\n @if (menuTitle()) {\r\n <div class=\"font-semibold\">{{ menuTitle() }}</div>\r\n }\r\n </div>\r\n </div>\r\n @if (!collapsed()) {\r\n <!-- Menu Items -->\r\n <mt-client-page-menu\r\n [menuItems]=\"menuItems()\"\r\n [selectedItem]=\"selectedItem()\"\r\n [loading]=\"menuItemsLoading()\"\r\n (menuItemClick)=\"selectItem($event)\"\r\n />\r\n }\r\n </div>\r\n\r\n <!-- Vertical Divider with Toggle Button -->\r\n <div\r\n class=\"relative flex-shrink-0 w-px\"\r\n (mouseenter)=\"dividerHovered.set(true)\"\r\n (mouseleave)=\"dividerHovered.set(false)\"\r\n >\r\n <!-- Toggle Button at bottom of divider -->\r\n <button\r\n type=\"button\"\r\n (click)=\"toggleCollapsed()\"\r\n class=\"absolute bottom-6 -translate-x-1/2 left-1/2 z-10 flex items-center justify-center w-6 h-6 rounded-full bg-white border border-gray-300 shadow-sm hover:shadow-md hover:scale-125 hover:bg-gray-50 active:scale-95 active:bg-gray-100 transition-all duration-200 ease-in-out cursor-pointer group\"\r\n [attr.aria-label]=\"\r\n collapsed() ? 'Expand sidebar' : 'Collapse sidebar'\r\n \"\r\n >\r\n <mt-icon\r\n [icon]=\"toggleIcon()\"\r\n class=\"text-gray-500 group-hover:text-primary-600 text-xs transition-all duration-200 group-hover:animate-pulse\"\r\n />\r\n </button>\r\n </div>\r\n\r\n <!-- Right Content Panel -->\r\n <div class=\"flex min-h-0 min-w-0 flex-1 flex-col\">\r\n <mt-card class=\"h-full min-h-0\">\r\n <ng-template #headless>\r\n <!-- Content Header -->\r\n <div\r\n class=\"flex shrink-0 items-center justify-between border-b border-surface px-5 py-4\"\r\n >\r\n <div class=\"flex gap-2 items-center\">\r\n @if (selectedItem(); as selected) {\r\n <mt-avatar\r\n [style]=\"getAvatarStyle(selected.color)\"\r\n [icon]=\"selected.icon\"\r\n shape=\"square\"\r\n size=\"large\"\r\n />\r\n <div>\r\n <div class=\"text-md font-semibold\">\r\n {{ selected.title }}\r\n </div>\r\n @if (selected.subtitle) {\r\n <div class=\"text-sm text-gray-500 font-semibold\">\r\n {{ selected.subtitle }}\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n @if (headerEnd(); as template) {\r\n <div class=\"flex gap-2\">\r\n <ng-container [ngTemplateOutlet]=\"template\" />\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Content Body -->\r\n <div class=\"flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto p-5\">\r\n <ng-content />\r\n </div>\r\n </ng-template>\r\n </mt-card>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</mt-card>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MA8Ba,UAAU,CAAA;;IAEZ,QAAQ,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,UAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;;IAG1B,SAAS,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;;AAG3B,IAAA,SAAS,GAAG,KAAK,CAAuB,EAAE,qDAAC;;AAG3C,IAAA,gBAAgB,GAAG,KAAK,CAAU,KAAK,4DAAC;;IAGxC,UAAU,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;;AAG5B,IAAA,SAAS,GAAG,KAAK,CAAU,KAAK,qDAAC;;AAGjC,IAAA,SAAS,GAAG,YAAY,CAAmB,qBAAqB,qDAAC;;IAGjE,aAAa,GAAG,MAAM,EAAsB;;IAGpC,WAAW,GAAG,YAAY,CAAC,MAAM,IAAI,CAAC,UAAU,EAAE,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAC;;AAG3D,IAAA,YAAY,GAAG,QAAQ,CAAC,MAAK;AACpC,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,EAAE;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AA,EAAA,IAAA,EAAE,IAAI,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,MAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,gBAAgB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAMnD,UAAU,EAAA,UAAA,EAAA,CAAA;kBATtB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,UAAA,EACd,IAAI,EAAA,OAAA,EACP,CAAC,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,gBAAgB,CAAC,EAAA,IAAA,EAEzD;AACJ,wBAAA,KAAK,EAAE,cAAc;AACtB,qBAAA,EAAA,QAAA,EAAA,m9HAAA,EAAA;8uBAsBmD,qBAAqB,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,eAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AElD3E;;AAEG;;;;"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, output, inject, signal, effect, ViewChild, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { NgControl, Validators, FormsModule } from '@angular/forms';
|
|
5
|
+
import * as i2 from 'primeng/colorpicker';
|
|
6
|
+
import { ColorPickerModule } from 'primeng/colorpicker';
|
|
7
|
+
import { FieldValidation } from '@masterteam/components/field-validation';
|
|
8
|
+
import { TextField } from '@masterteam/components/text-field';
|
|
9
|
+
import { isInvalid } from '@masterteam/components';
|
|
10
|
+
|
|
11
|
+
class ColorPickerField {
|
|
12
|
+
colorPicker;
|
|
13
|
+
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
14
|
+
appendTo = input('body', ...(ngDevMode ? [{ debugName: "appendTo" }] : []));
|
|
15
|
+
placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : []));
|
|
16
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
17
|
+
variant = input('outlined', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
18
|
+
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : []));
|
|
19
|
+
pInputs = input(...(ngDevMode ? [undefined, { debugName: "pInputs" }] : []));
|
|
20
|
+
required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : []));
|
|
21
|
+
onChange = output();
|
|
22
|
+
ngControl = inject(NgControl, { self: true });
|
|
23
|
+
requiredValidator = Validators.required;
|
|
24
|
+
value = signal(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
25
|
+
disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
26
|
+
onTouched = () => { };
|
|
27
|
+
onModelChange = () => { };
|
|
28
|
+
isInvalid = isInvalid;
|
|
29
|
+
constructor() {
|
|
30
|
+
if (this.ngControl) {
|
|
31
|
+
this.ngControl.valueAccessor = this;
|
|
32
|
+
}
|
|
33
|
+
// Effect to apply pInputs reactively when the pInputs signal changes
|
|
34
|
+
effect(() => {
|
|
35
|
+
const currentPInputs = this.pInputs();
|
|
36
|
+
// Ensure colorPicker ViewChild is initialized and pInputs has a value
|
|
37
|
+
// @ViewChild with static: true makes 'colorPicker' available during construction/ngOnInit
|
|
38
|
+
if (this.colorPicker && currentPInputs) {
|
|
39
|
+
this.applyInputsToColorPicker();
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
// Effect to add required validator if required input is true
|
|
43
|
+
effect(() => {
|
|
44
|
+
if (this.ngControl.control && this.required()) {
|
|
45
|
+
this.ngControl.control.addValidators(Validators.required);
|
|
46
|
+
this.ngControl.control.updateValueAndValidity();
|
|
47
|
+
}
|
|
48
|
+
if (this.ngControl.control) {
|
|
49
|
+
this.ngControl.control.addValidators(Validators.pattern(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/));
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
applyInputsToColorPicker() {
|
|
54
|
+
const currentPInputs = this.pInputs();
|
|
55
|
+
if (currentPInputs) {
|
|
56
|
+
Object.assign(this.colorPicker, currentPInputs);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
onValueChange(value) {
|
|
60
|
+
this.onModelChange(value);
|
|
61
|
+
this.onTouched();
|
|
62
|
+
this.value.set(value);
|
|
63
|
+
}
|
|
64
|
+
writeValue(value) {
|
|
65
|
+
this.value.set(value);
|
|
66
|
+
}
|
|
67
|
+
registerOnChange(fn) {
|
|
68
|
+
this.onModelChange = fn;
|
|
69
|
+
}
|
|
70
|
+
registerOnTouched(fn) {
|
|
71
|
+
this.onTouched = fn;
|
|
72
|
+
}
|
|
73
|
+
setDisabledState(disabled) {
|
|
74
|
+
this.disabled.set(disabled);
|
|
75
|
+
}
|
|
76
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ColorPickerField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
77
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: ColorPickerField, isStandalone: true, selector: "mt-color-picker-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, pInputs: { classPropertyName: "pInputs", publicName: "pInputs", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onChange: "onChange" }, host: { properties: { "class": "class()" } }, viewQueries: [{ propertyName: "colorPicker", first: true, predicate: ["colorPicker"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"flex flex-col gap-1 min-w-full\">\r\n @if (label()) {\r\n <label\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"ngControl?.name || label()\"\r\n >{{ label() }}</label\r\n >\r\n }\r\n <div\r\n class=\"flex items-center hover:border-(--p-inputtext-hover-border-color)! p-inputtext\"\r\n [class.bg-(--p-inputtext-filled-background)]=\"variant() === 'filled'\"\r\n [class.border-(--p-inputtext-invalid-border-color)!]=\"\r\n ngControl?.control?.invalid && ngControl?.control?.touched\r\n \"\r\n >\r\n <p-colorpicker\r\n #colorPicker=\"\"\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"onValueChange($event)\"\r\n (onChange)=\"onChange.emit($event)\"\r\n (blur)=\"onTouched()\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [inputId]=\"ngControl?.name ? ngControl?.name?.toString() : label()\"\r\n [class.ng-invalid]=\"ngControl?.control?.invalid\"\r\n class=\"leading-none\"\r\n [appendTo]=\"appendTo()\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n ></p-colorpicker>\r\n <div class=\"ms-2 w-full min-w-0\">\r\n <mt-text-field\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"onValueChange($event)\"\r\n (change)=\"onChange.emit($event)\"\r\n (blur)=\"onTouched()\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [class.ng-invalid]=\"ngControl?.control?.invalid\"\r\n placeholder=\"Select Color\"\r\n class=\"leading-none p-0 input-no-border px-0 w-full\"\r\n hint=\"Should be a hex color code, e.g. #ff5733 or #f00\"\r\n ></mt-text-field>\r\n </div>\r\n </div>\r\n <mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n</div>\r\n", styles: [":host{display:flex;align-items:center}::ng-deep .input-no-border .p-component{border:none;box-shadow:none;background-color:transparent;width:100%}::ng-deep .input-no-border .p-inputgroupaddon{border-inline:none;border-block-start:none;border-block-end:none;padding:0!important}::ng-deep .input-no-border .p-inputgroupaddon:last-child{border-inline-end:none}::ng-deep .p-inputtext .p-inputtext{padding:0!important}\n"], dependencies: [{ 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: "ngmodule", type: ColorPickerModule }, { kind: "component", type: i2.ColorPicker, selector: "p-colorPicker, p-colorpicker, p-color-picker", inputs: ["styleClass", "showTransitionOptions", "hideTransitionOptions", "inline", "format", "tabindex", "inputId", "autoZIndex", "autofocus", "defaultColor", "appendTo", "overlayOptions", "motionOptions"], outputs: ["onChange", "onShow", "onHide"] }, { kind: "component", type: FieldValidation, selector: "mt-field-validation", inputs: ["control", "touched"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "icon", "iconPosition"] }] });
|
|
78
|
+
}
|
|
79
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ColorPickerField, decorators: [{
|
|
80
|
+
type: Component,
|
|
81
|
+
args: [{ selector: 'mt-color-picker-field', standalone: true, imports: [FormsModule, ColorPickerModule, FieldValidation, TextField], host: {
|
|
82
|
+
'[class]': 'class()',
|
|
83
|
+
}, template: "<div class=\"flex flex-col gap-1 min-w-full\">\r\n @if (label()) {\r\n <label\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"ngControl?.name || label()\"\r\n >{{ label() }}</label\r\n >\r\n }\r\n <div\r\n class=\"flex items-center hover:border-(--p-inputtext-hover-border-color)! p-inputtext\"\r\n [class.bg-(--p-inputtext-filled-background)]=\"variant() === 'filled'\"\r\n [class.border-(--p-inputtext-invalid-border-color)!]=\"\r\n ngControl?.control?.invalid && ngControl?.control?.touched\r\n \"\r\n >\r\n <p-colorpicker\r\n #colorPicker=\"\"\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"onValueChange($event)\"\r\n (onChange)=\"onChange.emit($event)\"\r\n (blur)=\"onTouched()\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [inputId]=\"ngControl?.name ? ngControl?.name?.toString() : label()\"\r\n [class.ng-invalid]=\"ngControl?.control?.invalid\"\r\n class=\"leading-none\"\r\n [appendTo]=\"appendTo()\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n ></p-colorpicker>\r\n <div class=\"ms-2 w-full min-w-0\">\r\n <mt-text-field\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"onValueChange($event)\"\r\n (change)=\"onChange.emit($event)\"\r\n (blur)=\"onTouched()\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [class.ng-invalid]=\"ngControl?.control?.invalid\"\r\n placeholder=\"Select Color\"\r\n class=\"leading-none p-0 input-no-border px-0 w-full\"\r\n hint=\"Should be a hex color code, e.g. #ff5733 or #f00\"\r\n ></mt-text-field>\r\n </div>\r\n </div>\r\n <mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n</div>\r\n", styles: [":host{display:flex;align-items:center}::ng-deep .input-no-border .p-component{border:none;box-shadow:none;background-color:transparent;width:100%}::ng-deep .input-no-border .p-inputgroupaddon{border-inline:none;border-block-start:none;border-block-end:none;padding:0!important}::ng-deep .input-no-border .p-inputgroupaddon:last-child{border-inline-end:none}::ng-deep .p-inputtext .p-inputtext{padding:0!important}\n"] }]
|
|
84
|
+
}], ctorParameters: () => [], propDecorators: { colorPicker: [{
|
|
85
|
+
type: ViewChild,
|
|
86
|
+
args: ['colorPicker', { static: true }]
|
|
87
|
+
}], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], appendTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "appendTo", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], pInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "pInputs", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], onChange: [{ type: i0.Output, args: ["onChange"] }] } });
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Generated bundle index. Do not edit.
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
export { ColorPickerField };
|
|
94
|
+
//# sourceMappingURL=masterteam-components-color-picker-field.mjs.map
|
package/.codex-tmp-pack/extract/package/fesm2022/masterteam-components-color-picker-field.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"masterteam-components-color-picker-field.mjs","sources":["../../../../packages/masterteam/components/color-picker-field/color-picker-field.ts","../../../../packages/masterteam/components/color-picker-field/color-picker-field.html","../../../../packages/masterteam/components/color-picker-field/masterteam-components-color-picker-field.ts"],"sourcesContent":["import {\r\n Component,\r\n ViewChild,\r\n signal,\r\n input,\r\n output,\r\n inject,\r\n effect,\r\n} from '@angular/core';\r\nimport {\r\n ControlValueAccessor,\r\n FormsModule,\r\n NgControl,\r\n Validators,\r\n} from '@angular/forms';\r\nimport {\r\n ColorPickerModule,\r\n ColorPicker,\r\n ColorPickerChangeEvent,\r\n} from 'primeng/colorpicker';\r\nimport { FieldValidation } from '@masterteam/components/field-validation';\r\nimport { TextField } from '@masterteam/components/text-field';\r\nimport { isInvalid } from '@masterteam/components';\r\n\r\n@Component({\r\n selector: 'mt-color-picker-field',\r\n standalone: true,\r\n imports: [FormsModule, ColorPickerModule, FieldValidation, TextField],\r\n templateUrl: './color-picker-field.html',\r\n styleUrls: ['./color-picker-field.scss'],\r\n host: {\r\n '[class]': 'class()',\r\n },\r\n})\r\nexport class ColorPickerField implements ControlValueAccessor {\r\n @ViewChild('colorPicker', { static: true })\r\n colorPicker: ColorPicker;\r\n label = input<string>();\r\n appendTo = input<string>('body');\r\n placeholder = input<string>();\r\n class = input<string>('');\r\n variant = input<'outlined' | 'filled'>('outlined');\r\n readonly = input<boolean>(false);\r\n pInputs = input<Partial<ColorPicker>>();\r\n required = input<boolean>(false);\r\n\r\n onChange = output<ColorPickerChangeEvent>();\r\n\r\n public ngControl = inject(NgControl, { self: true });\r\n\r\n requiredValidator = Validators.required;\r\n value = signal<string | null>(null);\r\n disabled = signal<boolean>(false);\r\n\r\n onTouched: () => void = () => {};\r\n onModelChange: (value: string | null) => void = () => {};\r\n isInvalid = isInvalid;\r\n\r\n constructor() {\r\n if (this.ngControl) {\r\n this.ngControl.valueAccessor = this;\r\n }\r\n\r\n // Effect to apply pInputs reactively when the pInputs signal changes\r\n effect(() => {\r\n const currentPInputs = this.pInputs();\r\n // Ensure colorPicker ViewChild is initialized and pInputs has a value\r\n // @ViewChild with static: true makes 'colorPicker' available during construction/ngOnInit\r\n if (this.colorPicker && currentPInputs) {\r\n this.applyInputsToColorPicker();\r\n }\r\n });\r\n\r\n // Effect to add required validator if required input is true\r\n effect(() => {\r\n if (this.ngControl.control && this.required()) {\r\n this.ngControl.control.addValidators(Validators.required);\r\n this.ngControl.control.updateValueAndValidity();\r\n }\r\n if (this.ngControl.control) {\r\n this.ngControl.control.addValidators(\r\n Validators.pattern(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/),\r\n );\r\n }\r\n });\r\n }\r\n\r\n applyInputsToColorPicker() {\r\n const currentPInputs = this.pInputs();\r\n if (currentPInputs) {\r\n Object.assign(this.colorPicker, currentPInputs);\r\n }\r\n }\r\n\r\n onValueChange(value: string | null) {\r\n this.onModelChange(value);\r\n this.onTouched();\r\n this.value.set(value);\r\n }\r\n\r\n writeValue(value: string | null) {\r\n this.value.set(value);\r\n }\r\n\r\n registerOnChange(fn: any) {\r\n this.onModelChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: any) {\r\n this.onTouched = fn;\r\n }\r\n\r\n setDisabledState(disabled: boolean) {\r\n this.disabled.set(disabled);\r\n }\r\n}\r\n","<div class=\"flex flex-col gap-1 min-w-full\">\r\n @if (label()) {\r\n <label\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"ngControl?.name || label()\"\r\n >{{ label() }}</label\r\n >\r\n }\r\n <div\r\n class=\"flex items-center hover:border-(--p-inputtext-hover-border-color)! p-inputtext\"\r\n [class.bg-(--p-inputtext-filled-background)]=\"variant() === 'filled'\"\r\n [class.border-(--p-inputtext-invalid-border-color)!]=\"\r\n ngControl?.control?.invalid && ngControl?.control?.touched\r\n \"\r\n >\r\n <p-colorpicker\r\n #colorPicker=\"\"\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"onValueChange($event)\"\r\n (onChange)=\"onChange.emit($event)\"\r\n (blur)=\"onTouched()\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [inputId]=\"ngControl?.name ? ngControl?.name?.toString() : label()\"\r\n [class.ng-invalid]=\"ngControl?.control?.invalid\"\r\n class=\"leading-none\"\r\n [appendTo]=\"appendTo()\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n ></p-colorpicker>\r\n <div class=\"ms-2 w-full min-w-0\">\r\n <mt-text-field\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"onValueChange($event)\"\r\n (change)=\"onChange.emit($event)\"\r\n (blur)=\"onTouched()\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [class.ng-invalid]=\"ngControl?.control?.invalid\"\r\n placeholder=\"Select Color\"\r\n class=\"leading-none p-0 input-no-border px-0 w-full\"\r\n hint=\"Should be a hex color code, e.g. #ff5733 or #f00\"\r\n ></mt-text-field>\r\n </div>\r\n </div>\r\n <mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MAkCa,gBAAgB,CAAA;AAE3B,IAAA,WAAW;IACX,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;AACvB,IAAA,QAAQ,GAAG,KAAK,CAAS,MAAM,oDAAC;IAChC,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;AAC7B,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,iDAAC;AACzB,IAAA,OAAO,GAAG,KAAK,CAAwB,UAAU,mDAAC;AAClD,IAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,oDAAC;IAChC,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAwB;AACvC,IAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,oDAAC;IAEhC,QAAQ,GAAG,MAAM,EAA0B;IAEpC,SAAS,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAEpD,IAAA,iBAAiB,GAAG,UAAU,CAAC,QAAQ;AACvC,IAAA,KAAK,GAAG,MAAM,CAAgB,IAAI,iDAAC;AACnC,IAAA,QAAQ,GAAG,MAAM,CAAU,KAAK,oDAAC;AAEjC,IAAA,SAAS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AA,gBAAA,EAAA,eAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,EAAA,QAAA,EAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,eAAe,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,SAAS,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,MAAA,EAAA,OAAA,EAAA,aAAA,EAAA,OAAA,EAAA,MAAA,EAAA,UAAA,EAAA,SAAA,EAAA,UAAA,EAAA,MAAA,EAAA,cAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAOzD,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAV5B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,uBAAuB,EAAA,UAAA,EACrB,IAAI,EAAA,OAAA,EACP,CAAC,WAAW,EAAE,iBAAiB,EAAE,eAAe,EAAE,SAAS,CAAC,EAAA,IAAA,EAG/D;AACJ,wBAAA,SAAS,EAAE,SAAS;AACrB,qBAAA,EAAA,QAAA,EAAA,2wDAAA,EAAA,MAAA,EAAA,CAAA,iaAAA,CAAA,EAAA;;sBAGA,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;;AEnC5C;;AAEG;;;;"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, signal, Injectable, Component } from '@angular/core';
|
|
3
|
+
import { ConfirmationService as ConfirmationService$1 } from 'primeng/api';
|
|
4
|
+
import { TranslocoService } from '@jsverse/transloco';
|
|
5
|
+
import * as i1 from '@angular/common';
|
|
6
|
+
import { CommonModule } from '@angular/common';
|
|
7
|
+
import { ConfirmDialog } from 'primeng/confirmdialog';
|
|
8
|
+
import { Button } from '@masterteam/components/button';
|
|
9
|
+
import { Icon } from '@masterteam/icons';
|
|
10
|
+
import { ConfirmPopup } from 'primeng/confirmpopup';
|
|
11
|
+
|
|
12
|
+
class ConfirmationService {
|
|
13
|
+
confirmationService = inject(ConfirmationService$1);
|
|
14
|
+
transloco = inject(TranslocoService);
|
|
15
|
+
defaultConfig = {
|
|
16
|
+
header: this.transloco.translate('components.confirmation.header'),
|
|
17
|
+
message: this.transloco.translate('components.confirmation.message'),
|
|
18
|
+
icon: 'alert.alert-triangle',
|
|
19
|
+
acceptLabel: this.transloco.translate('components.confirmation.yes'),
|
|
20
|
+
rejectLabel: this.transloco.translate('components.confirmation.cancel'),
|
|
21
|
+
acceptButton: {
|
|
22
|
+
severity: 'primary',
|
|
23
|
+
variant: undefined,
|
|
24
|
+
},
|
|
25
|
+
rejectButton: {
|
|
26
|
+
severity: 'secondary',
|
|
27
|
+
variant: 'text',
|
|
28
|
+
},
|
|
29
|
+
position: 'center',
|
|
30
|
+
type: 'dialog',
|
|
31
|
+
closeOnEscape: true,
|
|
32
|
+
dismissableMask: true,
|
|
33
|
+
draggable: false,
|
|
34
|
+
};
|
|
35
|
+
popupKey = signal('', ...(ngDevMode ? [{ debugName: "popupKey" }] : []));
|
|
36
|
+
lastTarget = null;
|
|
37
|
+
confirm(config) {
|
|
38
|
+
const currentTarget = config?.event?.currentTarget;
|
|
39
|
+
this.popupKey.update((prev) => {
|
|
40
|
+
if (config.type === 'popup') {
|
|
41
|
+
if (this.lastTarget === currentTarget) {
|
|
42
|
+
return prev || 'popup1';
|
|
43
|
+
}
|
|
44
|
+
return prev === 'popup1' ? 'popup2' : 'popup1';
|
|
45
|
+
}
|
|
46
|
+
return config.type;
|
|
47
|
+
});
|
|
48
|
+
this.lastTarget = currentTarget ?? null;
|
|
49
|
+
this.confirmationService.close();
|
|
50
|
+
const mergedConfig = {
|
|
51
|
+
...this.defaultConfig,
|
|
52
|
+
...config,
|
|
53
|
+
target: currentTarget,
|
|
54
|
+
key: this.popupKey(),
|
|
55
|
+
};
|
|
56
|
+
this.confirmationService.confirm(mergedConfig);
|
|
57
|
+
}
|
|
58
|
+
confirmDelete(config) {
|
|
59
|
+
this.confirm({
|
|
60
|
+
message: this.transloco.translate('components.confirmation.deleteMessage'),
|
|
61
|
+
header: this.transloco.translate('components.confirmation.deleteHeader'),
|
|
62
|
+
icon: 'general.trash-01',
|
|
63
|
+
acceptLabel: this.transloco.translate('components.confirmation.delete'),
|
|
64
|
+
rejectLabel: this.transloco.translate('components.confirmation.cancel'),
|
|
65
|
+
acceptButton: {
|
|
66
|
+
severity: 'danger',
|
|
67
|
+
},
|
|
68
|
+
...config,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ConfirmationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
72
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ConfirmationService, providedIn: 'root' });
|
|
73
|
+
}
|
|
74
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ConfirmationService, decorators: [{
|
|
75
|
+
type: Injectable,
|
|
76
|
+
args: [{ providedIn: 'root' }]
|
|
77
|
+
}] });
|
|
78
|
+
|
|
79
|
+
class ConfirmationDialog {
|
|
80
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ConfirmationDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
81
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.3", type: ConfirmationDialog, isStandalone: true, selector: "mt-confirmation-dialog", ngImport: i0, template: "<ng-template #popupTemplate let-key=\"key\">\r\n <p-confirmpopup #cp [key]=\"key\">\r\n <ng-template #headless let-data>\r\n <div class=\"flex items-center gap-2 p-3 min-w-100\">\r\n <div class=\"text-3xl mb-2\">\r\n <mt-icon [icon]=\"data.icon\"></mt-icon>\r\n </div>\r\n <div>{{ data.message }}</div>\r\n </div>\r\n\r\n <div class=\"flex items-center justify-end gap-2 p-3 pt-0\">\r\n <mt-button\r\n [label]=\"data.acceptLabel\"\r\n [styleClass]=\"data.acceptButtonStyleClass\"\r\n [severity]=\"data.acceptButton.severity\"\r\n [variant]=\"data.acceptButton.variant\"\r\n size=\"small\"\r\n (onClick)=\"cp.onAccept()\"\r\n ></mt-button>\r\n <mt-button\r\n [label]=\"data.rejectLabel\"\r\n [severity]=\"data.rejectButton.severity\"\r\n [variant]=\"data.rejectButton.variant\"\r\n size=\"small\"\r\n (onClick)=\"cp.onReject()\"\r\n ></mt-button>\r\n </div>\r\n </ng-template>\r\n </p-confirmpopup>\r\n</ng-template>\r\n\r\n<ng-container\r\n *ngTemplateOutlet=\"popupTemplate; context: { key: 'popup1' }\"\r\n></ng-container>\r\n<ng-container\r\n *ngTemplateOutlet=\"popupTemplate; context: { key: 'popup2' }\"\r\n></ng-container>\r\n\r\n<p-confirmdialog [key]=\"'dialog'\">\r\n <ng-template\r\n #headless\r\n let-data\r\n let-onAccept=\"onAccept\"\r\n let-onReject=\"onReject\"\r\n >\r\n <div\r\n class=\"flex items-center justify-between bg-surface-100 rounded-t-xl px-4 py-2\"\r\n >\r\n <div class=\"text-xl font-semibold\">{{ data.header }}</div>\r\n <mt-button\r\n [icon]=\"'general.x-close'\"\r\n variant=\"text\"\r\n severity=\"secondary\"\r\n styleClass=\"text-8xl\"\r\n size=\"large\"\r\n (onClick)=\"onReject()\"\r\n ></mt-button>\r\n </div>\r\n\r\n <div class=\"flex items-center gap-2 p-4 min-w-100\">\r\n <div class=\"text-3xl mb-2\">\r\n <mt-icon [icon]=\"data.icon\"></mt-icon>\r\n </div>\r\n <div>{{ data.message }}</div>\r\n </div>\r\n\r\n <div class=\"flex items-center justify-end gap-2 mt-2 p-4\">\r\n <mt-button\r\n [label]=\"data.acceptLabel\"\r\n [styleClass]=\"data.acceptButtonStyleClass\"\r\n [severity]=\"data.acceptButton.severity\"\r\n [variant]=\"data.acceptButton.variant\"\r\n (onClick)=\"onAccept()\"\r\n ></mt-button>\r\n <mt-button\r\n [label]=\"data.rejectLabel\"\r\n [severity]=\"data.rejectButton.severity\"\r\n [variant]=\"data.rejectButton.variant\"\r\n (onClick)=\"onReject()\"\r\n ></mt-button>\r\n </div>\r\n </ng-template>\r\n</p-confirmdialog>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ConfirmDialog, selector: "p-confirmDialog, p-confirmdialog, p-confirm-dialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "closeAriaLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "modal", "visible", "position", "draggable"], outputs: ["onHide"] }, { 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: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: ConfirmPopup, selector: "p-confirmpopup", inputs: ["key", "defaultFocus", "showTransitionOptions", "hideTransitionOptions", "autoZIndex", "baseZIndex", "style", "styleClass", "visible", "motionOptions", "appendTo"] }] });
|
|
82
|
+
}
|
|
83
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ConfirmationDialog, decorators: [{
|
|
84
|
+
type: Component,
|
|
85
|
+
args: [{ selector: 'mt-confirmation-dialog', standalone: true, imports: [CommonModule, ConfirmDialog, Button, Icon, ConfirmPopup], template: "<ng-template #popupTemplate let-key=\"key\">\r\n <p-confirmpopup #cp [key]=\"key\">\r\n <ng-template #headless let-data>\r\n <div class=\"flex items-center gap-2 p-3 min-w-100\">\r\n <div class=\"text-3xl mb-2\">\r\n <mt-icon [icon]=\"data.icon\"></mt-icon>\r\n </div>\r\n <div>{{ data.message }}</div>\r\n </div>\r\n\r\n <div class=\"flex items-center justify-end gap-2 p-3 pt-0\">\r\n <mt-button\r\n [label]=\"data.acceptLabel\"\r\n [styleClass]=\"data.acceptButtonStyleClass\"\r\n [severity]=\"data.acceptButton.severity\"\r\n [variant]=\"data.acceptButton.variant\"\r\n size=\"small\"\r\n (onClick)=\"cp.onAccept()\"\r\n ></mt-button>\r\n <mt-button\r\n [label]=\"data.rejectLabel\"\r\n [severity]=\"data.rejectButton.severity\"\r\n [variant]=\"data.rejectButton.variant\"\r\n size=\"small\"\r\n (onClick)=\"cp.onReject()\"\r\n ></mt-button>\r\n </div>\r\n </ng-template>\r\n </p-confirmpopup>\r\n</ng-template>\r\n\r\n<ng-container\r\n *ngTemplateOutlet=\"popupTemplate; context: { key: 'popup1' }\"\r\n></ng-container>\r\n<ng-container\r\n *ngTemplateOutlet=\"popupTemplate; context: { key: 'popup2' }\"\r\n></ng-container>\r\n\r\n<p-confirmdialog [key]=\"'dialog'\">\r\n <ng-template\r\n #headless\r\n let-data\r\n let-onAccept=\"onAccept\"\r\n let-onReject=\"onReject\"\r\n >\r\n <div\r\n class=\"flex items-center justify-between bg-surface-100 rounded-t-xl px-4 py-2\"\r\n >\r\n <div class=\"text-xl font-semibold\">{{ data.header }}</div>\r\n <mt-button\r\n [icon]=\"'general.x-close'\"\r\n variant=\"text\"\r\n severity=\"secondary\"\r\n styleClass=\"text-8xl\"\r\n size=\"large\"\r\n (onClick)=\"onReject()\"\r\n ></mt-button>\r\n </div>\r\n\r\n <div class=\"flex items-center gap-2 p-4 min-w-100\">\r\n <div class=\"text-3xl mb-2\">\r\n <mt-icon [icon]=\"data.icon\"></mt-icon>\r\n </div>\r\n <div>{{ data.message }}</div>\r\n </div>\r\n\r\n <div class=\"flex items-center justify-end gap-2 mt-2 p-4\">\r\n <mt-button\r\n [label]=\"data.acceptLabel\"\r\n [styleClass]=\"data.acceptButtonStyleClass\"\r\n [severity]=\"data.acceptButton.severity\"\r\n [variant]=\"data.acceptButton.variant\"\r\n (onClick)=\"onAccept()\"\r\n ></mt-button>\r\n <mt-button\r\n [label]=\"data.rejectLabel\"\r\n [severity]=\"data.rejectButton.severity\"\r\n [variant]=\"data.rejectButton.variant\"\r\n (onClick)=\"onReject()\"\r\n ></mt-button>\r\n </div>\r\n </ng-template>\r\n</p-confirmdialog>\r\n" }]
|
|
86
|
+
}] });
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Generated bundle index. Do not edit.
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
export { ConfirmationDialog, ConfirmationService };
|
|
93
|
+
//# sourceMappingURL=masterteam-components-confirmation.mjs.map
|