f7cloud_client/apps/photos/js/InvalidFilenameDialog-BYpqWa7P-BCqKW7Jn.chunk.mjs.map
root 8b6a0139db f7cloud_client
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 22:59:26 +00:00

1 line
7.2 KiB
Plaintext

{"version":3,"file":"InvalidFilenameDialog-BYpqWa7P-BCqKW7Jn.chunk.mjs","sources":["../node_modules/@nextcloud/upload/dist/chunks/InvalidFilenameDialog-BYpqWa7P.mjs"],"sourcesContent":["import '../assets/InvalidFilenameDialog-YDOzIzS6.css';\nimport { InvalidFilenameError, InvalidFilenameErrorReason } from \"@nextcloud/files\";\nimport { defineComponent } from \"vue\";\nimport { t, n as normalizeComponent } from \"./index-DdKmqUaK.mjs\";\nimport NcDialog from \"@nextcloud/vue/dist/Components/NcDialog.js\";\nimport NcTextField from \"@nextcloud/vue/dist/Components/NcTextField.js\";\nimport NcNoteCard from \"@nextcloud/vue/dist/Components/NcNoteCard.js\";\nconst _sfc_main = defineComponent({\n components: {\n NcDialog,\n NcNoteCard,\n NcTextField\n },\n props: {\n error: {\n type: InvalidFilenameError,\n required: true\n },\n /**\n * @deprecated just for legacy reasons, replace with function from @nextcloud/files in future\n */\n validateFilename: {\n type: Function,\n required: true\n }\n },\n setup() {\n return {\n t\n };\n },\n data() {\n return {\n newName: \"\",\n validationError: \"\"\n };\n },\n computed: {\n isValidName() {\n return this.validationError === \"\";\n },\n isInvalidFileType() {\n return this.error.reason === InvalidFilenameErrorReason.Extension && this.error.segment.match(/^\\.\\w/) !== null;\n },\n canRename() {\n return !this.isInvalidFileType;\n },\n dialogButtons() {\n const buttons = [\n {\n label: t(\"Cancel\"),\n type: \"error\",\n callback: () => {\n this.$emit(\"close\", { cancel: true });\n }\n },\n {\n label: t(\"Skip\"),\n callback: () => {\n this.$emit(\"close\", { skip: true });\n }\n }\n ];\n if (this.canRename) {\n buttons.push({\n label: t(\"Rename\"),\n type: \"primary\",\n disabled: !this.isValidName,\n callback: () => {\n this.$emit(\"close\", { rename: this.newName.trimEnd() });\n }\n });\n }\n return buttons;\n }\n },\n watch: {\n error: {\n handler() {\n this.validationError = this.getErrorText(this.error);\n this.newName = this.error.filename;\n },\n immediate: true\n },\n newName() {\n try {\n this.validateFilename(this.newName.trimEnd());\n this.validationError = \"\";\n } catch (error) {\n this.validationError = this.getErrorText(error);\n } finally {\n const textfield = this.$refs.textfield?.$el.querySelector(\"input\");\n if (textfield) {\n textfield.setCustomValidity(this.validationError);\n textfield.reportValidity();\n }\n }\n }\n },\n methods: {\n getErrorText(error) {\n switch (error.reason) {\n case InvalidFilenameErrorReason.Character:\n return t('\"{segment}\" is not allowed inside a file or folder name.', { segment: error.segment });\n case InvalidFilenameErrorReason.ReservedName:\n return t('\"{segment}\" is a forbidden file or folder name.', { segment: error.segment });\n case InvalidFilenameErrorReason.Extension:\n return error.segment.match(/\\.\\w/) ? t('\"{segment}\" is a forbidden file type.', { segment: error.segment }) : t('Filenames must not end with \"{segment}\".', { segment: error.segment });\n }\n }\n }\n});\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n _vm._self._setupProxy;\n return _c(\"NcDialog\", { attrs: { \"buttons\": _vm.dialogButtons, \"name\": _vm.t(\"Invalid filename\") }, on: { \"close\": function($event) {\n return _vm.$emit(\"close\", { cancel: true });\n } } }, [_c(\"NcNoteCard\", { attrs: { \"severity\": \"error\" } }, [_vm._v(\" \" + _vm._s(_vm.getErrorText(_vm.error)) + \" \" + _vm._s(_vm.t(\"You can either rename the file, skip this file or cancel the whole operation.\")) + \" \")]), _vm.canRename ? _c(\"NcTextField\", { ref: \"textfield\", staticClass: \"invalid-filename-dialog__input\", attrs: { \"error\": !_vm.isValidName, \"helper-text\": _vm.validationError, \"label\": _vm.t(\"New filename\"), \"value\": _vm.newName }, on: { \"update:value\": function($event) {\n _vm.newName = $event;\n } } }) : _vm._e()], 1);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"3a479259\"\n);\nconst InvalidFilenameDialog = __component__.exports;\nexport {\n InvalidFilenameDialog as default\n};\n"],"names":["_sfc_main","defineComponent","NcDialog","NcNoteCard","NcTextField","InvalidFilenameError","r","InvalidFilenameErrorReason","buttons","t","error","textfield","_sfc_render","_vm","_c","$event","_sfc_staticRenderFns","__component__","normalizeComponent","InvalidFilenameDialog"],"mappings":"0vBAOA,MAAMA,EAAYC,EAAgB,CAChC,WAAY,CACV,SAAAC,EACA,WAAAC,EACA,YAAAC,CACD,EACD,MAAO,CACL,MAAO,CACL,KAAMC,EACN,SAAU,EACX,EAID,iBAAkB,CAChB,KAAM,SACN,SAAU,EAChB,CACG,EACD,OAAQ,CACN,MAAO,CACLC,CACD,CACF,EACD,MAAO,CACL,MAAO,CACL,QAAS,GACT,gBAAiB,EAClB,CACF,EACD,SAAU,CACR,aAAc,CACZ,OAAO,KAAK,kBAAoB,EACjC,EACD,mBAAoB,CAClB,OAAO,KAAK,MAAM,SAAWC,EAA2B,WAAa,KAAK,MAAM,QAAQ,MAAM,OAAO,IAAM,IAC5G,EACD,WAAY,CACV,MAAO,CAAC,KAAK,iBACd,EACD,eAAgB,CACd,MAAMC,EAAU,CACd,CACE,MAAOC,EAAE,QAAQ,EACjB,KAAM,QACN,SAAU,IAAM,CACd,KAAK,MAAM,QAAS,CAAE,OAAQ,EAAI,CAAE,CAChD,CACS,EACD,CACE,MAAOA,EAAE,MAAM,EACf,SAAU,IAAM,CACd,KAAK,MAAM,QAAS,CAAE,KAAM,EAAI,CAAE,CAC9C,CACA,CACO,EACD,OAAI,KAAK,WACPD,EAAQ,KAAK,CACX,MAAOC,EAAE,QAAQ,EACjB,KAAM,UACN,SAAU,CAAC,KAAK,YAChB,SAAU,IAAM,CACd,KAAK,MAAM,QAAS,CAAE,OAAQ,KAAK,QAAQ,QAAO,EAAI,CAClE,CACA,CAAS,EAEID,CACb,CACG,EACD,MAAO,CACL,MAAO,CACL,SAA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