@neovici/cosmoz-omnitable 13.14.2 → 14.0.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/lib/render-footer.js
CHANGED
|
@@ -4,7 +4,6 @@ import { saveAsCsvAction } from './save-as-csv-action';
|
|
|
4
4
|
import { saveAsXlsxAction } from './save-as-xlsx-action';
|
|
5
5
|
import { isEmpty } from '@neovici/cosmoz-utils/template';
|
|
6
6
|
|
|
7
|
-
// eslint-disable-next-line max-lines-per-function
|
|
8
7
|
export const renderFooter = ({
|
|
9
8
|
columns,
|
|
10
9
|
selectedItems,
|
|
@@ -12,12 +11,10 @@ export const renderFooter = ({
|
|
|
12
11
|
xlsxFilename,
|
|
13
12
|
xlsxSheetname,
|
|
14
13
|
topPlacement,
|
|
15
|
-
maxToolbarItems,
|
|
16
14
|
}) =>
|
|
17
15
|
html`<cosmoz-bottom-bar
|
|
18
16
|
id="bottomBar"
|
|
19
17
|
?active=${!isEmpty(selectedItems.length)}
|
|
20
|
-
?max-toolbar-items=${!isEmpty(maxToolbarItems)}
|
|
21
18
|
>
|
|
22
19
|
<slot name="info" slot="info">
|
|
23
20
|
${ngettext(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { html, component } from '@pionjs/pion';
|
|
2
2
|
import { _ } from '@neovici/cosmoz-i18next';
|
|
3
3
|
import { isEmpty } from '@neovici/cosmoz-utils/template';
|
|
4
|
-
import {
|
|
4
|
+
import { defaultMiddleware, size } from '@neovici/cosmoz-dropdown/use-floating';
|
|
5
5
|
import '@neovici/cosmoz-collapse';
|
|
6
6
|
import { sort, group } from './cosmoz-omnitable-sort-group';
|
|
7
7
|
import style, { dropdown as dropdownStyle } from './style.css';
|
|
@@ -10,9 +10,18 @@ import { close, pull, arrow } from '../icons';
|
|
|
10
10
|
import { when } from 'lit-html/directives/when.js';
|
|
11
11
|
import { sheet } from '@neovici/cosmoz-utils';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const middleware = [
|
|
14
|
+
size({
|
|
15
|
+
apply({ availableHeight, elements }) {
|
|
16
|
+
Object.assign(elements.floating.style, {
|
|
17
|
+
maxHeight: `${Math.max(0, availableHeight)}px`,
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
}),
|
|
21
|
+
...defaultMiddleware,
|
|
22
|
+
];
|
|
15
23
|
|
|
24
|
+
/* eslint-disable max-lines-per-function */
|
|
16
25
|
const renderItem =
|
|
17
26
|
({
|
|
18
27
|
onDragStart,
|
|
@@ -141,7 +150,8 @@ customElements.define(
|
|
|
141
150
|
|
|
142
151
|
const Settings = ({ config, newLayout }) => html`
|
|
143
152
|
<cosmoz-dropdown
|
|
144
|
-
.placement="${newLayout ?
|
|
153
|
+
.placement="${newLayout ? 'bottom-start' : 'bottom-end'}"
|
|
154
|
+
.middleware="${middleware}"
|
|
145
155
|
>
|
|
146
156
|
${when(
|
|
147
157
|
newLayout,
|
package/lib/use-footer.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import { defaultPlacement } from '@neovici/cosmoz-dropdown';
|
|
2
|
-
const _defaultPlacement = ['top-right', ...defaultPlacement];
|
|
3
|
-
|
|
4
1
|
export const useFooter = ({ host, ...rest }) => {
|
|
5
2
|
const {
|
|
6
3
|
csvFilename = 'omnitable.csv',
|
|
7
4
|
xlsxFilename = 'omnitable.xlsx',
|
|
8
5
|
xlsxSheetname = 'Omnitable',
|
|
9
|
-
topPlacement =
|
|
10
|
-
maxToolbarItems,
|
|
6
|
+
topPlacement = 'top-end',
|
|
11
7
|
} = host;
|
|
12
8
|
|
|
13
9
|
return {
|
|
@@ -15,7 +11,6 @@ export const useFooter = ({ host, ...rest }) => {
|
|
|
15
11
|
xlsxFilename,
|
|
16
12
|
xlsxSheetname,
|
|
17
13
|
topPlacement,
|
|
18
|
-
maxToolbarItems,
|
|
19
14
|
...rest,
|
|
20
15
|
};
|
|
21
16
|
};
|
package/lib/use-omnitable.js
CHANGED
|
@@ -8,7 +8,6 @@ import { useHeader } from './use-header';
|
|
|
8
8
|
import { useList } from './use-list';
|
|
9
9
|
import { useFooter } from './use-footer';
|
|
10
10
|
|
|
11
|
-
// eslint-disable-next-line max-lines-per-function
|
|
12
11
|
export const useOmnitable = (host) => {
|
|
13
12
|
const {
|
|
14
13
|
hashParam,
|
|
@@ -48,7 +47,6 @@ export const useOmnitable = (host) => {
|
|
|
48
47
|
resizeSpeedFactor,
|
|
49
48
|
sortAndGroupOptions,
|
|
50
49
|
}),
|
|
51
|
-
maxToolbarItems = isMini ? '0' : undefined,
|
|
52
50
|
dataIsValid = data && Array.isArray(data) && data.length > 0,
|
|
53
51
|
[selectedItems, setSelectedItems] = useState([]);
|
|
54
52
|
|
|
@@ -96,7 +94,6 @@ export const useOmnitable = (host) => {
|
|
|
96
94
|
host,
|
|
97
95
|
selectedItems,
|
|
98
96
|
columns,
|
|
99
|
-
maxToolbarItems,
|
|
100
97
|
}),
|
|
101
98
|
};
|
|
102
99
|
};
|
package/package.json
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
2
|
+
"name": "@neovici/cosmoz-omnitable",
|
|
3
|
+
"version": "14.0.0",
|
|
4
|
+
"description": "[](https://travis-ci.org/Neovici/cosmoz-omnitable)",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"web-components"
|
|
7
|
+
],
|
|
8
|
+
"homepage": "https://github.com/neovici/cosmoz-omnitable#readme",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/neovici/cosmoz-omnitable/issues"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/neovici/cosmoz-omnitable.git"
|
|
15
|
+
},
|
|
16
|
+
"license": "Apache-2.0",
|
|
17
|
+
"author": "Neovici Development",
|
|
18
|
+
"main": "cosmoz-omnitable.js",
|
|
19
|
+
"directories": {
|
|
20
|
+
"test": "test"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"cosmoz-*.js",
|
|
24
|
+
"get-effective-children-legacy-mixin.js",
|
|
25
|
+
"ui-helpers",
|
|
26
|
+
"lib/**/*.js"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"lint": "eslint --cache --ext .js .",
|
|
30
|
+
"start": "wds",
|
|
31
|
+
"test": "wtr --coverage",
|
|
32
|
+
"test:watch": "wtr --watch",
|
|
33
|
+
"prepare": "husky"
|
|
34
|
+
},
|
|
35
|
+
"release": {
|
|
36
|
+
"plugins": [
|
|
37
|
+
"@semantic-release/commit-analyzer",
|
|
38
|
+
"@semantic-release/release-notes-generator",
|
|
39
|
+
"@semantic-release/changelog",
|
|
40
|
+
"@semantic-release/github",
|
|
41
|
+
"@semantic-release/npm",
|
|
42
|
+
"@semantic-release/git"
|
|
43
|
+
],
|
|
44
|
+
"branch": "master"
|
|
45
|
+
},
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"commitlint": {
|
|
50
|
+
"extends": [
|
|
51
|
+
"@commitlint/config-conventional"
|
|
52
|
+
],
|
|
53
|
+
"rules": {
|
|
54
|
+
"body-max-line-length": [
|
|
55
|
+
1,
|
|
56
|
+
"always",
|
|
57
|
+
100
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"@neovici/cosmoz-autocomplete": "^10.0.0",
|
|
63
|
+
"@neovici/cosmoz-bottom-bar": "^8.0.0",
|
|
64
|
+
"@neovici/cosmoz-collapse": "^1.1.0",
|
|
65
|
+
"@neovici/cosmoz-datetime-input": "^4.0.1",
|
|
66
|
+
"@neovici/cosmoz-dropdown": "^5.0.0",
|
|
67
|
+
"@neovici/cosmoz-grouped-list": "^8.0.0",
|
|
68
|
+
"@neovici/cosmoz-i18next": "^3.1.1",
|
|
69
|
+
"@neovici/cosmoz-input": "^5.0.0",
|
|
70
|
+
"@neovici/cosmoz-router": "^11.0.0",
|
|
71
|
+
"@neovici/cosmoz-utils": "^6.5.0",
|
|
72
|
+
"@neovici/nullxlsx": "^3.0.0",
|
|
73
|
+
"@pionjs/pion": "^2.0.0",
|
|
74
|
+
"@polymer/iron-icon": "^3.0.0",
|
|
75
|
+
"@polymer/iron-icons": "^3.0.0",
|
|
76
|
+
"@polymer/paper-dropdown-menu": "^3.2.0",
|
|
77
|
+
"@polymer/paper-spinner": "^3.0.0",
|
|
78
|
+
"@polymer/polymer": "^3.3.0",
|
|
79
|
+
"file-saver-es": "^2.0.0",
|
|
80
|
+
"lit-html": "^2.0.0 || ^3.0.0"
|
|
81
|
+
},
|
|
82
|
+
"devDependencies": {
|
|
83
|
+
"@commitlint/cli": "^19.0.0",
|
|
84
|
+
"@commitlint/config-conventional": "^19.0.0",
|
|
85
|
+
"@neovici/cfg": "^1.18.0",
|
|
86
|
+
"@neovici/cosmoz-viewinfo": "^4.0.0",
|
|
87
|
+
"@open-wc/testing": "^4.0.0",
|
|
88
|
+
"@polymer/iron-test-helpers": "^3.0.0",
|
|
89
|
+
"@polymer/paper-button": "^3.0.0",
|
|
90
|
+
"@polymer/paper-item": "^3.0.0",
|
|
91
|
+
"@polymer/paper-listbox": "^3.0.0",
|
|
92
|
+
"@polymer/paper-toggle-button": "^3.0.0",
|
|
93
|
+
"@semantic-release/changelog": "^6.0.0",
|
|
94
|
+
"@semantic-release/git": "^10.0.0",
|
|
95
|
+
"husky": "^9.0.0",
|
|
96
|
+
"semantic-release": "^24.0.0",
|
|
97
|
+
"sinon": "^19.0.0"
|
|
98
|
+
}
|
|
99
99
|
}
|