1.0.3 • Published 1 year ago

ups-lil-ui-components-vue2 v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

ups-lil-ui-components-vue2

Lil ui library with customazable inputs, icon loader and modal notification

  • 💡Intuitive
  • 🔧Customazible
  • 🪶Lighweight
  • ✨Beauty design

Installation

npm

# or yarn
npm install --save ups-lil-ui-components-vue2

yarn

yarn add ups-lil-ui-components-vue2

Usage

Example of importing component and css file:

import { InputIIN } from "ups-lil-ui-components-vue2/dist/ups-lil-ui-components.common";
import "ups-lil-ui-components-vue2/dist/ups-lil-ui-components.css";

Components

List of all components:

ComponentDescription
FormInputCustomizable input component
VueTooltipTooltip component
IconBaseBase component to load icons
CodeInputVerification code input component
BaseTransitionTransition using css opacity
SlideTransitionTransition using css opacity and translateY
UserDividerComponent for user divider
DefaultAlertModal alert window component
appAlertStore object for DefaultAlert component

Inputs

List of all inputs components:

ComponentDescription
InputAccAccount input component
InputBikBank Identification Code (BIK) input component
InputBinBusiness Identification Number (BIN) input component
InputEmailEmail input component
InputFIOFull name input component
InputIINIndividual Identification Number (IIN) input component
InputKbeBank Entity Code (KBE) input component
InputPhonePhone number input component
InputPhoneLoginPhone number login input component
InputTariffTariff input component

Usage:

<InputIIN v-model="iin"></InputIIN>

Custom Input

<template>
  <FormInput
    v-model="inputValue"
    title="Input Title"
    :max="30"
    :min="1"
    warningMsg="Warning Message"
    tooltipMsg="Tooltip Message"
    rule="^[0-9А-Яа-я\\-\\s]+$"
    warningFlag="true"
    sintax="^[0-9А-Яа-я\\-\\s]$"
    :capitalize="true"
    :column="false"
    :decimal="false"
    placeholder="Placeholder Text"
    :mobile="false"
  />
</template>

<script>
import { FormInput } from "ups-lil-ui-components-vue2/dist/ups-lil-ui-components.common";

export default {
  components: {
    FormInput,
  },
  data() {
    return {
      inputValue: "",
    };
  },
};
</script>
PropTypeDefault ValueDescription
valueStringThe value of the input field (v-model)
titleStringTitle for the input field
maxNumber30Maximum character limit for the input field
minNumber1Minimum character limit for the input field
warningMsgStringWarning message to display when input is invalid
tooltipMsgStringTooltip message to display
ruleString"^0-9А-Яа-я\-\s+$"Regular expression rule for input validation
warningFlagBooleanfalseFlag to enable warning message display
sintaxString"^0-9А-Яа-я\-\s$"Regular expression for character validation
capitalizeBooleanfalseFlag to capitalize input text
columnBooleanfalseFlag to enable column layout
decimalBooleanfalseFlag to allow decimal input
placeholderStringPlaceholder text for the input field
mobileBooleanfalseFlag to enable mobile-specific input features
Event NameData TypeDescription
inputStringEmits the updated input value whenever the input changes.
validBooleanEmits a boolean indicating whether the input is valid or not.

Modal alert window:

<DefaultAlert
    text="This is an alert"
    alert-type="warning"
    :use-store="false"
    :is-clicked="isClicked"
    @update:is-clicked="isClicked = false">
</DefaultAlert>
PropTypeDefault ValueDescription
alert-typeString"info"Type of the alert (info, warning, error, success)
useStoreBooleantrueIndicates whether to use store
color-infoString"#2585EE"Color for info alerts
color-warningString"#FFCF40"Color for warning alerts
color-errorString"#F2363B"Color for error alerts
color-successString"#22C993"Color for success alerts
isClickedBooleanfalseIndicates if the alert has been clicked
alert-textString"This is an alert"Text content of the alert
wideBooleanfalseIndicates if the alert should be wide

Use event below to close modal window without store

Event NameData TypeDescription
update:is-clickedBooleanEmits an event to update is-clicked prop

if u want to use store to call DefaultAlert u need additional import:

import Vue from "vue";
import Vuex from "vuex";

import appAlert from "ups-lil-ui-components-vue2/dist/ups-lil-ui-components.common";

Vue.use(Vuex);

export const store = new Vuex.Store({
  modules: {
    alert: appAlert,
  },
});

Then u can use it like this:

methods: {
    callAlert(text, type) {
        var alert = {
            text: "",
            type: null,
        };
        alert.text = text;
        alert.type = type;
        this.$store.commit("clickAlertWide", true);
        this.$store.commit("setMessage", alert);
    },
    onBtnClick() {
        this.callAlert("Buttn clicked!", "info")
    }
}
1.0.2

1 year ago

1.0.1

1 year ago

1.0.3

1 year ago

1.0.0

1 year ago