, with it's content set as the value of this prop.
name (String) Default: null
options (Array) required
uid (String) Default: null
value (String) Default: null
Attributes
Below are the child elements you can pass attributes to, along with a list of attributes it will not accept, if any.
radio
label
for - this is given either the uid prop or the generated uid if the uid prop is not provided.
legend
group - This is the wrapping div that surrounds the label and radio combinations
Emitted Events
input Output: String | null
Set up to emit the 'input' event for use with v-model.
DOM Structure
div.WurldRadioButton | fieldset.WurldRadioButton // if legend is set then it uses fieldset otherwise it uses div
legend // if legend is set
.WurldRadioButton__group *repeatable*
label *repeatable* // if labelBrefore = true
input[type="radio"] *repeatable*
label *repeatable* // if labelBefore = false
WurldSelect
Props
disabled (Boolean) Default: false
If true, adds the "disabled" attribute to the .
label (HTML String) Default: null
If set, will create a with the given HTML string as its content. This will also trigger an uid to be placed onto the "for" attrbute and the "id" attibute. This uid would be generated if the uid prop is not set.
labelAfter (Boolean) Default: false
If label prop is set, the will normally be placed before the , in the document flow. However if the label prop is set, and this prop is set to true, the will appear after the , in the document flow.
name (String) Default: null
If set, will add the "name" attribute to the , with whatever is set here as its value. If the readonly prop is set to true, then the "name" attribute wil instead be placed on an .
options (Array) required
The array is an array of objects. Using an array of objects can garauntee the options appearing in specific a order, if desired. Each object has a "label" and "value" property. The "value" property will be used as the values for the and the "label" property will be used as the labels, i.e. what the user will visually see as the option. However, instead of a string as a value for the "value" property, another array could be set instead. This will make the "label" property the label of an and the child array of objects will be set for child elements.
placeholder (String) Default: null
If set, will create an initial , with a value of an empty string, and content of whatever is set here. If the required prop is true, and once the value prop is truthy, this initial will be removed. If the required prop is false, this initial will always remain, to be reselectable.
readonly (Boolean) Default: false
If true, the becomes disabled and the "name" attribute, if any, is removed. An is created which will instead have the "name" attribute, if any, and will recieve a "value" attribute, which will be populated with whatever is passed through the value prop.
required (Boolean) Default: false
If true, adds the "required" attribute to the . Additionally, if the placeholder prop also has a value, then the created placeholder will be removed once the value prop is truthy.
uid (String) Default: null
If set, the "id" attribute would be set to this prop's value. Also, if the label prop is set the "for" attribute would also be set to the same value. This prop should be unique. If this is not set, and a label prop is given the formerly mentioned attributes will be generated a uid.
value (String) Default: null
Normally, you would use v-model on this component, which itself will set this prop. Either way, if this prop is set, the that has a value equal to this prop will recieve the "selected" attribute.
Attributes
Below are the child elements you can pass attributes to, along with a list of attributes it will not accept, if any.
label
for - this is given either the uid prop or the generated uid if the uid prop is not provided.
select
disabled - use the disabled prop instead, because it is used in some logic with the readonly prop which select elements normally don't have as an attribute.
id - this is given either the uid prop or the generated uid if the uid prop is not provided, if neither of the label nor uid props are set then no id will out on the .
name - use the prop instead.
required - use the prop instead, because this will remove the placeholder , if a placeholder is provided once a value is set.
option
value - see the options prop.
selected - use the value prop instead.
optgroup
label - see the options prop.
Emitted Events
input Output: String
Set up to emit the 'input' event for use with v-model.
DOM Structure
div.WurldSelect
label // if labelAfter = false
select
option[value=""] // if placeholder has a value AND if value has no value OR required is false
option *repeatable* // if the "value" property of the current object of the options array is a string
optgroup *repeatable* // if the "value" property of the current object of the options array is another array
option *repeatable*
input[type="hidden"] // if readonly is true
label // if labelAfter = true
WurldTextarea
Props
label (HTML String) Default: null
If set, will create a with the given HTML string as its content. This will also trigger an uid to be placed onto the "for" attrbute and the
labelAfter (Boolean) Default: false
If label prop is set, the will normally be placed before the
name (String) Default: null
If set, will add the "name" attribute to the , with whatever is set here as its value.
uid (String) Default: null
If set, the "id" attribute would be set to this prop's value. Also, if the label prop is set the "for" attribute would also be set to the same value. This prop should be unique. If this is not set, and a label prop is given the formerly mentioned attributes will be generated a uid.
value (String) Default: null
Normally, you would use v-model on this component, which itself will set this prop. Either way, if this prop is set, the "value" attribute on the will be set this prop's value.
Attributes
Below are the child elements you can pass attributes to, along with a list of attributes it will not accept, if any.
label
for - this is given either the uid prop or the generated uid if the uid prop is not provided.
textarea
id - this is given either the uid prop or the generated uid if the uid prop is not provided, if neither of the label nor uid props are set then no id will out on the .
name - use the prop instead.
value - use the prop instead.
Emitted Events
input Output: String
Set up to emit the 'input' event for use with v-model.
DOM Structure
div.WurldText
label // if labelAfter = false
textarea
label // if labelAfter = true
Directives
sizeObserve
The sizeObserve directive is applied to an element with v-sizeObserve. It will observe the size of the element and apply classes whenever the size raises above a certain width. This will allow responsive design based on the elements width versus the viewports width. Additional modifiers can allow classes to be placed, in addition to the width, based off of the height, top, and left values of the element. Top and left are in comparison to it's parent.
This directive makes use of the ResizeObserver API, with a polyfill, from the resize-observer-polyfill npm module.
NOTE: The width and height are based off the content box, so it will not take margin, padding, or border into account. Therefore is it best to apply this directive to a container.
Config
This section refers to the configuration that can be applied when initially registering Wurld. The options for this directive is the same as value, below. This will adjust the default values for the directive. Any value given to a specific directive's use will override the config option.
Config Default
The following is the registered default, this could change to whatever you would prefer to be the default by changing the config when initially registering Wurld.
{
width: {
xxs: 256,
xs: 512,
sm: 768,
md: 1024,
lg: 1280,
xl: 1536,
xxl: 1792
}
}
Value
breakpoints (Object)
This object takes four properties: width, height, top, and left. By default, only width is defined. Each of these propertys' values are objects where keys are the classes you would like to apply to the element and the values are the minumum size, in pixels, at which the class is applied. For instance, in the default case, as seen above, if the element's content widthwas 900px it would have the xxs, xs, and sm classes applied to the element.
Modifiers
height - This will tell the directive to also observe the height of the element. If a height property is not provided to the breakpoints it will fall back to the width, with 'h-' prepended to the classes. If neither properties are present then this modifier will be ignored.
top - This will observe the distance the element is from the top of it's parent. It will only apply classes if a top, class-value object, is provided to the the breakpoints.
left - This will observe the distance the element is from the left of it's parent. It will only apply classes if a left, class-value object, is provided to the the breakpoints.
Filters
toPrice
This will convert a string to a "price" string
Config
This section refers to the configuration that can be applied when initially registering Wurld. This will change the defaults, but can still be overriden by each use of the toPrice filter. The defaults for this configuration can be seen in the comparable params.
pre (String) same as the param below.
locale (String) same as the param below.
fix (Integer) same as the param below.
Params
amount (String / Number)
The amount to convert to a price.
pre (String) - Default: '