1.17.1 • Published 1 month ago

@uoa/web-components v1.17.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

UOA Web Components Library

This library contains collection of web components built by UOA for their applications using stencil.

  • Logo
  • Header
  • Help Modal
  • Steps Bar
  • Search Autocomplete
  • Document Upload
  • Search Combo Dropbox

Uoa web components work in any major framework or with no framework at all.

Angular Integration

It is a two-step process.

  • Include the CUSTOM_ELEMENTS_SCHEMA in the modules that use the components. This code should be added into the AppModule and in every other modules that use your custom elements. Here is an example of adding it to AppModule
import { BrowserModule } from '@angular/platform-browser';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';

import { AppComponent } from './app.component';

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, FormsModule],
  bootstrap: [AppComponent],
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
  • Call defineCustomElements(), it needs to be called once during the bootstrapping of your application. One convenient place to do this is in main.ts as such:
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

import { defineCustomElements } from '@uoa/web-components/dist/loader';

if (environment.production) {
  enableProdMode();
}

platformBrowserDynamic()
  .bootstrapModule(AppModule)
  .catch((err) => console.log(err));
defineCustomElements();

Include web components style sheet to angular.json file styles tag.

 "styles": [
              {
                "input": "node_modules/@uoa/web-components/dist/web-components/web-components.css"
              },
            ],

Include web components svgs to angular.json file assets tag.

 "assets": [
              {
                "glob": "**/*",
                "input": "src/assets",
                "output": "assets"
              },
              {
                "glob": "**/*",
                "input": "node_modules/@uoa/web-components/dist/assets",
                "output": "assets"
              },
            ]

In order to integrate with other framework check following link. Framework Integration.

Logo Component Usage

To start using Logo component inside your project.

Inside your html you can add tag with attributes/properties

//Default Logo
<uoa-logo></uoa-logo>
// Logo with Properties
<uoa-logo logo-type="vertical" color="primary" size="small"></uoa-logo>

Properties

PropertyAttributeDescriptionTypeDefault
colorcolorThe color to use from your application's color palette."dark" \| "inverted" \| "light" \| "primary"'primary'
logoTypelogo-typeType of logo. Default options are: "vertical" and "horizontal""horizontal" \| "vertical"'vertical'
sizesizeThe size of logo"default" \| "large" \| "small" \| "xlarge" \| "xsmall"

Header Component Usage

To start using Header component inside your project. Simply add following tag with attributes/properties

// Default header
<uoa-header></uoa-header>

// header with properties
<uoa-header size="small" color="primary" logo-type="vertical" logo-position="middle">
  <div slot="start">hello header</div>
  <div slot="end" class="d-flex flex-end"><ion-button color="primary">Primary</ion-button></div>
</uoa-header>

Properties

PropertyAttributeDescriptionTypeDefault
colorcolorThe color to use from your application's color palette."dark" \| "inverted" \| "light" \| "primary"'primary'
logoPositionlogo-positionLogo Position: left, right or middle. Default is middle."end" \| "middle" \| "start"'middle'
logoTypelogo-typeType of logo. Default options are: "vertical" and "horizontal""horizontal" \| "vertical"'vertical'
sizesizeThe size of logo"default" \| "large" \| "small" \| "xlarge" \| "xsmall"'small'

Slots

SlotDescription
Content is placed along with end slot if provided without a slot. Slot moves left or right depends on logo Position.
"end"Content is placed to the right of the Logo
"start"Content is placed to the left of the Logo

CSS Custom Properties

NameDescription
--header-backgroundBackground of header.
--header-text-colorText color of header.
--margin-bottomBottom margin of header.

Help Modal Usage

To start using this component into your component.

Inside your html you can add tag with attributes/properties

<uoa-help>Hello help Content</uoa-help>

Properties

PropertyAttributeDescriptionTypeDefault
htmlContenthtml-contentHtml Content of the modal. It can be passed as a property/attribute or as html content inside uoa-help tag.stringundefined
linkTextlink-textClickable text of Linkstring'Help'
modalTitlemodal-titleTitle of the modalstring'Help'

Steps Bar Usage

To start using this component just add tag with attributes/properties.

<uoa-steps-bar steps="4" current-step="2"> </uoa-steps-bar>

Properties

PropertyAttributeDescriptionTypeDefault
currentStepcurrent-stepCurrent Step on the progress/step bar.number1
stepsstepsTotal Number of Steps.numberundefined
stepsInfosteps-infoArray of description of steps for aria-labels.string[][]

Events

EventDescriptionType
stepClickedStep number emitted when component is clicked.CustomEvent<number>

CSS Custom Properties

NameDescription
--button-padding-endStepsbar button padding from end.
--button-padding-startStepsbar button padding from start.
--icon-font-sizeStepsbar done icon font size.
--space-topStepsbar padding from top.
--steps-backgroundBackground color of done / in progress steps.
--steps-background-hoverBackground color of done steps on hover.
--sticky-topIf "none" stepsbar is not sticky. Default value is "0".

Search Autocomplete Usage

To start using this component just add tag with attributes/properties.

<uoa-search-autocomplete
                placeholder="Search a Pet"
                search-button="false"
                search-value="a"
                options='["cat","dog","fish","horse","snake","lizard"]'
              ></uoa-search-autocomplete>

<uoa-search-autocomplete
                placeholder="select a value"
                search-button="true"
                search-value=""
                filter-button="true"
                options='["cat","dog","fish","horse","snake","lizard"]'
                search-filters-list='[{
                          "code": "location",
                          "desc": "Filter By Location",
                          "type": "checkbox",
                          "options": [{
                              "code": "a",
                              "desc": "a orginiser 1"
                            },
                            {
                              "code": "b",
                              "desc": "b Orginiser "
                            },
                            {
                              "code": "c",
                              "desc": "c Orginiser 3",
                              "checked": true,
                              "default": false
                            }
                          ]
                        },
                        {
                          "code": "date1",
                          "desc": "Filter By Date ",
                          "type": "date",
                          "options": {
                            "titleFrom": "From Date ",
                            "titleTo": "To Date",
                            "min": "2022-01-11",
                            "max": "2022-03-11",
                            "from": "2022-01-18",
                            "to": "2022-03-11",
                            "default": true
                          }
                        },
                        {
                          "code": "Price",
                          "desc": "Filter By Price",
                          "type": "number",
                          "options": {
                            "titleFrom": "From Price",
                            "titleTo": "To Price",
                            "min": 0,
                            "max": 5
                          }
                        }

                      ]'
              ></uoa-search-autocomplete>

Properties

PropertyAttributeDescriptionTypeDefault
filterButtonfilter-buttonShow Filter button with search field.booleanfalse
optionsoptionsList of data to use for auto complete.string \| string[]undefined
placeholderplaceholderPlace holder text for search field..string'Search ...'
searchButtonsearch-buttonShow Search button with search field.booleantrue
searchFiltersListsearch-filters-listList of Search Filters with filter options.(DateFilter \| NumberFilter \| CheckBoxFilter)[] \| stringundefined
searchValuesearch-valueDefault Search string.stringundefined
showFilterOptionsshow-filter-optionsShow Filter options on first load.booleanfalse

Events

EventDescriptionType
filteredArrayFilters object emitted.CustomEvent<Filter[]>
searchedTextSearched string emitted.CustomEvent<string>

CSS Custom Properties

NameDescription
--checkbox-columnsNo. of columns for checkbox filter. Default 2.

Document Upload Usage

To start using this component just add tag with attributes/properties.

<uoa-upload-doc></uoa-upload-doc>

 <uoa-upload-doc max-files="3" allowed-type="image" max-file-size="5"></uoa-upload-doc>

Properties

PropertyAttributeDescriptionTypeDefault
allowMultipleallow-multipleAllow mulitple files selection.booleanfalse
allowedTypeallowed-typeAllowed file types."all" \| "custom" \| "doc" \| "image" \| "pdf" \| "pdfAndImage"'pdfAndImage'
customDescriptioncustom-descriptionAdditional description for doc upload.string''
customTypecustom-typeProvide custom accepted type/types of file.stringundefined
customTypeDescriptioncustom-type-descriptionProvide description of custom file type/ types.stringundefined
hideWarningMessagehide-warning-messageShow or Hide the warning messagebooleanundefined
maxFileSizemax-file-sizeMax size of file allowed in mb.number10
maxFilesmax-filesMax number of files can upload.number1
maxFilesWarningMessagemax-files-warning-messageCustom file limit warning messagestring'You have reached the maximum number of files to upload.'
selectedFiles--Pass Selected Files to component.File[][]

Events

EventDescriptionType
filesSelectedEmit selected files.CustomEvent<File[]>

CSS Custom Properties

NameDescription
--font-defaultFont size of text in upload area.
--font-smallFont size of text in info area.

Combo Search Dropbox

To use this component, provide the component with properties of the searchList.

// standard usage with search-list property.
<combo-search-dropbox
	search-list='["Cats",
				  "Dogs",
				  "Elephants",
                  "Lions",
				  "Rabbits"]'></combo-search-dropbox>

// placeholder, disable, search-list and search-value (initial search value) set.
<combo-search-dropbox
          placeholder='Search your value here...'
          disable='true'
          [searchList]='arrayOfObjects'
          search-value='Annie'
          primary-search-field='name'
          ></combo-search-dropbox>

...

const arrayOfObjects=[{'name':'Annie', 'age': 10}, {'name':'Sam', 'age': 6}];

Properties

PropertyAttributeDescriptionTypeDefault
disabledisableTo disable the input of component.booleanundefined
placeholderplaceholderPlaceholder string for the search bar.string'Search ...'
primarySearchFieldprimary-search-fieldPrimary search field to search in search list.stringundefined
searchListsearch-listList of data to select and search from.any[] \| stringundefined
searchValuesearch-valueInitial Search Value.stringundefined

Events

EventDescriptionType
chosenItemChosen (selected) data, emitted as the chosenItem by the event emitter.CustomEvent<any>

1.17.1

1 month ago

1.17.1-beta.G

2 months ago

1.17.1-beta.Z

2 months ago

1.17.1-beta.F

2 months ago

1.17.1-beta.E

3 months ago

1.17.0-beta.3

7 months ago

1.17.0-beta.2

7 months ago

1.17.0-beta.5

7 months ago

1.17.0-beta.4

7 months ago

1.17.0-beta.1

7 months ago

1.15.2-beta2

9 months ago

1.17.0-beta1

8 months ago

1.16.1

8 months ago

1.16.0

8 months ago

1.15.2-beta.5

9 months ago

1.17.0

6 months ago

1.17.1-beta.3

8 months ago

1.17.1-beta.4

8 months ago

1.17.1-beta.5

8 months ago

1.17.1-beta.6

8 months ago

1.17.1-beta.1

8 months ago

1.16.0-beta.E

8 months ago

1.17.1-beta.2

8 months ago

1.16.0-beta.F

8 months ago

1.16.0-beta.C

9 months ago

1.16.0-beta.D

9 months ago

1.16.0-beta.A

9 months ago

1.16.0-beta.B

9 months ago

1.16.0-beta.7

9 months ago

1.16.0-beta.8

9 months ago

1.16.0-beta.6

9 months ago

1.16.0-beta.3

9 months ago

1.16.0-beta.4

9 months ago

1.16.0-beta.1

9 months ago

1.16.0-beta.2

9 months ago

1.17.1-beta.10

8 months ago

1.16.1-beta.1

8 months ago

1.17.0-beta.7

7 months ago

1.17.1-beta.7

8 months ago

1.17.0-beta.6

7 months ago

1.17.1-beta.8

8 months ago

1.17.0-beta.9

7 months ago

1.17.1-beta.9

8 months ago

1.17.0-beta.8

7 months ago

1.17.1-beta.C

6 months ago

1.17.1-beta.D

6 months ago

1.17.1-beta.A

6 months ago

1.17.1-beta.B

6 months ago

1.15.2-beta1

11 months ago

1.15.1-beta1

11 months ago

1.15.1

1 year ago

1.15.0-beta5

1 year ago

1.15.0-beta4

1 year ago

1.15.0-beta3

1 year ago

1.15.0-beta2

1 year ago

1.15.0

1 year ago

1.14.0

1 year ago

1.13.0-beta.39

1 year ago

1.13.0-beta.38

1 year ago

1.13.0-beta.42

1 year ago

1.13.0-beta.41

1 year ago

1.13.0-beta.31

2 years ago

1.13.0-beta.34

2 years ago

1.13.0-beta.3

2 years ago

1.13.0-beta.33

2 years ago

1.13.0-beta.36

2 years ago

1.13.0-beta.35

2 years ago

1.13.0-beta.37

2 years ago

1.13.0

2 years ago

1.12.0-beta.8.10

2 years ago

1.12.0-beta.8.9

2 years ago

1.12.0-beta.8.8

2 years ago

1.12.0-beta.8.7

2 years ago

1.12.0-beta.8.6

2 years ago

1.12.0-beta.8.5

2 years ago

1.12.0-beta.8.4

2 years ago

1.12.0-beta.8.3

2 years ago

1.12.0-beta.8.2

2 years ago

1.12.0-beta.8.1

2 years ago

1.12.0-beta.7

2 years ago

1.12.0-beta.8

2 years ago

1.12.0-beta.6

2 years ago

1.12.0-beta.5

2 years ago

1.12.0-beta.4

2 years ago

1.12.0-beta.2

2 years ago

1.12.0-beta.3

2 years ago

1.12.0-beta.1

2 years ago

1.12.0-beta.0

2 years ago

1.12.0

2 years ago

1.11.0

2 years ago

1.10.0

2 years ago

1.9.1-beta.3

2 years ago

1.9.1-beta.2

2 years ago

1.9.1-beta.0

2 years ago

1.9.1-beta.1

2 years ago

1.9.1

2 years ago

1.9.0

2 years ago

1.8.1

2 years ago

1.8.0-beta.0

2 years ago

1.8.0

2 years ago

1.7.0-beta.1

2 years ago

1.7.0-beta.2

2 years ago

1.7.0

2 years ago

1.6.0

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

0.0.2-beta.0

3 years ago

0.0.2-beta.1

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago