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

@ortelius/inorigojs-ui-react

v0.0.48

Published

Inorigo UI React Components

Downloads

17

Readme

InorigoJS React UI Components

Bundle of React components for use with Inorigo solutions.

Installing package

Using npm:

npm install @ortelius/inorigojs-ui-react

DropDown

Drop down component.

import {DropDown} from "@ortelius/inorigojs-ui-react";
<DropDown
items={myItemArray} //[{id, presentation}, {id, presentation}]
selectedId={mypreselectedid}
classNameDiv="" //Add a css class to the root div element
classNameSelect="form-control"
classNameDefault="defaultdropdown"
placeholder="Employment Type"
callbackItemSelect={(value) => { console.log(value) }}
callbackItemClear={() => { console.log(value) }}
radio //Make it a radio button
/>

Properties

  • items array[{id, presentation}] - Array of values to show in the dropdown.
  • placeholder string - Default text for text
  • callbackItemSelect function - Function that should get triggered when an item gets selected
  • callbackItemClear function - Function that should get triggered when an item gets deselected
  • classNameDiv string - Css classname for dropdown container
  • classNameDefault string - Css classname for default text
  • classNameSelect string- Css classname for selected value
  • itemSelected string- Id of a preselected item
  • radio boolean- Render as a radio button list
  • disabled boolean- Disables input

Searchable drop down

import {SearchableDropDown} from "@ortelius/inorigojs-ui-react";
<SearchableDropDown
items={MyItemList} //[{id, presentation}, {id, presentation}]
selectedId={mypreselectedid}
classNames="form-control" //Add css classes
classNameDefault="defaultdropdown" //Add css classes
placeholder="My cool list"
callbackItemSelect={(value) => { console.log(value }}
callbackItemClear={() => { console.log(null) }}
/>

Properties

  • items array[{id, presentation}] - Array of values to show in the dropdown.
  • placeholder string - Default text for text
  • callbackItemSelect function - Function that should get triggered when an item gets selected
  • callbackItemClear function - Function that should get triggered when an item gets deselected
  • classNames string - Css classname for dropdown container
  • classNameDefault string - Css classname for default text
  • itemSelected string- Id of a preselected item
  • disabled boolean- Disables input

Multi Select DropDown

import {MultiSelectDropDown} from "@ortelius/inorigojs-ui-react";
<MultiSelectDropDown
items={myListItems} //[{id, presentation}, {id, presentation}]
selectedIds={["id2", "id5"]}
placeholder="Multi Selector"
multiple={true} //Show all selected values in folded preview
callbackItemSelect={value => {
this.props.context.handleChange("site", value);
}}
wclassname="sitedropdown" //Add css classes
/>

Properties

  • items array[{id, presentation}] - Array of values to show in the dropdown.
  • placeholder string - Default text for text
  • callbackItemSelect function - Function that should get triggered when an item gets selected
  • callbackItemClear function - Function that should get triggered when an item gets deselected
  • classNames string - Css classname for dropdown container
  • classNameDefault string - Css classname for default text
  • selectedIds array[string]- Id of a preselected item
  • disabled boolean- Disables input
  • multiple boolean - Allow multiple values.
  • wclassname string - Css classname that sets the width of the field.

Loader (fullscreen)

Renders a inorigo loading spinner

import {Loader} from "@ortelius/inorigojs-ui-react";
<Loader />

InlineLoader (not fullscreen)

Renders a inorigo loading spinner

import {InlineLoader} from "@ortelius/inorigojs-ui-react";
<InlineLoader />

Drag and drop (Deprecated)

Drag and drop component

import {DragAndDrop} from "@ortelius/inorigojs-ui-react";

Properties

  • content - which is the components that should be rendered for each draggable item.
  • data - is the data as an array that the content represents. The mapping of components (for content) should be on this data.
  • onDropCallback - is the function that should be executed when the dragged item is dropped.
  • switchPlaces - This function switches the position of the dragged item with the position of the target item.
  • onDragStartHandler - When an item starts to be dragged, this event fires. It activates the drop zones for all of the places where an item may be dropped, and sets which item is being dragged.
  • onDropHandler - This function fires when a dragged item is dropped onto a drop zone. It triggers "switchPlaces"and the onDropCallback that was specified earlier.
  • onDragOverHandler - Changes the css-classes of the hovered items so that it is visible where the item will land if dropped there.
  • onDragOutHandler - Only prevents default behaviour of whatever was dragged out of.
  • activateDropZones - When the component is loaded all of the drop zones have display: none so that they do not interfere whith the default functionality of other HTML elements (such as onClick). When they are activated, they block all other events beneath the drop zones.
  • deActivateDropZones - Hides drop zones once an item has been dropped and they are no longer needed.

Bootstrap window (Deprecated)

Component for quickly creating a modal window.

Example

import {BootstrapWindow} from "@ortelius/inorigojs-ui-react";

The Bootstrap Modal Window component requires Bootstrap 4.1.x to be installed in your project, either through CDN or NPM. The window will have all child markup as its content. The component will be invisible at first, and does not display anything until a modal event has been fired. To summon the window you can simply add attribute to anything clickable in your markup as such:

<a data-toggle="modal" data-target={`#Modal${myModalID}`}> Click me! </a>

Then make sure to add the BootstrapWindow element somewhere in your markup:

<BootstrapWindow title="One sassy title" id={`#Modal${myModalID}`}>
  <div>Some content for the window!</div>
 </BootstrapWindow>

To change the width use the following css in your main stylesheet:

.modal-lg {
max-width: 80% !important;
 }

Or you can use @media to define different breakpoints:

@media (min-width: 576px) {
  .modal-dialog {
      max-width: 600px !important;
     margin: 1.75rem auto !important;
}
}