@airpower/web 1.5.7 → 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.
Files changed (2) hide show
  1. package/dist/main.js +22 -20
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -14036,9 +14036,11 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
14036
14036
  emits("clear");
14037
14037
  }
14038
14038
  const isClearButtonShow = ref(props.showClear);
14039
+ const placeholderRef = ref(props.placeholder);
14039
14040
  const formConfig = ref(void 0);
14040
14041
  const fieldConfig = ref(void 0);
14041
14042
  const fieldName = ref("");
14043
+ const dictionary = ref(void 0);
14042
14044
  function onPropsValueUpdated(newProps) {
14043
14045
  if (newProps) {
14044
14046
  if (newProps.disabled) {
@@ -14067,9 +14069,6 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
14067
14069
  }
14068
14070
  return DateTimeFormatter.FULL_DATE_TIME;
14069
14071
  });
14070
- const dictionary = computed(() => {
14071
- return props.list ? props.list : formConfig.value && fieldConfig.value?.dictionary ? fieldConfig.value.dictionary.toArray() : void 0;
14072
- });
14073
14072
  function getSwitchColor(status) {
14074
14073
  return dictionary.value?.find((item) => !!item.key === status)?.color || "";
14075
14074
  }
@@ -14161,34 +14160,37 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
14161
14160
  }
14162
14161
  }
14163
14162
  }
14163
+ watch([props.list, props.tree], () => {
14164
+ init();
14165
+ }, {
14166
+ deep: true,
14167
+ immediate: true
14168
+ });
14164
14169
  function init() {
14165
14170
  initFieldName();
14166
14171
  if (props.entity && fieldName.value) {
14167
14172
  formConfig.value = getFormConfig(props.entity, fieldName.value);
14168
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
+ }
14169
14186
  }
14187
+ dictionary.value = props.list ? props.list : formConfig.value && fieldConfig.value?.dictionary ? fieldConfig.value.dictionary.toArray() : void 0;
14170
14188
  if (props.modelValue === void 0 && formConfig.value?.defaultValue !== void 0) {
14171
14189
  value.value = formConfig.value.defaultValue;
14172
14190
  emitValue();
14173
14191
  }
14174
14192
  onPropsValueUpdated(props);
14175
14193
  }
14176
- const placeholderRef = computed(() => {
14177
- if (formConfig.value && formConfig.value.placeholder) {
14178
- return formConfig.value.placeholder;
14179
- }
14180
- if (props.placeholder) {
14181
- return props.placeholder;
14182
- }
14183
- if (fieldConfig.value && props.entity) {
14184
- const field = fieldConfig.value.label || getFieldConfig(props.entity, fieldName.value).label;
14185
- if (dictionary.value || fieldConfig.value?.dictionary || props.list || props.tree || formConfig.value?.dateType !== void 0) {
14186
- return `${WebI18n.get().SelectPlease + field}...`;
14187
- }
14188
- return `${WebI18n.get().InputPlease + field}...`;
14189
- }
14190
- return "请输入...";
14191
- });
14192
14194
  const slots = useSlots();
14193
14195
  init();
14194
14196
  return (_ctx, _cache) => {
@@ -14239,7 +14241,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
14239
14241
  onFocus: emitFocus,
14240
14242
  onKeydown: onKeyDown
14241
14243
  }, null, 8, ["modelValue", "clearable", "disabled", "format", "placeholder", "prefix-icon", "readonly", "suffix-icon", "value-format"]))
14242
- ], 64)) : dictionary.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
14244
+ ], 64)) : __props.list || dictionary.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
14243
14245
  formConfig.value?.switch ? (openBlock(), createBlock(_component_el_switch, {
14244
14246
  key: 0,
14245
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.7",
4
+ "version": "1.5.8",
5
5
  "description": "AirPower-Web",
6
6
  "author": {
7
7
  "name": "Hamm",