@nocobase/client-v2 2.2.28 → 2.2.30

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": "@nocobase/client-v2",
3
- "version": "2.2.28",
3
+ "version": "2.2.30",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.mjs",
@@ -27,11 +27,11 @@
27
27
  "@formily/antd-v5": "1.2.3",
28
28
  "@formily/react": "^2.2.27",
29
29
  "@formily/shared": "^2.2.27",
30
- "@nocobase/evaluators": "2.2.28",
31
- "@nocobase/flow-engine": "2.2.28",
32
- "@nocobase/sdk": "2.2.28",
33
- "@nocobase/shared": "2.2.28",
34
- "@nocobase/utils": "2.2.28",
30
+ "@nocobase/evaluators": "2.2.30",
31
+ "@nocobase/flow-engine": "2.2.30",
32
+ "@nocobase/sdk": "2.2.30",
33
+ "@nocobase/shared": "2.2.30",
34
+ "@nocobase/utils": "2.2.30",
35
35
  "ahooks": "^3.7.2",
36
36
  "antd": "5.24.2",
37
37
  "antd-style": "3.7.1",
@@ -49,5 +49,5 @@
49
49
  "react-router-dom": "^6.30.1",
50
50
  "zxing-wasm": "^3.1.3"
51
51
  },
52
- "gitHead": "10c2e583e426fc6f7b8918a817febad6354190b6"
52
+ "gitHead": "7042ebef45742005aa38cd78c366e3e7f4ffed52"
53
53
  }
@@ -58,7 +58,7 @@ export class InputFieldModel extends FieldModel {
58
58
  return <ScanInput {...this.props} />;
59
59
  }
60
60
  const { enableScan, disableManualInput, ...inputProps } = this.props;
61
- return <IMESafeInput {...inputProps} />;
61
+ return <IMESafeInput {...inputProps} style={{ verticalAlign: 'top', ...inputProps.style }} />;
62
62
  }
63
63
  }
64
64
 
@@ -27,6 +27,22 @@ function createInputFieldModel(props?: Record<string, unknown>) {
27
27
  }
28
28
 
29
29
  describe('InputFieldModel', () => {
30
+ it('aligns plain inputs with the top of other filter form controls', () => {
31
+ const model = createInputFieldModel();
32
+
33
+ render(<>{model.render()}</>);
34
+
35
+ expect(screen.getByRole('textbox')).toHaveStyle({ verticalAlign: 'top' });
36
+ });
37
+
38
+ it('preserves explicitly configured input styles', () => {
39
+ const model = createInputFieldModel({ style: { verticalAlign: 'middle', width: 200 } });
40
+
41
+ render(<>{model.render()}</>);
42
+
43
+ expect(screen.getByRole('textbox')).toHaveStyle({ verticalAlign: 'middle', width: '200px' });
44
+ });
45
+
30
46
  it('renders the normal input when scan input is disabled', () => {
31
47
  const consoleError = vi.spyOn(console, 'error').mockImplementation(() => undefined);
32
48
  const model = createInputFieldModel({ disableManualInput: true, enableScan: false });
@@ -263,6 +263,7 @@ export function MobileLazySelect(props: Readonly<LazySelectProps>) {
263
263
  <>
264
264
  <Select
265
265
  {...restProps}
266
+ disabled={disabled}
266
267
  dropdownStyle={buildDropdownStyle(dropdownStyle)}
267
268
  fieldNames={fieldNames}
268
269
  options={realOptions}
@@ -388,6 +388,26 @@ describe('MobileLazySelect', () => {
388
388
  resetMockState();
389
389
  });
390
390
 
391
+ it.each([false, true])('updates the disabled trigger state in %s multiple mode', (multiple) => {
392
+ const onDropdownVisibleChange = vi.fn();
393
+ const { rerender } = renderMobileLazySelect({ multiple, onDropdownVisibleChange });
394
+
395
+ rerender({ disabled: true });
396
+
397
+ expect(mockState.selectProps?.disabled).toBe(true);
398
+ act(() => {
399
+ mockState.selectProps?.onClick?.();
400
+ });
401
+ expect(screen.queryByTestId('popup')).not.toBeInTheDocument();
402
+ expect(onDropdownVisibleChange).not.toHaveBeenCalled();
403
+
404
+ rerender({ disabled: false });
405
+
406
+ expect(mockState.selectProps?.disabled).toBe(false);
407
+ openLazyPopup();
408
+ expect(onDropdownVisibleChange).toHaveBeenCalledWith(true);
409
+ });
410
+
391
411
  it('renders a translated cancel action after searching', () => {
392
412
  renderMobileLazySelect();
393
413