rb-document-form-constructor 0.3.5 → 0.3.9

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.
@@ -4974,8 +4974,8 @@ let baseConfig = {
4974
4974
  refInputConfigs: __clone(fcRefInputConfigs),
4975
4975
  rules: [],
4976
4976
  icons: {
4977
- iconExpandFacet: 'icon-chevron-up',
4978
- iconCollapseFacet: 'icon-chevron-down',
4977
+ iconExpandFacet: 'icon-chevron-down',
4978
+ iconCollapseFacet: 'icon-chevron-up',
4979
4979
  iconCloseFieldSidebar: 'icon-chevron-right',
4980
4980
  iconOpenFieldSidebar: 'icon-chevron-left',
4981
4981
  iconAdd: 'icon-add',
@@ -5018,6 +5018,8 @@ const UtFormConstructor = {
5018
5018
 
5019
5019
  if (formConfig.rules) {
5020
5020
  this.config.rules = formConfig.rules;
5021
+ console.log("THIS.CONFIG", this.config);
5022
+ console.log("THIS.CONFIG.RULES", this.config.rules);
5021
5023
  }
5022
5024
 
5023
5025
  if (formConfig.ruleContext) {
@@ -10807,16 +10809,15 @@ var script$4 = {
10807
10809
  let innerFacets = this.facets.map(f => ({ ...f,
10808
10810
  expanded: false
10809
10811
  }));
10810
- this.innerFacets = JSON.parse(JSON.stringify(innerFacets));
10811
- this.allFacets = JSON.parse(JSON.stringify(innerFacets));
10812
- },
10813
10812
 
10814
- getVisibleFields(facet) {
10815
- if (!facet || !facet.fields) {
10816
- return [];
10813
+ if (innerFacets) {
10814
+ innerFacets.forEach(facet => {
10815
+ facet.fields = facet.fields.filter(field => !field.hiddenOnFormConfig);
10816
+ });
10817
10817
  }
10818
10818
 
10819
- return facet.fields.filter(field => !field.hiddenOnFormConfig);
10819
+ this.innerFacets = JSON.parse(JSON.stringify(innerFacets));
10820
+ this.allFacets = JSON.parse(JSON.stringify(innerFacets));
10820
10821
  }
10821
10822
 
10822
10823
  },
@@ -10858,7 +10859,7 @@ var __vue_render__$4 = function () {
10858
10859
  })], 1)], 1)], 1)], 1), _vm._v(" "), _c('div', {
10859
10860
  staticClass: "rb-facet-list"
10860
10861
  }, _vm._l(_vm.innerFacets, function (facet) {
10861
- return _vm.getVisibleFields(facet).length > 0 ? _c('div', {
10862
+ return facet.fields.length > 0 ? _c('div', {
10862
10863
  key: facet.name,
10863
10864
  staticClass: "rb-facet"
10864
10865
  }, [_c('h6', {
@@ -10897,7 +10898,7 @@ var __vue_render__$4 = function () {
10897
10898
  },
10898
10899
  expression: "facet.fields"
10899
10900
  }
10900
- }, _vm._l(_vm.getVisibleFields(facet), function (field) {
10901
+ }, _vm._l(facet.fields, function (field) {
10901
10902
  return _c('b-list-group-item', {
10902
10903
  key: field.name,
10903
10904
  staticClass: "cursor-pointer"
@@ -11010,9 +11011,9 @@ var script$3 = {
11010
11011
  type: Object,
11011
11012
  default: () => ({})
11012
11013
  },
11013
- refDataSuffix: {
11014
+ refSuffix: {
11014
11015
  type: String,
11015
- default: 'Data'
11016
+ default: 'Id'
11016
11017
  }
11017
11018
  },
11018
11019
 
@@ -11025,7 +11026,15 @@ var script$3 = {
11025
11026
  methods: {
11026
11027
  onEventFired(eventName, event, field) {
11027
11028
  if (eventName === 'input' && field.ref) {
11028
- this.doc[field.name + this.refDataSuffix] = null;
11029
+ let dataField = null;
11030
+
11031
+ if (field.name.lastIndexOf(this.refSuffix) >= 0) {
11032
+ dataField = field.name.substring(0, field.name.lastIndexOf(this.refSuffix));
11033
+ }
11034
+
11035
+ if (dataField && dataField.length > 0) {
11036
+ this.doc[dataField] = null;
11037
+ }
11029
11038
  }
11030
11039
 
11031
11040
  if (field.rules) {
@@ -11216,6 +11225,7 @@ var script$2 = {
11216
11225
  },
11217
11226
 
11218
11227
  rulePresets() {
11228
+ console.log("rulePresets", UtFormConstructor.getAvailableFieldRules(this.field));
11219
11229
  return UtFormConstructor.getAvailableFieldRules(this.field);
11220
11230
  }
11221
11231