@airpower/web 1.5.6 → 1.5.8

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.
@@ -16,6 +16,7 @@ export declare class WebI18n extends I18n {
16
16
  AddSuccess: string;
17
17
  DeleteSuccess: string;
18
18
  SelectPlease: string;
19
+ InputPlease: string;
19
20
  DisableSuccess: string;
20
21
  EnableSuccess: string;
21
22
  Confirm: string;
package/dist/main.js CHANGED
@@ -2165,6 +2165,7 @@ class WebI18n extends I18n {
2165
2165
  AddSuccess = "添加成功";
2166
2166
  DeleteSuccess = "删除成功";
2167
2167
  SelectPlease = "请选择";
2168
+ InputPlease = "请输入";
2168
2169
  DisableSuccess = "禁用成功";
2169
2170
  EnableSuccess = "启用成功";
2170
2171
  Confirm = "确定";
@@ -14035,9 +14036,11 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
14035
14036
  emits("clear");
14036
14037
  }
14037
14038
  const isClearButtonShow = ref(props.showClear);
14039
+ const placeholderRef = ref(props.placeholder);
14038
14040
  const formConfig = ref(void 0);
14039
14041
  const fieldConfig = ref(void 0);
14040
14042
  const fieldName = ref("");
14043
+ const dictionary = ref(void 0);
14041
14044
  function onPropsValueUpdated(newProps) {
14042
14045
  if (newProps) {
14043
14046
  if (newProps.disabled) {
@@ -14066,9 +14069,6 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
14066
14069
  }
14067
14070
  return DateTimeFormatter.FULL_DATE_TIME;
14068
14071
  });
14069
- const dictionary = computed(() => {
14070
- return props.list ? props.list : formConfig.value && fieldConfig.value?.dictionary ? fieldConfig.value.dictionary.toArray() : void 0;
14071
- });
14072
14072
  function getSwitchColor(status) {
14073
14073
  return dictionary.value?.find((item) => !!item.key === status)?.color || "";
14074
14074
  }
@@ -14160,33 +14160,37 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
14160
14160
  }
14161
14161
  }
14162
14162
  }
14163
+ watch([props.list, props.tree], () => {
14164
+ init();
14165
+ }, {
14166
+ deep: true,
14167
+ immediate: true
14168
+ });
14163
14169
  function init() {
14164
14170
  initFieldName();
14165
14171
  if (props.entity && fieldName.value) {
14166
14172
  formConfig.value = getFormConfig(props.entity, fieldName.value);
14167
14173
  fieldConfig.value = getFieldConfig(props.entity, fieldName.value);
14174
+ if (!placeholderRef.value) {
14175
+ const field = fieldConfig.value.label || getFieldConfig(props.entity, fieldName.value).label || fieldName;
14176
+ placeholderRef.value = `请输入${field}...`;
14177
+ if (formConfig.value) {
14178
+ if (dictionary.value || fieldConfig.value.dictionary || props.list || props.tree || formConfig.value.dateType !== void 0) {
14179
+ placeholderRef.value = WebI18n.get().SelectPlease;
14180
+ }
14181
+ if (formConfig.value.placeholder) {
14182
+ placeholderRef.value = formConfig.value.placeholder;
14183
+ }
14184
+ }
14185
+ }
14168
14186
  }
14187
+ dictionary.value = props.list ? props.list : formConfig.value && fieldConfig.value?.dictionary ? fieldConfig.value.dictionary.toArray() : void 0;
14169
14188
  if (props.modelValue === void 0 && formConfig.value?.defaultValue !== void 0) {
14170
14189
  value.value = formConfig.value.defaultValue;
14171
14190
  emitValue();
14172
14191
  }
14173
14192
  onPropsValueUpdated(props);
14174
14193
  }
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
- });
14190
14194
  const slots = useSlots();
14191
14195
  init();
14192
14196
  return (_ctx, _cache) => {
@@ -14237,7 +14241,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
14237
14241
  onFocus: emitFocus,
14238
14242
  onKeydown: onKeyDown
14239
14243
  }, null, 8, ["modelValue", "clearable", "disabled", "format", "placeholder", "prefix-icon", "readonly", "suffix-icon", "value-format"]))
14240
- ], 64)) : dictionary.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
14244
+ ], 64)) : __props.list || dictionary.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
14241
14245
  formConfig.value?.switch ? (openBlock(), createBlock(_component_el_switch, {
14242
14246
  key: 0,
14243
14247
  modelValue: value.value,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@airpower/web",
3
3
  "type": "module",
4
- "version": "1.5.6",
4
+ "version": "1.5.8",
5
5
  "description": "AirPower-Web",
6
6
  "author": {
7
7
  "name": "Hamm",