@pequity/squirrel 7.0.3 → 7.1.1

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.
Files changed (29) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/chunks/p-btn.js +22 -26
  3. package/dist/cjs/chunks/p-select-btn.js +1 -1
  4. package/dist/cjs/p-chips.js +2 -3
  5. package/dist/cjs/p-icon.js +2 -1
  6. package/dist/cjs/p-input-search.js +93 -82
  7. package/dist/es/chunks/p-btn.js +23 -27
  8. package/dist/es/chunks/p-select-btn.js +1 -1
  9. package/dist/es/p-chips.js +2 -3
  10. package/dist/es/p-icon.js +2 -1
  11. package/dist/es/p-input-search.js +93 -82
  12. package/dist/squirrel/components/p-btn/p-btn.vue.d.ts +6 -6
  13. package/dist/squirrel/components/p-chips/p-chips.vue.d.ts +0 -2
  14. package/dist/squirrel/components/p-icon/p-icon.types.d.ts +1 -0
  15. package/dist/squirrel/components/p-input-search/p-input-search.vue.d.ts +7 -164
  16. package/dist/squirrel.css +2 -76
  17. package/package.json +23 -20
  18. package/squirrel/components/p-btn/p-btn.spec.js +33 -35
  19. package/squirrel/components/p-btn/p-btn.vue +24 -28
  20. package/squirrel/components/p-chips/p-chips.vue +0 -1
  21. package/squirrel/components/p-dropdown-select/p-dropdown-select.spec.js +1 -1
  22. package/squirrel/components/p-icon/p-icon.types.ts +1 -0
  23. package/squirrel/components/p-input-search/p-input-search.spec.js +4 -4
  24. package/squirrel/components/p-input-search/p-input-search.vue +77 -137
  25. package/squirrel/components/p-select-btn/p-select-btn.vue +1 -1
  26. package/squirrel/components/p-select-list/p-select-list.spec.js +1 -1
  27. package/squirrel/assets/clear-input-faded.svg +0 -10
  28. package/squirrel/assets/clear-input-hovered.svg +0 -10
  29. package/squirrel/assets/magnifying-glass.svg +0 -10
package/README.md CHANGED
@@ -10,7 +10,7 @@ The library is built using [Vue 3](https://vuejs.org/) and [Tailwind CSS](https:
10
10
  Install the package and its dependencies using `pnpm`:
11
11
 
12
12
  ```bash
13
- pnpm i vue vue-router @pequity/squirrel @tanstack/vue-virtual @vuepic/vue-datepicker dayjs floating-vue lodash-es vue-currency-input vue-toastification@2.0.0-rc.5
13
+ pnpm i vue vue-router @pequity/squirrel @tanstack/vue-virtual @vuepic/vue-datepicker floating-vue lodash-es vue-currency-input vue-toastification@2.0.0-rc.5
14
14
  ```
15
15
 
16
16
  Install Tailwind CSS:
@@ -6,8 +6,7 @@ const pRingLoader_vue_vue_type_script_setup_true_lang = require("./p-ring-loader
6
6
  const link = require("../link.js");
7
7
  const sanitization = require("../sanitization.js");
8
8
  const index = require("./index.js");
9
- const _hoisted_1 = ["href", "disabled", "aria-disabled"];
10
- const _hoisted_2 = { class: "slot-wrapper empty:hidden" };
9
+ const _hoisted_1 = { class: "slot-wrapper empty:hidden" };
11
10
  const btnClasses = {
12
11
  slots: {
13
12
  button: "relative inline-block whitespace-nowrap rounded font-medium outline-none disabled:pointer-events-none disabled:cursor-default disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:cursor-default aria-disabled:opacity-50",
@@ -47,7 +46,7 @@ const btnClasses = {
47
46
  sm: {
48
47
  button: "px-3 has-[.slot-wrapper:empty]:px-1.5 py-1.5 text-sm leading-5",
49
48
  content: "gap-1",
50
- icon: "text-[20px]"
49
+ icon: "text-base p-0.5"
51
50
  },
52
51
  md: {
53
52
  button: "px-6 has-[.slot-wrapper:empty]:px-2.5 has-[.slot-wrapper:empty]:py-2.5 py-2 text-base",
@@ -72,8 +71,7 @@ const BUTTON_NATIVE_TYPES = ["button", "submit", "reset"];
72
71
  const LOADER_SIZES = { sm: 24, md: 30, lg: 40 };
73
72
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
74
73
  ...{
75
- name: "PBtn",
76
- inheritAttrs: false
74
+ name: "PBtn"
77
75
  },
78
76
  __name: "p-btn",
79
77
  props: {
@@ -142,6 +140,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
142
140
  }
143
141
  },
144
142
  setup(__props) {
143
+ const attrs = vue.useAttrs();
145
144
  const props = __props;
146
145
  const classes = vue.computed(() => {
147
146
  const { button, content, loader, icon } = btn({
@@ -150,27 +149,24 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
150
149
  });
151
150
  return { button: button(), content: content(), loader: loader(), icon: icon() };
152
151
  });
153
- const loaderSize = vue.computed(() => {
154
- return Number(`${LOADER_SIZES[props.size]}`);
152
+ const isExternal = vue.computed(() => link.isExternalLink(String(props.to)));
153
+ const btnAttrs = vue.computed(() => {
154
+ const res = {
155
+ target: isExternal.value ? "_blank" : null,
156
+ to: !isExternal.value && props.to ? props.to : null,
157
+ type: props.to ? null : props.nativeType,
158
+ disabled: attrs.disabled || props.loading ? "" : null,
159
+ "aria-selected": !isExternal.value ? props.selected : false,
160
+ "aria-disabled": attrs.disabled || props.loading
161
+ };
162
+ if (isExternal.value) {
163
+ res.href = sanitization.sanitizeUrl(String(props.to));
164
+ }
165
+ return res;
155
166
  });
156
167
  return (_ctx, _cache) => {
157
- return typeof __props.to === "string" && vue.unref(link.isExternalLink)(__props.to) ? (vue.openBlock(), vue.createElementBlock("a", vue.mergeProps({ key: 0 }, _ctx.$attrs, {
158
- href: vue.unref(sanitization.sanitizeUrl)(__props.to),
159
- target: "_blank",
160
- class: classes.value.button,
161
- disabled: !!_ctx.$attrs.disabled ? true : null,
162
- "aria-disabled": !!_ctx.$attrs.disabled
163
- }), [
164
- vue.renderSlot(_ctx.$slots, "default")
165
- ], 16, _hoisted_1)) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.to ? "RouterLink" : "button"), vue.mergeProps({
166
- key: 1,
167
- type: __props.to ? null : __props.nativeType,
168
- to: __props.to ? __props.to : null,
169
- "aria-selected": __props.selected,
168
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(isExternal.value ? "a" : __props.to ? "RouterLink" : "button"), vue.mergeProps(btnAttrs.value, {
170
169
  class: classes.value.button
171
- }, _ctx.$attrs, {
172
- disabled: !!_ctx.$attrs.disabled || __props.loading ? true : null,
173
- "aria-disabled": _ctx.$attrs.disabled
174
170
  }), {
175
171
  default: vue.withCtx(() => [
176
172
  vue.createElementVNode("div", {
@@ -181,7 +177,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
181
177
  icon: __props.icon,
182
178
  class: vue.normalizeClass(classes.value.icon)
183
179
  }, null, 8, ["icon", "class"])) : vue.createCommentVNode("", true),
184
- vue.createElementVNode("span", _hoisted_2, [
180
+ vue.createElementVNode("span", _hoisted_1, [
185
181
  vue.renderSlot(_ctx.$slots, "default")
186
182
  ]),
187
183
  __props.iconRight ? (vue.openBlock(), vue.createBlock(pIcon_vue_vue_type_script_setup_true_lang._sfc_main, {
@@ -192,12 +188,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
192
188
  ], 2),
193
189
  __props.loading ? (vue.openBlock(), vue.createBlock(pRingLoader_vue_vue_type_script_setup_true_lang._sfc_main, {
194
190
  key: 0,
195
- size: loaderSize.value,
191
+ size: LOADER_SIZES[props.size],
196
192
  class: vue.normalizeClass(classes.value.loader)
197
193
  }, null, 8, ["size", "class"])) : vue.createCommentVNode("", true)
198
194
  ]),
199
195
  _: 3
200
- }, 16, ["type", "to", "aria-selected", "class", "disabled", "aria-disabled"]));
196
+ }, 16, ["class"]);
201
197
  };
202
198
  }
203
199
  });
@@ -69,7 +69,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
69
69
  size: _ctx.size,
70
70
  type: "secondary-outline-blue",
71
71
  disabled: item.disabled,
72
- icon: String(item.icon),
72
+ icon: item.icon ? String(item.icon) : "",
73
73
  class: vue.normalizeClass({
74
74
  "rounded-none": index !== 0 && index !== _ctx.items.length - 1 && _ctx.items.length > 1,
75
75
  "rounded-br-none rounded-tr-none": index === 0 && _ctx.items.length > 1,
@@ -7,8 +7,7 @@ const _sfc_main = vue.defineComponent({
7
7
  props: {
8
8
  items: {
9
9
  type: Array,
10
- default: () => [],
11
- required: true
10
+ default: () => []
12
11
  },
13
12
  itemText: {
14
13
  type: String,
@@ -104,5 +103,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
104
103
  ], 512)
105
104
  ], 512);
106
105
  }
107
- const pChips = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-c4e84a46"]]);
106
+ const pChips = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-57d9f151"]]);
108
107
  module.exports = pChips;
@@ -34,6 +34,7 @@ const P_ICON_ALIASES = {
34
34
  refresh: "ri:loop-left-line",
35
35
  download: "tdesign:download",
36
36
  upload: "tdesign:upload",
37
- info: "streamline:information-circle"
37
+ info: "streamline:information-circle",
38
+ search: "streamline:magnifying-glass-solid"
38
39
  };
39
40
  exports.P_ICON_ALIASES = P_ICON_ALIASES;
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
+ const vue = require("vue");
2
3
  const pBtn_types = require("./chunks/p-btn.types.js");
4
+ const pIcon_vue_vue_type_script_setup_true_lang = require("./chunks/p-icon.js");
3
5
  const pInput_vue_vue_type_script_setup_true_lang = require("./chunks/p-input.js");
4
- const vue = require("vue");
5
6
  const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
6
- const _sfc_main = vue.defineComponent({
7
- name: "PInputSearch",
8
- components: {
9
- PInput: pInput_vue_vue_type_script_setup_true_lang._sfc_main
7
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
8
+ ...{
9
+ name: "PInputSearch",
10
+ inheritAttrs: false
10
11
  },
11
- inheritAttrs: false,
12
+ __name: "p-input-search",
12
13
  props: {
13
14
  modelValue: {
14
15
  type: String,
@@ -27,86 +28,96 @@ const _sfc_main = vue.defineComponent({
27
28
  }
28
29
  },
29
30
  emits: ["update:modelValue", "enter"],
30
- data() {
31
- return {
32
- query: this.modelValue,
33
- showEnterIconOnFocus: false
31
+ setup(__props, { emit: __emit }) {
32
+ const emit = __emit;
33
+ const props = __props;
34
+ const searchIconClasses = {
35
+ sm: "text-xs top-2.5 left-2",
36
+ md: "text-base top-3 left-3",
37
+ lg: "text-lg top-4 left-5"
34
38
  };
35
- },
36
- computed: {
37
- searchIconClasses() {
38
- return `search search-${this.size}`;
39
- },
40
- enterIconClasses() {
41
- return `enter enter-${this.size}`;
42
- },
43
- clearIconClasses() {
44
- return `clear clear-${this.size}`;
45
- }
46
- },
47
- watch: {
48
- modelValue(value) {
49
- this.query = value;
50
- },
51
- query(value) {
52
- this.$emit("update:modelValue", value);
53
- }
54
- },
55
- methods: {
56
- clearSearch() {
57
- this.query = "";
39
+ const clearIconClasses = {
40
+ sm: "text-base top-1.5 right-2",
41
+ md: "text-xl top-2 right-2.5",
42
+ lg: "text-3xl top-[5px] right-2.5"
43
+ };
44
+ const enterIconClasses = {
45
+ sm: "bg-[length:1rem_1rem] w-[1rem] h-[1rem] right-7 top-2",
46
+ md: "bg-[length:1.5rem_1.5rem] w-[1.5rem] h-[1.5rem] right-9 top-2",
47
+ lg: "bg-[length:2rem_2rem] w-[2rem] h-[2rem] right-[46px] top-2"
48
+ };
49
+ const showEnterIconOnFocus = vue.ref(false);
50
+ const searchInput = vue.useTemplateRef("searchInput");
51
+ const query = vue.ref(props.modelValue);
52
+ vue.watch(
53
+ () => props.modelValue,
54
+ (nV) => {
55
+ query.value = nV;
56
+ }
57
+ );
58
+ vue.watch(query, (nV) => {
59
+ emit("update:modelValue", nV);
60
+ });
61
+ const clearSearch = () => {
62
+ query.value = "";
58
63
  requestAnimationFrame(() => {
59
64
  var _a;
60
- (_a = this.$refs.searchInput) == null ? void 0 : _a.$el.querySelector("input").focus();
65
+ (_a = searchInput.value) == null ? void 0 : _a.$el.querySelector("input").focus();
61
66
  });
62
- },
63
- keydownEnter() {
64
- this.$emit("enter", this.query);
65
- }
67
+ };
68
+ const keydownEnter = () => {
69
+ emit("enter", query.value);
70
+ };
71
+ return (_ctx, _cache) => {
72
+ const _directive_tooltip = vue.resolveDirective("tooltip");
73
+ return vue.openBlock(), vue.createBlock(pInput_vue_vue_type_script_setup_true_lang._sfc_main, vue.mergeProps({
74
+ ref_key: "searchInput",
75
+ ref: searchInput,
76
+ modelValue: query.value,
77
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => query.value = $event),
78
+ size: __props.size
79
+ }, _ctx.$attrs, {
80
+ role: "searchbox",
81
+ rounded: "",
82
+ onFocus: _cache[1] || (_cache[1] = ($event) => showEnterIconOnFocus.value = true),
83
+ onFocusout: _cache[2] || (_cache[2] = ($event) => showEnterIconOnFocus.value = false),
84
+ onKeydown: vue.withKeys(keydownEnter, ["enter"])
85
+ }), {
86
+ prefix: vue.withCtx(() => [
87
+ vue.createVNode(pIcon_vue_vue_type_script_setup_true_lang._sfc_main, {
88
+ icon: "search",
89
+ class: vue.normalizeClass(["absolute text-p-gray-40", searchIconClasses[__props.size]])
90
+ }, null, 8, ["class"])
91
+ ]),
92
+ suffix: vue.withCtx(() => [
93
+ query.value && __props.showEnterIcon && showEnterIconOnFocus.value ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("i", {
94
+ key: 0,
95
+ class: vue.normalizeClass(["enter absolute bg-no-repeat outline-none", enterIconClasses[__props.size]])
96
+ }, null, 2)), [
97
+ [
98
+ _directive_tooltip,
99
+ { content: "Press enter to search", delay: { show: 100, hide: 0 } },
100
+ void 0,
101
+ { bottom: true }
102
+ ]
103
+ ]) : vue.createCommentVNode("", true),
104
+ query.value ? (vue.openBlock(), vue.createElementBlock("button", {
105
+ key: 1,
106
+ role: "button",
107
+ "aria-label": "Clear search input",
108
+ class: vue.normalizeClass(["absolute cursor-pointer", clearIconClasses[__props.size]]),
109
+ onClick: clearSearch
110
+ }, [
111
+ vue.createVNode(pIcon_vue_vue_type_script_setup_true_lang._sfc_main, {
112
+ icon: "cancel-circle",
113
+ class: "text-p-gray-40 hover:text-p-gray-50"
114
+ })
115
+ ], 2)) : vue.createCommentVNode("", true)
116
+ ]),
117
+ _: 1
118
+ }, 16, ["modelValue", "size"]);
119
+ };
66
120
  }
67
121
  });
68
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
69
- const _component_PInput = vue.resolveComponent("PInput");
70
- const _directive_tooltip = vue.resolveDirective("tooltip");
71
- return vue.openBlock(), vue.createBlock(_component_PInput, vue.mergeProps({
72
- ref: "searchInput",
73
- modelValue: _ctx.query,
74
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.query = $event),
75
- size: _ctx.size
76
- }, _ctx.$attrs, {
77
- role: "searchbox",
78
- rounded: "",
79
- onFocus: _cache[2] || (_cache[2] = ($event) => _ctx.showEnterIconOnFocus = true),
80
- onFocusout: _cache[3] || (_cache[3] = ($event) => _ctx.showEnterIconOnFocus = false),
81
- onKeydown: vue.withKeys(_ctx.keydownEnter, ["enter"])
82
- }), {
83
- prefix: vue.withCtx(() => [
84
- vue.createElementVNode("i", {
85
- class: vue.normalizeClass(["icon absolute bg-no-repeat outline-none", _ctx.searchIconClasses])
86
- }, null, 2)
87
- ]),
88
- suffix: vue.withCtx(() => [
89
- _ctx.query && _ctx.showEnterIcon && _ctx.showEnterIconOnFocus ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("i", {
90
- key: 0,
91
- class: vue.normalizeClass(["icon absolute bg-no-repeat outline-none", _ctx.enterIconClasses])
92
- }, null, 2)), [
93
- [
94
- _directive_tooltip,
95
- { content: "Press enter to search", delay: { show: 100, hide: 0 } },
96
- void 0,
97
- { bottom: true }
98
- ]
99
- ]) : vue.createCommentVNode("", true),
100
- _ctx.query ? (vue.openBlock(), vue.createElementBlock("button", {
101
- key: 1,
102
- role: "button",
103
- "aria-label": "Clear search input",
104
- class: vue.normalizeClass(["icon absolute cursor-pointer bg-no-repeat", _ctx.clearIconClasses]),
105
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.clearSearch && _ctx.clearSearch(...args))
106
- }, null, 2)) : vue.createCommentVNode("", true)
107
- ]),
108
- _: 1
109
- }, 16, ["modelValue", "size", "onKeydown"]);
110
- }
111
- const PInputSearch = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-78b7a6f8"]]);
122
+ const PInputSearch = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-ebc375ff"]]);
112
123
  module.exports = PInputSearch;
@@ -1,12 +1,11 @@
1
- import { defineComponent, computed, createElementBlock, createBlock, unref, openBlock, mergeProps, renderSlot, resolveDynamicComponent, withCtx, createElementVNode, createCommentVNode, normalizeClass } from "vue";
1
+ import { defineComponent, useAttrs, computed, createBlock, openBlock, resolveDynamicComponent, mergeProps, withCtx, createElementVNode, createCommentVNode, normalizeClass, renderSlot } from "vue";
2
2
  import { S as SIZES } from "./p-btn.types.js";
3
3
  import { _ as _sfc_main$1 } from "./p-icon.js";
4
4
  import { _ as _sfc_main$2 } from "./p-ring-loader.js";
5
5
  import { isExternalLink } from "../link.js";
6
6
  import { sanitizeUrl } from "../sanitization.js";
7
7
  import { c as ce } from "./index.js";
8
- const _hoisted_1 = ["href", "disabled", "aria-disabled"];
9
- const _hoisted_2 = { class: "slot-wrapper empty:hidden" };
8
+ const _hoisted_1 = { class: "slot-wrapper empty:hidden" };
10
9
  const btnClasses = {
11
10
  slots: {
12
11
  button: "relative inline-block whitespace-nowrap rounded font-medium outline-none disabled:pointer-events-none disabled:cursor-default disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:cursor-default aria-disabled:opacity-50",
@@ -46,7 +45,7 @@ const btnClasses = {
46
45
  sm: {
47
46
  button: "px-3 has-[.slot-wrapper:empty]:px-1.5 py-1.5 text-sm leading-5",
48
47
  content: "gap-1",
49
- icon: "text-[20px]"
48
+ icon: "text-base p-0.5"
50
49
  },
51
50
  md: {
52
51
  button: "px-6 has-[.slot-wrapper:empty]:px-2.5 has-[.slot-wrapper:empty]:py-2.5 py-2 text-base",
@@ -71,8 +70,7 @@ const BUTTON_NATIVE_TYPES = ["button", "submit", "reset"];
71
70
  const LOADER_SIZES = { sm: 24, md: 30, lg: 40 };
72
71
  const _sfc_main = /* @__PURE__ */ defineComponent({
73
72
  ...{
74
- name: "PBtn",
75
- inheritAttrs: false
73
+ name: "PBtn"
76
74
  },
77
75
  __name: "p-btn",
78
76
  props: {
@@ -141,6 +139,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
141
139
  }
142
140
  },
143
141
  setup(__props) {
142
+ const attrs = useAttrs();
144
143
  const props = __props;
145
144
  const classes = computed(() => {
146
145
  const { button, content, loader, icon } = btn({
@@ -149,27 +148,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
149
148
  });
150
149
  return { button: button(), content: content(), loader: loader(), icon: icon() };
151
150
  });
152
- const loaderSize = computed(() => {
153
- return Number(`${LOADER_SIZES[props.size]}`);
151
+ const isExternal = computed(() => isExternalLink(String(props.to)));
152
+ const btnAttrs = computed(() => {
153
+ const res = {
154
+ target: isExternal.value ? "_blank" : null,
155
+ to: !isExternal.value && props.to ? props.to : null,
156
+ type: props.to ? null : props.nativeType,
157
+ disabled: attrs.disabled || props.loading ? "" : null,
158
+ "aria-selected": !isExternal.value ? props.selected : false,
159
+ "aria-disabled": attrs.disabled || props.loading
160
+ };
161
+ if (isExternal.value) {
162
+ res.href = sanitizeUrl(String(props.to));
163
+ }
164
+ return res;
154
165
  });
155
166
  return (_ctx, _cache) => {
156
- return typeof __props.to === "string" && unref(isExternalLink)(__props.to) ? (openBlock(), createElementBlock("a", mergeProps({ key: 0 }, _ctx.$attrs, {
157
- href: unref(sanitizeUrl)(__props.to),
158
- target: "_blank",
159
- class: classes.value.button,
160
- disabled: !!_ctx.$attrs.disabled ? true : null,
161
- "aria-disabled": !!_ctx.$attrs.disabled
162
- }), [
163
- renderSlot(_ctx.$slots, "default")
164
- ], 16, _hoisted_1)) : (openBlock(), createBlock(resolveDynamicComponent(__props.to ? "RouterLink" : "button"), mergeProps({
165
- key: 1,
166
- type: __props.to ? null : __props.nativeType,
167
- to: __props.to ? __props.to : null,
168
- "aria-selected": __props.selected,
167
+ return openBlock(), createBlock(resolveDynamicComponent(isExternal.value ? "a" : __props.to ? "RouterLink" : "button"), mergeProps(btnAttrs.value, {
169
168
  class: classes.value.button
170
- }, _ctx.$attrs, {
171
- disabled: !!_ctx.$attrs.disabled || __props.loading ? true : null,
172
- "aria-disabled": _ctx.$attrs.disabled
173
169
  }), {
174
170
  default: withCtx(() => [
175
171
  createElementVNode("div", {
@@ -180,7 +176,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
180
176
  icon: __props.icon,
181
177
  class: normalizeClass(classes.value.icon)
182
178
  }, null, 8, ["icon", "class"])) : createCommentVNode("", true),
183
- createElementVNode("span", _hoisted_2, [
179
+ createElementVNode("span", _hoisted_1, [
184
180
  renderSlot(_ctx.$slots, "default")
185
181
  ]),
186
182
  __props.iconRight ? (openBlock(), createBlock(_sfc_main$1, {
@@ -191,12 +187,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
191
187
  ], 2),
192
188
  __props.loading ? (openBlock(), createBlock(_sfc_main$2, {
193
189
  key: 0,
194
- size: loaderSize.value,
190
+ size: LOADER_SIZES[props.size],
195
191
  class: normalizeClass(classes.value.loader)
196
192
  }, null, 8, ["size", "class"])) : createCommentVNode("", true)
197
193
  ]),
198
194
  _: 3
199
- }, 16, ["type", "to", "aria-selected", "class", "disabled", "aria-disabled"]));
195
+ }, 16, ["class"]);
200
196
  };
201
197
  }
202
198
  });
@@ -68,7 +68,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
68
68
  size: _ctx.size,
69
69
  type: "secondary-outline-blue",
70
70
  disabled: item.disabled,
71
- icon: String(item.icon),
71
+ icon: item.icon ? String(item.icon) : "",
72
72
  class: normalizeClass({
73
73
  "rounded-none": index !== 0 && index !== _ctx.items.length - 1 && _ctx.items.length > 1,
74
74
  "rounded-br-none rounded-tr-none": index === 0 && _ctx.items.length > 1,
@@ -6,8 +6,7 @@ const _sfc_main = defineComponent({
6
6
  props: {
7
7
  items: {
8
8
  type: Array,
9
- default: () => [],
10
- required: true
9
+ default: () => []
11
10
  },
12
11
  itemText: {
13
12
  type: String,
@@ -103,7 +102,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
103
102
  ], 512)
104
103
  ], 512);
105
104
  }
106
- const pChips = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-c4e84a46"]]);
105
+ const pChips = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-57d9f151"]]);
107
106
  export {
108
107
  pChips as default
109
108
  };
package/dist/es/p-icon.js CHANGED
@@ -32,7 +32,8 @@ const P_ICON_ALIASES = {
32
32
  refresh: "ri:loop-left-line",
33
33
  download: "tdesign:download",
34
34
  upload: "tdesign:upload",
35
- info: "streamline:information-circle"
35
+ info: "streamline:information-circle",
36
+ search: "streamline:magnifying-glass-solid"
36
37
  };
37
38
  export {
38
39
  P_ICON_ALIASES