@newview/file-ui 1.1.6 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/file-ui.js +86 -62
- package/dist/file-ui.umd.cjs +1 -1
- package/package.json +3 -2
- package/types/TextEditor.d.ts +11 -0
package/README.md
CHANGED
package/dist/file-ui.js
CHANGED
|
@@ -772,63 +772,6 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
772
772
|
]);
|
|
773
773
|
}
|
|
774
774
|
const UploadFile = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-decdfed6"]]);
|
|
775
|
-
const propDefine$1 = {
|
|
776
|
-
onlyView: {
|
|
777
|
-
// 是否只读
|
|
778
|
-
type: Boolean,
|
|
779
|
-
default: false
|
|
780
|
-
},
|
|
781
|
-
formItems: {
|
|
782
|
-
// 表单项
|
|
783
|
-
type: Array,
|
|
784
|
-
default: () => []
|
|
785
|
-
},
|
|
786
|
-
formModel: {
|
|
787
|
-
// 表单数据
|
|
788
|
-
type: Object,
|
|
789
|
-
default: () => {
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
};
|
|
793
|
-
const _sfc_main$1 = defineComponent({
|
|
794
|
-
name: "NvComFormUp",
|
|
795
|
-
components: { UploadFile },
|
|
796
|
-
emits: [""],
|
|
797
|
-
props: propDefine$1,
|
|
798
|
-
setup(props, ctx) {
|
|
799
|
-
return new ComFormInstance(props, ctx);
|
|
800
|
-
}
|
|
801
|
-
});
|
|
802
|
-
class ComFormInstance extends BaseInstance {
|
|
803
|
-
// API实例化
|
|
804
|
-
// 全局属性
|
|
805
|
-
constructor(props, ctx) {
|
|
806
|
-
super();
|
|
807
|
-
__publicField(this, "props");
|
|
808
|
-
__publicField(this, "ctx");
|
|
809
|
-
this.props = props;
|
|
810
|
-
this.ctx = ctx;
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
814
|
-
const _component_UploadFile = resolveComponent("UploadFile");
|
|
815
|
-
const _component_NvComForm = resolveComponent("NvComForm");
|
|
816
|
-
return openBlock(), createBlock(_component_NvComForm, {
|
|
817
|
-
onlyView: _ctx.onlyView,
|
|
818
|
-
formItems: _ctx.formItems,
|
|
819
|
-
formModel: _ctx.formModel
|
|
820
|
-
}, {
|
|
821
|
-
extend: withCtx(({ item }) => [
|
|
822
|
-
item.type === "UploadFile" ? (openBlock(), createBlock(_component_UploadFile, {
|
|
823
|
-
key: 0,
|
|
824
|
-
readonly: _ctx.onlyView,
|
|
825
|
-
token: _ctx.formModel[item.model]
|
|
826
|
-
}, null, 8, ["readonly", "token"])) : createCommentVNode("", true)
|
|
827
|
-
]),
|
|
828
|
-
_: 1
|
|
829
|
-
}, 8, ["onlyView", "formItems", "formModel"]);
|
|
830
|
-
}
|
|
831
|
-
const ComFormUp = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
832
775
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
833
776
|
function getDefaultExportFromCjs(x) {
|
|
834
777
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
@@ -15160,7 +15103,7 @@ const QuillEditor = defineComponent({
|
|
|
15160
15103
|
});
|
|
15161
15104
|
const vueQuill_snow = "";
|
|
15162
15105
|
const vueQuill_bubble = "";
|
|
15163
|
-
const propDefine = {
|
|
15106
|
+
const propDefine$1 = {
|
|
15164
15107
|
modelValue: {
|
|
15165
15108
|
default: "",
|
|
15166
15109
|
type: String
|
|
@@ -15174,14 +15117,14 @@ const propDefine = {
|
|
|
15174
15117
|
default: false
|
|
15175
15118
|
}
|
|
15176
15119
|
};
|
|
15177
|
-
const _sfc_main = defineComponent({
|
|
15120
|
+
const _sfc_main$1 = defineComponent({
|
|
15178
15121
|
name: "TextEditor",
|
|
15179
15122
|
components: {
|
|
15180
15123
|
QuillEditor
|
|
15181
15124
|
},
|
|
15182
15125
|
emits: ["update:modelValue", "textChange"],
|
|
15183
15126
|
// 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
|
|
15184
|
-
props: propDefine,
|
|
15127
|
+
props: propDefine$1,
|
|
15185
15128
|
setup(props, ctx) {
|
|
15186
15129
|
return new TextEditor$1(props, ctx);
|
|
15187
15130
|
}
|
|
@@ -15223,6 +15166,9 @@ let TextEditor$1 = class TextEditor extends BaseInstance {
|
|
|
15223
15166
|
}));
|
|
15224
15167
|
// 私有方法 | private 方法名() {}
|
|
15225
15168
|
// 响应式方法 | xxx = () => {}
|
|
15169
|
+
/**
|
|
15170
|
+
* 监听长文本变化
|
|
15171
|
+
*/
|
|
15226
15172
|
__publicField(this, "textChange", () => {
|
|
15227
15173
|
this.ctx.emit("update:modelValue", this.content.value);
|
|
15228
15174
|
this.ctx.emit("textChange", this.content.value);
|
|
@@ -15239,6 +15185,21 @@ let TextEditor$1 = class TextEditor extends BaseInstance {
|
|
|
15239
15185
|
__publicField(this, "deleteTextData", async () => {
|
|
15240
15186
|
await this.fileApi.deleteByToken(this.props.token);
|
|
15241
15187
|
});
|
|
15188
|
+
/**
|
|
15189
|
+
* 删除长文本
|
|
15190
|
+
* @param Token
|
|
15191
|
+
*/
|
|
15192
|
+
__publicField(this, "deleteTextDataByToken", async (Token) => {
|
|
15193
|
+
await this.fileApi.deleteByToken(Token);
|
|
15194
|
+
});
|
|
15195
|
+
/**
|
|
15196
|
+
* 清空长文本
|
|
15197
|
+
*/
|
|
15198
|
+
__publicField(this, "clearTextData", async () => {
|
|
15199
|
+
console.log("clearTextData");
|
|
15200
|
+
this.content.value = "";
|
|
15201
|
+
this.QuillEditorRef.value.setHTML("");
|
|
15202
|
+
});
|
|
15242
15203
|
this.props = props;
|
|
15243
15204
|
this.ctx = ctx;
|
|
15244
15205
|
this.init();
|
|
@@ -15277,7 +15238,7 @@ let TextEditor$1 = class TextEditor extends BaseInstance {
|
|
|
15277
15238
|
};
|
|
15278
15239
|
const TextEditor_vue_vue_type_style_index_0_scoped_5e7ac7cc_lang = "";
|
|
15279
15240
|
const _hoisted_1 = { style: { "height": "100%" } };
|
|
15280
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
15241
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
15281
15242
|
const _component_QuillEditor = resolveComponent("QuillEditor");
|
|
15282
15243
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
15283
15244
|
_ctx.componentShow ? (openBlock(), createBlock(_component_QuillEditor, {
|
|
@@ -15293,7 +15254,70 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
15293
15254
|
}, null, 8, ["content", "readOnly", "theme", "onTextChange", "options"])) : createCommentVNode("", true)
|
|
15294
15255
|
]);
|
|
15295
15256
|
}
|
|
15296
|
-
const TextEditor2 = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-5e7ac7cc"]]);
|
|
15257
|
+
const TextEditor2 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-5e7ac7cc"]]);
|
|
15258
|
+
const propDefine = {
|
|
15259
|
+
onlyView: {
|
|
15260
|
+
// 是否只读
|
|
15261
|
+
type: Boolean,
|
|
15262
|
+
default: false
|
|
15263
|
+
},
|
|
15264
|
+
formItems: {
|
|
15265
|
+
// 表单项
|
|
15266
|
+
type: Array,
|
|
15267
|
+
default: () => []
|
|
15268
|
+
},
|
|
15269
|
+
formModel: {
|
|
15270
|
+
// 表单数据
|
|
15271
|
+
type: Object,
|
|
15272
|
+
default: () => {
|
|
15273
|
+
}
|
|
15274
|
+
}
|
|
15275
|
+
};
|
|
15276
|
+
const _sfc_main = defineComponent({
|
|
15277
|
+
name: "NvComFormUp",
|
|
15278
|
+
components: { UploadFile, TextEditor: TextEditor2 },
|
|
15279
|
+
emits: [""],
|
|
15280
|
+
props: propDefine,
|
|
15281
|
+
setup(props, ctx) {
|
|
15282
|
+
return new ComFormInstance(props, ctx);
|
|
15283
|
+
}
|
|
15284
|
+
});
|
|
15285
|
+
class ComFormInstance extends BaseInstance {
|
|
15286
|
+
// API实例化
|
|
15287
|
+
// 全局属性
|
|
15288
|
+
constructor(props, ctx) {
|
|
15289
|
+
super();
|
|
15290
|
+
__publicField(this, "props");
|
|
15291
|
+
__publicField(this, "ctx");
|
|
15292
|
+
this.props = props;
|
|
15293
|
+
this.ctx = ctx;
|
|
15294
|
+
}
|
|
15295
|
+
}
|
|
15296
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
15297
|
+
const _component_UploadFile = resolveComponent("UploadFile");
|
|
15298
|
+
const _component_TextEditor = resolveComponent("TextEditor");
|
|
15299
|
+
const _component_NvComForm = resolveComponent("NvComForm");
|
|
15300
|
+
return openBlock(), createBlock(_component_NvComForm, {
|
|
15301
|
+
onlyView: _ctx.onlyView,
|
|
15302
|
+
formItems: _ctx.formItems,
|
|
15303
|
+
formModel: _ctx.formModel
|
|
15304
|
+
}, {
|
|
15305
|
+
extend: withCtx(({ item }) => [
|
|
15306
|
+
item.type === "UploadFile" ? (openBlock(), createBlock(_component_UploadFile, {
|
|
15307
|
+
key: 0,
|
|
15308
|
+
readonly: _ctx.onlyView,
|
|
15309
|
+
token: _ctx.formModel[item.model]
|
|
15310
|
+
}, null, 8, ["readonly", "token"])) : createCommentVNode("", true),
|
|
15311
|
+
item.type === "TextEditor" ? (openBlock(), createBlock(_component_TextEditor, {
|
|
15312
|
+
key: 1,
|
|
15313
|
+
readonly: _ctx.onlyView,
|
|
15314
|
+
token: _ctx.formModel[item.model]
|
|
15315
|
+
}, null, 8, ["readonly", "token"])) : createCommentVNode("", true)
|
|
15316
|
+
]),
|
|
15317
|
+
_: 1
|
|
15318
|
+
}, 8, ["onlyView", "formItems", "formModel"]);
|
|
15319
|
+
}
|
|
15320
|
+
const ComFormUp = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
15297
15321
|
export {
|
|
15298
15322
|
filePreview as FilePreview,
|
|
15299
15323
|
ComFormUp as NvComFormUp,
|