@oinone/kunlun-vue-ui-antd 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-antd.css +1 -0
- package/dist/oinone-kunlun-vue-ui-antd.esm.js +16 -0
- package/dist/oinone-kunlun-vue-ui-antd.scss +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/src/component/index.d.ts +31 -0
- package/dist/types/src/component/oio-block/index.d.ts +3 -0
- package/dist/types/src/component/oio-block/oio-block.vue.d.ts +39 -0
- package/dist/types/src/component/oio-block/oio-col.vue.d.ts +86 -0
- package/dist/types/src/component/oio-block/oio-row.vue.d.ts +34 -0
- package/dist/types/src/component/oio-breadcrumb/index.d.ts +2 -0
- package/dist/types/src/component/oio-breadcrumb/oio-breadcrumb-item.vue.d.ts +14 -0
- package/dist/types/src/component/oio-breadcrumb/oio-breadcrumb.vue.d.ts +14 -0
- package/dist/types/src/component/oio-button/index.d.ts +1 -0
- package/dist/types/src/component/oio-button/oio-button.vue.d.ts +136 -0
- package/dist/types/src/component/oio-cascader/index.d.ts +1 -0
- package/dist/types/src/component/oio-cascader/oio-cascader.vue.d.ts +236 -0
- package/dist/types/src/component/oio-checkbox/index.d.ts +1 -0
- package/dist/types/src/component/oio-checkbox/oio-checkbox.vue.d.ts +56 -0
- package/dist/types/src/component/oio-collapse/index.d.ts +2 -0
- package/dist/types/src/component/oio-collapse/oio-collapse-panel.vue.d.ts +86 -0
- package/dist/types/src/component/oio-collapse/oio-collapse.vue.d.ts +103 -0
- package/dist/types/src/component/oio-date-time-picker/index.d.ts +5 -0
- package/dist/types/src/component/oio-date-time-picker/oio-date-picker.vue.d.ts +182 -0
- package/dist/types/src/component/oio-date-time-picker/oio-date-time-picker.vue.d.ts +240 -0
- package/dist/types/src/component/oio-date-time-picker/oio-time-picker.vue.d.ts +176 -0
- package/dist/types/src/component/oio-date-time-picker/oio-year-picker.vue.d.ts +139 -0
- package/dist/types/src/component/oio-date-time-picker/use-date-time-picker-props.d.ts +15 -0
- package/dist/types/src/component/oio-date-time-range-picker/index.d.ts +5 -0
- package/dist/types/src/component/oio-date-time-range-picker/oio-date-range-picker.vue.d.ts +139 -0
- package/dist/types/src/component/oio-date-time-range-picker/oio-date-time-range-picker.vue.d.ts +195 -0
- package/dist/types/src/component/oio-date-time-range-picker/oio-time-range-picker.vue.d.ts +139 -0
- package/dist/types/src/component/oio-date-time-range-picker/oio-year-range-picker.vue.d.ts +124 -0
- package/dist/types/src/component/oio-date-time-range-picker/use-date-time-range-picker-props.d.ts +12 -0
- package/dist/types/src/component/oio-divider/index.d.ts +2 -0
- package/dist/types/src/component/oio-divider/oio-divider.vue.d.ts +38 -0
- package/dist/types/src/component/oio-drawer/index.d.ts +1 -0
- package/dist/types/src/component/oio-drawer/oio-drawer.vue.d.ts +227 -0
- package/dist/types/src/component/oio-dropdown/index.d.ts +1 -0
- package/dist/types/src/component/oio-dropdown/oio-dropdown.vue.d.ts +78 -0
- package/dist/types/src/component/oio-empty/index.d.ts +1 -0
- package/dist/types/src/component/oio-empty/oio-empty-data.vue.d.ts +42 -0
- package/dist/types/src/component/oio-form/index.d.ts +2 -0
- package/dist/types/src/component/oio-form/oio-form-item.vue.d.ts +126 -0
- package/dist/types/src/component/oio-form/oio-form.vue.d.ts +100 -0
- package/dist/types/src/component/oio-gallery/index.d.ts +1 -0
- package/dist/types/src/component/oio-gallery/oio-gallery.vue.d.ts +98 -0
- package/dist/types/src/component/oio-group/index.d.ts +2 -0
- package/dist/types/src/component/oio-group/oio-group-help.vue.d.ts +65 -0
- package/dist/types/src/component/oio-group/oio-group.vue.d.ts +113 -0
- package/dist/types/src/component/oio-inner-popup/index.d.ts +1 -0
- package/dist/types/src/component/oio-inner-popup/oio-inner-popup.vue.d.ts +195 -0
- package/dist/types/src/component/oio-input/index.d.ts +5 -0
- package/dist/types/src/component/oio-input/oio-input-group.vue.d.ts +16 -0
- package/dist/types/src/component/oio-input/oio-input-number.vue.d.ts +167 -0
- package/dist/types/src/component/oio-input/oio-input-password.vue.d.ts +111 -0
- package/dist/types/src/component/oio-input/oio-input-search.vue.d.ts +106 -0
- package/dist/types/src/component/oio-input/oio-input.vue.d.ts +107 -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 +230 -0
- package/dist/types/src/component/oio-notification/index.d.ts +116 -0
- package/dist/types/src/component/oio-pagination/index.d.ts +1 -0
- package/dist/types/src/component/oio-pagination/oio-pagination.vue.d.ts +107 -0
- package/dist/types/src/component/oio-popconfirm/index.d.ts +1 -0
- package/dist/types/src/component/oio-popconfirm/oio-popconfirm.vue.d.ts +119 -0
- package/dist/types/src/component/oio-select/index.d.ts +1 -0
- package/dist/types/src/component/oio-select/oio-select.vue.d.ts +153 -0
- package/dist/types/src/component/oio-slider/index.d.ts +1 -0
- package/dist/types/src/component/oio-slider/oio-slider.vue.d.ts +155 -0
- package/dist/types/src/component/oio-spin/index.d.ts +1 -0
- package/dist/types/src/component/oio-spin/oio-spin.vue.d.ts +54 -0
- package/dist/types/src/component/oio-switch/index.d.ts +1 -0
- package/dist/types/src/component/oio-switch/oio-switch.vue.d.ts +92 -0
- package/dist/types/src/component/oio-tabs/index.d.ts +3 -0
- package/dist/types/src/component/oio-tabs/oio-tab.vue.d.ts +67 -0
- package/dist/types/src/component/oio-tabs/oio-tabs.vue.d.ts +93 -0
- package/dist/types/src/component/oio-tabs/use-tab-bar.d.ts +5 -0
- package/dist/types/src/component/oio-textarea/index.d.ts +1 -0
- package/dist/types/src/component/oio-textarea/oio-textarea.vue.d.ts +100 -0
- package/dist/types/src/component/oio-tooltip/index.d.ts +2 -0
- package/dist/types/src/component/oio-tooltip/oio-tooltip-help.vue.d.ts +12 -0
- package/dist/types/src/component/oio-tooltip/oio-tooltip.vue.d.ts +76 -0
- package/dist/types/src/component/oio-tree/index.d.ts +1 -0
- package/dist/types/src/component/oio-tree/oio-tree.vue.d.ts +171 -0
- package/dist/types/src/component/oio-tree-select/index.d.ts +1 -0
- package/dist/types/src/component/oio-tree-select/oio-tree-select.vue.d.ts +226 -0
- package/dist/types/src/component/oio-upload/index.d.ts +1 -0
- package/dist/types/src/component/oio-upload/oio-upload.vue.d.ts +187 -0
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/theme/index.d.ts +1 -0
- package/dist/types/src/vc-component/index.d.ts +1 -0
- package/dist/types/src/vc-component/use-max-tag-placeholder.d.ts +7 -0
- package/index.ts +3 -0
- package/package.json +36 -0
- package/rollup.config.js +15 -0
- package/src/component/index.ts +32 -0
- package/src/component/oio-block/index.ts +3 -0
- package/src/component/oio-block/oio-block.vue +77 -0
- package/src/component/oio-block/oio-col.vue +32 -0
- package/src/component/oio-block/oio-row.vue +42 -0
- package/src/component/oio-block/style/a-col.scss +18 -0
- package/src/component/oio-block/style/index.scss +42 -0
- package/src/component/oio-block/style/parameters.scss +13 -0
- package/src/component/oio-breadcrumb/index.ts +2 -0
- package/src/component/oio-breadcrumb/oio-breadcrumb-item.vue +30 -0
- package/src/component/oio-breadcrumb/oio-breadcrumb.vue +30 -0
- package/src/component/oio-button/index.ts +1 -0
- package/src/component/oio-button/oio-button.vue +154 -0
- package/src/component/oio-button/style/a-button.scss +210 -0
- package/src/component/oio-button/style/index.scss +21 -0
- package/src/component/oio-button/style/parameters.scss +5 -0
- package/src/component/oio-cascader/index.ts +1 -0
- package/src/component/oio-cascader/oio-cascader.vue +171 -0
- package/src/component/oio-cascader/style/index.scss +59 -0
- package/src/component/oio-cascader/style/parameters.scss +5 -0
- package/src/component/oio-checkbox/index.ts +1 -0
- package/src/component/oio-checkbox/oio-checkbox.vue +69 -0
- package/src/component/oio-checkbox/style/index.scss +8 -0
- package/src/component/oio-checkbox/style/parameters.scss +5 -0
- package/src/component/oio-collapse/index.ts +2 -0
- package/src/component/oio-collapse/oio-collapse-panel.vue +92 -0
- package/src/component/oio-collapse/oio-collapse.vue +138 -0
- package/src/component/oio-collapse/style/index.scss +59 -0
- package/src/component/oio-collapse/style/parameters.scss +5 -0
- package/src/component/oio-date-time-picker/index.ts +5 -0
- package/src/component/oio-date-time-picker/oio-date-picker.vue +34 -0
- package/src/component/oio-date-time-picker/oio-date-time-picker.vue +91 -0
- package/src/component/oio-date-time-picker/oio-time-picker.vue +34 -0
- package/src/component/oio-date-time-picker/oio-year-picker.vue +34 -0
- package/src/component/oio-date-time-picker/style/index.scss +348 -0
- package/src/component/oio-date-time-picker/style/mixin.scss +16 -0
- package/src/component/oio-date-time-picker/style/parameters.scss +5 -0
- package/src/component/oio-date-time-picker/use-date-time-picker-props.ts +151 -0
- package/src/component/oio-date-time-range-picker/index.ts +5 -0
- package/src/component/oio-date-time-range-picker/oio-date-range-picker.vue +29 -0
- package/src/component/oio-date-time-range-picker/oio-date-time-range-picker.vue +82 -0
- package/src/component/oio-date-time-range-picker/oio-time-range-picker.vue +29 -0
- package/src/component/oio-date-time-range-picker/oio-year-range-picker.vue +29 -0
- package/src/component/oio-date-time-range-picker/style/index.scss +227 -0
- package/src/component/oio-date-time-range-picker/style/parameters.scss +5 -0
- package/src/component/oio-date-time-range-picker/use-date-time-range-picker-props.ts +138 -0
- package/src/component/oio-divider/index.ts +3 -0
- package/src/component/oio-divider/oio-divider.vue +31 -0
- package/src/component/oio-divider/style/index.scss +7 -0
- package/src/component/oio-divider/style/parameters.scss +5 -0
- package/src/component/oio-drawer/index.ts +1 -0
- package/src/component/oio-drawer/oio-drawer.vue +120 -0
- package/src/component/oio-drawer/style/index.scss +93 -0
- package/src/component/oio-drawer/style/parameters.scss +5 -0
- package/src/component/oio-dropdown/index.ts +1 -0
- package/src/component/oio-dropdown/oio-dropdown.vue +81 -0
- package/src/component/oio-dropdown/style/index.scss +30 -0
- package/src/component/oio-dropdown/style/parameters.scss +5 -0
- package/src/component/oio-empty/index.ts +1 -0
- package/src/component/oio-empty/oio-empty-data.vue +47 -0
- package/src/component/oio-empty/style/index.scss +6 -0
- package/src/component/oio-form/index.ts +2 -0
- package/src/component/oio-form/oio-form-item.vue +81 -0
- package/src/component/oio-form/oio-form.vue +102 -0
- package/src/component/oio-form/style/animation.scss +17 -0
- package/src/component/oio-form/style/index.scss +135 -0
- package/src/component/oio-form/style/parameters.scss +9 -0
- package/src/component/oio-gallery/index.ts +1 -0
- package/src/component/oio-gallery/oio-gallery.vue +158 -0
- package/src/component/oio-group/index.ts +2 -0
- package/src/component/oio-group/oio-group-help.vue +28 -0
- package/src/component/oio-group/oio-group.vue +140 -0
- package/src/component/oio-group/style/index.scss +98 -0
- package/src/component/oio-group/style/parameters.scss +5 -0
- package/src/component/oio-inner-popup/index.ts +1 -0
- package/src/component/oio-inner-popup/oio-inner-popup.vue +230 -0
- package/src/component/oio-inner-popup/style/index.scss +147 -0
- package/src/component/oio-inner-popup/style/parameters.scss +5 -0
- package/src/component/oio-input/index.ts +5 -0
- package/src/component/oio-input/oio-input-group.vue +40 -0
- package/src/component/oio-input/oio-input-number.vue +374 -0
- package/src/component/oio-input/oio-input-password.vue +67 -0
- package/src/component/oio-input/oio-input-search.vue +107 -0
- package/src/component/oio-input/oio-input.vue +124 -0
- package/src/component/oio-input/style/a-input.scss +103 -0
- package/src/component/oio-input/style/index.scss +198 -0
- package/src/component/oio-input/style/mixin.scss +50 -0
- package/src/component/oio-input/style/oio-input-group.scss +31 -0
- package/src/component/oio-input/style/oio-input-number.scss +13 -0
- package/src/component/oio-input/style/oio-input-search.scss +94 -0
- package/src/component/oio-input/style/parameters.scss +21 -0
- package/src/component/oio-modal/index.ts +1 -0
- package/src/component/oio-modal/index.zh-CN.md +167 -0
- package/src/component/oio-modal/oio-modal.vue +184 -0
- package/src/component/oio-modal/style/index.scss +167 -0
- package/src/component/oio-modal/style/parameters.scss +5 -0
- package/src/component/oio-notification/index.ts +197 -0
- package/src/component/oio-notification/style/index.scss +67 -0
- package/src/component/oio-notification/style/parameters.scss +5 -0
- package/src/component/oio-pagination/index.ts +1 -0
- package/src/component/oio-pagination/oio-pagination.vue +105 -0
- package/src/component/oio-pagination/style/index.scss +181 -0
- package/src/component/oio-pagination/style/parameters.scss +5 -0
- package/src/component/oio-popconfirm/index.ts +1 -0
- package/src/component/oio-popconfirm/oio-popconfirm.vue +192 -0
- package/src/component/oio-popconfirm/style/index.scss +54 -0
- package/src/component/oio-popconfirm/style/parameters.scss +5 -0
- package/src/component/oio-popover/style/index.scss +16 -0
- package/src/component/oio-popover/style/parameters.scss +5 -0
- package/src/component/oio-radio/style/index.scss +24 -0
- package/src/component/oio-radio/style/parameters.scss +5 -0
- package/src/component/oio-select/index.ts +1 -0
- package/src/component/oio-select/oio-select.vue +104 -0
- package/src/component/oio-select/style/a-select.scss +102 -0
- package/src/component/oio-select/style/index.scss +129 -0
- package/src/component/oio-select/style/mixin.scss +18 -0
- package/src/component/oio-select/style/parameters.scss +5 -0
- package/src/component/oio-slider/index.ts +1 -0
- package/src/component/oio-slider/oio-slider.vue +81 -0
- package/src/component/oio-slider/style/index.scss +100 -0
- package/src/component/oio-slider/style/parameters.scss +5 -0
- package/src/component/oio-spin/index.ts +1 -0
- package/src/component/oio-spin/oio-spin.vue +87 -0
- package/src/component/oio-spin/style/index.scss +48 -0
- package/src/component/oio-spin/style/parameters.scss +5 -0
- package/src/component/oio-switch/index.ts +1 -0
- package/src/component/oio-switch/oio-switch.vue +42 -0
- package/src/component/oio-switch/style/index.scss +36 -0
- package/src/component/oio-switch/style/parameters.scss +5 -0
- package/src/component/oio-tabs/index.ts +3 -0
- package/src/component/oio-tabs/oio-tab.vue +99 -0
- package/src/component/oio-tabs/oio-tabs.vue +188 -0
- package/src/component/oio-tabs/style/index.scss +274 -0
- package/src/component/oio-tabs/style/parameters.scss +9 -0
- package/src/component/oio-tabs/use-tab-bar.ts +69 -0
- package/src/component/oio-textarea/index.ts +1 -0
- package/src/component/oio-textarea/oio-textarea.vue +76 -0
- package/src/component/oio-textarea/style/index.scss +108 -0
- package/src/component/oio-textarea/style/parameters.scss +5 -0
- package/src/component/oio-tooltip/index.ts +2 -0
- package/src/component/oio-tooltip/oio-tooltip-help.vue +40 -0
- package/src/component/oio-tooltip/oio-tooltip.vue +59 -0
- package/src/component/oio-tooltip/style/index.scss +8 -0
- package/src/component/oio-tooltip/style/parameters.scss +9 -0
- package/src/component/oio-tree/index.ts +1 -0
- package/src/component/oio-tree/oio-tree.vue +181 -0
- package/src/component/oio-tree/style/index.scss +51 -0
- package/src/component/oio-tree/style/parameters.scss +5 -0
- package/src/component/oio-tree-select/index.ts +1 -0
- package/src/component/oio-tree-select/oio-tree-select.vue +180 -0
- package/src/component/oio-tree-select/style/index.scss +92 -0
- package/src/component/oio-tree-select/style/parameters.scss +5 -0
- package/src/component/oio-upload/index.ts +1 -0
- package/src/component/oio-upload/oio-upload.vue +232 -0
- package/src/component/oio-upload/style/index.scss +66 -0
- package/src/component/oio-upload/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 +9 -0
- package/src/style/index.scss +31 -0
- package/src/style/mixin.scss +135 -0
- package/src/theme/index.ts +1 -0
- package/src/vc-component/index.ts +1 -0
- package/src/vc-component/use-max-tag-placeholder.ts +38 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
@import '../../../style/mixin.scss';
|
|
2
|
+
@import './parameters.scss';
|
|
3
|
+
@import './mixin.scss';
|
|
4
|
+
|
|
5
|
+
&.ant-input {
|
|
6
|
+
@include input-style();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&.ant-input-affix-wrapper {
|
|
10
|
+
@include oio-appearance($inputParameterPrefix);
|
|
11
|
+
|
|
12
|
+
height: var($parameterPrefix + -height);
|
|
13
|
+
line-height: var($inputParameterPrefix + -line-height);
|
|
14
|
+
font-size: var($parameterPrefix + -font-size);
|
|
15
|
+
align-items: center;
|
|
16
|
+
|
|
17
|
+
input.ant-input {
|
|
18
|
+
height: calc(var(#{$parameterPrefix + -height}) - 8px);
|
|
19
|
+
line-height: var($inputParameterPrefix + -line-height);
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
text-overflow: clip;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
background: var($inputParameterPrefix + -background);
|
|
24
|
+
caret-color: var(--oio-input-text-color);
|
|
25
|
+
&.ant-input-disabled {
|
|
26
|
+
background: var(--oio-disabled-bg);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&:hover {
|
|
31
|
+
@include oio-hover($inputParameterPrefix);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:focus {
|
|
35
|
+
@include oio-focus($inputParameterPrefix);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&.ant-input-affix-wrapper-disabled {
|
|
39
|
+
@include oio-disabled();
|
|
40
|
+
|
|
41
|
+
input.ant-input {
|
|
42
|
+
background: var(--oio-disabled-bg);
|
|
43
|
+
color: var($parameterPrefix + -disabled-color);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&:hover {
|
|
47
|
+
@include oio-disabled(true, $inputParameterPrefix);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&:focus {
|
|
51
|
+
@include oio-disabled(true, $inputParameterPrefix);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&.ant-input-group-wrapper {
|
|
57
|
+
.ant-input-group {
|
|
58
|
+
.ant-input-group-addon {
|
|
59
|
+
border: var($inputParameterPrefix + -border-width) var($inputParameterPrefix + -border-style)
|
|
60
|
+
var($inputParameterPrefix + -border-color);
|
|
61
|
+
border-radius: var($inputParameterPrefix + -border-radius);
|
|
62
|
+
background: var($inputParameterPrefix + -addon-background);
|
|
63
|
+
|
|
64
|
+
&:first-child {
|
|
65
|
+
border-right: none;
|
|
66
|
+
border-top-right-radius: 0;
|
|
67
|
+
border-bottom-right-radius: 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&:last-child {
|
|
71
|
+
border-left: none;
|
|
72
|
+
border-top-left-radius: 0;
|
|
73
|
+
border-bottom-left-radius: 0;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
& > input.ant-input {
|
|
78
|
+
@include input-style();
|
|
79
|
+
|
|
80
|
+
&:first-child {
|
|
81
|
+
border-top-right-radius: 0;
|
|
82
|
+
border-bottom-right-radius: 0;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&:last-child {
|
|
86
|
+
border-top-left-radius: 0;
|
|
87
|
+
border-bottom-left-radius: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&:not(:first-child):not(:last-child) {
|
|
91
|
+
border-radius: 0;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&.ant-input-affix-wrapper-focused {
|
|
98
|
+
@include oio-focus($inputParameterPrefix);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&.ant-input-affix-wrapper-disabled {
|
|
102
|
+
background-color: var($parameterPrefix + -disabled-bg);
|
|
103
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
@import '../../../style/mixin.scss';
|
|
2
|
+
@import './parameters.scss';
|
|
3
|
+
@import './mixin.scss';
|
|
4
|
+
|
|
5
|
+
.ant-form-item-has-error
|
|
6
|
+
:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper,
|
|
7
|
+
.ant-form-item-has-error
|
|
8
|
+
:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:hover,
|
|
9
|
+
.ant-form-item-has-error :not(.ant-input-disabled):not(.ant-input-borderless).ant-input,
|
|
10
|
+
.ant-form-item-has-error :not(.ant-input-disabled):not(.ant-input-borderless).ant-input:hover,
|
|
11
|
+
.ant-form-item-has-error
|
|
12
|
+
:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper,
|
|
13
|
+
.ant-form-item-has-error
|
|
14
|
+
:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper:hover {
|
|
15
|
+
background-color: var(--oio-input-background-color);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.#{$inputClassPrefix} {
|
|
19
|
+
@import './a-input.scss';
|
|
20
|
+
|
|
21
|
+
.ant-input-clear-icon {
|
|
22
|
+
display: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.anticon.ant-input-clear-icon:hover {
|
|
26
|
+
color: var(--oio-input-clear-color);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.anticon.ant-input-clear-icon-has-suffix {
|
|
30
|
+
margin: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.ant-input {
|
|
34
|
+
color: var(--oio-input-text-color);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&.#{$inputClassPrefix}-allow-clear {
|
|
38
|
+
&:hover {
|
|
39
|
+
& > .ant-input-suffix > .ant-input-clear-icon {
|
|
40
|
+
display: inline-block;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&.#{$inputClassPrefix}-readonly {
|
|
46
|
+
background-color: var($parameterPrefix + -readonly-bg);
|
|
47
|
+
|
|
48
|
+
&:hover {
|
|
49
|
+
@include oio-readonly(true, $inputParameterPrefix);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&:focus {
|
|
53
|
+
@include oio-readonly(true, $inputParameterPrefix);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
input.ant-input {
|
|
57
|
+
@include oio-readonly();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&.ant-input-affix-wrapper-focused {
|
|
61
|
+
@include oio-readonly(true, $inputParameterPrefix);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.#{$inputClassPrefix}-wrapper {
|
|
67
|
+
&.#{$inputClassPrefix}-show-count[data-count] {
|
|
68
|
+
position: relative;
|
|
69
|
+
|
|
70
|
+
&:after {
|
|
71
|
+
@include counter();
|
|
72
|
+
bottom: 9px;
|
|
73
|
+
right: 4px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&.#{$inputClassPrefix}-allow-clear {
|
|
77
|
+
&:hover {
|
|
78
|
+
&:after {
|
|
79
|
+
display: none;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.#{$inputNumberClassPrefix} {
|
|
87
|
+
&.ant-input-affix-wrapper:not(.#{$inputNumberClassPrefix}-not-handler) {
|
|
88
|
+
padding-right: 0;
|
|
89
|
+
|
|
90
|
+
.ant-input-suffix {
|
|
91
|
+
margin-left: 0;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.ant-input-affix-wrapper {
|
|
96
|
+
border-radius: var($inputParameterPrefix + -border-radius);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&.#{$inputClassPrefix}-readonly {
|
|
100
|
+
&.ant-input-group-wrapper {
|
|
101
|
+
background-color: transparent;
|
|
102
|
+
|
|
103
|
+
.ant-input-group {
|
|
104
|
+
.ant-input-affix-wrapper {
|
|
105
|
+
@include oio-readonly();
|
|
106
|
+
|
|
107
|
+
.ant-input {
|
|
108
|
+
@include oio-readonly();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.ant-input-group-addon {
|
|
113
|
+
background-color: transparent;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&.ant-input-group-wrapper {
|
|
120
|
+
.ant-input-group {
|
|
121
|
+
.ant-input-group-addon {
|
|
122
|
+
border: none;
|
|
123
|
+
background-color: transparent;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
& > input.ant-input,
|
|
127
|
+
& > .ant-input-affix-wrapper {
|
|
128
|
+
&:first-child {
|
|
129
|
+
border-top-right-radius: var($inputParameterPrefix + -border-radius);
|
|
130
|
+
border-bottom-right-radius: var($inputParameterPrefix + -border-radius);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.ant-input-affix-wrapper:not(.#{$inputNumberClassPrefix}-not-handler) {
|
|
136
|
+
padding: 0 0 0 11px;
|
|
137
|
+
|
|
138
|
+
.ant-input-suffix {
|
|
139
|
+
margin-left: 0;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&:hover {
|
|
145
|
+
.oio-handler-wrapper {
|
|
146
|
+
span {
|
|
147
|
+
opacity: 1;
|
|
148
|
+
transition: opacity 0.3s ease-in-out;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.oio-handler-wrapper {
|
|
154
|
+
height: calc(var(#{$parameterPrefix + -height}) - 2px);
|
|
155
|
+
width: 20px;
|
|
156
|
+
display: flex;
|
|
157
|
+
flex-direction: column;
|
|
158
|
+
|
|
159
|
+
span {
|
|
160
|
+
height: 50%;
|
|
161
|
+
font-size: 7px;
|
|
162
|
+
display: flex;
|
|
163
|
+
justify-content: center;
|
|
164
|
+
align-items: center;
|
|
165
|
+
border-left: var($inputParameterPrefix + -border-width) var($inputParameterPrefix + -border-style)
|
|
166
|
+
var($inputParameterPrefix + -border-color);
|
|
167
|
+
cursor: pointer;
|
|
168
|
+
opacity: 0;
|
|
169
|
+
|
|
170
|
+
&:first-child {
|
|
171
|
+
border-top-right-radius: var($inputParameterPrefix + -border-radius);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&:last-child {
|
|
175
|
+
border-top: var($inputParameterPrefix + -border-width) var($inputParameterPrefix + -border-style)
|
|
176
|
+
var($inputParameterPrefix + -border-color);
|
|
177
|
+
border-bottom-right-radius: var($inputParameterPrefix + -border-radius);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&:hover {
|
|
181
|
+
color: var($parameterPrefix + -primary-color-hover);
|
|
182
|
+
|
|
183
|
+
svg {
|
|
184
|
+
color: var($parameterPrefix + -primary-color-hover);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
&:first-child,
|
|
188
|
+
&:last-child {
|
|
189
|
+
height: calc(50% + 6px);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
@import './oio-input-group.scss';
|
|
197
|
+
@import './oio-input-number.scss';
|
|
198
|
+
@import './oio-input-search.scss';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
@import '../../../style/mixin.scss';
|
|
2
|
+
@import './parameters.scss';
|
|
3
|
+
|
|
4
|
+
@mixin input-style() {
|
|
5
|
+
@include oio-appearance($inputParameterPrefix);
|
|
6
|
+
|
|
7
|
+
height: var($parameterPrefix + -height);
|
|
8
|
+
line-height: var($inputParameterPrefix + -line-height);
|
|
9
|
+
font-size: var(--oio-font-size);
|
|
10
|
+
|
|
11
|
+
&:hover {
|
|
12
|
+
@include oio-hover($inputParameterPrefix);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&:focus {
|
|
16
|
+
@include oio-focus($inputParameterPrefix);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&[readonly] {
|
|
20
|
+
@include oio-readonly();
|
|
21
|
+
|
|
22
|
+
&:hover {
|
|
23
|
+
@include oio-readonly(true, $inputParameterPrefix);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:focus {
|
|
27
|
+
@include oio-readonly(true, $inputParameterPrefix);
|
|
28
|
+
}
|
|
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
|
+
@mixin counter() {
|
|
45
|
+
display: block;
|
|
46
|
+
position: absolute;
|
|
47
|
+
color: var($inputParameterPrefix + -counter-color);
|
|
48
|
+
font-size: var($inputParameterPrefix + -counter-font-size);
|
|
49
|
+
content: attr(data-count) '/' attr(data-total);
|
|
50
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
@import './parameters.scss';
|
|
2
|
+
|
|
3
|
+
.#{$inputGroupClassPrefix} {
|
|
4
|
+
&.ant-input-group.ant-input-group-compact {
|
|
5
|
+
display: flex;
|
|
6
|
+
|
|
7
|
+
& > * {
|
|
8
|
+
border-radius: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
& > .ant-cascader-picker:first-child .ant-input,
|
|
12
|
+
& > .ant-select-auto-complete:first-child .ant-input,
|
|
13
|
+
& > .oio-select:first-child > .ant-select-selector,
|
|
14
|
+
& > :first-child {
|
|
15
|
+
border-top-left-radius: var(--oio-border-radius);
|
|
16
|
+
border-bottom-left-radius: var(--oio-border-radius);
|
|
17
|
+
border-top-right-radius: 0;
|
|
18
|
+
border-bottom-right-radius: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
& > .ant-cascader-picker-focused:last-child .ant-input,
|
|
22
|
+
& > .ant-cascader-picker:last-child .ant-input,
|
|
23
|
+
& > .oio-select:last-child > .ant-select-selector,
|
|
24
|
+
& > :last-child {
|
|
25
|
+
border-top-left-radius: 0;
|
|
26
|
+
border-bottom-left-radius: 0;
|
|
27
|
+
border-top-right-radius: var(--oio-border-radius);
|
|
28
|
+
border-bottom-right-radius: var(--oio-border-radius);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@import '../../../style/mixin.scss';
|
|
2
|
+
@import './parameters.scss';
|
|
3
|
+
@import './mixin.scss';
|
|
4
|
+
|
|
5
|
+
.ant-input-number.#{$inputNumberClassPrefix} {
|
|
6
|
+
@include input-style();
|
|
7
|
+
|
|
8
|
+
width: 100%;
|
|
9
|
+
|
|
10
|
+
& > .ant-input-number-input-wrap > .ant-input-number-input {
|
|
11
|
+
height: calc(var(#{$parameterPrefix + -height}) - 2px);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
@import '../../../style/mixin.scss';
|
|
2
|
+
@import './parameters.scss';
|
|
3
|
+
@import './mixin.scss';
|
|
4
|
+
|
|
5
|
+
.#{$inputSearchClassPrefix} {
|
|
6
|
+
height: var($parameterPrefix + -height);
|
|
7
|
+
line-height: var($inputParameterPrefix + -line-height);
|
|
8
|
+
font-size: var($parameterPrefix + -font-size);
|
|
9
|
+
|
|
10
|
+
border-radius: var($inputParameterPrefix + -border-radius);
|
|
11
|
+
background: var(--oio-input-background);
|
|
12
|
+
|
|
13
|
+
&.#{$inputSearchClassPrefix}-normal {
|
|
14
|
+
border: var($inputParameterPrefix + -border-width) var($inputParameterPrefix + -border-style)
|
|
15
|
+
var($inputParameterPrefix + -border-color);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ant-input-group > .ant-input-group-addon:last-child {
|
|
19
|
+
left: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
& > .ant-input-group {
|
|
23
|
+
height: 100%;
|
|
24
|
+
.ant-input {
|
|
25
|
+
height: 100%;
|
|
26
|
+
}
|
|
27
|
+
.ant-input-affix-wrapper {
|
|
28
|
+
height: calc(var(#{$parameterPrefix} + -height) - var(#{$inputParameterPrefix} + -border-width) * 2);
|
|
29
|
+
border: none;
|
|
30
|
+
border-radius: var($inputParameterPrefix + -border-radius);
|
|
31
|
+
background: var(--oio-input-background);
|
|
32
|
+
|
|
33
|
+
input {
|
|
34
|
+
color: var(--oio-text-color);
|
|
35
|
+
caret-color: var(--oio-input-text-color);
|
|
36
|
+
background-color: var(--oio-input-background);
|
|
37
|
+
|
|
38
|
+
&::placeholder,
|
|
39
|
+
&::-webkit-input-placeholder {
|
|
40
|
+
color: var(--oio-placeholder-color);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&:not(:last-child) {
|
|
45
|
+
border-bottom-left-radius: var($inputParameterPrefix + -border-radius);
|
|
46
|
+
border-top-left-radius: var($inputParameterPrefix + -border-radius);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:not(.ant-input-affix-wrapper-disabled):hover {
|
|
50
|
+
z-index: unset;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ant-input-affix-wrapper-focused,
|
|
55
|
+
.ant-input-affix-wrapper:focus {
|
|
56
|
+
box-shadow: none;
|
|
57
|
+
z-index: unset;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ant-input-group-addon {
|
|
61
|
+
background-color: transparent;
|
|
62
|
+
|
|
63
|
+
.ant-btn {
|
|
64
|
+
background: none;
|
|
65
|
+
|
|
66
|
+
.anticon-search,
|
|
67
|
+
.oio-icon {
|
|
68
|
+
color: var(--oio-icon-color);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
& > .ant-input-group-addon:last-child {
|
|
74
|
+
.ant-input-search-button {
|
|
75
|
+
border-radius: 0 var(--oio-border-radius) var(--oio-border-radius) 0;
|
|
76
|
+
|
|
77
|
+
&:not(.ant-btn-primary) {
|
|
78
|
+
color: rgba(0, 0, 0, 0.25);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&.ant-btn-primary {
|
|
82
|
+
background-color: var(--oio-primary-color);
|
|
83
|
+
border-color: var(--oio-primary-color);
|
|
84
|
+
height: 100%;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.ant-input-search-button {
|
|
90
|
+
border: none;
|
|
91
|
+
height: 100%;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@import '../../../style/global-parameters';
|
|
2
|
+
|
|
3
|
+
$inputPrefix: $prefix + -input;
|
|
4
|
+
$inputParameterPrefix: $parameterPrefix + -input;
|
|
5
|
+
$inputClassPrefix: $inputPrefix;
|
|
6
|
+
|
|
7
|
+
$inputSearchPrefix: $inputPrefix + -search;
|
|
8
|
+
$inputSearchParameterPrefix: $inputParameterPrefix + -search;
|
|
9
|
+
$inputSearchClassPrefix: $inputSearchPrefix;
|
|
10
|
+
|
|
11
|
+
$inputNumberPrefix: $inputPrefix + -number;
|
|
12
|
+
$inputNumberParameterPrefix: $inputParameterPrefix + -number;
|
|
13
|
+
$inputNumberClassPrefix: $inputNumberPrefix;
|
|
14
|
+
|
|
15
|
+
$inputPasswordPrefix: $inputPrefix + -password;
|
|
16
|
+
$inputPasswordParameterPrefix: $inputParameterPrefix + -password;
|
|
17
|
+
$inputPasswordClassPrefix: $inputPasswordPrefix;
|
|
18
|
+
|
|
19
|
+
$inputGroupPrefix: $inputPrefix + -group;
|
|
20
|
+
$inputGroupParameterPrefix: $inputParameterPrefix + -group;
|
|
21
|
+
$inputGroupClassPrefix: $inputGroupPrefix;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as OioModal } from './oio-modal.vue';
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
---
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
category: Components
|
|
5
|
+
type: 反馈
|
|
6
|
+
title: OioModal
|
|
7
|
+
subtitle: 对话框
|
|
8
|
+
cover: https://gw.alipayobjects.com/zos/alicdn/3StSdUlSH/Modal.svg
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
模态对话框。
|
|
14
|
+
|
|
15
|
+
## 何时使用
|
|
16
|
+
|
|
17
|
+
需要用户处理事务,又不希望跳转页面以致打断工作流程时,可以使用 `OioModal` 在当前页面正中打开一个浮层,承载相应的操作。
|
|
18
|
+
|
|
19
|
+
另外当需要一个简洁的确认框询问用户时,可以使用 `OioModal.confirm()` 等语法糖方法。
|
|
20
|
+
|
|
21
|
+
## API
|
|
22
|
+
|
|
23
|
+
### 属性
|
|
24
|
+
|
|
25
|
+
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
|
26
|
+
| --- | --- | --- | --- | --- |
|
|
27
|
+
| visible(v-model) | 对话框是否可见 | Boolean | 无 | |
|
|
28
|
+
| confirmLoading | 确定按钮 loading | boolean | 无 | |
|
|
29
|
+
| afterClose | Modal 完全关闭后的回调 | function | 无 | |
|
|
30
|
+
| bodyStyle | Modal body 样式 | object | {} | |
|
|
31
|
+
| cancelText | 取消按钮文字 | string | slot | 取消 | |
|
|
32
|
+
| centered | 垂直居中展示 Modal | Boolean | `false` | |
|
|
33
|
+
| closable | 是否显示右上角的关闭按钮 | boolean | true | |
|
|
34
|
+
| closeIcon | 自定义关闭图标 | VNode \| slot | - | |
|
|
35
|
+
| destroyOnClose | 关闭时销毁 Modal 里的子元素 | boolean | false | |
|
|
36
|
+
| footer | 底部内容,当不需要默认底部按钮时,可以设为 `:footer="null"` | string\|slot | 确定取消按钮 | |
|
|
37
|
+
| forceRender | 强制渲染 Modal | boolean | false | |
|
|
38
|
+
| getContainer | 指定 Modal 挂载的 HTML 节点 | (instance): HTMLElement | () => document.body | |
|
|
39
|
+
| keyboard | 是否支持键盘 esc 关闭 | boolean | true | |
|
|
40
|
+
| mask | 是否展示遮罩 | Boolean | true | |
|
|
41
|
+
| maskClosable | 点击蒙层是否允许关闭 | boolean | true | |
|
|
42
|
+
| maskStyle | 遮罩样式 | object | {} | |
|
|
43
|
+
| okText | 确认按钮文字 | string\|slot | 确定 | |
|
|
44
|
+
| okType | 确认按钮类型 | string | primary | |
|
|
45
|
+
| okButtonProps | ok 按钮 props | [ButtonProps](/components/button/#API) | - | |
|
|
46
|
+
| cancelButtonProps | cancel 按钮 props | [ButtonProps](/components/button/#API) | - | |
|
|
47
|
+
| title | 标题 | string\|slot | 无 | |
|
|
48
|
+
| width | 宽度 | string\|number | 520 | |
|
|
49
|
+
| wrapClassName | 对话框外层容器的类名 | string | - | |
|
|
50
|
+
| zIndex | 设置 Modal 的 `z-index` | Number | 1000 | |
|
|
51
|
+
| dialogStyle | 可用于设置浮层的样式,调整浮层位置等 | object | - | |
|
|
52
|
+
| dialogClass | 可用于设置浮层的类名 | string | - | |
|
|
53
|
+
|
|
54
|
+
### 回调
|
|
55
|
+
|
|
56
|
+
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
|
57
|
+
| --- | --- | --- | --- | --- |
|
|
58
|
+
| confirmLoading | 确定按钮 loading | boolean | 无 | |
|
|
59
|
+
| afterClose | Modal 完全关闭后的回调 | function | 无 | |
|
|
60
|
+
| bodyStyle | Modal body 样式 | object | {} | |
|
|
61
|
+
| cancelText | 取消按钮文字 | string\| slot | 取消 | |
|
|
62
|
+
| centered | 垂直居中展示 Modal | Boolean | `false` | |
|
|
63
|
+
| closable | 是否显示右上角的关闭按钮 | boolean | true | |
|
|
64
|
+
| closeIcon | 自定义关闭图标 | VNode \| slot | - | |
|
|
65
|
+
| destroyOnClose | 关闭时销毁 Modal 里的子元素 | boolean | false | |
|
|
66
|
+
| footer | 底部内容,当不需要默认底部按钮时,可以设为 `:footer="null"` | string\|slot | 确定取消按钮 | |
|
|
67
|
+
| forceRender | 强制渲染 Modal | boolean | false | |
|
|
68
|
+
| getContainer | 指定 Modal 挂载的 HTML 节点 | (instance): HTMLElement | () => document.body | |
|
|
69
|
+
| keyboard | 是否支持键盘 esc 关闭 | boolean | true | |
|
|
70
|
+
| mask | 是否展示遮罩 | Boolean | true | |
|
|
71
|
+
| maskClosable | 点击蒙层是否允许关闭 | boolean | true | |
|
|
72
|
+
| maskStyle | 遮罩样式 | object | {} | |
|
|
73
|
+
| okText | 确认按钮文字 | string\|slot | 确定 | |
|
|
74
|
+
| okType | 确认按钮类型 | string | primary | |
|
|
75
|
+
| okButtonProps | ok 按钮 props | [ButtonProps](/components/button/#API) | - | |
|
|
76
|
+
| cancelButtonProps | cancel 按钮 props | [ButtonProps](/components/button/#API) | - | |
|
|
77
|
+
| title | 标题 | string\|slot | 无 | |
|
|
78
|
+
| visible(v-model) | 对话框是否可见 | boolean | 无 | |
|
|
79
|
+
| width | 宽度 | string\|number | 520 | |
|
|
80
|
+
| wrapClassName | 对话框外层容器的类名 | string | - | |
|
|
81
|
+
| zIndex | 设置 Modal 的 `z-index` | Number | 1000 | |
|
|
82
|
+
| dialogStyle | 可用于设置浮层的样式,调整浮层位置等 | object | - | |
|
|
83
|
+
| dialogClass | 可用于设置浮层的类名 | string | - | |
|
|
84
|
+
|
|
85
|
+
#### 注意
|
|
86
|
+
|
|
87
|
+
> `<Modal />` 默认关闭后状态不会自动清空, 如果希望每次打开都是新内容,请设置 `destroyOnClose`。
|
|
88
|
+
|
|
89
|
+
### Modal.method()
|
|
90
|
+
|
|
91
|
+
包括:
|
|
92
|
+
|
|
93
|
+
- `Modal.info`
|
|
94
|
+
- `Modal.success`
|
|
95
|
+
- `Modal.error`
|
|
96
|
+
- `Modal.warning`
|
|
97
|
+
- `Modal.confirm`
|
|
98
|
+
|
|
99
|
+
以上均为一个函数,参数为 object,具体属性如下:
|
|
100
|
+
|
|
101
|
+
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
|
102
|
+
| --- | --- | --- | --- | --- |
|
|
103
|
+
| autoFocusButton | 指定自动获得焦点的按钮 | null\|string: `ok` `cancel` | `ok` | |
|
|
104
|
+
| cancelText | 取消按钮文字 | string | 取消 | |
|
|
105
|
+
| centered | 垂直居中展示 Modal | Boolean | `false` | |
|
|
106
|
+
| closable | 是否显示右上角的关闭按钮 | boolean | `false` | |
|
|
107
|
+
| class | 容器类名 | string | - | |
|
|
108
|
+
| content | 内容 | string \|vNode \|function(h) | 无 | |
|
|
109
|
+
| icon | 自定义图标(1.14.0 新增) | VNode \| ()=>VNode | - | |
|
|
110
|
+
| mask | 是否展示遮罩 | Boolean | true | |
|
|
111
|
+
| maskClosable | 点击蒙层是否允许关闭 | Boolean | `false` | |
|
|
112
|
+
| keyboard | 是否支持键盘 esc 关闭 | boolean | true | |
|
|
113
|
+
| okText | 确认按钮文字 | string | 确定 | |
|
|
114
|
+
| okType | 确认按钮类型 | string | primary | |
|
|
115
|
+
| okButtonProps | ok 按钮 props | [ButtonProps](/components/button) | - | |
|
|
116
|
+
| cancelButtonProps | cancel 按钮 props | [ButtonProps](/components/button) | - | |
|
|
117
|
+
| title | 标题 | string\|vNode \|function(h) | 无 | |
|
|
118
|
+
| width | 宽度 | string\|number | 416 | |
|
|
119
|
+
| zIndex | 设置 Modal 的 `z-index` | Number | 1000 | |
|
|
120
|
+
| onCancel | 取消回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function | 无 | |
|
|
121
|
+
| onOk | 点击确定回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function | 无 | |
|
|
122
|
+
| appContext | 弹窗的上下文,一般用于获取全局注册组件、vuex 等内容 | - | - | |
|
|
123
|
+
|
|
124
|
+
以上函数调用后,会返回一个引用,可以通过该引用更新和关闭弹窗。
|
|
125
|
+
|
|
126
|
+
```jsx
|
|
127
|
+
const modal = Modal.info();
|
|
128
|
+
|
|
129
|
+
modal.update({
|
|
130
|
+
title: '修改的标题',
|
|
131
|
+
content: '修改的内容',
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
modal.destroy();
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
- `Modal.destroyAll`
|
|
138
|
+
|
|
139
|
+
使用 `Modal.destroyAll()` 可以销毁弹出的确认窗(即上述的 Modal.info、Modal.success、Modal.error、Modal.warning、Modal.confirm)。通常用于路由监听当中,处理路由前进、后退不能销毁确认对话框的问题,而不用各处去使用实例的返回值进行关闭(modal.destroy() 适用于主动关闭,而不是路由这样被动关闭)
|
|
140
|
+
|
|
141
|
+
```jsx
|
|
142
|
+
const router = new VueRouter({ ... })
|
|
143
|
+
|
|
144
|
+
// router change
|
|
145
|
+
router.beforeEach((to, from, next) => {
|
|
146
|
+
Modal.destroyAll();
|
|
147
|
+
})
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## FAQ
|
|
151
|
+
|
|
152
|
+
### 为什么 Modal 方法不能获取 全局注册组件、context、vuex 等内容和 ConfigProvider `locale/prefixCls` 配置, 以及不能响应式更新数据 ?
|
|
153
|
+
|
|
154
|
+
直接调用 Modal 方法,组件会通过 `Vue.render` 动态创建新的 Vue 实体。其 context 与当前代码所在 context 并不相同,因而无法获取 context 信息。
|
|
155
|
+
|
|
156
|
+
当你需要 context 信息(例如使用全局注册的组件)时,可以通过 `appContext` 属性传递当前组件 context, 当你需要保留属性响应式时,你可以使用函数返回:
|
|
157
|
+
|
|
158
|
+
```tsx
|
|
159
|
+
import { getCurrentInstance } from 'vue';
|
|
160
|
+
|
|
161
|
+
const appContext = getCurrentInstance().appContext;
|
|
162
|
+
const title = ref('some message');
|
|
163
|
+
Modal.confirm({
|
|
164
|
+
title: () => title.value, // 此时 title 的改变,会同步更新 confirm 中的 title
|
|
165
|
+
appContext,
|
|
166
|
+
});
|
|
167
|
+
```
|