@winchsa/ui 0.1.5 → 0.1.6

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.
@@ -11,7 +11,7 @@ const { t, locale } = useI18n();
11
11
  const { current } = useTheme();
12
12
  const props = defineProps({
13
13
  modelValue: { type: [String, Date], required: false, default: "" },
14
- format: { type: String, required: false, default: "YYYY-MM-DD" },
14
+ format: { type: String, required: false, default: "DD-MM-YYYY" },
15
15
  displayFormat: { type: String, required: false },
16
16
  label: { type: String, required: false },
17
17
  forcedLabel: { type: String, required: false },
@@ -92,7 +92,6 @@ const label = (type) => {
92
92
  :error-messages="fromErrorMessages"
93
93
  :min-date="fromMinDate"
94
94
  :max-date="maxFromDate"
95
- format="DD-MM-YYYY"
96
95
  display-format="DD/MM/YYYY"
97
96
  :label="props.label"
98
97
  :forced-label="label('from')"
@@ -116,7 +115,6 @@ const label = (type) => {
116
115
  :min-date="from || toMinDate"
117
116
  :max-date="maxToDate"
118
117
  :disabled="disableFrom"
119
- format="DD-MM-YYYY"
120
118
  display-format="DD/MM/YYYY"
121
119
  :label="props.label"
122
120
  :forced-label="label('to')"
@@ -47,6 +47,7 @@ declare const headers: import("vue").ComputedRef<{
47
47
  groupValues?: string;
48
48
  options?: Record<string, unknown>[] | import("../../types").OptionItem[] | import("vue").Ref<import("../../types").OptionItem[]>;
49
49
  disableIfEmpty?: boolean;
50
+ maxDate?: Date | null;
50
51
  }[]>;
51
52
  declare const moduleIdentifier: import("vue").ComputedRef<string>;
52
53
  declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
@@ -197,6 +197,7 @@ const placeholder = (header) => {
197
197
  :rules="header.rules"
198
198
  :clearable="header.clearable"
199
199
  :min-date="/* @__PURE__ */new Date()"
200
+ :max-date="header.maxDate"
200
201
  :disabled="isDisabled"
201
202
  :error-messages="errorMessages"
202
203
  :error="error"
@@ -201,7 +201,6 @@ watch(
201
201
  v-if="form.type === 'datepicker'"
202
202
  v-model="value[form.name]"
203
203
  show-today
204
- format="DD-MM-YYYY"
205
204
  display-format="DD/MM/YYYY"
206
205
  :label="form.label"
207
206
  :rules="form.rules"
@@ -63,7 +63,8 @@ function useTableFilters({
63
63
  const filterType = currentFilter?.type ?? "text";
64
64
  if ((filterType === "autocomplete" || filterType === "autocompleteGroups" || filterType === "select") && !currentFilter?.multiple) {
65
65
  if (typeof filterValue === "object") {
66
- queryParams[filterKey] = filterValue[currentFilter?.trackBy || "id"];
66
+ const value = Array.isArray(filterValue) ? filterValue[0] : filterValue;
67
+ queryParams[filterKey] = value[currentFilter?.trackBy || "id"];
67
68
  } else {
68
69
  queryParams[filterKey] = filterValue;
69
70
  }
@@ -57,7 +57,8 @@ export function useTableFilters({ formFilters, syncFiltersWithUrl }) {
57
57
  const filterType = currentFilter?.type ?? "text";
58
58
  if ((filterType === "autocomplete" || filterType === "autocompleteGroups" || filterType === "select") && !currentFilter?.multiple) {
59
59
  if (typeof filterValue === "object") {
60
- queryParams[filterKey] = filterValue[currentFilter?.trackBy || "id"];
60
+ const value = Array.isArray(filterValue) ? filterValue[0] : filterValue;
61
+ queryParams[filterKey] = value[currentFilter?.trackBy || "id"];
61
62
  } else {
62
63
  queryParams[filterKey] = filterValue;
63
64
  }
package/dist/types.d.ts CHANGED
@@ -143,6 +143,7 @@ export type EditableDataTableItem = {
143
143
  groupValues?: string
144
144
  options?: Record<string, unknown>[] | OptionItem[] | Ref<OptionItem[]>
145
145
  disableIfEmpty?: boolean
146
+ maxDate?: Date | null
146
147
  }
147
148
 
148
149
  export type OptionItem = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@winchsa/ui",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "publishConfig": {