@pequity/squirrel 7.0.0 → 7.0.2

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.
@@ -24,12 +24,16 @@ const createPDropdownStub = () => {
24
24
  toggleShow() {
25
25
  this.show = !this.show;
26
26
  },
27
+
28
+ hide() {
29
+ this.show = false;
30
+ },
27
31
  },
28
32
  template: `
29
33
  <div class="p-dropdown-stub">
30
34
  <slot></slot>
31
35
  <div v-if="show" class="p-dropdown-stub-popper">
32
- <slot name="popper"></slot>
36
+ <slot name="popper" :hide="hide"></slot>
33
37
  </div>
34
38
  </div>`,
35
39
  });
@@ -29,14 +29,14 @@
29
29
  <div>{{ actionOrMenu.label }}</div>
30
30
  </div>
31
31
  </PBtn>
32
- <template #popper>
33
- <div class="flex flex-col bg-p-purple-60">
34
- <div v-for="subaction in actionOrMenu.subActions" :key="`subaction-${subaction.name}`">
32
+ <template #popper="{ hide }">
33
+ <ul class="bg-p-purple-60 py-2">
34
+ <li v-for="subaction in actionOrMenu.subActions" :key="`subaction-${subaction.name}`">
35
35
  <PBtn
36
36
  size="sm"
37
- class="w-full"
37
+ class="w-full [&>.items-center]:justify-start"
38
38
  type="secondary-ghost-dark"
39
- @click="$emit('click:action', subaction.name)"
39
+ @click="($emit('click:action', subaction.name), hide())"
40
40
  >
41
41
  <div class="flex items-center gap-2 px-1 py-0.5">
42
42
  <Component :is="subaction.icon" v-if="isComponent(subaction.icon)" class="h-4 w-4" />
@@ -44,8 +44,8 @@
44
44
  <div>{{ subaction.label }}</div>
45
45
  </div>
46
46
  </PBtn>
47
- </div>
48
- </div>
47
+ </li>
48
+ </ul>
49
49
  </template>
50
50
  </PDropdown>
51
51
  </template>
@@ -18,6 +18,7 @@ const ELEMENTS_MAP = {
18
18
  const DEFAULT_CLASSES_ARRAY = [
19
19
  'relative',
20
20
  'inline-block',
21
+ 'whitespace-nowrap',
21
22
  'outline-none',
22
23
  'disabled:opacity-50',
23
24
  'disabled:cursor-default',
@@ -47,7 +47,7 @@ type Icon = InstanceType<typeof PIcon>['$props']['icon'];
47
47
  const btnClasses = {
48
48
  slots: {
49
49
  button:
50
- 'relative inline-block 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',
50
+ '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',
51
51
  content: 'flex items-center justify-center has-[.slot-wrapper:empty]:gap-0',
52
52
  loader: 'absolute bottom-0 left-0 right-0 top-0 flex items-center justify-center font-medium',
53
53
  icon: 'shrink-0',