All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.lib.components.VSelectionControlGroup.VSelectionControlGroup.mjs.map Maven / Gradle / Ivy

{"version":3,"file":"VSelectionControlGroup.mjs","names":["makeComponentProps","provideDefaults","makeDensityProps","IconValue","useProxiedModel","makeThemeProps","computed","onScopeDispose","provide","toRef","deepEqual","genericComponent","getUid","propsFactory","useRender","VSelectionControlGroupSymbol","Symbol","for","makeSelectionControlGroupProps","color","String","disabled","type","Boolean","default","defaultsTarget","error","id","inline","falseIcon","trueIcon","ripple","Object","multiple","name","readonly","modelValue","valueComparator","Function","makeVSelectionControlGroupProps","VSelectionControlGroup","props","emits","value","setup","_ref","slots","uid","updateHandlers","Set","forceUpdate","forEach","fn","onForceUpdate","cb","add","delete","density","Array","isArray","_createVNode","class","style","undefined"],"sources":["../../../src/components/VSelectionControlGroup/VSelectionControlGroup.tsx"],"sourcesContent":["// Styles\nimport './VSelectionControlGroup.sass'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { provideDefaults } from '@/composables/defaults'\nimport { makeDensityProps } from '@/composables/density'\nimport { IconValue } from '@/composables/icons'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { makeThemeProps } from '@/composables/theme'\n\n// Utilities\nimport { computed, onScopeDispose, provide, toRef } from 'vue'\nimport { deepEqual, genericComponent, getUid, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { InjectionKey, PropType, Ref } from 'vue'\nimport type { RippleDirectiveBinding } from '@/directives/ripple'\nimport type { GenericProps } from '@/util'\n\nexport interface VSelectionGroupContext {\n  modelValue: Ref\n  forceUpdate: () => void\n  onForceUpdate: (fn: () => void) => void\n}\n\nexport const VSelectionControlGroupSymbol: InjectionKey = Symbol.for('vuetify:selection-control-group')\n\nexport const makeSelectionControlGroupProps = propsFactory({\n  color: String,\n  disabled: {\n    type: Boolean as PropType,\n    default: null,\n  },\n  defaultsTarget: String,\n  error: Boolean,\n  id: String,\n  inline: Boolean,\n  falseIcon: IconValue,\n  trueIcon: IconValue,\n  ripple: {\n    type: [Boolean, Object] as PropType,\n    default: true,\n  },\n  multiple: {\n    type: Boolean as PropType,\n    default: null,\n  },\n  name: String,\n  readonly: {\n    type: Boolean as PropType,\n    default: null,\n  },\n  modelValue: null,\n  type: String,\n  valueComparator: {\n    type: Function as PropType,\n    default: deepEqual,\n  },\n\n  ...makeComponentProps(),\n  ...makeDensityProps(),\n  ...makeThemeProps(),\n}, 'SelectionControlGroup')\n\nexport const makeVSelectionControlGroupProps = propsFactory({\n  ...makeSelectionControlGroupProps({\n    defaultsTarget: 'VSelectionControl',\n  }),\n}, 'VSelectionControlGroup')\n\nexport const VSelectionControlGroup = genericComponent(\n  props: {\n    modelValue?: T\n    'onUpdate:modelValue'?: (value: T) => void\n  },\n  slots: { default: never },\n) => GenericProps>()({\n  name: 'VSelectionControlGroup',\n\n  props: makeVSelectionControlGroupProps(),\n\n  emits: {\n    'update:modelValue': (value: any) => true,\n  },\n\n  setup (props, { slots }) {\n    const modelValue = useProxiedModel(props, 'modelValue')\n    const uid = getUid()\n    const id = computed(() => props.id || `v-selection-control-group-${uid}`)\n    const name = computed(() => props.name || id.value)\n\n    const updateHandlers = new Set<() => void>()\n    provide(VSelectionControlGroupSymbol, {\n      modelValue,\n      forceUpdate: () => {\n        updateHandlers.forEach(fn => fn())\n      },\n      onForceUpdate: cb => {\n        updateHandlers.add(cb)\n        onScopeDispose(() => {\n          updateHandlers.delete(cb)\n        })\n      },\n    })\n\n    provideDefaults({\n      [props.defaultsTarget]: {\n        color: toRef(props, 'color'),\n        disabled: toRef(props, 'disabled'),\n        density: toRef(props, 'density'),\n        error: toRef(props, 'error'),\n        inline: toRef(props, 'inline'),\n        modelValue,\n        multiple: computed(() => !!props.multiple || (props.multiple == null && Array.isArray(modelValue.value))),\n        name,\n        falseIcon: toRef(props, 'falseIcon'),\n        trueIcon: toRef(props, 'trueIcon'),\n        readonly: toRef(props, 'readonly'),\n        ripple: toRef(props, 'ripple'),\n        type: toRef(props, 'type'),\n        valueComparator: toRef(props, 'valueComparator'),\n      },\n    })\n\n    useRender(() => (\n      \n        { slots.default?.() }\n      
\n ))\n\n return {}\n },\n})\n\nexport type VSelectionControlGroup = InstanceType\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,kBAAkB;AAAA,SAClBC,eAAe;AAAA,SACfC,gBAAgB;AAAA,SAChBC,SAAS;AAAA,SACTC,eAAe;AAAA,SACfC,cAAc,uCAEvB;AACA,SAASC,QAAQ,EAAEC,cAAc,EAAEC,OAAO,EAAEC,KAAK,QAAQ,KAAK;AAAA,SACrDC,SAAS,EAAEC,gBAAgB,EAAEC,MAAM,EAAEC,YAAY,EAAEC,SAAS,gCAErE;AAWA,OAAO,MAAMC,4BAAkE,GAAGC,MAAM,CAACC,GAAG,CAAC,iCAAiC,CAAC;AAE/H,OAAO,MAAMC,8BAA8B,GAAGL,YAAY,CAAC;EACzDM,KAAK,EAAEC,MAAM;EACbC,QAAQ,EAAE;IACRC,IAAI,EAAEC,OAAmC;IACzCC,OAAO,EAAE;EACX,CAAC;EACDC,cAAc,EAAEL,MAAM;EACtBM,KAAK,EAAEH,OAAO;EACdI,EAAE,EAAEP,MAAM;EACVQ,MAAM,EAAEL,OAAO;EACfM,SAAS,EAAE1B,SAAS;EACpB2B,QAAQ,EAAE3B,SAAS;EACnB4B,MAAM,EAAE;IACNT,IAAI,EAAE,CAACC,OAAO,EAAES,MAAM,CAA8C;IACpER,OAAO,EAAE;EACX,CAAC;EACDS,QAAQ,EAAE;IACRX,IAAI,EAAEC,OAAmC;IACzCC,OAAO,EAAE;EACX,CAAC;EACDU,IAAI,EAAEd,MAAM;EACZe,QAAQ,EAAE;IACRb,IAAI,EAAEC,OAAmC;IACzCC,OAAO,EAAE;EACX,CAAC;EACDY,UAAU,EAAE,IAAI;EAChBd,IAAI,EAAEF,MAAM;EACZiB,eAAe,EAAE;IACff,IAAI,EAAEgB,QAAsC;IAC5Cd,OAAO,EAAEd;EACX,CAAC;EAED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