Compare commits

...

373 Commits

Author SHA1 Message Date
Sercan Yemen
798e2632bc Updated changelog 2018-07-13 18:58:02 +03:00
Sercan Yemen
19c960cc4c (Navbar) Moved navbar style into the variants
(AppComponent) Moved boxed class to the body
Fixed: Horizontal layout navbar covers entire screen
2018-07-13 18:55:45 +03:00
Sercan Yemen
8dfc3e854b Added comments to the app.component.html 2018-07-13 18:47:29 +03:00
Sercan Yemen
04b80ca168 Updated changelog 2018-07-13 14:43:03 +03:00
Sercan Yemen
54451bb19e (FuseProgressBar) Added new component and its service
(LoadingBarService) Removed due to the new progress bar service
Added documentation for the FuseProgressBar
2018-07-13 14:16:05 +03:00
Sercan Yemen
5e98d986e2 (AppComponent) Property order fix 2018-07-13 12:54:02 +03:00
Sercan Yemen
293192557f Updated Angular and various other packages
Increased the Fuse version number
2018-07-13 12:23:56 +03:00
Sercan Yemen
d61549d9e6 Fixed: Scrolling is not smooth on iOS devices 2018-07-13 12:23:30 +03:00
Sercan Yemen
b2ceb02709 Updated changelog and nav badge 2018-07-12 17:49:16 +03:00
Sercan Yemen
ffbd000fe2 (Chat Panel) Style and logic tweaks 2018-07-12 17:45:46 +03:00
Sercan Yemen
b6ebd2b839 (Navbar) Fixed: IE11 issues
(Chat Panel) Fixed: IE11 issues
2018-07-12 16:04:56 +03:00
Sercan Yemen
4d4d52ba05 (Navbar) Fixed: Style variant 2 doesn't scroll on Firefox, IE & Edge
(Chat Panel) Fixed: Doesn't scroll on Firefox, IE & Edge
Increased Fuse version
2018-07-12 15:48:55 +03:00
Sercan Yemen
251732f221 Updated changelog 2018-07-12 13:59:51 +03:00
Sercan Yemen
1c34a65034 Increased Fuse version 2018-07-12 13:30:17 +03:00
Sercan Yemen
b8803a055f Removed side panel from auth pages
Updated the changelog
Theme options button adjustments
2018-07-12 13:27:26 +03:00
Sercan Yemen
6b8cd41d5e Added SidePanel to the layouts for controlling the chat bar and possible other bar properties via FuseConfig 2018-07-12 13:19:34 +03:00
Sercan Yemen
2c7ef4de00 Updated Fuse version and changelog 2018-07-12 11:38:02 +03:00
Sercan Yemen
fdb572fadd (Toolbar) Removed unnecessary chat panel toggle method 2018-07-12 11:13:09 +03:00
Sercan Yemen
528c3f95e7 (Navbar) Fixed: Navbar doesn't grow if it has a small content 2018-07-12 11:04:54 +03:00
Sercan Yemen
f395046945 (Chat Panel) Removed mat-list, moved mat-tooltip to the avatar due to mobile scrolling issues 2018-07-12 10:48:31 +03:00
Sercan Yemen
b099022f5a (FuseSidebar) Max. width & width tweaks for small screen devices 2018-07-12 10:20:34 +03:00
Sercan Yemen
25a6ca2684 (Navbar) Added classes to the navbar containing fuse-sidebar's to contain their custom styles 2018-07-12 09:25:56 +03:00
Sercan Yemen
0cd5d613e0 (AppComponent) Added missing 'is-mobile' control - Fixes: Visible scrollbars on some mobile devices 2018-07-12 09:24:54 +03:00
Sercan Yemen
f45ad11861 Updated changelog date 2018-07-11 11:03:37 +03:00
Sercan Yemen
3cbe302b54 (Toolbar) Changed the username + Small margin tweaks
(Navbar) Style variant 2 adjustments and tweaks
2018-07-11 10:29:21 +03:00
Sercan Yemen
e1c906f08b (Chat Panel) Don't unfold the panel on hover
(Chat Panel) Always keep the contacts list in view
2018-07-10 14:55:30 +03:00
Sercan Yemen
585709cf93 (FuseSidebar) Exported temporary fold & unfold methods
(FuseSidebar) Added [foldedAutoTriggerOnHover] input for disabling the fold/unfold on mouseenter/mouseleave
(Chat Panel) Don't unfold the panel on hover
(Chat Panel) Always keep the contacts list in view
2018-07-10 14:55:08 +03:00
Sercan Yemen
ac70ecc616 (Navbar) Improved the style variant 1
Updated Changelog
2018-07-10 13:47:58 +03:00
Sercan Yemen
d5b64f3258 Updated Angular Material to 6.3.3 2018-07-10 12:26:55 +03:00
Sercan Yemen
59d838ef51 Updated changelog 2018-07-10 12:26:40 +03:00
Sercan Yemen
8b14366763 (Angular Material Examples) Updated the examples 2018-07-10 12:26:29 +03:00
Sercan Yemen
23b86a7e3d (Navbar) Style1 variant folded height 2018-07-10 12:26:04 +03:00
Sercan Yemen
2f497f1c7b (Navbar) Improved navbar style1 variant 2018-07-10 11:55:04 +03:00
Sercan Yemen
18009c9275 (Navbar) Finished navbar variants 2018-07-09 21:29:15 +03:00
Sercan Yemen
20d5a68bf3 (Colors) Further improved the color generators + added adaptive-border-color class 2018-07-09 16:37:00 +03:00
Sercan Yemen
59d53ba0b9 (Colors) Improved the color generators 2018-07-09 16:29:46 +03:00
Sercan Yemen
a6c91dd744 (AngularCLI) Added a configuration to serve with extractCss and sourceMap enabled 2018-07-09 14:31:11 +03:00
Sercan Yemen
5045482ef5 (Navbar) Started to adding new style variants to the navbar (wip) 2018-07-09 14:09:53 +03:00
Sercan Yemen
c7d9a7808a (Footer) Updated buy button link 2018-07-06 10:55:18 +03:00
Sercan Yemen
e4c0340cd7 (Sidebar) Import the takeUntil from the correct location 2018-07-04 19:32:24 +03:00
Sercan Yemen
67cb05be6b (Chat) Replaced multi line comments with single line comments 2018-07-04 17:55:52 +03:00
Sercan Yemen
634ff42f1a (Navigation) Updated version number badge 2018-07-04 17:50:37 +03:00
Sercan Yemen
0149beb33c (Chat Panel) Small color tweak on logo
Updated Angular Material to 6.3.2
Updated the changelog
Increased the Fuse version to 6.2.0 due to the amount of new stuff
2018-07-04 17:49:44 +03:00
Sercan Yemen
42d9748b10 (Chat Panel) Changed the chat panel icon and title 2018-07-04 17:29:44 +03:00
Sercan Yemen
8355e8a17c Updated changelog 2018-07-04 17:26:25 +03:00
Sercan Yemen
dbb925334a (Chat Panel) Styling adjustments 2018-07-04 17:21:51 +03:00
Sercan Yemen
49c8e32dce (Chat Panel) Styling adjustments 2018-07-03 21:05:52 +03:00
Sercan Yemen
595b16275b (Chat Panel) Added a chat panel 2018-07-03 18:23:51 +03:00
Sercan Yemen
fb003bc96f (Scrumboard) Removed an extra semi-colon 2018-07-03 18:06:33 +03:00
Sercan Yemen
d781e59928 (Sidebar) Added "foldedWidth" input for controlling the width of the folded sidebar
(Sidebar) Replaced the margin with padding on the folded sidebar's sibling
(Docs) Updated Sidebar docs
2018-07-03 13:54:19 +03:00
Sercan Yemen
89f71735a8 (Footer) Make the footer fixed for the Demo so the links can be seen at all times 2018-07-03 13:51:31 +03:00
Sercan Yemen
51d7c6fd6f (Contacts) Make the "Add Contact" button sticky on mobile devices 2018-07-02 19:51:37 +03:00
Sercan Yemen
e182f19644 Fix scss import path 2018-07-02 19:48:48 +03:00
Sercan Yemen
a1aed2998d (Navbar) Small fix for "scroll the active menu item into the view" 2018-07-02 16:46:55 +03:00
Sercan Yemen
7ff1d2aed0 (Navbar) Scroll the active menu item into the view 2018-07-02 15:58:07 +03:00
Sercan Yemen
09d1b1034e (Fuse) Tree-shakable core services, closes #64 2018-07-02 14:30:18 +03:00
Sercan Yemen
4e98ab1682 (Search Bar) Fixed: Height adjustment happens on the wrong media step 2018-07-02 13:29:33 +03:00
Sercan Yemen
984004d07a (Toolbar) Fixed: Unnecessary _.find in setLanguage method, Closes #66
(Navigation) Fixed: Removed id causing a style issue
2018-07-02 13:22:14 +03:00
Sercan Yemen
64e0451dc6 Removed the id from the navigation as there might be multiple navigations
Fixed: getFlatNavigation doesn't correctly get the 'collapsable' items because of the item.type change
Closes #71: getFlatNavigation method not correctly working when its called multiple times
2018-07-02 13:15:49 +03:00
Sercan Yemen
224bbf479a Fixed the Loading bar service small issue 2018-07-02 11:42:03 +03:00
Sercan Yemen
1aa79c257b Updated the changelog 2018-07-01 14:06:41 +03:00
Sercan Yemen
4d93b6acef Added a service for the Loading Bar
Added FuseLoadingBarService docs
Renamed service docs files
2018-07-01 14:02:14 +03:00
Sercan Yemen
ae29f1f03d Added 'openedChanged' and 'foldedChanged' events to the sidebar
Updated the Sidebar docs
2018-07-01 13:10:11 +03:00
Sercan Yemen
f35c1add1c Added ability to add custom classes to the navigation items using the "classes" property
Fixed: Item function and External URL's are missing from horizontal navigation
Fixed: Horizontal navigation active item does not highlight correctly
2018-07-01 12:20:33 +03:00
Sercan Yemen
388b724e90 Revert version number increase 2018-06-29 16:58:00 +03:00
Sercan Yemen
023bfea4df Removed the types definition for Webstorm IDE compatibility 2018-06-28 20:59:55 +03:00
Sercan Yemen
fd4da1e060 Simplified the class and the template as we don't need an extra object for errors
Used native .hasError checks on template
2018-06-28 20:34:43 +03:00
Sercan Yemen
85226e6094 Fixed: Changing 'password' field while 'passwordConfirm' field is filled doesn't trigger the 'confirmPassword' validator
Simplified the class and the template as we don't need an extra object for errors
Used native .hasError checks on template
2018-06-28 20:11:36 +03:00
Sercan Yemen
26a7cc41de Fixed broken print styles due to the latest layout updates 2018-06-28 17:39:22 +03:00
Sercan Yemen
3deba51322 Updated Angular & Angular Material
Increase the Fuse version number
Fixed the HMR serve ('npm run start-hmr' and 'npm run start-hmr-sourcemaps')
2018-06-28 13:28:56 +03:00
Sercan Yemen
1835c060d6 Updated the package-lock.json 2018-06-20 17:07:06 +03:00
Sercan Yemen
f75d458abe Added changelog for v6.1.2 2018-06-20 16:37:59 +03:00
Sercan Yemen
6320e98938 Added sticky header to the e-commerce tables 2018-06-20 16:36:31 +03:00
Sercan Yemen
94d20f8d8d Replace cdkTable stuff with matTable since table now is a proper Material element 2018-06-20 16:32:26 +03:00
Sercan Yemen
ba2f50bf62 Fixed Angular Material datepicker examples 2018-06-20 16:29:28 +03:00
Sercan Yemen
13746c2a73 Updated Angular Material examples 2018-06-20 16:16:03 +03:00
Sercan Yemen
faef6ec6f8 Increased the Fuse version number
Updated Angular Material and couple other packages
2018-06-20 15:30:54 +03:00
Sercan Yemen
b46b253c1c Small responsive fixes on e-commerce pages 2018-06-18 18:53:21 +03:00
Sercan Yemen
3abd764715 Updated the changelog 2018-06-18 18:42:35 +03:00
Sercan Yemen
1acfe2dfb3 Update the version on changelog navigation item 2018-06-17 14:44:11 +03:00
Sercan Yemen
6d3cfe8ace Increase the version number
Updated the changelog
2018-06-17 14:29:35 +03:00
Sercan Yemen
147525d16a (Sidebar) Fixed the folded issue 2018-06-17 14:24:10 +03:00
Sercan Yemen
29f8ddda9e Remove unnecessary input binding from sidebars 2018-06-17 13:16:04 +03:00
Sercan Yemen
1f77e201a1 Added the update date to the changelog 2018-06-15 19:46:31 +03:00
Sercan Yemen
75b7e4e270 Merge branch 'dev/new-fuse' 2018-06-15 17:56:36 +03:00
Sercan Yemen
9efab7ed20 Fixed private methods and injections 2018-06-15 17:46:41 +03:00
Sercan Yemen
65523c3c95 Fixed private methods and injections 2018-06-15 17:45:27 +03:00
Sercan Yemen
22b3a3c799 Reverted the ngx-dnd version to 4.0.0 2018-06-15 17:33:16 +03:00
Sercan Yemen
2b4bd45ad6 Updated Angular and couple other packages 2018-06-15 17:16:41 +03:00
Sercan Yemen
1e47c79f15 Add !important tag to the sibling's margin on sidebar folded 2018-06-15 17:01:02 +03:00
Sercan Yemen
58ab766edf Removed router animations since they are causing problems on Edge and also they make Fuse feel slower 2018-06-15 16:37:19 +03:00
Sercan Yemen
8db1206c91 Removed router animations since they are causing problems on Edge and also they make Fuse feel slower 2018-06-15 16:36:51 +03:00
Sercan Yemen
562ae61098 Added the changelog 2018-06-15 16:28:18 +03:00
Sercan Yemen
e43ae86a58 IE11 and Edge fixes on page layouts and theme layouts 2018-06-15 16:28:02 +03:00
Sercan Yemen
5459579d04 Added docs styles
Improved the documentation and moved it into the Demo app
2018-06-15 13:23:12 +03:00
Sercan Yemen
95759be710 Use the navigation service in the fuse-navigation for easier navigation swap 2018-06-14 18:00:22 +03:00
Sercan Yemen
edb4683dcb Use the navigation service in the fuse-navigation for easier navigation swap 2018-06-14 17:29:30 +03:00
Sercan Yemen
58dd3b93c3 message-box alert => message-box error 2018-06-14 13:41:18 +03:00
Sercan Yemen
91e8d88488 Import the "bash" language color from prism
Added "message-boxes" styles to the typography
Increased the home icon size in doc pages
Changed doc component class names
2018-06-14 12:25:03 +03:00
Sercan Yemen
ddcf1d5483 Added changelog and changelog style to the typography
Small tweaks on helper classes and typography pages
(Fuse Highlight) Don't wrap the code and show scrollbars instead
2018-06-12 17:06:38 +03:00
Sercan Yemen
0b5727ff15 Small tweaks 2018-06-12 14:52:13 +03:00
Sercan Yemen
20f80e3fe4 Page layout tweaks
Removed body color class
2018-06-12 12:09:00 +03:00
Sercan Yemen
5bf9fd177b Updated footer links 2018-06-12 10:51:16 +03:00
Sercan Yemen
507fe97e84 Changed layout names to make them easier to understand
New navigation structure for documentation and Angular Material elements
2018-06-12 10:44:00 +03:00
Sercan Yemen
a6a7442607 Search icon color 2018-06-12 10:28:53 +03:00
Sercan Yemen
43189728e5 Navbar toggle button should be right aligned if right navbar selected
Navbar classes actually moved to the navbar from fuse-sidebar
Search icon color
2018-06-12 10:28:08 +03:00
Sercan Yemen
9c88524185 Moved Angular Material Elements examples
Prepared the navigation for the documentation update
2018-06-12 10:27:17 +03:00
Sercan Yemen
52cfeec2e7 (Layout) Apps and pages moved to the new layout system 2018-06-11 19:15:12 +03:00
Sercan Yemen
ffb134f1ec (Perfect Scrollbar) Improved the fusePerfectScrollbar directive 2018-06-11 19:03:39 +03:00
Sercan Yemen
8520ca77be Icon colors on navigations 2018-06-11 18:18:01 +03:00
Sercan Yemen
a174c00072 (Apps) Moved the apps to the new page layouts and replaced MatSidenav with FuseSidebar on majority of them 2018-06-11 16:48:53 +03:00
Sercan Yemen
42ab15d9e1 (Apps) Moved the apps to the new page layouts and replaced MatSidenav with FuseSidebar on majority of them 2018-06-11 16:45:07 +03:00
Sercan Yemen
a87e68251e (Apps) Moved the apps to the new page layouts and replaced MatSidenav with FuseSidebar on majority of them 2018-06-11 13:26:03 +03:00
Sercan Yemen
436bd0aa91 (Page layouts) Small tweaks 2018-06-11 13:25:26 +03:00
Sercan Yemen
d5f1fcfefa (Sidebar) Mark the change detector for changes on every action so OnPush components can use the Sidebar 2018-06-11 12:10:04 +03:00
Sercan Yemen
234dec3d6a (Page layouts) Small tweaks
(Config) Disable the router animation by default
2018-06-11 12:02:54 +03:00
Sercan Yemen
928be05725 (Page Layouts) Small tweaks and fixes for native scrollbars 2018-06-11 09:27:56 +03:00
Sercan Yemen
bcf5a9e6cb (Navigation) Moved "Angular Material Elements" outside of the "Components" menu item 2018-06-10 20:27:29 +03:00
Sercan Yemen
e79bfb7bce (Page Layouts) Renamed simple "Tabbed" layout to "Full Width Tabbed" + small style tweak 2018-06-10 20:25:27 +03:00
Sercan Yemen
86815b7737 (Page Layouts) Small tweaks 2018-06-10 20:16:01 +03:00
Sercan Yemen
73a81699ec (Page Layouts) Removed mat-sidenav from page layouts, now all Fuse page layouts uses Fuse Sidebar 2018-06-10 20:00:34 +03:00
Sercan Yemen
c2970e34ba Content component small tweaks 2018-06-10 19:46:33 +03:00
Sercan Yemen
7d6a92fada (FusePerfectScrollbar) Added options for configuring the scrollbar
Updated layouts and navbar to make use of the scrollbar options
2018-06-10 19:46:10 +03:00
Sercan Yemen
acbed8e305 (Sidebar) Don't enable the animations right away to prevent initial animations 2018-06-10 19:32:01 +03:00
Sercan Yemen
b46f81b6ac Updated packages
Increased the Fuse version
2018-06-10 19:31:14 +03:00
Sercan Yemen
a284063d22 Added an extra Material theme as an example to the "styles.scss" file
Fixed bunch of color related stuff in order to apply the selected theme color correctly
2018-06-09 21:18:30 +03:00
Sercan Yemen
1c8cc35693 Fixed router animations after the layout changes
Don't reset the router animation on navigation change
2018-06-09 14:58:45 +03:00
Sercan Yemen
6cc7d03430 Removed console.log 2018-06-09 14:44:50 +03:00
Sercan Yemen
f8f97f8ad4 Remove 'inner-scroll' class on small screen devices to give more room to the scroll 2018-06-09 14:43:42 +03:00
Sercan Yemen
bd79830cb4 Fixed: Toolbar background color issues 2018-06-09 14:26:00 +03:00
Sercan Yemen
5ed04c3925 Collapsable arrow class name fix 2018-06-07 21:20:09 +03:00
Sercan Yemen
90fe94a417 Added horizontal layout to the new layout system
Added boxed layout width
2018-06-07 21:12:12 +03:00
Sercan Yemen
a39021188e Renamed 'collapse' to 'collapsable' in navigation types
Renamed navigation component files
Small fix in shortcuts ('nav-item' to 'item')
2018-06-07 20:49:29 +03:00
Sercan Yemen
ba35ebae94 Fix: Images in Angular Material cards 2018-06-07 19:11:21 +03:00
Sercan Yemen
97f864bb76 Small fix in navigation docs 2018-06-07 19:11:06 +03:00
Sercan Yemen
ea15a8b832 Re-added the accidentally deleted Angular Material Examples module 2018-06-07 19:10:44 +03:00
Sercan Yemen
5c1f2ad1e3 New layout system & new layouts (wip) 2018-06-06 21:20:04 +03:00
Sercan Yemen
420d8d1a1b Navigation icon colors 2018-06-06 21:19:43 +03:00
Sercan Yemen
f693298f3a Navigation interface 2018-05-30 19:48:59 +03:00
Sercan Yemen
a29c4b01ad Update the readme 2018-05-30 12:31:58 +03:00
Sercan Yemen
1b94d8d14e Config types 2018-05-30 12:23:31 +03:00
Sercan Yemen
232b4de752 Moved ThemeOptions to the Fuse Sidebar
Replaced align with position on Fuse Sidebar components
2018-05-30 12:23:09 +03:00
Sercan Yemen
b918fa4122 (Sidebar) Changed align to position since align is a native HTML attribute
Added invisibleOverlay option
2018-05-30 12:22:19 +03:00
Sercan Yemen
83c395b866 (Sidebar) Make the sidebar invisible when it's not open
Made the backdrop methods private
2018-05-30 11:49:30 +03:00
Sercan Yemen
387077882b Codebase improvements 2018-05-29 15:07:13 +03:00
Sercan Yemen
70d895c6ed New layout system (wip) 2018-05-29 14:58:48 +03:00
Sercan Yemen
0ac4e6c220 (Academy app) Small shadow adjustment 2018-05-28 17:41:33 +03:00
Sercan Yemen
850e43c653 (Navigation) Improved navigation service 2018-05-28 16:04:27 +03:00
Sercan Yemen
1e6bd8139c Removed bg color from body 2018-05-28 12:32:29 +03:00
Sercan Yemen
c6969cf9df (Navigation) Improved navigation service for easier navigation management 2018-05-28 12:31:54 +03:00
Sercan Yemen
745c51878d Small color adjustments 2018-05-27 16:58:26 +03:00
Sercan Yemen
9635165316 (Config Service) Added ability to access to the default config and reset to it 2018-05-27 16:57:54 +03:00
Sercan Yemen
02f305be1f Improved the FusePerfectScrollbar directive, not directives can be controlled individually by adding a boolean value to them 2018-05-27 16:56:50 +03:00
Sercan Yemen
27197a55dc Improving the codebase 2018-05-27 16:55:46 +03:00
Sercan Yemen
5d000a849d Updated couple packages 2018-05-27 16:54:20 +03:00
Sercan Yemen
07341c5ffa Improving the codebase (99% completed)
Updated Angular, Angular Material and couple other packages
2018-05-23 12:35:08 +03:00
Sercan Yemen
742da904da Improving the codebase (wip) 2018-05-21 15:42:34 +03:00
Sercan Yemen
880529ad62 Temporary solution to the ngx-translate issue while we are working on a better solution 2018-05-20 16:03:11 +03:00
Sercan Yemen
126ba35d3d Updated Angular and various other packages 2018-05-20 10:19:15 +03:00
Sercan Yemen
0039f44936 Improving the codebase (wip) 2018-05-20 10:12:31 +03:00
Sercan Yemen
ced0853af8 (mail-ngrx) Use absolute paths on imports 2018-05-18 17:40:57 +03:00
Sercan Yemen
3d483b5a4b Started building the new layout system along with the new layouts 2018-05-18 17:18:33 +03:00
Sercan Yemen
96813406a2 Fixed: Horizontal nav titles are collapsing on IE11 2018-05-16 14:16:40 +03:00
Sercan Yemen
7fa892d7cc Updated Angular and Angular Material
Increased the Fuse version
Small update on karma.conf.js
2018-05-15 14:09:01 +03:00
Sercan Yemen
832a08208a (Toolbar) Set the selected the language from the translation service 2018-05-15 13:52:01 +03:00
Sercan Yemen
7580176042 Increased the version number 2018-05-09 18:05:55 +03:00
Sercan Yemen
725719317a (Scrumboard) Fix: "Add a list" button is draggable and causing issues 2018-05-09 18:04:32 +03:00
Sercan Yemen
5ce276de8e rxjs 6.0.0 compatibility 2018-05-09 17:55:26 +03:00
Sercan Yemen
d330b42dec Updated @swimlane and couple other packages 2018-05-09 14:58:36 +03:00
Sercan Yemen
6bf2fe0b17 Updated ngrx to 6.0.0-beta.1 2018-05-09 14:50:30 +03:00
Sercan Yemen
a2187e0134 Set the output path 2018-05-06 14:33:17 +03:00
Sercan Yemen
a1cf7dba91 Angular version name 2018-05-06 14:32:10 +03:00
Sercan Yemen
b8039899db Fixed various dialog issues
+ (Shortcuts) Icon colors in shortcuts menu
2018-05-06 14:19:28 +03:00
Sercan Yemen
26e55d7f3d (Navigation) Fixed: Horizontal navigation items don't have 'hidden' and 'custom function' features 2018-05-06 13:44:34 +03:00
Sercan Yemen
1a9229a3ae (Contacts) Fixed: List item cell forces the list item width 2018-05-06 13:38:15 +03:00
Sercan Yemen
ebf865e2c7 Angular and Angular Material 6 compatibility
+ Small adjustments and polishing up in various apps and pages
2018-05-06 13:29:08 +03:00
Sercan Yemen
5fd146b8da Angular and Angular Material 6 compatibility (wip) 2018-05-05 19:54:52 +03:00
Sercan Yemen
3401a67959 intl polyfill is no longer required 2018-05-05 15:31:29 +03:00
Sercan Yemen
10dad46d7c Updated the position attribute of the sidenav
Did some changes on the core styles + forced input font sizes to 16px
2018-05-05 15:28:05 +03:00
Sercan Yemen
1c4983c756 rxjs upgrade 2018-05-05 14:42:18 +03:00
Sercan Yemen
f4636d9a37 Update Angular, Angular Material and Flex Layout to 6
Updated additional project files
Updated Angular Material examples
2018-05-04 19:28:20 +03:00
Sercan Yemen
02df48ab4e Remove the {navigation} import from the ThemeOptions and inject it where we actually use the fuseThemeOptions 2018-04-04 14:41:43 +03:00
Sercan Yemen
831d48f5a3 Remove the {navigation} import from the Shortcuts and inject it from the toolbar where we actually use the fuseShortcuts 2018-04-04 14:36:33 +03:00
Sercan Yemen
ca42f71b0e Added lodash for convenience
+ Removed the default settings from the settings service - this means the user must provide the default settings at all time
2018-04-04 14:30:52 +03:00
Sercan Yemen
ed4a3cb8d7 Move the layout settings reset to the 'NavigationEnd' to make things smoother on lazily loaded components 2018-04-04 14:20:45 +03:00
Sercan Yemen
5c66d95951 Warn the user about the missing sidebars in registry
+ Check if the sidebar exists before trying to close it
2018-04-04 13:37:59 +03:00
Sercan Yemen
44663342f4 Set the correct return type for the 'getSidebar' method
+ Close the navbar on NavigationEnd on mobile devices
2018-04-04 11:36:00 +03:00
Sercan Yemen
4e6207fef5 Fixed: Small issues caused by Flex Layout update
Fixed: Profile page header bg image doesn't correctly cover the header on mobile devices
Fixed: Contacts app form dialog header irregularities
Fixed: Analytics module doesn't import MatButtons
Fixed: Scrumboard card dialog toolbar issues
2018-03-31 13:20:22 +03:00
Sercan Yemen
bd67b660c8 Updated Flex Layout package
+ Fixed: Fuse sidebar doesn't scroll when the custom scrollbars disabled
+ Fixed: Expanded search bar style
2018-03-31 12:03:21 +03:00
Sercan Yemen
174789930d Allow url and function on collapsable nav items
+ Allow url and function to be exist at the same time on collapsable and normal nav items
2018-03-11 18:26:57 +03:00
Sercan Yemen
7af9c57977 Changed the title 2018-03-10 14:35:09 +03:00
Sercan Yemen
874ef26f0b Increase the version number 2018-03-10 14:34:17 +03:00
Sercan Yemen
329fbb5a38 Fix issues with folded navigation 2018-03-10 14:32:37 +03:00
Sercan Yemen
7db4715eb2 Increased the Fuse version number 2018-03-09 20:14:25 +03:00
Sercan Yemen
e57061b133 Replaced the project name in angular-cli.json 2018-03-09 20:07:42 +03:00
Sercan Yemen
096e1b47d2 Fixed: Sidebar folded doesn't push the content if activated programmatically 2018-03-09 20:03:12 +03:00
Sercan Yemen
9c0f89953c Fixed Scrumboard 'Remove Card' and 'Remove Board' actions. 2018-03-09 06:29:20 +03:00
Sercan Yemen
20bb52df50 Removed shared.module + tweaked module import order 2018-03-08 12:43:24 +03:00
Sercan Yemen
ddcd7c6831 Removed a comment 2018-03-08 12:27:12 +03:00
Sercan Yemen
30825e7927 Fixed Calendar day view weird characters issue
+ Added TranslateModule to the NavigationModule so the translate pipe can work
+ Small tweaks
2018-03-08 12:25:27 +03:00
Sercan Yemen
535dbdfe57 Updated Angular and Angular Material and various other libs
+ Added Community page link to the Readme
2018-03-08 11:49:13 +03:00
Sercan Yemen
8c4a714d39 Updated Angular Material element examples 2018-03-08 11:48:38 +03:00
Sercan Yemen
c9168717a4 Added component doc for the FuseSidebar 2018-03-06 11:57:01 +03:00
Sercan Yemen
2e76bf398f Added missing MatButtonModule import 2018-03-06 11:42:49 +03:00
Sercan Yemen
2803fd6e90 Fixed: fxLayoutAlign must be fxLayout 2018-03-06 11:30:52 +03:00
Sercan Yemen
681a75e683 Fixed couple bugs with FuseMaterialColorPicker 2018-03-06 11:24:20 +03:00
Sercan Yemen
ae6bc37664 Removed "fxLayoutWrap" and added "wrap" into fxLayout attributes where it's necessary 2018-03-06 11:23:59 +03:00
Sercan Yemen
583e74d99f Updated Angular, Angular Material, Flex Layout and various other packages 2018-03-06 11:23:20 +03:00
Sercan Yemen
82ca0329e9 Material module imports for the pages and rest of the Fuse
+ Couple tweaks & fixes
2018-03-06 10:38:30 +03:00
Sercan Yemen
7b474e54f0 Added missing 'MatRippleModule' import 2018-03-05 12:43:03 +03:00
Sercan Yemen
ab61faaba5 Material module imports for the apps
+ Couple fixes
2018-03-05 12:17:32 +03:00
Sercan Yemen
863fa5cc46 Reverted tsconfig.json to its original 2018-03-05 12:16:59 +03:00
Sercan Yemen
2509ad4e71 Merge branch 'master' into v5 2018-03-05 09:06:06 +03:00
Sercan Yemen
6108679f46 Fixed tabbed layouts issue on Firefox 2018-03-05 09:05:05 +03:00
Sercan Yemen
b34f7fca20 Replaced demo text with lorem ipsum 2018-02-23 19:57:31 +03:00
Sercan Yemen
fa53e773ae Separately importing Angular Material modules (wip) 2018-02-23 19:35:28 +03:00
Sercan Yemen
397c304ab2 Created modules for custom components and the main fuse components
+ Changed the Shared Module (WIP)
2018-02-21 09:36:41 +03:00
Sercan Yemen
3dfb79423a Changed how navigation data passed into the fuse-navigation
+ Added hidden property to the nav items
+ Updated fuse-navigation component docs
+ Updated other components that uses fuse-navigation service
+ Updated various packages including Angular and Angular Material
2018-02-20 11:05:07 +03:00
Sercan Yemen
51bd636ba6 Moved core into @fuse
+ New fuse sidebar component
+ Moved the navbar to the sidebar
2018-02-17 17:21:39 +03:00
Sercan Yemen
e55a385858 Navigation: Hide the children of the expanded items when the navbar collapsed 2018-02-08 11:06:23 +03:00
Sercan Yemen
43b85ca3b6 Reverted the ngx-dnd back to 3.1.0
+ Added missing debounceTime imports to prevent errors
2018-02-05 17:04:22 +03:00
Sercan Yemen
99696cabf7 Finished up the Analytics Dashboard
+ Updated the Angular Material version along with couple other libraries
+ Increased the version number of the Fuse
2018-02-05 15:08:18 +03:00
Sercan Yemen
f246fab1f4 Make sure the splash screen element exists before adding an event to it 2018-02-05 11:29:30 +03:00
Sercan Yemen
b0101a1f8c Fix the wrong api url 2018-02-05 11:28:24 +03:00
Sercan Yemen
8f5e947c28 Added a new dashboard (Analytics) 2018-02-01 15:30:44 +03:00
Sercan Yemen
dfd430712d Fixed some naming inconsistencies in Project dashboard
+ Added fake db for Analytics Dashboard
2018-02-01 15:30:30 +03:00
Sercan Yemen
8431c19133 Added Chart.js
+ Some improvements on Helper classes and Fuse Card
2018-02-01 15:28:40 +03:00
Sercan Yemen
6ee6934e0d Fixed a small typo in multi-language component page 2018-01-30 15:18:50 +03:00
Sercan Yemen
3253fbfaf4 Updated readme with slack workspace invitation 2018-01-29 11:24:47 +03:00
mustafahlvc
985a8dd3a9 ngrx updated to v5.0.0 2018-01-23 13:37:58 +03:00
Sercan Yemen
0c99c075f3 Updated Angular CLI and couple other packages to fix the devkit issue
+ Increase the Fuse version number
2018-01-23 12:47:31 +03:00
Sercan Yemen
c79db27092 Updated package-lock.json file 2018-01-18 13:37:57 +03:00
Sercan Yemen
a92cb8b7b6 Quick panel width is too wide for smaller screens
+ (Academy app) Course page doesn't scroll on mobile
2018-01-18 13:18:09 +03:00
Sercan Yemen
bb3d6d4839 Updated Angular, Angular Material and various other packages
+ Increased the Fuse version
+ Replaced datatable icons
+ Removed broken css imports
2018-01-18 13:13:40 +03:00
Sercan Yemen
9c06622efb Small fixes 2018-01-12 10:19:10 +03:00
Sercan Yemen
8b590408b0 Updated Angular & Angular Material
+ Increased the Fuse version
2018-01-11 12:57:38 +03:00
Sercan Yemen
18b2bdf5ab Mail-Ngrx app throws errors for certain rxjs operators
+ Various other small code fixes
2018-01-11 12:31:06 +03:00
Sercan Yemen
ba49621e79 Update perfect scrollbar on document click...
This isn't the most elegant solution but there is no other way
of knowing when the contents of the scrollable container changes.
Therefore, we update scrollbars on every document click.
2018-01-09 11:30:11 +03:00
Sercan Yemen
416f1997a9 Updated Angular Material, Angular and various other modules to latest versions 2018-01-08 16:39:44 +03:00
Sercan Yemen
fcfbedfd74 Increase the version number to 1.3.2 2018-01-08 16:02:45 +03:00
Sercan Yemen
35f3512e89 Added the [path] input to the fuse-highlight for loading source code externally
+ Removed highlight.js and angular2-markdown
+ Updated the Angular Material example viewer
2018-01-08 16:02:00 +03:00
Sercan Yemen
2288905cbd Merge branch 'master' of https://github.com/withinpixels/fuse2
+ fuse-hljs replaced with fuse-highlight
2018-01-08 15:29:04 +03:00
Sercan Yemen
5a40116c7b Merge branch 'master' of https://github.com/withinpixels/fuse2
+ fuse-hljs replaced with fuse-highlight
2018-01-08 15:28:50 +03:00
Sercan Yemen
b7c10a515c Added new cards 2018-01-08 12:40:39 +03:00
Sercan Yemen
65e637eeb9 Use [overlapTrigger] in toolbar menus 2018-01-08 12:40:25 +03:00
Sercan Yemen
b56088948c added --open to the "npm start" 2018-01-08 12:39:55 +03:00
mustafahlvc
0c5066e7d0 Lazy loading applied to group of demo modules. 2018-01-08 12:37:52 +03:00
Sercan Yemen
751497556a (Contacts App) Fixed: Selected filter is not preserved on route changes 2018-01-03 10:32:15 +03:00
Sercan Yemen
5f2372cc08 Updated Angular Calendar due to broken AoT 2018-01-02 12:29:32 +03:00
Sercan Yemen
6f315aa38e Small fixes to Auth pages 2018-01-02 12:00:46 +03:00
Sercan Yemen
0653b5f36b Academy app small tweaks and responsive fixes 2017-12-28 14:00:06 +03:00
Sercan Yemen
f13120bc01 Updated Academy example data 2017-12-28 11:53:02 +03:00
Sercan Yemen
a6c56518bc New: Academy (Courses) app 2017-12-28 10:49:29 +03:00
Sercan Yemen
ecae48f3d0 Updated Angular and Angular Material + various other components
+ Increased the Fuse version number
2017-12-28 10:49:04 +03:00
Sercan Yemen
c74751e0f4 Added new SlideIn Animation
+ Improvements on perfect scrollbar
2017-12-28 10:48:05 +03:00
Sercan Yemen
2b755fa669 Replaced depreciated Quick panel focus helpers 2017-12-28 10:47:19 +03:00
Sercan Yemen
ca0f46b414 Fix: Scroll doesn't propagate by default (PerfectScrollbar) 2017-12-26 10:48:58 +03:00
Sercan Yemen
528fa31df6 Fixed: (Firefox) Navbar logo doesn't show when navbar collapsed 2017-12-21 10:04:56 +03:00
Sercan Yemen
abfb2a6706 Fixed: Mail Compose dialog responsive issues
+ Added Show/Hide CC & BCC fields toggle button
2017-12-19 12:21:22 +03:00
Sercan Yemen
b1ab11393e Fix: (Ecommerce) Orders and Products tables not scrolling when custom scrollbars disabled 2017-12-19 10:27:33 +03:00
Sercan Yemen
786883eb10 Updated season images
+ Fixed e-commerce app images
+ Stop animations in mail-ngrx app
2017-12-18 12:24:47 +03:00
Sercan Yemen
e477f797d0 Updated Material Moment Adapter package 2017-12-14 16:06:07 +03:00
Sercan Yemen
fb196c3864 Angular & Angular Material versions updated 2017-12-14 15:51:09 +03:00
mustafahlvc
5cf44962fc (Mail) back arrow visibility updated for responsive 2017-12-14 12:27:08 +03:00
mustafahlvc
06b0c3775a (Mail-ngrx) missing deSelectCurrentFunction() added to mail.component,
back arrow visibility updated for responsive
2017-12-14 12:25:48 +03:00
mustafahlvc
26690990f0 (Mail-ngrx) currentMail fixes on html 2017-12-14 11:52:53 +03:00
mustafahlvc
377092d9ec (Mail-ngrx) unread, selected class added for mail list item 2017-12-14 11:10:35 +03:00
mustafahlvc
abede386c8 (Mail-ngrx) Ngrx version of Mail App added. 2017-12-12 22:31:50 +03:00
Sercan Yemen
242feaa169 Updated Angular to 5.0.1
+ Updated Angular Material to 5.0.0 stable
+ Install the ngx-dnd package from its original location
+ Updated various other packages
+ Increased the Fuse version
2017-12-08 10:34:39 +03:00
Sercan Yemen
7c2494a82c Fixed: Shortcut items duplicates on search in some cases 2017-12-08 10:31:39 +03:00
Sercan Yemen
5c2e717a40 Make sure the nav item has children before trying to get them
+ Added LICENSE file
+ Renamed the KnowledgeBase demo module
2017-12-08 09:34:30 +03:00
Sercan Yemen
6ae0a9760d Fix the missing backgrounds
+ Increased the shadow weight of the content on Auth, Coming Soon and Maintenance pages
2017-12-06 14:39:24 +03:00
Sercan Yemen
2a10f3e443 Moved the navigation.model.ts into its own folder
+ Added support for translations in nav items
+ Added badge support for collapsable nav items
+ Initialize the navigation from app.component rather then navigation.service
2017-12-06 14:10:48 +03:00
Sercan Yemen
db7a00440c Re-activated mail search
+ Small formatting in mail translation
2017-12-06 14:09:31 +03:00
Sercan Yemen
0e1c589399 Use absolute paths for importing fuse.scss 2017-12-06 11:40:43 +03:00
Sercan Yemen
2f419b1af5 Removed unused HttpModule import 2017-12-06 11:40:16 +03:00
Sercan Yemen
effd3cefcb Scrumboard and Contacts app dialogs responsive fixes 2017-12-06 11:35:58 +03:00
Sercan Yemen
21fd488a8e ngx-color-picker style adjustments
+ Calendar event form responsive fixes
2017-12-06 11:26:57 +03:00
Sercan Yemen
37a5c69269 Removed Google Calendar images as they are no longer available freely from Google 2017-12-06 10:34:40 +03:00
Sercan Yemen
9f440b1bf2 Some code inspection fixes 2017-11-30 15:55:00 +03:00
Sercan Yemen
a65f61cce4 Form Stepper examples
+ Simplified the mat-select style
+ Further simplified the mat-select in dashboard widgets
2017-11-30 15:37:32 +03:00
Sercan Yemen
0d8fe0be72 Trigger expand/collapse of the navigation on ngOnInit to update the active item 2017-11-30 10:37:35 +03:00
Sercan Yemen
2bbc90af64 Perfect scrollbar shouldn't be destroyed if it's not available
+ Print media css classes updated to hide the perfect scrollbars
2017-11-30 10:22:18 +03:00
Sercan Yemen
ad21d9fed5 Further improvements to Auth pages 2017-11-30 10:21:22 +03:00
Sercan Yemen
4c6ef29e20 Fixed: Behavior Subject must be array 2017-11-28 10:48:52 +03:00
Sercan Yemen
a74c5108fd Fixed: Couple small issues with Auth forms
Added custom validator for Password Matching to Register forms
2017-11-28 10:42:41 +03:00
Sercan Yemen
19fdbbdbcb Increased version number
Fixed: Sidenav helper causes issues on mobile media steps
2017-11-27 17:20:34 +03:00
Sercan Yemen
8bbabd7437 Corrected the version number 2017-11-27 14:31:57 +03:00
Sercan Yemen
5a9cd36282 Increased the Fuse version number
+ Updated Angular, Angular Material and Flex Layout
+ Updated various components for better Angular5 support
+ Fixed: Contacts app various issues
+ Fixed: Duplicate content in Profile page tabs
+ Fixed: Folded status of the Navbar shouldn't brake the layout if Horizontal Navbar is active
2017-11-27 14:28:08 +03:00
mustafahlvc
297bb95a2e Temporary aot build fix for @swimlane/ngx-charts 2017-11-18 01:43:08 +03:00
Sercan Yemen
2511a03b66 Increased the Fuse version number
+ Updated ngx-charts and ngx-datatables
+ added rxjs imports for the various search
2017-11-18 00:45:42 +03:00
mustafahlvc
76358f996e Angular material docs updated,
+ @angular/material-moment-adapter added to package.json
2017-11-17 18:35:44 +03:00
mustafahlvc
142fc982ca Angular updated to 5.0.2, angular-cli updated to 1.5.2,
+ angular-material-elements and fakeDb folder excluded from linting,
+ some lint errors solved.
2017-11-17 16:57:42 +03:00
Sercan Yemen
22d9279e3b Fix: Authentication (v2) pages not scrollable when custom scrollbars disabled 2017-11-14 09:35:03 +03:00
Sercan Yemen
a1bec98d44 Todo adjustments 2017-11-13 11:04:57 +03:00
Sercan Yemen
e8449e340d Contact list checkbox rendering broken due to ripple 2017-11-13 10:45:16 +03:00
Sercan Yemen
4cb8009c69 Scrumboard label selector not working correctly + style refinements 2017-11-13 10:36:32 +03:00
Sercan Yemen
7f357306eb Angular 5.0.1 & Angular Material 5.0.0-rc0 compatibility (wip) 2017-11-12 22:36:14 +03:00
Sercan Yemen
06679343a4 Fixes #44 : Example e2e test file content is wrong
+ Renamed 'mat-sidenav-helper' files/folders to 'fuse-mat-sidenav-helper' & fixed its import issues
2017-11-08 15:08:40 +03:00
Sercan Yemen
f35d83567e Update the footer button text 2017-11-04 16:49:47 +03:00
Sercan Yemen
c97fd77c13 Updated title 2017-11-04 16:32:12 +03:00
Sercan Yemen
62904cdb42 Updated readme file 2017-11-04 16:15:00 +03:00
Sercan Yemen
d9c36cad82 Fix: Angular 5 AoT issues 2017-11-04 16:14:12 +03:00
Sercan Yemen
d2bfc152a0 Fix: Some css issues after updating the ngx-datatable 2017-11-04 14:00:26 +03:00
Sercan Yemen
f013b2b667 Angular 5 compatibility (wip)
+ Fuse2 version: 1.2.0
2017-11-04 13:41:40 +03:00
Sercan Yemen
9fbcc20623 Fix: Navbar vertical puts out wrong classes 2017-11-04 13:41:24 +03:00
Sercan Yemen
0fd8a75f7d Added exactMatch parameter to the navigation items for correctly highlighting them 2017-11-04 13:39:18 +03:00
Sercan Yemen
99d9552813 Added E-Commerce pages to the navigation for easier access 2017-11-04 12:49:38 +03:00
Sercan Yemen
3bca193bcc Fixes #39 : Nav item not showing in Horizontal menu + its height is not correct 2017-11-04 12:46:40 +03:00
Sercan Yemen
f73ff363a5 Small fixes on cards 2017-11-04 12:45:12 +03:00
Sercan Yemen
1bf689f154 Angular 5 compatibility (wip) 2017-11-02 12:52:27 +03:00
Sercan Yemen
3499d89098 Angular 5 compatibility (wip) 2017-11-02 12:52:05 +03:00
Sercan Yemen
685cd76da2 Fixed: Minor issues with E-Commerce app
+ Fixed: Navigation collapsable items don't expand if the url has extra parameters in it
2017-11-02 11:16:24 +03:00
Sercan Yemen
786180958d Merge branch 'master' of https://github.com/withinpixels/fuse2 2017-11-02 10:47:33 +03:00
Sercan Yemen
a2f72c92d5 New: Material design cards 2017-11-02 10:47:28 +03:00
mustafahlvc
6b368d2e79 Merge remote-tracking branch 'origin/master' 2017-11-01 14:32:42 +03:00
mustafahlvc
47c2cc721e E-commerce App added. 2017-11-01 14:32:25 +03:00
Sercan Yemen
5574e3f729 Merge branch 'master' of https://github.com/withinpixels/fuse2 2017-10-31 10:08:04 +03:00
Sercan Yemen
1934bad3eb Fixes #33: Toolbar navigation bar button should toggle the navigation bar 2017-10-31 10:06:49 +03:00
Sercan Yemen
ee29f20304 Added an ability to control the folded status of the vertical navigation via FuseConfig 2017-10-30 13:31:23 +03:00
mustafahlvc
93c2eab584 Merge remote-tracking branch 'origin/master' 2017-10-27 18:22:44 +03:00
mustafahlvc
b0f45980be ngx-datatable data fake api data fix. 2017-10-27 18:22:14 +03:00
Sercan Yemen
7b10b2ad86 Added docs about vertical navigation default folded status 2017-10-27 11:45:11 +03:00
Sercan Yemen
3fc510469d New: Knowledge base page design 2017-10-25 13:09:35 +03:00
Sercan Yemen
5d56b3bcd6 Small typo on FAQ page 2017-10-25 13:09:17 +03:00
Sercan Yemen
aaa14eb1e9 Fixed: Stagger animation doesn't have {optional:true} 2017-10-25 10:15:19 +03:00
Sercan Yemen
f43608f93b Added a "Learn more" link to the language switcher for the demo 2017-10-24 16:02:09 +03:00
Sercan Yemen
9ecd921722 File based translations - multi language
+ Example in the Mail app
+ Component/doc page for translations
2017-10-24 15:41:44 +03:00
Sercan Yemen
98e2ff0e1e Small adjustment on the FAQ page header 2017-10-24 11:47:10 +03:00
Sercan Yemen
b7cb09b087 Small adjustment on the layout mode setting 2017-10-24 11:02:40 +03:00
Sercan Yemen
fe8b44b14c Fixed: FAQ page header shrinks on small heights 2017-10-24 10:19:17 +03:00
Sercan Yemen
ca8ed939ae Added new tabbed versions of the carded sidenav layouts
+ Small tweaks on other carded sidenav layouts
2017-10-23 14:39:44 +03:00
Sercan Yemen
4469a2c25a Fix: iOS10 scrolling issue in dashboard 2017-10-23 10:51:28 +03:00
Sercan Yemen
895291c37c Updated Fuse version
+ Removed unnecessary dev dependencies and updated couple of them
2017-10-16 10:45:08 +03:00
Sercan Yemen
ac7e6f75bc Added theme options openBar function to the navigation as an example
+ Removed duplicate Black and White tabs from colors
2017-10-16 10:08:40 +03:00
Sercan Yemen
bd8b02c82d Merge branch 'master' of https://github.com/withinpixels/fuse2 2017-10-14 18:44:17 +03:00
Sercan Yemen
6d594d63db Added a way of accessing and updating nav items
+ Added an ability to add custom functions to the nav items
2017-10-14 18:44:11 +03:00
mustafahlvc
6656410696 Calendar, Scrumboard Apps datepicker fixes. 2017-10-13 17:50:59 +03:00
mustafahlvc
470b851eae colors styling fix. 2017-10-13 15:43:22 +03:00
mustafahlvc
fbe9cb83a2 missing destroy function added for Faq page. 2017-10-13 15:39:18 +03:00
mustafahlvc
13a09164ae Faq page added. 2017-10-13 15:37:30 +03:00
Sercan Yemen
56d9830176 Fixed: Lock page layout issues 2017-10-13 14:39:46 +03:00
Sercan Yemen
be820804f2 New mail confirmation page 2017-10-13 14:22:59 +03:00
Sercan Yemen
7615bc1d03 Removed pricing tables from components 2017-10-13 12:24:13 +03:00
Sercan Yemen
3198663430 Merge branch 'master' of https://github.com/withinpixels/fuse2 2017-10-13 12:21:07 +03:00
Sercan Yemen
ad432ca31d New pricing page design
+ Fixed: Some color issues
+ Fixed: Icons and Quick Nav in memory web api related data issues
2017-10-13 12:21:00 +03:00
mustafahlvc
7d26beff3d angular updated to v4.4.5 2017-10-13 12:13:03 +03:00
mustafahlvc
4711a27814 Merge remote-tracking branch 'origin/master' 2017-10-13 11:58:12 +03:00
mustafahlvc
8205a4d5b5 <agm-map> Google Maps component library added,
+ some style refinements on doc pages.
2017-10-13 11:57:54 +03:00
Sercan Yemen
4f451a74e9 fixed custom colors 2017-10-12 17:40:27 +03:00
Sercan Yemen
8518408254 Merge branch 'master' of https://github.com/withinpixels/fuse2 2017-10-12 14:29:13 +03:00
Sercan Yemen
72f968b594 Fix: Auth page v2 styles iOS height issue
+ Fix: Perfect scrollbar causes issues on outside of the zone
+ Fix: Navigation must unsubscribe the nav toggle and clear the timeout
+ Fix: Chat view is not scrollable on mobile
+ Fix: Terms & Conditions checkbox styling issues on Auth forms
+ Fix: Sidenav z-index issue on certain page layouts
+ Fix: Some page layout header heights not correct on small devices
2017-10-12 14:28:58 +03:00
mustafahlvc
688b443ea8 <mat-select> wrapped with <mat-form-field> and fixed relative issues. 2017-10-12 14:05:22 +03:00
mustafahlvc
cb89da4647 angular-in-memory-web-api updated to v0.5.0,
(HTTP response data no longer wrapped in object w/ data property by default.)
2017-10-12 13:05:56 +03:00
Sercan Yemen
cc4a04afcb Removed fxFlexFill from main-content in an attempt to fix iOS scrolling and sizing issues
+ Updated Perfect scrollbar
+ updated various packages like zone-js & core-js
+ small tweak on contacts list item padding
+ removed md2 datepicker color tweak
2017-10-12 12:42:11 +03:00
mustafahlvc
bc239571a1 @angular/material v2.0.0-beta.12 examples updated. 2017-10-10 17:19:07 +03:00
mustafahlvc
c025563145 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	src/app/core/services/config.service.ts
2017-10-10 16:40:29 +03:00
mustafahlvc
c06e99dc97 @angular/material v2.0.0-beta.12 compability update,
Lots of breaking changes,
all "md" prefixes changed with "mat" due to angular material deprecation of "md",
md2 package removed, its not compatible with latest material version, will be replaced with another date picker later.
2017-10-10 16:37:24 +03:00
Sercan Yemen
c0a1dc7c37 Changed default navbar and footer colorsˆ 2017-10-09 14:22:12 +03:00
Sercan Yemen
55e1d8b2bc New Reset and Forgot password styles 2017-10-09 14:17:27 +03:00
Sercan Yemen
533f5f3f3f removed unnecessary console.logs and added possible route animations 2017-10-09 12:32:40 +03:00
Sercan Yemen
4a7b70c874 Fixes #16: Inconsistent font sizes across elements 2017-10-02 10:14:20 +03:00
Sercan Yemen
c101c432dc Fixes #14: Toolbar search bar button collapses on close 2017-10-02 10:01:22 +03:00
Sercan Yemen
04d1b2eff8 Fixes #9: print styles and page breaks 2017-09-29 12:06:47 +03:00
Sercan Yemen
f800dc3286 updated footer links 2017-09-28 12:52:34 +03:00
Sercan Yemen
619433f101 updated version number 2017-09-28 12:43:27 +03:00
mustafahlvc
3e9ae83aae Angular Material reference url fix 2017-09-28 12:26:33 +03:00
mustafahlvc
9400c3d748 Responsive refinement on some doc pages,
Navigation scrool fix on collapse toggled.
2017-09-28 12:22:33 +03:00
mustafahlvc
5e4940fed9 IconSvgExample Component path corrected. 2017-09-28 11:05:11 +03:00
mustafahlvc
8910e6f5dc angular-in-memory-web-api updated,
+ Http changed with HttpClient,
+ Angular Material Element examples added,
+ angular2-markdown Library added
2017-09-27 19:41:01 +03:00
mustafahlvc
52c5e6a18b Nested group vertical navigation indentation fix 2017-09-27 18:45:24 +03:00
mustafahlvc
3d9ded9a44 Nested Group feature added to navigation 2017-09-26 11:58:34 +03:00
mustafahlvc
1be3f0066b Angular Material updated to 2.0.0-beta.11:
Do not change the prefixes md to mat for this release; They don't completely migrate.
2017-09-26 10:04:45 +03:00
1618 changed files with 76283 additions and 22263 deletions

View File

@@ -1,58 +0,0 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "fuse2"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"styles.scss"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"hmr": "environments/environment.hmr.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json"
},
{
"project": "src/tsconfig.spec.json"
},
{
"project": "e2e/tsconfig.e2e.json"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "scss",
"component": {}
}
}

View File

@@ -1,12 +1,6 @@
root = true
[*]
charset=utf-8
end_of_line=lf
insert_final_newline=false
indent_style=space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
max_line_length = off
trim_trailing_whitespace = false
indent_size=4

5
.gitignore vendored
View File

@@ -30,13 +30,10 @@
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
# e2e
/e2e/*.js
/e2e/*.map
# System Files
.DS_Store
Thumbs.db

1
LICENSE Normal file
View File

@@ -0,0 +1 @@
https://themeforest.net/licenses/terms/regular

View File

@@ -1,6 +1,12 @@
# Fuse2
# Fuse - Angular
Material Design Admin Template with Angular 4+ and Angular Material 2
Material Design Admin Template with Angular 6+ and Angular Material
## The Community
Share your ideas, discuss Fuse and help each other.
[Click here](http://fusetheme.com/community) to see our Community page.
## Development server
@@ -8,11 +14,11 @@ Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app w
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|module`.
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
## Running unit tests
@@ -21,4 +27,8 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`.
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

150
angular.json Normal file
View File

@@ -0,0 +1,150 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"fuse": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {
"@schematics/angular:component": {
"styleext": "scss"
}
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets",
"src/app/main/angular-material-elements"
],
"styles": [
"src/styles.scss"
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
},
"ec": {
"sourceMap": true,
"extractCss": true
},
"hmr": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.hmr.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "fuse:build"
},
"configurations": {
"production": {
"browserTarget": "fuse:build:production"
},
"hmr": {
"hmr": true,
"browserTarget": "fuse:build:hmr"
},
"ec": {
"browserTarget": "fuse:build:ec"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "fuse:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"styles.scss"
],
"scripts": [],
"assets": [
"src/favicon.ico",
"src/assets"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**",
"**/src/app/fake-db/**/*",
"**/src/assets/angular-material-examples/**/*"
]
}
}
}
},
"fuse-e2e": {
"root": "e2e/",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "fuse:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**",
"**/src/app/fake-db/**/*",
"**/src/assets/angular-material-examples/**/*"
]
}
}
}
}
},
"defaultProject": "fuse"
}

View File

@@ -1,14 +0,0 @@
import { Fuse2Page } from './app.po';
describe('fuse2 App', () => {
let page: Fuse2Page;
beforeEach(() => {
page = new Fuse2Page();
});
it('should display welcome message', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('Welcome to app!!');
});
});

View File

@@ -1,11 +0,0 @@
import { browser, by, element } from 'protractor';
export class Fuse2Page {
navigateTo() {
return browser.get('/');
}
getParagraphText() {
return element(by.css('app-root h1')).getText();
}
}

31
e2e/protractor.conf.js Normal file
View File

@@ -0,0 +1,31 @@
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const {SpecReporter} = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs : [
'./src/**/*.e2e-spec.ts'
],
capabilities : {
'browserName': 'chrome'
},
directConnect : true,
baseUrl : 'http://localhost:4200/',
framework : 'jasmine',
jasmineNodeOpts : {
showColors : true,
defaultTimeoutInterval: 30000,
print : function ()
{
}
},
onPrepare()
{
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.e2e.json')
});
jasmine.getEnv().addReporter(new SpecReporter({spec: {displayStacktrace: true}}));
}
};

14
e2e/src/app.e2e-spec.ts Normal file
View File

@@ -0,0 +1,14 @@
import { Fuse2Page } from './app.po';
describe('Fuse2 App', () => {
let page: Fuse2Page;
beforeEach(() => {
page = new Fuse2Page();
});
it('should display welcome message', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('Welcome to Fuse2!');
});
});

11
e2e/src/app.po.ts Normal file
View File

@@ -0,0 +1,11 @@
import { browser, by, element } from 'protractor';
export class Fuse2Page {
navigateTo() {
return browser.get('/');
}
getParagraphText() {
return element(by.css('app-root h1')).getText();
}
}

View File

@@ -1,11 +1,12 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"outDir": "../out-tsc/app",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}

View File

@@ -1,33 +0,0 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma')
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};

15446
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,75 +1,88 @@
{
"name": "fuse2",
"version": "1.1.0",
"license": "",
"name": "fuse",
"version": "6.2.4",
"license": "https://themeforest.net/licenses/terms/regular",
"scripts": {
"ng": "ng",
"start": "ng serve",
"start-hmr": "ng serve --hmr -e=hmr -sm=false",
"start-hmr-sourcemaps": "ng serve --hmr -e=hmr",
"build": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build",
"build-prod": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --prod",
"start": "ng serve --open",
"start-hmr": "ng serve --configuration hmr --source-map=false --hmr-warning=false",
"start-hmr-sourcemaps": "ng serve --configuration hmr --source-map=true --hmr-warning=false",
"build": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --dev",
"build-stats": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --dev --stats-json",
"build-prod": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --prod",
"build-prod-stats": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --prod --stats-json",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
"e2e": "ng e2e",
"bundle-report": "webpack-bundle-analyzer dist/stats.json"
},
"private": true,
"dependencies": {
"@angular/animations": "4.4.3",
"@angular/cdk": "2.0.0-beta.10",
"@angular/common": "4.4.3",
"@angular/compiler": "4.4.3",
"@angular/core": "4.4.3",
"@angular/flex-layout": "2.0.0-beta.9",
"@angular/forms": "4.4.3",
"@angular/http": "4.4.3",
"@angular/material": "2.0.0-beta.10",
"@angular/platform-browser": "4.4.3",
"@angular/platform-browser-dynamic": "4.4.3",
"@angular/router": "4.4.3",
"@swimlane/ngx-charts": "6.0.2",
"@swimlane/ngx-datatable": "9.3.1",
"@swimlane/ngx-dnd": "3.0.0",
"angular-calendar": "0.19.0",
"angular-in-memory-web-api": "0.3.2",
"@agm/core": "1.0.0-beta.3",
"@angular/animations": "6.0.9",
"@angular/cdk": "6.3.3",
"@angular/common": "6.0.9",
"@angular/compiler": "6.0.9",
"@angular/core": "6.0.9",
"@angular/flex-layout": "6.0.0-beta.16",
"@angular/forms": "6.0.9",
"@angular/http": "6.0.9",
"@angular/material": "6.3.3",
"@angular/material-moment-adapter": "6.3.3",
"@angular/platform-browser": "6.0.9",
"@angular/platform-browser-dynamic": "6.0.9",
"@angular/router": "6.0.9",
"@ngrx/effects": "6.0.1",
"@ngrx/router-store": "6.0.1",
"@ngrx/store": "6.0.1",
"@ngrx/store-devtools": "6.0.1",
"@ngx-translate/core": "10.0.2",
"@swimlane/ngx-charts": "8.1.0",
"@swimlane/ngx-datatable": "13.0.1",
"@swimlane/ngx-dnd": "4.0.0",
"@types/prismjs": "1.9.0",
"angular-calendar": "0.25.2",
"angular-in-memory-web-api": "0.6.0",
"chart.js": "2.7.2",
"classlist.js": "1.1.20150312",
"core-js": "2.5.0",
"d3": "4.10.0",
"core-js": "2.5.7",
"d3": "5.5.0",
"hammerjs": "2.0.8",
"highlight.js": "9.12.0",
"intl": "1.2.5",
"md2": "0.0.28",
"moment": "2.18.1",
"ngx-color-picker": "4.3.1",
"ngx-cookie-service": "1.0.7",
"ngx-perfect-scrollbar": "4.6.2",
"perfect-scrollbar": "0.8.1",
"rxjs": "5.4.3",
"lodash": "4.17.10",
"moment": "2.22.2",
"ng2-charts": "1.6.0",
"ngrx-store-freeze": "0.2.4",
"ngx-color-picker": "6.5.0",
"ngx-cookie-service": "1.0.10",
"perfect-scrollbar": "1.4.0",
"prismjs": "1.15.0",
"rxjs": "6.2.1",
"rxjs-compat": "6.2.1",
"web-animations-js": "2.3.1",
"zone.js": "0.8.17"
"zone.js": "0.8.26"
},
"devDependencies": {
"@angular/cli": "1.4.2",
"@angular/compiler-cli": "4.4.3",
"@angular/language-service": "4.4.3",
"@angular/cli": "6.0.8",
"@angular/compiler-cli": "6.0.9",
"@angular/language-service": "6.0.9",
"@angular-devkit/build-angular": "0.6.8",
"@angularclass/hmr": "2.1.3",
"@ngtools/webpack": "1.7.1",
"@types/jasmine": "2.6.0",
"@types/jasminewd2": "2.0.2",
"@types/node": "6.0.88",
"codelyzer": "3.0.1",
"jasmine-core": "2.6.2",
"jasmine-spec-reporter": "4.1.0",
"@types/jasmine": "2.8.8",
"@types/jasminewd2": "2.0.3",
"@types/lodash": "4.14.111",
"@types/node": "8.9.5",
"codelyzer": "4.2.1",
"jasmine-core": "2.99.1",
"jasmine-spec-reporter": "4.2.1",
"karma": "1.7.1",
"karma-chrome-launcher": "2.1.1",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "1.2.1",
"karma-jasmine": "1.1.0",
"karma-chrome-launcher": "2.2.0",
"karma-coverage-istanbul-reporter": "2.0.1",
"karma-jasmine": "1.1.2",
"karma-jasmine-html-reporter": "0.2.2",
"node-sass": "4.5.3",
"protractor": "5.1.2",
"ts-node": "3.0.4",
"tslint": "5.3.2",
"typescript": "2.3.3"
"protractor": "5.3.2",
"ts-node": "5.0.1",
"tslint": "5.9.1",
"typescript": "2.7.2",
"webpack-bundle-analyzer": "2.13.1"
}
}

View File

@@ -1,28 +0,0 @@
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter } = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./e2e/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};

View File

@@ -33,21 +33,21 @@ export const fuseAnimations = [
stagger('50ms', [
animateChild()
])
])),
], {optional: true})),
transition('void => 100',
query('@*',
[
stagger('100ms', [
animateChild()
])
])),
], {optional: true})),
transition('void => 200',
query('@*',
[
stagger('200ms', [
animateChild()
])
]))
], {optional: true}))
]),
trigger('fadeInOut', [
@@ -76,6 +76,53 @@ export const fuseAnimations = [
transition('0 => 1', animate('300ms ease-in'))
]),
trigger('slideIn', [
transition('void => left', [
style({
transform: 'translateX(100%)'
}),
animate('300ms ease-in',
style({
transform: 'translateX(0)'
})
)
]
),
transition('left => void', [
style({
transform: 'translateX(0)'
}),
animate('300ms ease-in',
style({
transform: 'translateX(-100%)'
})
)
]
),
transition('void => right', [
style({
transform: 'translateX(-100%)'
}),
animate('300ms ease-in',
style({
transform: 'translateX(0)'
})
)
]
),
transition('right => void', [
style({
transform: 'translateX(0)'
}),
animate('300ms ease-in',
style({
transform: 'translateX(100%)'
})
)
]
),
]),
trigger('slideInLeft', [
state('void', style({
transform: 'translateX(-100%)',
@@ -129,10 +176,25 @@ export const fuseAnimations = [
transition('* => void', animate('300ms'))
]),
trigger('expandCollapse', [
state('void', style({
height: '0px'
})),
state('*', style({
height: '*'
})),
transition('void => *', animate('300ms ease-out')),
transition('* => void', animate('300ms ease-in'))
]),
// -----------------------------------------------------------------------------------------------------
// @ Router animations
// -----------------------------------------------------------------------------------------------------
trigger('routerTransitionLeft', [
transition('* => *', [
query('fuse-content > :enter, fuse-content > :leave', [
query('content > :enter, content > :leave', [
style({
position: 'absolute',
top : 0,
@@ -141,7 +203,7 @@ export const fuseAnimations = [
right : 0
})
], {optional: true}),
query('fuse-content > :enter', [
query('content > :enter', [
style({
transform: 'translateX(100%)',
opacity : 0
@@ -149,7 +211,7 @@ export const fuseAnimations = [
], {optional: true}),
sequence([
group([
query('fuse-content > :leave', [
query('content > :leave', [
style({
transform: 'translateX(0)',
opacity : 1
@@ -160,7 +222,7 @@ export const fuseAnimations = [
opacity : 0
}))
], {optional: true}),
query('fuse-content > :enter', [
query('content > :enter', [
style({transform: 'translateX(100%)'}),
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
style({
@@ -169,8 +231,8 @@ export const fuseAnimations = [
}))
], {optional: true})
]),
query('fuse-content > :leave', animateChild(), {optional: true}),
query('fuse-content > :enter', animateChild(), {optional: true})
query('content > :leave', animateChild(), {optional: true}),
query('content > :enter', animateChild(), {optional: true})
])
])
]),
@@ -178,7 +240,7 @@ export const fuseAnimations = [
trigger('routerTransitionRight', [
transition('* => *', [
query('fuse-content > :enter, fuse-content > :leave', [
query('content > :enter, content > :leave', [
style({
position: 'absolute',
top : 0,
@@ -187,7 +249,7 @@ export const fuseAnimations = [
right : 0
})
], {optional: true}),
query('fuse-content > :enter', [
query('content > :enter', [
style({
transform: 'translateX(-100%)',
opacity : 0
@@ -195,7 +257,7 @@ export const fuseAnimations = [
], {optional: true}),
sequence([
group([
query('fuse-content > :leave', [
query('content > :leave', [
style({
transform: 'translateX(0)',
opacity : 1
@@ -206,7 +268,7 @@ export const fuseAnimations = [
opacity : 0
}))
], {optional: true}),
query('fuse-content > :enter', [
query('content > :enter', [
style({transform: 'translateX(-100%)'}),
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
style({
@@ -215,8 +277,8 @@ export const fuseAnimations = [
}))
], {optional: true})
]),
query('fuse-content > :leave', animateChild(), {optional: true}),
query('fuse-content > :enter', animateChild(), {optional: true})
query('content > :leave', animateChild(), {optional: true}),
query('content > :enter', animateChild(), {optional: true})
])
])
]),
@@ -224,7 +286,7 @@ export const fuseAnimations = [
trigger('routerTransitionUp', [
transition('* => *', [
query('fuse-content > :enter, fuse-content > :leave', [
query('content > :enter, content > :leave', [
style({
position: 'absolute',
top : 0,
@@ -233,14 +295,14 @@ export const fuseAnimations = [
right : 0
})
], {optional: true}),
query('fuse-content > :enter', [
query('content > :enter', [
style({
transform: 'translateY(100%)',
opacity : 0
})
], {optional: true}),
group([
query('fuse-content > :leave', [
query('content > :leave', [
style({
transform: 'translateY(0)',
opacity : 1
@@ -251,7 +313,7 @@ export const fuseAnimations = [
opacity : 0
}))
], {optional: true}),
query('fuse-content > :enter', [
query('content > :enter', [
style({transform: 'translateY(100%)'}),
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
style({
@@ -260,15 +322,15 @@ export const fuseAnimations = [
}))
], {optional: true})
]),
query('fuse-content > :leave', animateChild(), {optional: true}),
query('fuse-content > :enter', animateChild(), {optional: true})
query('content > :leave', animateChild(), {optional: true}),
query('content > :enter', animateChild(), {optional: true})
])
]),
trigger('routerTransitionDown', [
transition('* => *', [
query('fuse-content > :enter, fuse-content > :leave', [
query('content > :enter, content > :leave', [
style({
position: 'absolute',
top : 0,
@@ -277,7 +339,7 @@ export const fuseAnimations = [
right : 0
})
], {optional: true}),
query('fuse-content > :enter', [
query('content > :enter', [
style({
transform: 'translateY(-100%)',
opacity : 0
@@ -285,7 +347,7 @@ export const fuseAnimations = [
], {optional: true}),
sequence([
group([
query('fuse-content > :leave', [
query('content > :leave', [
style({
transform: 'translateY(0)',
opacity : 1
@@ -296,7 +358,7 @@ export const fuseAnimations = [
opacity : 0
}))
], {optional: true}),
query('fuse-content > :enter', [
query('content > :enter', [
style({transform: 'translateY(-100%)'}),
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
style({
@@ -305,8 +367,8 @@ export const fuseAnimations = [
}))
], {optional: true})
]),
query('fuse-content > :leave', animateChild(), {optional: true}),
query('fuse-content > :enter', animateChild(), {optional: true})
query('content > :leave', animateChild(), {optional: true}),
query('content > :enter', animateChild(), {optional: true})
])
])
]),
@@ -315,7 +377,7 @@ export const fuseAnimations = [
transition('* => *', group([
query('fuse-content > :enter, fuse-content > :leave ', [
query('content > :enter, content > :leave ', [
style({
position: 'absolute',
top : 0,
@@ -325,12 +387,12 @@ export const fuseAnimations = [
})
], {optional: true}),
query('fuse-content > :enter', [
query('content > :enter', [
style({
opacity: 0
})
], {optional: true}),
query('fuse-content > :leave', [
query('content > :leave', [
style({
opacity: 1
}),
@@ -339,7 +401,7 @@ export const fuseAnimations = [
opacity: 0
}))
], {optional: true}),
query('fuse-content > :enter', [
query('content > :enter', [
style({
opacity: 0
}),
@@ -348,8 +410,8 @@ export const fuseAnimations = [
opacity: 1
}))
], {optional: true}),
query('fuse-content > :enter', animateChild(), {optional: true}),
query('fuse-content > :leave', animateChild(), {optional: true})
query('content > :enter', animateChild(), {optional: true}),
query('content > :leave', animateChild(), {optional: true})
]))
])
];

View File

@@ -0,0 +1,6 @@
<h1 matDialogTitle>Confirm</h1>
<div mat-dialog-content>{{confirmMessage}}</div>
<div mat-dialog-actions class="pt-24">
<button mat-raised-button class="mat-accent mr-16" (click)="dialogRef.close(true)">Confirm</button>
<button mat-button (click)="dialogRef.close(false)">Cancel</button>
</div>

View File

@@ -0,0 +1,24 @@
import { Component } from '@angular/core';
import { MatDialogRef } from '@angular/material';
@Component({
selector : 'fuse-confirm-dialog',
templateUrl: './confirm-dialog.component.html',
styleUrls : ['./confirm-dialog.component.scss']
})
export class FuseConfirmDialogComponent
{
public confirmMessage: string;
/**
* Constructor
*
* @param {MatDialogRef<FuseConfirmDialogComponent>} dialogRef
*/
constructor(
public dialogRef: MatDialogRef<FuseConfirmDialogComponent>
)
{
}
}

View File

@@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { MatButtonModule, MatDialogModule } from '@angular/material';
import { FuseConfirmDialogComponent } from '@fuse/components/confirm-dialog/confirm-dialog.component';
@NgModule({
declarations: [
FuseConfirmDialogComponent
],
imports: [
MatDialogModule,
MatButtonModule
],
entryComponents: [
FuseConfirmDialogComponent
],
})
export class FuseConfirmDialogModule
{
}

View File

@@ -0,0 +1,89 @@
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { interval, Subject } from 'rxjs';
import { map, takeUntil } from 'rxjs/operators';
import * as moment from 'moment';
@Component({
selector : 'fuse-countdown',
templateUrl: './countdown.component.html',
styleUrls : ['./countdown.component.scss']
})
export class FuseCountdownComponent implements OnInit, OnDestroy
{
// Event date
@Input('eventDate')
eventDate;
countdown: any;
// Private
private _unsubscribeAll: Subject<any>;
/**
* Constructor
*/
constructor()
{
// Set the defaults
this.countdown = {
days : '',
hours : '',
minutes: '',
seconds: ''
};
// Set the private defaults
this._unsubscribeAll = new Subject();
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void
{
const currDate = moment();
const eventDate = moment(this.eventDate);
// Get the difference in between the current date and event date
let diff = eventDate.diff(currDate, 'seconds');
// Create a subscribable interval
const countDown = interval(1000)
.pipe(
map(value => {
return diff = diff - 1;
}),
map(value => {
const timeLeft = moment.duration(value, 'seconds');
return {
days : timeLeft.asDays().toFixed(0),
hours : timeLeft.hours(),
minutes: timeLeft.minutes(),
seconds: timeLeft.seconds()
};
})
);
// Subscribe to the countdown interval
countDown
.pipe(takeUntil(this._unsubscribeAll))
.subscribe(value => {
this.countdown = value;
});
}
/**
* On destroy
*/
ngOnDestroy(): void
{
// Unsubscribe from all subscriptions
this._unsubscribeAll.next();
this._unsubscribeAll.complete();
}
}

View File

@@ -0,0 +1,15 @@
import { NgModule } from '@angular/core';
import { FuseCountdownComponent } from '@fuse/components/countdown/countdown.component';
@NgModule({
declarations: [
FuseCountdownComponent
],
exports: [
FuseCountdownComponent
],
})
export class FuseCountdownModule
{
}

View File

@@ -0,0 +1,75 @@
<!-- DEMO CONTENT -->
<div class="demo-content">
<img src="assets/images/beach.jpg" alt="beach" style="max-width: 640px; width: 100%;">
<h1>Early Sunrise</h1>
<h4 class="secondary-text">Demo Content</h4>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse tortor nibh, convallis sed purus nec,
auctor venenatis nisl. Suspendisse potenti. Nullam sagittis nulla in diam finibus, sed pharetra velit
vestibulum. Suspendisse euismod in urna eu posuere.
</p>
<blockquote>
<p>
Nunc vel lacinia lorem. Nullam tincidunt sed purus eu placerat. Donec id dictum erat. Etiam enim ex, dapibus
et tortor id, posuere pretium est. Maecenas fringilla ipsum vitae neque elementum, at eleifend ante
sollicitudin. Donec viverra augue dolor, a venenatis tellus consectetur sit amet.
</p>
<footer>
John Doe
</footer>
</blockquote>
<p>
Ut ornare sit amet velit vel congue. Ut nec tristique eros. Lorem ipsum dolor sit amet, consectetur adipiscing
elit. Vivamus sed lorem quis nibh porta iaculis. Vestibulum ut eleifend ante, at semper mi. Nam imperdiet est
nisi, quis hendrerit tellus convallis et. Morbi in luctus neque. Curabitur elementum ut est et gravida. In hac
habitasse platea dictumst.
</p>
<p>
In et placerat eros, eu tempor turpis. Curabitur ac felis finibus, elementum lectus vitae, venenatis est.
Integer mollis nisl a eros scelerisque varius. Etiam venenatis lectus vel erat condimentum tristique vel vel mi.
Nulla id euismod mi, et mollis tellus.
</p>
<p>
Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Class aptent taciti
sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur vitae sagittis odio.
Suspendisse ullamcorper nunc non pellentesque laoreet. Curabitur eu tortor id quam pretium mattis. Proin ut quam
velit.
</p>
<p>
Quisque sit amet risus enim. Aliquam sit amet interdum justo, at ultricies sapien. Suspendisse et semper urna,
in gravida eros. Quisque id nibh iaculis, euismod urna sed, egestas nisi. Donec eros metus, congue a imperdiet
feugiat, sagittis nec ipsum. Quisque dapibus mollis felis non tristique.
</p>
<p>
Ut auctor, metus sed dapibus tempus, urna diam auctor odio, in malesuada odio risus vitae nisi. Etiam blandit
ante urna, vitae placerat massa mollis in. Duis nec urna ac purus semper dictum ut eget justo. Aenean non
sagittis augue. Sed venenatis rhoncus enim eget ornare. Donec viverra sed felis at venenatis. Mauris aliquam
fringilla nulla, sit amet congue felis dignissim at.
</p>
<p>
Quisque accumsan augue tempor ante mollis, sed placerat diam porttitor. Vestibulum dignissim sem vel velit
eleifend, non pellentesque quam convallis. Pellentesque est dolor, dignissim ac tortor tristique, hendrerit
iaculis metus. Praesent pulvinar quam eu leo consectetur faucibus. Vestibulum purus diam, gravida sagittis
feugiat sit amet, tincidunt in ligula. Sed semper vestibulum magna. Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Suspendisse tortor nibh, convallis sed purus nec, auctor venenatis nisl. Suspendisse potenti.
</p>
<p>
Nullam sagittis nulla in diam finibus, sed pharetra velit vestibulum. Suspendisse euismod in urna eu posuere.
Etiam blandit nunc arcu, et consectetur orci blandit a. Aliquam condimentum pharetra quam at ultricies. Nunc vel
lacinia lorem. Nullam tincidunt sed purus eu placerat. Donec id dictum erat. Etiam enim ex, dapibus et tortor
id, posuere pretium est. Maecenas fringilla ipsum vitae neque elementum, at eleifend ante sollicitudin. Donec
viverra augue dolor, a venenatis tellus consectetur sit amet...
</p>
</div>
<!-- / DEMO CONTENT -->

View File

@@ -7,6 +7,9 @@ import { Component } from '@angular/core';
})
export class FuseDemoContentComponent
{
/**
* Constructor
*/
constructor()
{
}

View File

@@ -0,0 +1,100 @@
<div class="demo-sidebar">
<mat-list>
<h3 matSubheader>Sidebar Demo</h3>
<mat-list-item>
<span>Sidebar Item 1</span>
</mat-list-item>
<mat-divider></mat-divider>
<mat-list-item>
<span>Sidebar Item 2</span>
</mat-list-item>
<mat-divider></mat-divider>
<mat-list-item>
<span>Sidebar Item 3</span>
</mat-list-item>
<mat-divider></mat-divider>
<mat-list-item>
<span>Sidebar Item 4</span>
</mat-list-item>
<mat-divider></mat-divider>
<mat-list-item>
<span>Sidebar Item 5</span>
</mat-list-item>
<mat-divider></mat-divider>
<mat-list-item>
<span>Sidebar Item 6</span>
</mat-list-item>
<mat-divider></mat-divider>
<mat-list-item>
<span>Sidebar Item 7</span>
</mat-list-item>
<mat-divider></mat-divider>
<mat-list-item>
<span>Sidebar Item 8</span>
</mat-list-item>
<mat-divider></mat-divider>
<mat-list-item>
<span>Sidebar Item 9</span>
</mat-list-item>
<mat-divider></mat-divider>
<mat-list-item>
<span>Sidebar Item 10</span>
</mat-list-item>
<mat-divider></mat-divider>
<mat-list-item>
<span>Sidebar Item 11</span>
</mat-list-item>
<mat-divider></mat-divider>
<mat-list-item>
<span>Sidebar Item 12</span>
</mat-list-item>
<mat-divider></mat-divider>
<mat-list-item>
<span>Sidebar Item 13</span>
</mat-list-item>
<mat-divider></mat-divider>
<mat-list-item>
<span>Sidebar Item 14</span>
</mat-list-item>
<mat-divider></mat-divider>
<mat-list-item>
<span>Sidebar Item 15</span>
</mat-list-item>
<mat-divider></mat-divider>
<mat-list-item>
<span>Sidebar Item 16</span>
</mat-list-item>
</mat-list>
</div>

View File

@@ -0,0 +1,16 @@
import { Component } from '@angular/core';
@Component({
selector : 'fuse-demo-sidebar',
templateUrl: './demo-sidebar.component.html',
styleUrls : ['./demo-sidebar.component.scss']
})
export class FuseDemoSidebarComponent
{
/**
* Constructor
*/
constructor()
{
}
}

View File

@@ -1,21 +1,25 @@
import { NgModule } from '@angular/core';
import { SharedModule } from '../../modules/shared.module';
import { RouterModule } from '@angular/router';
import { MatDividerModule, MatListModule } from '@angular/material';
import { FuseDemoContentComponent } from './demo-content/demo-content.component';
import { FuseDemoSidenavComponent } from './demo-sidenav/demo-sidenav.component';
import { FuseDemoSidebarComponent } from './demo-sidebar/demo-sidebar.component';
@NgModule({
declarations: [
FuseDemoContentComponent,
FuseDemoSidenavComponent
FuseDemoSidebarComponent
],
imports : [
SharedModule,
RouterModule
RouterModule,
MatDividerModule,
MatListModule
],
exports : [
FuseDemoContentComponent,
FuseDemoSidenavComponent
FuseDemoSidebarComponent
]
})
export class FuseDemoModule

View File

@@ -0,0 +1,8 @@
:host {
display: block;
padding: 8px;
background: #263238;
cursor: text;
overflow: auto;
-webkit-overflow-scrolling: touch;
}

View File

@@ -0,0 +1,149 @@
import { Component, ContentChild, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import * as Prism from 'prismjs/prism';
import '@fuse/components/highlight/prism-languages';
@Component({
selector : 'fuse-highlight',
template : '',
styleUrls: ['./highlight.component.scss']
})
export class FuseHighlightComponent implements OnInit, OnDestroy
{
// Source
@ContentChild('source')
source: ElementRef;
// Lang
@Input('lang')
lang: string;
// Path
@Input('path')
path: string;
// Private
private _unsubscribeAll: Subject<any>;
/**
* Constructor
*
* @param {ElementRef} _elementRef
* @param {HttpClient} _httpClient
*/
constructor(
private _elementRef: ElementRef,
private _httpClient: HttpClient
)
{
// Set the private defaults
this._unsubscribeAll = new Subject();
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void
{
// If there is no language defined, return...
if ( !this.lang )
{
return;
}
// If the path is defined...
if ( this.path )
{
// Get the source
this._httpClient.get(this.path, {responseType: 'text'})
.pipe(takeUntil(this._unsubscribeAll))
.subscribe((response) => {
// Highlight it
this.highlight(response);
});
}
// If the path is not defined and the source element exists...
if ( !this.path && this.source )
{
// Highlight it
this.highlight(this.source.nativeElement.value);
}
}
/**
* On destroy
*/
ngOnDestroy(): void
{
// Unsubscribe from all subscriptions
this._unsubscribeAll.next();
this._unsubscribeAll.complete();
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Highlight the given source code
*
* @param sourceCode
*/
highlight(sourceCode): void
{
// Split the source into lines
const sourceLines = sourceCode.split('\n');
// Remove the first and the last line of the source
// code if they are blank lines. This way, the html
// can be formatted properly while using fuse-highlight
// component
if ( !sourceLines[0].trim() )
{
sourceLines.shift();
}
if ( !sourceLines[sourceLines.length - 1].trim() )
{
sourceLines.pop();
}
// Find the first non-whitespace char index in
// the first line of the source code
const indexOfFirstChar = sourceLines[0].search(/\S|$/);
// Generate the trimmed source
let source = '';
// Iterate through all the lines
sourceLines.forEach((line, index) => {
// Trim the beginning white space depending on the index
// and concat the source code
source = source + line.substr(indexOfFirstChar, line.length);
// If it's not the last line...
if ( index !== sourceLines.length - 1 )
{
// Add a line break at the end
source = source + '\n';
}
});
// Generate the highlighted code
const highlightedCode = Prism.highlight(source, Prism.languages[this.lang]);
// Replace the innerHTML of the component with the highlighted code
this._elementRef.nativeElement.innerHTML =
'<pre><code class="highlight language-' + this.lang + '">' + highlightedCode + '</code></pre>';
}
}

View File

@@ -0,0 +1,15 @@
import { NgModule } from '@angular/core';
import { FuseHighlightComponent } from '@fuse/components/highlight/highlight.component';
@NgModule({
declarations: [
FuseHighlightComponent
],
exports: [
FuseHighlightComponent
],
})
export class FuseHighlightModule
{
}

View File

@@ -0,0 +1,18 @@
import 'prismjs/prism';
import 'prismjs/components/prism-bash';
import 'prismjs/components/prism-c';
import 'prismjs/components/prism-cpp';
import 'prismjs/components/prism-csharp';
import 'prismjs/components/prism-css';
import 'prismjs/components/prism-diff';
import 'prismjs/components/prism-markup';
import 'prismjs/components/prism-markup-templating';
import 'prismjs/components/prism-java';
import 'prismjs/components/prism-javascript';
import 'prismjs/components/prism-json';
import 'prismjs/components/prism-perl';
import 'prismjs/components/prism-php';
import 'prismjs/components/prism-python';
import 'prismjs/components/prism-sass';
import 'prismjs/components/prism-scss';
import 'prismjs/components/prism-typescript';

View File

@@ -0,0 +1,12 @@
export * from './confirm-dialog/confirm-dialog.module';
export * from './countdown/countdown.module';
export * from './demo/demo.module';
export * from './highlight/highlight.module';
export * from './material-color-picker/material-color-picker.module';
export * from './navigation/navigation.module';
export * from './progress-bar/progress-bar.module';
export * from './search-bar/search-bar.module';
export * from './shortcuts/shortcuts.module';
export * from './sidebar/sidebar.module';
export * from './theme-options/theme-options.module';
export * from './widget/widget.module';

View File

@@ -0,0 +1,70 @@
<button mat-icon-button
type="button"
class="mat-elevation-z1"
[matMenuTriggerFor]="colorMenu"
(menuOpened)="onMenuOpen()"
[ngClass]="'mat-'+selectedPalette+'-'+selectedHue+'-bg'">
<mat-icon>palette</mat-icon>
</button>
<mat-menu #colorMenu="matMenu" class="fuse-material-color-picker-menu">
<header [ngClass]="selectedColor?.class || 'mat-accent-bg'" class="mat-elevation-z4"
fxLayout="row" fxLayoutAlign="space-between center">
<button mat-icon-button
[style.visibility]="view==='hues'?'visible':'hidden'"
(click)="$event.stopPropagation();backToPaletteSelection()" aria-label="Palette">
<mat-icon class="s-20">arrow_back</mat-icon>
</button>
<span *ngIf="selectedColor?.palette">
{{selectedColor.palette}} {{selectedColor.hue}}
</span>
<span *ngIf="!selectedColor?.palette">
Select Color
</span>
<button mat-icon-button
class="remove-color-button"
(click)="$event.stopPropagation();removeColor()"
aria-label="Remove Color">
<mat-icon class="s-20">delete</mat-icon>
</button>
</header>
<div [ngSwitch]="view" class="views">
<div class="view" *ngSwitchCase="'palettes'">
<div fxLayout="row wrap" fxLayoutAlign="start start" class="colors" fusePerfectScrollbar>
<div class="color"
[ngClass]="'mat-'+color.key+'-bg'"
*ngFor="let color of (colors | keys)"
(click)="$event.stopPropagation();selectPalette(color.key)"
fxLayout="row" fxLayoutAlign="start end" mat-ink-ripple>
<span class="label">
{{color.key}}
</span>
</div>
</div>
</div>
<div class="view" *ngSwitchCase="'hues'" >
<div fxLayout="row wrap" fxLayoutAlign="start start" class="colors" fusePerfectScrollbar>
<div class="color" *ngFor="let hue of hues"
[fxHide]="selectedPalette === 'white' && hue !== '500'|| selectedPalette === 'black' && hue !== '500'"
[ngClass]="'mat-'+selectedPalette+'-'+hue+'-bg'"
(click)="selectHue(hue)" fxLayout="row" fxLayoutAlign="start end" mat-ink-ripple>
<span class="label">
{{hue}}
</span>
<mat-icon *ngIf="selectedHue === hue" class="s-16">check</mat-icon>
</div>
</div>
</div>
</div>
</mat-menu>

View File

@@ -11,7 +11,7 @@
overflow: hidden;
min-height: 258px;
height: 308px;
background-color: #f7f7f7;
background-color: #F7F7F7;
.view {
position: absolute;
@@ -39,7 +39,7 @@
font-size: 10px;
}
md-icon {
mat-icon {
position: absolute;
top: 2px;
right: 2px;

View File

@@ -1,6 +1,7 @@
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, ViewEncapsulation } from '@angular/core';
import { MatColors } from '../../matColors';
import { fuseAnimations } from '../../animations';
import { Component, EventEmitter, Input, OnChanges, Output, ViewEncapsulation } from '@angular/core';
import { fuseAnimations } from '@fuse/animations';
import { MatColors } from '@fuse/mat-colors';
@Component({
selector : 'fuse-material-color-picker',
@@ -9,25 +10,81 @@ import { fuseAnimations } from '../../animations';
animations : fuseAnimations,
encapsulation: ViewEncapsulation.None
})
export class FuseMaterialColorPickerComponent implements OnInit, OnChanges
export class FuseMaterialColorPickerComponent implements OnChanges
{
colors: any;
selectedColor: any;
hues: string[];
view = 'palettes';
selectedColor: any;
view: string;
@Input() selectedPalette = '';
@Input() selectedHue = '';
@Input() selectedFg = '';
@Input() value: any;
@Output() onValueChange = new EventEmitter();
@Output() selectedPaletteChange = new EventEmitter();
@Output() selectedHueChange = new EventEmitter();
@Output() selectedClassChange = new EventEmitter();
@Output() selectedBgChange = new EventEmitter();
@Output() selectedFgChange = new EventEmitter();
@Input()
selectedPalette: string;
_selectedClass = '';
@Input()
selectedHue: string;
@Input()
selectedFg: string;
@Input()
value: any;
@Output()
onValueChange: EventEmitter<any>;
@Output()
selectedPaletteChange: EventEmitter<any>;
@Output()
selectedHueChange: EventEmitter<any>;
@Output()
selectedClassChange: EventEmitter<any>;
@Output()
selectedBgChange: EventEmitter<any>;
@Output()
selectedFgChange: EventEmitter<any>;
// Private
_selectedClass: string;
_selectedBg: string;
/**
* Constructor
*/
constructor()
{
// Set the defaults
this.colors = MatColors.all;
this.hues = ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900', 'A100', 'A200', 'A400', 'A700'];
this.selectedFg = '';
this.selectedHue = '';
this.selectedPalette = '';
this.view = 'palettes';
this.onValueChange = new EventEmitter();
this.selectedPaletteChange = new EventEmitter();
this.selectedHueChange = new EventEmitter();
this.selectedClassChange = new EventEmitter();
this.selectedBgChange = new EventEmitter();
this.selectedFgChange = new EventEmitter();
// Set the private defaults
this._selectedClass = '';
this._selectedBg = '';
}
// -----------------------------------------------------------------------------------------------------
// @ Accessors
// -----------------------------------------------------------------------------------------------------
/**
* Selected class
*
* @param value
*/
@Input()
set selectedClass(value)
{
@@ -53,7 +110,11 @@ export class FuseMaterialColorPickerComponent implements OnInit, OnChanges
return this._selectedClass;
}
_selectedBg = '';
/**
* Selected bg
*
* @param value
*/
@Input()
set selectedBg(value)
{
@@ -85,38 +146,72 @@ export class FuseMaterialColorPickerComponent implements OnInit, OnChanges
return this._selectedBg;
}
constructor()
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On changes
*
* @param changes
*/
ngOnChanges(changes: any): void
{
this.colors = MatColors.all;
this.hues = ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900', 'A100', 'A200', 'A400', 'A700'];
if ( changes.selectedBg && changes.selectedBg.currentValue === '' ||
changes.selectedClass && changes.selectedClass.currentValue === '' ||
changes.selectedPalette && changes.selectedPalette.currentValue === '' )
{
this.removeColor();
return;
}
if ( changes.selectedPalette || changes.selectedHue || changes.selectedClass || changes.selectedBg )
{
this.updateSelectedColor();
}
}
ngOnInit()
{
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
}
selectPalette(palette)
/**
* Select palette
*
* @param palette
*/
selectPalette(palette): void
{
this.selectedPalette = palette;
this.updateSelectedColor();
this.view = 'hues';
}
selectHue(hue)
/**
* Select hue
*
* @param hue
*/
selectHue(hue): void
{
this.selectedHue = hue;
this.updateSelectedColor();
}
removeColor()
/**
* Remove color
*/
removeColor(): void
{
this.selectedPalette = '';
this.selectedHue = '';
this.updateSelectedColor();
this.view = 'palettes';
}
updateSelectedColor()
/**
* Update selected color
*/
updateSelectedColor(): void
{
setTimeout(() => {
@@ -129,7 +224,7 @@ export class FuseMaterialColorPickerComponent implements OnInit, OnChanges
{
this.selectedBg = MatColors.getColor(this.selectedPalette)[this.selectedHue];
this.selectedFg = MatColors.getColor(this.selectedPalette).contrast[this.selectedHue];
this.selectedClass = 'md-' + this.selectedPalette + '-' + this.selectedHue + '-bg';
this.selectedClass = 'mat-' + this.selectedPalette + '-' + this.selectedHue + '-bg';
}
else
{
@@ -156,12 +251,18 @@ export class FuseMaterialColorPickerComponent implements OnInit, OnChanges
});
}
backToPaletteSelection()
/**
* Go back to palette selection
*/
backToPaletteSelection(): void
{
this.view = 'palettes';
}
onMenuOpen()
/**
* On menu open
*/
onMenuOpen(): void
{
if ( this.selectedPalette === '' )
{
@@ -172,19 +273,4 @@ export class FuseMaterialColorPickerComponent implements OnInit, OnChanges
this.view = 'hues';
}
}
ngOnChanges(changes: any)
{
if ( changes.selectedBg && changes.selectedBg.currentValue === '' ||
changes.selectedClass && changes.selectedClass.currentValue === '' ||
changes.selectedPalette && changes.selectedPalette.currentValue === '' )
{
this.removeColor();
return;
}
if ( changes.selectedPalette || changes.selectedHue || changes.selectedClass || changes.selectedBg )
{
this.updateSelectedColor();
}
}
}

View File

@@ -0,0 +1,32 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FlexLayoutModule } from '@angular/flex-layout';
import { MatButtonModule, MatIconModule, MatMenuModule, MatRippleModule } from '@angular/material';
import { FusePipesModule } from '@fuse/pipes/pipes.module';
import { FuseMaterialColorPickerComponent } from '@fuse/components/material-color-picker/material-color-picker.component';
@NgModule({
declarations: [
FuseMaterialColorPickerComponent
],
imports: [
CommonModule,
FlexLayoutModule,
MatButtonModule,
MatIconModule,
MatMenuModule,
MatRippleModule,
FusePipesModule
],
exports: [
FuseMaterialColorPickerComponent
],
})
export class FuseMaterialColorPickerModule
{
}

View File

@@ -0,0 +1,69 @@
<ng-container *ngIf="!item.hidden">
<!-- normal collapse -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="!item.url && !item.function" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.url -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && !item.function"
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}"
[target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.externalUrl -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && !item.function"
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.function -->
<span class="nav-link" [ngClass]="item.classes" *ngIf="!item.url && item.function"
(click)="item.function()" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</span>
<!-- item.url && item.function -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && item.function"
(click)="item.function()"
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.externalUrl && item.function -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && item.function"
(click)="item.function()"
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<ng-template #itemContent>
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
{{item.badge.title}}
</span>
<mat-icon class="collapsable-arrow">keyboard_arrow_right</mat-icon>
</ng-template>
<div class="children" [ngClass]="{'open': isOpen}">
<div class="{{fuseConfig.layout.navbar.background}}">
<ng-container *ngFor="let item of item.children">
<fuse-nav-horizontal-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-horizontal-item>
<fuse-nav-horizontal-collapsable *ngIf="item.type=='collapsable'"
[item]="item"></fuse-nav-horizontal-collapsable>
<fuse-nav-horizontal-collapsable *ngIf="item.type=='group'"
[item]="item"></fuse-nav-horizontal-collapsable>
</ng-container>
</div>
</div>
</ng-container>

View File

@@ -0,0 +1,86 @@
import { Component, HostBinding, HostListener, Input, OnDestroy, OnInit } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { fuseAnimations } from '@fuse/animations';
import { FuseConfigService } from '@fuse/services/config.service';
@Component({
selector : 'fuse-nav-horizontal-collapsable',
templateUrl: './collapsable.component.html',
styleUrls : ['./collapsable.component.scss'],
animations : fuseAnimations
})
export class FuseNavHorizontalCollapsableComponent implements OnInit, OnDestroy
{
fuseConfig: any;
isOpen = false;
@HostBinding('class')
classes = 'nav-collapsable nav-item';
@Input()
item: any;
// Private
private _unsubscribeAll: Subject<any>;
constructor(
private _fuseConfigService: FuseConfigService
)
{
// Set the private defaults
this._unsubscribeAll = new Subject();
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void
{
// Subscribe to config changes
this._fuseConfigService.config
.pipe(takeUntil(this._unsubscribeAll))
.subscribe(
(config) => {
this.fuseConfig = config;
}
);
}
/**
* On destroy
*/
ngOnDestroy(): void
{
// Unsubscribe from all subscriptions
this._unsubscribeAll.next();
this._unsubscribeAll.complete();
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Open
*/
@HostListener('mouseenter')
open(): void
{
this.isOpen = true;
}
/**
* Close
*/
@HostListener('mouseleave')
close(): void
{
this.isOpen = false;
}
}

View File

@@ -0,0 +1,48 @@
<ng-container *ngIf="!item.hidden">
<!-- item.url -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && !item.function"
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}"
[target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.externalUrl -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && !item.function"
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.function -->
<span class="nav-link" [ngClass]="item.classes" *ngIf="!item.url && item.function"
(click)="item.function()" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</span>
<!-- item.url && item.function -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && item.function"
(click)="item.function()"
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}"
[target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.externalUrl && item.function -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && item.function"
(click)="item.function()"
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<ng-template #itemContent>
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
{{item.badge.title}}
</span>
</ng-template>
</ng-container>

View File

@@ -0,0 +1,23 @@
import { Component, HostBinding, Input } from '@angular/core';
@Component({
selector : 'fuse-nav-horizontal-item',
templateUrl: './item.component.html',
styleUrls : ['./item.component.scss']
})
export class FuseNavHorizontalItemComponent
{
@HostBinding('class')
classes = 'nav-item';
@Input()
item: any;
/**
* Constructor
*/
constructor()
{
}
}

View File

@@ -0,0 +1,32 @@
<div class="nav" [ngClass]="{'horizontal':layout === 'horizontal', 'vertical':layout === 'vertical'}">
<!-- Vertical Navigation Layout -->
<ng-container *ngIf="layout === 'vertical'">
<ng-container *ngFor="let item of navigation">
<fuse-nav-vertical-group *ngIf="item.type=='group'" [item]="item"></fuse-nav-vertical-group>
<fuse-nav-vertical-collapsable *ngIf="item.type=='collapse'" [item]="item"></fuse-nav-vertical-collapsable>
<fuse-nav-vertical-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-vertical-item>
</ng-container>
</ng-container>
<!-- / Vertical Navigation Layout -->
<!-- Horizontal Navigation Layout -->
<ng-container *ngIf="layout === 'horizontal'">
<ng-container *ngFor="let item of navigation">
<fuse-nav-horizontal-collapsable *ngIf="item.type=='group'" [item]="item"></fuse-nav-horizontal-collapsable>
<fuse-nav-horizontal-collapsable *ngIf="item.type=='collapse'"
[item]="item"></fuse-nav-horizontal-collapsable>
<fuse-nav-horizontal-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-horizontal-item>
</ng-container>
</ng-container>
<!-- / Horizontal Navigation Layout -->
</div>

View File

@@ -0,0 +1,12 @@
@import 'src/@fuse/scss/fuse';
fuse-navigation {
display: flex;
flex: 1 0 auto;
> .nav {
margin: 0;
padding: 0;
width: 100%;
}
}

View File

@@ -0,0 +1,54 @@
import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
@Component({
selector : 'fuse-navigation',
templateUrl : './navigation.component.html',
styleUrls : ['./navigation.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class FuseNavigationComponent implements OnInit
{
@Input()
layout = 'vertical';
@Input()
navigation: any;
// Private
private _unsubscribeAll: Subject<any>;
/**
* Constructor
*/
constructor(
private _fuseNavigationService: FuseNavigationService
)
{
// Set the private defaults
this._unsubscribeAll = new Subject();
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void
{
// Load the navigation either from the input or from the service
this.navigation = this.navigation || this._fuseNavigationService.getCurrentNavigation();
// Subscribe to the current navigation changes
this._fuseNavigationService.onNavigationChanged
.pipe(takeUntil(this._unsubscribeAll))
.subscribe(() => {
this.navigation = this._fuseNavigationService.getCurrentNavigation();
});
}
}

View File

@@ -0,0 +1,39 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
import { MatIconModule, MatRippleModule } from '@angular/material';
import { TranslateModule } from '@ngx-translate/core';
import { FuseNavigationComponent } from './navigation.component';
import { FuseNavVerticalItemComponent } from './vertical/item/item.component';
import { FuseNavVerticalCollapsableComponent } from './vertical/collapsable/collapsable.component';
import { FuseNavVerticalGroupComponent } from './vertical/group/group.component';
import { FuseNavHorizontalItemComponent } from './horizontal/item/item.component';
import { FuseNavHorizontalCollapsableComponent } from './horizontal/collapsable/collapsable.component';
@NgModule({
imports : [
CommonModule,
RouterModule,
MatIconModule,
MatRippleModule,
TranslateModule.forChild()
],
exports : [
FuseNavigationComponent
],
declarations: [
FuseNavigationComponent,
FuseNavVerticalGroupComponent,
FuseNavVerticalItemComponent,
FuseNavVerticalCollapsableComponent,
FuseNavHorizontalItemComponent,
FuseNavHorizontalCollapsableComponent
]
})
export class FuseNavigationModule
{
}

View File

@@ -0,0 +1,350 @@
import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable, Subject } from 'rxjs';
import { FuseNavigationItem } from '@fuse/types';
@Injectable({
providedIn: 'root'
})
export class FuseNavigationService
{
onItemCollapsed: Subject<any>;
onItemCollapseToggled: Subject<any>;
// Private
private _onNavigationChanged: BehaviorSubject<any>;
private _onNavigationRegistered: BehaviorSubject<any>;
private _onNavigationUnregistered: BehaviorSubject<any>;
private _currentNavigationKey: string;
private _registry: { [key: string]: any } = {};
/**
* Constructor
*/
constructor()
{
// Set the defaults
this.onItemCollapsed = new Subject();
this.onItemCollapseToggled = new Subject();
// Set the private defaults
this._currentNavigationKey = null;
this._onNavigationChanged = new BehaviorSubject(null);
this._onNavigationRegistered = new BehaviorSubject(null);
this._onNavigationUnregistered = new BehaviorSubject(null);
}
// -----------------------------------------------------------------------------------------------------
// @ Accessors
// -----------------------------------------------------------------------------------------------------
/**
* Get onNavigationChanged
*
* @returns {Observable<any>}
*/
get onNavigationChanged(): Observable<any>
{
return this._onNavigationChanged.asObservable();
}
/**
* Get onNavigationRegistered
*
* @returns {Observable<any>}
*/
get onNavigationRegistered(): Observable<any>
{
return this._onNavigationRegistered.asObservable();
}
/**
* Get onNavigationUnregistered
*
* @returns {Observable<any>}
*/
get onNavigationUnregistered(): Observable<any>
{
return this._onNavigationUnregistered.asObservable();
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Register the given navigation
* with the given key
*
* @param key
* @param navigation
*/
register(key, navigation): void
{
// Check if the key already being used
if ( this._registry[key] )
{
console.error(`The navigation with the key '${key}' already exists. Either unregister it first or use a unique key.`);
return;
}
// Add to the registry
this._registry[key] = navigation;
// Notify the subject
this._onNavigationRegistered.next([key, navigation]);
}
/**
* Unregister the navigation from the registry
* @param key
*/
unregister(key): void
{
// Check if the navigation exists
if ( !this._registry[key] )
{
console.warn(`The navigation with the key '${key}' doesn't exist in the registry.`);
}
// Unregister the sidebar
delete this._registry[key];
// Notify the subject
this._onNavigationUnregistered.next(key);
}
/**
* Get navigation from registry by key
*
* @param key
* @returns {any}
*/
getNavigation(key): any
{
// Check if the navigation exists
if ( !this._registry[key] )
{
console.warn(`The navigation with the key '${key}' doesn't exist in the registry.`);
return;
}
// Return the sidebar
return this._registry[key];
}
/**
* Get flattened navigation array
*
* @param navigation
* @param flatNavigation
* @returns {any[]}
*/
getFlatNavigation(navigation, flatNavigation: FuseNavigationItem[] = []): any
{
for ( const item of navigation )
{
if ( item.type === 'item' )
{
flatNavigation.push(item);
continue;
}
if ( item.type === 'collapsable' || item.type === 'group' )
{
if ( item.children )
{
this.getFlatNavigation(item.children, flatNavigation);
}
}
}
return flatNavigation;
}
/**
* Get the current navigation
*
* @returns {any}
*/
getCurrentNavigation(): any
{
if ( !this._currentNavigationKey )
{
console.warn(`The current navigation is not set.`);
return;
}
return this.getNavigation(this._currentNavigationKey);
}
/**
* Set the navigation with the key
* as the current navigation
*
* @param key
*/
setCurrentNavigation(key): void
{
// Check if the sidebar exists
if ( !this._registry[key] )
{
console.warn(`The navigation with the key '${key}' doesn't exist in the registry.`);
return;
}
// Set the current navigation key
this._currentNavigationKey = key;
// Notify the subject
this._onNavigationChanged.next(key);
}
/**
* Get navigation item by id from the
* current navigation
*
* @param id
* @param {any} navigation
* @returns {any | boolean}
*/
getNavigationItem(id, navigation = null): any | boolean
{
if ( !navigation )
{
navigation = this.getCurrentNavigation();
}
for ( const item of navigation )
{
if ( item.id === id )
{
return item;
}
if ( item.children )
{
const childItem = this.getNavigationItem(id, item.children);
if ( childItem )
{
return childItem;
}
}
}
return false;
}
/**
* Get the parent of the navigation item
* with the id
*
* @param id
* @param {any} navigation
* @param parent
*/
getNavigationItemParent(id, navigation = null, parent = null): any
{
if ( !navigation )
{
navigation = this.getCurrentNavigation();
parent = navigation;
}
for ( const item of navigation )
{
if ( item.id === id )
{
return parent;
}
if ( item.children )
{
const childItem = this.getNavigationItemParent(id, item.children, item);
if ( childItem )
{
return childItem;
}
}
}
return false;
}
/**
* Add a navigation item to the specified location
*
* @param item
* @param id
*/
addNavigationItem(item, id): void
{
// Get the current navigation
const navigation: any[] = this.getCurrentNavigation();
// Add to the end of the navigation
if ( id === 'end' )
{
navigation.push(item);
return;
}
// Add to the start of the navigation
if ( id === 'start' )
{
navigation.unshift(item);
}
// Add it to a specific location
const parent: any = this.getNavigationItem(id);
if ( parent )
{
// Check if parent has a children entry,
// and add it if it doesn't
if ( !parent.children )
{
parent.children = [];
}
// Add the item
parent.children.push(item);
}
}
/**
* Remove navigation item with the given id
*
* @param id
*/
removeNavigationItem(id): void
{
const item = this.getNavigationItem(id);
// Return, if there is not such an item
if ( !item )
{
return;
}
// Get the parent of the item
let parent = this.getNavigationItemParent(id);
// This check is required because of the first level
// of the navigation, since the first level is not
// inside the 'children' array
parent = parent.children || parent;
// Remove the item
parent.splice(parent.indexOf(item), 1);
}
}

View File

@@ -0,0 +1,65 @@
<ng-container *ngIf="!item.hidden">
<!-- normal collapse -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="!item.url && !item.function"
(click)="toggleOpen($event)" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.url -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && !item.function"
(click)="toggleOpen($event)"
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}"
[target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.externalUrl -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && !item.function"
(click)="toggleOpen($event)"
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.function -->
<span class="nav-link" [ngClass]="item.classes" *ngIf="!item.url && item.function"
(click)="toggleOpen($event);item.function()" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</span>
<!-- item.url && item.function -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && item.function"
(click)="toggleOpen($event);item.function()"
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.externalUrl && item.function -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && item.function"
(click)="toggleOpen($event);item.function()"
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<ng-template #itemContent>
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
{{item.badge.title}}
</span>
<mat-icon class="collapsable-arrow">keyboard_arrow_right</mat-icon>
</ng-template>
<div class="children" [@slideInOut]="isOpen">
<ng-container *ngFor="let item of item.children">
<fuse-nav-vertical-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-vertical-item>
<fuse-nav-vertical-collapsable *ngIf="item.type=='collapsable'"
[item]="item"></fuse-nav-vertical-collapsable>
<fuse-nav-vertical-group *ngIf="item.type=='group'" [item]="item"></fuse-nav-vertical-group>
</ng-container>
</div>
</ng-container>

View File

@@ -1,6 +1,7 @@
:host {
.folded:not(.folded-open) & {
.folded:not(.unfolded) & {
.nav-link {
> span {
@@ -8,10 +9,18 @@
transition: opacity 200ms ease;
}
}
&.open {
.children {
display: none !important;
}
}
}
.nav-link {
.collapse-arrow {
.collapsable-arrow {
transition: transform .3s ease-in-out, opacity .25s ease-in-out .1s;
transform: rotate(0);
}
@@ -25,13 +34,9 @@
> .nav-link {
.collapse-arrow {
.collapsable-arrow {
transform: rotate(90deg);
}
}
> .children {
}
}
}

View File

@@ -0,0 +1,237 @@
import { Component, HostBinding, Input, OnDestroy, OnInit } from '@angular/core';
import { NavigationEnd, Router } from '@angular/router';
import { Subject } from 'rxjs';
import { filter, takeUntil } from 'rxjs/operators';
import { FuseNavigationItem } from '@fuse/types';
import { fuseAnimations } from '@fuse/animations';
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
@Component({
selector : 'fuse-nav-vertical-collapsable',
templateUrl: './collapsable.component.html',
styleUrls : ['./collapsable.component.scss'],
animations : fuseAnimations
})
export class FuseNavVerticalCollapsableComponent implements OnInit, OnDestroy
{
@Input()
item: FuseNavigationItem;
@HostBinding('class')
classes = 'nav-collapsable nav-item';
@HostBinding('class.open')
public isOpen = false;
// Private
private _unsubscribeAll: Subject<any>;
/**
* Constructor
*
* @param {FuseNavigationService} _fuseNavigationService
* @param {Router} _router
*/
constructor(
private _fuseNavigationService: FuseNavigationService,
private _router: Router
)
{
// Set the private defaults
this._unsubscribeAll = new Subject();
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void
{
// Listen for router events
this._router.events
.pipe(
filter(event => event instanceof NavigationEnd),
takeUntil(this._unsubscribeAll)
)
.subscribe((event: NavigationEnd) => {
// Check if the url can be found in
// one of the children of this item
if ( this.isUrlInChildren(this.item, event.urlAfterRedirects) )
{
this.expand();
}
else
{
this.collapse();
}
});
// Listen for collapsing of any navigation item
this._fuseNavigationService.onItemCollapsed
.pipe(takeUntil(this._unsubscribeAll))
.subscribe(
(clickedItem) => {
if ( clickedItem && clickedItem.children )
{
// Check if the clicked item is one
// of the children of this item
if ( this.isChildrenOf(this.item, clickedItem) )
{
return;
}
// Check if the url can be found in
// one of the children of this item
if ( this.isUrlInChildren(this.item, this._router.url) )
{
return;
}
// If the clicked item is not this item, collapse...
if ( this.item !== clickedItem )
{
this.collapse();
}
}
}
);
// Check if the url can be found in
// one of the children of this item
if ( this.isUrlInChildren(this.item, this._router.url) )
{
this.expand();
}
else
{
this.collapse();
}
}
/**
* On destroy
*/
ngOnDestroy(): void
{
// Unsubscribe from all subscriptions
this._unsubscribeAll.next();
this._unsubscribeAll.complete();
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Toggle collapse
*
* @param ev
*/
toggleOpen(ev): void
{
ev.preventDefault();
this.isOpen = !this.isOpen;
// Navigation collapse toggled...
this._fuseNavigationService.onItemCollapsed.next(this.item);
this._fuseNavigationService.onItemCollapseToggled.next();
}
/**
* Expand the collapsable navigation
*/
expand(): void
{
if ( this.isOpen )
{
return;
}
this.isOpen = true;
this._fuseNavigationService.onItemCollapseToggled.next();
}
/**
* Collapse the collapsable navigation
*/
collapse(): void
{
if ( !this.isOpen )
{
return;
}
this.isOpen = false;
this._fuseNavigationService.onItemCollapseToggled.next();
}
/**
* Check if the given parent has the
* given item in one of its children
*
* @param parent
* @param item
* @returns {boolean}
*/
isChildrenOf(parent, item): boolean
{
if ( !parent.children )
{
return false;
}
if ( parent.children.indexOf(item) !== -1 )
{
return true;
}
for ( const children of parent.children )
{
if ( children.children )
{
return this.isChildrenOf(children, item);
}
}
}
/**
* Check if the given url can be found
* in one of the given parent's children
*
* @param parent
* @param url
* @returns {boolean}
*/
isUrlInChildren(parent, url): boolean
{
if ( !parent.children )
{
return false;
}
for ( let i = 0; i < parent.children.length; i++ )
{
if ( parent.children[i].children )
{
if ( this.isUrlInChildren(parent.children[i], url) )
{
return true;
}
}
if ( parent.children[i].url === url || url.includes(parent.children[i].url) )
{
return true;
}
}
return false;
}
}

View File

@@ -0,0 +1,16 @@
<ng-container *ngIf="!item.hidden">
<div class="group-title" [ngClass]="item.classes">
<span class="hint-text" [translate]="item.translate">{{ item.title }}</span>
</div>
<div class="group-items">
<ng-container *ngFor="let item of item.children">
<fuse-nav-vertical-group *ngIf="item.type=='group'" [item]="item"></fuse-nav-vertical-group>
<fuse-nav-vertical-collapsable *ngIf="item.type=='collapsable'"
[item]="item"></fuse-nav-vertical-collapsable>
<fuse-nav-vertical-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-vertical-item>
</ng-container>
</div>
</ng-container>

View File

@@ -1,6 +1,6 @@
:host {
.folded:not(.folded-open) & {
.folded:not(.unfolded) & {
> .group-title {
align-items: center;

View File

@@ -0,0 +1,25 @@
import { Component, HostBinding, Input } from '@angular/core';
import { FuseNavigationItem } from '@fuse/types';
@Component({
selector : 'fuse-nav-vertical-group',
templateUrl: './group.component.html',
styleUrls : ['./group.component.scss']
})
export class FuseNavVerticalGroupComponent
{
@HostBinding('class')
classes = 'nav-group nav-item';
@Input()
item: FuseNavigationItem;
/**
* Constructor
*/
constructor()
{
}
}

View File

@@ -0,0 +1,48 @@
<ng-container *ngIf="!item.hidden">
<!-- item.url -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && !item.function"
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}"
[target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.externalUrl -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && !item.function"
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.function -->
<span class="nav-link" [ngClass]="item.classes" *ngIf="!item.url && item.function"
(click)="item.function()" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</span>
<!-- item.url && item.function -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && item.function"
(click)="item.function()"
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}"
[target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.externalUrl && item.function -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && item.function"
(click)="item.function()"
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<ng-template #itemContent>
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
{{item.badge.title}}
</span>
</ng-template>
</ng-container>

View File

@@ -1,6 +1,6 @@
:host {
.folded:not(.folded-open) & {
.folded:not(.unfolded) & {
.nav-link {

View File

@@ -0,0 +1,24 @@
import { Component, HostBinding, Input } from '@angular/core';
import { FuseNavigationItem } from '@fuse/types';
@Component({
selector : 'fuse-nav-vertical-item',
templateUrl: './item.component.html',
styleUrls : ['./item.component.scss']
})
export class FuseNavVerticalItemComponent
{
@HostBinding('class')
classes = 'nav-item';
@Input()
item: FuseNavigationItem;
/**
* Constructor
*/
constructor()
{
}
}

View File

@@ -0,0 +1,5 @@
<ng-container *ngIf="visible">
<mat-progress-bar color="accent" [bufferValue]="bufferValue" [mode]="mode" [value]="value"></mat-progress-bar>
</ng-container>

View File

@@ -0,0 +1,17 @@
@import "src/@fuse/scss/fuse";
fuse-progress-bar {
position: absolute;
top: 0;
left: 0;
right: 0;
width: 100%;
z-index: 99998;
mat-progress-bar {
.mat-progress-bar-buffer {
background-color: #C5C6CB !important;
}
}
}

View File

@@ -0,0 +1,93 @@
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { FuseProgressBarService } from '@fuse/components/progress-bar/progress-bar.service';
@Component({
selector : 'fuse-progress-bar',
templateUrl : './progress-bar.component.html',
styleUrls : ['./progress-bar.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class FuseProgressBarComponent implements OnInit, OnDestroy
{
bufferValue: number;
mode: 'determinate' | 'indeterminate' | 'buffer' | 'query';
value: number;
visible: boolean;
// Private
private _unsubscribeAll: Subject<any>;
/**
* Constructor
*
* @param {FuseProgressBarService} _fuseProgressBarService
*/
constructor(
private _fuseProgressBarService: FuseProgressBarService
)
{
// Set the defaults
// Set the private defaults
this._unsubscribeAll = new Subject();
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void
{
// Subscribe to the progress bar service properties
// Buffer value
this._fuseProgressBarService.bufferValue
.pipe(takeUntil(this._unsubscribeAll))
.subscribe((bufferValue) => {
this.bufferValue = bufferValue;
});
// Mode
this._fuseProgressBarService.mode
.pipe(takeUntil(this._unsubscribeAll))
.subscribe((mode) => {
this.mode = mode;
});
// Value
this._fuseProgressBarService.value
.pipe(takeUntil(this._unsubscribeAll))
.subscribe((value) => {
this.value = value;
});
// Visible
this._fuseProgressBarService.visible
.pipe(takeUntil(this._unsubscribeAll))
.subscribe((visible) => {
this.visible = visible;
});
}
/**
* On destroy
*/
ngOnDestroy(): void
{
// Unsubscribe from all subscriptions
this._unsubscribeAll.next();
this._unsubscribeAll.complete();
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
}

View File

@@ -0,0 +1,27 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
import { MatButtonModule, MatIconModule, MatProgressBarModule } from '@angular/material';
import { FuseProgressBarComponent } from './progress-bar.component';
@NgModule({
declarations: [
FuseProgressBarComponent
],
imports : [
CommonModule,
RouterModule,
MatButtonModule,
MatIconModule,
MatProgressBarModule
],
exports : [
FuseProgressBarComponent
]
})
export class FuseProgressBarModule
{
}

View File

@@ -0,0 +1,132 @@
import { Injectable } from '@angular/core';
import { NavigationEnd, NavigationStart, Router } from '@angular/router';
import { BehaviorSubject, Observable } from 'rxjs';
import { filter } from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class FuseProgressBarService
{
// Private
private _bufferValue: BehaviorSubject<number>;
private _mode: BehaviorSubject<string>;
private _value: BehaviorSubject<number>;
private _visible: BehaviorSubject<boolean>;
/**
* Constructor
*
* @param {Router} _router
*/
constructor(
private _router: Router
)
{
// Initialize the service
this._init();
}
// -----------------------------------------------------------------------------------------------------
// @ Accessors
// -----------------------------------------------------------------------------------------------------
/**
* Buffer value
*/
get bufferValue(): Observable<any>
{
return this._bufferValue.asObservable();
}
setBufferValue(value: number): void
{
this._bufferValue.next(value);
}
/**
* Mode
*/
get mode(): Observable<any>
{
return this._mode.asObservable();
}
setMode(value: 'determinate' | 'indeterminate' | 'buffer' | 'query'): void
{
this._mode.next(value);
}
/**
* Value
*/
get value(): Observable<any>
{
return this._value.asObservable();
}
setValue(value: number): void
{
this._value.next(value);
}
/**
* Visible
*/
get visible(): Observable<any>
{
return this._visible.asObservable();
}
// -----------------------------------------------------------------------------------------------------
// @ Private methods
// -----------------------------------------------------------------------------------------------------
/**
* Initialize
*
* @private
*/
private _init(): void
{
// Initialize the behavior subjects
this._bufferValue = new BehaviorSubject(0);
this._mode = new BehaviorSubject('indeterminate');
this._value = new BehaviorSubject(0);
this._visible = new BehaviorSubject(false);
// Subscribe to the router events to show/hide the loading bar
this._router.events
.pipe(filter((event) => event instanceof NavigationStart))
.subscribe(() => {
this.show();
});
this._router.events
.pipe(filter((event) => event instanceof NavigationEnd))
.subscribe(() => {
this.hide();
});
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Show the progress bar
*/
show(): void
{
this._visible.next(true);
}
/**
* Hide the progress bar
*/
hide(): void
{
this._visible.next(false);
}
}

View File

@@ -0,0 +1,25 @@
<div class="fuse-search-bar" [ngClass]="{'expanded':!collapsed}">
<div class="fuse-search-bar-content" [ngClass]="fuseConfig.layout.toolbar.background">
<label for="fuse-search-bar-input">
<button mat-icon-button class="fuse-search-bar-expander" aria-label="Expand Search Bar" (click)="expand()"
*ngIf="collapsed">
<mat-icon class="s-24 secondary-text">search</mat-icon>
</button>
<!--<span class="fuse-search-bar-loader" fxLayout="row" fxLayoutAlign="center center" *ngIf="!collapsed">
<mat-progress-spinner color="mat-accent" mode="indeterminate"></mat-progress-spinner>
</span>-->
</label>
<input id="fuse-search-bar-input" class="ml-24" type="text" placeholder="Search" (input)="search($event)"
fxFlex>
<button mat-icon-button class="fuse-search-bar-collapser" (click)="collapse()"
aria-label="Collapse Search Bar">
<mat-icon class="s-24 secondary-text">close</mat-icon>
</button>
</div>
</div>

View File

@@ -0,0 +1,91 @@
@import "src/@fuse/scss/fuse";
:host {
.fuse-search-bar {
display: flex;
flex: 0 1 auto;
min-width: 64px;
height: 64px;
font-size: 13px;
@include media-breakpoint-down('xs') {
height: 56px;
}
.fuse-search-bar-content {
display: flex;
flex: 1 1 auto;
align-items: center;
justify-content: flex-start;
.fuse-search-bar-expander,
.fuse-search-bar-collapser {
cursor: pointer;
padding: 0 20px;
margin: 0;
width: 64px !important;
height: 64px !important;
line-height: 64px !important;
@include media-breakpoint-down('xs') {
height: 56px !important;
line-height: 56px !important;
}
}
.fuse-search-bar-loader {
width: 64px !important;
height: 64px !important;
line-height: 64px !important;
@include media-breakpoint-down('xs') {
height: 56px !important;
line-height: 56px !important;
}
}
.fuse-search-bar-collapser {
display: none;
}
#fuse-search-bar-input {
display: none;
flex: 1 0 auto;
min-height: 64px;
background-color: transparent;
font-size: 16px;
}
}
&.expanded {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 10;
.fuse-search-bar-content {
#fuse-search-bar-input {
display: flex;
}
.fuse-search-bar-collapser {
display: flex;
}
}
}
}
body {
&.fuse-search-bar-expanded {
#toolbar {
z-index: 999 !important;
}
}
}
}

View File

@@ -0,0 +1,99 @@
import { Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { FuseConfigService } from '@fuse/services/config.service';
@Component({
selector : 'fuse-search-bar',
templateUrl: './search-bar.component.html',
styleUrls : ['./search-bar.component.scss']
})
export class FuseSearchBarComponent implements OnInit, OnDestroy
{
collapsed: boolean;
fuseConfig: any;
@Output()
input: EventEmitter<any>;
// Private
private _unsubscribeAll: Subject<any>;
/**
* Constructor
*
* @param {FuseConfigService} _fuseConfigService
*/
constructor(
private _fuseConfigService: FuseConfigService
)
{
// Set the defaults
this.input = new EventEmitter();
this.collapsed = true;
// Set the private defaults
this._unsubscribeAll = new Subject();
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void
{
// Subscribe to config changes
this._fuseConfigService.config
.pipe(takeUntil(this._unsubscribeAll))
.subscribe(
(config) => {
this.fuseConfig = config;
}
);
}
/**
* On destroy
*/
ngOnDestroy(): void
{
// Unsubscribe from all subscriptions
this._unsubscribeAll.next();
this._unsubscribeAll.complete();
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Collapse
*/
collapse(): void
{
this.collapsed = true;
}
/**
* Expand
*/
expand(): void
{
this.collapsed = false;
}
/**
* Search
*
* @param event
*/
search(event): void
{
this.input.emit(event.target.value);
}
}

View File

@@ -1,7 +1,9 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
import { SharedModule } from '../../modules/shared.module';
import { MatButtonModule, MatIconModule } from '@angular/material';
import { FuseSearchBarComponent } from './search-bar.component';
@NgModule({
@@ -9,8 +11,11 @@ import { FuseSearchBarComponent } from './search-bar.component';
FuseSearchBarComponent
],
imports : [
SharedModule,
RouterModule
CommonModule,
RouterModule,
MatButtonModule,
MatIconModule
],
exports : [
FuseSearchBarComponent

View File

@@ -0,0 +1,113 @@
<div id="fuse-shortcuts" #shortcuts>
<div class="shortcuts-mobile-toggle" *ngIf="!mobileShortcutsPanelActive" fxLayout="row" fxLayoutAlign="start center"
fxHide fxShow.lt-md>
<button mat-icon-button (click)="showMobileShortcutsPanel()">
<mat-icon class="amber-600-fg">star</mat-icon>
</button>
</div>
<div class="shortcuts" fxHide fxShow.gt-sm>
<div fxLayout="row" fxLayoutAlign="space-between center" fxFlex="0 1 auto">
<div fxLayout="row" fxLayoutAlign="start center">
<div class="w-40 h-40 p-4" fxLayout="row" fxLayoutAlign="center center"
*ngFor="let shortcutItem of shortcutItems">
<a mat-icon-button matTooltip="{{shortcutItem.title}}" [routerLink]="shortcutItem.url">
<mat-icon class="secondary-text" *ngIf="shortcutItem.icon">{{shortcutItem.icon}}</mat-icon>
<span *ngIf="!shortcutItem.icon" class="h2 secondary-text text-bold">
{{shortcutItem.title.substr(0, 1).toUpperCase()}}
</span>
</a>
</div>
<button mat-icon-button [matMenuTriggerFor]="addMenu" matTooltip="Click to add/remove shortcut"
(menuOpened)="onMenuOpen()">
<mat-icon class="amber-600-fg">star</mat-icon>
</button>
</div>
<div class="shortcuts-mobile-close" fxLayout="row" fxLayoutAlign="start center" fxHide fxShow.lt-md>
<button mat-icon-button (click)="hideMobileShortcutsPanel()">
<mat-icon>close</mat-icon>
</button>
</div>
</div>
<mat-menu #addMenu="matMenu" class="w-240">
<mat-form-field class="px-16 w-100-p" (click)="$event.stopPropagation()" floatLabel="never">
<input #searchInput matInput placeholder="Search for an app or a page" (input)="search($event)">
</mat-form-field>
<mat-divider></mat-divider>
<mat-nav-list *ngIf="!searching" style="max-height: 312px; overflow: auto" fusePerfectScrollbar>
<mat-list-item *ngFor="let shortcutItem of shortcutItems"
(click)="toggleShortcut($event, shortcutItem)">
<div class="w-100-p" fxLayout="row" fxLayoutAlign="start center">
<mat-icon mat-list-icon class="mr-8 secondary-text" *ngIf="shortcutItem.icon">
{{shortcutItem.icon}}
</mat-icon>
<span class="h2 w-32 h-32 p-4 mr-8 secondary-text text-bold" fxLayout="row"
fxLayoutAlign="center center" *ngIf="!shortcutItem.icon">
{{shortcutItem.title.substr(0, 1).toUpperCase()}}
</span>
<p matLine fxFlex>{{shortcutItem.title}}</p>
<mat-icon class="ml-8 amber-fg">star</mat-icon>
</div>
</mat-list-item>
<mat-list-item *ngIf="shortcutItems.length === 0">
<p>
<small>No shortcuts yet!</small>
</p>
</mat-list-item>
</mat-nav-list>
<mat-nav-list *ngIf="searching" style="max-height: 312px; overflow: auto" fusePerfectScrollbar>
<mat-list-item *ngFor="let navigationItem of filteredNavigationItems"
(click)="toggleShortcut($event, navigationItem)">
<div class="w-100-p" fxLayout="row" fxLayoutAlign="start center">
<mat-icon mat-list-icon class="mr-8 secondary-text" *ngIf="navigationItem.icon">
{{navigationItem.icon}}
</mat-icon>
<span class="h2 w-32 h-32 p-4 mr-8 secondary-text text-bold" fxLayout="row"
fxLayoutAlign="center center" *ngIf="!navigationItem.icon">
{{navigationItem.title.substr(0, 1).toUpperCase()}}
</span>
<p matLine fxFlex>{{navigationItem.title}}</p>
<mat-icon class="ml-8 amber-fg" *ngIf="isInShortcuts(navigationItem)">star</mat-icon>
</div>
</mat-list-item>
</mat-nav-list>
</mat-menu>
</div>
</div>

View File

@@ -1,4 +1,4 @@
@import 'src/app/core/scss/fuse';
@import 'src/@fuse/scss/fuse';
:host {

View File

@@ -0,0 +1,227 @@
import { Component, ElementRef, Input, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core';
import { ObservableMedia } from '@angular/flex-layout';
import { CookieService } from 'ngx-cookie-service';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { FuseMatchMediaService } from '@fuse/services/match-media.service';
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
@Component({
selector : 'fuse-shortcuts',
templateUrl: './shortcuts.component.html',
styleUrls : ['./shortcuts.component.scss']
})
export class FuseShortcutsComponent implements OnInit, OnDestroy
{
shortcutItems: any[];
navigationItems: any[];
filteredNavigationItems: any[];
searching: boolean;
mobileShortcutsPanelActive: boolean;
@Input()
navigation: any;
@ViewChild('searchInput')
searchInputField;
@ViewChild('shortcuts')
shortcutsEl: ElementRef;
// Private
private _unsubscribeAll: Subject<any>;
/**
* Constructor
*
* @param {Renderer2} _renderer
* @param {CookieService} _cookieService
* @param {FuseMatchMediaService} _fuseMatchMediaService
* @param {FuseNavigationService} _fuseNavigationService
* @param {ObservableMedia} _observableMedia
*/
constructor(
private _cookieService: CookieService,
private _fuseMatchMediaService: FuseMatchMediaService,
private _fuseNavigationService: FuseNavigationService,
private _observableMedia: ObservableMedia,
private _renderer: Renderer2
)
{
// Set the defaults
this.shortcutItems = [];
this.searching = false;
this.mobileShortcutsPanelActive = false;
// Set the private defaults
this._unsubscribeAll = new Subject();
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void
{
// Get the navigation items and flatten them
this.filteredNavigationItems = this.navigationItems = this._fuseNavigationService.getFlatNavigation(this.navigation);
const cookieExists = this._cookieService.check('FUSE2.shortcuts');
if ( cookieExists )
{
this.shortcutItems = JSON.parse(this._cookieService.get('FUSE2.shortcuts'));
}
else
{
// User's shortcut items
this.shortcutItems = [
{
'title': 'Calendar',
'type' : 'item',
'icon' : 'today',
'url' : '/apps/calendar'
},
{
'title': 'Mail',
'type' : 'item',
'icon' : 'email',
'url' : '/apps/mail'
},
{
'title': 'Contacts',
'type' : 'item',
'icon' : 'account_box',
'url' : '/apps/contacts'
},
{
'title': 'To-Do',
'type' : 'item',
'icon' : 'check_box',
'url' : '/apps/todo'
}
];
}
this._fuseMatchMediaService.onMediaChange
.pipe(takeUntil(this._unsubscribeAll))
.subscribe(() => {
if ( this._observableMedia.isActive('gt-sm') )
{
this.hideMobileShortcutsPanel();
}
});
}
/**
* On destroy
*/
ngOnDestroy(): void
{
// Unsubscribe from all subscriptions
this._unsubscribeAll.next();
this._unsubscribeAll.complete();
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Search
*
* @param event
*/
search(event): void
{
const value = event.target.value.toLowerCase();
if ( value === '' )
{
this.searching = false;
this.filteredNavigationItems = this.navigationItems;
return;
}
this.searching = true;
this.filteredNavigationItems = this.navigationItems.filter((navigationItem) => {
return navigationItem.title.toLowerCase().includes(value);
});
}
/**
* Toggle shortcut
*
* @param event
* @param itemToToggle
*/
toggleShortcut(event, itemToToggle): void
{
event.stopPropagation();
for ( let i = 0; i < this.shortcutItems.length; i++ )
{
if ( this.shortcutItems[i].url === itemToToggle.url )
{
this.shortcutItems.splice(i, 1);
// Save to the cookies
this._cookieService.set('FUSE2.shortcuts', JSON.stringify(this.shortcutItems));
return;
}
}
this.shortcutItems.push(itemToToggle);
// Save to the cookies
this._cookieService.set('FUSE2.shortcuts', JSON.stringify(this.shortcutItems));
}
/**
* Is in shortcuts?
*
* @param navigationItem
* @returns {any}
*/
isInShortcuts(navigationItem): any
{
return this.shortcutItems.find(item => {
return item.url === navigationItem.url;
});
}
/**
* On menu open
*/
onMenuOpen(): void
{
setTimeout(() => {
this.searchInputField.nativeElement.focus();
});
}
/**
* Show mobile shortcuts
*/
showMobileShortcutsPanel(): void
{
this.mobileShortcutsPanelActive = true;
this._renderer.addClass(this.shortcutsEl.nativeElement, 'show-mobile-panel');
}
/**
* Hide mobile shortcuts
*/
hideMobileShortcutsPanel(): void
{
this.mobileShortcutsPanelActive = false;
this._renderer.removeClass(this.shortcutsEl.nativeElement, 'show-mobile-panel');
}
}

View File

@@ -0,0 +1,38 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
import { FlexLayoutModule } from '@angular/flex-layout';
import { MatButtonModule, MatDividerModule, MatFormFieldModule, MatIconModule, MatInputModule, MatListModule, MatMenuModule, MatTooltipModule } from '@angular/material';
import { CookieService } from 'ngx-cookie-service';
import { FuseShortcutsComponent } from './shortcuts.component';
@NgModule({
declarations: [
FuseShortcutsComponent
],
imports : [
CommonModule,
RouterModule,
FlexLayoutModule,
MatButtonModule,
MatDividerModule,
MatFormFieldModule,
MatIconModule,
MatInputModule,
MatMenuModule,
MatListModule,
MatTooltipModule
],
exports : [
FuseShortcutsComponent
],
providers : [
CookieService
]
})
export class FuseShortcutsModule
{
}

View File

@@ -0,0 +1 @@
<ng-content></ng-content>

View File

@@ -0,0 +1,71 @@
@import "src/@fuse/scss/fuse";
fuse-sidebar {
display: flex;
flex-direction: column;
flex: 1 0 auto;
position: absolute;
top: 0;
bottom: 0;
overflow-x: hidden;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
width: 280px;
min-width: 280px;
max-width: 280px;
z-index: 1000;
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.35);
background: white;
@include media-breakpoint-down('xs') {
min-width: 0 !important;
max-width: 80vw !important;
width: 80vw !important;
}
&.left-positioned {
left: 0;
transform: translateX(-100%);
}
&.right-positioned {
right: 0;
transform: translateX(100%);
}
&.open {
transform: translateX(0);
}
&.locked-open {
position: relative !important;
transform: translateX(0) !important;
}
&.folded {
position: absolute !important;
top: 0;
bottom: 0;
}
&.animations-enabled {
transition-property: transform, width, min-width, max-width;
transition-duration: 150ms;
transition-timing-function: ease-in-out;
}
}
.fuse-sidebar-overlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 999;
background-color: rgba(0, 0, 0, 0.6);
opacity: 0;
&.fuse-sidebar-overlay-invisible {
background-color: transparent;
}
}

View File

@@ -0,0 +1,799 @@
import { ChangeDetectorRef, Component, ElementRef, EventEmitter, HostBinding, HostListener, Input, OnDestroy, OnInit, Output, Renderer2, RendererStyleFlags2, ViewEncapsulation } from '@angular/core';
import { animate, AnimationBuilder, AnimationPlayer, style } from '@angular/animations';
import { ObservableMedia } from '@angular/flex-layout';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { FuseSidebarService } from './sidebar.service';
import { FuseMatchMediaService } from '@fuse/services/match-media.service';
import { FuseConfigService } from '@fuse/services/config.service';
@Component({
selector : 'fuse-sidebar',
templateUrl : './sidebar.component.html',
styleUrls : ['./sidebar.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class FuseSidebarComponent implements OnInit, OnDestroy
{
// Name
@Input()
name: string;
// Key
@Input()
key: string;
// Position
@Input()
position: 'left' | 'right';
// Open
@HostBinding('class.open')
opened: boolean;
// Locked Open
@Input()
lockedOpen: string;
// isLockedOpen
@HostBinding('class.locked-open')
isLockedOpen: boolean;
// Folded width
@Input()
foldedWidth: number;
// Folded auto trigger on hover
@Input()
foldedAutoTriggerOnHover: boolean;
// Folded unfolded
@HostBinding('class.unfolded')
unfolded: boolean;
// Invisible overlay
@Input()
invisibleOverlay: boolean;
// Folded changed
@Output()
foldedChanged: EventEmitter<boolean>;
// Opened changed
@Output()
openedChanged: EventEmitter<boolean>;
// Private
private _folded: boolean;
private _fuseConfig: any;
private _wasActive: boolean;
private _wasFolded: boolean;
private _backdrop: HTMLElement | null = null;
private _player: AnimationPlayer;
private _unsubscribeAll: Subject<any>;
@HostBinding('class.animations-enabled')
private _animationsEnabled: boolean;
/**
* Constructor
*
* @param {AnimationBuilder} _animationBuilder
* @param {ChangeDetectorRef} _changeDetectorRef
* @param {ElementRef} _elementRef
* @param {FuseConfigService} _fuseConfigService
* @param {FuseMatchMediaService} _fuseMatchMediaService
* @param {FuseSidebarService} _fuseSidebarService
* @param {ObservableMedia} _observableMedia
* @param {Renderer2} _renderer
*/
constructor(
private _animationBuilder: AnimationBuilder,
private _changeDetectorRef: ChangeDetectorRef,
private _elementRef: ElementRef,
private _fuseConfigService: FuseConfigService,
private _fuseMatchMediaService: FuseMatchMediaService,
private _fuseSidebarService: FuseSidebarService,
private _observableMedia: ObservableMedia,
private _renderer: Renderer2
)
{
// Set the defaults
this.foldedAutoTriggerOnHover = true;
this.foldedWidth = 64;
this.foldedChanged = new EventEmitter();
this.openedChanged = new EventEmitter();
this.opened = false;
this.position = 'left';
this.invisibleOverlay = false;
// Set the private defaults
this._animationsEnabled = false;
this._folded = false;
this._unsubscribeAll = new Subject();
}
// -----------------------------------------------------------------------------------------------------
// @ Accessors
// -----------------------------------------------------------------------------------------------------
/**
* Folded
*
* @param {boolean} value
*/
@Input()
set folded(value: boolean)
{
// Set the folded
this._folded = value;
// Return if the sidebar is closed
if ( !this.opened )
{
return;
}
// Programmatically add/remove padding to the element
// that comes after or before based on the position
let sibling,
styleRule;
const styleValue = this.foldedWidth + 'px';
// Get the sibling and set the style rule
if ( this.position === 'left' )
{
sibling = this._elementRef.nativeElement.nextElementSibling;
styleRule = 'padding-left';
}
else
{
sibling = this._elementRef.nativeElement.previousElementSibling;
styleRule = 'padding-right';
}
// If there is no sibling, return...
if ( !sibling )
{
return;
}
// If folded...
if ( value )
{
// Fold the sidebar
this.fold();
// Set the folded width
this._renderer.setStyle(this._elementRef.nativeElement, 'width', styleValue);
this._renderer.setStyle(this._elementRef.nativeElement, 'min-width', styleValue);
this._renderer.setStyle(this._elementRef.nativeElement, 'max-width', styleValue);
// Set the style and class
this._renderer.setStyle(sibling, styleRule, styleValue, RendererStyleFlags2.Important + RendererStyleFlags2.DashCase);
this._renderer.addClass(this._elementRef.nativeElement, 'folded');
}
// If unfolded...
else
{
// Unfold the sidebar
this.unfold();
// Remove the folded width
this._renderer.removeStyle(this._elementRef.nativeElement, 'width');
this._renderer.removeStyle(this._elementRef.nativeElement, 'min-width');
this._renderer.removeStyle(this._elementRef.nativeElement, 'max-width');
// Remove the style and class
this._renderer.removeStyle(sibling, styleRule);
this._renderer.removeClass(this._elementRef.nativeElement, 'folded');
}
// Emit the 'foldedChanged' event
this.foldedChanged.emit(this.folded);
}
get folded(): boolean
{
return this._folded;
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void
{
// Subscribe to config changes
this._fuseConfigService.config
.pipe(takeUntil(this._unsubscribeAll))
.subscribe((config) => {
this._fuseConfig = config;
});
// Register the sidebar
this._fuseSidebarService.register(this.name, this);
// Setup visibility
this._setupVisibility();
// Setup position
this._setupPosition();
// Setup lockedOpen
this._setupLockedOpen();
// Setup folded
this._setupFolded();
}
/**
* On destroy
*/
ngOnDestroy(): void
{
// If the sidebar is folded, unfold it to revert modifications
if ( this.folded )
{
this.unfold();
}
// Unregister the sidebar
this._fuseSidebarService.unregister(this.name);
// Unsubscribe from all subscriptions
this._unsubscribeAll.next();
this._unsubscribeAll.complete();
}
// -----------------------------------------------------------------------------------------------------
// @ Private methods
// -----------------------------------------------------------------------------------------------------
/**
* Setup the visibility of the sidebar
*
* @private
*/
private _setupVisibility(): void
{
// Remove the existing box-shadow
this._renderer.setStyle(this._elementRef.nativeElement, 'box-shadow', 'none');
// Make the sidebar invisible
this._renderer.setStyle(this._elementRef.nativeElement, 'visibility', 'hidden');
}
/**
* Setup the sidebar position
*
* @private
*/
private _setupPosition(): void
{
// Add the correct class name to the sidebar
// element depending on the position attribute
if ( this.position === 'right' )
{
this._renderer.addClass(this._elementRef.nativeElement, 'right-positioned');
}
else
{
this._renderer.addClass(this._elementRef.nativeElement, 'left-positioned');
}
}
/**
* Setup the lockedOpen handler
*
* @private
*/
private _setupLockedOpen(): void
{
// Return if the lockedOpen wasn't set
if ( !this.lockedOpen )
{
// Return
return;
}
// Set the wasActive for the first time
this._wasActive = false;
// Set the wasFolded
this._wasFolded = this.folded;
// Show the sidebar
this._showSidebar();
// Act on every media change
this._fuseMatchMediaService.onMediaChange
.pipe(takeUntil(this._unsubscribeAll))
.subscribe(() => {
// Get the active status
const isActive = this._observableMedia.isActive(this.lockedOpen);
// If the both status are the same, don't act
if ( this._wasActive === isActive )
{
return;
}
// Activate the lockedOpen
if ( isActive )
{
// Set the lockedOpen status
this.isLockedOpen = true;
// Show the sidebar
this._showSidebar();
// Force the the opened status to true
this.opened = true;
// Emit the 'openedChanged' event
this.openedChanged.emit(this.opened);
// If the sidebar was folded, forcefully fold it again
if ( this._wasFolded )
{
// Enable the animations
this._enableAnimations();
// Fold
this.folded = true;
// Mark for check
this._changeDetectorRef.markForCheck();
}
// Hide the backdrop if any exists
this._hideBackdrop();
}
// De-Activate the lockedOpen
else
{
// Set the lockedOpen status
this.isLockedOpen = false;
// Unfold the sidebar in case if it was folded
this.unfold();
// Force the the opened status to close
this.opened = false;
// Emit the 'openedChanged' event
this.openedChanged.emit(this.opened);
// Hide the sidebar
this._hideSidebar();
}
// Store the new active status
this._wasActive = isActive;
});
}
/**
* Setup the initial folded status
*
* @private
*/
private _setupFolded(): void
{
// Return, if sidebar is not folded
if ( !this.folded )
{
return;
}
// Return if the sidebar is closed
if ( !this.opened )
{
return;
}
// Programmatically add/remove padding to the element
// that comes after or before based on the position
let sibling,
styleRule;
const styleValue = this.foldedWidth + 'px';
// Get the sibling and set the style rule
if ( this.position === 'left' )
{
sibling = this._elementRef.nativeElement.nextElementSibling;
styleRule = 'padding-left';
}
else
{
sibling = this._elementRef.nativeElement.previousElementSibling;
styleRule = 'padding-right';
}
// If there is no sibling, return...
if ( !sibling )
{
return;
}
// Fold the sidebar
this.fold();
// Set the folded width
this._renderer.setStyle(this._elementRef.nativeElement, 'width', styleValue);
this._renderer.setStyle(this._elementRef.nativeElement, 'min-width', styleValue);
this._renderer.setStyle(this._elementRef.nativeElement, 'max-width', styleValue);
// Set the style and class
this._renderer.setStyle(sibling, styleRule, styleValue, RendererStyleFlags2.Important + RendererStyleFlags2.DashCase);
this._renderer.addClass(this._elementRef.nativeElement, 'folded');
}
/**
* Show the backdrop
*
* @private
*/
private _showBackdrop(): void
{
// Create the backdrop element
this._backdrop = this._renderer.createElement('div');
// Add a class to the backdrop element
this._backdrop.classList.add('fuse-sidebar-overlay');
// Add a class depending on the invisibleOverlay option
if ( this.invisibleOverlay )
{
this._backdrop.classList.add('fuse-sidebar-overlay-invisible');
}
// Append the backdrop to the parent of the sidebar
this._renderer.appendChild(this._elementRef.nativeElement.parentElement, this._backdrop);
// Create the enter animation and attach it to the player
this._player =
this._animationBuilder
.build([
animate('300ms ease', style({opacity: 1}))
]).create(this._backdrop);
// Play the animation
this._player.play();
// Add an event listener to the overlay
this._backdrop.addEventListener('click', () => {
this.close();
}
);
// Mark for check
this._changeDetectorRef.markForCheck();
}
/**
* Hide the backdrop
*
* @private
*/
private _hideBackdrop(): void
{
if ( !this._backdrop )
{
return;
}
// Create the leave animation and attach it to the player
this._player =
this._animationBuilder
.build([
animate('300ms ease', style({opacity: 0}))
]).create(this._backdrop);
// Play the animation
this._player.play();
// Once the animation is done...
this._player.onDone(() => {
// If the backdrop still exists...
if ( this._backdrop )
{
// Remove the backdrop
this._backdrop.parentNode.removeChild(this._backdrop);
this._backdrop = null;
}
});
// Mark for check
this._changeDetectorRef.markForCheck();
}
/**
* Change some properties of the sidebar
* and make it visible
*
* @private
*/
private _showSidebar(): void
{
// Remove the box-shadow style
this._renderer.removeStyle(this._elementRef.nativeElement, 'box-shadow');
// Make the sidebar invisible
this._renderer.removeStyle(this._elementRef.nativeElement, 'visibility');
// Mark for check
this._changeDetectorRef.markForCheck();
}
/**
* Change some properties of the sidebar
* and make it invisible
*
* @private
*/
private _hideSidebar(delay = true): void
{
const delayAmount = delay ? 300 : 0;
// Add a delay so close animation can play
setTimeout(() => {
// Remove the box-shadow
this._renderer.setStyle(this._elementRef.nativeElement, 'box-shadow', 'none');
// Make the sidebar invisible
this._renderer.setStyle(this._elementRef.nativeElement, 'visibility', 'hidden');
}, delayAmount);
// Mark for check
this._changeDetectorRef.markForCheck();
}
/**
* Enable the animations
*
* @private
*/
private _enableAnimations(): void
{
// Return if animations already enabled
if ( this._animationsEnabled )
{
return;
}
// Enable the animations
this._animationsEnabled = true;
// Mark for check
this._changeDetectorRef.markForCheck();
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Open the sidebar
*/
open(): void
{
if ( this.opened || this.isLockedOpen )
{
return;
}
// Enable the animations
this._enableAnimations();
// Show the sidebar
this._showSidebar();
// Show the backdrop
this._showBackdrop();
// Set the opened status
this.opened = true;
// Emit the 'openedChanged' event
this.openedChanged.emit(this.opened);
// Mark for check
this._changeDetectorRef.markForCheck();
}
/**
* Close the sidebar
*/
close(): void
{
if ( !this.opened || this.isLockedOpen )
{
return;
}
// Enable the animations
this._enableAnimations();
// Hide the backdrop
this._hideBackdrop();
// Set the opened status
this.opened = false;
// Emit the 'openedChanged' event
this.openedChanged.emit(this.opened);
// Hide the sidebar
this._hideSidebar();
// Mark for check
this._changeDetectorRef.markForCheck();
}
/**
* Toggle open/close the sidebar
*/
toggleOpen(): void
{
if ( this.opened )
{
this.close();
}
else
{
this.open();
}
}
/**
* Mouseenter
*/
@HostListener('mouseenter')
onMouseEnter(): void
{
// Only work if the auto trigger is enabled
if ( !this.foldedAutoTriggerOnHover )
{
return;
}
this.unfoldTemporarily();
}
/**
* Mouseleave
*/
@HostListener('mouseleave')
onMouseLeave(): void
{
// Only work if the auto trigger is enabled
if ( !this.foldedAutoTriggerOnHover )
{
return;
}
this.foldTemporarily();
}
/**
* Fold the sidebar permanently
*/
fold(): void
{
// Only work if the sidebar is not folded
if ( this.folded )
{
return;
}
// Enable the animations
this._enableAnimations();
// Fold
this.folded = true;
// Mark for check
this._changeDetectorRef.markForCheck();
}
/**
* Unfold the sidebar permanently
*/
unfold(): void
{
// Only work if the sidebar is folded
if ( !this.folded )
{
return;
}
// Enable the animations
this._enableAnimations();
// Unfold
this.folded = false;
// Mark for check
this._changeDetectorRef.markForCheck();
}
/**
* Toggle the sidebar fold/unfold permanently
*/
toggleFold(): void
{
if ( this.folded )
{
this.unfold();
}
else
{
this.fold();
}
}
/**
* Fold the temporarily unfolded sidebar back
*/
foldTemporarily(): void
{
// Only work if the sidebar is folded
if ( !this.folded )
{
return;
}
// Enable the animations
this._enableAnimations();
// Fold the sidebar back
this.unfolded = false;
// Set the folded width
const styleValue = this.foldedWidth + 'px';
this._renderer.setStyle(this._elementRef.nativeElement, 'width', styleValue);
this._renderer.setStyle(this._elementRef.nativeElement, 'min-width', styleValue);
this._renderer.setStyle(this._elementRef.nativeElement, 'max-width', styleValue);
// Mark for check
this._changeDetectorRef.markForCheck();
}
/**
* Unfold the sidebar temporarily
*/
unfoldTemporarily(): void
{
// Only work if the sidebar is folded
if ( !this.folded )
{
return;
}
// Enable the animations
this._enableAnimations();
// Unfold the sidebar temporarily
this.unfolded = true;
// Remove the folded width
this._renderer.removeStyle(this._elementRef.nativeElement, 'width');
this._renderer.removeStyle(this._elementRef.nativeElement, 'min-width');
this._renderer.removeStyle(this._elementRef.nativeElement, 'max-width');
// Mark for check
this._changeDetectorRef.markForCheck();
}
}

View File

@@ -0,0 +1,15 @@
import { NgModule } from '@angular/core';
import { FuseSidebarComponent } from './sidebar.component';
@NgModule({
declarations: [
FuseSidebarComponent
],
exports : [
FuseSidebarComponent
]
})
export class FuseSidebarModule
{
}

View File

@@ -0,0 +1,77 @@
import { Injectable } from '@angular/core';
import { FuseSidebarComponent } from './sidebar.component';
@Injectable({
providedIn: 'root'
})
export class FuseSidebarService
{
// Private
private _registry: { [key: string]: FuseSidebarComponent } = {};
/**
* Constructor
*/
constructor()
{
}
/**
* Add the sidebar to the registry
*
* @param key
* @param sidebar
*/
register(key, sidebar): void
{
// Check if the key already being used
if ( this._registry[key] )
{
console.error(`The sidebar with the key '${key}' already exists. Either unregister it first or use a unique key.`);
return;
}
// Add to the registry
this._registry[key] = sidebar;
}
/**
* Remove the sidebar from the registry
*
* @param key
*/
unregister(key): void
{
// Check if the sidebar exists
if ( !this._registry[key] )
{
console.warn(`The sidebar with the key '${key}' doesn't exist in the registry.`);
}
// Unregister the sidebar
delete this._registry[key];
}
/**
* Return the sidebar with the given key
*
* @param key
* @returns {FuseSidebarComponent}
*/
getSidebar(key): FuseSidebarComponent
{
// Check if the sidebar exists
if ( !this._registry[key] )
{
console.warn(`The sidebar with the key '${key}' doesn't exist in the registry.`);
return;
}
// Return the sidebar
return this._registry[key];
}
}

View File

@@ -0,0 +1,495 @@
<div class="theme-options-panel" fusePerfectScrollbar>
<div class="header">
<span class="title">Theme Options</span>
<button mat-icon-button class="close-button" (click)="toggleSidebarOpen('themeOptionsPanel')">
<mat-icon>close</mat-icon>
</button>
</div>
<form [formGroup]="form">
<!-- LAYOUT STYLES -->
<div class="group" formGroupName="layout">
<h2>Layout Styles</h2>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="style">
<mat-radio-button class="mb-12" value="vertical-layout-1">
Vertical Layout #1
</mat-radio-button>
<mat-radio-button class="mb-12" value="vertical-layout-2">
Vertical Layout #2
</mat-radio-button>
<mat-radio-button class="mb-12" value="vertical-layout-3">
Vertical Layout #3
</mat-radio-button>
<mat-radio-button class="mb-12" value="horizontal-layout-1">
Horizontal Layout #1
</mat-radio-button>
</mat-radio-group>
<!-- DIFFERENT FORMS BASED ON LAYOUT STYLES -->
<ng-container [ngSwitch]="fuseConfig.layout.style">
<!-- VERTICAL LAYOUT #1 -->
<ng-container *ngSwitchCase="'vertical-layout-1'">
<!-- LAYOUT WIDTH -->
<div class="group mt-32">
<h2>Layout Width</h2>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="width">
<mat-radio-button class="mb-12" value="fullwidth">Fullwidth</mat-radio-button>
<mat-radio-button class="mb-12" value="boxed">Boxed</mat-radio-button>
</mat-radio-group>
</div>
<!-- NAVBAR -->
<div class="group" formGroupName="navbar">
<h2>Navbar</h2>
<mat-slide-toggle formControlName="hidden">
Hide
</mat-slide-toggle>
<mat-slide-toggle class="mt-24" formControlName="folded">
Folded
</mat-slide-toggle>
<h3 class="mt-24">Position:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
<mat-radio-button class="mb-16" value="left">Left</mat-radio-button>
<mat-radio-button class="mb-16" value="right">Right</mat-radio-button>
</mat-radio-group>
<h3 class="mt-8">Variant:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="variant">
<mat-radio-button class="mb-16" value="vertical-style-1">Style 1</mat-radio-button>
<mat-radio-button class="mb-16" value="vertical-style-2">Style 2</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.navbar.background">
</fuse-material-color-picker>
</div>
<!-- TOOLBAR -->
<div class="group" formGroupName="toolbar">
<h2>Toolbar</h2>
<mat-slide-toggle formControlName="hidden">
Hide
</mat-slide-toggle>
<h3 class="mt-24">Position:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
<mat-radio-button class="mb-12" value="above">Above</mat-radio-button>
<mat-radio-button class="mb-12" value="below-static">Below Static</mat-radio-button>
<mat-radio-button class="mb-12" value="below-fixed">Below Fixed</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.toolbar.background">
</fuse-material-color-picker>
</div>
<!-- FOOTER -->
<div class="group" formGroupName="footer">
<h2>Footer</h2>
<mat-slide-toggle formControlName="hidden">
Hide
</mat-slide-toggle>
<h3 class="mt-24">Position:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
<mat-radio-button class="mb-12" value="above">Above</mat-radio-button>
<mat-radio-button class="mb-12" value="below-static">Below Static</mat-radio-button>
<mat-radio-button class="mb-12" value="below-fixed">Below Fixed</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.footer.background">
</fuse-material-color-picker>
</div>
<!-- SIDE PANEL -->
<div class="group" formGroupName="sidepanel">
<h2>Side Panel</h2>
<mat-slide-toggle formControlName="hidden">
Hide
</mat-slide-toggle>
<h3 class="mt-24">Position:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
<mat-radio-button class="mb-12" value="left">Left</mat-radio-button>
<mat-radio-button class="mb-12" value="right">Right</mat-radio-button>
</mat-radio-group>
</div>
</ng-container>
<!-- VERTICAL LAYOUT #2 -->
<ng-container *ngSwitchCase="'vertical-layout-2'">
<!-- LAYOUT WIDTH -->
<div class="group mt-32">
<h2>Layout Width</h2>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="width">
<mat-radio-button class="mb-12" value="fullwidth">Fullwidth</mat-radio-button>
<mat-radio-button class="mb-12" value="boxed">Boxed</mat-radio-button>
</mat-radio-group>
</div>
<!-- NAVBAR -->
<div class="group" formGroupName="navbar">
<h2>Navbar</h2>
<mat-slide-toggle formControlName="hidden">
Hide
</mat-slide-toggle>
<mat-slide-toggle class="mt-24" formControlName="folded">
Folded
</mat-slide-toggle>
<h3 class="mt-24">Position:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
<mat-radio-button class="mb-16" value="left">Left</mat-radio-button>
<mat-radio-button class="mb-16" value="right">Right</mat-radio-button>
</mat-radio-group>
<h3 class="mt-8">Variant:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="variant">
<mat-radio-button class="mb-16" value="vertical-style-1">Style 1</mat-radio-button>
<mat-radio-button class="mb-16" value="vertical-style-2">Style 2</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.navbar.background">
</fuse-material-color-picker>
</div>
<!-- TOOLBAR -->
<div class="group" formGroupName="toolbar">
<h2>Toolbar</h2>
<mat-slide-toggle formControlName="hidden">
Hide
</mat-slide-toggle>
<h3 class="mt-24">Position:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
<mat-radio-button class="mb-12" value="above-static">Above Static</mat-radio-button>
<mat-radio-button class="mb-12" value="above-fixed">Above Fixed</mat-radio-button>
<mat-radio-button class="mb-12" value="below">Below</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.toolbar.background">
</fuse-material-color-picker>
</div>
<!-- FOOTER -->
<div class="group" formGroupName="footer">
<h2>Footer</h2>
<mat-slide-toggle formControlName="hidden">
Hide
</mat-slide-toggle>
<h3 class="mt-24">Position:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
<mat-radio-button class="mb-12" value="above-static">Above Static</mat-radio-button>
<mat-radio-button class="mb-12" value="above-fixed">Above Fixed</mat-radio-button>
<mat-radio-button class="mb-12" value="below">Below</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.footer.background">
</fuse-material-color-picker>
</div>
<!-- SIDE PANEL -->
<div class="group" formGroupName="sidepanel">
<h2>Side Panel</h2>
<mat-slide-toggle formControlName="hidden">
Hide
</mat-slide-toggle>
<h3 class="mt-24">Position:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
<mat-radio-button class="mb-12" value="left">Left</mat-radio-button>
<mat-radio-button class="mb-12" value="right">Right</mat-radio-button>
</mat-radio-group>
</div>
</ng-container>
<!-- VERTICAL LAYOUT #3 -->
<ng-container *ngSwitchCase="'vertical-layout-3'">
<!-- LAYOUT WIDTH -->
<div class="group mt-32">
<h2>Layout Width</h2>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="width">
<mat-radio-button class="mb-12" value="fullwidth">Fullwidth</mat-radio-button>
<mat-radio-button class="mb-12" value="boxed">Boxed</mat-radio-button>
</mat-radio-group>
</div>
<!-- NAVBAR -->
<div class="group" formGroupName="navbar">
<h2>Navbar</h2>
<mat-slide-toggle formControlName="hidden">
Hide
</mat-slide-toggle>
<mat-slide-toggle class="mt-24" formControlName="folded">
Folded
</mat-slide-toggle>
<h3 class="mt-24">Position:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
<mat-radio-button class="mb-16" value="left">Left</mat-radio-button>
<mat-radio-button class="mb-16" value="right">Right</mat-radio-button>
</mat-radio-group>
<h3 class="mt-8">Variant:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="variant">
<mat-radio-button class="mb-16" value="vertical-style-1">Style 1</mat-radio-button>
<mat-radio-button class="mb-16" value="vertical-style-2">Style 2</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.navbar.background">
</fuse-material-color-picker>
</div>
<!-- TOOLBAR -->
<div class="group" formGroupName="toolbar">
<h2>Toolbar</h2>
<mat-slide-toggle formControlName="hidden">
Hide
</mat-slide-toggle>
<h3 class="mt-24">Position:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
<mat-radio-button class="mb-12" value="above-static">Above Static</mat-radio-button>
<mat-radio-button class="mb-12" value="above-fixed">Above Fixed</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.toolbar.background">
</fuse-material-color-picker>
</div>
<!-- FOOTER -->
<div class="group" formGroupName="footer">
<h2>Footer</h2>
<mat-slide-toggle formControlName="hidden">
Hide
</mat-slide-toggle>
<h3 class="mt-24">Position:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
<mat-radio-button class="mb-12" value="above-static">Above Static</mat-radio-button>
<mat-radio-button class="mb-12" value="above-fixed">Above Fixed</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.footer.background">
</fuse-material-color-picker>
</div>
<!-- SIDE PANEL -->
<div class="group" formGroupName="sidepanel">
<h2>Side Panel</h2>
<mat-slide-toggle formControlName="hidden">
Hide
</mat-slide-toggle>
<h3 class="mt-24">Position:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
<mat-radio-button class="mb-12" value="left">Left</mat-radio-button>
<mat-radio-button class="mb-12" value="right">Right</mat-radio-button>
</mat-radio-group>
</div>
</ng-container>
<!-- HORIZONTAL LAYOUT #1 -->
<ng-container *ngSwitchCase="'horizontal-layout-1'">
<!-- LAYOUT WIDTH -->
<div class="group mt-32">
<h2>Layout Width</h2>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="width">
<mat-radio-button class="mb-12" value="fullwidth">Fullwidth</mat-radio-button>
<mat-radio-button class="mb-12" value="boxed">Boxed</mat-radio-button>
</mat-radio-group>
</div>
<!-- NAVBAR -->
<div class="group" formGroupName="navbar">
<h2>Navbar</h2>
<mat-slide-toggle formControlName="hidden">
Hide
</mat-slide-toggle>
<h3 class="mt-24">Position:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
<mat-radio-button class="mb-16" value="top">Top</mat-radio-button>
</mat-radio-group>
<h3 class="mt-8">Variant (Vertical):</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="variant">
<mat-radio-button class="mb-16" value="vertical-style-1">Style 1</mat-radio-button>
<mat-radio-button class="mb-16" value="vertical-style-2">Style 2</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.navbar.background">
</fuse-material-color-picker>
</div>
<!-- TOOLBAR -->
<div class="group" formGroupName="toolbar">
<h2>Toolbar</h2>
<mat-slide-toggle formControlName="hidden">
Hide
</mat-slide-toggle>
<h3 class="mt-24">Position:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
<mat-radio-button class="mb-12" value="above">Above</mat-radio-button>
<mat-radio-button class="mb-12" value="below">Below</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.toolbar.background">
</fuse-material-color-picker>
</div>
<!-- FOOTER -->
<div class="group" formGroupName="footer">
<h2>Footer</h2>
<mat-slide-toggle formControlName="hidden">
Hide
</mat-slide-toggle>
<h3 class="mt-24">Position:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
<mat-radio-button class="mb-12" value="above-fixed">Above Fixed</mat-radio-button>
<mat-radio-button class="mb-12" value="above-static">Above Static</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.footer.background">
</fuse-material-color-picker>
</div>
<!-- SIDE PANEL -->
<div class="group" formGroupName="sidepanel">
<h2>Side Panel</h2>
<mat-slide-toggle formControlName="hidden">
Hide
</mat-slide-toggle>
<h3 class="mt-24">Position:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
<mat-radio-button class="mb-12" value="left">Left</mat-radio-button>
<mat-radio-button class="mb-12" value="right">Right</mat-radio-button>
</mat-radio-group>
</div>
</ng-container>
</ng-container>
</div>
<!-- CUSTOM SCROLLBARS -->
<div class="group">
<h2>Custom scrollbars</h2>
<mat-slide-toggle class="mb-12" formControlName="customScrollbars">
Enable custom scrollbars
</mat-slide-toggle>
</div>
</form>
</div>

View File

@@ -0,0 +1,79 @@
@import "src/@fuse/scss/fuse";
@keyframes rotating {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
:host {
display: flex;
overflow: hidden;
.theme-options-panel {
display: flex;
flex-direction: column;
flex: 1 0 auto;
padding: 40px 24px 24px 24px;
overflow: auto;
-webkit-overflow-scrolling: touch;
.header {
display: flex;
flex: 0 1 auto;
margin-bottom: 32px;
align-items: center;
justify-content: space-between;
.title {
font-size: 20px;
font-weight: 500;
padding-left: 4px;
}
}
form {
display: flex;
flex: 1 1 auto;
flex-direction: column;
.group {
display: flex;
flex: 1 0 auto;
flex-direction: column;
position: relative;
border: 1px solid rgba(0, 0, 0, 0.12);
border-radius: 2px;
padding: 28px 16px 8px 16px;
margin: 16px 0;
h2 {
position: absolute;
top: -11px;
left: 8px;
margin: 0;
padding: 0 8px;
font-size: 16px;
font-weight: 500;
background: white;
color: rgba(0, 0, 0, 0.54);
}
h3 {
font-size: 14px;
font-weight: 500;
color: rgba(0, 0, 0, 0.54);
margin: 24px 0 16px 0;
padding: 0;
&:first-of-type {
margin-top: 0;
}
}
}
}
}
}

View File

@@ -0,0 +1,307 @@
import { Component, HostBinding, OnDestroy, OnInit, Renderer2 } from '@angular/core';
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { fuseAnimations } from '@fuse/animations';
import { FuseConfigService } from '@fuse/services/config.service';
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
import { FuseSidebarService } from '@fuse/components/sidebar/sidebar.service';
@Component({
selector : 'fuse-theme-options',
templateUrl: './theme-options.component.html',
styleUrls : ['./theme-options.component.scss'],
animations : fuseAnimations
})
export class FuseThemeOptionsComponent implements OnInit, OnDestroy
{
fuseConfig: any;
form: FormGroup;
@HostBinding('class.bar-closed')
barClosed: boolean;
// Private
private _unsubscribeAll: Subject<any>;
/**
* Constructor
*
* @param {FormBuilder} _formBuilder
* @param {FuseConfigService} _fuseConfigService
* @param {FuseNavigationService} _fuseNavigationService
* @param {FuseSidebarService} _fuseSidebarService
* @param {Renderer2} _renderer
*/
constructor(
private _formBuilder: FormBuilder,
private _fuseConfigService: FuseConfigService,
private _fuseNavigationService: FuseNavigationService,
private _fuseSidebarService: FuseSidebarService,
private _renderer: Renderer2
)
{
// Set the defaults
this.barClosed = true;
// Set the private defaults
this._unsubscribeAll = new Subject();
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void
{
// Build the config form
// noinspection TypeScriptValidateTypes
this.form = this._formBuilder.group({
layout : this._formBuilder.group({
style : new FormControl(),
width : new FormControl(),
navbar : this._formBuilder.group({
background: new FormControl(),
folded : new FormControl(),
hidden : new FormControl(),
position : new FormControl(),
variant : new FormControl()
}),
toolbar : this._formBuilder.group({
background: new FormControl(),
hidden : new FormControl(),
position : new FormControl()
}),
footer : this._formBuilder.group({
background: new FormControl(),
hidden : new FormControl(),
position : new FormControl()
}),
sidepanel: this._formBuilder.group({
hidden: new FormControl(),
position : new FormControl()
})
}),
customScrollbars: new FormControl()
});
// Subscribe to the config changes
this._fuseConfigService.config
.pipe(takeUntil(this._unsubscribeAll))
.subscribe((config) => {
// Update the stored config
this.fuseConfig = config;
// Set the config form values without emitting an event
// so that we don't end up with an infinite loop
this.form.setValue(config, {emitEvent: false});
});
// Subscribe to the specific form value changes (layout.style)
this.form.get('layout.style').valueChanges
.pipe(takeUntil(this._unsubscribeAll))
.subscribe((value) => {
// Reset the form values based on the
// selected layout style
this._resetFormValues(value);
});
// Subscribe to the form value changes
this.form.valueChanges
.pipe(takeUntil(this._unsubscribeAll))
.subscribe((config) => {
// Update the config
this._fuseConfigService.config = config;
});
// Add customize nav item that opens the bar programmatically
const customFunctionNavItem = {
'id' : 'custom-function',
'title' : 'Custom Function',
'type' : 'group',
'icon' : 'settings',
'children': [
{
'id' : 'customize',
'title' : 'Customize',
'type' : 'item',
'icon' : 'settings',
'function': () => {
this.toggleSidebarOpen('themeOptionsPanel');
}
}
]
};
this._fuseNavigationService.addNavigationItem(customFunctionNavItem, 'end');
}
/**
* On destroy
*/
ngOnDestroy(): void
{
// Unsubscribe from all subscriptions
this._unsubscribeAll.next();
this._unsubscribeAll.complete();
// Remove the custom function menu
this._fuseNavigationService.removeNavigationItem('custom-function');
}
// -----------------------------------------------------------------------------------------------------
// @ Private methods
// -----------------------------------------------------------------------------------------------------
/**
* Reset the form values based on the
* selected layout style
*
* @param value
* @private
*/
private _resetFormValues(value): void
{
switch ( value )
{
// Vertical Layout #1
case 'vertical-layout-1':
{
this.form.patchValue({
layout: {
width : 'fullwidth',
navbar : {
background: 'mat-fuse-dark-700-bg',
folded : false,
hidden : false,
position : 'left',
variant : 'vertical-style-1'
},
toolbar: {
background: 'mat-white-500-bg',
hidden : false,
position : 'below-static'
},
footer : {
background: 'mat-fuse-dark-900-bg',
hidden : false,
position : 'below-static'
}
}
});
break;
}
// Vertical Layout #2
case 'vertical-layout-2':
{
this.form.patchValue({
layout: {
width : 'fullwidth',
navbar : {
background: 'mat-fuse-dark-700-bg',
folded : false,
hidden : false,
position : 'left',
variant : 'vertical-style-1'
},
toolbar: {
background: 'mat-white-500-bg',
hidden : false,
position : 'below'
},
footer : {
background: 'mat-fuse-dark-900-bg',
hidden : false,
position : 'below'
}
}
});
break;
}
// Vertical Layout #3
case 'vertical-layout-3':
{
this.form.patchValue({
layout: {
width : 'fullwidth',
navbar : {
background: 'mat-fuse-dark-700-bg',
folded : false,
hidden : false,
position : 'left',
layout : 'vertical-style-1'
},
toolbar: {
background: 'mat-white-500-bg',
hidden : false,
position : 'above-static'
},
footer : {
background: 'mat-fuse-dark-900-bg',
hidden : false,
position : 'above-static'
}
}
});
break;
}
// Horizontal Layout #1
case 'horizontal-layout-1':
{
this.form.patchValue({
layout: {
width : 'fullwidth',
navbar : {
background: 'mat-fuse-dark-700-bg',
folded : false,
hidden : false,
position : 'top',
variant : 'vertical-style-1'
},
toolbar: {
background: 'mat-white-500-bg',
hidden : false,
position : 'above'
},
footer : {
background: 'mat-fuse-dark-900-bg',
hidden : false,
position : 'above-fixed'
}
}
});
break;
}
}
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Toggle sidebar open
*
* @param key
*/
toggleSidebarOpen(key): void
{
this._fuseSidebarService.getSidebar(key).toggleOpen();
}
}

View File

@@ -0,0 +1,43 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { FlexLayoutModule } from '@angular/flex-layout';
import { MatButtonModule, MatDividerModule, MatFormFieldModule, MatIconModule, MatOptionModule, MatRadioModule, MatSelectModule, MatSlideToggleModule } from '@angular/material';
import { FuseDirectivesModule } from '@fuse/directives/directives';
import { FuseSidebarModule } from '@fuse/components/sidebar/sidebar.module';
import { FuseMaterialColorPickerModule } from '@fuse/components/material-color-picker/material-color-picker.module';
import { FuseThemeOptionsComponent } from '@fuse/components/theme-options/theme-options.component';
@NgModule({
declarations: [
FuseThemeOptionsComponent
],
imports : [
CommonModule,
FormsModule,
ReactiveFormsModule,
FlexLayoutModule,
MatButtonModule,
MatDividerModule,
MatFormFieldModule,
MatIconModule,
MatOptionModule,
MatRadioModule,
MatSelectModule,
MatSlideToggleModule,
FuseDirectivesModule,
FuseMaterialColorPickerModule,
FuseSidebarModule
],
exports : [
FuseThemeOptionsComponent
]
})
export class FuseThemeOptionsModule
{
}

View File

@@ -0,0 +1,18 @@
import { Directive, ElementRef } from '@angular/core';
@Directive({
selector: '[fuseWidgetToggle]'
})
export class FuseWidgetToggleDirective
{
/**
* Constructor
*
* @param {ElementRef} elementRef
*/
constructor(
public elementRef: ElementRef
)
{
}
}

View File

@@ -62,4 +62,23 @@ fuse-widget {
transform: rotateY(360deg);
}
}
.mat-form-field {
&.mat-form-field-type-mat-select {
.mat-form-field-wrapper {
padding: 16px 0;
.mat-form-field-infix {
border: none;
padding: 0;
}
}
.mat-form-field-underline {
display: none;
}
}
}
}

View File

@@ -0,0 +1,65 @@
import { AfterContentInit, Component, ContentChildren, ElementRef, HostBinding, QueryList, Renderer2, ViewEncapsulation } from '@angular/core';
import { FuseWidgetToggleDirective } from './widget-toggle.directive';
@Component({
selector : 'fuse-widget',
templateUrl : './widget.component.html',
styleUrls : ['./widget.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class FuseWidgetComponent implements AfterContentInit
{
@HostBinding('class.flipped')
flipped = false;
@ContentChildren(FuseWidgetToggleDirective, {descendants: true})
toggleButtons: QueryList<FuseWidgetToggleDirective>;
/**
* Constructor
*
* @param {ElementRef} _elementRef
* @param {Renderer2} _renderer
*/
constructor(
private _elementRef: ElementRef,
private _renderer: Renderer2
)
{
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* After content init
*/
ngAfterContentInit(): void
{
// Listen for the flip button click
setTimeout(() => {
this.toggleButtons.forEach(flipButton => {
this._renderer.listen(flipButton.elementRef.nativeElement, 'click', (event) => {
event.preventDefault();
event.stopPropagation();
this.toggle();
});
});
});
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Toggle the flipped status
*/
toggle(): void
{
this.flipped = !this.flipped;
}
}

View File

@@ -1,20 +1,17 @@
import { NgModule } from '@angular/core';
import { SharedModule } from '../../modules/shared.module';
import { FuseWidgetComponent } from './widget.component';
import { FuseWidgetToggleDirective } from './widget-toggle.directive';
@NgModule({
imports : [
SharedModule
declarations: [
FuseWidgetComponent,
FuseWidgetToggleDirective
],
exports : [
FuseWidgetComponent,
FuseWidgetToggleDirective
],
declarations: [
FuseWidgetComponent,
FuseWidgetToggleDirective
]
})
export class FuseWidgetModule
{

View File

@@ -0,0 +1,27 @@
import { NgModule } from '@angular/core';
import { FuseIfOnDomDirective } from '@fuse/directives/fuse-if-on-dom/fuse-if-on-dom.directive';
import { FuseInnerScrollDirective } from '@fuse/directives/fuse-inner-scroll/fuse-inner-scroll.directive';
import { FusePerfectScrollbarDirective } from '@fuse/directives/fuse-perfect-scrollbar/fuse-perfect-scrollbar.directive';
import { FuseMatSidenavHelperDirective, FuseMatSidenavTogglerDirective } from '@fuse/directives/fuse-mat-sidenav/fuse-mat-sidenav.directive';
@NgModule({
declarations: [
FuseIfOnDomDirective,
FuseInnerScrollDirective,
FuseMatSidenavHelperDirective,
FuseMatSidenavTogglerDirective,
FusePerfectScrollbarDirective
],
imports : [],
exports : [
FuseIfOnDomDirective,
FuseInnerScrollDirective,
FuseMatSidenavHelperDirective,
FuseMatSidenavTogglerDirective,
FusePerfectScrollbarDirective
]
})
export class FuseDirectivesModule
{
}

View File

@@ -0,0 +1,49 @@
import { AfterContentChecked, Directive, ElementRef, TemplateRef, ViewContainerRef } from '@angular/core';
@Directive({
selector: '[fuseIfOnDom]'
})
export class FuseIfOnDomDirective implements AfterContentChecked
{
isCreated: boolean;
/**
* Constructor
*
* @param {ElementRef} _elementRef
* @param {TemplateRef<any>} _templateRef
* @param {ViewContainerRef} _viewContainerRef
*/
constructor(
private _elementRef: ElementRef,
private _templateRef: TemplateRef<any>,
private _viewContainerRef: ViewContainerRef
)
{
// Set the defaults
this.isCreated = false;
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* After content checked
*/
ngAfterContentChecked(): void
{
if ( document.body.contains(this._elementRef.nativeElement) && !this.isCreated )
{
setTimeout(() => {
this._viewContainerRef.createEmbeddedView(this._templateRef);
}, 300);
this.isCreated = true;
}
else if ( this.isCreated && !document.body.contains(this._elementRef.nativeElement) )
{
this._viewContainerRef.clear();
this.isCreated = false;
}
}
}

View File

@@ -0,0 +1,115 @@
import { Directive, ElementRef, OnDestroy, OnInit, Renderer2 } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { FuseMatchMediaService } from '@fuse/services/match-media.service';
@Directive({
selector: '.inner-scroll'
})
export class FuseInnerScrollDirective implements OnInit, OnDestroy
{
// Private
private _parent: any;
private _grandParent: any;
private _unsubscribeAll: Subject<any>;
/**
* Constructor
*
* @param {ElementRef} _elementRef
* @param {FuseMatchMediaService} _fuseMediaMatchService
* @param {Renderer2} _renderer
*/
constructor(
private _elementRef: ElementRef,
private _fuseMediaMatchService: FuseMatchMediaService,
private _renderer: Renderer2
)
{
// Set the private defaults
this._unsubscribeAll = new Subject();
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void
{
// Get the parent
this._parent = this._renderer.parentNode(this._elementRef.nativeElement);
// Return, if there is no parent
if ( !this._parent )
{
return;
}
// Get the grand parent
this._grandParent = this._renderer.parentNode(this._parent);
// Register to the media query changes
this._fuseMediaMatchService.onMediaChange
.pipe(takeUntil(this._unsubscribeAll))
.subscribe((alias) => {
if ( alias === 'xs' )
{
this._removeClass();
}
else
{
this._addClass();
}
});
}
/**
* On destroy
*/
ngOnDestroy(): void
{
// Return, if there is no parent
if ( !this._parent )
{
return;
}
// Remove the class
this._removeClass();
// Unsubscribe from all subscriptions
this._unsubscribeAll.next();
this._unsubscribeAll.complete();
}
// -----------------------------------------------------------------------------------------------------
// @ Private methods
// -----------------------------------------------------------------------------------------------------
/**
* Add the class name
*
* @private
*/
private _addClass(): void
{
// Add the inner-scroll class
this._renderer.addClass(this._grandParent, 'inner-scroll');
}
/**
* Remove the class name
* @private
*/
private _removeClass(): void
{
// Remove the inner-scroll class
this._renderer.removeClass(this._grandParent, 'inner-scroll');
}
}

View File

@@ -0,0 +1,133 @@
import { Directive, Input, OnInit, HostListener, OnDestroy, HostBinding } from '@angular/core';
import { MatSidenav } from '@angular/material';
import { ObservableMedia } from '@angular/flex-layout';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { FuseMatchMediaService } from '@fuse/services/match-media.service';
import { FuseMatSidenavHelperService } from '@fuse/directives/fuse-mat-sidenav/fuse-mat-sidenav.service';
@Directive({
selector: '[fuseMatSidenavHelper]'
})
export class FuseMatSidenavHelperDirective implements OnInit, OnDestroy
{
@HostBinding('class.mat-is-locked-open')
isLockedOpen: boolean;
@Input('fuseMatSidenavHelper')
id: string;
@Input('mat-is-locked-open')
matIsLockedOpenBreakpoint: string;
// Private
private _unsubscribeAll: Subject<any>;
/**
* Constructor
*
* @param {FuseMatchMediaService} _fuseMatchMediaService
* @param {FuseMatSidenavHelperService} _fuseMatSidenavHelperService
* @param {MatSidenav} _matSidenav
* @param {ObservableMedia} _observableMedia
*/
constructor(
private _fuseMatchMediaService: FuseMatchMediaService,
private _fuseMatSidenavHelperService: FuseMatSidenavHelperService,
private _matSidenav: MatSidenav,
private _observableMedia: ObservableMedia
)
{
// Set the defaults
this.isLockedOpen = true;
// Set the private defaults
this._unsubscribeAll = new Subject();
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void
{
// Register the sidenav to the service
this._fuseMatSidenavHelperService.setSidenav(this.id, this._matSidenav);
if ( this._observableMedia.isActive(this.matIsLockedOpenBreakpoint) )
{
this.isLockedOpen = true;
this._matSidenav.mode = 'side';
this._matSidenav.toggle(true);
}
else
{
this.isLockedOpen = false;
this._matSidenav.mode = 'over';
this._matSidenav.toggle(false);
}
this._fuseMatchMediaService.onMediaChange
.pipe(takeUntil(this._unsubscribeAll))
.subscribe(() => {
if ( this._observableMedia.isActive(this.matIsLockedOpenBreakpoint) )
{
this.isLockedOpen = true;
this._matSidenav.mode = 'side';
this._matSidenav.toggle(true);
}
else
{
this.isLockedOpen = false;
this._matSidenav.mode = 'over';
this._matSidenav.toggle(false);
}
});
}
/**
* On destroy
*/
ngOnDestroy(): void
{
// Unsubscribe from all subscriptions
this._unsubscribeAll.next();
this._unsubscribeAll.complete();
}
}
@Directive({
selector: '[fuseMatSidenavToggler]'
})
export class FuseMatSidenavTogglerDirective
{
@Input('fuseMatSidenavToggler')
id;
/**
* Constructor
*
* @param {FuseMatSidenavHelperService} _fuseMatSidenavHelperService
*/
constructor(
private _fuseMatSidenavHelperService: FuseMatSidenavHelperService)
{
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* On click
*/
@HostListener('click')
onClick()
{
this._fuseMatSidenavHelperService.getSidenav(this.id).toggle();
}
}

View File

@@ -0,0 +1,44 @@
import { Injectable } from '@angular/core';
import { MatSidenav } from '@angular/material';
@Injectable({
providedIn: 'root'
})
export class FuseMatSidenavHelperService
{
sidenavInstances: MatSidenav[];
/**
* Constructor
*/
constructor()
{
this.sidenavInstances = [];
}
// -----------------------------------------------------------------------------------------------------
// @ Accessors
// -----------------------------------------------------------------------------------------------------
/**
* Set sidenav
*
* @param id
* @param instance
*/
setSidenav(id, instance): void
{
this.sidenavInstances[id] = instance;
}
/**
* Get sidenav
*
* @param id
* @returns {any}
*/
getSidenav(id): any
{
return this.sidenavInstances[id];
}
}

View File

@@ -0,0 +1,410 @@
import { AfterViewInit, Directive, ElementRef, HostListener, Input, OnDestroy } from '@angular/core';
import { NavigationEnd, Router } from '@angular/router';
import { Platform } from '@angular/cdk/platform';
import { Subject } from 'rxjs';
import { filter, takeUntil } from 'rxjs/operators';
import PerfectScrollbar from 'perfect-scrollbar';
import * as _ from 'lodash';
import { FuseConfigService } from '@fuse/services/config.service';
@Directive({
selector: '[fusePerfectScrollbar]'
})
export class FusePerfectScrollbarDirective implements AfterViewInit, OnDestroy
{
isInitialized: boolean;
isMobile: boolean;
ps: PerfectScrollbar;
// Private
private _enabled: boolean | '';
private _debouncedUpdate: any;
private _options: any;
private _unsubscribeAll: Subject<any>;
/**
* Constructor
*
* @param {ElementRef} elementRef
* @param {FuseConfigService} _fuseConfigService
* @param {Platform} _platform
* @param {Router} _router
*/
constructor(
public elementRef: ElementRef,
private _fuseConfigService: FuseConfigService,
private _platform: Platform,
private _router: Router
)
{
// Set the defaults
this.isInitialized = false;
this.isMobile = false;
// Set the private defaults
this._enabled = false;
this._debouncedUpdate = _.debounce(this.update, 150);
this._options = {
updateOnRouteChange: false
};
this._unsubscribeAll = new Subject();
}
// -----------------------------------------------------------------------------------------------------
// @ Accessors
// -----------------------------------------------------------------------------------------------------
/**
* Perfect Scrollbar options
*
* @param value
*/
@Input()
set fusePerfectScrollbarOptions(value)
{
// Merge the options
this._options = _.merge({}, this._options, value);
}
get fusePerfectScrollbarOptions(): any
{
// Return the options
return this._options;
}
/**
* Is enabled
*
* @param {boolean | ""} value
*/
@Input('fusePerfectScrollbar')
set enabled(value: boolean | '')
{
// If nothing is provided with the directive (empty string),
// we will take that as a true
if ( value === '' )
{
value = true;
}
// Return, if both values are the same
if ( this.enabled === value )
{
return;
}
// Store the value
this._enabled = value;
// If enabled...
if ( this.enabled )
{
// Init the directive
this._init();
}
else
{
// Otherwise destroy it
this._destroy();
}
}
get enabled(): boolean | ''
{
// Return the enabled status
return this._enabled;
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* After view init
*/
ngAfterViewInit(): void
{
// Check if scrollbars enabled or not from the main config
this._fuseConfigService.config
.pipe(takeUntil(this._unsubscribeAll))
.subscribe(
(settings) => {
this.enabled = settings.customScrollbars;
}
);
// Scroll to the top on every route change
if ( this.fusePerfectScrollbarOptions.updateOnRouteChange )
{
this._router.events
.pipe(
takeUntil(this._unsubscribeAll),
filter(event => event instanceof NavigationEnd)
)
.subscribe(() => {
setTimeout(() => {
this.scrollToTop();
this.update();
}, 0);
});
}
}
/**
* On destroy
*/
ngOnDestroy(): void
{
this._destroy();
// Unsubscribe from all subscriptions
this._unsubscribeAll.next();
this._unsubscribeAll.complete();
}
// -----------------------------------------------------------------------------------------------------
// @ Private methods
// -----------------------------------------------------------------------------------------------------
/**
* Initialize
*
* @private
*/
_init(): void
{
// Return, if already initialized
if ( this.isInitialized )
{
return;
}
// Check if is mobile
if ( this._platform.ANDROID || this._platform.IOS )
{
this.isMobile = true;
}
// Return if it's mobile
if ( this.isMobile )
{
// Return...
return;
}
// Set as initialized
this.isInitialized = true;
// Initialize the perfect-scrollbar
this.ps = new PerfectScrollbar(this.elementRef.nativeElement, {
...this.fusePerfectScrollbarOptions
});
}
/**
* Destroy
*
* @private
*/
_destroy(): void
{
if ( !this.isInitialized || !this.ps )
{
return;
}
// Destroy the perfect-scrollbar
this.ps.destroy();
// Clean up
this.ps = null;
this.isInitialized = false;
}
/**
* Update scrollbars on window resize
*
* @private
*/
@HostListener('window:resize')
_updateOnResize(): void
{
this._debouncedUpdate();
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Document click
*
* @param {Event} event
*/
@HostListener('document:click', ['$event'])
documentClick(event: Event): void
{
if ( !this.isInitialized || !this.ps )
{
return;
}
// Update the scrollbar on document click..
// This isn't the most elegant solution but there is no other way
// of knowing when the contents of the scrollable container changes.
// Therefore, we update scrollbars on every document click.
this.ps.update();
}
/**
* Update the scrollbar
*/
update(): void
{
if ( !this.isInitialized )
{
return;
}
// Update the perfect-scrollbar
this.ps.update();
}
/**
* Destroy the scrollbar
*/
destroy(): void
{
this.ngOnDestroy();
}
/**
* Scroll to X
*
* @param {number} x
* @param {number} speed
*/
scrollToX(x: number, speed?: number): void
{
this.animateScrolling('scrollLeft', x, speed);
}
/**
* Scroll to Y
*
* @param {number} y
* @param {number} speed
*/
scrollToY(y: number, speed?: number): void
{
this.animateScrolling('scrollTop', y, speed);
}
/**
* Scroll to top
*
* @param {number} offset
* @param {number} speed
*/
scrollToTop(offset?: number, speed?: number): void
{
this.animateScrolling('scrollTop', (offset || 0), speed);
}
/**
* Scroll to left
*
* @param {number} offset
* @param {number} speed
*/
scrollToLeft(offset?: number, speed?: number): void
{
this.animateScrolling('scrollLeft', (offset || 0), speed);
}
/**
* Scroll to right
*
* @param {number} offset
* @param {number} speed
*/
scrollToRight(offset?: number, speed?: number): void
{
const width = this.elementRef.nativeElement.scrollWidth;
this.animateScrolling('scrollLeft', width - (offset || 0), speed);
}
/**
* Scroll to bottom
*
* @param {number} offset
* @param {number} speed
*/
scrollToBottom(offset?: number, speed?: number): void
{
const height = this.elementRef.nativeElement.scrollHeight;
this.animateScrolling('scrollTop', height - (offset || 0), speed);
}
/**
* Animate scrolling
*
* @param {string} target
* @param {number} value
* @param {number} speed
*/
animateScrolling(target: string, value: number, speed?: number): void
{
if ( !speed )
{
this.elementRef.nativeElement[target] = value;
// PS has weird event sending order, this is a workaround for that
this.update();
this.update();
}
else if ( value !== this.elementRef.nativeElement[target] )
{
let newValue = 0;
let scrollCount = 0;
let oldTimestamp = performance.now();
let oldValue = this.elementRef.nativeElement[target];
const cosParameter = (oldValue - value) / 2;
const step = (newTimestamp) => {
scrollCount += Math.PI / (speed / (newTimestamp - oldTimestamp));
newValue = Math.round(value + cosParameter + cosParameter * Math.cos(scrollCount));
// Only continue animation if scroll position has not changed
if ( this.elementRef.nativeElement[target] === oldValue )
{
if ( scrollCount >= Math.PI )
{
this.elementRef.nativeElement[target] = value;
// PS has weird event sending order, this is a workaround for that
this.update();
this.update();
}
else
{
this.elementRef.nativeElement[target] = oldValue = newValue;
oldTimestamp = newTimestamp;
window.requestAnimationFrame(step);
}
}
};
window.requestAnimationFrame(step);
}
}
}

28
src/@fuse/fuse.module.ts Normal file
View File

@@ -0,0 +1,28 @@
import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';
import { FUSE_CONFIG } from '@fuse/services/config.service';
@NgModule()
export class FuseModule
{
constructor(@Optional() @SkipSelf() parentModule: FuseModule)
{
if ( parentModule )
{
throw new Error('FuseModule is already loaded. Import it in the AppModule only!');
}
}
static forRoot(config): ModuleWithProviders
{
return {
ngModule : FuseModule,
providers: [
{
provide : FUSE_CONFIG,
useValue: config
}
]
};
}
}

View File

@@ -681,6 +681,7 @@ const matColors = {
}
};
// tslint:disable-next-line
const matPresetColors = [
'#ffebee', '#ffcdd2', '#ef9a9a', '#e57373', '#ef5350', '#f44336', '#e53935', '#d32f2f', '#c62828', '#b71c1c', '#ff8a80', '#ff5252', '#ff1744', '#d50000', '#fce4ec', '#f8bbd0', '#f48fb1', '#f06292', '#ec407a', '#e91e63', '#d81b60', '#c2185b', '#ad1457', '#880e4f', '#ff80ab', '#ff4081', '#f50057', '#c51162', '#f3e5f5', '#e1bee7', '#ce93d8', '#ba68c8', '#ab47bc', '#9c27b0', '#8e24aa', '#7b1fa2', '#6a1b9a', '#4a148c', '#ea80fc', '#e040fb', '#d500f9', '#aa00ff', '#ede7f6', '#d1c4e9', '#b39ddb', '#9575cd', '#7e57c2', '#673ab7', '#5e35b1', '#512da8', '#4527a0', '#311b92', '#b388ff', '#7c4dff', '#651fff', '#6200ea', '#e8eaf6', '#c5cae9', '#9fa8da', '#7986cb', '#5c6bc0', '#3f51b5', '#3949ab', '#303f9f', '#283593', '#1a237e', '#8c9eff', '#536dfe', '#3d5afe', '#304ffe', '#e3f2fd', '#bbdefb', '#90caf9', '#64b5f6', '#42a5f5', '#2196f3', '#1e88e5', '#1976d2', '#1565c0', '#0d47a1', '#82b1ff', '#448aff', '#2979ff', '#2962ff', '#e1f5fe', '#b3e5fc', '#81d4fa', '#4fc3f7', '#29b6f6', '#03a9f4', '#039be5', '#0288d1', '#0277bd', '#01579b', '#80d8ff', '#40c4ff', '#00b0ff', '#0091ea', '#e0f7fa', '#b2ebf2', '#80deea', '#4dd0e1', '#26c6da', '#00bcd4', '#00acc1', '#0097a7', '#00838f', '#006064', '#84ffff', '#18ffff', '#00e5ff', '#00b8d4', '#e0f2f1', '#b2dfdb', '#80cbc4', '#4db6ac', '#26a69a', '#009688', '#00897b', '#00796b', '#00695c', '#004d40', '#a7ffeb', '#64ffda', '#1de9b6', '#00bfa5', '#e8f5e9', '#c8e6c9', '#a5d6a7', '#81c784', '#66bb6a', '#4caf50', '#43a047', '#388e3c', '#2e7d32', '#1b5e20', '#b9f6ca', '#69f0ae', '#00e676', '#00c853', '#f1f8e9', '#dcedc8', '#c5e1a5', '#aed581', '#9ccc65', '#8bc34a', '#7cb342', '#689f38', '#558b2f', '#33691e', '#ccff90', '#b2ff59', '#76ff03', '#64dd17', '#f9fbe7', '#f0f4c3', '#e6ee9c', '#dce775', '#d4e157', '#cddc39', '#c0ca33', '#afb42b', '#9e9d24', '#827717', '#f4ff81', '#eeff41', '#c6ff00', '#aeea00', '#fffde7', '#fff9c4', '#fff59d', '#fff176', '#ffee58', '#ffeb3b', '#fdd835', '#fbc02d', '#f9a825', '#f57f17', '#ffff8d', '#ffff00', '#ffea00', '#ffd600', '#fff8e1', '#ffecb3', '#ffe082', '#ffd54f', '#ffca28', '#ffc107', '#ffb300', '#ffa000', '#ff8f00', '#ff6f00', '#ffe57f', '#ffd740', '#ffc400', '#ffab00', '#fff3e0', '#ffe0b2', '#ffcc80', '#ffb74d', '#ffa726', '#ff9800', '#fb8c00', '#f57c00', '#ef6c00', '#e65100', '#ffd180', '#ffab40', '#ff9100', '#ff6d00', '#fbe9e7', '#ffccbc', '#ffab91', '#ff8a65', '#ff7043', '#ff5722', '#f4511e', '#e64a19', '#d84315', '#bf360c', '#ff9e80', '#ff6e40', '#ff3d00', '#dd2c00', '#efebe9', '#d7ccc8', '#bcaaa4', '#a1887f', '#8d6e63', '#795548', '#6d4c41', '#5d4037', '#4e342e', '#3e2723', '#d7ccc8', '#bcaaa4', '#8d6e63', '#5d4037', '#fafafa', '#f5f5f5', '#eeeeee', '#e0e0e0', '#bdbdbd', '#9e9e9e', '#757575', '#616161', '#424242', '#212121', '#ffffff', '#eeeeee', '#bdbdbd', '#616161', '#eceff1', '#cfd8dc', '#b0bec5', '#90a4ae', '#78909c', '#607d8b', '#546e7a', '#455a64', '#37474f', '#263238', '#cfd8dc', '#b0bec5', '#78909c', '#455a64'
];

View File

@@ -3,7 +3,14 @@ import { Pipe, PipeTransform } from '@angular/core';
@Pipe({name: 'camelCaseToDash'})
export class CamelCaseToDashPipe implements PipeTransform
{
transform(value: string, args: any[] = [])
/**
* Transform
*
* @param {string} value
* @param {any[]} args
* @returns {string}
*/
transform(value: string, args: any[] = []): string
{
return value ? String(value).replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : '';
}

View File

@@ -1,9 +1,17 @@
import { Pipe, PipeTransform } from '@angular/core';
import { FuseUtils } from '../fuseUtils';
import { FuseUtils } from '@fuse/utils';
@Pipe({name: 'filter'})
export class FilterPipe implements PipeTransform
{
/**
* Transform
*
* @param {any[]} mainArr
* @param {string} searchText
* @param {string} property
* @returns {any}
*/
transform(mainArr: any[], searchText: string, property: string): any
{
return FuseUtils.filterArrayByString(mainArr, searchText);

View File

@@ -6,6 +6,14 @@ import { Pipe, PipeTransform } from '@angular/core';
})
export class GetByIdPipe implements PipeTransform
{
/**
* Transform
*
* @param {any[]} value
* @param {number} id
* @param {string} property
* @returns {any}
*/
transform(value: any[], id: number, property: string): any
{
const foundItem = value.find(item => {

View File

@@ -3,7 +3,14 @@ import { Pipe, PipeTransform } from '@angular/core';
@Pipe({name: 'htmlToPlaintext'})
export class HtmlToPlaintextPipe implements PipeTransform
{
transform(value: string, args: any[] = [])
/**
* Transform
*
* @param {string} value
* @param {any[]} args
* @returns {string}
*/
transform(value: string, args: any[] = []): string
{
return value ? String(value).replace(/<[^>]+>/gm, '') : '';
}

Some files were not shown because too many files have changed in this diff Show More