edvoyui-component-library-test-flight 0.0.133 → 0.0.135

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.
@@ -1,5 +1,5 @@
1
1
  export * from "/Volumes/work/repos/edvoy-ui-v2/src/components/popover/EUIPopover.vue?vue&type=script&setup=true&lang.ts";
2
- import "/Volumes/work/repos/edvoy-ui-v2/src/components/popover/EUIPopover.vue?vue&type=style&index=0&scoped=359908fd&lang.scss";
2
+ import "/Volumes/work/repos/edvoy-ui-v2/src/components/popover/EUIPopover.vue?vue&type=style&index=0&scoped=29b158d9&lang.scss";
3
3
  declare const _default: any;
4
4
  export default _default;
5
5
  //# sourceMappingURL=EUIPopover.vue.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "edvoyui-component-library-test-flight",
3
3
  "private": false,
4
- "version": "0.0.133",
4
+ "version": "0.0.135",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist/",
@@ -6,13 +6,28 @@
6
6
  Edvoy User Interface
7
7
  </h1>
8
8
 
9
- <div class="">
9
+ <!-- TODO: Add scroll to tab section in Student details page same -->
10
+
11
+ </div>
12
+ </template>
13
+ <script setup lang="ts">
14
+
15
+ </script>
16
+ <style lang="scss"></style>
17
+
18
+ <!-- Development code here -->
19
+
20
+ <!-- <template>
21
+ <div class="h-[clac(100svh-64px)] w-full px-10 py-8 max-w-screen-xl mx-auto">
22
+ <h1 class="mb-2 font-semibold text-gray-900 tetx-lg">Edvoy UI Componnet</h1>
23
+
24
+ <div class="mb-10">
10
25
  <EUITabOutline
11
26
  activeColor="purple"
12
27
  size="sm"
13
28
  :items="allDays"
14
- :defaultActive="activeDays"
15
- @update:clicked-button="onchangeActiveTab"
29
+ :defaultActive="activeTab"
30
+ @update:activeTabItem="onchangeActiveTab"
16
31
  >
17
32
  <template v-slot:content="{ data, activeName }">
18
33
  <div class="space-y-4">
@@ -30,43 +45,17 @@
30
45
  </template>
31
46
  </EUITabOutline>
32
47
  </div>
33
- </div>
34
- </template>
35
- <script setup lang="ts">
36
- import { ref } from "vue";
37
- import EUITabOutline from "./tabs/EUITabOutline.vue";
38
-
39
- const allDays = ref([
40
- { name: "7 days", count: 5 },
41
- { name: "15 days", count: 10 },
42
- { name: "16-30 days", count: 20 },
43
- { name: "31-60 days", count: 121 },
44
- { name: "61-90 days", count: 40 },
45
- ]);
46
48
 
47
- const activeDays = ref(allDays.value[0].name);
48
-
49
- const onchangeActiveTab = (val: any) => {
50
- activeDays.value = val.name;
51
- };
52
- </script>
53
- <style lang="scss"></style>
54
-
55
- <!-- Development code here -->
56
- <!--<template>
57
- <div class="h-[clac(100svh-64px)] w-full px-10 py-8 max-w-screen-xl mx-auto">
58
- <h1 class="mb-2 font-semibold text-gray-900 tetx-lg">Edvoy UI Componnet</h1>
59
-
60
- <div class="p-8 space-x-6 space-y-12">
49
+ <div class="p-8 space-x-6 space-y-4">
61
50
  <pre class="text-right">{{ activeDays }}--</pre>
62
51
  <div class="inline-flex flex-col items-end w-full">
63
- <EUIButtonGroup
52
+ <EUIButtonGroup
64
53
  activeColor="purple"
65
54
  size="sm"
66
55
  :rounded="false"
67
56
  :items="allDays"
68
57
  :defaultActive="activeDays"
69
- @update:clicked-button="onchangeActiveTab"
58
+ @update:activeButton="onchangeDays"
70
59
  >
71
60
  <template #before>
72
61
  <div
@@ -75,6 +64,9 @@ const onchangeActiveTab = (val: any) => {
75
64
  Renewals due in
76
65
  </div>
77
66
  </template>
67
+ <template #default="{ data, activeName}">
68
+ {{ data.name }} <small :class="activeName === data.name ? 'opacity-100': 'opacity-75'">({{ data.count }})</small>
69
+ </template>
78
70
  </EUIButtonGroup>
79
71
  </div>
80
72
 
@@ -1179,6 +1171,7 @@ import UTableview from "./table/UTableview.vue";
1179
1171
  import EUIAlerts from "./alerts/EUIAlerts.vue";
1180
1172
  import EUIButtonGroup from "./button/EUIButtonGroup.vue";
1181
1173
  import EUISearchExpand from "./searchexpand/EUISearchExpand.vue";
1174
+ import EUITabOutline from "./tabs/EUITabOutline.vue";
1182
1175
 
1183
1176
  const allDays = ref([
1184
1177
  { name: "7 days", count: 5 },
@@ -1188,12 +1181,17 @@ const allDays = ref([
1188
1181
  { name: "61-90 days", count: 40 },
1189
1182
  ]);
1190
1183
 
1191
- const activeDays = ref(allDays.value[1].name);
1184
+ const activeDays = ref(allDays.value[0].name);
1185
+ const activeTab = ref(allDays.value[3].name)
1192
1186
 
1193
1187
  const onchangeActiveTab = (val: any) => {
1194
- activeDays.value = val.name;
1188
+ activeTab.value = val.name;
1195
1189
  };
1196
1190
 
1191
+ const onchangeDays = (val:any) => {
1192
+ activeDays.value = val.name
1193
+ }
1194
+
1197
1195
  const searchInput = ref("");
1198
1196
  const showSearch = ref(false);
1199
1197
 
@@ -1201,7 +1199,6 @@ const seachStudent = (e) => {
1201
1199
  console.log("seachStudent", e);
1202
1200
  };
1203
1201
 
1204
-
1205
1202
  const mobileNumber = ref("+91 8667444951");
1206
1203
  const datepicker = ref(new Date());
1207
1204
  const loading = ref(false);
@@ -1,8 +1,9 @@
1
1
  <template>
2
2
  <div>
3
3
  <div
4
- class="inline-flex items-center gap-2 px-2 py-2 overflow-hidden transition-all duration-200 ease-in bg-white shadow-xl w-max shadow-purple-50"
5
- :class="[rounded ? 'rounded-full' : 'rounded-lg']"
4
+ class="inline-flex items-center gap-2 px-2 py-2 overflow-hidden transition-all duration-200 ease-in bg-white shadow-xl w-max shadow-purple-50"
5
+ :class="[rounded ? 'rounded-full' : 'rounded-lg']"
6
+ v-bind="$attrs"
6
7
  >
7
8
  <slot name="before" />
8
9
  <nav class="relative z-0 inline-flex flex-row items-center gap-2">
@@ -16,7 +17,7 @@
16
17
  <button
17
18
  v-for="(data, index) in items"
18
19
  :key="`data-${index}`"
19
- v-bind="$attrs"
20
+ v-bind="buttonAttrs"
20
21
  :type="type"
21
22
  :size="size"
22
23
  :iconType="iconType"
@@ -84,6 +85,7 @@ import {
84
85
  reactive,
85
86
  ref,
86
87
  toRefs,
88
+ useAttrs,
87
89
  } from "vue";
88
90
 
89
91
  interface Item {
@@ -97,8 +99,8 @@ const props = defineProps({
97
99
  default: () => [],
98
100
  },
99
101
  defaultActive: {
100
- type: String,
101
- default: "",
102
+ type:String,
103
+ default: '',
102
104
  },
103
105
  type: {
104
106
  type: String as PropType<"button" | "submit" | "reset">,
@@ -136,8 +138,17 @@ const props = defineProps({
136
138
  disabled: Boolean,
137
139
  });
138
140
 
141
+ defineOptions({
142
+ inheritAttrs: false, // 🛑 prevents auto-inheritance of $attrs to root
143
+ })
144
+ const attrs = useAttrs()
145
+ const buttonAttrs = computed(() => {
146
+ const { class: _class, style: _style, id: _id, ...rest } = attrs;
147
+ return rest;
148
+ });
149
+
139
150
  const emit = defineEmits<{
140
- (event: "update:clickedButton", activeTab: Item): void;
151
+ (event: "update:activeButton", activeButton: Item): void;
141
152
  }>();
142
153
 
143
154
  const { items, defaultActive } = toRefs(props);
@@ -153,7 +164,7 @@ const marker = (el: HTMLElement) => {
153
164
 
154
165
  const handleOnChange = (val: any) => {
155
166
  activeBtnName.value = val?.name;
156
- emit("update:clickedButton", val);
167
+ emit("update:activeButton", val);
157
168
  nextTick(() => {
158
169
  const activeBtn = document.querySelector(
159
170
  `nav button[data-name="${activeBtnName.value}"]`
@@ -1,8 +1,8 @@
1
1
  <template>
2
- <div>
2
+ <div ref="popperWrapper" class="isolate w-max">
3
3
  <div
4
4
  ref="popperButton"
5
- :class="['inline-flex items-center text-sm font-semibold gap-x-2', customButton]"
5
+ :class="['inline-flex items-center text-sm font-semibold gap-x-2 cursor-pointer', customButton]"
6
6
  >
7
7
  <slot name="referenceButton" :open="isOpen"/>
8
8
  </div>
@@ -52,6 +52,7 @@ const props = defineProps({
52
52
  }
53
53
  });
54
54
 
55
+ const popperWrapper = ref<HTMLElement | null>(null);
55
56
  const popperInstance = ref<Instance | null>(null);
56
57
  const popperButton = ref<HTMLElement | null>(null);
57
58
  const tooltip = ref<HTMLElement | null>(null);
@@ -60,9 +61,10 @@ const isOpen = ref(false);
60
61
  const emit = defineEmits(['showPopover', 'hidePopover']);
61
62
 
62
63
  onMounted(() => {
64
+ onClickOutside(popperWrapper.value, hide);
65
+
63
66
  if (props.trigger === "click") {
64
- useEventListener(popperButton.value, "click", show);
65
- onClickOutside(popperButton.value, hide);
67
+ useEventListener(popperButton.value, "click", toggle);
66
68
  } else if (props.trigger === "hover") {
67
69
  const showEvents = ["mouseenter", "focus"];
68
70
  const hideEvents = ["mouseleave", "blur"];
@@ -91,6 +93,14 @@ onMounted(() => {
91
93
  }
92
94
  });
93
95
 
96
+ function toggle() {
97
+ if (isOpen.value) {
98
+ hide();
99
+ } else {
100
+ show();
101
+ }
102
+ }
103
+
94
104
  function show() {
95
105
  tooltip.value?.setAttribute("data-show", "");
96
106
  isOpen.value = true;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="bg-white">
2
+ <div class="bg-white rounded-t-xl" v-bind="$attrs">
3
3
  <div
4
4
  class="relative z-10 inline-flex items-center w-full gap-2 pt-3 overflow-hidden transition-all duration-200 ease-in border border-b-0 border-solid rounded-t-xl isolate before:h-4 before:w-px before:bg-gray-200 before:-bottom-3 before:-left-px before:absolute after:h-4 after:w-px after:bg-gray-200 after:-bottom-3 after:-right-px after:absolute bg-gradient-to-b from-gray-100"
5
5
  >
@@ -7,7 +7,7 @@
7
7
  class="relative z-0 inline-flex flex-row items-center w-full gap-2 px-6"
8
8
  >
9
9
  <div
10
- id="nav-indicator"
10
+ id="tab-indicator"
11
11
  :style="{
12
12
  '--border': allColor[activeColor],
13
13
  }"
@@ -17,18 +17,15 @@
17
17
  <button
18
18
  v-for="(data, index) in items"
19
19
  :key="`data-${index}`"
20
- v-bind="$attrs"
21
- :size="size"
22
- :iconType="iconType"
23
- :data-name="data.name"
20
+ v-bind="buttonAttrs"
21
+ :data-tab="data.name"
24
22
  :class="[
25
- 'capitalize box-border border-none inline-flex flex-row gap-x-2 items-center',
23
+ 'capitalize box-border border-none inline-flex flex-row gap-x-2 items-center will-change-contents',
26
24
  getBtnClass(data.name || ''),
27
25
  activeBtnName === data.name ? 'font-semibold' : 'font-normal',
28
26
  ]"
29
27
  :disabled="disabled"
30
28
  :loading="loading"
31
- :icon="icon"
32
29
  @click="handleOnChange(data || '')"
33
30
  style="transition: all 350ms cubic-bezier(0.15, 0.3, 0.25, 1)"
34
31
  >
@@ -97,6 +94,7 @@ import {
97
94
  reactive,
98
95
  ref,
99
96
  toRefs,
97
+ useAttrs,
100
98
  } from "vue";
101
99
 
102
100
  interface Item {
@@ -138,14 +136,23 @@ const props = defineProps({
138
136
  });
139
137
 
140
138
  const emit = defineEmits<{
141
- (event: "update:clickedButton", activeTab: Item): void;
139
+ (event: "update:activeTabItem", activeTabItem: Item): void;
142
140
  }>();
143
141
 
142
+ defineOptions({
143
+ inheritAttrs: false, // 🛑 prevents auto-inheritance of $attrs to root
144
+ });
145
+ const attrs = useAttrs();
146
+ const buttonAttrs = computed(() => {
147
+ const { class: _class, style: _style, id: _id, ...rest } = attrs;
148
+ return rest;
149
+ });
150
+
144
151
  const { items, defaultActive } = toRefs(props);
145
152
  const activeBtnName = ref(defaultActive.value || items.value[0]?.name || "");
146
153
 
147
154
  const marker = (el: HTMLElement) => {
148
- const indicator = document.querySelector("#nav-indicator") as HTMLElement;
155
+ const indicator = document.querySelector("#tab-indicator") as HTMLElement;
149
156
  if (indicator && el) {
150
157
  indicator.style.left = el.offsetLeft + "px";
151
158
  indicator.style.width = el.offsetWidth + "px";
@@ -154,10 +161,10 @@ const marker = (el: HTMLElement) => {
154
161
 
155
162
  const handleOnChange = (val: any) => {
156
163
  activeBtnName.value = val?.name;
157
- emit("update:clickedButton", val);
164
+ emit("update:activeTabItem", val);
158
165
  nextTick(() => {
159
166
  const activeBtn = document.querySelector(
160
- `nav button[data-name="${activeBtnName.value}"]`
167
+ `nav button[data-tab="${activeBtnName.value}"]`
161
168
  );
162
169
  if (activeBtn) marker(activeBtn as HTMLElement);
163
170
  });
@@ -167,7 +174,7 @@ onMounted(() => {
167
174
  nextTick(() => {
168
175
  requestAnimationFrame(() => {
169
176
  const activeBtn = document.querySelector(
170
- `nav button[data-name="${activeBtnName.value}"]`
177
+ `nav button[data-tab="${activeBtnName.value}"]`
171
178
  );
172
179
  if (activeBtn) marker(activeBtn as HTMLElement);
173
180
  });
@@ -232,7 +239,7 @@ const allColor = {
232
239
  --clr: theme("colors.white");
233
240
  }
234
241
 
235
- #nav-indicator {
242
+ #tab-indicator {
236
243
  transition: all 350ms cubic-bezier(0.15, 0.3, 0.25, 1);
237
244
  background-image: linear-gradient(90deg, #fff, #fff),
238
245
  linear-gradient(to top, #e5e7eb, #e5e7eb, var(--border));