@mdsfe/mds-ui 0.3.0-17 → 0.3.0-18

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.
@@ -35545,14 +35545,18 @@ var search_component = normalizeComponent(
35545
35545
  )
35546
35546
 
35547
35547
  /* harmony default export */ var search = (search_component.exports);
35548
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/input/textarea.vue?vue&type=template&id=91122ef4&
35549
- var textareavue_type_template_id_91122ef4_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:(_vm.prefixCls + "-content " + (_vm.disabled ? 'disable' : ''))},[_c('textarea',{directives:[{name:"model",rawName:"v-model",value:(_vm.valueData),expression:"valueData"}],ref:"textAreaRef",class:[
35550
- (_vm.prefixCls + " " + _vm.prefixCls + "-textarea"),
35551
- _vm.disabled ? 'mds-input-disabled' : '' ],style:(_vm.textareaStyles),attrs:{"maxlength":_vm.max_length,"minlength":_vm.min_length,"rows":_vm.rows,"placeholder":_vm.placeholder,"disabled":_vm.disabled},domProps:{"value":(_vm.valueData)},on:{"input":[function($event){if($event.target.composing){ return; }_vm.valueData=$event.target.value},_vm.handleInput],"keypress":_vm.handleKeyDown,"change":_vm.handleChange,"focus":_vm.handleFocus,"blur":_vm.handleBlur}}),_vm._v(" "),(_vm.showLimit && _vm.max_length)?_c('span',{class:(_vm.prefixCls + "-show-limit")},[_vm._v(_vm._s(_vm.number)+"/"+_vm._s(_vm.max_length))]):_vm._e()])}
35552
- var textareavue_type_template_id_91122ef4_staticRenderFns = []
35548
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/input/textarea.vue?vue&type=template&id=55f2aeec&
35549
+ var textareavue_type_template_id_55f2aeec_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:(_vm.prefixCls + "-content " + (_vm.disabled ? 'disable' : ''))},[(_vm.showLimitPosition === 'inside')?_c('div',{staticClass:"mds-input-textarea-wrapper"},[_c('textarea',{directives:[{name:"model",rawName:"v-model",value:(_vm.valueData),expression:"valueData"}],ref:"textAreaRef",class:[
35550
+ (_vm.prefixCls + " " + _vm.prefixCls + "-textarea"),
35551
+ _vm.disabled ? 'mds-input-disabled' : '' ],style:(_vm.textareaStyles),attrs:{"maxlength":_vm.max_length,"minlength":_vm.min_length,"rows":_vm.rows,"placeholder":_vm.placeholder,"disabled":_vm.disabled},domProps:{"value":(_vm.valueData)},on:{"input":[function($event){if($event.target.composing){ return; }_vm.valueData=$event.target.value},_vm.handleInput],"keypress":_vm.handleKeyDown,"change":_vm.handleChange,"focus":_vm.handleFocus,"blur":_vm.handleBlur}}),_vm._v(" "),(_vm.max_length)?_c('span',{class:['mds-input-show-limit', 'mds-input-show-limit--inside']},[_vm._v(_vm._s(_vm.number)+"/"+_vm._s(_vm.max_length))]):_vm._e()]):(_vm.showLimitPosition === 'outside')?[_c('textarea',{directives:[{name:"model",rawName:"v-model",value:(_vm.valueData),expression:"valueData"}],ref:"textAreaRef",class:[
35552
+ (_vm.prefixCls + " " + _vm.prefixCls + "-textarea"),
35553
+ _vm.disabled ? 'mds-input-disabled' : '' ],style:(_vm.textareaStyles),attrs:{"maxlength":_vm.max_length,"minlength":_vm.min_length,"rows":_vm.rows,"placeholder":_vm.placeholder,"disabled":_vm.disabled},domProps:{"value":(_vm.valueData)},on:{"input":[function($event){if($event.target.composing){ return; }_vm.valueData=$event.target.value},_vm.handleInput],"keypress":_vm.handleKeyDown,"change":_vm.handleChange,"focus":_vm.handleFocus,"blur":_vm.handleBlur}}),_vm._v(" "),(_vm.max_length)?_c('span',{class:['mds-input-show-limit']},[_vm._v(_vm._s(_vm.number)+"/"+_vm._s(_vm.max_length))]):_vm._e()]:[_c('textarea',{directives:[{name:"model",rawName:"v-model",value:(_vm.valueData),expression:"valueData"}],ref:"textAreaRef",class:[
35554
+ (_vm.prefixCls + " " + _vm.prefixCls + "-textarea"),
35555
+ _vm.disabled ? 'mds-input-disabled' : '' ],style:(_vm.textareaStyles),attrs:{"maxlength":_vm.max_length,"minlength":_vm.min_length,"rows":_vm.rows,"placeholder":_vm.placeholder,"disabled":_vm.disabled},domProps:{"value":(_vm.valueData)},on:{"input":[function($event){if($event.target.composing){ return; }_vm.valueData=$event.target.value},_vm.handleInput],"keypress":_vm.handleKeyDown,"change":_vm.handleChange,"focus":_vm.handleFocus,"blur":_vm.handleBlur}})]],2)}
35556
+ var textareavue_type_template_id_55f2aeec_staticRenderFns = []
35553
35557
 
35554
35558
 
35555
- // CONCATENATED MODULE: ./components/input/textarea.vue?vue&type=template&id=91122ef4&
35559
+ // CONCATENATED MODULE: ./components/input/textarea.vue?vue&type=template&id=55f2aeec&
35556
35560
 
35557
35561
  // CONCATENATED MODULE: ./components/input/calculateNodeHeight.js
35558
35562
  // Thanks to https://github.com/andreypopp/react-textarea-autosize/
@@ -35705,6 +35709,55 @@ function calculateNodeHeight(uiTextNode) {
35705
35709
  //
35706
35710
  //
35707
35711
  //
35712
+ //
35713
+ //
35714
+ //
35715
+ //
35716
+ //
35717
+ //
35718
+ //
35719
+ //
35720
+ //
35721
+ //
35722
+ //
35723
+ //
35724
+ //
35725
+ //
35726
+ //
35727
+ //
35728
+ //
35729
+ //
35730
+ //
35731
+ //
35732
+ //
35733
+ //
35734
+ //
35735
+ //
35736
+ //
35737
+ //
35738
+ //
35739
+ //
35740
+ //
35741
+ //
35742
+ //
35743
+ //
35744
+ //
35745
+ //
35746
+ //
35747
+ //
35748
+ //
35749
+ //
35750
+ //
35751
+ //
35752
+ //
35753
+ //
35754
+ //
35755
+ //
35756
+ //
35757
+ //
35758
+ //
35759
+ //
35760
+ //
35708
35761
 
35709
35762
 
35710
35763
 
@@ -35747,8 +35800,8 @@ function clearNextFrameAction(nextFrameId) {
35747
35800
  default: 4
35748
35801
  },
35749
35802
  showLimit: {
35750
- type: Boolean,
35751
- default: false
35803
+ type: [Boolean, String],
35804
+ default: undefined
35752
35805
  },
35753
35806
  placeholder: {
35754
35807
  type: String,
@@ -35781,6 +35834,11 @@ function clearNextFrameAction(nextFrameId) {
35781
35834
  },
35782
35835
  min_length: function min_length() {
35783
35836
  return this.$attrs.minlength || this.minlength;
35837
+ },
35838
+ showLimitPosition: function showLimitPosition() {
35839
+ if (this.showLimit === 'outside') return 'outside';
35840
+ if (this.showLimit === true || this.showLimit === 'inside') return 'inside';
35841
+ return null; // 不显示
35784
35842
  }
35785
35843
  },
35786
35844
  watch: {
@@ -35863,8 +35921,8 @@ function clearNextFrameAction(nextFrameId) {
35863
35921
 
35864
35922
  var textarea_component = normalizeComponent(
35865
35923
  input_textareavue_type_script_lang_js_,
35866
- textareavue_type_template_id_91122ef4_render,
35867
- textareavue_type_template_id_91122ef4_staticRenderFns,
35924
+ textareavue_type_template_id_55f2aeec_render,
35925
+ textareavue_type_template_id_55f2aeec_staticRenderFns,
35868
35926
  false,
35869
35927
  null,
35870
35928
  null,
@@ -7643,12 +7643,6 @@ textarea.mds-input {
7643
7643
  .mds-input-textarea {
7644
7644
  resize: vertical;
7645
7645
  }
7646
- .mds-input-show-limit {
7647
- background: #fff;
7648
- position: absolute;
7649
- bottom: 5px;
7650
- right: 10px;
7651
- }
7652
7646
  .disable .mds-input:hover {
7653
7647
  border-color: #d8dce6 !important;
7654
7648
  }
@@ -7656,3 +7650,23 @@ textarea.mds-input {
7656
7650
  color: #d8dce6 !important;
7657
7651
  background-color: #fafafd;
7658
7652
  }
7653
+ .mds-input-show-limit {
7654
+ color: #999;
7655
+ font-size: 12px;
7656
+ line-height: 1;
7657
+ display: block;
7658
+ text-align: right;
7659
+ margin-top: 4px;
7660
+ }
7661
+ .mds-input-show-limit--inside {
7662
+ position: absolute;
7663
+ right: 8px;
7664
+ bottom: 8px;
7665
+ background: rgba(255, 255, 255, 0.7);
7666
+ padding: 0 4px;
7667
+ pointer-events: none;
7668
+ }
7669
+ .mds-input-textarea-wrapper {
7670
+ position: relative;
7671
+ width: 100%;
7672
+ }
@@ -7643,12 +7643,6 @@ textarea.mds-input {
7643
7643
  .mds-input-textarea {
7644
7644
  resize: vertical;
7645
7645
  }
7646
- .mds-input-show-limit {
7647
- background: #fff;
7648
- position: absolute;
7649
- bottom: 5px;
7650
- right: 10px;
7651
- }
7652
7646
  .disable .mds-input:hover {
7653
7647
  border-color: #d8dce6 !important;
7654
7648
  }
@@ -7656,6 +7650,26 @@ textarea.mds-input {
7656
7650
  color: #d8dce6 !important;
7657
7651
  background-color: #fafafd;
7658
7652
  }
7653
+ .mds-input-show-limit {
7654
+ color: #999;
7655
+ font-size: 12px;
7656
+ line-height: 1;
7657
+ display: block;
7658
+ text-align: right;
7659
+ margin-top: 4px;
7660
+ }
7661
+ .mds-input-show-limit--inside {
7662
+ position: absolute;
7663
+ right: 8px;
7664
+ bottom: 8px;
7665
+ background: rgba(255, 255, 255, 0.7);
7666
+ padding: 0 4px;
7667
+ pointer-events: none;
7668
+ }
7669
+ .mds-input-textarea-wrapper {
7670
+ position: relative;
7671
+ width: 100%;
7672
+ }
7659
7673
  /* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
7660
7674
  /* stylelint-disable declaration-bang-space-before */
7661
7675
  /* stylelint-disable declaration-bang-space-before */
package/dist/text.js CHANGED
@@ -720,51 +720,150 @@ var render = function () {
720
720
  "div",
721
721
  { class: _vm.prefixCls + "-content " + (_vm.disabled ? "disable" : "") },
722
722
  [
723
- _c("textarea", {
724
- directives: [
725
- {
726
- name: "model",
727
- rawName: "v-model",
728
- value: _vm.valueData,
729
- expression: "valueData",
730
- },
731
- ],
732
- ref: "textAreaRef",
733
- class: [
734
- _vm.prefixCls + " " + _vm.prefixCls + "-textarea",
735
- _vm.disabled ? "mds-input-disabled" : "",
736
- ],
737
- style: _vm.textareaStyles,
738
- attrs: {
739
- maxlength: _vm.max_length,
740
- minlength: _vm.min_length,
741
- rows: _vm.rows,
742
- placeholder: _vm.placeholder,
743
- disabled: _vm.disabled,
744
- },
745
- domProps: { value: _vm.valueData },
746
- on: {
747
- input: [
748
- function ($event) {
749
- if ($event.target.composing) {
750
- return
751
- }
752
- _vm.valueData = $event.target.value
753
- },
754
- _vm.handleInput,
755
- ],
756
- keypress: _vm.handleKeyDown,
757
- change: _vm.handleChange,
758
- focus: _vm.handleFocus,
759
- blur: _vm.handleBlur,
760
- },
761
- }),
762
- _vm.showLimit && _vm.max_length
763
- ? _c("span", { class: _vm.prefixCls + "-show-limit" }, [
764
- _vm._v(_vm._s(_vm.number) + "/" + _vm._s(_vm.max_length)),
723
+ _vm.showLimitPosition === "inside"
724
+ ? _c("div", { staticClass: "mds-input-textarea-wrapper" }, [
725
+ _c("textarea", {
726
+ directives: [
727
+ {
728
+ name: "model",
729
+ rawName: "v-model",
730
+ value: _vm.valueData,
731
+ expression: "valueData",
732
+ },
733
+ ],
734
+ ref: "textAreaRef",
735
+ class: [
736
+ _vm.prefixCls + " " + _vm.prefixCls + "-textarea",
737
+ _vm.disabled ? "mds-input-disabled" : "",
738
+ ],
739
+ style: _vm.textareaStyles,
740
+ attrs: {
741
+ maxlength: _vm.max_length,
742
+ minlength: _vm.min_length,
743
+ rows: _vm.rows,
744
+ placeholder: _vm.placeholder,
745
+ disabled: _vm.disabled,
746
+ },
747
+ domProps: { value: _vm.valueData },
748
+ on: {
749
+ input: [
750
+ function ($event) {
751
+ if ($event.target.composing) {
752
+ return
753
+ }
754
+ _vm.valueData = $event.target.value
755
+ },
756
+ _vm.handleInput,
757
+ ],
758
+ keypress: _vm.handleKeyDown,
759
+ change: _vm.handleChange,
760
+ focus: _vm.handleFocus,
761
+ blur: _vm.handleBlur,
762
+ },
763
+ }),
764
+ _vm.max_length
765
+ ? _c(
766
+ "span",
767
+ {
768
+ class: [
769
+ "mds-input-show-limit",
770
+ "mds-input-show-limit--inside",
771
+ ],
772
+ },
773
+ [_vm._v(_vm._s(_vm.number) + "/" + _vm._s(_vm.max_length))]
774
+ )
775
+ : _vm._e(),
765
776
  ])
766
- : _vm._e(),
767
- ]
777
+ : _vm.showLimitPosition === "outside"
778
+ ? [
779
+ _c("textarea", {
780
+ directives: [
781
+ {
782
+ name: "model",
783
+ rawName: "v-model",
784
+ value: _vm.valueData,
785
+ expression: "valueData",
786
+ },
787
+ ],
788
+ ref: "textAreaRef",
789
+ class: [
790
+ _vm.prefixCls + " " + _vm.prefixCls + "-textarea",
791
+ _vm.disabled ? "mds-input-disabled" : "",
792
+ ],
793
+ style: _vm.textareaStyles,
794
+ attrs: {
795
+ maxlength: _vm.max_length,
796
+ minlength: _vm.min_length,
797
+ rows: _vm.rows,
798
+ placeholder: _vm.placeholder,
799
+ disabled: _vm.disabled,
800
+ },
801
+ domProps: { value: _vm.valueData },
802
+ on: {
803
+ input: [
804
+ function ($event) {
805
+ if ($event.target.composing) {
806
+ return
807
+ }
808
+ _vm.valueData = $event.target.value
809
+ },
810
+ _vm.handleInput,
811
+ ],
812
+ keypress: _vm.handleKeyDown,
813
+ change: _vm.handleChange,
814
+ focus: _vm.handleFocus,
815
+ blur: _vm.handleBlur,
816
+ },
817
+ }),
818
+ _vm.max_length
819
+ ? _c("span", { class: ["mds-input-show-limit"] }, [
820
+ _vm._v(_vm._s(_vm.number) + "/" + _vm._s(_vm.max_length)),
821
+ ])
822
+ : _vm._e(),
823
+ ]
824
+ : [
825
+ _c("textarea", {
826
+ directives: [
827
+ {
828
+ name: "model",
829
+ rawName: "v-model",
830
+ value: _vm.valueData,
831
+ expression: "valueData",
832
+ },
833
+ ],
834
+ ref: "textAreaRef",
835
+ class: [
836
+ _vm.prefixCls + " " + _vm.prefixCls + "-textarea",
837
+ _vm.disabled ? "mds-input-disabled" : "",
838
+ ],
839
+ style: _vm.textareaStyles,
840
+ attrs: {
841
+ maxlength: _vm.max_length,
842
+ minlength: _vm.min_length,
843
+ rows: _vm.rows,
844
+ placeholder: _vm.placeholder,
845
+ disabled: _vm.disabled,
846
+ },
847
+ domProps: { value: _vm.valueData },
848
+ on: {
849
+ input: [
850
+ function ($event) {
851
+ if ($event.target.composing) {
852
+ return
853
+ }
854
+ _vm.valueData = $event.target.value
855
+ },
856
+ _vm.handleInput,
857
+ ],
858
+ keypress: _vm.handleKeyDown,
859
+ change: _vm.handleChange,
860
+ focus: _vm.handleFocus,
861
+ blur: _vm.handleBlur,
862
+ },
863
+ }),
864
+ ],
865
+ ],
866
+ 2
768
867
  )
769
868
  }
770
869
  var staticRenderFns = []
@@ -928,6 +1027,55 @@ var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
928
1027
  //
929
1028
  //
930
1029
  //
1030
+ //
1031
+ //
1032
+ //
1033
+ //
1034
+ //
1035
+ //
1036
+ //
1037
+ //
1038
+ //
1039
+ //
1040
+ //
1041
+ //
1042
+ //
1043
+ //
1044
+ //
1045
+ //
1046
+ //
1047
+ //
1048
+ //
1049
+ //
1050
+ //
1051
+ //
1052
+ //
1053
+ //
1054
+ //
1055
+ //
1056
+ //
1057
+ //
1058
+ //
1059
+ //
1060
+ //
1061
+ //
1062
+ //
1063
+ //
1064
+ //
1065
+ //
1066
+ //
1067
+ //
1068
+ //
1069
+ //
1070
+ //
1071
+ //
1072
+ //
1073
+ //
1074
+ //
1075
+ //
1076
+ //
1077
+ //
1078
+ //
931
1079
 
932
1080
 
933
1081
 
@@ -970,8 +1118,8 @@ function clearNextFrameAction(nextFrameId) {
970
1118
  default: 4
971
1119
  },
972
1120
  showLimit: {
973
- type: Boolean,
974
- default: false
1121
+ type: [Boolean, String],
1122
+ default: undefined
975
1123
  },
976
1124
  placeholder: {
977
1125
  type: String,
@@ -1004,6 +1152,11 @@ function clearNextFrameAction(nextFrameId) {
1004
1152
  },
1005
1153
  min_length: function min_length() {
1006
1154
  return this.$attrs.minlength || this.minlength;
1155
+ },
1156
+ showLimitPosition: function showLimitPosition() {
1157
+ if (this.showLimit === 'outside') return 'outside';
1158
+ if (this.showLimit === true || this.showLimit === 'inside') return 'inside';
1159
+ return null; // 不显示
1007
1160
  }
1008
1161
  },
1009
1162
  watch: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdsfe/mds-ui",
3
- "version": "0.3.0-17",
3
+ "version": "0.3.0-18",
4
4
  "description": "A set of enterprise-class Vue UI components.",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {