claude-web/node_modules/primevue/selectbutton/index.mjs.map

1 line
16 KiB
Plaintext
Raw Permalink Normal View History

2026-02-23 02:23:38 +00:00
{"version":3,"file":"index.mjs","sources":["../../src/selectbutton/BaseSelectButton.vue","../../src/selectbutton/SelectButton.vue","../../src/selectbutton/SelectButton.vue?vue&type=template&id=61c89026&lang.js"],"sourcesContent":["<script>\nimport BaseEditableHolder from '@primevue/core/baseeditableholder';\nimport SelectButtonStyle from 'primevue/selectbutton/style';\n\nexport default {\n name: 'BaseSelectButton',\n extends: BaseEditableHolder,\n props: {\n options: Array,\n optionLabel: null,\n optionValue: null,\n optionDisabled: null,\n multiple: Boolean,\n allowEmpty: {\n type: Boolean,\n default: true\n },\n dataKey: null,\n ariaLabelledby: {\n type: String,\n default: null\n },\n size: {\n type: String,\n default: null\n },\n fluid: {\n type: Boolean,\n default: null\n }\n },\n style: SelectButtonStyle,\n provide() {\n return {\n $pcSelectButton: this,\n $parentInstance: this\n };\n }\n};\n</script>\n","<template>\n <div :class=\"cx('root')\" role=\"group\" :aria-labelledby=\"ariaLabelledby\" v-bind=\"ptmi('root')\" :data-p=\"dataP\">\n <template v-for=\"(option, index) of options\" :key=\"getOptionRenderKey(option)\">\n <ToggleButton\n :modelValue=\"isSelected(option)\"\n :onLabel=\"getOptionLabel(option)\"\n :offLabel=\"getOptionLabel(option)\"\n :disabled=\"disabled || isOptionDisabled(option)\"\n :unstyled=\"unstyled\"\n :size=\"size\"\n :readonly=\"isOptionReadonly(option)\"\n @change=\"onOptionSelect($event, option, index)\"\n :pt=\"ptm('pcToggleButton')\"\n >\n <template v-if=\"$slots.option\" #default>\n <slot name=\"option\" :option=\"option\" :index=\"index\">\n <span v-bind=\"ptm('pcToggleButton')['label']\">{{ getOptionLabel(option) }}</span>\n </slot>\n </template>\n </ToggleButton>\n </template>\n </div>\n</template>\n\n<script>\nimport { cn } from '@primeuix/utils';\nimport { equals, resolveFieldData } from '@primeuix/utils/object';\nimport Ripple from 'primevue/ripple';\nimport ToggleButton from 'primevue/togglebutton';\nimport BaseSelectButton from './BaseSelectButton.vue';\n\nexport default {\n name: 'SelectButton',\n extends: BaseSelectButton,\n inheritAttrs: false,\n emits: ['change'],\n methods: {\n getOptionLabel(option) {\n return this.optionLabel ? resolveFieldData(option, this.optionLabel) : option;\n },\n getOptionValue(option) {\n return this.optionValue ? resolveFieldData(option, this.optionValue) : option;\n },\n getOptionRenderKey(option) {\n return this.dataKey ? resolveFieldData(option, this.dataKey) : this.getOptionLabel(option);\n },\n isOptionDisabled(option) {\n return this.optionDisabled ? resolveFieldData(option, this.optionDisabled) : false;\n },\n isOptionReadonly(option) {\n if (this.allowEmpty) return false;\n\n let selected = this.isSelected(option);\n\n if (this.multiple) {\n return selected && this.d_value.length === 1;\n } else {\n return selected;\n }\n },\n onOptionSelect(event, option, index) {\n if (this.disabled || this.isOptionDisabled(option) || this.isOptionReadonly(option)) {\n return;\n }\n\n let selected = this.isSelected(option);\n let optionValue = this.getOptionValue(option);\n let newValue;\n\n if (this.multiple) {\n if (selected) {\n newValue = this.d_value.filter((val) => !equals(val, optionValue, this.equalit