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

1 line
11 KiB
Plaintext
Raw Normal View History

2026-02-23 02:23:38 +00:00
{"version":3,"file":"index.mjs","sources":["../../src/toggleswitch/BaseToggleSwitch.vue","../../src/toggleswitch/ToggleSwitch.vue","../../src/toggleswitch/ToggleSwitch.vue?vue&type=template&id=b155e212&lang.js"],"sourcesContent":["<script>\nimport BaseEditableHolder from '@primevue/core/baseeditableholder';\nimport ToggleSwitchStyle from 'primevue/toggleswitch/style';\n\nexport default {\n name: 'BaseToggleSwitch',\n extends: BaseEditableHolder,\n props: {\n trueValue: {\n type: null,\n default: true\n },\n falseValue: {\n type: null,\n default: false\n },\n readonly: {\n type: Boolean,\n default: false\n },\n tabindex: {\n type: Number,\n default: null\n },\n inputId: {\n type: String,\n default: null\n },\n inputClass: {\n type: [String, Object],\n default: null\n },\n inputStyle: {\n type: Object,\n default: null\n },\n ariaLabelledby: {\n type: String,\n default: null\n },\n ariaLabel: {\n type: String,\n default: null\n }\n },\n style: ToggleSwitchStyle,\n provide() {\n return {\n $pcToggleSwitch: this,\n $parentInstance: this\n };\n }\n};\n</script>\n","<template>\n <div :class=\"cx('root')\" :style=\"sx('root')\" v-bind=\"getPTOptions('root')\" :data-p-checked=\"checked\" :data-p-disabled=\"disabled\" :data-p=\"dataP\">\n <input\n :id=\"inputId\"\n type=\"checkbox\"\n role=\"switch\"\n :class=\"[cx('input'), inputClass]\"\n :style=\"inputStyle\"\n :checked=\"checked\"\n :tabindex=\"tabindex\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :aria-checked=\"checked\"\n :aria-labelledby=\"ariaLabelledby\"\n :aria-label=\"ariaLabel\"\n :aria-invalid=\"invalid || undefined\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n @change=\"onChange\"\n v-bind=\"getPTOptions('input')\"\n />\n <div :class=\"cx('slider')\" v-bind=\"getPTOptions('slider')\" :data-p=\"dataP\">\n <div :class=\"cx('handle')\" v-bind=\"getPTOptions('handle')\" :data-p=\"dataP\">\n <slot name=\"handle\" :checked=\"checked\" />\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport { cn } from '@primeuix/utils';\nimport BaseToggleSwitch from './BaseToggleSwitch.vue';\n\nexport default {\n name: 'ToggleSwitch',\n extends: BaseToggleSwitch,\n inheritAttrs: false,\n emits: ['change', 'focus', 'blur'],\n methods: {\n getPTOptions(key) {\n const _ptm = key === 'root' ? this.ptmi : this.ptm;\n\n return _ptm(key, {\n context: {\n checked: this.checked,\n disabled: this.disabled\n }\n });\n },\n onChange(event) {\n if (!this.disabled && !this.readonly) {\n const newValue = this.checked ? this.falseValue : this.trueValue;\n\n this.writeValue(newValue, event);\n this.$emit('change', event);\n }\n },\n onFocus(event) {\n this.$emit('focus', event);\n },\n onBlur(event) {\n this.$emit('blur', event);\n this.formField.onBlur?.(event);\n }\n },\n computed: {\n checked() {\n return this.d_value === this.trueValue;\n },\n dataP() {\n return cn({\n checked: this.checked,\n disabled: this.disabled,\n invalid: this.$invalid\n });\n }\n }\n};\n</script>\n","<template>\n <div :class=\"cx('root')\" :style=\"sx('root')\" v-bind=\"getPTOptions('root')\" :data-p-ch