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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plain-design",
3
- "version": "1.0.0-beta.92",
3
+ "version": "1.0.0-beta.94",
4
4
  "description": "",
5
5
  "main": "dist/plain-design.min.js",
6
6
  "module": "dist/plain-design.commonjs.min.js",
@@ -172,7 +172,7 @@
172
172
  .#{componentName(icon)}, .#{componentName(loading)} {
173
173
  //vertical-align: text-top;
174
174
  position: relative;
175
- top: 1px;
175
+ top: 0.15em;
176
176
  }
177
177
 
178
178
  //&:not(.button-icon-only) {
@@ -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
- key={key} label={label}
224
+ labelAlign={isFirstColumn ? 'left' : 'right'}
225
+ key={key}
226
+ label={label}
226
227
  column={column}
227
228
  >
228
229
  <InputGroup>
@@ -204,6 +204,9 @@
204
204
 
205
205
  &.form-vertical-label {
206
206
  @include prefix(form-item) {
207
+ .form-item-label {
208
+ display: block;
209
+ }
207
210
  .form-item-label, .form-item-content {
208
211
  width: 100%;
209
212
  }
@@ -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-left"];}
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.labelAlign || form.props.labelAlign || (form.props.verticalLabel ? eFormLabelAlign.left : eFormLabelAlign.right));
207
+ const labelAlign = computed(() => form.props.verticalLabel ? eFormLabelAlign.left : (props.labelAlign || form.props.labelAlign));
208
208
 
209
209
  /**
210
210
  * 内容对其方式
@@ -105,7 +105,7 @@
105
105
  }
106
106
 
107
107
  &.popup-item-dark-app {
108
- filter: drop-shadow(0 0 0.5px plv(secondary-6));
108
+ filter: drop-shadow(0 0 16px var(--custom-bg-1));
109
109
  }
110
110
 
111
111
  &.popup-item-no-background {
@@ -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,