@vchasno/ui-kit 0.2.16 → 0.2.18

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.
@@ -7,6 +7,7 @@ export interface ProductLinkProps {
7
7
  queryParams?: Record<string, string>;
8
8
  onLinkClick?: (product: AllProducts, event: React.MouseEvent) => void;
9
9
  overrideHint?: (product: AllProducts) => string;
10
+ urls?: Partial<Record<AllProducts, string>>;
10
11
  }
11
12
  declare const ProductLink: React.FC<ProductLinkProps>;
12
13
  export default ProductLink;
@@ -4,7 +4,8 @@ interface ComposeLinkOptions {
4
4
  ctxProduct: string;
5
5
  targetProduct: AllProducts;
6
6
  queryParams?: Record<string, string>;
7
+ urls?: Partial<Record<AllProducts, string>>;
7
8
  }
8
9
  export declare const composeZakupivliLink: ({ targetProduct, }: Pick<ComposeLinkOptions, 'targetProduct'>) => string;
9
- export declare const composeLink: ({ targetProduct, ctxProduct, queryParams, edrpou, }: ComposeLinkOptions) => string;
10
+ export declare const composeLink: ({ targetProduct, ctxProduct, queryParams, edrpou, urls, }: ComposeLinkOptions) => string;
10
11
  export {};
@@ -178,31 +178,24 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
178
178
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
179
179
  };
180
180
 
181
- function _objectWithoutPropertiesLoose(source, excluded) {
182
- if (source == null) return {};
183
- var target = {};
184
- for (var key in source) {
185
- if (Object.prototype.hasOwnProperty.call(source, key)) {
186
- if (excluded.indexOf(key) >= 0) continue;
187
- target[key] = source[key];
188
- }
181
+ function _objectWithoutPropertiesLoose(r, e) {
182
+ if (null == r) return {};
183
+ var t = {};
184
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
185
+ if (e.includes(n)) continue;
186
+ t[n] = r[n];
189
187
  }
190
- return target;
188
+ return t;
191
189
  }
192
190
 
193
191
  function _extends$1() {
194
- _extends$1 = Object.assign ? Object.assign.bind() : function (target) {
195
- for (var i = 1; i < arguments.length; i++) {
196
- var source = arguments[i];
197
- for (var key in source) {
198
- if (Object.prototype.hasOwnProperty.call(source, key)) {
199
- target[key] = source[key];
200
- }
201
- }
192
+ return _extends$1 = Object.assign ? Object.assign.bind() : function (n) {
193
+ for (var e = 1; e < arguments.length; e++) {
194
+ var t = arguments[e];
195
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
202
196
  }
203
- return target;
204
- };
205
- return _extends$1.apply(this, arguments);
197
+ return n;
198
+ }, _extends$1.apply(null, arguments);
206
199
  }
207
200
 
208
201
  var propTypes = {exports: {}};
@@ -1610,11 +1603,9 @@ function deepmerge$1(target, source, options = {
1610
1603
  const output = options.clone ? _extends$1({}, target) : target;
1611
1604
  if (isPlainObject(target) && isPlainObject(source)) {
1612
1605
  Object.keys(source).forEach(key => {
1606
+ if (isPlainObject(source[key]) &&
1613
1607
  // Avoid prototype pollution
1614
- if (key === '__proto__') {
1615
- return;
1616
- }
1617
- if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {
1608
+ Object.prototype.hasOwnProperty.call(target, key) && isPlainObject(target[key])) {
1618
1609
  // Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.
1619
1610
  output[key] = deepmerge$1(target[key], source[key], options);
1620
1611
  } else if (options.clone) {
@@ -2118,7 +2109,7 @@ function useControlled({
2118
2109
  current: defaultValue
2119
2110
  } = React__namespace.useRef(defaultProp);
2120
2111
  React__namespace.useEffect(() => {
2121
- if (!isControlled && defaultValue !== defaultProp) {
2112
+ if (!isControlled && !Object.is(defaultValue, defaultProp)) {
2122
2113
  console.error([`MUI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\n'));
2123
2114
  }
2124
2115
  }, [JSON.stringify(defaultProp)]);
@@ -2547,9 +2538,9 @@ var colorManipulator = {};
2547
2538
  var interopRequireDefault = {exports: {}};
2548
2539
 
2549
2540
  (function (module) {
2550
- function _interopRequireDefault(obj) {
2551
- return obj && obj.__esModule ? obj : {
2552
- "default": obj
2541
+ function _interopRequireDefault(e) {
2542
+ return e && e.__esModule ? e : {
2543
+ "default": e
2553
2544
  };
2554
2545
  }
2555
2546
  module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -2953,18 +2944,13 @@ function require_extends () {
2953
2944
  hasRequired_extends = 1;
2954
2945
  (function (module) {
2955
2946
  function _extends() {
2956
- module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {
2957
- for (var i = 1; i < arguments.length; i++) {
2958
- var source = arguments[i];
2959
- for (var key in source) {
2960
- if (Object.prototype.hasOwnProperty.call(source, key)) {
2961
- target[key] = source[key];
2962
- }
2963
- }
2947
+ return (module.exports = _extends = Object.assign ? Object.assign.bind() : function (n) {
2948
+ for (var e = 1; e < arguments.length; e++) {
2949
+ var t = arguments[e];
2950
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
2964
2951
  }
2965
- return target;
2966
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
2967
- return _extends.apply(this, arguments);
2952
+ return n;
2953
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports), _extends.apply(null, arguments);
2968
2954
  }
2969
2955
  module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
2970
2956
  } (_extends));
@@ -2979,16 +2965,14 @@ function requireObjectWithoutPropertiesLoose () {
2979
2965
  if (hasRequiredObjectWithoutPropertiesLoose) return objectWithoutPropertiesLoose.exports;
2980
2966
  hasRequiredObjectWithoutPropertiesLoose = 1;
2981
2967
  (function (module) {
2982
- function _objectWithoutPropertiesLoose(source, excluded) {
2983
- if (source == null) return {};
2984
- var target = {};
2985
- for (var key in source) {
2986
- if (Object.prototype.hasOwnProperty.call(source, key)) {
2987
- if (excluded.indexOf(key) >= 0) continue;
2988
- target[key] = source[key];
2989
- }
2968
+ function _objectWithoutPropertiesLoose(r, e) {
2969
+ if (null == r) return {};
2970
+ var t = {};
2971
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
2972
+ if (e.includes(n)) continue;
2973
+ t[n] = r[n];
2990
2974
  }
2991
- return target;
2975
+ return t;
2992
2976
  }
2993
2977
  module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
2994
2978
  } (objectWithoutPropertiesLoose));
@@ -5954,7 +5938,7 @@ process.env.NODE_ENV !== "production" ? GlobalStyles.propTypes = {
5954
5938
  } : void 0;
5955
5939
 
5956
5940
  /**
5957
- * @mui/styled-engine v5.15.14
5941
+ * @mui/styled-engine v5.16.1
5958
5942
  *
5959
5943
  * @license MIT
5960
5944
  * This source code is licensed under the MIT license found in the
@@ -8267,18 +8251,14 @@ function useThemeProps({
8267
8251
  });
8268
8252
  }
8269
8253
 
8270
- function _setPrototypeOf(o, p) {
8271
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
8272
- o.__proto__ = p;
8273
- return o;
8274
- };
8275
- return _setPrototypeOf(o, p);
8254
+ function _setPrototypeOf(t, e) {
8255
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
8256
+ return t.__proto__ = e, t;
8257
+ }, _setPrototypeOf(t, e);
8276
8258
  }
8277
8259
 
8278
- function _inheritsLoose(subClass, superClass) {
8279
- subClass.prototype = Object.create(superClass.prototype);
8280
- subClass.prototype.constructor = subClass;
8281
- _setPrototypeOf(subClass, superClass);
8260
+ function _inheritsLoose(t, o) {
8261
+ t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
8282
8262
  }
8283
8263
 
8284
8264
  var config = {
@@ -12556,11 +12536,11 @@ var composeZakupivliLink = function (_a) {
12556
12536
  return link.href;
12557
12537
  };
12558
12538
  var composeLink = function (_a) {
12559
- var targetProduct = _a.targetProduct, ctxProduct = _a.ctxProduct, queryParams = _a.queryParams, edrpou = _a.edrpou;
12539
+ var targetProduct = _a.targetProduct, ctxProduct = _a.ctxProduct, queryParams = _a.queryParams, edrpou = _a.edrpou, urls = _a.urls;
12560
12540
  if (zakupivliProductsList.includes(targetProduct)) {
12561
12541
  return composeZakupivliLink({ targetProduct: targetProduct });
12562
12542
  }
12563
- var baseUrl = hrefMap[targetProduct];
12543
+ var baseUrl = __assign(__assign({}, hrefMap), urls)[targetProduct];
12564
12544
  var link = new URL(baseUrl);
12565
12545
  if (edrpou) {
12566
12546
  link.searchParams.set('edrpou', edrpou);
@@ -12577,14 +12557,15 @@ var composeLink = function (_a) {
12577
12557
  };
12578
12558
 
12579
12559
  var ProductLink = function (_a) {
12580
- var onLinkClick = _a.onLinkClick, queryParams = _a.queryParams, product = _a.product, ctxProduct = _a.ctxProduct, edrpou = _a.edrpou, overrideHint = _a.overrideHint;
12560
+ var onLinkClick = _a.onLinkClick, queryParams = _a.queryParams, product = _a.product, ctxProduct = _a.ctxProduct, edrpou = _a.edrpou, overrideHint = _a.overrideHint, _b = _a.urls, urls = _b === void 0 ? {} : _b;
12581
12561
  var href = composeLink({
12582
12562
  ctxProduct: ctxProduct,
12583
12563
  edrpou: edrpou,
12584
12564
  targetProduct: product,
12585
12565
  queryParams: queryParams,
12566
+ urls: urls,
12586
12567
  });
12587
- return (React$1.createElement(BlackTooltip, { title: (overrideHint === null || overrideHint === void 0 ? void 0 : overrideHint(product)) || tooltipHintMap[product] },
12568
+ return (React$1.createElement(BlackTooltip, { disableInteractive: true, title: (overrideHint === null || overrideHint === void 0 ? void 0 : overrideHint(product)) || tooltipHintMap[product] },
12588
12569
  React$1.createElement("a", { className: "vchasno-ui-ProjectsPopover__box", href: href, target: "_blank", rel: "noreferrer", onClick: function (event) { return onLinkClick === null || onLinkClick === void 0 ? void 0 : onLinkClick(product, event); } },
12589
12570
  isZakupivliProduct(product) && iconMap[product],
12590
12571
  isVchasnoProduct(product) && (React$1.createElement(React$1.Fragment, null,
@@ -12623,7 +12604,7 @@ var css_248z = ".vchasno-ui-ProjectsPopover {\n display: inline-block;\n w
12623
12604
  styleInject(css_248z);
12624
12605
 
12625
12606
  var ProjectsPopover = function (_a) {
12626
- var _b = _a.vchasnoTitle, vchasnoTitle = _b === void 0 ? 'Сервіси Вчасно:' : _b, className = _a.className, _c = _a.zakupivliTitle, zakupivliTitle = _c === void 0 ? 'Сервіси Закупівлі:' : _c, product = _a.product, _d = _a.hideProduct, hideProduct = _d === void 0 ? function () { return false; } : _d, edrpou = _a.edrpou, onLinkClick = _a.onLinkClick, queryParams = _a.queryParams, overrideHint = _a.overrideHint;
12607
+ var _b = _a.vchasnoTitle, vchasnoTitle = _b === void 0 ? 'Сервіси Вчасно:' : _b, className = _a.className, _c = _a.zakupivliTitle, zakupivliTitle = _c === void 0 ? 'Сервіси Закупівлі:' : _c, product = _a.product, _d = _a.hideProduct, hideProduct = _d === void 0 ? function () { return false; } : _d, edrpou = _a.edrpou, onLinkClick = _a.onLinkClick, queryParams = _a.queryParams, overrideHint = _a.overrideHint, urls = _a.urls;
12627
12608
  var displayVchasnoProducts = vchasnoProductsList
12628
12609
  .filter(function (item) { return item !== product; })
12629
12610
  .filter(function (item) { return !hideProduct(item); });
@@ -12634,12 +12615,12 @@ var ProjectsPopover = function (_a) {
12634
12615
  display: displayVchasnoProducts.length ? 'flex' : 'none',
12635
12616
  } },
12636
12617
  React$1.createElement("h3", { className: "vchasno-ui-ProjectsPopover__title" }, vchasnoTitle),
12637
- displayVchasnoProducts.map(function (key) { return (React$1.createElement(ProductLink, { overrideHint: overrideHint, queryParams: queryParams, onLinkClick: onLinkClick, edrpou: edrpou, ctxProduct: product, key: key, product: key })); })),
12618
+ displayVchasnoProducts.map(function (key) { return (React$1.createElement(ProductLink, { urls: urls, overrideHint: overrideHint, queryParams: queryParams, onLinkClick: onLinkClick, edrpou: edrpou, ctxProduct: product, key: key, product: key })); })),
12638
12619
  React$1.createElement("div", { className: "vchasno-ui-ProjectsPopover__products", style: {
12639
12620
  display: displayZakupivliProducts.length ? 'flex' : 'none',
12640
12621
  } },
12641
12622
  React$1.createElement("h3", { className: "vchasno-ui-ProjectsPopover__title" }, zakupivliTitle),
12642
- displayZakupivliProducts.map(function (key) { return (React$1.createElement(ProductLink, { overrideHint: overrideHint, onLinkClick: onLinkClick, queryParams: queryParams, edrpou: edrpou, ctxProduct: product, key: key, product: key })); })),
12623
+ displayZakupivliProducts.map(function (key) { return (React$1.createElement(ProductLink, { urls: urls, overrideHint: overrideHint, onLinkClick: onLinkClick, queryParams: queryParams, edrpou: edrpou, ctxProduct: product, key: key, product: key })); })),
12643
12624
  React$1.createElement("footer", { className: "vchasno-ui-ProjectsPopover__footer" },
12644
12625
  "\u0413\u0440\u0443\u043F\u0430 \u043A\u043E\u043C\u043F\u0430\u043D\u0456\u0439\u00A0",
12645
12626
  React$1.createElement("a", { target: "_blank", rel: "noreferrer", href: "https://tabularasa.buzz/" }, "Tabula Rasa"),