@pequity/squirrel 7.0.2 → 7.0.3

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.
@@ -420,7 +420,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
420
420
  }, [
421
421
  vue.createVNode(pIcon_vue_vue_type_script_setup_true_lang._sfc_main, { icon: "fe:plus-circle" }),
422
422
  vue.createTextVNode(" Add '" + vue.toDisplayString(vue.unref(search)) + "' ", 1)
423
- ])) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
423
+ ])) : __props.creatable ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
424
+ vue.createTextVNode("No items found. Type to add")
425
+ ], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
424
426
  vue.createTextVNode("No items found")
425
427
  ], 64))
426
428
  ], 2)
@@ -419,7 +419,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
419
419
  }, [
420
420
  createVNode(_sfc_main$1, { icon: "fe:plus-circle" }),
421
421
  createTextVNode(" Add '" + toDisplayString(unref(search)) + "' ", 1)
422
- ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
422
+ ])) : __props.creatable ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
423
+ createTextVNode("No items found. Type to add")
424
+ ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
423
425
  createTextVNode("No items found")
424
426
  ], 64))
425
427
  ], 2)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pequity/squirrel",
3
3
  "description": "Squirrel component library",
4
- "version": "7.0.2",
4
+ "version": "7.0.3",
5
5
  "packageManager": "pnpm@9.15.9",
6
6
  "type": "module",
7
7
  "scripts": {
@@ -764,6 +764,16 @@ describe('PDropdownSelect.vue', () => {
764
764
  cleanup(wrapper);
765
765
  });
766
766
 
767
+ it('shows "Type to add" message when creatable is true and no search term', async () => {
768
+ useVirtualizer.mockImplementation(() => createMockedVirtualizer(0));
769
+ const wrapper = createWrapper({ selected: null, items: [] }, { searchable: true, creatable: true });
770
+ await wrapper.find('button').trigger('click');
771
+ await sleep(200);
772
+ const noItemsMessage = wrapper.find('div.flex.items-center.justify-center.h-10.text-base');
773
+ expect(noItemsMessage.text()).toBe('No items found. Type to add');
774
+ cleanup(wrapper);
775
+ });
776
+
767
777
  it('does not show create option when creatable is false', async () => {
768
778
  useVirtualizer.mockImplementation(() => createMockedVirtualizer(20));
769
779
  const wrapper = createWrapper({ selected: null }, { searchable: true, creatable: false });
@@ -160,6 +160,7 @@
160
160
  Add '{{ search }}'
161
161
  </button>
162
162
  </template>
163
+ <template v-else-if="creatable">No items found. Type to add</template>
163
164
  <template v-else>No items found</template>
164
165
  </div>
165
166
  </slot>