npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rpcm-winbox-react

v1.0.0

Published

Winbox.js react module

Downloads

3

Readme

rpcm-winbox-react

Winbox.js react module

Install

npm install --save react
npm install --save react-dom
npm install --save winbox
npm install --save rpcm-winbox-react

Usage in functional components

import React from "react";
import WbModal from "rpcm-winbox-react";

var SimpleExample = () => {
    return <WbModal />
}
import React from "react";
import WbModal from "rpcm-winbox-react";

var ComplexExample = () => {
    var handleAction = () => {
        console.log("action");
    }
    var handleClose = () => {
        console.log("close");
    }
    return (
        <WbModal
            timestamp={timestamp}                                   // forces re-render
            onClose={() => handleClose()}                           // modal close handler
            theme="white" 
            modalBodyCssClass="extra-body-styles"
            noMin={true} 
            noMax={true} 
            noFull={true} 
            noClose={true} 
            isVisible={isModalVisible}
            noResize={true} 
            winboxCloseButtonId="btnCloseWinbox"                    // specify a modal close button
            isSingleton={false}
            styles={{
                modal: {"border-radius": "12px 12px 0 0"}, 
                body: {"font-family": "none"}, 
                title: {"color": "white"},
                header: {}
            }} 
            title="Mega Modal"
            recenterOnRerender={false}
            headerBackgroundColor="linear-gradient(rgb(20, 127, 193), rgb(34, 148, 218))"
            modal={false}>
            <div className="wbmodal-main-content">
                <div>
                    <textarea rows="10" style="width:90%"></textarea>
                </div>
                <div style={{ textAlign: "right" }}>
                    <button id="btnCloseWinbox" type="button" className="btn btn-default pointer">Close</button>
                    <button type="button" className="btn btn-default pointer" onClick={() => handleAction()}>Process</button>
                </div>
            </div>
        </WbModal>
    )
}

Props

var options = {
    /****
     *
     * default 
     * 
     */
    title: string,                                          // default "Modal"
    border: number,                                         // default 0
    headerBackgroundColor: string,                          // background style for the modal header
                                                            // default linear-gradient(90deg, #ff00f0, #0050ff)

    x: string | number | 'center',                          // default center
    y: string | number | 'center',                          // default center
    modal: boolean,                                         // default false
    minWidth: number,                                       // default 500
    theme: string,                                          // take from the Winbox themes, check Winbox docs for more info 
                                                            // default modern

    isSingleton: boolean,                                   // true keeps a Winbox instance inmemory/DOM. 
                                                            // false kills instance and removes from DOM
                                                            // default true

    /****
     *
     * additional 
     * 
     */
    noAnimation: boolean,                                   // handles modal animations
    noShadow: boolean,                                      // handles modal shadow
    noHeader: boolean,                                      // handles header visibility
    noMin: boolean,                                         // handles minimize button
    noMax: boolean,                                         // handles maximize button
    noFull: boolean,                                        // handles fullscreen button
    noClose: boolean,                                       // handles close button
    noResize: boolean,                                      // handles modal resizing
    noMove: boolean,                                        // handles modal draggability


    hide: boolean,                                          // handles modal visibility on modal creation
    isVisible: boolean,                                     // handles modal visibility on modal render
    border: number,                                         // Set the border width of the window (supports all css units, like px, %, em, rem, vh, vmax)

    timestamp: number,                                      // provides re-rendering when value changes, usefull when modal content changes
    
    top: string | number,                                   // Define the available area (relative to the document) in which the window can move or could be resized (supports units "px" and "%").
    bottom: string | number,                                // Define the available area (relative to the document) in which the window can move or could be resized (supports units "px" and "%").
    left: string | number,                                  // Define the available area (relative to the document) in which the window can move or could be resized (supports units "px" and "%").
    right: string | number,                                 // Define the available area (relative to the document) in which the window can move or could be resized (supports units "px" and "%").
    height: string | number,                                // Supports "right" for x-axis, "bottom" for y-axis, "center" for both, units "px" and "%" also for both.
    width: string | number,                                 // Supports "right" for x-axis, "bottom" for y-axis, "center" for both, units "px" and "%" also for both.

    onclose: function(),
    onmove: function(),
    onresize: function(),
    onblur: function(),
    onfocus: function(),

    modalCssClass: string,                                  // add extra CSS classes to the respective DOM elements
    modalHeaderCssClass: string,                            // add extra CSS classes to the respective DOM elements
    modalTitleCssClass: string,                             // add extra CSS classes to the respective DOM elements
    modalBodyCssClas: string,                               // add extra CSS classes to the respective DOM elements

    winboxCloseButtonId: string,                            // specify a DOM element ID which handles the modal close method.
    recenterOnRerender: boolean,                            // sets to center/center (x,y) uppon rerendering when true
    
    styles: Object                                          // adds additional inline styles directly to the specified elements
}