@iankibetsh/shframework 0.2.2 → 0.2.5

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.
@@ -30,3 +30,24 @@
30
30
  font-weight: 300;
31
31
  opacity: 0.5;
32
32
  }
33
+
34
+ :root {
35
+ --ck-z-default: 10555 !important;
36
+ --ck-z-modal: calc(var(--ck-z-default) + 999) !important;
37
+ }
38
+ .mceToolbar td {
39
+ display:table-row;
40
+ float: left;
41
+ }
42
+ .mceToolbar td:nth-of-type(11){
43
+ clear: left;
44
+ }
45
+
46
+ @media screen and (max-width:600px) {
47
+ .sh-editor{
48
+ width: 100% !important;
49
+ }
50
+ table.mceLayout, textarea.tinyMCE {
51
+ width: 100% !important;
52
+ }
53
+ }
package/dist/library.js CHANGED
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var Axios = require('axios');
6
6
  var NProgress = require('nprogress');
7
7
  var vue = require('vue');
8
+ var Editor = require('@tinymce/tinymce-vue');
8
9
  var moment = require('moment');
9
10
  var Swal = require('sweetalert2');
10
11
  var pinia = require('pinia');
@@ -13,6 +14,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
13
14
 
14
15
  var Axios__default = /*#__PURE__*/_interopDefaultLegacy(Axios);
15
16
  var NProgress__default = /*#__PURE__*/_interopDefaultLegacy(NProgress);
17
+ var Editor__default = /*#__PURE__*/_interopDefaultLegacy(Editor);
16
18
  var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
17
19
  var Swal__default = /*#__PURE__*/_interopDefaultLegacy(Swal);
18
20
 
@@ -1542,7 +1544,7 @@ const countries = [
1542
1544
  }
1543
1545
  ];
1544
1546
 
1545
- var script$6 = {
1547
+ var script$7 = {
1546
1548
  name: 'ShPhone',
1547
1549
  props: ['modelValue', 'country_code'],
1548
1550
  data () {
@@ -1604,7 +1606,7 @@ var script$6 = {
1604
1606
  }
1605
1607
  };
1606
1608
 
1607
- const _hoisted_1$6 = { class: "sh-phone mb-3" };
1609
+ const _hoisted_1$7 = { class: "sh-phone mb-3" };
1608
1610
  const _hoisted_2$6 = {
1609
1611
  key: 0,
1610
1612
  style: {"display":"contents"}
@@ -1612,8 +1614,8 @@ const _hoisted_2$6 = {
1612
1614
  const _hoisted_3$6 = ["src"];
1613
1615
  const _hoisted_4$5 = ["value"];
1614
1616
 
1615
- function render$6(_ctx, _cache, $props, $setup, $data, $options) {
1616
- return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
1617
+ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
1618
+ return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [
1617
1619
  ($data.selectedCountry)
1618
1620
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$6, [
1619
1621
  vue.createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$6),
@@ -1647,15 +1649,93 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
1647
1649
  ]))
1648
1650
  }
1649
1651
 
1652
+ script$7.render = render$7;
1653
+ script$7.__file = "src/views/ShPhone.vue";
1654
+
1655
+ var script$6 = {
1656
+ name: 'ShEditor',
1657
+ props: ['modelValue'],
1658
+ components: {
1659
+ editor: Editor__default["default"]
1660
+ },
1661
+ data () {
1662
+ return {
1663
+ editorData: this.modelValue
1664
+ }
1665
+ },
1666
+ computed: {
1667
+ value: {
1668
+ get () {
1669
+ return this.modelValue
1670
+ },
1671
+ set (value) {
1672
+ this.$emit('update:modelValue', value);
1673
+ }
1674
+ }
1675
+ },
1676
+ created () {
1677
+ document.addEventListener('focusin', function (e) {
1678
+ const closest = e.target.closest('.tox-tinymce-aux, .tox-dialog, .moxman-window, .tam-assetmanager-root');
1679
+ if (closest !== null && closest !== undefined) {
1680
+ e.stopImmediatePropagation();
1681
+ }
1682
+ });
1683
+ },
1684
+ mounted () {
1685
+ this.editorData = this.modelValue;
1686
+ },
1687
+ methods: {
1688
+ updateValue: function () {
1689
+ // alert('paste')
1690
+ }
1691
+ }
1692
+ };
1693
+
1694
+ const _hoisted_1$6 = /*#__PURE__*/vue.createElementVNode("textarea", {
1695
+ id: "tiny",
1696
+ style: {"display":"none"},
1697
+ "data-cy": "tinymce_editor"
1698
+ }, null, -1 /* HOISTED */);
1699
+
1700
+ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
1701
+ const _component_editor = vue.resolveComponent("editor");
1702
+
1703
+ return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
1704
+ _hoisted_1$6,
1705
+ vue.createElementVNode("div", {
1706
+ onFocusin: _cache[1] || (_cache[1] = vue.withModifiers(() => {}, ["stop"])),
1707
+ class: "sh-editor w-100"
1708
+ }, [
1709
+ vue.createVNode(_component_editor, {
1710
+ class: "tinyEditor",
1711
+ "api-key": "v5otxmculqf59xfg2bqr2ucw56cbqgbqo4x9gym2kwbv1rvi",
1712
+ onInput: $options.updateValue,
1713
+ onKeyup: $options.updateValue,
1714
+ modelValue: $options.value,
1715
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($options.value) = $event)),
1716
+ init: {
1717
+ selector: 'textarea#tiny',
1718
+ valid_children : '+body[style],+body[script]',
1719
+ extended_valid_elements : '*[*]',
1720
+ contextmenu: false,
1721
+ plugins: 'lists link image emoticons code autolink',
1722
+ toolbar: 'styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist | link image emoticons code'
1723
+ }
1724
+ }, null, 8 /* PROPS */, ["onInput", "onKeyup", "modelValue"])
1725
+ ], 32 /* HYDRATE_EVENTS */)
1726
+ ], 64 /* STABLE_FRAGMENT */))
1727
+ }
1728
+
1650
1729
  script$6.render = render$6;
1651
- script$6.__file = "src/views/ShPhone.vue";
1730
+ script$6.__file = "src/views/FormComponent/ShEditor.vue";
1652
1731
 
1653
1732
  var script$5 = {
1654
1733
  name: 'ShForm',
1655
1734
  components: {
1656
- ShPhone: script$6
1735
+ ShEditor: script$6,
1736
+ ShPhone: script$7
1657
1737
  },
1658
- props: ['action', 'classes', 'hasTerms', 'country_code', 'submit_btn_class', 'fields', 'columns', 'placeholders', 'field_permissions', 'retain_data_after_submission', 'current_data', 'action_label', 'fill_selects', 'phones', 'successCallback', 'failed_callback', 'labels'],
1738
+ props: ['action', 'classes', 'hasTerms', 'country_code', 'submitBtnClass', 'fields', 'columns', 'placeholders', 'field_permissions', 'retainDataAfterSubmission', 'currentData', 'actionLabel', 'fillSelects', 'phones', 'successCallback', 'failed_callback', 'labels', 'editors'],
1659
1739
  data: function () {
1660
1740
  return {
1661
1741
  form_elements: {},
@@ -1671,14 +1751,9 @@ var script$5 = {
1671
1751
  allLabels: {}
1672
1752
  }
1673
1753
  },
1674
- computed: {
1675
- currentData () {
1676
- return this.current_data
1677
- }
1678
- },
1679
1754
  methods: {
1680
1755
  getSubmitBtnClass: function () {
1681
- const btnClass = this.submit_btn_class;
1756
+ const btnClass = this.submitBtnClass;
1682
1757
  if (!btnClass) {
1683
1758
  return 'btn btn-primary mt-2'
1684
1759
  } else {
@@ -1702,7 +1777,10 @@ var script$5 = {
1702
1777
  const selects = ['gender', 'payment_method', 'allow_view_mode', 'reasons_name', 'has_free_tier', 'payment_period', 'role', 'register_as', 'account_type'];
1703
1778
  const numbers = ['age'];
1704
1779
  const datePickers = ['free_tier_days', 'recurring_date', 'date', 'paid_at'];
1705
- const editors = ['html_content', 'listing_description', 'mail'];
1780
+ let editors = ['html_content', 'listing_description', 'mail'];
1781
+ if(this.editors){
1782
+ editors = editors.concat(this.editors);
1783
+ }
1706
1784
  const mapLocations = ['building_location'];
1707
1785
  const files = ['file', 'logo'];
1708
1786
  const phones = ['phone'];
@@ -1817,7 +1895,7 @@ var script$5 = {
1817
1895
  this.form_status = 2;
1818
1896
  Object.keys(this.form_elements).forEach(key => {
1819
1897
  this.form_errors[key] = null;
1820
- if (!this.retain_data_after_submission) {
1898
+ if (!this.retainDataAfterSubmission) {
1821
1899
  this.form_elements[key] = '';
1822
1900
  }
1823
1901
  });
@@ -1886,14 +1964,14 @@ var script$5 = {
1886
1964
  },
1887
1965
  mounted: async function () {
1888
1966
  const selectData = {};
1889
- if (this.fill_selects) {
1890
- Object.keys(this.fill_selects).forEach(key => {
1891
- if (this.fill_selects[key].data) {
1892
- selectData[key] = this.fill_selects[key].data;
1967
+ if (this.fillSelects) {
1968
+ Object.keys(this.fillSelects).forEach(key => {
1969
+ if (this.fillSelects[key].data) {
1970
+ selectData[key] = this.fillSelects[key].data;
1893
1971
  this.selectData = selectData;
1894
1972
  console.log(this.selectData);
1895
1973
  } else {
1896
- apis.doGet(this.fill_selects[key].url, { all: 1 }).then(res => {
1974
+ apis.doGet(this.fillSelects[key].url, { all: 1 }).then(res => {
1897
1975
  // selectData[key] = res.data
1898
1976
  // console.log(res)
1899
1977
  this.selectData[key] = res.data.data;
@@ -1946,7 +2024,7 @@ const _hoisted_15$2 = ["name", "onFocus", "onUpdate:modelValue"];
1946
2024
  const _hoisted_16$2 = ["name", "onFocus", "onUpdate:modelValue"];
1947
2025
  const _hoisted_17$2 = ["value"];
1948
2026
  const _hoisted_18$2 = {
1949
- key: 9,
2027
+ key: 10,
1950
2028
  class: "invalid-feedback"
1951
2029
  };
1952
2030
  const _hoisted_19$2 = {
@@ -1979,6 +2057,7 @@ const _hoisted_23$2 = {
1979
2057
 
1980
2058
  function render$5(_ctx, _cache, $props, $setup, $data, $options) {
1981
2059
  const _component_ShPhone = vue.resolveComponent("ShPhone");
2060
+ const _component_ShEditor = vue.resolveComponent("ShEditor");
1982
2061
 
1983
2062
  return (vue.openBlock(), vue.createElementBlock("form", _hoisted_1$5, [
1984
2063
  vue.createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
@@ -2083,9 +2162,20 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2083
2162
  required: ""
2084
2163
  }, null, 8 /* PROPS */, ["country_code", "placeholder", "name", "onFocus", "class", "modelValue", "onUpdate:modelValue"]))
2085
2164
  : vue.createCommentVNode("v-if", true),
2165
+ ($options.getFieldType(field) === 'editor')
2166
+ ? (vue.openBlock(), vue.createBlock(_component_ShEditor, {
2167
+ key: 6,
2168
+ placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2169
+ name: field,
2170
+ onFocus: $event => ($options.removeErrors(field)),
2171
+ class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2172
+ modelValue: _ctx.form_elements[field],
2173
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2174
+ }, null, 8 /* PROPS */, ["placeholder", "name", "onFocus", "class", "modelValue", "onUpdate:modelValue"]))
2175
+ : vue.createCommentVNode("v-if", true),
2086
2176
  ($options.getFieldType(field) === 'text')
2087
2177
  ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
2088
- key: 6,
2178
+ key: 7,
2089
2179
  disabled: $options.isDisabled(field),
2090
2180
  placeholder: field === 'phone_number' ? 'e.g 0712 345 678':'',
2091
2181
  name: field,
@@ -2099,7 +2189,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2099
2189
  : vue.createCommentVNode("v-if", true),
2100
2190
  ($options.getFieldType(field) === 'textarea')
2101
2191
  ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("textarea", {
2102
- key: 7,
2192
+ key: 8,
2103
2193
  name: field,
2104
2194
  onFocus: $event => ($options.removeErrors(field)),
2105
2195
  class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
@@ -2110,7 +2200,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2110
2200
  : vue.createCommentVNode("v-if", true),
2111
2201
  ($options.getFieldType(field) === 'select' && _ctx.selectData[field] != null)
2112
2202
  ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("select", {
2113
- key: 8,
2203
+ key: 9,
2114
2204
  name: field,
2115
2205
  onFocus: $event => ($options.removeErrors(field)),
2116
2206
  class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
@@ -2142,7 +2232,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2142
2232
  type: "button",
2143
2233
  onClick: _cache[1] || (_cache[1] = (...args) => ($options.submitForm && $options.submitForm(...args)))
2144
2234
  }, [
2145
- vue.createTextVNode(vue.toDisplayString($props.action_label ? $props.action_label:'Submit') + " ", 1 /* TEXT */),
2235
+ vue.createTextVNode(vue.toDisplayString($props.actionLabel ? $props.actionLabel:'Submit') + " ", 1 /* TEXT */),
2146
2236
  (_ctx.form_status == 1)
2147
2237
  ? (vue.openBlock(), vue.createElementBlock("img", _hoisted_23$2))
2148
2238
  : vue.createCommentVNode("v-if", true)
@@ -3439,10 +3529,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
3439
3529
  ]),
3440
3530
  vue.createElementVNode("div", _hoisted_3, [
3441
3531
  vue.createVNode(_component_router_view, {
3442
- current_tab: $data.currentTab,
3532
+ currentTab: $data.currentTab,
3443
3533
  sharedData: $props.sharedData,
3444
3534
  tabCounts: $props.tabCounts
3445
- }, null, 8 /* PROPS */, ["current_tab", "sharedData", "tabCounts"])
3535
+ }, null, 8 /* PROPS */, ["currentTab", "sharedData", "tabCounts"])
3446
3536
  ])
3447
3537
  ]))
3448
3538
  }
@@ -3531,7 +3621,7 @@ const useUserStore = pinia.defineStore('user-store', {
3531
3621
  exports.ShCanvas = script$4;
3532
3622
  exports.ShForm = script$5;
3533
3623
  exports.ShModal = script$3;
3534
- exports.ShPhone = script$6;
3624
+ exports.ShPhone = script$7;
3535
3625
  exports.ShTable = script$1;
3536
3626
  exports.ShTabs = script;
3537
3627
  exports.shApis = apis;
package/dist/library.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import Axios from 'axios';
2
2
  import NProgress from 'nprogress';
3
- import { openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, withDirectives, Fragment, renderList, vModelSelect, vModelText, resolveComponent, normalizeClass, createBlock, renderSlot, createStaticVNode, withCtx, createVNode } from 'vue';
3
+ import { openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, withDirectives, Fragment, renderList, vModelSelect, vModelText, resolveComponent, withModifiers, createVNode, normalizeClass, createBlock, renderSlot, createStaticVNode, withCtx } from 'vue';
4
+ import Editor from '@tinymce/tinymce-vue';
4
5
  import moment from 'moment';
5
6
  import Swal from 'sweetalert2';
6
7
  import { defineStore } from 'pinia';
@@ -1531,7 +1532,7 @@ const countries = [
1531
1532
  }
1532
1533
  ];
1533
1534
 
1534
- var script$6 = {
1535
+ var script$7 = {
1535
1536
  name: 'ShPhone',
1536
1537
  props: ['modelValue', 'country_code'],
1537
1538
  data () {
@@ -1593,7 +1594,7 @@ var script$6 = {
1593
1594
  }
1594
1595
  };
1595
1596
 
1596
- const _hoisted_1$6 = { class: "sh-phone mb-3" };
1597
+ const _hoisted_1$7 = { class: "sh-phone mb-3" };
1597
1598
  const _hoisted_2$6 = {
1598
1599
  key: 0,
1599
1600
  style: {"display":"contents"}
@@ -1601,8 +1602,8 @@ const _hoisted_2$6 = {
1601
1602
  const _hoisted_3$6 = ["src"];
1602
1603
  const _hoisted_4$5 = ["value"];
1603
1604
 
1604
- function render$6(_ctx, _cache, $props, $setup, $data, $options) {
1605
- return (openBlock(), createElementBlock("div", _hoisted_1$6, [
1605
+ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
1606
+ return (openBlock(), createElementBlock("div", _hoisted_1$7, [
1606
1607
  ($data.selectedCountry)
1607
1608
  ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
1608
1609
  createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$6),
@@ -1636,15 +1637,93 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
1636
1637
  ]))
1637
1638
  }
1638
1639
 
1640
+ script$7.render = render$7;
1641
+ script$7.__file = "src/views/ShPhone.vue";
1642
+
1643
+ var script$6 = {
1644
+ name: 'ShEditor',
1645
+ props: ['modelValue'],
1646
+ components: {
1647
+ editor: Editor
1648
+ },
1649
+ data () {
1650
+ return {
1651
+ editorData: this.modelValue
1652
+ }
1653
+ },
1654
+ computed: {
1655
+ value: {
1656
+ get () {
1657
+ return this.modelValue
1658
+ },
1659
+ set (value) {
1660
+ this.$emit('update:modelValue', value);
1661
+ }
1662
+ }
1663
+ },
1664
+ created () {
1665
+ document.addEventListener('focusin', function (e) {
1666
+ const closest = e.target.closest('.tox-tinymce-aux, .tox-dialog, .moxman-window, .tam-assetmanager-root');
1667
+ if (closest !== null && closest !== undefined) {
1668
+ e.stopImmediatePropagation();
1669
+ }
1670
+ });
1671
+ },
1672
+ mounted () {
1673
+ this.editorData = this.modelValue;
1674
+ },
1675
+ methods: {
1676
+ updateValue: function () {
1677
+ // alert('paste')
1678
+ }
1679
+ }
1680
+ };
1681
+
1682
+ const _hoisted_1$6 = /*#__PURE__*/createElementVNode("textarea", {
1683
+ id: "tiny",
1684
+ style: {"display":"none"},
1685
+ "data-cy": "tinymce_editor"
1686
+ }, null, -1 /* HOISTED */);
1687
+
1688
+ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
1689
+ const _component_editor = resolveComponent("editor");
1690
+
1691
+ return (openBlock(), createElementBlock(Fragment, null, [
1692
+ _hoisted_1$6,
1693
+ createElementVNode("div", {
1694
+ onFocusin: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"])),
1695
+ class: "sh-editor w-100"
1696
+ }, [
1697
+ createVNode(_component_editor, {
1698
+ class: "tinyEditor",
1699
+ "api-key": "v5otxmculqf59xfg2bqr2ucw56cbqgbqo4x9gym2kwbv1rvi",
1700
+ onInput: $options.updateValue,
1701
+ onKeyup: $options.updateValue,
1702
+ modelValue: $options.value,
1703
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($options.value) = $event)),
1704
+ init: {
1705
+ selector: 'textarea#tiny',
1706
+ valid_children : '+body[style],+body[script]',
1707
+ extended_valid_elements : '*[*]',
1708
+ contextmenu: false,
1709
+ plugins: 'lists link image emoticons code autolink',
1710
+ toolbar: 'styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist | link image emoticons code'
1711
+ }
1712
+ }, null, 8 /* PROPS */, ["onInput", "onKeyup", "modelValue"])
1713
+ ], 32 /* HYDRATE_EVENTS */)
1714
+ ], 64 /* STABLE_FRAGMENT */))
1715
+ }
1716
+
1639
1717
  script$6.render = render$6;
1640
- script$6.__file = "src/views/ShPhone.vue";
1718
+ script$6.__file = "src/views/FormComponent/ShEditor.vue";
1641
1719
 
1642
1720
  var script$5 = {
1643
1721
  name: 'ShForm',
1644
1722
  components: {
1645
- ShPhone: script$6
1723
+ ShEditor: script$6,
1724
+ ShPhone: script$7
1646
1725
  },
1647
- props: ['action', 'classes', 'hasTerms', 'country_code', 'submit_btn_class', 'fields', 'columns', 'placeholders', 'field_permissions', 'retain_data_after_submission', 'current_data', 'action_label', 'fill_selects', 'phones', 'successCallback', 'failed_callback', 'labels'],
1726
+ props: ['action', 'classes', 'hasTerms', 'country_code', 'submitBtnClass', 'fields', 'columns', 'placeholders', 'field_permissions', 'retainDataAfterSubmission', 'currentData', 'actionLabel', 'fillSelects', 'phones', 'successCallback', 'failed_callback', 'labels', 'editors'],
1648
1727
  data: function () {
1649
1728
  return {
1650
1729
  form_elements: {},
@@ -1660,14 +1739,9 @@ var script$5 = {
1660
1739
  allLabels: {}
1661
1740
  }
1662
1741
  },
1663
- computed: {
1664
- currentData () {
1665
- return this.current_data
1666
- }
1667
- },
1668
1742
  methods: {
1669
1743
  getSubmitBtnClass: function () {
1670
- const btnClass = this.submit_btn_class;
1744
+ const btnClass = this.submitBtnClass;
1671
1745
  if (!btnClass) {
1672
1746
  return 'btn btn-primary mt-2'
1673
1747
  } else {
@@ -1691,7 +1765,10 @@ var script$5 = {
1691
1765
  const selects = ['gender', 'payment_method', 'allow_view_mode', 'reasons_name', 'has_free_tier', 'payment_period', 'role', 'register_as', 'account_type'];
1692
1766
  const numbers = ['age'];
1693
1767
  const datePickers = ['free_tier_days', 'recurring_date', 'date', 'paid_at'];
1694
- const editors = ['html_content', 'listing_description', 'mail'];
1768
+ let editors = ['html_content', 'listing_description', 'mail'];
1769
+ if(this.editors){
1770
+ editors = editors.concat(this.editors);
1771
+ }
1695
1772
  const mapLocations = ['building_location'];
1696
1773
  const files = ['file', 'logo'];
1697
1774
  const phones = ['phone'];
@@ -1806,7 +1883,7 @@ var script$5 = {
1806
1883
  this.form_status = 2;
1807
1884
  Object.keys(this.form_elements).forEach(key => {
1808
1885
  this.form_errors[key] = null;
1809
- if (!this.retain_data_after_submission) {
1886
+ if (!this.retainDataAfterSubmission) {
1810
1887
  this.form_elements[key] = '';
1811
1888
  }
1812
1889
  });
@@ -1875,14 +1952,14 @@ var script$5 = {
1875
1952
  },
1876
1953
  mounted: async function () {
1877
1954
  const selectData = {};
1878
- if (this.fill_selects) {
1879
- Object.keys(this.fill_selects).forEach(key => {
1880
- if (this.fill_selects[key].data) {
1881
- selectData[key] = this.fill_selects[key].data;
1955
+ if (this.fillSelects) {
1956
+ Object.keys(this.fillSelects).forEach(key => {
1957
+ if (this.fillSelects[key].data) {
1958
+ selectData[key] = this.fillSelects[key].data;
1882
1959
  this.selectData = selectData;
1883
1960
  console.log(this.selectData);
1884
1961
  } else {
1885
- apis.doGet(this.fill_selects[key].url, { all: 1 }).then(res => {
1962
+ apis.doGet(this.fillSelects[key].url, { all: 1 }).then(res => {
1886
1963
  // selectData[key] = res.data
1887
1964
  // console.log(res)
1888
1965
  this.selectData[key] = res.data.data;
@@ -1935,7 +2012,7 @@ const _hoisted_15$2 = ["name", "onFocus", "onUpdate:modelValue"];
1935
2012
  const _hoisted_16$2 = ["name", "onFocus", "onUpdate:modelValue"];
1936
2013
  const _hoisted_17$2 = ["value"];
1937
2014
  const _hoisted_18$2 = {
1938
- key: 9,
2015
+ key: 10,
1939
2016
  class: "invalid-feedback"
1940
2017
  };
1941
2018
  const _hoisted_19$2 = {
@@ -1968,6 +2045,7 @@ const _hoisted_23$2 = {
1968
2045
 
1969
2046
  function render$5(_ctx, _cache, $props, $setup, $data, $options) {
1970
2047
  const _component_ShPhone = resolveComponent("ShPhone");
2048
+ const _component_ShEditor = resolveComponent("ShEditor");
1971
2049
 
1972
2050
  return (openBlock(), createElementBlock("form", _hoisted_1$5, [
1973
2051
  createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
@@ -2072,9 +2150,20 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2072
2150
  required: ""
2073
2151
  }, null, 8 /* PROPS */, ["country_code", "placeholder", "name", "onFocus", "class", "modelValue", "onUpdate:modelValue"]))
2074
2152
  : createCommentVNode("v-if", true),
2153
+ ($options.getFieldType(field) === 'editor')
2154
+ ? (openBlock(), createBlock(_component_ShEditor, {
2155
+ key: 6,
2156
+ placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2157
+ name: field,
2158
+ onFocus: $event => ($options.removeErrors(field)),
2159
+ class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2160
+ modelValue: _ctx.form_elements[field],
2161
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2162
+ }, null, 8 /* PROPS */, ["placeholder", "name", "onFocus", "class", "modelValue", "onUpdate:modelValue"]))
2163
+ : createCommentVNode("v-if", true),
2075
2164
  ($options.getFieldType(field) === 'text')
2076
2165
  ? withDirectives((openBlock(), createElementBlock("input", {
2077
- key: 6,
2166
+ key: 7,
2078
2167
  disabled: $options.isDisabled(field),
2079
2168
  placeholder: field === 'phone_number' ? 'e.g 0712 345 678':'',
2080
2169
  name: field,
@@ -2088,7 +2177,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2088
2177
  : createCommentVNode("v-if", true),
2089
2178
  ($options.getFieldType(field) === 'textarea')
2090
2179
  ? withDirectives((openBlock(), createElementBlock("textarea", {
2091
- key: 7,
2180
+ key: 8,
2092
2181
  name: field,
2093
2182
  onFocus: $event => ($options.removeErrors(field)),
2094
2183
  class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
@@ -2099,7 +2188,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2099
2188
  : createCommentVNode("v-if", true),
2100
2189
  ($options.getFieldType(field) === 'select' && _ctx.selectData[field] != null)
2101
2190
  ? withDirectives((openBlock(), createElementBlock("select", {
2102
- key: 8,
2191
+ key: 9,
2103
2192
  name: field,
2104
2193
  onFocus: $event => ($options.removeErrors(field)),
2105
2194
  class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
@@ -2131,7 +2220,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2131
2220
  type: "button",
2132
2221
  onClick: _cache[1] || (_cache[1] = (...args) => ($options.submitForm && $options.submitForm(...args)))
2133
2222
  }, [
2134
- createTextVNode(toDisplayString($props.action_label ? $props.action_label:'Submit') + " ", 1 /* TEXT */),
2223
+ createTextVNode(toDisplayString($props.actionLabel ? $props.actionLabel:'Submit') + " ", 1 /* TEXT */),
2135
2224
  (_ctx.form_status == 1)
2136
2225
  ? (openBlock(), createElementBlock("img", _hoisted_23$2))
2137
2226
  : createCommentVNode("v-if", true)
@@ -3428,10 +3517,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
3428
3517
  ]),
3429
3518
  createElementVNode("div", _hoisted_3, [
3430
3519
  createVNode(_component_router_view, {
3431
- current_tab: $data.currentTab,
3520
+ currentTab: $data.currentTab,
3432
3521
  sharedData: $props.sharedData,
3433
3522
  tabCounts: $props.tabCounts
3434
- }, null, 8 /* PROPS */, ["current_tab", "sharedData", "tabCounts"])
3523
+ }, null, 8 /* PROPS */, ["currentTab", "sharedData", "tabCounts"])
3435
3524
  ])
3436
3525
  ]))
3437
3526
  }
@@ -3517,4 +3606,4 @@ const useUserStore = defineStore('user-store', {
3517
3606
  }
3518
3607
  });
3519
3608
 
3520
- export { script$4 as ShCanvas, script$5 as ShForm, script$3 as ShModal, script$6 as ShPhone, script$1 as ShTable, script as ShTabs, apis as shApis, helpers as shRepo, shstorage as shStorage, useUserStore };
3609
+ export { script$4 as ShCanvas, script$5 as ShForm, script$3 as ShModal, script$7 as ShPhone, script$1 as ShTable, script as ShTabs, apis as shApis, helpers as shRepo, shstorage as shStorage, useUserStore };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "0.2.2",
3
+ "version": "0.2.5",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",
@@ -22,7 +22,8 @@
22
22
  "nprogress": "^0.2.0",
23
23
  "pinia": "^2.0.13",
24
24
  "sweetalert2": "^11.4.14",
25
- "vue": "^3.2.37"
25
+ "vue": "^3.2.37",
26
+ "@tinymce/tinymce-vue": "^4.0.7"
26
27
  },
27
28
  "devDependencies": {
28
29
  "rollup": "^2.75.7",