@cloudtower/eagle 0.22.40 → 0.23.0
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/components/TableForm/Columns/AffixColumn.d.ts +1 -1
- package/dist/components/TableForm/Columns/CheckboxColumn.d.ts +6 -3
- package/dist/components/TableForm/Columns/InputColumn.d.ts +3 -3
- package/dist/components/TableForm/Columns/TextColumn.d.ts +1 -1
- package/dist/components/TableForm/Columns/index.d.ts +15 -13
- package/dist/components/TableForm/types.d.ts +27 -12
- package/dist/esm/index.js +189 -112
- package/dist/esm/stats1.html +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/style.css +1145 -1120
- package/dist/umd/index.js +188 -110
- package/dist/umd/stats1.html +1 -1
- package/package.json +5 -5
package/dist/esm/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { isElement } from 'react-is';
|
|
|
13
13
|
import { CloseCircleFilled, CheckOutlined, SearchOutlined, PlusOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons';
|
|
14
14
|
import { combineReducers, createStore } from 'redux';
|
|
15
15
|
import { createDispatchHook, createSelectorHook, Provider } from 'react-redux';
|
|
16
|
-
import {
|
|
16
|
+
import { XmarkRemove16SecondaryIcon, XmarkRemove16RegularRedIcon, HandlePoint816SecondaryIcon, HandlePoint816BlueIcon, CheckmarkDoneSuccessCorrect16BlueIcon } from '@cloudtower/icons-react';
|
|
17
17
|
import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
|
|
18
18
|
import TimeZones from 'timezones.json';
|
|
19
19
|
import { withTranslation } from 'react-i18next';
|
|
@@ -3636,6 +3636,15 @@ const AffixColumnHeaderCell = ({ data, column, onChange, onBlur }) => {
|
|
|
3636
3636
|
) : void 0);
|
|
3637
3637
|
};
|
|
3638
3638
|
|
|
3639
|
+
const CheckboxColumnHeaderCell = ({ onChange }) => {
|
|
3640
|
+
const _onChange = useCallback(
|
|
3641
|
+
(e) => {
|
|
3642
|
+
onChange(e.target.checked, true);
|
|
3643
|
+
},
|
|
3644
|
+
[onChange]
|
|
3645
|
+
);
|
|
3646
|
+
return /* @__PURE__ */ React.createElement(Checkbox$1, { onChange: _onChange });
|
|
3647
|
+
};
|
|
3639
3648
|
const CheckboxColumnBodyCell = ({ data, column, index, onChange }) => {
|
|
3640
3649
|
const value = data[index][column.key] === void 0 ? column.defaultValue : data[index][column.key];
|
|
3641
3650
|
const _onChange = useCallback(
|
|
@@ -3773,11 +3782,7 @@ const TextColumnHeaderCell = ({
|
|
|
3773
3782
|
column.subTitle
|
|
3774
3783
|
);
|
|
3775
3784
|
};
|
|
3776
|
-
const TextColumnBodyCell = ({
|
|
3777
|
-
data,
|
|
3778
|
-
column,
|
|
3779
|
-
index
|
|
3780
|
-
}) => {
|
|
3785
|
+
const TextColumnBodyCell = ({ data, column, index }) => {
|
|
3781
3786
|
const text = column.displayText || data[index][column.key];
|
|
3782
3787
|
const CellDescription = useMemo(() => {
|
|
3783
3788
|
var _a, _b;
|
|
@@ -3806,7 +3811,7 @@ const ColumnHeaderImpls = {
|
|
|
3806
3811
|
input: InputColumnHeaderCell,
|
|
3807
3812
|
password: InputColumnHeaderCell,
|
|
3808
3813
|
affix: AffixColumnHeaderCell,
|
|
3809
|
-
checkbox:
|
|
3814
|
+
checkbox: CheckboxColumnHeaderCell
|
|
3810
3815
|
};
|
|
3811
3816
|
const ColumnBodyImpls = {
|
|
3812
3817
|
text: TextColumnBodyCell,
|
|
@@ -3826,10 +3831,17 @@ const FormItem = props => {
|
|
|
3826
3831
|
return /* @__PURE__ */React.createElement(Form.Item, {
|
|
3827
3832
|
className: FormItemStyle,
|
|
3828
3833
|
validateStatus,
|
|
3829
|
-
help: validateStatus ? message :
|
|
3834
|
+
help: validateStatus && message ? message : void 0
|
|
3830
3835
|
}, children);
|
|
3831
3836
|
};
|
|
3832
3837
|
|
|
3838
|
+
var ValidateTriggerType = /* @__PURE__ */ ((ValidateTriggerType2) => {
|
|
3839
|
+
ValidateTriggerType2[ValidateTriggerType2["Normal"] = 0] = "Normal";
|
|
3840
|
+
ValidateTriggerType2[ValidateTriggerType2["Aggressive"] = 1] = "Aggressive";
|
|
3841
|
+
ValidateTriggerType2[ValidateTriggerType2["Lazy"] = 2] = "Lazy";
|
|
3842
|
+
return ValidateTriggerType2;
|
|
3843
|
+
})(ValidateTriggerType || {});
|
|
3844
|
+
|
|
3833
3845
|
var __defProp$5 = Object.defineProperty;
|
|
3834
3846
|
var __defProps$5 = Object.defineProperties;
|
|
3835
3847
|
var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
|
|
@@ -3852,40 +3864,77 @@ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
|
|
|
3852
3864
|
const TableFormBodyCell = (props) => {
|
|
3853
3865
|
const {
|
|
3854
3866
|
column,
|
|
3855
|
-
disabled,
|
|
3856
3867
|
index: rowIndex,
|
|
3857
3868
|
data,
|
|
3858
|
-
onChange,
|
|
3859
3869
|
latestData,
|
|
3870
|
+
validateTriggerType,
|
|
3860
3871
|
isRowError,
|
|
3861
|
-
|
|
3872
|
+
getRowValidateResult,
|
|
3873
|
+
disabled,
|
|
3874
|
+
onChange,
|
|
3875
|
+
onBlur,
|
|
3876
|
+
validateAll
|
|
3862
3877
|
} = props;
|
|
3878
|
+
const [validateResult, setValidateResult] = useState();
|
|
3879
|
+
const isTouched = useRef(false);
|
|
3863
3880
|
const width = typeof column.width === "number" ? column.width + "px" : column.width;
|
|
3864
|
-
const
|
|
3865
|
-
(
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
);
|
|
3869
|
-
|
|
3881
|
+
const triggerValidate = useCallback(
|
|
3882
|
+
(currentValue) => {
|
|
3883
|
+
var _a;
|
|
3884
|
+
const value = currentValue || data[rowIndex][column.key];
|
|
3885
|
+
const rowData = __spreadProps$5(__spreadValues$5({}, data[rowIndex]), { [column.key]: value });
|
|
3886
|
+
const rowValidateRes = getRowValidateResult(rowData);
|
|
3887
|
+
if (rowValidateRes) {
|
|
3888
|
+
return;
|
|
3889
|
+
}
|
|
3890
|
+
const result = (_a = column.validator) == null ? void 0 : _a.call(column, {
|
|
3891
|
+
value,
|
|
3892
|
+
rowIndex,
|
|
3893
|
+
rowData: data[rowIndex]
|
|
3894
|
+
});
|
|
3895
|
+
const isError = result ? typeof result === "string" : false;
|
|
3896
|
+
setValidateResult({ msg: result || "", isError });
|
|
3870
3897
|
},
|
|
3871
|
-
[
|
|
3898
|
+
[data, column, rowIndex, getRowValidateResult]
|
|
3872
3899
|
);
|
|
3900
|
+
useEffect(() => {
|
|
3901
|
+
if (validateAll) {
|
|
3902
|
+
isTouched.current = true;
|
|
3903
|
+
triggerValidate();
|
|
3904
|
+
}
|
|
3905
|
+
}, [validateAll, triggerValidate]);
|
|
3906
|
+
const _onChange = (value, data2) => {
|
|
3907
|
+
const newData = data2.map(
|
|
3908
|
+
(row, i) => i === rowIndex ? __spreadProps$5(__spreadValues$5({}, row), { [column.key]: value }) : row
|
|
3909
|
+
);
|
|
3910
|
+
onChange == null ? void 0 : onChange(newData, rowIndex, column.key);
|
|
3911
|
+
if (validateTriggerType === ValidateTriggerType.Normal && isTouched.current || validateTriggerType === ValidateTriggerType.Aggressive) {
|
|
3912
|
+
triggerValidate(value);
|
|
3913
|
+
}
|
|
3914
|
+
};
|
|
3873
3915
|
const _onBlur = useCallback(() => {
|
|
3916
|
+
isTouched.current = true;
|
|
3917
|
+
triggerValidate();
|
|
3874
3918
|
onBlur == null ? void 0 : onBlur(data, rowIndex, column.key);
|
|
3875
|
-
}, [rowIndex, column, onBlur, data]);
|
|
3919
|
+
}, [rowIndex, column, onBlur, data, triggerValidate]);
|
|
3876
3920
|
const renderDefaultComponent = () => {
|
|
3877
3921
|
if (!column.type)
|
|
3878
3922
|
return null;
|
|
3879
3923
|
const CellComponent = ColumnBodyImpls[column.type];
|
|
3880
3924
|
return /* @__PURE__ */ React.createElement(
|
|
3881
3925
|
CellComponent,
|
|
3882
|
-
|
|
3883
|
-
|
|
3926
|
+
{
|
|
3927
|
+
disabled,
|
|
3928
|
+
data,
|
|
3929
|
+
index: rowIndex,
|
|
3930
|
+
latestData,
|
|
3931
|
+
column,
|
|
3932
|
+
visible: props.visible,
|
|
3884
3933
|
onChange: (val) => {
|
|
3885
3934
|
_onChange(val, data);
|
|
3886
3935
|
},
|
|
3887
3936
|
onBlur: _onBlur
|
|
3888
|
-
}
|
|
3937
|
+
}
|
|
3889
3938
|
);
|
|
3890
3939
|
};
|
|
3891
3940
|
const Cell = column.render ? column.render({
|
|
@@ -3910,24 +3959,6 @@ const TableFormBodyCell = (props) => {
|
|
|
3910
3959
|
})) || null;
|
|
3911
3960
|
return typeof Result === "string" ? /* @__PURE__ */ React.createElement("p", { className: cx(Typo.Label.l4_regular, "cell-description") }, Result) : Result;
|
|
3912
3961
|
}, [rowIndex, data, latestData, column]);
|
|
3913
|
-
const validateResult = useMemo(() => {
|
|
3914
|
-
var _a;
|
|
3915
|
-
if (isRowError) {
|
|
3916
|
-
return {
|
|
3917
|
-
msg: "",
|
|
3918
|
-
isError: true
|
|
3919
|
-
};
|
|
3920
|
-
}
|
|
3921
|
-
const value = data[rowIndex][column.key];
|
|
3922
|
-
const result = (_a = column.validator) == null ? void 0 : _a.call(column, {
|
|
3923
|
-
value,
|
|
3924
|
-
rowIndex,
|
|
3925
|
-
rowData: data[rowIndex]
|
|
3926
|
-
});
|
|
3927
|
-
if (typeof result === "string" && result) {
|
|
3928
|
-
return { msg: result, isError: true };
|
|
3929
|
-
}
|
|
3930
|
-
}, [data, column, rowIndex, isRowError]);
|
|
3931
3962
|
return /* @__PURE__ */ React.createElement(
|
|
3932
3963
|
"div",
|
|
3933
3964
|
{
|
|
@@ -3941,8 +3972,8 @@ const TableFormBodyCell = (props) => {
|
|
|
3941
3972
|
/* @__PURE__ */ React.createElement(
|
|
3942
3973
|
FormItem,
|
|
3943
3974
|
{
|
|
3944
|
-
validateStatus: (validateResult == null ? void 0 : validateResult.isError) ? "error" : "",
|
|
3945
|
-
message:
|
|
3975
|
+
validateStatus: isRowError || (validateResult == null ? void 0 : validateResult.isError) ? "error" : "",
|
|
3976
|
+
message: isRowError ? "" : validateResult == null ? void 0 : validateResult.msg
|
|
3946
3977
|
},
|
|
3947
3978
|
Cell
|
|
3948
3979
|
),
|
|
@@ -3976,24 +4007,35 @@ const TableFormRow = (props) => {
|
|
|
3976
4007
|
latestData,
|
|
3977
4008
|
disabled,
|
|
3978
4009
|
passwordVisible,
|
|
3979
|
-
|
|
4010
|
+
deleteConfig,
|
|
3980
4011
|
draggable,
|
|
3981
4012
|
rowIndex,
|
|
3982
4013
|
provided,
|
|
3983
4014
|
snapshot,
|
|
4015
|
+
validateTriggerType = ValidateTriggerType.Normal,
|
|
3984
4016
|
updateData,
|
|
3985
4017
|
onBodyBlur,
|
|
3986
4018
|
renderRowDescription,
|
|
3987
|
-
rowValidator
|
|
4019
|
+
rowValidator,
|
|
4020
|
+
validateAll
|
|
3988
4021
|
} = props;
|
|
3989
4022
|
const rowData = data[rowIndex];
|
|
3990
|
-
const
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
4023
|
+
const [rowError, setRowError] = useState();
|
|
4024
|
+
const deleteRow = useCallback(
|
|
4025
|
+
(index, data2) => {
|
|
4026
|
+
const newData = [...data2];
|
|
4027
|
+
newData.splice(index, 1);
|
|
4028
|
+
updateData(newData);
|
|
4029
|
+
},
|
|
4030
|
+
[updateData]
|
|
4031
|
+
);
|
|
4032
|
+
const RowActions = useMemo(() => {
|
|
4033
|
+
var _a;
|
|
4034
|
+
const isRowDeleteDisabled = (_a = deleteConfig == null ? void 0 : deleteConfig.specifyRowDeleteDisabled) == null ? void 0 : _a.call(
|
|
4035
|
+
deleteConfig,
|
|
4036
|
+
rowIndex,
|
|
4037
|
+
data
|
|
4038
|
+
);
|
|
3997
4039
|
const DeleteIcon = /* @__PURE__ */ React.createElement(
|
|
3998
4040
|
Icon,
|
|
3999
4041
|
{
|
|
@@ -4003,20 +4045,21 @@ const TableFormRow = (props) => {
|
|
|
4003
4045
|
onClick: () => {
|
|
4004
4046
|
if (isRowDeleteDisabled)
|
|
4005
4047
|
return;
|
|
4006
|
-
deleteRow(
|
|
4048
|
+
deleteRow(rowIndex, data);
|
|
4007
4049
|
}
|
|
4008
4050
|
}
|
|
4009
4051
|
);
|
|
4010
4052
|
const FinalRenderIcon = isRowDeleteDisabled ? DeleteIcon : /* @__PURE__ */ React.createElement(Tooltip, { title: parrotI18n.t("components.remove") }, DeleteIcon);
|
|
4011
|
-
return deletable ? [FinalRenderIcon] : void 0;
|
|
4012
|
-
};
|
|
4013
|
-
const
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4053
|
+
return (deleteConfig == null ? void 0 : deleteConfig.deletable) ? [FinalRenderIcon] : void 0;
|
|
4054
|
+
}, [rowIndex, deleteConfig, data, deleteRow]);
|
|
4055
|
+
const getRowValidateResult = useCallback(
|
|
4056
|
+
(rowData2) => {
|
|
4057
|
+
const result = rowValidator == null ? void 0 : rowValidator(rowIndex, rowData2);
|
|
4058
|
+
setRowError(result);
|
|
4059
|
+
return result;
|
|
4060
|
+
},
|
|
4061
|
+
[rowValidator, rowIndex]
|
|
4062
|
+
);
|
|
4020
4063
|
const Cells = columns.map((col) => {
|
|
4021
4064
|
return /* @__PURE__ */ React.createElement(
|
|
4022
4065
|
TableFormBodyCell,
|
|
@@ -4030,7 +4073,10 @@ const TableFormRow = (props) => {
|
|
|
4030
4073
|
onChange: updateData,
|
|
4031
4074
|
onBlur: onBodyBlur,
|
|
4032
4075
|
visible: passwordVisible,
|
|
4033
|
-
|
|
4076
|
+
validateTriggerType,
|
|
4077
|
+
isRowError: !!rowError,
|
|
4078
|
+
getRowValidateResult,
|
|
4079
|
+
validateAll
|
|
4034
4080
|
}
|
|
4035
4081
|
);
|
|
4036
4082
|
});
|
|
@@ -4060,11 +4106,11 @@ const TableFormRow = (props) => {
|
|
|
4060
4106
|
"eagle-table-form-row",
|
|
4061
4107
|
(snapshot == null ? void 0 : snapshot.isDragging) && "isDragging"
|
|
4062
4108
|
),
|
|
4063
|
-
actions:
|
|
4109
|
+
actions: RowActions
|
|
4064
4110
|
},
|
|
4065
4111
|
DraggableHandle,
|
|
4066
4112
|
Cells,
|
|
4067
|
-
|
|
4113
|
+
rowError ? /* @__PURE__ */ React.createElement("p", { className: cx(Typo.Label.l4_regular, "row-error-message") }, rowError) : null,
|
|
4068
4114
|
RowDescription
|
|
4069
4115
|
);
|
|
4070
4116
|
};
|
|
@@ -4132,7 +4178,7 @@ const BatchInputListHeaderCell = (props) => {
|
|
|
4132
4178
|
const [errMsg, setErrMsg] = useState();
|
|
4133
4179
|
const width = Number.isNaN(Number(column.width)) ? column.width : column.width + "px";
|
|
4134
4180
|
const headerOnChange = useCallback(
|
|
4135
|
-
(value) => {
|
|
4181
|
+
(value, shouldUpdateData = false) => {
|
|
4136
4182
|
var _a;
|
|
4137
4183
|
const err = (_a = column.validator) == null ? void 0 : _a.call(column, { value, isHeader: true });
|
|
4138
4184
|
setErrMsg(err || void 0);
|
|
@@ -4142,7 +4188,7 @@ const BatchInputListHeaderCell = (props) => {
|
|
|
4142
4188
|
[column.key]: shouldAutoIncrease && typeof value === "string" ? increaseLastNumber(value, rowIndex) : value
|
|
4143
4189
|
});
|
|
4144
4190
|
});
|
|
4145
|
-
onChange == null ? void 0 : onChange(newData, column.key);
|
|
4191
|
+
onChange == null ? void 0 : onChange(newData, column.key, shouldUpdateData);
|
|
4146
4192
|
},
|
|
4147
4193
|
[onChange, data, column]
|
|
4148
4194
|
);
|
|
@@ -4178,14 +4224,14 @@ const BatchInputListHeaderCell = (props) => {
|
|
|
4178
4224
|
visibility: column.hidden ? "hidden" : "visible"
|
|
4179
4225
|
}
|
|
4180
4226
|
},
|
|
4181
|
-
/* @__PURE__ */ React.createElement(
|
|
4227
|
+
/* @__PURE__ */ React.createElement("p", { className: cx(Typo.Label.l3_bold_title, TitleStyle) }, column.title),
|
|
4228
|
+
disableBatchFilling ? null : /* @__PURE__ */ React.createElement(
|
|
4182
4229
|
FormItem,
|
|
4183
4230
|
{
|
|
4184
4231
|
validateStatus: typeof errMsg === "string" && errMsg ? "error" : "",
|
|
4185
4232
|
message: errMsg || void 0
|
|
4186
4233
|
},
|
|
4187
|
-
|
|
4188
|
-
disableBatchFilling ? null : renderCell()
|
|
4234
|
+
renderCell()
|
|
4189
4235
|
)
|
|
4190
4236
|
);
|
|
4191
4237
|
};
|
|
@@ -4212,16 +4258,18 @@ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
|
4212
4258
|
const DEFAULT_ROW_COUNT = 3;
|
|
4213
4259
|
const TableForm = React.forwardRef(
|
|
4214
4260
|
({
|
|
4215
|
-
defaultData,
|
|
4261
|
+
defaultData = [],
|
|
4216
4262
|
columns,
|
|
4217
4263
|
disabled,
|
|
4218
4264
|
rowAddConfig,
|
|
4219
|
-
|
|
4265
|
+
deleteConfig,
|
|
4220
4266
|
size = "default",
|
|
4221
4267
|
className,
|
|
4222
4268
|
draggable,
|
|
4223
4269
|
disableBatchFilling = false,
|
|
4224
4270
|
rowSplitType = "border",
|
|
4271
|
+
validateTriggerType,
|
|
4272
|
+
maxHeight,
|
|
4225
4273
|
renderRowDescription,
|
|
4226
4274
|
rowValidator,
|
|
4227
4275
|
onHeaderChange,
|
|
@@ -4229,12 +4277,10 @@ const TableForm = React.forwardRef(
|
|
|
4229
4277
|
onBodyChange,
|
|
4230
4278
|
onBodyBlur
|
|
4231
4279
|
}, ref) => {
|
|
4232
|
-
const
|
|
4233
|
-
return defaultData || [...Array(DEFAULT_ROW_COUNT)].map(() => genEmptyRow(columns));
|
|
4234
|
-
}, [defaultData, columns]);
|
|
4235
|
-
const [data, setData] = useState(treatedDefaultData);
|
|
4280
|
+
const [data, setData] = useState(defaultData);
|
|
4236
4281
|
const [passwordVisible, setPasswordVisible] = useState(false);
|
|
4237
|
-
const [latestData, setLatestData] = useState(
|
|
4282
|
+
const [latestData, setLatestData] = useState(defaultData);
|
|
4283
|
+
const [validateAll, setValidateAll] = useState(false);
|
|
4238
4284
|
const updateData = useCallback(
|
|
4239
4285
|
(value, rowIndex, columnKey) => {
|
|
4240
4286
|
setLatestData(value);
|
|
@@ -4243,12 +4289,23 @@ const TableForm = React.forwardRef(
|
|
|
4243
4289
|
},
|
|
4244
4290
|
[onBodyChange]
|
|
4245
4291
|
);
|
|
4292
|
+
useLayoutEffect(() => {
|
|
4293
|
+
if (defaultData.length === 0) {
|
|
4294
|
+
updateData(
|
|
4295
|
+
[...Array(DEFAULT_ROW_COUNT)].map(() => genEmptyRow(columns))
|
|
4296
|
+
);
|
|
4297
|
+
}
|
|
4298
|
+
}, []);
|
|
4246
4299
|
const handleBatchChange = useCallback(
|
|
4247
|
-
(newData, columnKey) => {
|
|
4300
|
+
(newData, columnKey, shouldUpdateData) => {
|
|
4248
4301
|
setLatestData(newData);
|
|
4249
4302
|
onHeaderChange == null ? void 0 : onHeaderChange(newData, columnKey);
|
|
4303
|
+
if (shouldUpdateData) {
|
|
4304
|
+
setData(newData);
|
|
4305
|
+
onBodyChange == null ? void 0 : onBodyChange(newData, void 0, columnKey);
|
|
4306
|
+
}
|
|
4250
4307
|
},
|
|
4251
|
-
[onHeaderChange]
|
|
4308
|
+
[onHeaderChange, onBodyChange]
|
|
4252
4309
|
);
|
|
4253
4310
|
const handleBatchBlur = useCallback(
|
|
4254
4311
|
(key, error) => {
|
|
@@ -4273,6 +4330,9 @@ const TableForm = React.forwardRef(
|
|
|
4273
4330
|
() => ({
|
|
4274
4331
|
setData: (data2) => {
|
|
4275
4332
|
updateData(data2);
|
|
4333
|
+
},
|
|
4334
|
+
validateWholeFields() {
|
|
4335
|
+
setValidateAll(true);
|
|
4276
4336
|
}
|
|
4277
4337
|
}),
|
|
4278
4338
|
[updateData]
|
|
@@ -4293,31 +4353,46 @@ const TableForm = React.forwardRef(
|
|
|
4293
4353
|
}
|
|
4294
4354
|
);
|
|
4295
4355
|
});
|
|
4296
|
-
|
|
4297
|
-
|
|
4356
|
+
const tableFormWrapperStyle = useMemo(
|
|
4357
|
+
() => maxHeight ? {
|
|
4358
|
+
maxHeight: typeof maxHeight === "number" ? maxHeight + "px" : maxHeight
|
|
4359
|
+
} : void 0,
|
|
4360
|
+
[]
|
|
4361
|
+
);
|
|
4362
|
+
return /* @__PURE__ */ React.createElement("div", { className }, /* @__PURE__ */ React.createElement(
|
|
4363
|
+
TableFormWrapper,
|
|
4298
4364
|
{
|
|
4299
|
-
className:
|
|
4300
|
-
|
|
4365
|
+
className: `table-form row-split-by-${rowSplitType}`,
|
|
4366
|
+
style: tableFormWrapperStyle
|
|
4301
4367
|
},
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4368
|
+
/* @__PURE__ */ React.createElement(List, { size, className: `size-${size}` }, /* @__PURE__ */ React.createElement(
|
|
4369
|
+
List.Item,
|
|
4370
|
+
{
|
|
4371
|
+
className: "eagle-table-form-header",
|
|
4372
|
+
actions: (deleteConfig == null ? void 0 : deleteConfig.deletable) ? [/* @__PURE__ */ React.createElement(React.Fragment, null)] : void 0
|
|
4373
|
+
},
|
|
4374
|
+
draggable ? /* @__PURE__ */ React.createElement(DraggableHandleWrapper, null) : null,
|
|
4375
|
+
headerCells
|
|
4376
|
+
), /* @__PURE__ */ React.createElement(
|
|
4377
|
+
TableFormBodyRows,
|
|
4378
|
+
{
|
|
4379
|
+
data,
|
|
4380
|
+
latestData,
|
|
4381
|
+
columns,
|
|
4382
|
+
passwordVisible,
|
|
4383
|
+
deleteConfig,
|
|
4384
|
+
disabled,
|
|
4385
|
+
draggable,
|
|
4386
|
+
rowSplitType,
|
|
4387
|
+
validateTriggerType,
|
|
4388
|
+
onBodyBlur,
|
|
4389
|
+
updateData,
|
|
4390
|
+
renderRowDescription,
|
|
4391
|
+
rowValidator,
|
|
4392
|
+
validateAll
|
|
4393
|
+
}
|
|
4394
|
+
))
|
|
4395
|
+
), (rowAddConfig == null ? void 0 : rowAddConfig.addible) ? /* @__PURE__ */ React.createElement(
|
|
4321
4396
|
AddRowButton,
|
|
4322
4397
|
{
|
|
4323
4398
|
config: rowAddConfig,
|
|
@@ -4425,7 +4500,7 @@ const TimeZoneSelect = props => {
|
|
|
4425
4500
|
input: {}
|
|
4426
4501
|
}, defaultTz ? /* @__PURE__ */React.createElement(Select$1.Option, {
|
|
4427
4502
|
value: DefaultTimeValue,
|
|
4428
|
-
label: parrotI18n.t("components.default_time_zone")
|
|
4503
|
+
label: `${parrotI18n.t("components.default_time_zone")} (${getUTCOffsetText(defaultTz.offset)})`,
|
|
4429
4504
|
className: OptionWrapperStyle
|
|
4430
4505
|
}, /* @__PURE__ */React.createElement(TimeZoneOption, {
|
|
4431
4506
|
key: DefaultTimeValue,
|
|
@@ -4433,7 +4508,7 @@ const TimeZoneSelect = props => {
|
|
|
4433
4508
|
timeZone: defaultTz
|
|
4434
4509
|
})) : void 0, /* @__PURE__ */React.createElement(Select$1.Option, {
|
|
4435
4510
|
value: BrowserTimeValue,
|
|
4436
|
-
label: parrotI18n.t("components.browser_time_zone")
|
|
4511
|
+
label: `${parrotI18n.t("components.browser_time_zone")} (${getUTCOffsetText(browserTz.offset)})`,
|
|
4437
4512
|
className: OptionWrapperStyle
|
|
4438
4513
|
}, /* @__PURE__ */React.createElement(TimeZoneOption, {
|
|
4439
4514
|
key: BrowserTimeValue,
|
|
@@ -4453,18 +4528,20 @@ const TimeZoneSelect = props => {
|
|
|
4453
4528
|
}
|
|
4454
4529
|
})), timeZoneOptionGroups);
|
|
4455
4530
|
};
|
|
4531
|
+
function getUTCOffsetText(offset) {
|
|
4532
|
+
if (offset === 0) {
|
|
4533
|
+
return "UTC";
|
|
4534
|
+
} else if (offset < 0) {
|
|
4535
|
+
return `UTC${offset}:00`;
|
|
4536
|
+
} else {
|
|
4537
|
+
return `UTC+${offset}:00`;
|
|
4538
|
+
}
|
|
4539
|
+
}
|
|
4456
4540
|
const TimeZoneOption = ({
|
|
4457
4541
|
timeZone,
|
|
4458
4542
|
customLabel
|
|
4459
4543
|
}) => {
|
|
4460
|
-
let tagText =
|
|
4461
|
-
if (timeZone.offset === 0) {
|
|
4462
|
-
tagText = "UTC";
|
|
4463
|
-
} else if (timeZone.offset < 0) {
|
|
4464
|
-
tagText = `UTC${timeZone.offset}:00`;
|
|
4465
|
-
} else {
|
|
4466
|
-
tagText = `UTC+${timeZone.offset}:00`;
|
|
4467
|
-
}
|
|
4544
|
+
let tagText = getUTCOffsetText(timeZone.offset);
|
|
4468
4545
|
return /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement("div", {
|
|
4469
4546
|
className: OptionFirstLineStyle
|
|
4470
4547
|
}, /* @__PURE__ */React.createElement("span", {
|
|
@@ -4719,4 +4796,4 @@ const useUIKit = () => {
|
|
|
4719
4796
|
return useContext(kitContext);
|
|
4720
4797
|
};
|
|
4721
4798
|
|
|
4722
|
-
export { Architecture, Button, ButtonStyle, EntityAsyncStatus, FailedLoad, Icon, InputTagItem, KitStoreProvider, ModalActions, ModalStack, TaskStatus, Typo, UIKitProvider, UIKitStore, UserSource, antdKit, closeModal, createBatchMessageMethods, kitContext, popModal, pushModal, tableStyleCover, tickFormatter, useElementsSize, useKitDispatch, useKitSelector, useUIKit };
|
|
4799
|
+
export { Architecture, Button, ButtonStyle, EntityAsyncStatus, FailedLoad, Icon, InputTagItem, KitStoreProvider, ModalActions, ModalStack, TaskStatus, Typo, UIKitProvider, UIKitStore, UserSource, ValidateTriggerType, antdKit, closeModal, createBatchMessageMethods, kitContext, popModal, pushModal, tableStyleCover, tickFormatter, useElementsSize, useKitDispatch, useKitSelector, useUIKit };
|