Skip to content

Commit

Permalink
chore: enhance class names
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed May 26, 2023
1 parent 5385de7 commit 93dbaa0
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 28 deletions.
2 changes: 1 addition & 1 deletion packages/form/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "schemastery-vue",
"description": "Type driven schema validator",
"version": "5.0.2",
"version": "5.0.3",
"main": "src/index.ts",
"repository": {
"type": "git",
Expand Down
12 changes: 6 additions & 6 deletions packages/form/src/base.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<div class="k-schema-item" v-bind="$attrs">
<div class="actions"></div>
<div class="header">
<div class="left">
<div class="k-schema-main">
<div class="k-schema-left">
<h3>
<slot name="title"></slot>
<el-dropdown
Expand All @@ -21,7 +21,7 @@
</h3>
<slot name="desc"></slot>
</div>
<div class="right">
<div class="k-schema-right">
<template v-if="!collapsed">
<slot name="prefix"></slot>
<slot name="control"></slot>
Expand Down Expand Up @@ -124,7 +124,7 @@ if (import.meta.hot) {
background-color: var(--el-fill-color-light);
}
.header {
.k-schema-main {
display: flex;
flex-direction: row;
justify-content: space-between;
Expand Down Expand Up @@ -154,7 +154,7 @@ if (import.meta.hot) {
}
}
.left {
.k-schema-left {
.el-dropdown {
margin-left: 0.5rem;
margin-top: 2px;
Expand All @@ -168,7 +168,7 @@ if (import.meta.hot) {
}
}
.right {
.k-schema-right {
display: flex;
gap: 1rem;
flex: 1;
Expand Down
12 changes: 4 additions & 8 deletions packages/form/src/extensions/intersect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,15 @@
</k-schema>
</template>

<script lang="ts">
export default {
inheritAttrs: false,
}
</script>

<script lang="ts" setup>
import { PropType } from 'vue'
import { getChoices, Schema } from '../utils'
defineOptions({
inheritAttrs: false,
})
defineProps({
schema: {} as PropType<Schema>,
modelValue: {} as PropType<any>,
Expand Down
12 changes: 4 additions & 8 deletions packages/form/src/extensions/object.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,16 @@
</k-schema>
</template>

<script lang="ts">
export default {
inheritAttrs: false,
}
</script>

<script lang="ts" setup>
import { PropType, computed } from 'vue'
import { Schema, useConfig, useI18nText } from '../utils'
import SchemaBase from '../base.vue'
defineOptions({
inheritAttrs: false,
})
const props = defineProps({
schema: {} as PropType<Schema>,
modelValue: {} as PropType<any>,
Expand Down
4 changes: 2 additions & 2 deletions packages/form/src/extensions/table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ if (import.meta.hot) {
display: flex;
justify-content: center;
align-items: center;
color: var(--fg3);
color: var(--k-text-light);
transition: var(--color-transition);
cursor: pointer;
}
Expand All @@ -122,7 +122,7 @@ if (import.meta.hot) {
}
.inner:hover {
color: var(--fg1);
color: var(--k-text-dark);
}
.k-icon {
Expand Down
4 changes: 2 additions & 2 deletions packages/form/src/primitive.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ function onClickExternal(value: string) {
.k-schema-item {
.el-input {
.k-icon {
color: var(--fg3);
color: var(--k-text-light);
transition: var(--color-transition);
cursor: pointer;
&:hover {
color: var(--fg1);
color: var(--k-text-dark);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/form/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function useI18nText() {
const composer = useI18n()
const context: any = {}
return (message: string | Dict<string>) => {
if (!message || typeof message === 'string') return message
if (!message || typeof message === 'string') return message as string
const locales = fallbackWithLocaleChain(context, composer.fallbackLocale.value, composer.locale.value)
for (const locale of locales) {
if (locale in message) return message[locale]
Expand Down

0 comments on commit 93dbaa0

Please sign in to comment.