quasar-factory-lib 0.0.42 → 0.0.44
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/components/Table/utils/filterMethod.d.ts +0 -1
- package/dist/components/index.d.ts +0 -3
- package/dist/index.d.ts +1 -0
- package/dist/quasar-factory-lib.js +1736 -1651
- package/dist/quasar-factory-lib.umd.cjs +11 -11
- package/dist/utils/index.d.ts +4 -0
- package/package.json +1 -1
- package/src/components/Table/utils/filterMethod.ts +2 -2
- package/src/components/index.ts +1 -4
- package/src/index.ts +1 -1
- package/src/utils/index.ts +4 -3
- package/src/utils/sort.js +0 -30
package/dist/utils/index.d.ts
CHANGED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as filterMethod } from '../components/Table/utils/filterMethod';
|
|
2
|
+
export { default as infiniteScroll } from '../components/Table/utils/infiniteScroll';
|
|
3
|
+
export { default as setTableHeight } from '../components/Table/utils/setTableHeight';
|
|
4
|
+
export { default as qTableSort } from '../components/Table/utils/sort';
|
package/package.json
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import infiniteScroll from './infiniteScroll'
|
|
4
4
|
const filterMethod = {
|
|
5
|
-
filter (self: {
|
|
6
|
-
if (
|
|
5
|
+
filter (self: { filteredRows: object [] | [] }, rows: string | [], terms: { search: string }): object[] | [] {
|
|
6
|
+
if (terms.search !== '') {
|
|
7
7
|
const filteredRows = []
|
|
8
8
|
const lowerSearch = terms.search ? terms.search.toLowerCase() : ''
|
|
9
9
|
for (let i = 0; i < self.rows.length; i++) {
|
package/src/components/index.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
export * from './Table'
|
|
2
2
|
export * from './Alert'
|
|
3
3
|
export * from './Confirm'
|
|
4
|
-
export * from './TaskNavBar'
|
|
5
|
-
export { default as filterMethod } from './Table/utils/filterMethod'
|
|
6
|
-
export { default as infiniteScroll } from './Table/utils/infiniteScroll';
|
|
7
|
-
export { default as tableHeight } from './Table/utils/setTableHeight';
|
|
4
|
+
export * from './TaskNavBar'
|
package/src/index.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { MyTable, AlertDialog, ConfirmDialog, TaskNavBar } from './components/in
|
|
|
10
10
|
export type { TranslateKeys }
|
|
11
11
|
// import plugins from "./components/plugins";
|
|
12
12
|
export * from './i18n/messages.js'
|
|
13
|
-
|
|
13
|
+
export * from './utils'
|
|
14
14
|
export * from './store'
|
|
15
15
|
// Import Quasar css
|
|
16
16
|
import './css/app.css'
|
package/src/utils/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export { default as filterMethod } from '../components/Table/utils/filterMethod'
|
|
2
|
+
export { default as infiniteScroll } from '../components/Table/utils/infiniteScroll';
|
|
3
|
+
export { default as setTableHeight } from '../components/Table/utils/setTableHeight';
|
|
4
|
+
export { default as qTableSort } from '../components/Table/utils/sort'
|
package/src/utils/sort.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const qTableSort = {
|
|
2
|
-
sortMethod (rows, sortBy, descending, values = []) {
|
|
3
|
-
const rowsFlat = [...rows]
|
|
4
|
-
if (sortBy) {
|
|
5
|
-
if (values.includes(sortBy)) {
|
|
6
|
-
this.sortDates(sortBy, descending, rowsFlat)
|
|
7
|
-
} else {
|
|
8
|
-
rowsFlat.sort((a, b) => {
|
|
9
|
-
const x = descending ? b : a
|
|
10
|
-
const y = descending ? a : b
|
|
11
|
-
return x[sortBy] > y[sortBy] ? 1 : x[sortBy] < y[sortBy] ? -1 : 0
|
|
12
|
-
})
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return rowsFlat
|
|
16
|
-
},
|
|
17
|
-
sortDates (sortBy, descending, rowsFlat) {
|
|
18
|
-
rowsFlat.sort(function (columnA, columnB) {
|
|
19
|
-
const a = columnA[sortBy]
|
|
20
|
-
const b = columnB[sortBy]
|
|
21
|
-
let x = descending ? b : a
|
|
22
|
-
let y = descending ? a : b
|
|
23
|
-
x = x.split('/').reverse().join('-')
|
|
24
|
-
y = y.split('/').reverse().join('-')
|
|
25
|
-
|
|
26
|
-
return x.localeCompare(y)
|
|
27
|
-
})
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
export default qTableSort
|