edvoyui-component-library-test-flight 0.0.154 → 0.0.157

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.
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.154",
4
+ "version": "0.0.157",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist/",
@@ -494,8 +494,17 @@ const selectAll = (e: Event) => {
494
494
  };
495
495
 
496
496
  watch(selected, (newValue) => {
497
- emit("update:modelValue", newValue);
498
- if (newValue === null || !newValue) {
497
+ // Emit scalar for single-select, array for multi-select
498
+ if (props.multiple) {
499
+ emit("update:modelValue", newValue);
500
+ } else {
501
+ if (Array.isArray(newValue)) {
502
+ emit("update:modelValue", newValue[0] ?? "");
503
+ } else {
504
+ emit("update:modelValue", newValue as any);
505
+ }
506
+ }
507
+ if (newValue === null || !newValue || (Array.isArray(newValue) && newValue.length === 0)) {
499
508
  emit("deselected", newValue);
500
509
  }
501
510
  });
@@ -512,7 +521,12 @@ const deselected = (newValue: any) => {
512
521
  };
513
522
 
514
523
  watch(modelValue, (newValue: any) => {
515
- selected.value = newValue;
524
+ if (props.multiple) {
525
+ selected.value = Array.isArray(newValue) ? newValue : (newValue ? [newValue] : []);
526
+ } else {
527
+ // keep scalar
528
+ selected.value = Array.isArray(newValue) ? (newValue[0] ?? "") : newValue;
529
+ }
516
530
  });
517
531
 
518
532
  const search = (x: string) => {
@@ -565,12 +579,21 @@ const fuseSearch = (
565
579
  };
566
580
 
567
581
  onMounted(() => {
568
- if (Array.isArray(props.value)) {
569
- selected.value = props.value;
570
- } else if (props.value) {
571
- selected.value = [props.value];
582
+ if (props.multiple) {
583
+ if (Array.isArray(props.value)) {
584
+ selected.value = props.value;
585
+ } else if (props.value) {
586
+ selected.value = [props.value];
587
+ } else {
588
+ selected.value = [];
589
+ }
572
590
  } else {
573
- selected.value = [];
591
+ // single: scalar
592
+ if (Array.isArray(props.value)) {
593
+ selected.value = props.value[0] ?? "";
594
+ } else {
595
+ selected.value = props.value ?? "";
596
+ }
574
597
  }
575
598
  });
576
599
 
@@ -1,43 +1,148 @@
1
1
  <template>
2
- <div>
3
- <ul role="list" class="space-y-6 p-4">
4
- <EUITimeLineItem :data="items" :type="type" :timeline-icon="icon" :show-more="showMore" />
5
- </ul>
6
- </div>
2
+ <div>
3
+ <ul role="list" class="p-4 space-y-6">
4
+ <li
5
+ v-for="(item, itemIdx) in items"
6
+ :data="item"
7
+ :key="`timeline_${itemIdx}`"
8
+ class="relative flex gap-x-4 group"
9
+ :type="type"
10
+ :timeline-icon="icon"
11
+ :show-more="showMore"
12
+ >
13
+ <div
14
+ :class="[
15
+ itemIdx === items.length - 1 ? 'h-6' : '-bottom-6',
16
+ 'absolute left-0 top-0 flex w-6 justify-center',
17
+ ]"
18
+ >
19
+ <slot name="line" :type="type">
20
+ <div
21
+ :class="[
22
+ type === 'icon' ? 'w-0.5 bg-green-500' : 'w-px bg-gray-200',
23
+ ]"
24
+ />
25
+ </slot>
26
+
27
+ </div>
28
+ <template v-if="type === 'image'">
29
+ <slot name="image" :data="item" :dataIndex="itemIdx">
30
+ <img
31
+ :src="item.person?.imageUrl"
32
+ alt=""
33
+ class="relative flex-initial flex-shrink-0 rounded-full size-6 bg-gray-50"
34
+ />
35
+ </slot>
36
+ <slot name="details" :data="item" :dataIndex="itemIdx">
37
+ <div
38
+ class="flex-1 min-w-0 p-3 rounded-md ring-1 ring-inset ring-gray-200"
39
+ >
40
+ <div class="flex justify-between gap-x-4 mb-0.5">
41
+ <div class="text-xs leading-5 text-gray-500">
42
+ <span class="font-medium text-gray-900">{{
43
+ item.person?.name
44
+ }}</span>
45
+ </div>
46
+ <time
47
+ :datetime="item.dateTime"
48
+ class="flex-none text-xs leading-5 text-gray-500"
49
+ >
50
+ {{ item.date + " " + item.dateTime }}
51
+ </time>
52
+ </div>
53
+ <p class="text-sm leading-6 text-gray-500">
54
+ {{ item.comment }}
55
+ </p>
56
+
57
+ <details
58
+ v-if="showMore"
59
+ :open="itemIdx === 0"
60
+ class="h-6 p-2 mt-2 text-xs text-gray-500 transition-colors duration-100 ease-in-out select-none open:border open:border-gray-100 open:bg-gray-50 open:rounded-md group open:h-auto"
61
+ >
62
+ <summary
63
+ class="flex flex-row items-center justify-start text-sm leading-5 text-gray-900 list-none cursor-pointer"
64
+ >
65
+ <slot name="showMoreTitle" :data="item" :open="itemIdx === 0">
66
+ {{ item.showmore?.title || "More Details" }}
67
+ <PlusIcon
68
+ class="ml-auto -mr-1 transition-all duration-300 opacity-75 fill-current size-4 group-open:hidden"
69
+ />
70
+ <MinusIcon
71
+ class="hidden ml-auto -mr-1 transition-all duration-300 opacity-75 fill-current size-4 group-open:inline-block"
72
+ />
73
+ </slot>
74
+ </summary>
75
+ <slot name="showMoreContent" :data="item">
76
+ <div>{{ item.showmore?.content }}</div>
77
+ </slot>
78
+ </details>
79
+ </div>
80
+ </slot>
81
+ </template>
82
+ <template v-else>
83
+ <div
84
+ class="relative flex items-center justify-center flex-none bg-white size-6"
85
+ >
86
+ <component
87
+ v-if="type === 'icon'"
88
+ :is="icon || CheckCircleIcon"
89
+ class="text-green-500 size-6"
90
+ aria-hidden="true"
91
+ />
92
+ <div
93
+ v-else
94
+ class="size-1.5 rounded-full bg-gray-100 ring-1 ring-gray-300 group-hover:bg-purple-200 group-hover:ring-purple-500"
95
+ />
96
+ </div>
97
+ <p class="flex-auto py-0.5 text-xs leading-5 text-gray-500">
98
+ <span class="font-medium text-gray-900">{{
99
+ item.person?.name
100
+ }}</span>
101
+ {{ item?.comment }}
102
+ </p>
103
+ <time
104
+ :datetime="item.dateTime"
105
+ class="flex-none py-0.5 text-xs leading-5 text-gray-500"
106
+ >{{ item.date + " " + item.dateTime }}</time
107
+ >
108
+ </template>
109
+ </li>
110
+ </ul>
111
+ </div>
7
112
  </template>
8
113
 
9
114
  <script setup lang="ts">
10
- import { PropType ,toRefs} from 'vue';
11
- import EUITimeLineItem from './EUITimeLineItem.vue';
115
+ import { PropType, toRefs } from "vue";
116
+ import { MinusIcon, PlusIcon } from "@heroicons/vue/24/outline";
117
+ import { CheckCircleIcon } from "@heroicons/vue/24/solid";
118
+
12
119
  interface ITimeLine {
13
- id: number | string,
14
- person: any,
120
+ id: number | string;
121
+ person: any;
15
122
  comment?: string;
16
- date?: string,
17
- dateTime?: string,
18
- showmore?: any
123
+ date?: string;
124
+ dateTime?: string;
125
+ showmore?: any;
19
126
  }
20
127
 
21
-
22
128
  const props = defineProps({
23
- items:{
24
- type:Array<ITimeLine>,
25
- default:[]
129
+ items: {
130
+ type: Array<ITimeLine>,
131
+ default: [],
26
132
  },
27
133
  type: {
28
- type:String as PropType<"view" | "icon" | "image">,
29
- default:''
134
+ type: String as PropType<"view" | "icon" | "image">,
135
+ default: "",
136
+ },
137
+ icon: {
138
+ type: [String, Object],
139
+ default: "",
140
+ },
141
+ showMore: {
142
+ type: Boolean,
143
+ default: false,
30
144
  },
31
- icon:{
32
- type:[String , Object],
33
- default:''
34
- } ,
35
- showMore:{
36
- type:Boolean,
37
- default:false
38
- }
39
145
  });
40
146
 
41
- const {items,type,icon,showMore} = toRefs(props)
147
+ const { items, type, icon, showMore } = toRefs(props);
42
148
  </script>
43
-
@@ -0,0 +1,120 @@
1
+ <template>
2
+ <div class="grid w-full grid-cols-3 gap-10">
3
+ <div>
4
+ <EUISelect
5
+ v-model="businessAreaSel"
6
+ :items="businessArea"
7
+ search-label="name"
8
+ label="Select Label"
9
+ placeholder="Placeholder"
10
+ :multiple="false"
11
+ :inputFilled="false"
12
+ />
13
+ <pre class="text-green-500 text-xxs">{{ businessAreaSel }}</pre>
14
+ </div>
15
+
16
+ <div>
17
+ <EUISelect
18
+ v-model="checkboxData"
19
+ search-label="name"
20
+ placeholder="Placeholder"
21
+ :items="datas"
22
+ :selected-count="true"
23
+ selectedCountLabel="Checkbox"
24
+ :multiple="true"
25
+ :is-checkbox="true"
26
+ />
27
+ <pre class="text-green-500 text-xxs">{{ checkboxData }}</pre>
28
+ </div>
29
+
30
+ <div>
31
+ <EUISelect
32
+ v-model="multipleData"
33
+ search-label="name"
34
+ label="Select Label"
35
+ placeholder="Placeholder"
36
+ :items="datas"
37
+ :multiple="true"
38
+ :multiple-limit="3"
39
+ />
40
+ <pre class="text-green-500 text-xxs">{{ multipleData }}</pre>
41
+ </div>
42
+ <div>
43
+ <EUISelect
44
+ v-model="singleData"
45
+ search-label="name"
46
+ label="Select Label"
47
+ placeholder="Placeholder"
48
+ :items="datas"
49
+ :multiple="false"
50
+ />
51
+ <pre class="text-green-500 text-xxs">{{ singleData }}</pre>
52
+ </div>
53
+ </div>
54
+ </template>
55
+
56
+ <script setup lang="ts">
57
+ import { ref } from "vue";
58
+ import EUISelect from "../select/EUISelect.vue";
59
+
60
+ const businessArea = ref(["All", "B2B", "B2C", "Accelerator"]);
61
+ const businessAreaSel = ref(businessArea.value?.[0]);
62
+
63
+ const checkboxData = ref([]);
64
+ const multipleData = ref([]);
65
+ const singleData = ref({});
66
+ const datas = ref([
67
+ {
68
+ value: "ShawnBurke",
69
+ name: "Shawn Burke",
70
+ age: 6,
71
+ },
72
+ {
73
+ value: "EmeryNolan",
74
+ name: "Emery Nolan",
75
+ age: 4,
76
+ },
77
+ {
78
+ value: "EmbryGrant",
79
+ name: "Embry Grant",
80
+ age: 3,
81
+ },
82
+ {
83
+ value: "JesseAustin",
84
+ name: "Jesse Austin",
85
+ age: 9,
86
+ },
87
+ {
88
+ value: "TandyChristensen",
89
+ name: "Tandy Christensen",
90
+ age: 7,
91
+ },
92
+ {
93
+ value: "ShawnBurkeNew",
94
+ name: "Shawn Burke New",
95
+ age: 6,
96
+ },
97
+ {
98
+ value: "EmeryNolanNew",
99
+ name: "Emery Nolan New",
100
+ age: 4,
101
+ },
102
+ {
103
+ value: "EmbryGrantNew",
104
+ name: "Embry Grant New",
105
+ age: 3,
106
+ },
107
+ {
108
+ value: "JesseAustinNew",
109
+ name: "Jesse Austin New",
110
+ age: 9,
111
+ },
112
+ {
113
+ value: "TandyChristensenNew",
114
+ name: "Tandy Christensen New",
115
+ age: 7,
116
+ },
117
+ ]);
118
+ </script>
119
+
120
+ <style scoped></style>
@@ -1 +0,0 @@
1
- {"version":3,"file":"EUIButtonGroup.vue.d.ts","sourceRoot":"","sources":["../../src/components/button/EUIButtonGroup.vue"],"names":[],"mappings":"AACA,cAAc,6GAA6G,CAAC;AAC5H,OAAO,2HAA2H,CAAC;;AAEnI,wBAA0F"}
@@ -1,4 +0,0 @@
1
- import _sfc_main from "/Volumes/work/repos/edvoy-ui-v2/src/components/timeLine/EUITimeLineItem.vue?vue&type=script&setup=true&lang.ts";
2
- export * from "/Volumes/work/repos/edvoy-ui-v2/src/components/timeLine/EUITimeLineItem.vue?vue&type=script&setup=true&lang.ts";
3
- export default _sfc_main;
4
- //# sourceMappingURL=EUITimeLineItem.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EUITimeLineItem.vue.d.ts","sourceRoot":"","sources":["../../src/components/timeLine/EUITimeLineItem.vue"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gHAAgH,CAAC;AACvI,cAAc,gHAAgH,CAAC;AAC/H,eAAe,SAAS,CAAC"}
@@ -1,135 +0,0 @@
1
- <template>
2
- <li
3
- v-for="(item, itemIdx) in data"
4
- :key="`timeline_${itemIdx}`"
5
- class="relative flex gap-x-4 group"
6
- >
7
- <div
8
- :class="[
9
- itemIdx === data.length - 1 ? 'h-6' : '-bottom-6',
10
- 'absolute left-0 top-0 flex w-6 justify-center',
11
- ]"
12
- >
13
- <div
14
- :class="[type === 'icon' ? 'w-0.5 bg-green-500' : 'w-px bg-gray-200']"
15
- />
16
- </div>
17
- <template v-if="type === 'image'">
18
- <slot name="image" :data="item" :dataIndex="itemIdx">
19
- <img
20
- :src="item.person?.imageUrl"
21
- alt=""
22
- class="relative flex-initial flex-shrink-0 rounded-full size-6 bg-gray-50"
23
- />
24
- </slot>
25
- <slot name="details" :data="item" :dataIndex="itemIdx">
26
- <div
27
- class="flex-1 min-w-0 p-3 rounded-md ring-1 ring-inset ring-gray-200"
28
- >
29
- <div class="flex justify-between gap-x-4 mb-0.5">
30
- <div class="text-xs leading-5 text-gray-500">
31
- <span class="font-medium text-gray-900">{{
32
- item.person?.name
33
- }}</span>
34
- </div>
35
- <time
36
- :datetime="item.dateTime"
37
- class="flex-none text-xs leading-5 text-gray-500"
38
- >
39
- {{ item.date + " " + item.dateTime }}
40
- </time>
41
- </div>
42
- <p class="text-sm leading-6 text-gray-500">
43
- {{ item.comment }}
44
- </p>
45
-
46
- <details
47
- v-if="showMore"
48
- :open="itemIdx === 0"
49
- class="h-6 p-2 mt-2 text-xs text-gray-500 transition-colors duration-100 ease-in-out select-none open:border open:border-gray-100 open:bg-gray-50 open:rounded-md group open:h-auto"
50
- >
51
- <summary
52
- class="flex flex-row items-center justify-start text-sm leading-5 text-gray-900 list-none cursor-pointer"
53
- >
54
- <slot name="showMoreTitle" :data="item" :open="itemIdx === 0">
55
- {{ item.showmore?.title || "More Details" }}
56
- <PlusIcon
57
- class="ml-auto -mr-1 transition-all duration-300 opacity-75 fill-current size-4 group-open:hidden"
58
- />
59
- <MinusIcon
60
- class="hidden ml-auto -mr-1 transition-all duration-300 opacity-75 fill-current size-4 group-open:inline-block"
61
- />
62
- </slot>
63
- </summary>
64
- <slot name="showMoreContent" :data="item">
65
- <div>{{ item.showmore?.content }}</div>
66
- </slot>
67
- </details>
68
- </div>
69
- </slot>
70
- </template>
71
- <template v-else>
72
- <div
73
- class="relative flex items-center justify-center flex-none bg-white size-6"
74
- >
75
- <component
76
- v-if="type === 'icon'"
77
- :is="icon || CheckCircleIcon"
78
- class="text-green-500 size-6"
79
- aria-hidden="true"
80
- />
81
- <div
82
- v-else
83
- class="size-1.5 rounded-full bg-gray-100 ring-1 ring-gray-300 group-hover:bg-purple-200 group-hover:ring-purple-500"
84
- />
85
- </div>
86
- <p class="flex-auto py-0.5 text-xs leading-5 text-gray-500">
87
- <span class="font-medium text-gray-900">{{ item.person?.name }}</span>
88
- {{ item?.command }}
89
- </p>
90
- <time
91
- :datetime="item.dateTime"
92
- class="flex-none py-0.5 text-xs leading-5 text-gray-500"
93
- >{{ item.date + " " + item.dateTime }}</time
94
- >
95
- </template>
96
- </li>
97
- </template>
98
-
99
- <script setup lang="ts">
100
- import { PropType, toRefs } from "vue";
101
- import { MinusIcon, PlusIcon } from "@heroicons/vue/24/outline";
102
- import { CheckCircleIcon } from "@heroicons/vue/24/solid";
103
-
104
- interface ITimeLine {
105
- id: number | string;
106
- person: any;
107
- comment?: string;
108
- date?: string;
109
- dateTime?: string;
110
- showmore?: any;
111
- command?: string;
112
- }
113
-
114
- const props = defineProps({
115
- data: {
116
- type: Array<ITimeLine>,
117
- default: [],
118
- },
119
- type: {
120
- type: String as PropType<"view" | "icon" | "image">,
121
- default: "",
122
- },
123
- icon: {
124
- type: [String, Object],
125
- default: "",
126
- },
127
- showMore: {
128
- type: Boolean,
129
- default: false,
130
- },
131
- });
132
- const { data, type, icon, showMore } = toRefs(props);
133
- </script>
134
-
135
- <style scoped></style>