0.4.48 • Published 11 months ago

@fantasyclub/fc-components v0.4.48

Weekly downloads
-
License
-
Repository
-
Last release
11 months ago

fc-components

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Lints and fixes files

npm run lint

Customize configuration

See Configuration Reference.

Integration with fc-ui-portal

Develop fc-components locally with fc-ui-portal

  1. Ensure that a local volume of fc-components is enabled in the fc-ui-portal docker-compose.yaml file.
    volumes:
       - .:/app
       - ../fc-components:/app/node_modules/@fantasyclub/fc-components
  2. Restart the fc-ui-portal development server.
  3. To make local changes in fc-components effective in fc-ui-portal, run the command make build from within the fc-components directory.

Integrate local changes for production

fc-components

  1. Ensure that all local changes are saved.
  2. Run the command git add -A to stage all local changes.
  3. Run the command git commit -m "<Your commit message here>" to commit all local changes.
  4. Run the command make publish to build the library for production and increment the version number.
  5. The new version number will be displayed in the package.json file (take note of this new version number).
    "version": "0.4.33"
  6. Run the command git push origin <branch name>.
  7. Merge your branch into master on Gitlab.

fc-ui-portal

  1. Comment out the local volume in the docker-compose.yaml file.
    volumes:
       - .:/app
       #- ../fc-components:/app/node_modules/@fantasyclub/fc-components
  2. Upgrade the fc-components npm package by running the command npm install @fantasyclub/fc-components@<version>, where version is the new version number of fc-components that was merged to master (e.g. npm install @fantasyclub/fc-components@0.4.33).
  3. Restart the development server and ensure that all changes that were made in the local environment are reflected in the newly upgraded fc-components npm package.

API Reference

Input Chip Input Button Snackbar Alert

Input (fc-input)

input

input in error state

<fc-input
  :type="showPassword ? 'text' : 'password'"
  name="password"
  placeholder="Enter your Password"
  label="Password"
  :icon="showPassword ? 'eye-slash' : 'eye'"
  v-model="form.password"
  @clickIcon="showPassword = !showPassword"
/>

Props

NameTypeDefaultDescription
labelStringN/Ainput label
placeholderStringN/Ainput placeholder
typeStringtextany valid input type
autocompleteStringN/Aany valid autocomplete attribute
idStringN/Ainput id
disabledBooleanfalsedisables the input
readonlyBooleanfalsemakes the input readonly
iconStringN/Aany valid font-awesome icon name
hintStringN/Adislpayed underneath the input, is hidden if the input is in an error state
nameStringN/Ainput name, required
errorBooleanfalseputs the input in an error state, and displays the errorMessage prop
errorMessageStringN/AReplaces hint text when the input is in an error state. If the errorMessage is not an empty string, the input will be thrown into an error state.

Slots

NameDescription
iconUsed in lieu of the icon prop, can be any valid font-awesome icon.
labelUsed in lieu of the lablel prop.
errorMessageUsed in lieu of the errorMessage prop, will be displayed only if the input is in an error state.
hintUsed in lieu of the hint prop, will display beneath the input. Replaced by the errorMessage prop/slot if the input is in an error state.

Events

NameDescription
clickIconemits a click event on the input icon (only applies to prop icons, not slotted icons).

Chip Input (fc-chip-input)

buttons

<fc-chip-input
  v-model="chips"
  label="Tags"
  hint="Enter the tags that best describe you"
  placeholder="Tag Name"
/>

Props

NameTypeDefaultDescription
labelStringDefault Labellabel for the chip input
placeholderStringN/Aplaceholder for the chip input
hintStringN/Ahint (bottom text) for the chip input
maxLengthNumber20max character length for each chip
customDelimitersArray key codes for custom keyboard events that create a new chip and reset the input value to an empty string. Key codes for all keys can be found here

Slots

NameDescription
hintUsed in lieu of the hint prop, will display beneath the input.

Additional Information

  • This input must v-model an Array
  • The default delimiters for this input are the following keys: Enter, Space, ,, and #
  • All chips are automatically prepended with a # character. If the input value starts with a #, this rendundant character will be removed.

Button (fc-btn)

buttons

<fc-btn type="submit" :loading="loading" :disabled="disabled" lg>
    Sign In
</fc-btn>

Props

NameTypeDefaultDescription
typeStringbuttonbutton type
smBooleanfalsedecreases button size
lgBooleanfalseincreases button size
secondaryBooleanfalseremoves background, adds a thin border
tertiaryBooleanfalseremoves background and border
disabledBooleanfalsedisables the button
loadingBooleanfalsehides text and displays a loading spinner

Snackbar (fc-snackbar)

buttons

<fc-snackbar v-model="confirmation" type="info" message="Information updated" />

Props

NameTypeDefaultDescription
messageStringN/Athe message to be displayed
timeoutString or Number2000allows for a custom timeout to wait until snackbar is automatically hidden.

Slots

NameDescription
messageUsed in lieu of the message prop.

Alert (fc-alert)

alert

<fc-alert
  v-if="!error"
  class="my-5"
  message="This is an alert"
/>

Props

NameTypeDefaultDescription
messageStringN/Athe alert message to be displayed

Slots

NameDescription
messageUsed in lieu of the message prop.
0.4.48

11 months ago

0.4.47

11 months ago

0.4.46

2 years ago

0.4.45

2 years ago

0.4.42

2 years ago

0.4.43

2 years ago

0.4.40

2 years ago

0.4.41

2 years ago

0.4.44

2 years ago

0.4.39

2 years ago

0.4.37

2 years ago

0.4.38

2 years ago

0.4.28

2 years ago

0.4.29

2 years ago

0.4.26

2 years ago

0.4.27

2 years ago

0.4.31

2 years ago

0.4.32

2 years ago

0.4.30

2 years ago

0.4.35

2 years ago

0.4.36

2 years ago

0.4.33

2 years ago

0.4.34

2 years ago

0.4.25

2 years ago

0.4.24

2 years ago

0.4.23

2 years ago

0.4.22

2 years ago

0.4.21

2 years ago

0.4.20

2 years ago

0.4.19

2 years ago

0.4.18

2 years ago

0.4.17

2 years ago

0.4.16

2 years ago

0.4.15

2 years ago

0.4.14

2 years ago

0.4.12

2 years ago

0.4.11

2 years ago

0.4.8

2 years ago

0.4.7

2 years ago

0.4.4

2 years ago

0.4.2

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago