-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update rollup to avoid losing reactivity
- Loading branch information
Showing
16 changed files
with
80 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,6 @@ const form = useForm({ | |
url: 'artists/', | ||
}, | ||
}) | ||
console.log(form.fields.checkbox) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from './defaults' | ||
export * from './themes' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,30 @@ | ||
<script lang="ts"> | ||
import _ from 'lodash' | ||
import { OField, ORadio } from '@oruga-ui/oruga-next' | ||
import type { NormalizedRadioField } from '@fancy-crud/core' | ||
import type { PropType } from 'vue' | ||
import { useRadioField } from '@fancy-crud/vue' | ||
<template> | ||
<o-field v-bind="props.field.wrapper" :label="props.field.label" :variant="variant" :message="hintText"> | ||
<div :class="display"> | ||
<template v-for="([label, value], _index) in options" :key="_index"> | ||
<o-radio v-bind="props.field" v-model="modelValue" :name="nameIdentifier" :native-value="value"> | ||
{{ label }} | ||
</o-radio> | ||
</template> | ||
</div> | ||
</o-field> | ||
</template> | ||
|
||
export default defineComponent({ | ||
props: { | ||
formId: { | ||
type: Symbol, | ||
required: true, | ||
}, | ||
field: { | ||
type: Object as PropType<NormalizedRadioField>, | ||
required: true, | ||
}, | ||
}, | ||
<script lang="ts" setup> | ||
import { ORadio } from '@oruga-ui/oruga-next' | ||
import { useRadioField } from '@fancy-crud/vue' | ||
import type { NormalizedRadioField } from '@fancy-crud/vue' | ||
setup(props, { attrs, slots }) { | ||
const { vmodel, hasFieldErrors, hintText, inRowDisplay, options } = useRadioField(props) | ||
const props = defineProps<{ | ||
formId: symbol | ||
field: NormalizedRadioField | ||
}>() | ||
const nameIdentifier = Symbol(props.field.modelKey).toString() | ||
const nameIdentifier = Symbol(props.field.modelKey).toString() | ||
const variant = computed(() => hasFieldErrors.value ? 'danger' : '') | ||
const { modelValue, hasFieldErrors, hintText, inRowDisplay, options } = useRadioField(props) | ||
function renderOptions() { | ||
return options.value.map( | ||
([label, value]) => h( | ||
ORadio, { ...attrs, ...vmodel, name: nameIdentifier, nativeValue: value }, { | ||
default: () => String(label), | ||
...slots, | ||
}), | ||
) | ||
} | ||
const display = computed(() => inRowDisplay.value ? inRowDisplay.value : 'radio-group--cascade') | ||
return () => | ||
h(OField, { ...props.field.wrapper, label: props.field.label, message: hintText.value, variant: variant.value }, { | ||
default: () => h('div', { class: inRowDisplay }, | ||
renderOptions(), | ||
), | ||
}) | ||
}, | ||
}) | ||
const variant = computed(() => hasFieldErrors.value ? 'danger' : '') | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
const colors = require('tailwindcss/colors') | ||
import { blue, gray, red } from 'tailwindcss/colors' | ||
|
||
module.exports = { | ||
content: [ | ||
'./index.html', | ||
'./src/**/*.{vue,js,ts,jsx,tsx}', | ||
'./demo/**/*.{vue,js,ts,jsx,tsx}', | ||
], | ||
theme: { | ||
extend: {}, | ||
export const content = [ | ||
'./demo/**/*.{vue,js,ts,jsx,tsx}', | ||
'./index.html', | ||
'./src/**/*.{vue,js,ts,jsx,tsx}', | ||
'node_modules/@fancy-crud/vue/*.{js,css}', | ||
] | ||
export const theme = { | ||
extend: { | ||
colors: { | ||
primary: colors.blue, | ||
danger: colors.red, | ||
primary: blue, | ||
danger: red, | ||
inactive: gray, | ||
}, | ||
}, | ||
plugins: [ | ||
], | ||
} | ||
export const plugins = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
} | ||
}, | ||
"exclude": [ | ||
// "demo", | ||
"demo", | ||
"dist", | ||
"node_modules", | ||
"cypress", | ||
|
Oops, something went wrong.