1.0.1-rc.18 • Published 4 years ago

@apok/admin-components-bootstrap v1.0.1-rc.18

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

Apok-admin-components-bootstrap

The Bootstrap Styled Components for Apok-admin vue plugin

Table of Contents

Installation

When installing Apok-admin VueJS plugin, you'll have to choose the CSS styled components. This project contains the Bootstrap version of the aforementioned components. You really should not install this package directly into your Vue app, unless you are developing this project too. Most of the times, you want to get this package from the Apok-admin installation guide describe in its docs.

Renderers

For renderers information make sure to check the Apok-admin's Renderers documentation. The only detail that's not yet explained on the aforementioned docs are the properties passed to the renderer. Since a renderer is the alias used for the component, all properties passed to a renderer are equivalent to pass them to the component itself!. By this we mean that you can set properties to a renderer the same way to a component, thus making a renderer tag behave exactly like the component tag. It's a fact that the renderer concept might seem redundant, however, it allows you to keep the same html tag on the whole app, while using variations on the same component or even change it completely.

Here's an example of a Button component being called by its renderer tag equivalent and making use of it just as the component itself:

<!-- On a Vue component template -->
<template>
<!-- Passing props the same as in the IconButton.vue component-->
    <button-renderer icon="plus" type="success">
        Add to cart
    </button-renderer>
</template>

The same logic applies to all renderers listed here

Input Mixin

All input components on this package include a InputMixin.js mixin that covers most of the properties that input components may need. This mixin has the inheritAttrs attribute set to false, which does exactly that. Here's a list on the props included on this mixin:

NameDescriptionTypeDefault
inlineInline alignment on componentBooleanfalse
readonlySets readonly stateBooleanfalse
loadingSets loading stateBooleanfalse
typeInput typeString'text'
labelInput labelStringnull
idInput IDStringnull
valueInput field valueAnynull
errorError message on fieldStringnull
placeholderInput field placeholderStringnull

Also there's a function called emit that emits an event on input change and has the input value as hte payload.

Components

This package includes a set of VueJS components for your project development. Each component have their own props and logic so you can work with them as you wish. Here's a list of every component and props. All components are made with Bootstrap

  • Bootstrap-Vue, so make sure to check the docs for more info about it.
  • Inputs

    InputFormCalendar.vue

    Under the hood, this component uses date-fns for format and parse functions. Make sure to check the docs for additional info!

  • Layout

    Layout.vue

    • Properties

      NameDescriptionTypeDefault
      navbarPropsNavigation bar propertiesObject-
      footerPropsFooter propertiesObject-
      menuArray of labels and links for the sidebar menuArray-
      messagesUI array of messagesArray-
      userLogged in user's dataObject-
      sidebarExpandedsidebar expansion flagBoolean-
    • Events

      | Name | Description | Parameters |
      |:---|:---|:---:|
      | ``messageDismissed`` | Triggered on message close event | message id |
      | ``toggle-sidebar`` | Triggered on sidebar expansion | - |

      LayoutNavbar.vue

    • Properties

      NameDescriptionTypeDefault
      navbarPropsNavigation bar propertiesObject{ title: { type: String, default: 'Apok-admin'}, shortTitle: { type: String, default: 'Admin' } }
      userUser's data objectObject-
      expandedExpansion state of navbarBoolean-
      canToggleSidebarWhether or not can be toggled the sidebarBooleantrue
      localesAvailable translation for your pageArray-
    • Events

      | Name | Description | Parameters |
      |:---|:---|:---:|
      | ``sidebarToggled`` | Triggered on sidebar expansion | - |
      | ``setLocale`` | On language selection | - |
      | ``onLogout`` | When logout option is clicked | - |

      LayoutFooter.vue

      This component does not make use of any property, instead, it uses a slot that can be changed to any content you want. So, as long as you footer content is inside of a footer renderer tag, your content will always behave as expected. For example:

        <layout-footer-renderer>
            <div class="myClass"> <h2> My header </h2>< /div>
        </layout-footer-renderer>

      LayoutMenu.vue

    • Properties

      NameDescriptionTypeDefault
      itemsMenu items to renderArray-
      inNavBarWhether or not the items will be render on the navigation bar or an independant navigatorBooleanfalse
      verticalUse a vertical expansible menuBooleanfalse
      expandedWhether or not the menu is expandedBooleantrue
    • Events

      | Name | Description | Parameters |
      |:---|:---|:---:|
      | ``onMenuItemClicked`` | Triggered on native click event of item menu | - |

      LayoutMenuItem.vue

    • Properties

      | Name | Description | Type | Default|
      |:---|:---|:---:|:---:|
      | ``ìtem`` | Item properties | Object | { label: '' } |
      | ``keyId`` | Item id. Specially useful when menu items are nested | String | - |
      | ``vertical`` | Sets flex-column bootstrap class on item | Object | { label: '' } |
      | ``showText`` | Show item label | Boolean | true |

      Dashboard.vue

      This components uses slots to render a sort of grid defined by rows and columns. Each "tile" will be the space taken by the specified slot where your content will render:

        <dashboard-renderer rows="1" columns="2">
            <template v-slot:tile_1_1>
                <p>Here's some content for the tile intersected between row 1 and column 1</p>
            </template>
            <template v-slot:tile_1_2>
                <p>And another one on the tile intersected between row 1 and column 2</p>
            </template>
        </dashboard-renderer>

      You can add as many tiles as your grid allows. However, tiles that doesn't exist in the current grid wont be rendered at all.

    • Properties

      NameDescriptionTypeDefault
      rowsAmount of rows in gridNumber0
      columnsAmount of columns on each rowNumber0
      sampleRender sample content in dashboardBooleanfalse
  • Form

    AdminForm.vue

    • Properties

      NameDescriptionTypeDefault
      formVarStores content for every field in formObject-
      fieldsArray of fields to render on formArray-
      errorsStores errors associated to a fieldObject-
      readonlySets read only state on form fieldBoolean-
      loadingSets loading state on form fieldBooleanfalse
      showDividerRender a divider between fields and buttonsBooleantrue
      buttonsAlignmentAlignment of buttonsString'left'
      submitButtonTextLabel on submit buttonString'actions.save'
      submitButtonVariantColor variant of submit buttonString'primary'
      submitButtonIconIcon of the submit buttonObject{ icon: 'check' }
      cancelButtonTextLabel on cancel buttonString'actions.cancel'
      cancelButtonVariantColor variant of cancel buttonStringnull
      cancelButtonIconIcon of the cancel buttonObject{ icon: 'angle-left' }
      backButtonTextLabel on back buttonString'actions.goBack'
      backButtonVariantColor variant of back buttonString'info'
      backButtonIconIcon of the back buttonObject{ icon: 'angle-left' }
      showCancelShow cancel buttonBooleantrue
      showSubmitShow submit buttonBooleantrue
      showBackShow back buttonBooleantrue
      submitButtonIconOnlyOnly show icon for the submit buttonBooleanfalse
      cancelButtonIconOnlyOnly show icon for the cancel buttonBooleanfalse
      backButtonIconOnlyOnly show icon for the back buttonBooleanfalse
    • Events

      | Name | Description | Parameters |
      |:---|:---|:---:|
      | ``fieldChanged`` | Triggered on field's input event | - |
      | ``cancel`` | When back button is clicked | - |
      | ``submit`` | When submit button is clicked | - |

      AdminFormField.vue

    • Properties

      This components also uses the [Input Mixin](#input-mixin).
      
      | Name | Description | Type | Default|
      |:---|:---|:---:|:---:|
      | ``append`` | Appended addon of field | Array | - |
      | ``prepend`` | Prepended addon of field | Array | - |

      IconButton.vue

    • Properties

      NameDescriptionTypeDefault
      iconOnlyOnly show an icon on the buttonBooleanfalse
      rightAdd an icon to the rightBoolean-
      iconIcon of choiceObject, Stringnull
      loadingIcon of choiceObject, Stringnull
  • Miscellaneous

    Icon.vue

    This component wraps around the font-awesome-icon and unicon components. If any of those icon packs are chosen then the Icon component will render any of those depending on the given properties. For mdi, a simple <i> tag is rendered with the right classes to display the icons.

    • Properties

      | Name | Description | Type | Default|
      |:---|:---|:---:|:---:|
      | ``unicons`` | Set true if you want to use (and have installed) unicons icon pack | Boolean | false |
      | ``material`` | Use material icons | Boolean | false |
      | ``mdi`` | Use Material Design Icons | Boolean | false |
      | ``iconStyle`` | Sets the icon style | String | 'line' |
      | ``icon`` | Icon's name | String, Array | null |
      | ``spin`` | Set spinning state if available | Boolean | false |
      | ``outlined`` | Sets outlined style of icon (material, mdi) | Boolean | false |

      AdminTable.vue

    • Properties

      NameDescriptionTypeDefault
      hoverMake hoverable rowsBooleanfalse
      stripedMake striped tableBooleanfalse
      borderedMake borders on tableBooleanfalse
      canChangePageSizeAllows page sizingBooleantrue
      canCreateShow create buttonBooleantrue
      createRouteCreate button routeObject, Stringnull
      idFieldName of ID columnString'id'
      loadingTable loading stateBooleanfalse
      canReloadShow reload buttonBooleantrue
      currentPageCurrent displayed pageNumber1
      totalPagesTotal amount of pages on whole listNumber1
      pageSizeAmount of items shown per pageNumber20
      createButtonTextCreate button labelStringnew
      createButtonPropsSets the create button type and iconObject{ variant: 'success', icon: 'plus'}
      orderFieldSorting orderString'asc'
      itemsTable itemsArray-
      fieldsTable columnsArray-
      actionsAllowed actions on each rowArray-
      filtersContent used for filteringObject-
      filtersFieldsColumns used for filteringArray-
    • Events

      | Name | Description | Parameters |
      |:---|:---|:---:|
      | ``refresh`` | Triggered when refresh button is clicked | - |
      | ``onChangePageSize`` | Triggered when page size is changed | event |
      | ``pageChanged`` | Triggered when page is changed on pagination | event |
      | ``toggleOrder`` | Changes sorting order of the column | key of the toggled field |

      Pagination.vue

    • Properties

      NameDescriptionTypeDefault
      currentPageCurrent page markerNumber1
      totalPagesTotal amount of pages on listNumber1
    • Events

      | Name | Description | Parameters |
      |:---|:---|:---:|
      | ``onPageChanged`` | Triggered on page size selection | event |

      Messages.vue

      Each message properties object has the following structure: { id, type, text }. Every prop object is a message on its own, being: id, the message ID; type, the message color variant on Bootstrap colors; and text, the string describing the message itself.

    • Properties

      NameDescriptionTypeDefault
      messagesArray of Objects containing messages propsArray-
    • Events

      NameDescriptionParameters
      messageDismissedOn message close actionDismissed message id
1.0.1-rc.18

4 years ago

1.0.1-rc.17

4 years ago

1.0.1-rc.16

5 years ago

1.0.1-rc.15

5 years ago

1.0.1-rc.14

5 years ago

1.0.1-rc.13

5 years ago

1.0.1-rc.12

5 years ago

1.0.1-rc.11

5 years ago

1.0.1-rc.10

5 years ago

1.0.1-rc.9

5 years ago

1.0.1-rc.8

5 years ago

1.0.1-rc.7

5 years ago

1.0.1-rc.6

5 years ago

1.0.1-rc.5

5 years ago

1.0.1-rc.4

5 years ago

1.0.1-rc.3

5 years ago

1.0.1-rc.2

5 years ago

1.0.1-rc1

5 years ago

1.0.1-b

5 years ago

1.0.1-a

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago