quasar-ui-sellmate-ui-kit 2.3.2 → 3.0.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/.eslintrc.cjs +73 -0
- package/.prettierrc +25 -0
- package/README.md +156 -142
- package/dist/index.common.js +2 -2
- package/dist/index.css +3 -8
- package/dist/index.esm.js +2 -2
- package/dist/index.min.css +2 -2
- package/dist/index.rtl.css +3 -8
- package/dist/index.rtl.min.css +2 -2
- package/dist/index.umd.js +3820 -3822
- package/dist/index.umd.min.js +2 -2
- package/package.json +83 -75
- package/src/assets/icons.js +28 -28
- package/src/components/SBreadcrumbs.vue +55 -55
- package/src/components/SButton.vue +206 -206
- package/src/components/SButtonGroup.vue +41 -41
- package/src/components/SButtonToggle.vue +200 -200
- package/src/components/SCaution.vue +102 -102
- package/src/components/SCheckbox.vue +123 -123
- package/src/components/SChip.vue +99 -99
- package/src/components/SDate.vue +717 -717
- package/src/components/SDateAutoRangePicker.vue +341 -341
- package/src/components/SDatePicker.vue +472 -472
- package/src/components/SDateRange.vue +470 -470
- package/src/components/SDateRangePicker.vue +660 -660
- package/src/components/SDateTimePicker.vue +349 -349
- package/src/components/SDialog.vue +250 -250
- package/src/components/SDropdown.vue +216 -216
- package/src/components/SEditor.vue +490 -490
- package/src/components/SFilePicker.vue +207 -207
- package/src/components/SHelp.vue +146 -146
- package/src/components/SInput.vue +343 -343
- package/src/components/SInputCounter.vue +46 -46
- package/src/components/SInputNumber.vue +179 -179
- package/src/components/SList.vue +29 -29
- package/src/components/SMarkupTable.vue +141 -141
- package/src/components/SPagination.vue +266 -266
- package/src/components/SRadio.vue +78 -78
- package/src/components/SRouteTab.vue +67 -67
- package/src/components/SSelect.vue +294 -294
- package/src/components/SSelectCheckbox.vue +222 -222
- package/src/components/SSelectCustom.vue +189 -189
- package/src/components/SSelectGroupCheckbox.vue +235 -235
- package/src/components/SSelectSearch.vue +261 -261
- package/src/components/SSelectSearchAutoComplete.vue +172 -172
- package/src/components/SSelectSearchCheckbox.vue +356 -356
- package/src/components/SStringToInput.vue +66 -66
- package/src/components/STab.vue +77 -77
- package/src/components/STable.vue +425 -425
- package/src/components/STableTree.vue +210 -208
- package/src/components/STabs.vue +32 -32
- package/src/components/STimePicker.vue +159 -159
- package/src/components/SToggle.vue +68 -68
- package/src/components/STooltip.vue +209 -209
- package/src/components/SelelctItem.vue +21 -21
- package/src/components/TimePickerCard.vue +352 -352
- package/src/composables/date.js +11 -11
- package/src/composables/modelBinder.js +13 -13
- package/src/composables/table/use-navigator.js +110 -110
- package/src/composables/table/use-resizable.js +80 -80
- package/src/css/app.scss +90 -90
- package/src/css/default.scss +875 -875
- package/src/css/extends.scss +154 -154
- package/src/css/quasar.variables.scss +189 -189
- package/src/directives/Directive.js +7 -8
- package/src/index.scss +3 -9
- package/src/vue-plugin.js +91 -92
- package/tsconfig.json +35 -0
package/src/composables/date.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export function getCustomAgoMonth(ago = 1) {
|
|
2
|
-
const newDate = new Date();
|
|
3
|
-
const monthOfYear = newDate.getMonth();
|
|
4
|
-
newDate.setMonth(monthOfYear - ago);
|
|
5
|
-
const year = newDate.getFullYear();
|
|
6
|
-
let month = newDate.getMonth() + 1;
|
|
7
|
-
let day = newDate.getDate();
|
|
8
|
-
month = month < 10 ? `0${String(month)}` : month;
|
|
9
|
-
day = day < 10 ? `0${String(day)}` : day;
|
|
10
|
-
return `${year}-${month}-${day}`;
|
|
11
|
-
}
|
|
1
|
+
export function getCustomAgoMonth(ago = 1) {
|
|
2
|
+
const newDate = new Date();
|
|
3
|
+
const monthOfYear = newDate.getMonth();
|
|
4
|
+
newDate.setMonth(monthOfYear - ago);
|
|
5
|
+
const year = newDate.getFullYear();
|
|
6
|
+
let month = newDate.getMonth() + 1;
|
|
7
|
+
let day = newDate.getDate();
|
|
8
|
+
month = month < 10 ? `0${String(month)}` : month;
|
|
9
|
+
day = day < 10 ? `0${String(day)}` : day;
|
|
10
|
+
return `${year}-${month}-${day}`;
|
|
11
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { getCurrentInstance, ref, watch } from 'vue';
|
|
2
|
-
|
|
3
|
-
export function useModelBinder(props) {
|
|
4
|
-
const { emit } = getCurrentInstance();
|
|
5
|
-
const model = ref(props.modelValue);
|
|
6
|
-
watch(() => model.value, () => {
|
|
7
|
-
emit('update:model-value', model.value);
|
|
8
|
-
}, { deep: true });
|
|
9
|
-
watch(() => props.modelValue, (newValue) => {
|
|
10
|
-
model.value = newValue;
|
|
11
|
-
}, { deep: true });
|
|
12
|
-
return model;
|
|
13
|
-
}
|
|
1
|
+
import { getCurrentInstance, ref, watch } from 'vue';
|
|
2
|
+
|
|
3
|
+
export function useModelBinder(props) {
|
|
4
|
+
const { emit } = getCurrentInstance();
|
|
5
|
+
const model = ref(props.modelValue);
|
|
6
|
+
watch(() => model.value, () => {
|
|
7
|
+
emit('update:model-value', model.value);
|
|
8
|
+
}, { deep: true });
|
|
9
|
+
watch(() => props.modelValue, (newValue) => {
|
|
10
|
+
model.value = newValue;
|
|
11
|
+
}, { deep: true });
|
|
12
|
+
return model;
|
|
13
|
+
}
|
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
import { computed, ref, watch } from 'vue';
|
|
2
|
-
import { copyToClipboard } from 'quasar';
|
|
3
|
-
import { editIcon } from '../../assets/icons.js';
|
|
4
|
-
|
|
5
|
-
export function useNavigator(props, attrs, emit) {
|
|
6
|
-
const focusedModel = ref(props.focused || {});
|
|
7
|
-
const editing = ref(false);
|
|
8
|
-
const max = computed(() => ({ x: props.columns.length, y: props.rows.length }));
|
|
9
|
-
const focusedData = computed(() => {
|
|
10
|
-
const value = props.rows[focusedModel.value.y][props.columns[focusedModel.value.x].name];
|
|
11
|
-
return {
|
|
12
|
-
col: props.columns[focusedModel.value.x],
|
|
13
|
-
row: props.rows[focusedModel.value.y],
|
|
14
|
-
val: props.inputOptions.type === 'number' ? Number(value) : value,
|
|
15
|
-
};
|
|
16
|
-
});
|
|
17
|
-
const inputData = ref(props.inputOptions.type === 'number' ? 0 : '');
|
|
18
|
-
const inputRef = ref(null);
|
|
19
|
-
function openInput() {
|
|
20
|
-
if (!focusedData.value.col.editable) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
inputData.value = props.inputOptions.type === 'number' ? Number(focusedData.value.val) : focusedData.value.val;
|
|
24
|
-
editing.value = true;
|
|
25
|
-
setTimeout(() => {
|
|
26
|
-
if (inputRef.value) {
|
|
27
|
-
inputRef.value.$el.focus();
|
|
28
|
-
}
|
|
29
|
-
}, 200);
|
|
30
|
-
}
|
|
31
|
-
function focusCell(cell) {
|
|
32
|
-
const x = cell.cols.indexOf(cell.cols.find((e) => cell.col.name === e.name));
|
|
33
|
-
const y = cell.rowIndex;
|
|
34
|
-
if (focusedModel.value.x === x && focusedModel.value.y === y) {
|
|
35
|
-
if (cell.row.deleted) return;
|
|
36
|
-
openInput();
|
|
37
|
-
} else {
|
|
38
|
-
focusedModel.value = {
|
|
39
|
-
x,
|
|
40
|
-
y,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
function isFocused(cell) {
|
|
45
|
-
const x = cell.cols.indexOf(cell.cols.find((e) => cell.col.name === e.name));
|
|
46
|
-
const y = cell.rowIndex;
|
|
47
|
-
return focusedModel.value.x === x && focusedModel.value.y === y;
|
|
48
|
-
}
|
|
49
|
-
function closeInput() {
|
|
50
|
-
emit('field-updated', {
|
|
51
|
-
field: focusedData.value,
|
|
52
|
-
value: props.inputOptions.type === 'number' ? Number(inputData.value) : inputData.value,
|
|
53
|
-
});
|
|
54
|
-
editing.value = false;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
watch(() => focusedModel.value, () => {
|
|
58
|
-
emit('update:focused', focusedModel.value);
|
|
59
|
-
});
|
|
60
|
-
watch(() => props.focused, (newVal) => {
|
|
61
|
-
focusedModel.value = newVal;
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
window.document.addEventListener('keydown', (e) => {
|
|
65
|
-
if (Object.keys(focusedModel.value).length > 0) {
|
|
66
|
-
if (!editing.value) {
|
|
67
|
-
if (focusedModel.value.x < max.value.x - 1 && e.code === 'ArrowRight') {
|
|
68
|
-
focusedModel.value.x += 1;
|
|
69
|
-
}
|
|
70
|
-
if (focusedModel.value.x > 0 && e.code === 'ArrowLeft') {
|
|
71
|
-
focusedModel.value.x -= 1;
|
|
72
|
-
}
|
|
73
|
-
if (focusedModel.value.y < max.value.y - 1 && e.code === 'ArrowDown') {
|
|
74
|
-
focusedModel.value.y += 1;
|
|
75
|
-
}
|
|
76
|
-
if (focusedModel.value.y > 0 && e.code === 'ArrowUp') {
|
|
77
|
-
focusedModel.value.y -= 1;
|
|
78
|
-
}
|
|
79
|
-
if (e.key === 'Enter') {
|
|
80
|
-
if (focusedData.value.row.deleted) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
if (document.activeElement.tagName === 'BODY') {
|
|
84
|
-
openInput();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
if (e.code === 'Tab') {
|
|
88
|
-
e.preventDefault();
|
|
89
|
-
if (focusedModel.value.x < max.value.x - 1) {
|
|
90
|
-
focusedModel.value.x += 1;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
if ((e.ctrlKey || e.metaKey) && e.code === 'KeyC') {
|
|
94
|
-
copyToClipboard(focusedData.value.val);
|
|
95
|
-
}
|
|
96
|
-
} else if (e.key === 'Enter') {
|
|
97
|
-
closeInput();
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}, { passive: true });
|
|
101
|
-
return {
|
|
102
|
-
focusCell,
|
|
103
|
-
isFocused,
|
|
104
|
-
editing,
|
|
105
|
-
inputRef,
|
|
106
|
-
inputData,
|
|
107
|
-
closeInput,
|
|
108
|
-
editIcon,
|
|
109
|
-
};
|
|
110
|
-
}
|
|
1
|
+
import { computed, ref, watch } from 'vue';
|
|
2
|
+
import { copyToClipboard } from 'quasar';
|
|
3
|
+
import { editIcon } from '../../assets/icons.js';
|
|
4
|
+
|
|
5
|
+
export function useNavigator(props, attrs, emit) {
|
|
6
|
+
const focusedModel = ref(props.focused || {});
|
|
7
|
+
const editing = ref(false);
|
|
8
|
+
const max = computed(() => ({ x: props.columns.length, y: props.rows.length }));
|
|
9
|
+
const focusedData = computed(() => {
|
|
10
|
+
const value = props.rows[focusedModel.value.y][props.columns[focusedModel.value.x].name];
|
|
11
|
+
return {
|
|
12
|
+
col: props.columns[focusedModel.value.x],
|
|
13
|
+
row: props.rows[focusedModel.value.y],
|
|
14
|
+
val: props.inputOptions.type === 'number' ? Number(value) : value,
|
|
15
|
+
};
|
|
16
|
+
});
|
|
17
|
+
const inputData = ref(props.inputOptions.type === 'number' ? 0 : '');
|
|
18
|
+
const inputRef = ref(null);
|
|
19
|
+
function openInput() {
|
|
20
|
+
if (!focusedData.value.col.editable) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
inputData.value = props.inputOptions.type === 'number' ? Number(focusedData.value.val) : focusedData.value.val;
|
|
24
|
+
editing.value = true;
|
|
25
|
+
setTimeout(() => {
|
|
26
|
+
if (inputRef.value) {
|
|
27
|
+
inputRef.value.$el.focus();
|
|
28
|
+
}
|
|
29
|
+
}, 200);
|
|
30
|
+
}
|
|
31
|
+
function focusCell(cell) {
|
|
32
|
+
const x = cell.cols.indexOf(cell.cols.find((e) => cell.col.name === e.name));
|
|
33
|
+
const y = cell.rowIndex;
|
|
34
|
+
if (focusedModel.value.x === x && focusedModel.value.y === y) {
|
|
35
|
+
if (cell.row.deleted) return;
|
|
36
|
+
openInput();
|
|
37
|
+
} else {
|
|
38
|
+
focusedModel.value = {
|
|
39
|
+
x,
|
|
40
|
+
y,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function isFocused(cell) {
|
|
45
|
+
const x = cell.cols.indexOf(cell.cols.find((e) => cell.col.name === e.name));
|
|
46
|
+
const y = cell.rowIndex;
|
|
47
|
+
return focusedModel.value.x === x && focusedModel.value.y === y;
|
|
48
|
+
}
|
|
49
|
+
function closeInput() {
|
|
50
|
+
emit('field-updated', {
|
|
51
|
+
field: focusedData.value,
|
|
52
|
+
value: props.inputOptions.type === 'number' ? Number(inputData.value) : inputData.value,
|
|
53
|
+
});
|
|
54
|
+
editing.value = false;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
watch(() => focusedModel.value, () => {
|
|
58
|
+
emit('update:focused', focusedModel.value);
|
|
59
|
+
});
|
|
60
|
+
watch(() => props.focused, (newVal) => {
|
|
61
|
+
focusedModel.value = newVal;
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
window.document.addEventListener('keydown', (e) => {
|
|
65
|
+
if (Object.keys(focusedModel.value).length > 0) {
|
|
66
|
+
if (!editing.value) {
|
|
67
|
+
if (focusedModel.value.x < max.value.x - 1 && e.code === 'ArrowRight') {
|
|
68
|
+
focusedModel.value.x += 1;
|
|
69
|
+
}
|
|
70
|
+
if (focusedModel.value.x > 0 && e.code === 'ArrowLeft') {
|
|
71
|
+
focusedModel.value.x -= 1;
|
|
72
|
+
}
|
|
73
|
+
if (focusedModel.value.y < max.value.y - 1 && e.code === 'ArrowDown') {
|
|
74
|
+
focusedModel.value.y += 1;
|
|
75
|
+
}
|
|
76
|
+
if (focusedModel.value.y > 0 && e.code === 'ArrowUp') {
|
|
77
|
+
focusedModel.value.y -= 1;
|
|
78
|
+
}
|
|
79
|
+
if (e.key === 'Enter') {
|
|
80
|
+
if (focusedData.value.row.deleted) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (document.activeElement.tagName === 'BODY') {
|
|
84
|
+
openInput();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (e.code === 'Tab') {
|
|
88
|
+
e.preventDefault();
|
|
89
|
+
if (focusedModel.value.x < max.value.x - 1) {
|
|
90
|
+
focusedModel.value.x += 1;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if ((e.ctrlKey || e.metaKey) && e.code === 'KeyC') {
|
|
94
|
+
copyToClipboard(focusedData.value.val);
|
|
95
|
+
}
|
|
96
|
+
} else if (e.key === 'Enter') {
|
|
97
|
+
closeInput();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}, { passive: true });
|
|
101
|
+
return {
|
|
102
|
+
focusCell,
|
|
103
|
+
isFocused,
|
|
104
|
+
editing,
|
|
105
|
+
inputRef,
|
|
106
|
+
inputData,
|
|
107
|
+
closeInput,
|
|
108
|
+
editIcon,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
function createDiv(val) {
|
|
2
|
-
const div = document.createElement('div');
|
|
3
|
-
div.classList.add(`resiable-${val}`);
|
|
4
|
-
div.style.top = '10px';
|
|
5
|
-
if (val === 'right') div.style.right = 0;
|
|
6
|
-
if (val === 'left') div.style.left = 0;
|
|
7
|
-
div.style.width = '4px';
|
|
8
|
-
div.style.position = 'absolute';
|
|
9
|
-
div.style.cursor = 'col-resize';
|
|
10
|
-
div.style.backgroundColor = 'none';
|
|
11
|
-
div.style.border = '1px solid #CCCCCC';
|
|
12
|
-
div.style.borderTop = 'none';
|
|
13
|
-
div.style.borderBottom = 'none';
|
|
14
|
-
div.style.zIndex = 2;
|
|
15
|
-
div.style.userSelect = 'none';
|
|
16
|
-
div.style.height = '16px';
|
|
17
|
-
return div;
|
|
18
|
-
}
|
|
19
|
-
function setListeners(div, position) {
|
|
20
|
-
let curCol;
|
|
21
|
-
let pageX;
|
|
22
|
-
let curColWidth;
|
|
23
|
-
div.addEventListener('mousedown', (e) => {
|
|
24
|
-
curCol = e.target.parentElement;
|
|
25
|
-
pageX = e.pageX;
|
|
26
|
-
curColWidth = curCol.offsetWidth;
|
|
27
|
-
}, { passive: true });
|
|
28
|
-
|
|
29
|
-
document.addEventListener('mousemove', (e) => {
|
|
30
|
-
if (curCol) {
|
|
31
|
-
const diffX = e.pageX - pageX;
|
|
32
|
-
if (position === 'right') {
|
|
33
|
-
curCol.style.minWidth = `${curColWidth + diffX}px`;
|
|
34
|
-
curCol.style.width = `${curColWidth + diffX}px`;
|
|
35
|
-
}
|
|
36
|
-
if (position === 'left') {
|
|
37
|
-
curCol.style.minWidth = `${curColWidth - diffX}px`;
|
|
38
|
-
curCol.style.width = `${curColWidth - diffX}px`;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}, { passive: true });
|
|
42
|
-
|
|
43
|
-
document.addEventListener('mouseup', () => {
|
|
44
|
-
curCol = undefined;
|
|
45
|
-
pageX = undefined;
|
|
46
|
-
curColWidth = undefined;
|
|
47
|
-
}, { passive: true });
|
|
48
|
-
}
|
|
49
|
-
function addResizable(tableEl) {
|
|
50
|
-
const tableElement = tableEl
|
|
51
|
-
.getElementsByTagName('table')[0];
|
|
52
|
-
const firstRow = tableElement.getElementsByTagName('tr')[0];
|
|
53
|
-
const cols = firstRow ? firstRow.children : [];
|
|
54
|
-
for (let i = 0; i < cols.length; i += 1) {
|
|
55
|
-
const div = createDiv('right');
|
|
56
|
-
cols[i].appendChild(div);
|
|
57
|
-
cols[i].style.position = 'sticky';
|
|
58
|
-
setListeners(div, 'right');
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function addStickyResizable(tableEl, val) {
|
|
63
|
-
const tableElement = tableEl
|
|
64
|
-
.getElementsByTagName('table')[0];
|
|
65
|
-
const firstRow = tableElement.getElementsByTagName('tr')[0];
|
|
66
|
-
const cols = firstRow ? firstRow.children : [];
|
|
67
|
-
for (let i = cols.length - val; i < cols.length; i += 1) {
|
|
68
|
-
const div = createDiv('left');
|
|
69
|
-
cols[i].appendChild(div);
|
|
70
|
-
cols[i].style.position = 'sticky';
|
|
71
|
-
setListeners(div, 'left');
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export function useResizable() {
|
|
76
|
-
return {
|
|
77
|
-
addResizable,
|
|
78
|
-
addStickyResizable,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
1
|
+
function createDiv(val) {
|
|
2
|
+
const div = document.createElement('div');
|
|
3
|
+
div.classList.add(`resiable-${val}`);
|
|
4
|
+
div.style.top = '10px';
|
|
5
|
+
if (val === 'right') div.style.right = 0;
|
|
6
|
+
if (val === 'left') div.style.left = 0;
|
|
7
|
+
div.style.width = '4px';
|
|
8
|
+
div.style.position = 'absolute';
|
|
9
|
+
div.style.cursor = 'col-resize';
|
|
10
|
+
div.style.backgroundColor = 'none';
|
|
11
|
+
div.style.border = '1px solid #CCCCCC';
|
|
12
|
+
div.style.borderTop = 'none';
|
|
13
|
+
div.style.borderBottom = 'none';
|
|
14
|
+
div.style.zIndex = 2;
|
|
15
|
+
div.style.userSelect = 'none';
|
|
16
|
+
div.style.height = '16px';
|
|
17
|
+
return div;
|
|
18
|
+
}
|
|
19
|
+
function setListeners(div, position) {
|
|
20
|
+
let curCol;
|
|
21
|
+
let pageX;
|
|
22
|
+
let curColWidth;
|
|
23
|
+
div.addEventListener('mousedown', (e) => {
|
|
24
|
+
curCol = e.target.parentElement;
|
|
25
|
+
pageX = e.pageX;
|
|
26
|
+
curColWidth = curCol.offsetWidth;
|
|
27
|
+
}, { passive: true });
|
|
28
|
+
|
|
29
|
+
document.addEventListener('mousemove', (e) => {
|
|
30
|
+
if (curCol) {
|
|
31
|
+
const diffX = e.pageX - pageX;
|
|
32
|
+
if (position === 'right') {
|
|
33
|
+
curCol.style.minWidth = `${curColWidth + diffX}px`;
|
|
34
|
+
curCol.style.width = `${curColWidth + diffX}px`;
|
|
35
|
+
}
|
|
36
|
+
if (position === 'left') {
|
|
37
|
+
curCol.style.minWidth = `${curColWidth - diffX}px`;
|
|
38
|
+
curCol.style.width = `${curColWidth - diffX}px`;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}, { passive: true });
|
|
42
|
+
|
|
43
|
+
document.addEventListener('mouseup', () => {
|
|
44
|
+
curCol = undefined;
|
|
45
|
+
pageX = undefined;
|
|
46
|
+
curColWidth = undefined;
|
|
47
|
+
}, { passive: true });
|
|
48
|
+
}
|
|
49
|
+
function addResizable(tableEl) {
|
|
50
|
+
const tableElement = tableEl
|
|
51
|
+
.getElementsByTagName('table')[0];
|
|
52
|
+
const firstRow = tableElement.getElementsByTagName('tr')[0];
|
|
53
|
+
const cols = firstRow ? firstRow.children : [];
|
|
54
|
+
for (let i = 0; i < cols.length; i += 1) {
|
|
55
|
+
const div = createDiv('right');
|
|
56
|
+
cols[i].appendChild(div);
|
|
57
|
+
cols[i].style.position = 'sticky';
|
|
58
|
+
setListeners(div, 'right');
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function addStickyResizable(tableEl, val) {
|
|
63
|
+
const tableElement = tableEl
|
|
64
|
+
.getElementsByTagName('table')[0];
|
|
65
|
+
const firstRow = tableElement.getElementsByTagName('tr')[0];
|
|
66
|
+
const cols = firstRow ? firstRow.children : [];
|
|
67
|
+
for (let i = cols.length - val; i < cols.length; i += 1) {
|
|
68
|
+
const div = createDiv('left');
|
|
69
|
+
cols[i].appendChild(div);
|
|
70
|
+
cols[i].style.position = 'sticky';
|
|
71
|
+
setListeners(div, 'left');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function useResizable() {
|
|
76
|
+
return {
|
|
77
|
+
addResizable,
|
|
78
|
+
addStickyResizable,
|
|
79
|
+
};
|
|
80
|
+
}
|
package/src/css/app.scss
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
// $
|
|
2
|
-
@import './quasar.variables.scss';
|
|
3
|
-
@import './default.scss';
|
|
4
|
-
|
|
5
|
-
.q-field {
|
|
6
|
-
font-size: $body-font-size;
|
|
7
|
-
&--outlined {
|
|
8
|
-
.q-field__control {
|
|
9
|
-
border-radius: $generic-border-radius;
|
|
10
|
-
&:before {
|
|
11
|
-
border: 1px solid rgba(0, 0, 0, 0.24);
|
|
12
|
-
}
|
|
13
|
-
&:hover:after {
|
|
14
|
-
border: 1px solid;
|
|
15
|
-
border-color: $positive;
|
|
16
|
-
box-shadow: 0 0 4px $positive;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
&.q-field--highlighted {
|
|
20
|
-
.q-field__control:hover:before {
|
|
21
|
-
border-color: transparent;
|
|
22
|
-
}
|
|
23
|
-
.q-field__control:after {
|
|
24
|
-
border: 1px solid;
|
|
25
|
-
border-color: $positive;
|
|
26
|
-
box-shadow: 0 0 4px $positive;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
&--dense {
|
|
31
|
-
.q-field__control,
|
|
32
|
-
.q-field__marginal {
|
|
33
|
-
height: 100%;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
&--auto-height {
|
|
37
|
-
&.q-field--dense {
|
|
38
|
-
.q-field__control,
|
|
39
|
-
.q-field__native {
|
|
40
|
-
min-height: 28px;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
.q-field__control-container {
|
|
44
|
-
white-space: nowrap;
|
|
45
|
-
overflow: hidden;
|
|
46
|
-
text-overflow: ellipsis;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
&--disabled {
|
|
50
|
-
.q-field__inner {
|
|
51
|
-
.q-field__control{
|
|
52
|
-
background: $Grey_Lighten-4 !important;
|
|
53
|
-
color: $Grey_Default !important;
|
|
54
|
-
cursor: not-allowed;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.q-textarea {
|
|
61
|
-
.q-field__control {
|
|
62
|
-
height: auto;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.disabled {
|
|
67
|
-
border: 1px solid $Grey_Lighten-2;
|
|
68
|
-
background: $Grey_Lighten-4 !important;
|
|
69
|
-
color: $Grey_Default !important;
|
|
70
|
-
cursor: not-allowed;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.q-card {
|
|
74
|
-
border-radius: 8px !important;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.no-hover {
|
|
78
|
-
&.q-focus-helper,
|
|
79
|
-
&.q-focusable:focus > .q-focus-helper,
|
|
80
|
-
&.q-manual-focusable--focused > .q-focus-helper,
|
|
81
|
-
&.q-hoverable:hover > .q-focus-helper {
|
|
82
|
-
background: none !important;
|
|
83
|
-
opacity: 0 !important;
|
|
84
|
-
&::before,
|
|
85
|
-
&::after {
|
|
86
|
-
opacity: 0 !important;
|
|
87
|
-
background: none !important;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
1
|
+
// $
|
|
2
|
+
@import './quasar.variables.scss';
|
|
3
|
+
@import './default.scss';
|
|
4
|
+
|
|
5
|
+
.q-field {
|
|
6
|
+
font-size: $body-font-size;
|
|
7
|
+
&--outlined {
|
|
8
|
+
.q-field__control {
|
|
9
|
+
border-radius: $generic-border-radius;
|
|
10
|
+
&:before {
|
|
11
|
+
border: 1px solid rgba(0, 0, 0, 0.24);
|
|
12
|
+
}
|
|
13
|
+
&:hover:after {
|
|
14
|
+
border: 1px solid;
|
|
15
|
+
border-color: $positive;
|
|
16
|
+
box-shadow: 0 0 4px $positive;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
&.q-field--highlighted {
|
|
20
|
+
.q-field__control:hover:before {
|
|
21
|
+
border-color: transparent;
|
|
22
|
+
}
|
|
23
|
+
.q-field__control:after {
|
|
24
|
+
border: 1px solid;
|
|
25
|
+
border-color: $positive;
|
|
26
|
+
box-shadow: 0 0 4px $positive;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
&--dense {
|
|
31
|
+
.q-field__control,
|
|
32
|
+
.q-field__marginal {
|
|
33
|
+
height: 100%;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
&--auto-height {
|
|
37
|
+
&.q-field--dense {
|
|
38
|
+
.q-field__control,
|
|
39
|
+
.q-field__native {
|
|
40
|
+
min-height: 28px;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
.q-field__control-container {
|
|
44
|
+
white-space: nowrap;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
text-overflow: ellipsis;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
&--disabled {
|
|
50
|
+
.q-field__inner {
|
|
51
|
+
.q-field__control{
|
|
52
|
+
background: $Grey_Lighten-4 !important;
|
|
53
|
+
color: $Grey_Default !important;
|
|
54
|
+
cursor: not-allowed;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.q-textarea {
|
|
61
|
+
.q-field__control {
|
|
62
|
+
height: auto;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.disabled {
|
|
67
|
+
border: 1px solid $Grey_Lighten-2;
|
|
68
|
+
background: $Grey_Lighten-4 !important;
|
|
69
|
+
color: $Grey_Default !important;
|
|
70
|
+
cursor: not-allowed;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.q-card {
|
|
74
|
+
border-radius: 8px !important;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.no-hover {
|
|
78
|
+
&.q-focus-helper,
|
|
79
|
+
&.q-focusable:focus > .q-focus-helper,
|
|
80
|
+
&.q-manual-focusable--focused > .q-focus-helper,
|
|
81
|
+
&.q-hoverable:hover > .q-focus-helper {
|
|
82
|
+
background: none !important;
|
|
83
|
+
opacity: 0 !important;
|
|
84
|
+
&::before,
|
|
85
|
+
&::after {
|
|
86
|
+
opacity: 0 !important;
|
|
87
|
+
background: none !important;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|