@anker-in/ui 0.1.3 → 0.1.5

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/index.css CHANGED
@@ -30,4 +30,7 @@
30
30
  .antd-mobile-isolated-container .antdMobileScope [class*=adm-] {
31
31
  all: revert;
32
32
  }
33
+ .antd-mobile-isolated-container .antdMobileScope .adm-list-item-content-arrow {
34
+ display: none !important;
35
+ }
33
36
  /*# sourceMappingURL=index.css.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/DemoRoom/components/RoomsList.module.css"],"sourcesContent":["/* antd-mobile 样式隔离 - 使用更强的隔离策略 */\n.antdMobileScope {\n /* 重置所有继承样式,但保持布局相关属性 */\n all: unset;\n\n /* 恢复必要的属性 */\n display: block;\n position: absolute;\n box-sizing: border-box;\n\n /* 阻止继承字体样式 */\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n font-size: 14px;\n line-height: 1.5;\n color: #333;\n\n /* 重置 CSS 变量影响 */\n --adm-color-primary: #1677ff;\n --adm-color-text: #333333;\n --adm-font-size-main: 14px;\n}\n\n/* 确保 antd-mobile 组件内部样式正常工作 */\n.antdMobileScope *,\n.antdMobileScope *::before,\n.antdMobileScope *::after {\n box-sizing: border-box;\n}\n\n/* 阻止全局样式继承 */\n.antd-mobile-isolated-container .antdMobileScope :not([class*=\"adm-\"]) {\n all: unset;\n}\n\n/* 保持 antd-mobile 组件样式 */\n.antd-mobile-isolated-container .antdMobileScope [class*=\"adm-\"] {\n all: revert;\n}\n"],"mappings":";AACA,CAAC;AAEC,OAAK;AAGL,WAAS;AACT,YAAU;AACV,cAAY;AAGZ;AAAA,IAAa,aAAa;AAAA,IAAE,kBAAkB;AAAA,IAAE,UAAU;AAAA,IAAE,MAAM;AAAA,IAAE,gBAAgB;AAAA,IAAE,KAAK;AAAA,IAAE;AAC7F,aAAW;AACX,eAAa;AACb,SAAO;AAGP,uBAAqB;AACrB,oBAAkB;AAClB,wBAAsB;AACxB;AAGA,CAtBC,gBAsBgB;AACjB,CAvBC,gBAuBgB,CAAC;AAClB,CAxBC,gBAwBgB,CAAC;AAChB,cAAY;AACd;AAGA,CAAC,+BAA+B,CA7B/B,gBA6BgD,KAAK,CAAC;AACrD,OAAK;AACP;AAGA,CALC,+BAK+B,CAlC/B,gBAkCgD,CAAC;AAChD,OAAK;AACP;","names":[]}
1
+ {"version":3,"sources":["../src/components/DemoRoom/components/RoomsList.module.css"],"sourcesContent":["/* antd-mobile 样式隔离 - 使用更强的隔离策略 */\n.antdMobileScope {\n /* 重置所有继承样式,但保持布局相关属性 */\n all: unset;\n\n /* 恢复必要的属性 */\n display: block;\n position: absolute;\n box-sizing: border-box;\n\n /* 阻止继承字体样式 */\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n font-size: 14px;\n line-height: 1.5;\n color: #333;\n\n /* 重置 CSS 变量影响 */\n --adm-color-primary: #1677ff;\n --adm-color-text: #333333;\n --adm-font-size-main: 14px;\n}\n\n/* 确保 antd-mobile 组件内部样式正常工作 */\n.antdMobileScope *,\n.antdMobileScope *::before,\n.antdMobileScope *::after {\n box-sizing: border-box;\n}\n\n/* 阻止全局样式继承 */\n.antd-mobile-isolated-container .antdMobileScope :not([class*=\"adm-\"]) {\n all: unset;\n}\n\n/* 保持 antd-mobile 组件样式 */\n.antd-mobile-isolated-container .antdMobileScope [class*=\"adm-\"] {\n all: revert;\n}\n\n/* 隐藏 List.Item 的右侧箭头 */\n.antd-mobile-isolated-container .antdMobileScope .adm-list-item-content-arrow {\n display: none !important;\n}\n"],"mappings":";AACA,CAAC;AAEC,OAAK;AAGL,WAAS;AACT,YAAU;AACV,cAAY;AAGZ;AAAA,IAAa,aAAa;AAAA,IAAE,kBAAkB;AAAA,IAAE,UAAU;AAAA,IAAE,MAAM;AAAA,IAAE,gBAAgB;AAAA,IAAE,KAAK;AAAA,IAAE;AAC7F,aAAW;AACX,eAAa;AACb,SAAO;AAGP,uBAAqB;AACrB,oBAAkB;AAClB,wBAAsB;AACxB;AAGA,CAtBC,gBAsBgB;AACjB,CAvBC,gBAuBgB,CAAC;AAClB,CAxBC,gBAwBgB,CAAC;AAChB,cAAY;AACd;AAGA,CAAC,+BAA+B,CA7B/B,gBA6BgD,KAAK,CAAC;AACrD,OAAK;AACP;AAGA,CALC,+BAK+B,CAlC/B,gBAkCgD,CAAC;AAChD,OAAK;AACP;AAGA,CAVC,+BAU+B,CAvC/B,gBAuCgD,CAAC;AAChD,WAAS;AACX;","names":[]}
package/dist/index.d.mts CHANGED
@@ -22,6 +22,7 @@ interface BookingFormProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'o
22
22
  * 时区(可选)
23
23
  */
24
24
  timezone?: string;
25
+ pageData?: any;
25
26
  }
26
27
  declare const BookingForm: React.FC<BookingFormProps>;
27
28
 
@@ -100,14 +101,29 @@ interface CreateBookingRequest {
100
101
  interface Booking {
101
102
  booking_id: number;
102
103
  demoroom_code: string;
104
+ demoroom_name?: string;
105
+ address?: string;
106
+ equipment?: string;
107
+ latitude?: number;
108
+ longitude?: number;
109
+ timezone?: string;
103
110
  booking_date: string;
104
- booking_time: string;
111
+ booking_time?: string;
112
+ time_slot?: string;
105
113
  customer_name: string;
106
114
  customer_email: string;
115
+ phone_code?: string;
116
+ phone_number?: string;
107
117
  status: BookingStatus;
108
118
  cancel_token: string;
109
119
  created_at: string;
110
120
  }
121
+ interface GetBookingResponse {
122
+ booking: Booking;
123
+ }
124
+ interface CancelBookingResponse {
125
+ booking: Booking;
126
+ }
111
127
  declare enum ApiErrorCode {
112
128
  SUCCESS = 0,
113
129
  PARAM_ERROR = 1001,
@@ -175,58 +191,26 @@ declare class DemoRoomApiClient {
175
191
  */
176
192
  createBooking(data: CreateBookingRequest): Promise<Booking>;
177
193
  /**
178
- * 根据 token 获取预约信息
179
- * @param token 预约 token
180
- */
181
- getBooking(token: string): Promise<Booking>;
182
- }
183
- declare function createDemoRoomApi(config: DemoRoomApiConfig): DemoRoomApiClient;
184
-
185
- interface DemoRoomDetailProps extends React.HTMLAttributes<HTMLDivElement> {
186
- /**
187
- * API client for fetching demo room details
188
- */
189
- apiClient?: DemoRoomApiClient;
190
- /**
191
- * Demo room code to fetch details
192
- */
193
- demoRoomCode?: string;
194
- /**
195
- * Locale for API request
196
- */
197
- locale?: string;
198
- /**
199
- * Room title (fallback if not using API)
200
- */
201
- title?: string;
202
- /**
203
- * Room description paragraphs (fallback if not using API)
204
- */
205
- descriptions?: string[];
206
- /**
207
- * Device models available (fallback if not using API)
194
+ * 根据 token 获取预约详情(支持多语言)
195
+ * @param token 预约凭证 (cancel_token)
196
+ * @param locale 语言偏好(可选,也可以通过 Accept-Language Header)
208
197
  */
209
- devices?: string;
198
+ getBooking(token: string, locale?: string): Promise<Booking>;
210
199
  /**
211
- * Room address (fallback if not using API)
200
+ * 取消预约(支持多语言邮件通知)
201
+ * @param token 预约凭证 (cancel_token)
202
+ * @param locale 语言偏好(可选,用于邮件通知)
212
203
  */
213
- address?: string;
214
- /**
215
- * Google Maps link
216
- */
217
- mapsLink?: string;
218
- /**
219
- * Room images (fallback if not using API)
220
- */
221
- images?: string[];
204
+ cancelBooking(token: string, locale?: string): Promise<Booking>;
222
205
  }
223
- declare const DemoRoomDetail: React.FC<DemoRoomDetailProps>;
206
+ declare function createDemoRoomApi(config: DemoRoomApiConfig): DemoRoomApiClient;
224
207
 
225
208
  interface BookingSuccessProps {
226
209
  bookingData?: Booking;
227
210
  token?: string;
228
211
  apiConfig?: DemoRoomApiConfig;
229
- onBackToHome?: () => void;
212
+ onScheduleAgain?: () => void;
213
+ onCancelSuccess?: (booking: Booking) => void;
230
214
  className?: string;
231
215
  }
232
216
  declare const BookingSuccess: React.FC<BookingSuccessProps>;
@@ -277,7 +261,22 @@ declare function useCreateBooking(client: DemoRoomApiClient): {
277
261
  loading: boolean;
278
262
  error: ApiError | null;
279
263
  };
264
+ /**
265
+ * 获取预约详情 Hook
266
+ */
267
+ declare function useBooking(client: DemoRoomApiClient, token: string, locale?: string, options?: {
268
+ enabled?: boolean;
269
+ }): UseApiState<Booking>;
270
+ /**
271
+ * 取消预约 Hook
272
+ */
273
+ declare function useCancelBooking(client: DemoRoomApiClient): {
274
+ cancelBooking: (token: string, locale?: string) => Promise<Booking>;
275
+ data: Booking | null;
276
+ loading: boolean;
277
+ error: ApiError | null;
278
+ };
280
279
 
281
280
  declare function cn(...inputs: ClassValue[]): string;
282
281
 
283
- export { ApiError, ApiErrorCode, type ApiResponse, type Booking, BookingForm, type BookingFormProps, type BookingStatus, BookingSuccess, type BookingSuccessProps, type CreateBookingRequest, DemoRoomApiClient, type DemoRoomApiConfig, type DemoRoom as DemoRoomData, DemoRoomDetail, type DemoRoomDetailProps, type DemoRoomStatus, type DemoRoomType, type GetDemoRoomsResponse, type GetTimeslotsResponse, type Question, type QuestionOption, type QuestionType, type Questionnaire, type Timeslot, type TimeslotStatus, cn, createDemoRoomApi, useCreateBooking, useDemoRoom, useDemoRooms, useQuestionnaire, useTimeslots };
282
+ export { ApiError, ApiErrorCode, type ApiResponse, type Booking, BookingForm, type BookingFormProps, type BookingStatus, BookingSuccess, type BookingSuccessProps, type CancelBookingResponse, type CreateBookingRequest, DemoRoomApiClient, type DemoRoomApiConfig, type DemoRoom as DemoRoomData, type DemoRoomStatus, type DemoRoomType, type GetBookingResponse, type GetDemoRoomsResponse, type GetTimeslotsResponse, type Question, type QuestionOption, type QuestionType, type Questionnaire, type Timeslot, type TimeslotStatus, cn, createDemoRoomApi, useBooking, useCancelBooking, useCreateBooking, useDemoRoom, useDemoRooms, useQuestionnaire, useTimeslots };
package/dist/index.d.ts CHANGED
@@ -22,6 +22,7 @@ interface BookingFormProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'o
22
22
  * 时区(可选)
23
23
  */
24
24
  timezone?: string;
25
+ pageData?: any;
25
26
  }
26
27
  declare const BookingForm: React.FC<BookingFormProps>;
27
28
 
@@ -100,14 +101,29 @@ interface CreateBookingRequest {
100
101
  interface Booking {
101
102
  booking_id: number;
102
103
  demoroom_code: string;
104
+ demoroom_name?: string;
105
+ address?: string;
106
+ equipment?: string;
107
+ latitude?: number;
108
+ longitude?: number;
109
+ timezone?: string;
103
110
  booking_date: string;
104
- booking_time: string;
111
+ booking_time?: string;
112
+ time_slot?: string;
105
113
  customer_name: string;
106
114
  customer_email: string;
115
+ phone_code?: string;
116
+ phone_number?: string;
107
117
  status: BookingStatus;
108
118
  cancel_token: string;
109
119
  created_at: string;
110
120
  }
121
+ interface GetBookingResponse {
122
+ booking: Booking;
123
+ }
124
+ interface CancelBookingResponse {
125
+ booking: Booking;
126
+ }
111
127
  declare enum ApiErrorCode {
112
128
  SUCCESS = 0,
113
129
  PARAM_ERROR = 1001,
@@ -175,58 +191,26 @@ declare class DemoRoomApiClient {
175
191
  */
176
192
  createBooking(data: CreateBookingRequest): Promise<Booking>;
177
193
  /**
178
- * 根据 token 获取预约信息
179
- * @param token 预约 token
180
- */
181
- getBooking(token: string): Promise<Booking>;
182
- }
183
- declare function createDemoRoomApi(config: DemoRoomApiConfig): DemoRoomApiClient;
184
-
185
- interface DemoRoomDetailProps extends React.HTMLAttributes<HTMLDivElement> {
186
- /**
187
- * API client for fetching demo room details
188
- */
189
- apiClient?: DemoRoomApiClient;
190
- /**
191
- * Demo room code to fetch details
192
- */
193
- demoRoomCode?: string;
194
- /**
195
- * Locale for API request
196
- */
197
- locale?: string;
198
- /**
199
- * Room title (fallback if not using API)
200
- */
201
- title?: string;
202
- /**
203
- * Room description paragraphs (fallback if not using API)
204
- */
205
- descriptions?: string[];
206
- /**
207
- * Device models available (fallback if not using API)
194
+ * 根据 token 获取预约详情(支持多语言)
195
+ * @param token 预约凭证 (cancel_token)
196
+ * @param locale 语言偏好(可选,也可以通过 Accept-Language Header)
208
197
  */
209
- devices?: string;
198
+ getBooking(token: string, locale?: string): Promise<Booking>;
210
199
  /**
211
- * Room address (fallback if not using API)
200
+ * 取消预约(支持多语言邮件通知)
201
+ * @param token 预约凭证 (cancel_token)
202
+ * @param locale 语言偏好(可选,用于邮件通知)
212
203
  */
213
- address?: string;
214
- /**
215
- * Google Maps link
216
- */
217
- mapsLink?: string;
218
- /**
219
- * Room images (fallback if not using API)
220
- */
221
- images?: string[];
204
+ cancelBooking(token: string, locale?: string): Promise<Booking>;
222
205
  }
223
- declare const DemoRoomDetail: React.FC<DemoRoomDetailProps>;
206
+ declare function createDemoRoomApi(config: DemoRoomApiConfig): DemoRoomApiClient;
224
207
 
225
208
  interface BookingSuccessProps {
226
209
  bookingData?: Booking;
227
210
  token?: string;
228
211
  apiConfig?: DemoRoomApiConfig;
229
- onBackToHome?: () => void;
212
+ onScheduleAgain?: () => void;
213
+ onCancelSuccess?: (booking: Booking) => void;
230
214
  className?: string;
231
215
  }
232
216
  declare const BookingSuccess: React.FC<BookingSuccessProps>;
@@ -277,7 +261,22 @@ declare function useCreateBooking(client: DemoRoomApiClient): {
277
261
  loading: boolean;
278
262
  error: ApiError | null;
279
263
  };
264
+ /**
265
+ * 获取预约详情 Hook
266
+ */
267
+ declare function useBooking(client: DemoRoomApiClient, token: string, locale?: string, options?: {
268
+ enabled?: boolean;
269
+ }): UseApiState<Booking>;
270
+ /**
271
+ * 取消预约 Hook
272
+ */
273
+ declare function useCancelBooking(client: DemoRoomApiClient): {
274
+ cancelBooking: (token: string, locale?: string) => Promise<Booking>;
275
+ data: Booking | null;
276
+ loading: boolean;
277
+ error: ApiError | null;
278
+ };
280
279
 
281
280
  declare function cn(...inputs: ClassValue[]): string;
282
281
 
283
- export { ApiError, ApiErrorCode, type ApiResponse, type Booking, BookingForm, type BookingFormProps, type BookingStatus, BookingSuccess, type BookingSuccessProps, type CreateBookingRequest, DemoRoomApiClient, type DemoRoomApiConfig, type DemoRoom as DemoRoomData, DemoRoomDetail, type DemoRoomDetailProps, type DemoRoomStatus, type DemoRoomType, type GetDemoRoomsResponse, type GetTimeslotsResponse, type Question, type QuestionOption, type QuestionType, type Questionnaire, type Timeslot, type TimeslotStatus, cn, createDemoRoomApi, useCreateBooking, useDemoRoom, useDemoRooms, useQuestionnaire, useTimeslots };
282
+ export { ApiError, ApiErrorCode, type ApiResponse, type Booking, BookingForm, type BookingFormProps, type BookingStatus, BookingSuccess, type BookingSuccessProps, type CancelBookingResponse, type CreateBookingRequest, DemoRoomApiClient, type DemoRoomApiConfig, type DemoRoom as DemoRoomData, type DemoRoomStatus, type DemoRoomType, type GetBookingResponse, type GetDemoRoomsResponse, type GetTimeslotsResponse, type Question, type QuestionOption, type QuestionType, type Questionnaire, type Timeslot, type TimeslotStatus, cn, createDemoRoomApi, useBooking, useCancelBooking, useCreateBooking, useDemoRoom, useDemoRooms, useQuestionnaire, useTimeslots };