@solidxai/core-ui 0.1.13-beta.1 → 0.1.13-beta.3
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/common/SolidFieldTooltip.d.ts.map +1 -1
- package/dist/components/common/SolidFieldTooltip.js +33 -1
- package/dist/components/common/SolidFieldTooltip.js.map +1 -1
- package/dist/components/common/SolidFieldTooltip.tsx +64 -8
- package/dist/components/core/chatter/SolidChatter.d.ts.map +1 -1
- package/dist/components/core/chatter/SolidChatter.js +4 -2
- package/dist/components/core/chatter/SolidChatter.js.map +1 -1
- package/dist/components/core/chatter/SolidChatter.tsx +4 -1
- package/dist/components/core/chatter/SolidChatterMentionMenu.d.ts +9 -0
- package/dist/components/core/chatter/SolidChatterMentionMenu.d.ts.map +1 -0
- package/dist/components/core/chatter/SolidChatterMentionMenu.js +18 -0
- package/dist/components/core/chatter/SolidChatterMentionMenu.js.map +1 -0
- package/dist/components/core/chatter/SolidChatterMentionMenu.tsx +45 -0
- package/dist/components/core/chatter/SolidChatterMessageBox.d.ts +1 -0
- package/dist/components/core/chatter/SolidChatterMessageBox.d.ts.map +1 -1
- package/dist/components/core/chatter/SolidChatterMessageBox.js +29 -5
- package/dist/components/core/chatter/SolidChatterMessageBox.js.map +1 -1
- package/dist/components/core/chatter/SolidChatterMessageBox.tsx +57 -4
- package/dist/components/core/chatter/SolidMessageComposer.d.ts.map +1 -1
- package/dist/components/core/chatter/SolidMessageComposer.js +33 -7
- package/dist/components/core/chatter/SolidMessageComposer.js.map +1 -1
- package/dist/components/core/chatter/SolidMessageComposer.tsx +61 -7
- package/dist/components/core/chatter/chatter.module.css +63 -0
- package/dist/components/core/chatter/chatterMentions.d.ts +17 -0
- package/dist/components/core/chatter/chatterMentions.d.ts.map +1 -0
- package/dist/components/core/chatter/chatterMentions.js +50 -0
- package/dist/components/core/chatter/chatterMentions.js.map +1 -0
- package/dist/components/core/chatter/chatterMentions.ts +59 -0
- package/dist/components/core/chatter/useChatterMentions.d.ts +26 -0
- package/dist/components/core/chatter/useChatterMentions.d.ts.map +1 -0
- package/dist/components/core/chatter/useChatterMentions.js +204 -0
- package/dist/components/core/chatter/useChatterMentions.js.map +1 -0
- package/dist/components/core/chatter/useChatterMentions.ts +160 -0
- package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.js +111 -106
- package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.tsx +165 -134
- package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.js +81 -84
- package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.tsx +97 -86
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +4 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +6 -0
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +4 -3
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +4 -3
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js +42 -81
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.tsx +90 -120
- package/dist/components/core/list/columns/SolidMediaSingleColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js +34 -42
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.tsx +51 -46
- package/dist/components/core/model/CreateModel.d.ts.map +1 -1
- package/dist/components/core/model/CreateModel.js +3 -2
- package/dist/components/core/model/CreateModel.js.map +1 -1
- package/dist/components/core/model/CreateModel.tsx +4 -1
- package/dist/components/core/model/FieldMetaData.d.ts +1 -1
- package/dist/components/core/model/FieldMetaData.d.ts.map +1 -1
- package/dist/components/core/model/FieldMetaData.js +17 -17
- package/dist/components/core/model/FieldMetaData.js.map +1 -1
- package/dist/components/core/model/FieldMetaData.tsx +10 -2
- package/dist/components/shad-cn-ui/SolidTextarea.d.ts +1 -1
- package/dist/components/shad-cn-ui/SolidTextarea.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidTextarea.js +4 -3
- package/dist/components/shad-cn-ui/SolidTextarea.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidTextarea.tsx +4 -2
- package/dist/helpers/downloadMediaFile.d.ts.map +1 -1
- package/dist/helpers/downloadMediaFile.js +10 -3
- package/dist/helpers/downloadMediaFile.js.map +1 -1
- package/dist/helpers/downloadMediaFile.tsx +13 -7
- package/dist/helpers/fileTypeIcon.d.ts +3 -2
- package/dist/helpers/fileTypeIcon.d.ts.map +1 -1
- package/dist/helpers/fileTypeIcon.js +11 -7
- package/dist/helpers/fileTypeIcon.js.map +1 -1
- package/dist/helpers/fileTypeIcon.tsx +12 -7
- package/dist/helpers/mediaType.d.ts +7 -0
- package/dist/helpers/mediaType.d.ts.map +1 -1
- package/dist/helpers/mediaType.js +39 -8
- package/dist/helpers/mediaType.js.map +1 -1
- package/dist/helpers/mediaType.ts +46 -7
- package/dist/helpers/mediaUrl.d.ts +2 -0
- package/dist/helpers/mediaUrl.d.ts.map +1 -0
- package/dist/helpers/mediaUrl.js +10 -0
- package/dist/helpers/mediaUrl.js.map +1 -0
- package/dist/helpers/mediaUrl.ts +11 -0
- package/dist/resources/globals.css +14 -0
- package/dist/resources/solid-tailwind-generated.css +1 -1
- package/package.json +1 -1
|
@@ -21,6 +21,8 @@ import { FileReaderExt } from "../../../../components/common/FileReaderExt";
|
|
|
21
21
|
import getAcceptedFileTypes from "../../../../helpers/getAcceptedFileTypes";
|
|
22
22
|
import { downloadMediaFile } from "../../../../helpers/downloadMediaFile";
|
|
23
23
|
import { getExtensionComponent } from "../../../../helpers/registry";
|
|
24
|
+
import { openMediaInNewTab } from "../../../../helpers/mediaUrl";
|
|
25
|
+
import { getMediaPreviewKind, isLightboxMediaKind } from "../../../../helpers/mediaType";
|
|
24
26
|
import { SolidMediaFormFieldWidgetProps } from "../../../../types/solid-core";
|
|
25
27
|
import { SolidFieldTooltip } from "../../../../components/common/SolidFieldTooltip";
|
|
26
28
|
import { ERROR_MESSAGES } from "../../../../constants/error-messages";
|
|
@@ -28,6 +30,13 @@ import styles from "./solidFields.module.css";
|
|
|
28
30
|
import { SolidIcon } from "../../../shad-cn-ui";
|
|
29
31
|
import { getPersistedMediaId } from "./mediaFieldUtils";
|
|
30
32
|
|
|
33
|
+
type SingleMediaFileDetail = {
|
|
34
|
+
name: string;
|
|
35
|
+
type: string;
|
|
36
|
+
fileUrl: string;
|
|
37
|
+
fileSize: number;
|
|
38
|
+
};
|
|
39
|
+
|
|
31
40
|
export class SolidMediaSingleField implements ISolidField {
|
|
32
41
|
|
|
33
42
|
private fieldContext: SolidFieldProps;
|
|
@@ -170,7 +179,7 @@ export const DefaultMediaSingleFormEditWidget = ({ formik, fieldContext, setLigh
|
|
|
170
179
|
const isFieldReadonly = formReadonly || fieldReadonly || readOnlyPermission;
|
|
171
180
|
|
|
172
181
|
const [isDeleteImageDialogVisible, setDeleteImageDialogVisible] = useState(false);
|
|
173
|
-
const [fileDetails, setFileDetails] = useState<
|
|
182
|
+
const [fileDetails, setFileDetails] = useState<SingleMediaFileDetail | null>(null);
|
|
174
183
|
const [isReplaceImageDialogVisible, setReplaceImageDialogVisible] = useState(false);
|
|
175
184
|
const [newFileToUpload, setNewFileToUpload] = useState<any>(null);
|
|
176
185
|
const [fileSizeError, setFileSizeError] = useState<string | null>(null);
|
|
@@ -272,34 +281,38 @@ export const DefaultMediaSingleFormEditWidget = ({ formik, fieldContext, setLigh
|
|
|
272
281
|
|
|
273
282
|
useEffect(() => {
|
|
274
283
|
const fieldValue = formik?.values[fieldLayoutInfo.attrs.name];
|
|
284
|
+
if (!fieldValue || typeof fieldValue !== "object") {
|
|
285
|
+
setFileDetails(null);
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
275
288
|
|
|
276
|
-
if (fieldValue
|
|
277
|
-
|
|
278
|
-
let fileName = "Unknown File";
|
|
279
|
-
let fileSize = 0;
|
|
280
|
-
|
|
281
|
-
if (fieldValue instanceof File) {
|
|
282
|
-
fileUrl = URL.createObjectURL(fieldValue);
|
|
283
|
-
fileName = fieldValue.name;
|
|
284
|
-
fileSize = fieldValue.size;
|
|
285
|
-
} else if (fieldValue._full_url) {
|
|
286
|
-
fileUrl = fieldValue._full_url;
|
|
287
|
-
fileName = fieldValue.originalFileName;
|
|
288
|
-
fileSize = fieldValue.fileSize;
|
|
289
|
-
}
|
|
290
|
-
|
|
289
|
+
if (fieldValue instanceof File) {
|
|
290
|
+
const fileUrl = URL.createObjectURL(fieldValue);
|
|
291
291
|
setFileDetails({
|
|
292
|
-
name:
|
|
293
|
-
type: fieldValue.
|
|
292
|
+
name: fieldValue.name,
|
|
293
|
+
type: fieldValue.type,
|
|
294
294
|
fileUrl,
|
|
295
|
-
fileSize
|
|
295
|
+
fileSize: fieldValue.size,
|
|
296
296
|
});
|
|
297
297
|
|
|
298
|
-
// Ensure formik has the correct value
|
|
299
298
|
formik.setFieldValue(fieldLayoutInfo.attrs.name, fieldValue);
|
|
300
|
-
|
|
299
|
+
return () => URL.revokeObjectURL(fileUrl);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
const fileUrl = fieldValue._full_url;
|
|
303
|
+
if (!fileUrl) {
|
|
301
304
|
setFileDetails(null);
|
|
305
|
+
return;
|
|
302
306
|
}
|
|
307
|
+
|
|
308
|
+
setFileDetails({
|
|
309
|
+
name: fieldValue.originalFileName,
|
|
310
|
+
type: fieldValue.mimeType ? fieldValue.mimeType : fieldValue.type,
|
|
311
|
+
fileUrl,
|
|
312
|
+
fileSize: fieldValue.fileSize,
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
formik.setFieldValue(fieldLayoutInfo.attrs.name, fieldValue);
|
|
303
316
|
}, [formik.values, fieldLayoutInfo.attrs.name]);
|
|
304
317
|
|
|
305
318
|
const {
|
|
@@ -332,32 +345,25 @@ export const DefaultMediaSingleFormEditWidget = ({ formik, fieldContext, setLigh
|
|
|
332
345
|
}
|
|
333
346
|
|
|
334
347
|
const handleFileView = (url: any) => {
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
];
|
|
341
|
-
|
|
342
|
-
const fileUrl = url?.fileUrl || "";
|
|
343
|
-
const cleanUrl = fileUrl.split("?")[0];
|
|
344
|
-
const ext = cleanUrl.split(".").pop()?.toLowerCase();
|
|
345
|
-
|
|
346
|
-
if (ext && downloadOnlyExt.includes(ext)) {
|
|
347
|
-
const link = document.createElement('a');
|
|
348
|
-
link.href = url.fileUrl;
|
|
349
|
-
link.download = ''; // or specify a file name like 'file.pdf'
|
|
350
|
-
link.target = '_blank';
|
|
351
|
-
document.body.appendChild(link);
|
|
352
|
-
link.click();
|
|
353
|
-
document.body.removeChild(link);
|
|
348
|
+
const previewKind = getMediaPreviewKind({
|
|
349
|
+
url: url?.fileUrl,
|
|
350
|
+
fileName: url?.name,
|
|
351
|
+
mimeType: url?.type,
|
|
352
|
+
});
|
|
354
353
|
|
|
355
|
-
|
|
354
|
+
if (isLightboxMediaKind(previewKind)) {
|
|
356
355
|
setLightboxUrls?.([
|
|
357
|
-
{
|
|
356
|
+
{
|
|
357
|
+
src: url.fileUrl,
|
|
358
|
+
downloadUrl: url.fileUrl,
|
|
359
|
+
type: previewKind === "video" ? "video" : undefined
|
|
360
|
+
},
|
|
358
361
|
]);
|
|
359
362
|
setOpenLightbox?.(true);
|
|
363
|
+
return;
|
|
360
364
|
}
|
|
365
|
+
|
|
366
|
+
openMediaInNewTab(url?.fileUrl);
|
|
361
367
|
}
|
|
362
368
|
|
|
363
369
|
|
|
@@ -412,7 +418,11 @@ export const DefaultMediaSingleFormEditWidget = ({ formik, fieldContext, setLigh
|
|
|
412
418
|
className="solid-file-icon-btn"
|
|
413
419
|
disabled={isFieldDisabled || isFieldReadonly}
|
|
414
420
|
aria-label="Download file"
|
|
415
|
-
onClick={() =>
|
|
421
|
+
onClick={(event) => {
|
|
422
|
+
event.preventDefault();
|
|
423
|
+
event.stopPropagation();
|
|
424
|
+
downloadMediaFile(fileDetails?.fileUrl, fileDetails?.name);
|
|
425
|
+
}}
|
|
416
426
|
>
|
|
417
427
|
<SolidIcon name="si-download" aria-hidden />
|
|
418
428
|
</button>
|
|
@@ -484,7 +494,7 @@ export const DefaultMediaSingleFormEditWidget = ({ formik, fieldContext, setLigh
|
|
|
484
494
|
}
|
|
485
495
|
|
|
486
496
|
export const DefaultMediaSingleFormViewWidget = ({ formik, fieldContext, setLightboxUrls, setOpenLightbox }: SolidMediaFormFieldWidgetProps) => {
|
|
487
|
-
const [fileDetails, setFileDetails] = useState<
|
|
497
|
+
const [fileDetails, setFileDetails] = useState<SingleMediaFileDetail | null>(null);
|
|
488
498
|
const fieldMetadata = fieldContext.fieldMetadata;
|
|
489
499
|
const fieldLayoutInfo = fieldContext.field;
|
|
490
500
|
const className = fieldLayoutInfo.attrs?.className || 'field w-full px-2 pt-2';
|
|
@@ -502,60 +512,57 @@ export const DefaultMediaSingleFormViewWidget = ({ formik, fieldContext, setLigh
|
|
|
502
512
|
|
|
503
513
|
useEffect(() => {
|
|
504
514
|
const fieldValue = formik?.values[fieldLayoutInfo.attrs.name];
|
|
515
|
+
if (!fieldValue || typeof fieldValue !== "object") {
|
|
516
|
+
setFileDetails(null);
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
505
519
|
|
|
506
|
-
if (fieldValue
|
|
507
|
-
|
|
508
|
-
let fileName = "Unknown File";
|
|
509
|
-
let fileSize = 0;
|
|
510
|
-
|
|
511
|
-
if (fieldValue instanceof File) {
|
|
512
|
-
fileUrl = URL.createObjectURL(fieldValue);
|
|
513
|
-
fileName = fieldValue.name;
|
|
514
|
-
fileSize = fieldValue.size;
|
|
515
|
-
} else if (fieldValue._full_url) {
|
|
516
|
-
fileUrl = fieldValue._full_url;
|
|
517
|
-
fileName = fieldValue.originalFileName;
|
|
518
|
-
fileSize = fieldValue.fileSize;
|
|
519
|
-
}
|
|
520
|
-
|
|
520
|
+
if (fieldValue instanceof File) {
|
|
521
|
+
const fileUrl = URL.createObjectURL(fieldValue);
|
|
521
522
|
setFileDetails({
|
|
522
|
-
name:
|
|
523
|
-
type: fieldValue.
|
|
523
|
+
name: fieldValue.name,
|
|
524
|
+
type: fieldValue.type,
|
|
524
525
|
fileUrl,
|
|
525
|
-
fileSize
|
|
526
|
+
fileSize: fieldValue.size,
|
|
526
527
|
});
|
|
527
|
-
|
|
528
|
-
|
|
528
|
+
|
|
529
|
+
return () => URL.revokeObjectURL(fileUrl);
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
const fileUrl = fieldValue._full_url;
|
|
533
|
+
if (!fileUrl) {
|
|
534
|
+
setFileDetails(null);
|
|
535
|
+
return;
|
|
529
536
|
}
|
|
537
|
+
|
|
538
|
+
setFileDetails({
|
|
539
|
+
name: fieldValue.originalFileName,
|
|
540
|
+
type: fieldValue.mimeType ? fieldValue.mimeType : fieldValue.type,
|
|
541
|
+
fileUrl,
|
|
542
|
+
fileSize: fieldValue.fileSize,
|
|
543
|
+
});
|
|
530
544
|
}, [formik.values, fieldLayoutInfo.attrs.name]);
|
|
531
545
|
|
|
532
546
|
const handleFileView = (url: any) => {
|
|
533
|
-
const
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
];
|
|
539
|
-
|
|
540
|
-
const fileUrl = url?.fileUrl || "";
|
|
541
|
-
const cleanUrl = fileUrl.split("?")[0];
|
|
542
|
-
const ext = cleanUrl.split(".").pop()?.toLowerCase();
|
|
543
|
-
|
|
544
|
-
if (ext && downloadOnlyExt.includes(ext)) {
|
|
545
|
-
const link = document.createElement('a');
|
|
546
|
-
link.href = url.fileUrl;
|
|
547
|
-
link.download = ''; // or specify a file name like 'file.pdf'
|
|
548
|
-
link.target = '_blank';
|
|
549
|
-
document.body.appendChild(link);
|
|
550
|
-
link.click();
|
|
551
|
-
document.body.removeChild(link);
|
|
547
|
+
const previewKind = getMediaPreviewKind({
|
|
548
|
+
url: url?.fileUrl,
|
|
549
|
+
fileName: url?.name,
|
|
550
|
+
mimeType: url?.type,
|
|
551
|
+
});
|
|
552
552
|
|
|
553
|
-
|
|
553
|
+
if (isLightboxMediaKind(previewKind)) {
|
|
554
554
|
setLightboxUrls?.([
|
|
555
|
-
{
|
|
555
|
+
{
|
|
556
|
+
src: url.fileUrl,
|
|
557
|
+
downloadUrl: url.fileUrl,
|
|
558
|
+
type: previewKind === "video" ? "video" : undefined
|
|
559
|
+
},
|
|
556
560
|
]);
|
|
557
561
|
setOpenLightbox?.(true);
|
|
562
|
+
return;
|
|
558
563
|
}
|
|
564
|
+
|
|
565
|
+
openMediaInNewTab(url?.fileUrl);
|
|
559
566
|
}
|
|
560
567
|
|
|
561
568
|
return (
|
|
@@ -585,7 +592,11 @@ export const DefaultMediaSingleFormViewWidget = ({ formik, fieldContext, setLigh
|
|
|
585
592
|
type="button"
|
|
586
593
|
className="solid-file-icon-btn"
|
|
587
594
|
aria-label="Download file"
|
|
588
|
-
onClick={() =>
|
|
595
|
+
onClick={(event) => {
|
|
596
|
+
event.preventDefault();
|
|
597
|
+
event.stopPropagation();
|
|
598
|
+
downloadMediaFile(fileDetails?.fileUrl, fileDetails?.name);
|
|
599
|
+
}}
|
|
589
600
|
>
|
|
590
601
|
<SolidIcon name="si-download" aria-hidden />
|
|
591
602
|
</button>
|
|
@@ -19,7 +19,7 @@ export declare class SolidRelationManyToOneField implements ISolidField {
|
|
|
19
19
|
renderExtensionRenderMode(widget: string, formik: FormikObject): import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
}
|
|
21
21
|
export declare const DefaultRelationManyToOneFormEditWidget: ({ formik, fieldContext }: SolidFormFieldWidgetProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export declare const RenderSolidFormEmbededView: ({ formik, fieldContext, customCreateHandler, visibleCreateRelationEntity, setvisibleCreateRelationEntity, formViewParams }: any) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare const RenderSolidFormEmbededView: ({ formik, fieldContext, customCreateHandler, visibleCreateRelationEntity, setvisibleCreateRelationEntity, formViewParams }: any) => import("react/jsx-runtime").JSX.Element | null;
|
|
23
23
|
export declare const DefaultRelationManyToOneFormViewWidget: ({ formik, fieldContext }: SolidFormFieldWidgetProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
export declare const PseudoRelationManyToOneFormWidget: ({ formik, fieldContext }: SolidFormFieldWidgetProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
25
|
//# sourceMappingURL=SolidRelationManyToOneField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidRelationManyToOneField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/core/form/fields/relations/SolidRelationManyToOneField.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAI5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAe5E,MAAM,MAAM,cAAc,GAAG;IACzB,UAAU,EAAE,GAAG,CAAC;IAChB,SAAS,EAAE,GAAG,CAAC;IACf,EAAE,EAAE,GAAG,CAAC;IACR,OAAO,EAAE,GAAG,CAAC;IACb,oBAAoB,EAAE,GAAG,CAAC;IAC1B,MAAM,EAAE,GAAG,CAAC;CACf,CAAA;AAED,qBAAa,2BAA4B,YAAW,WAAW;IAE3D,OAAO,CAAC,YAAY,CAAkB;gBAE1B,YAAY,EAAE,eAAe;IAIzC,YAAY,IAAI,GAAG;IAqBnB,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,GAAG,GAAG;IAUnD,gBAAgB,IAAI,GAAG,CAAC,MAAM;IA4D9B,MAAM,CAAC,MAAM,EAAE,YAAY;IAoC3B,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY;CAYjE;AAED,eAAO,MAAM,sCAAsC,6BAA8B,yBAAyB,4CAqTzG,CAAA;AAED,eAAO,MAAM,0BAA0B,+HAAgI,GAAG,
|
|
1
|
+
{"version":3,"file":"SolidRelationManyToOneField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/core/form/fields/relations/SolidRelationManyToOneField.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAI5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAe5E,MAAM,MAAM,cAAc,GAAG;IACzB,UAAU,EAAE,GAAG,CAAC;IAChB,SAAS,EAAE,GAAG,CAAC;IACf,EAAE,EAAE,GAAG,CAAC;IACR,OAAO,EAAE,GAAG,CAAC;IACb,oBAAoB,EAAE,GAAG,CAAC;IAC1B,MAAM,EAAE,GAAG,CAAC;CACf,CAAA;AAED,qBAAa,2BAA4B,YAAW,WAAW;IAE3D,OAAO,CAAC,YAAY,CAAkB;gBAE1B,YAAY,EAAE,eAAe;IAIzC,YAAY,IAAI,GAAG;IAqBnB,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,GAAG,GAAG;IAUnD,gBAAgB,IAAI,GAAG,CAAC,MAAM;IA4D9B,MAAM,CAAC,MAAM,EAAE,YAAY;IAoC3B,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY;CAYjE;AAED,eAAO,MAAM,sCAAsC,6BAA8B,yBAAyB,4CAqTzG,CAAA;AAED,eAAO,MAAM,0BAA0B,+HAAgI,GAAG,mDAoEzK,CAAA;AAGD,eAAO,MAAM,sCAAsC,6BAA8B,yBAAyB,4CAiBzG,CAAA;AAMD,eAAO,MAAM,iCAAiC,6BAA8B,yBAAyB,4CA2cpG,CAAA"}
|
|
@@ -479,6 +479,7 @@ export var RenderSolidFormEmbededView = function (_a) {
|
|
|
479
479
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
480
480
|
var formik = _a.formik, fieldContext = _a.fieldContext, customCreateHandler = _a.customCreateHandler, visibleCreateRelationEntity = _a.visibleCreateRelationEntity, setvisibleCreateRelationEntity = _a.setvisibleCreateRelationEntity, formViewParams = _a.formViewParams;
|
|
481
481
|
var fieldLayoutInfo = fieldContext.field;
|
|
482
|
+
var viewMode = fieldContext.viewMode;
|
|
482
483
|
var className = ((_b = fieldLayoutInfo.attrs) === null || _b === void 0 ? void 0 : _b.className) || 'field w-1/2 px-2 pt-2';
|
|
483
484
|
var parentModelName = (_c = fieldLayoutInfo === null || fieldLayoutInfo === void 0 ? void 0 : fieldLayoutInfo.attrs) === null || _c === void 0 ? void 0 : _c.parentModelName;
|
|
484
485
|
var childModelName = (_d = fieldLayoutInfo === null || fieldLayoutInfo === void 0 ? void 0 : fieldLayoutInfo.attrs) === null || _d === void 0 ? void 0 : _d.childModelName;
|
|
@@ -502,6 +503,9 @@ export var RenderSolidFormEmbededView = function (_a) {
|
|
|
502
503
|
setvisibleCreateRelationEntity(false);
|
|
503
504
|
}),
|
|
504
505
|
};
|
|
506
|
+
if (viewMode === "view") {
|
|
507
|
+
return null;
|
|
508
|
+
}
|
|
505
509
|
return (_jsxs("div", { children: [_jsx("div", { children: _jsx(SolidButton, { icon: "si si-plus", rounded: true, variant: "outline", "aria-label": "Filter", type: "button", size: "sm", onClick: function () { return setvisibleCreateRelationEntity(true); }, className: "custom-add-button" }) }), _jsxs(SolidDialog, { open: visibleCreateRelationEntity, onOpenChange: setvisibleCreateRelationEntity, style: {
|
|
506
510
|
width: (_s = (_r = (_q = (_p = fieldLayoutInfo === null || fieldLayoutInfo === void 0 ? void 0 : fieldLayoutInfo.attrs) === null || _p === void 0 ? void 0 : _p.inlineCreateLayout) === null || _q === void 0 ? void 0 : _q.attrs) === null || _r === void 0 ? void 0 : _r.width) !== null && _s !== void 0 ? _s : "60vw",
|
|
507
511
|
height: (_w = (_v = (_u = (_t = fieldLayoutInfo === null || fieldLayoutInfo === void 0 ? void 0 : fieldLayoutInfo.attrs) === null || _t === void 0 ? void 0 : _t.inlineCreateLayout) === null || _u === void 0 ? void 0 : _u.attrs) === null || _v === void 0 ? void 0 : _v.height) !== null && _w !== void 0 ? _w : "auto"
|