kui-utils 0.0.6 → 0.0.7

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/cjs/index.js CHANGED
@@ -2128,7 +2128,7 @@ var Paginator = /** @class */ (function () {
2128
2128
  }());
2129
2129
 
2130
2130
  var SortingFilter = /** @class */ (function () {
2131
- function SortingFilter() {
2131
+ function SortingFilter(orderBy, filterQuery) {
2132
2132
  var _this = this;
2133
2133
  this.updateSearchQuery = function (newQuery) {
2134
2134
  _this.searchQuery = newQuery;
@@ -2143,9 +2143,9 @@ var SortingFilter = /** @class */ (function () {
2143
2143
  _this.orderBy = orderBy;
2144
2144
  };
2145
2145
  this.searchQuery = "";
2146
- this.filterQuery = "";
2146
+ this.filterQuery = filterQuery || "";
2147
2147
  this.order = "asc";
2148
- this.orderBy = "";
2148
+ this.orderBy = orderBy || "";
2149
2149
  mobx.makeAutoObservable(this);
2150
2150
  }
2151
2151
  Object.defineProperty(SortingFilter.prototype, "searchParams", {
@@ -2159,7 +2159,11 @@ var SortingFilter = /** @class */ (function () {
2159
2159
  });
2160
2160
  Object.defineProperty(SortingFilter.prototype, "orderParams", {
2161
2161
  get: function () {
2162
- return this.orderBy ? "&ordering=".concat(this.orderBy) : "";
2162
+ if (this.orderBy) {
2163
+ var order = this.order === "desc" ? "-" : "";
2164
+ return "&ordering=".concat(order).concat(this.orderBy);
2165
+ }
2166
+ return "";
2163
2167
  },
2164
2168
  enumerable: false,
2165
2169
  configurable: true
@@ -2254,6 +2258,30 @@ var MultistepForm = /** @class */ (function () {
2254
2258
  return MultistepForm;
2255
2259
  }());
2256
2260
 
2261
+ var Editor = /** @class */ (function () {
2262
+ function Editor() {
2263
+ var _this = this;
2264
+ this.startEditing = function () {
2265
+ _this.isEditing = true;
2266
+ _this.blockToSendForm();
2267
+ };
2268
+ this.endEditing = function () {
2269
+ _this.isEditing = false;
2270
+ _this.blockToSendForm();
2271
+ };
2272
+ this.allowToSendForm = function () {
2273
+ _this.isAllowedToSendForm = true;
2274
+ };
2275
+ this.blockToSendForm = function () {
2276
+ _this.isAllowedToSendForm = false;
2277
+ };
2278
+ this.isEditing = false;
2279
+ this.isAllowedToSendForm = false;
2280
+ mobx.makeAutoObservable(this);
2281
+ }
2282
+ return Editor;
2283
+ }());
2284
+
2257
2285
  var phoneRegExp = /^((\\+[1-9]{1,4}[ \\-]*)|(\\([0-9]{2,3}\\)[ \\-]*)|([0-9]{2,4})[ \\-]*)*?[0-9]{3,4}?[ \\-]*[0-9]{3,4}?$/;
2258
2286
  var isValidWithMaskExp = /^[^_]+$/;
2259
2287
  var dateRegExp = /(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d/;
@@ -2269,6 +2297,7 @@ var simplePasswordRegExp = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{10,
2269
2297
  var mediumPasswordRegExp = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{12,}$/;
2270
2298
  var strongPasswordRegExp = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{14,}$/;
2271
2299
 
2300
+ exports.Editor = Editor;
2272
2301
  exports.Loader = Loader;
2273
2302
  exports.MultistepForm = MultistepForm;
2274
2303
  exports.Paginator = Paginator;