diff --git a/cypress/component/modal.cy.ts b/cypress/component/modal.cy.ts index 98e421f302..01ee456ebd 100644 --- a/cypress/component/modal.cy.ts +++ b/cypress/component/modal.cy.ts @@ -1,11 +1,12 @@ -import { mount } from 'cypress/vue2' +import { mount } from 'cypress/vue' import NcModal from '../../src/components/NcModal/NcModal.vue' import type { Component } from 'vue' +import { h } from 'vue' describe('NcModal', () => { it('close button is visible when content is scrolled', () => { mount(NcModal, { - propsData: { + props: { show: true, size: 'small', name: 'Name', @@ -13,10 +14,10 @@ describe('NcModal', () => { slots: { // Create two div as children, first is 100vh = overflows the content, second just gets some data attribute so we can scroll into view default: { - render: (h) => + render: () => h('div', [ - h('div', { style: 'height: 100vh;' }), - h('div', { attrs: { 'data-cy': 'bottom' } }), + h('div', { style: { height: '100vh' } }), + h('div', { 'data-cy': 'bottom' }), ]), } as Component, }, diff --git a/cypress/component/richtext.cy.ts b/cypress/component/richtext.cy.ts index 519068d7b9..dbf9cc069e 100644 --- a/cypress/component/richtext.cy.ts +++ b/cypress/component/richtext.cy.ts @@ -1,7 +1,7 @@ // Markdown guide: https://www.markdownguide.org/basic-syntax/ // Reference tests: https://github.com/nextcloud-deps/CDMarkdownKit/tree/master/CDMarkdownKitTests -import { mount } from 'cypress/vue2' +import { mount } from 'cypress/vue' import NcRichText from '../../src/components/NcRichText/NcRichText.vue' describe('NcRichText', () => { @@ -18,7 +18,7 @@ describe('NcRichText', () => { ] mount(NcRichText, { - propsData: { + props: { text: testCases.map(i => i.input).join('\n'), useMarkdown: true, }, @@ -31,7 +31,7 @@ describe('NcRichText', () => { it('ignored heading (with hash (#) syntax padded to the text)', () => { mount(NcRichText, { - propsData: { + props: { text: '#heading', useMarkdown: true, }, @@ -42,7 +42,7 @@ describe('NcRichText', () => { it('heading 1 (with equal (=) syntax on the next line)', () => { mount(NcRichText, { - propsData: { + props: { text: 'heading 1\n==', useMarkdown: true, }, @@ -53,7 +53,7 @@ describe('NcRichText', () => { it('heading 2 (with dash (-) syntax on the next line)', () => { mount(NcRichText, { - propsData: { + props: { text: 'heading 2\n--', useMarkdown: true, }, @@ -66,7 +66,7 @@ describe('NcRichText', () => { describe('bold text', () => { it('bold text (single with asterisk syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: '**bold asterisk**', useMarkdown: true, }, @@ -77,7 +77,7 @@ describe('NcRichText', () => { it('bold text (single with underscore syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: '__bold underscore__', useMarkdown: true, }, @@ -89,7 +89,7 @@ describe('NcRichText', () => { it('bold text (several in line with different syntax)', () => { const outputs = ['bold underscore', 'bold asterisk'] mount(NcRichText, { - propsData: { + props: { text: 'normal text __bold underscore__ normal text **bold asterisk** normal text', useMarkdown: true, }, @@ -103,7 +103,7 @@ describe('NcRichText', () => { it('bold text (between normal texts with asterisk syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: 'text**bold**text', useMarkdown: true, }, @@ -114,7 +114,7 @@ describe('NcRichText', () => { it('ignored bold text (between normal texts with underscore syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: 'text__bold__text', useMarkdown: true, }, @@ -126,7 +126,7 @@ describe('NcRichText', () => { it('normal text (between bold texts with asterisk syntax)', () => { const outputs = ['bold asterisk', 'bold asterisk'] mount(NcRichText, { - propsData: { + props: { text: '**bold asterisk**normal text**bold asterisk**', useMarkdown: true, }, @@ -142,7 +142,7 @@ describe('NcRichText', () => { describe('italic text', () => { it('italic text (single with asterisk syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: '*italic asterisk*', useMarkdown: true, }, @@ -153,7 +153,7 @@ describe('NcRichText', () => { it('italic text (single with underscore syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: '_italic underscore_', useMarkdown: true, }, @@ -165,7 +165,7 @@ describe('NcRichText', () => { it('italic text (several in line with different syntax)', () => { const outputs = ['italic underscore', 'italic asterisk'] mount(NcRichText, { - propsData: { + props: { text: 'normal text _italic underscore_ normal text *italic asterisk* normal text', useMarkdown: true, }, @@ -179,7 +179,7 @@ describe('NcRichText', () => { it('italic text (between normal texts with asterisk syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: 'text*italic*text', useMarkdown: true, }, @@ -190,7 +190,7 @@ describe('NcRichText', () => { it('ignored italic text (between normal texts with underscore syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: 'text_italic_text', useMarkdown: true, }, @@ -202,7 +202,7 @@ describe('NcRichText', () => { it('normal text (between italic texts with asterisk syntax)', () => { const outputs = ['italic asterisk', 'italic asterisk'] mount(NcRichText, { - propsData: { + props: { text: '*italic asterisk*normal text*italic asterisk*', useMarkdown: true, }, @@ -218,7 +218,7 @@ describe('NcRichText', () => { describe('inline code', () => { it('inline code (single with backticks syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: 'normal text `inline code` normal text', useMarkdown: true, }, @@ -229,7 +229,7 @@ describe('NcRichText', () => { it('inline code (single with double backticks syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: 'normal text ``inline code`` normal text', useMarkdown: true, }, @@ -240,7 +240,7 @@ describe('NcRichText', () => { it('inline code (single with triple backticks syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: 'normal text ```inline code``` normal text', useMarkdown: true, }, @@ -252,7 +252,7 @@ describe('NcRichText', () => { it('inline code (several in line )', () => { const outputs = ['inline code 1', 'inline code 2'] mount(NcRichText, { - propsData: { + props: { text: 'normal text `inline code 1`normal text ``inline code 2`` normal text', useMarkdown: true, }, @@ -266,7 +266,7 @@ describe('NcRichText', () => { it('inline code (between normal texts)', () => { mount(NcRichText, { - propsData: { + props: { text: 'text`inline code`text', useMarkdown: true, }, @@ -279,7 +279,7 @@ describe('NcRichText', () => { describe('multiline code', () => { it('multiline code (with triple backticks syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: '```\nmultiline code\n```', useMarkdown: true, }, @@ -290,7 +290,7 @@ describe('NcRichText', () => { it('multiline code (ignored info)', () => { mount(NcRichText, { - propsData: { + props: { text: '```vue\nmultiline code\n```', useMarkdown: true, }, @@ -301,7 +301,7 @@ describe('NcRichText', () => { it('empty multiline code', () => { mount(NcRichText, { - propsData: { + props: { text: '``````', useMarkdown: true, }, @@ -312,7 +312,7 @@ describe('NcRichText', () => { it('empty multiline code (with new line)', () => { mount(NcRichText, { - propsData: { + props: { text: '```\n```', useMarkdown: true, }, @@ -323,7 +323,7 @@ describe('NcRichText', () => { it('multiline code (with several lines)', () => { mount(NcRichText, { - propsData: { + props: { text: '```\nline 1\nline 2\nline 3\n```', useMarkdown: true, }, @@ -335,7 +335,7 @@ describe('NcRichText', () => { it('multiline code (with ignored bold, italic, inline code syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: '```\n**bold text**\n_italic text_\n`inline code`\n```', useMarkdown: true, }, @@ -348,7 +348,7 @@ describe('NcRichText', () => { describe('blockquote', () => { it('blockquote (with greater then (gt >) syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: '> blockquote', useMarkdown: true, }, @@ -359,7 +359,7 @@ describe('NcRichText', () => { it('blockquote (with bold, italic text, inline code)', () => { mount(NcRichText, { - propsData: { + props: { text: '> blockquote **bold text** _italic text_ `inline code`', useMarkdown: true, }, @@ -373,7 +373,7 @@ describe('NcRichText', () => { it('blockquote (with several lines)', () => { mount(NcRichText, { - propsData: { + props: { text: '> line 1\nline 2\n line 3', useMarkdown: true, }, @@ -384,7 +384,7 @@ describe('NcRichText', () => { it('blockquote (divided from normal text)', () => { mount(NcRichText, { - propsData: { + props: { text: 'normal text\n> line 1\nline 2\n\nnormal text', useMarkdown: true, }, @@ -395,7 +395,7 @@ describe('NcRichText', () => { it('blockquote (with several paragraphs)', () => { mount(NcRichText, { - propsData: { + props: { text: '> line 1\n>\n> line 3', useMarkdown: true, }, @@ -406,7 +406,7 @@ describe('NcRichText', () => { it('blockquote (with nested blockquote)', () => { mount(NcRichText, { - propsData: { + props: { text: '> blockquote\n>\n>> nested blockquote', useMarkdown: true, }, @@ -425,7 +425,7 @@ describe('NcRichText', () => { ] mount(NcRichText, { - propsData: { + props: { text: testCases.map(i => i.input).join('\n'), useMarkdown: true, }, @@ -446,7 +446,7 @@ describe('NcRichText', () => { ] mount(NcRichText, { - propsData: { + props: { text: testCases.map(i => i.input).join('\n'), useMarkdown: true, }, @@ -467,7 +467,7 @@ describe('NcRichText', () => { ] mount(NcRichText, { - propsData: { + props: { text: testCases.map(i => i.input).join('\n'), useMarkdown: true, }, @@ -483,7 +483,7 @@ describe('NcRichText', () => { describe('dividers', () => { it('dividers (with different syntax)', () => { mount(NcRichText, { - propsData: { + props: { text: '***\n---\n___', useMarkdown: true, }, diff --git a/jest.config.js b/jest.config.js index 63fa487509..46cb34b6a5 100644 --- a/jest.config.js +++ b/jest.config.js @@ -21,6 +21,7 @@ */ const ignorePatterns = [ + '@ckpack/vue-color', 'ansi-regex', 'bail', 'char-regex', @@ -72,17 +73,6 @@ module.exports = { transformIgnorePatterns: [ '/node_modules/(?!(' + ignorePatterns.join('|') + '))', ], - // Temporarily exclude not yet migrated vue2 components - testPathIgnorePatterns: [ - "/node_modules/", - "/tests/unit/components/NcActions", - "/tests/unit/components/NcAppNavigation", - "/tests/unit/components/NcAppSidebar", - "/tests/unit/components/NcModal", - "/tests/unit/components/NcRichContenteditable", - "/tests/unit/components/NcRichText", - "/tests/unit/mixins/", - ], moduleNameMapper: { '\\.(css|scss)$': 'jest-transform-stub', diff --git a/package-lock.json b/package-lock.json index 537fc758ed..f34cfc17f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "9.0.0-alpha.0", "license": "AGPL-3.0", "dependencies": { + "@ckpack/vue-color": "^1.5.0", "@floating-ui/dom": "^1.1.0", "@nextcloud/auth": "^2.0.0", "@nextcloud/axios": "^2.0.0", @@ -46,7 +47,9 @@ "unist-builder": "^4.0.0", "unist-util-visit": "^5.0.0", "vue": "^3.3.4", - "vue-material-design-icons": "^5.1.2" + "vue-datepicker-next": "^1.0.3", + "vue-material-design-icons": "^5.1.2", + "vue-select": "^4.0.0-beta.6" }, "devDependencies": { "@babel/plugin-syntax-import-assertions": "^7.22.5", @@ -1818,6 +1821,21 @@ "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==" }, + "node_modules/@ckpack/vue-color": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@ckpack/vue-color/-/vue-color-1.5.0.tgz", + "integrity": "sha512-dj1zXVyay2m4LdlLJCQSdIS2FYwUl77BZqyKmUXiehyqjCP0bGYnPcL38lrShzYUc2FdkYQX8ANZZjRahd4PQw==", + "dependencies": { + "@ctrl/tinycolor": "^3.6.0", + "material-colors": "^1.2.6" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "vue": "^3.2.0" + } + }, "node_modules/@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", @@ -1940,6 +1958,14 @@ "postcss-selector-parser": "^6.0.13" } }, + "node_modules/@ctrl/tinycolor": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz", + "integrity": "sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA==", + "engines": { + "node": ">=10" + } + }, "node_modules/@cypress/request": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.0.tgz", @@ -9781,6 +9807,11 @@ "node": ">=12" } }, + "node_modules/date-format-parse": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/date-format-parse/-/date-format-parse-0.2.7.tgz", + "integrity": "sha512-/+lyMUKoRogMuTeOVii6lUwjbVlesN9YRYLzZT/g3TEZ3uD9QnpjResujeEqUW+OSNbT7T1+SYdyEkTcRv+KDQ==" + }, "node_modules/dayjs": { "version": "1.11.9", "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.9.tgz", @@ -17996,6 +18027,11 @@ "node": ">= 12" } }, + "node_modules/material-colors": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/material-colors/-/material-colors-1.2.6.tgz", + "integrity": "sha512-6qE4B9deFBIa9YSpOc9O0Sgc43zTeVYbgDT5veRKSlB2+ZuHNoVVxA1L/ckMUayV9Ay9y7Z/SZCLcGteW9i7bg==" + }, "node_modules/mathml-tag-names": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz", @@ -27467,6 +27503,18 @@ "integrity": "sha512-6bnLkn8O0JJyiFSIF0EfCogzeqNXpnjJ0vW/SZzNHfe6sPx30lTtTXlE5TFs2qhJlAtDFybStVNpL73cPe3OMQ==", "dev": true }, + "node_modules/vue-datepicker-next": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/vue-datepicker-next/-/vue-datepicker-next-1.0.3.tgz", + "integrity": "sha512-Brqjh896BJGVxP7d6tGDsPMu0SDAB8hAdtG7zWF8VIHJB21dk1VB9KgdajD9Y9uXbg+wHN0vmL7sbMPIyehQVQ==", + "dependencies": { + "date-format-parse": "^0.2.7", + "vue": "^3.0.0" + }, + "peerDependencies": { + "vue": "^3.0.0" + } + }, "node_modules/vue-docgen-api": { "version": "4.74.0", "resolved": "https://registry.npmjs.org/vue-docgen-api/-/vue-docgen-api-4.74.0.tgz", @@ -27789,6 +27837,14 @@ "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.6.5.tgz", "integrity": "sha512-VYXZQLtjuvKxxcshuRAwjHnciqZVoXAjTjcqBTz4rKc8qih9g9pI3hbDjmqXaHdgL3v8pV6P8Z335XvHzESxLQ==" }, + "node_modules/vue-select": { + "version": "4.0.0-beta.6", + "resolved": "https://registry.npmjs.org/vue-select/-/vue-select-4.0.0-beta.6.tgz", + "integrity": "sha512-K+zrNBSpwMPhAxYLTCl56gaMrWZGgayoWCLqe5rWwkB8aUbAUh7u6sXjIR7v4ckp2WKC7zEEUY27g6h1MRsIHw==", + "peerDependencies": { + "vue": "3.x" + } + }, "node_modules/vue-styleguidist": { "version": "4.72.4", "resolved": "https://registry.npmjs.org/vue-styleguidist/-/vue-styleguidist-4.72.4.tgz", diff --git a/package.json b/package.json index 36f4844a49..af14916ebf 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "dist" ], "dependencies": { + "@ckpack/vue-color": "^1.5.0", "@floating-ui/dom": "^1.1.0", "@nextcloud/auth": "^2.0.0", "@nextcloud/axios": "^2.0.0", @@ -96,7 +97,9 @@ "unist-builder": "^4.0.0", "unist-util-visit": "^5.0.0", "vue": "^3.3.4", - "vue-material-design-icons": "^5.1.2" + "vue-datepicker-next": "^1.0.3", + "vue-material-design-icons": "^5.1.2", + "vue-select": "^4.0.0-beta.6" }, "peerDependencies": { "vue": "^3.3.4" diff --git a/src/components/NcActionInput/NcActionInput.vue b/src/components/NcActionInput/NcActionInput.vue index 5d03f24f58..bc30e5cdcb 100644 --- a/src/components/NcActionInput/NcActionInput.vue +++ b/src/components/NcActionInput/NcActionInput.vue @@ -32,41 +32,41 @@ For the `NcSelect` component, all events will be passed through. Please see the ```vue @@ -161,7 +161,7 @@ export default { overflow-y: hidden !important; } -.slide-up-enter, +.slide-up-enter-from, .slide-up-leave-to { max-height: 0 !important; padding: 0 10px !important; diff --git a/src/components/NcAppSettingsDialog/NcAppSettingsDialog.vue b/src/components/NcAppSettingsDialog/NcAppSettingsDialog.vue index def3fe08f6..052fa8aa84 100644 --- a/src/components/NcAppSettingsDialog/NcAppSettingsDialog.vue +++ b/src/components/NcAppSettingsDialog/NcAppSettingsDialog.vue @@ -28,7 +28,7 @@ providing the section's name prop. You can put your settings within each