edvoyui-component-library-test-flight 0.0.23 → 0.0.24

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.23",
4
+ "version": "0.0.24",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist/",
@@ -44,15 +44,15 @@
44
44
  "vue-tel-input": "^9.2.0"
45
45
  },
46
46
  "devDependencies": {
47
- "@storybook/addon-essentials": "^8.3.1",
48
- "@storybook/addon-interactions": "^8.3.1",
49
- "@storybook/addon-links": "^8.3.1",
50
- "@storybook/addon-onboarding": "^8.3.1",
51
- "@storybook/blocks": "^8.3.1",
52
- "@storybook/builder-vite": "^8.3.1",
53
- "@storybook/test": "^8.3.1",
54
- "@storybook/vue3": "^8.3.1",
55
- "@storybook/vue3-vite": "^8.3.1",
47
+ "@storybook/addon-essentials": "^8.4.4",
48
+ "@storybook/addon-interactions": "^8.4.4",
49
+ "@storybook/addon-links": "^8.4.4",
50
+ "@storybook/addon-onboarding": "^8.4.4",
51
+ "@storybook/blocks": "^8.4.4",
52
+ "@storybook/builder-vite": "^8.4.4",
53
+ "@storybook/test": "^8.4.4",
54
+ "@storybook/vue3": "^8.4.4",
55
+ "@storybook/vue3-vite": "^8.4.4",
56
56
  "@tailwindcss/aspect-ratio": "^0.4.2",
57
57
  "@tailwindcss/typography": "^0.5.15",
58
58
  "@types/vue-select": "^3.16.8",
@@ -60,7 +60,7 @@
60
60
  "@vitejs/plugin-vue": "^5.1.2",
61
61
  "path": "^0.12.7",
62
62
  "rollup-plugin-typescript2": "^0.36.0",
63
- "storybook": "^8.3.1",
63
+ "storybook": "^8.4.4",
64
64
  "typescript": "^5.5.3",
65
65
  "vite": "^5.4.1",
66
66
  "vite-plugin-css-injected-by-js": "^3.5.2",
@@ -39,6 +39,10 @@ const meta = {
39
39
  "Enables date range selection, allowing users to pick a start and end date.",
40
40
  defaultValue: false,
41
41
  },
42
+ timePicker: {
43
+ control: "boolean",
44
+ description: "Allows time selection in addition to the date if true.",
45
+ },
42
46
  required: {
43
47
  control: "boolean",
44
48
  description: "Marks the datepicker as a required field.",
@@ -72,11 +76,6 @@ const meta = {
72
76
  description:
73
77
  "Shows a clear icon inside the datepicker to reset the date.",
74
78
  },
75
- formatDate: {
76
- control: "boolean",
77
- description:
78
- "Formats the displayed date value; if true, a formatted date string is shown.",
79
- },
80
79
  disableDate: {
81
80
  control: "boolean",
82
81
  description:
@@ -86,9 +85,10 @@ const meta = {
86
85
  control: "boolean",
87
86
  description: "Enables quarter selection instead of date selection.",
88
87
  },
89
- timePicker: {
88
+ formatDate: {
90
89
  control: "boolean",
91
- description: "Allows time selection in addition to the date if true.",
90
+ description:
91
+ "Formats the displayed date value; if true, a formatted date string is shown.",
92
92
  },
93
93
  },
94
94
  } satisfies Meta<typeof EUIDatepicker>;
@@ -160,6 +160,50 @@ const datepickerRange = ref([new Date(), new Date(new Date().setDate(new Date().
160
160
  },
161
161
  };
162
162
 
163
+ export const TimeOnly: Story = {
164
+ args: {
165
+ placeholder: "Select your time",
166
+ label: "Time",
167
+ required: true,
168
+ timePicker: true,
169
+ errors: {
170
+ message: "Enter valid date format",
171
+ },
172
+ },
173
+ render: (args) => ({
174
+ components: { EUIDatepicker },
175
+ setup() {
176
+ const time = ref({
177
+ hours: new Date().getHours(),
178
+ minutes: new Date().getMinutes(),
179
+ });
180
+ const modelValue = ref(time);
181
+ return { args, modelValue };
182
+ },
183
+ template: `<div class="max-w-xl min-h-64"><EUIDatepicker v-bind="args" :modelValue="modelValue" /></div>`,
184
+ }),
185
+ parameters: {
186
+ docs: {
187
+ source: {
188
+ code: `<script lang="ts" setup>
189
+ const time = ref({
190
+ hours: new Date().getHours(),
191
+ minutes: new Date().getMinutes(),
192
+ });
193
+ </script>
194
+ <template>
195
+ <EUIDatepicker
196
+ v-model="time"
197
+ label="Time"
198
+ placeholder="Select your time"
199
+ :timePicker="true"
200
+ />
201
+ </template>`,
202
+ },
203
+ },
204
+ },
205
+ };
206
+
163
207
  export const IconUsingStart: Story = {
164
208
  args: {
165
209
  iconType: "startIcon",
@@ -31,7 +31,7 @@
31
31
  aria-hidden="true"
32
32
  />
33
33
  </div>
34
- <VueDatePicker
34
+ <VueDatePicker
35
35
  locale="en-US"
36
36
  :name="name"
37
37
  :placeholder="placeholder"
@@ -45,9 +45,10 @@
45
45
  :disabled="disabled"
46
46
  :readonly="readonly"
47
47
  :disabled-dates="disableDate ? disabledDates : undefined"
48
- :enable-time-picker="timePicker"
49
- :enable-seconds="timePicker"
50
- :is-24="timePicker"
48
+ :time-picker="timePicker"
49
+ :enable-time-picker="false"
50
+ :enable-seconds="false"
51
+ :is-24="false"
51
52
  :dark="false"
52
53
  :inline="false"
53
54
  :text-input="false"
@@ -67,7 +68,7 @@ import "@vuepic/vue-datepicker/dist/main.css";
67
68
 
68
69
  const props = defineProps({
69
70
  modelValue: {
70
- type: Date,
71
+ type: Date as any,
71
72
  default: "",
72
73
  },
73
74
  name: {
@@ -114,7 +115,13 @@ const emit = defineEmits(["update:modelValue"]);
114
115
  const { modelValue, isUtc, clearIcon } = toRefs(props);
115
116
  const startDate = ref(new Date());
116
117
  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
+ const time = ref({
120
+ hours: new Date().getHours(),
121
+ minutes: new Date().getMinutes()
122
+ });
123
+
124
+ const datepicker = ref( props.modelValue ? props.modelValue : props.timePicker ? time.value : props.range ? [startDate.value, endDate.value] : startDate.value);
118
125
 
119
126
  watch(
120
127
  datepicker,
@@ -151,7 +158,7 @@ const clearIconRight = computed(() => (props.iconType === 'endIcon' ? '40px' : '
151
158
  }
152
159
 
153
160
  .eui-datepicker {
154
- @apply min-w-96;
161
+ @apply min-w-56;
155
162
  .dp__main {
156
163
  .dp__input {
157
164
  @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;
@@ -19,6 +19,42 @@
19
19
  </div>
20
20
  </div>
21
21
 
22
+
23
+ <div class="grid max-w-3xl gap-4 mx-auto sm:grid-cols-3">
24
+ <div>
25
+ <EUIDatepicker
26
+ v-model:modelValue="datepickerRange"
27
+ label="Datepicker Range"
28
+ placeholder="Select Date here..."
29
+ :range="true"
30
+ required
31
+ />
32
+ </div>
33
+
34
+ <div>
35
+ <EUIDatepicker
36
+ :disabled="false"
37
+ label="Datepicker Single"
38
+ v-model:modelValue="singleDate"
39
+ placeholder="Select your date"
40
+ :readonly="false"
41
+ required
42
+ />
43
+ </div>
44
+
45
+ <div>
46
+ <EUIDatepicker
47
+ v-model:modelValue="timepicker"
48
+ :disabled="false"
49
+ label="Time Picker"
50
+ placeholder="Select your time"
51
+ :readonly="false"
52
+ required
53
+ :timePicker="true"
54
+ />
55
+ </div>
56
+ </div>
57
+
22
58
  <EUITable
23
59
  :checkable="true"
24
60
  paginated
@@ -67,6 +103,20 @@ import { capitalizeText } from "../utils/lodash";
67
103
  import EUITable from "./table/EUITable.vue";
68
104
  import EUITooltip from "./tooltip/EUITooltip.vue";
69
105
  import EUISearch from "./searchInput/EUISearch.vue";
106
+ import EUIDatepicker from "./datepicker/EUIDatepicker.vue";
107
+
108
+ // TODO: Datepicker
109
+ const datepickerRange = ref([
110
+ new Date(),
111
+ new Date(new Date().setDate(new Date().getDate() + 7)),
112
+ ]);
113
+
114
+ const singleDate = ref(new Date());
115
+
116
+ const timepicker = ref({
117
+ hours: new Date().getHours(),
118
+ minutes: new Date().getMinutes(),
119
+ });
70
120
 
71
121
  //TODO: Dashboard Table
72
122
  const checkedRows = ref([]);