plain-design 1.0.0-beta.17 → 1.0.0-beta.19
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.css +1 -1
- package/dist/plain-design.min.js +1 -1
- package/dist/report.html +2 -2
- package/package.json +2 -2
- package/src/packages/components/AutoTable/use/useTableOption.methods.tsx +2 -0
- package/src/packages/components/AutoTable/use/useTableOption.state.tsx +1 -0
- package/src/packages/components/AutoTable/utils/TableOption.space.tsx +1 -0
- package/src/packages/components/Tree/RenderTreeNode.tsx +2 -0
- package/src/packages/components/Tree/tree.scss +8 -1
- package/src/packages/components/TreeCore/createTreeProps.ts +1 -1
- package/src/packages/components/TreeNodeWithMenu/index.tsx +1 -1
- package/src/packages/components/useDialog/DialogService.tsx +13 -1
- package/src/packages/uses/useEdit.ts +4 -0
- package/src/packages/uses/useStyle.tsx +9 -1
- package/src/pages/index/components/AutoTable/AutoHeightAutoRow.tsx +10 -5
- package/src/pages/index/components/service/DemoDialogService.tsx +1 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "plain-design",
|
3
|
-
"version": "1.0.0-beta.
|
3
|
+
"version": "1.0.0-beta.19",
|
4
4
|
"description": "",
|
5
5
|
"main": "dist/plain-design.min.js",
|
6
6
|
"module": "dist/plain-design.commonjs.min.js",
|
@@ -68,7 +68,7 @@
|
|
68
68
|
"fork-ts-checker-webpack-plugin": "^6.2.4",
|
69
69
|
"mini-css-extract-plugin": "^1.4.1",
|
70
70
|
"mockjs": "^1.1.0",
|
71
|
-
"plain-design-composition": "^0.0.
|
71
|
+
"plain-design-composition": "^0.0.170-beta.1",
|
72
72
|
"postcss": "^8.2.13",
|
73
73
|
"postcss-loader": "^4.2.0",
|
74
74
|
"qs": "^6.10.1",
|
@@ -161,6 +161,7 @@ export const useTableOptionMethods = AutoModule.createRegistration((
|
|
161
161
|
}
|
162
162
|
};
|
163
163
|
const reload = async (reloadParam?: { size?: number }) => {
|
164
|
+
if (!state.isInit) {state.isInit = true;}
|
164
165
|
await load({
|
165
166
|
page: 1,
|
166
167
|
size: reloadParam?.size,
|
@@ -488,6 +489,7 @@ export const useTableOptionMethods = AutoModule.createRegistration((
|
|
488
489
|
})();
|
489
490
|
|
490
491
|
hooks.onTableSetup.use(() => {
|
492
|
+
if (state.isInit) {return;}
|
491
493
|
if (config.loadOnStart !== false) {pageMethods.reload();}
|
492
494
|
});
|
493
495
|
|
@@ -14,6 +14,7 @@ declare module '../utils/TableOption.space' {
|
|
14
14
|
|
15
15
|
export const useTableOptionState = AutoModule.createRegistration(({ config, hooks }) => {
|
16
16
|
const state: TableOptionSpace.iTableOptionState = reactive({
|
17
|
+
isInit: false,
|
17
18
|
getTable: () => null,
|
18
19
|
getAutoTable: () => null,
|
19
20
|
list: [],
|
@@ -34,6 +34,7 @@ export const RenderTreeNode = designComponent({
|
|
34
34
|
getComponentCls('tree-node'),
|
35
35
|
{
|
36
36
|
'tree-node-current': tree.state.current === props.treeNode.key,
|
37
|
+
'tree-node-lead': isLeaf.value,
|
37
38
|
'tree-node-single-check': !props.multiple && props.treeNode.checkStatus() === CheckboxStatus.check,
|
38
39
|
'tree-node-multi-check': props.multiple && props.treeNode.checkStatus() === CheckboxStatus.check,
|
39
40
|
'tree-node-disable-check': !props.treeNode.isCheckAble(),
|
@@ -42,6 +43,7 @@ export const RenderTreeNode = designComponent({
|
|
42
43
|
|
43
44
|
const checkStatus = cacheComputed(() => props.treeNode.checkStatus());
|
44
45
|
const isExpanded = cacheComputed(() => props.treeNode.isExpanded());
|
46
|
+
const isLeaf = cacheComputed(() => props.treeNode.isLeaf());
|
45
47
|
|
46
48
|
const connectorClassesList = computed(() => {
|
47
49
|
|
@@ -193,9 +193,16 @@
|
|
193
193
|
}
|
194
194
|
|
195
195
|
&.tree-expander-cover {
|
196
|
+
@include comp(tree-node) {
|
197
|
+
&:not(.tree-node-lead) {
|
198
|
+
.tree-node-expander {
|
199
|
+
background-color: plv(secondary-2);
|
200
|
+
}
|
201
|
+
}
|
202
|
+
}
|
203
|
+
|
196
204
|
.tree-node-expander {
|
197
205
|
border-radius: 2px;
|
198
|
-
background-color: plv(secondary-2);
|
199
206
|
transform: scale(0.75);
|
200
207
|
}
|
201
208
|
}
|
@@ -32,7 +32,7 @@ export const TreePropsOptions = {
|
|
32
32
|
customDraggier: { type: Boolean as PropType<iTreeProps["customDraggier"]> },
|
33
33
|
isAllowDraggable: { type: Function as PropType<iTreeProps["isAllowDraggable"]> },
|
34
34
|
isAllowDroppable: { type: Function as PropType<iTreeProps["isAllowDroppable"]> },
|
35
|
-
leafIcon: { type: String as PropType<iTreeProps["leafIcon"]>, default: 'pi-file' as string },
|
35
|
+
leafIcon: { type: String as PropType<iTreeProps["leafIcon"]>, default: 'pi-drive-file' as string },
|
36
36
|
folderCollapseIcon: { type: String as PropType<iTreeProps["folderCollapseIcon"]>, default: 'pi-caret-right' as string },
|
37
37
|
folderExpandIcon: { type: String as PropType<iTreeProps["folderExpandIcon"]>, default: 'pi-down' as string },
|
38
38
|
expanderCover: { type: Boolean as PropType<iTreeProps["expanderCover"]>, default: true },
|
@@ -69,7 +69,7 @@ export const TreeNodeWithMenu = designComponent({
|
|
69
69
|
v-slots={{
|
70
70
|
default: () => btn,
|
71
71
|
popper: () => (
|
72
|
-
props.dropdownOptions
|
72
|
+
props.dropdownOptions?.map((option, index) => {
|
73
73
|
const { renderDefault, renderContent, ...leftOption } = option;
|
74
74
|
const vSlots = {} as any;
|
75
75
|
if (!!renderDefault) {vSlots.default = () => renderDefault();}
|
@@ -10,6 +10,7 @@ import Icon from "../Icon";
|
|
10
10
|
import {ThemeStatusIcons} from "../Application/theme/theme.utils";
|
11
11
|
import Input from "../Input";
|
12
12
|
import InputNumber from "../InputNumber";
|
13
|
+
import $message from "../$message";
|
13
14
|
|
14
15
|
/**
|
15
16
|
* 弹框服务单个组件
|
@@ -133,7 +134,15 @@ export const DialogService = createApplicationServiceComponent<iDialogServiceOpt
|
|
133
134
|
const dialogProps = { ...targetOption.value.dialogProps };
|
134
135
|
|
135
136
|
/*wrap handleConfirm*/
|
136
|
-
dialogProps.handleConfirm = async (close: () => void) =>
|
137
|
+
dialogProps.handleConfirm = async (close: () => void) => {
|
138
|
+
if (!!targetOption.value.customOption.editRequired) {
|
139
|
+
if (state.editValue == null || !state.editValue.trim().length) {
|
140
|
+
$message.warn('不能为空!');
|
141
|
+
return false;
|
142
|
+
}
|
143
|
+
}
|
144
|
+
return targetOption.value.customOption.handleConfirm?.({ close, editValue: state.editValue });
|
145
|
+
};
|
137
146
|
|
138
147
|
/*wrap onClose*/
|
139
148
|
dialogProps.onClose = () => onClose.exec(undefined);
|
@@ -165,6 +174,7 @@ export const DialogService = createApplicationServiceComponent<iDialogServiceOpt
|
|
165
174
|
v-model={state.editValue}
|
166
175
|
readonly={option.editReadonly}
|
167
176
|
onEnter={onEnter}
|
177
|
+
status={option.editRequired ? 'warn' : undefined}
|
168
178
|
/>
|
169
179
|
);
|
170
180
|
break;
|
@@ -176,6 +186,7 @@ export const DialogService = createApplicationServiceComponent<iDialogServiceOpt
|
|
176
186
|
v-model={state.editValue}
|
177
187
|
readonly={option.editReadonly}
|
178
188
|
onEnter={onEnter}
|
189
|
+
status={option.editRequired ? 'warn' : undefined}
|
179
190
|
/>
|
180
191
|
);
|
181
192
|
break;
|
@@ -189,6 +200,7 @@ export const DialogService = createApplicationServiceComponent<iDialogServiceOpt
|
|
189
200
|
v-model={state.editValue}
|
190
201
|
readonly={option.editReadonly}
|
191
202
|
onEnter={onEnter}
|
203
|
+
status={option.editRequired ? 'warn' : undefined}
|
192
204
|
/>
|
193
205
|
);
|
194
206
|
break;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {computed, inject, PropType, provide} from "plain-design-composition";
|
1
|
+
import {computed, inject, onBeforeUnmount, PropType, provide} from "plain-design-composition";
|
2
2
|
import {useFunctionWrapper} from "./useFunctionWrapper";
|
3
3
|
import {createEnum} from "plain-utils/utils/createEnum";
|
4
4
|
import {ApplicationConfigurationProvider} from "../components/Application/utils/application.utils";
|
@@ -62,6 +62,14 @@ export const useStyle = useFunctionWrapper('style', (ctx, option: UseStyleOption
|
|
62
62
|
|
63
63
|
provide(USE_STYLE_PROVIDER, styleComputed);
|
64
64
|
|
65
|
+
onBeforeUnmount(() => {
|
66
|
+
setTimeout(() => {
|
67
|
+
(styleComputed.value as any).ctx = null;
|
68
|
+
(styleComputed.value as any).parent = null;
|
69
|
+
styleComputed.effect.stop();
|
70
|
+
});
|
71
|
+
});
|
72
|
+
|
65
73
|
return { styleComputed };
|
66
74
|
});
|
67
75
|
|
@@ -1,14 +1,19 @@
|
|
1
1
|
import {designPage} from "plain-design-composition";
|
2
2
|
import {useTableOption} from "../../../module/useTableOption";
|
3
3
|
import {AutoTable, Plc, PlcDate, PlcInput, PlcNumber, PlcSelect, SelectOption} from "../../../../packages";
|
4
|
+
import TableOptionSpace from "../../../../packages/components/TableOptionSpace";
|
5
|
+
|
6
|
+
let option: TableOptionSpace.iTableOption;
|
4
7
|
|
5
8
|
export const demo1 = designPage(() => {
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
10
|
+
if (!option) {
|
11
|
+
option = useTableOption({
|
12
|
+
url: '/demo',
|
13
|
+
showRowsMode: 'auto',
|
14
|
+
fill: true,
|
15
|
+
});
|
16
|
+
}
|
12
17
|
|
13
18
|
|
14
19
|
const onClick = () => {
|
@@ -195,6 +195,7 @@ export const demoInput = designPage(() => {
|
|
195
195
|
<Button label={'input'} onClick={() => $dialog({
|
196
196
|
editType: 'input',
|
197
197
|
editValue: inputValue,
|
198
|
+
editRequired: true,
|
198
199
|
handleConfirm: ({ editValue }) => {
|
199
200
|
inputValue = editValue;
|
200
201
|
$message(String(editValue));
|