@vc-shell/framework 1.0.38 → 1.0.39
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/components/atoms/vc-badge/vc-badge.stories.ts +27 -0
- package/components/atoms/vc-badge/vc-badge.vue +63 -0
- package/components/atoms/vc-button/vc-button.stories.ts +34 -0
- package/components/atoms/vc-button/vc-button.vue +219 -0
- package/components/atoms/vc-card/vc-card.vue +137 -0
- package/components/atoms/vc-checkbox/vc-checkbox.stories.ts +25 -0
- package/components/atoms/vc-checkbox/vc-checkbox.vue +130 -0
- package/components/atoms/vc-col/vc-col.vue +22 -0
- package/components/atoms/vc-container/vc-container.stories.ts +31 -0
- package/components/atoms/vc-container/vc-container.vue +220 -0
- package/components/atoms/vc-hint/vc-hint.stories.ts +23 -0
- package/components/atoms/vc-hint/vc-hint.vue +11 -0
- package/components/atoms/vc-icon/vc-icon.stories.ts +32 -0
- package/components/atoms/vc-icon/vc-icon.vue +36 -0
- package/components/atoms/vc-image/vc-image.stories.ts +40 -0
- package/components/atoms/vc-image/vc-image.vue +122 -0
- package/components/atoms/vc-info-row/vc-info-row.vue +42 -0
- package/components/atoms/vc-label/vc-label.stories.ts +23 -0
- package/components/atoms/vc-label/vc-label.vue +49 -0
- package/components/atoms/vc-link/vc-link.stories.ts +30 -0
- package/components/atoms/vc-link/vc-link.vue +46 -0
- package/components/atoms/vc-loading/vc-loading.vue +30 -0
- package/components/atoms/vc-progress/vc-progress.stories.ts +25 -0
- package/components/atoms/vc-progress/vc-progress.vue +65 -0
- package/components/atoms/vc-row/vc-row.vue +13 -0
- package/components/atoms/vc-status/vc-status.stories.ts +26 -0
- package/components/atoms/vc-status/vc-status.vue +78 -0
- package/components/atoms/vc-status-icon/vc-status-icon.vue +21 -0
- package/components/atoms/vc-switch/vc-switch.stories.ts +27 -0
- package/components/atoms/vc-switch/vc-switch.vue +100 -0
- package/components/atoms/vc-widget/vc-widget.vue +85 -0
- package/components/index.ts +43 -0
- package/components/molecules/vc-breadcrumbs/_internal/vc-breadcrumbs-item/vc-breadcrumbs-item.vue +103 -0
- package/components/molecules/vc-breadcrumbs/vc-breadcrumbs.stories.ts +39 -0
- package/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue +21 -0
- package/components/molecules/vc-editor/vc-editor.vue +117 -0
- package/components/molecules/vc-file-upload/vc-file-upload.vue +134 -0
- package/components/molecules/vc-form/vc-form.stories.ts +23 -0
- package/components/molecules/vc-form/vc-form.vue +5 -0
- package/components/molecules/vc-input/vc-input.stories.ts +26 -0
- package/components/molecules/vc-input/vc-input.vue +443 -0
- package/components/molecules/vc-multivalue/vc-multivalue.vue +447 -0
- package/components/molecules/vc-notification/vc-notification.vue +101 -0
- package/components/molecules/vc-pagination/vc-pagination.stories.ts +23 -0
- package/components/molecules/vc-pagination/vc-pagination.vue +169 -0
- package/components/molecules/vc-rating/vc-rating.stories.ts +23 -0
- package/components/molecules/vc-rating/vc-rating.vue +77 -0
- package/components/molecules/vc-select/vc-select.stories.ts +25 -0
- package/components/molecules/vc-select/vc-select.vue +402 -0
- package/components/molecules/vc-slider/vc-slider.vue +106 -0
- package/components/molecules/vc-textarea/vc-textarea.stories.ts +23 -0
- package/components/molecules/vc-textarea/vc-textarea.vue +155 -0
- package/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +146 -0
- package/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue +148 -0
- package/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue +157 -0
- package/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue +110 -0
- package/components/organisms/vc-app/vc-app.stories.ts +75 -0
- package/components/organisms/vc-app/vc-app.vue +171 -0
- package/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue +126 -0
- package/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue +223 -0
- package/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue +67 -0
- package/components/organisms/vc-blade/vc-blade.stories.ts +46 -0
- package/components/organisms/vc-blade/vc-blade.vue +87 -0
- package/components/organisms/vc-dynamic-property/vc-dynamic-property.vue +292 -0
- package/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue +123 -0
- package/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue +93 -0
- package/components/organisms/vc-gallery/vc-gallery.vue +186 -0
- package/components/organisms/vc-login-form/vc-login-form.stories.ts +55 -0
- package/components/organisms/vc-login-form/vc-login-form.vue +48 -0
- package/components/organisms/vc-popup/vc-popup.stories.ts +23 -0
- package/components/organisms/vc-popup/vc-popup.vue +97 -0
- package/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue +113 -0
- package/components/organisms/vc-table/_internal/vc-table-counter/vc-table-counter.vue +29 -0
- package/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue +152 -0
- package/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue +272 -0
- package/components/organisms/vc-table/vc-table.stories.ts +99 -0
- package/components/organisms/vc-table/vc-table.vue +638 -0
- package/core/api/index.ts +1 -0
- package/core/api/platform.ts +8332 -0
- package/core/composables/index.ts +8 -0
- package/core/composables/useAutosave/index.ts +57 -0
- package/core/composables/useFunctions/debounce.ts +18 -0
- package/core/composables/useFunctions/delay.ts +7 -0
- package/core/composables/useFunctions/index.ts +21 -0
- package/core/composables/useFunctions/once.ts +14 -0
- package/core/composables/useFunctions/sleep.ts +4 -0
- package/core/composables/useFunctions/throttle.ts +17 -0
- package/core/composables/useI18n/index.ts +28 -0
- package/core/composables/useLogger/index.ts +24 -0
- package/core/composables/useNotifications/index.ts +116 -0
- package/core/composables/usePermissions/index.ts +32 -0
- package/core/composables/useSettings/index.ts +36 -0
- package/core/composables/useUser/index.ts +266 -0
- package/core/directives/autofocus/index.ts +9 -0
- package/core/directives/click-outside/index.ts +21 -0
- package/core/directives/index.ts +4 -0
- package/core/directives/loading/index.ts +28 -0
- package/core/directives/permissions/index.ts +20 -0
- package/core/plugins/index.ts +1 -0
- package/core/plugins/validation/index.ts +2 -0
- package/core/plugins/validation/rules.ts +196 -0
- package/core/types/index.ts +92 -0
- package/core/utilities/camelToSnake.ts +7 -0
- package/core/utilities/index.ts +1 -0
- package/dist/core/composables/useNotifications/index.d.ts +1 -1
- package/dist/core/composables/useNotifications/index.d.ts.map +1 -1
- package/dist/core/composables/useUser/index.d.ts +2 -2
- package/dist/core/composables/useUser/index.d.ts.map +1 -1
- package/dist/core/plugins/validation/index.d.ts.map +1 -1
- package/dist/core/types/index.d.ts +1 -1
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/framework.js +70 -97
- package/dist/framework.js.map +1 -1
- package/dist/shared/app-switcher/composables/useAppSwitcher/index.d.ts +1 -1
- package/dist/shared/app-switcher/composables/useAppSwitcher/index.d.ts.map +1 -1
- package/dist/shared/app-switcher/index.d.ts +2 -2
- package/dist/shared/app-switcher/index.d.ts.map +1 -1
- package/dist/shared/blade-navigation/composables/useBladeNavigation/index.d.ts +1 -1
- package/dist/shared/blade-navigation/composables/useBladeNavigation/index.d.ts.map +1 -1
- package/dist/shared/blade-navigation/types/index.d.ts +1 -1
- package/dist/shared/blade-navigation/types/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/vite.config.d.ts.map +1 -1
- package/package.json +11 -8
- package/shared/app-switcher/components/index.ts +1 -0
- package/shared/app-switcher/components/vc-app-switcher/vc-app-switcher.vue +90 -0
- package/shared/app-switcher/composables/index.ts +1 -0
- package/shared/app-switcher/composables/useAppSwitcher/index.ts +54 -0
- package/shared/app-switcher/index.ts +14 -0
- package/shared/assets/components/assets-details/assets-details.vue +138 -0
- package/shared/assets/components/index.ts +1 -0
- package/shared/assets/index.ts +19 -0
- package/shared/assets/locales/en.json +29 -0
- package/shared/assets/locales/index.ts +2 -0
- package/shared/blade-navigation/components/index.ts +1 -0
- package/shared/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue +84 -0
- package/shared/blade-navigation/composables/index.ts +1 -0
- package/shared/blade-navigation/composables/useBladeNavigation/index.ts +216 -0
- package/shared/blade-navigation/index.ts +15 -0
- package/shared/blade-navigation/types/index.ts +52 -0
- package/shared/index.ts +16 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="vc-editor"
|
|
4
|
+
:class="[
|
|
5
|
+
{
|
|
6
|
+
'vc-editor_error': errorMessage,
|
|
7
|
+
'vc-editor_disabled': disabled
|
|
8
|
+
},
|
|
9
|
+
]"
|
|
10
|
+
>
|
|
11
|
+
<!-- Editor label -->
|
|
12
|
+
<VcLabel v-if="label" class="mb-2" :required="required">
|
|
13
|
+
<span>{{ label }}</span>
|
|
14
|
+
<template v-if="tooltip" v-slot:tooltip>{{ tooltip }}</template>
|
|
15
|
+
</VcLabel>
|
|
16
|
+
|
|
17
|
+
<!-- Editor field -->
|
|
18
|
+
<v-ace-editor
|
|
19
|
+
class="border border-solid border-[color:var(--editor-border-color)] rounded-[var(--editor-border-radius)]"
|
|
20
|
+
v-model:value="content"
|
|
21
|
+
lang="html"
|
|
22
|
+
theme="chrome"
|
|
23
|
+
style="height: 200px"
|
|
24
|
+
@input="onInput"
|
|
25
|
+
/>
|
|
26
|
+
<slot v-if="errorMessage" name="error">
|
|
27
|
+
<VcHint class="vc-editor__error">
|
|
28
|
+
{{ errorMessage }}
|
|
29
|
+
</VcHint>
|
|
30
|
+
</slot>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script lang="ts" setup>
|
|
35
|
+
import { VAceEditor } from "vue3-ace-editor";
|
|
36
|
+
import "ace-builds/src-noconflict/mode-html";
|
|
37
|
+
import "ace-builds/src-noconflict/theme-chrome";
|
|
38
|
+
import {ref, unref, watch} from "vue";
|
|
39
|
+
|
|
40
|
+
const props = defineProps({
|
|
41
|
+
placeholder: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: "",
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
modelValue: {
|
|
47
|
+
type: [String, Number, Date],
|
|
48
|
+
default: null,
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
required: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: false,
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
disabled: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: false,
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
label: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: undefined,
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
tooltip: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: undefined,
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
name: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: "Field",
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
errorMessage: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: undefined
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
83
|
+
const content = ref();
|
|
84
|
+
let initialValue = unref(props.modelValue);
|
|
85
|
+
|
|
86
|
+
watch(
|
|
87
|
+
() => props.modelValue,
|
|
88
|
+
(value) => {
|
|
89
|
+
let init = unref(value);
|
|
90
|
+
emit("update:modelValue", init);
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
// Handle input event to propertly validate value and emit changes
|
|
95
|
+
function onInput() {
|
|
96
|
+
emit("update:modelValue", content.value);
|
|
97
|
+
}
|
|
98
|
+
</script>
|
|
99
|
+
|
|
100
|
+
<style lang="scss">
|
|
101
|
+
:root {
|
|
102
|
+
--editor-border-radius: 3px;
|
|
103
|
+
--editor-border-color: #d3dbe9;
|
|
104
|
+
--editor-border-color-error: #f14e4e;
|
|
105
|
+
--editor-placeholder-color: #a5a5a5;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.vc-editor {
|
|
109
|
+
&__error {
|
|
110
|
+
@apply text-[color:var(--editor-border-color-error)] mt-1;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&_error .ace_editor {
|
|
114
|
+
@apply border border-solid border-[color:var(--editor-border-color-error)];
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
</style>
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col flex-1">
|
|
3
|
+
<div
|
|
4
|
+
class="vc-file-upload relative h-[155px] box-border border border-dashed border-[#c8dbea] rounded-[6px] p-2 p-4 flex flex-col items-center justify-center"
|
|
5
|
+
:class="`vc-file-upload_${variant}`"
|
|
6
|
+
@drop.stop.prevent="onDrop"
|
|
7
|
+
@drag.stop.prevent
|
|
8
|
+
@dragstart.stop.prevent
|
|
9
|
+
@dragend.stop.prevent
|
|
10
|
+
@dragover.stop.prevent
|
|
11
|
+
@dragenter.stop.prevent
|
|
12
|
+
@dragleave.stop.prevent
|
|
13
|
+
>
|
|
14
|
+
<VcLoading :active="loading"></VcLoading>
|
|
15
|
+
<VcIcon
|
|
16
|
+
class="text-[#c8dbea]"
|
|
17
|
+
icon="fas fa-cloud-upload-alt"
|
|
18
|
+
size="xxl"
|
|
19
|
+
></VcIcon>
|
|
20
|
+
|
|
21
|
+
<div class="text-[#9db0be] text-center text-lg leading-lg mt-4">
|
|
22
|
+
<span>Drag and drop file here or</span>
|
|
23
|
+
<br />
|
|
24
|
+
<VcLink @click="toggleUploader">browse your files</VcLink>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<input
|
|
28
|
+
ref="uploader"
|
|
29
|
+
type="file"
|
|
30
|
+
hidden
|
|
31
|
+
@change="upload"
|
|
32
|
+
:accept="accept"
|
|
33
|
+
:multiple="multiple"
|
|
34
|
+
:name="name"
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
<slot v-if="errorMessage" name="error">
|
|
38
|
+
<VcHint class="vc-input__error">
|
|
39
|
+
{{ errorMessage }}
|
|
40
|
+
</VcHint>
|
|
41
|
+
</slot>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script lang="ts" setup>
|
|
46
|
+
import { getCurrentInstance, ref, unref } from "vue";
|
|
47
|
+
import { useField } from "vee-validate";
|
|
48
|
+
|
|
49
|
+
const props = defineProps({
|
|
50
|
+
variant: {
|
|
51
|
+
type: String,
|
|
52
|
+
enum: ["gallery", "file-upload"],
|
|
53
|
+
default: "gallery",
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
loading: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: false,
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
accept: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: ".jpg, .png, .jpeg",
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
multiple: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false,
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
rules: {
|
|
72
|
+
type: [String, Object],
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
name: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: "Gallery",
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const emit = defineEmits(["upload"]);
|
|
82
|
+
const instance = getCurrentInstance();
|
|
83
|
+
// Prepare validation rules using required and rules props combination
|
|
84
|
+
let internalRules = unref(props.rules) || "";
|
|
85
|
+
|
|
86
|
+
// Prepare field-level validation
|
|
87
|
+
const { errorMessage, handleChange, errors, validate } = useField(
|
|
88
|
+
`${props.name === "Gallery" ? instance?.uid : props.name}`,
|
|
89
|
+
internalRules
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
const uploader = ref();
|
|
93
|
+
|
|
94
|
+
const upload = async (event: InputEvent) => {
|
|
95
|
+
await handleChange(event.target);
|
|
96
|
+
|
|
97
|
+
const isValid = await validate();
|
|
98
|
+
|
|
99
|
+
if (isValid.valid) {
|
|
100
|
+
const target = event.target as HTMLInputElement;
|
|
101
|
+
const fileList = target.files;
|
|
102
|
+
|
|
103
|
+
if (fileList && fileList.length) {
|
|
104
|
+
emit("upload", fileList);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
function toggleUploader() {
|
|
110
|
+
uploader.value.value = "";
|
|
111
|
+
uploader.value.click();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function onDrop(event: DragEvent) {
|
|
115
|
+
const fileList = event.dataTransfer?.files;
|
|
116
|
+
|
|
117
|
+
if (fileList && fileList.length) {
|
|
118
|
+
emit("upload", fileList);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
</script>
|
|
122
|
+
|
|
123
|
+
<style lang="scss">
|
|
124
|
+
.vc-file-upload {
|
|
125
|
+
// variants
|
|
126
|
+
&_gallery {
|
|
127
|
+
@apply w-[155px] h-[155px];
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&_file-upload {
|
|
131
|
+
@apply w-full bg-[#f2f8fd];
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
</style>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form component.
|
|
3
|
+
* @author Iurii A Taranov <me@flanker72.ru>
|
|
4
|
+
*/
|
|
5
|
+
import { Story } from "@storybook/vue3";
|
|
6
|
+
import VcForm from "./vc-form.vue";
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: "molecules/vc-form",
|
|
10
|
+
component: VcForm,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const Template: Story = (args) => ({
|
|
14
|
+
components: { VcForm },
|
|
15
|
+
setup() {
|
|
16
|
+
return { args };
|
|
17
|
+
},
|
|
18
|
+
template: '<vc-form v-bind="args"></vc-form>',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const Form = Template.bind({});
|
|
22
|
+
Form.storyName = "vc-form";
|
|
23
|
+
Form.args = {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input component.
|
|
3
|
+
* @author Iurii A Taranov <me@flanker72.ru>
|
|
4
|
+
*/
|
|
5
|
+
import { Story } from "@storybook/vue3";
|
|
6
|
+
import VcInput from "./vc-input.vue";
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: "molecules/vc-input",
|
|
10
|
+
component: VcInput,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const Template: Story = (args) => ({
|
|
14
|
+
components: { VcInput },
|
|
15
|
+
setup() {
|
|
16
|
+
return { args };
|
|
17
|
+
},
|
|
18
|
+
template: '<vc-input v-bind="args"></vc-input>',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const Input = Template.bind({});
|
|
22
|
+
Input.storyName = "vc-input";
|
|
23
|
+
Input.args = {
|
|
24
|
+
placeholder: "Placeholder",
|
|
25
|
+
clearable: true,
|
|
26
|
+
};
|