Merge branch 'master' into v4
commit
5a6e010794
|
@ -777,8 +777,13 @@ export default {
|
||||||
isValidSelectedOption(option) {
|
isValidSelectedOption(option) {
|
||||||
return this.isValidOption(option) && this.isSelected(option);
|
return this.isValidOption(option) && this.isSelected(option);
|
||||||
},
|
},
|
||||||
|
isEquals(value1, value2) {
|
||||||
|
return ObjectUtils.equals(value1, value2, this.equalityKey);
|
||||||
|
},
|
||||||
isSelected(option) {
|
isSelected(option) {
|
||||||
return ObjectUtils.equals(this.modelValue, this.getOptionValue(option), this.equalityKey);
|
const optionValue = this.getOptionValue(option);
|
||||||
|
|
||||||
|
return this.multiple ? (this.modelValue || []).some((value) => this.isEquals(value, optionValue)) : this.isEquals(this.modelValue, this.getOptionValue(option));
|
||||||
},
|
},
|
||||||
findFirstOptionIndex() {
|
findFirstOptionIndex() {
|
||||||
return this.visibleOptions.findIndex((option) => this.isValidOption(option));
|
return this.visibleOptions.findIndex((option) => this.isValidOption(option));
|
||||||
|
|
|
@ -943,9 +943,9 @@ export interface DataTableProps {
|
||||||
*/
|
*/
|
||||||
filterDisplay?: 'menu' | 'row' | undefined;
|
filterDisplay?: 'menu' | 'row' | undefined;
|
||||||
/**
|
/**
|
||||||
* Fields for global filter
|
* An array of fields as string or function to use in global filtering.
|
||||||
*/
|
*/
|
||||||
globalFilterFields?: string[] | undefined;
|
globalFilterFields?: (string | ((data: any) => string))[] | undefined;
|
||||||
/**
|
/**
|
||||||
* Locale to use in filtering. The default locale is the host environment's current locale.
|
* Locale to use in filtering. The default locale is the host environment's current locale.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -87,6 +87,7 @@
|
||||||
:filtersStore="filters"
|
:filtersStore="filters"
|
||||||
:filterDisplay="filterDisplay"
|
:filterDisplay="filterDisplay"
|
||||||
:filterInputProps="filterInputProps"
|
:filterInputProps="filterInputProps"
|
||||||
|
:first="d_first"
|
||||||
@column-click="onColumnHeaderClick($event)"
|
@column-click="onColumnHeaderClick($event)"
|
||||||
@column-mousedown="onColumnHeaderMouseDown($event)"
|
@column-mousedown="onColumnHeaderMouseDown($event)"
|
||||||
@filter-change="onFilterChange"
|
@filter-change="onFilterChange"
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
:filterDisplay="filterDisplay"
|
:filterDisplay="filterDisplay"
|
||||||
:filtersStore="filtersStore"
|
:filtersStore="filtersStore"
|
||||||
:filterInputProps="filterInputProps"
|
:filterInputProps="filterInputProps"
|
||||||
|
:first="first"
|
||||||
@filter-change="$emit('filter-change', $event)"
|
@filter-change="$emit('filter-change', $event)"
|
||||||
@filter-apply="$emit('filter-apply')"
|
@filter-apply="$emit('filter-apply')"
|
||||||
@operator-change="$emit('operator-change', $event)"
|
@operator-change="$emit('operator-change', $event)"
|
||||||
|
@ -223,6 +224,10 @@ export default {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
|
first: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
filterInputProps: {
|
filterInputProps: {
|
||||||
type: null,
|
type: null,
|
||||||
default: null
|
default: null
|
||||||
|
|
|
@ -355,7 +355,7 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.shiftKey || event.altKey) {
|
if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) {
|
||||||
this.isSpecialChar = true;
|
this.isSpecialChar = true;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -157,7 +157,7 @@ export default {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if ((this.integerOnly && !((event.code.startsWith('Digit') || event.code.startsWith('Numpad')) && Number(event.code) >= 0 && Number(event.code) <= 9)) || (this.tokens.join('').length >= this.length && event.code !== 'Delete')) {
|
if ((this.integerOnly && !((event.code.startsWith('Digit') || event.code.startsWith('Numpad')) && Number(event.key) >= 0 && Number(event.key) <= 9)) || (this.tokens.join('').length >= this.length && event.code !== 'Delete')) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
v-if="!range"
|
v-if="!range"
|
||||||
:class="cx('handle')"
|
:class="cx('handle')"
|
||||||
:style="[sx('handle'), handleStyle]"
|
:style="[sx('handle'), handleStyle]"
|
||||||
@touchstart="onDragStart($event)"
|
@touchstart.passive="onDragStart($event)"
|
||||||
@touchmove="onDrag($event)"
|
@touchmove.passive="onDrag($event)"
|
||||||
@touchend="onDragEnd($event)"
|
@touchend="onDragEnd($event)"
|
||||||
@mousedown="onMouseDown($event)"
|
@mousedown="onMouseDown($event)"
|
||||||
@keydown="onKeyDown($event)"
|
@keydown="onKeyDown($event)"
|
||||||
|
@ -24,8 +24,8 @@
|
||||||
v-if="range"
|
v-if="range"
|
||||||
:class="cx('handle')"
|
:class="cx('handle')"
|
||||||
:style="[sx('handle'), rangeStartHandleStyle]"
|
:style="[sx('handle'), rangeStartHandleStyle]"
|
||||||
@touchstart="onDragStart($event, 0)"
|
@touchstart.passive="onDragStart($event, 0)"
|
||||||
@touchmove="onDrag($event)"
|
@touchmove.passive="onDrag($event)"
|
||||||
@touchend="onDragEnd($event)"
|
@touchend="onDragEnd($event)"
|
||||||
@mousedown="onMouseDown($event, 0)"
|
@mousedown="onMouseDown($event, 0)"
|
||||||
@keydown="onKeyDown($event, 0)"
|
@keydown="onKeyDown($event, 0)"
|
||||||
|
@ -43,8 +43,8 @@
|
||||||
v-if="range"
|
v-if="range"
|
||||||
:class="cx('handle')"
|
:class="cx('handle')"
|
||||||
:style="[sx('handle'), rangeEndHandleStyle]"
|
:style="[sx('handle'), rangeEndHandleStyle]"
|
||||||
@touchstart="onDragStart($event, 1)"
|
@touchstart.passive="onDragStart($event, 1)"
|
||||||
@touchmove="onDrag($event)"
|
@touchmove.passive="onDrag($event)"
|
||||||
@touchend="onDragEnd($event)"
|
@touchend="onDragEnd($event)"
|
||||||
@mousedown="onMouseDown($event, 1)"
|
@mousedown="onMouseDown($event, 1)"
|
||||||
@keydown="onKeyDown($event, 1)"
|
@keydown="onKeyDown($event, 1)"
|
||||||
|
|
|
@ -370,13 +370,17 @@ export interface TreeSlots {
|
||||||
}): VNode[];
|
}): VNode[];
|
||||||
/**
|
/**
|
||||||
* Custom node icon template.
|
* Custom node icon template.
|
||||||
* @param {Object} scope - togglericon slot's params.
|
* @param {Object} scope - nodeicon slot's params.
|
||||||
*/
|
*/
|
||||||
nodeicon(scope: {
|
nodeicon(scope: {
|
||||||
/**
|
/**
|
||||||
* Tree node instance
|
* Tree node instance
|
||||||
*/
|
*/
|
||||||
node: TreeNode;
|
node: TreeNode;
|
||||||
|
/**
|
||||||
|
* Style class of the icon.
|
||||||
|
*/
|
||||||
|
class: string;
|
||||||
}): VNode[];
|
}): VNode[];
|
||||||
/**
|
/**
|
||||||
* Custom checkbox icon
|
* Custom checkbox icon
|
||||||
|
|
|
@ -63,7 +63,7 @@ describe('Tree.vue', () => {
|
||||||
it('should render icon slot', ({ expect }) => {
|
it('should render icon slot', ({ expect }) => {
|
||||||
let wrapper = mount(Tree, {
|
let wrapper = mount(Tree, {
|
||||||
slots: {
|
slots: {
|
||||||
nodeIcon: `<i data-node-icon/>`
|
nodeicon: `<i data-node-icon/>`
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
value: [
|
value: [
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<component v-else :is="checked ? 'CheckIcon' : partialChecked ? 'MinusIcon' : null" :class="slotProps.class" v-bind="getPTOptions('nodeCheckbox.icon')" />
|
<component v-else :is="checked ? 'CheckIcon' : partialChecked ? 'MinusIcon' : null" :class="slotProps.class" v-bind="getPTOptions('nodeCheckbox.icon')" />
|
||||||
</template>
|
</template>
|
||||||
</Checkbox>
|
</Checkbox>
|
||||||
<component v-if="templates['nodeicon']" :is="templates['nodeicon']" :node="node"></component>
|
<component v-if="templates['nodeicon']" :is="templates['nodeicon']" :node="node" :class="[cx('nodeIcon')]"></component>
|
||||||
<span v-else :class="[cx('nodeIcon'), node.icon]" v-bind="getPTOptions('nodeIcon')"></span>
|
<span v-else :class="[cx('nodeIcon'), node.icon]" v-bind="getPTOptions('nodeIcon')"></span>
|
||||||
<span :class="cx('label')" v-bind="getPTOptions('label')" @keydown.stop>
|
<span :class="cx('label')" v-bind="getPTOptions('label')" @keydown.stop>
|
||||||
<component v-if="templates[node.type] || templates['default']" :is="templates[node.type] || templates['default']" :node="node" />
|
<component v-if="templates[node.type] || templates['default']" :is="templates[node.type] || templates['default']" :node="node" />
|
||||||
|
|
|
@ -38,7 +38,7 @@ export default {
|
||||||
<Button icon="pi pi-check" aria-label="Submit" />
|
<Button icon="pi pi-check" aria-label="Submit" />
|
||||||
<Button label="Submit" icon="pi pi-check" />
|
<Button label="Submit" icon="pi pi-check" />
|
||||||
<Button label="Submit" icon="pi pi-check" iconPos="right" />
|
<Button label="Submit" icon="pi pi-check" iconPos="right" />
|
||||||
</div>s
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
|
@ -20104,9 +20104,9 @@
|
||||||
"name": "globalFilterFields",
|
"name": "globalFilterFields",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"readonly": false,
|
"readonly": false,
|
||||||
"type": "string[]",
|
"type": "(string | Function)[]",
|
||||||
"default": "",
|
"default": "",
|
||||||
"description": "Fields for global filter"
|
"description": "An array of fields as string or function to use in global filtering."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "filterLocale",
|
"name": "filterLocale",
|
||||||
|
@ -57315,8 +57315,8 @@
|
||||||
{
|
{
|
||||||
"name": "scope",
|
"name": "scope",
|
||||||
"optional": false,
|
"optional": false,
|
||||||
"type": "{\n \t <span class=\"ml-3 doc-option-parameter-name\">node</span>: <span class=\"doc-option-parameter-type\">TreeNode</span>, <span class=\"doc-option-parameter-type\">// Tree node instance</span>\n }",
|
"type": "{\n \t <span class=\"ml-3 doc-option-parameter-name\">node</span>: <span class=\"doc-option-parameter-type\">TreeNode</span>, <span class=\"doc-option-parameter-type\">// Tree node instance</span>\n \t <span class=\"ml-3 doc-option-parameter-name\">class</span>: <span class=\"doc-option-parameter-type\">string</span>, <span class=\"doc-option-parameter-type\">// Style class of the icon.</span>\n }",
|
||||||
"description": "togglericon slot's params."
|
"description": "nodeicon slot's params."
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"returnType": "VNode<RendererNode, RendererElement, Object>[]",
|
"returnType": "VNode<RendererNode, RendererElement, Object>[]",
|
||||||
|
|
Loading…
Reference in New Issue