tg-controls_cli 0.0.52 → 0.0.53

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.
@@ -34661,7 +34661,7 @@ if (typeof window !== 'undefined') {
34661
34661
  // Indicate to webpack that this file can be concatenated
34662
34662
  /* harmony default export */ var setPublicPath = (null);
34663
34663
 
34664
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e56dfd6a-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/DynamicForm.vue?vue&type=template&id=583327aa&
34664
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e56dfd6a-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/DynamicForm.vue?vue&type=template&id=fb2dbf10&
34665
34665
  var render = function render() {
34666
34666
  var _vm = this,
34667
34667
  _c = _vm._self._c;
@@ -34816,7 +34816,10 @@ var render = function render() {
34816
34816
  };
34817
34817
  var staticRenderFns = [];
34818
34818
 
34819
- // CONCATENATED MODULE: ./src/components/DynamicForm.vue?vue&type=template&id=583327aa&
34819
+ // CONCATENATED MODULE: ./src/components/DynamicForm.vue?vue&type=template&id=fb2dbf10&
34820
+
34821
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
34822
+ var es_array_push = __webpack_require__("14d9");
34820
34823
 
34821
34824
  // EXTERNAL MODULE: ./node_modules/axios/index.js
34822
34825
  var axios = __webpack_require__("bc3a");
@@ -38007,9 +38010,6 @@ var SelectFieldvue_type_template_id_314cc6f5_staticRenderFns = [];
38007
38010
 
38008
38011
  // CONCATENATED MODULE: ./src/components/SelectField.vue?vue&type=template&id=314cc6f5&
38009
38012
 
38010
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
38011
- var es_array_push = __webpack_require__("14d9");
38012
-
38013
38013
  // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SelectField.vue?vue&type=script&lang=js&
38014
38014
 
38015
38015
 
@@ -40672,6 +40672,7 @@ var SlotField_component = normalizeComponent(
40672
40672
 
40673
40673
 
40674
40674
 
40675
+
40675
40676
  //import { getFormValidationRules } from "./validationMessages.vue"
40676
40677
  /* harmony default export */ var DynamicFormvue_type_script_lang_js_ = ({
40677
40678
  name: 'DynamicForm',
@@ -40718,15 +40719,168 @@ var SlotField_component = normalizeComponent(
40718
40719
  default: false
40719
40720
  }
40720
40721
  },
40722
+ watch: {
40723
+ schema: {
40724
+ handler: function () {
40725
+ let ths = this;
40726
+ ths.schema.forEach(function (g, gi) {
40727
+ g.Data.forEach(function (f, fi) {
40728
+ ths.isShowBasedOnDependentField(f);
40729
+ });
40730
+ });
40731
+ },
40732
+ deep: true
40733
+ }
40734
+ },
40721
40735
  date: function () {
40722
40736
  return {
40723
40737
  validateForm: null
40724
40738
  };
40725
40739
  },
40726
40740
  mounted: function () {
40727
- this.validateForm = this.$refs.ObserverForm;
40741
+ let ths = this;
40742
+ ths.validateForm = ths.$refs.ObserverForm;
40728
40743
  },
40729
40744
  methods: {
40745
+ isShowBasedOnDependentField: function (field) {
40746
+ if (field && field.config && field.config.options) {
40747
+ field.config.initialOptions = field.config.options;
40748
+ }
40749
+ if (field && field.config && field.config.dependentOn && field.config.dependentOn > 0) {
40750
+ let depedentField = this.getFieldbyCustomFieldId(field.config.dependentOn);
40751
+ let showWhen = field.config.showWhen;
40752
+ let valueMapping = field.config.valueMapping;
40753
+ if (depedentField.value && depedentField.value != null && depedentField.value != "") {
40754
+ let showJson = JSON.parse(showWhen);
40755
+ if (showJson.value) {
40756
+ if (!isNaN(depedentField.value)) {
40757
+ if (showJson.value.includes(depedentField.value)) {
40758
+ field.visibility = true;
40759
+ }
40760
+ } else {
40761
+ var checkIfExists = [];
40762
+ try {
40763
+ if (depedentField.value.length && depedentField.value.length > 0) {
40764
+ depedentField.value.forEach(function (g, gi) {
40765
+ checkIfExists = showJson.value.filter(x => {
40766
+ return x == g.value;
40767
+ });
40768
+ });
40769
+ } else {
40770
+ checkIfExists = showJson.value.filter(x => {
40771
+ return x == depedentField.value.value;
40772
+ });
40773
+ }
40774
+ } catch (e) {
40775
+ checkIfExists = showJson.value.filter(x => {
40776
+ return x == depedentField.value.value;
40777
+ });
40778
+ }
40779
+ if (checkIfExists.length > 0) {
40780
+ field.visibility = true;
40781
+ } else {
40782
+ field.visibility = false;
40783
+ }
40784
+ }
40785
+ } else {
40786
+ field.visibility = true;
40787
+ }
40788
+ } else {
40789
+ field.visibility = false;
40790
+ }
40791
+ if (field.visibility == true) {}
40792
+ }
40793
+ },
40794
+ ConvertDynamicFormObjToCustomFieldObj: function (formSchema) {
40795
+ let returnObj = [];
40796
+ formSchema.forEach(function (item, index) {
40797
+ item.Data.forEach(function (field, fieldIndex) {
40798
+ let obj = {
40799
+ field_name: field.name,
40800
+ field_value: field.value,
40801
+ custom_field_id: field.customFieldId
40802
+ //SaveDynamicForm
40803
+ };
40804
+
40805
+ returnObj.push(obj);
40806
+ });
40807
+ });
40808
+ return returnObj;
40809
+ },
40810
+ ConvertCustomFieldIntoDynamicFormObj: function (fieldData) {
40811
+ let layoutData = [];
40812
+ var ths = this;
40813
+ if (fieldData.length > 0) {
40814
+ fieldData.forEach(function (field, fieldIndex) {
40815
+ var groupId = field.group_id;
40816
+ let checkIfAlreadyExist = layoutData.filter(x => {
40817
+ return x.groupId == groupId;
40818
+ });
40819
+ if (checkIfAlreadyExist.length == 0) {
40820
+ let fieldObj = fieldData.filter(x => {
40821
+ return x.group_id == groupId && (x.form_field_visibility == 'YES' || x.form_field_visibility == 'NO' && x.system_is_required == true);
40822
+ });
40823
+ if (fieldObj.length > 0) {
40824
+ let obj = {
40825
+ layoutType: field.layout_type,
40826
+ groupId: groupId,
40827
+ visibility: true,
40828
+ group_name: field.group_name,
40829
+ Data: []
40830
+ };
40831
+ fieldObj.forEach(function (fieldItem, fieldItemIndex) {
40832
+ let options = [];
40833
+ if (fieldItem.dt_code == "checkbox" || fieldItem.dt_code == "radio") {
40834
+ options = ths.MakeArray(fieldItem.select_options, fieldItem.dt_code);
40835
+ } else if (fieldItem.dt_code == "select" && fieldItem.picklist_options == 'Lookup') {
40836
+ options = ths.MakeNormalArray(fieldItem.select_options);
40837
+ } else if (fieldItem.dt_code == "select" && fieldItem.picklist_options != 'Lookup' && fieldItem.picklist_options != null) {
40838
+ options = ths.MakeArray(fieldItem.picklist_options, fieldItem.dt_code);
40839
+ }
40840
+ let validationRules = {};
40841
+ if (fieldItem.form_field_visibility == 'YES') {
40842
+ validationRules = {
40843
+ required: fieldItem.is_required == true
40844
+ };
40845
+ }
40846
+ let fieldObj = {
40847
+ customFieldId: fieldItem.custom_field_id,
40848
+ astype: fieldItem.astype == "TextAreaField" ? "SlotField" : fieldItem.astype,
40849
+ label: ths.$t(fieldItem.display_name),
40850
+ name: fieldItem.name,
40851
+ value: fieldItem.value,
40852
+ placeholder: "",
40853
+ config: {
40854
+ options: options,
40855
+ dependentOn: fieldItem.dependent_on,
40856
+ showWhen: fieldItem.show_when,
40857
+ valueMapping: fieldItem.value_mapping
40858
+ },
40859
+ mode: "",
40860
+ visibility: fieldItem.form_field_visibility == 'YES',
40861
+ validationRules: validationRules
40862
+ };
40863
+ obj.Data.push(fieldObj);
40864
+ });
40865
+ layoutData.push(obj);
40866
+ }
40867
+ }
40868
+ });
40869
+ }
40870
+ return layoutData;
40871
+ },
40872
+ getFieldbyCustomFieldId: function (customFieldId) {
40873
+ let returnVal = null;
40874
+ let ths = this;
40875
+ ths.schema.forEach(function (g, gi) {
40876
+ g.Data.forEach(function (f, fi) {
40877
+ if (f.customFieldId == customFieldId) {
40878
+ returnVal = f;
40879
+ }
40880
+ });
40881
+ });
40882
+ return returnVal;
40883
+ },
40730
40884
  renderButtons: function (buttons) {
40731
40885
  if (buttons) {
40732
40886
  var arrayConstructor = [].constructor;