@iankibetsh/shframework 0.2.0 → 0.2.3
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 +31 -24
- package/dist/library.mjs +31 -24
- package/package.json +1 -1
package/dist/library.js
CHANGED
|
@@ -1655,7 +1655,7 @@ var script$5 = {
|
|
|
1655
1655
|
components: {
|
|
1656
1656
|
ShPhone: script$6
|
|
1657
1657
|
},
|
|
1658
|
-
props: ['action', 'classes', 'hasTerms', 'country_code', '
|
|
1658
|
+
props: ['action', 'classes', 'hasTerms', 'country_code', 'submitBtnClass', 'fields', 'columns', 'placeholders', 'field_permissions', 'retainDataAfterSubmission', 'currentData', 'actionLabel', 'fillSelects', 'phones', 'successCallback', 'failed_callback', 'labels'],
|
|
1659
1659
|
data: function () {
|
|
1660
1660
|
return {
|
|
1661
1661
|
form_elements: {},
|
|
@@ -1671,14 +1671,9 @@ var script$5 = {
|
|
|
1671
1671
|
allLabels: {}
|
|
1672
1672
|
}
|
|
1673
1673
|
},
|
|
1674
|
-
computed: {
|
|
1675
|
-
currentData () {
|
|
1676
|
-
return this.current_data
|
|
1677
|
-
}
|
|
1678
|
-
},
|
|
1679
1674
|
methods: {
|
|
1680
1675
|
getSubmitBtnClass: function () {
|
|
1681
|
-
const btnClass = this.
|
|
1676
|
+
const btnClass = this.submitBtnClass;
|
|
1682
1677
|
if (!btnClass) {
|
|
1683
1678
|
return 'btn btn-primary mt-2'
|
|
1684
1679
|
} else {
|
|
@@ -1817,18 +1812,18 @@ var script$5 = {
|
|
|
1817
1812
|
this.form_status = 2;
|
|
1818
1813
|
Object.keys(this.form_elements).forEach(key => {
|
|
1819
1814
|
this.form_errors[key] = null;
|
|
1820
|
-
if (!this.
|
|
1815
|
+
if (!this.retainDataAfterSubmission) {
|
|
1821
1816
|
this.form_elements[key] = '';
|
|
1822
1817
|
}
|
|
1823
1818
|
});
|
|
1824
1819
|
Object.keys(this.form_files).forEach(key => {
|
|
1825
1820
|
this.form_errors[key] = null;
|
|
1826
1821
|
});
|
|
1827
|
-
if (this.
|
|
1828
|
-
if (typeof this.
|
|
1829
|
-
this.
|
|
1822
|
+
if (this.successCallback) {
|
|
1823
|
+
if (typeof this.successCallback === 'function') {
|
|
1824
|
+
this.successCallback(res.data);
|
|
1830
1825
|
} else {
|
|
1831
|
-
this.$emit(this.
|
|
1826
|
+
this.$emit(this.successCallback, res.data);
|
|
1832
1827
|
}
|
|
1833
1828
|
}
|
|
1834
1829
|
NProgress__default["default"].done();
|
|
@@ -1886,14 +1881,14 @@ var script$5 = {
|
|
|
1886
1881
|
},
|
|
1887
1882
|
mounted: async function () {
|
|
1888
1883
|
const selectData = {};
|
|
1889
|
-
if (this.
|
|
1890
|
-
Object.keys(this.
|
|
1891
|
-
if (this.
|
|
1892
|
-
selectData[key] = this.
|
|
1884
|
+
if (this.fillSelects) {
|
|
1885
|
+
Object.keys(this.fillSelects).forEach(key => {
|
|
1886
|
+
if (this.fillSelects[key].data) {
|
|
1887
|
+
selectData[key] = this.fillSelects[key].data;
|
|
1893
1888
|
this.selectData = selectData;
|
|
1894
1889
|
console.log(this.selectData);
|
|
1895
1890
|
} else {
|
|
1896
|
-
apis.doGet(this.
|
|
1891
|
+
apis.doGet(this.fillSelects[key].url, { all: 1 }).then(res => {
|
|
1897
1892
|
// selectData[key] = res.data
|
|
1898
1893
|
// console.log(res)
|
|
1899
1894
|
this.selectData[key] = res.data.data;
|
|
@@ -2142,7 +2137,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2142
2137
|
type: "button",
|
|
2143
2138
|
onClick: _cache[1] || (_cache[1] = (...args) => ($options.submitForm && $options.submitForm(...args)))
|
|
2144
2139
|
}, [
|
|
2145
|
-
vue.createTextVNode(vue.toDisplayString($props.
|
|
2140
|
+
vue.createTextVNode(vue.toDisplayString($props.actionLabel ? $props.actionLabel:'Submit') + " ", 1 /* TEXT */),
|
|
2146
2141
|
(_ctx.form_status == 1)
|
|
2147
2142
|
? (vue.openBlock(), vue.createElementBlock("img", _hoisted_23$2))
|
|
2148
2143
|
: vue.createCommentVNode("v-if", true)
|
|
@@ -2864,25 +2859,37 @@ const _hoisted_13 = {
|
|
|
2864
2859
|
key: 0,
|
|
2865
2860
|
class: "text-center"
|
|
2866
2861
|
};
|
|
2867
|
-
const _hoisted_14 = /*#__PURE__*/vue.createElementVNode("
|
|
2868
|
-
|
|
2862
|
+
const _hoisted_14 = /*#__PURE__*/vue.createElementVNode("div", {
|
|
2863
|
+
class: "spinner-border",
|
|
2864
|
+
role: "status"
|
|
2865
|
+
}, [
|
|
2866
|
+
/*#__PURE__*/vue.createElementVNode("span", { class: "visually-hidden" }, "Loading...")
|
|
2869
2867
|
], -1 /* HOISTED */);
|
|
2870
2868
|
const _hoisted_15 = [
|
|
2871
2869
|
_hoisted_14
|
|
2872
2870
|
];
|
|
2873
|
-
const _hoisted_16 = {
|
|
2871
|
+
const _hoisted_16 = {
|
|
2872
|
+
key: 1,
|
|
2873
|
+
class: "alert alert-danger"
|
|
2874
|
+
};
|
|
2874
2875
|
const _hoisted_17 = { colspan: 2 };
|
|
2875
2876
|
const _hoisted_18 = {
|
|
2876
2877
|
key: 0,
|
|
2877
2878
|
class: "text-center"
|
|
2878
2879
|
};
|
|
2879
|
-
const _hoisted_19 = /*#__PURE__*/vue.createElementVNode("
|
|
2880
|
-
|
|
2880
|
+
const _hoisted_19 = /*#__PURE__*/vue.createElementVNode("div", {
|
|
2881
|
+
class: "spinner-border",
|
|
2882
|
+
role: "status"
|
|
2883
|
+
}, [
|
|
2884
|
+
/*#__PURE__*/vue.createElementVNode("span", { class: "visually-hidden" }, "Loading...")
|
|
2881
2885
|
], -1 /* HOISTED */);
|
|
2882
2886
|
const _hoisted_20 = [
|
|
2883
2887
|
_hoisted_19
|
|
2884
2888
|
];
|
|
2885
|
-
const _hoisted_21 = {
|
|
2889
|
+
const _hoisted_21 = {
|
|
2890
|
+
key: 1,
|
|
2891
|
+
class: "alert alert-danger"
|
|
2892
|
+
};
|
|
2886
2893
|
const _hoisted_22 = { colspan: 2 };
|
|
2887
2894
|
const _hoisted_23 = {
|
|
2888
2895
|
key: 4,
|
package/dist/library.mjs
CHANGED
|
@@ -1644,7 +1644,7 @@ var script$5 = {
|
|
|
1644
1644
|
components: {
|
|
1645
1645
|
ShPhone: script$6
|
|
1646
1646
|
},
|
|
1647
|
-
props: ['action', 'classes', 'hasTerms', 'country_code', '
|
|
1647
|
+
props: ['action', 'classes', 'hasTerms', 'country_code', 'submitBtnClass', 'fields', 'columns', 'placeholders', 'field_permissions', 'retainDataAfterSubmission', 'currentData', 'actionLabel', 'fillSelects', 'phones', 'successCallback', 'failed_callback', 'labels'],
|
|
1648
1648
|
data: function () {
|
|
1649
1649
|
return {
|
|
1650
1650
|
form_elements: {},
|
|
@@ -1660,14 +1660,9 @@ var script$5 = {
|
|
|
1660
1660
|
allLabels: {}
|
|
1661
1661
|
}
|
|
1662
1662
|
},
|
|
1663
|
-
computed: {
|
|
1664
|
-
currentData () {
|
|
1665
|
-
return this.current_data
|
|
1666
|
-
}
|
|
1667
|
-
},
|
|
1668
1663
|
methods: {
|
|
1669
1664
|
getSubmitBtnClass: function () {
|
|
1670
|
-
const btnClass = this.
|
|
1665
|
+
const btnClass = this.submitBtnClass;
|
|
1671
1666
|
if (!btnClass) {
|
|
1672
1667
|
return 'btn btn-primary mt-2'
|
|
1673
1668
|
} else {
|
|
@@ -1806,18 +1801,18 @@ var script$5 = {
|
|
|
1806
1801
|
this.form_status = 2;
|
|
1807
1802
|
Object.keys(this.form_elements).forEach(key => {
|
|
1808
1803
|
this.form_errors[key] = null;
|
|
1809
|
-
if (!this.
|
|
1804
|
+
if (!this.retainDataAfterSubmission) {
|
|
1810
1805
|
this.form_elements[key] = '';
|
|
1811
1806
|
}
|
|
1812
1807
|
});
|
|
1813
1808
|
Object.keys(this.form_files).forEach(key => {
|
|
1814
1809
|
this.form_errors[key] = null;
|
|
1815
1810
|
});
|
|
1816
|
-
if (this.
|
|
1817
|
-
if (typeof this.
|
|
1818
|
-
this.
|
|
1811
|
+
if (this.successCallback) {
|
|
1812
|
+
if (typeof this.successCallback === 'function') {
|
|
1813
|
+
this.successCallback(res.data);
|
|
1819
1814
|
} else {
|
|
1820
|
-
this.$emit(this.
|
|
1815
|
+
this.$emit(this.successCallback, res.data);
|
|
1821
1816
|
}
|
|
1822
1817
|
}
|
|
1823
1818
|
NProgress.done();
|
|
@@ -1875,14 +1870,14 @@ var script$5 = {
|
|
|
1875
1870
|
},
|
|
1876
1871
|
mounted: async function () {
|
|
1877
1872
|
const selectData = {};
|
|
1878
|
-
if (this.
|
|
1879
|
-
Object.keys(this.
|
|
1880
|
-
if (this.
|
|
1881
|
-
selectData[key] = this.
|
|
1873
|
+
if (this.fillSelects) {
|
|
1874
|
+
Object.keys(this.fillSelects).forEach(key => {
|
|
1875
|
+
if (this.fillSelects[key].data) {
|
|
1876
|
+
selectData[key] = this.fillSelects[key].data;
|
|
1882
1877
|
this.selectData = selectData;
|
|
1883
1878
|
console.log(this.selectData);
|
|
1884
1879
|
} else {
|
|
1885
|
-
apis.doGet(this.
|
|
1880
|
+
apis.doGet(this.fillSelects[key].url, { all: 1 }).then(res => {
|
|
1886
1881
|
// selectData[key] = res.data
|
|
1887
1882
|
// console.log(res)
|
|
1888
1883
|
this.selectData[key] = res.data.data;
|
|
@@ -2131,7 +2126,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2131
2126
|
type: "button",
|
|
2132
2127
|
onClick: _cache[1] || (_cache[1] = (...args) => ($options.submitForm && $options.submitForm(...args)))
|
|
2133
2128
|
}, [
|
|
2134
|
-
createTextVNode(toDisplayString($props.
|
|
2129
|
+
createTextVNode(toDisplayString($props.actionLabel ? $props.actionLabel:'Submit') + " ", 1 /* TEXT */),
|
|
2135
2130
|
(_ctx.form_status == 1)
|
|
2136
2131
|
? (openBlock(), createElementBlock("img", _hoisted_23$2))
|
|
2137
2132
|
: createCommentVNode("v-if", true)
|
|
@@ -2853,25 +2848,37 @@ const _hoisted_13 = {
|
|
|
2853
2848
|
key: 0,
|
|
2854
2849
|
class: "text-center"
|
|
2855
2850
|
};
|
|
2856
|
-
const _hoisted_14 = /*#__PURE__*/createElementVNode("
|
|
2857
|
-
|
|
2851
|
+
const _hoisted_14 = /*#__PURE__*/createElementVNode("div", {
|
|
2852
|
+
class: "spinner-border",
|
|
2853
|
+
role: "status"
|
|
2854
|
+
}, [
|
|
2855
|
+
/*#__PURE__*/createElementVNode("span", { class: "visually-hidden" }, "Loading...")
|
|
2858
2856
|
], -1 /* HOISTED */);
|
|
2859
2857
|
const _hoisted_15 = [
|
|
2860
2858
|
_hoisted_14
|
|
2861
2859
|
];
|
|
2862
|
-
const _hoisted_16 = {
|
|
2860
|
+
const _hoisted_16 = {
|
|
2861
|
+
key: 1,
|
|
2862
|
+
class: "alert alert-danger"
|
|
2863
|
+
};
|
|
2863
2864
|
const _hoisted_17 = { colspan: 2 };
|
|
2864
2865
|
const _hoisted_18 = {
|
|
2865
2866
|
key: 0,
|
|
2866
2867
|
class: "text-center"
|
|
2867
2868
|
};
|
|
2868
|
-
const _hoisted_19 = /*#__PURE__*/createElementVNode("
|
|
2869
|
-
|
|
2869
|
+
const _hoisted_19 = /*#__PURE__*/createElementVNode("div", {
|
|
2870
|
+
class: "spinner-border",
|
|
2871
|
+
role: "status"
|
|
2872
|
+
}, [
|
|
2873
|
+
/*#__PURE__*/createElementVNode("span", { class: "visually-hidden" }, "Loading...")
|
|
2870
2874
|
], -1 /* HOISTED */);
|
|
2871
2875
|
const _hoisted_20 = [
|
|
2872
2876
|
_hoisted_19
|
|
2873
2877
|
];
|
|
2874
|
-
const _hoisted_21 = {
|
|
2878
|
+
const _hoisted_21 = {
|
|
2879
|
+
key: 1,
|
|
2880
|
+
class: "alert alert-danger"
|
|
2881
|
+
};
|
|
2875
2882
|
const _hoisted_22 = { colspan: 2 };
|
|
2876
2883
|
const _hoisted_23 = {
|
|
2877
2884
|
key: 4,
|