Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions resources/js/components/shared/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ import Recommendations from "../../components/Recommendations.vue"
import ProgressLoader from "../common/ProgressLoader.vue";
import AddToBundle from "./AddToBundle.vue";

export * from "../../../jscomposition/base/table/index";
export * from "../../../jscomposition/system/index";

export {
AddToProjectModal,
BasicSearch,
Expand Down
56 changes: 24 additions & 32 deletions resources/jscomposition/system/table/cell/StatusCell.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<template>
<div class="tw-flex tw-justify-left">
<span
:class="`tw-inline-flex tw-items-center tw-text-xs tw-border-1 tw-rounded-lg
<span :class="`tw-inline-flex tw-items-center tw-text-xs tw-border-1 tw-rounded-lg
tw-bg-${color}-100 tw-px-2 tw-py-1 tw-text-${color}-500`">
{{ label }}
</span>
</div>
</template>
<script>
import { defineComponent, computed } from "vue";
<script setup>
import { computed } from "vue";
import { t } from "i18next";
import { get } from "lodash";

export const statuses = {
const statuses = {
DRAFT: {
color: "red",
label: `${t("Draft")}`,
Expand Down Expand Up @@ -46,34 +46,26 @@ export const statuses = {
},
};

export default defineComponent({
props: {
columns: {
type: Array,
default: () => [],
},
column: {
type: Object,
default: () => ({}),
},
row: {
type: Object,
default: () => ({}),
},
const props = defineProps({
columns: {
type: Array,
default: () => [],
},
setup(props, { emit }) {
const color = computed(() => (
statuses[props.row[props.column.field]].color || statuses.IN_PROGRESS.color
));

const label = computed(() => (
statuses[props.row[props.column.field]].label || statuses.IN_PROGRESS.label
));

return {
color,
label,
};
column: {
type: Object,
default: () => ({}),
},
row: {
type: Object,
default: () => ({}),
},
});

const color = computed(() => (
statuses[get(props.row, props.column.field)].color || statuses.IN_PROGRESS.color
));

const label = computed(() => (
statuses[get(props.row, props.column.field)].label || statuses.IN_PROGRESS.label
));
</script>
Loading