@oinone/kunlun-vue-ui-el 6.2.0
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 +1 -0
- package/dist/oinone-kunlun-vue-ui-el.css +1 -0
- package/dist/oinone-kunlun-vue-ui-el.esm.js +1 -0
- package/dist/oinone-kunlun-vue-ui-el.scss +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/src/component/index.d.ts +3 -0
- package/dist/types/src/component/oio-color-picker/index.d.ts +1 -0
- package/dist/types/src/component/oio-color-picker/oio-color-picker.vue.d.ts +122 -0
- package/dist/types/src/component/oio-date-time-picker/index.d.ts +4 -0
- package/dist/types/src/component/oio-date-time-picker/oio-date-picker.vue.d.ts +184 -0
- package/dist/types/src/component/oio-date-time-picker/oio-date-time-picker.vue.d.ts +232 -0
- package/dist/types/src/component/oio-date-time-picker/oio-time-picker.vue.d.ts +178 -0
- package/dist/types/src/component/oio-date-time-picker/oio-year-picker.vue.d.ts +139 -0
- package/dist/types/src/component/oio-modal/index.d.ts +1 -0
- package/dist/types/src/component/oio-modal/oio-modal.vue.d.ts +229 -0
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/theme/index.d.ts +1 -0
- package/index.ts +3 -0
- package/package.json +36 -0
- package/rollup.config.js +12 -0
- package/src/component/index.ts +3 -0
- package/src/component/oio-color-picker/index.ts +1 -0
- package/src/component/oio-color-picker/oio-color-picker.vue +139 -0
- package/src/component/oio-color-picker/style/index.scss +125 -0
- package/src/component/oio-color-picker/style/parameters.scss +5 -0
- package/src/component/oio-date-time-picker/index.ts +4 -0
- package/src/component/oio-date-time-picker/oio-date-picker.vue +38 -0
- package/src/component/oio-date-time-picker/oio-date-time-picker.vue +78 -0
- package/src/component/oio-date-time-picker/oio-time-picker.vue +38 -0
- package/src/component/oio-date-time-picker/oio-year-picker.vue +29 -0
- package/src/component/oio-date-time-picker/style/index.scss +58 -0
- package/src/component/oio-date-time-picker/style/parameters.scss +5 -0
- package/src/component/oio-input/style/index.scss +0 -0
- package/src/component/oio-input/style/mixin/el-input.scss +13 -0
- package/src/component/oio-input/style/parameters.scss +9 -0
- package/src/component/oio-modal/index.ts +1 -0
- package/src/component/oio-modal/oio-modal.vue +81 -0
- package/src/component/oio-modal/style/index.scss +0 -0
- package/src/component/oio-modal/style/parameters.scss +5 -0
- package/src/index.ts +3 -0
- package/src/shim-translate.d.ts +7 -0
- package/src/shim-vue.d.ts +6 -0
- package/src/style/global-parameters.scss +5 -0
- package/src/style/index.scss +3 -0
- package/src/style/mixin.scss +86 -0
- package/src/theme/index.ts +1 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { autoRgbaStr, CastHelper, NumberHelper, StringHelper } from '@oinone/kunlun-shared';
|
|
3
|
+
import { OioColorPickerProps, PropRecordHelper } from '@oinone/kunlun-vue-ui-common';
|
|
4
|
+
import { ElColorPicker, ElInput } from 'element-plus';
|
|
5
|
+
import { isString } from 'lodash-es';
|
|
6
|
+
import { computed, createVNode, defineComponent, ref, VNode } from 'vue';
|
|
7
|
+
import { DEFAULT_PREFIX } from '../../theme';
|
|
8
|
+
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
name: 'OioColorPicker',
|
|
11
|
+
components: {
|
|
12
|
+
ElColorPicker,
|
|
13
|
+
ElInput
|
|
14
|
+
},
|
|
15
|
+
inheritAttrs: false,
|
|
16
|
+
props: {
|
|
17
|
+
...OioColorPickerProps
|
|
18
|
+
},
|
|
19
|
+
emits: ['update:value', 'change'],
|
|
20
|
+
setup(props, { emit }) {
|
|
21
|
+
const lastedColors = ref<string[] | undefined>(undefined);
|
|
22
|
+
|
|
23
|
+
const lastedColorCount = computed<number>(() => {
|
|
24
|
+
let count = props.lastedColorCount;
|
|
25
|
+
if (count == null) {
|
|
26
|
+
count = 4;
|
|
27
|
+
}
|
|
28
|
+
return NumberHelper.toNumber(count)!;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
function createColors() {
|
|
32
|
+
const storeColors = JSON.parse(localStorage.getItem('lastColors') || '[]') as unknown as string[];
|
|
33
|
+
lastedColors.value = storeColors || [];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function getLastColors(): string[] {
|
|
37
|
+
if (props.disabledLastedColor) {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
if (!lastedColors.value) {
|
|
41
|
+
createColors();
|
|
42
|
+
}
|
|
43
|
+
return lastedColors.value || [];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function pushLastColors(val: string) {
|
|
47
|
+
if (props.disabledLastedColor) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
let colors = lastedColors.value;
|
|
51
|
+
if (!colors) {
|
|
52
|
+
colors = [];
|
|
53
|
+
lastedColors.value = colors;
|
|
54
|
+
}
|
|
55
|
+
colors.push(val);
|
|
56
|
+
if (colors.length > lastedColorCount.value) {
|
|
57
|
+
colors.shift();
|
|
58
|
+
}
|
|
59
|
+
localStorage.setItem('lastColors', JSON.stringify(colors));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const predefineColors = computed(() => {
|
|
63
|
+
let result = props.predefine || [];
|
|
64
|
+
if (isString(result)) {
|
|
65
|
+
result = JSON.parse(result);
|
|
66
|
+
}
|
|
67
|
+
const rgbaRes = result.map((a) => autoRgbaStr(a));
|
|
68
|
+
const usableColors = getLastColors().map((a) => autoRgbaStr(a));
|
|
69
|
+
return [...new Set([...rgbaRes, ...usableColors])];
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
function handleChange(val?: string) {
|
|
73
|
+
if (val && !predefineColors.value.includes(val)) {
|
|
74
|
+
pushLastColors(val);
|
|
75
|
+
}
|
|
76
|
+
emit('change', val);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
predefineColors,
|
|
81
|
+
handleChange
|
|
82
|
+
};
|
|
83
|
+
},
|
|
84
|
+
render() {
|
|
85
|
+
const colorPickerClassList = [`${DEFAULT_PREFIX}-color-picker`];
|
|
86
|
+
if (this.readonly) {
|
|
87
|
+
colorPickerClassList.push(`${DEFAULT_PREFIX}-color-picker-readonly`);
|
|
88
|
+
}
|
|
89
|
+
const children: VNode[] = [];
|
|
90
|
+
let colorPicker: VNode = createVNode(ElColorPicker, {
|
|
91
|
+
modelValue: this.value,
|
|
92
|
+
defaultValue: this.defaultValue,
|
|
93
|
+
colorFormat: this.colorFormat,
|
|
94
|
+
disabled: this.disabled,
|
|
95
|
+
showAlpha: this.showAlpha,
|
|
96
|
+
predefine: this.predefineColors,
|
|
97
|
+
popperClass: `${DEFAULT_PREFIX}-color-picker-popper`,
|
|
98
|
+
...PropRecordHelper.collectionBasicProps(this.$attrs, colorPickerClassList),
|
|
99
|
+
'onUpdate:modelValue': (val) => this.$emit('update:value', val),
|
|
100
|
+
onChange: this.handleChange
|
|
101
|
+
});
|
|
102
|
+
if (this.hasInput) {
|
|
103
|
+
colorPicker = createVNode(
|
|
104
|
+
'div',
|
|
105
|
+
{
|
|
106
|
+
class: [
|
|
107
|
+
`${DEFAULT_PREFIX}-color-picker-inner`,
|
|
108
|
+
this.readonly ? `${DEFAULT_PREFIX}-color-picker-inner-readonly` : ''
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
[colorPicker]
|
|
112
|
+
);
|
|
113
|
+
const inputTemplate = {};
|
|
114
|
+
inputTemplate[this.inputPlacement] = () => [colorPicker];
|
|
115
|
+
children.push(
|
|
116
|
+
createVNode(
|
|
117
|
+
ElInput,
|
|
118
|
+
{
|
|
119
|
+
modelValue: this.value,
|
|
120
|
+
placeholder: this.inputPlaceholder,
|
|
121
|
+
readonly: this.inputReadonly || this.readonly,
|
|
122
|
+
disabled: this.disabled
|
|
123
|
+
},
|
|
124
|
+
inputTemplate
|
|
125
|
+
)
|
|
126
|
+
);
|
|
127
|
+
} else {
|
|
128
|
+
children.push(colorPicker);
|
|
129
|
+
}
|
|
130
|
+
return createVNode(
|
|
131
|
+
'div',
|
|
132
|
+
{
|
|
133
|
+
class: StringHelper.append(colorPickerClassList, CastHelper.cast(this.$attrs.class))
|
|
134
|
+
},
|
|
135
|
+
children
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
</script>
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
@import './parameters.scss';
|
|
2
|
+
@import '../../oio-input/style/mixin/el-input.scss';
|
|
3
|
+
|
|
4
|
+
.#{$colorPickerClassPrefix} {
|
|
5
|
+
.el-input__wrapper {
|
|
6
|
+
background: var(--oio-input-background);
|
|
7
|
+
padding: 0 11px;
|
|
8
|
+
&:hover {
|
|
9
|
+
border-color: var(--oio-primary-color-hover);
|
|
10
|
+
box-shadow: 0 0 0 1px var(--oio-primary-color-hover) inset;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.el-input.is-disabled .el-input__wrapper {
|
|
15
|
+
background: var(--oio-readonly-bg);
|
|
16
|
+
border-color: var(--oio-border-color);
|
|
17
|
+
box-shadow: 0 0 0 1px var(--oio-readonly-bg) inset;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.el-color-picker {
|
|
21
|
+
outline: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.el-color-picker .el-color-picker__empty {
|
|
25
|
+
color: var(--oio-addon-color-pick-icon-color);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.el-color-picker__color.is-alpha {
|
|
29
|
+
background-image: none;
|
|
30
|
+
border: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.el-input {
|
|
34
|
+
@include el-input;
|
|
35
|
+
|
|
36
|
+
width: 100%;
|
|
37
|
+
|
|
38
|
+
.el-input__inner {
|
|
39
|
+
border-color: var($parameterPrefix + -border-color);
|
|
40
|
+
height: var($parameterPrefix + -height);
|
|
41
|
+
line-height: var($inputParameterPrefix + -line-height);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.el-input-group__prepend,
|
|
45
|
+
.el-input-group__append {
|
|
46
|
+
border-color: var(--oio-addon-color-pick-border-color);
|
|
47
|
+
padding: 0;
|
|
48
|
+
background-color: transparent;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.el-input-group__prepend .#{$colorPickerClassPrefix}-inner {
|
|
52
|
+
border-top-left-radius: var($parameterPrefix + -border-radius);
|
|
53
|
+
border-bottom-left-radius: var($parameterPrefix + -border-radius);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.el-input-group__append .#{$colorPickerClassPrefix}-inner {
|
|
57
|
+
border-top-right-radius: var($parameterPrefix + -border-radius);
|
|
58
|
+
border-bottom-right-radius: var($parameterPrefix + -border-radius);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.#{$colorPickerClassPrefix}-inner {
|
|
63
|
+
height: calc(var($parameterPrefix + -height) - 2px);
|
|
64
|
+
width: calc(var($parameterPrefix + -height) - 2px);
|
|
65
|
+
display: flex;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
align-items: center;
|
|
68
|
+
|
|
69
|
+
.el-color-picker {
|
|
70
|
+
.el-color-picker__trigger {
|
|
71
|
+
border: none;
|
|
72
|
+
border-radius: 0;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&-readonly {
|
|
77
|
+
pointer-events: none;
|
|
78
|
+
background-color: var(--oio-addon-color-pick-readonly-background);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
& > .is-disabled {
|
|
82
|
+
.el-color-picker__mask {
|
|
83
|
+
display: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.el-color-picker__trigger {
|
|
87
|
+
background-color: var(--oio-addon-color-pick-readonly-background);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&.#{$colorPickerClassPrefix}-readonly {
|
|
93
|
+
.el-input__inner[readonly] {
|
|
94
|
+
background-color: transparent;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.el-color-picker__trigger {
|
|
98
|
+
pointer-events: none;
|
|
99
|
+
|
|
100
|
+
.el-color-picker__icon {
|
|
101
|
+
display: none;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
& > .el-input.is-disabled {
|
|
107
|
+
background-color: var($parameterPrefix + -disabled-bg);
|
|
108
|
+
border: 1px solid var(--oio-border-color);
|
|
109
|
+
box-sizing: border-box;
|
|
110
|
+
|
|
111
|
+
.el-input__inner {
|
|
112
|
+
border-color: var(--oio-border-color);
|
|
113
|
+
height: calc(var(--oio-height) - 2px);
|
|
114
|
+
line-height: calc(var(--oio-input-line-height) - 2px);
|
|
115
|
+
background-color: var($parameterPrefix + -disabled-bg);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.el-color-picker__trigger {
|
|
119
|
+
height: calc(var(--oio-height) - 2px);
|
|
120
|
+
line-height: calc(var(--oio-input-line-height) - 2px);
|
|
121
|
+
border-left: 1px solid var(--oio-border-color);
|
|
122
|
+
border-right: 1px solid var(--oio-border-color);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as OioDateTimePicker } from './oio-date-time-picker.vue';
|
|
2
|
+
export { default as OioDatePicker } from './oio-date-picker.vue';
|
|
3
|
+
export { default as OioTimePicker } from './oio-time-picker.vue';
|
|
4
|
+
export { default as OioYearPicker } from './oio-year-picker.vue';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { CastHelper, DateFormatMap, DateTimePickerMode } from '@oinone/kunlun-shared';
|
|
3
|
+
import { OioDatePickerProps, PropRecordHelper } from '@oinone/kunlun-vue-ui-common';
|
|
4
|
+
import { createVNode, defineComponent } from 'vue';
|
|
5
|
+
import OioDateTimePicker from './oio-date-time-picker.vue';
|
|
6
|
+
|
|
7
|
+
export default defineComponent({
|
|
8
|
+
name: 'OioDatePicker',
|
|
9
|
+
components: {
|
|
10
|
+
OioDateTimePicker
|
|
11
|
+
},
|
|
12
|
+
props: {
|
|
13
|
+
...OioDatePickerProps
|
|
14
|
+
},
|
|
15
|
+
emits: ['update:value'],
|
|
16
|
+
setup() {
|
|
17
|
+
const convertFormat = (val: string) => {
|
|
18
|
+
return DateFormatMap.get(val);
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
convertFormat
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
render() {
|
|
25
|
+
return createVNode(OioDateTimePicker, {
|
|
26
|
+
...PropRecordHelper.convert(OioDatePickerProps, CastHelper.cast(this)),
|
|
27
|
+
...this.$attrs,
|
|
28
|
+
'onUpdate:value': (val) => {
|
|
29
|
+
this.$emit('update:value', val);
|
|
30
|
+
},
|
|
31
|
+
mode: DateTimePickerMode.date,
|
|
32
|
+
hasDateFormat: true,
|
|
33
|
+
hasTimeFormat: false,
|
|
34
|
+
convertFormat: this.convertFormat
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
</script>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { CastHelper, DateTimePickerMode, DateUtil, defaultFormat, StringHelper } from '@oinone/kunlun-shared';
|
|
3
|
+
import { OioDateTimePickerProps } from '@oinone/kunlun-vue-ui-common';
|
|
4
|
+
import { ElDatePicker, ElTimePicker } from 'element-plus';
|
|
5
|
+
import { Component, computed, createVNode, defineComponent } from 'vue';
|
|
6
|
+
import { DEFAULT_PREFIX } from '../../theme';
|
|
7
|
+
|
|
8
|
+
export default defineComponent({
|
|
9
|
+
name: 'OioDateTimePicker',
|
|
10
|
+
components: {
|
|
11
|
+
ElDatePicker,
|
|
12
|
+
ElTimePicker
|
|
13
|
+
},
|
|
14
|
+
inheritAttrs: false,
|
|
15
|
+
props: {
|
|
16
|
+
...OioDateTimePickerProps
|
|
17
|
+
},
|
|
18
|
+
emits: ['update:value'],
|
|
19
|
+
setup(props) {
|
|
20
|
+
const getDateTimeFormat = () => {
|
|
21
|
+
return DateUtil.fetchDatetimeFormat(
|
|
22
|
+
{ hasDateFormat: props.hasDateFormat, hasTimeFormat: props.hasTimeFormat },
|
|
23
|
+
props.format,
|
|
24
|
+
props.dateFormat,
|
|
25
|
+
props.timeFormat,
|
|
26
|
+
props.convertFormat,
|
|
27
|
+
props.convertDateFormat,
|
|
28
|
+
props.convertTimeFormat
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const format = computed(() => {
|
|
33
|
+
return getDateTimeFormat() || defaultFormat;
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const valueFormat = computed(() => {
|
|
37
|
+
return props.valueFormat || defaultFormat;
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const defaultValue = computed(() => {
|
|
41
|
+
return DateUtil.toDate(props.defaultValue, valueFormat.value);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
format,
|
|
46
|
+
valueFormat,
|
|
47
|
+
defaultValue
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
render() {
|
|
51
|
+
let component: Component = ElDatePicker;
|
|
52
|
+
if (this.mode === DateTimePickerMode.time) {
|
|
53
|
+
component = ElTimePicker;
|
|
54
|
+
}
|
|
55
|
+
const datetimePickerClassList = [`${DEFAULT_PREFIX}-date-time-picker`];
|
|
56
|
+
if (this.readonly) {
|
|
57
|
+
datetimePickerClassList.push(`${DEFAULT_PREFIX}-date-time-picker-readonly`);
|
|
58
|
+
}
|
|
59
|
+
return createVNode(component, {
|
|
60
|
+
defaultValue: this.defaultValue,
|
|
61
|
+
placeholder: this.placeholder,
|
|
62
|
+
readonly: this.readonly,
|
|
63
|
+
disabled: this.disabled,
|
|
64
|
+
format: this.format,
|
|
65
|
+
valueFormat: this.valueFormat,
|
|
66
|
+
...this.$attrs,
|
|
67
|
+
modelValue: this.value,
|
|
68
|
+
'onUpdate:model-value': (val) => {
|
|
69
|
+
this.$emit('update:value', val);
|
|
70
|
+
},
|
|
71
|
+
type: this.mode,
|
|
72
|
+
clearable: this.allowClear,
|
|
73
|
+
class: StringHelper.append(datetimePickerClassList, CastHelper.cast(this.$attrs.class)),
|
|
74
|
+
popperClass: StringHelper.append([`${DEFAULT_PREFIX}-date-time-picker-popper`], this.dropdownClassName)
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
</script>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { CastHelper, DateTimePickerMode, TimeFormatMap } from '@oinone/kunlun-shared';
|
|
3
|
+
import { OioTimePickerProps, PropRecordHelper } from '@oinone/kunlun-vue-ui-common';
|
|
4
|
+
import { createVNode, defineComponent } from 'vue';
|
|
5
|
+
import OioDateTimePicker from './oio-date-time-picker.vue';
|
|
6
|
+
|
|
7
|
+
export default defineComponent({
|
|
8
|
+
name: 'OioTimePicker',
|
|
9
|
+
components: {
|
|
10
|
+
OioDateTimePicker
|
|
11
|
+
},
|
|
12
|
+
props: {
|
|
13
|
+
...OioTimePickerProps
|
|
14
|
+
},
|
|
15
|
+
emits: ['update:value'],
|
|
16
|
+
setup() {
|
|
17
|
+
const convertFormat = (val: string) => {
|
|
18
|
+
return TimeFormatMap.get(val);
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
convertFormat
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
render() {
|
|
25
|
+
return createVNode(OioDateTimePicker, {
|
|
26
|
+
...PropRecordHelper.convert(OioTimePickerProps, CastHelper.cast(this)),
|
|
27
|
+
...this.$attrs,
|
|
28
|
+
'onUpdate:value': (val) => {
|
|
29
|
+
this.$emit('update:value', val);
|
|
30
|
+
},
|
|
31
|
+
mode: DateTimePickerMode.time,
|
|
32
|
+
hasDateFormat: false,
|
|
33
|
+
hasTimeFormat: true,
|
|
34
|
+
convertFormat: this.convertFormat
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
</script>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { CastHelper, DateTimePickerMode } from '@oinone/kunlun-shared';
|
|
3
|
+
import { OioYearPickerProps, PropRecordHelper } from '@oinone/kunlun-vue-ui-common';
|
|
4
|
+
import { createVNode, defineComponent } from 'vue';
|
|
5
|
+
import OioDateTimePicker from './oio-date-time-picker.vue';
|
|
6
|
+
|
|
7
|
+
export default defineComponent({
|
|
8
|
+
name: 'OioYearPicker',
|
|
9
|
+
components: {
|
|
10
|
+
OioDateTimePicker
|
|
11
|
+
},
|
|
12
|
+
props: {
|
|
13
|
+
...OioYearPickerProps
|
|
14
|
+
},
|
|
15
|
+
emits: ['update:value'],
|
|
16
|
+
render() {
|
|
17
|
+
return createVNode(OioDateTimePicker, {
|
|
18
|
+
...PropRecordHelper.convert(OioYearPickerProps, CastHelper.cast(this)),
|
|
19
|
+
...this.$attrs,
|
|
20
|
+
'onUpdate:value': (val) => {
|
|
21
|
+
this.$emit('update:value', val);
|
|
22
|
+
},
|
|
23
|
+
mode: DateTimePickerMode.year,
|
|
24
|
+
hasDateFormat: false,
|
|
25
|
+
hasTimeFormat: false
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
</script>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
@import '../../../style/mixin.scss';
|
|
2
|
+
@import '../../oio-input/style/mixin/el-input.scss';
|
|
3
|
+
@import './parameters.scss';
|
|
4
|
+
|
|
5
|
+
.#{$dateTimePickerClassPrefix} {
|
|
6
|
+
width: 100%;
|
|
7
|
+
|
|
8
|
+
&.el-date-editor.el-input,
|
|
9
|
+
&.el-date-editor.el-input__inner {
|
|
10
|
+
@include el-input;
|
|
11
|
+
width: 100%;
|
|
12
|
+
|
|
13
|
+
.el-input__inner {
|
|
14
|
+
@include oio-appearance($inputParameterPrefix);
|
|
15
|
+
|
|
16
|
+
height: var($parameterPrefix + -height);
|
|
17
|
+
line-height: var($inputParameterPrefix + -line-height);
|
|
18
|
+
padding-right: 8px;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
text-overflow: ellipsis;
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
|
|
23
|
+
&:hover {
|
|
24
|
+
@include oio-hover($inputParameterPrefix);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&:focus {
|
|
28
|
+
@include oio-focus($inputParameterPrefix);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&[disabled] {
|
|
32
|
+
@include oio-disabled();
|
|
33
|
+
|
|
34
|
+
&:hover {
|
|
35
|
+
@include oio-disabled(true, $inputParameterPrefix);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&:focus {
|
|
39
|
+
@include oio-disabled(true, $inputParameterPrefix);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&.#{$dateTimePickerClassPrefix}-readonly {
|
|
46
|
+
.el-input__inner {
|
|
47
|
+
@include oio-readonly();
|
|
48
|
+
|
|
49
|
+
&:hover {
|
|
50
|
+
@include oio-readonly();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:focus {
|
|
54
|
+
@include oio-readonly();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@import '../parameters';
|
|
2
|
+
|
|
3
|
+
@mixin el-input {
|
|
4
|
+
--el-input-text-color: var(#{$inputParameterPrefix + -text-color});
|
|
5
|
+
--el-input-border: var(#{$inputParameterPrefix + -border-width}) var(#{$inputParameterPrefix + -border-style})
|
|
6
|
+
var(#{$inputParameterPrefix + -border-color});
|
|
7
|
+
--el-input-border-color: var(#{$inputParameterPrefix + -border-color});
|
|
8
|
+
--el-input-border-radius: var(#{$inputParameterPrefix + -border-radius});
|
|
9
|
+
--el-input-hover-border: var(#{$inputParameterPrefix + -border-style-hover});
|
|
10
|
+
--el-input-focus-border: var(#{$inputParameterPrefix + -border-style-focus});
|
|
11
|
+
font-size: var($parameterPrefix + -font-size);
|
|
12
|
+
line-height: var($inputParameterPrefix + -line-height);
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
@import '../../../style/global-parameters.scss';
|
|
2
|
+
|
|
3
|
+
$elInputPrefix: el-input;
|
|
4
|
+
$elInputParameterPrefix: $elParameterPrefix + -input;
|
|
5
|
+
$elInputClassPrefix: $elInputPrefix;
|
|
6
|
+
|
|
7
|
+
$inputPrefix: $prefix + -input;
|
|
8
|
+
$inputParameterPrefix: $parameterPrefix + -input;
|
|
9
|
+
$inputClassPrefix: $inputPrefix;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as OioModal } from './oio-modal.vue';
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { CastHelper, StringHelper } from '@oinone/kunlun-shared';
|
|
3
|
+
import { ButtonType, OioModalProps, PropRecordHelper, useModal } from '@oinone/kunlun-vue-ui-common';
|
|
4
|
+
import { ElButton, ElDialog, ElLoadingDirective } from 'element-plus';
|
|
5
|
+
import { createVNode, defineComponent, withDirectives } from 'vue';
|
|
6
|
+
import { DEFAULT_PREFIX } from '../../theme';
|
|
7
|
+
|
|
8
|
+
export default defineComponent({
|
|
9
|
+
name: 'OioModal',
|
|
10
|
+
components: {
|
|
11
|
+
ElDialog,
|
|
12
|
+
ElButton
|
|
13
|
+
},
|
|
14
|
+
inheritAttrs: false,
|
|
15
|
+
props: {
|
|
16
|
+
...OioModalProps
|
|
17
|
+
},
|
|
18
|
+
slots: ['default', 'header', 'footer', 'icon'],
|
|
19
|
+
emits: ['update:visible'],
|
|
20
|
+
setup(props, context) {
|
|
21
|
+
return {
|
|
22
|
+
...useModal(props, context)
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
render() {
|
|
26
|
+
const slots = PropRecordHelper.collectionSlots(this.$slots, [
|
|
27
|
+
{
|
|
28
|
+
origin: 'default',
|
|
29
|
+
isNotNull: true
|
|
30
|
+
},
|
|
31
|
+
['header', 'title'],
|
|
32
|
+
{
|
|
33
|
+
origin: 'footer',
|
|
34
|
+
default: () => {
|
|
35
|
+
return [
|
|
36
|
+
createVNode(
|
|
37
|
+
ElButton,
|
|
38
|
+
{
|
|
39
|
+
onClick: this.cancel
|
|
40
|
+
},
|
|
41
|
+
this.cancelText
|
|
42
|
+
),
|
|
43
|
+
createVNode(
|
|
44
|
+
ElButton,
|
|
45
|
+
{
|
|
46
|
+
type: ButtonType.primary,
|
|
47
|
+
onClick: this.enter
|
|
48
|
+
},
|
|
49
|
+
this.enterText
|
|
50
|
+
)
|
|
51
|
+
];
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
'icon'
|
|
55
|
+
]);
|
|
56
|
+
return withDirectives(
|
|
57
|
+
createVNode(
|
|
58
|
+
ElDialog,
|
|
59
|
+
{
|
|
60
|
+
title: this.title,
|
|
61
|
+
width: this.width,
|
|
62
|
+
draggable: this.draggable,
|
|
63
|
+
showClose: true,
|
|
64
|
+
closeOnClickModal: true,
|
|
65
|
+
closeOnPressEscape: true,
|
|
66
|
+
destroyOnClose: this.destroyOnClose,
|
|
67
|
+
...this.$attrs,
|
|
68
|
+
class: StringHelper.append([`${DEFAULT_PREFIX}-modal`], CastHelper.cast(this.$attrs.class)),
|
|
69
|
+
modelValue: this.visible,
|
|
70
|
+
beforeClose: this.cancel
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
...slots,
|
|
74
|
+
default: () => slots.default({ data: this.data })
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
[[ElLoadingDirective, this.loading]]
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
</script>
|
|
File without changes
|
package/src/index.ts
ADDED