Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@long2x:registry=https://registry.npmjs.org/
//registry.npmjs.org/:_authToken=npm_g00FfnibcRgWLdMmVn6QzxMVpjpbyt3s6kG
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,27 @@
"./icons": {
"import": "./dist/icons.es.js",
"require": "./dist/icons.cjs.js",
"types": "./dist/src/components/icons/index.d.ts"
"types": "./dist/icons.d.ts"
},
"./form-controls": {
"import": "./dist/form-controls.es.js",
"require": "./dist/form-controls.cjs.js",
"types": "./dist/src/components/form-controls/index.d.ts"
"types": "./dist/form-controls.d.ts"
},
"./directives": {
"import": "./dist/directives.es.js",
"require": "./dist/directives.cjs.js",
"types": "./dist/src/directives/index.d.ts"
"types": "./dist/directives.d.ts"
},
"./helpers": {
"import": "./dist/helpers.es.js",
"require": "./dist/helpers.cjs.js",
"types": "./dist/src/helpers/index.d.ts"
"types": "./dist/helpers.d.ts"
},
"./plugins": {
"import": "./dist/plugins.es.js",
"require": "./dist/plugins.cjs.js",
"types": "./dist/src/plugins/index.d.ts"
"types": "./dist/plugins.d.ts"
},
"./style.css": {
"import": "./dist/style.css",
Expand Down
6 changes: 2 additions & 4 deletions src/components/charts/BaseChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ import {
toRaw,
watch,
} from 'vue'
import {
debounce,
chartHelper,
} from '@/helpers'

import { chartHelper, debounce } from '../../helpers'

type Gradients = {
y1: number
Expand Down
2 changes: 1 addition & 1 deletion src/components/form-controls/CCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,5 @@ async function onCheckHandle () {
</script>

<style lang="scss">
@import '@/styles/form-controls/c-checkbox.scss';
@import '../../styles/form-controls/c-checkbox.scss';
</style>
2 changes: 1 addition & 1 deletion src/components/form-controls/CCreditCardInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@ const onBlur = async () => {
</script>

<style lang="scss">
@import '@/styles/form-controls/c-input.scss';
@import '../../styles/form-controls/c-input.scss';
</style>
2 changes: 1 addition & 1 deletion src/components/form-controls/CDatetimeInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,5 @@ watch(() => props.modelValue, (val: unknown) => {
</script>

<style lang="scss" scoped>
@import '@/styles/form-controls/c-input.scss';
@import '../../styles/form-controls/c-input.scss';
</style>
4 changes: 2 additions & 2 deletions src/components/form-controls/CFileInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ import {
CErrorMessage,
CProgressBar,
} from '../ui'
import i18nPlugin from '@/plugins/i18n.plugin'
import { fileHelper } from '@/helpers'
import i18nPlugin from '../../plugins/i18n.plugin'
import { fileHelper } from '../../helpers'

const inputRef = ref<HTMLInputElement | null>(null)

Expand Down
2 changes: 1 addition & 1 deletion src/components/form-controls/CInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,5 @@ function onInput (payload: Event): void {
</script>

<style lang="scss" scoped>
@import '@/styles/form-controls/c-input.scss';
@import '../../styles/form-controls/c-input.scss';
</style>
4 changes: 2 additions & 2 deletions src/components/form-controls/CPhoneInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import {

import baseProps from './base-control-props'
import CInput from './CInput.vue'
import i18nPlugin from '@/plugins/i18n.plugin'
import i18nPlugin from '../../plugins/i18n.plugin'

const props = defineProps({
...baseProps,
Expand Down Expand Up @@ -135,5 +135,5 @@ watch(() => props.modelValue, val => {
</script>

<style lang="scss">
@import '@/styles/form-controls/c-input.scss';
@import '../../styles/form-controls/c-input.scss';
</style>
2 changes: 1 addition & 1 deletion src/components/form-controls/CRadio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@ const onClick = (): void => {
</script>

<style lang="scss">
@import '@/styles/form-controls/c-radio.scss';
@import '../../styles/form-controls/c-radio.scss';
</style>
4 changes: 2 additions & 2 deletions src/components/form-controls/CSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ import {
import ChevronDownIcon from '../icons/ChevronDownIcon.vue'

import baseProps from './base-control-props'
import type { CSelectOption } from '@/@types/cresh-ui'
import type { CSelectOption } from '../../@types'

const props = defineProps({
...baseProps,
Expand Down Expand Up @@ -157,5 +157,5 @@ const hasValueOrPlaceholder = computed(
</script>

<style lang="scss">
@import '@/styles/form-controls/c-select.scss';
@import '../../styles/form-controls/c-select.scss';
</style>
2 changes: 1 addition & 1 deletion src/components/form-controls/CTextarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,5 @@ const hasValueOrPlaceholder = computed(
</script>

<style lang="scss">
@import '@/styles/form-controls/c-input.scss';
@import '../../styles/form-controls/c-input.scss';
</style>
8 changes: 3 additions & 5 deletions src/components/ui/CAccordion.cy.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/// <reference types="Cypress" /><

import { mountCyComponent } from '@/helpers/vue-test-helper'
import {
CAccordion,
CAccordionItem,
} from '@/components'
import { mountCyComponent } from '../../helpers/vue-test-helper'
import CAccordion from './CAccordion.vue'
import CAccordionItem from './CAccordionItem.vue'

describe('<CAccordion />', () => {
beforeEach(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/ui/CAccordion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
reactive,
} from 'vue'

import type { AccordionType } from '@/@types/cresh-ui'
import type { AccordionType } from '../../@types/cresh-ui'

const props = defineProps({
selectedName: String,

Check warning on line 16 in src/components/ui/CAccordion.vue

View workflow job for this annotation

GitHub Actions / Lint + TypeCheck + Build

Prop 'selectedName' requires default value to be set
})

const Accordion = reactive<AccordionType>({
Expand All @@ -34,5 +34,5 @@
</script>

<style lang="scss">
@import '@/styles/ui/c-accordion.scss';
@import '../../styles/ui/c-accordion.scss';
</style>
7 changes: 3 additions & 4 deletions src/components/ui/CAccordionItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ import {
reactive,
ref,
} from 'vue'

import { ChevronDownIcon } from '@/components'
import type { AccordionType } from '@/@types/cresh-ui'
import ChevronDownIcon from '../icons/ChevronDownIcon.vue'
import type { AccordionType } from '../../@types/cresh-ui'

const accordion = reactive(inject('accordion') as AccordionType)
const selectedName = ref(inject('selected-name') as string | undefined)
Expand Down Expand Up @@ -92,5 +91,5 @@ function end(el: Element) {
</script>

<style lang="scss">
@import '@/styles/ui/c-accordion.scss';
@import '../../styles/ui/c-accordion.scss';
</style>
2 changes: 1 addition & 1 deletion src/components/ui/CAlert.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import CAlert from './CAlert.vue'
import {
$t,
mountCyComponent,
} from '@/helpers/vue-test-helper'
} from '../../helpers/vue-test-helper'

describe('<CAlert />', () => {
context('renders', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/CAlert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ defineProps({
</script>

<style lang="scss">
@import '@/styles/ui/c-alert.scss';
@import '../../styles/ui/c-alert.scss';
</style>
2 changes: 1 addition & 1 deletion src/components/ui/CButton.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import {
mountCyComponent,
} from '@/helpers/vue-test-helper'
} from '../../helpers/vue-test-helper'

describe('<CAlert />', () => {
it('renders', () => {
Expand Down Expand Up @@ -49,7 +49,7 @@
cy.get('.c-btn')
.trigger('click')

cy.vue().then((wrapper: any) => {

Check warning on line 52 in src/components/ui/CButton.cy.ts

View workflow job for this annotation

GitHub Actions / Lint + TypeCheck + Build

Unexpected any. Specify a different type
const emitted = wrapper.emitted()
expect(
emitted,
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/CButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,5 @@ export default defineComponent({
</script>

<style lang="scss">
@import '@/styles/ui/c-button.scss';
@import '../../styles/ui/c-button.scss';
</style>
2 changes: 1 addition & 1 deletion src/components/ui/CCard.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import CCard from './CCard.vue'

import {
mountCyComponent,
} from '@/helpers/vue-test-helper'
} from '../../helpers/vue-test-helper'

describe('<CCard />', () => {
it('renders', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/CCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ const hasHeaderSlot = computed(() => !!slots.header)
</script>

<style lang="scss">
@import '@/styles/ui/c-card.scss';
@import '../../styles/ui/c-card.scss';
</style>
2 changes: 1 addition & 1 deletion src/components/ui/CDocumentItem.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import {
mountCyComponent,
} from '@/helpers/vue-test-helper'
} from '../../helpers/vue-test-helper'

describe('<CDocumentItem />', () => {
it('renders', () => {
Expand Down Expand Up @@ -75,7 +75,7 @@
.first()
.trigger('click')

cy.vue().then((wrapper: any) => {

Check warning on line 78 in src/components/ui/CDocumentItem.cy.ts

View workflow job for this annotation

GitHub Actions / Lint + TypeCheck + Build

Unexpected any. Specify a different type
const emittedEvent = wrapper.emitted().upload[0][0]
expect(emittedEvent.label).to.equals('id card')
expect(emittedEvent.id)
Expand Down
13 changes: 5 additions & 8 deletions src/components/ui/CDocumentItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,10 @@ import {
} from 'vue'
import {
CDocumentItemType,
} from '@/@types/cresh-ui'

import {
CIcon,
} from '@/components'
import { uuidv4 } from '@/helpers'
import i18nPlugin from '@/plugins/i18n.plugin'
} from '../../@types/cresh-ui'
import CIcon from '../icons/CIcon.vue'
import { uuidv4 } from '../../helpers'
import i18nPlugin from '../../plugins/i18n.plugin'

type CDocumentItemAction =
'upload'
Expand Down Expand Up @@ -162,5 +159,5 @@ function actionTooltipTranslation(action: 'upload' | 'download') {
</script>

<style lang="scss">
@import '@/styles/ui/c-document-item.scss';
@import '../../styles/ui/c-document-item.scss';
</style>
2 changes: 1 addition & 1 deletion src/components/ui/CDocumentViewer.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import CDocumentViewer from './CDocumentViewer.vue'

import {
mountCyComponent,
} from '@/helpers/vue-test-helper'
} from '../../helpers/vue-test-helper'

describe('<CDocumentViewer />', () => {
it('renders', () => {
Expand Down
11 changes: 4 additions & 7 deletions src/components/ui/CDocumentViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,11 @@ import {
watch,
} from 'vue'

import type { CDocumentItemType } from '@/@types/cresh-ui'
import type { CDocumentItemType } from '../../@types/cresh-ui'

import i18n from '../../plugins/i18n.plugin'

import {
CModal,
CIcon,
} from '@/components'
import CModal from './CModal.vue'
import CIcon from '../icons/CIcon.vue'

const props = defineProps({
modelValue: {
Expand Down Expand Up @@ -179,5 +176,5 @@ watch(() => previewRef.value, val => {
</script>

<style lang="scss">
@import '@/styles/ui/c-document-viewer.scss';
@import '../../styles/ui/c-document-viewer.scss';
</style>
2 changes: 1 addition & 1 deletion src/components/ui/CDropdown.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import {
mountCyComponent,
} from '@/helpers/vue-test-helper'
} from '../../helpers/vue-test-helper'

const dropdownItems = [{
value: 'animal1',
Expand Down Expand Up @@ -79,7 +79,7 @@
.eq(0)
.trigger('click')

cy.vue().then((wrapper: any) => {

Check warning on line 82 in src/components/ui/CDropdown.cy.ts

View workflow job for this annotation

GitHub Actions / Lint + TypeCheck + Build

Unexpected any. Specify a different type
expect(wrapper.emitted().select)
const selectedItem = wrapper.emitted().select[0]
expect(selectedItem[0].value).to.eq(firstItem.value)
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/CDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -297,5 +297,5 @@ const hasContentSlot = computed(() => !!slots.content)
</script>

<style lang="scss">
@import '@/styles/ui/c-dropdown.scss';
@import '../../styles/ui/c-dropdown.scss';
</style>
4 changes: 2 additions & 2 deletions src/components/ui/CEmpty.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import { faker } from '@faker-js/faker/locale/fr'
import {
mountCyComponent,
} from '@/helpers/vue-test-helper'
} from '../../helpers/vue-test-helper'

import CEmpty from './CEmpty.vue'
import i18nPlugin from '@/plugins/i18n.plugin'
import i18nPlugin from '../../plugins/i18n.plugin'

describe('<CEmpty />', () => {
it('renders', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/ui/CErrorMessage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import CErrorMessage from './CErrorMessage.vue'

import {
mountCyComponent,
} from '@/helpers/vue-test-helper'
import i18nPlugin from '@/plugins/i18n.plugin'
} from '../../helpers/vue-test-helper'
import i18nPlugin from '../../plugins/i18n.plugin'

describe('<CErrorMessage />', () => {
it('renders', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/CErrorMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import {
useSlots,
} from 'vue'

import i18n from '@/plugins/i18n.plugin'
import i18n from '../../plugins/i18n.plugin'
import CAlert from './CAlert.vue'

const props = defineProps({
Expand Down
9 changes: 5 additions & 4 deletions src/components/ui/CFileUploadZone.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { mountCyComponent } from '@/helpers/vue-test-helper'
import { CFileUploadZone } from '@/components'
import i18nPlugin from '@/plugins/i18n.plugin'
import cypress from 'cypress'
import { mountCyComponent } from '../../helpers/vue-test-helper'
import i18nPlugin from '../../plugins/i18n.plugin'
import CFileUploadZone from './CFileUploadZone.vue'

describe('<CFileUploadZone />', () => {
it('should render', () => {
Expand Down Expand Up @@ -33,7 +34,7 @@ describe('<CFileUploadZone />', () => {

cy.get('input[name=fileUploadZoneInput]')
.selectFile({
contents: Cypress.Buffer.from('file contents'),
contents: cypress.Buffer.from('file contents'),
fileName: 'file.json',
}, { force: true })

Expand Down
15 changes: 6 additions & 9 deletions src/components/ui/CFileUploadZone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,12 @@ import {
computed,
} from 'vue'

import i18nPlugin from '@/plugins/i18n.plugin'
import i18nPlugin from '../../plugins/i18n.plugin'

import {
CIcon,
CSpinner,
CErrorMessage,
} from '@/components'

import { fileHelper } from '@/helpers'
import CIcon from '../icons/CIcon.vue'
import CSpinner from './CSpinner.vue'
import CErrorMessage from './CErrorMessage.vue'
import { fileHelper } from '../../helpers'

const cFileUploadZoneRef = ref<HTMLDivElement | null>(null)

Expand Down Expand Up @@ -202,5 +199,5 @@ function onDragleave () {
</script>

<style lang="scss" scoped>
@import '@/styles/ui/c-file-upload-zone.scss';
@import '../../styles/ui/c-file-upload-zone.scss';
</style>
Loading
Loading