plain-design 1.0.0-beta.125 → 1.0.0-beta.127

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plain-design",
3
- "version": "1.0.0-beta.125",
3
+ "version": "1.0.0-beta.127",
4
4
  "description": "",
5
5
  "main": "dist/plain-design.min.js",
6
6
  "module": "dist/plain-design.commonjs.min.js",
@@ -40,7 +40,7 @@
40
40
  "react-transition-group": "4.4.5"
41
41
  },
42
42
  "devDependencies": {
43
- "@peryl/react-compose": "0.0.221",
43
+ "@peryl/react-compose": "0.0.223",
44
44
  "@babel/plugin-proposal-optional-chaining": "7.21.0",
45
45
  "@babel/plugin-transform-class-properties": "7.23.3",
46
46
  "@babel/preset-env": "7.23.7",
@@ -55,6 +55,7 @@ export const useTableOptionKeyboard = AutoModule.createRegistration(({ hooks })
55
55
  staticState.clearTableEnterEvent = () => {
56
56
  el.removeEventListener('mouseenter', onEnter);
57
57
  el.removeEventListener('mouseleave', onLeave);
58
+ staticState.clearTableEnterEvent = null;
58
59
  };
59
60
 
60
61
  return staticState.clearTableEnterEvent;
@@ -70,7 +71,10 @@ export const useTableOptionKeyboard = AutoModule.createRegistration(({ hooks })
70
71
  }
71
72
  };
72
73
  document.body.addEventListener('keydown', onKeydown);
73
- staticState.clearTableKeydownEvent = () => {document.body.removeEventListener('keydown', onKeydown);};
74
+ staticState.clearTableKeydownEvent = () => {
75
+ document.body.removeEventListener('keydown', onKeydown);
76
+ staticState.clearTableKeydownEvent = null;
77
+ };
74
78
  return staticState.clearTableKeydownEvent;
75
79
  },
76
80
  };
@@ -83,6 +87,7 @@ export const useTableOptionKeyboard = AutoModule.createRegistration(({ hooks })
83
87
  onBeforeUnmount(() => {
84
88
  staticState.clearTableEnterEvent?.();
85
89
  staticState.clearTableKeydownEvent?.();
90
+ staticState.listeners.splice(0, staticState.listeners.length);
86
91
  });
87
92
 
88
93
  const on = (name: string, handler: (e: KeyboardEvent) => void) => {
@@ -1,4 +1,4 @@
1
- import {computed, designComponent, getComponentCls, mergeAttrs, PropType, reactive, useClasses, watch} from "@peryl/react-compose";
1
+ import {computed, designComponent, Fragment, getComponentCls, mergeAttrs, PropType, reactive, useClasses, watch} from "@peryl/react-compose";
2
2
  import {PlainObject} from "@peryl/utils/event";
3
3
  import {Form} from "../Form";
4
4
  import {FormItem} from "../FormItem";
@@ -95,9 +95,12 @@ export const FilterFormMultiple = designComponent({
95
95
  * @author 韦胜健
96
96
  * @date 2023.1.6 16:00
97
97
  */
98
- const usingFilterOptions = computed(() => (props.filterOptions || []).map(i => (
99
- { ...i, filterHandler: state.filterHandlerMap[FilterService.getHandlerBindKey(i)] }
100
- )));
98
+ const usingFilterOptions = computed(() => {
99
+ // console.warn('run usingFilterOptions');
100
+ return (props.filterOptions || []).map(i => (
101
+ { ...i, filterHandler: state.filterHandlerMap[FilterService.getHandlerBindKey(i)] }
102
+ ));
103
+ });
101
104
 
102
105
  /**
103
106
  * props.filterOptions变化时更新内部状态
@@ -240,7 +243,9 @@ export const FilterFormMultiple = designComponent({
240
243
  <SelectOption label={handler!.label()} val={handler!.name} key={handler!.name}/>
241
244
  ))}
242
245
  </Select>
243
- {handler.render({ formData: state.formData, option: filterOption, confirm: methods.search })}
246
+ <Fragment key={filterOption.filterHandler}>
247
+ {handler.render({ formData: state.formData, option: filterOption, confirm: methods.search })}
248
+ </Fragment>
244
249
  </InputGroup>
245
250
  </FormItem>
246
251
  );
@@ -1,4 +1,4 @@
1
- import {computed, designComponent, PropType, reactive, watch} from "@peryl/react-compose";
1
+ import {computed, designComponent, Fragment, PropType, reactive, watch} from "@peryl/react-compose";
2
2
  import {PlainObject} from "@peryl/utils/event";
3
3
  import {iFilterOption, iFilterQueryParam} from "../FilterService/utils/filter.service.utils";
4
4
  import {InputGroup} from "../InputGroup";
@@ -48,7 +48,10 @@ export const FilterFormSingle = designComponent({
48
48
  }
49
49
  };
50
50
 
51
- const state = reactive(deepcopy(props.initialState) || utils.createState({ filterOptions: props.filterOptions || [] }));
51
+ const state: iFilterFormSingleState = reactive(
52
+ deepcopy(props.initialState) ||
53
+ utils.createState({ filterOptions: props.filterOptions || [] })
54
+ );
52
55
 
53
56
  /**
54
57
  * 正在使用的目标filterOptions
@@ -146,20 +149,22 @@ export const FilterFormSingle = designComponent({
146
149
  <InputGroup style={{ width: props.width }}>
147
150
  {slots.prepend()}
148
151
  {!props.hideFieldSelector && (
149
- <Select width={90} modelValue={state.field} onUpdateModelValue={handler.onUpdateField} inputAttrs={inputAttrs}>
152
+ <Select key="field_selector" width={90} modelValue={state.field} onUpdateModelValue={handler.onUpdateField} inputAttrs={inputAttrs}>
150
153
  {(props.filterOptions || []).map((option) => (
151
154
  <SelectOption label={option.label} val={option.field} key={option.label + option.field}/>
152
155
  ))}
153
156
  </Select>
154
157
  )}
155
158
  {!props.hideHandlerSelector && (
156
- <Select width={90} modelValue={state.filterHandler} onUpdateModelValue={handler.onUpdateHandler} inputAttrs={inputAttrs}>
159
+ <Select key={state.field} width={90} modelValue={state.filterHandler} onUpdateModelValue={handler.onUpdateHandler} inputAttrs={inputAttrs}>
157
160
  {(FilterService.touch(usingFilterOption.value.filterType)).state.list.map((handler) => (
158
161
  <SelectOption label={handler.label()} val={handler.name} key={handler.name}/>
159
162
  ))}
160
163
  </Select>
161
164
  )}
162
- {FilterService.getHandler(usingFilterOption.value)!.render({ formData: state.formData, option: usingFilterOption.value, confirm: methods.search })}
165
+ <Fragment key={state.filterHandler}>
166
+ {FilterService.getHandler(usingFilterOption.value)!.render({ formData: state.formData, option: usingFilterOption.value, confirm: methods.search })}
167
+ </Fragment>
163
168
  {!props.hideSearchButton && (
164
169
  <Button label={i18n.$it('base.query').d('查询')} icon="pi-search" mode="fill" asyncHandler={methods.search}/>
165
170
  )}
@@ -33,5 +33,14 @@
33
33
  border-left-color: transparent;
34
34
  }
35
35
  }
36
+
37
+ &.#{componentName(input)} + .#{componentName(button)} {
38
+ margin-left: -1px;
39
+ }
40
+
41
+ &.#{componentName(button)} + .#{componentName(input)},
42
+ &.#{componentName(button)} + .#{componentName(button)} {
43
+ margin-left: -1px;
44
+ }
36
45
  }
37
46
  }
@@ -1,4 +1,4 @@
1
- import {computed, designComponent, getComponentCls, PropType, reactive, RenderNode, useClasses} from "@peryl/react-compose";
1
+ import {computed, designComponent, getComponentCls, onBeforeUnmount, PropType, reactive, RenderNode, useClasses} from "@peryl/react-compose";
2
2
  import {eTableOperationPosition, iTableOperation, iTableOperationPermitConfig, iTableOuterOperation, iTableOuterOperationConfig, TableOperationDefaultTypeSeq} from "./PlcOperation.utils";
3
3
  import {Button} from "../../../Button";
4
4
  import {ButtonGroup} from "../../../ButtonGroup";
@@ -38,6 +38,7 @@ export const OuterOperation = designComponent({
38
38
  },
39
39
  },
40
40
  });
41
+ onBeforeUnmount(() => {state.dropdown = {} as any;});
41
42
 
42
43
  const permission = (() => {
43
44
  const { permit } = props;
@@ -57,6 +57,7 @@
57
57
  @mixin hover($component) {
58
58
  &:not(.#{$component}-disabled):not(.#{$component}-loading):not(.#{$component}-readonly):not(.#{$component}-focus) {
59
59
  &:hover, &.#{$component}-hover {
60
+ z-index: 2;
60
61
  @content;
61
62
  }
62
63
  }
@@ -99,21 +100,65 @@
99
100
  }
100
101
  @content;
101
102
 
102
- &.mt{margin-top: $margin}
103
- &.mb{margin-bottom: $margin}
104
- &.ml{margin-left: $margin}
105
- &.mr{margin-right: $margin}
106
- &.mx{margin-left: $margin;margin-right: $margin}
107
- &.my{margin-top: $margin;margin-bottom: $margin}
108
- &.margin {margin: $margin}
109
-
110
- &.pt{padding-top: $margin}
111
- &.pb{padding-bottom: $margin}
112
- &.pl{padding-left: $margin}
113
- &.pr{padding-right: $margin}
114
- &.px{padding-left: $margin;padding-right: $margin}
115
- &.py{padding-top: $margin;padding-bottom: $margin}
116
- &.padding {padding: $margin}
103
+ &.mt {
104
+ margin-top: $margin
105
+ }
106
+
107
+ &.mb {
108
+ margin-bottom: $margin
109
+ }
110
+
111
+ &.ml {
112
+ margin-left: $margin
113
+ }
114
+
115
+ &.mr {
116
+ margin-right: $margin
117
+ }
118
+
119
+ &.mx {
120
+ margin-left: $margin;
121
+ margin-right: $margin
122
+ }
123
+
124
+ &.my {
125
+ margin-top: $margin;
126
+ margin-bottom: $margin
127
+ }
128
+
129
+ &.margin {
130
+ margin: $margin
131
+ }
132
+
133
+ &.pt {
134
+ padding-top: $margin
135
+ }
136
+
137
+ &.pb {
138
+ padding-bottom: $margin
139
+ }
140
+
141
+ &.pl {
142
+ padding-left: $margin
143
+ }
144
+
145
+ &.pr {
146
+ padding-right: $margin
147
+ }
148
+
149
+ &.px {
150
+ padding-left: $margin;
151
+ padding-right: $margin
152
+ }
153
+
154
+ &.py {
155
+ padding-top: $margin;
156
+ padding-bottom: $margin
157
+ }
158
+
159
+ &.padding {
160
+ padding: $margin
161
+ }
117
162
  }
118
163
  }
119
164
  }