1.0.40 • Published 2 years ago

govil-strip-loading-tabs v1.0.40

Weekly downloads
14
License
MIT
Repository
-
Last release
2 years ago

govil-strip-loading-tabs

a component which load data from dynamic types by given ApiURL and title to present in boxes

How to use

Clone this repo to your local computer, then run:

  • npm install && npm run build

You can now import govil-strip-loading-tabs as a normal package installed from npm like so:

import LoadingTabsStrips from 'govil-strip-loading-tabs';
...

You can also import the type definitions if you're using TypeScript like so:

import  LoadingTabsStrips, { LoadingTab, LoadingTabs } from 'govil-strip-loading-tabs';
...

Available props/state Models

export interface LoadingTab {
    title: string;
    sourceUrl: string;
    id: string;
    selected: boolean;
}

export interface LoadingTabs {
    items: Array<LoadingTab>
}

interface StateModel {
    dataItems: Array<LinkableTitleAndDesc>
}

To customize this component, pass ComponentModel to the items prop.

// your-component.tsx
import  LoadingTabsStrips, { LoadingTab, LoadingTabs } from 'govil-strip-loading-tabs';

//for demo:

const LoadingTabsStripsDemo: LoadingTabs = {
    items : [
        {
            title: 'מדריכים ומידע',
            sourceUrl: 'http://localhost/govil/he/api/GeneralSrtripsApi/tryGetTaggedItems',
            id: '1',
            selected: true,
        }, {
            title: 'שירותים',
            sourceUrl: 'http://localhost/govil/he/api/GeneralSrtripsApi/tryGetTaggedItems',
            id: '2',
            selected: false,
        }, {
            title: 'שאלות ותשובות',
            sourceUrl: 'http://localhost/govil/he/api/GeneralSrtripsApi/tryGetTaggedItems',
            id: '3',
            selected: false,
        }
    ]
}

data structure (vm) expected from api:

interface vm {
    items: Array<LinkableTitleAndDesc>;
    resources: { readMoreTitle: string };
}

interface LinkableTitleAndDesc {
    link: string;
    title: string;
    description: string;
}

...
  <LoadingTabsStrips {...LoadingTabsStripsDemo} />
...

This component was built for the benefit of the citizens of Israel on behalf of the government, but of course also for the benefit of the OpenSource community and freely published in npm

1.0.40

2 years ago

1.0.31

2 years ago

1.0.30

3 years ago

1.0.26

3 years ago

1.0.25

3 years ago

1.0.29

3 years ago

1.0.28

3 years ago

1.0.27

3 years ago

1.0.24

3 years ago

1.0.23

3 years ago

1.0.22

3 years ago

1.0.19

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.15

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.2

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago