@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.
Files changed (142) hide show
  1. package/components/atoms/vc-badge/vc-badge.stories.ts +27 -0
  2. package/components/atoms/vc-badge/vc-badge.vue +63 -0
  3. package/components/atoms/vc-button/vc-button.stories.ts +34 -0
  4. package/components/atoms/vc-button/vc-button.vue +219 -0
  5. package/components/atoms/vc-card/vc-card.vue +137 -0
  6. package/components/atoms/vc-checkbox/vc-checkbox.stories.ts +25 -0
  7. package/components/atoms/vc-checkbox/vc-checkbox.vue +130 -0
  8. package/components/atoms/vc-col/vc-col.vue +22 -0
  9. package/components/atoms/vc-container/vc-container.stories.ts +31 -0
  10. package/components/atoms/vc-container/vc-container.vue +220 -0
  11. package/components/atoms/vc-hint/vc-hint.stories.ts +23 -0
  12. package/components/atoms/vc-hint/vc-hint.vue +11 -0
  13. package/components/atoms/vc-icon/vc-icon.stories.ts +32 -0
  14. package/components/atoms/vc-icon/vc-icon.vue +36 -0
  15. package/components/atoms/vc-image/vc-image.stories.ts +40 -0
  16. package/components/atoms/vc-image/vc-image.vue +122 -0
  17. package/components/atoms/vc-info-row/vc-info-row.vue +42 -0
  18. package/components/atoms/vc-label/vc-label.stories.ts +23 -0
  19. package/components/atoms/vc-label/vc-label.vue +49 -0
  20. package/components/atoms/vc-link/vc-link.stories.ts +30 -0
  21. package/components/atoms/vc-link/vc-link.vue +46 -0
  22. package/components/atoms/vc-loading/vc-loading.vue +30 -0
  23. package/components/atoms/vc-progress/vc-progress.stories.ts +25 -0
  24. package/components/atoms/vc-progress/vc-progress.vue +65 -0
  25. package/components/atoms/vc-row/vc-row.vue +13 -0
  26. package/components/atoms/vc-status/vc-status.stories.ts +26 -0
  27. package/components/atoms/vc-status/vc-status.vue +78 -0
  28. package/components/atoms/vc-status-icon/vc-status-icon.vue +21 -0
  29. package/components/atoms/vc-switch/vc-switch.stories.ts +27 -0
  30. package/components/atoms/vc-switch/vc-switch.vue +100 -0
  31. package/components/atoms/vc-widget/vc-widget.vue +85 -0
  32. package/components/index.ts +43 -0
  33. package/components/molecules/vc-breadcrumbs/_internal/vc-breadcrumbs-item/vc-breadcrumbs-item.vue +103 -0
  34. package/components/molecules/vc-breadcrumbs/vc-breadcrumbs.stories.ts +39 -0
  35. package/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue +21 -0
  36. package/components/molecules/vc-editor/vc-editor.vue +117 -0
  37. package/components/molecules/vc-file-upload/vc-file-upload.vue +134 -0
  38. package/components/molecules/vc-form/vc-form.stories.ts +23 -0
  39. package/components/molecules/vc-form/vc-form.vue +5 -0
  40. package/components/molecules/vc-input/vc-input.stories.ts +26 -0
  41. package/components/molecules/vc-input/vc-input.vue +443 -0
  42. package/components/molecules/vc-multivalue/vc-multivalue.vue +447 -0
  43. package/components/molecules/vc-notification/vc-notification.vue +101 -0
  44. package/components/molecules/vc-pagination/vc-pagination.stories.ts +23 -0
  45. package/components/molecules/vc-pagination/vc-pagination.vue +169 -0
  46. package/components/molecules/vc-rating/vc-rating.stories.ts +23 -0
  47. package/components/molecules/vc-rating/vc-rating.vue +77 -0
  48. package/components/molecules/vc-select/vc-select.stories.ts +25 -0
  49. package/components/molecules/vc-select/vc-select.vue +402 -0
  50. package/components/molecules/vc-slider/vc-slider.vue +106 -0
  51. package/components/molecules/vc-textarea/vc-textarea.stories.ts +23 -0
  52. package/components/molecules/vc-textarea/vc-textarea.vue +155 -0
  53. package/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +146 -0
  54. package/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue +148 -0
  55. package/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue +157 -0
  56. package/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue +110 -0
  57. package/components/organisms/vc-app/vc-app.stories.ts +75 -0
  58. package/components/organisms/vc-app/vc-app.vue +171 -0
  59. package/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue +126 -0
  60. package/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue +223 -0
  61. package/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue +67 -0
  62. package/components/organisms/vc-blade/vc-blade.stories.ts +46 -0
  63. package/components/organisms/vc-blade/vc-blade.vue +87 -0
  64. package/components/organisms/vc-dynamic-property/vc-dynamic-property.vue +292 -0
  65. package/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue +123 -0
  66. package/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue +93 -0
  67. package/components/organisms/vc-gallery/vc-gallery.vue +186 -0
  68. package/components/organisms/vc-login-form/vc-login-form.stories.ts +55 -0
  69. package/components/organisms/vc-login-form/vc-login-form.vue +48 -0
  70. package/components/organisms/vc-popup/vc-popup.stories.ts +23 -0
  71. package/components/organisms/vc-popup/vc-popup.vue +97 -0
  72. package/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue +113 -0
  73. package/components/organisms/vc-table/_internal/vc-table-counter/vc-table-counter.vue +29 -0
  74. package/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue +152 -0
  75. package/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue +272 -0
  76. package/components/organisms/vc-table/vc-table.stories.ts +99 -0
  77. package/components/organisms/vc-table/vc-table.vue +638 -0
  78. package/core/api/index.ts +1 -0
  79. package/core/api/platform.ts +8332 -0
  80. package/core/composables/index.ts +8 -0
  81. package/core/composables/useAutosave/index.ts +57 -0
  82. package/core/composables/useFunctions/debounce.ts +18 -0
  83. package/core/composables/useFunctions/delay.ts +7 -0
  84. package/core/composables/useFunctions/index.ts +21 -0
  85. package/core/composables/useFunctions/once.ts +14 -0
  86. package/core/composables/useFunctions/sleep.ts +4 -0
  87. package/core/composables/useFunctions/throttle.ts +17 -0
  88. package/core/composables/useI18n/index.ts +28 -0
  89. package/core/composables/useLogger/index.ts +24 -0
  90. package/core/composables/useNotifications/index.ts +116 -0
  91. package/core/composables/usePermissions/index.ts +32 -0
  92. package/core/composables/useSettings/index.ts +36 -0
  93. package/core/composables/useUser/index.ts +266 -0
  94. package/core/directives/autofocus/index.ts +9 -0
  95. package/core/directives/click-outside/index.ts +21 -0
  96. package/core/directives/index.ts +4 -0
  97. package/core/directives/loading/index.ts +28 -0
  98. package/core/directives/permissions/index.ts +20 -0
  99. package/core/plugins/index.ts +1 -0
  100. package/core/plugins/validation/index.ts +2 -0
  101. package/core/plugins/validation/rules.ts +196 -0
  102. package/core/types/index.ts +92 -0
  103. package/core/utilities/camelToSnake.ts +7 -0
  104. package/core/utilities/index.ts +1 -0
  105. package/dist/core/composables/useNotifications/index.d.ts +1 -1
  106. package/dist/core/composables/useNotifications/index.d.ts.map +1 -1
  107. package/dist/core/composables/useUser/index.d.ts +2 -2
  108. package/dist/core/composables/useUser/index.d.ts.map +1 -1
  109. package/dist/core/plugins/validation/index.d.ts.map +1 -1
  110. package/dist/core/types/index.d.ts +1 -1
  111. package/dist/core/types/index.d.ts.map +1 -1
  112. package/dist/framework.js +70 -97
  113. package/dist/framework.js.map +1 -1
  114. package/dist/shared/app-switcher/composables/useAppSwitcher/index.d.ts +1 -1
  115. package/dist/shared/app-switcher/composables/useAppSwitcher/index.d.ts.map +1 -1
  116. package/dist/shared/app-switcher/index.d.ts +2 -2
  117. package/dist/shared/app-switcher/index.d.ts.map +1 -1
  118. package/dist/shared/blade-navigation/composables/useBladeNavigation/index.d.ts +1 -1
  119. package/dist/shared/blade-navigation/composables/useBladeNavigation/index.d.ts.map +1 -1
  120. package/dist/shared/blade-navigation/types/index.d.ts +1 -1
  121. package/dist/shared/blade-navigation/types/index.d.ts.map +1 -1
  122. package/dist/style.css +1 -1
  123. package/dist/tsconfig.tsbuildinfo +1 -0
  124. package/dist/vite.config.d.ts.map +1 -1
  125. package/package.json +11 -8
  126. package/shared/app-switcher/components/index.ts +1 -0
  127. package/shared/app-switcher/components/vc-app-switcher/vc-app-switcher.vue +90 -0
  128. package/shared/app-switcher/composables/index.ts +1 -0
  129. package/shared/app-switcher/composables/useAppSwitcher/index.ts +54 -0
  130. package/shared/app-switcher/index.ts +14 -0
  131. package/shared/assets/components/assets-details/assets-details.vue +138 -0
  132. package/shared/assets/components/index.ts +1 -0
  133. package/shared/assets/index.ts +19 -0
  134. package/shared/assets/locales/en.json +29 -0
  135. package/shared/assets/locales/index.ts +2 -0
  136. package/shared/blade-navigation/components/index.ts +1 -0
  137. package/shared/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue +84 -0
  138. package/shared/blade-navigation/composables/index.ts +1 -0
  139. package/shared/blade-navigation/composables/useBladeNavigation/index.ts +216 -0
  140. package/shared/blade-navigation/index.ts +15 -0
  141. package/shared/blade-navigation/types/index.ts +52 -0
  142. package/shared/index.ts +16 -0
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <div
3
+ class="absolute items-center justify-center flex-col z-[9998] hidden w-full h-full box-border"
4
+ :class="{
5
+ '!flex backdrop-blur-[3px] bg-[rgba(255, 255, 255, 0.5)]': active,
6
+ }"
7
+ >
8
+ <div class="relative w-[142px] h-[40px] z-[1]">
9
+ <span
10
+ class="absolute w-4 h-4 top-[12px] left-[15px] bg-[#319ed4] rounded-full translate-x-0 animate-loadingMarker"
11
+ ></span>
12
+ <div class="translate-x-0 mt-3 ml-[31px] animate-loadingMarkers">
13
+ <span
14
+ class="block float-left w-4 h-4 bg-[#319ed4] rounded-full ml-4"
15
+ v-for="item in 3"
16
+ :key="`marker_${item}`"
17
+ ></span>
18
+ </div>
19
+ </div>
20
+ </div>
21
+ </template>
22
+
23
+ <script lang="ts" setup>
24
+ defineProps({
25
+ active: {
26
+ type: Boolean,
27
+ default: false,
28
+ },
29
+ });
30
+ </script>
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Progress component.
3
+ * @author Iurii A Taranov <me@flanker72.ru>
4
+ */
5
+ import { Story } from "@storybook/vue3";
6
+ import VcProgress from "./vc-progress.vue";
7
+
8
+ export default {
9
+ title: "atoms/vc-progress",
10
+ component: VcProgress,
11
+ };
12
+
13
+ const Template: Story = (args) => ({
14
+ components: { VcProgress },
15
+ setup() {
16
+ return { args };
17
+ },
18
+ template: '<vc-progress v-bind="args"></vc-progress>',
19
+ });
20
+
21
+ export const Progress = Template.bind({});
22
+ Progress.storyName = "vc-progress";
23
+ Progress.args = {
24
+ value: 30,
25
+ };
@@ -0,0 +1,65 @@
1
+ <template>
2
+ <div
3
+ :class="[
4
+ 'vc-progress border border-[length:var(--progressbar-border-width)] border-[color:var(--progressbar-border-color)] rounded-[var(--progressbar-border-radius)] h-[var(--progressbar-height)] transition duration-200 box-border bg-[color:var(--progressbar-background-color)]',
5
+ variant,
6
+ ]"
7
+ >
8
+ <div
9
+ class="vc-progress__value bg-[color:var(--progressbar-foreground-color)] transition duration-200 h-full"
10
+ :style="`width: ${value}%`"
11
+ ></div>
12
+ </div>
13
+ </template>
14
+
15
+ <script lang="ts" setup>
16
+ defineProps({
17
+ value: {
18
+ type: Number,
19
+ default: 0,
20
+ },
21
+
22
+ variant: {
23
+ type: String,
24
+ default: "default",
25
+ enum: ["default", "striped"],
26
+ },
27
+ });
28
+ </script>
29
+
30
+ <style lang="scss">
31
+ :root {
32
+ --progressbar-height: 16px;
33
+ --progressbar-border-radius: 2px;
34
+ --progressbar-background-color: #ffffff;
35
+ --progressbar-foreground-color: #e1eff9;
36
+ --progressbar-border-width: 1px;
37
+ --progressbar-border-color: #e1eff9;
38
+ }
39
+
40
+ @keyframes change {
41
+ from {
42
+ background-position: 0 0, left;
43
+ }
44
+ to {
45
+ background-position: 30px 0, left;
46
+ }
47
+ }
48
+
49
+ .vc-progress {
50
+ &.striped {
51
+ .vc-progress__value {
52
+ background: linear-gradient(
53
+ 45deg,
54
+ transparent 50%,
55
+ #acd2f2 50%,
56
+ #acd2f2 75%,
57
+ transparent 75%
58
+ )
59
+ left/30px 30px repeat-x,
60
+ #e1f0fe;
61
+ animation: change 1s linear infinite;
62
+ }
63
+ }
64
+ }
65
+ </style>
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <div class="vc-row flex-nowrap flex items-stretch">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
6
+
7
+ <style lang="scss">
8
+ .vc-row {
9
+ .vc-app_mobile & {
10
+ display: block;
11
+ }
12
+ }
13
+ </style>
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Status component.
3
+ * @author Iurii A Taranov <me@flanker72.ru>
4
+ */
5
+ import { Story } from "@storybook/vue3";
6
+ import VcStatus from "./vc-status.vue";
7
+
8
+ export default {
9
+ title: "atoms/vc-status",
10
+ component: VcStatus,
11
+ };
12
+
13
+ const Template: Story = (args) => ({
14
+ components: { VcStatus },
15
+ setup() {
16
+ return { args };
17
+ },
18
+ template: '<vc-status v-bind="args">Status text</vc-status>',
19
+ });
20
+
21
+ export const Status = Template.bind({});
22
+ Status.storyName = "vc-status";
23
+ Status.args = {
24
+ disabled: false,
25
+ clickable: true,
26
+ };
@@ -0,0 +1,78 @@
1
+ <template>
2
+ <div
3
+ class="vc-status"
4
+ :class="[
5
+ `vc-status_${variant}`,
6
+ { 'vc-status_outline': outline },
7
+ { 'vc-status_extended': extend },
8
+ ]"
9
+ >
10
+ <slot></slot>
11
+ </div>
12
+ </template>
13
+
14
+ <script lang="ts" setup>
15
+ defineProps({
16
+ variant: {
17
+ type: String,
18
+ default: "info",
19
+ enum: ["info", "warning", "danger", "success", "light-danger"],
20
+ },
21
+
22
+ outline: {
23
+ type: Boolean,
24
+ default: true,
25
+ },
26
+
27
+ extend: {
28
+ type: Boolean,
29
+ default: false,
30
+ },
31
+ });
32
+ </script>
33
+
34
+ <style lang="scss">
35
+ :root {
36
+ --status-padding: 4px 14px;
37
+ --status-padding-extended: 12px;
38
+
39
+ --status-border-radius: 2px;
40
+ --status-border-radius-extended: 4px;
41
+ --status-border-width: 1px;
42
+
43
+ --status-info-color: #ffffff;
44
+ --status-info-main-color: #bdd1df;
45
+
46
+ --status-warning-color: #ffffff;
47
+ --status-warning-main-color: #f89406;
48
+
49
+ --status-danger-color: #ffffff;
50
+ --status-danger-main-color: #ef796f;
51
+
52
+ --status-success-color: #ffffff;
53
+ --status-success-main-color: #87b563;
54
+
55
+ --status-light-danger-color: #333333;
56
+ --status-light-danger-main-color: #ffefef;
57
+ }
58
+
59
+ $variants: info, warning, danger, success, light-danger;
60
+
61
+ .vc-status {
62
+ @apply inline-block rounded-[var(--status-border-radius)] py-1 px-3.5 text-base font-normal whitespace-nowrap;
63
+
64
+ @each $variant in $variants {
65
+ &_#{$variant} {
66
+ @apply text-[color:var(--status-#{$variant}-color)] border border-solid border-[color:var(--status-#{$variant}-main-color)] bg-[color:var(--status-#{$variant}-main-color)];
67
+
68
+ &.vc-status_outline {
69
+ @apply text-[color:var(--status-#{$variant}-main-color)] border border-solid border-[color:var(--status-#{$variant}-main-color)] bg-white;
70
+ }
71
+ }
72
+ }
73
+
74
+ &.vc-status_extended {
75
+ @apply whitespace-normal p-[var(--status-padding-extended)] rounded-[var(--status-border-radius-extended)];
76
+ }
77
+ }
78
+ </style>
@@ -0,0 +1,21 @@
1
+ <template>
2
+ <div>
3
+ <template v-if="status">
4
+ <VcIcon icon="fas fa-check-circle" class="text-[color:#87b563]"></VcIcon>
5
+ </template>
6
+ <template v-else>
7
+ <VcIcon icon="fas fa-times-circle" class="text-[color:#bdd1df]"></VcIcon>
8
+ </template>
9
+ </div>
10
+ </template>
11
+
12
+ <script lang="ts" setup>
13
+ import { VcIcon } from "@/components";
14
+
15
+ defineProps({
16
+ status: {
17
+ type: Boolean,
18
+ default: false,
19
+ },
20
+ });
21
+ </script>
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Switch component.
3
+ * @author Iurii A Taranov <me@flanker72.ru>
4
+ */
5
+ import { Story } from "@storybook/vue3";
6
+ import VcSwitch from "./vc-switch.vue";
7
+ import VcHint from "../vc-hint/vc-hint.vue";
8
+
9
+ export default {
10
+ title: "atoms/vc-switch",
11
+ component: VcSwitch,
12
+ };
13
+
14
+ const Template: Story = (args) => ({
15
+ components: { VcSwitch, VcHint },
16
+ setup() {
17
+ return { args };
18
+ },
19
+ template: '<vc-switch v-bind="args"></vc-switch>',
20
+ });
21
+
22
+ export const Switch = Template.bind({});
23
+ Switch.storyName = "vc-switch";
24
+ Switch.args = {
25
+ checked: false,
26
+ disabled: false,
27
+ };
@@ -0,0 +1,100 @@
1
+ <template>
2
+ <div>
3
+ <!-- Switch label -->
4
+ <VcLabel v-if="label" class="mb-2" :required="required">
5
+ <span>{{ label }}</span>
6
+ </VcLabel>
7
+ <div class="relative inline-block w-[54px] h-[18px]">
8
+ <label>
9
+ <input
10
+ type="checkbox"
11
+ class="vc-switch__input"
12
+ :checked="modelValue"
13
+ :disabled="disabled"
14
+ @input="onInput"
15
+ />
16
+ <span class="vc-switch__slider"></span>
17
+ </label>
18
+ <VcHint class="mt-2 w-max" v-if="tooltip">
19
+ {{ tooltip }}
20
+ </VcHint>
21
+ </div>
22
+ </div>
23
+ </template>
24
+
25
+ <script lang="ts" setup>
26
+ defineProps({
27
+ modelValue: {
28
+ type: Boolean,
29
+ default: false,
30
+ },
31
+
32
+ disabled: {
33
+ type: Boolean,
34
+ default: false,
35
+ },
36
+
37
+ tooltip: {
38
+ type: String,
39
+ default: "",
40
+ },
41
+
42
+ required: {
43
+ type: Boolean,
44
+ default: false,
45
+ },
46
+
47
+ label: {
48
+ type: String,
49
+ default: undefined,
50
+ },
51
+ });
52
+
53
+ const emit = defineEmits(["update:modelValue"]);
54
+
55
+ function onInput(e: InputEvent) {
56
+ const newValue = (e.target as HTMLInputElement).checked;
57
+ emit("update:modelValue", newValue);
58
+ }
59
+ </script>
60
+
61
+ <style lang="scss">
62
+ :root {
63
+ --switch-main-color: #43b0e6;
64
+ --switch-secondary-color: #565656;
65
+ --switch-transition: all 0.2s ease-in-out;
66
+ --switch-icon-transition: opacity 0.3s ease-in-out;
67
+ --switch-active-icon: url("data:image/svg+xml;utf8,<svg width='10' height='8' viewBox='0 0 10 8' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M3.73609 7.34288L0.161085 3.85628C-0.0536949 3.64681 -0.0536949 3.30718 0.161085 3.09769L0.938884 2.3391C1.15366 2.12961 1.50193 2.12961 1.71671 2.3391L4.125 4.68782L8.28329 0.657101C8.49807 0.447633 8.84634 0.447633 9.06112 0.657101L9.83892 1.41569C10.0537 1.62516 10.0537 1.96479 9.83892 2.17428L4.51391 7.3429C4.29911 7.55237 3.95087 7.55237 3.73609 7.34288Z' fill='white'/></svg>");
68
+ --switch-disabled-icon: url("data:image/svg+xml;utf8,<svg width='8' height='8' viewBox='0 0 8 8' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M5.51636 4L7.79068 1.72568C8.06977 1.44659 8.06977 0.994091 7.79068 0.714773L7.28523 0.209318C7.00614 -0.0697727 6.55364 -0.0697727 6.27432 0.209318L4 2.48364L1.72568 0.209318C1.44659 -0.0697727 0.994091 -0.0697727 0.714773 0.209318L0.209318 0.714773C-0.0697727 0.993864 -0.0697727 1.44636 0.209318 1.72568L2.48364 4L0.209318 6.27432C-0.0697727 6.55341 -0.0697727 7.00591 0.209318 7.28523L0.714773 7.79068C0.993864 8.06977 1.44659 8.06977 1.72568 7.79068L4 5.51636L6.27432 7.79068C6.55341 8.06977 7.00614 8.06977 7.28523 7.79068L7.79068 7.28523C8.06977 7.00614 8.06977 6.55364 7.79068 6.27432L5.51636 4Z' fill='white'/></svg>");
69
+ }
70
+
71
+ .vc-switch {
72
+ &__input {
73
+ @apply w-0 h-0 opacity-0;
74
+
75
+ &:checked + .vc-switch__slider:before {
76
+ @apply translate-x-[29px];
77
+ }
78
+
79
+ &:checked + .vc-switch__slider {
80
+ @apply bg-[color:var(--switch-main-color)] after:bg-[image:var(--switch-active-icon)] after:bg-[position:10px] after:bg-[length:10px_7px];
81
+ }
82
+
83
+ &:disabled + .vc-switch__slider {
84
+ @apply bg-[color:var(--switch-secondary-color)];
85
+ }
86
+ }
87
+
88
+ &__slider {
89
+ @apply absolute top-0 right-0 bottom-0 left-0 bg-[color:var(--switch-secondary-color)] rounded-[3px] cursor-pointer transition duration-200;
90
+
91
+ &:after {
92
+ @apply inline-block w-full h-full bg-[image:var(--switch-disabled-icon)] bg-[position:calc(100%-11px)] bg-no-repeat bg-[length:8px_8px] content-[""];
93
+ }
94
+
95
+ &:before {
96
+ @apply absolute bottom-px left-px flex justify-center items-center w-[23px] h-[16px] bg-white rounded-sm text-[color:#d2d2d2] text-[10px] transition duration-200 content-["|||"];
97
+ }
98
+ }
99
+ }
100
+ </style>
@@ -0,0 +1,85 @@
1
+ <template>
2
+ <div
3
+ class="vc-widget"
4
+ :class="{ 'vc-widget_disabled': disabled }"
5
+ @click="onClick"
6
+ >
7
+ <VcIcon
8
+ v-if="icon"
9
+ class="vc-widget__icon"
10
+ :icon="icon"
11
+ size="xxl"
12
+ ></VcIcon>
13
+ <div v-if="title" class="vc-widget__title">{{ title }}</div>
14
+ <div v-if="value !== undefined" class="vc-widget__value">{{ value }}</div>
15
+ </div>
16
+ </template>
17
+
18
+ <script lang="ts" setup>
19
+ const props = defineProps({
20
+ icon: {
21
+ type: String,
22
+ default: undefined,
23
+ },
24
+
25
+ title: {
26
+ type: String,
27
+ default: undefined,
28
+ },
29
+
30
+ value: {
31
+ type: [String, Number],
32
+ default: undefined,
33
+ },
34
+
35
+ disabled: {
36
+ type: Boolean,
37
+ default: false,
38
+ },
39
+ });
40
+ const emit = defineEmits(["click"]);
41
+
42
+ function onClick() {
43
+ if (!props.disabled) {
44
+ emit("click");
45
+ }
46
+ }
47
+ </script>
48
+
49
+ <style lang="scss">
50
+ .vc-widget {
51
+ @apply flex w-[100px] overflow-hidden p-5
52
+ box-border flex-col items-center
53
+ justify-center border-b border-solid
54
+ border-b-[#eaedf3] cursor-pointer bg-white
55
+ hover:bg-[#eff7fc];
56
+
57
+ &_disabled {
58
+ @apply cursor-default hover:bg-white;
59
+ }
60
+
61
+ &__icon {
62
+ @apply text-[#a9bfd2];
63
+ }
64
+
65
+ &_disabled &__icon {
66
+ @apply text-[#d2d4d7];
67
+ }
68
+
69
+ &__title {
70
+ @apply font-medium text-sm text-[#333333] mt-3 mb-1 mx-0;
71
+ }
72
+
73
+ &_disabled &__title {
74
+ @apply text-[#d2d4d7];
75
+ }
76
+
77
+ &__value {
78
+ @apply font-medium text-[22px] text-[#43b0e6];
79
+ }
80
+
81
+ &_disabled &__value {
82
+ @apply text-[#d2d4d7];
83
+ }
84
+ }
85
+ </style>
@@ -0,0 +1,43 @@
1
+ /* Atoms */
2
+ export { default as VcBadge } from "./atoms/vc-badge/vc-badge.vue";
3
+ export { default as VcButton } from "./atoms/vc-button/vc-button.vue";
4
+ export { default as VcCard } from "./atoms/vc-card/vc-card.vue";
5
+ export { default as VcCheckbox } from "./atoms/vc-checkbox/vc-checkbox.vue";
6
+ export { default as VcCol } from "./atoms/vc-col/vc-col.vue";
7
+ export { default as VcContainer } from "./atoms/vc-container/vc-container.vue";
8
+ export { default as VcHint } from "./atoms/vc-hint/vc-hint.vue";
9
+ export { default as VcIcon } from "./atoms/vc-icon/vc-icon.vue";
10
+ export { default as VcInfoRow } from "./atoms/vc-info-row/vc-info-row.vue";
11
+ export { default as VcImage } from "./atoms/vc-image/vc-image.vue";
12
+ export { default as VcLabel } from "./atoms/vc-label/vc-label.vue";
13
+ export { default as VcLink } from "./atoms/vc-link/vc-link.vue";
14
+ export { default as VcLoading } from "./atoms/vc-loading/vc-loading.vue";
15
+ export { default as VcProgress } from "./atoms/vc-progress/vc-progress.vue";
16
+ export { default as VcRow } from "./atoms/vc-row/vc-row.vue";
17
+ export { default as VcStatus } from "./atoms/vc-status/vc-status.vue";
18
+ export { default as VcStatusIcon } from "./atoms/vc-status-icon/vc-status-icon.vue";
19
+ export { default as VcSwitch } from "./atoms/vc-switch/vc-switch.vue";
20
+ export { default as VcWidget } from "./atoms/vc-widget/vc-widget.vue";
21
+
22
+ /* Molecules */
23
+ export { default as VcBreadcrumbs } from "./molecules/vc-breadcrumbs/vc-breadcrumbs.vue";
24
+ export { default as VcEditor } from "./molecules/vc-editor/vc-editor.vue";
25
+ export { default as VcForm } from "./molecules/vc-form/vc-form.vue";
26
+ export { default as VcFileUpload } from "./molecules/vc-file-upload/vc-file-upload.vue";
27
+ export { default as VcInput } from "./molecules/vc-input/vc-input.vue";
28
+ export { default as VcMultivalue } from "./molecules/vc-multivalue/vc-multivalue.vue";
29
+ export { default as VcNotification } from "./molecules/vc-notification/vc-notification.vue";
30
+ export { default as VcPagination } from "./molecules/vc-pagination/vc-pagination.vue";
31
+ export { default as VcRating } from "./molecules/vc-rating/vc-rating.vue";
32
+ export { default as VcSelect } from "./molecules/vc-select/vc-select.vue";
33
+ export { default as VcSlider } from "./molecules/vc-slider/vc-slider.vue";
34
+ export { default as VcTextarea } from "./molecules/vc-textarea/vc-textarea.vue";
35
+
36
+ /* Organisms */
37
+ export { default as VcApp } from "./organisms/vc-app/vc-app.vue";
38
+ export { default as VcBlade } from "./organisms/vc-blade/vc-blade.vue";
39
+ export { default as VcDynamicProperty } from "./organisms/vc-dynamic-property/vc-dynamic-property.vue";
40
+ export { default as VcGallery } from "./organisms/vc-gallery/vc-gallery.vue";
41
+ export { default as VcLoginForm } from "./organisms/vc-login-form/vc-login-form.vue";
42
+ export { default as VcPopup } from "./organisms/vc-popup/vc-popup.vue";
43
+ export { default as VcTable } from "./organisms/vc-table/vc-table.vue";
@@ -0,0 +1,103 @@
1
+ <template>
2
+ <div
3
+ class="vc-breadcrumbs-item"
4
+ :class="{
5
+ 'vc-breadcrumbs-item_current': current,
6
+ }"
7
+ @click="onClick"
8
+ >
9
+ <VcIcon
10
+ v-if="icon"
11
+ class="vc-breadcrumbs-item__icon"
12
+ :icon="icon"
13
+ size="s"
14
+ />
15
+ <div class="vc-breadcrumbs-item__title">
16
+ {{ title }}
17
+ </div>
18
+ </div>
19
+ </template>
20
+
21
+ <script lang="ts" setup>
22
+ import { VcIcon } from "@/components";
23
+
24
+ const props = defineProps({
25
+ current: {
26
+ type: Boolean,
27
+ default: false,
28
+ },
29
+
30
+ icon: {
31
+ type: String,
32
+ default: undefined,
33
+ },
34
+
35
+ title: {
36
+ type: String,
37
+ default: undefined,
38
+ },
39
+
40
+ clickHandler: {
41
+ type: Function,
42
+ default: undefined,
43
+ },
44
+
45
+ id: {
46
+ type: String,
47
+ default: undefined,
48
+ },
49
+ });
50
+
51
+ const emit = defineEmits(["click"]);
52
+
53
+ function onClick(): void {
54
+ if (!props.current) {
55
+ if (props.clickHandler && typeof props.clickHandler === "function") {
56
+ props.clickHandler(props.id);
57
+ } else {
58
+ emit("click");
59
+ }
60
+ }
61
+ }
62
+ </script>
63
+
64
+ <style lang="scss">
65
+ :root {
66
+ --breadcrumbs-item-height: 28px;
67
+ --breadcrumbs-item-border-color: #a1c0d4;
68
+ --breadcrumbs-item-border-color-hover: #8fb0c6;
69
+ --breadcrumbs-item-border-color-current: #838d9a;
70
+ --breadcrumbs-item-color: #43b0e6;
71
+ --breadcrumbs-item-color-current: #465769;
72
+ --breadcrumbs-item-icon-color: #a1c0d4;
73
+ }
74
+
75
+ .vc-breadcrumbs-item {
76
+ @apply h-[var(--breadcrumbs-item-height)]
77
+ box-border rounded-[calc(var(--breadcrumbs-item-height)/2)]
78
+ border border-solid
79
+ border-[color:var(--breadcrumbs-item-border-color)]
80
+ text-[color:var(--breadcrumbs-item-color)]
81
+ whitespace-nowrap
82
+ px-3 mr-2
83
+ text-sm cursor-pointer inline-flex items-center
84
+ hover:border
85
+ hover:border-solid
86
+ hover:border-[color:var(--breadcrumbs-item-border-color-hover)];
87
+
88
+ &__icon {
89
+ @apply mr-2 text-[color:var(--breadcrumbs-item-icon-color)];
90
+ }
91
+
92
+ &_disabled {
93
+ @apply opacity-[0.4];
94
+ }
95
+
96
+ &_current,
97
+ &_current:hover {
98
+ @apply text-[color:var(--breadcrumbs-item-color-current)]
99
+ border border-solid border-[color:var(--breadcrumbs-item-border-color-current)]
100
+ cursor-default mr-0;
101
+ }
102
+ }
103
+ </style>
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Breadcrumbs component.
3
+ * @author Iurii A Taranov <me@flanker72.ru>
4
+ */
5
+ import { Story } from "@storybook/vue3";
6
+ import VcBreadcrumbs from "./vc-breadcrumbs.vue";
7
+
8
+ export default {
9
+ title: "molecules/vc-breadcrumbs",
10
+ component: VcBreadcrumbs,
11
+ };
12
+
13
+ const Template: Story = (args) => ({
14
+ components: { VcBreadcrumbs },
15
+ setup() {
16
+ return { args };
17
+ },
18
+ template: '<vc-breadcrumbs v-bind="args"></vc-breadcrumbs>',
19
+ });
20
+
21
+ export const Breadcrumbs = Template.bind({});
22
+ Breadcrumbs.storyName = "vc-breadcrumbs";
23
+ Breadcrumbs.args = {
24
+ items: [
25
+ {
26
+ id: 0,
27
+ title: "Back",
28
+ icon: "fas fa-arrow-left",
29
+ },
30
+ {
31
+ id: 1,
32
+ title: "Electronics",
33
+ },
34
+ {
35
+ id: 2,
36
+ title: "Desktop",
37
+ },
38
+ ],
39
+ };
@@ -0,0 +1,21 @@
1
+ <template>
2
+ <div v-if="items" class="flex items-center flex-nowrap">
3
+ <VcBreadcrumbsItem
4
+ v-for="(item, i) in items"
5
+ :key="item.id"
6
+ v-bind="item"
7
+ :current="i === items.length - 1"
8
+ />
9
+ </div>
10
+ </template>
11
+
12
+ <script lang="ts" setup>
13
+ import VcBreadcrumbsItem from "./_internal/vc-breadcrumbs-item/vc-breadcrumbs-item.vue";
14
+
15
+ defineProps({
16
+ items: {
17
+ type: Array,
18
+ default: () => [],
19
+ },
20
+ });
21
+ </script>