@yuuvis/material 2.3.16 → 2.3.18
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/fesm2022/yuuvis-material-layout.mjs +240 -0
- package/fesm2022/yuuvis-material-layout.mjs.map +1 -0
- package/fesm2022/yuuvis-material-panes.mjs +69 -40
- package/fesm2022/yuuvis-material-panes.mjs.map +1 -1
- package/fesm2022/yuuvis-material.mjs +154 -3
- package/fesm2022/yuuvis-material.mjs.map +1 -1
- package/layout/README.md +3 -0
- package/layout/index.d.ts +3 -0
- package/layout/lib/components/master-details-layout/master-details-layout.component.d.ts +38 -0
- package/layout/lib/directives/layout-pane.directive.d.ts +15 -0
- package/layout/lib/layout.interface.d.ts +25 -0
- package/layout/lib/layout.module.d.ts +8 -0
- package/layout/lib/services/layout.service.d.ts +19 -0
- package/lib/services/device.interface.d.ts +15 -0
- package/lib/services/device.service.d.ts +60 -0
- package/lib/services/index.d.ts +2 -0
- package/package.json +8 -2
- package/panes/index.d.ts +1 -1
- package/panes/lib/pane/pane-footer/pane-footer.component.d.ts +5 -0
- package/panes/lib/pane/pane-top-bar/pane-top-bar.component.d.ts +5 -6
- package/panes/lib/pane/pane.component.d.ts +29 -10
- package/panes/lib/panes.module.d.ts +3 -3
- package/scss/material-components/_dialog.scss +7 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yuuvis-material-panes.mjs","sources":["../../../../../libs/yuuvis/material/panes/src/lib/pane/pane-header/pane-header.component.ts","../../../../../libs/yuuvis/material/panes/src/lib/pane/pane-header/pane-header.component.html","../../../../../libs/yuuvis/material/panes/src/lib/pane/pane-top-bar/pane-top-bar.component.ts","../../../../../libs/yuuvis/material/panes/src/lib/pane/pane-top-bar/pane-top-bar.component.html","../../../../../libs/yuuvis/material/panes/src/lib/pane/pane-aside/pane-aside.component.ts","../../../../../libs/yuuvis/material/panes/src/lib/pane/pane-aside/pane-aside.component.html","../../../../../libs/yuuvis/material/panes/src/lib/pane/pane.component.ts","../../../../../libs/yuuvis/material/panes/src/lib/pane/pane.component.html","../../../../../libs/yuuvis/material/panes/src/lib/pane/pane-body/pane-body.component.ts","../../../../../libs/yuuvis/material/panes/src/lib/pane/pane-body/pane-body.component.html","../../../../../libs/yuuvis/material/panes/src/lib/panes.module.ts","../../../../../libs/yuuvis/material/panes/src/yuuvis-material-panes.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, input, TemplateRef } from '@angular/core';\n\n@Component({\n selector: 'ymt-pane-header',\n imports: [CommonModule],\n templateUrl: './pane-header.component.html',\n styleUrl: './pane-header.component.scss'\n})\nexport class YmtPaneHeaderComponent {\n /**\n * Title of the pane\n */\n title = input<string>();\n /**\n * Subtitle of the pane\n */\n subtitle = input<string>();\n /**\n * TemplateRef for actions area in the pane header.\n */\n actions = input<TemplateRef<any>>();\n}\n"," <header>\n <h2>{{ title() }}</h2>\n <small>{{ subtitle() }}</small>\n @let a = actions();\n @if (a) {\n <div class=\"actions\">\n <ng-container *ngTemplateOutlet=\"a\"></ng-container>\n </div>\n }\n </header>","import { Component, effect, input, output, signal, TemplateRef } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatIconModule } from '@angular/material/icon';\nimport { YmtIconButtonDirective } from '@yuuvis/material';\n\n@Component({\n selector: 'ymt-pane-top-bar',\n imports: [YmtIconButtonDirective, MatIconModule, CommonModule],\n templateUrl: './pane-top-bar.component.html',\n styleUrl: './pane-top-bar.component.scss',\n host: {\n '[class.inverse]': 'paneToggle() === \"end\"',\n '[class.pane-toggle]': 'paneToggle() !== \"none\"'\n }\n})\nexport class YmtPaneTopBarComponent {\n /**\n * TemplateRef for actions area in the top bar.\n */\n actions = input<TemplateRef<any>>();\n /**\n * Position of the pane toggle button (default: 'none')\n * Set to 'none' the pane toggle button in the top bar is hidden.\n */\n paneToggle = input<'start' | 'end' | 'none'>('none');\n\n /**\n * Event emitted when the pane toggle button is clicked.\n */\n paneToggled = output<boolean>();\n\n paneCollapsed = signal<boolean>(false);\n #paneCollapsedEffect = effect(() => {\n this.paneToggled.emit(this.paneCollapsed());\n });\n\n togglePane() {\n this.paneCollapsed.set(!this.paneCollapsed());\n }\n}\n"," @let ta = actions();\n <div class=\"top-bar\">\n @if (paneToggle() != 'none') {\n <button class=\"pane-toggle\" ymt-icon-button icon-button-size=\"small\" (click)=\"togglePane()\">\n <mat-icon>{{ paneCollapsed() ? 'right_panel_open' : 'right_panel_close' }}</mat-icon>\n </button>\n }\n @if (ta) {\n <div class=\"actions\">\n <ng-container *ngTemplateOutlet=\"ta\"></ng-container>\n </div>\n }\n </div>","import { Component } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@Component({\n selector: 'ymt-pane-aside',\n imports: [CommonModule],\n templateUrl: './pane-aside.component.html',\n styleUrl: './pane-aside.component.scss'\n})\nexport class YmtPaneAsideComponent {}\n","<p>pane-aside works!</p>\n","import { CommonModule } from '@angular/common';\nimport { Component, contentChild, input, output, signal, TemplateRef } from '@angular/core';\nimport { MatIconModule } from '@angular/material/icon';\nimport { YmtPaneAsideComponent } from './pane-aside/pane-aside.component';\nimport { YmtPaneTopBarComponent } from './pane-top-bar/pane-top-bar.component';\n\n/**\n * Pane component.\n *\n * A pane has a header and a main area. You may choose to not show a header at all:\n *\n * ```html\n * <ymt-pane [header]=\"false\">\n * Pane content goes here.\n * </ymt-pane>\n * ```\n *\n * You can change the appearance of the header area via CSS variables:\n * ```css\n * ymt-pane {\n * --header-area-background: var(--ymt-surface-container-low);\n * --header-area-border-color: var(--ymt-outline-variant);\n * }\n * ```\n *\n * The main area has a padding by default. You can customize or remove the padding via\n * CSS variables:\n * ```css\n * ymt-pane {\n * --main-area-padding: 0;\n * }\n * ```\n *\n * Add actions to a pane:\n * ```html\n * <ymt-pane title=\"My Pane\" subTitle=\"Pane Subtitle\">\n * <ng-template #yuvPaneActions>\n * <button ymt-icon-button><mat-icon>settings</mat-icon></button>\n * <button ymt-icon-button><mat-icon>more</mat-icon></button>\n * </ng-template>\n * </ymt-pane>\n * ```\n *\n */\n@Component({\n selector: 'ymt-pane',\n imports: [CommonModule, YmtPaneTopBarComponent, MatIconModule],\n templateUrl: './pane.component.html',\n styleUrl: './pane.component.scss',\n host: {\n '[class.collapsed]': 'collapsed()'\n }\n})\nexport class YmtPaneComponent {\n\n // paneHeader = contentChild(YmtPaneHeaderComponent);\n // paneBody = contentChild(YmtPaneBodyComponent);\n paneAside = contentChild(YmtPaneAsideComponent);\n\n /**\n * TemplateRef for actions area in the top bar.\n * ```html\n * <ymt-pane title=\"My Pane\" subTitle=\"Pane Subtitle\" [topBarActions]=\"topBarActions\"></ymt-pane>\n * <ng-template #topBarActions>\n * <button ymt-icon-button icon-button-size=\"small\"><mat-icon>settings</mat-icon></button>\n * </ng-template>\n * ```\n * Make sure to set the `icon-button-size=\"small\"` for proper alignment in the top bar.\n */\n topBarActions = input<TemplateRef<any>>();\n /**\n * Whether to show the top bar (default: true)\n */\n topBar = input<boolean>(true);\n\n /**\n * Position of the pane toggle button (default: 'none')\n * Set to 'none' the pane toggle button in the top bar is hidden.\n */\n paneToggle = input<'start' | 'end' | 'none'>('none');\n\n /**\n * Event emitted when the pane toggle button is clicked.\n */\n paneToggled = output<boolean>();\n\n collapsed = signal<boolean>(false);\n\n togglePane(collapsed: boolean) {\n this.collapsed.set(collapsed);\n this.paneToggled.emit(collapsed);\n }\n}\n","@if (topBar()) {\n <ymt-pane-top-bar [actions]=\"topBarActions()\" [paneToggle]=\"paneToggle()\" \n (paneToggled)=\"togglePane($event)\"></ymt-pane-top-bar>\n}\n<ng-content></ng-content>\n","import { Component } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@Component({\n selector: 'ymt-pane-body',\n imports: [CommonModule],\n templateUrl: './pane-body.component.html',\n styleUrl: './pane-body.component.scss'\n})\nexport class YmtPaneBodyComponent {}\n","!<ng-content></ng-content>!\n","import { NgModule } from '@angular/core';\nimport { YmtPaneHeaderComponent } from './pane/pane-header/pane-header.component';\nimport { YmtPaneTopBarComponent } from './pane/pane-top-bar/pane-top-bar.component';\nimport { YmtPaneComponent } from './pane/pane.component';\nimport { YmtPaneBodyComponent } from './pane/pane-body/pane-body.component';\nimport { YmtPaneAsideComponent } from './pane/pane-aside/pane-aside.component';\n\nconst cmp = [YmtPaneComponent, YmtPaneHeaderComponent, YmtPaneTopBarComponent, YmtPaneBodyComponent, YmtPaneAsideComponent];\n\n@NgModule({\n imports: cmp,\n exports: cmp\n})\nexport class YmtPanesModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2"],"mappings":";;;;;;;;MASa,sBAAsB,CAAA;AACjC;;AAEG;IACH,KAAK,GAAG,KAAK,EAAU;AACvB;;AAEG;IACH,QAAQ,GAAG,KAAK,EAAU;AAC1B;;AAEG;IACH,OAAO,GAAG,KAAK,EAAoB;wGAZxB,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAtB,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECTnC,oPASW,EAAA,MAAA,E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,SAAS;+BACE,eAAe,EAAA,OAAA,EAChB,CAAC,YAAY,CAAC,EAAA,QAAA,EAAA,+BAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;;AEEzB,MAAM,GAAG,GAAG,CAAC,gBAAgB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,qBAAqB,CAAC;MAM9G,cAAc,CAAA;wGAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAd,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YANd,gBAAgB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,qBAAqB,CAA7G,EAAA,OAAA,EAAA,CAAA,gBAAgB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,qBAAqB,CAAA,EAAA,CAAA;AAM7G,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YAHhB,GAAG,CAAA,EAAA,CAAA;;4FAGD,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,GAAG;AACZ,oBAAA,OAAO,EAAE;AACV,iBAAA;;;ACZD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"yuuvis-material-panes.mjs","sources":["../../../../../libs/yuuvis/material/panes/src/lib/pane/pane-aside/pane-aside.component.ts","../../../../../libs/yuuvis/material/panes/src/lib/pane/pane-aside/pane-aside.component.html","../../../../../libs/yuuvis/material/panes/src/lib/pane/pane-body/pane-body.component.ts","../../../../../libs/yuuvis/material/panes/src/lib/pane/pane-body/pane-body.component.html","../../../../../libs/yuuvis/material/panes/src/lib/pane/pane-header/pane-header.component.ts","../../../../../libs/yuuvis/material/panes/src/lib/pane/pane-header/pane-header.component.html","../../../../../libs/yuuvis/material/panes/src/lib/pane/pane-top-bar/pane-top-bar.component.ts","../../../../../libs/yuuvis/material/panes/src/lib/pane/pane-top-bar/pane-top-bar.component.html","../../../../../libs/yuuvis/material/panes/src/lib/pane/pane.component.ts","../../../../../libs/yuuvis/material/panes/src/lib/pane/pane.component.html","../../../../../libs/yuuvis/material/panes/src/lib/pane/pane-footer/pane-footer.component.ts","../../../../../libs/yuuvis/material/panes/src/lib/pane/pane-footer/pane-footer.component.html","../../../../../libs/yuuvis/material/panes/src/lib/panes.module.ts","../../../../../libs/yuuvis/material/panes/src/yuuvis-material-panes.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@Component({\n selector: 'ymt-pane-aside',\n imports: [CommonModule],\n templateUrl: './pane-aside.component.html',\n styleUrl: './pane-aside.component.scss'\n})\nexport class YmtPaneAsideComponent {}\n","<p>pane-aside works!</p>\n","import { Component } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@Component({\n selector: 'ymt-pane-body',\n imports: [CommonModule],\n templateUrl: './pane-body.component.html',\n styleUrl: './pane-body.component.scss'\n})\nexport class YmtPaneBodyComponent {}\n","<ng-content></ng-content>\n","import { CommonModule } from '@angular/common';\nimport { Component, input, TemplateRef } from '@angular/core';\n\n@Component({\n selector: 'ymt-pane-header',\n imports: [CommonModule],\n templateUrl: './pane-header.component.html',\n styleUrl: './pane-header.component.scss'\n})\nexport class YmtPaneHeaderComponent {\n /**\n * Title of the pane\n */\n title = input<string>();\n /**\n * Subtitle of the pane\n */\n subtitle = input<string>();\n /**\n * TemplateRef for actions area in the pane header.\n */\n actions = input<TemplateRef<any>>();\n}\n"," <header>\n <h2>{{ title() }}</h2>\n <small>{{ subtitle() }}</small>\n @let a = actions();\n @if (a) {\n <div class=\"actions\">\n <ng-container *ngTemplateOutlet=\"a\"></ng-container>\n </div>\n }\n </header>","import { Component, effect, input, output, signal, TemplateRef } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatIconModule } from '@angular/material/icon';\nimport { YmtIconButtonDirective } from '@yuuvis/material';\n\n@Component({\n selector: 'ymt-pane-top-bar',\n imports: [YmtIconButtonDirective, MatIconModule, CommonModule],\n templateUrl: './pane-top-bar.component.html',\n styleUrl: './pane-top-bar.component.scss',\n host: {\n '[class.inverse]': 'modeAlign() === \"end\"',\n '[class.has-mode]': 'mode() !== undefined'\n }\n})\nexport class YmtPaneTopBarComponent {\n /**\n * TemplateRef for actions area in the top bar.\n */\n actions = input<TemplateRef<any>>();\n modeAlign = input<'start' | 'end'>('start');\n\n mode = input<'navigation' | 'toggle' | undefined>(undefined);\n\n /**\n * Event emitted when the pane toggle button is clicked.\n */\n paneToggled = output<boolean>();\n navigationClicked = output<boolean>();\n\n paneCollapsed = signal<boolean>(false);\n #paneCollapsedEffect = effect(() => {\n this.paneToggled.emit(this.paneCollapsed());\n });\n\n togglePane() {\n this.paneCollapsed.set(!this.paneCollapsed());\n }\n\n navClick() {\n this.navigationClicked.emit(true);\n }\n}\n"," @let ta = actions();\n <div class=\"top-bar\">\n @let m = mode();\n @if (m === 'toggle') {\n <button class=\"pane-toggle\" ymt-icon-button icon-button-size=\"small\" (click)=\"togglePane()\">\n <mat-icon>{{ paneCollapsed() ? 'right_panel_open' : 'right_panel_close' }}</mat-icon>\n </button>\n } @else if (m === 'navigation') {\n <button class=\"pane-nav\" ymt-icon-button icon-button-size=\"small\" (click)=\"navClick()\">\n <mat-icon>arrow_back</mat-icon>\n </button>\n }\n @if (ta) {\n <div class=\"actions\">\n <ng-container *ngTemplateOutlet=\"ta\"></ng-container>\n </div>\n }\n </div>","import { CommonModule } from '@angular/common';\nimport { Component, contentChild, input, output, signal, TemplateRef } from '@angular/core';\nimport { MatIconModule } from '@angular/material/icon';\nimport { YmtPaneAsideComponent } from './pane-aside/pane-aside.component';\nimport { YmtPaneTopBarComponent } from './pane-top-bar/pane-top-bar.component';\n\n/**\n * Pane component.\n *\n * A pane has a header and a main area. You may choose to not show a header at all:\n *\n * ```html\n * <ymt-pane [header]=\"false\">\n * Pane content goes here.\n * </ymt-pane>\n * ```\n * \n * There are other components to be used within a pane:\n * - `ymt-pane-header`: Renders a pre-styled header area for the pane.\n * - `ymt-pane-body`: The main content area of the pane.\n * - `ymt-pane-footer`: A footer component to be used as footer area of the pane.\n *\n * You can change the appearance of the header area via CSS variables:\n * ```css\n * ymt-pane {\n * --header-area-background: var(--ymt-surface-container-low);\n * --header-area-border-color: var(--ymt-outline-variant);\n * }\n * ```\n *\n * The main area has a padding by default. You can customize or remove the padding via\n * CSS variables:\n * ```css\n * ymt-pane {\n * --main-area-padding: 0;\n * }\n * ```\n *\n * Add actions to a pane:\n * ```html\n * <ymt-pane title=\"My Pane\" subTitle=\"Pane Subtitle\">\n * <ng-template #yuvPaneActions>\n * <button ymt-icon-button><mat-icon>settings</mat-icon></button>\n * <button ymt-icon-button><mat-icon>more</mat-icon></button>\n * </ng-template>\n * </ymt-pane>\n * ```\n *\n */\n@Component({\n selector: 'ymt-pane',\n imports: [CommonModule, YmtPaneTopBarComponent, MatIconModule],\n templateUrl: './pane.component.html',\n styleUrl: './pane.component.scss',\n host: {\n '[class.collapsed]': 'collapsed()',\n '[class.plain]': 'plain()'\n }\n})\nexport class YmtPaneComponent {\n /**\n * TemplateRef for actions area in the top bar. These actions will be placed at the end of\n * the top bar.\n * \n * ```html\n * <ymt-pane title=\"My Pane\" subTitle=\"Pane Subtitle\" [topBarActions]=\"topBarActions\"></ymt-pane>\n * <ng-template #topBarActions>\n * <button ymt-icon-button icon-button-size=\"small\"><mat-icon>settings</mat-icon></button>\n * </ng-template>\n * ```\n * Make sure to set the `icon-button-size=\"small\"` for proper alignment in the top bar.\n */\n topBarActions = input<TemplateRef<any>>();\n\n /**\n * Setting this to true will remove the default styles for the pane. So it will\n * render without border-radius, border and background color, but keep the inner\n * structure. This is useful when you want to use the pane inside another container\n * and want to apply custom styles to the pane.\n */\n plain = input<boolean>(false);\n\n /**\n * A pane may have different modes to control the behavior of the top bar.\n * - `navigation`: Shows a back button on the left side of the top bar to close the pane or navigate back.\n * - `toggle`: Shows a toggle button on the left side of the top bar to collapse/expand the pane.\n */\n mode = input<'navigation' | 'toggle' | undefined>(undefined);\n\n modeAlign = input<'start' | 'end'>('start');\n /**\n * Event emitted when the pane toggle button is clicked. This toggle button is shown\n * when mode is set to 'toggle'.\n */\n paneToggled = output<boolean>();\n\n /**\n * Event emitted when the navigation button is clicked. Navigation button is shown when\n * mode is set to 'navigation'.\n */\n navigationClicked = output<boolean>();\n\n /**\n * Collapsed state of the pane. Only relevant when mode is set to 'toggle'.\n */\n collapsed = signal<boolean>(false);\n\n togglePane(collapsed: boolean) {\n this.collapsed.set(collapsed);\n this.paneToggled.emit(collapsed);\n }\n}\n","@let topBarVisible = mode() || topBarActions();\n@if (topBarVisible) {\n <ymt-pane-top-bar\n [actions]=\"topBarActions()\"\n [modeAlign]=\"modeAlign()\"\n [mode]=\"mode()\"\n (navigationClicked)=\"navigationClicked.emit(true)\"\n (paneToggled)=\"togglePane($event)\"\n ></ymt-pane-top-bar>\n}\n<ng-content></ng-content>\n","import { Component } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@Component({\n selector: 'ymt-pane-footer',\n imports: [CommonModule],\n templateUrl: './pane-footer.component.html',\n styleUrl: './pane-footer.component.scss'\n})\nexport class YmtPaneFooterComponent {}\n","<footer><ng-content></ng-content></footer>\n","import { NgModule } from '@angular/core';\nimport { YmtPaneAsideComponent } from './pane/pane-aside/pane-aside.component';\nimport { YmtPaneBodyComponent } from './pane/pane-body/pane-body.component';\nimport { YmtPaneHeaderComponent } from './pane/pane-header/pane-header.component';\nimport { YmtPaneComponent } from './pane/pane.component';\nimport { YmtPaneFooterComponent } from './pane/pane-footer/pane-footer.component';\n\nconst cmp = [YmtPaneComponent, YmtPaneHeaderComponent, YmtPaneBodyComponent, YmtPaneFooterComponent, YmtPaneAsideComponent];\n\n@NgModule({\n imports: cmp,\n exports: cmp\n})\nexport class YmtPanesModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2"],"mappings":";;;;;;;;MASa,qBAAqB,CAAA;wGAArB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECTlC,4BACA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDIY,YAAY,EAAA,CAAA,EAAA,CAAA;;4FAIX,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBANjC,SAAS;+BACE,gBAAgB,EAAA,OAAA,EACjB,CAAC,YAAY,CAAC,EAAA,QAAA,EAAA,4BAAA,EAAA;;;MEIZ,oBAAoB,CAAA;wGAApB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAApB,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,eAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECTjC,6BACA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDIY,YAAY,EAAA,CAAA,EAAA,CAAA;;4FAIX,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBANhC,SAAS;+BACE,eAAe,EAAA,OAAA,EAChB,CAAC,YAAY,CAAC,EAAA,QAAA,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AA,CAAA,EAAA;;;AEEzB,MAAM,GAAG,GAAG,CAAC,gBAAgB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,qBAAqB,CAAC;MAM9G,cAAc,CAAA;wGAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAd,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YANd,gBAAgB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,qBAAqB,CAA7G,EAAA,OAAA,EAAA,CAAA,gBAAgB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,qBAAqB,CAAA,EAAA,CAAA;AAM7G,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YAHhB,GAAG,CAAA,EAAA,CAAA;;4FAGD,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,GAAG;AACZ,oBAAA,OAAO,EAAE;AACV,iBAAA;;;ACZD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Inject, Injectable, inject, makeEnvironmentProviders, input, booleanAttribute, ElementRef, EnvironmentInjector, ApplicationRef, effect, createComponent, Directive,
|
|
2
|
+
import { Inject, Injectable, inject, signal, makeEnvironmentProviders, input, booleanAttribute, ElementRef, EnvironmentInjector, ApplicationRef, effect, createComponent, Directive, DestroyRef, viewChild, untracked, Input, HostBinding, HostListener, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { MAT_NATIVE_DATE_FORMATS, DateAdapter, MAT_DATE_FORMATS, NativeDateAdapter, MAT_DATE_LOCALE, MAT_RIPPLE_GLOBAL_OPTIONS, NativeDateModule } from '@angular/material/core';
|
|
4
4
|
import { MAT_FORM_FIELD_DEFAULT_OPTIONS, MatFormField, MatFormFieldControl } from '@angular/material/form-field';
|
|
5
5
|
import { MatIconRegistry } from '@angular/material/icon';
|
|
@@ -14,11 +14,12 @@ import { DOCUMENT, CommonModule } from '@angular/common';
|
|
|
14
14
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
15
15
|
import { MatDatepickerIntl, MatDatepicker, MatDatepickerInput, MatDateRangeInput, MatDateRangePicker, MatEndDate, MatStartDate } from '@angular/material/datepicker';
|
|
16
16
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
17
|
+
import { DeviceDetectorService } from 'ngx-device-detector';
|
|
18
|
+
import { fromEvent, debounceTime, ReplaySubject, Subject } from 'rxjs';
|
|
17
19
|
import { MatIconButton, MatButton } from '@angular/material/button';
|
|
18
20
|
import { MatInput } from '@angular/material/input';
|
|
19
21
|
import * as i1$1 from '@angular/forms';
|
|
20
22
|
import { NgControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
21
|
-
import { Subject } from 'rxjs';
|
|
22
23
|
import { MatTimepicker, MatTimepickerInput } from '@angular/material/timepicker';
|
|
23
24
|
|
|
24
25
|
class YmtMatIconRegistryService extends MatIconRegistry {
|
|
@@ -154,6 +155,156 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
154
155
|
type: Injectable
|
|
155
156
|
}], ctorParameters: () => [] });
|
|
156
157
|
|
|
158
|
+
var DeviceScreenOrientation;
|
|
159
|
+
(function (DeviceScreenOrientation) {
|
|
160
|
+
DeviceScreenOrientation["PORTRAIT"] = "portrait";
|
|
161
|
+
DeviceScreenOrientation["LANDSCAPE"] = "landscape";
|
|
162
|
+
})(DeviceScreenOrientation || (DeviceScreenOrientation = {}));
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* This service is used to adapt styles and designs of the client to
|
|
166
|
+
* different devices and screen sizes.
|
|
167
|
+
*
|
|
168
|
+
* Using `screenChange$` observable you are able to monitor changes to
|
|
169
|
+
* the screen size and act upon it.
|
|
170
|
+
*
|
|
171
|
+
* This service will also adds attributes to the body tag that reflect the
|
|
172
|
+
* current screen/device state. This way you can apply secific styles in your
|
|
173
|
+
* css files for different screen resolutions and orientations.
|
|
174
|
+
*
|
|
175
|
+
* Attributes applied to the body tag are:
|
|
176
|
+
*
|
|
177
|
+
* - `data-screen` - [s, m, l, xl] - for different screen sizes
|
|
178
|
+
* (s: for mobile phone like screen sizes, m: for tablet like screen
|
|
179
|
+
* sizes, 'l': for desktop like screen sizes, 'xl': for screen sizes exceeding
|
|
180
|
+
* the desktop screen size).
|
|
181
|
+
*
|
|
182
|
+
* - `data-orientation` - [portrait, landscape] - for the current screen orientation
|
|
183
|
+
*
|
|
184
|
+
* - `data-touch-enabled` - [true] - if the device has touch capabilities (won't be added if the device doesn't have touch capabilities)
|
|
185
|
+
*
|
|
186
|
+
* ```html
|
|
187
|
+
* <body data-screen-size="s" data-screen-orientation="portrait" data-touch-enabled="true">
|
|
188
|
+
* ...
|
|
189
|
+
* </body>
|
|
190
|
+
* ```
|
|
191
|
+
*/
|
|
192
|
+
class DeviceService {
|
|
193
|
+
#deviceDetectorService = inject(DeviceDetectorService);
|
|
194
|
+
#upperScreenBoundary = {
|
|
195
|
+
small: 600,
|
|
196
|
+
mediumPortrait: 900,
|
|
197
|
+
mediumLandscape: 1200,
|
|
198
|
+
large: 1800
|
|
199
|
+
};
|
|
200
|
+
#resize$ = fromEvent(window, 'resize').pipe(debounceTime(this.#getDebounceTime()));
|
|
201
|
+
#screen;
|
|
202
|
+
#screenSource = new ReplaySubject(1);
|
|
203
|
+
screenChange$ = this.#screenSource.asObservable();
|
|
204
|
+
/**
|
|
205
|
+
* Signal to indicate if the screen size is small (e.g. mobile phone).
|
|
206
|
+
* This will only be triggered if `supportsSmallScreens` is set to true.
|
|
207
|
+
* Major components will use this metric to adapt to 'small screen behavior' and so can you
|
|
208
|
+
*/
|
|
209
|
+
smallScreenLayout = signal(false);
|
|
210
|
+
#supportsSmallScreens = signal(false);
|
|
211
|
+
/**
|
|
212
|
+
* if the device is a mobile device (android / iPhone / windows-phone etc)
|
|
213
|
+
*/
|
|
214
|
+
isMobile = this.#deviceDetectorService.isMobile();
|
|
215
|
+
/**
|
|
216
|
+
* if the device us a tablet (iPad etc)
|
|
217
|
+
*/
|
|
218
|
+
isTablet = this.#deviceDetectorService.isTablet();
|
|
219
|
+
/**
|
|
220
|
+
* if the app is running on a Desktop browser
|
|
221
|
+
*/
|
|
222
|
+
isDesktop = this.#deviceDetectorService.isDesktop();
|
|
223
|
+
info = this.#deviceDetectorService.getDeviceInfo();
|
|
224
|
+
isTouchEnabled = this.#isTouchEnabled();
|
|
225
|
+
constructor() {
|
|
226
|
+
this.#resize$.subscribe((e) => {
|
|
227
|
+
this.#setScreen();
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
init(supportsSmallScreens = false) {
|
|
231
|
+
this.#supportsSmallScreens.set(supportsSmallScreens);
|
|
232
|
+
this.#setScreen();
|
|
233
|
+
}
|
|
234
|
+
#isTouchEnabled() {
|
|
235
|
+
return 'ontouchstart' in window || navigator.maxTouchPoints > 0;
|
|
236
|
+
}
|
|
237
|
+
#setScreen() {
|
|
238
|
+
const bounds = {
|
|
239
|
+
width: window.innerWidth,
|
|
240
|
+
height: window.innerHeight
|
|
241
|
+
};
|
|
242
|
+
let orientation = bounds.width >= bounds.height ? DeviceScreenOrientation.LANDSCAPE : DeviceScreenOrientation.PORTRAIT;
|
|
243
|
+
if (this.isMobile && window.screen['orientation']) {
|
|
244
|
+
const screenOrientation = window.screen['orientation'].type;
|
|
245
|
+
if (screenOrientation === 'landscape-primary' || screenOrientation === 'landscape-secondary') {
|
|
246
|
+
orientation = DeviceScreenOrientation.LANDSCAPE;
|
|
247
|
+
}
|
|
248
|
+
else if (screenOrientation === 'portrait-primary' || screenOrientation === 'portrait-secondary') {
|
|
249
|
+
orientation = DeviceScreenOrientation.PORTRAIT;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
this.#screen = {
|
|
253
|
+
size: this.#getScreenSize(bounds, orientation),
|
|
254
|
+
orientation,
|
|
255
|
+
width: bounds.width,
|
|
256
|
+
height: bounds.height
|
|
257
|
+
};
|
|
258
|
+
this.#screenSource.next(this.#screen);
|
|
259
|
+
this.smallScreenLayout.set(this.#supportsSmallScreens() && this.#screen.size === 's' && this.#screen.orientation === 'portrait');
|
|
260
|
+
this.#setupDOM(this.#screen);
|
|
261
|
+
// force change detection because resize will not be recognized by Angular in some cases
|
|
262
|
+
// TODO: check: causes recursive ticks in some cases ...
|
|
263
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
264
|
+
setTimeout(() => { }, 0);
|
|
265
|
+
}
|
|
266
|
+
#setupDOM(screen) {
|
|
267
|
+
const body = document.querySelector('body');
|
|
268
|
+
body.setAttribute('data-screen-size', screen.size);
|
|
269
|
+
body.setAttribute('data-screen-orientation', screen.orientation);
|
|
270
|
+
if (this.isTouchEnabled)
|
|
271
|
+
body.setAttribute('data-touch-enabled', 'true');
|
|
272
|
+
else
|
|
273
|
+
body.removeAttribute('data-touch-enabled');
|
|
274
|
+
}
|
|
275
|
+
#getScreenSize(bounds, orientation) {
|
|
276
|
+
if (this.#isBelow(this.#upperScreenBoundary.small, bounds)) {
|
|
277
|
+
return 's';
|
|
278
|
+
}
|
|
279
|
+
else if (this.#isBelow(orientation === 'landscape' ? this.#upperScreenBoundary.mediumLandscape : this.#upperScreenBoundary.mediumPortrait, bounds)) {
|
|
280
|
+
return 'm';
|
|
281
|
+
}
|
|
282
|
+
else if (this.#isBelow(this.#upperScreenBoundary.large, bounds)) {
|
|
283
|
+
return 'l';
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
return 'xl';
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
#isBelow(size, bounds) {
|
|
290
|
+
const landscape = bounds.width < this.#upperScreenBoundary.large ? bounds.width >= bounds.height : false;
|
|
291
|
+
return (landscape && bounds.height < size) || (!landscape && bounds.width < size);
|
|
292
|
+
}
|
|
293
|
+
#getDebounceTime() {
|
|
294
|
+
// on mobile devices resize only happens when rotating the device or when
|
|
295
|
+
// keyboard appears, so we dont't need to debounce
|
|
296
|
+
return this.isMobile ? 0 : 500;
|
|
297
|
+
}
|
|
298
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DeviceService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
299
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DeviceService, providedIn: 'root' });
|
|
300
|
+
}
|
|
301
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DeviceService, decorators: [{
|
|
302
|
+
type: Injectable,
|
|
303
|
+
args: [{
|
|
304
|
+
providedIn: 'root'
|
|
305
|
+
}]
|
|
306
|
+
}], ctorParameters: () => [] });
|
|
307
|
+
|
|
157
308
|
/* Draft */
|
|
158
309
|
class YmtMatPaginatorIntlService extends MatPaginatorIntl {
|
|
159
310
|
#translate = inject(TranslateService);
|
|
@@ -837,5 +988,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
837
988
|
* Generated bundle index. Do not edit.
|
|
838
989
|
*/
|
|
839
990
|
|
|
840
|
-
export { DatepickerComponent, DatepickerToggleComponent, YMT_BUTTON_SIZE, YMT_DATE_FROMATS, YMT_ICON_BUTTON_SIZE, YmtButtonDirective, YmtDateAdapterService, YmtDatepickerIntlService, YmtIconButtonDirective, YmtMatIconRegistryService, provideYmtDateAdapter, provideYmtMaterial };
|
|
991
|
+
export { DatepickerComponent, DatepickerToggleComponent, DeviceScreenOrientation, DeviceService, YMT_BUTTON_SIZE, YMT_DATE_FROMATS, YMT_ICON_BUTTON_SIZE, YmtButtonDirective, YmtDateAdapterService, YmtDatepickerIntlService, YmtIconButtonDirective, YmtMatIconRegistryService, provideYmtDateAdapter, provideYmtMaterial };
|
|
841
992
|
//# sourceMappingURL=yuuvis-material.mjs.map
|