Skip to content

Commit 1f51939

Browse files
committed
refactor: streamline imports and enhance component structure across various controls
1 parent 045ce43 commit 1f51939

File tree

8 files changed

+34
-56
lines changed

8 files changed

+34
-56
lines changed

src/controls/autocomplete.vue

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,22 @@
4848
</template>
4949

5050
<script lang="ts">
51-
import {
52-
ControlElement,
53-
JsonFormsRendererRegistryEntry,
54-
rankWith,
55-
isStringControl,
56-
and,
57-
hasOption,
58-
or,
59-
isEnumControl,
60-
} from '@jsonforms/core'
51+
import { ControlElement, JsonFormsRendererRegistryEntry, rankWith, isStringControl, and, hasOption } from '@jsonforms/core'
6152
import { defineComponent } from 'vue'
6253
import { rendererProps, RendererProps, useJsonFormsEnumControl } from '@jsonforms/vue'
6354
import { ControlWrapper } from '../common'
6455
import { determineClearValue } from '../utils'
6556
import { useAutocompleteControl } from '../composables'
57+
import { QItem, QItemLabel, QItemSection, QSelect } from 'quasar'
6658
6759
const controlRenderer = defineComponent({
6860
name: 'SuggestionControlRenderer',
6961
components: {
7062
ControlWrapper,
63+
QSelect,
64+
QItem,
65+
QItemSection,
66+
QItemLabel,
7167
},
7268
props: {
7369
...rendererProps<ControlElement>(),

src/controls/boolean.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import { defineComponent } from 'vue'
4141
import { rendererProps, useJsonFormsControl, RendererProps } from '@jsonforms/vue'
4242
import { ControlWrapper } from '../common'
4343
import { useBooleanControl } from '../composables'
44+
import { QCheckbox, QField } from 'quasar'
4445
4546
/**
4647
* BooleanControlRenderer Component
@@ -72,6 +73,8 @@ const controlRenderer = defineComponent({
7273
name: 'BooleanControlRenderer',
7374
components: {
7475
ControlWrapper,
76+
QField,
77+
QCheckbox,
7578
},
7679
props: {
7780
...rendererProps<ControlElement>(),

src/controls/date.vue

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,22 +82,14 @@
8282
</template>
8383

8484
<script lang="ts">
85-
import {
86-
ControlElement,
87-
JsonFormsRendererRegistryEntry,
88-
rankWith,
89-
isDateControl,
90-
or,
91-
isDateTimeControl,
92-
isTimeControl,
93-
} from '@jsonforms/core'
85+
import { ControlElement, JsonFormsRendererRegistryEntry, rankWith, isDateControl, or, isDateTimeControl, isTimeControl } from '@jsonforms/core'
9486
import dayjs from 'dayjs'
9587
import customParseFormat from 'dayjs/plugin/customParseFormat'
9688
import { defineComponent } from 'vue'
9789
import { rendererProps, useJsonFormsControl, RendererProps } from '@jsonforms/vue'
9890
import { ControlWrapper } from '../common'
9991
import { determineClearValue } from '../utils'
100-
import { QInput } from 'quasar'
92+
import { QCard, QDate, QIcon, QInput, QPopupProxy, QTime } from 'quasar'
10193
import { useDateControl } from '../composables'
10294
10395
dayjs.extend(customParseFormat)
@@ -107,6 +99,11 @@ const controlRenderer = defineComponent({
10799
components: {
108100
ControlWrapper,
109101
QInput,
102+
QIcon,
103+
QPopupProxy,
104+
QCard,
105+
QTime,
106+
QDate,
110107
},
111108
props: {
112109
...rendererProps<ControlElement>(),

src/controls/enum-and-suggestion.vue

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,29 +43,22 @@
4343
</template>
4444

4545
<script lang="ts">
46-
import {
47-
ControlElement,
48-
JsonFormsRendererRegistryEntry,
49-
rankWith,
50-
isStringControl,
51-
and,
52-
hasOption,
53-
or,
54-
isEnumControl,
55-
isPrimitiveArrayControl,
56-
} from '@jsonforms/core'
57-
import { defineComponent } from 'vue'
46+
import { and, ControlElement, hasOption, isEnumControl, isPrimitiveArrayControl, isStringControl, JsonFormsRendererRegistryEntry, or, rankWith } from '@jsonforms/core'
5847
import { rendererProps, RendererProps, useJsonFormsEnumControl } from '@jsonforms/vue'
48+
import { QItem, QItemLabel, QItemSection, QSelect } from 'quasar'
49+
import { defineComponent } from 'vue'
5950
import { ControlWrapper } from '../common'
60-
import { determineClearValue } from '../utils'
61-
import { QInput } from 'quasar'
6251
import { useEnumSuggestionControl } from '../composables'
52+
import { determineClearValue } from '../utils'
6353
6454
const controlRenderer = defineComponent({
6555
name: 'EnumAndSuggestionControlRenderer',
6656
components: {
6757
ControlWrapper,
68-
QInput,
58+
QSelect,
59+
QItem,
60+
QItemSection,
61+
QItemLabel,
6962
},
7063
props: {
7164
...rendererProps<ControlElement>(),

src/controls/password.vue

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,20 @@
4242
</template>
4343

4444
<script lang="ts">
45-
import {
46-
ControlElement,
47-
JsonFormsRendererRegistryEntry,
48-
rankWith,
49-
isStringControl,
50-
and,
51-
formatIs,
52-
} from '@jsonforms/core'
45+
import { ControlElement, JsonFormsRendererRegistryEntry, rankWith, isStringControl, and, formatIs } from '@jsonforms/core'
5346
import { defineComponent } from 'vue'
5447
import { rendererProps, useJsonFormsControl, RendererProps } from '@jsonforms/vue'
5548
import { ControlWrapper } from '../common'
5649
import { determineClearValue } from '../utils'
57-
import { QInput } from 'quasar'
50+
import { QIcon, QInput } from 'quasar'
5851
import { usePasswordControl } from '../composables'
5952
6053
const controlRenderer = defineComponent({
6154
name: 'PasswordControlRenderer',
6255
components: {
6356
ControlWrapper,
6457
QInput,
58+
QIcon,
6559
},
6660
props: {
6761
...rendererProps<ControlElement>(),

src/controls/radio-group.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<script lang="ts">
4444
import { and, ControlElement, isEnumControl, JsonFormsRendererRegistryEntry, optionIs, rankWith } from '@jsonforms/core'
4545
import { rendererProps, RendererProps, useJsonFormsEnumControl } from '@jsonforms/vue'
46-
import { QInput } from 'quasar'
46+
import { QField, QOptionGroup } from 'quasar'
4747
import { defineComponent } from 'vue'
4848
import { determineClearValue } from '../utils'
4949
import { ControlWrapper } from '../common'
@@ -53,7 +53,8 @@ const controlRenderer = defineComponent({
5353
name: 'RadioGroupControlRenderer',
5454
components: {
5555
ControlWrapper,
56-
QInput,
56+
QField,
57+
QOptionGroup,
5758
},
5859
props: {
5960
...rendererProps<ControlElement>(),

src/controls/slider.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,14 @@ import { defineComponent } from 'vue'
4646
import { rendererProps, useJsonFormsControl, type RendererProps } from '@jsonforms/vue'
4747
import { ControlWrapper } from '../common'
4848
import { determineClearValue } from '../utils'
49-
import { QSlider } from 'quasar'
49+
import { QField, QSlider } from 'quasar'
5050
import { useSliderControl } from '../composables'
5151
5252
const controlRenderer = defineComponent({
5353
name: 'slider-control-renderer',
5454
components: {
5555
ControlWrapper,
56+
QField,
5657
QSlider,
5758
},
5859
props: {

src/controls/textarea.vue

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,12 @@
3434
:counter="counter"
3535
stack-label
3636
outlined
37-
autogrowa
37+
autogrow
3838
)
3939
</template>
4040

4141
<script lang="ts">
42-
import {
43-
ControlElement,
44-
JsonFormsRendererRegistryEntry,
45-
rankWith,
46-
isStringControl,
47-
and,
48-
isMultiLineControl,
49-
} from '@jsonforms/core'
42+
import { ControlElement, JsonFormsRendererRegistryEntry, rankWith, isStringControl, and, isMultiLineControl } from '@jsonforms/core'
5043
import { defineComponent } from 'vue'
5144
import { rendererProps, useJsonFormsControl, RendererProps } from '@jsonforms/vue'
5245
import { ControlWrapper } from '../common'

0 commit comments

Comments
 (0)