@hywax/cms 1.8.0 → 1.9.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/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/ButtonDeleteConfirm.d.vue.ts +2 -0
- package/dist/runtime/components/ButtonDeleteConfirm.vue +2 -0
- package/dist/runtime/components/ButtonDeleteConfirm.vue.d.ts +2 -0
- package/dist/runtime/types/dictionaries.d.ts +1 -0
- package/dist/runtime/types/dictionaries.js +0 -0
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/utils/formatters.d.ts +4 -1
- package/dist/runtime/utils/formatters.js +18 -2
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { snakeCase, kebabCase } from 'scule';
|
|
|
6
6
|
import { readFile, writeFile } from 'node:fs/promises';
|
|
7
7
|
|
|
8
8
|
const name = "@hywax/cms";
|
|
9
|
-
const version = "1.
|
|
9
|
+
const version = "1.9.0";
|
|
10
10
|
|
|
11
11
|
function createContext(options, nuxt) {
|
|
12
12
|
const { resolve } = createResolver(import.meta.url);
|
|
@@ -17,6 +17,7 @@ export interface ButtonDeleteProps extends Pick<ModalConfirmProps, 'onConfirm'>
|
|
|
17
17
|
variant?: ButtonProps['variant'];
|
|
18
18
|
icon?: ButtonProps['icon'];
|
|
19
19
|
size?: ButtonProps['size'];
|
|
20
|
+
label?: ButtonProps['label'];
|
|
20
21
|
class?: any;
|
|
21
22
|
ui?: ButtonDelete['slots'];
|
|
22
23
|
}
|
|
@@ -32,5 +33,6 @@ declare const __VLS_export: import("vue").DefineComponent<ButtonDeleteProps, {},
|
|
|
32
33
|
onConfirm?: (() => any) | undefined;
|
|
33
34
|
}>, {
|
|
34
35
|
color: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral";
|
|
36
|
+
label: string;
|
|
35
37
|
confirmLabel: string;
|
|
36
38
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
:variant="variant"
|
|
12
12
|
:size="size"
|
|
13
13
|
:icon="icon"
|
|
14
|
+
:label="label"
|
|
14
15
|
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
15
16
|
auto-loading
|
|
16
17
|
@click="handleDeleteClick()"
|
|
@@ -37,6 +38,7 @@ const props = defineProps({
|
|
|
37
38
|
variant: { type: null, required: false },
|
|
38
39
|
icon: { type: null, required: false },
|
|
39
40
|
size: { type: null, required: false },
|
|
41
|
+
label: { type: String, required: false, default: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C" },
|
|
40
42
|
class: { type: null, required: false },
|
|
41
43
|
ui: { type: null, required: false },
|
|
42
44
|
onConfirm: { type: Function, required: false }
|
|
@@ -17,6 +17,7 @@ export interface ButtonDeleteProps extends Pick<ModalConfirmProps, 'onConfirm'>
|
|
|
17
17
|
variant?: ButtonProps['variant'];
|
|
18
18
|
icon?: ButtonProps['icon'];
|
|
19
19
|
size?: ButtonProps['size'];
|
|
20
|
+
label?: ButtonProps['label'];
|
|
20
21
|
class?: any;
|
|
21
22
|
ui?: ButtonDelete['slots'];
|
|
22
23
|
}
|
|
@@ -32,5 +33,6 @@ declare const __VLS_export: import("vue").DefineComponent<ButtonDeleteProps, {},
|
|
|
32
33
|
onConfirm?: (() => any) | undefined;
|
|
33
34
|
}>, {
|
|
34
35
|
color: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral";
|
|
36
|
+
label: string;
|
|
35
37
|
confirmLabel: string;
|
|
36
38
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Country = 'ru' | 'us';
|
|
File without changes
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type { FiltersField } from '../components/TableFilters.vue';
|
|
2
2
|
export type { ActionMenuItem } from '../components/TablePanel.vue';
|
|
3
3
|
export * from './date';
|
|
4
|
+
export * from './dictionaries';
|
|
4
5
|
export * from './image';
|
|
5
6
|
export * from './query';
|
|
6
7
|
export * from './seo';
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Country } from '../types/dictionaries';
|
|
2
|
+
export declare function formatMoney(value: number, country?: Country, locales?: Intl.LocalesArgument): string;
|
|
3
|
+
export declare function formatNumber(value: number, locales?: Intl.LocalesArgument): string;
|
|
4
|
+
export declare function formatPercentage(value: number, locales?: Intl.LocalesArgument): string;
|
|
2
5
|
export declare function formatBoolean(value: boolean | undefined | null): string;
|
|
@@ -1,8 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const currencies = {
|
|
2
|
+
ru: "RUB",
|
|
3
|
+
us: "USD"
|
|
4
|
+
};
|
|
5
|
+
export function formatMoney(value, country = "ru", locales = "ru-RU") {
|
|
6
|
+
return value.toLocaleString(locales, {
|
|
7
|
+
style: "currency",
|
|
8
|
+
currency: currencies[country],
|
|
9
|
+
currencyDisplay: "narrowSymbol"
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export function formatNumber(value, locales = "ru-RU") {
|
|
13
|
+
return value.toLocaleString(locales, {
|
|
3
14
|
style: "decimal"
|
|
4
15
|
});
|
|
5
16
|
}
|
|
17
|
+
export function formatPercentage(value, locales = "ru-RU") {
|
|
18
|
+
return value.toLocaleString(locales, {
|
|
19
|
+
style: "percent"
|
|
20
|
+
});
|
|
21
|
+
}
|
|
6
22
|
export function formatBoolean(value) {
|
|
7
23
|
return value ? "\u0414\u0430" : "\u041D\u0435\u0442";
|
|
8
24
|
}
|