px-react-ui-components 1.0.3 → 1.0.6
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 +9 -11
|
@@ -1,33 +1,18 @@
|
|
|
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 = exports.MyInputType = exports.MyInputIsNumeric = void 0;
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
8
|
var _MyInputModule = _interopRequireDefault(require("./MyInput.module.css"));
|
|
10
9
|
var _pi = require("react-icons/pi");
|
|
11
10
|
var _md = require("react-icons/md");
|
|
12
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : {
|
|
14
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
16
|
-
|
|
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({
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
const MyInputType = exports.MyInputType = Object.freeze({
|
|
31
16
|
TEXT: 'text',
|
|
32
17
|
PASSWORD: 'password',
|
|
33
18
|
SELECT: 'select',
|
|
@@ -45,148 +30,86 @@ var MyInputType = exports.MyInputType = Object.freeze({
|
|
|
45
30
|
MAIL: 'mail',
|
|
46
31
|
PHONE: 'phone'
|
|
47
32
|
});
|
|
48
|
-
|
|
33
|
+
const MyInputIsNumeric = value => {
|
|
49
34
|
if (value === null || value === undefined || value === '') return false;
|
|
50
35
|
return !isNaN(value) && !isNaN(parseFloat(value));
|
|
51
36
|
};
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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;
|
|
37
|
+
exports.MyInputIsNumeric = MyInputIsNumeric;
|
|
38
|
+
function MyInput({
|
|
39
|
+
id = null,
|
|
40
|
+
ref = null,
|
|
41
|
+
title = "",
|
|
42
|
+
placeholder = "",
|
|
43
|
+
placeholdersearchtext = "",
|
|
44
|
+
description = null,
|
|
45
|
+
type = MyInputType.TEXT,
|
|
46
|
+
className = null,
|
|
47
|
+
rows = 0,
|
|
48
|
+
icon = null,
|
|
49
|
+
options = null,
|
|
50
|
+
options_key_value = "value",
|
|
51
|
+
options_key_text = "text",
|
|
52
|
+
options_key_subtext = "subtext",
|
|
53
|
+
multiple = false,
|
|
54
|
+
disabled = false,
|
|
55
|
+
value = null,
|
|
56
|
+
decimalCount = 2,
|
|
57
|
+
buttonText = "",
|
|
58
|
+
accept = ".jpg,.jpeg,.png",
|
|
59
|
+
minDate = null,
|
|
60
|
+
maxDate = null,
|
|
61
|
+
style = null,
|
|
62
|
+
maxlength = null,
|
|
63
|
+
dangerouslySetInnerHTML = null,
|
|
64
|
+
uppercase = false,
|
|
65
|
+
lowercase = false,
|
|
66
|
+
firstUppercase = false,
|
|
67
|
+
onChange = null,
|
|
68
|
+
onBlur = null,
|
|
69
|
+
onFocus = null,
|
|
70
|
+
onKeyDown = null,
|
|
71
|
+
onKeyUp = null,
|
|
72
|
+
onKeyPress = null,
|
|
73
|
+
onMouseDown = null,
|
|
74
|
+
onMouseUp = null,
|
|
75
|
+
onMouseEnter = null,
|
|
76
|
+
onMouseLeave = null,
|
|
77
|
+
onRemoveImage = null
|
|
78
|
+
}) {
|
|
79
|
+
const myInputId = `key${Date.now() + Math.random().toString(36).substr(2, 9)}`;
|
|
80
|
+
const fileInputRef = (0, _react.useRef)(null);
|
|
81
|
+
const [loaded, setLoaded] = (0, _react.useState)(false);
|
|
82
|
+
const [myValue, setMyValue] = (0, _react.useState)(value);
|
|
83
|
+
const [myEyeView, setMyEyeView] = (0, _react.useState)(false);
|
|
84
|
+
const [myFileName, setMyFileName] = (0, _react.useState)(null);
|
|
85
|
+
const [myTitleLite, setMyTitleLite] = (0, _react.useState)("");
|
|
86
|
+
const [filtertext, setFiltertext] = (0, _react.useState)("");
|
|
87
|
+
const [isError, setIsError] = (0, _react.useState)(false);
|
|
88
|
+
const toBase64 = file => new Promise((resolve, reject) => {
|
|
89
|
+
const reader = new FileReader();
|
|
90
|
+
reader.readAsDataURL(file);
|
|
91
|
+
reader.onload = () => resolve(reader.result);
|
|
92
|
+
reader.onerror = reject;
|
|
93
|
+
});
|
|
94
|
+
const calculateFileSize = sizeInBytes => {
|
|
95
|
+
const units = ['B', 'KB', 'MB'];
|
|
96
|
+
let size = sizeInBytes;
|
|
97
|
+
let unitIndex = 0;
|
|
175
98
|
while (size >= 1024 && unitIndex < units.length - 1) {
|
|
176
99
|
size /= 1024;
|
|
177
100
|
unitIndex++;
|
|
178
101
|
}
|
|
179
|
-
return
|
|
102
|
+
return `${size.toFixed(2)} ${units[unitIndex]}`;
|
|
180
103
|
};
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
104
|
+
const moneyFormat = _value => {
|
|
105
|
+
let money = '';
|
|
106
|
+
let inputValue = _value;
|
|
184
107
|
if (inputValue == null || inputValue == undefined || inputValue == '') return money;
|
|
185
108
|
try {
|
|
186
109
|
inputValue = inputValue.toString();
|
|
187
110
|
// Tüm virgülleri kaldır ve son girilen karakteri kontrol et
|
|
188
111
|
money = inputValue.replace(/,/g, '');
|
|
189
|
-
|
|
112
|
+
const lastChar = inputValue.slice(-1);
|
|
190
113
|
if (lastChar === ',') {
|
|
191
114
|
money = money + '.';
|
|
192
115
|
}
|
|
@@ -195,7 +118,7 @@ function MyInput(_ref) {
|
|
|
195
118
|
money = money.replace(/[^0-9.]/g, '');
|
|
196
119
|
|
|
197
120
|
// Birden fazla nokta varsa ilkini koru
|
|
198
|
-
|
|
121
|
+
const parts = money.split('.');
|
|
199
122
|
if (parts.length > 2) {
|
|
200
123
|
money = parts[0] + '.' + parts[1];
|
|
201
124
|
}
|
|
@@ -207,14 +130,14 @@ function MyInput(_ref) {
|
|
|
207
130
|
|
|
208
131
|
// Binlik ayracı için formatlama
|
|
209
132
|
if (money) {
|
|
210
|
-
|
|
211
|
-
if (
|
|
133
|
+
const numParts = money.split('.');
|
|
134
|
+
if (numParts[0]) {
|
|
212
135
|
// Sayıyı önce tam sayıya çevir, sonra binlik ayracı ekle
|
|
213
|
-
|
|
136
|
+
numParts[0] = parseInt(numParts[0], 10).toLocaleString('en-US');
|
|
214
137
|
}
|
|
215
|
-
money =
|
|
138
|
+
money = numParts.join('.');
|
|
216
139
|
}
|
|
217
|
-
|
|
140
|
+
const numParts = money.split('.');
|
|
218
141
|
if (numParts[0]) {
|
|
219
142
|
numParts[0] = numParts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
220
143
|
}
|
|
@@ -226,7 +149,7 @@ function MyInput(_ref) {
|
|
|
226
149
|
}
|
|
227
150
|
return money;
|
|
228
151
|
};
|
|
229
|
-
|
|
152
|
+
const onMyBlur = e => {
|
|
230
153
|
setIsError(false);
|
|
231
154
|
if (myValue != null && myValue != "") {
|
|
232
155
|
switch (type) {
|
|
@@ -246,147 +169,111 @@ function MyInput(_ref) {
|
|
|
246
169
|
}
|
|
247
170
|
if (onBlur != null) onBlur(e);
|
|
248
171
|
};
|
|
249
|
-
|
|
172
|
+
const onMyFocus = e => {
|
|
250
173
|
if (onFocus != null) onFocus(e);
|
|
251
174
|
};
|
|
252
|
-
|
|
175
|
+
const onMyKeyDown = e => {
|
|
253
176
|
if (onKeyDown != null) onKeyDown(e);
|
|
254
177
|
};
|
|
255
|
-
|
|
178
|
+
const onMyKeyUp = e => {
|
|
256
179
|
if (onKeyUp != null) onKeyUp(e);
|
|
257
180
|
};
|
|
258
|
-
|
|
181
|
+
const onMyKeyPress = e => {
|
|
259
182
|
if (onKeyPress != null) onKeyPress(e);
|
|
260
183
|
};
|
|
261
|
-
|
|
184
|
+
const onMyMouseDown = e => {
|
|
262
185
|
if (onMouseDown != null) onMouseDown(e);
|
|
263
186
|
};
|
|
264
|
-
|
|
187
|
+
const onMyMouseUp = e => {
|
|
265
188
|
if (onMouseUp != null) onMouseUp(e);
|
|
266
189
|
};
|
|
267
|
-
|
|
190
|
+
const onMyMouseEnter = e => {
|
|
268
191
|
if (onMouseEnter != null) onMouseEnter(e);
|
|
269
192
|
};
|
|
270
|
-
|
|
193
|
+
const onMyMouseLeave = e => {
|
|
271
194
|
if (onMouseLeave != null) onMouseLeave(e);
|
|
272
195
|
};
|
|
273
|
-
|
|
196
|
+
const onRemoveImageClick = e => {
|
|
274
197
|
if (onRemoveImage != null) onRemoveImage();
|
|
275
198
|
};
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
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];
|
|
199
|
+
const onMyChange = async e => {
|
|
200
|
+
switch (type) {
|
|
201
|
+
case MyInputType.FILE:
|
|
202
|
+
case MyInputType.IMAGE:
|
|
203
|
+
let files = [];
|
|
204
|
+
if (e.target.files.length > 0) {
|
|
205
|
+
let totalSize = 0;
|
|
206
|
+
for (let i = 0; i < e.target.files.length; i++) {
|
|
207
|
+
const file = e.target.files[i];
|
|
299
208
|
totalSize += parseInt(file.size);
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
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
|
|
209
|
+
files.push({
|
|
210
|
+
// file: file,
|
|
211
|
+
base64: await toBase64(file),
|
|
212
|
+
filename: file.name,
|
|
213
|
+
size: file.size,
|
|
214
|
+
sizeText: calculateFileSize(file.size)
|
|
215
|
+
});
|
|
216
|
+
} //for
|
|
321
217
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
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();
|
|
218
|
+
totalSize = calculateFileSize(totalSize);
|
|
219
|
+
setMyFileName(`<span>${files.length == 1 ? files[0].filename : files.length + " Dosya Seçildi"}</span>
|
|
220
|
+
<small>(${totalSize})</small>`);
|
|
221
|
+
} else {
|
|
222
|
+
setMyFileName("");
|
|
355
223
|
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
224
|
+
setMyValue(files);
|
|
225
|
+
break;
|
|
226
|
+
case MyInputType.NUMBER:
|
|
227
|
+
let number = e.target.value.replace(/[^0-9.]/g, '');
|
|
228
|
+
|
|
229
|
+
// Birden fazla nokta varsa ilkini koru
|
|
230
|
+
const numberParts = number.split('.');
|
|
231
|
+
if (numberParts.length > 2) {
|
|
232
|
+
number = numberParts[0] + '.' + numberParts[1];
|
|
233
|
+
}
|
|
234
|
+
setMyValue(number);
|
|
235
|
+
break;
|
|
236
|
+
case MyInputType.MONEY:
|
|
237
|
+
let money = moneyFormat(e.target.value);
|
|
238
|
+
setMyValue(money);
|
|
239
|
+
break;
|
|
240
|
+
case MyInputType.DATE:
|
|
241
|
+
case MyInputType.DATETIME:
|
|
242
|
+
case MyInputType.TIME:
|
|
243
|
+
const selectedDate = e.target.value;
|
|
244
|
+
setMyValue(selectedDate);
|
|
245
|
+
break;
|
|
246
|
+
default:
|
|
247
|
+
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);
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
const mySelectFilterListClick = item => {
|
|
252
|
+
const selectElement = document.getElementById("mySelectFilterHiddenSelect" + myInputId);
|
|
364
253
|
selectElement.value = item.value;
|
|
365
254
|
setMyValue(item.value);
|
|
366
255
|
setFiltertext("");
|
|
367
256
|
};
|
|
368
|
-
|
|
257
|
+
const getMyValueText = () => {
|
|
369
258
|
if (!myValue || myValue == 0) return "";
|
|
370
259
|
if (!MyInputIsNumeric(myValue) || options == null) return myValue;
|
|
371
|
-
|
|
372
|
-
|
|
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>") : '');
|
|
260
|
+
let result = options.find(e => e.value.toString() == myValue.toString());
|
|
261
|
+
if (result) return result.text + (result[options_key_subtext] ? ` - <span style="color: #73889d; font-style: italic; font-weight: 300;">${result[options_key_subtext]}</span>` : '');
|
|
375
262
|
return "";
|
|
376
263
|
};
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
264
|
+
const filterSelectEvents = () => {
|
|
265
|
+
const selectElement = document.getElementById("mySelectFilterSelected" + (id ? id : myInputId));
|
|
266
|
+
const selectListElement = document.getElementById("mySelectFilterList" + (id ? id : myInputId));
|
|
267
|
+
const filterInput = document.getElementById("mySelectFilterInput" + (id ? id : myInputId));
|
|
381
268
|
if (!selectElement || !selectListElement || !filterInput) return;
|
|
382
|
-
|
|
269
|
+
let isInputFocused = false;
|
|
383
270
|
|
|
384
271
|
// Select'e tıklandığında seçim listesini aç
|
|
385
272
|
selectElement.addEventListener('click', function () {
|
|
386
273
|
if (!isInputFocused) {
|
|
387
274
|
filterInput.style.display = 'block';
|
|
388
275
|
selectListElement.style.display = 'block';
|
|
389
|
-
setTimeout(
|
|
276
|
+
setTimeout(() => {
|
|
390
277
|
filterInput.focus();
|
|
391
278
|
}, 100); // Gecikme, select listesi açılırken input'a odaklanması için
|
|
392
279
|
}
|
|
@@ -400,42 +287,36 @@ function MyInput(_ref) {
|
|
|
400
287
|
// Input odaktan çıktığında ve select'in blur olayında input'u gizle
|
|
401
288
|
filterInput.addEventListener('blur', function () {
|
|
402
289
|
isInputFocused = false;
|
|
403
|
-
setTimeout(
|
|
290
|
+
setTimeout(() => {
|
|
404
291
|
setFiltertext("");
|
|
405
292
|
filterInput.style.display = 'none';
|
|
406
293
|
selectListElement.style.display = 'none';
|
|
407
294
|
}, 150); // Gecikme ile select kapanmasını sağla
|
|
408
295
|
});
|
|
409
296
|
};
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
return true;
|
|
413
|
-
});
|
|
297
|
+
const getFilterOptions = () => {
|
|
298
|
+
let rv = options.filter(() => true);
|
|
414
299
|
if (filtertext != "") {
|
|
415
|
-
rv = rv.filter(
|
|
416
|
-
return e.text.toLocaleLowerCase().includes(filtertext.toLocaleLowerCase());
|
|
417
|
-
});
|
|
300
|
+
rv = rv.filter(e => e.text.toLocaleLowerCase().includes(filtertext.toLocaleLowerCase()));
|
|
418
301
|
}
|
|
419
302
|
return rv;
|
|
420
303
|
};
|
|
421
|
-
|
|
304
|
+
const getFileImageControl = filename => {
|
|
422
305
|
if (!filename) return false;
|
|
423
306
|
if (filename.includes(";base64,")) return true;
|
|
424
|
-
|
|
425
|
-
return validExtensions.some(
|
|
426
|
-
return filename.toString().toLocaleLowerCase().includes(ext);
|
|
427
|
-
});
|
|
307
|
+
const validExtensions = ['.jpg', '.jpeg', '.png', '.webp', '.gif'];
|
|
308
|
+
return validExtensions.some(ext => filename.toString().toLocaleLowerCase().includes(ext));
|
|
428
309
|
};
|
|
429
|
-
(0, _react.useEffect)(
|
|
310
|
+
(0, _react.useEffect)(() => {
|
|
430
311
|
if (loaded) {
|
|
431
|
-
|
|
312
|
+
let vl = value;
|
|
432
313
|
if (value == undefined) vl = null;
|
|
433
314
|
if (vl == null && (type == MyInputType.TEXT || type == MyInputType.MAIL || type == MyInputType.TEXTAREA || type == MyInputType.PASSWORD)) vl = "";
|
|
434
315
|
// if (vl != myValue) setMyValue(vl);
|
|
435
316
|
if (vl == null) setMyFileName(null);
|
|
436
317
|
}
|
|
437
318
|
}, [value]);
|
|
438
|
-
(0, _react.useEffect)(
|
|
319
|
+
(0, _react.useEffect)(() => {
|
|
439
320
|
if (myValue != value && onChange != null) {
|
|
440
321
|
onChange({
|
|
441
322
|
value: myValue,
|
|
@@ -445,55 +326,52 @@ function MyInput(_ref) {
|
|
|
445
326
|
});
|
|
446
327
|
}
|
|
447
328
|
}, [myValue]);
|
|
448
|
-
(0, _react.useEffect)(
|
|
329
|
+
(0, _react.useEffect)(() => {
|
|
449
330
|
if (title) {
|
|
450
331
|
setMyTitleLite(title.replace(/<\/?[^>]+(>|$)/g, ""));
|
|
451
332
|
}
|
|
452
333
|
}, [title]);
|
|
453
|
-
(0, _react.useEffect)(
|
|
334
|
+
(0, _react.useEffect)(() => {
|
|
454
335
|
setLoaded(true);
|
|
455
336
|
if (type == MyInputType.SELECTFILTER) filterSelectEvents();
|
|
456
337
|
if (type == MyInputType.DATE) {
|
|
457
|
-
|
|
458
|
-
dateInput.addEventListener('click',
|
|
459
|
-
var _dateInput$showPicker;
|
|
338
|
+
const dateInput = document.getElementById("myDate" + myInputId);
|
|
339
|
+
dateInput.addEventListener('click', () => {
|
|
460
340
|
// Tarih seçiciyi göstermek için odaklanma
|
|
461
|
-
|
|
341
|
+
dateInput.showPicker?.(); // Eğer destekliyorsa
|
|
462
342
|
});
|
|
463
343
|
}
|
|
464
344
|
if (type == MyInputType.DATETIME) {
|
|
465
|
-
|
|
466
|
-
dateTimeInput.addEventListener('click',
|
|
467
|
-
var _dateTimeInput$showPi;
|
|
345
|
+
const dateTimeInput = document.getElementById("myDateTime" + myInputId);
|
|
346
|
+
dateTimeInput.addEventListener('click', () => {
|
|
468
347
|
// Tarih seçiciyi göstermek için odaklanma
|
|
469
|
-
|
|
348
|
+
dateTimeInput.showPicker?.(); // Eğer destekliyorsa
|
|
470
349
|
});
|
|
471
350
|
}
|
|
472
351
|
if (type == MyInputType.TIME) {
|
|
473
|
-
|
|
474
|
-
timeInput.addEventListener('click',
|
|
475
|
-
var _timeInput$showPicker;
|
|
352
|
+
const timeInput = document.getElementById("myTime" + myInputId);
|
|
353
|
+
timeInput.addEventListener('click', () => {
|
|
476
354
|
// Saat seçiciyi göstermek için odaklanma
|
|
477
|
-
|
|
355
|
+
timeInput.showPicker?.(); // Eğer destekliyorsa
|
|
478
356
|
});
|
|
479
357
|
}
|
|
480
358
|
}, []);
|
|
481
|
-
|
|
482
|
-
var _inputTypes, _inputTypes$type;
|
|
359
|
+
const renderInput = () => {
|
|
483
360
|
if (disabled || type === MyInputType.READONLY) {
|
|
484
361
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
485
|
-
className: _MyInputModule
|
|
362
|
+
className: _MyInputModule.default.disabledInput,
|
|
486
363
|
dangerouslySetInnerHTML: dangerouslySetInnerHTML ? dangerouslySetInnerHTML : {
|
|
487
364
|
__html: getMyValueText()
|
|
488
365
|
},
|
|
489
|
-
style: rows > 0 ?
|
|
366
|
+
style: rows > 0 ? {
|
|
367
|
+
...(style ? style : {}),
|
|
490
368
|
height: rows * 30 + 'px',
|
|
491
369
|
alignItems: "flex-start"
|
|
492
|
-
}
|
|
370
|
+
} : style
|
|
493
371
|
});
|
|
494
372
|
}
|
|
495
|
-
|
|
496
|
-
|
|
373
|
+
const inputTypes = {
|
|
374
|
+
[MyInputType.TEXT]: () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
497
375
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
498
376
|
ref: ref,
|
|
499
377
|
id: id,
|
|
@@ -514,21 +392,20 @@ function MyInput(_ref) {
|
|
|
514
392
|
onMouseEnter: onMyMouseEnter,
|
|
515
393
|
onMouseLeave: onMyMouseLeave
|
|
516
394
|
})
|
|
517
|
-
})
|
|
518
|
-
|
|
519
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
395
|
+
}),
|
|
396
|
+
[MyInputType.MAIL]: () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
520
397
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
521
398
|
ref: ref,
|
|
522
399
|
id: id,
|
|
523
400
|
type: "text",
|
|
524
|
-
value: myValue
|
|
525
|
-
onChange:
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
}
|
|
531
|
-
},
|
|
401
|
+
value: myValue?.toLowerCase(),
|
|
402
|
+
onChange: e => onMyChange({
|
|
403
|
+
...e,
|
|
404
|
+
target: {
|
|
405
|
+
...e.target,
|
|
406
|
+
value: e.target.value.toLowerCase().replace(/\s/g, '')
|
|
407
|
+
}
|
|
408
|
+
}),
|
|
532
409
|
placeholder: placeholder || myTitleLite,
|
|
533
410
|
autoComplete: "off",
|
|
534
411
|
style: style,
|
|
@@ -542,21 +419,22 @@ function MyInput(_ref) {
|
|
|
542
419
|
onMouseEnter: onMyMouseEnter,
|
|
543
420
|
onMouseLeave: onMyMouseLeave
|
|
544
421
|
})
|
|
545
|
-
})
|
|
546
|
-
|
|
547
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
422
|
+
}),
|
|
423
|
+
[MyInputType.PHONE]: () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
548
424
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
549
425
|
ref: ref,
|
|
550
426
|
id: id,
|
|
551
427
|
type: "text",
|
|
552
428
|
value: myValue,
|
|
553
|
-
onChange:
|
|
554
|
-
|
|
555
|
-
onMyChange(
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
429
|
+
onChange: e => {
|
|
430
|
+
const value = e.target.value.replace(/[^0-9()-]/g, '');
|
|
431
|
+
onMyChange({
|
|
432
|
+
...e,
|
|
433
|
+
target: {
|
|
434
|
+
...e.target,
|
|
435
|
+
value
|
|
436
|
+
}
|
|
437
|
+
});
|
|
560
438
|
},
|
|
561
439
|
placeholder: placeholder || myTitleLite,
|
|
562
440
|
autoComplete: "off",
|
|
@@ -571,9 +449,8 @@ function MyInput(_ref) {
|
|
|
571
449
|
onMouseEnter: onMyMouseEnter,
|
|
572
450
|
onMouseLeave: onMyMouseLeave
|
|
573
451
|
})
|
|
574
|
-
})
|
|
575
|
-
|
|
576
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
452
|
+
}),
|
|
453
|
+
[MyInputType.MONEY]: () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
577
454
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
578
455
|
ref: ref,
|
|
579
456
|
id: id,
|
|
@@ -593,9 +470,8 @@ function MyInput(_ref) {
|
|
|
593
470
|
onMouseEnter: onMyMouseEnter,
|
|
594
471
|
onMouseLeave: onMyMouseLeave
|
|
595
472
|
})
|
|
596
|
-
})
|
|
597
|
-
|
|
598
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
473
|
+
}),
|
|
474
|
+
[MyInputType.NUMBER]: () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
599
475
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
600
476
|
ref: ref,
|
|
601
477
|
id: id,
|
|
@@ -615,9 +491,8 @@ function MyInput(_ref) {
|
|
|
615
491
|
onMouseEnter: onMyMouseEnter,
|
|
616
492
|
onMouseLeave: onMyMouseLeave
|
|
617
493
|
})
|
|
618
|
-
})
|
|
619
|
-
|
|
620
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
494
|
+
}),
|
|
495
|
+
[MyInputType.DATE]: () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
621
496
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
622
497
|
ref: ref,
|
|
623
498
|
type: "date",
|
|
@@ -638,9 +513,8 @@ function MyInput(_ref) {
|
|
|
638
513
|
onMouseEnter: onMyMouseEnter,
|
|
639
514
|
onMouseLeave: onMyMouseLeave
|
|
640
515
|
})
|
|
641
|
-
})
|
|
642
|
-
|
|
643
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
516
|
+
}),
|
|
517
|
+
[MyInputType.DATETIME]: () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
644
518
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
645
519
|
ref: ref,
|
|
646
520
|
type: "datetime-local",
|
|
@@ -661,9 +535,8 @@ function MyInput(_ref) {
|
|
|
661
535
|
onMouseEnter: onMyMouseEnter,
|
|
662
536
|
onMouseLeave: onMyMouseLeave
|
|
663
537
|
})
|
|
664
|
-
})
|
|
665
|
-
|
|
666
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
538
|
+
}),
|
|
539
|
+
[MyInputType.TIME]: () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
667
540
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
668
541
|
ref: ref,
|
|
669
542
|
type: "time",
|
|
@@ -682,9 +555,8 @@ function MyInput(_ref) {
|
|
|
682
555
|
onMouseEnter: onMyMouseEnter,
|
|
683
556
|
onMouseLeave: onMyMouseLeave
|
|
684
557
|
})
|
|
685
|
-
})
|
|
686
|
-
|
|
687
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
558
|
+
}),
|
|
559
|
+
[MyInputType.PASSWORD]: () => /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
688
560
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
689
561
|
ref: ref,
|
|
690
562
|
id: id,
|
|
@@ -706,15 +578,12 @@ function MyInput(_ref) {
|
|
|
706
578
|
onMouseLeave: onMyMouseLeave
|
|
707
579
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
708
580
|
type: "button",
|
|
709
|
-
className: _MyInputModule
|
|
710
|
-
onClick:
|
|
711
|
-
return setMyEyeView(!myEyeView);
|
|
712
|
-
},
|
|
581
|
+
className: _MyInputModule.default.eye,
|
|
582
|
+
onClick: () => setMyEyeView(!myEyeView),
|
|
713
583
|
children: myEyeView ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_pi.PiEyeSlash, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_pi.PiEye, {})
|
|
714
584
|
})]
|
|
715
|
-
})
|
|
716
|
-
|
|
717
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
585
|
+
}),
|
|
586
|
+
[MyInputType.COLOR]: () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
718
587
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
719
588
|
ref: ref,
|
|
720
589
|
id: id,
|
|
@@ -733,9 +602,8 @@ function MyInput(_ref) {
|
|
|
733
602
|
onMouseEnter: onMyMouseEnter,
|
|
734
603
|
onMouseLeave: onMyMouseLeave
|
|
735
604
|
})
|
|
736
|
-
})
|
|
737
|
-
|
|
738
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("textarea", {
|
|
605
|
+
}),
|
|
606
|
+
[MyInputType.TEXTAREA]: () => /*#__PURE__*/(0, _jsxRuntime.jsx)("textarea", {
|
|
739
607
|
ref: ref,
|
|
740
608
|
id: id,
|
|
741
609
|
onChange: onMyChange,
|
|
@@ -753,15 +621,12 @@ function MyInput(_ref) {
|
|
|
753
621
|
onMouseUp: onMyMouseUp,
|
|
754
622
|
onMouseEnter: onMyMouseEnter,
|
|
755
623
|
onMouseLeave: onMyMouseLeave
|
|
756
|
-
})
|
|
757
|
-
|
|
758
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
624
|
+
}),
|
|
625
|
+
[MyInputType.SELECT]: () => /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
759
626
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("select", {
|
|
760
627
|
ref: ref,
|
|
761
628
|
id: id,
|
|
762
|
-
onChange:
|
|
763
|
-
return onMyChange(e);
|
|
764
|
-
},
|
|
629
|
+
onChange: e => onMyChange(e),
|
|
765
630
|
value: myValue && !isNaN(myValue) ? MyInputIsNumeric(myValue) ? parseInt(myValue) : myValue : "",
|
|
766
631
|
style: style,
|
|
767
632
|
onBlur: onMyBlur,
|
|
@@ -773,29 +638,26 @@ function MyInput(_ref) {
|
|
|
773
638
|
onMouseUp: onMyMouseUp,
|
|
774
639
|
onMouseEnter: onMyMouseEnter,
|
|
775
640
|
onMouseLeave: onMyMouseLeave,
|
|
776
|
-
children: options && options.map(
|
|
641
|
+
children: options && options.map(e => {
|
|
777
642
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
778
643
|
value: MyInputIsNumeric(e[options_key_value]) ? parseInt(e[options_key_value]) : e[options_key_value],
|
|
779
644
|
children: e[options_key_text] || e["label"]
|
|
780
645
|
}, e[options_key_value]);
|
|
781
646
|
})
|
|
782
647
|
}), !myValue && !options && (placeholder || myTitleLite) && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
783
|
-
className: _MyInputModule
|
|
648
|
+
className: _MyInputModule.default.placeholder,
|
|
784
649
|
children: placeholder ? placeholder : myTitleLite
|
|
785
650
|
})]
|
|
786
|
-
})
|
|
787
|
-
|
|
788
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
651
|
+
}),
|
|
652
|
+
[MyInputType.SELECTFILTER]: () => /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
789
653
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
790
654
|
ref: ref,
|
|
791
655
|
id: "mySelectFilterInput" + (id ? id : myInputId),
|
|
792
656
|
type: "text",
|
|
793
|
-
className: _MyInputModule
|
|
657
|
+
className: _MyInputModule.default.filterInput,
|
|
794
658
|
style: style,
|
|
795
659
|
value: filtertext,
|
|
796
|
-
onChange:
|
|
797
|
-
return setFiltertext(e.target.value);
|
|
798
|
-
},
|
|
660
|
+
onChange: e => setFiltertext(e.target.value),
|
|
799
661
|
placeholder: placeholdersearchtext && placeholdersearchtext != "" ? placeholdersearchtext : (placeholder ? placeholder : myTitleLite) + " ...",
|
|
800
662
|
onBlur: onMyBlur,
|
|
801
663
|
onFocus: onMyFocus,
|
|
@@ -807,42 +669,38 @@ function MyInput(_ref) {
|
|
|
807
669
|
onMouseEnter: onMyMouseEnter,
|
|
808
670
|
onMouseLeave: onMyMouseLeave
|
|
809
671
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
810
|
-
className: _MyInputModule
|
|
672
|
+
className: _MyInputModule.default.filterInputSelectedContainer + " " + (myValue ? _MyInputModule.default.filterInputSelectedContainerSelected : ''),
|
|
811
673
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
812
674
|
id: "mySelectFilterSelected" + (id ? id : myInputId),
|
|
813
|
-
className: _MyInputModule
|
|
675
|
+
className: _MyInputModule.default.filterInputSelected,
|
|
814
676
|
dangerouslySetInnerHTML: {
|
|
815
677
|
__html: getMyValueText()
|
|
816
678
|
}
|
|
817
679
|
}), myValue && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
818
|
-
className: _MyInputModule
|
|
819
|
-
onClick:
|
|
820
|
-
return setMyValue(null);
|
|
821
|
-
},
|
|
680
|
+
className: _MyInputModule.default.filterInputSelectedX,
|
|
681
|
+
onClick: () => setMyValue(null),
|
|
822
682
|
title: t("Seçimi Kaldır"),
|
|
823
683
|
children: "x"
|
|
824
684
|
}) || "", /*#__PURE__*/(0, _jsxRuntime.jsx)(_pi.PiCaretDownBold, {
|
|
825
|
-
className: _MyInputModule
|
|
685
|
+
className: _MyInputModule.default.caretdown
|
|
826
686
|
})]
|
|
827
687
|
}), !myValue && (placeholder || myTitleLite) && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
828
|
-
className: _MyInputModule
|
|
688
|
+
className: _MyInputModule.default.placeholder,
|
|
829
689
|
children: placeholder ? placeholder : myTitleLite
|
|
830
690
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
|
|
831
691
|
id: "mySelectFilterList" + (id ? id : myInputId),
|
|
832
|
-
className: _MyInputModule
|
|
833
|
-
children: options && getFilterOptions().map(
|
|
692
|
+
className: _MyInputModule.default.filterInputList,
|
|
693
|
+
children: options && getFilterOptions().map(item => {
|
|
834
694
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("li", {
|
|
835
695
|
value: MyInputIsNumeric(item[options_key_value]) ? parseInt(item[options_key_value]) : item[options_key_value],
|
|
836
|
-
onClick:
|
|
837
|
-
|
|
838
|
-
},
|
|
839
|
-
className: item[options_key_subtext] ? _MyInputModule["default"].subtextli : '',
|
|
696
|
+
onClick: () => mySelectFilterListClick(item),
|
|
697
|
+
className: item[options_key_subtext] ? _MyInputModule.default.subtextli : '',
|
|
840
698
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
841
699
|
dangerouslySetInnerHTML: {
|
|
842
700
|
__html: item[options_key_text] || item["label"]
|
|
843
701
|
}
|
|
844
702
|
}), item[options_key_subtext] && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
845
|
-
className: _MyInputModule
|
|
703
|
+
className: _MyInputModule.default.subtext,
|
|
846
704
|
children: item[options_key_subtext]
|
|
847
705
|
})]
|
|
848
706
|
}, item[options_key_value]);
|
|
@@ -853,11 +711,9 @@ function MyInput(_ref) {
|
|
|
853
711
|
},
|
|
854
712
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("select", {
|
|
855
713
|
id: "mySelectFilterHiddenSelect" + myInputId,
|
|
856
|
-
onChange:
|
|
857
|
-
return onMyChange(e);
|
|
858
|
-
},
|
|
714
|
+
onChange: e => onMyChange(e),
|
|
859
715
|
value: myValue && !isNaN(myValue) ? MyInputIsNumeric(myValue) ? parseInt(myValue) : myValue : "",
|
|
860
|
-
children: options && options.map(
|
|
716
|
+
children: options && options.map(item => {
|
|
861
717
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
862
718
|
value: MyInputIsNumeric(item[options_key_value]) ? parseInt(item[options_key_value]) : item[options_key_value],
|
|
863
719
|
children: item[options_key_text] || item["label"]
|
|
@@ -865,75 +721,71 @@ function MyInput(_ref) {
|
|
|
865
721
|
})
|
|
866
722
|
})
|
|
867
723
|
})]
|
|
868
|
-
})
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
children: [function () {
|
|
724
|
+
}),
|
|
725
|
+
[MyInputType.FILE]: () => /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
726
|
+
className: _MyInputModule.default.fileinput,
|
|
727
|
+
children: [(() => {
|
|
873
728
|
// Dosya önizleme gösterimi için kontrol
|
|
874
729
|
if (myValue && (type === MyInputType.IMAGE || accept === '.jpg,.jpeg,.png')) {
|
|
875
730
|
if (Array.isArray(myValue) && myValue.length === 1 && getFileImageControl(myValue[0].filename)) {
|
|
876
731
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
877
732
|
src: myValue[0].base64,
|
|
878
|
-
className: _MyInputModule
|
|
733
|
+
className: _MyInputModule.default.fileImagePreview,
|
|
879
734
|
alt: "Preview"
|
|
880
735
|
});
|
|
881
736
|
} else if (getFileImageControl(myValue)) {
|
|
882
737
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
883
738
|
src: myValue,
|
|
884
|
-
className: _MyInputModule
|
|
739
|
+
className: _MyInputModule.default.fileImagePreview,
|
|
885
740
|
alt: "Preview"
|
|
886
741
|
});
|
|
887
742
|
}
|
|
888
743
|
}
|
|
889
744
|
return null;
|
|
890
|
-
}(), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
891
|
-
className: _MyInputModule
|
|
745
|
+
})(), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
746
|
+
className: _MyInputModule.default.filename + " " + (myFileName && _MyInputModule.default.selected),
|
|
892
747
|
dangerouslySetInnerHTML: {
|
|
893
748
|
__html: myFileName || (placeholder ? placeholder : t(type === MyInputType.IMAGE ? "Görsel Seçiniz" : "Dosya Seçiniz"))
|
|
894
749
|
}
|
|
895
|
-
}),
|
|
750
|
+
}), (() => {
|
|
896
751
|
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
752
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
898
753
|
type: "button",
|
|
899
754
|
onClick: onRemoveImageClick,
|
|
900
|
-
className: _MyInputModule
|
|
755
|
+
className: _MyInputModule.default.filebuttonremove,
|
|
901
756
|
title: t("Kaldır"),
|
|
902
757
|
children: "x"
|
|
903
758
|
});
|
|
904
759
|
}
|
|
905
760
|
return null;
|
|
906
|
-
}(), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
761
|
+
})(), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
907
762
|
type: "button",
|
|
908
|
-
onClick:
|
|
909
|
-
|
|
910
|
-
},
|
|
911
|
-
className: _MyInputModule["default"].filebutton,
|
|
763
|
+
onClick: () => fileInputRef.current.click(),
|
|
764
|
+
className: _MyInputModule.default.filebutton,
|
|
912
765
|
children: type === MyInputType.IMAGE ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_pi.PiImage, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_md.MdOutlineAttachFile, {})
|
|
913
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input",
|
|
766
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
914
767
|
type: "file",
|
|
915
768
|
ref: fileInputRef,
|
|
916
|
-
onChange:
|
|
917
|
-
return onMyChange(e);
|
|
918
|
-
},
|
|
769
|
+
onChange: e => onMyChange(e),
|
|
919
770
|
placeholder: placeholder || myTitleLite,
|
|
920
771
|
style: {
|
|
921
772
|
display: "none"
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
773
|
+
},
|
|
774
|
+
...(multiple ? {
|
|
775
|
+
multiple: true
|
|
776
|
+
} : {}),
|
|
926
777
|
accept: type === MyInputType.IMAGE ? '.jpg,.jpeg,.png' : accept
|
|
927
|
-
})
|
|
928
|
-
})
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
778
|
+
})]
|
|
779
|
+
}),
|
|
780
|
+
[MyInputType.IMAGE]: function () {
|
|
781
|
+
return this[MyInputType.FILE]();
|
|
782
|
+
}
|
|
783
|
+
};
|
|
784
|
+
return inputTypes[type]?.() || null;
|
|
933
785
|
};
|
|
934
786
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
935
787
|
id: "myinput" + myInputId,
|
|
936
|
-
className: _MyInputModule
|
|
788
|
+
className: _MyInputModule.default.container + " " + (className != null ? className : '') + " " + (isError ? _MyInputModule.default.error : ''),
|
|
937
789
|
title: title && myTitleLite || placeholder && placeholder,
|
|
938
790
|
style: style && style.width && {
|
|
939
791
|
display: 'inline-block'
|
|
@@ -945,18 +797,20 @@ function MyInput(_ref) {
|
|
|
945
797
|
__html: title
|
|
946
798
|
}
|
|
947
799
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
948
|
-
className: _MyInputModule
|
|
949
|
-
style: style &&
|
|
950
|
-
|
|
951
|
-
|
|
800
|
+
className: _MyInputModule.default.inputblock + " " + (disabled || type === MyInputType.READONLY ? _MyInputModule.default.inputblockdisabled : '') + " " + (icon || type === MyInputType.IMAGE ? _MyInputModule.default.inputblockicon : ''),
|
|
801
|
+
style: style && {
|
|
802
|
+
...(style.backgroundColor && {
|
|
803
|
+
backgroundColor: style.backgroundColor
|
|
804
|
+
})
|
|
805
|
+
},
|
|
952
806
|
children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
953
|
-
className:
|
|
807
|
+
className: `${_MyInputModule.default.icon} ${type === MyInputType.TEXTAREA || rows > 0 ? _MyInputModule.default.icontextarea : ''}`,
|
|
954
808
|
children: icon
|
|
955
809
|
}), renderInput()]
|
|
956
810
|
}), description && /*#__PURE__*/(0, _jsxRuntime.jsx)("small", {
|
|
957
|
-
className: _MyInputModule
|
|
811
|
+
className: _MyInputModule.default.description,
|
|
958
812
|
children: description
|
|
959
813
|
})]
|
|
960
814
|
});
|
|
961
815
|
}
|
|
962
|
-
var _default = exports
|
|
816
|
+
var _default = exports.default = MyInput;
|