nextcloud/dist/NcInputField-CPL-a_MM-R1bsVnGI.chunk.mjs.map
Ferdinand Thiessen a24fc77bcf
chore: compile assets
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-03-18 14:14:31 +01:00

1 line
No EOL
12 KiB
Text

{"version":3,"file":"NcInputField-CPL-a_MM-R1bsVnGI.chunk.mjs","sources":["../node_modules/@nextcloud/vue/dist/chunks/NcInputField-CPL-a_MM.mjs"],"sourcesContent":["import '../assets/NcInputField-DR0FULeu.css';\nimport { defineComponent, useModel, useAttrs, useTemplateRef, computed, warn, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, mergeProps, toDisplayString, createCommentVNode, withDirectives, renderSlot, vShow, createBlock, withCtx, createTextVNode, mergeModels } from \"vue\";\nimport { d as mdiCheck, j as mdiAlertCircleOutline } from \"./mdi-CpchYUUV.mjs\";\nimport { N as NcButton } from \"./NcButton-lQra4n2g.mjs\";\nimport { N as NcIconSvgWrapper } from \"./NcIconSvgWrapper-De-2-ukl.mjs\";\nimport { c as createElementId } from \"./createElementId-DhjFt1I9.mjs\";\nimport { i as isLegacy } from \"./legacy-DcjXBL_t.mjs\";\nimport { _ as _export_sfc } from \"./_plugin-vue_export-helper-1tPrXgE0.mjs\";\nconst _hoisted_1 = { class: \"input-field__main-wrapper\" };\nconst _hoisted_2 = [\"id\", \"aria-describedby\", \"disabled\", \"placeholder\", \"type\", \"value\"];\nconst _hoisted_3 = [\"for\"];\nconst _hoisted_4 = { class: \"input-field__icon input-field__icon--leading\" };\nconst _hoisted_5 = {\n key: 2,\n class: \"input-field__icon input-field__icon--trailing\"\n};\nconst _hoisted_6 = [\"id\"];\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n ...{\n inheritAttrs: false\n },\n __name: \"NcInputField\",\n props: /* @__PURE__ */ mergeModels({\n class: { default: \"\" },\n inputClass: { default: \"\" },\n id: { default: () => createElementId() },\n label: { default: void 0 },\n labelOutside: { type: Boolean },\n type: { default: \"text\" },\n placeholder: { default: void 0 },\n showTrailingButton: { type: Boolean },\n trailingButtonLabel: { default: void 0 },\n success: { type: Boolean },\n error: { type: Boolean },\n helperText: { default: \"\" },\n disabled: { type: Boolean },\n pill: { type: Boolean }\n }, {\n \"modelValue\": { required: true },\n \"modelModifiers\": {}\n }),\n emits: /* @__PURE__ */ mergeModels([\"trailingButtonClick\"], [\"update:modelValue\"]),\n setup(__props, { expose: __expose, emit: __emit }) {\n const modelValue = useModel(__props, \"modelValue\");\n const props = __props;\n const emit = __emit;\n __expose({\n focus,\n select\n });\n const attrs = useAttrs();\n const inputElement = useTemplateRef(\"input\");\n const hasTrailingIcon = computed(() => props.showTrailingButton || props.success);\n const internalPlaceholder = computed(() => {\n if (props.placeholder) {\n return props.placeholder;\n }\n if (props.label) {\n return isLegacy ? props.label : \"\";\n }\n return void 0;\n });\n const isValidLabel = computed(() => {\n const isValidLabel2 = props.label || props.labelOutside;\n if (!isValidLabel2) {\n warn(\"You need to add a label to the NcInputField component. Either use the prop label or use an external one, as per the example in the documentation.\");\n }\n return isValidLabel2;\n });\n const ariaDescribedby = computed(() => {\n const ariaDescribedby2 = [];\n if (props.helperText) {\n ariaDescribedby2.push(`${props.id}-helper-text`);\n }\n if (attrs[\"aria-describedby\"]) {\n ariaDescribedby2.push(String(attrs[\"aria-describedby\"]));\n }\n return ariaDescribedby2.join(\" \") || void 0;\n });\n function focus(options) {\n inputElement.value.focus(options);\n }\n function select() {\n inputElement.value.select();\n }\n function handleInput(event) {\n const target = event.target;\n modelValue.value = props.type === \"number\" && typeof modelValue.value === \"number\" ? parseFloat(target.value) : target.value;\n }\n return (_ctx, _cache) => {\n return openBlock(), createElementBlock(\"div\", {\n class: normalizeClass([\"input-field\", [{\n \"input-field--disabled\": _ctx.disabled,\n \"input-field--error\": _ctx.error,\n \"input-field--label-outside\": _ctx.labelOutside || !isValidLabel.value,\n \"input-field--leading-icon\": !!_ctx.$slots.icon,\n \"input-field--trailing-icon\": hasTrailingIcon.value,\n \"input-field--pill\": _ctx.pill,\n \"input-field--success\": _ctx.success,\n \"input-field--legacy\": unref(isLegacy)\n }, _ctx.$props.class]])\n }, [\n createElementVNode(\"div\", _hoisted_1, [\n createElementVNode(\"input\", mergeProps(_ctx.$attrs, {\n id: _ctx.id,\n ref: \"input\",\n \"aria-describedby\": ariaDescribedby.value,\n \"aria-live\": \"polite\",\n class: [\"input-field__input\", _ctx.inputClass],\n disabled: _ctx.disabled,\n placeholder: internalPlaceholder.value,\n type: _ctx.type,\n value: modelValue.value.toString(),\n onInput: handleInput\n }), null, 16, _hoisted_2),\n !_ctx.labelOutside && isValidLabel.value ? (openBlock(), createElementBlock(\"label\", {\n key: 0,\n class: \"input-field__label\",\n for: _ctx.id\n }, toDisplayString(_ctx.label), 9, _hoisted_3)) : createCommentVNode(\"\", true),\n withDirectives(createElementVNode(\"div\", _hoisted_4, [\n renderSlot(_ctx.$slots, \"icon\", {}, void 0, true)\n ], 512), [\n [vShow, !!_ctx.$slots.icon]\n ]),\n _ctx.showTrailingButton ? (openBlock(), createBlock(NcButton, {\n key: 1,\n class: \"input-field__trailing-button\",\n \"aria-label\": _ctx.trailingButtonLabel,\n disabled: _ctx.disabled,\n variant: \"tertiary-no-background\",\n onClick: _cache[0] || (_cache[0] = ($event) => emit(\"trailingButtonClick\", $event))\n }, {\n icon: withCtx(() => [\n renderSlot(_ctx.$slots, \"trailing-button-icon\", {}, void 0, true)\n ]),\n _: 3\n }, 8, [\"aria-label\", \"disabled\"])) : _ctx.success || _ctx.error ? (openBlock(), createElementBlock(\"div\", _hoisted_5, [\n _ctx.success ? (openBlock(), createBlock(NcIconSvgWrapper, {\n key: 0,\n path: unref(mdiCheck)\n }, null, 8, [\"path\"])) : (openBlock(), createBlock(NcIconSvgWrapper, {\n key: 1,\n path: unref(mdiAlertCircleOutline)\n }, null, 8, [\"path\"]))\n ])) : createCommentVNode(\"\", true)\n ]),\n _ctx.helperText ? (openBlock(), createElementBlock(\"p\", {\n key: 0,\n id: `${_ctx.id}-helper-text`,\n class: \"input-field__helper-text-message\"\n }, [\n _ctx.success ? (openBlock(), createBlock(NcIconSvgWrapper, {\n key: 0,\n class: \"input-field__helper-text-message__icon\",\n path: unref(mdiCheck),\n inline: \"\"\n }, null, 8, [\"path\"])) : _ctx.error ? (openBlock(), createBlock(NcIconSvgWrapper, {\n key: 1,\n class: \"input-field__helper-text-message__icon\",\n path: unref(mdiAlertCircleOutline),\n inline: \"\"\n }, null, 8, [\"path\"])) : createCommentVNode(\"\", true),\n createTextVNode(\" \" + toDisplayString(_ctx.helperText), 1)\n ], 8, _hoisted_6)) : createCommentVNode(\"\", true)\n ], 2);\n };\n }\n});\nconst NcInputField = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__scopeId\", \"data-v-fccfce00\"]]);\nexport {\n NcInputField as N\n};\n//# sourceMappingURL=NcInputField-CPL-a_MM.mjs.map\n"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_sfc_main","defineComponent","mergeModels","createElementId","__props","__expose","__emit","modelValue","useModel","props","emit","focus","select","attrs","useAttrs","inputElement","useTemplateRef","hasTrailingIcon","computed","internalPlaceholder","isLegacy","isValidLabel","ariaDescribedby","ariaDescribedby2","options","handleInput","event","target","_ctx","_cache","openBlock","createElementBlock","normalizeClass","unref","createElementVNode","mergeProps","toDisplayString","createCommentVNode","withDirectives","renderSlot","vShow","createBlock","NcButton","$event","withCtx","NcIconSvgWrapper","mdiCheck","mdiAlertCircleOutline","createTextVNode","NcInputField","_export_sfc"],"mappings":"sWAQA,MAAMA,EAAa,CAAE,MAAO,2BAA2B,EACjDC,EAAa,CAAC,KAAM,mBAAoB,WAAY,cAAe,OAAQ,OAAO,EAClFC,EAAa,CAAC,KAAK,EACnBC,EAAa,CAAE,MAAO,8CAA8C,EACpEC,EAAa,CACjB,IAAK,EACL,MAAO,+CACT,EACMC,EAAa,CAAC,IAAI,EAClBC,EAA4BC,EAAgB,CAE9C,aAAc,GAEhB,OAAQ,e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