sprintify-ui 0.6.61 → 0.6.63

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.
@@ -53,7 +53,7 @@ declare const _default: import("vue").DefineComponent<{
53
53
  default: boolean;
54
54
  };
55
55
  disableDates: {
56
- type: import("vue").PropType<string[] | Date[] | ((date: Date) => boolean)>;
56
+ type: import("vue").PropType<(string | Date | ((date: Date) => boolean))[]>;
57
57
  default: () => never[];
58
58
  };
59
59
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -112,7 +112,7 @@ declare const _default: import("vue").DefineComponent<{
112
112
  default: boolean;
113
113
  };
114
114
  disableDates: {
115
- type: import("vue").PropType<string[] | Date[] | ((date: Date) => boolean)>;
115
+ type: import("vue").PropType<(string | Date | ((date: Date) => boolean))[]>;
116
116
  default: () => never[];
117
117
  };
118
118
  }>> & {
@@ -131,6 +131,6 @@ declare const _default: import("vue").DefineComponent<{
131
131
  showInput: boolean;
132
132
  enableTime: boolean;
133
133
  noCalendar: boolean;
134
- disableDates: string[] | Date[] | ((date: Date) => boolean);
134
+ disableDates: (string | Date | ((date: Date) => boolean))[];
135
135
  }, {}>;
136
136
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.6.61",
3
+ "version": "0.6.63",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build-fast": "rimraf dist && vite build",
@@ -81,6 +81,26 @@ DisableDates.args = {
81
81
  ],
82
82
  };
83
83
 
84
+ const DisableMondayAndTuesdayTemplate = (args) => ({
85
+ components: { BaseDatePicker, ShowValue },
86
+ setup() {
87
+ const value = ref('2022-01-03');
88
+ const disableDates = [
89
+ (date) => {
90
+ return date.getDay() == 1 || date.getDay() == 2;
91
+ }
92
+ ]
93
+ return { value, args, disableDates };
94
+ },
95
+ template: `
96
+ <BaseDatePicker v-model="value" v-bind="args" :disableDates="disableDates">
97
+ </BaseDatePicker>
98
+ <ShowValue :value="value" />
99
+ `,
100
+ });
101
+
102
+ export const DisableMondayAndTuesday = DisableMondayAndTuesdayTemplate.bind({});
103
+
84
104
  export const RangeDisableDates = Template.bind({});
85
105
  RangeDisableDates.args = {
86
106
  disableDates: [
@@ -25,7 +25,7 @@
25
25
  >
26
26
  <div
27
27
  v-if="modelValueFormatted && !disabled && showInput"
28
- class="absolute top-0 right-0 h-full flex p-1"
28
+ :class="closeWrapClasses"
29
29
  >
30
30
  <button
31
31
  type="button"
@@ -43,7 +43,7 @@
43
43
 
44
44
  <script lang="ts" setup>
45
45
  import { Ref } from 'vue';
46
- import { isArray, isEqual } from 'lodash';
46
+ import { isArray, isEqual, size } from 'lodash';
47
47
  import { DateTime } from 'luxon';
48
48
  import { Icon as BaseIcon } from '@iconify/vue';
49
49
  import { useField } from '@/composables/field';
@@ -72,7 +72,7 @@ const props = withDefaults(
72
72
  enableTime?: boolean;
73
73
  mode?: 'single' | 'multiple' | 'range' | 'time';
74
74
  noCalendar?: boolean;
75
- disableDates?: string[] | Date[] | ((date: Date) => boolean);
75
+ disableDates?: (string | Date | ((date: Date) => boolean))[];
76
76
  }>(),
77
77
  {
78
78
  modelValue: null,
@@ -167,6 +167,7 @@ const datepicker = ref(null) as Ref<HTMLInputElement | null>;
167
167
  let picker = null as Instance | null;
168
168
 
169
169
  const flatpickrConfig = computed(() => {
170
+
170
171
  return {
171
172
  enableTime: props.enableTime,
172
173
  dateFormat: formatInternal.value,
@@ -306,7 +307,7 @@ const classes = computed(() => {
306
307
  const disabled = 'disabled:cursor-not-allowed disabled:text-slate-300';
307
308
  const sizeConfig = sizes[sizeInternal.value];
308
309
  const padding = {
309
- 'xs': 'pl-6 pr-5',
310
+ 'xs': 'pl-[1.54rem] pr-5',
310
311
  'sm': 'pl-[2.1rem] pr-6',
311
312
  'md': 'pl-10 pr-7',
312
313
  }[sizeInternal.value];
@@ -326,7 +327,8 @@ const classes = computed(() => {
326
327
  });
327
328
 
328
329
  const iconWrapClasses = computed(() => {
329
- const base = 'pointer-events-none absolute top-0 left-0 h-full flex items-center justify-center';
330
+ const base = 'pointer-events-none absolute top-0 left-0 flex items-center justify-center';
331
+ const sizeConfig = sizes[sizeInternal.value];
330
332
  const padding = {
331
333
  'xs': 'pl-2',
332
334
  'sm': 'pl-2.5',
@@ -335,10 +337,21 @@ const iconWrapClasses = computed(() => {
335
337
 
336
338
  return twMerge(
337
339
  base,
340
+ sizeConfig.height,
338
341
  padding
339
342
  );
340
343
  });
341
344
 
345
+ const closeWrapClasses = computed(() => {
346
+ const base = 'absolute top-0 right-0 flex justify-center p-1';
347
+ const sizeConfig = sizes[sizeInternal.value];
348
+
349
+ return twMerge(
350
+ base,
351
+ sizeConfig.height,
352
+ );
353
+ });
354
+
342
355
  const iconClasses = computed(() => {
343
356
  const base = '';
344
357
  const error = hasErrorInternal.value ? 'text-red-500' : 'text-slate-500';