@appscode/design-system 2.17.26-alpha → 2.17.27
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/main.scss +1 -4
- package/package.json +1 -1
- package/vue-components/styles/base/utilities/_global.scss +0 -8
- package/vue-components/styles/base/utilities/_typography.scss +0 -5
- package/vue-components/styles/components/cards/_all.scss +1 -1
- package/vue-components/styles/components/form-fields/_input-card.scss +1 -3
- package/vue-components/styles/components/form-fields/_input.scss +1 -63
- package/vue-components/v3/cards/UsageTableCard.vue +14 -3
- package/vue-components/v3/form-fields/AcSingleInput.vue +0 -20
- package/vue-components/v3/form-fields/CheckRadio.vue +1 -3
- package/vue-components/v3/section/SectionContent.vue +1 -1
- package/vue-components/styles/components/_ac-duration.scss +0 -50
- package/vue-components/styles/components/_file-explore.scss +0 -31
- package/vue-components/styles/components/cards/_cards-group.scss +0 -26
- package/vue-components/v3/alert/AlertLinked.vue +0 -32
- package/vue-components/v3/config-secret/ConfigSecret.vue +0 -61
- package/vue-components/v3/icons/ArrowDownLongIcon.vue +0 -8
- package/vue-components/v3/icons/ArrowRightIcon.vue +0 -14
- package/vue-components/v3/icons/InfoLightIcon.vue +0 -15
- package/vue-components/v3/icons/MachineCpuIcon.vue +0 -8
- package/vue-components/v3/icons/MachineMemoryIcon.vue +0 -8
- package/vue-components/v3/icons/StorageIcon-2.vue +0 -14
- package/vue-components/v3/node-selection/NodeSelection.vue +0 -82
- package/vue-components/v3/postgres/Postgres.vue +0 -33
- package/vue-components/v3/replica-set/MachineProfile.vue +0 -119
- package/vue-components/v3/replica-set/MultiMachineProfile.vue +0 -100
- package/vue-components/v3/replica-set/UpgradeSet.vue +0 -40
- package/vue-components/v3/scaling-rules/ScalingRules.vue +0 -93
- package/vue-components/v3/threshold/UsageThreshold.vue +0 -24
- package/vue-components/v3/time/AcDuration.vue +0 -167
- package/vue-components/v3/time/AcDurationNew.vue +0 -235
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { defineAsyncComponent, ref } from "vue";
|
|
3
|
-
const SectionContent = defineAsyncComponent(() => import("@/components/vue-components/v3/section/SectionContent.vue"));
|
|
4
|
-
const AcSelect = defineAsyncComponent(() => import("@/components/vue-components/v3/form-fields/AcSelect.vue"));
|
|
5
|
-
const AcSingleInput = defineAsyncComponent(
|
|
6
|
-
() => import("@/components/vue-components/v3/form-fields/AcSingleInput.vue"),
|
|
7
|
-
);
|
|
8
|
-
const ArrowRightIcon = defineAsyncComponent(() => import("@/components/vue-components/v3/icons/ArrowRightIcon.vue"));
|
|
9
|
-
const MachineCpuIcon = defineAsyncComponent(() => import("@/components/vue-components/v3/icons/MachineCpuIcon.vue"));
|
|
10
|
-
const MachineMemoryIcon = defineAsyncComponent(
|
|
11
|
-
() => import("@/components/vue-components/v3/icons/MachineMemoryIcon.vue"),
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
interface Props {
|
|
15
|
-
sectionTitle: string;
|
|
16
|
-
leftHeader?: string;
|
|
17
|
-
rightHeader?: string;
|
|
18
|
-
optionsTitle?: string;
|
|
19
|
-
currentOption: string;
|
|
20
|
-
newOptions: Array<{ name: string; id?: string }>;
|
|
21
|
-
currentCpu?: string;
|
|
22
|
-
currentMemory?: string;
|
|
23
|
-
newCpu?: string;
|
|
24
|
-
newMemory?: string;
|
|
25
|
-
modifierClasses?: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
withDefaults(defineProps<Props>(), {
|
|
29
|
-
leftHeader: "",
|
|
30
|
-
rightHeader: "",
|
|
31
|
-
optionsTitle: "",
|
|
32
|
-
currentCpu: "",
|
|
33
|
-
currentMemory: "",
|
|
34
|
-
newCpu: "",
|
|
35
|
-
newMemory: "",
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
const machine = ref("");
|
|
39
|
-
</script>
|
|
40
|
-
<template>
|
|
41
|
-
<SectionContent :title="sectionTitle" :is-expandable="true" :class="modifierClasses">
|
|
42
|
-
<template #section-body>
|
|
43
|
-
<div class="is-flex is-align-items-center gap-4">
|
|
44
|
-
<SectionContent :custom="true" class="single-machine">
|
|
45
|
-
<template #custom-header>
|
|
46
|
-
<h6>{{ leftHeader }}</h6>
|
|
47
|
-
</template>
|
|
48
|
-
<template #section-body>
|
|
49
|
-
<ac-single-input>
|
|
50
|
-
<label for="email" class="ac-label is-required show-label">{{ optionsTitle }} </label>
|
|
51
|
-
<input
|
|
52
|
-
id="email"
|
|
53
|
-
name="email"
|
|
54
|
-
type="email"
|
|
55
|
-
class="ac-input bg-white"
|
|
56
|
-
:placeholder="currentOption"
|
|
57
|
-
disabled
|
|
58
|
-
/>
|
|
59
|
-
</ac-single-input>
|
|
60
|
-
<div class="is-flex gap-12">
|
|
61
|
-
<p class="is-flex gap-4">
|
|
62
|
-
<span class="icon">
|
|
63
|
-
<MachineCpuIcon />
|
|
64
|
-
</span>
|
|
65
|
-
<span>{{ currentCpu }} CPU</span>
|
|
66
|
-
</p>
|
|
67
|
-
|
|
68
|
-
<p class="is-flex gap-4">
|
|
69
|
-
<span class="icon">
|
|
70
|
-
<MachineMemoryIcon />
|
|
71
|
-
</span>
|
|
72
|
-
<span>{{ currentMemory }} Memory</span>
|
|
73
|
-
</p>
|
|
74
|
-
</div>
|
|
75
|
-
</template>
|
|
76
|
-
</SectionContent>
|
|
77
|
-
<div class="arrow-right-icon">
|
|
78
|
-
<ArrowRightIcon />
|
|
79
|
-
</div>
|
|
80
|
-
<SectionContent :custom="true" class="single-machine">
|
|
81
|
-
<template #custom-header>
|
|
82
|
-
<h6>{{ rightHeader }}</h6>
|
|
83
|
-
</template>
|
|
84
|
-
<template #section-body>
|
|
85
|
-
<AcSelect
|
|
86
|
-
v-model="machine"
|
|
87
|
-
:options="newOptions"
|
|
88
|
-
label="Machine"
|
|
89
|
-
group-label="language"
|
|
90
|
-
show-by="name"
|
|
91
|
-
track-by="name"
|
|
92
|
-
/>
|
|
93
|
-
<div class="is-flex gap-12">
|
|
94
|
-
<p class="is-flex gap-4">
|
|
95
|
-
<span class="icon">
|
|
96
|
-
<MachineCpuIcon />
|
|
97
|
-
</span>
|
|
98
|
-
<span>{{ newCpu }} CPU</span>
|
|
99
|
-
</p>
|
|
100
|
-
|
|
101
|
-
<p class="is-flex gap-4">
|
|
102
|
-
<span class="icon">
|
|
103
|
-
<MachineMemoryIcon />
|
|
104
|
-
</span>
|
|
105
|
-
<span>{{ newMemory }} Memory</span>
|
|
106
|
-
</p>
|
|
107
|
-
</div>
|
|
108
|
-
</template>
|
|
109
|
-
</SectionContent>
|
|
110
|
-
</div>
|
|
111
|
-
</template>
|
|
112
|
-
</SectionContent>
|
|
113
|
-
</template>
|
|
114
|
-
|
|
115
|
-
<style lang="scss">
|
|
116
|
-
.single-machine {
|
|
117
|
-
min-width: 300px;
|
|
118
|
-
}
|
|
119
|
-
</style>
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { defineAsyncComponent, ref } from "vue";
|
|
3
|
-
const AcSelect = defineAsyncComponent(() => import("@/components/vue-components/v3/form-fields/AcSelect.vue"));
|
|
4
|
-
const AcSingleInput = defineAsyncComponent(
|
|
5
|
-
() => import("@/components/vue-components/v3/form-fields/AcSingleInput.vue"),
|
|
6
|
-
);
|
|
7
|
-
const ArrowRightIcon = defineAsyncComponent(() => import("@/components/vue-components/v3/icons/ArrowRightIcon.vue"));
|
|
8
|
-
const MachineCpuIcon = defineAsyncComponent(() => import("@/components/vue-components/v3/icons/MachineCpuIcon.vue"));
|
|
9
|
-
const MachineMemoryIcon = defineAsyncComponent(
|
|
10
|
-
() => import("@/components/vue-components/v3/icons/MachineMemoryIcon.vue"),
|
|
11
|
-
);
|
|
12
|
-
|
|
13
|
-
interface item {
|
|
14
|
-
title?: string;
|
|
15
|
-
optionsTitle?: string;
|
|
16
|
-
currentOption: string;
|
|
17
|
-
newOptions: Array<{ name: string; id?: string }>;
|
|
18
|
-
currentCpu?: string;
|
|
19
|
-
currentMemory?: string;
|
|
20
|
-
newCpu?: string;
|
|
21
|
-
newMemory?: string;
|
|
22
|
-
}
|
|
23
|
-
interface Props {
|
|
24
|
-
items: item[];
|
|
25
|
-
modifierClasses?: string;
|
|
26
|
-
}
|
|
27
|
-
withDefaults(defineProps<Props>(), {
|
|
28
|
-
items: () => [],
|
|
29
|
-
});
|
|
30
|
-
const machines = ref<string[]>([]);
|
|
31
|
-
</script>
|
|
32
|
-
|
|
33
|
-
<template>
|
|
34
|
-
<div class="is-flex gap-4" :class="modifierClasses">
|
|
35
|
-
<div class="card-group mt-24" v-for="(item, index) in items" :key="index">
|
|
36
|
-
<h6 class="card-label">{{ item.title }}</h6>
|
|
37
|
-
<div class="is-flex">
|
|
38
|
-
<div class="card-content p-8 is-flex is-align-items-center gap-8">
|
|
39
|
-
<div class="has-background-white p-16 is-rounded-4">
|
|
40
|
-
<ac-single-input>
|
|
41
|
-
<label for="email" class="ac-label is-required show-label">{{ item.optionsTitle }} </label>
|
|
42
|
-
<input
|
|
43
|
-
id="email"
|
|
44
|
-
name="email"
|
|
45
|
-
type="email"
|
|
46
|
-
class="ac-input bg-white"
|
|
47
|
-
:placeholder="item.currentOption"
|
|
48
|
-
disabled
|
|
49
|
-
/>
|
|
50
|
-
</ac-single-input>
|
|
51
|
-
<div class="is-flex gap-12">
|
|
52
|
-
<p class="is-flex gap-4">
|
|
53
|
-
<span class="icon">
|
|
54
|
-
<MachineCpuIcon />
|
|
55
|
-
</span>
|
|
56
|
-
<span class="is-whitespace-nowrap">{{ item.currentCpu }} CPU</span>
|
|
57
|
-
</p>
|
|
58
|
-
|
|
59
|
-
<p class="is-flex gap-4">
|
|
60
|
-
<span class="icon">
|
|
61
|
-
<MachineMemoryIcon />
|
|
62
|
-
</span>
|
|
63
|
-
<span class="is-whitespace-nowrap">{{ item.currentMemory }} Memory</span>
|
|
64
|
-
</p>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
<div class="arrow-right-icon">
|
|
68
|
-
<ArrowRightIcon />
|
|
69
|
-
</div>
|
|
70
|
-
|
|
71
|
-
<div class="has-background-white p-16 is-rounded-4">
|
|
72
|
-
<AcSelect
|
|
73
|
-
v-model="machines[index]"
|
|
74
|
-
:options="item.newOptions"
|
|
75
|
-
:label="item.optionsTitle"
|
|
76
|
-
group-label="language"
|
|
77
|
-
show-by="name"
|
|
78
|
-
class="mb-16"
|
|
79
|
-
/>
|
|
80
|
-
<div class="is-flex gap-12">
|
|
81
|
-
<p class="is-flex gap-4">
|
|
82
|
-
<span class="icon">
|
|
83
|
-
<MachineCpuIcon />
|
|
84
|
-
</span>
|
|
85
|
-
<span class="is-whitespace-nowrap">{{ item.newCpu }} CPU</span>
|
|
86
|
-
</p>
|
|
87
|
-
|
|
88
|
-
<p class="is-flex gap-4">
|
|
89
|
-
<span class="icon">
|
|
90
|
-
<MachineMemoryIcon />
|
|
91
|
-
</span>
|
|
92
|
-
<span class="is-whitespace-nowrap">{{ item.newMemory }} Memory</span>
|
|
93
|
-
</p>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
</div>
|
|
100
|
-
</template>
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { defineAsyncComponent, ref } from "vue";
|
|
3
|
-
const AcSingleInput = defineAsyncComponent(
|
|
4
|
-
() => import("@/components/vue-components/v3/form-fields/AcSingleInput.vue"),
|
|
5
|
-
);
|
|
6
|
-
const ArrowRightIcon = defineAsyncComponent(() => import("@/components/vue-components/v3/icons/ArrowRightIcon.vue"));
|
|
7
|
-
|
|
8
|
-
interface Props {
|
|
9
|
-
title?: string;
|
|
10
|
-
description?: string;
|
|
11
|
-
currentInputTitle?: string;
|
|
12
|
-
newInputTitle?: string;
|
|
13
|
-
currentValue: string;
|
|
14
|
-
modifierClasses?: string;
|
|
15
|
-
}
|
|
16
|
-
withDefaults(defineProps<Props>(), {});
|
|
17
|
-
const newValue = ref("");
|
|
18
|
-
</script>
|
|
19
|
-
<template>
|
|
20
|
-
<div :class="modifierClasses">
|
|
21
|
-
<h6>{{ title }}</h6>
|
|
22
|
-
<p>{{ description }}</p>
|
|
23
|
-
|
|
24
|
-
<div class="is-flex">
|
|
25
|
-
<ac-single-input>
|
|
26
|
-
<label for="Value" class="ac-label is-required show-label">{{ currentInputTitle }}</label>
|
|
27
|
-
<input class="ac-input" :placeholder="currentValue" disabled />
|
|
28
|
-
</ac-single-input>
|
|
29
|
-
|
|
30
|
-
<div class="arrow-right-icon">
|
|
31
|
-
<ArrowRightIcon />
|
|
32
|
-
</div>
|
|
33
|
-
|
|
34
|
-
<ac-single-input>
|
|
35
|
-
<label for="Value" class="ac-label is-required show-label">{{ newInputTitle }}</label>
|
|
36
|
-
<input v-model="newValue" class="ac-input" :placeholder="currentValue" />
|
|
37
|
-
</ac-single-input>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
</template>
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { defineAsyncComponent } from "vue";
|
|
3
|
-
import InfoLightIcon from "@/components/vue-components/v3/icons/InfoLightIcon.vue";
|
|
4
|
-
import CrossIcon from "@/components/vue-components/v3/icons/CrossIcon.vue";
|
|
5
|
-
|
|
6
|
-
const StorageIcon2 = defineAsyncComponent(() => import("@/components/vue-components/v3/icons/StorageIcon-2.vue"));
|
|
7
|
-
const ArrowDownLongIcon = defineAsyncComponent(
|
|
8
|
-
() => import("@/components/vue-components/v3/icons/ArrowDownLongIcon.vue"),
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
interface Props {
|
|
12
|
-
title?: string;
|
|
13
|
-
initialStorage?: string;
|
|
14
|
-
rules: {
|
|
15
|
-
percent?: string;
|
|
16
|
-
size?: string;
|
|
17
|
-
role?: string;
|
|
18
|
-
showAddButton?: boolean;
|
|
19
|
-
showSaveDeleteButtons?: boolean;
|
|
20
|
-
}[];
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
withDefaults(defineProps<Props>(), {
|
|
24
|
-
title: "",
|
|
25
|
-
initialStorage: "",
|
|
26
|
-
rules: () => [],
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const emit = defineEmits(["add-role", "save", "delete"]);
|
|
30
|
-
|
|
31
|
-
function addRole() {
|
|
32
|
-
emit("add-role");
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function saveRules() {
|
|
36
|
-
emit("save");
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function deleteRule() {
|
|
40
|
-
emit("delete");
|
|
41
|
-
}
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
<template>
|
|
45
|
-
<h5>{{ title }}</h5>
|
|
46
|
-
|
|
47
|
-
<span class="mb-4 is-inline-flex text-code px-2">Initial Storage</span>
|
|
48
|
-
<div class="is-flex is-flex-direction-column is-relative">
|
|
49
|
-
<div class="icon-with-input is-inactive width-120">
|
|
50
|
-
<label class="icon" for="initial">
|
|
51
|
-
<StorageIcon2 class="width-18" />
|
|
52
|
-
</label>
|
|
53
|
-
<div class="is-flex is-align-items-center px-2">{{ initialStorage }}</div>
|
|
54
|
-
</div>
|
|
55
|
-
|
|
56
|
-
<div v-for="(rule, index) in rules" :key="index" class="is-relative mt-4">
|
|
57
|
-
<div class="is-inline-flex is-align-items-center" style="margin-left: 52px">
|
|
58
|
-
<ArrowDownLongIcon />
|
|
59
|
-
<div class="input-with-icon width-80" style="margin: 4px">
|
|
60
|
-
<input type="text" class="ac-input" :value="rule.percent" />
|
|
61
|
-
<label class="icon">
|
|
62
|
-
<InfoLightIcon class="width-18" />
|
|
63
|
-
</label>
|
|
64
|
-
</div>
|
|
65
|
-
<p v-if="rule.role" class="ml-2">{{ rule.role }}</p>
|
|
66
|
-
</div>
|
|
67
|
-
|
|
68
|
-
<div class="is-flex is-align-items-center gap-8">
|
|
69
|
-
<div class="icon-with-input width-120">
|
|
70
|
-
<label class="icon">
|
|
71
|
-
<StorageIcon2 class="width-18" />
|
|
72
|
-
</label>
|
|
73
|
-
<input type="text" class="ac-input" :value="rule.size" />
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
<div class="buttons" v-if="rule.showAddButton || rule.showSaveDeleteButtons">
|
|
77
|
-
<button v-if="rule.showAddButton" class="button ac-button is-primary is-outlined is-soft" @click="addRole">
|
|
78
|
-
Add New Role
|
|
79
|
-
</button>
|
|
80
|
-
|
|
81
|
-
<template v-if="rule.showSaveDeleteButtons">
|
|
82
|
-
<button class="button ac-button is-primary is-outlined is-soft" @click="saveRules">Save</button>
|
|
83
|
-
<button class="button ac-button is-danger is-outlined is-soft" @click="deleteRule">
|
|
84
|
-
<span class="icon">
|
|
85
|
-
<CrossIcon />
|
|
86
|
-
</span>
|
|
87
|
-
</button>
|
|
88
|
-
</template>
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
</div>
|
|
93
|
-
</template>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
interface Props {
|
|
3
|
-
title?: string;
|
|
4
|
-
subtitle?: string;
|
|
5
|
-
minRange?: number;
|
|
6
|
-
maxRange?: number;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
withDefaults(defineProps<Props>(), {
|
|
10
|
-
title: "",
|
|
11
|
-
subtitle: "",
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const threshold = defineModel<number>();
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<template>
|
|
18
|
-
<h5>{{ title }}</h5>
|
|
19
|
-
<p>{{ subtitle }}</p>
|
|
20
|
-
<div class="ac-range">
|
|
21
|
-
<input v-model="threshold" type="range" :min="minRange" :max="maxRange" value="50" />
|
|
22
|
-
<span class="pl-8">{{ threshold }}</span>
|
|
23
|
-
</div>
|
|
24
|
-
</template>
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { defineAsyncComponent, ref } from "vue";
|
|
3
|
-
|
|
4
|
-
interface Props {
|
|
5
|
-
modifierClasses?: string;
|
|
6
|
-
label?: string;
|
|
7
|
-
required?: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
withDefaults(defineProps<Props>(), {
|
|
11
|
-
modifierClasses: "",
|
|
12
|
-
label: "Default",
|
|
13
|
-
required: false,
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const showDuration = ref(false);
|
|
17
|
-
const selectedDay = ref(0);
|
|
18
|
-
const selectedHour = ref(0);
|
|
19
|
-
const selectedMinute = ref(0);
|
|
20
|
-
|
|
21
|
-
const AcSingleInput = defineAsyncComponent(
|
|
22
|
-
() => import("@/components/vue-components/v3/form-fields/AcSingleInput.vue"),
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
const vClickOutside = {
|
|
26
|
-
mounted(el: any, binding: any) {
|
|
27
|
-
el.__clickOutsideHandler__ = (event: any) => {
|
|
28
|
-
if (!(el === event.target || el.contains(event.target))) {
|
|
29
|
-
binding.value(event);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
document.addEventListener("click", el.__clickOutsideHandler__);
|
|
33
|
-
},
|
|
34
|
-
unmounted(el: any) {
|
|
35
|
-
document.removeEventListener("click", el.__clickOutsideHandler__);
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
function handleScroll(type: "day" | "hour" | "minute") {
|
|
40
|
-
const container = document.querySelector(`.${type}-scroll`);
|
|
41
|
-
if (!container) return;
|
|
42
|
-
|
|
43
|
-
const scrollTop = container.scrollTop;
|
|
44
|
-
const itemHeight = container.querySelector("li")?.clientHeight || 0;
|
|
45
|
-
const containerHeight = container.clientHeight;
|
|
46
|
-
|
|
47
|
-
// Correctly calculate the middle index
|
|
48
|
-
const middleIndex = Math.round((scrollTop + containerHeight / 2 - itemHeight / 2) / itemHeight);
|
|
49
|
-
|
|
50
|
-
if (type === "day") {
|
|
51
|
-
selectedDay.value = middleIndex;
|
|
52
|
-
} else if (type === "hour") {
|
|
53
|
-
selectedHour.value = middleIndex;
|
|
54
|
-
} else if (type === "minute") {
|
|
55
|
-
selectedMinute.value = middleIndex + 1;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function getSelectedValue(type: "day" | "hour" | "minute") {
|
|
60
|
-
if (type === "day") return selectedDay.value;
|
|
61
|
-
if (type === "hour") return selectedHour.value;
|
|
62
|
-
return selectedMinute.value;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function setSelectedValue(type: "day" | "hour" | "minute", value: number) {
|
|
66
|
-
if (type === "day") {
|
|
67
|
-
selectedDay.value = value;
|
|
68
|
-
} else if (type === "hour") {
|
|
69
|
-
selectedHour.value = value;
|
|
70
|
-
} else if (type === "minute") {
|
|
71
|
-
selectedMinute.value = value;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
</script>
|
|
75
|
-
<template>
|
|
76
|
-
<div class="ac-duration-wrapper" :class="modifierClasses" v-click-outside="() => (showDuration = false)">
|
|
77
|
-
<ac-single-input class="width-220" @click="showDuration = !showDuration">
|
|
78
|
-
<label for="Value" :class="{ 'ac-label': true, 'is-required': required }">
|
|
79
|
-
{{ selectedDay }}d {{ selectedHour }}h {{ selectedMinute }}m
|
|
80
|
-
</label>
|
|
81
|
-
<input class="ac-input" />
|
|
82
|
-
</ac-single-input>
|
|
83
|
-
|
|
84
|
-
<div class="ac-duration" v-if="showDuration">
|
|
85
|
-
<div class="duration-header has-text-center">
|
|
86
|
-
<h6>Duration</h6>
|
|
87
|
-
</div>
|
|
88
|
-
<div class="duration-body">
|
|
89
|
-
<div class="is-flex">
|
|
90
|
-
<!-- Days -->
|
|
91
|
-
<div class="duration">
|
|
92
|
-
<span>DAY</span>
|
|
93
|
-
<ul class="day-scroll scroll-list" @scroll="handleScroll('day')">
|
|
94
|
-
<li
|
|
95
|
-
v-for="i in Array.from({ length: 30 }, (_, i) => i)"
|
|
96
|
-
:key="'d' + i"
|
|
97
|
-
:class="{ active: getSelectedValue('day') === i }"
|
|
98
|
-
@click="setSelectedValue('day', i)"
|
|
99
|
-
>
|
|
100
|
-
{{ i }}
|
|
101
|
-
</li>
|
|
102
|
-
</ul>
|
|
103
|
-
</div>
|
|
104
|
-
|
|
105
|
-
<!-- Hours -->
|
|
106
|
-
<div class="duration">
|
|
107
|
-
<span>HOUR</span>
|
|
108
|
-
<ul class="hour-scroll scroll-list" @scroll="handleScroll('hour')">
|
|
109
|
-
<li
|
|
110
|
-
v-for="i in Array.from({ length: 24 }, (_, i) => i)"
|
|
111
|
-
:key="'h' + i"
|
|
112
|
-
:class="{ active: getSelectedValue('hour') === i }"
|
|
113
|
-
@click="setSelectedValue('hour', i)"
|
|
114
|
-
>
|
|
115
|
-
{{ i }}
|
|
116
|
-
</li>
|
|
117
|
-
</ul>
|
|
118
|
-
</div>
|
|
119
|
-
|
|
120
|
-
<!-- Minutes -->
|
|
121
|
-
<div class="duration">
|
|
122
|
-
<span>MIN</span>
|
|
123
|
-
<ul class="minute-scroll scroll-list" @scroll="handleScroll('minute')">
|
|
124
|
-
<li
|
|
125
|
-
v-for="i in Array.from({ length: 60 }, (_, i) => i)"
|
|
126
|
-
:key="'m' + i"
|
|
127
|
-
:class="{ active: getSelectedValue('minute') === i }"
|
|
128
|
-
@click="setSelectedValue('minute', i)"
|
|
129
|
-
>
|
|
130
|
-
{{ i }}
|
|
131
|
-
</li>
|
|
132
|
-
</ul>
|
|
133
|
-
</div>
|
|
134
|
-
</div>
|
|
135
|
-
</div>
|
|
136
|
-
|
|
137
|
-
<div class="duration-footer">
|
|
138
|
-
<div class="buttons">
|
|
139
|
-
<button class="button ac-button is-small is-outlined" @click="showDuration = false">Cancel</button>
|
|
140
|
-
<button class="button ac-button is-small is-outlined">Ok</button>
|
|
141
|
-
</div>
|
|
142
|
-
</div>
|
|
143
|
-
</div>
|
|
144
|
-
</div>
|
|
145
|
-
</template>
|
|
146
|
-
<style scoped>
|
|
147
|
-
.scroll-list {
|
|
148
|
-
height: 150px;
|
|
149
|
-
overflow-y: scroll;
|
|
150
|
-
scroll-snap-type: y mandatory;
|
|
151
|
-
padding: 0;
|
|
152
|
-
margin: 0;
|
|
153
|
-
}
|
|
154
|
-
.scroll-list li {
|
|
155
|
-
color: #888;
|
|
156
|
-
}
|
|
157
|
-
.scroll-list li.active {
|
|
158
|
-
color: #007bff;
|
|
159
|
-
font-weight: 600;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.duration > span {
|
|
163
|
-
display: block;
|
|
164
|
-
text-align: center;
|
|
165
|
-
margin-bottom: 5px;
|
|
166
|
-
}
|
|
167
|
-
</style>
|