albinasoft-ui-package 1.0.50 → 1.0.52

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.
@@ -1,5 +1,6 @@
1
- import React from 'react';
2
- import 'react-datepicker/dist/react-datepicker.css';
1
+ import React from "react";
2
+ import "react-datepicker/dist/react-datepicker.css";
3
+ import "../assets/css/custom-datetime-picker.css";
3
4
  declare enum TimeFormat {
4
5
  H = "HH",
5
6
  M = "mm",
@@ -9,6 +9,7 @@ var react_datepicker_1 = __importDefault(require("react-datepicker"));
9
9
  require("react-datepicker/dist/react-datepicker.css");
10
10
  var react_bootstrap_1 = require("react-bootstrap");
11
11
  var fa_1 = require("react-icons/fa");
12
+ require("../assets/css/custom-datetime-picker.css");
12
13
  var TimeFormat;
13
14
  (function (TimeFormat) {
14
15
  TimeFormat["H"] = "HH";
@@ -18,18 +19,28 @@ var TimeFormat;
18
19
  exports.TimeFormat = TimeFormat;
19
20
  var CustomDateTimePicker = function (_a) {
20
21
  var id = _a.id, name = _a.name, label = _a.label, value = _a.value, placeholder = _a.placeholder, _b = _a.required, required = _b === void 0 ? false : _b, errorMessage = _a.errorMessage, _c = _a.conditionalErrorVisible, conditionalErrorVisible = _c === void 0 ? false : _c, conditionalErrorMessage = _a.conditionalErrorMessage, tooltip = _a.tooltip, description = _a.description, _d = _a.disabled, disabled = _d === void 0 ? false : _d, className = _a.className, style = _a.style, showTimeSelect = _a.showTimeSelect, showTimeSelectOnly = _a.showTimeSelectOnly, _e = _a.timeFormat, timeFormat = _e === void 0 ? TimeFormat.HM : _e, timeIntervals = _a.timeIntervals, onChange = _a.onChange;
21
- return (react_1.default.createElement("div", { className: className },
22
+ return (react_1.default.createElement("div", { className: "col-12" },
22
23
  react_1.default.createElement("div", { className: "form-group" },
23
24
  react_1.default.createElement("label", { htmlFor: id, className: "form-label" }, label),
24
25
  react_1.default.createElement("div", { className: "position-relative" },
25
- react_1.default.createElement(react_bootstrap_1.OverlayTrigger, { placement: "bottom", overlay: tooltip ? react_1.default.createElement(react_bootstrap_1.Tooltip, { id: "tooltip-".concat(id) }, tooltip) : react_1.default.createElement(react_1.default.Fragment, null) },
26
+ react_1.default.createElement(react_bootstrap_1.OverlayTrigger, { placement: "bottom", overlay: tooltip ? (react_1.default.createElement(react_bootstrap_1.Tooltip, { id: "tooltip-".concat(id) }, tooltip)) : (react_1.default.createElement(react_1.default.Fragment, null)) },
26
27
  react_1.default.createElement("div", null,
27
- react_1.default.createElement(react_datepicker_1.default, { id: id, name: name, selected: value, onChange: onChange, className: "form-control ".concat(className || ''), placeholderText: placeholder, disabled: disabled, required: required, showTimeSelect: showTimeSelect || false, showTimeSelectOnly: showTimeSelectOnly || false, showTimeCaption: false, timeFormat: timeFormat, dateFormat: showTimeSelectOnly ? timeFormat : showTimeSelect ? "dd.MM.yyyy HH:mm" : "dd.MM.yyyy", timeIntervals: timeFormat == TimeFormat.H ? 60 : timeFormat == TimeFormat.M ? 1 : timeIntervals ? timeIntervals : 30 }))),
28
+ react_1.default.createElement(react_datepicker_1.default, { id: id, name: name, selected: value, onChange: onChange, className: "form-control ".concat(className || ""), placeholderText: placeholder, disabled: disabled, required: required, showTimeSelect: showTimeSelect || false, showTimeSelectOnly: showTimeSelectOnly || false, showTimeCaption: false, timeFormat: timeFormat, dateFormat: showTimeSelectOnly
29
+ ? timeFormat
30
+ : showTimeSelect
31
+ ? "dd.MM.yyyy HH:mm"
32
+ : "dd.MM.yyyy", timeIntervals: timeFormat == TimeFormat.H
33
+ ? 60
34
+ : timeFormat == TimeFormat.M
35
+ ? 1
36
+ : timeIntervals
37
+ ? timeIntervals
38
+ : 30 }))),
28
39
  required && !value && (react_1.default.createElement("div", { className: "invalid-feedback text-danger mt-2" },
29
40
  react_1.default.createElement("div", { className: "description-icon" },
30
41
  react_1.default.createElement(fa_1.FaExclamationTriangle, null)),
31
42
  react_1.default.createElement("div", { className: "description-text" },
32
- react_1.default.createElement("span", null, errorMessage || 'This field is required.')))),
43
+ react_1.default.createElement("span", null, errorMessage || "This field is required.")))),
33
44
  conditionalErrorVisible && (react_1.default.createElement("div", { className: "conditional-error-message text-warning mt-2" },
34
45
  react_1.default.createElement("div", { className: "description-icon" },
35
46
  react_1.default.createElement(fa_1.FaExclamationTriangle, null)),
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React from "react";
2
2
  declare enum InputType {
3
3
  TEXT = "text",
4
4
  NUMBER = "number",
@@ -22,11 +22,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
25
28
  Object.defineProperty(exports, "__esModule", { value: true });
26
29
  exports.InputType = exports.CustomInput = void 0;
27
30
  var react_1 = __importStar(require("react"));
28
31
  var react_bootstrap_1 = require("react-bootstrap");
29
32
  var fa_1 = require("react-icons/fa");
33
+ var react_input_mask_1 = __importDefault(require("react-input-mask"));
30
34
  var InputType;
31
35
  (function (InputType) {
32
36
  InputType["TEXT"] = "text";
@@ -40,25 +44,32 @@ exports.InputType = InputType;
40
44
  var CustomInput = function (_a) {
41
45
  var id = _a.id, name = _a.name, label = _a.label, _b = _a.inputType, inputType = _b === void 0 ? InputType.TEXT : _b, value = _a.value, placeholder = _a.placeholder, _c = _a.required, required = _c === void 0 ? false : _c, errorMessage = _a.errorMessage, _d = _a.conditionalErrorVisible, conditionalErrorVisible = _d === void 0 ? false : _d, conditionalErrorMessage = _a.conditionalErrorMessage, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.readOnly, readOnly = _f === void 0 ? false : _f, buttonIcon = _a.buttonIcon, buttonClass = _a.buttonClass, buttonTooltip = _a.buttonTooltip, description = _a.description, tooltip = _a.tooltip, style = _a.style, mainClass = _a.mainClass, className = _a.className, buttonOnClick = _a.buttonOnClick, onChange = _a.onChange;
42
46
  var _g = (0, react_1.useState)(false), showPassword = _g[0], setShowPassword = _g[1];
43
- var handleType = inputType === InputType.PASSWORD && showPassword ? InputType.TEXT : inputType;
47
+ var handleType = inputType === InputType.PASSWORD && showPassword
48
+ ? InputType.TEXT
49
+ : inputType;
44
50
  var togglePasswordVisibility = function () {
45
51
  setShowPassword(function (prev) { return !prev; });
46
52
  };
53
+ var renderInput = function () {
54
+ // If inputType is TEL, use ReactInputMask
55
+ if (inputType === InputType.TEL) {
56
+ return (react_1.default.createElement(react_input_mask_1.default, { mask: "0(999) 999 99 99", value: value, onChange: onChange, className: "form-control ".concat(className), style: style, required: required, disabled: disabled, readOnly: readOnly, autoComplete: "new-password" }));
57
+ }
58
+ // Otherwise, return a normal input element
59
+ return (react_1.default.createElement("input", { id: id, name: name, type: handleType, value: value, placeholder: placeholder, onChange: onChange, className: "form-control ".concat(className), style: style, required: required, disabled: disabled, readOnly: readOnly, autoComplete: "new-password" }));
60
+ };
47
61
  return (react_1.default.createElement("div", { className: mainClass },
48
62
  react_1.default.createElement("div", { className: "form-group" },
49
63
  react_1.default.createElement("label", { htmlFor: id, className: "form-label" }, label),
50
64
  react_1.default.createElement("div", { className: "input-group position-relative" },
51
- tooltip ? (react_1.default.createElement(react_bootstrap_1.OverlayTrigger, { placement: "bottom", overlay: react_1.default.createElement(react_bootstrap_1.Tooltip, { id: "tooltip-".concat(tooltip) }, tooltip) },
52
- react_1.default.createElement("input", { id: id, name: name, type: handleType, value: value, placeholder: placeholder, onChange: onChange, className: "form-control ".concat(className), style: style, required: required, disabled: disabled, readOnly: readOnly, autoComplete: "new-password" // Modern tarayıcılarda autocomplete autofill engellemek için
53
- }))) : (react_1.default.createElement("input", { id: id, name: name, type: handleType, value: value, placeholder: placeholder, onChange: onChange, className: "form-control ".concat(className), style: style, required: required, disabled: disabled, readOnly: readOnly, autoComplete: "new-password" // Modern tarayıcılarda autocomplete autofill engellemek için
54
- })),
65
+ tooltip ? (react_1.default.createElement(react_bootstrap_1.OverlayTrigger, { placement: "bottom", overlay: react_1.default.createElement(react_bootstrap_1.Tooltip, { id: "tooltip-".concat(tooltip) }, tooltip) }, renderInput())) : (renderInput()),
55
66
  inputType === InputType.PASSWORD && (react_1.default.createElement("button", { type: "button", onClick: togglePasswordVisibility, className: "btn btn-outline-secondary", title: showPassword ? "Parolayı Gizle" : "Parolayı Göster" }, showPassword ? react_1.default.createElement(fa_1.FaEyeSlash, null) : react_1.default.createElement(fa_1.FaEye, null))),
56
67
  buttonIcon && buttonOnClick && (react_1.default.createElement("button", { type: "button", onClick: buttonOnClick, className: buttonClass || "btn btn-outline-secondary", title: buttonTooltip || "" }, buttonIcon)),
57
68
  required && (react_1.default.createElement("div", { className: "invalid-feedback text-danger" },
58
69
  react_1.default.createElement("div", { className: "description-icon" },
59
70
  react_1.default.createElement(fa_1.FaExclamationTriangle, null)),
60
71
  react_1.default.createElement("div", { className: "description-text" },
61
- react_1.default.createElement("span", null, errorMessage || 'Bu alan boş bırakılamaz.')))),
72
+ react_1.default.createElement("span", null, errorMessage || "Bu alan boş bırakılamaz.")))),
62
73
  conditionalErrorVisible && (react_1.default.createElement("div", { className: "conditional-error-message text-warning" },
63
74
  react_1.default.createElement("div", { className: "description-icon" },
64
75
  react_1.default.createElement(fa_1.FaExclamationTriangle, null)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "albinasoft-ui-package",
3
- "version": "1.0.50",
3
+ "version": "1.0.52",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -15,6 +15,7 @@
15
15
  "react-datepicker": "^7.5.0",
16
16
  "react-dom": "^18.0.0",
17
17
  "react-icons": "^5.4.0",
18
+ "react-input-mask": "^2.0.4",
18
19
  "react-quill": "^2.0.0",
19
20
  "react-router-dom": "^7.1.1",
20
21
  "react-toastify": "^10.0.6"
@@ -22,6 +23,7 @@
22
23
  "devDependencies": {
23
24
  "@types/react": "^19.0.1",
24
25
  "@types/react-bootstrap": "^0.32.37",
26
+ "@types/react-input-mask": "^3.0.6",
25
27
  "typescript": "^4.5.0"
26
28
  },
27
29
  "peerDependencies": {
@@ -1,41 +0,0 @@
1
- .autocomplete-container {
2
- position: relative; /* Dropdown'u input'un kapsayıcısına bağlamak için */
3
- }
4
-
5
- .autocomplete-dropdown {
6
- background-color: white;
7
- border: 1px solid #ccc;
8
- border-radius: 4px;
9
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
10
- z-index: 1050;
11
- max-height: 200px;
12
- overflow-y: auto;
13
- position: absolute;
14
- width: 100%;
15
- }
16
-
17
- .autocomplete-option {
18
- padding: 8px 12px;
19
- cursor: pointer;
20
- }
21
-
22
- .autocomplete-option:hover {
23
- background-color: #f1f1f1;
24
- }
25
-
26
- /* Dark Mode */
27
- .dark .autocomplete-dropdown {
28
- background-color: #333;
29
- color: #fff;
30
- border: 1px solid #444;
31
- }
32
-
33
- .dark .autocomplete-option:hover {
34
- background-color: #444;
35
- }
36
-
37
- mark {
38
- background-color: yellow;
39
- color: black;
40
- font-weight: bold;
41
- }
@@ -1,47 +0,0 @@
1
-
2
-
3
- .dropdown-menu {
4
- background: white;
5
- }
6
-
7
- .dark .dropdown-menu {
8
- background: #222738;
9
- }
10
-
11
- .dropdown-menu::-webkit-scrollbar-thumb {
12
- background-color: #888; /* Scrollbar rengi */
13
- }
14
-
15
- .dropdown-menu::-webkit-scrollbar-thumb:hover {
16
- background-color: #555; /* Hover durumunda daha koyu */
17
- }
18
-
19
- .dark .dropdown-menu::-webkit-scrollbar-thumb {
20
- background-color: #444; /* Dark tema için scrollbar rengi */
21
- }
22
-
23
- .dark .dropdown-menu::-webkit-scrollbar-thumb:hover {
24
- background-color: #666; /* Dark tema hover */
25
- }
26
-
27
- .dropdown-menu::-webkit-scrollbar-track {
28
- background: transparent; /* Scrollbar arka planı */
29
- }
30
-
31
- .dark .dropdown-menu::-webkit-scrollbar-track {
32
- background: #151824; /* Dark tema için arka plan */
33
- }
34
-
35
- .dropdown-item {
36
- padding: 8px 12px;
37
- cursor: pointer;
38
- }
39
-
40
- .dropdown-item:hover {
41
- background: #f1f1f1;
42
- }
43
-
44
- .dark .dropdown-item:hover {
45
- background: #151824;
46
- }
47
-