px-react-ui-components 1.0.3 → 1.0.5
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/dist/components/MyAlert/MyAlert.js +19 -23
- package/dist/components/MyContainer/MyContainer.js +30 -41
- package/dist/components/MyContainer/MyContainerBody.js +6 -5
- package/dist/components/MyContainer/MyContainerFooter.js +6 -5
- package/dist/components/MyContainer/MyContainerRight.js +7 -6
- package/dist/components/MyEditor/MyEditor.js +72 -112
- package/dist/components/MyFileUpload/MyFileUpload.js +77 -121
- package/dist/components/MyImageCropper/MyImageCropper.js +41 -67
- package/dist/components/MyInput/MyInput.js +273 -419
- package/dist/components/MyInput/index.js +9 -8
- package/dist/components/MyMaps/YandexMaps.js +62 -95
- package/dist/components/MyMenu/MenuItem.js +35 -59
- package/dist/components/MyModal/MyModal.js +24 -31
- package/dist/components/MyModal/MyModalBody.js +6 -5
- package/dist/components/MyModal/MyModalFooter.js +6 -5
- package/dist/components/MyNotFound/MyNotFound.js +8 -11
- package/dist/components/MyScrollableCard/MyScrollableCard.js +25 -49
- package/dist/components/MyTable/MyTable.js +152 -227
- package/dist/components/MyTable/MyTableBody.js +6 -5
- package/dist/components/MyTable/MyTableHead.js +6 -5
- package/dist/components/MyTabs/MyTabPane.js +17 -27
- package/dist/components/MyTabs/MyTabs.js +21 -41
- package/dist/components/MyWaiting/MyWaiting.js +6 -7
- package/dist/components/MyZoomImage/MyZoomImage.js +32 -57
- package/dist/index.js +32 -32
- package/package.json +7 -10
|
@@ -1,49 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
8
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
11
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
setIsDragging = _useState2[1];
|
|
25
|
-
var _useState3 = (0, _react.useState)(0),
|
|
26
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
27
|
-
startX = _useState4[0],
|
|
28
|
-
setStartX = _useState4[1];
|
|
29
|
-
var _useState5 = (0, _react.useState)(0),
|
|
30
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
31
|
-
startY = _useState6[0],
|
|
32
|
-
setStartY = _useState6[1];
|
|
33
|
-
var _useState7 = (0, _react.useState)(0),
|
|
34
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
35
|
-
scrollLeft = _useState8[0],
|
|
36
|
-
setScrollLeft = _useState8[1];
|
|
37
|
-
var _useState9 = (0, _react.useState)(0),
|
|
38
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
39
|
-
scrollTop = _useState10[0],
|
|
40
|
-
setScrollTop = _useState10[1];
|
|
41
|
-
var _useState11 = (0, _react.useState)(null),
|
|
42
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
43
|
-
direction = _useState12[0],
|
|
44
|
-
setDirection = _useState12[1]; // Yatay mı dikey mi olduğuna karar verecek
|
|
45
|
-
var containerRef = (0, _react.useRef)(null);
|
|
46
|
-
var handleMouseDown = function handleMouseDown(e) {
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
+
const MyScrollableCard = ({
|
|
12
|
+
children,
|
|
13
|
+
className
|
|
14
|
+
}) => {
|
|
15
|
+
const [isDragging, setIsDragging] = (0, _react.useState)(false);
|
|
16
|
+
const [startX, setStartX] = (0, _react.useState)(0);
|
|
17
|
+
const [startY, setStartY] = (0, _react.useState)(0);
|
|
18
|
+
const [scrollLeft, setScrollLeft] = (0, _react.useState)(0);
|
|
19
|
+
const [scrollTop, setScrollTop] = (0, _react.useState)(0);
|
|
20
|
+
const [direction, setDirection] = (0, _react.useState)(null); // Yatay mı dikey mi olduğuna karar verecek
|
|
21
|
+
const containerRef = (0, _react.useRef)(null);
|
|
22
|
+
const handleMouseDown = e => {
|
|
47
23
|
setIsDragging(true);
|
|
48
24
|
setStartX(e.pageX - containerRef.current.offsetLeft);
|
|
49
25
|
setStartY(e.pageY - containerRef.current.offsetTop);
|
|
@@ -51,16 +27,16 @@ var MyScrollableCard = function MyScrollableCard(_ref) {
|
|
|
51
27
|
setScrollTop(containerRef.current.scrollTop);
|
|
52
28
|
setDirection(null); // Fare basıldığı anda yönü sıfırla
|
|
53
29
|
};
|
|
54
|
-
|
|
30
|
+
const handleMouseMove = e => {
|
|
55
31
|
if (!isDragging) return;
|
|
56
32
|
e.preventDefault();
|
|
57
|
-
|
|
58
|
-
|
|
33
|
+
const x = e.pageX - containerRef.current.offsetLeft;
|
|
34
|
+
const y = e.pageY - containerRef.current.offsetTop;
|
|
59
35
|
|
|
60
36
|
// İlk hareket yönünü belirle
|
|
61
37
|
if (direction === null) {
|
|
62
|
-
|
|
63
|
-
|
|
38
|
+
const diffX = Math.abs(x - startX);
|
|
39
|
+
const diffY = Math.abs(y - startY);
|
|
64
40
|
if (diffX > diffY) {
|
|
65
41
|
setDirection("horizontal");
|
|
66
42
|
} else {
|
|
@@ -68,17 +44,17 @@ var MyScrollableCard = function MyScrollableCard(_ref) {
|
|
|
68
44
|
}
|
|
69
45
|
}
|
|
70
46
|
if (direction === "horizontal") {
|
|
71
|
-
|
|
47
|
+
const walkX = x - startX; // Hız faktörünü kaldırdım
|
|
72
48
|
containerRef.current.scrollLeft = scrollLeft - walkX; // Düz kaydırma
|
|
73
49
|
} else if (direction === "vertical") {
|
|
74
|
-
|
|
50
|
+
const walkY = y - startY;
|
|
75
51
|
containerRef.current.scrollTop = scrollTop - walkY;
|
|
76
52
|
}
|
|
77
53
|
};
|
|
78
|
-
|
|
54
|
+
const handleMouseUp = () => {
|
|
79
55
|
setIsDragging(false);
|
|
80
56
|
};
|
|
81
|
-
|
|
57
|
+
const handleWheel = e => {
|
|
82
58
|
e.preventDefault();
|
|
83
59
|
containerRef.current.scrollLeft += e.deltaY * 2; // Yatay tekerlek kaydırma
|
|
84
60
|
|
|
@@ -105,4 +81,4 @@ var MyScrollableCard = function MyScrollableCard(_ref) {
|
|
|
105
81
|
children: children
|
|
106
82
|
});
|
|
107
83
|
};
|
|
108
|
-
var _default = exports
|
|
84
|
+
var _default = exports.default = MyScrollableCard;
|