@@ -361,6 +361,8 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
361361//
362362//
363363//
364+ //
365+ //
364366
365367
366368
@@ -495,19 +497,23 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
495497//
496498//
497499//
500+ //
501+ //
498502
499503/* harmony default export */ __webpack_exports__ [ "default" ] = ( {
500504 name : "RelationshipDetailItem" ,
501505
502506 props : {
503- ' value' : Object ,
504- ' settings' : Object ,
505- ' collapsed' : {
507+ value : Object ,
508+ settings : Object ,
509+ collapsed : {
506510 type : Boolean ,
507511 default : false
508512 } ,
509- 'label' : String ,
510- 'id' : Number
513+ label : String ,
514+ id : Number ,
515+ modelId : Number ,
516+ modelKey : String
511517 } ,
512518
513519 data : function data ( ) {
@@ -641,7 +647,11 @@ var render = function() {
641647 [
642648 _c ( "detail-" + parameter . meta . component , {
643649 tag : "component" ,
644- attrs : { field : parameter . meta }
650+ attrs : {
651+ field : parameter . meta ,
652+ "resource-id" : _vm . modelId ,
653+ "resource-name" : _vm . modelKey
654+ }
645655 } )
646656 ] ,
647657 1
@@ -696,6 +706,8 @@ var render = function() {
696706 attrs : {
697707 id : index ,
698708 value : item ,
709+ "model-id" : _vm . field . models [ index ] || 0 ,
710+ "model-key" : _vm . field . modelKey ,
699711 label : _vm . field . singularLabel ,
700712 settings : _vm . field . settings ,
701713 collapsed : _vm . collapsed
@@ -902,11 +914,15 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
902914 fillValueFromChildren : function fillValueFromChildren ( formData ) {
903915 var _this2 = this ;
904916
905- _ ( this . $refs ) . each ( function ( item ) {
906- if ( item && Array . isArray ( item ) && item [ 0 ] ) {
907- item [ 0 ] . fill ( formData , _this2 . field . attribute ) ;
908- }
909- } ) ;
917+ if ( ! _ . isEmpty ( this . $refs [ 0 ] ) ) {
918+ _ ( this . $refs ) . each ( function ( item ) {
919+ if ( item && Array . isArray ( item ) && item [ 0 ] ) {
920+ item [ 0 ] . fill ( formData , _this2 . field . attribute ) ;
921+ }
922+ } ) ;
923+ } else {
924+ formData . append ( this . field . attribute , [ ] ) ;
925+ }
910926 } ,
911927
912928 /**
@@ -17028,7 +17044,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
1702817044 return _extends ( {
1702917045 'options' : { }
1703017046 } , _this . value [ attrib ] . meta , {
17031- 'attribute' : _this . value [ attrib ] . meta . component === "file-field" ? attrib : _this . field . attribute + '_' + _this . id + '_' + attrib , // This is needed to enable delete link for file without triggering duplicate id warning
17047+ 'attribute' : _this . value [ attrib ] . meta . component === "file-field" ? attrib + '?' + _this . id : _this . field . attribute + '_' + _this . id + '_' + attrib , // This is needed to enable delete link for file without triggering duplicate id warning
1703217048 'name' : _this . field . attribute + '[' + _this . id + '][' + attrib + ']' ,
1703317049 'deletable' : _this . modelId > 0 , // Hide delete button if model Id is not present, i.e. new model
1703417050 'attrib' : attrib
@@ -17045,9 +17061,9 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
1704517061 _ ( _this2 . $refs ) . each ( function ( item ) {
1704617062 if ( item [ 0 ] . field . component === 'file-field' ) {
1704717063 if ( item [ 0 ] . file ) {
17048- formData . append ( item [ 0 ] . field . attribute , item [ 0 ] . file , item [ 0 ] . fileName ) ;
17064+ formData . append ( item [ 0 ] . field . attrib , item [ 0 ] . file , item [ 0 ] . fileName ) ;
1704917065 } else if ( item [ 0 ] . value ) {
17050- formData . append ( item [ 0 ] . field . attribute , String ( item [ 0 ] . value ) ) ;
17066+ formData . append ( item [ 0 ] . field . attrib , String ( item [ 0 ] . value ) ) ;
1705117067 }
1705217068 } else if ( item [ 0 ] . field . component === 'boolean-field' ) {
1705317069 formData . append ( item [ 0 ] . field . attribute , item [ 0 ] . trueValue ) ;
@@ -17138,47 +17154,49 @@ var render = function() {
1713817154 ] )
1713917155 ] ) ,
1714017156 _vm . _v ( " " ) ,
17141- _c ( "div" , { staticClass : "w-1/4 text-right" } , [
17142- _c (
17143- "button" ,
17144- {
17145- staticClass :
17146- "btn btn-default btn-icon btn bg-transparent hover:bg-danger text-danger hover:text-white border border-danger hover:border-transparent inline-flex items-center relative mr-3" ,
17147- attrs : { title : "Delete" } ,
17148- on : {
17149- click : function ( $event ) {
17150- $event . preventDefault ( )
17151- return _vm . removeItem ( )
17152- }
17153- }
17154- } ,
17155- [
17157+ _vm . field . deletable
17158+ ? _c ( "div" , { staticClass : "w-1/4 text-right" } , [
1715617159 _c (
17157- "svg " ,
17160+ "button " ,
1715817161 {
17159- staticClass : "fill-current text-0" ,
17160- attrs : {
17161- xmlns : "http://www.w3.org/2000/svg" ,
17162- width : "20" ,
17163- height : "20" ,
17164- viewBox : "0 0 20 20" ,
17165- "aria-labelledby" : "delete" ,
17166- role : "presentation"
17162+ staticClass :
17163+ "btn btn-default btn-icon btn bg-transparent hover:bg-danger text-danger hover:text-white border border-danger hover:border-transparent inline-flex items-center relative mr-3" ,
17164+ attrs : { title : "Delete" } ,
17165+ on : {
17166+ click : function ( $event ) {
17167+ $event . preventDefault ( )
17168+ return _vm . removeItem ( )
17169+ }
1716717170 }
1716817171 } ,
1716917172 [
17170- _c ( "path" , {
17171- attrs : {
17172- "fill-rule" : "nonzero" ,
17173- d :
17174- "M6 4V2a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2h5a1 1 0 0 1 0 2h-1v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6H1a1 1 0 1 1 0-2h5zM4 6v12h12V6H4zm8-2V2H8v2h4zM8 8a1 1 0 0 1 1 1v6a1 1 0 0 1-2 0V9a1 1 0 0 1 1-1zm4 0a1 1 0 0 1 1 1v6a1 1 0 0 1-2 0V9a1 1 0 0 1 1-1z"
17175- }
17176- } )
17173+ _c (
17174+ "svg" ,
17175+ {
17176+ staticClass : "fill-current text-0" ,
17177+ attrs : {
17178+ xmlns : "http://www.w3.org/2000/svg" ,
17179+ width : "20" ,
17180+ height : "20" ,
17181+ viewBox : "0 0 20 20" ,
17182+ "aria-labelledby" : "delete" ,
17183+ role : "presentation"
17184+ }
17185+ } ,
17186+ [
17187+ _c ( "path" , {
17188+ attrs : {
17189+ "fill-rule" : "nonzero" ,
17190+ d :
17191+ "M6 4V2a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2h5a1 1 0 0 1 0 2h-1v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6H1a1 1 0 1 1 0-2h5zM4 6v12h12V6H4zm8-2V2H8v2h4zM8 8a1 1 0 0 1 1 1v6a1 1 0 0 1-2 0V9a1 1 0 0 1 1-1zm4 0a1 1 0 0 1 1 1v6a1 1 0 0 1-2 0V9a1 1 0 0 1 1-1z"
17192+ }
17193+ } )
17194+ ]
17195+ )
1717717196 ]
1717817197 )
17179- ]
17180- )
17181- ] )
17198+ ] )
17199+ : _vm . _e ( )
1718217200 ] ) ,
1718317201 _vm . _v ( " " ) ,
1718417202 _vm . _l ( _vm . fields , function ( field , attrib ) {
0 commit comments