iguazio.dashboard-react-controls 0.0.39 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Backdrop/Backdrop.js +4 -11
- package/dist/components/Button/Button.js +25 -28
- package/dist/components/ConfirmDialog/ConfirmDialog.js +10 -24
- package/dist/components/FormCheckBox/FormCheckBox.js +25 -25
- package/dist/components/FormChipCell/FormChip/FormChip.js +33 -33
- package/dist/components/FormChipCell/FormChipCell.js +66 -109
- package/dist/components/FormChipCell/FormChipCellView.js +19 -37
- package/dist/components/FormChipCell/NewChipForm/NewChipForm.js +58 -90
- package/dist/components/FormChipCell/NewChipInput/NewChipInput.js +24 -22
- package/dist/components/FormChipCell/formChipCell.util.js +0 -1
- package/dist/components/FormCombobox/FormCombobox.js +82 -140
- package/dist/components/FormInput/FormInput.js +110 -175
- package/dist/components/FormInput/InputNumberButtons/InputNumberButtons.js +6 -21
- package/dist/components/FormKeyValueTable/FormKeyValueTable.js +23 -39
- package/dist/components/FormRadio/FormRadio.js +23 -22
- package/dist/components/FormSelect/FormSelect.js +56 -92
- package/dist/components/FormSelect/FormSelect.test.js +19 -35
- package/dist/components/FormTextarea/FormTextarea.js +44 -69
- package/dist/components/Modal/Modal.js +8 -21
- package/dist/components/Modal/Modal.scss +2 -2
- package/dist/components/PopUpDialog/PopUpDialog.js +28 -43
- package/dist/components/RoundedIcon/RoundedIcon.js +7 -18
- package/dist/components/RoundedIcon/roundedIcon.scss +2 -2
- package/dist/components/Tip/Tip.js +25 -40
- package/dist/components/Tip/Tip.test.js +36 -45
- package/dist/components/Tooltip/Tooltip.js +40 -64
- package/dist/components/TooltipTemplate/ProducerTooltipTemplate.js +2 -8
- package/dist/components/TooltipTemplate/TextTooltipTemplate.js +2 -12
- package/dist/components/Wizard/Wizard.js +35 -57
- package/dist/components/Wizard/Wizard.scss +1 -3
- package/dist/components/Wizard/WizardSteps/WizardSteps.js +4 -16
- package/dist/components/Wizard/WizardSteps/WizardSteps.scss +1 -0
- package/dist/components/index.js +0 -18
- package/dist/constants.js +4 -6
- package/dist/elements/FormActionButton/FormActionButton.js +6 -12
- package/dist/elements/FormRowActions/FormRowActions.js +6 -18
- package/dist/elements/HiddenChipsBlock/HiddenChipsBlock.js +37 -55
- package/dist/elements/OptionsMenu/OptionsMenu.js +4 -14
- package/dist/elements/SelectOption/SelectOption.js +6 -18
- package/dist/elements/SelectOption/SelectOption.test.js +19 -12
- package/dist/elements/SelectOption/selectOption.scss +5 -2
- package/dist/elements/ValidationTemplate/ValidationTemplate.js +2 -11
- package/dist/elements/index.js +0 -6
- package/dist/hooks/index.js +0 -1
- package/dist/hooks/useDebounce.js +1 -5
- package/dist/hooks/useDetectOutsideClick.js +4 -8
- package/dist/hooks/useFormTable.hook.js +31 -41
- package/dist/images/archive-icon.svg +3 -0
- package/dist/images/arrow.svg +1 -1
- package/dist/images/close.svg +2 -2
- package/dist/images/collapse.svg +2 -2
- package/dist/images/copy-to-clipboard-icon.svg +3 -0
- package/dist/images/deploy-icon.svg +4 -0
- package/dist/images/edit.svg +1 -1
- package/dist/images/edit_old.svg +3 -0
- package/dist/images/expand.svg +2 -2
- package/dist/images/eye-icon.svg +3 -0
- package/dist/images/link-icon.svg +5 -0
- package/dist/images/monitor-icon.svg +3 -0
- package/dist/images/refresh.svg +1 -1
- package/dist/images/tag-icon.svg +4 -0
- package/dist/images/unarchive-icon.svg +3 -0
- package/dist/images/yaml.svg +2 -3
- package/dist/images/yaml_old.svg +4 -0
- package/dist/index.js +0 -13
- package/dist/scss/borders.scss +1 -1
- package/dist/scss/colors.scss +2 -0
- package/dist/scss/common.scss +7 -3
- package/dist/scss/mixins.scss +6 -19
- package/dist/scss/shadows.scss +3 -3
- package/dist/scss/variables.scss +2 -0
- package/dist/types.js +19 -49
- package/dist/utils/common.util.js +3 -13
- package/dist/utils/form.util.js +20 -24
- package/dist/utils/generateChipsList.util.js +0 -3
- package/dist/utils/getFirstScrollableParent.util.js +0 -5
- package/dist/utils/validation.util.js +72 -94
- package/package.json +104 -104
- package/dist/images/eye.svg +0 -4
|
@@ -1,46 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.required = exports.getValidationRules = exports.checkPatternsValidityAsync = exports.checkPatternsValidity = void 0;
|
|
9
|
-
|
|
10
7
|
var _lodash = _interopRequireWildcard(require("lodash"));
|
|
11
|
-
|
|
12
8
|
var _constants = require("../constants");
|
|
13
|
-
|
|
14
9
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
|
|
16
10
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
|
|
18
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; 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); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { 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); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; 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; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
19
|
-
|
|
11
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
12
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; 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; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; 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); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { 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); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; 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; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
20
13
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
21
|
-
|
|
22
14
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
23
|
-
|
|
24
15
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
29
|
-
|
|
16
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
17
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
30
18
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
31
|
-
|
|
32
19
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
33
|
-
|
|
34
20
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
35
|
-
|
|
36
21
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
37
|
-
|
|
38
22
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
23
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
24
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
25
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /*
|
|
26
|
+
Copyright 2022 Iguazio Systems Ltd.
|
|
27
|
+
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
28
|
+
an addition restriction as set forth herein. You may not use this
|
|
29
|
+
file except in compliance with the License. You may obtain a copy of
|
|
30
|
+
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
31
|
+
Unless required by applicable law or agreed to in writing, software
|
|
32
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
33
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
34
|
+
implied. See the License for the specific language governing
|
|
35
|
+
permissions and limitations under the License.
|
|
36
|
+
In addition, you may not use the software for any purposes that are
|
|
37
|
+
illegal under applicable law, and the grant of the foregoing license
|
|
38
|
+
under the Apache 2.0 license is conditioned upon your compliance with
|
|
39
|
+
such restriction.
|
|
40
|
+
*/
|
|
42
41
|
////// PRIVATE METHODS ///////
|
|
43
|
-
|
|
44
42
|
/**
|
|
45
43
|
* Converts characters string to readable format
|
|
46
44
|
* Note: converts Hyphens to En Dashes, replaces one space with comma and space,
|
|
@@ -54,6 +52,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
54
52
|
var convertToLabel = function convertToLabel(chars) {
|
|
55
53
|
return chars.replace(/-/g, '–').replace(/\s/g, ', ').replace(/\bs\b/);
|
|
56
54
|
};
|
|
55
|
+
|
|
57
56
|
/**
|
|
58
57
|
* Converts characters string to valid RegExp string that will be placed into RegExp pattern
|
|
59
58
|
* @param {string} chars - characters to convert
|
|
@@ -62,22 +61,21 @@ var convertToLabel = function convertToLabel(chars) {
|
|
|
62
61
|
* convertToPattern('a-z A-Z - _ *');
|
|
63
62
|
* // => 'a-zA-Z\-\_\*'
|
|
64
63
|
*/
|
|
65
|
-
|
|
66
|
-
|
|
67
64
|
var convertToPattern = function convertToPattern(chars) {
|
|
68
65
|
return chars.split(' ').map(function (patternItem) {
|
|
69
66
|
return patternItem.length === 1 ? '\\' + patternItem : patternItem;
|
|
70
67
|
}).join('');
|
|
71
68
|
};
|
|
69
|
+
|
|
72
70
|
/**
|
|
73
71
|
* Checks whether there is at least one failed validation rule.
|
|
74
72
|
* @returns {boolean} `true` in case there is at least one failed validation rule, or `false` otherwise.
|
|
75
73
|
*/
|
|
76
|
-
|
|
77
|
-
|
|
78
74
|
var hasInvalidRule = function hasInvalidRule(newRules) {
|
|
79
75
|
return _lodash.default.some(newRules, ['isValid', false]);
|
|
80
|
-
};
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
////// PUBLIC METHODS ///////
|
|
81
79
|
|
|
82
80
|
/**
|
|
83
81
|
* validate required field value
|
|
@@ -85,7 +83,6 @@ var hasInvalidRule = function hasInvalidRule(newRules) {
|
|
|
85
83
|
* @returns {function} Function that accepts a value and return an array [isFieldValid, validationMsg]
|
|
86
84
|
*/
|
|
87
85
|
|
|
88
|
-
|
|
89
86
|
var required = function required() {
|
|
90
87
|
var validationMsg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Required';
|
|
91
88
|
return function (value) {
|
|
@@ -93,6 +90,7 @@ var required = function required() {
|
|
|
93
90
|
return [isValid, validationMsg];
|
|
94
91
|
};
|
|
95
92
|
};
|
|
93
|
+
|
|
96
94
|
/**
|
|
97
95
|
* Checks whether there is at least one failed validation rule.
|
|
98
96
|
* @function checkPatternsValidity
|
|
@@ -101,10 +99,7 @@ var required = function required() {
|
|
|
101
99
|
* @param {boolean} required Specified if the value should be validated
|
|
102
100
|
* @returns {Array} [validationRules, isFieldValid] New validationRules With `isValid` property, `true` in case there is at least one failed validation rule, or `false` otherwise.
|
|
103
101
|
*/
|
|
104
|
-
|
|
105
|
-
|
|
106
102
|
exports.required = required;
|
|
107
|
-
|
|
108
103
|
var checkPatternsValidity = function checkPatternsValidity(validationRules) {
|
|
109
104
|
var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
110
105
|
var required = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
@@ -112,78 +107,62 @@ var checkPatternsValidity = function checkPatternsValidity(validationRules) {
|
|
|
112
107
|
return !rule.async;
|
|
113
108
|
}).map(function (rule) {
|
|
114
109
|
return _objectSpread(_objectSpread({}, rule), {}, {
|
|
115
|
-
isValid: _lodash.default.isFunction(rule.pattern) ? rule.pattern(value) :
|
|
116
|
-
/* else, it is a RegExp */
|
|
117
|
-
rule.pattern.test(value)
|
|
110
|
+
isValid: _lodash.default.isFunction(rule.pattern) ? rule.pattern(value) : /* else, it is a RegExp */rule.pattern.test(value)
|
|
118
111
|
});
|
|
119
112
|
});
|
|
120
113
|
return [newRules, !hasInvalidRule(newRules)];
|
|
121
114
|
};
|
|
122
|
-
|
|
123
115
|
exports.checkPatternsValidity = checkPatternsValidity;
|
|
124
|
-
|
|
125
116
|
var checkPatternsValidityAsync = /*#__PURE__*/function () {
|
|
126
117
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(validationRules, value) {
|
|
127
118
|
var _checkPatternsValidit, _checkPatternsValidit2, newRules, asyncRules, allRules;
|
|
128
|
-
|
|
129
119
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
130
|
-
while (1) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
case 3:
|
|
170
|
-
asyncRules = _context2.sent;
|
|
171
|
-
allRules = newRules.concat(asyncRules);
|
|
172
|
-
return _context2.abrupt("return", [allRules, !hasInvalidRule(allRules)]);
|
|
173
|
-
|
|
174
|
-
case 6:
|
|
175
|
-
case "end":
|
|
176
|
-
return _context2.stop();
|
|
177
|
-
}
|
|
120
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
121
|
+
case 0:
|
|
122
|
+
_checkPatternsValidit = checkPatternsValidity(validationRules, value), _checkPatternsValidit2 = _slicedToArray(_checkPatternsValidit, 1), newRules = _checkPatternsValidit2[0];
|
|
123
|
+
_context2.next = 3;
|
|
124
|
+
return Promise.all(validationRules.filter(function (rule) {
|
|
125
|
+
return rule.async;
|
|
126
|
+
}).map( /*#__PURE__*/function () {
|
|
127
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(rule) {
|
|
128
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
129
|
+
while (1) switch (_context.prev = _context.next) {
|
|
130
|
+
case 0:
|
|
131
|
+
_context.t0 = _objectSpread;
|
|
132
|
+
_context.t1 = _objectSpread({}, rule);
|
|
133
|
+
_context.t2 = {};
|
|
134
|
+
_context.next = 5;
|
|
135
|
+
return rule.pattern(value);
|
|
136
|
+
case 5:
|
|
137
|
+
_context.t3 = _context.sent;
|
|
138
|
+
_context.t4 = {
|
|
139
|
+
isValid: _context.t3
|
|
140
|
+
};
|
|
141
|
+
return _context.abrupt("return", (0, _context.t0)(_context.t1, _context.t2, _context.t4));
|
|
142
|
+
case 8:
|
|
143
|
+
case "end":
|
|
144
|
+
return _context.stop();
|
|
145
|
+
}
|
|
146
|
+
}, _callee);
|
|
147
|
+
}));
|
|
148
|
+
return function (_x3) {
|
|
149
|
+
return _ref2.apply(this, arguments);
|
|
150
|
+
};
|
|
151
|
+
}()));
|
|
152
|
+
case 3:
|
|
153
|
+
asyncRules = _context2.sent;
|
|
154
|
+
allRules = newRules.concat(asyncRules);
|
|
155
|
+
return _context2.abrupt("return", [allRules, !hasInvalidRule(allRules)]);
|
|
156
|
+
case 6:
|
|
157
|
+
case "end":
|
|
158
|
+
return _context2.stop();
|
|
178
159
|
}
|
|
179
160
|
}, _callee2);
|
|
180
161
|
}));
|
|
181
|
-
|
|
182
162
|
return function checkPatternsValidityAsync(_x, _x2) {
|
|
183
163
|
return _ref.apply(this, arguments);
|
|
184
164
|
};
|
|
185
165
|
}();
|
|
186
|
-
|
|
187
166
|
exports.checkPatternsValidityAsync = checkPatternsValidityAsync;
|
|
188
167
|
var generateRule = {
|
|
189
168
|
beginWith: function beginWith(chars) {
|
|
@@ -280,7 +259,6 @@ var generateRule = {
|
|
|
280
259
|
length: function length(options) {
|
|
281
260
|
var min = Number.isSafeInteger(options.min) ? options.min : 0;
|
|
282
261
|
var max = Number.isSafeInteger(options.max) ? options.max : '';
|
|
283
|
-
|
|
284
262
|
if (min || max) {
|
|
285
263
|
var label = 'Length – ' + (min ? 'min: ' + options.min + '\xa0\xa0' : '') + (max ? 'max: ' + options.max : '');
|
|
286
264
|
return {
|
|
@@ -297,7 +275,9 @@ var generateRule = {
|
|
|
297
275
|
pattern: new RegExp('\\S')
|
|
298
276
|
};
|
|
299
277
|
}
|
|
300
|
-
};
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
//const commonRules = {
|
|
301
281
|
// email: [
|
|
302
282
|
// generateRule.beginEndNotWith('@ .'),
|
|
303
283
|
// {
|
|
@@ -312,7 +292,6 @@ var generateRule = {
|
|
|
312
292
|
// }
|
|
313
293
|
// ]
|
|
314
294
|
//}
|
|
315
|
-
|
|
316
295
|
var validationRules = {
|
|
317
296
|
artifact: {
|
|
318
297
|
name: [generateRule.validCharacters('a-z A-Z 0-9 - _ .'), generateRule.beginEndWith('a-z A-Z 0-9'), generateRule.length({
|
|
@@ -354,6 +333,7 @@ var validationRules = {
|
|
|
354
333
|
})]
|
|
355
334
|
}
|
|
356
335
|
};
|
|
336
|
+
|
|
357
337
|
/**
|
|
358
338
|
* Returns the list of validation rules for `type`, optionally appending provided additional rules.
|
|
359
339
|
* @function getValidationRules
|
|
@@ -361,9 +341,7 @@ var validationRules = {
|
|
|
361
341
|
* @param {Array.<Object>} [additionalRules] - Additional rules to append.
|
|
362
342
|
* @returns {Array.<Object>} the rule list of type `type` with `additionalRules` appended to it if provided.
|
|
363
343
|
*/
|
|
364
|
-
|
|
365
344
|
var getValidationRules = function getValidationRules(type, additionalRules) {
|
|
366
345
|
return _lodash.default.chain(validationRules).get(type).defaultTo([]).cloneDeep().concat(_lodash.default.defaultTo(additionalRules, [])).value();
|
|
367
346
|
};
|
|
368
|
-
|
|
369
347
|
exports.getValidationRules = getValidationRules;
|
package/package.json
CHANGED
|
@@ -1,107 +1,107 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
"name": "iguazio.dashboard-react-controls",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "Collection of resources (such as CSS styles, fonts and images) and ReactJS 17.x components to share among different Iguazio React repos.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md"
|
|
10
|
+
],
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git@github.com:iguazio/dashboard-react-controls.git"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"Iguazio",
|
|
17
|
+
"iguazio",
|
|
18
|
+
"MLRun",
|
|
19
|
+
"mlrun"
|
|
20
|
+
],
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"classnames": "*",
|
|
23
|
+
"lodash": "*",
|
|
24
|
+
"prop-types": "*",
|
|
25
|
+
"react": "*",
|
|
26
|
+
"react-dom": "*",
|
|
27
|
+
"react-modal-promise": "*",
|
|
28
|
+
"react-transition-group": "*",
|
|
29
|
+
"final-form": "*",
|
|
30
|
+
"final-form-arrays": "*",
|
|
31
|
+
"react-final-form": "*",
|
|
32
|
+
"react-final-form-arrays": "*"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@babel/cli": "^7.17.6",
|
|
36
|
+
"@babel/core": "^7.17.9",
|
|
37
|
+
"@babel/eslint-parser": "^7.17.0",
|
|
38
|
+
"@babel/plugin-transform-react-jsx": "^7.17.3",
|
|
39
|
+
"@babel/preset-env": "^7.16.11",
|
|
40
|
+
"@babel/preset-react": "^7.16.7",
|
|
41
|
+
"@storybook/addon-actions": "^6.4.22",
|
|
42
|
+
"@storybook/addon-essentials": "^6.4.22",
|
|
43
|
+
"@storybook/addon-interactions": "^6.4.22",
|
|
44
|
+
"@storybook/addon-links": "^6.4.22",
|
|
45
|
+
"@storybook/builder-webpack5": "^6.4.22",
|
|
46
|
+
"@storybook/manager-webpack5": "^6.4.22",
|
|
47
|
+
"@storybook/preset-create-react-app": "^4.1.0",
|
|
48
|
+
"@storybook/react": "^6.4.22",
|
|
49
|
+
"@storybook/testing-library": "0.0.9",
|
|
50
|
+
"@testing-library/jest-dom": "^5.16.4",
|
|
51
|
+
"@testing-library/react": "^12.1.5",
|
|
52
|
+
"@testing-library/user-event": "^13.5.0",
|
|
53
|
+
"babel-loader": "^8.2.4",
|
|
54
|
+
"babel-plugin-inline-react-svg": "^2.0.1",
|
|
55
|
+
"classnames": "^2.3.1",
|
|
56
|
+
"cross-env": "^7.0.3",
|
|
57
|
+
"eslint": "^8.22.0",
|
|
58
|
+
"eslint-config-prettier": "^8.3.0",
|
|
59
|
+
"eslint-config-react-app": "^7.0.0",
|
|
60
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
61
|
+
"eslint-plugin-storybook": "^0.5.10",
|
|
62
|
+
"eslint-webpack-plugin": "^3.1.1",
|
|
63
|
+
"lodash": "^4.17.21",
|
|
64
|
+
"node": "14.19.0",
|
|
65
|
+
"prettier": "^2.5.1",
|
|
66
|
+
"prop-types": "^15.8.1",
|
|
67
|
+
"react": "^17.0.2",
|
|
68
|
+
"react-dom": "^17.0.2",
|
|
69
|
+
"final-form": "^4.20.7",
|
|
70
|
+
"final-form-arrays": "^3.0.2",
|
|
71
|
+
"react-final-form": "^6.5.9",
|
|
72
|
+
"react-final-form-arrays": "^3.1.3",
|
|
73
|
+
"react-modal-promise": "^1.0.2",
|
|
74
|
+
"react-scripts": "5.0.0",
|
|
75
|
+
"react-transition-group": "^4.4.2",
|
|
76
|
+
"sass": "^1.50.0",
|
|
77
|
+
"web-vitals": "^2.1.4",
|
|
78
|
+
"webpack": "^5.72.0"
|
|
79
|
+
},
|
|
80
|
+
"scripts": {
|
|
81
|
+
"start": "react-scripts start",
|
|
82
|
+
"build": "react-scripts build",
|
|
83
|
+
"test": "react-scripts test",
|
|
84
|
+
"eject": "react-scripts eject",
|
|
85
|
+
"build-storybook": "build-storybook",
|
|
86
|
+
"storybook": "start-storybook -p 6006",
|
|
87
|
+
"compile": "rm -rf dist/* && babel src/lib --out-dir dist --copy-files --no-copy-ignored --ignore src/**/*.stories.js"
|
|
88
|
+
},
|
|
89
|
+
"eslintConfig": {
|
|
90
|
+
"extends": [
|
|
91
|
+
"react-app",
|
|
92
|
+
"react-app/jest"
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
"browserslist": {
|
|
96
|
+
"production": [
|
|
97
|
+
">0.2%",
|
|
98
|
+
"not dead",
|
|
99
|
+
"not op_mini all"
|
|
10
100
|
],
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"iguazio",
|
|
18
|
-
"MLRun",
|
|
19
|
-
"mlrun"
|
|
20
|
-
],
|
|
21
|
-
"peerDependencies": {
|
|
22
|
-
"classnames": "*",
|
|
23
|
-
"lodash": "*",
|
|
24
|
-
"prop-types": "*",
|
|
25
|
-
"react": "*",
|
|
26
|
-
"react-dom": "*",
|
|
27
|
-
"react-modal-promise": "*",
|
|
28
|
-
"react-transition-group": "*",
|
|
29
|
-
"final-form": "*",
|
|
30
|
-
"final-form-arrays": "*",
|
|
31
|
-
"react-final-form": "*",
|
|
32
|
-
"react-final-form-arrays": "*"
|
|
33
|
-
},
|
|
34
|
-
"devDependencies": {
|
|
35
|
-
"@babel/cli": "^7.17.6",
|
|
36
|
-
"@babel/core": "^7.17.9",
|
|
37
|
-
"@babel/eslint-parser": "^7.17.0",
|
|
38
|
-
"@babel/plugin-transform-react-jsx": "^7.17.3",
|
|
39
|
-
"@babel/preset-env": "^7.16.11",
|
|
40
|
-
"@babel/preset-react": "^7.16.7",
|
|
41
|
-
"@storybook/addon-actions": "^6.4.22",
|
|
42
|
-
"@storybook/addon-essentials": "^6.4.22",
|
|
43
|
-
"@storybook/addon-interactions": "^6.4.22",
|
|
44
|
-
"@storybook/addon-links": "^6.4.22",
|
|
45
|
-
"@storybook/builder-webpack5": "^6.4.22",
|
|
46
|
-
"@storybook/manager-webpack5": "^6.4.22",
|
|
47
|
-
"@storybook/preset-create-react-app": "^4.1.0",
|
|
48
|
-
"@storybook/react": "^6.4.22",
|
|
49
|
-
"@storybook/testing-library": "0.0.9",
|
|
50
|
-
"@testing-library/jest-dom": "^5.16.4",
|
|
51
|
-
"@testing-library/react": "^12.1.5",
|
|
52
|
-
"@testing-library/user-event": "^13.5.0",
|
|
53
|
-
"babel-loader": "^8.2.4",
|
|
54
|
-
"babel-plugin-inline-react-svg": "^2.0.1",
|
|
55
|
-
"classnames": "^2.3.1",
|
|
56
|
-
"cross-env": "^7.0.3",
|
|
57
|
-
"eslint": "^8.22.0",
|
|
58
|
-
"eslint-config-prettier": "^8.3.0",
|
|
59
|
-
"eslint-config-react-app": "^7.0.0",
|
|
60
|
-
"eslint-plugin-prettier": "^4.0.0",
|
|
61
|
-
"eslint-plugin-storybook": "^0.5.10",
|
|
62
|
-
"eslint-webpack-plugin": "^3.1.1",
|
|
63
|
-
"lodash": "^4.17.21",
|
|
64
|
-
"node": "14.19.0",
|
|
65
|
-
"prettier": "^2.5.1",
|
|
66
|
-
"prop-types": "^15.8.1",
|
|
67
|
-
"react": "^17.0.2",
|
|
68
|
-
"react-dom": "^17.0.2",
|
|
69
|
-
"final-form": "^4.20.7",
|
|
70
|
-
"final-form-arrays": "^3.0.2",
|
|
71
|
-
"react-final-form": "^6.5.9",
|
|
72
|
-
"react-final-form-arrays": "^3.1.3",
|
|
73
|
-
"react-modal-promise": "^1.0.2",
|
|
74
|
-
"react-scripts": "5.0.0",
|
|
75
|
-
"react-transition-group": "^4.4.2",
|
|
76
|
-
"sass": "^1.50.0",
|
|
77
|
-
"web-vitals": "^2.1.4",
|
|
78
|
-
"webpack": "^5.72.0"
|
|
79
|
-
},
|
|
80
|
-
"scripts": {
|
|
81
|
-
"start": "react-scripts start",
|
|
82
|
-
"build": "react-scripts build",
|
|
83
|
-
"test": "react-scripts test",
|
|
84
|
-
"eject": "react-scripts eject",
|
|
85
|
-
"build-storybook": "build-storybook",
|
|
86
|
-
"storybook": "start-storybook -p 6006",
|
|
87
|
-
"compile": "rm -rf dist/* && babel src/lib --out-dir dist --copy-files --no-copy-ignored --ignore src/**/*.stories.js"
|
|
88
|
-
},
|
|
89
|
-
"eslintConfig": {
|
|
90
|
-
"extends": [
|
|
91
|
-
"react-app",
|
|
92
|
-
"react-app/jest"
|
|
93
|
-
]
|
|
94
|
-
},
|
|
95
|
-
"browserslist": {
|
|
96
|
-
"production": [
|
|
97
|
-
">0.2%",
|
|
98
|
-
"not dead",
|
|
99
|
-
"not op_mini all"
|
|
100
|
-
],
|
|
101
|
-
"development": [
|
|
102
|
-
"last 1 chrome version",
|
|
103
|
-
"last 1 firefox version",
|
|
104
|
-
"last 1 safari version"
|
|
105
|
-
]
|
|
106
|
-
}
|
|
101
|
+
"development": [
|
|
102
|
+
"last 1 chrome version",
|
|
103
|
+
"last 1 firefox version",
|
|
104
|
+
"last 1 safari version"
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
107
|
}
|
package/dist/images/eye.svg
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.18488 12C4.78877 15.2615 8.13541 17.5 12 17.5C15.8646 17.5 19.2112 15.2615 20.8151 12C19.2112 8.73854 15.8646 6.5 12 6.5C8.13541 6.5 4.78877 8.73854 3.18488 12ZM23 12C21.27 16.39 17 19.5 12 19.5C7 19.5 2.73 16.39 1 12C2.73 7.61 7 4.5 12 4.5C17 4.5 21.27 7.61 23 12Z" fill="#8C9DC5"/>
|
|
3
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 14C13.1046 14 14 13.1046 14 12C14 10.8954 13.1046 10 12 10C10.8954 10 10 10.8954 10 12C10 13.1046 10.8954 14 12 14ZM12 16C14.2091 16 16 14.2091 16 12C16 9.79086 14.2091 8 12 8C9.79086 8 8 9.79086 8 12C8 14.2091 9.79086 16 12 16Z" fill="#8C9DC5"/>
|
|
4
|
-
</svg>
|