funda-ui 4.4.15 → 4.5.12
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/Date/index.js +1078 -77
- package/EventCalendar/index.css +114 -114
- package/EventCalendar/index.d.ts +1 -0
- package/EventCalendar/index.js +124 -86
- package/EventCalendarTimeline/index.css +274 -270
- package/EventCalendarTimeline/index.d.ts +3 -0
- package/EventCalendarTimeline/index.js +673 -225
- package/Input/index.d.ts +7 -0
- package/Input/index.js +699 -57
- package/MasonryLayout/index.js +11 -1
- package/MultipleCheckboxes/index.js +11 -11
- package/MultipleSelect/index.d.ts +1 -0
- package/MultipleSelect/index.js +18 -16
- package/NativeSelect/index.js +11 -11
- package/Radio/index.js +11 -11
- package/RangeSlider/index.js +1078 -77
- package/Select/index.js +45 -13
- package/Table/index.css +1 -0
- package/Table/index.js +36 -7
- package/TagInput/index.d.ts +1 -0
- package/TagInput/index.js +20 -2
- package/Textarea/index.d.ts +7 -0
- package/Textarea/index.js +707 -10
- package/Tree/index.js +13 -11
- package/Utils/inputsCalculation.d.ts +18 -1
- package/Utils/inputsCalculation.js +26 -0
- package/Utils/object.js +11 -11
- package/Utils/os.d.ts +2 -0
- package/Utils/os.js +104 -0
- package/lib/cjs/Date/index.js +1078 -77
- package/lib/cjs/EventCalendar/index.d.ts +1 -0
- package/lib/cjs/EventCalendar/index.js +124 -86
- package/lib/cjs/EventCalendarTimeline/index.d.ts +3 -0
- package/lib/cjs/EventCalendarTimeline/index.js +673 -225
- package/lib/cjs/Input/index.d.ts +7 -0
- package/lib/cjs/Input/index.js +699 -57
- package/lib/cjs/MasonryLayout/index.js +11 -1
- package/lib/cjs/MultipleCheckboxes/index.js +11 -11
- package/lib/cjs/MultipleSelect/index.d.ts +1 -0
- package/lib/cjs/MultipleSelect/index.js +18 -16
- package/lib/cjs/NativeSelect/index.js +11 -11
- package/lib/cjs/Radio/index.js +11 -11
- package/lib/cjs/RangeSlider/index.js +1078 -77
- package/lib/cjs/Select/index.js +45 -13
- package/lib/cjs/Table/index.js +36 -7
- package/lib/cjs/TagInput/index.d.ts +1 -0
- package/lib/cjs/TagInput/index.js +20 -2
- package/lib/cjs/Textarea/index.d.ts +7 -0
- package/lib/cjs/Textarea/index.js +707 -10
- package/lib/cjs/Tree/index.js +13 -11
- package/lib/cjs/Utils/inputsCalculation.d.ts +18 -1
- package/lib/cjs/Utils/inputsCalculation.js +26 -0
- package/lib/cjs/Utils/object.js +11 -11
- package/lib/cjs/Utils/os.d.ts +2 -0
- package/lib/cjs/Utils/os.js +104 -0
- package/lib/css/EventCalendar/index.css +114 -114
- package/lib/css/EventCalendarTimeline/index.css +274 -270
- package/lib/css/Table/index.css +1 -0
- package/lib/esm/EventCalendar/index.scss +81 -81
- package/lib/esm/EventCalendar/index.tsx +144 -104
- package/lib/esm/EventCalendarTimeline/index.scss +226 -221
- package/lib/esm/EventCalendarTimeline/index.tsx +791 -517
- package/lib/esm/Input/index.tsx +299 -77
- package/lib/esm/MasonryLayout/index.tsx +9 -2
- package/lib/esm/ModalDialog/index.tsx +0 -1
- package/lib/esm/MultipleSelect/index.tsx +6 -4
- package/lib/esm/Table/Table.tsx +0 -1
- package/lib/esm/Table/index.scss +2 -0
- package/lib/esm/Table/utils/hooks/useTableDraggable.tsx +47 -6
- package/lib/esm/TagInput/index.tsx +23 -1
- package/lib/esm/Textarea/index.tsx +332 -39
- package/lib/esm/Tree/TreeList.tsx +4 -1
- package/lib/esm/Tree/index.tsx +1 -0
- package/lib/esm/Utils/libs/inputsCalculation.ts +60 -31
- package/lib/esm/Utils/libs/object.ts +67 -67
- package/lib/esm/Utils/libs/os.ts +63 -0
- package/package.json +1 -1
package/Date/index.js
CHANGED
|
@@ -280,8 +280,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
280
280
|
/***/
|
|
281
281
|
},
|
|
282
282
|
|
|
283
|
-
/***/
|
|
284
|
-
/* module decorator */module =
|
|
283
|
+
/***/954: /***/function _(module, exports, __nested_webpack_require_11464__) {
|
|
284
|
+
/* module decorator */module = __nested_webpack_require_11464__.nmd(module);
|
|
285
285
|
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
|
|
286
286
|
function _typeof(obj) {
|
|
287
287
|
"@babel/helpers - typeof";
|
|
@@ -293,7 +293,241 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
293
293
|
}, _typeof(obj);
|
|
294
294
|
}
|
|
295
295
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
296
|
-
if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory(
|
|
296
|
+
if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory();else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
|
|
297
|
+
})(this, function () {
|
|
298
|
+
return (/******/function () {
|
|
299
|
+
// webpackBootstrap
|
|
300
|
+
/******/
|
|
301
|
+
"use strict";
|
|
302
|
+
|
|
303
|
+
/******/ // The require scope
|
|
304
|
+
/******/
|
|
305
|
+
var __nested_webpack_require_987__ = {};
|
|
306
|
+
/******/
|
|
307
|
+
/************************************************************************/
|
|
308
|
+
/******/ /* webpack/runtime/define property getters */
|
|
309
|
+
/******/
|
|
310
|
+
(function () {
|
|
311
|
+
/******/ // define getter functions for harmony exports
|
|
312
|
+
/******/__nested_webpack_require_987__.d = function (exports, definition) {
|
|
313
|
+
/******/for (var key in definition) {
|
|
314
|
+
/******/if (__nested_webpack_require_987__.o(definition, key) && !__nested_webpack_require_987__.o(exports, key)) {
|
|
315
|
+
/******/Object.defineProperty(exports, key, {
|
|
316
|
+
enumerable: true,
|
|
317
|
+
get: definition[key]
|
|
318
|
+
});
|
|
319
|
+
/******/
|
|
320
|
+
}
|
|
321
|
+
/******/
|
|
322
|
+
}
|
|
323
|
+
/******/
|
|
324
|
+
};
|
|
325
|
+
/******/
|
|
326
|
+
})();
|
|
327
|
+
/******/
|
|
328
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
329
|
+
/******/
|
|
330
|
+
(function () {
|
|
331
|
+
/******/__nested_webpack_require_987__.o = function (obj, prop) {
|
|
332
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
333
|
+
};
|
|
334
|
+
/******/
|
|
335
|
+
})();
|
|
336
|
+
/******/
|
|
337
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
338
|
+
/******/
|
|
339
|
+
(function () {
|
|
340
|
+
/******/ // define __esModule on exports
|
|
341
|
+
/******/__nested_webpack_require_987__.r = function (exports) {
|
|
342
|
+
/******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
343
|
+
/******/Object.defineProperty(exports, Symbol.toStringTag, {
|
|
344
|
+
value: 'Module'
|
|
345
|
+
});
|
|
346
|
+
/******/
|
|
347
|
+
}
|
|
348
|
+
/******/
|
|
349
|
+
Object.defineProperty(exports, '__esModule', {
|
|
350
|
+
value: true
|
|
351
|
+
});
|
|
352
|
+
/******/
|
|
353
|
+
};
|
|
354
|
+
/******/
|
|
355
|
+
})();
|
|
356
|
+
/******/
|
|
357
|
+
/************************************************************************/
|
|
358
|
+
var __webpack_exports__ = {};
|
|
359
|
+
__nested_webpack_require_987__.r(__webpack_exports__);
|
|
360
|
+
/* harmony export */
|
|
361
|
+
__nested_webpack_require_987__.d(__webpack_exports__, {
|
|
362
|
+
/* harmony export */"actualPropertyValue": function actualPropertyValue() {
|
|
363
|
+
return (/* binding */_actualPropertyValue
|
|
364
|
+
);
|
|
365
|
+
},
|
|
366
|
+
/* harmony export */"getTextTop": function getTextTop() {
|
|
367
|
+
return (/* binding */_getTextTop
|
|
368
|
+
);
|
|
369
|
+
},
|
|
370
|
+
/* harmony export */"getTextWidth": function getTextWidth() {
|
|
371
|
+
return (/* binding */_getTextWidth
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
/* harmony export */
|
|
375
|
+
});
|
|
376
|
+
/**
|
|
377
|
+
* Gets the relative upside of the text
|
|
378
|
+
* @param {Element} el - A DOM node containing one selector to match against.
|
|
379
|
+
* @returns {Number} - Returns a pure number.
|
|
380
|
+
*/
|
|
381
|
+
function _getTextTop(el) {
|
|
382
|
+
var styles = window.getComputedStyle(el);
|
|
383
|
+
var fontSize = parseFloat(styles.fontSize);
|
|
384
|
+
var lineHeight = parseFloat(styles.lineHeight) || fontSize;
|
|
385
|
+
var paddingTop = parseFloat(styles.paddingTop);
|
|
386
|
+
var borderWidth = parseFloat(styles.borderWidth);
|
|
387
|
+
var textTop = paddingTop + (lineHeight - fontSize) / 2 - borderWidth * 2;
|
|
388
|
+
return textTop;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Get the actual value with user specific methed
|
|
393
|
+
* it can be 'width', 'height', 'outerWidth', 'outerHeight'
|
|
394
|
+
* @private
|
|
395
|
+
* @param {Element} el - A DOM node containing one selector to match against.
|
|
396
|
+
* @param {String} prop - A string naming the property of style.
|
|
397
|
+
* @param {?Json} config - Whether or not margin is included. The key `includeMargin`
|
|
398
|
+
takes effect when set to true
|
|
399
|
+
* @return {Number} - Returns a pure number.
|
|
400
|
+
*/
|
|
401
|
+
function _actualPropertyValue(el, prop) {
|
|
402
|
+
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
403
|
+
if (el === null) return 0;
|
|
404
|
+
var style = window.getComputedStyle ? window.getComputedStyle(el) : el.currentStyle,
|
|
405
|
+
display = style.display,
|
|
406
|
+
position = style.position,
|
|
407
|
+
visibility = style.visibility;
|
|
408
|
+
var marginWidth = 0;
|
|
409
|
+
var marginHeight = 0;
|
|
410
|
+
var maxVal;
|
|
411
|
+
var actualVal;
|
|
412
|
+
if (config && config.includeMargin === true) {
|
|
413
|
+
marginWidth = parseFloat(style.marginLeft) + parseFloat(style.marginRight);
|
|
414
|
+
marginHeight = parseFloat(style.marginTop) + parseFloat(style.marginBottom);
|
|
415
|
+
}
|
|
416
|
+
if (prop === 'fontSize') {
|
|
417
|
+
actualVal = parseFloat(style.fontSize);
|
|
418
|
+
}
|
|
419
|
+
if (prop === 'fontFamily') {
|
|
420
|
+
actualVal = style.fontFamily;
|
|
421
|
+
}
|
|
422
|
+
if (prop === 'letterSpacing') {
|
|
423
|
+
actualVal = style.letterSpacing;
|
|
424
|
+
}
|
|
425
|
+
if (prop === 'width') {
|
|
426
|
+
maxVal = parseFloat(style.maxWidth);
|
|
427
|
+
|
|
428
|
+
// if its not hidden we just return normal height
|
|
429
|
+
if (display !== 'none' && maxVal !== 0) {
|
|
430
|
+
return el.clientWidth;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
if (prop === 'height') {
|
|
434
|
+
maxVal = parseFloat(style.maxHeight);
|
|
435
|
+
if (display !== 'none' && maxVal !== 0) {
|
|
436
|
+
return el.clientHeight;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
if (prop === 'outerWidth') {
|
|
440
|
+
maxVal = parseFloat(style.maxWidth);
|
|
441
|
+
if (display !== 'none' && maxVal !== 0) {
|
|
442
|
+
return el.offsetWidth + marginWidth;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
if (prop === 'outerHeight') {
|
|
446
|
+
maxVal = parseFloat(style.maxHeight);
|
|
447
|
+
if (display !== 'none' && maxVal !== 0) {
|
|
448
|
+
return el.offsetHeight + marginHeight;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
// the element is hidden so:
|
|
453
|
+
// making the el block so we can meassure its height but still be hidden
|
|
454
|
+
el.style.position = 'absolute';
|
|
455
|
+
el.style.visibility = 'hidden';
|
|
456
|
+
el.style.display = 'block';
|
|
457
|
+
if (prop === 'width') actualVal = el.clientWidth;
|
|
458
|
+
if (prop === 'height') actualVal = el.clientHeight;
|
|
459
|
+
if (prop === 'outerWidth') actualVal = el.offsetWidth + marginWidth;
|
|
460
|
+
if (prop === 'outerHeight') actualVal = el.offsetHeight + marginHeight;
|
|
461
|
+
|
|
462
|
+
// reverting to the original values
|
|
463
|
+
el.style.display = display;
|
|
464
|
+
el.style.position = position;
|
|
465
|
+
el.style.visibility = visibility;
|
|
466
|
+
return actualVal;
|
|
467
|
+
}
|
|
468
|
+
function getElCSS(input, prop, isNumber) {
|
|
469
|
+
var _document$defaultView;
|
|
470
|
+
var val = (_document$defaultView = document.defaultView) === null || _document$defaultView === void 0 ? void 0 : _document$defaultView.getComputedStyle(input, null).getPropertyValue(prop);
|
|
471
|
+
return isNumber ? isNaN(parseFloat(val)) ? 0 : parseFloat(val) : val;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Get cursor or text position in pixels for input element
|
|
476
|
+
*
|
|
477
|
+
* @param {HTMLInputElement} input Required HTMLElement with `value` attribute
|
|
478
|
+
* @param {HTMLSpanElement} fauxContainer Container of faux.
|
|
479
|
+
* @param {HTMLElement} rawTextContainer The raw text container for the comparison
|
|
480
|
+
* @returns {Number}
|
|
481
|
+
*/
|
|
482
|
+
|
|
483
|
+
function _getTextWidth(input, fauxContainer, rawTextContainer) {
|
|
484
|
+
if (input === null || fauxContainer === null || rawTextContainer === null) return 0;
|
|
485
|
+
var _off = input.selectionStart;
|
|
486
|
+
var _faux = fauxContainer;
|
|
487
|
+
var _fauxContainer = rawTextContainer;
|
|
488
|
+
if (_faux && _fauxContainer) {
|
|
489
|
+
// Styles to simulate a node in an input field
|
|
490
|
+
// use pre-wrap instead of wrap for white-space to support wrapping in textareas
|
|
491
|
+
var listOfModifiers = ['direction', 'font-family', 'font-size', 'font-size-adjust', 'font-variant', 'font-weight', 'font-style', 'letter-spacing', 'line-height', 'text-align', 'text-indent', 'text-transform', 'word-wrap', 'word-spacing'];
|
|
492
|
+
|
|
493
|
+
// default styles
|
|
494
|
+
_faux.style.setProperty('white-space', 'pre-wrap');
|
|
495
|
+
_faux.style.setProperty('padding', '0');
|
|
496
|
+
_faux.style.setProperty('margin', '0');
|
|
497
|
+
_faux.style.setProperty('display', 'none');
|
|
498
|
+
for (var i = 0; i < listOfModifiers.length; i++) {
|
|
499
|
+
var propertyValue = getElCSS(_fauxContainer, listOfModifiers[i], false);
|
|
500
|
+
_faux.style.setProperty(listOfModifiers[i], propertyValue);
|
|
501
|
+
}
|
|
502
|
+
_faux.textContent = input.value.substring(0, _off).replace(/\s/g, "\xA0");
|
|
503
|
+
return _actualPropertyValue(_faux, 'outerWidth');
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/******/
|
|
508
|
+
return __webpack_exports__;
|
|
509
|
+
/******/
|
|
510
|
+
}()
|
|
511
|
+
);
|
|
512
|
+
});
|
|
513
|
+
|
|
514
|
+
/***/
|
|
515
|
+
},
|
|
516
|
+
|
|
517
|
+
/***/85: /***/function _(module, exports, __nested_webpack_require_23494__) {
|
|
518
|
+
/* module decorator */module = __nested_webpack_require_23494__.nmd(module);
|
|
519
|
+
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
|
|
520
|
+
function _typeof(obj) {
|
|
521
|
+
"@babel/helpers - typeof";
|
|
522
|
+
|
|
523
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
524
|
+
return typeof obj;
|
|
525
|
+
} : function (obj) {
|
|
526
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
527
|
+
}, _typeof(obj);
|
|
528
|
+
}
|
|
529
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
530
|
+
if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory(__nested_webpack_require_23494__(787));else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__nested_webpack_require_23494__(787)], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
|
|
297
531
|
})(this, function (__WEBPACK_EXTERNAL_MODULE__787__) {
|
|
298
532
|
return (/******/function () {
|
|
299
533
|
// webpackBootstrap
|
|
@@ -453,6 +687,203 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
453
687
|
/***/
|
|
454
688
|
},
|
|
455
689
|
|
|
690
|
+
/***/702: /***/function _(module, exports, __nested_webpack_require_31582__) {
|
|
691
|
+
/* module decorator */module = __nested_webpack_require_31582__.nmd(module);
|
|
692
|
+
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
|
|
693
|
+
function _typeof(obj) {
|
|
694
|
+
"@babel/helpers - typeof";
|
|
695
|
+
|
|
696
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
697
|
+
return typeof obj;
|
|
698
|
+
} : function (obj) {
|
|
699
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
700
|
+
}, _typeof(obj);
|
|
701
|
+
}
|
|
702
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
703
|
+
if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory(__nested_webpack_require_31582__(787));else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__nested_webpack_require_31582__(787)], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
|
|
704
|
+
})(this, function (__WEBPACK_EXTERNAL_MODULE__787__) {
|
|
705
|
+
return (/******/function () {
|
|
706
|
+
// webpackBootstrap
|
|
707
|
+
/******/
|
|
708
|
+
"use strict";
|
|
709
|
+
|
|
710
|
+
/******/
|
|
711
|
+
var __webpack_modules__ = {
|
|
712
|
+
/***/787: /***/function _(module) {
|
|
713
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
|
|
714
|
+
|
|
715
|
+
/***/
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
/******/
|
|
719
|
+
};
|
|
720
|
+
/************************************************************************/
|
|
721
|
+
/******/ // The module cache
|
|
722
|
+
/******/
|
|
723
|
+
var __webpack_module_cache__ = {};
|
|
724
|
+
/******/
|
|
725
|
+
/******/ // The require function
|
|
726
|
+
/******/
|
|
727
|
+
function __nested_webpack_require_1465__(moduleId) {
|
|
728
|
+
/******/ // Check if module is in cache
|
|
729
|
+
/******/var cachedModule = __webpack_module_cache__[moduleId];
|
|
730
|
+
/******/
|
|
731
|
+
if (cachedModule !== undefined) {
|
|
732
|
+
/******/return cachedModule.exports;
|
|
733
|
+
/******/
|
|
734
|
+
}
|
|
735
|
+
/******/ // Create a new module (and put it into the cache)
|
|
736
|
+
/******/
|
|
737
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
738
|
+
/******/ // no module.id needed
|
|
739
|
+
/******/ // no module.loaded needed
|
|
740
|
+
/******/exports: {}
|
|
741
|
+
/******/
|
|
742
|
+
};
|
|
743
|
+
/******/
|
|
744
|
+
/******/ // Execute the module function
|
|
745
|
+
/******/
|
|
746
|
+
__webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_1465__);
|
|
747
|
+
/******/
|
|
748
|
+
/******/ // Return the exports of the module
|
|
749
|
+
/******/
|
|
750
|
+
return module.exports;
|
|
751
|
+
/******/
|
|
752
|
+
}
|
|
753
|
+
/******/
|
|
754
|
+
/************************************************************************/
|
|
755
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
756
|
+
/******/
|
|
757
|
+
(function () {
|
|
758
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
759
|
+
/******/__nested_webpack_require_1465__.n = function (module) {
|
|
760
|
+
/******/var getter = module && module.__esModule ? /******/function () {
|
|
761
|
+
return module['default'];
|
|
762
|
+
} : /******/function () {
|
|
763
|
+
return module;
|
|
764
|
+
};
|
|
765
|
+
/******/
|
|
766
|
+
__nested_webpack_require_1465__.d(getter, {
|
|
767
|
+
a: getter
|
|
768
|
+
});
|
|
769
|
+
/******/
|
|
770
|
+
return getter;
|
|
771
|
+
/******/
|
|
772
|
+
};
|
|
773
|
+
/******/
|
|
774
|
+
})();
|
|
775
|
+
/******/
|
|
776
|
+
/******/ /* webpack/runtime/define property getters */
|
|
777
|
+
/******/
|
|
778
|
+
(function () {
|
|
779
|
+
/******/ // define getter functions for harmony exports
|
|
780
|
+
/******/__nested_webpack_require_1465__.d = function (exports, definition) {
|
|
781
|
+
/******/for (var key in definition) {
|
|
782
|
+
/******/if (__nested_webpack_require_1465__.o(definition, key) && !__nested_webpack_require_1465__.o(exports, key)) {
|
|
783
|
+
/******/Object.defineProperty(exports, key, {
|
|
784
|
+
enumerable: true,
|
|
785
|
+
get: definition[key]
|
|
786
|
+
});
|
|
787
|
+
/******/
|
|
788
|
+
}
|
|
789
|
+
/******/
|
|
790
|
+
}
|
|
791
|
+
/******/
|
|
792
|
+
};
|
|
793
|
+
/******/
|
|
794
|
+
})();
|
|
795
|
+
/******/
|
|
796
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
797
|
+
/******/
|
|
798
|
+
(function () {
|
|
799
|
+
/******/__nested_webpack_require_1465__.o = function (obj, prop) {
|
|
800
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
801
|
+
};
|
|
802
|
+
/******/
|
|
803
|
+
})();
|
|
804
|
+
/******/
|
|
805
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
806
|
+
/******/
|
|
807
|
+
(function () {
|
|
808
|
+
/******/ // define __esModule on exports
|
|
809
|
+
/******/__nested_webpack_require_1465__.r = function (exports) {
|
|
810
|
+
/******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
811
|
+
/******/Object.defineProperty(exports, Symbol.toStringTag, {
|
|
812
|
+
value: 'Module'
|
|
813
|
+
});
|
|
814
|
+
/******/
|
|
815
|
+
}
|
|
816
|
+
/******/
|
|
817
|
+
Object.defineProperty(exports, '__esModule', {
|
|
818
|
+
value: true
|
|
819
|
+
});
|
|
820
|
+
/******/
|
|
821
|
+
};
|
|
822
|
+
/******/
|
|
823
|
+
})();
|
|
824
|
+
/******/
|
|
825
|
+
/************************************************************************/
|
|
826
|
+
var __webpack_exports__ = {};
|
|
827
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
828
|
+
(function () {
|
|
829
|
+
__nested_webpack_require_1465__.r(__webpack_exports__);
|
|
830
|
+
/* harmony export */
|
|
831
|
+
__nested_webpack_require_1465__.d(__webpack_exports__, {
|
|
832
|
+
/* harmony export */"default": function _default() {
|
|
833
|
+
return __WEBPACK_DEFAULT_EXPORT__;
|
|
834
|
+
}
|
|
835
|
+
/* harmony export */
|
|
836
|
+
});
|
|
837
|
+
/* harmony import */
|
|
838
|
+
var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1465__(787);
|
|
839
|
+
/* harmony import */
|
|
840
|
+
var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1465__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
841
|
+
/**
|
|
842
|
+
* Delay the execution of function or state update
|
|
843
|
+
*
|
|
844
|
+
* @usage:
|
|
845
|
+
|
|
846
|
+
const App = () => {
|
|
847
|
+
const [count, setCount] = useState(0);
|
|
848
|
+
const handleClick = useDebounce(() => setCount(count + 1), 500, [count]);
|
|
849
|
+
|
|
850
|
+
return (
|
|
851
|
+
<div className="app">
|
|
852
|
+
<button onClick={handleClick}>click</button>
|
|
853
|
+
<p>click {count} time</p>
|
|
854
|
+
</div>
|
|
855
|
+
);
|
|
856
|
+
};
|
|
857
|
+
|
|
858
|
+
*/
|
|
859
|
+
|
|
860
|
+
var useDebounce = function useDebounce(fn, delay, dependence) {
|
|
861
|
+
var ref = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
862
|
+
return (0, react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
|
863
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
864
|
+
args[_key] = arguments[_key];
|
|
865
|
+
}
|
|
866
|
+
clearTimeout(ref.current);
|
|
867
|
+
ref.current = null;
|
|
868
|
+
ref.current = setTimeout(function () {
|
|
869
|
+
fn.apply(void 0, args);
|
|
870
|
+
}, delay);
|
|
871
|
+
}, dependence);
|
|
872
|
+
};
|
|
873
|
+
/* harmony default export */
|
|
874
|
+
var __WEBPACK_DEFAULT_EXPORT__ = useDebounce;
|
|
875
|
+
})();
|
|
876
|
+
|
|
877
|
+
/******/
|
|
878
|
+
return __webpack_exports__;
|
|
879
|
+
/******/
|
|
880
|
+
}()
|
|
881
|
+
);
|
|
882
|
+
});
|
|
883
|
+
|
|
884
|
+
/***/
|
|
885
|
+
},
|
|
886
|
+
|
|
456
887
|
/***/787: /***/function _(module) {
|
|
457
888
|
"use strict";
|
|
458
889
|
|
|
@@ -470,7 +901,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
470
901
|
/******/
|
|
471
902
|
/******/ // The require function
|
|
472
903
|
/******/
|
|
473
|
-
function
|
|
904
|
+
function __nested_webpack_require_41203__(moduleId) {
|
|
474
905
|
/******/ // Check if module is in cache
|
|
475
906
|
/******/var cachedModule = __webpack_module_cache__[moduleId];
|
|
476
907
|
/******/
|
|
@@ -489,7 +920,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
489
920
|
/******/
|
|
490
921
|
/******/ // Execute the module function
|
|
491
922
|
/******/
|
|
492
|
-
__webpack_modules__[moduleId].call(module.exports, module, module.exports,
|
|
923
|
+
__webpack_modules__[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_41203__);
|
|
493
924
|
/******/
|
|
494
925
|
/******/ // Flag the module as loaded
|
|
495
926
|
/******/
|
|
@@ -506,14 +937,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
506
937
|
/******/
|
|
507
938
|
(function () {
|
|
508
939
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
509
|
-
/******/
|
|
940
|
+
/******/__nested_webpack_require_41203__.n = function (module) {
|
|
510
941
|
/******/var getter = module && module.__esModule ? /******/function () {
|
|
511
942
|
return module['default'];
|
|
512
943
|
} : /******/function () {
|
|
513
944
|
return module;
|
|
514
945
|
};
|
|
515
946
|
/******/
|
|
516
|
-
|
|
947
|
+
__nested_webpack_require_41203__.d(getter, {
|
|
517
948
|
a: getter
|
|
518
949
|
});
|
|
519
950
|
/******/
|
|
@@ -527,9 +958,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
527
958
|
/******/
|
|
528
959
|
(function () {
|
|
529
960
|
/******/ // define getter functions for harmony exports
|
|
530
|
-
/******/
|
|
961
|
+
/******/__nested_webpack_require_41203__.d = function (exports, definition) {
|
|
531
962
|
/******/for (var key in definition) {
|
|
532
|
-
/******/if (
|
|
963
|
+
/******/if (__nested_webpack_require_41203__.o(definition, key) && !__nested_webpack_require_41203__.o(exports, key)) {
|
|
533
964
|
/******/Object.defineProperty(exports, key, {
|
|
534
965
|
enumerable: true,
|
|
535
966
|
get: definition[key]
|
|
@@ -546,7 +977,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
546
977
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
547
978
|
/******/
|
|
548
979
|
(function () {
|
|
549
|
-
/******/
|
|
980
|
+
/******/__nested_webpack_require_41203__.o = function (obj, prop) {
|
|
550
981
|
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
551
982
|
};
|
|
552
983
|
/******/
|
|
@@ -556,7 +987,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
556
987
|
/******/
|
|
557
988
|
(function () {
|
|
558
989
|
/******/ // define __esModule on exports
|
|
559
|
-
/******/
|
|
990
|
+
/******/__nested_webpack_require_41203__.r = function (exports) {
|
|
560
991
|
/******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
561
992
|
/******/Object.defineProperty(exports, Symbol.toStringTag, {
|
|
562
993
|
value: 'Module'
|
|
@@ -575,7 +1006,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
575
1006
|
/******/ /* webpack/runtime/node module decorator */
|
|
576
1007
|
/******/
|
|
577
1008
|
(function () {
|
|
578
|
-
/******/
|
|
1009
|
+
/******/__nested_webpack_require_41203__.nmd = function (module) {
|
|
579
1010
|
/******/module.paths = [];
|
|
580
1011
|
/******/
|
|
581
1012
|
if (!module.children) module.children = [];
|
|
@@ -592,27 +1023,360 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
592
1023
|
(function () {
|
|
593
1024
|
"use strict";
|
|
594
1025
|
|
|
595
|
-
|
|
1026
|
+
__nested_webpack_require_41203__.r(__webpack_exports__);
|
|
596
1027
|
/* harmony export */
|
|
597
|
-
|
|
1028
|
+
__nested_webpack_require_41203__.d(__webpack_exports__, {
|
|
598
1029
|
/* harmony export */"default": function _default() {
|
|
599
1030
|
return __WEBPACK_DEFAULT_EXPORT__;
|
|
600
1031
|
}
|
|
601
1032
|
/* harmony export */
|
|
602
1033
|
});
|
|
603
1034
|
/* harmony import */
|
|
604
|
-
var react__WEBPACK_IMPORTED_MODULE_0__ =
|
|
1035
|
+
var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_41203__(787);
|
|
1036
|
+
/* harmony import */
|
|
1037
|
+
var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_41203__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
1038
|
+
/* harmony import */
|
|
1039
|
+
var funda_utils_dist_cjs_useComId__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_41203__(85);
|
|
605
1040
|
/* harmony import */
|
|
606
|
-
var
|
|
1041
|
+
var funda_utils_dist_cjs_useComId__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_41203__.n(funda_utils_dist_cjs_useComId__WEBPACK_IMPORTED_MODULE_1__);
|
|
607
1042
|
/* harmony import */
|
|
608
|
-
var
|
|
1043
|
+
var funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_41203__(188);
|
|
609
1044
|
/* harmony import */
|
|
610
|
-
var
|
|
1045
|
+
var funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_41203__.n(funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__);
|
|
611
1046
|
/* harmony import */
|
|
612
|
-
var
|
|
1047
|
+
var funda_utils_dist_cjs_inputsCalculation__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_41203__(954);
|
|
613
1048
|
/* harmony import */
|
|
614
|
-
var
|
|
615
|
-
|
|
1049
|
+
var funda_utils_dist_cjs_inputsCalculation__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_41203__.n(funda_utils_dist_cjs_inputsCalculation__WEBPACK_IMPORTED_MODULE_3__);
|
|
1050
|
+
/* harmony import */
|
|
1051
|
+
var funda_utils_dist_cjs_useDebounce__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_41203__(702);
|
|
1052
|
+
/* harmony import */
|
|
1053
|
+
var funda_utils_dist_cjs_useDebounce__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_41203__.n(funda_utils_dist_cjs_useDebounce__WEBPACK_IMPORTED_MODULE_4__);
|
|
1054
|
+
var _excluded = ["contentRef", "wrapperClassName", "controlClassName", "controlExClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "type", "disabled", "required", "placeholder", "pattern", "readOnly", "defaultValue", "value", "requiredLabel", "label", "units", "name", "step", "min", "max", "src", "size", "minLength", "maxLength", "alt", "inputMode", "id", "appendControl", "aiPredict", "aiPredictRemainingTextRGB", "aiPredictConfirmKey", "aiPredictFetchFuncAsync", "aiPredictFetchFuncMethod", "aiPredictFetchFuncMethodParams", "aiPredictFetchCallback", "iconLeft", "iconRight", "autoComplete", "autoCapitalize", "spellCheck", "style", "tabIndex", "onChangeCallback", "onInputCallback", "onKeyPressedCallback", "onChange", "onBlur", "onFocus", "onPressEnter"];
|
|
1055
|
+
function _regeneratorRuntime() {
|
|
1056
|
+
"use strict";
|
|
1057
|
+
|
|
1058
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
1059
|
+
_regeneratorRuntime = function _regeneratorRuntime() {
|
|
1060
|
+
return exports;
|
|
1061
|
+
};
|
|
1062
|
+
var exports = {},
|
|
1063
|
+
Op = Object.prototype,
|
|
1064
|
+
hasOwn = Op.hasOwnProperty,
|
|
1065
|
+
defineProperty = Object.defineProperty || function (obj, key, desc) {
|
|
1066
|
+
obj[key] = desc.value;
|
|
1067
|
+
},
|
|
1068
|
+
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
1069
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
1070
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
1071
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
1072
|
+
function define(obj, key, value) {
|
|
1073
|
+
return Object.defineProperty(obj, key, {
|
|
1074
|
+
value: value,
|
|
1075
|
+
enumerable: !0,
|
|
1076
|
+
configurable: !0,
|
|
1077
|
+
writable: !0
|
|
1078
|
+
}), obj[key];
|
|
1079
|
+
}
|
|
1080
|
+
try {
|
|
1081
|
+
define({}, "");
|
|
1082
|
+
} catch (err) {
|
|
1083
|
+
define = function define(obj, key, value) {
|
|
1084
|
+
return obj[key] = value;
|
|
1085
|
+
};
|
|
1086
|
+
}
|
|
1087
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
1088
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
1089
|
+
generator = Object.create(protoGenerator.prototype),
|
|
1090
|
+
context = new Context(tryLocsList || []);
|
|
1091
|
+
return defineProperty(generator, "_invoke", {
|
|
1092
|
+
value: makeInvokeMethod(innerFn, self, context)
|
|
1093
|
+
}), generator;
|
|
1094
|
+
}
|
|
1095
|
+
function tryCatch(fn, obj, arg) {
|
|
1096
|
+
try {
|
|
1097
|
+
return {
|
|
1098
|
+
type: "normal",
|
|
1099
|
+
arg: fn.call(obj, arg)
|
|
1100
|
+
};
|
|
1101
|
+
} catch (err) {
|
|
1102
|
+
return {
|
|
1103
|
+
type: "throw",
|
|
1104
|
+
arg: err
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
exports.wrap = wrap;
|
|
1109
|
+
var ContinueSentinel = {};
|
|
1110
|
+
function Generator() {}
|
|
1111
|
+
function GeneratorFunction() {}
|
|
1112
|
+
function GeneratorFunctionPrototype() {}
|
|
1113
|
+
var IteratorPrototype = {};
|
|
1114
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
1115
|
+
return this;
|
|
1116
|
+
});
|
|
1117
|
+
var getProto = Object.getPrototypeOf,
|
|
1118
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
1119
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
1120
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
1121
|
+
function defineIteratorMethods(prototype) {
|
|
1122
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
1123
|
+
define(prototype, method, function (arg) {
|
|
1124
|
+
return this._invoke(method, arg);
|
|
1125
|
+
});
|
|
1126
|
+
});
|
|
1127
|
+
}
|
|
1128
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
1129
|
+
function invoke(method, arg, resolve, reject) {
|
|
1130
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
1131
|
+
if ("throw" !== record.type) {
|
|
1132
|
+
var result = record.arg,
|
|
1133
|
+
value = result.value;
|
|
1134
|
+
return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
1135
|
+
invoke("next", value, resolve, reject);
|
|
1136
|
+
}, function (err) {
|
|
1137
|
+
invoke("throw", err, resolve, reject);
|
|
1138
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
1139
|
+
result.value = unwrapped, resolve(result);
|
|
1140
|
+
}, function (error) {
|
|
1141
|
+
return invoke("throw", error, resolve, reject);
|
|
1142
|
+
});
|
|
1143
|
+
}
|
|
1144
|
+
reject(record.arg);
|
|
1145
|
+
}
|
|
1146
|
+
var previousPromise;
|
|
1147
|
+
defineProperty(this, "_invoke", {
|
|
1148
|
+
value: function value(method, arg) {
|
|
1149
|
+
function callInvokeWithMethodAndArg() {
|
|
1150
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
1151
|
+
invoke(method, arg, resolve, reject);
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
1155
|
+
}
|
|
1156
|
+
});
|
|
1157
|
+
}
|
|
1158
|
+
function makeInvokeMethod(innerFn, self, context) {
|
|
1159
|
+
var state = "suspendedStart";
|
|
1160
|
+
return function (method, arg) {
|
|
1161
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
1162
|
+
if ("completed" === state) {
|
|
1163
|
+
if ("throw" === method) throw arg;
|
|
1164
|
+
return doneResult();
|
|
1165
|
+
}
|
|
1166
|
+
for (context.method = method, context.arg = arg;;) {
|
|
1167
|
+
var delegate = context.delegate;
|
|
1168
|
+
if (delegate) {
|
|
1169
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
1170
|
+
if (delegateResult) {
|
|
1171
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
1172
|
+
return delegateResult;
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
1176
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
1177
|
+
context.dispatchException(context.arg);
|
|
1178
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
1179
|
+
state = "executing";
|
|
1180
|
+
var record = tryCatch(innerFn, self, context);
|
|
1181
|
+
if ("normal" === record.type) {
|
|
1182
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
1183
|
+
return {
|
|
1184
|
+
value: record.arg,
|
|
1185
|
+
done: context.done
|
|
1186
|
+
};
|
|
1187
|
+
}
|
|
1188
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
1189
|
+
}
|
|
1190
|
+
};
|
|
1191
|
+
}
|
|
1192
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
1193
|
+
var methodName = context.method,
|
|
1194
|
+
method = delegate.iterator[methodName];
|
|
1195
|
+
if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
|
|
1196
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
1197
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
1198
|
+
var info = record.arg;
|
|
1199
|
+
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
|
|
1200
|
+
}
|
|
1201
|
+
function pushTryEntry(locs) {
|
|
1202
|
+
var entry = {
|
|
1203
|
+
tryLoc: locs[0]
|
|
1204
|
+
};
|
|
1205
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
1206
|
+
}
|
|
1207
|
+
function resetTryEntry(entry) {
|
|
1208
|
+
var record = entry.completion || {};
|
|
1209
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
1210
|
+
}
|
|
1211
|
+
function Context(tryLocsList) {
|
|
1212
|
+
this.tryEntries = [{
|
|
1213
|
+
tryLoc: "root"
|
|
1214
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
1215
|
+
}
|
|
1216
|
+
function values(iterable) {
|
|
1217
|
+
if (iterable) {
|
|
1218
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
1219
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
1220
|
+
if ("function" == typeof iterable.next) return iterable;
|
|
1221
|
+
if (!isNaN(iterable.length)) {
|
|
1222
|
+
var i = -1,
|
|
1223
|
+
next = function next() {
|
|
1224
|
+
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
1225
|
+
return next.value = undefined, next.done = !0, next;
|
|
1226
|
+
};
|
|
1227
|
+
return next.next = next;
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
return {
|
|
1231
|
+
next: doneResult
|
|
1232
|
+
};
|
|
1233
|
+
}
|
|
1234
|
+
function doneResult() {
|
|
1235
|
+
return {
|
|
1236
|
+
value: undefined,
|
|
1237
|
+
done: !0
|
|
1238
|
+
};
|
|
1239
|
+
}
|
|
1240
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
|
|
1241
|
+
value: GeneratorFunctionPrototype,
|
|
1242
|
+
configurable: !0
|
|
1243
|
+
}), defineProperty(GeneratorFunctionPrototype, "constructor", {
|
|
1244
|
+
value: GeneratorFunction,
|
|
1245
|
+
configurable: !0
|
|
1246
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
1247
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
1248
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
1249
|
+
}, exports.mark = function (genFun) {
|
|
1250
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
1251
|
+
}, exports.awrap = function (arg) {
|
|
1252
|
+
return {
|
|
1253
|
+
__await: arg
|
|
1254
|
+
};
|
|
1255
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
1256
|
+
return this;
|
|
1257
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
1258
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
1259
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
1260
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
1261
|
+
return result.done ? result.value : iter.next();
|
|
1262
|
+
});
|
|
1263
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
1264
|
+
return this;
|
|
1265
|
+
}), define(Gp, "toString", function () {
|
|
1266
|
+
return "[object Generator]";
|
|
1267
|
+
}), exports.keys = function (val) {
|
|
1268
|
+
var object = Object(val),
|
|
1269
|
+
keys = [];
|
|
1270
|
+
for (var key in object) keys.push(key);
|
|
1271
|
+
return keys.reverse(), function next() {
|
|
1272
|
+
for (; keys.length;) {
|
|
1273
|
+
var key = keys.pop();
|
|
1274
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
|
1275
|
+
}
|
|
1276
|
+
return next.done = !0, next;
|
|
1277
|
+
};
|
|
1278
|
+
}, exports.values = values, Context.prototype = {
|
|
1279
|
+
constructor: Context,
|
|
1280
|
+
reset: function reset(skipTempReset) {
|
|
1281
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
1282
|
+
},
|
|
1283
|
+
stop: function stop() {
|
|
1284
|
+
this.done = !0;
|
|
1285
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
1286
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
1287
|
+
return this.rval;
|
|
1288
|
+
},
|
|
1289
|
+
dispatchException: function dispatchException(exception) {
|
|
1290
|
+
if (this.done) throw exception;
|
|
1291
|
+
var context = this;
|
|
1292
|
+
function handle(loc, caught) {
|
|
1293
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
1294
|
+
}
|
|
1295
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1296
|
+
var entry = this.tryEntries[i],
|
|
1297
|
+
record = entry.completion;
|
|
1298
|
+
if ("root" === entry.tryLoc) return handle("end");
|
|
1299
|
+
if (entry.tryLoc <= this.prev) {
|
|
1300
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
1301
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
1302
|
+
if (hasCatch && hasFinally) {
|
|
1303
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
1304
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
1305
|
+
} else if (hasCatch) {
|
|
1306
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
1307
|
+
} else {
|
|
1308
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
1309
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
},
|
|
1314
|
+
abrupt: function abrupt(type, arg) {
|
|
1315
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1316
|
+
var entry = this.tryEntries[i];
|
|
1317
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
1318
|
+
var finallyEntry = entry;
|
|
1319
|
+
break;
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
1323
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
1324
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
1325
|
+
},
|
|
1326
|
+
complete: function complete(record, afterLoc) {
|
|
1327
|
+
if ("throw" === record.type) throw record.arg;
|
|
1328
|
+
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
|
|
1329
|
+
},
|
|
1330
|
+
finish: function finish(finallyLoc) {
|
|
1331
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1332
|
+
var entry = this.tryEntries[i];
|
|
1333
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
1334
|
+
}
|
|
1335
|
+
},
|
|
1336
|
+
"catch": function _catch(tryLoc) {
|
|
1337
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1338
|
+
var entry = this.tryEntries[i];
|
|
1339
|
+
if (entry.tryLoc === tryLoc) {
|
|
1340
|
+
var record = entry.completion;
|
|
1341
|
+
if ("throw" === record.type) {
|
|
1342
|
+
var thrown = record.arg;
|
|
1343
|
+
resetTryEntry(entry);
|
|
1344
|
+
}
|
|
1345
|
+
return thrown;
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
throw new Error("illegal catch attempt");
|
|
1349
|
+
},
|
|
1350
|
+
delegateYield: function delegateYield(iterable, resultName, nextLoc) {
|
|
1351
|
+
return this.delegate = {
|
|
1352
|
+
iterator: values(iterable),
|
|
1353
|
+
resultName: resultName,
|
|
1354
|
+
nextLoc: nextLoc
|
|
1355
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
1356
|
+
}
|
|
1357
|
+
}, exports;
|
|
1358
|
+
}
|
|
1359
|
+
function _toConsumableArray(arr) {
|
|
1360
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
1361
|
+
}
|
|
1362
|
+
function _nonIterableSpread() {
|
|
1363
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1364
|
+
}
|
|
1365
|
+
function _iterableToArray(iter) {
|
|
1366
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
1367
|
+
}
|
|
1368
|
+
function _arrayWithoutHoles(arr) {
|
|
1369
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
1370
|
+
}
|
|
1371
|
+
function _typeof(obj) {
|
|
1372
|
+
"@babel/helpers - typeof";
|
|
1373
|
+
|
|
1374
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
1375
|
+
return typeof obj;
|
|
1376
|
+
} : function (obj) {
|
|
1377
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
1378
|
+
}, _typeof(obj);
|
|
1379
|
+
}
|
|
616
1380
|
function _extends() {
|
|
617
1381
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
618
1382
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -627,6 +1391,36 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
627
1391
|
};
|
|
628
1392
|
return _extends.apply(this, arguments);
|
|
629
1393
|
}
|
|
1394
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
1395
|
+
try {
|
|
1396
|
+
var info = gen[key](arg);
|
|
1397
|
+
var value = info.value;
|
|
1398
|
+
} catch (error) {
|
|
1399
|
+
reject(error);
|
|
1400
|
+
return;
|
|
1401
|
+
}
|
|
1402
|
+
if (info.done) {
|
|
1403
|
+
resolve(value);
|
|
1404
|
+
} else {
|
|
1405
|
+
Promise.resolve(value).then(_next, _throw);
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
function _asyncToGenerator(fn) {
|
|
1409
|
+
return function () {
|
|
1410
|
+
var self = this,
|
|
1411
|
+
args = arguments;
|
|
1412
|
+
return new Promise(function (resolve, reject) {
|
|
1413
|
+
var gen = fn.apply(self, args);
|
|
1414
|
+
function _next(value) {
|
|
1415
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
1416
|
+
}
|
|
1417
|
+
function _throw(err) {
|
|
1418
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
1419
|
+
}
|
|
1420
|
+
_next(undefined);
|
|
1421
|
+
});
|
|
1422
|
+
};
|
|
1423
|
+
}
|
|
630
1424
|
function _slicedToArray(arr, i) {
|
|
631
1425
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
632
1426
|
}
|
|
@@ -733,6 +1527,16 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
733
1527
|
inputMode = props.inputMode,
|
|
734
1528
|
id = props.id,
|
|
735
1529
|
appendControl = props.appendControl,
|
|
1530
|
+
_props$aiPredict = props.aiPredict,
|
|
1531
|
+
aiPredict = _props$aiPredict === void 0 ? false : _props$aiPredict,
|
|
1532
|
+
_props$aiPredictRemai = props.aiPredictRemainingTextRGB,
|
|
1533
|
+
aiPredictRemainingTextRGB = _props$aiPredictRemai === void 0 ? [153, 153, 153] : _props$aiPredictRemai,
|
|
1534
|
+
_props$aiPredictConfi = props.aiPredictConfirmKey,
|
|
1535
|
+
aiPredictConfirmKey = _props$aiPredictConfi === void 0 ? [['Enter'], ['Tab'], ['Shift', ' ']] : _props$aiPredictConfi,
|
|
1536
|
+
aiPredictFetchFuncAsync = props.aiPredictFetchFuncAsync,
|
|
1537
|
+
aiPredictFetchFuncMethod = props.aiPredictFetchFuncMethod,
|
|
1538
|
+
aiPredictFetchFuncMethodParams = props.aiPredictFetchFuncMethodParams,
|
|
1539
|
+
aiPredictFetchCallback = props.aiPredictFetchCallback,
|
|
736
1540
|
iconLeft = props.iconLeft,
|
|
737
1541
|
iconRight = props.iconRight,
|
|
738
1542
|
autoComplete = props.autoComplete,
|
|
@@ -762,6 +1566,183 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
762
1566
|
changedVal = _useState4[0],
|
|
763
1567
|
setChangedVal = _useState4[1];
|
|
764
1568
|
|
|
1569
|
+
//================================================================
|
|
1570
|
+
// AI Predict
|
|
1571
|
+
//================================================================
|
|
1572
|
+
var _useState5 = (0, react__WEBPACK_IMPORTED_MODULE_0__.useState)(''),
|
|
1573
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
1574
|
+
currentSuggestion = _useState6[0],
|
|
1575
|
+
setCurrentSuggestion = _useState6[1];
|
|
1576
|
+
var _useState7 = (0, react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),
|
|
1577
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
1578
|
+
tempMatchedSuggestion = _useState8[0],
|
|
1579
|
+
setTempMatchedSuggestion = _useState8[1];
|
|
1580
|
+
var _useState9 = (0, react__WEBPACK_IMPORTED_MODULE_0__.useState)(0),
|
|
1581
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
1582
|
+
textWidth = _useState10[0],
|
|
1583
|
+
setTextWidth = _useState10[1];
|
|
1584
|
+
var aiInputRef = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
1585
|
+
var originInputComputedStyle = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)({
|
|
1586
|
+
fontSize: 16,
|
|
1587
|
+
fontFamily: 'inherit',
|
|
1588
|
+
letterSpacing: 'normal',
|
|
1589
|
+
textTop: 10
|
|
1590
|
+
});
|
|
1591
|
+
var _useState11 = (0, react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
|
|
1592
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
1593
|
+
hasErr = _useState12[0],
|
|
1594
|
+
setHasErr = _useState12[1];
|
|
1595
|
+
var currentSuggestionIndex = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(0);
|
|
1596
|
+
|
|
1597
|
+
// A list of suggestions
|
|
1598
|
+
//----------------
|
|
1599
|
+
var _useState13 = (0, react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),
|
|
1600
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
1601
|
+
suggestions = _useState14[0],
|
|
1602
|
+
setSuggestions = _useState14[1];
|
|
1603
|
+
|
|
1604
|
+
//performance
|
|
1605
|
+
var handleChangeSuggestionsFetchSafe = funda_utils_dist_cjs_useDebounce__WEBPACK_IMPORTED_MODULE_4___default()(function (e, curVal) {
|
|
1606
|
+
var _oparams = aiPredictFetchFuncMethodParams || [];
|
|
1607
|
+
var _params = _oparams.map(function (item) {
|
|
1608
|
+
return item !== '$QUERY_STRING' ? item : curVal;
|
|
1609
|
+
});
|
|
1610
|
+
fetchSuggestionsData(_params.join(',')).then(function (resSuggestions) {
|
|
1611
|
+
handleInputAiPredictChange(curVal, resSuggestions);
|
|
1612
|
+
});
|
|
1613
|
+
}, 350, []);
|
|
1614
|
+
function fetchSuggestionsData(_x2) {
|
|
1615
|
+
return _fetchSuggestionsData.apply(this, arguments);
|
|
1616
|
+
} // Calculates the width of the input text
|
|
1617
|
+
//----------------
|
|
1618
|
+
function _fetchSuggestionsData() {
|
|
1619
|
+
_fetchSuggestionsData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
|
1620
|
+
var response, _ORGIN_DATA;
|
|
1621
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1622
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1623
|
+
case 0:
|
|
1624
|
+
if (!(_typeof(aiPredictFetchFuncAsync) === 'object')) {
|
|
1625
|
+
_context.next = 11;
|
|
1626
|
+
break;
|
|
1627
|
+
}
|
|
1628
|
+
_context.next = 3;
|
|
1629
|
+
return aiPredictFetchFuncAsync["".concat(aiPredictFetchFuncMethod)].apply(aiPredictFetchFuncAsync, _toConsumableArray(params.split(',')));
|
|
1630
|
+
case 3:
|
|
1631
|
+
response = _context.sent;
|
|
1632
|
+
_ORGIN_DATA = response.data; // reset data structure
|
|
1633
|
+
if (typeof aiPredictFetchCallback === 'function') {
|
|
1634
|
+
_ORGIN_DATA = aiPredictFetchCallback(_ORGIN_DATA);
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
// Determine whether the data structure matches
|
|
1638
|
+
if (!Array.isArray(_ORGIN_DATA)) {
|
|
1639
|
+
console.warn('The data structure does not match, please refer to the example in the component documentation.');
|
|
1640
|
+
setHasErr(true);
|
|
1641
|
+
_ORGIN_DATA = [];
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
//
|
|
1645
|
+
setSuggestions(_ORGIN_DATA);
|
|
1646
|
+
return _context.abrupt("return", _ORGIN_DATA);
|
|
1647
|
+
case 11:
|
|
1648
|
+
return _context.abrupt("return", []);
|
|
1649
|
+
case 12:
|
|
1650
|
+
case "end":
|
|
1651
|
+
return _context.stop();
|
|
1652
|
+
}
|
|
1653
|
+
}, _callee);
|
|
1654
|
+
}));
|
|
1655
|
+
return _fetchSuggestionsData.apply(this, arguments);
|
|
1656
|
+
}
|
|
1657
|
+
var calculateTextWidth = function calculateTextWidth(text) {
|
|
1658
|
+
if (valRef.current) {
|
|
1659
|
+
var canvas = document.createElement('canvas');
|
|
1660
|
+
var context = canvas.getContext('2d');
|
|
1661
|
+
context.font = "".concat(originInputComputedStyle.current.fontSize, "px ").concat(originInputComputedStyle.current.fontFamily);
|
|
1662
|
+
return context.measureText(text).width;
|
|
1663
|
+
}
|
|
1664
|
+
return 0;
|
|
1665
|
+
};
|
|
1666
|
+
|
|
1667
|
+
// Get the rest of the suggested text
|
|
1668
|
+
//----------------
|
|
1669
|
+
var getRemainingText = function getRemainingText(fullSuggestion) {
|
|
1670
|
+
if (!changedVal || !fullSuggestion) return '';
|
|
1671
|
+
|
|
1672
|
+
// Only the parts of the suggested text that were not entered are returned
|
|
1673
|
+
var lastInputChar = changedVal[changedVal.length - 1];
|
|
1674
|
+
var lastCharIndex = fullSuggestion.toLowerCase().lastIndexOf(lastInputChar.toLowerCase());
|
|
1675
|
+
return fullSuggestion.slice(lastCharIndex + 1);
|
|
1676
|
+
};
|
|
1677
|
+
|
|
1678
|
+
// Match exactly from the start
|
|
1679
|
+
//----------------
|
|
1680
|
+
var preciseMatch = function preciseMatch(input, suggestions) {
|
|
1681
|
+
if (!input) return '';
|
|
1682
|
+
var filtered = suggestions.filter(function (s) {
|
|
1683
|
+
return s.toLowerCase().startsWith(input.toLowerCase());
|
|
1684
|
+
});
|
|
1685
|
+
setTempMatchedSuggestion(filtered);
|
|
1686
|
+
return filtered;
|
|
1687
|
+
};
|
|
1688
|
+
|
|
1689
|
+
// Fuzzy matching
|
|
1690
|
+
//----------------
|
|
1691
|
+
var fuzzyMatch = function fuzzyMatch(input, suggestions) {
|
|
1692
|
+
if (!input) return '';
|
|
1693
|
+
|
|
1694
|
+
// Convert input to a regular expression pattern with support for arbitrary position matching
|
|
1695
|
+
var pattern = input.split('').map(function (_char) {
|
|
1696
|
+
return _char.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
1697
|
+
}).join('.*');
|
|
1698
|
+
var regex = new RegExp(pattern, 'i');
|
|
1699
|
+
|
|
1700
|
+
// Find the first matching suggestion (multiple matches)
|
|
1701
|
+
var filtered = suggestions.filter(function (suggestion) {
|
|
1702
|
+
return regex.test(suggestion);
|
|
1703
|
+
});
|
|
1704
|
+
setTempMatchedSuggestion(filtered);
|
|
1705
|
+
return filtered;
|
|
1706
|
+
};
|
|
1707
|
+
|
|
1708
|
+
// Handle input variations
|
|
1709
|
+
//----------------
|
|
1710
|
+
var handleInputAiPredictChange = function handleInputAiPredictChange(newValue, curSuggestions) {
|
|
1711
|
+
setTextWidth(calculateTextWidth(newValue));
|
|
1712
|
+
|
|
1713
|
+
// Match results
|
|
1714
|
+
var matchedSuggestion = fuzzyMatch(newValue, curSuggestions);
|
|
1715
|
+
setCurrentSuggestion(matchedSuggestion[0] || '');
|
|
1716
|
+
};
|
|
1717
|
+
|
|
1718
|
+
// Calculate the color shade of the prompt text
|
|
1719
|
+
//----------------
|
|
1720
|
+
var calculateOpacity = function calculateOpacity() {
|
|
1721
|
+
// Transparency is calculated based on the input length
|
|
1722
|
+
var baseOpacity = 0.5;
|
|
1723
|
+
var inputLength = changedVal.length;
|
|
1724
|
+
return Math.max(0.2, baseOpacity - inputLength * 0.05);
|
|
1725
|
+
};
|
|
1726
|
+
|
|
1727
|
+
// Confirm
|
|
1728
|
+
//----------------
|
|
1729
|
+
var handleAiPredictKeyDown = function handleAiPredictKeyDown(e) {
|
|
1730
|
+
// Prevents the default behavior of the enter key
|
|
1731
|
+
e.preventDefault();
|
|
1732
|
+
var remainingText = getRemainingText(currentSuggestion);
|
|
1733
|
+
if (remainingText) {
|
|
1734
|
+
// Only the second half of the text is added
|
|
1735
|
+
setChangedVal(changedVal + remainingText);
|
|
1736
|
+
setCurrentSuggestion('');
|
|
1737
|
+
}
|
|
1738
|
+
};
|
|
1739
|
+
|
|
1740
|
+
//
|
|
1741
|
+
var remainingText = getRemainingText(currentSuggestion);
|
|
1742
|
+
|
|
1743
|
+
//================================================================
|
|
1744
|
+
// General
|
|
1745
|
+
//================================================================
|
|
765
1746
|
// exposes the following methods
|
|
766
1747
|
(0, react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(contentRef, function () {
|
|
767
1748
|
return {
|
|
@@ -848,6 +1829,39 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
848
1829
|
// DO NOT USE "preventDefault()"
|
|
849
1830
|
onPressEnter === null || onPressEnter === void 0 ? void 0 : onPressEnter(event, valRef.current);
|
|
850
1831
|
}
|
|
1832
|
+
|
|
1833
|
+
// AI Predict
|
|
1834
|
+
//----
|
|
1835
|
+
if (aiPredict && currentSuggestion !== '') {
|
|
1836
|
+
var keyBindings = aiPredictConfirmKey;
|
|
1837
|
+
// The parameter 'registerKeyEvents' is an array, and each element is an object
|
|
1838
|
+
// eg. { keys: ["Control", "S"], action: () => { console.log("Ctrl+S"); } }
|
|
1839
|
+
var registerKeyEvents = keyBindings.map(function (s) {
|
|
1840
|
+
return {
|
|
1841
|
+
keys: s,
|
|
1842
|
+
action: function action() {
|
|
1843
|
+
handleAiPredictKeyDown(event);
|
|
1844
|
+
}
|
|
1845
|
+
};
|
|
1846
|
+
});
|
|
1847
|
+
registerKeyEvents.forEach(function (binding) {
|
|
1848
|
+
var keysPressed = binding.keys.every(function (key) {
|
|
1849
|
+
return key === "Shift" ? event.shiftKey : key === "Control" ? event.ctrlKey : key === "Alt" ? event.altKey : key === "Meta" ? event.metaKey : event.key === key;
|
|
1850
|
+
});
|
|
1851
|
+
if (keysPressed) {
|
|
1852
|
+
binding.action();
|
|
1853
|
+
}
|
|
1854
|
+
});
|
|
1855
|
+
|
|
1856
|
+
// switch result of suggestions
|
|
1857
|
+
if (event.code === 'ArrowUp') {
|
|
1858
|
+
currentSuggestionIndex.current = (currentSuggestionIndex.current - 1 + tempMatchedSuggestion.length) % tempMatchedSuggestion.length;
|
|
1859
|
+
}
|
|
1860
|
+
if (event.code === 'ArrowDown') {
|
|
1861
|
+
currentSuggestionIndex.current = (currentSuggestionIndex.current + 1) % tempMatchedSuggestion.length;
|
|
1862
|
+
}
|
|
1863
|
+
setCurrentSuggestion(tempMatchedSuggestion[currentSuggestionIndex.current] || '');
|
|
1864
|
+
}
|
|
851
1865
|
}
|
|
852
1866
|
(0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
853
1867
|
// update default value
|
|
@@ -863,6 +1877,17 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
863
1877
|
//REQUIRED
|
|
864
1878
|
setChangedVal("".concat(defaultValue)); // Avoid displaying the number 0
|
|
865
1879
|
}
|
|
1880
|
+
|
|
1881
|
+
// AI Predict initalization
|
|
1882
|
+
//--------------
|
|
1883
|
+
if (aiPredict && valRef.current !== null) {
|
|
1884
|
+
originInputComputedStyle.current = {
|
|
1885
|
+
fontSize: (0, funda_utils_dist_cjs_inputsCalculation__WEBPACK_IMPORTED_MODULE_3__.actualPropertyValue)(valRef.current, 'fontSize'),
|
|
1886
|
+
fontFamily: (0, funda_utils_dist_cjs_inputsCalculation__WEBPACK_IMPORTED_MODULE_3__.actualPropertyValue)(valRef.current, 'fontFamily'),
|
|
1887
|
+
letterSpacing: (0, funda_utils_dist_cjs_inputsCalculation__WEBPACK_IMPORTED_MODULE_3__.actualPropertyValue)(valRef.current, 'letterSpacing'),
|
|
1888
|
+
textTop: (0, funda_utils_dist_cjs_inputsCalculation__WEBPACK_IMPORTED_MODULE_3__.getTextTop)(valRef.current)
|
|
1889
|
+
};
|
|
1890
|
+
}
|
|
866
1891
|
}, []);
|
|
867
1892
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
868
1893
|
className: (0, funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.clsWrite)(wrapperClassName, 'mb-3 position-relative'),
|
|
@@ -877,60 +1902,15 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
877
1902
|
htmlFor: idRes,
|
|
878
1903
|
className: "form-label"
|
|
879
1904
|
}, label)) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
880
|
-
className: (0, funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.combinedCls)('position-relative', (0, funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.clsWrite)(controlGroupWrapperClassName, 'input-group'), {
|
|
1905
|
+
className: (0, funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.combinedCls)('position-relative z-1', (0, funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.clsWrite)(controlGroupWrapperClassName, 'input-group'), {
|
|
881
1906
|
'has-left-content': propExist(iconLeft),
|
|
882
1907
|
'has-right-content': propExist(iconRight) || propExist(units)
|
|
883
1908
|
})
|
|
884
1909
|
}, propExist(iconLeft) ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
|
|
885
1910
|
className: (0, funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.clsWrite)(controlGroupTextClassName, 'input-group-text')
|
|
886
|
-
}, iconLeft)) : null,
|
|
887
|
-
className: "input-group-control-container
|
|
1911
|
+
}, iconLeft)) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
1912
|
+
className: "input-group-control-container flex-fill position-relative"
|
|
888
1913
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", _extends({
|
|
889
|
-
ref: function ref(node) {
|
|
890
|
-
valRef.current = node;
|
|
891
|
-
if (typeof externalRef === 'function') {
|
|
892
|
-
externalRef(node);
|
|
893
|
-
} else if (externalRef) {
|
|
894
|
-
externalRef.current = node;
|
|
895
|
-
}
|
|
896
|
-
},
|
|
897
|
-
tabIndex: tabIndex || 0,
|
|
898
|
-
type: typeRes,
|
|
899
|
-
className: (0, funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.combinedCls)(propExist(iconLeft) ? 'rounded-start-0' : 'rounded', (0, funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.clsWrite)(controlClassName, 'form-control ')),
|
|
900
|
-
id: idRes,
|
|
901
|
-
name: name,
|
|
902
|
-
step: step || null,
|
|
903
|
-
min: min || null,
|
|
904
|
-
max: max || null,
|
|
905
|
-
src: src || null,
|
|
906
|
-
size: size || null,
|
|
907
|
-
alt: alt || null,
|
|
908
|
-
inputMode: inputMode || 'text',
|
|
909
|
-
pattern: pattern || null,
|
|
910
|
-
placeholder: placeholder || '',
|
|
911
|
-
defaultValue: defaultValue,
|
|
912
|
-
value: changedVal,
|
|
913
|
-
minLength: minLength || null,
|
|
914
|
-
maxLength: maxLength || null,
|
|
915
|
-
autoComplete: typeof autoComplete === 'undefined' ? 'on' : autoComplete,
|
|
916
|
-
autoCapitalize: typeof autoCapitalize === 'undefined' ? 'off' : autoCapitalize,
|
|
917
|
-
spellCheck: typeof spellCheck === 'undefined' ? false : spellCheck,
|
|
918
|
-
onFocus: handleFocus,
|
|
919
|
-
onBlur: handleBlur,
|
|
920
|
-
onChange: handleChange,
|
|
921
|
-
onKeyDown: handleKeyPressed,
|
|
922
|
-
onCompositionStart: handleComposition,
|
|
923
|
-
onCompositionUpdate: handleComposition,
|
|
924
|
-
onCompositionEnd: handleComposition,
|
|
925
|
-
disabled: disabled || null,
|
|
926
|
-
required: required || null,
|
|
927
|
-
readOnly: readOnly || null,
|
|
928
|
-
style: style
|
|
929
|
-
}, attributes)), appendControl || '', propExist(units) ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
|
|
930
|
-
className: (0, funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.clsWrite)(controlGroupTextClassName, 'input-group-text')
|
|
931
|
-
}, units)) : null, propExist(iconRight) ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
|
|
932
|
-
className: (0, funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.clsWrite)(controlGroupTextClassName, 'input-group-text')
|
|
933
|
-
}, iconRight)) : null)) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", _extends({
|
|
934
1914
|
ref: function ref(node) {
|
|
935
1915
|
valRef.current = node;
|
|
936
1916
|
if (typeof externalRef === 'function') {
|
|
@@ -942,7 +1922,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
942
1922
|
tabIndex: tabIndex || 0,
|
|
943
1923
|
type: typeRes,
|
|
944
1924
|
className: (0, funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.combinedCls)((0, funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.clsWrite)(controlClassName, 'form-control'), controlExClassName, {
|
|
945
|
-
'rounded': !propExist(iconLeft) && !propExist(iconRight) && !propExist(units)
|
|
1925
|
+
'rounded': !propExist(iconLeft) && !propExist(iconRight) && !propExist(units),
|
|
1926
|
+
'rounded-start-0': propExist(iconLeft),
|
|
1927
|
+
'rounded-end-0': propExist(iconRight) || propExist(units)
|
|
946
1928
|
}),
|
|
947
1929
|
id: idRes,
|
|
948
1930
|
name: name,
|
|
@@ -963,7 +1945,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
963
1945
|
spellCheck: typeof spellCheck === 'undefined' ? false : spellCheck,
|
|
964
1946
|
onFocus: handleFocus,
|
|
965
1947
|
onBlur: handleBlur,
|
|
966
|
-
onChange:
|
|
1948
|
+
onChange: function onChange(e) {
|
|
1949
|
+
handleChange(e);
|
|
1950
|
+
|
|
1951
|
+
// AI Predict
|
|
1952
|
+
if (aiPredict) {
|
|
1953
|
+
handleChangeSuggestionsFetchSafe(e, e.target.value);
|
|
1954
|
+
}
|
|
1955
|
+
},
|
|
967
1956
|
onKeyDown: handleKeyPressed,
|
|
968
1957
|
onCompositionStart: handleComposition,
|
|
969
1958
|
onCompositionUpdate: handleComposition,
|
|
@@ -972,15 +1961,27 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
972
1961
|
required: required || null,
|
|
973
1962
|
readOnly: readOnly || null,
|
|
974
1963
|
style: style
|
|
975
|
-
}, attributes)), appendControl || '',
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
1964
|
+
}, attributes)), appendControl || '', aiPredict && remainingText && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
1965
|
+
ref: aiInputRef,
|
|
1966
|
+
className: "position-absolute z-1",
|
|
1967
|
+
style: {
|
|
1968
|
+
left: "".concat(originInputComputedStyle.current.fontSize + textWidth, "px"),
|
|
1969
|
+
top: originInputComputedStyle.current.textTop + 'px',
|
|
1970
|
+
color: "rgba(".concat(aiPredictRemainingTextRGB[0], ", ").concat(aiPredictRemainingTextRGB[1], ", ").concat(aiPredictRemainingTextRGB[2], ", ").concat(calculateOpacity(), ")"),
|
|
1971
|
+
pointerEvents: 'none',
|
|
1972
|
+
fontSize: originInputComputedStyle.current.fontSize + 'px',
|
|
1973
|
+
fontFamily: originInputComputedStyle.current.fontFamily,
|
|
1974
|
+
letterSpacing: originInputComputedStyle.current.letterSpacing
|
|
1975
|
+
}
|
|
1976
|
+
}, remainingText), required ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, requiredLabel || requiredLabel === '' ? requiredLabel : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
|
|
980
1977
|
className: "position-absolute end-0 top-0 my-2 mx-2"
|
|
981
1978
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
|
|
982
1979
|
className: "text-danger"
|
|
983
|
-
}, "*"))) : ''))
|
|
1980
|
+
}, "*"))) : ''), propExist(units) ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
|
|
1981
|
+
className: (0, funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.clsWrite)(controlGroupTextClassName, 'input-group-text')
|
|
1982
|
+
}, units)) : null, propExist(iconRight) ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
|
|
1983
|
+
className: (0, funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.clsWrite)(controlGroupTextClassName, 'input-group-text')
|
|
1984
|
+
}, iconRight)) : null)));
|
|
984
1985
|
});
|
|
985
1986
|
/* harmony default export */
|
|
986
1987
|
var __WEBPACK_DEFAULT_EXPORT__ = Input;
|