Mobiscroll

repository·master·Indexed 23 days ago

https://github.com/acidb/mobiscroll

A high-performance UI library for progressive web apps (PWAs) and hybrid mobile development. It provides a set of free form controls (including text fields, buttons, switches, and sliders) and advanced commercial components such as calendars, schedulers, and date/time pickers. Mobiscroll is framework-agnostic and offers specific API variants for jQuery, Angular, AngularJS, and React.

Tokens
10.9K
Snippets
11
Records
72
Agent score
81%

What's inside mobiscroll

  1. Overview of Mobiscroll UI Library

    master

    Mobiscroll is a UI library designed for progressive web apps (PWAs) and hybrid development, focusing on usability and performance. It provides a set of customizable controls (Mobiscroll Forms) that are included in this repository for free, alongside advanced commercial components.

    Supported Frameworks

    While Mobiscroll is framework-agnostic at its core, it provides specific API variants for:

    • jQuery / jQuery Mobile
    • Angular / Ionic
    • AngularJS / Ionic 1
    • React
  2. Manage the React application with available scripts

    master

    The React example project uses yarn to manage development, testing, and production tasks. Use the following commands in the project directory:

    • Development: Run the app in development mode with hot reloading.
    • Testing: Launch the test runner in interactive watch mode.
    • Production Build: Bundle the app for production, optimizing performance and minifying files for deployment.
    • Eject: A one-way operation to expose the underlying build configuration (webpack, Babel, etc.) for full customization.
    yarn start
    
    yarn test
    
    yarn build
    
    yarn eject
  3. Scaffold Angular components and other entities

    master

    You can use the Angular CLI to generate new project structures. Use ng generate component <component-name> for components, or specify other types such as directive, pipe, service, class, guard, interface, enum, or module.

    ng generate component component-name
  4. Use Mobiscroll components with Angular Forms

    master

    Mobiscroll components implement the ControlValueAccessor interface, allowing them to work seamlessly with Angular's ngModel and formControl directives.

    When using a Mobiscroll component as a form control, the component handles:

    • writeValue(v): Propagating model changes to the Mobiscroll instance.
    • registerOnChange(fn): Registering the callback to notify the form of value changes.
    • registerOnTouched(fn): Registering the callback to notify the form when the control is touched.
    • setDisabledState(isDisabled): Synchronizing the disabled state between the Angular form and the Mobiscroll instance.

    Note: The component uses an internal MbscInputService to track if a control is set and manages the transition between the native input and the Mobiscroll instance.

  5. Use MbscSegmentedGroup and MbscSegmented

    master

    The MbscSegmentedGroup allows for a group of segmented buttons (similar to radio or checkbox groups). It uses MbscRadioService to coordinate selection.

    MbscSegmentedGroup Inputs:

    • select: Determines selection mode. Options: 'single' (default) or 'multiple'. This sets the multiSelect property on the underlying service.

    MbscSegmented Inputs:

    • value: The value of the segment.
    • icon: An icon identifier.
    • checkedChange: An EventEmitter for value changes (used when not using FormControl).
  6. Use MbscRadioGroup and MbscRadio

    master

    To create a group of radio buttons, wrap MbscRadio components inside an MbscRadioGroup. The group manages the selection state via MbscRadioService.

    MbscRadioGroup Inputs:

    • name: The name of the radio group.
    • color: The color preset for the group.

    MbscRadio Inputs:

    • value: The specific value for this radio option.
    • color: The color preset for the radio button.
    • error: Boolean to indicate an error state.
    • errorMessage: The error message to display.