empower-container 0.1.4 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +240 -236
  2. package/dist/cjs/DatetimeFormatter.js +24 -21
  3. package/dist/cjs/Information.js +6 -7
  4. package/dist/cjs/MenuBar.d.ts +0 -1
  5. package/dist/cjs/MenuBar.js +21 -18
  6. package/dist/cjs/Modal.d.ts +1 -0
  7. package/dist/cjs/Modal.js +2 -2
  8. package/dist/cjs/assets/Asset.js +1 -1
  9. package/dist/cjs/inputs/Input.d.ts +0 -1
  10. package/dist/cjs/inputs/Input.js +0 -1
  11. package/dist/cjs/inputs/Select.d.ts +0 -1
  12. package/dist/cjs/inputs/Select.js +3 -3
  13. package/dist/esm/DatetimeFormatter.js +24 -21
  14. package/dist/esm/Information.js +4 -2
  15. package/dist/esm/MenuBar.d.ts +0 -1
  16. package/dist/esm/MenuBar.js +21 -18
  17. package/dist/esm/Modal.d.ts +1 -0
  18. package/dist/esm/Modal.js +2 -2
  19. package/dist/esm/assets/Asset.js +1 -1
  20. package/dist/esm/inputs/Input.d.ts +0 -1
  21. package/dist/esm/inputs/Input.js +0 -1
  22. package/dist/esm/inputs/InputSelectionHandler.d.ts +1 -1
  23. package/dist/esm/inputs/Select.d.ts +0 -1
  24. package/dist/esm/inputs/Select.js +3 -3
  25. package/dist/scss/components/_modal.scss +41 -30
  26. package/dist/scss/elements/_button.scss +1 -3
  27. package/dist/scss/elements/_popover.scss +6 -38
  28. package/dist/scss/foundation/_mixins.scss +0 -2
  29. package/dist/scss/foundation/_typography.scss +0 -4
  30. package/dist/scss/library/_information.scss +68 -0
  31. package/dist/scss/library/{input.scss → _input.scss} +0 -2
  32. package/dist/scss/library/{menubar.scss → _menubar.scss} +0 -2
  33. package/{src/scss/library/select.scss → dist/scss/library/_select.scss} +0 -4
  34. package/dist/scss/style.scss +21 -5
  35. package/package.json +6 -3
  36. package/src/main/DatetimeFormatter.js +24 -21
  37. package/src/main/DatetimeFormatter.tsx +7 -4
  38. package/src/main/Information.js +13 -14
  39. package/src/main/Information.tsx +41 -36
  40. package/src/main/MenuBar.d.ts +0 -1
  41. package/src/main/MenuBar.js +25 -20
  42. package/src/main/MenuBar.tsx +39 -35
  43. package/src/main/Modal.d.ts +1 -0
  44. package/src/main/Modal.js +5 -5
  45. package/src/main/Modal.tsx +7 -10
  46. package/src/main/assets/Asset.js +3 -3
  47. package/src/main/assets/Asset.tsx +3 -3
  48. package/src/main/inputs/Input.d.ts +0 -1
  49. package/src/main/inputs/Input.js +0 -1
  50. package/src/main/inputs/Input.tsx +0 -1
  51. package/src/main/inputs/Select.d.ts +0 -1
  52. package/src/main/inputs/Select.js +3 -3
  53. package/src/main/inputs/Select.tsx +3 -3
  54. package/src/main/tsconfig.common.json +1 -0
  55. package/src/main/tsconfig.json +2 -1
  56. package/src/sample/App.d.ts +0 -1
  57. package/src/sample/App.js +1 -1
  58. package/src/sample/App.tsx +2 -1
  59. package/src/sample/TestMenuBar.d.ts +0 -1
  60. package/src/sample/TestMenuBar.js +32 -7
  61. package/src/sample/TestMenuBar.tsx +47 -9
  62. package/src/scss/components/_modal.scss +41 -30
  63. package/src/scss/elements/_button.scss +1 -3
  64. package/src/scss/elements/_popover.scss +6 -38
  65. package/src/scss/foundation/_mixins.scss +0 -2
  66. package/src/scss/foundation/_typography.scss +0 -4
  67. package/src/scss/library/_information.scss +68 -0
  68. package/src/scss/library/{input.scss → _input.scss} +0 -2
  69. package/src/scss/library/{menubar.scss → _menubar.scss} +0 -2
  70. package/{dist/scss/library/select.scss → src/scss/library/_select.scss} +0 -4
  71. package/src/scss/style.scss +21 -5
  72. package/dist/assets/Asset.d.ts +0 -15
  73. package/dist/assets/Asset.js +0 -47
  74. package/dist/assets/Asset.tsx +0 -75
  75. package/dist/assets/icons/icon-check-white-sm.svg +0 -3
  76. package/dist/assets/images/icon-arrowdown-graydark.svg +0 -3
  77. package/dist/assets/images/icon-arrowleft-graydark.svg +0 -3
  78. package/dist/assets/images/icon-arrowright-graydark.svg +0 -3
  79. package/dist/assets/images/icon-arrowup-graydark.svg +0 -3
  80. package/dist/assets/images/icon-check-graydark.svg +0 -3
  81. package/dist/scss/components/_index.scss +0 -1
  82. package/dist/scss/foundation/_index.scss +0 -5
  83. package/dist/scss/library/_index.scss +0 -3
  84. package/src/scss/components/_index.scss +0 -1
  85. package/src/scss/foundation/_index.scss +0 -5
  86. package/src/scss/library/_index.scss +0 -3
@@ -1,30 +1,35 @@
1
1
 
2
- import React, {useState} from 'react';
3
- import renderHtml from 'react-render-html';
2
+ import React, { useState } from 'react';
3
+ // @ts-ignore
4
+ // import renderHtml from 'react-render-html';
4
5
 
5
6
 
6
7
  interface IInformationProps {
7
8
  items: any,
8
- listRow:Array<string | object>,
9
- desc:boolean,
10
- title?:string
11
- hide: (event: React.DOMAttributes<HTMLDivElement> | React.MouseEventHandler<HTMLDivElement> | undefined | any) => void
9
+ listRow: Array<string | object>,
10
+ desc: boolean,
11
+ title?: string
12
+ hide: (event: React.DOMAttributes<HTMLDivElement> | React.MouseEventHandler<HTMLDivElement> | undefined | any) => void
12
13
 
13
14
 
14
15
  }
15
16
 
16
- const Information: React.FunctionComponent<IInformationProps> = ({items, listRow, desc,title, hide}) => {
17
+ const Information: React.FunctionComponent<IInformationProps> = ({ items, listRow, desc, title, hide }) => {
17
18
 
18
- let [rowAnchorEl, setRowAnchorEl] = useState<number|null>(null);
19
+ let [rowAnchorEl, setRowAnchorEl] = useState<number | null>(null);
20
+
21
+ const renderHtml = (html: any) => {
22
+
23
+ return <div dangerouslySetInnerHTML={{ __html: html }} />;
24
+ }
19
25
 
20
-
21
26
 
22
27
 
23
- const showRowDetails = (e: React.MouseEvent<HTMLDivElement, MouseEvent>, idx:number) => {
28
+ const showRowDetails = (e: React.MouseEvent<HTMLDivElement, MouseEvent>, idx: number) => {
24
29
  e && e.preventDefault();
25
-
30
+
26
31
  if (rowAnchorEl === idx) {
27
- rowAnchorEl = null
32
+ rowAnchorEl = null
28
33
  } else {
29
34
  rowAnchorEl = idx
30
35
  }
@@ -32,33 +37,33 @@ const Information: React.FunctionComponent<IInformationProps> = ({items, listRow
32
37
  setRowAnchorEl(rowAnchorEl)
33
38
  }
34
39
 
35
-
36
- const View = () =>{
40
+
41
+ const View = () => {
37
42
  return <React.Fragment>
38
- <div className="popover popover-i">
39
-
40
- {
41
- typeof desc != 'undefined' && desc ? (
42
- <div className="popover-i-content">
43
- <div className="popover-i-title">
44
- <h6>{title}</h6>
45
- <div className="popover-i-close" onClick={hide}></div>
46
- </div>
47
- <div>{typeof items != 'undefined' && items ? renderHtml(items) : ''}
43
+ <div className="em-popover-i">
44
+
45
+ {
46
+ typeof desc != 'undefined' && desc ? (
47
+ <div className="em-popover-i-content">
48
+ <div className="em-popover-i-title">
49
+ <h6>{title}</h6>
50
+ <div className="em-popover-i-close" onClick={hide}></div>
51
+ </div>
52
+ <div>{typeof items != 'undefined' && items ? renderHtml(items) : ''}
53
+ </div>
48
54
  </div>
49
- </div>
50
- ) : (
51
- <div className="popover-i-content">
52
- <div className="popover-i-title">
55
+ ) : (
56
+ <div className="em-popover-i-content">
57
+ <div className="em-popover-i-title">
53
58
  <h6>{title}</h6>
54
- <div className="popover-i-close" onClick={hide}></div>
59
+ <div className="em-popover-i-close" onClick={hide}></div>
55
60
  </div>
56
61
  {listRow ? (
57
62
  listRow.length >= 1 ? (
58
- listRow.map((item:any, key) => (
63
+ listRow.map((item: any, key) => (
59
64
 
60
65
  <React.Fragment key={key}>
61
- <div className="popover-i-category" onClick={(event) => showRowDetails(event, key)}>
66
+ <div className="em-popover-i-category" onClick={(event) => showRowDetails(event, key)}>
62
67
  <div>
63
68
  <h6>{item}</h6>
64
69
  </div>
@@ -69,7 +74,7 @@ const Information: React.FunctionComponent<IInformationProps> = ({items, listRow
69
74
  </div>
70
75
  {
71
76
  rowAnchorEl === key ? (
72
- <div className="popover-i-details">
77
+ <div className="em-popover-i-details">
73
78
  {item === 'COMPANY POLICY' ? (
74
79
  typeof items != 'undefined' && typeof items.companyPolicy != 'undefined' && items.companyPolicy ? renderHtml(items.companyPolicy) : '') :
75
80
  (item === 'SYSTEM POLICY' ? (typeof items != 'undefined' && typeof items.systemPolicy != 'undefined' && items.systemPolicy ? renderHtml(items.systemPolicy) : '') :
@@ -90,13 +95,13 @@ const Information: React.FunctionComponent<IInformationProps> = ({items, listRow
90
95
  }
91
96
  </div>
92
97
  )
93
- }
94
- </div>
95
- </React.Fragment>
98
+ }
99
+ </div>
100
+ </React.Fragment>
96
101
  }
97
102
 
98
103
 
99
- return View();
104
+ return View();
100
105
  };
101
106
 
102
107
  export default Information;
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
2
  import '../scss/style.scss';
3
- import '../scss/library/menubar.scss';
4
3
  interface IMenuBarProps {
5
4
  config?: any;
6
5
  info?: any;
@@ -50,7 +50,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
50
50
  /* eslint-disable jsx-a11y/anchor-is-valid */
51
51
  var react_1 = __importStar(require("react"));
52
52
  require("../scss/style.scss");
53
- require("../scss/library/menubar.scss");
54
53
  // Imports
55
54
  var Asset_1 = require("./assets/Asset");
56
55
  var Constant_1 = require("./constants/Constant");
@@ -82,15 +81,16 @@ var MenuBar = function (_a) {
82
81
  var _s = (0, react_1.useState)(undoButton && undoButton.show ? true : false), undoShow = _s[0], setUndoShow = _s[1];
83
82
  var _t = (0, react_1.useState)(false), doneTimer = _t[0], setDoneTimer = _t[1];
84
83
  (0, react_1.useEffect)(function () {
84
+ var filteredMonthList = [];
85
85
  if (dropdown && dropdown.minMonth) {
86
- var filteredMonthList = __spreadArray([], Constant_1.MONTH_LIST, true).filter(function (item) { return (item.value.toLowerCase() === dropdown.minMonth.toLowerCase()); });
86
+ filteredMonthList = __spreadArray([], Constant_1.MONTH_LIST, true).filter(function (item) { return (item.value.toLowerCase() === dropdown.minMonth.toLowerCase()); });
87
87
  if (filteredMonthList.length > 0) {
88
88
  minMonthIdx = Constant_1.MONTH_LIST.indexOf(filteredMonthList[0]);
89
89
  setMinMonthIdx(minMonthIdx);
90
90
  }
91
91
  }
92
92
  if (dropdown && dropdown.maxMonth) {
93
- var filteredMonthList = __spreadArray([], Constant_1.MONTH_LIST, true).filter(function (item) { return (item.value.toLowerCase() === dropdown.maxMonth.toLowerCase()); });
93
+ filteredMonthList = __spreadArray([], Constant_1.MONTH_LIST, true).filter(function (item) { return (item.value.toLowerCase() === dropdown.maxMonth.toLowerCase()); });
94
94
  if (filteredMonthList.length > 0) {
95
95
  maxMonthIdx = Constant_1.MONTH_LIST.indexOf(filteredMonthList[0]);
96
96
  setMaxMonthIdx(maxMonthIdx);
@@ -352,6 +352,11 @@ var MenuBar = function (_a) {
352
352
  var dateMonthlyPickerHandler = function (e, action, data) {
353
353
  if (data === void 0) { data = ''; }
354
354
  var _a = __assign({}, dropdown), maxYear = _a.maxYear, minYear = _a.minYear;
355
+ var newDateValue = null;
356
+ var standardDate = null;
357
+ var selectedMonthDate = null;
358
+ var monthIdx = null;
359
+ var fullYear = null;
355
360
  if (action === 'next') {
356
361
  if (!maxYear || (maxYear && parseInt(maxYear) >= calendarYear + 1)) {
357
362
  calendarYear += 1;
@@ -365,15 +370,14 @@ var MenuBar = function (_a) {
365
370
  }
366
371
  }
367
372
  else if (action === 'month-selection') {
368
- var newDateValue = (0, DatetimeFormatter_1.default)(data + ' ' + calendarYear, 'month-year');
373
+ newDateValue = (0, DatetimeFormatter_1.default)(data + ' ' + calendarYear, 'month-year');
369
374
  actionRequestHandler(e, 'dropdown', newDateValue);
370
375
  }
371
376
  else if (action === 'next-month') {
372
- var standardDate = (0, DatetimeFormatter_1.default)(dropdown.selection.startDate, 'date-standard');
373
- var selectedMonthDate = new Date(new Date(standardDate).toLocaleString('en-US', { timeZone: 'Asia/Manila' })); //making the date picked as the default gmt so that the new date wont adjust by timezone;
374
- // selectedMonthDate = new Date(selectedMonthDate);
375
- var monthIdx = selectedMonthDate.getMonth();
376
- var fullYear = selectedMonthDate.getFullYear();
377
+ standardDate = (0, DatetimeFormatter_1.default)(dropdown.selection.startDate, 'date-standard');
378
+ selectedMonthDate = new Date(new Date(standardDate).toLocaleString('en-US', { timeZone: 'Asia/Manila' })); //making the date picked as the default gmt so that the new date wont adjust by timezone;
379
+ monthIdx = selectedMonthDate.getMonth();
380
+ fullYear = selectedMonthDate.getFullYear();
377
381
  if (monthIdx + 1 < 12) {
378
382
  monthIdx = monthIdx + 1;
379
383
  }
@@ -382,16 +386,15 @@ var MenuBar = function (_a) {
382
386
  fullYear = fullYear + 1;
383
387
  }
384
388
  if ((!maxYear && !maxMonthIdx) || fullYear < parseInt(maxYear) || (fullYear === parseInt(maxYear) && monthIdx <= parseInt(maxMonthIdx))) {
385
- var newDateValue = (0, DatetimeFormatter_1.default)(Constant_1.MONTH_LIST[monthIdx].value + ' ' + fullYear, 'month-year');
389
+ newDateValue = (0, DatetimeFormatter_1.default)(Constant_1.MONTH_LIST[monthIdx].value + ' ' + fullYear, 'month-year');
386
390
  actionRequestHandler(e, 'dropdown', newDateValue, false);
387
391
  }
388
392
  }
389
393
  else if (action === 'prev-month') {
390
- var standardDate = (0, DatetimeFormatter_1.default)(dropdown.selection.startDate, 'date-standard');
391
- var selectedMonthDate = new Date(new Date(standardDate).toLocaleString('en-US', { timeZone: 'Asia/Manila' })); //making the date picked as the default gmt so that the new date wont adjust by timezone;
392
- // selectedMonthDate = new Date(selectedMonthDate);
393
- var monthIdx = selectedMonthDate.getMonth();
394
- var fullYear = selectedMonthDate.getFullYear();
394
+ standardDate = (0, DatetimeFormatter_1.default)(dropdown.selection.startDate, 'date-standard');
395
+ selectedMonthDate = new Date(new Date(standardDate).toLocaleString('en-US', { timeZone: 'Asia/Manila' })); //making the date picked as the default gmt so that the new date wont adjust by timezone;
396
+ monthIdx = selectedMonthDate.getMonth();
397
+ fullYear = selectedMonthDate.getFullYear();
395
398
  if (monthIdx - 1 >= 0) {
396
399
  monthIdx = monthIdx - 1;
397
400
  }
@@ -400,8 +403,8 @@ var MenuBar = function (_a) {
400
403
  fullYear = fullYear - 1;
401
404
  }
402
405
  if ((!minYear && !minMonthIdx) || fullYear > parseInt(minYear) || (fullYear === parseInt(minYear) && monthIdx >= parseInt(minMonthIdx))) {
403
- var newDateValue = (0, DatetimeFormatter_1.default)(Constant_1.MONTH_LIST[monthIdx].value + ' ' + fullYear, 'month-year');
404
- actionRequestHandler(e, 'dropdown', newDateValue, false);
406
+ var newDateValue_1 = (0, DatetimeFormatter_1.default)(Constant_1.MONTH_LIST[monthIdx].value + ' ' + fullYear, 'month-year');
407
+ actionRequestHandler(e, 'dropdown', newDateValue_1, false);
405
408
  }
406
409
  }
407
410
  };
@@ -478,9 +481,11 @@ var MenuBar = function (_a) {
478
481
  config && config.titleDescription ? (react_1.default.createElement("p", null, config.titleDescription)) : null),
479
482
  // Information Configuration
480
483
  config && config.showInfo.constructor === Boolean && config.showInfo === true ? (react_1.default.createElement(react_1.Fragment, null,
481
- react_1.default.createElement("a", { href: "#", className: "belt-info", onClick: function (event) { return popoverRequestHandler(event, 'info'); }, "data-testid": "menubar-information" }, Asset_1.SVG_INFORMATION),
482
- react_1.default.createElement(Select_1.Popover, { id: "InfoPopOver", open: Boolean(infoPopover), className: Boolean(dropdownPopover) ? 'open-popover' : '', onClick: function (event) { return popoverRequestHandler(event, 'info'); } },
483
- react_1.default.createElement(Information_1.default, { items: info && info.infoDetails ? info.infoDetails : info, listRow: info && info.listRow ? info.listRow : [], desc: info && info.listRow && info.listRow.length > 0 ? false : true, title: config && config.title ? config.title.toUpperCase() : null, hide: function (event) { return popoverRequestHandler(event, 'info', true); } })))) : null,
484
+ react_1.default.createElement("div", { className: "em-belt-info" },
485
+ react_1.default.createElement("a", { href: "#", onClick: function (event) { return popoverRequestHandler(event, 'info'); }, "data-testid": "menubar-information" },
486
+ react_1.default.createElement("div", { className: "em-info-icon" }, Asset_1.SVG_INFORMATION)),
487
+ react_1.default.createElement(Select_1.Popover, { id: "InfoPopOver", open: Boolean(infoPopover), className: Boolean(dropdownPopover) ? 'open-popover' : '', onClick: function (event) { return popoverRequestHandler(event, 'info'); } },
488
+ react_1.default.createElement(Information_1.default, { items: info && info.infoDetails ? info.infoDetails : info, listRow: info && info.listRow ? info.listRow : [], desc: info && info.listRow && info.listRow.length > 0 ? false : true, title: config && config.title ? config.title.toUpperCase() : null, hide: function (event) { return popoverRequestHandler(event, 'info', true); } }))))) : null,
484
489
  // Additional title on the modal
485
490
  config && config.addedTitle ? (react_1.default.createElement("p", null, config.addedTitle)) : null),
486
491
  react_1.default.createElement("div", { className: "em-beltleft-cta" },
@@ -1,9 +1,7 @@
1
1
  /* eslint-disable no-useless-concat */
2
2
  /* eslint-disable jsx-a11y/anchor-is-valid */
3
3
  import React, { useState, Fragment, useEffect } from "react";
4
-
5
4
  import '../scss/style.scss';
6
- import '../scss/library/menubar.scss';
7
5
 
8
6
  // Imports
9
7
  import { SVG_BACK, SVG_CLOSE_GRAY, SVG_ARROWLEFT, SVG_ARROWRIGHT, SVG_CHECK, SVG_ARROWDOWN, SVG_INFORMATION } from './assets/Asset';
@@ -65,15 +63,16 @@ const MenuBar: React.FunctionComponent<IMenuBarProps> = ({ config, info, button,
65
63
  let [doneTimer, setDoneTimer] = useState<boolean>(false);
66
64
 
67
65
  useEffect(() => {
66
+ let filteredMonthList = []
68
67
  if (dropdown && dropdown.minMonth) {
69
- let filteredMonthList = [...MONTH_LIST].filter(item => (item.value.toLowerCase() === dropdown.minMonth.toLowerCase()));
68
+ filteredMonthList = [...MONTH_LIST].filter(item => (item.value.toLowerCase() === dropdown.minMonth.toLowerCase()));
70
69
  if (filteredMonthList.length > 0) {
71
70
  minMonthIdx = MONTH_LIST.indexOf(filteredMonthList[0]);
72
71
  setMinMonthIdx(minMonthIdx);
73
72
  }
74
73
  }
75
74
  if (dropdown && dropdown.maxMonth) {
76
- let filteredMonthList = [...MONTH_LIST].filter(item => (item.value.toLowerCase() === dropdown.maxMonth.toLowerCase()));
75
+ filteredMonthList = [...MONTH_LIST].filter(item => (item.value.toLowerCase() === dropdown.maxMonth.toLowerCase()));
77
76
  if (filteredMonthList.length > 0) {
78
77
  maxMonthIdx = MONTH_LIST.indexOf(filteredMonthList[0]);
79
78
  setMaxMonthIdx(maxMonthIdx);
@@ -380,6 +379,11 @@ const MenuBar: React.FunctionComponent<IMenuBarProps> = ({ config, info, button,
380
379
  let dateMonthlyPickerHandler = (e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | React.MouseEvent<HTMLButtonElement, MouseEvent>, action: string, data: string = '') => {
381
380
  type opt = { maxYear: string; minYear: string; }
382
381
  let { maxYear, minYear }: opt = { ...dropdown }
382
+ let newDateValue = null;
383
+ let standardDate = null;
384
+ let selectedMonthDate=null;
385
+ let monthIdx = null;
386
+ let fullYear = null;
383
387
  if (action === 'next') {
384
388
  if (!maxYear || (maxYear && parseInt(maxYear) >= calendarYear + 1)) {
385
389
  calendarYear += 1;
@@ -391,14 +395,13 @@ const MenuBar: React.FunctionComponent<IMenuBarProps> = ({ config, info, button,
391
395
  setCalendarYear(calendarYear)
392
396
  }
393
397
  } else if (action === 'month-selection') {
394
- let newDateValue = datetimeFormatter(data + ' ' + calendarYear, 'month-year');
398
+ newDateValue = datetimeFormatter(data + ' ' + calendarYear, 'month-year');
395
399
  actionRequestHandler(e, 'dropdown', newDateValue);
396
400
  } else if (action === 'next-month') {
397
- let standardDate = datetimeFormatter(dropdown.selection.startDate, 'date-standard');
398
- let selectedMonthDate = new Date(new Date(standardDate).toLocaleString('en-US', { timeZone: 'Asia/Manila' })); //making the date picked as the default gmt so that the new date wont adjust by timezone;
399
- // selectedMonthDate = new Date(selectedMonthDate);
400
- let monthIdx = selectedMonthDate.getMonth();
401
- let fullYear = selectedMonthDate.getFullYear();
401
+ standardDate = datetimeFormatter(dropdown.selection.startDate, 'date-standard');
402
+ selectedMonthDate = new Date(new Date(standardDate).toLocaleString('en-US', { timeZone: 'Asia/Manila' })); //making the date picked as the default gmt so that the new date wont adjust by timezone;
403
+ monthIdx = selectedMonthDate.getMonth();
404
+ fullYear = selectedMonthDate.getFullYear();
402
405
  if (monthIdx + 1 < 12) {
403
406
  monthIdx = monthIdx + 1;
404
407
  } else {
@@ -406,16 +409,15 @@ const MenuBar: React.FunctionComponent<IMenuBarProps> = ({ config, info, button,
406
409
  fullYear = fullYear + 1;
407
410
  }
408
411
  if ((!maxYear && !maxMonthIdx) || fullYear < parseInt(maxYear) || (fullYear === parseInt(maxYear) && monthIdx <= parseInt(maxMonthIdx))) {
409
- let newDateValue = datetimeFormatter(MONTH_LIST[monthIdx].value + ' ' + fullYear, 'month-year');
412
+ newDateValue = datetimeFormatter(MONTH_LIST[monthIdx].value + ' ' + fullYear, 'month-year');
410
413
  actionRequestHandler(e, 'dropdown', newDateValue, false);
411
414
  }
412
415
  } else if (action === 'prev-month') {
413
- let standardDate = datetimeFormatter(dropdown.selection.startDate, 'date-standard');
414
- let selectedMonthDate = new Date(new Date(standardDate).toLocaleString('en-US', { timeZone: 'Asia/Manila' })); //making the date picked as the default gmt so that the new date wont adjust by timezone;
415
- // selectedMonthDate = new Date(selectedMonthDate);
416
-
417
- let monthIdx = selectedMonthDate.getMonth();
418
- let fullYear = selectedMonthDate.getFullYear();
416
+ standardDate = datetimeFormatter(dropdown.selection.startDate, 'date-standard');
417
+ selectedMonthDate = new Date(new Date(standardDate).toLocaleString('en-US', { timeZone: 'Asia/Manila' })); //making the date picked as the default gmt so that the new date wont adjust by timezone;
418
+
419
+ monthIdx = selectedMonthDate.getMonth();
420
+ fullYear = selectedMonthDate.getFullYear();
419
421
  if (monthIdx - 1 >= 0) {
420
422
  monthIdx = monthIdx - 1;
421
423
  } else {
@@ -567,26 +569,28 @@ const MenuBar: React.FunctionComponent<IMenuBarProps> = ({ config, info, button,
567
569
  // Information Configuration
568
570
  config && config.showInfo.constructor === Boolean && config.showInfo===true ? (
569
571
  <Fragment>
570
- <a href="#" className="belt-info" onClick={event => popoverRequestHandler(event, 'info')}
571
- data-testid="menubar-information">
572
- {SVG_INFORMATION}
573
- </a>
574
- <Popover
575
- id="InfoPopOver"
576
- open={Boolean(infoPopover)}
577
- className={Boolean(dropdownPopover) ? 'open-popover' : ''}
578
- onClick={event => popoverRequestHandler(event, 'info')}
579
- >
572
+ <div className="em-belt-info">
573
+ <a href="#" onClick={event => popoverRequestHandler(event, 'info')}
574
+ data-testid="menubar-information">
575
+ <div className="em-info-icon">{SVG_INFORMATION}</div>
576
+ </a>
577
+ <Popover
578
+ id="InfoPopOver"
579
+ open={Boolean(infoPopover)}
580
+ className={Boolean(dropdownPopover) ? 'open-popover' : ''}
581
+ onClick={event => popoverRequestHandler(event, 'info')}
582
+ >
580
583
 
581
- <Information
582
- items={info && info.infoDetails ? info.infoDetails : info}
583
- listRow={info && info.listRow ? info.listRow : []}
584
- desc={info && info.listRow && info.listRow.length > 0 ? false : true}
585
- title={config && config.title ? config.title.toUpperCase() : null}
586
- hide={event => popoverRequestHandler(event, 'info', true)}
587
- />
584
+ <Information
585
+ items={info && info.infoDetails ? info.infoDetails : info}
586
+ listRow={info && info.listRow ? info.listRow : []}
587
+ desc={info && info.listRow && info.listRow.length > 0 ? false : true}
588
+ title={config && config.title ? config.title.toUpperCase() : null}
589
+ hide={event => popoverRequestHandler(event, 'info', true)}
590
+ />
588
591
 
589
- </Popover>
592
+ </Popover>
593
+ </div>
590
594
  </Fragment>
591
595
  ) : null
592
596
  }
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import '../scss/style.scss';
2
3
  interface IModalProps {
3
4
  id?: string;
4
5
  show: boolean;
package/src/main/Modal.js CHANGED
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  var react_1 = __importDefault(require("react"));
7
7
  var react_dom_1 = __importDefault(require("react-dom"));
8
8
  var MenuBar_1 = __importDefault(require("./MenuBar"));
9
+ require("../scss/style.scss");
9
10
  var Modal = function (_a) {
10
11
  var id = _a.id, show = _a.show, hideMenuBar = _a.hideMenuBar, config = _a.config, getActions = _a.getActions, children = _a.children, button = _a.button, dropdown = _a.dropdown, search = _a.search, pagination = _a.pagination, pivot = _a.pivot, check = _a.check, toggle = _a.toggle, undoButton = _a.undoButton, mainButton = _a.mainButton, buttonFooter = _a.buttonFooter, info = _a.info, customClass = _a.customClass;
11
12
  var sendActions = function (actions, data) {
@@ -15,10 +16,9 @@ var Modal = function (_a) {
15
16
  if (addedParam === void 0) { addedParam = null; }
16
17
  return getActions ? getActions(action, data, addedParam) : false;
17
18
  };
18
- console.log(hideMenuBar, 'hideMenuBar');
19
- return (show ? react_dom_1.default.createPortal(react_1.default.createElement("div", { className: "e-modal" },
20
- react_1.default.createElement("div", { className: "e-modal-container", "data-testid": id ? id : 'default-modal-test' },
21
- react_1.default.createElement("div", { className: "card card-modal modal-".concat(config.modalSize ? config.modalSize : 'md') }, !hideMenuBar ? (react_1.default.createElement(MenuBar_1.default, { config: config, button: button, pagination: pagination, pivot: pivot, dropdown: dropdown, search: search, toggle: toggle, undoButton: undoButton, buttonFooter: buttonFooter, check: check, info: info, getActions: function (actions, data) { return sendActions(actions, data); } },
22
- react_1.default.createElement("div", { className: "card-content" }, children))) : react_1.default.createElement("div", { className: "card-content" }, children)))), document.getElementById('root')) : null);
19
+ return (show ? react_dom_1.default.createPortal(react_1.default.createElement("div", { className: "em-modal " + customClass },
20
+ react_1.default.createElement("div", { className: "em-modal-container", "data-testid": id ? id : 'default-modal-test' },
21
+ react_1.default.createElement("div", { className: "em-card card-modal modal-".concat(config.modalSize ? config.modalSize : 'md') }, !hideMenuBar ? (react_1.default.createElement(MenuBar_1.default, { config: config, button: button, pagination: pagination, pivot: pivot, dropdown: dropdown, search: search, toggle: toggle, undoButton: undoButton, buttonFooter: buttonFooter, check: check, info: info, getActions: function (actions, data) { return sendActions(actions, data); } },
22
+ react_1.default.createElement("div", { className: "em-card-content" }, children))) : react_1.default.createElement("div", { className: "em-card-content card-content" }, children)))), document.getElementById('root')) : null);
23
23
  };
24
24
  exports.default = Modal;
@@ -1,6 +1,8 @@
1
1
  import React from "react";
2
2
  import ReactDOM from "react-dom";
3
3
  import MenuBar from "./MenuBar";
4
+ import '../scss/style.scss';
5
+
4
6
 
5
7
  interface IModalProps {
6
8
  id?:string,
@@ -45,16 +47,11 @@ const Modal: React.FunctionComponent<IModalProps> = ({id, show,hideMenuBar, conf
45
47
  return getActions ? getActions(action, data, addedParam) : false;
46
48
  }
47
49
 
48
-
49
- console.log(hideMenuBar, 'hideMenuBar')
50
-
51
-
52
-
53
50
  return (
54
51
  show ? ReactDOM.createPortal(
55
- <div className="e-modal">
56
- <div className="e-modal-container" data-testid={id ? id : 'default-modal-test'}>
57
- <div className={`card card-modal modal-${config.modalSize ? config.modalSize : 'md'}`}>
52
+ <div className={"em-modal "+ customClass }>
53
+ <div className="em-modal-container" data-testid={id ? id : 'default-modal-test'}>
54
+ <div className={`em-card card-modal modal-${config.modalSize ? config.modalSize : 'md'}`}>
58
55
  {
59
56
  !hideMenuBar ? (
60
57
  <MenuBar
@@ -71,9 +68,9 @@ const Modal: React.FunctionComponent<IModalProps> = ({id, show,hideMenuBar, conf
71
68
  info={info}
72
69
  getActions={(actions:any,data:any) => sendActions(actions,data)}
73
70
  >
74
- <div className="card-content">{ children }</div>
71
+ <div className="em-card-content">{ children }</div>
75
72
  </MenuBar>
76
- ) : <div className="card-content">{ children }</div>
73
+ ) : <div className="em-card-content card-content">{ children }</div>
77
74
  }
78
75
  </div>
79
76
  </div>
@@ -42,6 +42,6 @@ exports.SVG_ADD = react_1.default.createElement("svg", { width: "20", height: "2
42
42
  react_1.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 2C10.5523 2 11 2.44772 11 3V17C11 17.5523 10.5523 18 10 18C9.44772 18 9 17.5523 9 17V3C9 2.44772 9.44772 2 10 2Z", fill: "#393F5A" }),
43
43
  react_1.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M2 10C2 9.44772 2.44772 9 3 9L17 9C17.5523 9 18 9.44772 18 10C18 10.5523 17.5523 11 17 11L3 11C2.44772 11 2 10.5523 2 10Z", fill: "#393F5A" }));
44
44
  exports.SVG_INFORMATION = react_1.default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
45
- react_1.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M2 10C2 14.4183 5.58172 18 10 18C14.4183 18 18 14.4183 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10ZM10 0C4.47715 0 0 4.47715 0 10C0 15.5228 4.47715 20 10 20C15.5228 20 20 15.5228 20 10C20 4.47715 15.5228 0 10 0Z", fill: "#393F5A" }),
46
- react_1.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 8C10.5523 8 11 8.44772 11 9V14C11 14.5523 10.5523 15 10 15C9.44772 15 9 14.5523 9 14V9C9 8.44772 9.44772 8 10 8Z", fill: "#393F5A" }),
47
- react_1.default.createElement("path", { d: "M11 6C11 6.55228 10.5523 7 10 7C9.44772 7 9 6.55228 9 6C9 5.44772 9.44772 5 10 5C10.5523 5 11 5.44772 11 6Z", fill: "#393F5A" }));
45
+ react_1.default.createElement("rect", { x: "1", y: "1", width: "18", height: "18", rx: "9", stroke: "#9FA5B7", strokeWidth: "2" }),
46
+ react_1.default.createElement("path", { d: "M10 9V14", stroke: "#9FA5B7", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
47
+ react_1.default.createElement("circle", { cx: "10", cy: "6", r: "1", fill: "#9FA5B7" }));
@@ -68,8 +68,8 @@ export const SVG_ADD = <svg width="20" height="20" viewBox="0 0 20 20" fill="non
68
68
 
69
69
 
70
70
  export const SVG_INFORMATION = <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
71
- <path fillRule="evenodd" clipRule="evenodd" d="M2 10C2 14.4183 5.58172 18 10 18C14.4183 18 18 14.4183 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10ZM10 0C4.47715 0 0 4.47715 0 10C0 15.5228 4.47715 20 10 20C15.5228 20 20 15.5228 20 10C20 4.47715 15.5228 0 10 0Z" fill="#393F5A" />
72
- <path fillRule="evenodd" clipRule="evenodd" d="M10 8C10.5523 8 11 8.44772 11 9V14C11 14.5523 10.5523 15 10 15C9.44772 15 9 14.5523 9 14V9C9 8.44772 9.44772 8 10 8Z" fill="#393F5A" />
73
- <path d="M11 6C11 6.55228 10.5523 7 10 7C9.44772 7 9 6.55228 9 6C9 5.44772 9.44772 5 10 5C10.5523 5 11 5.44772 11 6Z" fill="#393F5A" />
71
+ <rect x="1" y="1" width="18" height="18" rx="9" stroke="#9FA5B7" strokeWidth="2"/>
72
+ <path d="M10 9V14" stroke="#9FA5B7" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
73
+ <circle cx="10" cy="6" r="1" fill="#9FA5B7"/>
74
74
  </svg>
75
75
 
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
2
  import '../../scss/style.scss';
3
- import '../../scss/library/input.scss';
4
3
  interface IProps {
5
4
  config: {
6
5
  id: string | keyof Object;
@@ -36,7 +36,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
37
  var react_1 = __importStar(require("react"));
38
38
  require("../../scss/style.scss");
39
- require("../../scss/library/input.scss");
40
39
  var sanitizeValue = function (txt, props) {
41
40
  var pattern = null;
42
41
  var newTxt = txt;
@@ -1,6 +1,5 @@
1
1
  import React, { Fragment } from "react";
2
2
  import '../../scss/style.scss';
3
- import '../../scss/library/input.scss';
4
3
 
5
4
 
6
5
  interface IProps {
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
2
  import '../../scss/style.scss';
3
- import '../../scss/library/select.scss';
4
3
  interface IPropsPopover {
5
4
  id: String;
6
5
  className: String;
@@ -46,7 +46,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
46
46
  exports.Popover = void 0;
47
47
  var react_1 = __importStar(require("react"));
48
48
  require("../../scss/style.scss");
49
- require("../../scss/library/select.scss");
50
49
  // Imports
51
50
  var Asset_1 = require("../assets/Asset");
52
51
  var Popover = function (_a) {
@@ -223,9 +222,10 @@ var Dropdown = function (_a) {
223
222
  * @param {*} values - selected values of multi-select
224
223
  */
225
224
  function filterOptions(search, values) {
225
+ var selectedOptionsVariable = null;
226
226
  if (type === 'multi-select') {
227
227
  if (optionsArray && optionsArray.constructor === Array) {
228
- var selectedOptionsVariable = selectedOptions(values);
228
+ selectedOptionsVariable = selectedOptions(values);
229
229
  if (options && options.constructor === Array && options.length > 0) {
230
230
  optionsArray = options.filter(function (item) {
231
231
  return values.indexOf(item.value) < 0 && item.label.toLowerCase().search(search.toLowerCase()) > -1;
@@ -238,7 +238,7 @@ var Dropdown = function (_a) {
238
238
  }
239
239
  else if (optionsArray && optionsArray.constructor === Object) {
240
240
  var optionsArrayCopy_1 = {};
241
- var selectedOptionsVariable = selectedOptions(values);
241
+ selectedOptionsVariable = selectedOptions(values);
242
242
  if (selectedOptionsVariable.length > 0) {
243
243
  selectedOptionsVariable = selectedOptionsVariable.filter(function (item) {
244
244
  return item.label.toLowerCase().search(search.toLowerCase()) > -1;
@@ -1,6 +1,5 @@
1
1
  import React, { useState, Fragment } from "react";
2
2
  import '../../scss/style.scss';
3
- import '../../scss/library/select.scss';
4
3
 
5
4
  // Imports
6
5
  import { SVG_BACK, SVG_CLOSE_GRAY, SVG_ARROWLEFT, SVG_ARROWRIGHT, SVG_CHECK, SVG_ARROWDOWN } from '../assets/Asset';
@@ -253,9 +252,10 @@ const Dropdown: React.FC<IPropsDropDown> = ({ config, customClass, onChanged, is
253
252
  * @param {*} values - selected values of multi-select
254
253
  */
255
254
  function filterOptions(search: string, values: any) {
255
+ let selectedOptionsVariable = null;
256
256
  if (type === 'multi-select') {
257
257
  if (optionsArray && optionsArray.constructor === Array) {
258
- let selectedOptionsVariable = selectedOptions(values);
258
+ selectedOptionsVariable = selectedOptions(values);
259
259
  if (options && options.constructor===Array && options.length > 0) {
260
260
  optionsArray = options.filter((item:any) => {
261
261
  return values.indexOf(item.value) < 0 && item.label.toLowerCase().search(search.toLowerCase()) > -1;
@@ -268,7 +268,7 @@ const Dropdown: React.FC<IPropsDropDown> = ({ config, customClass, onChanged, is
268
268
  setOptionsArray([...values, ...optionsArray]);
269
269
  } else if (optionsArray && optionsArray.constructor === Object) {
270
270
  let optionsArrayCopy:{[index: string]:any} = {};
271
- let selectedOptionsVariable = selectedOptions(values);
271
+ selectedOptionsVariable = selectedOptions(values);
272
272
  if (selectedOptionsVariable.length > 0) {
273
273
  selectedOptionsVariable = selectedOptionsVariable.filter((item:any) => {
274
274
  return item.label.toLowerCase().search(search.toLowerCase()) > -1;
@@ -21,6 +21,7 @@
21
21
  "suppressImplicitAnyIndexErrors": true,
22
22
  "jsx": "react-jsx",
23
23
  "outDir": "../../dist/cjs",
24
+
24
25
 
25
26
 
26
27
 
@@ -12,7 +12,7 @@
12
12
  "skipLibCheck": true,
13
13
  "esModuleInterop": true,
14
14
  "allowSyntheticDefaultImports": true,
15
- "strict": false,
15
+ "strict": true,
16
16
  "forceConsistentCasingInFileNames": true,
17
17
  "noFallthroughCasesInSwitch": true,
18
18
  "declaration": true,
@@ -21,6 +21,7 @@
21
21
  "suppressImplicitAnyIndexErrors": true,
22
22
  "jsx": "react-jsx",
23
23
  "outDir": "../../dist/esm",
24
+
24
25
  }
25
26
 
26
27
 
@@ -1,4 +1,3 @@
1
1
  /// <reference types="react" />
2
- import './App.css';
3
2
  declare function App(): JSX.Element;
4
3
  export default App;
package/src/sample/App.js CHANGED
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  var react_1 = __importDefault(require("react"));
7
- require("./App.css");
7
+ // import './App.css';
8
8
  var TestMenuBar_1 = __importDefault(require("./TestMenuBar"));
9
9
  function App() {
10
10
  return (react_1.default.createElement("div", { className: "App" },