lew-ui 2.7.50 → 2.7.51

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
@@ -5162,9 +5162,22 @@ function any2px(value) {
5162
5162
  }
5163
5163
  return "";
5164
5164
  }
5165
+ let lastTimestamp = 0n;
5166
+ let counter = 0n;
5165
5167
  function getUniqueId() {
5166
- const uuid = crypto.randomUUID();
5167
- return uuid.substring(0, 8);
5168
+ const letters = "abcdefghijklmnopqrstuvwxyz";
5169
+ const firstChar = letters[Math.floor(Math.random() * letters.length)];
5170
+ const timestamp = BigInt(Date.now());
5171
+ if (timestamp === lastTimestamp) {
5172
+ counter++;
5173
+ } else {
5174
+ counter = 0n;
5175
+ lastTimestamp = timestamp;
5176
+ }
5177
+ const random2 = BigInt(Math.floor(Math.random() * 1e3));
5178
+ const uniqueNumber = timestamp * 1000n + counter + random2;
5179
+ const rest = uniqueNumber.toString(36).slice(-7).padStart(7, "0");
5180
+ return firstChar + rest;
5168
5181
  }
5169
5182
  function formatFormByMap(formMap) {
5170
5183
  const form = {};
@@ -21908,8 +21921,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
21908
21921
  });
21909
21922
  });
21910
21923
  onUnmounted(() => {
21911
- if (timer)
21912
- clearTimeout(timer);
21924
+ if (timer) clearTimeout(timer);
21913
21925
  });
21914
21926
  __expose({ toFocus, toBlur });
21915
21927
  return (_ctx, _cache) => {
@@ -22005,34 +22017,39 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
22005
22017
  _ctx.autoWidth ? (openBlock(), createElementBlock("label", _hoisted_6$1, toDisplayString$1(modelValue.value), 1)) : createCommentVNode("", true),
22006
22018
  _ctx.autoWidth && _ctx.clearable ? (openBlock(), createElementBlock("label", _hoisted_7)) : createCommentVNode("", true),
22007
22019
  _ctx.showPassword || _ctx.clearable || _ctx.showCount ? (openBlock(), createElementBlock("div", _hoisted_8, [
22008
- modelValue.value && _ctx.showCount ? (openBlock(), createElementBlock("div", {
22009
- key: 0,
22010
- ref_key: "lewInputCountRef",
22011
- ref: lewInputCountRef,
22012
- class: normalizeClass(["lew-input-count", {
22013
- "lew-input-count-clearable": _ctx.clearable && modelValue.value
22014
- }])
22015
- }, toDisplayString$1(typeof modelValue.value === "string" ? modelValue.value.length : 0) + toDisplayString$1(_ctx.maxLength ? ` / ${_ctx.maxLength}` : ""), 3)) : createCommentVNode("", true),
22016
- _ctx.showPassword && _ctx.type === "password" ? (openBlock(), createElementBlock("div", {
22017
- key: 1,
22018
- class: "lew-input-show-password",
22019
- onMousedown: _cache[3] || (_cache[3] = withModifiers(() => {
22020
- }, ["prevent"])),
22021
- onClick: showPasswordFn
22020
+ createElementVNode("div", {
22021
+ style: normalizeStyle({
22022
+ transform: _ctx.clearable && modelValue.value ? "translateX(-20px)" : "translateX(0px)"
22023
+ }),
22024
+ class: "lew-input-controls-box"
22022
22025
  }, [
22023
- withDirectives(createVNode(CommonIcon, {
22024
- size: unref(getIconSize),
22025
- type: "eye"
22026
- }, null, 8, ["size"]), [
22027
- [vShow, unref(_type) === "text"]
22028
- ]),
22029
- withDirectives(createVNode(CommonIcon, {
22030
- size: unref(getIconSize),
22031
- type: "eye_off"
22032
- }, null, 8, ["size"]), [
22033
- [vShow, unref(_type) === "password"]
22034
- ])
22035
- ], 32)) : createCommentVNode("", true),
22026
+ modelValue.value && _ctx.showCount ? (openBlock(), createElementBlock("div", {
22027
+ key: 0,
22028
+ ref_key: "lewInputCountRef",
22029
+ ref: lewInputCountRef,
22030
+ class: "lew-input-count"
22031
+ }, toDisplayString$1(typeof modelValue.value === "string" ? modelValue.value.length : 0) + toDisplayString$1(_ctx.maxLength ? ` / ${_ctx.maxLength}` : ""), 513)) : createCommentVNode("", true),
22032
+ _ctx.showPassword && _ctx.type === "password" ? (openBlock(), createElementBlock("div", {
22033
+ key: 1,
22034
+ class: "lew-input-show-password",
22035
+ onMousedown: _cache[3] || (_cache[3] = withModifiers(() => {
22036
+ }, ["prevent"])),
22037
+ onClick: showPasswordFn
22038
+ }, [
22039
+ withDirectives(createVNode(CommonIcon, {
22040
+ size: unref(getIconSize),
22041
+ type: "eye"
22042
+ }, null, 8, ["size"]), [
22043
+ [vShow, unref(_type) === "text"]
22044
+ ]),
22045
+ withDirectives(createVNode(CommonIcon, {
22046
+ size: unref(getIconSize),
22047
+ type: "eye_off"
22048
+ }, null, 8, ["size"]), [
22049
+ [vShow, unref(_type) === "password"]
22050
+ ])
22051
+ ], 32)) : createCommentVNode("", true)
22052
+ ], 4),
22036
22053
  createVNode(Transition, { name: "lew-form-icon-ani" }, {
22037
22054
  default: withCtx(() => [
22038
22055
  _ctx.clearable && modelValue.value && !_ctx.readonly ? (openBlock(), createBlock(CommonIcon, {
@@ -22103,7 +22120,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
22103
22120
  };
22104
22121
  }
22105
22122
  });
22106
- const LewInput = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-c42ed1c0"]]);
22123
+ const LewInput = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-9ae19967"]]);
22107
22124
  const inputNumberEmits = {
22108
22125
  change: (value) => value,
22109
22126
  input: (value) => value