Major overhaul to the theme and now functioning.
This commit is contained in:
1 parent
5823ca3c39
commit
a475dfeab6
5218 files changed
+1643729
-13229
No files matched your search
Generated
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
.v-radio-group > .v-input__control {
|
||||
flex-direction: column;
|
||||
}
|
||||
.v-radio-group > .v-input__control > .v-label {
|
||||
margin-inline-start: 16px;
|
||||
}
|
||||
.v-radio-group > .v-input__control > .v-label + .v-selection-control-group {
|
||||
padding-inline-start: 6px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
.v-radio-group .v-input__details {
|
||||
padding-inline: 16px;
|
||||
}
|
||||
Generated
Vendored
+1593
File diff suppressed because it is too large.
Load diff
Generated
Vendored
+103
@@ -0,0 +1,103 @@
|
||||
import { Fragment as _Fragment, createVNode as _createVNode, mergeProps as _mergeProps, createElementVNode as _createElementVNode } from "vue";
|
||||
// Styles
|
||||
import "./VRadioGroup.css";
|
||||
|
||||
// Components
|
||||
import { makeVInputProps, VInput } from "../VInput/VInput.js";
|
||||
import { VLabel } from "../VLabel/index.js";
|
||||
import { VSelectionControl } from "../VSelectionControl/index.js";
|
||||
import { makeSelectionControlGroupProps, VSelectionControlGroup } from "../VSelectionControlGroup/VSelectionControlGroup.js"; // Composables
|
||||
import { forwardRefs } from "../../composables/forwardRefs.js";
|
||||
import { IconValue } from "../../composables/icons.js";
|
||||
import { useProxiedModel } from "../../composables/proxiedModel.js"; // Utilities
|
||||
import { computed, ref, useId } from 'vue';
|
||||
import { filterInputAttrs, genericComponent, omit, propsFactory, useRender } from "../../util/index.js"; // Types
|
||||
export const makeVRadioGroupProps = propsFactory({
|
||||
height: {
|
||||
type: [Number, String],
|
||||
default: 'auto'
|
||||
},
|
||||
...makeVInputProps(),
|
||||
...omit(makeSelectionControlGroupProps(), ['multiple']),
|
||||
trueIcon: {
|
||||
type: IconValue,
|
||||
default: '$radioOn'
|
||||
},
|
||||
falseIcon: {
|
||||
type: IconValue,
|
||||
default: '$radioOff'
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: 'radio'
|
||||
}
|
||||
}, 'VRadioGroup');
|
||||
export const VRadioGroup = genericComponent()({
|
||||
name: 'VRadioGroup',
|
||||
inheritAttrs: false,
|
||||
props: makeVRadioGroupProps(),
|
||||
emits: {
|
||||
'update:modelValue': value => true
|
||||
},
|
||||
setup(props, _ref) {
|
||||
let {
|
||||
attrs,
|
||||
slots
|
||||
} = _ref;
|
||||
const uid = useId();
|
||||
const id = computed(() => props.id || `radio-group-${uid}`);
|
||||
const model = useProxiedModel(props, 'modelValue');
|
||||
const inputRef = ref();
|
||||
useRender(() => {
|
||||
const [rootAttrs, controlAttrs] = filterInputAttrs(attrs);
|
||||
const inputProps = VInput.filterProps(props);
|
||||
const controlProps = VSelectionControl.filterProps(props);
|
||||
const label = slots.label ? slots.label({
|
||||
label: props.label,
|
||||
props: {
|
||||
for: id.value
|
||||
}
|
||||
}) : props.label;
|
||||
return _createVNode(VInput, _mergeProps({
|
||||
"ref": inputRef,
|
||||
"class": ['v-radio-group', props.class],
|
||||
"style": props.style
|
||||
}, rootAttrs, inputProps, {
|
||||
"modelValue": model.value,
|
||||
"onUpdate:modelValue": $event => model.value = $event,
|
||||
"id": id.value
|
||||
}), {
|
||||
...slots,
|
||||
default: _ref2 => {
|
||||
let {
|
||||
id,
|
||||
messagesId,
|
||||
isDisabled,
|
||||
isReadonly
|
||||
} = _ref2;
|
||||
return _createElementVNode(_Fragment, null, [label && _createVNode(VLabel, {
|
||||
"id": id.value
|
||||
}, {
|
||||
default: () => [label]
|
||||
}), _createVNode(VSelectionControlGroup, _mergeProps(controlProps, {
|
||||
"id": id.value,
|
||||
"aria-describedby": messagesId.value,
|
||||
"defaultsTarget": "VRadio",
|
||||
"trueIcon": props.trueIcon,
|
||||
"falseIcon": props.falseIcon,
|
||||
"type": props.type,
|
||||
"disabled": isDisabled.value,
|
||||
"readonly": isReadonly.value,
|
||||
"aria-labelledby": label ? id.value : undefined,
|
||||
"multiple": false
|
||||
}, controlAttrs, {
|
||||
"modelValue": model.value,
|
||||
"onUpdate:modelValue": $event => model.value = $event
|
||||
}), slots)]);
|
||||
}
|
||||
});
|
||||
});
|
||||
return forwardRefs({}, inputRef);
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=VRadioGroup.js.map
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"VRadioGroup.js","names":["makeVInputProps","VInput","VLabel","VSelectionControl","makeSelectionControlGroupProps","VSelectionControlGroup","forwardRefs","IconValue","useProxiedModel","computed","ref","useId","filterInputAttrs","genericComponent","omit","propsFactory","useRender","makeVRadioGroupProps","height","type","Number","String","default","trueIcon","falseIcon","VRadioGroup","name","inheritAttrs","props","emits","value","setup","_ref","attrs","slots","uid","id","model","inputRef","rootAttrs","controlAttrs","inputProps","filterProps","controlProps","label","for","_createVNode","_mergeProps","class","style","$event","_ref2","messagesId","isDisabled","isReadonly","_createElementVNode","_Fragment","undefined"],"sources":["../../../src/components/VRadioGroup/VRadioGroup.tsx"],"sourcesContent":["// Styles\nimport './VRadioGroup.sass'\n\n// Components\nimport { makeVInputProps, VInput } from '@/components/VInput/VInput'\nimport { VLabel } from '@/components/VLabel'\nimport { VSelectionControl } from '@/components/VSelectionControl'\nimport { makeSelectionControlGroupProps, VSelectionControlGroup } from '@/components/VSelectionControlGroup/VSelectionControlGroup'\n\n// Composables\nimport { forwardRefs } from '@/composables/forwardRefs'\nimport { IconValue } from '@/composables/icons'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, ref, useId } from 'vue'\nimport { filterInputAttrs, genericComponent, omit, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { VInputSlots } from '@/components/VInput/VInput'\nimport type { GenericProps } from '@/util'\n\nexport type VRadioGroupSlots = Omit<VInputSlots, 'default'> & {\n default: never\n label: {\n label: string | undefined\n props: Record<string, any>\n }\n}\n\nexport const makeVRadioGroupProps = propsFactory({\n height: {\n type: [Number, String],\n default: 'auto',\n },\n\n ...makeVInputProps(),\n ...omit(makeSelectionControlGroupProps(), ['multiple']),\n\n trueIcon: {\n type: IconValue,\n default: '$radioOn',\n },\n falseIcon: {\n type: IconValue,\n default: '$radioOff',\n },\n type: {\n type: String,\n default: 'radio',\n },\n}, 'VRadioGroup')\n\nexport const VRadioGroup = genericComponent<new <T>(\n props: {\n modelValue?: T | null\n 'onUpdate:modelValue'?: (value: T | null) => void\n },\n slots: VRadioGroupSlots,\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VRadioGroup',\n\n inheritAttrs: false,\n\n props: makeVRadioGroupProps(),\n\n emits: {\n 'update:modelValue': (value: any) => true,\n },\n\n setup (props, { attrs, slots }) {\n const uid = useId()\n const id = computed(() => props.id || `radio-group-${uid}`)\n const model = useProxiedModel(props, 'modelValue')\n const inputRef = ref<VInput>()\n\n useRender(() => {\n const [rootAttrs, controlAttrs] = filterInputAttrs(attrs)\n const inputProps = VInput.filterProps(props)\n const controlProps = VSelectionControl.filterProps(props)\n const label = slots.label\n ? slots.label({\n label: props.label,\n props: { for: id.value },\n })\n : props.label\n\n return (\n <VInput\n ref={ inputRef }\n class={[\n 'v-radio-group',\n props.class,\n ]}\n style={ props.style }\n { ...rootAttrs }\n { ...inputProps }\n v-model={ model.value }\n id={ id.value }\n >\n {{\n ...slots,\n default: ({\n id,\n messagesId,\n isDisabled,\n isReadonly,\n }) => (\n <>\n { label && (\n <VLabel id={ id.value }>\n { label }\n </VLabel>\n )}\n\n <VSelectionControlGroup\n { ...controlProps }\n id={ id.value }\n aria-describedby={ messagesId.value }\n defaultsTarget=\"VRadio\"\n trueIcon={ props.trueIcon }\n falseIcon={ props.falseIcon }\n type={ props.type }\n disabled={ isDisabled.value }\n readonly={ isReadonly.value }\n aria-labelledby={ label ? id.value : undefined }\n multiple={ false }\n { ...controlAttrs }\n v-model={ model.value }\n v-slots={ slots }\n />\n </>\n ),\n }}\n </VInput>\n )\n })\n\n return forwardRefs({}, inputRef)\n },\n})\n\nexport type VRadioGroup = InstanceType<typeof VRadioGroup>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,eAAe,EAAEC,MAAM;AAAA,SACvBC,MAAM;AAAA,SACNC,iBAAiB;AAAA,SACjBC,8BAA8B,EAAEC,sBAAsB,+DAE/D;AAAA,SACSC,WAAW;AAAA,SACXC,SAAS;AAAA,SACTC,eAAe,6CAExB;AACA,SAASLine truncated
|
||||
Generated
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
@use '../../styles/tools'
|
||||
@use './variables' as *
|
||||
|
||||
@include tools.layer('components')
|
||||
.v-radio-group
|
||||
> .v-input__control
|
||||
flex-direction: column
|
||||
|
||||
> .v-label
|
||||
margin-inline-start: $radio-group-label-margin-inline-start
|
||||
|
||||
+ .v-selection-control-group
|
||||
padding-inline-start: $radio-group-label-selection-group-padding-inline
|
||||
margin-top: $radio-group-label-selection-group-margin-top
|
||||
|
||||
.v-input__details
|
||||
padding-inline: $radio-group-details-padding-inline
|
||||
Generated
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
$radio-group-details-padding-inline: 16px !default;
|
||||
$radio-group-label-margin-inline-start: 16px !default;
|
||||
$radio-group-label-selection-group-margin-top: 8px !default;
|
||||
$radio-group-label-selection-group-padding-inline: 6px !default;
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
export { VRadioGroup } from './VRadioGroup.js';
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
export { VRadioGroup } from "./VRadioGroup.js";
|
||||
//# sourceMappingURL=index.js.map
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","names":["VRadioGroup"],"sources":["../../../src/components/VRadioGroup/index.ts"],"sourcesContent":["export { VRadioGroup } from './VRadioGroup'\n"],"mappings":"SAASA,WAAW","ignoreList":[]}
|
||||
Reference in new issue
Block a user