diff --git a/components/lib/checkbox/BaseCheckbox.vue b/components/lib/checkbox/BaseCheckbox.vue index c113f27a6..82e049bbf 100644 --- a/components/lib/checkbox/BaseCheckbox.vue +++ b/components/lib/checkbox/BaseCheckbox.vue @@ -13,6 +13,10 @@ export default { type: String, default: null }, + indeterminate: { + type: Boolean, + default: false + }, trueValue: { type: null, default: true diff --git a/components/lib/checkbox/Checkbox.d.ts b/components/lib/checkbox/Checkbox.d.ts index 50217b5e3..7167a6ee7 100755 --- a/components/lib/checkbox/Checkbox.d.ts +++ b/components/lib/checkbox/Checkbox.d.ts @@ -111,6 +111,11 @@ export interface CheckboxProps { * @default false */ binary?: boolean; + /** + * When present, it specifies input state as indeterminate. + * @default false + */ + indeterminate?: boolean | undefined; /** * When present, it specifies that the component should have invalid state style. * @defaultValue false diff --git a/components/lib/checkbox/Checkbox.vue b/components/lib/checkbox/Checkbox.vue index d2ae54475..b68a9c8cb 100755 --- a/components/lib/checkbox/Checkbox.vue +++ b/components/lib/checkbox/Checkbox.vue @@ -1,5 +1,5 @@ - + + @@ -30,6 +32,7 @@ diff --git a/components/lib/tree/TreeNode.vue b/components/lib/tree/TreeNode.vue index f3140f4e5..b5b5d6f41 100755 --- a/components/lib/tree/TreeNode.vue +++ b/components/lib/tree/TreeNode.vue @@ -26,10 +26,9 @@ - + - diff --git a/components/lib/treetable/BodyCell.vue b/components/lib/treetable/BodyCell.vue index 86d557b5b..131dc5083 100644 --- a/components/lib/treetable/BodyCell.vue +++ b/components/lib/treetable/BodyCell.vue @@ -18,15 +18,13 @@ :class="cx('rowCheckbox')" @change="toggleCheckbox" :tabindex="-1" + :indeterminate="partialChecked" :unstyled="unstyled" :pt="getColumnCheckboxPT('rowCheckbox')" - :data-p-highlight="checked" - :data-p-checked="checked" :data-p-partialchecked="partialChecked" > - diff --git a/doc/checkbox/IndeterminateDoc.vue b/doc/checkbox/IndeterminateDoc.vue new file mode 100644 index 000000000..63182ea3d --- /dev/null +++ b/doc/checkbox/IndeterminateDoc.vue @@ -0,0 +1,54 @@ + + + When indeterminate is present, the checkbox state specified as indeterminate. + + + + + + + + diff --git a/pages/checkbox/index.vue b/pages/checkbox/index.vue index 02ad4983d..3f64404db 100755 --- a/pages/checkbox/index.vue +++ b/pages/checkbox/index.vue @@ -18,6 +18,7 @@ import DynamicDoc from '@/doc/checkbox/DynamicDoc.vue'; import FilledDoc from '@/doc/checkbox/FilledDoc.vue'; import GroupDoc from '@/doc/checkbox/GroupDoc.vue'; import ImportDoc from '@/doc/checkbox/ImportDoc.vue'; +import IndeterminateDoc from '@/doc/checkbox/IndeterminateDoc.vue'; import InvalidDoc from '@/doc/checkbox/InvalidDoc.vue'; import PTComponent from '@/doc/checkbox/pt/index.vue'; import ThemingDoc from '@/doc/checkbox/theming/index.vue'; @@ -36,6 +37,11 @@ export default { label: 'Basic', component: BasicDoc }, + { + id: 'indeterminate', + label: 'Indeterminate', + component: IndeterminateDoc + }, { id: 'group', label: 'Group',
When indeterminate is present, the checkbox state specified as indeterminate.