@v1nt1248/3nclient-lib 0.2.66 → 0.2.67
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/ui3n-components.js +621 -615
- package/package.json +24 -37
- package/src/components/ui3n-table/composables/useTable.ts +18 -8
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@v1nt1248/3nclient-lib",
|
|
3
3
|
"license": "AGPL-3.0-or-later",
|
|
4
4
|
"author": "v1nt1248",
|
|
5
|
-
"version": "0.2.
|
|
5
|
+
"version": "0.2.67",
|
|
6
6
|
"description": "Library for 3NWeb clients",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"files": [
|
|
@@ -27,29 +27,6 @@
|
|
|
27
27
|
"./style.css": "./dist/style.css",
|
|
28
28
|
"./variables.css": "./dist/variables.css"
|
|
29
29
|
},
|
|
30
|
-
"scripts": {
|
|
31
|
-
"dev": "LIB_NAME=all vite",
|
|
32
|
-
"generate:types": "vue-tsc --declaration --emitDeclarationOnly --outdir ./dist",
|
|
33
|
-
"copy:dts": "cp ./src/types.d.ts ./dist",
|
|
34
|
-
"copy:css": "cp ./src/assets/styles/variables.css ./dist",
|
|
35
|
-
"copy:icons:css": "cp ./src/assets/styles/icons.css ./dist",
|
|
36
|
-
"clean:dist": "rm -rf dist/",
|
|
37
|
-
"build:components": "LIB_NAME=lib vite build",
|
|
38
|
-
"build:plugins": "LIB_NAME=plugins vite build",
|
|
39
|
-
"build:utils": "LIB_NAME=utils vite build",
|
|
40
|
-
"build": "pnpm clean:dist && pnpm build:plugins && pnpm build:utils && pnpm build:components && pnpm copy:css",
|
|
41
|
-
"pack": "pnpm build && npm pack && cp *.tgz ./dist && rm *.tgz",
|
|
42
|
-
"preview": "vite preview",
|
|
43
|
-
"stylelint": "stylelint --config .stylelint.config.cjs 'src/**/*.{vue,scss,css}'",
|
|
44
|
-
"stylelint:fix": "stylelint --config .stylelint.config.cjs --fix 'src/**/*.{vue,scss,css}'",
|
|
45
|
-
"linter": "eslint -c eslint.config.js --ext .js,.vue,.ts, src",
|
|
46
|
-
"linter:fix": "eslint -c eslint.config.js --fix --ext .js,.vue,.ts, src",
|
|
47
|
-
"lint": "pnpm linter && pnpm stylelint",
|
|
48
|
-
"lint:fix": "pnpm linter:fix && pnpm stylelint:fix",
|
|
49
|
-
"docs:dev": "vitepress dev docs",
|
|
50
|
-
"docs:build": "vitepress build docs",
|
|
51
|
-
"docs:preview": "vitepress preview docs"
|
|
52
|
-
},
|
|
53
30
|
"dependencies": {
|
|
54
31
|
"@floating-ui/dom": "^1.7.4",
|
|
55
32
|
"@floating-ui/vue": "1.1.9",
|
|
@@ -107,17 +84,27 @@
|
|
|
107
84
|
"vue-eslint-parser": "^10.2.0",
|
|
108
85
|
"vue-tsc": "3.1.3"
|
|
109
86
|
},
|
|
110
|
-
"
|
|
111
|
-
|
|
112
|
-
"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
"
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
87
|
+
"scripts": {
|
|
88
|
+
"dev": "LIB_NAME=all vite",
|
|
89
|
+
"generate:types": "vue-tsc --declaration --emitDeclarationOnly --outdir ./dist",
|
|
90
|
+
"copy:dts": "cp ./src/types.d.ts ./dist",
|
|
91
|
+
"copy:css": "cp ./src/assets/styles/variables.css ./dist",
|
|
92
|
+
"copy:icons:css": "cp ./src/assets/styles/icons.css ./dist",
|
|
93
|
+
"clean:dist": "rm -rf dist/",
|
|
94
|
+
"build:components": "LIB_NAME=lib vite build",
|
|
95
|
+
"build:plugins": "LIB_NAME=plugins vite build",
|
|
96
|
+
"build:utils": "LIB_NAME=utils vite build",
|
|
97
|
+
"build": "pnpm clean:dist && pnpm build:plugins && pnpm build:utils && pnpm build:components && pnpm copy:css",
|
|
98
|
+
"pack": "pnpm build && npm pack && cp *.tgz ./dist && rm *.tgz",
|
|
99
|
+
"preview": "vite preview",
|
|
100
|
+
"stylelint": "stylelint --config .stylelint.config.cjs 'src/**/*.{vue,scss,css}'",
|
|
101
|
+
"stylelint:fix": "stylelint --config .stylelint.config.cjs --fix 'src/**/*.{vue,scss,css}'",
|
|
102
|
+
"linter": "eslint -c eslint.config.js --ext .js,.vue,.ts, src",
|
|
103
|
+
"linter:fix": "eslint -c eslint.config.js --fix --ext .js,.vue,.ts, src",
|
|
104
|
+
"lint": "pnpm linter && pnpm stylelint",
|
|
105
|
+
"lint:fix": "pnpm linter:fix && pnpm stylelint:fix",
|
|
106
|
+
"docs:dev": "vitepress dev docs",
|
|
107
|
+
"docs:build": "vitepress build docs",
|
|
108
|
+
"docs:preview": "vitepress preview docs"
|
|
122
109
|
}
|
|
123
|
-
}
|
|
110
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed,
|
|
1
|
+
import { computed, type Ref, ref, watch, UnwrapRef } from 'vue';
|
|
2
2
|
import { get, isEmpty, size } from 'lodash';
|
|
3
3
|
import {
|
|
4
4
|
Ui3nTableBodyBaseItem,
|
|
@@ -34,21 +34,20 @@ export function useTable<T extends Ui3nTableBodyBaseItem>(props: Ui3nTableProps<
|
|
|
34
34
|
);
|
|
35
35
|
const showGroupActionsRow = computed(() => props.config?.selectable === 'multiple' && hasGroupActionsRow.value);
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
const tableColumnWidth = computed(() => {
|
|
38
|
+
if (!tableEl.value) {
|
|
39
|
+
return '100%';
|
|
40
|
+
}
|
|
40
41
|
|
|
41
|
-
function setColumnWidth(el: HTMLDivElement) {
|
|
42
42
|
const { config = {}, head } = props;
|
|
43
43
|
const { columnStyle } = config;
|
|
44
44
|
const keys = head.map(h => h.key);
|
|
45
|
-
|
|
45
|
+
return keys.reduce((res, key, index) => {
|
|
46
46
|
const width = get(columnStyle, [key, 'width'], '1fr');
|
|
47
47
|
res = index === 0 ? `${width}` : `${res} ${width}`;
|
|
48
48
|
return res;
|
|
49
49
|
}, '');
|
|
50
|
-
|
|
51
|
-
}
|
|
50
|
+
});
|
|
52
51
|
|
|
53
52
|
function setFieldAsRowKey() {
|
|
54
53
|
const { config = {}, body } = props;
|
|
@@ -186,6 +185,17 @@ export function useTable<T extends Ui3nTableBodyBaseItem>(props: Ui3nTableProps<
|
|
|
186
185
|
currentConfig.value.sortOrder?.field && emits('change:sort', currentConfig.value.sortOrder as Ui3nTableSort<T>);
|
|
187
186
|
}
|
|
188
187
|
|
|
188
|
+
watch(
|
|
189
|
+
tableColumnWidth,
|
|
190
|
+
(val, oVal) => {
|
|
191
|
+
if (val && val !== oVal) {
|
|
192
|
+
tableEl.value && tableEl.value.style.setProperty('--ui3n-table-columns-width', val);
|
|
193
|
+
}
|
|
194
|
+
}, {
|
|
195
|
+
immediate: true,
|
|
196
|
+
}
|
|
197
|
+
);
|
|
198
|
+
|
|
189
199
|
watch(
|
|
190
200
|
() => selectedRowsSize.value,
|
|
191
201
|
(val, oldVal) => {
|