@hywax/cms 1.7.1 → 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/.nuxt/cms.css +31 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +46 -2
- 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 +3 -1
package/.nuxt/cms.css
CHANGED
|
@@ -1 +1,31 @@
|
|
|
1
|
-
@source "./cms";
|
|
1
|
+
@source "./cms";
|
|
2
|
+
|
|
3
|
+
@layer components {
|
|
4
|
+
.unvois {
|
|
5
|
+
--vis-crosshair-line-stroke-color: var(--ui-bg-elevated);
|
|
6
|
+
--vis-crosshair-circle-stroke-color: transparent;
|
|
7
|
+
|
|
8
|
+
--vis-axis-grid-color: var(--ui-border);
|
|
9
|
+
--vis-axis-tick-color: var(--ui-border);
|
|
10
|
+
--vis-axis-tick-label-color: var(--ui-text-dimmed);
|
|
11
|
+
|
|
12
|
+
--vis-tooltip-background-color: var(--ui-bg);
|
|
13
|
+
--vis-tooltip-border-color: var(--ui-border);
|
|
14
|
+
--vis-tooltip-text-color: var(--ui-text-highlighted);
|
|
15
|
+
|
|
16
|
+
--vis-color0: var(--ui-primary);
|
|
17
|
+
--vis-color1: var(--ui-secondary);
|
|
18
|
+
--vis-color2: var(--ui-info);
|
|
19
|
+
--vis-color3: var(--ui-warning);
|
|
20
|
+
--vis-color4: var(--ui-error);
|
|
21
|
+
--vis-color5: var(--ui-success);
|
|
22
|
+
|
|
23
|
+
--vis-dark-color0: var(--ui-primary);
|
|
24
|
+
--vis-dark-color1: var(--ui-secondary);
|
|
25
|
+
--vis-dark-color2: var(--ui-info);
|
|
26
|
+
--vis-dark-color3: var(--ui-warning);
|
|
27
|
+
--vis-dark-color4: var(--ui-error);
|
|
28
|
+
--vis-dark-color5: var(--ui-success);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
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);
|
|
@@ -239,6 +239,20 @@ function prepareMergeConfigs({ nuxt, options }) {
|
|
|
239
239
|
url: options.uploraUrl,
|
|
240
240
|
apiKey: ""
|
|
241
241
|
});
|
|
242
|
+
nuxt.options.vite = defu(nuxt.options.vite || {}, {
|
|
243
|
+
optimizeDeps: {
|
|
244
|
+
include: [
|
|
245
|
+
"@vue/devtools-core",
|
|
246
|
+
"@vue/devtools-kit",
|
|
247
|
+
"@nuxt/ui/locale",
|
|
248
|
+
"@uplora/formats",
|
|
249
|
+
"@uplora/serializer",
|
|
250
|
+
"object-to-formdata",
|
|
251
|
+
"zod",
|
|
252
|
+
"zod/locales"
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
});
|
|
242
256
|
}
|
|
243
257
|
|
|
244
258
|
function prepareServerRoutes({ resolve }) {
|
|
@@ -426,7 +440,37 @@ function getAppTemplates({ options }) {
|
|
|
426
440
|
templates.push({
|
|
427
441
|
filename: "cms.css",
|
|
428
442
|
write: true,
|
|
429
|
-
getContents: () => `@source "./cms"
|
|
443
|
+
getContents: () => `@source "./cms";
|
|
444
|
+
|
|
445
|
+
@layer components {
|
|
446
|
+
.unvois {
|
|
447
|
+
--vis-crosshair-line-stroke-color: var(--ui-bg-elevated);
|
|
448
|
+
--vis-crosshair-circle-stroke-color: transparent;
|
|
449
|
+
|
|
450
|
+
--vis-axis-grid-color: var(--ui-border);
|
|
451
|
+
--vis-axis-tick-color: var(--ui-border);
|
|
452
|
+
--vis-axis-tick-label-color: var(--ui-text-dimmed);
|
|
453
|
+
|
|
454
|
+
--vis-tooltip-background-color: var(--ui-bg);
|
|
455
|
+
--vis-tooltip-border-color: var(--ui-border);
|
|
456
|
+
--vis-tooltip-text-color: var(--ui-text-highlighted);
|
|
457
|
+
|
|
458
|
+
--vis-color0: var(--ui-primary);
|
|
459
|
+
--vis-color1: var(--ui-secondary);
|
|
460
|
+
--vis-color2: var(--ui-info);
|
|
461
|
+
--vis-color3: var(--ui-warning);
|
|
462
|
+
--vis-color4: var(--ui-error);
|
|
463
|
+
--vis-color5: var(--ui-success);
|
|
464
|
+
|
|
465
|
+
--vis-dark-color0: var(--ui-primary);
|
|
466
|
+
--vis-dark-color1: var(--ui-secondary);
|
|
467
|
+
--vis-dark-color2: var(--ui-info);
|
|
468
|
+
--vis-dark-color3: var(--ui-warning);
|
|
469
|
+
--vis-dark-color4: var(--ui-error);
|
|
470
|
+
--vis-dark-color5: var(--ui-success);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
`
|
|
430
474
|
});
|
|
431
475
|
templates.push({
|
|
432
476
|
filename: "cms/index.ts",
|
|
@@ -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
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hywax/cms",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.9.0",
|
|
5
5
|
"description": "Hywax CMS. ⚠️ This package is intended for internal use only.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -63,6 +63,8 @@
|
|
|
63
63
|
"@nuxtjs/mdc": "^0.19.2",
|
|
64
64
|
"@nuxtjs/seo": "^3.3.0",
|
|
65
65
|
"@sindresorhus/slugify": "^3.0.0",
|
|
66
|
+
"@unovis/ts": "^1.6.2",
|
|
67
|
+
"@unovis/vue": "^1.6.2",
|
|
66
68
|
"@uplora/formats": "^0.1.0",
|
|
67
69
|
"@uplora/serializer": "^0.1.3",
|
|
68
70
|
"@vueuse/nuxt": "^14.1.0",
|