jb-mobile-ui 1.4.13 → 1.4.15

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.es.js CHANGED
@@ -4926,7 +4926,7 @@ const _hoisted_1$6 = {
4926
4926
  const _hoisted_2$5 = { class: "jb-mobile-date-picker__value" };
4927
4927
  const _hoisted_3$4 = ["src"];
4928
4928
  const _hoisted_4$4 = { class: "jb-mobile-date-picker__date-text" };
4929
- const _hoisted_5$2 = ["src"];
4929
+ const _hoisted_5$3 = ["src"];
4930
4930
  const _hoisted_6$2 = { class: "jb-mobile-time-picker__calendar__inner" };
4931
4931
  const _hoisted_7$2 = { class: "jb-mobile-time-picker__group-wrap" };
4932
4932
  const _hoisted_8$2 = {
@@ -5577,7 +5577,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
5577
5577
  createElementVNode("img", {
5578
5578
  src: forwardIcon.value,
5579
5579
  alt: "forward"
5580
- }, null, 8, _hoisted_5$2)
5580
+ }, null, 8, _hoisted_5$3)
5581
5581
  ])) : createCommentVNode("", true)
5582
5582
  ])
5583
5583
  ])) : createCommentVNode("", true),
@@ -6004,13 +6004,14 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
6004
6004
  const JbMobileSearchInput = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-6caaea20"]]);
6005
6005
  const _imports_0$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAOBJREFUWEftlDEOwjAMRfMz5AJInIMJcQYWFma2SkG9AEfgAhWRujGzsHAGxMQ5kLhABxsydKmgcQpSF2eLktjPz1ZgRl4YOb9RADWgBtSAGkgaKMty0jRNALDO+baZ+eSc81VVPfveSQGOAJaZABfn3OZngJjUez9l5jMzz40xNgFCb9gbgFUI4ZGCThpoAxRFMbPWHph50asUuBLRtq7reyp5PBcDCExkVd7CZQHER99MILPywQAfTJicnnfbkm2gMxP7uCeinbTnfwOQDJjkzmADkuCSOwqgBtSAGlADL9JbXiGSAZGLAAAAAElFTkSuQmCC";
6006
6006
  const _hoisted_1$2 = { class: "jb-mobile-select__value" };
6007
- const _hoisted_2$2 = {
6008
- key: 0,
6009
- class: "jb-mobile-select__option-list"
6010
- };
6011
- const _hoisted_3$2 = ["onClick"];
6012
- const _hoisted_4$2 = {
6007
+ const _hoisted_2$2 = { class: "jb-mobile-select__content flex-column" };
6008
+ const _hoisted_3$2 = {
6013
6009
  key: 1,
6010
+ class: "jb-mobile-select__option-list flex-1"
6011
+ };
6012
+ const _hoisted_4$2 = ["onClick"];
6013
+ const _hoisted_5$2 = {
6014
+ key: 2,
6014
6015
  class: "jb-mobile-select__empty-wrap"
6015
6016
  };
6016
6017
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
@@ -6057,6 +6058,27 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
6057
6058
  fieldNames: {
6058
6059
  type: Object,
6059
6060
  default: () => ({})
6061
+ },
6062
+ /**
6063
+ * 是否显示搜索框
6064
+ */
6065
+ showSearch: {
6066
+ type: Boolean,
6067
+ default: false
6068
+ },
6069
+ /**
6070
+ * 搜索框的提示文案
6071
+ */
6072
+ searchPlaceholder: {
6073
+ type: String,
6074
+ default: ""
6075
+ },
6076
+ /**
6077
+ * 选中项的样式类型, 1 - 主题色填充背景和边框, 2 - 主题色填充文案和边框
6078
+ */
6079
+ selectedType: {
6080
+ type: Number,
6081
+ default: 1
6060
6082
  }
6061
6083
  },
6062
6084
  emits: [
@@ -6076,6 +6098,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
6076
6098
  const props = __props;
6077
6099
  const isShowOptionsPopup = ref(false);
6078
6100
  const selectedOptionItem = ref({});
6101
+ const searchValue = ref("");
6079
6102
  const computedWidth = computed(() => `${props.width}px`);
6080
6103
  const modelValue = computed({
6081
6104
  get() {
@@ -6091,11 +6114,15 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
6091
6114
  value: "value"
6092
6115
  }, props.fieldNames);
6093
6116
  });
6117
+ const options = computed(() => searchValue.value ? props.options.filter((item) => item[fieldNames.value.label].indexOf(searchValue.value) > -1) : props.options);
6094
6118
  watch(() => modelValue.value, (newVal) => {
6095
6119
  if (!newVal) {
6096
6120
  selectedOptionItem.value = {};
6097
6121
  }
6098
6122
  });
6123
+ const showOptionsPopup = () => {
6124
+ isShowOptionsPopup.value = true;
6125
+ };
6099
6126
  const handleSelectOptionItem = (item) => {
6100
6127
  selectedOptionItem.value = item;
6101
6128
  isShowOptionsPopup.value = false;
@@ -6103,6 +6130,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
6103
6130
  emits("change", item);
6104
6131
  };
6105
6132
  __expose({
6133
+ showOptionsPopup,
6106
6134
  handleSelectOptionItem
6107
6135
  });
6108
6136
  return (_ctx, _cache) => {
@@ -6119,7 +6147,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
6119
6147
  onClick: _cache[1] || (_cache[1] = ($event) => isShowOptionsPopup.value = true)
6120
6148
  }, [
6121
6149
  createElementVNode("div", _hoisted_1$2, toDisplayString(selectedOptionItem.value[fieldNames.value.label] || __props.placeholder), 1),
6122
- _cache[3] || (_cache[3] = createElementVNode("img", {
6150
+ _cache[4] || (_cache[4] = createElementVNode("img", {
6123
6151
  class: "jb-mobile-select__select-down-icon",
6124
6152
  src: _imports_0$1,
6125
6153
  alt: ""
@@ -6127,7 +6155,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
6127
6155
  ], 4)),
6128
6156
  createVNode(JbMobilePopup, mergeProps({
6129
6157
  visible: isShowOptionsPopup.value,
6130
- "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => isShowOptionsPopup.value = $event)
6158
+ "onUpdate:visible": _cache[3] || (_cache[3] = ($event) => isShowOptionsPopup.value = $event)
6131
6159
  }, unref(attrs), {
6132
6160
  title: __props.popupTitle,
6133
6161
  "grey-bg": true,
@@ -6135,17 +6163,27 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
6135
6163
  "confirm-button": false
6136
6164
  }), {
6137
6165
  default: withCtx(() => [
6138
- __props.options.length ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
6139
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item) => {
6140
- return openBlock(), createElementBlock("div", {
6141
- class: normalizeClass$1(["jb-mobile-select__option-item", { selected: item[fieldNames.value.value] === modelValue.value }]),
6142
- key: item[fieldNames.value.value],
6143
- onClick: ($event) => handleSelectOptionItem(item)
6144
- }, toDisplayString(item[fieldNames.value.label]), 11, _hoisted_3$2);
6145
- }), 128))
6146
- ])) : (openBlock(), createElementBlock("div", _hoisted_4$2, [
6147
- createVNode(JbMobileEmpty)
6148
- ]))
6166
+ createElementVNode("div", _hoisted_2$2, [
6167
+ __props.showSearch ? (openBlock(), createBlock(JbMobileSearchInput, {
6168
+ key: 0,
6169
+ modelValue: searchValue.value,
6170
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => searchValue.value = $event),
6171
+ class: "jb-mobile-select__search-input",
6172
+ "grey-bg": false,
6173
+ placeholder: __props.searchPlaceholder
6174
+ }, null, 8, ["modelValue", "placeholder"])) : createCommentVNode("", true),
6175
+ options.value.length ? (openBlock(), createElementBlock("div", _hoisted_3$2, [
6176
+ (openBlock(true), createElementBlock(Fragment, null, renderList(options.value, (item) => {
6177
+ return openBlock(), createElementBlock("div", {
6178
+ class: normalizeClass$1(["jb-mobile-select__option-item", [`type-${__props.selectedType}`, { selected: item[fieldNames.value.value] === modelValue.value }]]),
6179
+ key: item[fieldNames.value.value],
6180
+ onClick: ($event) => handleSelectOptionItem(item)
6181
+ }, toDisplayString(item[fieldNames.value.label]), 11, _hoisted_4$2);
6182
+ }), 128))
6183
+ ])) : (openBlock(), createElementBlock("div", _hoisted_5$2, [
6184
+ createVNode(JbMobileEmpty)
6185
+ ]))
6186
+ ])
6149
6187
  ]),
6150
6188
  _: 1
6151
6189
  }, 16, ["visible", "title"])
@@ -6153,7 +6191,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
6153
6191
  };
6154
6192
  }
6155
6193
  });
6156
- const JbMobileSelect = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-a3efea23"]]);
6194
+ const JbMobileSelect = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-07168033"]]);
6157
6195
  const _imports_0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3e图标(24)/巡检%3c/title%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='我的服务备份-14'%20transform='translate(-339,%20-371)'%20fill='%237B52FE'%20fill-rule='nonzero'%3e%3cg%20id='编组-28'%20transform='translate(0,%20134)'%3e%3cg%20id='编组-28备份'%20transform='translate(0,%2051)'%3e%3cg%20id='编组-32备份-4'%20transform='translate(0,%20176)'%3e%3cg%20id='编组-27'%20transform='translate(132,%200)'%3e%3cg%20id='编组'%20transform='translate(211.3571,%2016)'%3e%3cpath%20d='M0.127476811,5.43301045%20L5.51144105,11.8129903%20C5.70234462,12.0384575%206.03582177,12.0632342%206.25572336,11.8699765%20C6.27022237,11.8575882%206.28472138,11.8427223%206.29680387,11.8278563%20L16.146462,0.901366518%20C16.3325325,0.695720566%2016.3325325,0.37610216%2016.1440455,0.170456209%20C15.9555584,-0.0351897433%2015.6438297,-0.0574886986%2015.4287612,0.118425301%20L6.19289432,7.77687878%20C6.01407325,7.92553851%205.76275714,7.93792683%205.57185357,7.80908838%20L0.813763084,4.63520326%20C0.593861494,4.4890212%200.303881373,4.52866379%200.12989331,4.72935442%20C-0.0416782539,4.93004505%20-0.0440947695,5.22984216%200.127476811,5.43301045%20Z'%20id='路径'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
6158
6196
  const _hoisted_1$1 = { class: "jb-mobile-tree-select-popup__search" };
6159
6197
  const _hoisted_2$1 = { class: "jb-mobile-tree-select-popup__list" };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "jb-mobile-ui",
3
3
  "description": "JinBiWuYe Mobile UI Components base on Vant",
4
4
  "private": false,
5
- "version": "1.4.13",
5
+ "version": "1.4.15",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.es.js",
8
8
  "type": "module",