edvoyui-component-library-test-flight 0.0.144 → 0.0.146

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.144",
4
+ "version": "0.0.146",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist/",
@@ -7,8 +7,7 @@
7
7
  </h1>
8
8
  </div>
9
9
  </template>
10
- <script setup lang="ts">
11
- </script>
10
+ <script setup lang="ts"></script>
12
11
  <style lang="scss"></style>
13
12
 
14
13
  <!-- Development code here -->
@@ -18,6 +17,41 @@
18
17
  <div class="h-[clac(100svh-64px)] w-full px-10 py-8 max-w-screen-xl mx-auto">
19
18
  <h1 class="mb-2 font-semibold text-gray-900 tetx-lg">Edvoy UI Componnet</h1>
20
19
 
20
+ <pre class="p-2 text-red-500 text-xxs">
21
+ {{ popoverSelect }}
22
+ {{ businessAreaSel }}
23
+ </pre>
24
+ <div class="grid max-w-2xl grid-cols-2 gap-6 mx-auto">
25
+ <EUISelect
26
+ v-model="businessAreaSel"
27
+ :value="businessAreaSel"
28
+ :items="businessArea"
29
+ search-label="name"
30
+ label="Select Label"
31
+ placeholder="Placeholder"
32
+ :multiple="true"
33
+ :isCheckbox="true"
34
+ :selectedCount="true"
35
+ selectedCountLabel="Business Area"
36
+ :inputFilled="true"
37
+ :searchable="true"
38
+ />
39
+
40
+ <EUISelect
41
+ v-model="popoverSelect"
42
+ :value="popoverSelect"
43
+ :items="datas"
44
+ search-label="name"
45
+ label="Select Label"
46
+ placeholder="Placeholder"
47
+ :searchable="true"
48
+ :multiple="true"
49
+ :isCheckbox="true"
50
+ :selectedCount="true"
51
+ :inputFilled="true"
52
+ />
53
+ </div>
54
+
21
55
 
22
56
  <div class="grid w-full h-48 grid-cols-4 gap-4 mb-20 isolate">
23
57
  <div
@@ -1425,6 +1459,15 @@ import EUITabOutline from "./tabs/EUITabOutline.vue";
1425
1459
  import EUIPopover from "./popover/EUIPopover.vue";
1426
1460
 
1427
1461
  const checkboxData = ref([])
1462
+ const businessAreaSel = ref()
1463
+ const popoverSelect = ref([]);
1464
+
1465
+ const businessArea = ref([
1466
+ "All",
1467
+ "B2B",
1468
+ "B2C",
1469
+ "Accelerator"
1470
+ ])
1428
1471
 
1429
1472
  // TODO: Popover
1430
1473
  const isLoading = ref(false);
@@ -254,7 +254,8 @@ const startCaseText = (x: string) => {
254
254
  return startCase(x);
255
255
  };
256
256
 
257
- const selected = ref<any[] | null>([]);
257
+ const selected = ref<string | string[] | Record<string, any> | Record<string, any>[] | null>(null)
258
+
258
259
  const nodropDown = ref(false);
259
260
  const props = defineProps({
260
261
  clearable: {
@@ -433,14 +434,21 @@ const isCheckedAll =(e: Event) => {
433
434
  };
434
435
 
435
436
  const isChecked = (item: any) => {
436
- const sel = selected.value
437
+ const sel = selected.value;
438
+ const itemValue = item?.[fieldName.value];
437
439
  if (Array.isArray(sel)) {
438
- return sel.some((s:any) => s?.value === item.value)
440
+ return sel.some((s: any) => {
441
+ if(s && typeof s === 'string'){
442
+ return s === itemValue
443
+ } else {
444
+ return s?.[fieldName.value] === itemValue
445
+ }
446
+ });
439
447
  }
440
448
  if (sel && typeof sel === 'object') {
441
- return (sel as any).value === item.value;
449
+ return sel?.[fieldName.value] === itemValue;
442
450
  }
443
- return false
451
+ return false;
444
452
  }
445
453
 
446
454
  const clearAll = (e:Event) => {
@@ -451,20 +459,31 @@ const clearAll = (e:Event) => {
451
459
  }
452
460
 
453
461
  const onCheckBoxChange = (item: any, event: Event) => {
454
- const target = event.target as HTMLInputElement
462
+ const target = event.target as HTMLInputElement;
455
463
 
456
464
  if (!Array.isArray(selected.value)) {
457
- selected.value = []
465
+ selected.value = [];
458
466
  }
459
467
 
468
+ const current = selected.value as any[];
469
+
460
470
  if (target.checked) {
461
- if (!selected.value?.some(s => s?.value === item?.value)) {
462
- selected.value?.push(item)
471
+ const exists = current.some((s) => {
472
+ if (typeof s === 'string') return s === item[fieldName.value];
473
+ return s?.[fieldName.value] === item[fieldName.value];
474
+ });
475
+
476
+ if (!exists) {
477
+ current.push(item);
463
478
  }
464
479
  } else {
465
- selected.value = selected.value?.filter(s => s?.value !== item?.value)
480
+ selected.value = current.filter((s) => {
481
+ if (typeof s === 'string') return s !== item[fieldName.value];
482
+ return s?.[fieldName.value] !== item[fieldName.value];
483
+ });
466
484
  }
467
- }
485
+ };
486
+
468
487
 
469
488
  const selectAll = (e: Event) => {
470
489
  if (e.target) {
@@ -685,7 +704,9 @@ const open = () => {
685
704
  </script>
686
705
  <style lang="scss">
687
706
  :root {
688
- --vs-dropdown-color: theme('colors.gray.600')
707
+ --vs-dropdown-color: theme('colors.gray.600');
708
+ --vs-dropdown-option--active-color: theme('colors.white');
709
+ --vs-disabled-bg: theme('colors.white');
689
710
  }
690
711
  .scrollbar {
691
712
  &--hide {