UNPKG

@santinobch/os-window-angular

Version:

Create windows inside a browser window!

1 lines 75.6 kB
{"version":3,"file":"santinobch-os-window-angular.mjs","sources":["../../../projects/os-window-angular/src/lib/themes/theme_list.ts","../../../projects/os-window-angular/src/lib/services/os-config/os-config.service.ts","../../../projects/os-window-angular/src/lib/classes/Style.class.ts","../../../projects/os-window-angular/src/lib/classes/OsWindow.class.ts","../../../projects/os-window-angular/src/lib/components/os-window/os-window.component.ts","../../../projects/os-window-angular/src/lib/components/os-window/os-window.component.html","../../../projects/os-window-angular/src/lib/components/os-window/os-window.module.ts","../../../projects/os-window-angular/src/lib/components/os-button/os-button.component.ts","../../../projects/os-window-angular/src/lib/components/os-button/os-button.component.html","../../../projects/os-window-angular/src/lib/components/os-button/os-button.module.ts","../../../projects/os-window-angular/src/lib/components/os-radio/os-radio.component.ts","../../../projects/os-window-angular/src/lib/components/os-radio/os-radio.component.html","../../../projects/os-window-angular/src/lib/components/os-radio/os-radio.module.ts","../../../projects/os-window-angular/src/public-api.ts","../../../projects/os-window-angular/src/santinobch-os-window-angular.ts"],"sourcesContent":["import { ThemeDefinition } from '../models/Theme.model';\n\nexport const THEME_LIST: ThemeDefinition[] = [\n {\n name: 'arc',\n variants: ['light', 'dark'],\n palette: [\n 'red',\n 'orange',\n 'yellow',\n 'lime',\n 'green',\n 'aqua',\n 'blue',\n 'purple',\n 'magenta',\n ],\n },\n {\n name: 'win98',\n variants: ['classic', 'vaporwave'],\n palette: [\n 'red',\n 'orange',\n 'yellow',\n 'lime',\n 'green',\n 'aqua',\n 'blue',\n 'purple',\n 'magenta',\n ],\n },\n];\n","import { Injectable } from '@angular/core';\nimport { ProcessModel as InstanceModel } from '../../models/Shared.model';\nimport { Theme, ThemeDefinition } from '../../models/Theme.model';\nimport { THEME_LIST } from '../../themes/theme_list';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class OsConfigService {\n constructor() {}\n\n private globalTheme: Theme = {\n name: 'arc',\n variant: 'light',\n };\n\n private instances!: InstanceModel[];\n\n // This stores windows information (id and styles)\n getInstances(): InstanceModel[] {\n return this.instances;\n }\n\n setInstances(shared: InstanceModel) {\n this.instances.push(shared);\n }\n\n getGlobalTheme(): Theme {\n const GLOBAL_THEME = localStorage.getItem('GLOBAL_THEME');\n\n if (GLOBAL_THEME === null) {\n return this.globalTheme;\n }\n\n return JSON.parse(GLOBAL_THEME);\n }\n\n setGlobalTheme(style: Theme) {\n this.globalTheme = style;\n\n localStorage.setItem('GLOBAL_THEME', JSON.stringify(this.globalTheme));\n }\n\n private zIndex: number = 1;\n\n /**\n * Returns last zIndex value\n *\n * When a window is focused, it's zIndex value changes,\n * making it appear in front of the other windows\n */\n getZIndex(): number {\n return this.zIndex;\n }\n\n /**\n * Sets last zIndex value\n *\n * When a window is focused, it's zIndex value changes,\n * making it appear in front of the other windows\n */\n setZIndex(zIndex: number) {\n this.zIndex = zIndex;\n }\n\n private userThemeList: ThemeDefinition[] = THEME_LIST;\n\n addTheme(theme: ThemeDefinition) {\n this.userThemeList.push(theme);\n\n localStorage.setItem('THEME_LIST', JSON.stringify(this.userThemeList));\n }\n\n getThemes() {\n const THEME_LIST = localStorage.getItem('THEME_LIST');\n\n if (THEME_LIST === null) {\n return THEME_LIST;\n }\n\n return JSON.parse(THEME_LIST);\n }\n}\n","import { ElementRef, Renderer2, SimpleChanges } from '@angular/core';\nimport { OsConfigService } from '../services/os-config/os-config.service';\nimport { THEME_LIST } from '../themes/theme_list';\nimport { Theme } from '../models/Theme.model';\n\nexport class StyleClass {\n private componentElement!: ElementRef;\n private renderer!: Renderer2;\n private globalConfigService!: OsConfigService;\n private componentName!: string;\n\n constructor(\n private _componentElement: ElementRef,\n private _renderer: Renderer2,\n private _globalConfigService: OsConfigService,\n private _componentName: string\n ) {\n this.componentElement = _componentElement;\n this.renderer = _renderer;\n this.globalConfigService = _globalConfigService;\n this.componentName = _componentName;\n }\n\n private globalConfigData: Theme = {\n name: '',\n variant: '',\n };\n\n public style: Theme = {\n name: '',\n variant: '',\n color: '',\n };\n\n private previousStyle: Theme = {\n name: '',\n variant: '',\n color: '',\n };\n\n private isValidStyle(): boolean {\n if (\n this.style.name !== '' &&\n this.style.name !== undefined &&\n this.style.variant !== '' &&\n this.style.variant !== undefined\n ) {\n for (const i of this.globalConfigService.getThemes()) {\n if (i.name == this.style.name) {\n for (const v of i.variants) {\n if (v == this.style.variant) {\n return true;\n }\n }\n console.error(\n 'Invalid variant at ' +\n this.componentName +\n ' component: ' +\n this.style.variant\n );\n return false;\n }\n }\n console.error(\n 'Invalid Theme at ' +\n this.componentName +\n ' component: ' +\n this.style.name\n );\n return false;\n }\n return false;\n }\n\n private isValidColor(): boolean {\n if (\n this.style.name !== '' &&\n this.style.name !== undefined &&\n this.style.color !== '' &&\n this.style.color !== undefined\n ) {\n for (const i of this.globalConfigService.getThemes()) {\n if (i.name == this.style.name) {\n for (const p of i.palette) {\n if (p == this.style.color) {\n return true;\n }\n }\n console.error(\n 'Invalid color at ' +\n this.componentName +\n ' component: ' +\n this.style.color\n );\n return false;\n }\n }\n console.error(\n 'Invalid Theme at ' +\n this.componentName +\n ' component: ' +\n this.style.name\n );\n return false;\n }\n return false;\n }\n\n private getStyle(): string {\n return (\n this.style.name + '-' + this.style.variant + '-os-' + this.componentName\n );\n }\n\n private getPreviousStyle(): string {\n return (\n this.previousStyle.name +\n '-' +\n this.previousStyle.variant +\n '-os-' +\n this.componentName\n );\n }\n\n private getColor() {\n return this.style.color + '-os-' + this.componentName;\n }\n\n private getPreviousColor() {\n return this.previousStyle.color + '-os-' + this.componentName;\n }\n\n public loadGlobalStyles() {\n //Global theme config\n this.globalConfigData = this.globalConfigService.getGlobalTheme();\n this.style.name = this.globalConfigData.name;\n this.style.variant = this.globalConfigData.variant;\n this.renderer.addClass(\n this.componentElement.nativeElement,\n this.getStyle()\n );\n }\n\n public loadStyles() {\n if (this.isValidStyle()) {\n //Removes old theme class\n if (\n this.previousStyle.name !== '' &&\n this.previousStyle.name !== undefined &&\n this.previousStyle.variant !== '' &&\n this.previousStyle.variant !== undefined\n ) {\n this.renderer.removeClass(\n this.componentElement.nativeElement,\n this.getPreviousStyle()\n );\n }\n\n this.previousStyle.name = this.style.name;\n this.previousStyle.variant = this.style.variant;\n\n //Adds theme class\n this.renderer.addClass(\n this.componentElement.nativeElement,\n this.getStyle()\n );\n } else {\n this.loadGlobalStyles();\n }\n }\n\n public loadColor() {\n if (this.isValidColor()) {\n if (\n this.previousStyle.color !== '' &&\n this.previousStyle.color !== undefined\n ) {\n this.renderer.removeClass(\n this.componentElement.nativeElement,\n this.getPreviousColor()\n );\n }\n this.previousStyle.color = this.style.color;\n\n this.renderer.addClass(\n this.componentElement.nativeElement,\n this.getColor()\n );\n }\n }\n\n public onChanges(changes: SimpleChanges) {\n if (changes != undefined) {\n if (changes['theme'] != undefined) {\n this.style.name = changes['theme'].currentValue;\n }\n if (changes.variant != undefined) {\n this.style.variant = changes['variant'].currentValue;\n }\n\n if (changes['theme'] != undefined || changes['variant'] != undefined) {\n this.loadStyles();\n }\n\n if (changes['color'] != undefined) {\n this.loadColor();\n }\n }\n }\n}\n","import { CdkDragEnd, CdkDragMove } from '@angular/cdk/drag-drop';\nimport { ElementRef, Renderer2, SimpleChanges } from '@angular/core';\nimport { coerceNumberProperty } from '@angular/cdk/coercion';\n\nimport { OsConfigService } from '../services/os-config/os-config.service';\nimport { TwoPointModel } from '../models/TwoPoint.model';\nimport { PositionModel } from '../models/Position.model';\nimport { ResizeModel } from '../models/Resize.model';\nimport { StyleClass } from './Style.class';\nimport { SizeModel } from '../models/Size.model';\n\nexport function clamp(v: Number, min = 0, max = Number.MAX_SAFE_INTEGER) {\n return Math.max(min, Math.min(max, coerceNumberProperty(v)));\n}\n\nexport class OsWindowClass {\n public styleConfig!: StyleClass;\n\n constructor(\n public componentElement: ElementRef<HTMLElement>,\n public renderer: Renderer2,\n public globalConfigService: OsConfigService\n ) {\n this.styleConfig = new StyleClass(\n componentElement,\n renderer,\n globalConfigService,\n 'window'\n );\n }\n\n private mousePos: TwoPointModel = { x: 0, y: 0 };\n\n //Anchor stores temporary point of the current resize CdkDragMove event\n private anchor: TwoPointModel = { x: 0, y: 0 };\n\n public minHeight: number = 200;\n public minWidth: number = 200;\n\n public size: SizeModel = {\n height: {\n previous: 200,\n current: 200,\n unit: 'px',\n },\n width: {\n previous: 200,\n current: 200,\n unit: 'px',\n },\n };\n\n public position: PositionModel = {\n resize: { x: 0, y: 0 },\n current: { x: 0, y: 0 },\n next: { x: 0, y: 0 },\n zIndex: {\n current: 0,\n next: 1,\n },\n };\n\n public cdkAnchors: ResizeModel = {\n n: { x: 0, y: 0 },\n ne: { x: 0, y: 0 },\n e: { x: 0, y: 0 },\n se: { x: 0, y: 0 },\n s: { x: 0, y: 0 },\n sw: { x: 0, y: 0 },\n w: { x: 0, y: 0 },\n nw: { x: 0, y: 0 },\n };\n\n public state = {\n minimized: false,\n maximized: false,\n };\n\n public rules = {\n disableResize: false,\n minimizable: true,\n maximizable: true,\n closable: true,\n };\n\n private setStyle(_elementRef: ElementRef, property: string, value: string) {\n _elementRef.nativeElement.style.setProperty(property, value);\n }\n\n private getStyle(_elementRef: ElementRef, property: string) {\n return getComputedStyle(_elementRef.nativeElement).getPropertyValue(\n property\n );\n }\n\n private clamp(input: number, max: number) {\n return input >= max ? input : max;\n }\n\n private clampHeight(\n _elementRef: ElementRef,\n _height: number,\n _minHeight?: number\n ) {\n if (_minHeight) {\n _height = this.clamp(_height, _minHeight);\n }\n\n return _height;\n }\n\n private clampWidth(\n _elementRef: ElementRef,\n _width: number,\n _minWidth?: number\n ) {\n if (_minWidth) {\n _width = this.clamp(_width, _minWidth);\n }\n\n return _width;\n }\n\n setDimesions() {\n this.size.width.current = this.clampWidth(\n this.componentElement,\n this.size.width.current,\n this.minWidth\n );\n this.size.height.current = this.clampHeight(\n this.componentElement,\n this.size.height.current,\n this.minHeight\n );\n }\n\n ////////////////////////\n // Position //\n ////////////////////////\n\n setPosition(positionStr: string[]) {\n const X = parseInt(positionStr[0]);\n const Y = parseInt(positionStr[1]);\n\n if (!Number.isNaN(X)) {\n this.position.next.x = X;\n } else {\n switch (positionStr[0]) {\n case 'left':\n this.position.next.x = 0;\n break;\n\n case 'center':\n this.position.next.x =\n window.innerWidth / 2 - this.size.width.current / 2;\n break;\n\n case 'right':\n this.position.next.x = window.innerWidth - this.size.width.current;\n break;\n\n default:\n this.position.next.x = 0;\n break;\n }\n }\n\n if (!Number.isNaN(Y)) {\n this.position.next.y = Y + window.innerHeight;\n } else {\n //To hide the window element we need to set it top: -100% in scss,\n //so we later need to calculate everything + innerHeight\n switch (positionStr[1]) {\n case 'top':\n this.position.next.y = window.innerHeight;\n break;\n\n case 'center':\n this.position.next.y =\n window.innerHeight +\n (window.innerHeight / 2 - this.size.height.current / 2);\n break;\n\n case 'bottom':\n this.position.next.y =\n window.innerHeight +\n (window.innerHeight - this.size.height.current);\n break;\n\n default:\n this.position.next.y = window.innerHeight;\n break;\n }\n }\n\n this.position.current = this.position.next;\n }\n\n ////////////////////////\n // Style //\n ////////////////////////\n\n ////////////////////////\n // Rules //\n ////////////////////////\n\n loadRules() {\n //Minimizable?\n if (!this.rules.minimizable) {\n this.setStyle(this.componentElement, '--minimizeButton', 'none');\n }\n\n //Maximizable?\n if (!this.rules.maximizable) {\n this.setStyle(this.componentElement, '--maximizeButton', 'none');\n }\n\n //Closable?\n if (!this.rules.closable) {\n this.setStyle(this.componentElement, '--closeButton', 'none');\n }\n\n //Resizable?\n if (this.rules.disableResize) {\n this.setStyle(this.componentElement, '--cursorN', 'auto');\n this.setStyle(this.componentElement, '--cursorNE', 'auto');\n this.setStyle(this.componentElement, '--cursorE', 'auto');\n this.setStyle(this.componentElement, '--cursorSE', 'auto');\n this.setStyle(this.componentElement, '--cursorS', 'auto');\n this.setStyle(this.componentElement, '--cursorSW', 'auto');\n this.setStyle(this.componentElement, '--cursorW', 'auto');\n this.setStyle(this.componentElement, '--cursorNW', 'auto');\n }\n }\n\n ////////////////////////\n // Controls //\n ////////////////////////\n\n minimize() {\n //TODO\n }\n\n maximize() {\n if (this.rules.maximizable) {\n if (this.state.maximized == false) {\n //Saving value for later\n this.size.height.previous = this.size.height.current;\n this.size.width.previous = this.size.width.current;\n\n this.size.height.current = 100;\n this.size.height.unit = 'vh';\n this.size.width.current = 100;\n this.size.width.unit = 'vw';\n\n this.position.current = { x: 0, y: window.innerHeight };\n\n this.state.maximized = true;\n this.rules.disableResize = true;\n } else {\n //Restoring window size\n this.size.height.current = this.size.height.previous;\n this.size.height.unit = 'px';\n this.size.width.current = this.size.width.previous;\n this.size.width.unit = 'px';\n\n this.position.current = this.position.next;\n\n this.state.maximized = false;\n this.rules.disableResize = false;\n }\n }\n }\n\n //When maximized and then dragged the window demaximizes\n //and puts itself aligned with the mouse position\n demaximize() {\n if (this.state.maximized == true) {\n this.position.next = {\n x: this.mousePos.x - this.size.width.current / 2,\n y: this.mousePos.y + window.innerHeight - 20,\n };\n this.maximize();\n }\n }\n\n close() {\n this.componentElement.nativeElement.remove();\n }\n\n ////////////////////////\n // Resize & movement //\n ////////////////////////\n\n storeMousePos(event: MouseEvent) {\n this.mousePos = {\n x: event.x,\n y: event.y,\n };\n }\n\n //Sets some variables when the resize drag starts, we use them later\n startResize() {\n this.size.height.previous = this.size.height.current;\n this.size.width.previous = this.size.width.current;\n }\n\n resize(dragEvent: CdkDragMove, direction: string) {\n let directionSplit: string[] = [direction.charAt(0), direction.charAt(1)];\n\n this.anchor = dragEvent.source.getFreeDragPosition();\n\n directionSplit.forEach(dir => {\n this.resizeDirection(dir);\n });\n\n //Reset anchor position\n switch (direction) {\n case 'n':\n this.cdkAnchors.n = { x: 0, y: 0 };\n break;\n\n case 'ne':\n this.cdkAnchors.n = { x: 0, y: 0 };\n break;\n\n case 'e':\n this.cdkAnchors.e = { x: 0, y: 0 };\n break;\n\n case 'se':\n this.cdkAnchors.se = { x: 0, y: 0 };\n break;\n\n case 's':\n this.cdkAnchors.s = { x: 0, y: 0 };\n break;\n\n case 'sw':\n this.cdkAnchors.sw = { x: 0, y: 0 };\n break;\n\n case 'w':\n this.cdkAnchors.w = { x: 0, y: 0 };\n break;\n\n case 'nw':\n this.cdkAnchors.nw = { x: 0, y: 0 };\n break;\n }\n }\n\n resizeDirection(direction: string) {\n this.position.resize = this.position.next;\n\n switch (direction) {\n case 'n':\n //Checks that the new position and dimesions produce a minHeight lower than the required\n if (this.size.height.previous - this.anchor.y >= this.minHeight) {\n this.position.resize = {\n x: this.position.resize.x,\n y: this.position.next.y + this.anchor.y,\n };\n\n this.size.height.current = this.size.height.previous - this.anchor.y;\n this.size.height.current = this.clampHeight(\n this.componentElement,\n this.size.height.current,\n this.minHeight\n );\n\n this.position.current = {\n x: this.position.current.x,\n y: this.position.resize.y,\n };\n }\n break;\n\n case 'e':\n this.size.width.current = this.size.width.previous + this.anchor.x;\n this.size.width.current = this.clampWidth(\n this.componentElement,\n this.size.width.current,\n this.minWidth\n );\n\n break;\n\n case 's':\n this.size.height.current = this.size.height.previous + this.anchor.y;\n this.size.height.current = this.clampHeight(\n this.componentElement,\n this.size.height.current,\n this.minHeight\n );\n\n break;\n\n case 'w':\n //Checks that the new position and dimesions produce a minHeight lower than the required\n if (this.size.width.previous - this.anchor.x >= this.minWidth) {\n this.position.resize = {\n x: this.position.next.x + this.anchor.x,\n y: this.position.resize.y,\n };\n\n this.size.width.current = this.size.width.previous - this.anchor.x;\n this.size.width.current = this.clampWidth(\n this.componentElement,\n this.size.width.current,\n this.minWidth\n );\n\n this.position.current = {\n x: this.position.resize.x,\n y: this.position.current.y,\n };\n }\n break;\n }\n }\n\n endResize() {\n this.position.next = this.position.current;\n }\n\n //When releasing the os-window the user may leave it outside of the browser window\n //which would make it imposible to interact with the component again,\n //this makes the window 'bounce' back into sight\n correctEndPosition(event: CdkDragEnd) {\n this.position.next = event.source.getFreeDragPosition();\n\n //Fix for Y position, the window-bar will always be visible\n if (this.position.next.y < window.innerHeight) {\n this.position.next.y = window.innerHeight;\n } else if (this.position.next.y > window.innerHeight * 2 - 40) {\n this.position.next.y = window.innerHeight * 2 - 40;\n }\n\n //Fix for X position, a quarter of the window will always be visible\n if (this.position.next.x < -((this.size.width.current / 4) * 3)) {\n this.position.next.x = -((this.size.width.current / 4) * 3);\n } else if (\n this.position.next.x >\n window.innerWidth - this.size.width.current / 4\n ) {\n this.position.next.x = window.innerWidth - this.size.width.current / 4;\n }\n\n this.position.current = this.position.next;\n }\n\n //////////////////////////////\n // Other user interaction //\n //////////////////////////////\n\n //When a window is clicked we want to change it's z-index value and apply some styles\n focus() {\n //We get the current global z-index\n this.position.zIndex.next = this.globalConfigService.getZIndex();\n\n //This will be unequal if another window has been focused on\n if (this.position.zIndex.current != this.position.zIndex.next) {\n this.position.zIndex.next++;\n this.position.zIndex.current = this.position.zIndex.next;\n\n //Updating global z-index\n this.globalConfigService.setZIndex(this.position.zIndex.current);\n }\n\n //After that we remove the 'focused' class from all the windows\n let focused = document.getElementsByClassName('focused');\n let i: number = 0;\n while (i < focused.length) {\n this.renderer.removeClass(focused[i], 'focused');\n i++;\n }\n\n //We add the 'focused' class to the current window\n this.renderer.addClass(\n this.componentElement.nativeElement.firstChild,\n 'focused'\n );\n }\n}\n","import {\n CdkDragEnd,\n CdkDragMove,\n CdkDragRelease,\n CdkDragStart,\n DragRef,\n} from '@angular/cdk/drag-drop';\nimport {\n Component,\n ElementRef,\n Input,\n OnInit,\n OnChanges,\n Renderer2,\n SimpleChanges,\n Directive,\n ViewEncapsulation,\n HostBinding,\n} from '@angular/core';\n\n//Models\nimport { clamp, OsWindowClass } from '../../classes/OsWindow.class';\n\n//Services\nimport { OsConfigService } from '../../services/os-config/os-config.service';\n\n@Directive({\n selector: `window-title, [window-title], [windowTitle]`,\n exportAs: 'OsWindowTitle',\n})\nexport class OsWindowTitle {}\n\n@Directive({\n selector: `window-content, [window-content], [windowContent]`,\n exportAs: 'WindowContent',\n})\nexport class OsWindowContent {}\n\n@Component({\n selector: 'os-window',\n templateUrl: './os-window.component.html',\n styleUrls: [\n './os-window.component.scss',\n '../../themes/arc/components/window.scss',\n '../../themes/win98/components/window.scss',\n ],\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'os-window',\n },\n})\nexport class OsWindowComponent implements OnInit, OnChanges {\n public win!: OsWindowClass;\n\n constructor(\n public componentElement: ElementRef<HTMLElement>,\n public renderer: Renderer2,\n public globalConfigService: OsConfigService\n ) {\n this.win = new OsWindowClass(\n this.componentElement,\n this.renderer,\n this.globalConfigService\n );\n }\n\n /////////////////////////\n //// Host bindings ////\n /////////////////////////\n\n @HostBinding('style.z-index') get zIndex() {\n return this.win.position.zIndex.current;\n }\n\n //////////////////////\n //// Inputs ////\n //////////////////////\n\n // Component theme //\n @Input()\n get theme(): string {\n return this.win.styleConfig.style.name;\n }\n set theme(v: string) {\n this.win.styleConfig.style.name = v;\n }\n\n @Input()\n get variant(): string {\n return this.win.styleConfig.style.variant;\n }\n set variant(v: string) {\n this.win.styleConfig.style.variant = v;\n }\n\n // Size & position ///\n @Input()\n get minHeight(): Number {\n return this.win.minHeight;\n }\n set minHeight(v: Number) {\n this.win.minHeight = clamp(v || this.win.minHeight);\n }\n\n @Input()\n get minWidth(): Number {\n return this.win.minWidth;\n }\n set minWidth(v: Number) {\n this.win.minWidth = clamp(v || this.win.minWidth);\n }\n\n @Input()\n get height(): Number {\n return this.win.size.height.current;\n }\n set height(v: Number) {\n this.win.size.height.current = clamp(v || this.win.minHeight);\n }\n\n @Input()\n get width(): Number {\n return this.win.size.width.current;\n }\n set width(v: Number) {\n this.win.size.width.current = clamp(v || this.win.minWidth);\n }\n\n //TODO implement PointModel return\n positionStr!: string[];\n @Input()\n set position(v: string) {\n this.positionStr = v.split(' ', 2);\n }\n\n // Rules //\n @Input()\n get resizable(): boolean {\n return this.win.rules.disableResize;\n }\n set resizable(v: boolean) {\n this.win.rules.disableResize = !v;\n }\n\n @Input()\n get minimizable(): boolean {\n return this.win.rules.minimizable;\n }\n set minimizable(v: boolean) {\n this.win.rules.minimizable = v;\n }\n\n @Input()\n get maximizable(): boolean {\n return this.win.rules.maximizable;\n }\n set maximizable(v: boolean) {\n this.win.rules.maximizable = v;\n }\n\n @Input()\n get closable(): boolean {\n return this.win.rules.closable;\n }\n set closable(v: boolean) {\n this.win.rules.closable = v;\n }\n\n ngOnInit(): void {}\n\n ngAfterViewInit() {\n /* We first care about the dimensions and position of the window */\n //Initial width & height, also returns corrected value if bellow minimal\n this.win.setDimesions();\n\n //Sets initial position\n this.win.setPosition(this.positionStr);\n\n /* After dimensions & position we set the themes and rules */\n //Setting theme of component\n this.win.styleConfig.loadStyles();\n //Colored windows someday?\n //this.win.styleConfig.loadColor();\n\n this.win.loadRules();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n //Changing styles on runtime\n this.win.styleConfig.onChanges(changes);\n }\n}\n","<!--\nTO DO:\n- Maximized change screen DELAYED\n- Arc Theme HALF DONE\n- Win98 Theme Check inner shadow scroll right & bottom, next release\n- Revise code\n- Documentation\n- Licencing\n- Release\n\n-->\n\n<div\n class=\"window-child\"\n [style.width]=\"win.size.width.current + win.size.width.unit\"\n [style.height]=\"win.size.height.current + win.size.height.unit\"\n cdkDrag\n (cdkDragStarted)=\"this.win.demaximize()\"\n (cdkDragEnded)=\"this.win.correctEndPosition($event)\"\n [cdkDragFreeDragPosition]=\"this.win.position.current\"\n (mousedown)=\"this.win.storeMousePos($event)\"\n (mousedown)=\"this.win.focus()\">\n <div\n cdkDrag\n cdkDragLockAxis=\"y\"\n (cdkDragStarted)=\"this.win.startResize()\"\n (cdkDragMoved)=\"this.win.resize($event, 'n')\"\n (cdkDragEnded)=\"this.win.endResize()\"\n [cdkDragFreeDragPosition]=\"this.win.cdkAnchors.n\"\n [cdkDragDisabled]=\"this.win.rules.disableResize\"\n (mousedown)=\"this.win.focus()\"\n class=\"window-resize n\"></div>\n <div\n cdkDrag\n (cdkDragStarted)=\"this.win.startResize()\"\n (cdkDragMoved)=\"this.win.resize($event, 'ne')\"\n [cdkDragFreeDragPosition]=\"this.win.cdkAnchors.ne\"\n [cdkDragDisabled]=\"this.win.rules.disableResize\"\n (mousedown)=\"this.win.focus()\"\n class=\"window-resize ne\"></div>\n <div\n cdkDrag\n cdkDragLockAxis=\"x\"\n (cdkDragStarted)=\"this.win.startResize()\"\n (cdkDragMoved)=\"this.win.resize($event, 'e')\"\n [cdkDragFreeDragPosition]=\"this.win.cdkAnchors.e\"\n [cdkDragDisabled]=\"this.win.rules.disableResize\"\n (mousedown)=\"this.win.focus()\"\n class=\"window-resize e\"></div>\n <div\n cdkDrag\n (cdkDragStarted)=\"this.win.startResize()\"\n (cdkDragMoved)=\"this.win.resize($event, 'se')\"\n [cdkDragFreeDragPosition]=\"this.win.cdkAnchors.se\"\n [cdkDragDisabled]=\"this.win.rules.disableResize\"\n (mousedown)=\"this.win.focus()\"\n class=\"window-resize se\"></div>\n <div\n cdkDrag\n cdkDragLockAxis=\"y\"\n (cdkDragStarted)=\"this.win.startResize()\"\n (cdkDragMoved)=\"this.win.resize($event, 's')\"\n [cdkDragFreeDragPosition]=\"this.win.cdkAnchors.s\"\n [cdkDragDisabled]=\"this.win.rules.disableResize\"\n (mousedown)=\"this.win.focus()\"\n class=\"window-resize s\"></div>\n <div\n cdkDrag\n (cdkDragStarted)=\"this.win.startResize()\"\n (cdkDragMoved)=\"this.win.resize($event, 'sw')\"\n (cdkDragEnded)=\"this.win.endResize()\"\n [cdkDragFreeDragPosition]=\"this.win.cdkAnchors.sw\"\n [cdkDragDisabled]=\"this.win.rules.disableResize\"\n (mousedown)=\"this.win.focus()\"\n class=\"window-resize sw\"></div>\n <div\n cdkDrag\n cdkDragLockAxis=\"x\"\n (cdkDragStarted)=\"this.win.startResize()\"\n (cdkDragMoved)=\"this.win.resize($event, 'w')\"\n (cdkDragEnded)=\"this.win.endResize()\"\n [cdkDragFreeDragPosition]=\"this.win.cdkAnchors.w\"\n [cdkDragDisabled]=\"this.win.rules.disableResize\"\n (mousedown)=\"this.win.focus()\"\n class=\"window-resize w\"></div>\n <div\n cdkDrag\n (cdkDragStarted)=\"this.win.startResize()\"\n (cdkDragMoved)=\"this.win.resize($event, 'nw')\"\n (cdkDragEnded)=\"this.win.endResize()\"\n [cdkDragFreeDragPosition]=\"this.win.cdkAnchors.nw\"\n [cdkDragDisabled]=\"this.win.rules.disableResize\"\n (mousedown)=\"this.win.focus()\"\n class=\"window-resize nw\"></div>\n\n <div class=\"window-bar\">\n <div\n class=\"window-bar-anchor\"\n cdkDragHandle\n (dblclick)=\"this.win.maximize()\">\n <div class=\"window-title\">\n <ng-content\n select=\"window-title, [window-title], [windowTitle]\"></ng-content>\n </div>\n\n <div class=\"controls-separator\"></div>\n\n <div class=\"controls-container\">\n <button class=\"control minimize\" (click)=\"this.win.minimize()\"></button>\n <button class=\"control maximize\" (click)=\"this.win.maximize()\"></button>\n <button class=\"control close\" (click)=\"this.win.close()\"></button>\n </div>\n </div>\n </div>\n\n <div class=\"window-content\">\n <ng-scrollbar\n [class]=\"theme + '-scrollbar'\"\n track=\"all\"\n trackClass=\"os-scrollbar-track\"\n thumbClass=\"os-scrollbar-thumb\">\n <ng-content select=\"window-content, [window-content], [windowContent]\">\n </ng-content>\n </ng-scrollbar>\n </div>\n</div>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n//Custom scrollbars\nimport { NgScrollbarModule } from 'ngx-scrollbar';\n\n//Component\nimport {\n OsWindowComponent,\n OsWindowContent,\n OsWindowTitle,\n} from './os-window.component';\n\n//cdk\nimport { DragDropModule } from '@angular/cdk/drag-drop';\n\n@NgModule({\n declarations: [OsWindowComponent, OsWindowContent, OsWindowTitle],\n imports: [CommonModule, DragDropModule, NgScrollbarModule],\n exports: [OsWindowComponent, OsWindowContent, OsWindowTitle],\n})\nexport class OsWindowModule {}\n","import { CssSelector } from '@angular/compiler';\nimport {\n Component,\n ElementRef,\n Input,\n OnChanges,\n OnInit,\n Renderer2,\n SimpleChanges,\n ViewEncapsulation,\n} from '@angular/core';\nimport { OsConfigService } from '../../services/os-config/os-config.service';\nimport { StyleClass } from '../../classes/Style.class';\n\n@Component({\n selector: `button[os-button], button[os-icon-button],\n a[os-button], a[os-icon-button]`,\n templateUrl: './os-button.component.html',\n styleUrls: [\n './os-button.component.scss',\n '../../themes/arc/components/buttons.scss',\n '../../themes/win98/components/buttons.scss',\n ],\n encapsulation: ViewEncapsulation.None,\n})\nexport class OsButtonComponent implements OnInit, OnChanges {\n public componentElement!: ElementRef<HTMLElement>;\n private renderer!: Renderer2;\n private globalConfigService!: OsConfigService;\n public styleConfig!: StyleClass;\n\n constructor(\n private _componentElement: ElementRef,\n private _renderer: Renderer2,\n private _globalConfigService: OsConfigService\n ) {\n this.componentElement = _componentElement;\n this.renderer = _renderer;\n this.globalConfigService = _globalConfigService;\n\n this.styleConfig = new StyleClass(\n _componentElement,\n _renderer,\n _globalConfigService,\n 'button'\n );\n }\n\n //////////////////////\n //// Inputs ////\n //////////////////////\n\n //\n // Component theme //\n //\n @Input()\n get theme(): string {\n return this.styleConfig.style.name;\n }\n set theme(v: string) {\n this.styleConfig.style.name = v;\n }\n\n @Input()\n get variant(): string {\n return this.styleConfig.style.variant;\n }\n set variant(v: string) {\n this.styleConfig.style.variant = v;\n }\n\n @Input()\n get color(): string {\n return this.styleConfig.style.color || '';\n }\n set color(v: string) {\n this.styleConfig.style.color = v;\n }\n\n ngOnInit(): void {}\n\n ngAfterViewInit(): void {\n this.styleConfig.loadStyles();\n this.styleConfig.loadColor();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n this.styleConfig.onChanges(changes);\n }\n}\n","<ng-content></ng-content>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { OsButtonComponent } from './os-button.component';\n\n@NgModule({\n declarations: [OsButtonComponent],\n imports: [CommonModule],\n exports: [OsButtonComponent],\n})\nexport class OsButtonModule {}\n","import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n ElementRef,\n Input,\n OnChanges,\n OnInit,\n Renderer2,\n SimpleChanges,\n ViewEncapsulation,\n} from '@angular/core';\nimport { OsConfigService } from '../../services/os-config/os-config.service';\nimport { StyleClass } from '../../classes/Style.class';\n\n@Component({\n selector: `os-radio`,\n templateUrl: './os-radio.component.html',\n styleUrls: [\n './os-radio.component.scss',\n '../../themes/win98/components/radio.scss',\n '../../themes/arc/components/radio.scss',\n ],\n encapsulation: ViewEncapsulation.None,\n})\nexport class OsRadioComponent implements OnInit, OnChanges {\n public styleConfig!: StyleClass;\n\n constructor(\n public componentElement: ElementRef,\n public renderer: Renderer2,\n public globalConfigService: OsConfigService\n ) {\n this.styleConfig = new StyleClass(\n componentElement,\n renderer,\n globalConfigService,\n 'radio'\n );\n }\n\n //////////////////////\n //// Inputs ////\n //////////////////////\n\n //\n // Component theme //\n //\n @Input()\n get theme(): string {\n return this.styleConfig.style.name;\n }\n set theme(v: string) {\n this.styleConfig.style.name = v;\n }\n\n @Input()\n get variant(): string {\n return this.styleConfig.style.variant;\n }\n set variant(v: string) {\n this.styleConfig.style.variant = v;\n }\n\n @Input()\n get color(): string {\n return this.styleConfig.style.color || '';\n }\n set color(v: string) {\n this.styleConfig.style.color = v;\n }\n\n /** Where the label should appear */\n private _labelPosition: 'before' | 'after' = 'after';\n public flexDirection: string = 'row';\n\n @Input()\n set labelPosition(v: 'before' | 'after') {\n this._labelPosition = v;\n }\n\n private _uniqueId: string = '';\n private _name: string = '';\n private _ariaLabel: string = '';\n private _ariaLabelledby: string = '';\n private _ariaDescribedby: string = '';\n private _checked: boolean = false;\n private _value: any = null;\n private _disabled: boolean = false;\n private _required: boolean = false;\n\n @Input()\n get id(): string {\n return this._uniqueId;\n }\n set id(v: string) {\n this._uniqueId = v;\n }\n\n /** Analog to HTML 'name' attribute used to group radios for unique selection. */\n @Input()\n get name(): string {\n return this._name;\n }\n set name(v: string) {\n this._name = v;\n }\n\n /** Used to set the 'aria-label' attribute on the underlying input element. */\n @Input('aria-label')\n get ariaLabel(): string {\n return this._ariaLabel;\n }\n set ariaLabel(v: string) {\n this._ariaLabel = v;\n }\n\n /** The 'aria-labelledby' attribute takes precedence as the element's text alternative. */\n @Input('aria-labelledby')\n get ariaLabelledby(): string {\n return this._ariaLabelledby;\n }\n set ariaLabelledby(v: string) {\n this._ariaLabelledby = v;\n }\n\n /** The 'aria-describedby' attribute is read after the element's label and field type. */\n @Input('aria-describedby')\n get ariaDescribedby(): string {\n return this._ariaDescribedby;\n }\n set ariaDescribedby(v: string) {\n this._ariaDescribedby = v;\n }\n\n /** Whether this radio button is checked. */\n @Input()\n get checked(): boolean {\n return this._checked;\n }\n set checked(v: BooleanInput) {\n this._checked = coerceBooleanProperty(v);\n }\n\n /** The value of this radio button. */\n @Input()\n get value(): any {\n return this._value;\n }\n set value(v: any) {\n this._value = v;\n }\n\n /** Whether the radio button is disabled. */\n @Input()\n get disabled(): boolean {\n return this._disabled;\n }\n set disabled(v: BooleanInput) {\n this._disabled = coerceBooleanProperty(v);\n }\n\n /** Whether the radio button is required. */\n @Input()\n get required(): boolean {\n return this._required;\n }\n set required(v: BooleanInput) {\n this._required = coerceBooleanProperty(v);\n }\n\n ngOnInit(): void {\n //This chooses the flex direction of the container\n\n if (this._labelPosition == 'after') {\n this.flexDirection = 'row';\n } else {\n this.flexDirection = 'row-reverse';\n }\n }\n\n ngAfterViewInit(): void {\n this.styleConfig.loadStyles();\n this.styleConfig.loadColor();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n this.styleConfig.onChanges(changes);\n }\n\n check(input: HTMLInputElement) {\n input.checked = true;\n input.focus();\n }\n}\n","<div\n class=\"radio-container flex w-fit items-center\"\n [style.flex-direction]=\"flexDirection\"\n (click)=\"radio.disabled ? undefined : check(radio)\">\n <input\n type=\"radio\"\n #radio\n [id]=\"id\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [attr.name]=\"name\"\n [attr.value]=\"value\"\n [required]=\"required\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-describedby]=\"ariaDescribedby\" />\n\n <label\n [attr.for]=\"id\"\n [class.disabled]=\"disabled\"\n class=\"flex cursor-pointer items-center\">\n <span>\n <ng-content></ng-content>\n </span>\n </label>\n</div>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { OsRadioComponent } from './os-radio.component';\n\n@NgModule({\n declarations: [OsRadioComponent],\n imports: [CommonModule],\n exports: [OsRadioComponent],\n})\nexport class OsRadioModule {}\n","/*\n * Public API Surface of os-window-angular\n */\n\n// Types\n\nexport * from './lib/models/Theme.model';\n\n// Services\n\nexport * from './lib/services/os-config/os-config.service';\n\n// Components\n\nexport * from './lib/components/os-window/os-window.component';\nexport * from './lib/components/os-window/os-window.module';\n\nexport * from './lib/components/os-button/os-button.component';\nexport * from './lib/components/os-button/os-button.module';\n\nexport * from './lib/components/os-radio/os-radio.component';\nexport * from './lib/components/os-radio/os-radio.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.OsConfigService"],"mappings":";;;;;;;;;AAEO,MAAM,UAAU,GAAsB;AAC3C,IAAA;AACE,QAAA,IAAI,EAAE,KAAK;AACX,QAAA,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;AAC3B,QAAA,OAAO,EAAE;YACP,KAAK;YACL,QAAQ;YACR,QAAQ;YACR,MAAM;YACN,OAAO;YACP,MAAM;YACN,MAAM;YACN,QAAQ;YACR,SAAS;AACV,SAAA;AACF,KAAA;AACD,IAAA;AACE,QAAA,IAAI,EAAE,OAAO;AACb,QAAA,QAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC;AAClC,QAAA,OAAO,EAAE;YACP,KAAK;YACL,QAAQ;YACR,QAAQ;YACR,MAAM;YACN,OAAO;YACP,MAAM;YACN,MAAM;YACN,QAAQ;YACR,SAAS;AACV,SAAA;AACF,KAAA;CACF;;MCzBY,eAAe,CAAA;AAC1B,IAAA,WAAA,GAAA;AAEQ,QAAA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