zartui 3.1.91 → 3.1.92

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/lib/zartui.cjs.js CHANGED
@@ -9080,6 +9080,10 @@ var stdin_default$15 = vue.defineComponent({
9080
9080
  const historyList = vue.ref([]);
9081
9081
  const showAllCommonTypes = vue.ref(false);
9082
9082
  const selectCommonId = vue.ref(-1);
9083
+ const commonTypesListRef = vue.ref();
9084
+ const showLeftCommonTypesMask = vue.ref(false);
9085
+ const showRightCommonTypesMask = vue.ref(false);
9086
+ let commonTypesResizeObserver;
9083
9087
  const defaultTreeNode = vue.ref(props.treeData);
9084
9088
  const fields = vue.computed(() => assignDefaultFields$1(props.treeFieldName));
9085
9089
  const visibleCommonTypeList = vue.computed(() => {
@@ -9094,6 +9098,35 @@ var stdin_default$15 = vue.defineComponent({
9094
9098
  children,
9095
9099
  text: key
9096
9100
  } = fields.value;
9101
+ const updateCommonTypesMask = () => {
9102
+ const list = commonTypesListRef.value;
9103
+ if (!list) {
9104
+ showLeftCommonTypesMask.value = false;
9105
+ showRightCommonTypesMask.value = false;
9106
+ return;
9107
+ }
9108
+ const remainingScrollWidth = list.scrollWidth - list.clientWidth - list.scrollLeft;
9109
+ showLeftCommonTypesMask.value = list.scrollLeft > 0;
9110
+ showRightCommonTypesMask.value = remainingScrollWidth > 1;
9111
+ };
9112
+ const onCommonTypesScroll = () => {
9113
+ updateCommonTypesMask();
9114
+ };
9115
+ const observeCommonTypesList = () => {
9116
+ commonTypesResizeObserver == null ? void 0 : commonTypesResizeObserver.disconnect();
9117
+ const list = commonTypesListRef.value;
9118
+ if (!list || typeof ResizeObserver === "undefined") {
9119
+ return;
9120
+ }
9121
+ commonTypesResizeObserver = new ResizeObserver(updateCommonTypesMask);
9122
+ commonTypesResizeObserver.observe(list);
9123
+ };
9124
+ const updateCommonTypesLayout = () => {
9125
+ vue.nextTick(() => {
9126
+ observeCommonTypesList();
9127
+ updateCommonTypesMask();
9128
+ });
9129
+ };
9097
9130
  const allData = {
9098
9131
  [value]: -1,
9099
9132
  [key]: "全部",
@@ -9170,6 +9203,13 @@ var stdin_default$15 = vue.defineComponent({
9170
9203
  };
9171
9204
  flatData(props.treeData);
9172
9205
  updateOffset();
9206
+ updateCommonTypesLayout();
9207
+ });
9208
+ vue.watch(visibleCommonTypeList, updateCommonTypesLayout, {
9209
+ flush: "post"
9210
+ });
9211
+ vue.onBeforeUnmount(() => {
9212
+ commonTypesResizeObserver == null ? void 0 : commonTypesResizeObserver.disconnect();
9173
9213
  });
9174
9214
  const isEmpty = (item) => !item[children] || item[children].length === 0;
9175
9215
  const syncExpandNodeByParent = (item) => {
@@ -9357,11 +9397,16 @@ var stdin_default$15 = vue.defineComponent({
9357
9397
  }, [vue.createVNode("span", {
9358
9398
  "class": [bem$M("common-types--label")]
9359
9399
  }, [vue.createTextVNode("常用小类")]), visibleCommonTypeList.value.length > 0 ? vue.createVNode("div", {
9360
- "class": [bem$M("common-types--mask")]
9400
+ "class": [bem$M("common-types--mask"), bem$M("common-types--mask", {
9401
+ "left-mask": showLeftCommonTypesMask.value,
9402
+ "right-mask": showRightCommonTypesMask.value
9403
+ })]
9361
9404
  }, [vue.createVNode("div", {
9362
9405
  "class": [bem$M("common-types--viewport")]
9363
9406
  }, [vue.createVNode("div", {
9364
- "class": [bem$M("common-types--list")]
9407
+ "ref": commonTypesListRef,
9408
+ "class": [bem$M("common-types--list")],
9409
+ "onScroll": onCommonTypesScroll
9365
9410
  }, [visibleCommonTypeList.value.map(renderCommonTypeButton)])])]) : vue.createVNode("div", {
9366
9411
  "class": [bem$M("common-types--empty")]
9367
9412
  }, [vue.createTextVNode("暂无常用小类")]), visibleCommonTypeList.value.length > 0 && vue.createVNode("div", {
@@ -24379,7 +24424,7 @@ const Lazyload = {
24379
24424
  });
24380
24425
  }
24381
24426
  };
24382
- const version = "3.1.91";
24427
+ const version = "3.1.92";
24383
24428
  function install(app) {
24384
24429
  const components = [
24385
24430
  ActionSheet,
package/lib/zartui.es.js CHANGED
@@ -9078,6 +9078,10 @@ var stdin_default$15 = defineComponent({
9078
9078
  const historyList = ref([]);
9079
9079
  const showAllCommonTypes = ref(false);
9080
9080
  const selectCommonId = ref(-1);
9081
+ const commonTypesListRef = ref();
9082
+ const showLeftCommonTypesMask = ref(false);
9083
+ const showRightCommonTypesMask = ref(false);
9084
+ let commonTypesResizeObserver;
9081
9085
  const defaultTreeNode = ref(props.treeData);
9082
9086
  const fields = computed(() => assignDefaultFields$1(props.treeFieldName));
9083
9087
  const visibleCommonTypeList = computed(() => {
@@ -9092,6 +9096,35 @@ var stdin_default$15 = defineComponent({
9092
9096
  children,
9093
9097
  text: key
9094
9098
  } = fields.value;
9099
+ const updateCommonTypesMask = () => {
9100
+ const list = commonTypesListRef.value;
9101
+ if (!list) {
9102
+ showLeftCommonTypesMask.value = false;
9103
+ showRightCommonTypesMask.value = false;
9104
+ return;
9105
+ }
9106
+ const remainingScrollWidth = list.scrollWidth - list.clientWidth - list.scrollLeft;
9107
+ showLeftCommonTypesMask.value = list.scrollLeft > 0;
9108
+ showRightCommonTypesMask.value = remainingScrollWidth > 1;
9109
+ };
9110
+ const onCommonTypesScroll = () => {
9111
+ updateCommonTypesMask();
9112
+ };
9113
+ const observeCommonTypesList = () => {
9114
+ commonTypesResizeObserver == null ? void 0 : commonTypesResizeObserver.disconnect();
9115
+ const list = commonTypesListRef.value;
9116
+ if (!list || typeof ResizeObserver === "undefined") {
9117
+ return;
9118
+ }
9119
+ commonTypesResizeObserver = new ResizeObserver(updateCommonTypesMask);
9120
+ commonTypesResizeObserver.observe(list);
9121
+ };
9122
+ const updateCommonTypesLayout = () => {
9123
+ nextTick(() => {
9124
+ observeCommonTypesList();
9125
+ updateCommonTypesMask();
9126
+ });
9127
+ };
9095
9128
  const allData = {
9096
9129
  [value]: -1,
9097
9130
  [key]: "全部",
@@ -9168,6 +9201,13 @@ var stdin_default$15 = defineComponent({
9168
9201
  };
9169
9202
  flatData(props.treeData);
9170
9203
  updateOffset();
9204
+ updateCommonTypesLayout();
9205
+ });
9206
+ watch(visibleCommonTypeList, updateCommonTypesLayout, {
9207
+ flush: "post"
9208
+ });
9209
+ onBeforeUnmount(() => {
9210
+ commonTypesResizeObserver == null ? void 0 : commonTypesResizeObserver.disconnect();
9171
9211
  });
9172
9212
  const isEmpty = (item) => !item[children] || item[children].length === 0;
9173
9213
  const syncExpandNodeByParent = (item) => {
@@ -9355,11 +9395,16 @@ var stdin_default$15 = defineComponent({
9355
9395
  }, [createVNode("span", {
9356
9396
  "class": [bem$M("common-types--label")]
9357
9397
  }, [createTextVNode("常用小类")]), visibleCommonTypeList.value.length > 0 ? createVNode("div", {
9358
- "class": [bem$M("common-types--mask")]
9398
+ "class": [bem$M("common-types--mask"), bem$M("common-types--mask", {
9399
+ "left-mask": showLeftCommonTypesMask.value,
9400
+ "right-mask": showRightCommonTypesMask.value
9401
+ })]
9359
9402
  }, [createVNode("div", {
9360
9403
  "class": [bem$M("common-types--viewport")]
9361
9404
  }, [createVNode("div", {
9362
- "class": [bem$M("common-types--list")]
9405
+ "ref": commonTypesListRef,
9406
+ "class": [bem$M("common-types--list")],
9407
+ "onScroll": onCommonTypesScroll
9363
9408
  }, [visibleCommonTypeList.value.map(renderCommonTypeButton)])])]) : createVNode("div", {
9364
9409
  "class": [bem$M("common-types--empty")]
9365
9410
  }, [createTextVNode("暂无常用小类")]), visibleCommonTypeList.value.length > 0 && createVNode("div", {
@@ -24377,7 +24422,7 @@ const Lazyload = {
24377
24422
  });
24378
24423
  }
24379
24424
  };
24380
- const version = "3.1.91";
24425
+ const version = "3.1.92";
24381
24426
  function install(app) {
24382
24427
  const components = [
24383
24428
  ActionSheet,
package/lib/zartui.js CHANGED
@@ -9329,6 +9329,10 @@ var __publicField = (obj, key, value) => {
9329
9329
  const historyList = vue.ref([]);
9330
9330
  const showAllCommonTypes = vue.ref(false);
9331
9331
  const selectCommonId = vue.ref(-1);
9332
+ const commonTypesListRef = vue.ref();
9333
+ const showLeftCommonTypesMask = vue.ref(false);
9334
+ const showRightCommonTypesMask = vue.ref(false);
9335
+ let commonTypesResizeObserver;
9332
9336
  const defaultTreeNode = vue.ref(props.treeData);
9333
9337
  const fields = vue.computed(() => assignDefaultFields$1(props.treeFieldName));
9334
9338
  const visibleCommonTypeList = vue.computed(() => {
@@ -9343,6 +9347,35 @@ var __publicField = (obj, key, value) => {
9343
9347
  children,
9344
9348
  text: key
9345
9349
  } = fields.value;
9350
+ const updateCommonTypesMask = () => {
9351
+ const list = commonTypesListRef.value;
9352
+ if (!list) {
9353
+ showLeftCommonTypesMask.value = false;
9354
+ showRightCommonTypesMask.value = false;
9355
+ return;
9356
+ }
9357
+ const remainingScrollWidth = list.scrollWidth - list.clientWidth - list.scrollLeft;
9358
+ showLeftCommonTypesMask.value = list.scrollLeft > 0;
9359
+ showRightCommonTypesMask.value = remainingScrollWidth > 1;
9360
+ };
9361
+ const onCommonTypesScroll = () => {
9362
+ updateCommonTypesMask();
9363
+ };
9364
+ const observeCommonTypesList = () => {
9365
+ commonTypesResizeObserver == null ? void 0 : commonTypesResizeObserver.disconnect();
9366
+ const list = commonTypesListRef.value;
9367
+ if (!list || typeof ResizeObserver === "undefined") {
9368
+ return;
9369
+ }
9370
+ commonTypesResizeObserver = new ResizeObserver(updateCommonTypesMask);
9371
+ commonTypesResizeObserver.observe(list);
9372
+ };
9373
+ const updateCommonTypesLayout = () => {
9374
+ vue.nextTick(() => {
9375
+ observeCommonTypesList();
9376
+ updateCommonTypesMask();
9377
+ });
9378
+ };
9346
9379
  const allData = {
9347
9380
  [value]: -1,
9348
9381
  [key]: "全部",
@@ -9419,6 +9452,13 @@ var __publicField = (obj, key, value) => {
9419
9452
  };
9420
9453
  flatData(props.treeData);
9421
9454
  updateOffset();
9455
+ updateCommonTypesLayout();
9456
+ });
9457
+ vue.watch(visibleCommonTypeList, updateCommonTypesLayout, {
9458
+ flush: "post"
9459
+ });
9460
+ vue.onBeforeUnmount(() => {
9461
+ commonTypesResizeObserver == null ? void 0 : commonTypesResizeObserver.disconnect();
9422
9462
  });
9423
9463
  const isEmpty = (item) => !item[children] || item[children].length === 0;
9424
9464
  const syncExpandNodeByParent = (item) => {
@@ -9606,11 +9646,16 @@ var __publicField = (obj, key, value) => {
9606
9646
  }, [vue.createVNode("span", {
9607
9647
  "class": [bem$M("common-types--label")]
9608
9648
  }, [vue.createTextVNode("常用小类")]), visibleCommonTypeList.value.length > 0 ? vue.createVNode("div", {
9609
- "class": [bem$M("common-types--mask")]
9649
+ "class": [bem$M("common-types--mask"), bem$M("common-types--mask", {
9650
+ "left-mask": showLeftCommonTypesMask.value,
9651
+ "right-mask": showRightCommonTypesMask.value
9652
+ })]
9610
9653
  }, [vue.createVNode("div", {
9611
9654
  "class": [bem$M("common-types--viewport")]
9612
9655
  }, [vue.createVNode("div", {
9613
- "class": [bem$M("common-types--list")]
9656
+ "ref": commonTypesListRef,
9657
+ "class": [bem$M("common-types--list")],
9658
+ "onScroll": onCommonTypesScroll
9614
9659
  }, [visibleCommonTypeList.value.map(renderCommonTypeButton)])])]) : vue.createVNode("div", {
9615
9660
  "class": [bem$M("common-types--empty")]
9616
9661
  }, [vue.createTextVNode("暂无常用小类")]), visibleCommonTypeList.value.length > 0 && vue.createVNode("div", {
@@ -31892,7 +31937,7 @@ var __publicField = (obj, key, value) => {
31892
31937
  });
31893
31938
  }
31894
31939
  };
31895
- const version = "3.1.91";
31940
+ const version = "3.1.92";
31896
31941
  function install(app) {
31897
31942
  const components = [
31898
31943
  ActionSheet,