edvoyui-component-library-test-flight 0.0.22 → 0.0.23
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/dist/EUIButton.vue.d.ts.map +1 -0
- package/dist/inputNormal/EUIInputNormal.vue.d.ts.map +1 -0
- package/dist/library-vue-ts.cjs.js +1 -0
- package/dist/library-vue-ts.es.js +1 -0
- package/dist/library-vue-ts.umd.js +1 -0
- package/package.json +6 -3
- package/src/App.vue +16 -0
- package/src/assets/fonts/gilroy/GilroyBold/font.woff +0 -0
- package/src/assets/fonts/gilroy/GilroyBold/font.woff2 +0 -0
- package/src/assets/fonts/gilroy/GilroyBoldItalic/font.woff +0 -0
- package/src/assets/fonts/gilroy/GilroyBoldItalic/font.woff2 +0 -0
- package/src/assets/fonts/gilroy/GilroyExtraBold/font.woff +0 -0
- package/src/assets/fonts/gilroy/GilroyExtraBold/font.woff2 +0 -0
- package/src/assets/fonts/gilroy/GilroyExtraBoldItalic/font.woff +0 -0
- package/src/assets/fonts/gilroy/GilroyExtraBoldItalic/font.woff2 +0 -0
- package/src/assets/fonts/gilroy/GilroyMedium/font.woff +0 -0
- package/src/assets/fonts/gilroy/GilroyMedium/font.woff2 +0 -0
- package/src/assets/fonts/gilroy/GilroyRegular/font.woff +0 -0
- package/src/assets/fonts/gilroy/GilroyRegular/font.woff2 +0 -0
- package/src/assets/fonts/gilroy/GilroySemiBold/font.woff +0 -0
- package/src/assets/fonts/gilroy/GilroySemiBold/font.woff2 +0 -0
- package/src/assets/fonts/inter/Inter-Bold.woff +0 -0
- package/src/assets/fonts/inter/Inter-Bold.woff2 +0 -0
- package/src/assets/fonts/inter/Inter-Italic.woff +0 -0
- package/src/assets/fonts/inter/Inter-Italic.woff2 +0 -0
- package/src/assets/fonts/inter/Inter-Medium.woff +0 -0
- package/src/assets/fonts/inter/Inter-Medium.woff2 +0 -0
- package/src/assets/fonts/inter/Inter-MediumItalic.woff +0 -0
- package/src/assets/fonts/inter/Inter-MediumItalic.woff2 +0 -0
- package/src/assets/fonts/inter/Inter-Regular.woff +0 -0
- package/src/assets/fonts/inter/Inter-Regular.woff2 +0 -0
- package/src/assets/fonts/inter/Inter-SemiBold.woff +0 -0
- package/src/assets/fonts/inter/Inter-SemiBold.woff2 +0 -0
- package/src/assets/fonts/inter/Inter-SemiBoldItalic.woff +0 -0
- package/src/assets/fonts/inter/Inter-SemiBoldItalic.woff2 +0 -0
- package/src/assets/scss/body.scss +15 -0
- package/src/assets/svg/ChevronDownSolid.vue +19 -0
- package/src/assets/svg/ChevronDownStroke.vue +22 -0
- package/src/assets/svg/SortArrow.vue +24 -0
- package/src/assets/svg/Student.vue +30 -0
- package/src/assets/svg/partner.vue +33 -0
- package/src/assets/svg/people.vue +25 -0
- package/src/assets/vue.svg +1 -0
- package/src/components/HelloWorld.vue +999 -0
- package/src/components/accordion/EUIAccordion.stories.ts +157 -0
- package/src/components/accordion/EUIAccordion.vue +90 -0
- package/src/components/avatar/EUIAvatar.stories.ts +157 -0
- package/src/components/avatar/EUIAvatar.vue +96 -0
- package/src/components/button/EUIButton.stories.ts +252 -0
- package/src/components/button/EUIButton.vue +151 -0
- package/src/components/checkbox/EUICheckbox.stories.ts +58 -0
- package/src/components/checkbox/EUICheckbox.vue +103 -0
- package/src/components/datepicker/EUIDatepicker.stories.ts +236 -0
- package/src/components/datepicker/EUIDatepicker.vue +185 -0
- package/src/components/delete.vue +108 -0
- package/src/components/dropdown/EUIMultiDropdown.stories.ts +187 -0
- package/src/components/dropdown/EUIMultiDropdown.vue +129 -0
- package/src/components/errorMessage/EUIErrorMessage.scss +0 -0
- package/src/components/errorMessage/EUIErrorMessage.stories.ts +41 -0
- package/src/components/errorMessage/EUIErrorMessage.vue +25 -0
- package/src/components/index.ts +46 -0
- package/src/components/input/EUIInput.stories.ts +174 -0
- package/src/components/input/EUIInput.vue +169 -0
- package/src/components/inputNormal/EUIInputNormal.stories.ts +164 -0
- package/src/components/inputNormal/EUIInputNormal.vue +161 -0
- package/src/components/loader/EUICircleLoader.vue +31 -0
- package/src/components/loader/EUICubeLoader.vue +237 -0
- package/src/components/loader/EUILoader.stories.ts +99 -0
- package/src/components/loader/EUILoader.vue +17 -0
- package/src/components/loader/EUISquareLoader.vue +47 -0
- package/src/components/modal/EUIModal.stories.ts +372 -0
- package/src/components/modal/EUIModal.vue +163 -0
- package/src/components/pillSelect/EUIPillSelect.stories.ts +74 -0
- package/src/components/pillSelect/EUIPillSelect.vue +149 -0
- package/src/components/popover/EUIPopover.stories.ts +247 -0
- package/src/components/popover/EUIPopover.vue +159 -0
- package/src/components/radio/EUIRadio.stories.ts +54 -0
- package/src/components/radio/EUIRadio.vue +78 -0
- package/src/components/searchInput/EUISearch.stories.ts +24 -0
- package/src/components/searchInput/EUISearch.vue +215 -0
- package/src/components/select/EUISelect.scss +0 -0
- package/src/components/select/EUISelect.stories.ts +49 -0
- package/src/components/select/EUISelect.vue +682 -0
- package/src/components/selectSearch/EUISelectSearch.vue +23 -0
- package/src/components/slideover/EUISlideover.stories.ts +318 -0
- package/src/components/slideover/EUISlideover.vue +207 -0
- package/src/components/stepperTimeline/EUIStepperHorizontal.vue +112 -0
- package/src/components/stepperTimeline/EUIStepperTimeline.stories.ts +54 -0
- package/src/components/stepperTimeline/EUIStepperTimeline.vue +16 -0
- package/src/components/stepperTimeline/EUIStepperVertical.vue +112 -0
- package/src/components/table/EUIDashboardTable.vue +482 -0
- package/src/components/table/EUIPageLimit.vue +66 -0
- package/src/components/table/EUIPagination.vue +175 -0
- package/src/components/table/EUIStudentPagination.vue +172 -0
- package/src/components/table/EUITable.stories.ts +190 -0
- package/src/components/table/EUITable.vue +508 -0
- package/src/components/table/EUITableCheckbox.vue +97 -0
- package/src/components/tabs/EUITabs.vue +128 -0
- package/src/components/tabs/EUItabs.stories.ts +123 -0
- package/src/components/tag/EUITag.stories.ts +46 -0
- package/src/components/tag/EUITag.vue +46 -0
- package/src/components/telephone/EUITelephone.stories.ts +202 -0
- package/src/components/telephone/EUITelephone.vue +280 -0
- package/src/components/textArea/EUITextArea.stories.ts +82 -0
- package/src/components/textArea/EUITextArea.vue +122 -0
- package/src/components/timeLine/EUITimeLine.stories.ts +247 -0
- package/src/components/timeLine/EUITimeLine.vue +43 -0
- package/src/components/timeLine/EUITimeLineItem.vue +124 -0
- package/src/components/toggle/EUIToggle.stories.ts +63 -0
- package/src/components/toggle/EUIToggle.vue +99 -0
- package/src/components/tooltip/EUITooltip.stories.ts +53 -0
- package/src/components/tooltip/EUITooltip.vue +108 -0
- package/src/data/books.ts +163 -0
- package/src/data/tab.ts +33 -0
- package/src/data/table.ts +5392 -0
- package/src/main.ts +5 -0
- package/src/utils/lodash.ts +9 -0
- package/src/utils/types.ts +9 -0
- package/src/vite-env.d.ts +5 -0
- package/dist/EUIInputNormal.vue.d.ts.map +0 -1
- package/dist/button/EUIButton.vue.d.ts.map +0 -1
- package/dist/library-vue-ts.css +0 -1
- /package/dist/{button/EUIButton.vue.d.ts → EUIButton.vue.d.ts} +0 -0
- /package/dist/{EUIInputNormal.vue.d.ts → inputNormal/EUIInputNormal.vue.d.ts} +0 -0
- /package/{dist → src}/style.scss +0 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/vue3";
|
|
2
|
+
import EUIDatepicker from "./EUIDatepicker.vue";
|
|
3
|
+
import { ref } from "vue";
|
|
4
|
+
import { CalendarDaysIcon } from "@heroicons/vue/24/outline";
|
|
5
|
+
|
|
6
|
+
// Meta configuration for the component's stories
|
|
7
|
+
const meta = {
|
|
8
|
+
title: "Forms/Datepicker",
|
|
9
|
+
component: EUIDatepicker,
|
|
10
|
+
tags: ["autodocs"],
|
|
11
|
+
argTypes: {
|
|
12
|
+
modelValue: {
|
|
13
|
+
control: "date",
|
|
14
|
+
description: "The selected date value of the datepicker.",
|
|
15
|
+
},
|
|
16
|
+
name: {
|
|
17
|
+
control: "text",
|
|
18
|
+
description:
|
|
19
|
+
"Name for the Validation of Datepicker field, used for identification.",
|
|
20
|
+
},
|
|
21
|
+
label: {
|
|
22
|
+
control: "text",
|
|
23
|
+
description:
|
|
24
|
+
"Label for the datepicker field that is displayed above the input.",
|
|
25
|
+
},
|
|
26
|
+
placeholder: {
|
|
27
|
+
control: "text",
|
|
28
|
+
description:
|
|
29
|
+
"Placeholder text shown inside the datepicker input when no date is selected.",
|
|
30
|
+
},
|
|
31
|
+
errors: {
|
|
32
|
+
control: "object",
|
|
33
|
+
description:
|
|
34
|
+
"Object containing validation errors. The keys are field names, and the values are the corresponding error messages.",
|
|
35
|
+
},
|
|
36
|
+
range: {
|
|
37
|
+
control: "boolean",
|
|
38
|
+
description:
|
|
39
|
+
"Enables date range selection, allowing users to pick a start and end date.",
|
|
40
|
+
defaultValue: false,
|
|
41
|
+
},
|
|
42
|
+
required: {
|
|
43
|
+
control: "boolean",
|
|
44
|
+
description: "Marks the datepicker as a required field.",
|
|
45
|
+
},
|
|
46
|
+
readonly: {
|
|
47
|
+
control: "boolean",
|
|
48
|
+
description: "Makes the datepicker read-only, preventing date selection.",
|
|
49
|
+
},
|
|
50
|
+
disabled: {
|
|
51
|
+
control: "boolean",
|
|
52
|
+
description:
|
|
53
|
+
"Disables the datepicker, making it uneditable and unclickable.",
|
|
54
|
+
},
|
|
55
|
+
iconType: {
|
|
56
|
+
control: "select",
|
|
57
|
+
options: ["", "startIcon", "endIcon"],
|
|
58
|
+
description:
|
|
59
|
+
"The position of the icon to be displayed either at the start or end of the input field.",
|
|
60
|
+
},
|
|
61
|
+
icon: {
|
|
62
|
+
control: { type: "text" },
|
|
63
|
+
description: "Sets an SVG icon inside the datepicker input field.",
|
|
64
|
+
},
|
|
65
|
+
isUtc: {
|
|
66
|
+
control: "boolean",
|
|
67
|
+
description:
|
|
68
|
+
"Sets the selected date in UTC format if true, otherwise in local time.",
|
|
69
|
+
},
|
|
70
|
+
clearIcon: {
|
|
71
|
+
control: "boolean",
|
|
72
|
+
description:
|
|
73
|
+
"Shows a clear icon inside the datepicker to reset the date.",
|
|
74
|
+
},
|
|
75
|
+
formatDate: {
|
|
76
|
+
control: "boolean",
|
|
77
|
+
description:
|
|
78
|
+
"Formats the displayed date value; if true, a formatted date string is shown.",
|
|
79
|
+
},
|
|
80
|
+
disableDate: {
|
|
81
|
+
control: "boolean",
|
|
82
|
+
description:
|
|
83
|
+
"Disables past dates if true, preventing them from being selected.",
|
|
84
|
+
},
|
|
85
|
+
quarter: {
|
|
86
|
+
control: "boolean",
|
|
87
|
+
description: "Enables quarter selection instead of date selection.",
|
|
88
|
+
},
|
|
89
|
+
timePicker: {
|
|
90
|
+
control: "boolean",
|
|
91
|
+
description: "Allows time selection in addition to the date if true.",
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
} satisfies Meta<typeof EUIDatepicker>;
|
|
95
|
+
|
|
96
|
+
export default meta;
|
|
97
|
+
type Story = StoryObj<typeof meta>;
|
|
98
|
+
|
|
99
|
+
// Default story with minimum props
|
|
100
|
+
export const Default: Story = {
|
|
101
|
+
args: {
|
|
102
|
+
placeholder: "Select your date",
|
|
103
|
+
label: "Datepicker",
|
|
104
|
+
modelValue: new Date(),
|
|
105
|
+
required: true,
|
|
106
|
+
readonly: false,
|
|
107
|
+
disabled: false,
|
|
108
|
+
errors: {
|
|
109
|
+
message: "Enter valid date format",
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
render: (args) => ({
|
|
113
|
+
components: { EUIDatepicker },
|
|
114
|
+
setup() {
|
|
115
|
+
const modelValue = ref(args.modelValue);
|
|
116
|
+
return { args, modelValue };
|
|
117
|
+
},
|
|
118
|
+
template: `<div class="max-w-xl min-h-64"><EUIDatepicker v-bind="args" /></div>`,
|
|
119
|
+
}),
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export const DateRange: Story = {
|
|
123
|
+
args: {
|
|
124
|
+
placeholder: "Choose your date range...",
|
|
125
|
+
label: "Datepicker",
|
|
126
|
+
range: true,
|
|
127
|
+
required: true,
|
|
128
|
+
readonly: false,
|
|
129
|
+
disabled: false,
|
|
130
|
+
errors: {
|
|
131
|
+
message: "Enter valid date format",
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
render: (args) => ({
|
|
135
|
+
components: { EUIDatepicker },
|
|
136
|
+
setup() {
|
|
137
|
+
const startDate = new Date();
|
|
138
|
+
const endDate = new Date(new Date().setDate(startDate.getDate() + 7));
|
|
139
|
+
const datepicker = ref([startDate, endDate]);
|
|
140
|
+
return { args, datepicker };
|
|
141
|
+
},
|
|
142
|
+
template: `<div class="max-w-xl min-h-64"><EUIDatepicker v-bind="args" v-model="datepicker" /></div>`,
|
|
143
|
+
}),
|
|
144
|
+
parameters: {
|
|
145
|
+
docs: {
|
|
146
|
+
source: {
|
|
147
|
+
code: `<script lang="ts" setup>
|
|
148
|
+
const datepickerRange = ref([new Date(), new Date(new Date().setDate(new Date().getDate() + 7))]);
|
|
149
|
+
</script>
|
|
150
|
+
<template>
|
|
151
|
+
<EUIDatepicker
|
|
152
|
+
v-model="datepickerRange"
|
|
153
|
+
label="Datepicker"
|
|
154
|
+
placeholder="Select Date here..."
|
|
155
|
+
:range="true"
|
|
156
|
+
/>
|
|
157
|
+
</template>`,
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export const IconUsingStart: Story = {
|
|
164
|
+
args: {
|
|
165
|
+
iconType: "startIcon",
|
|
166
|
+
icon: CalendarDaysIcon,
|
|
167
|
+
},
|
|
168
|
+
render: (args) => ({
|
|
169
|
+
components: { EUIDatepicker, CalendarDaysIcon },
|
|
170
|
+
setup() {
|
|
171
|
+
const modelValue = ref(args.modelValue);
|
|
172
|
+
return { args, modelValue };
|
|
173
|
+
},
|
|
174
|
+
template: `<div class="max-w-xl min-h-64"><EUIDatepicker v-bind="args" /></div>`,
|
|
175
|
+
}),
|
|
176
|
+
parameters: {
|
|
177
|
+
docs: {
|
|
178
|
+
source: {
|
|
179
|
+
code: `<template>
|
|
180
|
+
<EUIDatepicker
|
|
181
|
+
v-model="datepicker"
|
|
182
|
+
:icon="CalendarDaysIcon"
|
|
183
|
+
icon-type="startIcon"
|
|
184
|
+
label="Datepicker"
|
|
185
|
+
placeholder="Select Date here..."
|
|
186
|
+
/>
|
|
187
|
+
</template>`,
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
export const IconUsingEnd: Story = {
|
|
194
|
+
args: {
|
|
195
|
+
iconType: "endIcon",
|
|
196
|
+
icon: CalendarDaysIcon,
|
|
197
|
+
},
|
|
198
|
+
render: (args) => ({
|
|
199
|
+
components: { EUIDatepicker, CalendarDaysIcon },
|
|
200
|
+
setup() {
|
|
201
|
+
const modelValue = ref(args.modelValue);
|
|
202
|
+
return { args, modelValue };
|
|
203
|
+
},
|
|
204
|
+
template: `<div class="max-w-xl min-h-64"><EUIDatepicker v-bind="args" /></div>`,
|
|
205
|
+
}),
|
|
206
|
+
parameters: {
|
|
207
|
+
docs: {
|
|
208
|
+
source: {
|
|
209
|
+
code: `<template>
|
|
210
|
+
<EUIDatepicker
|
|
211
|
+
v-model="datepicker"
|
|
212
|
+
:icon="CalendarDaysIcon"
|
|
213
|
+
icon-type="endIcon"
|
|
214
|
+
label="Datepicker"
|
|
215
|
+
placeholder="Select Date here..."
|
|
216
|
+
/>
|
|
217
|
+
</template>`,
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
export const DateSelected: Story = {
|
|
224
|
+
args: {
|
|
225
|
+
modelValue: new Date(),
|
|
226
|
+
disabled: false,
|
|
227
|
+
},
|
|
228
|
+
render: (args) => ({
|
|
229
|
+
components: { EUIDatepicker },
|
|
230
|
+
setup() {
|
|
231
|
+
const modelValue = ref(args.modelValue);
|
|
232
|
+
return { args, modelValue };
|
|
233
|
+
},
|
|
234
|
+
template: `<div class="max-w-xl"><EUIDatepicker v-bind="args" v-model="modelValue" @update:modelValue="onUpdateModelValue" /></div>`,
|
|
235
|
+
}),
|
|
236
|
+
};
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div
|
|
4
|
+
:class="disabled ? 'pointer-events-none cursor-not-allowed' : ''"
|
|
5
|
+
class="relative w-full mb-2 overflow-hidden border border-gray-100 cursor-pointer group h-14 rounded-2xl eui-datepicker"
|
|
6
|
+
>
|
|
7
|
+
<label
|
|
8
|
+
:class="[
|
|
9
|
+
getIconClass(),
|
|
10
|
+
datepicker
|
|
11
|
+
? 'top-3.5 text-xs text-gray-400 leading-none cursor-default'
|
|
12
|
+
: 'top-1/2 text-sm w-full text-gray-700 cursor-pointer h-14 pt-5 pb-4 bg-white ring-1 ring-gray-200',
|
|
13
|
+
disabled ? ' cursor-not-allowed' : '',
|
|
14
|
+
required && `after:content-['*'] after:ml-0.5 after:text-red-500`,
|
|
15
|
+
]"
|
|
16
|
+
class="absolute font-medium left-0 px-4 z-[1] -translate-y-1/2 duration-200 group-focus-within:top-3.5 group-focus-within:text-xs group-focus-within:text-gray-400 rounded-2xl group-focus-within:bg-transparent group-hover:text-xs group-focus-within:ring-transparent group-focus-within:h-auto group-focus-within:py-0 group-hover:top-3.5 group-hover:ring-0 group-hover:ring-transparent group-hover:bg-transparent group-hover:h-auto group-hover:py-0 group-focus-within:-translate-y-1/2 group-hover:-translate-y-1/2 text-start first-letter:capitalize group-hover:rounded-none group-hover:text-gray-400 group-hover:w-max group-hover:transition-colors"
|
|
17
|
+
>
|
|
18
|
+
{{ label }}
|
|
19
|
+
</label>
|
|
20
|
+
<div
|
|
21
|
+
v-if="icon && iconType"
|
|
22
|
+
class="absolute inset-y-0 z-10 flex items-center pointer-events-none"
|
|
23
|
+
:class="[
|
|
24
|
+
iconType === 'startIcon' ? 'left-0 pl-3' : 'right-0 pr-3',
|
|
25
|
+
disabled ? 'cursor-not-allowed' : '',
|
|
26
|
+
]"
|
|
27
|
+
>
|
|
28
|
+
<component
|
|
29
|
+
:is="icon"
|
|
30
|
+
class="w-6 h-6 text-gray-400"
|
|
31
|
+
aria-hidden="true"
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
<VueDatePicker
|
|
35
|
+
locale="en-US"
|
|
36
|
+
:name="name"
|
|
37
|
+
:placeholder="placeholder"
|
|
38
|
+
v-model="datepicker"
|
|
39
|
+
:value="modelValue"
|
|
40
|
+
:utc="isUtc"
|
|
41
|
+
:range="range"
|
|
42
|
+
:teleport="true"
|
|
43
|
+
:clearable="clearIcon"
|
|
44
|
+
:required="required"
|
|
45
|
+
:disabled="disabled"
|
|
46
|
+
:readonly="readonly"
|
|
47
|
+
:disabled-dates="disableDate ? disabledDates : undefined"
|
|
48
|
+
:enable-time-picker="timePicker"
|
|
49
|
+
:enable-seconds="timePicker"
|
|
50
|
+
:is-24="timePicker"
|
|
51
|
+
:dark="false"
|
|
52
|
+
:inline="false"
|
|
53
|
+
:text-input="false"
|
|
54
|
+
auto-apply
|
|
55
|
+
:hide-input-icon="true"
|
|
56
|
+
position="left"
|
|
57
|
+
/>
|
|
58
|
+
</div>
|
|
59
|
+
<EUIErrorMessage :errors="errors" :name="name" />
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
|
+
<script setup lang="ts">
|
|
64
|
+
import { computed, PropType, ref, toRefs, watch } from "vue";
|
|
65
|
+
import VueDatePicker from "@vuepic/vue-datepicker";
|
|
66
|
+
import "@vuepic/vue-datepicker/dist/main.css";
|
|
67
|
+
|
|
68
|
+
const props = defineProps({
|
|
69
|
+
modelValue: {
|
|
70
|
+
type: Date,
|
|
71
|
+
default: "",
|
|
72
|
+
},
|
|
73
|
+
name: {
|
|
74
|
+
type: String,
|
|
75
|
+
required: false,
|
|
76
|
+
default: "date-picker",
|
|
77
|
+
},
|
|
78
|
+
isUtc: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
default: true,
|
|
81
|
+
},
|
|
82
|
+
clearIcon: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: true,
|
|
85
|
+
},
|
|
86
|
+
placeholder: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: 'Choose your date',
|
|
89
|
+
},
|
|
90
|
+
label: {
|
|
91
|
+
type: String,
|
|
92
|
+
required: true,
|
|
93
|
+
default: "Datepicker",
|
|
94
|
+
},
|
|
95
|
+
iconType: {
|
|
96
|
+
type: String as PropType<"startIcon" | "endIcon">,
|
|
97
|
+
default: "",
|
|
98
|
+
},
|
|
99
|
+
icon: {
|
|
100
|
+
type: [Object, String],
|
|
101
|
+
default: "",
|
|
102
|
+
},
|
|
103
|
+
errors: { type: Object, required: false, default: () => {} },
|
|
104
|
+
timePicker: Boolean,
|
|
105
|
+
quarter: Boolean,
|
|
106
|
+
disableDate: Boolean,
|
|
107
|
+
formatDate: Boolean,
|
|
108
|
+
readonly: Boolean,
|
|
109
|
+
disabled:Boolean,
|
|
110
|
+
required: Boolean,
|
|
111
|
+
range:Boolean,
|
|
112
|
+
});
|
|
113
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
114
|
+
const { modelValue, isUtc, clearIcon } = toRefs(props);
|
|
115
|
+
const startDate = ref(new Date());
|
|
116
|
+
const endDate = ref(new Date(new Date().setDate(startDate.value.getDate() + 7)));
|
|
117
|
+
const datepicker = ref(props.modelValue ? props.modelValue : props.range ? [startDate.value, endDate.value] : startDate.value);
|
|
118
|
+
|
|
119
|
+
watch(
|
|
120
|
+
datepicker,
|
|
121
|
+
(newDate) => {
|
|
122
|
+
emit("update:modelValue", newDate);
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
const disabledDates = (date: Date) => {
|
|
127
|
+
const today = new Date();
|
|
128
|
+
today.setHours(0, 0, 0, 0);
|
|
129
|
+
return date < today;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const getIconClass = () => {
|
|
133
|
+
switch (props.iconType) {
|
|
134
|
+
case "startIcon":
|
|
135
|
+
return "pl-12 pr-4";
|
|
136
|
+
case "endIcon":
|
|
137
|
+
return "pr-12 pl-4";
|
|
138
|
+
default:
|
|
139
|
+
return "px-4";
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const iconshowLeft = computed(() => (props.iconType === 'startIcon' ? "46px" : "16px"));
|
|
144
|
+
const iconshowRight = computed(() => (props.iconType === 'endIcon' ? "46px" : "16px"));
|
|
145
|
+
const clearIconRight = computed(() => (props.iconType === 'endIcon' ? '40px' : '0px'));
|
|
146
|
+
</script>
|
|
147
|
+
|
|
148
|
+
<style lang="scss">
|
|
149
|
+
.dp__theme_light {
|
|
150
|
+
--dp-primary-color: rgba(139, 92, 246, 1);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.eui-datepicker {
|
|
154
|
+
@apply min-w-96;
|
|
155
|
+
.dp__main {
|
|
156
|
+
.dp__input {
|
|
157
|
+
@apply pb-2 pt-6 border-0 transition-colors duration-100 ease-in-out text-sm font-medium leading-6 placeholder:text-gray-400 placeholder:font-normal;
|
|
158
|
+
padding-left: v-bind(iconshowLeft);
|
|
159
|
+
padding-right: v-bind(iconshowRight);
|
|
160
|
+
}
|
|
161
|
+
.dp__input.dp__input_focus {
|
|
162
|
+
@apply ring-2 ring-purple-600 rounded-2xl ring-inset h-[3.365rem];
|
|
163
|
+
}
|
|
164
|
+
.dp--clear-btn {
|
|
165
|
+
right: v-bind(clearIconRight);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.dp__range_end,
|
|
170
|
+
.dp__range_start,
|
|
171
|
+
.dp__active_date {
|
|
172
|
+
background-color: var(--dp-primary-color);
|
|
173
|
+
color: #fff;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.dp__today {
|
|
177
|
+
border-color: var(--dp-primary-color);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.dp__action_select:hover {
|
|
181
|
+
background-color: var(--dp-primary-color);
|
|
182
|
+
color: #fff;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
</style>
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<!-- <template>
|
|
2
|
+
<div class="py-4">
|
|
3
|
+
<div
|
|
4
|
+
class="flex flex-row items-center justify-end max-w-screen-xl gap-6 mx-auto mb-10"
|
|
5
|
+
>
|
|
6
|
+
<EUISearch />
|
|
7
|
+
|
|
8
|
+
<div>
|
|
9
|
+
<EUITooltip placement="top">
|
|
10
|
+
<template v-slot:default>
|
|
11
|
+
<button class="px-4 py-2 text-white bg-gray-800 rounded">
|
|
12
|
+
Hover rihgt
|
|
13
|
+
</button>
|
|
14
|
+
</template>
|
|
15
|
+
<template v-slot:tooltip>
|
|
16
|
+
<div>You've got access to canvas. Collaborate with ChatGPT!</div>
|
|
17
|
+
</template>
|
|
18
|
+
</EUITooltip>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<EUITable
|
|
23
|
+
:checkable="true"
|
|
24
|
+
paginated
|
|
25
|
+
:checked-rows.sync="checkedRows"
|
|
26
|
+
backend-pagination
|
|
27
|
+
:per-page="limit"
|
|
28
|
+
:headers="studentHeader"
|
|
29
|
+
:items="studentData"
|
|
30
|
+
:total="totalCount"
|
|
31
|
+
:default-sort-direction="defaultSortOrder"
|
|
32
|
+
default-sort=""
|
|
33
|
+
:current-page="offset"
|
|
34
|
+
table-height="h-[calc(100svh-20rem)] max-h-[calc(100svh-20rem)]"
|
|
35
|
+
@changePage="onPageChange"
|
|
36
|
+
@changeLimit="onChangeLimit"
|
|
37
|
+
@sort="onSort"
|
|
38
|
+
@mouseenter="select"
|
|
39
|
+
@mouseleave="(selectedIndex = null), (selected = null)"
|
|
40
|
+
>
|
|
41
|
+
<template #[`item.firstName`]="{ row, rowIndex }">
|
|
42
|
+
<div class="space-y-0.5">
|
|
43
|
+
<div class="block text-sm font-medium leading-snug">
|
|
44
|
+
{{
|
|
45
|
+
capitalizeText(row?.firstName) +
|
|
46
|
+
" " +
|
|
47
|
+
capitalizeText(row?.lastName)
|
|
48
|
+
}}
|
|
49
|
+
</div>
|
|
50
|
+
<div class="text-xs font-medium text-gray-900 leading-[normal]">
|
|
51
|
+
{{ row?.referenceId }}
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</template>
|
|
55
|
+
<template #[`item.activeUser`]="{ row, rowIndex }">
|
|
56
|
+
{{ row?.activeUser?.user?.firstName }}
|
|
57
|
+
{{ row?.activeUser?.user?.lastName }}
|
|
58
|
+
</template>
|
|
59
|
+
</EUITable>
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
|
+
<script setup lang="ts">
|
|
64
|
+
import { computed, ref } from "vue";
|
|
65
|
+
import { studentData, studentHeader, tableData } from "../data/table";
|
|
66
|
+
import { capitalizeText } from "../utils/lodash";
|
|
67
|
+
import EUITable from "./table/EUITable.vue";
|
|
68
|
+
import EUITooltip from "./tooltip/EUITooltip.vue";
|
|
69
|
+
import EUISearch from "./searchInput/EUISearch.vue";
|
|
70
|
+
|
|
71
|
+
//TODO: Dashboard Table
|
|
72
|
+
const checkedRows = ref([]);
|
|
73
|
+
const defaultSortOrder = ref("asc");
|
|
74
|
+
const limit = ref(5);
|
|
75
|
+
const offset = ref(0);
|
|
76
|
+
const selectedIndex = ref(null);
|
|
77
|
+
const selected: { index: string } = { index: "" };
|
|
78
|
+
|
|
79
|
+
const totalCount = computed(() => {
|
|
80
|
+
return studentData.length;
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const select = (_item: any, index: any) => {
|
|
84
|
+
selectedIndex.value = index;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
// onChangeLimit
|
|
88
|
+
const onChangeLimit = (page: number) => {
|
|
89
|
+
limit.value = page;
|
|
90
|
+
console.log("@onChangeLimit:", page);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const onPageChange = (offsetData: number) => {
|
|
94
|
+
offset.value = offsetData;
|
|
95
|
+
console.log("@changePage:", offsetData);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const onSort = (field: string, order: string) => {
|
|
99
|
+
const modifier = order === "desc" ? -1 : 1;
|
|
100
|
+
tableData.sort((a: any, b: any) => {
|
|
101
|
+
if (a[field] < b[field]) return -1 * modifier;
|
|
102
|
+
if (a[field] > b[field]) return 1 * modifier;
|
|
103
|
+
return 0;
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
</script>
|
|
107
|
+
|
|
108
|
+
<style scoped></style> -->
|