lew-ui 1.0.29 → 1.0.32

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/lew.es.ts CHANGED
@@ -1939,6 +1939,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
1939
1939
  const tagsValue = ref(props.modelValue);
1940
1940
  const isInput = ref(false);
1941
1941
  const lewInputRef = ref();
1942
+ let isEnter = false;
1942
1943
  let delDownTimer;
1943
1944
  let delDownCheck = 0;
1944
1945
  watch(
@@ -1965,19 +1966,26 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
1965
1966
  delDownCheck = 0;
1966
1967
  }
1967
1968
  }
1969
+ } else {
1970
+ if (event.keyCode == 13) {
1971
+ isEnter = true;
1972
+ }
1968
1973
  }
1969
1974
  };
1970
1975
  };
1971
- const closeInput = (e2) => {
1976
+ const blurFn = (e2) => {
1972
1977
  isInput.value = false;
1973
1978
  document.onkeydown = null;
1974
- addTag(e2);
1975
- };
1976
- const addTag = (value) => {
1977
- if (!!value) {
1978
- tagsValue.value.push(value);
1979
+ addTag();
1980
+ if (isEnter) {
1979
1981
  openInput();
1980
1982
  }
1983
+ isEnter = false;
1984
+ };
1985
+ const addTag = () => {
1986
+ if (!!inputValue.value) {
1987
+ tagsValue.value.push(inputValue.value);
1988
+ }
1981
1989
  inputValue.value = "";
1982
1990
  };
1983
1991
  const delTag = (index2) => {
@@ -2017,7 +2025,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
2017
2025
  ref: lewInputRef,
2018
2026
  modelValue: inputValue.value,
2019
2027
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
2020
- onBlur: closeInput,
2028
+ onBlur: blurFn,
2021
2029
  onFocus: addTag,
2022
2030
  size: "small",
2023
2031
  "auto-width": "",
@@ -2303,9 +2311,9 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
2303
2311
  }
2304
2312
  });
2305
2313
  var LewRadio = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-365d2981"], ["__file", "/Users/kamtao/Documents/GitHub/Lew-UI/packages/components/radio/src/LewRadio.vue"]]);
2306
- var LewRadioboxGroup_vue_vue_type_style_index_0_scoped_true_lang = "";
2314
+ var LewRadioGroup_vue_vue_type_style_index_0_scoped_true_lang = "";
2307
2315
  const _sfc_main$m = /* @__PURE__ */ defineComponent({
2308
- __name: "LewRadioboxGroup",
2316
+ __name: "LewRadioGroup",
2309
2317
  props: {
2310
2318
  modelValue: {
2311
2319
  type: String,
@@ -2374,7 +2382,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
2374
2382
  };
2375
2383
  }
2376
2384
  });
2377
- var LewRadioboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-304dc5f5"], ["__file", "/Users/kamtao/Documents/GitHub/Lew-UI/packages/components/radio/src/LewRadioboxGroup.vue"]]);
2385
+ var LewRadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-642e37a4"], ["__file", "/Users/kamtao/Documents/GitHub/Lew-UI/packages/components/radio/src/LewRadioGroup.vue"]]);
2378
2386
  const selectProps = {
2379
2387
  modelValue: {
2380
2388
  type: [String, Array],
@@ -3238,7 +3246,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
3238
3246
  }
3239
3247
  );
3240
3248
  let maxLen = computed(() => {
3241
- return Math.floor(props.total / pageSize.value);
3249
+ return Math.ceil(props.total / pageSize.value);
3242
3250
  });
3243
3251
  let pageInterval = computed(() => {
3244
3252
  let start2 = pageNum.value - props.pageShowSize;
@@ -3277,7 +3285,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
3277
3285
  }
3278
3286
  if (pageNum.value < 1) {
3279
3287
  pageNum.value = 1;
3280
- } else if (pageNum.value > props.total / pageSize.value) {
3288
+ } else if (pageNum.value > maxLen.value) {
3281
3289
  pageNum.value = maxLen.value;
3282
3290
  }
3283
3291
  pageNumbackup.value = pageNum.value;
@@ -11772,7 +11780,7 @@ var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
11772
11780
  LewFormItem,
11773
11781
  LewCheckbox,
11774
11782
  LewCheckboxGroup,
11775
- LewRadioboxGroup,
11783
+ LewRadioGroup,
11776
11784
  LewSelect,
11777
11785
  LewSwitch,
11778
11786
  LewDate,
@@ -12221,23 +12229,38 @@ const notification = (type, title, content) => {
12221
12229
  const add = (type, title, content) => {
12222
12230
  const LewMessageDom = document.getElementById("lew-notification");
12223
12231
  const newMessage = document.createElement("div");
12232
+ const svgArr = {
12233
+ success: `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><g fill="none"><path d="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2zm0 1.5a8.5 8.5 0 1 0 0 17a8.5 8.5 0 0 0 0-17zm-1.25 9.94l4.47-4.47a.75.75 0 0 1 1.133.976l-.073.084l-5 5a.75.75 0 0 1-.976.073l-.084-.073l-2.5-2.5a.75.75 0 0 1 .976-1.133l.084.073l1.97 1.97l4.47-4.47l-4.47 4.47z" fill="currentColor"></path></g></svg>`,
12234
+ warning: `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><g fill="none"><path d="M10.91 2.782a2.25 2.25 0 0 1 2.975.74l.083.138l7.759 14.009a2.25 2.25 0 0 1-1.814 3.334l-.154.006H4.243a2.25 2.25 0 0 1-2.041-3.197l.072-.143L10.031 3.66a2.25 2.25 0 0 1 .878-.878zm9.505 15.613l-7.76-14.008a.75.75 0 0 0-1.254-.088l-.057.088l-7.757 14.008a.75.75 0 0 0 .561 1.108l.095.006h15.516a.75.75 0 0 0 .696-1.028l-.04-.086l-7.76-14.008l7.76 14.008zM12 16.002a.999.999 0 1 1 0 1.997a.999.999 0 0 1 0-1.997zM11.995 8.5a.75.75 0 0 1 .744.647l.007.102l.004 4.502a.75.75 0 0 1-1.494.103l-.006-.102l-.004-4.502a.75.75 0 0 1 .75-.75z" fill="currentColor"></path></g></svg>`,
12235
+ error: `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><g fill="none"><path d="M12 2c5.523 0 10 4.478 10 10s-4.477 10-10 10S2 17.522 2 12S6.477 2 12 2zm0 1.667c-4.595 0-8.333 3.738-8.333 8.333c0 4.595 3.738 8.333 8.333 8.333c4.595 0 8.333-3.738 8.333-8.333c0-4.595-3.738-8.333-8.333-8.333zm-.001 10.835a.999.999 0 1 1 0 1.998a.999.999 0 0 1 0-1.998zM11.994 7a.75.75 0 0 1 .744.648l.007.101l.004 4.502a.75.75 0 0 1-1.493.103l-.007-.102l-.004-4.501a.75.75 0 0 1 .75-.751z" fill="currentColor"></path></g></svg>`,
12236
+ normal: `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><g fill="none"><path d="M12 1.999c5.524 0 10.002 4.478 10.002 10.002c0 5.523-4.478 10.001-10.002 10.001C6.476 22.002 2 17.524 2 12.001C1.999 6.477 6.476 1.999 12 1.999zm0 1.5a8.502 8.502 0 1 0 0 17.003A8.502 8.502 0 0 0 12 3.5zm-.004 7a.75.75 0 0 1 .744.648l.007.102l.004 5.502a.75.75 0 0 1-1.494.102l-.006-.101l-.004-5.502a.75.75 0 0 1 .75-.75zm.005-3.497a.999.999 0 1 1 0 1.997a.999.999 0 0 1 0-1.997z" fill="currentColor"></path></g></svg>`,
12237
+ info: `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><g fill="none"><path d="M12 1.996a7.49 7.49 0 0 1 7.496 7.25l.004.25v4.097l1.38 3.156a1.249 1.249 0 0 1-1.145 1.75L15 18.502a3 3 0 0 1-5.995.177L9 18.499H4.275a1.251 1.251 0 0 1-1.147-1.747L4.5 13.594V9.496c0-4.155 3.352-7.5 7.5-7.5zM13.5 18.5l-3 .002a1.5 1.5 0 0 0 2.993.145l.007-.147zM12 3.496c-3.32 0-6 2.674-6 6v4.41L4.656 17h14.697L18 13.907V9.509l-.003-.225A5.988 5.988 0 0 0 12 3.496z" fill="currentColor"></path></g></svg>`
12238
+ };
12224
12239
  newMessage.innerHTML = `
12225
- <div class="main">
12226
- <div class="lew-notification-title">${title}</div>
12227
- ${content ? '<div class="lew-notification-content">' + content + "</div>" : ""}
12228
- </div>
12240
+ <div class="lew-notification-box">
12241
+ <div class="lew-notification-icon">
12242
+ ${svgArr[type]}
12243
+ </div>
12244
+ <div class="lew-notification-body">
12245
+ <div class="lew-notification-title">${title}</div>
12246
+ ${content ? '<div class="lew-notification-content">' + content + "</div>" : ""}
12247
+ </div>
12248
+ </div>
12229
12249
  `;
12230
12250
  LewMessageDom == null ? void 0 : LewMessageDom.appendChild(newMessage, LewMessageDom == null ? void 0 : LewMessageDom.childNodes[0]);
12231
- newMessage.setAttribute("class", `notification notification-${type}`);
12251
+ newMessage.setAttribute(
12252
+ "class",
12253
+ `lew-notification lew-notification-${type}`
12254
+ );
12232
12255
  setTimeout(() => {
12233
12256
  newMessage.setAttribute(
12234
12257
  "class",
12235
- `notification notification-${type} notification-show`
12258
+ `lew-notification lew-notification-${type} lew-notification-show`
12236
12259
  );
12237
12260
  setTimeout(() => {
12238
12261
  newMessage.setAttribute(
12239
12262
  "class",
12240
- `notification notification-${type} notification-hidden`
12263
+ `lew-notification lew-notification-${type} lew-notification-hidden`
12241
12264
  );
12242
12265
  setTimeout(() => {
12243
12266
  LewMessageDom == null ? void 0 : LewMessageDom.removeChild(newMessage);
@@ -12324,4 +12347,4 @@ const install = function(Vue) {
12324
12347
  var index = {
12325
12348
  install
12326
12349
  };
12327
- export { LewAlert, LewAvatar, LewBackTop, LewBadge, LewBreadcrumb, LewButton, LewCheckbox, LewCheckboxGroup, LewDate, LewDatePicker, LewDemoBox, index$7 as LewDialog, LewDrawer, LewDropdown, LewFancyImage, index$a as LewFancybox, LewFlex, LewFormItem, LewInput, LewInputPro, LewInputTag, LewLayout, LewMark, index$8 as LewMessage, LewModal, index$3 as LewNotification, LewPagination, LewPlyrVideo, LewPopok, LewPopover, LewRadioboxGroup, LewSelect, LewSpace, LewSteps, LewSwitch, LewTable, LewTabs, LewTag, LewTitle, index$5 as LewVBacktop, index$6 as LewVTooltip, index as default };
12350
+ export { LewAlert, LewAvatar, LewBackTop, LewBadge, LewBreadcrumb, LewButton, LewCheckbox, LewCheckboxGroup, LewDate, LewDatePicker, LewDemoBox, index$7 as LewDialog, LewDrawer, LewDropdown, LewFancyImage, index$a as LewFancybox, LewFlex, LewFormItem, LewInput, LewInputPro, LewInputTag, LewLayout, LewMark, index$8 as LewMessage, LewModal, index$3 as LewNotification, LewPagination, LewPlyrVideo, LewPopok, LewPopover, LewRadioGroup, LewSelect, LewSpace, LewSteps, LewSwitch, LewTable, LewTabs, LewTag, LewTitle, index$5 as LewVBacktop, index$6 as LewVTooltip, index as default };