Refactor #3832 Refactor #3833 - For DataTable & Column

This commit is contained in:
Tuğçe Küçükoğlu 2023-04-13 17:42:33 +03:00
parent bb65e68636
commit b82c553747
12 changed files with 314 additions and 73 deletions

View file

@ -4,12 +4,13 @@
<input ref="input" type="checkbox" :checked="checked" :disabled="disabled" :tabindex="disabled ? null : '0'" :aria-label="headerCheckboxAriaLabel" @focus="onFocus($event)" @blur="onBlur($event)" />
</div>
<div ref="box" :class="['p-checkbox-box p-component', { 'p-highlight': checked, 'p-disabled': disabled, 'p-focus': focused }]">
<span :class="['p-checkbox-icon', { 'pi pi-check': checked }]"></span>
<component :is="headerCheckboxIconTemplate || 'CheckIcon'" :checked="checked" class="p-checkbox-icon" />
</div>
</div>
</template>
<script>
import CheckIcon from 'primevue/icon/check';
import { DomHandler } from 'primevue/utils';
export default {
@ -17,7 +18,11 @@ export default {
emits: ['change'],
props: {
checked: null,
disabled: null
disabled: null,
headerCheckboxIconTemplate: {
type: null,
default: null
}
},
data() {
return {
@ -46,6 +51,9 @@ export default {
headerCheckboxAriaLabel() {
return this.$primevue.config.locale.aria ? (this.checked ? this.$primevue.config.locale.aria.selectAll : this.$primevue.config.locale.aria.unselectAll) : undefined;
}
},
components: {
CheckIcon: CheckIcon
}
};
</script>