58 KiB
UI Components
This page contains all the UI components used in the application.
Builder
Modal.vue
This component contains all widgets needed on a modal. This is different from a page builder as we don't need to define the container and grid layout. We can't create multiple grids or containers in a modal.
Parameters
widgetsArray Array of containers and widgets
Examples
[
"id": "modal-delete-plugin",
"widgets": [
{
"type": "Title",
"data": {
"title": "plugins_modal_delete_title",
"type": "modal"
}
},
{
"type": "Text",
"data": {
"text": "plugins_modal_delete_confirm"
}
},
{
"type": "Text",
"data": {
"text": "",
"bold": true,
"attrs": {
"data-modal-plugin-name": "true"
}
}
},
{
"type": "ButtonGroup",
"data": {
"buttons": [
{
"id": "delete-plugin-btn",
"text": "action_close",
"disabled": false,
"color": "close",
"size": "normal",
"attrs": {
"data-hide-el": "modal-delete-plugin"
}
},
{
"id": "delete-plugin-btn",
"text": "action_delete",
"disabled": false,
"color": "delete",
"size": "normal",
"attrs": {
"data-delete-plugin-submit": ""
}
}
],
}
}
]
];
Form
Advanced.vue
This component is used to create a complete advanced form with plugin selection.
Parameters
templateObject Template object with plugin and settings data.containerClassString Container additional class (optional, default"")operationString Operation type (edit, new, delete). (optional, default"edit")endpointString Form endpoint. Case none, will be ignored. (optional, default"")methodString Http method to be used on form submit. (optional, default"POST")oldServerNameString Old server name. This is a server name before any changes. (optional, default"")columnsObject Columns object. (optional, default{"pc":"12","tablet":"12","mobile":"12"})displayArray Array need two values : "groupName" in index 0 and "compId" in index 1 in order to be displayed using the display store. More info on the display store itslef. (optional, default[])
Examples
{
template: [
{
columns: { pc: 6, tablet: 12, mobile: 12 },
id: "test-check",
value: "yes",
label: "Checkbox",
name: "checkbox",
required: true,
hideLabel: false,
headerClass: "text-red-500",
inpType: "checkbox",
},
{
id: "test-input",
value: "yes",
type: "text",
name: "test-input",
disabled: false,
required: true,
label: "Test input",
pattern: "(test)",
inpType: "input",
},
],
}
Easy.vue
This component is used to create a complete easy form with plugin selection.
Parameters
templateObject Template object with plugin and settings data.containerClassString Container additional class (optional, default"")operationString Operation type (edit, new, delete). (optional, default"edit")endpointString Form endpoint. Case none, will be ignored. (optional, default"")methodString Http method to be used on form submit. (optional, default"POST")oldServerNameString Old server name. This is a server name before any changes. (optional, default"")columnsObject Columns object. (optional, default{"pc":"12","tablet":"12","mobile":"12"})displayArray Array need two values : "groupName" in index 0 and "compId" in index 1 in order to be displayed using the display store. More info on the display store itslef. (optional, default[])
Examples
{
template: [
{
columns: { pc: 6, tablet: 12, mobile: 12 },
id: "test-check",
value: "yes",
label: "Checkbox",
name: "checkbox",
required: true,
hideLabel: false,
headerClass: "text-red-500",
inpType: "checkbox",
},
{
id: "test-input",
value: "yes",
type: "text",
name: "test-input",
disabled: false,
required: true,
label: "Test input",
pattern: "(test)",
inpType: "input",
},
],
}
Fields.vue
This component wraps all available fields for a form.
Parameters
settingObject Setting needed to render a field.
Examples
{
columns : {"pc": 6, "tablet": 12, "mobile": 12},
id:"test-check",
value: "yes",
label: "Checkbox",
name: "checkbox",
required: true,
hideLabel: false,
inpType: "checkbox",
headerClass: "text-red-500"
popovers : [
{
text: "This is a popover text",
iconName: "info",
},
]
}
Raw.vue
This component is used to create a complete raw form with settings as JSON format.
Parameters
templateObject Template object with plugin and settings data.operationString Operation type (edit, new, delete). (optional, default"edit")oldServerNameString Old server name. This is a server name before any changes. (optional, default"")containerClassString Container additional class (optional, default"")endpointString Form endpoint. Case none, will be ignored. (optional, default"")methodString Http method to be used on form submit. (optional, default"POST")columnsObject Columns object. (optional, default{"pc":"12","tablet":"12","mobile":"12"})displayArray Array need two values : "groupName" in index 0 and "compId" in index 1 in order to be displayed using the display store. More info on the display store itslef. (optional, default[])
Examples
{
"IS_LOADING": "no",
"NGINX_PREFIX": "/etc/nginx/",
"HTTP_PORT": "8080",
"HTTPS_PORT": "8443",
"MULTISITE": "yes"
}
Regular.vue
This component is used to create a basic form with fields.
Parameters
titleString Form title (optional, default"")subtitleString Form subtitle (optional, default"")fieldsObject List of Fields component to displaybuttonsObject We need to send a regular ButtonGroup buttons propcontainerClassString Container additional class (optional, default"")endpointString Form endpoint. Case none, will be ignored. (optional, default"")methodString Http method to be used on form submit. (optional, default"POST")displayArray Array need two values : "groupName" in index 0 and "compId" in index 1 in order to be displayed using the display store. More info on the display store itslef. (optional, default[])maxWidthScreenString Max screen width for the settings based on the breakpoint (xs, sm, md, lg, xl, 2xl) (optional, default"lg")columnsObject Columns object. (optional, default{"pc":"12","tablet":"12","mobile":"12"})
Examples
fields : [
{
columns: { pc: 6, tablet: 12, mobile: 12 },
id: "test-check",
value: "yes",
label: "Checkbox",
name: "checkbox",
required: true,
hideLabel: false,
headerClass: "text-red-500",
inpType: "checkbox",
},
{
id: "test-input",
value: "yes",
type: "text",
name: "test-input",
disabled: false,
required: true,
label: "Test input",
pattern: "(test)",
inpType: "input",
},
],
Templates.vue
This component is used to create a complete settings form with all modes (advanced, raw, easy).
Parameters
templatesObject List of advanced templates that contains settings. Must be a dict with mode as key, then the template name as key with a list of data (different for each modes).operationString Operation type (edit, new, delete). (optional, default"edit")oldServerNameString Old server name. This is a server name before any changes. (optional, default"")isDraft(String | Boolean) Is draft mode. "yes" or "no" to set a draft select. Else will be ignored. (optional, defaultfalse)displayArray Array need two values : "groupName" in index 0 and "compId" in index 1 in order to be displayed using the display store. More info on the display store itslef. (optional, default[])
Examples
{
advanced : {
default : [{SETTING_1}, {SETTING_2}...],
low : [{SETTING_1}, {SETTING_2}...],
},
easy : {
default : [...],
low : [...],
}
}
Forms
Error
Field.vue
This component is an alert type to send feedback to the user. We can used it as a fixed alert or we can use it in a container as a list.
Parameters
titleString The title of the alert. Can be a translation key or by default raw text.messageString The message of the alert. Can be a translation key or by default raw text.canCloseBoolean Determine if the alert can be closed by user (add a close button), by default it is closable (optional, defaulttrue)isFixedString Determine if the alert is fixed (visible bottom right of page) or relative (inside a container) (optional, defaultfalse)typeString The type of the alert, can be success, error, warning or info (optional, default"info")delayToCloseNumber The delay to auto close alert in ms, by default always visible (optional, default0)tabIdString The tabindex of the alert (optional, default"-1")
Examples
{
position : "fixed",
type: "success",
title: "Success",
message: "Your action has been successfully completed",
delayToClose: 5000,
}
Feature
Clipboard.vue
This component can be add to some fields to allow to copy the value of the field. Additional clipboardClass and copyClass can be added to fit the parent container.
Parameters
idString Unique id (optional, defaultuuidv4())isClipboardBoolean Display a clipboard button to copy a value (optional, defaultfalse)valueToCopyString The value to copy (optional, default"")clipboadClassString Additional class for the clipboard container. Useful to fit the component in a specific container. (optional, default"")copyClassString The class of the copy message. Useful to fit the component in a specific container. (optional, default"")fieldSizeString Size between "normal" or "sm" (optional, default"normal")
Examples
{
id: 'test-input',
isClipboard: true,
valueToCopy: 'yes',
clipboadClass: 'mx-2',
copyClass: 'mt-2',
}
Field
Checkbox.vue
This component is used to create a complete checkbox field input with error handling and label. We can also add popover to display more information. It is mainly use in forms.
Parameters
idString Unique id (optional, defaultuuidv4())labelString The label of the field. Can be a translation key or by default raw text.nameString The name of the field. Case no label, this is the fallback. Can be a translation key or by default raw text.valueString;attrsObject Additional attributes to add to the field (optional, default{})popoversArray List of popovers to display more information (optional, default[])inpTypeString The type of the field, useful when we have multiple fields in the same container to display the right field (optional, default"checkbox")disabledBoolean (optional, defaultfalse)requiredBoolean (optional, defaultfalse)columnsObject Field has a grid system. This allow to get multiple field in the same row if needed. (optional, default{"pc":"12","tablet":"12","mobile":"12"})hideLabelBoolean (optional, defaultfalse)containerClassString (optional, default"")headerClassString (optional, default"")inpClassString (optional, default"")fieldSizeString Size between "normal" or "sm" (optional, default"normal")tabId(String | Number) The tabindex of the field, by default it is the contentIndex (optional, defaultcontentIndex)showErrMsgBoolean Show additionnal required or invalid error message at the bottom of the input. Disable by default because help popover, label and outline color are enough for the user. (optional, defaultfalse)
Examples
{
columns : {"pc": 6, "tablet": 12, "mobile": 12},
id:"test-check",
value: "yes",
label: "Checkbox",
name: "checkbox",
required: true,
hideLabel: false,
inpType: "checkbox",
headerClass: "text-red-500"
popovers : [
{
text: "This is a popover text",
iconName: "info",
},
]
}
Combobox.vue
This component is used to create a complete combobox field input with error handling and label. We can be more precise by adding values that need to be selected to be valid. We can also add popover to display more information.
Parameters
idString Unique id (optional, defaultuuidv4())labelString The label of the field. Can be a translation key or by default raw text.nameString The name of the field. Case no label, this is the fallback. Can be a translation key or by default raw text.valueString;valuesArray;attrsObject Additional attributes to add to the field (optional, default{})maxBtnCharsString Max char to display in the dropdown button handler. (optional, default"")popoversArray List of popovers to display more information (optional, default[])inpTypeString The type of the field, useful when we have multiple fields in the same container to display the right field (optional, default"select")disabledBoolean (optional, defaultfalse)requiredBoolean (optional, defaultfalse)requiredValuesArray values that need to be selected to be valid, works only if required is true (optional, default[])columnsObject Field has a grid system. This allow to get multiple field in the same row if needed. (optional, default{"pc":"12","tablet":"12","mobile":"12"})hideLabelBoolean (optional, defaultfalse)onlyDownBoolean If the dropdown should check the bottom of the (optional, defaultfalse)overflowAttrElBoolean Attribute to select the container the element has to check for overflow (optional, default"")containerClassString (optional, default"")inpClassString (optional, default"")fieldSizeString Size between "normal" or "sm" (optional, default"normal")headerClassString (optional, default"")tabId(String | Number) The tabindex of the field, by default it is the contentIndex (optional, defaultcontentIndex)showErrMsgBoolean Show additionnal required or invalid error message at the bottom of the input. Disable by default because help popover, label and outline color are enough for the user. (optional, defaultfalse)
Examples
{
id: 'test-input',
value: 'yes',
values : ['yes', 'no'],
name: 'test-input',
disabled: false,
required: true,
requiredValues : ['no'], // need required to be checked
label: 'Test select',
inpType: "select",
popovers : [
{
text: "This is a popover text",
iconName: "info",
},
]
}
Datepicker.vue
This component is used to create a complete datepicker field input with error handling and label. You can define a default date, a min and max date, and a format. We can also add popover to display more information. It is mainly use in forms.
Parameters
idString Unique id (optional, defaultuuidv4())labelString The label of the field. Can be a translation key or by default raw text.nameString The name of the field. Case no label, this is the fallback. Can be a translation key or by default raw text.popoversArray List of popovers to display more information (optional, default[])attrsObject Additional attributes to add to the field (optional, default{})inpTypeString The type of the field, useful when we have multiple fields in the same container to display the right field (optional, default"datepicker")valueTimestamp Default date when instantiate (optional, default"")minDateTimestamp Impossible to pick a date before this date. (optional, default"")maxDateTimestamp Impossible to pick a date after this date. (optional, default"")isClipboardBoolean allow to copy the timestamp value (optional, defaulttrue)hideLabelBoolean (optional, defaultfalse)columnsObject Field has a grid system. This allow to get multiple field in the same row if needed. (optional, default{"pc":"12","tablet":"12","mobile":"12"})disabledBoolean (optional, defaultfalse)requiredBoolean (optional, defaultfalse)headerClassString (optional, default"")containerClassString (optional, default"")fieldSizeString Size between "normal" or "sm" (optional, default"normal")tabId(String | Number) The tabindex of the field, by default it is the contentIndex (optional, defaultcontentIndex)showErrMsgBoolean Show additionnal required or invalid error message at the bottom of the input. Disable by default because help popover, label and outline color are enough for the user. (optional, defaultfalse)
Examples
{
id: 'test-date',
columns : {"pc": 6, "tablet": 12, "mobile": 12},
disabled: false,
required: true,
value: 1735682600000,
minDate: 1735682600000,
maxDate: 1735689600000,
inpClass: "text-center",
inpType : ""
popovers : [
{
text: "This is a popover text",
iconName: "info",
},
],
}
Editor.vue
This component is used to create a complete editor field with error handling and label. We can also add popover to display more information. It is mainly use in forms.
Parameters
idString Unique id (optional, defaultuuidv4())labelString The label of the field. Can be a translation key or by default raw text.nameString The name of the field. Case no label, this is the fallback. Can be a translation key or by default raw text.valueString;attrsObject Additional attributes to add to the field (optional, default{})popoversArray List of popovers to display more information (optional, default[])inpTypeString The type of the field, useful when we have multiple fields in the same container to display the right field (optional, default"editor")columnsObject Field has a grid system. This allow to get multiple field in the same row if needed. (optional, default{"pc":"12","tablet":"12","mobile":"12"})patternString (optional, default"")disabledBoolean (optional, defaultfalse)requiredBoolean (optional, defaultfalse)isClipboardBoolean allow to copy the input value (optional, defaulttrue)hideLabelBoolean (optional, defaultfalse)containerClassString (optional, default"")inpClassString (optional, default"")headerClassString (optional, default"")tabId(String | Number) The tabindex of the field, by default it is the contentIndex (optional, defaultcontentIndex)fieldSizeString Size between "normal" or "sm" (optional, default"normal")showErrMsgBoolean Show additionnal required or invalid error message at the bottom of the input. Disable by default because help popover, label and outline color are enough for the user. (optional, defaultfalse)
Examples
{
id: "test-editor",
value: "yes",
name: "test-editor",
disabled: false,
required: true,
pattern: "(test)",
label: "Test editor",
tabId: "1",
columns: { pc: 12, tablet: 12, mobile: 12 },
};
Input.vue
This component is used to create a complete input field input with error handling and label. We can add a clipboard button to copy the input value. We can also add a password button to show the password. We can also add popover to display more information. It is mainly use in forms.
Parameters
idString Unique id (optional, defaultuuidv4())typeString text, email, password, number, tel, url (optional, default"text")labelString The label of the field. Can be a translation key or by default raw text.nameString The name of the field. Case no label, this is the fallback. Can be a translation key or by default raw text.valueString;attrsObject Additional attributes to add to the field (optional, default{})popoversArray List of popovers to display more information (optional, default[])inpTypeString The type of the field, useful when we have multiple fields in the same container to display the right field (optional, default"input")columnsObject Field has a grid system. This allow to get multiple field in the same row if needed. (optional, default{"pc":"12","tablet":"12","mobile":"12"})disabledBoolean (optional, defaultfalse)requiredBoolean (optional, defaultfalse)placeholderString (optional, default"")patternString (optional, default"(?.*)")isClipboardBoolean allow to copy the input value (optional, defaulttrue)readonlyBoolean allow to read only the input value (optional, defaultfalse)hideLabelBoolean (optional, defaultfalse)containerClassString (optional, default"")inpClassString (optional, default"")headerClassString (optional, default"")fieldSizeString Size between "normal" or "sm" (optional, default"normal")tabId(String | Number) The tabindex of the field, by default it is the contentIndex (optional, defaultcontentIndex)showErrMsgBoolean Show additionnal required or invalid error message at the bottom of the input. Disable by default because help popover, label and outline color are enough for the user. (optional, defaultfalse)
Examples
{
id: 'test-input',
value: 'yes',
type: "text",
name: 'test-input',
disabled: false,
required: true,
label: 'Test input',
pattern : "(test)",
inpType: "input",
popovers : [
{
text: "This is a popover text",
iconName: "info",
},
],
}
List.vue
This component is used display list of values in a dropdown, remove or add an item in an easy way. We can also add popover to display more information.
Parameters
idString Unique id (optional, defaultuuidv4())labelString The label of the field. Can be a translation key or by default raw text.nameString The name of the field. Case no label, this is the fallback. Can be a translation key or by default raw text.valueString;attrsObject Additional attributes to add to the field (optional, default{})separatorString Separator to split the value, by default it is a space (optional, default" ")maxBtnCharsString Max char to display in the dropdown button handler. (optional, default"")popoversArray List of popovers to display more information (optional, default[])inpTypeString The type of the field, useful when we have multiple fields in the same container to display the right field (optional, default"list")disabledBoolean (optional, defaultfalse)requiredBoolean (optional, defaultfalse)columnsObject Field has a grid system. This allow to get multiple field in the same row if needed. (optional, default{"pc":"12","tablet":"12","mobile":"12"})hideLabelBoolean (optional, defaultfalse)onlyDownBoolean If the dropdown should stay down (optional, defaultfalse)overflowAttrElBoolean Attribute the element has to check for overflow (optional, default"")containerClassString (optional, default"")inpClassString (optional, default"")headerClassString (optional, default"")fieldSizeString Size between "normal" or "sm" (optional, default"normal")tabId(String | Number) The tabindex of the field, by default it is the contentIndex (optional, defaultcontentIndex)showErrMsgBoolean Show additionnal required or invalid error message at the bottom of the input. Disable by default because help popover, label and outline color are enough for the user. (optional, defaultfalse)
Examples
{
id: 'test-input',
value: 'yes no maybe',
name: 'test-list',
label: 'Test list',
inpType: "list",
popovers : [
{
text: "This is a popover text",
iconName: "info",
},
]
}
Select.vue
This component is used to create a complete select field input with error handling and label. We can be more precise by adding values that need to be selected to be valid. We can also add popover to display more information. It is mainly use in forms.
Parameters
idString Unique id (optional, defaultuuidv4())labelString The label of the field. Can be a translation key or by default raw text.nameString The name of the field. Case no label, this is the fallback. Can be a translation key or by default raw text.valueString;valuesArray;attrsObject Additional attributes to add to the field (optional, default{})popoversArray List of popovers to display more information (optional, default[])inpTypeString The type of the field, useful when we have multiple fields in the same container to display the right field (optional, default"select")maxBtnCharsString Max char to display in the dropdown button handler. (optional, default"")disabledBoolean (optional, defaultfalse)requiredBoolean (optional, defaultfalse)requiredValuesArray values that need to be selected to be valid, works only if required is true (optional, default[])columnsObject Field has a grid system. This allow to get multiple field in the same row if needed. (optional, default{"pc":"12","tablet":"12","mobile":"12"})hideLabelBoolean (optional, defaultfalse)onlyDownBoolean If the dropdown should check the bottom of the container (optional, defaultfalse)overflowAttrElBoolean Attribute to select the container the element has to check for overflow (optional, default"")containerClassString (optional, default"")inpClassString (optional, default"")headerClassString (optional, default"")fieldSizeString Size between "normal" or "sm" (optional, default"normal")tabId(String | Number) The tabindex of the field, by default it is the contentIndex (optional, defaultcontentIndex)hideValidationBoolean If field should be validate and show error. Useful to disable it for filters. (optional, defaultfalse)
Examples
{
id: 'test-input',
value: 'yes',
values : ['yes', 'no'],
name: 'test-input',
disabled: false,
required: true,
requiredValues : ['no'], // need required to be checked
label: 'Test select',
inpType: "select",
popovers : [
{
text: "This is a popover text",
iconName: "info",
},
]
}
Group
Multiple.vue
This Will regroup all multiples settings with add and remove logic. This component under the hood is rendering default fields but by group with possibility to add or remove a multiple group.
Parameters
multiplesObject The multiples settings to display. This needs to be a dict of settings using default field format.columnsObject Field has a grid system. This allow to get multiple field in the same row if needed. (optional, default{"pc":"12","tablet":"12","mobile":"12"})containerClassString Additionnal class to add to the container (optional, default"")tadIdString The tabindex of the field, by default it is the contentIndex (optional, defaultcontentIndex)
Examples
{
"columns": {"pc": 6, "tablet": 12, "mobile": 12},
"multiples": {
"reverse-proxy": {
"0": {
"REVERSE_PROXY_HOST": {
"context": "multisite",
"default": "",
"help": "Full URL of the proxied resource (proxy_pass).",
"id": "reverse-proxy-host",
"label": "Reverse proxy host",
"regex": "^.*$",
"type": "text",
"multiple": "reverse-proxy",
"pattern": "^.*$",
"inpType": "input",
"name": "Reverse proxy host",
"columns": {
"pc": 4,
"tablet": 6,
"mobile": 12
},
"disabled": false,
"value": "service",
"popovers": [
{
"iconName": "disk",
"text": "inp_popover_multisite"
},
{
"iconName": "info",
"text": "Full URL of the proxied resource (proxy_pass)."
}
],
"containerClass": "z-26",
"method": "ui"
},
"REVERSE_PROXY_KEEPALIVE": {
"context": "multisite",
"default": "no",
"help": "Enable or disable keepalive connections with the proxied resource.",
"id": "reverse-proxy-keepalive",
"label": "Reverse proxy keepalive",
"regex": "^(yes|no)$",
"type": "check",
"multiple": "reverse-proxy",
"pattern": "^(yes|no)$",
"inpType": "checkbox",
"name": "Reverse proxy keepalive",
"columns": {
"pc": 4,
"tablet": 6,
"mobile": 12
},
"disabled": false,
"value": "no",
"popovers": [
{
"iconName": "disk",
"text": "inp_popover_multisite"
},
{
"iconName": "info",
"text": "Enable or disable keepalive connections with the proxied resource."
}
],
"containerClass": "z-20"
},
},
}
}
}
},
Header
Field.vue
This component is used with field in order to link a label to field type. We can add popover to display more information. Always use with field component.
Parameters
labelString The label of the field. Can be a translation key or by default raw text.idString The id of the field. This is used to link the label to the field.nameString The name of the field. Case no label, this is the fallback. Can be a translation key or by default raw text.popoversArray List of popovers to display more information (optional, default[])requiredBoolean (optional, defaultfalse)hideLabelBoolean (optional, defaultfalse)headerClassString (optional, default"")fieldSizeString Size between "normal" or "sm" inherit from field (optional, default"normal")
Examples
{
label: 'Test',
version : "0.1.0",
name: 'test-input',
required: true,
popovers : [
{
text: "This is a popover text",
iconName: "info",
},
],
}
Icon
Status.vue
This component is a icon used with status.
Parameters
idString The id of the status icon.statusString The color of the icon between error, success, warning, info (optional, default"info")statusClassString Additional class, for example to use with grid system. (optional, default"")
Examples
{
id: "instance-1",
status: "success",
statusClass: "col-span-12",
}
List
Details.vue
This component is a list of items separate on two columns : one for the title, and other for a list of popovers related to the plugin (type, link...)
Parameters
detailsstring List of details item that contains a text, disabled state, attrs and list of popovers. We can also add a disabled key to disable the item.filtersarray List of filters to apply on the list of items. (optional, default[])columnscolumns Determine the position of the items in the grid system. (optional, default{"pc":"4","tablet":"6","mobile":"12"})
Examples
{
details : [{
text: "name",
disabled : false,
attrs: {
id: "id",
value: "value",
},
popovers: [
{
text: "This is a popover text",
iconName: "info",
},
{
text: "This is a popover text",
iconName: "info",
},
],
}
Pairs.vue
This component is used to display key value information in a list.
Parameters
pairsArray The list of key value information. The key and value can be a translation key or a raw text.columnsObject Determine the position of the items in the grid system. (optional, default{"pc":"12","tablet":"12","mobile":"12"})
Examples
{
pairs : [
{ key: "Total Users", value: "100" }
],
columns: { pc: 12, tablet: 12, mobile: 12 }
}
Message
Unmatch.vue
Display a default message "no match" with dedicated icon. The message text can be overridden by passing a text prop.
Parameters
textString The text to displayiconNameString The icon to display (optional, default"search")iconColorString The color of the icon (optional, default"")unmatchClassString The class to apply to the message. If not provided, the class will be based on the parent component. (optional, default"")
Examples
{
text: "dashboard_no_match",
}
Widget
Button.vue
This component is a standard button.
Parameters
idString Unique id of the button (optional, defaultuuidv4())textString Content of the button. Can be a translation key or by default raw text.displayArray Case display, we will update the display store with the given array. Useful when we want to use button as tabs. (optional, default[])typeString Can be of type button || submit (optional, default"button")disabledBoolean (optional, defaultfalse)hideTextBoolean Hide text to only display icon (optional, defaultfalse)colorString (optional, default"primary")iconColorString Color we want to apply to the icon. If falsy value, default icon color is applied. (optional, default"")sizeString Can be of size sm || normal || lg || xl or tab (optional, default"normal")iconNameString Name in lowercase of icons store on /Icons. If falsy value, no icon displayed. (optional, default"")attrsObject List of attributes to add to the button. Some attributes will conduct to additional script (optional, default{})modal(Object | boolean) We can link the button to a Modal component. We need to pass the widgets inside the modal. Button click will open the modal. (optional, defaultfalse)tabId(String | Number) The tabindex of the field, by default it is the contentIndex (optional, defaultcontentIndex)containerClassString Additional class to the container (optional, default"")
Examples
{
id: "open-modal-btn",
text: "Open modal",
disabled: false,
hideText: true,
color: "green",
size: "normal",
iconName: "modal",
attrs: { data-toggle: "modal", "data-target": "#modal"},
}
ButtonGroup.vue
This component allow to display multiple buttons in the same row using flex. We can define additional class too for the flex container. We need a list of buttons to display.
Parameters
buttonsArray List of buttons to display. Button component is used.buttonGroupClassString Additional class for the flex container (optional, default"")
Examples
{
id: "group-btn",
boutonGroupClass : "justify-center",
buttons: [
{
id: "open-modal-btn",
text: "Open modal",
disabled: false,
hideText: true,
color: "green",
size: "normal",
iconName: "modal",
eventAttr: {"store" : "modal", "value" : "open", "target" : "modal_id", "valueExpanded" : "open"},
},
{
id: "close-modal-btn",
text: "Close modal",
disabled: false,
hideText: true,
color: "red",
size: "normal",
iconName: "modal",
eventAttr: {"store" : "modal", "value" : "close", "target" : "modal_id", "valueExpanded" : "close"},
},
],
}
Container.vue
This component is a basic container that can be used to wrap other components. In case we are working with grid system, we can add columns to position the container. We can define additional class too. This component is mainly use as widget container.
Parameters
containerClassString Additional class (optional, default"")columns(Object | boolean) Work with grid system { pc: 12, tablet: 12, mobile: 12} (optional, default{"pc":"12","tablet":"12","mobile":"12"})tagString The tag for the container (optional, default"div")displayArray Array need two values : "groupName" in index 0 and "compId" in index 1 in order to be displayed using the display store. More info on the display store itslef. (optional, default[])
Examples
{
containerClass: "w-full h-full bg-white rounded shadow-md",
columns: { pc: 12, tablet: 12, mobile: 12}
}
FileManager.vue
File manager component. Useful with cache page.
Parameters
dataObject Can be a translation key or by default raw text.baseFolderString The base folder to display by default (optional, default"base")columnsObject Work with grid system { pc: 12, tablet: 12, mobile: 12} (optional, default{"pc":"12","tablet":"12","mobile":"12"})containerClassString Additional class (optional, default"")
Examples
{
title: "Total Users",
type: "card",
titleClass: "text-lg",
color : "info",
tag: "h2"
}
Filter.vue
This component allow to filter any data object or array with a list of filters. For the moment, we have 2 types of filters: select and keyword. We have default values that avoid filter ("all" for select and "" for keyword). Filters are fields so we need to provide a "field" key with same structure as a Field. We have to define "keys" that will be the keys the filter value will check. We can set filter "default" in order to filter the base keys of an object. We can set filter "settings" in order to filter settings, data must be an advanced template. We can set filter "table" in order to filter table items. Check example for more details.
Parameters
filtersArray Fields with additional data to be used as filters. (optional, default[])data(Object | Array) Data object or array to filter. Emit a filter event with the filtered data. (optional, default{})containerClassString Additional class for the container. (optional, default"")
Examples
[
{
filter: "default", // or "settings" or "table"
type: "select",
value: "all",
keys: ["type"],
field: {
inpType: "select",
id: uuidv4(),
value: "all",
// add 'all' as first value
values: ["all"].concat(plugin_types),
name: uuidv4(),
onlyDown: true,
label: "inp_select_plugin_type",
popovers: [
{
text: "inp_select_plugin_type_desc",
iconName: "info",
},
],
columns: { pc: 3, tablet: 4, mobile: 12 },
},
},
]
Grid.vue
This component is a basic container that can be used to wrap other components. This container is based on a grid system and will return a grid container with 12 columns. We can define additional class too. This component is mainly use as widget container or as a child of a GridLayout.
Parameters
gridClassString Additional class (optional, default"items-start")displayArray Array need two values : "groupName" in index 0 and "compId" in index 1 in order to be displayed using the display store. More info on the display store itslef. (optional, default[])
Examples
{
columns: { pc: 12, tablet: 12, mobile: 12},
gridClass: "items-start"
}
GridLayout.vue
This component is used for top level page layout. This will determine the position of layout components based on the grid system. We can create card, modal, table and others top level layout using this component. This component is mainly use as Grid parent component.
Parameters
typeString Type of layout component, we can have "card" (optional, default"card")idString Id of the layout component, will be used to identify the component. (optional, defaultuuidv4())titleString Title of the layout component, will be displayed at the top if exists. Type of layout component will determine the style of the title. (optional, default"")linkString Will transform the container tag from a div to an a tag with the link as href. Useful with card type. (optional, default"")columnsObject Work with grid system { pc: 12, tablet: 12, mobile: 12} (optional, default{"pc":12,"tablet":12,"mobile":12})gridLayoutClassString Additional class (optional, default"items-start")displayArray Array need two values : "groupName" in index 0 and "compId" in index 1 in order to be displayed using the display store. More info on the display store itslef. (optional, default[])tabIdString Case the container is converted to an anchor with a link, we can define the tabId, by default it is the contentIndex (optional, defaultcontentIndex)maxWidthScreenString Max screen width for the settings based on the breakpoint (xs, sm, md, lg, xl, 2xl, 3xl) (optional, default"2xl")
Examples
{
type: "card",
title: "Test",
columns: { pc: 12, tablet: 12, mobile: 12},
gridLayoutClass: "items-start",
display: ["main", 1],
}
Icons.vue
This component is a wrapper that contains all the icons available in the application (Icons folder). This component is used to display the icon based on the icon name. This component is mainly use inside others widgets.
Parameters
iconNameString The name of the icon to display. The icon name is the name of the file without the extension on lowercase.iconClassString Class to apply to the icon. In case the icon is related to a widget, the widget will set the right class automatically. (optional, default"base")colorString The color of the icon between some tailwind css available colors (purple, green, red, orange, blue, yellow, gray, dark, amber, emerald, teal, indigo, cyan, sky, pink...). Darker colors are also available using the base color and adding '-darker' (e.g. 'red-darker'). (optional, default"")isStickBoolean If true, the icon will be stick to the top right of the parent container. (optional, defaultfalse)disabledBoolean If true, the icon will be disabled. (optional, defaultfalse)valueAny Attach a value to icon. Useful on some cases like table filtering using icons. (optional, default"")
Examples
{
iconName: 'box',
iconClass: 'base',
color: 'amber',
}
Image.vue
This component is used for regular paragraph.
Parameters
srcString The src value of the image.altString The alt value of the image. Can be a translation key or by default raw text. (optional, default"")imgClassString (optional, default"")imgContainerClassString (optional, default"")attrsObject List of attributes to add to the image. (optional, default{})
Examples
{
src: "https://via.placeholder.com/150",
alt: "My image",
attrs: { id: "paragraph" },
}
Popover.vue
This component is a standard popover.
Parameters
textString Content of the popover. Can be a translation key or by default raw text.hrefString Link of the anchor. By default it is a # link. (optional, default"#")colorString Color of the icon between tailwind colorsattrsObject List of attributs to add to the text. (optional, default{})tagString By default it is a anchor tag, but we can use other tag like div in case of popover on another anchor (optional, default"a")iconClassString (optional, default"icon-default")tabId(String | Number) The tabindex of the field, by default it is the contentIndex (optional, defaultcontentIndex)
Examples
{
text: "This is a popover text",
href: "#",
iconName: "info",
attrs: { "data-popover": "test" },
}
PopoverGroup.vue
This component allow to display multiple popovers in the same row using flex. We can define additional class too for the flex container. We need a list of popovers to display.
Parameters
popoversArray List of popovers to display. Popover component is used.groupClasssString Additional class for the flex container (optional, default"")
Examples
{
flexClass : "justify-center",
popovers: [
{
text: "This is a popover text",
iconName: "info",
},
{
text: "This is a popover text",
iconName: "info",
},
],
}
Stat.vue
This component is wrapper of all stat components. This component has no grid system and will always get the full width of the parent. This component is mainly use inside a blank card.
Parameters
titleString The title of the stat. Can be a translation key or by default raw text.stat(String | Number) The valuesubtitleString The subtitle of the stat. Can be a translation key or by default raw text. (optional, default"")iconNameString A top-right icon to display between icon available in Icons/Stat. Case falsy value, no icon displayed. The icon name is the name of the file without the extension on lowercase. (optional, default"")subtitleColorString The color of the subtitle between error, success, warning, info (optional, default"info")
Examples
{
title: "Total Users",
value: 100,
subtitle : "Last 30 days",
iconName: "user",
link: "/users",
subtitleColor: "info",
}
Subtitle.vue
This component is a general subtitle wrapper.
Parameters
subtitleString Can be a translation key or by default raw text.typeString The type of title between "container", "card", "content", "min" or "stat" (optional, default"card")tagString The tag of the subtitle. Can be h1, h2, h3, h4, h5, h6 or p. If empty, will be determine by the type of subtitle. (optional, default"")colorString The color of the subtitle between error, success, warning, info or tailwind color (optional, default"")boldBoolean If the subtitle should be bold or not. (optional, defaultfalse)uppercaseBoolean If the subtitle should be uppercase or not. (optional, defaultfalse)lowercaseBoolean If the subtitle should be lowercase or not. (optional, defaultfalse)subtitleClassString Additional class, useful when component is used directly on a grid system (optional, default"")
Examples
{
subtitle: "Total Users",
type: "card",
subtitleClass: "text-lg",
color : "info",
tag: "h2"
}
Table.vue
This component is used to create a table. You need to provide a title, a header, a list of positions, and a list of items. Items need to be an array of array with a cell being a regular widget. Not all widget are supported. Check this component import list to see which widget are supported. For example, Text, Icons, Icons, Buttons and Fields are supported.
Parameters
titleString Determine the title of the table.headerArray Determine the header of the table.positionsArray Determine the position of each item in the table in a list of number based on 12 columns grid.itemsArray items to render in the table. This need to be an array (row) of array (cols) with a cell being a regular widget.filtersArray Determine the filters of the table. (optional, default[])minWidthString Determine the minimum size of the table. Can be "base", "sm", "md", "lg", "xl". (optional, default"base")containerClassString Container additional class. (optional, default"")containerWrapClassString Container wrap additional class. (optional, default"")tableClassString Table additional class. (optional, default"")
Examples
{
"title": "Table title",
"header": ["Header 1", "Header 2", "Header 3"],
"minWidth": "base",
"positions": [4,4,4],
"items": [
[
{
"type": "Text",
"data": {
"text": "whitelist-download"
}
},
],
],
filters : [
{
filter: "default",
filterName: "type",
type: "select",
value: "all",
keys: ["type"],
field: {
id: uuidv4(),
value: "all",
// add 'all' as first value
values: ["all"].concat(plugin_types),
name: uuidv4(),
onlyDown: true,
label: "inp_select_plugin_type",
containerClass: "setting",
popovers: [
{
text: "inp_select_plugin_type_desc",
iconName: "info",
},
],
columns: { pc: 3, tablet: 4, mobile: 12 },
},
},
];
}
Tabulator.vue
This component allow to display a table using the Tabulator library with utils and custom components around to work with (like filters). Because we can't instantiate Vue component inside the Tabulator cell, I choose to send default component props to the cell and teleport the component inside the cell. The created instance is store in the tableStore using the id as key in order to use it in other components. UI : I created a formatter for each custom component that will return an empty string. Sorting : because we aren't working with primitives but props object, each columns that have a custom component will have a custom sorter to avoid sorting error. Filtering : I created isomorphic filters that will get the right data to check for each custom component object. To apply a filter, we need to render a field that will be link to the filterTable() function. A11y :I created a11yTable(), with sortable header tab index.
Parameters
idString Unique id of the tableisStripedBoolean Add striped class to the table (optional, defaulttrue)filtersArray List of filters to display (optional, default[])columnsArray List of columns to displayitemsArray List of items to displayactionsButtonsArray Buttons group props to render buttons that will be after filters and before the table stick left. (optional, default[])layoutString Layout of the table. "fitDataTable" useful with wide columns, "fitColumns" useful with narrow columns. (optional, default"fitDataTable")rowHeightNumber Case value is 0, this will be ignored. (optional, default0)colMinWidthNumber Minimum width for each col of a row (optional, default150)colMaxWidthNumber Maximum width for each col of a row. Case value is 0, this will be ignored. (optional, default0)isPaginationBoolean Add pagination to the table (optional, defaulttrue)itemsBeforePaginationNumber Hide pagination unless number is reach. (optional, default10)paginationSizeNumber Number of items per page (optional, default10)paginationInitialPageNumber Initial page (optional, default1)paginationButtonCountNumber Available pagination buttons (optional, default3)paginationSizeSelectorArray Select number of items per page (optional, default[10,25,50,100])
Examples
filter = [{
"type": "like", // isomorphic filter type
"fields": ["ip"], // fields to filter
// setting is a regular Fields props object
"setting": {
"id": "input-search-ip",
"name": "input-search-ip",
"label": "bans_search_ip", # keep it (a18n)
"value": "",
"inpType": "input",
"columns": {"pc": 3, "tablet": 4, "mobile": 12},
},
}];
Returns Void;
Text.vue
This component is used for regular paragraph.
Parameters
textString The text value. Can be a translation key or by default raw text.textClassString Style of text. Can be replace by any class starting by 'text-' like 'text-stat'. (optional, default"")textIconContainerClassString Case we have icon with text, we wrap the text on a container with the icon. We can add a class to this container. (optional, default"col-span-12 flex justify-center items-center")colorString The color of the text between error, success, warning, info or tailwind color (optional, default"")iconNameString The name of the icon to display before the text. (optional, default"")iconColorString The color of the icon. (optional, default"")boldBoolean If the text should be bold or not. (optional, defaultfalse)uppercaseBoolean If the text should be uppercase or not. (optional, defaultfalse)tagString The tag of the text. Can be p, span, div, h1, h2, h3, h4, h5, h6 (optional, default"p")icon(Boolean | Object) The icon to add before the text. If true, will add a default icon. If object, will add the icon with the name and the color. (optional, defaultfalse)attrsObject List of attributes to add to the text. (optional, default{})
Examples
{
text: "This is a paragraph",
textClass: "text-3xl"
attrs: { id: "paragraph" },
}
Title.vue
This component is a general title wrapper.
Parameters
titleString Can be a translation key or by default raw text.typeString The type of title between "container", "card", "content", "min" or "stat" (optional, default"card")tagString The tag of the title. Can be h1, h2, h3, h4, h5, h6 or p. If empty, will be determine by the type of title. (optional, default"")colorString The color of the title between error, success, warning, info or tailwind color (optional, default"")uppercaseBoolean If the title should be uppercase or not. (optional, defaultfalse)lowercaseBoolean If the title should be lowercase or not. (optional, defaultfalse)titleClassString Additional class, useful when component is used directly on a grid system (optional, default"")
Examples
{
title: "Total Users",
type: "card",
titleClass: "text-lg",
color : "info",
tag: "h2"
}
Upload.vue
This component is used to upload files to the server. ATM only used to upload plugins.
Parameters
disabledBoolean If true, the upload will be disabled. (optional, defaultFalse)columnsObject Columns object. (optional, default{"pc":"12","tablet":"12","mobile":"12"})containerClassString Container additional class (optional, default"")maxScreenWString Max screen width within sm, md, lg, xl, 2xl, 3xl (optional, default"2xl")
Examples
{
disabled : True
}