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

reactive.fiori

v1.0.1

Published

Build react apps with UI5

Downloads

2

Readme

reactive.fiori

A lightweight react library wrapping SAP UI5 controls

Getting started

  1. install reactive.fiori package
$ npm install reactive.fiori
  1. add UI5 library
    <!-- load the stylesheets eagerly, this can improve the page rendering -->
    <link rel="stylesheet" id="sap-ui-theme-sap.ui.core"
      href="https://sapui5.hana.ondemand.com/resources/sap/ui/core/themes/sap_belize/library.css">
    <link rel="stylesheet" id="sap-ui-theme-sap.m"
      href="https://sapui5.hana.ondemand.com/resources/sap/m/themes/sap_belize/library.css">
    <link rel="stylesheet" id="sap-ui-theme-sap.ui.layout"
      href="https://sapui5.hana.ondemand.com/resources/sap/ui/layout/themes/sap_belize/library.css">

    <!-- load SAP UI5 with configs -->
    <script
		  id="sap-ui-bootstrap"
		  src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
		  data-sap-ui-theme="sap_belize"
		  data-sap-ui-libs="sap.m"
		  data-sap-ui-async="false"
    >
  1. bootstrap UI5 before importing any reactive.fiori components
import 'reactive.fiori/src/ui5/bootstrap';
  1. render react views with reactive.fiori

import React from "react";

import Button from 'reactive.fiori/src/button';
import Breadcrumbs from 'reactive.fiori/src/breadcrumbs';
import Link from 'reactive.fiori/src/link';
import DynamicPage from 'reactive.fiori/src/dynamic-page';
import DynamicPageTitle from 'reactive.fiori/src/dynamic-page-title';
import DynamicPageHeader from 'reactive.fiori/src/dynamic-page-header';
import Title from 'reactive.fiori/src/title';
import OverflowToolbar from 'reactive.fiori/src/overflow-toolbar';
import Text from 'reactive.fiori/src/text';
import FlexBox from 'reactive.fiori/src/flex-box';
import Panel from 'reactive.fiori/src/panel';
import VerticalLayout from 'reactive.fiori/src/vertical-layout';
import ToolbarSpacer from 'reactive.fiori/src/toolbar-spacer';

import { createIDStore } from 'reactive.fiori/src/ui5/utils';

class ExamplePage extends React.Component {

  constructor (props) {
    super(props);

    this.state = {};

    // this will create a local idStore for reusing unique IDs
    this.idStore = createIDStore();
  }

  render() {

    // use uniqueId to generate unique and persistent IDs for the major elements
    // this can improve rendering and performance
    const { uniqueId } = this.idStore;

    return (
      <DynamicPage
        containerProps={{
          style: { height: "100%" }
        }}

        title={(
          <DynamicPageTitle
            ctrlId={uniqueId('pageTitle')}
            heading={(
              <Title text="Request for Bodhi" />
            )}
            breadcrumbs={(
              <Breadcrumbs>
                <Link text="Home Page" />
                <Link text="My Workflow Requests" />
                <Link text="Workflow Details" />
              </Breadcrumbs>
            )}
          />
        )}

        header={(
          <DynamicPageHeader ctrlId={uniqueId('pageHeader')} pinnable={false} >
            <FlexBox justifyContent="SpaceBetween" >
              <Text text="General info" />
              <Text text="Subject user" />
            </FlexBox>
          </DynamicPageHeader>
        )}
        toggleHeaderOnTitleClick={false}

        content={(
          <VerticalLayout ctrlId={uniqueId('pageContent')} >
            <Panel
              headerText="" expandable={false} width={`${window.innerWidth * 0.9}px`} class="sapUiResponsiveMargin"
            >
              <Text text={`Name: Bodhi`} />
            </Panel>
            <Panel
              headerText="This is Panel" expandable={true} width={`${window.innerWidth * 0.9}px`} class="sapUiResponsiveMargin"
            >
              <Text text={`panel content`} />
            </Panel>
          </VerticalLayout>
        )}

        showFooter={true}
        footer={(
          <OverflowToolbar ctrlId={uniqueId('pageFooter')} >
            <Button type="Accept" text="Update" />
            <ToolbarSpacer />
            <Button type="Accept" text="Approve" />
            <Button type="Reject" text="Decline" />
            <Button type="Reject" text="Sendback" />
          </OverflowToolbar>
        )}
      >
      </DynamicPage>
    );
  }
}

export default ExamplePage;

Missing UI5 Components ?

Just add it to ./scripts/create-reactive-ui5-components.js, for example:

  {
    dir: 'dynamic-page',
    name: 'DynamicPage',
    ctrl: 'sap.f.DynamicPage'
  },

And run:

node ./scripts/create-reactive-ui5-components.js

This will create a new class(ReactiveUI5Component) for the given UI5 Control

Roadmaps

[ ] supports on-demand-loading of UI5 controls;