claude-web/node_modules/@primevue/core/baseeditableholder/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/baseeditableholder/BaseEditableHolder.vue"],"sourcesContent":["<script>\nimport { isNotEmpty } from '@primeuix/utils';\nimport BaseComponent from '@primevue/core/basecomponent';\n\nexport default {\n name: 'BaseEditableHolder',\n extends: BaseComponent,\n emits: ['update:modelValue', 'value-change'],\n props: {\n modelValue: {\n type: null,\n default: undefined\n },\n defaultValue: {\n type: null,\n default: undefined\n },\n name: {\n type: String,\n default: undefined\n },\n invalid: {\n type: Boolean,\n default: undefined\n },\n disabled: {\n type: Boolean,\n default: false\n },\n formControl: {\n type: Object,\n default: undefined\n }\n },\n inject: {\n $parentInstance: {\n default: undefined\n },\n $pcForm: {\n default: undefined\n },\n $pcFormField: {\n default: undefined\n }\n },\n data() {\n return {\n d_value: this.defaultValue !== undefined ? this.defaultValue : this.modelValue\n };\n },\n watch: {\n modelValue: {\n deep: true,\n handler(newValue) {\n this.d_value = newValue;\n }\n },\n defaultValue(newValue) {\n this.d_value = newValue;\n },\n $formName: {\n immediate: true,\n handler(newValue) {\n this.formField = this.$pcForm?.register?.(newValue, this.$formControl) || {};\n }\n },\n $formControl: {\n immediate: true,\n handler(newValue) {\n this.formField = this.$pcForm?.register?.(this.$formName, newValue) || {};\n }\n },\n $formDefaultValue: {\n immediate: true,\n handler(newValue) {\n this.d_value !== newValue && (this.d_value = newValue);\n }\n },\n $formValue: {\n immediate: false,\n handler(newValue) {\n if (this.$pcForm?.getFieldState(this.$formName) && newValue !== this.d_value) {\n this.d_value = newValue;\n }\n }\n }\n },\n formField: {},\n methods: {\n writeValue(value, event) {\n if (this.controlled) {\n this.d_value = value;\n this.$emit('update:modelValue', value);\n }\n\n this.$emit('value-change', value);\n\n this.formField.onChange?.({ originalEvent: event, value });\n },\n // @todo move to @primeuix/utils\n findNonEmpty(...values) {\n return values.find(isNotEmpty);\n }\n },\n computed: {\n $filled() {\n return isNotEmpty(this.d_value);\n },\n $invalid() {\n return !this.$formNovalidate && this.findNonEmpty(this.invalid, this.$pcFormField?.$field?.invalid, this.$pcForm?.getFieldState(this.$formName)?.invalid);\n },\n $formName() {\n return !this.$formNovalidate ? this.name || this.$formControl?.name : undefined;\n },\n $formControl() {\n return this.formControl || this.$pcFormField?.formControl;\n },\n $formNovalidate() {\n return this.$formControl?.novalidate;\n },\n $formDefaultValue() {\n return this.findNonEmpty(this.d_value, this.$pcFormField?.initialValue, this.$pcForm?.initialValues?.[this.$formName]);\n },\n $formValue() {\n return this.findNonEmpty(this.$pcFormField?.$field?.value, this.$pcForm?.getFieldState(this.$formName)?.value);\n },\n controlled() {\n return this.$inProps.hasOwnProperty('modelValue') || (!this.$inProps.hasOwnProperty('modelValue') && !this.$inProps.hasOwnProperty('defaultValue'));\n