px-react-ui-components 1.0.1 → 1.0.3
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 +34 -22
- package/dist/components/MyContainer/MyContainer.js +73 -46
- package/dist/components/MyContainer/MyContainerBody.js +16 -8
- package/dist/components/MyContainer/MyContainerFooter.js +16 -8
- package/dist/components/MyContainer/MyContainerRight.js +17 -9
- package/dist/components/MyEditor/MyEditor.js +160 -106
- package/dist/components/MyFileUpload/MyFileUpload.js +214 -140
- package/dist/components/MyImageCropper/MyImageCropper.js +92 -53
- package/dist/components/MyInput/MyInput.js +745 -548
- package/dist/components/MyInput/index.js +22 -0
- package/dist/components/MyMaps/YandexMaps.js +102 -61
- package/dist/components/MyMenu/MenuItem.js +96 -50
- package/dist/components/MyModal/MyModal.js +63 -39
- package/dist/components/MyModal/MyModalBody.js +16 -8
- package/dist/components/MyModal/MyModalFooter.js +16 -8
- package/dist/components/MyNotFound/MyNotFound.js +30 -17
- package/dist/components/MyScrollableCard/MyScrollableCard.js +60 -26
- package/dist/components/MyTable/MyTable.js +298 -189
- package/dist/components/MyTable/MyTableBody.js +16 -8
- package/dist/components/MyTable/MyTableHead.js +16 -8
- package/dist/components/MyTabs/MyTabPane.js +37 -16
- package/dist/components/MyTabs/MyTabs.js +88 -50
- package/dist/components/MyWaiting/MyWaiting.js +34 -22
- package/dist/components/MyZoomImage/MyZoomImage.js +143 -94
- package/dist/index.js +131 -15
- package/package.json +18 -4
- package/.babelrc +0 -3
- package/src/components/MyAlert/MyAlert.css +0 -113
- package/src/components/MyAlert/MyAlert.jsx +0 -96
- package/src/components/MyContainer/MyContainer.jsx +0 -90
- package/src/components/MyContainer/MyContainer.module.css +0 -110
- package/src/components/MyContainer/MyContainerBody.jsx +0 -8
- package/src/components/MyContainer/MyContainerFooter.jsx +0 -8
- package/src/components/MyContainer/MyContainerRight.jsx +0 -11
- package/src/components/MyEditor/MyEditor.jsx +0 -252
- package/src/components/MyEditor/MyEditor.scss +0 -277
- package/src/components/MyFileUpload/MyFileUpload.jsx +0 -371
- package/src/components/MyFileUpload/MyFileUpload.module.css +0 -86
- package/src/components/MyImageCropper/MyImageCropper.jsx +0 -108
- package/src/components/MyInput/MyInput.jsx +0 -895
- package/src/components/MyInput/MyInput.module.css +0 -420
- package/src/components/MyMaps/YandexMaps.jsx +0 -186
- package/src/components/MyMenu/MenuItem.jsx +0 -62
- package/src/components/MyMenu/MyMenu.module.css +0 -102
- package/src/components/MyModal/MyModal.css +0 -83
- package/src/components/MyModal/MyModal.jsx +0 -78
- package/src/components/MyModal/MyModalBody.jsx +0 -8
- package/src/components/MyModal/MyModalFooter.jsx +0 -8
- package/src/components/MyNotFound/MyNotFound.css +0 -22
- package/src/components/MyNotFound/MyNotFound.jsx +0 -11
- package/src/components/MyScrollableCard/MyScrollableCard.jsx +0 -86
- package/src/components/MyTable/MyTable.jsx +0 -459
- package/src/components/MyTable/MyTable.module.css +0 -350
- package/src/components/MyTable/MyTableBody.jsx +0 -8
- package/src/components/MyTable/MyTableHead.jsx +0 -10
- package/src/components/MyTabs/MyTabPane.jsx +0 -9
- package/src/components/MyTabs/MyTabs.css +0 -105
- package/src/components/MyTabs/MyTabs.jsx +0 -63
- package/src/components/MyWaiting/MyWaiting.css +0 -28
- package/src/components/MyWaiting/MyWaiting.jsx +0 -27
- package/src/components/MyZoomImage/MyZoomImage.css +0 -0
- package/src/components/MyZoomImage/MyZoomImage.jsx +0 -139
- package/src/index.js +0 -15
|
@@ -1,9 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
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
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = exports.MyInputType = exports.MyInputIsNumeric = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _MyInputModule = _interopRequireDefault(require("./MyInput.module.css"));
|
|
10
|
+
var _pi = require("react-icons/pi");
|
|
11
|
+
var _md = require("react-icons/md");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
15
|
+
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; }
|
|
16
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
19
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
20
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
21
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
22
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
23
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
24
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
25
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
26
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
27
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
28
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
29
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
30
|
+
var MyInputType = exports.MyInputType = Object.freeze({
|
|
7
31
|
TEXT: 'text',
|
|
8
32
|
PASSWORD: 'password',
|
|
9
33
|
SELECT: 'select',
|
|
@@ -21,85 +45,148 @@ export const MyInputType = Object.freeze({
|
|
|
21
45
|
MAIL: 'mail',
|
|
22
46
|
PHONE: 'phone'
|
|
23
47
|
});
|
|
24
|
-
|
|
48
|
+
var MyInputIsNumeric = exports.MyInputIsNumeric = function MyInputIsNumeric(value) {
|
|
25
49
|
if (value === null || value === undefined || value === '') return false;
|
|
26
50
|
return !isNaN(value) && !isNaN(parseFloat(value));
|
|
27
51
|
};
|
|
28
|
-
function MyInput({
|
|
29
|
-
id =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
52
|
+
function MyInput(_ref) {
|
|
53
|
+
var _ref$id = _ref.id,
|
|
54
|
+
id = _ref$id === void 0 ? null : _ref$id,
|
|
55
|
+
_ref$ref = _ref.ref,
|
|
56
|
+
ref = _ref$ref === void 0 ? null : _ref$ref,
|
|
57
|
+
_ref$title = _ref.title,
|
|
58
|
+
title = _ref$title === void 0 ? "" : _ref$title,
|
|
59
|
+
_ref$placeholder = _ref.placeholder,
|
|
60
|
+
placeholder = _ref$placeholder === void 0 ? "" : _ref$placeholder,
|
|
61
|
+
_ref$placeholdersearc = _ref.placeholdersearchtext,
|
|
62
|
+
placeholdersearchtext = _ref$placeholdersearc === void 0 ? "" : _ref$placeholdersearc,
|
|
63
|
+
_ref$description = _ref.description,
|
|
64
|
+
description = _ref$description === void 0 ? null : _ref$description,
|
|
65
|
+
_ref$type = _ref.type,
|
|
66
|
+
type = _ref$type === void 0 ? MyInputType.TEXT : _ref$type,
|
|
67
|
+
_ref$className = _ref.className,
|
|
68
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
69
|
+
_ref$rows = _ref.rows,
|
|
70
|
+
rows = _ref$rows === void 0 ? 0 : _ref$rows,
|
|
71
|
+
_ref$icon = _ref.icon,
|
|
72
|
+
icon = _ref$icon === void 0 ? null : _ref$icon,
|
|
73
|
+
_ref$options = _ref.options,
|
|
74
|
+
options = _ref$options === void 0 ? null : _ref$options,
|
|
75
|
+
_ref$options_key_valu = _ref.options_key_value,
|
|
76
|
+
options_key_value = _ref$options_key_valu === void 0 ? "value" : _ref$options_key_valu,
|
|
77
|
+
_ref$options_key_text = _ref.options_key_text,
|
|
78
|
+
options_key_text = _ref$options_key_text === void 0 ? "text" : _ref$options_key_text,
|
|
79
|
+
_ref$options_key_subt = _ref.options_key_subtext,
|
|
80
|
+
options_key_subtext = _ref$options_key_subt === void 0 ? "subtext" : _ref$options_key_subt,
|
|
81
|
+
_ref$multiple = _ref.multiple,
|
|
82
|
+
multiple = _ref$multiple === void 0 ? false : _ref$multiple,
|
|
83
|
+
_ref$disabled = _ref.disabled,
|
|
84
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
85
|
+
_ref$value = _ref.value,
|
|
86
|
+
value = _ref$value === void 0 ? null : _ref$value,
|
|
87
|
+
_ref$decimalCount = _ref.decimalCount,
|
|
88
|
+
decimalCount = _ref$decimalCount === void 0 ? 2 : _ref$decimalCount,
|
|
89
|
+
_ref$buttonText = _ref.buttonText,
|
|
90
|
+
buttonText = _ref$buttonText === void 0 ? "" : _ref$buttonText,
|
|
91
|
+
_ref$accept = _ref.accept,
|
|
92
|
+
accept = _ref$accept === void 0 ? ".jpg,.jpeg,.png" : _ref$accept,
|
|
93
|
+
_ref$minDate = _ref.minDate,
|
|
94
|
+
minDate = _ref$minDate === void 0 ? null : _ref$minDate,
|
|
95
|
+
_ref$maxDate = _ref.maxDate,
|
|
96
|
+
maxDate = _ref$maxDate === void 0 ? null : _ref$maxDate,
|
|
97
|
+
_ref$style = _ref.style,
|
|
98
|
+
style = _ref$style === void 0 ? null : _ref$style,
|
|
99
|
+
_ref$maxlength = _ref.maxlength,
|
|
100
|
+
maxlength = _ref$maxlength === void 0 ? null : _ref$maxlength,
|
|
101
|
+
_ref$dangerouslySetIn = _ref.dangerouslySetInnerHTML,
|
|
102
|
+
dangerouslySetInnerHTML = _ref$dangerouslySetIn === void 0 ? null : _ref$dangerouslySetIn,
|
|
103
|
+
_ref$uppercase = _ref.uppercase,
|
|
104
|
+
uppercase = _ref$uppercase === void 0 ? false : _ref$uppercase,
|
|
105
|
+
_ref$lowercase = _ref.lowercase,
|
|
106
|
+
lowercase = _ref$lowercase === void 0 ? false : _ref$lowercase,
|
|
107
|
+
_ref$firstUppercase = _ref.firstUppercase,
|
|
108
|
+
firstUppercase = _ref$firstUppercase === void 0 ? false : _ref$firstUppercase,
|
|
109
|
+
_ref$onChange = _ref.onChange,
|
|
110
|
+
onChange = _ref$onChange === void 0 ? null : _ref$onChange,
|
|
111
|
+
_ref$onBlur = _ref.onBlur,
|
|
112
|
+
onBlur = _ref$onBlur === void 0 ? null : _ref$onBlur,
|
|
113
|
+
_ref$onFocus = _ref.onFocus,
|
|
114
|
+
onFocus = _ref$onFocus === void 0 ? null : _ref$onFocus,
|
|
115
|
+
_ref$onKeyDown = _ref.onKeyDown,
|
|
116
|
+
onKeyDown = _ref$onKeyDown === void 0 ? null : _ref$onKeyDown,
|
|
117
|
+
_ref$onKeyUp = _ref.onKeyUp,
|
|
118
|
+
onKeyUp = _ref$onKeyUp === void 0 ? null : _ref$onKeyUp,
|
|
119
|
+
_ref$onKeyPress = _ref.onKeyPress,
|
|
120
|
+
onKeyPress = _ref$onKeyPress === void 0 ? null : _ref$onKeyPress,
|
|
121
|
+
_ref$onMouseDown = _ref.onMouseDown,
|
|
122
|
+
onMouseDown = _ref$onMouseDown === void 0 ? null : _ref$onMouseDown,
|
|
123
|
+
_ref$onMouseUp = _ref.onMouseUp,
|
|
124
|
+
onMouseUp = _ref$onMouseUp === void 0 ? null : _ref$onMouseUp,
|
|
125
|
+
_ref$onMouseEnter = _ref.onMouseEnter,
|
|
126
|
+
onMouseEnter = _ref$onMouseEnter === void 0 ? null : _ref$onMouseEnter,
|
|
127
|
+
_ref$onMouseLeave = _ref.onMouseLeave,
|
|
128
|
+
onMouseLeave = _ref$onMouseLeave === void 0 ? null : _ref$onMouseLeave,
|
|
129
|
+
_ref$onRemoveImage = _ref.onRemoveImage,
|
|
130
|
+
onRemoveImage = _ref$onRemoveImage === void 0 ? null : _ref$onRemoveImage;
|
|
131
|
+
var myInputId = "key".concat(Date.now() + Math.random().toString(36).substr(2, 9));
|
|
132
|
+
var fileInputRef = (0, _react.useRef)(null);
|
|
133
|
+
var _useState = (0, _react.useState)(false),
|
|
134
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
135
|
+
loaded = _useState2[0],
|
|
136
|
+
setLoaded = _useState2[1];
|
|
137
|
+
var _useState3 = (0, _react.useState)(value),
|
|
138
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
139
|
+
myValue = _useState4[0],
|
|
140
|
+
setMyValue = _useState4[1];
|
|
141
|
+
var _useState5 = (0, _react.useState)(false),
|
|
142
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
143
|
+
myEyeView = _useState6[0],
|
|
144
|
+
setMyEyeView = _useState6[1];
|
|
145
|
+
var _useState7 = (0, _react.useState)(null),
|
|
146
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
147
|
+
myFileName = _useState8[0],
|
|
148
|
+
setMyFileName = _useState8[1];
|
|
149
|
+
var _useState9 = (0, _react.useState)(""),
|
|
150
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
151
|
+
myTitleLite = _useState10[0],
|
|
152
|
+
setMyTitleLite = _useState10[1];
|
|
153
|
+
var _useState11 = (0, _react.useState)(""),
|
|
154
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
155
|
+
filtertext = _useState12[0],
|
|
156
|
+
setFiltertext = _useState12[1];
|
|
157
|
+
var _useState13 = (0, _react.useState)(false),
|
|
158
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
159
|
+
isError = _useState14[0],
|
|
160
|
+
setIsError = _useState14[1];
|
|
161
|
+
var toBase64 = function toBase64(file) {
|
|
162
|
+
return new Promise(function (resolve, reject) {
|
|
163
|
+
var reader = new FileReader();
|
|
164
|
+
reader.readAsDataURL(file);
|
|
165
|
+
reader.onload = function () {
|
|
166
|
+
return resolve(reader.result);
|
|
167
|
+
};
|
|
168
|
+
reader.onerror = reject;
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
var calculateFileSize = function calculateFileSize(sizeInBytes) {
|
|
172
|
+
var units = ['B', 'KB', 'MB'];
|
|
173
|
+
var size = sizeInBytes;
|
|
174
|
+
var unitIndex = 0;
|
|
88
175
|
while (size >= 1024 && unitIndex < units.length - 1) {
|
|
89
176
|
size /= 1024;
|
|
90
177
|
unitIndex++;
|
|
91
178
|
}
|
|
92
|
-
return
|
|
179
|
+
return "".concat(size.toFixed(2), " ").concat(units[unitIndex]);
|
|
93
180
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
181
|
+
var moneyFormat = function moneyFormat(_value) {
|
|
182
|
+
var money = '';
|
|
183
|
+
var inputValue = _value;
|
|
97
184
|
if (inputValue == null || inputValue == undefined || inputValue == '') return money;
|
|
98
185
|
try {
|
|
99
186
|
inputValue = inputValue.toString();
|
|
100
187
|
// Tüm virgülleri kaldır ve son girilen karakteri kontrol et
|
|
101
188
|
money = inputValue.replace(/,/g, '');
|
|
102
|
-
|
|
189
|
+
var lastChar = inputValue.slice(-1);
|
|
103
190
|
if (lastChar === ',') {
|
|
104
191
|
money = money + '.';
|
|
105
192
|
}
|
|
@@ -108,7 +195,7 @@ function MyInput({
|
|
|
108
195
|
money = money.replace(/[^0-9.]/g, '');
|
|
109
196
|
|
|
110
197
|
// Birden fazla nokta varsa ilkini koru
|
|
111
|
-
|
|
198
|
+
var parts = money.split('.');
|
|
112
199
|
if (parts.length > 2) {
|
|
113
200
|
money = parts[0] + '.' + parts[1];
|
|
114
201
|
}
|
|
@@ -120,14 +207,14 @@ function MyInput({
|
|
|
120
207
|
|
|
121
208
|
// Binlik ayracı için formatlama
|
|
122
209
|
if (money) {
|
|
123
|
-
|
|
124
|
-
if (
|
|
210
|
+
var _numParts = money.split('.');
|
|
211
|
+
if (_numParts[0]) {
|
|
125
212
|
// Sayıyı önce tam sayıya çevir, sonra binlik ayracı ekle
|
|
126
|
-
|
|
213
|
+
_numParts[0] = parseInt(_numParts[0], 10).toLocaleString('en-US');
|
|
127
214
|
}
|
|
128
|
-
money =
|
|
215
|
+
money = _numParts.join('.');
|
|
129
216
|
}
|
|
130
|
-
|
|
217
|
+
var numParts = money.split('.');
|
|
131
218
|
if (numParts[0]) {
|
|
132
219
|
numParts[0] = numParts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
133
220
|
}
|
|
@@ -139,7 +226,7 @@ function MyInput({
|
|
|
139
226
|
}
|
|
140
227
|
return money;
|
|
141
228
|
};
|
|
142
|
-
|
|
229
|
+
var onMyBlur = function onMyBlur(e) {
|
|
143
230
|
setIsError(false);
|
|
144
231
|
if (myValue != null && myValue != "") {
|
|
145
232
|
switch (type) {
|
|
@@ -159,111 +246,147 @@ function MyInput({
|
|
|
159
246
|
}
|
|
160
247
|
if (onBlur != null) onBlur(e);
|
|
161
248
|
};
|
|
162
|
-
|
|
249
|
+
var onMyFocus = function onMyFocus(e) {
|
|
163
250
|
if (onFocus != null) onFocus(e);
|
|
164
251
|
};
|
|
165
|
-
|
|
252
|
+
var onMyKeyDown = function onMyKeyDown(e) {
|
|
166
253
|
if (onKeyDown != null) onKeyDown(e);
|
|
167
254
|
};
|
|
168
|
-
|
|
255
|
+
var onMyKeyUp = function onMyKeyUp(e) {
|
|
169
256
|
if (onKeyUp != null) onKeyUp(e);
|
|
170
257
|
};
|
|
171
|
-
|
|
258
|
+
var onMyKeyPress = function onMyKeyPress(e) {
|
|
172
259
|
if (onKeyPress != null) onKeyPress(e);
|
|
173
260
|
};
|
|
174
|
-
|
|
261
|
+
var onMyMouseDown = function onMyMouseDown(e) {
|
|
175
262
|
if (onMouseDown != null) onMouseDown(e);
|
|
176
263
|
};
|
|
177
|
-
|
|
264
|
+
var onMyMouseUp = function onMyMouseUp(e) {
|
|
178
265
|
if (onMouseUp != null) onMouseUp(e);
|
|
179
266
|
};
|
|
180
|
-
|
|
267
|
+
var onMyMouseEnter = function onMyMouseEnter(e) {
|
|
181
268
|
if (onMouseEnter != null) onMouseEnter(e);
|
|
182
269
|
};
|
|
183
|
-
|
|
270
|
+
var onMyMouseLeave = function onMyMouseLeave(e) {
|
|
184
271
|
if (onMouseLeave != null) onMouseLeave(e);
|
|
185
272
|
};
|
|
186
|
-
|
|
273
|
+
var onRemoveImageClick = function onRemoveImageClick(e) {
|
|
187
274
|
if (onRemoveImage != null) onRemoveImage();
|
|
188
275
|
};
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
276
|
+
var onMyChange = /*#__PURE__*/function () {
|
|
277
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
|
|
278
|
+
var files, totalSize, i, file, number, numberParts, money, selectedDate;
|
|
279
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
280
|
+
while (1) switch (_context.prev = _context.next) {
|
|
281
|
+
case 0:
|
|
282
|
+
_context.t0 = type;
|
|
283
|
+
_context.next = _context.t0 === MyInputType.FILE ? 3 : _context.t0 === MyInputType.IMAGE ? 3 : _context.t0 === MyInputType.NUMBER ? 29 : _context.t0 === MyInputType.MONEY ? 34 : _context.t0 === MyInputType.DATE ? 37 : _context.t0 === MyInputType.DATETIME ? 37 : _context.t0 === MyInputType.TIME ? 37 : 40;
|
|
284
|
+
break;
|
|
285
|
+
case 3:
|
|
286
|
+
files = [];
|
|
287
|
+
if (!(e.target.files.length > 0)) {
|
|
288
|
+
_context.next = 26;
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
totalSize = 0;
|
|
292
|
+
i = 0;
|
|
293
|
+
case 7:
|
|
294
|
+
if (!(i < e.target.files.length)) {
|
|
295
|
+
_context.next = 22;
|
|
296
|
+
break;
|
|
297
|
+
}
|
|
298
|
+
file = e.target.files[i];
|
|
198
299
|
totalSize += parseInt(file.size);
|
|
199
|
-
files
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
300
|
+
_context.t1 = files;
|
|
301
|
+
_context.next = 13;
|
|
302
|
+
return toBase64(file);
|
|
303
|
+
case 13:
|
|
304
|
+
_context.t2 = _context.sent;
|
|
305
|
+
_context.t3 = file.name;
|
|
306
|
+
_context.t4 = file.size;
|
|
307
|
+
_context.t5 = calculateFileSize(file.size);
|
|
308
|
+
_context.t6 = {
|
|
309
|
+
base64: _context.t2,
|
|
310
|
+
filename: _context.t3,
|
|
311
|
+
size: _context.t4,
|
|
312
|
+
sizeText: _context.t5
|
|
313
|
+
};
|
|
314
|
+
_context.t1.push.call(_context.t1, _context.t6);
|
|
315
|
+
case 19:
|
|
316
|
+
i++;
|
|
317
|
+
_context.next = 7;
|
|
318
|
+
break;
|
|
319
|
+
case 22:
|
|
320
|
+
//for
|
|
218
321
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
322
|
+
totalSize = calculateFileSize(totalSize);
|
|
323
|
+
setMyFileName("<span>".concat(files.length == 1 ? files[0].filename : files.length + " Dosya Seçildi", "</span>\n <small>(").concat(totalSize, ")</small>"));
|
|
324
|
+
_context.next = 27;
|
|
325
|
+
break;
|
|
326
|
+
case 26:
|
|
327
|
+
setMyFileName("");
|
|
328
|
+
case 27:
|
|
329
|
+
setMyValue(files);
|
|
330
|
+
return _context.abrupt("break", 42);
|
|
331
|
+
case 29:
|
|
332
|
+
number = e.target.value.replace(/[^0-9.]/g, ''); // Birden fazla nokta varsa ilkini koru
|
|
333
|
+
numberParts = number.split('.');
|
|
334
|
+
if (numberParts.length > 2) {
|
|
335
|
+
number = numberParts[0] + '.' + numberParts[1];
|
|
336
|
+
}
|
|
337
|
+
setMyValue(number);
|
|
338
|
+
return _context.abrupt("break", 42);
|
|
339
|
+
case 34:
|
|
340
|
+
money = moneyFormat(e.target.value);
|
|
341
|
+
setMyValue(money);
|
|
342
|
+
return _context.abrupt("break", 42);
|
|
343
|
+
case 37:
|
|
344
|
+
selectedDate = e.target.value;
|
|
345
|
+
setMyValue(selectedDate);
|
|
346
|
+
return _context.abrupt("break", 42);
|
|
347
|
+
case 40:
|
|
348
|
+
if (uppercase) setMyValue(e.target.value.toLocaleUpperCase("TR"));else if (lowercase) setMyValue(e.target.value.toLocaleLowerCase("TR"));else if (firstUppercase) setMyValue(e.target.value.split(' ').map(function (word) {
|
|
349
|
+
return word.charAt(0).toLocaleUpperCase("TR") + word.slice(1).toLocaleLowerCase("TR");
|
|
350
|
+
}).join(' '));else setMyValue(e.target.value);
|
|
351
|
+
return _context.abrupt("break", 42);
|
|
352
|
+
case 42:
|
|
353
|
+
case "end":
|
|
354
|
+
return _context.stop();
|
|
223
355
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
case MyInputType.TIME:
|
|
233
|
-
const selectedDate = e.target.value;
|
|
234
|
-
setMyValue(selectedDate);
|
|
235
|
-
break;
|
|
236
|
-
default:
|
|
237
|
-
if (uppercase) setMyValue(e.target.value.toLocaleUpperCase("TR"));else if (lowercase) setMyValue(e.target.value.toLocaleLowerCase("TR"));else if (firstUppercase) setMyValue(e.target.value.split(' ').map(word => word.charAt(0).toLocaleUpperCase("TR") + word.slice(1).toLocaleLowerCase("TR")).join(' '));else setMyValue(e.target.value);
|
|
238
|
-
break;
|
|
239
|
-
}
|
|
240
|
-
};
|
|
241
|
-
const mySelectFilterListClick = item => {
|
|
242
|
-
const selectElement = document.getElementById("mySelectFilterHiddenSelect" + myInputId);
|
|
356
|
+
}, _callee);
|
|
357
|
+
}));
|
|
358
|
+
return function onMyChange(_x) {
|
|
359
|
+
return _ref2.apply(this, arguments);
|
|
360
|
+
};
|
|
361
|
+
}();
|
|
362
|
+
var mySelectFilterListClick = function mySelectFilterListClick(item) {
|
|
363
|
+
var selectElement = document.getElementById("mySelectFilterHiddenSelect" + myInputId);
|
|
243
364
|
selectElement.value = item.value;
|
|
244
365
|
setMyValue(item.value);
|
|
245
366
|
setFiltertext("");
|
|
246
367
|
};
|
|
247
|
-
|
|
368
|
+
var getMyValueText = function getMyValueText() {
|
|
248
369
|
if (!myValue || myValue == 0) return "";
|
|
249
370
|
if (!MyInputIsNumeric(myValue) || options == null) return myValue;
|
|
250
|
-
|
|
251
|
-
|
|
371
|
+
var result = options.find(function (e) {
|
|
372
|
+
return e.value.toString() == myValue.toString();
|
|
373
|
+
});
|
|
374
|
+
if (result) return result.text + (result[options_key_subtext] ? " - <span style=\"color: #73889d; font-style: italic; font-weight: 300;\">".concat(result[options_key_subtext], "</span>") : '');
|
|
252
375
|
return "";
|
|
253
376
|
};
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
377
|
+
var filterSelectEvents = function filterSelectEvents() {
|
|
378
|
+
var selectElement = document.getElementById("mySelectFilterSelected" + (id ? id : myInputId));
|
|
379
|
+
var selectListElement = document.getElementById("mySelectFilterList" + (id ? id : myInputId));
|
|
380
|
+
var filterInput = document.getElementById("mySelectFilterInput" + (id ? id : myInputId));
|
|
258
381
|
if (!selectElement || !selectListElement || !filterInput) return;
|
|
259
|
-
|
|
382
|
+
var isInputFocused = false;
|
|
260
383
|
|
|
261
384
|
// Select'e tıklandığında seçim listesini aç
|
|
262
385
|
selectElement.addEventListener('click', function () {
|
|
263
386
|
if (!isInputFocused) {
|
|
264
387
|
filterInput.style.display = 'block';
|
|
265
388
|
selectListElement.style.display = 'block';
|
|
266
|
-
setTimeout(()
|
|
389
|
+
setTimeout(function () {
|
|
267
390
|
filterInput.focus();
|
|
268
391
|
}, 100); // Gecikme, select listesi açılırken input'a odaklanması için
|
|
269
392
|
}
|
|
@@ -277,36 +400,42 @@ function MyInput({
|
|
|
277
400
|
// Input odaktan çıktığında ve select'in blur olayında input'u gizle
|
|
278
401
|
filterInput.addEventListener('blur', function () {
|
|
279
402
|
isInputFocused = false;
|
|
280
|
-
setTimeout(()
|
|
403
|
+
setTimeout(function () {
|
|
281
404
|
setFiltertext("");
|
|
282
405
|
filterInput.style.display = 'none';
|
|
283
406
|
selectListElement.style.display = 'none';
|
|
284
407
|
}, 150); // Gecikme ile select kapanmasını sağla
|
|
285
408
|
});
|
|
286
409
|
};
|
|
287
|
-
|
|
288
|
-
|
|
410
|
+
var getFilterOptions = function getFilterOptions() {
|
|
411
|
+
var rv = options.filter(function () {
|
|
412
|
+
return true;
|
|
413
|
+
});
|
|
289
414
|
if (filtertext != "") {
|
|
290
|
-
rv = rv.filter(
|
|
415
|
+
rv = rv.filter(function (e) {
|
|
416
|
+
return e.text.toLocaleLowerCase().includes(filtertext.toLocaleLowerCase());
|
|
417
|
+
});
|
|
291
418
|
}
|
|
292
419
|
return rv;
|
|
293
420
|
};
|
|
294
|
-
|
|
421
|
+
var getFileImageControl = function getFileImageControl(filename) {
|
|
295
422
|
if (!filename) return false;
|
|
296
423
|
if (filename.includes(";base64,")) return true;
|
|
297
|
-
|
|
298
|
-
return validExtensions.some(
|
|
424
|
+
var validExtensions = ['.jpg', '.jpeg', '.png', '.webp', '.gif'];
|
|
425
|
+
return validExtensions.some(function (ext) {
|
|
426
|
+
return filename.toString().toLocaleLowerCase().includes(ext);
|
|
427
|
+
});
|
|
299
428
|
};
|
|
300
|
-
useEffect(()
|
|
429
|
+
(0, _react.useEffect)(function () {
|
|
301
430
|
if (loaded) {
|
|
302
|
-
|
|
431
|
+
var vl = value;
|
|
303
432
|
if (value == undefined) vl = null;
|
|
304
433
|
if (vl == null && (type == MyInputType.TEXT || type == MyInputType.MAIL || type == MyInputType.TEXTAREA || type == MyInputType.PASSWORD)) vl = "";
|
|
305
434
|
// if (vl != myValue) setMyValue(vl);
|
|
306
435
|
if (vl == null) setMyFileName(null);
|
|
307
436
|
}
|
|
308
437
|
}, [value]);
|
|
309
|
-
useEffect(()
|
|
438
|
+
(0, _react.useEffect)(function () {
|
|
310
439
|
if (myValue != value && onChange != null) {
|
|
311
440
|
onChange({
|
|
312
441
|
value: myValue,
|
|
@@ -316,263 +445,297 @@ function MyInput({
|
|
|
316
445
|
});
|
|
317
446
|
}
|
|
318
447
|
}, [myValue]);
|
|
319
|
-
useEffect(()
|
|
448
|
+
(0, _react.useEffect)(function () {
|
|
320
449
|
if (title) {
|
|
321
450
|
setMyTitleLite(title.replace(/<\/?[^>]+(>|$)/g, ""));
|
|
322
451
|
}
|
|
323
452
|
}, [title]);
|
|
324
|
-
useEffect(()
|
|
453
|
+
(0, _react.useEffect)(function () {
|
|
325
454
|
setLoaded(true);
|
|
326
455
|
if (type == MyInputType.SELECTFILTER) filterSelectEvents();
|
|
327
456
|
if (type == MyInputType.DATE) {
|
|
328
|
-
|
|
329
|
-
dateInput.addEventListener('click', ()
|
|
457
|
+
var dateInput = document.getElementById("myDate" + myInputId);
|
|
458
|
+
dateInput.addEventListener('click', function () {
|
|
459
|
+
var _dateInput$showPicker;
|
|
330
460
|
// Tarih seçiciyi göstermek için odaklanma
|
|
331
|
-
dateInput.showPicker
|
|
461
|
+
(_dateInput$showPicker = dateInput.showPicker) === null || _dateInput$showPicker === void 0 || _dateInput$showPicker.call(dateInput); // Eğer destekliyorsa
|
|
332
462
|
});
|
|
333
463
|
}
|
|
334
464
|
if (type == MyInputType.DATETIME) {
|
|
335
|
-
|
|
336
|
-
dateTimeInput.addEventListener('click', ()
|
|
465
|
+
var dateTimeInput = document.getElementById("myDateTime" + myInputId);
|
|
466
|
+
dateTimeInput.addEventListener('click', function () {
|
|
467
|
+
var _dateTimeInput$showPi;
|
|
337
468
|
// Tarih seçiciyi göstermek için odaklanma
|
|
338
|
-
dateTimeInput.showPicker
|
|
469
|
+
(_dateTimeInput$showPi = dateTimeInput.showPicker) === null || _dateTimeInput$showPi === void 0 || _dateTimeInput$showPi.call(dateTimeInput); // Eğer destekliyorsa
|
|
339
470
|
});
|
|
340
471
|
}
|
|
341
472
|
if (type == MyInputType.TIME) {
|
|
342
|
-
|
|
343
|
-
timeInput.addEventListener('click', ()
|
|
473
|
+
var timeInput = document.getElementById("myTime" + myInputId);
|
|
474
|
+
timeInput.addEventListener('click', function () {
|
|
475
|
+
var _timeInput$showPicker;
|
|
344
476
|
// Saat seçiciyi göstermek için odaklanma
|
|
345
|
-
timeInput.showPicker
|
|
477
|
+
(_timeInput$showPicker = timeInput.showPicker) === null || _timeInput$showPicker === void 0 || _timeInput$showPicker.call(timeInput); // Eğer destekliyorsa
|
|
346
478
|
});
|
|
347
479
|
}
|
|
348
480
|
}, []);
|
|
349
|
-
|
|
481
|
+
var renderInput = function renderInput() {
|
|
482
|
+
var _inputTypes, _inputTypes$type;
|
|
350
483
|
if (disabled || type === MyInputType.READONLY) {
|
|
351
|
-
return /*#__PURE__*/
|
|
352
|
-
className:
|
|
484
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
485
|
+
className: _MyInputModule["default"].disabledInput,
|
|
353
486
|
dangerouslySetInnerHTML: dangerouslySetInnerHTML ? dangerouslySetInnerHTML : {
|
|
354
487
|
__html: getMyValueText()
|
|
355
488
|
},
|
|
356
|
-
style: rows > 0 ? {
|
|
357
|
-
...(style ? style : {}),
|
|
489
|
+
style: rows > 0 ? _objectSpread(_objectSpread({}, style ? style : {}), {}, {
|
|
358
490
|
height: rows * 30 + 'px',
|
|
359
491
|
alignItems: "flex-start"
|
|
360
|
-
} : style
|
|
492
|
+
}) : style
|
|
361
493
|
});
|
|
362
494
|
}
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
})
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
495
|
+
var inputTypes = (_inputTypes = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_inputTypes, MyInputType.TEXT, function () {
|
|
496
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
497
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
498
|
+
ref: ref,
|
|
499
|
+
id: id,
|
|
500
|
+
type: "text",
|
|
501
|
+
value: myValue,
|
|
502
|
+
onChange: onMyChange,
|
|
503
|
+
placeholder: placeholder || myTitleLite,
|
|
504
|
+
autoComplete: "off",
|
|
505
|
+
style: style,
|
|
506
|
+
maxLength: maxlength,
|
|
507
|
+
onBlur: onMyBlur,
|
|
508
|
+
onFocus: onMyFocus,
|
|
509
|
+
onKeyDown: onMyKeyDown,
|
|
510
|
+
onKeyUp: onMyKeyUp,
|
|
511
|
+
onKeyPress: onMyKeyPress,
|
|
512
|
+
onMouseDown: onMyMouseDown,
|
|
513
|
+
onMouseUp: onMyMouseUp,
|
|
514
|
+
onMouseEnter: onMyMouseEnter,
|
|
515
|
+
onMouseLeave: onMyMouseLeave
|
|
516
|
+
})
|
|
517
|
+
});
|
|
518
|
+
}), MyInputType.MAIL, function () {
|
|
519
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
520
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
521
|
+
ref: ref,
|
|
522
|
+
id: id,
|
|
523
|
+
type: "text",
|
|
524
|
+
value: myValue === null || myValue === void 0 ? void 0 : myValue.toLowerCase(),
|
|
525
|
+
onChange: function onChange(e) {
|
|
526
|
+
return onMyChange(_objectSpread(_objectSpread({}, e), {}, {
|
|
527
|
+
target: _objectSpread(_objectSpread({}, e.target), {}, {
|
|
528
|
+
value: e.target.value.toLowerCase().replace(/\s/g, '')
|
|
529
|
+
})
|
|
530
|
+
}));
|
|
531
|
+
},
|
|
532
|
+
placeholder: placeholder || myTitleLite,
|
|
533
|
+
autoComplete: "off",
|
|
534
|
+
style: style,
|
|
535
|
+
onBlur: onMyBlur,
|
|
536
|
+
onFocus: onMyFocus,
|
|
537
|
+
onKeyDown: onMyKeyDown,
|
|
538
|
+
onKeyUp: onMyKeyUp,
|
|
539
|
+
onKeyPress: onMyKeyPress,
|
|
540
|
+
onMouseDown: onMyMouseDown,
|
|
541
|
+
onMouseUp: onMyMouseUp,
|
|
542
|
+
onMouseEnter: onMyMouseEnter,
|
|
543
|
+
onMouseLeave: onMyMouseLeave
|
|
544
|
+
})
|
|
545
|
+
});
|
|
546
|
+
}), MyInputType.PHONE, function () {
|
|
547
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
548
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
549
|
+
ref: ref,
|
|
550
|
+
id: id,
|
|
551
|
+
type: "text",
|
|
552
|
+
value: myValue,
|
|
553
|
+
onChange: function onChange(e) {
|
|
554
|
+
var value = e.target.value.replace(/[^0-9()-]/g, '');
|
|
555
|
+
onMyChange(_objectSpread(_objectSpread({}, e), {}, {
|
|
556
|
+
target: _objectSpread(_objectSpread({}, e.target), {}, {
|
|
557
|
+
value: value
|
|
558
|
+
})
|
|
559
|
+
}));
|
|
560
|
+
},
|
|
561
|
+
placeholder: placeholder || myTitleLite,
|
|
562
|
+
autoComplete: "off",
|
|
563
|
+
style: style,
|
|
564
|
+
onBlur: onMyBlur,
|
|
565
|
+
onFocus: onMyFocus,
|
|
566
|
+
onKeyDown: onMyKeyDown,
|
|
567
|
+
onKeyUp: onMyKeyUp,
|
|
568
|
+
onKeyPress: onMyKeyPress,
|
|
569
|
+
onMouseDown: onMyMouseDown,
|
|
570
|
+
onMouseUp: onMyMouseUp,
|
|
571
|
+
onMouseEnter: onMyMouseEnter,
|
|
572
|
+
onMouseLeave: onMyMouseLeave
|
|
573
|
+
})
|
|
574
|
+
});
|
|
575
|
+
}), MyInputType.MONEY, function () {
|
|
576
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
577
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
578
|
+
ref: ref,
|
|
579
|
+
id: id,
|
|
580
|
+
type: "text",
|
|
581
|
+
value: moneyFormat(myValue),
|
|
582
|
+
onChange: onMyChange,
|
|
583
|
+
placeholder: placeholder || myTitleLite,
|
|
584
|
+
autoComplete: "off",
|
|
585
|
+
style: style,
|
|
586
|
+
onBlur: onMyBlur,
|
|
587
|
+
onFocus: onMyFocus,
|
|
588
|
+
onKeyDown: onMyKeyDown,
|
|
589
|
+
onKeyUp: onMyKeyUp,
|
|
590
|
+
onKeyPress: onMyKeyPress,
|
|
591
|
+
onMouseDown: onMyMouseDown,
|
|
592
|
+
onMouseUp: onMyMouseUp,
|
|
593
|
+
onMouseEnter: onMyMouseEnter,
|
|
594
|
+
onMouseLeave: onMyMouseLeave
|
|
595
|
+
})
|
|
596
|
+
});
|
|
597
|
+
}), MyInputType.NUMBER, function () {
|
|
598
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
599
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
600
|
+
ref: ref,
|
|
601
|
+
id: id,
|
|
602
|
+
type: "number",
|
|
603
|
+
value: myValue,
|
|
604
|
+
onChange: onMyChange,
|
|
605
|
+
placeholder: placeholder || myTitleLite,
|
|
606
|
+
autoComplete: "off",
|
|
607
|
+
style: style,
|
|
608
|
+
onBlur: onMyBlur,
|
|
609
|
+
onFocus: onMyFocus,
|
|
610
|
+
onKeyDown: onMyKeyDown,
|
|
611
|
+
onKeyUp: onMyKeyUp,
|
|
612
|
+
onKeyPress: onMyKeyPress,
|
|
613
|
+
onMouseDown: onMyMouseDown,
|
|
614
|
+
onMouseUp: onMyMouseUp,
|
|
615
|
+
onMouseEnter: onMyMouseEnter,
|
|
616
|
+
onMouseLeave: onMyMouseLeave
|
|
617
|
+
})
|
|
618
|
+
});
|
|
619
|
+
}), MyInputType.DATE, function () {
|
|
620
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
621
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
622
|
+
ref: ref,
|
|
623
|
+
type: "date",
|
|
624
|
+
id: "myDate" + myInputId,
|
|
625
|
+
value: myValue || '',
|
|
626
|
+
onChange: onMyChange,
|
|
627
|
+
placeholder: placeholder || myTitleLite,
|
|
628
|
+
min: minDate,
|
|
629
|
+
max: maxDate,
|
|
630
|
+
style: style,
|
|
631
|
+
onBlur: onMyBlur,
|
|
632
|
+
onFocus: onMyFocus,
|
|
633
|
+
onKeyDown: onMyKeyDown,
|
|
634
|
+
onKeyUp: onMyKeyUp,
|
|
635
|
+
onKeyPress: onMyKeyPress,
|
|
636
|
+
onMouseDown: onMyMouseDown,
|
|
637
|
+
onMouseUp: onMyMouseUp,
|
|
638
|
+
onMouseEnter: onMyMouseEnter,
|
|
639
|
+
onMouseLeave: onMyMouseLeave
|
|
640
|
+
})
|
|
641
|
+
});
|
|
642
|
+
}), MyInputType.DATETIME, function () {
|
|
643
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
644
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
645
|
+
ref: ref,
|
|
646
|
+
type: "datetime-local",
|
|
647
|
+
id: "myDateTime" + myInputId,
|
|
648
|
+
value: myValue || '',
|
|
649
|
+
onChange: onMyChange,
|
|
650
|
+
placeholder: placeholder || myTitleLite,
|
|
651
|
+
min: minDate,
|
|
652
|
+
max: maxDate,
|
|
653
|
+
style: style,
|
|
654
|
+
onBlur: onMyBlur,
|
|
655
|
+
onFocus: onMyFocus,
|
|
656
|
+
onKeyDown: onMyKeyDown,
|
|
657
|
+
onKeyUp: onMyKeyUp,
|
|
658
|
+
onKeyPress: onMyKeyPress,
|
|
659
|
+
onMouseDown: onMyMouseDown,
|
|
660
|
+
onMouseUp: onMyMouseUp,
|
|
661
|
+
onMouseEnter: onMyMouseEnter,
|
|
662
|
+
onMouseLeave: onMyMouseLeave
|
|
663
|
+
})
|
|
664
|
+
});
|
|
665
|
+
}), MyInputType.TIME, function () {
|
|
666
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
667
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
668
|
+
ref: ref,
|
|
669
|
+
type: "time",
|
|
670
|
+
id: "myTime" + myInputId,
|
|
671
|
+
value: myValue || '',
|
|
672
|
+
onChange: onMyChange,
|
|
673
|
+
placeholder: placeholder || myTitleLite,
|
|
674
|
+
style: style,
|
|
675
|
+
onBlur: onMyBlur,
|
|
676
|
+
onFocus: onMyFocus,
|
|
677
|
+
onKeyDown: onMyKeyDown,
|
|
678
|
+
onKeyUp: onMyKeyUp,
|
|
679
|
+
onKeyPress: onMyKeyPress,
|
|
680
|
+
onMouseDown: onMyMouseDown,
|
|
681
|
+
onMouseUp: onMyMouseUp,
|
|
682
|
+
onMouseEnter: onMyMouseEnter,
|
|
683
|
+
onMouseLeave: onMyMouseLeave
|
|
684
|
+
})
|
|
685
|
+
});
|
|
686
|
+
}), MyInputType.PASSWORD, function () {
|
|
687
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
688
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
689
|
+
ref: ref,
|
|
690
|
+
id: id,
|
|
691
|
+
type: myEyeView ? "text" : "password",
|
|
692
|
+
value: myValue,
|
|
693
|
+
onChange: onMyChange,
|
|
694
|
+
placeholder: placeholder || myTitleLite,
|
|
695
|
+
autoComplete: "new-password",
|
|
696
|
+
style: style,
|
|
697
|
+
maxLength: maxlength,
|
|
698
|
+
onBlur: onMyBlur,
|
|
699
|
+
onFocus: onMyFocus,
|
|
700
|
+
onKeyDown: onMyKeyDown,
|
|
701
|
+
onKeyUp: onMyKeyUp,
|
|
702
|
+
onKeyPress: onMyKeyPress,
|
|
703
|
+
onMouseDown: onMyMouseDown,
|
|
704
|
+
onMouseUp: onMyMouseUp,
|
|
705
|
+
onMouseEnter: onMyMouseEnter,
|
|
706
|
+
onMouseLeave: onMyMouseLeave
|
|
707
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
708
|
+
type: "button",
|
|
709
|
+
className: _MyInputModule["default"].eye,
|
|
710
|
+
onClick: function onClick() {
|
|
711
|
+
return setMyEyeView(!myEyeView);
|
|
712
|
+
},
|
|
713
|
+
children: myEyeView ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_pi.PiEyeSlash, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_pi.PiEye, {})
|
|
714
|
+
})]
|
|
715
|
+
});
|
|
716
|
+
}), MyInputType.COLOR, function () {
|
|
717
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
718
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
719
|
+
ref: ref,
|
|
720
|
+
id: id,
|
|
721
|
+
type: "color",
|
|
722
|
+
value: myValue,
|
|
723
|
+
onChange: onMyChange,
|
|
724
|
+
placeholder: placeholder || myTitleLite,
|
|
725
|
+
style: style,
|
|
726
|
+
onBlur: onMyBlur,
|
|
727
|
+
onFocus: onMyFocus,
|
|
728
|
+
onKeyDown: onMyKeyDown,
|
|
729
|
+
onKeyUp: onMyKeyUp,
|
|
730
|
+
onKeyPress: onMyKeyPress,
|
|
731
|
+
onMouseDown: onMyMouseDown,
|
|
732
|
+
onMouseUp: onMyMouseUp,
|
|
733
|
+
onMouseEnter: onMyMouseEnter,
|
|
734
|
+
onMouseLeave: onMyMouseLeave
|
|
735
|
+
})
|
|
736
|
+
});
|
|
737
|
+
}), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_inputTypes, MyInputType.TEXTAREA, function () {
|
|
738
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("textarea", {
|
|
576
739
|
ref: ref,
|
|
577
740
|
id: id,
|
|
578
741
|
onChange: onMyChange,
|
|
@@ -590,176 +753,210 @@ function MyInput({
|
|
|
590
753
|
onMouseUp: onMyMouseUp,
|
|
591
754
|
onMouseEnter: onMyMouseEnter,
|
|
592
755
|
onMouseLeave: onMyMouseLeave
|
|
593
|
-
})
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
756
|
+
});
|
|
757
|
+
}), MyInputType.SELECT, function () {
|
|
758
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
759
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("select", {
|
|
760
|
+
ref: ref,
|
|
761
|
+
id: id,
|
|
762
|
+
onChange: function onChange(e) {
|
|
763
|
+
return onMyChange(e);
|
|
764
|
+
},
|
|
765
|
+
value: myValue && !isNaN(myValue) ? MyInputIsNumeric(myValue) ? parseInt(myValue) : myValue : "",
|
|
766
|
+
style: style,
|
|
767
|
+
onBlur: onMyBlur,
|
|
768
|
+
onFocus: onMyFocus,
|
|
769
|
+
onKeyDown: onMyKeyDown,
|
|
770
|
+
onKeyUp: onMyKeyUp,
|
|
771
|
+
onKeyPress: onMyKeyPress,
|
|
772
|
+
onMouseDown: onMyMouseDown,
|
|
773
|
+
onMouseUp: onMyMouseUp,
|
|
774
|
+
onMouseEnter: onMyMouseEnter,
|
|
775
|
+
onMouseLeave: onMyMouseLeave,
|
|
776
|
+
children: options && options.map(function (e) {
|
|
777
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
778
|
+
value: MyInputIsNumeric(e[options_key_value]) ? parseInt(e[options_key_value]) : e[options_key_value],
|
|
779
|
+
children: e[options_key_text] || e["label"]
|
|
780
|
+
}, e[options_key_value]);
|
|
781
|
+
})
|
|
782
|
+
}), !myValue && !options && (placeholder || myTitleLite) && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
783
|
+
className: _MyInputModule["default"].placeholder,
|
|
784
|
+
children: placeholder ? placeholder : myTitleLite
|
|
785
|
+
})]
|
|
786
|
+
});
|
|
787
|
+
}), MyInputType.SELECTFILTER, function () {
|
|
788
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
789
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
790
|
+
ref: ref,
|
|
791
|
+
id: "mySelectFilterInput" + (id ? id : myInputId),
|
|
792
|
+
type: "text",
|
|
793
|
+
className: _MyInputModule["default"].filterInput,
|
|
794
|
+
style: style,
|
|
795
|
+
value: filtertext,
|
|
796
|
+
onChange: function onChange(e) {
|
|
797
|
+
return setFiltertext(e.target.value);
|
|
798
|
+
},
|
|
799
|
+
placeholder: placeholdersearchtext && placeholdersearchtext != "" ? placeholdersearchtext : (placeholder ? placeholder : myTitleLite) + " ...",
|
|
800
|
+
onBlur: onMyBlur,
|
|
801
|
+
onFocus: onMyFocus,
|
|
802
|
+
onKeyDown: onMyKeyDown,
|
|
803
|
+
onKeyUp: onMyKeyUp,
|
|
804
|
+
onKeyPress: onMyKeyPress,
|
|
805
|
+
onMouseDown: onMyMouseDown,
|
|
806
|
+
onMouseUp: onMyMouseUp,
|
|
807
|
+
onMouseEnter: onMyMouseEnter,
|
|
808
|
+
onMouseLeave: onMyMouseLeave
|
|
809
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
810
|
+
className: _MyInputModule["default"].filterInputSelectedContainer + " " + (myValue ? _MyInputModule["default"].filterInputSelectedContainerSelected : ''),
|
|
811
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
812
|
+
id: "mySelectFilterSelected" + (id ? id : myInputId),
|
|
813
|
+
className: _MyInputModule["default"].filterInputSelected,
|
|
814
|
+
dangerouslySetInnerHTML: {
|
|
815
|
+
__html: getMyValueText()
|
|
816
|
+
}
|
|
817
|
+
}), myValue && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
818
|
+
className: _MyInputModule["default"].filterInputSelectedX,
|
|
819
|
+
onClick: function onClick() {
|
|
820
|
+
return setMyValue(null);
|
|
821
|
+
},
|
|
822
|
+
title: t("Seçimi Kaldır"),
|
|
823
|
+
children: "x"
|
|
824
|
+
}) || "", /*#__PURE__*/(0, _jsxRuntime.jsx)(_pi.PiCaretDownBold, {
|
|
825
|
+
className: _MyInputModule["default"].caretdown
|
|
826
|
+
})]
|
|
827
|
+
}), !myValue && (placeholder || myTitleLite) && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
828
|
+
className: _MyInputModule["default"].placeholder,
|
|
829
|
+
children: placeholder ? placeholder : myTitleLite
|
|
830
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
|
|
831
|
+
id: "mySelectFilterList" + (id ? id : myInputId),
|
|
832
|
+
className: _MyInputModule["default"].filterInputList,
|
|
833
|
+
children: options && getFilterOptions().map(function (item) {
|
|
834
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("li", {
|
|
835
|
+
value: MyInputIsNumeric(item[options_key_value]) ? parseInt(item[options_key_value]) : item[options_key_value],
|
|
836
|
+
onClick: function onClick() {
|
|
837
|
+
return mySelectFilterListClick(item);
|
|
838
|
+
},
|
|
839
|
+
className: item[options_key_subtext] ? _MyInputModule["default"].subtextli : '',
|
|
840
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
841
|
+
dangerouslySetInnerHTML: {
|
|
842
|
+
__html: item[options_key_text] || item["label"]
|
|
843
|
+
}
|
|
844
|
+
}), item[options_key_subtext] && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
845
|
+
className: _MyInputModule["default"].subtext,
|
|
846
|
+
children: item[options_key_subtext]
|
|
847
|
+
})]
|
|
848
|
+
}, item[options_key_value]);
|
|
849
|
+
})
|
|
850
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
851
|
+
style: {
|
|
852
|
+
display: "none"
|
|
853
|
+
},
|
|
854
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("select", {
|
|
855
|
+
id: "mySelectFilterHiddenSelect" + myInputId,
|
|
856
|
+
onChange: function onChange(e) {
|
|
857
|
+
return onMyChange(e);
|
|
858
|
+
},
|
|
859
|
+
value: myValue && !isNaN(myValue) ? MyInputIsNumeric(myValue) ? parseInt(myValue) : myValue : "",
|
|
860
|
+
children: options && options.map(function (item) {
|
|
861
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
862
|
+
value: MyInputIsNumeric(item[options_key_value]) ? parseInt(item[options_key_value]) : item[options_key_value],
|
|
863
|
+
children: item[options_key_text] || item["label"]
|
|
864
|
+
}, item[options_key_value]);
|
|
865
|
+
})
|
|
866
|
+
})
|
|
867
|
+
})]
|
|
868
|
+
});
|
|
869
|
+
}), MyInputType.FILE, function () {
|
|
870
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
871
|
+
className: _MyInputModule["default"].fileinput,
|
|
872
|
+
children: [function () {
|
|
873
|
+
// Dosya önizleme gösterimi için kontrol
|
|
874
|
+
if (myValue && (type === MyInputType.IMAGE || accept === '.jpg,.jpeg,.png')) {
|
|
875
|
+
if (Array.isArray(myValue) && myValue.length === 1 && getFileImageControl(myValue[0].filename)) {
|
|
876
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
877
|
+
src: myValue[0].base64,
|
|
878
|
+
className: _MyInputModule["default"].fileImagePreview,
|
|
879
|
+
alt: "Preview"
|
|
880
|
+
});
|
|
881
|
+
} else if (getFileImageControl(myValue)) {
|
|
882
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
883
|
+
src: myValue,
|
|
884
|
+
className: _MyInputModule["default"].fileImagePreview,
|
|
885
|
+
alt: "Preview"
|
|
886
|
+
});
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
return null;
|
|
890
|
+
}(), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
891
|
+
className: _MyInputModule["default"].filename + " " + (myFileName && _MyInputModule["default"].selected),
|
|
661
892
|
dangerouslySetInnerHTML: {
|
|
662
|
-
__html:
|
|
893
|
+
__html: myFileName || (placeholder ? placeholder : t(type === MyInputType.IMAGE ? "Görsel Seçiniz" : "Dosya Seçiniz"))
|
|
663
894
|
}
|
|
664
|
-
}),
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
id: "mySelectFilterHiddenSelect" + myInputId,
|
|
673
|
-
onChange: e => onMyChange(e),
|
|
674
|
-
value: myValue && !isNaN(myValue) ? MyInputIsNumeric(myValue) ? parseInt(myValue) : myValue : ""
|
|
675
|
-
}, options && options.map(item => {
|
|
676
|
-
return /*#__PURE__*/React.createElement("option", {
|
|
677
|
-
key: item[options_key_value],
|
|
678
|
-
value: MyInputIsNumeric(item[options_key_value]) ? parseInt(item[options_key_value]) : item[options_key_value]
|
|
679
|
-
}, item[options_key_text] || item["label"]);
|
|
680
|
-
})))),
|
|
681
|
-
[MyInputType.FILE]: () => /*#__PURE__*/React.createElement("div", {
|
|
682
|
-
className: styles.fileinput
|
|
683
|
-
}, (() => {
|
|
684
|
-
// Dosya önizleme gösterimi için kontrol
|
|
685
|
-
if (myValue && (type === MyInputType.IMAGE || accept === '.jpg,.jpeg,.png')) {
|
|
686
|
-
if (Array.isArray(myValue) && myValue.length === 1 && getFileImageControl(myValue[0].filename)) {
|
|
687
|
-
return /*#__PURE__*/React.createElement("img", {
|
|
688
|
-
src: myValue[0].base64,
|
|
689
|
-
className: styles.fileImagePreview,
|
|
690
|
-
alt: "Preview"
|
|
691
|
-
});
|
|
692
|
-
} else if (getFileImageControl(myValue)) {
|
|
693
|
-
return /*#__PURE__*/React.createElement("img", {
|
|
694
|
-
src: myValue,
|
|
695
|
-
className: styles.fileImagePreview,
|
|
696
|
-
alt: "Preview"
|
|
895
|
+
}), function () {
|
|
896
|
+
if (onRemoveImage && myValue && type === MyInputType.IMAGE && (Array.isArray(myValue) && myValue.length === 1 && getFileImageControl(myValue[0].filename) || getFileImageControl(myValue) && !(myValue.includes("nologo") || myValue.includes("noimage")))) {
|
|
897
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
898
|
+
type: "button",
|
|
899
|
+
onClick: onRemoveImageClick,
|
|
900
|
+
className: _MyInputModule["default"].filebuttonremove,
|
|
901
|
+
title: t("Kaldır"),
|
|
902
|
+
children: "x"
|
|
697
903
|
});
|
|
698
904
|
}
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
}
|
|
728
|
-
}, multiple ? {
|
|
729
|
-
multiple: true
|
|
730
|
-
} : {}, {
|
|
731
|
-
accept: type === MyInputType.IMAGE ? '.jpg,.jpeg,.png' : accept
|
|
732
|
-
}))),
|
|
733
|
-
[MyInputType.IMAGE]: function () {
|
|
734
|
-
return this[MyInputType.FILE]();
|
|
735
|
-
}
|
|
736
|
-
};
|
|
737
|
-
return inputTypes[type]?.() || null;
|
|
905
|
+
return null;
|
|
906
|
+
}(), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
907
|
+
type: "button",
|
|
908
|
+
onClick: function onClick() {
|
|
909
|
+
return fileInputRef.current.click();
|
|
910
|
+
},
|
|
911
|
+
className: _MyInputModule["default"].filebutton,
|
|
912
|
+
children: type === MyInputType.IMAGE ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_pi.PiImage, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_md.MdOutlineAttachFile, {})
|
|
913
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", _objectSpread(_objectSpread({
|
|
914
|
+
type: "file",
|
|
915
|
+
ref: fileInputRef,
|
|
916
|
+
onChange: function onChange(e) {
|
|
917
|
+
return onMyChange(e);
|
|
918
|
+
},
|
|
919
|
+
placeholder: placeholder || myTitleLite,
|
|
920
|
+
style: {
|
|
921
|
+
display: "none"
|
|
922
|
+
}
|
|
923
|
+
}, multiple ? {
|
|
924
|
+
multiple: true
|
|
925
|
+
} : {}), {}, {
|
|
926
|
+
accept: type === MyInputType.IMAGE ? '.jpg,.jpeg,.png' : accept
|
|
927
|
+
}))]
|
|
928
|
+
});
|
|
929
|
+
}), MyInputType.IMAGE, function () {
|
|
930
|
+
return this[MyInputType.FILE]();
|
|
931
|
+
}));
|
|
932
|
+
return ((_inputTypes$type = inputTypes[type]) === null || _inputTypes$type === void 0 ? void 0 : _inputTypes$type.call(inputTypes)) || null;
|
|
738
933
|
};
|
|
739
|
-
return /*#__PURE__*/
|
|
934
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
740
935
|
id: "myinput" + myInputId,
|
|
741
|
-
className:
|
|
936
|
+
className: _MyInputModule["default"].container + " " + (className != null ? className : '') + " " + (isError ? _MyInputModule["default"].error : ''),
|
|
742
937
|
title: title && myTitleLite || placeholder && placeholder,
|
|
743
938
|
style: style && style.width && {
|
|
744
939
|
display: 'inline-block'
|
|
745
940
|
} || {
|
|
746
941
|
width: '100%'
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
...(style.backgroundColor && {
|
|
942
|
+
},
|
|
943
|
+
children: [title && /*#__PURE__*/(0, _jsxRuntime.jsx)("small", {
|
|
944
|
+
dangerouslySetInnerHTML: {
|
|
945
|
+
__html: title
|
|
946
|
+
}
|
|
947
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
948
|
+
className: _MyInputModule["default"].inputblock + " " + (disabled || type === MyInputType.READONLY ? _MyInputModule["default"].inputblockdisabled : '') + " " + (icon || type === MyInputType.IMAGE ? _MyInputModule["default"].inputblockicon : ''),
|
|
949
|
+
style: style && _objectSpread({}, style.backgroundColor && {
|
|
756
950
|
backgroundColor: style.backgroundColor
|
|
757
|
-
})
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
951
|
+
}),
|
|
952
|
+
children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
953
|
+
className: "".concat(_MyInputModule["default"].icon, " ").concat(type === MyInputType.TEXTAREA || rows > 0 ? _MyInputModule["default"].icontextarea : ''),
|
|
954
|
+
children: icon
|
|
955
|
+
}), renderInput()]
|
|
956
|
+
}), description && /*#__PURE__*/(0, _jsxRuntime.jsx)("small", {
|
|
957
|
+
className: _MyInputModule["default"].description,
|
|
958
|
+
children: description
|
|
959
|
+
})]
|
|
960
|
+
});
|
|
764
961
|
}
|
|
765
|
-
|
|
962
|
+
var _default = exports["default"] = MyInput;
|