px-react-ui-components 1.0.0

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 (75) hide show
  1. package/.babelrc +3 -0
  2. package/README.md +126 -0
  3. package/dist/components/MyAlert/MyAlert.css +113 -0
  4. package/dist/components/MyAlert/MyAlert.js +109 -0
  5. package/dist/components/MyContainer/MyContainer.js +59 -0
  6. package/dist/components/MyContainer/MyContainer.module.css +110 -0
  7. package/dist/components/MyContainer/MyContainerBody.js +9 -0
  8. package/dist/components/MyContainer/MyContainerFooter.js +9 -0
  9. package/dist/components/MyContainer/MyContainerRight.js +10 -0
  10. package/dist/components/MyEditor/MyEditor.js +292 -0
  11. package/dist/components/MyEditor/MyEditor.scss +277 -0
  12. package/dist/components/MyFileUpload/MyFileUpload.js +288 -0
  13. package/dist/components/MyFileUpload/MyFileUpload.module.css +86 -0
  14. package/dist/components/MyImageCropper/MyImageCropper.js +95 -0
  15. package/dist/components/MyInput/MyInput.js +768 -0
  16. package/dist/components/MyInput/MyInput.module.css +420 -0
  17. package/dist/components/MyMaps/YandexMaps.js +162 -0
  18. package/dist/components/MyMenu/MenuItem.js +55 -0
  19. package/dist/components/MyMenu/MyMenu.module.css +102 -0
  20. package/dist/components/MyModal/MyModal.css +83 -0
  21. package/dist/components/MyModal/MyModal.js +71 -0
  22. package/dist/components/MyModal/MyModalBody.js +9 -0
  23. package/dist/components/MyModal/MyModalFooter.js +9 -0
  24. package/dist/components/MyNotFound/MyNotFound.css +22 -0
  25. package/dist/components/MyNotFound/MyNotFound.js +20 -0
  26. package/dist/components/MyScrollableCard/MyScrollableCard.js +74 -0
  27. package/dist/components/MyTable/MyTable.js +310 -0
  28. package/dist/components/MyTable/MyTable.module.css +350 -0
  29. package/dist/components/MyTable/MyTableBody.js +9 -0
  30. package/dist/components/MyTable/MyTableHead.js +9 -0
  31. package/dist/components/MyTabs/MyTabPane.js +17 -0
  32. package/dist/components/MyTabs/MyTabs.css +105 -0
  33. package/dist/components/MyTabs/MyTabs.js +66 -0
  34. package/dist/components/MyWaiting/MyWaiting.css +28 -0
  35. package/dist/components/MyWaiting/MyWaiting.js +27 -0
  36. package/dist/components/MyZoomImage/MyZoomImage.css +0 -0
  37. package/dist/components/MyZoomImage/MyZoomImage.js +108 -0
  38. package/dist/index.js +15 -0
  39. package/package.json +44 -0
  40. package/src/components/MyAlert/MyAlert.css +113 -0
  41. package/src/components/MyAlert/MyAlert.jsx +96 -0
  42. package/src/components/MyContainer/MyContainer.jsx +90 -0
  43. package/src/components/MyContainer/MyContainer.module.css +110 -0
  44. package/src/components/MyContainer/MyContainerBody.jsx +8 -0
  45. package/src/components/MyContainer/MyContainerFooter.jsx +8 -0
  46. package/src/components/MyContainer/MyContainerRight.jsx +11 -0
  47. package/src/components/MyEditor/MyEditor.jsx +252 -0
  48. package/src/components/MyEditor/MyEditor.scss +277 -0
  49. package/src/components/MyFileUpload/MyFileUpload.jsx +373 -0
  50. package/src/components/MyFileUpload/MyFileUpload.module.css +86 -0
  51. package/src/components/MyImageCropper/MyImageCropper.jsx +108 -0
  52. package/src/components/MyInput/MyInput.jsx +896 -0
  53. package/src/components/MyInput/MyInput.module.css +420 -0
  54. package/src/components/MyMaps/YandexMaps.jsx +186 -0
  55. package/src/components/MyMenu/MenuItem.jsx +62 -0
  56. package/src/components/MyMenu/MyMenu.module.css +102 -0
  57. package/src/components/MyModal/MyModal.css +83 -0
  58. package/src/components/MyModal/MyModal.jsx +78 -0
  59. package/src/components/MyModal/MyModalBody.jsx +8 -0
  60. package/src/components/MyModal/MyModalFooter.jsx +8 -0
  61. package/src/components/MyNotFound/MyNotFound.css +22 -0
  62. package/src/components/MyNotFound/MyNotFound.jsx +11 -0
  63. package/src/components/MyScrollableCard/MyScrollableCard.jsx +86 -0
  64. package/src/components/MyTable/MyTable.jsx +458 -0
  65. package/src/components/MyTable/MyTable.module.css +350 -0
  66. package/src/components/MyTable/MyTableBody.jsx +8 -0
  67. package/src/components/MyTable/MyTableHead.jsx +10 -0
  68. package/src/components/MyTabs/MyTabPane.jsx +9 -0
  69. package/src/components/MyTabs/MyTabs.css +105 -0
  70. package/src/components/MyTabs/MyTabs.jsx +63 -0
  71. package/src/components/MyWaiting/MyWaiting.css +28 -0
  72. package/src/components/MyWaiting/MyWaiting.jsx +27 -0
  73. package/src/components/MyZoomImage/MyZoomImage.css +0 -0
  74. package/src/components/MyZoomImage/MyZoomImage.jsx +139 -0
  75. package/src/index.js +15 -0
@@ -0,0 +1,102 @@
1
+ .menuItem{
2
+ display: flex;
3
+ width: 100%;
4
+ flex-direction: row;
5
+ align-items: center;
6
+ gap: 15px;
7
+ padding: 10px 16px 10px 20px;
8
+ cursor: pointer;
9
+ border-bottom: 1px solid #0000001c;
10
+ font-weight: 300;
11
+ font-size: 14px;
12
+ color: #fff !important;
13
+ text-decoration: none !important;
14
+ }
15
+ .menuItem.selected{
16
+ background-color: #fff1c939 !important;
17
+ }
18
+ .menuItem:last-child{
19
+ border-bottom: none;
20
+ }
21
+ .menuItem:hover{
22
+ background-color: #00000039;
23
+ }
24
+ .menuItem .menuItemIcon{
25
+ font-size: 20px;
26
+ }
27
+ .menuItem .menuItemText{
28
+ display: block;
29
+ position: relative;
30
+ width: 100%;
31
+ padding-right: 35px;
32
+ }
33
+ .menuItem .menuItemText .menuItemBadge{
34
+ position: absolute;
35
+ right: 0px;
36
+ top: 50%;
37
+ padding: 0px 8px;
38
+ transform: translateY(-50%);
39
+ background-color: #0000003d;
40
+ color: #fff;
41
+ border-radius: 10px;
42
+ padding-top: 1px;
43
+ font-size: 12px;
44
+ min-width: 25px;
45
+ font-weight: normal;
46
+ text-align: center;
47
+ }
48
+
49
+ .menuItem.menuItemShortMenu{
50
+ position: relative;
51
+ padding: 10px 10px;
52
+ justify-content: center;
53
+ }
54
+ .menuItem.menuItemShortMenu .menuItemIcon{
55
+ font-size: 24px;
56
+ }
57
+
58
+ .menuItem.menuItemShortMenu .menuItemText{
59
+ display: none;
60
+ }
61
+
62
+ .menuItem.menuItemShortMenu .menuItemIconSubMenu{
63
+ font-size: 13px;
64
+ position: absolute;
65
+ right: 8px;
66
+ top: 50%;
67
+ transform: translateY(-50%);
68
+ }
69
+
70
+ .menuItem.menuItemShortMenu:hover .menuItemText{
71
+ display: block;
72
+ position: absolute;
73
+ width: auto;
74
+ left: calc(100% + 5px);
75
+ top: 50%;
76
+ transform: translateY(-50%);
77
+ padding: 10px;
78
+ background-color: #000000;
79
+ color: #fff !important;
80
+ border-radius: 10px;
81
+ z-index: 1000;
82
+ white-space: nowrap;
83
+ }
84
+ .menuItem.menuItemShortMenu:hover .menuItemText.menuItemTextBadge{
85
+ padding-right: 50px;
86
+ }
87
+ .menuItem.menuItemShortMenu:hover .menuItemText.menuItemTextBadge .menuItemBadge{
88
+ right: 8px;
89
+ background-color: #ffffff46;
90
+ }
91
+ .menuItemOwner .menuItemOpen{
92
+ background-color: #283b5c;
93
+ }
94
+
95
+ .menuItemOwner .menuItemChildren{
96
+ display: none;
97
+ background-color: #30425f;
98
+
99
+ }
100
+ .menuItemOwner .menuItemChildrenOpen{
101
+ display: block;
102
+ }
@@ -0,0 +1,83 @@
1
+ .modal-overlay {
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ padding: 25px 0;
8
+ background-color: rgba(0, 0, 0, 0.5);
9
+ display: flex;
10
+ justify-content: center;
11
+ /* align-items: center; */
12
+ /* Overlay için overflow özelliği */
13
+ overflow-y: auto;
14
+ z-index: 99;
15
+ }
16
+ .modal-overlay.top {
17
+ align-items: baseline;
18
+ }
19
+
20
+ .modal-overlay .modal {
21
+ /* Modal için maksimum yükseklik ve scroll */
22
+
23
+ /* Modalın üst ve alt kısmında boşluk bırakmak için */
24
+ /* margin: 20px 0; */
25
+ height: max-content;
26
+ background-color: #ebeef3;
27
+ padding: 15px;
28
+ border-radius: 10px;
29
+ min-width: 200px;
30
+ max-width: 100%;
31
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
32
+ }
33
+
34
+ .modal-overlay .modal .modal-header {
35
+ display: flex;
36
+ width: 100%;
37
+ justify-content: space-between;
38
+ align-items: center;
39
+ }
40
+ .modal-overlay .modal .modal-header h4 {
41
+ margin-top: 0px;
42
+ padding-left: 8px;
43
+ }
44
+
45
+ .modal-overlay .modal .modal-header .close-button {
46
+ background: none;
47
+ border: none;
48
+ height: 25px;
49
+ font-size: 32px;
50
+ color: #cdcdcd;
51
+ background: none;
52
+ padding: 0px;
53
+ cursor: pointer;
54
+ margin: -10px 10px 0 0;
55
+ }
56
+
57
+ .modal-overlay .modal .modal-header .close-button:hover {
58
+ background: none;
59
+ color: #9c9c9c;
60
+ }
61
+
62
+ .modal-overlay .modal .modal-content {
63
+ display: block;
64
+ width: 100%;
65
+ padding: 10px 0;
66
+ /* max-height: calc(100vh - 80px); */
67
+ /* overflow-y: auto; */
68
+ }
69
+
70
+ .MyModalTagBody {
71
+ display: block;
72
+ width: 100%;
73
+ padding: 15px;
74
+ background: #fff;
75
+ border-radius: 15px;
76
+ }
77
+
78
+ .MyModalTagFooter {
79
+ display: flex;
80
+ justify-content: flex-end;
81
+ gap: 10px;
82
+ margin-top: 5px;
83
+ }
@@ -0,0 +1,71 @@
1
+ import React, { useEffect } from 'react';
2
+ import './MyModal.css'; // Modal için CSS dosyası
3
+
4
+ const MyModal = ({
5
+ show,
6
+ title,
7
+ children,
8
+ top = null,
9
+ onClose = null,
10
+ closeOnBackdropClick = true,
11
+ closeOnEsc = true,
12
+ style = null
13
+ }) => {
14
+ const arrChild = React.Children.toArray(children);
15
+ let childBody = null;
16
+ let childFooter = null;
17
+ for (let i = 0; i < arrChild.length; i++) {
18
+ const el = arrChild[i];
19
+ if (el.type.toString().includes("MyModalTagFooter")) {
20
+ childFooter = el;
21
+ } else if (el.type.toString().includes("MyModalTagBody")) {
22
+ childBody = el;
23
+ } else if (childBody == null) {
24
+ childBody = el;
25
+ }
26
+ }
27
+
28
+ // ESC tuşu ile kapatma işlevi
29
+ useEffect(() => {
30
+ if (!closeOnEsc) return;
31
+ const handleEsc = event => {
32
+ if (event.key === 'Escape') {
33
+ onClose();
34
+ }
35
+ };
36
+ window.addEventListener('keydown', handleEsc);
37
+ return () => {
38
+ window.removeEventListener('keydown', handleEsc);
39
+ };
40
+ }, [closeOnEsc, onClose]);
41
+ if (!show) {
42
+ return null;
43
+ }
44
+ const handleBackdropClick = e => {
45
+ if (closeOnBackdropClick && e.target.className.includes('modal-overlay')) {
46
+ onClose();
47
+ }
48
+ };
49
+ return /*#__PURE__*/React.createElement("div", {
50
+ className: 'modal-overlay ' + (top ? 'top' : ''),
51
+ onClick: handleBackdropClick,
52
+ style: {
53
+ paddingTop: top
54
+ }
55
+ }, /*#__PURE__*/React.createElement("div", {
56
+ className: "modal",
57
+ onClick: e => e.stopPropagation(),
58
+ style: style
59
+ }, /*#__PURE__*/React.createElement("div", {
60
+ className: "modal-header"
61
+ }, /*#__PURE__*/React.createElement("h4", null, title), onClose && /*#__PURE__*/React.createElement("button", {
62
+ type: "button",
63
+ className: "close-button",
64
+ onClick: onClose
65
+ }, "\xD7")), /*#__PURE__*/React.createElement("div", {
66
+ className: "modal-content"
67
+ }, childBody), /*#__PURE__*/React.createElement("div", {
68
+ className: "modal-footer"
69
+ }, childFooter)));
70
+ };
71
+ export default MyModal;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ function MyModalBody({
3
+ children
4
+ }) {
5
+ return /*#__PURE__*/React.createElement("div", {
6
+ className: "MyModalTagBody"
7
+ }, children);
8
+ }
9
+ export default MyModalBody;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ function MyModalFooter({
3
+ children
4
+ }) {
5
+ return /*#__PURE__*/React.createElement("div", {
6
+ className: "MyModalTagFooter"
7
+ }, children);
8
+ }
9
+ export default MyModalFooter;
@@ -0,0 +1,22 @@
1
+ .my-nodata{
2
+ display: flex;
3
+ flex-direction: column;
4
+ width: 100%;
5
+ justify-content: center;
6
+ align-items: center;
7
+ padding: 25px;
8
+ font-size: 17px;
9
+ color: #444;
10
+ }
11
+
12
+ .my-nodata .icon{
13
+ font-size: 42px;
14
+ color: #adadad;
15
+ margin-bottom: 10px;
16
+ }
17
+
18
+ .my-nodata span{
19
+ display: block;
20
+ width: 100%;
21
+ text-align: center;
22
+ }
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import './MyNotFound.css'; // Modal için CSS dosyası
3
+
4
+ export default function MyNotFound({
5
+ message = "Kayıt Mevcut Değil!",
6
+ className = null,
7
+ style = null,
8
+ icon = null
9
+ }) {
10
+ return /*#__PURE__*/React.createElement("div", {
11
+ className: "my-nodata " + (className ? className : ''),
12
+ style: style
13
+ }, icon && /*#__PURE__*/React.createElement("div", {
14
+ className: "icon"
15
+ }, icon), /*#__PURE__*/React.createElement("span", {
16
+ dangerouslySetInnerHTML: {
17
+ __html: message
18
+ }
19
+ }));
20
+ }
@@ -0,0 +1,74 @@
1
+ import React, { useState, useRef } from "react";
2
+ const MyScrollableCard = ({
3
+ children,
4
+ className
5
+ }) => {
6
+ const [isDragging, setIsDragging] = useState(false);
7
+ const [startX, setStartX] = useState(0);
8
+ const [startY, setStartY] = useState(0);
9
+ const [scrollLeft, setScrollLeft] = useState(0);
10
+ const [scrollTop, setScrollTop] = useState(0);
11
+ const [direction, setDirection] = useState(null); // Yatay mı dikey mi olduğuna karar verecek
12
+ const containerRef = useRef(null);
13
+ const handleMouseDown = e => {
14
+ setIsDragging(true);
15
+ setStartX(e.pageX - containerRef.current.offsetLeft);
16
+ setStartY(e.pageY - containerRef.current.offsetTop);
17
+ setScrollLeft(containerRef.current.scrollLeft);
18
+ setScrollTop(containerRef.current.scrollTop);
19
+ setDirection(null); // Fare basıldığı anda yönü sıfırla
20
+ };
21
+ const handleMouseMove = e => {
22
+ if (!isDragging) return;
23
+ e.preventDefault();
24
+ const x = e.pageX - containerRef.current.offsetLeft;
25
+ const y = e.pageY - containerRef.current.offsetTop;
26
+
27
+ // İlk hareket yönünü belirle
28
+ if (direction === null) {
29
+ const diffX = Math.abs(x - startX);
30
+ const diffY = Math.abs(y - startY);
31
+ if (diffX > diffY) {
32
+ setDirection("horizontal");
33
+ } else {
34
+ setDirection("vertical");
35
+ }
36
+ }
37
+ if (direction === "horizontal") {
38
+ const walkX = x - startX; // Hız faktörünü kaldırdım
39
+ containerRef.current.scrollLeft = scrollLeft - walkX; // Düz kaydırma
40
+ } else if (direction === "vertical") {
41
+ const walkY = y - startY;
42
+ containerRef.current.scrollTop = scrollTop - walkY;
43
+ }
44
+ };
45
+ const handleMouseUp = () => {
46
+ setIsDragging(false);
47
+ };
48
+ const handleWheel = e => {
49
+ e.preventDefault();
50
+ containerRef.current.scrollLeft += e.deltaY * 2; // Yatay tekerlek kaydırma
51
+
52
+ // Eğer dikey kaydırma isteniyorsa deltaX'i kullanabilirsiniz:
53
+ // containerRef.current.scrollTop += e.deltaY * 2;
54
+
55
+ // const deltaX = e.deltaX;
56
+ // const deltaY = e.deltaY;
57
+
58
+ // if (Math.abs(deltaX) > Math.abs(deltaY)) {
59
+ // containerRef.current.scrollLeft += deltaX * 2; // Yatay tekerlek kaydırma
60
+ // } else {
61
+ // containerRef.current.scrollTop += deltaY * 2; // Dikey tekerlek kaydırma
62
+ // }
63
+ };
64
+ return /*#__PURE__*/React.createElement("div", {
65
+ className: className,
66
+ onMouseDown: handleMouseDown,
67
+ onMouseMove: handleMouseMove,
68
+ onMouseLeave: handleMouseUp,
69
+ onMouseUp: handleMouseUp,
70
+ onWheel: handleWheel,
71
+ ref: containerRef
72
+ }, children);
73
+ };
74
+ export default MyScrollableCard;