@onehat/ui 0.4.59 → 0.4.60
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/package.json
CHANGED
|
@@ -44,6 +44,12 @@ import AngleLeft from '../Icons/AngleLeft.js';
|
|
|
44
44
|
import Eye from '../Icons/Eye.js';
|
|
45
45
|
import Rotate from '../Icons/Rotate.js';
|
|
46
46
|
import Pencil from '../Icons/Pencil.js';
|
|
47
|
+
import Plus from '../Icons/Plus.js';
|
|
48
|
+
import FloppyDiskRegular from '../Icons/FloppyDiskRegular.js';
|
|
49
|
+
import Trash from '../Icons/Trash.js';
|
|
50
|
+
import Xmark from '../Icons/Xmark.js';
|
|
51
|
+
import Check from '../Icons/Check.js';
|
|
52
|
+
|
|
47
53
|
import Footer from '../Layout/Footer.js';
|
|
48
54
|
import Label from '../Form/Label.js';
|
|
49
55
|
import _ from 'lodash';
|
|
@@ -1216,6 +1222,7 @@ function Form(props) {
|
|
|
1216
1222
|
{...testProps('deleteBtn')}
|
|
1217
1223
|
key="deleteBtn"
|
|
1218
1224
|
onPress={onDelete}
|
|
1225
|
+
icon={Trash}
|
|
1219
1226
|
className={`
|
|
1220
1227
|
bg-warning-500
|
|
1221
1228
|
hover:bg-warning-700
|
|
@@ -1239,6 +1246,7 @@ function Form(props) {
|
|
|
1239
1246
|
{...testProps('cancelBtn')}
|
|
1240
1247
|
key="cancelBtn"
|
|
1241
1248
|
variant={editorType === EDITOR_TYPE__INLINE ? 'solid' : 'outline'}
|
|
1249
|
+
icon={Xmark}
|
|
1242
1250
|
onPress={onCancel}
|
|
1243
1251
|
className="text-white"
|
|
1244
1252
|
text="Cancel"
|
|
@@ -1249,6 +1257,7 @@ function Form(props) {
|
|
|
1249
1257
|
{...testProps('closeBtn')}
|
|
1250
1258
|
key="closeBtn"
|
|
1251
1259
|
variant={editorType === EDITOR_TYPE__INLINE ? 'solid' : 'outline'}
|
|
1260
|
+
icon={Xmark}
|
|
1252
1261
|
onPress={onClose}
|
|
1253
1262
|
className="text-white"
|
|
1254
1263
|
text="Close"
|
|
@@ -1259,6 +1268,7 @@ function Form(props) {
|
|
|
1259
1268
|
{...testProps('saveBtn')}
|
|
1260
1269
|
key="saveBtn"
|
|
1261
1270
|
onPress={(e) => handleSubmit(onSaveDecorated, onSubmitError)(e)}
|
|
1271
|
+
icon={getEditorMode() === EDITOR_MODE__ADD ? Plus : FloppyDiskRegular}
|
|
1262
1272
|
isDisabled={isSaveDisabled}
|
|
1263
1273
|
className="text-white"
|
|
1264
1274
|
text={getEditorMode() === EDITOR_MODE__ADD ? 'Add' : 'Save'}
|
|
@@ -1268,6 +1278,7 @@ function Form(props) {
|
|
|
1268
1278
|
<Button
|
|
1269
1279
|
{...testProps('submitBtn')}
|
|
1270
1280
|
key="submitBtn"
|
|
1281
|
+
icon={Check}
|
|
1271
1282
|
onPress={(e) => handleSubmit(onSubmitDecorated, onSubmitError)(e)}
|
|
1272
1283
|
isDisabled={isSubmitDisabled}
|
|
1273
1284
|
className="text-white"
|
|
@@ -1283,6 +1294,7 @@ function Form(props) {
|
|
|
1283
1294
|
{...testProps('additionalFooterBtn-' + props.key)}
|
|
1284
1295
|
{...props}
|
|
1285
1296
|
onPress={(e) => handleSubmit(props.onPress, onSubmitError)(e)}
|
|
1297
|
+
icon={props.icon || null}
|
|
1286
1298
|
text={props.text}
|
|
1287
1299
|
isDisabled={isDisabled}
|
|
1288
1300
|
/>;
|
|
@@ -424,9 +424,9 @@ function GridComponent(props) {
|
|
|
424
424
|
} else {
|
|
425
425
|
let canDoEdit = false,
|
|
426
426
|
canDoView = false;
|
|
427
|
-
if (onEdit && canUser && canUser(EDIT) && canRecordBeEdited
|
|
427
|
+
if (onEdit && canUser && canUser(EDIT) && (!canRecordBeEdited || canRecordBeEdited(selection))) {
|
|
428
428
|
canDoEdit = true;
|
|
429
|
-
}
|
|
429
|
+
} else
|
|
430
430
|
if (onView && canUser && canUser(VIEW)) {
|
|
431
431
|
canDoView = true;
|
|
432
432
|
}
|