@knovator/pagecreator-admin 0.5.6 → 0.5.8

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/index.cjs CHANGED
@@ -7,6 +7,7 @@ var fetchUrl = require('@knovator/api');
7
7
  var classNames = require('classnames');
8
8
  var ReactSelect = require('react-select/async');
9
9
  var reactHookForm = require('react-hook-form');
10
+ var SunEditor = require('suneditor-react');
10
11
  var reactBeautifulDnd = require('react-beautiful-dnd');
11
12
  var CSSTransition = require('react-transition-group/CSSTransition');
12
13
  var reactDropzone = require('react-dropzone');
@@ -19,6 +20,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
19
20
  var fetchUrl__default = /*#__PURE__*/_interopDefaultLegacy(fetchUrl);
20
21
  var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
21
22
  var ReactSelect__default = /*#__PURE__*/_interopDefaultLegacy(ReactSelect);
23
+ var SunEditor__default = /*#__PURE__*/_interopDefaultLegacy(SunEditor);
22
24
  var CSSTransition__default = /*#__PURE__*/_interopDefaultLegacy(CSSTransition);
23
25
 
24
26
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -67,10 +69,10 @@ var functionBindNative = !fails$l(function () {
67
69
 
68
70
  var NATIVE_BIND$3 = functionBindNative;
69
71
 
70
- var call$j = Function.prototype.call;
72
+ var call$i = Function.prototype.call;
71
73
 
72
- var functionCall = NATIVE_BIND$3 ? call$j.bind(call$j) : function () {
73
- return call$j.apply(call$j, arguments);
74
+ var functionCall = NATIVE_BIND$3 ? call$i.bind(call$i) : function () {
75
+ return call$i.apply(call$i, arguments);
74
76
  };
75
77
 
76
78
  var objectPropertyIsEnumerable = {};
@@ -101,22 +103,22 @@ var createPropertyDescriptor$3 = function (bitmap, value) {
101
103
  var NATIVE_BIND$2 = functionBindNative;
102
104
 
103
105
  var FunctionPrototype$2 = Function.prototype;
104
- var call$i = FunctionPrototype$2.call;
105
- var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$i, call$i);
106
+ var call$h = FunctionPrototype$2.call;
107
+ var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$h, call$h);
106
108
 
107
109
  var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function (fn) {
108
110
  return function () {
109
- return call$i.apply(fn, arguments);
111
+ return call$h.apply(fn, arguments);
110
112
  };
111
113
  };
112
114
 
113
115
  var uncurryThis$l = functionUncurryThis;
114
116
 
115
- var toString$9 = uncurryThis$l({}.toString);
117
+ var toString$8 = uncurryThis$l({}.toString);
116
118
  var stringSlice$4 = uncurryThis$l(''.slice);
117
119
 
118
120
  var classofRaw$2 = function (it) {
119
- return stringSlice$4(toString$9(it), 8, -1);
121
+ return stringSlice$4(toString$8(it), 8, -1);
120
122
  };
121
123
 
122
124
  var uncurryThis$k = functionUncurryThis;
@@ -137,27 +139,27 @@ var indexedObject = fails$k(function () {
137
139
 
138
140
  // we can't use just `it == null` since of `document.all` special case
139
141
  // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
140
- var isNullOrUndefined$6 = function (it) {
142
+ var isNullOrUndefined$5 = function (it) {
141
143
  return it === null || it === undefined;
142
144
  };
143
145
 
144
- var isNullOrUndefined$5 = isNullOrUndefined$6;
146
+ var isNullOrUndefined$4 = isNullOrUndefined$5;
145
147
 
146
148
  var $TypeError$f = TypeError;
147
149
 
148
150
  // `RequireObjectCoercible` abstract operation
149
151
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
150
- var requireObjectCoercible$7 = function (it) {
151
- if (isNullOrUndefined$5(it)) throw $TypeError$f("Can't call method on " + it);
152
+ var requireObjectCoercible$6 = function (it) {
153
+ if (isNullOrUndefined$4(it)) throw $TypeError$f("Can't call method on " + it);
152
154
  return it;
153
155
  };
154
156
 
155
157
  // toObject with fallback for non-array-like ES3 strings
156
158
  var IndexedObject$2 = indexedObject;
157
- var requireObjectCoercible$6 = requireObjectCoercible$7;
159
+ var requireObjectCoercible$5 = requireObjectCoercible$6;
158
160
 
159
161
  var toIndexedObject$5 = function (it) {
160
- return IndexedObject$2(requireObjectCoercible$6(it));
162
+ return IndexedObject$2(requireObjectCoercible$5(it));
161
163
  };
162
164
 
163
165
  var documentAll$2 = typeof document == 'object' && document.all;
@@ -299,16 +301,16 @@ var aCallable$8 = function (argument) {
299
301
  };
300
302
 
301
303
  var aCallable$7 = aCallable$8;
302
- var isNullOrUndefined$4 = isNullOrUndefined$6;
304
+ var isNullOrUndefined$3 = isNullOrUndefined$5;
303
305
 
304
306
  // `GetMethod` abstract operation
305
307
  // https://tc39.es/ecma262/#sec-getmethod
306
- var getMethod$5 = function (V, P) {
308
+ var getMethod$4 = function (V, P) {
307
309
  var func = V[P];
308
- return isNullOrUndefined$4(func) ? undefined : aCallable$7(func);
310
+ return isNullOrUndefined$3(func) ? undefined : aCallable$7(func);
309
311
  };
310
312
 
311
- var call$h = functionCall;
313
+ var call$g = functionCall;
312
314
  var isCallable$h = isCallable$m;
313
315
  var isObject$9 = isObject$a;
314
316
 
@@ -318,9 +320,9 @@ var $TypeError$d = TypeError;
318
320
  // https://tc39.es/ecma262/#sec-ordinarytoprimitive
319
321
  var ordinaryToPrimitive$1 = function (input, pref) {
320
322
  var fn, val;
321
- if (pref === 'string' && isCallable$h(fn = input.toString) && !isObject$9(val = call$h(fn, input))) return val;
322
- if (isCallable$h(fn = input.valueOf) && !isObject$9(val = call$h(fn, input))) return val;
323
- if (pref !== 'string' && isCallable$h(fn = input.toString) && !isObject$9(val = call$h(fn, input))) return val;
323
+ if (pref === 'string' && isCallable$h(fn = input.toString) && !isObject$9(val = call$g(fn, input))) return val;
324
+ if (isCallable$h(fn = input.valueOf) && !isObject$9(val = call$g(fn, input))) return val;
325
+ if (pref !== 'string' && isCallable$h(fn = input.toString) && !isObject$9(val = call$g(fn, input))) return val;
324
326
  throw $TypeError$d("Can't convert object to primitive value");
325
327
  };
326
328
 
@@ -359,14 +361,14 @@ var store$2 = sharedStore;
359
361
  source: 'https://github.com/zloirock/core-js'
360
362
  });
361
363
 
362
- var requireObjectCoercible$5 = requireObjectCoercible$7;
364
+ var requireObjectCoercible$4 = requireObjectCoercible$6;
363
365
 
364
366
  var $Object$2 = Object;
365
367
 
366
368
  // `ToObject` abstract operation
367
369
  // https://tc39.es/ecma262/#sec-toobject
368
370
  var toObject$5 = function (argument) {
369
- return $Object$2(requireObjectCoercible$5(argument));
371
+ return $Object$2(requireObjectCoercible$4(argument));
370
372
  };
371
373
 
372
374
  var uncurryThis$i = functionUncurryThis;
@@ -385,10 +387,10 @@ var uncurryThis$h = functionUncurryThis;
385
387
 
386
388
  var id = 0;
387
389
  var postfix = Math.random();
388
- var toString$8 = uncurryThis$h(1.0.toString);
390
+ var toString$7 = uncurryThis$h(1.0.toString);
389
391
 
390
392
  var uid$2 = function (key) {
391
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$8(++id + postfix, 36);
393
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$7(++id + postfix, 36);
392
394
  };
393
395
 
394
396
  var global$i = global$n;
@@ -416,10 +418,10 @@ var wellKnownSymbol$i = function (name) {
416
418
  } return WellKnownSymbolsStore[name];
417
419
  };
418
420
 
419
- var call$g = functionCall;
421
+ var call$f = functionCall;
420
422
  var isObject$8 = isObject$a;
421
423
  var isSymbol$1 = isSymbol$2;
422
- var getMethod$4 = getMethod$5;
424
+ var getMethod$3 = getMethod$4;
423
425
  var ordinaryToPrimitive = ordinaryToPrimitive$1;
424
426
  var wellKnownSymbol$h = wellKnownSymbol$i;
425
427
 
@@ -430,11 +432,11 @@ var TO_PRIMITIVE = wellKnownSymbol$h('toPrimitive');
430
432
  // https://tc39.es/ecma262/#sec-toprimitive
431
433
  var toPrimitive$1 = function (input, pref) {
432
434
  if (!isObject$8(input) || isSymbol$1(input)) return input;
433
- var exoticToPrim = getMethod$4(input, TO_PRIMITIVE);
435
+ var exoticToPrim = getMethod$3(input, TO_PRIMITIVE);
434
436
  var result;
435
437
  if (exoticToPrim) {
436
438
  if (pref === undefined) pref = 'default';
437
- result = call$g(exoticToPrim, input, pref);
439
+ result = call$f(exoticToPrim, input, pref);
438
440
  if (!isObject$8(result) || isSymbol$1(result)) return result;
439
441
  throw $TypeError$c("Can't convert object to primitive value");
440
442
  }
@@ -476,7 +478,7 @@ var ie8DomDefine = !DESCRIPTORS$a && !fails$i(function () {
476
478
  });
477
479
 
478
480
  var DESCRIPTORS$9 = descriptors;
479
- var call$f = functionCall;
481
+ var call$e = functionCall;
480
482
  var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
481
483
  var createPropertyDescriptor$2 = createPropertyDescriptor$3;
482
484
  var toIndexedObject$4 = toIndexedObject$5;
@@ -495,7 +497,7 @@ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$9 ? $getOwnPropertyDescriptor$1 :
495
497
  if (IE8_DOM_DEFINE$1) try {
496
498
  return $getOwnPropertyDescriptor$1(O, P);
497
499
  } catch (error) { /* empty */ }
498
- if (hasOwn$9(O, P)) return createPropertyDescriptor$2(!call$f(propertyIsEnumerableModule$1.f, O, P), O[P]);
500
+ if (hasOwn$9(O, P)) return createPropertyDescriptor$2(!call$e(propertyIsEnumerableModule$1.f, O, P), O[P]);
499
501
  };
500
502
 
501
503
  var objectDefineProperty = {};
@@ -519,7 +521,7 @@ var $String$2 = String;
519
521
  var $TypeError$b = TypeError;
520
522
 
521
523
  // `Assert: Type(argument) is Object`
522
- var anObject$f = function (argument) {
524
+ var anObject$e = function (argument) {
523
525
  if (isObject$6(argument)) return argument;
524
526
  throw $TypeError$b($String$2(argument) + ' is not an object');
525
527
  };
@@ -527,7 +529,7 @@ var anObject$f = function (argument) {
527
529
  var DESCRIPTORS$7 = descriptors;
528
530
  var IE8_DOM_DEFINE = ie8DomDefine;
529
531
  var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
530
- var anObject$e = anObject$f;
532
+ var anObject$d = anObject$e;
531
533
  var toPropertyKey = toPropertyKey$2;
532
534
 
533
535
  var $TypeError$a = TypeError;
@@ -542,9 +544,9 @@ var WRITABLE = 'writable';
542
544
  // `Object.defineProperty` method
543
545
  // https://tc39.es/ecma262/#sec-object.defineproperty
544
546
  objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
545
- anObject$e(O);
547
+ anObject$d(O);
546
548
  P = toPropertyKey(P);
547
- anObject$e(Attributes);
549
+ anObject$d(Attributes);
548
550
  if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
549
551
  var current = $getOwnPropertyDescriptor(O, P);
550
552
  if (current && current[WRITABLE]) {
@@ -557,9 +559,9 @@ objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function de
557
559
  }
558
560
  } return $defineProperty(O, P, Attributes);
559
561
  } : $defineProperty : function defineProperty(O, P, Attributes) {
560
- anObject$e(O);
562
+ anObject$d(O);
561
563
  P = toPropertyKey(P);
562
- anObject$e(Attributes);
564
+ anObject$d(Attributes);
563
565
  if (IE8_DOM_DEFINE) try {
564
566
  return $defineProperty(O, P, Attributes);
565
567
  } catch (error) { /* empty */ }
@@ -921,13 +923,13 @@ var getBuiltIn$5 = getBuiltIn$8;
921
923
  var uncurryThis$e = functionUncurryThis;
922
924
  var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
923
925
  var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
924
- var anObject$d = anObject$f;
926
+ var anObject$c = anObject$e;
925
927
 
926
928
  var concat$2 = uncurryThis$e([].concat);
927
929
 
928
930
  // all object keys, includes non-enumerable and symbols
929
931
  var ownKeys$1 = getBuiltIn$5('Reflect', 'ownKeys') || function ownKeys(it) {
930
- var keys = getOwnPropertyNamesModule.f(anObject$d(it));
932
+ var keys = getOwnPropertyNamesModule.f(anObject$c(it));
931
933
  var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
932
934
  return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys;
933
935
  };
@@ -1039,7 +1041,7 @@ var objectKeys$2 = Object.keys || function keys(O) {
1039
1041
 
1040
1042
  var DESCRIPTORS$3 = descriptors;
1041
1043
  var uncurryThis$d = functionUncurryThis;
1042
- var call$e = functionCall;
1044
+ var call$d = functionCall;
1043
1045
  var fails$e = fails$n;
1044
1046
  var objectKeys$1 = objectKeys$2;
1045
1047
  var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
@@ -1089,7 +1091,7 @@ var objectAssign = !$assign || fails$e(function () {
1089
1091
  var key;
1090
1092
  while (length > j) {
1091
1093
  key = keys[j++];
1092
- if (!DESCRIPTORS$3 || call$e(propertyIsEnumerable, S, key)) T[key] = S[key];
1094
+ if (!DESCRIPTORS$3 || call$d(propertyIsEnumerable, S, key)) T[key] = S[key];
1093
1095
  }
1094
1096
  } return T;
1095
1097
  } : $assign;
@@ -1109,7 +1111,7 @@ var objectDefineProperties = {};
1109
1111
  var DESCRIPTORS$2 = descriptors;
1110
1112
  var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1111
1113
  var definePropertyModule$1 = objectDefineProperty;
1112
- var anObject$c = anObject$f;
1114
+ var anObject$b = anObject$e;
1113
1115
  var toIndexedObject$1 = toIndexedObject$5;
1114
1116
  var objectKeys = objectKeys$2;
1115
1117
 
@@ -1117,7 +1119,7 @@ var objectKeys = objectKeys$2;
1117
1119
  // https://tc39.es/ecma262/#sec-object.defineproperties
1118
1120
  // eslint-disable-next-line es/no-object-defineproperties -- safe
1119
1121
  objectDefineProperties.f = DESCRIPTORS$2 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1120
- anObject$c(O);
1122
+ anObject$b(O);
1121
1123
  var props = toIndexedObject$1(Properties);
1122
1124
  var keys = objectKeys(Properties);
1123
1125
  var length = keys.length;
@@ -1133,7 +1135,7 @@ var html$2 = getBuiltIn$4('document', 'documentElement');
1133
1135
 
1134
1136
  /* global ActiveXObject -- old IE, WSH */
1135
1137
 
1136
- var anObject$b = anObject$f;
1138
+ var anObject$a = anObject$e;
1137
1139
  var definePropertiesModule = objectDefineProperties;
1138
1140
  var enumBugKeys = enumBugKeys$3;
1139
1141
  var hiddenKeys = hiddenKeys$4;
@@ -1207,7 +1209,7 @@ hiddenKeys[IE_PROTO$1] = true;
1207
1209
  var objectCreate = Object.create || function create(O, Properties) {
1208
1210
  var result;
1209
1211
  if (O !== null) {
1210
- EmptyConstructor[PROTOTYPE] = anObject$b(O);
1212
+ EmptyConstructor[PROTOTYPE] = anObject$a(O);
1211
1213
  result = new EmptyConstructor();
1212
1214
  EmptyConstructor[PROTOTYPE] = null;
1213
1215
  // add "__proto__" for Object.getPrototypeOf polyfill
@@ -1358,7 +1360,7 @@ var aPossiblePrototype$1 = function (argument) {
1358
1360
  /* eslint-disable no-proto -- safe */
1359
1361
 
1360
1362
  var uncurryThis$c = functionUncurryThis;
1361
- var anObject$a = anObject$f;
1363
+ var anObject$9 = anObject$e;
1362
1364
  var aPossiblePrototype = aPossiblePrototype$1;
1363
1365
 
1364
1366
  // `Object.setPrototypeOf` method
@@ -1376,7 +1378,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1376
1378
  CORRECT_SETTER = test instanceof Array;
1377
1379
  } catch (error) { /* empty */ }
1378
1380
  return function setPrototypeOf(O, proto) {
1379
- anObject$a(O);
1381
+ anObject$9(O);
1380
1382
  aPossiblePrototype(proto);
1381
1383
  if (CORRECT_SETTER) setter(O, proto);
1382
1384
  else O.__proto__ = proto;
@@ -1385,7 +1387,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1385
1387
  }() : undefined);
1386
1388
 
1387
1389
  var $$d = _export;
1388
- var call$d = functionCall;
1390
+ var call$c = functionCall;
1389
1391
  var FunctionName = functionName;
1390
1392
  var isCallable$8 = isCallable$m;
1391
1393
  var createIteratorConstructor = iteratorCreateConstructor;
@@ -1454,7 +1456,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1454
1456
  createNonEnumerableProperty$2(IterablePrototype, 'name', VALUES);
1455
1457
  } else {
1456
1458
  INCORRECT_VALUES_NAME = true;
1457
- defaultIterator = function values() { return call$d(nativeIterator, this); };
1459
+ defaultIterator = function values() { return call$c(nativeIterator, this); };
1458
1460
  }
1459
1461
  }
1460
1462
 
@@ -1710,7 +1712,7 @@ const TRANSLATION_PAIRS_WIDGET = {
1710
1712
  'widget.nameRequired': 'Name is required',
1711
1713
  'widget.widgetTitle': 'Widget Title',
1712
1714
  'widget.widgetTitlePlaceholder': 'Enter Widget Title',
1713
- 'widget.widgetTitleRequired': 'Section Widget is required',
1715
+ 'widget.widgetTitleRequired': 'Widget Title is required',
1714
1716
  'widget.itemsType': 'Items Type',
1715
1717
  'widget.itemsTypePlaceholder': 'Select Items Type',
1716
1718
  'widget.widgetType': 'Widget Type',
@@ -1738,7 +1740,8 @@ const TRANSLATION_PAIRS_WIDGET = {
1738
1740
  'widget.tabletPerRowRequired': 'Tablet Per Row is required',
1739
1741
  'widget.mobilePerRowRequired': 'Mobile Per Row is required',
1740
1742
  'widget.tabDeleteTitle': 'Are you sure you want to delete this tab?',
1741
- 'widget.widgetTitleInfo': 'HTML is supported'
1743
+ 'widget.widgetTitleInfo': 'HTML is supported',
1744
+ 'widget.minPerRow': 'Value must be greater than zero'
1742
1745
  };
1743
1746
  const TRANSLATION_PAIRS_ITEM = {
1744
1747
  'item.title': 'Title',
@@ -1847,17 +1850,17 @@ var classof$5 = classof$6;
1847
1850
 
1848
1851
  var $String = String;
1849
1852
 
1850
- var toString$7 = function (argument) {
1853
+ var toString$6 = function (argument) {
1851
1854
  if (classof$5(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1852
1855
  return $String(argument);
1853
1856
  };
1854
1857
 
1855
- var anObject$9 = anObject$f;
1858
+ var anObject$8 = anObject$e;
1856
1859
 
1857
1860
  // `RegExp.prototype.flags` getter implementation
1858
1861
  // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
1859
1862
  var regexpFlags$1 = function () {
1860
- var that = anObject$9(this);
1863
+ var that = anObject$8(this);
1861
1864
  var result = '';
1862
1865
  if (that.hasIndices) result += 'd';
1863
1866
  if (that.global) result += 'g';
@@ -1926,9 +1929,9 @@ var regexpUnsupportedNcg = fails$9(function () {
1926
1929
 
1927
1930
  /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
1928
1931
  /* eslint-disable regexp/no-useless-quantifier -- testing */
1929
- var call$c = functionCall;
1932
+ var call$b = functionCall;
1930
1933
  var uncurryThis$b = functionUncurryThis;
1931
- var toString$6 = toString$7;
1934
+ var toString$5 = toString$6;
1932
1935
  var regexpFlags = regexpFlags$1;
1933
1936
  var stickyHelpers = regexpStickyHelpers;
1934
1937
  var shared = shared$4.exports;
@@ -1948,8 +1951,8 @@ var stringSlice$3 = uncurryThis$b(''.slice);
1948
1951
  var UPDATES_LAST_INDEX_WRONG = (function () {
1949
1952
  var re1 = /a/;
1950
1953
  var re2 = /b*/g;
1951
- call$c(nativeExec, re1, 'a');
1952
- call$c(nativeExec, re2, 'a');
1954
+ call$b(nativeExec, re1, 'a');
1955
+ call$b(nativeExec, re2, 'a');
1953
1956
  return re1.lastIndex !== 0 || re2.lastIndex !== 0;
1954
1957
  })();
1955
1958
 
@@ -1964,20 +1967,20 @@ if (PATCH) {
1964
1967
  patchedExec = function exec(string) {
1965
1968
  var re = this;
1966
1969
  var state = getInternalState(re);
1967
- var str = toString$6(string);
1970
+ var str = toString$5(string);
1968
1971
  var raw = state.raw;
1969
1972
  var result, reCopy, lastIndex, match, i, object, group;
1970
1973
 
1971
1974
  if (raw) {
1972
1975
  raw.lastIndex = re.lastIndex;
1973
- result = call$c(patchedExec, raw, str);
1976
+ result = call$b(patchedExec, raw, str);
1974
1977
  re.lastIndex = raw.lastIndex;
1975
1978
  return result;
1976
1979
  }
1977
1980
 
1978
1981
  var groups = state.groups;
1979
1982
  var sticky = UNSUPPORTED_Y && re.sticky;
1980
- var flags = call$c(regexpFlags, re);
1983
+ var flags = call$b(regexpFlags, re);
1981
1984
  var source = re.source;
1982
1985
  var charsAdded = 0;
1983
1986
  var strCopy = str;
@@ -2005,7 +2008,7 @@ if (PATCH) {
2005
2008
  }
2006
2009
  if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
2007
2010
 
2008
- match = call$c(nativeExec, sticky ? reCopy : re, strCopy);
2011
+ match = call$b(nativeExec, sticky ? reCopy : re, strCopy);
2009
2012
 
2010
2013
  if (sticky) {
2011
2014
  if (match) {
@@ -2020,7 +2023,7 @@ if (PATCH) {
2020
2023
  if (NPCG_INCLUDED && match && match.length > 1) {
2021
2024
  // Fix browsers whose `exec` methods don't consistently return `undefined`
2022
2025
  // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
2023
- call$c(nativeReplace, match[0], reCopy, function () {
2026
+ call$b(nativeReplace, match[0], reCopy, function () {
2024
2027
  for (i = 1; i < arguments.length - 2; i++) {
2025
2028
  if (arguments[i] === undefined) match[i] = undefined;
2026
2029
  }
@@ -2054,11 +2057,11 @@ var NATIVE_BIND$1 = functionBindNative;
2054
2057
 
2055
2058
  var FunctionPrototype = Function.prototype;
2056
2059
  var apply$2 = FunctionPrototype.apply;
2057
- var call$b = FunctionPrototype.call;
2060
+ var call$a = FunctionPrototype.call;
2058
2061
 
2059
2062
  // eslint-disable-next-line es/no-reflect -- safe
2060
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$b.bind(apply$2) : function () {
2061
- return call$b.apply(apply$2, arguments);
2063
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$a.bind(apply$2) : function () {
2064
+ return call$a.apply(apply$2, arguments);
2062
2065
  });
2063
2066
 
2064
2067
  var classofRaw = classofRaw$2;
@@ -2147,8 +2150,8 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
2147
2150
 
2148
2151
  var uncurryThis$8 = functionUncurryThis;
2149
2152
  var toIntegerOrInfinity$1 = toIntegerOrInfinity$4;
2150
- var toString$5 = toString$7;
2151
- var requireObjectCoercible$4 = requireObjectCoercible$7;
2153
+ var toString$4 = toString$6;
2154
+ var requireObjectCoercible$3 = requireObjectCoercible$6;
2152
2155
 
2153
2156
  var charAt$2 = uncurryThis$8(''.charAt);
2154
2157
  var charCodeAt = uncurryThis$8(''.charCodeAt);
@@ -2156,7 +2159,7 @@ var stringSlice$2 = uncurryThis$8(''.slice);
2156
2159
 
2157
2160
  var createMethod$2 = function (CONVERT_TO_STRING) {
2158
2161
  return function ($this, pos) {
2159
- var S = toString$5(requireObjectCoercible$4($this));
2162
+ var S = toString$4(requireObjectCoercible$3($this));
2160
2163
  var position = toIntegerOrInfinity$1(pos);
2161
2164
  var size = S.length;
2162
2165
  var first, second;
@@ -2235,8 +2238,8 @@ var getSubstitution$1 = function (matched, str, position, captures, namedCapture
2235
2238
  });
2236
2239
  };
2237
2240
 
2238
- var call$a = functionCall;
2239
- var anObject$8 = anObject$f;
2241
+ var call$9 = functionCall;
2242
+ var anObject$7 = anObject$e;
2240
2243
  var isCallable$6 = isCallable$m;
2241
2244
  var classof$4 = classofRaw$2;
2242
2245
  var regexpExec = regexpExec$2;
@@ -2248,30 +2251,30 @@ var $TypeError$8 = TypeError;
2248
2251
  var regexpExecAbstract = function (R, S) {
2249
2252
  var exec = R.exec;
2250
2253
  if (isCallable$6(exec)) {
2251
- var result = call$a(exec, R, S);
2252
- if (result !== null) anObject$8(result);
2254
+ var result = call$9(exec, R, S);
2255
+ if (result !== null) anObject$7(result);
2253
2256
  return result;
2254
2257
  }
2255
- if (classof$4(R) === 'RegExp') return call$a(regexpExec, R, S);
2258
+ if (classof$4(R) === 'RegExp') return call$9(regexpExec, R, S);
2256
2259
  throw $TypeError$8('RegExp#exec called on incompatible receiver');
2257
2260
  };
2258
2261
 
2259
2262
  var apply$1 = functionApply;
2260
- var call$9 = functionCall;
2263
+ var call$8 = functionCall;
2261
2264
  var uncurryThis$6 = functionUncurryThis;
2262
- var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
2265
+ var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
2263
2266
  var fails$7 = fails$n;
2264
- var anObject$7 = anObject$f;
2267
+ var anObject$6 = anObject$e;
2265
2268
  var isCallable$5 = isCallable$m;
2266
- var isNullOrUndefined$3 = isNullOrUndefined$6;
2269
+ var isNullOrUndefined$2 = isNullOrUndefined$5;
2267
2270
  var toIntegerOrInfinity = toIntegerOrInfinity$4;
2268
2271
  var toLength = toLength$2;
2269
- var toString$4 = toString$7;
2270
- var requireObjectCoercible$3 = requireObjectCoercible$7;
2272
+ var toString$3 = toString$6;
2273
+ var requireObjectCoercible$2 = requireObjectCoercible$6;
2271
2274
  var advanceStringIndex = advanceStringIndex$1;
2272
- var getMethod$3 = getMethod$5;
2275
+ var getMethod$2 = getMethod$4;
2273
2276
  var getSubstitution = getSubstitution$1;
2274
- var regExpExec$1 = regexpExecAbstract;
2277
+ var regExpExec = regexpExecAbstract;
2275
2278
  var wellKnownSymbol$8 = wellKnownSymbol$i;
2276
2279
 
2277
2280
  var REPLACE = wellKnownSymbol$8('replace');
@@ -2313,24 +2316,24 @@ var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$7(function () {
2313
2316
  });
2314
2317
 
2315
2318
  // @@replace logic
2316
- fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCallNative) {
2319
+ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
2317
2320
  var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
2318
2321
 
2319
2322
  return [
2320
2323
  // `String.prototype.replace` method
2321
2324
  // https://tc39.es/ecma262/#sec-string.prototype.replace
2322
2325
  function replace(searchValue, replaceValue) {
2323
- var O = requireObjectCoercible$3(this);
2324
- var replacer = isNullOrUndefined$3(searchValue) ? undefined : getMethod$3(searchValue, REPLACE);
2326
+ var O = requireObjectCoercible$2(this);
2327
+ var replacer = isNullOrUndefined$2(searchValue) ? undefined : getMethod$2(searchValue, REPLACE);
2325
2328
  return replacer
2326
- ? call$9(replacer, searchValue, O, replaceValue)
2327
- : call$9(nativeReplace, toString$4(O), searchValue, replaceValue);
2329
+ ? call$8(replacer, searchValue, O, replaceValue)
2330
+ : call$8(nativeReplace, toString$3(O), searchValue, replaceValue);
2328
2331
  },
2329
2332
  // `RegExp.prototype[@@replace]` method
2330
2333
  // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
2331
2334
  function (string, replaceValue) {
2332
- var rx = anObject$7(this);
2333
- var S = toString$4(string);
2335
+ var rx = anObject$6(this);
2336
+ var S = toString$3(string);
2334
2337
 
2335
2338
  if (
2336
2339
  typeof replaceValue == 'string' &&
@@ -2342,7 +2345,7 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
2342
2345
  }
2343
2346
 
2344
2347
  var functionalReplace = isCallable$5(replaceValue);
2345
- if (!functionalReplace) replaceValue = toString$4(replaceValue);
2348
+ if (!functionalReplace) replaceValue = toString$3(replaceValue);
2346
2349
 
2347
2350
  var global = rx.global;
2348
2351
  if (global) {
@@ -2351,13 +2354,13 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
2351
2354
  }
2352
2355
  var results = [];
2353
2356
  while (true) {
2354
- var result = regExpExec$1(rx, S);
2357
+ var result = regExpExec(rx, S);
2355
2358
  if (result === null) break;
2356
2359
 
2357
2360
  push(results, result);
2358
2361
  if (!global) break;
2359
2362
 
2360
- var matchStr = toString$4(result[0]);
2363
+ var matchStr = toString$3(result[0]);
2361
2364
  if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
2362
2365
  }
2363
2366
 
@@ -2366,7 +2369,7 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
2366
2369
  for (var i = 0; i < results.length; i++) {
2367
2370
  result = results[i];
2368
2371
 
2369
- var matched = toString$4(result[0]);
2372
+ var matched = toString$3(result[0]);
2370
2373
  var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
2371
2374
  var captures = [];
2372
2375
  // NOTE: This is equivalent to
@@ -2379,7 +2382,7 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
2379
2382
  if (functionalReplace) {
2380
2383
  var replacerArgs = concat([matched], captures, position, S);
2381
2384
  if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
2382
- var replacement = toString$4(apply$1(replaceValue, undefined, replacerArgs));
2385
+ var replacement = toString$3(apply$1(replaceValue, undefined, replacerArgs));
2383
2386
  } else {
2384
2387
  replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
2385
2388
  }
@@ -2419,8 +2422,8 @@ var whitespaces$3 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u200
2419
2422
  '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
2420
2423
 
2421
2424
  var uncurryThis$5 = functionUncurryThis;
2422
- var requireObjectCoercible$2 = requireObjectCoercible$7;
2423
- var toString$3 = toString$7;
2425
+ var requireObjectCoercible$1 = requireObjectCoercible$6;
2426
+ var toString$2 = toString$6;
2424
2427
  var whitespaces$2 = whitespaces$3;
2425
2428
 
2426
2429
  var replace = uncurryThis$5(''.replace);
@@ -2431,7 +2434,7 @@ var rtrim = RegExp(whitespace + whitespace + '*$');
2431
2434
  // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
2432
2435
  var createMethod$1 = function (TYPE) {
2433
2436
  return function ($this) {
2434
- var string = toString$3(requireObjectCoercible$2($this));
2437
+ var string = toString$2(requireObjectCoercible$1($this));
2435
2438
  if (TYPE & 1) string = replace(string, ltrim, '');
2436
2439
  if (TYPE & 2) string = replace(string, rtrim, '');
2437
2440
  return string;
@@ -2531,7 +2534,7 @@ const build_path = (...args) => {
2531
2534
  var global$9 = global$n;
2532
2535
  var fails$4 = fails$n;
2533
2536
  var uncurryThis$4 = functionUncurryThis;
2534
- var toString$2 = toString$7;
2537
+ var toString$1 = toString$6;
2535
2538
  var trim = stringTrim.trim;
2536
2539
  var whitespaces = whitespaces$3;
2537
2540
 
@@ -2547,7 +2550,7 @@ var FORCED = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces +
2547
2550
  // `parseInt` method
2548
2551
  // https://tc39.es/ecma262/#sec-parseint-string-radix
2549
2552
  var numberParseInt = FORCED ? function parseInt(string, radix) {
2550
- var S = trim(toString$2(string));
2553
+ var S = trim(toString$1(string));
2551
2554
  return $parseInt$1(S, (radix >>> 0) || (exec$1(hex, S) ? 16 : 10));
2552
2555
  } : $parseInt$1;
2553
2556
 
@@ -2561,90 +2564,34 @@ $$9({ target: 'Number', stat: true, forced: Number.parseInt != parseInt$1 }, {
2561
2564
  parseInt: parseInt$1
2562
2565
  });
2563
2566
 
2564
- // `SameValue` abstract operation
2565
- // https://tc39.es/ecma262/#sec-samevalue
2566
- // eslint-disable-next-line es/no-object-is -- safe
2567
- var sameValue$1 = Object.is || function is(x, y) {
2568
- // eslint-disable-next-line no-self-compare -- NaN check
2569
- return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
2570
- };
2571
-
2572
- var call$8 = functionCall;
2573
- var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
2574
- var anObject$6 = anObject$f;
2575
- var isNullOrUndefined$2 = isNullOrUndefined$6;
2576
- var requireObjectCoercible$1 = requireObjectCoercible$7;
2577
- var sameValue = sameValue$1;
2578
- var toString$1 = toString$7;
2579
- var getMethod$2 = getMethod$5;
2580
- var regExpExec = regexpExecAbstract;
2581
-
2582
- // @@search logic
2583
- fixRegExpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCallNative) {
2584
- return [
2585
- // `String.prototype.search` method
2586
- // https://tc39.es/ecma262/#sec-string.prototype.search
2587
- function search(regexp) {
2588
- var O = requireObjectCoercible$1(this);
2589
- var searcher = isNullOrUndefined$2(regexp) ? undefined : getMethod$2(regexp, SEARCH);
2590
- return searcher ? call$8(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString$1(O));
2591
- },
2592
- // `RegExp.prototype[@@search]` method
2593
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@search
2594
- function (string) {
2595
- var rx = anObject$6(this);
2596
- var S = toString$1(string);
2597
- var res = maybeCallNative(nativeSearch, rx, S);
2598
-
2599
- if (res.done) return res.value;
2600
-
2601
- var previousLastIndex = rx.lastIndex;
2602
- if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
2603
- var result = regExpExec(rx, S);
2604
- if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
2605
- return result === null ? -1 : result.index;
2606
- }
2607
- ];
2608
- });
2609
-
2610
2567
  const usePagination = ({
2611
2568
  defaultLimit
2612
2569
  }) => {
2613
- const defaultApiPayload = {
2614
- search: "",
2615
- offset: DEFAULT_OFFSET_PAYLOAD,
2616
- limit: defaultLimit || DEFAULT_LIMIT
2617
- };
2618
- const [filter, setFilter] = React.useState(defaultApiPayload);
2619
- const [currentPage, setCurrentPage] = React.useState(DEFAULT_CURRENT_PAGE);
2570
+ const offsetRef = React.useRef(DEFAULT_OFFSET_PAYLOAD);
2571
+ const limitRef = React.useRef(defaultLimit || DEFAULT_LIMIT);
2572
+ const currentPageRef = React.useRef(DEFAULT_CURRENT_PAGE);
2573
+ const searchRef = React.useRef('');
2620
2574
  const setPageSize = value => {
2621
- setFilter(Object.assign(Object.assign({}, filter), {
2622
- limit: Number.parseInt(String(value), DECIMAL_REDIX),
2623
- offset: DEFAULT_OFFSET_PAYLOAD
2624
- }));
2625
- setCurrentPage(DEFAULT_CURRENT_PAGE);
2575
+ limitRef.current = Number.parseInt(String(value), DECIMAL_REDIX);
2576
+ offsetRef.current = DEFAULT_OFFSET_PAYLOAD;
2577
+ currentPageRef.current = DEFAULT_CURRENT_PAGE;
2626
2578
  };
2627
2579
  const changeSearch = value => {
2628
- setFilter(draft => {
2629
- draft.search = value;
2630
- return draft;
2631
- });
2580
+ searchRef.current = value;
2632
2581
  };
2633
2582
  const changeCurrentPage = value => {
2634
- setFilter(Object.assign(Object.assign({}, filter), {
2635
- offset: Math.max(value - 1, 1) * filter.limit
2636
- }));
2637
- setCurrentPage(value);
2583
+ currentPageRef.current = value;
2584
+ offsetRef.current = value * limitRef.current;
2638
2585
  };
2639
2586
  return {
2640
- pageSize: filter.limit,
2587
+ pageSize: limitRef.current,
2588
+ currentPageRef,
2589
+ limitRef,
2590
+ offsetRef,
2591
+ searchRef,
2641
2592
  setPageSize,
2642
- currentPage,
2643
2593
  changeSearch,
2644
- filter,
2645
- setCurrentPage: changeCurrentPage,
2646
- defaultApiPayload,
2647
- setFilter
2594
+ setCurrentPage: changeCurrentPage
2648
2595
  };
2649
2596
  };
2650
2597
 
@@ -2804,9 +2751,12 @@ const usePage = ({
2804
2751
  const {
2805
2752
  setPageSize,
2806
2753
  pageSize,
2807
- currentPage,
2754
+ currentPageRef,
2808
2755
  setCurrentPage,
2809
- filter
2756
+ offsetRef,
2757
+ limitRef,
2758
+ searchRef,
2759
+ changeSearch
2810
2760
  } = usePagination({
2811
2761
  defaultLimit
2812
2762
  });
@@ -2871,9 +2821,9 @@ const usePage = ({
2871
2821
  data: {
2872
2822
  search,
2873
2823
  options: {
2874
- offset: filter.offset,
2875
- limit: filter.limit,
2876
- page: currentPage
2824
+ offset: offsetRef.current,
2825
+ limit: limitRef.current,
2826
+ page: currentPageRef.current
2877
2827
  }
2878
2828
  }
2879
2829
  });
@@ -2887,7 +2837,7 @@ const usePage = ({
2887
2837
  } catch (error) {
2888
2838
  setLoading(false);
2889
2839
  }
2890
- }), [baseUrl, currentPage, filter.limit, filter.offset, handleError, pageRoutesPrefix, routes, token]);
2840
+ }), [baseUrl, currentPageRef, limitRef, offsetRef, handleError, pageRoutesPrefix, routes, token]);
2891
2841
  const onPageFormSubmit = data => __awaiter(void 0, void 0, void 0, function* () {
2892
2842
  setLoading(true);
2893
2843
  const code = formState === 'ADD' ? CALLBACK_CODES.CREATE : CALLBACK_CODES.UPDATE;
@@ -2983,21 +2933,27 @@ const usePage = ({
2983
2933
  return temporaryData;
2984
2934
  });
2985
2935
  };
2936
+ const changeCurrentPage = page => {
2937
+ setCurrentPage(page);
2938
+ getPages(searchRef.current);
2939
+ };
2986
2940
  React.useEffect(() => {
2987
2941
  if (_canList) getPages();
2988
2942
  // eslint-disable-next-line react-hooks/exhaustive-deps
2989
- }, [pageSize, currentPage, _canList]);
2943
+ }, [pageSize, _canList]);
2990
2944
  return {
2991
2945
  list,
2992
2946
  getPages,
2993
2947
  loading,
2994
2948
  setLoading,
2995
2949
  // Pagination
2950
+ searchText: searchRef.current,
2951
+ changeSearch,
2996
2952
  pageSize,
2997
2953
  totalPages,
2998
- currentPage,
2954
+ currentPage: currentPageRef.current,
2999
2955
  totalRecords,
3000
- setCurrentPage,
2956
+ setCurrentPage: changeCurrentPage,
3001
2957
  setPageSize,
3002
2958
  // Form
3003
2959
  widgets,
@@ -3019,6 +2975,8 @@ const PageContext = /*#__PURE__*/React.createContext(null);
3019
2975
  const PageContextProvider = ({
3020
2976
  t: _t = key => Object.assign({}, TRANSLATION_PAIRS_COMMON)[key],
3021
2977
  // Form
2978
+ searchText: _searchText = '',
2979
+ changeSearch: _changeSearch = () => {},
3022
2980
  list: _list = [],
3023
2981
  widgets: _widgets = [],
3024
2982
  formState: _formState = '',
@@ -3055,6 +3013,8 @@ const PageContextProvider = ({
3055
3013
  t: _t,
3056
3014
  // Form
3057
3015
  list: _list,
3016
+ searchText: _searchText,
3017
+ changeSearch: _changeSearch,
3058
3018
  widgets: _widgets,
3059
3019
  closeForm: _closeForm,
3060
3020
  formState: _formState,
@@ -3513,26 +3473,55 @@ const SrcSet = ({
3513
3473
  }, error));
3514
3474
  };
3515
3475
 
3476
+ const App = ({
3477
+ label,
3478
+ wrapperClassName,
3479
+ required,
3480
+ value,
3481
+ error,
3482
+ onChange
3483
+ }) => {
3484
+ return /*#__PURE__*/React__default["default"].createElement("div", {
3485
+ className: classNames__default["default"]('khb_input-wrapper', wrapperClassName)
3486
+ }, label && /*#__PURE__*/React__default["default"].createElement("label", {
3487
+ className: "khb_input-label"
3488
+ }, label, required ? /*#__PURE__*/React__default["default"].createElement("span", {
3489
+ className: "khb_input-label-required"
3490
+ }, "*") : null), /*#__PURE__*/React__default["default"].createElement(SunEditor__default["default"], {
3491
+ setContents: value,
3492
+ onChange: onChange,
3493
+ setOptions: {
3494
+ defaultStyle: 'font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial; font-size: 0.875rem;',
3495
+ buttonList: [['undo', 'redo', 'align'], ['bold', 'underline', 'italic', 'strike', 'subscript', 'superscript'], ['fontColor', 'hiliteColor'], ['removeFormat']]
3496
+ }
3497
+ }), error && /*#__PURE__*/React__default["default"].createElement("p", {
3498
+ className: "khb_input-error "
3499
+ }, error));
3500
+ };
3501
+
3516
3502
  var Input = Object.assign(Input$1, {
3517
3503
  Select,
3518
3504
  ReactSelect: CustomReactSelect,
3519
3505
  Checkbox,
3520
- SrcSet
3506
+ SrcSet,
3507
+ HTML: App
3521
3508
  });
3522
3509
 
3523
3510
  const PageSearch = () => {
3524
3511
  const {
3525
- getPages,
3526
3512
  t,
3527
- canList
3513
+ canList,
3514
+ changeSearch,
3515
+ setCurrentPage
3528
3516
  } = usePageState();
3529
3517
  const callerRef = React.useRef(null);
3530
3518
  const [search, setSearch] = React.useState('');
3531
3519
  const onChangeSearch = str => {
3532
3520
  setSearch(str);
3521
+ changeSearch(str);
3533
3522
  if (callerRef.current) clearTimeout(callerRef.current);
3534
3523
  callerRef.current = setTimeout(() => {
3535
- getPages(str);
3524
+ setCurrentPage(1);
3536
3525
  }, 300);
3537
3526
  };
3538
3527
  return /*#__PURE__*/React__default["default"].createElement(Input, {
@@ -3559,8 +3548,8 @@ var regexpGetFlags = function (R) {
3559
3548
 
3560
3549
  var PROPER_FUNCTION_NAME = functionName.PROPER;
3561
3550
  var defineBuiltIn$2 = defineBuiltIn$7;
3562
- var anObject$5 = anObject$f;
3563
- var $toString = toString$7;
3551
+ var anObject$5 = anObject$e;
3552
+ var $toString = toString$6;
3564
3553
  var fails$3 = fails$n;
3565
3554
  var getRegExpFlags = regexpGetFlags;
3566
3555
 
@@ -3934,6 +3923,26 @@ const SimpleForm = /*#__PURE__*/React.forwardRef(({
3934
3923
  }
3935
3924
  });
3936
3925
  break;
3926
+ case 'html':
3927
+ input = /*#__PURE__*/React__default["default"].createElement(reactHookForm.Controller, {
3928
+ control: control,
3929
+ name: schema.accessor,
3930
+ rules: schema.validations,
3931
+ render: ({
3932
+ field
3933
+ }) => {
3934
+ var _a, _b;
3935
+ return /*#__PURE__*/React__default["default"].createElement(Input.HTML, {
3936
+ label: schema.label,
3937
+ error: (_b = (_a = errors[schema.accessor]) === null || _a === void 0 ? void 0 : _a.message) === null || _b === void 0 ? void 0 : _b.toString(),
3938
+ onInput: schema.onInput,
3939
+ required: schema.required,
3940
+ value: field.value,
3941
+ onChange: field.onChange
3942
+ });
3943
+ }
3944
+ });
3945
+ break;
3937
3946
  case 'text':
3938
3947
  case 'number':
3939
3948
  case 'url':
@@ -4189,26 +4198,21 @@ const Pagination = ({
4189
4198
  previousContent,
4190
4199
  nextContent
4191
4200
  }) => {
4192
- const [localCurrentPage, setLocalCurrentPage] = React.useState(currentPage);
4193
- const updatePagination = () => {
4194
- let newValue = localCurrentPage;
4195
- if (newValue) {
4201
+ const updatePagination = newValue => {
4202
+ if (newValue && typeof newValue === 'number') {
4196
4203
  if (newValue <= 0) {
4197
4204
  newValue = 1;
4198
4205
  } else if (newValue > totalPages) {
4199
4206
  newValue = totalPages;
4200
4207
  }
4201
4208
  setCurrentPage(newValue);
4202
- setLocalCurrentPage(newValue);
4203
4209
  }
4204
4210
  };
4205
4211
  const onPaginationButtonClick = dir => {
4206
4212
  if (dir === 'next') {
4207
- setCurrentPage(currentPage + 1);
4208
- setLocalCurrentPage(localCurrentPage + 1);
4213
+ updatePagination(currentPage + 1);
4209
4214
  } else {
4210
- setCurrentPage(currentPage - 1);
4211
- setLocalCurrentPage(localCurrentPage - 1);
4215
+ updatePagination(currentPage - 1);
4212
4216
  }
4213
4217
  };
4214
4218
  return /*#__PURE__*/React__default["default"].createElement("nav", {
@@ -4226,7 +4230,7 @@ const Pagination = ({
4226
4230
  size: "xs",
4227
4231
  type: "secondary",
4228
4232
  className: "khb_pagination-previous",
4229
- disabled: currentPage - 1 === 0,
4233
+ disabled: currentPage - 1 <= 0,
4230
4234
  onClick: () => onPaginationButtonClick('previous')
4231
4235
  }, previousContent || /*#__PURE__*/React__default["default"].createElement(ChevronLeft, {
4232
4236
  srText: "Previous"
@@ -4237,15 +4241,14 @@ const Pagination = ({
4237
4241
  size: "xs",
4238
4242
  type: "number",
4239
4243
  id: "page",
4240
- value: localCurrentPage,
4241
- onChange: e => setLocalCurrentPage(Number(e.target.value)),
4242
- onBlur: updatePagination,
4244
+ value: currentPage,
4245
+ onChange: e => updatePagination(Number(e.target.value)),
4243
4246
  disabled: !totalRecords
4244
4247
  }), ' ', "/ ", totalPages), /*#__PURE__*/React__default["default"].createElement(Button, {
4245
4248
  size: "xs",
4246
4249
  type: "secondary",
4247
4250
  className: "khb_pagination-next",
4248
- disabled: currentPage === totalPages || !totalRecords,
4251
+ disabled: currentPage >= totalPages,
4249
4252
  onClick: () => onPaginationButtonClick('next')
4250
4253
  }, nextContent || /*#__PURE__*/React__default["default"].createElement(ChevronRight, {
4251
4254
  srText: "Next"
@@ -4518,6 +4521,8 @@ const Page = ({
4518
4521
  currentPage,
4519
4522
  pageSize,
4520
4523
  itemData,
4524
+ searchText,
4525
+ changeSearch,
4521
4526
  setCurrentPage,
4522
4527
  formState,
4523
4528
  getWidgets,
@@ -4538,6 +4543,8 @@ const Page = ({
4538
4543
  t: derivedT,
4539
4544
  loader: loader,
4540
4545
  list: list,
4546
+ searchText: searchText,
4547
+ changeSearch: changeSearch,
4541
4548
  widgets: widgets,
4542
4549
  data: itemData,
4543
4550
  loading: loading,
@@ -4624,11 +4631,14 @@ const useWidget = ({
4624
4631
  itemsRoutesPrefix
4625
4632
  } = useProviderState();
4626
4633
  const {
4634
+ changeSearch,
4627
4635
  setPageSize,
4628
4636
  pageSize,
4629
- currentPage,
4637
+ limitRef,
4638
+ currentPageRef,
4630
4639
  setCurrentPage,
4631
- filter
4640
+ offsetRef,
4641
+ searchRef
4632
4642
  } = usePagination({
4633
4643
  defaultLimit
4634
4644
  });
@@ -4659,9 +4669,9 @@ const useWidget = ({
4659
4669
  data: {
4660
4670
  search,
4661
4671
  options: {
4662
- offset: filter.offset,
4663
- limit: filter.limit,
4664
- page: currentPage
4672
+ offset: offsetRef.current,
4673
+ limit: limitRef.current,
4674
+ page: currentPageRef.current
4665
4675
  }
4666
4676
  }
4667
4677
  });
@@ -4675,7 +4685,7 @@ const useWidget = ({
4675
4685
  } catch (error) {
4676
4686
  setLoading(false);
4677
4687
  }
4678
- }), [baseUrl, currentPage, filter.limit, filter.offset, handleError, routes, token, widgetRoutesPrefix]);
4688
+ }), [baseUrl, currentPageRef, limitRef, offsetRef, handleError, routes, token, widgetRoutesPrefix]);
4679
4689
  const getItems = React.useCallback(id => __awaiter(void 0, void 0, void 0, function* () {
4680
4690
  try {
4681
4691
  setItemsLoading(true);
@@ -5023,21 +5033,26 @@ const useWidget = ({
5023
5033
  onError(CALLBACK_CODES.IMAGE_REMOVE, INTERNAL_ERROR_CODE, error.message);
5024
5034
  }
5025
5035
  });
5036
+ const changeCurrentPage = page => {
5037
+ setCurrentPage(page);
5038
+ getWidgets(searchRef.current);
5039
+ };
5026
5040
  React.useEffect(() => {
5027
5041
  if (_canList) getWidgets();
5028
5042
  // eslint-disable-next-line react-hooks/exhaustive-deps
5029
- }, [pageSize, currentPage, _canList]);
5043
+ }, [_canList]);
5030
5044
  return {
5031
5045
  list,
5032
5046
  getWidgets,
5033
5047
  loading,
5034
5048
  setLoading,
5035
5049
  // Pagination
5050
+ searchText: searchRef.current,
5036
5051
  pageSize,
5037
5052
  totalPages,
5038
- currentPage,
5053
+ currentPage: currentPageRef.current,
5039
5054
  totalRecords,
5040
- setCurrentPage,
5055
+ setCurrentPage: changeCurrentPage,
5041
5056
  setPageSize,
5042
5057
  // Form
5043
5058
  formState,
@@ -5052,6 +5067,7 @@ const useWidget = ({
5052
5067
  onImageRemove,
5053
5068
  itemsTypes,
5054
5069
  widgetTypes,
5070
+ changeSearch,
5055
5071
  collectionDataLoading,
5056
5072
  getCollectionData,
5057
5073
  collectionData,
@@ -5154,9 +5170,9 @@ var aConstructor$1 = function (argument) {
5154
5170
  throw $TypeError$5(tryToString$2(argument) + ' is not a constructor');
5155
5171
  };
5156
5172
 
5157
- var anObject$4 = anObject$f;
5173
+ var anObject$4 = anObject$e;
5158
5174
  var aConstructor = aConstructor$1;
5159
- var isNullOrUndefined$1 = isNullOrUndefined$6;
5175
+ var isNullOrUndefined$1 = isNullOrUndefined$5;
5160
5176
  var wellKnownSymbol$6 = wellKnownSymbol$i;
5161
5177
 
5162
5178
  var SPECIES$1 = wellKnownSymbol$6('species');
@@ -5833,8 +5849,8 @@ var isArrayIteratorMethod$1 = function (it) {
5833
5849
  };
5834
5850
 
5835
5851
  var classof$1 = classof$6;
5836
- var getMethod$1 = getMethod$5;
5837
- var isNullOrUndefined = isNullOrUndefined$6;
5852
+ var getMethod$1 = getMethod$4;
5853
+ var isNullOrUndefined = isNullOrUndefined$5;
5838
5854
  var Iterators = iterators;
5839
5855
  var wellKnownSymbol$3 = wellKnownSymbol$i;
5840
5856
 
@@ -5848,7 +5864,7 @@ var getIteratorMethod$2 = function (it) {
5848
5864
 
5849
5865
  var call$5 = functionCall;
5850
5866
  var aCallable$2 = aCallable$8;
5851
- var anObject$3 = anObject$f;
5867
+ var anObject$3 = anObject$e;
5852
5868
  var tryToString$1 = tryToString$4;
5853
5869
  var getIteratorMethod$1 = getIteratorMethod$2;
5854
5870
 
@@ -5861,8 +5877,8 @@ var getIterator$1 = function (argument, usingIterator) {
5861
5877
  };
5862
5878
 
5863
5879
  var call$4 = functionCall;
5864
- var anObject$2 = anObject$f;
5865
- var getMethod = getMethod$5;
5880
+ var anObject$2 = anObject$e;
5881
+ var getMethod = getMethod$4;
5866
5882
 
5867
5883
  var iteratorClose$1 = function (iterator, kind, value) {
5868
5884
  var innerResult, innerError;
@@ -5886,7 +5902,7 @@ var iteratorClose$1 = function (iterator, kind, value) {
5886
5902
 
5887
5903
  var bind = functionBindContext;
5888
5904
  var call$3 = functionCall;
5889
- var anObject$1 = anObject$f;
5905
+ var anObject$1 = anObject$e;
5890
5906
  var tryToString = tryToString$4;
5891
5907
  var isArrayIteratorMethod = isArrayIteratorMethod$1;
5892
5908
  var lengthOfArrayLike = lengthOfArrayLike$3;
@@ -6105,7 +6121,7 @@ $$2({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
6105
6121
  }
6106
6122
  });
6107
6123
 
6108
- var anObject = anObject$f;
6124
+ var anObject = anObject$e;
6109
6125
  var isObject$1 = isObject$a;
6110
6126
  var newPromiseCapability = newPromiseCapability$2;
6111
6127
 
@@ -6138,6 +6154,8 @@ const WidgetContextProvider = ({
6138
6154
  t: _t = () => '',
6139
6155
  // Form
6140
6156
  list: _list = [],
6157
+ searchText: _searchText = '',
6158
+ changeSearch: _changeSearch = () => {},
6141
6159
  formState: _formState = '',
6142
6160
  closeForm: _closeForm = () => {},
6143
6161
  loading: _loading = false,
@@ -6190,6 +6208,8 @@ const WidgetContextProvider = ({
6190
6208
  closeForm: _closeForm,
6191
6209
  formState: _formState,
6192
6210
  loading: _loading,
6211
+ searchText: _searchText,
6212
+ changeSearch: _changeSearch,
6193
6213
  onChangeFormState: _onChangeFormState,
6194
6214
  onWidgetFormSubmit: _onWidgetFormSubmit,
6195
6215
  updateData: _updateData,
@@ -6351,8 +6371,8 @@ var correctIsRegexpLogic = function (METHOD_NAME) {
6351
6371
  var $ = _export;
6352
6372
  var uncurryThis = functionUncurryThis;
6353
6373
  var notARegExp = notARegexp;
6354
- var requireObjectCoercible = requireObjectCoercible$7;
6355
- var toString = toString$7;
6374
+ var requireObjectCoercible = requireObjectCoercible$6;
6375
+ var toString = toString$6;
6356
6376
  var correctIsRegExpLogic = correctIsRegexpLogic;
6357
6377
 
6358
6378
  var stringIndexOf = uncurryThis(''.indexOf);
@@ -7075,7 +7095,7 @@ const WidgetForm = ({
7075
7095
  label: `${t('widget.widgetTitle')}`,
7076
7096
  accessor: 'widgetTitle',
7077
7097
  required: true,
7078
- type: 'text',
7098
+ type: 'html',
7079
7099
  onInput: handleCapitalize,
7080
7100
  placeholder: t('widget.widgetTitlePlaceholder'),
7081
7101
  validations: {
@@ -7121,7 +7141,11 @@ const WidgetForm = ({
7121
7141
  placeholder: t('widget.webPerRowPlaceholder'),
7122
7142
  wrapperClassName: 'khb_grid-item-1of3 khb_padding-right-1',
7123
7143
  validations: {
7124
- required: t('widget.webPerRowRequired')
7144
+ required: t('widget.webPerRowRequired'),
7145
+ min: {
7146
+ value: 1,
7147
+ message: t('widget.minPerRow')
7148
+ }
7125
7149
  }
7126
7150
  }, {
7127
7151
  label: t('widget.tabletPerRow'),
@@ -7131,7 +7155,11 @@ const WidgetForm = ({
7131
7155
  placeholder: t('widget.tabletPerRowPlaceholder'),
7132
7156
  wrapperClassName: 'khb_grid-item-1of3 khb_padding-left-1',
7133
7157
  validations: {
7134
- required: t('widget.tabletPerRowRequired')
7158
+ required: t('widget.tabletPerRowRequired'),
7159
+ min: {
7160
+ value: 1,
7161
+ message: t('widget.minPerRow')
7162
+ }
7135
7163
  }
7136
7164
  }, {
7137
7165
  label: t('widget.mobilePerRow'),
@@ -7141,7 +7169,11 @@ const WidgetForm = ({
7141
7169
  placeholder: t('widget.mobilePerRowPlaceholder'),
7142
7170
  wrapperClassName: 'khb_grid-item-1of3 khb_padding-right-1 khb_padding-left-1',
7143
7171
  validations: {
7144
- required: t('widget.mobilePerRowRequired')
7172
+ required: t('widget.mobilePerRowRequired'),
7173
+ min: {
7174
+ value: 1,
7175
+ message: t('widget.minPerRow')
7176
+ }
7145
7177
  }
7146
7178
  }, {
7147
7179
  label: selectedCollectionType === null || selectedCollectionType === void 0 ? void 0 : selectedCollectionType.label,
@@ -7331,22 +7363,24 @@ const WidgetPagination = () => {
7331
7363
 
7332
7364
  const WidgetSearch = () => {
7333
7365
  const {
7334
- getWidgets,
7366
+ changeSearch,
7335
7367
  t,
7336
- canList
7368
+ canList,
7369
+ setCurrentPage
7337
7370
  } = useWidgetState();
7338
7371
  const callerRef = React.useRef(null);
7339
- const [search, setSearch] = React.useState('');
7372
+ const [searchVal, setSearchVal] = React.useState();
7340
7373
  const onChangeSearch = str => {
7341
- setSearch(str);
7374
+ setSearchVal(str);
7375
+ changeSearch(str);
7342
7376
  if (callerRef.current) clearTimeout(callerRef.current);
7343
7377
  callerRef.current = setTimeout(() => {
7344
- getWidgets(str);
7378
+ setCurrentPage(1);
7345
7379
  }, 300);
7346
7380
  };
7347
7381
  return /*#__PURE__*/React__default["default"].createElement(Input, {
7348
7382
  type: "search",
7349
- value: search,
7383
+ value: searchVal,
7350
7384
  disabled: !canList,
7351
7385
  onChange: e => onChangeSearch(e.target.value),
7352
7386
  placeholder: t('widget.searchPlaceholder')
@@ -7423,6 +7457,8 @@ const Widget = ({
7423
7457
  const {
7424
7458
  list,
7425
7459
  loading,
7460
+ searchText,
7461
+ changeSearch,
7426
7462
  onChangeFormState,
7427
7463
  formState,
7428
7464
  onCloseForm,
@@ -7460,6 +7496,8 @@ const Widget = ({
7460
7496
  list: list,
7461
7497
  onChangeFormState: onChangeFormState,
7462
7498
  t: derivedT,
7499
+ searchText: searchText,
7500
+ changeSearch: changeSearch,
7463
7501
  loader: loader,
7464
7502
  onWidgetFormSubmit: onWidgetFormSubmit,
7465
7503
  data: itemData,