@websy/websy-designs 1.8.2 → 1.9.1
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/server/helpers/v1/authHelper.js +23 -18
- package/dist/server/helpers/v1/pgHelper.js +7 -0
- package/dist/server/routes/v1/api.js +6 -1
- package/dist/server/websy-designs-server.js +6 -3
- package/dist/websy-designs-es6.debug.js +71 -27
- package/dist/websy-designs-es6.js +58 -21
- package/dist/websy-designs-es6.min.js +1 -1
- package/dist/websy-designs.debug.js +72 -28
- package/dist/websy-designs.js +59 -22
- package/dist/websy-designs.min.css +1 -1
- package/dist/websy-designs.min.js +1 -1
- package/package.json +1 -1
|
@@ -133,27 +133,32 @@ class AuthHelper {
|
|
|
133
133
|
}
|
|
134
134
|
checkPermissions (req, res, next) {
|
|
135
135
|
console.log('hello')
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
136
|
+
if (process.env.USE_PERMISSIONS === 'true' || process.env.USE_PERMISSIONS === true) {
|
|
137
|
+
const permissions = {
|
|
138
|
+
entities: {
|
|
139
|
+
POST: false,
|
|
140
|
+
PUT: true,
|
|
141
|
+
GET: true,
|
|
142
|
+
DELETE: true
|
|
143
|
+
},
|
|
144
|
+
item: {
|
|
145
|
+
POST: true,
|
|
146
|
+
PUT: true,
|
|
147
|
+
GET: true,
|
|
148
|
+
DELETE: true
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (permissions[req.params.entity] && permissions[req.params.entity][req.method] === true) {
|
|
152
|
+
next()
|
|
148
153
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
154
|
+
else {
|
|
155
|
+
res.status(403)
|
|
156
|
+
res.json('User does not have permissions to ....')
|
|
157
|
+
}
|
|
152
158
|
}
|
|
153
159
|
else {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
160
|
+
next()
|
|
161
|
+
}
|
|
157
162
|
}
|
|
158
163
|
}
|
|
159
164
|
|
|
@@ -110,6 +110,13 @@ class PGHelper {
|
|
|
110
110
|
buildInsert (entity, data, user) {
|
|
111
111
|
delete data[(this.options.entityConfig[entity] && this.options.entityConfig[entity].idColumn) || 'id']
|
|
112
112
|
// data.create_user = user
|
|
113
|
+
if (process.env.CREATE_USER_FIELD && process.env.USERID_FIELD && user) {
|
|
114
|
+
data[process.env.CREATE_USER_FIELD] = user[process.env.USERID_FIELD || 'id']
|
|
115
|
+
data[process.env.EDIT_USER_FIELD] = user[process.env.USERID_FIELD || 'id']
|
|
116
|
+
}
|
|
117
|
+
if (process.env.EDIT_DATE_FIELD) {
|
|
118
|
+
data[process.env.EDIT_DATE_FIELD] = (new Date()).toISOString()
|
|
119
|
+
}
|
|
113
120
|
return `
|
|
114
121
|
INSERT INTO ${entity} (${Object.keys(data).join(',')})
|
|
115
122
|
VALUES (${Object.values(data).map(d => (d === null ? `${d}` : `'${d}'`)).join(',')})
|
|
@@ -46,7 +46,12 @@ function APIRoutes (dbHelper, authHelper) {
|
|
|
46
46
|
router.post('/:entity', authHelper.checkPermissions, (req, res) => {
|
|
47
47
|
// const sql = dbHelper.buildInsert(req.params.entity, req.body, req.session.passport.user.id)
|
|
48
48
|
console.log(req.body)
|
|
49
|
-
|
|
49
|
+
console.log(req.session)
|
|
50
|
+
let user
|
|
51
|
+
if (req.session && req.session.user) {
|
|
52
|
+
user = req.session.user
|
|
53
|
+
}
|
|
54
|
+
const sql = dbHelper.buildInsert(req.params.entity, req.body, user)
|
|
50
55
|
console.log(sql)
|
|
51
56
|
dbHelper.execute(sql).then(response => res.json(response), err => {
|
|
52
57
|
res.statusCode = 404
|
|
@@ -147,12 +147,15 @@ module.exports = function (options) {
|
|
|
147
147
|
// console.log('secure routes', secureRoutes)
|
|
148
148
|
// console.log('excluded routes', excludedRoutes)
|
|
149
149
|
// console.log('path', req.path)
|
|
150
|
-
// console.log('index of', excludedRoutes.indexOf(req.path))
|
|
151
|
-
if (secureRoutes ===
|
|
150
|
+
// console.log('index of', excludedRoutes.indexOf(req.path))
|
|
151
|
+
if (secureRoutes === true) {
|
|
152
|
+
excludedRoutes.push('/resources', '/scripts', '/styles', '/external', '/templates', '/fonts')
|
|
153
|
+
}
|
|
154
|
+
if (secureRoutes === false && excludedRoutes.indexOf('/' + req.path.split('/')[1]) !== -1) {
|
|
152
155
|
// console.log('in condition A')
|
|
153
156
|
app.authHelper.isLoggedIn(req, res, next)
|
|
154
157
|
}
|
|
155
|
-
else if (secureRoutes === true && excludedRoutes.indexOf(req.path) === -1) {
|
|
158
|
+
else if (secureRoutes === true && excludedRoutes.indexOf('/' + req.path.split('/')[1]) === -1) {
|
|
156
159
|
// console.log('in condition B')
|
|
157
160
|
app.authHelper.isLoggedIn(req, res, next)
|
|
158
161
|
}
|
|
@@ -1501,6 +1501,7 @@ class WebsyDropdown {
|
|
|
1501
1501
|
showCompleteSelectedList: false,
|
|
1502
1502
|
closeAfterSelection: true,
|
|
1503
1503
|
customActions: [],
|
|
1504
|
+
customButtons: [],
|
|
1504
1505
|
searchIcon: `<svg width="20" height="20" viewBox="0 0 512 512"><path d="M221.09,64A157.09,157.09,0,1,0,378.18,221.09,157.1,157.1,0,0,0,221.09,64Z" style="fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px"/><line x1="338.29" y1="338.29" x2="448" y2="448" style="fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px"/></svg>`,
|
|
1505
1506
|
clearIcon: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 512 512"><title>ionicons-v5-l</title><line x1="368" y1="368" x2="144" y2="144" style="fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><line x1="368" y1="144" x2="144" y2="368" style="fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/></svg>`,
|
|
1506
1507
|
arrowIcon: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M23.677 18.52c.914 1.523-.183 3.472-1.967 3.472h-19.414c-1.784 0-2.881-1.949-1.967-3.472l9.709-16.18c.891-1.483 3.041-1.48 3.93 0l9.709 16.18z"/></svg>`,
|
|
@@ -1553,24 +1554,47 @@ class WebsyDropdown {
|
|
|
1553
1554
|
<div id='${this.elementId}_mask' class='websy-dropdown-mask'></div>
|
|
1554
1555
|
<div id='${this.elementId}_content' class='websy-dropdown-content'>
|
|
1555
1556
|
`
|
|
1556
|
-
if (this.options.customActions.length > 0) {
|
|
1557
|
+
if (this.options.customActions.length > 0 || this.options.customButtons.length > 0) {
|
|
1557
1558
|
html += `
|
|
1558
1559
|
<div class='websy-dropdown-action-container'>
|
|
1560
|
+
`
|
|
1561
|
+
if (this.options.customActions.length > 0) {
|
|
1562
|
+
html += `
|
|
1559
1563
|
${this.options.actionsTitle || ''}
|
|
1560
1564
|
<button class='websy-dropdown-action-button'>
|
|
1561
1565
|
${this.options.actionsIcon}
|
|
1562
1566
|
</button>
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
this.options.
|
|
1567
|
+
`
|
|
1568
|
+
}
|
|
1569
|
+
if (this.options.customButtons.length > 0) {
|
|
1566
1570
|
html += `
|
|
1567
|
-
<
|
|
1571
|
+
<div class='websy-dropdown-additional-buttons'>
|
|
1568
1572
|
`
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1573
|
+
this.options.customButtons.forEach((b, i) => {
|
|
1574
|
+
html += `
|
|
1575
|
+
<button class='websy-dropdown-custom-button' data-index='${i}'>
|
|
1576
|
+
${b.label}
|
|
1577
|
+
</button>
|
|
1578
|
+
`
|
|
1579
|
+
})
|
|
1580
|
+
html += `
|
|
1581
|
+
</div>
|
|
1582
|
+
`
|
|
1583
|
+
}
|
|
1584
|
+
if (this.options.customActions.length > 0) {
|
|
1585
|
+
html += `
|
|
1586
|
+
<ul id='${this.elementId}_actionContainer'>
|
|
1587
|
+
`
|
|
1588
|
+
this.options.customActions.forEach((a, i) => {
|
|
1589
|
+
html += `
|
|
1590
|
+
<li class='websy-dropdown-custom-action' data-index='${i}'>${a.label}</li>
|
|
1591
|
+
`
|
|
1592
|
+
})
|
|
1593
|
+
html += `
|
|
1594
|
+
</ul>
|
|
1595
|
+
</div>
|
|
1596
|
+
`
|
|
1597
|
+
}
|
|
1574
1598
|
}
|
|
1575
1599
|
if (this.options.disableSearch !== true) {
|
|
1576
1600
|
html += `
|
|
@@ -1640,7 +1664,20 @@ class WebsyDropdown {
|
|
|
1640
1664
|
this.options.onClearSelected()
|
|
1641
1665
|
}
|
|
1642
1666
|
}
|
|
1643
|
-
close () {
|
|
1667
|
+
close () {
|
|
1668
|
+
this.hide()
|
|
1669
|
+
const searchEl = document.getElementById(`${this.elementId}_search`)
|
|
1670
|
+
if (searchEl) {
|
|
1671
|
+
if (searchEl.value.length > 0 && this.options.onCancelSearch) {
|
|
1672
|
+
this.options.onCancelSearch('')
|
|
1673
|
+
searchEl.value = ''
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
if (this.options.onClose) {
|
|
1677
|
+
this.options.onClose(this.elementId)
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
hide () {
|
|
1644
1681
|
const maskEl = document.getElementById(`${this.elementId}_mask`)
|
|
1645
1682
|
const contentEl = document.getElementById(`${this.elementId}_content`)
|
|
1646
1683
|
const scrollEl = document.getElementById(`${this.elementId}_itemsContainer`)
|
|
@@ -1661,17 +1698,7 @@ class WebsyDropdown {
|
|
|
1661
1698
|
if (contentEl) {
|
|
1662
1699
|
contentEl.classList.remove('active')
|
|
1663
1700
|
contentEl.classList.remove('on-top')
|
|
1664
|
-
}
|
|
1665
|
-
const searchEl = document.getElementById(`${this.elementId}_search`)
|
|
1666
|
-
if (searchEl) {
|
|
1667
|
-
if (searchEl.value.length > 0 && this.options.onCancelSearch) {
|
|
1668
|
-
this.options.onCancelSearch('')
|
|
1669
|
-
searchEl.value = ''
|
|
1670
|
-
}
|
|
1671
|
-
}
|
|
1672
|
-
if (this.options.onClose) {
|
|
1673
|
-
this.options.onClose(this.elementId)
|
|
1674
|
-
}
|
|
1701
|
+
}
|
|
1675
1702
|
}
|
|
1676
1703
|
handleClick (event) {
|
|
1677
1704
|
if (this.options.disabled === true) {
|
|
@@ -1700,6 +1727,12 @@ class WebsyDropdown {
|
|
|
1700
1727
|
this.options.customActions[actionIndex].fn()
|
|
1701
1728
|
}
|
|
1702
1729
|
}
|
|
1730
|
+
else if (event.target.classList.contains('websy-dropdown-custom-button')) {
|
|
1731
|
+
const actionIndex = +event.target.getAttribute('data-index')
|
|
1732
|
+
if (this.options.customButtons[actionIndex] && this.options.customButtons[actionIndex].fn) {
|
|
1733
|
+
this.options.customButtons[actionIndex].fn()
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1703
1736
|
else if (event.target.classList.contains('websy-dropdown-action-button')) {
|
|
1704
1737
|
const el = document.getElementById(`${this.elementId}_actionContainer`)
|
|
1705
1738
|
if (el) {
|
|
@@ -1997,7 +2030,7 @@ class WebsyDropdown {
|
|
|
1997
2030
|
class WebsyForm {
|
|
1998
2031
|
constructor (elementId, options) {
|
|
1999
2032
|
const defaults = {
|
|
2000
|
-
submit: { text: 'Save', classes:
|
|
2033
|
+
submit: { text: 'Save', classes: [] },
|
|
2001
2034
|
useRecaptcha: false,
|
|
2002
2035
|
clearAfterSave: false,
|
|
2003
2036
|
fields: [],
|
|
@@ -2068,6 +2101,10 @@ class WebsyForm {
|
|
|
2068
2101
|
}
|
|
2069
2102
|
})
|
|
2070
2103
|
}
|
|
2104
|
+
clear () {
|
|
2105
|
+
const formEl = document.getElementById(`${this.elementId}Form`)
|
|
2106
|
+
formEl.reset()
|
|
2107
|
+
}
|
|
2071
2108
|
get data () {
|
|
2072
2109
|
const formEl = document.getElementById(`${this.elementId}Form`)
|
|
2073
2110
|
const data = {}
|
|
@@ -4050,7 +4087,9 @@ class WebsyRouter {
|
|
|
4050
4087
|
if (typeof params === 'undefined') {
|
|
4051
4088
|
return
|
|
4052
4089
|
}
|
|
4053
|
-
|
|
4090
|
+
if (reloadView === false) {
|
|
4091
|
+
this.previousParams = Object.assign({}, this.currentParams)
|
|
4092
|
+
}
|
|
4054
4093
|
const output = {
|
|
4055
4094
|
path: '',
|
|
4056
4095
|
items: {}
|
|
@@ -4065,7 +4104,9 @@ class WebsyRouter {
|
|
|
4065
4104
|
path = this.buildUrlPath(output.items)
|
|
4066
4105
|
}
|
|
4067
4106
|
output.path = path
|
|
4068
|
-
|
|
4107
|
+
if (reloadView === false) {
|
|
4108
|
+
this.currentParams = output
|
|
4109
|
+
}
|
|
4069
4110
|
let inputPath = this.currentView
|
|
4070
4111
|
if (this.options.urlPrefix) {
|
|
4071
4112
|
inputPath = `/${this.options.urlPrefix}/${inputPath}`
|
|
@@ -6029,7 +6070,8 @@ class WebsyTable3 {
|
|
|
6029
6070
|
allowPivoting: false,
|
|
6030
6071
|
searchIcon: `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 512 512"><title>ionicons-v5-f</title><path d="M221.09,64A157.09,157.09,0,1,0,378.18,221.09,157.1,157.1,0,0,0,221.09,64Z" style="fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px"/><line x1="338.29" y1="338.29" x2="448" y2="448" style="fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px"/></svg>`,
|
|
6031
6072
|
plusIcon: WebsyDesigns.Icons.PlusFilled,
|
|
6032
|
-
minusIcon: WebsyDesigns.Icons.MinusFilled
|
|
6073
|
+
minusIcon: WebsyDesigns.Icons.MinusFilled,
|
|
6074
|
+
disableInternalLoader: false
|
|
6033
6075
|
}
|
|
6034
6076
|
this.options = Object.assign({}, DEFAULTS, options)
|
|
6035
6077
|
this.isTouchDevice = ('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)
|
|
@@ -7059,7 +7101,9 @@ class WebsyTable3 {
|
|
|
7059
7101
|
}
|
|
7060
7102
|
}
|
|
7061
7103
|
showLoading (options) {
|
|
7062
|
-
this.
|
|
7104
|
+
if (this.options.disableInternalLoader !== true) {
|
|
7105
|
+
this.loadingDialog.show(options)
|
|
7106
|
+
}
|
|
7063
7107
|
}
|
|
7064
7108
|
}
|
|
7065
7109
|
|
|
@@ -1507,6 +1507,7 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
1507
1507
|
showCompleteSelectedList: false,
|
|
1508
1508
|
closeAfterSelection: true,
|
|
1509
1509
|
customActions: [],
|
|
1510
|
+
customButtons: [],
|
|
1510
1511
|
searchIcon: "<svg width=\"20\" height=\"20\" viewBox=\"0 0 512 512\"><path d=\"M221.09,64A157.09,157.09,0,1,0,378.18,221.09,157.1,157.1,0,0,0,221.09,64Z\" style=\"fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px\"/><line x1=\"338.29\" y1=\"338.29\" x2=\"448\" y2=\"448\" style=\"fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px\"/></svg>",
|
|
1511
1512
|
clearIcon: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 512 512\"><title>ionicons-v5-l</title><line x1=\"368\" y1=\"368\" x2=\"144\" y2=\"144\" style=\"fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px\"/><line x1=\"368\" y1=\"144\" x2=\"144\" y2=\"368\" style=\"fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px\"/></svg>",
|
|
1512
1513
|
arrowIcon: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path d=\"M23.677 18.52c.914 1.523-.183 3.472-1.967 3.472h-19.414c-1.784 0-2.881-1.949-1.967-3.472l9.709-16.18c.891-1.483 3.041-1.48 3.93 0l9.709 16.18z\"/></svg>",
|
|
@@ -1549,12 +1550,25 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
1549
1550
|
html += "<div class='clear'>".concat(this.options.clearIcon, "</div>");
|
|
1550
1551
|
}
|
|
1551
1552
|
html += " \n </div>\n <div id='".concat(this.elementId, "_mask' class='websy-dropdown-mask'></div>\n <div id='").concat(this.elementId, "_content' class='websy-dropdown-content'>\n ");
|
|
1552
|
-
if (this.options.customActions.length > 0) {
|
|
1553
|
-
html += "\n <div class='websy-dropdown-action-container'>\n
|
|
1554
|
-
this.options.customActions.
|
|
1555
|
-
html += "\n <
|
|
1556
|
-
}
|
|
1557
|
-
|
|
1553
|
+
if (this.options.customActions.length > 0 || this.options.customButtons.length > 0) {
|
|
1554
|
+
html += "\n <div class='websy-dropdown-action-container'>\n ";
|
|
1555
|
+
if (this.options.customActions.length > 0) {
|
|
1556
|
+
html += "\n ".concat(this.options.actionsTitle || '', "\n <button class='websy-dropdown-action-button'>\n ").concat(this.options.actionsIcon, "\n </button>\n ");
|
|
1557
|
+
}
|
|
1558
|
+
if (this.options.customButtons.length > 0) {
|
|
1559
|
+
html += "\n <div class='websy-dropdown-additional-buttons'>\n ";
|
|
1560
|
+
this.options.customButtons.forEach(function (b, i) {
|
|
1561
|
+
html += "\n <button class='websy-dropdown-custom-button' data-index='".concat(i, "'>\n ").concat(b.label, "\n </button>\n ");
|
|
1562
|
+
});
|
|
1563
|
+
html += "\n </div>\n ";
|
|
1564
|
+
}
|
|
1565
|
+
if (this.options.customActions.length > 0) {
|
|
1566
|
+
html += " \n <ul id='".concat(this.elementId, "_actionContainer'>\n ");
|
|
1567
|
+
this.options.customActions.forEach(function (a, i) {
|
|
1568
|
+
html += "\n <li class='websy-dropdown-custom-action' data-index='".concat(i, "'>").concat(a.label, "</li>\n ");
|
|
1569
|
+
});
|
|
1570
|
+
html += "\n </ul>\n </div>\n ";
|
|
1571
|
+
}
|
|
1558
1572
|
}
|
|
1559
1573
|
if (this.options.disableSearch !== true) {
|
|
1560
1574
|
html += "\n <div class='websy-dropdown-search-container'>\n <input id='".concat(this.elementId, "_search' class='websy-dropdown-search' placeholder='").concat(this.options.searchPlaceholder || 'Search', "'>\n </div>\n ");
|
|
@@ -1621,6 +1635,21 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
1621
1635
|
}, {
|
|
1622
1636
|
key: "close",
|
|
1623
1637
|
value: function close() {
|
|
1638
|
+
this.hide();
|
|
1639
|
+
var searchEl = document.getElementById("".concat(this.elementId, "_search"));
|
|
1640
|
+
if (searchEl) {
|
|
1641
|
+
if (searchEl.value.length > 0 && this.options.onCancelSearch) {
|
|
1642
|
+
this.options.onCancelSearch('');
|
|
1643
|
+
searchEl.value = '';
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
if (this.options.onClose) {
|
|
1647
|
+
this.options.onClose(this.elementId);
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
}, {
|
|
1651
|
+
key: "hide",
|
|
1652
|
+
value: function hide() {
|
|
1624
1653
|
var maskEl = document.getElementById("".concat(this.elementId, "_mask"));
|
|
1625
1654
|
var contentEl = document.getElementById("".concat(this.elementId, "_content"));
|
|
1626
1655
|
var scrollEl = document.getElementById("".concat(this.elementId, "_itemsContainer"));
|
|
@@ -1642,16 +1671,6 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
1642
1671
|
contentEl.classList.remove('active');
|
|
1643
1672
|
contentEl.classList.remove('on-top');
|
|
1644
1673
|
}
|
|
1645
|
-
var searchEl = document.getElementById("".concat(this.elementId, "_search"));
|
|
1646
|
-
if (searchEl) {
|
|
1647
|
-
if (searchEl.value.length > 0 && this.options.onCancelSearch) {
|
|
1648
|
-
this.options.onCancelSearch('');
|
|
1649
|
-
searchEl.value = '';
|
|
1650
|
-
}
|
|
1651
|
-
}
|
|
1652
|
-
if (this.options.onClose) {
|
|
1653
|
-
this.options.onClose(this.elementId);
|
|
1654
|
-
}
|
|
1655
1674
|
}
|
|
1656
1675
|
}, {
|
|
1657
1676
|
key: "handleClick",
|
|
@@ -1676,6 +1695,11 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
1676
1695
|
if (this.options.customActions[actionIndex] && this.options.customActions[actionIndex].fn) {
|
|
1677
1696
|
this.options.customActions[actionIndex].fn();
|
|
1678
1697
|
}
|
|
1698
|
+
} else if (event.target.classList.contains('websy-dropdown-custom-button')) {
|
|
1699
|
+
var _actionIndex = +event.target.getAttribute('data-index');
|
|
1700
|
+
if (this.options.customButtons[_actionIndex] && this.options.customButtons[_actionIndex].fn) {
|
|
1701
|
+
this.options.customButtons[_actionIndex].fn();
|
|
1702
|
+
}
|
|
1679
1703
|
} else if (event.target.classList.contains('websy-dropdown-action-button')) {
|
|
1680
1704
|
var _el = document.getElementById("".concat(this.elementId, "_actionContainer"));
|
|
1681
1705
|
if (_el) {
|
|
@@ -1997,7 +2021,7 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
1997
2021
|
var defaults = {
|
|
1998
2022
|
submit: {
|
|
1999
2023
|
text: 'Save',
|
|
2000
|
-
classes:
|
|
2024
|
+
classes: []
|
|
2001
2025
|
},
|
|
2002
2026
|
useRecaptcha: false,
|
|
2003
2027
|
clearAfterSave: false,
|
|
@@ -2077,6 +2101,12 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2077
2101
|
}
|
|
2078
2102
|
});
|
|
2079
2103
|
}
|
|
2104
|
+
}, {
|
|
2105
|
+
key: "clear",
|
|
2106
|
+
value: function clear() {
|
|
2107
|
+
var formEl = document.getElementById("".concat(this.elementId, "Form"));
|
|
2108
|
+
formEl.reset();
|
|
2109
|
+
}
|
|
2080
2110
|
}, {
|
|
2081
2111
|
key: "data",
|
|
2082
2112
|
get: function get() {
|
|
@@ -3842,7 +3872,9 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
3842
3872
|
if (typeof params === 'undefined') {
|
|
3843
3873
|
return;
|
|
3844
3874
|
}
|
|
3845
|
-
|
|
3875
|
+
if (reloadView === false) {
|
|
3876
|
+
this.previousParams = _extends({}, this.currentParams);
|
|
3877
|
+
}
|
|
3846
3878
|
var output = {
|
|
3847
3879
|
path: '',
|
|
3848
3880
|
items: {}
|
|
@@ -3856,7 +3888,9 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
3856
3888
|
path = this.buildUrlPath(output.items);
|
|
3857
3889
|
}
|
|
3858
3890
|
output.path = path;
|
|
3859
|
-
|
|
3891
|
+
if (reloadView === false) {
|
|
3892
|
+
this.currentParams = output;
|
|
3893
|
+
}
|
|
3860
3894
|
var inputPath = this.currentView;
|
|
3861
3895
|
if (this.options.urlPrefix) {
|
|
3862
3896
|
inputPath = "/".concat(this.options.urlPrefix, "/").concat(inputPath);
|
|
@@ -5772,7 +5806,8 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
5772
5806
|
allowPivoting: false,
|
|
5773
5807
|
searchIcon: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 512 512\"><title>ionicons-v5-f</title><path d=\"M221.09,64A157.09,157.09,0,1,0,378.18,221.09,157.1,157.1,0,0,0,221.09,64Z\" style=\"fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px\"/><line x1=\"338.29\" y1=\"338.29\" x2=\"448\" y2=\"448\" style=\"fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px\"/></svg>",
|
|
5774
5808
|
plusIcon: WebsyDesigns.Icons.PlusFilled,
|
|
5775
|
-
minusIcon: WebsyDesigns.Icons.MinusFilled
|
|
5809
|
+
minusIcon: WebsyDesigns.Icons.MinusFilled,
|
|
5810
|
+
disableInternalLoader: false
|
|
5776
5811
|
};
|
|
5777
5812
|
this.options = _extends({}, DEFAULTS, options);
|
|
5778
5813
|
this.isTouchDevice = 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
|
|
@@ -6777,7 +6812,9 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6777
6812
|
}, {
|
|
6778
6813
|
key: "showLoading",
|
|
6779
6814
|
value: function showLoading(options) {
|
|
6780
|
-
this.
|
|
6815
|
+
if (this.options.disableInternalLoader !== true) {
|
|
6816
|
+
this.loadingDialog.show(options);
|
|
6817
|
+
}
|
|
6781
6818
|
}
|
|
6782
6819
|
}]);
|
|
6783
6820
|
return WebsyTable3;
|