fontastic 0.1.3
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/.editorconfig +16 -0
- package/.eslintrc.json +54 -0
- package/.github/FUNDING.yml +12 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +29 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.github/dependabot.yml +6 -0
- package/.github/pull_request_template.md +21 -0
- package/.github/stale.yml +17 -0
- package/.github/workflows/macos.yml +58 -0
- package/.github/workflows/ubuntu.yml +70 -0
- package/.github/workflows/windows.yml +64 -0
- package/.node-version +1 -0
- package/.vscode/launch.json +46 -0
- package/.vscode/tasks.json +49 -0
- package/CODE_OF_CONDUCT.md +45 -0
- package/CONTRIBUTING.md +72 -0
- package/LICENSE +21 -0
- package/README.md +111 -0
- package/_config.yml +1 -0
- package/angular.json +194 -0
- package/angular.webpack.js +32 -0
- package/app/Application.js +40 -0
- package/app/Application.ts +38 -0
- package/app/config/alert.ts +32 -0
- package/app/config/database.js +203 -0
- package/app/config/database.ts +202 -0
- package/app/config/index.js +20 -0
- package/app/config/index.ts +3 -0
- package/app/config/mimes.js +49 -0
- package/app/config/mimes.ts +54 -0
- package/app/config/system.js +497 -0
- package/app/config/system.ts +498 -0
- package/app/config/themes.ts +38 -0
- package/app/core/AppLogger.js +31 -0
- package/app/core/AppLogger.ts +38 -0
- package/app/core/ConfigManager.js +114 -0
- package/app/core/ConfigManager.ts +137 -0
- package/app/core/ConnectionManager.js +83 -0
- package/app/core/ConnectionManager.ts +95 -0
- package/app/core/FontCatalog.js +51 -0
- package/app/core/FontCatalog.ts +42 -0
- package/app/core/FontFinder.js +86 -0
- package/app/core/FontFinder.ts +96 -0
- package/app/core/FontInstaller.js +67 -0
- package/app/core/FontInstaller.ts +63 -0
- package/app/core/FontManager.js +165 -0
- package/app/core/FontManager.ts +172 -0
- package/app/core/FontObject.js +54 -0
- package/app/core/FontObject.ts +62 -0
- package/app/core/MessageHandler.js +272 -0
- package/app/core/MessageHandler.ts +337 -0
- package/app/core/SystemManager.js +140 -0
- package/app/core/SystemManager.ts +171 -0
- package/app/core/menu/Example.ts +280 -0
- package/app/core/menu/MenuBuilder.js +45 -0
- package/app/core/menu/MenuBuilder.ts +53 -0
- package/app/core/menu/templates/DarwinTemplate.js +127 -0
- package/app/core/menu/templates/DarwinTemplate.ts +142 -0
- package/app/core/menu/templates/SystemTemplate.js +124 -0
- package/app/core/menu/templates/SystemTemplate.ts +139 -0
- package/app/database/entity/Collection.schema.js +99 -0
- package/app/database/entity/Collection.schema.ts +68 -0
- package/app/database/entity/Logger.schema.js +50 -0
- package/app/database/entity/Logger.schema.ts +26 -0
- package/app/database/entity/Store.schema.js +165 -0
- package/app/database/entity/Store.schema.ts +116 -0
- package/app/database/entity/index.js +20 -0
- package/app/database/entity/index.ts +3 -0
- package/app/database/repository/Collection.repository.js +181 -0
- package/app/database/repository/Collection.repository.ts +190 -0
- package/app/database/repository/Logger.repository.js +25 -0
- package/app/database/repository/Logger.repository.ts +11 -0
- package/app/database/repository/Store.repository.js +328 -0
- package/app/database/repository/Store.repository.ts +358 -0
- package/app/database/repository/User.repository.js +12 -0
- package/app/database/repository/User.repository.ts +8 -0
- package/app/database/repository/index.js +20 -0
- package/app/database/repository/index.ts +3 -0
- package/app/enums/ChannelType.js +62 -0
- package/app/enums/ChannelType.ts +65 -0
- package/app/enums/StorageType.js +19 -0
- package/app/enums/index.js +19 -0
- package/app/enums/index.ts +2 -0
- package/app/enums/storageType.ts +14 -0
- package/app/helpers/command.js +28 -0
- package/app/helpers/command.ts +20 -0
- package/app/helpers/random.js +16 -0
- package/app/helpers/random.ts +12 -0
- package/app/main.js +82 -0
- package/app/main.ts +94 -0
- package/app/package-lock.json +2649 -0
- package/app/package.json +35 -0
- package/app/types/AppAlert.js +3 -0
- package/app/types/AppAlert.ts +8 -0
- package/app/types/AuthUser.js +7 -0
- package/app/types/AuthUser.ts +5 -0
- package/app/types/Breadcrumb.js +3 -0
- package/app/types/Breadcrumb.ts +5 -0
- package/app/types/ImportOptions.js +7 -0
- package/app/types/ImportOptions.ts +3 -0
- package/app/types/QueryOptions.js +3 -0
- package/app/types/QueryOptions.ts +12 -0
- package/app/types/SystemConfig.js +3 -0
- package/app/types/SystemConfig.ts +132 -0
- package/app/types/SystemStats.js +3 -0
- package/app/types/SystemStats.ts +7 -0
- package/app/types/SystemTheme.js +3 -0
- package/app/types/SystemTheme.ts +5 -0
- package/app/types/index.js +25 -0
- package/app/types/index.ts +8 -0
- package/docs/logo.png +0 -0
- package/docs/screenshots/readme.md +7 -0
- package/docs/screenshots/screen-grab1.png +0 -0
- package/docs/screenshots/screen-grab2.png +0 -0
- package/docs/screenshots/screen-grab3.png +0 -0
- package/e2e/main.spec.ts +59 -0
- package/e2e/playwright.config.ts +19 -0
- package/e2e/tsconfig.e2e.json +13 -0
- package/electron-builder.json +71 -0
- package/package.json +121 -0
- package/src/app/app-routing.module.ts +15 -0
- package/src/app/app.component.html +1 -0
- package/src/app/app.component.scss +0 -0
- package/src/app/app.component.spec.ts.dist +33 -0
- package/src/app/app.component.ts +37 -0
- package/src/app/app.module.ts +63 -0
- package/src/app/core/core.module.ts +11 -0
- package/src/app/core/model/AuthUserModel.ts +7 -0
- package/src/app/core/model/CustomThemeModel.ts +7 -0
- package/src/app/core/model/DbConnectionModel.ts +16 -0
- package/src/app/core/model/ImportOptionsModel.ts +5 -0
- package/src/app/core/model/LatestNewsModel.ts +7 -0
- package/src/app/core/model/SearchFormModel.ts +10 -0
- package/src/app/core/model/index.ts +6 -0
- package/src/app/core/services/alert/alert.service.spec.ts +22 -0
- package/src/app/core/services/alert/alert.service.ts +71 -0
- package/src/app/core/services/auth/auth.service.ts +30 -0
- package/src/app/core/services/boot/boot.service.ts +33 -0
- package/src/app/core/services/breadcrumb/breadcrumb.service.spec.ts +22 -0
- package/src/app/core/services/breadcrumb/breadcrumb.service.ts +30 -0
- package/src/app/core/services/config/config.service.ts +63 -0
- package/src/app/core/services/database/database.service.ts +286 -0
- package/src/app/core/services/electron/electron.service.spec.ts +12 -0
- package/src/app/core/services/electron/electron.service.ts +62 -0
- package/src/app/core/services/font/font.service.ts +79 -0
- package/src/app/core/services/gravatar/gravatar.service.spec.ts +16 -0
- package/src/app/core/services/gravatar/gravatar.service.ts +18 -0
- package/src/app/core/services/index.ts +14 -0
- package/src/app/core/services/message/message.service.ts +289 -0
- package/src/app/core/services/modal/modal.service.spec.ts +16 -0
- package/src/app/core/services/modal/modal.service.ts +34 -0
- package/src/app/core/services/news/news.service.ts +94 -0
- package/src/app/core/services/presentation/presentation.service.ts +341 -0
- package/src/app/core/services/utils/utils.service.spec.ts +12 -0
- package/src/app/core/services/utils/utils.service.ts +144 -0
- package/src/app/layout/aside/aside.component.html +9 -0
- package/src/app/layout/aside/aside.component.scss +1 -0
- package/src/app/layout/aside/aside.component.ts +26 -0
- package/src/app/layout/footer/footer.component.html +11 -0
- package/src/app/layout/footer/footer.component.scss +27 -0
- package/src/app/layout/footer/footer.component.ts +32 -0
- package/src/app/layout/header/header.component.html +35 -0
- package/src/app/layout/header/header.component.scss +60 -0
- package/src/app/layout/header/header.component.ts +229 -0
- package/src/app/layout/layout.component.html +14 -0
- package/src/app/layout/layout.component.scss +119 -0
- package/src/app/layout/layout.component.ts +23 -0
- package/src/app/layout/layout.module.ts +32 -0
- package/src/app/layout/layout.service.ts +13 -0
- package/src/app/layout/navigation/navigation.component.html +142 -0
- package/src/app/layout/navigation/navigation.component.scss +0 -0
- package/src/app/layout/navigation/navigation.component.ts +302 -0
- package/src/app/pages/main/grid/grid.component.html +160 -0
- package/src/app/pages/main/grid/grid.component.scss +3 -0
- package/src/app/pages/main/grid/grid.component.ts +98 -0
- package/src/app/pages/main/inspect/inspect.component.html +7 -0
- package/src/app/pages/main/inspect/inspect.component.scss +3 -0
- package/src/app/pages/main/inspect/inspect.component.ts +66 -0
- package/src/app/pages/main/main-routing.module.ts +30 -0
- package/src/app/pages/main/main.component.html +6 -0
- package/src/app/pages/main/main.component.scss +191 -0
- package/src/app/pages/main/main.component.ts +35 -0
- package/src/app/pages/main/main.module.ts +28 -0
- package/src/app/pages/main/preview/preview.component.html +46 -0
- package/src/app/pages/main/preview/preview.component.scss +0 -0
- package/src/app/pages/main/preview/preview.component.ts +239 -0
- package/src/app/pages/main/toolbar/toolbar.component.html +78 -0
- package/src/app/pages/main/toolbar/toolbar.component.scss +3 -0
- package/src/app/pages/main/toolbar/toolbar.component.ts +132 -0
- package/src/app/shared/components/alert/alert.component.html +9 -0
- package/src/app/shared/components/alert/alert.component.scss +0 -0
- package/src/app/shared/components/alert/alert.component.ts +37 -0
- package/src/app/shared/components/breadcrumbs/breadcrumbs.component.html +14 -0
- package/src/app/shared/components/breadcrumbs/breadcrumbs.component.scss +0 -0
- package/src/app/shared/components/breadcrumbs/breadcrumbs.component.ts +36 -0
- package/src/app/shared/components/button/button.component.html +3 -0
- package/src/app/shared/components/button/button.component.scss +2 -0
- package/src/app/shared/components/button/button.component.ts +22 -0
- package/src/app/shared/components/collection/create-collection/create-collection.component.html +41 -0
- package/src/app/shared/components/collection/create-collection/create-collection.component.scss +0 -0
- package/src/app/shared/components/collection/create-collection/create-collection.component.ts +68 -0
- package/src/app/shared/components/collection/form-collection/form-collection.component.html +1 -0
- package/src/app/shared/components/collection/form-collection/form-collection.component.scss +0 -0
- package/src/app/shared/components/collection/form-collection/form-collection.component.ts +15 -0
- package/src/app/shared/components/collection/update-collection/update-collection.component.html +40 -0
- package/src/app/shared/components/collection/update-collection/update-collection.component.scss +0 -0
- package/src/app/shared/components/collection/update-collection/update-collection.component.ts +71 -0
- package/src/app/shared/components/glyph-list/glyph-list.component.html +40 -0
- package/src/app/shared/components/glyph-list/glyph-list.component.scss +1 -0
- package/src/app/shared/components/glyph-list/glyph-list.component.ts +165 -0
- package/src/app/shared/components/glyph-view/glyph-view.component.html +23 -0
- package/src/app/shared/components/glyph-view/glyph-view.component.scss +0 -0
- package/src/app/shared/components/glyph-view/glyph-view.component.ts +228 -0
- package/src/app/shared/components/index.ts +16 -0
- package/src/app/shared/components/loading/loading.component.html +1 -0
- package/src/app/shared/components/loading/loading.component.scss +0 -0
- package/src/app/shared/components/loading/loading.component.ts +26 -0
- package/src/app/shared/components/modal/modal.component.html +31 -0
- package/src/app/shared/components/modal/modal.component.scss +0 -0
- package/src/app/shared/components/modal/modal.component.ts +51 -0
- package/src/app/shared/components/page-not-found/page-not-found.component.html +3 -0
- package/src/app/shared/components/page-not-found/page-not-found.component.scss +0 -0
- package/src/app/shared/components/page-not-found/page-not-found.component.ts +12 -0
- package/src/app/shared/components/paginator/paginator.component.html +21 -0
- package/src/app/shared/components/paginator/paginator.component.scss +3 -0
- package/src/app/shared/components/paginator/paginator.component.ts +133 -0
- package/src/app/shared/components/pairing/pairing.component.html +20 -0
- package/src/app/shared/components/pairing/pairing.component.scss +0 -0
- package/src/app/shared/components/pairing/pairing.component.ts +33 -0
- package/src/app/shared/components/search/search.component.html +54 -0
- package/src/app/shared/components/search/search.component.scss +10 -0
- package/src/app/shared/components/search/search.component.ts +77 -0
- package/src/app/shared/components/settings/database/database.component.html +151 -0
- package/src/app/shared/components/settings/database/database.component.scss +0 -0
- package/src/app/shared/components/settings/database/database.component.ts +145 -0
- package/src/app/shared/components/settings/general/general.component.html +170 -0
- package/src/app/shared/components/settings/general/general.component.scss +0 -0
- package/src/app/shared/components/settings/general/general.component.ts +150 -0
- package/src/app/shared/components/settings/logs/logs.component.html +44 -0
- package/src/app/shared/components/settings/logs/logs.component.scss +0 -0
- package/src/app/shared/components/settings/logs/logs.component.ts +37 -0
- package/src/app/shared/components/settings/news/news.component.html +41 -0
- package/src/app/shared/components/settings/news/news.component.scss +0 -0
- package/src/app/shared/components/settings/news/news.component.ts +52 -0
- package/src/app/shared/components/settings/settings.component.html +46 -0
- package/src/app/shared/components/settings/settings.component.scss +0 -0
- package/src/app/shared/components/settings/settings.component.ts +23 -0
- package/src/app/shared/components/settings/system/system.component.html +30 -0
- package/src/app/shared/components/settings/system/system.component.scss +0 -0
- package/src/app/shared/components/settings/system/system.component.ts +43 -0
- package/src/app/shared/components/settings/theme/theme.component.html +22 -0
- package/src/app/shared/components/settings/theme/theme.component.scss +0 -0
- package/src/app/shared/components/settings/theme/theme.component.ts +50 -0
- package/src/app/shared/components/spinner/spinner.component.html +1 -0
- package/src/app/shared/components/spinner/spinner.component.scss +0 -0
- package/src/app/shared/components/spinner/spinner.component.ts +26 -0
- package/src/app/shared/components/store/store.component.html +22 -0
- package/src/app/shared/components/store/store.component.scss +10 -0
- package/src/app/shared/components/store/store.component.ts +58 -0
- package/src/app/shared/components/tables/tables.component.html +47 -0
- package/src/app/shared/components/tables/tables.component.scss +10 -0
- package/src/app/shared/components/tables/tables.component.ts +81 -0
- package/src/app/shared/components/typescale/typescale.component.html +53 -0
- package/src/app/shared/components/typescale/typescale.component.scss +0 -0
- package/src/app/shared/components/typescale/typescale.component.ts +168 -0
- package/src/app/shared/directives/gravatar/gravatar.directive.ts +29 -0
- package/src/app/shared/directives/index.ts +2 -0
- package/src/app/shared/directives/webview/webview.directive.ts +8 -0
- package/src/app/shared/pipes/installable.pipe.ts +10 -0
- package/src/app/shared/pipes/prettybytes.pipe.ts +10 -0
- package/src/app/shared/pipes/safehtml.pipe.ts +10 -0
- package/src/app/shared/shared.module.ts +92 -0
- package/src/assets/.gitkeep +0 -0
- package/src/assets/fonts/fa/fa-brands-400.eot +0 -0
- package/src/assets/fonts/fa/fa-brands-400.svg +3535 -0
- package/src/assets/fonts/fa/fa-brands-400.ttf +0 -0
- package/src/assets/fonts/fa/fa-brands-400.woff +0 -0
- package/src/assets/fonts/fa/fa-brands-400.woff2 +0 -0
- package/src/assets/fonts/fa/fa-regular-400.eot +0 -0
- package/src/assets/fonts/fa/fa-regular-400.svg +803 -0
- package/src/assets/fonts/fa/fa-regular-400.ttf +0 -0
- package/src/assets/fonts/fa/fa-regular-400.woff +0 -0
- package/src/assets/fonts/fa/fa-regular-400.woff2 +0 -0
- package/src/assets/fonts/fa/fa-solid-900.eot +0 -0
- package/src/assets/fonts/fa/fa-solid-900.svg +4700 -0
- package/src/assets/fonts/fa/fa-solid-900.ttf +0 -0
- package/src/assets/fonts/fa/fa-solid-900.woff +0 -0
- package/src/assets/fonts/fa/fa-solid-900.woff2 +0 -0
- package/src/assets/fonts/md/MaterialIcons-Regular.eot +0 -0
- package/src/assets/fonts/md/MaterialIcons-Regular.ijmap +1 -0
- package/src/assets/fonts/md/MaterialIcons-Regular.svg +2373 -0
- package/src/assets/fonts/md/MaterialIcons-Regular.ttf +0 -0
- package/src/assets/fonts/md/MaterialIcons-Regular.woff +0 -0
- package/src/assets/fonts/md/MaterialIcons-Regular.woff2 +0 -0
- package/src/assets/fonts/md/README.md +9 -0
- package/src/assets/fonts/md/codepoints +932 -0
- package/src/assets/fonts/md/material-icons.css +36 -0
- package/src/assets/fonts/octicon/octicon.eot +0 -0
- package/src/assets/fonts/octicon/octicon.svg +378 -0
- package/src/assets/fonts/octicon/octicon.ttf +0 -0
- package/src/assets/fonts/octicon/octicon.woff +0 -0
- package/src/assets/fonts/octicon/octicon.woff2 +0 -0
- package/src/assets/fonts/roboto/Roboto-Bold-webfont.eot +0 -0
- package/src/assets/fonts/roboto/Roboto-Bold-webfont.svg +607 -0
- package/src/assets/fonts/roboto/Roboto-Bold-webfont.ttf +0 -0
- package/src/assets/fonts/roboto/Roboto-Bold-webfont.woff +0 -0
- package/src/assets/fonts/roboto/Roboto-Medium-webfont.eot +0 -0
- package/src/assets/fonts/roboto/Roboto-Medium-webfont.svg +607 -0
- package/src/assets/fonts/roboto/Roboto-Medium-webfont.ttf +0 -0
- package/src/assets/fonts/roboto/Roboto-Medium-webfont.woff +0 -0
- package/src/assets/fonts/roboto/Roboto-Regular-webfont.eot +0 -0
- package/src/assets/fonts/roboto/Roboto-Regular-webfont.svg +635 -0
- package/src/assets/fonts/roboto/Roboto-Regular-webfont.ttf +0 -0
- package/src/assets/fonts/roboto/Roboto-Regular-webfont.woff +0 -0
- package/src/assets/i18n/en.json +12 -0
- package/src/assets/icons/android-chrome-192x192.png +0 -0
- package/src/assets/icons/android-chrome-512x512.png +0 -0
- package/src/assets/icons/apple-touch-icon.png +0 -0
- package/src/assets/icons/favicon-16x16.png +0 -0
- package/src/assets/icons/favicon-32x32.png +0 -0
- package/src/assets/icons/favicon.ico +0 -0
- package/src/assets/icons/site.webmanifest +1 -0
- package/src/assets/images/electron.bmp +0 -0
- package/src/bin/activator +0 -0
- package/src/bin/activator.exe +0 -0
- package/src/environments/environment.dev.ts +4 -0
- package/src/environments/environment.prod.ts +4 -0
- package/src/environments/environment.ts +4 -0
- package/src/environments/environment.web.prod.ts +4 -0
- package/src/environments/environment.web.ts +4 -0
- package/src/favicon.ico +0 -0
- package/src/index.html +55 -0
- package/src/karma.conf.js +50 -0
- package/src/main.ts +15 -0
- package/src/polyfills-test.ts +1 -0
- package/src/polyfills.ts +53 -0
- package/src/styles/base/loading.scss +87 -0
- package/src/styles/base/reset.scss +408 -0
- package/src/styles/components/alert.scss +54 -0
- package/src/styles/components/buttons.scss +93 -0
- package/src/styles/components/forms.scss +96 -0
- package/src/styles/components/inputs.scss +113 -0
- package/src/styles/components/modal.scss +52 -0
- package/src/styles/components/paginator.scss +108 -0
- package/src/styles/components/scrollbox.scss +71 -0
- package/src/styles/components/spinner.scss +11 -0
- package/src/styles/components/tables.scss +42 -0
- package/src/styles/components/tabs.scss +44 -0
- package/src/styles/components/toolbar.scss +130 -0
- package/src/styles/fonts/md.scss +54 -0
- package/src/styles/fonts/octicons.scss +1351 -0
- package/src/styles/fonts/roboto.scss +32 -0
- package/src/styles/themes/dashboard.scss +294 -0
- package/src/styles/themes/euphoria.scss +283 -0
- package/src/styles/themes/mellow.scss +280 -0
- package/src/styles/themes/midnight.scss +283 -0
- package/src/styles/themes/passion.scss +280 -0
- package/src/styles/themes/swiss.scss +283 -0
- package/src/styles/tools/_functions.scss +5 -0
- package/src/styles/tools/_mixins.scss +159 -0
- package/src/styles/tools/_placeholders.scss +17 -0
- package/src/styles/tools/_variables.scss +67 -0
- package/src/styles.scss +37 -0
- package/src/test.ts +22 -0
- package/src/tsconfig.app.json +20 -0
- package/src/tsconfig.spec.json +23 -0
- package/src/typings.d.ts +9 -0
- package/tailwind.config.js +67 -0
- package/tsconfig.json +42 -0
- package/tsconfig.serve.json +27 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { BehaviorSubject } from 'rxjs';
|
|
3
|
+
import { ConfigService } from '../config/config.service';
|
|
4
|
+
import { MessageService } from '../message/message.service';
|
|
5
|
+
import { ElectronService } from '@app/core/services/electron/electron.service';
|
|
6
|
+
import { AppThemes, ThemeColors } from '@main/config/themes';
|
|
7
|
+
import { SystemTheme, LayoutPanelType, LayoutPreviewType, LayoutThemeType } from '@main/types';
|
|
8
|
+
import { StorageType } from '@main/enums';
|
|
9
|
+
|
|
10
|
+
export class ScrollToOptions {
|
|
11
|
+
id: string;
|
|
12
|
+
type: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@Injectable({
|
|
16
|
+
providedIn: 'root'
|
|
17
|
+
})
|
|
18
|
+
export class PresentationService {
|
|
19
|
+
|
|
20
|
+
quickText: any[] = [{
|
|
21
|
+
title: 'default',
|
|
22
|
+
text: 'The quick brown fox jumped over the lazy dog.'
|
|
23
|
+
}, {
|
|
24
|
+
title: 'All Caps',
|
|
25
|
+
text: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
|
26
|
+
}, {
|
|
27
|
+
title: 'Alternating Caps',
|
|
28
|
+
text: 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz'
|
|
29
|
+
}];
|
|
30
|
+
|
|
31
|
+
// Defaults.
|
|
32
|
+
defaultText = 'The quick brown fox jumped over the lazy dog.';
|
|
33
|
+
defaultFontSize = 48;
|
|
34
|
+
defaultFontColor = '#3e4245';
|
|
35
|
+
defaultBackgroundColor = '#ffffff';
|
|
36
|
+
|
|
37
|
+
defaultFillColor = '#808080';
|
|
38
|
+
defaultStrokeColor = '#000000';
|
|
39
|
+
defaultLineColor = '#00a0be';
|
|
40
|
+
|
|
41
|
+
defaultWordSpacing = 0;
|
|
42
|
+
defaultLetterSpacing = 0;
|
|
43
|
+
|
|
44
|
+
_gridEnabled: BehaviorSubject<boolean> = new BehaviorSubject(true);
|
|
45
|
+
_toolbarEnabled: BehaviorSubject<boolean> = new BehaviorSubject(true);
|
|
46
|
+
_previewEnabled: BehaviorSubject<boolean> = new BehaviorSubject(true);
|
|
47
|
+
_inspectEnabled: BehaviorSubject<boolean> = new BehaviorSubject(false);
|
|
48
|
+
_inspectComponent: BehaviorSubject<string> = new BehaviorSubject('glyph-list');
|
|
49
|
+
_navigationEnabled: BehaviorSubject<boolean> = new BehaviorSubject(true);
|
|
50
|
+
_asideEnabled: BehaviorSubject<boolean> = new BehaviorSubject(false);
|
|
51
|
+
_asideComponent = new BehaviorSubject<string>('names');
|
|
52
|
+
_asideTableTabs = new BehaviorSubject<any[]>([]);
|
|
53
|
+
|
|
54
|
+
_statsCollapsed: BehaviorSubject<boolean> = new BehaviorSubject(false);
|
|
55
|
+
_foldersCollapsed: BehaviorSubject<boolean> = new BehaviorSubject(false);
|
|
56
|
+
_optionsCollapsed: BehaviorSubject<boolean> = new BehaviorSubject(false);
|
|
57
|
+
|
|
58
|
+
_systemLoading: BehaviorSubject<boolean> = new BehaviorSubject(true);
|
|
59
|
+
_loadingScreen: BehaviorSubject<boolean> = new BehaviorSubject(false);
|
|
60
|
+
_loadingSpinner: BehaviorSubject<boolean> = new BehaviorSubject(false);
|
|
61
|
+
|
|
62
|
+
_scrollToItem: BehaviorSubject<ScrollToOptions> = new BehaviorSubject(null);
|
|
63
|
+
|
|
64
|
+
_glyphIndex: BehaviorSubject<number> = new BehaviorSubject(0);
|
|
65
|
+
watchGlyphIndex$ = this._glyphIndex.asObservable();
|
|
66
|
+
|
|
67
|
+
_fontSize = new BehaviorSubject<number>(this.defaultFontSize);
|
|
68
|
+
watchFontSize$ = this._fontSize.asObservable();
|
|
69
|
+
|
|
70
|
+
_fontColor = new BehaviorSubject<string>(this.defaultFontColor);
|
|
71
|
+
watchFontColor$ = this._fontColor.asObservable();
|
|
72
|
+
|
|
73
|
+
_displayText = new BehaviorSubject<string>(this.defaultText);
|
|
74
|
+
watchDisplayText$ = this._displayText.asObservable();
|
|
75
|
+
|
|
76
|
+
_backgroundColor = new BehaviorSubject<string>(this.defaultBackgroundColor);
|
|
77
|
+
watchBackgroundColor$ = this._backgroundColor.asObservable();
|
|
78
|
+
|
|
79
|
+
_wordSpacing = new BehaviorSubject<number>(this.defaultWordSpacing);
|
|
80
|
+
watchWordSpacing$ = this._wordSpacing.asObservable();
|
|
81
|
+
|
|
82
|
+
_letterSpacing = new BehaviorSubject<number>(this.defaultLetterSpacing);
|
|
83
|
+
watchLetterSpacing$ = this._letterSpacing.asObservable();
|
|
84
|
+
|
|
85
|
+
_defaultTheme: BehaviorSubject<string> = new BehaviorSubject('default');
|
|
86
|
+
watchDefaultTheme$ = this._defaultTheme.asObservable();
|
|
87
|
+
|
|
88
|
+
_displayNews: BehaviorSubject<boolean> = new BehaviorSubject(false);
|
|
89
|
+
|
|
90
|
+
constructor(
|
|
91
|
+
private configService: ConfigService,
|
|
92
|
+
private messageService: MessageService,
|
|
93
|
+
private electronService: ElectronService
|
|
94
|
+
) {
|
|
95
|
+
if (this.electronService.isElectron) {
|
|
96
|
+
if (this.configService.has(StorageType.LayoutPanel)) {
|
|
97
|
+
this.loadLayoutSettings();
|
|
98
|
+
}
|
|
99
|
+
if (this.configService.has(StorageType.LayoutPreview)) {
|
|
100
|
+
this.loadPreviewSettings();
|
|
101
|
+
}
|
|
102
|
+
if (this.configService.has(StorageType.LayoutTheme)) {
|
|
103
|
+
this.loadThemeSettings();
|
|
104
|
+
}
|
|
105
|
+
this.setThemeVars(this._defaultTheme.getValue());
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
getQuickText(): any {
|
|
110
|
+
return this.quickText;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
setNavigationEnabled(status: any): void {
|
|
114
|
+
this._navigationEnabled.next(status);
|
|
115
|
+
this.saveLayoutSettings();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
setAsideEnabled(status: any): void {
|
|
119
|
+
this._asideEnabled.next(status);
|
|
120
|
+
this.saveLayoutSettings();
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
setAsideComponent(name: any): void {
|
|
124
|
+
this._asideComponent.next(name);
|
|
125
|
+
this.saveLayoutSettings();
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
setAsideTableTabs(tabs: any[]): void {
|
|
129
|
+
this._asideTableTabs.next(tabs);
|
|
130
|
+
this.saveLayoutSettings();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
setGridEnabled(status: any): void {
|
|
134
|
+
this._gridEnabled.next(status);
|
|
135
|
+
this.saveLayoutSettings();
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
setToolbarEnabled(status: any): void {
|
|
139
|
+
this._toolbarEnabled.next(status);
|
|
140
|
+
this.saveLayoutSettings();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
setPreviewEnabled(status: any): void {
|
|
144
|
+
this._previewEnabled.next(status);
|
|
145
|
+
this.saveLayoutSettings();
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
setInspectEnabled(status: any): void {
|
|
149
|
+
this._inspectEnabled.next(status);
|
|
150
|
+
this.saveLayoutSettings();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
setInspectComponent(name: any): void {
|
|
154
|
+
this._inspectComponent.next(name);
|
|
155
|
+
this.saveLayoutSettings();
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
setStatsCollapsed(toggle: any): void {
|
|
159
|
+
this._statsCollapsed.next(toggle);
|
|
160
|
+
this.saveLayoutSettings();
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
setFoldersCollapsed(toggle: any): void {
|
|
164
|
+
this._foldersCollapsed.next(toggle);
|
|
165
|
+
this.saveLayoutSettings();
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
setOptionsCollapsed(toggle: any): void {
|
|
169
|
+
this._optionsCollapsed.next(toggle);
|
|
170
|
+
this.saveLayoutSettings();
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
saveLayoutSettings(): void {
|
|
174
|
+
const settings: LayoutPanelType = {
|
|
175
|
+
_gridEnabled: this._gridEnabled.getValue(),
|
|
176
|
+
_asideEnabled: this._asideEnabled.getValue(),
|
|
177
|
+
_asideComponent: this._asideComponent.getValue(),
|
|
178
|
+
_asideTableTabs: this._asideTableTabs.getValue(),
|
|
179
|
+
_navigationEnabled: this._navigationEnabled.getValue(),
|
|
180
|
+
_toolbarEnabled: this._toolbarEnabled.getValue(),
|
|
181
|
+
_previewEnabled: this._previewEnabled.getValue(),
|
|
182
|
+
_inspectEnabled: this._inspectEnabled.getValue(),
|
|
183
|
+
_inspectComponent: this._inspectComponent.getValue(),
|
|
184
|
+
_statsCollapsed: this._statsCollapsed.getValue(),
|
|
185
|
+
_foldersCollapsed: this._foldersCollapsed.getValue(),
|
|
186
|
+
_optionsCollapsed: this._optionsCollapsed.getValue()
|
|
187
|
+
};
|
|
188
|
+
this.messageService.set(StorageType.LayoutPanel, settings);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
loadLayoutSettings(): void {
|
|
192
|
+
const settings: LayoutPanelType = this.configService.get(StorageType.LayoutPanel);
|
|
193
|
+
if (Object.keys(settings).length) {
|
|
194
|
+
for (const [key, value] of Object.entries(settings)) {
|
|
195
|
+
if (this[key]) {
|
|
196
|
+
this[key].next(value);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
savePreviewSettings(): void {
|
|
203
|
+
const settings: LayoutPreviewType = {
|
|
204
|
+
_fontSize: this._fontSize.getValue(),
|
|
205
|
+
_fontColor: this._fontColor.getValue(),
|
|
206
|
+
_displayText: this._displayText.getValue(),
|
|
207
|
+
_backgroundColor: this._backgroundColor.getValue(),
|
|
208
|
+
_wordSpacing: this._wordSpacing.getValue(),
|
|
209
|
+
_letterSpacing: this._letterSpacing.getValue(),
|
|
210
|
+
_displayNews: this._displayNews.getValue()
|
|
211
|
+
};
|
|
212
|
+
this.messageService.set(StorageType.LayoutPreview, settings);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
loadPreviewSettings(): void {
|
|
216
|
+
const settings: LayoutPreviewType = this.configService.get(StorageType.LayoutPreview);
|
|
217
|
+
if (Object.keys(settings).length) {
|
|
218
|
+
for (const [key, value] of Object.entries(settings)) {
|
|
219
|
+
if (this[key]) {
|
|
220
|
+
this[key].next(value);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
saveThemeSettings(): void {
|
|
227
|
+
const settings: LayoutThemeType = {
|
|
228
|
+
_defaultTheme: this._defaultTheme.getValue()
|
|
229
|
+
};
|
|
230
|
+
this.messageService.set(StorageType.LayoutTheme, settings);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
loadThemeSettings(): void {
|
|
234
|
+
const settings: LayoutThemeType = this.configService.get(StorageType.LayoutTheme);
|
|
235
|
+
if (Object.keys(settings).length) {
|
|
236
|
+
for (const [key, value] of Object.entries(settings)) {
|
|
237
|
+
if (this[key]) {
|
|
238
|
+
this[key].next(value);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
setSystemLoading(value: boolean): void {
|
|
245
|
+
this._systemLoading.next(value);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
setLoadingScreen(value: boolean): void {
|
|
249
|
+
this._loadingScreen.next(value);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
setLoadingSpinner(value: boolean): void {
|
|
253
|
+
this._loadingSpinner.next(value);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
setGlyphIndex(value: number): void {
|
|
257
|
+
this._glyphIndex.next(value);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
setFontSize(value: number): void {
|
|
261
|
+
this._fontSize.next(value);
|
|
262
|
+
this.savePreviewSettings();
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
setFontColor(value: string): void {
|
|
266
|
+
this._fontColor.next(value);
|
|
267
|
+
this.savePreviewSettings();
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
setDisplayText(value: string): void {
|
|
271
|
+
this._displayText.next(value);
|
|
272
|
+
this.savePreviewSettings();
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
setBackgroundColor(value: string): void {
|
|
276
|
+
this._backgroundColor.next(value);
|
|
277
|
+
this.savePreviewSettings();
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
setWordSpacing(value: number): void {
|
|
281
|
+
this._wordSpacing.next(value);
|
|
282
|
+
this.savePreviewSettings();
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
setLetterSpacing(value: number): void {
|
|
286
|
+
this._letterSpacing.next(value);
|
|
287
|
+
this.savePreviewSettings();
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
setTheme(value: string): void {
|
|
291
|
+
this._defaultTheme.next(value);
|
|
292
|
+
this.saveThemeSettings();
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
getTheme(): string {
|
|
296
|
+
return this._defaultTheme.getValue();
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
getThemes(): SystemTheme[] {
|
|
300
|
+
return AppThemes;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
resetPreview() {
|
|
304
|
+
const settings: LayoutPreviewType = {
|
|
305
|
+
_fontSize: this.defaultFontSize,
|
|
306
|
+
_fontColor: this.defaultFontColor,
|
|
307
|
+
_displayText: this._displayText.getValue(),
|
|
308
|
+
_backgroundColor: this.defaultBackgroundColor,
|
|
309
|
+
_wordSpacing: this.defaultWordSpacing,
|
|
310
|
+
_letterSpacing: this.defaultLetterSpacing
|
|
311
|
+
};
|
|
312
|
+
for (const [key, value] of Object.entries(settings)) {
|
|
313
|
+
if (this[key]) {
|
|
314
|
+
this[key].next(value);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
this.messageService.set(StorageType.LayoutPreview, settings);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
setThemeVars(name: string): void {
|
|
321
|
+
const config = ThemeColors.has(name) ? ThemeColors.get(name) : ThemeColors.get('default');
|
|
322
|
+
|
|
323
|
+
const root = document.documentElement;
|
|
324
|
+
root.style.setProperty('--font-color', config.color);
|
|
325
|
+
root.style.setProperty('--background-color', config.background);
|
|
326
|
+
root.style.setProperty('--border-color', config.border);
|
|
327
|
+
root.style.setProperty('--fill-color', config.fill);
|
|
328
|
+
root.style.setProperty('--stroke-color', config.stroke);
|
|
329
|
+
|
|
330
|
+
this.setFontColor(config.color);
|
|
331
|
+
this.setBackgroundColor(config.background);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
getDisplayNews(): boolean {
|
|
335
|
+
return this._displayNews.getValue();
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
setDisplayNews(toggle: boolean): void {
|
|
339
|
+
this._displayNews.next(toggle);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { UtilsService } from './utils.service';
|
|
4
|
+
|
|
5
|
+
describe('UtilsService', () => {
|
|
6
|
+
beforeEach(() => TestBed.configureTestingModule({}));
|
|
7
|
+
|
|
8
|
+
it('should be created', () => {
|
|
9
|
+
const service: UtilsService = TestBed.inject(UtilsService);
|
|
10
|
+
expect(service).toBeTruthy();
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { gsap, Power3 } from 'gsap';
|
|
3
|
+
|
|
4
|
+
@Injectable({ providedIn: 'root' })
|
|
5
|
+
export class UtilsService {
|
|
6
|
+
|
|
7
|
+
delay = (time: number) => (result: any) => new Promise(resolve => setTimeout(() => resolve(result), time));
|
|
8
|
+
|
|
9
|
+
clone = (items: any) => items.map((item: any) => Array.isArray(item) ? this.clone(item) : item);
|
|
10
|
+
|
|
11
|
+
listToTree(arr: any[] = [], parentId: number = 0) {
|
|
12
|
+
const tree = [];
|
|
13
|
+
for (const i in arr) {
|
|
14
|
+
if (arr[i].parent_id === parentId) {
|
|
15
|
+
const children = this.listToTree(arr, arr[i].id);
|
|
16
|
+
arr[i].children = (children.length) ? children : [];
|
|
17
|
+
tree.push(arr[i]);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return tree;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
randomString(length: number): string {
|
|
24
|
+
let result = '';
|
|
25
|
+
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
|
26
|
+
const charactersLength = characters.length;
|
|
27
|
+
for (let i = 0; i < length; i++) {
|
|
28
|
+
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
29
|
+
}
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Revert camlecase back to normal string. Used in aside component.
|
|
35
|
+
* https://stackoverflow.com/questions/4149276/how-to-convert-camelcase-to-camel-case
|
|
36
|
+
*
|
|
37
|
+
* @param str
|
|
38
|
+
*/
|
|
39
|
+
normalizeCamelCase(str: string): string {
|
|
40
|
+
return str.replace(/([a-z])([A-Z])/g, '$1 $2');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
capitalize(str: string): string {
|
|
44
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
escapeHtml(unsafe: string): string {
|
|
48
|
+
return unsafe
|
|
49
|
+
.replace(/&/g, '&')
|
|
50
|
+
.replace(/</g, '<')
|
|
51
|
+
.replace(/>/g, '>')
|
|
52
|
+
.replace(/\u0022/g, '"')
|
|
53
|
+
.replace(/\u0027/g, ''');
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
compare(a: any, b: any): any {
|
|
57
|
+
if (a.order < b.order) {
|
|
58
|
+
return -1;
|
|
59
|
+
}
|
|
60
|
+
if (a.order > b.order) {
|
|
61
|
+
return 1;
|
|
62
|
+
}
|
|
63
|
+
return 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
sortKeys(dict: any) {
|
|
67
|
+
const keys = [];
|
|
68
|
+
for (const key in dict) {
|
|
69
|
+
if (dict.hasOwnProperty(key)) {
|
|
70
|
+
keys.push(key);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
keys.sort();
|
|
74
|
+
return keys;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
isEmptyObject(obj: any): boolean {
|
|
78
|
+
return (
|
|
79
|
+
Object.getPrototypeOf(obj) === Object.prototype &&
|
|
80
|
+
Object.getOwnPropertyNames(obj).length === 0 &&
|
|
81
|
+
Object.getOwnPropertySymbols(obj).length === 0
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
scrollTo(element: Element, offset: number = 0) {
|
|
86
|
+
gsap.to(element, {
|
|
87
|
+
scrollTo: {
|
|
88
|
+
y: offset,
|
|
89
|
+
autoKill: true,
|
|
90
|
+
},
|
|
91
|
+
duration: 1,
|
|
92
|
+
ease: Power3.easeOut
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
appendStyles(css: string, id: string = 'inline') {
|
|
97
|
+
const head = document.getElementsByTagName('head')[0];
|
|
98
|
+
const style = document.createElement('style');
|
|
99
|
+
style.setAttribute('type', 'text/css');
|
|
100
|
+
style.setAttribute('id', id);
|
|
101
|
+
style.appendChild(document.createTextNode(css));
|
|
102
|
+
head.appendChild(style);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
removeStyles(id: string) {
|
|
106
|
+
return new Promise((resolve, reject) => {
|
|
107
|
+
const el = document.getElementById(id);
|
|
108
|
+
if (el) {
|
|
109
|
+
resolve(el.remove());
|
|
110
|
+
} else {
|
|
111
|
+
reject(true);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
createFontStyles(data: any[], next: any) {
|
|
117
|
+
let css = ``;
|
|
118
|
+
|
|
119
|
+
data.forEach((item: any) => {
|
|
120
|
+
try {
|
|
121
|
+
|
|
122
|
+
// Fix font styles not working when name begins with number.
|
|
123
|
+
if (Number.isInteger(parseInt(item.file_name.charAt(0), 10))) {
|
|
124
|
+
item.file_name = this.randomString(5);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const fontFamily = (item.file_name?.length) ? item.file_name.replace(/\.[^/.]+$/, '') : item.file_name;
|
|
128
|
+
const filePath = (item.file_path.length) ? item.file_path.replace(/\\/g, '/') : item.file_path;
|
|
129
|
+
|
|
130
|
+
css += `
|
|
131
|
+
@font-face {
|
|
132
|
+
font-family: ${fontFamily};
|
|
133
|
+
src: url("file://${filePath}");
|
|
134
|
+
}
|
|
135
|
+
`;
|
|
136
|
+
|
|
137
|
+
} catch (error) {
|
|
138
|
+
console.warn('create-font-styles-error:', error as Error);
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
next(css);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<ng-container [ngSwitch]="componentName">
|
|
2
|
+
<aside class="component border-left">
|
|
3
|
+
<div class="component__panel">
|
|
4
|
+
<app-tables *ngSwitchCase="'tables'"></app-tables>
|
|
5
|
+
<app-search *ngSwitchCase="'search'"></app-search>
|
|
6
|
+
<app-store *ngSwitchCase="'store'"></app-store>
|
|
7
|
+
</div>
|
|
8
|
+
</aside>
|
|
9
|
+
</ng-container>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Component, OnInit } from '@angular/core';
|
|
2
|
+
import { PresentationService } from '@app/core/services';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'app-aside',
|
|
6
|
+
templateUrl: './aside.component.html',
|
|
7
|
+
styleUrls: ['./aside.component.scss']
|
|
8
|
+
})
|
|
9
|
+
export class AsideComponent implements OnInit {
|
|
10
|
+
|
|
11
|
+
componentName = 'tables';
|
|
12
|
+
componentList = ['tables', 'search', 'store'];
|
|
13
|
+
|
|
14
|
+
constructor(
|
|
15
|
+
private presentationService: PresentationService,
|
|
16
|
+
) { }
|
|
17
|
+
|
|
18
|
+
ngOnInit() {
|
|
19
|
+
this.presentationService._asideComponent.subscribe((value: string) => this.componentName = this.componentList.includes(value) ? value : this.componentName);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
onComponentSwitch(): void {
|
|
23
|
+
this.componentName = (this.componentName === 'tables') ? 'store' : 'tables';
|
|
24
|
+
this.presentationService.setAsideComponent(this.componentName);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<footer class="component">
|
|
2
|
+
<div class="left border-top">
|
|
3
|
+
<app-spinner></app-spinner>
|
|
4
|
+
</div>
|
|
5
|
+
<div class="middle border-top"></div>
|
|
6
|
+
<div class="right border-top">
|
|
7
|
+
<div class="flex items-center justify-end w-full px-4">
|
|
8
|
+
<span class="font-medium text-sm uppercase">Angular — {{ngVersion}} Electron — {{version.electron}}</span>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</footer>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
footer {
|
|
2
|
+
display: grid;
|
|
3
|
+
grid-template-areas: "left middle right";
|
|
4
|
+
grid-template-columns: 300px 1fr 300px;
|
|
5
|
+
grid-template-rows: 30px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.left { grid-area: left; }
|
|
9
|
+
.middle { grid-area: middle; }
|
|
10
|
+
.right { grid-area: right; }
|
|
11
|
+
|
|
12
|
+
.middle {
|
|
13
|
+
margin: 0px 1px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.left,
|
|
17
|
+
.middle,
|
|
18
|
+
.right {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: row;
|
|
21
|
+
justify-content: flex-start;
|
|
22
|
+
align-items: center;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.left {
|
|
26
|
+
padding: 0px 10px;
|
|
27
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Component, OnInit } from '@angular/core';
|
|
2
|
+
import { ConfigService } from '@app/core/services';
|
|
3
|
+
|
|
4
|
+
export interface AppVersion {
|
|
5
|
+
system: string;
|
|
6
|
+
electron: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'app-footer',
|
|
11
|
+
templateUrl: './footer.component.html',
|
|
12
|
+
styleUrls: ['./footer.component.scss']
|
|
13
|
+
})
|
|
14
|
+
export class FooterComponent implements OnInit {
|
|
15
|
+
|
|
16
|
+
version: AppVersion;
|
|
17
|
+
ngVersion: string;
|
|
18
|
+
|
|
19
|
+
constructor(
|
|
20
|
+
private configService: ConfigService,
|
|
21
|
+
) { }
|
|
22
|
+
|
|
23
|
+
ngOnInit() {
|
|
24
|
+
if (this.configService.has('system.version')) {
|
|
25
|
+
this.version = this.configService.get('system.version') as AppVersion;
|
|
26
|
+
}
|
|
27
|
+
if (this.configService.has('ng-version')) {
|
|
28
|
+
this.ngVersion = this.configService.get('ng-version');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<header class="component">
|
|
2
|
+
<div class="left border-top border-bottom">
|
|
3
|
+
<div class="header-block flex justify-items-start items-center">
|
|
4
|
+
<a class="enabled" title="New Collection"><i class="material-icons" (click)="handleCreateCollection($event)">widgets</i> New Collection</a>
|
|
5
|
+
<ng-container *ngIf="collectionId>0; else elseAddFontsDisabled">
|
|
6
|
+
<a class="enabled" title="New Collection"><i class="material-icons" (click)="handleAddFonts($event, collectionId)">list_alt</i> Add Fonts</a>
|
|
7
|
+
</ng-container>
|
|
8
|
+
<ng-template #elseAddFontsDisabled>
|
|
9
|
+
<a class="disabled" title="New Collection"><i class="material-icons">list_alt</i> Add Fonts</a>
|
|
10
|
+
</ng-template>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="middle border-top border-bottom">
|
|
14
|
+
<div class="header-block flex justify-start items-center">
|
|
15
|
+
<a href="javascript:;" (click)="handleToggleNavigation($event)" [className]="navigationEnabled ? 'enabled' : 'disabled'" title="Toggle Navigation"><i class="material-icons">border_all</i> Navigation</a>
|
|
16
|
+
<a href="javascript:;" (click)="handleToggleAside($event)" [className]="asideEnabled ? 'enabled' : 'disabled'" title="Toggle Aside"><i class="material-icons">border_all</i> Aside</a>
|
|
17
|
+
<a href="javascript:;" (click)="handleTogglePreview($event)" [className]="previewEnabled ? 'enabled' : 'disabled'" title="Toggle Preview"><i class="material-icons">border_all</i> Preview</a>
|
|
18
|
+
<a href="javascript:;" (click)="handleToggleInspect($event)" [className]="inspectEnabled ? 'enabled' : 'disabled'" title="Toggle Inspect"><i class="material-icons">border_all</i> Inspect</a>
|
|
19
|
+
<a href="javascript:;" (click)="handleToggleToolbar($event)" [className]="toolbarEnabled ? 'enabled' : 'disabled'" title="Toggle Toolbar"><i class="material-icons">border_all</i> Toolbar</a>
|
|
20
|
+
<a href="javascript:;" (click)="handleToggleGrid($event)" [className]="gridEnabled ? 'enabled' : 'disabled'" title="Toggle Grid"><i class="material-icons">border_all</i> Grid</a>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="right border-top border-bottom">
|
|
24
|
+
<div class="header-block flex justify-end items-center">
|
|
25
|
+
<a class="enabled" title="Theme" (click)="handleToggleSearch($event)"><i class="material-icons">search</i> Search</a>
|
|
26
|
+
<a class="enabled" title="Theme" (click)="handleSwitchTheme($event)"><i class="material-icons">burst_mode</i> Theme</a>
|
|
27
|
+
<ng-container *ngIf="currentUser; else elseif1">
|
|
28
|
+
<a (click)="handleLoadSettings()" class="gravatar" title="Settings"><img src="{{gravatarUrl}}" alt="{{currentUser.name}}" /></a>
|
|
29
|
+
</ng-container>
|
|
30
|
+
<ng-template #elseif1>
|
|
31
|
+
<a (click)="handleLoadSettings()" title="Settings"><i class="material-icons">exit_to_app</i> Settings</a>
|
|
32
|
+
</ng-template>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</header>
|