Tile Demo

Play with AngularJS to get dynamic a modern component.

Checkbox case

<form method="post" asp-controller="Home" asp-action="Demo">
    <div ng-controller="DemoCheckController as DemoCheckCtrl">
        <h4>Checkbox case</h4>
        <div class="mw-tiles mw-theme-light">
            <div class="mw-tile mw-medium" ng-class="{'mw-checked': checkValue}" ng-click="DemoCheckCtrl.Toggle();">
                <input type="checkbox" asp-for="checkValue" hidden ng-model="checkValue" />
            </div>
        </div>
    </div>
    <input type="submit" value="Send" />
</form>
module Demo {
    'use strict';
    export interface IDemoCheckScope extends ng.IScope {
        checkValue: boolean;
    }
    
/* ==========================================================================
    DemoCheckController
    ========================================================================== */
    export class DemoCheckController {
        private scope: IDemoCheckScope;
        static $inject = ['$scope', '$element'];
        public constructor($scope: IDemoCheckScope, $element: JQuery) {
            this.scope = $scope;
        }
        public Toggle(): void {
            this.scope.checkValue = !this.scope.checkValue;
        }
    }
}

RadioBox case

A
B
C
<form method="post" asp-controller="Home" asp-action="Demo">
    <div ng-controller="DemoRadioController as DemoRadioCtrl">
        <h4>RadioBox case</h4>
        <div class="mw-tiles mw-theme-light">
            <div class="mw-tile mw-medium" ng-class="{'mw-checked': radioValue === 0}" ng-click="radioValue = 0">
                <div class="mw-tile">A</div>
                <input type="radio" asp-for="radioValue" value="0" ng-model="radioValue" />
            </div>
            <div class="mw-tile mw-medium" ng-class="{'mw-checked': radioValue === 1}" ng-click="radioValue = 1">
                <div class="mw-tile">B</div>
                <input type="radio" asp-for="radioValue" value="1" ng-model="radioValue" />
            </div>
            <div class="mw-tile mw-medium" ng-class="{'mw-checked': radioValue === 2}" ng-click="radioValue = 2">
                <div class="mw-tile">C</div>
                <input type="radio" asp-for="radioValue" value="2" ng-model="radioValue" />
            </div>
        </div>
    </div>
    <input type="submit" value="Send" />
</form>
module Demo {
    'use strict';
    export enum RadioEnum {
        A = 0,
        B = 1,
        C = 2
    }
    export interface IDemoRadioScope extends ng.IScope {
        radioValue: RadioEnum;
    }
/* ==========================================================================
    DemoRadioController
    ========================================================================== */
    export class DemoRadioController {
        private scope: IDemoRadioScope;
        static $inject = ['$scope', '$element'];
        public constructor($scope: IDemoRadioScope, $element: JQuery) {
            this.scope = $scope;
            this.scope.radioValue = RadioEnum.A;
        }
    }
}

Animate Number

The Animate Number, the component to animate the numbers.

To create a animate number, you must add a mw-animate-number directive.
You can customize your animate number with theses options : delay, number, sign, unit.
To customize your animate number, you must set these options in a parent scope.
Use the interface ModernWeb.IAnimateNumberModel to set options available.

Option Type Default Description
delay number 2500

This option defines the delay to reach the number setted of your mw-animate-number.

number number 100

This option defines the number value to reach of your mw-animate-number.

sign string null This option defines the sign.
unit string null This option defines the unit.

You can interact dynamically with the directive mw-animate-number.
Check the directive definition scope to learn more.

<div ng-controller="DemoAnimateNumberController as DemoAnimateNumberCtrl">
    <mw-animate-number>
    </mw-animate-number>
    <button type="button" class="btn btn-default" ng-click="DemoAnimateNumberCtrl.Animate()">Animate</button>
    <button type="button" class="btn btn-default" ng-click="DemoAnimateNumberCtrl.Reset()">Reset</button>
    <input id="animateNumberDelay" type="number" min="0" class="form-control" placeholder="3000" ng-model="delay">
    <input id="animateNumberNumber" type="number" min="0" class="form-control" placeholder="200" ng-model="number">
</div>
module Demo {
    'use strict';
/* ==========================================================================
    DemoAnimateNumberController
    ========================================================================== */
    export class DemoAnimateNumberController extends ModernWeb.Controllers.AnimateNumberController {
        static $inject = ['$scope', '$window', '$interval'];
        public constructor($scope: ModernWeb.IAnimateNumberScope, $window: ng.IWindowService, $interval: ng.IIntervalService) {
            super($scope, $window, $interval);
            ($scope).delay = 750;
            ($scope).number = 225;
            ($scope).sign = "+";
            ($scope).unit = "K";
            // Comment this line to trigger the animation on event or action.
            this.Animate();
            // Uncomment this line to trigger the animation on window scroll event
            //this.AttachEventOnWindowScroll($element);
        }
    }
}

Progress Bar

The Progress bar, the component to show a loading.

To create a progress bar, you must add a mw-progress directive and then you must add inside a mw-progress-bar.
You can customize your progress bar with theses options : min, max, initial value.
To customize your progress bar, you must set these options in a parent scope.
Use the interface ModernWeb.IProgressBarModel to set options available.

Option Type Default Description
min number 0

This option defines the minimum value of your mw-progress-bar.

max number 100

This option defines the maximum value of your mw-progress-bar.

value number 0 This option defines the initial value of your progressing.

You can interact dynamically with the directive mw-progress-bar.
Check the interface ModernWeb.IProgressBarScope to learn more.

{{percentage}} %
<div ng-controller="DemoProgressBarController as DemoProgressBarCtrl">
    <mw-progress>
        <mw-progress-bar class="progress-bar-warning progress-bar-striped">
            { {percentage} } %
        </mw-progress-bar>
    </mw-progress>
    <input type="number" min="{{min}}" max="{{max}}" ng-model="value" />
</div>
module Demo {
    'use strict';
/* ==========================================================================
    DemoProgressBarController
    ========================================================================== */
    export class DemoProgressBarController extends ModernWeb.Controllers.ProgressBarController {
        static $inject = ['$scope', '$element'];
        public constructor($scope: ModernWeb.IProgressBarScope, $element: JQuery) {
            super($scope, $element);
            (<ModernWeb.IProgressBarModel>$scope).min = 0;
            (<ModernWeb.IProgressBarModel>$scope).max = 100;
            (<ModernWeb.IProgressBarModel>$scope).value = 75;
        }
    }
}

Progress Bar CSS Animated

The Progress css animated, the component to show a loading animated by CSS.

To create a progress css animated, you must add amw-progress directive and then you must add inside a mw-progress-bar-animated.
You can customize your progress css animated with these option : delay.
To customize your progress css animated, you must set these option in a parent scope.
Use the interface ModernWeb.IProgressBarAnimatedModel to set options available.

Option Type Default Description
delay number 3500

This option defines the delay of loading for a cycle.

You can interact dynamically with the directive mw-progress-css.
Check the interface ModernWeb.IProgressBarAnimatedScope to learn more.

<div ng-controller="DemoProgressBarAnimatedController as DemoProgressBarAnimatedCtrl">
    <mw-progress>
        <mw-progress-bar-animated class="progress-bar-success"></mw-progress-bar-animated>
    </mw-progress>
    <button type="button" class="btn btn-default" ng-click="DemoProgressBarAnimatedCtrl.Play()">Play</button>
    <button type="button" class="btn btn-default" ng-click="DemoProgressBarAnimatedCtrl.Pause()">Pause</button>
    <button type="button" class="btn btn-default" ng-click="DemoProgressBarAnimatedCtrl.Stop()">Stop</button>
    <input type="number" min="0" class="form-control" placeholder="3000" ng-model="delay">
</div>
module Demo {
    'use strict';

/* ==========================================================================
    DemoProgressBarAnimatedController
    ========================================================================== */
    export class DemoProgressBarAnimatedController extends ModernWeb.Controllers.ProgressBarAnimatedController {
        static $inject = ['$scope', '$element'];

        public constructor($scope: ModernWeb.IProgressBarAnimatedScope, $element: JQuery) {
            super($scope, $element);
            (<ModernWeb.IProgressBarAnimatedModel>$scope).delay = 1500;
        }
    }
}

Carousel

The carousel, the component to play a dynamic slideshow.

To create a carousel, you must add the directive mw-carousel.
To add a slide inside your mw-carousel, you must add the directive mw-slide inside your carousel.
You can customize your carousel with theses options : Delay, PlayType, PlayDirection, IsAnimated, IsReverseAnimated.
To customize your carousel, you must set these options in a parent scope.

The trigger previous/next/goTo stop the carousel

If your carousel is automatic and you press the previous, next or one indicator goTo, it will stop to play the carousel.
To restart your carousel, you should add a ng-leave="CarouselCtrl.Play()" on your mw-carousel.

Option Type Default Description
delay number 4500

This option defines the delay between each transition.

playType enum PlayType.Automatic

This option defines the type of carousel.
You can choose a type in this list; Automatic | 0, Manual | 1.
PlayType enum is defined in ModernWeb rootscope.

playDirection enum PlayDirection.Ascending This option defines the direction of carousel.
You can choose a direction in this list; Ascending | 0, Descending | 1.
PlayDirection enum is defined in ModernWeb rootscope.
isAnimated boolean true This option defines if an animation is played for each transition.
isReverseAnimated boolean true This option defines if the animation must be inversed when a previous action is triggered.
image header

I design and develop Websites

image header

I craft Mobile applications

image header

I build Web applications

<div ng-controller="DemoCarouselController as DemoCarouselCtrl">
    <mw-carousel class="carousel-example" ng-mouseenter="CarouselCtrl.Pause()" ng-mouseleave="CarouselCtrl.Play()" ng-swipe-right="CarouselCtrl.Prev()" ng-swipe-left="CarouselCtrl.Next()">
        <!-- Slide 1 -->
        <mw-slide class="mw-push-left" slide="slides[0]">
            <!-- slide inner -->
        </mw-slide>
        <!-- Slide 2 -->
        <mw-slide class="mw-push-left" slide="slides[1]">
            <!-- slide inner -->
        </mw-slide>
        <!-- Slide 3 -->
        <mw-slide class="mw-push-left" slide="slides[2]">
            <!-- slide inner -->
        </mw-slide>
    </mw-carousel>
</div>
.carousel-example {
    width: 100%; 
    height: 425px;
}
.carousel-example .mw-slide{
    text-align: center;
}
.carousel-example figure{
    margin: 20px;
    height: 250px;
}
.carousel-example img {
    max-height: 250px;
}
module Demo {
    'use strict';
/* ==========================================================================
    DemoCarouselController
    ========================================================================== */
    export class DemoCarouselController {
        public constructor($scope: ModernWeb.ICarouselScope) {
            ($scope).delay = 3250;
            ($scope).playType = ModernWeb.PlayType.Automatic;
            ($scope).playDirection = ModernWeb.PlayDirection.Ascending;
            ($scope).isAnimated = true;
            ($scope).isReverseAnimated = true;
        }
    }
}

You can interact dynamically with the directive mw-carousel.
Check the interface ModernWeb.Controllers.ICarouselController to know what methods are accessibles.

image header

I design and develop Websites

image header

I craft Mobile applications

image header

I build Web applications

<div class="options">
        <div class="option">
            <label>Action</label>
            <div class="btn-group" role="group" style="width: 100%">
                <button type="button" class="btn btn-default" ng-click="CarouselCtrl.Play()">Play</button>
                <button type="button" class="btn btn-default" ng-click="CarouselCtrl.Pause()">Pause</button>
                <button type="button" class="btn btn-default" ng-click="CarouselCtrl.Stop()">Stop</button>
            </div>
        </div>
        <div class="option">
            <label for="carouselDelay">Delay</label>
            <input type="number" min="0" class="form-control" id="carouselDelay" placeholder="3000" ng-model="delay">
        </div>
        <div class="option">
            <label for="carouselType">Type</label>
            <label><input type="radio" name="carouselType" value="{{PlayType.Automatic}}" ng-model="playType" /> Automatic</label>
            <label><input type="radio" name="carouselType" value="{{PlayType.Manual}}" ng-model="playType" /> Manual</label>
        </div>
    </div>
</div>

Dialog

The dialog, the component to show a pop up.

To create a dialog, you must add the directive mw-dialog.

The id attribut is needed

You must set the id attribut on your mw-dialog directive.
This is is used as key to register the dialog in the dialogService.

Option Type Default Description
id string null

This option defines the id of mw-dialog.

<div ng-controller="DemoDialogController as DemoDialogCtrl">
    <mw-dialog id="demoDialog1">
        <div class="modal" role="dialog">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" ng-click="DemoDialogCtrl.Close()" aria-label="Close"><span aria-hidden="true">×</span></button>
                        <h4 class="modal-title">Modal title</h4>
                    </div>
                    <div class="modal-body">
                        <p>One fine body…</p>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" ng-click="DemoDialogCtrl.Close()">Close</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->
    </mw-dialog>
</div>
<div ng-controller="DemoDialogController as DemoDialogCtrl">
    <div class="btn-group" role="group" style="width: 100%; z-index: 9999;">
        <button type="button" class="btn btn-default" ng-click="DemoDialogCtrl.Open()">Open</button>
        <button type="button" class="btn btn-default" ng-click="DemoDialogCtrl.Close()">Close</button>
    </div>
</div>
module Demo {
    'use strict';
/* ==========================================================================
    DemoDialogController
    ========================================================================== */
    export class DemoDialogController extends ModernWeb.Controllers.DialogController {
        static $inject = ['$scope', 'dialogService'];
        public constructor($scope: ModernWeb.IDialogScope, dialogService: ModernWeb.Services.DialogService) {
            super($scope, dialogService);
            (<ModernWeb.IDialogModel>$scope).id = "demoDialog1";
        }
    }
}

Remote Dialog

The Remote dialog, the component to load and inject a remote template.

To create a remote dialog, you must add a template and then, use RemoteDialogController.

Section title

Article title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur mollis et massa at commodo. Cras purus odio, suscipit eu facilisis in, facilisis sit amet tortor. Aenean faucibus blandit magna nec pharetra. Nam in ante felis. Nullam blandit rhoncus massa, sed porttitor turpis molestie in. Duis volutpat, ante ut molestie pulvinar, felis justo dapibus odio, eu euismod ante ligula ut nulla. Quisque sagittis a nisl quis euismod. Proin suscipit quam sit amet egestas ullamcorper.

Vestibulum accumsan congue sapien, vel ultrices augue imperdiet eu. Maecenas ut dui sed nisi pulvinar finibus id ac sem. Sed consectetur metus non lacus laoreet eleifend. Mauris ut odio enim. Fusce ut turpis consectetur, sollicitudin arcu quis, porttitor elit. In ultricies, nibh sed euismod imperdiet, est elit lacinia purus, in pharetra libero mauris at tortor. Proin a faucibus felis, eget efficitur lorem. Sed sollicitudin lobortis libero vitae placerat. Mauris interdum sed justo eu ullamcorper. Pellentesque suscipit scelerisque magna fermentum cursus. Vestibulum aliquet commodo eros, sed tristique magna fermentum volutpat.


<section id="demoRemoteDialogSection">
    <h2>Section title</h2>
    <article>
        <h4>Article title</h4>
        <p>
            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur mollis et massa at commodo. Cras purus odio, suscipit eu facilisis in, facilisis sit amet tortor. Aenean faucibus blandit magna nec pharetra. Nam in ante felis. Nullam blandit rhoncus massa, sed porttitor turpis molestie in. Duis volutpat, ante ut molestie pulvinar, felis justo dapibus odio, eu euismod ante ligula ut nulla. Quisque sagittis a nisl quis euismod. Proin suscipit quam sit amet egestas ullamcorper.
        </p>
        <p>
            Vestibulum accumsan congue sapien, vel ultrices augue imperdiet eu. Maecenas ut dui sed nisi pulvinar finibus id ac sem. Sed consectetur metus non lacus laoreet eleifend. Mauris ut odio enim. Fusce ut turpis consectetur, sollicitudin arcu quis, porttitor elit. In ultricies, nibh sed euismod imperdiet, est elit lacinia purus, in pharetra libero mauris at tortor. Proin a faucibus felis, eget efficitur lorem. Sed sollicitudin lobortis libero vitae placerat. Mauris interdum sed justo eu ullamcorper. Pellentesque suscipit scelerisque magna fermentum cursus. Vestibulum aliquet commodo eros, sed tristique magna fermentum volutpat.
        </p>
    </article>
    <div ng-controller="DemoRemoteDialogController as RemoteDialogCtrl">
        <button type="button" class="btn btn-primary" ng-click="RemoteDialogCtrl.After()">Insert After</button>
        <br />
        <button type="button" class="btn btn-default" ng-click="RemoteDialogCtrl.Before()">Insert Before</button>
    </div>
</section>
<!-- template located in '/lib/modernWeb/templates/Demo/RemoteDialog.html'-->
<div id="{{id}}" ng-show="isOpen">
    <h2>Remote Dialog</h2>
    <div>
        <p>
            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur mollis et massa at commodo. Cras purus odio, suscipit eu facilisis in, facilisis sit amet tortor. Aenean faucibus blandit magna nec pharetra. Nam in ante felis. Nullam blandit rhoncus massa, sed porttitor turpis molestie in. Duis volutpat, ante ut molestie pulvinar, felis justo dapibus odio, eu euismod ante ligula ut nulla. Quisque sagittis a nisl quis euismod. Proin suscipit quam sit amet egestas ullamcorper.
        </p>
        <div>
            <button type="button" ng-click="close()">Close</button>
        </div>
    </div>
</div>
module Demo {
    'use strict';
/* ==========================================================================
    DemoDialogInsertedController
    ========================================================================== */
    export class DemoRemoteDialogController extends ModernWeb.Controllers.RemoteDialogController {
        static $inject = ['$scope', '$element', 'dialogService', '$templateRequest', '$compile'];
        public constructor($scope: ModernWeb.IRemoteDialogScope, $element: JQuery, dialogService: ModernWeb.Services.DialogService, $templateRequest: ng.ITemplateRequestService, $compile: ng.ICompileService) {
            super($scope, $element, dialogService, $templateRequest, $compile);
            
            ($scope).id = "demoRemoteDialog";
            ($scope).templateUrl = '/lib/modernWeb/templates/Demo/RemoteDialog.html';
            ($scope).elementTarget = $("#demoRemoteDialogSection");
        }
    }
}

Grid

The Grid, the best way to view and handle large amount of data.

Option Type Default Description
template-url string /lib/modernWeb/templates/Grid/Grid.html

This option defines the url of grid template.

url string undefined

This option defines the OData url WebService to request data.
This option is mandatory.

sortable boolean false

This option gives a sortable behavior (UI arrows controls)

filterable boolean false

This option gives a searchable behavior (UI searchbar).

selectable boolean false

This option gives a selectable bahavior (UI checkBox).

pagination
object 
{
    pageSizes: Array<number>, 
    indexPagesSizes: number, 
    range: number
}
{
    pageSizes: 10, 
    range: 5
}
  • pageSizes : defines the number of item per page.
  • indexPageSizes : defines the default index of pageSizes array.
  • range : defines the number pages in pagination.
columns
object 
{
    field: string, 
    title: string, 
    isSortable: boolean, 
    isFiltrable: boolean, 
    isEditable: boolean, 
    isPrimaryKey: boolean, 
    type: string
}
{}

defines options per column :

  • field : defines the data name of the column for the WS.
  • title : defines the display name of the column.
  • isSortable : defines if the column is sortable.
  • isFiltrable : defines if the column is filtrable.
  • isEditable : defines if the column is editable.
  • isPrimaryKey : defines if the column is the primary key. This option is mandatory for the update.
  • type : [Int32|String|Boolean|Single|DateTime] defines the data type. This option is mandatory for the search
<mw-grid template-url="/templates/Grid/Grid.html"
         url="http://localhost:27806/odata/Characters"
         sortable="true"
         filterable="true"
         selectable="true"
         pagination='{
                pageSizes: [0,5,10,20],
                indexPageSizes: 2,
                range: 5
             }'
         columns='[{
                field: "Id",
                title: "Id",
                isSortable: true,
                isFiltrable: true,
                isEditable: false,
                isPrimaryKey: true,
                type: "Int32"
             },
             {
                field: "Name",
                title: "Name",
                isSortable: true,
                isFiltrable: true,
                isEditable: true,
                type: "String"
             }]'>
    </mw-grid>

Wizard

The wizard, the component to handle multi step form.

To create a wizard, you must add the directive mw-wizard.
To add a step inside your mw-wizard, you must add the directive mw-step inside your carousel.

The mw-wizard is a form

You must keep in mind that the directive mw-wizard is an Html Form.

Option Type Default Description
valid () => boolean () => { return true; }

This function is called to determined if the step is valid or not (in memory).
The valid function is trigerred on Next and Select function called.

validate () => void () => { return; }

This function is called to trigger the validation (in view).
The validate function is trigerred on Next and Select function called.

Wizard Demo

Step 1 - Product Info

Microsoft Lumia 950

High-end features, premium design, and the best Windows 10 experience – unleash the potential of your digital life with a powerful smartphone.

  • 5.2” Quad HD
    AMOLED, 2560 x 1440
  • Qualcomm® Snapdragon ™ 808
    1.8 GHz hexa-core
  • 20 MP sensor
    Triple LED natural flash, ZEISS optics
Price: $549.00
Microsoft Lumia 950

Wizard Demo

Step 2 - Personal Info

Status
Private
Corporate
Name
The field Name is required.
Credit Card
The field card number is required.

Wizard Demo

Step 3 - Confirmation

Cart
Product Quantity Price
Microsoft Lumia 950 thumb Microsoft Lumia 950 1 $549.00
Shipping
Total
$549.00
<div ng-controller="DemoWizardController as DemoWizardCtrl">
    <form class="wizard-example" method="post" asp-controller="Home" asp-action="Lab" ng-submit="DemoWizardCtrl.Submit($event)" novalidate>
        <mw-wizard class="wizard-example" ng-style="{'left': 'calc(' + (-1 * currentIndex) + ' * 35px)'}">
            <mw-step step="steps[0]" valid="DemoWizardCtrl.ValidStep1();" validate="DemoWizardCtrl.ValidateStep1();">
                <!-- step inner -->
            </mw-step>
            <mw-step step="steps[1]" valid="DemoWizardCtrl.ValidStep2();" validate="DemoWizardCtrl.ValidateStep2();">
                <!-- step inner -->
            </mw-step>
            <mw-step step="steps[2]" valid="DemoWizardCtrl.ValidStep3();" validate="DemoWizardCtrl.ValidateStep3();">
                <!-- step inner -->
            </mw-step>
        </mw-wizard>
    </form>
</div>
module Demo {
    'use strict';

/* ==========================================================================
    Interface
    ========================================================================== */
    export interface IDemoWizardScope extends ng.IScope {
        demoForm: IDemoFormController;
    }

    export interface IDemoFormController extends ng.IFormController {
        customerName: ng.INgModelController;
        customerCardNumber: ng.INgModelController;
    }

/* ==========================================================================
    DemoWizardController
    ========================================================================== */
    export class DemoWizardController {
        protected scope: IDemoWizardScope;
        static $inject = ['$scope', '$element'];

        public constructor($scope: IDemoWizardScope, $element: JQuery) {
            this.scope = $scope;
        }

        public ValidStep1(): boolean {
            return true;
        }

        public ValidStep2(): boolean {
            return this.scope.demoForm.customerName.$valid && this.scope.demoForm.customerCardNumber.$valid;
        }

        public ValidStep3(): boolean {
            return true;
        }
        
        public ValidateStep1(): void {
            alert("Validate step 1");
        }

        public ValidateStep2(): void {
            this.scope.demoForm.customerName.$validate();
            this.scope.demoForm.customerCardNumber.$validate();
            this.scope.demoForm.customerName.$setDirty();
            this.scope.demoForm.customerCardNumber.$setDirty();
            alert("Validate step 2");
        }

        public ValidateStep3(): void {
            alert("Validate step 3");
        }

        public Submit($event: Event): void {
            $event.preventDefault();
            alert("Form submitted from DemoWizardController Submit($event) function");
        }
    }
}