@next-bricks/form 0.11.3 → 0.12.1

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 (117) hide show
  1. package/dist/bricks.json +9 -6
  2. package/dist/chunks/1966.5be7af84.js +2 -0
  3. package/dist/chunks/1966.5be7af84.js.map +1 -0
  4. package/dist/chunks/3494.dd24d739.js +2 -0
  5. package/dist/chunks/{3494.b32e021c.js.map → 3494.dd24d739.js.map} +1 -1
  6. package/dist/chunks/4131.48a216bd.js +2 -0
  7. package/dist/chunks/4131.48a216bd.js.map +1 -0
  8. package/dist/chunks/4791.06b0142b.js +2 -0
  9. package/dist/chunks/{4791.288c8084.js.map → 4791.06b0142b.js.map} +1 -1
  10. package/dist/chunks/4795.90b6991e.js +2 -0
  11. package/dist/chunks/4795.90b6991e.js.map +1 -0
  12. package/dist/chunks/5202.e887583f.js +2 -0
  13. package/dist/chunks/{5202.2b219084.js.map → 5202.e887583f.js.map} +1 -1
  14. package/dist/chunks/6221.9d80956c.js +3 -0
  15. package/dist/chunks/6221.9d80956c.js.map +1 -0
  16. package/dist/chunks/7822.c8ee10ba.js +2 -0
  17. package/dist/chunks/{7822.4154a218.js.map → 7822.c8ee10ba.js.map} +1 -1
  18. package/dist/chunks/7884.e14a1509.js +2 -0
  19. package/dist/chunks/7884.e14a1509.js.map +1 -0
  20. package/dist/chunks/873.cc3010b0.js +2 -0
  21. package/dist/chunks/{873.2b11a4db.js.map → 873.cc3010b0.js.map} +1 -1
  22. package/dist/chunks/9549.de31aced.js +2 -0
  23. package/dist/chunks/{9549.2c5f5edd.js.map → 9549.de31aced.js.map} +1 -1
  24. package/dist/chunks/eo-checkbox.f9bc931d.js +2 -0
  25. package/dist/chunks/eo-checkbox.f9bc931d.js.map +1 -0
  26. package/dist/chunks/{eo-dynamic-form-item.68db88eb.js → eo-dynamic-form-item.4acd47a7.js} +2 -2
  27. package/dist/chunks/{eo-dynamic-form-item.68db88eb.js.map → eo-dynamic-form-item.4acd47a7.js.map} +1 -1
  28. package/dist/chunks/eo-form.d8d5e655.js +2 -0
  29. package/dist/chunks/{eo-form.dfefdd7d.js.map → eo-form.d8d5e655.js.map} +1 -1
  30. package/dist/chunks/eo-icon-select.c36f29bb.js +3 -0
  31. package/dist/chunks/{eo-icon-select.821c7b62.js.map → eo-icon-select.c36f29bb.js.map} +1 -1
  32. package/dist/chunks/eo-radio.ea667baf.js +2 -0
  33. package/dist/chunks/eo-radio.ea667baf.js.map +1 -0
  34. package/dist/chunks/eo-search.92a48f0f.js +3 -0
  35. package/dist/chunks/eo-search.92a48f0f.js.map +1 -0
  36. package/dist/chunks/eo-select.cd27e6c2.js +2 -0
  37. package/dist/chunks/eo-select.cd27e6c2.js.map +1 -0
  38. package/dist/chunks/eo-textarea.9a478e44.js +3 -0
  39. package/dist/chunks/{eo-textarea.7e65b425.js.map → eo-textarea.9a478e44.js.map} +1 -1
  40. package/dist/chunks/eo-upload-file.837872c4.js +3 -0
  41. package/dist/chunks/eo-upload-file.837872c4.js.map +1 -0
  42. package/dist/chunks/eo-upload-image.e3a4fa7b.js +3 -0
  43. package/dist/chunks/eo-upload-image.e3a4fa7b.js.map +1 -0
  44. package/dist/chunks/main.2fbe2cf6.js +2 -0
  45. package/dist/chunks/main.2fbe2cf6.js.map +1 -0
  46. package/dist/index.6f347e9d.js +2 -0
  47. package/dist/index.6f347e9d.js.map +1 -0
  48. package/dist/manifest.json +99 -182
  49. package/dist/types.json +558 -727
  50. package/dist-types/bootstrap.d.ts +1 -1
  51. package/dist-types/upload/Upload.d.ts +4 -1
  52. package/dist-types/upload/upload-file/i18n.d.ts +14 -0
  53. package/dist-types/upload/upload-file/index.d.ts +95 -0
  54. package/dist-types/upload/upload-file/index.spec.d.ts +1 -0
  55. package/docs/eo-upload-file.md +22 -0
  56. package/package.json +2 -2
  57. package/dist/chunks/1970.6303d93c.js +0 -3
  58. package/dist/chunks/1970.6303d93c.js.LICENSE.txt +0 -46
  59. package/dist/chunks/1970.6303d93c.js.map +0 -1
  60. package/dist/chunks/3494.b32e021c.js +0 -2
  61. package/dist/chunks/4131.da9663d6.js +0 -2
  62. package/dist/chunks/4131.da9663d6.js.map +0 -1
  63. package/dist/chunks/4791.288c8084.js +0 -2
  64. package/dist/chunks/5202.2b219084.js +0 -2
  65. package/dist/chunks/6389.d53428bf.js +0 -2
  66. package/dist/chunks/6389.d53428bf.js.map +0 -1
  67. package/dist/chunks/714.fbaa063b.js +0 -2
  68. package/dist/chunks/714.fbaa063b.js.map +0 -1
  69. package/dist/chunks/7822.4154a218.js +0 -2
  70. package/dist/chunks/873.2b11a4db.js +0 -2
  71. package/dist/chunks/9223.f5fd0ea1.js +0 -2
  72. package/dist/chunks/9223.f5fd0ea1.js.map +0 -1
  73. package/dist/chunks/9549.2c5f5edd.js +0 -2
  74. package/dist/chunks/9986.bb3def3f.js +0 -2
  75. package/dist/chunks/9986.bb3def3f.js.map +0 -1
  76. package/dist/chunks/code-editor.e3690b47.js +0 -2
  77. package/dist/chunks/code-editor.e3690b47.js.map +0 -1
  78. package/dist/chunks/eo-checkbox.c5010723.js +0 -3
  79. package/dist/chunks/eo-checkbox.c5010723.js.map +0 -1
  80. package/dist/chunks/eo-form.dfefdd7d.js +0 -2
  81. package/dist/chunks/eo-icon-select.821c7b62.js +0 -3
  82. package/dist/chunks/eo-radio.3c54b91c.js +0 -3
  83. package/dist/chunks/eo-radio.3c54b91c.js.map +0 -1
  84. package/dist/chunks/eo-search.519fbec4.js +0 -3
  85. package/dist/chunks/eo-search.519fbec4.js.map +0 -1
  86. package/dist/chunks/eo-select.5abf2d64.js +0 -3
  87. package/dist/chunks/eo-select.5abf2d64.js.map +0 -1
  88. package/dist/chunks/eo-textarea.7e65b425.js +0 -3
  89. package/dist/chunks/eo-upload-image.8c7d6541.js +0 -3
  90. package/dist/chunks/eo-upload-image.8c7d6541.js.LICENSE.txt +0 -5
  91. package/dist/chunks/eo-upload-image.8c7d6541.js.map +0 -1
  92. package/dist/chunks/main.3c473511.js +0 -2
  93. package/dist/chunks/main.3c473511.js.map +0 -1
  94. package/dist/index.07479137.js +0 -2
  95. package/dist/index.07479137.js.map +0 -1
  96. package/dist-types/code-editor/aceBuilds/index.d.ts +0 -16
  97. package/dist-types/code-editor/codeEditor.d.ts +0 -5
  98. package/dist-types/code-editor/custom-mode/BrickNextMode.d.ts +0 -7
  99. package/dist-types/code-editor/custom-mode/BrickNextRules.d.ts +0 -170
  100. package/dist-types/code-editor/custom-mode/BrickNextYamlMode.d.ts +0 -7
  101. package/dist-types/code-editor/custom-mode/CommonExpressionLanguageMode.d.ts +0 -7
  102. package/dist-types/code-editor/custom-mode/CommonExpressionLanguageRules.d.ts +0 -19
  103. package/dist-types/code-editor/custom-mode/CommonExpressionLanguageRules.spec.d.ts +0 -1
  104. package/dist-types/code-editor/custom-mode/CommonExpressionLanguageYamlMode.d.ts +0 -7
  105. package/dist-types/code-editor/custom-mode/TerraformMode.d.ts +0 -7
  106. package/dist-types/code-editor/custom-mode/brickNextUtil.d.ts +0 -15
  107. package/dist-types/code-editor/getClickableMarker.d.ts +0 -2
  108. package/dist-types/code-editor/getHighlightMarkers.d.ts +0 -11
  109. package/dist-types/code-editor/index.d.ts +0 -166
  110. package/dist-types/code-editor/index.spec.d.ts +0 -1
  111. package/dist-types/code-editor/interfaces.d.ts +0 -76
  112. /package/dist/chunks/{eo-checkbox.c5010723.js.LICENSE.txt → 6221.9d80956c.js.LICENSE.txt} +0 -0
  113. /package/dist/chunks/{eo-icon-select.821c7b62.js.LICENSE.txt → eo-icon-select.c36f29bb.js.LICENSE.txt} +0 -0
  114. /package/dist/chunks/{eo-radio.3c54b91c.js.LICENSE.txt → eo-search.92a48f0f.js.LICENSE.txt} +0 -0
  115. /package/dist/chunks/{eo-search.519fbec4.js.LICENSE.txt → eo-textarea.9a478e44.js.LICENSE.txt} +0 -0
  116. /package/dist/chunks/{eo-select.5abf2d64.js.LICENSE.txt → eo-upload-file.837872c4.js.LICENSE.txt} +0 -0
  117. /package/dist/chunks/{eo-textarea.7e65b425.js.LICENSE.txt → eo-upload-image.e3a4fa7b.js.LICENSE.txt} +0 -0
@@ -6,9 +6,9 @@ import "./radio/index.js";
6
6
  import "./select/index.js";
7
7
  import "./submit-buttons/index.js";
8
8
  import "./checkbox/index.js";
9
- import "./code-editor/index.js";
10
9
  import "./dynamic-form-item/index.js";
11
10
  import "./search/index.js";
12
11
  import "./icon-select/index.js";
13
12
  import "./upload/upload-image/index.js";
14
13
  import "./general-switch/index.js";
14
+ import "./upload/upload-file/index.js";
@@ -3,12 +3,13 @@ import "@next-core/theme";
3
3
  import { type FileData } from "./utils.js";
4
4
  export interface UploadActions {
5
5
  upload: () => void;
6
+ uploadFiles: (files: FileList | File[]) => void;
6
7
  }
7
8
  export interface ItemActions {
8
9
  remove: () => void;
9
10
  }
10
11
  export interface UploadProps {
11
- uploadRender: (fileDataList: FileData[], actions: UploadActions) => React.ReactElement;
12
+ children: (fileDataList: FileData[], uploadActions: UploadActions) => React.ReactElement;
12
13
  itemRender: (fileData: FileData, fileDataList: FileData[], actions: ItemActions) => React.ReactElement;
13
14
  fileList?: FileData[];
14
15
  autoUpload?: boolean;
@@ -17,6 +18,8 @@ export interface UploadProps {
17
18
  method?: string;
18
19
  accept?: string;
19
20
  multiple?: boolean;
21
+ maxCount?: number;
22
+ overMaxCountMode?: "ignore" | "replace";
20
23
  beforeUploadValidators?: ((file: File, files: File[]) => Promise<unknown>)[];
21
24
  beforeUploadUserDataProcessor?: (file: File, fileDataList: {
22
25
  file: File;
@@ -0,0 +1,14 @@
1
+ export declare enum K {
2
+ UPLOAD = "UPLOAD",
3
+ FILE_UPLOADING = "FILE_UPLOADING",
4
+ DRAG_UPLOAD_TEXT = "DRAG_UPLOAD_TEXT"
5
+ }
6
+ export declare const NS = "bricks/form/eo-upload-file";
7
+ export declare const locales: {
8
+ en: Locale;
9
+ zh: Locale;
10
+ };
11
+ type Locale = {
12
+ [key in K]: string;
13
+ };
14
+ export {};
@@ -0,0 +1,95 @@
1
+ /// <reference types="react" />
2
+ import { FormItemElementBase } from "@next-shared/form";
3
+ import type { FormItemProps } from "../../form-item/index.js";
4
+ import "@next-core/theme";
5
+ import { FileData } from "../utils.js";
6
+ export interface UploadFileProps {
7
+ label?: string;
8
+ name?: string;
9
+ required?: boolean;
10
+ message?: Record<string, string>;
11
+ value?: FileData[];
12
+ multiple?: boolean;
13
+ accept?: string;
14
+ maxCount?: number;
15
+ overMaxCountMode?: "ignore" | "replace";
16
+ uploadDraggable?: boolean;
17
+ draggableUploadTip?: string;
18
+ autoUpload?: boolean;
19
+ url?: string;
20
+ method?: string;
21
+ uploadName?: string;
22
+ }
23
+ /**
24
+ * 上传文件
25
+ */
26
+ export declare class EoUploadFile extends FormItemElementBase implements UploadFileProps {
27
+ #private;
28
+ /**
29
+ * 字段说明
30
+ */
31
+ accessor label: string | undefined;
32
+ /**
33
+ * 字段名称
34
+ */
35
+ accessor name: string | undefined;
36
+ /**
37
+ * 是否必填
38
+ */
39
+ accessor required: boolean | undefined;
40
+ /**
41
+ * 校验文本信息
42
+ */
43
+ accessor message: Record<string, string> | undefined;
44
+ /**
45
+ * 值
46
+ */
47
+ accessor value: FileData[] | undefined;
48
+ /**
49
+ * 是否支持多选
50
+ */
51
+ accessor multiple: boolean | undefined;
52
+ /**
53
+ * 接受上传的文件类型,多个之间用 `,` 连接
54
+ */
55
+ accessor accept: string | undefined;
56
+ /**
57
+ * 最大上传数量
58
+ */
59
+ accessor maxCount: number | undefined;
60
+ /**
61
+ * 超出最大上传数量时文件的保留方式
62
+ */
63
+ accessor overMaxCountMode: "ignore" | "replace";
64
+ /**
65
+ * 是否可以拖拽上传
66
+ */
67
+ accessor uploadDraggable: boolean | undefined;
68
+ /**
69
+ * 拖拽上传的提示信息
70
+ */
71
+ accessor draggableUploadTip: string | undefined;
72
+ /**
73
+ * 是否自动上传
74
+ */
75
+ accessor autoUpload: boolean;
76
+ /**
77
+ * 自动上传的地址
78
+ */
79
+ accessor url: string | undefined;
80
+ /**
81
+ * 自动上传的方法
82
+ */
83
+ accessor method: string;
84
+ /**
85
+ * 自动上传的文件参数名
86
+ */
87
+ accessor uploadName: string;
88
+ handleChange: (fileDataList: FileData[]) => void;
89
+ render(): JSX.Element;
90
+ }
91
+ interface UploadFileComponentProps extends UploadFileProps, FormItemProps {
92
+ onChange?: (fileDataList: FileData[]) => void;
93
+ }
94
+ export declare function EoUploadFileComponent(props: UploadFileComponentProps): JSX.Element;
95
+ export {};
@@ -0,0 +1 @@
1
+ import "./index.jsx";
@@ -0,0 +1,22 @@
1
+ 上传文件
2
+
3
+ ## Examples
4
+
5
+ ### Basic
6
+
7
+ ```yaml preview
8
+ brick: eo-upload-file
9
+ properties:
10
+ style:
11
+ width: 300px
12
+ uploadDraggable: true
13
+ maxCount: 2
14
+ multiple: true
15
+ accept: image/*
16
+ draggableUploadTip: 支持上传图片
17
+ events:
18
+ change:
19
+ - action: console.log
20
+ args:
21
+ - <% EVENT.detail %>
22
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-bricks/form",
3
- "version": "0.11.3",
3
+ "version": "0.12.1",
4
4
  "homepage": "https://github.com/easyops-cn/next-bricks/tree/master/bricks/form",
5
5
  "repository": {
6
6
  "type": "git",
@@ -37,5 +37,5 @@
37
37
  "@next-core/build-next-bricks": "^1.13.2",
38
38
  "@next-core/test-next": "^1.0.7"
39
39
  },
40
- "gitHead": "f1d29ebf93aac3b9e3a9ffbed716a15e0476b876"
40
+ "gitHead": "dac6b6cc81d6456ebe70ad06ed98364d0b6fc412"
41
41
  }