@cloud-ru/ds-uikit-product-quota 1.0.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/CHANGELOG.md +8 -0
- package/LICENSE +201 -0
- package/README.md +458 -0
- package/dist/cjs/components/QuotaWidget/QuotaIncreaseButton.d.ts +4 -0
- package/dist/cjs/components/QuotaWidget/QuotaIncreaseButton.js +15 -0
- package/dist/cjs/components/QuotaWidget/QuotaMobileHeader.d.ts +4 -0
- package/dist/cjs/components/QuotaWidget/QuotaMobileHeader.js +15 -0
- package/dist/cjs/components/QuotaWidget/QuotaWidget.d.ts +12 -0
- package/dist/cjs/components/QuotaWidget/QuotaWidget.js +44 -0
- package/dist/cjs/components/QuotaWidget/QuotaWidgetContent.d.ts +27 -0
- package/dist/cjs/components/QuotaWidget/QuotaWidgetContent.js +33 -0
- package/dist/cjs/components/QuotaWidget/components/ProjectHeader/ProjectHeader.d.ts +7 -0
- package/dist/cjs/components/QuotaWidget/components/ProjectHeader/ProjectHeader.js +19 -0
- package/dist/cjs/components/QuotaWidget/components/ProjectHeader/index.d.ts +1 -0
- package/dist/cjs/components/QuotaWidget/components/ProjectHeader/index.js +17 -0
- package/dist/cjs/components/QuotaWidget/components/ProjectHeader/styles.module.css +30 -0
- package/dist/cjs/components/QuotaWidget/index.d.ts +2 -0
- package/dist/cjs/components/QuotaWidget/index.js +18 -0
- package/dist/cjs/components/QuotaWidget/styles.module.css +49 -0
- package/dist/cjs/components/QuotaWidgetCard/QuotaWidgetCard.d.ts +13 -0
- package/dist/cjs/components/QuotaWidgetCard/QuotaWidgetCard.js +53 -0
- package/dist/cjs/components/QuotaWidgetCard/components/QuotaTooltip/QuotaTooltip.d.ts +6 -0
- package/dist/cjs/components/QuotaWidgetCard/components/QuotaTooltip/QuotaTooltip.js +23 -0
- package/dist/cjs/components/QuotaWidgetCard/components/QuotaTooltip/index.d.ts +1 -0
- package/dist/cjs/components/QuotaWidgetCard/components/QuotaTooltip/index.js +17 -0
- package/dist/cjs/components/QuotaWidgetCard/components/QuotaTooltip/styles.module.css +34 -0
- package/dist/cjs/components/QuotaWidgetCard/index.d.ts +1 -0
- package/dist/cjs/components/QuotaWidgetCard/index.js +17 -0
- package/dist/cjs/components/QuotaWidgetCard/styles.module.css +97 -0
- package/dist/cjs/components/QuotaWidgetMini/QuotaWidgetMini.d.ts +7 -0
- package/dist/cjs/components/QuotaWidgetMini/QuotaWidgetMini.js +27 -0
- package/dist/cjs/components/QuotaWidgetMini/index.d.ts +1 -0
- package/dist/cjs/components/QuotaWidgetMini/index.js +17 -0
- package/dist/cjs/components/QuotaWidgetMini/styles.module.css +15 -0
- package/dist/cjs/components/index.d.ts +3 -0
- package/dist/cjs/components/index.js +19 -0
- package/dist/cjs/constants.d.ts +17 -0
- package/dist/cjs/constants.js +20 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/QuotaCardsGrid.d.ts +6 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/QuotaCardsGrid.js +32 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/Grid.d.ts +6 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/Grid.js +30 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/QuotaCardsSkeleton.d.ts +6 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/QuotaCardsSkeleton.js +16 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/index.d.ts +1 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/index.js +17 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/styles.module.css +10 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/index.d.ts +1 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/index.js +17 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/styles.module.css +9 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/QuotaError/QuotaError.d.ts +5 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/QuotaError/QuotaError.js +12 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/QuotaError/index.d.ts +1 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/QuotaError/index.js +17 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/index.d.ts +1 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/index.js +17 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/styles.module.css +16 -0
- package/dist/cjs/index.d.ts +5 -0
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/locale/index.d.ts +91 -0
- package/dist/cjs/locale/index.js +50 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/style.css +260 -0
- package/dist/cjs/types.d.ts +34 -0
- package/dist/cjs/types.js +2 -0
- package/dist/cjs/utils/checkIsExceeded.d.ts +2 -0
- package/dist/cjs/utils/checkIsExceeded.js +5 -0
- package/dist/cjs/utils/formatNumber.d.ts +1 -0
- package/dist/cjs/utils/formatNumber.js +6 -0
- package/dist/cjs/utils/getPercent.d.ts +2 -0
- package/dist/cjs/utils/getPercent.js +9 -0
- package/dist/cjs/utils/index.d.ts +3 -0
- package/dist/cjs/utils/index.js +19 -0
- package/dist/esm/components/QuotaWidget/QuotaIncreaseButton.d.ts +4 -0
- package/dist/esm/components/QuotaWidget/QuotaIncreaseButton.js +9 -0
- package/dist/esm/components/QuotaWidget/QuotaMobileHeader.d.ts +4 -0
- package/dist/esm/components/QuotaWidget/QuotaMobileHeader.js +9 -0
- package/dist/esm/components/QuotaWidget/QuotaWidget.d.ts +12 -0
- package/dist/esm/components/QuotaWidget/QuotaWidget.js +41 -0
- package/dist/esm/components/QuotaWidget/QuotaWidgetContent.d.ts +27 -0
- package/dist/esm/components/QuotaWidget/QuotaWidgetContent.js +27 -0
- package/dist/esm/components/QuotaWidget/components/ProjectHeader/ProjectHeader.d.ts +7 -0
- package/dist/esm/components/QuotaWidget/components/ProjectHeader/ProjectHeader.js +13 -0
- package/dist/esm/components/QuotaWidget/components/ProjectHeader/index.d.ts +1 -0
- package/dist/esm/components/QuotaWidget/components/ProjectHeader/index.js +1 -0
- package/dist/esm/components/QuotaWidget/components/ProjectHeader/styles.module.css +30 -0
- package/dist/esm/components/QuotaWidget/index.d.ts +2 -0
- package/dist/esm/components/QuotaWidget/index.js +2 -0
- package/dist/esm/components/QuotaWidget/styles.module.css +49 -0
- package/dist/esm/components/QuotaWidgetCard/QuotaWidgetCard.d.ts +13 -0
- package/dist/esm/components/QuotaWidgetCard/QuotaWidgetCard.js +47 -0
- package/dist/esm/components/QuotaWidgetCard/components/QuotaTooltip/QuotaTooltip.d.ts +6 -0
- package/dist/esm/components/QuotaWidgetCard/components/QuotaTooltip/QuotaTooltip.js +17 -0
- package/dist/esm/components/QuotaWidgetCard/components/QuotaTooltip/index.d.ts +1 -0
- package/dist/esm/components/QuotaWidgetCard/components/QuotaTooltip/index.js +1 -0
- package/dist/esm/components/QuotaWidgetCard/components/QuotaTooltip/styles.module.css +34 -0
- package/dist/esm/components/QuotaWidgetCard/index.d.ts +1 -0
- package/dist/esm/components/QuotaWidgetCard/index.js +1 -0
- package/dist/esm/components/QuotaWidgetCard/styles.module.css +97 -0
- package/dist/esm/components/QuotaWidgetMini/QuotaWidgetMini.d.ts +7 -0
- package/dist/esm/components/QuotaWidgetMini/QuotaWidgetMini.js +21 -0
- package/dist/esm/components/QuotaWidgetMini/index.d.ts +1 -0
- package/dist/esm/components/QuotaWidgetMini/index.js +1 -0
- package/dist/esm/components/QuotaWidgetMini/styles.module.css +15 -0
- package/dist/esm/components/index.d.ts +3 -0
- package/dist/esm/components/index.js +3 -0
- package/dist/esm/constants.d.ts +17 -0
- package/dist/esm/constants.js +17 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/QuotaCardsGrid.d.ts +6 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/QuotaCardsGrid.js +26 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/Grid.d.ts +6 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/Grid.js +24 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/QuotaCardsSkeleton.d.ts +6 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/QuotaCardsSkeleton.js +10 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/index.d.ts +1 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/index.js +1 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/styles.module.css +10 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/index.d.ts +1 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/index.js +1 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/styles.module.css +9 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/QuotaError/QuotaError.d.ts +5 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/QuotaError/QuotaError.js +9 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/QuotaError/index.d.ts +1 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/QuotaError/index.js +1 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/index.d.ts +1 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/index.js +1 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/styles.module.css +16 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/locale/index.d.ts +91 -0
- package/dist/esm/locale/index.js +47 -0
- package/dist/esm/style.css +260 -0
- package/dist/esm/types.d.ts +34 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/utils/checkIsExceeded.d.ts +2 -0
- package/dist/esm/utils/checkIsExceeded.js +1 -0
- package/dist/esm/utils/formatNumber.d.ts +1 -0
- package/dist/esm/utils/formatNumber.js +3 -0
- package/dist/esm/utils/getPercent.d.ts +2 -0
- package/dist/esm/utils/getPercent.js +6 -0
- package/dist/esm/utils/index.d.ts +3 -0
- package/dist/esm/utils/index.js +3 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -0
- package/package.json +63 -0
- package/src/components/QuotaWidget/QuotaIncreaseButton.tsx +21 -0
- package/src/components/QuotaWidget/QuotaMobileHeader.tsx +18 -0
- package/src/components/QuotaWidget/QuotaWidget.tsx +109 -0
- package/src/components/QuotaWidget/QuotaWidgetContent.tsx +91 -0
- package/src/components/QuotaWidget/components/ProjectHeader/ProjectHeader.tsx +59 -0
- package/src/components/QuotaWidget/components/ProjectHeader/index.ts +1 -0
- package/src/components/QuotaWidget/components/ProjectHeader/styles.module.scss +29 -0
- package/src/components/QuotaWidget/index.ts +2 -0
- package/src/components/QuotaWidget/styles.module.scss +52 -0
- package/src/components/QuotaWidgetCard/QuotaWidgetCard.tsx +127 -0
- package/src/components/QuotaWidgetCard/components/QuotaTooltip/QuotaTooltip.tsx +48 -0
- package/src/components/QuotaWidgetCard/components/QuotaTooltip/index.ts +1 -0
- package/src/components/QuotaWidgetCard/components/QuotaTooltip/styles.module.scss +30 -0
- package/src/components/QuotaWidgetCard/index.ts +1 -0
- package/src/components/QuotaWidgetCard/styles.module.scss +97 -0
- package/src/components/QuotaWidgetMini/QuotaWidgetMini.tsx +93 -0
- package/src/components/QuotaWidgetMini/index.ts +1 -0
- package/src/components/QuotaWidgetMini/styles.module.scss +18 -0
- package/src/components/index.ts +3 -0
- package/src/constants.ts +17 -0
- package/src/helperComponents/QuotaCardsGrid/QuotaCardsGrid.tsx +54 -0
- package/src/helperComponents/QuotaCardsGrid/components/Grid/Grid.tsx +47 -0
- package/src/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/QuotaCardsSkeleton.tsx +24 -0
- package/src/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/index.ts +1 -0
- package/src/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/styles.module.scss +15 -0
- package/src/helperComponents/QuotaCardsGrid/components/Grid/index.ts +1 -0
- package/src/helperComponents/QuotaCardsGrid/components/Grid/styles.module.scss +12 -0
- package/src/helperComponents/QuotaCardsGrid/components/QuotaError/QuotaError.tsx +31 -0
- package/src/helperComponents/QuotaCardsGrid/components/QuotaError/index.ts +1 -0
- package/src/helperComponents/QuotaCardsGrid/index.ts +1 -0
- package/src/helperComponents/QuotaCardsGrid/styles.module.scss +16 -0
- package/src/index.ts +5 -0
- package/src/locale/index.ts +51 -0
- package/src/types.ts +35 -0
- package/src/utils/checkIsExceeded.ts +3 -0
- package/src/utils/formatNumber.ts +3 -0
- package/src/utils/getPercent.ts +9 -0
- package/src/utils/index.ts +3 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.QuotaWidgetMini = QuotaWidgetMini;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const accordion_1 = require("@cloud-ru/ds-accordion");
|
|
9
|
+
const button_1 = require("@cloud-ru/ds-button");
|
|
10
|
+
const counter_1 = require("@cloud-ru/ds-counter");
|
|
11
|
+
const truncate_string_1 = require("@cloud-ru/ds-truncate-string");
|
|
12
|
+
const constants_1 = require("../../constants");
|
|
13
|
+
const QuotaCardsGrid_1 = require("../../helperComponents/QuotaCardsGrid");
|
|
14
|
+
const locale_1 = require("../../locale");
|
|
15
|
+
const utils_1 = require("../../utils");
|
|
16
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
17
|
+
const ACCORDION_ID = 'quotas-widget-accordion';
|
|
18
|
+
function QuotaWidgetMini({ quotas, disableSorting, loading, error, onRefresh, projectName, canEditQuota, defaultExpanded, hideIncreaseQuotaButton, onIncreaseQuotaClick, onWidgetOpen, 'data-test-id': dataTestId, ...props }) {
|
|
19
|
+
const { t } = locale_1.quotaLocale.useTranslations();
|
|
20
|
+
const exhaustedCount = quotas.filter(utils_1.checkIsExceeded).length;
|
|
21
|
+
const handleExpandedChange = (expanded) => {
|
|
22
|
+
if (expanded) {
|
|
23
|
+
onWidgetOpen?.();
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)("div", { "data-test-id": dataTestId ?? constants_1.TEST_IDS.quotaWidgetMini.root, children: (0, jsx_runtime_1.jsx)(accordion_1.Accordion, { ...props, expandedDefault: defaultExpanded ? ACCORDION_ID : undefined, onExpandedChange: handleExpandedChange, children: (0, jsx_runtime_1.jsx)(accordion_1.Accordion.CollapseBlockSecondary, { id: ACCORDION_ID, className: styles_module_scss_1.default.collapse, "data-test-id": constants_1.TEST_IDS.quotaWidgetMini.trigger, title: t('quotas'), afterTitle: !error && !loading && exhaustedCount > 0 ? ((0, jsx_runtime_1.jsx)(counter_1.Counter, { value: exhaustedCount, size: 'xs', appearance: 'red' })) : undefined, subTitle: (0, jsx_runtime_1.jsx)(truncate_string_1.TruncateString, { maxLines: 1, text: projectName }), children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.body, "data-test-id": constants_1.TEST_IDS.quotaWidgetMini.content, children: [(0, jsx_runtime_1.jsx)(QuotaCardsGrid_1.QuotaCardsGrid, { isAccordion: true, quotas: quotas, disableSorting: disableSorting, loading: loading, error: error, onRefresh: onRefresh }), !error && canEditQuota && !hideIncreaseQuotaButton && ((0, jsx_runtime_1.jsx)(button_1.Button, { className: styles_module_scss_1.default.button, fullWidth: true, view: 'outline', appearance: 'neutral', label: t('increaseQuota'), size: 'm', onClick: onIncreaseQuotaClick }))] }) }) }) }));
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './QuotaWidgetMini';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./QuotaWidgetMini"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./QuotaWidget"), exports);
|
|
18
|
+
__exportStar(require("./QuotaWidgetMini"), exports);
|
|
19
|
+
__exportStar(require("./QuotaWidgetCard"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const TEST_IDS: {
|
|
2
|
+
readonly quotaWidget: {
|
|
3
|
+
readonly root: "quota-widget";
|
|
4
|
+
readonly trigger: "quota-widget__trigger";
|
|
5
|
+
readonly content: "quota-widget__content";
|
|
6
|
+
readonly projectHeader: "quota-widget__project-header";
|
|
7
|
+
};
|
|
8
|
+
readonly quotaWidgetMini: {
|
|
9
|
+
readonly root: "quota-widget-mini";
|
|
10
|
+
readonly trigger: "quota-widget-mini__trigger";
|
|
11
|
+
readonly content: "quota-widget-mini__content";
|
|
12
|
+
};
|
|
13
|
+
readonly quotaWidgetCard: {
|
|
14
|
+
readonly root: "quota-widget-card";
|
|
15
|
+
readonly tooltip: "quota-widget-card__tooltip";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TEST_IDS = void 0;
|
|
4
|
+
exports.TEST_IDS = {
|
|
5
|
+
quotaWidget: {
|
|
6
|
+
root: 'quota-widget',
|
|
7
|
+
trigger: 'quota-widget__trigger',
|
|
8
|
+
content: 'quota-widget__content',
|
|
9
|
+
projectHeader: 'quota-widget__project-header',
|
|
10
|
+
},
|
|
11
|
+
quotaWidgetMini: {
|
|
12
|
+
root: 'quota-widget-mini',
|
|
13
|
+
trigger: 'quota-widget-mini__trigger',
|
|
14
|
+
content: 'quota-widget-mini__content',
|
|
15
|
+
},
|
|
16
|
+
quotaWidgetCard: {
|
|
17
|
+
root: 'quota-widget-card',
|
|
18
|
+
tooltip: 'quota-widget-card__tooltip',
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { QuotaWidgetPropsBase } from '../../types';
|
|
2
|
+
type QuotaCardsGridProps = Pick<QuotaWidgetPropsBase, 'quotas' | 'disableSorting' | 'loading' | 'error' | 'onRefresh'> & {
|
|
3
|
+
isAccordion?: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare function QuotaCardsGrid({ quotas, loading, error, onRefresh, disableSorting, isAccordion, }: QuotaCardsGridProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.QuotaCardsGrid = QuotaCardsGrid;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const adaptive_1 = require("@cloud-ru/ds-adaptive");
|
|
9
|
+
const scroll_1 = require("@cloud-ru/ds-scroll");
|
|
10
|
+
const Grid_1 = require("./components/Grid");
|
|
11
|
+
const QuotaError_1 = require("./components/QuotaError");
|
|
12
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
13
|
+
function QuotaCardsGrid({ quotas, loading, error, onRefresh, disableSorting = false, isAccordion = false, }) {
|
|
14
|
+
// На мобилке bottom-sheet-виджет full-height: снимаем фикс-cap высоты (`max-height`), карточки
|
|
15
|
+
// скроллятся телом листа. Для аккордеона (`QuotaWidgetMini`) это НЕ применяем — у него свой cap.
|
|
16
|
+
const isMobile = (0, adaptive_1.isMobileLayout)((0, adaptive_1.useAdaptiveLayout)().layoutType);
|
|
17
|
+
const wrapperAttributes = {
|
|
18
|
+
className: styles_module_scss_1.default.wrapper,
|
|
19
|
+
'data-accordion': isAccordion,
|
|
20
|
+
'data-mobile': isMobile && !isAccordion,
|
|
21
|
+
};
|
|
22
|
+
const gridProps = {
|
|
23
|
+
quotas,
|
|
24
|
+
loading,
|
|
25
|
+
disableSorting,
|
|
26
|
+
isAccordion,
|
|
27
|
+
};
|
|
28
|
+
if (error) {
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)("div", { ...wrapperAttributes, children: (0, jsx_runtime_1.jsx)(QuotaError_1.QuotaError, { onRefresh: onRefresh }) }));
|
|
30
|
+
}
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(scroll_1.Scroll, { ...wrapperAttributes, size: 's', children: (0, jsx_runtime_1.jsx)(Grid_1.Grid, { ...gridProps }) }));
|
|
32
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { QuotaWidgetPropsBase } from '../../../../types';
|
|
2
|
+
type GridProps = Pick<QuotaWidgetPropsBase, 'quotas' | 'loading' | 'disableSorting'> & {
|
|
3
|
+
isAccordion?: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare function Grid({ quotas, loading, disableSorting, isAccordion }: GridProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Grid = Grid;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const adaptive_1 = require("@cloud-ru/ds-adaptive");
|
|
9
|
+
const QuotaWidgetCard_1 = require("../../../../components/QuotaWidgetCard");
|
|
10
|
+
const constants_1 = require("../../../../constants");
|
|
11
|
+
const getPercent_1 = require("../../../../utils/getPercent");
|
|
12
|
+
const QuotaWidgetCardsSkeleton_1 = require("./components/QuotaWidgetCardsSkeleton");
|
|
13
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
14
|
+
function sortQuotas(quotas) {
|
|
15
|
+
return [...quotas].sort((first, second) => {
|
|
16
|
+
const percentFirst = (0, getPercent_1.getPercent)(first);
|
|
17
|
+
const percentSecond = (0, getPercent_1.getPercent)(second);
|
|
18
|
+
if (percentSecond !== percentFirst) {
|
|
19
|
+
return percentSecond - percentFirst;
|
|
20
|
+
}
|
|
21
|
+
return first.name.localeCompare(second.name);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function Grid({ quotas, loading, disableSorting = false, isAccordion = false }) {
|
|
25
|
+
const sortedQuotas = disableSorting ? quotas : sortQuotas(quotas);
|
|
26
|
+
// На мобилке — строго одна колонка на всю ширину (BottomSheet-раскладка узкая, 2 колонки не влезают).
|
|
27
|
+
const { layoutType } = (0, adaptive_1.useAdaptiveLayout)();
|
|
28
|
+
const isSingleColumn = (quotas.length <= 1 && !loading) || isAccordion || (0, adaptive_1.isMobileLayout)(layoutType);
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.grid, "data-single": isSingleColumn, children: (0, jsx_runtime_1.jsx)(QuotaWidgetCardsSkeleton_1.QuotaWidgetCardsSkeleton, { loading: loading, children: sortedQuotas.map(quota => ((0, jsx_runtime_1.jsx)(QuotaWidgetCard_1.QuotaWidgetCard, { quota: quota, "data-test-id": `${constants_1.TEST_IDS.quotaWidgetCard.root}--${quota.name}` }, quota.name))) }) }));
|
|
30
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
type QuotaWidgetCardsSkeletonProps = PropsWithChildren<{
|
|
3
|
+
loading: boolean;
|
|
4
|
+
}>;
|
|
5
|
+
export declare function QuotaWidgetCardsSkeleton({ loading, children }: QuotaWidgetCardsSkeletonProps): string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element[] | null | undefined;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.QuotaWidgetCardsSkeleton = QuotaWidgetCardsSkeleton;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const skeleton_1 = require("@cloud-ru/ds-skeleton");
|
|
9
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
10
|
+
const SKELETON_COUNT = 6;
|
|
11
|
+
function QuotaWidgetCardsSkeleton({ loading, children }) {
|
|
12
|
+
if (loading) {
|
|
13
|
+
return [...Array(SKELETON_COUNT)].map((_, index) => ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.card, children: [(0, jsx_runtime_1.jsx)(skeleton_1.SkeletonText, { loading: true, lines: 1, variant: 'body', size: 'm' }), (0, jsx_runtime_1.jsx)(skeleton_1.SkeletonText, { loading: true, lines: 1, variant: 'body', size: 'm' }), (0, jsx_runtime_1.jsx)(skeleton_1.SkeletonText, { loading: true, lines: 1, variant: 'body', size: 'l' })] }, index)));
|
|
14
|
+
}
|
|
15
|
+
return children;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './QuotaCardsSkeleton';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./QuotaCardsSkeleton"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
.card{
|
|
2
|
+
display:flex;
|
|
3
|
+
flex:1;
|
|
4
|
+
flex-direction:column;
|
|
5
|
+
row-gap:var(--sn-primitive-dimension-4, 4px);
|
|
6
|
+
min-width:0;
|
|
7
|
+
padding:var(--sn-primitive-dimension-8, 8px);
|
|
8
|
+
border-radius:var(--sn-card-anatomy-radius-s-container-borderRadius, var(--sn-brand-anatomy-radius-card-s, var(--sn-primitive-dimension-2, 2px)));
|
|
9
|
+
background-color:var(--sn-theme-color-neutral-decorTransparent, var(--sn-brand-color-neutral-transparent-forLightMode, rgba(124, 131, 182, 0.0784313725)));
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Grid';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Grid"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuotaError = QuotaError;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const button_1 = require("@cloud-ru/ds-button");
|
|
6
|
+
const system_1 = require("@cloud-ru/ds-icons/interface/system");
|
|
7
|
+
const info_block_1 = require("@cloud-ru/ds-info-block");
|
|
8
|
+
const locale_1 = require("../../../../locale");
|
|
9
|
+
function QuotaError({ onRefresh }) {
|
|
10
|
+
const { t } = locale_1.quotaLocale.useTranslations();
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(info_block_1.InfoBlock, { size: 'm', align: 'vertical', content: t('errorText'), icon: { icon: system_1.CrossSVG, appearance: 'neutral', background: true }, footer: (0, jsx_runtime_1.jsx)(button_1.Button, { appearance: 'neutral', size: 'm', label: t('errorButton'), icon: (0, jsx_runtime_1.jsx)(system_1.UpdateSVG, { size: 24 }), onClick: onRefresh }) }));
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './QuotaError';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./QuotaError"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './QuotaCardsGrid';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./QuotaCardsGrid"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./components"), exports);
|
|
18
|
+
__exportStar(require("./constants"), exports);
|
|
19
|
+
__exportStar(require("./types"), exports);
|
|
20
|
+
__exportStar(require("./utils"), exports);
|
|
21
|
+
__exportStar(require("./locale"), exports);
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
declare const QUOTA_MESSAGES: {
|
|
2
|
+
readonly 'en-GB': {
|
|
3
|
+
readonly quotas: "Quotas";
|
|
4
|
+
readonly widgetTitle: {
|
|
5
|
+
readonly withoutProject: "Project quotas";
|
|
6
|
+
readonly quotes: "Project quotas «{{project}}»";
|
|
7
|
+
readonly noQuotes: "Project quotas {{project}}";
|
|
8
|
+
};
|
|
9
|
+
readonly widgetSubtitle: "Current quota balance";
|
|
10
|
+
readonly increaseQuota: "Increase quota";
|
|
11
|
+
readonly cardAvailable: "Available";
|
|
12
|
+
readonly cardRemaining: "Remaining";
|
|
13
|
+
readonly tooltipAvailable: "Available";
|
|
14
|
+
readonly tooltipUsed: "Used";
|
|
15
|
+
readonly tooltipRemaining: "Remaining";
|
|
16
|
+
readonly tooltipExhaustedHint: {
|
|
17
|
+
readonly first: "Quota exhausted.";
|
|
18
|
+
readonly second: "To increase the quota, contact the quota or organization administrator.";
|
|
19
|
+
};
|
|
20
|
+
readonly errorText: "Failed to load data";
|
|
21
|
+
readonly errorButton: "Refresh";
|
|
22
|
+
};
|
|
23
|
+
readonly 'ru-RU': {
|
|
24
|
+
readonly quotas: "Квоты";
|
|
25
|
+
readonly widgetTitle: {
|
|
26
|
+
readonly withoutProject: "Квоты проекта";
|
|
27
|
+
readonly quotes: "Квоты проекта «{{project}}»";
|
|
28
|
+
readonly noQuotes: "Квоты проекта {{project}}";
|
|
29
|
+
};
|
|
30
|
+
readonly widgetSubtitle: "Остаток по квотам на текущий момент";
|
|
31
|
+
readonly increaseQuota: "Увеличить квоту";
|
|
32
|
+
readonly cardAvailable: "Доступно";
|
|
33
|
+
readonly cardRemaining: "Остаток";
|
|
34
|
+
readonly tooltipAvailable: "Доступно";
|
|
35
|
+
readonly tooltipUsed: "Использовано";
|
|
36
|
+
readonly tooltipRemaining: "Остаток";
|
|
37
|
+
readonly tooltipExhaustedHint: {
|
|
38
|
+
readonly first: "Квота исчерпана.";
|
|
39
|
+
readonly second: "Чтобы увеличить квоту, обратитесь к администратору квот или организации.";
|
|
40
|
+
};
|
|
41
|
+
readonly errorText: "Не удалось загрузить данные";
|
|
42
|
+
readonly errorButton: "Обновить";
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export type QuotaMessages = (typeof QUOTA_MESSAGES)['en-GB'];
|
|
46
|
+
/** locale компонента Quota: `quotaLocale.useTranslations()` в коде, `quotaLocale.extend(...)` в сервисе. */
|
|
47
|
+
export declare const quotaLocale: import("@cloud-ru/ds-locale").DefinedLocale<{
|
|
48
|
+
readonly 'en-GB': {
|
|
49
|
+
readonly quotas: "Quotas";
|
|
50
|
+
readonly widgetTitle: {
|
|
51
|
+
readonly withoutProject: "Project quotas";
|
|
52
|
+
readonly quotes: "Project quotas «{{project}}»";
|
|
53
|
+
readonly noQuotes: "Project quotas {{project}}";
|
|
54
|
+
};
|
|
55
|
+
readonly widgetSubtitle: "Current quota balance";
|
|
56
|
+
readonly increaseQuota: "Increase quota";
|
|
57
|
+
readonly cardAvailable: "Available";
|
|
58
|
+
readonly cardRemaining: "Remaining";
|
|
59
|
+
readonly tooltipAvailable: "Available";
|
|
60
|
+
readonly tooltipUsed: "Used";
|
|
61
|
+
readonly tooltipRemaining: "Remaining";
|
|
62
|
+
readonly tooltipExhaustedHint: {
|
|
63
|
+
readonly first: "Quota exhausted.";
|
|
64
|
+
readonly second: "To increase the quota, contact the quota or organization administrator.";
|
|
65
|
+
};
|
|
66
|
+
readonly errorText: "Failed to load data";
|
|
67
|
+
readonly errorButton: "Refresh";
|
|
68
|
+
};
|
|
69
|
+
readonly 'ru-RU': {
|
|
70
|
+
readonly quotas: "Квоты";
|
|
71
|
+
readonly widgetTitle: {
|
|
72
|
+
readonly withoutProject: "Квоты проекта";
|
|
73
|
+
readonly quotes: "Квоты проекта «{{project}}»";
|
|
74
|
+
readonly noQuotes: "Квоты проекта {{project}}";
|
|
75
|
+
};
|
|
76
|
+
readonly widgetSubtitle: "Остаток по квотам на текущий момент";
|
|
77
|
+
readonly increaseQuota: "Увеличить квоту";
|
|
78
|
+
readonly cardAvailable: "Доступно";
|
|
79
|
+
readonly cardRemaining: "Остаток";
|
|
80
|
+
readonly tooltipAvailable: "Доступно";
|
|
81
|
+
readonly tooltipUsed: "Использовано";
|
|
82
|
+
readonly tooltipRemaining: "Остаток";
|
|
83
|
+
readonly tooltipExhaustedHint: {
|
|
84
|
+
readonly first: "Квота исчерпана.";
|
|
85
|
+
readonly second: "Чтобы увеличить квоту, обратитесь к администратору квот или организации.";
|
|
86
|
+
};
|
|
87
|
+
readonly errorText: "Не удалось загрузить данные";
|
|
88
|
+
readonly errorButton: "Обновить";
|
|
89
|
+
};
|
|
90
|
+
}, "@cloud-ru/ds-uikit-product-quota">;
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.quotaLocale = void 0;
|
|
4
|
+
const locale_1 = require("@cloud-ru/ds-locale");
|
|
5
|
+
const QUOTA_MESSAGES = (0, locale_1.defineMessages)({
|
|
6
|
+
'en-GB': {
|
|
7
|
+
quotas: 'Quotas',
|
|
8
|
+
widgetTitle: {
|
|
9
|
+
withoutProject: 'Project quotas',
|
|
10
|
+
quotes: 'Project quotas «{{project}}»',
|
|
11
|
+
noQuotes: 'Project quotas {{project}}',
|
|
12
|
+
},
|
|
13
|
+
widgetSubtitle: 'Current quota balance',
|
|
14
|
+
increaseQuota: 'Increase quota',
|
|
15
|
+
cardAvailable: 'Available',
|
|
16
|
+
cardRemaining: 'Remaining',
|
|
17
|
+
tooltipAvailable: 'Available',
|
|
18
|
+
tooltipUsed: 'Used',
|
|
19
|
+
tooltipRemaining: 'Remaining',
|
|
20
|
+
tooltipExhaustedHint: {
|
|
21
|
+
first: 'Quota exhausted.',
|
|
22
|
+
second: 'To increase the quota, contact the quota or organization administrator.',
|
|
23
|
+
},
|
|
24
|
+
errorText: 'Failed to load data',
|
|
25
|
+
errorButton: 'Refresh',
|
|
26
|
+
},
|
|
27
|
+
'ru-RU': {
|
|
28
|
+
quotas: 'Квоты',
|
|
29
|
+
widgetTitle: {
|
|
30
|
+
withoutProject: 'Квоты проекта',
|
|
31
|
+
quotes: 'Квоты проекта «{{project}}»',
|
|
32
|
+
noQuotes: 'Квоты проекта {{project}}',
|
|
33
|
+
},
|
|
34
|
+
widgetSubtitle: 'Остаток по квотам на текущий момент',
|
|
35
|
+
increaseQuota: 'Увеличить квоту',
|
|
36
|
+
cardAvailable: 'Доступно',
|
|
37
|
+
cardRemaining: 'Остаток',
|
|
38
|
+
tooltipAvailable: 'Доступно',
|
|
39
|
+
tooltipUsed: 'Использовано',
|
|
40
|
+
tooltipRemaining: 'Остаток',
|
|
41
|
+
tooltipExhaustedHint: {
|
|
42
|
+
first: 'Квота исчерпана.',
|
|
43
|
+
second: 'Чтобы увеличить квоту, обратитесь к администратору квот или организации.',
|
|
44
|
+
},
|
|
45
|
+
errorText: 'Не удалось загрузить данные',
|
|
46
|
+
errorButton: 'Обновить',
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
/** locale компонента Quota: `quotaLocale.useTranslations()` в коде, `quotaLocale.extend(...)` в сервисе. */
|
|
50
|
+
exports.quotaLocale = (0, locale_1.defineLocale)('@cloud-ru/ds-uikit-product-quota', QUOTA_MESSAGES);
|