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

1 line
11 KiB
Plaintext
Raw Permalink Normal View History

2026-02-23 02:23:38 +00:00
{"version":3,"file":"index.mjs","sources":["../../src/togglebutton/BaseToggleButton.vue","../../src/togglebutton/ToggleButton.vue","../../src/togglebutton/ToggleButton.vue?vue&type=template&id=7a5c1ac9&lang.js"],"sourcesContent":["<script>\nimport BaseEditableHolder from '@primevue/core/baseeditableholder';\nimport ToggleButtonStyle from 'primevue/togglebutton/style';\n\nexport default {\n name: 'BaseToggleButton',\n extends: BaseEditableHolder,\n props: {\n onIcon: String,\n offIcon: String,\n onLabel: {\n type: String,\n default: 'Yes'\n },\n offLabel: {\n type: String,\n default: 'No'\n },\n readonly: {\n type: Boolean,\n default: false\n },\n tabindex: {\n type: Number,\n default: null\n },\n ariaLabelledby: {\n type: String,\n default: null\n },\n ariaLabel: {\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: ToggleButtonStyle,\n provide() {\n return {\n $pcToggleButton: this,\n $parentInstance: this\n };\n }\n};\n</script>\n","<template>\n <button\n v-ripple\n type=\"button\"\n :class=\"cx('root')\"\n :tabindex=\"tabindex\"\n :disabled=\"disabled\"\n :aria-pressed=\"d_value\"\n @click=\"onChange\"\n @blur=\"onBlur\"\n v-bind=\"getPTOptions('root')\"\n :aria-label=\"ariaLabel\"\n :aria-labelledby=\"ariaLabelledby\"\n :data-p-checked=\"active\"\n :data-p-disabled=\"disabled\"\n :data-p=\"dataP\"\n >\n <span :class=\"cx('content')\" v-bind=\"getPTOptions('content')\" :data-p=\"dataP\">\n <slot>\n <slot name=\"icon\" :value=\"d_value\" :class=\"cx('icon')\">\n <span v-if=\"onIcon || offIcon\" :class=\"[cx('icon'), d_value ? onIcon : offIcon]\" v-bind=\"getPTOptions('icon')\" />\n </slot>\n <span :class=\"cx('label')\" v-bind=\"getPTOptions('label')\">{{ label }}</span>\n </slot>\n </span>\n </button>\n</template>\n\n<script>\nimport { cn } from '@primeuix/utils';\nimport { isNotEmpty } from '@primeuix/utils/object';\nimport Ripple from 'primevue/ripple';\nimport BaseToggleButton from './BaseToggleButton.vue';\n\nexport default {\n name: 'ToggleButton',\n extends: BaseToggleButton,\n inheritAttrs: false,\n emits: ['change'],\n methods: {\n getPTOptions(key) {\n const _ptm = key === 'root' ? this.ptmi : this.ptm;\n\n return _ptm(key, {\n context: {\n active: this.active,\n disabled: this.disabled\n }\n });\n },\n onChange(event) {\n if (!this.disabled && !this.readonly) {\n this.writeValue(!this.d_value, event);\n this.$emit('change', event);\n }\n },\n onBlur(event) {\n this.formField.onBlur?.(event);\n }\n },\n computed: {\n active() {\n return this.d_value === true;\n },\n hasLabel() {\n return isNotEmpty(this.onLabel) && isNotEmpty(this.offLabel);\n },\n label() {\n return this.hasLabel ? (this.d_value ? this.onLabel : this.offLabel) : '\\u00A0';\n },\n dataP() {\n return cn({\n checked: this.active,\n invalid: this.$invalid,\n [this.size]: this.size\n });\n }\n },\n directives: {\n ripple: Ripple\n }\n};\n</script>\n","<template>\n <button\n v-ripple\n type=\"button\"\n :class=\"cx('root')\"\n :tabindex=\"tabindex\"\n :disabled=\"disable