@vc-shell/framework 1.0.181 → 1.0.183

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 (149) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/framework.js +5196 -5182
  3. package/dist/index.css +1 -1
  4. package/dist/shared/components/popup-handler/components/vc-popup-container/vc-popup-container.vue.d.ts.map +1 -1
  5. package/dist/shared/components/popup-handler/composables/usePopup/index.d.ts.map +1 -1
  6. package/dist/tailwind.config.d.ts +1 -2
  7. package/dist/tailwind.config.d.ts.map +1 -1
  8. package/dist/tsconfig.tsbuildinfo +1 -1
  9. package/dist/ui/components/atoms/vc-badge/index.d.ts +1 -79
  10. package/dist/ui/components/atoms/vc-badge/index.d.ts.map +1 -1
  11. package/dist/ui/components/atoms/vc-badge/vc-badge.stories.d.ts +389 -6
  12. package/dist/ui/components/atoms/vc-badge/vc-badge.stories.d.ts.map +1 -1
  13. package/dist/ui/components/atoms/vc-button/vc-button.stories.d.ts +2295 -5
  14. package/dist/ui/components/atoms/vc-button/vc-button.stories.d.ts.map +1 -1
  15. package/dist/ui/components/atoms/vc-card/vc-card.stories.d.ts +1119 -5
  16. package/dist/ui/components/atoms/vc-card/vc-card.stories.d.ts.map +1 -1
  17. package/dist/ui/components/atoms/vc-checkbox/vc-checkbox.stories.d.ts +1778 -5
  18. package/dist/ui/components/atoms/vc-checkbox/vc-checkbox.stories.d.ts.map +1 -1
  19. package/dist/ui/components/atoms/vc-col/vc-col.stories.d.ts +51 -5
  20. package/dist/ui/components/atoms/vc-col/vc-col.stories.d.ts.map +1 -1
  21. package/dist/ui/components/atoms/vc-hint/vc-hint.stories.d.ts +37 -5
  22. package/dist/ui/components/atoms/vc-hint/vc-hint.stories.d.ts.map +1 -1
  23. package/dist/ui/components/atoms/vc-icon/vc-icon.stories.d.ts +62 -5
  24. package/dist/ui/components/atoms/vc-icon/vc-icon.stories.d.ts.map +1 -1
  25. package/dist/ui/components/atoms/vc-image/vc-image.stories.d.ts +103 -5
  26. package/dist/ui/components/atoms/vc-image/vc-image.stories.d.ts.map +1 -1
  27. package/dist/ui/components/atoms/vc-label/vc-label.stories.d.ts +101 -5
  28. package/dist/ui/components/atoms/vc-label/vc-label.stories.d.ts.map +1 -1
  29. package/dist/ui/components/atoms/vc-link/vc-link.stories.d.ts +103 -5
  30. package/dist/ui/components/atoms/vc-link/vc-link.stories.d.ts.map +1 -1
  31. package/dist/ui/components/atoms/vc-loading/vc-loading.stories.d.ts +18 -5
  32. package/dist/ui/components/atoms/vc-loading/vc-loading.stories.d.ts.map +1 -1
  33. package/dist/ui/components/atoms/vc-progress/vc-progress.stories.d.ts +85 -5
  34. package/dist/ui/components/atoms/vc-progress/vc-progress.stories.d.ts.map +1 -1
  35. package/dist/ui/components/atoms/vc-row/vc-row.stories.d.ts +25 -5
  36. package/dist/ui/components/atoms/vc-row/vc-row.stories.d.ts.map +1 -1
  37. package/dist/ui/components/atoms/vc-status/vc-status.stories.d.ts +116 -5
  38. package/dist/ui/components/atoms/vc-status/vc-status.stories.d.ts.map +1 -1
  39. package/dist/ui/components/atoms/vc-switch/vc-switch.stories.d.ts +53 -5
  40. package/dist/ui/components/atoms/vc-switch/vc-switch.stories.d.ts.map +1 -1
  41. package/dist/ui/components/atoms/vc-video/vc-video.stories.d.ts +59 -0
  42. package/dist/ui/components/atoms/vc-video/vc-video.stories.d.ts.map +1 -0
  43. package/dist/ui/components/atoms/vc-widget/vc-widget.stories.d.ts +42 -5
  44. package/dist/ui/components/atoms/vc-widget/vc-widget.stories.d.ts.map +1 -1
  45. package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.stories.d.ts +40 -5
  46. package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.stories.d.ts.map +1 -1
  47. package/dist/ui/components/molecules/vc-editor/vc-editor.stories.d.ts +179 -5
  48. package/dist/ui/components/molecules/vc-editor/vc-editor.stories.d.ts.map +1 -1
  49. package/dist/ui/components/molecules/vc-field/vc-field.stories.d.ts +12 -0
  50. package/dist/ui/components/molecules/vc-field/vc-field.stories.d.ts.map +1 -0
  51. package/dist/ui/components/molecules/vc-file-upload/index.d.ts +19 -0
  52. package/dist/ui/components/molecules/vc-file-upload/index.d.ts.map +1 -1
  53. package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.stories.d.ts +182 -5
  54. package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.stories.d.ts.map +1 -1
  55. package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts +4 -0
  56. package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts.map +1 -1
  57. package/dist/ui/components/molecules/vc-form/vc-form.stories.d.ts +29 -5
  58. package/dist/ui/components/molecules/vc-form/vc-form.stories.d.ts.map +1 -1
  59. package/dist/ui/components/molecules/vc-input/vc-input.stories.d.ts +347 -5
  60. package/dist/ui/components/molecules/vc-input/vc-input.stories.d.ts.map +1 -1
  61. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.stories.d.ts +354 -5
  62. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.stories.d.ts.map +1 -1
  63. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.stories.d.ts +889 -0
  64. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.stories.d.ts.map +1 -0
  65. package/dist/ui/components/molecules/vc-pagination/vc-pagination.stories.d.ts +74 -5
  66. package/dist/ui/components/molecules/vc-pagination/vc-pagination.stories.d.ts.map +1 -1
  67. package/dist/ui/components/molecules/vc-rating/vc-rating.stories.d.ts +498 -5
  68. package/dist/ui/components/molecules/vc-rating/vc-rating.stories.d.ts.map +1 -1
  69. package/dist/ui/components/molecules/vc-select/vc-select.stories.d.ts +2567 -5
  70. package/dist/ui/components/molecules/vc-select/vc-select.stories.d.ts.map +1 -1
  71. package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts.map +1 -1
  72. package/dist/ui/components/molecules/vc-slider/vc-slider.stories.d.ts +156 -5
  73. package/dist/ui/components/molecules/vc-slider/vc-slider.stories.d.ts.map +1 -1
  74. package/dist/ui/components/molecules/vc-textarea/vc-textarea.stories.d.ts +1297 -5
  75. package/dist/ui/components/molecules/vc-textarea/vc-textarea.stories.d.ts.map +1 -1
  76. package/dist/ui/components/organisms/vc-app/vc-app.stories.d.ts +276 -5
  77. package/dist/ui/components/organisms/vc-app/vc-app.stories.d.ts.map +1 -1
  78. package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts +82 -3
  79. package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
  80. package/dist/ui/components/organisms/vc-blade/index.d.ts +1 -179
  81. package/dist/ui/components/organisms/vc-blade/index.d.ts.map +1 -1
  82. package/dist/ui/components/organisms/vc-blade/vc-blade.stories.d.ts +209 -5
  83. package/dist/ui/components/organisms/vc-blade/vc-blade.stories.d.ts.map +1 -1
  84. package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts +6 -3
  85. package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
  86. package/dist/ui/components/organisms/vc-gallery/vc-gallery.stories.d.ts +155 -6
  87. package/dist/ui/components/organisms/vc-gallery/vc-gallery.stories.d.ts.map +1 -1
  88. package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts +0 -4
  89. package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts.map +1 -1
  90. package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts +13 -8
  91. package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts.map +1 -1
  92. package/dist/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue.d.ts.map +1 -1
  93. package/dist/ui/components/organisms/vc-table/vc-table.stories.d.ts +1272 -5
  94. package/dist/ui/components/organisms/vc-table/vc-table.stories.d.ts.map +1 -1
  95. package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
  96. package/package.json +6 -5
  97. package/shared/components/popup-handler/components/vc-popup-container/vc-popup-container.vue +1 -0
  98. package/shared/components/popup-handler/composables/usePopup/index.ts +8 -7
  99. package/tailwind.config.ts +2 -46
  100. package/ui/components/atoms/vc-badge/index.ts +1 -13
  101. package/ui/components/atoms/vc-badge/vc-badge.stories.ts +48 -20
  102. package/ui/components/atoms/vc-button/vc-button.stories.ts +111 -19
  103. package/ui/components/atoms/vc-card/vc-card.stories.ts +96 -18
  104. package/ui/components/atoms/vc-checkbox/vc-checkbox.stories.ts +75 -16
  105. package/ui/components/atoms/vc-col/vc-col.stories.ts +16 -17
  106. package/ui/components/atoms/vc-hint/vc-hint.stories.ts +18 -16
  107. package/ui/components/atoms/vc-icon/vc-icon.stories.ts +57 -16
  108. package/ui/components/atoms/vc-image/vc-image.stories.ts +72 -24
  109. package/ui/components/atoms/vc-label/vc-label.stories.ts +26 -16
  110. package/ui/components/atoms/vc-link/vc-link.stories.ts +29 -16
  111. package/ui/components/atoms/vc-loading/vc-loading.stories.ts +11 -16
  112. package/ui/components/atoms/vc-progress/vc-progress.stories.ts +22 -16
  113. package/ui/components/atoms/vc-row/vc-row.stories.ts +14 -17
  114. package/ui/components/atoms/vc-status/vc-status.stories.ts +78 -16
  115. package/ui/components/atoms/vc-switch/vc-switch.stories.ts +18 -16
  116. package/ui/components/atoms/vc-video/vc-video.stories.ts +33 -0
  117. package/ui/components/atoms/vc-widget/vc-widget.stories.ts +13 -17
  118. package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.stories.ts +22 -19
  119. package/ui/components/molecules/vc-editor/vc-editor.stories.ts +24 -16
  120. package/ui/components/molecules/vc-field/vc-field.stories.ts +114 -0
  121. package/ui/components/molecules/vc-file-upload/vc-file-upload.stories.ts +34 -16
  122. package/ui/components/molecules/vc-file-upload/vc-file-upload.vue +3 -1
  123. package/ui/components/molecules/vc-form/vc-form.stories.ts +20 -16
  124. package/ui/components/molecules/vc-input/vc-input.stories.ts +144 -14
  125. package/ui/components/molecules/vc-input-currency/vc-input-currency.stories.ts +61 -18
  126. package/ui/components/molecules/vc-multivalue/vc-multivalue.stories.ts +120 -0
  127. package/ui/components/molecules/vc-pagination/vc-pagination.stories.ts +17 -14
  128. package/ui/components/molecules/vc-rating/vc-rating.stories.ts +51 -15
  129. package/ui/components/molecules/vc-select/vc-select.stories.ts +605 -29
  130. package/ui/components/molecules/vc-select/vc-select.vue +0 -4
  131. package/ui/components/molecules/vc-slider/vc-slider.stories.ts +34 -21
  132. package/ui/components/molecules/vc-textarea/vc-textarea.stories.ts +46 -14
  133. package/ui/components/organisms/vc-app/vc-app.stories.ts +204 -51
  134. package/ui/components/organisms/vc-app/vc-app.vue +31 -24
  135. package/ui/components/organisms/vc-blade/index.ts +1 -11
  136. package/ui/components/organisms/vc-blade/vc-blade.stories.ts +60 -16
  137. package/ui/components/organisms/vc-blade/vc-blade.vue +7 -2
  138. package/ui/components/organisms/vc-gallery/vc-gallery.stories.ts +68 -24
  139. package/ui/components/organisms/vc-gallery/vc-gallery.vue +7 -6
  140. package/ui/components/organisms/vc-popup/vc-popup.vue +7 -1
  141. package/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue +1 -0
  142. package/ui/components/organisms/vc-table/vc-table.stories.ts +144 -30
  143. package/ui/components/organisms/vc-table/vc-table.vue +13 -7
  144. package/dist/ui/components/organisms/vc-login-form/vc-login-form.stories.d.ts +0 -7
  145. package/dist/ui/components/organisms/vc-login-form/vc-login-form.stories.d.ts.map +0 -1
  146. package/dist/ui/components/organisms/vc-popup/vc-popup.stories.d.ts +0 -7
  147. package/dist/ui/components/organisms/vc-popup/vc-popup.stories.d.ts.map +0 -1
  148. package/ui/components/organisms/vc-login-form/vc-login-form.stories.ts +0 -52
  149. package/ui/components/organisms/vc-popup/vc-popup.stories.ts +0 -21
@@ -1,47 +1,91 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3";
1
+ import type { Meta, StoryFn } from "@storybook/vue3";
2
2
  import { VcGallery } from "./";
3
3
  import VcGalleryItem from "./_internal/vc-gallery-item/vc-gallery-item.vue";
4
4
  import VcGalleryPreview from "./_internal/vc-gallery-preview/vc-gallery-preview.vue";
5
5
  import { VcLabel, VcFileUpload, VcHint } from "./../../";
6
6
 
7
- const meta: Meta<typeof VcGallery> = {
7
+ export default {
8
8
  title: "organisms/VcGallery",
9
9
  component: VcGallery,
10
- };
11
-
12
- export default meta;
13
- type Story = StoryObj<typeof VcGallery>;
14
-
15
- export const Primary: Story = {
16
- render: (args) => ({
17
- components: {
18
- VcGallery,
19
- VcGalleryItem,
20
- VcGalleryPreview,
21
- VcLabel,
22
- VcFileUpload,
23
- VcHint,
24
- },
25
- setup() {
26
- return { args };
27
- },
28
- template: '<div class="tw-flex tw-h-[400px] tw-overflow-hidden"><vc-gallery v-bind="args"></vc-gallery></div>',
29
- }),
30
10
  args: {
31
11
  images: [
32
12
  {
33
13
  title: "Title",
34
14
  name: "Name",
35
- url: "https://placekitten.com/800/600",
15
+ url: "https://picsum.photos/200",
36
16
  sortOrder: 0,
37
17
  },
38
18
  {
39
19
  title: "Title",
40
20
  name: "Name",
41
- url: "https://placekitten.com/800/600",
21
+ url: "https://picsum.photos/200",
42
22
  sortOrder: 1,
43
23
  },
44
24
  ],
45
25
  variant: "gallery",
46
26
  },
27
+ argTypes: {
28
+ variant: {
29
+ control: "radio",
30
+ options: ["gallery", "file-upload"],
31
+ },
32
+ },
33
+ } satisfies Meta<typeof VcGallery>;
34
+
35
+ export const Primary: StoryFn = (args) => ({
36
+ components: {
37
+ VcGallery,
38
+ VcGalleryItem,
39
+ VcGalleryPreview,
40
+ VcLabel,
41
+ VcFileUpload,
42
+ VcHint,
43
+ },
44
+ setup() {
45
+ return { args };
46
+ },
47
+ template: '<div class="tw-flex tw-h-[400px] tw-overflow-hidden"><vc-gallery v-bind="args"></vc-gallery></div>',
48
+ });
49
+
50
+ export const Label = Primary.bind({});
51
+ Label.args = {
52
+ label: "Gallery",
53
+ };
54
+
55
+ export const Disabled = Primary.bind({});
56
+ Disabled.args = {
57
+ disabled: true,
58
+ };
59
+
60
+ export const Required = Primary.bind({});
61
+ Required.args = {
62
+ label: "Gallery",
63
+ required: true,
64
+ };
65
+
66
+ export const Tooltip = Primary.bind({});
67
+ Tooltip.args = {
68
+ label: "Gallery",
69
+ tooltip: "Tooltip",
70
+ };
71
+
72
+ export const FileUploading = Primary.bind({});
73
+ FileUploading.args = {
74
+ label: "Gallery",
75
+ loading: true,
76
+ };
77
+
78
+ export const SingleFileUpload = Primary.bind({});
79
+ SingleFileUpload.args = {
80
+ label: "Gallery",
81
+ images: [],
82
+ variant: "file-upload",
83
+ };
84
+
85
+ export const SingleFileUploadWithCustomUploadIcon = Primary.bind({});
86
+ SingleFileUploadWithCustomUploadIcon.args = {
87
+ label: "Gallery",
88
+ images: [],
89
+ variant: "file-upload",
90
+ uploadIcon: "fas fa-user",
47
91
  };
@@ -2,11 +2,14 @@
2
2
  <div class="vc-gallery">
3
3
  <VcLabel
4
4
  v-if="label"
5
- :tooltip="tooltip"
6
5
  :required="required"
7
- :tooltip-icon="tooltipIcon"
8
6
  >
9
- {{ label }}
7
+ <span>{{ label }}</span>
8
+ <template
9
+ v-if="tooltip"
10
+ #tooltip
11
+ >{{ tooltip }}</template
12
+ >
10
13
  </VcLabel>
11
14
 
12
15
  <template v-if="(defaultImages && defaultImages.length) || !disabled">
@@ -74,7 +77,6 @@ export interface Props {
74
77
  required?: boolean;
75
78
  label?: string;
76
79
  tooltip?: string;
77
- tooltipIcon?: string;
78
80
  uploadIcon?: string;
79
81
  multiple?: boolean;
80
82
  variant?: "gallery" | "file-upload";
@@ -98,8 +100,7 @@ export interface Emits {
98
100
 
99
101
  const props = withDefaults(defineProps<Props>(), {
100
102
  images: () => [],
101
- tooltipIcon: "fas fa-info",
102
- uploadIcon: "fas fa-upload",
103
+ uploadIcon: "fas fa-cloud-upload-alt",
103
104
  variant: "gallery",
104
105
  itemActions: () => ({
105
106
  preview: true,
@@ -126,7 +126,7 @@ import { TransitionRoot, TransitionChild, Dialog, DialogPanel, DialogTitle } fro
126
126
  interface Props {
127
127
  title?: string;
128
128
  closable?: boolean;
129
- variant: "default" | "error" | "warning" | "success";
129
+ variant?: "default" | "error" | "warning" | "success";
130
130
  isMobileFullscreen?: boolean;
131
131
  isFullscreen?: boolean;
132
132
  modalWidth?: string;
@@ -144,6 +144,12 @@ const props = withDefaults(defineProps<Props>(), {
144
144
 
145
145
  const emit = defineEmits<Emits>();
146
146
 
147
+ defineSlots<{
148
+ header: void;
149
+ content: void;
150
+ footer: (props: { close: () => void }) => void;
151
+ }>();
152
+
147
153
  const isMobile = inject("isMobile") as Ref<boolean>;
148
154
 
149
155
  const icon = computed(() => {
@@ -133,6 +133,7 @@ export interface Props {
133
133
 
134
134
  const props = defineProps<Props>();
135
135
 
136
+ // TODO fix on russian locale
136
137
  const locale = window.navigator.language;
137
138
  const value = computed((): unknown => {
138
139
  return (props.cell.field || props.cell.id).split(".").reduce((p: { [x: string]: unknown }, c: string) => {
@@ -1,36 +1,14 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3";
2
-
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import type { Meta, StoryFn } from "@storybook/vue3";
3
3
  import { VcTable } from "./";
4
- // import VcHint from "../../atoms/vc-hint/vc-hint.vue";
5
- // import VcImage from "../../atoms/vc-image/vc-image.vue";
4
+ import VcHint from "../../atoms/vc-hint/vc-hint.vue";
5
+ import VcImage from "../../atoms/vc-image/vc-image.vue";
6
+ import { ref, unref } from "vue";
6
7
 
7
- const meta: Meta<typeof VcTable> = {
8
+ export default {
8
9
  title: "organisms/VcTable",
9
- // component: VcTable,
10
- };
11
-
12
- export default meta;
13
- type Story = StoryObj<typeof VcTable>;
14
-
15
- export const Primary: Story = {
16
- render: (args) => ({
17
- // components: { VcTable, VcHint, VcImage },
18
- setup() {
19
- return { args };
20
- },
21
- template: `
22
- <div class= "tw-flex tw-h-[400px] tw-overflow-hidden">
23
- <vc-table v-bind="args">
24
- <template v-slot:item_name="itemData">
25
- <div class= "tw-flex tw-flex-col">
26
- <div>{{ itemData.item.name }}</div>
27
- <vc-hint>{{ itemData.item.description }}</vc-hint>
28
- </div>
29
- </template>
30
- </vc-table>
31
- </div>
32
- `,
33
- }),
10
+ component: VcTable as Record<keyof typeof VcTable, unknown>,
11
+ decorators: [() => ({ template: '<div class="tw-flex tw-h-[400px] tw-overflow-hidden"><story/></div>' })],
34
12
  args: {
35
13
  multiselect: true,
36
14
  stateKey: "storybook_table",
@@ -93,4 +71,140 @@ export const Primary: Story = {
93
71
  },
94
72
  ],
95
73
  },
74
+ } satisfies Meta<typeof VcTable>;
75
+
76
+ export const Primary: StoryFn<typeof VcTable> = (args) => ({
77
+ components: { VcTable, VcHint, VcImage } as Record<keyof typeof VcTable, unknown>,
78
+ setup() {
79
+ return { args };
80
+ },
81
+ template: `
82
+ <vc-table v-bind="args">
83
+ <template v-slot:item_name="itemData">
84
+ <div class= "tw-flex tw-flex-col">
85
+ <div>{{ itemData.item.name }}</div>
86
+ <vc-hint>{{ itemData.item.description }}</vc-hint>
87
+ </div>
88
+ </template>
89
+ </vc-table>
90
+ `,
91
+ });
92
+
93
+ export const Loading = Primary.bind({});
94
+ Loading.args = {
95
+ loading: true,
96
+ };
97
+
98
+ export const WithoutHeader = Primary.bind({});
99
+ WithoutHeader.args = {
100
+ header: false,
101
+ };
102
+
103
+ export const WithoutFooter = Primary.bind({});
104
+ WithoutFooter.args = {
105
+ footer: false,
106
+ };
107
+
108
+ export const DisabledColumnsResizing = Primary.bind({});
109
+ DisabledColumnsResizing.args = {
110
+ resizableColumns: false,
111
+ };
112
+
113
+ export const DisabledColumnsReordering = Primary.bind({});
114
+ DisabledColumnsReordering.args = {
115
+ reorderableColumns: false,
96
116
  };
117
+
118
+ export const WithReorderableRows: StoryFn<typeof VcTable> = (args) => ({
119
+ components: { VcTable, VcHint, VcImage } as Record<keyof typeof VcTable, unknown>,
120
+ setup() {
121
+ const items = ref([
122
+ {
123
+ id: "1",
124
+ img: "/images/1.jpg",
125
+ name: "Lenovo IdeaCentre 310S-08",
126
+ description: "Physical",
127
+ sku: "990555005",
128
+ },
129
+ {
130
+ id: "2",
131
+ img: "/images/2.jpg",
132
+ name: "BLU Win HD LTE X150Q 8GB",
133
+ description: "Physical",
134
+ sku: "003578948",
135
+ },
136
+ {
137
+ id: "3",
138
+ img: "/images/3.jpg",
139
+ name: "Samsung Galaxy S6 SM-G920F 32GB",
140
+ description: "Physical",
141
+ sku: "334590-095",
142
+ },
143
+ {
144
+ id: "4",
145
+ img: "/images/4.jpg",
146
+ name: "DJI Phantom 3 Professional Quadcopter",
147
+ description: "Physical",
148
+ sku: "000545432",
149
+ },
150
+ {
151
+ id: "5",
152
+ img: "/images/5.jpg",
153
+ name: "3DR X8-M Octocopter for Visual-Spectr",
154
+ description: "Physical",
155
+ sku: "435344443",
156
+ },
157
+ ]);
158
+ const itemsProxy = ref(items.value);
159
+
160
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
161
+ function sortRows(event: { dragIndex: number; dropIndex: number; value: any[] }) {
162
+ if (event.dragIndex !== event.dropIndex) {
163
+ const sorted = event.value.map((item, index) => {
164
+ item.sortOrder = index;
165
+ return item;
166
+ });
167
+
168
+ itemsProxy.value = sorted;
169
+ }
170
+ }
171
+ return { args, itemsProxy, sortRows };
172
+ },
173
+ template: `
174
+
175
+ <vc-table v-bind="args" reorderableRows :items="itemsProxy" @row:reorder="sortRows">
176
+ <template v-slot:item_name="itemData">
177
+ <div class= "tw-flex tw-flex-col">
178
+ <div>{{ itemData.item.name }}</div>
179
+ <vc-hint>{{ itemData.item.description }}</vc-hint>
180
+ </div>
181
+ </template>
182
+ </vc-table>
183
+
184
+ `,
185
+ });
186
+
187
+ export const SelectAllItems: StoryFn<typeof VcTable> = (args) => ({
188
+ components: { VcTable, VcHint, VcImage } as Record<keyof typeof VcTable, unknown>,
189
+ setup() {
190
+ const selectedIds = ref();
191
+ const onSelectionChanged = (i: any) => {
192
+ const item = unref(i)
193
+ .map((item: any) => item.id)
194
+ .filter((x: any): x is string => x !== null);
195
+
196
+ selectedIds.value = item;
197
+ };
198
+ return { args, onSelectionChanged, pages: 2 };
199
+ },
200
+ template: `
201
+ <vc-table v-bind="args" select-all @selection-changed="onSelectionChanged" :pages="pages">
202
+ <template v-slot:item_name="itemData">
203
+ <div class= "tw-flex tw-flex-col">
204
+ <div>{{ itemData.item.name }}</div>
205
+ <vc-hint>{{ itemData.item.description }}</vc-hint>
206
+ </div>
207
+ </template>
208
+ </vc-table>
209
+ `,
210
+ });
@@ -174,7 +174,10 @@
174
174
  </div>
175
175
  </div>
176
176
  <div
177
- class="tw-w-3 tw-top-0 tw-bottom-0 tw-cursor-col-resize tw-absolute tw-right-0 tw-flex tw-justify-end"
177
+ class="tw-w-3 tw-top-0 tw-bottom-0 tw-absolute tw-right-0 tw-flex tw-justify-end"
178
+ :class="{
179
+ 'tw-cursor-col-resize': props.resizableColumns,
180
+ }"
178
181
  @mousedown="handleMouseDown($event, item)"
179
182
  >
180
183
  <div class="tw-w-px tw-bg-[#e5e7eb] tw-h-full"></div>
@@ -818,12 +821,14 @@ function handleHeaderClick(item: ITableColumns) {
818
821
  }
819
822
 
820
823
  function handleMouseDown(e: MouseEvent, item: ITableColumns) {
821
- const containerLeft = getOffset(table.value as HTMLElement).left;
822
- resizeColumnElement.value = item;
823
- columnResizing.value = true;
824
- lastResize.value = e.pageX - containerLeft + table.value.scrollLeft;
824
+ if (props.resizableColumns) {
825
+ const containerLeft = getOffset(table.value as HTMLElement).left;
826
+ resizeColumnElement.value = item;
827
+ columnResizing.value = true;
828
+ lastResize.value = e.pageX - containerLeft + table.value.scrollLeft;
825
829
 
826
- bindColumnResizeEvents();
830
+ bindColumnResizeEvents();
831
+ }
827
832
  }
828
833
 
829
834
  function bindColumnResizeEvents() {
@@ -975,7 +980,8 @@ function onColumnHeaderDragOver(event: DragEvent) {
975
980
  }
976
981
  }
977
982
  }
978
-
983
+ // TODO column width fix
984
+ // TODO tootip on date date ago full time on hover
979
985
  function onColumnHeaderDragLeave(event: DragEvent) {
980
986
  if (props.reorderableColumns && draggedColumn.value) {
981
987
  event.preventDefault();
@@ -1,7 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3";
2
- import { VcLoginForm } from "./";
3
- declare const meta: Meta<typeof VcLoginForm>;
4
- export default meta;
5
- type Story = StoryObj<typeof VcLoginForm>;
6
- export declare const Primary: Story;
7
- //# sourceMappingURL=vc-login-form.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vc-login-form.stories.d.ts","sourceRoot":"","sources":["../../../../../ui/components/organisms/vc-login-form/vc-login-form.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAGjC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAGlC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAC;AAE1C,eAAO,MAAM,OAAO,EAAE,KAuCrB,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3";
2
- import { VcPopup } from "./";
3
- declare const meta: Meta<typeof VcPopup>;
4
- export default meta;
5
- type Story = StoryObj<typeof VcPopup>;
6
- export declare const Primary: Story;
7
- //# sourceMappingURL=vc-popup.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vc-popup.stories.d.ts","sourceRoot":"","sources":["../../../../../ui/components/organisms/vc-popup/vc-popup.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAE7B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,CAG9B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,OAAO,CAAC,CAAC;AAEtC,eAAO,MAAM,OAAO,EAAE,KASrB,CAAC"}
@@ -1,52 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3";
2
- import { VcLoginForm } from "./";
3
- import { VcInput, VcButton } from "./../../";
4
-
5
- const meta: Meta<typeof VcLoginForm> = {
6
- title: "organisms/VcLoginForm",
7
- component: VcLoginForm,
8
- };
9
-
10
- export default meta;
11
- type Story = StoryObj<typeof VcLoginForm>;
12
-
13
- export const Primary: Story = {
14
- render: (args) => ({
15
- components: { VcLoginForm, VcInput, VcButton },
16
- setup() {
17
- return { args };
18
- },
19
- template: `<vc-login-form v-bind="args">
20
- <vc-input
21
- ref="loginField"
22
- class="tw-mb-4 tw-mt-1"
23
- label="Username"
24
- placeholder="Enter username"
25
- ></vc-input>
26
- <vc-input
27
- ref="passwordField"
28
- class="tw-mb-4"
29
- label="Password"
30
- placeholder="Enter password"
31
- type="password"
32
- ></vc-input>
33
- <div
34
- class="
35
- flex
36
- tw-justify-center
37
- tw-items-center
38
- tw-pt-2
39
- "
40
- >
41
- <span class="tw-grow tw-basis-0"></span>
42
- <vc-button >
43
- Submit
44
- </vc-button>
45
- </div>
46
- </vc-login-form>`,
47
- }),
48
- args: {
49
- background: "images/background.jpg",
50
- logo: "images/logo-white.svg",
51
- },
52
- };
@@ -1,21 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3";
2
- import { VcPopup } from "./";
3
-
4
- const meta: Meta<typeof VcPopup> = {
5
- title: "organisms/VcPopup",
6
- component: VcPopup,
7
- };
8
-
9
- export default meta;
10
- type Story = StoryObj<typeof VcPopup>;
11
-
12
- export const Primary: Story = {
13
- render: (args) => ({
14
- components: { VcPopup },
15
- setup() {
16
- return { args };
17
- },
18
- template: '<vc-popup v-bind="args"></vc-popup>',
19
- }),
20
- args: {},
21
- };