iglooform 2.5.29 → 2.5.31

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.
@@ -1,8 +1,8 @@
1
- import { FC } from 'react';
1
+ import { FC, ReactNode } from 'react';
2
2
  import './style/index';
3
3
  interface ICard {
4
4
  title: string;
5
- contentTitle?: string;
5
+ contentTitle?: ReactNode;
6
6
  contentStatus?: any;
7
7
  className?: string;
8
8
  }
@@ -16,12 +16,14 @@ import id from './id-ID';
16
16
  import vi from './vi-VN';
17
17
  import th from './th-TH';
18
18
  import zhTW from './zh-TW';
19
+ import my from './ms-MY';
19
20
  import antdId from 'antd/es/locale/id_ID';
20
21
  import antdEn from 'antd/es/locale/en_US';
21
22
  import antdZh from 'antd/es/locale/zh_CN';
22
23
  import antdVi from 'antd/es/locale/vi_VN';
23
24
  import antdTH from 'antd/es/locale/th_TH';
24
25
  import antdZhTw from 'antd/es/locale/zh_TW';
26
+ import antdMY from 'antd/es/locale/ms_MY';
25
27
  import antdDefault from 'antd/es/locale/default';
26
28
  import { staticLang } from './format-message';
27
29
  export var locales = {
@@ -30,7 +32,8 @@ export var locales = {
30
32
  'zh-CN': zh,
31
33
  'vi-VN': vi,
32
34
  'th-TH': th,
33
- 'zh-TW': zhTW
35
+ 'zh-TW': zhTW,
36
+ 'ms-MY': my
34
37
  };
35
38
  var antdLocale = {
36
39
  'en-US': _objectSpread(_objectSpread({}, antdDefault), antdEn),
@@ -38,7 +41,8 @@ var antdLocale = {
38
41
  'zh-CN': _objectSpread(_objectSpread({}, antdDefault), antdZh),
39
42
  'vi-VN': _objectSpread(_objectSpread({}, antdDefault), antdVi),
40
43
  'th-TH': _objectSpread(_objectSpread({}, antdDefault), antdTH),
41
- 'zh-TW': _objectSpread(_objectSpread({}, antdDefault), antdZhTw)
44
+ 'zh-TW': _objectSpread(_objectSpread({}, antdDefault), antdZhTw),
45
+ 'ms-MY': _objectSpread(_objectSpread({}, antdDefault), antdMY)
42
46
  };
43
47
 
44
48
  var LocaleProvider = function LocaleProvider(_ref) {
@@ -0,0 +1,94 @@
1
+ {
2
+ "1 file attached.": "1 fail disertakan",
3
+ "1 file imported.": "1 fail diimport",
4
+ "1 file in progress...": "1 fail dalam progress",
5
+ "Accept": "Terima",
6
+ "Action": "Tindakan",
7
+ "Add": "Menambah",
8
+ "Apply": "Memohon",
9
+ "Apply Columns": "Ruang Memohon",
10
+ "Cancel": "Batal",
11
+ "Clear All": "Kosongkan semua",
12
+ "Click to cancel sorting": "Klik untuk membatalkan pengisihan",
13
+ "Click to sort ascending": "Klik untuk menyusun secara menaik",
14
+ "Click to sort descending": "Klik untuk menyusun secara menurun",
15
+ "Close Result Panel": "Tutup Panel Keputusan",
16
+ "Continue": "Sambung",
17
+ "Credit card must be {typeNames} or {finalName}": "Kad kredit mestilah {typeNames} atau {finalName}",
18
+ "Custom": "Kustom",
19
+ "Customize Columns": "Penyesuaian Ruangan",
20
+ "Data Importing Queue": "Giliran Mengimport Data",
21
+ "Data Processed": "Data telah diprocess",
22
+ "Data Processing...": "Data sedang diprocess",
23
+ "Date": "Tarikh",
24
+ "Drag and drop a file here": "Seret dan lepaskan fail disini",
25
+ "Edit": "Edit",
26
+ "Error Report": "Laporan Ralat",
27
+ "Filter": "Tapisan",
28
+ "I declare that the statements I have described above are true. I further declare that the loss occured was accidental, without planning or consensus with other parties.": "Saya mengaku bahawa kenyataan yang saya telah saya nyatakan di atas adalah benar. Saya seterusnya mengisytiharkan bahawa kerugian yang berlaku adalah tidak sengaja, tanpa perancangan atau konsensus dengan pihak lain.",
29
+ "Import": "Import",
30
+ "It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.": "Adalah disyorkan untuk memilih tidak lebih daripada {colMax} metrik untuk memastikan piawai setiap ruang dimasukkan.",
31
+ "Last 7 Days": "7 Hari Lepas",
32
+ "Last Day": "Hari Lepas",
33
+ "Last Month": "Bulan Lepas",
34
+ "Log in": "Daftar masuk",
35
+ "Next": "Seterusnya",
36
+ "No preview for this file. Only support image, video or PDF file.": "Tiada pratonton untuk fail ini. Hanya menyokong imej, video atau fail PDF.",
37
+ "Numbers only, please omit \" \" or \"-\".": "Nombor sahaja, sila tinggalkan \" \" atau \"-\".",
38
+ "OK": "OK",
39
+ "Once you’re happy with the above, and you’ve checked the declaration, please go ahead and submit your claim.": "Sebaik sahaja anda berpuas hati dengan maklumat di atas dan anda telah menyemak deklarasi, anda boleh terus mengemukakan tuntutan anda.",
40
+ "Optional": "Pilihan",
41
+ "Please enter a valid date.": "Sila masukkan tarikh yang sah.",
42
+ "Please enter a valid time.": "Sila masukkan waktu yang sah.",
43
+ "Please select": "Sila pilih",
44
+ "Please select a file type": "Sila pilih jenis fail",
45
+ "Please take a moment to review what you’ve told us above.": "Sila luangkan masa untuk menyemak maklumat yang telah dikongsi dengan kami di atas.",
46
+ "Previous": "Sebelum",
47
+ "Processing": "Dalam process",
48
+ "Processing progress cannot be updated at the moment. Don’t worry! All your file data are still in progress.": "Pemprosesan progress tidak boleh dikemaskini buat masa ini. Jangan risau! Kesemua fail data anda masih lagi dalam progress.",
49
+ "Quantity of files should be less than {limit}": "Kuantity fail hendaklah kurang daripada {limit}",
50
+ "Reject": "Ditolak",
51
+ "Remove": "Mengeluarkan",
52
+ "Resend OTP": "Hantar semula OTP",
53
+ "Resend in": "Menghantar semula",
54
+ "Reset All Filters": "Tetapkan Semula",
55
+ "Result": "Keputusan",
56
+ "Result: Success {success_num}; Error {fail_num}": "Keputusan: Berjaya {success_num}; Ralat {fail_num}",
57
+ "Rows per page": "Baris setiap halaman",
58
+ "Select All": "Pilih Semua",
59
+ "Send OTP": "Hantar OTP",
60
+ "Submit": "Hantar",
61
+ "The file type is not supported.": "Jenis fail yang tidak disokong",
62
+ "This Month": "Bulan ini",
63
+ "Unselect All": "Nyahpilih semua",
64
+ "Uploading": "Memuatnaik",
65
+ "We support CSV or XLSX files (less than 20M each).": "Kami menyokong fail CSV atau XLSX (kurang daripada 20M setiap satu)",
66
+ "Yes, Close": "Ya, Tutup",
67
+ "browse": "Layari",
68
+ "or": "atau",
69
+ "{beginIndex}-{endIndex} of {total}": "{beginIndex}-{endIndex} daripada {total}",
70
+ "{canInputNum} characters left": "{canInputNum} karakter yang tinggal",
71
+ "{canInputNum} characters over": "{canInputNum} lebih karakter",
72
+ "{count} files attached.": "count} fail yang dilampirkan",
73
+ "{currentStep} of {allSteps}": "{currentStep} daripada {allSteps}",
74
+ "{doneNumber} files imported.": "{doneNumber} fail yang diimport.",
75
+ "{processingNumber} files in progress...": "{processingNumber} fail dalam progress...",
76
+ "Done": "Selesai",
77
+ "I agree to the Igloo": "Saya bersetuju dengan Igloo",
78
+ "Once you’re happy with the above, and you’ve checked the box below, please go ahead and submit your activation.": "Sebaik sahaja anda berpuas hati dengan maklumat di atas dan anda telah menandakan kotak dibawah, anda boleh terus mengemukakan pengaktifan.",
79
+ "Other Reason": "Lain-lain sebab",
80
+ "Please input a date after {date}": "Sila masukkan tarikh selepas {date}",
81
+ "Please input a date before {date}": "Sila masukkan tarikh sebelum {date}",
82
+ "Please read and agree to Igloo Terms of Use and Privacy Policy": "Sila baca dan bersetuju dengan Terma Penggunaan dan Dasar Privasi Igloo",
83
+ "Privacy Policy": "Dasar Privasi",
84
+ "Review and Submit": "Semak dan Hantar",
85
+ "Search": "Carian",
86
+ "Searching...": "Mencari...",
87
+ "Terms of Use": "Terma Penggunaan",
88
+ "There are no options available currently": "Tiada pilihan lain ketika ini",
89
+ "and": "dan",
90
+ "{label} must be at least {minLength} digits.": "{label} hendaklah sekurang-kurangnya {minLength} digit.",
91
+ "{label} must be less than {maxLength} digits.": "{label} hendaklah kurang daripada {maxLength} digit.",
92
+ "{label} must be {length} digits.": "{label} hendaklah {length} digit.",
93
+ "{label} must be {minLength} - {maxLength} digits.": "{label} hendaklah {minLength} - {maxLength} digit."
94
+ }
@@ -0,0 +1,2 @@
1
+ declare const messages: any;
2
+ export default messages;
@@ -0,0 +1,3 @@
1
+ var messages = require('./ms-MY/messages.json');
2
+
3
+ export default messages;
@@ -310,6 +310,37 @@ var AttachedSelect = Object.assign(optionsHOC(IglooSelect), {
310
310
  });
311
311
 
312
312
  AttachedSelect.formItemPropsHandler = function (config) {
313
+ var options = config.options,
314
+ multiple = config.multiple;
315
+
316
+ var previewFormateForSingleValue = function previewFormateForSingleValue(value) {
317
+ return options === null || options === void 0 ? void 0 : options.reduce(function (displayLabel, option) {
318
+ if (option.value === value) {
319
+ displayLabel = option.label;
320
+ }
321
+
322
+ return displayLabel;
323
+ }, value);
324
+ }; // 多选
325
+
326
+
327
+ var previewFormateForMultipleValue = function previewFormateForMultipleValue(value) {
328
+ var replaceLabel = value.reduce(function (strArr, selectedValue, index) {
329
+ var matched = options === null || options === void 0 ? void 0 : options.filter(function (originOption) {
330
+ return originOption.value === selectedValue;
331
+ });
332
+ if (matched && matched[0]) strArr[index] = matched[0].label;
333
+ return strArr;
334
+ }, value);
335
+ return replaceLabel.join(',');
336
+ };
337
+
338
+ if (options === null || options === void 0 ? void 0 : options.length) {
339
+ return {
340
+ previewFormater: multiple ? previewFormateForMultipleValue : previewFormateForSingleValue
341
+ };
342
+ }
343
+
313
344
  return {};
314
345
  };
315
346
 
@@ -173,6 +173,8 @@
173
173
  }
174
174
 
175
175
  .igloo-table-row:hover {
176
+ position: relative;
177
+ z-index: 9;
176
178
  cursor: pointer;
177
179
  background: #ffffff;
178
180
  box-shadow: 0px 0px 16px rgba(88, 88, 255, 0.16);
package/es/types.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- /// <reference types="react" />
2
1
  /// <reference types="typings" />
3
2
  import { FormItemProps, FormInstance } from 'antd/es/form';
3
+ import { ReactNode } from 'react';
4
4
  import { NamePath } from 'rc-field-form/lib/interface';
5
5
  import { CheckboxOptionType } from 'antd/es/checkbox';
6
6
  import { SelectProps } from 'antd/es/select';
7
+ export { Rule } from 'rc-field-form/lib/interface';
7
8
  export declare type FormItemName = NamePath;
8
9
  export interface FormBasicConfig {
9
10
  className?: string;
@@ -69,7 +70,7 @@ export interface FormItemExtraConfig extends FormItemProps {
69
70
  limit?: number;
70
71
  hideWhenPreview?: boolean;
71
72
  hideWhenEdit?: boolean;
72
- requiredMessage?: string;
73
+ requiredMessage?: string | ReactNode;
73
74
  showOptional?: boolean;
74
75
  previewFormater?(value: any, form?: FormInstance): any;
75
76
  handleNext?(values: any): any;
@@ -140,4 +141,3 @@ export interface IglooComponentProps {
140
141
  [key: string]: string;
141
142
  };
142
143
  }
143
- export {};
@@ -1,5 +1,5 @@
1
1
  import { FormInstance } from 'antd/es/form';
2
- import { FormItemConfig, FormItemExtraConfig, FormItemName, FormItemCopyValue, FormItemSelectValue, FormItemAssert } from '../types';
2
+ import { FormItemConfig, FormItemExtraConfig, FormItemName, FormItemCopyValue, FormItemSelectValue, FormItemAssert, Rule } from '../types';
3
3
  import { NamePath } from 'antd/es/form/interface';
4
4
  export declare const calcNamePath: (parentName: FormItemName | undefined, name: FormItemName | undefined) => (string | number)[];
5
5
  export declare const testAssert: (form: FormInstance, assert: FormItemAssert) => boolean;
@@ -34,7 +34,7 @@ export declare const calcFormItemProps: (config: FormItemConfig, extraProps: For
34
34
  disabled: boolean | undefined;
35
35
  };
36
36
  normalize: ((value: any, prevValue: any, allValues: import("rc-field-form/lib/interface").Store) => any) | undefined;
37
- rules: import("rc-field-form/lib/interface").Rule[];
37
+ rules: Rule[];
38
38
  validateTrigger: string[];
39
39
  label: JSX.Element | null;
40
40
  getValueFromEvent: ((...args: import("rc-field-form/lib/interface").EventArgs) => any) | undefined;
@@ -1,8 +1,8 @@
1
- import { FC } from 'react';
1
+ import { FC, ReactNode } from 'react';
2
2
  import './style/index';
3
3
  interface ICard {
4
4
  title: string;
5
- contentTitle?: string;
5
+ contentTitle?: ReactNode;
6
6
  contentStatus?: any;
7
7
  className?: string;
8
8
  }
@@ -27,6 +27,8 @@ var _thTH = _interopRequireDefault(require("./th-TH"));
27
27
 
28
28
  var _zhTW = _interopRequireDefault(require("./zh-TW"));
29
29
 
30
+ var _msMY = _interopRequireDefault(require("./ms-MY"));
31
+
30
32
  var _id_ID = _interopRequireDefault(require("antd/es/locale/id_ID"));
31
33
 
32
34
  var _en_US = _interopRequireDefault(require("antd/es/locale/en_US"));
@@ -39,6 +41,8 @@ var _th_TH = _interopRequireDefault(require("antd/es/locale/th_TH"));
39
41
 
40
42
  var _zh_TW = _interopRequireDefault(require("antd/es/locale/zh_TW"));
41
43
 
44
+ var _ms_MY = _interopRequireDefault(require("antd/es/locale/ms_MY"));
45
+
42
46
  var _default2 = _interopRequireDefault(require("antd/es/locale/default"));
43
47
 
44
48
  var _formatMessage = require("./format-message");
@@ -57,7 +61,8 @@ var locales = {
57
61
  'zh-CN': _zhCN.default,
58
62
  'vi-VN': _viVN.default,
59
63
  'th-TH': _thTH.default,
60
- 'zh-TW': _zhTW.default
64
+ 'zh-TW': _zhTW.default,
65
+ 'ms-MY': _msMY.default
61
66
  };
62
67
  exports.locales = locales;
63
68
  var antdLocale = {
@@ -66,7 +71,8 @@ var antdLocale = {
66
71
  'zh-CN': _objectSpread(_objectSpread({}, _default2.default), _zh_CN.default),
67
72
  'vi-VN': _objectSpread(_objectSpread({}, _default2.default), _vi_VN.default),
68
73
  'th-TH': _objectSpread(_objectSpread({}, _default2.default), _th_TH.default),
69
- 'zh-TW': _objectSpread(_objectSpread({}, _default2.default), _zh_TW.default)
74
+ 'zh-TW': _objectSpread(_objectSpread({}, _default2.default), _zh_TW.default),
75
+ 'ms-MY': _objectSpread(_objectSpread({}, _default2.default), _ms_MY.default)
70
76
  };
71
77
 
72
78
  var LocaleProvider = function LocaleProvider(_ref) {
@@ -0,0 +1,94 @@
1
+ {
2
+ "1 file attached.": "1 fail disertakan",
3
+ "1 file imported.": "1 fail diimport",
4
+ "1 file in progress...": "1 fail dalam progress",
5
+ "Accept": "Terima",
6
+ "Action": "Tindakan",
7
+ "Add": "Menambah",
8
+ "Apply": "Memohon",
9
+ "Apply Columns": "Ruang Memohon",
10
+ "Cancel": "Batal",
11
+ "Clear All": "Kosongkan semua",
12
+ "Click to cancel sorting": "Klik untuk membatalkan pengisihan",
13
+ "Click to sort ascending": "Klik untuk menyusun secara menaik",
14
+ "Click to sort descending": "Klik untuk menyusun secara menurun",
15
+ "Close Result Panel": "Tutup Panel Keputusan",
16
+ "Continue": "Sambung",
17
+ "Credit card must be {typeNames} or {finalName}": "Kad kredit mestilah {typeNames} atau {finalName}",
18
+ "Custom": "Kustom",
19
+ "Customize Columns": "Penyesuaian Ruangan",
20
+ "Data Importing Queue": "Giliran Mengimport Data",
21
+ "Data Processed": "Data telah diprocess",
22
+ "Data Processing...": "Data sedang diprocess",
23
+ "Date": "Tarikh",
24
+ "Drag and drop a file here": "Seret dan lepaskan fail disini",
25
+ "Edit": "Edit",
26
+ "Error Report": "Laporan Ralat",
27
+ "Filter": "Tapisan",
28
+ "I declare that the statements I have described above are true. I further declare that the loss occured was accidental, without planning or consensus with other parties.": "Saya mengaku bahawa kenyataan yang saya telah saya nyatakan di atas adalah benar. Saya seterusnya mengisytiharkan bahawa kerugian yang berlaku adalah tidak sengaja, tanpa perancangan atau konsensus dengan pihak lain.",
29
+ "Import": "Import",
30
+ "It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.": "Adalah disyorkan untuk memilih tidak lebih daripada {colMax} metrik untuk memastikan piawai setiap ruang dimasukkan.",
31
+ "Last 7 Days": "7 Hari Lepas",
32
+ "Last Day": "Hari Lepas",
33
+ "Last Month": "Bulan Lepas",
34
+ "Log in": "Daftar masuk",
35
+ "Next": "Seterusnya",
36
+ "No preview for this file. Only support image, video or PDF file.": "Tiada pratonton untuk fail ini. Hanya menyokong imej, video atau fail PDF.",
37
+ "Numbers only, please omit \" \" or \"-\".": "Nombor sahaja, sila tinggalkan \" \" atau \"-\".",
38
+ "OK": "OK",
39
+ "Once you’re happy with the above, and you’ve checked the declaration, please go ahead and submit your claim.": "Sebaik sahaja anda berpuas hati dengan maklumat di atas dan anda telah menyemak deklarasi, anda boleh terus mengemukakan tuntutan anda.",
40
+ "Optional": "Pilihan",
41
+ "Please enter a valid date.": "Sila masukkan tarikh yang sah.",
42
+ "Please enter a valid time.": "Sila masukkan waktu yang sah.",
43
+ "Please select": "Sila pilih",
44
+ "Please select a file type": "Sila pilih jenis fail",
45
+ "Please take a moment to review what you’ve told us above.": "Sila luangkan masa untuk menyemak maklumat yang telah dikongsi dengan kami di atas.",
46
+ "Previous": "Sebelum",
47
+ "Processing": "Dalam process",
48
+ "Processing progress cannot be updated at the moment. Don’t worry! All your file data are still in progress.": "Pemprosesan progress tidak boleh dikemaskini buat masa ini. Jangan risau! Kesemua fail data anda masih lagi dalam progress.",
49
+ "Quantity of files should be less than {limit}": "Kuantity fail hendaklah kurang daripada {limit}",
50
+ "Reject": "Ditolak",
51
+ "Remove": "Mengeluarkan",
52
+ "Resend OTP": "Hantar semula OTP",
53
+ "Resend in": "Menghantar semula",
54
+ "Reset All Filters": "Tetapkan Semula",
55
+ "Result": "Keputusan",
56
+ "Result: Success {success_num}; Error {fail_num}": "Keputusan: Berjaya {success_num}; Ralat {fail_num}",
57
+ "Rows per page": "Baris setiap halaman",
58
+ "Select All": "Pilih Semua",
59
+ "Send OTP": "Hantar OTP",
60
+ "Submit": "Hantar",
61
+ "The file type is not supported.": "Jenis fail yang tidak disokong",
62
+ "This Month": "Bulan ini",
63
+ "Unselect All": "Nyahpilih semua",
64
+ "Uploading": "Memuatnaik",
65
+ "We support CSV or XLSX files (less than 20M each).": "Kami menyokong fail CSV atau XLSX (kurang daripada 20M setiap satu)",
66
+ "Yes, Close": "Ya, Tutup",
67
+ "browse": "Layari",
68
+ "or": "atau",
69
+ "{beginIndex}-{endIndex} of {total}": "{beginIndex}-{endIndex} daripada {total}",
70
+ "{canInputNum} characters left": "{canInputNum} karakter yang tinggal",
71
+ "{canInputNum} characters over": "{canInputNum} lebih karakter",
72
+ "{count} files attached.": "count} fail yang dilampirkan",
73
+ "{currentStep} of {allSteps}": "{currentStep} daripada {allSteps}",
74
+ "{doneNumber} files imported.": "{doneNumber} fail yang diimport.",
75
+ "{processingNumber} files in progress...": "{processingNumber} fail dalam progress...",
76
+ "Done": "Selesai",
77
+ "I agree to the Igloo": "Saya bersetuju dengan Igloo",
78
+ "Once you’re happy with the above, and you’ve checked the box below, please go ahead and submit your activation.": "Sebaik sahaja anda berpuas hati dengan maklumat di atas dan anda telah menandakan kotak dibawah, anda boleh terus mengemukakan pengaktifan.",
79
+ "Other Reason": "Lain-lain sebab",
80
+ "Please input a date after {date}": "Sila masukkan tarikh selepas {date}",
81
+ "Please input a date before {date}": "Sila masukkan tarikh sebelum {date}",
82
+ "Please read and agree to Igloo Terms of Use and Privacy Policy": "Sila baca dan bersetuju dengan Terma Penggunaan dan Dasar Privasi Igloo",
83
+ "Privacy Policy": "Dasar Privasi",
84
+ "Review and Submit": "Semak dan Hantar",
85
+ "Search": "Carian",
86
+ "Searching...": "Mencari...",
87
+ "Terms of Use": "Terma Penggunaan",
88
+ "There are no options available currently": "Tiada pilihan lain ketika ini",
89
+ "and": "dan",
90
+ "{label} must be at least {minLength} digits.": "{label} hendaklah sekurang-kurangnya {minLength} digit.",
91
+ "{label} must be less than {maxLength} digits.": "{label} hendaklah kurang daripada {maxLength} digit.",
92
+ "{label} must be {length} digits.": "{label} hendaklah {length} digit.",
93
+ "{label} must be {minLength} - {maxLength} digits.": "{label} hendaklah {minLength} - {maxLength} digit."
94
+ }
@@ -0,0 +1,2 @@
1
+ declare const messages: any;
2
+ export default messages;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var messages = require('./ms-MY/messages.json');
9
+
10
+ var _default = messages;
11
+ exports.default = _default;
@@ -334,6 +334,37 @@ var AttachedSelect = Object.assign((0, _optionUtils.optionsHOC)(IglooSelect), {
334
334
  });
335
335
 
336
336
  AttachedSelect.formItemPropsHandler = function (config) {
337
+ var options = config.options,
338
+ multiple = config.multiple;
339
+
340
+ var previewFormateForSingleValue = function previewFormateForSingleValue(value) {
341
+ return options === null || options === void 0 ? void 0 : options.reduce(function (displayLabel, option) {
342
+ if (option.value === value) {
343
+ displayLabel = option.label;
344
+ }
345
+
346
+ return displayLabel;
347
+ }, value);
348
+ }; // 多选
349
+
350
+
351
+ var previewFormateForMultipleValue = function previewFormateForMultipleValue(value) {
352
+ var replaceLabel = value.reduce(function (strArr, selectedValue, index) {
353
+ var matched = options === null || options === void 0 ? void 0 : options.filter(function (originOption) {
354
+ return originOption.value === selectedValue;
355
+ });
356
+ if (matched && matched[0]) strArr[index] = matched[0].label;
357
+ return strArr;
358
+ }, value);
359
+ return replaceLabel.join(',');
360
+ };
361
+
362
+ if (options === null || options === void 0 ? void 0 : options.length) {
363
+ return {
364
+ previewFormater: multiple ? previewFormateForMultipleValue : previewFormateForSingleValue
365
+ };
366
+ }
367
+
337
368
  return {};
338
369
  };
339
370
 
@@ -173,6 +173,8 @@
173
173
  }
174
174
 
175
175
  .igloo-table-row:hover {
176
+ position: relative;
177
+ z-index: 9;
176
178
  cursor: pointer;
177
179
  background: #ffffff;
178
180
  box-shadow: 0px 0px 16px rgba(88, 88, 255, 0.16);
package/lib/types.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- /// <reference types="react" />
2
1
  /// <reference types="typings" />
3
2
  import { FormItemProps, FormInstance } from 'antd/es/form';
3
+ import { ReactNode } from 'react';
4
4
  import { NamePath } from 'rc-field-form/lib/interface';
5
5
  import { CheckboxOptionType } from 'antd/es/checkbox';
6
6
  import { SelectProps } from 'antd/es/select';
7
+ export { Rule } from 'rc-field-form/lib/interface';
7
8
  export declare type FormItemName = NamePath;
8
9
  export interface FormBasicConfig {
9
10
  className?: string;
@@ -69,7 +70,7 @@ export interface FormItemExtraConfig extends FormItemProps {
69
70
  limit?: number;
70
71
  hideWhenPreview?: boolean;
71
72
  hideWhenEdit?: boolean;
72
- requiredMessage?: string;
73
+ requiredMessage?: string | ReactNode;
73
74
  showOptional?: boolean;
74
75
  previewFormater?(value: any, form?: FormInstance): any;
75
76
  handleNext?(values: any): any;
@@ -140,4 +141,3 @@ export interface IglooComponentProps {
140
141
  [key: string]: string;
141
142
  };
142
143
  }
143
- export {};
@@ -1,5 +1,5 @@
1
1
  import { FormInstance } from 'antd/es/form';
2
- import { FormItemConfig, FormItemExtraConfig, FormItemName, FormItemCopyValue, FormItemSelectValue, FormItemAssert } from '../types';
2
+ import { FormItemConfig, FormItemExtraConfig, FormItemName, FormItemCopyValue, FormItemSelectValue, FormItemAssert, Rule } from '../types';
3
3
  import { NamePath } from 'antd/es/form/interface';
4
4
  export declare const calcNamePath: (parentName: FormItemName | undefined, name: FormItemName | undefined) => (string | number)[];
5
5
  export declare const testAssert: (form: FormInstance, assert: FormItemAssert) => boolean;
@@ -34,7 +34,7 @@ export declare const calcFormItemProps: (config: FormItemConfig, extraProps: For
34
34
  disabled: boolean | undefined;
35
35
  };
36
36
  normalize: ((value: any, prevValue: any, allValues: import("rc-field-form/lib/interface").Store) => any) | undefined;
37
- rules: import("rc-field-form/lib/interface").Rule[];
37
+ rules: Rule[];
38
38
  validateTrigger: string[];
39
39
  label: JSX.Element | null;
40
40
  getValueFromEvent: ((...args: import("rc-field-form/lib/interface").EventArgs) => any) | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iglooform",
3
- "version": "2.5.29",
3
+ "version": "2.5.31",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "build-dev": "dumi build",