An open API service indexing awesome lists of open source software.

https://github.com/menduz/mzcore-uikit

Simple components for mzcore
https://github.com/menduz/mzcore-uikit

Last synced: 2 months ago
JSON representation

Simple components for mzcore

Awesome Lists containing this project

README

        

# mzcore-uikit

Simple components for mzcore, includes: `` `` ``

## Install

* Install with bower: `$ bower install mzcore-uikit --save`
* Include the following line where you want use this components
```typescript
// in your own module 'modules/select_user_page.ts'
import * as uikit 'bower_components/mzcore-uikit/index'
```
```typescript
// or in 'components/components.ts'
export * from 'bower_components/mzcore-uikit/index'
```
* We are ready to use the components

# Components

## ``
Is a simple autocomplete component with a very basic style, so you can add a custom theme. It extends MzInput in order to use with a `mz-model="selectedItem"` attribute.
You must provide a method used for fullfill the autocomplete list, this method should return a Promise which resolves as an array with values or objects.

### Usage:

```xml

...

{scope.Name} ({scope.Email})

...
```

```typescript
/// myController.ts
interface IUser { Name: string; Email: string; }

@MyController.Template(`myView.xml`)
export class MyController extends mz.widgets.BasePagelet /* or mz.app.Page or any other widget or component */ {

@MyController.proxy
selectedUser: IUser;

performSearch(typedText: string){
return mz.xr.get(mz.xr.urlEncode `@api/users?filter=${typedText}`)
.then(x => x.data);
}




/*
perfomSearch(){
return Promise.resolve(
[
{ Name: 'Agustin', Email: '[email protected]' },
{ Name: 'Uriel', Email: '[email protected]' }
]
);
}
*/
}

```

You also can initialize with a value:
```typescript
export class UserSearchWindow extends mz.app.Page {
@UserSearchWindow.proxy
selectedUser = {
Name: 'Agustin',
Email: '[email protected]'
}
}
```

## ``

Provides a simple way for creating tabbed content.

### Usage

```xml


User's wall


Message list


Message list

```

renders as:

```html





  • Wall


  • Messages


  • Photos






User's wall



```