0.1.71 • Published 1 year ago

empower-display v0.1.71

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

Getting Started with Empower Display Component (Typescript)

  1. Alert
  2. Alert with batch
  3. Alert with Dropdown
  4. Button with Dropdown
  5. Badge
  6. Chip
  7. Card
  8. Nav Tab
  9. Info Single
  10. Info Multiple
  11. Accordion
  12. Related Activities
  13. Media Thumbnail
  14. Snackbar

1) Alert

Initialization

import {Alert} from 'empower-display';

Usage

const getActions = (action, data) => {
  switch (data) {
    case 'submit':
      break;

    case 'cancel':
      break;
  }
}

const configAlert =  {
    show: true,
    actionable: true,
    status: "success",  // "success", "info", "critical", "warning"
    title: "Sample Alert Title",
    message: ["Sample  Message Here"],
    label:'optional Label',
     // batch: [],
    actions: [
        {
            label: 'Submit',
            clicked: (event) => getActions(event, 'delete-batch'),
            isDisabled: false
        },
        {
            label: 'Cancel',
            clicked: (event) => getActions(event, 'cancel-alert'),
            isDisabled: false
        }
    ],
}
 <Alert config={configAlert} />

2) Alert with batch

Initialization

import {Alert} from 'empower-display';

Usage

const getActions = (action, data) => {
  switch (data) {
    case 'submit':
      break;

    case 'cancel':
      break;
  }
}

const configAlertBatch = {
  show: true,
  actionable: true,
  status: "warning", // "success", "info", "critical", "warning"
  title: "Sample Alert Title",
  message: [
    {
      title: "EMPLOYEE HAS AN EXISTING BEGINNING BALANCE.",
      message: [
        "JUAN MARTIN PENAFLORIDA"
      ]
    }
  ],
  label: "optional Label",
  batch: 5, //limit before see more
  actions : [
    {
      "label": "Submit",
      "isDisabled": false
    },
    {
      "label": "Cancel",
      "isDisabled": false
    }
  ]
}
 <Alert config={configAlertBatch} />

3) Alert with Dropdown

Initialization

import {Alert} from 'empower-display';

Usage

const getActions = (action, data) => {
  switch (data) {
    case 'submit':
      break;

    case 'cancel':
      break;
  }
}

const configAlertDropdown = {
    show: true,
    actionable: true,
    status: "success",
    title: "Sample Alert Title",
    message: ["Sample  Message Here"],
    buttons: [
      {
          label: 'Start Editing',
          icon: <img src="https://storage.googleapis.com/empower-production-assets/images/icons/icon-arrowdown-white.svg" />,
          iconPlacement: 'right', // left, right
          class: '', // this is optional
          withDropDown: true,
          actions: [
            {
              label: 'As Public Template',
              action: 'as_public',
              isDisabled: false,
              tooltip: {
                delay:400, // default 400
                direction: 'right' ,//top, right, bottom, left
                content:'This is the content for tooltop'
              }
            },
            {
              label: 'As Assigned Template',
              action: 'as_assigned',
              isDisabled: false,
              tooltip: {
                delay:400, // default 400
                direction: 'right' ,//top, right, bottom, left
                content:'This is the content for tooltop'
              }
            }
          ]
      },
      {
          label: 'Choose Another Template',
          icon: <img src="https://storage.googleapis.com/empower-production-assets/images/icons/icon-arrowdown-white.svg" />,
          iconPlacement: 'right', // left, right
          class: 'outline', // this is optional
          withDropDown: false, //set to "true" if you want to add dropdown
          action: 'another_template' //replace with array "actions" if you want option.
      }
    ]
  }
  <Alert config={{...configAlertDropdown}} onChange={(action, data) => getActions(action, data)} />
  

4) Button with DropDown

Initialization

import {Button} from 'empower-display';

Usage

const getActions = (action, data) => {
  switch (data) {
    case 'submit':
      break;

    case 'cancel':
      break;
  }
}

  const configButtonDropdown = {
    show: true,
    actionable: true,
    status: "success",
    title: "Sample Alert Title",
    message: ["Sample  Message Here"],
    label: 'Start Editing',
    icon: <img src="https://storage.googleapis.com/empower-production-assets/images/icons/icon-arrowdown-white.svg" />,
    iconPlacement: 'left', // left, right
    class: 'outline', //this is optional
    actions: [
      {
        label: 'As Public Template',
        action: 'as_public',
        isDisabled: false,
        tooltip: {
          delay:400, // default 400
          direction: 'right' ,//top, right, bottom, left
          content:'This is the content for tooltop'
        }
      },
      {
        label: 'As Assigned Template',
        action: 'as_assigned',
        isDisabled: true,
        tooltip: {
          delay:400, // default 400
          direction: 'right' ,//top, right, bottom, left
          content:'This is the content for tooltop'
        }
      }
    ],
    withDropDown: true
}
  <Button config={{...configButtonDropdown}} onChange={(action, data) => getActions(action, data)} />

5) Badge

Initialization

import {Badge} from 'empower-display';

Usage

const configBadge = {
  currentStat: 'PRE_APPROVED_DONE',
  historyStat: ['REQUEST_STATUS_WARNING']
}
<Badge config={configBadge} />

6) Chip

Initialization

import {Chip} from 'empower-display';

Usage

const configChip = {
  removeIcon: true,
  label: 'Chip Label',
  id: 'chipID',
  disabled: false,
}
<Chip config={configChip} onChange={e => getActions(e, 'chip')} />

7) Card

Initialization

import {Card} from 'empower-display';

Usage

<Card id={'cardId'} > This  is a Card Content</Card>

8) Nav Tab

Initialization

import {NavTab} from 'empower-display';

Usage

const  configTab = {
    tabs: [
      { label: 'On Time', value: 'ON_TIME', status: 'ON_TIME' },
      { label: 'Tardy', value: 'TARDY', status: 'LATE' },
      { label: 'On Leave', value: 'ON_LEAVE', status: null },
      { label: 'Not in Office', value: 'NOT_IN_OFFICE', status: '' }
    ],
    selected: ''
  }
<NavTab config={configTab} onChange={e => getActions(e, 'tab')} />

9) Info Single

Initialization

import {Info} from 'empower-display';

Usage

 const  configInfoSingle = {
    title: 'Info Title',
    info: "<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>"
  }
<Info config={configInfoSingle} onChange={e => getActions(e, 'info')} />

10) Info Multiple

Initialization

import {Info} from 'empower-display';

Usage

 const  configInfoMultiple = {
    title: 'Info Title',
    info: {
      infoDetails: {
        companyPolicy: "<p><strong>Certifying Daily Time Records (DTR) </strong></p>\n<p>All Employees are expected to certify all DTRs covering a pay period as true, correct, accurate and final that will serve as basis to compute their pay.</p>\n<p><strong>Failure</strong> to certify DTRs shall result to an Auto-Certification at the end of the pay cutoff. Uncertified DTRs will be deemed true, correct, accurate and final, except for Absences incurred on the day of the cutoff itself, either on the 10th or 26th of the month.</p>\n<p>For these absences, either of the following will apply:</p>\n<p>1. The employee is given until the 12th or the 27th to amend the DTR and seek approval;</p>\n<p>2. The Timekeeping &amp; Benefits department will verify the details of the absence incurred and amend the DTR appropriately.</p>\n<p>The Company has two (2) pay cutoff periods:</p>\n<p>1. Payroll for the 15th -- 26th of the previous month to the 10th of the current month 2. Payroll for the 30th -- 11th to the 25th of the current month.</p>\n<p><strong>Clock In</strong></p>\n<p>When an employee clocks into work, the Company&rsquo;s online system shall provide the applicable status:</p>\n<p><strong> ON TIME</strong> - Clock In before the start of shift and/ or before the grace period (if any) ends</p>\n<p>TARDY - Clock In within the first four (4) hours after the shift has started</p>\n<p>ABSENT (1ST HALF and TARDY) - Clock In beyond the first four (4) hours after the shift has started will be tagged as Tardy. The first four (4) hours after the shift has started will be tagged as Absent - 1st Half.</p>\n<p><strong> Tardiness</strong></p>\n<p>1. Failure to come ON TIME six (6) times or accumulation of at least 60 minutes of TARDINESS (whichever comes first) within the 11th of the current month to the 10th of the following month, shall constitute an offense of TARDINESS.</p>\n<p>Employees are expected to time in upon arriving at their respective office. However, due to unforeseen circumstances preventing the employee to timely Clock In within the Company&rsquo;s online system, employees are allowed to amend their Clock In time, subject to the approval of their respective Department Head / Immediate Superior. Amendments to Clock In within the Company&rsquo;s online system can be done on or before the payroll cutoff.</p>\n<p>2. Employee reporting to work after the official start of the assigned work shift and, if any, after the grace period. Applicable only to Time-bounded Work Shifts.</p>\n<p>Tardiness computed in payroll is equivalent to length of time computed as the difference between the clock in time and the grace period. If no Grace Period allowed, it will be the difference between the clock in time and the start of the shift.</p>\n<p>Example:</p>\n<p>Start Time - 6:00 AM</p>\n<p>Grace Period - 6:10 AM (10 minutes from the start of the shift)</p>\n<p>Clock In - 6:15 AM</p>\n<p>Tardiness = 5 minutes (time in excess of the end of the Grace Period)</p>\n<p>Computed Tardiness will be the basis of payroll deductions.</p>\n<p><strong>Clock Out</strong></p>\n<p>When an employee clocks out of work, the Company&rsquo;s online system shall provide the applicable status:</p>\n<p><strong> SHIFT ENDED</strong> - Clock out on or beyond the end of shift will be tagged as Shift Ended</p>\n<p><strong>UNDERTIME</strong> - Clock out before the expected end of shift will tag the talent as Undertime</p>\n<p><strong>ABSENT (2ND HALF and Undertime)</strong> - Clock out within the first four (4) hours after the shift has started will be tagged as Undertime. The last four (4) hours before the shift ends will be tagged as Absent - 2nd Half.</p>\n<p><strong> Undertime </strong></p>\n<p>An employee leaving work earlier than the required end of a Work Shift. Undertime computed in payroll is equivalent to length of time computed as the difference between the end of shift and the clock out time.</p>\n<p>Example:</p>\n<p>End Time - 3:00 PM</p>\n<p>Clock In - 2:55 PM</p>\n<p>Undertime = 5 minutes (time out short of the end of the Grace Period)</p>\n<p>Computed Undertime will be the basis of payroll deductions.</p>",
        systemPolicy: "<p><strong>Certify </strong></p>\n<p>1. Certification of DTR can only be done<strong> within the cutoff. </strong></p>\n<p>2. You cannot certify an <strong>incomplete DTR, current day</strong> and <strong>an ongoing shift. </strong></p>\n<p>3. Failure to certify DTRs shall result to an Auto-Certification at the end of the pay cutoff.</p>\n<p><strong>What you can do:</strong></p>\n<p>1. If with time logged (whether complete or incomplete), allows <strong>DTR amendment</strong> or <strong>Certify</strong>.</p>\n<p>2. If registered Absent, allows DTR amendment, File a Leave or Certify.</p>\n<p><strong>Amendment can be done in the following ways: </strong></p>\n<p>1. Time Recorder - Previous Shift</p>\n<p>2. Requests - File Request / DTR amendment</p>\n<p>3. Express Button - Amendment</p>\n<p><strong>Filing of leave can be done in the following ways:</strong></p>\n<p>1. Time Recorder - Previous Shift</p>\n<p>2. Requests - File Request / File Leave</p>\n<p>3. Express Button - File Leave</p>\n<p><strong>Amend DTR</strong></p>\n<p>1. You cannot amend an<strong> Ongoing / Current Shift.</strong> Filing of DTR amendment is allowed the next day after you have Clocked In.</p>\n<p>2. Amendments are disallowed by the end of the cutoff (10th or 25th).</p>\n<p>3. You are expected to amend your DTR within <strong>twenty-four (24) hours upon return to work</strong> in the succeeding Work Shift.</p>\n<p>4. You can only adjust your CLOCK IN DATE one (1) day prior your Chosen Work Date.</p>\n<p><strong>E.g</strong></p>\n<p>Work Date: November 08, 2019 - 12:00am to 09:00am</p>\n<p>Clock in Date: November 07, 2019 Clock In Time:11:00pm</p>\n<p>Clock out Date: November 08, 2019 Clock out Time:09:00am</p>\n<p>5. You can only adjust your CLOCK OUT DATE one (1) day after your Chosen Work Date.</p>\n<p><strong>E.g</strong></p>\n<p>Work Date: November 08, 2019 - 8:00am to 05:00pm</p>\n<p>Clock in Date: November 08, 2019 Clock In Time:08:00am</p>\n<p>Clock out Date: November 09, 2019 Clock out Time:02:00am</p>\n<p>6. DTR amendment request can be canceled / edited provided the request is still pending.</p>\n<p>7. DTR amendment requests that have already passed or requests that have already been denied cannot be canceled.</p>\n<p>8. DTRs that have been previously certified <strong>CANNOT</strong> be amended.</p>\n<p><strong> File Leave </strong></p>\n<p>1. Filing of Sick / Emergency Leave is allowed the next day after you have Clocked In.</p>\n<p>2. You cannot file a backdated Vacation Leave.</p>\n<p>3. You cannot file a future - dated Sick / Emergency Leave.</p>\n<p>4. The employee is expected to file a Sick or Emergency Leave within the Company online system within <strong>twenty-four (24) hours upon return to work</strong> in the succeeding Work Shift.</p>\n<p>5. Leave request can be edited provided the request is still pending.</p>\n<p>6. Approved leave request can be canceled before the effectivity date.</p>\n<p>7. Reporting to work on a day with a pre-approved SIL.</p>\n<p>- Will cancel the leave</p>\n<p>- Credit back the approved SIL to the Leave balance</p>\n<p>- Record the DTR for the day</p>",
        instruction: "<p><strong>What you can do:</strong></p>\n<p>1. If with time logged (whether complete or incomplete), allows DTR amendment or Certify.</p>\n<p>2. If without time logged, allows DTR Amemdment.</p>\n<p>3. If registered Absent, allows DTR amendment, File a Leave or Certify.</p>\n<p><strong>Amendment can be done in the following ways:</strong></p>\n<p>1. Time Recorder - Previous Shift</p>\n<p>2. Requests - File Request / DTR amendment</p>\n<p>3. Express Button - Amendment</p>\n<p><strong>Filing of leave can be done in the following ways:</strong></p>\n<p>1. Time Recorder - Previous Shift</p>\n<p>2. Requests - File Request / File Leave</p>\n<p>3. Express Button - File Leave</p>"
      },
      listRow: [
        "COMPANY POLICY",
        "SYSTEM POLICY",
        "INSTRUCTION"
      ],
      "loaded": false,
      "cardIconDesc": false
    }
  }
<Info config={configInfoMultiple} onChange={e => getActions(e, 'info')} />

11) Accordion

Initialization

import {Accordion} from 'empower-display';

Usage

 const configAccordion = [
     {
      title: 'Title 1',
      subText: 'Subtext Title 1',
      checked:false,
      checkBoxShow:true,
      content: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
    },
    {
      title: 'Title 2',
      subText: 'Subtext Title 2',
      checked:false,
      checkBoxShow:true,
      content: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
    }
  ]
<Accordion config={configAccordion} onChange={(action, data) => getActions(action, data)} />

12) Related Activities

Initialization

import {RelatedActivities} from 'empower-display';

Usage

const activities = [
  {
    badge: SVG_BADGE_APPROVE,
    status: 'approved',
    desc: 'Desc 1',
    date: 'date here',
  },
  {
    badge: SVG_BADGE_PENDING,
    status: 'pending',
    desc: 'Desc 2',
    date: 'date here',
  }
]
<RelatedActivities activities={activities} />

13) Media Thumbnail

Initialization

import {MediaThumbnail} from 'empower-display';

Usage

const mediaThumbProps = {
    title: 'Test title',
    data: [
      {
        filename: '123.mp4',
        type: 'mp4',
        id: '1',
      },
      {
        filename: 'testimage.jpg',
        type: 'jpg',
        thumbnailPath: 'https://upload.wikimedia.org/wikipedia/commons/e/ee/Sample_abc.jpg',
        id: '2',
      },
      {
        filename: 'testimage2.png',
        type: 'png',
        id: '3',
      },
      {
        filename: 'audio.mp3',
        type: 'mp3',
        id: '4',
      },
      {
        filename: 'docu.docx',
        type: 'docx',
        id: '5',
      },
      {
        filename: 'testpdf.pdf',
        type: 'pdf',
        id: '6',
      },
    ],
  }
<MediaThumbnail
  {...mediaThumbProps}
  getActions={val => getActions(val, 'mediaThumb')}
/>

14) Snackbar

Initialization

import {SnackBar} from 'empower-display';

Usage

<SnackBar 
  duration={2} 
  show={showSnackbar} 
  onHide={(val) => setShowSnackbar(val)}>
  icon={SVG_BADGE_PENDING}
  <span>Dynamic Snackbar Content Here</span>
</SnackBar>

Changelog

  • 0.1.62 - Fixed position of dialog in info.
  • 0.1.60 - Fixed inconsistent texts in info.
  • 0.1.59 - Fixed dropdown lagging.
  • 0.1.58 - Added icon prop for snackbar.
  • 0.1.57 - Fixed default icon showing in secondary buttons in alert with dropdown.
  • 0.1.56 - Add alert types can be configured using class props.
  • 0.1.50 - Added disable and tooltip for Alert and Button with dropdown.
  • 0.1.42 - Fixed CSS for Accordion, Button with dropdown and Alert with dropdown.
  • 0.1.37 - Updated config for accordion.
  • 0.1.36 - Fixed key on Accordion and Media Thumbnail.
  • 0.1.35 - Added Button with dropdown, Accordion with Checkbox.
  • 0.1.34 - Added Alert with dropdown, Snackbar, Accordion with media and Tooltip.
0.1.70

1 year ago

0.1.71

1 year ago

0.1.65

2 years ago

0.1.66

1 year ago

0.1.67

1 year ago

0.1.68

1 year ago

0.1.69

1 year ago

0.1.64

2 years ago

0.1.63

2 years ago

0.1.61

2 years ago

0.1.62

2 years ago

0.1.52

2 years ago

0.1.53

2 years ago

0.1.54

2 years ago

0.1.55

2 years ago

0.1.56

2 years ago

0.1.57

2 years ago

0.1.58

2 years ago

0.1.59

2 years ago

0.1.50

2 years ago

0.1.51

2 years ago

0.1.49

2 years ago

0.1.41

2 years ago

0.1.42

2 years ago

0.1.43

2 years ago

0.1.44

2 years ago

0.1.45

2 years ago

0.1.46

2 years ago

0.1.47

2 years ago

0.1.48

2 years ago

0.1.40

2 years ago

0.1.38

2 years ago

0.1.39

2 years ago

0.1.30

2 years ago

0.1.31

2 years ago

0.1.32

2 years ago

0.1.33

2 years ago

0.1.34

2 years ago

0.1.35

2 years ago

0.1.36

2 years ago

0.1.37

2 years ago

0.1.29

2 years ago

0.1.60

2 years ago

0.1.12

2 years ago

0.1.13

2 years ago

0.1.14

2 years ago

0.1.15

2 years ago

0.1.27

2 years ago

0.1.28

2 years ago

0.1.20

2 years ago

0.1.21

2 years ago

0.1.22

2 years ago

0.1.23

2 years ago

0.1.24

2 years ago

0.1.25

2 years ago

0.1.26

2 years ago

0.1.17

2 years ago

0.1.18

2 years ago

0.1.19

2 years ago

0.1.11

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago