Refactor to Vue 3 recommended ESLint rules
These updates ensure better adherence to Vue 3 standards and improve overall code quality and readability. - Update ESLint configuration from Vue 2.x to Vue 3 rules. - Switch from "essential" to strictest "recommended" ESLint ruleset. - Adjust ESLint script to treat warnings as errors by using `--max-warnings=0` flag. This enforces stricter code quality controls provided by Vue 3 rules.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<template>
|
||||
<SizeObserver v-on:widthChanged="width = $event">
|
||||
<SizeObserver
|
||||
@width-changed="width = $event"
|
||||
>
|
||||
<transition name="fade-transition">
|
||||
<div v-if="width">
|
||||
<!-- <div id="responsivity-debug">
|
||||
@@ -14,21 +16,23 @@
|
||||
class="cards"
|
||||
>
|
||||
<CardListItem
|
||||
v-for="categoryId of categoryIds"
|
||||
:key="categoryId"
|
||||
class="card"
|
||||
v-bind:class="{
|
||||
:class="{
|
||||
'small-screen': width <= 500,
|
||||
'medium-screen': width > 500 && width < 750,
|
||||
'big-screen': width >= 750,
|
||||
}"
|
||||
v-for="categoryId of categoryIds"
|
||||
:data-category="categoryId"
|
||||
v-bind:key="categoryId"
|
||||
:categoryId="categoryId"
|
||||
:activeCategoryId="activeCategoryId"
|
||||
v-on:cardExpansionChanged="onSelected(categoryId, $event)"
|
||||
:category-id="categoryId"
|
||||
:active-category-id="activeCategoryId"
|
||||
@card-expansion-changed="onSelected(categoryId, $event)"
|
||||
/>
|
||||
</div>
|
||||
<div v-else class="error">Something went bad 😢</div>
|
||||
<div v-else class="error">
|
||||
Something went bad 😢
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
</SizeObserver>
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
<template>
|
||||
<div
|
||||
ref="cardElement"
|
||||
class="card"
|
||||
v-on:click="isExpanded = !isExpanded"
|
||||
v-bind:class="{
|
||||
:class="{
|
||||
'is-collapsed': !isExpanded,
|
||||
'is-inactive': activeCategoryId && activeCategoryId != categoryId,
|
||||
'is-expanded': isExpanded,
|
||||
}"
|
||||
ref="cardElement">
|
||||
@click="isExpanded = !isExpanded"
|
||||
>
|
||||
<div class="card__inner">
|
||||
<!-- Title -->
|
||||
<span
|
||||
v-if="cardTitle.length > 0"
|
||||
class="card__inner__title"
|
||||
v-if="cardTitle && cardTitle.length > 0">
|
||||
<span>{{cardTitle}}</span>
|
||||
>
|
||||
<span>{{ cardTitle }}</span>
|
||||
</span>
|
||||
<span v-else>Oh no 😢</span>
|
||||
<!-- Expand icon -->
|
||||
@@ -24,17 +26,17 @@
|
||||
<!-- Indeterminate and full states -->
|
||||
<CardSelectionIndicator
|
||||
class="card__inner__selection_indicator"
|
||||
:categoryId="categoryId"
|
||||
:category-id="categoryId"
|
||||
/>
|
||||
</div>
|
||||
<div class="card__expander" v-on:click.stop>
|
||||
<div class="card__expander" @click.stop>
|
||||
<div class="card__expander__content">
|
||||
<ScriptsTree :categoryId="categoryId" />
|
||||
<ScriptsTree :category-id="categoryId" />
|
||||
</div>
|
||||
<div class="card__expander__close-button">
|
||||
<AppIcon
|
||||
icon="xmark"
|
||||
v-on:click="collapse()"
|
||||
@click="collapse()"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<div>
|
||||
<AppIcon
|
||||
icon="battery-half"
|
||||
v-if="isAnyChildSelected && !areAllChildrenSelected"
|
||||
icon="battery-half"
|
||||
/>
|
||||
<AppIcon
|
||||
icon="battery-full"
|
||||
v-if="areAllChildrenSelected"
|
||||
icon="battery-full"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -10,13 +10,14 @@
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div v-else> <!-- Searching -->
|
||||
<div v-else>
|
||||
<!-- Searching -->
|
||||
<div class="search">
|
||||
<div class="search__query">
|
||||
<div>Searching for "{{ trimmedSearchQuery }}"</div>
|
||||
<div
|
||||
class="search__query__close-button"
|
||||
v-on:click="clearSearchQuery()"
|
||||
@click="clearSearchQuery()"
|
||||
>
|
||||
<AppIcon icon="xmark" />
|
||||
</div>
|
||||
|
||||
@@ -6,22 +6,26 @@
|
||||
</div>
|
||||
<ToggleDocumentationButton
|
||||
v-if="docs && docs.length > 0"
|
||||
v-on:show="isExpanded = true"
|
||||
v-on:hide="isExpanded = false"
|
||||
@show="isExpanded = true"
|
||||
@hide="isExpanded = false"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
v-if="docs && docs.length > 0 && isExpanded"
|
||||
class="docs"
|
||||
v-bind:class="{ 'docs-expanded': isExpanded, 'docs-collapsed': !isExpanded }"
|
||||
:class="{
|
||||
'docs-expanded': isExpanded,
|
||||
'docs-collapsed': !isExpanded,
|
||||
}"
|
||||
>
|
||||
<DocumentationText
|
||||
:docs="docs"
|
||||
class="text"
|
||||
v-bind:class="{
|
||||
:class="{
|
||||
expanded: isExpanded,
|
||||
collapsed: !isExpanded,
|
||||
}" />
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<template>
|
||||
<!-- eslint-disable vue/no-v-html -->
|
||||
<div
|
||||
class="documentation-text"
|
||||
@click.stop
|
||||
v-html="renderedText"
|
||||
v-on:click.stop
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<a
|
||||
class="button"
|
||||
target="_blank"
|
||||
v-bind:class="{ 'button-on': isOn }"
|
||||
v-on:click.stop
|
||||
v-on:click="toggle()"
|
||||
:class="{ 'button-on': isOn }"
|
||||
@click.stop
|
||||
@click="toggle()"
|
||||
>
|
||||
<AppIcon icon="circle-info" />
|
||||
</a>
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
<template>
|
||||
<DocumentableNode :docs="nodeMetadata.docs">
|
||||
<div id="node">
|
||||
<div class="item text">{{ nodeMetadata.text }}</div>
|
||||
<div class="item text">
|
||||
{{ nodeMetadata.text }}
|
||||
</div>
|
||||
<RevertToggle
|
||||
class="item"
|
||||
v-if="nodeMetadata.isReversible"
|
||||
:node="nodeMetadata" />
|
||||
class="item"
|
||||
:node="nodeMetadata"
|
||||
/>
|
||||
</div>
|
||||
</DocumentableNode>
|
||||
</template>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<ToggleSwitch
|
||||
v-model="isReverted"
|
||||
:stopClickPropagation="true"
|
||||
:stop-click-propagation="true"
|
||||
:label="'revert'"
|
||||
/>
|
||||
</template>
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
@click="handleClickPropagation"
|
||||
>
|
||||
<input
|
||||
v-model="isChecked"
|
||||
type="checkbox"
|
||||
class="toggle-input"
|
||||
v-model="isChecked"
|
||||
>
|
||||
<div class="toggle-animation">
|
||||
<span class="label-off">{{ label }}</span>
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
<span id="container">
|
||||
<span v-if="initialNodes.length">
|
||||
<TreeView
|
||||
:initialNodes="initialNodes"
|
||||
:selectedLeafNodeIds="selectedScriptNodeIds"
|
||||
:latestFilterEvent="latestFilterEvent"
|
||||
@nodeStateChanged="handleNodeChangedEvent($event)"
|
||||
:initial-nodes="initialNodes"
|
||||
:selected-leaf-node-ids="selectedScriptNodeIds"
|
||||
:latest-filter-event="latestFilterEvent"
|
||||
@node-state-changed="handleNodeChangedEvent($event)"
|
||||
>
|
||||
<template v-slot:node-content="{ nodeMetadata }">
|
||||
<NodeContent :nodeMetadata="nodeMetadata" />
|
||||
<template #node-content="{ nodeMetadata }">
|
||||
<NodeContent :node-metadata="nodeMetadata" />
|
||||
</template>
|
||||
</TreeView>
|
||||
</span>
|
||||
@@ -28,16 +28,16 @@ import { TreeNodeStateChangedEmittedEvent } from './TreeView/Bindings/TreeNodeSt
|
||||
import { useSelectedScriptNodeIds } from './TreeViewAdapter/UseSelectedScriptNodeIds';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
TreeView,
|
||||
NodeContent,
|
||||
},
|
||||
props: {
|
||||
categoryId: {
|
||||
type: [Number],
|
||||
default: undefined,
|
||||
},
|
||||
},
|
||||
components: {
|
||||
TreeView,
|
||||
NodeContent,
|
||||
},
|
||||
setup(props) {
|
||||
const useUserCollectionStateHook = injectKey((keys) => keys.useUserSelectionState);
|
||||
const { selectedScriptNodeIds } = useSelectedScriptNodeIds(useUserCollectionStateHook);
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
<div class="wrapper">
|
||||
<div
|
||||
class="expansible-node"
|
||||
@click="toggleCheck"
|
||||
:style="{
|
||||
'padding-left': `${currentNode.hierarchy.depthInTree * 24}px`,
|
||||
}">
|
||||
}"
|
||||
@click="toggleCheck"
|
||||
>
|
||||
<div
|
||||
class="expand-collapse-arrow"
|
||||
:class="{
|
||||
@@ -15,10 +16,10 @@
|
||||
@click.stop="toggleExpand"
|
||||
/>
|
||||
<LeafTreeNode
|
||||
:nodeId="nodeId"
|
||||
:treeRoot="treeRoot"
|
||||
:node-id="nodeId"
|
||||
:tree-root="treeRoot"
|
||||
>
|
||||
<template v-slot:node-content="slotProps">
|
||||
<template #node-content="slotProps">
|
||||
<slot name="node-content" v-bind="slotProps" />
|
||||
</template>
|
||||
</LeafTreeNode>
|
||||
@@ -32,11 +33,11 @@
|
||||
<HierarchicalTreeNode
|
||||
v-for="id in renderedNodeIds"
|
||||
:key="id"
|
||||
:nodeId="id"
|
||||
:treeRoot="treeRoot"
|
||||
:renderingStrategy="renderingStrategy"
|
||||
:node-id="id"
|
||||
:tree-root="treeRoot"
|
||||
:rendering-strategy="renderingStrategy"
|
||||
>
|
||||
<template v-slot:node-content="slotProps">
|
||||
<template #node-content="slotProps">
|
||||
<slot name="node-content" v-bind="slotProps" />
|
||||
</template>
|
||||
</HierarchicalTreeNode>
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
>
|
||||
<div
|
||||
class="node focusable"
|
||||
@focus="onNodeFocus"
|
||||
tabindex="-1"
|
||||
:class="{
|
||||
'keyboard-focus': hasKeyboardFocus,
|
||||
}"
|
||||
tabindex="-1"
|
||||
@focus="onNodeFocus"
|
||||
>
|
||||
<div
|
||||
class="checkbox"
|
||||
@@ -22,7 +22,7 @@
|
||||
<div class="content">
|
||||
<slot
|
||||
name="node-content"
|
||||
:nodeMetadata="currentNode.metadata"
|
||||
:node-metadata="currentNode.metadata"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
<HierarchicalTreeNode
|
||||
v-for="nodeId in renderedNodeIds"
|
||||
:key="nodeId"
|
||||
:nodeId="nodeId"
|
||||
:treeRoot="treeRoot"
|
||||
:renderingStrategy="renderingStrategy"
|
||||
:node-id="nodeId"
|
||||
:tree-root="treeRoot"
|
||||
:rendering-strategy="renderingStrategy"
|
||||
>
|
||||
<template v-slot:node-content="slotProps">
|
||||
<template #node-content="slotProps">
|
||||
<slot v-bind="slotProps" />
|
||||
</template>
|
||||
</HierarchicalTreeNode>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div
|
||||
class="tree"
|
||||
ref="treeContainerElement"
|
||||
class="tree"
|
||||
>
|
||||
<TreeRoot :treeRoot="tree" :renderingStrategy="nodeRenderingScheduler">
|
||||
<template v-slot="slotProps">
|
||||
<TreeRoot :tree-root="tree" :rendering-strategy="nodeRenderingScheduler">
|
||||
<template #default="slotProps">
|
||||
<slot name="node-content" v-bind="slotProps" />
|
||||
</template>
|
||||
</TreeRoot>
|
||||
@@ -34,11 +34,6 @@ export default defineComponent({
|
||||
components: {
|
||||
TreeRoot,
|
||||
},
|
||||
emits: {
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
nodeStateChanged: (node: TreeNodeStateChangedEmittedEvent) => true,
|
||||
/* eslint-enable @typescript-eslint/no-unused-vars */
|
||||
},
|
||||
props: {
|
||||
initialNodes: {
|
||||
type: Array as PropType<readonly TreeInputNodeData[]>,
|
||||
@@ -53,6 +48,11 @@ export default defineComponent({
|
||||
default: () => [],
|
||||
},
|
||||
},
|
||||
emits: {
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
nodeStateChanged: (node: TreeNodeStateChangedEmittedEvent) => true,
|
||||
/* eslint-enable @typescript-eslint/no-unused-vars */
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const treeContainerElement = shallowRef<HTMLElement | undefined>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user