@questwork/vue-q-list-vue3 3.1.3 → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,42 @@
|
|
|
1
|
+
Name: bwip-js
|
|
2
|
+
Version: 4.8.0
|
|
3
|
+
License: MIT
|
|
4
|
+
Private: false
|
|
5
|
+
Description: JavaScript barcode generator supporting over 100 types and standards.
|
|
6
|
+
Repository: https://github.com/metafloor/bwip-js.git
|
|
7
|
+
Homepage: https://github.com/metafloor/bwip-js
|
|
8
|
+
Author: Mark Warren <mwarren@metafloor.com>
|
|
9
|
+
License Copyright:
|
|
10
|
+
===
|
|
11
|
+
|
|
12
|
+
bwip-js : Barcode Writer in Pure JavaScript
|
|
13
|
+
|
|
14
|
+
Copyright (c) 2011-2025 Mark Warren
|
|
15
|
+
|
|
16
|
+
The MIT License
|
|
17
|
+
|
|
18
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
19
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
20
|
+
in the Software without restriction, including without limitation the rights
|
|
21
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
22
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
23
|
+
furnished to do so, subject to the following conditions:
|
|
24
|
+
|
|
25
|
+
The above copyright notice and this permission notice shall be included in
|
|
26
|
+
all copies or substantial portions of the Software.
|
|
27
|
+
|
|
28
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
29
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
30
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
31
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
32
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
33
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
34
|
+
THE SOFTWARE.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
1
38
|
Name: @questwork/q-utilities
|
|
2
|
-
Version: 0.1.
|
|
39
|
+
Version: 0.1.22
|
|
3
40
|
License: MIT
|
|
4
41
|
Private: false
|
|
5
42
|
Description: Questwork QUtilities
|
|
@@ -91,37 +128,4 @@ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
|
91
128
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
92
129
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
93
130
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
94
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
95
|
-
|
|
96
|
-
---
|
|
97
|
-
|
|
98
|
-
Name: @questwork/utilities
|
|
99
|
-
Version: 0.1.67
|
|
100
|
-
License: MIT
|
|
101
|
-
Private: false
|
|
102
|
-
Description: Questwork utilities
|
|
103
|
-
Author: Questwork Consulting Limited <info@questwork.com> (https://questwork.com/)
|
|
104
|
-
License Copyright:
|
|
105
|
-
===
|
|
106
|
-
|
|
107
|
-
Copyright 2019 Questwork Consulting Limited
|
|
108
|
-
|
|
109
|
-
This project is free software released under the MIT/X11 license:
|
|
110
|
-
|
|
111
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
112
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
113
|
-
in the Software without restriction, including without limitation the rights
|
|
114
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
115
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
116
|
-
furnished to do so, subject to the following conditions:
|
|
117
|
-
|
|
118
|
-
The above copyright notice and this permission notice shall be included in
|
|
119
|
-
all copies or substantial portions of the Software.
|
|
120
|
-
|
|
121
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
122
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
123
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
124
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
125
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
126
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
127
|
-
THE SOFTWARE.
|
|
131
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/lib/helpers/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const { checkIfUsingTemplateCompiler } = require('./checkIfUsingTemplateCompiler')
|
|
1
2
|
const { getPopupPosition } = require('./getPopupPosition')
|
|
2
3
|
const { getTitle } = require('./getTitle')
|
|
3
4
|
const { getTooltipPosition } = require('./getTooltipPosition')
|
|
@@ -5,6 +6,7 @@ const { getValidation } = require('./getValidation')
|
|
|
5
6
|
const { getValue } = require('./getValue')
|
|
6
7
|
|
|
7
8
|
module.exports = {
|
|
9
|
+
checkIfUsingTemplateCompiler,
|
|
8
10
|
getPopupPosition,
|
|
9
11
|
getTitle,
|
|
10
12
|
getTooltipPosition,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
const { getValidation } = require('../../helpers')
|
|
1
|
+
const { getValidation, getValue, checkIfUsingTemplateCompiler } = require('../../helpers')
|
|
3
2
|
const { KeyValueObject } = require('../keyValueObject')
|
|
3
|
+
const { TemplateCompiler } = require('@questwork/q-utilities')
|
|
4
|
+
|
|
4
5
|
class QListButton {
|
|
5
6
|
constructor(options = {}) {
|
|
6
7
|
options = options || {}
|
|
@@ -12,7 +13,6 @@ class QListButton {
|
|
|
12
13
|
this.endpoint = options.endpoint
|
|
13
14
|
this.httpMethod = options.httpMethod
|
|
14
15
|
this.icon = options.icon
|
|
15
|
-
this.label = options.label
|
|
16
16
|
this.linkTarget = options.linkTarget
|
|
17
17
|
this.onClick = options.onClick
|
|
18
18
|
this.owner = options.owner
|
|
@@ -23,6 +23,8 @@ class QListButton {
|
|
|
23
23
|
this.showLabel = options.showLabel
|
|
24
24
|
this.title = options.title
|
|
25
25
|
this.url = options.url
|
|
26
|
+
this._templateCompiler = TemplateCompiler.init(this.qRow)
|
|
27
|
+
this.label = this.getLabel(options.label)
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
static init(options) {
|
|
@@ -77,6 +79,13 @@ class QListButton {
|
|
|
77
79
|
}
|
|
78
80
|
}
|
|
79
81
|
|
|
82
|
+
getLabel(label = '') {
|
|
83
|
+
if (checkIfUsingTemplateCompiler(label)) {
|
|
84
|
+
return this._templateCompiler.pipe(label)
|
|
85
|
+
}
|
|
86
|
+
return label
|
|
87
|
+
}
|
|
88
|
+
|
|
80
89
|
makeCss() {
|
|
81
90
|
return `__q-list-button ${this.css.element || ''}`
|
|
82
91
|
}
|
package/lib/models/qRow/qRow.js
CHANGED
|
@@ -4,21 +4,16 @@ const { TemplateCompiler } = require('@questwork/q-utilities')
|
|
|
4
4
|
class QRow {
|
|
5
5
|
constructor(options = {}) {
|
|
6
6
|
options = options || {}
|
|
7
|
-
this.
|
|
8
|
-
this.creator = options.creator
|
|
7
|
+
this.isChecked = options.isChecked || false
|
|
9
8
|
this.cssMaker = options.cssMaker
|
|
10
9
|
this.cssNames = options.cssNames || []
|
|
11
|
-
this.deleted = options.deleted || false
|
|
12
|
-
this.duration = options.duration
|
|
13
10
|
this.editable = (typeof options.editable === 'boolean') ? options.editable : true
|
|
11
|
+
this.expansion = options.expansion || false
|
|
14
12
|
this.getActions = options.getActions
|
|
15
|
-
this.new = options.new || false
|
|
16
|
-
this.owner = options.owner
|
|
17
13
|
this.row = options.row
|
|
18
14
|
this.shouldBeDisabled = setshouldBeDisabled(options.shouldBeDisabled || null)
|
|
19
15
|
this.shouldBeVisible = setShouldBeVisible(options.shouldBeVisible || null)
|
|
20
16
|
this.uniqueKey = options.uniqueKey
|
|
21
|
-
this.unread = options.unread || false
|
|
22
17
|
this._templateCompiler = TemplateCompiler.init(this.row)
|
|
23
18
|
}
|
|
24
19
|
|
|
@@ -84,8 +79,17 @@ class QRow {
|
|
|
84
79
|
// return this[realKey]
|
|
85
80
|
}
|
|
86
81
|
// check if regular expr
|
|
87
|
-
if (
|
|
88
|
-
|
|
82
|
+
if (_hasTemplateDelimiters(key)) {
|
|
83
|
+
const regex = /(\{\{ \w+\((['"])(.*?)\2\) \}\})|([^{]+)/g
|
|
84
|
+
const result = key.match(regex)?.filter(Boolean) || [key]
|
|
85
|
+
return result.reduce((acc, k) => {
|
|
86
|
+
if (_hasTemplateDelimiters(k)) {
|
|
87
|
+
acc += this._templateCompiler.pipe(k)
|
|
88
|
+
} else {
|
|
89
|
+
acc += k
|
|
90
|
+
}
|
|
91
|
+
return acc
|
|
92
|
+
}, '')
|
|
89
93
|
}
|
|
90
94
|
if (key.includes('.')) {
|
|
91
95
|
const arr = key.split('.')
|
|
@@ -96,6 +100,10 @@ class QRow {
|
|
|
96
100
|
return this.row
|
|
97
101
|
}
|
|
98
102
|
|
|
103
|
+
getIsChecked() {
|
|
104
|
+
return this.isChecked
|
|
105
|
+
}
|
|
106
|
+
|
|
99
107
|
getUniqueKey() {
|
|
100
108
|
if (this.uniqueKey) {
|
|
101
109
|
return this.get(this.uniqueKey)
|
|
@@ -103,48 +111,8 @@ class QRow {
|
|
|
103
111
|
return null
|
|
104
112
|
}
|
|
105
113
|
|
|
106
|
-
isBetween(myTimestamp, dateRange) {
|
|
107
|
-
let result = true
|
|
108
|
-
if (dateRange) {
|
|
109
|
-
const timestamp = new Date().getTime()
|
|
110
|
-
if (dateRange.start) {
|
|
111
|
-
const { start } = dateRange
|
|
112
|
-
result = result && (timestamp >= dateHelper(myTimestamp).add(start).valueOf())
|
|
113
|
-
}
|
|
114
|
-
if (dateRange.end) {
|
|
115
|
-
const { end } = dateRange
|
|
116
|
-
result = result && (timestamp <= dateHelper(myTimestamp).add(end).valueOf())
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return result
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
isSameCreator(user) {
|
|
123
|
-
return user
|
|
124
|
-
? (user === this.creator)
|
|
125
|
-
: false
|
|
126
|
-
}
|
|
127
|
-
isSameOwner(user) {
|
|
128
|
-
return user
|
|
129
|
-
? (user === this.owner)
|
|
130
|
-
: false
|
|
131
|
-
}
|
|
132
|
-
|
|
133
114
|
getStatus() {
|
|
134
|
-
|
|
135
|
-
if (this.active) {
|
|
136
|
-
statusList.push('active')
|
|
137
|
-
}
|
|
138
|
-
if (this.deleted) {
|
|
139
|
-
statusList.push('deleted')
|
|
140
|
-
}
|
|
141
|
-
if (this.new) {
|
|
142
|
-
statusList.push('new')
|
|
143
|
-
}
|
|
144
|
-
if (this.unread) {
|
|
145
|
-
statusList.push('unread')
|
|
146
|
-
}
|
|
147
|
-
return statusList
|
|
115
|
+
return []
|
|
148
116
|
}
|
|
149
117
|
|
|
150
118
|
makeCss() {
|
|
@@ -170,24 +138,19 @@ class QRow {
|
|
|
170
138
|
this.editable = val
|
|
171
139
|
}
|
|
172
140
|
|
|
173
|
-
|
|
174
|
-
this.
|
|
175
|
-
this.new = false
|
|
176
|
-
this.unread = false
|
|
177
|
-
return this
|
|
178
|
-
}
|
|
179
|
-
toggleDeleted() {
|
|
180
|
-
this.deleted = !this.deleted
|
|
181
|
-
this.new = false
|
|
182
|
-
this.unread = false
|
|
141
|
+
setExpansion(val) {
|
|
142
|
+
this.expansion = val
|
|
183
143
|
return this
|
|
184
144
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
145
|
+
|
|
146
|
+
toggleExpansion() {
|
|
147
|
+
this.expansion = !this.expansion
|
|
188
148
|
}
|
|
189
|
-
|
|
190
|
-
|
|
149
|
+
|
|
150
|
+
updateIsChecked(selectedRows = []) {
|
|
151
|
+
this.isChecked = selectedRows.filter((selectedRow) => {
|
|
152
|
+
return typeof selectedRow.getUniqueKey === 'function' && selectedRow.getUniqueKey() === this.getUniqueKey()
|
|
153
|
+
}).length > 0
|
|
191
154
|
return this
|
|
192
155
|
}
|
|
193
156
|
}
|
|
@@ -227,9 +190,14 @@ function setShouldBeVisible(shouldBeVisible) {
|
|
|
227
190
|
}
|
|
228
191
|
}
|
|
229
192
|
|
|
230
|
-
function
|
|
193
|
+
function _hasTemplateDelimiters(key) {
|
|
231
194
|
key = key.trim()
|
|
232
|
-
|
|
195
|
+
// Check for {{ }} pattern
|
|
196
|
+
const doubleCurlyRegex = /\{\{.*?\}\}/
|
|
197
|
+
// Check for <% %> pattern
|
|
198
|
+
const anglePercentRegex = /<%.*?%>/
|
|
199
|
+
|
|
200
|
+
return doubleCurlyRegex.test(key) || anglePercentRegex.test(key)
|
|
233
201
|
}
|
|
234
202
|
|
|
235
203
|
module.exports = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@questwork/vue-q-list-vue3",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
4
4
|
"description": "Questwork vue component for displaying a list",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"@babel/preset-env": "^7.22.10",
|
|
25
25
|
"@questwork/utilities": "^0.1.67",
|
|
26
26
|
"@questwork/vue-q-buttons-vue3": "^3.1.0",
|
|
27
|
+
"@questwork/vue-q-form-vue3": "^3.1.8",
|
|
27
28
|
"@questwork/vue-q-paginator-vue3": "^3.1.0",
|
|
28
29
|
"@storybook/addon-essentials": "8.5.3",
|
|
29
30
|
"@storybook/addon-links": "^8.4.7",
|