paas-component-library 0.9.99 → 0.9.100
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/paas-ui.js +37 -47
- package/dist/paas-ui.umd.cjs +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/paas-ui.js
CHANGED
|
@@ -9110,39 +9110,21 @@ function GH(r, e, t, n, a, f) {
|
|
|
9110
9110
|
const ZH = /* @__PURE__ */ qt(UH, [["render", GH]]), YH = {
|
|
9111
9111
|
name: "PaasSelect",
|
|
9112
9112
|
props: {
|
|
9113
|
-
placeholder: {
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
},
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
default: !1
|
|
9120
|
-
},
|
|
9121
|
-
disabled: {
|
|
9122
|
-
type: Boolean,
|
|
9123
|
-
default: !1
|
|
9124
|
-
},
|
|
9125
|
-
modelValue: {
|
|
9126
|
-
type: [String, Array, Number],
|
|
9127
|
-
default: null
|
|
9128
|
-
},
|
|
9129
|
-
data: {
|
|
9130
|
-
type: Array,
|
|
9131
|
-
default: () => []
|
|
9132
|
-
},
|
|
9133
|
-
params: {
|
|
9134
|
-
type: String,
|
|
9135
|
-
default: ""
|
|
9136
|
-
}
|
|
9113
|
+
placeholder: { type: String, default: "" },
|
|
9114
|
+
multiple: { type: Boolean, default: !1 },
|
|
9115
|
+
disabled: { type: Boolean, default: !1 },
|
|
9116
|
+
modelValue: { type: [String, Array, Number], default: null },
|
|
9117
|
+
data: { type: Array, default: () => [] },
|
|
9118
|
+
params: { type: String, default: "" }
|
|
9137
9119
|
},
|
|
9138
9120
|
data() {
|
|
9139
9121
|
return {
|
|
9140
9122
|
stringValue: null,
|
|
9141
|
-
//
|
|
9123
|
+
// Select绑定值(统一为字符串)
|
|
9142
9124
|
internalOptions: [],
|
|
9143
|
-
// options
|
|
9125
|
+
// options列表,value统一转为字符串
|
|
9144
9126
|
originMap: /* @__PURE__ */ new Map()
|
|
9145
|
-
//
|
|
9127
|
+
// Map<string, any>:记录原始值
|
|
9146
9128
|
};
|
|
9147
9129
|
},
|
|
9148
9130
|
created() {
|
|
@@ -9160,8 +9142,8 @@ const ZH = /* @__PURE__ */ qt(UH, [["render", GH]]), YH = {
|
|
|
9160
9142
|
},
|
|
9161
9143
|
stringValue(r) {
|
|
9162
9144
|
if (this.multiple) {
|
|
9163
|
-
const
|
|
9164
|
-
this.$emit("update:modelValue",
|
|
9145
|
+
const t = (Array.isArray(r) ? r.map((n) => this.originMap.get(n)).filter((n) => n !== void 0) : []).join(",");
|
|
9146
|
+
this.$emit("update:modelValue", t), this.$emit("change", t);
|
|
9165
9147
|
} else {
|
|
9166
9148
|
const e = this.originMap.get(r) ?? null;
|
|
9167
9149
|
this.$emit("update:modelValue", e), this.$emit("change", e);
|
|
@@ -9170,17 +9152,18 @@ const ZH = /* @__PURE__ */ qt(UH, [["render", GH]]), YH = {
|
|
|
9170
9152
|
},
|
|
9171
9153
|
methods: {
|
|
9172
9154
|
initOptions() {
|
|
9173
|
-
|
|
9174
|
-
this.
|
|
9175
|
-
|
|
9176
|
-
|
|
9177
|
-
|
|
9178
|
-
|
|
9155
|
+
var e, t;
|
|
9156
|
+
const r = this.data.length > 0 ? this.data : ((t = (e = this.$store) == null ? void 0 : e.dicts) == null ? void 0 : t[this.params]) || [];
|
|
9157
|
+
this.originMap.clear(), this.internalOptions = r.map((n) => {
|
|
9158
|
+
const a = String(n.value);
|
|
9159
|
+
return this.originMap.set(a, n.value), {
|
|
9160
|
+
...n,
|
|
9161
|
+
value: a
|
|
9179
9162
|
};
|
|
9180
9163
|
});
|
|
9181
9164
|
},
|
|
9182
9165
|
setInternalValue(r) {
|
|
9183
|
-
this.multiple ? Array.isArray(r) ? this.stringValue = r.map((e) => String(e)) : typeof r == "string" && r.includes(",") ? this.stringValue = r.split(",").map((e) =>
|
|
9166
|
+
this.multiple ? Array.isArray(r) ? this.stringValue = r.map((e) => String(e)) : typeof r == "string" && r.includes(",") ? this.stringValue = r.split(",").map((e) => e.trim()) : r != null && r !== "" ? this.stringValue = [String(r)] : this.stringValue = [] : this.stringValue = r != null ? String(r) : null;
|
|
9184
9167
|
}
|
|
9185
9168
|
}
|
|
9186
9169
|
};
|
|
@@ -30321,7 +30304,7 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
30321
30304
|
change(r) {
|
|
30322
30305
|
this.value = Array.isArray(r) ? r : [r], this.selected = this.value;
|
|
30323
30306
|
let e = this.multiple ? this.value : this.value[0];
|
|
30324
|
-
e instanceof Array && (e = e.join(",")),
|
|
30307
|
+
e instanceof Array && (e = e.join(",")), this.$emit("update:modelValue", e), this.$emit("change", e);
|
|
30325
30308
|
},
|
|
30326
30309
|
loadData() {
|
|
30327
30310
|
if (this.loading) return;
|
|
@@ -30430,7 +30413,7 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
30430
30413
|
}, 8, ["span"]);
|
|
30431
30414
|
};
|
|
30432
30415
|
}
|
|
30433
|
-
}), Vce = /* @__PURE__ */ qt(Fce, [["__scopeId", "data-v-
|
|
30416
|
+
}), Vce = /* @__PURE__ */ qt(Fce, [["__scopeId", "data-v-d4c8f37d"]]), Dce = {
|
|
30434
30417
|
name: "FormSelect",
|
|
30435
30418
|
inject: {
|
|
30436
30419
|
labelWidth: {
|
|
@@ -30456,14 +30439,15 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
30456
30439
|
data() {
|
|
30457
30440
|
return {
|
|
30458
30441
|
value: this.multiple ? [] : "",
|
|
30459
|
-
//
|
|
30442
|
+
// PaasSelect绑定值
|
|
30460
30443
|
datas: []
|
|
30461
|
-
//
|
|
30444
|
+
// 转为字符串后的options
|
|
30462
30445
|
};
|
|
30463
30446
|
},
|
|
30464
30447
|
computed: {
|
|
30465
30448
|
see() {
|
|
30466
|
-
|
|
30449
|
+
var r, e;
|
|
30450
|
+
return (e = (r = this.$store) == null ? void 0 : r.forms) == null ? void 0 : e.see;
|
|
30467
30451
|
}
|
|
30468
30452
|
},
|
|
30469
30453
|
watch: {
|
|
@@ -30485,14 +30469,20 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
30485
30469
|
},
|
|
30486
30470
|
methods: {
|
|
30487
30471
|
syncValue(r) {
|
|
30488
|
-
if (
|
|
30472
|
+
if (r == null || r === "") {
|
|
30489
30473
|
this.value = this.multiple ? [] : "";
|
|
30490
30474
|
return;
|
|
30491
30475
|
}
|
|
30492
|
-
this.multiple ? Array.isArray(r) ? this.value = r.
|
|
30476
|
+
this.multiple ? Array.isArray(r) ? this.value = r.map((e) => String(e)) : typeof r == "string" ? this.value = r.split(",").map((e) => e.trim()).filter((e) => e !== "") : this.value = [String(r)] : this.value = String(
|
|
30477
|
+
Array.isArray(r) && r.length > 0 ? r[0] : r
|
|
30478
|
+
);
|
|
30493
30479
|
},
|
|
30494
30480
|
handleChange(r) {
|
|
30495
|
-
this.multiple
|
|
30481
|
+
if (this.multiple) {
|
|
30482
|
+
const e = Array.isArray(r) ? r.join(",") : "";
|
|
30483
|
+
this.$emit("update:modelValue", e), this.$emit("change", e);
|
|
30484
|
+
} else
|
|
30485
|
+
this.$emit("update:modelValue", r), this.$emit("change", r);
|
|
30496
30486
|
}
|
|
30497
30487
|
},
|
|
30498
30488
|
mounted() {
|
|
@@ -30520,10 +30510,10 @@ function Nce(r, e, t, n, a, f) {
|
|
|
30520
30510
|
value: a.value,
|
|
30521
30511
|
disabled: f.see || t.disabled,
|
|
30522
30512
|
mode: t.multiple ? "multiple" : void 0,
|
|
30523
|
-
onChange: f.handleChange,
|
|
30524
30513
|
params: t.params,
|
|
30525
|
-
placeholder: t.placeholder
|
|
30526
|
-
|
|
30514
|
+
placeholder: t.placeholder,
|
|
30515
|
+
onChange: f.handleChange
|
|
30516
|
+
}, null, 8, ["data", "value", "disabled", "mode", "params", "placeholder", "onChange"])
|
|
30527
30517
|
]),
|
|
30528
30518
|
_: 1
|
|
30529
30519
|
}, 8, ["label", "name", "label-col"])
|