mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-01-15 09:24:34 +00:00
Add lint and lint:fix to scripts; fix some linting
This commit is contained in:
parent
017e840bbb
commit
25942d17b7
@ -2,7 +2,7 @@
|
||||
<div
|
||||
class="ds-avatar"
|
||||
:class="[
|
||||
`ds-size-${this.size}`,
|
||||
`ds-size-${size}`,
|
||||
online && 'is-online'
|
||||
]"
|
||||
:style="styles"
|
||||
|
||||
@ -28,10 +28,10 @@ export default {
|
||||
],
|
||||
|
||||
initials(name) {
|
||||
let un = name || 'Anonymus'
|
||||
let parts = un.split(/[ -]/)
|
||||
const un = name || 'Anonymus'
|
||||
const parts = un.split(/[ -]/)
|
||||
let initials = ''
|
||||
for (var i = 0; i < parts.length; i++) {
|
||||
for (let i = 0; i < parts.length; i++) {
|
||||
initials += parts[i].charAt(0)
|
||||
}
|
||||
if (initials.length > 3 && initials.search(/[A-Z]/) !== -1) {
|
||||
@ -45,19 +45,19 @@ export default {
|
||||
},
|
||||
lightenColor(hex, amt) {
|
||||
// From https://css-tricks.com/snippets/javascript/lighten-darken-color/
|
||||
var usePound = false
|
||||
let usePound = false
|
||||
if (hex[0] === '#') {
|
||||
hex = hex.slice(1)
|
||||
usePound = true
|
||||
}
|
||||
var num = parseInt(hex, 16)
|
||||
var r = (num >> 16) + amt
|
||||
const num = parseInt(hex, 16)
|
||||
let r = (num >> 16) + amt
|
||||
if (r > 255) r = 255
|
||||
else if (r < 0) r = 0
|
||||
var b = ((num >> 8) & 0x00ff) + amt
|
||||
let b = ((num >> 8) & 0x00ff) + amt
|
||||
if (b > 255) b = 255
|
||||
else if (b < 0) b = 0
|
||||
var g = (num & 0x0000ff) + amt
|
||||
let g = (num & 0x0000ff) + amt
|
||||
if (g > 255) g = 255
|
||||
else if (g < 0) g = 0
|
||||
return (usePound ? '#' : '') + (g | (b << 8) | (r << 16)).toString(16)
|
||||
|
||||
@ -9,18 +9,18 @@
|
||||
<div
|
||||
class="ds-copy-field-link">
|
||||
<ds-button
|
||||
@click="copy"
|
||||
icon="copy"
|
||||
color="soft"
|
||||
ghost/>
|
||||
ghost
|
||||
@click="copy"/>
|
||||
</div>
|
||||
<transition name="ds-copy-field-message">
|
||||
<div
|
||||
v-show="showMessage"
|
||||
class="ds-copy-field-message">
|
||||
<div
|
||||
class="ds-copy-field-message-text"
|
||||
ref="messageText"/>
|
||||
ref="messageText"
|
||||
class="ds-copy-field-message-text"/>
|
||||
</div>
|
||||
</transition>
|
||||
</component>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div
|
||||
class="ds-table-wrap"
|
||||
v-if="dataArray">
|
||||
v-if="dataArray"
|
||||
class="ds-table-wrap">
|
||||
<table
|
||||
cellpadding="0"
|
||||
cellspacing="0"
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<form
|
||||
class="ds-form"
|
||||
@submit.prevent="submit"
|
||||
novalidate="true"
|
||||
autocomplete="off">
|
||||
autocomplete="off"
|
||||
@submit.prevent="submit">
|
||||
<slot
|
||||
:errors="errors"
|
||||
:reset="reset"/>
|
||||
@ -24,7 +24,6 @@ Schema.warning = function() {}
|
||||
* @version 1.0.0
|
||||
*/
|
||||
export default defineComponent({
|
||||
emits: ['submit', 'update:modelValue', 'input-valid', 'reset'],
|
||||
name: 'DsForm',
|
||||
|
||||
provide() {
|
||||
@ -49,6 +48,7 @@ export default defineComponent({
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
emits: ['submit', 'update:modelValue', 'input-valid', 'reset'],
|
||||
|
||||
data() {
|
||||
return {
|
||||
@ -68,6 +68,10 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.newData = cloneDeep(this.modelValue)
|
||||
},
|
||||
|
||||
methods: {
|
||||
submit() {
|
||||
this.validate(() => {
|
||||
@ -148,10 +152,6 @@ export default defineComponent({
|
||||
this.$emit('reset', cloneDeep(this.modelValue))
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.newData = cloneDeep(this.modelValue)
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<transition name="ds-input-error">
|
||||
<div
|
||||
class="ds-input-error"
|
||||
v-show="!!error">
|
||||
v-show="!!error"
|
||||
class="ds-input-error">
|
||||
{{ error }}
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<label
|
||||
class="ds-input-label"
|
||||
v-show="!!label">
|
||||
v-show="!!label"
|
||||
class="ds-input-label">
|
||||
{{ label }}
|
||||
</label>
|
||||
</template>
|
||||
|
||||
@ -7,12 +7,13 @@
|
||||
<ds-icon :name="icon"/>
|
||||
</div>
|
||||
<component
|
||||
:is="tag"
|
||||
:id="id"
|
||||
class="ds-input"
|
||||
:class="[
|
||||
icon && `ds-input-has-icon`,
|
||||
iconRight && `ds-input-has-icon-right`
|
||||
]"
|
||||
:id="id"
|
||||
:name="name ? name : model"
|
||||
:type="type"
|
||||
:autofocus="autofocus"
|
||||
@ -20,12 +21,11 @@
|
||||
:tabindex="tabindex"
|
||||
:disabled="disabled"
|
||||
:readonly="readonly"
|
||||
:is="tag"
|
||||
:modelValue.prop="innerValue"
|
||||
@update:modelValue="handleInput"
|
||||
:model-value.prop="innerValue"
|
||||
:rows="type === 'textarea' ? rows : null"
|
||||
@update:model-value="handleInput"
|
||||
@focus="handleFocus"
|
||||
@blur="handleBlur"
|
||||
:rows="type === 'textarea' ? rows : null"
|
||||
v-html="type === 'textarea' ? innerValue : null"/>
|
||||
<div
|
||||
v-if="iconRight"
|
||||
|
||||
@ -6,18 +6,18 @@
|
||||
@keydown.self.down.prevent="pointerNext"
|
||||
@keydown.self.up.prevent="pointerPrev">
|
||||
<component
|
||||
:is="buttons ? 'ds-button' : 'div'"
|
||||
v-for="option in options"
|
||||
:key="option[labelProp] || option"
|
||||
class="ds-radio-option"
|
||||
:class="[
|
||||
isSelected(option) && `ds-radio-option-is-selected`
|
||||
]"
|
||||
v-for="option in options"
|
||||
@click="handleSelect(option)"
|
||||
:key="option[labelProp] || option"
|
||||
:is="buttons ? 'ds-button' : 'div'"
|
||||
:primary="buttons && isSelected(option)">
|
||||
:primary="buttons && isSelected(option)"
|
||||
@click="handleSelect(option)">
|
||||
<span
|
||||
class="ds-radio-option-mark"
|
||||
v-if="!buttons"/>
|
||||
v-if="!buttons"
|
||||
class="ds-radio-option-mark"/>
|
||||
<span class="ds-radio-option-label">
|
||||
<!-- @slot Slot to provide custom option items -->
|
||||
<slot
|
||||
@ -44,17 +44,11 @@ import DsFormItem from '@@/components/data-input/FormItem/FormItem.vue'
|
||||
*/
|
||||
export default defineComponent({
|
||||
name: 'DsRadio',
|
||||
mixins: [inputMixin, multiinputMixin],
|
||||
|
||||
components: {
|
||||
DsFormItem
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
pointer: 0
|
||||
}
|
||||
},
|
||||
mixins: [inputMixin, multiinputMixin],
|
||||
|
||||
props: {
|
||||
/**
|
||||
@ -82,6 +76,12 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
pointer: 0
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
pointerMax() {
|
||||
return this.options.length - 1
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<ds-form-item>
|
||||
<div
|
||||
v-click-outside="closeAndBlur"
|
||||
class="ds-select-wrap"
|
||||
:class="[
|
||||
isOpen && `ds-select-is-open`
|
||||
]"
|
||||
:tabindex="searchable ? -1 : tabindex"
|
||||
v-click-outside="closeAndBlur"
|
||||
@keydown.tab="closeAndBlur"
|
||||
@keydown.self.down.prevent="pointerNext"
|
||||
@keydown.self.up.prevent="pointerPrev"
|
||||
@ -19,43 +19,43 @@
|
||||
</div>
|
||||
<div
|
||||
class="ds-select"
|
||||
@click="openAndFocus"
|
||||
:class="[
|
||||
icon && `ds-select-has-icon`,
|
||||
iconRight && `ds-select-has-icon-right`,
|
||||
multiple && `ds-select-multiple`
|
||||
]">
|
||||
]"
|
||||
@click="openAndFocus">
|
||||
<div
|
||||
v-if="multiple"
|
||||
class="ds-selected-options">
|
||||
<div
|
||||
class="ds-selected-option"
|
||||
v-for="(value, index) in innerValue"
|
||||
:key="value[labelProp] || value">
|
||||
:key="value[labelProp] || value"
|
||||
class="ds-selected-option">
|
||||
<!-- @slot Slot to provide a custom selected option display -->
|
||||
<slot
|
||||
name="optionitem"
|
||||
:modelValue="value">
|
||||
:model-value="value">
|
||||
<ds-chip
|
||||
removable
|
||||
@remove="deselectOption(index)"
|
||||
color="primary"
|
||||
:size="size">
|
||||
:size="size"
|
||||
@remove="deselectOption(index)">
|
||||
{{ value[labelProp] || value }}
|
||||
</ds-chip>
|
||||
</slot>
|
||||
</div>
|
||||
<input
|
||||
:id="id"
|
||||
ref="search"
|
||||
v-model="searchString"
|
||||
class="ds-select-search"
|
||||
autocomplete="off"
|
||||
:id="id"
|
||||
:name="name ? name : model"
|
||||
:autofocus="autofocus"
|
||||
:placeholder="placeholder"
|
||||
:tabindex="tabindex"
|
||||
:disabled="disabled"
|
||||
v-model="searchString"
|
||||
@focus="openAndFocus"
|
||||
@keydown.tab="closeAndBlur"
|
||||
@keydown.delete.stop="deselectLastOption"
|
||||
@ -71,7 +71,7 @@
|
||||
<slot
|
||||
v-if="innerValue"
|
||||
name="value"
|
||||
:modelValue="innerValue">
|
||||
:model-value="innerValue">
|
||||
{{ innerValue[labelProp] || innerValue }}
|
||||
</slot>
|
||||
<div
|
||||
@ -82,16 +82,16 @@
|
||||
</div>
|
||||
<input
|
||||
v-if="!multiple"
|
||||
:id="id"
|
||||
ref="search"
|
||||
v-model="searchString"
|
||||
class="ds-select-search"
|
||||
autocomplete="off"
|
||||
:id="id"
|
||||
:name="name ? name : model"
|
||||
:autofocus="autofocus"
|
||||
:placeholder="placeholder"
|
||||
:tabindex="tabindex"
|
||||
:disabled="disabled"
|
||||
v-model="searchString"
|
||||
@focus="openAndFocus"
|
||||
@keydown.tab="closeAndBlur"
|
||||
@keydown.delete.stop="deselectLastOption"
|
||||
@ -102,29 +102,29 @@
|
||||
</div>
|
||||
<div class="ds-select-dropdown">
|
||||
<div
|
||||
class="ds-select-dropdown-message"
|
||||
v-if="!options || !options.length">
|
||||
v-if="!options || !options.length"
|
||||
class="ds-select-dropdown-message">
|
||||
{{ noOptionsAvailable }}
|
||||
</div>
|
||||
<div
|
||||
class="ds-select-dropdown-message"
|
||||
v-else-if="!filteredOptions.length">
|
||||
v-else-if="!filteredOptions.length"
|
||||
class="ds-select-dropdown-message">
|
||||
{{ noOptionsFound }} "{{ searchString }}"
|
||||
</div>
|
||||
<ul
|
||||
class="ds-select-options"
|
||||
v-else
|
||||
ref="options"
|
||||
v-else>
|
||||
class="ds-select-options">
|
||||
<li
|
||||
v-for="(option, index) in filteredOptions"
|
||||
:key="option[labelProp] || option"
|
||||
class="ds-select-option"
|
||||
:class="[
|
||||
isSelected(option) && `ds-select-option-is-selected`,
|
||||
pointer === index && `ds-select-option-hover`
|
||||
]"
|
||||
v-for="(option, index) in filteredOptions"
|
||||
@click="handleSelect(option)"
|
||||
@mouseover="setPointer(index)"
|
||||
:key="option[labelProp] || option">
|
||||
@mouseover="setPointer(index)">
|
||||
<!-- @slot Slot to provide custom option items -->
|
||||
<slot
|
||||
name="option"
|
||||
@ -165,9 +165,7 @@ import DsIcon from '@@/components/typography/Icon/Icon.vue'
|
||||
* @version 1.0.0
|
||||
*/
|
||||
export default defineComponent({
|
||||
emits: ['enter'],
|
||||
name: 'DsSelect',
|
||||
mixins: [inputMixin, multiinputMixin],
|
||||
|
||||
components: {
|
||||
DsFormItem,
|
||||
@ -178,14 +176,7 @@ export default defineComponent({
|
||||
directives: {
|
||||
ClickOutside
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
searchString: '',
|
||||
pointer: 0,
|
||||
isOpen: false
|
||||
}
|
||||
},
|
||||
mixins: [inputMixin, multiinputMixin],
|
||||
|
||||
props: {
|
||||
/**
|
||||
@ -285,6 +276,15 @@ export default defineComponent({
|
||||
default: 'No options found for:'
|
||||
}
|
||||
},
|
||||
emits: ['enter'],
|
||||
|
||||
data() {
|
||||
return {
|
||||
searchString: '',
|
||||
pointer: 0,
|
||||
isOpen: false
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
filteredOptions() {
|
||||
|
||||
@ -155,9 +155,9 @@ export default {
|
||||
}
|
||||
const validator = new Schema({ input: this.schema })
|
||||
// Prevent validator from printing to console
|
||||
// eslint-disable-next-line
|
||||
|
||||
const warn = console.warn;
|
||||
// eslint-disable-next-line
|
||||
|
||||
console.warn = () => {};
|
||||
validator.validate({ input: value }, errors => {
|
||||
if (errors) {
|
||||
@ -165,7 +165,7 @@ export default {
|
||||
} else {
|
||||
this.error = null
|
||||
}
|
||||
// eslint-disable-next-line
|
||||
|
||||
console.warn = warn;
|
||||
})
|
||||
},
|
||||
|
||||
@ -11,26 +11,26 @@
|
||||
space && `ds-card-space-${space}`
|
||||
]">
|
||||
<div
|
||||
class="ds-card-image"
|
||||
v-if="image || $slots.image">
|
||||
v-if="image || $slots.image"
|
||||
class="ds-card-image">
|
||||
<!-- @slot Content of the card's image -->
|
||||
<slot
|
||||
name="image"
|
||||
:image="image">
|
||||
<img
|
||||
:src="image"
|
||||
v-if="!error"
|
||||
:src="image"
|
||||
@error="onError" >
|
||||
</slot>
|
||||
</div>
|
||||
<div
|
||||
class="ds-card-icon"
|
||||
v-if="icon">
|
||||
v-if="icon"
|
||||
class="ds-card-icon">
|
||||
<ds-icon :name="icon"/>
|
||||
</div>
|
||||
<header
|
||||
class="ds-card-header"
|
||||
v-if="header || $slots.header">
|
||||
v-if="header || $slots.header"
|
||||
class="ds-card-header">
|
||||
<!-- @slot Content of the card's header -->
|
||||
<slot name="header">
|
||||
<ds-heading
|
||||
@ -44,8 +44,8 @@
|
||||
</template>
|
||||
</div>
|
||||
<footer
|
||||
class="ds-card-footer"
|
||||
v-if="$slots.footer">
|
||||
v-if="$slots.footer"
|
||||
class="ds-card-footer">
|
||||
<!-- @slot Content of the card's footer -->
|
||||
<slot name="footer"/>
|
||||
</footer>
|
||||
|
||||
@ -8,8 +8,8 @@
|
||||
appear>
|
||||
<div
|
||||
v-if="isOpen"
|
||||
class="ds-modal-backdrop"
|
||||
ref="backdrop"
|
||||
class="ds-modal-backdrop"
|
||||
@click="backdropHandler"
|
||||
>
|
||||
|
||||
@ -20,12 +20,12 @@
|
||||
appear>
|
||||
<ds-card
|
||||
v-if="isOpen"
|
||||
ref="modal"
|
||||
class="ds-modal"
|
||||
:class="[extended && 'ds-modal-extended']"
|
||||
:header="title"
|
||||
tableindex="-1"
|
||||
role="dialog"
|
||||
ref="modal"
|
||||
style="display: block"
|
||||
>
|
||||
<ds-button
|
||||
@ -39,14 +39,14 @@
|
||||
/>
|
||||
<!-- @slot Modal content -->
|
||||
<slot ref="modalBody"/>
|
||||
<template slot="footer">
|
||||
<template #footer>
|
||||
<!-- @slot Modal footer with action buttons -->
|
||||
<slot
|
||||
name="footer"
|
||||
:confirm="confirm"
|
||||
:cancel="cancel"
|
||||
:cancelLabel="cancelLabel"
|
||||
:confirmLabel="confirmLabel"
|
||||
:cancel-label="cancelLabel"
|
||||
:confirm-label="confirmLabel"
|
||||
>
|
||||
<ds-button
|
||||
ghost
|
||||
@ -74,9 +74,13 @@ import { defineComponent } from 'vue';
|
||||
* @version 1.0.0
|
||||
*/
|
||||
export default defineComponent({
|
||||
emits: ['opened', 'confirm', 'cancel', 'update:isOpen', 'close'],
|
||||
name: 'DsModal',
|
||||
|
||||
model: {
|
||||
prop: 'isOpen',
|
||||
event: 'update:isOpen'
|
||||
},
|
||||
|
||||
props: {
|
||||
/**
|
||||
* Modal title
|
||||
@ -121,11 +125,7 @@ export default defineComponent({
|
||||
default: 'Confirm'
|
||||
}
|
||||
},
|
||||
|
||||
model: {
|
||||
prop: 'isOpen',
|
||||
event: 'update:isOpen'
|
||||
},
|
||||
emits: ['opened', 'confirm', 'cancel', 'update:isOpen', 'close'],
|
||||
|
||||
watch: {
|
||||
isOpen: {
|
||||
@ -145,26 +145,6 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
confirm(type = 'confirm') {
|
||||
this.$emit('confirm')
|
||||
this.close(type)
|
||||
},
|
||||
cancel(type = 'cancel') {
|
||||
this.$emit('cancel')
|
||||
this.close(type)
|
||||
},
|
||||
close(type) {
|
||||
this.$emit('update:isOpen', false)
|
||||
this.$emit('close', type)
|
||||
},
|
||||
backdropHandler() {
|
||||
if (!this.force) {
|
||||
this.cancel('backdrop')
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
beforeCreate() {
|
||||
// create random key string
|
||||
this.key = Math.random()
|
||||
@ -187,6 +167,26 @@ export default defineComponent({
|
||||
this.$emit('opened')
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
confirm(type = 'confirm') {
|
||||
this.$emit('confirm')
|
||||
this.close(type)
|
||||
},
|
||||
cancel(type = 'cancel') {
|
||||
this.$emit('cancel')
|
||||
this.close(type)
|
||||
},
|
||||
close(type) {
|
||||
this.$emit('update:isOpen', false)
|
||||
this.$emit('close', type)
|
||||
},
|
||||
backdropHandler() {
|
||||
if (!this.force) {
|
||||
this.cancel('backdrop')
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
viewBox="0 0 50 50"
|
||||
class="ds-spinner"
|
||||
:class="[
|
||||
`ds-size-${this.size}`,
|
||||
`ds-size-${size}`,
|
||||
inverse && 'ds-spinner-inverse',
|
||||
primary && !inverse && `ds-spinner-primary`,
|
||||
secondary && !inverse && `ds-spinner-secondary`,
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<component
|
||||
@click.capture="handleClick"
|
||||
v-bind="bindings"
|
||||
:is="linkTag"
|
||||
class="ds-button"
|
||||
:class="[
|
||||
size && `ds-button-size-${size}`,
|
||||
@ -15,16 +16,15 @@
|
||||
right && `ds-button-right`
|
||||
]"
|
||||
:name="name"
|
||||
v-bind="bindings"
|
||||
:is="linkTag">
|
||||
@click.capture="handleClick">
|
||||
<div class="ds-button-wrap">
|
||||
<ds-icon
|
||||
v-if="icon"
|
||||
:name="icon"
|
||||
/>
|
||||
<span
|
||||
class="ds-button-text"
|
||||
v-if="$slots.default">
|
||||
v-if="$slots.default"
|
||||
class="ds-button-text">
|
||||
<slot />
|
||||
</span>
|
||||
</div>
|
||||
@ -43,7 +43,6 @@ import { defineComponent } from 'vue';
|
||||
* @version 1.0.0
|
||||
*/
|
||||
export default defineComponent({
|
||||
emits: ['click'],
|
||||
name: 'DsButton',
|
||||
|
||||
props: {
|
||||
@ -152,6 +151,7 @@ export default defineComponent({
|
||||
default: false
|
||||
}
|
||||
},
|
||||
emits: ['click'],
|
||||
|
||||
computed: {
|
||||
bindings() {
|
||||
|
||||
@ -35,7 +35,6 @@ import { defineComponent } from 'vue';
|
||||
* @version 1.0.0
|
||||
*/
|
||||
export default defineComponent({
|
||||
emits: ['navigate'],
|
||||
name: 'DsMenu',
|
||||
|
||||
provide() {
|
||||
@ -123,6 +122,7 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
},
|
||||
emits: ['navigate'],
|
||||
|
||||
computed: {},
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<li
|
||||
v-click-outside="handleClickOutside"
|
||||
class="ds-menu-item"
|
||||
:class="[
|
||||
`ds-menu-item-level-${level}`,
|
||||
@ -10,26 +11,25 @@
|
||||
@mouseover="handleMouseOver"
|
||||
@mouseout="handleMouseOut"
|
||||
@click.capture="handleClick"
|
||||
v-click-outside="handleClickOutside"
|
||||
>
|
||||
<component
|
||||
v-bind="bindings"
|
||||
:is="linkTag"
|
||||
v-if="route"
|
||||
ref="link"
|
||||
class="ds-menu-item-link"
|
||||
:class="[
|
||||
matcher && 'router-link-exact-active'
|
||||
]"
|
||||
v-bind="bindings"
|
||||
:exact="isExact"
|
||||
:is="linkTag"
|
||||
ref="link"
|
||||
>
|
||||
<slot>
|
||||
{{ name }}
|
||||
</slot>
|
||||
</component>
|
||||
<ul
|
||||
class="ds-menu-item-submenu"
|
||||
v-if="hasSubmenu"
|
||||
class="ds-menu-item-submenu"
|
||||
>
|
||||
<ds-menu-item
|
||||
v-for="child in route.children"
|
||||
@ -51,19 +51,18 @@ import ClickOutside from 'vue-click-outside'
|
||||
* @see DsMenu
|
||||
*/
|
||||
export default defineComponent({
|
||||
emits: ['click'],
|
||||
name: 'DsMenuItem',
|
||||
|
||||
directives: {
|
||||
ClickOutside
|
||||
},
|
||||
|
||||
inject: {
|
||||
$parentMenu: {
|
||||
default: null
|
||||
}
|
||||
},
|
||||
|
||||
directives: {
|
||||
ClickOutside
|
||||
},
|
||||
|
||||
props: {
|
||||
/**
|
||||
* The route to display
|
||||
@ -99,6 +98,7 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
},
|
||||
emits: ['click'],
|
||||
|
||||
data() {
|
||||
return {
|
||||
|
||||
@ -12,9 +12,9 @@
|
||||
<slot />
|
||||
<button
|
||||
v-if="removable"
|
||||
@click="remove"
|
||||
class="ds-chip-close"
|
||||
tabindex="-1"
|
||||
@click="remove"
|
||||
>
|
||||
<ds-icon name="close" />
|
||||
</button>
|
||||
@ -30,7 +30,6 @@ import { defineComponent } from 'vue';
|
||||
* @version 1.0.0
|
||||
*/
|
||||
export default defineComponent({
|
||||
emits: ['remove'],
|
||||
name: 'DsChip',
|
||||
|
||||
props: {
|
||||
@ -78,6 +77,7 @@ export default defineComponent({
|
||||
default: 'span'
|
||||
}
|
||||
},
|
||||
emits: ['remove'],
|
||||
|
||||
methods: {
|
||||
remove() {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<component
|
||||
class="ds-code"
|
||||
:is="inline ? 'code' : 'pre'"
|
||||
class="ds-code"
|
||||
:class="[
|
||||
inline && `ds-code-inline`
|
||||
]"
|
||||
|
||||
@ -6,8 +6,8 @@
|
||||
class="ds-icon"
|
||||
>
|
||||
<component
|
||||
v-if="svgComponent"
|
||||
:is="svgComponent"
|
||||
v-if="svgComponent"
|
||||
class="ds-icon-svg"
|
||||
/>
|
||||
</component>
|
||||
|
||||
@ -5,6 +5,8 @@
|
||||
"scripts": {
|
||||
"build": "nuxt build",
|
||||
"dev": "nuxt dev",
|
||||
"lint": "eslint .",
|
||||
"lint:fix": "eslint . --fix",
|
||||
"generate": "nuxt generate",
|
||||
"preview": "nuxt preview",
|
||||
"postinstall": "nuxt prepare"
|
||||
|
||||
@ -82,7 +82,7 @@ describe('actions', () => {
|
||||
|
||||
describe('client-side', () => {
|
||||
beforeEach(() => {
|
||||
process.server = false
|
||||
import.meta.server = false
|
||||
})
|
||||
|
||||
it('returns', async () => {
|
||||
@ -94,7 +94,7 @@ describe('actions', () => {
|
||||
|
||||
describe('server-side', () => {
|
||||
beforeEach(() => {
|
||||
process.server = true
|
||||
import.meta.server = true
|
||||
})
|
||||
|
||||
it('fetches the current user', async () => {
|
||||
@ -194,7 +194,7 @@ describe('actions', () => {
|
||||
let mutate
|
||||
|
||||
beforeEach(() => {
|
||||
mutate = jest.fn(() => Promise.reject('This error is expected.')) // eslint-disable-line prefer-promise-reject-errors
|
||||
mutate = jest.fn(() => Promise.reject('This error is expected.'))
|
||||
onLogin = jest.fn(() => Promise.resolve())
|
||||
const module = {
|
||||
app: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user