hi-tm 0.0.1
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.
- package/README.md +0 -0
- package/dist/components/AutoComplete/AutoComplete.d.ts +4 -0
- package/dist/components/AutoComplete/AutoComplete.js +132 -0
- package/dist/components/AutoComplete/AutoCompleteMultiSelect.d.ts +4 -0
- package/dist/components/AutoComplete/AutoCompleteMultiSelect.js +155 -0
- package/dist/components/AutoComplete/TreeAutoComplete.d.ts +65 -0
- package/dist/components/AutoComplete/TreeAutoComplete.js +150 -0
- package/dist/components/Cards/AutoComplete&DropDown/CourierCard.d.ts +4 -0
- package/dist/components/Cards/AutoComplete&DropDown/CourierCard.js +13 -0
- package/dist/components/Cards/AutoComplete&DropDown/GeographyCard.d.ts +4 -0
- package/dist/components/Cards/AutoComplete&DropDown/GeographyCard.js +11 -0
- package/dist/components/Cards/AutoComplete&DropDown/ItemCard.d.ts +4 -0
- package/dist/components/Cards/AutoComplete&DropDown/ItemCard.js +12 -0
- package/dist/components/Cards/AutoComplete&DropDown/PersonCard.d.ts +4 -0
- package/dist/components/Cards/AutoComplete&DropDown/PersonCard.js +12 -0
- package/dist/components/Cards/AutoComplete&DropDown/SimpleCard.d.ts +4 -0
- package/dist/components/Cards/AutoComplete&DropDown/SimpleCard.js +11 -0
- package/dist/components/DropDowns/DropDown.d.ts +4 -0
- package/dist/components/DropDowns/DropDown.js +170 -0
- package/dist/components/DropDowns/DropDownItemsPerPage.d.ts +8 -0
- package/dist/components/DropDowns/DropDownItemsPerPage.js +44 -0
- package/dist/components/DropDowns/DropDownMultiSelect.d.ts +4 -0
- package/dist/components/DropDowns/DropDownMultiSelect.js +154 -0
- package/dist/components/Inputs/Buttons/Button.d.ts +14 -0
- package/dist/components/Inputs/Buttons/Button.js +39 -0
- package/dist/components/Inputs/DaysCheckBox.d.ts +4 -0
- package/dist/components/Inputs/DaysCheckBox.js +27 -0
- package/dist/components/Inputs/InputBarcode.d.ts +4 -0
- package/dist/components/Inputs/InputBarcode.js +148 -0
- package/dist/components/Inputs/InputCurrency.d.ts +25 -0
- package/dist/components/Inputs/InputCurrency.js +105 -0
- package/dist/components/Inputs/InputMultiselect.d.ts +20 -0
- package/dist/components/Inputs/InputMultiselect.js +106 -0
- package/dist/components/Inputs/InputPercent.d.ts +40 -0
- package/dist/components/Inputs/InputPercent.js +100 -0
- package/dist/components/Inputs/InputSearch.d.ts +4 -0
- package/dist/components/Inputs/InputSearch.js +35 -0
- package/dist/components/Inputs/RangePicker.d.ts +18 -0
- package/dist/components/Inputs/RangePicker.js +132 -0
- package/dist/components/Inputs/TextArea.d.ts +4 -0
- package/dist/components/Inputs/TextArea.js +61 -0
- package/dist/components/Inputs/TextInput.d.ts +4 -0
- package/dist/components/Inputs/TextInput.js +74 -0
- package/dist/components/Inputs/Toggle.d.ts +20 -0
- package/dist/components/Inputs/Toggle.js +83 -0
- package/dist/components/Layout/Footers/FooterLayout.d.ts +5 -0
- package/dist/components/Layout/Footers/FooterLayout.js +80 -0
- package/dist/components/Layout/Headers/HeaderLayout.d.ts +85 -0
- package/dist/components/Layout/Headers/HeaderLayout.js +333 -0
- package/dist/components/Layout/Headers/HeaderSelectBranch.d.ts +38 -0
- package/dist/components/Layout/Headers/HeaderSelectBranch.js +153 -0
- package/dist/components/Layout/Sidebar.d.ts +4 -0
- package/dist/components/Layout/Sidebar.js +304 -0
- package/dist/components/Pagination/PaginationPrimary.d.ts +8 -0
- package/dist/components/Pagination/PaginationPrimary.js +40 -0
- package/dist/components/Table/TableHeader.d.ts +17 -0
- package/dist/components/Table/TableHeader.js +73 -0
- package/dist/components/Table/TableHeaderDiv.d.ts +33 -0
- package/dist/components/Table/TableHeaderDiv.js +121 -0
- package/dist/components/Table/TableRow.d.ts +4 -0
- package/dist/components/Table/TableRow.js +156 -0
- package/dist/components/Table/TableRowCards/TableRowCardChildren.d.ts +11 -0
- package/dist/components/Table/TableRowCards/TableRowCardChildren.js +68 -0
- package/dist/components/Table/TableRowCards/TableRowCardSimple.d.ts +12 -0
- package/dist/components/Table/TableRowCards/TableRowCardSimple.js +66 -0
- package/dist/components/Table/TableRowDiv.d.ts +59 -0
- package/dist/components/Table/TableRowDiv.js +329 -0
- package/dist/components/Tabs/Tabs.d.ts +15 -0
- package/dist/components/Tabs/Tabs.js +45 -0
- package/dist/components/Wrapper/Bounded.d.ts +30 -0
- package/dist/components/Wrapper/Bounded.js +17 -0
- package/dist/components/Wrapper/GlobalWrapper.d.ts +6 -0
- package/dist/components/Wrapper/GlobalWrapper.js +12 -0
- package/dist/components/Wrapper/Modals/Modal.d.ts +9 -0
- package/dist/components/Wrapper/Modals/Modal.js +77 -0
- package/dist/components/Wrapper/TableBodyBounded.d.ts +5 -0
- package/dist/components/Wrapper/TableBodyBounded.js +50 -0
- package/dist/components/Wrapper/TableBodyBoundedDiv.d.ts +6 -0
- package/dist/components/Wrapper/TableBodyBoundedDiv.js +11 -0
- package/dist/components/Wrapper/TableBounded.d.ts +18 -0
- package/dist/components/Wrapper/TableBounded.js +22 -0
- package/dist/components/Wrapper/TableBoundedDiv.d.ts +6 -0
- package/dist/components/Wrapper/TableBoundedDiv.js +11 -0
- package/dist/components/sections/components/Inputs/Toggle.d.ts +6 -0
- package/dist/components/sections/components/Inputs/Toggle.js +19 -0
- package/dist/components/sections/components/Loader/BtnLoader.d.ts +3 -0
- package/dist/components/sections/components/Loader/BtnLoader.js +15 -0
- package/dist/components/sections/components/Modals/ModalProvider.d.ts +4 -0
- package/dist/components/sections/components/Modals/ModalProvider.js +10 -0
- package/dist/components/sections/components/Modals/ModalSearchContentInHeader.d.ts +4 -0
- package/dist/components/sections/components/Modals/ModalSearchContentInHeader.js +104 -0
- package/dist/components/sections/components/Tabs/BreadCrumbs.d.ts +4 -0
- package/dist/components/sections/components/Tabs/BreadCrumbs.js +23 -0
- package/dist/components/sections/components/Tabs/TabsComponent.d.ts +4 -0
- package/dist/components/sections/components/Tabs/TabsComponent.js +109 -0
- package/dist/helper/formatNumberWithCommas.d.ts +1 -0
- package/dist/helper/formatNumberWithCommas.js +32 -0
- package/dist/helper/getValueByTypeInList.d.ts +2 -0
- package/dist/helper/getValueByTypeInList.js +7 -0
- package/dist/helper/modalStyleOperationHandler.d.ts +3 -0
- package/dist/helper/modalStyleOperationHandler.js +12 -0
- package/dist/helper/truncateText.d.ts +2 -0
- package/dist/helper/truncateText.js +19 -0
- package/dist/helper/useBackAndEscModal.d.ts +24 -0
- package/dist/helper/useBackAndEscModal.js +26 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +85 -0
- package/dist/styles/globals.css +176 -0
- package/dist/tailwind-preset.d.ts +42 -0
- package/dist/tailwind-preset.js +43 -0
- package/dist/tailwind-preset.ts +41 -0
- package/dist/types/AutoComplete/AutoComplete.d.ts +22 -0
- package/dist/types/AutoComplete/AutoComplete.js +2 -0
- package/dist/types/AutoComplete/AutoCompleteMultiSelect.d.ts +27 -0
- package/dist/types/AutoComplete/AutoCompleteMultiSelect.js +2 -0
- package/dist/types/BreakCrumbTypes.d.ts +12 -0
- package/dist/types/BreakCrumbTypes.js +2 -0
- package/dist/types/Buttons/PrimaryButton.d.ts +14 -0
- package/dist/types/Buttons/PrimaryButton.js +2 -0
- package/dist/types/Cards/AutoComplete&DropDown/CardsType.d.ts +30 -0
- package/dist/types/Cards/AutoComplete&DropDown/CardsType.js +2 -0
- package/dist/types/DropDown/DropDownMultiSelectType.d.ts +31 -0
- package/dist/types/DropDown/DropDownMultiSelectType.js +2 -0
- package/dist/types/DropDown/DropDownType.d.ts +30 -0
- package/dist/types/DropDown/DropDownType.js +2 -0
- package/dist/types/Inputs/AutoCompleteType.d.ts +37 -0
- package/dist/types/Inputs/AutoCompleteType.js +2 -0
- package/dist/types/Inputs/DaysCheckBoxType.d.ts +13 -0
- package/dist/types/Inputs/DaysCheckBoxType.js +2 -0
- package/dist/types/Inputs/DropDownType.d.ts +24 -0
- package/dist/types/Inputs/DropDownType.js +2 -0
- package/dist/types/Inputs/InputBarcodeType.d.ts +17 -0
- package/dist/types/Inputs/InputBarcodeType.js +2 -0
- package/dist/types/Inputs/InputCurrencyType.d.ts +17 -0
- package/dist/types/Inputs/InputCurrencyType.js +2 -0
- package/dist/types/Inputs/InputMultiselectType.d.ts +19 -0
- package/dist/types/Inputs/InputMultiselectType.js +2 -0
- package/dist/types/Inputs/InputSearchType.d.ts +19 -0
- package/dist/types/Inputs/InputSearchType.js +2 -0
- package/dist/types/Inputs/RangePickerType.d.ts +14 -0
- package/dist/types/Inputs/RangePickerType.js +2 -0
- package/dist/types/Inputs/TextAreaType.d.ts +12 -0
- package/dist/types/Inputs/TextAreaType.js +2 -0
- package/dist/types/Inputs/TextInputType.d.ts +20 -0
- package/dist/types/Inputs/TextInputType.js +2 -0
- package/dist/types/Inputs/ToggleType.d.ts +11 -0
- package/dist/types/Inputs/ToggleType.js +2 -0
- package/dist/types/Layout/Headers/HeaderLayout.d.ts +75 -0
- package/dist/types/Layout/Headers/HeaderLayout.js +2 -0
- package/dist/types/Layout/Sidebar.d.ts +21 -0
- package/dist/types/Layout/Sidebar.js +2 -0
- package/dist/types/Layout/SidebarType.d.ts +42 -0
- package/dist/types/Layout/SidebarType.js +2 -0
- package/dist/types/Modals/ModalProviderType.d.ts +4 -0
- package/dist/types/Modals/ModalProviderType.js +2 -0
- package/dist/types/Modals/ModalSearchContentInHeaderPropsType.d.ts +10 -0
- package/dist/types/Modals/ModalSearchContentInHeaderPropsType.js +2 -0
- package/dist/types/Table/TableRowType.d.ts +41 -0
- package/dist/types/Table/TableRowType.js +2 -0
- package/dist/types/TabsType.d.ts +24 -0
- package/dist/types/TabsType.js +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +17 -0
- package/package.json +44 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const TextArea = ({ label, placeholder, required, textError, value, onChangeValueHandler, style = {
|
|
39
|
+
margin: '',
|
|
40
|
+
width: 'w-full',
|
|
41
|
+
}, }) => {
|
|
42
|
+
const [currentValue, setCurrentValue] = (0, react_1.useState)(value || '');
|
|
43
|
+
const handleChange = (event) => {
|
|
44
|
+
setCurrentValue(event.target.value);
|
|
45
|
+
onChangeValueHandler(event);
|
|
46
|
+
};
|
|
47
|
+
(0, react_1.useEffect)(() => {
|
|
48
|
+
setCurrentValue(value || '');
|
|
49
|
+
}, [value]);
|
|
50
|
+
const showError = () => {
|
|
51
|
+
return textError === '' || textError === null || textError.trim() === '';
|
|
52
|
+
};
|
|
53
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
54
|
+
react_1.default.createElement("div", { className: `flex flex-col gap-1 py-2 relative ${style.width} ${style.margin}` },
|
|
55
|
+
react_1.default.createElement("label", { htmlFor: 'message', className: 'flex items-center gap-2 mx-3' },
|
|
56
|
+
react_1.default.createElement("p", { className: 'text-sm text-text-color-primary font-medium cursor-pointer' }, label),
|
|
57
|
+
react_1.default.createElement("span", { className: `text-red-primary font-bold ${required ? 'block' : 'hidden'}` }, "*")),
|
|
58
|
+
react_1.default.createElement("textarea", { id: 'message', rows: 4, cols: 4, value: currentValue, className: 'block p-2.5 w-full text-sm outline-none text-gray-900 bg-[#e4e4e7] rounded-lg border border-gray-300 focus:border-primaryBorderColor resize-none', placeholder: placeholder, onChange: handleChange }),
|
|
59
|
+
react_1.default.createElement("p", { className: `text-sm mr-1 mt-2 text-nowrap font-normal text-red-primary ${showError() ? 'hidden' : 'flex'}` }, textError?.trim()))));
|
|
60
|
+
};
|
|
61
|
+
exports.default = TextArea;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextInputPropsType } from '../../types/Inputs/TextInputType';
|
|
3
|
+
declare const TextInput: ({ label, required, value, placeholderText, autoComplete, autoFocus, textError, onChangeValueHandler, onBlurHandler, onFocusHandler, onKeyUpHandler, onKeyDownHandler, disabled, type, style, }: TextInputPropsType) => React.JSX.Element;
|
|
4
|
+
export default TextInput;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const TextInput = ({ label, required, value, placeholderText, autoComplete, autoFocus, textError, onChangeValueHandler, onBlurHandler, onFocusHandler, onKeyUpHandler, onKeyDownHandler, disabled = false, type = 'text', style = {
|
|
39
|
+
margin: 'mt-[-6px]',
|
|
40
|
+
width: 'w-full',
|
|
41
|
+
}, }) => {
|
|
42
|
+
const [inputValue, setInputValue] = (0, react_1.useState)('');
|
|
43
|
+
const inputRef = (0, react_1.useRef)(null);
|
|
44
|
+
const handleInputChange = (e) => {
|
|
45
|
+
setInputValue(e.target.value);
|
|
46
|
+
onChangeValueHandler(e);
|
|
47
|
+
};
|
|
48
|
+
const handleFocus = (e) => {
|
|
49
|
+
if (onFocusHandler) {
|
|
50
|
+
onFocusHandler(e);
|
|
51
|
+
}
|
|
52
|
+
if (inputRef.current && type === 'text') {
|
|
53
|
+
setTimeout(() => {
|
|
54
|
+
if (inputRef.current) {
|
|
55
|
+
const length = inputRef.current.value.length;
|
|
56
|
+
inputRef.current.setSelectionRange(length, length);
|
|
57
|
+
}
|
|
58
|
+
}, 0);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const showError = () => {
|
|
62
|
+
return textError === '' || textError === null || textError.trim() === '';
|
|
63
|
+
};
|
|
64
|
+
return (react_1.default.createElement("div", { className: `${style.margin} ${style.width} h-full bg-inherit` },
|
|
65
|
+
react_1.default.createElement("div", { className: "relative flex flex-col min-h-[85px]" },
|
|
66
|
+
react_1.default.createElement("div", { className: "w-full flex items-start justify-start gap-1" },
|
|
67
|
+
react_1.default.createElement("p", { className: `text-sm text-text-color-primary font-medium ${disabled ? 'cursor-not-allowed' : 'cursor-pointer'}` }, label),
|
|
68
|
+
react_1.default.createElement("span", { className: `text-red-primary ${required ? 'opacity-100' : 'opacity-0'} ` }, "*")),
|
|
69
|
+
react_1.default.createElement("input", { ref: inputRef, type: type, id: label, disabled: disabled, value: value || inputValue, required: false, onChange: handleInputChange, onBlur: onBlurHandler ? onBlurHandler : () => { }, onFocus: handleFocus, onKeyDown: onKeyDownHandler ? onKeyDownHandler : () => { }, onKeyUp: onKeyUpHandler ? onKeyUpHandler : () => { }, placeholder: placeholderText, autoComplete: autoComplete ? 'on' : 'off', autoFocus: autoFocus, className: `input-style bg-inherit ${disabled ? 'cursor-not-allowed' : ''} text-gray-secondary ${textError === ''
|
|
70
|
+
? 'border-[2px] border-solid border-gray-tertiary'
|
|
71
|
+
: ' border-[2.5px] border-solid border-red-primary'}` }),
|
|
72
|
+
react_1.default.createElement("span", { className: `absolute bottom-0 text-sm mr-1 text-nowrap font-normal text-red-primary ${showError() ? 'opacity-0' : 'opacity-100'}` }, textError?.trim()))));
|
|
73
|
+
};
|
|
74
|
+
exports.default = TextInput;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TogglePropsType } from '../../types/Inputs/ToggleType';
|
|
3
|
+
/**
|
|
4
|
+
* Toggle Component
|
|
5
|
+
*
|
|
6
|
+
* A customizable toggle switch component with a label.
|
|
7
|
+
*
|
|
8
|
+
* @param {string} props.label - The label to display next to the toggle switch.
|
|
9
|
+
* @param {boolean | null} props.value - The initial state of the toggle (on/off). => Null = false
|
|
10
|
+
* @param {(newValue: boolean) => void} props.onChangeValueHandler -
|
|
11
|
+
* A callback function that gets called when the toggle value changes.
|
|
12
|
+
* It receives the updated value as its parameter.
|
|
13
|
+
* True / False
|
|
14
|
+
*
|
|
15
|
+
* * @param {string} [props.width] - Optional width for the toggle container. Defaults to "w-full".
|
|
16
|
+
*
|
|
17
|
+
* @returns {React.JSX.Element} - A React component for a toggle switch.
|
|
18
|
+
*/
|
|
19
|
+
declare const Toggle: ({ label, value, textError, onChangeValueHandler, style, }: TogglePropsType) => React.JSX.Element;
|
|
20
|
+
export default Toggle;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
/**
|
|
39
|
+
* Toggle Component
|
|
40
|
+
*
|
|
41
|
+
* A customizable toggle switch component with a label.
|
|
42
|
+
*
|
|
43
|
+
* @param {string} props.label - The label to display next to the toggle switch.
|
|
44
|
+
* @param {boolean | null} props.value - The initial state of the toggle (on/off). => Null = false
|
|
45
|
+
* @param {(newValue: boolean) => void} props.onChangeValueHandler -
|
|
46
|
+
* A callback function that gets called when the toggle value changes.
|
|
47
|
+
* It receives the updated value as its parameter.
|
|
48
|
+
* True / False
|
|
49
|
+
*
|
|
50
|
+
* * @param {string} [props.width] - Optional width for the toggle container. Defaults to "w-full".
|
|
51
|
+
*
|
|
52
|
+
* @returns {React.JSX.Element} - A React component for a toggle switch.
|
|
53
|
+
*/
|
|
54
|
+
const Toggle = ({ label, value, textError, onChangeValueHandler, style = {
|
|
55
|
+
margin: 'mt-2',
|
|
56
|
+
width: 'w-full',
|
|
57
|
+
}, }) => {
|
|
58
|
+
const [isChecked, setIsChecked] = (0, react_1.useState)(value ?? false);
|
|
59
|
+
const handleToggle = () => {
|
|
60
|
+
const newValue = !isChecked;
|
|
61
|
+
setIsChecked(newValue);
|
|
62
|
+
onChangeValueHandler(newValue);
|
|
63
|
+
};
|
|
64
|
+
(0, react_1.useEffect)(() => {
|
|
65
|
+
setIsChecked(value ?? false);
|
|
66
|
+
}, [value]);
|
|
67
|
+
const handleInputClick = (event) => {
|
|
68
|
+
event.stopPropagation();
|
|
69
|
+
};
|
|
70
|
+
const showError = () => {
|
|
71
|
+
return textError === '' || textError === null || textError.trim() === '';
|
|
72
|
+
};
|
|
73
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
74
|
+
react_1.default.createElement("div", { onClick: handleToggle, className: `bg-primaryBackGroundWhite cursor-pointer text-primaryTextColor flex flex-row items-center justify-between border border-solid border-gray-secondary h-12 px-4 rounded-2xl ${style.margin} ${style.width}` },
|
|
75
|
+
react_1.default.createElement("div", { className: 'w-full relative flex flex-row items-center justify-between gap-4 py-2 md:py-0 select-none-custom' },
|
|
76
|
+
label,
|
|
77
|
+
react_1.default.createElement("div", { className: 'absolute left-0 inline-block w-8 h-4 rounded-full cursor-pointer' },
|
|
78
|
+
react_1.default.createElement("input", { id: 'toggle', type: 'checkbox', className: 'absolute w-8 h-4 transition-colors duration-300 rounded-full appearance-none cursor-pointer peer bg-gray-500 checked:bg-blue-primary peer-checked:border-blue-primary peer-checked:before:bg-blue-primary', checked: isChecked, onChange: () => { }, onClick: handleInputClick }),
|
|
79
|
+
react_1.default.createElement("label", { htmlFor: 'toggle', className: "before:content[''] absolute top-2/4 -right-1 h-5 w-5 -translate-y-2/4 cursor-pointer rounded-full border border-blue-gray-100 bg-white-color shadow-md transition-all duration-300 before:absolute before:top-2/4 before:right-2/4 before:block before:h-10 before:w-10 before:-translate-y-2/4 before:translate-x-2/4 before:rounded-full before:bg-blue-gray-500 before:opacity-0 before:transition-opacity hover:before:opacity-10 peer-checked:-translate-x-full peer-checked:border-blue-primary peer-checked:before:bg-blue-primary" },
|
|
80
|
+
react_1.default.createElement("div", { className: 'inline-block p-5 rounded-full top-2/4 left-2/4 -translate-x-2/4 -translate-y-2/4', "data-ripple-dark": 'true' }))))),
|
|
81
|
+
react_1.default.createElement("span", { className: `text-sm mr-1 mt-2 text-nowrap font-normal text-red-primary ${showError() ? 'opacity-0' : 'opacity-100'}` }, textError?.trim())));
|
|
82
|
+
};
|
|
83
|
+
exports.default = Toggle;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const FooterLayout = ({ versionNumber }) => {
|
|
39
|
+
const [isVisible, setIsVisible] = (0, react_1.useState)(false);
|
|
40
|
+
const handleScroll = () => {
|
|
41
|
+
const scrollTop = window.scrollY;
|
|
42
|
+
const windowHeight = window.innerHeight;
|
|
43
|
+
const documentHeight = document.documentElement.scrollHeight;
|
|
44
|
+
// Check if the page is scrollable
|
|
45
|
+
const isScrollable = documentHeight > windowHeight;
|
|
46
|
+
if (!isScrollable) {
|
|
47
|
+
setIsVisible(true);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
// Check if the user has scrolled to near the bottom of the page
|
|
51
|
+
const offset = 50; // Distance from the bottom to trigger visibility
|
|
52
|
+
if (scrollTop + windowHeight >= documentHeight - offset) {
|
|
53
|
+
setIsVisible(true);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
setIsVisible(false);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
(0, react_1.useEffect)(() => {
|
|
61
|
+
// Add scroll event listener
|
|
62
|
+
window.addEventListener('scroll', handleScroll);
|
|
63
|
+
// Initial check to see if the page is scrollable
|
|
64
|
+
handleScroll();
|
|
65
|
+
// Cleanup the event listener on component unmount
|
|
66
|
+
return () => {
|
|
67
|
+
window.removeEventListener('scroll', handleScroll);
|
|
68
|
+
};
|
|
69
|
+
}, []);
|
|
70
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
71
|
+
react_1.default.createElement("footer", { style: {
|
|
72
|
+
boxShadow: '0px 0px 123px #b3b3b3',
|
|
73
|
+
transform: isVisible ? 'translateY(0)' : 'translateY(100%)',
|
|
74
|
+
transition: 'transform 0.3s ease-in-out',
|
|
75
|
+
}, className: 'w-screen flex flex-row-reverse items-center justify-end h-5 bg-white-color fixed bottom-0 left-0' },
|
|
76
|
+
react_1.default.createElement("div", { className: 'flex flex-row-reverse gap-1 text-xs text-black-color opacity-30 absolute left-0 top-1/2 transform -translate-y-1/2' },
|
|
77
|
+
react_1.default.createElement("p", null, ":Version"),
|
|
78
|
+
react_1.default.createElement("p", null, versionNumber)))));
|
|
79
|
+
};
|
|
80
|
+
exports.default = FooterLayout;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { HeaderLayoutProps } from '../../../types/Layout/Headers/HeaderLayout';
|
|
3
|
+
/**
|
|
4
|
+
* The component accepts the following props:
|
|
5
|
+
* @param branchName - User's branch name to use in the logo URL.
|
|
6
|
+
* @param brandNameText - The name of the brand to display in the header.(next to the logo image)
|
|
7
|
+
* @param userFirstName - The first name of the user to display in the profile section.
|
|
8
|
+
* @param userLastName - The last name of the user to display in the profile section.
|
|
9
|
+
* @param logOutText - Logout text to display in the modal.
|
|
10
|
+
* @param logOutHandler - Function to handle the logout action when the user clicks the logout button.
|
|
11
|
+
* @param modalData - Array of modal data items to display in the profile dropdown menu.
|
|
12
|
+
* @type
|
|
13
|
+
* ```typescript
|
|
14
|
+
* {
|
|
15
|
+
* id: number;
|
|
16
|
+
* title: string;
|
|
17
|
+
* link: string;
|
|
18
|
+
* iconSrc: string;
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
* @param modalItemOnClickHandler - Function Called when the item is clicked.
|
|
22
|
+
* ```typescript
|
|
23
|
+
* {
|
|
24
|
+
* id: number;
|
|
25
|
+
* title: string;
|
|
26
|
+
* link: string;
|
|
27
|
+
* iconSrc: string;
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @param iconsSRC - Object containing paths to various icon sources used in the header.
|
|
32
|
+
* ```typescript
|
|
33
|
+
* {
|
|
34
|
+
logoSRC: string,
|
|
35
|
+
iconProfileUserSRC: string,
|
|
36
|
+
logOutIconSRC: string,
|
|
37
|
+
arrowSRC: string,
|
|
38
|
+
refreshIconSRC: string,
|
|
39
|
+
notificationIconSRC: string,
|
|
40
|
+
languageIconSRC: string,
|
|
41
|
+
menuIconSRC: string,
|
|
42
|
+
trashIconSRC: string,
|
|
43
|
+
closeIconSRC: string,
|
|
44
|
+
}
|
|
45
|
+
* ```
|
|
46
|
+
* @param cdnURL - The base URL for CDN resources.
|
|
47
|
+
* @param userBranchesData - Array of user branch data for branch selection.
|
|
48
|
+
* @param selectBranchHandler - Function to handle branch selection ( Void OR It returns the following type).
|
|
49
|
+
* @type
|
|
50
|
+
* ```typescript
|
|
51
|
+
* {
|
|
52
|
+
* id: number;
|
|
53
|
+
* name: string;
|
|
54
|
+
* urlName: string;
|
|
55
|
+
* imageName: string;
|
|
56
|
+
* logoName: string;
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
59
|
+
* @param sidebarData - Array of sidebar data for search in header.
|
|
60
|
+
* @type
|
|
61
|
+
* ```typescript
|
|
62
|
+
* {
|
|
63
|
+
* id: number;
|
|
64
|
+
* imgSrc: string;
|
|
65
|
+
* name: string;
|
|
66
|
+
* keyNameLang: string;
|
|
67
|
+
* FirstSubsets?: FirstSubset[];
|
|
68
|
+
* }
|
|
69
|
+
* ```
|
|
70
|
+
* @param searchIconSRC - The path to the search icon source => type:string.
|
|
71
|
+
* @param searchItemHandler - When the user searches for an item and clicks on a search result,
|
|
72
|
+
* the clicked item is returned with the following type:
|
|
73
|
+
* ```typescript
|
|
74
|
+
* {
|
|
75
|
+
* id: number;
|
|
76
|
+
* name: string;
|
|
77
|
+
* routeURL: string;
|
|
78
|
+
* iconSRC: string;
|
|
79
|
+
* keyNameLang: string;
|
|
80
|
+
* }
|
|
81
|
+
* ```
|
|
82
|
+
* @param refreshPageHandler - Function to refresh the page when the refresh icon is clicked.
|
|
83
|
+
*/
|
|
84
|
+
declare const HeaderLayout: React.FC<HeaderLayoutProps>;
|
|
85
|
+
export default HeaderLayout;
|