Skip to content

Commit

Permalink
Merge branch 'v4' into split-radio
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu committed Dec 15, 2023
2 parents 57ed81e + ee96fa9 commit b1f6848
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 22 deletions.
1 change: 1 addition & 0 deletions src/packages/__VUE/radio/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
display: flex;
align-items: center;
flex-shrink: 0;
cursor: pointer;

&:last-child {
margin-bottom: 0 !important;
Expand Down
6 changes: 3 additions & 3 deletions src/packages/__VUE/radio/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createComponent } from '@/packages/utils/create';
const { componentName, create } = createComponent('radio');
import { CheckNormal, CheckChecked } from '@nutui/icons-vue-taro';
import { pxCheck } from '@/packages/utils/pxCheck';
import { RADIO_KEY, RadioButtonSize } from './types';
import { RADIO_KEY, RadioShape, RadioButtonSize } from './types';
export default create({
components: {
Expand All @@ -17,8 +17,8 @@ export default create({
default: false
},
shape: {
type: String,
default: 'round' // button
type: String as PropType<RadioShape>,
default: 'round'
},
label: {
type: [String, Number, Boolean],
Expand Down
6 changes: 3 additions & 3 deletions src/packages/__VUE/radio/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createComponent } from '@/packages/utils/create';
const { componentName, create } = createComponent('radio');
import { CheckNormal, CheckChecked } from '@nutui/icons-vue';
import { pxCheck } from '@/packages/utils/pxCheck';
import { RADIO_KEY, RadioButtonSize } from './types';
import { RADIO_KEY, RadioShape, RadioButtonSize } from './types';
export default create({
components: {
Expand All @@ -17,8 +17,8 @@ export default create({
default: false
},
shape: {
type: String,
default: 'round' // button
type: String as PropType<RadioShape>,
default: 'round'
},
label: {
type: [String, Number, Boolean],
Expand Down
9 changes: 8 additions & 1 deletion src/packages/__VUE/radio/types.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
export const RADIO_KEY = Symbol('nut-radio');
export type RadioButtonSize = 'large' | 'normal' | 'small' | 'mini';

// Radio
export type RadioShape = 'round' | 'button';
export type RadioButtonSize = 'normal' | 'small' | 'mini';

// RadioGroup
export type RadioGroupTextPosition = 'right' | 'left';
export type RadioGroupDirection = 'vertical' | 'horizontal';
5 changes: 0 additions & 5 deletions src/packages/__VUE/radiogroup/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
.nut-radio {
margin-bottom: 5px;
}
&--vertical {
}
&--horizontal {
.nut-radio {
display: inline-flex;
Expand All @@ -14,9 +12,6 @@
margin: 0 6px;
}
}
&--button {
// ...
}
}
}
}
10 changes: 5 additions & 5 deletions src/packages/__VUE/radiogroup/index.taro.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { h, provide, computed, readonly, watch } from 'vue';
import { h, provide, computed, readonly, watch, PropType } from 'vue';
import { createComponent } from '@/packages/utils/create';
import { RADIO_KEY } from '../radio/types';
import { RADIO_KEY, RadioGroupTextPosition, RadioGroupDirection } from '../radio/types';
const { componentName, create } = createComponent('radio-group');
export default create({
Expand All @@ -11,11 +11,11 @@ export default create({
default: ''
},
direction: {
type: String,
default: 'vertical' //horizontal
type: String as PropType<RadioGroupDirection>,
default: 'vertical'
},
textPosition: {
type: String,
type: String as PropType<RadioGroupTextPosition>,
default: 'right'
}
},
Expand Down
10 changes: 5 additions & 5 deletions src/packages/__VUE/radiogroup/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { h, provide, computed, readonly, watch } from 'vue';
import { h, provide, computed, readonly, watch, PropType } from 'vue';
import { createComponent } from '@/packages/utils/create';
import { RADIO_KEY } from '../radio/types';
import { RADIO_KEY, RadioGroupTextPosition, RadioGroupDirection } from '../radio/types';
const { componentName, create } = createComponent('radio-group');
export default create({
Expand All @@ -11,11 +11,11 @@ export default create({
default: ''
},
direction: {
type: String,
default: 'vertical' //horizontal
type: String as PropType<RadioGroupDirection>,
default: 'vertical'
},
textPosition: {
type: String,
type: String as PropType<RadioGroupTextPosition>,
default: 'right'
}
},
Expand Down

0 comments on commit b1f6848

Please sign in to comment.