@trionesdev/antd-mobile-base-react 0.0.2-beta.16 → 0.0.2-beta.18

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.
Files changed (118) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +23 -23
  3. package/dist/Alert/alert.js +1 -1
  4. package/dist/Alert/style.scss +69 -69
  5. package/dist/Avatar/avatar.d.ts +2 -2
  6. package/dist/Avatar/avatar.js +1 -1
  7. package/dist/Avatar/style.scss +17 -17
  8. package/dist/Badge/style.scss +100 -100
  9. package/dist/Card/style.scss +35 -35
  10. package/dist/CascaderView/cascader-column-item.js +1 -1
  11. package/dist/CascaderView/style.scss +22 -22
  12. package/dist/Cell/CellGroup.js +25 -8
  13. package/dist/Cell/cell.js +20 -37
  14. package/dist/Cell/context.d.ts +4 -2
  15. package/dist/Cell/styles.scss +81 -52
  16. package/dist/Cell/types.d.ts +6 -4
  17. package/dist/Checkbox/checkbox-button.js +1 -1
  18. package/dist/Checkbox/checkbox-group.js +1 -2
  19. package/dist/Checkbox/checkbox-round.js +1 -1
  20. package/dist/Checkbox/index.scss +165 -165
  21. package/dist/ConfigProvider/config-provider.d.ts +1 -0
  22. package/dist/DemoBlock/index.scss +20 -20
  23. package/dist/DemoDescription/index.scss +3 -3
  24. package/dist/Descriptions/style.scss +65 -65
  25. package/dist/Divider/divider.d.ts +1 -1
  26. package/dist/Divider/divider.js +5 -3
  27. package/dist/Divider/style.scss +62 -62
  28. package/dist/Ellipsis/style.scss +13 -13
  29. package/dist/Empty/style.scss +29 -29
  30. package/dist/ErrorBlock/demo/base.js +2 -2
  31. package/dist/ErrorBlock/style.scss +62 -62
  32. package/dist/Footer/style.scss +55 -55
  33. package/dist/Form/ErrorList.d.ts +4 -0
  34. package/dist/Form/ErrorList.js +9 -0
  35. package/dist/Form/context.d.ts +4 -2
  36. package/dist/Form/context.js +2 -1
  37. package/dist/Form/form.d.ts +24 -6
  38. package/dist/Form/form.js +22 -11
  39. package/dist/Form/hooks/useForm.js +1 -8
  40. package/dist/Form/hooks/useFormContext.js +1 -2
  41. package/dist/Form/index.d.ts +6 -3
  42. package/dist/Form/index.js +4 -1
  43. package/dist/Form/styles.scss +11 -0
  44. package/dist/Form/types.d.ts +2 -1
  45. package/dist/FormCell/FormCell.d.ts +21 -0
  46. package/dist/FormCell/FormCell.js +56 -0
  47. package/dist/FormCell/index.d.ts +4 -0
  48. package/dist/FormCell/index.js +3 -0
  49. package/dist/FormCell/styles.scss +103 -0
  50. package/dist/Grid/style.scss +17 -17
  51. package/dist/Icon/demo/base.js +2 -2
  52. package/dist/InputNumber/style.scss +100 -100
  53. package/dist/Loading/DotLoading.d.ts +8 -0
  54. package/dist/Loading/DotLoading.js +33 -0
  55. package/dist/Loading/SpinLoading.js +70 -0
  56. package/dist/Loading/dot-loading.scss +72 -0
  57. package/dist/Loading/index.d.ts +5 -0
  58. package/dist/Loading/index.js +3 -0
  59. package/dist/{SpinLoading → Loading}/spin-loading.scss +39 -40
  60. package/dist/NavBar/nav-bar.js +1 -1
  61. package/dist/NavBar/style.scss +64 -64
  62. package/dist/NoticeBar/style.scss +130 -130
  63. package/dist/PageIndicator/style.scss +59 -59
  64. package/dist/Progress/Progress.js +1 -1
  65. package/dist/Progress/ProgressCircle.js +5 -2
  66. package/dist/Progress/ProgressLine.js +2 -2
  67. package/dist/Progress/style.scss +33 -33
  68. package/dist/Progress/types.d.ts +2 -2
  69. package/dist/Radio/radio.js +1 -1
  70. package/dist/Radio/style.scss +154 -141
  71. package/dist/Rate/rate.js +1 -1
  72. package/dist/Rate/style.scss +37 -37
  73. package/dist/Result/demo/base.js +2 -2
  74. package/dist/Result/style.scss +73 -73
  75. package/dist/Result/use-result-icon.js +1 -1
  76. package/dist/SafeArea/style.scss +20 -20
  77. package/dist/Scaffold/style.scss +17 -17
  78. package/dist/Segmented/style.scss +75 -75
  79. package/dist/Skeleton/Skeleton.d.ts +80 -21
  80. package/dist/Skeleton/Skeleton.js +248 -57
  81. package/dist/Skeleton/index.d.ts +3 -1
  82. package/dist/Skeleton/index.js +2 -1
  83. package/dist/Skeleton/style.scss +215 -48
  84. package/dist/Space/space.js +12 -9
  85. package/dist/Space/style.scss +101 -80
  86. package/dist/Stepper/stepper.js +2 -1
  87. package/dist/Stepper/style.scss +100 -100
  88. package/dist/Steps/HorizontalSteps.js +5 -2
  89. package/dist/Steps/VerticalSteps.js +5 -2
  90. package/dist/Steps/style.scss +153 -153
  91. package/dist/Steps/types.d.ts +2 -0
  92. package/dist/Switch/style.scss +127 -128
  93. package/dist/Switch/switch.d.ts +2 -0
  94. package/dist/Switch/switch.js +6 -5
  95. package/dist/TabBar/demo/base.js +2 -2
  96. package/dist/TabBar/index.scss +37 -37
  97. package/dist/Tabs/style.scss +108 -108
  98. package/dist/Tag/style.scss +110 -109
  99. package/dist/Tag/tag.d.ts +1 -1
  100. package/dist/Tag/tag.js +1 -1
  101. package/dist/WaterMark/style.scss +17 -17
  102. package/dist/index.d.ts +9 -4
  103. package/dist/index.js +4 -2
  104. package/dist/style/css-variable.scss +6 -6
  105. package/dist/style/style.scss +52 -52
  106. package/dist/style/theme-dark.scss +24 -24
  107. package/dist/style/theme-default.scss +54 -54
  108. package/dist/style/variable.scss +180 -173
  109. package/dist/types.d.ts +6 -1
  110. package/dist/utils/type.js +36 -36
  111. package/dist/utils/with-default-props.js +4 -4
  112. package/package.json +4 -7
  113. package/dist/SpinLoading/index.d.ts +0 -3
  114. package/dist/SpinLoading/index.js +0 -2
  115. package/dist/SpinLoading/spin-loading.js +0 -59
  116. package/dist/Tabs/demo/base.d.ts +0 -3
  117. package/dist/Tabs/demo/base.js +0 -59
  118. /package/dist/{SpinLoading/spin-loading.d.ts → Loading/SpinLoading.d.ts} +0 -0
@@ -1,13 +1,13 @@
1
- $class-prefix-ellipsis: 'triones-antm-ellipsis';
2
- /* prettier-ignore */
3
- .#{$class-prefix-ellipsis} {
4
- overflow: hidden;
5
- line-height: 1.5;
6
- word-break: break-word;
7
-
8
- &-icon {
9
- display: inline-block;
10
- color: #1677ff;
11
- cursor: pointer;
12
- }
13
- }
1
+ $class-prefix-ellipsis: 'triones-antm-ellipsis';
2
+ /* prettier-ignore */
3
+ .#{$class-prefix-ellipsis} {
4
+ overflow: hidden;
5
+ line-height: 1.5;
6
+ word-break: break-word;
7
+
8
+ &-icon {
9
+ display: inline-block;
10
+ color: #1677ff;
11
+ cursor: pointer;
12
+ }
13
+ }
@@ -1,29 +1,29 @@
1
- .triones-antm-empty {
2
- text-align: center;
3
-
4
- &-wrapper {
5
- width: 100%;
6
- height: 100%;
7
- display: flex;
8
- align-items: center;
9
- justify-content: space-around;
10
- }
11
-
12
- &-image {
13
- //margin-bottom: 8Px;
14
- :global {
15
- img,
16
- image {
17
- width: 100%;
18
- height: 100%;
19
- object-fit: cover;
20
- }
21
- }
22
- }
23
-
24
- &-description {
25
- color: rgba(0, 0, 0, 45%);
26
- font-size: 14Px;
27
- padding: 8Px;
28
- }
29
- }
1
+ .triones-antm-empty {
2
+ text-align: center;
3
+
4
+ &-wrapper {
5
+ width: 100%;
6
+ height: 100%;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: space-around;
10
+ }
11
+
12
+ &-image {
13
+ //margin-bottom: 8Px;
14
+ :global {
15
+ img,
16
+ image {
17
+ width: 100%;
18
+ height: 100%;
19
+ object-fit: cover;
20
+ }
21
+ }
22
+ }
23
+
24
+ &-description {
25
+ color: rgba(0, 0, 0, 45%);
26
+ font-size: 14Px;
27
+ padding: 8Px;
28
+ }
29
+ }
@@ -1,5 +1,5 @@
1
- /**
2
- * compact: true
1
+ /**
2
+ * compact: true
3
3
  */
4
4
  import { DemoBlock } from "../../DemoBlock";
5
5
  import React from 'react';
@@ -1,62 +1,62 @@
1
- $class-prefix-error-block: 'triones-antm-error-block';
2
- /* prettier-ignore */
3
- .#{$class-prefix-error-block} {
4
- --color: var(--triones-antm-color-text);
5
- --image-height: var(--triones-antm-error-block-image-height, 100PX);
6
- --image-height-full-page: var(
7
- --triones-antm-error-block-image-height-full-page,
8
- 200PX
9
- );
10
- --image-width: var(--triones-antm-error-block-image-width, auto);
11
- --image-width-full-page: var(
12
- --triones-antm-error-block-image-width-full-page,
13
- auto
14
- );
15
- width: 100%;
16
- box-sizing: border-box;
17
- text-align: center;
18
-
19
- &-image {
20
- height: var(--image-height);
21
- width: var(--image-width);
22
- max-width: 100%;
23
-
24
- & svg,
25
- img {
26
- height: 100%;
27
- }
28
- }
29
-
30
- &-description {
31
- font-size: var(--triones-antm-font-size-4);
32
- color: var(--triones-antm-color-weak);
33
- line-height: 1.4;
34
- margin-top: 12PX;
35
- &-title {
36
- font-size: var(--triones-antm-font-size-7);
37
- }
38
- &-subtitle {
39
- margin-top: 8PX;
40
- }
41
- }
42
-
43
- &-content {
44
- margin-top: 12PX;
45
- }
46
-
47
- &-full-page {
48
- padding-top: calc(50vh - var(--image-height-full-page));
49
- .#{$class-prefix-error-block}-image {
50
- height: var(--image-height-full-page);
51
- width: var(--image-width-full-page);
52
- }
53
- .#{$class-prefix-error-block}-description {
54
- margin-top: 20PX;
55
- font-size: var(--triones-antm-font-size-main);
56
- &-title {
57
- font-size: 20PX;
58
- color: var(--triones-antm-color-text);
59
- }
60
- }
61
- }
62
- }
1
+ $class-prefix-error-block: 'triones-antm-error-block';
2
+ /* prettier-ignore */
3
+ .#{$class-prefix-error-block} {
4
+ --color: var(--triones-antm-color-text);
5
+ --image-height: var(--triones-antm-error-block-image-height, 100PX);
6
+ --image-height-full-page: var(
7
+ --triones-antm-error-block-image-height-full-page,
8
+ 200PX
9
+ );
10
+ --image-width: var(--triones-antm-error-block-image-width, auto);
11
+ --image-width-full-page: var(
12
+ --triones-antm-error-block-image-width-full-page,
13
+ auto
14
+ );
15
+ width: 100%;
16
+ box-sizing: border-box;
17
+ text-align: center;
18
+
19
+ &-image {
20
+ height: var(--image-height);
21
+ width: var(--image-width);
22
+ max-width: 100%;
23
+
24
+ & svg,
25
+ img {
26
+ height: 100%;
27
+ }
28
+ }
29
+
30
+ &-description {
31
+ font-size: var(--triones-antm-font-size-4);
32
+ color: var(--triones-antm-color-weak);
33
+ line-height: 1.4;
34
+ margin-top: 12PX;
35
+ &-title {
36
+ font-size: var(--triones-antm-font-size-7);
37
+ }
38
+ &-subtitle {
39
+ margin-top: 8PX;
40
+ }
41
+ }
42
+
43
+ &-content {
44
+ margin-top: 12PX;
45
+ }
46
+
47
+ &-full-page {
48
+ padding-top: calc(50vh - var(--image-height-full-page));
49
+ .#{$class-prefix-error-block}-image {
50
+ height: var(--image-height-full-page);
51
+ width: var(--image-width-full-page);
52
+ }
53
+ .#{$class-prefix-error-block}-description {
54
+ margin-top: 20PX;
55
+ font-size: var(--triones-antm-font-size-main);
56
+ &-title {
57
+ font-size: 20PX;
58
+ color: var(--triones-antm-color-text);
59
+ }
60
+ }
61
+ }
62
+ }
@@ -1,55 +1,55 @@
1
- $class-prefix-footer: 'triones-antm-footer';
2
- /* prettier-ignore */
3
- .#{$class-prefix-footer} {
4
- --background-color: #ffffff;
5
-
6
- color: #333333;
7
- display: flex;
8
- flex-direction: column;
9
- align-items: center;
10
- background-color: var(--background-color);
11
-
12
- &-label {
13
- width: 100%;
14
- .triones-antm-divider {
15
- color: #cccccc;
16
- }
17
- }
18
- &-links {
19
- margin: 8PX 0;
20
- color: #1677ff;
21
- white-space: nowrap;
22
- &-item {
23
- display: inline-block;
24
- }
25
- }
26
- &-content {
27
- display: flex;
28
- align-items: center;
29
- margin: 8PX 0;
30
- color: #cccccc;
31
- }
32
- &-chips {
33
- display: flex;
34
- align-items: center;
35
- white-space: nowrap;
36
- margin: 8PX 0;
37
- }
38
- &-chip {
39
- white-space: nowrap;
40
- margin-right: 20PX;
41
- font-size: 12PX;
42
- background-color: #f5f5f5;
43
- color: #999999;
44
- padding: 4PX 12PX;
45
- border-radius: 100PX;
46
- &-link {
47
- cursor: pointer;
48
- background-color: #e7f1ff;
49
- color: #1677ff;
50
- }
51
- &:last-child {
52
- margin-right: 0;
53
- }
54
- }
55
- }
1
+ $class-prefix-footer: 'triones-antm-footer';
2
+ /* prettier-ignore */
3
+ .#{$class-prefix-footer} {
4
+ --background-color: #ffffff;
5
+
6
+ color: #333333;
7
+ display: flex;
8
+ flex-direction: column;
9
+ align-items: center;
10
+ background-color: var(--background-color);
11
+
12
+ &-label {
13
+ width: 100%;
14
+ .triones-antm-divider {
15
+ color: #cccccc;
16
+ }
17
+ }
18
+ &-links {
19
+ margin: 8PX 0;
20
+ color: #1677ff;
21
+ white-space: nowrap;
22
+ &-item {
23
+ display: inline-block;
24
+ }
25
+ }
26
+ &-content {
27
+ display: flex;
28
+ align-items: center;
29
+ margin: 8PX 0;
30
+ color: #cccccc;
31
+ }
32
+ &-chips {
33
+ display: flex;
34
+ align-items: center;
35
+ white-space: nowrap;
36
+ margin: 8PX 0;
37
+ }
38
+ &-chip {
39
+ white-space: nowrap;
40
+ margin-right: 20PX;
41
+ font-size: 12PX;
42
+ background-color: #f5f5f5;
43
+ color: #999999;
44
+ padding: 4PX 12PX;
45
+ border-radius: 100PX;
46
+ &-link {
47
+ cursor: pointer;
48
+ background-color: #e7f1ff;
49
+ color: #1677ff;
50
+ }
51
+ &:last-child {
52
+ margin-right: 0;
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,4 @@
1
+ import { FC } from "react";
2
+ export declare const ErrorList: FC<{
3
+ errors?: string[];
4
+ }>;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ var cls = 'triones-antm-form';
3
+ export var ErrorList = function ErrorList(_ref) {
4
+ var errors = _ref.errors;
5
+ if (!errors || !errors.length) return null;
6
+ return /*#__PURE__*/React.createElement("div", {
7
+ className: "".concat(cls, "-item-explain-error")
8
+ }, errors === null || errors === void 0 ? void 0 : errors.join(','));
9
+ };
@@ -1,13 +1,15 @@
1
1
  import React from "react";
2
- import { FormLayout, FormLayoutAlign, RequiredMark } from "./types";
2
+ import { FormItemVerticalAlign, FormLayout, FormHorizontalAlign, RequiredMark } from "./types";
3
3
  export interface FormContextProps {
4
4
  colon?: boolean;
5
5
  layout?: FormLayout;
6
- labelAlign?: FormLayoutAlign;
6
+ labelAlign?: FormHorizontalAlign;
7
7
  labelWidth?: number;
8
+ contentAlign?: FormHorizontalAlign;
8
9
  requiredMark?: RequiredMark;
9
10
  form?: any;
10
11
  hiddenError?: boolean;
11
12
  extra?: React.ReactNode;
13
+ verticalAlign?: FormItemVerticalAlign;
12
14
  }
13
15
  export declare const FormContext: React.Context<FormContextProps>;
@@ -2,5 +2,6 @@ import React from "react";
2
2
  export var FormContext = /*#__PURE__*/React.createContext({
3
3
  colon: true,
4
4
  layout: "horizontal",
5
- labelAlign: "left"
5
+ labelAlign: "start",
6
+ contentAlign: "start"
6
7
  });
@@ -3,11 +3,12 @@ import type { FormProps as RcFormProps } from 'rc-field-form/lib/Form';
3
3
  import type { FormRef } from 'rc-field-form/lib/interface';
4
4
  import React from 'react';
5
5
  import { FormInstance } from './interface';
6
- import { FormLayout, FormLayoutAlign, RequiredMark } from "./types";
6
+ import { FormHorizontalAlign, FormLayout, RequiredMark } from "./types";
7
+ import "./styles.scss";
7
8
  export interface FormProps<Values = any> extends Omit<RcFormProps<Values>, 'form' | 'component'> {
8
9
  /**
9
10
  * @description 配置 Form.Item 的 colon 的默认值。表示是否显示 label 后面的冒号 (只有在属性 layout 为 horizontal 时有效)
10
- * @default true
11
+ * @default false
11
12
  */
12
13
  colon?: boolean;
13
14
  /**
@@ -21,19 +22,36 @@ export interface FormProps<Values = any> extends Omit<RcFormProps<Values>, 'form
21
22
  */
22
23
  form?: FormInstance<Values>;
23
24
  /**
24
- * @description 标签
25
- * @default horizontal
25
+ * @description 标签对齐方式
26
+ * @default left
27
+ */
28
+ labelAlign?: FormHorizontalAlign;
29
+ /**
30
+ * @description 标签宽度
31
+ * @default
26
32
  */
27
- labelAlign?: FormLayoutAlign;
28
33
  labelWidth?: number;
34
+ /**
35
+ * @description 表单控件的对齐方式
36
+ * @default left
37
+ */
38
+ contentAlign?: FormHorizontalAlign;
39
+ /**
40
+ * @description 是否显示必填标记
41
+ * @default true
42
+ */
29
43
  requiredMark?: RequiredMark;
30
44
  /**
31
45
  * @description 是否隐藏错误信息,主要用于自定义异常样式
32
46
  * @default false
33
47
  */
34
48
  hiddenError?: boolean;
49
+ /**
50
+ * @description 表单底部内容
51
+ * @default
52
+ */
35
53
  extra?: React.ReactNode;
36
54
  }
37
- export declare const InternalForm: React.ForwardRefRenderFunction<FormRef, FormProps>;
55
+ declare const InternalForm: React.ForwardRefExoticComponent<FormProps<any> & React.RefAttributes<FormRef>>;
38
56
  export { useWatch };
39
57
  export default InternalForm;
package/dist/Form/form.js CHANGED
@@ -1,32 +1,43 @@
1
- var _excluded = ["children", "layout", "labelAlign", "labelWidth", "requiredMark", "hiddenError", "extra"];
1
+ var _excluded = ["children", "colon", "layout", "labelAlign", "labelWidth", "contentAlign", "requiredMark", "hiddenError", "extra"];
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
3
  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; }
4
4
  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; }
5
5
  import FieldForm, { useWatch } from 'rc-field-form';
6
6
  import React from 'react';
7
7
  import { FormContext } from "./context";
8
- export var InternalForm = function InternalForm(_ref, ref) {
8
+ import "./styles.scss";
9
+ var InternalForm = /*#__PURE__*/React.forwardRef(function Form(_ref, ref) {
9
10
  var children = _ref.children,
11
+ _ref$colon = _ref.colon,
12
+ colon = _ref$colon === void 0 ? false : _ref$colon,
10
13
  layout = _ref.layout,
11
14
  labelAlign = _ref.labelAlign,
12
15
  labelWidth = _ref.labelWidth,
16
+ contentAlign = _ref.contentAlign,
13
17
  requiredMark = _ref.requiredMark,
14
18
  _ref$hiddenError = _ref.hiddenError,
15
19
  hiddenError = _ref$hiddenError === void 0 ? false : _ref$hiddenError,
16
20
  extra = _ref.extra,
17
- props = _objectWithoutProperties(_ref, _excluded);
18
- return /*#__PURE__*/React.createElement(FormContext.Provider, {
19
- value: {
20
- layout: layout || 'horizontal',
21
- labelAlign: labelAlign || 'left',
21
+ rest = _objectWithoutProperties(_ref, _excluded);
22
+ var contextValue = React.useMemo(function () {
23
+ return {
24
+ colon: colon,
25
+ layout: layout !== null && layout !== void 0 ? layout : 'horizontal',
26
+ labelAlign: labelAlign !== null && labelAlign !== void 0 ? labelAlign : 'start',
22
27
  labelWidth: labelWidth,
23
- requiredMark: requiredMark || true,
28
+ contentAlign: contentAlign !== null && contentAlign !== void 0 ? contentAlign : 'start',
29
+ requiredMark: requiredMark !== null && requiredMark !== void 0 ? requiredMark : true,
24
30
  hiddenError: hiddenError,
25
31
  extra: extra
26
- }
27
- }, /*#__PURE__*/React.createElement(FieldForm, _extends({}, props, {
32
+ };
33
+ }, [colon, layout, labelAlign, labelWidth, contentAlign, requiredMark, hiddenError, extra]);
34
+ return /*#__PURE__*/React.createElement(FormContext.Provider, {
35
+ value: contextValue
36
+ }, /*#__PURE__*/React.createElement(FieldForm, _extends({}, rest, {
37
+ ref: ref,
28
38
  component: false
29
39
  }), children));
30
- };
40
+ });
41
+ InternalForm.displayName = 'Form';
31
42
  export { useWatch };
32
43
  export default InternalForm;
@@ -1,9 +1,3 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
2
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -16,9 +10,8 @@ export default function useForm(form) {
16
10
  var _useRcForm = useRcForm(),
17
11
  _useRcForm2 = _slicedToArray(_useRcForm, 1),
18
12
  rcForm = _useRcForm2[0];
19
- var itemsRef = React.useRef({});
20
13
  var wrapForm = React.useMemo(function () {
21
- return form !== null && form !== void 0 ? form : _objectSpread({}, rcForm);
14
+ return form !== null && form !== void 0 ? form : rcForm;
22
15
  }, [form, rcForm]);
23
16
  return [wrapForm];
24
17
  }
@@ -1,6 +1,5 @@
1
1
  import { FormContext } from "../context";
2
2
  import React from "react";
3
3
  export function useFormContext() {
4
- var formContext = React.useContext(FormContext);
5
- return formContext;
4
+ return React.useContext(FormContext);
6
5
  }
@@ -1,14 +1,17 @@
1
- import FieldForm from 'rc-field-form';
1
+ import FieldForm, { Field } from 'rc-field-form';
2
2
  import InternalForm, { FormProps, useWatch } from "./form";
3
+ import { ErrorList } from "./ErrorList";
3
4
  import useForm from "./hooks/useForm";
4
- import { FormItemLayout, FormLayout, FormLayoutAlign } from "./types";
5
+ import { FormItemLayout, FormLayout, FormHorizontalAlign, FormItemVerticalAlign } from "./types";
6
+ export { Field };
5
7
  export { useFormContext } from "./hooks/useFormContext";
6
8
  type InternalFormType = typeof InternalForm;
7
9
  type CompoundedComponent = InternalFormType & {
8
10
  useForm: typeof useForm;
9
11
  List: typeof FieldForm.List;
12
+ ErrorList: typeof ErrorList;
10
13
  useWatch: typeof useWatch;
11
14
  };
12
15
  declare const Form: CompoundedComponent;
13
- export type { FormProps, FormLayout, FormLayoutAlign, FormItemLayout };
16
+ export type { FormProps, FormLayout, FormItemLayout, FormHorizontalAlign, FormItemVerticalAlign, };
14
17
  export default Form;
@@ -1,9 +1,12 @@
1
- import FieldForm from 'rc-field-form';
1
+ import FieldForm, { Field } from 'rc-field-form';
2
2
  import InternalForm, { useWatch } from "./form";
3
+ import { ErrorList } from "./ErrorList";
3
4
  import useForm from "./hooks/useForm";
5
+ export { Field };
4
6
  export { useFormContext } from "./hooks/useFormContext";
5
7
  var Form = InternalForm;
6
8
  Form.List = FieldForm.List;
9
+ Form.ErrorList = ErrorList;
7
10
  Form.useForm = useForm;
8
11
  // Form.Item = FormItem;
9
12
  Form.useWatch = useWatch;
@@ -0,0 +1,11 @@
1
+ @use "../style/variable" as variable;
2
+
3
+ .triones-antm-form{
4
+ &-item{
5
+ &-explain-error{
6
+ font-size: variable.$trionesFontSizeSm;
7
+ color: variable.$trionesColorError;
8
+ }
9
+ }
10
+
11
+ }
@@ -4,4 +4,5 @@ export type RequiredMark = boolean | 'optional' | ((labelNode: React.ReactNode,
4
4
  }) => React.ReactNode);
5
5
  export type FormLayout = 'horizontal' | 'inline' | 'vertical';
6
6
  export type FormItemLayout = 'horizontal' | 'vertical';
7
- export type FormLayoutAlign = 'left' | 'right';
7
+ export type FormHorizontalAlign = 'start' | 'end';
8
+ export type FormItemVerticalAlign = 'start' | 'center';
@@ -0,0 +1,21 @@
1
+ import React, { FC, PropsWithChildren } from "react";
2
+ import { AntSize } from "../types";
3
+ export type VariantType = 'outlined' | 'borderless' | 'filled' | 'underlined' | undefined;
4
+ export type FormCellProps = {
5
+ className?: string;
6
+ style?: React.CSSProperties;
7
+ styles?: {
8
+ root?: React.CSSProperties;
9
+ content?: React.CSSProperties;
10
+ extra?: React.CSSProperties;
11
+ arrow?: React.CSSProperties;
12
+ };
13
+ size?: AntSize;
14
+ variant?: VariantType;
15
+ placeholder?: string;
16
+ onClick?: () => void;
17
+ extra?: React.ReactNode;
18
+ arrow?: boolean | React.ReactNode;
19
+ align?: 'start' | 'center' | 'end';
20
+ };
21
+ export declare const FormCell: FC<PropsWithChildren<FormCellProps>>;
@@ -0,0 +1,56 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import React from "react";
8
+ import classNames from "classnames";
9
+ import { RightOutline } from "@trionesdev/antd-mobile-icons-react";
10
+ import ConfigProvider from "../ConfigProvider";
11
+ import { mergeProp } from "../utils/with-default-props";
12
+ var cls = 'triones-antm-form-cell';
13
+ var defaultArrowIcon = /*#__PURE__*/React.createElement(RightOutline, null);
14
+ export var FormCell = function FormCell(_ref) {
15
+ var className = _ref.className,
16
+ style = _ref.style,
17
+ styles = _ref.styles,
18
+ children = _ref.children,
19
+ _ref$size = _ref.size,
20
+ size = _ref$size === void 0 ? 'medium' : _ref$size,
21
+ _ref$variant = _ref.variant,
22
+ variant = _ref$variant === void 0 ? 'borderless' : _ref$variant,
23
+ placeholder = _ref.placeholder,
24
+ extra = _ref.extra,
25
+ _ref$arrow = _ref.arrow,
26
+ arrow = _ref$arrow === void 0 ? false : _ref$arrow,
27
+ _ref$align = _ref.align,
28
+ align = _ref$align === void 0 ? 'left' : _ref$align,
29
+ onClick = _ref.onClick;
30
+ var _ConfigProvider$useCo = ConfigProvider.useConfig(),
31
+ _ConfigProvider$useCo2 = _ConfigProvider$useCo.form,
32
+ componentConfig = _ConfigProvider$useCo2 === void 0 ? {} : _ConfigProvider$useCo2;
33
+ var mergedArrow = function () {
34
+ if (arrow === false || arrow === undefined || arrow === null) return null;
35
+ if (arrow === true) {
36
+ return mergeProp(defaultArrowIcon, componentConfig.arrowIcon);
37
+ }
38
+ return arrow;
39
+ }();
40
+ return /*#__PURE__*/React.createElement("div", {
41
+ className: classNames("".concat(cls), "".concat(cls, "-").concat(align), "".concat(cls, "-").concat(size), "".concat(cls, "-").concat(variant), className),
42
+ style: _objectSpread(_objectSpread({}, style), styles === null || styles === void 0 ? void 0 : styles.root),
43
+ onClick: onClick
44
+ }, /*#__PURE__*/React.createElement("div", {
45
+ className: classNames("".concat(cls, "-content")),
46
+ style: styles === null || styles === void 0 ? void 0 : styles.content
47
+ }, children || placeholder && /*#__PURE__*/React.createElement("div", {
48
+ className: classNames("".concat(cls, "-placeholder"))
49
+ }, placeholder)), extra && /*#__PURE__*/React.createElement("div", {
50
+ className: classNames("".concat(cls, "-extra")),
51
+ style: styles === null || styles === void 0 ? void 0 : styles.extra
52
+ }, extra), mergedArrow && /*#__PURE__*/React.createElement("div", {
53
+ className: classNames("".concat(cls, "-arrow")),
54
+ style: styles === null || styles === void 0 ? void 0 : styles.arrow
55
+ }, mergedArrow));
56
+ };