ocpview-pro 0.1.17 → 0.1.19

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/index.js CHANGED
@@ -10740,13 +10740,43 @@ const _sfc_main$1J = {
10740
10740
  return this.isMaskMode ? "text" : this.myConfig.vtype;
10741
10741
  }
10742
10742
  },
10743
+ mounted() {
10744
+ if (this.isMaskMode) {
10745
+ this.$nextTick(() => {
10746
+ this.hardenMaskInput();
10747
+ });
10748
+ }
10749
+ },
10750
+ updated() {
10751
+ if (this.isMaskMode) {
10752
+ this.$nextTick(() => {
10753
+ this.hardenMaskInput();
10754
+ });
10755
+ }
10756
+ },
10743
10757
  methods: {
10758
+ hardenMaskInput() {
10759
+ const comp = this.$refs.myControl;
10760
+ if (!comp || !comp.$el)
10761
+ return;
10762
+ const inputEl = comp.$el.querySelector ? comp.$el.querySelector("input") : null;
10763
+ if (!inputEl)
10764
+ return;
10765
+ if (inputEl.type !== "text") {
10766
+ inputEl.setAttribute("type", "text");
10767
+ }
10768
+ inputEl.setAttribute("autocomplete", "off");
10769
+ inputEl.setAttribute("name", "mask-field");
10770
+ inputEl.setAttribute("data-lpignore", "true");
10771
+ inputEl.setAttribute("data-1p-ignore", "true");
10772
+ inputEl.setAttribute("data-form-type", "other");
10773
+ },
10744
10774
  toggleMask() {
10745
10775
  this.maskVisible = !this.maskVisible;
10746
10776
  },
10747
10777
  keyUp(e11) {
10748
10778
  if (this.myConfig.notSpecial) {
10749
- e11.target.value = e11.target.value.replace(/[`~!@$%^&*()_\-+=<>?:"{}|,\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/g, "");
10779
+ e11.target.value = e11.target.value.replace(/[`~!@$%^&*()_+=<>?:"{}|,\/;'\\[\]·~!@¥%……&*()+={}|《》?:“”【】、;‘’,。、-]/g, "");
10750
10780
  }
10751
10781
  },
10752
10782
  customInit() {
@@ -10797,10 +10827,88 @@ function _sfc_render$1w(_ctx, _cache, $props, $setup, $data, $options) {
10797
10827
  return withDirectives((openBlock(), createElementBlock("div", {
10798
10828
  class: normalizeClass(["textbox-wrapper", { "textbox-mask": $options.isMaskMode, "textbox-mask-visible": $options.isMaskMode && $data.maskVisible }])
10799
10829
  }, [
10800
- createVNode(_component_Input, {
10830
+ $options.isMaskMode ? (openBlock(), createElementBlock("form", {
10831
+ key: 0,
10832
+ autocomplete: "off",
10833
+ onSubmit: _cache[1] || (_cache[1] = withModifiers(() => {
10834
+ }, ["prevent"])),
10835
+ style: { "margin": "0", "padding": "0" }
10836
+ }, [
10837
+ _cache[3] || (_cache[3] = createElementVNode("input", {
10838
+ type: "text",
10839
+ name: "username",
10840
+ autocomplete: "off",
10841
+ tabindex: "-1",
10842
+ "aria-hidden": "true",
10843
+ style: { "position": "absolute", "left": "-9999px", "width": "1px", "height": "1px", "opacity": "0" }
10844
+ }, null, -1)),
10845
+ _cache[4] || (_cache[4] = createElementVNode("input", {
10846
+ type: "password",
10847
+ name: "password",
10848
+ autocomplete: "off",
10849
+ tabindex: "-1",
10850
+ "aria-hidden": "true",
10851
+ style: { "position": "absolute", "left": "-9999px", "width": "1px", "height": "1px", "opacity": "0" }
10852
+ }, null, -1)),
10853
+ createVNode(_component_Input, {
10854
+ ref: "myControl",
10855
+ modelValue: _ctx.value,
10856
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.value = $event),
10857
+ size: $data.myConfig.size,
10858
+ type: $options.inputType,
10859
+ password: $data.passwordFlag,
10860
+ autocomplete: "off",
10861
+ name: "mask-field",
10862
+ "data-lpignore": "true",
10863
+ "data-1p-ignore": "true",
10864
+ "data-form-type": "other",
10865
+ role: "textbox",
10866
+ rows: $data.myConfig.rows,
10867
+ placeholder: $data.myConfig.placeholder,
10868
+ maxlength: $data.myConfig.maxLength,
10869
+ disabled: $data.myConfig.readOnly,
10870
+ clearable: $data.myConfig.clearable,
10871
+ readonly: !$data.myConfig.allowInput,
10872
+ onKeydown: withKeys(withModifiers($options._enterSetFatherValue, ["stop"]), ["enter"]),
10873
+ onKeyup: $options.keyUp,
10874
+ onOnBlur: _ctx.setFatherValue,
10875
+ search: $data.myConfig.search,
10876
+ onOnSearch: $options.search
10877
+ }, createSlots({ _: 2 }, [
10878
+ $data.myConfig.maskToggle ? {
10879
+ name: "suffix",
10880
+ fn: withCtx(() => [
10881
+ createVNode(_component_Icon, {
10882
+ type: $data.maskVisible ? "md-eye-off" : "md-eye",
10883
+ onClick: withModifiers($options.toggleMask, ["stop"]),
10884
+ style: { "cursor": "pointer", "font-size": "16px" }
10885
+ }, null, 8, ["type", "onClick"])
10886
+ ]),
10887
+ key: "0"
10888
+ } : void 0,
10889
+ $data.myConfig.showAppend ? {
10890
+ name: "append",
10891
+ fn: withCtx(() => [
10892
+ createVNode(_component_Button, {
10893
+ size: $data.myConfig.size,
10894
+ type: "primary",
10895
+ disabled: $data.myConfig.readOnly,
10896
+ onClick: $options.appendClick
10897
+ }, {
10898
+ default: withCtx(() => [
10899
+ createTextVNode(toDisplayString$1($data.myConfig.appendText), 1)
10900
+ ]),
10901
+ _: 1
10902
+ }, 8, ["size", "disabled", "onClick"])
10903
+ ]),
10904
+ key: "1"
10905
+ } : void 0
10906
+ ]), 1032, ["modelValue", "size", "type", "password", "rows", "placeholder", "maxlength", "disabled", "clearable", "readonly", "onKeydown", "onKeyup", "onOnBlur", "search", "onOnSearch"])
10907
+ ], 32)) : (openBlock(), createBlock(_component_Input, {
10908
+ key: 1,
10801
10909
  ref: "myControl",
10802
10910
  modelValue: _ctx.value,
10803
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.value = $event),
10911
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.value = $event),
10804
10912
  size: $data.myConfig.size,
10805
10913
  type: $options.inputType,
10806
10914
  password: $data.passwordFlag,
@@ -10816,17 +10924,6 @@ function _sfc_render$1w(_ctx, _cache, $props, $setup, $data, $options) {
10816
10924
  search: $data.myConfig.search,
10817
10925
  onOnSearch: $options.search
10818
10926
  }, createSlots({ _: 2 }, [
10819
- $options.isMaskMode && $data.myConfig.maskToggle ? {
10820
- name: "suffix",
10821
- fn: withCtx(() => [
10822
- createVNode(_component_Icon, {
10823
- type: $data.maskVisible ? "md-eye-off" : "md-eye",
10824
- onClick: withModifiers($options.toggleMask, ["stop"]),
10825
- style: { "cursor": "pointer", "font-size": "16px" }
10826
- }, null, 8, ["type", "onClick"])
10827
- ]),
10828
- key: "0"
10829
- } : void 0,
10830
10927
  $data.myConfig.showAppend ? {
10831
10928
  name: "append",
10832
10929
  fn: withCtx(() => [
@@ -10842,14 +10939,14 @@ function _sfc_render$1w(_ctx, _cache, $props, $setup, $data, $options) {
10842
10939
  _: 1
10843
10940
  }, 8, ["size", "disabled", "onClick"])
10844
10941
  ]),
10845
- key: "1"
10942
+ key: "0"
10846
10943
  } : void 0
10847
- ]), 1032, ["modelValue", "size", "type", "password", "rows", "placeholder", "maxlength", "disabled", "clearable", "readonly", "onKeydown", "onKeyup", "onOnBlur", "search", "onOnSearch"])
10944
+ ]), 1032, ["modelValue", "size", "type", "password", "rows", "placeholder", "maxlength", "disabled", "clearable", "readonly", "onKeydown", "onKeyup", "onOnBlur", "search", "onOnSearch"]))
10848
10945
  ], 2)), [
10849
10946
  [vShow, $data.myConfig.visible]
10850
10947
  ]);
10851
10948
  }
10852
- var TextBox = /* @__PURE__ */ _export_sfc$1(_sfc_main$1J, [["render", _sfc_render$1w], ["__scopeId", "data-v-63864133"]]);
10949
+ var TextBox = /* @__PURE__ */ _export_sfc$1(_sfc_main$1J, [["render", _sfc_render$1w], ["__scopeId", "data-v-0fec4f11"]]);
10853
10950
  const _sfc_main$1I = {
10854
10951
  name: "uploadbox",
10855
10952
  data() {