@timus-networks/theme 2.0.1 → 2.0.2
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/README.md +34 -49
- package/dist/module.d.mts +1 -1
- package/dist/module.d.ts +1 -1
- package/dist/module.json +2 -2
- package/dist/module.mjs +40 -18
- package/dist/runtime/components/development/example.alert.vue +29 -0
- package/dist/runtime/components/development/example.avatar.vue +85 -0
- package/dist/runtime/components/development/example.badge.vue +93 -0
- package/dist/runtime/components/development/example.breadcrumb.vue +54 -0
- package/dist/runtime/components/development/example.button.vue +235 -0
- package/dist/runtime/components/{example.button.vue.d.ts → development/example.button.vue.d.ts} +2 -1
- package/dist/runtime/components/development/example.card.vue +68 -0
- package/dist/runtime/components/development/example.checkbox.vue +176 -0
- package/dist/runtime/components/{example.checkbox.vue.d.ts → development/example.checkbox.vue.d.ts} +2 -2
- package/dist/runtime/components/development/example.collapse.vue +38 -0
- package/dist/runtime/components/development/example.datepicker.vue +193 -0
- package/dist/runtime/components/development/example.description.vue +94 -0
- package/dist/runtime/components/{example.dialog.vue → development/example.dialog.vue} +21 -24
- package/dist/runtime/components/development/example.dropdown.vue +166 -0
- package/dist/runtime/components/development/example.form.vue +488 -0
- package/dist/runtime/components/development/example.input.vue +270 -0
- package/dist/runtime/components/development/example.input.vue.d.ts +23 -0
- package/dist/runtime/components/development/example.link.vue +68 -0
- package/dist/runtime/components/development/example.message.vue +64 -0
- package/dist/runtime/components/development/example.notification.vue +75 -0
- package/dist/runtime/components/development/example.number.vue +70 -0
- package/dist/runtime/components/development/example.pagination.vue +89 -0
- package/dist/runtime/components/development/example.popover.vue +151 -0
- package/dist/runtime/components/development/example.radio.vue +163 -0
- package/dist/runtime/components/{example.radio.vue.d.ts → development/example.radio.vue.d.ts} +3 -2
- package/dist/runtime/components/development/example.select.vue +588 -0
- package/dist/runtime/components/{example.select.vue.d.ts → development/example.select.vue.d.ts} +3 -2
- package/dist/runtime/components/development/example.sidebar.vue +101 -0
- package/dist/runtime/components/development/example.static.vue +50 -0
- package/dist/runtime/components/development/example.switch.vue +101 -0
- package/dist/runtime/components/{example.table.vue → development/example.table.vue} +8 -22
- package/dist/runtime/components/development/example.tag.vue +255 -0
- package/dist/runtime/components/development/example.timepicker.vue +89 -0
- package/dist/runtime/components/development/example.tooltip.vue +104 -0
- package/dist/runtime/components/development/example.upload.vue +84 -0
- package/dist/runtime/components/production/html-encode.vue +96 -0
- package/dist/runtime/components/production/timus-breadcrumb.d.ts +36 -0
- package/dist/runtime/components/production/timus-breadcrumb.js +224 -0
- package/dist/runtime/components/production/timus-breadcrumb.mjs +224 -0
- package/dist/runtime/components/production/timus-breadcrumb.vue +83 -0
- package/dist/runtime/components/production/timus-breadcrumb.vue.d.ts +340 -0
- package/dist/runtime/composables/useBreadcrumb.d.ts +8 -0
- package/dist/runtime/composables/useBreadcrumb.js +53 -0
- package/dist/runtime/composables/useBreadcrumb.mjs +53 -0
- package/dist/runtime/pages/theme.vue +44 -13
- package/dist/runtime/plugins/disable-warnings-plugin.js +18 -0
- package/dist/runtime/plugins/disable-warnings-plugin.mjs +18 -0
- package/dist/runtime/public/scss/element-plus/affix.css +28 -0
- package/dist/runtime/public/scss/element-plus/alert.css +116 -20
- package/dist/runtime/public/scss/element-plus/anchor-link.css +28 -0
- package/dist/runtime/public/scss/element-plus/anchor.css +28 -0
- package/dist/runtime/public/scss/element-plus/aside.css +28 -0
- package/dist/runtime/public/scss/element-plus/autocomplete.css +28 -0
- package/dist/runtime/public/scss/element-plus/avatar.css +60 -10
- package/dist/runtime/public/scss/element-plus/backtop.css +28 -0
- package/dist/runtime/public/scss/element-plus/badge.css +30 -2
- package/dist/runtime/public/scss/element-plus/base.css +31 -3
- package/dist/runtime/public/scss/element-plus/breadcrumb.css +46 -6
- package/dist/runtime/public/scss/element-plus/button-group.css +154 -32
- package/dist/runtime/public/scss/element-plus/button.css +70 -24
- package/dist/runtime/public/scss/element-plus/calendar.css +28 -0
- package/dist/runtime/public/scss/element-plus/card.css +41 -6
- package/dist/runtime/public/scss/element-plus/carousel-item.css +28 -0
- package/dist/runtime/public/scss/element-plus/carousel.css +28 -0
- package/dist/runtime/public/scss/element-plus/cascader-panel.css +28 -0
- package/dist/runtime/public/scss/element-plus/cascader.css +28 -0
- package/dist/runtime/public/scss/element-plus/check-tag.css +28 -0
- package/dist/runtime/public/scss/element-plus/checkbox-button.css +33 -0
- package/dist/runtime/public/scss/element-plus/checkbox-group.css +28 -0
- package/dist/runtime/public/scss/element-plus/checkbox.css +28 -0
- package/dist/runtime/public/scss/element-plus/col.css +28 -0
- package/dist/runtime/public/scss/element-plus/collapse.css +28 -0
- package/dist/runtime/public/scss/element-plus/color-picker.css +28 -0
- package/dist/runtime/public/scss/element-plus/common/popup.css +28 -0
- package/dist/runtime/public/scss/element-plus/common/transition.css +28 -0
- package/dist/runtime/public/scss/element-plus/common/var.css +28 -0
- package/dist/runtime/public/scss/element-plus/container.css +28 -0
- package/dist/runtime/public/scss/element-plus/dark/css-vars.css +28 -0
- package/dist/runtime/public/scss/element-plus/dark/var.css +28 -0
- package/dist/runtime/public/scss/element-plus/date-picker/date-picker.css +76 -14
- package/dist/runtime/public/scss/element-plus/date-picker/date-range-picker.css +41 -9
- package/dist/runtime/public/scss/element-plus/date-picker/date-table.css +31 -3
- package/dist/runtime/public/scss/element-plus/date-picker/month-table.css +28 -0
- package/dist/runtime/public/scss/element-plus/date-picker/picker-panel.css +69 -6
- package/dist/runtime/public/scss/element-plus/date-picker/picker.css +28 -0
- package/dist/runtime/public/scss/element-plus/date-picker/time-picker.css +56 -16
- package/dist/runtime/public/scss/element-plus/date-picker/time-range-picker.css +39 -4
- package/dist/runtime/public/scss/element-plus/date-picker/time-spinner.css +31 -4
- package/dist/runtime/public/scss/element-plus/date-picker/year-table.css +28 -0
- package/dist/runtime/public/scss/element-plus/date-picker.css +134 -50
- package/dist/runtime/public/scss/element-plus/descriptions-item.css +48 -8
- package/dist/runtime/public/scss/element-plus/descriptions.css +78 -16
- package/dist/runtime/public/scss/element-plus/dialog.css +30 -2
- package/dist/runtime/public/scss/element-plus/display.css +28 -0
- package/dist/runtime/public/scss/element-plus/divider.css +28 -0
- package/dist/runtime/public/scss/element-plus/drawer.css +28 -0
- package/dist/runtime/public/scss/element-plus/dropdown.css +43 -12
- package/dist/runtime/public/scss/element-plus/empty.css +28 -0
- package/dist/runtime/public/scss/element-plus/footer.css +28 -0
- package/dist/runtime/public/scss/element-plus/form.css +28 -0
- package/dist/runtime/public/scss/element-plus/header.css +28 -0
- package/dist/runtime/public/scss/element-plus/icon.css +30 -2
- package/dist/runtime/public/scss/element-plus/image-viewer.css +28 -0
- package/dist/runtime/public/scss/element-plus/image.css +28 -0
- package/dist/runtime/public/scss/element-plus/index.css +920 -329
- package/dist/runtime/public/scss/element-plus/input-number.css +50 -6
- package/dist/runtime/public/scss/element-plus/input.css +28 -0
- package/dist/runtime/public/scss/element-plus/link.css +59 -28
- package/dist/runtime/public/scss/element-plus/loading.css +28 -0
- package/dist/runtime/public/scss/element-plus/main.css +28 -0
- package/dist/runtime/public/scss/element-plus/mention.css +28 -0
- package/dist/runtime/public/scss/element-plus/menu.css +28 -0
- package/dist/runtime/public/scss/element-plus/message-box.css +34 -2
- package/dist/runtime/public/scss/element-plus/message.css +161 -31
- package/dist/runtime/public/scss/element-plus/mixins/mixins.css +28 -0
- package/dist/runtime/public/scss/element-plus/notification.css +41 -9
- package/dist/runtime/public/scss/element-plus/option-group.css +28 -0
- package/dist/runtime/public/scss/element-plus/option.css +29 -0
- package/dist/runtime/public/scss/element-plus/overlay.css +28 -0
- package/dist/runtime/public/scss/element-plus/page-header.css +28 -0
- package/dist/runtime/public/scss/element-plus/pagination.css +64 -11
- package/dist/runtime/public/scss/element-plus/popconfirm.css +28 -0
- package/dist/runtime/public/scss/element-plus/popover.css +28 -0
- package/dist/runtime/public/scss/element-plus/popper.css +29 -1
- package/dist/runtime/public/scss/element-plus/progress.css +28 -0
- package/dist/runtime/public/scss/element-plus/radio-button.css +36 -2
- package/dist/runtime/public/scss/element-plus/radio-group.css +28 -0
- package/dist/runtime/public/scss/element-plus/radio.css +28 -0
- package/dist/runtime/public/scss/element-plus/rate.css +28 -0
- package/dist/runtime/public/scss/element-plus/reset.css +28 -0
- package/dist/runtime/public/scss/element-plus/result.css +28 -0
- package/dist/runtime/public/scss/element-plus/row.css +28 -0
- package/dist/runtime/public/scss/element-plus/scrollbar.css +28 -0
- package/dist/runtime/public/scss/element-plus/segmented.css +28 -0
- package/dist/runtime/public/scss/element-plus/select-dropdown-v2.css +28 -0
- package/dist/runtime/public/scss/element-plus/select-dropdown.css +28 -0
- package/dist/runtime/public/scss/element-plus/select-v2.css +48 -23
- package/dist/runtime/public/scss/element-plus/select.css +48 -23
- package/dist/runtime/public/scss/element-plus/skeleton-item.css +28 -0
- package/dist/runtime/public/scss/element-plus/skeleton.css +28 -0
- package/dist/runtime/public/scss/element-plus/slider.css +28 -0
- package/dist/runtime/public/scss/element-plus/space.css +28 -0
- package/dist/runtime/public/scss/element-plus/spinner.css +28 -0
- package/dist/runtime/public/scss/element-plus/statistic.css +28 -0
- package/dist/runtime/public/scss/element-plus/step.css +28 -0
- package/dist/runtime/public/scss/element-plus/steps.css +28 -0
- package/dist/runtime/public/scss/element-plus/switch.css +116 -20
- package/dist/runtime/public/scss/element-plus/table-column.css +29 -1
- package/dist/runtime/public/scss/element-plus/table-v2.css +28 -0
- package/dist/runtime/public/scss/element-plus/table.css +28 -0
- package/dist/runtime/public/scss/element-plus/tabs.css +30 -2
- package/dist/runtime/public/scss/element-plus/tag.css +28 -0
- package/dist/runtime/public/scss/element-plus/text.css +34 -0
- package/dist/runtime/public/scss/element-plus/time-picker.css +111 -30
- package/dist/runtime/public/scss/element-plus/time-select.css +76 -14
- package/dist/runtime/public/scss/element-plus/timeline-item.css +28 -0
- package/dist/runtime/public/scss/element-plus/timeline.css +28 -0
- package/dist/runtime/public/scss/element-plus/tooltip-v2.css +28 -0
- package/dist/runtime/public/scss/element-plus/tour.css +30 -2
- package/dist/runtime/public/scss/element-plus/transfer.css +28 -0
- package/dist/runtime/public/scss/element-plus/tree-select.css +28 -0
- package/dist/runtime/public/scss/element-plus/tree.css +28 -0
- package/dist/runtime/public/scss/element-plus/upload.css +28 -0
- package/dist/runtime/public/scss/element-plus/var.css +29 -1
- package/dist/runtime/public/scss/element-plus/virtual-list.css +28 -0
- package/dist/runtime/public/scss/theme.css +79 -2
- package/dist/runtime/types.d.ts +7 -16
- package/package.json +1 -1
- package/dist/runtime/components/example.button.vue +0 -237
- package/dist/runtime/components/example.checkbox.vue +0 -190
- package/dist/runtime/components/example.form.vue +0 -494
- package/dist/runtime/components/example.input.vue +0 -286
- package/dist/runtime/components/example.input.vue.d.ts +0 -20
- package/dist/runtime/components/example.popover.vue +0 -161
- package/dist/runtime/components/example.radio.vue +0 -165
- package/dist/runtime/components/example.select.vue +0 -591
- package/dist/runtime/components/example.sidebar.vue +0 -104
- package/dist/runtime/components/example.tag.vue +0 -279
- package/dist/runtime/components/html-encode.vue +0 -37
- package/dist/runtime/plugins/element-extend-plugin.d.ts +0 -38
- package/dist/runtime/plugins/element-extend-plugin.js +0 -39
- package/dist/runtime/plugins/element-extend-plugin.mjs +0 -39
- package/dist/runtime/plugins/experimental-size-plugin.js +0 -13
- package/dist/runtime/plugins/experimental-size-plugin.mjs +0 -13
- /package/dist/runtime/plugins/{experimental-size-plugin.d.ts → disable-warnings-plugin.d.ts} +0 -0
- /package/dist/runtime/plugins/{theme-provider.d.ts → theme-provider-plugin.d.ts} +0 -0
- /package/dist/runtime/plugins/{theme-provider.js → theme-provider-plugin.js} +0 -0
- /package/dist/runtime/plugins/{theme-provider.mjs → theme-provider-plugin.mjs} +0 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col gap-8 mb-16">
|
|
3
|
+
<h1 class="">Menu</h1>
|
|
4
|
+
<p>Menu that provides navigation for your website.</p>
|
|
5
|
+
|
|
6
|
+
<el-card>
|
|
7
|
+
<template #header> Sidebar </template>
|
|
8
|
+
<div class="flex flex-col gap-3 items-start">
|
|
9
|
+
<p>
|
|
10
|
+
Vertical <el-text tag="mark">Menu</el-text> with sub-menus. You can use the <el-text tag="mark">el-menu-item-group</el-text> component to create a
|
|
11
|
+
<span class="font-medium">menu group</span>, and the name of the group is determined by the title prop or a named slot.
|
|
12
|
+
</p>
|
|
13
|
+
<div class="flex flex-col gap-4 items-start">
|
|
14
|
+
{{ currentRoute }}
|
|
15
|
+
<el-menu :default-active="currentRoute.path" class="w-[270px]" :router="true" @open="handleOpen" @close="handleClose">
|
|
16
|
+
<el-menu-item index="/" class="isax-grid-3">Dashboard</el-menu-item>
|
|
17
|
+
<el-menu-item index="/theme" class="isax-designtools">Theme</el-menu-item>
|
|
18
|
+
<el-menu-item index="/users" class="isax-profile-circle">User & Teams</el-menu-item>
|
|
19
|
+
<el-menu-item index="/devices" class="isax-monitor-mobbile">Devices</el-menu-item>
|
|
20
|
+
<el-menu-item index="/sites" class="isax-driver-2">Sites</el-menu-item>
|
|
21
|
+
<el-sub-menu index="1">
|
|
22
|
+
<template #title><i class="isax-key-square" /><span>Rules</span></template>
|
|
23
|
+
<el-menu-item index="/rules/firewall">Firewall</el-menu-item>
|
|
24
|
+
<el-menu-item index="/rules/routes">Routes</el-menu-item>
|
|
25
|
+
<el-menu-item index="/rules/forwarding">Forwarding</el-menu-item>
|
|
26
|
+
<el-menu-item index="/rules/acls">Access Control List</el-menu-item>
|
|
27
|
+
</el-sub-menu>
|
|
28
|
+
<el-sub-menu index="2">
|
|
29
|
+
<template #title><i class="isax-shield" /><span>Zero Trust Security</span></template>
|
|
30
|
+
<el-menu-item index="/ztna/dashboard">Dashboard</el-menu-item>
|
|
31
|
+
<el-menu-item index="/ztna/behavior-detection">Behaviors</el-menu-item>
|
|
32
|
+
<el-menu-item index="/ztna/device-posture-check">Device Posture Checks</el-menu-item>
|
|
33
|
+
<el-menu-item index="/ztna/behavior-detection">User Sign-In Policies</el-menu-item>
|
|
34
|
+
<el-menu-item index="/ztna/behavior-detection">Admin Sign-In Policies</el-menu-item>
|
|
35
|
+
</el-sub-menu>
|
|
36
|
+
<el-sub-menu index="3">
|
|
37
|
+
<template #title><i class="isax-folder-open" /><span>Insights</span></template>
|
|
38
|
+
<el-menu-item index="/insights/alerts">Alerts</el-menu-item>
|
|
39
|
+
<el-menu-item index="/ztna/dashboard">Traffic Logs</el-menu-item>
|
|
40
|
+
<el-menu-item index="/ztna/dashboard">Events</el-menu-item>
|
|
41
|
+
<el-menu-item index="/insights/blocked-ips">Blocked IP Addresses</el-menu-item>
|
|
42
|
+
<el-menu-item index="/insights/signed-logs">"Signed Logs"</el-menu-item>
|
|
43
|
+
<el-menu-item index="/insights/reports">Automated Reports</el-menu-item>
|
|
44
|
+
<el-menu-item index="/insights/tracker">Productivity Reports</el-menu-item>
|
|
45
|
+
<el-menu-item index="/insights/dpc-reports">Device Posture Reports</el-menu-item>
|
|
46
|
+
</el-sub-menu>
|
|
47
|
+
<el-sub-menu index="4">
|
|
48
|
+
<template #title><i class="isax-setting-2" /><span>Settings</span></template>
|
|
49
|
+
<el-menu-item index="/settings/captive-portals">Captive Portal</el-menu-item>
|
|
50
|
+
<el-menu-item index="/settings/integrations">Integrations</el-menu-item>
|
|
51
|
+
<el-menu-item index="/settings/configuration">Configurations</el-menu-item>
|
|
52
|
+
<el-menu-item index="/settings/tags">Tags</el-menu-item>
|
|
53
|
+
<el-menu-item index="/settings/administrators">Administrators</el-menu-item>
|
|
54
|
+
<el-menu-item index="/settings/organization">Organization</el-menu-item>
|
|
55
|
+
<el-menu-item index="/settings/downloads">Downloads</el-menu-item>
|
|
56
|
+
</el-sub-menu>
|
|
57
|
+
</el-menu>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
<template #footer>
|
|
61
|
+
<html-encode :tag="snippets.sizes" />
|
|
62
|
+
</template>
|
|
63
|
+
</el-card>
|
|
64
|
+
</div>
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<script lang="ts" setup>
|
|
68
|
+
import { useRoute } from 'nuxt/app';
|
|
69
|
+
import { computed } from 'vue';
|
|
70
|
+
|
|
71
|
+
const route = useRoute();
|
|
72
|
+
const currentRoute = computed(() => ({
|
|
73
|
+
path: route.path,
|
|
74
|
+
fullPath: route.fullPath,
|
|
75
|
+
name: route.name,
|
|
76
|
+
params: route.params,
|
|
77
|
+
query: route.query,
|
|
78
|
+
}));
|
|
79
|
+
const handleOpen = (key: string, keyPath: string[]) => {
|
|
80
|
+
console.log(key, keyPath);
|
|
81
|
+
};
|
|
82
|
+
const handleClose = (key: string, keyPath: string[]) => {
|
|
83
|
+
console.log(key, keyPath);
|
|
84
|
+
};
|
|
85
|
+
const snippets = ref({
|
|
86
|
+
sizes: `
|
|
87
|
+
<el-menu :default-active="currentRoute.path" class="w-[270px]" :router="true" @open="handleOpen" @close="handleClose">
|
|
88
|
+
<el-sub-menu index="4">
|
|
89
|
+
<template #title><i class="isax-setting-2" /><span>Settings</span></template>
|
|
90
|
+
<el-menu-item index="/settings/captive-portals">Captive Portal</el-menu-item>
|
|
91
|
+
<el-menu-item index="/settings/integrations">Integrations</el-menu-item>
|
|
92
|
+
<el-menu-item index="/settings/configuration">Configurations</el-menu-item>
|
|
93
|
+
<el-menu-item index="/settings/tags">Tags</el-menu-item>
|
|
94
|
+
<el-menu-item index="/settings/administrators">Administrators</el-menu-item>
|
|
95
|
+
<el-menu-item index="/settings/organization">Organization</el-menu-item>
|
|
96
|
+
<el-menu-item index="/settings/downloads">Downloads</el-menu-item>
|
|
97
|
+
</el-sub-menu>
|
|
98
|
+
</el-menu>
|
|
99
|
+
`,
|
|
100
|
+
});
|
|
101
|
+
</script>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col gap-8 mb-16">
|
|
3
|
+
<h1 class="">Static - (Coding Not Started)</h1>
|
|
4
|
+
<p>Display statistics.</p>
|
|
5
|
+
|
|
6
|
+
<el-card>
|
|
7
|
+
<template #header>Basic usage</template>
|
|
8
|
+
<div class="flex flex-col gap-3">
|
|
9
|
+
<p>
|
|
10
|
+
To highlight a number or a group of numbers, such as statistical value, amount, and ranking, you can add elements such as icon and unit before and after the number and
|
|
11
|
+
title. And use vueuse to add animated transitions to value.
|
|
12
|
+
</p>
|
|
13
|
+
<section class="flex gap-7.5">
|
|
14
|
+
<el-statistic :value="138">
|
|
15
|
+
<template #title>
|
|
16
|
+
<div style="align-items: center; display: inline-flex">
|
|
17
|
+
Ratio of men to women
|
|
18
|
+
<el-icon style="margin-left: 4px" :size="12">
|
|
19
|
+
<ElIconMale />
|
|
20
|
+
</el-icon>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
<template #suffix>/100</template>
|
|
24
|
+
</el-statistic>
|
|
25
|
+
</section>
|
|
26
|
+
</div>
|
|
27
|
+
<template #footer> <html-encode :tag="snippets.basic" /> </template>
|
|
28
|
+
</el-card>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script lang="ts" setup>
|
|
33
|
+
import { ref } from 'vue';
|
|
34
|
+
|
|
35
|
+
const snippets = ref({
|
|
36
|
+
basic: `
|
|
37
|
+
<el-statistic :value="138">
|
|
38
|
+
<template #title>
|
|
39
|
+
<div style="align-items: center; display: inline-flex">
|
|
40
|
+
Ratio of men to women
|
|
41
|
+
<el-icon style="margin-left: 4px" :size="12">
|
|
42
|
+
<ElIconMale />
|
|
43
|
+
</el-icon>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
<template #suffix>/100</template>
|
|
47
|
+
</el-statistic>
|
|
48
|
+
`,
|
|
49
|
+
});
|
|
50
|
+
</script>
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col gap-8 mb-16">
|
|
3
|
+
<h1 class="">Switch</h1>
|
|
4
|
+
<p>Switch is used for switching between two opposing states.</p>
|
|
5
|
+
|
|
6
|
+
<el-card>
|
|
7
|
+
<template #header> Basic usage </template>
|
|
8
|
+
<div class="flex flex-col gap-3">
|
|
9
|
+
<p>
|
|
10
|
+
Bind <el-text tag="mark">v-model</el-text> to a Boolean typed variable. The <el-text tag="mark">--el-switch-on-color</el-text> and
|
|
11
|
+
<el-text tag="mark">--el-switch-off-color</el-text> CSS variables decides the background color in two states.
|
|
12
|
+
</p>
|
|
13
|
+
<div class="flex gap-4">
|
|
14
|
+
<el-switch v-model="value" />
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
<template #footer> <html-encode :tag="snippets.basic" /> </template>
|
|
18
|
+
</el-card>
|
|
19
|
+
|
|
20
|
+
<el-card>
|
|
21
|
+
<template #header> Sizes </template>
|
|
22
|
+
<div class="flex flex-col gap-3">
|
|
23
|
+
<p>You can set <el-text tag="mark">size</el-text>.</p>
|
|
24
|
+
<div class="flex flex-row gap-7.5">
|
|
25
|
+
<div v-for="size of sizes" :key="size" class="flex flex-col items-start border p-4 rounded">
|
|
26
|
+
<h5 class="font-normal text-neutral-7 grow">{{ size }}</h5>
|
|
27
|
+
<el-switch v-model="value" :size="size" active-text="Open" inactive-text="Close" />
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<template #footer> <html-encode :tag="snippets.sizes" /> </template>
|
|
32
|
+
</el-card>
|
|
33
|
+
|
|
34
|
+
<el-card>
|
|
35
|
+
<template #header> Text description </template>
|
|
36
|
+
<div class="flex flex-col gap-3">
|
|
37
|
+
<p>
|
|
38
|
+
You can add <el-text tag="mark">active-text</el-text> and <el-text tag="mark">inactive-text</el-text> attribute to show texts. use
|
|
39
|
+
<el-text tag="mark">inline-prompt</el-text> attribute to control text is displayed inside dot. You can add active-text and inactive-text attribute to show texts.
|
|
40
|
+
</p>
|
|
41
|
+
<div class="flex flex-col items-start">
|
|
42
|
+
<el-switch v-model="value" active-text="Pay by month" inactive-text="Pay by year" />
|
|
43
|
+
<el-switch v-model="value" inline-prompt width="40" active-text="超出省略" inactive-text="超出省略" />
|
|
44
|
+
<el-switch v-model="value" width="80" inline-prompt active-text="超出省略" inactive-text="超出省略" />
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
<template #footer> <html-encode :tag="snippets.text" /> </template>
|
|
48
|
+
</el-card>
|
|
49
|
+
|
|
50
|
+
<el-card>
|
|
51
|
+
<template #header> Extended value types </template>
|
|
52
|
+
<div class="flex flex-col gap-3">
|
|
53
|
+
<p>
|
|
54
|
+
You can set <el-text tag="mark">active-value</el-text> and <el-text tag="mark">inactive-value</el-text> attributes. They both receive a Boolean, String or Number typed
|
|
55
|
+
value.
|
|
56
|
+
</p>
|
|
57
|
+
<div class="flex items-center gap-4">
|
|
58
|
+
<el-tooltip :content="'Switch value: ' + custom" placement="top">
|
|
59
|
+
<el-switch v-model="custom" active-value="100" inactive-value="0" size="default" :active-text="`Value is ${custom}`" />
|
|
60
|
+
</el-tooltip>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
<template #footer> <html-encode :tag="snippets.value" /> </template>
|
|
64
|
+
</el-card>
|
|
65
|
+
|
|
66
|
+
<el-card>
|
|
67
|
+
<template #header> Disabled </template>
|
|
68
|
+
<div class="flex flex-col gap-3">
|
|
69
|
+
<p>Adding the disabled attribute <el-text tag="mark">disables</el-text> Switch.</p>
|
|
70
|
+
<div class="flex items-center gap-4">
|
|
71
|
+
<el-switch v-model="value" disabled />
|
|
72
|
+
<el-switch v-model="value" class="ml-2" />
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
<template #footer> <html-encode :tag="snippets.disable" /> </template>
|
|
76
|
+
</el-card>
|
|
77
|
+
</div>
|
|
78
|
+
</template>
|
|
79
|
+
|
|
80
|
+
<script lang="ts" setup>
|
|
81
|
+
import { ref } from 'vue';
|
|
82
|
+
|
|
83
|
+
const value = ref(true);
|
|
84
|
+
const custom = ref(100);
|
|
85
|
+
const sizes = ref(['default', 'large', 'medium', 'small', 'mini']);
|
|
86
|
+
const snippets = ref({
|
|
87
|
+
basic: `<el-switch v-model="value2" class="ml-2" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949" />`,
|
|
88
|
+
sizes: `<el-switch v-model="value" size="large" />`,
|
|
89
|
+
text: `
|
|
90
|
+
<el-switch v-model="value" active-text="Pay by month" inactive-text="Pay by year" />
|
|
91
|
+
<el-switch v-model="value" inline-prompt width="40" active-text="超出省略" inactive-text="超出省略" />
|
|
92
|
+
<el-switch v-model="value" width="80" inline-prompt active-text="超出省略" inactive-text="超出省略" />
|
|
93
|
+
`,
|
|
94
|
+
value: `
|
|
95
|
+
<el-tooltip :content="'Switch value: ' + custom" placement="top">
|
|
96
|
+
<el-switch v-model="custom" active-value="100" inactive-value="0" size="default" :active-text="\`Value is \${custom}\`" />
|
|
97
|
+
</el-tooltip>
|
|
98
|
+
`,
|
|
99
|
+
disable: `<el-switch v-model="value" disabled />`,
|
|
100
|
+
});
|
|
101
|
+
</script>
|
|
@@ -4,27 +4,13 @@
|
|
|
4
4
|
<p>Display multiple data with similar format. You can sort, filter, compare your data in a table.</p>
|
|
5
5
|
|
|
6
6
|
<el-card>
|
|
7
|
-
<template #header>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
</p>
|
|
15
|
-
<h3>Table has these properties:</h3>
|
|
16
|
-
<ul class="list-disc list-inside gap-1 flex flex-col [&_span]:w-28 [&_span]:inline-flex">
|
|
17
|
-
<li><span>Max Height:</span> <html-encode tag="<el-table max-height='250' />" /></li>
|
|
18
|
-
<li><span>Height:</span> <html-encode tag="<el-table height='250' />" /></li>
|
|
19
|
-
<li><span>Sorting:</span> <html-encode tag="<el-table default-sort='{ prop: 'date', order: 'descending' }' />" /></li>
|
|
20
|
-
<li><span>Min Height:</span> <html-encode tag="<el-table-column min-height='120' />" /></li>
|
|
21
|
-
<li><span>Tooltip:</span> <html-encode tag="<el-table-column show-overflow-tooltip />" /></li>
|
|
22
|
-
<li><span>Width:</span> <html-encode tag="<el-table-column width='120px' />" /></li>
|
|
23
|
-
<li><span>Fixed:</span> <html-encode tag="<el-table-column fixed='right' />" /></li>
|
|
24
|
-
</ul>
|
|
25
|
-
</div>
|
|
26
|
-
</template>
|
|
27
|
-
<div class="flex gap-2">
|
|
7
|
+
<template #header> Basic table </template>
|
|
8
|
+
<div class="flex flex-col gap-7.5 items-start">
|
|
9
|
+
<p>
|
|
10
|
+
Basic table is just for data display. After setting attribute <el-text tag="mark">data</el-text> of <el-text tag="mark">el-table</el-text> with an object array, you can
|
|
11
|
+
use prop (corresponding to a key of the object in data array) in <el-text tag="mark">el-table-column</el-text> to insert data to table columns, and set the attribute
|
|
12
|
+
<el-text tag="mark">label</el-text> to define the column name. You can also use the attribute <el-text tag="mark">width</el-text> to define the width of columns.
|
|
13
|
+
</p>
|
|
28
14
|
<el-table :data="tableData" style="width: 100%" flexible height="300">
|
|
29
15
|
<el-table-column type="selection" width="55" />
|
|
30
16
|
<el-table-column label="Date" width="120" show-overflow-tooltip>
|
|
@@ -46,7 +32,7 @@
|
|
|
46
32
|
</div>
|
|
47
33
|
</template>
|
|
48
34
|
<script lang="ts" setup>
|
|
49
|
-
import { ElTable } from '
|
|
35
|
+
import { ElTable } from 'element-plus';
|
|
50
36
|
|
|
51
37
|
interface User {
|
|
52
38
|
date: string;
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col gap-8 mb-16">
|
|
3
|
+
<h1 class="">Tag</h1>
|
|
4
|
+
<p>Used for marking and selection.</p>
|
|
5
|
+
|
|
6
|
+
<el-card>
|
|
7
|
+
<template #header>Types</template>
|
|
8
|
+
<div class="flex flex-col gap-3 items-start">
|
|
9
|
+
<p>
|
|
10
|
+
Use the <el-text tag="mark">type</el-text> attribute to define Tag's type. In addition, the <el-text tag="mark">color</el-text> attribute can be used to set the
|
|
11
|
+
background color of the Tag.
|
|
12
|
+
</p>
|
|
13
|
+
<div class="flex gap-2">
|
|
14
|
+
<el-tag v-for="(color, key) in colors" :key="key + color" :type="color">{{ color }}</el-tag>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
<template #footer><html-encode :tag="snippets.types" /> </template>
|
|
18
|
+
</el-card>
|
|
19
|
+
|
|
20
|
+
<el-card>
|
|
21
|
+
<template #header> Sizes </template>
|
|
22
|
+
<div class="flex flex-col gap-3 items-start">
|
|
23
|
+
<p>
|
|
24
|
+
Besides default size, Tag component provides three additional sizes for you to choose among different scenarios. Use attribute size to set additional sizes with
|
|
25
|
+
<el-text tag="mark">
|
|
26
|
+
{{ sizes.join(', ') }}
|
|
27
|
+
</el-text>
|
|
28
|
+
</p>
|
|
29
|
+
<div class="flex gap-2">
|
|
30
|
+
<el-tag v-for="(size, key) in sizes" :key="key + size" :size="size">{{ size }}</el-tag>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
<template #footer> <html-encode :tag="snippets.sizes" /> </template>
|
|
34
|
+
</el-card>
|
|
35
|
+
|
|
36
|
+
<el-card>
|
|
37
|
+
<template #header> Removable Tag </template>
|
|
38
|
+
<div class="flex flex-col gap-3 items-start">
|
|
39
|
+
<p>
|
|
40
|
+
<el-text tag="mark">closable</el-text> attribute can be used to define a removable tag. It accepts a Boolean. By default the removal of Tag has a fading animation. If you
|
|
41
|
+
don't want to use it, you can set the <el-text tag="mark">disable-transitions</el-text> attribute, which accepts a Boolean, to true. close event triggers when Tag is
|
|
42
|
+
removed.
|
|
43
|
+
</p>
|
|
44
|
+
<div class="flex gap-2">
|
|
45
|
+
<el-tag v-for="tag in tags" :key="tag.name" closable :type="tag.type">
|
|
46
|
+
{{ tag.name }}
|
|
47
|
+
</el-tag>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
<template #footer> <html-encode :tag="snippets.closable" /> </template>
|
|
51
|
+
</el-card>
|
|
52
|
+
|
|
53
|
+
<el-card>
|
|
54
|
+
<template #header> Edit Dynamically </template>
|
|
55
|
+
<div class="flex flex-col gap-3 items-start">
|
|
56
|
+
<p>You can use the <el-text tag="mark">close</el-text> event to add and remove tag dynamically.</p>
|
|
57
|
+
<div class="flex gap-2">
|
|
58
|
+
<el-tag v-for="tag in dynamicTags" :key="tag" closable :disable-transitions="false" @close="handleClose(tag)">
|
|
59
|
+
{{ tag }}
|
|
60
|
+
</el-tag>
|
|
61
|
+
<el-input v-if="inputVisible" ref="InputRef" v-model="inputValue" class="!w-20" size="mini" @keyup.enter="handleInputConfirm" @blur="handleInputConfirm" />
|
|
62
|
+
<el-button v-else class="button-new-tag" size="mini" @click="showInput"> + New Tag </el-button>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
<template #footer> <html-encode :tag="snippets.dynamic" /> </template>
|
|
66
|
+
</el-card>
|
|
67
|
+
|
|
68
|
+
<el-card>
|
|
69
|
+
<template #header> Theme </template>
|
|
70
|
+
<div class="flex flex-col gap-3 items-start">
|
|
71
|
+
<p>Tag provide three different themes: dark、light and plain Using effect to change, default is light</p>
|
|
72
|
+
<div class="flex flex-col gap-2">
|
|
73
|
+
<div class="flex gap-2">
|
|
74
|
+
<span>Dark</span>
|
|
75
|
+
<el-tag v-for="item in items" :key="item.label" :type="item.type" effect="dark">
|
|
76
|
+
{{ item.label }}
|
|
77
|
+
</el-tag>
|
|
78
|
+
</div>
|
|
79
|
+
<div class="flex gap-2 mt-4">
|
|
80
|
+
<span>Light</span>
|
|
81
|
+
<el-tag v-for="item in items" :key="item.label" :type="item.type" effect="light">
|
|
82
|
+
{{ item.label }}
|
|
83
|
+
</el-tag>
|
|
84
|
+
</div>
|
|
85
|
+
<div class="flex gap-2 mt-4">
|
|
86
|
+
<span>Plain</span>
|
|
87
|
+
<el-tag v-for="item in items" :key="item.label" :type="item.type" effect="plain">
|
|
88
|
+
{{ item.label }}
|
|
89
|
+
</el-tag>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
<template #footer> <html-encode :tag="snippets.theme" /> </template>
|
|
94
|
+
</el-card>
|
|
95
|
+
|
|
96
|
+
<el-card>
|
|
97
|
+
<template #header> Rounded </template>
|
|
98
|
+
<div class="flex flex-col gap-3 items-start">
|
|
99
|
+
<p>Tag can also be rounded like button.</p>
|
|
100
|
+
<div class="flex flex-col gap-2">
|
|
101
|
+
<div class="flex gap-2">
|
|
102
|
+
<el-tag v-for="item in items" :key="item.label" :type="item.type" effect="dark" round>
|
|
103
|
+
{{ item.label }}
|
|
104
|
+
</el-tag>
|
|
105
|
+
</div>
|
|
106
|
+
<div class="flex gap-2 mt-4">
|
|
107
|
+
<el-tag v-for="item in items" :key="item.label" :type="item.type" effect="light" round>
|
|
108
|
+
{{ item.label }}
|
|
109
|
+
</el-tag>
|
|
110
|
+
</div>
|
|
111
|
+
<div class="flex gap-2 mt-4">
|
|
112
|
+
<el-tag v-for="item in items" :key="item.label" :type="item.type" effect="plain" round>
|
|
113
|
+
{{ item.label }}
|
|
114
|
+
</el-tag>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
<template #footer> <html-encode :tag="snippets.rounded" /> </template>
|
|
119
|
+
</el-card>
|
|
120
|
+
|
|
121
|
+
<el-card>
|
|
122
|
+
<template #header> Checkable Tag </template>
|
|
123
|
+
<div class="flex flex-col gap-3 items-start">
|
|
124
|
+
<p>
|
|
125
|
+
Sometimes because of the business needs, we might need checkbox like tag, but button like checkbox cannot meet our needs, here comes
|
|
126
|
+
<el-text tag="mark">check-tag</el-text>. You can use type prop in 2.5.4. basic check-tag usage, the API is rather simple.
|
|
127
|
+
</p>
|
|
128
|
+
<div class="flex gap-2">
|
|
129
|
+
<div class="flex gap-2">
|
|
130
|
+
<el-check-tag checked>Checked</el-check-tag>
|
|
131
|
+
<el-check-tag :checked="checked" @change="onChange">Toggle me</el-check-tag>
|
|
132
|
+
</div>
|
|
133
|
+
<el-check-tag :checked="checked1" type="primary" @change="onChange1"> Tag 1 </el-check-tag>
|
|
134
|
+
<el-check-tag :checked="checked2" type="success" @change="onChange2"> Tag 2 </el-check-tag>
|
|
135
|
+
<el-check-tag :checked="checked3" type="info" @change="onChange3"> Tag 3 </el-check-tag>
|
|
136
|
+
<el-check-tag :checked="checked4" type="warning" @change="onChange4"> Tag 4 </el-check-tag>
|
|
137
|
+
<el-check-tag :checked="checked5" type="danger" @change="onChange5"> Tag 5 </el-check-tag>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
<template #footer> <html-encode :tag="snippets.checked" /> </template>
|
|
141
|
+
</el-card>
|
|
142
|
+
</div>
|
|
143
|
+
</template>
|
|
144
|
+
|
|
145
|
+
<script lang="ts" setup>
|
|
146
|
+
import type { InputInstance } from 'element-plus';
|
|
147
|
+
import type { TagProps } from 'element-plus';
|
|
148
|
+
import { ElInput } from 'element-plus';
|
|
149
|
+
import { nextTick, ref } from 'vue';
|
|
150
|
+
|
|
151
|
+
interface TagsItem {
|
|
152
|
+
name: string;
|
|
153
|
+
type: TagProps['type'];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
type Item = { type: TagProps['type']; label: string };
|
|
157
|
+
|
|
158
|
+
const checked = ref(false);
|
|
159
|
+
const checked1 = ref(true);
|
|
160
|
+
const checked2 = ref(true);
|
|
161
|
+
const checked3 = ref(true);
|
|
162
|
+
const checked4 = ref(true);
|
|
163
|
+
const checked5 = ref(true);
|
|
164
|
+
const onChange = (status: boolean) => {
|
|
165
|
+
checked.value = status;
|
|
166
|
+
};
|
|
167
|
+
const onChange1 = (status: boolean) => {
|
|
168
|
+
checked1.value = status;
|
|
169
|
+
};
|
|
170
|
+
const onChange2 = (status: boolean) => {
|
|
171
|
+
checked2.value = status;
|
|
172
|
+
};
|
|
173
|
+
const onChange3 = (status: boolean) => {
|
|
174
|
+
checked3.value = status;
|
|
175
|
+
};
|
|
176
|
+
const onChange4 = (status: boolean) => {
|
|
177
|
+
checked4.value = status;
|
|
178
|
+
};
|
|
179
|
+
const onChange5 = (status: boolean) => {
|
|
180
|
+
checked5.value = status;
|
|
181
|
+
};
|
|
182
|
+
const items = ref<Array<Item>>([
|
|
183
|
+
{ type: 'primary', label: 'Tag 1' },
|
|
184
|
+
{ type: 'secondary', label: 'Tag 2' },
|
|
185
|
+
{ type: 'neutral', label: 'Tag 2' },
|
|
186
|
+
{ type: 'success', label: 'Tag 2' },
|
|
187
|
+
{ type: 'info', label: 'Tag 3' },
|
|
188
|
+
{ type: 'warning', label: 'Tag 4' },
|
|
189
|
+
{ type: 'danger', label: 'Tag 5' },
|
|
190
|
+
]);
|
|
191
|
+
const tags = ref<TagsItem[]>([
|
|
192
|
+
{ name: 'Tag 1', type: 'primary' },
|
|
193
|
+
{ name: 'Tag 1', type: 'secondary' },
|
|
194
|
+
{ name: 'Tag 1', type: 'neutral' },
|
|
195
|
+
{ name: 'Tag 2', type: 'success' },
|
|
196
|
+
{ name: 'Tag 3', type: 'info' },
|
|
197
|
+
{ name: 'Tag 4', type: 'warning' },
|
|
198
|
+
{ name: 'Tag 5', type: 'danger' },
|
|
199
|
+
]);
|
|
200
|
+
const inputValue = ref('');
|
|
201
|
+
const dynamicTags = ref(['Tag 1', 'Tag 2', 'Tag 3']);
|
|
202
|
+
const inputVisible = ref(false);
|
|
203
|
+
const InputRef = ref<InputInstance>();
|
|
204
|
+
const handleClose = (tag: string) => {
|
|
205
|
+
dynamicTags.value.splice(dynamicTags.value.indexOf(tag), 1);
|
|
206
|
+
};
|
|
207
|
+
const showInput = () => {
|
|
208
|
+
inputVisible.value = true;
|
|
209
|
+
nextTick(() => {
|
|
210
|
+
InputRef.value!.input!.focus();
|
|
211
|
+
});
|
|
212
|
+
};
|
|
213
|
+
const handleInputConfirm = () => {
|
|
214
|
+
if (inputValue.value) {
|
|
215
|
+
dynamicTags.value.push(inputValue.value);
|
|
216
|
+
}
|
|
217
|
+
inputVisible.value = false;
|
|
218
|
+
inputValue.value = '';
|
|
219
|
+
};
|
|
220
|
+
</script>
|
|
221
|
+
|
|
222
|
+
<script lang="ts">
|
|
223
|
+
import { defineComponent } from 'vue';
|
|
224
|
+
|
|
225
|
+
export default defineComponent({
|
|
226
|
+
name: 'TimusTag',
|
|
227
|
+
data() {
|
|
228
|
+
return {
|
|
229
|
+
sizes: ['default', 'large', 'medium', 'small', 'mini'],
|
|
230
|
+
colors: ['primary', 'secondary', 'neutral', 'success', 'warning', 'info', 'danger'],
|
|
231
|
+
value: '',
|
|
232
|
+
snippets: {
|
|
233
|
+
types: `<el-tag type="success">tag</el-tag>`,
|
|
234
|
+
sizes: `<el-tag size="large">tag</el-tag>`,
|
|
235
|
+
closable: `<el-tag size="large" type="success" closable>tag</el-tag>`,
|
|
236
|
+
dynamic: `<el-tag closable :disable-transitions="false" @close="handleClose(tag)"> tag </el-tag>`,
|
|
237
|
+
theme: `
|
|
238
|
+
<el-tag effect="dark"> tag </el-tag>
|
|
239
|
+
<el-tag effect="light"> tag </el-tag>
|
|
240
|
+
<el-tag effect="plain"> tag </el-tag>
|
|
241
|
+
`,
|
|
242
|
+
rounded: `<el-tag round>tag</el-tag>`,
|
|
243
|
+
checked: `<el-check-tag :checked="checked1" type="primary" @change="onChange1"> Tag 1 </el-check-tag>`,
|
|
244
|
+
},
|
|
245
|
+
};
|
|
246
|
+
},
|
|
247
|
+
methods: {
|
|
248
|
+
capitalize(value: string): string {
|
|
249
|
+
const text = String(value);
|
|
250
|
+
|
|
251
|
+
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
});
|
|
255
|
+
</script>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col gap-8 mb-16">
|
|
3
|
+
<h1 class="">TimePicker</h1>
|
|
4
|
+
<p>Use Time Picker for time input.</p>
|
|
5
|
+
|
|
6
|
+
<el-card>
|
|
7
|
+
<template #header>Arbitrary time picker</template>
|
|
8
|
+
<div class="flex flex-col gap-3">
|
|
9
|
+
<p>
|
|
10
|
+
Can pick an arbitrary time. By default, you can scroll the mouse wheel to pick time, alternatively you can use the control arrows when the
|
|
11
|
+
<el-text tag="mark">arrow-control</el-text> attribute is set.
|
|
12
|
+
</p>
|
|
13
|
+
<section class="flex gap-7.5">
|
|
14
|
+
<el-time-picker v-model="value" placeholder="Arbitrary time" />
|
|
15
|
+
<el-time-picker v-model="value" arrow-control placeholder="Arbitrary time" />
|
|
16
|
+
</section>
|
|
17
|
+
</div>
|
|
18
|
+
<template #footer> <html-encode :tag="snippets.basic" /> </template>
|
|
19
|
+
</el-card>
|
|
20
|
+
|
|
21
|
+
<el-card>
|
|
22
|
+
<template #header>Limit the time range</template>
|
|
23
|
+
<div class="flex flex-col gap-3">
|
|
24
|
+
<p>
|
|
25
|
+
You can also limit the time range. Limit the time range by specifying <el-text tag="mark">disabledHours</el-text> <el-text tag="mark">disabledMinutes</el-text> and
|
|
26
|
+
<el-text tag="mark">disabledSeconds</el-text>.
|
|
27
|
+
</p>
|
|
28
|
+
<section class="flex gap-7.5">
|
|
29
|
+
<el-time-picker v-model="limited" :disabled-hours="disabledHours" :disabled-minutes="disabledMinutes" :disabled-seconds="disabledSeconds" placeholder="Arbitrary time" />
|
|
30
|
+
</section>
|
|
31
|
+
</div>
|
|
32
|
+
<template #footer> <html-encode :tag="snippets.limit" /> </template>
|
|
33
|
+
</el-card>
|
|
34
|
+
|
|
35
|
+
<el-card>
|
|
36
|
+
<template #header>Arbitrary time range</template>
|
|
37
|
+
<div class="flex flex-col gap-3">
|
|
38
|
+
<p>
|
|
39
|
+
Can pick an arbitrary time range. We can pick a time range by adding an <el-text tag="mark">is-range</el-text> attribute. Also,
|
|
40
|
+
<el-text tag="mark">arrow-control</el-text> is supported in range mode.
|
|
41
|
+
</p>
|
|
42
|
+
<section class="flex gap-7.5">
|
|
43
|
+
<el-time-picker v-model="range" is-range range-separator="To" start-placeholder="Start time" end-placeholder="End time" />
|
|
44
|
+
<el-time-picker v-model="range" is-range arrow-control range-separator="To" start-placeholder="Start time" end-placeholder="End time" />
|
|
45
|
+
</section>
|
|
46
|
+
</div>
|
|
47
|
+
<template #footer> <html-encode :tag="snippets.arbitrary" /> </template>
|
|
48
|
+
</el-card>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script lang="ts" setup>
|
|
53
|
+
import type { GetDisabledMinutes } from 'element-plus';
|
|
54
|
+
import { ref } from 'vue';
|
|
55
|
+
|
|
56
|
+
const value = ref('');
|
|
57
|
+
const range = ref<[Date, Date]>([new Date(2016, 9, 10, 8, 40), new Date(2016, 9, 10, 9, 40)]);
|
|
58
|
+
const limited = ref(new Date(2016, 9, 10, 18, 30));
|
|
59
|
+
const makeRange = (start: number, end: number) => {
|
|
60
|
+
const result: number[] = [];
|
|
61
|
+
|
|
62
|
+
for (let i = start; i <= end; i++) {
|
|
63
|
+
result.push(i);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return result;
|
|
67
|
+
};
|
|
68
|
+
const disabledHours = () => makeRange(0, 16).concat(makeRange(19, 23));
|
|
69
|
+
const disabledMinutes: GetDisabledMinutes = (hour: number) => {
|
|
70
|
+
if (hour === 17) {
|
|
71
|
+
return makeRange(0, 29) as number[];
|
|
72
|
+
}
|
|
73
|
+
if (hour === 18) {
|
|
74
|
+
return makeRange(31, 59) as number[];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return [];
|
|
78
|
+
};
|
|
79
|
+
const disabledSeconds = (hour: number, minute: number) => {
|
|
80
|
+
if (hour === 18 && minute === 30) {
|
|
81
|
+
return makeRange(1, 59);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const snippets = ref({
|
|
85
|
+
basic: `<el-time-picker v-model="value" arrow-control placeholder="Arbitrary time" />`,
|
|
86
|
+
limit: `<el-time-picker v-model="limited" :disabled-hours="disabledHours" :disabled-minutes="disabledMinutes" :disabled-seconds="disabledSeconds" placeholder="Arbitrary time" />`,
|
|
87
|
+
arbitrary: `<el-time-picker v-model="range" is-range arrow-control range-separator="To" start-placeholder="Start time" end-placeholder="End time" />`,
|
|
88
|
+
});
|
|
89
|
+
</script>
|