plain-design 1.0.0-beta.154 → 1.0.0-beta.156
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/dist/plain-design.commonjs.min.js +1 -1
- package/dist/plain-design.min.js +1 -1
- package/dist/report.html +2 -2
- package/package.json +1 -1
- package/src/packages/components/$imageSelector/index.tsx +3 -0
- package/src/packages/components/ImageSelector/index.tsx +8 -2
- package/src/packages/components/PageCard/index.tsx +3 -0
- package/src/packages/components/PageCardContent/index.tsx +3 -0
package/package.json
CHANGED
|
@@ -13,6 +13,7 @@ export const $imageSelector = (
|
|
|
13
13
|
title,
|
|
14
14
|
aspectRatio,
|
|
15
15
|
imageFit,
|
|
16
|
+
imagePosition,
|
|
16
17
|
}: {
|
|
17
18
|
title?: string,
|
|
18
19
|
selectOptions: iImageSelectOption[],
|
|
@@ -21,6 +22,7 @@ export const $imageSelector = (
|
|
|
21
22
|
handleConfirm?: (selectValue: string, selectOption: iImageSelectOption) => void | boolean | Promise<void | boolean>,
|
|
22
23
|
aspectRatio?: string,
|
|
23
24
|
imageFit?: string,
|
|
25
|
+
imagePosition?: string,
|
|
24
26
|
}
|
|
25
27
|
) => {
|
|
26
28
|
const _handleConfirm = async () => {
|
|
@@ -36,6 +38,7 @@ export const $imageSelector = (
|
|
|
36
38
|
width: 800,
|
|
37
39
|
render: () => <ImageSelector
|
|
38
40
|
imageFit={imageFit}
|
|
41
|
+
imagePosition={imagePosition}
|
|
39
42
|
modelValue={selectValue}
|
|
40
43
|
onUpdateModelValue={val => selectValue = val}
|
|
41
44
|
selectOptions={selectOptions}
|
|
@@ -11,7 +11,8 @@ export const ImageSelector = designComponent({
|
|
|
11
11
|
modelValue: { type: [String, Number] },
|
|
12
12
|
selectOptions: { type: Array as PropType<iImageSelectOption[]> },
|
|
13
13
|
aspectRatio: { type: String, default: '3 / 4' },
|
|
14
|
-
imageFit: { type: String, default: 'contain' }
|
|
14
|
+
imageFit: { type: String, default: 'contain' },
|
|
15
|
+
imagePosition: { type: String, default: 'center left' },
|
|
15
16
|
},
|
|
16
17
|
emits: {
|
|
17
18
|
onUpdateModelValue: (val?: string | number | null | undefined) => true,
|
|
@@ -32,7 +33,12 @@ export const ImageSelector = designComponent({
|
|
|
32
33
|
onClick={() => {model.value = item.val;}}
|
|
33
34
|
onDoubleClick={emit.onDoubleClickOption}
|
|
34
35
|
>
|
|
35
|
-
<Image
|
|
36
|
+
<Image
|
|
37
|
+
src={item.url}
|
|
38
|
+
previewOnClick={false}
|
|
39
|
+
fit={props.imageFit as any}
|
|
40
|
+
position={props.imagePosition}
|
|
41
|
+
/>
|
|
36
42
|
<div className="image-select-option-checked">
|
|
37
43
|
<Icon icon="pi-check"/>
|
|
38
44
|
</div>
|
|
@@ -2,6 +2,7 @@ import {designComponent, getComponentCls, useClassCache, useModel} from "@peryl/
|
|
|
2
2
|
import {StyleProps, useStyle} from "../../uses/useStyle";
|
|
3
3
|
import {Box} from "../Box";
|
|
4
4
|
import './page-card.scss';
|
|
5
|
+
import {EditProps, useEdit} from "../../uses/useEdit";
|
|
5
6
|
|
|
6
7
|
export const PageCard = designComponent({
|
|
7
8
|
name: 'page-card',
|
|
@@ -12,6 +13,7 @@ export const PageCard = designComponent({
|
|
|
12
13
|
collapsable: { type: Boolean },
|
|
13
14
|
full: { type: Boolean },
|
|
14
15
|
...StyleProps,
|
|
16
|
+
...EditProps,
|
|
15
17
|
},
|
|
16
18
|
slots: ['default'],
|
|
17
19
|
emits: {
|
|
@@ -22,6 +24,7 @@ export const PageCard = designComponent({
|
|
|
22
24
|
const model = useModel(() => props.modelValue, emit.onUpdateModelValue);
|
|
23
25
|
|
|
24
26
|
const { styleComputed } = useStyle();
|
|
27
|
+
useEdit();
|
|
25
28
|
|
|
26
29
|
const classes = useClassCache(() => [
|
|
27
30
|
getComponentCls('page-card'),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {designComponent, getComponentCls, PropType, useClassCache} from "@peryl/react-compose";
|
|
2
2
|
import {StyleProps, useStyle} from "../../uses/useStyle";
|
|
3
3
|
import PageCard from "../PageCard";
|
|
4
|
+
import {EditProps, useEdit} from "../../uses/useEdit";
|
|
4
5
|
|
|
5
6
|
export const PageCardContent = designComponent({
|
|
6
7
|
name: 'page-card-content',
|
|
@@ -9,6 +10,7 @@ export const PageCardContent = designComponent({
|
|
|
9
10
|
full: { type: Boolean },
|
|
10
11
|
noPadding: { type: Boolean },
|
|
11
12
|
...StyleProps,
|
|
13
|
+
...EditProps,
|
|
12
14
|
},
|
|
13
15
|
slots: ['default'],
|
|
14
16
|
setup({ props, slots }) {
|
|
@@ -16,6 +18,7 @@ export const PageCardContent = designComponent({
|
|
|
16
18
|
const pageCard = PageCard.use.inject();
|
|
17
19
|
|
|
18
20
|
const { styleComputed } = useStyle();
|
|
21
|
+
useEdit();
|
|
19
22
|
|
|
20
23
|
const classes = useClassCache(() => [
|
|
21
24
|
getComponentCls('page-card-content'),
|