@aloudata/aloudata-design 2.13.3 → 2.13.4
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/Form/index.d.ts +4 -3
- package/dist/Form/index.js +2 -2
- package/dist/IconButton/style/index.less +4 -0
- package/dist/MemberPicker/components/SelectedMemberTags.js +1 -4
- package/dist/MemberPicker/style/index.less +5 -2
- package/dist/MemberPicker/tests/mockPort.js +1 -1
- package/dist/Switch/index.js +1 -2
- package/dist/Switch/test/index.d.ts +1 -0
- package/dist/Switch/test/index.js +43 -0
- package/dist/ald.min.css +1 -1
- package/package.json +1 -1
package/dist/Form/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FormProvider } from 'antd/lib/form/context';
|
|
2
1
|
import ErrorList, { type ErrorListProps } from 'antd/lib/form/ErrorList';
|
|
3
2
|
import { useForm, useWatch, type FormInstance, type FormProps } from 'antd/lib/form/Form';
|
|
4
3
|
import { type FormItemProps } from 'antd/lib/form/FormItem';
|
|
5
4
|
import List, { type FormListFieldData, type FormListOperation, type FormListProps } from 'antd/lib/form/FormList';
|
|
5
|
+
import { FormProvider } from 'antd/lib/form/context';
|
|
6
6
|
import useFormInstance from 'antd/lib/form/hooks/useFormInstance';
|
|
7
7
|
import type { Rule, RuleObject, RuleRender } from 'rc-field-form/lib/interface';
|
|
8
8
|
import React from 'react';
|
|
@@ -18,14 +18,15 @@ interface IFormItemProps extends FormItemProps {
|
|
|
18
18
|
declare const AldFormItem: {
|
|
19
19
|
(props: IFormItemProps): React.JSX.Element;
|
|
20
20
|
useStatus: () => {
|
|
21
|
-
status?: "" | "success" | "
|
|
21
|
+
status?: "" | "success" | "warning" | "error" | "validating" | undefined;
|
|
22
22
|
errors: React.ReactNode[];
|
|
23
23
|
warnings: React.ReactNode[];
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
type InternalFormType = typeof AldForm;
|
|
27
|
+
type OriginUseFormType<T> = typeof useForm<T>;
|
|
27
28
|
type CompoundedComponent = InternalFormType & {
|
|
28
|
-
useForm:
|
|
29
|
+
useForm: <T>(...args: [...Parameters<OriginUseFormType<T>>, string?]) => ReturnType<OriginUseFormType<T>>;
|
|
29
30
|
useFormInstance: typeof useFormInstance;
|
|
30
31
|
useWatch: typeof useWatch;
|
|
31
32
|
Item: typeof AldFormItem;
|
package/dist/Form/index.js
CHANGED
|
@@ -9,13 +9,13 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
9
9
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
10
10
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
11
11
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
12
|
-
import
|
|
12
|
+
import warning from 'antd/lib/_util/warning';
|
|
13
13
|
import ErrorList from 'antd/lib/form/ErrorList';
|
|
14
14
|
import InternalForm, { useForm, useWatch } from 'antd/lib/form/Form';
|
|
15
15
|
import Item from 'antd/lib/form/FormItem';
|
|
16
16
|
import List from 'antd/lib/form/FormList';
|
|
17
|
+
import { FormProvider } from 'antd/lib/form/context';
|
|
17
18
|
import useFormInstance from 'antd/lib/form/hooks/useFormInstance';
|
|
18
|
-
import warning from 'antd/lib/_util/warning';
|
|
19
19
|
import React, { forwardRef } from 'react';
|
|
20
20
|
import SizeContext, { SizeContextProvider } from "../ConfigProvider/sizeContext";
|
|
21
21
|
var AldForm = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
@@ -22,10 +22,7 @@ export default function SelectedMemberTags(props) {
|
|
|
22
22
|
}, /*#__PURE__*/React.createElement("div", {
|
|
23
23
|
className: 'ald-member-picker-has-selected'
|
|
24
24
|
}, t.MemberPicker.selectedTotal(selectedUsers.length)), /*#__PURE__*/React.createElement(ScrollArea, {
|
|
25
|
-
|
|
26
|
-
maxHeight: 'calc(100% - 20px)',
|
|
27
|
-
overflow: 'hidden'
|
|
28
|
-
}
|
|
25
|
+
className: 'ald-member-selected-member-wrapper'
|
|
29
26
|
}, /*#__PURE__*/React.createElement("div", {
|
|
30
27
|
className: 'ald-member-picker-tags',
|
|
31
28
|
style: {
|
|
@@ -81,8 +81,7 @@
|
|
|
81
81
|
|
|
82
82
|
.ald-member-picker-selected-member-tags-wrap {
|
|
83
83
|
width: 50%;
|
|
84
|
-
height:
|
|
85
|
-
max-height: 320px;
|
|
84
|
+
max-height: 377px;
|
|
86
85
|
padding: 8px;
|
|
87
86
|
|
|
88
87
|
.ald-member-picker-has-selected {
|
|
@@ -354,3 +353,7 @@
|
|
|
354
353
|
align-items: center;
|
|
355
354
|
gap: var(--alias-spacing-75, 6px);
|
|
356
355
|
}
|
|
356
|
+
|
|
357
|
+
.ald-member-selected-member-wrapper {
|
|
358
|
+
height: calc(100% - 24px);
|
|
359
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { EUserType } from "../../ConfigProvider/getUserList";
|
|
3
3
|
export function genUserListByKeywords(keywords) {
|
|
4
4
|
var userList = [];
|
|
5
|
-
for (var i = 0; i <
|
|
5
|
+
for (var i = 0; i < 20; i++) {
|
|
6
6
|
var user = {
|
|
7
7
|
type: EUserType.USER,
|
|
8
8
|
userId: "user".concat(i),
|
package/dist/Switch/index.js
CHANGED
|
@@ -19,8 +19,7 @@ var Switch = function Switch(_ref) {
|
|
|
19
19
|
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
20
20
|
customSize = _ref.size,
|
|
21
21
|
checked = _ref.checked,
|
|
22
|
-
|
|
23
|
-
defaultChecked = _ref$defaultChecked === void 0 ? false : _ref$defaultChecked,
|
|
22
|
+
defaultChecked = _ref.defaultChecked,
|
|
24
23
|
onChange = _ref.onChange,
|
|
25
24
|
onClick = _ref.onClick,
|
|
26
25
|
children = _ref.children;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Switch from '..';
|
|
4
|
+
describe('switch defaultChecked undefined', function () {
|
|
5
|
+
var container;
|
|
6
|
+
var renderResult = render( /*#__PURE__*/React.createElement("div", {
|
|
7
|
+
style: {
|
|
8
|
+
width: 600
|
|
9
|
+
}
|
|
10
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
11
|
+
checked: true
|
|
12
|
+
})));
|
|
13
|
+
container = renderResult.container;
|
|
14
|
+
var hasChecked = container.querySelector('.ant-switch-checked');
|
|
15
|
+
expect(hasChecked).not.toBeNull();
|
|
16
|
+
});
|
|
17
|
+
describe('switch defaultChecked false1', function () {
|
|
18
|
+
var container;
|
|
19
|
+
var renderResult = render( /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
style: {
|
|
21
|
+
width: 600
|
|
22
|
+
}
|
|
23
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
24
|
+
checked: true,
|
|
25
|
+
defaultChecked: false
|
|
26
|
+
})));
|
|
27
|
+
container = renderResult.container;
|
|
28
|
+
var hasChecked = container.querySelector('.ant-switch-checked');
|
|
29
|
+
expect(hasChecked).toBeNull();
|
|
30
|
+
});
|
|
31
|
+
describe('switch defaultChecked false2', function () {
|
|
32
|
+
var container;
|
|
33
|
+
var renderResult = render( /*#__PURE__*/React.createElement("div", {
|
|
34
|
+
style: {
|
|
35
|
+
width: 600
|
|
36
|
+
}
|
|
37
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
38
|
+
defaultChecked: false
|
|
39
|
+
})));
|
|
40
|
+
container = renderResult.container;
|
|
41
|
+
var hasChecked = container.querySelector('.ant-switch-checked');
|
|
42
|
+
expect(hasChecked).toBeNull();
|
|
43
|
+
});
|