plain-design 1.0.0-beta.92 → 1.0.0-beta.94
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/plain-design.commonjs.min.js +2 -2
- package/dist/plain-design.min.css +5 -4
- package/dist/plain-design.min.js +2 -2
- package/dist/report.html +2 -2
- package/package.json +1 -1
- package/src/packages/components/Button/button.scss +1 -1
- package/src/packages/components/ConfirmPopup/confirm-popup.scss +16 -0
- package/src/packages/components/ConfirmPopup/index.tsx +72 -0
- package/src/packages/components/FilterFormMultiple/index.tsx +3 -2
- package/src/packages/components/Form/form.scss +3 -0
- package/src/packages/components/Form/layout/useFormLayout.tsx +2 -2
- package/src/packages/components/usePopup/popup-item.scss +1 -1
- package/src/packages/entry.tsx +1 -0
package/package.json
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
@include comp(confirm-popup) {
|
2
|
+
.popup-content {
|
3
|
+
.popper-head {
|
4
|
+
color: plv(text-1);
|
5
|
+
text-align: center;
|
6
|
+
padding: 1em 1.25em 0;
|
7
|
+
}
|
8
|
+
|
9
|
+
.confirm-popup-button-bar {
|
10
|
+
display: flex;
|
11
|
+
align-items: center;
|
12
|
+
justify-content: flex-end;
|
13
|
+
padding: 1em 1.25em;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
import {designComponent, getComponentCls, PropType, useModel} from "plain-design-composition";
|
2
|
+
import Popup from "../Popup";
|
3
|
+
import Space from "../Space";
|
4
|
+
import Button from "../Button";
|
5
|
+
import i18n from "../i18n";
|
6
|
+
import './confirm-popup.scss';
|
7
|
+
import {ePopupTrigger, iPopupTrigger} from "../usePopup/utils/popup.utils";
|
8
|
+
|
9
|
+
export const ConfirmPopup = designComponent({
|
10
|
+
name: 'confirm-popup',
|
11
|
+
inheritPropsType: Popup,
|
12
|
+
props: {
|
13
|
+
title: { type: String },
|
14
|
+
trigger: { type: String as PropType<iPopupTrigger>, default: ePopupTrigger.click },
|
15
|
+
confirmLabel: { type: String },
|
16
|
+
cancelLabel: { type: String },
|
17
|
+
modelValue: { type: Boolean },
|
18
|
+
},
|
19
|
+
emits: {
|
20
|
+
onConfirm: () => true,
|
21
|
+
onCancel: () => true,
|
22
|
+
onUpdateModelValue: (val: boolean) => true,
|
23
|
+
},
|
24
|
+
slots: ['default'],
|
25
|
+
setup({ props, slots, attrs, event: { emit } }) {
|
26
|
+
|
27
|
+
const model = useModel(() => props.modelValue, emit.onUpdateModelValue);
|
28
|
+
|
29
|
+
const handler = {
|
30
|
+
onConfirm: () => {
|
31
|
+
model.value = false;
|
32
|
+
emit.onConfirm();
|
33
|
+
},
|
34
|
+
onCancel: () => {
|
35
|
+
model.value = false;
|
36
|
+
emit.onCancel();
|
37
|
+
},
|
38
|
+
};
|
39
|
+
|
40
|
+
return () => {
|
41
|
+
const hasTitle = !!props.title;
|
42
|
+
return (
|
43
|
+
<Popup
|
44
|
+
title={props.title}
|
45
|
+
placement={attrs.placement || (hasTitle ? 'bottom-end' : 'bottom-center')}
|
46
|
+
popperClass={getComponentCls('confirm-popup')}
|
47
|
+
v-model={model.value}
|
48
|
+
trigger={props.trigger}
|
49
|
+
noPadding
|
50
|
+
v-slots={{
|
51
|
+
default: () => slots.default(),
|
52
|
+
popper: () => (
|
53
|
+
hasTitle ? (
|
54
|
+
<Space className="confirm-popup-button-bar" size="mini">
|
55
|
+
<Button mode="fill" status="primary" label={props.confirmLabel || i18n.$it('base.confirm').d('确定')} onClick={handler.onConfirm}/>
|
56
|
+
<Button mode="stroke" status="secondary" label={props.cancelLabel || i18n.$it('base.cancel').d('取消')} onClick={handler.onCancel}/>
|
57
|
+
</Space>
|
58
|
+
) : (
|
59
|
+
<Space className="confirm-popup-button-bar">
|
60
|
+
<Button mode="text" status="primary" icon="pi-check" label={props.confirmLabel || i18n.$it('base.confirm').d('确定')} onClick={handler.onConfirm}/>
|
61
|
+
<Button mode="text" status="error" icon="pi-close" label={props.cancelLabel || i18n.$it('base.cancel').d('取消')} onClick={handler.onCancel}/>
|
62
|
+
</Space>
|
63
|
+
)
|
64
|
+
)
|
65
|
+
}}
|
66
|
+
/>
|
67
|
+
);
|
68
|
+
};
|
69
|
+
},
|
70
|
+
});
|
71
|
+
|
72
|
+
export default ConfirmPopup;
|
@@ -178,7 +178,6 @@ export const FilterFormMultiple = designComponent({
|
|
178
178
|
const formAttrs = computed(() => {
|
179
179
|
return {
|
180
180
|
column: props.column,
|
181
|
-
labelAlign: 'right' as const,
|
182
181
|
labelWidth: 100,
|
183
182
|
...props.formAttrs,
|
184
183
|
};
|
@@ -222,7 +221,9 @@ export const FilterFormMultiple = designComponent({
|
|
222
221
|
return (
|
223
222
|
<FormItem
|
224
223
|
class={isFirstColumn ? 'filter-form-multiple-first-column' : undefined}
|
225
|
-
|
224
|
+
labelAlign={isFirstColumn ? 'left' : 'right'}
|
225
|
+
key={key}
|
226
|
+
label={label}
|
226
227
|
column={column}
|
227
228
|
>
|
228
229
|
<InputGroup>
|
@@ -119,7 +119,7 @@ export const useFormLayout = (() => {
|
|
119
119
|
if (!!props.validateMessagePosition) {return props.validateMessagePosition;}
|
120
120
|
|
121
121
|
/*纵向文本的情况下,校验消息默认放在左下角*/
|
122
|
-
if (props.verticalLabel) {return FormValidateMessagePosition["bottom-
|
122
|
+
if (props.verticalLabel) {return FormValidateMessagePosition["bottom-right"];}
|
123
123
|
if (isSingleColumn.value) {
|
124
124
|
/*单列的情况下,校验消息默认放在右侧*/
|
125
125
|
return FormValidateMessagePosition['right'];
|
@@ -204,7 +204,7 @@ export const useFormLayout = (() => {
|
|
204
204
|
* @author 韦胜健
|
205
205
|
* @date 2022.9.4 23:22
|
206
206
|
*/
|
207
|
-
const labelAlign = computed(() => props.
|
207
|
+
const labelAlign = computed(() => form.props.verticalLabel ? eFormLabelAlign.left : (props.labelAlign || form.props.labelAlign));
|
208
208
|
|
209
209
|
/**
|
210
210
|
* 内容对其方式
|
package/src/packages/entry.tsx
CHANGED
@@ -89,6 +89,7 @@ export type {FileServiceChooseFileConfig, FileServiceSingleFile, FileServiceUplo
|
|
89
89
|
export {CascadePanel} from './components/CascadePanel';
|
90
90
|
export {usePopup} from './components/usePopup';
|
91
91
|
export {Popup} from './components/Popup';
|
92
|
+
export {ConfirmPopup} from './components/ConfirmPopup';
|
92
93
|
export {createPopup} from './components/createPopup';
|
93
94
|
export type {
|
94
95
|
iPopupAlign,
|