@topvisor/ui 0.9.5 → 0.9.7
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/.chunks/datepicker-0tFN0clU.amd.js +234 -0
- package/.chunks/datepicker-0tFN0clU.amd.js.map +1 -0
- package/.chunks/datepicker-8geHBNBn.es.js +275 -0
- package/.chunks/datepicker-8geHBNBn.es.js.map +1 -0
- package/.chunks/{forms-9516aa6c.es.js → forms-dneLtREE.es.js} +16 -15
- package/.chunks/forms-dneLtREE.es.js.map +1 -0
- package/.chunks/forms-hIalWiGK.amd.js +3 -0
- package/.chunks/forms-hIalWiGK.amd.js.map +1 -0
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-bLJ0dcPn.amd.js +2 -0
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-bLJ0dcPn.amd.js.map +1 -0
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-qWOlkuQ3.es.js +148 -0
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-qWOlkuQ3.es.js.map +1 -0
- package/.chunks/{popup-d96418da.amd.js → popup-2azH2gGP.amd.js} +378 -378
- package/.chunks/popup-2azH2gGP.amd.js.map +1 -0
- package/.chunks/{popup-70a8c892.es.js → popup-GFcVEZf5.es.js} +423 -423
- package/.chunks/popup-GFcVEZf5.es.js.map +1 -0
- package/README.md +80 -80
- package/assets/core.css +1 -1
- package/assets/forms.css +1 -1
- package/assets/light.css +1 -1
- package/core/core.amd.js +1 -1
- package/core/core.js +1 -1
- package/forms/forms.amd.js +1 -1
- package/forms/forms.js +1 -1
- package/forms/helpers.amd.js +1 -1
- package/forms/helpers.amd.js.map +1 -1
- package/forms/helpers.js +2 -2
- package/forms/helpers.js.map +1 -1
- package/formsExt/formsExt.amd.js +1 -1
- package/formsExt/formsExt.amd.js.map +1 -1
- package/formsExt/formsExt.js +1 -1
- package/formsExt/formsExt.js.map +1 -1
- package/icomoon/demo-files/demo.css +161 -161
- package/icomoon/demo-files/demo.js +30 -30
- package/icomoon/demo.html +2945 -2945
- package/icomoon/fonts/Topvisor-2.svg +232 -232
- package/icomoon/style.css +647 -647
- package/package.json +19 -22
- package/popup/popup.amd.js +1 -1
- package/popup/popup.amd.js.map +1 -1
- package/popup/popup.js +7 -146
- package/popup/popup.js.map +1 -1
- package/popup/worker.amd.js +1 -1
- package/popup/worker.amd.js.map +1 -1
- package/popup/worker.js +2 -2
- package/popup/worker.js.map +1 -1
- package/require/css.amd.js +11 -11
- package/src/components/forms/avatar/avatar.stories.d.ts +1 -1
- package/src/components/forms/avatar/avatar.vue.d.ts +1 -1
- package/src/components/forms/button/button.d.ts +2 -2
- package/src/components/forms/button/button.stories.d.ts +6 -1
- package/src/components/forms/button/button.vue.d.ts +2 -1
- package/src/components/forms/checkbox/checkbox.vue.d.ts +1 -1
- package/src/components/forms/controlLabel/controlLabel.vue.d.ts +1 -1
- package/src/components/forms/helpers.d.ts +1 -1
- package/src/components/forms/hint/hint.stories.d.ts +2 -2
- package/src/components/forms/hint/hint.vue.d.ts +1 -1
- package/src/components/forms/input/input.d.ts +2 -2
- package/src/components/forms/input/input.vue.d.ts +1 -1
- package/src/components/forms/inputDate/inputDate.d.ts +2 -2
- package/src/components/forms/inputDate/inputDate.stories.d.ts +1 -1
- package/src/components/forms/inputDate/inputDate.vue.d.ts +1 -1
- package/src/components/forms/inputRange/inputRange.vue.d.ts +1 -1
- package/src/components/forms/radio/radio.vue.d.ts +1 -1
- package/src/components/forms/select/select.d.ts +2 -2
- package/src/components/forms/select/select.stories.d.ts +1 -1
- package/src/components/forms/select/select.vue.d.ts +1 -1
- package/src/components/forms/switcher/switcher.vue.d.ts +1 -1
- package/src/components/forms/textarea/textarea.stories.d.ts +1 -1
- package/src/components/forms/textarea/textarea.vue.d.ts +1 -1
- package/src/components/formsExt/editArea/editArea.d.ts +1 -1
- package/src/components/formsExt/editArea/editArea.stories.d.ts +1 -1
- package/src/components/formsExt/editArea/editArea.vue.d.ts +1 -1
- package/src/components/formsExt/editInput/editInput.d.ts +2 -2
- package/src/components/formsExt/editInput/editInput.vue.d.ts +1 -1
- package/src/components/formsExt/radioGroup/radioGroup.d.ts +2 -2
- package/src/components/formsExt/radioGroup/radioGroup.stories.d.ts +1 -1
- package/src/components/formsExt/radioGroup/radioGroup.vue.d.ts +1 -1
- package/src/components/popup/popup/listItem.vue.d.ts +1 -1
- package/src/components/popup/popup/opener.vue.d.ts +1 -1
- package/src/components/popup/popup/popup.stories.d.ts +1 -0
- package/src/components/popup/popup/popup.vue.d.ts +1 -1
- package/src/components/tabs/tabs/content.vue.d.ts +1 -1
- package/src/components/tabs/tabs/tab.vue.d.ts +1 -1
- package/src/components/tabs/tabs/tabs.stories.d.ts +3 -2
- package/src/components/tabs/tabs/tabs.vue.d.ts +1 -1
- package/src/components/tabsView/tabsView/content.vue.d.ts +1 -1
- package/src/components/tabsView/tabsView/menu.vue.d.ts +1 -1
- package/src/components/tabsView/tabsView/menuDelimeter.vue.d.ts +1 -1
- package/src/components/tabsView/tabsView/menuItem.vue.d.ts +1 -1
- package/src/components/tabsView/tabsView/menuTitle.vue.d.ts +1 -1
- package/src/components/tabsView/tabsView/tabsView.d.ts +1 -1
- package/src/components/tabsView/tabsView/tabsView.vue.d.ts +1 -1
- package/src/core/core/core.d.ts +1 -1
- package/tabs/tabs.amd.js +1 -1
- package/tabs/tabs.js +1 -1
- package/tabsView/tabsView.amd.js +1 -1
- package/tabsView/tabsView.amd.js.map +1 -1
- package/tabsView/tabsView.js +27 -27
- package/tabsView/tabsView.js.map +1 -1
- package/utils/css.amd.js.map +1 -1
- package/utils/css.js.map +1 -1
- package/utils/date.amd.js +1 -1
- package/utils/date.js +1 -1
- package/utils/device.amd.js +1 -1
- package/utils/device.js +1 -1
- package/utils/dom.amd.js.map +1 -1
- package/utils/dom.js.map +1 -1
- package/.chunks/datepicker-78c2af5a.es.js +0 -275
- package/.chunks/datepicker-78c2af5a.es.js.map +0 -1
- package/.chunks/datepicker-cc0011e1.amd.js +0 -234
- package/.chunks/datepicker-cc0011e1.amd.js.map +0 -1
- package/.chunks/forms-9516aa6c.es.js.map +0 -1
- package/.chunks/forms-9972aba2.amd.js +0 -3
- package/.chunks/forms-9972aba2.amd.js.map +0 -1
- package/.chunks/popup-70a8c892.es.js.map +0 -1
- package/.chunks/popup-d96418da.amd.js.map +0 -1
- /package/assets/{popup.css → listItem.css} +0 -0
|
@@ -52,7 +52,7 @@ declare const meta: {
|
|
|
52
52
|
};
|
|
53
53
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
54
54
|
"update:modelValue": (value: string) => void;
|
|
55
|
-
}, string, import("vue").
|
|
55
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
56
56
|
icon: {
|
|
57
57
|
type: import("vue").PropType<string>;
|
|
58
58
|
};
|
|
@@ -3,7 +3,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
3
3
|
icon2: string;
|
|
4
4
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
5
|
"update:modelValue": (value: string) => void;
|
|
6
|
-
}, string, import("vue").
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
7
7
|
icon2: string;
|
|
8
8
|
}>>> & {
|
|
9
9
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, {
|
|
2
2
|
from?(_: {}): any;
|
|
3
3
|
to?(_: {}): any;
|
|
4
4
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Props } from './radio';
|
|
2
2
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
3
|
"update:modelValue": (value: string | object) => void;
|
|
4
|
-
}, string, import("vue").
|
|
4
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & {
|
|
5
5
|
"onUpdate:modelValue"?: ((value: string | object) => any) | undefined;
|
|
6
6
|
}, {}, {}>, {
|
|
7
7
|
default?(_: {}): any;
|
|
@@ -34,7 +34,7 @@ declare const meta: {
|
|
|
34
34
|
};
|
|
35
35
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
36
36
|
"update:modelValue": (value: string) => void;
|
|
37
|
-
}, string, import("vue").
|
|
37
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
38
38
|
icon: {
|
|
39
39
|
type: import("vue").PropType<string>;
|
|
40
40
|
};
|
|
@@ -3,7 +3,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
3
3
|
size: string;
|
|
4
4
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
5
|
"update:modelValue": (value: string) => void;
|
|
6
|
-
}, string, import("vue").
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
7
7
|
size: string;
|
|
8
8
|
}>>> & {
|
|
9
9
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Props } from './switcher';
|
|
2
2
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
3
|
"update:modelValue": (value: boolean | string[] | Set<string>) => void;
|
|
4
|
-
}, string, import("vue").
|
|
4
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & {
|
|
5
5
|
"onUpdate:modelValue"?: ((value: boolean | string[] | Set<string>) => any) | undefined;
|
|
6
6
|
}, {}, {}>, {
|
|
7
7
|
default?(_: {}): any;
|
|
@@ -36,7 +36,7 @@ declare const meta: {
|
|
|
36
36
|
};
|
|
37
37
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
38
38
|
"update:modelValue": (value?: string | undefined) => void;
|
|
39
|
-
}, string, import("vue").
|
|
39
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
40
40
|
name: {
|
|
41
41
|
type: import("vue").PropType<string>;
|
|
42
42
|
};
|
|
@@ -4,7 +4,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
4
4
|
minHeight: number;
|
|
5
5
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
6
|
"update:modelValue": (value?: string | undefined) => void;
|
|
7
|
-
}, string, import("vue").
|
|
7
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
8
8
|
rows: number;
|
|
9
9
|
minHeight: number;
|
|
10
10
|
}>>> & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Props as TextareaProps } from '
|
|
1
|
+
import type { Props as TextareaProps } from '../../forms/textarea/textarea';
|
|
2
2
|
export interface Props extends TextareaProps {
|
|
3
3
|
/**
|
|
4
4
|
* Поддерживает modelValue и **все другие** props компонента Textarea
|
|
@@ -50,7 +50,7 @@ declare const meta: {
|
|
|
50
50
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
51
51
|
"update:modelValue": (value: string) => void;
|
|
52
52
|
cancel: () => void;
|
|
53
|
-
}, string, import("vue").
|
|
53
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
54
54
|
title: {
|
|
55
55
|
type: import("vue").PropType<string>;
|
|
56
56
|
};
|
|
@@ -6,7 +6,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
6
6
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
7
|
"update:modelValue": (value: string) => void;
|
|
8
8
|
cancel: () => void;
|
|
9
|
-
}, string, import("vue").
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
10
10
|
cancelText: string;
|
|
11
11
|
submitText: string;
|
|
12
12
|
expandable: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Props as InputProps } from '
|
|
2
|
-
import type { Props as ButtonProps } from '
|
|
1
|
+
import type { Props as InputProps } from '../../forms/input/input';
|
|
2
|
+
import type { Props as ButtonProps } from '../../forms/button/button';
|
|
3
3
|
export interface Props {
|
|
4
4
|
modelValue: string;
|
|
5
5
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Props } from './editInput';
|
|
2
2
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
3
|
"update:modelValue": (value: string) => void;
|
|
4
|
-
}, string, import("vue").
|
|
4
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & {
|
|
5
5
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
6
6
|
}, {}, {}>, {
|
|
7
7
|
default?(_: {}): any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Size } from '
|
|
2
|
-
import { sizes } from '
|
|
1
|
+
import type { Size } from '../../forms/helpers';
|
|
2
|
+
import { sizes } from '../../forms/helpers';
|
|
3
3
|
export interface Props {
|
|
4
4
|
modelValue: string;
|
|
5
5
|
/**
|
|
@@ -21,7 +21,7 @@ declare const meta: {
|
|
|
21
21
|
};
|
|
22
22
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
23
|
"update:modelValue": (value: string) => void;
|
|
24
|
-
}, string, import("vue").
|
|
24
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
25
25
|
size: {
|
|
26
26
|
type: import("vue").PropType<import("../../forms/helpers").Size>;
|
|
27
27
|
default: string;
|
|
@@ -3,7 +3,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
3
3
|
size: string;
|
|
4
4
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
5
|
"update:modelValue": (value: string) => void;
|
|
6
|
-
}, string, import("vue").
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
7
7
|
size: string;
|
|
8
8
|
}>>> & {
|
|
9
9
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
@@ -2,7 +2,7 @@ import type { ListItemProps } from './popup';
|
|
|
2
2
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ListItemProps>, {
|
|
3
3
|
type: string;
|
|
4
4
|
closeByClick: boolean;
|
|
5
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
5
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ListItemProps>, {
|
|
6
6
|
type: string;
|
|
7
7
|
closeByClick: boolean;
|
|
8
8
|
}>>>, {
|
|
@@ -3,7 +3,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
3
3
|
pos: string;
|
|
4
4
|
notch: boolean;
|
|
5
5
|
posBy: string;
|
|
6
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
6
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<OpenerProps>, {
|
|
7
7
|
pos: string;
|
|
8
8
|
notch: boolean;
|
|
9
9
|
posBy: string;
|
|
@@ -551,6 +551,7 @@ export declare const Playground: {
|
|
|
551
551
|
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
552
552
|
$slots: {
|
|
553
553
|
default?(_: {}): any;
|
|
554
|
+
html?(_: {}): any;
|
|
554
555
|
};
|
|
555
556
|
});
|
|
556
557
|
};
|
|
@@ -7,7 +7,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
7
7
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
8
|
open: () => void;
|
|
9
9
|
close: () => void;
|
|
10
|
-
}, string, import("vue").
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
11
11
|
id: string;
|
|
12
12
|
pos: string;
|
|
13
13
|
notch: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropsContent } from './tabs';
|
|
2
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<PropsContent>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<PropsContent>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<PropsContent>>>, {}, {}>, {
|
|
3
3
|
default?(_: {}): any;
|
|
4
4
|
}>;
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropsTab } from './tabs';
|
|
2
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<PropsTab>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<PropsTab>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<PropsTab>>>, {}, {}>, {
|
|
3
3
|
default?(_: {}): any;
|
|
4
4
|
}>;
|
|
5
5
|
export default _default;
|
|
@@ -451,6 +451,7 @@ export declare const Overview: {
|
|
|
451
451
|
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
452
452
|
$slots: {
|
|
453
453
|
default?(_: {}): any;
|
|
454
|
+
html?(_: {}): any;
|
|
454
455
|
};
|
|
455
456
|
});
|
|
456
457
|
Textarea: import("vue").DefineComponent<{
|
|
@@ -489,7 +490,7 @@ export declare const Overview: {
|
|
|
489
490
|
};
|
|
490
491
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
491
492
|
"update:modelValue": (value?: string | undefined) => void;
|
|
492
|
-
}, string, import("vue").
|
|
493
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
493
494
|
name: {
|
|
494
495
|
type: import("vue").PropType<string>;
|
|
495
496
|
};
|
|
@@ -534,7 +535,7 @@ export declare const Overview: {
|
|
|
534
535
|
type: import("vue").PropType<string>;
|
|
535
536
|
required: true;
|
|
536
537
|
};
|
|
537
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
538
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
538
539
|
hint: {
|
|
539
540
|
type: import("vue").PropType<string>;
|
|
540
541
|
required: true;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Props } from './tabs';
|
|
2
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>, {
|
|
3
3
|
buttons?(_: {}): any;
|
|
4
4
|
header?(_: {}): any;
|
|
5
5
|
contents?(_: {}): any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropsContent } from './tabsView';
|
|
2
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<PropsContent>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<PropsContent>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<PropsContent>>>, {}, {}>, {
|
|
3
3
|
default?(_: {}): any;
|
|
4
4
|
}>;
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropsMenu } from './tabsView';
|
|
2
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<PropsMenu>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<PropsMenu>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<PropsMenu>>>, {}, {}>, {
|
|
3
3
|
default?(_: {}): any;
|
|
4
4
|
}>;
|
|
5
5
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
2
2
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropsMenuItem } from './tabsView';
|
|
2
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<PropsMenuItem>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<PropsMenuItem>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<PropsMenuItem>>>, {}, {}>, {
|
|
3
3
|
default?(_: {}): any;
|
|
4
4
|
}>;
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropsMenuTitle } from './tabsView';
|
|
2
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<PropsMenuTitle>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<PropsMenuTitle>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<PropsMenuTitle>>>, {}, {}>, {
|
|
3
3
|
default?(_: {}): any;
|
|
4
4
|
}>;
|
|
5
5
|
export default _default;
|
|
@@ -3,7 +3,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
3
3
|
isShortable: boolean;
|
|
4
4
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
5
|
"update:modelValue": (value: string) => void;
|
|
6
|
-
}, string, import("vue").
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
7
7
|
isShortable: boolean;
|
|
8
8
|
}>>> & {
|
|
9
9
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
package/src/core/core/core.d.ts
CHANGED
package/tabs/tabs.amd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
define(["require","exports","vue","../.chunks/forms-
|
|
1
|
+
define(["require","exports","vue","../.chunks/forms-hIalWiGK.amd","../require/css.amd!../assets/tabs.css"],function(k,s,e,o){"use strict";if(typeof e>"u")var e=window.Vue;const l={class:e.normalizeClass({"top-tabs":!0})},d={key:0,class:"top-tabs_header"},c={class:"top-tabs_contents"},r=e.defineComponent({__name:"tabs",props:{id:{}},setup(a){return(t,n)=>(e.openBlock(),e.createElementBlock("div",l,[e.renderSlot(t.$slots,"buttons"),t.$slots.header?(e.openBlock(),e.createElementBlock("div",d,[e.renderSlot(t.$slots,"header")])):e.createCommentVNode("",!0),e.createElementVNode("div",c,[e.renderSlot(t.$slots,"contents")])]))}}),b={$style:{"top-tabs":"top-tabs","top-tabs_header":"top-tabs_header","top-tabs_contents":"top-tabs_contents","top-tabs_tabInput":"top-tabs_tabInput","top-tabs_content":"top-tabs_content"}},p=o._export_sfc(r,[["__cssModules",b]]),_=["id","name","value","checked","disabled"],i=["for"],u=e.defineComponent({__name:"tab",props:{tabsId:{},name:{},title:{},active:{type:Boolean},disabled:{type:Boolean}},setup(a){return(t,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("input",{type:"radio",class:"top-tabs_tabInput top-unvisible",id:t.tabsId+t.name,name:t.tabsId,value:t.name,checked:t.active,disabled:t.disabled},null,8,_),e.createElementVNode("label",{class:e.normalizeClass({"top-tabs_tabLabel":!0,"top-forms-focusable":!0,"top-disabled":t.disabled}),for:t.tabsId+t.name},[e.renderSlot(t.$slots,"default")],10,i)],64))}}),m={$style:{"top-tabs_tabLabel":"top-tabs_tabLabel","top-tabs_tabInput":"top-tabs_tabInput","top-disabled":"top-disabled"}},f=o._export_sfc(u,[["__cssModules",m]]),$=["data-tabs-name"],h=e.defineComponent({__name:"content",props:{name:{}},setup(a){return(t,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({"top-tabs_content":!0}),"data-tabs-name":t.name},[e.renderSlot(t.$slots,"default")],8,$))}}),y={$style:{"top-tabs_content":"top-tabs_content"}},v=o._export_sfc(h,[["__cssModules",y]]);s.Tabs=p,s.TabsContent=v,s.TabsTab=f,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
|
|
2
2
|
//# sourceMappingURL=tabs.amd.js.map
|
package/tabs/tabs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { insertToPage as c } from "../utils/css.js";
|
|
2
2
|
import { defineComponent as b, openBlock as a, createElementBlock as o, renderSlot as s, createCommentVNode as _, createElementVNode as n, normalizeClass as l, Fragment as i } from "vue";
|
|
3
|
-
import { _ as p } from "../.chunks/forms-
|
|
3
|
+
import { _ as p } from "../.chunks/forms-dneLtREE.es.js";
|
|
4
4
|
const r = ["../assets/tabs.css"].map((e) => import.meta.resolve(e));
|
|
5
5
|
await c(r);
|
|
6
6
|
const u = {
|
package/tabsView/tabsView.amd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
define(["require","exports","vue","
|
|
1
|
+
define(["require","exports","vue","../.chunks/listItem.vue_vue_type_script_setup_true_lang-bLJ0dcPn.amd","../.chunks/forms-hIalWiGK.amd","../popup/worker.amd","../utils/dom.amd","../require/css.amd!../assets/tabsView.css"],function(Y,u,e,d,c,Z,x){"use strict";if(typeof e>"u")var e=window.Vue;const S=(o,t)=>(e.provide(o,t),t),y=o=>{const t=e.inject(o);if(!t)throw Error("Попытка использовать tabsView state до его инициализации");return t},w=(o,t)=>`top:tabsView:${String(o)}:${t}`,p={init:S,use:y,loadLocalStorge:(o,t)=>{if(!t.key)return;const n=w(o,t.key);try{const s=JSON.parse(localStorage.getItem(n));typeof s==typeof t[o]&&(t[o]=s)}catch{console.warn(new Error(`В localStorage[${n}] не корректный json`))}},addSaverLocalStorge:(o,t)=>{if(!t.key)return;const n=w(o,t.key);e.watch(e.toRef(t,o),()=>{localStorage.setItem(n,JSON.stringify(t[o]))},{immediate:!0})}},f=Symbol(),k=(o,t)=>{const n=e.reactive({key:o.keyForSaveState,showMenuInPopup:o.showMenuInPopup,isShort:!1,activeItemName:e.computed({get(){return o.modelValue},set(s){t("update:modelValue",s)}})});return v(o,n),p.init(f,n)},m=()=>p.use(f),v=(o,t)=>{if(o.isShortable){const n="isShort";p.loadLocalStorge(n,t),p.addSaverLocalStorge(n,t)}},$={key:1,class:"top-ellipsis"},I=e.defineComponent({__name:"menuItem",props:{name:{},href:{},icon:{},disabled:{type:Boolean}},setup(o){const t=o,n=e.computed(()=>s.showMenuInPopup?d._sfc_main$2:t.href?"a":"button"),s=m();return(a,l)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value),{class:e.normalizeClass({"top-tabsView_menuItem":!e.unref(s).showMenuInPopup,"top-active":a.name&&e.unref(s).activeItemName===a.name,"top-disabled":a.disabled}),href:a.href,"data-top-icon":a.icon||void 0,disabled:a.disabled||void 0,onClick:l[0]||(l[0]=i=>a.name?e.unref(s).activeItemName=a.name:null)},{default:e.withCtx(()=>[e.unref(s).showMenuInPopup?e.renderSlot(a.$slots,"default",{key:0}):a.$slots.default&&!e.unref(s).isShort?(e.openBlock(),e.createElementBlock("span",$,[e.renderSlot(a.$slots,"default")])):e.createCommentVNode("",!0)]),_:3},8,["class","href","data-top-icon","disabled"]))}}),M={$style:{"top-tabsView_menuItem":"top-tabsView_menuItem","top-active":"top-active","top-forms-option":"top-forms-option","top-formsCaption":"top-formsCaption","top-disabled":"top-disabled"}},_=c._export_sfc(I,[["__cssModules",M]]),B={class:"top-tabsView_menuOpener"},g=["data-top-icon"],P={class:"top-ellipsis"},C=e.createElementVNode("div",{class:"top-tabsView_menuOpenerIcon","data-top-icon":""},null,-1),N={class:"top-tabsView_menuList"},E={class:"top-tabsView_menuFooter"},T=e.defineComponent({__name:"menu",props:{isShortable:{type:Boolean}},setup(o){const t=m(),n=e.useSlots(),s=new Map,a=e.computed(()=>{let i=s.get(t.activeItemName);return i||(l(),s.get(t.activeItemName)||null)}),l=()=>{if(!n.default)return;const i=n.default().find(r=>r.key==="_menu");i&&i.children.forEach(r=>{var V,h;if(r.type.__name!==_.__name||!r.props.name)return;const b={title:((h=(V=r.children).default)==null?void 0:h.call(V)[0].children).trim(),icon:r.props.icon};s.set(r.props.name,b)})};return(i,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({"top-tabsView_menu":!0,"top-tabsView_menu-inPopup_0":!e.unref(t).showMenuInPopup,"top-tabsView_menu-inPopup_1":e.unref(t).showMenuInPopup,"top-tabsView_menu-short":e.unref(t).isShort&&!e.unref(t).showMenuInPopup})},[e.unref(t).showMenuInPopup?(e.openBlock(),e.createBlock(e.unref(d._sfc_main),{key:0},{opener:e.withCtx(()=>[e.createElementVNode("div",B,[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"top-tabsView_menuOpenerActiveItem","data-top-icon":a.value.icon},[e.createElementVNode("span",P,e.toDisplayString(a.value.title),1)],8,g)):e.createCommentVNode("",!0),C])]),contentList:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",N,[e.renderSlot(i.$slots,"default")]),e.createElementVNode("div",E,[i.isShortable?(e.openBlock(),e.createBlock(_,{key:0,icon:e.unref(t).isShort?"":"",onClick:r[0]||(r[0]=b=>e.unref(t).isShort=!e.unref(t).isShort)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t).isShort?"":"Свернуть"),1)]),_:1},8,["icon"])):e.createCommentVNode("",!0)])],64))],2))}}),O={$style:{"top-tabsView_menu-inPopup_0":"top-tabsView_menu-inPopup_0","top-tabsView_menu-inPopup_1":"top-tabsView_menu-inPopup_1","top-tabsView_menu-short":"top-tabsView_menu-short","top-tabsView_menu":"top-tabsView_menu","top-tabsView_menuOpener":"top-tabsView_menuOpener","top-tabsView_menuOpenerIcon":"top-tabsView_menuOpenerIcon","top-tabsView_menuOpenerActiveItem":"top-tabsView_menuOpenerActiveItem","top-tabsView_menuList":"top-tabsView_menuList","top-tabsView_menuFooter":"top-tabsView_menuFooter","top-tabsView_menuItem":"top-tabsView_menuItem"}},L=c._export_sfc(T,[["__cssModules",O]]),D={class:"top-tabsView_contents"},F=e.defineComponent({__name:"tabsView",props:{modelValue:{},showMenuInPopup:{type:Boolean},isShortable:{type:Boolean,default:!1},keyForSaveState:{}},emits:["update:modelValue"],setup(o,{emit:t}){const n=o,a=k(n,t);return e.watchEffect(()=>{a.showMenuInPopup=n.showMenuInPopup??c.Core.state.isMobile}),(l,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({"top-tabsView":!0,"top-tabsView-inPopup":e.unref(a).showMenuInPopup})},[e.createVNode(L,{isShortable:l.isShortable},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"menu")]),_:3},8,["isShortable"]),e.createElementVNode("div",D,[e.renderSlot(l.$slots,"contents")])],2))}}),j={$style:{"top-tabsView":"top-tabsView","top-tabsView-inPopup":"top-tabsView-inPopup","top-tabsView_contents":"top-tabsView_contents"}},z=c._export_sfc(F,[["__cssModules",j]]),K={"top-tabsView_menuDelimeter":"top-tabsView_menuDelimeter"},q={},A={class:"top-tabsView_menuDelimeter"};function J(o,t){return e.openBlock(),e.createElementBlock("div",A)}const R={$style:K},G=c._export_sfc(q,[["render",J],["__cssModules",R]]),H=e.defineComponent({__name:"menuTitle",props:{isSubtitle:{type:Boolean}},setup(o){const t=m();return(n,s)=>e.unref(t).showMenuInPopup?(e.openBlock(),e.createBlock(e.unref(d._sfc_main$2),{key:0,type:"title"},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3})):e.unref(t).isShort?(e.openBlock(),e.createBlock(G,{key:1})):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass({"top-tabsView_menuTitle":!0,"top-tabsView_menuTitle-subtitle":n.isSubtitle})},[e.renderSlot(n.$slots,"default")],2))}}),Q={$style:{"top-tabsView_menuTitle":"top-tabsView_menuTitle","top-tabsView_menuTitle-subtitle":"top-tabsView_menuTitle-subtitle"}},U=c._export_sfc(H,[["__cssModules",Q]]),W={key:0,class:"top-tabsView_content"},X=e.defineComponent({__name:"content",props:{name:{}},setup(o){const t=m();return(n,s)=>e.unref(t).activeItemName===n.name?(e.openBlock(),e.createElementBlock("div",W,[e.renderSlot(n.$slots,"default")])):e.createCommentVNode("",!0)}});u.TabsView=z,u.TabsViewContent=X,u.TabsViewMenuItem=_,u.TabsViewMenuTitle=U,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
|
2
2
|
//# sourceMappingURL=tabsView.amd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabsView.amd.js","sources":["../../src/components/stateManager.ts","../../src/components/tabsView/tabsView/state.ts","../../src/components/tabsView/tabsView/menuItem.vue","../../src/components/tabsView/tabsView/menu.vue","../../src/components/tabsView/tabsView/tabsView.vue","../../src/components/tabsView/tabsView/menuDelimeter.vue","../../src/components/tabsView/tabsView/menuTitle.vue","../../src/components/tabsView/tabsView/content.vue"],"sourcesContent":["import { provide, inject, toRef, watch } from 'vue';\r\nimport type { InjectionKey } from 'vue';\r\nimport { injectionKey } from '@/components/tabsView/tabsView/state';\r\n\r\n/**\r\n * State - интерфейс с общими параметрами для состояния компоента\r\n */\r\nexport interface State {\r\n\t/**\r\n\t * Ключ для сохранения состояния\r\n\t *\r\n\t * Может быть одинаковый для разных компонентов\r\n\t *\r\n\t * Не может быть реактивным\r\n\t *\r\n\t * Состояния сохраняются в localStorage с префиксом top\r\n\t */\r\n\tkey?: string;\r\n}\r\n\r\n/**\r\n * Инициировать State компонента\r\n * @param key - InjectionKey для provide / inject в области компонента\r\n * @param state\r\n * @return - State компонента\r\n */\r\nconst init = <T>(injectionKey: InjectionKey<T>, state: T): T => {\r\n\tprovide(injectionKey, state);\r\n\r\n\treturn state;\r\n};\r\n\r\n/**\r\n * Получить State компонента\r\n * @param key - InjectionKey для provide / inject в области компонента\r\n * @return - State компонента\r\n */\r\nconst use = <T>(injectionKey: InjectionKey<T>): T => {\r\n\tconst state = inject(injectionKey);\r\n\r\n\tif (!state) {\r\n\t\tthrow Error('Попытка использовать tabsView state до его инициализации');\r\n\t}\r\n\r\n\treturn state;\r\n};\r\n\r\n/**\r\n * Сгенерировать имя для сохранения данных в localStorage\r\n * @param stateName - имя свойства состояния\r\n * @param stateKey - ключ состояния, разные компоненты могут использовать одинаковый ключ\r\n */\r\nconst genStorageKey = <T extends State>(stateName: keyof T, stateKey: string): string => {\r\n\tconst stateNameString = String(stateName);\r\n\r\n\treturn `top:tabsView:${stateNameString}:${stateKey}`;\r\n};\r\n\r\n/**\r\n * Загрузить состояние\r\n * @param stateName - имя свойства состояния\r\n * @param state\r\n */\r\nconst loadLocalStorge = <T extends State>(stateName: keyof T, state: T) => {\r\n\t// если state.key не знадан, значит сохранение состояния в компоненте отключено\r\n\tif (!state.key) return;\r\n\r\n\tconst localStorageKey = genStorageKey(stateName, state.key);\r\n\r\n\ttry {\r\n\t\tconst localStorageValue: typeof state[keyof typeof state] = JSON.parse(localStorage.getItem(localStorageKey) as string);\r\n\r\n\t\tif (typeof localStorageValue === typeof state[stateName]) {\r\n\t\t\tstate[stateName] = localStorageValue;\r\n\t\t}\r\n\t} catch (e) {\r\n\t\tconsole.warn(new Error(`В localStorage[${localStorageKey}] не корректный json`));\r\n\t}\r\n};\r\n\r\n/**\r\n * Добавить автосохранение состояние при его изменении\r\n * @param stateName - имя свойства состояния\r\n * @param state\r\n */\r\nconst addSaverLocalStorge = <T extends State>(stateName: keyof T, state: T) => {\r\n\t// если state.key не знадан, значит сохранение состояния в компоненте отключено\r\n\tif (!state.key) return;\r\n\r\n\tconst localStorageKey = genStorageKey(stateName, state.key);\r\n\r\n\twatch(toRef(state, stateName), () => {\r\n\t\tlocalStorage.setItem(localStorageKey, JSON.stringify(state[stateName]));\r\n\t}, { immediate: true });\r\n};\r\n\r\nexport default {\r\n\tinit,\r\n\tuse,\r\n\tloadLocalStorge,\r\n\taddSaverLocalStorge,\r\n};","import { reactive, computed } from 'vue';\r\nimport type { InjectionKey } from 'vue';\r\nimport type { State } from './tabsView';\r\nimport type { Emits, Props } from './tabsView';\r\nimport stateManager from '@/components/stateManager';\r\n\r\nexport const injectionKey = Symbol() as InjectionKey<State>;\r\n\r\n/**\r\n * Инициировать State компонента\r\n * @param props\r\n * @param emit\r\n */\r\nexport const initState = (props: Props, emit: Emits): State => {\r\n\tconst state: State = reactive({\r\n\t\tkey: props.keyForSaveState,\r\n\t\tshowMenuInPopup: props.showMenuInPopup,\r\n\t\tisShort: false,\r\n\t\tactiveItemName: computed({\r\n\t\t\tget() {\r\n\t\t\t\treturn props.modelValue;\r\n\t\t\t},\r\n\t\t\tset(value) {\r\n\t\t\t\temit('update:modelValue', value);\r\n\t\t\t},\r\n\t\t}),\r\n\t});\r\n\r\n\tinitLocalStorge(props, state);\r\n\r\n\treturn stateManager.init(injectionKey, state);\r\n};\r\n\r\n/**\r\n * Получить State компонента\r\n */\r\nexport const useState = () => {\r\n\treturn stateManager.use(injectionKey);\r\n};\r\n\r\n/**\r\n * Инициировать работу LocalStorge\r\n * @param props\r\n * @param state\r\n */\r\nconst initLocalStorge = (props: Props, state: State): void => {\r\n\tif (props.isShortable) {\r\n\t\tconst stateName = 'isShort';\r\n\r\n\t\tstateManager.loadLocalStorge(stateName, state);\r\n\t\tstateManager.addSaverLocalStorge(stateName, state);\r\n\t}\r\n};","<script setup lang=\"ts\">\r\nimport { computed } from 'vue';\r\nimport { useState } from './state';\r\nimport type { PropsMenuItem, State } from './tabsView';\r\nimport { PopupListItem } from '../../popup/popup';\r\n\r\nconst props = defineProps<PropsMenuItem>();\r\n\r\nconst componentName = computed(() => {\r\n\tif (state.showMenuInPopup) {\r\n\t\treturn PopupListItem;\r\n\t}\r\n\r\n\treturn props.href ? 'a' : 'button';\r\n});\r\n\r\nconst state = useState();\r\n</script>\r\n\r\n<template>\r\n\t<component\r\n\t\t:is=\"componentName\"\r\n\t\t:class=\"{\r\n\t\t\t['top-tabsView_menuItem']: !state.showMenuInPopup,\r\n\t\t\t['top-active']: name && state.activeItemName === name,\r\n\t\t\t['top-disabled']: disabled,\r\n\t\t}\"\r\n\t\t:href=\"href\"\r\n\t\t:data-top-icon=\"icon || undefined\"\r\n\t\t:disabled=\"disabled || undefined\"\r\n\t\t@click=\"name ? state.activeItemName = name : null\"\r\n\t>\r\n\t\t<slot v-if=\"state.showMenuInPopup\"></slot>\r\n\r\n\t\t<span\r\n\t\t\tv-else-if=\"$slots.default && !state.isShort\"\r\n\t\t\tclass=\"top-ellipsis\"\r\n\t\t>\r\n\t\t\t<slot></slot>\r\n\t\t</span>\r\n\t</component>\r\n</template>\r\n\r\n<style module>\r\n.top-tabsView_menuItem {\r\n\t--top-icon-color: var(--color-text-1);\r\n\t--top-icon-width: calc(var(--top-icon-size));\r\n\r\n\tcursor: pointer;\r\n\tbox-sizing: border-box;\r\n\r\n\tborder: none;\r\n\tborder-radius: var(--top-radius-2);\r\n\tpadding: var(--top-padding-2);\r\n\tbackground: transparent;\r\n\theight: 40px;\r\n\r\n\tcolor: var(--color-text-1);\r\n\ttext-align: left;\r\n\ttext-decoration: none;\r\n\twhite-space: nowrap;\r\n\r\n\tdisplay: flex;\r\n\tgap: var(--top-gap-2);\r\n\talign-items: center;\r\n\tjustify-content: flex-start;\r\n\ttransition: background var(--transition);\r\n}\r\n\r\n.top-tabsView_menuItem:hover {\r\n\tbackground: var(--color-secondary-2-opacity);\r\n}\r\n\r\n.top-tabsView_menuItem.top-active {\r\n\t--top-icon-color: var(--color-primary);\r\n\r\n\tcursor: unset;\r\n\tbackground: var(--color-bg-3);\r\n\tcolor: var(--color-primary);\r\n}\r\n\r\n.top-tabsView_menuItem:disabled:not(option):not(optgroup):not(.top-forms-option),\r\n.top-tabsView_menuItem:disabled ~ .top-formsCaption,\r\n.top-tabsView_menuItem.top-disabled[data-top-icon]:before,\r\n.top-tabsView_menuItem.top-disabled[data-top-icon2]:after {\r\n\topacity: unset;\r\n\tfilter: unset;\r\n}\r\n\r\n.top-tabsView_menuItem.top-disabled {\r\n\t--top-icon-color: var(--color-text-4);\r\n\r\n\tcolor: var(--color-text-4);\r\n}\r\n</style>","<script setup lang=\"ts\">\r\nimport { computed, useSlots } from 'vue';\r\nimport type { ComputedRef } from '@vue/reactivity';\r\nimport { Popup } from '../../popup/popup';\r\n\r\nimport type { PropsMenu, PropsMenuItem, MenuItem } from './tabsView';\r\nimport { useState } from './state';\r\nimport TabsViewMenuItem from './menuItem.vue';\r\n\r\ndefineProps<PropsMenu>();\r\n\r\nconst state = useState();\r\n\r\nconst slots = useSlots();\r\n\r\n// словарь испоьзуется для оптимизации получения нужного menuItem\r\nconst menuItemByName: Map<PropsMenuItem['name'], MenuItem> = new Map();\r\n\r\n// activeMenuItem нужен для вывода текста активной вкладки в меню с popup\r\n// смена slot, например смена языка, требует повторного выполнения genMenuItemByName()\r\nconst activeMenuItem: ComputedRef<MenuItem | null> = computed(() => {\r\n\tlet menuItem = menuItemByName.get(state.activeItemName);\r\n\tif (menuItem) return menuItem;\r\n\r\n\tgenMenuItemByName();\r\n\r\n\treturn menuItemByName.get(state.activeItemName) || null;\r\n});\r\n\r\n// сгенерировать словарь с menuItem, по элементам в slot\r\nconst genMenuItemByName = () => {\r\n\tif (!slots.default) return;\r\n\r\n\tconst component: any = slots.default().find(item => item.key === '_menu');\r\n\tif (!component) return;\r\n\r\n\tcomponent.children.forEach((subComponent: any) => {\r\n\t\tif (subComponent.type.__name !== TabsViewMenuItem.__name) return;\r\n\t\tif (!subComponent.props.name) return;\r\n\r\n\t\tconst menuItem = {\r\n\t\t\ttitle: (subComponent.children.default?.()[0].children as string).trim(),\r\n\t\t\ticon: subComponent.props.icon,\r\n\t\t};\r\n\r\n\t\tmenuItemByName.set(subComponent.props.name, menuItem);\r\n\t});\r\n};\r\n</script>\r\n\r\n<template>\r\n\t<div\r\n\t\t:class=\"{\r\n\t\t\t'top-tabsView_menu': true,\r\n\t\t\t'top-tabsView_menu-inPopup_0': !state.showMenuInPopup,\r\n\t\t\t'top-tabsView_menu-inPopup_1': state.showMenuInPopup,\r\n\t\t\t'top-tabsView_menu-short': state.isShort && !state.showMenuInPopup,\r\n\t\t}\"\r\n\t>\r\n\t\t<!-- Спрятать меню под кнопку в popup -->\r\n\t\t<Popup v-if=\"state.showMenuInPopup\">\r\n\t\t\t<template #opener>\r\n\t\t\t\t<div class=\"top-tabsView_menuOpener\">\r\n\t\t\t\t\t<div\r\n\t\t\t\t\t\tv-if=\"activeMenuItem\"\r\n\t\t\t\t\t\tclass=\"top-tabsView_menuOpenerActiveItem\"\r\n\t\t\t\t\t\t:data-top-icon=\"activeMenuItem.icon\"\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<span class=\"top-ellipsis\">\r\n\t\t\t\t\t\t\t{{ activeMenuItem.title }}\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t</div>\r\n\r\n\t\t\t\t\t<div class=\"top-tabsView_menuOpenerIcon\" data-top-icon=\"\"></div>\r\n\t\t\t\t</div>\r\n\t\t\t</template>\r\n\r\n\t\t\t<template #contentList>\r\n\t\t\t\t<slot></slot>\r\n\t\t\t</template>\r\n\t\t</Popup>\r\n\r\n\t\t<!-- Отобразить меню на старнице -->\r\n\t\t<template v-else>\r\n\t\t\t<div class=\"top-tabsView_menuList\">\r\n\t\t\t\t<slot></slot>\r\n\t\t\t</div>\r\n\r\n\t\t\t<div class=\"top-tabsView_menuFooter\">\r\n\t\t\t\t<TabsViewMenuItem\r\n\t\t\t\t\tv-if=\"isShortable\"\r\n\t\t\t\t\t:icon=\"state.isShort ? '' : ''\"\r\n\t\t\t\t\t@click=\"state.isShort = !state.isShort\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{{ state.isShort ? '' : 'Свернуть' }} <!--TODO: translate-->\r\n\t\t\t\t</TabsViewMenuItem>\r\n\t\t\t</div>\r\n\t\t</template>\r\n\t</div>\r\n</template>\r\n\r\n<style module>\r\n.top-tabsView_menu-inPopup_0 {\r\n\tbox-sizing: border-box;\r\n\twidth: var(--top-tabsView-menu-width);\r\n\tdisplay: flex;\r\n\tflex-direction: column;\r\n\tjustify-content: space-between;\r\n}\r\n\r\n.top-tabsView_menu-inPopup_1 {\r\n\tborder-bottom: 1px solid var(--color-line-2-opacity);\r\n}\r\n\r\n.top-tabsView_menu-short {\r\n\twidth: auto;\r\n}\r\n\r\n.top-tabsView_menu > .top-tabsView_menuOpener {\r\n\tdisplay: flex;\r\n\tjustify-content: flex-end;\r\n}\r\n\r\n.top-tabsView_menu > .top-tabsView_menuOpener:hover {\r\n\tbackground: var(--color-secondary-opacity);\r\n}\r\n\r\n.top-tabsView_menuOpenerIcon { display: flex; }\r\n\r\n.top-tabsView_menuOpenerActiveItem {\r\n\t--top-forms-padding: 0px;\r\n\r\n\tbox-sizing: border-box;\r\n\tpadding: var(--top-padding-2);\r\n\tmax-width: calc(100% - var(--top-forms-base-height));\r\n\twhite-space: nowrap;\r\n\tflex-grow: 1;\r\n\tdisplay: flex;\r\n\talign-items: center;\r\n\tgap: var(--top-padding-2);\r\n}\r\n\r\n.top-tabsView_menuList,\r\n.top-tabsView_menuFooter{\r\n\tpadding: var(--top-padding-2);\r\n\tdisplay: flex;\r\n\tflex-direction: column;\r\n\tgap: var(--top-gap-2);\r\n}\r\n\r\n.top-tabsView_menuList{\r\n\toverflow-y: auto;\r\n}\r\n\r\n.top-tabsView_menu-short .top-tabsView_menuFooter > .top-tabsView_menuItem{\r\n\t--top-icon-width: 100%;\r\n}\r\n</style>","<script setup lang=\"ts\">\r\nimport { watchEffect } from 'vue';\r\nimport type { Props, Emits } from './tabsView';\r\nimport { initState } from './state';\r\nimport TabsViewMenu from './menu.vue';\r\nimport Core from '@/core/core/core';\r\n\r\nconst props = withDefaults(defineProps<Props>(), {\r\n\tisShortable: false,\r\n});\r\n\r\nconst emit = defineEmits<Emits>();\r\n\r\nconst state = initState(props, emit);\r\n\r\nwatchEffect(() => {\r\n\tstate.showMenuInPopup = props.showMenuInPopup ?? Core.state.isMobile;\r\n});\r\n</script>\r\n\r\n<template>\r\n\t<div\r\n\t\t:class=\"{\r\n\t\t\t'top-tabsView': true,\r\n\t\t\t'top-tabsView-inPopup': state.showMenuInPopup,\r\n\t\t}\"\r\n\t>\r\n\t\t<TabsViewMenu :isShortable=\"isShortable\">\r\n\t\t\t<!-- @slot Меню, ожидает передачу компонентов TabsViewMenuItem и TabsViewMenuTitle -->\r\n\t\t\t<slot name=\"menu\"></slot>\r\n\t\t</TabsViewMenu>\r\n\r\n\t\t<div class=\"top-tabsView_contents\">\r\n\t\t\t<!-- @slot Контент вкладок, ожидает передачу компонентов TabsViewContent, в слоте необходимо предусмотреть вывод неободимого компонента в зависимости от активной вкладки -->\r\n\t\t\t<slot name=\"contents\"></slot>\r\n\t\t</div>\r\n\t</div>\r\n</template>\r\n\r\n<style module>\r\n:root {\r\n\t--top-tabsView-menu-width: 220px;\r\n}\r\n\r\n.top-tabsView {\r\n\tbackground: var(--color-bg-2);\r\n\twidth: 100%;\r\n\theight: 100%;\r\n\tdisplay: flex;\r\n\tflex-direction: row;\r\n}\r\n\r\n.top-tabsView-inPopup {\r\n\tbackground: var(--color-bg-3);\r\n\tflex-direction: column;\r\n}\r\n\r\n.top-tabsView_contents {\r\n\tborder-radius: var(--top-radius-4);\r\n\tbackground: var(--color-bg-3);\r\n\tpadding: var(--top-padding-4);\r\n\tflex-grow: 1;\r\n\toverflow: auto;\r\n}\r\n</style>","<script setup lang=\"ts\">\r\n\r\n</script>\r\n\r\n<template>\r\n\t<div class=\"top-tabsView_menuDelimeter\"></div>\r\n</template>\r\n\r\n<style module>\r\n.top-tabsView_menuDelimeter {\r\n\tpadding: var(--top-padding-1) 0;\r\n\tdisplay: flex;\r\n}\r\n\r\n.top-tabsView_menuDelimeter:before {\r\n\tcontent: \"\";\r\n\theight: 2px;\r\n\tbackground: var(--color-line-2-opacity);\r\n\tflex-grow: 1;\r\n}\r\n\r\n.top-tabsView_menuDelimeter:first-child,\r\n.top-tabsView_menuDelimeter + .top-tabsView_menuDelimeter {\r\n\tdisplay: none;\r\n}\r\n</style>","<script setup lang=\"ts\">\r\nimport { useState } from './state';\r\nimport type { PropsMenuTitle, State } from './tabsView';\r\nimport TabsViewMenuDelimeter from './menuDelimeter.vue';\r\nimport { PopupListItem } from '../../popup/popup';\r\n\r\ndefineProps<PropsMenuTitle>();\r\n\r\nconst state = useState();\r\n</script>\r\n\r\n<template>\r\n\t<PopupListItem\r\n\t\tv-if=\"state.showMenuInPopup\"\r\n\t\ttype=\"title\"\r\n\t>\r\n\t\t<slot></slot>\r\n\t</PopupListItem>\r\n\r\n\t<TabsViewMenuDelimeter v-else-if=\"state.isShort\"/>\r\n\r\n\t<div\r\n\t\tv-else\r\n\t\t:class=\"{\r\n\t\t\t'top-tabsView_menuTitle': true,\r\n\t\t\t'top-tabsView_menuTitle-subtitle': isSubtitle,\r\n\t\t}\"\r\n\t>\r\n\t\t<slot></slot>\r\n\t</div>\r\n</template>\r\n\r\n<style module>\r\n.top-tabsView_menuTitle {\r\n\tpadding: var(--top-padding-4) var(--top-padding-2) var(--top-padding-1);\r\n\tfont-weight: 600;\r\n}\r\n\r\n.top-tabsView_menuTitle-subtitle {\r\n\tpadding-top: var(--top-padding-1);\r\n\tfont-size: 12px;\r\n\tfont-weight: 400;\r\n\tcolor: var(--color-text-2);\r\n}\r\n</style>","<script setup lang=\"ts\">\r\nimport { useState } from './state';\r\nimport type { PropsContent } from './tabsView';\r\n\r\ndefineProps<PropsContent>();\r\n\r\nconst state = useState();\r\n</script>\r\n\r\n<template>\r\n\t<div\r\n\t\tv-if=\"state.activeItemName === name\"\r\n\t\tclass=\"top-tabsView_content\"\r\n\t>\r\n\t\t<slot></slot>\r\n\t</div>\r\n</template>\r\n\r\n<style module>\r\n\r\n</style>"],"names":["init","injectionKey2","state","vue","use","genStorageKey","stateName","stateKey","stateManager","localStorageValue","localStorageKey","injectionKey","initState","props","emit","value","initLocalStorge","__props","componentName","useState","slots","menuItemByName","activeMenuItem","menuItem","component","item","subComponent","_b","_a","__emit","forms","_sfc_render","_ctx","_cache"],"mappings":"mPA0BA,MAAAA,EAAA,CAAAC,EAAAC,KACCC,EAAA,QAAAF,EAAAC,CAAA,KAUDE,EAAAH,GAAA,CACC,MAAAC,EAAAC,EAAA,OAAAF,CAAA,QAGC,MAAA,MAAA,0DAAA,UAIF,EAOAI,EAAA,CAAAC,EAAAC,oBACC,OAAAD,CAAA,SA2CDE,EAAA,CAAe,KAAAR,EACd,IAAAI,EACA,gBAnCD,CAAAE,EAAAJ,IAAA,CAEC,GAAA,CAAAA,EAAA,IAAgB,0BAIhB,GAAA,CACC,MAAAO,EAAA,KAAA,MAAA,aAAA,QAAAC,CAAA,CAAA,0BAGCR,EAAAI,CAAA,EAAAG,SAGD,QAAA,KAAA,IAAA,MAAA,kBAAAC,CAAA,sBAAA,CAAA,EAEF,EAqBC,oBAdD,CAAAJ,EAAAJ,IAAA,CAEC,GAAA,CAAAA,EAAA,IAAgB,oDAKf,aAAA,QAAAQ,EAAA,KAAA,UAAAR,EAAAI,CAAA,CAAA,CAAA,CAAsE,EAAA,CAAA,UAAA,EAAA,CAAA,CAExE,GCxFOK,EAAA,OAAA,EAOMC,EAAA,CAAAC,EAAAC,IAAA,CACZ,MAAAZ,EAAAC,EAAA,SAAA,CAA8B,IAAAU,EAAA,gBAClB,gBAAAA,EAAA,sDAGc,KAAA,CAEvB,OAAAA,EAAA,mBAGAC,EAAA,oBAAAC,CAAA,EACD,CAAA,CACA,CAAA,EAGF,OAAAC,EAAAH,EAAAX,CAAA,aAGD,QAMCM,EAAA,IAAAG,CAAA,EAQDK,EAAA,CAAAH,EAAAX,IAAA,CACC,GAAAW,EAAA,YAAA,CACC,MAAAP,EAAA,qMCzCF,MAAAO,EAAAI,EAEAC,EAAAf,EAAA,SAAA,IACCD,EAAA,mDAI0B,EAG3BA,EAAAiB,EAAA,stCCLA,MAAAjB,EAAAiB,EAAA,EAEAC,EAAAjB,EAAA,SAAA,EAGAkB,EAAA,IAAA,IAIAC,EAAAnB,EAAA,SAAA,IAAA,+BAEC,OAAAoB,sCAImD,CAAA,SAKnD,GAAA,CAAAH,EAAA,QAAoB,OAEpB,MAAAI,EAAAJ,EAAA,QAAA,EAAA,KAAAK,GAAAA,EAAA,MAAA,OAAA,oCAKC,6BAAA,CAAAC,EAAA,MAAA,KAA8B,gBAEb,QAAAC,GAAAC,EAAAF,EAAA,UAAA,UAAA,YAAAC,EAAA,KAAAC,GAAA,GAAA,UAAA,KAAA,EACsD,KAAAF,EAAA,MAAA,IAC7C,EAG1BL,EAAA,IAAAK,EAAA,MAAA,KAAAH,CAAA,CAAoD,CAAA,CACpD,4+DCvCF,MAAAV,EAAAI,QAIAY,6BAKC3B,EAAA,gBAAAW,EAAA,iBAAAiB,EAAA,KAAA,MAAA,QAA4D,CAAA,qnBCX5D,SAAAC,EAAAC,EAAAC,EAAA,+MCGD,MAAA/B,EAAAiB,EAAA,qsBCFA,MAAAjB,EAAAiB,EAAA"}
|
|
1
|
+
{"version":3,"file":"tabsView.amd.js","sources":["../../src/components/stateManager.ts","../../src/components/tabsView/tabsView/state.ts","../../src/components/tabsView/tabsView/menuItem.vue","../../src/components/tabsView/tabsView/menu.vue","../../src/components/tabsView/tabsView/tabsView.vue","../../src/components/tabsView/tabsView/menuDelimeter.vue","../../src/components/tabsView/tabsView/menuTitle.vue","../../src/components/tabsView/tabsView/content.vue"],"sourcesContent":["import { provide, inject, toRef, watch } from 'vue';\nimport type { InjectionKey } from 'vue';\nimport { injectionKey } from '@/components/tabsView/tabsView/state';\n\n/**\n * State - интерфейс с общими параметрами для состояния компоента\n */\nexport interface State {\n\t/**\n\t * Ключ для сохранения состояния\n\t *\n\t * Может быть одинаковый для разных компонентов\n\t *\n\t * Не может быть реактивным\n\t *\n\t * Состояния сохраняются в localStorage с префиксом top\n\t */\n\tkey?: string;\n}\n\n/**\n * Инициировать State компонента\n * @param key - InjectionKey для provide / inject в области компонента\n * @param state\n * @return - State компонента\n */\nconst init = <T>(injectionKey: InjectionKey<T>, state: T): T => {\n\tprovide(injectionKey, state);\n\n\treturn state;\n};\n\n/**\n * Получить State компонента\n * @param key - InjectionKey для provide / inject в области компонента\n * @return - State компонента\n */\nconst use = <T>(injectionKey: InjectionKey<T>): T => {\n\tconst state = inject(injectionKey);\n\n\tif (!state) {\n\t\tthrow Error('Попытка использовать tabsView state до его инициализации');\n\t}\n\n\treturn state;\n};\n\n/**\n * Сгенерировать имя для сохранения данных в localStorage\n * @param stateName - имя свойства состояния\n * @param stateKey - ключ состояния, разные компоненты могут использовать одинаковый ключ\n */\nconst genStorageKey = <T extends State>(stateName: keyof T, stateKey: string): string => {\n\tconst stateNameString = String(stateName);\n\n\treturn `top:tabsView:${stateNameString}:${stateKey}`;\n};\n\n/**\n * Загрузить состояние\n * @param stateName - имя свойства состояния\n * @param state\n */\nconst loadLocalStorge = <T extends State>(stateName: keyof T, state: T) => {\n\t// если state.key не знадан, значит сохранение состояния в компоненте отключено\n\tif (!state.key) return;\n\n\tconst localStorageKey = genStorageKey(stateName, state.key);\n\n\ttry {\n\t\tconst localStorageValue: typeof state[keyof typeof state] = JSON.parse(localStorage.getItem(localStorageKey) as string);\n\n\t\tif (typeof localStorageValue === typeof state[stateName]) {\n\t\t\tstate[stateName] = localStorageValue;\n\t\t}\n\t} catch (e) {\n\t\tconsole.warn(new Error(`В localStorage[${localStorageKey}] не корректный json`));\n\t}\n};\n\n/**\n * Добавить автосохранение состояние при его изменении\n * @param stateName - имя свойства состояния\n * @param state\n */\nconst addSaverLocalStorge = <T extends State>(stateName: keyof T, state: T) => {\n\t// если state.key не знадан, значит сохранение состояния в компоненте отключено\n\tif (!state.key) return;\n\n\tconst localStorageKey = genStorageKey(stateName, state.key);\n\n\twatch(toRef(state, stateName), () => {\n\t\tlocalStorage.setItem(localStorageKey, JSON.stringify(state[stateName]));\n\t}, { immediate: true });\n};\n\nexport default {\n\tinit,\n\tuse,\n\tloadLocalStorge,\n\taddSaverLocalStorge,\n};","import { reactive, computed } from 'vue';\nimport type { InjectionKey } from 'vue';\nimport type { State } from './tabsView';\nimport type { Emits, Props } from './tabsView';\nimport stateManager from '@/components/stateManager';\n\nexport const injectionKey = Symbol() as InjectionKey<State>;\n\n/**\n * Инициировать State компонента\n * @param props\n * @param emit\n */\nexport const initState = (props: Props, emit: Emits): State => {\n\tconst state: State = reactive({\n\t\tkey: props.keyForSaveState,\n\t\tshowMenuInPopup: props.showMenuInPopup,\n\t\tisShort: false,\n\t\tactiveItemName: computed({\n\t\t\tget() {\n\t\t\t\treturn props.modelValue;\n\t\t\t},\n\t\t\tset(value) {\n\t\t\t\temit('update:modelValue', value);\n\t\t\t},\n\t\t}),\n\t});\n\n\tinitLocalStorge(props, state);\n\n\treturn stateManager.init(injectionKey, state);\n};\n\n/**\n * Получить State компонента\n */\nexport const useState = () => {\n\treturn stateManager.use(injectionKey);\n};\n\n/**\n * Инициировать работу LocalStorge\n * @param props\n * @param state\n */\nconst initLocalStorge = (props: Props, state: State): void => {\n\tif (props.isShortable) {\n\t\tconst stateName = 'isShort';\n\n\t\tstateManager.loadLocalStorge(stateName, state);\n\t\tstateManager.addSaverLocalStorge(stateName, state);\n\t}\n};","<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport { useState } from './state';\nimport type { PropsMenuItem, State } from './tabsView';\nimport { PopupListItem } from '../../popup/popup';\n\nconst props = defineProps<PropsMenuItem>();\n\nconst componentName = computed(() => {\n\tif (state.showMenuInPopup) {\n\t\treturn PopupListItem;\n\t}\n\n\treturn props.href ? 'a' : 'button';\n});\n\nconst state = useState();\n</script>\n\n<template>\n\t<component\n\t\t:is=\"componentName\"\n\t\t:class=\"{\n\t\t\t['top-tabsView_menuItem']: !state.showMenuInPopup,\n\t\t\t['top-active']: name && state.activeItemName === name,\n\t\t\t['top-disabled']: disabled,\n\t\t}\"\n\t\t:href=\"href\"\n\t\t:data-top-icon=\"icon || undefined\"\n\t\t:disabled=\"disabled || undefined\"\n\t\t@click=\"name ? state.activeItemName = name : null\"\n\t>\n\t\t<slot v-if=\"state.showMenuInPopup\"></slot>\n\n\t\t<span\n\t\t\tv-else-if=\"$slots.default && !state.isShort\"\n\t\t\tclass=\"top-ellipsis\"\n\t\t>\n\t\t\t<slot></slot>\n\t\t</span>\n\t</component>\n</template>\n\n<style module>\n.top-tabsView_menuItem {\n\t--top-icon-color: var(--color-text-1);\n\t--top-icon-width: calc(var(--top-icon-size));\n\n\tcursor: pointer;\n\tbox-sizing: border-box;\n\n\tborder: none;\n\tborder-radius: var(--top-radius-2);\n\tpadding: var(--top-padding-2);\n\tbackground: transparent;\n\theight: 40px;\n\n\tcolor: var(--color-text-1);\n\ttext-align: left;\n\ttext-decoration: none;\n\twhite-space: nowrap;\n\n\tdisplay: flex;\n\tgap: var(--top-gap-2);\n\talign-items: center;\n\tjustify-content: flex-start;\n\ttransition: background var(--transition);\n}\n\n.top-tabsView_menuItem:hover {\n\tbackground: var(--color-secondary-2-opacity);\n}\n\n.top-tabsView_menuItem.top-active {\n\t--top-icon-color: var(--color-primary);\n\n\tcursor: unset;\n\tbackground: var(--color-bg-3);\n\tcolor: var(--color-primary);\n}\n\n.top-tabsView_menuItem:disabled:not(option):not(optgroup):not(.top-forms-option),\n.top-tabsView_menuItem:disabled ~ .top-formsCaption,\n.top-tabsView_menuItem.top-disabled[data-top-icon]:before,\n.top-tabsView_menuItem.top-disabled[data-top-icon2]:after {\n\topacity: unset;\n\tfilter: unset;\n}\n\n.top-tabsView_menuItem.top-disabled {\n\t--top-icon-color: var(--color-text-4);\n\n\tcolor: var(--color-text-4);\n}\n</style>","<script setup lang=\"ts\">\nimport { computed, useSlots } from 'vue';\nimport type { ComputedRef } from '@vue/reactivity';\nimport { Popup } from '../../popup/popup';\n\nimport type { PropsMenu, PropsMenuItem, MenuItem } from './tabsView';\nimport { useState } from './state';\nimport TabsViewMenuItem from './menuItem.vue';\n\ndefineProps<PropsMenu>();\n\nconst state = useState();\n\nconst slots = useSlots();\n\n// словарь испоьзуется для оптимизации получения нужного menuItem\nconst menuItemByName: Map<PropsMenuItem['name'], MenuItem> = new Map();\n\n// activeMenuItem нужен для вывода текста активной вкладки в меню с popup\n// смена slot, например смена языка, требует повторного выполнения genMenuItemByName()\nconst activeMenuItem: ComputedRef<MenuItem | null> = computed(() => {\n\tlet menuItem = menuItemByName.get(state.activeItemName);\n\tif (menuItem) return menuItem;\n\n\tgenMenuItemByName();\n\n\treturn menuItemByName.get(state.activeItemName) || null;\n});\n\n// сгенерировать словарь с menuItem, по элементам в slot\nconst genMenuItemByName = () => {\n\tif (!slots.default) return;\n\n\tconst component: any = slots.default().find(item => item.key === '_menu');\n\tif (!component) return;\n\n\tcomponent.children.forEach((subComponent: any) => {\n\t\tif (subComponent.type.__name !== TabsViewMenuItem.__name) return;\n\t\tif (!subComponent.props.name) return;\n\n\t\tconst menuItem = {\n\t\t\ttitle: (subComponent.children.default?.()[0].children as string).trim(),\n\t\t\ticon: subComponent.props.icon,\n\t\t};\n\n\t\tmenuItemByName.set(subComponent.props.name, menuItem);\n\t});\n};\n</script>\n\n<template>\n\t<div\n\t\t:class=\"{\n\t\t\t'top-tabsView_menu': true,\n\t\t\t'top-tabsView_menu-inPopup_0': !state.showMenuInPopup,\n\t\t\t'top-tabsView_menu-inPopup_1': state.showMenuInPopup,\n\t\t\t'top-tabsView_menu-short': state.isShort && !state.showMenuInPopup,\n\t\t}\"\n\t>\n\t\t<!-- Спрятать меню под кнопку в popup -->\n\t\t<Popup v-if=\"state.showMenuInPopup\">\n\t\t\t<template #opener>\n\t\t\t\t<div class=\"top-tabsView_menuOpener\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-if=\"activeMenuItem\"\n\t\t\t\t\t\tclass=\"top-tabsView_menuOpenerActiveItem\"\n\t\t\t\t\t\t:data-top-icon=\"activeMenuItem.icon\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"top-ellipsis\">\n\t\t\t\t\t\t\t{{ activeMenuItem.title }}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div class=\"top-tabsView_menuOpenerIcon\" data-top-icon=\"\"></div>\n\t\t\t\t</div>\n\t\t\t</template>\n\n\t\t\t<template #contentList>\n\t\t\t\t<slot></slot>\n\t\t\t</template>\n\t\t</Popup>\n\n\t\t<!-- Отобразить меню на старнице -->\n\t\t<template v-else>\n\t\t\t<div class=\"top-tabsView_menuList\">\n\t\t\t\t<slot></slot>\n\t\t\t</div>\n\n\t\t\t<div class=\"top-tabsView_menuFooter\">\n\t\t\t\t<TabsViewMenuItem\n\t\t\t\t\tv-if=\"isShortable\"\n\t\t\t\t\t:icon=\"state.isShort ? '' : ''\"\n\t\t\t\t\t@click=\"state.isShort = !state.isShort\"\n\t\t\t\t>\n\t\t\t\t\t{{ state.isShort ? '' : 'Свернуть' }} <!--TODO: translate-->\n\t\t\t\t</TabsViewMenuItem>\n\t\t\t</div>\n\t\t</template>\n\t</div>\n</template>\n\n<style module>\n.top-tabsView_menu-inPopup_0 {\n\tbox-sizing: border-box;\n\twidth: var(--top-tabsView-menu-width);\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n}\n\n.top-tabsView_menu-inPopup_1 {\n\tborder-bottom: 1px solid var(--color-line-2-opacity);\n}\n\n.top-tabsView_menu-short {\n\twidth: auto;\n}\n\n.top-tabsView_menu > .top-tabsView_menuOpener {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n}\n\n.top-tabsView_menu > .top-tabsView_menuOpener:hover {\n\tbackground: var(--color-secondary-opacity);\n}\n\n.top-tabsView_menuOpenerIcon { display: flex; }\n\n.top-tabsView_menuOpenerActiveItem {\n\t--top-forms-padding: 0px;\n\n\tbox-sizing: border-box;\n\tpadding: var(--top-padding-2);\n\tmax-width: calc(100% - var(--top-forms-base-height));\n\twhite-space: nowrap;\n\tflex-grow: 1;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: var(--top-padding-2);\n}\n\n.top-tabsView_menuList,\n.top-tabsView_menuFooter{\n\tpadding: var(--top-padding-2);\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: var(--top-gap-2);\n}\n\n.top-tabsView_menuList{\n\toverflow-y: auto;\n}\n\n.top-tabsView_menu-short .top-tabsView_menuFooter > .top-tabsView_menuItem{\n\t--top-icon-width: 100%;\n}\n</style>","<script setup lang=\"ts\">\nimport { watchEffect } from 'vue';\nimport type { Props, Emits } from './tabsView';\nimport { initState } from './state';\nimport TabsViewMenu from './menu.vue';\nimport Core from '@/core/core/core';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tisShortable: false,\n});\n\nconst emit = defineEmits<Emits>();\n\nconst state = initState(props, emit);\n\nwatchEffect(() => {\n\tstate.showMenuInPopup = props.showMenuInPopup ?? Core.state.isMobile;\n});\n</script>\n\n<template>\n\t<div\n\t\t:class=\"{\n\t\t\t'top-tabsView': true,\n\t\t\t'top-tabsView-inPopup': state.showMenuInPopup,\n\t\t}\"\n\t>\n\t\t<TabsViewMenu :isShortable=\"isShortable\">\n\t\t\t<!-- @slot Меню, ожидает передачу компонентов TabsViewMenuItem и TabsViewMenuTitle -->\n\t\t\t<slot name=\"menu\"></slot>\n\t\t</TabsViewMenu>\n\n\t\t<div class=\"top-tabsView_contents\">\n\t\t\t<!-- @slot Контент вкладок, ожидает передачу компонентов TabsViewContent, в слоте необходимо предусмотреть вывод неободимого компонента в зависимости от активной вкладки -->\n\t\t\t<slot name=\"contents\"></slot>\n\t\t</div>\n\t</div>\n</template>\n\n<style module>\n:root {\n\t--top-tabsView-menu-width: 220px;\n}\n\n.top-tabsView {\n\tbackground: var(--color-bg-2);\n\twidth: 100%;\n\theight: 100%;\n\tdisplay: flex;\n\tflex-direction: row;\n}\n\n.top-tabsView-inPopup {\n\tbackground: var(--color-bg-3);\n\tflex-direction: column;\n}\n\n.top-tabsView_contents {\n\tborder-radius: var(--top-radius-4);\n\tbackground: var(--color-bg-3);\n\tpadding: var(--top-padding-4);\n\tflex-grow: 1;\n\toverflow: auto;\n}\n</style>","<script setup lang=\"ts\">\n\n</script>\n\n<template>\n\t<div class=\"top-tabsView_menuDelimeter\"></div>\n</template>\n\n<style module>\n.top-tabsView_menuDelimeter {\n\tpadding: var(--top-padding-1) 0;\n\tdisplay: flex;\n}\n\n.top-tabsView_menuDelimeter:before {\n\tcontent: \"\";\n\theight: 2px;\n\tbackground: var(--color-line-2-opacity);\n\tflex-grow: 1;\n}\n\n.top-tabsView_menuDelimeter:first-child,\n.top-tabsView_menuDelimeter + .top-tabsView_menuDelimeter {\n\tdisplay: none;\n}\n</style>","<script setup lang=\"ts\">\nimport { useState } from './state';\nimport type { PropsMenuTitle, State } from './tabsView';\nimport TabsViewMenuDelimeter from './menuDelimeter.vue';\nimport { PopupListItem } from '../../popup/popup';\n\ndefineProps<PropsMenuTitle>();\n\nconst state = useState();\n</script>\n\n<template>\n\t<PopupListItem\n\t\tv-if=\"state.showMenuInPopup\"\n\t\ttype=\"title\"\n\t>\n\t\t<slot></slot>\n\t</PopupListItem>\n\n\t<TabsViewMenuDelimeter v-else-if=\"state.isShort\"/>\n\n\t<div\n\t\tv-else\n\t\t:class=\"{\n\t\t\t'top-tabsView_menuTitle': true,\n\t\t\t'top-tabsView_menuTitle-subtitle': isSubtitle,\n\t\t}\"\n\t>\n\t\t<slot></slot>\n\t</div>\n</template>\n\n<style module>\n.top-tabsView_menuTitle {\n\tpadding: var(--top-padding-4) var(--top-padding-2) var(--top-padding-1);\n\tfont-weight: 600;\n}\n\n.top-tabsView_menuTitle-subtitle {\n\tpadding-top: var(--top-padding-1);\n\tfont-size: 12px;\n\tfont-weight: 400;\n\tcolor: var(--color-text-2);\n}\n</style>","<script setup lang=\"ts\">\nimport { useState } from './state';\nimport type { PropsContent } from './tabsView';\n\ndefineProps<PropsContent>();\n\nconst state = useState();\n</script>\n\n<template>\n\t<div\n\t\tv-if=\"state.activeItemName === name\"\n\t\tclass=\"top-tabsView_content\"\n\t>\n\t\t<slot></slot>\n\t</div>\n</template>\n\n<style module>\n\n</style>"],"names":["init","injectionKey2","state","vue","use","genStorageKey","stateName","stateKey","stateManager","localStorageValue","localStorageKey","injectionKey","initState","props","emit","value","initLocalStorge","__props","componentName","useState","slots","menuItemByName","activeMenuItem","menuItem","component","item","subComponent","_b","_a","__emit","forms","_sfc_render","_ctx","_cache"],"mappings":"qSA0BA,MAAAA,EAAA,CAAAC,EAAAC,KACCC,EAAA,QAAAF,EAAAC,CAAA,KAUDE,EAAAH,GAAA,CACC,MAAAC,EAAAC,EAAA,OAAAF,CAAA,QAGC,MAAA,MAAA,0DAAA,UAIF,EAOAI,EAAA,CAAAC,EAAAC,oBACC,OAAAD,CAAA,SA2CDE,EAAA,CAAe,KAAAR,EACd,IAAAI,EACA,gBAnCD,CAAAE,EAAAJ,IAAA,CAEC,GAAA,CAAAA,EAAA,IAAgB,0BAIhB,GAAA,CACC,MAAAO,EAAA,KAAA,MAAA,aAAA,QAAAC,CAAA,CAAA,0BAGCR,EAAAI,CAAA,EAAAG,SAGD,QAAA,KAAA,IAAA,MAAA,kBAAAC,CAAA,sBAAA,CAAA,EAEF,EAqBC,oBAdD,CAAAJ,EAAAJ,IAAA,CAEC,GAAA,CAAAA,EAAA,IAAgB,oDAKf,aAAA,QAAAQ,EAAA,KAAA,UAAAR,EAAAI,CAAA,CAAA,CAAA,CAAsE,EAAA,CAAA,UAAA,EAAA,CAAA,CAExE,GCxFOK,EAAA,OAAA,EAOMC,EAAA,CAAAC,EAAAC,IAAA,CACZ,MAAAZ,EAAAC,EAAA,SAAA,CAA8B,IAAAU,EAAA,gBAClB,gBAAAA,EAAA,sDAGc,KAAA,CAEvB,OAAAA,EAAA,mBAGAC,EAAA,oBAAAC,CAAA,EACD,CAAA,CACA,CAAA,EAGF,OAAAC,EAAAH,EAAAX,CAAA,aAGD,QAMCM,EAAA,IAAAG,CAAA,EAQDK,EAAA,CAAAH,EAAAX,IAAA,CACC,GAAAW,EAAA,YAAA,CACC,MAAAP,EAAA,qMCzCF,MAAAO,EAAAI,EAEAC,EAAAf,EAAA,SAAA,IACCD,EAAA,iDAI0B,EAG3BA,EAAAiB,EAAA,stCCLA,MAAAjB,EAAAiB,EAAA,EAEAC,EAAAjB,EAAA,SAAA,EAGAkB,EAAA,IAAA,IAIAC,EAAAnB,EAAA,SAAA,IAAA,+BAEC,OAAAoB,sCAImD,CAAA,SAKnD,GAAA,CAAAH,EAAA,QAAoB,OAEpB,MAAAI,EAAAJ,EAAA,QAAA,EAAA,KAAAK,GAAAA,EAAA,MAAA,OAAA,oCAKC,6BAAA,CAAAC,EAAA,MAAA,KAA8B,gBAEb,QAAAC,GAAAC,EAAAF,EAAA,UAAA,UAAA,YAAAC,EAAA,KAAAC,GAAA,GAAA,UAAA,KAAA,EACsD,KAAAF,EAAA,MAAA,IAC7C,EAG1BL,EAAA,IAAAK,EAAA,MAAA,KAAAH,CAAA,CAAoD,CAAA,CACpD,4+DCvCF,MAAAV,EAAAI,QAIAY,6BAKC3B,EAAA,gBAAAW,EAAA,iBAAAiB,EAAA,KAAA,MAAA,QAA4D,CAAA,qnBCX5D,SAAAC,EAAAC,EAAAC,EAAA,+MCGD,MAAA/B,EAAAiB,EAAA,msBCFA,MAAAjB,EAAAiB,EAAA"}
|