@iankibetsh/shframework 0.3.5 → 0.3.8

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/library.js CHANGED
@@ -1735,7 +1735,22 @@ var script$5 = {
1735
1735
  ShEditor: script$6,
1736
1736
  ShPhone: script$7
1737
1737
  },
1738
- props: ['action', 'classes', 'hasTerms', 'country_code', 'submitBtnClass', 'fields', 'columns', 'placeholders', 'field_permissions', 'retainDataAfterSubmission', 'currentData', 'actionLabel', 'fillSelects', 'phones', 'successCallback', 'failed_callback', 'labels', 'editors'],
1738
+ props: [
1739
+ 'action',
1740
+ 'classes',
1741
+ 'hasTerms',
1742
+ 'country_code',
1743
+ 'submitBtnClass',
1744
+ 'fields',
1745
+ 'columns', 'placeholders', 'field_permissions', 'retainDataAfterSubmission',
1746
+ 'currentData', 'actionLabel', 'fillSelects', 'phones', 'successCallback',
1747
+ 'failedCallback', 'labels', 'editors',
1748
+ 'datePickers',
1749
+ 'textAreas',
1750
+ 'files',
1751
+ 'phones',
1752
+ 'numbers'
1753
+ ],
1739
1754
  data: function () {
1740
1755
  return {
1741
1756
  form_elements: {},
@@ -1773,14 +1788,26 @@ var script$5 = {
1773
1788
  }
1774
1789
  },
1775
1790
  getFieldType: function (field) {
1791
+ if(this.editors && this.editors.includes(field)){
1792
+ return 'editor'
1793
+ }
1794
+ if(this.textAreas && this.textAreas.includes(field)){
1795
+ return 'textarea'
1796
+ }
1797
+ if(this.datePickers && this.datePickers.includes(field)){
1798
+ return 'datepicker'
1799
+ }
1800
+ if(this.numbers && this.numbers.includes(field)){
1801
+ return 'numeric'
1802
+ }
1803
+ if(this.files && this.files.includes(field)){
1804
+ return 'file'
1805
+ }
1776
1806
  const textareas = ['message', 'meta_description', 'comment', 'call_response', 'comments', 'description'];
1777
1807
  const selects = ['gender', 'payment_method', 'allow_view_mode', 'reasons_name', 'has_free_tier', 'payment_period', 'role', 'register_as', 'account_type'];
1778
1808
  const numbers = ['age'];
1779
1809
  const datePickers = ['free_tier_days', 'recurring_date', 'date', 'paid_at'];
1780
- let editors = ['html_content', 'listing_description', 'mail'];
1781
- if(this.editors){
1782
- editors = editors.concat(this.editors);
1783
- }
1810
+ let realEditors = ['html_content', 'listing_description', 'mail', 'comment'];
1784
1811
  const mapLocations = ['building_location'];
1785
1812
  const files = ['file', 'logo'];
1786
1813
  const phones = ['phone'];
@@ -1805,7 +1832,7 @@ var script$5 = {
1805
1832
  if (mapLocations.includes(field)) {
1806
1833
  return 'location'
1807
1834
  }
1808
- if (editors.includes(field)) {
1835
+ if (realEditors.includes(field)) {
1809
1836
  return 'editor'
1810
1837
  }
1811
1838
  if (numbers.includes(field)) {
package/dist/library.mjs CHANGED
@@ -1723,7 +1723,22 @@ var script$5 = {
1723
1723
  ShEditor: script$6,
1724
1724
  ShPhone: script$7
1725
1725
  },
1726
- props: ['action', 'classes', 'hasTerms', 'country_code', 'submitBtnClass', 'fields', 'columns', 'placeholders', 'field_permissions', 'retainDataAfterSubmission', 'currentData', 'actionLabel', 'fillSelects', 'phones', 'successCallback', 'failed_callback', 'labels', 'editors'],
1726
+ props: [
1727
+ 'action',
1728
+ 'classes',
1729
+ 'hasTerms',
1730
+ 'country_code',
1731
+ 'submitBtnClass',
1732
+ 'fields',
1733
+ 'columns', 'placeholders', 'field_permissions', 'retainDataAfterSubmission',
1734
+ 'currentData', 'actionLabel', 'fillSelects', 'phones', 'successCallback',
1735
+ 'failedCallback', 'labels', 'editors',
1736
+ 'datePickers',
1737
+ 'textAreas',
1738
+ 'files',
1739
+ 'phones',
1740
+ 'numbers'
1741
+ ],
1727
1742
  data: function () {
1728
1743
  return {
1729
1744
  form_elements: {},
@@ -1761,14 +1776,26 @@ var script$5 = {
1761
1776
  }
1762
1777
  },
1763
1778
  getFieldType: function (field) {
1779
+ if(this.editors && this.editors.includes(field)){
1780
+ return 'editor'
1781
+ }
1782
+ if(this.textAreas && this.textAreas.includes(field)){
1783
+ return 'textarea'
1784
+ }
1785
+ if(this.datePickers && this.datePickers.includes(field)){
1786
+ return 'datepicker'
1787
+ }
1788
+ if(this.numbers && this.numbers.includes(field)){
1789
+ return 'numeric'
1790
+ }
1791
+ if(this.files && this.files.includes(field)){
1792
+ return 'file'
1793
+ }
1764
1794
  const textareas = ['message', 'meta_description', 'comment', 'call_response', 'comments', 'description'];
1765
1795
  const selects = ['gender', 'payment_method', 'allow_view_mode', 'reasons_name', 'has_free_tier', 'payment_period', 'role', 'register_as', 'account_type'];
1766
1796
  const numbers = ['age'];
1767
1797
  const datePickers = ['free_tier_days', 'recurring_date', 'date', 'paid_at'];
1768
- let editors = ['html_content', 'listing_description', 'mail'];
1769
- if(this.editors){
1770
- editors = editors.concat(this.editors);
1771
- }
1798
+ let realEditors = ['html_content', 'listing_description', 'mail', 'comment'];
1772
1799
  const mapLocations = ['building_location'];
1773
1800
  const files = ['file', 'logo'];
1774
1801
  const phones = ['phone'];
@@ -1793,7 +1820,7 @@ var script$5 = {
1793
1820
  if (mapLocations.includes(field)) {
1794
1821
  return 'location'
1795
1822
  }
1796
- if (editors.includes(field)) {
1823
+ if (realEditors.includes(field)) {
1797
1824
  return 'editor'
1798
1825
  }
1799
1826
  if (numbers.includes(field)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "0.3.5",
3
+ "version": "0.3.8",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",