next-element-vue 0.4.3 → 0.4.6
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/dist/index.css +2 -2
- package/dist/index.js +77 -26
- package/dist/index.min.js +3 -3
- package/dist/index.umd.js +85 -33
- package/dist/index.umd.min.js +3 -3
- package/dist/packages/components/dialog/index.d.ts +9 -0
- package/dist/packages/components/dialog/src/index.d.ts +9 -0
- package/dist/packages/components/form/index.d.ts +60 -0
- package/dist/packages/components/form/src/widgets/input-table-select.d.ts +9 -0
- package/dist/packages/components/upload/index.d.ts +3 -1
- package/dist/packages/components/upload/src/index.d.ts +3 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* 作 者:huangteng
|
|
4
4
|
* 邮 箱:htengweb@163.com
|
|
5
|
-
* 当前版本:0.4.
|
|
6
|
-
* 发布日期:2024-
|
|
5
|
+
* 当前版本:0.4.6 v
|
|
6
|
+
* 发布日期:2024-12-02
|
|
7
7
|
* 地 址:https://www.npmjs.com/package/next-element-vue
|
|
8
8
|
*/
|
|
9
9
|
|
|
@@ -4195,6 +4195,10 @@
|
|
|
4195
4195
|
top: {
|
|
4196
4196
|
type: String,
|
|
4197
4197
|
default: "15vh"
|
|
4198
|
+
},
|
|
4199
|
+
nofill: {
|
|
4200
|
+
type: Boolean,
|
|
4201
|
+
default: !1
|
|
4198
4202
|
}
|
|
4199
4203
|
},
|
|
4200
4204
|
emits: [ "close" ],
|
|
@@ -4209,7 +4213,7 @@
|
|
|
4209
4213
|
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(elementPlus.ElDialog, {
|
|
4210
4214
|
modelValue: visible.value,
|
|
4211
4215
|
"onUpdate:modelValue": $event => visible.value = $event,
|
|
4212
|
-
class: [ ns$b.b(), props.className ],
|
|
4216
|
+
class: [ ns$b.b(), props.className, props.nofill && ns$b.b("nofill") ],
|
|
4213
4217
|
style: props.style,
|
|
4214
4218
|
title: props.title,
|
|
4215
4219
|
appendToBody: props.appendToBody,
|
|
@@ -4344,7 +4348,7 @@
|
|
|
4344
4348
|
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s);
|
|
4345
4349
|
}
|
|
4346
4350
|
const ns$9 = useNamespace("form"), InputTableSelect = vue.defineComponent({
|
|
4347
|
-
name: "
|
|
4351
|
+
name: "NextInputTableSelect",
|
|
4348
4352
|
props: {
|
|
4349
4353
|
modelValue: {
|
|
4350
4354
|
type: [ Array, String, Number, Boolean, Object ],
|
|
@@ -4360,6 +4364,10 @@
|
|
|
4360
4364
|
type: Boolean,
|
|
4361
4365
|
default: !1
|
|
4362
4366
|
},
|
|
4367
|
+
closable: {
|
|
4368
|
+
type: Boolean,
|
|
4369
|
+
default: !1
|
|
4370
|
+
},
|
|
4363
4371
|
formParams: {
|
|
4364
4372
|
type: Object,
|
|
4365
4373
|
default: () => ({})
|
|
@@ -4371,7 +4379,10 @@
|
|
|
4371
4379
|
},
|
|
4372
4380
|
emits: [ "select" ],
|
|
4373
4381
|
setup(props, {emit: emit}) {
|
|
4374
|
-
const {t: t} = useLocale(), _disabled = props.disabled, _column = props.column, _placeholder = _column.placeholder || t("next.form.select") + _column.label, _tableDefaultConfig = deepClone(defaultConfig$4), _tableSelectConfig = deepClone(tableSelectConfig), _options = merge$1(_tableDefaultConfig, _tableSelectConfig, _column.tableSelect),
|
|
4382
|
+
const {t: t} = useLocale(), _disabled = props.disabled, _closable = props.closable, _column = props.column, _placeholder = _column.placeholder || t("next.form.select") + _column.label, _tableDefaultConfig = deepClone(defaultConfig$4), _tableSelectConfig = deepClone(tableSelectConfig), _options = merge$1(_tableDefaultConfig, _tableSelectConfig, _column.tableSelect), {value: propsValue, label: propsLabel} = _column.tableSelectProps || {
|
|
4383
|
+
value: "id",
|
|
4384
|
+
label: "name"
|
|
4385
|
+
}, tableSelectDialog = vue.reactive({
|
|
4375
4386
|
visible: !1,
|
|
4376
4387
|
title: _column.label + t("next.form.tableSelect"),
|
|
4377
4388
|
dialogWidth: _options.dialogWidth
|
|
@@ -4392,15 +4403,13 @@
|
|
|
4392
4403
|
tableReactive.data = res.data || [], tableReactive.page.total = res.total || 0,
|
|
4393
4404
|
tableReactive.loading = !1;
|
|
4394
4405
|
}));
|
|
4395
|
-
}, multipleSelection = vue.ref([]);
|
|
4406
|
+
}, multipleSelection = vue.ref([]), sinleSelection = vue.ref("");
|
|
4396
4407
|
_column.tableSelectDefaultValue?.(props.formParams, _column, (rows => {
|
|
4397
|
-
rows?.length && (_column.tableSelectRows = rows, multipleSelection.value = rows
|
|
4408
|
+
rows?.length && (_column.tableSelectRows = rows, multipleSelection.value = rows,
|
|
4409
|
+
sinleSelection.value = rows[0][propsValue]);
|
|
4398
4410
|
}));
|
|
4399
|
-
const
|
|
4411
|
+
const _disabledSelect = vue.computed((() => "radio" === _options.selectType ? !sinleSelection.value : 0 === multipleSelection.value.length)), onResetTableSelect = () => {
|
|
4400
4412
|
multipleSelection.value = [], sinleSelection.value = "";
|
|
4401
|
-
}, {value: propsValue, label: propsLabel} = _column.tableSelectProps || {
|
|
4402
|
-
value: "id",
|
|
4403
|
-
label: "name"
|
|
4404
4413
|
}, onConfirmSelect = () => {
|
|
4405
4414
|
const rows = vue.toRaw(multipleSelection.value), _rows = arrayObjNoRepeat(rows, propsValue);
|
|
4406
4415
|
onCloseTableDialog(), emit("select", _rows);
|
|
@@ -4409,10 +4418,10 @@
|
|
|
4409
4418
|
}, renderSelectTypeContent = (row, index) => {
|
|
4410
4419
|
const rowKey = _options.rowKey, value = valueExist(row[rowKey], index);
|
|
4411
4420
|
return "checkbox" === _options.selectType ? vue.createVNode(elementPlus.ElCheckbox, {
|
|
4412
|
-
|
|
4421
|
+
value: value,
|
|
4413
4422
|
onChange: event => ((event, row) => {
|
|
4414
4423
|
if (event) multipleSelection.value.push(row); else {
|
|
4415
|
-
const index = multipleSelection.value.
|
|
4424
|
+
const index = multipleSelection.value.findIndex((o => o[propsValue] === row[propsValue]));
|
|
4416
4425
|
-1 !== index && multipleSelection.value.splice(index, 1);
|
|
4417
4426
|
}
|
|
4418
4427
|
})(event, vue.toRaw(row))
|
|
@@ -4424,8 +4433,8 @@
|
|
|
4424
4433
|
}, null);
|
|
4425
4434
|
}, tags = vue.ref([]), tagsMore = vue.ref([]), _updateTags = () => {
|
|
4426
4435
|
const rows = arrayObjNoRepeat(multipleSelection.value, propsValue).map((row => ({
|
|
4427
|
-
value: row[propsValue
|
|
4428
|
-
label: row[propsLabel
|
|
4436
|
+
value: row[propsValue],
|
|
4437
|
+
label: row[propsLabel]
|
|
4429
4438
|
})));
|
|
4430
4439
|
rows.length > 1 ? (tags.value = rows.splice(0, 1), tagsMore.value = rows) : (tags.value = rows,
|
|
4431
4440
|
tagsMore.value = []);
|
|
@@ -4436,6 +4445,20 @@
|
|
|
4436
4445
|
deep: !0,
|
|
4437
4446
|
immediate: !0
|
|
4438
4447
|
});
|
|
4448
|
+
const _multipleSelection = vue.ref([]);
|
|
4449
|
+
vue.watch((() => [ props.formParams[_column.prop], multipleSelection.value ]), (() => {
|
|
4450
|
+
_multipleSelection.value = multipleSelection.value.map((o => o[propsValue])), _updateTags();
|
|
4451
|
+
}), {
|
|
4452
|
+
deep: !0,
|
|
4453
|
+
immediate: !0
|
|
4454
|
+
});
|
|
4455
|
+
const _sinleSelection = vue.ref(null);
|
|
4456
|
+
vue.watch((() => [ props.formParams[_column.prop], sinleSelection.value ]), (() => {
|
|
4457
|
+
_sinleSelection.value = sinleSelection.value, _updateTags();
|
|
4458
|
+
}), {
|
|
4459
|
+
deep: !0,
|
|
4460
|
+
immediate: !0
|
|
4461
|
+
});
|
|
4439
4462
|
const _onCloseTag = (tag, i) => {
|
|
4440
4463
|
const rows = vue.toRaw(multipleSelection.value);
|
|
4441
4464
|
rows.splice(i, 1), multipleSelection.value = rows, _updateTags(), emit("select", rows);
|
|
@@ -4448,7 +4471,7 @@
|
|
|
4448
4471
|
}, [ tags?.value.length ? vue.createVNode("span", {
|
|
4449
4472
|
class: ns$9.em("input-table", "value")
|
|
4450
4473
|
}, [ tags.value.map(((tag, index) => vue.createVNode(elementPlus.ElTag, {
|
|
4451
|
-
closable: !
|
|
4474
|
+
closable: !_closable,
|
|
4452
4475
|
onClose: () => _onCloseTag(0, index)
|
|
4453
4476
|
}, {
|
|
4454
4477
|
default: () => [ tag.label ]
|
|
@@ -4461,7 +4484,7 @@
|
|
|
4461
4484
|
default: () => [ vue.createTextVNode("+ "), tagsMore.value.length ]
|
|
4462
4485
|
}),
|
|
4463
4486
|
content: () => tagsMore.value.map(((tag, index) => vue.createVNode(elementPlus.ElTag, {
|
|
4464
|
-
closable: !
|
|
4487
|
+
closable: !_closable,
|
|
4465
4488
|
onClose: () => _onCloseTag(0, index + 1)
|
|
4466
4489
|
}, {
|
|
4467
4490
|
default: () => [ tag.label ]
|
|
@@ -4480,13 +4503,35 @@
|
|
|
4480
4503
|
title: tableSelectDialog.title,
|
|
4481
4504
|
closeOnClickModal: _options.closeOnClickModal,
|
|
4482
4505
|
width: _options.dialogWidth,
|
|
4506
|
+
appendToBody: valueExist(_options.dialogAppendToBody, !0),
|
|
4483
4507
|
modal: !1,
|
|
4484
4508
|
onClose: onCloseTableDialog
|
|
4485
4509
|
}, {
|
|
4486
4510
|
default: () => [ vue.createVNode("div", {
|
|
4487
4511
|
class: ns$9.em("input-table", "content")
|
|
4488
|
-
}, [ vue.createVNode(elementPlus.
|
|
4489
|
-
modelValue:
|
|
4512
|
+
}, [ "checkbox" === _options.selectType ? vue.createVNode(elementPlus.ElCheckboxGroup, {
|
|
4513
|
+
modelValue: _multipleSelection.value
|
|
4514
|
+
}, {
|
|
4515
|
+
default: () => [ vue.createVNode(NextCrudTable, {
|
|
4516
|
+
options: _options,
|
|
4517
|
+
loading: tableReactive.loading,
|
|
4518
|
+
data: tableReactive.data,
|
|
4519
|
+
page: tableReactive.page,
|
|
4520
|
+
"onConfirm-search": onConfirmSearch,
|
|
4521
|
+
"onClick-add-edit": onClickAddEdit
|
|
4522
|
+
}, {
|
|
4523
|
+
default: () => [ vue.createVNode(elementPlus.ElTableColumn, {
|
|
4524
|
+
fixed: "left",
|
|
4525
|
+
label: t("next.table.selection"),
|
|
4526
|
+
width: 55,
|
|
4527
|
+
headerAlign: _options.headerAlign,
|
|
4528
|
+
align: _options.cellAlign
|
|
4529
|
+
}, {
|
|
4530
|
+
default: ({row: row, $index: $index}) => renderSelectTypeContent(row, $index)
|
|
4531
|
+
}) ]
|
|
4532
|
+
}) ]
|
|
4533
|
+
}) : vue.createVNode(elementPlus.ElRadioGroup, {
|
|
4534
|
+
modelValue: _sinleSelection.value
|
|
4490
4535
|
}, {
|
|
4491
4536
|
default: () => [ vue.createVNode(NextCrudTable, {
|
|
4492
4537
|
options: _options,
|
|
@@ -4998,6 +5043,7 @@
|
|
|
4998
5043
|
disabled: valueExist(col.disabled, !1),
|
|
4999
5044
|
readonly: valueExist(col.readonly, !1),
|
|
5000
5045
|
multiple: valueExist(col.multiple, !1),
|
|
5046
|
+
filterable: valueExist(col.filterable, !1),
|
|
5001
5047
|
"collapse-tags-tooltip": !0,
|
|
5002
5048
|
onChange: event => col.onChange?.(event, col, formParams, formColumns)
|
|
5003
5049
|
}, {
|
|
@@ -5229,7 +5275,7 @@
|
|
|
5229
5275
|
};
|
|
5230
5276
|
}
|
|
5231
5277
|
});
|
|
5232
|
-
const NextTreeSelect = withInstall(treeSelect), NextTreeCascader = withInstall(treeCascader), NextForm = withInstall(Element$7);
|
|
5278
|
+
const NextTreeSelect = withInstall(treeSelect), NextTreeCascader = withInstall(treeCascader), NextInputTableSelect = withInstall(InputTableSelect), NextForm = withInstall(Element$7);
|
|
5233
5279
|
var AddEditForm = vue.defineComponent({
|
|
5234
5280
|
name: "AddEditForm",
|
|
5235
5281
|
props: {
|
|
@@ -5732,7 +5778,7 @@
|
|
|
5732
5778
|
default: "image/*"
|
|
5733
5779
|
}
|
|
5734
5780
|
},
|
|
5735
|
-
emits: [ "change" ],
|
|
5781
|
+
emits: [ "change", "remove", "preview" ],
|
|
5736
5782
|
setup() {
|
|
5737
5783
|
const {appContext: appContext} = vue.getCurrentInstance(), {t: t} = useLocale();
|
|
5738
5784
|
return {
|
|
@@ -5763,10 +5809,14 @@
|
|
|
5763
5809
|
}
|
|
5764
5810
|
}) ])
|
|
5765
5811
|
});
|
|
5766
|
-
previewImagesContainer.appContext = this.appContext, vue.render(previewComponent, previewImagesContainer)
|
|
5812
|
+
previewImagesContainer.appContext = this.appContext, vue.render(previewComponent, previewImagesContainer),
|
|
5813
|
+
emit("preview", uploadFile);
|
|
5767
5814
|
},
|
|
5768
5815
|
onChange: (uploadfile, uploadfiles) => {
|
|
5769
5816
|
uploadfilesPreview.value = uploadfiles, emit("change", uploadfile, uploadfiles);
|
|
5817
|
+
},
|
|
5818
|
+
onRemove: (uploadfile, uploadfiles) => {
|
|
5819
|
+
uploadfilesPreview.value = uploadfiles, emit("remove", uploadfile, uploadfiles);
|
|
5770
5820
|
}
|
|
5771
5821
|
}, {
|
|
5772
5822
|
trigger: () => slots.default ? slots.default() : "picture-card" === props.listType ? vue.createVNode(elementPlus.ElIcon, null, {
|
|
@@ -8117,6 +8167,7 @@
|
|
|
8117
8167
|
NextDialog: NextDialog,
|
|
8118
8168
|
NextDragResize: NextDragResize,
|
|
8119
8169
|
NextForm: NextForm,
|
|
8170
|
+
NextInputTableSelect: NextInputTableSelect,
|
|
8120
8171
|
NextLabelimg: NextLabelimg,
|
|
8121
8172
|
NextLabelimgPreview: NextLabelimgPreview,
|
|
8122
8173
|
NextLabelme: NextLabelme,
|
|
@@ -8171,20 +8222,21 @@
|
|
|
8171
8222
|
})(app);
|
|
8172
8223
|
};
|
|
8173
8224
|
var index = {
|
|
8174
|
-
version: "0.4.
|
|
8225
|
+
version: "0.4.6",
|
|
8175
8226
|
install: install
|
|
8176
8227
|
};
|
|
8177
8228
|
exports.NextContainer = NextContainer, exports.NextCrudTable = NextCrudTable, exports.NextCrudTableVirtualized = NextCrudTableVirtualized,
|
|
8178
8229
|
exports.NextDialog = NextDialog, exports.NextDragResize = NextDragResize, exports.NextForm = NextForm,
|
|
8179
|
-
exports.
|
|
8180
|
-
exports.
|
|
8181
|
-
exports.
|
|
8182
|
-
exports.
|
|
8183
|
-
exports.
|
|
8184
|
-
exports.
|
|
8185
|
-
exports.
|
|
8186
|
-
exports.
|
|
8187
|
-
exports.
|
|
8230
|
+
exports.NextInputTableSelect = NextInputTableSelect, exports.NextLabelimg = NextLabelimg,
|
|
8231
|
+
exports.NextLabelimgPreview = NextLabelimgPreview, exports.NextLabelme = NextLabelme,
|
|
8232
|
+
exports.NextLayout = NextLayout, exports.NextMenu = NextMenu, exports.NextSpinLoading = NextSpinLoading,
|
|
8233
|
+
exports.NextTabs = NextTabs, exports.NextTextEllipsis = NextTextEllipsis, exports.NextTreeCascader = NextTreeCascader,
|
|
8234
|
+
exports.NextTreeSelect = NextTreeSelect, exports.NextUpload = NextUpload, exports.NextVideoPlayer = NextVideoPlayer,
|
|
8235
|
+
exports.buildLocaleContext = buildLocaleContext, exports.buildTranslator = buildTranslator,
|
|
8236
|
+
exports.default = index, exports.defaultNamespace = "next", exports.install = install,
|
|
8237
|
+
exports.localeContextKey = localeContextKey, exports.localeLang = localeLang, exports.namespaceContextKey = namespaceContextKey,
|
|
8238
|
+
exports.nextUseCssTheme = nextUseCssTheme, exports.nextUseCssVar = nextUseCssVar,
|
|
8239
|
+
exports.translate = translate, exports.updateThemeColor = color => {
|
|
8188
8240
|
color && nextUseCssTheme("--el-color-primary", color);
|
|
8189
8241
|
}, exports.updateThemeColorCssVar = updateThemeColorCssVar, exports.useDetectVideo = () => ({
|
|
8190
8242
|
detectVideoFrameImage: ({container: container, video: video, modelUrl: modelUrl, classNames: classNames, classInput: classInput = []}, success, error) => modelUrl ? classNames ? void tf__namespace.loadGraphModel(modelUrl).then((model => {
|
|
@@ -8218,7 +8270,7 @@
|
|
|
8218
8270
|
}), exports.useGetDerivedNamespace = useGetDerivedNamespace, exports.useLanguage = (locale, lang) => {
|
|
8219
8271
|
const localeRef = vue.isRef(locale) ? locale : vue.ref(locale), nextLang = localeLang[lang] || localeLang["zh-cn"];
|
|
8220
8272
|
localeRef.value.name = lang, localeRef.value.next = nextLang.next;
|
|
8221
|
-
}, exports.useLocale = useLocale, exports.useNamespace = useNamespace, exports.version = "0.4.
|
|
8273
|
+
}, exports.useLocale = useLocale, exports.useNamespace = useNamespace, exports.version = "0.4.6",
|
|
8222
8274
|
Object.defineProperty(exports, "__esModule", {
|
|
8223
8275
|
value: !0
|
|
8224
8276
|
});
|