1.5.4 • Published 4 years ago

mwc-components v1.5.4

Weekly downloads
1
License
ISC
Repository
-
Last release
4 years ago

MWC-LOGIN-WIDGET

A web component that can be used in any Framework, built using vue

Motivation

Many teams in Morningstar uses a Sign-in widget in their web internal tools or products. by Using Morningstar Web Components this sign in widget can be used in any framework. With features:

- The Sign in widget supports many Languages as Morningstar is a global company

- The Widget Provides many Options and variation that covers many of Morningstar team's Requirements.  

Code style

This project uses Yarn. Vue cli 3

Usage

supports the following component attributes :

attributetypeDescription
mwc-idRequiredimportant to initiate an mwc instance in window
configOptionalProvide an object with options i.e language `

The provided options within config :

optionDescription
isEmailTo determine the populate email input field or user name field as each has it own validations rules
languageIdTo determine the language needed now it supports en, fr, ar, ch English, French, Arabic, Chinese
logoUrlto user a logo just provide a link for it otherwise it use Morningstar's logo `
resetPasswordUrlif reset password link is preset it will show the 'forget password link' and will redirect to that link when pressed`
errorTextThe component will listen to this field if the consumer changed the errorText from empty to any text it will populate an error message in the form `

After the login submit. it will return an object of

{

    keepUserLoggedIn: true
    password: "rdsfsfds"
    userName: "Rahmo"
    
}

the consumer has to listen to this even signInRequested to get the object from the component

scripts :

$ yarn install

$ yarn build-component //it creates the dist for the component with demo

Make sure you modify the Demo.html with the parameter to load the page

$ open dist/demo.html

run local development

yarn serve

Screenshots

The sign-in in English Language

Screenshot

The sign-in in Arabic Language

Screenshot

Links

Repository

mswiki

design chart

Requirements

  • VueJS
  • Web Components Polyfills

    Dependency scripts

    Those scripts needed for IE

Demo

<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/@webcomponents/webcomponentsjs"></script>
<script src="./mwc-login.js"></script>


<mwc-login
        mwc-id="login-container"
        config="{
                    &quot;settings&quot;:
                        {
                        &quot;useEmail&quot;:false,
                        &quot;languageId&quot;:&quot;en&quot;,
                        &quot;errorText&quot;:&quot;&quot;,
                        &quot;resetPasswordUrl&quot;:&quot;https://access.lim.com/authws/pages/pw_reset.jsp&quot;
                        }
                    }"
></mwc-login>

Task Lists

  • Use a CSS naming Methodology, like BEM
  • add tests for 'Forget Password' link

Project setup

yarn install

Lints and fixes files

yarn run lint

Run your unit tests

yarn run test:unit

using it for existing Apps

//At the bottom of Main.js

window.Vue = Vue;
let GlobalVue = null;
if (typeof window !== 'undefined') {
  GlobalVue = window.Vue;
} else if (typeof global !== 'undefined') {
  GlobalVue = global.Vue;
}
if (GlobalVue) {
  import('mwc-components/dist/mwc-login');
}

Customize configuration

See Configuration Reference.

1.5.4

4 years ago

1.5.3

5 years ago

1.5.2

5 years ago

1.5.1

5 years ago

1.4.9

5 years ago

1.4.8

5 years ago

1.4.7

5 years ago

1.4.6

5 years ago

1.4.5

5 years ago

1.4.4

5 years ago

1.4.3

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.9

5 years ago

1.3.8

5 years ago

1.3.7

5 years ago

1.3.6

5 years ago

1.3.5

5 years ago

1.3.4

5 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.9

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.0.0

5 years ago