@bridge-ui/vue 0.12.0 → 0.14.0

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.
Files changed (153) hide show
  1. package/ai/skills/bridge-ui-components/SKILL.md +2 -1
  2. package/ai/skills/bridge-ui-forms/SKILL.md +3 -3
  3. package/dist/Adapters/Examples/date-moment.js +31 -31
  4. package/dist/Adapters/Examples/i18n-dictionary.js +14 -0
  5. package/dist/Adapters/Examples/icon-fontawesome.js +24 -22
  6. package/dist/Adapters/Examples/icon-heroicons.js +47 -45
  7. package/dist/Adapters/Examples/icon-lucide.js +13 -11
  8. package/dist/Adapters/Examples/icon-phosphor.js +49 -47
  9. package/dist/Adapters/Examples/icon-tabler.js +13 -11
  10. package/dist/Adapters/Examples/rich-text-tiptap.js +34 -41
  11. package/dist/Components/BaseField/composables/useBaseField.d.ts +3 -3
  12. package/dist/Components/BaseField/composables/useBaseField.js +7 -7
  13. package/dist/Components/Calendar/Calendar.vue.d.ts +14 -6
  14. package/dist/Components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +78 -74
  15. package/dist/Components/Calendar/calendar.types.d.ts +12 -7
  16. package/dist/Components/Calendar/composables/useCalendar.d.ts +5 -9
  17. package/dist/Components/Calendar/composables/useCalendar.js +144 -143
  18. package/dist/Components/CalendarDate/CalendarDate.vue.d.ts +14 -6
  19. package/dist/Components/CalendarDate/CalendarDate.vue_vue_type_script_setup_true_lang.js +20 -16
  20. package/dist/Components/CalendarDate/calendarDate.types.d.ts +13 -8
  21. package/dist/Components/CalendarDate/composables/useCalendarDate.d.ts +4 -8
  22. package/dist/Components/CalendarDate/composables/useCalendarDate.js +105 -105
  23. package/dist/Components/CalendarMonth/CalendarMonth.vue.d.ts +9 -2
  24. package/dist/Components/CalendarMonth/CalendarMonth.vue_vue_type_script_setup_true_lang.js +19 -12
  25. package/dist/Components/CalendarMonth/calendarMonth.types.d.ts +14 -8
  26. package/dist/Components/CalendarMonth/composables/useCalendarMonth.d.ts +4 -7
  27. package/dist/Components/CalendarMonth/composables/useCalendarMonth.js +92 -89
  28. package/dist/Components/CalendarRange/CalendarRange.vue.d.ts +14 -6
  29. package/dist/Components/CalendarRange/CalendarRange.vue_vue_type_script_setup_true_lang.js +109 -105
  30. package/dist/Components/CalendarRange/calendarRange.types.d.ts +12 -7
  31. package/dist/Components/CalendarRange/composables/useCalendarRange.d.ts +5 -9
  32. package/dist/Components/CalendarRange/composables/useCalendarRange.js +181 -154
  33. package/dist/Components/CalendarYear/CalendarYear.vue.d.ts +9 -2
  34. package/dist/Components/CalendarYear/CalendarYear.vue_vue_type_script_setup_true_lang.js +20 -13
  35. package/dist/Components/CalendarYear/calendarYear.types.d.ts +12 -6
  36. package/dist/Components/CalendarYear/composables/useCalendarYear.d.ts +4 -7
  37. package/dist/Components/CalendarYear/composables/useCalendarYear.js +91 -88
  38. package/dist/Components/Carousel/Carousel.js +5 -0
  39. package/dist/Components/Carousel/Carousel.vue.d.ts +22 -0
  40. package/dist/Components/Carousel/Carousel.vue_vue_type_script_setup_true_lang.js +49 -0
  41. package/dist/Components/Carousel/carousel.types.d.ts +236 -0
  42. package/dist/Components/Carousel/carouselInjectionKey.d.ts +48 -0
  43. package/dist/Components/Carousel/carouselInjectionKey.js +4 -0
  44. package/dist/Components/Carousel/composables/useCarousel.d.ts +91 -0
  45. package/dist/Components/Carousel/composables/useCarousel.js +331 -0
  46. package/dist/Components/Carousel/index.d.ts +4 -0
  47. package/dist/Components/Carousel/index.js +4 -0
  48. package/dist/Components/CarouselSlide/CarouselSlide.js +5 -0
  49. package/dist/Components/CarouselSlide/CarouselSlide.vue.d.ts +11 -0
  50. package/dist/Components/CarouselSlide/CarouselSlide.vue_vue_type_script_setup_true_lang.js +17 -0
  51. package/dist/Components/CarouselSlide/carouselSlide.types.d.ts +40 -0
  52. package/dist/Components/CarouselSlide/composables/useCarouselSlide.d.ts +205 -0
  53. package/dist/Components/CarouselSlide/composables/useCarouselSlide.js +79 -0
  54. package/dist/Components/CarouselSlide/index.d.ts +3 -0
  55. package/dist/Components/CarouselSlide/index.js +3 -0
  56. package/dist/Components/ColorField/ColorField.vue_vue_type_script_setup_true_lang.js +2 -2
  57. package/dist/Components/ColorPicker/ColorPicker.vue.d.ts +9 -2
  58. package/dist/Components/ColorPicker/ColorPicker.vue_vue_type_script_setup_true_lang.js +48 -44
  59. package/dist/Components/ColorPicker/colorPicker.types.d.ts +12 -7
  60. package/dist/Components/ColorPicker/composables/useColorPicker.d.ts +3 -3
  61. package/dist/Components/ColorPicker/composables/useColorPicker.js +150 -150
  62. package/dist/Components/DateField/DateField.vue_vue_type_script_setup_true_lang.js +2 -2
  63. package/dist/Components/DatePicker/DatePicker.vue.d.ts +12 -4
  64. package/dist/Components/DatePicker/DatePicker.vue_vue_type_script_setup_true_lang.js +55 -51
  65. package/dist/Components/DatePicker/composables/useDatePicker.d.ts +3 -3
  66. package/dist/Components/DatePicker/composables/useDatePicker.js +52 -25
  67. package/dist/Components/DatePicker/datePicker.types.d.ts +12 -7
  68. package/dist/Components/DateRangeField/DateRangeField.vue_vue_type_script_setup_true_lang.js +2 -2
  69. package/dist/Components/DateRangePicker/DateRangePicker.vue.d.ts +12 -4
  70. package/dist/Components/DateRangePicker/DateRangePicker.vue_vue_type_script_setup_true_lang.js +54 -50
  71. package/dist/Components/DateRangePicker/composables/useDateRangePicker.d.ts +3 -3
  72. package/dist/Components/DateRangePicker/composables/useDateRangePicker.js +26 -26
  73. package/dist/Components/DateRangePicker/dateRangePicker.types.d.ts +12 -7
  74. package/dist/Components/DateTimeField/DateTimeField.vue_vue_type_script_setup_true_lang.js +2 -2
  75. package/dist/Components/DateTimePicker/DateTimePicker.vue.d.ts +9 -2
  76. package/dist/Components/DateTimePicker/DateTimePicker.vue_vue_type_script_setup_true_lang.js +82 -78
  77. package/dist/Components/DateTimePicker/composables/useDateTimePicker.d.ts +3 -3
  78. package/dist/Components/DateTimePicker/composables/useDateTimePicker.js +64 -63
  79. package/dist/Components/DateTimePicker/dateTimePicker.types.d.ts +12 -7
  80. package/dist/Components/DateTimeRangeField/DateTimeRangeField.vue_vue_type_script_setup_true_lang.js +2 -2
  81. package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue.d.ts +12 -4
  82. package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue_vue_type_script_setup_true_lang.js +110 -106
  83. package/dist/Components/DateTimeRangePicker/composables/useDateTimeRangePicker.d.ts +3 -3
  84. package/dist/Components/DateTimeRangePicker/composables/useDateTimeRangePicker.js +71 -70
  85. package/dist/Components/DateTimeRangePicker/dateTimeRangePicker.types.d.ts +12 -7
  86. package/dist/Components/FileUpload/FileUpload.vue.d.ts +22 -24
  87. package/dist/Components/FileUpload/FileUpload.vue_vue_type_script_setup_true_lang.js +101 -92
  88. package/dist/Components/FileUpload/composables/useFileUpload.d.ts +66 -16
  89. package/dist/Components/FileUpload/composables/useFileUpload.js +182 -157
  90. package/dist/Components/FileUpload/fileUpload.types.d.ts +113 -23
  91. package/dist/Components/FileUpload/fileUploadInjectionKey.d.ts +61 -0
  92. package/dist/Components/FileUpload/fileUploadInjectionKey.js +4 -0
  93. package/dist/Components/FileUpload/index.d.ts +1 -1
  94. package/dist/Components/FileUploadItem/FileUploadItem.js +5 -0
  95. package/dist/Components/FileUploadItem/FileUploadItem.vue.d.ts +12 -0
  96. package/dist/Components/FileUploadItem/FileUploadItem.vue_vue_type_script_setup_true_lang.js +83 -0
  97. package/dist/Components/FileUploadItem/composables/useFileUploadItem.d.ts +1153 -0
  98. package/dist/Components/FileUploadItem/composables/useFileUploadItem.js +94 -0
  99. package/dist/Components/FileUploadItem/fileUploadItem.types.d.ts +20 -0
  100. package/dist/Components/FileUploadItem/index.d.ts +3 -0
  101. package/dist/Components/FileUploadItem/index.js +3 -0
  102. package/dist/Components/Pagination/composables/usePagination.d.ts +1 -1
  103. package/dist/Components/Rating/Rating.js +5 -0
  104. package/dist/Components/Rating/Rating.vue.d.ts +20 -0
  105. package/dist/Components/Rating/Rating.vue_vue_type_script_setup_true_lang.js +62 -0
  106. package/dist/Components/Rating/composables/useRating.d.ts +112 -0
  107. package/dist/Components/Rating/composables/useRating.js +190 -0
  108. package/dist/Components/Rating/index.d.ts +4 -0
  109. package/dist/Components/Rating/index.js +3 -0
  110. package/dist/Components/Rating/rating.types.d.ts +107 -0
  111. package/dist/Components/Sidebar/composables/useSidebar.js +1 -1
  112. package/dist/Components/Sidebar/composables/useSidebarTrigger.d.ts +1 -1
  113. package/dist/Components/Slider/composables/useSlider.d.ts +1 -1
  114. package/dist/Components/TimeField/TimeField.vue_vue_type_script_setup_true_lang.js +2 -2
  115. package/dist/Components/TimePanel/TimePanel.vue.d.ts +10 -2
  116. package/dist/Components/TimePanel/TimePanel.vue_vue_type_script_setup_true_lang.js +37 -34
  117. package/dist/Components/TimePanel/composables/useTimePanel.d.ts +5 -5
  118. package/dist/Components/TimePanel/composables/useTimePanel.js +108 -109
  119. package/dist/Components/TimePanel/timePanel.types.d.ts +10 -4
  120. package/dist/Components/TimePicker/TimePicker.vue.d.ts +10 -2
  121. package/dist/Components/TimePicker/TimePicker.vue_vue_type_script_setup_true_lang.js +46 -42
  122. package/dist/Components/TimePicker/composables/useTimePicker.d.ts +3 -3
  123. package/dist/Components/TimePicker/composables/useTimePicker.js +36 -36
  124. package/dist/Components/TimePicker/timePicker.types.d.ts +12 -7
  125. package/dist/Components/TimeRangeField/TimeRangeField.vue_vue_type_script_setup_true_lang.js +2 -2
  126. package/dist/Components/TimeRangePicker/TimeRangePicker.vue.d.ts +12 -4
  127. package/dist/Components/TimeRangePicker/TimeRangePicker.vue_vue_type_script_setup_true_lang.js +72 -68
  128. package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.d.ts +4 -4
  129. package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.js +87 -87
  130. package/dist/Components/TimeRangePicker/timeRangePicker.types.d.ts +12 -7
  131. package/dist/augments.d.ts +10 -1
  132. package/dist/index.d.ts +9 -1
  133. package/dist/index.js +117 -109
  134. package/docs/README.md +2 -0
  135. package/docs/components/BaseField.md +3 -3
  136. package/docs/components/Calendar.md +0 -1
  137. package/docs/components/CalendarDate.md +0 -1
  138. package/docs/components/CalendarMonth.md +0 -1
  139. package/docs/components/CalendarRange.md +0 -1
  140. package/docs/components/CalendarYear.md +0 -1
  141. package/docs/components/Carousel.md +113 -0
  142. package/docs/components/ColorPicker.md +13 -14
  143. package/docs/components/DatePicker.md +0 -1
  144. package/docs/components/DateRangePicker.md +0 -1
  145. package/docs/components/DateTimePicker.md +0 -1
  146. package/docs/components/DateTimeRangePicker.md +0 -1
  147. package/docs/components/FileUpload.md +83 -8
  148. package/docs/components/Rating.md +86 -0
  149. package/docs/components/RichTextEditor.md +3 -3
  150. package/docs/components/TimePanel.md +0 -1
  151. package/docs/components/TimePicker.md +0 -1
  152. package/docs/components/TimeRangePicker.md +0 -1
  153. package/package.json +2 -12
@@ -11,7 +11,6 @@ var D = [
11
11
  "color",
12
12
  "error",
13
13
  "range",
14
- "value",
15
14
  "classes",
16
15
  "maxDate",
17
16
  "minDate",
@@ -27,70 +26,74 @@ var D = [
27
26
  "disableYears",
28
27
  "disableMonths"
29
28
  ];
30
- function O(O, k, A) {
31
- let j = s(), M = e(), N = i(() => E({
29
+ function O(O, k, A, j) {
30
+ let M = s(), N = e(), P = i(() => E({
32
31
  bridgeKeys: D,
33
32
  props: {
34
- ...j,
33
+ ...M,
35
34
  ...o(O)
36
35
  }
37
- })), { merged: P, entry: F } = n({
36
+ })), { merged: F, entry: I } = n({
38
37
  libDefaults: k,
39
38
  componentName: "Calendar",
40
- props: () => N.value.componentProps
41
- }), I = i(() => P.value.customProps), L = i(() => d(N.value.inheritedAttrs, ["onChange", "onPreviewDateChange"])), R = r({
42
- props: () => N.value.componentProps,
39
+ props: () => P.value.componentProps
40
+ }), L = i(() => F.value.customProps), R = i(() => d(P.value.inheritedAttrs, [
41
+ "onChange",
42
+ "onPreviewDateChange",
43
+ "onUpdate:modelValue"
44
+ ])), z = r({
45
+ props: () => P.value.componentProps,
43
46
  entry: i(() => {})
44
- }), z = i(() => P.value.timeZone), B = i(() => P.value.year ?? M.value.getYear(M.value.now(z.value), z.value)), V = i(() => b({
45
- range: P.value.range,
46
- multiple: P.value.multiple
47
- })), H = i(() => !u(P.value.selection)), U = a(null), W = i(() => l(P.value.previewDate) ? U.value : P.value.previewDate), G = i(() => {
48
- let e = T(S, F.value?.tokens?.rounded);
49
- return c(e, P.value.rounded);
50
- }), K = i(() => {
51
- let e = T(x, F.value?.tokens?.color);
47
+ }), B = i(() => F.value.timeZone), V = i(() => F.value.year ?? N.value.getYear(N.value.now(B.value), B.value)), H = i(() => b({
48
+ range: F.value.range,
49
+ multiple: F.value.multiple
50
+ })), U = i(() => !u(F.value.selection)), W = a(null), G = i(() => l(F.value.previewDate) ? W.value : F.value.previewDate), K = i(() => {
51
+ let e = T(S, I.value?.tokens?.rounded);
52
+ return c(e, F.value.rounded);
53
+ }), q = i(() => {
54
+ let e = T(x, I.value?.tokens?.color);
52
55
  return w({
53
56
  tokens: e,
54
- color: P.value.color,
55
- invalid: P.value.error
57
+ color: F.value.color,
58
+ invalid: F.value.error
56
59
  });
57
- }), q = i(() => M.value.getMonthNames().map((e, t) => {
60
+ }), J = i(() => N.value.getMonthNames().map((e, t) => {
58
61
  let n = f({
59
62
  month: t,
60
- year: B.value,
61
- adapter: M.value,
62
- timeZone: z.value
63
- }), r = !!P.value.disabled || (H.value ? p(n, {
63
+ year: V.value,
64
+ adapter: N.value,
65
+ timeZone: B.value
66
+ }), r = !!F.value.disabled || (U.value ? p(n, {
64
67
  granularity: "month",
65
- adapter: M.value,
66
- timeZone: z.value,
67
- maxDate: P.value.maxDate,
68
- minDate: P.value.minDate,
69
- disableDates: P.value.disableDates,
70
- disableYears: P.value.disableYears,
71
- disableMonths: P.value.disableMonths
68
+ adapter: N.value,
69
+ timeZone: B.value,
70
+ maxDate: F.value.maxDate,
71
+ minDate: F.value.minDate,
72
+ disableDates: F.value.disableDates,
73
+ disableYears: F.value.disableYears,
74
+ disableMonths: F.value.disableMonths
72
75
  }) : _({
73
76
  month: t,
74
- year: B.value,
75
- adapter: M.value,
76
- timeZone: z.value,
77
- maxDate: P.value.maxDate,
78
- minDate: P.value.minDate,
79
- disableMonths: P.value.disableMonths
80
- })), i = H.value ? g({
77
+ year: V.value,
78
+ adapter: N.value,
79
+ timeZone: B.value,
80
+ maxDate: F.value.maxDate,
81
+ minDate: F.value.minDate,
82
+ disableMonths: F.value.disableMonths
83
+ })), i = U.value ? g({
81
84
  date: n,
82
- mode: V.value,
85
+ mode: H.value,
83
86
  granularity: "month",
84
- adapter: M.value,
85
- timeZone: z.value,
86
- value: P.value.selection ?? null
87
- }) : !l(P.value.value) && P.value.value === t, a = H.value && V.value === "range" && m({
87
+ adapter: N.value,
88
+ timeZone: B.value,
89
+ value: F.value.selection ?? null
90
+ }) : !l(A.value) && A.value === t, a = U.value && H.value === "range" && m({
88
91
  date: n,
89
92
  granularity: "month",
90
- adapter: M.value,
91
- timeZone: z.value,
92
- previewDate: W.value,
93
- value: P.value.selection ?? null
93
+ adapter: N.value,
94
+ timeZone: B.value,
95
+ previewDate: G.value,
96
+ value: F.value.selection ?? null
94
97
  });
95
98
  return {
96
99
  date: n,
@@ -99,85 +102,85 @@ function O(O, k, A) {
99
102
  state: y({
100
103
  disabled: r,
101
104
  selected: i,
102
- readOnly: P.value.readOnly
105
+ readOnly: F.value.readOnly
103
106
  }),
104
107
  preview: a,
105
108
  selected: i,
106
- disabled: r || !!P.value.readOnly
109
+ disabled: r || !!F.value.readOnly
107
110
  };
108
- })), J = (e) => {
109
- l(P.value.previewDate) && (U.value = e), A("previewDateChange", e);
110
- }, Y = i(() => {
111
- if (!H.value || V.value !== "range" || !h(P.value.selection)) return !1;
112
- let [e, t] = P.value.selection;
113
- return v(e, t, "month", M.value, z.value);
114
- }), X = (e) => {
115
- if (P.value.disabled || P.value.readOnly) return;
111
+ })), Y = (e) => {
112
+ l(F.value.previewDate) && (W.value = e), j("previewDateChange", e);
113
+ }, X = i(() => {
114
+ if (!U.value || H.value !== "range" || !h(F.value.selection)) return !1;
115
+ let [e, t] = F.value.selection;
116
+ return v(e, t, "month", N.value, B.value);
117
+ }), Z = (e) => {
118
+ if (F.value.disabled || F.value.readOnly) return;
116
119
  let t = f({
117
120
  month: e,
118
- year: B.value,
119
- adapter: M.value,
120
- timeZone: z.value
121
+ year: V.value,
122
+ adapter: N.value,
123
+ timeZone: B.value
121
124
  });
122
- if (H.value) {
125
+ if (U.value) {
123
126
  if (p(t, {
124
127
  granularity: "month",
125
- adapter: M.value,
126
- timeZone: z.value,
127
- maxDate: P.value.maxDate,
128
- minDate: P.value.minDate,
129
- disableDates: P.value.disableDates,
130
- disableYears: P.value.disableYears,
131
- disableMonths: P.value.disableMonths
128
+ adapter: N.value,
129
+ timeZone: B.value,
130
+ maxDate: F.value.maxDate,
131
+ minDate: F.value.minDate,
132
+ disableDates: F.value.disableDates,
133
+ disableYears: F.value.disableYears,
134
+ disableMonths: F.value.disableMonths
132
135
  })) return;
133
136
  } else if (_({
134
137
  month: e,
135
- year: B.value,
136
- adapter: M.value,
137
- timeZone: z.value,
138
- maxDate: P.value.maxDate,
139
- minDate: P.value.minDate,
140
- disableMonths: P.value.disableMonths
138
+ year: V.value,
139
+ adapter: N.value,
140
+ timeZone: B.value,
141
+ maxDate: F.value.maxDate,
142
+ minDate: F.value.minDate,
143
+ disableMonths: F.value.disableMonths
141
144
  })) return;
142
- A("change", e), V.value === "range" && J(null);
145
+ A.value = e, j("change", e), H.value === "range" && Y(null);
143
146
  };
144
147
  return {
145
- year: B,
146
- merged: P,
147
- months: q,
148
- rootBind: i(() => t(I.value?.root, L.value, C({
148
+ year: V,
149
+ merged: F,
150
+ months: J,
151
+ rootBind: i(() => t(L.value?.root, R.value, C({
149
152
  "flex flex-col": !0,
150
- [R.value.root ?? ""]: !0
153
+ [z.value.root ?? ""]: !0
151
154
  }))),
152
- gridBind: i(() => t(I.value?.grid, {
155
+ gridBind: i(() => t(L.value?.grid, {
153
156
  role: "grid",
154
157
  onMouseLeave: () => {
155
- Y.value && J(null);
158
+ X.value && Y(null);
156
159
  }
157
160
  }, C({
158
161
  "grid grid-cols-3 gap-2": !0,
159
- [R.value.grid ?? ""]: !0
162
+ [z.value.grid ?? ""]: !0
160
163
  }))),
161
- selectMonth: X,
164
+ selectMonth: Z,
162
165
  getMonthBind: (e) => {
163
- let n = K.value;
164
- return t(I.value?.month, {
166
+ let n = q.value;
167
+ return t(L.value?.month, {
165
168
  type: "button",
166
169
  disabled: e.disabled,
167
170
  "aria-pressed": e.selected,
168
- onClick: () => X(e.month),
171
+ onClick: () => Z(e.month),
169
172
  "data-preview": e.preview ? "" : void 0,
170
173
  onMouseEnter: () => {
171
- Y.value && !e.disabled && J(e.date);
174
+ X.value && !e.disabled && Y(e.date);
172
175
  }
173
176
  }, C({
174
177
  "cursor-pointer px-2 py-4 text-xs uppercase transition-all duration-150 ease-in-out outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed": !0,
175
- [G.value ?? ""]: !0,
178
+ [K.value ?? ""]: !0,
176
179
  [n?.soft ?? ""]: e.state === "base",
177
180
  [n?.hover ?? ""]: e.state === "base",
178
181
  [n?.selected ?? ""]: e.state === "selected",
179
182
  [n?.disabled ?? ""]: e.state === "disabled",
180
- [R.value.month ?? ""]: !0
183
+ [z.value.month ?? ""]: !0
181
184
  }));
182
185
  }
183
186
  };
@@ -1,13 +1,21 @@
1
+ import { DateRangeValue } from '@bridge-ui/core/Domain';
1
2
  import { CalendarRangeOwnProps, CalendarRangeSlots } from './calendarRange.types';
2
3
  type __VLS_Slots = CalendarRangeSlots;
3
- declare const __VLS_base: import('vue').DefineComponent<CalendarRangeOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
4
- change: (value: import('@bridge-ui/core/Domain').DateRangeValue | null) => any;
5
- viewDateChange: (date: Date) => any;
4
+ type __VLS_Props = CalendarRangeOwnProps;
5
+ type __VLS_ModelProps = {
6
+ modelValue?: null | DateRangeValue;
7
+ };
8
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
9
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
+ change: (value: DateRangeValue | null) => any;
11
+ "update:modelValue": (...args: unknown[]) => any;
6
12
  previewDateChange: (date: Date | null) => any;
7
- }, string, import('vue').PublicProps, Readonly<CalendarRangeOwnProps> & Readonly<{
8
- onChange?: ((value: import('@bridge-ui/core/Domain').DateRangeValue | null) => any) | undefined;
9
- onViewDateChange?: ((date: Date) => any) | undefined;
13
+ viewDateChange: (date: Date) => any;
14
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
15
+ onChange?: ((value: DateRangeValue | null) => any) | undefined;
16
+ "onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
10
17
  onPreviewDateChange?: ((date: Date | null) => any) | undefined;
18
+ onViewDateChange?: ((date: Date) => any) | undefined;
11
19
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
20
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
13
21
  declare const _default: typeof __VLS_export;
@@ -1,20 +1,21 @@
1
- import e from "../Icon/Icon.js";
2
- import t from "../CalendarDate/CalendarDate.js";
1
+ import { useOptionalModel as e } from "../../Utils/useOptionalModel.js";
2
+ import t from "../Icon/Icon.js";
3
+ import n from "../CalendarDate/CalendarDate.js";
3
4
  import ee from "../CalendarMonth/CalendarMonth.js";
4
- import n from "../CalendarYear/CalendarYear.js";
5
+ import te from "../CalendarYear/CalendarYear.js";
5
6
  import { useCalendarRange as r } from "./composables/useCalendarRange.js";
6
- import te from "../Divider/Divider.js";
7
- import { Fragment as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, mergeProps as f, normalizeClass as p, normalizeProps as m, openBlock as h, renderSlot as g, toDisplayString as _, toValue as v, unref as y, withCtx as b } from "vue";
8
- import { isString as ne } from "es-toolkit/compat";
9
- import { cn as re } from "@bridge-ui/core/Utils";
7
+ import ne from "../Divider/Divider.js";
8
+ import { Fragment as re, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, mergeModels as d, mergeProps as f, normalizeClass as p, normalizeProps as m, openBlock as h, ref as ie, renderSlot as g, toDisplayString as _, toValue as ae, unref as v, useModel as oe, withCtx as y } from "vue";
9
+ import { isString as b } from "es-toolkit/compat";
10
+ import { cn as x } from "@bridge-ui/core/Utils";
10
11
  //#region src/Components/CalendarRange/CalendarRange.vue?vue&type=script&setup=true&lang.ts
11
- var ie = {
12
+ var se = {
12
13
  key: 0,
13
14
  class: "grid w-full grid-cols-[1fr_auto_1fr] items-center"
14
- }, ae = { class: "flex justify-start" }, oe = { class: "flex justify-end" }, se = { class: "flex shrink-0 items-center" }, x = { class: "ml-auto" }, ce = { class: "ml-auto" }, S = { class: "flex shrink-0 items-center" }, C = { class: "flex min-w-max flex-1 items-stretch" }, w = /*@__PURE__*/ u({
15
+ }, ce = { class: "flex justify-start" }, le = { class: "flex justify-end" }, ue = { class: "flex shrink-0 items-center" }, de = { class: "ml-auto" }, fe = { class: "ml-auto" }, pe = { class: "flex shrink-0 items-center" }, me = { class: "flex min-w-max flex-1 items-stretch" }, S = /*@__PURE__*/ l({
15
16
  inheritAttrs: !1,
16
17
  __name: "CalendarRange",
17
- props: {
18
+ props: /*@__PURE__*/ d({
18
19
  classes: {},
19
20
  color: {},
20
21
  customProps: {},
@@ -39,88 +40,91 @@ var ie = {
39
40
  rounded: {},
40
41
  startOfWeek: {},
41
42
  timeZone: {},
42
- value: {},
43
43
  viewDate: {}
44
- },
45
- emits: [
44
+ }, {
45
+ modelValue: {},
46
+ modelModifiers: {}
47
+ }),
48
+ emits: /*@__PURE__*/ d([
46
49
  "change",
47
50
  "previewDateChange",
51
+ "update:modelValue",
48
52
  "viewDateChange"
49
- ],
50
- setup(u, { emit: w }) {
51
- let { view: T, value: E, shared: D, merged: O, endBind: le, rootBind: ue, bodyBind: de, viewDate: fe, viewYear: pe, startBind: me, yearLabel: k, monthLabel: A, headerBind: j, monthsBind: M, panelsBind: N, isVertical: P, endViewDate: F, previewDate: I, navIconBind: L, granularity: R, handleChange: z, yearPageSize: he, endMonthLabel: B, yearPageStart: ge, endHeaderBind: V, monthYearBind: H, nextButtonBind: U, monthPanelYear: _e, todayButtonBind: W, monthPanelValue: ve, startHeaderBind: ye, yearSelectorBind: G, handleYearSelect: be, showYearSelector: K, monthSelectorBind: q, handleMonthSelect: J, showMonthSelector: Y, previousButtonBind: X, endMonthSelectorBind: Z, handleEndViewDateChange: xe, handlePreviewDateChange: Q, handleStartViewDateChange: Se } = r(u, {
53
+ ], ["update:modelValue"]),
54
+ setup(l, { emit: d }) {
55
+ let S = d, he = oe(l, "modelValue"), C = l, ge = ie(C.defaultValue ?? null), w = e(he, ge), { view: T, shared: E, merged: D, endBind: _e, rootBind: ve, bodyBind: O, viewDate: k, viewYear: A, startBind: j, yearLabel: M, monthLabel: N, headerBind: P, monthsBind: F, panelsBind: ye, isVertical: I, endViewDate: be, previewDate: L, navIconBind: R, granularity: z, handleChange: B, yearPageSize: xe, endMonthLabel: V, yearPageStart: Se, endHeaderBind: H, monthYearBind: U, nextButtonBind: W, monthPanelYear: Ce, todayButtonBind: G, monthPanelValue: we, startHeaderBind: Te, yearSelectorBind: K, handleYearSelect: Ee, showYearSelector: q, monthSelectorBind: J, handleMonthSelect: De, showMonthSelector: Y, previousButtonBind: X, endMonthSelectorBind: Z, handleEndViewDateChange: Oe, handlePreviewDateChange: Q, handleStartViewDateChange: ke } = r(C, {
52
56
  rounded: "md",
53
57
  startOfWeek: 0,
54
58
  color: "primary",
55
59
  orientation: "horizontal"
56
- }, w);
60
+ }, w, S);
57
61
  function $(e) {
58
- let t = v(L)?.class;
59
- return re({
62
+ let t = ae(R)?.class;
63
+ return x({
60
64
  "size-3 transition-all duration-200 ease-in-out": !0,
61
- [ne(t) ? t : ""]: !0,
65
+ [b(t) ? t : ""]: !0,
62
66
  "rotate-180": e
63
67
  });
64
68
  }
65
- return (r, u) => (h(), o("div", m(d(y(ue))), [s("div", m(d(y(j))), [y(T) === "year" || y(P) && y(T) === "date" ? (h(), o("div", ie, [
66
- s("div", ae, [y(K) ? (h(), o("button", m(f({ key: 0 }, y(G))), [s("span", null, _(y(k)), 1), l(y(e), f({
69
+ return (e, r) => (h(), a("div", m(u(v(ve))), [o("div", m(u(v(P))), [v(T) === "year" || v(I) && v(T) === "date" ? (h(), a("div", se, [
70
+ o("div", ce, [v(q) ? (h(), a("button", m(f({ key: 0 }, v(K))), [o("span", null, _(v(M)), 1), c(v(t), f({
67
71
  size: "2xs",
68
72
  icon: "chevronDown"
69
- }, y(L), { class: $(y(T) === "year") }), null, 16, ["class"])], 16)) : a("", !0)]),
70
- s("div", m(d(y(M))), [y(Y) && y(T) === "date" ? (h(), o("button", m(f({ key: 0 }, y(q))), [s("span", null, _(y(A)), 1), l(y(e), f({
73
+ }, v(R), { class: $(v(T) === "year") }), null, 16, ["class"])], 16)) : i("", !0)]),
74
+ o("div", m(u(v(F))), [v(Y) && v(T) === "date" ? (h(), a("button", m(f({ key: 0 }, v(J))), [o("span", null, _(v(N)), 1), c(v(t), f({
71
75
  size: "2xs",
72
76
  icon: "chevronDown"
73
- }, y(L), { class: $(!1) }), null, 16, ["class"])], 16)) : a("", !0)], 16),
74
- s("div", oe, [s("div", se, [
75
- s("button", m(d(y(X))), [l(y(e), f({
77
+ }, v(R), { class: $(!1) }), null, 16, ["class"])], 16)) : i("", !0)], 16),
78
+ o("div", le, [o("div", ue, [
79
+ o("button", m(u(v(X))), [c(v(t), f({
76
80
  size: "sm",
77
81
  icon: "chevronLeft"
78
- }, y(L)), null, 16)], 16),
79
- s("button", m(d(y(W))), [...u[0] ||= [s("span", { class: "size-2 rounded-full bg-dark-600 dark:bg-dark-300" }, null, -1)]], 16),
80
- s("button", m(d(y(U))), [l(y(e), f({
82
+ }, v(R)), null, 16)], 16),
83
+ o("button", m(u(v(G))), [...r[0] ||= [o("span", { class: "size-2 rounded-full bg-dark-600 dark:bg-dark-300" }, null, -1)]], 16),
84
+ o("button", m(u(v(W))), [c(v(t), f({
81
85
  size: "sm",
82
86
  icon: "chevronRight"
83
- }, y(L)), null, 16)], 16)
87
+ }, v(R)), null, 16)], 16)
84
88
  ])])
85
- ])) : (h(), o(i, { key: 1 }, [s("div", m(d(y(ye))), [y(K) ? (h(), o("button", m(f({ key: 0 }, y(G))), [s("span", null, _(y(k)), 1), l(y(e), f({
89
+ ])) : (h(), a(re, { key: 1 }, [o("div", m(u(v(Te))), [v(q) ? (h(), a("button", m(f({ key: 0 }, v(K))), [o("span", null, _(v(M)), 1), c(v(t), f({
86
90
  size: "2xs",
87
91
  icon: "chevronDown"
88
- }, y(L), { class: $(!1) }), null, 16, ["class"])], 16)) : a("", !0), s("div", x, [y(Y) ? (h(), o("button", m(f({ key: 0 }, y(q))), [s("span", null, _(y(A)), 1), l(y(e), f({
92
+ }, v(R), { class: $(!1) }), null, 16, ["class"])], 16)) : i("", !0), o("div", de, [v(Y) ? (h(), a("button", m(f({ key: 0 }, v(J))), [o("span", null, _(v(N)), 1), c(v(t), f({
89
93
  size: "2xs",
90
94
  icon: "chevronDown"
91
- }, y(L), { class: $(y(T) === "month") }), null, 16, ["class"])], 16)) : a("", !0)])], 16), s("div", m(d(y(V))), [y(Y) ? (h(), o("button", m(f({ key: 0 }, y(Z))), [s("span", null, _(y(B)), 1), l(y(e), f({
95
+ }, v(R), { class: $(v(T) === "month") }), null, 16, ["class"])], 16)) : i("", !0)])], 16), o("div", m(u(v(H))), [v(Y) ? (h(), a("button", m(f({ key: 0 }, v(Z))), [o("span", null, _(v(V)), 1), c(v(t), f({
92
96
  size: "2xs",
93
97
  icon: "chevronDown"
94
- }, y(L), { class: $(y(T) === "month") }), null, 16, ["class"])], 16)) : a("", !0), s("div", ce, [s("div", S, [
95
- s("button", m(d(y(X))), [l(y(e), f({
98
+ }, v(R), { class: $(v(T) === "month") }), null, 16, ["class"])], 16)) : i("", !0), o("div", fe, [o("div", pe, [
99
+ o("button", m(u(v(X))), [c(v(t), f({
96
100
  size: "sm",
97
101
  icon: "chevronLeft"
98
- }, y(L)), null, 16)], 16),
99
- s("button", m(d(y(W))), [...u[1] ||= [s("span", { class: "size-2 rounded-full bg-dark-600 dark:bg-dark-300" }, null, -1)]], 16),
100
- s("button", m(d(y(U))), [l(y(e), f({
102
+ }, v(R)), null, 16)], 16),
103
+ o("button", m(u(v(G))), [...r[1] ||= [o("span", { class: "size-2 rounded-full bg-dark-600 dark:bg-dark-300" }, null, -1)]], 16),
104
+ o("button", m(u(v(W))), [c(v(t), f({
101
105
  size: "sm",
102
106
  icon: "chevronRight"
103
- }, y(L)), null, 16)], 16)
104
- ])])], 16)], 64))], 16), s("div", m(d(y(de))), [s("div", m(d(y(N))), [
105
- s("div", { class: p([y(P) ? "pb-2.5" : void 0, "flex min-w-max flex-1 items-stretch"]) }, [s("div", m(d(y(me))), [l(t, f(y(D), {
107
+ }, v(R)), null, 16)], 16)
108
+ ])])], 16)], 64))], 16), o("div", m(u(v(O))), [o("div", m(u(v(ye))), [
109
+ o("div", { class: p([v(I) ? "pb-2.5" : void 0, "flex min-w-max flex-1 items-stretch"]) }, [o("div", m(u(v(j))), [c(n, f(v(E), {
106
110
  range: "",
107
- value: y(E),
108
- "view-date": y(fe),
109
- onChange: y(z),
110
- "preview-date": y(I),
111
- "start-of-week": y(O).startOfWeek,
112
- "disable-dates": y(O).disableDates,
113
- "disable-years": y(O).disableYears,
114
- "hide-weekdays": y(O).hideWeekdays,
115
- "disable-months": y(O).disableMonths,
116
- "hide-outside-days": y(O).hideOutsideDays,
117
- onViewDateChange: y(Se),
118
- onPreviewDateChange: y(Q)
111
+ "model-value": v(w),
112
+ "view-date": v(k),
113
+ onChange: v(B),
114
+ "preview-date": v(L),
115
+ "start-of-week": v(D).startOfWeek,
116
+ "disable-dates": v(D).disableDates,
117
+ "disable-years": v(D).disableYears,
118
+ "hide-weekdays": v(D).hideWeekdays,
119
+ "disable-months": v(D).disableMonths,
120
+ "hide-outside-days": v(D).hideOutsideDays,
121
+ onViewDateChange: v(ke),
122
+ onPreviewDateChange: v(Q)
119
123
  }), {
120
- day: b((e) => [g(r.$slots, "day", m(d(e)), () => [c(_(e.label), 1)])]),
124
+ day: y((t) => [g(e.$slots, "day", m(u(t)), () => [s(_(t.label), 1)])]),
121
125
  _: 3
122
126
  }, 16, [
123
- "value",
127
+ "model-value",
124
128
  "view-date",
125
129
  "onChange",
126
130
  "preview-date",
@@ -132,33 +136,33 @@ var ie = {
132
136
  "hide-outside-days",
133
137
  "onViewDateChange",
134
138
  "onPreviewDateChange"
135
- ])], 16), g(r.$slots, "startAside")], 2),
136
- l(y(te), {
137
- class: p(y(P) ? "mx-2.5" : void 0),
138
- orientation: y(P) ? "horizontal" : "vertical"
139
+ ])], 16), g(e.$slots, "startAside")], 2),
140
+ c(v(ne), {
141
+ class: p(v(I) ? "mx-2.5" : void 0),
142
+ orientation: v(I) ? "horizontal" : "vertical"
139
143
  }, null, 8, ["class", "orientation"]),
140
- s("div", { class: p(["flex min-w-max flex-1 flex-col", y(P) ? "pt-2.5" : void 0]) }, [y(P) && y(T) === "date" && y(Y) ? (h(), o("div", m(f({ key: 0 }, y(V))), [s("button", m(d(y(Z))), [s("span", null, _(y(B)), 1), l(y(e), f({
144
+ o("div", { class: p(["flex min-w-max flex-1 flex-col", v(I) ? "pt-2.5" : void 0]) }, [v(I) && v(T) === "date" && v(Y) ? (h(), a("div", m(f({ key: 0 }, v(H))), [o("button", m(u(v(Z))), [o("span", null, _(v(V)), 1), c(v(t), f({
141
145
  size: "2xs",
142
146
  icon: "chevronDown"
143
- }, y(L), { class: $(!1) }), null, 16, ["class"])], 16)], 16)) : a("", !0), s("div", C, [s("div", m(d(y(le))), [l(t, f(y(D), {
147
+ }, v(R), { class: $(!1) }), null, 16, ["class"])], 16)], 16)) : i("", !0), o("div", me, [o("div", m(u(v(_e))), [c(n, f(v(E), {
144
148
  range: "",
145
- value: y(E),
146
- "view-date": y(F),
147
- onChange: y(z),
148
- "preview-date": y(I),
149
- "start-of-week": y(O).startOfWeek,
150
- "disable-dates": y(O).disableDates,
151
- "disable-years": y(O).disableYears,
152
- "hide-weekdays": y(O).hideWeekdays,
153
- "disable-months": y(O).disableMonths,
154
- "hide-outside-days": y(O).hideOutsideDays,
155
- onViewDateChange: y(xe),
156
- onPreviewDateChange: y(Q)
149
+ "model-value": v(w),
150
+ "view-date": v(be),
151
+ onChange: v(B),
152
+ "preview-date": v(L),
153
+ "start-of-week": v(D).startOfWeek,
154
+ "disable-dates": v(D).disableDates,
155
+ "disable-years": v(D).disableYears,
156
+ "hide-weekdays": v(D).hideWeekdays,
157
+ "disable-months": v(D).disableMonths,
158
+ "hide-outside-days": v(D).hideOutsideDays,
159
+ onViewDateChange: v(Oe),
160
+ onPreviewDateChange: v(Q)
157
161
  }), {
158
- day: b((e) => [g(r.$slots, "day", m(d(e)), () => [c(_(e.label), 1)])]),
162
+ day: y((t) => [g(e.$slots, "day", m(u(t)), () => [s(_(t.label), 1)])]),
159
163
  _: 3
160
164
  }, 16, [
161
- "value",
165
+ "model-value",
162
166
  "view-date",
163
167
  "onChange",
164
168
  "preview-date",
@@ -170,21 +174,21 @@ var ie = {
170
174
  "hide-outside-days",
171
175
  "onViewDateChange",
172
176
  "onPreviewDateChange"
173
- ])], 16), g(r.$slots, "endAside")])], 2)
174
- ], 16), y(T) === "month" ? (h(), o("div", {
177
+ ])], 16), g(e.$slots, "endAside")])], 2)
178
+ ], 16), v(T) === "month" ? (h(), a("div", {
175
179
  key: 0,
176
- class: p(y(H))
177
- }, [l(ee, f(y(D), {
180
+ class: p(v(U))
181
+ }, [c(ee, f(v(E), {
178
182
  range: "",
179
- year: y(_e),
180
- value: y(ve),
181
- "preview-date": y(I),
182
- onChange: y(J),
183
- "disable-dates": y(O).disableDates,
184
- "disable-years": y(O).disableYears,
185
- "disable-months": y(O).disableMonths,
186
- onPreviewDateChange: y(Q),
187
- selection: y(R) === "month" ? y(E) : void 0,
183
+ year: v(Ce),
184
+ "preview-date": v(L),
185
+ "model-value": v(we),
186
+ onChange: v(De),
187
+ "disable-dates": v(D).disableDates,
188
+ "disable-years": v(D).disableYears,
189
+ "disable-months": v(D).disableMonths,
190
+ onPreviewDateChange: v(Q),
191
+ selection: v(z) === "month" ? v(w) : void 0,
188
192
  classes: {
189
193
  root: "h-full min-h-0 flex-1",
190
194
  grid: "h-full auto-rows-fr",
@@ -192,35 +196,35 @@ var ie = {
192
196
  }
193
197
  }), null, 16, [
194
198
  "year",
195
- "value",
196
199
  "preview-date",
200
+ "model-value",
197
201
  "onChange",
198
202
  "disable-dates",
199
203
  "disable-years",
200
204
  "disable-months",
201
205
  "onPreviewDateChange",
202
206
  "selection"
203
- ])], 2)) : y(T) === "year" ? (h(), o("div", {
207
+ ])], 2)) : v(T) === "year" ? (h(), a("div", {
204
208
  key: 1,
205
- class: p(y(H))
206
- }, [l(n, f(y(D), {
209
+ class: p(v(U))
210
+ }, [c(te, f(v(E), {
207
211
  range: "",
208
- value: y(pe),
209
- "page-size": y(he),
210
- "start-year": y(ge),
211
- "preview-date": y(I),
212
- onChange: y(be),
213
- "disable-dates": y(O).disableDates,
214
- "disable-years": y(O).disableYears,
215
- onPreviewDateChange: y(Q),
216
- selection: y(R) === "year" ? y(E) : void 0,
212
+ "model-value": v(A),
213
+ "page-size": v(xe),
214
+ "start-year": v(Se),
215
+ "preview-date": v(L),
216
+ onChange: v(Ee),
217
+ "disable-dates": v(D).disableDates,
218
+ "disable-years": v(D).disableYears,
219
+ onPreviewDateChange: v(Q),
220
+ selection: v(z) === "year" ? v(w) : void 0,
217
221
  classes: {
218
222
  root: "h-full min-h-0 flex-1",
219
223
  grid: "h-full auto-rows-fr",
220
224
  year: "min-h-0"
221
225
  }
222
226
  }), null, 16, [
223
- "value",
227
+ "model-value",
224
228
  "page-size",
225
229
  "start-year",
226
230
  "preview-date",
@@ -229,8 +233,8 @@ var ie = {
229
233
  "disable-years",
230
234
  "onPreviewDateChange",
231
235
  "selection"
232
- ])], 2)) : a("", !0)], 16)], 16));
236
+ ])], 2)) : i("", !0)], 16)], 16));
233
237
  }
234
238
  });
235
239
  //#endregion
236
- export { w as default };
240
+ export { S as default };