@factoringplus/pl-components-pack-v3 0.3.45 → 0.3.48

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.
@@ -42012,6 +42012,35 @@ const _sfc_main$1 = {
42012
42012
  type: String,
42013
42013
  default: ""
42014
42014
  },
42015
+ rules: {
42016
+ type: Object,
42017
+ default: function() {
42018
+ return {};
42019
+ }
42020
+ },
42021
+ prop: {
42022
+ type: String,
42023
+ default: "name"
42024
+ },
42025
+ maxLength: {
42026
+ type: Number,
42027
+ default: 210
42028
+ },
42029
+ minLength: {
42030
+ type: Number
42031
+ },
42032
+ formater: {
42033
+ type: Function,
42034
+ default: function(value) {
42035
+ return value;
42036
+ }
42037
+ },
42038
+ parcer: {
42039
+ type: Function,
42040
+ default: (value) => {
42041
+ return value;
42042
+ }
42043
+ },
42015
42044
  isError: {
42016
42045
  type: Boolean,
42017
42046
  default: false
@@ -42053,6 +42082,12 @@ const _sfc_main$1 = {
42053
42082
  setup(__props, { emit: emit2 }) {
42054
42083
  const props = __props;
42055
42084
  let { modelValue } = toRefs(props);
42085
+ const ruleForm = reactive({
42086
+ [props.prop]: modelValue
42087
+ });
42088
+ watch(modelValue, (newValue) => {
42089
+ ruleForm[props.prop] = newValue;
42090
+ });
42056
42091
  const updateValue = (value) => {
42057
42092
  emit2("update:modelValue", value);
42058
42093
  };
@@ -42072,7 +42107,9 @@ const _sfc_main$1 = {
42072
42107
  return openBlock(), createElementBlock("div", null, [
42073
42108
  createVNode(_component_el_form, {
42074
42109
  "label-position": "top",
42075
- ref: "form"
42110
+ model: ruleForm,
42111
+ ref: "form",
42112
+ rules: __props.rules
42076
42113
  }, {
42077
42114
  default: withCtx(() => [
42078
42115
  createElementVNode("div", {
@@ -42101,13 +42138,17 @@ const _sfc_main$1 = {
42101
42138
  createElementVNode("div", { id }, [
42102
42139
  createVNode(_component_el_form_item, {
42103
42140
  class: normalizeClass({ "is-error": __props.isError }),
42104
- "show-message": false,
42141
+ "show-message": true,
42105
42142
  label: props.label,
42106
- prop: "name"
42143
+ prop: __props.prop
42107
42144
  }, {
42108
42145
  default: withCtx(() => [
42109
42146
  createVNode(_component_el_input, {
42110
42147
  class: normalizeClass({ padding: props.prefix }),
42148
+ formatter: (value) => __props.formater(value),
42149
+ parser: (value) => __props.parcer(value),
42150
+ minlength: __props.minLength,
42151
+ maxlength: __props.maxLength,
42111
42152
  disabled: props.disabled,
42112
42153
  placeholder: props.placeholder,
42113
42154
  modelValue: unref(modelValue),
@@ -42117,18 +42158,19 @@ const _sfc_main$1 = {
42117
42158
  autosize: { minRows: 3, maxRows: 6 },
42118
42159
  clearable: props.clearable && __props.area,
42119
42160
  onInput: updateValue
42120
- }, null, 8, ["class", "disabled", "placeholder", "modelValue", "type", "clearable"])
42161
+ }, null, 8, ["class", "formatter", "parser", "minlength", "maxlength", "disabled", "placeholder", "modelValue", "type", "clearable"])
42121
42162
  ]),
42122
42163
  _: 1
42123
- }, 8, ["class", "label"])
42164
+ }, 8, ["class", "label", "prop"])
42124
42165
  ]),
42125
- createElementVNode("p", {
42166
+ __props.isError ? (openBlock(), createElementBlock("p", {
42167
+ key: 4,
42126
42168
  class: normalizeClass({ isError: props.isError })
42127
- }, toDisplayString(props.helper), 3)
42169
+ }, toDisplayString(props.helper), 3)) : createCommentVNode("", true)
42128
42170
  ], 2)
42129
42171
  ]),
42130
42172
  _: 1
42131
- }, 512)
42173
+ }, 8, ["model", "rules"])
42132
42174
  ]);
42133
42175
  };
42134
42176
  }