diff --git a/api-generator/components/tristatecheckbox.js b/api-generator/components/tristatecheckbox.js deleted file mode 100644 index 916a3630f..000000000 --- a/api-generator/components/tristatecheckbox.js +++ /dev/null @@ -1,92 +0,0 @@ -const TriStateCheckboxProps = [ - { - name: 'modelValue', - type: 'boolean', - default: 'null', - description: 'Value of the component.' - }, - { - name: 'disabled', - type: 'boolean', - default: 'false', - description: 'When present, it specifies that the component should be disabled.' - }, - { - name: 'invalid', - type: 'boolean', - default: 'false', - description: 'When present, it specifies that the component should have invalid state style.' - }, - { - name: 'variant', - type: 'string', - default: 'null', - description: 'Specifies the input variant of the component.' - }, - { - name: 'tabindex', - type: 'string', - default: 'null', - description: 'Index of the element in tabbing order.' - }, - { - name: 'inputId', - type: 'string', - default: 'null', - description: 'Identifier of the underlying input element.' - }, - { - name: 'inputProps', - type: 'object', - default: 'null', - description: 'Used to pass all properties of the HTMLInputElement to the focusable input element inside the component.' - }, - { - name: 'aria-labelledby', - type: 'string', - default: 'null', - description: 'Establishes relationships between the component and label(s) where its value should be one or more element IDs.' - }, - { - name: 'aria-label', - type: 'string', - default: 'null', - description: 'Used to define a string that labels the element.' - }, - { - name: 'pt', - type: 'any', - default: 'null', - description: 'Used to pass attributes to DOM elements inside the component.' - }, - { - name: 'unstyled', - type: 'boolean', - default: 'false', - description: 'When enabled, it removes component related styles in the core.' - } -]; - -const TriStateCheckboxSlots = [ - { - name: 'checkicon', - description: 'Custom check icon template.' - }, - { - name: 'uncheckicon', - description: 'Custom uncheck icon template.' - }, - { - name: 'nullableicon', - description: 'Custom nullable icon template.' - } -]; - -module.exports = { - tristatecheckbox: { - name: 'TriStateCheckbox', - description: 'TriStateCheckbox is used to select either "true", "false" or "null" as the value.', - props: TriStateCheckboxProps, - slots: TriStateCheckboxSlots - } -}; diff --git a/assets/menu/menu.json b/assets/menu/menu.json index f0dc6cc2e..b2ce0f19b 100644 --- a/assets/menu/menu.json +++ b/assets/menu/menu.json @@ -171,10 +171,6 @@ { "name": "TreeSelect", "to": "/treeselect" - }, - { - "name": "TriStateCheckbox", - "to": "/tristatecheckbox" } ] }, diff --git a/components/doc/codeeditor/templates.js b/components/doc/codeeditor/templates.js index c3a2d48b8..b5dcd4f46 100644 --- a/components/doc/codeeditor/templates.js +++ b/components/doc/codeeditor/templates.js @@ -249,7 +249,6 @@ import Tooltip from 'primevue/tooltip'; import Tree from 'primevue/tree'; import TreeSelect from 'primevue/treeselect'; import TreeTable from 'primevue/treetable'; -import TriStateCheckbox from 'primevue/tristatecheckbox'; import VirtualScroller from 'primevue/virtualscroller'; ${imports} @@ -363,7 +362,6 @@ app.component('ToggleButton', ToggleButton); app.component('Tree', Tree); app.component('TreeSelect', TreeSelect); app.component('TreeTable', TreeTable); -app.component('TriStateCheckbox', TriStateCheckbox); app.component('VirtualScroller', VirtualScroller); ${element} diff --git a/components/lib/config/PrimeVue.d.ts b/components/lib/config/PrimeVue.d.ts index e0d1ad714..bd4b60501 100644 --- a/components/lib/config/PrimeVue.d.ts +++ b/components/lib/config/PrimeVue.d.ts @@ -92,7 +92,6 @@ import { TooltipDirectivePassThroughOptions } from '../tooltip'; import { TreePassThroughOptions } from '../tree'; import { TreeSelectPassThroughOptions } from '../treeselect'; import { TreeTablePassThroughOptions } from '../treetable'; -import { TriStateCheckboxPassThroughOptions } from '../tristatecheckbox'; import { DefaultPassThrough, PassThrough } from '../ts-helpers'; import { VirtualScrollerPassThroughOptions } from '../virtualscroller'; @@ -208,7 +207,6 @@ export interface PrimeVuePTOptions { toolbar?: DefaultPassThrough; tree?: DefaultPassThrough; treeselect?: DefaultPassThrough; - tristatecheckbox?: DefaultPassThrough; treetable?: DefaultPassThrough; virtualscroller?: DefaultPassThrough; directives?: { diff --git a/components/lib/tristatecheckbox/BaseTriStateCheckbox.vue b/components/lib/tristatecheckbox/BaseTriStateCheckbox.vue deleted file mode 100644 index 183901480..000000000 --- a/components/lib/tristatecheckbox/BaseTriStateCheckbox.vue +++ /dev/null @@ -1,58 +0,0 @@ - diff --git a/components/lib/tristatecheckbox/TriStateCheckbox.d.ts b/components/lib/tristatecheckbox/TriStateCheckbox.d.ts deleted file mode 100755 index c1a72df0e..000000000 --- a/components/lib/tristatecheckbox/TriStateCheckbox.d.ts +++ /dev/null @@ -1,273 +0,0 @@ -/** - * - * TriStateCheckbox is used to select either 'true', 'false' or 'null' as the value. - * - * [Live Demo](https://www.primevue.org/tristatecheckbox/) - * - * @module tristatecheckbox - * - */ -import { VNode } from 'vue'; -import { ComponentHooks } from '../basecomponent'; -import { PassThroughOptions } from '../passthrough'; -import { ClassComponent, GlobalComponentConstructor, Nullable, PassThrough } from '../ts-helpers'; - -export declare type TriStateCheckboxPassThroughOptionType = TriStateCheckboxPassThroughAttributes | ((options: TriStateCheckboxPassThroughMethodOptions) => TriStateCheckboxPassThroughAttributes | string) | string | null | undefined; - -/** - * Custom passthrough(pt) option method. - */ -export interface TriStateCheckboxPassThroughMethodOptions { - /** - * Defines instance. - */ - instance: any; - /** - * Defines valid properties. - */ - props: TriStateCheckboxProps; - /** - * Defines current inline state. - */ - state: TriStateCheckboxState; - /** - * Defines current options. - */ - context: TriStateCheckboxContext; - /** - * Defines valid attributes. - */ - attrs: any; - /** - * Defines parent options. - */ - parent: any; - /** - * Defines passthrough(pt) options in global config. - */ - global: object | undefined; -} - -/** - * Custom passthrough(pt) options. - * @see {@link TriStateCheckboxProps.pt} - */ -export interface TriStateCheckboxPassThroughOptions { - /** - * Used to pass attributes to the root's DOM element. - */ - root?: TriStateCheckboxPassThroughOptionType; - /** - * Used to pass attributes to the input's DOM element. - */ - input?: TriStateCheckboxPassThroughOptionType; - /** - * Used to pass attributes to the box's DOM element. - */ - box?: TriStateCheckboxPassThroughOptionType; - /** - * Used to pass attributes to the check icon's DOM element. - */ - checkIcon?: TriStateCheckboxPassThroughOptionType; - /** - * Used to pass attributes to the uncheck icon's DOM element. - */ - uncheckIcon?: TriStateCheckboxPassThroughOptionType; - /** - * Used to pass attributes to the nullable icon's DOM element. - */ - nullableIcon?: TriStateCheckboxPassThroughOptionType; - /** - * Used to pass attributes to the hidden value label's DOM element. - */ - hiddenValueLabel?: TriStateCheckboxPassThroughOptionType; - /** - * Used to manage all lifecycle hooks. - * @see {@link BaseComponent.ComponentHooks} - */ - hooks?: ComponentHooks; -} - -/** - * Custom passthrough attributes for each DOM elements - */ -export interface TriStateCheckboxPassThroughAttributes { - [key: string]: any; -} - -/** - * Defines current inline state in TriStateCheckbox component. - */ -export interface TriStateCheckboxState { - [key: string]: any; -} - -/** - * Defines current options in TriStateCheckbox component. - */ -export interface TriStateCheckboxContext { - /** - * Current active state as a boolean. - * @defaultValue false - */ - active: boolean; - /** - * Current disabled state as a boolean. - * @defaultValue false - */ - disabled: boolean; -} - -/** - * Defines valid properties in TriStateCheckbox component. - */ -export interface TriStateCheckboxProps { - /** - * Value of the component. - * @defaultValue null - */ - modelValue?: Nullable; - /** - * When present, it specifies that the component should have invalid state style. - * @defaultValue false - */ - invalid?: boolean | undefined; - /** - * When present, it specifies that the component should be disabled. - * @defaultValue false - */ - disabled?: boolean | undefined; - /** - * Specifies the input variant of the component. - * @defaultValue outlined - */ - variant?: 'outlined' | 'filled' | undefined; - /** - * When present, it specifies that an input field is read-only. - * @default false - */ - readonly?: boolean | undefined; - /** - * Index of the element in tabbing order. - */ - tabindex?: string | undefined; - /** - * Identifier of the underlying input element. - */ - inputId?: string | undefined; - /** - * Style class of the input field. - */ - inputClass?: object | undefined; - /** - * Inline style of the input field. - */ - inputStyle?: string | object | undefined; - /** - * Establishes relationships between the component and label(s) where its value should be one or more element IDs. - */ - ariaLabelledby?: string | undefined; - /** - * Establishes a string value that labels the component. - */ - ariaLabel?: string | undefined; - /** - * Used to pass attributes to DOM elements inside the component. - * @type {TriStateCheckboxPassThroughOptions} - */ - pt?: PassThrough; - /** - * Used to configure passthrough(pt) options of the component. - * @type {PassThroughOptions} - */ - ptOptions?: PassThroughOptions; - /** - * When enabled, it removes component related styles in the core. - * @defaultValue false - */ - unstyled?: boolean; -} - -/** - * Defines valid slots in TriStateCheckbox component. - */ -export interface TriStateCheckboxSlots { - /** - * Custom check icon template. - * @param {Object} scope - checkicon slot's params. - */ - checkicon(scope: { - /** - * Style class of the icon. - */ - class: string; - }): VNode[]; - /** - * Custom uncheck icon template. - * @param {Object} scope - uncheckicon slot's params. - */ - uncheckicon(scope: { - /** - * Style class of the icon. - */ - class: string; - }): VNode[]; - /** - * Custom nullable icon template. - * @param {Object} scope - nullableicon slot's params. - */ - nullableicon(scope: { - /** - * Style class of the icon. - */ - class: string; - }): VNode[]; -} - -/** - * Defines valid emits in TriStateCheckbox component. - */ -export interface TriStateCheckboxEmits { - /** - * Emitted when the value changes. - * @param {boolean|null|undefined} value - New value. - */ - 'update:modelValue'(value: Nullable): void; - /** - * Callback to invoke on value change. - * @param {Event} event - Browser event. - */ - change(event: Event): void; - /** - * Callback to invoke when the component receives focus. - * @param {Event} event - Browser event. - */ - focus(event: Event): void; - /** - * Callback to invoke when the component loses focus. - * @param {Event} event - Browser event. - */ - blur(event: Event): void; -} - -/** - * **PrimeVue - TriStateCheckbox** - * - * _TriStateCheckbox is used to select either 'true', 'false' or 'null' as the value._ - * - * [Live Demo](https://www.primevue.org/tristatecheckbox/) - * --- --- - * ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png) - * - * @group Component - * - */ -declare class TriStateCheckbox extends ClassComponent {} - -declare module 'vue' { - export interface GlobalComponents { - TriStateCheckbox: GlobalComponentConstructor; - } -} - -export default TriStateCheckbox; diff --git a/components/lib/tristatecheckbox/TriStateCheckbox.spec.js b/components/lib/tristatecheckbox/TriStateCheckbox.spec.js deleted file mode 100644 index 4a63a91b4..000000000 --- a/components/lib/tristatecheckbox/TriStateCheckbox.spec.js +++ /dev/null @@ -1,54 +0,0 @@ -import { mount } from '@vue/test-utils'; -import TriStateCheckbox from './TriStateCheckbox.vue'; - -let wrapper; -const modelValues = [true, false, null]; -const emittedResults = [false, null, true]; - -describe('TriStateCheckbox.vue', () => { - beforeEach(() => { - wrapper = mount(TriStateCheckbox); - }); - - it('When onBlur is triggered focused property should be false', async () => { - wrapper.vm.onBlur(); - - expect(wrapper.vm.focused).toBeFalsy(); - expect(wrapper.emitted().blur).toBeTruthy(); - }); -}); - -describe('UpdateModel method tests', () => { - beforeEach(() => { - wrapper = mount(TriStateCheckbox); - }); - - it('When disable props true change emit should not triggered', async () => { - await wrapper.setProps({ - disabled: true, - modelValue: null - }); - - await wrapper.trigger('change'); - - expect(wrapper.emitted()['change']).toBeFalsy(); - }); - - it('When disable props false updateModal should triggered emit', () => { - wrapper.vm.updateModel(); - - expect(wrapper.emitted()['update:modelValue']).toBeTruthy(); - }); - - modelValues.forEach((modelValue, index) => { - it('When modelValue changed update model emitted value should be change', async () => { - await wrapper.setProps({ - modelValue - }); - - wrapper.vm.updateModel(); - - expect(wrapper.emitted()['update:modelValue']).toEqual([[emittedResults[index]]]); - }); - }); -}); diff --git a/components/lib/tristatecheckbox/TriStateCheckbox.vue b/components/lib/tristatecheckbox/TriStateCheckbox.vue deleted file mode 100755 index d2416cafc..000000000 --- a/components/lib/tristatecheckbox/TriStateCheckbox.vue +++ /dev/null @@ -1,103 +0,0 @@ - - - diff --git a/components/lib/tristatecheckbox/package.json b/components/lib/tristatecheckbox/package.json deleted file mode 100644 index 15bb4dc68..000000000 --- a/components/lib/tristatecheckbox/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "main": "./tristatecheckbox.cjs.js", - "module": "./tristatecheckbox.esm.js", - "unpkg": "./tristatecheckbox.min.js", - "types": "./TriStateCheckbox.d.ts", - "browser": { - "./sfc": "./TriStateCheckbox.vue" - } -} diff --git a/components/lib/tristatecheckbox/style/TriStateCheckboxStyle.d.ts b/components/lib/tristatecheckbox/style/TriStateCheckboxStyle.d.ts deleted file mode 100644 index 965244856..000000000 --- a/components/lib/tristatecheckbox/style/TriStateCheckboxStyle.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { BaseStyle } from '../../base/style'; - -export interface TriStateCheckboxStyle extends BaseStyle {} diff --git a/components/lib/tristatecheckbox/style/TriStateCheckboxStyle.js b/components/lib/tristatecheckbox/style/TriStateCheckboxStyle.js deleted file mode 100644 index 2e628f15f..000000000 --- a/components/lib/tristatecheckbox/style/TriStateCheckboxStyle.js +++ /dev/null @@ -1,23 +0,0 @@ -import BaseStyle from 'primevue/base/style'; - -const classes = { - root: ({ instance, props }) => [ - 'p-tristatecheckbox p-checkbox p-component', - { - 'p-highlight': instance.active, - 'p-disabled': props.disabled, - 'p-invalid': props.invalid, - 'p-variant-filled': props.variant === 'filled' || instance.$primevue.config.inputStyle === 'filled' - } - ], - box: 'p-checkbox-box', - input: 'p-checkbox-input', - checkIcon: 'p-checkbox-icon', - uncheckIcon: 'p-checkbox-icon', - nullableIcon: 'p-checkbox-icon' -}; - -export default BaseStyle.extend({ - name: 'tristatecheckbox', - classes -}); diff --git a/components/lib/tristatecheckbox/style/package.json b/components/lib/tristatecheckbox/style/package.json deleted file mode 100644 index 80d509f69..000000000 --- a/components/lib/tristatecheckbox/style/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "main": "./tristatecheckboxstyle.cjs.js", - "module": "./tristatecheckboxstyle.esm.js", - "unpkg": "./tristatecheckboxstyle.min.js", - "types": "./TriStateCheckboxStyle.d.ts" -} diff --git a/doc/datatable/filter/AdvancedFilterDoc.vue b/doc/datatable/filter/AdvancedFilterDoc.vue index 06b892db5..498998c2c 100644 --- a/doc/datatable/filter/AdvancedFilterDoc.vue +++ b/doc/datatable/filter/AdvancedFilterDoc.vue @@ -110,7 +110,7 @@ @@ -251,7 +251,7 @@ export default { @@ -366,7 +366,7 @@ export default { @@ -573,7 +573,7 @@ export default { diff --git a/doc/datatable/filter/BasicFilterDoc.vue b/doc/datatable/filter/BasicFilterDoc.vue index d06ed9328..f6a305d9c 100644 --- a/doc/datatable/filter/BasicFilterDoc.vue +++ b/doc/datatable/filter/BasicFilterDoc.vue @@ -75,7 +75,7 @@ @@ -184,7 +184,7 @@ export default { @@ -260,7 +260,7 @@ export default { @@ -416,7 +416,7 @@ export default { diff --git a/doc/tristatecheckbox/AccessibilityDoc.vue b/doc/tristatecheckbox/AccessibilityDoc.vue deleted file mode 100644 index 425d9a531..000000000 --- a/doc/tristatecheckbox/AccessibilityDoc.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - diff --git a/doc/tristatecheckbox/BasicDoc.vue b/doc/tristatecheckbox/BasicDoc.vue deleted file mode 100644 index a57fe30db..000000000 --- a/doc/tristatecheckbox/BasicDoc.vue +++ /dev/null @@ -1,57 +0,0 @@ - - - diff --git a/doc/tristatecheckbox/DisabledDoc.vue b/doc/tristatecheckbox/DisabledDoc.vue deleted file mode 100644 index fedb70da3..000000000 --- a/doc/tristatecheckbox/DisabledDoc.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - diff --git a/doc/tristatecheckbox/FilledDoc.vue b/doc/tristatecheckbox/FilledDoc.vue deleted file mode 100644 index f08da174f..000000000 --- a/doc/tristatecheckbox/FilledDoc.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - diff --git a/doc/tristatecheckbox/ImportDoc.vue b/doc/tristatecheckbox/ImportDoc.vue deleted file mode 100644 index f35d92028..000000000 --- a/doc/tristatecheckbox/ImportDoc.vue +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/doc/tristatecheckbox/InvalidDoc.vue b/doc/tristatecheckbox/InvalidDoc.vue deleted file mode 100644 index 1d43ea1dc..000000000 --- a/doc/tristatecheckbox/InvalidDoc.vue +++ /dev/null @@ -1,57 +0,0 @@ - - - diff --git a/doc/tristatecheckbox/form/VeeValidateDoc.vue b/doc/tristatecheckbox/form/VeeValidateDoc.vue deleted file mode 100644 index 7f79f17eb..000000000 --- a/doc/tristatecheckbox/form/VeeValidateDoc.vue +++ /dev/null @@ -1,139 +0,0 @@ - - - diff --git a/doc/tristatecheckbox/pt/PTImage.vue b/doc/tristatecheckbox/pt/PTImage.vue deleted file mode 100644 index d12cded92..000000000 --- a/doc/tristatecheckbox/pt/PTImage.vue +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/doc/tristatecheckbox/pt/index.vue b/doc/tristatecheckbox/pt/index.vue deleted file mode 100644 index c57485885..000000000 --- a/doc/tristatecheckbox/pt/index.vue +++ /dev/null @@ -1,35 +0,0 @@ - - - diff --git a/doc/tristatecheckbox/theming/StyledDoc.vue b/doc/tristatecheckbox/theming/StyledDoc.vue deleted file mode 100644 index 0d9c102e5..000000000 --- a/doc/tristatecheckbox/theming/StyledDoc.vue +++ /dev/null @@ -1,33 +0,0 @@ - diff --git a/doc/tristatecheckbox/theming/TailwindDoc.vue b/doc/tristatecheckbox/theming/TailwindDoc.vue deleted file mode 100644 index fe4aadc26..000000000 --- a/doc/tristatecheckbox/theming/TailwindDoc.vue +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/doc/tristatecheckbox/theming/index.vue b/doc/tristatecheckbox/theming/index.vue deleted file mode 100644 index 7e563f0bb..000000000 --- a/doc/tristatecheckbox/theming/index.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - diff --git a/modules/nuxt-primevue/runtime/core/components/index.js b/modules/nuxt-primevue/runtime/core/components/index.js index daa1f3f80..0f0b7277f 100644 --- a/modules/nuxt-primevue/runtime/core/components/index.js +++ b/modules/nuxt-primevue/runtime/core/components/index.js @@ -27,8 +27,7 @@ const form = [ 'Slider', 'Textarea', 'ToggleButton', - 'TreeSelect', - 'TriStateCheckbox' + 'TreeSelect' ]; const button = ['Button', 'ButtonGroup', 'SpeedDial', 'SplitButton']; diff --git a/nuxt-vite.config.js b/nuxt-vite.config.js index 7ccacc070..dea41c71a 100644 --- a/nuxt-vite.config.js +++ b/nuxt-vite.config.js @@ -109,7 +109,6 @@ const STYLE_ALIAS = { 'primevue/tree/style': path.resolve(__dirname, './components/lib/tree/style/TreeStyle.js'), 'primevue/treeselect/style': path.resolve(__dirname, './components/lib/treeselect/style/TreeSelectStyle.js'), 'primevue/treetable/style': path.resolve(__dirname, './components/lib/treetable/style/TreeTableStyle.js'), - 'primevue/tristatecheckbox/style': path.resolve(__dirname, './components/lib/tristatecheckbox/style/TriStateCheckboxStyle.js'), 'primevue/virtualscroller/style': path.resolve(__dirname, './components/lib/virtualscroller/style/VirtualScrollerStyle.js') }; diff --git a/pages/tristatecheckbox/index.vue b/pages/tristatecheckbox/index.vue deleted file mode 100755 index e795e51fc..000000000 --- a/pages/tristatecheckbox/index.vue +++ /dev/null @@ -1,63 +0,0 @@ - - - diff --git a/rollup.config.js b/rollup.config.js index 58a6838cd..f705e2122 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -170,7 +170,6 @@ const CORE_STYLE_DEPENDENCIES = { 'primevue/tree/style': 'primevue.tree.style', 'primevue/treeselect/style': 'primevue.treeselect.style', 'primevue/treetable/style': 'primevue.treetable.style', - 'primevue/tristatecheckbox/style': 'primevue.tristatecheckbox.style', 'primevue/virtualscroller/style': 'primevue.virtualscroller.style' };