@vc-shell/framework 1.0.117 → 1.0.118

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 (50) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/framework.mjs +12405 -12165
  3. package/dist/shared/modules/dynamic/components/FIELD_MAP.d.ts.map +1 -1
  4. package/dist/shared/modules/dynamic/components/factories.d.ts +4 -1
  5. package/dist/shared/modules/dynamic/components/factories.d.ts.map +1 -1
  6. package/dist/shared/modules/dynamic/components/fields/ContentField.d.ts +131 -0
  7. package/dist/shared/modules/dynamic/components/fields/ContentField.d.ts.map +1 -0
  8. package/dist/shared/modules/dynamic/components/fields/ImageField.d.ts +131 -0
  9. package/dist/shared/modules/dynamic/components/fields/ImageField.d.ts.map +1 -0
  10. package/dist/shared/modules/dynamic/components/fields/VideoField.d.ts +131 -0
  11. package/dist/shared/modules/dynamic/components/fields/VideoField.d.ts.map +1 -0
  12. package/dist/shared/modules/dynamic/factories/types/index.d.ts.map +1 -1
  13. package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts +1 -1
  14. package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts.map +1 -1
  15. package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts +8 -0
  16. package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts.map +1 -1
  17. package/dist/shared/modules/dynamic/types/index.d.ts +24 -2
  18. package/dist/shared/modules/dynamic/types/index.d.ts.map +1 -1
  19. package/dist/shared/modules/dynamic/types/models.d.ts +14 -2
  20. package/dist/shared/modules/dynamic/types/models.d.ts.map +1 -1
  21. package/dist/tsconfig.tsbuildinfo +1 -1
  22. package/dist/ui/components/molecules/index.d.ts +1 -0
  23. package/dist/ui/components/molecules/index.d.ts.map +1 -1
  24. package/dist/ui/components/molecules/vc-field/_internal/vc-field-type/vc-field-type.vue.d.ts +33 -0
  25. package/dist/ui/components/molecules/vc-field/_internal/vc-field-type/vc-field-type.vue.d.ts.map +1 -0
  26. package/dist/ui/components/molecules/vc-field/index.d.ts +2 -0
  27. package/dist/ui/components/molecules/vc-field/index.d.ts.map +1 -0
  28. package/dist/ui/components/molecules/vc-field/vc-field.vue.d.ts +45 -0
  29. package/dist/ui/components/molecules/vc-field/vc-field.vue.d.ts.map +1 -0
  30. package/dist/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue.d.ts.map +1 -1
  31. package/dist/ui/types/index.d.ts +1 -0
  32. package/dist/ui/types/index.d.ts.map +1 -1
  33. package/package.json +4 -4
  34. package/shared/modules/dynamic/components/FIELD_MAP.ts +7 -0
  35. package/shared/modules/dynamic/components/SchemaRender.ts +3 -3
  36. package/shared/modules/dynamic/components/factories.ts +33 -0
  37. package/shared/modules/dynamic/components/fields/ContentField.ts +25 -0
  38. package/shared/modules/dynamic/components/fields/ImageField.ts +30 -0
  39. package/shared/modules/dynamic/components/fields/VideoField.ts +28 -0
  40. package/shared/modules/dynamic/factories/types/index.ts +1 -1
  41. package/shared/modules/dynamic/helpers/nodeBuilder.ts +9 -8
  42. package/shared/modules/dynamic/pages/dynamic-blade-list.vue +39 -2
  43. package/shared/modules/dynamic/types/index.ts +30 -2
  44. package/shared/modules/dynamic/types/models.ts +21 -1
  45. package/ui/components/molecules/index.ts +1 -0
  46. package/ui/components/molecules/vc-field/_internal/vc-field-type/vc-field-type.vue +66 -0
  47. package/ui/components/molecules/vc-field/index.ts +1 -0
  48. package/ui/components/molecules/vc-field/vc-field.vue +67 -0
  49. package/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue +4 -2
  50. package/ui/types/index.ts +1 -0
@@ -0,0 +1,66 @@
1
+ <template>
2
+ <!-- Text -->
3
+ <template v-if="type === 'text'">
4
+ <div class="tw-flex tw-flex-row tw-justify-stretch tw-truncate">
5
+ <div class="tw-truncate">
6
+ <VcHint class="tw-text-s">{{ value }}</VcHint>
7
+ </div>
8
+ </div>
9
+ </template>
10
+
11
+ <!-- Date -->
12
+ <template v-if="type === 'date'">
13
+ <div class="tw-flex tw-flex-row tw-justify-stretch tw-truncate">
14
+ <div class="tw-truncate">
15
+ <VcHint class="tw-text-s"> {{ value.toLocaleDateString() }}</VcHint>
16
+ </div>
17
+ </div>
18
+ </template>
19
+
20
+ <!-- Date ago -->
21
+ <template v-if="type === 'date-ago'">
22
+ <div class="tw-flex tw-flex-row tw-justify-stretch tw-truncate">
23
+ <div class="tw-truncate">
24
+ <VcHint class="tw-text-s"> {{ moment(value).fromNow() ?? "N/A" }}</VcHint>
25
+ </div>
26
+ </div>
27
+ </template>
28
+
29
+ <!-- Link -->
30
+ <template v-if="type === 'link'">
31
+ <div class="tw-flex tw-flex-row tw-justify-stretch tw-truncate">
32
+ <div class="tw-truncate">
33
+ <VcLink
34
+ class="vc-link tw-text-s tw-truncate tw-w-full"
35
+ @click="onLinkClick"
36
+ >{{ value }}</VcLink
37
+ >
38
+ </div>
39
+ <slot></slot>
40
+ </div>
41
+ </template>
42
+ </template>
43
+
44
+ <script lang="ts" setup>
45
+ import moment from "moment";
46
+
47
+ export interface Props {
48
+ type: "text" | "date" | "date-ago" | "link";
49
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
+ value: any;
51
+ }
52
+
53
+ export interface Emits {
54
+ (event: "click"): void;
55
+ (event: "copy"): void;
56
+ }
57
+
58
+ defineEmits<Emits>();
59
+ const props = defineProps<Props>();
60
+
61
+ function onLinkClick() {
62
+ location.href = props.value;
63
+ }
64
+ </script>
65
+
66
+ <style lang="scss" scoped></style>
@@ -0,0 +1 @@
1
+ export { default as VcField } from "./vc-field.vue";
@@ -0,0 +1,67 @@
1
+ <template>
2
+ <div>
3
+ <!-- Field label -->
4
+ <VcLabel v-if="label">
5
+ <span>{{ label }}</span>
6
+ <template
7
+ v-if="tooltip"
8
+ #tooltip
9
+ >{{ tooltip }}</template
10
+ ></VcLabel
11
+ >
12
+ <div>
13
+ <VcFieldType
14
+ :value="modelValue"
15
+ :type="type"
16
+ >
17
+ <VcButton
18
+ v-if="copyable"
19
+ icon="far fa-copy"
20
+ size="m"
21
+ class="tw-ml-2"
22
+ text
23
+ @click="copy(modelValue)"
24
+ ></VcButton>
25
+ </VcFieldType>
26
+ </div>
27
+ </div>
28
+ </template>
29
+
30
+ <script lang="ts" setup>
31
+ import { VcLabel } from "./../../";
32
+ import VcFieldType from "./_internal/vc-field-type/vc-field-type.vue";
33
+
34
+ export interface Props {
35
+ /**
36
+ * Field label text
37
+ */
38
+ label?: string;
39
+ /**
40
+ * Field tooltip information
41
+ */
42
+ tooltip?: string;
43
+ /**
44
+ * Field type
45
+ */
46
+ type?: "text" | "date" | "date-ago" | "link";
47
+ /**
48
+ * Field content
49
+ */
50
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
51
+ modelValue?: any;
52
+ /**
53
+ * Add button for field content copying
54
+ */
55
+ copyable?: boolean;
56
+ }
57
+
58
+ withDefaults(defineProps<Props>(), {
59
+ type: "text",
60
+ });
61
+
62
+ function copy(value: string) {
63
+ navigator.clipboard?.writeText(value);
64
+ }
65
+ </script>
66
+
67
+ <style lang="scss" scoped></style>
@@ -100,9 +100,11 @@ const locale = window.navigator.language;
100
100
  const value = computed(() => {
101
101
  return (props.cell.field || props.cell.id).split(".").reduce((p: { [x: string]: unknown }, c: string) => {
102
102
  if (p && Array.isArray(p) && p.length) {
103
- return (p && p[0][c]) || null;
103
+ const val = p && p[0][c];
104
+ return val !== undefined ? val : null;
104
105
  }
105
- return (p && p[c]) || null;
106
+ const val = p && p[c];
107
+ return val !== undefined ? val : null;
106
108
  }, props.item);
107
109
  });
108
110
  </script>
package/ui/types/index.ts CHANGED
@@ -39,6 +39,7 @@ declare module "vue" {
39
39
  VcSlider: (typeof VcShellComponents)["VcSlider"];
40
40
  VcTextarea: (typeof VcShellComponents)["VcTextarea"];
41
41
  VcMultivalue: (typeof VcShellComponents)["VcMultivalue"];
42
+ VcField: (typeof VcShellComponents)["VcField"];
42
43
 
43
44
  // organisms
44
45
  VcApp: (typeof VcShellComponents)["VcApp"];