-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds scheme standard section with widgets
- Loading branch information
1 parent
d934018
commit 501e55f
Showing
18 changed files
with
481 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 9 additions & 10 deletions
19
arches_lingo/src/arches_lingo/components/generic/ControlledListItem.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
<script setup lang="ts"> | ||
import type { ControlledListItem } from "@/arches_lingo/types"; | ||
import type { | ||
ControlledListItem, | ||
DataComponentMode, | ||
} from "@/arches_lingo/types"; | ||
import ControlledListItemViewer from "@/arches_lingo/components/generic/ControlledListItemViewer.vue"; | ||
import { EDIT, VIEW } from "@/arches_lingo/constants.ts"; | ||
const VIEW = "view"; | ||
const EDIT = "edit"; | ||
type DataComponentMode = typeof EDIT | typeof VIEW; | ||
const props = defineProps<{ | ||
const { mode = EDIT } = defineProps<{ | ||
mode?: DataComponentMode; | ||
value?: ControlledListItem; | ||
}>(); | ||
defineEmits(["update"]); | ||
</script> | ||
<template> | ||
<div> | ||
<div v-if="!props.mode || props.mode === VIEW"> | ||
<ControlledListItemViewer :value="props.value" /> | ||
<div v-if="mode === VIEW"> | ||
<ControlledListItemViewer :value="value" /> | ||
</div> | ||
<div v-if="props.mode === EDIT"></div> | ||
<div v-if="mode === EDIT"></div> | ||
</div> | ||
</template> |
Empty file.
19 changes: 10 additions & 9 deletions
19
arches_lingo/src/arches_lingo/components/generic/NonLocalizedString.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
arches_lingo/src/arches_lingo/components/generic/ResourceInstanceRelationships.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<script setup lang="ts"> | ||
import ResourceInstanceRelationshipsViewer from "@/arches_lingo/components/generic/ResourceInstanceRelationshipsViewer.vue"; | ||
import ResourceInstanceRelationshipsEditor from "@/arches_lingo/components/generic/ResourceInstanceRelationshipsEditor.vue"; | ||
import { EDIT, VIEW } from "@/arches_lingo/constants.ts"; | ||
import type { | ||
DataComponentMode, | ||
ResourceInstanceReference, | ||
} from "@/arches_lingo/types"; | ||
const { mode = EDIT } = defineProps<{ | ||
mode?: DataComponentMode; | ||
value?: ResourceInstanceReference[]; | ||
options?: ResourceInstanceReference[]; | ||
}>(); | ||
const emits = defineEmits(["update"]); | ||
function onUpdate(val: string[]) { | ||
emits("update", val); | ||
} | ||
</script> | ||
<template> | ||
<div v-if="mode === VIEW"> | ||
<ResourceInstanceRelationshipsViewer :value="value" /> | ||
</div> | ||
<div v-if="mode === EDIT"> | ||
<ResourceInstanceRelationshipsEditor | ||
:options="options" | ||
:val="value?.map((x) => x.resourceId) ?? []" | ||
@update="onUpdate" | ||
/> | ||
</div> | ||
</template> |
45 changes: 45 additions & 0 deletions
45
arches_lingo/src/arches_lingo/components/generic/ResourceInstanceRelationshipsEditor.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<script setup lang="ts"> | ||
import { computed, toRef } from "vue"; | ||
import MultiSelect from "primevue/multiselect"; | ||
import type { ResourceInstanceReference } from "@/arches_lingo/types"; | ||
import { useGettext } from "vue3-gettext"; | ||
const { $gettext } = useGettext(); | ||
const props = withDefaults( | ||
defineProps<{ | ||
val?: string[]; | ||
options?: ResourceInstanceReference[]; | ||
}>(), | ||
{ | ||
options: () => [], | ||
}, | ||
); | ||
const emit = defineEmits(["update"]); | ||
const valRef = toRef(props, "val"); | ||
const value = computed({ | ||
get() { | ||
return valRef.value; | ||
}, | ||
set(value) { | ||
emit("update", value); | ||
}, | ||
}); | ||
</script> | ||
<template> | ||
<MultiSelect | ||
v-model="value" | ||
:show-toggle-all="!!options?.length" | ||
:options | ||
option-label="display_value" | ||
option-value="resourceId" | ||
:pt="{ | ||
emptyMessage: { style: { fontFamily: 'sans-serif' } }, | ||
option: { style: { fontFamily: 'sans-serif' } }, | ||
}" | ||
:placeholder="$gettext('Select Resources')" | ||
/> | ||
</template> |
15 changes: 15 additions & 0 deletions
15
arches_lingo/src/arches_lingo/components/generic/ResourceInstanceRelationshipsViewer.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script setup lang="ts"> | ||
import type { ResourceInstanceReference } from "@/arches_lingo/types"; | ||
const props = defineProps<{ value?: ResourceInstanceReference[] }>(); | ||
</script> | ||
<template> | ||
<div v-if="props.value"> | ||
<div | ||
v-for="val in props.value" | ||
:key="val.resourceXresourceId" | ||
> | ||
{{ val.display_value }} | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.