@dhtmlx/trial-vue-gantt 1.1.2 → 9.1.4
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 +126 -262
- package/dist/dhtmlxgantt.vue.es.d.ts +352 -0
- package/dist/dhtmlxgantt.vue.es.js +18052 -0
- package/dist/vue-gantt.css +1 -0
- package/license.txt +43 -0
- package/package.json +55 -62
- package/whatsnew.md +1157 -0
- package/public/dist/gantt.js +0 -1
- package/src/components/Gantt.vue +0 -238
- package/src/components/TimeScale.vue +0 -57
- package/src/components/chart/Bars.vue +0 -470
- package/src/components/chart/CellGrid.vue +0 -22
- package/src/components/chart/Chart.vue +0 -236
- package/src/components/chart/Links.vue +0 -35
- package/src/components/chart/NewLink.vue +0 -39
- package/src/components/grid/Body.vue +0 -256
- package/src/components/grid/Grid.vue +0 -98
- package/src/components/grid/Header.vue +0 -104
- package/src/components/grid/actions/reorder.js +0 -193
- package/src/components/sidebar/Links.vue +0 -147
- package/src/components/sidebar/Sidebar.vue +0 -219
- package/src/locales/cn.js +0 -21
- package/src/locales/en.js +0 -21
- package/src/locales/ru.js +0 -21
- package/src/main.js +0 -46
- package/src/state/local.js +0 -48
- package/src/wx/Button.vue +0 -54
- package/src/wx/CNLocale.js +0 -15
- package/src/wx/Calendar.vue +0 -194
- package/src/wx/Counter.vue +0 -154
- package/src/wx/Datepicker.vue +0 -153
- package/src/wx/DefaultTheme.vue +0 -104
- package/src/wx/ENLocale.js +0 -15
- package/src/wx/IconButton.vue +0 -39
- package/src/wx/MaterialTheme.vue +0 -107
- package/src/wx/RULocale.js +0 -15
- package/src/wx/Select.vue +0 -75
- package/src/wx/Slider.vue +0 -150
- package/src/wx/Text.vue +0 -73
- package/src/wx/Textarea.vue +0 -63
- package/src/wx/Tooltip.vue +0 -110
- package/src/wx/index.js +0 -35
- package/src/wx/locale.js +0 -1
- package/src/wx/locales/cn.js +0 -39
- package/src/wx/locales/en.js +0 -39
- package/src/wx/locales/ru.js +0 -39
package/src/wx/MaterialTheme.vue
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="wx-default" style="height: 100%" v-if="this.$slots.default">
|
|
3
|
-
<slot />
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<style>
|
|
8
|
-
@import "https://fonts.googleapis.com/css?family=Roboto:400,500,700,900&display=swap&subset=cyrillic-ext";
|
|
9
|
-
@import "https://cdn.materialdesignicons.com/2.7.94/css/materialdesignicons.css";
|
|
10
|
-
|
|
11
|
-
.wx-material {
|
|
12
|
-
/* common */
|
|
13
|
-
--wx-font: 400 14px Roboto;
|
|
14
|
-
--wx-font-color: #5f5f5f;
|
|
15
|
-
--wx-border-color: #ededed;
|
|
16
|
-
|
|
17
|
-
/* buttons */
|
|
18
|
-
--wx-button-font: 500 14px Roboto;
|
|
19
|
-
--wx-button-primary-font-color: #fff;
|
|
20
|
-
--wx-button-danger-font-color: #ff5252;
|
|
21
|
-
--wx-button-primary-color: #2a7fff;
|
|
22
|
-
--wx-button-primary-color-hover: #246cd9;
|
|
23
|
-
--wx-button-danger-color: transparent;
|
|
24
|
-
--wx-button-danger-color-hover: rgba(255, 82, 82, 0.2);
|
|
25
|
-
--wx-button-radius: 30px;
|
|
26
|
-
|
|
27
|
-
/* bars */
|
|
28
|
-
--wx-gantt-bar-font: 400 14px Roboto;
|
|
29
|
-
--wx-gantt-bar-border-radius: 50px;
|
|
30
|
-
|
|
31
|
-
--wx-gantt-task-color: #448aff;
|
|
32
|
-
--wx-gantt-task-font-color: #fff;
|
|
33
|
-
--wx-gantt-task-fill-color: #246cd9;
|
|
34
|
-
--wx-gantt-task-border-color: #448aff;
|
|
35
|
-
|
|
36
|
-
--wx-gantt-project-color: #1de9b6;
|
|
37
|
-
--wx-gantt-project-font-color: #5f5f5f;
|
|
38
|
-
--wx-gantt-project-fill-color: #00d19a;
|
|
39
|
-
--wx-gantt-project-border-color: #1de9b6;
|
|
40
|
-
|
|
41
|
-
--wx-gantt-milestone-color: #d33daf;
|
|
42
|
-
|
|
43
|
-
--wx-gantt-select-color: rgba(0, 199, 181, 0.2);
|
|
44
|
-
--wx-gantt-link-color: #87a4bc;
|
|
45
|
-
|
|
46
|
-
/* shadows */
|
|
47
|
-
--wx-top-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1),
|
|
48
|
-
0px 1px 2px rgba(0, 0, 0, 0.1);
|
|
49
|
-
|
|
50
|
-
/* grid */
|
|
51
|
-
--wx-grid-header-font: 500 14px Roboto;
|
|
52
|
-
--wx-grid-header-font-color: #a6a6a6;
|
|
53
|
-
--wx-grid-header-text-transform: uppercase;
|
|
54
|
-
--wx-grid-header-shadow: var(--wx-top-shadow);
|
|
55
|
-
|
|
56
|
-
--wx-grid-body-font: 400 14px Roboto;
|
|
57
|
-
--wx-grid-body-font-color: #5f5f5f;
|
|
58
|
-
--wx-grid-body-row-border: 1px solid #fff;
|
|
59
|
-
|
|
60
|
-
/* timescale */
|
|
61
|
-
--wx-timescale-font: 500 12px Roboto;
|
|
62
|
-
--wx-timescale-font-color: #a6a6a6;
|
|
63
|
-
--wx-timescale-text-transform: uppercase;
|
|
64
|
-
--wx-timescale-shadow: var(--wx-top-shadow);
|
|
65
|
-
--wx-timescale-border: 1px solid transparent;
|
|
66
|
-
|
|
67
|
-
/* input */
|
|
68
|
-
--wx-label-font: 500 14px Roboto;
|
|
69
|
-
--wx-label-font-color: #5f5f5f;
|
|
70
|
-
|
|
71
|
-
--wx-input-font: 400 14px Roboto;
|
|
72
|
-
--wx-input-font-color: #5f5f5f;
|
|
73
|
-
--wx-input-padding: 8px 11px;
|
|
74
|
-
--wx-input-border: 1px solid #dfdfdf;
|
|
75
|
-
--wx-input-border-radius: 2px;
|
|
76
|
-
--wx-input-focus-color: #2a7fff;
|
|
77
|
-
|
|
78
|
-
/* calendar */
|
|
79
|
-
--wx-calendar-border: 1px solid #dfdfdf;
|
|
80
|
-
--wx-calendar-month-font: 400 12px Roboto;
|
|
81
|
-
--wx-calendar-month-font-color: #5f5f5f;
|
|
82
|
-
--wx-calendar-days-font: 400 10px Roboto;
|
|
83
|
-
--wx-calendar-days-font-color: rgba(0, 0, 0, 0.5);
|
|
84
|
-
--wx-calendar-dates-font: 400 12px Roboto;
|
|
85
|
-
--wx-calendar-dates-font-color: #4f4f4f;
|
|
86
|
-
|
|
87
|
-
/* markers */
|
|
88
|
-
--wx-gantt-marker-font: 500 12px Roboto;
|
|
89
|
-
--wx-gantt-marker-font-color: #fff;
|
|
90
|
-
--wx-gantt-marker-color: rgba(6, 189, 248, 0.77);
|
|
91
|
-
|
|
92
|
-
/* tooltips */
|
|
93
|
-
--wx-tooltip-font: 400 12px Roboto;
|
|
94
|
-
--wx-tooltip-font-color: #5f5f5f;
|
|
95
|
-
|
|
96
|
-
/* tooltips */
|
|
97
|
-
|
|
98
|
-
/* icons */
|
|
99
|
-
--wx-add-btn-icon: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M7.52734 0.671875H6.47266C6.37891 0.671875 6.33203 0.71875 6.33203 0.8125V6.33203H1.09375C1 6.33203 0.953125 6.37891 0.953125 6.47266V7.52734C0.953125 7.62109 1 7.66797 1.09375 7.66797H6.33203V13.1875C6.33203 13.2812 6.37891 13.3281 6.47266 13.3281H7.52734C7.62109 13.3281 7.66797 13.2812 7.66797 13.1875V7.66797H12.9062C13 7.66797 13.0469 7.62109 13.0469 7.52734V6.47266C13.0469 6.37891 13 6.33203 12.9062 6.33203H7.66797V0.8125C7.66797 0.71875 7.62109 0.671875 7.52734 0.671875Z' fill='%2300C7B5' fill-opacity='0.54'/%3E%3C/svg%3E ");
|
|
100
|
-
--wx-open-btn-icon: url("data:image/svg+xml,%3Csvg width='5' height='10' viewBox='0 0 5 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 10L5 5L0 0V10Z' fill='%235F5F5F' fill-opacity='0.54'/%3E%3C/svg%3E%0A");
|
|
101
|
-
--wx-close-btn-icon: url("data:image/svg+xml,%3Csvg width='10' height='5' viewBox='0 0 10 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0L5 5L10 0H0Z' fill='%235F5F5F' fill-opacity='0.54'/%3E%3C/svg%3E%0A");
|
|
102
|
-
--wx-close-sb-icon: url("data:image/svg+xml,%3Csvg width='15' height='14' viewBox='0 0 15 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.0344 1.42188L12.6281 0.015625L7.04999 5.59375L1.47186 0.015625L0.0656128 1.42188L5.64374 7L0.0656128 12.5781L1.47186 13.9844L7.04999 8.40625L12.6281 13.9844L14.0344 12.5781L8.45624 7L14.0344 1.42188Z' fill='black' fill-opacity='0.54'/%3E%3C/svg%3E%0A");
|
|
103
|
-
--wx-show-more-icon: url("data:image/svg+xml,%3Csvg width='10' height='7' viewBox='0 0 10 7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1.175 0.158203L5 3.97487L8.825 0.158203L10 1.3332L5 6.3332L0 1.3332L1.175 0.158203Z' fill='%235F5F5F'/%3E%3C/svg%3E ");
|
|
104
|
-
--wx-calendar-icon: url("data:image/svg+xml,%3Csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.8203 15.3203H2.17969V6.17969H13.8203V15.3203ZM11.3203 0.320312V2H4.67969V0.320312H3V2H2.17969C1.6849 2 1.28125 2.15625 0.96875 2.46875C0.65625 2.78125 0.5 3.1849 0.5 3.67969V15.3203C0.5 15.7891 0.65625 16.1927 0.96875 16.5312C1.30729 16.8438 1.71094 17 2.17969 17H13.8203C14.2891 17 14.6797 16.8438 14.9922 16.5312C15.3307 16.1927 15.5 15.7891 15.5 15.3203V3.67969C15.5 3.1849 15.3307 2.78125 14.9922 2.46875C14.6797 2.15625 14.2891 2 13.8203 2H13V0.320312H11.3203ZM12.1797 9.5H8V13.6797H12.1797V9.5Z' fill='black' fill-opacity='0.5'/%3E%3C/svg%3E ");
|
|
105
|
-
--wx-remove-link-icon: url("data:image/svg+xml,%3Csvg width='12' height='15' viewBox='0 0 12 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 13.3203C1 13.7891 1.15625 14.1927 1.46875 14.5312C1.80729 14.8438 2.21094 15 2.67969 15H9.32031C9.78906 15 10.1797 14.8438 10.4922 14.5312C10.8307 14.1927 11 13.7891 11 13.3203V3.32031H1V13.3203ZM3.03125 7.38281L4.24219 6.21094L6 8.00781L7.75781 6.21094L8.92969 7.38281L7.17188 9.17969L8.92969 10.9375L7.75781 12.1094L6 10.3516L4.24219 12.1094L3.07031 10.9375L4.82812 9.17969L3.03125 7.38281ZM8.92969 0.820312L8.07031 0H3.92969L3.07031 0.820312H0.179688V2.5H11.8203V0.820312H8.92969Z' fill='black' fill-opacity='0.5'/%3E%3C/svg%3E ");
|
|
106
|
-
}
|
|
107
|
-
</style>
|
package/src/wx/RULocale.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { provide, readonly } from "vue";
|
|
2
|
-
import { LocaleContext } from "./locale";
|
|
3
|
-
import locale from "./locales/ru";
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
setup(props) {
|
|
7
|
-
if (props.words)
|
|
8
|
-
provide(LocaleContext, readonly(locale().extend(props.words)));
|
|
9
|
-
else provide(LocaleContext, readonly(locale()));
|
|
10
|
-
},
|
|
11
|
-
props: ["words"],
|
|
12
|
-
render() {
|
|
13
|
-
return this.$slots.default();
|
|
14
|
-
},
|
|
15
|
-
};
|
package/src/wx/Select.vue
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="container">
|
|
3
|
-
<label class="label">{{ label }}</label>
|
|
4
|
-
<div class="wrapper">
|
|
5
|
-
<select class="select" :value="value" @change="select">
|
|
6
|
-
<option v-for="option in options" :key="option" :value="option">
|
|
7
|
-
{{ option }}
|
|
8
|
-
</option>
|
|
9
|
-
</select>
|
|
10
|
-
<div class="icon" />
|
|
11
|
-
</div>
|
|
12
|
-
</div>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<script>
|
|
16
|
-
export default {
|
|
17
|
-
props: {
|
|
18
|
-
label: { type: String, default: "" },
|
|
19
|
-
value: { type: String, default: "" },
|
|
20
|
-
options: { type: Array, default: () => [] },
|
|
21
|
-
},
|
|
22
|
-
emits: ["change"],
|
|
23
|
-
|
|
24
|
-
methods: {
|
|
25
|
-
select(e) {
|
|
26
|
-
this.$emit("change", e.target.value);
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
</script>
|
|
31
|
-
|
|
32
|
-
<style scoped>
|
|
33
|
-
.container {
|
|
34
|
-
margin-bottom: 20px;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.label {
|
|
38
|
-
display: block;
|
|
39
|
-
margin-bottom: 10px;
|
|
40
|
-
font: var(--wx-label-font);
|
|
41
|
-
color: var(--wx-label-font-color);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.wrapper {
|
|
45
|
-
position: relative;
|
|
46
|
-
display: flex;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.select {
|
|
50
|
-
width: 100%;
|
|
51
|
-
padding: var(--wx-input-padding);
|
|
52
|
-
border: var(--wx-input-border);
|
|
53
|
-
border-radius: var(--wx-input-border-radius);
|
|
54
|
-
font: var(--wx-input-font);
|
|
55
|
-
color: var(--wx-input-font-color);
|
|
56
|
-
text-transform: capitalize;
|
|
57
|
-
outline: none;
|
|
58
|
-
appearance: none;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.select:focus {
|
|
62
|
-
border: 1px solid var(--wx-input-focus-color);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.icon {
|
|
66
|
-
position: absolute;
|
|
67
|
-
top: 50%;
|
|
68
|
-
right: 11px;
|
|
69
|
-
transform: translateY(-50%);
|
|
70
|
-
width: 20px;
|
|
71
|
-
height: 20px;
|
|
72
|
-
background: var(--wx-show-more-icon) center center no-repeat;
|
|
73
|
-
pointer-events: none;
|
|
74
|
-
}
|
|
75
|
-
</style>
|
package/src/wx/Slider.vue
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="slider">
|
|
3
|
-
<label class="label">{{ label }}</label>
|
|
4
|
-
<input
|
|
5
|
-
type="range"
|
|
6
|
-
class="range"
|
|
7
|
-
:style="bgStyle"
|
|
8
|
-
:value="value"
|
|
9
|
-
:min="min"
|
|
10
|
-
:max="max"
|
|
11
|
-
:step="step"
|
|
12
|
-
@input="input"
|
|
13
|
-
/>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script>
|
|
18
|
-
export default {
|
|
19
|
-
props: {
|
|
20
|
-
label: { type: String, default: "" },
|
|
21
|
-
value: { type: Number, default: 0 },
|
|
22
|
-
min: { type: Number, default: 0 },
|
|
23
|
-
max: { type: Number, default: 100 },
|
|
24
|
-
step: { type: Number, default: 1 },
|
|
25
|
-
inactive: { type: String, default: "#dbdbdb" },
|
|
26
|
-
},
|
|
27
|
-
emits: ["change"],
|
|
28
|
-
|
|
29
|
-
methods: {
|
|
30
|
-
input(e) {
|
|
31
|
-
this.$emit("change", +e.target.value);
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
computed: {
|
|
36
|
-
bgStyle() {
|
|
37
|
-
const { value, min, max, inactive } = this;
|
|
38
|
-
const progress = ((value - min) / (max - min)) * 100 + "%";
|
|
39
|
-
return `background: linear-gradient(90deg, var(--wx-input-focus-color) 0% ${progress}, ${inactive} ${progress} 100%);`;
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
</script>
|
|
44
|
-
|
|
45
|
-
<style scoped>
|
|
46
|
-
.slider {
|
|
47
|
-
margin-bottom: 20px;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.label {
|
|
51
|
-
display: block;
|
|
52
|
-
margin-bottom: 10px;
|
|
53
|
-
font: var(--wx-label-font);
|
|
54
|
-
color: var(--wx-label-font-color);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.range {
|
|
58
|
-
width: 100%;
|
|
59
|
-
background-color: #dbdbdb;
|
|
60
|
-
-webkit-appearance: none;
|
|
61
|
-
border-radius: 4px;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.range:focus {
|
|
65
|
-
outline: none;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.range::-webkit-slider-runnable-track {
|
|
69
|
-
border-radius: 4px;
|
|
70
|
-
width: 100%;
|
|
71
|
-
height: 8px;
|
|
72
|
-
cursor: pointer;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.range::-webkit-slider-thumb {
|
|
76
|
-
margin-top: -6px;
|
|
77
|
-
width: 20px;
|
|
78
|
-
height: 20px;
|
|
79
|
-
background: var(--wx-input-focus-color);
|
|
80
|
-
border: 2px solid #ffffff;
|
|
81
|
-
border-radius: 50%;
|
|
82
|
-
cursor: pointer;
|
|
83
|
-
-webkit-appearance: none;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.range::-moz-range-track {
|
|
87
|
-
background-color: transparent;
|
|
88
|
-
border-top: 5px solid #fff;
|
|
89
|
-
border-bottom: 5px solid #fff;
|
|
90
|
-
width: 100%;
|
|
91
|
-
height: 8px;
|
|
92
|
-
cursor: pointer;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.range::-moz-range-thumb {
|
|
96
|
-
width: 14px;
|
|
97
|
-
height: 14px;
|
|
98
|
-
background: var(--wx-input-focus-color);
|
|
99
|
-
border: 2px solid #ffffff;
|
|
100
|
-
border-radius: 50%;
|
|
101
|
-
cursor: pointer;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.range::-moz-range-progress {
|
|
105
|
-
background-color: var(--wx-input-focus-color);
|
|
106
|
-
height: 8px;
|
|
107
|
-
border-top-left-radius: 6px;
|
|
108
|
-
border-bottom-left-radius: 6px;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.range::-ms-track {
|
|
112
|
-
background: transparent;
|
|
113
|
-
border-color: transparent;
|
|
114
|
-
border-width: 5px 0;
|
|
115
|
-
color: transparent;
|
|
116
|
-
width: 100%;
|
|
117
|
-
height: 8px;
|
|
118
|
-
cursor: pointer;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.range::-ms-fill-lower {
|
|
122
|
-
background: var(--wx-input-focus-color);
|
|
123
|
-
border: 0.2px solid var(--wx-input-focus-color);
|
|
124
|
-
border-radius: 8px;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.range::-ms-fill-upper {
|
|
128
|
-
background: #dbdbdb;
|
|
129
|
-
border: 0.2px solid #dbdbdb;
|
|
130
|
-
border-radius: 8px;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.range::-ms-thumb {
|
|
134
|
-
width: 16px;
|
|
135
|
-
height: 16px;
|
|
136
|
-
background: var(--wx-focus-color);
|
|
137
|
-
border: 2px solid #ffffff;
|
|
138
|
-
border-radius: 50%;
|
|
139
|
-
cursor: pointer;
|
|
140
|
-
margin-top: 0px;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.range:focus::-ms-fill-lower {
|
|
144
|
-
background: var(--wx-focus-color);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.range:focus::-ms-fill-upper {
|
|
148
|
-
background: #dbdbdb;
|
|
149
|
-
}
|
|
150
|
-
</style>
|
package/src/wx/Text.vue
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="text">
|
|
3
|
-
<label class="label">{{ label }}</label>
|
|
4
|
-
<input
|
|
5
|
-
ref="node"
|
|
6
|
-
type="text"
|
|
7
|
-
class="input"
|
|
8
|
-
:value="value"
|
|
9
|
-
:placeholder="placeholder"
|
|
10
|
-
:readonly="readonly"
|
|
11
|
-
:disabled="disabled"
|
|
12
|
-
@input="input"
|
|
13
|
-
/>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script>
|
|
18
|
-
export default {
|
|
19
|
-
props: {
|
|
20
|
-
label: { type: String, default: "" },
|
|
21
|
-
value: { type: String, default: "" },
|
|
22
|
-
placeholder: { type: String, default: "" },
|
|
23
|
-
readonly: { type: Boolean, default: false },
|
|
24
|
-
disabled: { type: Boolean, default: false },
|
|
25
|
-
autofocus: { type: Boolean, default: false },
|
|
26
|
-
},
|
|
27
|
-
emits: ["change"],
|
|
28
|
-
|
|
29
|
-
data: () => ({
|
|
30
|
-
node: null,
|
|
31
|
-
}),
|
|
32
|
-
|
|
33
|
-
methods: {
|
|
34
|
-
input(e) {
|
|
35
|
-
this.$emit("change", e.target.value);
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
mounted() {
|
|
40
|
-
if (this.autofocus) {
|
|
41
|
-
this.$refs.node.focus();
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
</script>
|
|
46
|
-
|
|
47
|
-
<style scoped>
|
|
48
|
-
.text {
|
|
49
|
-
margin-bottom: 20px;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.label {
|
|
53
|
-
display: block;
|
|
54
|
-
margin-bottom: 10px;
|
|
55
|
-
font: var(--wx-label-font);
|
|
56
|
-
color: var(--wx-label-font-color);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.input {
|
|
60
|
-
box-sizing: border-box;
|
|
61
|
-
width: 100%;
|
|
62
|
-
padding: var(--wx-input-padding);
|
|
63
|
-
border: var(--wx-input-border);
|
|
64
|
-
border-radius: var(--wx-input-border-radius);
|
|
65
|
-
font: var(--wx-input-font);
|
|
66
|
-
color: var(--wx-input-font-color);
|
|
67
|
-
outline: none;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.input:focus {
|
|
71
|
-
border: 1px solid var(--wx-input-focus-color);
|
|
72
|
-
}
|
|
73
|
-
</style>
|
package/src/wx/Textarea.vue
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="area">
|
|
3
|
-
<label class="label">{{ label }}</label>
|
|
4
|
-
<textarea
|
|
5
|
-
class="textarea"
|
|
6
|
-
:value="value"
|
|
7
|
-
:placeholder="placeholder"
|
|
8
|
-
:readonly="readonly"
|
|
9
|
-
:disabled="disabled"
|
|
10
|
-
@input="input"
|
|
11
|
-
/>
|
|
12
|
-
</div>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<script>
|
|
16
|
-
export default {
|
|
17
|
-
props: {
|
|
18
|
-
label: { type: String, default: "" },
|
|
19
|
-
value: { type: String, default: "" },
|
|
20
|
-
placeholder: { type: String, default: "" },
|
|
21
|
-
readonly: { type: Boolean, default: false },
|
|
22
|
-
disabled: { type: Boolean, default: false },
|
|
23
|
-
},
|
|
24
|
-
emits: ["change"],
|
|
25
|
-
|
|
26
|
-
methods: {
|
|
27
|
-
input(e) {
|
|
28
|
-
this.$emit("change", e.target.value);
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<style scoped>
|
|
35
|
-
.area {
|
|
36
|
-
margin-bottom: 20px;
|
|
37
|
-
font: var(--wx-font);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.label {
|
|
41
|
-
display: block;
|
|
42
|
-
margin-bottom: 10px;
|
|
43
|
-
font: var(--wx-label-font);
|
|
44
|
-
color: var(--wx-label-font-color);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.textarea {
|
|
48
|
-
box-sizing: border-box;
|
|
49
|
-
width: 100%;
|
|
50
|
-
height: 70px;
|
|
51
|
-
padding: var(--wx-input-padding);
|
|
52
|
-
border: var(--wx-input-border);
|
|
53
|
-
border-radius: var(--wx-input-border-radius);
|
|
54
|
-
font: var(--wx-input-font);
|
|
55
|
-
color: var(--wx-input-font-color);
|
|
56
|
-
resize: vertical;
|
|
57
|
-
outline: none;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.textarea:focus {
|
|
61
|
-
border: 1px solid var(--wx-input-focus-color);
|
|
62
|
-
}
|
|
63
|
-
</style>
|
package/src/wx/Tooltip.vue
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="area" ref="area" @mousemove="move">
|
|
3
|
-
<div
|
|
4
|
-
v-if="(id && content) || tooltip"
|
|
5
|
-
class="tooltip"
|
|
6
|
-
ref="tooltipNode"
|
|
7
|
-
:style="{ top: pos.top + 'px', left: pos.left + 'px' }"
|
|
8
|
-
>
|
|
9
|
-
<template v-if="id">
|
|
10
|
-
<component :is="content" :data="tooltipData"></component>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<template v-else>{{ tooltip }}</template>
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
<slot />
|
|
17
|
-
</div>
|
|
18
|
-
</template>
|
|
19
|
-
|
|
20
|
-
<script>
|
|
21
|
-
export default {
|
|
22
|
-
props: {
|
|
23
|
-
content: { default: null },
|
|
24
|
-
data: { default: null },
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
data: () => ({
|
|
28
|
-
id: null,
|
|
29
|
-
tooltip: null,
|
|
30
|
-
tooltipData: null,
|
|
31
|
-
tooltipNode: null,
|
|
32
|
-
target: null,
|
|
33
|
-
targetCoords: null,
|
|
34
|
-
areaCoords: null,
|
|
35
|
-
pos: null,
|
|
36
|
-
}),
|
|
37
|
-
|
|
38
|
-
methods: {
|
|
39
|
-
locate(node) {
|
|
40
|
-
while (node) {
|
|
41
|
-
if (node.getAttribute) {
|
|
42
|
-
const id = node.getAttribute("data-tooltip-id");
|
|
43
|
-
const tooltip = node.getAttribute("data-tooltip");
|
|
44
|
-
if (id || tooltip) return { id, tooltip, target: node };
|
|
45
|
-
}
|
|
46
|
-
node = node.parentNode;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return { id: null, tooltip: null, target: null };
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
move(e) {
|
|
53
|
-
const data = this.locate(e.target);
|
|
54
|
-
|
|
55
|
-
this.id = data.id;
|
|
56
|
-
this.tooltip = data.tooltip;
|
|
57
|
-
this.target = data.target;
|
|
58
|
-
|
|
59
|
-
if (!this.id && !this.tooltip) return;
|
|
60
|
-
|
|
61
|
-
if (this.id && this.data) {
|
|
62
|
-
this.tooltipData = this.data(this.id);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
this.targetCoords = this.target.getBoundingClientRect();
|
|
66
|
-
this.areaCoords = this.$refs.area.getBoundingClientRect();
|
|
67
|
-
|
|
68
|
-
const top =
|
|
69
|
-
this.targetCoords.top +
|
|
70
|
-
this.targetCoords.height -
|
|
71
|
-
this.areaCoords.top +
|
|
72
|
-
5;
|
|
73
|
-
const left = this.targetCoords.left - this.areaCoords.left;
|
|
74
|
-
|
|
75
|
-
this.pos = { top, left };
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
updated() {
|
|
80
|
-
if (this.$refs.tooltipNode) {
|
|
81
|
-
const node = this.$refs.tooltipNode;
|
|
82
|
-
const tooltipCoords = node.getBoundingClientRect();
|
|
83
|
-
if (tooltipCoords.right >= this.areaCoords.right) {
|
|
84
|
-
this.pos.left = this.areaCoords.width - tooltipCoords.width - 5;
|
|
85
|
-
}
|
|
86
|
-
if (tooltipCoords.bottom >= this.areaCoords.bottom) {
|
|
87
|
-
this.pos.top = this.targetCoords.top - tooltipCoords.height - 5;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
</script>
|
|
93
|
-
|
|
94
|
-
<style scoped>
|
|
95
|
-
.area {
|
|
96
|
-
position: relative;
|
|
97
|
-
height: 100%;
|
|
98
|
-
width: 100%;
|
|
99
|
-
}
|
|
100
|
-
</style>
|
|
101
|
-
|
|
102
|
-
<style>
|
|
103
|
-
.tooltip {
|
|
104
|
-
position: absolute;
|
|
105
|
-
z-index: 10;
|
|
106
|
-
font: var(--wx-small-font);
|
|
107
|
-
color: var(--wx-font-color);
|
|
108
|
-
background-color: #fff;
|
|
109
|
-
}
|
|
110
|
-
</style>
|
package/src/wx/index.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import Button from "./Button.vue";
|
|
2
|
-
import Calendar from "./Calendar.vue";
|
|
3
|
-
import Counter from "./Counter.vue";
|
|
4
|
-
import Datepicker from "./Datepicker.vue";
|
|
5
|
-
import Select from "./Select.vue";
|
|
6
|
-
import Slider from "./Slider.vue";
|
|
7
|
-
import Text from "./Text.vue";
|
|
8
|
-
import Textarea from "./Textarea.vue";
|
|
9
|
-
import Tooltip from "./Textarea.vue";
|
|
10
|
-
|
|
11
|
-
import DefaultTheme from "./DefaultTheme.vue";
|
|
12
|
-
import MaterialTheme from "./MaterialTheme.vue";
|
|
13
|
-
|
|
14
|
-
import RULocale from "./RULocale";
|
|
15
|
-
import ENLocale from "./ENLocale";
|
|
16
|
-
import CNLocale from "./CNLocale";
|
|
17
|
-
|
|
18
|
-
export const wx = {
|
|
19
|
-
Button,
|
|
20
|
-
Calendar,
|
|
21
|
-
Counter,
|
|
22
|
-
Datepicker,
|
|
23
|
-
Select,
|
|
24
|
-
Slider,
|
|
25
|
-
Text,
|
|
26
|
-
Textarea,
|
|
27
|
-
Tooltip,
|
|
28
|
-
|
|
29
|
-
DefaultTheme,
|
|
30
|
-
MaterialTheme,
|
|
31
|
-
|
|
32
|
-
RULocale,
|
|
33
|
-
CNLocale,
|
|
34
|
-
ENLocale,
|
|
35
|
-
};
|
package/src/wx/locale.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const LocaleContext = Symbol("WX Locale");
|
package/src/wx/locales/cn.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
const days = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
|
|
2
|
-
|
|
3
|
-
const months = [
|
|
4
|
-
"一月",
|
|
5
|
-
"二月",
|
|
6
|
-
"三月",
|
|
7
|
-
"四月",
|
|
8
|
-
"五月",
|
|
9
|
-
"六月",
|
|
10
|
-
"七月",
|
|
11
|
-
"八月",
|
|
12
|
-
"九月",
|
|
13
|
-
"十月",
|
|
14
|
-
"十一月",
|
|
15
|
-
"十二月",
|
|
16
|
-
];
|
|
17
|
-
|
|
18
|
-
let data = {
|
|
19
|
-
__dates: {
|
|
20
|
-
months,
|
|
21
|
-
days,
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default function wrapper() {
|
|
26
|
-
return {
|
|
27
|
-
_(key) {
|
|
28
|
-
return data[key] || key;
|
|
29
|
-
},
|
|
30
|
-
__(group, key) {
|
|
31
|
-
const block = data[group];
|
|
32
|
-
return block ? block[key] || key : key;
|
|
33
|
-
},
|
|
34
|
-
extend(values) {
|
|
35
|
-
data = { ...data, ...values };
|
|
36
|
-
return this;
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
}
|