fluency-v8-components 1.3.5 → 1.3.7
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/dist/fluency-v8-components.es.js +1 -1
- package/dist/fluency-v8-components.umd.js +99 -99
- package/dist/{index-q2NbjdVo.mjs → index-ChEFiXF5.mjs} +12 -11
- package/dist/{index.es-PAPL4E6Y.mjs → index.es-CjjN70eV.mjs} +1 -1
- package/package.json +3 -2
- package/src/assets/images/ai.svg +1 -0
- package/src/assets/images/github-dark.svg +1 -0
- package/src/assets/images/github.svg +1 -0
- package/src/assets/images/high-priority.svg +1 -0
- package/src/assets/images/power-off.svg +1 -0
- package/src/assets/images/save.svg +1 -0
- package/src/assets/index.ts +15 -0
- package/src/assets/main.css +495 -0
- package/src/assets/prism-theme.css +290 -0
- package/src/components/buttons/ActionButtons.vue +374 -0
- package/src/components/buttons/DropdownButton.vue +104 -0
- package/src/components/buttons/IconButton.vue +63 -0
- package/src/components/buttons/ImageButton.vue +16 -0
- package/src/components/buttons/MenuButton.vue +138 -0
- package/src/components/buttons/SubmitButtons.vue +51 -0
- package/src/components/buttons/TextButton.vue +40 -0
- package/src/components/charts/AlertChart.vue +376 -0
- package/src/components/charts/BarChart.vue +212 -0
- package/src/components/charts/BarChartHorizontal.vue +243 -0
- package/src/components/charts/CronChart.vue +146 -0
- package/src/components/charts/EmptyChart.vue +76 -0
- package/src/components/charts/GradientChart.vue +310 -0
- package/src/components/charts/LineChart.test.js +59 -0
- package/src/components/charts/LineChart.vue +434 -0
- package/src/components/charts/PieChart.vue +293 -0
- package/src/components/charts/ProgressChart.vue +106 -0
- package/src/components/charts/StackedChart.vue +364 -0
- package/src/components/charts/StackedChartClustered.vue +395 -0
- package/src/components/charts/TimelineChart.vue +215 -0
- package/src/components/charts/WorkflowChart.vue +520 -0
- package/src/components/common/AutoCompleteSearchBar.vue +100 -0
- package/src/components/common/AutoRefreshButton.vue +53 -0
- package/src/components/common/Breadcrumb.vue +45 -0
- package/src/components/common/ButtonToggle.vue +24 -0
- package/src/components/common/Card.vue +116 -0
- package/src/components/common/Carousel.vue +66 -0
- package/src/components/common/CategoryCard.vue +28 -0
- package/src/components/common/CodeEditor.vue +59 -0
- package/src/components/common/DatePicker.vue +21 -0
- package/src/components/common/DatePickerInput.vue +109 -0
- package/src/components/common/Dialog.vue +103 -0
- package/src/components/common/EditorHeading.vue +10 -0
- package/src/components/common/EventList.vue +41 -0
- package/src/components/common/Facet.vue +206 -0
- package/src/components/common/Feed.vue +58 -0
- package/src/components/common/Flag.vue +27 -0
- package/src/components/common/HomeCard.vue +20 -0
- package/src/components/common/ItemBox.vue +49 -0
- package/src/components/common/Loading.vue +19 -0
- package/src/components/common/LoadingDots.vue +12 -0
- package/src/components/common/PageHeading.vue +30 -0
- package/src/components/common/Pagination.vue +105 -0
- package/src/components/common/Popover.vue +24 -0
- package/src/components/common/PowerToggle.vue +130 -0
- package/src/components/common/ProgressBar.vue +33 -0
- package/src/components/common/RadioButtons.vue +52 -0
- package/src/components/common/Schedule.vue +79 -0
- package/src/components/common/SearchBar.vue +30 -0
- package/src/components/common/Separator.vue +3 -0
- package/src/components/common/Slideout.vue +95 -0
- package/src/components/common/Sort.vue +83 -0
- package/src/components/common/Table.vue +48 -0
- package/src/components/common/Tabs.vue +129 -0
- package/src/components/common/Tag.vue +53 -0
- package/src/components/common/Tooltip.vue +49 -0
- package/src/components/common/VerticalTabs.vue +34 -0
- package/src/components/common/card/CardItem.vue +27 -0
- package/src/components/common/card/CardItemGroup.vue +45 -0
- package/src/components/common/facet/Leaf.vue +97 -0
- package/src/components/common/facet/TriState.vue +37 -0
- package/src/components/common/table/TableData.vue +48 -0
- package/src/components/common/table/TableHeader.vue +21 -0
- package/src/components/dialogs/ChooseValueDialog.vue +97 -0
- package/src/components/dialogs/ConfirmDialog.vue +73 -0
- package/src/components/dialogs/CopyDialog.vue +51 -0
- package/src/components/dialogs/DownloadDialog.vue +48 -0
- package/src/components/dialogs/NameDescDialog.vue +74 -0
- package/src/components/dialogs/NameDialog.vue +56 -0
- package/src/components/dialogs/PopupEditor.vue +113 -0
- package/src/components/dialogs/ProgressDialog.vue +58 -0
- package/src/components/dialogs/ResetPasswordDialog.vue +58 -0
- package/src/components/dialogs/Wizard.vue +99 -0
- package/src/components/dialogs/wizard/Stepper.vue +31 -0
- package/src/components/form/CheckBox.vue +26 -0
- package/src/components/form/Editor.vue +93 -0
- package/src/components/form/FormCol.vue +19 -0
- package/src/components/form/FormRow.vue +19 -0
- package/src/components/form/FormSection.vue +21 -0
- package/src/components/form/GreyForm.vue +7 -0
- package/src/components/form/GreyInput.vue +51 -0
- package/src/components/form/GreyInputAutocomplete.vue +100 -0
- package/src/components/form/GreyInputCopy.vue +66 -0
- package/src/components/form/GreyInputGrow.vue +42 -0
- package/src/components/form/GreyInputToken.vue +78 -0
- package/src/components/form/GreyPassword.vue +36 -0
- package/src/components/form/GreySelect.vue +154 -0
- package/src/components/form/GreySelectInput.vue +123 -0
- package/src/components/form/GreySelectInputMultiple.vue +218 -0
- package/src/components/form/GreyTel.vue +58 -0
- package/src/components/form/HamburgerItem.vue +95 -0
- package/src/components/form/KeyValueEntry.vue +74 -0
- package/src/components/form/RadioInput.vue +38 -0
- package/src/components/form/UploadFile.vue +99 -0
- package/src/components/icons/AiIcon.vue +6 -0
- package/src/components/icons/GithubIcon.vue +18 -0
- package/src/components/icons/HighPriorityIcon.vue +6 -0
- package/src/components/icons/PowerOffIcon.vue +6 -0
- package/src/components/icons/SaveIcon.vue +6 -0
- package/src/components/index.js +134 -0
- package/src/components/menu/DialogMenu.vue +142 -0
- package/src/components/menu/GrandChild.vue +39 -0
- package/src/components/menu/GridMenu.vue +88 -0
- package/src/components/menu/MenuAvatar.vue +66 -0
- package/src/components/menu/MenuDesktop.vue +90 -0
- package/src/components/notifications/Notify.vue +123 -0
- package/src/components/notifications/NotifyList.vue +130 -0
- package/src/components/page-structure/FacetPage.vue +77 -0
- package/src/components/query/Child.vue +63 -0
- package/src/components/query/LVDBQuery.vue +38 -0
- package/src/components/status/Active.vue +44 -0
- package/src/components/status/ScoreLevel.vue +43 -0
- package/src/components/status/Status.vue +51 -0
- package/src/components/status/TaskDot.vue +25 -0
- package/src/components/status/TaskStatus.vue +26 -0
- package/src/components/status/TicketStatus.vue +201 -0
- package/src/components/status/Trend.vue +20 -0
- package/src/components/tables/ArgumentRunTable.vue +96 -0
- package/src/components/tables/ArgumentTable.vue +67 -0
- package/src/components/tables/CloudFormationParameters.vue +25 -0
- package/src/constants/colors.js +248 -0
- package/src/constants/font-map.js +128 -0
- package/src/constants/fpl2.js +162 -0
- package/src/constants/icon-svg.js +405 -0
- package/src/constants/schedule.js +52 -0
- package/src/fpl/AddPanel.vue +237 -0
- package/src/fpl/Configs/Alert.vue +16 -0
- package/src/fpl/Configs/AlertSprite.vue +2 -0
- package/src/fpl/Configs/Chart.vue +63 -0
- package/src/fpl/Configs/Config.js +154 -0
- package/src/fpl/Configs/Counter.vue +35 -0
- package/src/fpl/Configs/Histogram.vue +70 -0
- package/src/fpl/Configs/IPMap.vue +37 -0
- package/src/fpl/Configs/Image.vue +163 -0
- package/src/fpl/Configs/MetricChart.vue +20 -0
- package/src/fpl/Configs/PieChart.vue +37 -0
- package/src/fpl/Configs/SparkChart.vue +41 -0
- package/src/fpl/Configs/StackedBarChart.vue +49 -0
- package/src/fpl/Configs/Table.vue +211 -0
- package/src/fpl/Configs/Text.vue +14 -0
- package/src/fpl/Configs/TopNChart.vue +37 -0
- package/src/fpl/Outputs/FPLAlert.vue +64 -0
- package/src/fpl/Outputs/FPLStream.vue +41 -0
- package/src/fpl/Outputs/FPLTable.vue +77 -0
- package/src/fpl/Panel.vue +202 -0
- package/src/fpl/Panels/Alert.vue +85 -0
- package/src/fpl/Panels/AlertSprite.vue +9 -0
- package/src/fpl/Panels/Chart.vue +98 -0
- package/src/fpl/Panels/Counter.vue +43 -0
- package/src/fpl/Panels/Histogram.vue +138 -0
- package/src/fpl/Panels/IPMap.vue +48 -0
- package/src/fpl/Panels/Image.vue +35 -0
- package/src/fpl/Panels/MetricChart.vue +97 -0
- package/src/fpl/Panels/PieChart.vue +54 -0
- package/src/fpl/Panels/SparkChart.vue +166 -0
- package/src/fpl/Panels/StackedBarChart.vue +74 -0
- package/src/fpl/Panels/Table.vue +103 -0
- package/src/fpl/Panels/Text.vue +24 -0
- package/src/fpl/Panels/TopNChart.vue +69 -0
- package/src/fpl/index.js +39 -0
- package/src/utils/download.js +220 -0
- package/src/utils/formatOutput.js +156 -0
- package/src/utils/random.js +32 -0
- package/src/utils/timeUtils.js +138 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Dialog :open="open" :title="title">
|
|
3
|
+
<template #content>
|
|
4
|
+
<FormCol :fieldName="nameField">
|
|
5
|
+
<GreyInput v-model="entry.name" />
|
|
6
|
+
</FormCol>
|
|
7
|
+
</template>
|
|
8
|
+
<template #footer>
|
|
9
|
+
<SubmitButtons
|
|
10
|
+
:saveText="saveButtonText"
|
|
11
|
+
@save="emits('save', entry)"
|
|
12
|
+
@close="close"
|
|
13
|
+
/>
|
|
14
|
+
</template>
|
|
15
|
+
</Dialog>
|
|
16
|
+
</template>
|
|
17
|
+
<script setup>
|
|
18
|
+
import { ref } from "vue";
|
|
19
|
+
import { Dialog, GreyInput, FormCol, SubmitButtons } from "@/components";
|
|
20
|
+
|
|
21
|
+
const props = defineProps({
|
|
22
|
+
title: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: "Add",
|
|
25
|
+
},
|
|
26
|
+
nameField: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "Name",
|
|
29
|
+
},
|
|
30
|
+
saveButtonText: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: "Save",
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
const emits = defineEmits(["save"]);
|
|
36
|
+
|
|
37
|
+
const open = ref(false);
|
|
38
|
+
const entry = ref({});
|
|
39
|
+
|
|
40
|
+
function close() {
|
|
41
|
+
open.value = false;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function openModal(e) {
|
|
45
|
+
open.value = true;
|
|
46
|
+
entry.value = {
|
|
47
|
+
name: e.name,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
defineExpose({
|
|
52
|
+
open,
|
|
53
|
+
openModal,
|
|
54
|
+
close,
|
|
55
|
+
});
|
|
56
|
+
</script>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<TransitionRoot appear :show="open" as="template">
|
|
3
|
+
<Dialog as="div" @close="closeModal" class="relative z-50">
|
|
4
|
+
<TransitionChild
|
|
5
|
+
as="template"
|
|
6
|
+
enter="duration-300 ease-out"
|
|
7
|
+
enter-from="opacity-0"
|
|
8
|
+
enter-to="opacity-100"
|
|
9
|
+
leave="duration-200 ease-in"
|
|
10
|
+
leave-from="opacity-100"
|
|
11
|
+
leave-to="opacity-0"
|
|
12
|
+
>
|
|
13
|
+
<div class="fixed inset-0 bg-black/50" />
|
|
14
|
+
</TransitionChild>
|
|
15
|
+
|
|
16
|
+
<div class="fixed inset-0 overflow-y-auto">
|
|
17
|
+
<div
|
|
18
|
+
class="flex min-h-full items-center justify-center p-2 text-center"
|
|
19
|
+
>
|
|
20
|
+
<TransitionChild
|
|
21
|
+
as="template"
|
|
22
|
+
enter="duration-300 ease-out"
|
|
23
|
+
enter-from="opacity-0 scale-95"
|
|
24
|
+
enter-to="opacity-100 scale-100"
|
|
25
|
+
leave="duration-200 ease-in"
|
|
26
|
+
leave-from="opacity-100 scale-100"
|
|
27
|
+
leave-to="opacity-0 scale-95"
|
|
28
|
+
>
|
|
29
|
+
<DialogPanel
|
|
30
|
+
class="m-2 transform overflow-hidden rounded-xl text-left align-middle shadow-xl transition-all"
|
|
31
|
+
style="width: 64rem"
|
|
32
|
+
>
|
|
33
|
+
<div class="bg-sky-700 px-4 py-3 text-white sm:px-6">
|
|
34
|
+
<div class="flex items-center justify-between">
|
|
35
|
+
<DialogTitle
|
|
36
|
+
class="text-base font-semibold leading-6 text-white"
|
|
37
|
+
>
|
|
38
|
+
{{ title }}
|
|
39
|
+
</DialogTitle>
|
|
40
|
+
<div class="ml-3 flex h-7 items-center">
|
|
41
|
+
<button
|
|
42
|
+
type="button"
|
|
43
|
+
class="relative rounded-md bg-sky-700 text-sky-200 hover:text-white focus:outline-hidden focus:ring-2 focus:ring-white"
|
|
44
|
+
@click="closeModal"
|
|
45
|
+
>
|
|
46
|
+
<span class="absolute -inset-2.5" />
|
|
47
|
+
<span class="sr-only">Close panel</span>
|
|
48
|
+
<XMarkIcon class="icon-lg" aria-hidden="true" />
|
|
49
|
+
</button>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
<CodeEditor
|
|
54
|
+
v-model="code"
|
|
55
|
+
class="p-3"
|
|
56
|
+
:fontSize="`${fontSize ? fontSize : '12px'}`"
|
|
57
|
+
:isFPL="isFPL"
|
|
58
|
+
:line-numbers="isFPL"
|
|
59
|
+
:readonly="!isEditable"
|
|
60
|
+
@update:model-value="emits('update', code)"
|
|
61
|
+
/>
|
|
62
|
+
</DialogPanel>
|
|
63
|
+
</TransitionChild>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</Dialog>
|
|
67
|
+
</TransitionRoot>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<script lang="ts" setup>
|
|
71
|
+
import { ref } from "vue";
|
|
72
|
+
import {
|
|
73
|
+
TransitionRoot,
|
|
74
|
+
TransitionChild,
|
|
75
|
+
Dialog,
|
|
76
|
+
DialogPanel,
|
|
77
|
+
DialogTitle,
|
|
78
|
+
} from "@headlessui/vue";
|
|
79
|
+
import { XMarkIcon } from "@heroicons/vue/20/solid";
|
|
80
|
+
import CodeEditor from "../common/CodeEditor.vue";
|
|
81
|
+
|
|
82
|
+
// props and emits
|
|
83
|
+
const props = defineProps({
|
|
84
|
+
fontSize: {
|
|
85
|
+
type: String,
|
|
86
|
+
default: "12px",
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
const emits = defineEmits(["update"]);
|
|
90
|
+
// states
|
|
91
|
+
const title = ref("");
|
|
92
|
+
const open = ref(false);
|
|
93
|
+
const code = ref("");
|
|
94
|
+
const isFPL = ref(true);
|
|
95
|
+
const isEditable = ref(false);
|
|
96
|
+
|
|
97
|
+
// function defs
|
|
98
|
+
function openModal(c: string, isFpl2: boolean, edit: boolean, t = "Editor") {
|
|
99
|
+
open.value = true;
|
|
100
|
+
code.value = c;
|
|
101
|
+
isFPL.value = isFpl2;
|
|
102
|
+
title.value = t;
|
|
103
|
+
isEditable.value = edit;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function closeModal() {
|
|
107
|
+
open.value = false;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
defineExpose({
|
|
111
|
+
openModal,
|
|
112
|
+
});
|
|
113
|
+
</script>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Dialog :open="open" :title="title" :loading="true">
|
|
3
|
+
<template #content>
|
|
4
|
+
<ProgressBar :progress="progress" />
|
|
5
|
+
</template>
|
|
6
|
+
</Dialog>
|
|
7
|
+
</template>
|
|
8
|
+
<script setup>
|
|
9
|
+
import { ref } from "vue";
|
|
10
|
+
import { Dialog, ProgressBar } from "@/components";
|
|
11
|
+
|
|
12
|
+
const emits = defineEmits(["close"]);
|
|
13
|
+
|
|
14
|
+
const open = ref(false);
|
|
15
|
+
const title = ref("Loading");
|
|
16
|
+
const progress = ref(0);
|
|
17
|
+
const progressFunction = ref(() => {});
|
|
18
|
+
const progressID = ref();
|
|
19
|
+
const defaultProgressFunction = (interval) => {
|
|
20
|
+
progress.value += 1;
|
|
21
|
+
if (progress.value < 100) {
|
|
22
|
+
progressID.value = setTimeout(() => {
|
|
23
|
+
progressFunction.value(interval);
|
|
24
|
+
}, interval);
|
|
25
|
+
} else {
|
|
26
|
+
close();
|
|
27
|
+
emits("close");
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
function close() {
|
|
32
|
+
clearTimeout(progressID.value);
|
|
33
|
+
open.value = false;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function openModal(t, p = 0, i = 100, fxP = defaultProgressFunction) {
|
|
37
|
+
open.value = true;
|
|
38
|
+
title.value = t;
|
|
39
|
+
progress.value = p;
|
|
40
|
+
if (!i) {
|
|
41
|
+
progressFunction.value = fxP;
|
|
42
|
+
progressFunction.value();
|
|
43
|
+
} else {
|
|
44
|
+
progressFunction.value = defaultProgressFunction;
|
|
45
|
+
progressFunction.value(i);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function updateProgress(p) {
|
|
50
|
+
progress.value = p;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
defineExpose({
|
|
54
|
+
openModal,
|
|
55
|
+
updateProgress,
|
|
56
|
+
close,
|
|
57
|
+
});
|
|
58
|
+
</script>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Dialog :open="open" title="Reset Password">
|
|
3
|
+
<template #content>
|
|
4
|
+
<FormCol fieldName="Password">
|
|
5
|
+
<GreyPassword v-model="entry.password" :error="errors.password" />
|
|
6
|
+
</FormCol>
|
|
7
|
+
<FormCol fieldName="Confirm Password">
|
|
8
|
+
<GreyPassword v-model="entry.confirm" :error="errors.confirm" />
|
|
9
|
+
</FormCol>
|
|
10
|
+
</template>
|
|
11
|
+
<template #footer>
|
|
12
|
+
<SubmitButtons saveText="Reset" @save="confirmPassword" @close="close" />
|
|
13
|
+
</template>
|
|
14
|
+
</Dialog>
|
|
15
|
+
</template>
|
|
16
|
+
<script setup>
|
|
17
|
+
import { ref } from "vue";
|
|
18
|
+
import { Dialog, FormCol, SubmitButtons, GreyPassword } from "@/components";
|
|
19
|
+
|
|
20
|
+
const emits = defineEmits(["save", "notify"]);
|
|
21
|
+
|
|
22
|
+
const open = ref(false);
|
|
23
|
+
const entry = ref({});
|
|
24
|
+
const errors = ref({});
|
|
25
|
+
|
|
26
|
+
function confirmPassword() {
|
|
27
|
+
errors.value = {};
|
|
28
|
+
if (!entry.value.password || entry.value.password.length < 8) {
|
|
29
|
+
errors.value.password = "Password needs to be at least 8 characters long";
|
|
30
|
+
emits("notify", "Error", [errors.value.password], false);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (entry.value.password !== entry.value.confirm) {
|
|
34
|
+
errors.value.confirm = "Passwords do not match";
|
|
35
|
+
emits("notify", "Error", [errors.value.confirm], false);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
emits("save", entry.value);
|
|
39
|
+
close();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function close() {
|
|
43
|
+
open.value = false;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function openModal(username) {
|
|
47
|
+
open.value = true;
|
|
48
|
+
entry.value = {
|
|
49
|
+
username,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
defineExpose({
|
|
54
|
+
open,
|
|
55
|
+
openModal,
|
|
56
|
+
close,
|
|
57
|
+
});
|
|
58
|
+
</script>
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Dialog :open="open" :title="title" size="large" @close="$emit('clickout')">
|
|
3
|
+
<template #header>
|
|
4
|
+
<slot name="header" />
|
|
5
|
+
</template>
|
|
6
|
+
<template #content>
|
|
7
|
+
<Stepper :steps="steps" />
|
|
8
|
+
<slot name="content" />
|
|
9
|
+
</template>
|
|
10
|
+
<template #footer>
|
|
11
|
+
<div class="flow-root">
|
|
12
|
+
<div class="float-left">
|
|
13
|
+
<slot name="footer" />
|
|
14
|
+
</div>
|
|
15
|
+
<div class="float-right space-x-4">
|
|
16
|
+
<TextButton
|
|
17
|
+
:text="currentStep === 0 ? 'Cancel' : 'Back'"
|
|
18
|
+
color="red"
|
|
19
|
+
@click="back"
|
|
20
|
+
/>
|
|
21
|
+
<TextButton
|
|
22
|
+
v-if="currentStep !== steps.length - 1"
|
|
23
|
+
text="Next"
|
|
24
|
+
@click="next"
|
|
25
|
+
/>
|
|
26
|
+
<TextButton
|
|
27
|
+
v-else
|
|
28
|
+
:text="preventSave ? 'Close' : saveButton"
|
|
29
|
+
color="blue"
|
|
30
|
+
@click="preventSave ? emits('close') : next()"
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
</Dialog>
|
|
36
|
+
</template>
|
|
37
|
+
<script setup>
|
|
38
|
+
import { ref, watch } from "vue";
|
|
39
|
+
import { Dialog, TextButton } from "@/components";
|
|
40
|
+
import Stepper from "./wizard/Stepper.vue";
|
|
41
|
+
|
|
42
|
+
const props = defineProps({
|
|
43
|
+
open: Boolean,
|
|
44
|
+
title: String,
|
|
45
|
+
steps: Array,
|
|
46
|
+
proceed: Boolean,
|
|
47
|
+
saveButton: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: "Save",
|
|
50
|
+
},
|
|
51
|
+
preventSave: {
|
|
52
|
+
type: [Boolean, Number],
|
|
53
|
+
default: false,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
const steps = ref(props.steps);
|
|
57
|
+
const currentStep = ref(0);
|
|
58
|
+
const emits = defineEmits(["close", "next", "moved", "clickout"]);
|
|
59
|
+
|
|
60
|
+
watch(
|
|
61
|
+
() => props.open,
|
|
62
|
+
() => {
|
|
63
|
+
steps.value = props.steps;
|
|
64
|
+
currentStep.value = 0;
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
watch(
|
|
68
|
+
() => props.proceed,
|
|
69
|
+
() => {
|
|
70
|
+
if (props.proceed) {
|
|
71
|
+
steps.value[currentStep.value].status = "completed";
|
|
72
|
+
currentStep.value += 1;
|
|
73
|
+
steps.value[currentStep.value].status = "current";
|
|
74
|
+
emits("moved");
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
watch(
|
|
79
|
+
() => props.steps,
|
|
80
|
+
() => {
|
|
81
|
+
steps.value = props.steps;
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
function back() {
|
|
86
|
+
if (currentStep.value === 0) {
|
|
87
|
+
currentStep.value = 0;
|
|
88
|
+
emits("close");
|
|
89
|
+
} else {
|
|
90
|
+
steps.value[currentStep.value].status = "upcoming";
|
|
91
|
+
currentStep.value -= 1;
|
|
92
|
+
steps.value[currentStep.value].status = "current";
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function next() {
|
|
97
|
+
emits("next");
|
|
98
|
+
}
|
|
99
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="w-full px-4">
|
|
3
|
+
<div class="pb-8 md:pb-4 row gap-x-2">
|
|
4
|
+
<div
|
|
5
|
+
v-for="(step, i) in steps"
|
|
6
|
+
:class="[
|
|
7
|
+
`h-2 w-1/${steps.length} text-sm px-1`,
|
|
8
|
+
{ 'opacity-75': step.status !== 'current' },
|
|
9
|
+
{ 'font-semibold': step.status === 'current' },
|
|
10
|
+
]"
|
|
11
|
+
>
|
|
12
|
+
{{ step.name }}
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="row gap-x-2">
|
|
16
|
+
<div
|
|
17
|
+
v-for="(step, i) in steps"
|
|
18
|
+
:class="[
|
|
19
|
+
`h-2 w-1/${steps.length} rounded-lg`,
|
|
20
|
+
{ 'bg-gray-200 dark:bg-gray-500': step.status === 'upcoming' },
|
|
21
|
+
{ 'bg-sky-500': step.status !== 'upcoming' },
|
|
22
|
+
]"
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
<script setup>
|
|
28
|
+
const props = defineProps({
|
|
29
|
+
steps: Array,
|
|
30
|
+
});
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="relative flex items-start pl-2">
|
|
3
|
+
<div class="flex h-6 items-center">
|
|
4
|
+
<input
|
|
5
|
+
type="checkbox"
|
|
6
|
+
:class="[
|
|
7
|
+
'icon-md rounded-sm border-gray-400 text-indigo-600 focus:ring-indigo-600',
|
|
8
|
+
$attrs.disabled ? 'cursor-not-allowed' : 'cursor-pointer',
|
|
9
|
+
]"
|
|
10
|
+
:checked="$attrs.modelValue"
|
|
11
|
+
v-bind="$attrs"
|
|
12
|
+
@change="onChange"
|
|
13
|
+
:disabled="$attrs.disabled"
|
|
14
|
+
/>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
<script>
|
|
19
|
+
export default {
|
|
20
|
+
methods: {
|
|
21
|
+
onChange() {
|
|
22
|
+
this.$emit("update:modelValue", !this.$attrs.modelValue);
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
</script>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="toolbar" class="bg-blue-100 dark:bg-blue-200">
|
|
3
|
+
<span class="ql-formats">
|
|
4
|
+
<select class="ql-font"></select>
|
|
5
|
+
<select class="ql-size"></select>
|
|
6
|
+
</span>
|
|
7
|
+
<span class="ql-formats">
|
|
8
|
+
<button class="ql-bold"></button>
|
|
9
|
+
<button class="ql-italic"></button>
|
|
10
|
+
<button class="ql-underline"></button>
|
|
11
|
+
<button class="ql-strike"></button>
|
|
12
|
+
</span>
|
|
13
|
+
<span class="ql-formats">
|
|
14
|
+
<select class="ql-color"></select>
|
|
15
|
+
<select class="ql-background"></select>
|
|
16
|
+
</span>
|
|
17
|
+
<span class="ql-formats">
|
|
18
|
+
<button class="ql-list" value="ordered"></button>
|
|
19
|
+
<button class="ql-list" value="bullet"></button>
|
|
20
|
+
<select class="ql-align"></select>
|
|
21
|
+
</span>
|
|
22
|
+
<span class="ql-formats">
|
|
23
|
+
<button class="ql-link"></button>
|
|
24
|
+
</span>
|
|
25
|
+
</div>
|
|
26
|
+
<div id="editor" class="min-h-40"></div>
|
|
27
|
+
</template>
|
|
28
|
+
<script>
|
|
29
|
+
import Quill from "quill";
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
props: {
|
|
33
|
+
modelValue: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: "",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
data() {
|
|
39
|
+
return {
|
|
40
|
+
editor: null,
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
mounted() {
|
|
44
|
+
this.editor = new Quill("#editor", {
|
|
45
|
+
modules: {
|
|
46
|
+
toolbar: "#toolbar",
|
|
47
|
+
},
|
|
48
|
+
theme: "snow",
|
|
49
|
+
formats: [
|
|
50
|
+
"font",
|
|
51
|
+
"size",
|
|
52
|
+
"bold",
|
|
53
|
+
"underline",
|
|
54
|
+
"header",
|
|
55
|
+
"italic",
|
|
56
|
+
"strike",
|
|
57
|
+
"link",
|
|
58
|
+
"color",
|
|
59
|
+
"background",
|
|
60
|
+
"list",
|
|
61
|
+
"align",
|
|
62
|
+
],
|
|
63
|
+
});
|
|
64
|
+
// set initial value
|
|
65
|
+
if (this.modelValue) {
|
|
66
|
+
// support for legacy data without <p> tags
|
|
67
|
+
let txt = "";
|
|
68
|
+
if (this.modelValue.startsWith("<p>")) {
|
|
69
|
+
txt = this.modelValue;
|
|
70
|
+
} else {
|
|
71
|
+
const delta = this.editor.clipboard.convertHTML(this.modelValue);
|
|
72
|
+
const lines = delta.ops[0].insert.split("\n");
|
|
73
|
+
txt = lines.map((line) => `<p>${line}</p>`).join("");
|
|
74
|
+
}
|
|
75
|
+
const editorID = document.querySelector("#editor .ql-editor");
|
|
76
|
+
editorID.innerHTML = txt;
|
|
77
|
+
}
|
|
78
|
+
this.editor.on("text-change", () => {
|
|
79
|
+
this.$emit("update:modelValue", this.editor.root.innerHTML);
|
|
80
|
+
});
|
|
81
|
+
/*
|
|
82
|
+
// override default css when using dark mode
|
|
83
|
+
const isDark = document.body.classList.contains("dark");
|
|
84
|
+
if (isDark) {
|
|
85
|
+
const strokes = document.querySelectorAll(".ql-stroke");
|
|
86
|
+
Array.prototype.forEach.call(strokes, (el) => {
|
|
87
|
+
el.style.stroke = "#FFFFFF";
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
*/
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
</script>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="col py-1">
|
|
3
|
+
<!-- provide section name -->
|
|
4
|
+
<div class="row text-xs font-medium text-grey-7">
|
|
5
|
+
{{ fieldName }}
|
|
6
|
+
<span v-if="required" class="text-red-500">*</span>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="flex-row w-full">
|
|
9
|
+
<slot />
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
const props = defineProps<{
|
|
16
|
+
fieldName: string;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
}>();
|
|
19
|
+
</script>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex items-center py-3">
|
|
3
|
+
<!-- provide section name -->
|
|
4
|
+
<div class="w-20 sm:w-40 text-xs font-medium text-grey-7 pr-4">
|
|
5
|
+
{{ fieldName }}
|
|
6
|
+
<span v-if="required" class="text-red-500">*</span>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="w-32 sm:w-full">
|
|
9
|
+
<slot />
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
const props = defineProps<{
|
|
16
|
+
fieldName: string;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
}>();
|
|
19
|
+
</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="row justify-between items-center w-full">
|
|
4
|
+
<div class="text-base">
|
|
5
|
+
{{ props.sectionName }}
|
|
6
|
+
</div>
|
|
7
|
+
<div class="justify-end relative">
|
|
8
|
+
<slot name="section-right" />
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
<Separator />
|
|
12
|
+
<slot />
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
<script setup lang="ts">
|
|
16
|
+
import Separator from "../common/Separator.vue";
|
|
17
|
+
|
|
18
|
+
const props = defineProps<{
|
|
19
|
+
sectionName: string;
|
|
20
|
+
}>();
|
|
21
|
+
</script>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="['flex input-block', { 'ring-red-600 ': error }]">
|
|
3
|
+
<span
|
|
4
|
+
class="flex select-none items-center pl-3 text-slate-400 italic sm:text-sm"
|
|
5
|
+
>
|
|
6
|
+
{{ prefix }}
|
|
7
|
+
</span>
|
|
8
|
+
<input
|
|
9
|
+
:type="type"
|
|
10
|
+
:class="[
|
|
11
|
+
'flex-1 border-0 text-sm bg-transparent p-0.5 focus:ring-0 focus:outline-none',
|
|
12
|
+
readonly ? 'disabled' : '',
|
|
13
|
+
]"
|
|
14
|
+
:value="$attrs.modelValue"
|
|
15
|
+
v-bind="$attrs"
|
|
16
|
+
:readonly="readonly"
|
|
17
|
+
@input="onChange"
|
|
18
|
+
/>
|
|
19
|
+
</div>
|
|
20
|
+
<div v-if="error" class="text-red-600 text-sm">
|
|
21
|
+
{{ error }}
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script>
|
|
26
|
+
export default {
|
|
27
|
+
props: {
|
|
28
|
+
error: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: "",
|
|
31
|
+
},
|
|
32
|
+
prefix: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "",
|
|
35
|
+
},
|
|
36
|
+
readonly: {
|
|
37
|
+
type: [Boolean, Number],
|
|
38
|
+
default: false,
|
|
39
|
+
},
|
|
40
|
+
type: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: "text",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
methods: {
|
|
46
|
+
onChange(event) {
|
|
47
|
+
this.$emit("update:modelValue", event.target.value);
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
</script>
|