npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cloud-ru/uikit-product-calculator

v0.38.1

Published

## Installation

Readme

Calculator

Installation

npm i @cloud-ru/uikit-product-calculator

Example

import {
  ADVANCED_PLATFORM,
  ADVANCED_PRODUCT,
  CATALOG_CONFIG,
  getFetcherFn,
  getOnDownloadFileClick,
  getOnShareClick,
  VM_WARE_PLATFORM,
} from '@sbercloud/cpt-calculator-configs';
import { useAdaptive } from '@sbercloud/cpt-common';
import { Calculator as CalculatorUi, CALCULATOR_TYPE } from '@cloud-ru/uikit-product-calculator';

const onDownloadFileClick = getOnDownloadFileClick();
const onShareClick = getOnShareClick();
const fetcherFn = getFetcherFn();

const config = { ...CATALOG_CONFIG, platforms: [ADVANCED_PLATFORM, VM_WARE_PLATFORM] };

export function Calculator() {
  return (
    <CalculatorUi
      config={config}
      layoutType={layoutType}
      calculatorType={CALCULATOR_TYPE.Partners}
      initialActiveProduct={ADVANCED_PRODUCT.AdvancedCloudServer}
      fetcherFn={fetcherFn}
      actions={{
        onDownloadFileClick,
        onShareClick,
      }}
    />
  );
}

Calculator

Props

| name | type | default value | description | |------|------|---------------|-------------| | actions* | { onPlatformSelect?(platform: string): void; onProductSelect?(productId: string): void; onProductDelete?(productId: string): void; onStartClick?(): void; onCatalogOpen?(): void; onConnectClick?(id: string, value: FormValues): void; onShareClick?(state: State): Promise<...>; onDownloadFileClick?(state: State): Promis... | - | Колбеки на действия внутри калькулятора | | fetcherFn* | FetcherFn | - | Функция для запроса цен по продукту | | config* | CatalogConfig | - | Конфигурация платформ/продуктов/каталога | | layoutType | enum LayoutType: "mobile", "tablet", "desktop", "desktopSmall" | desktop | Тип устройства | | calculatorType | enum CalculatorType: "test", "main", "partners", "product", "additional" | main | Тип калькулятора | | onAnalyticsClick | (clickContent: string, uniqueId: string) => void | - | Колбэк вызова при изменении любого контрола для аналитики | | bgImage | string | - | Изображение на заднем фоне в состоянии "пустой" корзины | | initialActiveProduct | string | - | Id продукта который будет "по умолчанию" в корзине | | iniState | Record<string, ProductState[]> | - | Начальное состояние корзины |

Main

калькулятор на странице /calculator

Props

| name | type | default value | description | |------|------|---------------|-------------|

Partners

калькулятор на странице партнеров /calculator/partners

Props

| name | type | default value | description | |------|------|---------------|-------------|

Additional

остальные калькуляторы на сайте

Props

| name | type | default value | description | |------|------|---------------|-------------|

platforms

Платформы

Props

| name | type | default value | description | |------|------|---------------|-------------|

products

Продукты

Props

| name | type | default value | description | |------|------|---------------|-------------|

catalog

Каталог

Props

| name | type | default value | description | |------|------|---------------|-------------|

id

Уникальный id

Props

| name | type | default value | description | |------|------|---------------|-------------|

icon

Иконка

Props

| name | type | default value | description | |------|------|---------------|-------------|

label

Название

Props

| name | type | default value | description | |------|------|---------------|-------------|

description

Дополнительное описание

Props

| name | type | default value | description | |------|------|---------------|-------------|

access

Доступ к платформе

Props

| name | type | default value | description | |------|------|---------------|-------------|

dataTestId

data-test-id

Props

| name | type | default value | description | |------|------|---------------|-------------|

onClick

Колбек клика на карточку платформы

Props

| name | type | default value | description | |------|------|---------------|-------------| | __@iterator@1094* | () => StringIterator<string> | - | Iterator | | toWellFormed* | () => string | - | Returns a string where all lone or out-of-order surrogates have been replaced by the Unicode replacement character (U+FFFD). | | isWellFormed* | () => boolean | - | Returns true if all leading surrogates and trailing surrogates appear paired and in order. | | at* | (index: number) => string | - | Returns a new String consisting of the single UTF-16 code unit located at the specified index. @param index The zero-based index of the desired code unit. A negative index will count back from the last item. | | replaceAll* | { (searchValue: string \| RegExp, replaceValue: string): string; (searchValue: string \| RegExp, replacer: (substring: string, ...args: any[]) => string): string; } | - | Replace all instances of a substring in a string, using a regular expression or search string. @param searchValue A string to search for. @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. @param searchValue A string to search for. @param replacer A function that returns the replacement text. | | matchAll* | (regexp: RegExp) => RegExpStringIterator<RegExpExecArray> | - | Matches a string with a regular expression, and returns an iterable of matches containing the results of that search. @param regexp A variable name or string literal containing the regular expression pattern and flags. | | trimRight* | () => string | - | Removes the trailing white space and line terminator characters from a string. @deprecated A legacy feature for browser compatibility. Use trimEnd instead | | trimLeft* | () => string | - | Removes the leading white space and line terminator characters from a string. @deprecated A legacy feature for browser compatibility. Use trimStart instead | | trimStart* | () => string | - | Removes the leading white space and line terminator characters from a string. | | trimEnd* | () => string | - | Removes the trailing white space and line terminator characters from a string. | | padEnd* | (maxLength: number, fillString?: string) => string | - | Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. The padding is applied from the end (right) of the current string. @param maxLength The length of the resulting string once the current string has been padded. If this parameter is smaller than the current string's length, the current string will be returned as it is. @param fillString The string to pad the current string with. If this string is too long, it will be truncated and the left-most part will be applied. The default value for this parameter is " " (U+0020). | | padStart* | (maxLength: number, fillString?: string) => string | - | Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. The padding is applied from the start (left) of the current string. @param maxLength The length of the resulting string once the current string has been padded. If this parameter is smaller than the current string's length, the current string will be returned as it is. @param fillString The string to pad the current string with. If this string is too long, it will be truncated and the left-most part will be applied. The default value for this parameter is " " (U+0020). | | sup* | () => string | - | Returns a <sup> HTML element @deprecated A legacy feature for browser compatibility | | sub* | () => string | - | Returns a <sub> HTML element @deprecated A legacy feature for browser compatibility | | strike* | () => string | - | Returns a <strike> HTML element @deprecated A legacy feature for browser compatibility | | small* | () => string | - | Returns a <small> HTML element @deprecated A legacy feature for browser compatibility | | link* | (url: string) => string | - | Returns an <a> HTML element and sets the href attribute value @deprecated A legacy feature for browser compatibility | | italics* | () => string | - | Returns an <i> HTML element @deprecated A legacy feature for browser compatibility | | fontsize* | { (size: number): string; (size: string): string; } | - | Returns a <font> HTML element and sets the size attribute value @deprecated A legacy feature for browser compatibility @deprecated A legacy feature for browser compatibility | | fontcolor* | (color: string) => string | - | Returns a <font> HTML element and sets the color attribute value @deprecated A legacy feature for browser compatibility | | fixed* | () => string | - | Returns a <tt> HTML element @deprecated A legacy feature for browser compatibility | | bold* | () => string | - | Returns a <b> HTML element @deprecated A legacy feature for browser compatibility | | blink* | () => string | - | Returns a <blink> HTML element @deprecated A legacy feature for browser compatibility | | big* | () => string | - | Returns a <big> HTML element @deprecated A legacy feature for browser compatibility | | anchor* | (name: string) => string | - | Returns an <a> HTML anchor element and sets the name attribute to the text value @deprecated A legacy feature for browser compatibility @param name | | startsWith* | (searchString: string, position?: number) => boolean | - | Returns true if the sequence of elements of searchString converted to a String is the same as the corresponding elements of this object (converted to a String) starting at position. Otherwise returns false. | | repeat* | (count: number) => string | - | Returns a String value that is made from count copies appended together. If count is 0, the empty string is returned. @param count number of copies to append | | normalize* | { (form: "NFC" \| "NFD" \| "NFKC" \| "NFKD"): string; (form?: string): string; } | - | Returns the String value result of normalizing the string into the normalization form named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default is "NFC" @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default is "NFC" | | endsWith* | (searchString: string, endPosition?: number) => boolean | - | Returns true if the sequence of elements of searchString converted to a String is the same as the corresponding elements of this object (converted to a String) starting at endPosition – length(this). Otherwise returns false. | | includes* | (searchString: string, position?: number) => boolean | - | Returns true if searchString appears as a substring of the result of converting this object to a String, at one or more positions that are greater than or equal to position; otherwise, returns false. @param searchString search string @param position If position is undefined, 0 is assumed, so as to search all of the String. | | codePointAt* | (pos: number) => number | - | Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point value of the UTF-16 encoded code point starting at the string element at position pos in the String resulting from converting this object to a String. If there is no element at that position, the result is undefined. If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. | | substr* | (from: number, length?: number) => string | - | Gets a substring beginning at the specified location and having the specified length. @deprecated A legacy feature for browser compatibility @param from The starting position of the desired substring. The index of the first character in the string is zero. @param length The number of characters to include in the returned substring. | | length* | number | - | Returns the length of a String object. | | trim* | () => string | - | Removes the leading and trailing white space and line terminator characters from a string. | | toLocaleUpperCase* | { (locales?: string \| string[]): string; (locales?: LocalesArgument): string; } | - | Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. | | toUpperCase* | () => string | - | Converts all the alphabetic characters in a string to uppercase. | | toLocaleLowerCase* | { (locales?: string \| string[]): string; (locales?: LocalesArgument): string; } | - | Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. | | toLowerCase* | () => string | - | Converts all the alphabetic characters in a string to lowercase. | | substring* | (start: number, end?: number) => string | - | Returns the substring at the specified location within a String object. @param start The zero-based index number indicating the beginning of the substring. @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. If end is omitted, the characters from start through the end of the original string are returned. | | split* | { (separator: string \| RegExp, limit?: number): string[]; (splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[]; } | - | Split a string into substrings using the specified separator and return them as an array. @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. @param limit A value used to limit the number of elements returned in the array. @param splitter An object that can split a string. @param limit A value used to limit the number of elements returned in the array. | | slice* | (start?: number, end?: number) => string | - | Returns a section of a string. @param start The index to the beginning of the specified portion of stringObj. @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. If this value is not specified, the substring continues to the end of stringObj. | | search* | { (regexp: string \| RegExp): number; (searcher: { [Symbol.search](string: string): number; }): number; } | - | Finds the first substring match in a regular expression search. @param regexp The regular expression pattern and applicable flags. @param searcher An object which supports searching within a string. | | replace* | { (searchValue: string \| RegExp, replaceValue: string): string; (searchValue: string \| RegExp, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: { ...; }, replaceValue: string): string; (searchValue: { ...; }, replacer: (substring: string, ...args: any[]) => string): string; } | - | Replaces text in a string, using a regular expression or search string. Passes a string and {@linkcode replaceValue} to the [Symbol.replace] method on {@linkcode searchValue}. This method is expected to implement its own replacement algorithm. Replaces text in a string, using an object that supports replacement within a string. @param searchValue A string or regular expression to search for. @param replaceValue A string containing the text to replace. When the {@linkcode searchValue } is a RegExp, all matches are replaced if the g flag is set (or only those matches at the beginning, if the y flag is also present). Otherwise, only the first match of {@linkcode searchValue } is replaced. @param searchValue A string to search for. @param replacer A function that returns the replacement text. @param searchValue An object that supports searching for and replacing matches within a string. @param replaceValue The replacement text. @param searchValue A object can search for and replace matches within a string. @param replacer A function that returns the replacement text. | | match* | { (regexp: string \| RegExp): RegExpMatchArray; (matcher: { [Symbol.match](string: string): RegExpMatchArray; }): RegExpMatchArray; } | - | Matches a string with a regular expression, and returns an array containing the results of that search. Matches a string or an object that supports being matched against, and returns an array containing the results of that search, or null if no matches are found. @param regexp A variable name or string literal containing the regular expression pattern and flags. @param matcher An object that supports being matched against. | | localeCompare* | { (that: string): number; (that: string, locales?: string \| string[], options?: CollatorOptions): number; (that: string, locales?: LocalesArgument, options?: CollatorOptions): number; } | - | Determines whether two strings are equivalent in the current locale. Determines whether two strings are equivalent in the current or specified locale. @param that String to compare to target string @param that String to compare to target string @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. @param that String to compare to target string @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. | | lastIndexOf* | (searchString: string, position?: number) => number | - | Returns the last occurrence of a substring in the string. @param searchString The substring to search for. @param position The index at which to begin searching. If omitted, the search begins at the end of the string. | | indexOf* | (searchString: string, position?: number) => number | - | Returns the position of the first occurrence of a substring. @param searchString The substring to search for in the string @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. | | concat* | (...strings: string[]) => string | - | Returns a string that contains the concatenation of two or more strings. @param strings The strings to append to the end of the string. | | charCodeAt* | (index: number) => number | - | Returns the Unicode value of the character at the specified location. @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. | | charAt* | (pos: number) => string | - | Returns the character at the specified index. @param pos The zero-based index of the desired character. | | toString | () => string | function toString() { [native code] } | Returns a string representation of a string. | | valueOf | () => string | function valueOf() { [native code] } | Returns the primitive value of the specified object. |

getOnDownloadFileClick

helper

Функция для выгрузки расчета по ценам

getOnShareClick

Props

| name | type | default value | description | |------|------|---------------|-------------| | backendHost | string | 'https://api.cloud.ru' | | | baseUrl | string | 'https://cloud.ru' | |

getFetcherFn

helper

Функция для отправки запросов на цены

getInitPrice

helper

Функция для получения стартовой цены

Changelog