@zkwq/business 0.0.4 → 0.0.6
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/package.json +2 -2
- package/src/components/base/ui/alert/Alert.vue +0 -94
- package/src/components/base/ui/autocomplete/autocomplete-suggestions.vue +0 -77
- package/src/components/base/ui/autocomplete/autocomplete.vue +0 -305
- package/src/components/base/ui/backtop/main.vue +0 -112
- package/src/components/base/ui/button/Button.vue +0 -84
- package/src/components/base/ui/button/ButtonGroup.vue +0 -10
- package/src/components/base/ui/carousel/Carousel.vue +0 -304
- package/src/components/base/ui/carousel/CarouselItem.vue +0 -137
- package/src/components/base/ui/cascader/cascader.vue +0 -650
- package/src/components/base/ui/cascader-panel/cascader-menu.vue +0 -138
- package/src/components/base/ui/cascader-panel/cascader-node.vue +0 -246
- package/src/components/base/ui/cascader-panel/cascader-panel.vue +0 -382
- package/src/components/base/ui/cascader-panel/node.js +0 -166
- package/src/components/base/ui/cascader-panel/store.js +0 -62
- package/src/components/base/ui/checkbox/checkbox-button.vue +0 -199
- package/src/components/base/ui/checkbox/checkbox-group.vue +0 -48
- package/src/components/base/ui/checkbox/checkbox.vue +0 -222
- package/src/components/base/ui/col/col.js +0 -71
- package/src/components/base/ui/collapse/collapse-item.vue +0 -180
- package/src/components/base/ui/collapse/collapse.vue +0 -73
- package/src/components/base/ui/color-picker/color.js +0 -317
- package/src/components/base/ui/color-picker/components/alpha-slider.vue +0 -132
- package/src/components/base/ui/color-picker/components/hue-slider.vue +0 -123
- package/src/components/base/ui/color-picker/components/picker-dropdown.vue +0 -119
- package/src/components/base/ui/color-picker/components/predefine.vue +0 -61
- package/src/components/base/ui/color-picker/components/sv-panel.vue +0 -100
- package/src/components/base/ui/color-picker/draggable.js +0 -36
- package/src/components/base/ui/color-picker/index.js +0 -2
- package/src/components/base/ui/color-picker/main.vue +0 -188
- package/src/components/base/ui/date-picker/basic/date-table.vue +0 -441
- package/src/components/base/ui/date-picker/basic/month-table.vue +0 -254
- package/src/components/base/ui/date-picker/basic/time-spinner.vue +0 -304
- package/src/components/base/ui/date-picker/basic/year-table.vue +0 -101
- package/src/components/base/ui/date-picker/panel/date-range.vue +0 -680
- package/src/components/base/ui/date-picker/panel/date.vue +0 -597
- package/src/components/base/ui/date-picker/panel/month-range.vue +0 -289
- package/src/components/base/ui/date-picker/panel/time-range.vue +0 -248
- package/src/components/base/ui/date-picker/panel/time-select.vue +0 -178
- package/src/components/base/ui/date-picker/panel/time.vue +0 -186
- package/src/components/base/ui/date-picker/picker/date-picker.js +0 -43
- package/src/components/base/ui/date-picker/picker/time-picker.js +0 -39
- package/src/components/base/ui/date-picker/picker/time-select.js +0 -21
- package/src/components/base/ui/date-picker/picker.vue +0 -942
- package/src/components/base/ui/dialog/Index.vue +0 -212
- package/src/components/base/ui/directive/repeat-click.js +0 -24
- package/src/components/base/ui/directive/ripple.js +0 -303
- package/src/components/base/ui/divider/Divider.vue +0 -37
- package/src/components/base/ui/drawer/Drawer.vue +0 -202
- package/src/components/base/ui/dropdown/dropdown-item.vue +0 -39
- package/src/components/base/ui/dropdown/dropdown-menu.vue +0 -63
- package/src/components/base/ui/dropdown/dropdown.vue +0 -308
- package/src/components/base/ui/form/Form.vue +0 -167
- package/src/components/base/ui/form/FormItem.vue +0 -334
- package/src/components/base/ui/form/LabelWrap.vue +0 -69
- package/src/components/base/ui/icon/icon.vue +0 -13
- package/src/components/base/ui/image/image-viewer.vue +0 -302
- package/src/components/base/ui/image/main.vue +0 -248
- package/src/components/base/ui/index.js +0 -189
- package/src/components/base/ui/input/Input.vue +0 -438
- package/src/components/base/ui/input/calcTextareaHeight.js +0 -104
- package/src/components/base/ui/input-number/input-number.vue +0 -285
- package/src/components/base/ui/locale/format.js +0 -32
- package/src/components/base/ui/locale/index.js +0 -48
- package/src/components/base/ui/locale/lang/zh-CN.js +0 -120
- package/src/components/base/ui/menu/menu-item-group.vue +0 -45
- package/src/components/base/ui/menu/menu-item.vue +0 -112
- package/src/components/base/ui/menu/menu-mixin.js +0 -44
- package/src/components/base/ui/menu/menu.vue +0 -312
- package/src/components/base/ui/menu/submenu.vue +0 -408
- package/src/components/base/ui/message/index.js +0 -2
- package/src/components/base/ui/message/main.js +0 -87
- package/src/components/base/ui/message/main.vue +0 -110
- package/src/components/base/ui/message-box/main.js +0 -216
- package/src/components/base/ui/message-box/main.vue +0 -323
- package/src/components/base/ui/mixin/emitter.js +0 -31
- package/src/components/base/ui/mixin/focus.js +0 -9
- package/src/components/base/ui/mixin/locale.js +0 -9
- package/src/components/base/ui/mixin/migrating.js +0 -33
- package/src/components/base/ui/pagination/pager.vue +0 -163
- package/src/components/base/ui/pagination/pagination.jsx +0 -391
- package/src/components/base/ui/popover/directive.js +0 -20
- package/src/components/base/ui/popover/index.js +0 -14
- package/src/components/base/ui/popover/main.vue +0 -236
- package/src/components/base/ui/progress/Progress.vue +0 -227
- package/src/components/base/ui/radio/radio-button.vue +0 -114
- package/src/components/base/ui/radio/radio-group.vue +0 -111
- package/src/components/base/ui/radio/radio.vue +0 -134
- package/src/components/base/ui/row/row.js +0 -47
- package/src/components/base/ui/scrollbar/bar.jsx +0 -91
- package/src/components/base/ui/scrollbar/index.jsx +0 -203
- package/src/components/base/ui/scrollbar/util.js +0 -32
- package/src/components/base/ui/select/Option.vue +0 -168
- package/src/components/base/ui/select/OptionGroup.vue +0 -60
- package/src/components/base/ui/select/Select.vue +0 -920
- package/src/components/base/ui/select/SelectDropdown.vue +0 -74
- package/src/components/base/ui/select/navigation-mixin.js +0 -54
- package/src/components/base/ui/skeleton/index.js +0 -8
- package/src/components/base/ui/skeleton/src/img-placeholder.vue +0 -16
- package/src/components/base/ui/skeleton/src/index.vue +0 -80
- package/src/components/base/ui/skeleton/src/item.vue +0 -22
- package/src/components/base/ui/skeleton-item/index.js +0 -8
- package/src/components/base/ui/slider/button.vue +0 -238
- package/src/components/base/ui/slider/main.vue +0 -427
- package/src/components/base/ui/slider/marker.js +0 -18
- package/src/components/base/ui/style/alert.scss +0 -147
- package/src/components/base/ui/style/animations.scss +0 -65
- package/src/components/base/ui/style/autocomplete.scss +0 -81
- package/src/components/base/ui/style/backtop.scss +0 -20
- package/src/components/base/ui/style/button-group.scss +0 -0
- package/src/components/base/ui/style/button.scss +0 -380
- package/src/components/base/ui/style/carousel-item.scss +0 -50
- package/src/components/base/ui/style/carousel.scss +0 -161
- package/src/components/base/ui/style/cascader-panel.scss +0 -120
- package/src/components/base/ui/style/cascader.scss +0 -185
- package/src/components/base/ui/style/checkbox-button.scss +0 -0
- package/src/components/base/ui/style/checkbox-group.scss +0 -0
- package/src/components/base/ui/style/checkbox.scss +0 -360
- package/src/components/base/ui/style/col.scss +0 -156
- package/src/components/base/ui/style/collapse-item.scss +0 -0
- package/src/components/base/ui/style/collapse.scss +0 -114
- package/src/components/base/ui/style/color-picker.scss +0 -387
- package/src/components/base/ui/style/config.scss +0 -4
- package/src/components/base/ui/style/date-picker/date-picker.scss +0 -97
- package/src/components/base/ui/style/date-picker/date-range-picker.scss +0 -101
- package/src/components/base/ui/style/date-picker/date-table.scss +0 -151
- package/src/components/base/ui/style/date-picker/month-table.scss +0 -82
- package/src/components/base/ui/style/date-picker/picker-panel.scss +0 -117
- package/src/components/base/ui/style/date-picker/picker.scss +0 -197
- package/src/components/base/ui/style/date-picker/time-picker.scss +0 -85
- package/src/components/base/ui/style/date-picker/time-range-picker.scss +0 -31
- package/src/components/base/ui/style/date-picker/time-spinner.scss +0 -110
- package/src/components/base/ui/style/date-picker/year-table.scss +0 -51
- package/src/components/base/ui/style/date-picker.scss +0 -12
- package/src/components/base/ui/style/dialog.scss +0 -123
- package/src/components/base/ui/style/divider.scss +0 -47
- package/src/components/base/ui/style/drawer.scss +0 -218
- package/src/components/base/ui/style/dropdown-item.scss +0 -0
- package/src/components/base/ui/style/dropdown-menu.scss +0 -0
- package/src/components/base/ui/style/dropdown.scss +0 -185
- package/src/components/base/ui/style/form-item.scss +0 -0
- package/src/components/base/ui/style/form.scss +0 -203
- package/src/components/base/ui/style/function.scss +0 -43
- package/src/components/base/ui/style/icon.scss +0 -1167
- package/src/components/base/ui/style/image.scss +0 -184
- package/src/components/base/ui/style/index.scss +0 -57
- package/src/components/base/ui/style/input-number.scss +0 -187
- package/src/components/base/ui/style/input.scss +0 -477
- package/src/components/base/ui/style/menu-item-group.scss +0 -0
- package/src/components/base/ui/style/menu-item.scss +0 -0
- package/src/components/base/ui/style/menu.scss +0 -294
- package/src/components/base/ui/style/message-box.scss +0 -231
- package/src/components/base/ui/style/message.scss +0 -120
- package/src/components/base/ui/style/mixins.scss +0 -196
- package/src/components/base/ui/style/option-group.scss +0 -42
- package/src/components/base/ui/style/option.scss +0 -36
- package/src/components/base/ui/style/pagination.scss +0 -295
- package/src/components/base/ui/style/popover.scss +0 -40
- package/src/components/base/ui/style/popper.scss +0 -102
- package/src/components/base/ui/style/popup.scss +0 -42
- package/src/components/base/ui/style/progress.scss +0 -141
- package/src/components/base/ui/style/radio-button.scss +0 -113
- package/src/components/base/ui/style/radio-group.scss +0 -9
- package/src/components/base/ui/style/radio.scss +0 -203
- package/src/components/base/ui/style/ripple.scss +0 -35
- package/src/components/base/ui/style/row.scss +0 -39
- package/src/components/base/ui/style/scrollbar.scss +0 -75
- package/src/components/base/ui/style/select-dropdown.scss +0 -59
- package/src/components/base/ui/style/select.scss +0 -154
- package/src/components/base/ui/style/skeleton-item.scss +0 -84
- package/src/components/base/ui/style/skeleton.scss +0 -40
- package/src/components/base/ui/style/slider.scss +0 -250
- package/src/components/base/ui/style/switch.scss +0 -116
- package/src/components/base/ui/style/tabs.scss +0 -602
- package/src/components/base/ui/style/tag.scss +0 -174
- package/src/components/base/ui/style/tooltip.scss +0 -146
- package/src/components/base/ui/style/transition.scss +0 -138
- package/src/components/base/ui/style/upload.scss +0 -603
- package/src/components/base/ui/style/utils.scss +0 -39
- package/src/components/base/ui/style/var.scss +0 -1011
- package/src/components/base/ui/switch/index.vue +0 -174
- package/src/components/base/ui/tabs/tab-bar.vue +0 -57
- package/src/components/base/ui/tabs/tab-nav.vue +0 -294
- package/src/components/base/ui/tabs/tab-pane.vue +0 -56
- package/src/components/base/ui/tabs/tabs.vue +0 -191
- package/src/components/base/ui/tag/Tag.vue +0 -60
- package/src/components/base/ui/tooltip/tooltip.jsx +0 -234
- package/src/components/base/ui/upload/Index.vue +0 -340
- package/src/components/base/ui/upload/Upload.vue +0 -216
- package/src/components/base/ui/upload/UploadDragger.vue +0 -70
- package/src/components/base/ui/upload/UploadList.vue +0 -100
- package/src/components/base/ui/upload/ajax.js +0 -85
- package/src/components/base/ui/util/aria-dialog.js +0 -90
- package/src/components/base/ui/util/aria-utils.js +0 -122
- package/src/components/base/ui/util/clickoutside.js +0 -76
- package/src/components/base/ui/util/date-util.js +0 -292
- package/src/components/base/ui/util/date.js +0 -355
- package/src/components/base/ui/util/debounce.js +0 -21
- package/src/components/base/ui/util/deepmerge.js +0 -100
- package/src/components/base/ui/util/dom.js +0 -215
- package/src/components/base/ui/util/index.js +0 -262
- package/src/components/base/ui/util/menu/aria-menubar.js +0 -14
- package/src/components/base/ui/util/menu/aria-menuitem.js +0 -49
- package/src/components/base/ui/util/menu/aria-submenu.js +0 -59
- package/src/components/base/ui/util/merge.js +0 -14
- package/src/components/base/ui/util/popper.js +0 -1235
- package/src/components/base/ui/util/popup/index.js +0 -218
- package/src/components/base/ui/util/popup/popup-manager.js +0 -194
- package/src/components/base/ui/util/resize-events.js +0 -32
- package/src/components/base/ui/util/scroll-into-view.js +0 -27
- package/src/components/base/ui/util/scrollbar-width.js +0 -29
- package/src/components/base/ui/util/shared.js +0 -7
- package/src/components/base/ui/util/throttle.js +0 -91
- package/src/components/base/ui/util/types.js +0 -24
- package/src/components/base/ui/util/vdom.js +0 -5
- package/src/components/base/ui/util/vue-popper.js +0 -188
- package/src/components/normal/AggsItemH.vue +0 -145
- package/src/index.js +0 -10
- package/src/static/base-icons.ttf +0 -0
- package/src/static/base-icons.woff +0 -0
- package/src/static/label_bg.png +0 -0
- package/src/static/term-label-bg.png +0 -0
- package/src/style/app-article.scss +0 -698
- package/src/style/app-comment.scss +0 -259
- package/src/style/app-recommend.scss +0 -48
- package/src/style/app-richtext.scss +0 -176
- package/src/style/index.scss +0 -523
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
let hiddenTextarea;
|
|
2
|
-
|
|
3
|
-
const HIDDEN_STYLE = `
|
|
4
|
-
height:0 !important;
|
|
5
|
-
visibility:hidden !important;
|
|
6
|
-
overflow:hidden !important;
|
|
7
|
-
position:absolute !important;
|
|
8
|
-
z-index:-1000 !important;
|
|
9
|
-
top:0 !important;
|
|
10
|
-
right:0 !important
|
|
11
|
-
`;
|
|
12
|
-
|
|
13
|
-
const CONTEXT_STYLE = [
|
|
14
|
-
'letter-spacing',
|
|
15
|
-
'line-height',
|
|
16
|
-
'padding-top',
|
|
17
|
-
'padding-bottom',
|
|
18
|
-
'font-family',
|
|
19
|
-
'font-weight',
|
|
20
|
-
'font-size',
|
|
21
|
-
'text-rendering',
|
|
22
|
-
'text-transform',
|
|
23
|
-
'width',
|
|
24
|
-
'text-indent',
|
|
25
|
-
'padding-left',
|
|
26
|
-
'padding-right',
|
|
27
|
-
'border-width',
|
|
28
|
-
'box-sizing'
|
|
29
|
-
];
|
|
30
|
-
|
|
31
|
-
function calculateNodeStyling(targetElement) {
|
|
32
|
-
const style = window.getComputedStyle(targetElement);
|
|
33
|
-
|
|
34
|
-
const boxSizing = style.getPropertyValue('box-sizing');
|
|
35
|
-
|
|
36
|
-
const paddingSize = (
|
|
37
|
-
parseFloat(style.getPropertyValue('padding-bottom')) +
|
|
38
|
-
parseFloat(style.getPropertyValue('padding-top'))
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
const borderSize = (
|
|
42
|
-
parseFloat(style.getPropertyValue('border-bottom-width')) +
|
|
43
|
-
parseFloat(style.getPropertyValue('border-top-width'))
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
const contextStyle = CONTEXT_STYLE
|
|
47
|
-
.map(name => `${name}:${style.getPropertyValue(name)}`)
|
|
48
|
-
.join(';');
|
|
49
|
-
|
|
50
|
-
return { contextStyle, paddingSize, borderSize, boxSizing };
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export default function calcTextareaHeight(
|
|
54
|
-
targetElement,
|
|
55
|
-
minRows = 1,
|
|
56
|
-
maxRows = null
|
|
57
|
-
) {
|
|
58
|
-
if (!hiddenTextarea) {
|
|
59
|
-
hiddenTextarea = document.createElement('textarea');
|
|
60
|
-
document.body.appendChild(hiddenTextarea);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
let {
|
|
64
|
-
paddingSize,
|
|
65
|
-
borderSize,
|
|
66
|
-
boxSizing,
|
|
67
|
-
contextStyle
|
|
68
|
-
} = calculateNodeStyling(targetElement);
|
|
69
|
-
|
|
70
|
-
hiddenTextarea.setAttribute('style', `${contextStyle};${HIDDEN_STYLE}`);
|
|
71
|
-
hiddenTextarea.value = targetElement.value || targetElement.placeholder || '';
|
|
72
|
-
|
|
73
|
-
let height = hiddenTextarea.scrollHeight;
|
|
74
|
-
const result = {};
|
|
75
|
-
|
|
76
|
-
if (boxSizing === 'border-box') {
|
|
77
|
-
height = height + borderSize;
|
|
78
|
-
} else if (boxSizing === 'content-box') {
|
|
79
|
-
height = height - paddingSize;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
hiddenTextarea.value = '';
|
|
83
|
-
let singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
|
|
84
|
-
|
|
85
|
-
if (minRows !== null) {
|
|
86
|
-
let minHeight = singleRowHeight * minRows;
|
|
87
|
-
if (boxSizing === 'border-box') {
|
|
88
|
-
minHeight = minHeight + paddingSize + borderSize;
|
|
89
|
-
}
|
|
90
|
-
height = Math.max(minHeight, height);
|
|
91
|
-
result.minHeight = `${ minHeight }px`;
|
|
92
|
-
}
|
|
93
|
-
if (maxRows !== null) {
|
|
94
|
-
let maxHeight = singleRowHeight * maxRows;
|
|
95
|
-
if (boxSizing === 'border-box') {
|
|
96
|
-
maxHeight = maxHeight + paddingSize + borderSize;
|
|
97
|
-
}
|
|
98
|
-
height = Math.min(maxHeight, height);
|
|
99
|
-
}
|
|
100
|
-
result.height = `${ height }px`;
|
|
101
|
-
hiddenTextarea.parentNode && hiddenTextarea.parentNode.removeChild(hiddenTextarea);
|
|
102
|
-
hiddenTextarea = null;
|
|
103
|
-
return result;
|
|
104
|
-
};
|
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
@dragstart.prevent
|
|
4
|
-
:class="[
|
|
5
|
-
'base-input-number',
|
|
6
|
-
inputNumberSize ? 'base-input-number--' + inputNumberSize : '',
|
|
7
|
-
{ 'is-disabled': inputNumberDisabled },
|
|
8
|
-
{ 'is-without-controls': !controls },
|
|
9
|
-
{ 'is-controls-right': controlsAtRight }
|
|
10
|
-
]">
|
|
11
|
-
<span
|
|
12
|
-
class="base-input-number__decrease"
|
|
13
|
-
role="button"
|
|
14
|
-
v-if="controls"
|
|
15
|
-
v-repeat-click="decrease"
|
|
16
|
-
:class="{'is-disabled': minDisabled}"
|
|
17
|
-
@keydown.enter="decrease">
|
|
18
|
-
<i :class="`base-icon-${controlsAtRight ? 'arrow-down' : 'minus'}`"></i>
|
|
19
|
-
</span>
|
|
20
|
-
<span
|
|
21
|
-
class="base-input-number__increase"
|
|
22
|
-
role="button"
|
|
23
|
-
v-if="controls"
|
|
24
|
-
v-repeat-click="increase"
|
|
25
|
-
:class="{'is-disabled': maxDisabled}"
|
|
26
|
-
@keydown.enter="increase">
|
|
27
|
-
<i :class="`base-icon-${controlsAtRight ? 'arrow-up' : 'plus'}`"></i>
|
|
28
|
-
</span>
|
|
29
|
-
<base-input
|
|
30
|
-
ref="input"
|
|
31
|
-
:value="displayValue"
|
|
32
|
-
:placeholder="placeholder"
|
|
33
|
-
:disabled="inputNumberDisabled"
|
|
34
|
-
:size="inputNumberSize"
|
|
35
|
-
:max="max"
|
|
36
|
-
:min="min"
|
|
37
|
-
:name="name"
|
|
38
|
-
:label="label"
|
|
39
|
-
:show-lable="false"
|
|
40
|
-
:ripple="false"
|
|
41
|
-
@keydown.up.native.prevent="increase"
|
|
42
|
-
@keydown.down.native.prevent="decrease"
|
|
43
|
-
@blur="handleBlur"
|
|
44
|
-
@focus="handleFocus"
|
|
45
|
-
@input="handleInput"
|
|
46
|
-
@change="handleInputChange">
|
|
47
|
-
</base-input>
|
|
48
|
-
</div>
|
|
49
|
-
</template>
|
|
50
|
-
<script>
|
|
51
|
-
import BaseInput from '../input/Input';
|
|
52
|
-
import Focus from '../mixin/focus';
|
|
53
|
-
import RepeatClick from '../directive/repeat-click';
|
|
54
|
-
|
|
55
|
-
export default {
|
|
56
|
-
name: 'BaseInputNumber',
|
|
57
|
-
mixins: [Focus('input')],
|
|
58
|
-
inject: {
|
|
59
|
-
baseForm: {
|
|
60
|
-
default: ''
|
|
61
|
-
},
|
|
62
|
-
elFormItem: {
|
|
63
|
-
default: ''
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
directives: {
|
|
67
|
-
repeatClick: RepeatClick
|
|
68
|
-
},
|
|
69
|
-
components: {
|
|
70
|
-
BaseInput
|
|
71
|
-
},
|
|
72
|
-
props: {
|
|
73
|
-
step: {
|
|
74
|
-
type: Number,
|
|
75
|
-
default: 1
|
|
76
|
-
},
|
|
77
|
-
stepStrictly: {
|
|
78
|
-
type: Boolean,
|
|
79
|
-
default: false
|
|
80
|
-
},
|
|
81
|
-
max: {
|
|
82
|
-
type: Number,
|
|
83
|
-
default: Infinity
|
|
84
|
-
},
|
|
85
|
-
min: {
|
|
86
|
-
type: Number,
|
|
87
|
-
default: -Infinity
|
|
88
|
-
},
|
|
89
|
-
value: {},
|
|
90
|
-
disabled: Boolean,
|
|
91
|
-
size: String,
|
|
92
|
-
controls: {
|
|
93
|
-
type: Boolean,
|
|
94
|
-
default: true
|
|
95
|
-
},
|
|
96
|
-
controlsPosition: {
|
|
97
|
-
type: String,
|
|
98
|
-
default: ''
|
|
99
|
-
},
|
|
100
|
-
name: String,
|
|
101
|
-
label: String,
|
|
102
|
-
placeholder: String,
|
|
103
|
-
precision: {
|
|
104
|
-
type: Number,
|
|
105
|
-
validator(val) {
|
|
106
|
-
return val >= 0 && val === parseInt(val, 10);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
data() {
|
|
111
|
-
return {
|
|
112
|
-
currentValue: 0,
|
|
113
|
-
userInput: null
|
|
114
|
-
};
|
|
115
|
-
},
|
|
116
|
-
watch: {
|
|
117
|
-
value: {
|
|
118
|
-
immediate: true,
|
|
119
|
-
handler(value) {
|
|
120
|
-
let newVal = value === undefined ? value : Number(value);
|
|
121
|
-
if (newVal !== undefined) {
|
|
122
|
-
if (isNaN(newVal)) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (this.stepStrictly) {
|
|
127
|
-
const stepPrecision = this.getPrecision(this.step);
|
|
128
|
-
const precisionFactor = Math.pow(10, stepPrecision);
|
|
129
|
-
newVal = Math.round(newVal / this.step) * precisionFactor * this.step / precisionFactor;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (this.precision !== undefined) {
|
|
133
|
-
newVal = this.toPrecision(newVal, this.precision);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
if (newVal >= this.max) newVal = this.max;
|
|
137
|
-
if (newVal <= this.min) newVal = this.min;
|
|
138
|
-
this.currentValue = newVal;
|
|
139
|
-
this.userInput = null;
|
|
140
|
-
this.$emit('input', newVal);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
computed: {
|
|
145
|
-
minDisabled() {
|
|
146
|
-
return this._decrease(this.value, this.step) < this.min;
|
|
147
|
-
},
|
|
148
|
-
maxDisabled() {
|
|
149
|
-
return this._increase(this.value, this.step) > this.max;
|
|
150
|
-
},
|
|
151
|
-
numPrecision() {
|
|
152
|
-
const { value, step, getPrecision, precision } = this;
|
|
153
|
-
const stepPrecision = getPrecision(step);
|
|
154
|
-
if (precision !== undefined) {
|
|
155
|
-
if (stepPrecision > precision) {
|
|
156
|
-
console.warn('[Element Warn][InputNumber]precision should not be less than the decimal places of step');
|
|
157
|
-
}
|
|
158
|
-
return precision;
|
|
159
|
-
} else {
|
|
160
|
-
return Math.max(getPrecision(value), stepPrecision);
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
controlsAtRight() {
|
|
164
|
-
return this.controls && this.controlsPosition === 'right';
|
|
165
|
-
},
|
|
166
|
-
_baseFormItemSize() {
|
|
167
|
-
return (this.elFormItem || {}).baseFormItemSize;
|
|
168
|
-
},
|
|
169
|
-
inputNumberSize() {
|
|
170
|
-
return this.size || this._baseFormItemSize || (this.$ELEMENT || {}).size;
|
|
171
|
-
},
|
|
172
|
-
inputNumberDisabled() {
|
|
173
|
-
return this.disabled || !!(this.elForm || {}).disabled;
|
|
174
|
-
},
|
|
175
|
-
displayValue() {
|
|
176
|
-
if (this.userInput !== null) {
|
|
177
|
-
return this.userInput;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
let currentValue = this.currentValue;
|
|
181
|
-
|
|
182
|
-
if (typeof currentValue === 'number') {
|
|
183
|
-
if (this.stepStrictly) {
|
|
184
|
-
const stepPrecision = this.getPrecision(this.step);
|
|
185
|
-
const precisionFactor = Math.pow(10, stepPrecision);
|
|
186
|
-
currentValue = Math.round(currentValue / this.step) * precisionFactor * this.step / precisionFactor;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
if (this.precision !== undefined) {
|
|
190
|
-
currentValue = currentValue.toFixed(this.precision);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
return currentValue;
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
methods: {
|
|
198
|
-
toPrecision(num, precision) {
|
|
199
|
-
if (precision === undefined) precision = this.numPrecision;
|
|
200
|
-
return parseFloat(Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision));
|
|
201
|
-
},
|
|
202
|
-
getPrecision(value) {
|
|
203
|
-
if (value === undefined) return 0;
|
|
204
|
-
const valueString = value.toString();
|
|
205
|
-
const dotPosition = valueString.indexOf('.');
|
|
206
|
-
let precision = 0;
|
|
207
|
-
if (dotPosition !== -1) {
|
|
208
|
-
precision = valueString.length - dotPosition - 1;
|
|
209
|
-
}
|
|
210
|
-
return precision;
|
|
211
|
-
},
|
|
212
|
-
_increase(val, step) {
|
|
213
|
-
if (typeof val !== 'number' && val !== undefined) return this.currentValue;
|
|
214
|
-
|
|
215
|
-
const precisionFactor = Math.pow(10, this.numPrecision);
|
|
216
|
-
// Solve the accuracy problem of JS decimal calculation by converting the value to integer.
|
|
217
|
-
return this.toPrecision((precisionFactor * val + precisionFactor * step) / precisionFactor);
|
|
218
|
-
},
|
|
219
|
-
_decrease(val, step) {
|
|
220
|
-
if (typeof val !== 'number' && val !== undefined) return this.currentValue;
|
|
221
|
-
|
|
222
|
-
const precisionFactor = Math.pow(10, this.numPrecision);
|
|
223
|
-
|
|
224
|
-
return this.toPrecision((precisionFactor * val - precisionFactor * step) / precisionFactor);
|
|
225
|
-
},
|
|
226
|
-
increase() {
|
|
227
|
-
if (this.inputNumberDisabled || this.maxDisabled) return;
|
|
228
|
-
const value = this.value || 0;
|
|
229
|
-
const newVal = this._increase(value, this.step);
|
|
230
|
-
this.setCurrentValue(newVal);
|
|
231
|
-
},
|
|
232
|
-
decrease() {
|
|
233
|
-
if (this.inputNumberDisabled || this.minDisabled) return;
|
|
234
|
-
const value = this.value || 0;
|
|
235
|
-
const newVal = this._decrease(value, this.step);
|
|
236
|
-
this.setCurrentValue(newVal);
|
|
237
|
-
},
|
|
238
|
-
handleBlur(event) {
|
|
239
|
-
this.$emit('blur', event);
|
|
240
|
-
},
|
|
241
|
-
handleFocus(event) {
|
|
242
|
-
this.$emit('focus', event);
|
|
243
|
-
},
|
|
244
|
-
setCurrentValue(newVal) {
|
|
245
|
-
const oldVal = this.currentValue;
|
|
246
|
-
if (typeof newVal === 'number' && this.precision !== undefined) {
|
|
247
|
-
newVal = this.toPrecision(newVal, this.precision);
|
|
248
|
-
}
|
|
249
|
-
if (newVal >= this.max) newVal = this.max;
|
|
250
|
-
if (newVal <= this.min) newVal = this.min;
|
|
251
|
-
if (oldVal === newVal) return;
|
|
252
|
-
this.userInput = null;
|
|
253
|
-
this.$emit('input', newVal);
|
|
254
|
-
this.$emit('change', newVal, oldVal);
|
|
255
|
-
this.currentValue = newVal;
|
|
256
|
-
},
|
|
257
|
-
handleInput(value) {
|
|
258
|
-
this.userInput = value;
|
|
259
|
-
},
|
|
260
|
-
handleInputChange(value) {
|
|
261
|
-
const newVal = value === '' ? undefined : Number(value);
|
|
262
|
-
if (!isNaN(newVal) || value === '') {
|
|
263
|
-
this.setCurrentValue(newVal);
|
|
264
|
-
}
|
|
265
|
-
this.userInput = null;
|
|
266
|
-
},
|
|
267
|
-
select() {
|
|
268
|
-
this.$refs.input.select();
|
|
269
|
-
}
|
|
270
|
-
},
|
|
271
|
-
mounted() {
|
|
272
|
-
let innerInput = this.$refs.input.$refs.input;
|
|
273
|
-
innerInput.setAttribute('role', 'spinbutton');
|
|
274
|
-
innerInput.setAttribute('aria-valuemax', this.max);
|
|
275
|
-
innerInput.setAttribute('aria-valuemin', this.min);
|
|
276
|
-
innerInput.setAttribute('aria-valuenow', this.currentValue);
|
|
277
|
-
innerInput.setAttribute('aria-disabled', this.inputNumberDisabled);
|
|
278
|
-
},
|
|
279
|
-
updated() {
|
|
280
|
-
if (!this.$refs || !this.$refs.input) return;
|
|
281
|
-
const innerInput = this.$refs.input.$refs.input;
|
|
282
|
-
innerInput.setAttribute('aria-valuenow', this.currentValue);
|
|
283
|
-
}
|
|
284
|
-
};
|
|
285
|
-
</script>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { hasOwn } from '../util/index'
|
|
2
|
-
|
|
3
|
-
const RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g
|
|
4
|
-
|
|
5
|
-
export default function(Vue) {
|
|
6
|
-
function template(string, ...args) {
|
|
7
|
-
if (args.length === 1 && typeof args[0] === 'object') {
|
|
8
|
-
args = args[0]
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (!args || !args.hasOwnProperty) {
|
|
12
|
-
args = {}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return string.replace(RE_NARGS, (match, prefix, i, index) => {
|
|
16
|
-
let result
|
|
17
|
-
|
|
18
|
-
if (string[index - 1] === '{' &&
|
|
19
|
-
string[index + match.length] === '}') {
|
|
20
|
-
return i
|
|
21
|
-
} else {
|
|
22
|
-
result = hasOwn(args, i) ? args[i] : null
|
|
23
|
-
if (result === null || result === undefined) {
|
|
24
|
-
return ''
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return result
|
|
28
|
-
}
|
|
29
|
-
})
|
|
30
|
-
}
|
|
31
|
-
return template
|
|
32
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import defaultLang from './lang/zh-CN'
|
|
2
|
-
import Vue from 'vue'
|
|
3
|
-
import deepmerge from '../util/deepmerge'
|
|
4
|
-
import Format from './format'
|
|
5
|
-
|
|
6
|
-
const format = Format(Vue)
|
|
7
|
-
let lang = defaultLang
|
|
8
|
-
let merged = false
|
|
9
|
-
let i18nHandler = function() {
|
|
10
|
-
const vuei18n = Object.getPrototypeOf(this || Vue).$t
|
|
11
|
-
if (typeof vuei18n === 'function' && !!Vue.locale) {
|
|
12
|
-
if (!merged) {
|
|
13
|
-
merged = true
|
|
14
|
-
Vue.locale(
|
|
15
|
-
Vue.config.lang,
|
|
16
|
-
deepmerge(lang, Vue.locale(Vue.config.lang) || {}, { clone: true })
|
|
17
|
-
)
|
|
18
|
-
}
|
|
19
|
-
return vuei18n.apply(this, arguments)
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export const t = function(path, options) {
|
|
24
|
-
let value = i18nHandler.apply(this, arguments)
|
|
25
|
-
if (value !== null && value !== undefined) return value
|
|
26
|
-
|
|
27
|
-
const array = path.split('.')
|
|
28
|
-
let current = lang
|
|
29
|
-
|
|
30
|
-
for (let i = 0, j = array.length; i < j; i++) {
|
|
31
|
-
const property = array[i]
|
|
32
|
-
value = current[property]
|
|
33
|
-
if (i === j - 1) return format(value, options)
|
|
34
|
-
if (!value) return ''
|
|
35
|
-
current = value
|
|
36
|
-
}
|
|
37
|
-
return ''
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export const use = function(l) {
|
|
41
|
-
lang = l || lang
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export const i18n = function(fn) {
|
|
45
|
-
i18nHandler = fn || i18nHandler
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export default { use, t, i18n }
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
base: {
|
|
3
|
-
colorpicker: {
|
|
4
|
-
confirm: '确定',
|
|
5
|
-
clear: '清空'
|
|
6
|
-
},
|
|
7
|
-
datepicker: {
|
|
8
|
-
now: '此刻',
|
|
9
|
-
today: '今天',
|
|
10
|
-
cancel: '取消',
|
|
11
|
-
clear: '清空',
|
|
12
|
-
confirm: '确定',
|
|
13
|
-
selectDate: '选择日期',
|
|
14
|
-
selectTime: '选择时间',
|
|
15
|
-
startDate: '开始日期',
|
|
16
|
-
startTime: '开始时间',
|
|
17
|
-
endDate: '结束日期',
|
|
18
|
-
endTime: '结束时间',
|
|
19
|
-
prevYear: '前一年',
|
|
20
|
-
nextYear: '后一年',
|
|
21
|
-
prevMonth: '上个月',
|
|
22
|
-
nextMonth: '下个月',
|
|
23
|
-
year: '年',
|
|
24
|
-
month1: '1 月',
|
|
25
|
-
month2: '2 月',
|
|
26
|
-
month3: '3 月',
|
|
27
|
-
month4: '4 月',
|
|
28
|
-
month5: '5 月',
|
|
29
|
-
month6: '6 月',
|
|
30
|
-
month7: '7 月',
|
|
31
|
-
month8: '8 月',
|
|
32
|
-
month9: '9 月',
|
|
33
|
-
month10: '10 月',
|
|
34
|
-
month11: '11 月',
|
|
35
|
-
month12: '12 月',
|
|
36
|
-
// week: '周次',
|
|
37
|
-
weeks: {
|
|
38
|
-
sun: '日',
|
|
39
|
-
mon: '一',
|
|
40
|
-
tue: '二',
|
|
41
|
-
wed: '三',
|
|
42
|
-
thu: '四',
|
|
43
|
-
fri: '五',
|
|
44
|
-
sat: '六'
|
|
45
|
-
},
|
|
46
|
-
months: {
|
|
47
|
-
jan: '一月',
|
|
48
|
-
feb: '二月',
|
|
49
|
-
mar: '三月',
|
|
50
|
-
apr: '四月',
|
|
51
|
-
may: '五月',
|
|
52
|
-
jun: '六月',
|
|
53
|
-
jul: '七月',
|
|
54
|
-
aug: '八月',
|
|
55
|
-
sep: '九月',
|
|
56
|
-
oct: '十月',
|
|
57
|
-
nov: '十一月',
|
|
58
|
-
dec: '十二月'
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
select: {
|
|
62
|
-
loading: '加载中',
|
|
63
|
-
noMatch: '无匹配数据',
|
|
64
|
-
noData: '无数据',
|
|
65
|
-
placeholder: '请选择'
|
|
66
|
-
},
|
|
67
|
-
cascader: {
|
|
68
|
-
noMatch: '无匹配数据',
|
|
69
|
-
loading: '加载中',
|
|
70
|
-
placeholder: '请选择',
|
|
71
|
-
noData: '暂无数据'
|
|
72
|
-
},
|
|
73
|
-
pagination: {
|
|
74
|
-
goto: '前往',
|
|
75
|
-
pagesize: '条/页',
|
|
76
|
-
total: '共 {total} {unitText}',
|
|
77
|
-
pageClassifier: '页'
|
|
78
|
-
},
|
|
79
|
-
messagebox: {
|
|
80
|
-
title: '提示',
|
|
81
|
-
confirm: '确定',
|
|
82
|
-
cancel: '取消',
|
|
83
|
-
error: '输入的数据不合法!'
|
|
84
|
-
},
|
|
85
|
-
upload: {
|
|
86
|
-
deleteTip: '按 delete 键可删除',
|
|
87
|
-
delete: '删除',
|
|
88
|
-
preview: '查看图片',
|
|
89
|
-
continue: '继续上传'
|
|
90
|
-
},
|
|
91
|
-
table: {
|
|
92
|
-
emptyText: '暂无数据',
|
|
93
|
-
confirmFilter: '筛选',
|
|
94
|
-
resetFilter: '重置',
|
|
95
|
-
clearFilter: '全部',
|
|
96
|
-
sumText: '合计'
|
|
97
|
-
},
|
|
98
|
-
tree: {
|
|
99
|
-
emptyText: '暂无数据'
|
|
100
|
-
},
|
|
101
|
-
transfer: {
|
|
102
|
-
noMatch: '无匹配数据',
|
|
103
|
-
noData: '无数据',
|
|
104
|
-
titles: ['列表 1', '列表 2'],
|
|
105
|
-
filterPlaceholder: '请输入搜索内容',
|
|
106
|
-
noCheckedFormat: '共 {total} 项',
|
|
107
|
-
hasCheckedFormat: '已选 {checked}/{total} 项'
|
|
108
|
-
},
|
|
109
|
-
image: {
|
|
110
|
-
error: '加载失败'
|
|
111
|
-
},
|
|
112
|
-
pageHeader: {
|
|
113
|
-
title: '返回'
|
|
114
|
-
},
|
|
115
|
-
popconfirm: {
|
|
116
|
-
confirmButtonText: '确定',
|
|
117
|
-
cancelButtonText: '取消'
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<li class="base-menu-item-group">
|
|
3
|
-
<div class="base-menu-item-group__title" :style="{paddingLeft: levelPadding + 'px'}">
|
|
4
|
-
<template v-if="!$slots.title">{{title}}</template>
|
|
5
|
-
<slot v-else name="title"></slot>
|
|
6
|
-
</div>
|
|
7
|
-
<ul>
|
|
8
|
-
<slot></slot>
|
|
9
|
-
</ul>
|
|
10
|
-
</li>
|
|
11
|
-
</template>
|
|
12
|
-
<script>
|
|
13
|
-
export default {
|
|
14
|
-
name: 'BaseMenuItemGroup',
|
|
15
|
-
|
|
16
|
-
componentName: 'BaseMenuItemGroup',
|
|
17
|
-
|
|
18
|
-
inject: ['rootMenu'],
|
|
19
|
-
props: {
|
|
20
|
-
title: {
|
|
21
|
-
type: String
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
data() {
|
|
25
|
-
return {
|
|
26
|
-
paddingLeft: 20
|
|
27
|
-
};
|
|
28
|
-
},
|
|
29
|
-
computed: {
|
|
30
|
-
levelPadding() {
|
|
31
|
-
let padding = 20;
|
|
32
|
-
let parent = this.$parent;
|
|
33
|
-
if (this.rootMenu.collapse) return 20;
|
|
34
|
-
while (parent && parent.$options.componentName !== 'BaseMenu') {
|
|
35
|
-
if (parent.$options.componentName === 'BaseSubmenu') {
|
|
36
|
-
padding += 20;
|
|
37
|
-
}
|
|
38
|
-
parent = parent.$parent;
|
|
39
|
-
}
|
|
40
|
-
return padding;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
</script>
|
|
45
|
-
|