@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.
- package/CHANGELOG.md +19 -0
- package/dist/framework.mjs +12405 -12165
- package/dist/shared/modules/dynamic/components/FIELD_MAP.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/factories.d.ts +4 -1
- package/dist/shared/modules/dynamic/components/factories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/ContentField.d.ts +131 -0
- package/dist/shared/modules/dynamic/components/fields/ContentField.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/ImageField.d.ts +131 -0
- package/dist/shared/modules/dynamic/components/fields/ImageField.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/VideoField.d.ts +131 -0
- package/dist/shared/modules/dynamic/components/fields/VideoField.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/factories/types/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts +1 -1
- package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts +8 -0
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/types/index.d.ts +24 -2
- package/dist/shared/modules/dynamic/types/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/types/models.d.ts +14 -2
- package/dist/shared/modules/dynamic/types/models.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/molecules/index.d.ts +1 -0
- package/dist/ui/components/molecules/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-field/_internal/vc-field-type/vc-field-type.vue.d.ts +33 -0
- package/dist/ui/components/molecules/vc-field/_internal/vc-field-type/vc-field-type.vue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-field/index.d.ts +2 -0
- package/dist/ui/components/molecules/vc-field/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-field/vc-field.vue.d.ts +45 -0
- package/dist/ui/components/molecules/vc-field/vc-field.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue.d.ts.map +1 -1
- package/dist/ui/types/index.d.ts +1 -0
- package/dist/ui/types/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/shared/modules/dynamic/components/FIELD_MAP.ts +7 -0
- package/shared/modules/dynamic/components/SchemaRender.ts +3 -3
- package/shared/modules/dynamic/components/factories.ts +33 -0
- package/shared/modules/dynamic/components/fields/ContentField.ts +25 -0
- package/shared/modules/dynamic/components/fields/ImageField.ts +30 -0
- package/shared/modules/dynamic/components/fields/VideoField.ts +28 -0
- package/shared/modules/dynamic/factories/types/index.ts +1 -1
- package/shared/modules/dynamic/helpers/nodeBuilder.ts +9 -8
- package/shared/modules/dynamic/pages/dynamic-blade-list.vue +39 -2
- package/shared/modules/dynamic/types/index.ts +30 -2
- package/shared/modules/dynamic/types/models.ts +21 -1
- package/ui/components/molecules/index.ts +1 -0
- package/ui/components/molecules/vc-field/_internal/vc-field-type/vc-field-type.vue +66 -0
- package/ui/components/molecules/vc-field/index.ts +1 -0
- package/ui/components/molecules/vc-field/vc-field.vue +67 -0
- package/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue +4 -2
- 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
|
-
|
|
103
|
+
const val = p && p[0][c];
|
|
104
|
+
return val !== undefined ? val : null;
|
|
104
105
|
}
|
|
105
|
-
|
|
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"];
|