0.3.130 • Published 2 years ago

tuxedo-elements v0.3.130

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

A collection of components that can be dropped into projects, not overly complicated.

Index

Usage

Download & Installation

$ npm i tuxedo-elements

Some CSS styling is available (recommended) to be included in your compiled stylesheets

@import '~tuxedo-elements/dist/tuxedo.css';

Mount Globally

import { TuxedoInput, TuxedoRadio } from 'tuxedo-elements'

const components = {
    TuxedoInput,
    TuxedoRadio
}

Object.entries(components).forEach(([name, component]) => Vue.component(name, component))

Mount Within Component

<script>
    import { TuxedoInput, TuxedoRadio } from 'tuxedo-elements'
    
    export default {
      name: 'SomeComponent',
      components: {
        TuxedoInput,
        TuxedoRadio
      }
    }
</script>

Fields

All fields include a few standard props that can be used consistently throughout.

:name (required) This prop passes a standard html name value to the field, a required prop with a unique value as it helps to differentiate the field form others.

:label Optional, set the attached label markup to the field.

:sub Optional, set <small> text next to the label and within the label tag.

:help Optional, include a helpful bit of text to guide the user. This text gets replaced with error text if there is some validation problem.

:inputClass Optional, include class declarations to be applied to the input field.

Input Field

<tuxedo-input :name="'first_name'" :label="'Some Label'" :help="'Some help text that appears below the field'" v-model="resource" />

Radio Field

<tuxedo-radio :name="'first_name'" :label="'Some Label'" :help="'Some help text that appears below the field'" v-model="resource" />

Select Field

This is an object select field with search functionality. An array of objects should be passed in as options, and an array of chosen options are returned. by default the component will use id and label properties of the objects in the option fields. An array of selected objects will be returned.

<tuxedo-select :name="'select'" :label="'Select Field'" v-model="resource" :options="[{}]" />

# Pass in a default value, and insist on simple returns
<tuxedo-select 
        :name="'select'" 
        :label="'Select Field'" 
        v-model="resource" 
        :options="[{id: 'yes', label: 'Yes'}, {id: 'no', label: 'No'}]"
        :default="'yes'" # the default value based on the insisted return
        :insistReturn="'id'" 
/>

Multiselect Field

Similar to above, but we can pass in the 'multi' prop to let our select field know it should be multi-select

<tuxedo-select 
        :name="'multi-select'" 
        :label="'Multiselect Field'"
        :options="[]"
        :multi="true" />

This field also will also display a 'Select All' and 'Unselect All' buttons for use. The text of these buttons can be changed by using the props 'insistSelectAll' and 'insistUnselectAll' to pass in the text preferred.

Date Field

<tuxedo-date :name="'date'" :label="'Some Label'" v-model="resource" />

# Make it a date range picker by passing the 'range' prop
<tuxedo-date :name="'dateRange'" :range="true" />

# Insist on a specific format to get and set by passing in the 'insistFormat' prop
# Formats available include:
# 'iso', 'isoDate' (which returns as date only no tz), 'isoDateTime' (excludes tz)
<tuxedo-date :insistFormat="'isoDate'" />

Switch Field

<tuxedo-switch :name="'switch'" :label="'Toggle this switch on and off'" v-model="resource" />

License

This project is licensed under the MIT License

0.3.130

2 years ago

0.3.121

2 years ago

0.3.120

2 years ago

0.3.123

2 years ago

0.3.122

2 years ago

0.3.125

2 years ago

0.3.124

2 years ago

0.3.127

2 years ago

0.3.126

2 years ago

0.3.129

2 years ago

0.3.119

2 years ago

0.3.110

2 years ago

0.3.112

2 years ago

0.3.111

2 years ago

0.3.114

2 years ago

0.3.113

2 years ago

0.3.116

2 years ago

0.3.115

2 years ago

0.3.118

2 years ago

0.3.117

2 years ago

0.3.105

2 years ago

0.3.107

2 years ago

0.3.106

2 years ago

0.3.109

2 years ago

0.3.108

2 years ago

0.3.104

2 years ago

0.3.0

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.3

2 years ago

0.2.52

2 years ago

0.2.51

2 years ago

0.2.50

2 years ago

0.2.57

2 years ago

0.2.56

2 years ago

0.2.55

2 years ago

0.2.54

2 years ago

0.2.53

2 years ago

0.2.49

2 years ago

0.2.41

2 years ago

0.2.40

2 years ago

0.2.48

2 years ago

0.2.47

2 years ago

0.2.46

2 years ago

0.2.45

2 years ago

0.2.44

2 years ago

0.2.43

2 years ago

0.2.42

2 years ago

0.2.39

2 years ago

0.2.38

2 years ago

0.2.37

2 years ago

0.2.36

2 years ago

0.2.35

2 years ago

0.2.34

2 years ago

0.2.33

2 years ago

0.2.32

2 years ago

0.2.30

3 years ago

0.2.31

3 years ago

0.2.27

3 years ago

0.2.26

3 years ago

0.2.25

3 years ago

0.2.24

3 years ago

0.2.23

3 years ago

0.2.29

3 years ago

0.2.28

3 years ago

0.2.22

3 years ago

0.2.21

3 years ago

0.2.20

3 years ago

0.2.19

3 years ago

0.2.18

3 years ago

0.2.17

3 years ago

0.2.16

3 years ago

0.2.15

3 years ago

0.2.14

3 years ago

0.2.13

3 years ago

0.2.12

3 years ago

0.2.11

3 years ago

0.2.10

3 years ago

0.2.7

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.6

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.1.10

3 years ago

0.1.11

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.0.14

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.13

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago