jky-component-lib 0.0.20 → 0.0.21

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.
@@ -18,13 +18,13 @@ interface NavItem {
18
18
  to?: RouteLocationRaw;
19
19
  }
20
20
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
21
- click: (item: NavItem) => any;
22
21
  change: (value: string | number) => any;
23
22
  "update:modelValue": (value: string | number) => any;
23
+ navClick: (item: NavItem) => any;
24
24
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
25
- onClick?: ((item: NavItem) => any) | undefined;
26
25
  onChange?: ((value: string | number) => any) | undefined;
27
26
  "onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
27
+ onNavClick?: ((item: NavItem) => any) | undefined;
28
28
  }>, {
29
29
  size: "" | "default" | "large" | "small";
30
30
  type: "" | "default" | "primary" | "success" | "warning" | "danger" | "info" | "text";
@@ -34,7 +34,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
34
34
  buttonWidth: {},
35
35
  route: { type: Boolean, default: false }
36
36
  },
37
- emits: ["update:modelValue", "change", "click"],
37
+ emits: ["update:modelValue", "change", "navClick"],
38
38
  setup(__props, { emit: __emit }) {
39
39
  const props = __props;
40
40
  const emit = __emit;
@@ -51,12 +51,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
51
51
  return props.modelValue === item.value;
52
52
  }
53
53
  function handleClick(item) {
54
- if (props.route && item.to && router) {
55
- router.push(item.to);
54
+ if (props.route && item.to) {
55
+ if (router) {
56
+ router.push(item.to);
57
+ } else {
58
+ emit("navClick", item);
59
+ }
56
60
  } else {
57
61
  emit("update:modelValue", item.value);
58
62
  emit("change", item.value);
59
- emit("click", item);
63
+ emit("navClick", item);
60
64
  }
61
65
  }
62
66
  return (_ctx, _cache) => {
@@ -1,4 +1,4 @@
1
- const version = "0.0.20";
1
+ const version = "0.0.21";
2
2
  export {
3
3
  version
4
4
  };
@@ -18,13 +18,13 @@ interface NavItem {
18
18
  to?: RouteLocationRaw;
19
19
  }
20
20
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
21
- click: (item: NavItem) => any;
22
21
  change: (value: string | number) => any;
23
22
  "update:modelValue": (value: string | number) => any;
23
+ navClick: (item: NavItem) => any;
24
24
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
25
- onClick?: ((item: NavItem) => any) | undefined;
26
25
  onChange?: ((value: string | number) => any) | undefined;
27
26
  "onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
27
+ onNavClick?: ((item: NavItem) => any) | undefined;
28
28
  }>, {
29
29
  size: "" | "default" | "large" | "small";
30
30
  type: "" | "default" | "primary" | "success" | "warning" | "danger" | "info" | "text";
@@ -36,7 +36,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
36
36
  buttonWidth: {},
37
37
  route: { type: Boolean, default: false }
38
38
  },
39
- emits: ["update:modelValue", "change", "click"],
39
+ emits: ["update:modelValue", "change", "navClick"],
40
40
  setup(__props, { emit: __emit }) {
41
41
  const props = __props;
42
42
  const emit = __emit;
@@ -53,12 +53,16 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
53
53
  return props.modelValue === item.value;
54
54
  }
55
55
  function handleClick(item) {
56
- if (props.route && item.to && router) {
57
- router.push(item.to);
56
+ if (props.route && item.to) {
57
+ if (router) {
58
+ router.push(item.to);
59
+ } else {
60
+ emit("navClick", item);
61
+ }
58
62
  } else {
59
63
  emit("update:modelValue", item.value);
60
64
  emit("change", item.value);
61
- emit("click", item);
65
+ emit("navClick", item);
62
66
  }
63
67
  }
64
68
  return (_ctx, _cache) => {
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const version = "0.0.20";
3
+ const version = "0.0.21";
4
4
  exports.version = version;
package/dist/umd/index.js CHANGED
@@ -1398,7 +1398,7 @@ img {
1398
1398
  }
1399
1399
  /*$vite$:1*/`;
1400
1400
  document.head.appendChild(__vite_style__);
1401
- const version$1 = "0.0.20";
1401
+ const version$1 = "0.0.21";
1402
1402
  const INSTALLED_KEY = Symbol("INSTALLED_KEY");
1403
1403
  function createInstaller(components2 = []) {
1404
1404
  const install2 = (app, options) => {
@@ -1535,7 +1535,7 @@ img {
1535
1535
  buttonWidth: {},
1536
1536
  route: { type: Boolean, default: false }
1537
1537
  },
1538
- emits: ["update:modelValue", "change", "click"],
1538
+ emits: ["update:modelValue", "change", "navClick"],
1539
1539
  setup(__props, { emit: __emit }) {
1540
1540
  const props = __props;
1541
1541
  const emit = __emit;
@@ -1552,12 +1552,16 @@ img {
1552
1552
  return props.modelValue === item.value;
1553
1553
  }
1554
1554
  function handleClick(item) {
1555
- if (props.route && item.to && router) {
1556
- router.push(item.to);
1555
+ if (props.route && item.to) {
1556
+ if (router) {
1557
+ router.push(item.to);
1558
+ } else {
1559
+ emit("navClick", item);
1560
+ }
1557
1561
  } else {
1558
1562
  emit("update:modelValue", item.value);
1559
1563
  emit("change", item.value);
1560
- emit("click", item);
1564
+ emit("navClick", item);
1561
1565
  }
1562
1566
  }
1563
1567
  return (_ctx, _cache) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jky-component-lib",
3
3
  "type": "module",
4
- "version": "0.0.20",
4
+ "version": "0.0.21",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -42,7 +42,10 @@
42
42
  "jsdelivr": "dist/umd/index.js",
43
43
  "types": "dist/es/index.d.ts",
44
44
  "files": [
45
- "dist"
45
+ "LICENSE",
46
+ "README.md",
47
+ "dist",
48
+ "package.json"
46
49
  ],
47
50
  "engines": {
48
51
  "node": ">=18 || >=20 || >=22",