@iankibetsh/shframework 0.5.8 → 0.6.0
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/dist/library.mjs.css +15 -15
- package/dist/library.js +572 -204
- package/dist/library.mjs +567 -199
- package/package.json +1 -1
package/dist/library.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import Axios from 'axios';
|
|
2
2
|
import moment from 'moment';
|
|
3
|
-
import { inject, openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, withDirectives, Fragment, renderList, vModelSelect, vModelText, resolveComponent, withModifiers, createVNode, ref, onMounted, unref, normalizeClass, createBlock, renderSlot, createStaticVNode, withCtx, shallowRef, resolveDynamicComponent } from 'vue';
|
|
3
|
+
import { inject, openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, withDirectives, Fragment, renderList, vModelSelect, vModelText, resolveComponent, withModifiers, createVNode, ref, onMounted, unref, normalizeClass, createBlock, renderSlot, createStaticVNode, withCtx, shallowRef, resolveDynamicComponent, isRef, vModelCheckbox, computed } from 'vue';
|
|
4
4
|
import NProgress from 'nprogress';
|
|
5
5
|
import Editor from '@tinymce/tinymce-vue';
|
|
6
6
|
import Swal from 'sweetalert2';
|
|
7
|
-
import { defineStore } from 'pinia';
|
|
7
|
+
import { defineStore, storeToRefs } from 'pinia';
|
|
8
|
+
import { useRoute } from 'vue-router';
|
|
8
9
|
|
|
9
10
|
function setItem (key, value) {
|
|
10
11
|
let toStore = value;
|
|
@@ -87,7 +88,7 @@ function doPost (endPoint, data) {
|
|
|
87
88
|
)
|
|
88
89
|
}
|
|
89
90
|
|
|
90
|
-
var
|
|
91
|
+
var shApis$1 = {
|
|
91
92
|
doGet,
|
|
92
93
|
doPost
|
|
93
94
|
};
|
|
@@ -1565,7 +1566,7 @@ const countries = [
|
|
|
1565
1566
|
}
|
|
1566
1567
|
];
|
|
1567
1568
|
|
|
1568
|
-
var script$
|
|
1569
|
+
var script$b = {
|
|
1569
1570
|
name: 'ShPhone',
|
|
1570
1571
|
props: ['modelValue', 'country_code'],
|
|
1571
1572
|
data () {
|
|
@@ -1627,19 +1628,19 @@ var script$9 = {
|
|
|
1627
1628
|
}
|
|
1628
1629
|
};
|
|
1629
1630
|
|
|
1630
|
-
const _hoisted_1$
|
|
1631
|
-
const _hoisted_2$
|
|
1631
|
+
const _hoisted_1$b = { class: "sh-phone mb-3" };
|
|
1632
|
+
const _hoisted_2$a = {
|
|
1632
1633
|
key: 0,
|
|
1633
1634
|
style: {"display":"contents"}
|
|
1634
1635
|
};
|
|
1635
|
-
const _hoisted_3$
|
|
1636
|
-
const _hoisted_4$
|
|
1636
|
+
const _hoisted_3$a = ["src"];
|
|
1637
|
+
const _hoisted_4$a = ["value"];
|
|
1637
1638
|
|
|
1638
1639
|
function render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1639
|
-
return (openBlock(), createElementBlock("div", _hoisted_1$
|
|
1640
|
+
return (openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
1640
1641
|
($data.selectedCountry)
|
|
1641
|
-
? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
1642
|
-
createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$
|
|
1642
|
+
? (openBlock(), createElementBlock("div", _hoisted_2$a, [
|
|
1643
|
+
createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$a),
|
|
1643
1644
|
createTextVNode(" " + toDisplayString($data.selectedCountry.dialCode), 1 /* TEXT */)
|
|
1644
1645
|
]))
|
|
1645
1646
|
: createCommentVNode("v-if", true),
|
|
@@ -1652,7 +1653,7 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1652
1653
|
return (openBlock(), createElementBlock("option", {
|
|
1653
1654
|
value: country,
|
|
1654
1655
|
key: country.dialCode
|
|
1655
|
-
}, toDisplayString(country.name + '(' + country.dialCode + ')'), 9 /* TEXT, PROPS */, _hoisted_4$
|
|
1656
|
+
}, toDisplayString(country.name + '(' + country.dialCode + ')'), 9 /* TEXT, PROPS */, _hoisted_4$a))
|
|
1656
1657
|
}), 128 /* KEYED_FRAGMENT */))
|
|
1657
1658
|
], 544 /* HYDRATE_EVENTS, NEED_PATCH */), [
|
|
1658
1659
|
[vModelSelect, $data.selectedCountry]
|
|
@@ -1670,10 +1671,10 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1670
1671
|
]))
|
|
1671
1672
|
}
|
|
1672
1673
|
|
|
1673
|
-
script$
|
|
1674
|
-
script$
|
|
1674
|
+
script$b.render = render$7;
|
|
1675
|
+
script$b.__file = "src/lib/components/ShPhone.vue";
|
|
1675
1676
|
|
|
1676
|
-
var script$
|
|
1677
|
+
var script$a = {
|
|
1677
1678
|
name: 'ShEditor',
|
|
1678
1679
|
props: ['modelValue'],
|
|
1679
1680
|
components: {
|
|
@@ -1712,7 +1713,7 @@ var script$8 = {
|
|
|
1712
1713
|
}
|
|
1713
1714
|
};
|
|
1714
1715
|
|
|
1715
|
-
const _hoisted_1$
|
|
1716
|
+
const _hoisted_1$a = /*#__PURE__*/createElementVNode("textarea", {
|
|
1716
1717
|
id: "tiny",
|
|
1717
1718
|
style: {"display":"none"},
|
|
1718
1719
|
"data-cy": "tinymce_editor"
|
|
@@ -1722,7 +1723,7 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1722
1723
|
const _component_editor = resolveComponent("editor");
|
|
1723
1724
|
|
|
1724
1725
|
return (openBlock(), createElementBlock(Fragment, null, [
|
|
1725
|
-
_hoisted_1$
|
|
1726
|
+
_hoisted_1$a,
|
|
1726
1727
|
createElementVNode("div", {
|
|
1727
1728
|
onFocusin: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"])),
|
|
1728
1729
|
class: "sh-editor w-100"
|
|
@@ -1747,31 +1748,31 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1747
1748
|
], 64 /* STABLE_FRAGMENT */))
|
|
1748
1749
|
}
|
|
1749
1750
|
|
|
1750
|
-
script$
|
|
1751
|
-
script$
|
|
1751
|
+
script$a.render = render$6;
|
|
1752
|
+
script$a.__file = "src/lib/components/FormComponent/ShEditor.vue";
|
|
1752
1753
|
|
|
1753
|
-
const _hoisted_1$
|
|
1754
|
+
const _hoisted_1$9 = {
|
|
1754
1755
|
key: 0,
|
|
1755
1756
|
class: "dropdown sh-suggest"
|
|
1756
1757
|
};
|
|
1757
|
-
const _hoisted_2$
|
|
1758
|
-
const _hoisted_3$
|
|
1759
|
-
const _hoisted_4$
|
|
1760
|
-
const _hoisted_5$
|
|
1761
|
-
const _hoisted_6$
|
|
1762
|
-
const _hoisted_7$
|
|
1763
|
-
const _hoisted_8$
|
|
1764
|
-
const _hoisted_9$
|
|
1758
|
+
const _hoisted_2$9 = ["id"];
|
|
1759
|
+
const _hoisted_3$9 = { class: "badge bg-secondary m-1 sh-selected-item" };
|
|
1760
|
+
const _hoisted_4$9 = ["onClick"];
|
|
1761
|
+
const _hoisted_5$7 = ["id"];
|
|
1762
|
+
const _hoisted_6$5 = ["id", "aria-labelledby"];
|
|
1763
|
+
const _hoisted_7$4 = { key: 0 };
|
|
1764
|
+
const _hoisted_8$3 = ["onClick"];
|
|
1765
|
+
const _hoisted_9$3 = {
|
|
1765
1766
|
key: 1,
|
|
1766
1767
|
class: "dropdown-item sh-suggest-no-results"
|
|
1767
1768
|
};
|
|
1768
|
-
const _hoisted_10$
|
|
1769
|
+
const _hoisted_10$4 = {
|
|
1769
1770
|
key: 2,
|
|
1770
1771
|
class: "dropdown-item sh-suggest-no-input"
|
|
1771
1772
|
};
|
|
1772
1773
|
|
|
1773
1774
|
|
|
1774
|
-
var script$
|
|
1775
|
+
var script$9 = {
|
|
1775
1776
|
__name: 'ShSuggest',
|
|
1776
1777
|
props: ['fillSelects','modelValue'],
|
|
1777
1778
|
emits: ['update:modelValue'],
|
|
@@ -1842,7 +1843,7 @@ function filterData(e){
|
|
|
1842
1843
|
}
|
|
1843
1844
|
});
|
|
1844
1845
|
} else {
|
|
1845
|
-
|
|
1846
|
+
shApis$1.doGet(props.fillSelects.url, { all: 1,filter_value: filterValue }).then(res => {
|
|
1846
1847
|
suggestions.value = res.data.data;
|
|
1847
1848
|
}).catch(res => {
|
|
1848
1849
|
console.log(res);
|
|
@@ -1852,7 +1853,7 @@ function filterData(e){
|
|
|
1852
1853
|
|
|
1853
1854
|
return (_ctx, _cache) => {
|
|
1854
1855
|
return (unref(id))
|
|
1855
|
-
? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
1856
|
+
? (openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
1856
1857
|
createElementVNode("div", {
|
|
1857
1858
|
id: unref(id),
|
|
1858
1859
|
"data-bs-toggle": "dropdown",
|
|
@@ -1861,14 +1862,14 @@ return (_ctx, _cache) => {
|
|
|
1861
1862
|
}, [
|
|
1862
1863
|
createElementVNode("div", null, [
|
|
1863
1864
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(selectedSuggestions), (sgt) => {
|
|
1864
|
-
return (openBlock(), createElementBlock("h5", _hoisted_3$
|
|
1865
|
+
return (openBlock(), createElementBlock("h5", _hoisted_3$9, [
|
|
1865
1866
|
createTextVNode(toDisplayString(sgt.name) + " ", 1 /* TEXT */),
|
|
1866
1867
|
createElementVNode("button", {
|
|
1867
1868
|
onClick: $event => (removeSuggestion(sgt.id)),
|
|
1868
1869
|
type: "button",
|
|
1869
1870
|
class: "btn-close border-start border-1 ms-1",
|
|
1870
1871
|
"aria-label": "Close"
|
|
1871
|
-
}, null, 8 /* PROPS */, _hoisted_4$
|
|
1872
|
+
}, null, 8 /* PROPS */, _hoisted_4$9)
|
|
1872
1873
|
]))
|
|
1873
1874
|
}), 256 /* UNKEYED_FRAGMENT */))
|
|
1874
1875
|
]),
|
|
@@ -1877,8 +1878,8 @@ return (_ctx, _cache) => {
|
|
|
1877
1878
|
contenteditable: "true",
|
|
1878
1879
|
onInput: filterData,
|
|
1879
1880
|
class: "flex-fill h-100 sh-suggestion-input"
|
|
1880
|
-
}, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_5$
|
|
1881
|
-
], 8 /* PROPS */, _hoisted_2$
|
|
1881
|
+
}, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_5$7)
|
|
1882
|
+
], 8 /* PROPS */, _hoisted_2$9),
|
|
1882
1883
|
createElementVNode("ul", {
|
|
1883
1884
|
class: "dropdown-menu w-100",
|
|
1884
1885
|
id: 'dropwdown_section' + unref(id),
|
|
@@ -1890,20 +1891,20 @@ return (_ctx, _cache) => {
|
|
|
1890
1891
|
key: suggestion.id
|
|
1891
1892
|
}, [
|
|
1892
1893
|
(suggestion.name)
|
|
1893
|
-
? (openBlock(), createElementBlock("li", _hoisted_7$
|
|
1894
|
+
? (openBlock(), createElementBlock("li", _hoisted_7$4, [
|
|
1894
1895
|
createElementVNode("a", {
|
|
1895
1896
|
onClick: $event => (addSuggestion(suggestion)),
|
|
1896
1897
|
class: normalizeClass(["dropdown-item", unref(selectedSuggestions).includes(suggestion) ? 'active':'']),
|
|
1897
1898
|
href: "#"
|
|
1898
|
-
}, toDisplayString(suggestion.name ?? suggestion.text), 11 /* TEXT, CLASS, PROPS */, _hoisted_8$
|
|
1899
|
+
}, toDisplayString(suggestion.name ?? suggestion.text), 11 /* TEXT, CLASS, PROPS */, _hoisted_8$3)
|
|
1899
1900
|
]))
|
|
1900
1901
|
: createCommentVNode("v-if", true)
|
|
1901
1902
|
], 64 /* STABLE_FRAGMENT */))
|
|
1902
1903
|
}), 128 /* KEYED_FRAGMENT */))
|
|
1903
1904
|
: (unref(searchText))
|
|
1904
|
-
? (openBlock(), createElementBlock("li", _hoisted_9$
|
|
1905
|
-
: (openBlock(), createElementBlock("li", _hoisted_10$
|
|
1906
|
-
], 8 /* PROPS */, _hoisted_6$
|
|
1905
|
+
? (openBlock(), createElementBlock("li", _hoisted_9$3, " No results found "))
|
|
1906
|
+
: (openBlock(), createElementBlock("li", _hoisted_10$4, " Type to search... "))
|
|
1907
|
+
], 8 /* PROPS */, _hoisted_6$5)
|
|
1907
1908
|
]))
|
|
1908
1909
|
: createCommentVNode("v-if", true)
|
|
1909
1910
|
}
|
|
@@ -1911,15 +1912,15 @@ return (_ctx, _cache) => {
|
|
|
1911
1912
|
|
|
1912
1913
|
};
|
|
1913
1914
|
|
|
1914
|
-
script$
|
|
1915
|
-
script$
|
|
1915
|
+
script$9.__scopeId = "data-v-5b767123";
|
|
1916
|
+
script$9.__file = "src/lib/components/FormComponent/ShSuggest.vue";
|
|
1916
1917
|
|
|
1917
|
-
var script$
|
|
1918
|
+
var script$8 = {
|
|
1918
1919
|
name: 'ShForm',
|
|
1919
1920
|
components: {
|
|
1920
|
-
ShSuggest: script$
|
|
1921
|
-
ShEditor: script$
|
|
1922
|
-
ShPhone: script$
|
|
1921
|
+
ShSuggest: script$9,
|
|
1922
|
+
ShEditor: script$a,
|
|
1923
|
+
ShPhone: script$b
|
|
1923
1924
|
},
|
|
1924
1925
|
props: [
|
|
1925
1926
|
'action',
|
|
@@ -2001,7 +2002,6 @@ var script$6 = {
|
|
|
2001
2002
|
const datePickers = ['free_tier_days', 'recurring_date', 'date', 'paid_at'];
|
|
2002
2003
|
let realEditors = ['html_content', 'listing_description', 'mail', 'comment'];
|
|
2003
2004
|
const mapLocations = ['building_location'];
|
|
2004
|
-
const files = ['file', 'logo'];
|
|
2005
2005
|
const phones = ['phone'];
|
|
2006
2006
|
if (this.selectData[field]) {
|
|
2007
2007
|
return 'select'
|
|
@@ -2012,9 +2012,6 @@ var script$6 = {
|
|
|
2012
2012
|
if (field.includes('password')) {
|
|
2013
2013
|
return 'password'
|
|
2014
2014
|
}
|
|
2015
|
-
if (field.includes('file')) {
|
|
2016
|
-
return 'file'
|
|
2017
|
-
}
|
|
2018
2015
|
if (textareas.includes(field)) {
|
|
2019
2016
|
return 'textarea'
|
|
2020
2017
|
}
|
|
@@ -2037,7 +2034,7 @@ var script$6 = {
|
|
|
2037
2034
|
if (selects.includes(field)) {
|
|
2038
2035
|
return 'select'
|
|
2039
2036
|
}
|
|
2040
|
-
if (files.includes(field)) {
|
|
2037
|
+
if (typeof this.files === 'array' && this.files.includes(field)) {
|
|
2041
2038
|
return 'file'
|
|
2042
2039
|
}
|
|
2043
2040
|
return 'text'
|
|
@@ -2113,7 +2110,7 @@ var script$6 = {
|
|
|
2113
2110
|
Object.keys(this.form_files).forEach(key => {
|
|
2114
2111
|
data.append(key, this.form_files[key].value);
|
|
2115
2112
|
});
|
|
2116
|
-
|
|
2113
|
+
shApis$1.doPost(this.action, data).then(res => {
|
|
2117
2114
|
// console.log(res)
|
|
2118
2115
|
this.form_status = 2;
|
|
2119
2116
|
Object.keys(this.form_elements).forEach(key => {
|
|
@@ -2201,7 +2198,7 @@ var script$6 = {
|
|
|
2201
2198
|
this.selectData = selectData;
|
|
2202
2199
|
console.log(this.selectData);
|
|
2203
2200
|
} else {
|
|
2204
|
-
|
|
2201
|
+
shApis$1.doGet(this.fillSelects[key].url, { all: 1 }).then(res => {
|
|
2205
2202
|
// selectData[key] = res.data
|
|
2206
2203
|
// console.log(res)
|
|
2207
2204
|
this.selectData[key] = res.data.data;
|
|
@@ -2230,27 +2227,27 @@ var script$6 = {
|
|
|
2230
2227
|
}
|
|
2231
2228
|
};
|
|
2232
2229
|
|
|
2233
|
-
const _hoisted_1$
|
|
2230
|
+
const _hoisted_1$8 = {
|
|
2234
2231
|
ref: "ShAutoForm",
|
|
2235
2232
|
class: "sh-form"
|
|
2236
2233
|
};
|
|
2237
|
-
const _hoisted_2$
|
|
2234
|
+
const _hoisted_2$8 = {
|
|
2238
2235
|
key: 0,
|
|
2239
2236
|
class: "alert alert-danger alert-dismissible fade show sh-form-submission-error",
|
|
2240
2237
|
role: "alert"
|
|
2241
2238
|
};
|
|
2242
|
-
const _hoisted_3$
|
|
2243
|
-
const _hoisted_4$
|
|
2244
|
-
const _hoisted_5$
|
|
2245
|
-
const _hoisted_6$
|
|
2246
|
-
const _hoisted_7$
|
|
2247
|
-
const _hoisted_8$
|
|
2248
|
-
const _hoisted_9$
|
|
2249
|
-
const _hoisted_10$
|
|
2250
|
-
const _hoisted_11$
|
|
2251
|
-
const _hoisted_12$
|
|
2252
|
-
const _hoisted_13$
|
|
2253
|
-
const _hoisted_14$
|
|
2239
|
+
const _hoisted_3$8 = /*#__PURE__*/createElementVNode("i", { class: "bi-exclamation-triangle-fill me-1" }, null, -1 /* HOISTED */);
|
|
2240
|
+
const _hoisted_4$8 = { key: 0 };
|
|
2241
|
+
const _hoisted_5$6 = { key: 1 };
|
|
2242
|
+
const _hoisted_6$4 = { class: "row" };
|
|
2243
|
+
const _hoisted_7$3 = { class: "fg-label control-label text-capitalize control-bel col-md-12 request-form-label mb-2" };
|
|
2244
|
+
const _hoisted_8$2 = { class: "col-md-12" };
|
|
2245
|
+
const _hoisted_9$2 = ["data-cy", "placeholder", "name", "onFocus", "onChange"];
|
|
2246
|
+
const _hoisted_10$3 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
|
|
2247
|
+
const _hoisted_11$3 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
|
|
2248
|
+
const _hoisted_12$3 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
|
|
2249
|
+
const _hoisted_13$3 = ["data-cy", "name", "onFocus", "onUpdate:modelValue"];
|
|
2250
|
+
const _hoisted_14$3 = ["disabled", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
|
|
2254
2251
|
const _hoisted_15$2 = ["name", "onFocus", "onUpdate:modelValue"];
|
|
2255
2252
|
const _hoisted_16$2 = ["name", "onFocus", "onUpdate:modelValue"];
|
|
2256
2253
|
const _hoisted_17$2 = ["value"];
|
|
@@ -2295,15 +2292,15 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2295
2292
|
const _component_ShSuggest = resolveComponent("ShSuggest");
|
|
2296
2293
|
const _component_ShEditor = resolveComponent("ShEditor");
|
|
2297
2294
|
|
|
2298
|
-
return (openBlock(), createElementBlock("form", _hoisted_1$
|
|
2295
|
+
return (openBlock(), createElementBlock("form", _hoisted_1$8, [
|
|
2299
2296
|
createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
|
|
2300
2297
|
createCommentVNode(" <div v-if=\"form_status == 2\" class=\"alert alert-success\">Success</div>"),
|
|
2301
2298
|
(_ctx.form_status == 3)
|
|
2302
|
-
? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
2303
|
-
_hoisted_3$
|
|
2299
|
+
? (openBlock(), createElementBlock("div", _hoisted_2$8, [
|
|
2300
|
+
_hoisted_3$8,
|
|
2304
2301
|
(_ctx.errorText)
|
|
2305
|
-
? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
2306
|
-
: (openBlock(), createElementBlock("span", _hoisted_5$
|
|
2302
|
+
? (openBlock(), createElementBlock("span", _hoisted_4$8, toDisplayString(_ctx.errorText), 1 /* TEXT */))
|
|
2303
|
+
: (openBlock(), createElementBlock("span", _hoisted_5$6, "Unexpected Error Occurred")),
|
|
2307
2304
|
createElementVNode("button", {
|
|
2308
2305
|
onClick: _cache[0] || (_cache[0] = (...args) => ($options.hideError && $options.hideError(...args))),
|
|
2309
2306
|
type: "button",
|
|
@@ -2318,14 +2315,14 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2318
2315
|
}, null, 512 /* NEED_PATCH */), [
|
|
2319
2316
|
[vModelText, _ctx.form_elements['id']]
|
|
2320
2317
|
]),
|
|
2321
|
-
createElementVNode("div", _hoisted_6$
|
|
2318
|
+
createElementVNode("div", _hoisted_6$4, [
|
|
2322
2319
|
(openBlock(true), createElementBlock(Fragment, null, renderList($props.fields, (field) => {
|
|
2323
2320
|
return (openBlock(), createElementBlock("div", {
|
|
2324
2321
|
class: normalizeClass(["form-group", 'col-md-' + $options.getColumns()]),
|
|
2325
2322
|
key: field
|
|
2326
2323
|
}, [
|
|
2327
|
-
createElementVNode("label", _hoisted_7$
|
|
2328
|
-
createElementVNode("div", _hoisted_8$
|
|
2324
|
+
createElementVNode("label", _hoisted_7$3, toDisplayString($options.getLabel(field)), 1 /* TEXT */),
|
|
2325
|
+
createElementVNode("div", _hoisted_8$2, [
|
|
2329
2326
|
($options.getFieldType(field) === 'file')
|
|
2330
2327
|
? (openBlock(), createElementBlock("input", {
|
|
2331
2328
|
key: 0,
|
|
@@ -2338,7 +2335,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2338
2335
|
ref: 'file_'+field,
|
|
2339
2336
|
onChange: $event => ($options.handleFileUpload(field)),
|
|
2340
2337
|
type: "file"
|
|
2341
|
-
}, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_9$
|
|
2338
|
+
}, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_9$2))
|
|
2342
2339
|
: createCommentVNode("v-if", true),
|
|
2343
2340
|
($options.getFieldType(field) === 'numeric')
|
|
2344
2341
|
? withDirectives((openBlock(), createElementBlock("input", {
|
|
@@ -2350,7 +2347,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2350
2347
|
class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
|
|
2351
2348
|
"onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
|
|
2352
2349
|
type: "number"
|
|
2353
|
-
}, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_10$
|
|
2350
|
+
}, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_10$3)), [
|
|
2354
2351
|
[vModelText, _ctx.form_elements[field]]
|
|
2355
2352
|
])
|
|
2356
2353
|
: createCommentVNode("v-if", true),
|
|
@@ -2364,7 +2361,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2364
2361
|
class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
|
|
2365
2362
|
"onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
|
|
2366
2363
|
type: "password"
|
|
2367
|
-
}, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_11$
|
|
2364
|
+
}, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_11$3)), [
|
|
2368
2365
|
[vModelText, _ctx.form_elements[field]]
|
|
2369
2366
|
])
|
|
2370
2367
|
: createCommentVNode("v-if", true),
|
|
@@ -2379,7 +2376,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2379
2376
|
"onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
|
|
2380
2377
|
type: "email",
|
|
2381
2378
|
required: ""
|
|
2382
|
-
}, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_12$
|
|
2379
|
+
}, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_12$3)), [
|
|
2383
2380
|
[vModelText, _ctx.form_elements[field]]
|
|
2384
2381
|
])
|
|
2385
2382
|
: createCommentVNode("v-if", true),
|
|
@@ -2392,7 +2389,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2392
2389
|
onFocus: $event => ($options.removeErrors(field)),
|
|
2393
2390
|
class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control active"]),
|
|
2394
2391
|
"onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
|
|
2395
|
-
}, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_13$
|
|
2392
|
+
}, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_13$3)), [
|
|
2396
2393
|
[vModelText, _ctx.form_elements[field]]
|
|
2397
2394
|
])
|
|
2398
2395
|
: createCommentVNode("v-if", true),
|
|
@@ -2440,7 +2437,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2440
2437
|
class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
|
|
2441
2438
|
"onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
|
|
2442
2439
|
type: "text"
|
|
2443
|
-
}, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_14$
|
|
2440
|
+
}, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_14$3)), [
|
|
2444
2441
|
[vModelText, _ctx.form_elements[field]]
|
|
2445
2442
|
])
|
|
2446
2443
|
: createCommentVNode("v-if", true),
|
|
@@ -2500,10 +2497,10 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2500
2497
|
], 512 /* NEED_PATCH */))
|
|
2501
2498
|
}
|
|
2502
2499
|
|
|
2503
|
-
script$
|
|
2504
|
-
script$
|
|
2500
|
+
script$8.render = render$5;
|
|
2501
|
+
script$8.__file = "src/lib/components/ShForm.vue";
|
|
2505
2502
|
|
|
2506
|
-
var script$
|
|
2503
|
+
var script$7 = {
|
|
2507
2504
|
name: 'ShCanvas',
|
|
2508
2505
|
props: ['canvasTitle', 'canvasId', 'position'],
|
|
2509
2506
|
components: {
|
|
@@ -2520,13 +2517,13 @@ var script$5 = {
|
|
|
2520
2517
|
}
|
|
2521
2518
|
};
|
|
2522
2519
|
|
|
2523
|
-
const _hoisted_1$
|
|
2524
|
-
const _hoisted_2$
|
|
2525
|
-
const _hoisted_3$
|
|
2520
|
+
const _hoisted_1$7 = ["id"];
|
|
2521
|
+
const _hoisted_2$7 = { class: "offcanvas-header" };
|
|
2522
|
+
const _hoisted_3$7 = {
|
|
2526
2523
|
class: "offcanvas-title",
|
|
2527
2524
|
id: "offcanvasScrollingLabel"
|
|
2528
2525
|
};
|
|
2529
|
-
const _hoisted_4$
|
|
2526
|
+
const _hoisted_4$7 = { class: "offcanvas-body" };
|
|
2530
2527
|
|
|
2531
2528
|
function render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2532
2529
|
return (openBlock(), createElementBlock("div", {
|
|
@@ -2536,8 +2533,8 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2536
2533
|
id: $props.canvasId,
|
|
2537
2534
|
"aria-labelledby": "offcanvasScrollingLabel"
|
|
2538
2535
|
}, [
|
|
2539
|
-
createElementVNode("div", _hoisted_2$
|
|
2540
|
-
createElementVNode("h5", _hoisted_3$
|
|
2536
|
+
createElementVNode("div", _hoisted_2$7, [
|
|
2537
|
+
createElementVNode("h5", _hoisted_3$7, toDisplayString($props.canvasTitle), 1 /* TEXT */),
|
|
2541
2538
|
createElementVNode("button", {
|
|
2542
2539
|
type: "button",
|
|
2543
2540
|
ref: "closecanvas",
|
|
@@ -2547,33 +2544,33 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2547
2544
|
"aria-label": "Close"
|
|
2548
2545
|
}, null, 512 /* NEED_PATCH */)
|
|
2549
2546
|
]),
|
|
2550
|
-
createElementVNode("div", _hoisted_4$
|
|
2547
|
+
createElementVNode("div", _hoisted_4$7, [
|
|
2551
2548
|
renderSlot(_ctx.$slots, "default")
|
|
2552
2549
|
])
|
|
2553
|
-
], 10 /* CLASS, PROPS */, _hoisted_1$
|
|
2550
|
+
], 10 /* CLASS, PROPS */, _hoisted_1$7))
|
|
2554
2551
|
}
|
|
2555
2552
|
|
|
2556
|
-
script$
|
|
2557
|
-
script$
|
|
2553
|
+
script$7.render = render$4;
|
|
2554
|
+
script$7.__file = "src/lib/components/ShCanvas.vue";
|
|
2558
2555
|
|
|
2559
|
-
var script$
|
|
2556
|
+
var script$6 = {
|
|
2560
2557
|
name: 'ShModal',
|
|
2561
2558
|
props: ['modalTitle', 'modalId', 'modalSize'],
|
|
2562
2559
|
components: {
|
|
2563
2560
|
}
|
|
2564
2561
|
};
|
|
2565
2562
|
|
|
2566
|
-
const _hoisted_1$
|
|
2567
|
-
const _hoisted_2$
|
|
2568
|
-
const _hoisted_3$
|
|
2569
|
-
const _hoisted_4$
|
|
2570
|
-
const _hoisted_5$
|
|
2563
|
+
const _hoisted_1$6 = ["id"];
|
|
2564
|
+
const _hoisted_2$6 = { class: "modal-content" };
|
|
2565
|
+
const _hoisted_3$6 = { class: "modal-header" };
|
|
2566
|
+
const _hoisted_4$6 = { class: "modal-title" };
|
|
2567
|
+
const _hoisted_5$5 = /*#__PURE__*/createElementVNode("button", {
|
|
2571
2568
|
class: "btn btn-danger btn-sm",
|
|
2572
2569
|
"data-bs-dismiss": "modal",
|
|
2573
2570
|
"data-dismiss": "modal"
|
|
2574
2571
|
}, "×", -1 /* HOISTED */);
|
|
2575
|
-
const _hoisted_6$
|
|
2576
|
-
const _hoisted_7$
|
|
2572
|
+
const _hoisted_6$3 = { class: "modal-body" };
|
|
2573
|
+
const _hoisted_7$2 = { class: "section" };
|
|
2577
2574
|
|
|
2578
2575
|
function render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2579
2576
|
return (openBlock(), createElementBlock("div", {
|
|
@@ -2586,25 +2583,25 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2586
2583
|
createElementVNode("div", {
|
|
2587
2584
|
class: normalizeClass(["modal-dialog", `modal-${$props.modalSize}`])
|
|
2588
2585
|
}, [
|
|
2589
|
-
createElementVNode("div", _hoisted_2$
|
|
2590
|
-
createElementVNode("div", _hoisted_3$
|
|
2591
|
-
createElementVNode("h3", _hoisted_4$
|
|
2592
|
-
_hoisted_5$
|
|
2586
|
+
createElementVNode("div", _hoisted_2$6, [
|
|
2587
|
+
createElementVNode("div", _hoisted_3$6, [
|
|
2588
|
+
createElementVNode("h3", _hoisted_4$6, toDisplayString($props.modalTitle), 1 /* TEXT */),
|
|
2589
|
+
_hoisted_5$5
|
|
2593
2590
|
]),
|
|
2594
|
-
createElementVNode("div", _hoisted_6$
|
|
2595
|
-
createElementVNode("div", _hoisted_7$
|
|
2591
|
+
createElementVNode("div", _hoisted_6$3, [
|
|
2592
|
+
createElementVNode("div", _hoisted_7$2, [
|
|
2596
2593
|
renderSlot(_ctx.$slots, "default")
|
|
2597
2594
|
])
|
|
2598
2595
|
])
|
|
2599
2596
|
])
|
|
2600
2597
|
], 2 /* CLASS */)
|
|
2601
|
-
], 8 /* PROPS */, _hoisted_1$
|
|
2598
|
+
], 8 /* PROPS */, _hoisted_1$6))
|
|
2602
2599
|
}
|
|
2603
2600
|
|
|
2604
|
-
script$
|
|
2605
|
-
script$
|
|
2601
|
+
script$6.render = render$3;
|
|
2602
|
+
script$6.__file = "src/lib/components/ShModal.vue";
|
|
2606
2603
|
|
|
2607
|
-
var script$
|
|
2604
|
+
var script$5 = {
|
|
2608
2605
|
name: 'Pagination',
|
|
2609
2606
|
props: ['pagination_data', 'loadMore', 'hideCount', 'hideLoadMore'],
|
|
2610
2607
|
data () {
|
|
@@ -2675,21 +2672,21 @@ var script$3 = {
|
|
|
2675
2672
|
}
|
|
2676
2673
|
};
|
|
2677
2674
|
|
|
2678
|
-
const _hoisted_1$
|
|
2679
|
-
const _hoisted_2$
|
|
2680
|
-
const _hoisted_3$
|
|
2681
|
-
const _hoisted_4$
|
|
2682
|
-
const _hoisted_5$
|
|
2683
|
-
const _hoisted_10$
|
|
2684
|
-
_hoisted_5$
|
|
2675
|
+
const _hoisted_1$5 = { key: 0 };
|
|
2676
|
+
const _hoisted_2$5 = { class: "record_count_body mb-3" };
|
|
2677
|
+
const _hoisted_3$5 = /*#__PURE__*/createElementVNode("span", { class: "per_page_show" }, "Showing", -1 /* HOISTED */);
|
|
2678
|
+
const _hoisted_4$5 = /*#__PURE__*/createTextVNode(" ");
|
|
2679
|
+
const _hoisted_5$4 = /*#__PURE__*/createStaticVNode("<option value=\"10\">10</option><option value=\"25\">25</option><option value=\"50\">50</option><option value=\"100\">100</option><option value=\"200\">200</option>", 5);
|
|
2680
|
+
const _hoisted_10$2 = [
|
|
2681
|
+
_hoisted_5$4
|
|
2685
2682
|
];
|
|
2686
|
-
const _hoisted_11$
|
|
2687
|
-
const _hoisted_12$
|
|
2683
|
+
const _hoisted_11$2 = { class: "record_counts" };
|
|
2684
|
+
const _hoisted_12$2 = {
|
|
2688
2685
|
key: 0,
|
|
2689
2686
|
"aria-label": "Page navigation"
|
|
2690
2687
|
};
|
|
2691
|
-
const _hoisted_13$
|
|
2692
|
-
const _hoisted_14$
|
|
2688
|
+
const _hoisted_13$2 = { class: "pagination" };
|
|
2689
|
+
const _hoisted_14$2 = {
|
|
2693
2690
|
key: 0,
|
|
2694
2691
|
class: "page-link"
|
|
2695
2692
|
};
|
|
@@ -2722,22 +2719,22 @@ const _hoisted_23$1 = {
|
|
|
2722
2719
|
|
|
2723
2720
|
function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2724
2721
|
return (!$props.loadMore)
|
|
2725
|
-
? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2726
|
-
createElementVNode("div", _hoisted_2$
|
|
2727
|
-
_hoisted_3$
|
|
2728
|
-
_hoisted_4$
|
|
2722
|
+
? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
2723
|
+
createElementVNode("div", _hoisted_2$5, [
|
|
2724
|
+
_hoisted_3$5,
|
|
2725
|
+
_hoisted_4$5,
|
|
2729
2726
|
withDirectives(createElementVNode("select", {
|
|
2730
2727
|
class: "select_per_page",
|
|
2731
2728
|
onChange: _cache[0] || (_cache[0] = (...args) => ($options.changePerPage && $options.changePerPage(...args))),
|
|
2732
2729
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (($data.per_page) = $event))
|
|
2733
|
-
}, _hoisted_10$
|
|
2730
|
+
}, _hoisted_10$2, 544 /* HYDRATE_EVENTS, NEED_PATCH */), [
|
|
2734
2731
|
[vModelSelect, $data.per_page]
|
|
2735
2732
|
]),
|
|
2736
|
-
createElementVNode("span", _hoisted_11$
|
|
2733
|
+
createElementVNode("span", _hoisted_11$2, " of " + toDisplayString($props.pagination_data.record_count) + " items", 1 /* TEXT */)
|
|
2737
2734
|
]),
|
|
2738
2735
|
($props.pagination_data != null)
|
|
2739
|
-
? (openBlock(), createElementBlock("nav", _hoisted_12$
|
|
2740
|
-
createElementVNode("ul", _hoisted_13$
|
|
2736
|
+
? (openBlock(), createElementBlock("nav", _hoisted_12$2, [
|
|
2737
|
+
createElementVNode("ul", _hoisted_13$2, [
|
|
2741
2738
|
createElementVNode("li", {
|
|
2742
2739
|
class: normalizeClass([$options.getActivePage === 1 ? 'disabled' : '' , "page-item"])
|
|
2743
2740
|
}, [
|
|
@@ -2752,7 +2749,7 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2752
2749
|
key: page
|
|
2753
2750
|
}, [
|
|
2754
2751
|
($options.getActivePage === page)
|
|
2755
|
-
? (openBlock(), createElementBlock("a", _hoisted_14$
|
|
2752
|
+
? (openBlock(), createElementBlock("a", _hoisted_14$2, toDisplayString(page), 1 /* TEXT */))
|
|
2756
2753
|
: (['..','...'].includes(page))
|
|
2757
2754
|
? (openBlock(), createElementBlock("a", _hoisted_15$1, toDisplayString(page), 1 /* TEXT */))
|
|
2758
2755
|
: (openBlock(), createElementBlock("a", {
|
|
@@ -2794,8 +2791,8 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2794
2791
|
]))
|
|
2795
2792
|
}
|
|
2796
2793
|
|
|
2797
|
-
script$
|
|
2798
|
-
script$
|
|
2794
|
+
script$5.render = render$2;
|
|
2795
|
+
script$5.__file = "src/lib/components/list_templates/Pagination.vue";
|
|
2799
2796
|
|
|
2800
2797
|
function swalSuccess (message) {
|
|
2801
2798
|
Swal.fire('Success!', message, 'success');
|
|
@@ -2833,11 +2830,11 @@ function swalHttpError (reason) {
|
|
|
2833
2830
|
}
|
|
2834
2831
|
|
|
2835
2832
|
function runSilentRequest (url) {
|
|
2836
|
-
return
|
|
2833
|
+
return shApis$1.doPost(url)
|
|
2837
2834
|
}
|
|
2838
2835
|
|
|
2839
2836
|
function setTabCounts (url) {
|
|
2840
|
-
|
|
2837
|
+
shApis$1.doGet(url).then(res => {
|
|
2841
2838
|
Object.keys(res.data).forEach(key => {
|
|
2842
2839
|
const elem = document.getElementById(key);
|
|
2843
2840
|
if (elem === null) {
|
|
@@ -2884,7 +2881,7 @@ function formatHttpCatchError (reason) {
|
|
|
2884
2881
|
return error
|
|
2885
2882
|
}
|
|
2886
2883
|
function getMenuCount (url) {
|
|
2887
|
-
|
|
2884
|
+
shApis$1.doGet(url).then(res => {
|
|
2888
2885
|
console.log(res);
|
|
2889
2886
|
});
|
|
2890
2887
|
}
|
|
@@ -2927,7 +2924,7 @@ async function runPlainRequest (url, message, title, data) {
|
|
|
2927
2924
|
reverseButtons: true,
|
|
2928
2925
|
showLoaderOnConfirm: true,
|
|
2929
2926
|
preConfirm: () => {
|
|
2930
|
-
return
|
|
2927
|
+
return shApis$1.doPost(url, data).then(function (response) {
|
|
2931
2928
|
Swal.fire('Success!', 'Action completed successfully', 'success');
|
|
2932
2929
|
return {
|
|
2933
2930
|
response: response.data,
|
|
@@ -2969,7 +2966,7 @@ var helpers = {
|
|
|
2969
2966
|
formatDate
|
|
2970
2967
|
};
|
|
2971
2968
|
|
|
2972
|
-
var script$
|
|
2969
|
+
var script$4 = {
|
|
2973
2970
|
name: 'sh-table',
|
|
2974
2971
|
props: ['endPoint', 'headers', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover'],
|
|
2975
2972
|
inject: ['channel', 'global'],
|
|
@@ -3095,7 +3092,7 @@ var script$2 = {
|
|
|
3095
3092
|
titles: headers,
|
|
3096
3093
|
export: 1
|
|
3097
3094
|
};
|
|
3098
|
-
|
|
3095
|
+
shApis$1.doPost(this.endPoint, data).then(res => {
|
|
3099
3096
|
this.downloading = false;
|
|
3100
3097
|
if (res.data.file) {
|
|
3101
3098
|
const url = this.appUrl + 'external-download?file=' + res.data.file + '&name=' + res.data.name;
|
|
@@ -3125,7 +3122,7 @@ var script$2 = {
|
|
|
3125
3122
|
if (this.pagination_data) {
|
|
3126
3123
|
this.pagination_data.loading = 1;
|
|
3127
3124
|
}
|
|
3128
|
-
|
|
3125
|
+
shApis$1.doGet(this.endPoint, data).then(req => {
|
|
3129
3126
|
this.loading = 'done';
|
|
3130
3127
|
const response = req.data.data;
|
|
3131
3128
|
this.pagination_data = {
|
|
@@ -3168,7 +3165,7 @@ var script$2 = {
|
|
|
3168
3165
|
this.reloadData();
|
|
3169
3166
|
},
|
|
3170
3167
|
components: {
|
|
3171
|
-
pagination: script$
|
|
3168
|
+
pagination: script$5
|
|
3172
3169
|
},
|
|
3173
3170
|
computed: {
|
|
3174
3171
|
windowWidth: function () {
|
|
@@ -3186,39 +3183,39 @@ var script$2 = {
|
|
|
3186
3183
|
}
|
|
3187
3184
|
};
|
|
3188
3185
|
|
|
3189
|
-
const _hoisted_1$
|
|
3190
|
-
const _hoisted_2$
|
|
3186
|
+
const _hoisted_1$4 = { class: "auto-table" };
|
|
3187
|
+
const _hoisted_2$4 = {
|
|
3191
3188
|
key: 0,
|
|
3192
3189
|
class: "col-md-4 mb-2"
|
|
3193
3190
|
};
|
|
3194
|
-
const _hoisted_3$
|
|
3195
|
-
const _hoisted_4$
|
|
3196
|
-
const _hoisted_5$
|
|
3197
|
-
const _hoisted_6 = /*#__PURE__*/createElementVNode("span", {
|
|
3191
|
+
const _hoisted_3$4 = ["disabled"];
|
|
3192
|
+
const _hoisted_4$4 = /*#__PURE__*/createElementVNode("i", { class: "bi-download" }, null, -1 /* HOISTED */);
|
|
3193
|
+
const _hoisted_5$3 = /*#__PURE__*/createTextVNode(" Export ");
|
|
3194
|
+
const _hoisted_6$2 = /*#__PURE__*/createElementVNode("span", {
|
|
3198
3195
|
class: "spinner-border spinner-border-sm",
|
|
3199
3196
|
role: "status",
|
|
3200
3197
|
"aria-hidden": "true"
|
|
3201
3198
|
}, null, -1 /* HOISTED */);
|
|
3202
|
-
const _hoisted_7 = /*#__PURE__*/createElementVNode("span", { class: "visually-hidden" }, "Loading...", -1 /* HOISTED */);
|
|
3203
|
-
const _hoisted_8 = {
|
|
3199
|
+
const _hoisted_7$1 = /*#__PURE__*/createElementVNode("span", { class: "visually-hidden" }, "Loading...", -1 /* HOISTED */);
|
|
3200
|
+
const _hoisted_8$1 = {
|
|
3204
3201
|
key: 1,
|
|
3205
3202
|
class: "row"
|
|
3206
3203
|
};
|
|
3207
|
-
const _hoisted_9 = { class: "col-12 mb-3" };
|
|
3208
|
-
const _hoisted_10 = { class: "sh-search-bar" };
|
|
3209
|
-
const _hoisted_11 = ["placeholder"];
|
|
3210
|
-
const _hoisted_12 = {
|
|
3204
|
+
const _hoisted_9$1 = { class: "col-12 mb-3" };
|
|
3205
|
+
const _hoisted_10$1 = { class: "sh-search-bar" };
|
|
3206
|
+
const _hoisted_11$1 = ["placeholder"];
|
|
3207
|
+
const _hoisted_12$1 = {
|
|
3211
3208
|
key: 0,
|
|
3212
3209
|
class: "text-center"
|
|
3213
3210
|
};
|
|
3214
|
-
const _hoisted_13 = /*#__PURE__*/createElementVNode("div", {
|
|
3211
|
+
const _hoisted_13$1 = /*#__PURE__*/createElementVNode("div", {
|
|
3215
3212
|
class: "spinner-border",
|
|
3216
3213
|
role: "status"
|
|
3217
3214
|
}, [
|
|
3218
3215
|
/*#__PURE__*/createElementVNode("span", { class: "visually-hidden" }, "Loading...")
|
|
3219
3216
|
], -1 /* HOISTED */);
|
|
3220
|
-
const _hoisted_14 = [
|
|
3221
|
-
_hoisted_13
|
|
3217
|
+
const _hoisted_14$1 = [
|
|
3218
|
+
_hoisted_13$1
|
|
3222
3219
|
];
|
|
3223
3220
|
const _hoisted_15 = {
|
|
3224
3221
|
key: 1,
|
|
@@ -3349,9 +3346,9 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3349
3346
|
const _component_router_link = resolveComponent("router-link");
|
|
3350
3347
|
const _component_pagination = resolveComponent("pagination");
|
|
3351
3348
|
|
|
3352
|
-
return (openBlock(), createElementBlock("div", _hoisted_1$
|
|
3349
|
+
return (openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
3353
3350
|
($props.hasDownload)
|
|
3354
|
-
? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
3351
|
+
? (openBlock(), createElementBlock("div", _hoisted_2$4, [
|
|
3355
3352
|
createElementVNode("button", {
|
|
3356
3353
|
disabled: $data.downloading,
|
|
3357
3354
|
class: "btn btn-warning btn-sm",
|
|
@@ -3359,27 +3356,27 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3359
3356
|
}, [
|
|
3360
3357
|
(!$data.downloading)
|
|
3361
3358
|
? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3362
|
-
_hoisted_4$
|
|
3363
|
-
_hoisted_5$
|
|
3359
|
+
_hoisted_4$4,
|
|
3360
|
+
_hoisted_5$3
|
|
3364
3361
|
], 64 /* STABLE_FRAGMENT */))
|
|
3365
3362
|
: (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
3366
|
-
_hoisted_6,
|
|
3367
|
-
_hoisted_7
|
|
3363
|
+
_hoisted_6$2,
|
|
3364
|
+
_hoisted_7$1
|
|
3368
3365
|
], 64 /* STABLE_FRAGMENT */))
|
|
3369
|
-
], 8 /* PROPS */, _hoisted_3$
|
|
3366
|
+
], 8 /* PROPS */, _hoisted_3$4)
|
|
3370
3367
|
]))
|
|
3371
3368
|
: createCommentVNode("v-if", true),
|
|
3372
3369
|
(!$props.hideSearch)
|
|
3373
|
-
? (openBlock(), createElementBlock("div", _hoisted_8, [
|
|
3374
|
-
createElementVNode("div", _hoisted_9, [
|
|
3375
|
-
createElementVNode("div", _hoisted_10, [
|
|
3370
|
+
? (openBlock(), createElementBlock("div", _hoisted_8$1, [
|
|
3371
|
+
createElementVNode("div", _hoisted_9$1, [
|
|
3372
|
+
createElementVNode("div", _hoisted_10$1, [
|
|
3376
3373
|
withDirectives(createElementVNode("input", {
|
|
3377
3374
|
type: "search",
|
|
3378
3375
|
onChange: _cache[1] || (_cache[1] = $event => ($options.reloadData(1))),
|
|
3379
3376
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = $event => (($data.filter_value) = $event)),
|
|
3380
3377
|
placeholder: $props.searchPlaceholder ? $props.searchPlaceholder : 'Search',
|
|
3381
3378
|
class: "form-control sh-search-input"
|
|
3382
|
-
}, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_11), [
|
|
3379
|
+
}, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_11$1), [
|
|
3383
3380
|
[vModelText, $data.filter_value]
|
|
3384
3381
|
])
|
|
3385
3382
|
])
|
|
@@ -3389,7 +3386,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3389
3386
|
($options.hasDefaultSlot)
|
|
3390
3387
|
? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
3391
3388
|
($data.loading === 'loading')
|
|
3392
|
-
? (openBlock(), createElementBlock("div", _hoisted_12, _hoisted_14))
|
|
3389
|
+
? (openBlock(), createElementBlock("div", _hoisted_12$1, _hoisted_14$1))
|
|
3393
3390
|
: ($data.loading === 'error')
|
|
3394
3391
|
? (openBlock(), createElementBlock("div", _hoisted_15, [
|
|
3395
3392
|
createElementVNode("span", _hoisted_16, toDisplayString($data.loading_error), 1 /* TEXT */)
|
|
@@ -3675,10 +3672,10 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3675
3672
|
]))
|
|
3676
3673
|
}
|
|
3677
3674
|
|
|
3678
|
-
script$
|
|
3679
|
-
script$
|
|
3675
|
+
script$4.render = render$1;
|
|
3676
|
+
script$4.__file = "src/lib/components/ShTable.vue";
|
|
3680
3677
|
|
|
3681
|
-
var script$
|
|
3678
|
+
var script$3 = {
|
|
3682
3679
|
name: 'ShTabs',
|
|
3683
3680
|
props: ['tabs', 'baseUrl', 'sharedData', 'tabCounts', 'responsive'],
|
|
3684
3681
|
data () {
|
|
@@ -3719,7 +3716,7 @@ var script$1 = {
|
|
|
3719
3716
|
if (typeof tabCounts === 'object') {
|
|
3720
3717
|
this.setCounts(tabCounts);
|
|
3721
3718
|
} else {
|
|
3722
|
-
|
|
3719
|
+
shApis$1.doGet(tabCounts).then(res => {
|
|
3723
3720
|
this.setCounts(res.data);
|
|
3724
3721
|
});
|
|
3725
3722
|
}
|
|
@@ -3759,14 +3756,14 @@ var script$1 = {
|
|
|
3759
3756
|
}
|
|
3760
3757
|
};
|
|
3761
3758
|
|
|
3762
|
-
const _hoisted_1$
|
|
3759
|
+
const _hoisted_1$3 = {
|
|
3763
3760
|
key: 0,
|
|
3764
3761
|
class: "navbar navbar-expand-lg sh-horizontal-tabs"
|
|
3765
3762
|
};
|
|
3766
|
-
const _hoisted_2$
|
|
3767
|
-
const _hoisted_3$
|
|
3768
|
-
const _hoisted_4$
|
|
3769
|
-
const _hoisted_5 = { class: "tab-content" };
|
|
3763
|
+
const _hoisted_2$3 = ["data-bs-target"];
|
|
3764
|
+
const _hoisted_3$3 = /*#__PURE__*/createElementVNode("i", { class: "bi-chevron-right float-end" }, null, -1 /* HOISTED */);
|
|
3765
|
+
const _hoisted_4$3 = ["id"];
|
|
3766
|
+
const _hoisted_5$2 = { class: "tab-content" };
|
|
3770
3767
|
|
|
3771
3768
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3772
3769
|
const _component_router_link = resolveComponent("router-link");
|
|
@@ -3774,7 +3771,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3774
3771
|
|
|
3775
3772
|
return (openBlock(), createElementBlock(Fragment, null, [
|
|
3776
3773
|
($data.generatedId)
|
|
3777
|
-
? (openBlock(), createElementBlock("nav", _hoisted_1$
|
|
3774
|
+
? (openBlock(), createElementBlock("nav", _hoisted_1$3, [
|
|
3778
3775
|
($data.isResponsive)
|
|
3779
3776
|
? (openBlock(), createElementBlock("a", {
|
|
3780
3777
|
key: 0,
|
|
@@ -3787,8 +3784,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3787
3784
|
"aria-label": "Toggle navigation"
|
|
3788
3785
|
}, [
|
|
3789
3786
|
createTextVNode(toDisplayString($data.currentTab) + " ", 1 /* TEXT */),
|
|
3790
|
-
_hoisted_3$
|
|
3791
|
-
], 8 /* PROPS */, _hoisted_2$
|
|
3787
|
+
_hoisted_3$3
|
|
3788
|
+
], 8 /* PROPS */, _hoisted_2$3))
|
|
3792
3789
|
: createCommentVNode("v-if", true),
|
|
3793
3790
|
createElementVNode("div", {
|
|
3794
3791
|
class: normalizeClass($data.isResponsive ? 'collapse navbar-collapse':''),
|
|
@@ -3817,10 +3814,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3817
3814
|
]))
|
|
3818
3815
|
}), 128 /* KEYED_FRAGMENT */))
|
|
3819
3816
|
], 2 /* CLASS */)
|
|
3820
|
-
], 10 /* CLASS, PROPS */, _hoisted_4$
|
|
3817
|
+
], 10 /* CLASS, PROPS */, _hoisted_4$3)
|
|
3821
3818
|
]))
|
|
3822
3819
|
: createCommentVNode("v-if", true),
|
|
3823
|
-
createElementVNode("div", _hoisted_5, [
|
|
3820
|
+
createElementVNode("div", _hoisted_5$2, [
|
|
3824
3821
|
createVNode(_component_router_view, {
|
|
3825
3822
|
currentTab: $data.currentTab,
|
|
3826
3823
|
sharedData: $props.sharedData,
|
|
@@ -3830,21 +3827,21 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3830
3827
|
], 64 /* STABLE_FRAGMENT */))
|
|
3831
3828
|
}
|
|
3832
3829
|
|
|
3833
|
-
script$
|
|
3834
|
-
script$
|
|
3830
|
+
script$3.render = render;
|
|
3831
|
+
script$3.__file = "src/lib/components/ShTabs.vue";
|
|
3835
3832
|
|
|
3836
|
-
const _hoisted_1 = {
|
|
3833
|
+
const _hoisted_1$2 = {
|
|
3837
3834
|
class: "nav nav-tabs",
|
|
3838
3835
|
role: "tablist"
|
|
3839
3836
|
};
|
|
3840
|
-
const _hoisted_2 = {
|
|
3837
|
+
const _hoisted_2$2 = {
|
|
3841
3838
|
class: "nav-item",
|
|
3842
3839
|
role: "presentation"
|
|
3843
3840
|
};
|
|
3844
|
-
const _hoisted_3 = ["onClick"];
|
|
3845
|
-
const _hoisted_4 = { class: "tab-content" };
|
|
3841
|
+
const _hoisted_3$2 = ["onClick"];
|
|
3842
|
+
const _hoisted_4$2 = { class: "tab-content" };
|
|
3846
3843
|
|
|
3847
|
-
var script = {
|
|
3844
|
+
var script$2 = {
|
|
3848
3845
|
__name: 'ShDynamicTabs',
|
|
3849
3846
|
props: ['tabs'],
|
|
3850
3847
|
setup(__props) {
|
|
@@ -3869,17 +3866,17 @@ function setTab(tab){
|
|
|
3869
3866
|
|
|
3870
3867
|
return (_ctx, _cache) => {
|
|
3871
3868
|
return (openBlock(), createElementBlock(Fragment, null, [
|
|
3872
|
-
createElementVNode("ul", _hoisted_1, [
|
|
3869
|
+
createElementVNode("ul", _hoisted_1$2, [
|
|
3873
3870
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(tabs), (tab) => {
|
|
3874
|
-
return (openBlock(), createElementBlock("li", _hoisted_2, [
|
|
3871
|
+
return (openBlock(), createElementBlock("li", _hoisted_2$2, [
|
|
3875
3872
|
createElementVNode("button", {
|
|
3876
3873
|
onClick: $event => (setTab(tab)),
|
|
3877
3874
|
class: normalizeClass(["nav-link", unref(currentTab) === tab ? 'active':''])
|
|
3878
|
-
}, toDisplayString(tab.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_3)
|
|
3875
|
+
}, toDisplayString(tab.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_3$2)
|
|
3879
3876
|
]))
|
|
3880
3877
|
}), 256 /* UNKEYED_FRAGMENT */))
|
|
3881
3878
|
]),
|
|
3882
|
-
createElementVNode("div", _hoisted_4, [
|
|
3879
|
+
createElementVNode("div", _hoisted_4$2, [
|
|
3883
3880
|
(unref(currentTab))
|
|
3884
3881
|
? (openBlock(), createBlock(resolveDynamicComponent(unref(currentTab).component), { key: 0 }))
|
|
3885
3882
|
: createCommentVNode("v-if", true)
|
|
@@ -3890,7 +3887,7 @@ return (_ctx, _cache) => {
|
|
|
3890
3887
|
|
|
3891
3888
|
};
|
|
3892
3889
|
|
|
3893
|
-
script.__file = "src/lib/components/ShDynamicTabs.vue";
|
|
3890
|
+
script$2.__file = "src/lib/components/ShDynamicTabs.vue";
|
|
3894
3891
|
|
|
3895
3892
|
const useUserStore = defineStore('user-store', {
|
|
3896
3893
|
state: () => ({
|
|
@@ -3918,7 +3915,7 @@ const useUserStore = defineStore('user-store', {
|
|
|
3918
3915
|
};
|
|
3919
3916
|
}
|
|
3920
3917
|
this.user = user;
|
|
3921
|
-
|
|
3918
|
+
shApis$1.doGet('auth/user').then(res => {
|
|
3922
3919
|
const user = res.data;
|
|
3923
3920
|
ShStorage.setItem('user',res.data);
|
|
3924
3921
|
user.isAllowedTo = function (slug) {
|
|
@@ -3972,13 +3969,384 @@ const useUserStore = defineStore('user-store', {
|
|
|
3972
3969
|
}
|
|
3973
3970
|
});
|
|
3974
3971
|
|
|
3975
|
-
|
|
3972
|
+
const _hoisted_1$1 = /*#__PURE__*/createElementVNode("h5", null, "Departments (updated)", -1 /* HOISTED */);
|
|
3973
|
+
const _hoisted_2$1 = {
|
|
3974
|
+
"data-bs-toggle": "modal",
|
|
3975
|
+
ref: "addDeptBtn",
|
|
3976
|
+
href: "#department_modal",
|
|
3977
|
+
class: "btn btn-info"
|
|
3978
|
+
};
|
|
3979
|
+
const _hoisted_3$1 = /*#__PURE__*/createElementVNode("i", { class: "fa fa-plus" }, null, -1 /* HOISTED */);
|
|
3980
|
+
const _hoisted_4$1 = /*#__PURE__*/createTextVNode(" ADD DEPARTMENT");
|
|
3981
|
+
const _hoisted_5$1 = [
|
|
3982
|
+
_hoisted_3$1,
|
|
3983
|
+
_hoisted_4$1
|
|
3984
|
+
];
|
|
3985
|
+
const _hoisted_6$1 = /*#__PURE__*/createElementVNode("i", { class: "fa fa-plus" }, null, -1 /* HOISTED */);
|
|
3986
|
+
const _hoisted_7 = /*#__PURE__*/createTextVNode(" ADD DEPARTMENT");
|
|
3987
|
+
const _hoisted_8 = [
|
|
3988
|
+
_hoisted_6$1,
|
|
3989
|
+
_hoisted_7
|
|
3990
|
+
];
|
|
3991
|
+
const _hoisted_9 = /*#__PURE__*/createTextVNode("Permissions for ");
|
|
3992
|
+
const _hoisted_10 = { class: "text-primary" };
|
|
3993
|
+
const _hoisted_11 = ["value"];
|
|
3994
|
+
const _hoisted_12 = /*#__PURE__*/createElementVNode("i", { class: "fa fa-save" }, null, -1 /* HOISTED */);
|
|
3995
|
+
const _hoisted_13 = /*#__PURE__*/createTextVNode(" Submit");
|
|
3996
|
+
const _hoisted_14 = [
|
|
3997
|
+
_hoisted_12,
|
|
3998
|
+
_hoisted_13
|
|
3999
|
+
];
|
|
4000
|
+
|
|
4001
|
+
|
|
4002
|
+
var script$1 = {
|
|
4003
|
+
__name: 'Departments',
|
|
4004
|
+
setup(__props) {
|
|
4005
|
+
|
|
4006
|
+
let editingDepartment = ref(null);
|
|
4007
|
+
let allPermissions = ref([]);
|
|
4008
|
+
let permissions = ref([]);
|
|
4009
|
+
let reload = ref(0);
|
|
4010
|
+
let permissionsModalBtn = ref(null);
|
|
4011
|
+
|
|
4012
|
+
onMounted(() => {
|
|
4013
|
+
shApis$1.doGet('admin/departments/all-permissions').then(res => {
|
|
4014
|
+
allPermissions.value = res.data;
|
|
4015
|
+
});
|
|
4016
|
+
});
|
|
4017
|
+
|
|
4018
|
+
|
|
4019
|
+
function getPermissionLeft (menu) {
|
|
4020
|
+
const len = menu.split('.').length * 2;
|
|
4021
|
+
if (len > 5) {
|
|
4022
|
+
return 5
|
|
4023
|
+
}
|
|
4024
|
+
return len
|
|
4025
|
+
}
|
|
4026
|
+
function getPermissionLabel (menu) {
|
|
4027
|
+
const arr = menu.split('.');
|
|
4028
|
+
return arr[arr.length - 1].replace(/_/g, ' ')
|
|
4029
|
+
}
|
|
4030
|
+
function departmentAdded (response) {
|
|
4031
|
+
this.reload += 1;
|
|
4032
|
+
}
|
|
4033
|
+
|
|
4034
|
+
function rowSelected(department) {
|
|
4035
|
+
editingDepartment.value = department;
|
|
4036
|
+
if (department.permissions) {
|
|
4037
|
+
this.permissions = JSON.parse(department.permissions);
|
|
4038
|
+
}
|
|
4039
|
+
}
|
|
4040
|
+
|
|
4041
|
+
return (_ctx, _cache) => {
|
|
4042
|
+
return (openBlock(), createElementBlock(Fragment, null, [
|
|
4043
|
+
_hoisted_1$1,
|
|
4044
|
+
createElementVNode("a", _hoisted_2$1, _hoisted_5$1, 512 /* NEED_PATCH */),
|
|
4045
|
+
createElementVNode("a", {
|
|
4046
|
+
"data-bs-toggle": "modal",
|
|
4047
|
+
ref_key: "permissionsModalBtn",
|
|
4048
|
+
ref: permissionsModalBtn,
|
|
4049
|
+
href: "#permissions_modal",
|
|
4050
|
+
class: "btn btn-info d-none"
|
|
4051
|
+
}, _hoisted_8, 512 /* NEED_PATCH */),
|
|
4052
|
+
createVNode(script$4, {
|
|
4053
|
+
reload: unref(reload),
|
|
4054
|
+
onRowSelected: rowSelected,
|
|
4055
|
+
headers: ['id','name','description', 'created_at'],
|
|
4056
|
+
"end-point": "admin/departments/list",
|
|
4057
|
+
actions: {
|
|
4058
|
+
label: 'Action',
|
|
4059
|
+
actions: [
|
|
4060
|
+
{
|
|
4061
|
+
label: 'Permissions',
|
|
4062
|
+
path: '/admin/departments/permissions/{id}',
|
|
4063
|
+
class: 'btn btn-info bi-lock'
|
|
4064
|
+
}
|
|
4065
|
+
]
|
|
4066
|
+
}
|
|
4067
|
+
}, null, 8 /* PROPS */, ["reload"]),
|
|
4068
|
+
createVNode(script$6, {
|
|
4069
|
+
modal_id: "department_modal",
|
|
4070
|
+
modal_title: "Department Form"
|
|
4071
|
+
}, {
|
|
4072
|
+
default: withCtx(() => [
|
|
4073
|
+
createVNode(script$8, {
|
|
4074
|
+
"success-callback": "departmentAdded",
|
|
4075
|
+
onDepartmentAdded: departmentAdded,
|
|
4076
|
+
action: "admin/departments/store",
|
|
4077
|
+
fields: ['name','description']
|
|
4078
|
+
})
|
|
4079
|
+
]),
|
|
4080
|
+
_: 1 /* STABLE */
|
|
4081
|
+
}),
|
|
4082
|
+
createVNode(script$6, {
|
|
4083
|
+
modal_id: "permissions_modal",
|
|
4084
|
+
modal_title: "Edit Department Permissions"
|
|
4085
|
+
}, {
|
|
4086
|
+
default: withCtx(() => [
|
|
4087
|
+
(unref(allPermissions) && unref(editingDepartment))
|
|
4088
|
+
? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
4089
|
+
createElementVNode("h3", null, [
|
|
4090
|
+
_hoisted_9,
|
|
4091
|
+
createElementVNode("span", _hoisted_10, toDisplayString(unref(editingDepartment).name), 1 /* TEXT */)
|
|
4092
|
+
]),
|
|
4093
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(allPermissions), (permission) => {
|
|
4094
|
+
return (openBlock(), createElementBlock("div", {
|
|
4095
|
+
key: permission,
|
|
4096
|
+
class: "list-group p-0"
|
|
4097
|
+
}, [
|
|
4098
|
+
createElementVNode("label", {
|
|
4099
|
+
class: normalizeClass(["list-group-item pb-0 text-capitalize", 'ms-' + getPermissionLeft(permission)])
|
|
4100
|
+
}, [
|
|
4101
|
+
withDirectives(createElementVNode("input", {
|
|
4102
|
+
type: "checkbox",
|
|
4103
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (isRef(permissions) ? (permissions).value = $event : permissions = $event)),
|
|
4104
|
+
value: permission
|
|
4105
|
+
}, null, 8 /* PROPS */, _hoisted_11), [
|
|
4106
|
+
[vModelCheckbox, unref(permissions)]
|
|
4107
|
+
]),
|
|
4108
|
+
createTextVNode(" " + toDisplayString(getPermissionLabel(permission)), 1 /* TEXT */)
|
|
4109
|
+
], 2 /* CLASS */)
|
|
4110
|
+
]))
|
|
4111
|
+
}), 128 /* KEYED_FRAGMENT */)),
|
|
4112
|
+
createElementVNode("button", {
|
|
4113
|
+
onClick: _cache[1] || (_cache[1] = (...args) => (_ctx.submitPermissions && _ctx.submitPermissions(...args))),
|
|
4114
|
+
class: "btn btn-info"
|
|
4115
|
+
}, _hoisted_14)
|
|
4116
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
4117
|
+
: createCommentVNode("v-if", true)
|
|
4118
|
+
]),
|
|
4119
|
+
_: 1 /* STABLE */
|
|
4120
|
+
})
|
|
4121
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
4122
|
+
}
|
|
4123
|
+
}
|
|
4124
|
+
|
|
4125
|
+
};
|
|
4126
|
+
|
|
4127
|
+
script$1.__file = "src/lib/components/core/Departments/Departments.vue";
|
|
4128
|
+
|
|
4129
|
+
const _hoisted_1 = /*#__PURE__*/createElementVNode("a", {
|
|
4130
|
+
href: "#addModule",
|
|
4131
|
+
class: "btn btn-info btn-sm",
|
|
4132
|
+
"data-bs-toggle": "modal"
|
|
4133
|
+
}, [
|
|
4134
|
+
/*#__PURE__*/createElementVNode("i", { class: "bi-plus" }),
|
|
4135
|
+
/*#__PURE__*/createTextVNode(" ADD Module")
|
|
4136
|
+
], -1 /* HOISTED */);
|
|
4137
|
+
const _hoisted_2 = { class: "text-primary text-capitalize" };
|
|
4138
|
+
const _hoisted_3 = ["value"];
|
|
4139
|
+
const _hoisted_4 = /*#__PURE__*/createElementVNode("i", { class: "fa fa-save" }, null, -1 /* HOISTED */);
|
|
4140
|
+
const _hoisted_5 = /*#__PURE__*/createTextVNode(" Submit");
|
|
4141
|
+
const _hoisted_6 = [
|
|
4142
|
+
_hoisted_4,
|
|
4143
|
+
_hoisted_5
|
|
4144
|
+
];
|
|
4145
|
+
|
|
4146
|
+
var script = {
|
|
4147
|
+
__name: 'Department',
|
|
4148
|
+
setup(__props) {
|
|
4149
|
+
|
|
4150
|
+
const route = useRoute();
|
|
4151
|
+
const id = ref(route.params.id);
|
|
4152
|
+
let department = ref(null);
|
|
4153
|
+
let permissionCanvasBtn = ref(null);
|
|
4154
|
+
let reload = ref(1);
|
|
4155
|
+
let module = ref(null);
|
|
4156
|
+
let modulePermissions = ref(null);
|
|
4157
|
+
let selectedPermissions = ref([]);
|
|
4158
|
+
const userStore = useUserStore();
|
|
4159
|
+
|
|
4160
|
+
storeToRefs(userStore);
|
|
4161
|
+
|
|
4162
|
+
onMounted(() => {
|
|
4163
|
+
getDepartment();
|
|
4164
|
+
});
|
|
4165
|
+
|
|
4166
|
+
let getModule = computed(()=>{
|
|
4167
|
+
return module.value
|
|
4168
|
+
});
|
|
4169
|
+
|
|
4170
|
+
|
|
4171
|
+
|
|
4172
|
+
function moduleAdded () {
|
|
4173
|
+
shRepo.showToast('module added successfully', 'success');
|
|
4174
|
+
reload.value++;
|
|
4175
|
+
}
|
|
4176
|
+
function showModule (module) {
|
|
4177
|
+
if (module) {
|
|
4178
|
+
return '<span class="text-capitalize">' + module.module.replace('_', ' ') + '</span>'
|
|
4179
|
+
}
|
|
4180
|
+
return 'Module'
|
|
4181
|
+
}
|
|
4182
|
+
function deletePermission (module) {
|
|
4183
|
+
shRepo.runPlainRequest('admin/departments/department/delete-department/' + module.id).then((res) => {
|
|
4184
|
+
if (res.isConfirmed) {
|
|
4185
|
+
reload.value++;
|
|
4186
|
+
// shRepo.showToast('module removed successfully', 'success')
|
|
4187
|
+
}
|
|
4188
|
+
});
|
|
4189
|
+
}
|
|
4190
|
+
function viewPermissions(rModule) {
|
|
4191
|
+
module.value = null;
|
|
4192
|
+
permissionCanvasBtn.value.click();
|
|
4193
|
+
modulePermissions.value = null;
|
|
4194
|
+
selectedPermissions.value = [];
|
|
4195
|
+
shApis.doGet('admin/departments/department/get-module-permissions/' + rModule.module).then(res => {
|
|
4196
|
+
modulePermissions.value = res.data.permissions;
|
|
4197
|
+
module.value = rModule;
|
|
4198
|
+
if (rModule.permissions) {
|
|
4199
|
+
selectedPermissions.value = JSON.parse(rModule.permissions);
|
|
4200
|
+
}
|
|
4201
|
+
console.log(module.value);
|
|
4202
|
+
}).catch(ex => {
|
|
4203
|
+
console.log(ex);
|
|
4204
|
+
// helpers.showToast('An error occurred while fetching permissions')
|
|
4205
|
+
});
|
|
4206
|
+
}
|
|
4207
|
+
function getDepartment() {
|
|
4208
|
+
shApis.doGet('admin/departments/department/' + id.value).then(res => {
|
|
4209
|
+
department.value = res.data.department;
|
|
4210
|
+
}).catch(ex => {
|
|
4211
|
+
console.log(ex);
|
|
4212
|
+
});
|
|
4213
|
+
}
|
|
4214
|
+
function getPermissionLeft (menu) {
|
|
4215
|
+
const len = menu.split('.').length * 2;
|
|
4216
|
+
if (len > 5) {
|
|
4217
|
+
return 5
|
|
4218
|
+
}
|
|
4219
|
+
return len
|
|
4220
|
+
}
|
|
4221
|
+
function getPermissionLabel(menu) {
|
|
4222
|
+
const arr = menu.split('.');
|
|
4223
|
+
return arr[arr.length - 1].replace(/_/g, ' ')
|
|
4224
|
+
}
|
|
4225
|
+
function submitPermissions() {
|
|
4226
|
+
const data = {
|
|
4227
|
+
permissions: selectedPermissions.value
|
|
4228
|
+
};
|
|
4229
|
+
shApis.doPost('admin/departments/department/permissions/' + getModule.value.id, data)
|
|
4230
|
+
.then(res => {
|
|
4231
|
+
reload.value++;
|
|
4232
|
+
shRepo.showToast('Permissions updated', 'success');
|
|
4233
|
+
});
|
|
4234
|
+
}
|
|
4235
|
+
|
|
4236
|
+
return (_ctx, _cache) => {
|
|
4237
|
+
return (unref(department))
|
|
4238
|
+
? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
4239
|
+
_hoisted_1,
|
|
4240
|
+
createElementVNode("h5", null, "Department #" + toDisplayString(unref(department).id) + " - " + toDisplayString(unref(department).name) + " Allowed Modules", 1 /* TEXT */),
|
|
4241
|
+
createVNode(script$4, {
|
|
4242
|
+
actions: {
|
|
4243
|
+
label: 'Actions',
|
|
4244
|
+
actions: [
|
|
4245
|
+
{
|
|
4246
|
+
label: 'Permissions',
|
|
4247
|
+
emits: viewPermissions,
|
|
4248
|
+
class: 'btn btn-success btn-sm'
|
|
4249
|
+
},
|
|
4250
|
+
{
|
|
4251
|
+
label: 'Delete',
|
|
4252
|
+
emits: deletePermission,
|
|
4253
|
+
class: 'btn btn-danger mx-2 btn-sm'
|
|
4254
|
+
}
|
|
4255
|
+
]
|
|
4256
|
+
},
|
|
4257
|
+
reload: unref(reload),
|
|
4258
|
+
headers: ['id',showModule,'created_at'],
|
|
4259
|
+
"end-point": 'admin/departments/department/list-modules/' + id.value
|
|
4260
|
+
}, null, 8 /* PROPS */, ["actions", "reload", "headers", "end-point"]),
|
|
4261
|
+
createVNode(script$6, {
|
|
4262
|
+
"modal-id": "addModule",
|
|
4263
|
+
"modal-title": "Add Module Department"
|
|
4264
|
+
}, {
|
|
4265
|
+
default: withCtx(() => [
|
|
4266
|
+
createVNode(script$8, {
|
|
4267
|
+
"reload-select-items": unref(reload),
|
|
4268
|
+
"success-callback": moduleAdded,
|
|
4269
|
+
"fill-selects": {
|
|
4270
|
+
permission_module: {
|
|
4271
|
+
url: 'admin/departments/department/list-pending-modules/' + id.value
|
|
4272
|
+
}
|
|
4273
|
+
},
|
|
4274
|
+
fields: ['permission_module'],
|
|
4275
|
+
action: 'admin/departments/department/add-module/' + id.value
|
|
4276
|
+
}, null, 8 /* PROPS */, ["reload-select-items", "fill-selects", "action"])
|
|
4277
|
+
]),
|
|
4278
|
+
_: 1 /* STABLE */
|
|
4279
|
+
}),
|
|
4280
|
+
createElementVNode("a", {
|
|
4281
|
+
href: "#permissionsCanvas",
|
|
4282
|
+
class: "d-none",
|
|
4283
|
+
ref_key: "permissionCanvasBtn",
|
|
4284
|
+
ref: permissionCanvasBtn,
|
|
4285
|
+
"data-bs-toggle": "offcanvas"
|
|
4286
|
+
}, null, 512 /* NEED_PATCH */),
|
|
4287
|
+
createVNode(script$7, {
|
|
4288
|
+
"canvas-id": "permissionsCanvas",
|
|
4289
|
+
position: "end enlarged",
|
|
4290
|
+
"canvas-title": "Module Permissions"
|
|
4291
|
+
}, {
|
|
4292
|
+
default: withCtx(() => [
|
|
4293
|
+
(unref(getModule))
|
|
4294
|
+
? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
4295
|
+
createElementVNode("h5", _hoisted_2, "Permissions for " + toDisplayString(unref(getModule).module), 1 /* TEXT */),
|
|
4296
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(modulePermissions), (permission) => {
|
|
4297
|
+
return (openBlock(), createElementBlock("div", {
|
|
4298
|
+
key: permission,
|
|
4299
|
+
class: "list-group p-0"
|
|
4300
|
+
}, [
|
|
4301
|
+
createElementVNode("label", {
|
|
4302
|
+
class: normalizeClass(["list-group-item pb-0 text-capitalize", 'ms-' + getPermissionLeft(permission)])
|
|
4303
|
+
}, [
|
|
4304
|
+
withDirectives(createElementVNode("input", {
|
|
4305
|
+
type: "checkbox",
|
|
4306
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (isRef(selectedPermissions) ? (selectedPermissions).value = $event : selectedPermissions = $event)),
|
|
4307
|
+
value: permission
|
|
4308
|
+
}, null, 8 /* PROPS */, _hoisted_3), [
|
|
4309
|
+
[vModelCheckbox, unref(selectedPermissions)]
|
|
4310
|
+
]),
|
|
4311
|
+
createTextVNode(" " + toDisplayString(getPermissionLabel(permission)), 1 /* TEXT */)
|
|
4312
|
+
], 2 /* CLASS */)
|
|
4313
|
+
]))
|
|
4314
|
+
}), 128 /* KEYED_FRAGMENT */)),
|
|
4315
|
+
createElementVNode("button", {
|
|
4316
|
+
onClick: submitPermissions,
|
|
4317
|
+
class: "btn btn-info"
|
|
4318
|
+
}, _hoisted_6)
|
|
4319
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
4320
|
+
: createCommentVNode("v-if", true)
|
|
4321
|
+
]),
|
|
4322
|
+
_: 1 /* STABLE */
|
|
4323
|
+
})
|
|
4324
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
4325
|
+
: createCommentVNode("v-if", true)
|
|
4326
|
+
}
|
|
4327
|
+
}
|
|
4328
|
+
|
|
4329
|
+
};
|
|
4330
|
+
|
|
4331
|
+
script.__file = "src/lib/components/core/Departments/department/Department.vue";
|
|
4332
|
+
|
|
4333
|
+
const ShFrontend = {
|
|
3976
4334
|
install: (app, options) => {
|
|
3977
4335
|
if(options.sessionTimeout){
|
|
3978
4336
|
app.provide('sessionTimeout',options.sessionTimeout);
|
|
3979
4337
|
ShStorage.setItem('sessionTimeout',options.sessionTimeout);
|
|
3980
4338
|
}
|
|
4339
|
+
if(options.router) {
|
|
4340
|
+
options.router.addRoute({
|
|
4341
|
+
path: '/sh-departments',
|
|
4342
|
+
component: script$1
|
|
4343
|
+
});
|
|
4344
|
+
options.router.addRoute({
|
|
4345
|
+
path: '/sh-departments/permissions/:id',
|
|
4346
|
+
component: script
|
|
4347
|
+
});
|
|
4348
|
+
}
|
|
3981
4349
|
}
|
|
3982
4350
|
};
|
|
3983
4351
|
|
|
3984
|
-
export { script$
|
|
4352
|
+
export { script$7 as ShCanvas, script$2 as ShDynamicTabs, script$8 as ShForm, ShFrontend, script$6 as ShModal, script$b as ShPhone, script$4 as ShTable, script$3 as ShTabs, shApis$1 as shApis, helpers as shRepo, ShStorage as shStorage, useUserStore };
|