@airpower/web 1.5.4 → 1.5.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/main.js +19 -22
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -14035,11 +14035,9 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
14035
14035
|
emits("clear");
|
|
14036
14036
|
}
|
|
14037
14037
|
const isClearButtonShow = ref(props.showClear);
|
|
14038
|
-
const placeholderRef = ref(props.placeholder);
|
|
14039
14038
|
const formConfig = ref(void 0);
|
|
14040
14039
|
const fieldConfig = ref(void 0);
|
|
14041
14040
|
const fieldName = ref("");
|
|
14042
|
-
const dictionary = ref(void 0);
|
|
14043
14041
|
function onPropsValueUpdated(newProps) {
|
|
14044
14042
|
if (newProps) {
|
|
14045
14043
|
if (newProps.disabled) {
|
|
@@ -14068,6 +14066,9 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
14068
14066
|
}
|
|
14069
14067
|
return DateTimeFormatter.FULL_DATE_TIME;
|
|
14070
14068
|
});
|
|
14069
|
+
const dictionary = computed(() => {
|
|
14070
|
+
return props.list ? props.list : formConfig.value && fieldConfig.value?.dictionary ? fieldConfig.value.dictionary.toArray() : void 0;
|
|
14071
|
+
});
|
|
14071
14072
|
function getSwitchColor(status) {
|
|
14072
14073
|
return dictionary.value?.find((item) => !!item.key === status)?.color || "";
|
|
14073
14074
|
}
|
|
@@ -14147,12 +14148,6 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
14147
14148
|
emitValue();
|
|
14148
14149
|
emitBlur();
|
|
14149
14150
|
}
|
|
14150
|
-
watch([props.list, props.tree], () => {
|
|
14151
|
-
dictionary.value = props.list ? props.list : formConfig.value && fieldConfig.value?.dictionary ? fieldConfig.value.dictionary.toArray() : void 0;
|
|
14152
|
-
}, {
|
|
14153
|
-
deep: true,
|
|
14154
|
-
immediate: true
|
|
14155
|
-
});
|
|
14156
14151
|
watch(value, () => {
|
|
14157
14152
|
emitValue();
|
|
14158
14153
|
});
|
|
@@ -14170,26 +14165,28 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
14170
14165
|
if (props.entity && fieldName.value) {
|
|
14171
14166
|
formConfig.value = getFormConfig(props.entity, fieldName.value);
|
|
14172
14167
|
fieldConfig.value = getFieldConfig(props.entity, fieldName.value);
|
|
14173
|
-
if (!placeholderRef.value) {
|
|
14174
|
-
const field = fieldConfig.value.label || getFieldConfig(props.entity, fieldName.value).label || fieldName;
|
|
14175
|
-
placeholderRef.value = `请输入${field}...`;
|
|
14176
|
-
if (formConfig.value) {
|
|
14177
|
-
if (dictionary.value || fieldConfig.value.dictionary || props.list || props.tree || formConfig.value.dateType !== void 0) {
|
|
14178
|
-
placeholderRef.value = WebI18n.get().SelectPlease;
|
|
14179
|
-
}
|
|
14180
|
-
if (formConfig.value.placeholder) {
|
|
14181
|
-
placeholderRef.value = formConfig.value.placeholder;
|
|
14182
|
-
}
|
|
14183
|
-
}
|
|
14184
|
-
}
|
|
14185
14168
|
}
|
|
14186
|
-
dictionary.value = props.list ? props.list : formConfig.value && fieldConfig.value?.dictionary ? fieldConfig.value.dictionary.toArray() : void 0;
|
|
14187
14169
|
if (props.modelValue === void 0 && formConfig.value?.defaultValue !== void 0) {
|
|
14188
14170
|
value.value = formConfig.value.defaultValue;
|
|
14189
14171
|
emitValue();
|
|
14190
14172
|
}
|
|
14191
14173
|
onPropsValueUpdated(props);
|
|
14192
14174
|
}
|
|
14175
|
+
const placeholderRef = computed(() => {
|
|
14176
|
+
if (fieldConfig.value && props.entity) {
|
|
14177
|
+
if (formConfig.value) {
|
|
14178
|
+
if (dictionary.value || fieldConfig.value?.dictionary || props.list || props.tree || formConfig.value.dateType !== void 0) {
|
|
14179
|
+
return WebI18n.get().SelectPlease;
|
|
14180
|
+
}
|
|
14181
|
+
if (formConfig.value.placeholder) {
|
|
14182
|
+
return formConfig.value.placeholder;
|
|
14183
|
+
}
|
|
14184
|
+
}
|
|
14185
|
+
const field = fieldConfig.value.label || getFieldConfig(props.entity, fieldName.value).label || fieldName;
|
|
14186
|
+
return `请输入${field}...`;
|
|
14187
|
+
}
|
|
14188
|
+
return props.placeholder || "请输入...";
|
|
14189
|
+
});
|
|
14193
14190
|
const slots = useSlots();
|
|
14194
14191
|
init();
|
|
14195
14192
|
return (_ctx, _cache) => {
|
|
@@ -14240,7 +14237,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
14240
14237
|
onFocus: emitFocus,
|
|
14241
14238
|
onKeydown: onKeyDown
|
|
14242
14239
|
}, null, 8, ["modelValue", "clearable", "disabled", "format", "placeholder", "prefix-icon", "readonly", "suffix-icon", "value-format"]))
|
|
14243
|
-
], 64)) :
|
|
14240
|
+
], 64)) : dictionary.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
14244
14241
|
formConfig.value?.switch ? (openBlock(), createBlock(_component_el_switch, {
|
|
14245
14242
|
key: 0,
|
|
14246
14243
|
modelValue: value.value,
|